From e47aebb33fd5372bcb437aba1cc3a078608c388d Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Fri, 9 Feb 2018 06:48:33 +0100 Subject: [PATCH] re PR debug/84252 (ICE in get_tracked_reg_offset when building libvpx for aarch64) PR debug/84252 * var-tracking.c (vt_add_function_parameter): Punt for non-onepart PARALLEL incoming that failed vt_get_decl_and_offset check. * gcc.target/aarch64/pr84252.c: New test. From-SVN: r257514 --- gcc/ChangeLog | 4 ++++ gcc/testsuite/ChangeLog | 3 +++ gcc/testsuite/gcc.target/aarch64/pr84252.c | 10 ++++++++++ gcc/var-tracking.c | 6 ++++++ 4 files changed, 23 insertions(+) create mode 100644 gcc/testsuite/gcc.target/aarch64/pr84252.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index cacb10e9a84..e1945fe1997 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,9 @@ 2018-02-09 Jakub Jelinek + PR debug/84252 + * var-tracking.c (vt_add_function_parameter): Punt for non-onepart + PARALLEL incoming that failed vt_get_decl_and_offset check. + PR middle-end/84237 * output.h (bss_initializer_p): Add NAMED argument, defaulted to false. * varasm.c (bss_initializer_p): Add NAMED argument, if true, ignore diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 0177e2b4270..12ccc313493 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,8 @@ 2018-02-09 Jakub Jelinek + PR debug/84252 + * gcc.target/aarch64/pr84252.c: New test. + PR middle-end/84237 * gcc.dg/pr84237.c: New test. diff --git a/gcc/testsuite/gcc.target/aarch64/pr84252.c b/gcc/testsuite/gcc.target/aarch64/pr84252.c new file mode 100644 index 00000000000..fc66a269d4f --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/pr84252.c @@ -0,0 +1,10 @@ +/* PR debug/84252 */ +/* { dg-do compile } */ +/* { dg-options "-g -O2" } */ + +struct S { __Int32x4_t b[2]; }; + +void +foo (struct S x) +{ +} diff --git a/gcc/var-tracking.c b/gcc/var-tracking.c index c3d4dac59ef..fb30ec223ef 100644 --- a/gcc/var-tracking.c +++ b/gcc/var-tracking.c @@ -9653,6 +9653,7 @@ vt_add_function_parameter (tree parm) poly_int64 offset; dataflow_set *out; decl_or_value dv; + bool incoming_ok = true; if (TREE_CODE (parm) != PARM_DECL) return; @@ -9743,6 +9744,7 @@ vt_add_function_parameter (tree parm) if (!vt_get_decl_and_offset (incoming, &decl, &offset)) { + incoming_ok = false; if (MEM_P (incoming)) { /* This means argument is passed by invisible reference. */ @@ -9861,6 +9863,10 @@ vt_add_function_parameter (tree parm) { int i; + /* The following code relies on vt_get_decl_and_offset returning true for + incoming, which might not be always the case. */ + if (!incoming_ok) + return; for (i = 0; i < XVECLEN (incoming, 0); i++) { rtx reg = XEXP (XVECEXP (incoming, 0, i), 0); -- 2.30.2