[Bug tree-optimization/113024] Nested cast not optimized out in GIMPLE

pinskia at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Dec 14 17:59:42 GMT 2023


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113024

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Confirmed.

Note if the final convert was a truncation from the original one, match is able
to remove the inner cast since r14-2890-gcc2003cd87532f (PR 93044).
That is:
```
unsigned char
foo1 (signed short x)
{
  unsigned long long y = x;
  return y;
}
```
Maybe that part of the pattern could be improved to catch the testcase in
comment #0 too.


More information about the Gcc-bugs mailing list