This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [wwwdocs] Round 1 of cleaning up "old PROBLEMS"
Andreas Schwab <schwab@suse.de> writes:
>> That appears to be m68k assembly language. I don't think it's worth
>> trying very hard to reconstruct a test case, though.
>
> That's pretty straightforward. Compiling this:
>
> struct X {
> char *a;
> /* other members */
> int b;
> };
>
> void f (struct X *x)
> {
> x->a[x->b] = 0;
> }
>
> with current mainline on m68k at -O2 yields the following, which looks
> exactly like what this entry is about:
>
> f:
> link.w %fp,#0
> move.l 8(%fp),%a0
> move.l (%a0),%a1
> move.l 4(%a0),%a0
> clr.b (%a0,%a1.l)
> unlk %fp
> rts
Can you express an opinion on whether the suggested variant code (in
this notation,
f:
link.w %fp,#0
move.l 8(%fp),%a0
add.l 4(%a0),%a0
clr.b (%a0)
unlk %fp
rts
) is indeed more efficient than what GCC does generate?
zw