PATCH RFC: Implement and use VEC(T,stack)

Martin Jambor mjambor@suse.cz
Tue Jun 16 17:19:00 GMT 2009


Hi,

On Wed, Jun 10, 2009 at 09:29:30AM -0700, Ian Lance Taylor wrote:
> This is the patch I committed after another bootstrap and testuite run
> on x86_64-unknown-linux-gnu.  Thanks for the suggestions.
> 
> Ian

Since this commit, I cannot compile GCC configured with
--enable-gather-detailed-mem-stats due to syntax errors in
gcc/df-scan.c which are pasted below.  I tried to track the errors
down for a while but was not very successful so far.  Perhaps someone
who knows what is going on there can do this faster.

The errors are:

gcc -c  -g -O2 -DIN_GCC   -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wcast-qual -Wold-style-definition -Wc++-compat -Wmissing-format-attribute -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -fno-common  -DHAVE_CONFIG_H -I. -I. -I/home/mjambor/gcc/mine/gcc -I/home/mjambor/gcc/mine/gcc/. -I/home/mjambor/gcc/mine/gcc/../include -I/home/mjambor/gcc/mine/gcc/../libcpp/include  -I/home/mjambor/gcc/mine/gcc/../libdecnumber -I/home/mjambor/gcc/mine/gcc/../libdecnumber/bid -I../libdecnumber    /home/mjambor/gcc/mine/gcc/df-scan.c -o df-scan.o
/home/mjambor/gcc/mine/gcc/df-scan.c:1265:1: error: macro "VEC_stack_alloc" passed 5 arguments, but takes just 2
/home/mjambor/gcc/mine/gcc/df-scan.c: In function 'df_insn_rescan':
/home/mjambor/gcc/mine/gcc/df-scan.c:1265: error: 'VEC_stack_alloc' undeclared (first use in this function)
/home/mjambor/gcc/mine/gcc/df-scan.c:1265: error: (Each undeclared identifier is reported only once
/home/mjambor/gcc/mine/gcc/df-scan.c:1265: error: for each function it appears in.)
/home/mjambor/gcc/mine/gcc/df-scan.c:1266:1: error: macro "VEC_stack_alloc" passed 5 arguments, but takes just 2
/home/mjambor/gcc/mine/gcc/df-scan.c:1267:1: error: macro "VEC_stack_alloc" passed 5 arguments, but takes just 2
/home/mjambor/gcc/mine/gcc/df-scan.c:1268:1: error: macro "VEC_stack_alloc" passed 5 arguments, but takes just 2
/home/mjambor/gcc/mine/gcc/df-scan.c:2157:1: error: macro "VEC_stack_alloc" passed 5 arguments, but takes just 2
/home/mjambor/gcc/mine/gcc/df-scan.c: In function 'df_notes_rescan':
/home/mjambor/gcc/mine/gcc/df-scan.c:2157: error: 'VEC_stack_alloc' undeclared (first use in this function)
/home/mjambor/gcc/mine/gcc/df-scan.c:2158:1: error: macro "VEC_stack_alloc" passed 5 arguments, but takes just 2
/home/mjambor/gcc/mine/gcc/df-scan.c:3643:1: error: macro "VEC_stack_alloc" passed 5 arguments, but takes just 2
/home/mjambor/gcc/mine/gcc/df-scan.c: In function 'df_bb_refs_record':
/home/mjambor/gcc/mine/gcc/df-scan.c:3643: error: 'VEC_stack_alloc' undeclared (first use in this function)
/home/mjambor/gcc/mine/gcc/df-scan.c:3644:1: error: macro "VEC_stack_alloc" passed 5 arguments, but takes just 2
/home/mjambor/gcc/mine/gcc/df-scan.c:3645:1: error: macro "VEC_stack_alloc" passed 5 arguments, but takes just 2
/home/mjambor/gcc/mine/gcc/df-scan.c:3646:1: error: macro "VEC_stack_alloc" passed 5 arguments, but takes just 2
/home/mjambor/gcc/mine/gcc/df-scan.c:3933:1: error: macro "VEC_stack_alloc" passed 5 arguments, but takes just 2
/home/mjambor/gcc/mine/gcc/df-scan.c: In function 'df_record_entry_block_defs':
/home/mjambor/gcc/mine/gcc/df-scan.c:3933: error: 'VEC_stack_alloc' undeclared (first use in this function)
/home/mjambor/gcc/mine/gcc/df-scan.c:4104:1: error: macro "VEC_stack_alloc" passed 5 arguments, but takes just 2
/home/mjambor/gcc/mine/gcc/df-scan.c: In function 'df_record_exit_block_uses':
/home/mjambor/gcc/mine/gcc/df-scan.c:4104: error: 'VEC_stack_alloc' undeclared (first use in this function)
/home/mjambor/gcc/mine/gcc/df-scan.c:4474:1: error: macro "VEC_stack_alloc" passed 5 arguments, but takes just 2
/home/mjambor/gcc/mine/gcc/df-scan.c: In function 'df_bb_verify':
/home/mjambor/gcc/mine/gcc/df-scan.c:4474: error: 'VEC_stack_alloc' undeclared (first use in this function)
/home/mjambor/gcc/mine/gcc/df-scan.c:4475:1: error: macro "VEC_stack_alloc" passed 5 arguments, but takes just 2
/home/mjambor/gcc/mine/gcc/df-scan.c:4476:1: error: macro "VEC_stack_alloc" passed 5 arguments, but takes just 2
/home/mjambor/gcc/mine/gcc/df-scan.c:4477:1: error: macro "VEC_stack_alloc" passed 5 arguments, but takes just 2

