[Bug tree-optimization/97223] Failure to optimize comparison of char arithmetic to single comparison

2021-08-24 Thread arjun.is at lostca dot se via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97223

Arjun Shankar  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
   Target Milestone|--- |11.0
 Resolution|--- |FIXED
 CC||arjun.is at lostca dot se

--- Comment #5 from Arjun Shankar  ---
Looks like this was fixed by the time GCC 11 was released. I'm closing this bug
out.

[Bug tree-optimization/97223] Failure to optimize comparison of char arithmetic to single comparison

2021-01-14 Thread erozen at microsoft dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97223

--- Comment #4 from Eugene Rozenfeld  ---
The commit that fixed this:
https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=32ee472864ada44ef05b2a3b087b8ce413bee282

[Bug tree-optimization/97223] Failure to optimize comparison of char arithmetic to single comparison

2020-11-06 Thread erozen at microsoft dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97223

--- Comment #3 from Eugene Rozenfeld  ---
The proposed patch was committed to the trunk by Jeff Law.

[Bug tree-optimization/97223] Failure to optimize comparison of char arithmetic to single comparison

2020-10-30 Thread erozen at microsoft dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97223

Eugene Rozenfeld  changed:

   What|Removed |Added

 CC||erozen at microsoft dot com

--- Comment #2 from Eugene Rozenfeld  ---
Created attachment 49475
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=49475=edit
Proposed patch.

The patch was approved by Richard Beiner:
https://gcc.gnu.org/pipermail/gcc-patches/2020-October/557584.html

[Bug tree-optimization/97223] Failure to optimize comparison of char arithmetic to single comparison

2020-09-28 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97223

Richard Biener  changed:

   What|Removed |Added

 Ever confirmed|0   |1
   Last reconfirmed||2020-09-28
 Status|UNCONFIRMED |NEW
   Keywords||easyhack

--- Comment #1 from Richard Biener  ---
It works for 'unsigned char' but not for signed char (or signed short) which
are promoted to 'int' and then shortened to unsigned arithmetic:

return  = (short int) ((unsigned short) x + 5) > x;

there's existing patterns that would need to be amended for the extra
conversion.