On Mon, Aug 6, 2012 at 1:31 AM, Tom de Vries <tom_devr...@mentor.com> wrote:
> Richard,
>
> the code in emit_case_bit_tests currently introduces a MINUS_EXPR in signed 
> type
> (without checking if signed types wrap or not), which could mean introduction 
> of
> undefined overflow.
>
> This patch fixes this problem by performing the MINUS_EXPR in an unsigned 
> type.
>
> Doing so also enables the vrp optimization for the test-case.
>
> Bootstrapped and reg-tested (ada inclusive) on x86_64.
>
> OK for trunk?

Ok.

Thanks,
Richard.

> Thanks,
> - Tom
>
>
> 2012-08-06  Tom de Vries  <t...@codesourcery.com>
>
>         * tree-switch-conversion.c (emit_case_bit_tests): Generate MINUS_EXPR 
> in
>         unsigned type.
>
>         * gcc.dg/tree-ssa/vrp78.c: New test.

Reply via email to