aboutsummaryrefslogtreecommitdiff
path: root/gcc/loop-unroll.c
diff options
context:
space:
mode:
authorSteven Bosscher <steven@gcc.gnu.org>2005-08-16 22:24:30 +0000
committerSteven Bosscher <steven@gcc.gnu.org>2005-08-16 22:24:30 +0000
commitf2dd440f45c158db6f71408390b278f9f20bce5d (patch)
treebacd32891aff883427b4cdbc6749fb801f19932d /gcc/loop-unroll.c
parent196f5a8dcd804b909caf88455c775393dd15fa65 (diff)
downloadgcc-f2dd440f45c158db6f71408390b278f9f20bce5d.zip
gcc-f2dd440f45c158db6f71408390b278f9f20bce5d.tar.gz
gcc-f2dd440f45c158db6f71408390b278f9f20bce5d.tar.bz2
re PR target/23376 (ICE on GCC 4.x with -O1 -funroll-loops -fvariable-expansion-in-unroller)
PR target/23376 * loop-unroll.c (analyze_insn_to_expand_var): Make sure that force_operand will work later on using have_insn_for. From-SVN: r103181
Diffstat (limited to 'gcc/loop-unroll.c')
-rw-r--r--gcc/loop-unroll.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/gcc/loop-unroll.c b/gcc/loop-unroll.c
index 8293448..4cabfd5 100644
--- a/gcc/loop-unroll.c
+++ b/gcc/loop-unroll.c
@@ -1574,7 +1574,19 @@ analyze_insn_to_expand_var (struct loop *loop, rtx insn)
&& GET_CODE (src) != MINUS
&& GET_CODE (src) != MULT)
return NULL;
-
+
+ /* Hmm, this is a bit paradoxical. We know that INSN is a valid insn
+ in MD. But if there is no optab to generate the insn, we can not
+ perform the variable expansion. This can happen if an MD provides
+ an insn but not a named pattern to generate it, for example to avoid
+ producing code that needs additional mode switches like for x87/mmx.
+
+ So we check have_insn_for which looks for an optab for the operation
+ in SRC. If it doesn't exist, we can't perform the expansion even
+ though INSN is valid. */
+ if (!have_insn_for (GET_CODE (src), GET_MODE (src)))
+ return NULL;
+
if (!XEXP (src, 0))
return NULL;