[Bug middle-end/25125] [4.1/4.2 Regression] (short) ((int)(unsigned short) + (int)) is done in the wrong type

2005-12-19 Thread kazu at codesourcery dot com


--- Comment #10 from kazu at codesourcery dot com  2005-12-19 18:38 ---
Subject: Re:  [4.1/4.2 Regression] (short) ((int)(unsigned
 short) + (int)) is done in the wrong type

Hi Mark,

> (Why should we get 1?  Upon entry to f, a will be 1, since 32769 will be
> reduced modulo 2^16.  Then, b will be 1 - 32768, or -32767.  I don't see why
> that should be converted to 1 -- but I certainly don't see why it should be
> 32768 either.)
> 
> In any case, wrong-code: P1.

First, 32769 will be reduced to -32767.
(int) -32767 + -(int)32768 = -65535.
If we take the lowest 16 bits of -65535, we get 1, and that's what f should be 
returning.

Kazu Hirata


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25125



[Bug rtl-optimization/22384] compiling cp-mangle.c causes an ICE

2005-07-09 Thread kazu at codesourcery dot com

--- Additional Comments From kazu at codesourcery dot com  2005-07-09 17:13 
---
Subject: Re:  compiling cp-mangle.c causes an
 ICE

Hi Dave,

> I've posted a possible fix to gcc-patches:
> <http://gcc.gnu.org/ml/gcc-patches/2005-07/msg00649.html>.  Does that
> work for you?

Thank you for a quick reply.  Yes, your new patch fixes the ICE 
associated with the testcase.

Kazu Hirata


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22384