aboutsummaryrefslogtreecommitdiff
path: root/gcc/combine.c
diff options
context:
space:
mode:
authorAndy Hutchinson <hutchinsonandy@aim.com>2008-04-04 23:45:46 +0000
committerAndy Hutchinson <hutchinsonandy@gcc.gnu.org>2008-04-04 23:45:46 +0000
commit3c2397cdcaafb0b75f88a9638412058eb959cb64 (patch)
tree608b6af689bb766fb939cdcf3c357eaf819afa5a /gcc/combine.c
parent9eb3a0dd852a6a0de2c4849391024e7efc70922d (diff)
downloadgcc-3c2397cdcaafb0b75f88a9638412058eb959cb64.zip
gcc-3c2397cdcaafb0b75f88a9638412058eb959cb64.tar.gz
gcc-3c2397cdcaafb0b75f88a9638412058eb959cb64.tar.bz2
re PR target/34916 (gcc.c-torture/execute/pr27364.c fails with -O1, -O2 and -Os)
PR rtl-optimization/34916 PR middle-end/35519 * combine.c (create_log_links): Do not create duplicate LOG_LINKS between instruction pairs From-SVN: r133920
Diffstat (limited to 'gcc/combine.c')
-rw-r--r--gcc/combine.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/gcc/combine.c b/gcc/combine.c
index 0fca12d..db828e8 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
+ 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
Free Software Foundation, Inc.
This file is part of GCC.
@@ -976,8 +976,18 @@ create_log_links (void)
assignments later. */
if (regno >= FIRST_PSEUDO_REGISTER
|| asm_noperands (PATTERN (use_insn)) < 0)
- LOG_LINKS (use_insn) =
- alloc_INSN_LIST (insn, LOG_LINKS (use_insn));
+ {
+ /* Don't add duplicate links between instructions. */
+ rtx links;
+ for (links = LOG_LINKS (use_insn); links;
+ links = XEXP (links, 1))
+ if (insn == XEXP (links, 0))
+ break;
+
+ if (!links)
+ LOG_LINKS (use_insn) =
+ alloc_INSN_LIST (insn, LOG_LINKS (use_insn));
+ }
}
next_use[regno] = NULL_RTX;
}