This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Optimization of offset computations
- To: Richard Kenner <kenner at vlsi1 dot ultra dot nyu dot edu>
- Subject: Re: Optimization of offset computations
- From: Richard Henderson <rth at cygnus dot com>
- Date: Tue, 30 Nov 1999 03:34:51 -0800
- Cc: gcc-patches at gcc dot gnu dot org
- References: <9911301113.AA29540@vlsi1.ultra.nyu.edu>
On Tue, Nov 30, 1999 at 06:13:10AM -0500, Richard Kenner wrote:
> > unsigned int a = 65536;
> > b = (a * 65536) / 8;
> > b = (a * 8192);
>
> Sure, but don't both expressions overflow the same way?
Absolutely not.
To 32 bits, the first is 0x1_0000_0000 = 0 / 8 = 0,
whereas the second is 0x2000_0000.
r~