Re: [PATCH] Fix CDDCE miscompilation (PR tree-optimization/55018)

2012-11-01 Thread Jan Hubicka
> On Thu, Nov 01, 2012 at 09:26:25PM +0100, Hans-Peter Nilsson wrote: > > > Attached patch was bootstrapped&tested on > > > > gcc/ > > PR tree-optimization/55018 > > * basic-block.h (dfs_find_deadend): New prototype. > > * cfganal.c (dfs_find_deadend): No longer static. Use bitmap > >

Re: [PATCH] Fix CDDCE miscompilation (PR tree-optimization/55018)

2012-11-01 Thread Jakub Jelinek
On Thu, Nov 01, 2012 at 09:26:25PM +0100, Hans-Peter Nilsson wrote: > > Attached patch was bootstrapped&tested on > > gcc/ > PR tree-optimization/55018 > * basic-block.h (dfs_find_deadend): New prototype. > * cfganal.c (dfs_find_deadend): No longer static. Use bitmap > ins

Re: [PATCH] Fix CDDCE miscompilation (PR tree-optimization/55018)

2012-11-01 Thread Hans-Peter Nilsson
> From: Steven Bosscher > Date: Sun, 28 Oct 2012 19:33:29 +0100 > On Mon, Oct 22, 2012 at 11:09 PM, Jakub Jelinek wrote: > > On Mon, Oct 22, 2012 at 10:51:43PM +0200, Steven Bosscher wrote: > > Wouldn't it be way cheaper to just export dfs_find_deadend from cfganal.c > > and call it in calc_dfs_t

Re: [PATCH] Fix CDDCE miscompilation (PR tree-optimization/55018)

2012-10-29 Thread Richard Biener
On Sun, Oct 28, 2012 at 7:33 PM, Steven Bosscher wrote: > On Mon, Oct 22, 2012 at 11:09 PM, Jakub Jelinek wrote: >> On Mon, Oct 22, 2012 at 10:51:43PM +0200, Steven Bosscher wrote: >> Wouldn't it be way cheaper to just export dfs_find_deadend from cfganal.c >> and call it in calc_dfs_tree on each

Re: [PATCH] Fix CDDCE miscompilation (PR tree-optimization/55018)

2012-10-28 Thread Steven Bosscher
On Mon, Oct 22, 2012 at 11:09 PM, Jakub Jelinek wrote: > On Mon, Oct 22, 2012 at 10:51:43PM +0200, Steven Bosscher wrote: > Wouldn't it be way cheaper to just export dfs_find_deadend from cfganal.c > and call it in calc_dfs_tree on each unconnected bb? > I.e. (untested with the exception of the tes

Re: [PATCH] Fix CDDCE miscompilation (PR tree-optimization/55018)

2012-10-22 Thread Jakub Jelinek
On Tue, Oct 23, 2012 at 12:49:44AM +0200, Steven Bosscher wrote: > On Mon, Oct 22, 2012 at 11:09 PM, Jakub Jelinek wrote: > > Wouldn't it be way cheaper to just export dfs_find_deadend from cfganal.c > > and call it in calc_dfs_tree on each unconnected bb? > > I.e. (untested with the exception of

Re: [PATCH] Fix CDDCE miscompilation (PR tree-optimization/55018)

2012-10-22 Thread Steven Bosscher
On Mon, Oct 22, 2012 at 11:09 PM, Jakub Jelinek wrote: > Wouldn't it be way cheaper to just export dfs_find_deadend from cfganal.c > and call it in calc_dfs_tree on each unconnected bb? > I.e. (untested with the exception of the testcase): FWIW, dfs_find_deadend looks broken to me for this usage

Re: [PATCH] Fix CDDCE miscompilation (PR tree-optimization/55018)

2012-10-22 Thread Steven Bosscher
On Mon, Oct 22, 2012 at 11:09 PM, Jakub Jelinek wrote: > Wouldn't it be way cheaper to just export dfs_find_deadend from cfganal.c > and call it in calc_dfs_tree on each unconnected bb? > I.e. (untested with the exception of the testcase): Better yet, I have a patch in testing now to use cfganal'

Re: [PATCH] Fix CDDCE miscompilation (PR tree-optimization/55018)

2012-10-22 Thread Jakub Jelinek
On Mon, Oct 22, 2012 at 10:51:43PM +0200, Steven Bosscher wrote: > On Mon, Oct 22, 2012 at 10:39 PM, Jakub Jelinek wrote: > > dominance.c doesn't use cfgloop.h (can it? Isn't it used before loops are > > computed, perhaps after loops destroyed, etc.), so there is no guarantee > > that loop->latch

Re: [PATCH] Fix CDDCE miscompilation (PR tree-optimization/55018)

2012-10-22 Thread Steven Bosscher
On Mon, Oct 22, 2012 at 10:39 PM, Jakub Jelinek wrote: > dominance.c doesn't use cfgloop.h (can it? Isn't it used before loops are > computed, perhaps after loops destroyed, etc.), so there is no guarantee > that loop->latch of endless loop will have the fake edge added and no other > bb before i

Re: [PATCH] Fix CDDCE miscompilation (PR tree-optimization/55018)

2012-10-22 Thread Jakub Jelinek
On Mon, Oct 22, 2012 at 10:27:52PM +0200, Steven Bosscher wrote: > I understand what your patch does, but I don't understand why it is correct. > > Why are there fake edges from bb7 and bb8 to exit when both are > reverse-reachable from exit via the infinite loops? The infinite loops > should be c

Re: [PATCH] Fix CDDCE miscompilation (PR tree-optimization/55018)

2012-10-22 Thread Steven Bosscher
On Mon, Oct 22, 2012 at 9:58 PM, Jakub Jelinek wrote: > On Mon, Oct 22, 2012 at 09:48:16PM +0200, Steven Bosscher wrote: >> On Mon, Oct 22, 2012 at 9:35 PM, Jakub Jelinek wrote: >> > On the following testcase we have two endless loops before cddce2: >> > >> > Sender_signal (int Connect) >> > { >>

Re: [PATCH] Fix CDDCE miscompilation (PR tree-optimization/55018)

2012-10-22 Thread Jakub Jelinek
On Mon, Oct 22, 2012 at 09:48:16PM +0200, Steven Bosscher wrote: > On Mon, Oct 22, 2012 at 9:35 PM, Jakub Jelinek wrote: > > On the following testcase we have two endless loops before cddce2: > > > > Sender_signal (int Connect) > > { > > int State; > > unsigned int occurrence; > > > > : > >

Re: [PATCH] Fix CDDCE miscompilation (PR tree-optimization/55018)

2012-10-22 Thread Steven Bosscher
On Mon, Oct 22, 2012 at 9:35 PM, Jakub Jelinek wrote: > Hi! > > On the following testcase we have two endless loops before cddce2: > > Sender_signal (int Connect) > { > int State; > unsigned int occurrence; > > : > if (Connect_6(D) != 0) > goto ; > else > goto ; > > : > # occ

[PATCH] Fix CDDCE miscompilation (PR tree-optimization/55018)

2012-10-22 Thread Jakub Jelinek
Hi! On the following testcase we have two endless loops before cddce2: Sender_signal (int Connect) { int State; unsigned int occurrence; : if (Connect_6(D) != 0) goto ; else goto ; : # occurrence_8 = PHI <0(7), occurrence_12(4)> occurrence_12 = occurrence_8 + 1; __buil