diff mbox

patch to fix PR57960

Message ID 51F13E8D.8070200@redhat.com
State New
Headers show

Commit Message

Vladimir Makarov July 25, 2013, 3:04 p.m. UTC
The following patch fixes

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57960

The patch was successfully bootstrapped and tested on s390 and x86/x86-64.

Committed as rev. 201243.

2013-07-25  Vladimir Makarov  <vmakarov@redhat.com>

        PR rtl-optimization/57960
        * lra-constraints.c (process_alt_operands): Use the right mode
        when checking strict_low.

2013-07-25  Vladimir Makarov  <vmakarov@redhat.com>

        PR rtl-optimization/57960
        * gcc.target/s390/pr57960.c: New.
diff mbox

Patch

Index: lra-constraints.c
===================================================================
--- lra-constraints.c	(revision 201215)
+++ lra-constraints.c	(working copy)
@@ -1940,7 +1940,8 @@  process_alt_operands (int only_alternati
 		      && ira_class_hard_regs_num[this_alternative] > 0
 		      && ! HARD_REGNO_MODE_OK (ira_class_hard_regs
 					       [this_alternative][0],
-					       GET_MODE (op)))
+					       GET_MODE
+					       (*curr_id->operand_loc[nop])))
 		    goto fail;
 		  losers++;
 		}
Index: testsuite/gcc.target/s390/pr57960.c
===================================================================
--- testsuite/gcc.target/s390/pr57960.c	(revision 0)
+++ testsuite/gcc.target/s390/pr57960.c	(working copy)
@@ -0,0 +1,30 @@ 
+/* PR rtl-optimization/57960  */
+
+/* { dg-do compile } */
+/* { dg-options "-march=z10 -m64 -mzarch  -O1" } */
+
+typedef union
+{
+  long double value;
+  struct
+  {
+    unsigned int w0, w1, w2, w3;
+  }
+    parts32;
+}
+  ieee854_long_double_shape_type;
+static const long double one = 1.0L;
+long double
+__ieee754_acosl (long double x)
+{
+  long double z, w;
+  int ix;
+  ieee854_long_double_shape_type u;
+
+  z = (one - u.value) * 0.5;
+  u.parts32.w2 = 0;
+  u.parts32.w3 = 0;
+  w = z - u.value * u.value;
+  return 2.0 * w;
+
+}