This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/28283] SuperH: Very unoptimal code generated for 64-bit ints
- From: "amylaar at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 7 Jul 2006 13:50:13 -0000
- Subject: [Bug middle-end/28283] SuperH: Very unoptimal code generated for 64-bit ints
- References: <bug-28283-6755@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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