Commit 1282697f by Aldy Hernandez Committed by Aldy Hernandez

+ * gimplify.c (gimplify_arg): Add location argument.

+       * gimplify.c (gimplify_arg): Add location argument.  Use it.
+       (gimplify_call_expr): Pass location to gimplify_arg.
+       (gimplify_modify_expr_to_memcpy): Same.
+       (gimplify_modify_expr_to_memset): Same.

From-SVN: r140917
parent 38179091
2008-10-06 Aldy Hernandez <aldyh@redhat.com>
* gimplify.c (gimplify_arg): Add location argument. Use it.
(gimplify_call_expr): Pass location to gimplify_arg.
(gimplify_modify_expr_to_memcpy): Same.
(gimplify_modify_expr_to_memset): Same.
2008-10-06 Andrew Pinski <andrew_pinski@playstation.sony.com> 2008-10-06 Andrew Pinski <andrew_pinski@playstation.sony.com>
* config/rs6000/rs6000-c.c (altivec_resolve_overloaded_builtin): * config/rs6000/rs6000-c.c (altivec_resolve_overloaded_builtin):
......
...@@ -2238,10 +2238,11 @@ maybe_with_size_expr (tree *expr_p) ...@@ -2238,10 +2238,11 @@ maybe_with_size_expr (tree *expr_p)
/* Helper for gimplify_call_expr. Gimplify a single argument *ARG_P /* Helper for gimplify_call_expr. Gimplify a single argument *ARG_P
Store any side-effects in PRE_P. */ Store any side-effects in PRE_P. CALL_LOCATION is the location of
the CALL_EXPR. */
static enum gimplify_status static enum gimplify_status
gimplify_arg (tree *arg_p, gimple_seq *pre_p) gimplify_arg (tree *arg_p, gimple_seq *pre_p, location_t call_location)
{ {
bool (*test) (tree); bool (*test) (tree);
fallback_t fb; fallback_t fb;
...@@ -2259,6 +2260,10 @@ gimplify_arg (tree *arg_p, gimple_seq *pre_p) ...@@ -2259,6 +2260,10 @@ gimplify_arg (tree *arg_p, gimple_seq *pre_p)
/* If this is a variable sized type, we must remember the size. */ /* If this is a variable sized type, we must remember the size. */
maybe_with_size_expr (arg_p); maybe_with_size_expr (arg_p);
/* Make sure arguments have the same location as the function call
itself. */
protected_set_expr_location (*arg_p, call_location);
/* There is a sequence point before a function call. Side effects in /* There is a sequence point before a function call. Side effects in
the argument list must occur before the actual call. So, when the argument list must occur before the actual call. So, when
gimplifying arguments, force gimplify_expr to use an internal gimplifying arguments, force gimplify_expr to use an internal
...@@ -2448,7 +2453,8 @@ gimplify_call_expr (tree *expr_p, gimple_seq *pre_p, bool want_value) ...@@ -2448,7 +2453,8 @@ gimplify_call_expr (tree *expr_p, gimple_seq *pre_p, bool want_value)
be the plain PARM_DECL. */ be the plain PARM_DECL. */
if ((i != 1) || !builtin_va_start_p) if ((i != 1) || !builtin_va_start_p)
{ {
t = gimplify_arg (&CALL_EXPR_ARG (*expr_p, i), pre_p); t = gimplify_arg (&CALL_EXPR_ARG (*expr_p, i), pre_p,
EXPR_LOCATION (*expr_p));
if (t == GS_ERROR) if (t == GS_ERROR)
ret = GS_ERROR; ret = GS_ERROR;
...@@ -3095,10 +3101,10 @@ gimplify_modify_expr_to_memcpy (tree *expr_p, tree size, bool want_value, ...@@ -3095,10 +3101,10 @@ gimplify_modify_expr_to_memcpy (tree *expr_p, tree size, bool want_value,
from = TREE_OPERAND (*expr_p, 1); from = TREE_OPERAND (*expr_p, 1);
from_ptr = build_fold_addr_expr (from); from_ptr = build_fold_addr_expr (from);
gimplify_arg (&from_ptr, seq_p); gimplify_arg (&from_ptr, seq_p, EXPR_LOCATION (*expr_p));
to_ptr = build_fold_addr_expr (to); to_ptr = build_fold_addr_expr (to);
gimplify_arg (&to_ptr, seq_p); gimplify_arg (&to_ptr, seq_p, EXPR_LOCATION (*expr_p));
t = implicit_built_in_decls[BUILT_IN_MEMCPY]; t = implicit_built_in_decls[BUILT_IN_MEMCPY];
...@@ -3145,7 +3151,7 @@ gimplify_modify_expr_to_memset (tree *expr_p, tree size, bool want_value, ...@@ -3145,7 +3151,7 @@ gimplify_modify_expr_to_memset (tree *expr_p, tree size, bool want_value,
to = TREE_OPERAND (*expr_p, 0); to = TREE_OPERAND (*expr_p, 0);
to_ptr = build_fold_addr_expr (to); to_ptr = build_fold_addr_expr (to);
gimplify_arg (&to_ptr, seq_p); gimplify_arg (&to_ptr, seq_p, EXPR_LOCATION (*expr_p));
t = implicit_built_in_decls[BUILT_IN_MEMSET]; t = implicit_built_in_decls[BUILT_IN_MEMSET];
gs = gimple_build_call (t, 3, to_ptr, integer_zero_node, size); gs = gimple_build_call (t, 3, to_ptr, integer_zero_node, size);
......
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