This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Don't create out-of-bounds BIT_FIELD_REFs


[ Fix email address Marc ]
On 26-11-13 08:57, Tom de Vries 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?

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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]