re PR rtl-optimization/6177 (ia64 ICE with single-element complex array in LAPACK)
authorJakub Jelinek <jakub@redhat.com>
Thu, 11 Apr 2002 21:04:09 +0000 (23:04 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Thu, 11 Apr 2002 21:04:09 +0000 (23:04 +0200)
PR optimization/6177
* expr.c (expand_expr) [COMPONENT_REF]: Handle op0 CONCAT if
bitpos is 0 and bitsize CONCAT size.

* gcc.c-torture/execute/20020411-1.c: New test.

From-SVN: r52178

gcc/ChangeLog
gcc/expr.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/execute/20020411-1.c [new file with mode: 0644]

index 34c0f0faef50401dbe257d5c2cb5888c65a34618..58f921dec24fe9af52cc58d4ccbe311aafcd6885 100644 (file)
@@ -1,3 +1,9 @@
+2002-04-11  Jakub Jelinek  <jakub@redhat.com>
+
+       PR optimization/6177
+       * expr.c (expand_expr) [COMPONENT_REF]: Handle op0 CONCAT if
+       bitpos is 0 and bitsize CONCAT size.
+
 2002-04-11  Jakub Jelinek  <jakub@redhat.com>
 
        PR c/6223
index 3e0add257f769f79e9197b3e631dd483b51a8714..a9ca3f6613bf7e1097608df2de86faa6722d3b8b 100644 (file)
@@ -6954,6 +6954,16 @@ expand_expr (exp, target, tmode, modifier)
            MEM_VOLATILE_P (op0) = 1;
          }
 
+       /* The following code doesn't handle CONCAT.
+          Assume only bitpos == 0 can be used for CONCAT, due to
+          one element arrays having the same mode as its element.  */
+       if (GET_CODE (op0) == CONCAT)
+         {
+           if (bitpos != 0 || bitsize != GET_MODE_BITSIZE (GET_MODE (op0)))
+             abort ();
+           return op0;
+         }
+
        /* In cases where an aligned union has an unaligned object
           as a field, we might be extracting a BLKmode value from
           an integer-mode (e.g., SImode) object.  Handle this case
index df40cb497fc22634c0b2dfb40a879e28d1dc9524..ccabe18f899627cdbeaee48038ed3bf6c1468f32 100644 (file)
@@ -1,10 +1,9 @@
 2002-04-11  Jakub Jelinek  <jakub@redhat.com>
 
-       PR c/6223
-       * combine.c (if_then_else_cond): Use trunc_int_for_mode on nz.
-
        * gcc.dg/20020411-1.c: New test.
 
+       * gcc.c-torture/execute/20020411-1.c: New test.
+
 2002-04-10  Janis Johnson  <janis187@us.ibm.com>
 
        * g77.f-torture/execute/6177.f: New test.
diff --git a/gcc/testsuite/gcc.c-torture/execute/20020411-1.c b/gcc/testsuite/gcc.c-torture/execute/20020411-1.c
new file mode 100644 (file)
index 0000000..89e2bae
--- /dev/null
@@ -0,0 +1,25 @@
+/* PR optimization/6177
+   This testcase ICEd because expr.c did not expect to see a CONCAT
+   as array rtl.  */
+
+extern void abort (void);
+extern void exit (int);
+
+__complex__ float foo (void)
+{
+  __complex__ float f[1];
+  __real__ f[0] = 1.0;
+  __imag__ f[0] = 1.0;
+  f[0] = __builtin_conjf (f[0]);
+  return f[0];
+}
+
+int main (void)
+{
+  __complex__ double d[1];
+  d[0] = foo ();
+  if (__real__ d[0] != 1.0
+      || __imag__ d[0] != -1.0)
+    abort ();
+  exit (0);
+}