function.c (stack_protect_epilogue): Use expand_call to expand targetm.stack_protect_...
authorSteven Bosscher <steven@gcc.gnu.org>
Mon, 16 Jul 2012 11:47:59 +0000 (11:47 +0000)
committerSteven Bosscher <steven@gcc.gnu.org>
Mon, 16 Jul 2012 11:47:59 +0000 (11:47 +0000)
* function.c (stack_protect_epilogue): Use expand_call to expand
targetm.stack_protect_fail.
* stmt.c (expand_expr_stmt): Remove now-unused function.
* tree.h (expand_expr_stmt): Remove prototype.
* doc/tm.texi.in (TARGET_STACK_PROTECT_FAIL): Document that this
hook must return a CALL_EXPR.
* doc/tm.texi: Regenerate.

From-SVN: r189522

gcc/doc/tm.texi
gcc/doc/tm.texi.in
gcc/function.c
gcc/stmt.c
gcc/tree.h

index 0208b02125ad7e27c171e36ab0f86dc2950556e3..fc3345a3b118b70d94d424f1eb5e1328492b7858 100644 (file)
@@ -4993,7 +4993,7 @@ The default version of this hook creates a variable called
 @end deftypefn
 
 @deftypefn {Target Hook} tree TARGET_STACK_PROTECT_FAIL (void)
-This hook returns a tree expression that alerts the runtime that the
+This hook returns a @code{CALL_EXPR} that alerts the runtime that the
 stack protect guard variable has been modified.  This expression should
 involve a call to a @code{noreturn} function.
 
index 044b416b332d922fd5efd245cf8f3c5d0c8ea884..33ccf8260dbd6d85b7e223a44b1111d7acb4ad03 100644 (file)
@@ -4934,7 +4934,7 @@ The default version of this hook creates a variable called
 @end deftypefn
 
 @hook TARGET_STACK_PROTECT_FAIL
-This hook returns a tree expression that alerts the runtime that the
+This hook returns a @code{CALL_EXPR} that alerts the runtime that the
 stack protect guard variable has been modified.  This expression should
 involve a call to a @code{noreturn} function.
 
index bc9a99f78c58904bcccd0cbe5dba0afbedbabafd..c56758870bc5b37af07bf493363f02d27c33605c 100644 (file)
@@ -4660,7 +4660,8 @@ stack_protect_epilogue (void)
   if (JUMP_P (tmp))
     predict_insn_def (tmp, PRED_NORETURN, TAKEN);
 
-  expand_expr_stmt (targetm.stack_protect_fail ());
+  expand_call (targetm.stack_protect_fail (), NULL_RTX, /*ignore=*/true);
+  free_temp_slots ();
   emit_label (label);
 }
 \f
index 3269de1462ba944d5b890479e08178edfc11b4d5..11180e4dc4ac4817209df30d1c48708d193c7507 100644 (file)
@@ -1399,42 +1399,6 @@ resolve_operand_name_1 (char *p, tree outputs, tree inputs, tree labels)
 
   return p;
 }
-\f
-/* Generate RTL to evaluate the expression EXP.  */
-
-void
-expand_expr_stmt (tree exp)
-{
-  rtx value;
-  tree type;
-
-  value = expand_expr (exp, const0_rtx, VOIDmode, EXPAND_NORMAL);
-  type = TREE_TYPE (exp);
-
-  /* If all we do is reference a volatile value in memory,
-     copy it to a register to be sure it is actually touched.  */
-  if (value && MEM_P (value) && TREE_THIS_VOLATILE (exp))
-    {
-      if (TYPE_MODE (type) == VOIDmode)
-       ;
-      else if (TYPE_MODE (type) != BLKmode)
-       copy_to_reg (value);
-      else
-       {
-         rtx lab = gen_label_rtx ();
-
-         /* Compare the value with itself to reference it.  */
-         emit_cmp_and_jump_insns (value, value, EQ,
-                                  expand_normal (TYPE_SIZE (type)),
-                                  BLKmode, 0, lab);
-         emit_label (lab);
-       }
-    }
-
-  /* Free any temporaries used to evaluate this expression.  */
-  free_temp_slots ();
-}
-
 \f
 /* Generate RTL to return from the current function, with no value.
    (That is, we do not do anything about returning any value.)  */
index cc840ae496eb3c703b3b2f31de23f96cd4b2c409..321ad8ab4cca644a7545e224e4931adcda9d5148 100644 (file)
@@ -5229,7 +5229,6 @@ extern tree unshare_expr (tree);
 \f
 /* In stmt.c */
 
-extern void expand_expr_stmt (tree);
 extern void expand_label (tree);
 extern void expand_goto (tree);