This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [4.1 Committed] PR middle-end/26729: Fold vs. TREE_OVERFLOW
- From: Roger Sayle <roger at eyesopen dot com>
- To: Richard Guenther <richard dot guenther at gmail dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Sun, 14 May 2006 07:40:58 -0600 (MDT)
- Subject: Re: [4.1 Committed] PR middle-end/26729: Fold vs. TREE_OVERFLOW
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.
Roger
--