]> git.ipfire.org Git - thirdparty/gcc.git/commit
[ifcombine] out-of-bounds bitfield refs can trap [PR118514]
authorAlexandre Oliva <oliva@adacore.com>
Fri, 24 Jan 2025 02:23:10 +0000 (23:23 -0300)
committerAlexandre Oliva <oliva@gnu.org>
Fri, 24 Jan 2025 02:23:10 +0000 (23:23 -0300)
commit3f05d70389f523cf53f9b8fdf56570e8a6ecdb8b
treeb69109cf0ec73a29d75731e5d63bb15888f86072
parent35d5c4f9f479afa3ee585b617cc73a03d44297f4
[ifcombine] out-of-bounds bitfield refs can trap [PR118514]

Check that BIT_FIELD_REFs of DECLs are in range before deciding they
don't trap.

Check that a replacement bitfield load is as trapping as the replaced
load.

for  gcc/ChangeLog

PR tree-optimization/118514
* tree-eh.cc (bit_field_ref_in_bounds_p): New.
(tree_could_trap_p) <BIT_FIELD_REF>: Call it.
* gimple-fold.cc (make_bit_field_load): Check trapping status
of replacement load against original load.

for  gcc/testsuite/ChangeLog

PR tree-optimization/118514
* gcc.dg/field-merge-23.c: New.
gcc/gimple-fold.cc
gcc/testsuite/gcc.dg/field-merge-23.c [new file with mode: 0644]
gcc/tree-eh.cc