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 middle-end/28283] SuperH: Very unoptimal code generated for 64-bit ints



------- Comment #7 from amylaar at gcc dot gnu dot org  2006-07-07 13:50 -------
(In reply to comment #3)
> When I disable the offending code (by altering add_cost[DImode] at the right
> moment), I get the right result for little endian.  However, compiling for
> big endian gives wrong code:
> 
> _expand64:
>         mov     #0,r5
>         mov     r4,r0
>         rts     
>         mov     r5,r1
>         .size   _expand64, .-_expand64
>         .ident  "GCC: (GNU) 4.2.0 20060620 (experimental)"
> 
> 3.4.0 was sane:
> _expand64:
>         mov     r4,r5
>         mov     #0,r4
>         mov     r4,r0
>         rts
>         mov     r5,r1
>         .size   _expand64, .-_expand64
>         .ident  "GCC: (GNU) 3.4.0 20040113 (experimental)"
> 
Oops, I got mixed up here - I somehow thought the argument was long long,
i.e. the lowpart in r5.  Since the argument is actually unsigned int, it is
passed in r4.

And the 3.4.0 code for big endian is actually:
_expand64:
        mov     #0,r5
        mov     r4,r0
        rts
        mov     r5,r1
        .size   _expand64, .-_expand64
        .ident  "GCC: (GNU) 3.4.0 20040113 (experimental)"


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28283


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