Problem with Fix for PR 35163 ?
Richard Guenther
richard.guenther@gmail.com
Tue Apr 8 20:47:00 GMT 2008
On Tue, Apr 8, 2008 at 5:36 PM, Richard Guenther
<richard.guenther@gmail.com> wrote:
>
> 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.
Btw, I have a fix.
Richard.
More information about the Gcc
mailing list