hppa-linux regressions and 3.2.2 release

Eric Botcazou ebotcazou@libertysurf.fr
Sun Feb 2 16:06:00 GMT 2003


> #9492 is causing the hppa-linux kernel to be miscompiled. We have a
> workaround in place, but I think there may be more silently miscompiled
> cases that we have not yet discovered. No one has identified what
> causes this yet, but it seems to be a generic scheduling problem
> rather than an hppa specific one?

I think so.

There are actually two bugs:

struct termios {
        tcflag_t c_iflag;
        tcflag_t c_oflag;
        tcflag_t c_cflag;
        tcflag_t c_lflag;
        cc_t c_line;
        cc_t c_cc[19];
};

struct tty_driver {
        int magic;
        const char *driver_name;
        const char *name;
        int name_base;
        short major;
        short minor_start;
        short num;
        short type;
        short subtype;
        struct termios init_termios;
        int flags;
        int *refcount;
};

int main(void) {
...
        pty_driver.init_termios = tty_std_termios;
...
}


struct init_termios is reported by the front-end as having a size of 8 
(instead of 36) for the copy-assignment operation. This causes the alias 
analysis to think that c_lflag (offset 12) is not clobbered by the 
copy-assignment. Interestingly, c_cflag (offset 8) is detected as being 
clobbered, although it is outside the first 8 bytes.

On first inspection (.sched log file), both errors fixed on the 3.3 branch.

The latter error is fixed by:

2002-06-03  Dan Nicolaescu  <dann@godzilla.ics.uci.edu>

	* alias.c (nonoverlapping_memrefs_p): Fix off by one error.


The former problem comes from expand_assignment() that uses a hack with 
set_mem_offset() in order to adjust the offset. It is (supposedly) fixed by:

2002-07-29  Richard Henderson  <rth@redhat.com>

	* emit-rtl.c (set_mem_attributes_minus_bitpos): Rename from
	set_mem_attributes and add BITPOS argument.  Subtract it from
	OFFSET when same is adjusted.
	(set_mem_attributes): New wrapper function.
	* expr.c (expand_assignment): Use set_mem_attributes_minus_bitpos;
	remove offset adjustment hack.
	* expr.h (set_mem_attributes_minus_bitpos): Declare.

which relies on:

2002-07-25  Richard Henderson  <rth@redhat.com>

	* emit-rtl.c (set_mem_attributes): Fix size and alignment thinkos
	in ARRAY_REF of DECL_P case.

and

2002-07-21  Richard Henderson  <rth@redhat.com>

	* emit-rtl.c (set_mem_attributes): Preserve indirection of PARM_DECL
	when flag_argument_noalias == 2.
	* alias.c (nonoverlapping_memrefs_p): Handle that.
	* print-rtl.c (print_mem_expr): Likewise.


As David Edelsohn would say, a nice string :-)

-- 
Eric Botcazou



More information about the Gcc mailing list