OSDN Git Service

2012-02-22 Richard Guenther <rguenther@suse.de>
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 22 Feb 2012 11:21:48 +0000 (11:21 +0000)
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 22 Feb 2012 11:21:48 +0000 (11:21 +0000)
PR middle-end/52329
* gimple-fold.c (fold_stmt_1): Also canonicalize ADDR_EXPRs
for GIMPLE_DEBUG stmts.

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

gcc/ChangeLog
gcc/gimple-fold.c

index ff81abd..cc6d64c 100644 (file)
@@ -1,3 +1,9 @@
+2012-02-22  Richard Guenther  <rguenther@suse.de>
+
+       PR middle-end/52329
+       * gimple-fold.c (fold_stmt_1): Also canonicalize ADDR_EXPRs
+       for GIMPLE_DEBUG stmts.
 2012-02-22  Martin Jambor  <mjambor@suse.cz>
 
        PR middle-end/51782
 2012-02-22  Martin Jambor  <mjambor@suse.cz>
 
        PR middle-end/51782
index eae4cbe..5ba7178 100644 (file)
@@ -1250,6 +1250,18 @@ fold_stmt_1 (gimple_stmt_iterator *gsi, bool inplace)
                  changed = true;
                }
            }
                  changed = true;
                }
            }
+         else if (val
+                  && TREE_CODE (val) == ADDR_EXPR)
+           {
+             tree ref = TREE_OPERAND (val, 0);
+             tree tem = maybe_fold_reference (ref, false);
+             if (tem)
+               {
+                 tem = build_fold_addr_expr_with_type (tem, TREE_TYPE (val));
+                 gimple_debug_bind_set_value (stmt, tem);
+                 changed = true;
+               }
+           }
        }
       break;
 
        }
       break;