diff options
author | Jakub Jelinek <jakub@redhat.com> | 2020-03-27 10:00:47 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@redhat.com> | 2020-03-27 10:00:47 +0100 |
commit | 72809d6fe8e085440403ce125c51d01d6e7512b0 (patch) | |
tree | 58c817b44e0efb32a29324c34108ce76a61ebdfe /gcc/tree-ssa-propagate.c | |
parent | 06d5d63d9944691bb4286e5f6b2422cc97148336 (diff) | |
download | gcc-72809d6fe8e085440403ce125c51d01d6e7512b0.zip gcc-72809d6fe8e085440403ce125c51d01d6e7512b0.tar.gz gcc-72809d6fe8e085440403ce125c51d01d6e7512b0.tar.bz2 |
c++: Handle COMPOUND_EXPRs in ocp_convert [PR94339]
My recent change to get_narrower/warnings_for_convert_and_check broke
the following testcase, warnings_for_convert_and_check is upset that
expr is a COMPOUND_EXPR with INTEGER_CST at the rightmost operand, while
result is a COMPOUND_EXPR with a NOP_EXPR of INTEGER_CST at the rightmost
operand, it expects such conversions to be simplified.
The easiest fix seems to be to handle COMPOUND_EXPRs in ocp_convert too,
by converting the rightmost operand and recreating COMPOUND_EXPR(s) if that
changed.
The attr-copy-2.C change is a workaround for PR94346, where we now ICE on
the testcase, while previously we'd ICE only if it contained a comma
expression at the outer level rather than cast of a COMPOUND_EXPR to
something. I'll defer that to Martin.
2020-03-27 Jakub Jelinek <jakub@redhat.com>
PR c++/94339
* cvt.c (ocp_convert): Handle COMPOUND_EXPR by recursion on the second
operand and creating a new COMPOUND_EXPR if anything changed.
* g++.dg/other/pr94339.C: New test.
* g++.dg/ext/attr-copy-2.C: Comment out failing tests due to PR94346.
Diffstat (limited to 'gcc/tree-ssa-propagate.c')
0 files changed, 0 insertions, 0 deletions