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?
Thanks,
- Tom
2013-11-26 Tom de Vries <tom@codesourcery.com>
Marc Glisse <marc.glisse@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.