diff options
author | Jason Merrill <jason@redhat.com> | 2023-01-23 16:25:07 -0500 |
---|---|---|
committer | Jason Merrill <jason@redhat.com> | 2023-01-23 22:26:24 -0500 |
commit | 049a52909075117f5112971cc83952af2a818bc1 (patch) | |
tree | bc657540f19ed98d8f7fe778deebdb78f4b6f20d /gcc/gcc.cc | |
parent | 607f278a3546fe6b91a881318db85d7a0dfdacd9 (diff) | |
download | gcc-049a52909075117f5112971cc83952af2a818bc1.zip gcc-049a52909075117f5112971cc83952af2a818bc1.tar.gz gcc-049a52909075117f5112971cc83952af2a818bc1.tar.bz2 |
c++: TARGET_EXPR collapsing [PR107303]
In r13-2978 I tried to eliminate TARGET_EXPR around TARGET_EXPR by
discarding the outer one, but as in this testcase that breaks if the
TARGET_EXPR_SLOT of the outer one is used elsewhere. But it should always
be safe to strip the inner one; if its slot were reused, there would be a
COMPOUND_EXPR around the TARGET_EXPR.
For 107329, if we're setting *walk_subtrees, we also need to fold
TARGET_EXPR_CLEANUP.
PR c++/107303
PR c++/107329
gcc/cp/ChangeLog:
* cp-gimplify.cc (cp_fold_r) [TARGET_EXPR]: In case of double
TARGET_EXPR, keep the outer one instead of the inner one.
(maybe_replace_decl): New.
gcc/testsuite/ChangeLog:
* g++.dg/ext/builtin-shufflevector-5.C: New test.
* g++.dg/init/new51.C: New test.
Diffstat (limited to 'gcc/gcc.cc')
0 files changed, 0 insertions, 0 deletions