From: Martin Jambor Date: Tue, 13 Feb 2018 12:25:36 +0000 (+0100) Subject: [PR 83990] Fix location handling in ipa_modify_call_arguments X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b607e474206ceecadd044f592f74d1709b1b7cf6;p=gcc.git [PR 83990] Fix location handling in ipa_modify_call_arguments 2018-02-13 Martin Jambor PR c++/83990 * ipa-param-manipulation.c (ipa_modify_call_arguments): Use location of call statements, also set location of a load to a temporary. From-SVN: r257623 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 4a79c7b648a..ac13faf58d6 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2018-02-13 Martin Jambor + + PR c++/83990 + * ipa-param-manipulation.c (ipa_modify_call_arguments): Use location + of call statements, also set location of a load to a temporary. + 2018-02-13 Sebastian Perta * config/rl78/rl78.c (add_vector_labels): New function. diff --git a/gcc/ipa-param-manipulation.c b/gcc/ipa-param-manipulation.c index 36290704644..1ab1fcccdae 100644 --- a/gcc/ipa-param-manipulation.c +++ b/gcc/ipa-param-manipulation.c @@ -295,8 +295,7 @@ ipa_modify_call_arguments (struct cgraph_edge *cs, gcall *stmt, poly_int64 byte_offset = exact_div (adj->offset, BITS_PER_UNIT); base = gimple_call_arg (stmt, adj->base_index); - loc = DECL_P (base) ? DECL_SOURCE_LOCATION (base) - : EXPR_LOCATION (base); + loc = gimple_location (stmt); if (TREE_CODE (base) != ADDR_EXPR && POINTER_TYPE_P (TREE_TYPE (base))) @@ -385,6 +384,7 @@ ipa_modify_call_arguments (struct cgraph_edge *cs, gcall *stmt, else expr = create_tmp_reg (TREE_TYPE (expr)); gimple_assign_set_lhs (tem, expr); + gimple_set_location (tem, loc); gsi_insert_before (&gsi, tem, GSI_SAME_STMT); } }