This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/32680] New: unneeded movsbl
- From: "romikb at mail dot ru" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 8 Jul 2007 20:26:24 -0000
- Subject: [Bug c/32680] New: unneeded movsbl
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
Code compiled with -O2 -fomit-frame-pointer
char function1(){ return 10; }
char (*pfunc)() = function1;
char function2(){ return pfunc(); }
produce unneeded movsbl instruction:
_function2:
subl $12, %esp << unneeded
call *_pfunc
addl $12, %esp << unneeded
movsbl %al,%eax << unneeded
ret
eax register allready contains char and don't need to be converted.
Code for
long function1(){ return 10; }
long (*pfunc)() = function1;
lonf function2(){ return pfunc(); }
looks fine.
--
Summary: unneeded movsbl
Product: gcc
Version: 4.1.2
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: romikb at mail dot ru
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32680