aboutsummaryrefslogtreecommitdiff
path: root/gcc/combine.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2009-01-06 21:41:52 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2009-01-06 21:41:52 +0100
commit7ad7809bbffd3f79f6e8b6831fe7ac993f88dd6b (patch)
treee4aa7573a7e175a551cecb80d7c655a3680ee0ad /gcc/combine.c
parentfc7e95540999408dda59f94fdbdb96ee40ca185e (diff)
downloadgcc-7ad7809bbffd3f79f6e8b6831fe7ac993f88dd6b.zip
gcc-7ad7809bbffd3f79f6e8b6831fe7ac993f88dd6b.tar.gz
gcc-7ad7809bbffd3f79f6e8b6831fe7ac993f88dd6b.tar.bz2
re PR rtl-optimization/38722 (Revision 143027 causes ICE in find_decomposable_subregs)
PR rtl-optimization/38722 * combine.c (try_combine): Don't modify PATTERN (i3) and notes too early, only set a flag and modify after last possible undo_all point. * gfortran.dg/pr38722.f90: New test. From-SVN: r143132
Diffstat (limited to 'gcc/combine.c')
-rw-r--r--gcc/combine.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/gcc/combine.c b/gcc/combine.c
index d6f7480..0198342 100644
--- a/gcc/combine.c
+++ b/gcc/combine.c
@@ -1,6 +1,6 @@
/* Optimize by combining instructions for GNU compiler.
Copyright (C) 1987, 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
- 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
+ 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
Free Software Foundation, Inc.
This file is part of GCC.
@@ -2208,6 +2208,7 @@ try_combine (rtx i3, rtx i2, rtx i1, int *new_direct_jump_p)
/* Notes that I1, I2 or I3 is a MULT operation. */
int have_mult = 0;
int swap_i2i3 = 0;
+ int changed_i3_dest = 0;
int maxreg;
rtx temp;
@@ -2895,14 +2896,7 @@ try_combine (rtx i3, rtx i2, rtx i1, int *new_direct_jump_p)
insn_code_number = recog_for_combine (&newpat, i3, &new_i3_notes);
if (insn_code_number >= 0)
- {
- /* If we will be able to accept this, we have made a
- change to the destination of I3. This requires us to
- do a few adjustments. */
-
- PATTERN (i3) = newpat;
- adjust_for_new_dest (i3);
- }
+ changed_i3_dest = 1;
}
}
@@ -3375,6 +3369,16 @@ try_combine (rtx i3, rtx i2, rtx i1, int *new_direct_jump_p)
return 0;
}
+ /* If we will be able to accept this, we have made a
+ change to the destination of I3. This requires us to
+ do a few adjustments. */
+
+ if (changed_i3_dest)
+ {
+ PATTERN (i3) = newpat;
+ adjust_for_new_dest (i3);
+ }
+
/* We now know that we can do this combination. Merge the insns and
update the status of registers and LOG_LINKS. */