summaryrefslogtreecommitdiff
path: root/gcc/loop-unroll.c
diff options
context:
space:
mode:
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2011-12-01 16:57:07 +0000
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2011-12-01 16:57:07 +0000
commit0e6893c50928aa41ac4b90e030c3107b1c1de8b3 (patch)
tree2a0b61e7b0f5bbfe78e39830f2ed9679d4bb4e5c /gcc/loop-unroll.c
parentc8c597a7f96bda049ef5dd3fe0b9fd95305b940f (diff)
downloadgcc-0e6893c50928aa41ac4b90e030c3107b1c1de8b3.tar.gz
PR rtl-optimization/51014
* loop-unroll.c (apply_opt_in_copies): Ignore label DEBUG_INSNs both from bb and orig_bb. * g++.dg/opt/pr51014.C: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@181883 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/loop-unroll.c')
-rw-r--r--gcc/loop-unroll.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/gcc/loop-unroll.c b/gcc/loop-unroll.c
index 6deff4141a3..378b933baf0 100644
--- a/gcc/loop-unroll.c
+++ b/gcc/loop-unroll.c
@@ -1,5 +1,5 @@
/* Loop unrolling and peeling.
- Copyright (C) 2002, 2003, 2004, 2005, 2007, 2008, 2010
+ Copyright (C) 2002, 2003, 2004, 2005, 2007, 2008, 2010, 2011
Free Software Foundation, Inc.
This file is part of GCC.
@@ -2262,10 +2262,15 @@ apply_opt_in_copies (struct opt_info *opt_info,
for (insn = BB_HEAD (bb); insn != NEXT_INSN (BB_END (bb)); insn = next)
{
next = NEXT_INSN (insn);
- if (!INSN_P (insn))
+ if (!INSN_P (insn)
+ || (DEBUG_INSN_P (insn)
+ && TREE_CODE (INSN_VAR_LOCATION_DECL (insn)) == LABEL_DECL))
continue;
- while (!INSN_P (orig_insn))
+ while (!INSN_P (orig_insn)
+ || (DEBUG_INSN_P (orig_insn)
+ && (TREE_CODE (INSN_VAR_LOCATION_DECL (orig_insn))
+ == LABEL_DECL)))
orig_insn = NEXT_INSN (orig_insn);
ivts_templ.insn = orig_insn;