public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* CFG problems on alpha
@ 2001-10-24 18:35 Richard Kenner
  2001-10-24 22:56 ` Richard Henderson
  0 siblings, 1 reply; 8+ messages in thread
From: Richard Kenner @ 2001-10-24 18:35 UTC (permalink / raw)
  To: gcc

I get this:

stage1/xgcc -Bstage1/ -B/usr/local/alphaev56-dec-osf4.0c/bin/ -c  -DIN_GCC    -g
 -O2 -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes   -DHAVE_
CONFIG_H    -I. -Icp -I../../egcs/gcc -I../../egcs/gcc/cp -I../../egcs/gcc/confi
g -I../../egcs/gcc/../include ../../egcs/gcc/cp/decl2.c -o cp/decl2.o
../../egcs/gcc/cp/decl2.c: In function `decl_namespace':
../../egcs/gcc/cp/decl2.c:4397: Internal compiler error in alloc_aux_for_edge, a
t cfg.c:649

I also get an ICE in a verification routine in flow.c when compiling
the Ada library module g-regpat.adb.  I have no idea if these two are
the same problem, but I hope so ...

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: CFG problems on alpha
  2001-10-24 18:35 CFG problems on alpha Richard Kenner
@ 2001-10-24 22:56 ` Richard Henderson
  2001-10-25  0:51   ` Jan Hubicka
  2001-10-25  6:27   ` Jan Hubicka
  0 siblings, 2 replies; 8+ messages in thread
From: Richard Henderson @ 2001-10-24 22:56 UTC (permalink / raw)
  To: Richard Kenner; +Cc: gcc, jh

On Wed, Oct 24, 2001 at 09:42:02PM -0400, Richard Kenner wrote:
> ../../egcs/gcc/cp/decl2.c:4397: Internal compiler error in
> alloc_aux_for_edge, at cfg.c:649

I suspect 

Tue Oct 23 15:30:23 CEST 2001  Jan Hubicka  <jh@suse.cz>

        * toplev.c (rest_of_compilation): Use CLEANUP_UPDATE_LIFE
        to avoid update_life_info call.
        * basic-block.h (CLEANUP_UPATE_LIFE): Define.
        * cfgcleanup.c (bb_flags): New enum.
        (BB_FLAGS, BB_SET_FLAG, BB_CLEAR_FLAG, FORWARDER_BLOCK_P): New macros.
        (notice_new_block, update_forwarder_flag): New functions.
        (try_simplify_condjump): Use FORWARDER_BLOCK_P.
        (try_forward_edges): Likewise; update flags.
        (merge_blocks): Likewise.
        (outgoing_edges_match): Likewise.
        (try_crossjump_to_edge): Likewise.
        (try_optimize_cfg): Likewise; initialize and clear the flags;
        recompute life info if needed.
        (cleanup_cfg): No need to clear aux pointers.

in that it probably left the aux field non-zero.  Which 
trips the later sanity check.


r~

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: CFG problems on alpha
  2001-10-24 22:56 ` Richard Henderson
@ 2001-10-25  0:51   ` Jan Hubicka
  2001-10-25  6:27   ` Jan Hubicka
  1 sibling, 0 replies; 8+ messages in thread
From: Jan Hubicka @ 2001-10-25  0:51 UTC (permalink / raw)
  To: Richard Henderson, Richard Kenner, gcc, jh

