aboutsummaryrefslogtreecommitdiff
path: root/gcc/gimplify.c
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@gcc.gnu.org>2010-10-22 23:39:16 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2010-10-22 23:39:16 +0000
commit692ad9aab27d2420d85704db46dddabc2cb1b61e (patch)
treed33139567cb4e551c6210de407685e46668acbd2 /gcc/gimplify.c
parentb3f85ff2b7a16dcf31d6c2c60cfddc9d55d21d1a (diff)
downloadgcc-692ad9aab27d2420d85704db46dddabc2cb1b61e.zip
gcc-692ad9aab27d2420d85704db46dddabc2cb1b61e.tar.gz
gcc-692ad9aab27d2420d85704db46dddabc2cb1b61e.tar.bz2
gimplify.c (gimplify_variable_sized_compare): Preserve the source location info of the expression.
* gimplify.c (gimplify_variable_sized_compare): Preserve the source location info of the expression. From-SVN: r165875
Diffstat (limited to 'gcc/gimplify.c')
-rw-r--r--gcc/gimplify.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/gcc/gimplify.c b/gcc/gimplify.c
index 4753c4b..542c223 100644
--- a/gcc/gimplify.c
+++ b/gcc/gimplify.c
@@ -4634,10 +4634,10 @@ gimplify_modify_expr (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p,
static enum gimplify_status
gimplify_variable_sized_compare (tree *expr_p)
{
+ location_t loc = EXPR_LOCATION (*expr_p);
tree op0 = TREE_OPERAND (*expr_p, 0);
tree op1 = TREE_OPERAND (*expr_p, 1);
- tree t, arg, dest, src;
- location_t loc = EXPR_LOCATION (*expr_p);
+ tree t, arg, dest, src, expr;
arg = TYPE_SIZE_UNIT (TREE_TYPE (op0));
arg = unshare_expr (arg);
@@ -4646,8 +4646,11 @@ gimplify_variable_sized_compare (tree *expr_p)
dest = build_fold_addr_expr_loc (loc, op0);
t = implicit_built_in_decls[BUILT_IN_MEMCMP];
t = build_call_expr_loc (loc, t, 3, dest, src, arg);
- *expr_p
+
+ expr
= build2 (TREE_CODE (*expr_p), TREE_TYPE (*expr_p), t, integer_zero_node);
+ SET_EXPR_LOCATION (expr, loc);
+ *expr_p = expr;
return GS_OK;
}