RFA: one more version of the patch for PR61360

Vladimir Makarov vmakarov@redhat.com
Fri Sep 26 20:32:00 GMT 2014


I guess we achieved the consensus about the following patch to fix PR61360

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61360

The patch was successfully bootstrapped and tested (w/wo 
-march=amdfam10) on x86/x86-64.

Is it ok to commit to trunk?

2014-09-26  Vladimir Makarov  <vmakarov@redhat.com>

         PR target/61360
         * lra.c (lra): Remove call of recog_init.
         * recog.c (constrain_operands): Permit reg for memory constraint
         when LRA is used.
         * config/i386/i386.md (*float<SWI48:mode><MODEF:mode>2_sse):
         Enable first alternative independently on RA stage.
-------------- next part --------------
Index: config/i386/i386.md
===================================================================
--- config/i386/i386.md	(revision 215337)
+++ config/i386/i386.md	(working copy)
@@ -4796,13 +4796,8 @@
                            && X87_ENABLE_FLOAT (<MODEF:MODE>mode,
                                                 <SWI48:MODE>mode)")
             (eq_attr "alternative" "1")
-              /* ??? For sched1 we need constrain_operands to be able to
-                 select an alternative.  Leave this enabled before RA.  */
               (symbol_ref "TARGET_INTER_UNIT_CONVERSIONS
-                           || optimize_function_for_size_p (cfun)
-                           || !(reload_completed
-                                || reload_in_progress
-                                || lra_in_progress)")
+                           || optimize_function_for_size_p (cfun)")
            ]
            (symbol_ref "true")))
    ])
Index: lra.c
===================================================================
--- lra.c	(revision 215358)
+++ lra.c	(working copy)
@@ -2135,11 +2135,6 @@ lra (FILE *f)
 
   lra_in_progress = 1;
 
-  /* The enable attributes can change their values as LRA starts
-     although it is a bad practice.  To prevent reuse of the outdated
-     values, clear them.  */
-  recog_init ();
-
   lra_live_range_iter = lra_coalesce_iter = 0;
   lra_constraint_iter = lra_constraint_iter_after_spill = 0;
   lra_inheritance_iter = lra_undo_inheritance_iter = 0;
Index: recog.c
===================================================================
--- recog.c	(revision 215337)
+++ recog.c	(working copy)
@@ -2639,7 +2639,10 @@ constrain_operands (int strict)
 			       || (strict < 0 && CONSTANT_P (op))
 			       /* During reload, accept a pseudo  */
 			       || (reload_in_progress && REG_P (op)
-				   && REGNO (op) >= FIRST_PSEUDO_REGISTER)))
+				   && REGNO (op) >= FIRST_PSEUDO_REGISTER)
+			       /* LRA can put reg value into memory if
+				  it is necessary.  */
+			       || (strict <= 0 && targetm.lra_p () && REG_P (op))))
 		    win = 1;
 		  else if (insn_extra_address_constraint (cn)
 			   /* Every address operand can be reloaded to fit.  */


More information about the Gcc-patches mailing list