> On Wed, Oct 24, 2001 at 09:42:02PM -0400, Richard Kenner wrote:
> > ../../egcs/gcc/cp/decl2.c:4397: Internal compiler error in
> > alloc_aux_for_edge, at cfg.c:649
> 
> I suspect 
> 
> Tue Oct 23 15:30:23 CEST 2001  Jan Hubicka  <jh@suse.cz>
> 
>         * toplev.c (rest_of_compilation): Use CLEANUP_UPDATE_LIFE
>         to avoid update_life_info call.
>         * basic-block.h (CLEANUP_UPATE_LIFE): Define.
>         * cfgcleanup.c (bb_flags): New enum.
>         (BB_FLAGS, BB_SET_FLAG, BB_CLEAR_FLAG, FORWARDER_BLOCK_P): New macros.
>         (notice_new_block, update_forwarder_flag): New functions.
>         (try_simplify_condjump): Use FORWARDER_BLOCK_P.
>         (try_forward_edges): Likewise; update flags.
>         (merge_blocks): Likewise.
>         (outgoing_edges_match): Likewise.
>         (try_crossjump_to_edge): Likewise.
>         (try_optimize_cfg): Likewise; initialize and clear the flags;
>         recompute life info if needed.
>         (cleanup_cfg): No need to clear aux pointers.
> 
> in that it probably left the aux field non-zero.  Which 
Agreed - somehow it happends to be nonzero, even when I don't see where it
is comming from (both delete_unreachable_blocks and try_optimize_cfg should
clear the aux pointers).
I am going to fix this afternoon, as now I need to wait on our study section
to get my index approved.

I apologize for the problem.
Honza
> trips the later sanity check.
> 
> 
> r~

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: CFG problems on alpha
  2001-10-24 22:56 ` Richard Henderson
  2001-10-25  0:51   ` Jan Hubicka
@ 2001-10-25  6:27   ` Jan Hubicka
  2001-10-26  0:21     ` Richard Henderson
  1 sibling, 1 reply; 8+ messages in thread
From: Jan Hubicka @ 2001-10-25  6:27 UTC (permalink / raw)
  To: Richard Henderson, Richard Kenner, gcc, jh

> On Wed, Oct 24, 2001 at 09:42:02PM -0400, Richard Kenner wrote:
> > ../../egcs/gcc/cp/decl2.c:4397: Internal compiler error in
> > alloc_aux_for_edge, at cfg.c:649
> 
> I suspect 
> 
> Tue Oct 23 15:30:23 CEST 2001  Jan Hubicka  <jh@suse.cz>
> 
>         * toplev.c (rest_of_compilation): Use CLEANUP_UPDATE_LIFE
>         to avoid update_life_info call.
>         * basic-block.h (CLEANUP_UPATE_LIFE): Define.
>         * cfgcleanup.c (bb_flags): New enum.
>         (BB_FLAGS, BB_SET_FLAG, BB_CLEAR_FLAG, FORWARDER_BLOCK_P): New macros.
>         (notice_new_block, update_forwarder_flag): New functions.
>         (try_simplify_condjump): Use FORWARDER_BLOCK_P.
>         (try_forward_edges): Likewise; update flags.
>         (merge_blocks): Likewise.
>         (outgoing_edges_match): Likewise.
>         (try_crossjump_to_edge): Likewise.
>         (try_optimize_cfg): Likewise; initialize and clear the flags;
>         recompute life info if needed.
>         (cleanup_cfg): No need to clear aux pointers.
> 
> in that it probably left the aux field non-zero.  Which 
> trips the later sanity check.
I've just checked that and it don't appear to be the case, as try_optimize_cfg
always cleansup and find_unrechable_blocks don't use aux.  I will try
to hunt it after meeting I have to come in 10 minutes.
> 
> 
> r~

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: CFG problems on alpha
  2001-10-25  6:27   ` Jan Hubicka
@ 2001-10-26  0:21     ` Richard Henderson
  2001-10-26 15:08       ` Jan Hubicka
  2001-10-26 15:16       ` Jan Hubicka
  0 siblings, 2 replies; 8+ messages in thread
From: Richard Henderson @ 2001-10-26  0:21 UTC (permalink / raw)
  To: Jan Hubicka; +Cc: Richard Kenner, gcc

On Thu, Oct 25, 2001 at 03:26:38PM +0200, Jan Hubicka wrote:
> I've just checked that and it don't appear to be the case, as
> try_optimize_cfg always cleansup and find_unrechable_blocks don't
> use aux.

