------- Additional Comments From hubicka at ucw dot cz  2005-06-19 16:58 -------
Subject: Re:  [4.1 regression] internal compiler error: in tree_verify_flow_info

Hi,
this is patch I am testing...

2005-06-19  Jan Hubicka  <[EMAIL PROTECTED]>
        * cfgloop.h (DLTHE_RECORD_COPY_NUMBER): New flag.
        * cfgloopmanip.c (duplicate_loop_to_header_edge): Set aux flags only
        when asked for.
        * loop-unroll.c (peel_loop_completely, unroll_loop_constant_iterations,
        unroll_loop_runtime_iterations, peel_loop_simple, unroll_loop_stupid):
        Update call of duplicate_loop_to_header_edge.
        (apply_opt_in_copies): Clear out aux pointers.

Index: cfgloop.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cfgloop.h,v
retrieving revision 1.46
diff -c -3 -p -r1.46 cfgloop.h
*** cfgloop.h   2 Jun 2005 10:19:12 -0000       1.46
--- cfgloop.h   19 Jun 2005 14:47:09 -0000
*************** extern bool can_duplicate_loop_p (struct
*** 296,301 ****
--- 296,303 ----
  
  #define DLTHE_FLAG_UPDATE_FREQ        1       /* Update frequencies in
                                           duplicate_loop_to_header_edge.  */
+ #define DLTHE_RECORD_COPY_NUMBER 2    /* Record copy number in the aux
+                                          field of newly create BB.  */
  
  extern struct loop * duplicate_loop (struct loops *, struct loop *,
                                     struct loop *);
Index: cfgloopmanip.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cfgloopmanip.c,v
retrieving revision 1.48
diff -c -3 -p -r1.48 cfgloopmanip.c
*** cfgloopmanip.c      15 Jun 2005 23:05:19 -0000      1.48
--- cfgloopmanip.c      19 Jun 2005 14:47:09 -0000
*************** duplicate_loop_to_header_edge (struct lo
*** 982,992 ****
        /* Copy bbs.  */
        copy_bbs (bbs, n, new_bbs, spec_edges, 2, new_spec_edges, loop);
  
!       for (i = 0; i < n; i++)
!       {
!         gcc_assert (!new_bbs[i]->aux);
!         new_bbs[i]->aux = (void *)(size_t)(j + 1);
!       }
  
        /* Note whether the blocks and edges belong to an irreducible loop.  */
        if (add_irreducible_flag)
--- 982,993 ----
        /* Copy bbs.  */
        copy_bbs (bbs, n, new_bbs, spec_edges, 2, new_spec_edges, loop);
  
!       if (flags & DLTHE_RECORD_COPY_NUMBER)
!       for (i = 0; i < n; i++)
!         {
!           gcc_assert (!new_bbs[i]->aux);
!           new_bbs[i]->aux = (void *)(size_t)(j + 1);
!         }
  
        /* Note whether the blocks and edges belong to an irreducible loop.  */
        if (add_irreducible_flag)
Index: loop-unroll.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/loop-unroll.c,v
retrieving revision 1.34
diff -c -3 -p -r1.34 loop-unroll.c
*** loop-unroll.c       15 Jun 2005 23:05:22 -0000      1.34
--- loop-unroll.c       19 Jun 2005 14:47:09 -0000
*************** peel_loop_completely (struct loops *loop
*** 519,525 ****
                                          loops, npeel,
                                          wont_exit, desc->out_edge,
                                          remove_edges, &n_remove_edges,
!                                         DLTHE_FLAG_UPDATE_FREQ);
        gcc_assert (ok);
  
        free (wont_exit);
--- 519,527 ----
                                          loops, npeel,
                                          wont_exit, desc->out_edge,
                                          remove_edges, &n_remove_edges,
!                                         DLTHE_FLAG_UPDATE_FREQ
!                                         | (opt_info
!                                            ? DLTHE_RECORD_COPY_NUMBER : 0));
        gcc_assert (ok);
  
        free (wont_exit);
*************** unroll_loop_constant_iterations (struct 
*** 717,723 ****
                                              loops, exit_mod,
                                              wont_exit, desc->out_edge,
                                              remove_edges, &n_remove_edges,
!                                             DLTHE_FLAG_UPDATE_FREQ);
          gcc_assert (ok);
  
            if (opt_info && exit_mod > 1)
--- 719,728 ----
                                              loops, exit_mod,
                                              wont_exit, desc->out_edge,
                                              remove_edges, &n_remove_edges,
!                                             DLTHE_FLAG_UPDATE_FREQ
!                                             | (opt_info && exit_mod > 1
!                                                ? DLTHE_RECORD_COPY_NUMBER
!                                                  : 0));
          gcc_assert (ok);
  
            if (opt_info && exit_mod > 1)
