This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/25113] New: [m68k] lshiftrt and some other insns are conservative on cc0
- From: "kazu at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 27 Nov 2005 02:29:58 -0000
- Subject: [Bug target/25113] New: [m68k] lshiftrt and some other insns are conservative on cc0
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
Consider:
unsigned int bar (void);
void
foo (void)
{
unsigned int a = bar ();
a >>= 2;
if (a == 0)
bar ();
}
./cc1 -quiet -O2 -m5200 -fomit-frame-pointer generates
foo:
move.l %a2,-(%sp)
lea bar,%a2
jbsr (%a2)
lsr.l #2,%d0
tst.l %d0
jbne .L4
jbsr (%a2)
.L4:
move.l (%sp)+,%a2
rts
Note that tst.l is not necessary because lsr.l sets the zero flag correctly.
See notice_update_cc and its frequent use of CC_STATUS_INIT.
--
Summary: [m68k] lshiftrt and some other insns are conservative on
cc0
Product: gcc
Version: 4.2.0
Status: UNCONFIRMED
Keywords: missed-optimization
Severity: normal
Priority: P3
Component: target
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: kazu at gcc dot gnu dot org
GCC target triplet: m68k-elf
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25113