aboutsummaryrefslogtreecommitdiff
path: root/gcc/jump.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gcc.gnu.org>2011-08-03 21:18:21 +0930
committerAlan Modra <amodra@gcc.gnu.org>2011-08-03 21:18:21 +0930
commit276e02243a3e9dfd2fa7043dba85dfb85a81f22a (patch)
tree93c98a43871a16b1f0bacd16de0dd5976685e26b /gcc/jump.c
parenteb723fa314a09f6cf8708f8243a436ff9475558c (diff)
downloadgcc-276e02243a3e9dfd2fa7043dba85dfb85a81f22a.zip
gcc-276e02243a3e9dfd2fa7043dba85dfb85a81f22a.tar.gz
gcc-276e02243a3e9dfd2fa7043dba85dfb85a81f22a.tar.bz2
re PR rtl-optimization/49941 (segmentation fault in redirect_jump_2)
PR rtl-optimization/49941 * jump.c (mark_jump_label): Comment. (mark_jump_label_1): Set JUMP_LABEL for return jumps. * emit-rtl.c (copy_rtx_if_shared_1, copy_insn_1): Leave RETURN shared. (mark_used_flags): Don't mark RETURN. From-SVN: r177268
Diffstat (limited to 'gcc/jump.c')
-rw-r--r--gcc/jump.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/gcc/jump.c b/gcc/jump.c
index 2026243..8dc78f2 100644
--- a/gcc/jump.c
+++ b/gcc/jump.c
@@ -1,7 +1,7 @@
/* Optimize jump instructions, for GNU compiler.
Copyright (C) 1987, 1988, 1989, 1991, 1992, 1993, 1994, 1995, 1996, 1997
- 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010
- Free Software Foundation, Inc.
+ 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010,
+ 2011 Free Software Foundation, Inc.
This file is part of GCC.
@@ -1039,6 +1039,7 @@ sets_cc0_p (const_rtx x)
notes. If INSN is an INSN or a CALL_INSN or non-target operands of
a JUMP_INSN, and there is at least one CODE_LABEL referenced in
INSN, add a REG_LABEL_OPERAND note containing that label to INSN.
+ For returnjumps, the JUMP_LABEL will also be set as appropriate.
Note that two labels separated by a loop-beginning note
must be kept distinct if we have not yet done loop-optimization,
@@ -1081,6 +1082,14 @@ mark_jump_label_1 (rtx x, rtx insn, bool in_mem, bool is_target)
case CALL:
return;
+ case RETURN:
+ if (is_target)
+ {
+ gcc_assert (JUMP_LABEL (insn) == NULL || JUMP_LABEL (insn) == x);
+ JUMP_LABEL (insn) = x;
+ }
+ return;
+
case MEM:
in_mem = true;
break;