An alias bug
H.J. Lu
hjl@lucon.org
Sat Jul 11 15:24:00 GMT 1998
> > Here is a testcase. Compile it with -O2. You should get a core dump
> > on x86. The problem is aliase code cannot tell in
> [ ... ]
> This one runs just fine too on my x86 compiled with -O2.
>
> Thanks for the RTL. It would have helped if you at least mentioned
> what function this code was from -- it was nontrivial to find this
It is the main function.
> rtl in my dump files because the insn #s don't exactly match.
>
> Compiling with -O2 on my x86 I get this in my .greg dump in main:
>
> (code_label/i 462 461 887 973 "")
>
> (insn 887 462 463 (set (reg:SI 4 %esi)
> (mem:SI (plus:SI (reg:SI 6 %ebp)
> (const_int -88)))) 54 {movsi+2} (nil)
> (nil))
>
> (insn/i:HI 463 887 464 (set (mem/s:SI (reg:SI 4 %esi))
> (reg:SI 0 %eax)) 54 {movsi+2} (nil)
> (expr_list:REG_DEAD (reg:SI 0 %eax)
> (expr_list:REG_DEAD (mem:SI (plus:SI (reg:SI 6 %ebp)
> (const_int -88)))
> (nil))))
>
> [ random note insns ]
>
> (insn 810 469 836 (set (reg:SI 1 %edx)
> (mem:SI (plus:SI (reg:SI 6 %ebp)
> (const_int -68)))) 54 {movsi+2} (nil)
> (nil))
>
> In my .sched2 dump I get:
>
> [ random note insns ]
>
> (insn 887 836 463 (set (reg:SI 4 %esi)
> (mem:SI (plus:SI (reg:SI 6 %ebp)
> (const_int -88)))) 54 {movsi+2} (nil)
> (nil))
>
> (insn/i:HI 463 887 810 (set (mem/s:SI (reg:SI 4 %esi))
> (reg:SI 0 %eax)) 54 {movsi+2} (insn_list 887 (nil))
> (expr_list:REG_DEAD (reg:SI 0 %eax)
> (expr_list:REG_DEAD (mem:SI (plus:SI (reg:SI 6 %ebp)
> (const_int -88)))
> (nil))))
>
> (insn 810 463 811 (set (reg:SI 1 %edx)
> (mem:SI (plus:SI (reg:SI 6 %ebp)
> (const_int -68)))) 54 {movsi+2} (nil)
> (nil))
>
>
> Nothing got moved in an unsafe manner as far as I can tell.
>
That is strange. insn is moved unsafely by egcs in CVS as of 11:00am
PDT on 980711 on my Linux/x86. BTW, I didn't use haifa-sched. I also
use -O2 -g to bootstrap egcs. BTW, have you tried "make check" on my
libg++ addon in egcs?
BTW, I have put tSet.cc and RTL dumps at
ftp://ftp.yggdrasil.com/private/hjl/tSet.tar.gz
insn/i:HI 468 and insn 823 are swapped after sched2.
--
H.J. Lu (hjl@gnu.org)
More information about the Gcc-bugs
mailing list