This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/30322] ((-i-1) + i) +1) is turned into ~i + (i+1) and never into 0 on the tree level
- From: "roger at eyesopen dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 4 Jan 2007 22:34:33 -0000
- Subject: [Bug middle-end/30322] ((-i-1) + i) +1) is turned into ~i + (i+1) and never into 0 on the tree level
- References: <bug-30322-10053@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #5 from roger at eyesopen dot com 2007-01-04 22:34 -------
Can you reduce a test case for the loop, now that the code in the PR
description is fixed? One thing that looks a bit odd is that in the condition
you describe the constant term "1", isn't on the far right, which I believe
should be the correct canonical form. Hence it looks like some of the
trees/subtrees in your expression haven't been folded. With a small testcase
it'll be easier to see whats going on.
I agree that you might be right, and it may be profitable to disable these
BIT_NOT_EXPR forms in fold, and identify them during RTL expansion or during
the RTL optimizers. But I'd like to see the sequence of events before I admit
defeat.
Thanks in advance.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30322