re: Issues with native build of -10 on VAX

matthew green <[email protected]>
Newsgroups gmane.os.netbsd.ports.vax
Message-ID <[email protected]>
> I *think* I've worked out what the 'reload' pass has done when compiling 
> this test case, though I'm not sure that I understand it well enough to 
> be able to explain it properly.

nice!

> What seems to have happened is that the instructions to push argument 3 
> have inherited the output reload of --%sp into %r1 from the instructions 
> pushing argument 5, but GCC hasn't noted that the pushl $0 for argument 
> 4 has also changed %sp so the output reload can't be reused.
>
> There's a block of code in gcc/reload1.c which does invalidate old 
> output reloads; the attached patch adds to this block to invalidate a 
> reload of an output register if the output register is a reference to 
> memory using an autoincrement or autodecrement addressing mode.
>
> With the patch applied, I've been able to compile the test case using 
> the resulting native compiler, and a native build of NetBSD hasn't 
> failed yet, which is promising.  I have not applied any workarounds to 
> sancov.c or to tree-switch-conversion.c, and I'm also compiling GCC with 
> the default optimisation level (-O2; I haven't applied any of Matthew's 
> changes mentioned earlier).

i think i actually understand what you're fixing and my review of
this change says i don't see anything obvious wrong about it (but
i'm not going to claim i understand it fully. :)

> I've also applied this change to a copy of GCC 10.5.0 from upstream and 
> on amd64 at least there was no change to the regression test results so 
> I don't think this introduces any regressions.

FWIW, it doesn't seem to affect x86 because it doesn't end up 
having AUTO_INC_DEC set, so not compiled there.  looks like for
netbsd targets, that set that will be aarch64, arm, ia64, m68k,
pa, rs6000, sh, and vax.  (i confirmed x86 with a real test,
but this list is a grep-based one.)

this makes me wonder if we can trigger this failure mode on
these other cpus if we try hard, and this fixes for all..

> I'm curious to know if this will work for anyone else.

my netbsd-10 vax simh hung during the install phase of
build.sh release, using the -O1 hacked version, so for
now i've switched to a -current GCC 10 system, with your
this patch applied and no -O1s for cc1plus.  will be a
couple days, but i should have a result soon :)


.mrg.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.