This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/23386] [4.1 Regression] bitmap.c is being miscompiled (VRP)
- From: "dberlin at dberlin dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 14 Aug 2005 17:57:48 -0000
- Subject: [Bug tree-optimization/23386] [4.1 Regression] bitmap.c is being miscompiled (VRP)
- References: <20050814153712.23386.danglin@gcc.gnu.org>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From dberlin at gcc dot gnu dot org 2005-08-14 17:57 -------
Subject: Re: [4.1 Regression] bitmap.c is
being miscompiled (VRP)
On Sun, 2005-08-14 at 17:32 +0000, pinskia at gcc dot gnu dot org wrote:
> ------- Additional Comments From pinskia at gcc dot gnu dot org 2005-08-14 17:32 -------
> Here is something which is a little more reduced:
> int f[100];
> int g[100];
> unsigned char
> f1 (int a, int b)
> {
> unsigned ix;
> if (a == b)
> return 1;
> for (ix = 4; ix--;)
> if (f[ix] != g[ix])
> return 0;
> return 1;
> }
>
> int main(void)
> {
> if (!f1 (1, 2))
> __builtin_abort();
> return 0;
> }
>
>
The SSA version used in the pointer arithmetic doesn't wrap. The other
SSA versions do.
We can't afford to simply assume that everything wraps, or else we can't
calculate the number of iterations on pretty much any loop.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23386