This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: bootstrap failure, x86: stage1 miscompiles gengenrtl
On Fri, Mar 31, 2000 at 11:04:12AM +1000, Alan Modra wrote:
> On Thu, 30 Mar 2000, Zack Weinberg wrote:
>
> > stage1/xgcc -Bstage1/ -B/work/inst/i686-pc-linux-gnu/bin/ -c -DIN_GCC
> > -W -Wall -Wtraditional -O2 -g -W -Wall -Wtraditional -DHAVE_CONFIG_H
> > -I. -I/work/src/hashtab.gcc/gcc -I/work/src/hashtab.gcc/gcc/config
> > -I/work/src/hashtab.gcc/gcc/../include
> > /work/src/hashtab.gcc/gcc/gengenrtl.c
> > stage1/xgcc -Bstage1/ -B/work/inst/i686-pc-linux-gnu/bin/ -DIN_GCC -W
> > -Wall -Wtraditional -O2 -g -W -Wall -Wtraditional -DHAVE_CONFIG_H
> > -o gengenrtl gengenrtl.o obstack.o
> > ./gengenrtl -h >tmp-genrtl.h
> > Segmentation fault
...
> > movl 8(%ebp), %edi
> > .stabn 68,0,261,.LM74-genmacro
> > .LM74:
> > leal (%edi,%edi,2), %eax
> > leal 0(,%eax,4), %ebx
> > movl defs(%ebx), %eax
> > pushl %eax
> > subl $12, %esp
>
> The above two instructions seem to be in the wrong order. That's likely
> your segv problem.
Yeah, that'd do it.
I know that it worked yesterday, so it's got to be the size-in-bits
changes that broke this, but I don't see anything obvious in the
changelog for that. The subl comes from the stack alignment code,
presumably.
> > I'm not exactly an x86 assembly expert, but it appears to me that the
> > code generated by 2.95 is multiplying idx by 3 before the
> > leal 0(,%eax,4) instruction, while the current tree is multiplying it
> > by 4. sizeof(*defs) is 12; both versions agree on that if explicitly
> > asked.
>
> Nup. "leal (%edi,%edi,2), %eax" does eax = edi + edi * 2
Aha. Much more useful semantics that way, now I think about it.
zw