[parisc-linux] new gcc-default for hppa
Randolph Chung
Randolph Chung <tausq@debian.org>
Mon, 27 Jan 2003 23:31:01 -0800
> well.... Grant and I did some more debugging on this.... here's what
> we've tried so far:
ok, here's what's happening apparently.... (with many thanks to Grant
for a sharp eye :)
The pty_init() function does a number of structure copies. e.g.
init_termios is a 36-byte structure.
pty_driver.init_termios = tty_std_termios;
pty_driver.init_termios.c_iflag = 0;
pty_driver.init_termios.c_oflag = 0;
pty_driver.init_termios.c_cflag = B38400 | CS8 | CREAD;
pty_driver.init_termios.c_lflag = 0;
gcc translates this to something like this:
/* %r4 is &pty_driver */
ldo 28(%r4),%r23
ldi 28,%r21
ldw,ma 4(%r22),%r20
ldw,ma 4(%r22),%r19
stw,ma %r20,4(%r23)
addib,>= -8,%r21,.-12
stw,ma %r19,4(%r23)
/* ... */
stw %r0,28(%r4)
stw %r0,32(%r4)
stw %r10,36(%r4)
stw %r0,40(%r4)
When optimizations are turned on, gcc reschedules some of those final
stw insns above the structure copy loop. When the structure copy
happens, the values get overwritten. ick.
this was kind of interesting to debug :) but i have no idea how to fix
it. Dave? :)
randolph
--
Randolph Chung
Debian GNU/Linux Developer, hppa/ia64 ports
http://www.tausq.org/