[Bug rtl-optimization/97607] New: Spurious sign extension
elronnd at elronnd dot net
gcc-bugzilla@gcc.gnu.org
Tue Oct 27 23:54:55 GMT 2020
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97607
Bug ID: 97607
Summary: Spurious sign extension
Product: gcc
Version: 11.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: rtl-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: elronnd at elronnd dot net
Target Milestone: ---
The following code
extern void fun(char);
void wrapper(char x) { fun(x); }
Should compile 'wrapper' to a single jump, but instead it does this (on amd64):
wrapper:
movsx edi, dil
jmp fun
Presumably 'x' is getting promoted to int in wrapper, and the promotion never
gets removed.
More information about the Gcc-bugs
mailing list