Patchwork patch to fix PR58784 (ARM LRA crash)

login
register
mail settings
Submitter Steven Bosscher
Date Nov. 8, 2013, 9:29 p.m.
Message ID <CABu31nMuB=WomKDGP_rMgKqVg40_czSe1eZ5NLt9vB58QHzAGw@mail.gmail.com>
Download mbox | patch
Permalink /patch/289922/
State New
Headers show

Comments

Steven Bosscher - Nov. 8, 2013, 9:29 p.m.
On Fri, Nov 8, 2013 at 10:13 PM, Steven Bosscher wrote:
> On Thu, Nov 7, 2013 at 10:42 AM, Yvan Roux wrote:
> This store_minmaxsi insn is not recognized because
> optimize_function_for_size_p() is false. The problem is in the place
> where this insn was created. Trying to figure that out now...


LRA fails to set up cfun->maybe_hot_insn_p via rtl_profile_for_bb.

Doing that fixes the problem (diff -upbw to keep the patch small):

Patch

Index: lra.c
===================================================================
--- lra.c       (revision 204565)
+++ lra.c       (working copy)
@@ -2022,6 +2022,11 @@  check_rtl (bool final_p)

   lra_assert (! final_p || reload_completed);
   FOR_EACH_BB (bb)
+    {
+      /* Whether an insn is recognized or not may depend on the hotness of
+        the insn: Some back ends use it as a layman's "enable" attribute.  */
+      rtl_profile_for_bb (bb);
+
     FOR_BB_INSNS (bb, insn)
     if (NONDEBUG_INSN_P (insn)
        && GET_CODE (PATTERN (insn)) != USE
@@ -2043,6 +2048,7 @@  check_rtl (bool final_p)
          fatal_insn_not_found (insn);
       }
 }
+}
 #endif /* #ifdef ENABLE_CHECKING */

 /* Determine if the current function has an exception receiver block