This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Problem with Fix for PR 35163 ?
- From: "Richard Guenther" <richard dot guenther at gmail dot com>
- To: "Pranav Bhandarkar" <pranav dot bhandarkar at gmail dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Tue, 8 Apr 2008 17:36:30 +0200
- Subject: Re: Problem with Fix for PR 35163 ?
- References: <649555d50804080746q77f97c61q5ccd4261dd0b83e8@mail.gmail.com>
On Tue, Apr 8, 2008 at 4:46 PM, Pranav Bhandarkar
<pranav.bhandarkar@gmail.com> wrote:
> Hi,
>
> Consider the attached testcase.
>
> Working on a private port (Infact I see this problem on
> arm-none-eabi-gcc too). I see the following in test.c.003t.original
>
> fail = (short int) usi <= ssi;
>
> And then in test.c.025t.ssa
> usi.2_5 = (short int) usi_4;
> fail.3_6 = usi.2_5 <= ssi_2;
>
> Now ccp1 does constant propagation and we are left with
> usi.2_5 = -256;
>
> This causes the test to fail.
>
> Clearly the problem seems to be that since usi is unsigned short int a
> short int cant represent all the possible values of usi
>
> I reverted the following patch and the test passed.
> PR middle-end/35163
> * fold-const.c (fold_widened_comparison): Use get_unwidened in
> value-preserving mode. Disallow final truncation.
>
> Now with the patch reverted, test.c.003t.original has
>
> fail = (int) ssi >= (int) usi;
>
> And this problem vanished.
>
>
> Am I missing something here ?
Please file a bugreport about this.
Richard.