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 target/49468] SH Target: inefficient integer abs code


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


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