lra.c (lra): Remove call to recog_init.
authorRichard Sandiford <richard.sandiford@arm.com>
Wed, 22 Oct 2014 12:03:00 +0000 (12:03 +0000)
committerRichard Sandiford <rsandifo@gcc.gnu.org>
Wed, 22 Oct 2014 12:03:00 +0000 (12:03 +0000)
gcc/
* lra.c (lra): Remove call to recog_init.
* config/i386/i386.md (preferred_for_speed): New attribute
(*float<SWI48:mode><MODEF:mode>2_sse): Override it instead of
"enabled".  Remove check for sched1.

gcc/testsuite/
* gcc.target/i386/conversion-2.c: New test.

From-SVN: r216557

gcc/ChangeLog
gcc/config/i386/i386.md
gcc/lra.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/i386/conversion-2.c [new file with mode: 0644]

index 6b23954b5e7608b66bd39080053b6f2839c585b6..e34b69801105795c21a37852adb386e292a53056 100644 (file)
@@ -1,3 +1,10 @@
+2014-10-22  Richard Sandiford  <richard.sandiford@arm.com>
+
+       * lra.c (lra): Remove call to recog_init.
+       * config/i386/i386.md (preferred_for_speed): New attribute
+       (*float<SWI48:mode><MODEF:mode>2_sse): Override it instead of
+       "enabled".  Remove check for sched1.
+
 2014-10-22  Richard Sandiford  <richard.sandiford@arm.com>
 
        * recog.h (recog_data_d): Remove enabled_alternatives.
index 624a1c1468bf243a7a650dfbf4ea06347a94e15b..7ba07c3ae7cbb7838c53ee976aa5b12b2c227385 100644 (file)
        ]
        (const_int 1)))
 
+(define_attr "preferred_for_speed" "" (const_int 1))
+
 ;; Describe a user's asm statement.
 (define_asm_attributes
   [(set_attr "length" "128")
               (symbol_ref "TARGET_MIX_SSE_I387
                            && 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)")
            ]
            (symbol_ref "true")))
+   (set (attr "preferred_for_speed")
+     (cond [(eq_attr "alternative" "1")
+              (symbol_ref "TARGET_INTER_UNIT_CONVERSIONS")]
+           (symbol_ref "true")))
    ])
 
 (define_insn "*float<SWI48x:mode><MODEF:mode>2_i387"
index 22226361e64a3e1c8a56501d3eef8cf936fc0a7b..dfca2df22916aa2f19fd7ae3cd59ca77a97af3ee 100644 (file)
--- a/gcc/lra.c
+++ b/gcc/lra.c
@@ -2120,11 +2120,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 = lra_constraint_iter = 0;
   lra_assignment_iter = lra_assignment_iter_after_spill = 0;
   lra_inheritance_iter = lra_undo_inheritance_iter = 0;
index 49e2537d51de1de133ca6b309f7054a8781c3395..964037a1e966736a94275e7c04467786ef6e8fd7 100644 (file)
@@ -1,3 +1,7 @@
+2014-10-22  Richard Sandiford  <richard.sandiford@arm.com>
+
+       * gcc.target/i386/conversion-2.c: New test.
+
 2014-10-22  Jakub Jelinek  <jakub@redhat.com>
            Yury Gribov  <y.gribov@samsung.com>
 
diff --git a/gcc/testsuite/gcc.target/i386/conversion-2.c b/gcc/testsuite/gcc.target/i386/conversion-2.c
new file mode 100644 (file)
index 0000000..cca149a
--- /dev/null
@@ -0,0 +1,36 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fno-toplevel-reorder -mtune=bdver2" } */
+/* { dg-additional-options "-mregparm=1 -msse -mfpmath=sse" { target ia32 } } */
+
+void __attribute__ ((hot))
+f1 (int x)
+{
+  register float f asm ("%xmm0") = x;
+  asm volatile ("" :: "x" (f));
+}
+
+void __attribute__ ((cold))
+f2 (int x)
+{
+  register float f asm ("%xmm1") = x;
+  asm volatile ("" :: "x" (f));
+}
+
+void __attribute__ ((hot))
+f3 (int x)
+{
+  register float f asm ("%xmm2") = x;
+  asm volatile ("" :: "x" (f));
+}
+
+void __attribute__ ((cold))
+f4 (int x)
+{
+  register float f asm ("%xmm3") = x;
+  asm volatile ("" :: "x" (f));
+}
+
+/* { dg-final { scan-assembler "sp\\\), %xmm0" } } */
+/* { dg-final { scan-assembler "(ax|di), %xmm1" } } */
+/* { dg-final { scan-assembler "sp\\\), %xmm2" } } */
+/* { dg-final { scan-assembler "(ax|di), %xmm3" } } */