This is the mail archive of the gcc-patches@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]

Re: [4.1 Committed] PR middle-end/26729: Fold vs. TREE_OVERFLOW


On 5/14/06, Roger Sayle <roger@eyesopen.com> wrote:

Hi Richard,


On Sun, 14 May 2006, Richard Guenther wrote:
> I don't see how this avoids the problem in general.  In fact,
> integer_nonzerop will return false for an integer != 0 with
> TREE_CONSTANT_OVERFLOW
> set - so it will fail the same way, just for different overflowed constants.
>
> Or am I missing something?
>
> At least it looks like you would only get bogus warnings in this case and
> not wrong-code.

It's the other way around.  The bogus warning and the invalid code are
caused by the same hunk.  Previously, the TREE_OVERFLOW caused fold-const
to incorrectly determine that the condition was always a constant,
which would issue a diagnostic and then misoptimize the expression.
Now that the sense of TREE_OVERFLOW has been reversed in this test,
we no longer enter the problematic clause.

You'll notice that the new testcase, has two passes on 4.1 now, but had
two unexpected failures previously (one for the unexpected warning during
compilation, and the other for the abort() at run-time).

Hopefully this clears up your confusion.

Doh, yes. I looked up more context from the sources and it's all clear now. Now the only thing left is if you did look at the 14 other places !integer_zerop is used in fold_const.c? At least a bunch of them look suspicious from a quick look (I'll have a closer look tomorrow and try to produce some testcases that fail).

Thanks,
Richard.


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