Hi,

gcc currently doesn't boostrap on s390 and s390x:

/build2/gcc-4.3-build/s390x-ibm-linux-gnu/libstdc++-v3/include/bits/locale_facets.tcc:2025:
 internal compiler error: in cse_find_path, at cse.c:5930
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.

The problem looks related to [Bug middle-end/30149].


The ICE is issued in cse_find_path by the following code:

if (e && e->dest != EXIT_BLOCK_PTR
    && single_pred_p (e->dest))
  {
      basic_block bb2 = e->dest;
      /* We should only see blocks here that we have not
         visited yet.  */
      gcc_assert (!TEST_BIT (cse_visited_basic_blocks, bb2->index));
        ...

This code is executed when cse_follow_jumps is enabled.  The check for 
predecessor
edges does not look sufficient to me since cse itself might remove edges what 
could lead to loops not connected to any of the other basic blocks.  These 
loops can't
be recognized with that check.

E.g.: 

1 ---> 2 --|
|      ^   |
|      |---|
|
|--> 3

Lets consider that bb 1 ends with a conditional jump insn to bb 3.  cse'ing that
insn via cse_extended_basic_block -> cse_insn now replaces the cond. jump with 
an 
unconditional one and deletes the edge 1->2.  Afterwards cse_find_path for bb 2 
is called
and since single_pred_p now returns true the assertion is triggered.

The problem is that removing edges in cse may create dead basic blocks which 
are still
mentioned in rc_order array computed when the edges were still in place.

Bye,

-Andreas-

Reply via email to