[PR 83990] Fix location handling in ipa_modify_call_arguments
authorMartin Jambor <mjambor@suse.cz>
Tue, 13 Feb 2018 12:25:36 +0000 (13:25 +0100)
committerMartin Jambor <jamborm@gcc.gnu.org>
Tue, 13 Feb 2018 12:25:36 +0000 (13:25 +0100)
2018-02-13  Martin Jambor  <mjambor@suse.cz>

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

gcc/ChangeLog
gcc/ipa-param-manipulation.c

index 4a79c7b648a327e43c4455f9a4797ddc0eaca99b..ac13faf58d6b7c99839fe6dab88ebfc24080424c 100644 (file)
@@ -1,3 +1,9 @@
+2018-02-13  Martin Jambor  <mjambor@suse.cz>
+
+       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  <sebastian.perta@renesas.com>
 
        * config/rl78/rl78.c (add_vector_labels): New function.
index 36290704644bff2e656d5c7dc0d148aa09486e89..1ab1fcccdaec51a95d99acac8842f687039681a7 100644 (file)
@@ -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);
                }
            }