On 25-11-14 10:28, Richard Biener wrote:
On Tue, Nov 25, 2014 at 1:01 AM, Tom de Vries <tom_devr...@mentor.com> wrote:
Richard,
I ran into a problem with my oacc kernels directive patch series where
tail-merge added another entry into a region that was previously
single-entry-single-exit.
That resulted in hitting this assert in calc_dfs_tree:
...
/* This aborts e.g. when there is _no_ path from ENTRY to EXIT at all. */
gcc_assert (di->nodes == (unsigned int) n_basic_blocks_for_fn (cfun) - 1);
...
during a call to move_sese_region_to_fn.
This patch makes sure that we abort earlier, with a clearer message of what
is actually wrong.
Bootstrapped and reg-tested on x86_64.
OK for trunk/stage3?
I believe someone made the function work for SEME regions and I believe
it is actually used to copy loops with multiple exits
This is the first part of the function comment for move_sese_region_to_fn:
...
/* Move a single-entry, single-exit region delimited by ENTRY_BB and
EXIT_BB to function DEST_CFUN. The whole region is replaced by a
single basic block in the original CFG and the new basic block is
returned. DEST_CFUN must not have a CFG yet.
Note that the region need not be a pure SESE region. Blocks inside
the region may contain calls to abort/exit. The only restriction
is that ENTRY_BB should be the only entry point and it must
dominate EXIT_BB.
...
I'm guessing you're referring to the 'not pure SESE region' bit?
So in fact, it's not a single-entry-single-exit region, but more a
single-entry-at-most-one-continuation region. [ Note that in case of f.i. an
eternal loop, we can also have single entry, no continuation. ]
so I don't see how the
patch can work in these cases?
The bbs with calls to abort/exit don't have any successor edges. verify_sese
doesn't assert anything specific about suchs bbs.
Thanks,
- Tom