Commit 276e0224 by Alan Modra

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
parent eb723fa3
2011-08-03 Alan Modra <amodra@gmail.com>
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.
2011-08-03 Richard Guenther <rguenther@suse.de>
PR tree-optimization/49938
......@@ -176,10 +184,10 @@
boolean-typed operands for comparisons.
2011-08-02 Georg-Johann Lay <avr@gjlay.de>
* config/avr/libgcc.S: Gather related function in the
same input section.
(__mulqihi3, __mulqihi3, __divmodqi4, __divmodhi4, __udivmodsi4,
(__mulqihi3, __mulqihi3, __divmodqi4, __divmodhi4, __udivmodsi4,
__divmodsi4): Use XCALL/XJMP instead of rcall/rjmp for external
references.
(__udivmodqi4, __divmodqi4, __udivmodhi4, __divmodhi4,
......@@ -21337,7 +21345,7 @@
to cselib_lookup.
(add_uses): Likewise, also to cselib_subst_to_values.
(add_stores): Likewise.
* sched-deps.c (add_insn_mem_dependence): Pass mode to
* sched-deps.c (add_insn_mem_dependence): Pass mode to
cselib_subst_to_values.
(sched_analyze_1, sched_analyze_2): Likewise. Adjusted.
* gcse.c (do_local_cprop): Adjusted.
......
......@@ -2724,6 +2724,7 @@ repeat:
case CODE_LABEL:
case PC:
case CC0:
case RETURN:
case SCRATCH:
/* SCRATCH must be shared because they represent distinct values. */
return;
......@@ -2843,6 +2844,7 @@ repeat:
case CODE_LABEL:
case PC:
case CC0:
case RETURN:
return;
case DEBUG_INSN:
......@@ -5261,6 +5263,7 @@ copy_insn_1 (rtx orig)
case CODE_LABEL:
case PC:
case CC0:
case RETURN:
return orig;
case CLOBBER:
if (REG_P (XEXP (orig, 0)) && REGNO (XEXP (orig, 0)) < FIRST_PSEUDO_REGISTER)
......
/* 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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment