More CFG branch merge lossage
Jan Hubicka
jh@suse.cz
Wed Mar 13 03:36:00 GMT 2002
>
> Jan,
>
> Here's another bug that seems to be a result of your recent CFG merges.
>
> On an ARM target (arm-netbsd/arm-elf), the following code will abort in
> verify_local_live_at_start() when called after sched2.
>
> This is causing a bootstrap failure while building jcf-write.c
>
> void foo(int);
>
> void f (int a, int b, int c)
> {
> int x;
>
> if (a)
> x = b > 0 ? 7 : 0;
> else
> x = c > 0 ? 9 : 0;
>
> foo(x);
> }
Hi,
the attached patch should be enought to fix the arm problems.
I am following similar strategy to peephole2 - do not trust local updating,
but do update_life_info instead. I believe it still makes sense to call
propagate_block as it will get thinks right most of time and avoid some
relaxation process.
I am bootstrapping it together with other changes on ia-64 (it takes a while)
Honza
Wed Mar 13 12:34:07 CET 2002 Jan Hubicka <jh@suse.cz>
* Makefile.in (cfgrtl): Add insn-config.h depenendency.
* cfgrtl.c: Include insn-config.h
(split_block) Dirtify block in presence of conditional execution
Index: Makefile.in
===================================================================
RCS file: /cvs/gcc/egcs/gcc/Makefile.in,v
retrieving revision 1.837
diff -c -3 -p -r1.837 Makefile.in
*** Makefile.in 2002/03/12 05:40:30 1.837
--- Makefile.in 2002/03/13 11:27:52
*************** cfg.o : cfg.c $(CONFIG_H) $(SYSTEM_H) $(
*** 1492,1498 ****
function.h except.h $(GGC_H) $(TM_P_H)
cfgrtl.o : cfgrtl.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) flags.h insn-config.h \
$(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h output.h toplev.h $(RECOG_H) \
! function.h except.h $(GGC_H) $(TM_P_H)
cfganal.o : cfganal.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(BASIC_BLOCK_H) \
hard-reg-set.h insn-config.h $(RECOG_H) $(GGC_H) $(TM_P_H)
cfgbuild.o : cfgbuild.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) flags.h insn-config.h \
--- 1492,1498 ----
function.h except.h $(GGC_H) $(TM_P_H)
cfgrtl.o : cfgrtl.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) flags.h insn-config.h \
$(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h output.h toplev.h $(RECOG_H) \
! function.h except.h $(GGC_H) $(TM_P_H) insn-config.h
cfganal.o : cfganal.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(BASIC_BLOCK_H) \
hard-reg-set.h insn-config.h $(RECOG_H) $(GGC_H) $(TM_P_H)
cfgbuild.o : cfgbuild.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) flags.h insn-config.h \
Index: cfgrtl.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cfgrtl.c,v
retrieving revision 1.35
diff -c -3 -p -r1.35 cfgrtl.c
*** cfgrtl.c 2002/03/08 20:32:14 1.35
--- cfgrtl.c 2002/03/13 11:27:55
*************** Software Foundation, 59 Temple Place - S
*** 56,61 ****
--- 56,62 ----
#include "toplev.h"
#include "tm_p.h"
#include "obstack.h"
+ #include "insn-config.h"
/* Stubs in case we don't have a return insn. */
#ifndef HAVE_return
*************** split_block (bb, insn)
*** 546,551 ****
--- 558,572 ----
propagate_block (new_bb, new_bb->global_live_at_start, NULL, NULL, 0);
COPY_REG_SET (bb->global_live_at_end,
new_bb->global_live_at_start);
+ #ifdef HAVE_conditional_execution
+ /* In the presence of conditional execution we are not able to update
+ liveness precisely. */
+ if (reload_completed)
+ {
+ bb->flags |= BB_DIRTY;
+ new_bb->flags |= BB_DIRTY;
+ }
+ #endif
}
return new_edge;
More information about the Gcc-bugs
mailing list