Thanks,

Martin


> 
> 
> 2009-06-10  Ian Lance Taylor  <iant@google.com>
> 
> 	* vec.h (DEF_VEC_ALLOC_I): Use DEF_VEC_NONALLOC_FUNCS_I.
> 	(DEF_VEC_ALLOC_P): Use DEF_VEC_NONALLOC_FUNCS_P.
> 	(DEF_VEC_ALLOC_O): Use DEF_VEC_NONALLOC_FUNCS_O.
> 	(DEF_VEC_ALLOC_FUNC_P): Only define VEC_OP (T,A,alloc).
> 	(DEF_VEC_NONALLOC_FUNCS_P): New macro, broken out of old
> 	DEF_VEC_ALLOC_FUNC_P.
> 	(DEF_VEC_ALLOC_FUNC_O): Only define VEC_OP (T,A,alloc).
> 	(DEF_VEC_NONALLOC_FUNCS_O): New macro, broken out of old
> 	DEF_VEC_ALLOC_FUNC_O.
> 	(DEF_VEC_ALLOC_FUNC_I): Only define VEC_OP (T,A,alloc).
> 	(DEF_VEC_NONALLOC_FUNCS_I): New macro, broken out of old
> 	DEF_VEC_ALLOC_FUNC_I.
> 	(vec_stack_p_reserve, vec_stack_p_reserve_exact): Declare.
> 	(vec_stack_p_reserve_exact_1): Declare.
> 	(vec_stack_o_reserve, vec_stack_o_reserve_exact): Declare.
> 	(vec_stack_free): Declare.
> 	(VEC_stack_alloc): Define.
> 	(DEF_VEC_ALLOC_P_STACK, DEF_VEC_ALLOC_FUNC_P_STACK): Define.
> 	(DEF_VEC_ALLOC_O_STACK, DEF_VEC_ALLOC_FUNC_O_STACK): Define.
> 	(DEF_VEC_ALLOC_I_STACK, DEF_VEC_ALLOC_FUNC_I_STACK): Define.
> 	* vec.c (void_p): New type.  Call DEF_VEC_P and DEF_VEC_ALLOC_P
> 	for void_p.
> 	(stack_vecs): New static variable.
> 	(vec_stack_p_reserve_exact_1): New function.
> 	(vec_stack_o_reserve_1): New static function.
> 	(vec_stack_p_reserve, vec_stack_p_reserve_exact): New functions.
> 	(vec_stack_o_reserve, vec_stack_o_reserve_exact): New functions.
> 	(vec_stack_free): New function.
> 	* df-scan.c (df_ref): Use DEF_VEC_P and DEF_VEC_ALLOC_P_STACK.
> 	(VEC_df_ref_stack_alloc): Define.
> 	(df_mw_hardreg_ptr): New type.  Use DEF_VEC_P and
> 	DEF_VEC_ALLOC_P_STACK.
> 	(VEC_df_mw_hardreg_ptr_stack_alloc): Define.
> 	(struct df_collection_rec): Change _vec fields to VEC.  Remove
> 	_use fields.
> 	(df_free_collection_rec): Adjust for new fields.
> 	(df_insn_rescan): Use new df_collection_rec fields.
> 	(df_notes_rescan, df_canonize_collection_rec): Likewise.
> 	(df_ref_create_structure, df_ref_record): Likewise.
> 	(df_get_conditional_uses, df_get_call_refs): Likewise.
> 	(df_insn_refs_collect, df_bb_refs_collect): Likewise.
> 	(df_bb_refs_record, df_record_entry_block_defs): Likewise.
> 	(df_record_exit_block_uses, df_bb_verify): Likewise.
> 	(df_swap_refs): Change ref_vec parameter to VEC.  Change all
> 	callers.
> 	(df_sort_and_compress_refs): Change ref_vec parameter to VEC.
> 	Remove count parameter.  Change return type to void.  Change all
> 	callers.
> 	(df_sort_and_compress_mws): Change mw_vec parameter to VEC.
> 	Remove count parameter.  Change return type to void.  Change all
> 	callers.
> 	(df_install_refs): Change old_vec parameter to VEC.  Remove count
> 	parameter.  Change all callers.
> 	(df_install_mws): Change old_vec parameter to VEC.  Remove count
> 	parameter.  Change all callers.
> 	(df_refs_verify): Change new_rec parameter to VEC.  Change call
> 	callers.
> 	(df_mws_verify): Likewise.
> 
> 



More information about the Gcc-patches mailing list