This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/21858] [4.1 Regression] ICE in compare_values, at tree-vrp.c:301
- From: "dnovillo at redhat dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 1 Jun 2005 19:38:52 -0000
- Subject: [Bug middle-end/21858] [4.1 Regression] ICE in compare_values, at tree-vrp.c:301
- References: <20050601033924.21858.john.carter@tait.co.nz>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From dnovillo at redhat dot com 2005-06-01 19:38 -------
Subject: Re: [4.1 Regression] ICE in compare_values, at tree-vrp.c:301
On Wed, Jun 01, 2005 at 07:31:24PM -0000, pinskia at gcc dot gnu dot org wrote:
>
> ------- Additional Comments From pinskia at gcc dot gnu dot org 2005-06-01 19:31 -------
> Confirmed, reduced testcase:
> unsigned int dsdblm_GetBlockAddress();
> void error_LocalAssert(void);
> int dsdblm_CreateBlock(unsigned int address)
> {
> address = dsdblm_GetBlockAddress();
> if (address >= (void*)0x00020000)
> error_LocalAssert();
> return address;
> }
> This is either a front-end bug or a fold bug.
>
Is this legal C?
vrp15.c: In function `dsdblm_CreateBlock':
vrp15.c:6: warning: comparison between pointer and integer
This is very similar to what I found in the Fortran FE a few days
ago. The .gimple form is already "wrong":
D.1242 = dsdblm_GetBlockAddress ();
address = D.1242;
if (address > 131071B)
We lose, or never emit, the cast to convert the constant to integer.
However, the optimizers should probably not be ICEing here. I
will remove the assert in compare_values, to simply refuse to do
anything when pointers and non-pointers are mixed in the same
predicate.
Diego.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21858