This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug other/16802] New: PowerPC - Unnecessary extsw


Description:
A non-optimal code sequence is illustrated.  The extsw prior to the branch to return from the procedure is not necessary.  Duplicate using gcc 3.5 and command line:

gcc -O3 -m64 -c test.c

Testcase:
int b,d;

int logic_func1() {
  return (d< b);
}

Assembly:
.logic_func1:
	ld 9,.LC1@toc(2)
	li 3,1
	ld 11,.LC0@toc(2)
	lwz 10,0(9)
	lwz 0,0(11)
	cmpw 7,0,10
	blt- 7,.L2
	li 3,0
.L2:
	extsw 3,3 <-- Unnecessary.
	blr



-- 
           Summary: PowerPC - Unnecessary extsw
           Product: gcc
           Version: 3.5.0
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P1
         Component: other
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: steinmtz at us dot ibm dot com
                CC: gcc-bugs at gcc dot gnu dot org,steinmtz at us dot ibm
                    dot com
 GCC build triplet: powerpc64-linux
  GCC host triplet: powerpc64-linux
GCC target triplet: powerpc64-linux


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16802


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]