This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Patch for incorrect execute/divconst-2.c
- To: Hans-Peter Nilsson <hp at bitrange dot com>
- Subject: Re: Patch for incorrect execute/divconst-2.c
- From: Jeffrey A Law <law at cygnus dot com>
- Date: Wed, 24 May 2000 19:41:20 -0600
- cc: gcc-patches at gcc dot gnu dot org
- Reply-To: law at cygnus dot com
In message <Pine.BSF.4.10.10003142020490.6219-100000@dair.pair.com>you write:
> On Tue, 14 Mar 2000, Jeffrey A Law wrote:
> > In message <Pine.BSF.4.10.10003110755460.17527-100000@dair.pair.com>you
> write
> > > Unfortunately this uncovers other GCC problems: the "quot * -21474836
> 48"
> > > gets optimized into "quot << 31" on a host with 32-bit HOST_WIDE_INTs
> ,
> > > regardless of sizeof long on the actual target,
> > When precisely is that not a safe thing to do?
>
> When "long int" (the type of quot) is 64 bits on the target.
> It is then wrong since -2147483648L != (1 << 31).
> The correct optimization would then be -(quot) << 31.
Can you find out where this is happening? I would guess it's happening
before/during RTL generation.
jeff