]> 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 09:41:13 +0000 (11:41 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Wed, 5 Jun 2019 09:41:13 +0000 (11:41 +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: r271952

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

index f5208e1d83330d5c814d460e4976f1b442309086..7c1bd52945f337447f5ae1c8ad0793b6ef78bd01 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  Richard Biener  <rguenther@suse.de>
 
        PR middle-end/90726
index 35a2d5434533abc75716476d777b714c9ec5c526..75a0f767ccf18e841625c62403697c85756afbaa 100644 (file)
@@ -1,3 +1,8 @@
+2019-06-05  Jakub Jelinek  <jakub@redhat.com>
+
+       PR debug/90733
+       * gcc.dg/pr90733.c: New test.
+
 2019-06-05  Richard Biener  <rguenther@suse.de>
 
        PR middle-end/90726
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 c9de93473d16ebd0ac081e01a575f02def51fd37..c2b4204c0cb7c0c8b49aaf622318acab7f584c04 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;