From: Jan Hubicka Date: Tue, 2 Aug 2005 00:12:50 +0000 (+0200) Subject: tree-ssa-dom.c (thread_across_edge): Remove updating here. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=5e5a504e300285125a09fb0ea3031187f98f4e68;p=gcc.git tree-ssa-dom.c (thread_across_edge): Remove updating here. * tree-ssa-dom.c (thread_across_edge): Remove updating here. (thread_block): Add it here. * update-threading.c: New test. From-SVN: r102648 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index bc765ffe59a..3be4e2192db 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2005-08-02 Jan Hubicka + + * 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 * config/mips/mips.c (mips_encode_section_info, mips_attribute_table, diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 5ca88a25516..2efa49912e4 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2005-08-02 Jan Hubicka + + * update-threading.c: New test. + 2005-08-01 Andrew Pinski * 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 index 00000000000..d9fdac8a66f --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/update-threading.c @@ -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" } } */ diff --git a/gcc/tree-ssa-dom.c b/gcc/tree-ssa-dom.c index 1a59e9eb642..6d99e543640 100644 --- a/gcc/tree-ssa-dom.c +++ b/gcc/tree-ssa-dom.c @@ -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 diff --git a/gcc/tree-ssa-threadupdate.c b/gcc/tree-ssa-threadupdate.c index 6181b27978d..ab748ad7798 100644 --- a/gcc/tree-ssa-threadupdate.c +++ b/gcc/tree-ssa-threadupdate.c @@ -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