[Bug tree-optimization/93044] New: extra cast is not removed
pinskia at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Sun Dec 22 12:06:00 GMT 2019
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93044
Bug ID: 93044
Summary: extra cast is not removed
Product: gcc
Version: 10.0
Status: UNCONFIRMED
Keywords: missed-optimization
Severity: normal
Priority: P3
Component: tree-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: pinskia at gcc dot gnu.org
Target Milestone: ---
While looking into some bit-field code generation, I found a case where we
don't remove a cast. A slightly different testcase GCC does.
Take:
void f(signed char *a, unsigned char *c)
{
unsigned short b = *a;
*c = ((unsigned char)b);
}
---- CUT ---
We are not able to remove the cast there.
But if we change it to:
void f1(signed char *a, unsigned char *c)
{
signed short b = *a;
*c = ((unsigned char)b);
}
---- CUT ----
We are able to remove it.
More information about the Gcc-bugs
mailing list