This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] PR21299
- From: Steven Bosscher <stevenb dot gcc at gmail dot com>
- To: gcc-patches at gcc dot gnu dot org
- Cc: iant at airs dot com
- Date: Tue, 19 Sep 2006 23:07:09 +0200
- Subject: [PATCH] PR21299
Hi,
This implements the idea proposed by Ian to fix this bug: Just purge
asms with constraints that can't be satisfied.
Bootstrapped&tested (c,c++, the only languages with asm support afaik)
on x86_64-suse-linux-gnu.
OK for trunk?
Gr.
Steven
* reload1.c (reload): Purge invalid ASMs in the final pass.
Index: reload1.c
===================================================================
--- reload1.c (revision 117002)
+++ reload1.c (working copy)
@@ -1167,6 +1167,20 @@ reload (rtx first, int global)
{
rtx *pnote;
+ /* Clean up invalid ASMs so that they don't confuse later passes.
+ See PR 21299. */
+ if (asm_noperands (PATTERN (insn)) >= 0)
+ {
+ extract_insn (insn);
+ if (!constrain_operands (1))
+ {
+ error_for_asm (insn,
+ "%<asm%> operand has impossible constraints");
+ delete_insn (insn);
+ continue;
+ }
+ }
+
if (CALL_P (insn))
replace_pseudos_in (& CALL_INSN_FUNCTION_USAGE (insn),
VOIDmode, CALL_INSN_FUNCTION_USAGE (insn));