re PR debug/83621 (ICE: in simplify_subreg, at simplify-rtx.c:6293 with -O -g)
authorJakub Jelinek <jakub@redhat.com>
Wed, 3 Jan 2018 20:59:50 +0000 (21:59 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Wed, 3 Jan 2018 20:59:50 +0000 (21:59 +0100)
PR debug/83621
* cfgexpand.c (expand_debug_expr): Return NULL if mode is
BLKmode for ternary, binary or unary expressions.

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

From-SVN: r256190

gcc/ChangeLog
gcc/cfgexpand.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/pr83621.c [new file with mode: 0644]

index 62856ceaa26ea19c60d16d479d724a71672a23fb..8df8f232d808ed22e24c85a187b742e060699561 100644 (file)
@@ -1,5 +1,9 @@
 2018-01-03  Jakub Jelinek  <jakub@redhat.com>
 
+       PR debug/83621
+       * cfgexpand.c (expand_debug_expr): Return NULL if mode is
+       BLKmode for ternary, binary or unary expressions.
+
        PR debug/83645
        * var-tracking.c (delete_vta_debug_insn): New inline function.
        (delete_vta_debug_insns): Add USE_CFG argument, if true, walk just
index a7f389447f9acf35aa4a8ff8826d646c84c939f5..257ddfc21a974b9401a63b00faa9b9a34e84ced8 100644 (file)
@@ -4208,6 +4208,8 @@ expand_debug_expr (tree exp)
 
     binary:
     case tcc_binary:
+      if (mode == BLKmode)
+       return NULL_RTX;
       op1 = expand_debug_expr (TREE_OPERAND (exp, 1));
       if (!op1)
        return NULL_RTX;
@@ -4232,6 +4234,8 @@ expand_debug_expr (tree exp)
 
     unary:
     case tcc_unary:
+      if (mode == BLKmode)
+       return NULL_RTX;
       inner_mode = TYPE_MODE (TREE_TYPE (TREE_OPERAND (exp, 0)));
       op0 = expand_debug_expr (TREE_OPERAND (exp, 0));
       if (!op0)
index e4d16a590ccc37c6c9578b65ef02ae441745596c..2c66a0d007e9e2523aa82e9bb7d7e70453e1cbbe 100644 (file)
@@ -1,5 +1,8 @@
 2018-01-03  Jakub Jelinek  <jakub@redhat.com>
 
+       PR debug/83621
+       * gcc.dg/pr83621.c: New test.
+
        PR debug/83645
        * gcc.dg/pr83645.c: New test.
 
diff --git a/gcc/testsuite/gcc.dg/pr83621.c b/gcc/testsuite/gcc.dg/pr83621.c
new file mode 100644 (file)
index 0000000..a27a0a8
--- /dev/null
@@ -0,0 +1,12 @@
+/* PR debug/83621 */
+/* { dg-do compile } */
+/* { dg-options "-O -g" } */
+
+typedef int __attribute__ ((__vector_size__ (64))) V;
+V v;
+
+void
+foo ()
+{
+  V u = v >> 1;
+}