This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/22312] reassoc does not handle (i+j)+(k+l) well
- From: "dberlin at dberlin dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 5 Jul 2005 19:02:40 -0000
- Subject: [Bug tree-optimization/22312] reassoc does not handle (i+j)+(k+l) well
- References: <20050705183341.22312.pinskia@gcc.gnu.org>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From dberlin at gcc dot gnu dot org 2005-07-05 19:02 -------
Subject: Re: New: reassoc does not handle
(i+j)+(k+l) well
On Tue, 2005-07-05 at 18:33 +0000, pinskia at gcc dot gnu dot org wrote:
> take the following example:
> int f(int i, int j, int k, int l)
> {
> int r1 = (i+j)+(k+l);
> int r2 = (j+k)+(l+i);
> return r1 == r2;
> }
>
> This should return 1 all the time. I found this while making testcases for reassoc working fp (well I just
> change one little thing to make it work really).
We can't do a full top-down reassocation because update_stmt reorders
our operands so we lose information about which is the high ranked
operand, etc.
It's a pain in the ass to fix, but possible.
>
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22312