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/64507] SH inlined builtin strncmp doesn't return 0 for 0 length


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64507

--- Comment #4 from chrbr at gcc dot gnu.org ---
Actually, the code could be slightly better by factorizing the return sequences

        ;; check length
        mov    #0,r0
        ;; goto .l2
        ;; else init r1,r0
        ;; goto .l1
.l2:
        rtx
    nop
.l1:
    rts    
    sub    r1,r0

into
       ;; check length
       mov r1,r0
       ;; goto l1
       ;; else init r1,r0
.l1:        
       rts
       sub   r1,r0

however this creates an unitilized mov (which we donÂt care) but the backend
keeps forcing an useless mov #0,r1

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