[Bug tree-optimization/95246] Failure to optimize comparison between differently signed chars

2020-05-20 Thread gabravier at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95246

Gabriel Ravier  changed:

   What|Removed |Added

 Resolution|--- |INVALID
 Status|UNCONFIRMED |RESOLVED

--- Comment #3 from Gabriel Ravier  ---
Welp I actually found the option for it, so I'll close it as RESOLVED INVALID
(I guess I really shouldn't be trying to close bug reports at 5 am )

[Bug tree-optimization/95246] Failure to optimize comparison between differently signed chars

2020-05-20 Thread gabravier at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95246

--- Comment #2 from Gabriel Ravier  ---
Looks like I misread it, LLVM compares `dil` and `sil` with that
transformation, not `edi` and `esi` as it does without it. I should stop making
bug reports at 1 am... I suppose I should mark thtis as INVALID, but I haven't
been able to find how to do it, I can only seem to mark it as RESOLVED (maybe I
shouldn't try to close bug reports at 5 am)

[Bug tree-optimization/95246] Failure to optimize comparison between differently signed chars

2020-05-20 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95246

--- Comment #1 from Marc Glisse  ---
On which version of LLVM did you see that? For me, gcc produces

movzbl  %dil, %edi
movsbl  %sil, %esi
cmpl%esi, %edi
setg%al

while clang skips the first 2 lines (but still emits movl), assuming that the
input is already signed/zero extended, which points at ABI conventions. The
transformation you suggest doesn't seem right to me.