diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2017-06-02 09:57:40 +0000 |
---|---|---|
committer | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2017-06-02 09:57:40 +0000 |
commit | b7e52782f605f9dd73526cf6fcf305207612313d (patch) | |
tree | 99c858951e72bae6b7f5542f9300ad8e2e8f0b6e /gcc/builtins.c | |
parent | 1c26adb74dd3c09b755dd8d224d7a028155b110e (diff) | |
download | gcc-b7e52782f605f9dd73526cf6fcf305207612313d.zip gcc-b7e52782f605f9dd73526cf6fcf305207612313d.tar.gz gcc-b7e52782f605f9dd73526cf6fcf305207612313d.tar.bz2 |
* builtins. (expand_builtin_alloca): Remove second parameter and
infer its value from the first parameter instead.
(expand_builtin) <BUILT_IN_ALLOCA>: Adjust call to above.
From-SVN: r248818
Diffstat (limited to 'gcc/builtins.c')
-rw-r--r-- | gcc/builtins.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/gcc/builtins.c b/gcc/builtins.c index 4f6c9c4..30462ad 100644 --- a/gcc/builtins.c +++ b/gcc/builtins.c @@ -140,7 +140,7 @@ static rtx expand_builtin_memset_with_bounds (tree, rtx, machine_mode); static rtx expand_builtin_memset_args (tree, tree, tree, rtx, machine_mode, tree); static rtx expand_builtin_bzero (tree); static rtx expand_builtin_strlen (tree, rtx, machine_mode); -static rtx expand_builtin_alloca (tree, bool); +static rtx expand_builtin_alloca (tree); static rtx expand_builtin_unop (machine_mode, tree, rtx, rtx, optab); static rtx expand_builtin_frame_address (tree, tree); static tree stabilize_va_list_loc (location_t, tree, int); @@ -4914,11 +4914,10 @@ expand_builtin_frame_address (tree fndecl, tree exp) } /* Expand EXP, a call to the alloca builtin. Return NULL_RTX if we - failed and the caller should emit a normal call. CANNOT_ACCUMULATE - is the same as for allocate_dynamic_stack_space. */ + failed and the caller should emit a normal call. */ static rtx -expand_builtin_alloca (tree exp, bool cannot_accumulate) +expand_builtin_alloca (tree exp) { rtx op0; rtx result; @@ -4926,7 +4925,7 @@ expand_builtin_alloca (tree exp, bool cannot_accumulate) tree fndecl = get_callee_fndecl (exp); bool alloca_with_align = (DECL_FUNCTION_CODE (fndecl) == BUILT_IN_ALLOCA_WITH_ALIGN); - + bool alloca_for_var = CALL_ALLOCA_FOR_VAR_P (exp); bool valid_arglist = (alloca_with_align ? validate_arglist (exp, INTEGER_TYPE, INTEGER_TYPE, VOID_TYPE) @@ -4955,8 +4954,9 @@ expand_builtin_alloca (tree exp, bool cannot_accumulate) ? TREE_INT_CST_LOW (CALL_EXPR_ARG (exp, 1)) : BIGGEST_ALIGNMENT); - /* Allocate the desired space. */ - result = allocate_dynamic_stack_space (op0, 0, align, cannot_accumulate); + /* Allocate the desired space. If the allocation stems from the declaration + of a variable-sized object, it cannot accumulate. */ + result = allocate_dynamic_stack_space (op0, 0, align, alloca_for_var); result = convert_memory_address (ptr_mode, result); return result; @@ -6752,9 +6752,7 @@ expand_builtin (tree exp, rtx target, rtx subtarget, machine_mode mode, case BUILT_IN_ALLOCA: case BUILT_IN_ALLOCA_WITH_ALIGN: - /* If the allocation stems from the declaration of a variable-sized - object, it cannot accumulate. */ - target = expand_builtin_alloca (exp, CALL_ALLOCA_FOR_VAR_P (exp)); + target = expand_builtin_alloca (exp); if (target) return target; break; |