Article View: gnu.gcc.bug
Article #1697alter_reg assigns misaligned stack slots
From: Rob McMahon
Date: Sun, 25 Sep 1988 17:28
Date: Sun, 25 Sep 1988 17:28
30 lines
1610 bytes
1610 bytes
GCC 1.28, Gould PN6000
When a pseudo-reg gets spilt to a stack slot, alter_reg now tries to re-use a
slot which was previously allocated to the same hard reg. If the mode was
different, though, this slot may have had an offset added by
assign_stack_local, which won't be appropriate for the current mode. The
result is a misaligned stack slot, and a core dump on big-endian machines that
care about alignment.
The offset could probably be adjusted, but I've just punted and stopped it
reusing a stack slot allocated to a different mode. Around line 1069 in
reload.c (alter_reg):
if (from_reg == -1)
x = assign_stack_local (GET_MODE (regno_reg_rtx[i]),
PSEUDO_REGNO_BYTES (i));
=> else if (spill_stack_slot[from_reg] != 0
=> && GET_MODE (regno_reg_rtx[i])
=> == GET_MODE (spill_stack_slot[from_reg]))
x = spill_stack_slot[from_reg];
else
spill_stack_slot[from_reg] = x
= assign_stack_local (GET_MODE (regno_reg_rtx[i]),
PSEUDO_REGNO_BYTES (i));
Rob
--
UUCP: ...!mcvax!ukc!warwick!cudcv PHONE: +44 203 523037
JANET: cudcv@uk.ac.warwick ARPA: cudcv@warwick.ac.uk
Rob McMahon, Computing Services, Warwick University, Coventry CV4 7AL, England
Technical Details
Message-ID:
<52@titania.warwick.ac.uk>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!water!watmath!uunet!axion!ist!icdoc!ukc!warwick!cudcvShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!water!watmath!uunet!axion!ist!icdoc!ukc!warwick!cudcv From: cudcv@warwick.ac.uk (Rob McMahon) Newsgroups: gnu.gcc.bug Subject: alter_reg assigns misaligned stack slots Message-ID: <52@titania.warwick.ac.uk> Date: 25 Sep 88 17:28:25 GMT Reply-To: cudcv@warwick.ac.uk (Rob McMahon) Organization: Computing Services, Warwick University, UK Lines: 30