[PATCH]Keep location info when expand complex component-wise load/store.
authorRenlin Li <renlin.li@arm.com>
Fri, 6 Feb 2015 14:37:59 +0000 (14:37 +0000)
committerRenlin Li <renlin@gcc.gnu.org>
Fri, 6 Feb 2015 14:37:59 +0000 (14:37 +0000)
gcc/
* tree-ssa-forwprop.c (execute): Keep location info while rewrite
complex gimple.
* tree-ssa.c (execute_update_addresses_taken): Likewise.

From-SVN: r220480

gcc/ChangeLog
gcc/tree-ssa-forwprop.c
gcc/tree-ssa.c

index 41a824d057bbd9da250ff4020a306ae47ffa4876..47d98adbd5c2ca8271d1e47df4be1ebac2d0c7b6 100644 (file)
@@ -1,3 +1,9 @@
+2015-02-06  Renlin Li  <renlin.li@arm.com>
+
+       * tree-ssa-forwprop.c (execute): Keep location info while rewrite
+       complex gimple.
+       * tree-ssa.c (execute_update_addresses_taken): Likewise.
+
 2015-02-06  Jeff Law  <law@redhat.com>
 
        PR target/64889
index 82d832d475484e352eaf3a0a8cf55bd7e897f56c..d8db20acd3cbf010fcdeaa5e72f8c015cf41da70 100644 (file)
@@ -2274,6 +2274,8 @@ pass_forwprop::execute (function *fun)
                        = gimple_build_assign (gimple_assign_lhs (use_stmt),
                                               new_rhs);
 
+                     location_t loc = gimple_location (use_stmt);
+                     gimple_set_location (new_stmt, loc);
                      gimple_stmt_iterator gsi2 = gsi_for_stmt (use_stmt);
                      unlink_stmt_vdef (use_stmt);
                      gsi_remove (&gsi2, true);
@@ -2305,6 +2307,8 @@ pass_forwprop::execute (function *fun)
                                         TREE_TYPE (TREE_TYPE (use_lhs)),
                                         unshare_expr (use_lhs));
                  gimple new_stmt = gimple_build_assign (new_lhs, rhs);
+                 location_t loc = gimple_location (use_stmt);
+                 gimple_set_location (new_stmt, loc);
                  gimple_set_vuse (new_stmt, gimple_vuse (use_stmt));
                  gimple_set_vdef (new_stmt, make_ssa_name (gimple_vop (cfun)));
                  SSA_NAME_DEF_STMT (gimple_vdef (new_stmt)) = new_stmt;
index 5bf64476bebf45f4e160215a17fc785a4351e0fa..10d3314558e8a413a0c246b3f74809554e451af3 100644 (file)
@@ -1561,6 +1561,8 @@ execute_update_addresses_taken (void)
                                        TREE_TYPE (other),
                                        TREE_OPERAND (lhs, 0));
                    gimple load = gimple_build_assign (other, lrhs);
+                   location_t loc = gimple_location (stmt);
+                   gimple_set_location (load, loc);
                    gimple_set_vuse (load, gimple_vuse (stmt));
                    gsi_insert_before (&gsi, load, GSI_SAME_STMT);
                    gimple_assign_set_lhs (stmt, TREE_OPERAND (lhs, 0));