This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: Very nasty C bug in gcc 2.95.2
- To: Geoff Keating <geoffk at geoffk dot org>
- Subject: Re: Very nasty C bug in gcc 2.95.2
- From: Ken Settle <ken at gordian dot com>
- Date: Wed, 14 Mar 2001 23:21:35 -0800
- CC: gcc-bugs at gcc dot gnu dot org
- Organization: Gordian
- References: <3AB014C0.D4074553@gordian.com> <jmsnkfvhxn.fsf@geoffk.org>
Geoff Keating wrote:
>
> Ken Settle <gordian.com> writes:
>
> > 1c: 3b e1 00 08 addi r31,r1,8
> ...
> > 40: 63 e3 00 02 ori r3,r31,2
> ...
> > The instruction at 40: is an ori! it should be an addi.
>
> No, this is OK. The stack is aligned (on ppc-eabi) to an 8-byte boundary.
>
> --
> - Geoffrey Keating <geoffk@geoffk.org>
Thanks! That's the problem. Apparently my stack is becoming misaligned
somewhere (aligned to a 4 byte boundry instead of 8). I guess that'll
take some rooting around in the assembly code to find that one.
Apparently, if the offset is >= 1 && <= the stack alignment boundry, it
uses ori, and it uses addi otherwise, on all 3 cpus mentioned (ppc, arm,
mips). I'm confused about why anyone would prefer an ori in this
circumstance, rather than an addi.
--------------------------------------------------------------
Is ori faster or fewer instruction bytes then addi on any cpu?
--------------------------------------------------------------
Amazingly, it just works, even though it looks insane, and is certainly
confusing.
Thanks again!
Ken Settle
Wanna get blacklisted by our spam filter? mailto:ahayoufool@gordian.com