It is the case.  It's a typo.  You set a bit on an edge
instead of a block, and those don't get cleaned up.

*** cfgcleanup.c        2001/10/23 13:34:23     1.10
--- cfgcleanup.c        2001/10/26 07:11:53
*************** merge_blocks (e, b, c, mode)
*** 490,496 ****
        {
          if (b_fallthru_edge->src == ENTRY_BLOCK_PTR)
            return false;
-         BB_SET_FLAG (b_fallthru_edge, BB_UPDATE_LIFE);
          notice_new_block (force_nonfallthru (b_fallthru_edge));
        }
        merge_blocks_move_predecessor_nojumps (b, c);


However, I can't figure out why this is here.  You've just insertted
a branch in a new block, and notice_new_block takes care of updating
the new block.  So what's this?

This patch appears to suffer from other problems as well.  With the
above, I get past the cfg abort on alpha to scheduler aborts due to
invalid incoming life info, and DJ has a failure building SH libgcc
that appears to be related.

It may be best to revert the patch until it gets more testing.


r~

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: CFG problems on alpha
  2001-10-26  0:21     ` Richard Henderson
@ 2001-10-26 15:08       ` Jan Hubicka
  2001-10-26 15:16       ` Jan Hubicka
  1 sibling, 0 replies; 8+ messages in thread
From: Jan Hubicka @ 2001-10-26 15:08 UTC (permalink / raw)
  To: Richard Henderson, Jan Hubicka, Richard Kenner, gcc

> On Thu, Oct 25, 2001 at 03:26:38PM +0200, Jan Hubicka wrote:
> > I've just checked that and it don't appear to be the case, as
> > try_optimize_cfg always cleansup and find_unrechable_blocks don't
> > use aux.
> 
> It is the case.  It's a typo.  You set a bit on an edge
> instead of a block, and those don't get cleaned up.
> 
> *** cfgcleanup.c        2001/10/23 13:34:23     1.10
> --- cfgcleanup.c        2001/10/26 07:11:53
> *************** merge_blocks (e, b, c, mode)
> *** 490,496 ****
>         {
>           if (b_fallthru_edge->src == ENTRY_BLOCK_PTR)
>             return false;
> -         BB_SET_FLAG (b_fallthru_edge, BB_UPDATE_LIFE);
>           notice_new_block (force_nonfallthru (b_fallthru_edge));
>         }
>         merge_blocks_move_predecessor_nojumps (b, c);
> 
> 
> However, I can't figure out why this is here.  You've just insertted
> a branch in a new block, and notice_new_block takes care of updating
> the new block.  So what's this?
It's an cut&pasto :( It should be missing there.
> 
> This patch appears to suffer from other problems as well.  With the
> above, I get past the cfg abort on alpha to scheduler aborts due to
> invalid incoming life info, and DJ has a failure building SH libgcc
> that appears to be related.
> 
> It may be best to revert the patch until it gets more testing.
Agreed. I've apparently underestimated the issue - it appears to be
relativly dificult
Maybe it is better to be solved at lower level as I've proposed in the
other email by making the "modified" flag to be set by emit insn familly
what do you think?

Honza

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: CFG problems on alpha
  2001-10-26  0:21     ` Richard Henderson
  2001-10-26 15:08       ` Jan Hubicka
@ 2001-10-26 15:16       ` Jan Hubicka
  2001-10-26 20:31         ` Hans-Peter Nilsson
  1 sibling, 1 reply; 8+ messages in thread
From: Jan Hubicka @ 2001-10-26 15:16 UTC (permalink / raw)
  To: Richard Henderson, Jan Hubicka, Richard Kenner, gcc

> On Thu, Oct 25, 2001 at 03:26:38PM +0200, Jan Hubicka wrote:
> > I've just checked that and it don't appear to be the case, as
> > try_optimize_cfg always cleansup and find_unrechable_blocks don't
> > use aux.
> 
> It is the case.  It's a typo.  You set a bit on an edge
> instead of a block, and those don't get cleaned up.
> 
> *** cfgcleanup.c        2001/10/23 13:34:23     1.10
> --- cfgcleanup.c        2001/10/26 07:11:53
> *************** merge_blocks (e, b, c, mode)
> *** 490,496 ****
>         {
>           if (b_fallthru_edge->src == ENTRY_BLOCK_PTR)
>             return false;
> -         BB_SET_FLAG (b_fallthru_edge, BB_UPDATE_LIFE);
>           notice_new_block (force_nonfallthru (b_fallthru_edge));
>         }
>         merge_blocks_move_predecessor_nojumps (b, c);
> 
> 
> However, I can't figure out why this is here.  You've just insertted
> a branch in a new block, and notice_new_block takes care of updating
> the new block.  So what's this?
Uhm, I now remember what I was shooting for - what I need to handle is
the case that force_nonfallthru will insert the jump at the end of
basic block, instead of creating new.
The b_fallthru_edge has been supposed to be b_fallthru_edge->src of course :(

> !         BB_SET_FLAG (b_fallthru_edge->src, BB_UPDATE_LIFE);

I've found another latent bug in merge_blocks_nomove - it does not update
the global_live_at_end flag of basic block. The attached patch should solve
it, I am just bootstrapping it.  OK if it passes?

Sat Oct 27 00:14:41 CEST 2001  Jan Hubicka  <jh@suse.cz>

	* cfgrtl.c (merge_blocks_nomove):  Update life info properly.

Index: cfgrtl.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cfgrtl.c,v
retrieving revision 1.4
diff -c -3 -p -r1.4 cfgrtl.c
*** cfgrtl.c	2001/10/11 03:15:24	1.4
--- cfgrtl.c	2001/10/26 22:14:27
*************** merge_blocks_nomove (a, b)
*** 603,608 ****
--- 603,609 ----
  
    /* B hasn't quite yet ceased to exist.  Attempt to prevent mishap.  */
    b->pred = b->succ = NULL;
+   a->global_live_at_end = b->global_live_at_end;
  
    expunge_block (b);
  

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: CFG problems on alpha
  2001-10-26 15:16       ` Jan Hubicka
