]> gcc.gnu.org Git - gcc.git/commit
middle-end/106053 - fold_sign_changed_comparison and large bools
authorRichard Biener <rguenther@suse.de>
Tue, 28 Jun 2022 08:50:34 +0000 (10:50 +0200)
committerRichard Biener <rguenther@suse.de>
Tue, 28 Jun 2022 10:00:16 +0000 (12:00 +0200)
commita3ca1fc5f409e257e9fb9a8165bb4a7068ddebbe
tree2d7f9e922c8324e5cadc3f6e8bfdbd8e166d4ebd
parent6835baee7196eeb03f24f6e650c0d37cbb295647
middle-end/106053 - fold_sign_changed_comparison and large bools

The following fixes a latent issue in the match.pd variant of
fold_sign_changed_comparison which replaces an unsigned integer
comparison with a signed boolean comparison of the same precision
despite the fact that we treat BOOLEAN_TYPEs as only having two
valid values.

2022-06-28  Richard Biener  <rguenther@suse.de>

PR middle-end/106053
* match.pd ((T)a == (T)b): Avoid folding away sign
changes in a comparison if we'd truncate to a boolean.

* gcc.target/i386/pr106053.c: New testcase.
gcc/match.pd
gcc/testsuite/gcc.target/i386/pr106053.c [new file with mode: 0644]
This page took 0.067375 seconds and 5 git commands to generate.