From: Jan Hubicka Date: Fri, 4 Aug 2006 17:05:38 +0000 (+0200) Subject: re PR rtl-optimization/26655 (ICE in ix86_secondary_memory_needed, at config/i386... X-Git-Tag: releases/gcc-4.2.0~1864 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=71156bccaa2aadde4cc420bb719626c59380561b;p=thirdparty%2Fgcc.git re PR rtl-optimization/26655 (ICE in ix86_secondary_memory_needed, at config/i386/i386.c:16446) PR target/26655 PR target/28270 * reload.c (push_reload): Patch out the mismathcing instruction; return early. (find_reload): Bail out if the instruction was patched out. From-SVN: r115928 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 642cde8cdb94..eb198c84acec 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2006-08-04 Jan Hubicka + + PR target/26655 + PR target/28270 + * reload.c (push_reload): Patch out the mismathcing instruction; return early. + (find_reload): Bail out if the instruction was patched out. + 2006-08-04 Jan Hubicka PR tree-optimization/24888 diff --git a/gcc/reload.c b/gcc/reload.c index 616a73726a16..c8c48b1dc78f 100644 --- a/gcc/reload.c +++ b/gcc/reload.c @@ -1254,7 +1254,19 @@ push_reload (rtx in, rtx out, rtx *inloc, rtx *outloc, { error_for_asm (this_insn, "impossible register constraint " "in %"); - class = ALL_REGS; + /* Avoid further trouble with this insn. */ + PATTERN (this_insn) = gen_rtx_USE (VOIDmode, const0_rtx); + /* We used to continue here setting class to ALL_REGS, but it triggers + sanity check on i386 for: + void foo(long double d) + { + asm("" :: "a" (d)); + } + Returning zero here ought to be safe as we take care in + find_reloads to not process the reloads when instruction was + replaced by USE. */ + + return 0; } } @@ -4133,6 +4145,12 @@ find_reloads (rtx insn, int replace, int ind_levels, int live_known, } #endif + /* If we detected error and replaced asm instruction by USE, forget about the + reloads. */ + if (GET_CODE (PATTERN (insn)) == USE + && GET_CODE (XEXP (PATTERN (insn), 0)) == CONST_INT) + n_reloads = 0; + /* Perhaps an output reload can be combined with another to reduce needs by one. */ if (!goal_earlyclobber)