This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/49468] SH Target: inefficient integer abs code
- From: "oleg dot endo at t-online dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 26 Jun 2011 20:48:53 +0000
- Subject: [Bug target/49468] SH Target: inefficient integer abs code
- Auto-submitted: auto-generated
- References: <bug-49468-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49468
Oleg Endo <oleg.endo@t-online.de> changed:
What |Removed |Added
----------------------------------------------------------------------------
Attachment #24560|0 |1
is obsolete| |
--- Comment #4 from Oleg Endo <oleg.endo@t-online.de> 2011-06-26 20:48:19 UTC ---
Created attachment 24603
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=24603
Proposed patch
Thanks for checking.
I missed to tell the expanders that the T bit is clobbered by insns such as
negdi2 and abssi2 / absdi2. The negdi2 expander that I have changed caused the
libstdc++ tests to fail when formatting a -1LL.
Another (reduced) example:
long long x (long long i, int j, long long k)
{
if (j & 5)
return -i;
return -k;
}
..ended up as (the "j & 5" got lost)...
mov.l @(4,r15),r1
clrt
mov.l @r15,r2
negc r1,r1
negc r2,r0
bt/s .L8
clrt
negc r5,r1
negc r4,r0
.L8:
rts
nop