From fc31d739fb9feeadfeb28cf795530cd1d1be2d54 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Tue, 13 Mar 2018 09:04:54 +0100 Subject: [PATCH] re PR target/84828 (ICE in verify_flow_info at gcc/cfghooks.c:265) PR target/84828 * reg-stack.c (change_stack): Change update_end var from int to rtx_insn *, if non-NULL don't update just BB_END (current_block), but also call set_block_for_insn on the newly added insns and rescan. * g++.dg/ext/pr84828.C: New test. From-SVN: r258476 --- gcc/ChangeLog | 5 +++++ gcc/reg-stack.c | 15 ++++++++++++--- gcc/testsuite/ChangeLog | 3 +++ gcc/testsuite/g++.dg/ext/pr84828.C | 13 +++++++++++++ 4 files changed, 33 insertions(+), 3 deletions(-) create mode 100644 gcc/testsuite/g++.dg/ext/pr84828.C diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 1bbeaff0c44..dd1259351ec 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,10 @@ 2018-03-13 Jakub Jelinek + PR target/84828 + * reg-stack.c (change_stack): Change update_end var from int to + rtx_insn *, if non-NULL don't update just BB_END (current_block), but + also call set_block_for_insn on the newly added insns and rescan. + PR target/84786 * config/i386/sse.md (sse2_loadhpd): Use Yv constraint rather than v on the last operand. diff --git a/gcc/reg-stack.c b/gcc/reg-stack.c index 82feb5d84a0..73bb4fcf65d 100644 --- a/gcc/reg-stack.c +++ b/gcc/reg-stack.c @@ -2489,7 +2489,7 @@ change_stack (rtx_insn *insn, stack_ptr old, stack_ptr new_stack, enum emit_where where) { int reg; - int update_end = 0; + rtx_insn *update_end = NULL; int i; /* Stack adjustments for the first insn in a block update the @@ -2511,7 +2511,7 @@ change_stack (rtx_insn *insn, stack_ptr old, stack_ptr new_stack, if (where == EMIT_AFTER) { if (current_block && BB_END (current_block) == insn) - update_end = 1; + update_end = insn; insn = NEXT_INSN (insn); } @@ -2686,7 +2686,16 @@ change_stack (rtx_insn *insn, stack_ptr old, stack_ptr new_stack, } if (update_end) - BB_END (current_block) = PREV_INSN (insn); + { + for (update_end = NEXT_INSN (update_end); update_end != insn; + update_end = NEXT_INSN (update_end)) + { + set_block_for_insn (update_end, current_block); + if (INSN_P (update_end)) + df_insn_rescan (update_end); + } + BB_END (current_block) = PREV_INSN (insn); + } } /* Print stack configuration. */ diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index faa6e338d30..7083c16cd24 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,8 @@ 2018-03-13 Jakub Jelinek + PR target/84828 + * g++.dg/ext/pr84828.C: New test. + PR target/84786 * gcc.target/i386/avx512f-pr84786-1.c: New test. * gcc.target/i386/avx512f-pr84786-2.c: New test. diff --git a/gcc/testsuite/g++.dg/ext/pr84828.C b/gcc/testsuite/g++.dg/ext/pr84828.C new file mode 100644 index 00000000000..1d36d843d2f --- /dev/null +++ b/gcc/testsuite/g++.dg/ext/pr84828.C @@ -0,0 +1,13 @@ +// PR target/84828 +// { dg-do compile { target i?86-*-* x86_64-*-* } } +// { dg-options "-Og -mno-sse2" } + +void +foo (float b, double c) +{ + for (int e = 0; e < 2; e++) + { + asm volatile ("" : "+f" (c)); // { dg-error "must specify a single register" } + asm ("" : "+rm" (c = b)); + } +} -- 2.30.2