This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/15791] fold misses that two ADDR_EXPR of an arrary obvious not equal
- From: "rguenth at tat dot physik dot uni-tuebingen dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 26 Jan 2005 16:16:58 -0000
- Subject: [Bug tree-optimization/15791] fold misses that two ADDR_EXPR of an arrary obvious not equal
- References: <20040603004359.15791.pinskia@gcc.gnu.org>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From rguenth at tat dot physik dot uni-tuebingen dot de 2005-01-26 16:16 -------
Umm, no. We fold the ARRAY_REF comparison to
PLUS_EXPR(ADDR_EXPR, INTEGER_CST) == PLUS_EXPR(ADDR_EXPR, INTEGER_CST)
oh well ;) So I guess transforming &a + i truth_op &a + j to i truth_op j
is always correct, as &a - &a == 0.
For &b[1] == b though, we'll have to do more checks for this.
Patch attached, bootstrap and testing in progress.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15791