This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
reload and asms
- From: Nathan Sidwell <nathan at codesourcery dot com>
- To: gcc at gcc dot gnu dot org
- Date: Wed, 02 Jun 2004 22:38:51 +0100
- Subject: reload and asms
- Organization: CodeSourcery LLC
Hi,
I've tripped over this code in reload_as_needed (reload1.c),
/* If this was an ASM, make sure that all the reload insns
we have generated are valid. If not, give an error
and delete them. */
if (asm_noperands (PATTERN (insn)) >= 0)
for (p = NEXT_INSN (prev); p != next; p = NEXT_INSN (p))
if (p != insn && INSN_P (p)
&& GET_CODE (PATTERN (p)) != USE
&& (recog_memoized (p) < 0
|| (extract_insn (p), ! constrain_operands (1))))
{
error_for_asm (insn,
"`asm' operand requires impossible reload");
delete_insn (p);
}
It is generating false positives, because at this point the source operands
of the P insns are still pseudos, hence constrain_operands (1), fails,
even though things will all work out ok. A second problem is that
extract_insn makes the insn memoized, so merely removing the
constrain_operands call makes us fall over later, should the move's source
operand be a stack slot for instance, because we'd have remembered it
as a reg-reg move.
Removing this block of code has not caused any problems, but I'm
at a loss to understand what legitimate cases it would detect. Anybody
want to clue me in?
nathan
--
Nathan Sidwell :: http://www.codesourcery.com :: CodeSourcery LLC
nathan@codesourcery.com :: http://www.planetfall.pwp.blueyonder.co.uk