diff options
author | Jakub Jelinek <jakub@redhat.com> | 2020-04-23 21:11:36 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@redhat.com> | 2020-04-23 21:11:36 +0200 |
commit | bca558de2a24b2a78c6a321d6cec384e07759d77 (patch) | |
tree | 001650ca80858285d7089a14cb14d6787412a3fd /gcc/combine.c | |
parent | 06eca1acafa27e19e82dc73927394a7a4d0bdbc5 (diff) | |
download | gcc-bca558de2a24b2a78c6a321d6cec384e07759d77.zip gcc-bca558de2a24b2a78c6a321d6cec384e07759d77.tar.gz gcc-bca558de2a24b2a78c6a321d6cec384e07759d77.tar.bz2 |
tree: Fix up get_narrower [PR94724]
In the recent get_narrower change, I wanted it to be efficient and avoid
recursion if there are many nested COMPOUND_EXPRs. That builds the
COMPOUND_EXPR nest with the right arguments, but as build2_loc computes some
flags like TREE_SIDE_EFFECTS, TREE_CONSTANT and TREE_READONLY, when it
is called with something that will not be the argument in the end, those
flags are computed incorrectly.
So, this patch instead uses an auto_vec and builds them in the reverse order
so when they are built, they are built with the correct operands.
2020-04-23 Jakub Jelinek <jakub@redhat.com>
PR middle-end/94724
* tree.c (get_narrower): Instead of creating COMPOUND_EXPRs
temporarily with non-final second operand and updating it later,
push COMPOUND_EXPRs into a vector and process it in reverse,
creating COMPOUND_EXPRs with the final operands.
* gcc.c-torture/execute/pr94724.c: New test.
Diffstat (limited to 'gcc/combine.c')
0 files changed, 0 insertions, 0 deletions