This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug middle-end/30322] ((-i-1) + i) +1) is turned into ~i + (i+1) and never into 0 on the tree level



------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]