Article View: gnu.gcc.bug
Article #2012gcc-1.30 bug in copy_rtx_if_shared() +(ugly)FIX
From: Jonathan
Date: Mon, 28 Nov 1988 08:51
Date: Mon, 28 Nov 1988 08:51
55 lines
2438 bytes
2438 bytes
[[ Please mail any replies to me; we don't get the mailing list here.
Apologies if this has been fixed already. ]]
Summary::
Function copy_rtx_if_shared () in GCC-1.30 contains references
to XEP(x, 1) of rtx x, when RTX_CODE(x) == MEM.
Since rtx_length[MEM] == 1, this must be wrong.
Symptom::
GCC 1.30, built with my Pyramid machine description, on a Vax,
as a cross-compiler, dumps core when compiling function calls that
pass more than 12 arguments to the callee. (Pyramids provide
12 registers for passing arguments.)
Repeat-By::
Tricky, without the Pyramid machine description.
Hence the following:
Diagnosis::
Gdb shows that cc1 is dying in copy_rtx_if_shared(), on the
indicated line:
case MEM:
[... code omitted ...]
if (GET_CODE (XEXP (x, 0)) == REG
&& (REGNO (XEXP (x, 0)) == FRAME_POINTER_REGNUM
|| REGNO (XEXP (x, 0)) == ARG_POINTER_REGNUM)
=> && CONSTANT_ADDRESS_P (XEXP (x, 1)))
return x; ^
|
huh???
MEMs only have one field. Surely this code is bogus.
Using the gdb and the -dr flag to cc1, x points to the MEM
part of the rtl generated to pass the 13th argument:
(insn 63 62 64 (set (mem:SI (reg:SI 14))
(const_int 13)) -1 (nil)
(nil))
[[Register 14 is the data stack/argument pointer.]]
Fix-By:
Removing the if() and return included above is surely safe, but will
result in unnecessary copying of shared structure. There must
be a better fix.
It's hard to come up with one, since I don't understand what
the original code was intended to do. Perhaps
if (GET_CODE (XEXP (x, 0)) == REG
&& (REGNO (XEXP (x, 0)) == FRAME_POINTER_REGNUM
|| REGNO (XEXP (x, 0)) == ARG_POINTER_REGNUM))
is correct?
Technical Details
Message-ID:
<8811280851.AA03886@comp.vuw.ac.nz>Path:
arc1-ca.pugleaf.net!utzoo!telly!ddsw1!lll-winken!killer!mit-eddie!bloom-beacon!tut.cis.ohio-state.edu!comp.vuw.ac.nz!jonathanShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!telly!ddsw1!lll-winken!killer!mit-eddie!bloom-beacon!tut.cis.ohio-state.edu!comp.vuw.ac.nz!jonathan From: jonathan@comp.vuw.ac.nz (Jonathan) Newsgroups: gnu.gcc.bug Subject: gcc-1.30 bug in copy_rtx_if_shared() +(ugly)FIX Message-ID: <8811280851.AA03886@comp.vuw.ac.nz> Date: 28 Nov 88 08:51:26 GMT Sender: daemon@tut.cis.ohio-state.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 54