Commit ebd765d4 by Kito Cheng Committed by Jeff Law

function.c (stack_protect_epilogue): Use if rather than switch for check…

function.c (stack_protect_epilogue): Use if rather than switch for check targetm.have_stack_protect_test.

2015-07-08  Kito Cheng  <kito.cheng@gmail.com>

	* function.c (stack_protect_epilogue): Use if rather than switch for
	check targetm.have_stack_protect_test.

From-SVN: r225599
parent ca506be6
2015-07-08 Kito Cheng <kito.cheng@gmail.com>
* function.c (stack_protect_epilogue): Use if rather than switch for
check targetm.have_stack_protect_test.
2015-07-08 Trevor Saunders <tbsaunde+gcc@tbsaunde.org> 2015-07-08 Trevor Saunders <tbsaunde+gcc@tbsaunde.org>
* defaults.h: Provide default for WORD_REGISTER_OPERATIONS. * defaults.h: Provide default for WORD_REGISTER_OPERATIONS.
......
...@@ -4874,26 +4874,18 @@ stack_protect_epilogue (void) ...@@ -4874,26 +4874,18 @@ stack_protect_epilogue (void)
tree guard_decl = targetm.stack_protect_guard (); tree guard_decl = targetm.stack_protect_guard ();
rtx_code_label *label = gen_label_rtx (); rtx_code_label *label = gen_label_rtx ();
rtx x, y, tmp; rtx x, y, tmp;
rtx_insn *seq;
x = expand_normal (crtl->stack_protect_guard); x = expand_normal (crtl->stack_protect_guard);
y = expand_normal (guard_decl); y = expand_normal (guard_decl);
/* Allow the target to compare Y with X without leaking either into /* Allow the target to compare Y with X without leaking either into
a register. */ a register. */
switch (targetm.have_stack_protect_test ()) if (targetm.have_stack_protect_test ()
{ && ((seq = targetm.gen_stack_protect_test (x, y, label)) != NULL_RTX))
case 1: emit_insn (seq);
if (rtx_insn *seq = targetm.gen_stack_protect_test (x, y, label)) else
{ emit_cmp_and_jump_insns (x, y, EQ, NULL_RTX, ptr_mode, 1, label);
emit_insn (seq);
break;
}
/* FALLTHRU */
default:
emit_cmp_and_jump_insns (x, y, EQ, NULL_RTX, ptr_mode, 1, label);
break;
}
/* The noreturn predictor has been moved to the tree level. The rtl-level /* The noreturn predictor has been moved to the tree level. The rtl-level
predictors estimate this branch about 20%, which isn't enough to get predictors estimate this branch about 20%, which isn't enough to get
......
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