This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: hppa-linux regressions and 3.2.2 release


On Sunday 02 February 2003 16:55, Eric Botcazou wrote:
> > #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 :-)

Yeah, and I think you missed a few more fixes to 
set_mem_attributes_minus_bitpos. I've applied these to my gcc-3_2-branch 
testing tree and started a build for powerpc-linux-gnu. I will report 
tomorrow.

These are the patches I applied:

cvs diff -r1.172 -r1.173 alias.c |patch
cvs diff -r1.177 -r1.178 alias.c |patch
cvs diff -r1.285 -r1.288 emit-rtl.c |patch
cvs diff -r1.291 -r1.292 emit-rtl.c |patch
cvs diff -r1.294 -r1.295 emit-rtl.c |patch
cvs diff -r1.85 -r1.86 print-rtl.c |patch
cvs diff -r1.471 -r1.472 expr.c |patch
cvs diff -r1.118 -r1.119 expr.h |patch

Hopefully I didn't miss something and the tree is buildable :-).

Franz.

irc://irc.freenode.net/#gcc


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]