OSDN Git Service

2010-03-15 Richard Guenther <rguenther@suse.de>
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 15 Mar 2010 13:05:05 +0000 (13:05 +0000)
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 15 Mar 2010 13:05:05 +0000 (13:05 +0000)
PR tree-optimization/43317
* ipa-struct-reorg.c (create_new_general_access): Update stmt.

* gcc.dg/pr43317.c: New testcase.

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

gcc/ChangeLog
gcc/ipa-struct-reorg.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/pr43317.c [new file with mode: 0644]

index fcb5452..bd07364 100644 (file)
@@ -1,6 +1,11 @@
+2010-03-15  Richard Guenther  <rguenther@suse.de>
+
+       PR tree-optimization/43317
+       * ipa-struct-reorg.c (create_new_general_access): Update stmt.
+
 2010-03-15  Martin Jambor  <mjambor@suse.cz>
 
-       PR tree/optimization/43141
+       PR tree-optimization/43141
        * tree-sra.c (create_abstract_origin): New function.
        (modify_function): Call create_abstract_origin.
 
index e0336aa..24b42e3 100644 (file)
@@ -1389,6 +1389,7 @@ create_new_general_access (struct access_site *acc, d_str str)
         for now just reset all debug stmts referencing objects that have
         been peeled.  */
       gimple_debug_bind_reset_value (stmt);
+      update_stmt (stmt);
       break;
 
     default:
index f70b5e6..65c465f 100644 (file)
@@ -1,3 +1,8 @@
+2010-03-15  Richard Guenther  <rguenther@suse.de>
+
+       PR tree-optimization/43317
+       * gcc.dg/pr43317.c: New testcase.
+
 2010-03-14  Uros Bizjak  <ubizjak@gmail.com>
 
        * g++.dg/abi/packed1.C: Expect warning on the alpha*-*-*.
diff --git a/gcc/testsuite/gcc.dg/pr43317.c b/gcc/testsuite/gcc.dg/pr43317.c
new file mode 100644 (file)
index 0000000..3ee3ed5
--- /dev/null
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fipa-struct-reorg -fwhole-program -fipa-type-escape -g" } */
+
+extern void *malloc(__SIZE_TYPE__);
+
+struct S {
+  int i;
+};
+
+int main(int argc, char *argv[])
+{
+  int i = argc;
+  struct S *p = malloc(sizeof (struct S));
+  return p[i].i;
+}