]> gcc.gnu.org Git - gcc.git/commitdiff
re PR rtl-optimization/77919 (ICE converting DC to V2DF mode)
authorJakub Jelinek <jakub@redhat.com>
Fri, 28 Oct 2016 08:11:57 +0000 (10:11 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Fri, 28 Oct 2016 08:11:57 +0000 (10:11 +0200)
PR rtl-optimization/77919
* expr.c (expand_expr_real_1) <normal_inner_ref>: Force CONCAT into
MEM if mode1 is not a complex mode.

* g++.dg/torture/pr77919.C: New test.

From-SVN: r241642

gcc/ChangeLog
gcc/expr.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/torture/pr77919.C [new file with mode: 0644]

index 88805bd25c91e74a968d75f8704b2cde86909a19..95da0d1abf17fe6f5dea7169fb2ceed780c8ea34 100644 (file)
@@ -1,5 +1,9 @@
 2016-10-28  Jakub Jelinek  <jakub@redhat.com>
 
+       PR rtl-optimization/77919
+       * expr.c (expand_expr_real_1) <normal_inner_ref>: Force CONCAT into
+       MEM if mode1 is not a complex mode.
+
        PR rtl-optimization/78132
        * ree.c (combine_reaching_defs): Give up if copy_needed and
        !HARD_REGNO_MODE_OK (REGNO (src_reg), dst_mode).
index 38ef07c0a0f75901be151f3bd2c42bf1198faa05..6420e278f3d198e2ef1b122e832b87c0f816b1d5 100644 (file)
@@ -10421,7 +10421,8 @@ expand_expr_real_1 (tree exp, rtx target, machine_mode tmode,
        if (GET_CODE (op0) == CONCAT && !must_force_mem)
          {
            if (bitpos == 0
-               && bitsize == GET_MODE_BITSIZE (GET_MODE (op0)))
+               && bitsize == GET_MODE_BITSIZE (GET_MODE (op0))
+               && COMPLEX_MODE_P (mode1))
              {
                if (reversep)
                  op0 = flip_storage_order (GET_MODE (op0), op0);
index 08cc8bda7cb549cf72efae0b646e47fec62eb4db..f13b2bdbba5d18582c69b1d5f67174a08b3fdfd3 100644 (file)
@@ -1,5 +1,8 @@
 2016-10-28  Jakub Jelinek  <jakub@redhat.com>
 
+       PR rtl-optimization/77919
+       * g++.dg/torture/pr77919.C: New test.
+
        PR rtl-optimization/78132
        * gcc.target/i386/pr78132.c: New test.
 
diff --git a/gcc/testsuite/g++.dg/torture/pr77919.C b/gcc/testsuite/g++.dg/torture/pr77919.C
new file mode 100644 (file)
index 0000000..cab6e90
--- /dev/null
@@ -0,0 +1,11 @@
+// PR rtl-optimization/77919
+// { dg-do compile }
+// { dg-additional-options "-Wno-psabi" }
+
+struct A { A (double) {} _Complex double i; };
+typedef int __attribute__ ((vector_size (16))) B;
+typedef struct { B b; } C;
+struct D { D (const B &x) : b (x) {} B b; };
+static inline B foo (const double *x) { C *a; a = (C *) x; return a->b; }
+static inline D baz (const A &x) { return foo ((double *) &x); }
+D b = baz (0);
This page took 0.130658 seconds and 5 git commands to generate.