On Tue, Nov 26, 2013 at 8:57 AM, Tom de Vries <tom_devr...@mentor.com> wrote:
> Jason,
>
> This patch prevents creating out-of-bounds BIT_FIELD_REFs in 3 locations.
>
> It fixes a SIGSEGV (triggered by gimple_fold_indirect_ref_1) in
> simplify_bitfield_ref. I've added an assert to detect the problematic
> BIT_FIELD_REF there.
>
> Bootstrapped and reg-tested on x86_64.
>
> OK for trunk?

Looks obvious to me - btw, instead of asserting in tree-ssa-forwprop.c
can you adjust the verify_expr BIT_FIELD_REF code so it checks for
this?

Thanks,
Richard.

> Thanks,
> - Tom
>
> 2013-11-26  Tom de Vries  <t...@codesourcery.com>
>             Marc Glisse  <marc.gli...@inria.fr>
>
>         PR middle-end/59037
>         * semantics.c (cxx_fold_indirect_ref): Don't create out-of-bounds
>         BIT_FIELD_REF.
>
>         * fold-const.c (fold_indirect_ref_1): Don't create out-of-bounds
>         BIT_FIELD_REF.
>         * gimple-fold.c (gimple_fold_indirect_ref): Same.
>         * tree-ssa-forwprop.c (simplify_bitfield_ref): Assert that
> BIT_FIELD_REF
>         is not out-of-bounds.
>
>         * g++.dg/pr59037.C: New testcase.
>         * gcc.dg/pr59037.c: Same.

Reply via email to