http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57567
Bug ID: 57567
Summary: Missed optimsation : compare + or
Product: gcc
Version: 4.9.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: tree-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: [email protected]
Using 4.9.0 20130608 (experimental) [trunk revision 199851], target
arm-unknown-eabi.
The following case produces suboptimal code:
unsigned
test (unsigned t)
{
if (t != (unsigned)-1)
t |= 3;
return t;
}
Result:
cmn r0, #1
orrne r0, r0, #3
A simple:
orr r0, r0, #3
would be enough.