Revert parts of ADDR_EXPR/CONSTRUCTOR treatment change in match.pd
authorRichard Biener <rguenther@suse.de>
Mon, 12 Dec 2022 07:56:41 +0000 (08:56 +0100)
committerRichard Biener <rguenther@suse.de>
Mon, 12 Dec 2022 08:50:29 +0000 (09:50 +0100)
commit49bf49bb6174734879adcba7fb340c1c8f5dd253
tree190d2ed74771c42335ffcadd58ede29f64f030ea
parent2dc5d6b1e7ec8822f5bd78761962ca2c85d4a2b4
Revert parts of ADDR_EXPR/CONSTRUCTOR treatment change in match.pd

This reverts the part that substitutes from the definition of an
SSA name to the capture, thus ADDR_EXPR@0 eventually yielding
&y_1->a[i_2] instead of _3.  That's because I didn't think of
how to deal with substituting @0 in the result pattern.  So
the following re-instantiates the SSA def CONSTRUCTOR handling
and in the ADDR_EXPR helpers used by match.pd handles SSA names
defined to ADDR_EXPRs transparently.

* genmatch.cc (dt_simplify::gen): Revert last change.
* match.pd: Revert simplification of CONSTUCTOR leaf handling.
(&x cmp SSA_NAME): Handle ADDR_EXPR in SSA defs.
* fold-const.cc (split_address_to_core_and_offset): Handle
ADDR_EXPRs in SSA defs.
(address_compare): Likewise.
gcc/fold-const.cc
gcc/genmatch.cc
gcc/match.pd