Speedup to propagate_one_insn

Jan Hubicka jh@suse.cz
Sat Feb 7 19:07:00 GMT 2004


> Jan Hubicka <jh@suse.cz> writes:
> 
> > Bootstrapped/regetsted i686-pc-gnu-linux, OK?
> 
> Breaks bootstrap on ia64.
> 
> ./xgcc -B./ -B/usr/local/ia64-suse-linux/bin/ -isystem /usr/local/ia64-suse-linux/include -isystem /usr/local/ia64-suse-linux/sys-include -L/tmp/cvs/gcc-20040207/Build/gcc/../ld -O2  -DIN_GCC    -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition  -isystem ./include  -fPIC -g -DHAVE_GTHR_DEFAULT -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED  -I. -I. -I../../gcc -I../../gcc/. -I../../gcc/../include   -DL_gcov -c ../../gcc/libgcov.c -o libgcc/./_gcov.o
> ../../gcc/gcov-io.c: In function `gcov_write_block':
> ../../gcc/gcov-io.c:181: internal compiler error: in allocate_reg_life_data, at flow.c:1491
> Please submit a full bug report,
> with preprocessed source if appropriate.
> See <URL:http://gcc.gnu.org/bugs.html> for instructions.

This seems to be latent bug in schedule-ebbs.  It allocate reg life
data, never compute it and then use for alias analysis, that strikes
wrong.  It is used only for comparing REG_N_SETS to 1 so it just fails.
Similarly sched2 is using uninitialized reg-scan data.

I am testing the attached patch that reorganize things in a way so
reg-scan data are always up-to-date just before sched2, but perhaps
cheaper would be to make post-reload alias analysis to not use reg-scan
data.  REG_N_SETs will be likely > 1 anyway.

We also do full flow in sched1 pass just to compute REG_N_SETs that is
just silly.  I replaced it by reg_scan, so hope it will just work.

Honza

2004-02-07  Jan Hubicka  <jh@suse.cz>
	* sched-ebb.c (schedule_ebbs): Do not allocate reg life data.
	* toplev.c (rest_of_compilation): Do just reg_scan before sched1
	* ia64.c (ia64_reorg): Compute reg_scan data.

Index: sched-ebb.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/sched-ebb.c,v
retrieving revision 1.35
diff -c -3 -p -r1.35 sched-ebb.c
*** sched-ebb.c	21 Jan 2004 20:40:04 -0000	1.35
--- sched-ebb.c	7 Feb 2004 18:51:02 -0000
*************** schedule_ebbs (FILE *dump_file)
*** 579,585 ****
  
    current_sched_info = &ebb_sched_info;
  
-   allocate_reg_life_data ();
    compute_bb_for_insn ();
  
    /* Schedule every region in the subroutine.  */
--- 579,584 ----
Index: toplev.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/toplev.c,v
retrieving revision 1.875
diff -c -3 -p -r1.875 toplev.c
*** toplev.c	6 Feb 2004 20:03:43 -0000	1.875
--- toplev.c	7 Feb 2004 18:51:02 -0000
*************** rest_of_compilation (tree decl)
*** 3412,3418 ****
    /* Any of the several passes since flow1 will have munged register
       lifetime data a bit.  We need it to be up to date for scheduling
       (see handling of reg_known_equiv in init_alias_analysis).  */
!   recompute_reg_usage (insns, !optimize_size);
  
  #ifdef INSN_SCHEDULING
    rest_of_handle_sched (decl, insns);
--- 3412,3421 ----
    /* Any of the several passes since flow1 will have munged register
       lifetime data a bit.  We need it to be up to date for scheduling
       (see handling of reg_known_equiv in init_alias_analysis).  */
!   if (optimize > 0 && flag_schedule_insns)
!     reg_scan (insns, max_reg_num (), 1);
!   else
!     recompute_reg_usage (insns, !optimize_size);
  
  #ifdef INSN_SCHEDULING
    rest_of_handle_sched (decl, insns);
Index: config/ia64/ia64.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/ia64/ia64.c,v
retrieving revision 1.274
diff -c -3 -p -r1.274 ia64.c
*** config/ia64/ia64.c	6 Feb 2004 20:03:45 -0000	1.274
--- config/ia64/ia64.c	7 Feb 2004 18:51:04 -0000
*************** ia64_reorg (void)
*** 7594,7599 ****
--- 7594,7600 ----
  	  _1mfb_ = get_cpu_unit_code ("1b_1mfb.");
  	  _1mlx_ = get_cpu_unit_code ("1b_1mlx.");
  	}
+       reg_scan (get_insns (), max_reg_num (), 0);
        schedule_ebbs (rtl_dump_file);
        finish_bundle_states ();
        if (ia64_tune == PROCESSOR_ITANIUM)



More information about the Gcc-patches mailing list