*************** unroll_loop_constant_iterations (struct 
*** 753,759 ****
                                              loops, exit_mod + 1,
                                              wont_exit, desc->out_edge,
                                              remove_edges, &n_remove_edges,
!                                             DLTHE_FLAG_UPDATE_FREQ);
          gcc_assert (ok);
   
            if (opt_info && exit_mod > 0)
--- 758,767 ----
                                              loops, exit_mod + 1,
                                              wont_exit, desc->out_edge,
                                              remove_edges, &n_remove_edges,
!                                             DLTHE_FLAG_UPDATE_FREQ
!                                             | (opt_info && exit_mod > 0
!                                                ? DLTHE_RECORD_COPY_NUMBER
!                                                  : 0));
          gcc_assert (ok);
   
            if (opt_info && exit_mod > 0)
*************** unroll_loop_constant_iterations (struct 
*** 777,783 ****
                                      loops, max_unroll,
                                      wont_exit, desc->out_edge,
                                      remove_edges, &n_remove_edges,
!                                     DLTHE_FLAG_UPDATE_FREQ);
    gcc_assert (ok);
  
    if (opt_info)
--- 785,794 ----
                                      loops, max_unroll,
                                      wont_exit, desc->out_edge,
                                      remove_edges, &n_remove_edges,
!                                     DLTHE_FLAG_UPDATE_FREQ
!                                     | (opt_info
!                                        ? DLTHE_RECORD_COPY_NUMBER
!                                          : 0));
    gcc_assert (ok);
  
    if (opt_info)
*************** unroll_loop_runtime_iterations (struct l
*** 1097,1103 ****
                                      loops, max_unroll,
                                      wont_exit, desc->out_edge,
                                      remove_edges, &n_remove_edges,
!                                     DLTHE_FLAG_UPDATE_FREQ);
    gcc_assert (ok);
    
    if (opt_info)
--- 1108,1117 ----
                                      loops, max_unroll,
                                      wont_exit, desc->out_edge,
                                      remove_edges, &n_remove_edges,
!                                     DLTHE_FLAG_UPDATE_FREQ
!                                     | (opt_info
!                                        ? DLTHE_RECORD_COPY_NUMBER
!                                          : 0));
    gcc_assert (ok);
    
    if (opt_info)
*************** peel_loop_simple (struct loops *loops, s
*** 1274,1280 ****
    ok = duplicate_loop_to_header_edge (loop, loop_preheader_edge (loop),
                                      loops, npeel, wont_exit,
                                      NULL, NULL,
!                                     NULL, DLTHE_FLAG_UPDATE_FREQ);
    gcc_assert (ok);
  
    free (wont_exit);
--- 1288,1297 ----
    ok = duplicate_loop_to_header_edge (loop, loop_preheader_edge (loop),
                                      loops, npeel, wont_exit,
                                      NULL, NULL,
!                                     NULL, DLTHE_FLAG_UPDATE_FREQ
!                                     | (opt_info
!                                        ? DLTHE_RECORD_COPY_NUMBER
!                                          : 0));
    gcc_assert (ok);
  
    free (wont_exit);
*************** unroll_loop_stupid (struct loops *loops,
*** 1422,1428 ****
    ok = duplicate_loop_to_header_edge (loop, loop_latch_edge (loop),
                                      loops, nunroll, wont_exit,
                                      NULL, NULL, NULL,
!                                     DLTHE_FLAG_UPDATE_FREQ);
    gcc_assert (ok);
    
    if (opt_info)
--- 1439,1448 ----
    ok = duplicate_loop_to_header_edge (loop, loop_latch_edge (loop),
                                      loops, nunroll, wont_exit,
                                      NULL, NULL, NULL,
!                                     DLTHE_FLAG_UPDATE_FREQ
!                                     | (opt_info
!                                        ? DLTHE_RECORD_COPY_NUMBER
!                                          : 0));
    gcc_assert (ok);
    
    if (opt_info)
*************** apply_opt_in_copies (struct opt_info *op
*** 2064,2069 ****
--- 2084,2090 ----
         duplicate_loop_to_header_edge.  */
        delta = determine_split_iv_delta ((size_t)bb->aux, n_copies,
                                        unrolling);
+       bb->aux = 0;
        orig_insn = BB_HEAD (orig_bb);
        for (insn = BB_HEAD (bb); insn != NEXT_INSN (BB_END (bb)); insn = next)
          {


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22100

Reply via email to