tree-ssa-dom.c (thread_across_edge): Remove updating here.
authorJan Hubicka <jh@suse.cz>
Tue, 2 Aug 2005 00:12:50 +0000 (02:12 +0200)
committerJan Hubicka <hubicka@gcc.gnu.org>
Tue, 2 Aug 2005 00:12:50 +0000 (00:12 +0000)
* tree-ssa-dom.c (thread_across_edge): Remove updating here.
(thread_block): Add it here.
* update-threading.c: New test.

From-SVN: r102648

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/tree-ssa/update-threading.c [new file with mode: 0644]
gcc/tree-ssa-dom.c
gcc/tree-ssa-threadupdate.c

index bc765ffe59a637c293b2999cbcd05823a53f4601..3be4e2192dbb6e70afaed2d170676018e3134df8 100644 (file)
@@ -1,3 +1,8 @@
+2005-08-02  Jan Hubicka  <jh@suse.cz>
+
+       * tree-ssa-dom.c (thread_across_edge): Remove updating here.
+       * tree-ssa-threadupdate.c (thread_block): Add it here.
+
 2005-08-01  James E Wilson  <wilson@specifix.com>
 
        * config/mips/mips.c (mips_encode_section_info, mips_attribute_table,
index 5ca88a25516fa4d7e5988dcb30c82e247caca8aa..2efa49912e4b3e435857f2173e55264e2446acc1 100644 (file)
@@ -1,3 +1,7 @@
+2005-08-02  Jan Hubicka  <jh@suse.cz>
+
+       * update-threading.c: New test.
+
 2005-08-01  Andrew Pinski  <pinskia@physics.uc.edu>
 
        * gcc.c-torture/compile/20050801-1.c: New test.
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/update-threading.c b/gcc/testsuite/gcc.dg/tree-ssa/update-threading.c
new file mode 100644 (file)
index 0000000..d9fdac8
--- /dev/null
@@ -0,0 +1,24 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+typedef struct { unsigned short a; } A;
+
+extern void abort (void);
+extern void exit (int);
+
+void foo (unsigned int x)
+{
+  if (x != 0x800 && x != 0x810)
+    abort ();
+}
+
+int
+main (int argc, char **argv)
+{
+  int i;
+  for (i = 0; i < 2; ++i)
+    foo (((A) { ((!(i >> 4) ? 8 : 64 + (i >> 4)) << 8) + (i << 4) } ).a);
+  exit (0);
+}
+/* { dg-final { scan-tree-dump-times ".optimized" 0 "Invalid sum"} } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
index 1a59e9eb642baeb3f852d21ad31603b6438b9cd3..6d99e54364008e158c83fb22e3fa173650c1e3eb 100644 (file)
@@ -848,8 +848,6 @@ thread_across_edge (struct dom_walk_data *walk_data, edge e)
            {
              struct edge_info *edge_info;
 
-             update_bb_profile_for_threading (e->dest, EDGE_FREQUENCY (e),
-                                              e->count, taken_edge);
              if (e->aux)
                edge_info = e->aux;
              else
index 6181b27978d65a4dd31a3fb3191c0c1e0f765bda..ab748ad7798e187b5a22117da07b76c47cb0e368 100644 (file)
@@ -724,6 +724,8 @@ thread_block (basic_block bb)
       else
        {
          edge e2 = e->aux;
+         update_bb_profile_for_threading (e->dest, EDGE_FREQUENCY (e),
+                                          e->count, e->aux);
 
          /* If we thread to a loop exit edge, then we will need to 
             rediscover the loop exit edges.  While it may seem that