re PR middle-end/31344 (bootstrap broken on i[345]86-linux)
authorUros Bizjak <ubizjak@gmail.com>
Fri, 18 May 2007 08:37:03 +0000 (10:37 +0200)
committerUros Bizjak <uros@gcc.gnu.org>
Fri, 18 May 2007 08:37:03 +0000 (10:37 +0200)
PR rtl-optimization/31344
* expr.c (emit_move_change_mode): Change mode of push operands here.

testsuite/ChangeLog:

PR rtl-optimization/31344
* gcc.dg/pr31344.c: New test.

From-SVN: r124825

gcc/ChangeLog
gcc/expr.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/pr31344.c [new file with mode: 0644]

index cbe76f8..4756ff8 100644 (file)
@@ -1,3 +1,8 @@
+2007-05-18  Uros Bizjak  <ubizjak@gmail.com>
+
+       PR rtl-optimization/31344
+       * expr.c (emit_move_change_mode): Change mode of push operands here.
+
 2007-05-17  Ian Lance Taylor  <iant@google.com>
 
        PR tree-optimization/31953
index 9286ffa..8c4b03d 100644 (file)
@@ -2867,7 +2867,12 @@ emit_move_change_mode (enum machine_mode new_mode,
 {
   rtx ret;
 
-  if (MEM_P (x))
+  if (push_operand (x, GET_MODE (x)))
+    {
+      ret = gen_rtx_MEM (new_mode, XEXP (x, 0));
+      MEM_COPY_ATTRIBUTES (ret, x);
+    }
+  else if (MEM_P (x))
     {
       /* We don't have to worry about changing the address since the
         size in bytes is supposed to be the same.  */
index 96b7c39..75b2d53 100644 (file)
@@ -1,3 +1,8 @@
+2007-05-18  Uros Bizjak  <ubizjak@gmail.com>
+
+       PR rtl-optimization/31344
+       * gcc.dg/pr31344.c: New test.
+
 2007-05-17  Ian Lance Taylor  <iant@google.com>
 
        PR tree-optimization/31953
diff --git a/gcc/testsuite/gcc.dg/pr31344.c b/gcc/testsuite/gcc.dg/pr31344.c
new file mode 100644 (file)
index 0000000..a01439b
--- /dev/null
@@ -0,0 +1,25 @@
+/* { dg-do compile { target dfp } } */
+/* { dg-options "-O -std=gnu99 -mtune=i386" { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
+/* { dg-options "-O -std=gnu99" } */
+
+typedef struct
+{
+  unsigned char bits;
+} decNumber;
+
+typedef struct
+{
+  unsigned char bytes[1];
+} decimal32;
+
+extern decNumber *__decimal32ToNumber (const decimal32 *, decNumber *);
+extern void __host_to_ieee_32 (_Decimal32, decimal32 *);
+
+void
+foo (_Decimal32 arg)
+{
+  decNumber dn;
+  decimal32 d32;
+  __host_to_ieee_32 (arg, &d32);
+  __decimal32ToNumber (&d32, &dn);
+}