@ 2001-10-26 20:31         ` Hans-Peter Nilsson
  0 siblings, 0 replies; 8+ messages in thread
From: Hans-Peter Nilsson @ 2001-10-26 20:31 UTC (permalink / raw)
  To: Jan Hubicka; +Cc: gcc

On Sat, 27 Oct 2001, Jan Hubicka wrote:
> Sat Oct 27 00:14:41 CEST 2001  Jan Hubicka  <jh@suse.cz>
>
> 	* cfgrtl.c (merge_blocks_nomove):  Update life info properly.

A datapoint without further analysis: with this patch (just this
patch) cris-axis-linux-gnu now builds.  So far, there are some
new failures compared to last time it built:
FAIL: gcc.c-torture/compile/20001221-1.c,  -O2
FAIL: gcc.c-torture/compile/20001221-1.c,  -Os
gcc.log says:
/home/hp/cvs_areas/gcc/cvs_write/egcs/gcc/testsuite/gcc.c-torture/compile/20001221-1.c:70: Internal compiler error in find_free_reg, at local-alloc.c:2163
I don't know how that's correlated to your changes, I just
mention in in a vain attempt at completeness.  That's all for
now: execute/ shows no failures yet but it's getting way too
late.  (Oh no: there are more execute/loop-* failures.
Oh well.)

brgds, H-P

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2001-10-26 20:31 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-10-24 18:35 CFG problems on alpha Richard Kenner
2001-10-24 22:56 ` Richard Henderson
2001-10-25  0:51   ` Jan Hubicka
2001-10-25  6:27   ` Jan Hubicka
2001-10-26  0:21     ` Richard Henderson
2001-10-26 15:08       ` Jan Hubicka
2001-10-26 15:16       ` Jan Hubicka
2001-10-26 20:31         ` Hans-Peter Nilsson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).