]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR debug/90733 (ICE in simplify_subreg, at simplify-rtx.c:6440)
authorJakub Jelinek <jakub@redhat.com>
Wed, 5 Jun 2019 12:22:22 +0000 (14:22 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Wed, 5 Jun 2019 12:22:22 +0000 (14:22 +0200)
PR debug/90733
* var-tracking.c (vt_expand_loc_callback): Don't create raw subregs
with VOIDmode inner operands.

* gcc.dg/pr90733.c: New test.

From-SVN: r271960

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/pr90733.c [new file with mode: 0644]
gcc/var-tracking.c

index a62b34e8a92c77d356bbfeb7abf941a5e89c4731..5f378bea55394a2c1ade0d2b3b6eee077a3b3b19 100644 (file)
@@ -1,3 +1,9 @@
+2019-06-05  Jakub Jelinek  <jakub@redhat.com>
+
+       PR debug/90733
+       * var-tracking.c (vt_expand_loc_callback): Don't create raw subregs
+       with VOIDmode inner operands.
+
 2019-06-05  Iain Sandoe  <iain@sandoe.co.uk>
 
        Backport from mainline.
index 2317d659f881711b1570fec7ad602422c3a7deb2..bf1b9d1bbfb1a8dfbcef4f9c52bbddd327c9b7c1 100644 (file)
@@ -1,5 +1,8 @@
 2019-06-05  Jakub Jelinek  <jakub@redhat.com>
 
+       PR debug/90733
+       * gcc.dg/pr90733.c: New test.
+
        Backported from mainline
        2019-05-29  Jakub Jelinek  <jakub@redhat.com>
 
diff --git a/gcc/testsuite/gcc.dg/pr90733.c b/gcc/testsuite/gcc.dg/pr90733.c
new file mode 100644 (file)
index 0000000..7d2a7fb
--- /dev/null
@@ -0,0 +1,22 @@
+/* PR debug/90733 */
+/* { dg-do compile } */
+/* { dg-options "-g -O2 -w" } */
+
+struct S { unsigned a : 1; };
+union U { struct S b; _Complex unsigned c; };
+
+union U
+foo (union U d)
+{
+  union U e = d;
+  return e;
+}
+
+int
+bar (void)
+{
+  union U x, y;
+  x.c = x.b.a;
+  y = foo (x);
+  return x.c != y.c;
+}
index 55ff354c37c74b269e7333a4451069be48a47f4a..96e0c93a6ca0e216ae92a00c0ffe0e537adc3e25 100644 (file)
@@ -8491,7 +8491,7 @@ vt_expand_loc_callback (rtx x, bitmap regs,
 
       /* Invalid SUBREGs are ok in debug info.  ??? We could try
         alternate expansions for the VALUE as well.  */
-      if (!result)
+      if (!result && GET_MODE (subreg) != VOIDmode)
        result = gen_rtx_raw_SUBREG (GET_MODE (x), subreg, SUBREG_BYTE (x));
 
       return result;