]> git.ipfire.org Git - thirdparty/gcc.git/commit
ifcombine field merge: do not follow a second conversion [PR118046]
authorAlexandre Oliva <oliva@adacore.com>
Thu, 19 Dec 2024 01:17:02 +0000 (22:17 -0300)
committerAlexandre Oliva <oliva@gnu.org>
Thu, 19 Dec 2024 01:17:02 +0000 (22:17 -0300)
commit2c55a891840425a98d951283273a11cf7bd31816
treeaa8b761b79f8c143775c015299268b381abf959d
parent86d9951acb4ec6f6f47402abb1fe3f059beb3ddb
ifcombine field merge: do not follow a second conversion [PR118046]

The testcase shows that conversions that would impact negatively the
ifcombine field merging implementation won't always have been
optimized out by the time we reach ifcombine.

There's probably room to support multiple conversions with extra
logic, but this workaround should avoid codegen errors until that
logic is figured out.

for  gcc/ChangeLog

PR tree-optimization/118046
* gimple-fold.cc (decode_field_reference): Don't follow more
than one conversion.

for  gcc/testsuite/ChangeLog

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