From d301c1a41d7ee2dd35aac12bda09c8ced73a36f6 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Wed, 5 Jun 2019 11:41:13 +0200 Subject: [PATCH] re PR debug/90733 (ICE in simplify_subreg, at simplify-rtx.c:6440) 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 | 6 ++++++ gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.dg/pr90733.c | 22 ++++++++++++++++++++++ gcc/var-tracking.c | 2 +- 4 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/gcc.dg/pr90733.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index f5208e1d833..7c1bd52945f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2019-06-05 Jakub Jelinek + + PR debug/90733 + * var-tracking.c (vt_expand_loc_callback): Don't create raw subregs + with VOIDmode inner operands. + 2019-06-05 Richard Biener PR middle-end/90726 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 35a2d543453..75a0f767ccf 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2019-06-05 Jakub Jelinek + + PR debug/90733 + * gcc.dg/pr90733.c: New test. + 2019-06-05 Richard Biener PR middle-end/90726 diff --git a/gcc/testsuite/gcc.dg/pr90733.c b/gcc/testsuite/gcc.dg/pr90733.c new file mode 100644 index 00000000000..7d2a7fb559a --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr90733.c @@ -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; +} diff --git a/gcc/var-tracking.c b/gcc/var-tracking.c index c9de93473d1..c2b4204c0cb 100644 --- a/gcc/var-tracking.c +++ b/gcc/var-tracking.c @@ -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; -- 2.30.2