diff options
author | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2025-04-16 22:01:31 +0200 |
---|---|---|
committer | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2025-04-16 22:05:00 +0200 |
commit | d5d7dfab811de74cff88759785d0d5068b3b1121 (patch) | |
tree | 4def80d1caecea3c3ae23d2e7234b2b5351d2aa7 /libjava/classpath/lib/java | |
parent | dbffeadf7f682625c7ac8c251ee62c02c90f32df (diff) | |
download | gcc-d5d7dfab811de74cff88759785d0d5068b3b1121.zip gcc-d5d7dfab811de74cff88759785d0d5068b3b1121.tar.gz gcc-d5d7dfab811de74cff88759785d0d5068b3b1121.tar.bz2 |
Fix wrong optimization of conditional expression with enumeration type
This is a regression introduced on the mainline and 14 branch by:
https://gcc.gnu.org/pipermail/gcc-cvs/2023-October/391658.html
The change bypasses int_fits_type_p (essentially) to work around the
signedness constraints, but in doing so disregards the peculiarities
of boolean types whose precision is not 1 dealt with by the predicate,
leading to the creation of a problematic conversion here.
Fixed by special-casing boolean types whose precision is not 1, as done
in several other places.
gcc/
* tree-ssa-phiopt.cc (factor_out_conditional_operation): Do not
bypass the int_fits_type_p test for boolean types whose precision
is not 1.
gcc/testsuite/
* gnat.dg/opt105.adb: New test.
* gnat.dg/opt105_pkg.ads, gnat.dg/opt105_pkg.adb: New helper.
Diffstat (limited to 'libjava/classpath/lib/java')
0 files changed, 0 insertions, 0 deletions