Re: [PATCH] [ifcombine] out-of-bounds bitfield refs can trap [PR118514]

2025-01-23 Thread Richard Biener
On Thu, Jan 23, 2025 at 1:08 AM Alexandre Oliva wrote: > > On Jan 21, 2025, Richard Biener wrote: > > > So - your fix looks almost good, I'd adjust it to > > >> +case BIT_FIELD_REF: > >> + if (DECL_P (TREE_OPERAND (expr, 0)) > >> + && !bit_field_ref_in_bounds_p (expr)) > >> +

[PATCH] [ifcombine] out-of-bounds bitfield refs can trap [PR118514]

2025-01-22 Thread Alexandre Oliva
On Jan 21, 2025, Richard Biener wrote: > So - your fix looks almost good, I'd adjust it to >> +case BIT_FIELD_REF: >> + if (DECL_P (TREE_OPERAND (expr, 0)) >> + && !bit_field_ref_in_bounds_p (expr)) >> + return true; >> + /* Fall through. */ > OK if that works. It