On Tue, Apr 8, 2008 at 4:46 PM, Pranav Bhandarkar
<[EMAIL PROTECTED]> 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.

Reply via email to