* tree-ssa-propagate.c (set_rhs): Copy EXPR_LOCATION if
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 22 Sep 2006 08:32:45 +0000 (08:32 +0000)
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 22 Sep 2006 08:32:45 +0000 (08:32 +0000)
needed.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@117134 138bc75d-0d04-0410-961f-82ee72b054a4

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

index f81896b..11c8865 100644 (file)
@@ -1,3 +1,8 @@
+2006-09-22  Jakub Jelinek  <jakub@redhat.com>
+
+       * tree-ssa-propagate.c (set_rhs): Copy EXPR_LOCATION if
+       needed.
+
 2006-09-21  Richard Sandiford  <richard@codesourcery.com>
 
        * varasm.c (copy_constant): Fix reversed gcc_assert check.
index 111b39d..f9ece62 100644 (file)
@@ -592,6 +592,13 @@ set_rhs (tree *stmt_p, tree expr)
           || code == MODIFY_EXPR)
     return false;
 
+  if (EXPR_HAS_LOCATION (stmt)
+      && EXPR_P (expr)
+      && ! EXPR_HAS_LOCATION (expr)
+      && TREE_SIDE_EFFECTS (expr)
+      && TREE_CODE (expr) != LABEL_EXPR)
+    SET_EXPR_LOCATION (expr, EXPR_LOCATION (stmt));
+
   switch (TREE_CODE (stmt))
     {
     case RETURN_EXPR: