diff options
author | Jakub Jelinek <jakub@redhat.com> | 2025-06-10 20:06:14 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2025-06-10 20:07:39 +0200 |
commit | 2e4688a7202d73baeb4de18ca4591e6b0985f4a4 (patch) | |
tree | e2a02469035dc88c9bf2da12607ef2c2197e7ae7 /libgcobol | |
parent | 54da199f28da07166a44eae7d53acb9e3abe1306 (diff) | |
download | gcc-master.zip gcc-master.tar.gz gcc-master.tar.bz2 |
expand: Use less costly from sign and zero extensions for values where value range says they don't have MSB set [PR120434]HEADtrunkmaster
On top of the just posted patch, the following patch attempts to
use value range to see if MSB is known to be false and for scalar integral
extension in that case tries to expand both sign and zero extension and
chooses based on RTX costs the cheaper one (if the costs are the same
uses what it used before, TYPE_UNSIGNED (TREE_TYPE (treeop0)) based.
The patch regresses the gcc.target/i386/pr78103-3.c test, will post
a separate patch for that momentarily (with the intent that if all 3
patches are approved, I'll commit the PR78103 related one before this one).
2025-06-10 Jakub Jelinek <jakub@redhat.com>
PR middle-end/120434
* expr.cc (expand_expr_real_2) <CASE_CONVERT>: If get_range_pos_neg
at -O2 for scalar integer extension suggests the most significant
bit of op0 is not set, try both unsigned and signed conversion and
choose the cheaper one. If both are the same cost, choose one
based on TYPE_UNSIGNED (TREE_TYPE (treeop0)).
* gcc.target/i386/pr120434-2.c: New test.
Diffstat (limited to 'libgcobol')
0 files changed, 0 insertions, 0 deletions