From e3bd17639b20e009238b15b2354bb0e87e29703e Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Wed, 3 Jan 2018 21:59:50 +0100 Subject: [PATCH] re PR debug/83621 (ICE: in simplify_subreg, at simplify-rtx.c:6293 with -O -g) 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 | 4 ++++ gcc/cfgexpand.c | 4 ++++ gcc/testsuite/ChangeLog | 3 +++ gcc/testsuite/gcc.dg/pr83621.c | 12 ++++++++++++ 4 files changed, 23 insertions(+) create mode 100644 gcc/testsuite/gcc.dg/pr83621.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 62856ceaa26..8df8f232d80 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,9 @@ 2018-01-03 Jakub Jelinek + 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 diff --git a/gcc/cfgexpand.c b/gcc/cfgexpand.c index a7f389447f9..257ddfc21a9 100644 --- a/gcc/cfgexpand.c +++ b/gcc/cfgexpand.c @@ -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) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index e4d16a590cc..2c66a0d007e 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,8 @@ 2018-01-03 Jakub Jelinek + 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 index 00000000000..a27a0a81a61 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr83621.c @@ -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; +} -- 2.30.2