diff options
author | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-03-20 13:22:49 +0000 |
---|---|---|
committer | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-03-20 13:22:49 +0000 |
commit | 1a8bf94d3197b82fc41436b2a3043f339536f603 (patch) | |
tree | 4d66b707d35b8c679d14f070a4cc42b15a95d2a8 | |
parent | 5cc6d735d73e4810078b05e651751ba7b84539be (diff) | |
download | gcc-1a8bf94d3197b82fc41436b2a3043f339536f603.tar.gz |
2008-03-20 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk r133366
* gcc/basilys.c: pass_basilys is now a gimple_opt_pass.
* gcc/tree-pass.h: pass_basilys is now a gimple_opt_pass.
pass_compiler_probe now declared here.
* gcc/passes.c: using new struct-s for passes.
* gcc/compiler-probe.h: moved pass_compiler_probe from here to tree-pass.h
* gcc/compiler-probe.c: pass_compiler_probe is a gimple_opt_pass.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@133372 138bc75d-0d04-0410-961f-82ee72b054a4
291 files changed, 7156 insertions, 1995 deletions
diff --git a/ChangeLog.melt b/ChangeLog.melt index 3f886ad335f..9330af713d7 100644 --- a/ChangeLog.melt +++ b/ChangeLog.melt @@ -1,4 +1,7 @@ +2008-03-20 Basile Starynkevitch <basile@starynkevitch.net> + MELT branch merged with trunk r133366 + 2008-03-11 Basile Starynkevitch <basile@starynkevitch.net> MELT branch merged with trunk r133288 diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 7c597afe4ef..9134b4bc93a 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,12 +1,294 @@ <<<<<<< .mine <<<<<<< .mine <<<<<<< .mine +<<<<<<< .mine +<<<<<<< .mine 2008-03-02 Basile Starynkevitch <basile@starynkevitch.net> merged with trunk 132817 ======= ======= ======= +======= +======= +2008-03-20 Kai Tietz <kai.tietz@onevision.com> + + * c-format.c (replace_format_name_to_system_name): New. + (cmp_attribs): New. + (convert_format_name_to_system_name): New. + (decode_format_attr): Add use of convert_format_name_to_system_name. + (format_types_orig): Add gnu_ prefix to names. + (check_format_info_main): Special treating of \0 escaped names for + supporting multi-character format specifiers as I32, I64. + (TARGET_OVERRIDES_FORMAT_ATTRIBUTES): Use of user defined attributes. + (gnu_target_overrides_format_attributes): New. + * c-format.h: Add structure target_ovr_attr to hold + system specific formatter names. + * config.gcc: Add for x86&x86_64 cygwin and mingw32 targets the + msformat-c.o file to c_target_objs and cxx_target_objs. + * config/i386/mingw32.h (TARGET_OVERRIDES_FORMAT_ATTRIBUTES): New. + (TARGET_OVERRIDES_FORMAT_ATTRIBUTES_COUNT): New. + (TARGET_N_FORMAT_TYPES): New. + * config/i386/msformat-c.c: New. + * config/i386/t-cygming: Add build rule for msformat-c.o. + * doc/extend.texi: Add new format names gnu_* and ms_* and + further details. + * doc/tm.texi: (TARGET_OVERRIDES_FORMAT_ATTRIBUTES): New. + +2008-03-20 Ira Rosen <irar@il.ibm.com> + + * doc/invoke.texi (-O3): Add -ftree-vectorize to the list of + optimizations turned on under -O3. + (ftree-vectorize): Add that the flag is turned on with -O3. + +2008-03-20 Ben Elliston <bje@au.ibm.com> + + * regmove.c (try_auto_increment): Fix spelling error in comment. + * final.c (final_scan_insn): Likewise. + +2008-03-20 Uros Bizjak <ubizjak@gmail.com> + + PR target/14552 + * config/i386/mmx.md (*mov<mode>_internal_rex64"): Adjust register + allocator preferences for "y" and "r" class registers. + ("*mov<mode>_internal"): Ditto. + ("*movv2sf_internal_rex64"): Ditto. + ("*movv2sf_internal"): Ditto. + +2008-03-19 Michael Matz <matz@suse.de> + + PR middle-end/35616 + * calls.c (expand_call): Check overlap of arguments with call + address for sibcalls. + +2008-03-19 Uros Bizjak <ubizjak@gmail.com> + + PR target/35496 + * stor-layout.c (update_alignment_for_field): Set minimum alignment + of the underlying type of a MS bitfield layout to the natural + alignment of the type. + +2008-03-19 Jan Hubicka <jh@suse.cz> + + PR other/35094 + * toplev.c (decode_d_option): Handle all CPP flags. + * tree-vrp.c: Update tree_pass descriptors. + * regrename.c: Update tree_pass descriptors. + * fwprop.c: Update tree_pass descriptors. + * doc/invoke.texi: Remove documentation of dropped -d? flags. + * tree-into-ssa.c: Update tree_pass descriptors. + * tree-dump.c: Update tree_pass descriptors. + * tree-complex.c: Update tree_pass descriptors. + * tree-dump.h: Update tree_pass descriptors. + * see.c: Update tree_pass descriptors. + * cgraphbuild.c: Update tree_pass descriptors. + * tracer.c: Update tree_pass descriptors. + * tree-loop-distribution.c: Update tree_pass descriptors. + * cgraph.c: Update tree_pass descriptors. + * postreload-gcse.c: Update tree_pass descriptors. + * postreload.c: Update tree_pass descriptors. + * tree-ssa-loop-ch.c: Update tree_pass descriptors. + * tree-tailcall.c: Update tree_pass descriptors. + * tree-pass.h (tree_opt_pass): Rename to ... + (opt_pass) ... this one; add "type" field and remove letter field. + (gimple_opt_pass, rtl_opt_pass, simple_ipa_opt_pass): New. + (execute_pass_list, execute_ipa_pass_list, all_passes, all_ipa_passes, + all_lowering_passes): Update declaration. + * ipa-cp.c: Update tree_pass descriptors. + * final.c: Update tree_pass descriptors. + * omp-low.c: Update tree_pass descriptors. + * tree-ssa-dse.c: Update tree_pass descriptors. + * ipa-reference.c: Update tree_pass descriptors. + * tree-ssa-uncprop.c: Update tree_pass descriptors. + * auto-inc-dec.c: Update tree_pass descriptors. + * reorg.c: Update tree_pass descriptors. + * cgraphunit.c: Update tree_pass descriptors. + * tree-ssa-copyrename.c: Update tree_pass descriptors. + * tree-ssa-ccp.c: Update tree_pass descriptors. + * df-core.c: Update tree_pass descriptors. + * mode-switching.c: Update tree_pass descriptors. + * tree-nomudflap.c: Update tree_pass descriptors. + * modulo-sched.c: Update tree_pass descriptors. + * ipa-pure-const.c: Update tree_pass descriptors. + * cse.c: Update tree_pass descriptors. + * web.c: Update tree_pass descriptors. + * tree-stdarg.c: Update tree_pass descriptors. + * tree-ssa-math-opts.c: Update tree_pass descriptors. + * tree-ssa-dom.c: Update tree_pass descriptors. + * tree-nrv.c: Update tree_pass descriptors. + * tree-ssa-alias.c: Update tree_pass descriptors. + * loop-init.c: Update tree_pass descriptors. + * gimple-low.c: Update tree_pass descriptors. + * ipa-inline.c: Update tree_pass descriptors. + * tree-ssa-sink.c: Update tree_pass descriptors. + * global.c: Update tree_pass descriptors. + * ifcvt.c: Update tree_pass descriptors. + * jump.c: Update tree_pass descriptors. + * predict.c: Update tree_pass descriptors. + * tree-ssa-loop.c: Update tree_pass descriptors. + * recog.c: Update tree_pass descriptors. + * dse.c: Update tree_pass descriptors. + * tree-ssa-ifcombine.c: Update tree_pass descriptors. + * tree-eh.c: Update tree_pass descriptors. + * regmove.c: Update tree_pass descriptors. + * local-alloc.c + * function.c: Update tree_pass descriptors. + * tree-vectorizer.c: Update tree_pass descriptors. + * gcse.c: Update tree_pass descriptors. + * ipa-type-escape.c: Update tree_pass descriptors. + * tree-if-conv.c: Update tree_pass descriptors. + * init-regs.c: Update tree_pass descriptors. + * ipa.c: Update tree_pass descriptors. + * tree-ssa-phiopt.c: Update tree_pass descriptors. + * rtl-factoring.c: Update tree_pass descriptors. + * lower-subreg.c: Update tree_pass descriptors. + * bt-load.c: Update tree_pass descriptors. + * tree-dfa.c: Update tree_pass descriptors. + * except.c: Update tree_pass descriptors. + * emit-rtl.c: Update tree_pass descriptors. + * cfgexpand.c: Update tree_pass descriptors. + * tree-cfgcleanup.c: Update tree_pass descriptors. + * cfgcleanup.c: Update tree_pass descriptors. + * tree-ssa-pre.c: Update tree_pass descriptors. + * tree-sra.c: Update tree_pass descriptors. + * tree-mudflap.c: Update tree_pass descriptors. + * tree-ssa-copy.c: Update tree_pass descriptors. + * cfglayout.c: Update tree_pass descriptors. + * tree-ssa-forwprop.c: Update tree_pass descriptors. + * tree-ssa-dce.c: Update tree_pass descriptors. + * tree-ssa.c: Update tree_pass descriptors. + * regclass.c: Update tree_pass descriptors. + * integrate.c: Update tree_pass descriptors. + * tree-optimize.c: Update tree_pass descriptors. + * tree-ssa-phiprop.c: Update tree_pass descriptors. + * tree-object-size.c: Update tree_pass descriptors. + * combine.c: Update tree_pass descriptors. + * tree-outof-ssa.c: Update tree_pass descriptors. + * bb-reorder.c: Update tree_pass descriptors. + * stack-ptr-mod.c: Update tree_pass descriptors. + * var-tracking.c: Update tree_pass descriptors. + * tree-profile.c: Update tree_pass descriptors. + * tree-vect-generic.c: Update tree_pass descriptors. + * reg-stack.c: Update tree_pass descriptors. + * sched-rgn.c: Update tree_pass descriptors. + * tree-ssa-structalias.c: Update tree_pass descriptors. + * tree-cfg.c: Update tree_pass descriptors. + * passes.c (current_pass): Update declaration. + (finish_optimization_passes): Update. + (all_passes, all_ipa_passes, all_lowering_passes): Update declaration. + (register_one_dump_file, register_dump_files_1, next_pass_1): + Update arguments. + (init_optimization_passes): Update handling of new types. + (execute_one_pass, execute_pass_list, execute_ipa_pass_list): Update. + * ipa-struct-reorg.c: Update tree_pass descriptors. + * tree-ssa-reassoc.c: Update tree_pass descriptors. + * combine-stack-adj.c: Update tree_pass descriptors. + * cfgrtl.c: Update tree_pass descriptors. + * dce.c: Update tree_pass descriptors. + * tree-ssanames.c: Update tree_pass descriptors. + +2008-03-19 Richard Guenther <rguenther@suse.de> + + PR middle-end/35609 + * tree-ssa.c (always_executed): New global flag. + (warn_uninitialized_var): If !always_executed warn with "maybe" + instead of "is". + (execute_early_warn_uninitialized): Compute post-dominators. + Initialize always_executed before processing each basic block. + +>>>>>>> .r133365 +2008-03-18 Mikulas Patocka <mikulas@artax.karlin.mff.cuni.cz> + + PR target/35504 + * config/i386/i386.c (x86_this_parameter): Calculate correct location + of "this" pointer when "regparm = N" or "fastcall" is in effect. + +2008-03-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> + + * doc/include/texinfo.tex: Update to version 2008-03-17.10. + +2008-03-18 Paolo Bonzini <bonzini@gnu.org> + + * expr.c (store_expr): Assume lang_hooks.reduce_bit_field_operations + is true. + (expand_expr_real_1) <REDUCE_BIT_FIELD>: Don't look at ignore. + (expand_expr_real_1): Assume lang_hooks.reduce_bit_field_operations + is true. Add "&& !ignore" condition to reduce_bit_field. Modify + target after ignore has been set, and move there also the commputation + of subtarget and original_target. + * langhooks-def.h (LANG_HOOKS_REDUCE_BIT_FIELD_OPERATIONS): Delete. + (LANG_HOOKS_INITIALIZER): Remove it. + * langhooks.h (struct lang_hooks): Remove reduce_bit_field_operations. + +2008-03-18 Richard Guenther <rguenther@suse.de> + + * tree-ssa-sccvn.c (visit_reference_op_load): If the lookup + found an expression with constants, note that in the VN for the lhs. + * tree-ssa-pre.c (eliminate): Visit COND_EXPR statements and + fold them to constants if possible. Run cleanup_cfg if done so. + (execute_pre): Return todo. + (do_pre): Likewise. + (execute_fre): Likewise. + * tree-ssa-forwprop.c (can_propagate_from): Allow propagation + of constants. + (get_prop_source_stmt): Look through pointer conversions. + +2008-03-18 Jan Hubicka <jh@suse.cz> + + * tree-pretty-print.c: Include predict.h. + (dump_generic_node): Dump predictor. + * tree.h (PREDICT_EXPR_OUTCOME, PREDICT_EXPR_PREDICTION): Update. + * tree-gimple.c (is_gimple_stmt): Add PREDICT_EXPR. + * gimple-low.c (lower_stmt): Likewise. + * expr.c (expand_expr_real): Likewise. + * predict.c (tree_bb_level_predictions): Use PREDICT_EXPRs and remove + them. + (build_predict_expr, build_predict_expr): New. + * predict.h (predictor_name, build_predict_expr): Update. + * c-typeck.c (c_finish_bc_stmt): Add prediction. + * gimplify.c (gimplify_expr): Add PREDICT_EXPR. + * predict.def (PRED_CONTINUE): Update hitrate. + * tree.def (PREDICT_EXPR): Define. + * tree-ssa-dce.c (mark_stmt_if_obviously_necessary): Mark PREDICT_EXPR; + do not handle BIND_EXPR. + * tree-inline.c (estimate_num_insns_1): PREDICT_EXPR is free. + * tree-cfg.c (verify_gimple_stmt): PREDICT_EXPR is valid. + * tree-ssa-operands.c (get_expr_operands): PREDICT_EXPR takes no + operands. + +2008-03-18 Michael Matz <matz@suse.de> + + * gcov-io.h (__gcov_merge_ior, __gcov_fork): Mark hidden. + +2008-03-18 Richard Guenther <rguenther@suse.de> + + * tree-gimple.h (is_gimple_invariant_address): Declare. + (is_gimple_constant): Likewise. + * tree-gimple.c (is_gimple_constant): New function. + (is_gimple_invariant_address): Likewise. + (is_gimple_min_invariant): Implement in terms of is_gimple_constant + and is_gimple_invariant_address. + * tree-ssa-loop-niter.c (expand_simple_operations): Revert + previous change. + * tree-data-ref.c (get_references_in_stmt): A SSA_NAME is not + an addressable base. + +2008-03-18 Jakub Jelinek <jakub@redhat.com> + + PR middle-end/35611 + * gimplify.c (gimplify_expr): Gimplify second operand of + OMP_ATOMIC_LOAD. + +2008-03-17 Richard Guenther <rguenther@suse.de> + + PR tree-optimization/19637 + * fold-const.c (fold_unary): Remove restrictions of removing + intermediate pointer-conversions (P2)(P1)P0. + * tree-ssa-ccp.c (maybe_fold_stmt_addition): Recover from + conversion to void pointer. + (get_maxval_strlen): Handle addresses of the form &(*p)[0]. + +>>>>>>> .r133327 2008-03-16 James E. Wilson <wilson@tuliptree.org> PR debug/31510 @@ -73,7 +355,7 @@ (maybe_fold_stmt_addition): Likewise. 2008-03-15 Bjoern Haase <bjoern.m.haase@web.de> - Anatoly Sokolov <aesok@post.ru> + Anatoly Sokolov <aesok@post.ru> * gcc/gcc/config/avr/avr.c (avr_arch_types): Add avr6 entry. (avr_arch): Add ARCH_AVR6. @@ -365,11 +647,11 @@ PR target/35540 * config/i386/i386.md (paritysi2, paritydi2): Use register_operand - constraint for operand 1. - (paritysi2_cmp): Use register_operand constraint for operand 2. + predicate for operand 1. + (paritysi2_cmp): Use register_operand predicate for operand 2. Use earlyclobber modifier for operand 1. Remove support for memory operands. - (paritydi2_cmp): Use register_operand constraint for operand 3. + (paritydi2_cmp): Use register_operand predicate for operand 3. Use earlyclobber modifier for operand 1. Remove support for memory operands. @@ -915,7 +1197,7 @@ 2008-03-04 Danny Smith <dannysmith@users.sourceforge.net> * config/i386/i386.md (allocate_stack_worker_32): Use __chkstk - label to probe the stack. + label to probe the stack. 2008-03-04 Danny Smith <dannysmith@users.sourceforge.net> @@ -1481,7 +1763,7 @@ 2008-02-26 Manuel Lopez-Ibanez <manu@gcc.gnu.org> - PR 26264 + PR 26264 * builtins.def (BUILT_IN_STDARG_START): Remove. * builtins.c (expand_builtin): Remove BUILT_IN_STDARG_START. * tree-stdarg.c (execute_optimize_stdarg): Likewise. @@ -1661,7 +1943,7 @@ PR fortran/29549 * doc/invoke.texi (-fcx-limited-range): Document new option. * toplev.c (process_options): Handle -fcx-fortran-rules. - * common.opt: Add documentation for -fcx-fortran-rules. + * common.opt: Add documentation for -fcx-fortran-rules. 2008-02-25 Janne Blomqvist <jb@gcc.gnu.org> diff --git a/gcc/ChangeLog.melt b/gcc/ChangeLog.melt index 3b01a595ac8..eede9775a32 100644 --- a/gcc/ChangeLog.melt +++ b/gcc/ChangeLog.melt @@ -1,3 +1,13 @@ + +2008-03-20 Basile Starynkevitch <basile@starynkevitch.net> + MELT branch merged with trunk r133366. + * basilys.c: pass_basilys is now a gimple_opt_pass. + * tree-pass.h: pass_basilys is now a gimple_opt_pass. + pass_compiler_probe now declared here. + * passes.c: using new struct-s for passes. + * compiler-probe.h: moved pass_compiler_probe from here to tree-pass.h + * compiler-probe.c: pass_compiler_probe is a gimple_opt_pass. + 2008-03-18 Basile Starynkevitch <basile@starynkevitch.net> * melt-cc-script.prot: added generation of date & md5sum. diff --git a/gcc/DATESTAMP b/gcc/DATESTAMP index e43e62f6ee7..fdd996bdbd7 100644 --- a/gcc/DATESTAMP +++ b/gcc/DATESTAMP @@ -1 +1 @@ -20080317 +20080320 diff --git a/gcc/Makefile.in b/gcc/Makefile.in index 823582d0210..2780de4c29a 100644 --- a/gcc/Makefile.in +++ b/gcc/Makefile.in @@ -3912,6 +3912,8 @@ clean: mostlyclean lang.clean else if [ "x$(MULTILIB_OPTIONS)" != x ] ; then \ rm -rf `echo $(MULTILIB_OPTIONS) | sed -e 's/\// /g'`; \ fi ; fi +# Also delete the run-basilys.h.gch generated file by run-basilys.d target + rm -f run-basilys.h.gch # Delete all files that users would normally create # while building and installing GCC. @@ -4566,8 +4568,9 @@ MELT_CFLAGS= $(X_CFLAGS) $(T_CFLAGS) $(CFLAGS) $(XCFLAGS) run-basilys.d: run-basilys.h \ $(CONFIG_H) $(SYSTEM_H) $(TIMEVAR_H) $(TM_H) $(TREE_H) $(GGC_H) \ tree-pass.h basilys.h gt-basilys.h -## perhaps this should really use depcomp - $(CC) -MT run-basilys-deps -MMD $(ALL_CFLAGS) $(ALL_CPPFLAGS) $< +## perhaps this should really use depcomp, because this works only if +## CC is some gcc 4.x since it use the precompiled headers feature + $(CC) -MT run-basilys-deps -MMD $(ALL_CFLAGS) $(ALL_CPPFLAGS) $< -o run-basilys.h.gch .PHONY: run-basilys-deps ## the include below defines the dependencies of run-basilys-deps diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 5960ea96fad..9847af6633e 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,7 @@ +2008-03-18 Paolo Bonzini <bonzini@gnu.org> + + * misc.c (LANG_HOOKS_REDUCE_BIT_FIELD_OPERATIONS): Delete. + 2008-03-15 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> * gnat_rm.texi (Implementation Defined Characteristics) diff --git a/gcc/ada/misc.c b/gcc/ada/misc.c index da0f2d96a0a..fbb6b8ecb77 100644 --- a/gcc/ada/misc.c +++ b/gcc/ada/misc.c @@ -129,8 +129,6 @@ static tree gnat_type_max_size (const_tree); #define LANG_HOOKS_WRITE_GLOBALS gnat_write_global_declarations #undef LANG_HOOKS_FINISH_INCOMPLETE_DECL #define LANG_HOOKS_FINISH_INCOMPLETE_DECL gnat_finish_incomplete_decl -#undef LANG_HOOKS_REDUCE_BIT_FIELD_OPERATIONS -#define LANG_HOOKS_REDUCE_BIT_FIELD_OPERATIONS true #undef LANG_HOOKS_GET_ALIAS_SET #define LANG_HOOKS_GET_ALIAS_SET gnat_get_alias_set #undef LANG_HOOKS_EXPAND_EXPR diff --git a/gcc/auto-inc-dec.c b/gcc/auto-inc-dec.c index 2e2d047bf97..8dbcecf93b5 100644 --- a/gcc/auto-inc-dec.c +++ b/gcc/auto-inc-dec.c @@ -1540,8 +1540,10 @@ gate_auto_inc_dec (void) } -struct tree_opt_pass pass_inc_dec = +struct rtl_opt_pass pass_inc_dec = { + { + RTL_PASS, "auto-inc-dec", /* name */ gate_auto_inc_dec, /* gate */ rest_of_handle_auto_inc_dec, /* execute */ @@ -1555,6 +1557,6 @@ struct tree_opt_pass pass_inc_dec = 0, /* todo_flags_start */ TODO_dump_func | TODO_df_finish, /* todo_flags_finish */ - 0 /* letter */ + } }; diff --git a/gcc/basilys.c b/gcc/basilys.c index a3bdeab399a..b509d893bf8 100644 --- a/gcc/basilys.c +++ b/gcc/basilys.c @@ -5838,20 +5838,23 @@ execute_basilys (void) return 0; } -struct tree_opt_pass pass_basilys = { - "basilys", /* name */ - gate_basilys, /* gate */ - execute_basilys, /* execute */ - NULL, /* sub */ - NULL, /* next */ - 0, /* static_pass_number */ - TV_BASILE_ANALYSIS, /* tv_id */ - PROP_cfg | PROP_ssa, /* properties_required */ - 0, /* properties_provided */ - 0, /* properties_destroyed */ - 0, /* todo_flags_start */ - 0, /* todo_flags_finish */ - 0 /* letter */ +struct gimple_opt_pass pass_basilys = +{ + { + GIMPLE_PASS, /* type */ + "basilys", /* name */ + gate_basilys, /* gate */ + execute_basilys, /* execute */ + NULL, /* sub */ + NULL, /* next */ + 0, /* static_pass_number */ + TV_BASILE_ANALYSIS, /* tv_id */ + PROP_cfg | PROP_ssa, /* properties_required */ + 0, /* properties_provided */ + 0, /* properties_destroyed */ + 0, /* todo_flags_start */ + 0, /* todo_flags_finish */ + } }; #include "gt-basilys.h" diff --git a/gcc/bb-reorder.c b/gcc/bb-reorder.c index 18e9405a7ae..3b59fcd8377 100644 --- a/gcc/bb-reorder.c +++ b/gcc/bb-reorder.c @@ -2096,8 +2096,10 @@ done: return 0; } -struct tree_opt_pass pass_duplicate_computed_gotos = +struct rtl_opt_pass pass_duplicate_computed_gotos = { + { + RTL_PASS, "compgotos", /* name */ gate_duplicate_computed_gotos, /* gate */ duplicate_computed_gotos, /* execute */ @@ -2110,7 +2112,7 @@ struct tree_opt_pass pass_duplicate_computed_gotos = 0, /* properties_destroyed */ 0, /* todo_flags_start */ TODO_dump_func | TODO_verify_rtl_sharing,/* todo_flags_finish */ - 0 /* letter */ + } }; @@ -2239,8 +2241,10 @@ rest_of_handle_reorder_blocks (void) return 0; } -struct tree_opt_pass pass_reorder_blocks = +struct rtl_opt_pass pass_reorder_blocks = { + { + RTL_PASS, "bbro", /* name */ gate_handle_reorder_blocks, /* gate */ rest_of_handle_reorder_blocks, /* execute */ @@ -2253,7 +2257,7 @@ struct tree_opt_pass pass_reorder_blocks = 0, /* properties_destroyed */ 0, /* todo_flags_start */ TODO_dump_func | TODO_verify_rtl_sharing,/* todo_flags_finish */ - 'B' /* letter */ + } }; static bool @@ -2277,8 +2281,10 @@ rest_of_handle_partition_blocks (void) return 0; } -struct tree_opt_pass pass_partition_blocks = +struct rtl_opt_pass pass_partition_blocks = { + { + RTL_PASS, "bbpart", /* name */ gate_handle_partition_blocks, /* gate */ rest_of_handle_partition_blocks, /* execute */ @@ -2290,8 +2296,8 @@ struct tree_opt_pass pass_partition_blocks = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - TODO_dump_func | TODO_verify_rtl_sharing,/* todo_flags_finish */ - 0 /* letter */ + TODO_dump_func | TODO_verify_rtl_sharing/* todo_flags_finish */ + } }; diff --git a/gcc/bt-load.c b/gcc/bt-load.c index c30f2c3342e..188faeb4f74 100644 --- a/gcc/bt-load.c +++ b/gcc/bt-load.c @@ -1505,8 +1505,10 @@ rest_of_handle_branch_target_load_optimize1 (void) return 0; } -struct tree_opt_pass pass_branch_target_load_optimize1 = +struct rtl_opt_pass pass_branch_target_load_optimize1 = { + { + RTL_PASS, "btl1", /* name */ gate_handle_branch_target_load_optimize1, /* gate */ rest_of_handle_branch_target_load_optimize1, /* execute */ @@ -1521,7 +1523,7 @@ struct tree_opt_pass pass_branch_target_load_optimize1 = TODO_dump_func | TODO_verify_rtl_sharing | TODO_ggc_collect, /* todo_flags_finish */ - 'd' /* letter */ + } }; static bool @@ -1553,8 +1555,10 @@ rest_of_handle_branch_target_load_optimize2 (void) return 0; } -struct tree_opt_pass pass_branch_target_load_optimize2 = +struct rtl_opt_pass pass_branch_target_load_optimize2 = { + { + RTL_PASS, "btl2", /* name */ gate_handle_branch_target_load_optimize2, /* gate */ rest_of_handle_branch_target_load_optimize2, /* execute */ @@ -1568,6 +1572,6 @@ struct tree_opt_pass pass_branch_target_load_optimize2 = 0, /* todo_flags_start */ TODO_dump_func | TODO_ggc_collect, /* todo_flags_finish */ - 'd' /* letter */ + } }; diff --git a/gcc/c-format.c b/gcc/c-format.c index 9eaaefa9d5a..13de9106f3a 100644 --- a/gcc/c-format.c +++ b/gcc/c-format.c @@ -62,8 +62,7 @@ enum format_type { printf_format_type, asm_fprintf_format_type, gcc_diag_format_type, gcc_tdiag_format_type, gcc_cdiag_format_type, gcc_cxxdiag_format_type, gcc_gfc_format_type, - scanf_format_type, strftime_format_type, - strfmon_format_type, format_type_error = -1}; + format_type_error = -1}; typedef struct function_format_info { @@ -80,7 +79,8 @@ static bool check_format_string (tree argument, int flags, bool *no_add_attrs); static bool get_constant (tree expr, unsigned HOST_WIDE_INT *value, int validated_p); - +static const char *convert_format_name_to_system_name (const char *attr_name); +static bool cmp_attribs (const char *tattr_name, const char *attr_name); /* Handle a "format_arg" attribute; arguments as in struct attribute_spec.handler. */ @@ -191,6 +191,8 @@ decode_format_attr (tree args, function_format_info *info, int validated_p) { const char *p = IDENTIFIER_POINTER (format_type_id); + p = convert_format_name_to_system_name (p); + info->format_type = decode_format_type (p); if (info->format_type == format_type_error) @@ -715,7 +717,7 @@ static const format_char_info monetary_char_table[] = /* This must be in the same order as enum format_type. */ static const format_kind_info format_types_orig[] = { - { "printf", printf_length_specs, print_char_table, " +#0-'I", NULL, + { "gnu_printf", printf_length_specs, print_char_table, " +#0-'I", NULL, printf_flag_specs, printf_flag_pairs, FMT_FLAG_ARG_CONVERT|FMT_FLAG_DOLLAR_MULTIPLE|FMT_FLAG_USE_DOLLAR|FMT_FLAG_EMPTY_PREC_OK, 'w', 0, 'p', 0, 'L', 0, @@ -757,18 +759,18 @@ static const format_kind_info format_types_orig[] = 0, 0, 0, 0, 0, 0, NULL, NULL }, - { "scanf", scanf_length_specs, scan_char_table, "*'I", NULL, + { "gnu_scanf", scanf_length_specs, scan_char_table, "*'I", NULL, scanf_flag_specs, scanf_flag_pairs, FMT_FLAG_ARG_CONVERT|FMT_FLAG_SCANF_A_KLUDGE|FMT_FLAG_USE_DOLLAR|FMT_FLAG_ZERO_WIDTH_BAD|FMT_FLAG_DOLLAR_GAP_POINTER_OK, 'w', 0, 0, '*', 'L', 'm', NULL, NULL }, - { "strftime", NULL, time_char_table, "_-0^#", "EO", + { "gnu_strftime", NULL, time_char_table, "_-0^#", "EO", strftime_flag_specs, strftime_flag_pairs, FMT_FLAG_FANCY_PERCENT_OK, 'w', 0, 0, 0, 0, 0, NULL, NULL }, - { "strfmon", strfmon_length_specs, monetary_char_table, "=^+(!-", NULL, + { "gnu_strfmon", strfmon_length_specs, monetary_char_table, "=^+(!-", NULL, strfmon_flag_specs, strfmon_flag_pairs, FMT_FLAG_ARG_CONVERT, 'w', '#', 'p', 0, 'L', 0, NULL, NULL @@ -847,6 +849,8 @@ decode_format_type (const char *s) { int i; int slen; + + s = convert_format_name_to_system_name (s); slen = strlen (s); for (i = 0; i < n_format_types; i++) { @@ -1776,7 +1780,22 @@ check_format_info_main (format_check_results *res, if (fli) { while (fli->name != 0 && fli->name[0] != *format_chars) - fli++; + { + if (fli->name[0] == '\0') + { + int si = strlen (fli->name + 1) + 1; + int i = 1; + while (fli->name[i] != 0 && fli->name[i] == format_chars [i - 1]) + ++i; + if (si == i) + { + if (si > 2) + format_chars += si - 2; + break; + } + } + fli++; + } if (fli->name != 0) { format_chars++; @@ -2703,6 +2722,84 @@ init_dynamic_diag_info (void) extern const format_kind_info TARGET_FORMAT_TYPES[]; #endif +#ifdef TARGET_OVERRIDES_FORMAT_ATTRIBUTES +extern const target_ovr_attr TARGET_OVERRIDES_FORMAT_ATTRIBUTES[]; +#endif + +/* Attributes such as "printf" are equivalent to those such as + "gnu_printf" unless this is overridden by a target. */ +static const target_ovr_attr gnu_target_overrides_format_attributes[] = +{ + { "gnu_printf", "printf" }, + { "gnu_scanf", "scanf" }, + { "gnu_strftime", "strftime" }, + { "gnu_strfmon", "strfmon" }, + { NULL, NULL } +}; + +/* Translate to unified attribute name. This is used in decode_format_type and + decode_format_attr. In attr_name the user specified argument is passed. It + returns the unified format name from TARGET_OVERRIDES_FORMAT_ATTRIBUTES + or the attr_name passed to this function, if there is no matching entry. */ +static const char * +convert_format_name_to_system_name (const char *attr_name) +{ + int i; + + if (attr_name == NULL || *attr_name == 0 + || strncmp (attr_name, "gcc_", 4) == 0) + return attr_name; + +#ifdef TARGET_OVERRIDES_FORMAT_ATTRIBUTES + /* Check if format attribute is overridden by target. */ + if (TARGET_OVERRIDES_FORMAT_ATTRIBUTES != NULL + && TARGET_OVERRIDES_FORMAT_ATTRIBUTES_COUNT > 0) + { + for (i = 0; i < TARGET_OVERRIDES_FORMAT_ATTRIBUTES_COUNT; ++i) + { + if (cmp_attribs (TARGET_OVERRIDES_FORMAT_ATTRIBUTES[i].named_attr_src, + attr_name)) + return attr_name; + if (cmp_attribs (TARGET_OVERRIDES_FORMAT_ATTRIBUTES[i].named_attr_dst, + attr_name)) + return TARGET_OVERRIDES_FORMAT_ATTRIBUTES[i].named_attr_src; + } + } +#endif + /* Otherwise default to gnu format. */ + for (i = 0; + gnu_target_overrides_format_attributes[i].named_attr_src != NULL; + ++i) + { + if (cmp_attribs (gnu_target_overrides_format_attributes[i].named_attr_src, + attr_name)) + return attr_name; + if (cmp_attribs (gnu_target_overrides_format_attributes[i].named_attr_dst, + attr_name)) + return gnu_target_overrides_format_attributes[i].named_attr_src; + } + + return attr_name; +} + +/* Return true if TATTR_NAME and ATTR_NAME are the same format attribute, + counting "name" and "__name__" as the same, false otherwise. */ +static bool +cmp_attribs (const char *tattr_name, const char *attr_name) +{ + int alen = strlen (attr_name); + int slen = (tattr_name ? strlen (tattr_name) : 0); + if (alen > 4 && attr_name[0] == '_' && attr_name[1] == '_' + && attr_name[alen - 1] == '_' && attr_name[alen - 2] == '_') + { + attr_name += 2; + alen -= 4; + } + if (alen != slen || strncmp (tattr_name, attr_name, alen) != 0) + return false; + return true; +} + /* Handle a "format" attribute; arguments as in struct attribute_spec.handler. */ tree @@ -2762,7 +2859,10 @@ handle_format_attribute (tree *node, tree ARG_UNUSED (name), tree args, } } - if (info.format_type == strftime_format_type && info.first_arg_num != 0) + /* Check if this is a strftime variant. Just for this variant + FMT_FLAG_ARG_CONVERT is not set. */ + if ((format_types[info.format_type].flags & (int) FMT_FLAG_ARG_CONVERT) == 0 + && info.first_arg_num != 0) { error ("strftime formats cannot format arguments"); *no_add_attrs = true; diff --git a/gcc/c-format.h b/gcc/c-format.h index 90cbb179e68..6f74354c555 100644 --- a/gcc/c-format.h +++ b/gcc/c-format.h @@ -80,12 +80,13 @@ enum of whether length modifiers can occur (length_char_specs). */ }; - /* Structure describing a length modifier supported in format checking, and possibly a doubled version such as "hh". */ typedef struct { - /* Name of the single-character length modifier. */ + /* Name of the single-character length modifier. If prefixed by + a zero character, it describes a multi character length + modifier, like I64, I32, etc. */ const char *name; /* Index into a format_char_info.types array. */ enum format_lengths index; @@ -306,4 +307,16 @@ typedef struct #define T_D128 &dfloat128_type_node #define TEX_D128 { STD_EXT, "_Decimal128", T_D128 } +/* Structure describing how format attributes such as "printf" are + interpreted as "gnu_printf" or "ms_printf" on a particular system. + TARGET_OVERRIDES_FORMAT_ATTRIBUTES is used to specify target-specific + defaults. */ +typedef struct +{ + /* The name of the to be copied format attribute. */ + const char *named_attr_src; + /* The name of the to be overridden format attribute. */ + const char *named_attr_dst; +} target_ovr_attr; + #endif /* GCC_C_FORMAT_H */ diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c index 94d4eea8dc3..4d476c5d4dd 100644 --- a/gcc/c-typeck.c +++ b/gcc/c-typeck.c @@ -7503,6 +7503,9 @@ c_finish_bc_stmt (tree *label_p, bool is_break) if (skip) return NULL_TREE; + if (!is_break) + add_stmt (build_predict_expr (PRED_CONTINUE, NOT_TAKEN)); + return add_stmt (build1 (GOTO_EXPR, void_type_node, label)); } diff --git a/gcc/calls.c b/gcc/calls.c index 657439a60eb..2d68f7507a5 100644 --- a/gcc/calls.c +++ b/gcc/calls.c @@ -2326,7 +2326,7 @@ expand_call (tree exp, rtx target, int ignore) int save_pending_stack_adjust = 0; int save_stack_pointer_delta = 0; rtx insns; - rtx before_call, next_arg_reg; + rtx before_call, next_arg_reg, after_args; if (pass == 0) { @@ -2756,6 +2756,7 @@ expand_call (tree exp, rtx target, int ignore) use_reg (&call_fusage, struct_value); } + after_args = get_last_insn (); funexp = prepare_call_address (funexp, static_chain_value, &call_fusage, reg_parm_seen, pass == 0); @@ -2790,6 +2791,13 @@ expand_call (tree exp, rtx target, int ignore) next_arg_reg, valreg, old_inhibit_defer_pop, call_fusage, flags, & args_so_far); + /* If the call setup or the call itself overlaps with anything + of the argument setup we probably clobbered our call address. + In that case we can't do sibcalls. */ + if (pass == 0 + && check_sibcall_argument_overlap (after_args, 0, 0)) + sibcall_failure = 1; + /* If a non-BLKmode value is returned at the most significant end of a register, shift the register right by the appropriate amount and update VALREG accordingly. BLKmode values are handled by the diff --git a/gcc/cfgcleanup.c b/gcc/cfgcleanup.c index a95204cf4fc..203963e02cc 100644 --- a/gcc/cfgcleanup.c +++ b/gcc/cfgcleanup.c @@ -2181,8 +2181,10 @@ rest_of_handle_jump (void) return 0; } -struct tree_opt_pass pass_jump = +struct rtl_opt_pass pass_jump = { + { + RTL_PASS, "sibling", /* name */ NULL, /* gate */ rest_of_handle_jump, /* execute */ @@ -2195,7 +2197,7 @@ struct tree_opt_pass pass_jump = 0, /* properties_destroyed */ TODO_ggc_collect, /* todo_flags_start */ TODO_verify_flow, /* todo_flags_finish */ - 'i' /* letter */ + } }; @@ -2211,8 +2213,10 @@ rest_of_handle_jump2 (void) } -struct tree_opt_pass pass_jump2 = +struct rtl_opt_pass pass_jump2 = { + { + RTL_PASS, "jump", /* name */ NULL, /* gate */ rest_of_handle_jump2, /* execute */ @@ -2225,7 +2229,7 @@ struct tree_opt_pass pass_jump2 = 0, /* properties_destroyed */ TODO_ggc_collect, /* todo_flags_start */ TODO_dump_func | TODO_verify_rtl_sharing,/* todo_flags_finish */ - 'j' /* letter */ + } }; diff --git a/gcc/cfgexpand.c b/gcc/cfgexpand.c index 943a0704168..cd04a625ec8 100644 --- a/gcc/cfgexpand.c +++ b/gcc/cfgexpand.c @@ -1986,8 +1986,10 @@ tree_expand_cfg (void) return 0; } -struct tree_opt_pass pass_expand = +struct gimple_opt_pass pass_expand = { + { + GIMPLE_PASS, "expand", /* name */ NULL, /* gate */ tree_expand_cfg, /* execute */ @@ -2001,5 +2003,5 @@ struct tree_opt_pass pass_expand = PROP_trees, /* properties_destroyed */ 0, /* todo_flags_start */ TODO_dump_func, /* todo_flags_finish */ - 'r' /* letter */ + } }; diff --git a/gcc/cfglayout.c b/gcc/cfglayout.c index 5387b388260..0885af79b3f 100644 --- a/gcc/cfglayout.c +++ b/gcc/cfglayout.c @@ -340,8 +340,10 @@ outof_cfg_layout_mode (void) return 0; } -struct tree_opt_pass pass_into_cfg_layout_mode = +struct rtl_opt_pass pass_into_cfg_layout_mode = { + { + RTL_PASS, "into_cfglayout", /* name */ NULL, /* gate */ into_cfg_layout_mode, /* execute */ @@ -354,11 +356,13 @@ struct tree_opt_pass pass_into_cfg_layout_mode = 0, /* properties_destroyed */ 0, /* todo_flags_start */ TODO_dump_func, /* todo_flags_finish */ - 0 /* letter */ + } }; -struct tree_opt_pass pass_outof_cfg_layout_mode = +struct rtl_opt_pass pass_outof_cfg_layout_mode = { + { + RTL_PASS, "outof_cfglayout", /* name */ NULL, /* gate */ outof_cfg_layout_mode, /* execute */ @@ -371,7 +375,7 @@ struct tree_opt_pass pass_outof_cfg_layout_mode = 0, /* properties_destroyed */ 0, /* todo_flags_start */ TODO_dump_func, /* todo_flags_finish */ - 0 /* letter */ + } }; /* Return sope resulting from combination of S1 and S2. */ diff --git a/gcc/cfgrtl.c b/gcc/cfgrtl.c index c157e08d84b..a42063b6c4c 100644 --- a/gcc/cfgrtl.c +++ b/gcc/cfgrtl.c @@ -427,8 +427,10 @@ free_bb_for_insn (void) return 0; } -struct tree_opt_pass pass_free_cfg = +struct rtl_opt_pass pass_free_cfg = { + { + RTL_PASS, NULL, /* name */ NULL, /* gate */ free_bb_for_insn, /* execute */ @@ -441,7 +443,7 @@ struct tree_opt_pass pass_free_cfg = PROP_cfg, /* properties_destroyed */ 0, /* todo_flags_start */ 0, /* todo_flags_finish */ - 0 /* letter */ + } }; /* Return RTX to emit after when we want to emit code on the entry of function. */ diff --git a/gcc/cgraph.c b/gcc/cgraph.c index 649915e4618..86940b84ed3 100644 --- a/gcc/cgraph.c +++ b/gcc/cgraph.c @@ -1070,7 +1070,7 @@ cgraph_add_new_function (tree fndecl, bool lowered) tree_lowering_passes (fndecl); bitmap_obstack_initialize (NULL); if (!gimple_in_ssa_p (DECL_STRUCT_FUNCTION (fndecl)) && optimize) - execute_pass_list (pass_early_local_passes.sub); + execute_pass_list (pass_early_local_passes.pass.sub); bitmap_obstack_release (NULL); tree_rest_of_compilation (fndecl); pop_cfun (); diff --git a/gcc/cgraphbuild.c b/gcc/cgraphbuild.c index 2f8d3b07051..832fa6eab90 100644 --- a/gcc/cgraphbuild.c +++ b/gcc/cgraphbuild.c @@ -170,8 +170,10 @@ build_cgraph_edges (void) return 0; } -struct tree_opt_pass pass_build_cgraph_edges = +struct gimple_opt_pass pass_build_cgraph_edges = { + { + GIMPLE_PASS, NULL, /* name */ NULL, /* gate */ build_cgraph_edges, /* execute */ @@ -183,8 +185,8 @@ struct tree_opt_pass pass_build_cgraph_edges = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - 0, /* todo_flags_finish */ - 0 /* letter */ + 0 /* todo_flags_finish */ + } }; /* Record references to functions and other variables present in the @@ -238,8 +240,10 @@ rebuild_cgraph_edges (void) return 0; } -struct tree_opt_pass pass_rebuild_cgraph_edges = +struct gimple_opt_pass pass_rebuild_cgraph_edges = { + { + GIMPLE_PASS, NULL, /* name */ NULL, /* gate */ rebuild_cgraph_edges, /* execute */ @@ -252,5 +256,5 @@ struct tree_opt_pass pass_rebuild_cgraph_edges = 0, /* properties_destroyed */ 0, /* todo_flags_start */ 0, /* todo_flags_finish */ - 0 /* letter */ + } }; diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c index 0d6a9fed9fc..7b01248def2 100644 --- a/gcc/cgraphunit.c +++ b/gcc/cgraphunit.c @@ -475,7 +475,7 @@ cgraph_process_new_functions (void) /* When not optimizing, be sure we run early local passes anyway to expand OMP. */ || !optimize) - execute_pass_list (pass_early_local_passes.sub); + execute_pass_list (pass_early_local_passes.pass.sub); free_dominance_info (CDI_POST_DOMINATORS); free_dominance_info (CDI_DOMINATORS); pop_cfun (); @@ -858,7 +858,7 @@ cgraph_analyze_function (struct cgraph_node *node) { bitmap_obstack_initialize (NULL); tree_register_cfg_hooks (); - execute_pass_list (pass_early_local_passes.sub); + execute_pass_list (pass_early_local_passes.pass.sub); free_dominance_info (CDI_POST_DOMINATORS); free_dominance_info (CDI_DOMINATORS); bitmap_obstack_release (NULL); diff --git a/gcc/combine-stack-adj.c b/gcc/combine-stack-adj.c index 37942bc4519..bf7cccf2df7 100644 --- a/gcc/combine-stack-adj.c +++ b/gcc/combine-stack-adj.c @@ -472,8 +472,10 @@ rest_of_handle_stack_adjustments (void) return 0; } -struct tree_opt_pass pass_stack_adjustments = +struct rtl_opt_pass pass_stack_adjustments = { + { + RTL_PASS, "csa", /* name */ gate_handle_stack_adjustments, /* gate */ rest_of_handle_stack_adjustments, /* execute */ @@ -488,6 +490,6 @@ struct tree_opt_pass pass_stack_adjustments = TODO_df_finish | TODO_verify_rtl_sharing | TODO_dump_func | TODO_ggc_collect, /* todo_flags_finish */ - 0 /* letter */ + } }; diff --git a/gcc/combine.c b/gcc/combine.c index b812b33ac41..0fca12da9db 100644 --- a/gcc/combine.c +++ b/gcc/combine.c @@ -13035,8 +13035,10 @@ rest_of_handle_combine (void) return 0; } -struct tree_opt_pass pass_combine = +struct rtl_opt_pass pass_combine = { + { + RTL_PASS, "combine", /* name */ gate_handle_combine, /* gate */ rest_of_handle_combine, /* execute */ @@ -13051,6 +13053,6 @@ struct tree_opt_pass pass_combine = TODO_dump_func | TODO_df_finish | TODO_verify_rtl_sharing | TODO_ggc_collect, /* todo_flags_finish */ - 'c' /* letter */ + } }; diff --git a/gcc/compiler-probe.c b/gcc/compiler-probe.c index 6a7a5e0c922..8003dd15af8 100644 --- a/gcc/compiler-probe.c +++ b/gcc/compiler-probe.c @@ -2058,20 +2058,23 @@ execute_comprobe (void) return 0; /* no additional todos */ } -struct tree_opt_pass pass_compiler_probe = { - "comprobe", /* name */ - gate_comprobe, /* gate */ - execute_comprobe, /* execute */ - NULL, /* sub */ - NULL, /* next */ - 0, /* static_pass_number */ - 0, /* tv_id */ - 0 /*PROP_cfg | PROP_ssa */ , /* properties_required */ - 0, /* properties_provided */ - 0, /* properties_destroyed */ - 0, /* todo_flags_start */ - 0, /* todo_flags_finish */ - 0 /* letter */ +struct gimple_opt_pass pass_compiler_probe = +{ + { + GIMPLE_PASS, /* type */ + "comprobe", /* name */ + gate_comprobe, /* gate */ + execute_comprobe, /* execute */ + NULL, /* sub */ + NULL, /* next */ + 0, /* static_pass_number */ + 0, /* tv_id */ + 0 /*PROP_cfg | PROP_ssa */ , /* properties_required */ + 0, /* properties_provided */ + 0, /* properties_destroyed */ + 0, /* todo_flags_start */ + 0, /* todo_flags_finish */ + } }; #include "gt-compiler-probe.h" diff --git a/gcc/compiler-probe.h b/gcc/compiler-probe.h index 1f5aa0b34b8..c527ae83642 100644 --- a/gcc/compiler-probe.h +++ b/gcc/compiler-probe.h @@ -103,7 +103,6 @@ void comprobe_finish (void); void comprobe_show_message (const char *msg); -extern struct tree_opt_pass pass_compiler_probe; /*** * return a unique positive file rank for a file path; or 0 for NULL name diff --git a/gcc/config.gcc b/gcc/config.gcc index 4533e0e76c8..fbb54e2d5b3 100644 --- a/gcc/config.gcc +++ b/gcc/config.gcc @@ -1372,8 +1372,8 @@ i[34567]86-*-pe | i[34567]86-*-cygwin*) target_gtfiles="\$(srcdir)/config/i386/winnt.c" extra_options="${extra_options} i386/cygming.opt" extra_objs="winnt.o winnt-stubs.o" - c_target_objs=cygwin2.o - cxx_target_objs="cygwin2.o winnt-cxx.o" + c_target_objs="cygwin2.o msformat-c.o" + cxx_target_objs="cygwin2.o winnt-cxx.o msformat-c.o" extra_gcc_objs=cygwin1.o if test x$enable_threads = xyes; then thread_file='posix' @@ -1386,7 +1386,8 @@ i[34567]86-*-mingw32* | x86_64-*-mingw32*) target_gtfiles="\$(srcdir)/config/i386/winnt.c" extra_options="${extra_options} i386/cygming.opt" extra_objs="winnt.o winnt-stubs.o" - cxx_target_objs=winnt-cxx.o + c_target_objs="msformat-c.o" + cxx_target_objs="winnt-cxx.o msformat-c.o" default_use_cxa_atexit=yes case ${enable_threads} in "" | yes | win32) diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 883f226b968..5bb5494e27f 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -22698,6 +22698,7 @@ x86_this_parameter (tree function) { tree type = TREE_TYPE (function); bool aggr = aggregate_value_p (TREE_TYPE (type), type) != 0; + int nregs; if (TARGET_64BIT) { @@ -22710,11 +22711,25 @@ x86_this_parameter (tree function) return gen_rtx_REG (DImode, parm_regs[aggr]); } - if (ix86_function_regparm (type, function) > 0 && !stdarg_p (type)) + nregs = ix86_function_regparm (type, function); + + if (nregs > 0 && !stdarg_p (type)) { - int regno = AX_REG; + int regno; + if (lookup_attribute ("fastcall", TYPE_ATTRIBUTES (type))) - regno = CX_REG; + regno = aggr ? DX_REG : CX_REG; + else + { + regno = AX_REG; + if (aggr) + { + regno = DX_REG; + if (nregs == 1) + return gen_rtx_MEM (SImode, + plus_constant (stack_pointer_rtx, 4)); + } + } return gen_rtx_REG (SImode, regno); } diff --git a/gcc/config/i386/mingw32.h b/gcc/config/i386/mingw32.h index 7e4d7b91989..890a09674dd 100644 --- a/gcc/config/i386/mingw32.h +++ b/gcc/config/i386/mingw32.h @@ -143,6 +143,23 @@ do { \ to register C++ static destructors. */ #define TARGET_CXX_USE_ATEXIT_FOR_CXA_ATEXIT hook_bool_void_true +/* Contains a pointer to type target_ovr_attr defining the target specific + overrides of format attributes. See c-format.h for structure + definition. */ +#undef TARGET_OVERRIDES_FORMAT_ATTRIBUTES +#define TARGET_OVERRIDES_FORMAT_ATTRIBUTES mingw_format_attribute_overrides + +/* Specify the count of elements in TARGET_OVERRIDES_ATTRIBUTE. */ +#undef TARGET_OVERRIDES_FORMAT_ATTRIBUTES_COUNT +#define TARGET_OVERRIDES_FORMAT_ATTRIBUTES_COUNT 3 + +/* MS specific format attributes for ms_printf, ms_scanf, ms_strftime. */ +#undef TARGET_FORMAT_TYPES +#define TARGET_FORMAT_TYPES mingw_format_attributes + +#undef TARGET_N_FORMAT_TYPES +#define TARGET_N_FORMAT_TYPES 3 + /* JCR_SECTION works on mingw32. */ #undef TARGET_USE_JCR_SECTION #define TARGET_USE_JCR_SECTION 1 diff --git a/gcc/config/i386/mmx.md b/gcc/config/i386/mmx.md index 2238a3ffd14..a146231e992 100644 --- a/gcc/config/i386/mmx.md +++ b/gcc/config/i386/mmx.md @@ -65,9 +65,9 @@ (define_insn "*mov<mode>_internal_rex64" [(set (match_operand:MMXMODEI8 0 "nonimmediate_operand" - "=rm,r,!y,!y ,m ,!y,Y2,x,x ,m,r,x") + "=rm,r,!?y,!?y ,m ,!y,Y2,x,x ,m,r,x") (match_operand:MMXMODEI8 1 "vector_move_operand" - "Cr ,m,C ,!ym,!y,Y2,!y,C,xm,x,x,r"))] + "Cr ,m,C ,!?ym,!?y,Y2,!y,C,xm,x,x,r"))] "TARGET_64BIT && TARGET_MMX && !(MEM_P (operands[0]) && MEM_P (operands[1]))" "@ @@ -89,9 +89,9 @@ (define_insn "*mov<mode>_internal" [(set (match_operand:MMXMODEI8 0 "nonimmediate_operand" - "=!y,!y ,m ,!y ,*Y2,*Y2,*Y2 ,m ,*x,*x,*x,m ,?r ,?m") + "=!?y,!?y,m ,!y ,*Y2,*Y2,*Y2 ,m ,*x,*x,*x,m ,r ,m") (match_operand:MMXMODEI8 1 "vector_move_operand" - "C ,!ym,!y,*Y2,!y ,C ,*Y2m,*Y2,C ,*x,m ,*x,irm,r"))] + "C ,!ym,!?y,*Y2,!y ,C ,*Y2m,*Y2,C ,*x,m ,*x,irm,r"))] "TARGET_MMX && !(MEM_P (operands[0]) && MEM_P (operands[1]))" "@ @@ -124,9 +124,9 @@ (define_insn "*movv2sf_internal_rex64" [(set (match_operand:V2SF 0 "nonimmediate_operand" - "=rm,r,!y ,!y ,m ,!y,Y2,x,x,x,m,r,x") + "=rm,r ,!?y,!?y ,m ,!y,Y2,x,x,x,m,r,x") (match_operand:V2SF 1 "vector_move_operand" - "Cr ,m ,C ,!ym,!y,Y2,!y,C,x,m,x,x,r"))] + "Cr ,m ,C ,!?ym,!y,Y2,!y,C,x,m,x,x,r"))] "TARGET_64BIT && TARGET_MMX && !(MEM_P (operands[0]) && MEM_P (operands[1]))" "@ @@ -149,9 +149,9 @@ (define_insn "*movv2sf_internal" [(set (match_operand:V2SF 0 "nonimmediate_operand" - "=!y,!y ,m,!y ,*Y2,*x,*x,*x,m ,?r ,?m") + "=!?y,!?y ,m ,!y ,*Y2,*x,*x,*x,m ,r ,m") (match_operand:V2SF 1 "vector_move_operand" - "C ,!ym,!y,*Y2,!y ,C ,*x,m ,*x,irm,r"))] + "C ,!?ym,!?y,*Y2,!y ,C ,*x,m ,*x,irm,r"))] "TARGET_MMX && !(MEM_P (operands[0]) && MEM_P (operands[1]))" "@ diff --git a/gcc/config/i386/msformat-c.c b/gcc/config/i386/msformat-c.c new file mode 100644 index 00000000000..821be470b8e --- /dev/null +++ b/gcc/config/i386/msformat-c.c @@ -0,0 +1,175 @@ +/* Check calls to formatted I/O functions (-Wformat). + Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, + 2001, 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc. + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify it under +the terms of the GNU General Public License as published by the Free +Software Foundation; either version 3, or (at your option) any later +version. + +GCC is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with GCC; see the file COPYING3. If not see +<http://www.gnu.org/licenses/>. */ + +#include "config.h" +#include "system.h" +#include "coretypes.h" +#include "tm.h" +#include "tree.h" +#include "flags.h" +#include "c-common.h" +#include "toplev.h" +#include "intl.h" +#include "diagnostic.h" +#include "langhooks.h" +#include "c-format.h" +#include "alloc-pool.h" + +/* Mingw specific format attributes ms_printf, ms_scanf, and ms_strftime. */ + +static const format_length_info ms_printf_length_specs[] = +{ + { "h", FMT_LEN_h, STD_C89, NULL, 0, 0 }, + { "l", FMT_LEN_l, STD_C89, NULL, 0, 0 }, + { "\0I32", FMT_LEN_l, STD_EXT, NULL, 0, 0 }, + { "\0I64", FMT_LEN_ll, STD_EXT, NULL, 0, 0 }, + { "I", FMT_LEN_L, STD_EXT, NULL, 0, 0 }, + { NULL, 0, 0, NULL, 0, 0 } +}; + +static const format_flag_spec ms_printf_flag_specs[] = +{ + { ' ', 0, 0, N_("' ' flag"), N_("the ' ' printf flag"), STD_C89 }, + { '+', 0, 0, N_("'+' flag"), N_("the '+' printf flag"), STD_C89 }, + { '#', 0, 0, N_("'#' flag"), N_("the '#' printf flag"), STD_C89 }, + { '0', 0, 0, N_("'0' flag"), N_("the '0' printf flag"), STD_C89 }, + { '-', 0, 0, N_("'-' flag"), N_("the '-' printf flag"), STD_C89 }, + { '\'', 0, 0, N_("''' flag"), N_("the ''' printf flag"), STD_EXT }, + { 'w', 0, 0, N_("field width"), N_("field width in printf format"), STD_C89 }, + { 'p', 0, 0, N_("precision"), N_("precision in printf format"), STD_C89 }, + { 'L', 0, 0, N_("length modifier"), N_("length modifier in printf format"), STD_C89 }, + { 0, 0, 0, NULL, NULL, 0 } +}; + +static const format_flag_pair ms_printf_flag_pairs[] = +{ + { ' ', '+', 1, 0 }, + { '0', '-', 1, 0 }, { '0', 'p', 1, 'i' }, + { 0, 0, 0, 0 } +}; + +static const format_flag_spec ms_scanf_flag_specs[] = +{ + { '*', 0, 0, N_("assignment suppression"), N_("the assignment suppression scanf feature"), STD_C89 }, + { 'a', 0, 0, N_("'a' flag"), N_("the 'a' scanf flag"), STD_EXT }, + { 'w', 0, 0, N_("field width"), N_("field width in scanf format"), STD_C89 }, + { 'L', 0, 0, N_("length modifier"), N_("length modifier in scanf format"), STD_C89 }, + { '\'', 0, 0, N_("''' flag"), N_("the ''' scanf flag"), STD_EXT }, + { 0, 0, 0, NULL, NULL, 0 } +}; + +static const format_flag_pair ms_scanf_flag_pairs[] = +{ + { '*', 'L', 0, 0 }, + { 0, 0, 0, 0 } +}; + +static const format_flag_spec ms_strftime_flag_specs[] = +{ + { '#', 0, 0, N_("'#' flag"), N_("the '#' strftime flag"), STD_EXT }, + { 0, 0, 0, NULL, NULL, 0 } +}; + +static const format_flag_pair ms_strftime_flag_pairs[] = +{ + { 0, 0, 0, 0 } +}; + +static const format_char_info ms_print_char_table[] = +{ + /* C89 conversion specifiers. */ + { "di", 0, STD_C89, { T89_I, BADLEN, T89_S, T89_L, T9L_LL, T99_SST, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "-wp0 +'", "i", NULL }, + { "oxX", 0, STD_C89, { T89_UI, BADLEN, T89_US, T89_UL, T9L_ULL, T99_ST, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "-wp0#", "i", NULL }, + { "u", 0, STD_C89, { T89_UI, BADLEN, T89_US, T89_UL, T9L_ULL, T99_ST, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "-wp0'", "i", NULL }, + { "fgG", 0, STD_C89, { T89_D, BADLEN, BADLEN, T99_D, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "-wp0 +#'", "", NULL }, + { "eE", 0, STD_C89, { T89_D, BADLEN, BADLEN, T99_D, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "-wp0 +#", "", NULL }, + { "c", 0, STD_C89, { T89_I, BADLEN, T89_S, T94_WI, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "-w", "", NULL }, + { "s", 1, STD_C89, { T89_C, BADLEN, T89_S, T94_W, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "-wp", "cR", NULL }, + { "p", 1, STD_C89, { T89_V, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "-w", "c", NULL }, + { "n", 1, STD_C89, { T89_I, BADLEN, T89_S, T89_L, T9L_LL, BADLEN, BADLEN, BADLEN, T99_IM, BADLEN, BADLEN, BADLEN }, "", "W", NULL }, + /* X/Open conversion specifiers. */ + { "C", 0, STD_EXT, { TEX_WI, BADLEN, T89_S, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "-w", "", NULL }, + { "S", 1, STD_EXT, { TEX_W, BADLEN, T89_S, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "-wp", "R", NULL }, + { NULL, 0, 0, NOLENGTHS, NULL, NULL, NULL } +}; + +static const format_char_info ms_scan_char_table[] = +{ + /* C89 conversion specifiers. */ + { "di", 1, STD_C89, { T89_I, BADLEN, T89_S, T89_L, T9L_LL, T99_SST, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "*w'", "W", NULL }, + { "u", 1, STD_C89, { T89_UI, BADLEN, T89_US, T89_UL, T9L_ULL, T99_ST, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "*w'", "W", NULL }, + { "oxX", 1, STD_C89, { T89_UI, BADLEN, T89_US, T89_UL, T9L_ULL, T99_ST, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "*w", "W", NULL }, + { "efgEG", 1, STD_C89, { T89_F, BADLEN, BADLEN, T89_D, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "*w'", "W", NULL }, + { "c", 1, STD_C89, { T89_C, BADLEN, T89_S, T94_W, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "*w", "cW", NULL }, + { "s", 1, STD_C89, { T89_C, BADLEN, T89_S, T94_W, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "*aw", "cW", NULL }, + { "[", 1, STD_C89, { T89_C, BADLEN, BADLEN, T94_W, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "*aw", "cW[", NULL }, + { "p", 2, STD_C89, { T89_V, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "*w", "W", NULL }, + { "n", 1, STD_C89, { T89_I, BADLEN, T89_S, T89_L, T9L_LL, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "", "W", NULL }, + /* X/Open conversion specifiers. */ + { "C", 1, STD_EXT, { TEX_W, BADLEN, T89_S, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "*w", "W", NULL }, + { "S", 1, STD_EXT, { TEX_W, BADLEN, T89_S, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "*aw", "W", NULL }, + { NULL, 0, 0, NOLENGTHS, NULL, NULL, NULL } +}; + +static const format_char_info ms_time_char_table[] = +{ + /* C89 conversion specifiers. */ + { "ABZab", 0, STD_C89, NOLENGTHS, "#", "", NULL }, + { "cx", 0, STD_C89, NOLENGTHS, "#", "3", NULL }, + { "HIMSUWdmw", 0, STD_C89, NOLENGTHS, "#", "", NULL }, + { "j", 0, STD_C89, NOLENGTHS, "#", "", NULL }, + { "p", 0, STD_C89, NOLENGTHS, "#", "", NULL }, + { "X", 0, STD_C89, NOLENGTHS, "#", "", NULL }, + { "y", 0, STD_C89, NOLENGTHS, "#", "4", NULL }, + { "Y", 0, STD_C89, NOLENGTHS, "#", "", NULL }, + { "%", 0, STD_C89, NOLENGTHS, "", "", NULL }, + /* C99 conversion specifiers. */ + { "z", 0, STD_C99, NOLENGTHS, "#", "", NULL }, + { NULL, 0, 0, NOLENGTHS, NULL, NULL, NULL } +}; + +const format_kind_info mingw_format_attributes[3] = +{ + { "ms_printf", ms_printf_length_specs, ms_print_char_table, " +#0-'", NULL, + ms_printf_flag_specs, ms_printf_flag_pairs, + FMT_FLAG_ARG_CONVERT|FMT_FLAG_DOLLAR_MULTIPLE|FMT_FLAG_USE_DOLLAR|FMT_FLAG_EMPTY_PREC_OK, + 'w', 0, 'p', 0, 'L', 0, + &integer_type_node, &integer_type_node + }, + { "ms_scanf", ms_printf_length_specs, ms_scan_char_table, "*'", NULL, + ms_scanf_flag_specs, ms_scanf_flag_pairs, + FMT_FLAG_ARG_CONVERT|FMT_FLAG_SCANF_A_KLUDGE|FMT_FLAG_USE_DOLLAR|FMT_FLAG_ZERO_WIDTH_BAD|FMT_FLAG_DOLLAR_GAP_POINTER_OK, + 'w', 0, 0, '*', 'L', 0, + NULL, NULL + }, + { "ms_strftime", NULL, ms_time_char_table, "", "#", + ms_strftime_flag_specs, ms_strftime_flag_pairs, + FMT_FLAG_FANCY_PERCENT_OK, 0, 0, 0, 0, 0, 0, + NULL, NULL + } +}; + +/* Default overrides for printf, scanf and strftime. */ +const target_ovr_attr mingw_format_attribute_overrides[4] = +{ + { "ms_printf", "printf" }, + { "ms_scanf", "scanf" }, + { "ms_strftime", "strftime" } +}; diff --git a/gcc/config/i386/t-cygming b/gcc/config/i386/t-cygming index c001a8b0f61..b2c50df01fa 100644 --- a/gcc/config/i386/t-cygming +++ b/gcc/config/i386/t-cygming @@ -29,4 +29,10 @@ winnt-stubs.o: $(srcdir)/config/i386/winnt-stubs.c $(CONFIG_H) $(SYSTEM_H) coret $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \ $(srcdir)/config/i386/winnt-stubs.c +msformat-c.o: $(srcdir)/config/i386/msformat-c.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ + $(TM_H) $(RTL_H) $(REGS_H) hard-reg-set.h output.h $(TREE_H) flags.h \ + $(TM_P_H) toplev.h $(HASHTAB_H) $(GGC_H) + $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \ + $(srcdir)/config/i386/msformat-c.c + STMP_FIXINC=stmp-fixinc diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index c73fd6b25d5..a85346545c5 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,13 @@ +2008-03-18 Paolo Bonzini <bonzini@gnu.org> + + * cp-lang.c (LANG_HOOKS_REDUCE_BIT_FIELD_OPERATIONS): Delete. + +2008-03-17 Jason Merrill <jason@redhat.com> + + PR c++/35548 + * call.c (reference_binding): Check LOOKUP_NO_TEMP_BIND when binding + a temp directly to a reference as per DR391. + 2008-03-12 Richard Guenther <rguenther@suse.de> PR c++/35469 diff --git a/gcc/cp/call.c b/gcc/cp/call.c index 2ee82371f68..3677262a370 100644 --- a/gcc/cp/call.c +++ b/gcc/cp/call.c @@ -1145,7 +1145,8 @@ reference_binding (tree rto, tree rfrom, tree expr, bool c_cast_p, int flags) const and rvalue references to rvalues of compatible class type. */ if (compatible_p && (lvalue_p - || ((CP_TYPE_CONST_NON_VOLATILE_P(to) || TYPE_REF_IS_RVALUE (rto)) + || (!(flags & LOOKUP_NO_TEMP_BIND) + && (CP_TYPE_CONST_NON_VOLATILE_P(to) || TYPE_REF_IS_RVALUE (rto)) && CLASS_TYPE_P (from)))) { /* [dcl.init.ref] diff --git a/gcc/cp/cp-lang.c b/gcc/cp/cp-lang.c index b35f7f3811c..70709298e9a 100644 --- a/gcc/cp/cp-lang.c +++ b/gcc/cp/cp-lang.c @@ -57,8 +57,6 @@ static enum classify_record cp_classify_record (tree type); #define LANG_HOOKS_FOLD_OBJ_TYPE_REF cp_fold_obj_type_ref #undef LANG_HOOKS_INIT_TS #define LANG_HOOKS_INIT_TS cp_init_ts -#undef LANG_HOOKS_REDUCE_BIT_FIELD_OPERATIONS -#define LANG_HOOKS_REDUCE_BIT_FIELD_OPERATIONS true /* Each front end provides its own lang hook initializer. */ const struct lang_hooks lang_hooks = LANG_HOOKS_INITIALIZER; diff --git a/gcc/cse.c b/gcc/cse.c index 82ea2b70da1..ef135e99b8f 100644 --- a/gcc/cse.c +++ b/gcc/cse.c @@ -7011,8 +7011,10 @@ rest_of_handle_cse (void) return 0; } -struct tree_opt_pass pass_cse = +struct rtl_opt_pass pass_cse = { + { + RTL_PASS, "cse1", /* name */ gate_handle_cse, /* gate */ rest_of_handle_cse, /* execute */ @@ -7028,7 +7030,7 @@ struct tree_opt_pass pass_cse = TODO_dump_func | TODO_ggc_collect | TODO_verify_flow, /* todo_flags_finish */ - 's' /* letter */ + } }; @@ -7072,8 +7074,10 @@ rest_of_handle_cse2 (void) } -struct tree_opt_pass pass_cse2 = +struct rtl_opt_pass pass_cse2 = { + { + RTL_PASS, "cse2", /* name */ gate_handle_cse2, /* gate */ rest_of_handle_cse2, /* execute */ @@ -7088,7 +7092,7 @@ struct tree_opt_pass pass_cse2 = TODO_df_finish | TODO_verify_rtl_sharing | TODO_dump_func | TODO_ggc_collect | - TODO_verify_flow, /* todo_flags_finish */ - 't' /* letter */ + TODO_verify_flow /* todo_flags_finish */ + } }; diff --git a/gcc/dce.c b/gcc/dce.c index 70b9e226514..f8e54bbb530 100644 --- a/gcc/dce.c +++ b/gcc/dce.c @@ -567,8 +567,10 @@ gate_ud_dce (void) && dbg_cnt (dce_ud); } -struct tree_opt_pass pass_ud_rtl_dce = +struct rtl_opt_pass pass_ud_rtl_dce = { + { + RTL_PASS, "dce", /* name */ gate_ud_dce, /* gate */ rest_of_handle_ud_dce, /* execute */ @@ -582,8 +584,8 @@ struct tree_opt_pass pass_ud_rtl_dce = 0, /* todo_flags_start */ TODO_dump_func | TODO_df_finish | TODO_verify_rtl_sharing | - TODO_ggc_collect, /* todo_flags_finish */ - 'w' /* letter */ + TODO_ggc_collect /* todo_flags_finish */ + } }; @@ -853,8 +855,10 @@ gate_fast_dce (void) && dbg_cnt (dce_fast); } -struct tree_opt_pass pass_fast_rtl_dce = +struct rtl_opt_pass pass_fast_rtl_dce = { + { + RTL_PASS, "dce", /* name */ gate_fast_dce, /* gate */ rest_of_handle_fast_dce, /* execute */ @@ -868,6 +872,6 @@ struct tree_opt_pass pass_fast_rtl_dce = 0, /* todo_flags_start */ TODO_dump_func | TODO_df_finish | TODO_verify_rtl_sharing | - TODO_ggc_collect, /* todo_flags_finish */ - 'w' /* letter */ + TODO_ggc_collect /* todo_flags_finish */ + } }; diff --git a/gcc/df-core.c b/gcc/df-core.c index 5404000ef39..1cd49b133be 100644 --- a/gcc/df-core.c +++ b/gcc/df-core.c @@ -753,8 +753,10 @@ gate_opt (void) } -struct tree_opt_pass pass_df_initialize_opt = +struct rtl_opt_pass pass_df_initialize_opt = { + { + RTL_PASS, "dfinit", /* name */ gate_opt, /* gate */ rest_of_handle_df_initialize, /* execute */ @@ -766,8 +768,8 @@ struct tree_opt_pass pass_df_initialize_opt = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - 0, /* todo_flags_finish */ - 'z' /* letter */ + 0 /* todo_flags_finish */ + } }; @@ -778,8 +780,10 @@ gate_no_opt (void) } -struct tree_opt_pass pass_df_initialize_no_opt = +struct rtl_opt_pass pass_df_initialize_no_opt = { + { + RTL_PASS, "dfinit", /* name */ gate_no_opt, /* gate */ rest_of_handle_df_initialize, /* execute */ @@ -791,8 +795,8 @@ struct tree_opt_pass pass_df_initialize_no_opt = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - 0, /* todo_flags_finish */ - 'z' /* letter */ + 0 /* todo_flags_finish */ + } }; @@ -825,8 +829,10 @@ rest_of_handle_df_finish (void) } -struct tree_opt_pass pass_df_finish = +struct rtl_opt_pass pass_df_finish = { + { + RTL_PASS, "dfinish", /* name */ NULL, /* gate */ rest_of_handle_df_finish, /* execute */ @@ -838,8 +844,8 @@ struct tree_opt_pass pass_df_finish = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - 0, /* todo_flags_finish */ - 'z' /* letter */ + 0 /* todo_flags_finish */ + } }; diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi index d114adce2fd..fd97c16d96f 100644 --- a/gcc/doc/extend.texi +++ b/gcc/doc/extend.texi @@ -2204,13 +2204,22 @@ for consistency with the @code{printf} style format string argument @code{my_format}. The parameter @var{archetype} determines how the format string is -interpreted, and should be @code{printf}, @code{scanf}, @code{strftime} -or @code{strfmon}. (You can also use @code{__printf__}, -@code{__scanf__}, @code{__strftime__} or @code{__strfmon__}.) The -parameter @var{string-index} specifies which argument is the format -string argument (starting from 1), while @var{first-to-check} is the -number of the first argument to check against the format string. For -functions where the arguments are not available to be checked (such as +interpreted, and should be @code{printf}, @code{scanf}, @code{strftime}, +@code{gnu_printf}, @code{gnu_scanf}, @code{gnu_strftime} or +@code{strfmon}. (You can also use @code{__printf__}, +@code{__scanf__}, @code{__strftime__} or @code{__strfmon__}.) On +MinGW targets, @code{ms_printf}, @code{ms_scanf}, and +@code{ms_strftime} are also present. +@var{archtype} values such as @code{printf} refer to the formats accepted +by the system's C run-time library, while @code{gnu_} values always refer +to the formats accepted by the GNU C Library. On Microsoft Windows +targets, @code{ms_} values refer to the formats accepted by the +@file{msvcrt.dll} library. +The parameter @var{string-index} +specifies which argument is the format string argument (starting +from 1), while @var{first-to-check} is the number of the first +argument to check against the format string. For functions +where the arguments are not available to be checked (such as @code{vprintf}), specify the third parameter as zero. In this case the compiler only checks the format string for consistency. For @code{strftime} formats, the third parameter is required to be zero. diff --git a/gcc/doc/include/texinfo.tex b/gcc/doc/include/texinfo.tex index 790673c3e56..e4f38dd4964 100644 --- a/gcc/doc/include/texinfo.tex +++ b/gcc/doc/include/texinfo.tex @@ -3,7 +3,7 @@ % Load plain if necessary, i.e., if running under initex. \expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi % -\def\texinfoversion{2008-03-07.10} +\def\texinfoversion{2008-03-17.10} % % Copyright (C) 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995, % 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, @@ -6967,20 +6967,22 @@ end % % Make link in pdf output. \ifpdf - \leavevmode - \getfilename{#4}% {\indexnofonts \turnoffactive + % This expands tokens, so do it after making catcode changes, so _ + % etc. don't get their TeX definitions. + \getfilename{#4}% + % % See comments at \activebackslashdouble. {\activebackslashdouble \xdef\pdfxrefdest{#1}% \backslashparens\pdfxrefdest}% % + \leavevmode + \startlink attr{/Border [0 0 0]}% \ifnum\filenamelength>0 - \startlink attr{/Border [0 0 0]}% - goto file{\the\filename.pdf} name{\pdfxrefdest}% + goto file{\the\filename.pdf} name{\pdfxrefdest}% \else - \startlink attr{/Border [0 0 0]}% - goto name{\pdfmkpgn{\pdfxrefdest}}% + goto name{\pdfmkpgn{\pdfxrefdest}}% \fi }% \setcolor{\linkcolor}% diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index 27bf020d813..fc5e8dd99b8 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -4446,39 +4446,31 @@ letters for use in @var{letters} and @var{pass}, and their meanings: @opindex dA Annotate the assembler output with miscellaneous debugging information. -@item -dB @itemx -fdump-rtl-bbro -@opindex dB @opindex fdump-rtl-bbro Dump after block reordering, to @file{@var{file}.148r.bbro}. -@item -dc @itemx -fdump-rtl-combine -@opindex dc @opindex fdump-rtl-combine Dump after the RTL instruction combination pass, to the file @file{@var{file}.129r.combine}. -@item -dC @itemx -fdump-rtl-ce1 @itemx -fdump-rtl-ce2 -@opindex dC @opindex fdump-rtl-ce1 @opindex fdump-rtl-ce2 -@option{-dC} and @option{-fdump-rtl-ce1} enable dumping after the -first if conversion, to the file @file{@var{file}.117r.ce1}. @option{-dC} -and @option{-fdump-rtl-ce2} enable dumping after the second if +@option{-fdump-rtl-ce1} enable dumping after the +first if conversion, to the file @file{@var{file}.117r.ce1}. +@option{-fdump-rtl-ce2} enable dumping after the second if conversion, to the file @file{@var{file}.130r.ce2}. -@item -dd @itemx -fdump-rtl-btl @itemx -fdump-rtl-dbr -@opindex dd @opindex fdump-rtl-btl @opindex fdump-rtl-dbr -@option{-dd} and @option{-fdump-rtl-btl} enable dumping after branch -target load optimization, to @file{@var{file}.31.btl}. @option{-dd} -and @option{-fdump-rtl-dbr} enable dumping after delayed branch +@option{-fdump-rtl-btl} enable dumping after branch +target load optimization, to @file{@var{file}.31.btl}. +@option{-fdump-rtl-dbr} enable dumping after delayed branch scheduling, to @file{@var{file}.36.dbr}. @item -dD @@ -4486,74 +4478,54 @@ scheduling, to @file{@var{file}.36.dbr}. Dump all macro definitions, at the end of preprocessing, in addition to normal output. -@item -dE @itemx -fdump-rtl-ce3 -@opindex dE @opindex fdump-rtl-ce3 Dump after the third if conversion, to @file{@var{file}.146r.ce3}. -@item -df @itemx -fdump-rtl-cfg @itemx -fdump-rtl-life -@opindex df @opindex fdump-rtl-cfg @opindex fdump-rtl-life -@option{-df} and @option{-fdump-rtl-cfg} enable dumping after control -and data flow analysis, to @file{@var{file}.116r.cfg}. @option{-df} -and @option{-fdump-rtl-cfg} enable dumping dump after life analysis, +@option{-fdump-rtl-cfg} enable dumping after control +and data flow analysis, to @file{@var{file}.116r.cfg}. +@option{-fdump-rtl-cfg} enable dumping dump after life analysis, to @file{@var{file}.128r.life1} and @file{@var{file}.135r.life2}. -@item -dg @itemx -fdump-rtl-greg -@opindex dg @opindex fdump-rtl-greg Dump after global register allocation, to @file{@var{file}.139r.greg}. -@item -dG @itemx -fdump-rtl-gcse @itemx -fdump-rtl-bypass -@opindex dG @opindex fdump-rtl-gcse @opindex fdump-rtl-bypass -@option{-dG} and @option{-fdump-rtl-gcse} enable dumping after GCSE, to -@file{@var{file}.114r.gcse}. @option{-dG} and @option{-fdump-rtl-bypass} +@option{-fdump-rtl-gcse} enable dumping after GCSE, to +@file{@var{file}.114r.gcse}. @option{-fdump-rtl-bypass} enable dumping after jump bypassing and control flow optimizations, to @file{@var{file}.115r.bypass}. -@item -dh @itemx -fdump-rtl-eh -@opindex dh @opindex fdump-rtl-eh Dump after finalization of EH handling code, to @file{@var{file}.02.eh}. -@item -di @itemx -fdump-rtl-sibling -@opindex di @opindex fdump-rtl-sibling Dump after sibling call optimizations, to @file{@var{file}.106r.sibling}. -@item -dj @itemx -fdump-rtl-jump -@opindex dj @opindex fdump-rtl-jump Dump after the first jump optimization, to @file{@var{file}.112r.jump}. -@item -dk @itemx -fdump-rtl-stack -@opindex dk @opindex fdump-rtl-stack Dump after conversion from GCC's "flat register file" registers to the x87's stack-like registers, to @file{@var{file}.152r.stack}. -@item -dl @itemx -fdump-rtl-lreg -@opindex dl @opindex fdump-rtl-lreg Dump after local register allocation, to @file{@var{file}.138r.lreg}. -@item -dL @itemx -fdump-rtl-loop2 -@opindex dL @opindex fdump-rtl-loop2 @option{-dL} and @option{-fdump-rtl-loop2} enable dumping after the loop optimization pass, to @file{@var{file}.119r.loop2}, @@ -4561,107 +4533,75 @@ loop optimization pass, to @file{@var{file}.119r.loop2}, @file{@var{file}.121r.loop2_invariant}, and @file{@var{file}.125r.loop2_done}. -@item -dm @itemx -fdump-rtl-sms -@opindex dm @opindex fdump-rtl-sms Dump after modulo scheduling, to @file{@var{file}.136r.sms}. -@item -dM @itemx -fdump-rtl-mach -@opindex dM @opindex fdump-rtl-mach Dump after performing the machine dependent reorganization pass, to @file{@var{file}.155r.mach} if that pass exists. -@item -dn @itemx -fdump-rtl-rnreg -@opindex dn @opindex fdump-rtl-rnreg Dump after register renumbering, to @file{@var{file}.147r.rnreg}. -@item -dN @itemx -fdump-rtl-regmove -@opindex dN @opindex fdump-rtl-regmove Dump after the register move pass, to @file{@var{file}.132r.regmove}. -@item -do @itemx -fdump-rtl-postreload -@opindex do @opindex fdump-rtl-postreload Dump after post-reload optimizations, to @file{@var{file}.24.postreload}. -@item -dr @itemx -fdump-rtl-expand -@opindex dr @opindex fdump-rtl-expand Dump after RTL generation, to @file{@var{file}.104r.expand}. -@item -dR @itemx -fdump-rtl-sched2 -@opindex dR @opindex fdump-rtl-sched2 Dump after the second scheduling pass, to @file{@var{file}.149r.sched2}. -@item -ds @itemx -fdump-rtl-cse -@opindex ds @opindex fdump-rtl-cse Dump after CSE (including the jump optimization that sometimes follows CSE), to @file{@var{file}.113r.cse}. -@item -dS @itemx -fdump-rtl-sched1 -@opindex dS @opindex fdump-rtl-sched1 Dump after the first scheduling pass, to @file{@var{file}.136r.sched1}. -@item -dt @itemx -fdump-rtl-cse2 -@opindex dt @opindex fdump-rtl-cse2 Dump after the second CSE pass (including the jump optimization that sometimes follows CSE), to @file{@var{file}.127r.cse2}. -@item -dT @itemx -fdump-rtl-tracer -@opindex dT @opindex fdump-rtl-tracer Dump after running tracer, to @file{@var{file}.118r.tracer}. -@item -dV @itemx -fdump-rtl-vpt @itemx -fdump-rtl-vartrack -@opindex dV @opindex fdump-rtl-vpt @opindex fdump-rtl-vartrack -@option{-dV} and @option{-fdump-rtl-vpt} enable dumping after the value -profile transformations, to @file{@var{file}.10.vpt}. @option{-dV} -and @option{-fdump-rtl-vartrack} enable dumping after variable tracking, +@option{-fdump-rtl-vpt} enable dumping after the value +profile transformations, to @file{@var{file}.10.vpt}. +@option{-fdump-rtl-vartrack} enable dumping after variable tracking, to @file{@var{file}.154r.vartrack}. -@item -dw @itemx -fdump-rtl-flow2 -@opindex dw @opindex fdump-rtl-flow2 Dump after the second flow pass, to @file{@var{file}.142r.flow2}. -@item -dz @itemx -fdump-rtl-peephole2 -@opindex dz @opindex fdump-rtl-peephole2 Dump after the peephole pass, to @file{@var{file}.145r.peephole2}. -@item -dZ @itemx -fdump-rtl-web -@opindex dZ @opindex fdump-rtl-web Dump after live range splitting, to @file{@var{file}.126r.web}. -@item -da @itemx -fdump-rtl-all -@opindex da @opindex fdump-rtl-all Produce all the dumps listed above. @@ -5224,8 +5164,8 @@ invoking @option{-O2} on programs that use computed gotos. @opindex O3 Optimize yet more. @option{-O3} turns on all optimizations specified by @option{-O2} and also turns on the @option{-finline-functions}, -@option{-funswitch-loops}, @option{-fpredictive-commoning} and -@option{-fgcse-after-reload} options. +@option{-funswitch-loops}, @option{-fpredictive-commoning}, +@option{-fgcse-after-reload} and @option{-ftree-vectorize} options. @item -O0 @opindex O0 @@ -6009,7 +5949,8 @@ enabled by default at @option{-O} and higher. @item -ftree-vectorize @opindex ftree-vectorize -Perform loop vectorization on trees. +Perform loop vectorization on trees. This flag is enabled by default at +@option{-O3}. @item -ftree-vect-loop-version @opindex ftree-vect-loop-version diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi index 2c1446f3807..869bb1b6a0a 100644 --- a/gcc/doc/tm.texi +++ b/gcc/doc/tm.texi @@ -10319,6 +10319,18 @@ If defined, this macro is the number of entries in @code{TARGET_FORMAT_TYPES}. @end defmac +@defmac TARGET_OVERRIDES_FORMAT_ATTRIBUTES +If defined, this macro is the name of a global variable containing +target-specific format overrides for the @option{-Wformat} option. The +default is to have no target-specific format overrides. If defined, +@code{TARGET_FORMAT_TYPES} must be defined, too. +@end defmac + +@defmac TARGET_OVERRIDES_FORMAT_ATTRIBUTES_COUNT +If defined, this macro specifies the number of entries in +@code{TARGET_OVERRIDES_FORMAT_ATTRIBUTES}. +@end defmac + @deftypefn {Target Hook} bool TARGET_RELAXED_ORDERING If set to @code{true}, means that the target's memory model does not guarantee that loads which do not depend on one another will access diff --git a/gcc/dse.c b/gcc/dse.c index 48df3503b6f..fea7afaca04 100644 --- a/gcc/dse.c +++ b/gcc/dse.c @@ -3303,8 +3303,10 @@ gate_dse2 (void) && dbg_cnt (dse2); } -struct tree_opt_pass pass_rtl_dse1 = +struct rtl_opt_pass pass_rtl_dse1 = { + { + RTL_PASS, "dse1", /* name */ gate_dse1, /* gate */ rest_of_handle_dse, /* execute */ @@ -3318,12 +3320,14 @@ struct tree_opt_pass pass_rtl_dse1 = 0, /* todo_flags_start */ TODO_dump_func | TODO_df_finish | TODO_verify_rtl_sharing | - TODO_ggc_collect, /* todo_flags_finish */ - 'w' /* letter */ + TODO_ggc_collect /* todo_flags_finish */ + } }; -struct tree_opt_pass pass_rtl_dse2 = +struct rtl_opt_pass pass_rtl_dse2 = { + { + RTL_PASS, "dse2", /* name */ gate_dse2, /* gate */ rest_of_handle_dse, /* execute */ @@ -3337,6 +3341,6 @@ struct tree_opt_pass pass_rtl_dse2 = 0, /* todo_flags_start */ TODO_dump_func | TODO_df_finish | TODO_verify_rtl_sharing | - TODO_ggc_collect, /* todo_flags_finish */ - 'w' /* letter */ + TODO_ggc_collect /* todo_flags_finish */ + } }; diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c index 8628d5238de..02680a9c06b 100644 --- a/gcc/emit-rtl.c +++ b/gcc/emit-rtl.c @@ -2181,8 +2181,10 @@ unshare_all_rtl (void) return 0; } -struct tree_opt_pass pass_unshare_all_rtl = +struct rtl_opt_pass pass_unshare_all_rtl = { + { + RTL_PASS, "unshare", /* name */ NULL, /* gate */ unshare_all_rtl, /* execute */ @@ -2194,8 +2196,8 @@ struct tree_opt_pass pass_unshare_all_rtl = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - TODO_dump_func | TODO_verify_rtl_sharing, /* todo_flags_finish */ - 0 /* letter */ + TODO_dump_func | TODO_verify_rtl_sharing /* todo_flags_finish */ + } }; diff --git a/gcc/except.c b/gcc/except.c index 0fbda613961..9c18ebde765 100644 --- a/gcc/except.c +++ b/gcc/except.c @@ -2843,8 +2843,10 @@ set_nothrow_function_flags (void) return 0; } -struct tree_opt_pass pass_set_nothrow_function_flags = +struct rtl_opt_pass pass_set_nothrow_function_flags = { + { + RTL_PASS, NULL, /* name */ NULL, /* gate */ set_nothrow_function_flags, /* execute */ @@ -2857,7 +2859,7 @@ struct tree_opt_pass pass_set_nothrow_function_flags = 0, /* properties_destroyed */ 0, /* todo_flags_start */ 0, /* todo_flags_finish */ - 0 /* letter */ + } }; @@ -3372,8 +3374,10 @@ convert_to_eh_region_ranges (void) return 0; } -struct tree_opt_pass pass_convert_to_eh_region_ranges = +struct rtl_opt_pass pass_convert_to_eh_region_ranges = { + { + RTL_PASS, "eh-ranges", /* name */ NULL, /* gate */ convert_to_eh_region_ranges, /* execute */ @@ -3386,7 +3390,7 @@ struct tree_opt_pass pass_convert_to_eh_region_ranges = 0, /* properties_destroyed */ 0, /* todo_flags_start */ TODO_dump_func, /* todo_flags_finish */ - 0 /* letter */ + } }; @@ -3995,8 +3999,10 @@ rest_of_handle_eh (void) return 0; } -struct tree_opt_pass pass_rtl_eh = +struct rtl_opt_pass pass_rtl_eh = { + { + RTL_PASS, "eh", /* name */ gate_handle_eh, /* gate */ rest_of_handle_eh, /* execute */ @@ -4008,8 +4014,8 @@ struct tree_opt_pass pass_rtl_eh = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - TODO_dump_func, /* todo_flags_finish */ - 'h' /* letter */ + TODO_dump_func /* todo_flags_finish */ + } }; #include "gt-except.h" diff --git a/gcc/expr.c b/gcc/expr.c index 3294f1a23e0..7e1a0ffa85b 100644 --- a/gcc/expr.c +++ b/gcc/expr.c @@ -4484,9 +4484,8 @@ store_expr (tree exp, rtx target, int call_param_p, bool nontemporal) converting modes. */ if (INTEGRAL_TYPE_P (TREE_TYPE (exp)) && TREE_TYPE (TREE_TYPE (exp)) == 0 - && (!lang_hooks.reduce_bit_field_operations - || (GET_MODE_PRECISION (GET_MODE (target)) - == TYPE_PRECISION (TREE_TYPE (exp))))) + && GET_MODE_PRECISION (GET_MODE (target)) + == TYPE_PRECISION (TREE_TYPE (exp))) { if (TYPE_UNSIGNED (TREE_TYPE (exp)) != SUBREG_PROMOTED_UNSIGNED_P (target)) @@ -7055,6 +7054,7 @@ expand_expr_real (tree exp, rtx target, enum machine_mode tmode, /* Handle ERROR_MARK before anybody tries to access its type. */ if (TREE_CODE (exp) == ERROR_MARK + || TREE_CODE (exp) == PREDICT_EXPR || (!GIMPLE_TUPLE_P (exp) && TREE_CODE (TREE_TYPE (exp)) == ERROR_MARK)) { ret = CONST0_RTX (tmode); @@ -7133,8 +7133,8 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode, rtx subtarget, original_target; int ignore; tree context, subexp0, subexp1; - bool reduce_bit_field = false; -#define REDUCE_BIT_FIELD(expr) (reduce_bit_field && !ignore \ + bool reduce_bit_field; +#define REDUCE_BIT_FIELD(expr) (reduce_bit_field \ ? reduce_to_bit_field_precision ((expr), \ target, \ type) \ @@ -7152,27 +7152,20 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode, mode = TYPE_MODE (type); unsignedp = TYPE_UNSIGNED (type); } - if (lang_hooks.reduce_bit_field_operations - && TREE_CODE (type) == INTEGER_TYPE - && GET_MODE_PRECISION (mode) > TYPE_PRECISION (type)) - { - /* An operation in what may be a bit-field type needs the - result to be reduced to the precision of the bit-field type, - which is narrower than that of the type's mode. */ - reduce_bit_field = true; - if (modifier == EXPAND_STACK_PARM) - target = 0; - } - /* Use subtarget as the target for operand 0 of a binary operation. */ - subtarget = get_subtarget (target); - original_target = target; ignore = (target == const0_rtx || ((code == NON_LVALUE_EXPR || code == NOP_EXPR || code == CONVERT_EXPR || code == COND_EXPR || code == VIEW_CONVERT_EXPR) && TREE_CODE (type) == VOID_TYPE)); + /* An operation in what may be a bit-field type needs the + result to be reduced to the precision of the bit-field type, + which is narrower than that of the type's mode. */ + reduce_bit_field = (!ignore + && TREE_CODE (type) == INTEGER_TYPE + && GET_MODE_PRECISION (mode) > TYPE_PRECISION (type)); + /* If we are going to ignore this result, we need only do something if there is a side-effect somewhere in the expression. If there is, short-circuit the most common cases here. Note that we must @@ -7221,6 +7214,12 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode, target = 0; } + if (reduce_bit_field && modifier == EXPAND_STACK_PARM) + target = 0; + + /* Use subtarget as the target for operand 0 of a binary operation. */ + subtarget = get_subtarget (target); + original_target = target; switch (code) { diff --git a/gcc/final.c b/gcc/final.c index 05d60d5d68d..2968174a430 100644 --- a/gcc/final.c +++ b/gcc/final.c @@ -794,8 +794,10 @@ compute_alignments (void) return 0; } -struct tree_opt_pass pass_compute_alignments = +struct rtl_opt_pass pass_compute_alignments = { + { + RTL_PASS, "alignments", /* name */ NULL, /* gate */ compute_alignments, /* execute */ @@ -808,8 +810,8 @@ struct tree_opt_pass pass_compute_alignments = 0, /* properties_destroyed */ 0, /* todo_flags_start */ TODO_dump_func | TODO_verify_rtl_sharing - | TODO_ggc_collect, /* todo_flags_finish */ - 0 /* letter */ + | TODO_ggc_collect /* todo_flags_finish */ + } }; @@ -2219,7 +2221,7 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED, /* Get out the operand values. */ string = decode_asm_operands (body, ops, NULL, NULL, NULL, &loc); - /* Inhibit dieing on what would otherwise be compiler bugs. */ + /* Inhibit dying on what would otherwise be compiler bugs. */ insn_noperands = noperands; this_is_asm_operands = insn; expanded = expand_location (loc); @@ -4169,8 +4171,10 @@ rest_of_handle_final (void) return 0; } -struct tree_opt_pass pass_final = +struct rtl_opt_pass pass_final = { + { + RTL_PASS, NULL, /* name */ NULL, /* gate */ rest_of_handle_final, /* execute */ @@ -4182,8 +4186,8 @@ struct tree_opt_pass pass_final = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - TODO_ggc_collect, /* todo_flags_finish */ - 0 /* letter */ + TODO_ggc_collect /* todo_flags_finish */ + } }; @@ -4195,8 +4199,10 @@ rest_of_handle_shorten_branches (void) return 0; } -struct tree_opt_pass pass_shorten_branches = +struct rtl_opt_pass pass_shorten_branches = { + { + RTL_PASS, "shorten", /* name */ NULL, /* gate */ rest_of_handle_shorten_branches, /* execute */ @@ -4208,8 +4214,8 @@ struct tree_opt_pass pass_shorten_branches = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - TODO_dump_func, /* todo_flags_finish */ - 0 /* letter */ + TODO_dump_func /* todo_flags_finish */ + } }; @@ -4277,8 +4283,10 @@ rest_of_clean_state (void) return 0; } -struct tree_opt_pass pass_clean_state = +struct rtl_opt_pass pass_clean_state = { + { + RTL_PASS, NULL, /* name */ NULL, /* gate */ rest_of_clean_state, /* execute */ @@ -4290,7 +4298,7 @@ struct tree_opt_pass pass_clean_state = 0, /* properties_provided */ PROP_rtl, /* properties_destroyed */ 0, /* todo_flags_start */ - 0, /* todo_flags_finish */ - 0 /* letter */ + 0 /* todo_flags_finish */ + } }; diff --git a/gcc/fold-const.c b/gcc/fold-const.c index 4dc4ad72e3c..3bfe52e0081 100644 --- a/gcc/fold-const.c +++ b/gcc/fold-const.c @@ -7784,9 +7784,7 @@ fold_unary (enum tree_code code, tree type, tree op0) - the initial type is a pointer type and the precisions of the intermediate and final types differ, or - the final type is a pointer type and the precisions of the - initial and intermediate types differ. - - the initial type is a pointer to an array and the final type - not. */ + initial and intermediate types differ. */ if (! inside_float && ! inter_float && ! final_float && ! inside_vec && ! inter_vec && ! final_vec && (inter_prec >= inside_prec || inter_prec >= final_prec) @@ -7798,10 +7796,7 @@ fold_unary (enum tree_code code, tree type, tree op0) && ! (inside_ptr && inter_prec != final_prec) && ! (final_ptr && inside_prec != inter_prec) && ! (final_prec != GET_MODE_BITSIZE (TYPE_MODE (type)) - && TYPE_MODE (type) == TYPE_MODE (inter_type)) - && ! (inside_ptr && final_ptr - && TREE_CODE (TREE_TYPE (inside_type)) == ARRAY_TYPE - && TREE_CODE (TREE_TYPE (type)) != ARRAY_TYPE)) + && TYPE_MODE (type) == TYPE_MODE (inter_type))) return fold_build1 (code, type, TREE_OPERAND (op0, 0)); } diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 08f1a8c2c26..9254562afae 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,9 @@ +2008-03-19 Daniel Franke <franke.daniel@gmail.com> + + PR fortran/35152 + * interface.c (gfc_procedure_use): Check for keyworded arguments in + procedures without explicit interfaces. + 2008-03-16 Paul Thomas <pault@gcc.gnu.org> PR fortran/35470 diff --git a/gcc/fortran/interface.c b/gcc/fortran/interface.c index 4cee386d3d5..09f72383b0f 100644 --- a/gcc/fortran/interface.c +++ b/gcc/fortran/interface.c @@ -2419,9 +2419,26 @@ gfc_procedure_use (gfc_symbol *sym, gfc_actual_arglist **ap, locus *where) } } - if (sym->attr.if_source == IFSRC_UNKNOWN - || !compare_actual_formal (ap, sym->formal, 0, - sym->attr.elemental, where)) + if (sym->attr.external + || sym->attr.if_source == IFSRC_UNKNOWN) + { + gfc_actual_arglist *a; + for (a = *ap; a; a = a->next) + { + /* Skip g77 keyword extensions like %VAL, %REF, %LOC. */ + if (a->name != NULL && a->name[0] != '%') + { + gfc_error("Keyword argument requires explicit interface " + "for procedure '%s' at %L", sym->name, &a->expr->where); + break; + } + } + + return; + } + + if (!compare_actual_formal (ap, sym->formal, 0, + sym->attr.elemental, where)) return; check_intents (sym->formal, *ap); diff --git a/gcc/function.c b/gcc/function.c index 275b70264cc..4e2da890214 100644 --- a/gcc/function.c +++ b/gcc/function.c @@ -1737,8 +1737,10 @@ instantiate_virtual_regs (void) return 0; } -struct tree_opt_pass pass_instantiate_virtual_regs = +struct rtl_opt_pass pass_instantiate_virtual_regs = { + { + RTL_PASS, "vregs", /* name */ NULL, /* gate */ instantiate_virtual_regs, /* execute */ @@ -1750,8 +1752,8 @@ struct tree_opt_pass pass_instantiate_virtual_regs = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - TODO_dump_func, /* todo_flags_finish */ - 0 /* letter */ + TODO_dump_func /* todo_flags_finish */ + } }; @@ -4042,8 +4044,10 @@ init_function_for_compilation (void) return 0; } -struct tree_opt_pass pass_init_function = +struct rtl_opt_pass pass_init_function = { + { + RTL_PASS, NULL, /* name */ NULL, /* gate */ init_function_for_compilation, /* execute */ @@ -4055,8 +4059,8 @@ struct tree_opt_pass pass_init_function = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - 0, /* todo_flags_finish */ - 0 /* letter */ + 0 /* todo_flags_finish */ + } }; @@ -5595,8 +5599,10 @@ used_types_insert (tree t) used_types_insert_helper (t, cfun); } -struct tree_opt_pass pass_leaf_regs = +struct rtl_opt_pass pass_leaf_regs = { + { + RTL_PASS, NULL, /* name */ NULL, /* gate */ rest_of_handle_check_leaf_regs, /* execute */ @@ -5608,8 +5614,8 @@ struct tree_opt_pass pass_leaf_regs = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - 0, /* todo_flags_finish */ - 0 /* letter */ + 0 /* todo_flags_finish */ + } }; static unsigned int @@ -5626,8 +5632,10 @@ rest_of_handle_thread_prologue_and_epilogue (void) return 0; } -struct tree_opt_pass pass_thread_prologue_and_epilogue = +struct rtl_opt_pass pass_thread_prologue_and_epilogue = { + { + RTL_PASS, "pro_and_epilogue", /* name */ NULL, /* gate */ rest_of_handle_thread_prologue_and_epilogue, /* execute */ @@ -5642,8 +5650,8 @@ struct tree_opt_pass pass_thread_prologue_and_epilogue = TODO_dump_func | TODO_df_verify | TODO_df_finish | TODO_verify_rtl_sharing | - TODO_ggc_collect, /* todo_flags_finish */ - 'w' /* letter */ + TODO_ggc_collect /* todo_flags_finish */ + } }; @@ -5823,8 +5831,10 @@ rest_of_match_asm_constraints (void) return TODO_df_finish; } -struct tree_opt_pass pass_match_asm_constraints = +struct rtl_opt_pass pass_match_asm_constraints = { + { + RTL_PASS, "asmcons", /* name */ NULL, /* gate */ rest_of_match_asm_constraints, /* execute */ @@ -5836,8 +5846,8 @@ struct tree_opt_pass pass_match_asm_constraints = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - TODO_dump_func, /* todo_flags_finish */ - 0 /* letter */ + TODO_dump_func /* todo_flags_finish */ + } }; diff --git a/gcc/fwprop.c b/gcc/fwprop.c index 089c571a635..b0ae1ba625c 100644 --- a/gcc/fwprop.c +++ b/gcc/fwprop.c @@ -1021,8 +1021,10 @@ fwprop (void) return 0; } -struct tree_opt_pass pass_rtl_fwprop = +struct rtl_opt_pass pass_rtl_fwprop = { + { + RTL_PASS, "fwprop1", /* name */ gate_fwprop, /* gate */ fwprop, /* execute */ @@ -1035,8 +1037,8 @@ struct tree_opt_pass pass_rtl_fwprop = 0, /* properties_destroyed */ 0, /* todo_flags_start */ TODO_df_finish | TODO_verify_rtl_sharing | - TODO_dump_func, /* todo_flags_finish */ - 0 /* letter */ + TODO_dump_func /* todo_flags_finish */ + } }; static unsigned int @@ -1063,8 +1065,10 @@ fwprop_addr (void) return 0; } -struct tree_opt_pass pass_rtl_fwprop_addr = +struct rtl_opt_pass pass_rtl_fwprop_addr = { + { + RTL_PASS, "fwprop2", /* name */ gate_fwprop, /* gate */ fwprop_addr, /* execute */ @@ -1077,6 +1081,6 @@ struct tree_opt_pass pass_rtl_fwprop_addr = 0, /* properties_destroyed */ 0, /* todo_flags_start */ TODO_df_finish | TODO_verify_rtl_sharing | - TODO_dump_func, /* todo_flags_finish */ - 0 /* letter */ + TODO_dump_func /* todo_flags_finish */ + } }; diff --git a/gcc/gcov-io.h b/gcc/gcov-io.h index a874b32dc62..6e9234e3d50 100644 --- a/gcc/gcov-io.h +++ b/gcc/gcov-io.h @@ -467,6 +467,9 @@ extern void __gcov_merge_single (gcov_type *, unsigned) ATTRIBUTE_HIDDEN; consecutive values. */ extern void __gcov_merge_delta (gcov_type *, unsigned) ATTRIBUTE_HIDDEN; +/* The merge function that just ors the counters together. */ +extern void __gcov_merge_ior (gcov_type *, unsigned) ATTRIBUTE_HIDDEN; + /* The profiler functions. */ extern void __gcov_interval_profiler (gcov_type *, gcov_type, int, unsigned); extern void __gcov_pow2_profiler (gcov_type *, gcov_type); @@ -474,11 +477,10 @@ extern void __gcov_one_value_profiler (gcov_type *, gcov_type); extern void __gcov_indirect_call_profiler (gcov_type *, gcov_type, void *, void *); extern void __gcov_average_profiler (gcov_type *, gcov_type); extern void __gcov_ior_profiler (gcov_type *, gcov_type); -extern void __gcov_merge_ior (gcov_type *, unsigned); #ifndef inhibit_libc /* The wrappers around some library functions.. */ -extern pid_t __gcov_fork (void); +extern pid_t __gcov_fork (void) ATTRIBUTE_HIDDEN; extern int __gcov_execl (const char *, const char *, ...) ATTRIBUTE_HIDDEN; extern int __gcov_execlp (const char *, const char *, ...) ATTRIBUTE_HIDDEN; extern int __gcov_execle (const char *, const char *, ...) ATTRIBUTE_HIDDEN; diff --git a/gcc/gcse.c b/gcc/gcse.c index c9c8b4c32b3..201e42c5a97 100644 --- a/gcc/gcse.c +++ b/gcc/gcse.c @@ -6691,8 +6691,10 @@ rest_of_handle_jump_bypass (void) return 0; } -struct tree_opt_pass pass_jump_bypass = +struct rtl_opt_pass pass_jump_bypass = { + { + RTL_PASS, "bypass", /* name */ gate_handle_jump_bypass, /* gate */ rest_of_handle_jump_bypass, /* execute */ @@ -6705,8 +6707,8 @@ struct tree_opt_pass pass_jump_bypass = 0, /* properties_destroyed */ 0, /* todo_flags_start */ TODO_dump_func | - TODO_ggc_collect | TODO_verify_flow, /* todo_flags_finish */ - 'G' /* letter */ + TODO_ggc_collect | TODO_verify_flow /* todo_flags_finish */ + } }; @@ -6760,8 +6762,10 @@ rest_of_handle_gcse (void) return 0; } -struct tree_opt_pass pass_gcse = +struct rtl_opt_pass pass_gcse = { + { + RTL_PASS, "gcse1", /* name */ gate_handle_gcse, /* gate */ rest_of_handle_gcse, /* execute */ @@ -6775,8 +6779,8 @@ struct tree_opt_pass pass_gcse = 0, /* todo_flags_start */ TODO_df_finish | TODO_verify_rtl_sharing | TODO_dump_func | - TODO_verify_flow | TODO_ggc_collect, /* todo_flags_finish */ - 'G' /* letter */ + TODO_verify_flow | TODO_ggc_collect /* todo_flags_finish */ + } }; diff --git a/gcc/gimple-low.c b/gcc/gimple-low.c index a860dd1caf1..09ca304bca4 100644 --- a/gcc/gimple-low.c +++ b/gcc/gimple-low.c @@ -148,8 +148,10 @@ lower_function_body (void) return 0; } -struct tree_opt_pass pass_lower_cf = +struct gimple_opt_pass pass_lower_cf = { + { + GIMPLE_PASS, "lower", /* name */ NULL, /* gate */ lower_function_body, /* execute */ @@ -161,8 +163,8 @@ struct tree_opt_pass pass_lower_cf = PROP_gimple_lcf, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - TODO_dump_func, /* todo_flags_finish */ - 0 /* letter */ + TODO_dump_func /* todo_flags_finish */ + } }; @@ -235,6 +237,7 @@ lower_stmt (tree_stmt_iterator *tsi, struct lower_data *data) case NOP_EXPR: case ASM_EXPR: case GOTO_EXPR: + case PREDICT_EXPR: case LABEL_EXPR: case SWITCH_EXPR: case CHANGE_DYNAMIC_TYPE_EXPR: @@ -789,8 +792,10 @@ mark_used_blocks (void) } -struct tree_opt_pass pass_mark_used_blocks = +struct gimple_opt_pass pass_mark_used_blocks = { + { + GIMPLE_PASS, "blocks", /* name */ NULL, /* gate */ mark_used_blocks, /* execute */ @@ -802,6 +807,6 @@ struct tree_opt_pass pass_mark_used_blocks = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - TODO_dump_func, /* todo_flags_finish */ - 0 /* letter */ + TODO_dump_func /* todo_flags_finish */ + } }; diff --git a/gcc/gimplify.c b/gcc/gimplify.c index a75c711384f..acdfb994960 100644 --- a/gcc/gimplify.c +++ b/gcc/gimplify.c @@ -5837,6 +5837,10 @@ gimplify_expr (tree *expr_p, tree *pre_p, tree *post_p, NULL, is_gimple_val, fb_rvalue); break; + /* Predictions are always gimplified. */ + case PREDICT_EXPR: + goto out; + case LABEL_EXPR: ret = GS_ALL_DONE; gcc_assert (decl_function_context (LABEL_EXPR_LABEL (*expr_p)) @@ -6022,12 +6026,18 @@ gimplify_expr (tree *expr_p, tree *pre_p, tree *post_p, case OMP_RETURN: case OMP_CONTINUE: - case OMP_ATOMIC_LOAD: - case OMP_ATOMIC_STORE: - + case OMP_ATOMIC_STORE: ret = GS_ALL_DONE; break; + case OMP_ATOMIC_LOAD: + if (gimplify_expr (&TREE_OPERAND (*expr_p, 1), pre_p, NULL, + is_gimple_val, fb_rvalue) != GS_ALL_DONE) + ret = GS_ERROR; + else + ret = GS_ALL_DONE; + break; + case POINTER_PLUS_EXPR: /* Convert ((type *)A)+offset into &A->field_of_type_and_offset. The second is gimple immediate saving a need for extra statement. diff --git a/gcc/global.c b/gcc/global.c index ca9f4fb1a8a..f88da110321 100644 --- a/gcc/global.c +++ b/gcc/global.c @@ -1783,7 +1783,7 @@ rest_of_handle_global_alloc (void) failure = reload (get_insns (), 0); } - if (dump_enabled_p (pass_global_alloc.static_pass_number)) + if (dump_enabled_p (pass_global_alloc.pass.static_pass_number)) { timevar_push (TV_DUMP); dump_global_regs (dump_file); @@ -1817,8 +1817,10 @@ rest_of_handle_global_alloc (void) return 0; } -struct tree_opt_pass pass_global_alloc = +struct rtl_opt_pass pass_global_alloc = { + { + RTL_PASS, "greg", /* name */ NULL, /* gate */ rest_of_handle_global_alloc, /* execute */ @@ -1831,7 +1833,7 @@ struct tree_opt_pass pass_global_alloc = 0, /* properties_destroyed */ 0, /* todo_flags_start */ TODO_dump_func | TODO_verify_rtl_sharing - | TODO_ggc_collect, /* todo_flags_finish */ - 'g' /* letter */ + | TODO_ggc_collect /* todo_flags_finish */ + } }; diff --git a/gcc/ifcvt.c b/gcc/ifcvt.c index cab4fbdf6b1..98b707a3e77 100644 --- a/gcc/ifcvt.c +++ b/gcc/ifcvt.c @@ -4143,8 +4143,10 @@ rest_of_handle_if_conversion (void) return 0; } -struct tree_opt_pass pass_rtl_ifcvt = +struct rtl_opt_pass pass_rtl_ifcvt = { + { + RTL_PASS, "ce1", /* name */ gate_handle_if_conversion, /* gate */ rest_of_handle_if_conversion, /* execute */ @@ -4157,8 +4159,8 @@ struct tree_opt_pass pass_rtl_ifcvt = 0, /* properties_destroyed */ 0, /* todo_flags_start */ TODO_df_finish | TODO_verify_rtl_sharing | - TODO_dump_func, /* todo_flags_finish */ - 'C' /* letter */ + TODO_dump_func /* todo_flags_finish */ + } }; static bool @@ -4178,8 +4180,10 @@ rest_of_handle_if_after_combine (void) return 0; } -struct tree_opt_pass pass_if_after_combine = +struct rtl_opt_pass pass_if_after_combine = { + { + RTL_PASS, "ce2", /* name */ gate_handle_if_after_combine, /* gate */ rest_of_handle_if_after_combine, /* execute */ @@ -4193,8 +4197,8 @@ struct tree_opt_pass pass_if_after_combine = 0, /* todo_flags_start */ TODO_df_finish | TODO_verify_rtl_sharing | TODO_dump_func | - TODO_ggc_collect, /* todo_flags_finish */ - 'C' /* letter */ + TODO_ggc_collect /* todo_flags_finish */ + } }; @@ -4213,8 +4217,10 @@ rest_of_handle_if_after_reload (void) } -struct tree_opt_pass pass_if_after_reload = +struct rtl_opt_pass pass_if_after_reload = { + { + RTL_PASS, "ce3", /* name */ gate_handle_if_after_reload, /* gate */ rest_of_handle_if_after_reload, /* execute */ @@ -4228,6 +4234,6 @@ struct tree_opt_pass pass_if_after_reload = 0, /* todo_flags_start */ TODO_df_finish | TODO_verify_rtl_sharing | TODO_dump_func | - TODO_ggc_collect, /* todo_flags_finish */ - 'E' /* letter */ + TODO_ggc_collect /* todo_flags_finish */ + } }; diff --git a/gcc/init-regs.c b/gcc/init-regs.c index b835de07513..83abe715971 100644 --- a/gcc/init-regs.c +++ b/gcc/init-regs.c @@ -139,8 +139,10 @@ rest_of_handle_initialize_regs (void) return 0; } -struct tree_opt_pass pass_initialize_regs = +struct rtl_opt_pass pass_initialize_regs = { + { + RTL_PASS, "init-regs", /* name */ gate_initialize_regs, /* gate */ rest_of_handle_initialize_regs, /* execute */ @@ -153,6 +155,6 @@ struct tree_opt_pass pass_initialize_regs = 0, /* properties_destroyed */ 0, /* todo_flags_start */ TODO_dump_func | - TODO_df_finish, /* todo_flags_finish */ - 0 /* letter */ + TODO_df_finish /* todo_flags_finish */ + } }; diff --git a/gcc/integrate.c b/gcc/integrate.c index 7eb29f20303..55ac31ddf93 100644 --- a/gcc/integrate.c +++ b/gcc/integrate.c @@ -298,8 +298,10 @@ emit_initial_value_sets (void) return 0; } -struct tree_opt_pass pass_initial_value_sets = +struct rtl_opt_pass pass_initial_value_sets = { + { + RTL_PASS, "initvals", /* name */ NULL, /* gate */ emit_initial_value_sets, /* execute */ @@ -311,8 +313,8 @@ struct tree_opt_pass pass_initial_value_sets = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - TODO_dump_func, /* todo_flags_finish */ - 0 /* letter */ + TODO_dump_func /* todo_flags_finish */ + } }; /* If the backend knows where to allocate pseudos for hard diff --git a/gcc/ipa-cp.c b/gcc/ipa-cp.c index 088319dc65c..4d9e0a4eb28 100644 --- a/gcc/ipa-cp.c +++ b/gcc/ipa-cp.c @@ -1136,7 +1136,10 @@ cgraph_gate_cp (void) return flag_ipa_cp; } -struct tree_opt_pass pass_ipa_cp = { +struct simple_ipa_opt_pass pass_ipa_cp = +{ + { + SIMPLE_IPA_PASS, "cp", /* name */ cgraph_gate_cp, /* gate */ ipcp_driver, /* execute */ @@ -1148,6 +1151,6 @@ struct tree_opt_pass pass_ipa_cp = { PROP_trees, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - TODO_dump_cgraph | TODO_dump_func, /* todo_flags_finish */ - 0 /* letter */ + TODO_dump_cgraph | TODO_dump_func /* todo_flags_finish */ + } }; diff --git a/gcc/ipa-inline.c b/gcc/ipa-inline.c index 06d00e355dd..f251fbebe30 100644 --- a/gcc/ipa-inline.c +++ b/gcc/ipa-inline.c @@ -1426,8 +1426,10 @@ cgraph_gate_inlining (void) return flag_inline_trees; } -struct tree_opt_pass pass_ipa_inline = +struct simple_ipa_opt_pass pass_ipa_inline = { + { + SIMPLE_IPA_PASS, "inline", /* name */ cgraph_gate_inlining, /* gate */ cgraph_decide_inlining, /* execute */ @@ -1440,8 +1442,8 @@ struct tree_opt_pass pass_ipa_inline = 0, /* properties_destroyed */ TODO_remove_functions, /* todo_flags_finish */ TODO_dump_cgraph | TODO_dump_func - | TODO_remove_functions, /* todo_flags_finish */ - 0 /* letter */ + | TODO_remove_functions /* todo_flags_finish */ + } }; /* Because inlining might remove no-longer reachable nodes, we need to @@ -1479,8 +1481,10 @@ cgraph_gate_early_inlining (void) return flag_inline_trees && flag_early_inlining; } -struct tree_opt_pass pass_early_inline = +struct gimple_opt_pass pass_early_inline = { + { + GIMPLE_PASS, "einline", /* name */ cgraph_gate_early_inlining, /* gate */ cgraph_early_inlining, /* execute */ @@ -1492,8 +1496,8 @@ struct tree_opt_pass pass_early_inline = PROP_cfg, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - TODO_dump_func, /* todo_flags_finish */ - 0 /* letter */ + TODO_dump_func /* todo_flags_finish */ + } }; /* When inlining shall be performed. */ @@ -1507,8 +1511,10 @@ cgraph_gate_ipa_early_inlining (void) /* IPA pass wrapper for early inlining pass. We need to run early inlining before tree profiling so we have stand alone IPA pass for doing so. */ -struct tree_opt_pass pass_ipa_early_inline = +struct simple_ipa_opt_pass pass_ipa_early_inline = { + { + SIMPLE_IPA_PASS, "einline_ipa", /* name */ cgraph_gate_ipa_early_inlining, /* gate */ NULL, /* execute */ @@ -1520,8 +1526,8 @@ struct tree_opt_pass pass_ipa_early_inline = PROP_cfg, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - TODO_dump_cgraph, /* todo_flags_finish */ - 0 /* letter */ + TODO_dump_cgraph /* todo_flags_finish */ + } }; /* Compute parameters of functions used by inliner. */ @@ -1554,8 +1560,10 @@ gate_inline_passes (void) return flag_inline_trees; } -struct tree_opt_pass pass_inline_parameters = +struct gimple_opt_pass pass_inline_parameters = { + { + GIMPLE_PASS, NULL, /* name */ gate_inline_passes, /* gate */ compute_inline_parameters, /* execute */ @@ -1567,8 +1575,8 @@ struct tree_opt_pass pass_inline_parameters = PROP_cfg, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - 0, /* todo_flags_finish */ - 0 /* letter */ + 0 /* todo_flags_finish */ + } }; /* Apply inline plan to the function. */ @@ -1609,8 +1617,10 @@ apply_inline (void) return todo | execute_fixup_cfg (); } -struct tree_opt_pass pass_apply_inline = +struct gimple_opt_pass pass_apply_inline = { + { + GIMPLE_PASS, "apply_inline", /* name */ NULL, /* gate */ apply_inline, /* execute */ @@ -1623,8 +1633,8 @@ struct tree_opt_pass pass_apply_inline = 0, /* properties_destroyed */ 0, /* todo_flags_start */ TODO_dump_func | TODO_verify_flow - | TODO_verify_stmts, /* todo_flags_finish */ - 0 /* letter */ + | TODO_verify_stmts /* todo_flags_finish */ + } }; #include "gt-ipa-inline.h" diff --git a/gcc/ipa-pure-const.c b/gcc/ipa-pure-const.c index eb4262a0047..c180e35d6c1 100644 --- a/gcc/ipa-pure-const.c +++ b/gcc/ipa-pure-const.c @@ -769,8 +769,10 @@ gate_pure_const (void) && !(errorcount || sorrycount)); } -struct tree_opt_pass pass_ipa_pure_const = +struct simple_ipa_opt_pass pass_ipa_pure_const = { + { + SIMPLE_IPA_PASS, "pure-const", /* name */ gate_pure_const, /* gate */ static_execute, /* execute */ @@ -782,8 +784,8 @@ struct tree_opt_pass pass_ipa_pure_const = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - 0, /* todo_flags_finish */ - 0 /* letter */ + 0 /* todo_flags_finish */ + } }; diff --git a/gcc/ipa-reference.c b/gcc/ipa-reference.c index 87d8c2fa144..71c0ec50297 100644 --- a/gcc/ipa-reference.c +++ b/gcc/ipa-reference.c @@ -1319,8 +1319,10 @@ gate_reference (void) && !(errorcount || sorrycount)); } -struct tree_opt_pass pass_ipa_reference = +struct simple_ipa_opt_pass pass_ipa_reference = { + { + SIMPLE_IPA_PASS, "static-var", /* name */ gate_reference, /* gate */ static_execute, /* execute */ @@ -1332,8 +1334,8 @@ struct tree_opt_pass pass_ipa_reference = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - 0, /* todo_flags_finish */ - 0 /* letter */ + 0 /* todo_flags_finish */ + } }; #include "gt-ipa-reference.h" diff --git a/gcc/ipa-struct-reorg.c b/gcc/ipa-struct-reorg.c index 515dba67206..10eedec08ec 100644 --- a/gcc/ipa-struct-reorg.c +++ b/gcc/ipa-struct-reorg.c @@ -4038,8 +4038,10 @@ struct_reorg_gate (void) && (optimize > 0); } -struct tree_opt_pass pass_ipa_struct_reorg = +struct simple_ipa_opt_pass pass_ipa_struct_reorg = { + { + SIMPLE_IPA_PASS, "ipa_struct_reorg", /* name */ struct_reorg_gate, /* gate */ reorg_structs_drive, /* execute */ @@ -4051,6 +4053,6 @@ struct tree_opt_pass pass_ipa_struct_reorg = 0, /* properties_provided */ 0, /* properties_destroyed */ TODO_verify_ssa, /* todo_flags_start */ - TODO_dump_func | TODO_verify_ssa, /* todo_flags_finish */ - 0 /* letter */ + TODO_dump_func | TODO_verify_ssa /* todo_flags_finish */ + } }; diff --git a/gcc/ipa-type-escape.c b/gcc/ipa-type-escape.c index 2aedb95987e..9cd9caa99df 100644 --- a/gcc/ipa-type-escape.c +++ b/gcc/ipa-type-escape.c @@ -2196,8 +2196,10 @@ gate_type_escape_vars (void) && !(errorcount || sorrycount)); } -struct tree_opt_pass pass_ipa_type_escape = +struct simple_ipa_opt_pass pass_ipa_type_escape = { + { + SIMPLE_IPA_PASS, "type-escape-var", /* name */ gate_type_escape_vars, /* gate */ type_escape_execute, /* execute */ @@ -2209,7 +2211,7 @@ struct tree_opt_pass pass_ipa_type_escape = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - 0, /* todo_flags_finish */ - 0 /* letter */ + 0 /* todo_flags_finish */ + } }; diff --git a/gcc/ipa.c b/gcc/ipa.c index 0bfe255e9c8..16023be2dee 100644 --- a/gcc/ipa.c +++ b/gcc/ipa.c @@ -278,8 +278,10 @@ function_and_variable_visibility (void) return 0; } -struct tree_opt_pass pass_ipa_function_and_variable_visibility = +struct simple_ipa_opt_pass pass_ipa_function_and_variable_visibility = { + { + SIMPLE_IPA_PASS, "visibility", /* name */ NULL, /* gate */ function_and_variable_visibility, /* execute */ @@ -291,6 +293,6 @@ struct tree_opt_pass pass_ipa_function_and_variable_visibility = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - TODO_remove_functions | TODO_dump_cgraph,/* todo_flags_finish */ - 0 /* letter */ + TODO_remove_functions | TODO_dump_cgraph/* todo_flags_finish */ + } }; diff --git a/gcc/jump.c b/gcc/jump.c index 4564cd105ce..1aa0c6db6d8 100644 --- a/gcc/jump.c +++ b/gcc/jump.c @@ -122,8 +122,10 @@ cleanup_barriers (void) return 0; } -struct tree_opt_pass pass_cleanup_barriers = +struct rtl_opt_pass pass_cleanup_barriers = { + { + RTL_PASS, "barriers", /* name */ NULL, /* gate */ cleanup_barriers, /* execute */ @@ -135,8 +137,8 @@ struct tree_opt_pass pass_cleanup_barriers = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - TODO_dump_func, /* todo_flags_finish */ - 0 /* letter */ + TODO_dump_func /* todo_flags_finish */ + } }; diff --git a/gcc/langhooks-def.h b/gcc/langhooks-def.h index 9f2cc71a431..bd3fdca6c38 100644 --- a/gcc/langhooks-def.h +++ b/gcc/langhooks-def.h @@ -97,7 +97,6 @@ extern void lhd_omp_firstprivatize_type_sizes (struct gimplify_omp_ctx *, #define LANG_HOOKS_STATICP lhd_staticp #define LANG_HOOKS_DUP_LANG_SPECIFIC_DECL lhd_do_nothing_t #define LANG_HOOKS_SET_DECL_ASSEMBLER_NAME lhd_set_decl_assembler_name -#define LANG_HOOKS_REDUCE_BIT_FIELD_OPERATIONS true #define LANG_HOOKS_NO_BODY_BLOCKS false #define LANG_HOOKS_PRINT_STATISTICS lhd_do_nothing #define LANG_HOOKS_PRINT_XNODE lhd_print_tree_nothing @@ -257,7 +256,6 @@ extern tree lhd_make_node (enum tree_code); LANG_HOOKS_STATICP, \ LANG_HOOKS_DUP_LANG_SPECIFIC_DECL, \ LANG_HOOKS_SET_DECL_ASSEMBLER_NAME, \ - LANG_HOOKS_REDUCE_BIT_FIELD_OPERATIONS, \ LANG_HOOKS_NO_BODY_BLOCKS, \ LANG_HOOKS_PRINT_STATISTICS, \ LANG_HOOKS_PRINT_XNODE, \ diff --git a/gcc/langhooks.h b/gcc/langhooks.h index 9da60f11b23..3ee23f69c0f 100644 --- a/gcc/langhooks.h +++ b/gcc/langhooks.h @@ -329,10 +329,6 @@ struct lang_hooks assembler does not talk about it. */ void (*set_decl_assembler_name) (tree); - /* Nonzero if operations on types narrower than their mode should - have their results reduced to the precision of the type. */ - bool reduce_bit_field_operations; - /* Nonzero if this front end does not generate a dummy BLOCK between the outermost scope of the function and the FUNCTION_DECL. See is_body_block in stmt.c, and its callers. */ diff --git a/gcc/local-alloc.c b/gcc/local-alloc.c index 9569a36e707..0d6d908581a 100644 --- a/gcc/local-alloc.c +++ b/gcc/local-alloc.c @@ -2632,8 +2632,10 @@ rest_of_handle_local_alloc (void) return 0; } -struct tree_opt_pass pass_local_alloc = +struct rtl_opt_pass pass_local_alloc = { + { + RTL_PASS, "lreg", /* name */ NULL, /* gate */ rest_of_handle_local_alloc, /* execute */ @@ -2646,7 +2648,7 @@ struct tree_opt_pass pass_local_alloc = 0, /* properties_destroyed */ 0, /* todo_flags_start */ TODO_dump_func | - TODO_ggc_collect, /* todo_flags_finish */ - 'l' /* letter */ + TODO_ggc_collect /* todo_flags_finish */ + } }; diff --git a/gcc/loop-init.c b/gcc/loop-init.c index 57f9768b377..83375714d44 100644 --- a/gcc/loop-init.c +++ b/gcc/loop-init.c @@ -140,8 +140,10 @@ gate_handle_loop2 (void) )); } -struct tree_opt_pass pass_loop2 = +struct rtl_opt_pass pass_loop2 = { + { + RTL_PASS, "loop2", /* name */ gate_handle_loop2, /* gate */ NULL, /* execute */ @@ -154,8 +156,8 @@ struct tree_opt_pass pass_loop2 = 0, /* properties_destroyed */ 0, /* todo_flags_start */ TODO_dump_func | - TODO_ggc_collect, /* todo_flags_finish */ - 'L' /* letter */ + TODO_ggc_collect /* todo_flags_finish */ + } }; @@ -172,8 +174,10 @@ rtl_loop_init (void) return 0; } -struct tree_opt_pass pass_rtl_loop_init = +struct rtl_opt_pass pass_rtl_loop_init = { + { + RTL_PASS, "loop2_init", /* name */ NULL, /* gate */ rtl_loop_init, /* execute */ @@ -185,8 +189,8 @@ struct tree_opt_pass pass_rtl_loop_init = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - TODO_dump_func | TODO_verify_rtl_sharing, /* todo_flags_finish */ - 'L' /* letter */ + TODO_dump_func | TODO_verify_rtl_sharing /* todo_flags_finish */ + } }; @@ -205,8 +209,10 @@ rtl_loop_done (void) return 0; } -struct tree_opt_pass pass_rtl_loop_done = +struct rtl_opt_pass pass_rtl_loop_done = { + { + RTL_PASS, "loop2_done", /* name */ NULL, /* gate */ rtl_loop_done, /* execute */ @@ -218,8 +224,8 @@ struct tree_opt_pass pass_rtl_loop_done = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - TODO_dump_func | TODO_verify_rtl_sharing, /* todo_flags_finish */ - 'L' /* letter */ + TODO_dump_func | TODO_verify_rtl_sharing /* todo_flags_finish */ + } }; @@ -238,8 +244,10 @@ rtl_move_loop_invariants (void) return 0; } -struct tree_opt_pass pass_rtl_move_loop_invariants = +struct rtl_opt_pass pass_rtl_move_loop_invariants = { + { + RTL_PASS, "loop2_invariant", /* name */ gate_rtl_move_loop_invariants, /* gate */ rtl_move_loop_invariants, /* execute */ @@ -253,8 +261,8 @@ struct tree_opt_pass pass_rtl_move_loop_invariants = 0, /* todo_flags_start */ TODO_df_verify | TODO_df_finish | TODO_verify_rtl_sharing | - TODO_dump_func, /* todo_flags_finish */ - 'L' /* letter */ + TODO_dump_func /* todo_flags_finish */ + } }; @@ -273,8 +281,10 @@ rtl_unswitch (void) return 0; } -struct tree_opt_pass pass_rtl_unswitch = +struct rtl_opt_pass pass_rtl_unswitch = { + { + RTL_PASS, "loop2_unswitch", /* name */ gate_rtl_unswitch, /* gate */ rtl_unswitch, /* execute */ @@ -287,7 +297,7 @@ struct tree_opt_pass pass_rtl_unswitch = 0, /* properties_destroyed */ 0, /* todo_flags_start */ TODO_dump_func | TODO_verify_rtl_sharing, /* todo_flags_finish */ - 'L' /* letter */ + } }; @@ -319,8 +329,10 @@ rtl_unroll_and_peel_loops (void) return 0; } -struct tree_opt_pass pass_rtl_unroll_and_peel_loops = +struct rtl_opt_pass pass_rtl_unroll_and_peel_loops = { + { + RTL_PASS, "loop2_unroll", /* name */ gate_rtl_unroll_and_peel_loops, /* gate */ rtl_unroll_and_peel_loops, /* execute */ @@ -333,7 +345,7 @@ struct tree_opt_pass pass_rtl_unroll_and_peel_loops = 0, /* properties_destroyed */ 0, /* todo_flags_start */ TODO_dump_func | TODO_verify_rtl_sharing, /* todo_flags_finish */ - 'L' /* letter */ + } }; @@ -358,8 +370,10 @@ rtl_doloop (void) return 0; } -struct tree_opt_pass pass_rtl_doloop = +struct rtl_opt_pass pass_rtl_doloop = { + { + RTL_PASS, "loop2_doloop", /* name */ gate_rtl_doloop, /* gate */ rtl_doloop, /* execute */ @@ -371,7 +385,7 @@ struct tree_opt_pass pass_rtl_doloop = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - TODO_dump_func | TODO_verify_rtl_sharing, /* todo_flags_finish */ - 'L' /* letter */ + TODO_dump_func | TODO_verify_rtl_sharing /* todo_flags_finish */ + } }; diff --git a/gcc/lower-subreg.c b/gcc/lower-subreg.c index fa3a2c87a98..c3b29a84f30 100644 --- a/gcc/lower-subreg.c +++ b/gcc/lower-subreg.c @@ -1425,8 +1425,10 @@ rest_of_handle_lower_subreg2 (void) return 0; } -struct tree_opt_pass pass_lower_subreg = +struct rtl_opt_pass pass_lower_subreg = { + { + RTL_PASS, "subreg", /* name */ gate_handle_lower_subreg, /* gate */ rest_of_handle_lower_subreg, /* execute */ @@ -1440,12 +1442,14 @@ struct tree_opt_pass pass_lower_subreg = 0, /* todo_flags_start */ TODO_dump_func | TODO_ggc_collect | - TODO_verify_flow, /* todo_flags_finish */ - 'u' /* letter */ + TODO_verify_flow /* todo_flags_finish */ + } }; -struct tree_opt_pass pass_lower_subreg2 = +struct rtl_opt_pass pass_lower_subreg2 = { + { + RTL_PASS, "subreg2", /* name */ gate_handle_lower_subreg, /* gate */ rest_of_handle_lower_subreg2, /* execute */ @@ -1460,6 +1464,6 @@ struct tree_opt_pass pass_lower_subreg2 = TODO_df_finish | TODO_verify_rtl_sharing | TODO_dump_func | TODO_ggc_collect | - TODO_verify_flow, /* todo_flags_finish */ - 'U' /* letter */ + TODO_verify_flow /* todo_flags_finish */ + } }; diff --git a/gcc/matrix-reorg.c b/gcc/matrix-reorg.c index 38b0d5e146b..8a2734d0f0b 100644 --- a/gcc/matrix-reorg.c +++ b/gcc/matrix-reorg.c @@ -2317,7 +2317,10 @@ gate_matrix_reorg (void) return flag_ipa_matrix_reorg && flag_whole_program; } -struct tree_opt_pass pass_ipa_matrix_reorg = { +struct simple_ipa_opt_pass pass_ipa_matrix_reorg = +{ + { + SIMPLE_IPA_PASS, "matrix-reorg", /* name */ gate_matrix_reorg, /* gate */ matrix_reorg, /* execute */ @@ -2329,6 +2332,6 @@ struct tree_opt_pass pass_ipa_matrix_reorg = { PROP_trees, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - TODO_dump_cgraph | TODO_dump_func, /* todo_flags_finish */ - 0 /* letter */ + TODO_dump_cgraph | TODO_dump_func /* todo_flags_finish */ + } }; diff --git a/gcc/mode-switching.c b/gcc/mode-switching.c index 5f4f95fa899..23269b815dd 100644 --- a/gcc/mode-switching.c +++ b/gcc/mode-switching.c @@ -756,8 +756,10 @@ rest_of_handle_mode_switching (void) } -struct tree_opt_pass pass_mode_switching = +struct rtl_opt_pass pass_mode_switching = { + { + RTL_PASS, "mode-sw", /* name */ gate_mode_switching, /* gate */ rest_of_handle_mode_switching, /* execute */ @@ -770,6 +772,6 @@ struct tree_opt_pass pass_mode_switching = 0, /* properties_destroyed */ 0, /* todo_flags_start */ TODO_df_finish | TODO_verify_rtl_sharing | - TODO_dump_func, /* todo_flags_finish */ - 0 /* letter */ + TODO_dump_func /* todo_flags_finish */ + } }; diff --git a/gcc/modulo-sched.c b/gcc/modulo-sched.c index 3d710ad6a43..f2193d4e41a 100644 --- a/gcc/modulo-sched.c +++ b/gcc/modulo-sched.c @@ -2871,8 +2871,10 @@ rest_of_handle_sms (void) return 0; } -struct tree_opt_pass pass_sms = +struct rtl_opt_pass pass_sms = { + { + RTL_PASS, "sms", /* name */ gate_handle_sms, /* gate */ rest_of_handle_sms, /* execute */ @@ -2886,7 +2888,7 @@ struct tree_opt_pass pass_sms = TODO_dump_func, /* todo_flags_start */ TODO_df_finish | TODO_verify_rtl_sharing | TODO_dump_func | - TODO_ggc_collect, /* todo_flags_finish */ - 'm' /* letter */ + TODO_ggc_collect /* todo_flags_finish */ + } }; diff --git a/gcc/omp-low.c b/gcc/omp-low.c index 340c621d350..45602c24d74 100644 --- a/gcc/omp-low.c +++ b/gcc/omp-low.c @@ -4195,8 +4195,10 @@ gate_expand_omp_ssa (void) return flag_openmp_ssa && flag_openmp != 0 && errorcount == 0; } -struct tree_opt_pass pass_expand_omp_ssa = +struct gimple_opt_pass pass_expand_omp_ssa = { + { + GIMPLE_PASS, "ompexpssa", /* name */ gate_expand_omp_ssa, /* gate */ execute_expand_omp, /* execute */ @@ -4208,8 +4210,8 @@ struct tree_opt_pass pass_expand_omp_ssa = PROP_gimple_lomp, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - TODO_dump_func, /* todo_flags_finish */ - 0 /* letter */ + TODO_dump_func /* todo_flags_finish */ + } }; /* OMP expansion -- the default pass, run before creation of SSA form. */ @@ -4221,8 +4223,10 @@ gate_expand_omp (void) && flag_openmp != 0 && errorcount == 0); } -struct tree_opt_pass pass_expand_omp = +struct gimple_opt_pass pass_expand_omp = { + { + GIMPLE_PASS, "ompexp", /* name */ gate_expand_omp, /* gate */ execute_expand_omp, /* execute */ @@ -4234,8 +4238,8 @@ struct tree_opt_pass pass_expand_omp = PROP_gimple_lomp, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - TODO_dump_func, /* todo_flags_finish */ - 0 /* letter */ + TODO_dump_func /* todo_flags_finish */ + } }; /* Routines to lower OpenMP directives into OMP-GIMPLE. */ @@ -5081,8 +5085,10 @@ gate_lower_omp (void) return flag_openmp != 0; } -struct tree_opt_pass pass_lower_omp = +struct gimple_opt_pass pass_lower_omp = { + { + GIMPLE_PASS, "omplower", /* name */ gate_lower_omp, /* gate */ execute_lower_omp, /* execute */ @@ -5094,8 +5100,8 @@ struct tree_opt_pass pass_lower_omp = PROP_gimple_lomp, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - TODO_dump_func, /* todo_flags_finish */ - 0 /* letter */ + TODO_dump_func /* todo_flags_finish */ + } }; /* The following is a utility to diagnose OpenMP structured block violations. diff --git a/gcc/passes.c b/gcc/passes.c index 76fd58ba372..194ad78f05d 100644 --- a/gcc/passes.c +++ b/gcc/passes.c @@ -107,7 +107,7 @@ along with GCC; see the file COPYING3. If not see /* This is used for debugging. It allows the current pass to printed from anywhere in compilation. */ -struct tree_opt_pass *current_pass; +struct opt_pass *current_pass; /* Call from anywhere to find out what pass this is. Useful for printing out debugging information deep inside an service @@ -249,19 +249,19 @@ finish_optimization_passes (void) timevar_push (TV_DUMP); if (profile_arc_flag || flag_test_coverage || flag_branch_probabilities) { - dump_file = dump_begin (pass_profile.static_pass_number, NULL); + dump_file = dump_begin (pass_profile.pass.static_pass_number, NULL); end_branch_prob (); if (dump_file) - dump_end (pass_profile.static_pass_number, dump_file); + dump_end (pass_profile.pass.static_pass_number, dump_file); } if (optimize > 0) { - dump_file = dump_begin (pass_combine.static_pass_number, NULL); + dump_file = dump_begin (pass_combine.pass.static_pass_number, NULL); if (dump_file) { dump_combine_total_stats (dump_file); - dump_end (pass_combine.static_pass_number, dump_file); + dump_end (pass_combine.pass.static_pass_number, dump_file); } } @@ -287,8 +287,10 @@ gate_rest_of_compilation (void) return !(rtl_dump_and_exit || flag_syntax_only || errorcount || sorrycount); } -struct tree_opt_pass pass_rest_of_compilation = +struct gimple_opt_pass pass_rest_of_compilation = { + { + GIMPLE_PASS, NULL, /* name */ gate_rest_of_compilation, /* gate */ NULL, /* execute */ @@ -300,8 +302,8 @@ struct tree_opt_pass pass_rest_of_compilation = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - TODO_ggc_collect, /* todo_flags_finish */ - 0 /* letter */ + TODO_ggc_collect /* todo_flags_finish */ + } }; static bool @@ -310,8 +312,10 @@ gate_postreload (void) return reload_completed; } -struct tree_opt_pass pass_postreload = +struct rtl_opt_pass pass_postreload = { + { + RTL_PASS, NULL, /* name */ gate_postreload, /* gate */ NULL, /* execute */ @@ -323,21 +327,21 @@ struct tree_opt_pass pass_postreload = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - TODO_ggc_collect | TODO_verify_rtl_sharing, /* todo_flags_finish */ - 0 /* letter */ + TODO_ggc_collect | TODO_verify_rtl_sharing /* todo_flags_finish */ + } }; /* The root of the compilation pass tree, once constructed. */ -struct tree_opt_pass *all_passes, *all_ipa_passes, *all_lowering_passes; +struct opt_pass *all_passes, *all_ipa_passes, *all_lowering_passes; /* Iterate over the pass tree allocating dump file numbers. We want to do this depth first, and independent of whether the pass is enabled or not. */ static void -register_one_dump_file (struct tree_opt_pass *pass, bool ipa, int properties) +register_one_dump_file (struct opt_pass *pass, bool ipa, int properties) { char *dot_name, *flag_name, *glob_name; const char *prefix; @@ -361,13 +365,13 @@ register_one_dump_file (struct tree_opt_pass *pass, bool ipa, int properties) flag_name = concat (prefix, pass->name, num, NULL); glob_name = concat (prefix, pass->name, NULL); pass->static_pass_number = dump_register (dot_name, flag_name, glob_name, - flags, pass->letter); + flags); } /* Recursive worker function for register_dump_files. */ static int -register_dump_files_1 (struct tree_opt_pass *pass, bool ipa, int properties) +register_dump_files_1 (struct opt_pass *pass, bool ipa, int properties) { do { @@ -401,7 +405,7 @@ register_dump_files_1 (struct tree_opt_pass *pass, bool ipa, int properties) the pipeline. */ static void -register_dump_files (struct tree_opt_pass *pass, bool ipa, int properties) +register_dump_files (struct opt_pass *pass, bool ipa, int properties) { pass->properties_required |= properties; register_dump_files_1 (pass, ipa, properties); @@ -410,14 +414,14 @@ register_dump_files (struct tree_opt_pass *pass, bool ipa, int properties) /* Add a pass to the pass list. Duplicate the pass if it's already in the list. */ -static struct tree_opt_pass ** -next_pass_1 (struct tree_opt_pass **list, struct tree_opt_pass *pass) +static struct opt_pass ** +next_pass_1 (struct opt_pass **list, struct opt_pass *pass) { /* A nonzero static_pass_number indicates that the pass is already in the list. */ if (pass->static_pass_number) { - struct tree_opt_pass *new; + struct opt_pass *new; new = xmalloc (sizeof (*new)); memcpy (new, pass, sizeof (*new)); @@ -470,9 +474,9 @@ next_pass_1 (struct tree_opt_pass **list, struct tree_opt_pass *pass) void init_optimization_passes (void) { - struct tree_opt_pass **p; + struct opt_pass **p; -#define NEXT_PASS(PASS) (p = next_pass_1 (p, &PASS)) +#define NEXT_PASS(PASS) (p = next_pass_1 (p, &((PASS).pass))) /* All passes needed to lower the function into shape optimizers can operate on. These passes are always run first on the function, but @@ -500,21 +504,21 @@ init_optimization_passes (void) NEXT_PASS (pass_ipa_function_and_variable_visibility); NEXT_PASS (pass_ipa_early_inline); { - struct tree_opt_pass **p = &pass_ipa_early_inline.sub; + struct opt_pass **p = &pass_ipa_early_inline.pass.sub; NEXT_PASS (pass_early_inline); NEXT_PASS (pass_inline_parameters); NEXT_PASS (pass_rebuild_cgraph_edges); } NEXT_PASS (pass_early_local_passes); { - struct tree_opt_pass **p = &pass_early_local_passes.sub; + struct opt_pass **p = &pass_early_local_passes.pass.sub; NEXT_PASS (pass_tree_profile); NEXT_PASS (pass_cleanup_cfg); NEXT_PASS (pass_init_datastructures); NEXT_PASS (pass_expand_omp); NEXT_PASS (pass_all_early_optimizations); { - struct tree_opt_pass **p = &pass_all_early_optimizations.sub; + struct opt_pass **p = &pass_all_early_optimizations.pass.sub; NEXT_PASS (pass_referenced_vars); NEXT_PASS (pass_reset_cc_flags); NEXT_PASS (pass_build_ssa); @@ -559,7 +563,7 @@ init_optimization_passes (void) NEXT_PASS (pass_apply_inline); NEXT_PASS (pass_all_optimizations); { - struct tree_opt_pass **p = &pass_all_optimizations.sub; + struct opt_pass **p = &pass_all_optimizations.pass.sub; NEXT_PASS (pass_create_structure_vars); /* ??? pass_build_alias is a dummy pass that ensures that we execute TODO_rebuild_alias at this point even if @@ -618,7 +622,7 @@ init_optimization_passes (void) NEXT_PASS (pass_sink_code); NEXT_PASS (pass_tree_loop); { - struct tree_opt_pass **p = &pass_tree_loop.sub; + struct opt_pass **p = &pass_tree_loop.pass.sub; NEXT_PASS (pass_tree_loop_init); NEXT_PASS (pass_copy_prop); NEXT_PASS (pass_dce_loop); @@ -635,7 +639,7 @@ init_optimization_passes (void) NEXT_PASS (pass_if_conversion); NEXT_PASS (pass_vectorize); { - struct tree_opt_pass **p = &pass_vectorize.sub; + struct opt_pass **p = &pass_vectorize.pass.sub; NEXT_PASS (pass_lower_vector_ssa); NEXT_PASS (pass_dce_loop); } @@ -694,7 +698,7 @@ init_optimization_passes (void) NEXT_PASS (pass_expand); NEXT_PASS (pass_rest_of_compilation); { - struct tree_opt_pass **p = &pass_rest_of_compilation.sub; + struct opt_pass **p = &pass_rest_of_compilation.pass.sub; NEXT_PASS (pass_init_function); NEXT_PASS (pass_jump); NEXT_PASS (pass_rtl_eh); @@ -714,7 +718,7 @@ init_optimization_passes (void) efficiently. */ NEXT_PASS (pass_loop2); { - struct tree_opt_pass **p = &pass_loop2.sub; + struct opt_pass **p = &pass_loop2.pass.sub; NEXT_PASS (pass_rtl_loop_init); NEXT_PASS (pass_rtl_move_loop_invariants); NEXT_PASS (pass_rtl_unswitch); @@ -752,7 +756,7 @@ init_optimization_passes (void) NEXT_PASS (pass_subregs_of_mode_finish); NEXT_PASS (pass_postreload); { - struct tree_opt_pass **p = &pass_postreload.sub; + struct opt_pass **p = &pass_postreload.pass.sub; NEXT_PASS (pass_postreload_cse); NEXT_PASS (pass_gcse2); NEXT_PASS (pass_split_after_reload); @@ -773,7 +777,7 @@ init_optimization_passes (void) NEXT_PASS (pass_sched2); NEXT_PASS (pass_stack_regs); { - struct tree_opt_pass **p = &pass_stack_regs.sub; + struct opt_pass **p = &pass_stack_regs.pass.sub; NEXT_PASS (pass_split_before_regstack); NEXT_PASS (pass_stack_regs_run); } @@ -1065,13 +1069,13 @@ verify_curr_properties (void *data) static void update_properties_after_pass (void *data) { - struct tree_opt_pass *pass = data; + struct opt_pass *pass = data; cfun->curr_properties = (cfun->curr_properties | pass->properties_provided) & ~pass->properties_destroyed; } static bool -execute_one_pass (struct tree_opt_pass *pass) +execute_one_pass (struct opt_pass *pass) { bool initializing_dump; unsigned int todo_after = 0; @@ -1197,7 +1201,7 @@ execute_one_pass (struct tree_opt_pass *pass) } void -execute_pass_list (struct tree_opt_pass *pass) +execute_pass_list (struct opt_pass *pass) { do { @@ -1211,7 +1215,7 @@ execute_pass_list (struct tree_opt_pass *pass) /* Same as execute_pass_list but assume that subpasses of IPA passes are local passes. */ void -execute_ipa_pass_list (struct tree_opt_pass *pass) +execute_ipa_pass_list (struct opt_pass *pass) { do { diff --git a/gcc/po/ChangeLog b/gcc/po/ChangeLog index 1c450d33fed..dd5dbec7614 100644 --- a/gcc/po/ChangeLog +++ b/gcc/po/ChangeLog @@ -1,3 +1,7 @@ +2008-03-18 Joseph S. Myers <joseph@codesourcery.com> + + * nl.po: Update. + 2008-03-15 Joseph S. Myers <joseph@codesourcery.com> * zh_CN.po: Update. diff --git a/gcc/po/nl.po b/gcc/po/nl.po index 7f6b9e6b5ba..4f0199251f2 100644 --- a/gcc/po/nl.po +++ b/gcc/po/nl.po @@ -1,13 +1,14 @@ -# Dutch messages for gcc 4.1. -# Copyright (C) 1999, 2000, 2002, 2003, 2005 Free Software Foundation, Inc. -# Tim Van Holder <tim.van.holder@telenet.be>, 1999, 2000, 2002, 2003, 2005. +# Dutch messages for gcc 4.3.0. +# Copyright (C) 1999, 2000, 2002, 2003, 2005, 2008 Free Software Foundation, Inc. +# This file is distributed under the same license as the gcc package. +# Tim Van Holder <tim.van.holder@telenet.be>, 1999, 2000, 2002, 2003, 2005, 2007, 2008. # msgid "" msgstr "" -"Project-Id-Version: gcc 4.1-b20051125\n" +"Project-Id-Version: gcc 4.3.0\n" "Report-Msgid-Bugs-To: http://gcc.gnu.org/bugs.html\n" "POT-Creation-Date: 2008-03-05 17:23+0100\n" -"PO-Revision-Date: 2005-12-14 15:03+0100\n" +"PO-Revision-Date: 2008-03-18 21:16+0100\n" "Last-Translator: Tim Van Holder <tim.van.holder@telenet.be>\n" "Language-Team: Dutch <vertaling@vrijschrift.org>\n" "MIME-Version: 1.0\n" @@ -131,14 +132,12 @@ msgid "the 'a' scanf flag" msgstr "de 'a' scanf-vlag" #: c-format.c:440 -#, fuzzy msgid "'m' flag" -msgstr "' ' vlag" +msgstr "'m' vlag" #: c-format.c:440 -#, fuzzy msgid "the 'm' scanf flag" -msgstr "de 'a' scanf-vlag" +msgstr "de 'm' scanf-vlag" #: c-format.c:441 msgid "field width in scanf format" @@ -307,7 +306,6 @@ msgid "<built-in>" msgstr "<ingebouwd>" #: c-opts.c:1523 -#, fuzzy msgid "<command-line>" msgstr "<commandolijn>" @@ -431,11 +429,11 @@ msgstr "array-indexbereik in beginwaarde overschrijdt de grenzen van de array" #: c-typeck.c:5849 c-typeck.c:5872 c-typeck.c:6346 msgid "initialized field with side-effects overwritten" -msgstr "" +msgstr "geïnitialiseerd veld met neveneffecten wordt overschreven" #: c-typeck.c:5851 c-typeck.c:5874 c-typeck.c:6348 msgid "initialized field overwritten" -msgstr "" +msgstr "geïnitialiseerd veld wordt overschreven" #: c-typeck.c:6556 msgid "excess elements in char array initializer" @@ -447,7 +445,7 @@ msgstr "overtollige elementen in beginwaarde van struct" #: c-typeck.c:6624 msgid "non-static initialization of a flexible array member" -msgstr "" +msgstr "niet-statische initialisatie van flexibel array-lid" #: c-typeck.c:6692 msgid "excess elements in union initializer" @@ -499,10 +497,10 @@ msgstr "functie wordt niet als kandidaat voor inlining beschouwd" msgid "function not inlinable" msgstr "functie kan niet inline gemaakt worden" +# Betere term voor "mismatched"? #: cgraphbuild.c:101 -#, fuzzy msgid "mismatched arguments" -msgstr "geen argumenten" +msgstr "slechte combinatie van argumenten" #: collect2.c:382 gcc.c:6896 #, c-format @@ -547,22 +545,22 @@ msgstr "%d frame-tabel(len) gevonden\n" #: collect2.c:1518 #, c-format msgid "can't get program status" -msgstr "" +msgstr "kan programmastatus niet ophalen" #: collect2.c:1587 -#, fuzzy, c-format +#, c-format msgid "could not open response file %s" -msgstr "kan bestand '%s' niet openen" +msgstr "kan antwoordbestand %s niet openen" #: collect2.c:1592 -#, fuzzy, c-format +#, c-format msgid "could not write to response file %s" -msgstr "%s:kon uitvoerbestand '%s' niet openen\n" +msgstr "kan niet schrijven naar antwoordbestand %s" #: collect2.c:1597 -#, fuzzy, c-format +#, c-format msgid "could not close response file %s" -msgstr "kan bestand '%s' niet openen" +msgstr "kan antwoordbestand %s niet sluiten" #: collect2.c:1615 #, c-format @@ -577,7 +575,7 @@ msgstr "kan '%s' niet vinden" #: collect2.c:1634 collect2.c:2126 collect2.c:2281 gcc.c:2974 #, c-format msgid "pex_init failed" -msgstr "" +msgstr "pex_init mislukt" #: collect2.c:1672 #, c-format @@ -1068,9 +1066,9 @@ msgstr "kon '%s' niet uitvoeren: %s" # moet dit eigenlijk wel een vertaalbare string zijn? #. translate_options () has turned --version into -fversion. #: gcc.c:3606 -#, fuzzy, c-format +#, c-format msgid "%s %s%s\n" -msgstr "%s '%s'\n" +msgstr "%s %s%s\n" # Het copyright symbool zit in latin-1 dus lijkt me toepasselijk voor Nederlands (aangezien we ook accenten hebben). # Maar misschien toch als (C) laten? @@ -1085,6 +1083,10 @@ msgid "" "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n" "\n" msgstr "" +"Dit is vrije software; zie de broncode voor kopieercondities. Er is GEEN\n" +"garantie; zelfs niet voor VERKOOPBAARHEID of GESCHIKTHEID voor een bepaald\n" +"doel.\n" +"\n" #: gcc.c:3722 #, c-format @@ -1152,19 +1154,19 @@ msgid "spec '%s' has invalid '%%0%c'" msgstr "spec '%s' heeft een ongeldige '%%0%c'" #: gcc.c:5047 -#, fuzzy, c-format +#, c-format msgid "could not open temporary response file %s" -msgstr "kan bestand '%s' niet openen" +msgstr "kon tijdelijk antwoordbestand %s niet openen" #: gcc.c:5053 #, c-format msgid "could not write to temporary response file %s" -msgstr "" +msgstr "kon niet schrijven naar tijdelijk antwoordbestand %s" #: gcc.c:5059 -#, fuzzy, c-format +#, c-format msgid "could not close temporary response file %s" -msgstr "kan bestand '%s' niet openen" +msgstr "kon tijdelijk antwoordbestand %s niet sluiten" #: gcc.c:5093 #, c-format @@ -1262,14 +1264,14 @@ msgid "Thread model: %s\n" msgstr "" #: gcc.c:6530 -#, fuzzy, c-format +#, c-format msgid "gcc version %s %s\n" -msgstr "gcc versie %s\n" +msgstr "gcc versie %s %s\n" #: gcc.c:6532 -#, fuzzy, c-format +#, c-format msgid "gcc driver version %s %sexecuting gcc version %s\n" -msgstr "gcc stuurprogramma versie %s voert gcc versie %s uit\n" +msgstr "gcc stuurprogramma versie %s %svoert gcc versie %s uit\n" #: gcc.c:6540 #, c-format @@ -1364,12 +1366,12 @@ msgid "" msgstr "" #: gcov.c:400 -#, fuzzy, c-format +#, c-format msgid "" "Usage: gcov [OPTION]... SOURCEFILE...\n" "\n" msgstr "" -"Gebruik: gcov [OPTIE]... BRONBESTAND\n" +"Gebruik: gcov [OPTIE]... BRONBESTAND...\n" "\n" #: gcov.c:401 @@ -1448,9 +1450,9 @@ msgstr "" # moet dit eigenlijk wel een vertaalbare string zijn? #: gcov.c:425 -#, fuzzy, c-format +#, c-format msgid "gcov %s%s\n" -msgstr "gcov (GCC) %s\n" +msgstr "gcov %s%s\n" #: gcov.c:429 #, c-format @@ -1527,10 +1529,11 @@ msgstr "" msgid "%s:corrupted\n" msgstr "%s:corrupt\n" +# Niet letterlijk vertaald, maar zou de lading moeten dekken #: gcov.c:1024 -#, fuzzy, c-format +#, c-format msgid "%s:cannot open data file, assuming not executed\n" -msgstr "%s:kan gegevensbestand niet openen\n" +msgstr "%s:kan gegevensbestand niet openen; code zal niet uitgevoerd zijn\n" #: gcov.c:1031 #, c-format @@ -1687,14 +1690,12 @@ msgid "--param large-function-growth limit reached" msgstr "limiet van --param large-function-growth bereikt" #: ipa-inline.c:392 -#, fuzzy msgid "--param large-stack-frame-growth limit reached" -msgstr "limiet van --param large-function-growth bereikt" +msgstr "limiet van --param large-stack-frame-growth bereikt" #: ipa-inline.c:410 -#, fuzzy msgid "function not inline candidate" -msgstr "functie kan niet inline gemaakt worden" +msgstr "functie is geen kandidaat om inline gemaakt te worden" #: ipa-inline.c:426 msgid "--param max-inline-insns-single limit reached" @@ -1722,36 +1723,36 @@ msgstr "" #: ipa-inline.c:1013 msgid "--param inline-unit-growth limit reached" -msgstr "" +msgstr "limiet van --param inline-unit-growth bereikt" #: langhooks.c:389 msgid "At top level:" msgstr "Op bovenste niveau:" #: langhooks.c:407 -#, fuzzy, c-format +#, c-format msgid "In member function %qs" -msgstr "In memberfunctie %qs:" +msgstr "In memberfunctie %qs" #: langhooks.c:411 -#, fuzzy, c-format +#, c-format msgid "In function %qs" -msgstr "In functie %qs:" +msgstr "In functie %qs" #: langhooks.c:461 -#, fuzzy, c-format +#, c-format msgid " inlined from %qs at %s:%d:%d" -msgstr "ongeldige registernaam voor %qs" +msgstr " inline gemaakt vanuit %qs op %s:%d:%d" #: langhooks.c:467 -#, fuzzy, c-format +#, c-format msgid " inlined from %qs at %s:%d" -msgstr "%s voor %qs" +msgstr " inline gemaakt vanuit %qs op %s:%d" #: langhooks.c:473 -#, fuzzy, c-format +#, c-format msgid " inlined from %qs" -msgstr "'complex' ongeldig voor %qs" +msgstr " inline gemaakt vanuit %qs" #: loop-iv.c:2806 tree-ssa-loop-niter.c:1818 msgid "assuming that the loop is not infinite" @@ -1776,12 +1777,11 @@ msgstr "Deze optie heeft geen documentatie" #: opts.c:1161 msgid "[enabled]" -msgstr "" +msgstr "[ingeschakeld]" #: opts.c:1161 -#, fuzzy msgid "[disabled]" -msgstr "GCSE uitgeschakeld" +msgstr "[uitgeschakeld]" #: opts.c:1172 #, c-format @@ -1794,49 +1794,44 @@ msgid " All options with the desired characteristics have already been displayed msgstr "" #: opts.c:1228 -#, fuzzy msgid "The following options are target specific" -msgstr "De volgende opties zijn taalafhankelijk:\n" +msgstr "De volgende opties zijn afhankelijk van het doelsysteem" #: opts.c:1231 -#, fuzzy msgid "The following options control compiler warning messages" -msgstr "De volgende opties zijn taalafhankelijk:\n" +msgstr "De volgende opties beheren waarschuwingsboodschappen van de compiler" #: opts.c:1234 -#, fuzzy msgid "The following options control optimizations" -msgstr "lege declaratie" +msgstr "De volgende opties beheren optimalisaties" #: opts.c:1237 opts.c:1275 -#, fuzzy msgid "The following options are language-independent" -msgstr "De volgende opties zijn taalafhankelijk:\n" +msgstr "De volgende opties zijn taalafhankelijk" #: opts.c:1240 -#, fuzzy msgid "The --param option recognizes the following as parameters" -msgstr "De --param optie herkent de volgende parameters:\n" +msgstr "De --param optie herkent de volgende parameters" +# Zou een format spec moeten hebben voor de taalnaam... #: opts.c:1247 -#, fuzzy msgid "The following options are specific to the language " -msgstr "De volgende opties zijn taalafhankelijk:\n" +msgstr "De volgende opties enkel van toepassing voor de taal " +# Zou een format spec moeten hebben voor de taalnaam... +# Of beter "voor de taal "? #: opts.c:1251 -#, fuzzy msgid "The following options are supported by the language " -msgstr "De volgende opties zijn taalafhankelijk:\n" +msgstr "De volgende opties worden ondersteund door de taal " #: opts.c:1262 -#, fuzzy msgid "The following options are not documented" -msgstr "De volgende opties zijn taalafhankelijk:\n" +msgstr "De volgende opties zijn niet gedocumenteerd" +# Betere vertaling? #: opts.c:1273 -#, fuzzy msgid "The following options are language-related" -msgstr "De volgende opties zijn taalafhankelijk:\n" +msgstr "De volgende opties hebben iets met een taal te maken" #: opts.c:1405 #, c-format @@ -2236,35 +2231,33 @@ msgid "unrecoverable error" msgstr "onherstelbare fout" #: toplev.c:1180 -#, fuzzy, c-format +#, c-format msgid "" "%s%s%s %sversion %s (%s)\n" "%s\tcompiled by GNU C version %s, " msgstr "" -"%s%s%s versie %s (%s)\n" -"%s\tgecompileerd door GNU C versie %s.\n" +"%s%s%s %sversie %s (%s)\n" +"%s\tgecompileerd door GNU C versie %s, " #: toplev.c:1182 -#, fuzzy, c-format +#, c-format msgid "%s%s%s %sversion %s (%s) compiled by CC, " -msgstr "%s%s%s versie %s (%s) gecompileerd door CC.\n" +msgstr "%s%s%s %sversie %s (%s) gecompileerd door CC, " #: toplev.c:1186 -#, fuzzy, c-format +#, c-format msgid "GMP version %s, MPFR version %s.\n" -msgstr "%s:versie '%.4s', verkies versie '%.4s'\n" +msgstr "GMP versie %s, MPFR versie %s.\n" #: toplev.c:1188 -#, fuzzy, c-format +#, c-format msgid "%s%swarning: %s header version %s differs from library version %s.\n" -msgstr "" -"%s%s%s versie %s (%s)\n" -"%s\tgecompileerd door GNU C versie %s.\n" +msgstr "%s%slet op: %s headerversie %s verschilt van bibliotheekversie %s.\n" #: toplev.c:1190 #, c-format msgid "%s%sGGC heuristics: --param ggc-min-expand=%d --param ggc-min-heapsize=%d\n" -msgstr "" +msgstr "%s%sGGC heuristieken: --param ggc-min-expand=%d --param ggc-min-heapsize=%d\n" #: toplev.c:1342 msgid "options passed: " @@ -2422,9 +2415,8 @@ msgid "expense of call operation relative to ordinary arithmetic operations" msgstr "" #: params.def:217 -#, fuzzy msgid "The size of stack frame to be considered large" -msgstr "bestand %qs is te groot" +msgstr "" #: params.def:221 msgid "Maximal stack frame growth due to inlining (in percent)" @@ -2875,9 +2867,9 @@ msgid "predicated instruction in conditional sequence" msgstr "instructie met predicaat in voorwaardelijke sequentie" #: config/arm/arm.c:12686 -#, fuzzy, c-format +#, c-format msgid "invalid shift operand" -msgstr "ongeldige operand voor %%f" +msgstr "ongeldige shift-operand" #: config/arm/arm.c:12733 config/arm/arm.c:12743 config/arm/arm.c:12753 #: config/arm/arm.c:12763 config/arm/arm.c:12773 config/arm/arm.c:12812 @@ -2892,9 +2884,9 @@ msgid "invalid operand for code '%c'" msgstr "ongeldige operand voor code '%c'" #: config/arm/arm.c:12825 -#, fuzzy, c-format +#, c-format msgid "instruction never executed" -msgstr "onvoorwaardelijke tak %2d werd nooit uitgevoerd\n" +msgstr "instructie wordt nooit uitgevoerd" #: config/arm/arm.c:13037 #, c-format @@ -3359,15 +3351,15 @@ msgid "invalid Z register replacement for insn" msgstr "ongeldige Z-register vervanging voor insn" #: config/mips/mips.c:6371 config/mips/mips.c:6392 config/mips/mips.c:6496 -#, fuzzy, c-format +#, c-format msgid "'%%%c' is not a valid operand prefix" -msgstr "-fPIC is niet geldig met -mcoff" +msgstr "'%%%c' is geen geldige operand-prefix" #: config/mips/mips.c:6440 config/mips/mips.c:6447 config/mips/mips.c:6454 #: config/mips/mips.c:6514 -#, fuzzy, c-format +#, c-format msgid "invalid use of '%%%c'" -msgstr "ongeldig gebruik van %<restrict%>" +msgstr "ongeldig gebruik van '%%%c'" #: config/mips/mips.c:6761 msgid "mips_debugger_offset called with non stack/frame/arg pointer" @@ -3517,9 +3509,9 @@ msgstr "" #: config/score/score3.c:1262 config/score/score3.c:1282 #: config/score/score7.c:1253 -#, fuzzy, c-format +#, c-format msgid "invalid operand for code: '%c'" -msgstr "ongeldige operand voor code '%c'" +msgstr "ongeldige operand voor code: '%c'" #: config/sh/sh.c:749 #, c-format @@ -3713,9 +3705,8 @@ msgstr "" # Is 'elementair' wel een goede vertaling voor 'elemental'? #: fortran/arith.c:1472 -#, fuzzy msgid "elemental binary operation" -msgstr "Elementaire binaire operatie" +msgstr "elementaire binaire operatie" #: fortran/arith.c:2044 #, no-c-format @@ -3972,9 +3963,9 @@ msgid "'%s' argument of '%s' intrinsic at %L must be a POINTER" msgstr "" #: fortran/check.c:621 -#, fuzzy, no-c-format +#, no-c-format msgid "'%s' argument of '%s' intrinsic at %L must be a pointer or target VARIABLE or FUNCTION" -msgstr "'%s' argument voor intrinsic '%s' op %L moet een constante zijn" +msgstr "" #: fortran/check.c:629 #, no-c-format @@ -4014,9 +4005,9 @@ msgid "Different shape for arguments '%s' and '%s' at %L for intrinsic 'dot_prod msgstr "" #: fortran/check.c:992 fortran/check.c:1000 -#, fuzzy, no-c-format +#, no-c-format msgid "'%s' argument of '%s' intrinsic at %L must be default real" -msgstr "'%s' argument voor intrinsic '%s' op %L moet een array zijn" +msgstr "" #: fortran/check.c:1250 #, no-c-format @@ -4048,11 +4039,10 @@ msgstr "" msgid "Fortran 2003: '%s' intrinsic with CHARACTER argument at %L" msgstr "" -# vertaling voor 'intrinsic'? 'intrinsiek(e) xxx', maar wat als xxx te gebruiken? #: fortran/check.c:1656 -#, fuzzy, no-c-format +#, no-c-format msgid "'a1' argument of '%s' intrinsic at %L must be INTEGER, REAL or CHARACTER" -msgstr "'%s' argument voor intrinsic '%s' op %L moet %s zijn" +msgstr "" #: fortran/check.c:1728 #, no-c-format @@ -4213,7 +4203,7 @@ msgstr "" #: fortran/decl.c:390 #, fuzzy, no-c-format msgid "Invalid initializer %s in Data statement at %C" -msgstr "ongeldige lvalue in asm-statement" +msgstr "%s voor %qs" #: fortran/decl.c:493 #, no-c-format @@ -5002,7 +4992,7 @@ msgstr "" #: fortran/decl.c:5799 #, fuzzy, no-c-format msgid "Initializing already initialized variable at %C" -msgstr "array krijgt niet-constante array-expressie als beginwaarde" +msgstr "Initialisatie op %C is niet voor een pointervariable" #: fortran/decl.c:5844 #, no-c-format @@ -6671,9 +6661,9 @@ msgid "Type mismatch in argument '%s' at %L; passed %s to %s" msgstr "meerdere parameters hebben de naam %qs" #: fortran/interface.c:1492 fortran/interface.c:1532 -#, no-c-format +#, fuzzy, no-c-format msgid "Rank mismatch in argument '%s' at %L (%d and %d)" -msgstr "" +msgstr "Te veel argumenten voor %s op %L" #: fortran/interface.c:1519 #, fuzzy, no-c-format @@ -6681,9 +6671,9 @@ msgid "Fortran 2003: Scalar CHARACTER actual argument with array dummy argument msgstr "doorgeven van argument %d van %qs" #: fortran/interface.c:1544 -#, no-c-format +#, fuzzy, no-c-format msgid "Element of assumed-shaped array passed to dummy argument '%s' at %L" -msgstr "" +msgstr "Te veel argumenten voor %s op %L" #: fortran/interface.c:1861 #, no-c-format @@ -6711,14 +6701,14 @@ msgid "Unexpected alternate return spec in subroutine call at %L" msgstr "" #: fortran/interface.c:1922 -#, no-c-format +#, fuzzy, no-c-format msgid "Character length mismatch (%ld/%ld) between actual argument and pointer or allocatable dummy argument '%s' at %L" -msgstr "" +msgstr "doorgeven van argument %d van %qs" #: fortran/interface.c:1929 -#, no-c-format +#, fuzzy, no-c-format msgid "Character length mismatch (%ld/%ld) between actual argument and assumed-shape dummy argument '%s' at %L" -msgstr "" +msgstr "doorgeven van argument %d van %qs" #: fortran/interface.c:1943 #, fuzzy, no-c-format @@ -8583,9 +8573,9 @@ msgid "Integer too big for integer kind %i at %C" msgstr "" #: fortran/primary.c:429 -#, no-c-format +#, fuzzy, no-c-format msgid "Fortran 2003: BOZ used outside a DATA statement at %C" -msgstr "" +msgstr "%s voor %qs" #: fortran/primary.c:529 #, no-c-format @@ -8757,10 +8747,11 @@ msgstr "%s van alleen-lezen variabele %qs" msgid "Named constant at %C in an EQUIVALENCE" msgstr "" +# dit klinkt niet al te best #: fortran/primary.c:2579 #, fuzzy, no-c-format msgid "'%s' at %C is not a variable" -msgstr "-fPIC is niet geldig met -mcoff" +msgstr "functie-oproep heeft geaggregeerde waarde" #: fortran/resolve.c:121 #, no-c-format @@ -8808,9 +8799,9 @@ msgid "Argument '%s' of elemental procedure at %L cannot have the POINTER attrib msgstr "" #: fortran/resolve.c:231 -#, no-c-format +#, fuzzy, no-c-format msgid "Dummy procedure '%s' not allowed in elemental procedure '%s' at %L" -msgstr "" +msgstr "overflow in constante expressie" #: fortran/resolve.c:243 #, no-c-format @@ -12079,20 +12070,17 @@ msgstr "" msgid "Change the number of temporary registers that are available to conditionally-executed sequences" msgstr "" -# of "preprocessing" behouden? #: config/frv/frv.opt:58 -#, fuzzy msgid "Enable conditional moves" -msgstr "Schakel traditionele voorverwerking in" +msgstr "" #: config/frv/frv.opt:62 msgid "Set the target CPU type" msgstr "" #: config/frv/frv.opt:84 -#, fuzzy msgid "Use fp double instructions" -msgstr "ongeldig gebruik van %<restrict%>" +msgstr "" #: config/frv/frv.opt:88 msgid "Change the ABI to allow double word insns" @@ -12131,11 +12119,9 @@ msgstr "" msgid "Use hardware floating point" msgstr "" -# "sentinel" hoe vertalen? "schildwacht" lijkt niet echt van toepassing... #: config/frv/frv.opt:124 config/bfin/bfin.opt:77 -#, fuzzy msgid "Enable inlining of PLT in function calls" -msgstr "sentinel ontbreekt in functie-oproep" +msgstr "" #: config/frv/frv.opt:128 msgid "Enable PIC support for building libraries" @@ -12146,29 +12132,24 @@ msgid "Follow the EABI linkage requirements" msgstr "" #: config/frv/frv.opt:136 -#, fuzzy msgid "Disallow direct calls to global functions" -msgstr "Genereer directe aftakkingen naar locale functies" +msgstr "Verbied rechtstreekse oproepen van globale functies" #: config/frv/frv.opt:140 -#, fuzzy msgid "Use media instructions" -msgstr "ongeldig gebruik van %<restrict%>" +msgstr "" #: config/frv/frv.opt:144 -#, fuzzy msgid "Use multiply add/subtract instructions" -msgstr "ongeldig gebruik van %<restrict%>" +msgstr "" #: config/frv/frv.opt:148 -#, fuzzy msgid "Enable optimizing &&/|| in conditional execution" -msgstr "types in voorwaardelijke expressie komen niet overeen" +msgstr "" #: config/frv/frv.opt:152 -#, fuzzy msgid "Enable nested conditional execution optimizations" -msgstr "lege declaratie" +msgstr "" #: config/frv/frv.opt:157 msgid "Do not mark ABI switches in e_flags" @@ -12179,9 +12160,8 @@ msgid "Remove redundant membars" msgstr "" #: config/frv/frv.opt:165 -#, fuzzy msgid "Pack VLIW instructions" -msgstr "ongeldig gebruik van %<restrict%>" +msgstr "" #: config/frv/frv.opt:169 msgid "Enable setting GPRs to the result of comparisons" @@ -12260,24 +12240,20 @@ msgid "Align some doubles on dword boundary" msgstr "" #: config/i386/i386.opt:43 -#, fuzzy msgid "Function starts are aligned to this power of 2" -msgstr "gevraagd alignment is geen macht van 2" +msgstr "Startadressen van functies worden uiteglijnd op deze macht van 2" #: config/i386/i386.opt:47 -#, fuzzy msgid "Jump targets are aligned to this power of 2" -msgstr "gevraagd alignment is geen macht van 2" +msgstr "Doeladressen van jumps worden uiteglijnd op deze macht van 2" #: config/i386/i386.opt:51 -#, fuzzy msgid "Loop code aligned to this power of 2" -msgstr "gevraagd alignment is geen macht van 2" +msgstr "Luscode wordt uiteglijnd op deze macht van 2" #: config/i386/i386.opt:55 -#, fuzzy msgid "Align destination of the string operations" -msgstr "ISO C staat het testen van asserties niet toe" +msgstr "" #: config/i386/i386.opt:59 config/spu/spu.opt:60 config/s390/s390.opt:31 msgid "Generate code for given CPU" @@ -12352,9 +12328,8 @@ msgid "Number of registers used to pass integer arguments" msgstr "" #: config/i386/i386.opt:151 -#, fuzzy msgid "Alternate calling convention" -msgstr "Onbeëindigde stringconstante" +msgstr "" #: config/i386/i386.opt:159 msgid "Use SSE register passing conventions for SF and DF mode" @@ -16973,14 +16948,14 @@ msgid "non-floating-point argument to function %qs" msgstr "niet-floating-point argument voor functie %qs" #: builtins.c:10446 builtins.c:10466 -#, gcc-internal-format +#, fuzzy, gcc-internal-format msgid "too few arguments to function %qs" -msgstr "te weinig argumenten voor functie %qs" +msgstr "te weinig argumenten voor functie %qE" #: builtins.c:10452 builtins.c:10472 -#, gcc-internal-format +#, fuzzy, gcc-internal-format msgid "too many arguments to function %qs" -msgstr "te veel argumenten voor functie %qs" +msgstr "te veel argumenten voor functie %qE" #: builtins.c:11377 #, gcc-internal-format @@ -20184,7 +20159,7 @@ msgstr "ISO C90 verbiedt labeldeclaraties" #: c-parser.c:3550 #, fuzzy, gcc-internal-format msgid "%Hexpected %<}%> before %<else%>" -msgstr "%<__thread%> vóór %<extern%> gebruikt" +msgstr "ongeldige operand van %s" #: c-parser.c:3555 #, gcc-internal-format @@ -28133,9 +28108,9 @@ msgstr "het %qs attribuut heeft enkel betekenis voor functies" #. A template type parameter or other dependent type. #: cp/decl.c:3929 -#, gcc-internal-format +#, fuzzy, gcc-internal-format msgid "ignoring attributes applied to dependent type %qT without an associated declaration" -msgstr "" +msgstr "het %qs attribuut heeft enkel betekenis voor functies" #: cp/decl.c:4007 #, fuzzy, gcc-internal-format @@ -28358,9 +28333,9 @@ msgid "%qD cannot be initialized by a non-constant expression when being declare msgstr "overflow in constante expressie" #: cp/decl.c:5597 -#, gcc-internal-format +#, fuzzy, gcc-internal-format msgid "non-static data member %qD has Java class type" -msgstr "" +msgstr "%qs is geen static veld" #: cp/decl.c:6232 #, gcc-internal-format @@ -30658,7 +30633,7 @@ msgstr "%qs neemt ofwel geen, ofwel twee argumenten" #: cp/parser.c:9422 #, fuzzy, gcc-internal-format msgid "template parameter pack cannot have a default argument" -msgstr "niet-beëindigde parameterlijst in %<#define%>" +msgstr "%qs neemt ofwel geen, ofwel twee argumenten" #: cp/parser.c:9520 cp/parser.c:9621 #, fuzzy, gcc-internal-format @@ -33770,578 +33745,3 @@ msgstr "Adres van registervariabele %qD gevraagd." #, gcc-internal-format msgid "%qD attribute ignored" msgstr "het %qD attribuut wordt genegeerd" - -# moet dit eigenlijk wel een vertaalbare string zijn? -#~ msgid "%s (GCC) %s\n" -#~ msgstr "%s (GCC) %s\n" - -#~ msgid "syntax error: cannot back up" -#~ msgstr "syntaxfout: kan niet terugkeren" - -#~ msgid "memory exhausted" -#~ msgstr "geheugen opgebruikt" - -#~ msgid "syntax error, unexpected %s" -#~ msgstr "syntaxfout, %s onverwacht" - -#~ msgid "syntax error, unexpected %s, expecting %s" -#~ msgstr "syntaxfout, %s onverwacht, %s verwacht" - -#~ msgid "syntax error, unexpected %s, expecting %s or %s" -#~ msgstr "syntaxfout, %s onverwacht, %s of %s verwacht" - -#~ msgid "syntax error, unexpected %s, expecting %s or %s or %s" -#~ msgstr "syntaxfout, %s onverwacht, %s of %s of %s verwacht" - -#~ msgid "syntax error, unexpected %s, expecting %s or %s or %s or %s" -#~ msgstr "syntaxfout, %s onverwacht, %s of %s of %s of %s verwacht" - -#~ msgid "syntax error" -#~ msgstr "syntaxfout" - -#~ msgid "call is unlikely" -#~ msgstr "oproep is onwaarschijnlijk" - -#~ msgid "c4x_address_cost: Invalid addressing mode" -#~ msgstr "c4x_address_cost: Ongeldige adresseringsmodus" - -#~ msgid "invalid indirect memory address" -#~ msgstr "ongeldig indirect geheugenadres" - -#~ msgid "invalid indirect (S) memory address" -#~ msgstr "ongeldig indirect (S) geheugenadres" - -# klinkt niet -#~ msgid "c4x_operand_subword: address not offsettable" -#~ msgstr "c4x_operand_subword: adres kan niet geoffset worden" - -#~ msgid "invalid %%Y value" -#~ msgstr "ongeldige waarde voor %%Y" - -#~ msgid "invalid %%C operand" -#~ msgstr "ongeldige operand voor %%C" - -#~ msgid "invalid %%D operand" -#~ msgstr "ongeldige operand voor %%D" - -#~ msgid "Arithmetic overflow converting %s to %s at %L" -#~ msgstr "Arithmetische overflow bij conversie van %s naar %s op %L" - -#, fuzzy -#~ msgid "In file %s:%d\n" -#~ msgstr "In functie %qs:" - -#, fuzzy -#~ msgid "Period required" -#~ msgstr "overflow in constante expressie" - -#, fuzzy -#~ msgid "REC tag at %L is incompatible with END tag" -#~ msgstr "case-selector niet compatibel met label" - -#, fuzzy -#~ msgid "storage size not known" -#~ msgstr "opslaggrootte van %qs is onbekend" - -#, fuzzy -#~ msgid "storage size not constant" -#~ msgstr "opslaggrootte van %qs is niet constant" - -#, fuzzy -#~ msgid "Processing %s\n" -#~ msgstr "#error %s" - -#, fuzzy -#~ msgid "%s: error: " -#~ msgstr "parse-fout" - -# Dit zou misschien beter 'warning' blijven -#, fuzzy -#~ msgid "%s: warning: " -#~ msgstr "let op: " - -#, fuzzy -#~ msgid "Missing term" -#~ msgstr "beginwaarde ontbreekt" - -#~ msgid "parse error" -#~ msgstr "parse-fout" - -#~ msgid "syntax error; also virtual memory exhausted" -#~ msgstr "syntaxfout; ook is het virtueel geheugen opgebruikt" - -#~ msgid "parse error; also virtual memory exhausted" -#~ msgstr "parse-fout; ook is het virtueel geheugen opgebruikt" - -#~ msgid "parse error: cannot back up" -#~ msgstr "parse-fout: kan niet terugkeren" - -#, fuzzy -#~ msgid "Missing name" -#~ msgstr "beginwaarde ontbreekt" - -#, fuzzy -#~ msgid "Missing variable initializer" -#~ msgstr "beginwaarde ontbreekt" - -#, fuzzy -#~ msgid "Invalid declaration" -#~ msgstr "lege declaratie" - -#, fuzzy -#~ msgid "Unbalanced ']'" -#~ msgstr "niet-gebalanceerde %<#endif%>" - -#, fuzzy -#~ msgid "Missing formal parameter term" -#~ msgstr "parameternaam ontbreekt uit parameterlijst" - -#, fuzzy -#~ msgid "Missing identifier" -#~ msgstr "beginwaarde ontbreekt" - -#, fuzzy -#~ msgid "Invalid interface type" -#~ msgstr "Ongeldig register voor vergelijking" - -#, fuzzy -#~ msgid "Invalid expression statement" -#~ msgstr "ongeldige expressie als operand" - -#, fuzzy -#~ msgid "Missing or invalid constant expression" -#~ msgstr "overflow in constante expressie" - -#, fuzzy -#~ msgid "Invalid update expression" -#~ msgstr "Ongeldig token in expressie" - -#, fuzzy -#~ msgid "']' expected, invalid type expression" -#~ msgstr "ongeldige waarheidsexpressie" - -#, fuzzy -#~ msgid "Generate code for CPU" -#~ msgstr "case-label niet in een switch-statement" - -#~ msgid "Emit code compatible with TI tools" -#~ msgstr "Genereer code die compatibel is met de TI tools" - -#, fuzzy -#~ msgid "Warn about possibly confusing type conversions" -#~ msgstr "accolades ontbreken rond beginwaarde" - -#, fuzzy -#~ msgid "Make implicit function declarations an error" -#~ msgstr "parameternamen (zonder types) in functiedeclaratie" - -#, fuzzy -#~ msgid "Make string literals \"const char[]\" not \"char[]\"" -#~ msgstr "slechte stringconstante" - -#, fuzzy -#~ msgid "Copy memory address constants into registers before use" -#~ msgstr "numerieke constante zonder cijfers" - -#~ msgid "second argument to %<__builtin_expect%> must be a constant" -#~ msgstr "tweede argument voor %<__builtin_expect%> moet een constante zijn" - -#~ msgid "%<va_start%> used with too many arguments" -#~ msgstr "%<va_start%> gebruikt met te veel argumenten" - -#~ msgid "invalid truth-value expression" -#~ msgstr "ongeldige waarheidsexpressie" - -#~ msgid "invalid lvalue in increment" -#~ msgstr "ongeldige lvalue in verhoging" - -#~ msgid "invalid lvalue in decrement" -#~ msgstr "ongeldige lvalue in verlaging" - -#~ msgid "invalid lvalue in unary %<&%>" -#~ msgstr "ongeldige lvalue bij unaire %<&%>" - -#~ msgid "GCC does not yet properly implement %<[*]%> array declarators" -#~ msgstr "GCC heeft nog geen fatsoenlijke implementatie van %<[*]%> declaratoren van arrays" - -#, fuzzy -#~ msgid "static or type qualifiers in abstract declarator" -#~ msgstr "%<static%> of type-kwalificatie in abstracte declarator" - -#~ msgid "thread-local storage not supported for this target" -#~ msgstr "thread-local opslag wordt niet ondersteund voor dit doelsysteem" - -#~ msgid "this function may return with or without a value" -#~ msgstr "deze functie kan met of zonder waarde tergukeren" - -#, fuzzy -#~ msgid "junk at end of #pragma weak" -#~ msgstr "misvormde #pragma weak" - -#~ msgid "internal error" -#~ msgstr "interne fout" - -#, fuzzy -#~ msgid "malformed '#pragma %s' - ignored" -#~ msgstr "misvormde #pragma pack" - -#, fuzzy -#~ msgid "code model %<large%> not supported yet" -#~ msgstr "afrondingsmodus niet ondersteund voor VAX-floats" - -#, fuzzy -#~ msgid "-fpic is not supported; -fPIC assumed" -#~ msgstr "-pipe wordt niet ondersteund" - -#, fuzzy -#~ msgid "constant arithmetic operand out of range" -#~ msgstr "te veel argumenten voor procedure `%s'" - -#, fuzzy -#~ msgid "passing %qT for argument %P to %qD" -#~ msgstr "doorgeven van argument %d van %qs" - -#, fuzzy -#~ msgid "%q+#D previously declared here" -#~ msgstr "%qs tevoren hier gedeclareerd" - -#, fuzzy -#~ msgid "no type named %q#T in %q#T" -#~ msgstr "het type van de teruggeefwaarde van %qs is niet %<int%>" - -#, fuzzy -#~ msgid "cannot initialize %qD to namespace %qD" -#~ msgstr "niet-constante beginwaarde voor %qs" - -#, fuzzy -#~ msgid "operator %qT declared to return %qT" -#~ msgstr "parameter %qs als void gedeclareerd" - -#, fuzzy -#~ msgid "long or short specified with floating type for %qs" -#~ msgstr "'long' of 'short' opgegeven bij floating-point type voor %qs" - -#, fuzzy -#~ msgid "constructors may not be cv-qualified" -#~ msgstr "structure heeft geen lid dat %qs heet" - -#, fuzzy -#~ msgid "enumerator value for %qD not integer constant" -#~ msgstr "enumeratiewaarde voor %qs is geen integrale constante" - -#, fuzzy -#~ msgid "invalid use of %<virtual%> in template declaration of %q#D" -#~ msgstr "ongeldig gebruik van onvolledige typedef %qs" - -#, fuzzy -#~ msgid "%qD is not a member of type %qT" -#~ msgstr "%qs is geen bestand, pipe of tty" - -#, fuzzy -#~ msgid "%<%D::%D%> is not a template" -#~ msgstr "%qs is geen iterator" - -#, fuzzy -#~ msgid "%qD undeclared in namespace %qD" -#~ msgstr "ongeldige naam %qs" - -#, fuzzy -#~ msgid "duplicate %<friend%>" -#~ msgstr "herhaalde %qs" - -#, fuzzy -#~ msgid "invalid function declaration" -#~ msgstr "lege declaratie" - -#, fuzzy -#~ msgid "%qD does not declare a template type" -#~ msgstr "%qs is geen iterator" - -#, fuzzy -#~ msgid "used %d template parameter(s) instead of %d" -#~ msgstr "meerdere parameters hebben de naam %qs" - -#, fuzzy -#~ msgid "division by zero in %<%E / 0%>" -#~ msgstr "deling door nul in %<#if%>" - -#, fuzzy -#~ msgid "division by zero in %<%E / 0.%>" -#~ msgstr "deling door nul in %<#if%>" - -#, fuzzy -#~ msgid "division by zero in %<%E %% 0%>" -#~ msgstr "deling door nul in %<#if%>" - -#, fuzzy -#~ msgid "division by zero in %<%E %% 0.%>" -#~ msgstr "deling door nul in %<#if%>" - -#, fuzzy -#~ msgid "invalid use of %<--%> on bool variable %qD" -#~ msgstr "ongeldig gebruik van array die geen lvalue is" - -#, fuzzy -#~ msgid "ISO C++ forbids assignment of arrays" -#~ msgstr "ISO C++ verbiedt array %qs met lengte 0" - -#, fuzzy -#~ msgid "pointer to member cast via virtual base %qT" -#~ msgstr "pointer naar een lid gebruikt in rekensom" - -#, fuzzy -#~ msgid "unused parameter %qs" -#~ msgstr "ongeldige macronaam %<%.*s%>" - -#, fuzzy -#~ msgid "unused variable %qs" -#~ msgstr "%s van alleen-lezen variabele %qs" - -#, fuzzy -#~ msgid "variable %qD may not have been initialized" -#~ msgstr "object van variabele lengte mag geen beginwaarde krijgen" - -#, fuzzy -#~ msgid "%Jfinal field %qD may not have been initialized" -#~ msgstr "object van variabele lengte mag geen beginwaarde krijgen" - -#, fuzzy -#~ msgid "declaration of %qs shadows a parameter" -#~ msgstr "de declaratie van %qs verbergt een parameter" - -#, fuzzy -#~ msgid "declaration of %qs shadows a symbol from the parameter list" -#~ msgstr "de declaratie van %qs verbergt een symbool uit de parameterlijst" - -#, fuzzy -#~ msgid "assignment to final static field %q+D not in class initializer" -#~ msgstr "toekenning aan final-veld %qs niet in constructor" - -#, fuzzy -#~ msgid "assignment to final field %q+D not in constructor" -#~ msgstr "toekenning aan final-veld %qs niet in constructor" - -#, fuzzy -#~ msgid "couldn't find class %s" -#~ msgstr "kan %s niet vinden" - -#, fuzzy -#~ msgid "unparseable signature: '%s'" -#~ msgstr "kan bestand '%s' niet stat'en" - -#, fuzzy -#~ msgid "Not a valid Java .class file." -#~ msgstr "ongeldige basisklasse" - -#, fuzzy -#~ msgid "error in constant pool entry #%d" -#~ msgstr "constant object wordt beschreven (argument %d)" - -#, fuzzy -#~ msgid "class is of array type\n" -#~ msgstr "cast geeft array-type op" - -#, fuzzy -#~ msgid "base class is of array type" -#~ msgstr "cast geeft array-type op" - -#, fuzzy -#~ msgid "no classes specified" -#~ msgstr "Bestandsnaam voor uitvoer twee keer opgegeven" - -#~ msgid "'-MG' option is unimplemented" -#~ msgstr "de '-MG' optie is niet geïmplementeerd" - -#, fuzzy -#~ msgid "can't specify both -o and -MD" -#~ msgstr "-EB en -EL mogen niet samen gebruikt worden" - -#~ msgid "%s: no such class" -#~ msgstr "%s: geen class met die naam" - -#, fuzzy -#~ msgid "can't reopen %s: %m" -#~ msgstr "open %s" - -#, fuzzy -#~ msgid "can't close %s: %m" -#~ msgstr "close %s" - -#, fuzzy -#~ msgid "field initializer type mismatch" -#~ msgstr "ongeldige beginwaarde voor bit-string" - -#, fuzzy -#~ msgid "can't create directory %s: %m" -#~ msgstr "dubbele folder %qs wordt genegeerd\n" - -#, fuzzy -#~ msgid "can't open %s for writing: %m" -#~ msgstr "open %s" - -#, fuzzy -#~ msgid "can't create %s: %m" -#~ msgstr "open %s" - -#, fuzzy -#~ msgid "can't open output file '%s'" -#~ msgstr "kan bestand '%s' niet openen" - -#, fuzzy -#~ msgid "file not found '%s'" -#~ msgstr "kan %s niet vinden" - -#, fuzzy -#~ msgid "internal error - bad unget" -#~ msgstr "formaatstring niet beëindigd" - -#, fuzzy -#~ msgid "Modifier %qs declared twice" -#~ msgstr "veld %qs als een functie gedeclareerd" - -#, fuzzy -#~ msgid "Unreachable statement" -#~ msgstr "ongeldige beginwaarde" - -#, fuzzy -#~ msgid "%s: recursive invocation of constructor %qs" -#~ msgstr "herdefinitie van %<struct %s%>" - -#, fuzzy -#~ msgid "Type %qs not found in declaration of field %qs" -#~ msgstr "type krijgt standaardwaarde %<int%> in de declaratie van %qs" - -#, fuzzy -#~ msgid "Duplicate %s declaration %qs" -#~ msgstr "herhaalde label-declaratie %qs" - -#, fuzzy -#~ msgid "Undefined variable %qs" -#~ msgstr "ongeldige operand van %s" - -#, fuzzy -#~ msgid "No variable %qs defined in class %qs" -#~ msgstr "kan klasse '%s' niet vinden" - -#, fuzzy -#~ msgid "Undefined variable or class name: %qs" -#~ msgstr "[kan %s niet vinden]" - -#, fuzzy -#~ msgid "Class %qs not found in type declaration" -#~ msgstr "geen eerdere declaratie voor %qs" - -#, fuzzy -#~ msgid "Constant expression required" -#~ msgstr "overflow in constante expressie" - -#, fuzzy -#~ msgid "Incompatible type for case. Can't convert %qs to %<int%>" -#~ msgstr "incompatibel type voor argument %d van %qs" - -#, fuzzy -#~ msgid "Duplicate case label: %<default%>" -#~ msgstr "herhaalde case-waarde" - -# 'whitespace' -> 'witruimte'? -#, fuzzy -#~ msgid "missing static field %qs" -#~ msgstr "ontbrekende witruimte na getal %qs" - -#, fuzzy -#~ msgid "not a static field %qs" -#~ msgstr "%qs is geen static veld" - -#, fuzzy -#~ msgid "Incompatible type for %s. Can't convert %qs to %qs" -#~ msgstr "incompatibel type voor argument %d van %qs" - -#, fuzzy -#~ msgid "unregistered operator %s" -#~ msgstr "registernaam niet opgegeven voor %qs" - -# Is the %s the argument, or is it 'of' the argument? -#, fuzzy -#~ msgid "Invalid argument %qs for %<instanceof%>" -#~ msgstr "ongeldig type-argument %qs" - -#, fuzzy -#~ msgid "Incompatible type for %qs. Can't convert %qs to %qs" -#~ msgstr "incompatibel type voor argument %d van %qs" - -# Is the %s the argument, or is it 'of' the argument? -#, fuzzy -#~ msgid "Invalid argument type %qs to %qs" -#~ msgstr "ongeldig type-argument %qs" - -#, fuzzy -#~ msgid "Incompatible type for %<[]%>. Can't convert %qs to %<int%>" -#~ msgstr "incompatibel type voor argument %d van %qs" - -#, fuzzy -#~ msgid "Incompatible type for array. %s convert %qs to %qs" -#~ msgstr "incompatibel type voor argument %d van %qs" - -#, fuzzy -#~ msgid "%<return%> inside instance initializer" -#~ msgstr "leeg indexbereik in beginwaarde" - -#, fuzzy -#~ msgid "%<return%> inside static initializer" -#~ msgstr "leeg indexbereik in beginwaarde" - -#, fuzzy -#~ msgid "Declaration of %qs shadows a previous label declaration" -#~ msgstr "de declaratie van %qs verbergt een parameter" - -#, fuzzy -#~ msgid "This is the location of the previous declaration of label %qs" -#~ msgstr "dit is een eerdere declaratie" - -#, fuzzy -#~ msgid "No label definition found for %qs" -#~ msgstr "label niet in een CASE-statement" - -#, fuzzy -#~ msgid "%<continue%> must be in loop" -#~ msgstr "continue-statement niet in een lus" - -#, fuzzy -#~ msgid "continue label %qs does not name a loop" -#~ msgstr "continue-statement niet in een lus" - -#, fuzzy -#~ msgid "%<break%> must be in loop or switch" -#~ msgstr "break-statement niet in een lus of switch" - -#, fuzzy -#~ msgid "duplicate case label: %<" -#~ msgstr "herhaald label %qs" - -#, fuzzy -#~ msgid "Exception %qs can't be thrown in initializer" -#~ msgstr "leeg indexbereik in beginwaarde" - -#, fuzzy -#~ msgid "Incompatible type for %<?:%>. Can't convert %qs to %qs" -#~ msgstr "incompatibel type voor argument %d van %qs" - -#, fuzzy -#~ msgid "Constructor can't be %s" -#~ msgstr "structure heeft geen lid dat %qs heet" - -#, fuzzy -#~ msgid "Discouraged redundant use of %qs modifier in declaration of %s" -#~ msgstr "meerdere opslagklassen in declaratie van %qs" - -#, fuzzy -#~ msgid "Incompatible type for %qs. Can't convert %qs to boolean" -#~ msgstr "incompatibel type voor argument %d van %qs" - -#, fuzzy -#~ msgid "Incompatible type for %qs. Can't convert %qs to integral" -#~ msgstr "incompatibel type voor argument %d van onrechtstreekse functie-oproep" - -#, fuzzy -#~ msgid "Variable %qs may not have been initialized" -#~ msgstr "object van variabele lengte mag geen beginwaarde krijgen" diff --git a/gcc/postreload-gcse.c b/gcc/postreload-gcse.c index 805608dc5fa..ef78fde2179 100644 --- a/gcc/postreload-gcse.c +++ b/gcc/postreload-gcse.c @@ -1318,8 +1318,10 @@ rest_of_handle_gcse2 (void) return 0; } -struct tree_opt_pass pass_gcse2 = +struct rtl_opt_pass pass_gcse2 = { + { + RTL_PASS, "gcse2", /* name */ gate_handle_gcse2, /* gate */ rest_of_handle_gcse2, /* execute */ @@ -1332,7 +1334,7 @@ struct tree_opt_pass pass_gcse2 = 0, /* properties_destroyed */ 0, /* todo_flags_start */ TODO_dump_func | TODO_verify_rtl_sharing - | TODO_verify_flow | TODO_ggc_collect,/* todo_flags_finish */ - 'J' /* letter */ + | TODO_verify_flow | TODO_ggc_collect /* todo_flags_finish */ + } }; diff --git a/gcc/postreload.c b/gcc/postreload.c index 674160b0954..7e40728e876 100644 --- a/gcc/postreload.c +++ b/gcc/postreload.c @@ -1585,8 +1585,10 @@ rest_of_handle_postreload (void) return 0; } -struct tree_opt_pass pass_postreload_cse = +struct rtl_opt_pass pass_postreload_cse = { + { + RTL_PASS, "postreload", /* name */ gate_handle_postreload, /* gate */ rest_of_handle_postreload, /* execute */ @@ -1599,7 +1601,7 @@ struct tree_opt_pass pass_postreload_cse = 0, /* properties_destroyed */ 0, /* todo_flags_start */ TODO_df_finish | TODO_verify_rtl_sharing | - TODO_dump_func, /* todo_flags_finish */ - 'o' /* letter */ + TODO_dump_func /* todo_flags_finish */ + } }; diff --git a/gcc/predict.c b/gcc/predict.c index cedb3d54818..41743331b9e 100644 --- a/gcc/predict.c +++ b/gcc/predict.c @@ -1293,10 +1293,11 @@ tree_bb_level_predictions (void) { block_stmt_iterator bsi = bsi_last (bb); - for (bsi = bsi_start (bb); !bsi_end_p (bsi); bsi_next (&bsi)) + for (bsi = bsi_start (bb); !bsi_end_p (bsi);) { tree stmt = bsi_stmt (bsi); tree decl; + bool next = false; switch (TREE_CODE (stmt)) { @@ -1319,9 +1320,17 @@ call_expr:; predict_paths_leading_to (bb, PRED_COLD_FUNCTION, NOT_TAKEN); break; + case PREDICT_EXPR: + predict_paths_leading_to (bb, PREDICT_EXPR_PREDICTOR (stmt), + PREDICT_EXPR_OUTCOME (stmt)); + bsi_remove (&bsi, true); + next = true; + break; default: break; } + if (!next) + bsi_next (&bsi); } } } @@ -1915,8 +1924,25 @@ gate_estimate_probability (void) return flag_guess_branch_prob; } -struct tree_opt_pass pass_profile = +/* Build PREDICT_EXPR. */ +tree +build_predict_expr (enum br_predictor predictor, enum prediction taken) +{ + tree t = build1 (PREDICT_EXPR, NULL_TREE, build_int_cst (NULL, predictor)); + PREDICT_EXPR_OUTCOME (t) = taken; + return t; +} + +const char * +predictor_name (enum br_predictor predictor) +{ + return predictor_info[predictor].name; +} + +struct gimple_opt_pass pass_profile = { + { + GIMPLE_PASS, "profile", /* name */ gate_estimate_probability, /* gate */ tree_estimate_probability, /* execute */ @@ -1928,6 +1954,6 @@ struct tree_opt_pass pass_profile = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - TODO_ggc_collect | TODO_verify_ssa, /* todo_flags_finish */ - 0 /* letter */ + TODO_ggc_collect | TODO_verify_ssa /* todo_flags_finish */ + } }; diff --git a/gcc/predict.def b/gcc/predict.def index a858c016aa7..62ae9d9f8d3 100644 --- a/gcc/predict.def +++ b/gcc/predict.def @@ -66,7 +66,7 @@ DEF_PREDICTOR (PRED_LOOP_ITERATIONS_GUESSED, "guessed loop iterations", PROB_ALWAYS, PRED_FLAG_FIRST_MATCH) /* Branch containing goto is probably not taken. */ -DEF_PREDICTOR (PRED_CONTINUE, "continue", HITRATE (56), 0) +DEF_PREDICTOR (PRED_CONTINUE, "continue", HITRATE (50), 0) /* Branch to basic block containing call marked by noreturn attribute. */ DEF_PREDICTOR (PRED_NORETURN, "noreturn call", HITRATE (99), diff --git a/gcc/predict.h b/gcc/predict.h index 6c48c3e1d42..6552c7293fd 100644 --- a/gcc/predict.h +++ b/gcc/predict.h @@ -38,5 +38,7 @@ enum prediction extern void predict_insn_def (rtx, enum br_predictor, enum prediction); extern int counts_to_freqs (void); extern void estimate_bb_frequencies (void); +extern const char *predictor_name (enum br_predictor); +extern tree build_predict_expr (enum br_predictor, enum prediction); #endif /* GCC_PREDICT_H */ diff --git a/gcc/recog.c b/gcc/recog.c index 2629adc3229..7303b2a86f3 100644 --- a/gcc/recog.c +++ b/gcc/recog.c @@ -3312,8 +3312,10 @@ rest_of_handle_peephole2 (void) return 0; } -struct tree_opt_pass pass_peephole2 = +struct rtl_opt_pass pass_peephole2 = { + { + RTL_PASS, "peephole2", /* name */ gate_handle_peephole2, /* gate */ rest_of_handle_peephole2, /* execute */ @@ -3326,8 +3328,8 @@ struct tree_opt_pass pass_peephole2 = 0, /* properties_destroyed */ 0, /* todo_flags_start */ TODO_df_finish | TODO_verify_rtl_sharing | - TODO_dump_func, /* todo_flags_finish */ - 'z' /* letter */ + TODO_dump_func /* todo_flags_finish */ + } }; static unsigned int @@ -3337,8 +3339,10 @@ rest_of_handle_split_all_insns (void) return 0; } -struct tree_opt_pass pass_split_all_insns = +struct rtl_opt_pass pass_split_all_insns = { + { + RTL_PASS, "split1", /* name */ NULL, /* gate */ rest_of_handle_split_all_insns, /* execute */ @@ -3350,8 +3354,8 @@ struct tree_opt_pass pass_split_all_insns = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - TODO_dump_func, /* todo_flags_finish */ - 0 /* letter */ + TODO_dump_func /* todo_flags_finish */ + } }; static unsigned int @@ -3365,8 +3369,10 @@ rest_of_handle_split_after_reload (void) return 0; } -struct tree_opt_pass pass_split_after_reload = +struct rtl_opt_pass pass_split_after_reload = { + { + RTL_PASS, "split2", /* name */ NULL, /* gate */ rest_of_handle_split_after_reload, /* execute */ @@ -3378,8 +3384,8 @@ struct tree_opt_pass pass_split_after_reload = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - TODO_dump_func, /* todo_flags_finish */ - 0 /* letter */ + TODO_dump_func /* todo_flags_finish */ + } }; static bool @@ -3407,8 +3413,10 @@ rest_of_handle_split_before_regstack (void) return 0; } -struct tree_opt_pass pass_split_before_regstack = +struct rtl_opt_pass pass_split_before_regstack = { + { + RTL_PASS, "split3", /* name */ gate_handle_split_before_regstack, /* gate */ rest_of_handle_split_before_regstack, /* execute */ @@ -3420,8 +3428,8 @@ struct tree_opt_pass pass_split_before_regstack = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - TODO_dump_func, /* todo_flags_finish */ - 0 /* letter */ + TODO_dump_func /* todo_flags_finish */ + } }; static bool @@ -3443,8 +3451,10 @@ rest_of_handle_split_before_sched2 (void) return 0; } -struct tree_opt_pass pass_split_before_sched2 = +struct rtl_opt_pass pass_split_before_sched2 = { + { + RTL_PASS, "split4", /* name */ gate_handle_split_before_sched2, /* gate */ rest_of_handle_split_before_sched2, /* execute */ @@ -3457,8 +3467,8 @@ struct tree_opt_pass pass_split_before_sched2 = 0, /* properties_destroyed */ 0, /* todo_flags_start */ TODO_verify_flow | - TODO_dump_func, /* todo_flags_finish */ - 0 /* letter */ + TODO_dump_func /* todo_flags_finish */ + } }; /* The placement of the splitting that we do for shorten_branches @@ -3473,8 +3483,10 @@ gate_do_final_split (void) #endif } -struct tree_opt_pass pass_split_for_shorten_branches = +struct rtl_opt_pass pass_split_for_shorten_branches = { + { + RTL_PASS, "split5", /* name */ gate_do_final_split, /* gate */ split_all_insns_noflow, /* execute */ @@ -3486,8 +3498,8 @@ struct tree_opt_pass pass_split_for_shorten_branches = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - TODO_dump_func | TODO_verify_rtl_sharing, /* todo_flags_finish */ - 0 /* letter */ + TODO_dump_func | TODO_verify_rtl_sharing /* todo_flags_finish */ + } }; diff --git a/gcc/reg-stack.c b/gcc/reg-stack.c index 248a8c2b9a5..5a6443bd1ab 100644 --- a/gcc/reg-stack.c +++ b/gcc/reg-stack.c @@ -3202,8 +3202,10 @@ gate_handle_stack_regs (void) #endif } -struct tree_opt_pass pass_stack_regs = +struct rtl_opt_pass pass_stack_regs = { + { + RTL_PASS, NULL, /* name */ gate_handle_stack_regs, /* gate */ NULL, /* execute */ @@ -3215,8 +3217,8 @@ struct tree_opt_pass pass_stack_regs = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - 0, /* todo_flags_finish */ - 0 /* letter */ + 0 /* todo_flags_finish */ + } }; /* Convert register usage from flat register file usage to a stack @@ -3231,8 +3233,10 @@ rest_of_handle_stack_regs (void) return 0; } -struct tree_opt_pass pass_stack_regs_run = +struct rtl_opt_pass pass_stack_regs_run = { + { + RTL_PASS, "stack", /* name */ NULL, /* gate */ rest_of_handle_stack_regs, /* execute */ @@ -3246,6 +3250,6 @@ struct tree_opt_pass pass_stack_regs_run = 0, /* todo_flags_start */ TODO_df_finish | TODO_verify_rtl_sharing | TODO_dump_func | - TODO_ggc_collect, /* todo_flags_finish */ - 'k' /* letter */ + TODO_ggc_collect /* todo_flags_finish */ + } }; diff --git a/gcc/regclass.c b/gcc/regclass.c index 911a19aefe6..200f3eefa58 100644 --- a/gcc/regclass.c +++ b/gcc/regclass.c @@ -1059,8 +1059,10 @@ regclass_init (void) return 1; } -struct tree_opt_pass pass_regclass_init = +struct rtl_opt_pass pass_regclass_init = { + { + RTL_PASS, "regclass", /* name */ NULL, /* gate */ regclass_init, /* execute */ @@ -1072,8 +1074,8 @@ struct tree_opt_pass pass_regclass_init = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - 0, /* todo_flags_finish */ - 'k' /* letter */ + 0 /* todo_flags_finish */ + } }; @@ -2670,8 +2672,10 @@ gate_subregs_of_mode_init (void) #endif } -struct tree_opt_pass pass_subregs_of_mode_init = +struct rtl_opt_pass pass_subregs_of_mode_init = { + { + RTL_PASS, "subregs_of_mode_init", /* name */ gate_subregs_of_mode_init, /* gate */ init_subregs_of_mode, /* execute */ @@ -2683,12 +2687,14 @@ struct tree_opt_pass pass_subregs_of_mode_init = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - 0, /* todo_flags_finish */ - 0 /* letter */ + 0 /* todo_flags_finish */ + } }; -struct tree_opt_pass pass_subregs_of_mode_finish = +struct rtl_opt_pass pass_subregs_of_mode_finish = { + { + RTL_PASS, "subregs_of_mode_finish", /* name */ gate_subregs_of_mode_init, /* gate */ finish_subregs_of_mode, /* execute */ @@ -2700,8 +2706,8 @@ struct tree_opt_pass pass_subregs_of_mode_finish = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - 0, /* todo_flags_finish */ - 0 /* letter */ + 0 /* todo_flags_finish */ + } }; diff --git a/gcc/regmove.c b/gcc/regmove.c index 5a2f9c92ed9..81891b9661e 100644 --- a/gcc/regmove.c +++ b/gcc/regmove.c @@ -193,7 +193,7 @@ try_auto_increment (rtx insn, rtx inc_insn, rtx inc_insn_set, rtx reg, /* If there is a REG_DEAD note on this insn, we must change this not to REG_UNUSED meaning that the register is set, but the value is dead. Failure to do so will - result in a sched1 dieing -- when it recomputes lifetime + result in sched1 dying -- when it recomputes lifetime information, the number of REG_DEAD notes will have changed. */ rtx note = find_reg_note (insn, REG_DEAD, reg); @@ -2135,8 +2135,10 @@ rest_of_handle_regmove (void) return 0; } -struct tree_opt_pass pass_regmove = +struct rtl_opt_pass pass_regmove = { + { + RTL_PASS, "regmove", /* name */ gate_handle_regmove, /* gate */ rest_of_handle_regmove, /* execute */ @@ -2150,7 +2152,7 @@ struct tree_opt_pass pass_regmove = 0, /* todo_flags_start */ TODO_df_finish | TODO_verify_rtl_sharing | TODO_dump_func | - TODO_ggc_collect, /* todo_flags_finish */ - 'N' /* letter */ + TODO_ggc_collect /* todo_flags_finish */ + } }; diff --git a/gcc/regrename.c b/gcc/regrename.c index 74112c3ca53..cfc0881be1f 100644 --- a/gcc/regrename.c +++ b/gcc/regrename.c @@ -1938,8 +1938,10 @@ rest_of_handle_regrename (void) return 0; } -struct tree_opt_pass pass_regrename = +struct rtl_opt_pass pass_regrename = { + { + RTL_PASS, "rnreg", /* name */ gate_handle_regrename, /* gate */ rest_of_handle_regrename, /* execute */ @@ -1952,8 +1954,8 @@ struct tree_opt_pass pass_regrename = 0, /* properties_destroyed */ 0, /* todo_flags_start */ TODO_df_finish | TODO_verify_rtl_sharing | - TODO_dump_func, /* todo_flags_finish */ - 'n' /* letter */ + TODO_dump_func /* todo_flags_finish */ + } }; static bool @@ -1971,8 +1973,10 @@ rest_of_handle_cprop (void) return 0; } -struct tree_opt_pass pass_cprop_hardreg = +struct rtl_opt_pass pass_cprop_hardreg = { + { + RTL_PASS, "cprop_hardreg", /* name */ gate_handle_cprop, /* gate */ rest_of_handle_cprop, /* execute */ @@ -1984,7 +1988,7 @@ struct tree_opt_pass pass_cprop_hardreg = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - TODO_dump_func | TODO_verify_rtl_sharing, /* todo_flags_finish */ - 'n' /* letter */ + TODO_dump_func | TODO_verify_rtl_sharing /* todo_flags_finish */ + } }; diff --git a/gcc/reorg.c b/gcc/reorg.c index 985c118bc8c..8db19b49d57 100644 --- a/gcc/reorg.c +++ b/gcc/reorg.c @@ -4066,8 +4066,10 @@ rest_of_handle_delay_slots (void) return 0; } -struct tree_opt_pass pass_delay_slots = +struct rtl_opt_pass pass_delay_slots = { + { + RTL_PASS, "dbr", /* name */ gate_handle_delay_slots, /* gate */ rest_of_handle_delay_slots, /* execute */ @@ -4080,8 +4082,8 @@ struct tree_opt_pass pass_delay_slots = 0, /* properties_destroyed */ 0, /* todo_flags_start */ TODO_dump_func | - TODO_ggc_collect, /* todo_flags_finish */ - 'd' /* letter */ + TODO_ggc_collect /* todo_flags_finish */ + } }; /* Machine dependent reorg pass. */ @@ -4099,8 +4101,10 @@ rest_of_handle_machine_reorg (void) return 0; } -struct tree_opt_pass pass_machine_reorg = +struct rtl_opt_pass pass_machine_reorg = { + { + RTL_PASS, "mach", /* name */ gate_handle_machine_reorg, /* gate */ rest_of_handle_machine_reorg, /* execute */ @@ -4113,6 +4117,6 @@ struct tree_opt_pass pass_machine_reorg = 0, /* properties_destroyed */ 0, /* todo_flags_start */ TODO_dump_func | - TODO_ggc_collect, /* todo_flags_finish */ - 'M' /* letter */ + TODO_ggc_collect /* todo_flags_finish */ + } }; diff --git a/gcc/rtl-factoring.c b/gcc/rtl-factoring.c index 20e9cf29097..77c2197b41d 100644 --- a/gcc/rtl-factoring.c +++ b/gcc/rtl-factoring.c @@ -1428,7 +1428,10 @@ rest_of_rtl_seqabstr (void) return 0; } -struct tree_opt_pass pass_rtl_seqabstr = { +struct rtl_opt_pass pass_rtl_seqabstr = +{ + { + RTL_PASS, "seqabstr", /* name */ gate_rtl_seqabstr, /* gate */ rest_of_rtl_seqabstr, /* execute */ @@ -1442,6 +1445,6 @@ struct tree_opt_pass pass_rtl_seqabstr = { 0, /* todo_flags_start */ TODO_df_finish | TODO_verify_rtl_sharing | TODO_dump_func | - TODO_ggc_collect, /* todo_flags_finish */ - 'Q' /* letter */ + TODO_ggc_collect /* todo_flags_finish */ + } }; diff --git a/gcc/sched-rgn.c b/gcc/sched-rgn.c index b340bd532e4..e62046b8cd8 100644 --- a/gcc/sched-rgn.c +++ b/gcc/sched-rgn.c @@ -3192,8 +3192,10 @@ rest_of_handle_sched2 (void) return 0; } -struct tree_opt_pass pass_sched = +struct rtl_opt_pass pass_sched = { + { + RTL_PASS, "sched1", /* name */ gate_handle_sched, /* gate */ rest_of_handle_sched, /* execute */ @@ -3208,12 +3210,14 @@ struct tree_opt_pass pass_sched = TODO_df_finish | TODO_verify_rtl_sharing | TODO_dump_func | TODO_verify_flow | - TODO_ggc_collect, /* todo_flags_finish */ - 'S' /* letter */ + TODO_ggc_collect /* todo_flags_finish */ + } }; -struct tree_opt_pass pass_sched2 = +struct rtl_opt_pass pass_sched2 = { + { + RTL_PASS, "sched2", /* name */ gate_handle_sched2, /* gate */ rest_of_handle_sched2, /* execute */ @@ -3228,7 +3232,7 @@ struct tree_opt_pass pass_sched2 = TODO_df_finish | TODO_verify_rtl_sharing | TODO_dump_func | TODO_verify_flow | - TODO_ggc_collect, /* todo_flags_finish */ - 'R' /* letter */ + TODO_ggc_collect /* todo_flags_finish */ + } }; diff --git a/gcc/see.c b/gcc/see.c index d932f51a266..c6f584cc653 100644 --- a/gcc/see.c +++ b/gcc/see.c @@ -3859,8 +3859,10 @@ rest_of_handle_see (void) return 0; } -struct tree_opt_pass pass_see = +struct rtl_opt_pass pass_see = { + { + RTL_PASS, "see", /* name */ gate_handle_see, /* gate */ rest_of_handle_see, /* execute */ @@ -3874,7 +3876,7 @@ struct tree_opt_pass pass_see = 0, /* todo_flags_start */ TODO_df_verify | TODO_df_finish | TODO_verify_rtl_sharing | - TODO_dump_func, /* todo_flags_finish */ - 'u' /* letter */ + TODO_dump_func /* todo_flags_finish */ + } }; diff --git a/gcc/stack-ptr-mod.c b/gcc/stack-ptr-mod.c index a5c85a5247c..e37fcc3e302 100644 --- a/gcc/stack-ptr-mod.c +++ b/gcc/stack-ptr-mod.c @@ -91,8 +91,10 @@ rest_of_handle_stack_ptr_mod (void) return 0; } -struct tree_opt_pass pass_stack_ptr_mod = +struct rtl_opt_pass pass_stack_ptr_mod = { + { + RTL_PASS, NULL, /* name */ NULL, /* gate */ rest_of_handle_stack_ptr_mod, /* execute */ @@ -104,6 +106,6 @@ struct tree_opt_pass pass_stack_ptr_mod = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - 0, /* todo_flags_finish */ - 0 /* letter */ + 0 /* todo_flags_finish */ + } }; diff --git a/gcc/stor-layout.c b/gcc/stor-layout.c index 67e4c25fbdc..ff46687834d 100644 --- a/gcc/stor-layout.c +++ b/gcc/stor-layout.c @@ -699,6 +699,9 @@ update_alignment_for_field (record_layout_info rli, tree field, && ! integer_zerop (DECL_SIZE (rli->prev_field))))) { unsigned int type_align = TYPE_ALIGN (type); + unsigned int type_size + = tree_low_cst (TYPE_SIZE (type), 1); + type_align = MAX (type_align, type_size); type_align = MAX (type_align, desired_align); if (maximum_field_alignment != 0) type_align = MIN (type_align, maximum_field_alignment); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 10ead70ab01..cee836cc8a3 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,156 @@ +2008-03-20 Kai Tietz <kai.tietz@onevision.com> + + * gcc.dg/format/ms_array-1.c: New. + * gcc.dg/format/ms_c90-scanf-3.c: New. + * gcc.dg/format/ms_c99-strftime-1.c: New. + * gcc.dg/format/ms_no-y2k-1.c: New. + * gcc.dg/format/ms_attr-1.c: New. + * gcc.dg/format/ms_c90-scanf-4.c: New. + * gcc.dg/format/ms_c99-strftime-2.c: New. + * gcc.dg/format/ms_nonlit-1.c: New. + * gcc.dg/format/ms_c90-scanf-5.c: New. + * gcc.dg/format/ms_cast-1.c: New. + * gcc.dg/format/ms_nonlit-2.c: New. + * gcc.dg/format/ms_attr-2.c: New. + * gcc.dg/format/ms_c90-strftime-1.c: New. + * gcc.dg/format/ms_miss-1.c: New. + * gcc.dg/format/ms_nonlit-3.c: New. + * gcc.dg/format/ms_attr-3.c: New. + * gcc.dg/format/ms_c90-strftime-2.c: New. + * gcc.dg/format/ms_miss-2.c: New. + * gcc.dg/format/ms_nul-1.c: New. + * gcc.dg/format/ms_attr-4.c: New. + * gcc.dg/format/ms_c94-printf-1.c: New. + * gcc.dg/format/ms_miss-3.c: New. + * gcc.dg/format/ms_nul-2.c: New. + * gcc.dg/format/ms_attr-7.c: New. + * gcc.dg/format/ms_c94-scanf-1.c: New. + * gcc.dg/format/ms_miss-4.c: New. + * gcc.dg/format/ms_null-1.c: New. + * gcc.dg/format/ms_bitfld-1.c: New. + * gcc.dg/format/ms_c99-printf-1.c: New. + * gcc.dg/format/ms_miss-5.c: New. + * gcc.dg/format/ms_plus-1.c: New. + * gcc.dg/format/ms_branch-1.c: New. + * gcc.dg/format/ms_c99-printf-2.c: New. + * gcc.dg/format/ms_miss-6.c: New. + * gcc.dg/format/ms_sec-1.c: New. + * gcc.dg/format/ms_c90-printf-1.c: New. + * gcc.dg/format/ms_c99-printf-3.c: New. + * gcc.dg/format/ms_multattr-1.c: New. + * gcc.dg/format/ms_unnamed-1.c: New. + * gcc.dg/format/ms_c90-printf-2.c: New. + * gcc.dg/format/ms_c99-scanf-1.c: New. + * gcc.dg/format/ms_multattr-2.c: New. + * gcc.dg/format/ms_va-1.c: New. + * gcc.dg/format/ms_c90-printf-3.c: New. + * gcc.dg/format/ms_c99-scanf-2.c: New. + * gcc.dg/format/ms_multattr-3.c: New. + * gcc.dg/format/ms_c90-scanf-1.c: New. + * gcc.dg/format/ms_c99-scanf-3.c: New. + * gcc.dg/format/ms_no-exargs-1.c: New. + * gcc.dg/format/ms_zero-length-1.c: New. + * gcc.dg/format/ms_c90-scanf-2.c: New. + * gcc.dg/format/ms_c99-scanf-4.c: New. + * gcc.dg/format/ms_no-exargs-2.c: New. + * gcc.dg/format/null-1.c: Add gnu style usage for mingw. + * gcc.dg/format/miss-1.c: Likewise. + * gcc.dg/format/miss-3.c: Likewise. + * gcc.dg/format/multattr-2.c: Likewise. + * gcc.dg/format/miss-5.c: Likewise. + * gcc.dg/format/attr-2.c: Likewise. + * gcc.dg/format/attr-4.c: Likewise. + * gcc.dg/format/c90-scanf-4.c: Likewise. + * gcc.dg/format/c99-printf-3.c: Likewise. + * gcc.dg/format/multattr-1.c: Likewise. + * gcc.dg/format/miss-4.c: Likewise. + * gcc.dg/format/miss-6.c: Likewise. + * gcc.dg/format/c90-printf-3.c: Likewise. + * gcc.dg/format/attr-1.c: Likewise. + * gcc.dg/format/attr-3.c: Likewise. + * gcc.dg/format/attr-7.c: Likewise. + * gcc.dg/format/format.h: Treat mingw and gnu style. + * gcc.dg/format/sys_format.c: New. + +2008-03-19 Jerry DeLisle <jvdelisle@gcc.gnu.org> + + PR libfortran/35627 + * gfortran.dg/namelist_46.f90: New test. + +2008-03-20 Uros Bizjak <ubizjak@gmail.com> + + PR target/14552 + * gcc.target/i386/pr14552.c: New test. + +2008-03-19 Michael Matz <matz@suse.de> + + PR middle-end/35616 + * gcc.dg/pr35616.c: New test. + +2008-03-19 Daniel Franke <franke.daniel@gmail.com> + + PR fortran/35152 + * gfortran.dg/argument_checking_16.f90: New test. + +2008-03-19 Thomas Koenig <tkoenig@gcc.gnu.org> + + PR libfortran/32972 + * gfortran.dg/internal_pack_1.f90: New test case. + * gfortran.dg/internal_pack_2.f90: New test case. + * gfortran.dg/internal_pack_3.f90: New test case. + +2008-03-19 Jan Hubicka <jh@suse.cz> + + * gcc.dg/20050811-2.c: Update dumping flags. + * gcc.dg/sms-2.c: Update dumping flags. + * gcc.dg/var-expand1.c: Update dumping flags. + * gcc.dg/var-expand3.c: Update dumping flags. + * gcc.dg/pr30957-1.c: Update dumping flags. + * gcc.dg/20050811-1.c: Update dumping flags. + * gcc.dg/cpp/cmdlne-dI-M.C: Do not xfail. + * gcc.dg/cpp/cmdlne-dM-M.C: Do not xfail. + +2008-03-19 Richard Guenther <rguenther@suse.de> + + PR middle-end/35609 + * gcc.dg/testsuite/uninit-15.c: New testcase. + * gcc.dg/testsuite/uninit-16.c: Likewise. + +2008-03-18 Mikulas Patocka <mikulas@artax.karlin.mff.cuni.cz> + + PR target/35504 + * g++.dg/other/pr35504.C: New test. + +2008-03-18 Richard Guenther <rguenther@suse.de> + + * gcc.dg/tree-ssa/forwprop-4.c: New testcase. + * gcc.dg/tree-ssa/ssa-fre-16.c: Likewise. + +2008-03-18 Richard Guenther <rguenther@suse.de> + + * gcc.dg/tree-ssa/loop-19.c: Revert previous change. + +2008-03-17 Jerry DeLisle <jvdelisle@gcc.gnu.org> + + PR libfortran/35617 + * gfortran.dg/namelist_45.f90: New test. + +2008-03-17 James E. Wilson <wilson@tuliptree.org> + + PR testsuite/35512 + * gcc.target/ia64/visibility-1.c (foo): Change return type to void. + Write variables instead of reading them. + +2008-03-17 Jason Merrill <jason@redhat.com> + + PR c++/35548 + * g++.dg/init/ref16.C: New testcase. + +2008-03-17 Richard Guenther <rguenther@suse.de> + + PR tree-optimization/19637 + * g++.dg/tree-ssa/pr19637.C: New testcase. + 2008-03-16 Paul Thomas <pault@gcc.gnu.org> PR fortran/35470 diff --git a/gcc/testsuite/g++.dg/init/ref16.C b/gcc/testsuite/g++.dg/init/ref16.C new file mode 100644 index 00000000000..2d56395cb63 --- /dev/null +++ b/gcc/testsuite/g++.dg/init/ref16.C @@ -0,0 +1,23 @@ +// PR c++/35548 +// { dg-do run } + +int c; +struct A +{ + A() { ++c; } + A(const A&) { ++c; } + ~A() { --c; } +}; + +A f() +{ + return A(); +} + +int i; +const A* ap; +int main() +{ + const A& ar = i ? *ap : f(); + return (c == 0); +} diff --git a/gcc/testsuite/g++.dg/other/pr35504.C b/gcc/testsuite/g++.dg/other/pr35504.C new file mode 100644 index 00000000000..09c13fd08a7 --- /dev/null +++ b/gcc/testsuite/g++.dg/other/pr35504.C @@ -0,0 +1,147 @@ +// { dg-do run { target { { i?86-*-* x86_64-*-* } && ilp32 } } } + +#define ATTR0 __attribute__((__regparm__(0))) +#define ATTR1 __attribute__((__regparm__(1))) +#define ATTR2 __attribute__((__regparm__(2))) +#define ATTR3 __attribute__((__regparm__(3))) +#define ATTR4 __attribute__((__fastcall__)) +#define ATTR5 __attribute__((__stdcall__)) +#define ATTR6 __attribute__((__cdecl__)) +#define ATTR7 + +extern "C" void abort (void); + +struct long_struct +{ + int a[3]; +}; + +struct long_struct ret; + +class c3 *this3; + +class c1 +{ + int val1; +public: + virtual void foo () { } +}; + +class c2 +{ +public: + virtual ATTR0 struct long_struct method0 () + { + return ret; + } + + virtual ATTR1 struct long_struct method1 () + { + return ret; + } + + virtual ATTR2 struct long_struct method2 () + { + return ret; + } + + virtual ATTR3 struct long_struct method3 () + { + return ret; + } + + virtual ATTR4 struct long_struct method4 () + { + return ret; + } + + virtual ATTR5 struct long_struct method5 () + { + return ret; + } + + virtual ATTR6 struct long_struct method6 () + { + return ret; + } + + virtual ATTR7 struct long_struct method7 () + { + return ret; + } +}; + +class c3:c1, public c2 +{ +public: + c3 () + { + this3 = this; + } + + struct long_struct check_this (int a) + { + if (this3 != this) + abort (); + + return ret; + } + + virtual ATTR0 struct long_struct method0 () + { + return check_this (0); + } + + virtual ATTR1 struct long_struct method1 () + { + return check_this (1); + } + + virtual ATTR2 struct long_struct method2 () + { + return check_this (2); + } + + virtual ATTR3 struct long_struct method3 () + { + return check_this (3); + } + + virtual ATTR4 struct long_struct method4 () + { + return check_this (4); + } + + virtual ATTR5 struct long_struct method5 () + { + return check_this (5); + } + + virtual ATTR6 struct long_struct method6 () + { + return check_this (6); + } + + virtual ATTR7 struct long_struct method7 () + { + return check_this (7); + } +}; + +class c3 c3_instance; +class c2 *c2_ptr = &c3_instance; + +int +main () +{ + c2_ptr->method0 (); + c2_ptr->method1 (); + c2_ptr->method2 (); + c2_ptr->method3 (); + c2_ptr->method4 (); + c2_ptr->method5 (); + c2_ptr->method6 (); + c2_ptr->method7 (); + + return 0; +} diff --git a/gcc/testsuite/g++.dg/tree-ssa/pr19637.C b/gcc/testsuite/g++.dg/tree-ssa/pr19637.C new file mode 100644 index 00000000000..2d1dcceba42 --- /dev/null +++ b/gcc/testsuite/g++.dg/tree-ssa/pr19637.C @@ -0,0 +1,33 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fdump-tree-dom1" } */ + +#include <new> + +struct Foo { + Foo() { i[0] = 1; } + int i[2]; +}; + +int foo_char(void) +{ + int i[2]; + new (reinterpret_cast<char *>(i)) Foo(); + return reinterpret_cast<Foo *>(i)->i[0]; +} + +int foo_void(void) +{ + int i[2]; + new (reinterpret_cast<void *>(i)) Foo(); + return reinterpret_cast<Foo *>(i)->i[0]; +} + +int foo_void_offset(void) +{ + int i[2]; + new (reinterpret_cast<void *>(&i[0])) Foo(); + return reinterpret_cast<Foo *>(&i[0])->i[0]; +} + +/* { dg-final { scan-tree-dump-times "return 1;" 3 "dom1" } } */ +/* { dg-final { cleanup-tree-dump "dom1" } } */ diff --git a/gcc/testsuite/gcc.dg/20050811-1.c b/gcc/testsuite/gcc.dg/20050811-1.c index cfc181692c1..a9f860bb8bd 100644 --- a/gcc/testsuite/gcc.dg/20050811-1.c +++ b/gcc/testsuite/gcc.dg/20050811-1.c @@ -1,6 +1,6 @@ -/* Test whether -dav doesn't crash. */ +/* Test whether -dv -fdump-rtl-all doesn't crash. */ /* { dg-do compile } */ -/* { dg-options "-O2 -dav" } */ +/* { dg-options "-O2 -dv -fdump-rtl-all" } */ int foo (void) { diff --git a/gcc/testsuite/gcc.dg/20050811-2.c b/gcc/testsuite/gcc.dg/20050811-2.c index 2f1d48b350e..ffd1f390498 100644 --- a/gcc/testsuite/gcc.dg/20050811-2.c +++ b/gcc/testsuite/gcc.dg/20050811-2.c @@ -1,6 +1,6 @@ /* Test whether -dov doesn't crash. */ /* { dg-do compile } */ -/* { dg-options "-O2 -dov" } */ +/* { dg-options "-O2 -dv -fdump-rtl-postreload" } */ int foo (void) { diff --git a/gcc/testsuite/gcc.dg/cpp/cmdlne-dI-M.c b/gcc/testsuite/gcc.dg/cpp/cmdlne-dI-M.c index c003d5ade98..a30b4bc12db 100644 --- a/gcc/testsuite/gcc.dg/cpp/cmdlne-dI-M.c +++ b/gcc/testsuite/gcc.dg/cpp/cmdlne-dI-M.c @@ -13,4 +13,4 @@ int variable; /* { dg-final { scan-file-not cmdlne-dI-M.i "(^|\\n)#define foo bar($|\\n)" } } { dg-final { scan-file-not cmdlne-dI-M.i "variable" } } - { dg-final { scan-file cmdlne-dI-M.i "(^|\\n)cmdlne-dI-M.*:\[^\\n\]*cmdlne-dI-M.c" { xfail *-*-* } } } */ + { dg-final { scan-file cmdlne-dI-M.i "(^|\\n)cmdlne-dI-M.*:\[^\\n\]*cmdlne-dI-M.c" } } */ diff --git a/gcc/testsuite/gcc.dg/cpp/cmdlne-dM-M.c b/gcc/testsuite/gcc.dg/cpp/cmdlne-dM-M.c index fb21f40f408..193168e940f 100644 --- a/gcc/testsuite/gcc.dg/cpp/cmdlne-dM-M.c +++ b/gcc/testsuite/gcc.dg/cpp/cmdlne-dM-M.c @@ -12,4 +12,4 @@ int variable; /* { dg-final { scan-file cmdlne-dM-M.i "(^|\\n)#define foo bar($|\\n)" } } { dg-final { scan-file-not cmdlne-dM-M.i "variable" } } - { dg-final { scan-file cmdlne-dM-M.i "(^|\\n)cmdlne-dM-M\[^\\n\]*:\[^\\n\]*cmdlne-dM-M.c" { xfail *-*-* } } } */ + { dg-final { scan-file cmdlne-dM-M.i "(^|\\n)cmdlne-dM-M\[^\\n\]*:\[^\\n\]*cmdlne-dM-M.c"} } */ diff --git a/gcc/testsuite/gcc.dg/format/attr-1.c b/gcc/testsuite/gcc.dg/format/attr-1.c index b92c67a81e7..8b2f5b7a357 100644 --- a/gcc/testsuite/gcc.dg/format/attr-1.c +++ b/gcc/testsuite/gcc.dg/format/attr-1.c @@ -3,7 +3,8 @@ /* { dg-do compile } */ /* { dg-options "-std=gnu99 -Wformat" } */ +#define DONT_GNU_PROTOTYPE #include "format.h" -extern void foo0 (const char *) __attribute__((__format__(__strftime__, 1, 0))); -extern void foo1 (const char *, ...) __attribute__((__format__(__strftime__, 1, 2))); /* { dg-error "cannot format" "strftime first_arg_num != 0" } */ +extern void foo0 (const char *) __attribute__((__format__(gnu_attr___strftime__, 1, 0))); +extern void foo1 (const char *, ...) __attribute__((__format__(gnu_attr___strftime__, 1, 2))); /* { dg-error "cannot format" "strftime first_arg_num != 0" } */ diff --git a/gcc/testsuite/gcc.dg/format/attr-2.c b/gcc/testsuite/gcc.dg/format/attr-2.c index 54d4655ef2c..f560ed06bb1 100644 --- a/gcc/testsuite/gcc.dg/format/attr-2.c +++ b/gcc/testsuite/gcc.dg/format/attr-2.c @@ -3,22 +3,23 @@ /* { dg-do compile } */ /* { dg-options "-std=gnu99 -Wformat" } */ +#define DONT_GNU_PROTOTYPE #include "format.h" -extern void tformatprintf (const char *, ...) __attribute__((format(printf, 1, 2))); -extern void tformat__printf__ (const char *, ...) __attribute__((format(__printf__, 1, 2))); -extern void tformatscanf (const char *, ...) __attribute__((format(scanf, 1, 2))); -extern void tformat__scanf__ (const char *, ...) __attribute__((format(__scanf__, 1, 2))); -extern void tformatstrftime (const char *) __attribute__((format(strftime, 1, 0))); -extern void tformat__strftime__ (const char *) __attribute__((format(__strftime__, 1, 0))); +extern void tformatprintf (const char *, ...) __attribute__((format(gnu_attr_printf, 1, 2))); +extern void tformat__printf__ (const char *, ...) __attribute__((format(gnu_attr___printf__, 1, 2))); +extern void tformatscanf (const char *, ...) __attribute__((format(gnu_attr_scanf, 1, 2))); +extern void tformat__scanf__ (const char *, ...) __attribute__((format(gnu_attr___scanf__, 1, 2))); +extern void tformatstrftime (const char *) __attribute__((format(gnu_attr_strftime, 1, 0))); +extern void tformat__strftime__ (const char *) __attribute__((format(gnu_attr___strftime__, 1, 0))); extern void tformatstrfmon (const char *, ...) __attribute__((format(strfmon, 1, 2))); extern void tformat__strfmon__ (const char *, ...) __attribute__((format(__strfmon__, 1, 2))); -extern void t__format__printf (const char *, ...) __attribute__((__format__(printf, 1, 2))); -extern void t__format____printf__ (const char *, ...) __attribute__((__format__(__printf__, 1, 2))); -extern void t__format__scanf (const char *, ...) __attribute__((__format__(scanf, 1, 2))); -extern void t__format____scanf__ (const char *, ...) __attribute__((__format__(__scanf__, 1, 2))); -extern void t__format__strftime (const char *) __attribute__((__format__(strftime, 1, 0))); -extern void t__format____strftime__ (const char *) __attribute__((__format__(__strftime__, 1, 0))); +extern void t__format__printf (const char *, ...) __attribute__((__format__(gnu_attr_printf, 1, 2))); +extern void t__format____printf__ (const char *, ...) __attribute__((__format__(gnu_attr___printf__, 1, 2))); +extern void t__format__scanf (const char *, ...) __attribute__((__format__(gnu_attr_scanf, 1, 2))); +extern void t__format____scanf__ (const char *, ...) __attribute__((__format__(gnu_attr___scanf__, 1, 2))); +extern void t__format__strftime (const char *) __attribute__((__format__(gnu_attr_strftime, 1, 0))); +extern void t__format____strftime__ (const char *) __attribute__((__format__(gnu_attr___strftime__, 1, 0))); extern void t__format__strfmon (const char *, ...) __attribute__((__format__(strfmon, 1, 2))); extern void t__format____strfmon__ (const char *, ...) __attribute__((__format__(__strfmon__, 1, 2))); diff --git a/gcc/testsuite/gcc.dg/format/attr-3.c b/gcc/testsuite/gcc.dg/format/attr-3.c index 8fc1faa6819..bee5ff4841b 100644 --- a/gcc/testsuite/gcc.dg/format/attr-3.c +++ b/gcc/testsuite/gcc.dg/format/attr-3.c @@ -3,20 +3,21 @@ /* { dg-do compile } */ /* { dg-options "-std=gnu99 -Wformat" } */ +#define DONT_GNU_PROTOTYPE #include "format.h" /* Proper uses of the attributes. */ -extern void fa0 (const char *, ...) __attribute__((format(printf, 1, 2))); -extern void fa1 (char *, ...) __attribute__((format(printf, 1, 2))); +extern void fa0 (const char *, ...) __attribute__((format(gnu_attr_printf, 1, 2))); +extern void fa1 (char *, ...) __attribute__((format(gnu_attr_printf, 1, 2))); extern char *fa2 (const char *) __attribute__((format_arg(1))); extern char *fa3 (char *) __attribute__((format_arg(1))); /* Uses with too few or too many arguments. */ extern void fb0 (const char *, ...) __attribute__((format)); /* { dg-error "wrong number of arguments" "bad format" } */ extern void fb1 (const char *, ...) __attribute__((format())); /* { dg-error "wrong number of arguments" "bad format" } */ -extern void fb2 (const char *, ...) __attribute__((format(printf))); /* { dg-error "wrong number of arguments" "bad format" } */ -extern void fb3 (const char *, ...) __attribute__((format(printf, 1))); /* { dg-error "wrong number of arguments" "bad format" } */ -extern void fb4 (const char *, ...) __attribute__((format(printf, 1, 2, 3))); /* { dg-error "wrong number of arguments" "bad format" } */ +extern void fb2 (const char *, ...) __attribute__((format(gnu_attr_printf))); /* { dg-error "wrong number of arguments" "bad format" } */ +extern void fb3 (const char *, ...) __attribute__((format(gnu_attr_printf, 1))); /* { dg-error "wrong number of arguments" "bad format" } */ +extern void fb4 (const char *, ...) __attribute__((format(gnu_attr_printf, 1, 2, 3))); /* { dg-error "wrong number of arguments" "bad format" } */ extern void fc1 (const char *) __attribute__((format_arg)); /* { dg-error "wrong number of arguments" "bad format_arg" } */ extern void fc2 (const char *) __attribute__((format_arg())); /* { dg-error "wrong number of arguments" "bad format_arg" } */ @@ -25,9 +26,9 @@ extern void fc3 (const char *) __attribute__((format_arg(1, 2))); /* { dg-error /* These attributes presently only apply to declarations, not to types. Eventually, they should be usable with declarators for function types anywhere, but still not with structure/union/enum types. */ -struct s0 { int i; } __attribute__((format(printf, 1, 2))); /* { dg-error "does not apply|only applies" "format on struct" } */ -union u0 { int i; } __attribute__((format(printf, 1, 2))); /* { dg-error "does not apply|only applies" "format on union" } */ -enum e0 { E0V0 } __attribute__((format(printf, 1, 2))); /* { dg-error "does not apply|only applies" "format on enum" } */ +struct s0 { int i; } __attribute__((format(gnu_attr_printf, 1, 2))); /* { dg-error "does not apply|only applies" "format on struct" } */ +union u0 { int i; } __attribute__((format(gnu_attr_printf, 1, 2))); /* { dg-error "does not apply|only applies" "format on union" } */ +enum e0 { E0V0 } __attribute__((format(gnu_attr_printf, 1, 2))); /* { dg-error "does not apply|only applies" "format on enum" } */ struct s1 { int i; } __attribute__((format_arg(1))); /* { dg-error "does not apply|only applies" "format_arg on struct" } */ union u1 { int i; } __attribute__((format_arg(1))); /* { dg-error "does not apply|only applies" "format_arg on union" } */ @@ -38,28 +39,28 @@ extern void fe0 (const char *, ...) __attribute__((format(12345, 1, 2))); /* { d extern void fe1 (const char *, ...) __attribute__((format(nosuch, 1, 2))); /* { dg-warning "format function type" "unknown format" } */ /* Both the numbers must be integer constant expressions. */ -extern void ff0 (const char *, ...) __attribute__((format(printf, 3-2, (long long)(10/5)))); +extern void ff0 (const char *, ...) __attribute__((format(gnu_attr_printf, 3-2, (long long)(10/5)))); int foo; -extern void ff1 (const char *, ...) __attribute__((format(printf, foo, 10/5))); /* { dg-error "invalid operand" "bad number" } */ -extern void ff2 (const char *, ...) __attribute__((format(printf, 3-2, foo))); /* { dg-error "invalid operand" "bad number" } */ +extern void ff1 (const char *, ...) __attribute__((format(gnu_attr_printf, foo, 10/5))); /* { dg-error "invalid operand" "bad number" } */ +extern void ff2 (const char *, ...) __attribute__((format(gnu_attr_printf, 3-2, foo))); /* { dg-error "invalid operand" "bad number" } */ extern char *ff3 (const char *) __attribute__((format_arg(3-2))); extern char *ff4 (const char *) __attribute__((format_arg(foo))); /* { dg-error "invalid operand" "bad format_arg number" } */ /* The format string argument must precede the arguments to be formatted. This includes if no parameter types are specified (which is not valid ISO C for variadic functions). */ -extern void fg0 () __attribute__((format(printf, 1, 2))); -extern void fg1 () __attribute__((format(printf, 1, 0))); -extern void fg2 () __attribute__((format(printf, 1, 1))); /* { dg-error "follows" "bad number order" } */ -extern void fg3 () __attribute__((format(printf, 2, 1))); /* { dg-error "follows" "bad number order" } */ +extern void fg0 () __attribute__((format(gnu_attr_printf, 1, 2))); +extern void fg1 () __attribute__((format(gnu_attr_printf, 1, 0))); +extern void fg2 () __attribute__((format(gnu_attr_printf, 1, 1))); /* { dg-error "follows" "bad number order" } */ +extern void fg3 () __attribute__((format(gnu_attr_printf, 2, 1))); /* { dg-error "follows" "bad number order" } */ /* The format string argument must be a string type, and the arguments to be formatted must be the "...". */ -extern void fh0 (int, ...) __attribute__((format(printf, 1, 2))); /* { dg-error "not a string" "format int string" } */ -extern void fh1 (signed char *, ...) __attribute__((format(printf, 1, 2))); /* { dg-error "not a string" "signed char string" } */ -extern void fh2 (unsigned char *, ...) __attribute__((format(printf, 1, 2))); /* { dg-error "not a string" "unsigned char string" } */ -extern void fh3 (const char *, ...) __attribute__((format(printf, 1, 3))); /* { dg-error "is not" "not ..." } */ -extern void fh4 (const char *, int, ...) __attribute__((format(printf, 1, 2))); /* { dg-error "is not" "not ..." } */ +extern void fh0 (int, ...) __attribute__((format(gnu_attr_printf, 1, 2))); /* { dg-error "not a string" "format int string" } */ +extern void fh1 (signed char *, ...) __attribute__((format(gnu_attr_printf, 1, 2))); /* { dg-error "not a string" "signed char string" } */ +extern void fh2 (unsigned char *, ...) __attribute__((format(gnu_attr_printf, 1, 2))); /* { dg-error "not a string" "unsigned char string" } */ +extern void fh3 (const char *, ...) __attribute__((format(gnu_attr_printf, 1, 3))); /* { dg-error "is not" "not ..." } */ +extern void fh4 (const char *, int, ...) __attribute__((format(gnu_attr_printf, 1, 2))); /* { dg-error "is not" "not ..." } */ /* format_arg formats must take and return a string. */ extern char *fi0 (int) __attribute__((format_arg(1))); /* { dg-error "not a string" "format_arg int string" } */ diff --git a/gcc/testsuite/gcc.dg/format/attr-4.c b/gcc/testsuite/gcc.dg/format/attr-4.c index ef50c494f35..caeed93a790 100644 --- a/gcc/testsuite/gcc.dg/format/attr-4.c +++ b/gcc/testsuite/gcc.dg/format/attr-4.c @@ -4,12 +4,13 @@ /* { dg-do compile } */ /* { dg-options "-std=gnu99 -Wformat" } */ +#define DONT_GNU_PROTOTYPE #include "format.h" -extern __attribute__((format(printf, 1, 2))) void tformatprintf0 (const char *, ...); -extern void __attribute__((format(printf, 1, 2))) tformatprintf1 (const char *, ...); -extern void foo (void), __attribute__((format(printf, 1, 2))) tformatprintf2 (const char *, ...); -extern __attribute__((noreturn)) void bar (void), __attribute__((format(printf, 1, 2))) tformatprintf3 (const char *, ...); +extern __attribute__((format(gnu_attr_printf, 1, 2))) void tformatprintf0 (const char *, ...); +extern void __attribute__((format(gnu_attr_printf, 1, 2))) tformatprintf1 (const char *, ...); +extern void foo (void), __attribute__((format(gnu_attr_printf, 1, 2))) tformatprintf2 (const char *, ...); +extern __attribute__((noreturn)) void bar (void), __attribute__((format(gnu_attr_printf, 1, 2))) tformatprintf3 (const char *, ...); void baz (int i, int *ip, double d) diff --git a/gcc/testsuite/gcc.dg/format/attr-7.c b/gcc/testsuite/gcc.dg/format/attr-7.c index 78526a5e9bb..c370448193f 100644 --- a/gcc/testsuite/gcc.dg/format/attr-7.c +++ b/gcc/testsuite/gcc.dg/format/attr-7.c @@ -3,12 +3,13 @@ /* { dg-do compile } */ /* { dg-options "-std=gnu99 -Wformat" } */ +#define DONT_GNU_PROTOTYPE #include "format.h" -__attribute__((format(printf, 1, 2))) void (*tformatprintf0) (const char *, ...); -void (*tformatprintf1) (const char *, ...) __attribute__((format(printf, 1, 2))); -void (__attribute__((format(printf, 1, 2))) *tformatprintf2) (const char *, ...); -void (__attribute__((format(printf, 1, 2))) ****tformatprintf3) (const char *, ...); +__attribute__((format(gnu_attr_printf, 1, 2))) void (*tformatprintf0) (const char *, ...); +void (*tformatprintf1) (const char *, ...) __attribute__((format(gnu_attr_printf, 1, 2))); +void (__attribute__((format(gnu_attr_printf, 1, 2))) *tformatprintf2) (const char *, ...); +void (__attribute__((format(gnu_attr_printf, 1, 2))) ****tformatprintf3) (const char *, ...); char * (__attribute__((format_arg(1))) *tformat_arg) (const char *); diff --git a/gcc/testsuite/gcc.dg/format/c90-printf-3.c b/gcc/testsuite/gcc.dg/format/c90-printf-3.c index 1d53de32f65..bf48f3114e0 100644 --- a/gcc/testsuite/gcc.dg/format/c90-printf-3.c +++ b/gcc/testsuite/gcc.dg/format/c90-printf-3.c @@ -3,7 +3,7 @@ do not. */ /* Origin: Joseph Myers <jsm28@cam.ac.uk> */ -/* { dg-do compile } */ +/* { dg-do compile { target { ! *-*-mingw* } } } */ /* { dg-options "-std=iso9899:1990 -pedantic -Wformat" } */ #include "format.h" diff --git a/gcc/testsuite/gcc.dg/format/c90-scanf-4.c b/gcc/testsuite/gcc.dg/format/c90-scanf-4.c index e15dbd22616..0a47f3f3500 100644 --- a/gcc/testsuite/gcc.dg/format/c90-scanf-4.c +++ b/gcc/testsuite/gcc.dg/format/c90-scanf-4.c @@ -3,7 +3,7 @@ do not. */ /* Origin: Joseph Myers <jsm28@cam.ac.uk> */ -/* { dg-do compile } */ +/* { dg-do compile { target { ! *-*-mingw* } } } */ /* { dg-options "-std=iso9899:1990 -pedantic -Wformat" } */ #include "format.h" diff --git a/gcc/testsuite/gcc.dg/format/c99-printf-3.c b/gcc/testsuite/gcc.dg/format/c99-printf-3.c index b8ae405b299..2407bb60391 100644 --- a/gcc/testsuite/gcc.dg/format/c99-printf-3.c +++ b/gcc/testsuite/gcc.dg/format/c99-printf-3.c @@ -2,7 +2,7 @@ attributes in strict C99 mode, but the gettext functions do not. */ /* Origin: Joseph Myers <jsm28@cam.ac.uk> */ -/* { dg-do compile } */ +/* { dg-do compile { target { ! *-*-mingw* } } } */ /* { dg-options "-std=iso9899:1999 -pedantic -Wformat" } */ #include "format.h" diff --git a/gcc/testsuite/gcc.dg/format/format.h b/gcc/testsuite/gcc.dg/format/format.h index e55d23cd4d3..a99927e3c64 100644 --- a/gcc/testsuite/gcc.dg/format/format.h +++ b/gcc/testsuite/gcc.dg/format/format.h @@ -1,6 +1,37 @@ /* Format checking tests: common header. */ /* Origin: Joseph Myers <jsm28@cam.ac.uk> */ +/* DONT_GNU_PROTOTYPE */ +#if defined (_WIN32) && !defined (__CYGWIN__) +#if !defined (USE_SYSTEM_FORMATS) +#define gnu_attr_printf gnu_printf +#define gnu_attr___printf__ __gnu_printf__ +#define gnu_attr_scanf gnu_scanf +#define gnu_attr___scanf__ __gnu_scanf__ +#define gnu_attr_strftime gnu_strftime +#define gnu_attr___strftime__ __gnu_strftime__ +#endif +#endif + +#ifndef gnu_attr_printf +#define gnu_attr_printf printf +#define gnu_attr___printf__ __printf__ +#define gnu_attr_scanf scanf +#define gnu_attr___scanf__ __scanf__ +#define gnu_attr_strftime strftime +#define gnu_attr___strftime__ __strftime__ +#endif + +#if !defined (USE_SYSTEM_FORMATS) +#define USE_PRINTF(FMTPOS, WILDARG) __attribute__((format(gnu_printf, FMTPOS, WILDARG))) __attribute__((nonnull (FMTPOS))) +#define USE_SCANF(FMTPOS, WILDARG) __attribute__((format(gnu_scanf, FMTPOS, WILDARG))) __attribute__((nonnull (FMTPOS))) +#define USE_STRFTIME(FMTPOS) __attribute__((__format__(gnu_strftime, FMTPOS, 0))) __attribute__((nonnull (FMTPOS))) +#else +#define USE_PRINTF(FMTPOS, WILDARG) +#define USE_SCANF(FMTPOS, WILDARG) +#define USE_STRFTIME(FMTPOS) +#endif + #include <stdarg.h> #include <stddef.h> @@ -11,6 +42,20 @@ typedef __WINT_TYPE__ wint_t; #endif +#ifdef _WIN64 +/* Kludges to get types corresponding to size_t and ptrdiff_t. */ +#define unsigned signed +typedef signed int signed_size_t __attribute__ ((mode (DI))); +/* We also use this type to approximate ssize_t. */ +typedef signed int ssize_t __attribute__ ((mode (DI))); +#undef unsigned +#define signed /* Type might or might not have explicit 'signed'. */ +typedef unsigned int unsigned_ptrdiff_t __attribute__ ((mode (DI))); +#undef signed + +__extension__ typedef int llong __attribute__ ((mode (DI))); +__extension__ typedef unsigned int ullong __attribute__ ((mode (DI))); +#else /* Kludges to get types corresponding to size_t and ptrdiff_t. */ #define unsigned signed typedef __SIZE_TYPE__ signed_size_t; @@ -23,6 +68,7 @@ typedef unsigned __PTRDIFF_TYPE__ unsigned_ptrdiff_t; __extension__ typedef long long int llong; __extension__ typedef unsigned long long int ullong; +#endif /* %q formats want a "quad"; GCC considers this to be a long long. */ typedef llong quad_t; @@ -70,3 +116,77 @@ extern size_t strftime (char *restrict, size_t, const char *restrict, const struct tm *restrict); extern ssize_t strfmon (char *restrict, size_t, const char *restrict, ...); + +/* Mingw specific part. */ +#if !defined (USE_SYSTEM_FORMATS) && defined(_WIN32) && !defined(DONT_GNU_PROTOTYPE) + +extern USE_PRINTF(2,3) int fprintf_gnu (FILE *restrict, const char *restrict, ...); +#undef fprintf +#define fprintf fprintf_gnu + +extern USE_PRINTF(1,2) int printf_gnu (const char *restrict, ...); +#undef printf +#define printf printf_gnu + +extern USE_PRINTF(2,3) int fprintf_unlocked_gnu (FILE *restrict, const char *restrict, ...); +#undef fprintf_unlocked +#define fprintf_unlocked fprintf_unlocked_gnu + +extern USE_PRINTF(1,2)int printf_unlocked_gnu (const char *restrict, ...); +#undef printf_unlocked +#define printf_unlocked printf_unlocked_gnu + +extern USE_PRINTF(2,3) int sprintf_gnu (char *restrict, const char *restrict, ...); +#undef sprintf +#define sprintf sprintf_gnu + +extern USE_PRINTF(2,0) int vfprintf_gnu (FILE *restrict, const char *restrict, va_list); +#undef vsprintf +#define vsprintf vsprintf_gnu + +extern USE_PRINTF(1,0) int vprintf_gnu (const char *restrict, va_list); +#undef vprintf +#define vprintf vprintf_gnu + +extern USE_PRINTF(2,0) int vsprintf_gnu (char *restrict, const char *restrict, va_list); +#undef vsprintf +#define vsprintf vsprintf_gnu + +extern USE_PRINTF(3,4) int snprintf_gnu (char *restrict, size_t, const char *restrict, ...); +#undef snprintf +#define snprintf snprintf_gnu + +extern USE_PRINTF(3,0) int vsnprintf_gnu (char *restrict, size_t, const char *restrict, va_list); +#undef vsnprintf +#define vsnprintf vsnprintf_gnu + +extern USE_SCANF(2,3) int fscanf_gnu (FILE *restrict, const char *restrict, ...); +#undef fscanf +#define fscanf fscanf_gnu + +extern USE_SCANF(1,2) int scanf_gnu (const char *restrict, ...); +#undef scanf +#define scanf scanf_gnu + +extern USE_SCANF(2,3) int sscanf_gnu (const char *restrict, const char *restrict, ...); +#undef sscanf +#define sscanf sscanf_gnu + +extern USE_SCANF(2,0) int vfscanf_gnu (FILE *restrict, const char *restrict, va_list); +#undef vfscanf +#define vfscanf vfscanf_gnu + +extern USE_SCANF(1,0) int vscanf_gnu (const char *restrict, va_list); +#undef vscanf +#define vscanf vscanf_gnu + +extern USE_SCANF(2,0) int vsscanf_gnu (const char *restrict, const char *restrict, va_list); +#undef vsscanf +#define vsscanf vsscanf_gnu + +extern USE_STRFTIME(3) size_t strftime_gnu (char *restrict, size_t, const char *restrict, + const struct tm *restrict); +#undef strftime +#define strftime strftime_gnu + +#endif diff --git a/gcc/testsuite/gcc.dg/format/miss-1.c b/gcc/testsuite/gcc.dg/format/miss-1.c index 839f2963ae7..3d4b99124ef 100644 --- a/gcc/testsuite/gcc.dg/format/miss-1.c +++ b/gcc/testsuite/gcc.dg/format/miss-1.c @@ -23,7 +23,7 @@ bar (const char *fmt, ...) va_end (ap); } -__attribute__((__format__(__printf__, 1, 2))) void +__attribute__((__format__(gnu_attr___printf__, 1, 2))) void foo2 (const char *fmt, ...) { va_list ap; diff --git a/gcc/testsuite/gcc.dg/format/miss-3.c b/gcc/testsuite/gcc.dg/format/miss-3.c index c588bed3519..e9cf19d1f0a 100644 --- a/gcc/testsuite/gcc.dg/format/miss-3.c +++ b/gcc/testsuite/gcc.dg/format/miss-3.c @@ -3,13 +3,14 @@ /* { dg-do compile } */ /* { dg-options "-std=gnu99 -Wmissing-format-attribute" } */ +#define DONT_GNU_PROTOTYPE #include "format.h" typedef void (*noattr_t) (const char *, ...); -typedef noattr_t __attribute__ ((__format__(__printf__, 1, 2))) attr_t; +typedef noattr_t __attribute__ ((__format__(gnu_attr___printf__, 1, 2))) attr_t; typedef void (*vnoattr_t) (const char *, va_list); -typedef vnoattr_t __attribute__ ((__format__(__printf__, 1, 0))) vattr_t; +typedef vnoattr_t __attribute__ ((__format__(gnu_attr___printf__, 1, 0))) vattr_t; void foo1 (noattr_t na, attr_t a, vnoattr_t vna, vattr_t va) @@ -18,7 +19,7 @@ foo1 (noattr_t na, attr_t a, vnoattr_t vna, vattr_t va) noattr_t na2 = a; /* { dg-warning "candidate" "initialization warning" } */ attr_t a1 = na; attr_t a2 = a; - + vnoattr_t vna1 = vna; vnoattr_t vna2 = va; /* { dg-warning "candidate" "initialization warning" } */ vattr_t va1 = vna; diff --git a/gcc/testsuite/gcc.dg/format/miss-4.c b/gcc/testsuite/gcc.dg/format/miss-4.c index 9be5e4df4e5..f6cfd64cdbf 100644 --- a/gcc/testsuite/gcc.dg/format/miss-4.c +++ b/gcc/testsuite/gcc.dg/format/miss-4.c @@ -3,20 +3,21 @@ /* { dg-do compile } */ /* { dg-options "-std=gnu99 -Wmissing-format-attribute" } */ +#define DONT_GNU_PROTOTYPE #include "format.h" typedef void (*noattr_t) (const char *, ...); -typedef noattr_t __attribute__ ((__format__(__printf__, 1, 2))) attr_t; +typedef noattr_t __attribute__ ((__format__(gnu_attr___printf__, 1, 2))) attr_t; typedef void (*vnoattr_t) (const char *, va_list); -typedef vnoattr_t __attribute__ ((__format__(__printf__, 1, 0))) vattr_t; +typedef vnoattr_t __attribute__ ((__format__(gnu_attr___printf__, 1, 0))) vattr_t; void foo1 (noattr_t na, attr_t a, vnoattr_t vna, vattr_t va) { noattr_t na1, na2; attr_t a1, a2; - + vnoattr_t vna1, vna2; vattr_t va1, va2; @@ -24,7 +25,7 @@ foo1 (noattr_t na, attr_t a, vnoattr_t vna, vattr_t va) na2 = a; /* { dg-warning "candidate" "assignment warning" } */ a1 = na; a2 = a; - + vna1 = vna; vna2 = va; /* { dg-warning "candidate" "assignment warning" } */ va1 = vna; diff --git a/gcc/testsuite/gcc.dg/format/miss-5.c b/gcc/testsuite/gcc.dg/format/miss-5.c index eaf1473ddc1..1706e369b02 100644 --- a/gcc/testsuite/gcc.dg/format/miss-5.c +++ b/gcc/testsuite/gcc.dg/format/miss-5.c @@ -3,13 +3,14 @@ /* { dg-do compile } */ /* { dg-options "-std=gnu99 -Wmissing-format-attribute" } */ +#define DONT_GNU_PROTOTYPE #include "format.h" typedef void (*noattr_t) (const char *, ...); -typedef noattr_t __attribute__ ((__format__(__printf__, 1, 2))) attr_t; +typedef noattr_t __attribute__ ((__format__(gnu_attr___printf__, 1, 2))) attr_t; typedef void (*vnoattr_t) (const char *, va_list); -typedef vnoattr_t __attribute__ ((__format__(__printf__, 1, 0))) vattr_t; +typedef vnoattr_t __attribute__ ((__format__(gnu_attr___printf__, 1, 0))) vattr_t; noattr_t foo1 (noattr_t na, attr_t a, int i) diff --git a/gcc/testsuite/gcc.dg/format/miss-6.c b/gcc/testsuite/gcc.dg/format/miss-6.c index abe221f917f..77e287465e8 100644 --- a/gcc/testsuite/gcc.dg/format/miss-6.c +++ b/gcc/testsuite/gcc.dg/format/miss-6.c @@ -3,13 +3,14 @@ /* { dg-do compile } */ /* { dg-options "-std=gnu99 -Wmissing-format-attribute" } */ +#define DONT_GNU_PROTOTYPE #include "format.h" typedef void (*noattr_t) (const char *, ...); -typedef noattr_t __attribute__ ((__format__(__printf__, 1, 2))) attr_t; +typedef noattr_t __attribute__ ((__format__(gnu_attr___printf__, 1, 2))) attr_t; typedef void (*vnoattr_t) (const char *, va_list); -typedef vnoattr_t __attribute__ ((__format__(__printf__, 1, 0))) vattr_t; +typedef vnoattr_t __attribute__ ((__format__(gnu_attr___printf__, 1, 0))) vattr_t; extern void foo1 (noattr_t); extern void foo2 (attr_t); @@ -23,7 +24,7 @@ foo (noattr_t na, attr_t a, vnoattr_t vna, vattr_t va) foo1 (a); /* { dg-warning "candidate" "parameter passing warning" } */ foo2 (na); foo2 (a); - + foo3 (vna); foo3 (va); /* { dg-warning "candidate" "parameter passing warning" } */ foo4 (vna); diff --git a/gcc/testsuite/gcc.dg/format/ms_array-1.c b/gcc/testsuite/gcc.dg/format/ms_array-1.c new file mode 100644 index 00000000000..b34506830bb --- /dev/null +++ b/gcc/testsuite/gcc.dg/format/ms_array-1.c @@ -0,0 +1,42 @@ +/* Test for format checking of constant arrays. */ +/* Origin: Joseph Myers <jsm28@cam.ac.uk> */ +/* { dg-do compile { target { *-*-mingw* } } } */ +/* { dg-options "-std=gnu99 -Wformat=2" } */ + +#define USE_SYSTEM_FORMATS +#include "format.h" + +const char a1[] = "foo"; +const char a2[] = "foo%d"; +const char b1[3] = "foo"; +const char b2[1] = "1"; +static const char c1[] = "foo"; +static const char c2[] = "foo%d"; +char d[] = "foo"; +volatile const char e[] = "foo"; + +void +foo (int i, long l) +{ + const char p1[] = "bar"; + const char p2[] = "bar%d"; + static const char q1[] = "bar"; + static const char q2[] = "bar%d"; + printf (a1); + printf (a2, i); + printf (a2, l); /* { dg-warning "format" "wrong type with array" } */ + printf (b1); /* { dg-warning "unterminated" "unterminated array" } */ + printf (b2); /* { dg-warning "unterminated" "unterminated array" } */ + printf (c1); + printf (c2, i); + printf (c2, l); /* { dg-warning "format" "wrong type with array" } */ + printf (p1); + printf (p2, i); + printf (p2, l); /* { dg-warning "format" "wrong type with array" } */ + printf (q1); + printf (q2, i); + printf (q2, l); /* { dg-warning "format" "wrong type with array" } */ + /* Volatile or non-constant arrays must not be checked. */ + printf (d); /* { dg-warning "not a string literal" "non-const" } */ + printf ((const char *)e); /* { dg-warning "not a string literal" "volatile" } */ +} diff --git a/gcc/testsuite/gcc.dg/format/ms_attr-1.c b/gcc/testsuite/gcc.dg/format/ms_attr-1.c new file mode 100644 index 00000000000..90709bb1fb0 --- /dev/null +++ b/gcc/testsuite/gcc.dg/format/ms_attr-1.c @@ -0,0 +1,10 @@ +/* Test for strftime format attributes: can't have first_arg_num != 0. */ +/* Origin: Joseph Myers <jsm28@cam.ac.uk> */ +/* { dg-do compile { target { *-*-mingw* } } } */ +/* { dg-options "-std=gnu99 -Wformat" } */ + +#define DONT_GNU_PROTOTYPE +#include "format.h" + +extern void foo0 (const char *) __attribute__((__format__(__ms_strftime__, 1, 0))); +extern void foo1 (const char *, ...) __attribute__((__format__(__ms_strftime__, 1, 2))); /* { dg-error "cannot format" "strftime first_arg_num != 0" } */ diff --git a/gcc/testsuite/gcc.dg/format/ms_attr-2.c b/gcc/testsuite/gcc.dg/format/ms_attr-2.c new file mode 100644 index 00000000000..9a9ce0fe355 --- /dev/null +++ b/gcc/testsuite/gcc.dg/format/ms_attr-2.c @@ -0,0 +1,68 @@ +/* Test for format attributes: test use of __attribute__. */ +/* Origin: Joseph Myers <jsm28@cam.ac.uk> */ +/* { dg-do compile { target { *-*-mingw* } } } */ +/* { dg-options "-std=gnu99 -Wformat" } */ + +#define DONT_GNU_PROTOTYPE +#include "format.h" + +extern void tformatprintf (const char *, ...) __attribute__((format(ms_printf, 1, 2))); +extern void tformat__printf__ (const char *, ...) __attribute__((format(__ms_printf__, 1, 2))); +extern void tformatscanf (const char *, ...) __attribute__((format(ms_scanf, 1, 2))); +extern void tformat__scanf__ (const char *, ...) __attribute__((format(__ms_scanf__, 1, 2))); +extern void tformatstrftime (const char *) __attribute__((format(ms_strftime, 1, 0))); +extern void tformat__strftime__ (const char *) __attribute__((format(__ms_strftime__, 1, 0))); +extern void tformatstrfmon (const char *, ...) __attribute__((format(strfmon, 1, 2))); +extern void tformat__strfmon__ (const char *, ...) __attribute__((format(__strfmon__, 1, 2))); +extern void t__format__printf (const char *, ...) __attribute__((__format__(ms_printf, 1, 2))); +extern void t__format____printf__ (const char *, ...) __attribute__((__format__(__ms_printf__, 1, 2))); +extern void t__format__scanf (const char *, ...) __attribute__((__format__(ms_scanf, 1, 2))); +extern void t__format____scanf__ (const char *, ...) __attribute__((__format__(__ms_scanf__, 1, 2))); +extern void t__format__strftime (const char *) __attribute__((__format__(ms_strftime, 1, 0))); +extern void t__format____strftime__ (const char *) __attribute__((__format__(__ms_strftime__, 1, 0))); +extern void t__format__strfmon (const char *, ...) __attribute__((__format__(strfmon, 1, 2))); +extern void t__format____strfmon__ (const char *, ...) __attribute__((__format__(__strfmon__, 1, 2))); + +extern char *tformat_arg (const char *) __attribute__((format_arg(1))); +extern char *t__format_arg__ (const char *) __attribute__((__format_arg__(1))); + +void +foo (int i, int *ip, double d) +{ + tformatprintf ("%d", i); + tformatprintf ("%"); /* { dg-warning "format" "attribute format printf" } */ + tformat__printf__ ("%d", i); + tformat__printf__ ("%"); /* { dg-warning "format" "attribute format __printf__" } */ + tformatscanf ("%d", ip); + tformatscanf ("%"); /* { dg-warning "format" "attribute format scanf" } */ + tformat__scanf__ ("%d", ip); + tformat__scanf__ ("%"); /* { dg-warning "format" "attribute format __scanf__" } */ + tformatstrftime ("%a"); + tformatstrftime ("%"); /* { dg-warning "format" "attribute format strftime" } */ + tformat__strftime__ ("%a"); + tformat__strftime__ ("%"); /* { dg-warning "format" "attribute format __strftime__" } */ + tformatstrfmon ("%n", d); + tformatstrfmon ("%"); /* { dg-warning "format" "attribute format strfmon" } */ + tformat__strfmon__ ("%n", d); + tformat__strfmon__ ("%"); /* { dg-warning "format" "attribute format __strfmon__" } */ + t__format__printf ("%d", i); + t__format__printf ("%"); /* { dg-warning "format" "attribute __format__ printf" } */ + t__format____printf__ ("%d", i); + t__format____printf__ ("%"); /* { dg-warning "format" "attribute __format__ __printf__" } */ + t__format__scanf ("%d", ip); + t__format__scanf ("%"); /* { dg-warning "format" "attribute __format__ scanf" } */ + t__format____scanf__ ("%d", ip); + t__format____scanf__ ("%"); /* { dg-warning "format" "attribute __format__ __scanf__" } */ + t__format__strftime ("%a"); + t__format__strftime ("%"); /* { dg-warning "format" "attribute __format__ strftime" } */ + t__format____strftime__ ("%a"); + t__format____strftime__ ("%"); /* { dg-warning "format" "attribute __format__ __strftime__" } */ + t__format__strfmon ("%n", d); + t__format__strfmon ("%"); /* { dg-warning "format" "attribute __format__ strfmon" } */ + t__format____strfmon__ ("%n", d); + t__format____strfmon__ ("%"); /* { dg-warning "format" "attribute __format__ __strfmon__" } */ + tformatprintf (tformat_arg ("%d"), i); + tformatprintf (tformat_arg ("%")); /* { dg-warning "format" "attribute format_arg" } */ + tformatprintf (t__format_arg__ ("%d"), i); + tformatprintf (t__format_arg__ ("%")); /* { dg-warning "format" "attribute __format_arg__" } */ +} diff --git a/gcc/testsuite/gcc.dg/format/ms_attr-3.c b/gcc/testsuite/gcc.dg/format/ms_attr-3.c new file mode 100644 index 00000000000..5341dd8164b --- /dev/null +++ b/gcc/testsuite/gcc.dg/format/ms_attr-3.c @@ -0,0 +1,71 @@ +/* Test for format attributes: test bad uses of __attribute__. */ +/* Origin: Joseph Myers <jsm28@cam.ac.uk> */ +/* { dg-do compile { target { *-*-mingw* } } } */ +/* { dg-options "-std=gnu99 -Wformat" } */ + +#define USE_SYSTEM_FORMATS +#include "format.h" + +/* Proper uses of the attributes. */ +extern void fa0 (const char *, ...) __attribute__((format(ms_printf, 1, 2))); +extern void fa1 (char *, ...) __attribute__((format(ms_printf, 1, 2))); +extern char *fa2 (const char *) __attribute__((format_arg(1))); +extern char *fa3 (char *) __attribute__((format_arg(1))); + +/* Uses with too few or too many arguments. */ +extern void fb0 (const char *, ...) __attribute__((format)); /* { dg-error "wrong number of arguments" "bad format" } */ +extern void fb1 (const char *, ...) __attribute__((format())); /* { dg-error "wrong number of arguments" "bad format" } */ +extern void fb2 (const char *, ...) __attribute__((format(ms_printf))); /* { dg-error "wrong number of arguments" "bad format" } */ +extern void fb3 (const char *, ...) __attribute__((format(ms_printf, 1))); /* { dg-error "wrong number of arguments" "bad format" } */ +extern void fb4 (const char *, ...) __attribute__((format(ms_printf, 1, 2, 3))); /* { dg-error "wrong number of arguments" "bad format" } */ + +extern void fc1 (const char *) __attribute__((format_arg)); /* { dg-error "wrong number of arguments" "bad format_arg" } */ +extern void fc2 (const char *) __attribute__((format_arg())); /* { dg-error "wrong number of arguments" "bad format_arg" } */ +extern void fc3 (const char *) __attribute__((format_arg(1, 2))); /* { dg-error "wrong number of arguments" "bad format_arg" } */ + +/* These attributes presently only apply to declarations, not to types. + Eventually, they should be usable with declarators for function types + anywhere, but still not with structure/union/enum types. */ +struct s0 { int i; } __attribute__((format(ms_printf, 1, 2))); /* { dg-error "does not apply|only applies" "format on struct" } */ +union u0 { int i; } __attribute__((format(ms_printf, 1, 2))); /* { dg-error "does not apply|only applies" "format on union" } */ +enum e0 { E0V0 } __attribute__((format(ms_printf, 1, 2))); /* { dg-error "does not apply|only applies" "format on enum" } */ + +struct s1 { int i; } __attribute__((format_arg(1))); /* { dg-error "does not apply|only applies" "format_arg on struct" } */ +union u1 { int i; } __attribute__((format_arg(1))); /* { dg-error "does not apply|only applies" "format_arg on union" } */ +enum e1 { E1V0 } __attribute__((format_arg(1))); /* { dg-error "does not apply|only applies" "format_arg on enum" } */ + +/* The format type must be an identifier, one of those recognized. */ +extern void fe0 (const char *, ...) __attribute__((format(12345, 1, 2))); /* { dg-error "format specifier" "non-id format" } */ +extern void fe1 (const char *, ...) __attribute__((format(nosuch, 1, 2))); /* { dg-warning "format function type" "unknown format" } */ + +/* Both the numbers must be integer constant expressions. */ +extern void ff0 (const char *, ...) __attribute__((format(ms_printf, 3-2, (long long)(10/5)))); +int foo; +extern void ff1 (const char *, ...) __attribute__((format(ms_printf, foo, 10/5))); /* { dg-error "invalid operand" "bad number" } */ +extern void ff2 (const char *, ...) __attribute__((format(ms_printf, 3-2, foo))); /* { dg-error "invalid operand" "bad number" } */ +extern char *ff3 (const char *) __attribute__((format_arg(3-2))); +extern char *ff4 (const char *) __attribute__((format_arg(foo))); /* { dg-error "invalid operand" "bad format_arg number" } */ + +/* The format string argument must precede the arguments to be formatted. + This includes if no parameter types are specified (which is not valid ISO + C for variadic functions). */ +extern void fg0 () __attribute__((format(ms_printf, 1, 2))); +extern void fg1 () __attribute__((format(ms_printf, 1, 0))); +extern void fg2 () __attribute__((format(ms_printf, 1, 1))); /* { dg-error "follows" "bad number order" } */ +extern void fg3 () __attribute__((format(ms_printf, 2, 1))); /* { dg-error "follows" "bad number order" } */ + +/* The format string argument must be a string type, and the arguments to + be formatted must be the "...". */ +extern void fh0 (int, ...) __attribute__((format(ms_printf, 1, 2))); /* { dg-error "not a string" "format int string" } */ +extern void fh1 (signed char *, ...) __attribute__((format(ms_printf, 1, 2))); /* { dg-error "not a string" "signed char string" } */ +extern void fh2 (unsigned char *, ...) __attribute__((format(ms_printf, 1, 2))); /* { dg-error "not a string" "unsigned char string" } */ +extern void fh3 (const char *, ...) __attribute__((format(ms_printf, 1, 3))); /* { dg-error "is not" "not ..." } */ +extern void fh4 (const char *, int, ...) __attribute__((format(ms_printf, 1, 2))); /* { dg-error "is not" "not ..." } */ + +/* format_arg formats must take and return a string. */ +extern char *fi0 (int) __attribute__((format_arg(1))); /* { dg-error "not a string" "format_arg int string" } */ +extern char *fi1 (signed char *) __attribute__((format_arg(1))); /* { dg-error "not a string" "format_arg signed char string" } */ +extern char *fi2 (unsigned char *) __attribute__((format_arg(1))); /* { dg-error "not a string" "format_arg unsigned char string" } */ +extern int fi3 (const char *) __attribute__((format_arg(1))); /* { dg-error "not return string" "format_arg ret int string" } */ +extern signed char *fi4 (const char *) __attribute__((format_arg(1))); /* { dg-error "not return string" "format_arg ret signed char string" } */ +extern unsigned char *fi5 (const char *) __attribute__((format_arg(1))); /* { dg-error "not return string" "format_arg ret unsigned char string" } */ diff --git a/gcc/testsuite/gcc.dg/format/ms_attr-4.c b/gcc/testsuite/gcc.dg/format/ms_attr-4.c new file mode 100644 index 00000000000..45f09ef2278 --- /dev/null +++ b/gcc/testsuite/gcc.dg/format/ms_attr-4.c @@ -0,0 +1,26 @@ +/* Test for format attributes: test use of __attribute__ + in prefix attributes. */ +/* Origin: Joseph Myers <jsm28@cam.ac.uk> */ +/* { dg-do compile { target { *-*-mingw* } } } */ +/* { dg-options "-std=gnu99 -Wformat" } */ + +#define USE_SYSTEM_FORMATS +#include "format.h" + +extern __attribute__((format(ms_printf, 1, 2))) void tformatprintf0 (const char *, ...); +extern void __attribute__((format(ms_printf, 1, 2))) tformatprintf1 (const char *, ...); +extern void foo (void), __attribute__((format(ms_printf, 1, 2))) tformatprintf2 (const char *, ...); +extern __attribute__((noreturn)) void bar (void), __attribute__((format(ms_printf, 1, 2))) tformatprintf3 (const char *, ...); + +void +baz (int i, int *ip, double d) +{ + tformatprintf0 ("%d", i); + tformatprintf0 ("%"); /* { dg-warning "format" "attribute format printf case 0" } */ + tformatprintf1 ("%d", i); + tformatprintf1 ("%"); /* { dg-warning "format" "attribute format printf case 1" } */ + tformatprintf2 ("%d", i); + tformatprintf2 ("%"); /* { dg-warning "format" "attribute format printf case 2" } */ + tformatprintf3 ("%d", i); + tformatprintf3 ("%"); /* { dg-warning "format" "attribute format printf case 3" } */ +} diff --git a/gcc/testsuite/gcc.dg/format/ms_attr-7.c b/gcc/testsuite/gcc.dg/format/ms_attr-7.c new file mode 100644 index 00000000000..b169e2c3ab5 --- /dev/null +++ b/gcc/testsuite/gcc.dg/format/ms_attr-7.c @@ -0,0 +1,35 @@ +/* Test for format attributes: test applying them to types. */ +/* Origin: Joseph Myers <jsm28@cam.ac.uk> */ +/* { dg-do compile { target { *-*-mingw* } } } */ +/* { dg-options "-std=gnu99 -Wformat" } */ + +#define DONT_GNU_PROTOTYPE +#include "format.h" + +__attribute__((format(ms_printf, 1, 2))) void (*tformatprintf0) (const char *, ...); +void (*tformatprintf1) (const char *, ...) __attribute__((format(ms_printf, 1, 2))); +void (__attribute__((format(ms_printf, 1, 2))) *tformatprintf2) (const char *, ...); +void (__attribute__((format(ms_printf, 1, 2))) ****tformatprintf3) (const char *, ...); + +char * (__attribute__((format_arg(1))) *tformat_arg) (const char *); + +void +baz (int i) +{ + (*tformatprintf0) ("%d", i); + (*tformatprintf0) ((*tformat_arg) ("%d"), i); + (*tformatprintf0) ("%"); /* { dg-warning "format" "prefix" } */ + (*tformatprintf0) ((*tformat_arg) ("%")); /* { dg-warning "format" "prefix" } */ + (*tformatprintf1) ("%d", i); + (*tformatprintf1) ((*tformat_arg) ("%d"), i); + (*tformatprintf1) ("%"); /* { dg-warning "format" "postfix" } */ + (*tformatprintf1) ((*tformat_arg) ("%")); /* { dg-warning "format" "postfix" } */ + (*tformatprintf2) ("%d", i); + (*tformatprintf2) ((*tformat_arg) ("%d"), i); + (*tformatprintf2) ("%"); /* { dg-warning "format" "nested" } */ + (*tformatprintf2) ((*tformat_arg) ("%")); /* { dg-warning "format" "nested" } */ + (****tformatprintf3) ("%d", i); + (****tformatprintf3) ((*tformat_arg) ("%d"), i); + (****tformatprintf3) ("%"); /* { dg-warning "format" "nested 2" } */ + (****tformatprintf3) ((*tformat_arg) ("%")); /* { dg-warning "format" "nested 2" } */ +} diff --git a/gcc/testsuite/gcc.dg/format/ms_bitfld-1.c b/gcc/testsuite/gcc.dg/format/ms_bitfld-1.c new file mode 100644 index 00000000000..83eb2fec625 --- /dev/null +++ b/gcc/testsuite/gcc.dg/format/ms_bitfld-1.c @@ -0,0 +1,52 @@ +/* Test for printf formats and bit-fields: bug 22421. */ +/* Origin: Joseph Myers <joseph@codesourcery.com> */ +/* { dg-do compile { target { *-*-mingw* } } } */ +/* { dg-options "-std=gnu99 -Wformat" } */ +/* { dg-require-effective-target int32plus } */ + +#define USE_SYSTEM_FORMATS +#include "format.h" + +struct s { + unsigned int u1 : 1; + signed int s1 : 1; + unsigned int u15 : 15; + signed int s15 : 15; + unsigned int u16 : 16; + signed int s16 : 16; + unsigned long u31 : 31; + signed long s31 : 31; + unsigned long u32 : 32; + signed long s32 : 32; + unsigned long long u48 : 48; +} x; + +void +foo (void) +{ + printf ("%d%u", x.u1, x.u1); + printf ("%d%u", x.s1, x.s1); + printf ("%d%u", x.u15, x.u15); + printf ("%d%u", x.s15, x.s15); + printf ("%d%u", x.u16, x.u16); + printf ("%d%u", x.s16, x.s16); +#if __INT_MAX__ > 32767 + /* If integers are 16 bits, there doesn't seem to be a way of + printing these without getting an error. */ + printf ("%d%u", x.u31, x.u31); + printf ("%d%u", x.s31, x.s31); +#endif +#if __LONG_MAX__ > 2147483647 && __INT_MAX__ >= 2147483647 + /* If long is wider than 32 bits, the 32-bit bit-fields are int or + unsigned int or promote to those types. Otherwise, long is 32 + bits and the bit-fields are of type plain long or unsigned + long. */ + printf ("%d%u", x.u32, x.u32); + printf ("%d%u", x.s32, x.s32); +#else + printf ("%ld%lu", x.u32, x.u32); + printf ("%ld%lu", x.s32, x.s32); +#endif + printf ("%I64u", x.u48); /* { dg-warning "has type '.*unsigned int:48'" } */ + printf ("%I64u", (unsigned long long)x.u48); +} diff --git a/gcc/testsuite/gcc.dg/format/ms_branch-1.c b/gcc/testsuite/gcc.dg/format/ms_branch-1.c new file mode 100644 index 00000000000..fe3f80e57d5 --- /dev/null +++ b/gcc/testsuite/gcc.dg/format/ms_branch-1.c @@ -0,0 +1,28 @@ +/* Test for format checking of conditional expressions. */ +/* Origin: Joseph Myers <jsm28@cam.ac.uk> */ +/* { dg-do compile { target { *-*-mingw* } } } */ +/* { dg-options "-std=gnu99 -Wformat" } */ + +#define USE_SYSTEM_FORMATS +#include "format.h" + +void +foo (long l, int nfoo) +{ + printf ((nfoo > 1) ? "%d foos" : "%d foo", nfoo); + printf ((l > 1) ? "%d foos" : "%d foo", l); /* { dg-warning "int" "wrong type in conditional expr" } */ + printf ((l > 1) ? "%ld foos" : "%d foo", l); /* { dg-warning "int" "wrong type in conditional expr" } */ + printf ((l > 1) ? "%d foos" : "%ld foo", l); /* { dg-warning "int" "wrong type in conditional expr" } */ + /* Should allow one case to have extra arguments. */ + printf ((nfoo > 1) ? "%d foos" : "1 foo", nfoo); + printf ((nfoo > 1) ? "many foos" : "1 foo", nfoo); /* { dg-warning "too many" "too many args in all branches" } */ + printf ((nfoo > 1) ? "%d foos" : "", nfoo); + printf ((nfoo > 1) ? "%d foos" : ((nfoo > 0) ? "1 foo" : "no foos"), nfoo); + printf ((nfoo > 1) ? "%d foos" : ((nfoo > 0) ? "%d foo" : "%d foos"), nfoo); + printf ((nfoo > 1) ? "%d foos" : ((nfoo > 0) ? "%d foo" : "%ld foos"), nfoo); /* { dg-warning "long int" "wrong type" } */ + printf ((nfoo > 1) ? "%ld foos" : ((nfoo > 0) ? "%d foo" : "%d foos"), nfoo); /* { dg-warning "long int" "wrong type" } */ + printf ((nfoo > 1) ? "%d foos" : ((nfoo > 0) ? "%ld foo" : "%d foos"), nfoo); /* { dg-warning "long int" "wrong type" } */ + /* Extra arguments to NULL should be complained about. */ + printf (NULL, "foo"); /* { dg-warning "too many" "NULL extra args" } */ + /* { dg-warning "null" "null format arg" { target *-*-* } 26 } */ +} diff --git a/gcc/testsuite/gcc.dg/format/ms_c90-printf-1.c b/gcc/testsuite/gcc.dg/format/ms_c90-printf-1.c new file mode 100644 index 00000000000..f99d4c49db9 --- /dev/null +++ b/gcc/testsuite/gcc.dg/format/ms_c90-printf-1.c @@ -0,0 +1,184 @@ +/* Test for printf formats. Formats using C90 features, including cases + where C90 specifies some aspect of the format to be ignored or where + the behavior is undefined. +*/ +/* Origin: Joseph Myers <jsm28@cam.ac.uk> */ +/* { dg-do compile { target { *-*-mingw* } } } */ +/* { dg-options "-std=iso9899:1990 -pedantic -Wformat" } */ + +#define USE_SYSTEM_FORMATS +#include "format.h" + +void +foo (int i, int i1, int i2, unsigned int u, double d, char *s, void *p, + int *n, short int *hn, long int l, unsigned long int ul, + long int *ln, long double ld, wint_t lc, wchar_t *ls, llong ll, + ullong ull, unsigned int *un, const int *cn, signed char *ss, + unsigned char *us, const signed char *css, unsigned int u1, + unsigned int u2) +{ + /* See ISO/IEC 9899:1990 (E) subclause 7.9.6.1 (pages 131-134). */ + /* Basic sanity checks for the different components of a format. */ + printf ("%d\n", i); + printf ("%+d\n", i); + printf ("%3d\n", i); + printf ("%-3d\n", i); + printf ("%*d\n", i1, i); + printf ("%d %lu\n", i, ul); + /* Bogus use of width. */ + printf ("%5n\n", n); /* { dg-warning "width" "width with %n" } */ + /* Valid and invalid %% constructions. Some of the warning messages + are non-optimal, but they do detect the errorneous nature of the + format string. + */ + printf ("%%"); + printf ("%-%"); /* { dg-warning "format" "bogus %%" } */ + printf ("%-%\n"); /* { dg-warning "format" "bogus %%" } */ + printf ("%5%\n"); /* { dg-warning "format" "bogus %%" } */ + printf ("%h%\n"); /* { dg-warning "format" "bogus %%" } */ + /* Valid and invalid %h, %l, %L constructions. */ + printf ("%hd", i); + printf ("%hi", i); + /* Strictly, these parameters should be int or unsigned int according to + what unsigned short promotes to. However, GCC ignores sign + differences in format checking here, and this is relied on to get the + correct checking without print_char_table needing to know whether + int and short are the same size. + */ + printf ("%ho%hu%hx%hX", u, u, u, u); + printf ("%hn", hn); + printf ("%hf", d); /* { dg-warning "length" "bad use of %h" } */ + printf ("%he", d); /* { dg-warning "length" "bad use of %h" } */ + printf ("%hE", d); /* { dg-warning "length" "bad use of %h" } */ + printf ("%hg", d); /* { dg-warning "length" "bad use of %h" } */ + printf ("%hG", d); /* { dg-warning "length" "bad use of %h" } */ + printf ("%hc", i); + printf ("%hs", hn); + printf ("%hp", p); /* { dg-warning "length" "bad use of %h" } */ + printf ("%h"); /* { dg-warning "conversion lacks type" "bare %h" } */ + printf ("%ld%li%lo%lu%lx%lX", l, l, ul, ul, ul, ul); + printf ("%ln", ln); + printf ("%lf", d); /* { dg-warning "length|C" "bad use of %l" } */ + printf ("%le", d); /* { dg-warning "length|C" "bad use of %l" } */ + printf ("%lE", d); /* { dg-warning "length|C" "bad use of %l" } */ + printf ("%lg", d); /* { dg-warning "length|C" "bad use of %l" } */ + printf ("%lG", d); /* { dg-warning "length|C" "bad use of %l" } */ + printf ("%lp", p); /* { dg-warning "length|C" "bad use of %l" } */ + /* These next two were added in C94, but should be objected to in C90. + For the first one, GCC has wanted wchar_t instead of the correct C94 + and C99 wint_t. + */ + printf ("%lc", lc); /* { dg-warning "length|C" "C90 bad use of %l" } */ + printf ("%ls", ls); /* { dg-warning "length|C" "C90 bad use of %l" } */ + /* Valid uses of each bare conversion. */ + printf ("%d%i%o%u%x%X%f%e%E%g%G%c%s%p%n%%", i, i, u, u, u, u, d, d, d, d, d, + i, s, p, n); + /* Uses of the - flag (valid on all non-%, non-n conversions). */ + printf ("%-d%-i%-o%-u%-x%-X%-f%-e%-E%-g%-G%-c%-s%-p", i, i, u, u, u, u, + d, d, d, d, d, i, s, p); + printf ("%-n", n); /* { dg-warning "flag" "bad use of %-n" } */ + /* Uses of the + flag (valid on signed conversions only). */ + printf ("%+d%+i%+f%+e%+E%+g%+G\n", i, i, d, d, d, d, d); + printf ("%+o", u); /* { dg-warning "flag" "bad use of + flag" } */ + printf ("%+u", u); /* { dg-warning "flag" "bad use of + flag" } */ + printf ("%+x", u); /* { dg-warning "flag" "bad use of + flag" } */ + printf ("%+X", u); /* { dg-warning "flag" "bad use of + flag" } */ + printf ("%+c", i); /* { dg-warning "flag" "bad use of + flag" } */ + printf ("%+s", s); /* { dg-warning "flag" "bad use of + flag" } */ + printf ("%+p", p); /* { dg-warning "flag" "bad use of + flag" } */ + printf ("%+n", n); /* { dg-warning "flag" "bad use of + flag" } */ + /* Uses of the space flag (valid on signed conversions only, and ignored + with +). + */ + printf ("% +d", i); /* { dg-warning "use of both|ignored" "use of space and + flags" } */ + printf ("%+ d", i); /* { dg-warning "use of both|ignored" "use of space and + flags" } */ + printf ("% d% i% f% e% E% g% G\n", i, i, d, d, d, d, d); + printf ("% o", u); /* { dg-warning "flag" "bad use of space flag" } */ + printf ("% u", u); /* { dg-warning "flag" "bad use of space flag" } */ + printf ("% x", u); /* { dg-warning "flag" "bad use of space flag" } */ + printf ("% X", u); /* { dg-warning "flag" "bad use of space flag" } */ + printf ("% c", i); /* { dg-warning "flag" "bad use of space flag" } */ + printf ("% s", s); /* { dg-warning "flag" "bad use of space flag" } */ + printf ("% p", p); /* { dg-warning "flag" "bad use of space flag" } */ + printf ("% n", n); /* { dg-warning "flag" "bad use of space flag" } */ + /* Uses of the # flag. */ + printf ("%#o%#x%#X%#e%#E%#f%#g%#G", u, u, u, d, d, d, d, d); + printf ("%#d", i); /* { dg-warning "flag" "bad use of # flag" } */ + printf ("%#i", i); /* { dg-warning "flag" "bad use of # flag" } */ + printf ("%#u", u); /* { dg-warning "flag" "bad use of # flag" } */ + printf ("%#c", i); /* { dg-warning "flag" "bad use of # flag" } */ + printf ("%#s", s); /* { dg-warning "flag" "bad use of # flag" } */ + printf ("%#p", p); /* { dg-warning "flag" "bad use of # flag" } */ + printf ("%#n", n); /* { dg-warning "flag" "bad use of # flag" } */ + /* Uses of the 0 flag. */ + printf ("%08d%08i%08o%08u%08x%08X%08e%08E%08f%08g%08G", i, i, u, u, u, u, + d, d, d, d, d); + printf ("%0c", i); /* { dg-warning "flag" "bad use of 0 flag" } */ + printf ("%0s", s); /* { dg-warning "flag" "bad use of 0 flag" } */ + printf ("%0p", p); /* { dg-warning "flag" "bad use of 0 flag" } */ + printf ("%0n", n); /* { dg-warning "flag" "bad use of 0 flag" } */ + /* 0 flag ignored with - flag. */ + printf ("%-08d", i); /* { dg-warning "flags|ignored" "0 flag ignored with - flag" } */ + printf ("%-08i", i); /* { dg-warning "flags|ignored" "0 flag ignored with - flag" } */ + printf ("%-08o", u); /* { dg-warning "flags|ignored" "0 flag ignored with - flag" } */ + printf ("%-08u", u); /* { dg-warning "flags|ignored" "0 flag ignored with - flag" } */ + printf ("%-08x", u); /* { dg-warning "flags|ignored" "0 flag ignored with - flag" } */ + printf ("%-08X", u); /* { dg-warning "flags|ignored" "0 flag ignored with - flag" } */ + printf ("%-08e", d); /* { dg-warning "flags|ignored" "0 flag ignored with - flag" } */ + printf ("%-08E", d); /* { dg-warning "flags|ignored" "0 flag ignored with - flag" } */ + printf ("%-08f", d); /* { dg-warning "flags|ignored" "0 flag ignored with - flag" } */ + printf ("%-08g", d); /* { dg-warning "flags|ignored" "0 flag ignored with - flag" } */ + printf ("%-08G", d); /* { dg-warning "flags|ignored" "0 flag ignored with - flag" } */ + /* Various tests of bad argument types. */ + printf ("%d", l); /* { dg-warning "format" "bad argument types" } */ + printf ("%ld", i); /* { dg-warning "format" "bad argument types" } */ + printf ("%s", n); /* { dg-warning "format" "bad argument types" } */ + printf ("%p", i); /* { dg-warning "format" "bad argument types" } */ + printf ("%n", p); /* { dg-warning "format" "bad argument types" } */ + /* With -pedantic, we want some further checks for pointer targets: + %p should allow only pointers to void (possibly qualified) and + to character types (possibly qualified), but not function pointers + or pointers to other types. (Whether, in fact, character types are + allowed here is unclear; see thread on comp.std.c, July 2000 for + discussion of the requirements of rules on identical representation, + and of the application of the as if rule with the new va_arg + allowances in C99 to printf.) Likewise, we should warn if + pointer targets differ in signedness, except in some circumstances + for character pointers. (In C99 we should consider warning for + char * or unsigned char * being passed to %hhn, even if strictly + legitimate by the standard.) + */ + printf ("%p", foo); /* { dg-warning "format" "bad argument types" } */ + printf ("%n", un); /* { dg-warning "format" "bad argument types" } */ + printf ("%p", n); /* { dg-warning "format" "bad argument types" } */ + /* Allow character pointers with %p. */ + printf ("%p%p%p%p", s, ss, us, css); + /* %s allows any character type. */ + printf ("%s%s%s%s", s, ss, us, css); + /* Warning for void * arguments for %s is GCC's historical behavior, + and seems useful to keep, even if some standard versions might be + read to permit it. + */ + printf ("%s", p); /* { dg-warning "format" "bad argument types" } */ + /* The historical behavior is to allow signed / unsigned types + interchangably as arguments. For values representable in both types, + such usage may be correct. For now preserve the behavior of GCC + in such cases. + */ + printf ("%d", u); + /* Wrong number of arguments. */ + printf ("%d%d", i); /* { dg-warning "arguments" "wrong number of args" } */ + printf ("%d", i, i); /* { dg-warning "arguments" "wrong number of args" } */ + /* Miscellaneous bogus constructions. */ + printf (""); /* { dg-warning "zero-length" "warning for empty format" } */ + printf ("\0"); /* { dg-warning "embedded" "warning for embedded NUL" } */ + printf ("%d\0", i); /* { dg-warning "embedded" "warning for embedded NUL" } */ + printf ("%d\0%d", i, i); /* { dg-warning "embedded|too many" "warning for embedded NUL" } */ + printf (NULL); /* { dg-warning "null" "null format string warning" } */ + printf ("%"); /* { dg-warning "trailing" "trailing % warning" } */ + printf ("%++d", i); /* { dg-warning "repeated" "repeated flag warning" } */ + printf ("%n", cn); /* { dg-warning "constant" "%n with const" } */ + printf ((const char *)L"foo"); /* { dg-warning "wide" "wide string" } */ + printf ("%n", (int *)0); /* { dg-warning "null" "%n with NULL" } */ + printf ("%s", (char *)0); /* { dg-warning "null" "%s with NULL" } */ +} diff --git a/gcc/testsuite/gcc.dg/format/ms_c90-printf-2.c b/gcc/testsuite/gcc.dg/format/ms_c90-printf-2.c new file mode 100644 index 00000000000..b5395588120 --- /dev/null +++ b/gcc/testsuite/gcc.dg/format/ms_c90-printf-2.c @@ -0,0 +1,25 @@ +/* Test for printf formats. Formats using C99 features should be rejected + outside of C99 mode. +*/ +/* Origin: Joseph Myers <jsm28@cam.ac.uk> */ +/* { dg-do compile { target { *-*-mingw* } } } */ +/* { dg-options "-std=iso9899:1990 -pedantic -Wformat" } */ + +#define USE_SYSTEM_FORMATS +#include "format.h" + +void +foo (int i, double d, llong ll, intmax_t j, size_t z, ptrdiff_t t) +{ + /* Some tests already in c90-printf-1.c, e.g. %lf. */ + /* The widths hh, ll, j, z, t are new. */ + printf ("%hhd", i); /* { dg-warning "unknown|format" "%hh is unsupported" } */ + printf ("%I64d", ll); /* { dg-warning "length|C" "%I64 in C90" } */ + printf ("%jd", j); /* { dg-warning "unknown|format" "%j is unsupported" } */ + printf ("%zu", z); /* { dg-warning "unknown|format" "%z is unsupported" } */ + printf ("%td", t); /* { dg-warning "unknown|format" "%t is unsupported" } */ + /* The formats F, a, A are new. */ + printf ("%F", d); /* { dg-warning "unknown|format" "%F is unsupported" } */ + printf ("%a", d); /* { dg-warning "unknown|format" "%a is unsupported" } */ + printf ("%A", d); /* { dg-warning "unknown|format" "%A is unsupported" } */ +} diff --git a/gcc/testsuite/gcc.dg/format/ms_c90-printf-3.c b/gcc/testsuite/gcc.dg/format/ms_c90-printf-3.c new file mode 100644 index 00000000000..8e4b19a774e --- /dev/null +++ b/gcc/testsuite/gcc.dg/format/ms_c90-printf-3.c @@ -0,0 +1,43 @@ +/* Test for printf formats. Test that the C90 functions get their default + attributes in strict C90 mode, but the C99 and gettext functions + do not. +*/ +/* Origin: Joseph Myers <jsm28@cam.ac.uk> */ +/* { dg-do compile { target { *-*-mingw* } } } */ +/* { dg-options "-std=iso9899:1990 -pedantic -Wformat" } */ + +#define USE_SYSTEM_FORMATS +#include "format.h" + +void +foo (int i, char *s, size_t n, va_list v0, va_list v1, va_list v2, va_list v3, + va_list v4, va_list v5, va_list v6, va_list v7, va_list v8) +{ + fprintf (stdout, "%d", i); + fprintf (stdout, "%ld", i); /* { dg-warning "format" "fprintf" } */ + printf ("%d", i); + printf ("%ld", i); /* { dg-warning "format" "printf" } */ + /* The "unlocked" functions shouldn't warn in c90 mode. */ + fprintf_unlocked (stdout, "%ld", i); + printf_unlocked ("%ld", i); + sprintf (s, "%d", i); + sprintf (s, "%ld", i); /* { dg-warning "format" "sprintf" } */ + vfprintf (stdout, "%d", v0); + vfprintf (stdout, "%Y", v1); /* { dg-warning "format" "vfprintf" } */ + vprintf ("%d", v2); + vprintf ("%Y", v3); /* { dg-warning "format" "vprintf" } */ + /* The following used to give a bogus warning. */ + vprintf ("%*.*d", v8); /* { dg-bogus "format" "vprintf" } */ + vsprintf (s, "%d", v4); + vsprintf (s, "%Y", v5); /* { dg-warning "format" "Y is invalid" } */ + snprintf (s, n, "%d", i); + snprintf (s, n, "%ld", i); + vsnprintf (s, n, "%d", v6); + vsnprintf (s, n, "%Y", v7); + printf (gettext ("%d"), i); + printf (gettext ("%ld"), i); + printf (dgettext ("", "%d"), i); + printf (dgettext ("", "%ld"), i); + printf (dcgettext ("", "%d", 0), i); + printf (dcgettext ("", "%ld", 0), i); +} diff --git a/gcc/testsuite/gcc.dg/format/ms_c90-scanf-1.c b/gcc/testsuite/gcc.dg/format/ms_c90-scanf-1.c new file mode 100644 index 00000000000..6e2cb10063b --- /dev/null +++ b/gcc/testsuite/gcc.dg/format/ms_c90-scanf-1.c @@ -0,0 +1,119 @@ +/* Test for scanf formats. Formats using C90 features, including cases + where C90 specifies some aspect of the format to be ignored or where + the behavior is undefined. +*/ +/* Origin: Joseph Myers <jsm28@cam.ac.uk> */ +/* { dg-do compile { target { *-*-mingw* } } } */ +/* { dg-options "-std=iso9899:1990 -pedantic -Wformat" } */ + +#define USE_SYSTEM_FORMATS +#include "format.h" + +void +foo (int *ip, unsigned int *uip, short int *hp, unsigned short int *uhp, + long int *lp, unsigned long int *ulp, float *fp, double *dp, + long double *ldp, char *s, signed char *ss, unsigned char *us, + void **pp, int *n, llong *llp, ullong *ullp, wchar_t *ls, + const int *cip, const int *cn, const char *cs, const void **ppc, + void *const *pcp, short int *hn, long int *ln, void *p, char **sp, + volatile void *ppv) +{ + /* See ISO/IEC 9899:1990 (E) subclause 7.9.6.2 (pages 134-138). */ + /* Basic sanity checks for the different components of a format. */ + scanf ("%d", ip); + scanf ("%*d"); + scanf ("%3d", ip); + scanf ("%hd", hp); + scanf ("%3ld", lp); + scanf ("%*3d"); + scanf ("%d %ld", ip, lp); + /* Valid and invalid %% constructions. */ + scanf ("%%"); + scanf ("%*%"); /* { dg-warning "format" "bogus %%" } */ + scanf ("%*%\n"); /* { dg-warning "format" "bogus %%" } */ + scanf ("%4%"); /* { dg-warning "format" "bogus %%" } */ + scanf ("%4%\n"); /* { dg-warning "format" "bogus %%" } */ + scanf ("%h%"); /* { dg-warning "format" "bogus %%" } */ + scanf ("%h%\n"); /* { dg-warning "format" "bogus %%" } */ + /* Valid, invalid and silly assignment-suppression constructions. */ + scanf ("%*d%*i%*o%*u%*x%*X%*e%*E%*f%*g%*G%*s%*[abc]%*c%*p"); + scanf ("%*2d%*8s%*3c"); + scanf ("%*n", n); /* { dg-warning "suppress" "suppression of %n" } */ + scanf ("%*hd"); /* { dg-warning "together" "suppression with length" } */ + /* Valid, invalid and silly width constructions. */ + scanf ("%2d%3i%4o%5u%6x%7X%8e%9E%10f%11g%12G%13s%14[abc]%15c%16p", + ip, ip, uip, uip, uip, uip, fp, fp, fp, fp, fp, s, s, s, pp); + scanf ("%0d", ip); /* { dg-warning "width" "warning for zero width" } */ + scanf ("%3n", n); /* { dg-warning "width" "width with %n" } */ + /* Valid and invalid %h, %l, %L constructions. */ + scanf ("%hd%hi%ho%hu%hx%hX%hn", hp, hp, uhp, uhp, uhp, uhp, hn); + scanf ("%he", fp); /* { dg-warning "length" "bad use of %h" } */ + scanf ("%hE", fp); /* { dg-warning "length" "bad use of %h" } */ + scanf ("%hf", fp); /* { dg-warning "length" "bad use of %h" } */ + scanf ("%hg", fp); /* { dg-warning "length" "bad use of %h" } */ + scanf ("%hG", fp); /* { dg-warning "length" "bad use of %h" } */ + scanf ("%hs", hp); + scanf ("%h[ac]", s); /* { dg-warning "length" "bad use of %h" } */ + scanf ("%hc", hp); + scanf ("%hp", pp); /* { dg-warning "length" "bad use of %h" } */ + scanf ("%h"); /* { dg-warning "conversion lacks type" "bare %h" } */ + scanf ("%h."); /* { dg-warning "conversion" "bogus %h" } */ + scanf ("%ld%li%lo%lu%lx%lX%ln", lp, lp, ulp, ulp, ulp, ulp, ln); + scanf ("%le%lE%lf%lg%lG", dp, dp, dp, dp, dp); + scanf ("%lp", pp); /* { dg-warning "length" "bad use of %l" } */ + /* These next three formats were added in C94. */ + scanf ("%ls", ls); /* { dg-warning "length|C" "bad use of %l" } */ + scanf ("%l[ac]", ls); /* { dg-warning "length|C" "bad use of %l" } */ + scanf ("%lc", ls); /* { dg-warning "length|C" "bad use of %l" } */ + scanf ("%Ld", llp); /* { dg-warning "unknown|format" "%L is unsupported" } */ + scanf ("%Li", llp); /* { dg-warning "unknown|format" "%L is unsupported" } */ + scanf ("%Lo", ullp); /* { dg-warning "unknown|format" "%L is unsupported" } */ + scanf ("%Lu", ullp); /* { dg-warning "unknown|format" "%L is unsupported" } */ + scanf ("%Lx", ullp); /* { dg-warning "unknown|format" "%L is unsupported" } */ + scanf ("%LX", ullp); /* { dg-warning "unknown|format" "%L is unsupported" } */ + scanf ("%Ls", s); /* { dg-warning "unknown|format" "%L is unsupported" } */ + scanf ("%L[ac]", s); /* { dg-warning "unknown|format" "%L is unsupported" } */ + scanf ("%Lc", s); /* { dg-warning "unknown|format" "%L is unsupported" } */ + scanf ("%Lp", pp); /* { dg-warning "unknown|format" "%L is unsupported" } */ + scanf ("%Ln", n); /* { dg-warning "unknown|format" "%L is unsupported" } */ + /* Valid uses of each bare conversion. */ + scanf ("%d%i%o%u%x%X%e%E%f%g%G%s%[abc]%c%p%n%%", ip, ip, uip, uip, uip, + uip, fp, fp, fp, fp, fp, s, s, s, pp, n); + /* Allow other character pointers with %s, %c, %[]. */ + scanf ("%2s%3s%4c%5c%6[abc]%7[abc]", ss, us, ss, us, ss, us); + /* Further tests for %[]. */ + scanf ("%[%d]%d", s, ip); + scanf ("%[^%d]%d", s, ip); + scanf ("%[]%d]%d", s, ip); + scanf ("%[^]%d]%d", s, ip); + scanf ("%[%d]%d", s, ip); + scanf ("%[]abcd", s); /* { dg-warning "no closing" "incomplete scanset" } */ + /* Various tests of bad argument types. Some of these are only pedantic + warnings. + */ + scanf ("%d", lp); /* { dg-warning "format" "bad argument types" } */ + scanf ("%d", uip); /* { dg-warning "format" "bad argument types" } */ + scanf ("%d", pp); /* { dg-warning "format" "bad argument types" } */ + scanf ("%p", ppc); /* { dg-warning "format" "bad argument types" } */ + scanf ("%p", ppv); /* { dg-warning "format" "bad argument types" } */ + scanf ("%s", n); /* { dg-warning "format" "bad argument types" } */ + scanf ("%s", p); /* { dg-warning "format" "bad argument types" } */ + scanf ("%p", p); /* { dg-warning "format" "bad argument types" } */ + scanf ("%p", sp); /* { dg-warning "format" "bad argument types" } */ + /* Tests for writing into constant values. */ + scanf ("%d", cip); /* { dg-warning "constant" "%d writing into const" } */ + scanf ("%n", cn); /* { dg-warning "constant" "%n writing into const" } */ + scanf ("%s", cs); /* { dg-warning "constant" "%s writing into const" } */ + scanf ("%p", pcp); /* { dg-warning "constant" "%p writing into const" } */ + /* Wrong number of arguments. */ + scanf ("%d%d", ip); /* { dg-warning "arguments" "wrong number of args" } */ + scanf ("%d", ip, ip); /* { dg-warning "arguments" "wrong number of args" } */ + /* Miscellaneous bogus constructions. */ + scanf (""); /* { dg-warning "zero-length" "warning for empty format" } */ + scanf ("\0"); /* { dg-warning "embedded" "warning for embedded NUL" } */ + scanf ("%d\0", ip); /* { dg-warning "embedded" "warning for embedded NUL" } */ + scanf ("%d\0%d", ip, ip); /* { dg-warning "embedded|too many" "warning for embedded NUL" } */ + scanf (NULL); /* { dg-warning "null" "null format string warning" } */ + scanf ("%"); /* { dg-warning "trailing" "trailing % warning" } */ + scanf ("%d", (int *)0); /* { dg-warning "null" "writing into NULL" } */ +} diff --git a/gcc/testsuite/gcc.dg/format/ms_c90-scanf-2.c b/gcc/testsuite/gcc.dg/format/ms_c90-scanf-2.c new file mode 100644 index 00000000000..b55122792ab --- /dev/null +++ b/gcc/testsuite/gcc.dg/format/ms_c90-scanf-2.c @@ -0,0 +1,26 @@ +/* Test for scanf formats. Formats using C99 features should be rejected + outside of C99 mode. +*/ +/* Origin: Joseph Myers <jsm28@cam.ac.uk> */ +/* { dg-do compile { target { *-*-mingw* } } } */ +/* { dg-options "-std=iso9899:1990 -pedantic -Wformat" } */ + +#define USE_SYSTEM_FORMATS +#include "format.h" + +void +foo (signed char *hhp, float *fp, llong *llp, intmax_t *jp, + size_t *zp, ptrdiff_t *tp) +{ + /* Some tests already in c90-scanf-1.c. */ + /* The widths hh, ll, j, z, t are new. */ + scanf ("%hhd", hhp); /* { dg-warning "unknown|format" "%hh is unsupported" } */ + scanf ("%I64d", llp); /* { dg-warning "length|C" "%I64 in C90" } */ + scanf ("%jd", jp); /* { dg-warning "unknown|format" "%j is unsupported" } */ + scanf ("%zu", zp); /* { dg-warning "unknown|format" "%z is unsupported" } */ + scanf ("%td", tp); /* { dg-warning "unknown|format" "%t is unsupported" } */ + /* The formats F, a, A are new. */ + scanf ("%F", fp); /* { dg-warning "unknown|format" "%F is unsupported" } */ + scanf ("%a", fp); /* { dg-warning "unknown|format" "%a is unsupported" } */ + scanf ("%A", fp); /* { dg-warning "unknown|format" "%A is unsupported" } */ +} diff --git a/gcc/testsuite/gcc.dg/format/ms_c90-scanf-3.c b/gcc/testsuite/gcc.dg/format/ms_c90-scanf-3.c new file mode 100644 index 00000000000..b9d3e38bc00 --- /dev/null +++ b/gcc/testsuite/gcc.dg/format/ms_c90-scanf-3.c @@ -0,0 +1,20 @@ +/* Test for scanf formats. Formats using extensions to the standard + should be rejected in strict pedantic mode. +*/ +/* Origin: Joseph Myers <jsm28@cam.ac.uk> */ +/* { dg-do compile { target { *-*-mingw* } } } */ +/* { dg-options "-std=iso9899:1990 -pedantic -Wformat" } */ + +#define USE_SYSTEM_FORMATS +#include "format.h" + +void +foo (char **sp, wchar_t **lsp) +{ + /* %a formats for allocation, only recognized in C90 mode, are a + GNU extension. + */ + scanf ("%as", sp); /* { dg-warning "flag" "%as is unsupported" } */ + scanf ("%aS", lsp); /* { dg-warning "format|flag" "%aS is unsupported" } */ + scanf ("%a[bcd]", sp); /* { dg-warning "flag" "%a[] is unsupported" } */ +} diff --git a/gcc/testsuite/gcc.dg/format/ms_c90-scanf-4.c b/gcc/testsuite/gcc.dg/format/ms_c90-scanf-4.c new file mode 100644 index 00000000000..4b1fda7cafb --- /dev/null +++ b/gcc/testsuite/gcc.dg/format/ms_c90-scanf-4.c @@ -0,0 +1,31 @@ +/* Test for scanf formats. Test that the C90 functions get their default + attributes in strict C90 mode, but the C99 and gettext functions + do not. +*/ +/* Origin: Joseph Myers <jsm28@cam.ac.uk> */ +/* { dg-do compile { target { *-*-mingw* } } } */ +/* { dg-options "-std=iso9899:1990 -pedantic -Wformat" } */ + +#define USE_SYSTEM_FORMATS +#include "format.h" + +void +foo (int *ip, char *s, va_list v0, va_list v1, va_list v2, va_list v3, + va_list v4, va_list v5) +{ + fscanf (stdin, "%d", ip); + fscanf (stdin, "%ld", ip); /* { dg-warning "format" "fscanf" } */ + scanf ("%d", ip); + scanf ("%ld", ip); /* { dg-warning "format" "scanf" } */ + sscanf (s, "%d", ip); + sscanf (s, "%ld", ip); /* { dg-warning "format" "sscanf" } */ + vfscanf (stdin, "%d", v0); + vscanf ("%d", v2); + vsscanf (s, "%d", v4); + scanf (gettext ("%d"), ip); + scanf (gettext ("%ld"), ip); + scanf (dgettext ("", "%d"), ip); + scanf (dgettext ("", "%ld"), ip); + scanf (dcgettext ("", "%d", 0), ip); + scanf (dcgettext ("", "%ld", 0), ip); +} diff --git a/gcc/testsuite/gcc.dg/format/ms_c90-scanf-5.c b/gcc/testsuite/gcc.dg/format/ms_c90-scanf-5.c new file mode 100644 index 00000000000..c714689e06f --- /dev/null +++ b/gcc/testsuite/gcc.dg/format/ms_c90-scanf-5.c @@ -0,0 +1,20 @@ +/* Test for scanf formats. Formats using extensions to the standard + should be rejected in strict pedantic mode. +*/ +/* { dg-do compile { target { *-*-mingw* } } } */ +/* { dg-options "-std=iso9899:1990 -pedantic -Wformat" } */ + +#define USE_SYSTEM_FORMATS +#include "format.h" + +void +foo (char **sp, wchar_t **lsp) +{ + /* m assignment-allocation modifier, recognized in both C90 + and C99 modes, is a POSIX and ISO/IEC WDTR 24731-2 extension. */ + scanf ("%ms", sp); /* { dg-warning "unknown|format" "%ms is unsupported" } */ + scanf ("%mS", lsp); /* { dg-warning "unknown|format" "%mS is unsupported" } */ + scanf ("%mls", lsp); /* { dg-warning "unknown|format" "%mls is unsupported" } */ + scanf ("%m[bcd]", sp); /* { dg-warning "unknown|format" "%m[] is unsupported" } */ + scanf ("%ml[bcd]", lsp); /* { dg-warning "unknown|format" "%ml[] is unsupported" } */ +} diff --git a/gcc/testsuite/gcc.dg/format/ms_c90-strftime-1.c b/gcc/testsuite/gcc.dg/format/ms_c90-strftime-1.c new file mode 100644 index 00000000000..34143c1b214 --- /dev/null +++ b/gcc/testsuite/gcc.dg/format/ms_c90-strftime-1.c @@ -0,0 +1,20 @@ +/* Test for strftime formats. Formats using C90 features. */ +/* Origin: Joseph Myers <jsm28@cam.ac.uk> */ +/* { dg-do compile { target { *-*-mingw* } } } */ +/* { dg-options "-std=iso9899:1990 -pedantic -Wformat -Wformat-y2k" } */ + +#define USE_SYSTEM_FORMATS +#include "format.h" + +void +foo (char *s, size_t m, const struct tm *tp) +{ + /* See ISO/IEC 9899:1990 (E) subclause 7.12.3.5 (pages 174-175). */ + /* Formats which are Y2K-compliant (no 2-digit years). */ + strftime (s, m, "%a%A%b%B%d%H%I%j%m%M%p%S%U%w%W%X%Y%Z%%", tp); + /* Formats with 2-digit years. */ + strftime (s, m, "%y", tp); /* { dg-warning "only last 2" "2-digit year" } */ + /* Formats with 2-digit years in some locales. */ + strftime (s, m, "%c", tp); /* { dg-warning "some locales" "2-digit year" } */ + strftime (s, m, "%x", tp); /* { dg-warning "some locales" "2-digit year" } */ +} diff --git a/gcc/testsuite/gcc.dg/format/ms_c90-strftime-2.c b/gcc/testsuite/gcc.dg/format/ms_c90-strftime-2.c new file mode 100644 index 00000000000..446f235336b --- /dev/null +++ b/gcc/testsuite/gcc.dg/format/ms_c90-strftime-2.c @@ -0,0 +1,28 @@ +/* Test for strftime formats. Rejection of formats using C99 features in + pedantic C90 mode. */ +/* Origin: Joseph Myers <jsm28@cam.ac.uk> */ +/* { dg-do compile { target { *-*-mingw* } } } */ +/* { dg-options "-std=iso9899:1990 -pedantic -Wformat -Wformat-y2k" } */ + +#define USE_SYSTEM_FORMATS +#include "format.h" + +void +foo (char *s, size_t m, const struct tm *tp) +{ + strftime (s, m, "%C", tp); /* { dg-warning "format" "%C is unsupported" } */ + strftime (s, m, "%D", tp); /* { dg-warning "format" "%D is unsupported" } */ + strftime (s, m, "%e", tp); /* { dg-warning "format" "%e is unsupported" } */ + strftime (s, m, "%F", tp); /* { dg-warning "format" "%F is unsupported" } */ + strftime (s, m, "%g", tp); /* { dg-warning "format" "%g is unsupported" } */ + strftime (s, m, "%G", tp); /* { dg-warning "format" "%G is unsupported" } */ + strftime (s, m, "%h", tp); /* { dg-warning "format" "%h is unsupported" } */ + strftime (s, m, "%n", tp); /* { dg-warning "format" "%n is unsupported" } */ + strftime (s, m, "%r", tp); /* { dg-warning "format" "%r is unsupported" } */ + strftime (s, m, "%R", tp); /* { dg-warning "format" "%R is unsupported" } */ + strftime (s, m, "%t", tp); /* { dg-warning "format" "%t is unsupported" } */ + strftime (s, m, "%T", tp); /* { dg-warning "format" "%T is unsupported" } */ + strftime (s, m, "%u", tp); /* { dg-warning "format" "%u is unsupported" } */ + strftime (s, m, "%V", tp); /* { dg-warning "format" "%V is unsupported" } */ + strftime (s, m, "%z", tp); /* { dg-warning "C" "%z not in C90" } */ +} diff --git a/gcc/testsuite/gcc.dg/format/ms_c94-printf-1.c b/gcc/testsuite/gcc.dg/format/ms_c94-printf-1.c new file mode 100644 index 00000000000..8a7a12e3f06 --- /dev/null +++ b/gcc/testsuite/gcc.dg/format/ms_c94-printf-1.c @@ -0,0 +1,19 @@ +/* Test for printf formats. Changes in C94 to C90. */ +/* Origin: Joseph Myers <jsm28@cam.ac.uk> */ +/* { dg-do compile { target { *-*-mingw* } } } */ +/* { dg-options "-std=iso9899:199409 -pedantic -Wformat" } */ + +#define USE_SYSTEM_FORMATS +#include "format.h" + +void +foo (wint_t lc, wchar_t *ls) +{ + /* See ISO/IEC 9899:1990 (E) subclause 7.9.6.1 (pages 131-134), + as amended by ISO/IEC 9899:1990/Amd.1:1995 (E) (pages 4-5). + We do not repeat here all the C90 format checks, but just verify + that %ls and %lc are accepted without warning. + */ + printf ("%lc", lc); + printf ("%ls", ls); +} diff --git a/gcc/testsuite/gcc.dg/format/ms_c94-scanf-1.c b/gcc/testsuite/gcc.dg/format/ms_c94-scanf-1.c new file mode 100644 index 00000000000..85b300f4fc6 --- /dev/null +++ b/gcc/testsuite/gcc.dg/format/ms_c94-scanf-1.c @@ -0,0 +1,18 @@ +/* Test for scanf formats. Changes in C94 to C90. */ +/* Origin: Joseph Myers <jsm28@cam.ac.uk> */ +/* { dg-do compile { target { *-*-mingw* } } } */ +/* { dg-options "-std=iso9899:199409 -pedantic -Wformat" } */ + +#define USE_SYSTEM_FORMATS +#include "format.h" + +void +foo (wchar_t *ls) +{ + /* See ISO/IEC 9899:1990 (E) subclause 7.9.6.2 (pages 134-138), + as amended by ISO/IEC 9899:1990/Amd.1:1995 (E) (pages 5-6). + We do not repeat here all the C90 format checks, but just verify + that %ls, %lc, %l[] are accepted without warning. + */ + scanf ("%lc%ls%l[abc]", ls, ls, ls); +} diff --git a/gcc/testsuite/gcc.dg/format/ms_c99-printf-1.c b/gcc/testsuite/gcc.dg/format/ms_c99-printf-1.c new file mode 100644 index 00000000000..ad5634ceb78 --- /dev/null +++ b/gcc/testsuite/gcc.dg/format/ms_c99-printf-1.c @@ -0,0 +1,109 @@ +/* Test for printf formats. Formats using C99 features, including cases + where C99 specifies some aspect of the format to be ignored or where + the behavior is undefined. +*/ +/* Origin: Joseph Myers <jsm28@cam.ac.uk> */ +/* { dg-do compile { target { *-*-mingw* } } } */ +/* { dg-options "-std=iso9899:1999 -pedantic -Wformat" } */ + +#define USE_SYSTEM_FORMATS +#include "format.h" + +void +foo (int i, unsigned int u, double d, char *s, void *p, int *n, + long double ld, wint_t lc, wchar_t *ls, long long int ll, + unsigned long long int ull, signed char *ss, unsigned char *us, + long long int *lln, intmax_t j, uintmax_t uj, intmax_t *jn, + size_t z, signed_size_t sz, signed_size_t *zn, + ptrdiff_t t, ptrdiff_t *tn) +{ + /* See ISO/IEC 9899:1999 (E) subclause 7.19.6.1 (pages 273-281). + We do not repeat here most of the checks for correct C90 formats + or completely broken formats. + */ + /* Valid and invalid %h, %hh, %l, %j, %z, %t, %L constructions. */ + printf ("%hf", d); /* { dg-warning "length" "bad use of %h" } */ + printf ("%hF", d); /* { dg-warning "unknown|format" "bad use of %hF" } */ + printf ("%he", d); /* { dg-warning "length" "bad use of %h" } */ + printf ("%hE", d); /* { dg-warning "length" "bad use of %h" } */ + printf ("%hg", d); /* { dg-warning "length" "bad use of %h" } */ + printf ("%hG", d); /* { dg-warning "length" "bad use of %h" } */ + printf ("%ha", d); /* { dg-warning "unknown|format" "bad use of %ha" } */ + printf ("%hA", d); /* { dg-warning "unknown|format" "bad use of %hA" } */ + printf ("%hc", i); + printf ("%hs", (short *)s); + printf ("%hp", p); /* { dg-warning "length" "bad use of %h" } */ + printf ("%lc", lc); + printf ("%ls", ls); + printf ("%lp", p); /* { dg-warning "length|C" "bad use of %l" } */ + /* Valid uses of each bare conversion. */ + printf ("%d%i%o%u%x%X%f%e%E%g%G%c%s%p%n%%", i, i, u, u, u, u, + d, d, d, d, d, i, s, p, n); + /* Uses of the - flag (valid on all non-%, non-n conversions). */ + printf ("%-d%-i%-o%-u%-x%-X%-f%-e%-E%-g%-G%-c%-s%-p", i, i, + u, u, u, u, d, d, d, d, d, i, s, p); + printf ("%-n", n); /* { dg-warning "flag" "bad use of %-n" } */ + /* Uses of the + flag (valid on signed conversions only). */ + printf ("%+d%+i%+f%+e%+E%+g%+G\n", i, i, d, d, d, d, d); + printf ("%+o", u); /* { dg-warning "flag" "bad use of + flag" } */ + printf ("%+u", u); /* { dg-warning "flag" "bad use of + flag" } */ + printf ("%+x", u); /* { dg-warning "flag" "bad use of + flag" } */ + printf ("%+X", u); /* { dg-warning "flag" "bad use of + flag" } */ + printf ("%+c", i); /* { dg-warning "flag" "bad use of + flag" } */ + printf ("%+s", s); /* { dg-warning "flag" "bad use of + flag" } */ + printf ("%+p", p); /* { dg-warning "flag" "bad use of + flag" } */ + printf ("%+n", n); /* { dg-warning "flag" "bad use of + flag" } */ + /* Uses of the space flag (valid on signed conversions only, and ignored + with +). + */ + printf ("% +d", i); /* { dg-warning "use of both|ignored" "use of space and + flags" } */ + printf ("%+ d", i); /* { dg-warning "use of both|ignored" "use of space and + flags" } */ + printf ("% d% i% f% e% E% g% G\n", i, i, d, d, d, d, d); + printf ("% o", u); /* { dg-warning "flag" "bad use of space flag" } */ + printf ("% u", u); /* { dg-warning "flag" "bad use of space flag" } */ + printf ("% x", u); /* { dg-warning "flag" "bad use of space flag" } */ + printf ("% X", u); /* { dg-warning "flag" "bad use of space flag" } */ + printf ("% c", i); /* { dg-warning "flag" "bad use of space flag" } */ + printf ("% s", s); /* { dg-warning "flag" "bad use of space flag" } */ + printf ("% p", p); /* { dg-warning "flag" "bad use of space flag" } */ + printf ("% n", n); /* { dg-warning "flag" "bad use of space flag" } */ + /* Uses of the # flag. */ + printf ("%#o%#x%#X%#e%#E%#f%#g%#G", u, u, u, d, d, d, + d, d); + printf ("%#d", i); /* { dg-warning "flag" "bad use of # flag" } */ + printf ("%#i", i); /* { dg-warning "flag" "bad use of # flag" } */ + printf ("%#u", u); /* { dg-warning "flag" "bad use of # flag" } */ + printf ("%#c", i); /* { dg-warning "flag" "bad use of # flag" } */ + printf ("%#s", s); /* { dg-warning "flag" "bad use of # flag" } */ + printf ("%#p", p); /* { dg-warning "flag" "bad use of # flag" } */ + printf ("%#n", n); /* { dg-warning "flag" "bad use of # flag" } */ + /* Uses of the 0 flag. */ + printf ("%08d%08i%08o%08u%08x%08X%08e%08E%08f%08g%08G", i, i, + u, u, u, u, d, d, d, d, d); + printf ("%0c", i); /* { dg-warning "flag" "bad use of 0 flag" } */ + printf ("%0s", s); /* { dg-warning "flag" "bad use of 0 flag" } */ + printf ("%0p", p); /* { dg-warning "flag" "bad use of 0 flag" } */ + printf ("%0n", n); /* { dg-warning "flag" "bad use of 0 flag" } */ + /* 0 flag ignored with - flag. */ + printf ("%-08d", i); /* { dg-warning "flags|ignored" "0 flag ignored with - flag" } */ + printf ("%-08i", i); /* { dg-warning "flags|ignored" "0 flag ignored with - flag" } */ + printf ("%-08o", u); /* { dg-warning "flags|ignored" "0 flag ignored with - flag" } */ + printf ("%-08u", u); /* { dg-warning "flags|ignored" "0 flag ignored with - flag" } */ + printf ("%-08x", u); /* { dg-warning "flags|ignored" "0 flag ignored with - flag" } */ + printf ("%-08X", u); /* { dg-warning "flags|ignored" "0 flag ignored with - flag" } */ + printf ("%-08e", d); /* { dg-warning "flags|ignored" "0 flag ignored with - flag" } */ + printf ("%-08E", d); /* { dg-warning "flags|ignored" "0 flag ignored with - flag" } */ + printf ("%-08f", d); /* { dg-warning "flags|ignored" "0 flag ignored with - flag" } */ + printf ("%-08F", d); /* { dg-warning "unknown|format" "0 flag ignored with - flag" } */ + printf ("%-08g", d); /* { dg-warning "flags|ignored" "0 flag ignored with - flag" } */ + printf ("%-08G", d); /* { dg-warning "flags|ignored" "0 flag ignored with - flag" } */ + printf ("%-08a", d); /* { dg-warning "unknown|format" "0 flag ignored with - flag" } */ + printf ("%-08A", d); /* { dg-warning "unknown|format" "0 flag ignored with - flag" } */ + /* Various tests of bad argument types. Mostly covered in c90-printf-1.c; + here just test for pointer target sign with %hhn. (Probably allowed + by the standard, but a bad idea, so GCC should diagnose if what + is used is not signed char *.) + */ + printf ("%hhn", s); /* { dg-warning "unknown|format" "%hhn is unsupported" } */ + printf ("%hhn", us); /* { dg-warning "unknown|format" "%hhn is unsupported" } */ +} diff --git a/gcc/testsuite/gcc.dg/format/ms_c99-printf-2.c b/gcc/testsuite/gcc.dg/format/ms_c99-printf-2.c new file mode 100644 index 00000000000..0a4d3160d30 --- /dev/null +++ b/gcc/testsuite/gcc.dg/format/ms_c99-printf-2.c @@ -0,0 +1,32 @@ +/* Test for printf formats. Formats using extensions to the standard + should be rejected in strict pedantic mode. +*/ +/* Origin: Joseph Myers <jsm28@cam.ac.uk> */ +/* { dg-do compile { target { *-*-mingw* } } } */ +/* { dg-options "-std=iso9899:1999 -pedantic -Wformat" } */ + +#define USE_SYSTEM_FORMATS +#include "format.h" + +void +foo (int i, long long ll, size_t z, wint_t lc, wchar_t *ls) +{ + /* The length modifiers q, Z and L as applied to integer formats are + extensions. + */ + printf ("%qd", ll); /* { dg-warning "unknown|format" "%q length is unsupported" } */ + printf ("%Ld", ll); /* { dg-warning "unknown|format" "%L length is unsupported" } */ + printf ("%Zd", z); /* { dg-warning "unknown|format" "%Z length is unsupported" } */ + /* The conversion specifiers C and S are X/Open extensions; the + conversion specifier m is a GNU extension. + */ + printf ("%m"); /* { dg-warning "unknown" "printf %m is unsupported" } */ + printf ("%C", lc); /* { dg-warning "C" "printf %C" } */ + printf ("%S", ls); /* { dg-warning "C" "printf %S" } */ + /* The flag character ', and the use of operand number $ formats, are + X/Open extensions. + */ + printf ("%'d", i); /* { dg-warning "C" "printf ' flag" } */ + printf ("%1$d", i); /* { dg-warning "C" "printf $ format" } */ + printf ("%Ix", z); /* { dg-warning "C" "printf I format" } */ +} diff --git a/gcc/testsuite/gcc.dg/format/ms_c99-printf-3.c b/gcc/testsuite/gcc.dg/format/ms_c99-printf-3.c new file mode 100644 index 00000000000..d8c51eaa063 --- /dev/null +++ b/gcc/testsuite/gcc.dg/format/ms_c99-printf-3.c @@ -0,0 +1,40 @@ +/* Test for printf formats. Test that the C99 functions get their default + attributes in strict C99 mode, but the gettext functions do not. +*/ +/* Origin: Joseph Myers <jsm28@cam.ac.uk> */ +/* { dg-do compile { target { *-*-mingw* } } } */ +/* { dg-options "-std=iso9899:1999 -pedantic -Wformat" } */ + +#define USE_SYSTEM_FORMATS +#include "format.h" + +void +foo (int i, char *s, size_t n, va_list v0, va_list v1, va_list v2, va_list v3, + va_list v4, va_list v5, va_list v6, va_list v7) +{ + fprintf (stdout, "%d", i); + fprintf (stdout, "%ld", i); /* { dg-warning "format" "fprintf" } */ + printf ("%d", i); + printf ("%ld", i); /* { dg-warning "format" "printf" } */ + /* The "unlocked" functions shouldn't warn in c99 mode. */ + fprintf_unlocked (stdout, "%ld", i); + printf_unlocked ("%ld", i); + sprintf (s, "%d", i); + sprintf (s, "%ld", i); /* { dg-warning "format" "sprintf" } */ + snprintf (s, n, "%d", i); + snprintf (s, n, "%ld", i); /* { dg-warning "format" "snprintf" } */ + vfprintf (stdout, "%d", v0); + vfprintf (stdout, "%Y", v1); /* { dg-warning "format" "vfprintf" } */ + vprintf ("%d", v0); + vprintf ("%Y", v1); /* { dg-warning "format" "vprintf" } */ + vsprintf (s, "%d", v0); + vsprintf (s, "%Y", v1); /* { dg-warning "format" "vsprintf" } */ + vsnprintf (s, n, "%d", v0); + vsnprintf (s, n, "%Y", v1); /* { dg-warning "format" "vsnprintf" } */ + printf (gettext ("%d"), i); + printf (gettext ("%ld"), (long) i); + printf (dgettext ("", "%d"), i); + printf (dgettext ("", "%ld"), (long) i); + printf (dcgettext ("", "%d", 0), i); + printf (dcgettext ("", "%ld", 0), (long) i); +} diff --git a/gcc/testsuite/gcc.dg/format/ms_c99-scanf-1.c b/gcc/testsuite/gcc.dg/format/ms_c99-scanf-1.c new file mode 100644 index 00000000000..f4ac706e7c4 --- /dev/null +++ b/gcc/testsuite/gcc.dg/format/ms_c99-scanf-1.c @@ -0,0 +1,63 @@ +/* Test for scanf formats. Formats using C99 features, including cases + where C99 specifies some aspect of the format to be ignored or where + the behavior is undefined. +*/ +/* Origin: Joseph Myers <jsm28@cam.ac.uk> */ +/* { dg-do compile { target { *-*-mingw* } } } */ +/* { dg-options "-std=iso9899:1999 -pedantic -Wformat" } */ + +#define USE_SYSTEM_FORMATS +#include "format.h" + +void +foo (int *ip, unsigned int *uip, short int *hp, unsigned short int *uhp, + signed char *hhp, unsigned char *uhhp, long int *lp, + unsigned long int *ulp, float *fp, double *dp, long double *ldp, char *s, + void **pp, int *n, long long *llp, unsigned long long *ullp, wchar_t *ls, + short int *hn, signed char *hhn, long int *ln, long long int *lln, + intmax_t *jp, uintmax_t *ujp, intmax_t *jn, size_t *zp, + signed_size_t *szp, signed_size_t *zn, ptrdiff_t *tp, + unsigned_ptrdiff_t *utp, ptrdiff_t *tn) +{ + /* See ISO/IEC 9899:1999 (E) subclause 7.19.6.2 (pages 281-288). + We do not repeat here most of the checks for correct C90 formats + or completely broken formats. + */ + /* Valid, invalid and silly assignment-suppression + and width constructions. + */ + scanf ("%*d%*i%*o%*u%*x%*X%*e%*E%*f%*g%*G%*s%*[abc]%*c%*p"); + scanf ("%*2d%*8s%*3c"); + scanf ("%*n", n); /* { dg-warning "suppress" "suppression of %n" } */ + scanf ("%*hd"); /* { dg-warning "together" "suppression with length" } */ + scanf ("%2d%3i%4o%5u%6x%7X%10e%11E%12f%14g%15G%16s%3[abc]%4c%5p", + ip, ip, uip, uip, uip, uip, fp, fp, fp, fp, fp, + s, s, s, pp); + scanf ("%0d", ip); /* { dg-warning "width" "warning for zero width" } */ + scanf ("%3n", n); /* { dg-warning "width" "width with %n" } */ + /* Valid and invalid %h, %hh, %l, %j, %z, %t, %L constructions. */ + scanf ("%hd%hi%ho%hu%hx%hX%hn", hp, hp, uhp, uhp, uhp, uhp, hn); + scanf ("%he", fp); /* { dg-warning "length" "bad use of %h" } */ + scanf ("%hE", fp); /* { dg-warning "length" "bad use of %h" } */ + scanf ("%hf", fp); /* { dg-warning "length" "bad use of %h" } */ + scanf ("%hg", fp); /* { dg-warning "length" "bad use of %h" } */ + scanf ("%hG", fp); /* { dg-warning "length" "bad use of %h" } */ + scanf ("%hs", hp); + scanf ("%h[ac]", s); /* { dg-warning "length" "bad use of %h" } */ + scanf ("%hc", (short *)s); + scanf ("%hp", pp); /* { dg-warning "length" "bad use of %h" } */ + scanf ("%hhd", hhp); /* { dg-warning "unknown|format" "%hh is unsupported" } */ + scanf ("%ld%li%lo%lu%lx%lX%ln", lp, lp, ulp, ulp, ulp, ulp, ln); + scanf ("%le%lE%lf%lg%lG", dp, dp, dp, dp, dp); + scanf ("%lp", pp); /* { dg-warning "length" "bad use of %l" } */ + scanf ("%ls", ls); + scanf ("%l[ac]", ls); + scanf ("%lc", ls); + scanf ("%jd", jp); /* { dg-warning "unknown|format" "%j not supported" } */ + scanf ("%zd", zp); /* { dg-warning "unknown|format" "%z not supported" } */ + scanf ("%td", tp); /* { dg-warning "unknown|format" "%t not supported" } */ + scanf ("%Lf", llp); /* { dg-warning "unknown|format" "bad use of %L is not supported" } */ + /* Valid uses of each bare conversion. */ + scanf ("%d%i%o%u%x%X%e%E%f%g%G%s%[abc]%c%p%n%%", ip, ip, uip, uip, uip, + uip, fp, fp, fp, fp, fp, s, s, s, pp, n); +} diff --git a/gcc/testsuite/gcc.dg/format/ms_c99-scanf-2.c b/gcc/testsuite/gcc.dg/format/ms_c99-scanf-2.c new file mode 100644 index 00000000000..e16f5bfc3ca --- /dev/null +++ b/gcc/testsuite/gcc.dg/format/ms_c99-scanf-2.c @@ -0,0 +1,27 @@ +/* Test for scanf formats. Formats using extensions to the standard + should be rejected in strict pedantic mode. +*/ +/* Origin: Joseph Myers <jsm28@cam.ac.uk> */ +/* { dg-do compile { target { *-*-mingw* } } } */ +/* { dg-options "-std=iso9899:1999 -pedantic -Wformat" } */ + +#define USE_SYSTEM_FORMATS +#include "format.h" + +void +foo (int *ip, long long int *llp, wchar_t *ls) +{ + /* The length modifiers q and L as applied to integer formats are + extensions. + */ + scanf ("%qd", llp); /* { dg-warning "unknown|format" "%q is unsupported" } */ + scanf ("%Ld", llp); /* { dg-warning "unknown|format" "%L is unsupported" } */ + /* The conversion specifiers C and S are X/Open extensions. */ + scanf ("%C", ls); /* { dg-warning "C" "scanf %C" } */ + scanf ("%S", ls); /* { dg-warning "C" "scanf %S" } */ + /* The use of operand number $ formats is an X/Open extension. */ + scanf ("%1$d", ip); /* { dg-warning "C" "scanf $ format" } */ + /* glibc also supports flags ' and I on scanf formats as an extension. */ + scanf ("%'d", ip); /* { dg-warning "C" "scanf ' flag" } */ + scanf ("%Id", (ssize_t *)ip); /* { dg-warning "C" "scanf I flag" } */ +} diff --git a/gcc/testsuite/gcc.dg/format/ms_c99-scanf-3.c b/gcc/testsuite/gcc.dg/format/ms_c99-scanf-3.c new file mode 100644 index 00000000000..cde2f3703d4 --- /dev/null +++ b/gcc/testsuite/gcc.dg/format/ms_c99-scanf-3.c @@ -0,0 +1,33 @@ +/* Test for scanf formats. Test that the C99 functions get their default + attributes in strict C99 mode, but the gettext functions do not. +*/ +/* Origin: Joseph Myers <jsm28@cam.ac.uk> */ +/* { dg-do compile { target { *-*-mingw* } } } */ +/* { dg-options "-std=iso9899:1999 -pedantic -Wformat" } */ + +#define USE_SYSTEM_FORMATS +#include "format.h" + +void +foo (int *ip, char *s, va_list v0, va_list v1, va_list v2, va_list v3, + va_list v4, va_list v5) +{ + fscanf (stdin, "%d", ip); + fscanf (stdin, "%ld", ip); /* { dg-warning "format" "fscanf" } */ + scanf ("%d", ip); + scanf ("%ld", ip); /* { dg-warning "format" "scanf" } */ + sscanf (s, "%d", ip); + sscanf (s, "%ld", ip); /* { dg-warning "format" "sscanf" } */ + vfscanf (stdin, "%d", v0); + vfscanf (stdin, "%Y", v1); /* { dg-warning "format" "vfscanf" } */ + vscanf ("%d", v2); + vscanf ("%Y", v3); /* { dg-warning "format" "vscanf" } */ + vsscanf (s, "%d", v4); + vsscanf (s, "%Y", v5); /* { dg-warning "format" "vsscanf" } */ + scanf (gettext ("%d"), ip); + scanf (gettext ("%ld"), ip); + scanf (dgettext ("", "%d"), ip); + scanf (dgettext ("", "%ld"), ip); + scanf (dcgettext ("", "%d", 0), ip); + scanf (dcgettext ("", "%ld", 0), ip); +} diff --git a/gcc/testsuite/gcc.dg/format/ms_c99-scanf-4.c b/gcc/testsuite/gcc.dg/format/ms_c99-scanf-4.c new file mode 100644 index 00000000000..bddc11dd1f4 --- /dev/null +++ b/gcc/testsuite/gcc.dg/format/ms_c99-scanf-4.c @@ -0,0 +1,20 @@ +/* Test for scanf formats. Formats using extensions to the standard + should be rejected in strict pedantic mode. +*/ +/* { dg-do compile { target { *-*-mingw* } } } */ +/* { dg-options "-std=iso9899:1999 -pedantic -Wformat" } */ + +#define USE_SYSTEM_FORMATS +#include "format.h" + +void +foo (char **sp, wchar_t **lsp) +{ + /* m assignment-allocation modifier, recognized in both C90 + and C99 modes, is a POSIX and ISO/IEC WDTR 24731-2 extension. */ + scanf ("%ms", sp); /* { dg-warning "unknown|format" "%ms is unsupported" } */ + scanf ("%mS", lsp); /* { dg-warning "unknown|format" "%mS is unsupported" } */ + scanf ("%mls", lsp); /* { dg-warning "unknown|format" "%mls is unsupported" } */ + scanf ("%m[bcd]", sp); /* { dg-warning "unknown|format" "%m[] is unsupported" } */ + scanf ("%ml[bcd]", lsp); /* { dg-warning "unknown|format" "%ml[] is unsupported" } */ +} diff --git a/gcc/testsuite/gcc.dg/format/ms_c99-strftime-1.c b/gcc/testsuite/gcc.dg/format/ms_c99-strftime-1.c new file mode 100644 index 00000000000..743972efab4 --- /dev/null +++ b/gcc/testsuite/gcc.dg/format/ms_c99-strftime-1.c @@ -0,0 +1,20 @@ +/* Test for strftime formats. Formats using C99 features. */ +/* Origin: Joseph Myers <jsm28@cam.ac.uk> */ +/* { dg-do compile { target { *-*-mingw* } } } */ +/* { dg-options "-std=iso9899:1999 -pedantic -Wformat -Wformat-y2k" } */ + +#define USE_SYSTEM_FORMATS +#include "format.h" + +void +foo (char *s, size_t m, const struct tm *tp) +{ + /* See ISO/IEC 9899:1990 (E) subclause 7.12.3.5 (pages 174-175). */ + /* Formats which are Y2K-compliant (no 2-digit years). */ + strftime (s, m, "%a%A%b%B%d%H%I%j%m%M%p%S%U%w%W%X%Y%z%Z%%", tp); + /* Formats with 2-digit years. */ + strftime (s, m, "%y", tp); /* { dg-warning "only last 2" "2-digit year" } */ + /* Formats with 2-digit years in some locales. */ + strftime (s, m, "%c", tp); /* { dg-warning "some locales" "2-digit year" } */ + strftime (s, m, "%x", tp); /* { dg-warning "some locales" "2-digit year" } */ +} diff --git a/gcc/testsuite/gcc.dg/format/ms_c99-strftime-2.c b/gcc/testsuite/gcc.dg/format/ms_c99-strftime-2.c new file mode 100644 index 00000000000..9a6ae3545ae --- /dev/null +++ b/gcc/testsuite/gcc.dg/format/ms_c99-strftime-2.c @@ -0,0 +1,20 @@ +/* Test for strftime formats. Rejection of extensions in pedantic mode. */ +/* Origin: Joseph Myers <jsm28@cam.ac.uk> */ +/* { dg-do compile { target { *-*-mingw* } } } */ +/* { dg-options "-std=iso9899:1999 -pedantic -Wformat" } */ + +#define USE_SYSTEM_FORMATS +#include "format.h" + +void +foo (char *s, size_t m, const struct tm *tp) +{ + /* %P is a lowercase version of %p. */ + strftime (s, m, "%P", tp); /* { dg-warning "unknown" "strftime %P" } */ + /* %k is %H but padded with a space rather than 0 if necessary. */ + strftime (s, m, "%k", tp); /* { dg-warning "unknown" "strftime %k" } */ + /* %l is %I but padded with a space rather than 0 if necessary. */ + strftime (s, m, "%l", tp); /* { dg-warning "unknown" "strftime %l" } */ + /* %s is the number of seconds since the Epoch. */ + strftime (s, m, "%s", tp); /* { dg-warning "unknown" "strftime %s" } */ +} diff --git a/gcc/testsuite/gcc.dg/format/ms_cast-1.c b/gcc/testsuite/gcc.dg/format/ms_cast-1.c new file mode 100644 index 00000000000..08659616e70 --- /dev/null +++ b/gcc/testsuite/gcc.dg/format/ms_cast-1.c @@ -0,0 +1,17 @@ +/* Test for strings cast through integer types: should not be treated + as format strings unless the types are of the same width as + pointers (intptr_t or similar). */ +/* Origin: Joseph Myers <joseph@codesourcery.com> */ +/* { dg-do compile { target { *-*-mingw* } } } */ +/* { dg-options "-Wformat" } */ + +#define USE_SYSTEM_FORMATS +#include "format.h" + +void +f (int x) +{ + printf("%s", x); /* { dg-warning "format" } */ + printf((char *)(size_t)"%s", x); /* { dg-warning "format" } */ + printf((char *)(char)"%s", x); /* { dg-warning "cast from pointer to integer of different size" } */ +} diff --git a/gcc/testsuite/gcc.dg/format/ms_miss-1.c b/gcc/testsuite/gcc.dg/format/ms_miss-1.c new file mode 100644 index 00000000000..b6c71c04f7b --- /dev/null +++ b/gcc/testsuite/gcc.dg/format/ms_miss-1.c @@ -0,0 +1,40 @@ +/* Test for warnings for missing format attributes. */ +/* Origin: Joseph Myers <jsm28@cam.ac.uk> */ +/* { dg-do compile { target { *-*-mingw* } } } */ +/* { dg-options "-std=gnu99 -Wmissing-format-attribute" } */ + +#define USE_SYSTEM_FORMATS +#include "format.h" + +void +foo (const char *fmt, ...) +{ + va_list ap; + va_start (ap, fmt); + vprintf (fmt, ap); /* { dg-warning "candidate" "printf attribute warning" } */ + va_end (ap); +} + +void +bar (const char *fmt, ...) +{ + va_list ap; + va_start (ap, fmt); + vscanf (fmt, ap); /* { dg-warning "candidate" "scanf attribute warning" } */ + va_end (ap); +} + +__attribute__((__format__(__ms_printf__, 1, 2))) void +foo2 (const char *fmt, ...) +{ + va_list ap; + va_start (ap, fmt); + vprintf (fmt, ap); + va_end (ap); +} + +void +vfoo (const char *fmt, va_list arg) +{ + vprintf (fmt, arg); /* { dg-warning "candidate" "printf attribute warning 2" } */ +} diff --git a/gcc/testsuite/gcc.dg/format/ms_miss-2.c b/gcc/testsuite/gcc.dg/format/ms_miss-2.c new file mode 100644 index 00000000000..e0dd465f889 --- /dev/null +++ b/gcc/testsuite/gcc.dg/format/ms_miss-2.c @@ -0,0 +1,17 @@ +/* Test for warnings for missing format attributes. Don't warn if no + relevant parameters for a format attribute; see c/1017. */ +/* Origin: Joseph Myers <jsm28@cam.ac.uk> */ +/* { dg-do compile { target { *-*-mingw* } } } */ +/* { dg-options "-std=gnu99 -Wmissing-format-attribute" } */ + +#define USE_SYSTEM_FORMATS +#include "format.h" + +void +foo (int i, ...) +{ + va_list ap; + va_start (ap, i); + vprintf ("Foo %s bar %s", ap); /* { dg-bogus "candidate" "bogus printf attribute warning" } */ + va_end (ap); +} diff --git a/gcc/testsuite/gcc.dg/format/ms_miss-3.c b/gcc/testsuite/gcc.dg/format/ms_miss-3.c new file mode 100644 index 00000000000..cf41756c063 --- /dev/null +++ b/gcc/testsuite/gcc.dg/format/ms_miss-3.c @@ -0,0 +1,27 @@ +/* Test warnings for missing format attributes on function pointers. */ +/* Origin: Kaveh Ghazi <ghazi@caip.rutgers.edu> */ +/* { dg-do compile { target { *-*-mingw* } } } */ +/* { dg-options "-std=gnu99 -Wmissing-format-attribute" } */ + +#define USE_SYSTEM_FORMATS +#include "format.h" + +typedef void (*noattr_t) (const char *, ...); +typedef noattr_t __attribute__ ((__format__(__ms_printf__, 1, 2))) attr_t; + +typedef void (*vnoattr_t) (const char *, va_list); +typedef vnoattr_t __attribute__ ((__format__(__ms_printf__, 1, 0))) vattr_t; + +void +foo1 (noattr_t na, attr_t a, vnoattr_t vna, vattr_t va) +{ + noattr_t na1 = na; + noattr_t na2 = a; /* { dg-warning "candidate" "initialization warning" } */ + attr_t a1 = na; + attr_t a2 = a; + + vnoattr_t vna1 = vna; + vnoattr_t vna2 = va; /* { dg-warning "candidate" "initialization warning" } */ + vattr_t va1 = vna; + vattr_t va2 = va; +} diff --git a/gcc/testsuite/gcc.dg/format/ms_miss-4.c b/gcc/testsuite/gcc.dg/format/ms_miss-4.c new file mode 100644 index 00000000000..faacf5ce43b --- /dev/null +++ b/gcc/testsuite/gcc.dg/format/ms_miss-4.c @@ -0,0 +1,33 @@ +/* Test warnings for missing format attributes on function pointers. */ +/* Origin: Kaveh Ghazi <ghazi@caip.rutgers.edu> */ +/* { dg-do compile { target { *-*-mingw* } } } */ +/* { dg-options "-std=gnu99 -Wmissing-format-attribute" } */ + +#define USE_SYSTEM_FORMATS +#include "format.h" + +typedef void (*noattr_t) (const char *, ...); +typedef noattr_t __attribute__ ((__format__(__ms_printf__, 1, 2))) attr_t; + +typedef void (*vnoattr_t) (const char *, va_list); +typedef vnoattr_t __attribute__ ((__format__(__ms_printf__, 1, 0))) vattr_t; + +void +foo1 (noattr_t na, attr_t a, vnoattr_t vna, vattr_t va) +{ + noattr_t na1, na2; + attr_t a1, a2; + + vnoattr_t vna1, vna2; + vattr_t va1, va2; + + na1 = na; + na2 = a; /* { dg-warning "candidate" "assignment warning" } */ + a1 = na; + a2 = a; + + vna1 = vna; + vna2 = va; /* { dg-warning "candidate" "assignment warning" } */ + va1 = vna; + va1 = va; +} diff --git a/gcc/testsuite/gcc.dg/format/ms_miss-5.c b/gcc/testsuite/gcc.dg/format/ms_miss-5.c new file mode 100644 index 00000000000..a9f54c3a8ce --- /dev/null +++ b/gcc/testsuite/gcc.dg/format/ms_miss-5.c @@ -0,0 +1,49 @@ +/* Test warnings for missing format attributes on function pointers. */ +/* Origin: Kaveh Ghazi <ghazi@caip.rutgers.edu> */ +/* { dg-do compile { target { *-*-mingw* } } } */ +/* { dg-options "-std=gnu99 -Wmissing-format-attribute" } */ + +#define USE_SYSTEM_FORMATS +#include "format.h" + +typedef void (*noattr_t) (const char *, ...); +typedef noattr_t __attribute__ ((__format__(__ms_printf__, 1, 2))) attr_t; + +typedef void (*vnoattr_t) (const char *, va_list); +typedef vnoattr_t __attribute__ ((__format__(__ms_printf__, 1, 0))) vattr_t; + +noattr_t +foo1 (noattr_t na, attr_t a, int i) +{ + if (i) + return na; + else + return a; /* { dg-warning "candidate" "return type warning" } */ +} + +attr_t +foo2 (noattr_t na, attr_t a, int i) +{ + if (i) + return na; + else + return a; +} + +vnoattr_t +foo3 (vnoattr_t vna, vattr_t va, int i) +{ + if (i) + return vna; + else + return va; /* { dg-warning "candidate" "return type warning" } */ +} + +vattr_t +foo4 (vnoattr_t vna, vattr_t va, int i) +{ + if (i) + return vna; + else + return va; +} diff --git a/gcc/testsuite/gcc.dg/format/ms_miss-6.c b/gcc/testsuite/gcc.dg/format/ms_miss-6.c new file mode 100644 index 00000000000..3e210deee50 --- /dev/null +++ b/gcc/testsuite/gcc.dg/format/ms_miss-6.c @@ -0,0 +1,32 @@ +/* Test warnings for missing format attributes on function pointers. */ +/* Origin: Kaveh Ghazi <ghazi@caip.rutgers.edu> */ +/* { dg-do compile { target { *-*-mingw* } } } */ +/* { dg-options "-std=gnu99 -Wmissing-format-attribute" } */ + +#define USE_SYSTEM_FORMATS +#include "format.h" + +typedef void (*noattr_t) (const char *, ...); +typedef noattr_t __attribute__ ((__format__(__ms_printf__, 1, 2))) attr_t; + +typedef void (*vnoattr_t) (const char *, va_list); +typedef vnoattr_t __attribute__ ((__format__(__ms_printf__, 1, 0))) vattr_t; + +extern void foo1 (noattr_t); +extern void foo2 (attr_t); +extern void foo3 (vnoattr_t); +extern void foo4 (vattr_t); + +void +foo (noattr_t na, attr_t a, vnoattr_t vna, vattr_t va) +{ + foo1 (na); + foo1 (a); /* { dg-warning "candidate" "parameter passing warning" } */ + foo2 (na); + foo2 (a); + + foo3 (vna); + foo3 (va); /* { dg-warning "candidate" "parameter passing warning" } */ + foo4 (vna); + foo4 (va); +} diff --git a/gcc/testsuite/gcc.dg/format/ms_multattr-1.c b/gcc/testsuite/gcc.dg/format/ms_multattr-1.c new file mode 100644 index 00000000000..0936f5f6e0d --- /dev/null +++ b/gcc/testsuite/gcc.dg/format/ms_multattr-1.c @@ -0,0 +1,51 @@ +/* Test for multiple format attributes. Test for printf and scanf attributes + together. */ +/* Origin: Joseph Myers <jsm28@cam.ac.uk> */ +/* { dg-do compile { target { *-*-mingw* } } } */ +/* { dg-options "-std=gnu99 -Wformat" } */ + +#define USE_SYSTEM_FORMATS +#include "format.h" + +/* If we specify multiple attributes for a single function, they should + all apply. This should apply whether they are on the same declaration + or on different declarations. */ + +extern void my_vprintf_scanf (const char *, va_list, const char *, ...) + __attribute__((__format__(__ms_printf__, 1, 0))) + __attribute__((__format__(__ms_scanf__, 3, 4))); + +extern void my_vprintf_scanf2 (const char *, va_list, const char *, ...) + __attribute__((__format__(__ms_scanf__, 3, 4))) + __attribute__((__format__(__ms_printf__, 1, 0))); + +extern void my_vprintf_scanf3 (const char *, va_list, const char *, ...) + __attribute__((__format__(__ms_printf__, 1, 0))); +extern void my_vprintf_scanf3 (const char *, va_list, const char *, ...) + __attribute__((__format__(__ms_scanf__, 3, 4))); + +extern void my_vprintf_scanf4 (const char *, va_list, const char *, ...) + __attribute__((__format__(__ms_scanf__, 3, 4))); +extern void my_vprintf_scanf4 (const char *, va_list, const char *, ...) + __attribute__((__format__(__ms_printf__, 1, 0))); + +void +foo (va_list ap, int *ip, long *lp) +{ + my_vprintf_scanf ("%d", ap, "%d", ip); + my_vprintf_scanf ("%d", ap, "%ld", lp); + my_vprintf_scanf ("%", ap, "%d", ip); /* { dg-warning "format" "printf" } */ + my_vprintf_scanf ("%d", ap, "%ld", ip); /* { dg-warning "format" "scanf" } */ + my_vprintf_scanf2 ("%d", ap, "%d", ip); + my_vprintf_scanf2 ("%d", ap, "%ld", lp); + my_vprintf_scanf2 ("%", ap, "%d", ip); /* { dg-warning "format" "printf" } */ + my_vprintf_scanf2 ("%d", ap, "%ld", ip); /* { dg-warning "format" "scanf" } */ + my_vprintf_scanf3 ("%d", ap, "%d", ip); + my_vprintf_scanf3 ("%d", ap, "%ld", lp); + my_vprintf_scanf3 ("%", ap, "%d", ip); /* { dg-warning "format" "printf" } */ + my_vprintf_scanf3 ("%d", ap, "%ld", ip); /* { dg-warning "format" "scanf" } */ + my_vprintf_scanf4 ("%d", ap, "%d", ip); + my_vprintf_scanf4 ("%d", ap, "%ld", lp); + my_vprintf_scanf4 ("%", ap, "%d", ip); /* { dg-warning "format" "printf" } */ + my_vprintf_scanf4 ("%d", ap, "%ld", ip); /* { dg-warning "format" "scanf" } */ +} diff --git a/gcc/testsuite/gcc.dg/format/ms_multattr-2.c b/gcc/testsuite/gcc.dg/format/ms_multattr-2.c new file mode 100644 index 00000000000..47e20e4d461 --- /dev/null +++ b/gcc/testsuite/gcc.dg/format/ms_multattr-2.c @@ -0,0 +1,40 @@ +/* Test for multiple format attributes. Test for printf and scanf attributes + together, in different places on the declarations. */ +/* Origin: Joseph Myers <jsm28@cam.ac.uk> */ +/* { dg-do compile { target { *-*-mingw* } } } */ +/* { dg-options "-std=gnu99 -Wformat" } */ + +#define USE_SYSTEM_FORMATS +#include "format.h" + +/* If we specify multiple attributes for a single function, they should + all apply, wherever they are placed on the declarations. */ + +extern __attribute__((__format__(__ms_printf__, 1, 0))) void + my_vprintf_scanf (const char *, va_list, const char *, ...) + __attribute__((__format__(__ms_scanf__, 3, 4))); + +extern void (__attribute__((__format__(__ms_printf__, 1, 0))) my_vprintf_scanf2) + (const char *, va_list, const char *, ...) + __attribute__((__format__(__ms_scanf__, 3, 4))); + +extern __attribute__((__format__(__ms_scanf__, 3, 4))) void + (__attribute__((__format__(__ms_printf__, 1, 0))) my_vprintf_scanf3) + (const char *, va_list, const char *, ...); + +void +foo (va_list ap, int *ip, long *lp) +{ + my_vprintf_scanf ("%d", ap, "%d", ip); + my_vprintf_scanf ("%d", ap, "%ld", lp); + my_vprintf_scanf ("%", ap, "%d", ip); /* { dg-warning "format" "printf" } */ + my_vprintf_scanf ("%d", ap, "%ld", ip); /* { dg-warning "format" "scanf" } */ + my_vprintf_scanf2 ("%d", ap, "%d", ip); + my_vprintf_scanf2 ("%d", ap, "%ld", lp); + my_vprintf_scanf2 ("%", ap, "%d", ip); /* { dg-warning "format" "printf" } */ + my_vprintf_scanf2 ("%d", ap, "%ld", ip); /* { dg-warning "format" "scanf" } */ + my_vprintf_scanf3 ("%d", ap, "%d", ip); + my_vprintf_scanf3 ("%d", ap, "%ld", lp); + my_vprintf_scanf3 ("%", ap, "%d", ip); /* { dg-warning "format" "printf" } */ + my_vprintf_scanf3 ("%d", ap, "%ld", ip); /* { dg-warning "format" "scanf" } */ +} diff --git a/gcc/testsuite/gcc.dg/format/ms_multattr-3.c b/gcc/testsuite/gcc.dg/format/ms_multattr-3.c new file mode 100644 index 00000000000..1a247a7a126 --- /dev/null +++ b/gcc/testsuite/gcc.dg/format/ms_multattr-3.c @@ -0,0 +1,29 @@ +/* Test for multiple format_arg attributes. Test for both branches + getting checked. */ +/* Origin: Joseph Myers <jsm28@cam.ac.uk> */ +/* { dg-do compile { target { *-*-mingw* } } } */ +/* { dg-options "-std=gnu99 -Wformat" } */ + +#define USE_SYSTEM_FORMATS +#include "format.h" + +extern char *ngettext (const char *, const char *, unsigned long int) + __attribute__((__format_arg__(1))) __attribute__((__format_arg__(2))); + +void +foo (long l, int nfoo) +{ + printf (ngettext ("%d foo", "%d foos", nfoo), nfoo); + printf (ngettext ("%d foo", "%d foos", l), l); /* { dg-warning "int" "wrong type in conditional expr" } */ + printf (ngettext ("%d foo", "%ld foos", l), l); /* { dg-warning "int" "wrong type in conditional expr" } */ + printf (ngettext ("%ld foo", "%d foos", l), l); /* { dg-warning "int" "wrong type in conditional expr" } */ + /* Should allow one case to have extra arguments. */ + printf (ngettext ("1 foo", "%d foos", nfoo), nfoo); + printf (ngettext ("1 foo", "many foos", nfoo), nfoo); /* { dg-warning "too many" "too many args in all branches" } */ + printf (ngettext ("", "%d foos", nfoo), nfoo); + printf (ngettext ("1 foo", (nfoo > 0) ? "%d foos" : "no foos", nfoo), nfoo); + printf (ngettext ("%d foo", (nfoo > 0) ? "%d foos" : "no foos", nfoo), nfoo); + printf (ngettext ("%ld foo", (nfoo > 0) ? "%d foos" : "no foos", nfoo), nfoo); /* { dg-warning "long int" "wrong type" } */ + printf (ngettext ("%d foo", (nfoo > 0) ? "%ld foos" : "no foos", nfoo), nfoo); /* { dg-warning "long int" "wrong type" } */ + printf (ngettext ("%d foo", (nfoo > 0) ? "%d foos" : "%ld foos", nfoo), nfoo); /* { dg-warning "long int" "wrong type" } */ +} diff --git a/gcc/testsuite/gcc.dg/format/ms_no-exargs-1.c b/gcc/testsuite/gcc.dg/format/ms_no-exargs-1.c new file mode 100644 index 00000000000..659ca3e0bfb --- /dev/null +++ b/gcc/testsuite/gcc.dg/format/ms_no-exargs-1.c @@ -0,0 +1,15 @@ +/* Test for warnings for extra format arguments being disabled by + -Wno-format-extra-args. */ +/* Origin: Joseph Myers <jsm28@cam.ac.uk> */ +/* { dg-do compile { target { *-*-mingw* } } } */ +/* { dg-options "-std=gnu99 -Wformat -Wno-format-extra-args" } */ + +#define USE_SYSTEM_FORMATS +#include "format.h" + +void +foo (int i) +{ + printf ("foo", i); + printf ("%1$d", i, i); +} diff --git a/gcc/testsuite/gcc.dg/format/ms_no-exargs-2.c b/gcc/testsuite/gcc.dg/format/ms_no-exargs-2.c new file mode 100644 index 00000000000..654241ddff4 --- /dev/null +++ b/gcc/testsuite/gcc.dg/format/ms_no-exargs-2.c @@ -0,0 +1,28 @@ +/* Test for warnings for extra format arguments being disabled by + -Wno-format-extra-args. Test which warnings still apply with $ + operand numbers. */ +/* Origin: Joseph Myers <jsm28@cam.ac.uk> */ +/* { dg-do compile { target { *-*-mingw* } } } */ +/* { dg-options "-std=gnu99 -Wformat -Wno-format-extra-args" } */ + +#define USE_SYSTEM_FORMATS +#include "format.h" + +void +foo (int i, int *ip, va_list va) +{ + printf ("%3$d%1$d", i, i, i); /* { dg-warning "before used" "unused $ operand" } */ + printf ("%2$d%1$d", i, i, i); + vprintf ("%3$d%1$d", va); /* { dg-warning "before used" "unused $ operand" } */ + /* With scanf formats, gaps in the used arguments are allowed only if the + arguments are all pointers. In such a case, should only give the lesser + warning about unused arguments rather than the more serious one about + argument gaps. */ + scanf ("%3$d%1$d", ip, ip, ip); + /* If there are non-pointer arguments unused at the end, this is also OK. */ + scanf ("%3$d%1$d", ip, ip, ip, i); + scanf ("%3$d%1$d", ip, i, ip); /* { dg-warning "before used" "unused $ scanf non-pointer operand" } */ + /* Can't check the arguments in the vscanf case, so should suppose the + lesser problem. */ + vscanf ("%3$d%1$d", va); +} diff --git a/gcc/testsuite/gcc.dg/format/ms_no-y2k-1.c b/gcc/testsuite/gcc.dg/format/ms_no-y2k-1.c new file mode 100644 index 00000000000..aed760aab5f --- /dev/null +++ b/gcc/testsuite/gcc.dg/format/ms_no-y2k-1.c @@ -0,0 +1,13 @@ +/* Test for warnings for Y2K problems not being on by default. */ +/* Origin: Joseph Myers <jsm28@cam.ac.uk> */ +/* { dg-do compile { target { *-*-mingw* } } } */ +/* { dg-options "-std=gnu99 -Wformat" } */ + +#define USE_SYSTEM_FORMATS +#include "format.h" + +void +foo (char *s, size_t m, const struct tm *tp) +{ + strftime (s, m, "%y%c%x", tp); +} diff --git a/gcc/testsuite/gcc.dg/format/ms_nonlit-1.c b/gcc/testsuite/gcc.dg/format/ms_nonlit-1.c new file mode 100644 index 00000000000..b29c0080e0f --- /dev/null +++ b/gcc/testsuite/gcc.dg/format/ms_nonlit-1.c @@ -0,0 +1,14 @@ +/* Test for warnings for non-string-literal formats. */ +/* Origin: Joseph Myers <jsm28@cam.ac.uk> */ +/* { dg-do compile { target { *-*-mingw* } } } */ +/* { dg-options "-std=gnu99 -Wformat -Wformat-nonliteral" } */ + +#define USE_SYSTEM_FORMATS +#include "format.h" + +void +foo (char *s, size_t i) +{ + printf ((const char *)i, i); /* { dg-warning "argument types" "non-literal" } */ + printf (s, i); /* { dg-warning "argument types" "non-literal" } */ +} diff --git a/gcc/testsuite/gcc.dg/format/ms_nonlit-2.c b/gcc/testsuite/gcc.dg/format/ms_nonlit-2.c new file mode 100644 index 00000000000..e60242187e0 --- /dev/null +++ b/gcc/testsuite/gcc.dg/format/ms_nonlit-2.c @@ -0,0 +1,14 @@ +/* Test for warnings for non-string-literal formats. Test with -Wformat=2. */ +/* Origin: Joseph Myers <jsm28@cam.ac.uk> */ +/* { dg-do compile { target { *-*-mingw* } } } */ +/* { dg-options "-std=gnu99 -Wformat=2" } */ + +#define USE_SYSTEM_FORMATS +#include "format.h" + +void +foo (char *s, size_t i) +{ + printf ((const char *)i, i); /* { dg-warning "argument types" "non-literal" } */ + printf (s, i); /* { dg-warning "argument types" "non-literal" } */ +} diff --git a/gcc/testsuite/gcc.dg/format/ms_nonlit-3.c b/gcc/testsuite/gcc.dg/format/ms_nonlit-3.c new file mode 100644 index 00000000000..e8c8933bc7c --- /dev/null +++ b/gcc/testsuite/gcc.dg/format/ms_nonlit-3.c @@ -0,0 +1,13 @@ +/* Test for warnings for non-string-literal formats. Test for strftime formats. */ +/* Origin: Joseph Myers <jsm28@cam.ac.uk> */ +/* { dg-do compile { target { *-*-mingw* } } } */ +/* { dg-options "-std=gnu99 -Wformat -Wformat-nonliteral" } */ + +#define USE_SYSTEM_FORMATS +#include "format.h" + +void +foo (char *s, size_t m, const struct tm *tp, char *fmt) +{ + strftime (s, m, fmt, tp); /* { dg-warning "format string" "non-literal" } */ +} diff --git a/gcc/testsuite/gcc.dg/format/ms_nul-1.c b/gcc/testsuite/gcc.dg/format/ms_nul-1.c new file mode 100644 index 00000000000..50bfd546d5a --- /dev/null +++ b/gcc/testsuite/gcc.dg/format/ms_nul-1.c @@ -0,0 +1,15 @@ +/* Test diagnostics for suppressing contains nul + -Wformat. -Wformat. */ +/* Origin: Bruce Korb <bkorb@gnu.org> */ +/* { dg-do compile { target { *-*-mingw* } } } */ +/* { dg-options "-Wformat -Wno-format-contains-nul" } */ + +#define USE_SYSTEM_FORMATS +#include "format.h" + +void +foo (void) +{ + static char const fmt[] = "x%s\0%s\n\0abc"; + printf (fmt+4, fmt+8); /* { dg-bogus "embedded.*in format" "bogus embed warning" } */ +} diff --git a/gcc/testsuite/gcc.dg/format/ms_nul-2.c b/gcc/testsuite/gcc.dg/format/ms_nul-2.c new file mode 100644 index 00000000000..3dfc3c62f97 --- /dev/null +++ b/gcc/testsuite/gcc.dg/format/ms_nul-2.c @@ -0,0 +1,17 @@ +/* Test diagnostics for options used on their own without + -Wformat. -Wformat-. */ +/* Origin: Bruce Korb <bkorb@gnu.org> */ +/* { dg-do compile { target { *-*-mingw* } } } */ +/* { dg-options "-Wformat" } */ + +/* { dg-warning "embedded .* in format" "ignored" { target *-*-* } 0 } */ + +#define USE_SYSTEM_FORMATS +#include "format.h" + +void +fumble (void) +{ + static char const fmt[] = "x%s\0%s\n\0abc"; + printf (fmt+4, fmt+8); +} diff --git a/gcc/testsuite/gcc.dg/format/ms_null-1.c b/gcc/testsuite/gcc.dg/format/ms_null-1.c new file mode 100644 index 00000000000..91495016ebc --- /dev/null +++ b/gcc/testsuite/gcc.dg/format/ms_null-1.c @@ -0,0 +1,28 @@ +/* Test for some aspects of null format string handling. */ +/* Origin: Jason Thorpe <thorpej@wasabisystems.com> */ +/* { dg-do compile { target { *-*-mingw* } } } */ +/* { dg-options "-std=gnu99 -Wformat" } */ + +#define USE_SYSTEM_FORMATS +#include "format.h" + +extern void my_printf (const char *, ...) __attribute__((format(ms_printf,1,2))); +extern const char *my_format (const char *, const char *) + __attribute__((format_arg(2))); + +void +foo (int i1) +{ + /* Warning about a null format string has been decoupled from the actual + format check. However, we still expect to be warned about any excess + arguments after a null format string. */ + my_printf (NULL); + my_printf (NULL, i1); /* { dg-warning "too many" "null format with arguments" } */ + + my_printf (my_format ("", NULL)); + my_printf (my_format ("", NULL), i1); /* { dg-warning "too many" "null format_arg with arguments" } */ + + /* While my_printf allows a null argument, dgettext does not, so we expect + a null argument warning here. */ + my_printf (dgettext ("", NULL)); /* { dg-warning "null" "null format with dgettext" } */ +} diff --git a/gcc/testsuite/gcc.dg/format/ms_plus-1.c b/gcc/testsuite/gcc.dg/format/ms_plus-1.c new file mode 100644 index 00000000000..f6eba280acc --- /dev/null +++ b/gcc/testsuite/gcc.dg/format/ms_plus-1.c @@ -0,0 +1,21 @@ +/* Test for printf formats using string literal plus constant. + */ +/* Origin: Jakub Jelinek <jakub@redhat.com> */ +/* { dg-do compile { target { *-*-mingw* } } } */ +/* { dg-options "-std=iso9899:1990 -pedantic -Wformat=2" } */ + +#define USE_SYSTEM_FORMATS +#include "format.h" + +void +foo (int i) +{ + printf ("%%d\n" + 1, i); + printf (5 + "%.-*d%3d\n", i); + printf ("%d%d" + 2, i, i); /* { dg-warning "arguments" "wrong number of args" } */ + printf (3 + "%d\n"); /* { dg-warning "zero-length" "zero-length string" } */ + printf ("%d\n" + i, i); /* { dg-warning "not a string" "non-constant addend" } */ + printf ("%d\n" + 10); /* { dg-warning "not a string" "too large addend" } */ + printf ("%d\n" - 1, i); /* { dg-warning "not a string" "minus constant" } */ + printf ("%d\n" + -1, i); /* { dg-warning "not a string" "negative addend" } */ +} diff --git a/gcc/testsuite/gcc.dg/format/ms_sec-1.c b/gcc/testsuite/gcc.dg/format/ms_sec-1.c new file mode 100644 index 00000000000..5f6b76726fc --- /dev/null +++ b/gcc/testsuite/gcc.dg/format/ms_sec-1.c @@ -0,0 +1,13 @@ +/* Test for security warning when non-literal format has no arguments. */ +/* Origin: Joseph Myers <jsm28@cam.ac.uk> */ +/* { dg-do compile { target { *-*-mingw* } } } */ +/* { dg-options "-std=gnu99 -Wformat -Wformat-security" } */ + +#define USE_SYSTEM_FORMATS +#include "format.h" + +void +foo (char *s) +{ + printf (s); /* { dg-warning "no format arguments" "security warning" } */ +} diff --git a/gcc/testsuite/gcc.dg/format/ms_unnamed-1.c b/gcc/testsuite/gcc.dg/format/ms_unnamed-1.c new file mode 100644 index 00000000000..aa4f6cb5f3d --- /dev/null +++ b/gcc/testsuite/gcc.dg/format/ms_unnamed-1.c @@ -0,0 +1,24 @@ +/* Test for warnings with possibly unnamed integer types. Bug 24329. */ +/* Origin: Joseph Myers <joseph@codesourcery.com> */ +/* { dg-do compile { target { *-*-mingw* } } } */ +/* { dg-options "-Wformat" } */ +/* { dg-options "-Wformat -msse" { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */ + +#define USE_SYSTEM_FORMATS +#include "format.h" + +/* Definition of TItype follows same logic as in gcc.dg/titype-1.c, + but must be a #define to avoid giving the type a name. */ +#if defined(__LP64__) && !defined(__hppa__) +#define TItype int __attribute__ ((mode (TI))) +#else +#define TItype long +#endif + +void +f (TItype x) +{ + printf("%d", x); /* { dg-warning "expects type" } */ + printf("%d", 141592653589793238462643383279502884197169399375105820974944); /* { dg-warning "expects type" } */ + /* { dg-warning "unsigned only|too large" "constant" { target *-*-* } 22 } */ +} diff --git a/gcc/testsuite/gcc.dg/format/ms_va-1.c b/gcc/testsuite/gcc.dg/format/ms_va-1.c new file mode 100644 index 00000000000..97d2979e8f2 --- /dev/null +++ b/gcc/testsuite/gcc.dg/format/ms_va-1.c @@ -0,0 +1,14 @@ +/* Test for strange warning in format checking. */ +/* Origin: Joseph Myers <jsm28@cam.ac.uk> */ +/* { dg-do compile { target { *-*-mingw* } } } */ +/* { dg-options "-Wformat" } */ + +#define USE_SYSTEM_FORMATS +#include "format.h" + +void +foo (void *p) +{ + printf ("%d", p); /* { dg-bogus "va_list" "wrong type in format warning" } */ + /* { dg-warning "format" "format error" { target *-*-* } 12 } */ +} diff --git a/gcc/testsuite/gcc.dg/format/ms_zero-length-1.c b/gcc/testsuite/gcc.dg/format/ms_zero-length-1.c new file mode 100644 index 00000000000..d024458a4e4 --- /dev/null +++ b/gcc/testsuite/gcc.dg/format/ms_zero-length-1.c @@ -0,0 +1,16 @@ +/* Test the -Wno-format-zero-length option, which suppresses warnings + about zero-length formats. */ +/* Origin: Jason Thorpe <thorpej@wasabisystems.com> */ +/* { dg-do compile { target { *-*-mingw* } } } */ +/* { dg-options "-std=iso9899:1990 -pedantic -Wformat -Wno-format-zero-length" } */ + +#define USE_SYSTEM_FORMATS +#include "format.h" + +void +foo (void) +{ + /* See ISO/IEC 9899:1990 (E) subclause 7.9.6.1 (pages 131-134). */ + /* Zero-length format strings are allowed. */ + printf (""); +} diff --git a/gcc/testsuite/gcc.dg/format/multattr-1.c b/gcc/testsuite/gcc.dg/format/multattr-1.c index 7691aba5bd8..c7404bedf8b 100644 --- a/gcc/testsuite/gcc.dg/format/multattr-1.c +++ b/gcc/testsuite/gcc.dg/format/multattr-1.c @@ -4,6 +4,7 @@ /* { dg-do compile } */ /* { dg-options "-std=gnu99 -Wformat" } */ +#define DONT_GNU_PROTOTYPE #include "format.h" /* If we specify multiple attributes for a single function, they should @@ -11,22 +12,22 @@ or on different declarations. */ extern void my_vprintf_scanf (const char *, va_list, const char *, ...) - __attribute__((__format__(__printf__, 1, 0))) - __attribute__((__format__(__scanf__, 3, 4))); + __attribute__((__format__(gnu_attr___printf__, 1, 0))) + __attribute__((__format__(gnu_attr___scanf__, 3, 4))); extern void my_vprintf_scanf2 (const char *, va_list, const char *, ...) - __attribute__((__format__(__scanf__, 3, 4))) - __attribute__((__format__(__printf__, 1, 0))); + __attribute__((__format__(gnu_attr___scanf__, 3, 4))) + __attribute__((__format__(gnu_attr___printf__, 1, 0))); extern void my_vprintf_scanf3 (const char *, va_list, const char *, ...) - __attribute__((__format__(__printf__, 1, 0))); + __attribute__((__format__(gnu_attr___printf__, 1, 0))); extern void my_vprintf_scanf3 (const char *, va_list, const char *, ...) - __attribute__((__format__(__scanf__, 3, 4))); + __attribute__((__format__(gnu_attr___scanf__, 3, 4))); extern void my_vprintf_scanf4 (const char *, va_list, const char *, ...) - __attribute__((__format__(__scanf__, 3, 4))); + __attribute__((__format__(gnu_attr___scanf__, 3, 4))); extern void my_vprintf_scanf4 (const char *, va_list, const char *, ...) - __attribute__((__format__(__printf__, 1, 0))); + __attribute__((__format__(gnu_attr___printf__, 1, 0))); void foo (va_list ap, int *ip, long *lp) diff --git a/gcc/testsuite/gcc.dg/format/multattr-2.c b/gcc/testsuite/gcc.dg/format/multattr-2.c index 1d78840aecb..4011bf14585 100644 --- a/gcc/testsuite/gcc.dg/format/multattr-2.c +++ b/gcc/testsuite/gcc.dg/format/multattr-2.c @@ -4,21 +4,22 @@ /* { dg-do compile } */ /* { dg-options "-std=gnu99 -Wformat" } */ +#define DONT_GNU_PROTOTYPE #include "format.h" /* If we specify multiple attributes for a single function, they should all apply, wherever they are placed on the declarations. */ -extern __attribute__((__format__(__printf__, 1, 0))) void +extern __attribute__((__format__(gnu_attr___printf__, 1, 0))) void my_vprintf_scanf (const char *, va_list, const char *, ...) - __attribute__((__format__(__scanf__, 3, 4))); + __attribute__((__format__(gnu_attr___scanf__, 3, 4))); -extern void (__attribute__((__format__(__printf__, 1, 0))) my_vprintf_scanf2) +extern void (__attribute__((__format__(gnu_attr___printf__, 1, 0))) my_vprintf_scanf2) (const char *, va_list, const char *, ...) - __attribute__((__format__(__scanf__, 3, 4))); + __attribute__((__format__(gnu_attr___scanf__, 3, 4))); -extern __attribute__((__format__(__scanf__, 3, 4))) void - (__attribute__((__format__(__printf__, 1, 0))) my_vprintf_scanf3) +extern __attribute__((__format__(gnu_attr___scanf__, 3, 4))) void + (__attribute__((__format__(gnu_attr___printf__, 1, 0))) my_vprintf_scanf3) (const char *, va_list, const char *, ...); void diff --git a/gcc/testsuite/gcc.dg/format/null-1.c b/gcc/testsuite/gcc.dg/format/null-1.c index 63501a3981e..ed714442be9 100644 --- a/gcc/testsuite/gcc.dg/format/null-1.c +++ b/gcc/testsuite/gcc.dg/format/null-1.c @@ -3,9 +3,10 @@ /* { dg-do compile } */ /* { dg-options "-std=gnu99 -Wformat" } */ +#define DONT_GNU_PROTOTYPE #include "format.h" -extern void my_printf (const char *, ...) __attribute__((format(printf,1,2))); +extern void my_printf (const char *, ...) __attribute__((format(gnu_attr_printf,1,2))); extern const char *my_format (const char *, const char *) __attribute__((format_arg(2))); diff --git a/gcc/testsuite/gcc.dg/format/sys_format.c b/gcc/testsuite/gcc.dg/format/sys_format.c new file mode 100755 index 00000000000..b69ae5bc5b5 --- /dev/null +++ b/gcc/testsuite/gcc.dg/format/sys_format.c @@ -0,0 +1,14 @@ +/* Test system default printf formatter specifiers. */ +/* Origin: Kai Tietz <KaiTietz.@onevision.com> */ +/* { dg-do compile { target { *-*-mingw* } } } */ +/* { dg-options "-std=gnu89" } */ + +#define USE_SYSTEM_FORMATS +#include "format.h" + +__attribute__((format(printf, 1, 2))) void foo (const char *, ...); + +void bar (long long v1, long v2, int v3) +{ + foo ("%I64d %I32d %ld %d\n", v1, v2, v2, v3); +} diff --git a/gcc/testsuite/gcc.dg/pr30957-1.c b/gcc/testsuite/gcc.dg/pr30957-1.c index 44cdf9db9b0..65b98fa533d 100644 --- a/gcc/testsuite/gcc.dg/pr30957-1.c +++ b/gcc/testsuite/gcc.dg/pr30957-1.c @@ -6,7 +6,7 @@ they can not co-exist; also under -funsafe-math-optimizations, so we expect it to fail. */ /* { dg-require-effective-target hard_float } */ -/* { dg-options "-O2 -funroll-loops -funsafe-math-optimizations -fvariable-expansion-in-unroller -dL" } */ +/* { dg-options "-O2 -funroll-loops -funsafe-math-optimizations -fvariable-expansion-in-unroller -fdump-rtl-loop2_unroll" } */ extern void abort (void); extern void exit (int); diff --git a/gcc/testsuite/gcc.dg/pr35616.c b/gcc/testsuite/gcc.dg/pr35616.c new file mode 100644 index 00000000000..ad2c9e99e99 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr35616.c @@ -0,0 +1,43 @@ +/* { dg-do run } */ +/* { dg-options "-O2" } */ +typedef void (*listener_fun)( + int a, + int b, + int c); + +struct data_t +{ + int a; + + listener_fun listener; + + int b; + int c; + int d; +}; + +extern void abort(void); +void function_calling_listener (struct data_t data); + +void function_calling_listener (struct data_t data) +{ + data.listener(data.a, data.c, data.d); +} + +void my_listener(int a, int b, int c) +{ + if (a != 42 || b != 44 || c != 45) + abort (); +} + +int main() +{ + struct data_t d; + d.a = 42; + d.b = 43; + d.c = 44; + d.d = 45; + d.listener = my_listener; + function_calling_listener (d); + return 0; +} diff --git a/gcc/testsuite/gcc.dg/sms-2.c b/gcc/testsuite/gcc.dg/sms-2.c index 918f6c82378..04d0482ca8c 100644 --- a/gcc/testsuite/gcc.dg/sms-2.c +++ b/gcc/testsuite/gcc.dg/sms-2.c @@ -2,7 +2,7 @@ traversal of the loops after versioning. */ /* { dg-do compile } */ -/* { dg-options "-O2 -fmodulo-sched -dm" } */ +/* { dg-options "-O2 -fmodulo-sched -fdump-rtl-sms" } */ void diff --git a/gcc/testsuite/gcc.dg/tree-ssa/forwprop-4.c b/gcc/testsuite/gcc.dg/tree-ssa/forwprop-4.c new file mode 100644 index 00000000000..7eabd1a7bd8 --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/forwprop-4.c @@ -0,0 +1,18 @@ +/* { dg-do compile } */ +/* { dg-options "-O -fdump-tree-forwprop1" } */ + +/* We should be able to fold the comparison at least with the + first forwprop pass, if not a ccp pass before. */ + +extern void link_error (void); +void foo() +{ + int i; + char *p = (char *)&i; + long *q = (long *)p; + if (q == 0) + link_error (); +} + +/* { dg-final { scan-tree-dump-not "link_error" "forwprop1" } } */ +/* { dg-final { cleanup-tree-dump "forwprop1" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/loop-19.c b/gcc/testsuite/gcc.dg/tree-ssa/loop-19.c index 1614f7e4de1..748c6e81434 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/loop-19.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/loop-19.c @@ -6,7 +6,7 @@ /* { dg-do compile { target i?86-*-* x86_64-*-* powerpc*-*-*} } */ /* { dg-require-effective-target nonpic } */ -/* { dg-options "-O2 -fdump-tree-final_cleanup" } */ +/* { dg-options "-O3 -fdump-tree-final_cleanup" } */ # define N 2000000 static double a[N],c[N]; diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-16.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-16.c new file mode 100644 index 00000000000..56d85e58e7f --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-16.c @@ -0,0 +1,18 @@ +/* { dg-do compile } */ +/* { dg-options "-O -fdump-tree-fre" } */ + +/* FRE should be able to combine i and j and perform simplification + on the condition. */ + +extern void link_error (void); +int i; +int foo(int b, int c) +{ + i = b + 1; + int j = i - 1; + if (b != j) + link_error (); +} + +/* { dg-final { scan-tree-dump-not "link_error" "fre" } } */ +/* { dg-final { cleanup-tree-dump "fre" } } */ diff --git a/gcc/testsuite/gcc.dg/uninit-15.c b/gcc/testsuite/gcc.dg/uninit-15.c new file mode 100644 index 00000000000..dee7a3b211c --- /dev/null +++ b/gcc/testsuite/gcc.dg/uninit-15.c @@ -0,0 +1,17 @@ +/* { dg-do compile } */ +/* { dg-options "-O -Wuninitialized" } */ + +inline int foo (int i) +{ + if (i) return 1; /* { dg-warning "is used uninitialized" } */ + return 0; +} + +void baz(); + +void bar() +{ + int j; /* { dg-message "was declared here" } */ + for (; foo(j); ++j) + baz(); +} diff --git a/gcc/testsuite/gcc.dg/uninit-16.c b/gcc/testsuite/gcc.dg/uninit-16.c new file mode 100644 index 00000000000..aefb5e5f7d2 --- /dev/null +++ b/gcc/testsuite/gcc.dg/uninit-16.c @@ -0,0 +1,22 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -Wuninitialized" } */ + +int foo, bar; + +void decode_reloc(int reloc, int *is_alt) +{ + if (reloc >= 20) + *is_alt = 1; + else if (reloc >= 10) + *is_alt = 0; +} + +void testfunc() +{ + int alt_reloc; + + decode_reloc(foo, &alt_reloc); + + if (alt_reloc) /* { dg-warning "may be used uninitialized" } */ + bar = 42; +} diff --git a/gcc/testsuite/gcc.dg/var-expand1.c b/gcc/testsuite/gcc.dg/var-expand1.c index 707e346d63b..3904407c44d 100644 --- a/gcc/testsuite/gcc.dg/var-expand1.c +++ b/gcc/testsuite/gcc.dg/var-expand1.c @@ -2,7 +2,7 @@ /* We don't (and don't want to) perform this optimisation on soft-float targets, where each addition is a library call. */ /* { dg-require-effective-target hard_float } */ -/* { dg-options "-O2 -funroll-loops --fast-math -fvariable-expansion-in-unroller -dL" } */ +/* { dg-options "-O2 -funroll-loops --fast-math -fvariable-expansion-in-unroller -fdump-rtl-loop2_unroll" } */ extern void abort (void); diff --git a/gcc/testsuite/gcc.dg/var-expand3.c b/gcc/testsuite/gcc.dg/var-expand3.c index 6ccf59ef7ee..e82fb3ceb28 100644 --- a/gcc/testsuite/gcc.dg/var-expand3.c +++ b/gcc/testsuite/gcc.dg/var-expand3.c @@ -1,5 +1,5 @@ /* { dg-do run { target { powerpc*-*-* && powerpc_altivec_ok } } }} */ -/* { dg-options "-O2 -funroll-loops -ffast-math -fvariable-expansion-in-unroller -maltivec -dL" } */ +/* { dg-options "-O2 -funroll-loops -ffast-math -fvariable-expansion-in-unroller -maltivec -fdump-rtl-loop2" } */ #include "altivec.h" extern void abort (void); diff --git a/gcc/testsuite/gcc.target/i386/pr14552.c b/gcc/testsuite/gcc.target/i386/pr14552.c new file mode 100644 index 00000000000..659257c3290 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr14552.c @@ -0,0 +1,16 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -mmmx" } */ + +typedef short mmxw __attribute__ ((vector_size (8))); +typedef int mmxdw __attribute__ ((vector_size (8))); + +mmxdw dw; +mmxw w; + +void test() +{ + w+=w; + dw= (mmxdw)w; +} + +/* { dg-final { scan-assembler-not "%mm" } } */ diff --git a/gcc/testsuite/gcc.target/ia64/visibility-1.c b/gcc/testsuite/gcc.target/ia64/visibility-1.c index 53bc2c3f785..fdccab3c750 100644 --- a/gcc/testsuite/gcc.target/ia64/visibility-1.c +++ b/gcc/testsuite/gcc.target/ia64/visibility-1.c @@ -19,9 +19,11 @@ static struct A variable_l __attribute__((section (".sbss"))); struct A variable_m __attribute__((visibility ("hidden"), section(".sbss"))); struct A variable_n __attribute__((section (".sbss"))); -int foo (void) +void foo (void) { - return variable_i + variable_j + variable_k; + variable_i = 0; + variable_j = 0; + variable_k = 0; } void bar (void) diff --git a/gcc/testsuite/gfortran.dg/argument_checking_16.f90 b/gcc/testsuite/gfortran.dg/argument_checking_16.f90 new file mode 100644 index 00000000000..75b2eced122 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/argument_checking_16.f90 @@ -0,0 +1,9 @@ +! { dg-do compile } +! PR fortran/35152 - implicit procedure with keyword=argument + +external bar + +call bar(a=5) ! { dg-error "requires explicit interface" } +call foo(a=5) ! { dg-error "requires explicit interface" } +end + diff --git a/gcc/testsuite/gfortran.dg/internal_pack_1.f90 b/gcc/testsuite/gfortran.dg/internal_pack_1.f90 new file mode 100644 index 00000000000..87565bee322 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/internal_pack_1.f90 @@ -0,0 +1,85 @@ +! { dg-do run } +! Test that the internal pack and unpack routines work OK +! for different data types + +program main + integer(kind=1), dimension(3) :: i1 + integer(kind=2), dimension(3) :: i2 + integer(kind=4), dimension(3) :: i4 + integer(kind=8), dimension(3) :: i8 + real(kind=4), dimension(3) :: r4 + real(kind=8), dimension(3) :: r8 + + i1 = (/ -1, 1, -3 /) + call sub_i1(i1(1:3:2)) + if (any(i1 /= (/ 3, 1, 2 /))) call abort + + i2 = (/ -1, 1, -3 /) + call sub_i2(i2(1:3:2)) + if (any(i2 /= (/ 3, 1, 2 /))) call abort + + i4 = (/ -1, 1, -3 /) + call sub_i4(i4(1:3:2)) + if (any(i4 /= (/ 3, 1, 2 /))) call abort + + i8 = (/ -1, 1, -3 /) + call sub_i8(i8(1:3:2)) + if (any(i8 /= (/ 3, 1, 2 /))) call abort + + r4 = (/ -1.0, 1.0, -3.0 /) + call sub_r4(r4(1:3:2)) + if (any(r4 /= (/ 3.0, 1.0, 2.0/))) call abort + + r8 = (/ -1.0_8, 1.0_8, -3.0_8 /) + call sub_r8(r8(1:3:2)) + if (any(r8 /= (/ 3.0_8, 1.0_8, 2.0_8/))) call abort + +end program main + +subroutine sub_i1(i) + integer(kind=1), dimension(2) :: i + if (i(1) /= -1) call abort + if (i(2) /= -3) call abort + i(1) = 3 + i(2) = 2 +end subroutine sub_i1 + +subroutine sub_i2(i) + integer(kind=2), dimension(2) :: i + if (i(1) /= -1) call abort + if (i(2) /= -3) call abort + i(1) = 3 + i(2) = 2 +end subroutine sub_i2 + +subroutine sub_i4(i) + integer(kind=4), dimension(2) :: i + if (i(1) /= -1) call abort + if (i(2) /= -3) call abort + i(1) = 3 + i(2) = 2 +end subroutine sub_i4 + +subroutine sub_i8(i) + integer(kind=8), dimension(2) :: i + if (i(1) /= -1) call abort + if (i(2) /= -3) call abort + i(1) = 3 + i(2) = 2 +end subroutine sub_i8 + +subroutine sub_r4(r) + real(kind=4), dimension(2) :: r + if (r(1) /= -1.) call abort + if (r(2) /= -3.) call abort + r(1) = 3. + r(2) = 2. +end subroutine sub_r4 + +subroutine sub_r8(r) + real(kind=8), dimension(2) :: r + if (r(1) /= -1._8) call abort + if (r(2) /= -3._8) call abort + r(1) = 3._8 + r(2) = 2._8 +end subroutine sub_r8 diff --git a/gcc/testsuite/gfortran.dg/internal_pack_2.f90 b/gcc/testsuite/gfortran.dg/internal_pack_2.f90 new file mode 100644 index 00000000000..1966e7d05d2 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/internal_pack_2.f90 @@ -0,0 +1,25 @@ +! { dg-do run } +! { dg-require-effective-target fortran_large_real } +! Test that the internal pack and unpack routines work OK +! for our large real type. + +program main + implicit none + integer,parameter :: k = selected_real_kind (precision (0.0_8) + 1) + real(kind=k), dimension(3) :: rk + + rk = (/ -1.0_k, 1.0_k, -3.0_k /) + call sub_rk(rk(1:3:2)) + if (any(rk /= (/ 3.0_k, 1.0_k, 2.0_k/))) call abort + +end program main + +subroutine sub_rk(r) + implicit none + integer,parameter :: k = selected_real_kind (precision (0.0_8) + 1) + real(kind=k), dimension(2) :: r + if (r(1) /= -1._k) call abort + if (r(2) /= -3._k) call abort + r(1) = 3._k + r(2) = 2._k +end subroutine sub_rk diff --git a/gcc/testsuite/gfortran.dg/internal_pack_3.f90 b/gcc/testsuite/gfortran.dg/internal_pack_3.f90 new file mode 100644 index 00000000000..8312e1d2265 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/internal_pack_3.f90 @@ -0,0 +1,21 @@ +! { dg-do run } +! { dg-require-effective-target fortran_large_int } +! Test that the internal pack and unpack routines work OK +! for our large integer type. + +program main + integer,parameter :: k = selected_int_kind (range (0_8) + 1) + integer(kind=k), dimension(3) :: ik + + ik = (/ -1, 1, -3 /) + call sub_ik(ik(1:3:2)) + if (any(ik /= (/ 3, 1, 2 /))) call abort +end program main + +subroutine sub_ik(i) + integer(kind=k), dimension(2) :: i + if (i(1) /= -1) call abort + if (i(2) /= -3) call abort + i(1) = 3 + i(2) = 2 +end subroutine sub_ik diff --git a/gcc/testsuite/gfortran.dg/namelist_45.f90 b/gcc/testsuite/gfortran.dg/namelist_45.f90 new file mode 100644 index 00000000000..3512d08b7cc --- /dev/null +++ b/gcc/testsuite/gfortran.dg/namelist_45.f90 @@ -0,0 +1,18 @@ +! { dg-do run } +! PR35617 read namelist error with '!' +program test + character(len=128) :: mhdpath + namelist /nbdrive_naml/ mhdpath + open(10, file='test.nml') + + write(10,'(a)') "&nbdrive_naml" + write(10,'(a)') + write(10,'(a)') "!nstep_stop = 2 ! uncomment to bar" + write(10,'(a)') "!nstep_start = 2 ! uncomment to foo" + write(10,'(a)') " mhdpath = 'mypath.dat'" + write(10,'(a)') "/" + + rewind(10) + read(10, nbdrive_naml) + close(10,status="delete") +end program test diff --git a/gcc/testsuite/gfortran.dg/namelist_46.f90 b/gcc/testsuite/gfortran.dg/namelist_46.f90 new file mode 100644 index 00000000000..0f048cf2100 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/namelist_46.f90 @@ -0,0 +1,23 @@ +! { dg-do run } +! PR35627 Namelist read problem with short logical followed by read real +program test + implicit none + LOGICAL :: nlco(200) ! (1:nbeam) + REAL(kind=8):: xlbtna(200) ! (1:nbeam) + NAMELIST/nbdrive_naml/ nlco, xlbtna + INTEGER :: nbshapa(200) ! (1:nbeam) + NAMELIST/nbdrive_naml/ nbshapa + nlco = .false. + xlbtna = 0.0_8 + nbshapa = 0 + open(10, file='t.nml') + write(10,'(a)') "&nbdrive_naml" + write(10,'(a)') "nlco = 4*T," + write(10,'(a)') "xlbtna = 802.8, 802.8, 802.8, 802.8" + write(10,'(a)') "nbshapa = 4*1" + write(10,'(a)') "/" + rewind(10) + read(10, nbdrive_naml) + !write(*,nbdrive_naml) + close(10, status="delete") +end program test diff --git a/gcc/toplev.c b/gcc/toplev.c index 26b48a5a9e6..5504f801ae7 100644 --- a/gcc/toplev.c +++ b/gcc/toplev.c @@ -1078,6 +1078,8 @@ decode_d_option (const char *arg) break; case 'D': /* These are handled by the preprocessor. */ case 'I': + case 'M': + case 'N': break; case 'H': setup_core_dumping(); diff --git a/gcc/tracer.c b/gcc/tracer.c index e82238201fe..1d5099ae05f 100644 --- a/gcc/tracer.c +++ b/gcc/tracer.c @@ -378,8 +378,10 @@ gate_tracer (void) return (optimize > 0 && flag_tracer && flag_reorder_blocks); } -struct tree_opt_pass pass_tracer = +struct gimple_opt_pass pass_tracer = { + { + GIMPLE_PASS, "tracer", /* name */ gate_tracer, /* gate */ tracer, /* execute */ @@ -393,6 +395,6 @@ struct tree_opt_pass pass_tracer = 0, /* todo_flags_start */ TODO_dump_func | TODO_update_ssa - | TODO_verify_ssa, /* todo_flags_finish */ - 'T' /* letter */ + | TODO_verify_ssa /* todo_flags_finish */ + } }; diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c index 5e551aa4517..c4b9bfff849 100644 --- a/gcc/tree-cfg.c +++ b/gcc/tree-cfg.c @@ -212,8 +212,10 @@ execute_build_cfg (void) return 0; } -struct tree_opt_pass pass_build_cfg = +struct gimple_opt_pass pass_build_cfg = { + { + GIMPLE_PASS, "cfg", /* name */ NULL, /* gate */ execute_build_cfg, /* execute */ @@ -225,8 +227,8 @@ struct tree_opt_pass pass_build_cfg = PROP_cfg, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - TODO_verify_stmts | TODO_cleanup_cfg, /* todo_flags_finish */ - 0 /* letter */ + TODO_verify_stmts | TODO_cleanup_cfg /* todo_flags_finish */ + } }; /* Search the CFG for any computed gotos. If found, factor them to a @@ -1933,8 +1935,10 @@ remove_useless_stmts (void) } -struct tree_opt_pass pass_remove_useless_stmts = +struct gimple_opt_pass pass_remove_useless_stmts = { + { + GIMPLE_PASS, "useless", /* name */ NULL, /* gate */ remove_useless_stmts, /* execute */ @@ -1946,8 +1950,8 @@ struct tree_opt_pass pass_remove_useless_stmts = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - TODO_dump_func, /* todo_flags_finish */ - 0 /* letter */ + TODO_dump_func /* todo_flags_finish */ + } }; /* Remove PHI nodes associated with basic block BB and all edges out of BB. */ @@ -4059,6 +4063,7 @@ verify_gimple_stmt (tree stmt) case NOP_EXPR: case CHANGE_DYNAMIC_TYPE_EXPR: case ASM_EXPR: + case PREDICT_EXPR: return false; default: @@ -6897,8 +6902,10 @@ split_critical_edges (void) return 0; } -struct tree_opt_pass pass_split_crit_edges = +struct gimple_opt_pass pass_split_crit_edges = { + { + GIMPLE_PASS, "crited", /* name */ NULL, /* gate */ split_critical_edges, /* execute */ @@ -6910,8 +6917,8 @@ struct tree_opt_pass pass_split_crit_edges = PROP_no_crit_edges, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - TODO_dump_func, /* todo_flags_finish */ - 0 /* letter */ + TODO_dump_func /* todo_flags_finish */ + } }; @@ -7067,8 +7074,10 @@ extract_true_false_edges_from_block (basic_block b, } } -struct tree_opt_pass pass_warn_function_return = +struct gimple_opt_pass pass_warn_function_return = { + { + GIMPLE_PASS, NULL, /* name */ NULL, /* gate */ execute_warn_function_return, /* execute */ @@ -7080,8 +7089,8 @@ struct tree_opt_pass pass_warn_function_return = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - 0, /* todo_flags_finish */ - 0 /* letter */ + 0 /* todo_flags_finish */ + } }; /* Emit noreturn warnings. */ @@ -7099,8 +7108,10 @@ execute_warn_function_noreturn (void) return 0; } -struct tree_opt_pass pass_warn_function_noreturn = +struct gimple_opt_pass pass_warn_function_noreturn = { + { + GIMPLE_PASS, NULL, /* name */ NULL, /* gate */ execute_warn_function_noreturn, /* execute */ @@ -7112,6 +7123,6 @@ struct tree_opt_pass pass_warn_function_noreturn = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - 0, /* todo_flags_finish */ - 0 /* letter */ + 0 /* todo_flags_finish */ + } }; diff --git a/gcc/tree-cfgcleanup.c b/gcc/tree-cfgcleanup.c index aaaacd9fb33..8970a9b96eb 100644 --- a/gcc/tree-cfgcleanup.c +++ b/gcc/tree-cfgcleanup.c @@ -930,7 +930,10 @@ gate_merge_phi (void) return 1; } -struct tree_opt_pass pass_merge_phi = { +struct gimple_opt_pass pass_merge_phi = +{ + { + GIMPLE_PASS, "mergephi", /* name */ gate_merge_phi, /* gate */ merge_phi_nodes, /* execute */ @@ -943,6 +946,6 @@ struct tree_opt_pass pass_merge_phi = { 0, /* properties_destroyed */ 0, /* todo_flags_start */ TODO_dump_func | TODO_ggc_collect /* todo_flags_finish */ - | TODO_verify_ssa, - 0 /* letter */ + | TODO_verify_ssa + } }; diff --git a/gcc/tree-complex.c b/gcc/tree-complex.c index 10fa0aeb71d..4703e78d22d 100644 --- a/gcc/tree-complex.c +++ b/gcc/tree-complex.c @@ -1534,8 +1534,10 @@ tree_lower_complex (void) return 0; } -struct tree_opt_pass pass_lower_complex = +struct gimple_opt_pass pass_lower_complex = { + { + GIMPLE_PASS, "cplxlower", /* name */ 0, /* gate */ tree_lower_complex, /* execute */ @@ -1550,8 +1552,8 @@ struct tree_opt_pass pass_lower_complex = TODO_dump_func | TODO_ggc_collect | TODO_update_ssa - | TODO_verify_stmts, /* todo_flags_finish */ - 0 /* letter */ + | TODO_verify_stmts /* todo_flags_finish */ + } }; @@ -1582,8 +1584,10 @@ gate_no_optimization (void) return optimize == 0 || sorrycount || errorcount; } -struct tree_opt_pass pass_lower_complex_O0 = +struct gimple_opt_pass pass_lower_complex_O0 = { + { + GIMPLE_PASS, "cplxlower0", /* name */ gate_no_optimization, /* gate */ tree_lower_complex_O0, /* execute */ @@ -1597,5 +1601,5 @@ struct tree_opt_pass pass_lower_complex_O0 = 0, /* todo_flags_start */ TODO_dump_func | TODO_ggc_collect | TODO_verify_stmts, /* todo_flags_finish */ - 0 /* letter */ + } }; diff --git a/gcc/tree-data-ref.c b/gcc/tree-data-ref.c index 70266034aab..f8faed813c7 100644 --- a/gcc/tree-data-ref.c +++ b/gcc/tree-data-ref.c @@ -3965,11 +3965,14 @@ get_references_in_stmt (tree stmt, VEC (data_ref_loc, heap) **references) if (TREE_CODE (stmt) == GIMPLE_MODIFY_STMT) { + tree base; op0 = &GIMPLE_STMT_OPERAND (stmt, 0); op1 = &GIMPLE_STMT_OPERAND (stmt, 1); if (DECL_P (*op1) - || (REFERENCE_CLASS_P (*op1) && get_base_address (*op1))) + || (REFERENCE_CLASS_P (*op1) + && (base = get_base_address (*op1)) + && TREE_CODE (base) != SSA_NAME)) { ref = VEC_safe_push (data_ref_loc, heap, *references, NULL); ref->pos = op1; diff --git a/gcc/tree-dfa.c b/gcc/tree-dfa.c index 349581671a5..23e3ba7919a 100644 --- a/gcc/tree-dfa.c +++ b/gcc/tree-dfa.c @@ -96,8 +96,10 @@ find_referenced_vars (void) return 0; } -struct tree_opt_pass pass_referenced_vars = +struct gimple_opt_pass pass_referenced_vars = { + { + GIMPLE_PASS, NULL, /* name */ NULL, /* gate */ find_referenced_vars, /* execute */ @@ -109,8 +111,8 @@ struct tree_opt_pass pass_referenced_vars = PROP_referenced_vars, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - 0, /* todo_flags_finish */ - 0 /* letter */ + 0 /* todo_flags_finish */ + } }; diff --git a/gcc/tree-dump.c b/gcc/tree-dump.c index a377deb959f..bc017738efb 100644 --- a/gcc/tree-dump.c +++ b/gcc/tree-dump.c @@ -831,7 +831,7 @@ static const struct dump_option_value_info dump_options[] = unsigned int dump_register (const char *suffix, const char *swtch, const char *glob, - int flags, int letter) + int flags) { static int next_dump = FIRST_AUTO_NUMBERED_DUMP; int num = next_dump++; @@ -855,7 +855,6 @@ dump_register (const char *suffix, const char *swtch, const char *glob, extra_dump_files[this].glob = glob; extra_dump_files[this].flags = flags; extra_dump_files[this].num = num; - extra_dump_files[this].letter = letter; return this + TDI_end; } diff --git a/gcc/tree-dump.h b/gcc/tree-dump.h index 30efb10d413..72c2868c857 100644 --- a/gcc/tree-dump.h +++ b/gcc/tree-dump.h @@ -94,7 +94,7 @@ extern void debug_function (tree, int); extern int dump_flag (dump_info_p, int, const_tree); extern unsigned int dump_register (const char *, const char *, const char *, - int, int); + int); #endif /* ! GCC_TREE_DUMP_H */ diff --git a/gcc/tree-eh.c b/gcc/tree-eh.c index 44d5a6d59de..06e4b5a9d07 100644 --- a/gcc/tree-eh.c +++ b/gcc/tree-eh.c @@ -1725,8 +1725,10 @@ lower_eh_constructs (void) return 0; } -struct tree_opt_pass pass_lower_eh = +struct gimple_opt_pass pass_lower_eh = { + { + GIMPLE_PASS, "eh", /* name */ NULL, /* gate */ lower_eh_constructs, /* execute */ @@ -1738,8 +1740,8 @@ struct tree_opt_pass pass_lower_eh = PROP_gimple_leh, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - TODO_dump_func, /* todo_flags_finish */ - 0 /* letter */ + TODO_dump_func /* todo_flags_finish */ + } }; @@ -2244,8 +2246,10 @@ refactor_eh (void) return 0; } -struct tree_opt_pass pass_refactor_eh = +struct gimple_opt_pass pass_refactor_eh = { + { + GIMPLE_PASS, "ehopt", /* name */ NULL, /* gate */ refactor_eh, /* execute */ @@ -2257,6 +2261,6 @@ struct tree_opt_pass pass_refactor_eh = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - TODO_dump_func, /* todo_flags_finish */ - 0 /* letter */ + TODO_dump_func /* todo_flags_finish */ + } }; diff --git a/gcc/tree-gimple.c b/gcc/tree-gimple.c index d1e47f65eda..bc482983847 100644 --- a/gcc/tree-gimple.c +++ b/gcc/tree-gimple.c @@ -167,17 +167,13 @@ is_gimple_addressable (tree t) || INDIRECT_REF_P (t)); } -/* Return true if T is a GIMPLE minimal invariant. It's a restricted - form of function invariant. */ +/* Return true if T is a valid gimple constant. */ bool -is_gimple_min_invariant (const_tree t) +is_gimple_constant (const_tree t) { switch (TREE_CODE (t)) { - case ADDR_EXPR: - return TREE_INVARIANT (t); - case INTEGER_CST: case REAL_CST: case FIXED_CST: @@ -198,6 +194,87 @@ is_gimple_min_invariant (const_tree t) } } +/* Return true if T is a gimple invariant address. */ + +bool +is_gimple_invariant_address (const_tree t) +{ + tree op; + + if (TREE_CODE (t) != ADDR_EXPR) + return false; + + op = TREE_OPERAND (t, 0); + while (handled_component_p (op)) + { + switch (TREE_CODE (op)) + { + case ARRAY_REF: + case ARRAY_RANGE_REF: + if (!is_gimple_constant (TREE_OPERAND (op, 1)) + || TREE_OPERAND (op, 2) != NULL_TREE + || TREE_OPERAND (op, 3) != NULL_TREE) + return false; + break; + + case COMPONENT_REF: + if (TREE_OPERAND (op, 2) != NULL_TREE) + return false; + break; + + default:; + } + op = TREE_OPERAND (op, 0); + } + + if (CONSTANT_CLASS_P (op)) + return true; + + if (INDIRECT_REF_P (op)) + return false; + + switch (TREE_CODE (op)) + { + case PARM_DECL: + case RESULT_DECL: + case LABEL_DECL: + case FUNCTION_DECL: + return true; + + case VAR_DECL: + if (((TREE_STATIC (op) || DECL_EXTERNAL (op)) + && ! DECL_DLLIMPORT_P (op)) + || DECL_THREAD_LOCAL_P (op) + || DECL_CONTEXT (op) == current_function_decl + || decl_function_context (op) == current_function_decl) + return true; + break; + + case CONST_DECL: + if ((TREE_STATIC (op) || DECL_EXTERNAL (op)) + || decl_function_context (op) == current_function_decl) + return true; + break; + + default: + gcc_unreachable (); + } + + return false; +} + +/* Return true if T is a GIMPLE minimal invariant. It's a restricted + form of function invariant. */ + +bool +is_gimple_min_invariant (const_tree t) +{ + if (TREE_CODE (t) == ADDR_EXPR) + return is_gimple_invariant_address (t); + + return is_gimple_constant (t); +} + /* Return true if T looks like a valid GIMPLE statement. */ bool @@ -248,6 +325,7 @@ is_gimple_stmt (tree t) case CALL_EXPR: case GIMPLE_MODIFY_STMT: + case PREDICT_EXPR: /* These are valid regardless of their type. */ return true; diff --git a/gcc/tree-gimple.h b/gcc/tree-gimple.h index 2493b6b2419..b45b44b2bde 100644 --- a/gcc/tree-gimple.h +++ b/gcc/tree-gimple.h @@ -62,6 +62,10 @@ extern bool is_gimple_addressable (tree); /* Returns true iff T is any valid GIMPLE lvalue. */ extern bool is_gimple_lvalue (tree); +/* Returns true iff T is a GIMPLE invariant address. */ +bool is_gimple_invariant_address (const_tree); +/* Returns true iff T is a valid GIMPLE constant. */ +bool is_gimple_constant (const_tree); /* Returns true iff T is a GIMPLE restricted function invariant. */ extern bool is_gimple_min_invariant (const_tree); /* Returns true iff T is a GIMPLE rvalue. */ diff --git a/gcc/tree-if-conv.c b/gcc/tree-if-conv.c index ec349297fd1..5c285efba55 100644 --- a/gcc/tree-if-conv.c +++ b/gcc/tree-if-conv.c @@ -1160,8 +1160,10 @@ gate_tree_if_conversion (void) return flag_tree_vectorize != 0; } -struct tree_opt_pass pass_if_conversion = +struct gimple_opt_pass pass_if_conversion = { + { + GIMPLE_PASS, "ifcvt", /* name */ gate_tree_if_conversion, /* gate */ main_tree_if_conversion, /* execute */ @@ -1173,7 +1175,7 @@ struct tree_opt_pass pass_if_conversion = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - TODO_dump_func | TODO_verify_loops | TODO_verify_stmts | TODO_verify_flow, + TODO_dump_func | TODO_verify_loops | TODO_verify_stmts | TODO_verify_flow /* todo_flags_finish */ - 0 /* letter */ + } }; diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c index 74895a82c93..54cacb5a79b 100644 --- a/gcc/tree-inline.c +++ b/gcc/tree-inline.c @@ -2265,6 +2265,7 @@ estimate_num_insns_1 (tree *tp, int *walk_subtrees, void *data) case COMPLEX_CST: case VECTOR_CST: case STRING_CST: + case PREDICT_EXPR: *walk_subtrees = 0; return NULL; diff --git a/gcc/tree-into-ssa.c b/gcc/tree-into-ssa.c index c55f7363697..efb315b0607 100644 --- a/gcc/tree-into-ssa.c +++ b/gcc/tree-into-ssa.c @@ -2298,8 +2298,10 @@ rewrite_into_ssa (void) } -struct tree_opt_pass pass_build_ssa = +struct gimple_opt_pass pass_build_ssa = { + { + GIMPLE_PASS, "ssa", /* name */ NULL, /* gate */ rewrite_into_ssa, /* execute */ @@ -2313,8 +2315,8 @@ struct tree_opt_pass pass_build_ssa = 0, /* todo_flags_start */ TODO_dump_func | TODO_verify_ssa - | TODO_remove_unused_locals, /* todo_flags_finish */ - 0 /* letter */ + | TODO_remove_unused_locals /* todo_flags_finish */ + } }; diff --git a/gcc/tree-loop-distribution.c b/gcc/tree-loop-distribution.c index 2d4a5d69373..c380854eab5 100644 --- a/gcc/tree-loop-distribution.c +++ b/gcc/tree-loop-distribution.c @@ -1155,8 +1155,10 @@ gate_tree_loop_distribution (void) return flag_tree_loop_distribution != 0; } -struct tree_opt_pass pass_loop_distribution = +struct gimple_opt_pass pass_loop_distribution = { + { + GIMPLE_PASS, "ldist", /* name */ gate_tree_loop_distribution, /* gate */ tree_loop_distribution, /* execute */ @@ -1168,6 +1170,6 @@ struct tree_opt_pass pass_loop_distribution = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - TODO_dump_func | TODO_verify_loops, /* todo_flags_finish */ - 0 /* letter */ + TODO_dump_func | TODO_verify_loops /* todo_flags_finish */ + } }; diff --git a/gcc/tree-mudflap.c b/gcc/tree-mudflap.c index 190a3d3ce2d..cb0b4493601 100644 --- a/gcc/tree-mudflap.c +++ b/gcc/tree-mudflap.c @@ -1303,8 +1303,10 @@ gate_mudflap (void) return flag_mudflap != 0; } -struct tree_opt_pass pass_mudflap_1 = +struct gimple_opt_pass pass_mudflap_1 = { + { + GIMPLE_PASS, "mudflap1", /* name */ gate_mudflap, /* gate */ execute_mudflap_function_decls, /* execute */ @@ -1316,12 +1318,14 @@ struct tree_opt_pass pass_mudflap_1 = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - TODO_dump_func, /* todo_flags_finish */ - 0 /* letter */ + TODO_dump_func /* todo_flags_finish */ + } }; -struct tree_opt_pass pass_mudflap_2 = +struct gimple_opt_pass pass_mudflap_2 = { + { + GIMPLE_PASS, "mudflap2", /* name */ gate_mudflap, /* gate */ execute_mudflap_function_ops, /* execute */ @@ -1334,8 +1338,8 @@ struct tree_opt_pass pass_mudflap_2 = 0, /* properties_destroyed */ 0, /* todo_flags_start */ TODO_verify_flow | TODO_verify_stmts - | TODO_dump_func, /* todo_flags_finish */ - 0 /* letter */ + | TODO_dump_func /* todo_flags_finish */ + } }; #include "gt-tree-mudflap.h" diff --git a/gcc/tree-nomudflap.c b/gcc/tree-nomudflap.c index a59b9da0b4e..8d1ae7519b3 100644 --- a/gcc/tree-nomudflap.c +++ b/gcc/tree-nomudflap.c @@ -90,8 +90,10 @@ gate_mudflap (void) return flag_mudflap != 0; } -struct tree_opt_pass pass_mudflap_1 = +struct gimple_opt_pass pass_mudflap_1 = { + { + GIMPLE_PASS, "mudflap1", /* name */ gate_mudflap, /* gate */ NULL, /* execute */ @@ -103,12 +105,14 @@ struct tree_opt_pass pass_mudflap_1 = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - 0, /* todo_flags_finish */ - 0 /* letter */ + 0 /* todo_flags_finish */ + } }; -struct tree_opt_pass pass_mudflap_2 = +struct gimple_opt_pass pass_mudflap_2 = { + { + GIMPLE_PASS, "mudflap2", /* name */ gate_mudflap, /* gate */ NULL, /* execute */ @@ -120,8 +124,8 @@ struct tree_opt_pass pass_mudflap_2 = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - 0, /* todo_flags_finish */ - 0 /* letter */ + 0 /* todo_flags_finish */ + } }; /* Instead of: diff --git a/gcc/tree-nrv.c b/gcc/tree-nrv.c index ef5ee67a2f3..7330d2896b5 100644 --- a/gcc/tree-nrv.c +++ b/gcc/tree-nrv.c @@ -221,8 +221,10 @@ tree_nrv (void) return 0; } -struct tree_opt_pass pass_nrv = +struct gimple_opt_pass pass_nrv = { + { + GIMPLE_PASS, "nrv", /* name */ NULL, /* gate */ tree_nrv, /* execute */ @@ -234,8 +236,8 @@ struct tree_opt_pass pass_nrv = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - TODO_dump_func | TODO_ggc_collect, /* todo_flags_finish */ - 0 /* letter */ + TODO_dump_func | TODO_ggc_collect /* todo_flags_finish */ + } }; /* Determine (pessimistically) whether DEST is available for NRV @@ -312,8 +314,10 @@ execute_return_slot_opt (void) return 0; } -struct tree_opt_pass pass_return_slot = +struct gimple_opt_pass pass_return_slot = { + { + GIMPLE_PASS, "retslot", /* name */ NULL, /* gate */ execute_return_slot_opt, /* execute */ @@ -325,6 +329,6 @@ struct tree_opt_pass pass_return_slot = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - 0, /* todo_flags_finish */ - 0 /* letter */ + 0 /* todo_flags_finish */ + } }; diff --git a/gcc/tree-object-size.c b/gcc/tree-object-size.c index 371e3e52fb3..bc99ae79e49 100644 --- a/gcc/tree-object-size.c +++ b/gcc/tree-object-size.c @@ -1063,8 +1063,10 @@ compute_object_sizes (void) return 0; } -struct tree_opt_pass pass_object_sizes = +struct gimple_opt_pass pass_object_sizes = { + { + GIMPLE_PASS, "objsz", /* name */ NULL, /* gate */ compute_object_sizes, /* execute */ @@ -1076,6 +1078,6 @@ struct tree_opt_pass pass_object_sizes = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - TODO_dump_func | TODO_verify_ssa, /* todo_flags_finish */ - 0 /* letter */ + TODO_dump_func | TODO_verify_ssa /* todo_flags_finish */ + } }; diff --git a/gcc/tree-optimize.c b/gcc/tree-optimize.c index 544d75daabe..b6a9b93ef28 100644 --- a/gcc/tree-optimize.c +++ b/gcc/tree-optimize.c @@ -61,8 +61,10 @@ gate_all_optimizations (void) && (!(errorcount || sorrycount) || gimple_in_ssa_p (cfun))); } -struct tree_opt_pass pass_all_optimizations = +struct gimple_opt_pass pass_all_optimizations = { + { + GIMPLE_PASS, NULL, /* name */ gate_all_optimizations, /* gate */ NULL, /* execute */ @@ -74,8 +76,8 @@ struct tree_opt_pass pass_all_optimizations = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - 0, /* todo_flags_finish */ - 0 /* letter */ + 0 /* todo_flags_finish */ + } }; /* Gate: execute, or not, all of the non-trivial optimizations. */ @@ -87,8 +89,10 @@ gate_all_early_local_passes (void) return (!errorcount && !sorrycount); } -struct tree_opt_pass pass_early_local_passes = +struct simple_ipa_opt_pass pass_early_local_passes = { + { + SIMPLE_IPA_PASS, "early_local_cleanups", /* name */ gate_all_early_local_passes, /* gate */ NULL, /* execute */ @@ -100,8 +104,8 @@ struct tree_opt_pass pass_early_local_passes = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - TODO_remove_functions, /* todo_flags_finish */ - 0 /* letter */ + TODO_remove_functions /* todo_flags_finish */ + } }; static unsigned int @@ -122,8 +126,10 @@ gate_all_early_optimizations (void) && !(errorcount || sorrycount)); } -struct tree_opt_pass pass_all_early_optimizations = +struct gimple_opt_pass pass_all_early_optimizations = { + { + GIMPLE_PASS, "early_optimizations", /* name */ gate_all_early_optimizations, /* gate */ execute_early_local_optimizations, /* execute */ @@ -135,8 +141,8 @@ struct tree_opt_pass pass_all_early_optimizations = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - 0, /* todo_flags_finish */ - 0 /* letter */ + 0 /* todo_flags_finish */ + } }; /* Pass: cleanup the CFG just before expanding trees to RTL. @@ -151,8 +157,10 @@ execute_cleanup_cfg_pre_ipa (void) return 0; } -struct tree_opt_pass pass_cleanup_cfg = +struct gimple_opt_pass pass_cleanup_cfg = { + { + GIMPLE_PASS, "cleanup_cfg", /* name */ NULL, /* gate */ execute_cleanup_cfg_pre_ipa, /* execute */ @@ -164,8 +172,8 @@ struct tree_opt_pass pass_cleanup_cfg = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - TODO_dump_func, /* todo_flags_finish */ - 0 /* letter */ + TODO_dump_func /* todo_flags_finish */ + } }; @@ -184,8 +192,10 @@ execute_cleanup_cfg_post_optimizing (void) return 0; } -struct tree_opt_pass pass_cleanup_cfg_post_optimizing = +struct gimple_opt_pass pass_cleanup_cfg_post_optimizing = { + { + GIMPLE_PASS, "final_cleanup", /* name */ NULL, /* gate */ execute_cleanup_cfg_post_optimizing, /* execute */ @@ -197,8 +207,8 @@ struct tree_opt_pass pass_cleanup_cfg_post_optimizing = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - TODO_dump_func, /* todo_flags_finish */ - 0 /* letter */ + TODO_dump_func /* todo_flags_finish */ + } }; /* Pass: do the actions required to finish with tree-ssa optimization @@ -216,8 +226,10 @@ execute_free_datastructures (void) return 0; } -struct tree_opt_pass pass_free_datastructures = +struct gimple_opt_pass pass_free_datastructures = { + { + GIMPLE_PASS, NULL, /* name */ NULL, /* gate */ execute_free_datastructures, /* execute */ @@ -229,8 +241,8 @@ struct tree_opt_pass pass_free_datastructures = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - 0, /* todo_flags_finish */ - 0 /* letter */ + 0 /* todo_flags_finish */ + } }; /* Pass: free cfg annotations. */ @@ -243,8 +255,10 @@ execute_free_cfg_annotations (void) return 0; } -struct tree_opt_pass pass_free_cfg_annotations = +struct gimple_opt_pass pass_free_cfg_annotations = { + { + GIMPLE_PASS, NULL, /* name */ NULL, /* gate */ execute_free_cfg_annotations, /* execute */ @@ -256,8 +270,8 @@ struct tree_opt_pass pass_free_cfg_annotations = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - 0, /* todo_flags_finish */ - 0 /* letter */ + 0 /* todo_flags_finish */ + } }; /* Pass: fixup_cfg. IPA passes, compilation of earlier functions or inlining @@ -330,8 +344,10 @@ gate_init_datastructures (void) return (optimize >= 1); } -struct tree_opt_pass pass_init_datastructures = +struct gimple_opt_pass pass_init_datastructures = { + { + GIMPLE_PASS, NULL, /* name */ gate_init_datastructures, /* gate */ execute_init_datastructures, /* execute */ @@ -343,8 +359,8 @@ struct tree_opt_pass pass_init_datastructures = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - 0, /* todo_flags_finish */ - 0 /* letter */ + 0 /* todo_flags_finish */ + } }; void @@ -358,7 +374,7 @@ tree_lowering_passes (tree fn) bitmap_obstack_initialize (NULL); execute_pass_list (all_lowering_passes); if (optimize && cgraph_global_info_ready) - execute_pass_list (pass_early_local_passes.sub); + execute_pass_list (pass_early_local_passes.pass.sub); free_dominance_info (CDI_POST_DOMINATORS); free_dominance_info (CDI_DOMINATORS); compact_blocks (); diff --git a/gcc/tree-outof-ssa.c b/gcc/tree-outof-ssa.c index be8a459f402..12ce1b9c692 100644 --- a/gcc/tree-outof-ssa.c +++ b/gcc/tree-outof-ssa.c @@ -1466,8 +1466,10 @@ rewrite_out_of_ssa (void) /* Define the parameters of the out of SSA pass. */ -struct tree_opt_pass pass_del_ssa = +struct gimple_opt_pass pass_del_ssa = { + { + GIMPLE_PASS, "optimized", /* name */ NULL, /* gate */ rewrite_out_of_ssa, /* execute */ @@ -1483,6 +1485,6 @@ struct tree_opt_pass pass_del_ssa = | TODO_verify_stmts, /* todo_flags_start */ TODO_dump_func | TODO_ggc_collect - | TODO_remove_unused_locals, /* todo_flags_finish */ - 0 /* letter */ + | TODO_remove_unused_locals /* todo_flags_finish */ + } }; diff --git a/gcc/tree-pass.h b/gcc/tree-pass.h index 0033f6ad718..91366430b70 100644 --- a/gcc/tree-pass.h +++ b/gcc/tree-pass.h @@ -88,9 +88,16 @@ extern const char *dump_file_name; /* Return the dump_file_info for the given phase. */ extern struct dump_file_info *get_dump_file_info (enum tree_dump_index); -/* Describe one pass. */ -struct tree_opt_pass +/* Describe one pass; this is the common part shared across different pass + types. */ +struct opt_pass { + /* Optimization pass type. */ + enum opt_pass_type { + GIMPLE_PASS, + RTL_PASS, + SIMPLE_IPA_PASS + } type; /* Terse name of the pass used as a fragment of the dump file name. */ const char *name; @@ -104,10 +111,10 @@ struct tree_opt_pass unsigned int (*execute) (void); /* A list of sub-passes to run, dependent on gate predicate. */ - struct tree_opt_pass *sub; + struct opt_pass *sub; /* Next in the list of passes to run, independent of gate predicate. */ - struct tree_opt_pass *next; + struct opt_pass *next; /* Static pass number, used as a fragment of the dump file name. */ int static_pass_number; @@ -124,9 +131,25 @@ struct tree_opt_pass /* Flags indicating common sets things to do before and after. */ unsigned int todo_flags_start; unsigned int todo_flags_finish; +}; + +/* Description or GIMPLE pass. */ +struct gimple_opt_pass +{ + struct opt_pass pass; +}; - /* Letter for RTL dumps. */ - char letter; +/* Decription of RTL pass. */ +struct rtl_opt_pass +{ + struct opt_pass pass; +}; + +/* Description if simple IPA pass. Simple IPA passes have just one execute + hook. */ +struct simple_ipa_opt_pass +{ + struct opt_pass pass; }; /* Define a tree dump switch. */ @@ -240,226 +263,229 @@ struct dump_file_info extern void tree_lowering_passes (tree decl); -extern struct tree_opt_pass pass_mudflap_1; -extern struct tree_opt_pass pass_mudflap_2; -extern struct tree_opt_pass pass_remove_useless_stmts; -extern struct tree_opt_pass pass_lower_cf; -extern struct tree_opt_pass pass_refactor_eh; -extern struct tree_opt_pass pass_lower_eh; -extern struct tree_opt_pass pass_build_cfg; -extern struct tree_opt_pass pass_tree_profile; -extern struct tree_opt_pass pass_early_tree_profile; -extern struct tree_opt_pass pass_cleanup_cfg; -extern struct tree_opt_pass pass_referenced_vars; -extern struct tree_opt_pass pass_sra; -extern struct tree_opt_pass pass_sra_early; -extern struct tree_opt_pass pass_tail_recursion; -extern struct tree_opt_pass pass_tail_calls; -extern struct tree_opt_pass pass_tree_loop; -extern struct tree_opt_pass pass_tree_loop_init; -extern struct tree_opt_pass pass_lim; -extern struct tree_opt_pass pass_tree_unswitch; -extern struct tree_opt_pass pass_predcom; -extern struct tree_opt_pass pass_iv_canon; -extern struct tree_opt_pass pass_scev_cprop; -extern struct tree_opt_pass pass_empty_loop; -extern struct tree_opt_pass pass_record_bounds; -extern struct tree_opt_pass pass_if_conversion; -extern struct tree_opt_pass pass_loop_distribution; -extern struct tree_opt_pass pass_vectorize; -extern struct tree_opt_pass pass_complete_unroll; -extern struct tree_opt_pass pass_parallelize_loops; -extern struct tree_opt_pass pass_loop_prefetch; -extern struct tree_opt_pass pass_iv_optimize; -extern struct tree_opt_pass pass_tree_loop_done; -extern struct tree_opt_pass pass_ch; -extern struct tree_opt_pass pass_ccp; -extern struct tree_opt_pass pass_phi_only_cprop; -extern struct tree_opt_pass pass_build_ssa; -extern struct tree_opt_pass pass_del_ssa; -extern struct tree_opt_pass pass_build_alias; -extern struct tree_opt_pass pass_dominator; -extern struct tree_opt_pass pass_dce; -extern struct tree_opt_pass pass_dce_loop; -extern struct tree_opt_pass pass_cd_dce; -extern struct tree_opt_pass pass_merge_phi; -extern struct tree_opt_pass pass_split_crit_edges; -extern struct tree_opt_pass pass_pre; -extern struct tree_opt_pass pass_profile; -extern struct tree_opt_pass pass_lower_complex_O0; -extern struct tree_opt_pass pass_lower_complex; -extern struct tree_opt_pass pass_lower_vector; -extern struct tree_opt_pass pass_lower_vector_ssa; -extern struct tree_opt_pass pass_lower_omp; -extern struct tree_opt_pass pass_expand_omp; -extern struct tree_opt_pass pass_expand_omp_ssa; -extern struct tree_opt_pass pass_object_sizes; -extern struct tree_opt_pass pass_fold_builtins; -extern struct tree_opt_pass pass_stdarg; -extern struct tree_opt_pass pass_early_warn_uninitialized; -extern struct tree_opt_pass pass_late_warn_uninitialized; -extern struct tree_opt_pass pass_cse_reciprocals; -extern struct tree_opt_pass pass_cse_sincos; -extern struct tree_opt_pass pass_convert_to_rsqrt; -extern struct tree_opt_pass pass_warn_function_return; -extern struct tree_opt_pass pass_warn_function_noreturn; -extern struct tree_opt_pass pass_cselim; -extern struct tree_opt_pass pass_phiopt; -extern struct tree_opt_pass pass_forwprop; -extern struct tree_opt_pass pass_phiprop; -extern struct tree_opt_pass pass_tree_ifcombine; -extern struct tree_opt_pass pass_dse; -extern struct tree_opt_pass pass_simple_dse; -extern struct tree_opt_pass pass_nrv; -extern struct tree_opt_pass pass_mark_used_blocks; -extern struct tree_opt_pass pass_rename_ssa_copies; -extern struct tree_opt_pass pass_expand; -extern struct tree_opt_pass pass_rest_of_compilation; -extern struct tree_opt_pass pass_sink_code; -extern struct tree_opt_pass pass_fre; -extern struct tree_opt_pass pass_linear_transform; -extern struct tree_opt_pass pass_check_data_deps; -extern struct tree_opt_pass pass_copy_prop; -extern struct tree_opt_pass pass_store_ccp; -extern struct tree_opt_pass pass_vrp; -extern struct tree_opt_pass pass_create_structure_vars; -extern struct tree_opt_pass pass_uncprop; -extern struct tree_opt_pass pass_return_slot; -extern struct tree_opt_pass pass_reassoc; -extern struct tree_opt_pass pass_rebuild_cgraph_edges; -extern struct tree_opt_pass pass_build_cgraph_edges; -extern struct tree_opt_pass pass_reset_cc_flags; +extern struct gimple_opt_pass pass_mudflap_1; +extern struct gimple_opt_pass pass_mudflap_2; +extern struct gimple_opt_pass pass_remove_useless_stmts; +extern struct gimple_opt_pass pass_lower_cf; +extern struct gimple_opt_pass pass_refactor_eh; +extern struct gimple_opt_pass pass_lower_eh; +extern struct gimple_opt_pass pass_build_cfg; +extern struct gimple_opt_pass pass_tree_profile; +extern struct gimple_opt_pass pass_early_tree_profile; +extern struct gimple_opt_pass pass_cleanup_cfg; +extern struct gimple_opt_pass pass_referenced_vars; +extern struct gimple_opt_pass pass_sra; +extern struct gimple_opt_pass pass_sra_early; +extern struct gimple_opt_pass pass_tail_recursion; +extern struct gimple_opt_pass pass_tail_calls; +extern struct gimple_opt_pass pass_tree_loop; +extern struct gimple_opt_pass pass_tree_loop_init; +extern struct gimple_opt_pass pass_lim; +extern struct gimple_opt_pass pass_tree_unswitch; +extern struct gimple_opt_pass pass_predcom; +extern struct gimple_opt_pass pass_iv_canon; +extern struct gimple_opt_pass pass_scev_cprop; +extern struct gimple_opt_pass pass_empty_loop; +extern struct gimple_opt_pass pass_record_bounds; +extern struct gimple_opt_pass pass_if_conversion; +extern struct gimple_opt_pass pass_loop_distribution; +extern struct gimple_opt_pass pass_vectorize; +extern struct gimple_opt_pass pass_complete_unroll; +extern struct gimple_opt_pass pass_parallelize_loops; +extern struct gimple_opt_pass pass_loop_prefetch; +extern struct gimple_opt_pass pass_iv_optimize; +extern struct gimple_opt_pass pass_tree_loop_done; +extern struct gimple_opt_pass pass_ch; +extern struct gimple_opt_pass pass_ccp; +extern struct gimple_opt_pass pass_phi_only_cprop; +extern struct gimple_opt_pass pass_build_ssa; +extern struct gimple_opt_pass pass_del_ssa; +extern struct gimple_opt_pass pass_build_alias; +extern struct gimple_opt_pass pass_dominator; +extern struct gimple_opt_pass pass_dce; +extern struct gimple_opt_pass pass_dce_loop; +extern struct gimple_opt_pass pass_cd_dce; +extern struct gimple_opt_pass pass_merge_phi; +extern struct gimple_opt_pass pass_split_crit_edges; +extern struct gimple_opt_pass pass_pre; +extern struct gimple_opt_pass pass_profile; +extern struct gimple_opt_pass pass_lower_complex_O0; +extern struct gimple_opt_pass pass_lower_complex; +extern struct gimple_opt_pass pass_lower_vector; +extern struct gimple_opt_pass pass_lower_vector_ssa; +extern struct gimple_opt_pass pass_lower_omp; +extern struct gimple_opt_pass pass_expand_omp; +extern struct gimple_opt_pass pass_expand_omp_ssa; +extern struct gimple_opt_pass pass_object_sizes; +extern struct gimple_opt_pass pass_fold_builtins; +extern struct gimple_opt_pass pass_stdarg; +extern struct gimple_opt_pass pass_early_warn_uninitialized; +extern struct gimple_opt_pass pass_late_warn_uninitialized; +extern struct gimple_opt_pass pass_cse_reciprocals; +extern struct gimple_opt_pass pass_cse_sincos; +extern struct gimple_opt_pass pass_convert_to_rsqrt; +extern struct gimple_opt_pass pass_warn_function_return; +extern struct gimple_opt_pass pass_warn_function_noreturn; +extern struct gimple_opt_pass pass_cselim; +extern struct gimple_opt_pass pass_phiopt; +extern struct gimple_opt_pass pass_forwprop; +extern struct gimple_opt_pass pass_phiprop; +extern struct gimple_opt_pass pass_tree_ifcombine; +extern struct gimple_opt_pass pass_dse; +extern struct gimple_opt_pass pass_simple_dse; +extern struct gimple_opt_pass pass_nrv; +extern struct gimple_opt_pass pass_mark_used_blocks; +extern struct gimple_opt_pass pass_rename_ssa_copies; +extern struct gimple_opt_pass pass_expand; +extern struct gimple_opt_pass pass_rest_of_compilation; +extern struct gimple_opt_pass pass_sink_code; +extern struct gimple_opt_pass pass_fre; +extern struct gimple_opt_pass pass_linear_transform; +extern struct gimple_opt_pass pass_check_data_deps; +extern struct gimple_opt_pass pass_copy_prop; +extern struct gimple_opt_pass pass_store_ccp; +extern struct gimple_opt_pass pass_vrp; +extern struct gimple_opt_pass pass_create_structure_vars; +extern struct gimple_opt_pass pass_uncprop; +extern struct gimple_opt_pass pass_return_slot; +extern struct gimple_opt_pass pass_reassoc; +extern struct gimple_opt_pass pass_rebuild_cgraph_edges; +extern struct gimple_opt_pass pass_build_cgraph_edges; +extern struct gimple_opt_pass pass_reset_cc_flags; /* IPA Passes */ -extern struct tree_opt_pass pass_ipa_matrix_reorg; -extern struct tree_opt_pass pass_ipa_cp; -extern struct tree_opt_pass pass_ipa_inline; -extern struct tree_opt_pass pass_ipa_early_inline; -extern struct tree_opt_pass pass_ipa_reference; -extern struct tree_opt_pass pass_ipa_pure_const; -extern struct tree_opt_pass pass_ipa_type_escape; -extern struct tree_opt_pass pass_ipa_pta; -extern struct tree_opt_pass pass_ipa_struct_reorg; -extern struct tree_opt_pass pass_early_local_passes; -extern struct tree_opt_pass pass_ipa_increase_alignment; -extern struct tree_opt_pass pass_ipa_function_and_variable_visibility; +extern struct simple_ipa_opt_pass pass_ipa_matrix_reorg; +extern struct simple_ipa_opt_pass pass_ipa_cp; +extern struct simple_ipa_opt_pass pass_ipa_inline; +extern struct simple_ipa_opt_pass pass_ipa_early_inline; +extern struct simple_ipa_opt_pass pass_ipa_reference; +extern struct simple_ipa_opt_pass pass_ipa_pure_const; +extern struct simple_ipa_opt_pass pass_ipa_type_escape; +extern struct simple_ipa_opt_pass pass_ipa_pta; +extern struct simple_ipa_opt_pass pass_ipa_struct_reorg; +extern struct simple_ipa_opt_pass pass_early_local_passes; +extern struct simple_ipa_opt_pass pass_ipa_increase_alignment; +extern struct simple_ipa_opt_pass pass_ipa_function_and_variable_visibility; /* Basilys passes */ -extern struct tree_opt_pass pass_basilys; - - -extern struct tree_opt_pass pass_all_optimizations; -extern struct tree_opt_pass pass_cleanup_cfg_post_optimizing; -extern struct tree_opt_pass pass_free_cfg_annotations; -extern struct tree_opt_pass pass_free_datastructures; -extern struct tree_opt_pass pass_init_datastructures; -extern struct tree_opt_pass pass_fixup_cfg; - -extern struct tree_opt_pass pass_init_function; -extern struct tree_opt_pass pass_jump; -extern struct tree_opt_pass pass_rtl_eh; -extern struct tree_opt_pass pass_initial_value_sets; -extern struct tree_opt_pass pass_unshare_all_rtl; -extern struct tree_opt_pass pass_instantiate_virtual_regs; -extern struct tree_opt_pass pass_rtl_fwprop; -extern struct tree_opt_pass pass_rtl_fwprop_addr; -extern struct tree_opt_pass pass_jump2; -extern struct tree_opt_pass pass_lower_subreg; -extern struct tree_opt_pass pass_cse; -extern struct tree_opt_pass pass_fast_rtl_dce; -extern struct tree_opt_pass pass_ud_rtl_dce; -extern struct tree_opt_pass pass_rtl_dce; -extern struct tree_opt_pass pass_rtl_dse1; -extern struct tree_opt_pass pass_rtl_dse2; -extern struct tree_opt_pass pass_rtl_dse3; -extern struct tree_opt_pass pass_gcse; -extern struct tree_opt_pass pass_jump_bypass; -extern struct tree_opt_pass pass_profiling; -extern struct tree_opt_pass pass_rtl_ifcvt; -extern struct tree_opt_pass pass_tracer; - -extern struct tree_opt_pass pass_into_cfg_layout_mode; -extern struct tree_opt_pass pass_outof_cfg_layout_mode; - -extern struct tree_opt_pass pass_loop2; -extern struct tree_opt_pass pass_rtl_loop_init; -extern struct tree_opt_pass pass_rtl_move_loop_invariants; -extern struct tree_opt_pass pass_rtl_unswitch; -extern struct tree_opt_pass pass_rtl_unroll_and_peel_loops; -extern struct tree_opt_pass pass_rtl_doloop; -extern struct tree_opt_pass pass_rtl_loop_done; - -extern struct tree_opt_pass pass_web; -extern struct tree_opt_pass pass_cse2; -extern struct tree_opt_pass pass_df_initialize_opt; -extern struct tree_opt_pass pass_df_initialize_no_opt; -extern struct tree_opt_pass pass_regclass_init; -extern struct tree_opt_pass pass_subregs_of_mode_init; -extern struct tree_opt_pass pass_subregs_of_mode_finish; -extern struct tree_opt_pass pass_inc_dec; -extern struct tree_opt_pass pass_stack_ptr_mod; -extern struct tree_opt_pass pass_initialize_regs; -extern struct tree_opt_pass pass_combine; -extern struct tree_opt_pass pass_if_after_combine; -extern struct tree_opt_pass pass_partition_blocks; -extern struct tree_opt_pass pass_match_asm_constraints; -extern struct tree_opt_pass pass_regmove; -extern struct tree_opt_pass pass_split_all_insns; -extern struct tree_opt_pass pass_lower_subreg2; -extern struct tree_opt_pass pass_mode_switching; -extern struct tree_opt_pass pass_see; -extern struct tree_opt_pass pass_sms; -extern struct tree_opt_pass pass_sched; -extern struct tree_opt_pass pass_local_alloc; -extern struct tree_opt_pass pass_global_alloc; -extern struct tree_opt_pass pass_postreload; -extern struct tree_opt_pass pass_clean_state; -extern struct tree_opt_pass pass_branch_prob; -extern struct tree_opt_pass pass_value_profile_transformations; -extern struct tree_opt_pass pass_postreload_cse; -extern struct tree_opt_pass pass_gcse2; -extern struct tree_opt_pass pass_split_after_reload; -extern struct tree_opt_pass pass_branch_target_load_optimize1; -extern struct tree_opt_pass pass_thread_prologue_and_epilogue; -extern struct tree_opt_pass pass_stack_adjustments; -extern struct tree_opt_pass pass_peephole2; -extern struct tree_opt_pass pass_if_after_reload; -extern struct tree_opt_pass pass_regrename; -extern struct tree_opt_pass pass_cprop_hardreg; -extern struct tree_opt_pass pass_reorder_blocks; -extern struct tree_opt_pass pass_branch_target_load_optimize2; -extern struct tree_opt_pass pass_leaf_regs; -extern struct tree_opt_pass pass_split_before_sched2; -extern struct tree_opt_pass pass_sched2; -extern struct tree_opt_pass pass_stack_regs; -extern struct tree_opt_pass pass_stack_regs_run; -extern struct tree_opt_pass pass_df_finish; -extern struct tree_opt_pass pass_compute_alignments; -extern struct tree_opt_pass pass_duplicate_computed_gotos; -extern struct tree_opt_pass pass_variable_tracking; -extern struct tree_opt_pass pass_free_cfg; -extern struct tree_opt_pass pass_machine_reorg; -extern struct tree_opt_pass pass_cleanup_barriers; -extern struct tree_opt_pass pass_delay_slots; -extern struct tree_opt_pass pass_split_for_shorten_branches; -extern struct tree_opt_pass pass_split_before_regstack; -extern struct tree_opt_pass pass_convert_to_eh_region_ranges; -extern struct tree_opt_pass pass_shorten_branches; -extern struct tree_opt_pass pass_set_nothrow_function_flags; -extern struct tree_opt_pass pass_final; -extern struct tree_opt_pass pass_rtl_seqabstr; -extern struct tree_opt_pass pass_release_ssa_names; -extern struct tree_opt_pass pass_early_inline; -extern struct tree_opt_pass pass_inline_parameters; -extern struct tree_opt_pass pass_apply_inline; -extern struct tree_opt_pass pass_all_early_optimizations; -extern struct tree_opt_pass pass_update_address_taken; +extern struct gimple_opt_pass pass_basilys; + +extern struct gimple_opt_pass pass_all_optimizations; +extern struct gimple_opt_pass pass_cleanup_cfg_post_optimizing; +extern struct gimple_opt_pass pass_free_cfg_annotations; +extern struct gimple_opt_pass pass_free_datastructures; +extern struct gimple_opt_pass pass_init_datastructures; +extern struct gimple_opt_pass pass_fixup_cfg; + +#if ENABLE_COMPILER_PROBE +extern struct gimple_opt_pass pass_compiler_probe; +#endif + +extern struct rtl_opt_pass pass_init_function; +extern struct rtl_opt_pass pass_jump; +extern struct rtl_opt_pass pass_rtl_eh; +extern struct rtl_opt_pass pass_initial_value_sets; +extern struct rtl_opt_pass pass_unshare_all_rtl; +extern struct rtl_opt_pass pass_instantiate_virtual_regs; +extern struct rtl_opt_pass pass_rtl_fwprop; +extern struct rtl_opt_pass pass_rtl_fwprop_addr; +extern struct rtl_opt_pass pass_jump2; +extern struct rtl_opt_pass pass_lower_subreg; +extern struct rtl_opt_pass pass_cse; +extern struct rtl_opt_pass pass_fast_rtl_dce; +extern struct rtl_opt_pass pass_ud_rtl_dce; +extern struct rtl_opt_pass pass_rtl_dce; +extern struct rtl_opt_pass pass_rtl_dse1; +extern struct rtl_opt_pass pass_rtl_dse2; +extern struct rtl_opt_pass pass_rtl_dse3; +extern struct rtl_opt_pass pass_gcse; +extern struct rtl_opt_pass pass_jump_bypass; +extern struct rtl_opt_pass pass_profiling; +extern struct rtl_opt_pass pass_rtl_ifcvt; +extern struct gimple_opt_pass pass_tracer; + +extern struct rtl_opt_pass pass_into_cfg_layout_mode; +extern struct rtl_opt_pass pass_outof_cfg_layout_mode; + +extern struct rtl_opt_pass pass_loop2; +extern struct rtl_opt_pass pass_rtl_loop_init; +extern struct rtl_opt_pass pass_rtl_move_loop_invariants; +extern struct rtl_opt_pass pass_rtl_unswitch; +extern struct rtl_opt_pass pass_rtl_unroll_and_peel_loops; +extern struct rtl_opt_pass pass_rtl_doloop; +extern struct rtl_opt_pass pass_rtl_loop_done; + +extern struct rtl_opt_pass pass_web; +extern struct rtl_opt_pass pass_cse2; +extern struct rtl_opt_pass pass_df_initialize_opt; +extern struct rtl_opt_pass pass_df_initialize_no_opt; +extern struct rtl_opt_pass pass_regclass_init; +extern struct rtl_opt_pass pass_subregs_of_mode_init; +extern struct rtl_opt_pass pass_subregs_of_mode_finish; +extern struct rtl_opt_pass pass_inc_dec; +extern struct rtl_opt_pass pass_stack_ptr_mod; +extern struct rtl_opt_pass pass_initialize_regs; +extern struct rtl_opt_pass pass_combine; +extern struct rtl_opt_pass pass_if_after_combine; +extern struct rtl_opt_pass pass_partition_blocks; +extern struct rtl_opt_pass pass_match_asm_constraints; +extern struct rtl_opt_pass pass_regmove; +extern struct rtl_opt_pass pass_split_all_insns; +extern struct rtl_opt_pass pass_lower_subreg2; +extern struct rtl_opt_pass pass_mode_switching; +extern struct rtl_opt_pass pass_see; +extern struct rtl_opt_pass pass_sms; +extern struct rtl_opt_pass pass_sched; +extern struct rtl_opt_pass pass_local_alloc; +extern struct rtl_opt_pass pass_global_alloc; +extern struct rtl_opt_pass pass_postreload; +extern struct rtl_opt_pass pass_clean_state; +extern struct rtl_opt_pass pass_branch_prob; +extern struct rtl_opt_pass pass_value_profile_transformations; +extern struct rtl_opt_pass pass_postreload_cse; +extern struct rtl_opt_pass pass_gcse2; +extern struct rtl_opt_pass pass_split_after_reload; +extern struct rtl_opt_pass pass_branch_target_load_optimize1; +extern struct rtl_opt_pass pass_thread_prologue_and_epilogue; +extern struct rtl_opt_pass pass_stack_adjustments; +extern struct rtl_opt_pass pass_peephole2; +extern struct rtl_opt_pass pass_if_after_reload; +extern struct rtl_opt_pass pass_regrename; +extern struct rtl_opt_pass pass_cprop_hardreg; +extern struct rtl_opt_pass pass_reorder_blocks; +extern struct rtl_opt_pass pass_branch_target_load_optimize2; +extern struct rtl_opt_pass pass_leaf_regs; +extern struct rtl_opt_pass pass_split_before_sched2; +extern struct rtl_opt_pass pass_sched2; +extern struct rtl_opt_pass pass_stack_regs; +extern struct rtl_opt_pass pass_stack_regs_run; +extern struct rtl_opt_pass pass_df_finish; +extern struct rtl_opt_pass pass_compute_alignments; +extern struct rtl_opt_pass pass_duplicate_computed_gotos; +extern struct rtl_opt_pass pass_variable_tracking; +extern struct rtl_opt_pass pass_free_cfg; +extern struct rtl_opt_pass pass_machine_reorg; +extern struct rtl_opt_pass pass_cleanup_barriers; +extern struct rtl_opt_pass pass_delay_slots; +extern struct rtl_opt_pass pass_split_for_shorten_branches; +extern struct rtl_opt_pass pass_split_before_regstack; +extern struct rtl_opt_pass pass_convert_to_eh_region_ranges; +extern struct rtl_opt_pass pass_shorten_branches; +extern struct rtl_opt_pass pass_set_nothrow_function_flags; +extern struct rtl_opt_pass pass_final; +extern struct rtl_opt_pass pass_rtl_seqabstr; +extern struct gimple_opt_pass pass_release_ssa_names; +extern struct gimple_opt_pass pass_early_inline; +extern struct gimple_opt_pass pass_inline_parameters; +extern struct gimple_opt_pass pass_apply_inline; +extern struct gimple_opt_pass pass_all_early_optimizations; +extern struct gimple_opt_pass pass_update_address_taken; /* The root of the compilation pass tree, once constructed. */ -extern struct tree_opt_pass *all_passes, *all_ipa_passes, *all_lowering_passes; +extern struct opt_pass *all_passes, *all_ipa_passes, *all_lowering_passes; -extern void execute_pass_list (struct tree_opt_pass *); -extern void execute_ipa_pass_list (struct tree_opt_pass *); +extern void execute_pass_list (struct opt_pass *); +extern void execute_ipa_pass_list (struct opt_pass *); extern void print_current_pass (FILE *); extern void debug_pass (void); diff --git a/gcc/tree-pretty-print.c b/gcc/tree-pretty-print.c index b64571dbae2..8b5f847e476 100644 --- a/gcc/tree-pretty-print.c +++ b/gcc/tree-pretty-print.c @@ -35,6 +35,7 @@ along with GCC; see the file COPYING3. If not see #include "tree-pass.h" #include "fixed-value.h" #include "value-prof.h" +#include "predict.h" /* Local functions, macros and variables. */ static int op_prio (const_tree); @@ -1592,6 +1593,16 @@ dump_generic_node (pretty_printer *buffer, tree node, int spc, int flags, is_expr = false; break; + case PREDICT_EXPR: + pp_string (buffer, "// predicted "); + if (PREDICT_EXPR_OUTCOME (node)) + pp_string (buffer, "likely by "); + else + pp_string (buffer, "unlikely by "); + pp_string (buffer, predictor_name (PREDICT_EXPR_PREDICTOR (node))); + pp_string (buffer, " predictor."); + break; + case RETURN_EXPR: pp_string (buffer, "return"); op0 = TREE_OPERAND (node, 0); diff --git a/gcc/tree-profile.c b/gcc/tree-profile.c index 57c9f5c0c5a..7a70cefad19 100644 --- a/gcc/tree-profile.c +++ b/gcc/tree-profile.c @@ -443,8 +443,10 @@ tree_profiling (void) return 0; } -struct tree_opt_pass pass_tree_profile = +struct gimple_opt_pass pass_tree_profile = { + { + GIMPLE_PASS, "tree_profile", /* name */ do_tree_profiling, /* gate */ tree_profiling, /* execute */ @@ -456,8 +458,8 @@ struct tree_opt_pass pass_tree_profile = PROP_gimple_leh | PROP_cfg, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - TODO_verify_stmts | TODO_dump_func, /* todo_flags_finish */ - 0 /* letter */ + TODO_verify_stmts | TODO_dump_func /* todo_flags_finish */ + } }; struct profile_hooks tree_profile_hooks = diff --git a/gcc/tree-sra.c b/gcc/tree-sra.c index 45142e8e14c..752f87da947 100644 --- a/gcc/tree-sra.c +++ b/gcc/tree-sra.c @@ -3680,8 +3680,10 @@ gate_sra (void) return flag_tree_sra != 0; } -struct tree_opt_pass pass_sra_early = +struct gimple_opt_pass pass_sra_early = { + { + GIMPLE_PASS, "esra", /* name */ gate_sra, /* gate */ tree_sra_early, /* execute */ @@ -3696,12 +3698,14 @@ struct tree_opt_pass pass_sra_early = TODO_dump_func | TODO_update_ssa | TODO_ggc_collect - | TODO_verify_ssa, /* todo_flags_finish */ - 0 /* letter */ + | TODO_verify_ssa /* todo_flags_finish */ + } }; -struct tree_opt_pass pass_sra = +struct gimple_opt_pass pass_sra = { + { + GIMPLE_PASS, "sra", /* name */ gate_sra, /* gate */ tree_sra, /* execute */ @@ -3716,6 +3720,6 @@ struct tree_opt_pass pass_sra = TODO_dump_func | TODO_update_ssa | TODO_ggc_collect - | TODO_verify_ssa, /* todo_flags_finish */ - 0 /* letter */ + | TODO_verify_ssa /* todo_flags_finish */ + } }; diff --git a/gcc/tree-ssa-alias.c b/gcc/tree-ssa-alias.c index 7ab2f6b5473..a9ae29fa876 100644 --- a/gcc/tree-ssa-alias.c +++ b/gcc/tree-ssa-alias.c @@ -4205,8 +4205,10 @@ gate_structure_vars (void) return flag_tree_salias != 0; } -struct tree_opt_pass pass_create_structure_vars = +struct gimple_opt_pass pass_create_structure_vars = { + { + GIMPLE_PASS, "salias", /* name */ gate_structure_vars, /* gate */ create_structure_vars, /* execute */ @@ -4218,8 +4220,8 @@ struct tree_opt_pass pass_create_structure_vars = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - TODO_dump_func, /* todo_flags_finish */ - 0 /* letter */ + TODO_dump_func /* todo_flags_finish */ + } }; /* Reset the call_clobbered flags on our referenced vars. In @@ -4236,8 +4238,10 @@ reset_cc_flags (void) return 0; } -struct tree_opt_pass pass_reset_cc_flags = +struct gimple_opt_pass pass_reset_cc_flags = { + { + GIMPLE_PASS, NULL, /* name */ NULL, /* gate */ reset_cc_flags, /* execute */ @@ -4249,8 +4253,8 @@ struct tree_opt_pass pass_reset_cc_flags = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - 0, /* todo_flags_finish */ - 0 /* letter */ + 0 /* todo_flags_finish */ + } }; static bool @@ -4260,8 +4264,10 @@ gate_build_alias (void) } -struct tree_opt_pass pass_build_alias = +struct gimple_opt_pass pass_build_alias = { + { + GIMPLE_PASS, "build_alias", /* name */ gate_build_alias, /* gate */ NULL, /* execute */ @@ -4273,6 +4279,6 @@ struct tree_opt_pass pass_build_alias = PROP_alias, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - TODO_rebuild_alias, /* todo_flags_finish */ - 0 /* letter */ + TODO_rebuild_alias /* todo_flags_finish */ + } }; diff --git a/gcc/tree-ssa-ccp.c b/gcc/tree-ssa-ccp.c index f087a8d8948..2a82c046999 100644 --- a/gcc/tree-ssa-ccp.c +++ b/gcc/tree-ssa-ccp.c @@ -1495,8 +1495,10 @@ gate_ccp (void) } -struct tree_opt_pass pass_ccp = +struct gimple_opt_pass pass_ccp = { + { + GIMPLE_PASS, "ccp", /* name */ gate_ccp, /* gate */ do_ssa_ccp, /* execute */ @@ -1509,8 +1511,8 @@ struct tree_opt_pass pass_ccp = 0, /* properties_destroyed */ 0, /* todo_flags_start */ TODO_dump_func | TODO_verify_ssa - | TODO_verify_stmts | TODO_ggc_collect,/* todo_flags_finish */ - 0 /* letter */ + | TODO_verify_stmts | TODO_ggc_collect/* todo_flags_finish */ + } }; @@ -1531,8 +1533,10 @@ gate_store_ccp (void) } -struct tree_opt_pass pass_store_ccp = +struct gimple_opt_pass pass_store_ccp = { + { + GIMPLE_PASS, "store_ccp", /* name */ gate_store_ccp, /* gate */ do_ssa_store_ccp, /* execute */ @@ -1545,8 +1549,8 @@ struct tree_opt_pass pass_store_ccp = 0, /* properties_destroyed */ 0, /* todo_flags_start */ TODO_dump_func | TODO_verify_ssa - | TODO_verify_stmts | TODO_ggc_collect,/* todo_flags_finish */ - 0 /* letter */ + | TODO_verify_stmts | TODO_ggc_collect/* todo_flags_finish */ + } }; /* Given a constant value VAL for bitfield FIELD, and a destination @@ -2105,6 +2109,12 @@ maybe_fold_stmt_addition (tree expr) } ptd_type = TREE_TYPE (ptr_type); + /* If we want a pointer to void, reconstruct the reference from the + array element type. A pointer to that can be trivially converted + to void *. This happens as we fold (void *)(ptr p+ off). */ + if (VOID_TYPE_P (ptd_type) + && TREE_CODE (TREE_TYPE (op0)) == ARRAY_TYPE) + ptd_type = TREE_TYPE (TREE_TYPE (op0)); /* At which point we can try some of the same things as for indirects. */ t = maybe_fold_offset_to_array_ref (op0, op1, ptd_type, true); @@ -2292,6 +2302,17 @@ get_maxval_strlen (tree arg, tree *length, bitmap visited, int type) if (TREE_CODE (arg) == COND_EXPR) return get_maxval_strlen (COND_EXPR_THEN (arg), length, visited, type) && get_maxval_strlen (COND_EXPR_ELSE (arg), length, visited, type); + /* We can end up with &(*iftmp_1)[0] here as well, so handle it. */ + else if (TREE_CODE (arg) == ADDR_EXPR + && TREE_CODE (TREE_OPERAND (arg, 0)) == ARRAY_REF + && integer_zerop (TREE_OPERAND (TREE_OPERAND (arg, 0), 1))) + { + tree aop0 = TREE_OPERAND (TREE_OPERAND (arg, 0), 0); + if (TREE_CODE (aop0) == INDIRECT_REF + && TREE_CODE (TREE_OPERAND (aop0, 0)) == SSA_NAME) + return get_maxval_strlen (TREE_OPERAND (aop0, 0), + length, visited, type); + } if (type == 2) { @@ -3009,8 +3030,10 @@ execute_fold_all_builtins (void) } -struct tree_opt_pass pass_fold_builtins = +struct gimple_opt_pass pass_fold_builtins = { + { + GIMPLE_PASS, "fab", /* name */ NULL, /* gate */ execute_fold_all_builtins, /* execute */ @@ -3024,6 +3047,6 @@ struct tree_opt_pass pass_fold_builtins = 0, /* todo_flags_start */ TODO_dump_func | TODO_verify_ssa - | TODO_update_ssa, /* todo_flags_finish */ - 0 /* letter */ + | TODO_update_ssa /* todo_flags_finish */ + } }; diff --git a/gcc/tree-ssa-copy.c b/gcc/tree-ssa-copy.c index 2cd30c94eb0..bc8a874eeda 100644 --- a/gcc/tree-ssa-copy.c +++ b/gcc/tree-ssa-copy.c @@ -1062,8 +1062,10 @@ gate_copy_prop (void) return flag_tree_copy_prop != 0; } -struct tree_opt_pass pass_copy_prop = +struct gimple_opt_pass pass_copy_prop = { + { + GIMPLE_PASS, "copyprop", /* name */ gate_copy_prop, /* gate */ execute_copy_prop, /* execute */ @@ -1079,7 +1081,7 @@ struct tree_opt_pass pass_copy_prop = | TODO_dump_func | TODO_ggc_collect | TODO_verify_ssa - | TODO_update_ssa, /* todo_flags_finish */ - 0 /* letter */ + | TODO_update_ssa /* todo_flags_finish */ + } }; diff --git a/gcc/tree-ssa-copyrename.c b/gcc/tree-ssa-copyrename.c index d701d4385d3..46b33143cb0 100644 --- a/gcc/tree-ssa-copyrename.c +++ b/gcc/tree-ssa-copyrename.c @@ -389,8 +389,10 @@ gate_copyrename (void) return flag_tree_copyrename != 0; } -struct tree_opt_pass pass_rename_ssa_copies = -{ +struct gimple_opt_pass pass_rename_ssa_copies = +{ + { + GIMPLE_PASS, "copyrename", /* name */ gate_copyrename, /* gate */ rename_ssa_copies, /* execute */ @@ -402,7 +404,7 @@ struct tree_opt_pass pass_rename_ssa_copies = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - TODO_dump_func | TODO_verify_ssa, /* todo_flags_finish */ - 0 /* letter */ + TODO_dump_func | TODO_verify_ssa /* todo_flags_finish */ + } }; diff --git a/gcc/tree-ssa-dce.c b/gcc/tree-ssa-dce.c index bc1700338d8..95457eb7fe4 100644 --- a/gcc/tree-ssa-dce.c +++ b/gcc/tree-ssa-dce.c @@ -277,7 +277,7 @@ mark_stmt_if_obviously_necessary (tree stmt, bool aggressive) can then remove the block and labels. */ switch (TREE_CODE (stmt)) { - case BIND_EXPR: + case PREDICT_EXPR: case LABEL_EXPR: case CASE_LABEL_EXPR: mark_stmt_necessary (stmt, false); @@ -901,8 +901,10 @@ gate_dce (void) return flag_tree_dce != 0; } -struct tree_opt_pass pass_dce = +struct gimple_opt_pass pass_dce = { + { + GIMPLE_PASS, "dce", /* name */ gate_dce, /* gate */ tree_ssa_dce, /* execute */ @@ -914,12 +916,14 @@ struct tree_opt_pass pass_dce = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - TODO_dump_func | TODO_verify_ssa, /* todo_flags_finish */ - 0 /* letter */ + TODO_dump_func | TODO_verify_ssa /* todo_flags_finish */ + } }; -struct tree_opt_pass pass_dce_loop = +struct gimple_opt_pass pass_dce_loop = { + { + GIMPLE_PASS, "dceloop", /* name */ gate_dce, /* gate */ tree_ssa_dce_loop, /* execute */ @@ -931,12 +935,14 @@ struct tree_opt_pass pass_dce_loop = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - TODO_dump_func | TODO_verify_ssa, /* todo_flags_finish */ - 0 /* letter */ + TODO_dump_func | TODO_verify_ssa /* todo_flags_finish */ + } }; -struct tree_opt_pass pass_cd_dce = +struct gimple_opt_pass pass_cd_dce = { + { + GIMPLE_PASS, "cddce", /* name */ gate_dce, /* gate */ tree_ssa_cd_dce, /* execute */ @@ -949,6 +955,6 @@ struct tree_opt_pass pass_cd_dce = 0, /* properties_destroyed */ 0, /* todo_flags_start */ TODO_dump_func | TODO_verify_ssa - | TODO_verify_flow, /* todo_flags_finish */ - 0 /* letter */ + | TODO_verify_flow /* todo_flags_finish */ + } }; diff --git a/gcc/tree-ssa-dom.c b/gcc/tree-ssa-dom.c index bc9809edfc2..4d95261bc73 100644 --- a/gcc/tree-ssa-dom.c +++ b/gcc/tree-ssa-dom.c @@ -367,8 +367,10 @@ gate_dominator (void) return flag_tree_dom != 0; } -struct tree_opt_pass pass_dominator = +struct gimple_opt_pass pass_dominator = { + { + GIMPLE_PASS, "dom", /* name */ gate_dominator, /* gate */ tree_ssa_dominator_optimize, /* execute */ @@ -383,8 +385,8 @@ struct tree_opt_pass pass_dominator = TODO_dump_func | TODO_update_ssa | TODO_cleanup_cfg - | TODO_verify_ssa, /* todo_flags_finish */ - 0 /* letter */ + | TODO_verify_ssa /* todo_flags_finish */ + } }; @@ -2533,8 +2535,10 @@ eliminate_degenerate_phis (void) return 0; } -struct tree_opt_pass pass_phi_only_cprop = +struct gimple_opt_pass pass_phi_only_cprop = { + { + GIMPLE_PASS, "phicprop", /* name */ gate_dominator, /* gate */ eliminate_degenerate_phis, /* execute */ @@ -2551,6 +2555,6 @@ struct tree_opt_pass pass_phi_only_cprop = | TODO_ggc_collect | TODO_verify_ssa | TODO_verify_stmts - | TODO_update_ssa, /* todo_flags_finish */ - 0 /* letter */ + | TODO_update_ssa /* todo_flags_finish */ + } }; diff --git a/gcc/tree-ssa-dse.c b/gcc/tree-ssa-dse.c index f2ec9a505c7..8c960045ce6 100644 --- a/gcc/tree-ssa-dse.c +++ b/gcc/tree-ssa-dse.c @@ -632,7 +632,10 @@ gate_dse (void) return flag_tree_dse != 0; } -struct tree_opt_pass pass_dse = { +struct gimple_opt_pass pass_dse = +{ + { + GIMPLE_PASS, "dse", /* name */ gate_dse, /* gate */ tree_ssa_dse, /* execute */ @@ -648,8 +651,8 @@ struct tree_opt_pass pass_dse = { 0, /* todo_flags_start */ TODO_dump_func | TODO_ggc_collect - | TODO_verify_ssa, /* todo_flags_finish */ - 0 /* letter */ + | TODO_verify_ssa /* todo_flags_finish */ + } }; /* A very simple dead store pass eliminating write only local variables. @@ -769,8 +772,10 @@ execute_simple_dse (void) return todo; } -struct tree_opt_pass pass_simple_dse = +struct gimple_opt_pass pass_simple_dse = { + { + GIMPLE_PASS, "sdse", /* name */ NULL, /* gate */ execute_simple_dse, /* execute */ @@ -782,6 +787,6 @@ struct tree_opt_pass pass_simple_dse = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - TODO_dump_func, /* todo_flags_finish */ - 0 /* letter */ + TODO_dump_func /* todo_flags_finish */ + } }; diff --git a/gcc/tree-ssa-forwprop.c b/gcc/tree-ssa-forwprop.c index 5108cfcd6f2..84553fbef42 100644 --- a/gcc/tree-ssa-forwprop.c +++ b/gcc/tree-ssa-forwprop.c @@ -218,14 +218,28 @@ get_prop_source_stmt (tree name, bool single_use_only, bool *single_use_p) /* If name is not a simple copy destination, we found it. */ if (TREE_CODE (GIMPLE_STMT_OPERAND (def_stmt, 1)) != SSA_NAME) { + tree rhs; + if (!single_use_only && single_use_p) *single_use_p = single_use; - return def_stmt; + /* We can look through pointer conversions in the search + for a useful stmt for the comparison folding. */ + rhs = GIMPLE_STMT_OPERAND (def_stmt, 1); + if ((TREE_CODE (rhs) == NOP_EXPR + || TREE_CODE (rhs) == CONVERT_EXPR) + && TREE_CODE (TREE_OPERAND (rhs, 0)) == SSA_NAME + && POINTER_TYPE_P (TREE_TYPE (rhs)) + && POINTER_TYPE_P (TREE_TYPE (TREE_OPERAND (rhs, 0)))) + name = TREE_OPERAND (rhs, 0); + else + return def_stmt; + } + else + { + /* Continue searching the def of the copy source name. */ + name = GIMPLE_STMT_OPERAND (def_stmt, 1); } - - /* Continue searching the def of the copy source name. */ - name = GIMPLE_STMT_OPERAND (def_stmt, 1); } while (1); } @@ -245,6 +259,10 @@ can_propagate_from (tree def_stmt) if (REFERENCE_CLASS_P (rhs)) return false; + /* Constants can be always propagated. */ + if (is_gimple_min_invariant (rhs)) + return true; + /* We cannot propagate ssa names that occur in abnormal phi nodes. */ switch (TREE_CODE_LENGTH (TREE_CODE (rhs))) { @@ -1063,7 +1081,10 @@ gate_forwprop (void) return 1; } -struct tree_opt_pass pass_forwprop = { +struct gimple_opt_pass pass_forwprop = +{ + { + GIMPLE_PASS, "forwprop", /* name */ gate_forwprop, /* gate */ tree_ssa_forward_propagate_single_use_vars, /* execute */ @@ -1078,7 +1099,7 @@ struct tree_opt_pass pass_forwprop = { TODO_dump_func | TODO_ggc_collect | TODO_update_ssa - | TODO_verify_ssa, /* todo_flags_finish */ - 0 /* letter */ + | TODO_verify_ssa /* todo_flags_finish */ + } }; diff --git a/gcc/tree-ssa-ifcombine.c b/gcc/tree-ssa-ifcombine.c index eef6f22d2a2..cec5868c636 100644 --- a/gcc/tree-ssa-ifcombine.c +++ b/gcc/tree-ssa-ifcombine.c @@ -605,7 +605,10 @@ gate_ifcombine (void) return 1; } -struct tree_opt_pass pass_tree_ifcombine = { +struct gimple_opt_pass pass_tree_ifcombine = +{ + { + GIMPLE_PASS, "ifcombine", /* name */ gate_ifcombine, /* gate */ tree_ssa_ifcombine, /* execute */ @@ -620,6 +623,6 @@ struct tree_opt_pass pass_tree_ifcombine = { TODO_dump_func | TODO_ggc_collect | TODO_update_ssa - | TODO_verify_ssa, /* todo_flags_finish */ - 0 /* letter */ + | TODO_verify_ssa /* todo_flags_finish */ + } }; diff --git a/gcc/tree-ssa-loop-ch.c b/gcc/tree-ssa-loop-ch.c index ff62c686c28..47b93f8beeb 100644 --- a/gcc/tree-ssa-loop-ch.c +++ b/gcc/tree-ssa-loop-ch.c @@ -253,8 +253,10 @@ gate_ch (void) return flag_tree_ch != 0; } -struct tree_opt_pass pass_ch = +struct gimple_opt_pass pass_ch = { + { + GIMPLE_PASS, "ch", /* name */ gate_ch, /* gate */ copy_loop_headers, /* execute */ @@ -267,6 +269,6 @@ struct tree_opt_pass pass_ch = 0, /* properties_destroyed */ 0, /* todo_flags_start */ TODO_cleanup_cfg | TODO_dump_func - | TODO_verify_ssa, /* todo_flags_finish */ - 0 /* letter */ + | TODO_verify_ssa /* todo_flags_finish */ + } }; diff --git a/gcc/tree-ssa-loop-niter.c b/gcc/tree-ssa-loop-niter.c index 0696342bd1b..40e7051c265 100644 --- a/gcc/tree-ssa-loop-niter.c +++ b/gcc/tree-ssa-loop-niter.c @@ -1436,10 +1436,6 @@ expand_simple_operations (tree expr) return expr; e = GIMPLE_STMT_OPERAND (stmt, 1); - /* Do not expand random invariants. */ - if (TREE_INVARIANT (e) - && !is_gimple_min_invariant (e)) - return expr; if (/* Casts are simple. */ TREE_CODE (e) != NOP_EXPR && TREE_CODE (e) != CONVERT_EXPR diff --git a/gcc/tree-ssa-loop.c b/gcc/tree-ssa-loop.c index 3361834f57c..639fb10a393 100644 --- a/gcc/tree-ssa-loop.c +++ b/gcc/tree-ssa-loop.c @@ -55,8 +55,10 @@ gate_tree_loop (void) return flag_tree_loop_optimize != 0; } -struct tree_opt_pass pass_tree_loop = +struct gimple_opt_pass pass_tree_loop = { + { + GIMPLE_PASS, "loop", /* name */ gate_tree_loop, /* gate */ NULL, /* execute */ @@ -68,8 +70,8 @@ struct tree_opt_pass pass_tree_loop = 0, /* properties_provided */ 0, /* properties_destroyed */ TODO_ggc_collect, /* todo_flags_start */ - TODO_dump_func | TODO_verify_ssa | TODO_ggc_collect, /* todo_flags_finish */ - 0 /* letter */ + TODO_dump_func | TODO_verify_ssa | TODO_ggc_collect /* todo_flags_finish */ + } }; /* Loop optimizer initialization. */ @@ -85,8 +87,10 @@ tree_ssa_loop_init (void) return 0; } -struct tree_opt_pass pass_tree_loop_init = +struct gimple_opt_pass pass_tree_loop_init = { + { + GIMPLE_PASS, "loopinit", /* name */ NULL, /* gate */ tree_ssa_loop_init, /* execute */ @@ -98,8 +102,8 @@ struct tree_opt_pass pass_tree_loop_init = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - TODO_dump_func | TODO_verify_loops, /* todo_flags_finish */ - 0 /* letter */ + TODO_dump_func | TODO_verify_loops /* todo_flags_finish */ + } }; /* Loop invariant motion pass. */ @@ -120,8 +124,10 @@ gate_tree_ssa_loop_im (void) return flag_tree_loop_im != 0; } -struct tree_opt_pass pass_lim = +struct gimple_opt_pass pass_lim = { + { + GIMPLE_PASS, "lim", /* name */ gate_tree_ssa_loop_im, /* gate */ tree_ssa_loop_im, /* execute */ @@ -133,8 +139,8 @@ struct tree_opt_pass pass_lim = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - TODO_dump_func | TODO_verify_loops, /* todo_flags_finish */ - 0 /* letter */ + TODO_dump_func | TODO_verify_loops /* todo_flags_finish */ + } }; /* Loop unswitching pass. */ @@ -154,8 +160,10 @@ gate_tree_ssa_loop_unswitch (void) return flag_unswitch_loops != 0; } -struct tree_opt_pass pass_tree_unswitch = +struct gimple_opt_pass pass_tree_unswitch = { + { + GIMPLE_PASS, "unswitch", /* name */ gate_tree_ssa_loop_unswitch, /* gate */ tree_ssa_loop_unswitch, /* execute */ @@ -168,8 +176,8 @@ struct tree_opt_pass pass_tree_unswitch = 0, /* properties_destroyed */ 0, /* todo_flags_start */ TODO_ggc_collect | TODO_dump_func - | TODO_verify_loops, /* todo_flags_finish */ - 0 /* letter */ + | TODO_verify_loops /* todo_flags_finish */ + } }; /* Predictive commoning. */ @@ -190,8 +198,10 @@ gate_tree_predictive_commoning (void) return flag_predictive_commoning != 0; } -struct tree_opt_pass pass_predcom = +struct gimple_opt_pass pass_predcom = { + { + GIMPLE_PASS, "pcom", /* name */ gate_tree_predictive_commoning, /* gate */ run_tree_predictive_commoning, /* execute */ @@ -204,8 +214,8 @@ struct tree_opt_pass pass_predcom = 0, /* properties_destroyed */ 0, /* todo_flags_start */ TODO_dump_func | TODO_verify_loops - | TODO_update_ssa_only_virtuals, /* todo_flags_finish */ - 0 /* letter */ + | TODO_update_ssa_only_virtuals /* todo_flags_finish */ + } }; /* Loop autovectorization. */ @@ -222,8 +232,10 @@ gate_tree_vectorize (void) return flag_tree_vectorize && number_of_loops () > 1; } -struct tree_opt_pass pass_vectorize = +struct gimple_opt_pass pass_vectorize = { + { + GIMPLE_PASS, "vect", /* name */ gate_tree_vectorize, /* gate */ tree_vectorize, /* execute */ @@ -236,8 +248,8 @@ struct tree_opt_pass pass_vectorize = 0, /* properties_destroyed */ TODO_verify_loops, /* todo_flags_start */ TODO_dump_func | TODO_update_ssa - | TODO_ggc_collect, /* todo_flags_finish */ - 0 /* letter */ + | TODO_ggc_collect /* todo_flags_finish */ + } }; /* Loop nest optimizations. */ @@ -258,8 +270,10 @@ gate_tree_linear_transform (void) return flag_tree_loop_linear != 0; } -struct tree_opt_pass pass_linear_transform = +struct gimple_opt_pass pass_linear_transform = { + { + GIMPLE_PASS, "ltrans", /* name */ gate_tree_linear_transform, /* gate */ tree_linear_transform, /* execute */ @@ -273,8 +287,8 @@ struct tree_opt_pass pass_linear_transform = 0, /* todo_flags_start */ TODO_dump_func | TODO_verify_loops | TODO_update_ssa_only_virtuals - | TODO_ggc_collect, /* todo_flags_finish */ - 0 /* letter */ + | TODO_ggc_collect /* todo_flags_finish */ + } }; /* Check the correctness of the data dependence analyzers. */ @@ -295,8 +309,10 @@ gate_check_data_deps (void) return flag_check_data_deps != 0; } -struct tree_opt_pass pass_check_data_deps = +struct gimple_opt_pass pass_check_data_deps = { + { + GIMPLE_PASS, "ckdd", /* name */ gate_check_data_deps, /* gate */ check_data_deps, /* execute */ @@ -308,8 +324,8 @@ struct tree_opt_pass pass_check_data_deps = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - TODO_dump_func, /* todo_flags_finish */ - 0 /* letter */ + TODO_dump_func /* todo_flags_finish */ + } }; /* Canonical induction variable creation pass. */ @@ -329,8 +345,10 @@ gate_tree_ssa_loop_ivcanon (void) return flag_tree_loop_ivcanon != 0; } -struct tree_opt_pass pass_iv_canon = +struct gimple_opt_pass pass_iv_canon = { + { + GIMPLE_PASS, "ivcanon", /* name */ gate_tree_ssa_loop_ivcanon, /* gate */ tree_ssa_loop_ivcanon, /* execute */ @@ -342,8 +360,8 @@ struct tree_opt_pass pass_iv_canon = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - TODO_dump_func | TODO_verify_loops, /* todo_flags_finish */ - 0 /* letter */ + TODO_dump_func | TODO_verify_loops /* todo_flags_finish */ + } }; /* Propagation of constants using scev. */ @@ -354,8 +372,10 @@ gate_scev_const_prop (void) return flag_tree_scev_cprop; } -struct tree_opt_pass pass_scev_cprop = +struct gimple_opt_pass pass_scev_cprop = { + { + GIMPLE_PASS, "sccp", /* name */ gate_scev_const_prop, /* gate */ scev_const_prop, /* execute */ @@ -368,9 +388,9 @@ struct tree_opt_pass pass_scev_cprop = 0, /* properties_destroyed */ 0, /* todo_flags_start */ TODO_dump_func | TODO_cleanup_cfg - | TODO_update_ssa_only_virtuals, + | TODO_update_ssa_only_virtuals /* todo_flags_finish */ - 0 /* letter */ + } }; /* Remove empty loops. */ @@ -384,8 +404,10 @@ tree_ssa_empty_loop (void) return remove_empty_loops (); } -struct tree_opt_pass pass_empty_loop = +struct gimple_opt_pass pass_empty_loop = { + { + GIMPLE_PASS, "empty", /* name */ NULL, /* gate */ tree_ssa_empty_loop, /* execute */ @@ -398,8 +420,8 @@ struct tree_opt_pass pass_empty_loop = 0, /* properties_destroyed */ 0, /* todo_flags_start */ TODO_dump_func | TODO_verify_loops - | TODO_ggc_collect, /* todo_flags_finish */ - 0 /* letter */ + | TODO_ggc_collect /* todo_flags_finish */ + } }; /* Record bounds on numbers of iterations of loops. */ @@ -415,8 +437,10 @@ tree_ssa_loop_bounds (void) return 0; } -struct tree_opt_pass pass_record_bounds = +struct gimple_opt_pass pass_record_bounds = { + { + GIMPLE_PASS, NULL, /* name */ NULL, /* gate */ tree_ssa_loop_bounds, /* execute */ @@ -428,8 +452,8 @@ struct tree_opt_pass pass_record_bounds = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - 0, /* todo_flags_finish */ - 0 /* letter */ + 0 /* todo_flags_finish */ + } }; /* Complete unrolling of loops. */ @@ -451,8 +475,10 @@ gate_tree_complete_unroll (void) return true; } -struct tree_opt_pass pass_complete_unroll = +struct gimple_opt_pass pass_complete_unroll = { + { + GIMPLE_PASS, "cunroll", /* name */ gate_tree_complete_unroll, /* gate */ tree_complete_unroll, /* execute */ @@ -465,8 +491,8 @@ struct tree_opt_pass pass_complete_unroll = 0, /* properties_destroyed */ 0, /* todo_flags_start */ TODO_dump_func | TODO_verify_loops - | TODO_ggc_collect, /* todo_flags_finish */ - 0 /* letter */ + | TODO_ggc_collect /* todo_flags_finish */ + } }; /* Parallelization. */ @@ -488,8 +514,10 @@ tree_parallelize_loops (void) return 0; } -struct tree_opt_pass pass_parallelize_loops = +struct gimple_opt_pass pass_parallelize_loops = { + { + GIMPLE_PASS, "parloops", /* name */ gate_tree_parallelize_loops, /* gate */ tree_parallelize_loops, /* execute */ @@ -501,8 +529,8 @@ struct tree_opt_pass pass_parallelize_loops = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - TODO_dump_func | TODO_verify_loops, /* todo_flags_finish */ - 0 /* letter */ + TODO_dump_func | TODO_verify_loops /* todo_flags_finish */ + } }; /* Prefetching. */ @@ -522,8 +550,10 @@ gate_tree_ssa_loop_prefetch (void) return flag_prefetch_loop_arrays != 0; } -struct tree_opt_pass pass_loop_prefetch = +struct gimple_opt_pass pass_loop_prefetch = { + { + GIMPLE_PASS, "aprefetch", /* name */ gate_tree_ssa_loop_prefetch, /* gate */ tree_ssa_loop_prefetch, /* execute */ @@ -535,8 +565,8 @@ struct tree_opt_pass pass_loop_prefetch = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - TODO_dump_func | TODO_verify_loops, /* todo_flags_finish */ - 0 /* letter */ + TODO_dump_func | TODO_verify_loops /* todo_flags_finish */ + } }; /* Induction variable optimizations. */ @@ -557,8 +587,10 @@ gate_tree_ssa_loop_ivopts (void) return flag_ivopts != 0; } -struct tree_opt_pass pass_iv_optimize = +struct gimple_opt_pass pass_iv_optimize = { + { + GIMPLE_PASS, "ivopts", /* name */ gate_tree_ssa_loop_ivopts, /* gate */ tree_ssa_loop_ivopts, /* execute */ @@ -571,8 +603,8 @@ struct tree_opt_pass pass_iv_optimize = 0, /* properties_destroyed */ 0, /* todo_flags_start */ TODO_dump_func | TODO_verify_loops - | TODO_update_ssa | TODO_ggc_collect, /* todo_flags_finish */ - 0 /* letter */ + | TODO_update_ssa | TODO_ggc_collect /* todo_flags_finish */ + } }; /* Loop optimizer finalization. */ @@ -586,8 +618,10 @@ tree_ssa_loop_done (void) return 0; } -struct tree_opt_pass pass_tree_loop_done = +struct gimple_opt_pass pass_tree_loop_done = { + { + GIMPLE_PASS, "loopdone", /* name */ NULL, /* gate */ tree_ssa_loop_done, /* execute */ @@ -599,6 +633,6 @@ struct tree_opt_pass pass_tree_loop_done = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - TODO_cleanup_cfg | TODO_dump_func, /* todo_flags_finish */ - 0 /* letter */ + TODO_cleanup_cfg | TODO_dump_func /* todo_flags_finish */ + } }; diff --git a/gcc/tree-ssa-math-opts.c b/gcc/tree-ssa-math-opts.c index 087cca2c3d9..49fd1707d1e 100644 --- a/gcc/tree-ssa-math-opts.c +++ b/gcc/tree-ssa-math-opts.c @@ -555,8 +555,10 @@ execute_cse_reciprocals (void) return 0; } -struct tree_opt_pass pass_cse_reciprocals = +struct gimple_opt_pass pass_cse_reciprocals = { + { + GIMPLE_PASS, "recip", /* name */ gate_cse_reciprocals, /* gate */ execute_cse_reciprocals, /* execute */ @@ -569,8 +571,8 @@ struct tree_opt_pass pass_cse_reciprocals = 0, /* properties_destroyed */ 0, /* todo_flags_start */ TODO_dump_func | TODO_update_ssa | TODO_verify_ssa - | TODO_verify_stmts, /* todo_flags_finish */ - 0 /* letter */ + | TODO_verify_stmts /* todo_flags_finish */ + } }; /* Records an occurrence at statement USE_STMT in the vector of trees @@ -761,8 +763,10 @@ gate_cse_sincos (void) && optimize; } -struct tree_opt_pass pass_cse_sincos = +struct gimple_opt_pass pass_cse_sincos = { + { + GIMPLE_PASS, "sincos", /* name */ gate_cse_sincos, /* gate */ execute_cse_sincos, /* execute */ @@ -775,8 +779,8 @@ struct tree_opt_pass pass_cse_sincos = 0, /* properties_destroyed */ 0, /* todo_flags_start */ TODO_dump_func | TODO_update_ssa | TODO_verify_ssa - | TODO_verify_stmts, /* todo_flags_finish */ - 0 /* letter */ + | TODO_verify_stmts /* todo_flags_finish */ + } }; /* Find all expressions in the form of sqrt(a/b) and @@ -853,8 +857,10 @@ gate_convert_to_rsqrt (void) return flag_unsafe_math_optimizations && optimize; } -struct tree_opt_pass pass_convert_to_rsqrt = +struct gimple_opt_pass pass_convert_to_rsqrt = { + { + GIMPLE_PASS, "rsqrt", /* name */ gate_convert_to_rsqrt, /* gate */ execute_convert_to_rsqrt, /* execute */ @@ -867,6 +873,6 @@ struct tree_opt_pass pass_convert_to_rsqrt = 0, /* properties_destroyed */ 0, /* todo_flags_start */ TODO_dump_func | TODO_update_ssa | TODO_verify_ssa - | TODO_verify_stmts, /* todo_flags_finish */ - 0 /* letter */ + | TODO_verify_stmts /* todo_flags_finish */ + } }; diff --git a/gcc/tree-ssa-operands.c b/gcc/tree-ssa-operands.c index ceb18ba55a6..8869e6ed95a 100644 --- a/gcc/tree-ssa-operands.c +++ b/gcc/tree-ssa-operands.c @@ -2376,6 +2376,7 @@ get_expr_operands (tree stmt, tree *expr_p, int flags) case OMP_RETURN: case OMP_SECTION: case OMP_SECTIONS_SWITCH: + case PREDICT_EXPR: /* Expressions that make no memory references. */ return; diff --git a/gcc/tree-ssa-phiopt.c b/gcc/tree-ssa-phiopt.c index e51bac6232c..bfe4fed4ba6 100644 --- a/gcc/tree-ssa-phiopt.c +++ b/gcc/tree-ssa-phiopt.c @@ -1352,8 +1352,10 @@ gate_phiopt (void) return 1; } -struct tree_opt_pass pass_phiopt = +struct gimple_opt_pass pass_phiopt = { + { + GIMPLE_PASS, "phiopt", /* name */ gate_phiopt, /* gate */ tree_ssa_phiopt, /* execute */ @@ -1369,8 +1371,8 @@ struct tree_opt_pass pass_phiopt = | TODO_ggc_collect | TODO_verify_ssa | TODO_verify_flow - | TODO_verify_stmts, /* todo_flags_finish */ - 0 /* letter */ + | TODO_verify_stmts /* todo_flags_finish */ + } }; static bool @@ -1379,8 +1381,10 @@ gate_cselim (void) return flag_tree_cselim; } -struct tree_opt_pass pass_cselim = +struct gimple_opt_pass pass_cselim = { + { + GIMPLE_PASS, "cselim", /* name */ gate_cselim, /* gate */ tree_ssa_cs_elim, /* execute */ @@ -1396,6 +1400,6 @@ struct tree_opt_pass pass_cselim = | TODO_ggc_collect | TODO_verify_ssa | TODO_verify_flow - | TODO_verify_stmts, /* todo_flags_finish */ - 0 /* letter */ + | TODO_verify_stmts /* todo_flags_finish */ + } }; diff --git a/gcc/tree-ssa-phiprop.c b/gcc/tree-ssa-phiprop.c index 273ed2fa53b..2621dae1abd 100644 --- a/gcc/tree-ssa-phiprop.c +++ b/gcc/tree-ssa-phiprop.c @@ -368,7 +368,10 @@ gate_phiprop (void) return 1; } -struct tree_opt_pass pass_phiprop = { +struct gimple_opt_pass pass_phiprop = +{ + { + GIMPLE_PASS, "phiprop", /* name */ gate_phiprop, /* gate */ tree_ssa_phiprop, /* execute */ @@ -383,6 +386,6 @@ struct tree_opt_pass pass_phiprop = { TODO_dump_func | TODO_ggc_collect | TODO_update_ssa - | TODO_verify_ssa, /* todo_flags_finish */ - 0 /* letter */ + | TODO_verify_ssa /* todo_flags_finish */ + } }; diff --git a/gcc/tree-ssa-pre.c b/gcc/tree-ssa-pre.c index 616627ccb1b..e6a931d9440 100644 --- a/gcc/tree-ssa-pre.c +++ b/gcc/tree-ssa-pre.c @@ -3605,10 +3605,11 @@ do_SCCVN_insertion (tree stmt, tree ssa_vn) /* Eliminate fully redundant computations. */ -static void +static unsigned int eliminate (void) { basic_block b; + unsigned int todo = 0; FOR_EACH_BB (b) { @@ -3689,8 +3690,46 @@ eliminate (void) } } } + /* Visit COND_EXPRs and fold the comparison with the + available value-numbers. */ + else if (TREE_CODE (stmt) == COND_EXPR + && COMPARISON_CLASS_P (COND_EXPR_COND (stmt))) + { + tree cond = COND_EXPR_COND (stmt); + tree op0 = TREE_OPERAND (cond, 0); + tree op1 = TREE_OPERAND (cond, 1); + tree result; + + if (TREE_CODE (op0) == SSA_NAME) + op0 = VN_INFO (op0)->valnum; + if (TREE_CODE (op1) == SSA_NAME) + op1 = VN_INFO (op1)->valnum; + result = fold_binary (TREE_CODE (cond), TREE_TYPE (cond), + op0, op1); + if (result && TREE_CODE (result) == INTEGER_CST) + { + COND_EXPR_COND (stmt) = result; + update_stmt (stmt); + todo = TODO_cleanup_cfg; + } + } + else if (TREE_CODE (stmt) == COND_EXPR + && TREE_CODE (COND_EXPR_COND (stmt)) == SSA_NAME) + { + tree op = COND_EXPR_COND (stmt); + op = VN_INFO (op)->valnum; + if (TREE_CODE (op) == INTEGER_CST) + { + COND_EXPR_COND (stmt) = integer_zerop (op) + ? boolean_false_node : boolean_true_node; + update_stmt (stmt); + todo = TODO_cleanup_cfg; + } + } } } + + return todo; } /* Borrow a bit of tree-ssa-dce.c for the moment. @@ -3931,9 +3970,10 @@ fini_pre (void) /* Main entry point to the SSA-PRE pass. DO_FRE is true if the caller only wants to do full redundancy elimination. */ -static void +static unsigned int execute_pre (bool do_fre) { + unsigned int todo = 0; do_partial_partial = optimize > 2; init_pre (do_fre); @@ -3947,7 +3987,7 @@ execute_pre (bool do_fre) if (!do_fre) remove_dead_inserted_code (); fini_pre (); - return; + return 0; } switch_to_PRE_table (); compute_avail (); @@ -3978,7 +4018,7 @@ execute_pre (bool do_fre) } /* Remove all the redundant expressions. */ - eliminate (); + todo |= eliminate (); if (dump_file && (dump_flags & TDF_STATS)) { @@ -3999,6 +4039,8 @@ execute_pre (bool do_fre) } fini_pre (); + + return todo; } /* Gate and execute functions for PRE. */ @@ -4006,8 +4048,7 @@ execute_pre (bool do_fre) static unsigned int do_pre (void) { - execute_pre (false); - return TODO_rebuild_alias; + return TODO_rebuild_alias | execute_pre (false); } static bool @@ -4016,8 +4057,10 @@ gate_pre (void) return flag_tree_pre != 0; } -struct tree_opt_pass pass_pre = +struct gimple_opt_pass pass_pre = { + { + GIMPLE_PASS, "pre", /* name */ gate_pre, /* gate */ do_pre, /* execute */ @@ -4031,8 +4074,8 @@ struct tree_opt_pass pass_pre = 0, /* properties_destroyed */ 0, /* todo_flags_start */ TODO_update_ssa_only_virtuals | TODO_dump_func | TODO_ggc_collect - | TODO_verify_ssa, /* todo_flags_finish */ - 0 /* letter */ + | TODO_verify_ssa /* todo_flags_finish */ + } }; @@ -4041,8 +4084,7 @@ struct tree_opt_pass pass_pre = static unsigned int execute_fre (void) { - execute_pre (true); - return 0; + return execute_pre (true); } static bool @@ -4051,8 +4093,10 @@ gate_fre (void) return flag_tree_fre != 0; } -struct tree_opt_pass pass_fre = +struct gimple_opt_pass pass_fre = { + { + GIMPLE_PASS, "fre", /* name */ gate_fre, /* gate */ execute_fre, /* execute */ @@ -4064,6 +4108,6 @@ struct tree_opt_pass pass_fre = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - TODO_dump_func | TODO_ggc_collect | TODO_verify_ssa, /* todo_flags_finish */ - 0 /* letter */ + TODO_dump_func | TODO_ggc_collect | TODO_verify_ssa /* todo_flags_finish */ + } }; diff --git a/gcc/tree-ssa-reassoc.c b/gcc/tree-ssa-reassoc.c index 6e6f5f7f442..19e10398168 100644 --- a/gcc/tree-ssa-reassoc.c +++ b/gcc/tree-ssa-reassoc.c @@ -1528,8 +1528,10 @@ gate_tree_ssa_reassoc (void) return flag_tree_reassoc != 0; } -struct tree_opt_pass pass_reassoc = +struct gimple_opt_pass pass_reassoc = { + { + GIMPLE_PASS, "reassoc", /* name */ gate_tree_ssa_reassoc, /* gate */ execute_reassoc, /* execute */ @@ -1541,6 +1543,6 @@ struct tree_opt_pass pass_reassoc = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - TODO_dump_func | TODO_ggc_collect | TODO_verify_ssa, /* todo_flags_finish */ - 0 /* letter */ + TODO_dump_func | TODO_ggc_collect | TODO_verify_ssa /* todo_flags_finish */ + } }; diff --git a/gcc/tree-ssa-sccvn.c b/gcc/tree-ssa-sccvn.c index b10d3e31a85..b613b2ba21f 100644 --- a/gcc/tree-ssa-sccvn.c +++ b/gcc/tree-ssa-sccvn.c @@ -1251,6 +1251,12 @@ visit_reference_op_load (tree lhs, tree op, tree stmt) if (result) { changed = set_ssa_val_to (lhs, result); + if (TREE_CODE (result) == SSA_NAME + && VN_INFO (result)->has_constants) + { + VN_INFO (lhs)->expr = VN_INFO (result)->expr; + VN_INFO (lhs)->has_constants = true; + } } else { diff --git a/gcc/tree-ssa-sink.c b/gcc/tree-ssa-sink.c index cd57baa0d99..40a3640b736 100644 --- a/gcc/tree-ssa-sink.c +++ b/gcc/tree-ssa-sink.c @@ -568,8 +568,10 @@ gate_sink (void) return flag_tree_sink != 0; } -struct tree_opt_pass pass_sink_code = +struct gimple_opt_pass pass_sink_code = { + { + GIMPLE_PASS, "sink", /* name */ gate_sink, /* gate */ do_sink, /* execute */ @@ -585,6 +587,6 @@ struct tree_opt_pass pass_sink_code = TODO_update_ssa | TODO_dump_func | TODO_ggc_collect - | TODO_verify_ssa, /* todo_flags_finish */ - 0 /* letter */ + | TODO_verify_ssa /* todo_flags_finish */ + } }; diff --git a/gcc/tree-ssa-structalias.c b/gcc/tree-ssa-structalias.c index 31ab38f8cfa..037f223c140 100644 --- a/gcc/tree-ssa-structalias.c +++ b/gcc/tree-ssa-structalias.c @@ -5630,8 +5630,10 @@ ipa_pta_execute (void) return 0; } -struct tree_opt_pass pass_ipa_pta = +struct simple_ipa_opt_pass pass_ipa_pta = { + { + SIMPLE_IPA_PASS, "pta", /* name */ gate_ipa_pta, /* gate */ ipa_pta_execute, /* execute */ @@ -5643,8 +5645,8 @@ struct tree_opt_pass pass_ipa_pta = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - TODO_update_ssa, /* todo_flags_finish */ - 0 /* letter */ + TODO_update_ssa /* todo_flags_finish */ + } }; /* Initialize the heapvar for statement mapping. */ diff --git a/gcc/tree-ssa-uncprop.c b/gcc/tree-ssa-uncprop.c index 0b6ab7f51b3..0d19c2dfa5f 100644 --- a/gcc/tree-ssa-uncprop.c +++ b/gcc/tree-ssa-uncprop.c @@ -606,8 +606,10 @@ gate_uncprop (void) return flag_tree_dom != 0; } -struct tree_opt_pass pass_uncprop = +struct gimple_opt_pass pass_uncprop = { + { + GIMPLE_PASS, "uncprop", /* name */ gate_uncprop, /* gate */ tree_ssa_uncprop, /* execute */ @@ -619,6 +621,6 @@ struct tree_opt_pass pass_uncprop = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - TODO_dump_func | TODO_verify_ssa, /* todo_flags_finish */ - 0 /* letter */ + TODO_dump_func | TODO_verify_ssa /* todo_flags_finish */ + } }; diff --git a/gcc/tree-ssa.c b/gcc/tree-ssa.c index a036346dee2..128b4e87283 100644 --- a/gcc/tree-ssa.c +++ b/gcc/tree-ssa.c @@ -1416,13 +1416,19 @@ warn_uninit (tree t, const char *gmsgid, void *data) TREE_NO_WARNING (var) = 1; } - + +struct walk_data { + tree stmt; + bool always_executed; +}; + /* Called via walk_tree, look for SSA_NAMEs that have empty definitions and warn about them. */ static tree -warn_uninitialized_var (tree *tp, int *walk_subtrees, void *data) +warn_uninitialized_var (tree *tp, int *walk_subtrees, void *data_) { + struct walk_data *data = (struct walk_data *)data_; tree t = *tp; switch (TREE_CODE (t)) @@ -1430,7 +1436,12 @@ warn_uninitialized_var (tree *tp, int *walk_subtrees, void *data) case SSA_NAME: /* We only do data flow with SSA_NAMEs, so that's all we can warn about. */ - warn_uninit (t, "%H%qD is used uninitialized in this function", data); + if (data->always_executed) + warn_uninit (t, "%H%qD is used uninitialized in this function", + data->stmt); + else + warn_uninit (t, "%H%qD may be used uninitialized in this function", + data->stmt); *walk_subtrees = 0; break; @@ -1478,14 +1489,21 @@ execute_early_warn_uninitialized (void) { block_stmt_iterator bsi; basic_block bb; + struct walk_data data; + + calculate_dominance_info (CDI_POST_DOMINATORS); FOR_EACH_BB (bb) - for (bsi = bsi_start (bb); !bsi_end_p (bsi); bsi_next (&bsi)) - { - tree context = bsi_stmt (bsi); - walk_tree (bsi_stmt_ptr (bsi), warn_uninitialized_var, - context, NULL); - } + { + data.always_executed = dominated_by_p (CDI_POST_DOMINATORS, + single_succ (ENTRY_BLOCK_PTR), bb); + for (bsi = bsi_start (bb); !bsi_end_p (bsi); bsi_next (&bsi)) + { + data.stmt = bsi_stmt (bsi); + walk_tree (bsi_stmt_ptr (bsi), warn_uninitialized_var, + &data, NULL); + } + } return 0; } @@ -1512,8 +1530,10 @@ gate_warn_uninitialized (void) return warn_uninitialized != 0; } -struct tree_opt_pass pass_early_warn_uninitialized = +struct gimple_opt_pass pass_early_warn_uninitialized = { + { + GIMPLE_PASS, NULL, /* name */ gate_warn_uninitialized, /* gate */ execute_early_warn_uninitialized, /* execute */ @@ -1525,12 +1545,14 @@ struct tree_opt_pass pass_early_warn_uninitialized = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - 0, /* todo_flags_finish */ - 0 /* letter */ + 0 /* todo_flags_finish */ + } }; -struct tree_opt_pass pass_late_warn_uninitialized = +struct gimple_opt_pass pass_late_warn_uninitialized = { + { + GIMPLE_PASS, NULL, /* name */ gate_warn_uninitialized, /* gate */ execute_late_warn_uninitialized, /* execute */ @@ -1542,8 +1564,8 @@ struct tree_opt_pass pass_late_warn_uninitialized = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - 0, /* todo_flags_finish */ - 0 /* letter */ + 0 /* todo_flags_finish */ + } }; /* Compute TREE_ADDRESSABLE for local variables. */ @@ -1625,8 +1647,10 @@ execute_update_addresses_taken (void) return 0; } -struct tree_opt_pass pass_update_address_taken = +struct gimple_opt_pass pass_update_address_taken = { + { + GIMPLE_PASS, "addressables", /* name */ NULL, /* gate */ execute_update_addresses_taken, /* execute */ @@ -1638,6 +1662,6 @@ struct tree_opt_pass pass_update_address_taken = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - TODO_update_ssa, /* todo_flags_finish */ - 0 /* letter */ + TODO_update_ssa /* todo_flags_finish */ + } }; diff --git a/gcc/tree-ssanames.c b/gcc/tree-ssanames.c index 956dd00206d..d418bc19b5f 100644 --- a/gcc/tree-ssanames.c +++ b/gcc/tree-ssanames.c @@ -343,8 +343,10 @@ release_dead_ssa_names (void) return 0; } -struct tree_opt_pass pass_release_ssa_names = +struct gimple_opt_pass pass_release_ssa_names = { + { + GIMPLE_PASS, "release_ssa", /* name */ NULL, /* gate */ release_dead_ssa_names, /* execute */ @@ -356,6 +358,6 @@ struct tree_opt_pass pass_release_ssa_names = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - 0, /* todo_flags_finish */ - 0 /* letter */ + 0 /* todo_flags_finish */ + } }; diff --git a/gcc/tree-stdarg.c b/gcc/tree-stdarg.c index 8a275295aa4..54693d11bec 100644 --- a/gcc/tree-stdarg.c +++ b/gcc/tree-stdarg.c @@ -904,8 +904,10 @@ finish: } -struct tree_opt_pass pass_stdarg = +struct gimple_opt_pass pass_stdarg = { + { + GIMPLE_PASS, "stdarg", /* name */ gate_optimize_stdarg, /* gate */ execute_optimize_stdarg, /* execute */ @@ -917,6 +919,6 @@ struct tree_opt_pass pass_stdarg = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - TODO_dump_func, /* todo_flags_finish */ - 0 /* letter */ + TODO_dump_func /* todo_flags_finish */ + } }; diff --git a/gcc/tree-tailcall.c b/gcc/tree-tailcall.c index bd3da886668..a4430ec34e2 100644 --- a/gcc/tree-tailcall.c +++ b/gcc/tree-tailcall.c @@ -1017,8 +1017,10 @@ execute_tail_calls (void) return tree_optimize_tail_calls_1 (true); } -struct tree_opt_pass pass_tail_recursion = +struct gimple_opt_pass pass_tail_recursion = { + { + GIMPLE_PASS, "tailr", /* name */ gate_tail_calls, /* gate */ execute_tail_recursion, /* execute */ @@ -1030,12 +1032,14 @@ struct tree_opt_pass pass_tail_recursion = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - TODO_dump_func | TODO_verify_ssa, /* todo_flags_finish */ - 0 /* letter */ + TODO_dump_func | TODO_verify_ssa /* todo_flags_finish */ + } }; -struct tree_opt_pass pass_tail_calls = +struct gimple_opt_pass pass_tail_calls = { + { + GIMPLE_PASS, "tailc", /* name */ gate_tail_calls, /* gate */ execute_tail_calls, /* execute */ @@ -1047,6 +1051,6 @@ struct tree_opt_pass pass_tail_calls = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - TODO_dump_func | TODO_verify_ssa, /* todo_flags_finish */ - 0 /* letter */ + TODO_dump_func | TODO_verify_ssa /* todo_flags_finish */ + } }; diff --git a/gcc/tree-vect-generic.c b/gcc/tree-vect-generic.c index 76a51e0f090..a4026d6acf5 100644 --- a/gcc/tree-vect-generic.c +++ b/gcc/tree-vect-generic.c @@ -527,8 +527,10 @@ expand_vector_operations (void) return 0; } -struct tree_opt_pass pass_lower_vector = +struct gimple_opt_pass pass_lower_vector = { + { + GIMPLE_PASS, "veclower", /* name */ 0, /* gate */ expand_vector_operations, /* execute */ @@ -541,12 +543,14 @@ struct tree_opt_pass pass_lower_vector = 0, /* properties_destroyed */ 0, /* todo_flags_start */ TODO_dump_func | TODO_ggc_collect - | TODO_verify_stmts, /* todo_flags_finish */ - 0 /* letter */ + | TODO_verify_stmts /* todo_flags_finish */ + } }; -struct tree_opt_pass pass_lower_vector_ssa = +struct gimple_opt_pass pass_lower_vector_ssa = { + { + GIMPLE_PASS, "veclower2", /* name */ gate_expand_vector_operations, /* gate */ expand_vector_operations, /* execute */ @@ -560,8 +564,8 @@ struct tree_opt_pass pass_lower_vector_ssa = 0, /* todo_flags_start */ TODO_dump_func | TODO_update_ssa /* todo_flags_finish */ | TODO_verify_ssa - | TODO_verify_stmts | TODO_verify_flow, - 0 /* letter */ + | TODO_verify_stmts | TODO_verify_flow + } }; #include "gt-tree-vect-generic.h" diff --git a/gcc/tree-vectorizer.c b/gcc/tree-vectorizer.c index 7f631fb6f61..ac3f8437053 100644 --- a/gcc/tree-vectorizer.c +++ b/gcc/tree-vectorizer.c @@ -2767,8 +2767,10 @@ gate_increase_alignment (void) return flag_section_anchors && flag_tree_vectorize; } -struct tree_opt_pass pass_ipa_increase_alignment = +struct simple_ipa_opt_pass pass_ipa_increase_alignment = { + { + SIMPLE_IPA_PASS, "increase_alignment", /* name */ gate_increase_alignment, /* gate */ increase_alignment, /* execute */ @@ -2780,6 +2782,6 @@ struct tree_opt_pass pass_ipa_increase_alignment = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - 0, /* todo_flags_finish */ - 0 /* letter */ + 0 /* todo_flags_finish */ + } }; diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c index eaeaea08902..5944e6a95b2 100644 --- a/gcc/tree-vrp.c +++ b/gcc/tree-vrp.c @@ -6207,8 +6207,10 @@ gate_vrp (void) return flag_tree_vrp != 0; } -struct tree_opt_pass pass_vrp = +struct gimple_opt_pass pass_vrp = { + { + GIMPLE_PASS, "vrp", /* name */ gate_vrp, /* gate */ execute_vrp, /* execute */ @@ -6224,6 +6226,6 @@ struct tree_opt_pass pass_vrp = | TODO_ggc_collect | TODO_verify_ssa | TODO_dump_func - | TODO_update_ssa, /* todo_flags_finish */ - 0 /* letter */ + | TODO_update_ssa /* todo_flags_finish */ + } }; diff --git a/gcc/tree.def b/gcc/tree.def index 4a55ee0aaf9..89c18dfd16c 100644 --- a/gcc/tree.def +++ b/gcc/tree.def @@ -1170,6 +1170,12 @@ DEFTREECODE (VEC_EXTRACT_ODD_EXPR, "vec_extractodd_expr", tcc_binary, 2) DEFTREECODE (VEC_INTERLEAVE_HIGH_EXPR, "vec_interleavehigh_expr", tcc_binary, 2) DEFTREECODE (VEC_INTERLEAVE_LOW_EXPR, "vec_interleavelow_expr", tcc_binary, 2) +/* PREDICT_EXPR. Specify hint for branch prediction. The + PREDICT_EXPR_PREDICTOR specify predictor and PREDICT_EXPR_OUTCOME the + outcome (0 for not taken and 1 for taken). Once the profile is guessed + all conditional branches leading to execution paths executing the + PREDICT_EXPR will get predicted by the specified predictor. */ +DEFTREECODE (PREDICT_EXPR, "predict_expr", tcc_unary, 1) /* Local variables: mode:c diff --git a/gcc/tree.h b/gcc/tree.h index de6654de80f..0cb2fadca75 100644 --- a/gcc/tree.h +++ b/gcc/tree.h @@ -436,6 +436,7 @@ struct gimple_stmt GTY(()) expression. CALL_EXPR_TAILCALL in CALL_EXPR CASE_LOW_SEEN in CASE_LABEL_EXPR + RETURN_EXPR_OUTCOME in RETURN_EXPR static_flag: @@ -1158,6 +1159,11 @@ extern void omp_clause_range_check_failed (const_tree, const char *, int, #define CASE_LOW_SEEN(NODE) \ (CASE_LABEL_EXPR_CHECK (NODE)->base.addressable_flag) +#define PREDICT_EXPR_OUTCOME(NODE) \ + (PREDICT_EXPR_CHECK(NODE)->base.addressable_flag) +#define PREDICT_EXPR_PREDICTOR(NODE) \ + ((enum br_predictor)tree_low_cst (TREE_OPERAND (PREDICT_EXPR_CHECK (NODE), 0), 0)) + /* In a VAR_DECL, nonzero means allocate static storage. In a FUNCTION_DECL, nonzero if function has been defined. In a CONSTRUCTOR, nonzero means allocate static storage. diff --git a/gcc/var-tracking.c b/gcc/var-tracking.c index b8db2692f3e..de996acd963 100644 --- a/gcc/var-tracking.c +++ b/gcc/var-tracking.c @@ -3406,8 +3406,10 @@ gate_handle_var_tracking (void) -struct tree_opt_pass pass_variable_tracking = +struct rtl_opt_pass pass_variable_tracking = { + { + RTL_PASS, "vartrack", /* name */ gate_handle_var_tracking, /* gate */ variable_tracking_main, /* execute */ @@ -3419,7 +3421,7 @@ struct tree_opt_pass pass_variable_tracking = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - TODO_dump_func | TODO_verify_rtl_sharing,/* todo_flags_finish */ - 'V' /* letter */ + TODO_dump_func | TODO_verify_rtl_sharing/* todo_flags_finish */ + } }; diff --git a/gcc/web.c b/gcc/web.c index f45d344d9d5..ada150ed23d 100644 --- a/gcc/web.c +++ b/gcc/web.c @@ -371,8 +371,10 @@ web_main (void) return 0; } -struct tree_opt_pass pass_web = +struct rtl_opt_pass pass_web = { + { + RTL_PASS, "web", /* name */ gate_handle_web, /* gate */ web_main, /* execute */ @@ -385,7 +387,7 @@ struct tree_opt_pass pass_web = 0, /* properties_destroyed */ 0, /* todo_flags_start */ TODO_df_finish | TODO_verify_rtl_sharing | - TODO_dump_func, /* todo_flags_finish */ - 'Z' /* letter */ + TODO_dump_func /* todo_flags_finish */ + } }; diff --git a/intl/ChangeLog b/intl/ChangeLog index c511c1ed228..840752a024c 100644 --- a/intl/ChangeLog +++ b/intl/ChangeLog @@ -1,3 +1,8 @@ +2008-03-17 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> + + * aclocal.m4: Regenerate. + * configure: Likewise. + 2006-09-27 Alan Modra <amodra@bigpond.net.au> * Makefile.in (distclean): Delete config files. diff --git a/libcpp/po/ChangeLog b/libcpp/po/ChangeLog index de8c1781cea..f46ec3ed3e8 100644 --- a/libcpp/po/ChangeLog +++ b/libcpp/po/ChangeLog @@ -1,3 +1,7 @@ +2008-03-18 Joseph S. Myers <joseph@codesourcery.com> + + * es.po, nl.po: Update. + 2008-03-15 Joseph S. Myers <joseph@codesourcery.com> * zh_CN.po: Update. diff --git a/libcpp/po/es.po b/libcpp/po/es.po index b9f7ff64e49..c5fe62b00ed 100644 --- a/libcpp/po/es.po +++ b/libcpp/po/es.po @@ -1,13 +1,14 @@ -# Mensajes en español para cpplib-4.3-b20071109 -# Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. -# Cristian Othón Martínez Vera <cfuga@itam.mx>, 2001, 2002, 2003, 2004, 2005, 2006, 2007. +# Mensajes en español para cpplib-4.3.0 +# Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# This file is distributed under the same license as the gcc package. +# Cristian Othón Martínez Vera <cfuga@itam.mx>, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008. # msgid "" msgstr "" -"Project-Id-Version: cpplib-4.3-b20071109\n" +"Project-Id-Version: cpplib-4.3.0\n" "Report-Msgid-Bugs-To: http://gcc.gnu.org/bugs.html\n" "POT-Creation-Date: 2008-02-01 16:21+0000\n" -"PO-Revision-Date: 2007-11-13 19:48-0600\n" +"PO-Revision-Date: 2008-03-18 12:01-0600\n" "Last-Translator: Cristian Othón Martínez Vera <cfuga@itam.mx>\n" "Language-Team: Spanish <es@li.org>\n" "MIME-Version: 1.0\n" @@ -237,7 +238,7 @@ msgstr "indicador \"%s\" inválido en la línea de la directiva" #: directives.c:868 msgid "unexpected end of file after #line" -msgstr "" +msgstr "fin de fichero inesperado después de #line" #: directives.c:871 #, c-format diff --git a/libcpp/po/nl.po b/libcpp/po/nl.po index 8872f80788b..d8062ad4a93 100644 --- a/libcpp/po/nl.po +++ b/libcpp/po/nl.po @@ -1,13 +1,14 @@ # Dutch messages for cpplib. -# Copyright (C) 1999, 2000, 2002, 2003, 2005, 2007 Free Software Foundation, Inc. -# Tim Van Holder <tim.van.holder@telenet.be>, 2007. +# Copyright (C) 1999, 2000, 2002, 2003, 2005, 2007, 2008 Free Software Foundation, Inc. +# This file is distributed under the same license as the gcc package. +# Tim Van Holder <tim.van.holder@telenet.be>, 2008. # msgid "" msgstr "" -"Project-Id-Version: cpplib 4.3-b20071109\n" +"Project-Id-Version: cpplib 4.3.0\n" "Report-Msgid-Bugs-To: http://gcc.gnu.org/bugs.html\n" "POT-Creation-Date: 2008-02-01 16:21+0000\n" -"PO-Revision-Date: 2007-11-10 17:28+0100\n" +"PO-Revision-Date: 2008-03-18 20:16+0100\n" "Last-Translator: Tim Van Holder <tim.van.holder@telenet.be>\n" "Language-Team: Dutch <vertaling@vrijschrift.org>\n" "MIME-Version: 1.0\n" @@ -243,7 +244,7 @@ msgstr "ongeldige vlag \"%s\" in #line commando" #: directives.c:868 msgid "unexpected end of file after #line" -msgstr "" +msgstr "onverwacht einde van bestand na #line" #: directives.c:871 #, c-format diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog index 086e292df0a..ee0aae8ceea 100644 --- a/libgfortran/ChangeLog +++ b/libgfortran/ChangeLog @@ -1,3 +1,68 @@ +2008-03-19 Jerry DeLisle <jvdelisle@gcc.gnu.org> + + PR libfortran/35627 + * io/list_read.c (free_line): Clear the line buffer enable flag and + reset the index into line_buffer, aka item_count. + (next_char): Cleanup whitespace. + (read_logical): Use unget_char to assure that the first character of the + bad logical is saved in case it is part of an object name. Remove the + clearing of index and flag that is now in free_line. + (read_real): Likewise. + +2008-03-19 Thomas Koenig <tkoenig@gcc.gnu.org> + + PR libfortran/32972 + * runtime/in_pack_generic.c (internal_pack): Fix typo in + last commit. + +2008-03-19 Thomas Koenig <tkoenig@gcc.gnu.org> + + PR libfortran/32972 + * Makefile.am (in_pack_c): Add in_pack_i1.c, in_pack_i2.c, + in_pack_r4.c, in_pack_r8.c, in_pack_r10.c and in_pack_r16.c. + (in_unpack_c): Add in_unpack_i1.c, in_unpack_i2.c, + in_unpack_r4.c, in_unpack_r8.c, in_unpack_r10.c and + in_unpack_r16.c. + * Makefile.in: Regenerate. + * libgfortran.h: Add prototypes for internal_pack_1, + internal_pack_2, internal_pack_16, internal_pack_r4, + internal_pack_r8, internal_pack_r10, internal_pack_r16, + internal_pack_c10 and internal_pack_c16. Add prototypes for + internal_unpack_1, internal_unpack_2, internal_unpack_16, + internal_unpack_r4, internal_unpack_r8, internal_unpack_r10, + internal_unpack_r16, internal_unpack_c10 and + internal_unpack_c16. + * runtime/in_pack_generic.c (internal_pack): Use sizeof instead + of hardwired sizes. + Add calls to internal_pack_1, internal_pack_2, + internal_pack_16, internal_pack_r4, internal_pack_r8, + internal_pack_r10, internal_pack_r16, internal_pack_c10 and + internal_pack_c16. + * runtime/in_unpack_generic.c (internal_unpack): Use sizeof + instead of hardwired sizes. + Add calls to internal_unpack_1, internal_unpack_2, + internal_unpack_16, internal_unpack_r4, internal_unpack_r8, + internal_unpack_r10, internal_unpack_r16, internal_unpack_c10 + and internal_unpack_c16. + * generated/in_pack_r4.c: New file. + * generated/in_pack_i2.c: New file. + * generated/in_unpack_i1.c: New file. + * generated/in_pack_r10.c: New file. + * generated/in_unpack_r4.c: New file. + * generated/in_unpack_i2.c: New file. + * generated/in_unpack_r16.c: New file. + * generated/in_pack_r8.c: New file. + * generated/in_unpack_r10.c: New file. + * generated/in_unpack_r8.c: New file. + * generated/in_pack_r16.c: New file. + * generated/in_pack_i1.c: New file. + +2008-03-17 Jerry DeLisle <jvdelisle@gcc.gnu.org> + + PR libfortran/35617 + * io/list_read.c (eat_separator): If next character after eatline is '!' + then eatline again. + 2008-03-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> * aclocal.m4: Regenerate. diff --git a/libgfortran/Makefile.am b/libgfortran/Makefile.am index b601f4f3c9a..bcf9ffa6510 100644 --- a/libgfortran/Makefile.am +++ b/libgfortran/Makefile.am @@ -380,18 +380,30 @@ $(srcdir)/generated/cshift1_8.c \ $(srcdir)/generated/cshift1_16.c in_pack_c = \ +$(srcdir)/generated/in_pack_i1.c \ +$(srcdir)/generated/in_pack_i2.c \ $(srcdir)/generated/in_pack_i4.c \ $(srcdir)/generated/in_pack_i8.c \ $(srcdir)/generated/in_pack_i16.c \ +$(srcdir)/generated/in_pack_r4.c \ +$(srcdir)/generated/in_pack_r8.c \ +$(srcdir)/generated/in_pack_r10.c \ +$(srcdir)/generated/in_pack_r16.c \ $(srcdir)/generated/in_pack_c4.c \ $(srcdir)/generated/in_pack_c8.c \ $(srcdir)/generated/in_pack_c10.c \ $(srcdir)/generated/in_pack_c16.c in_unpack_c = \ +$(srcdir)/generated/in_unpack_i1.c \ +$(srcdir)/generated/in_unpack_i2.c \ $(srcdir)/generated/in_unpack_i4.c \ $(srcdir)/generated/in_unpack_i8.c \ $(srcdir)/generated/in_unpack_i16.c \ +$(srcdir)/generated/in_unpack_r4.c \ +$(srcdir)/generated/in_unpack_r8.c \ +$(srcdir)/generated/in_unpack_r10.c \ +$(srcdir)/generated/in_unpack_r16.c \ $(srcdir)/generated/in_unpack_c4.c \ $(srcdir)/generated/in_unpack_c8.c \ $(srcdir)/generated/in_unpack_c10.c \ diff --git a/libgfortran/Makefile.in b/libgfortran/Makefile.in index 4ea5108e275..2d1ce0d7c1b 100644 --- a/libgfortran/Makefile.in +++ b/libgfortran/Makefile.in @@ -285,16 +285,28 @@ am__libgfortran_la_SOURCES_DIST = runtime/backtrace.c \ $(srcdir)/generated/reshape_c8.c \ $(srcdir)/generated/reshape_c10.c \ $(srcdir)/generated/reshape_c16.c \ + $(srcdir)/generated/in_pack_i1.c \ + $(srcdir)/generated/in_pack_i2.c \ $(srcdir)/generated/in_pack_i4.c \ $(srcdir)/generated/in_pack_i8.c \ $(srcdir)/generated/in_pack_i16.c \ + $(srcdir)/generated/in_pack_r4.c \ + $(srcdir)/generated/in_pack_r8.c \ + $(srcdir)/generated/in_pack_r10.c \ + $(srcdir)/generated/in_pack_r16.c \ $(srcdir)/generated/in_pack_c4.c \ $(srcdir)/generated/in_pack_c8.c \ $(srcdir)/generated/in_pack_c10.c \ $(srcdir)/generated/in_pack_c16.c \ + $(srcdir)/generated/in_unpack_i1.c \ + $(srcdir)/generated/in_unpack_i2.c \ $(srcdir)/generated/in_unpack_i4.c \ $(srcdir)/generated/in_unpack_i8.c \ $(srcdir)/generated/in_unpack_i16.c \ + $(srcdir)/generated/in_unpack_r4.c \ + $(srcdir)/generated/in_unpack_r8.c \ + $(srcdir)/generated/in_unpack_r10.c \ + $(srcdir)/generated/in_unpack_r16.c \ $(srcdir)/generated/in_unpack_c4.c \ $(srcdir)/generated/in_unpack_c8.c \ $(srcdir)/generated/in_unpack_c10.c \ @@ -592,9 +604,13 @@ am__objects_19 = cshift1_4.lo cshift1_8.lo cshift1_16.lo am__objects_20 = reshape_i4.lo reshape_i8.lo reshape_i16.lo \ reshape_r4.lo reshape_r8.lo reshape_r10.lo reshape_r16.lo \ reshape_c4.lo reshape_c8.lo reshape_c10.lo reshape_c16.lo -am__objects_21 = in_pack_i4.lo in_pack_i8.lo in_pack_i16.lo \ - in_pack_c4.lo in_pack_c8.lo in_pack_c10.lo in_pack_c16.lo -am__objects_22 = in_unpack_i4.lo in_unpack_i8.lo in_unpack_i16.lo \ +am__objects_21 = in_pack_i1.lo in_pack_i2.lo in_pack_i4.lo \ + in_pack_i8.lo in_pack_i16.lo in_pack_r4.lo in_pack_r8.lo \ + in_pack_r10.lo in_pack_r16.lo in_pack_c4.lo in_pack_c8.lo \ + in_pack_c10.lo in_pack_c16.lo +am__objects_22 = in_unpack_i1.lo in_unpack_i2.lo in_unpack_i4.lo \ + in_unpack_i8.lo in_unpack_i16.lo in_unpack_r4.lo \ + in_unpack_r8.lo in_unpack_r10.lo in_unpack_r16.lo \ in_unpack_c4.lo in_unpack_c8.lo in_unpack_c10.lo \ in_unpack_c16.lo am__objects_23 = exponent_r4.lo exponent_r8.lo exponent_r10.lo \ @@ -1218,18 +1234,30 @@ $(srcdir)/generated/cshift1_8.c \ $(srcdir)/generated/cshift1_16.c in_pack_c = \ +$(srcdir)/generated/in_pack_i1.c \ +$(srcdir)/generated/in_pack_i2.c \ $(srcdir)/generated/in_pack_i4.c \ $(srcdir)/generated/in_pack_i8.c \ $(srcdir)/generated/in_pack_i16.c \ +$(srcdir)/generated/in_pack_r4.c \ +$(srcdir)/generated/in_pack_r8.c \ +$(srcdir)/generated/in_pack_r10.c \ +$(srcdir)/generated/in_pack_r16.c \ $(srcdir)/generated/in_pack_c4.c \ $(srcdir)/generated/in_pack_c8.c \ $(srcdir)/generated/in_pack_c10.c \ $(srcdir)/generated/in_pack_c16.c in_unpack_c = \ +$(srcdir)/generated/in_unpack_i1.c \ +$(srcdir)/generated/in_unpack_i2.c \ $(srcdir)/generated/in_unpack_i4.c \ $(srcdir)/generated/in_unpack_i8.c \ $(srcdir)/generated/in_unpack_i16.c \ +$(srcdir)/generated/in_unpack_r4.c \ +$(srcdir)/generated/in_unpack_r8.c \ +$(srcdir)/generated/in_unpack_r10.c \ +$(srcdir)/generated/in_unpack_r16.c \ $(srcdir)/generated/in_unpack_c4.c \ $(srcdir)/generated/in_unpack_c8.c \ $(srcdir)/generated/in_unpack_c10.c \ @@ -1689,17 +1717,29 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/in_pack_c4.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/in_pack_c8.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/in_pack_generic.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/in_pack_i1.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/in_pack_i16.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/in_pack_i2.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/in_pack_i4.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/in_pack_i8.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/in_pack_r10.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/in_pack_r16.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/in_pack_r4.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/in_pack_r8.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/in_unpack_c10.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/in_unpack_c16.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/in_unpack_c4.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/in_unpack_c8.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/in_unpack_generic.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/in_unpack_i1.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/in_unpack_i16.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/in_unpack_i2.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/in_unpack_i4.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/in_unpack_i8.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/in_unpack_r10.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/in_unpack_r16.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/in_unpack_r4.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/in_unpack_r8.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/inquire.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/intrinsics.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ishftc.Plo@am__quote@ @@ -4026,6 +4066,20 @@ reshape_c16.lo: $(srcdir)/generated/reshape_c16.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o reshape_c16.lo `test -f '$(srcdir)/generated/reshape_c16.c' || echo '$(srcdir)/'`$(srcdir)/generated/reshape_c16.c +in_pack_i1.lo: $(srcdir)/generated/in_pack_i1.c +@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT in_pack_i1.lo -MD -MP -MF "$(DEPDIR)/in_pack_i1.Tpo" -c -o in_pack_i1.lo `test -f '$(srcdir)/generated/in_pack_i1.c' || echo '$(srcdir)/'`$(srcdir)/generated/in_pack_i1.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/in_pack_i1.Tpo" "$(DEPDIR)/in_pack_i1.Plo"; else rm -f "$(DEPDIR)/in_pack_i1.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/generated/in_pack_i1.c' object='in_pack_i1.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o in_pack_i1.lo `test -f '$(srcdir)/generated/in_pack_i1.c' || echo '$(srcdir)/'`$(srcdir)/generated/in_pack_i1.c + +in_pack_i2.lo: $(srcdir)/generated/in_pack_i2.c +@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT in_pack_i2.lo -MD -MP -MF "$(DEPDIR)/in_pack_i2.Tpo" -c -o in_pack_i2.lo `test -f '$(srcdir)/generated/in_pack_i2.c' || echo '$(srcdir)/'`$(srcdir)/generated/in_pack_i2.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/in_pack_i2.Tpo" "$(DEPDIR)/in_pack_i2.Plo"; else rm -f "$(DEPDIR)/in_pack_i2.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/generated/in_pack_i2.c' object='in_pack_i2.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o in_pack_i2.lo `test -f '$(srcdir)/generated/in_pack_i2.c' || echo '$(srcdir)/'`$(srcdir)/generated/in_pack_i2.c + in_pack_i4.lo: $(srcdir)/generated/in_pack_i4.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT in_pack_i4.lo -MD -MP -MF "$(DEPDIR)/in_pack_i4.Tpo" -c -o in_pack_i4.lo `test -f '$(srcdir)/generated/in_pack_i4.c' || echo '$(srcdir)/'`$(srcdir)/generated/in_pack_i4.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/in_pack_i4.Tpo" "$(DEPDIR)/in_pack_i4.Plo"; else rm -f "$(DEPDIR)/in_pack_i4.Tpo"; exit 1; fi @@ -4047,6 +4101,34 @@ in_pack_i16.lo: $(srcdir)/generated/in_pack_i16.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o in_pack_i16.lo `test -f '$(srcdir)/generated/in_pack_i16.c' || echo '$(srcdir)/'`$(srcdir)/generated/in_pack_i16.c +in_pack_r4.lo: $(srcdir)/generated/in_pack_r4.c +@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT in_pack_r4.lo -MD -MP -MF "$(DEPDIR)/in_pack_r4.Tpo" -c -o in_pack_r4.lo `test -f '$(srcdir)/generated/in_pack_r4.c' || echo '$(srcdir)/'`$(srcdir)/generated/in_pack_r4.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/in_pack_r4.Tpo" "$(DEPDIR)/in_pack_r4.Plo"; else rm -f "$(DEPDIR)/in_pack_r4.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/generated/in_pack_r4.c' object='in_pack_r4.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o in_pack_r4.lo `test -f '$(srcdir)/generated/in_pack_r4.c' || echo '$(srcdir)/'`$(srcdir)/generated/in_pack_r4.c + +in_pack_r8.lo: $(srcdir)/generated/in_pack_r8.c +@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT in_pack_r8.lo -MD -MP -MF "$(DEPDIR)/in_pack_r8.Tpo" -c -o in_pack_r8.lo `test -f '$(srcdir)/generated/in_pack_r8.c' || echo '$(srcdir)/'`$(srcdir)/generated/in_pack_r8.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/in_pack_r8.Tpo" "$(DEPDIR)/in_pack_r8.Plo"; else rm -f "$(DEPDIR)/in_pack_r8.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/generated/in_pack_r8.c' object='in_pack_r8.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o in_pack_r8.lo `test -f '$(srcdir)/generated/in_pack_r8.c' || echo '$(srcdir)/'`$(srcdir)/generated/in_pack_r8.c + +in_pack_r10.lo: $(srcdir)/generated/in_pack_r10.c +@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT in_pack_r10.lo -MD -MP -MF "$(DEPDIR)/in_pack_r10.Tpo" -c -o in_pack_r10.lo `test -f '$(srcdir)/generated/in_pack_r10.c' || echo '$(srcdir)/'`$(srcdir)/generated/in_pack_r10.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/in_pack_r10.Tpo" "$(DEPDIR)/in_pack_r10.Plo"; else rm -f "$(DEPDIR)/in_pack_r10.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/generated/in_pack_r10.c' object='in_pack_r10.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o in_pack_r10.lo `test -f '$(srcdir)/generated/in_pack_r10.c' || echo '$(srcdir)/'`$(srcdir)/generated/in_pack_r10.c + +in_pack_r16.lo: $(srcdir)/generated/in_pack_r16.c +@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT in_pack_r16.lo -MD -MP -MF "$(DEPDIR)/in_pack_r16.Tpo" -c -o in_pack_r16.lo `test -f '$(srcdir)/generated/in_pack_r16.c' || echo '$(srcdir)/'`$(srcdir)/generated/in_pack_r16.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/in_pack_r16.Tpo" "$(DEPDIR)/in_pack_r16.Plo"; else rm -f "$(DEPDIR)/in_pack_r16.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/generated/in_pack_r16.c' object='in_pack_r16.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o in_pack_r16.lo `test -f '$(srcdir)/generated/in_pack_r16.c' || echo '$(srcdir)/'`$(srcdir)/generated/in_pack_r16.c + in_pack_c4.lo: $(srcdir)/generated/in_pack_c4.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT in_pack_c4.lo -MD -MP -MF "$(DEPDIR)/in_pack_c4.Tpo" -c -o in_pack_c4.lo `test -f '$(srcdir)/generated/in_pack_c4.c' || echo '$(srcdir)/'`$(srcdir)/generated/in_pack_c4.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/in_pack_c4.Tpo" "$(DEPDIR)/in_pack_c4.Plo"; else rm -f "$(DEPDIR)/in_pack_c4.Tpo"; exit 1; fi @@ -4075,6 +4157,20 @@ in_pack_c16.lo: $(srcdir)/generated/in_pack_c16.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o in_pack_c16.lo `test -f '$(srcdir)/generated/in_pack_c16.c' || echo '$(srcdir)/'`$(srcdir)/generated/in_pack_c16.c +in_unpack_i1.lo: $(srcdir)/generated/in_unpack_i1.c +@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT in_unpack_i1.lo -MD -MP -MF "$(DEPDIR)/in_unpack_i1.Tpo" -c -o in_unpack_i1.lo `test -f '$(srcdir)/generated/in_unpack_i1.c' || echo '$(srcdir)/'`$(srcdir)/generated/in_unpack_i1.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/in_unpack_i1.Tpo" "$(DEPDIR)/in_unpack_i1.Plo"; else rm -f "$(DEPDIR)/in_unpack_i1.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/generated/in_unpack_i1.c' object='in_unpack_i1.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o in_unpack_i1.lo `test -f '$(srcdir)/generated/in_unpack_i1.c' || echo '$(srcdir)/'`$(srcdir)/generated/in_unpack_i1.c + +in_unpack_i2.lo: $(srcdir)/generated/in_unpack_i2.c +@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT in_unpack_i2.lo -MD -MP -MF "$(DEPDIR)/in_unpack_i2.Tpo" -c -o in_unpack_i2.lo `test -f '$(srcdir)/generated/in_unpack_i2.c' || echo '$(srcdir)/'`$(srcdir)/generated/in_unpack_i2.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/in_unpack_i2.Tpo" "$(DEPDIR)/in_unpack_i2.Plo"; else rm -f "$(DEPDIR)/in_unpack_i2.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/generated/in_unpack_i2.c' object='in_unpack_i2.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o in_unpack_i2.lo `test -f '$(srcdir)/generated/in_unpack_i2.c' || echo '$(srcdir)/'`$(srcdir)/generated/in_unpack_i2.c + in_unpack_i4.lo: $(srcdir)/generated/in_unpack_i4.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT in_unpack_i4.lo -MD -MP -MF "$(DEPDIR)/in_unpack_i4.Tpo" -c -o in_unpack_i4.lo `test -f '$(srcdir)/generated/in_unpack_i4.c' || echo '$(srcdir)/'`$(srcdir)/generated/in_unpack_i4.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/in_unpack_i4.Tpo" "$(DEPDIR)/in_unpack_i4.Plo"; else rm -f "$(DEPDIR)/in_unpack_i4.Tpo"; exit 1; fi @@ -4096,6 +4192,34 @@ in_unpack_i16.lo: $(srcdir)/generated/in_unpack_i16.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o in_unpack_i16.lo `test -f '$(srcdir)/generated/in_unpack_i16.c' || echo '$(srcdir)/'`$(srcdir)/generated/in_unpack_i16.c +in_unpack_r4.lo: $(srcdir)/generated/in_unpack_r4.c +@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT in_unpack_r4.lo -MD -MP -MF "$(DEPDIR)/in_unpack_r4.Tpo" -c -o in_unpack_r4.lo `test -f '$(srcdir)/generated/in_unpack_r4.c' || echo '$(srcdir)/'`$(srcdir)/generated/in_unpack_r4.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/in_unpack_r4.Tpo" "$(DEPDIR)/in_unpack_r4.Plo"; else rm -f "$(DEPDIR)/in_unpack_r4.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/generated/in_unpack_r4.c' object='in_unpack_r4.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o in_unpack_r4.lo `test -f '$(srcdir)/generated/in_unpack_r4.c' || echo '$(srcdir)/'`$(srcdir)/generated/in_unpack_r4.c + +in_unpack_r8.lo: $(srcdir)/generated/in_unpack_r8.c +@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT in_unpack_r8.lo -MD -MP -MF "$(DEPDIR)/in_unpack_r8.Tpo" -c -o in_unpack_r8.lo `test -f '$(srcdir)/generated/in_unpack_r8.c' || echo '$(srcdir)/'`$(srcdir)/generated/in_unpack_r8.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/in_unpack_r8.Tpo" "$(DEPDIR)/in_unpack_r8.Plo"; else rm -f "$(DEPDIR)/in_unpack_r8.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/generated/in_unpack_r8.c' object='in_unpack_r8.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o in_unpack_r8.lo `test -f '$(srcdir)/generated/in_unpack_r8.c' || echo '$(srcdir)/'`$(srcdir)/generated/in_unpack_r8.c + +in_unpack_r10.lo: $(srcdir)/generated/in_unpack_r10.c +@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT in_unpack_r10.lo -MD -MP -MF "$(DEPDIR)/in_unpack_r10.Tpo" -c -o in_unpack_r10.lo `test -f '$(srcdir)/generated/in_unpack_r10.c' || echo '$(srcdir)/'`$(srcdir)/generated/in_unpack_r10.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/in_unpack_r10.Tpo" "$(DEPDIR)/in_unpack_r10.Plo"; else rm -f "$(DEPDIR)/in_unpack_r10.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/generated/in_unpack_r10.c' object='in_unpack_r10.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o in_unpack_r10.lo `test -f '$(srcdir)/generated/in_unpack_r10.c' || echo '$(srcdir)/'`$(srcdir)/generated/in_unpack_r10.c + +in_unpack_r16.lo: $(srcdir)/generated/in_unpack_r16.c +@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT in_unpack_r16.lo -MD -MP -MF "$(DEPDIR)/in_unpack_r16.Tpo" -c -o in_unpack_r16.lo `test -f '$(srcdir)/generated/in_unpack_r16.c' || echo '$(srcdir)/'`$(srcdir)/generated/in_unpack_r16.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/in_unpack_r16.Tpo" "$(DEPDIR)/in_unpack_r16.Plo"; else rm -f "$(DEPDIR)/in_unpack_r16.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/generated/in_unpack_r16.c' object='in_unpack_r16.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o in_unpack_r16.lo `test -f '$(srcdir)/generated/in_unpack_r16.c' || echo '$(srcdir)/'`$(srcdir)/generated/in_unpack_r16.c + in_unpack_c4.lo: $(srcdir)/generated/in_unpack_c4.c @am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT in_unpack_c4.lo -MD -MP -MF "$(DEPDIR)/in_unpack_c4.Tpo" -c -o in_unpack_c4.lo `test -f '$(srcdir)/generated/in_unpack_c4.c' || echo '$(srcdir)/'`$(srcdir)/generated/in_unpack_c4.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/in_unpack_c4.Tpo" "$(DEPDIR)/in_unpack_c4.Plo"; else rm -f "$(DEPDIR)/in_unpack_c4.Tpo"; exit 1; fi diff --git a/libgfortran/generated/in_pack_i1.c b/libgfortran/generated/in_pack_i1.c new file mode 100644 index 00000000000..b5be016cf37 --- /dev/null +++ b/libgfortran/generated/in_pack_i1.c @@ -0,0 +1,124 @@ +/* Helper function for repacking arrays. + Copyright 2003, 2006, 2007 Free Software Foundation, Inc. + Contributed by Paul Brook <paul@nowt.org> + +This file is part of the GNU Fortran 95 runtime library (libgfortran). + +Libgfortran is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public +License as published by the Free Software Foundation; either +version 2 of the License, or (at your option) any later version. + +In addition to the permissions in the GNU General Public License, the +Free Software Foundation gives you unlimited permission to link the +compiled version of this file into combinations with other programs, +and to distribute those combinations without any restriction coming +from the use of this file. (The General Public License restrictions +do apply in other respects; for example, they cover modification of +the file, and distribution when not linked into a combine +executable.) + +Libgfortran is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public +License along with libgfortran; see the file COPYING. If not, +write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ + +#include "libgfortran.h" +#include <stdlib.h> +#include <assert.h> + + +#if defined (HAVE_GFC_INTEGER_1) + +/* Allocates a block of memory with internal_malloc if the array needs + repacking. */ + +GFC_INTEGER_1 * +internal_pack_1 (gfc_array_i1 * source) +{ + index_type count[GFC_MAX_DIMENSIONS]; + index_type extent[GFC_MAX_DIMENSIONS]; + index_type stride[GFC_MAX_DIMENSIONS]; + index_type stride0; + index_type dim; + index_type ssize; + const GFC_INTEGER_1 *src; + GFC_INTEGER_1 *dest; + GFC_INTEGER_1 *destptr; + int n; + int packed; + + /* TODO: Investigate how we can figure out if this is a temporary + since the stride=0 thing has been removed from the frontend. */ + + dim = GFC_DESCRIPTOR_RANK (source); + ssize = 1; + packed = 1; + for (n = 0; n < dim; n++) + { + count[n] = 0; + stride[n] = source->dim[n].stride; + extent[n] = source->dim[n].ubound + 1 - source->dim[n].lbound; + if (extent[n] <= 0) + { + /* Do nothing. */ + packed = 1; + break; + } + + if (ssize != stride[n]) + packed = 0; + + ssize *= extent[n]; + } + + if (packed) + return source->data; + + /* Allocate storage for the destination. */ + destptr = (GFC_INTEGER_1 *)internal_malloc_size (ssize * sizeof (GFC_INTEGER_1)); + dest = destptr; + src = source->data; + stride0 = stride[0]; + + + while (src) + { + /* Copy the data. */ + *(dest++) = *src; + /* Advance to the next element. */ + src += stride0; + count[0]++; + /* Advance to the next source element. */ + n = 0; + while (count[n] == extent[n]) + { + /* When we get to the end of a dimension, reset it and increment + the next dimension. */ + count[n] = 0; + /* We could precalculate these products, but this is a less + frequently used path so probably not worth it. */ + src -= stride[n] * extent[n]; + n++; + if (n == dim) + { + src = NULL; + break; + } + else + { + count[n]++; + src += stride[n]; + } + } + } + return destptr; +} + +#endif + diff --git a/libgfortran/generated/in_pack_i2.c b/libgfortran/generated/in_pack_i2.c new file mode 100644 index 00000000000..240409a357e --- /dev/null +++ b/libgfortran/generated/in_pack_i2.c @@ -0,0 +1,124 @@ +/* Helper function for repacking arrays. + Copyright 2003, 2006, 2007 Free Software Foundation, Inc. + Contributed by Paul Brook <paul@nowt.org> + +This file is part of the GNU Fortran 95 runtime library (libgfortran). + +Libgfortran is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public +License as published by the Free Software Foundation; either +version 2 of the License, or (at your option) any later version. + +In addition to the permissions in the GNU General Public License, the +Free Software Foundation gives you unlimited permission to link the +compiled version of this file into combinations with other programs, +and to distribute those combinations without any restriction coming +from the use of this file. (The General Public License restrictions +do apply in other respects; for example, they cover modification of +the file, and distribution when not linked into a combine +executable.) + +Libgfortran is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public +License along with libgfortran; see the file COPYING. If not, +write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ + +#include "libgfortran.h" +#include <stdlib.h> +#include <assert.h> + + +#if defined (HAVE_GFC_INTEGER_2) + +/* Allocates a block of memory with internal_malloc if the array needs + repacking. */ + +GFC_INTEGER_2 * +internal_pack_2 (gfc_array_i2 * source) +{ + index_type count[GFC_MAX_DIMENSIONS]; + index_type extent[GFC_MAX_DIMENSIONS]; + index_type stride[GFC_MAX_DIMENSIONS]; + index_type stride0; + index_type dim; + index_type ssize; + const GFC_INTEGER_2 *src; + GFC_INTEGER_2 *dest; + GFC_INTEGER_2 *destptr; + int n; + int packed; + + /* TODO: Investigate how we can figure out if this is a temporary + since the stride=0 thing has been removed from the frontend. */ + + dim = GFC_DESCRIPTOR_RANK (source); + ssize = 1; + packed = 1; + for (n = 0; n < dim; n++) + { + count[n] = 0; + stride[n] = source->dim[n].stride; + extent[n] = source->dim[n].ubound + 1 - source->dim[n].lbound; + if (extent[n] <= 0) + { + /* Do nothing. */ + packed = 1; + break; + } + + if (ssize != stride[n]) + packed = 0; + + ssize *= extent[n]; + } + + if (packed) + return source->data; + + /* Allocate storage for the destination. */ + destptr = (GFC_INTEGER_2 *)internal_malloc_size (ssize * sizeof (GFC_INTEGER_2)); + dest = destptr; + src = source->data; + stride0 = stride[0]; + + + while (src) + { + /* Copy the data. */ + *(dest++) = *src; + /* Advance to the next element. */ + src += stride0; + count[0]++; + /* Advance to the next source element. */ + n = 0; + while (count[n] == extent[n]) + { + /* When we get to the end of a dimension, reset it and increment + the next dimension. */ + count[n] = 0; + /* We could precalculate these products, but this is a less + frequently used path so probably not worth it. */ + src -= stride[n] * extent[n]; + n++; + if (n == dim) + { + src = NULL; + break; + } + else + { + count[n]++; + src += stride[n]; + } + } + } + return destptr; +} + +#endif + diff --git a/libgfortran/generated/in_pack_r10.c b/libgfortran/generated/in_pack_r10.c new file mode 100644 index 00000000000..892c6bb9dc5 --- /dev/null +++ b/libgfortran/generated/in_pack_r10.c @@ -0,0 +1,124 @@ +/* Helper function for repacking arrays. + Copyright 2003, 2006, 2007 Free Software Foundation, Inc. + Contributed by Paul Brook <paul@nowt.org> + +This file is part of the GNU Fortran 95 runtime library (libgfortran). + +Libgfortran is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public +License as published by the Free Software Foundation; either +version 2 of the License, or (at your option) any later version. + +In addition to the permissions in the GNU General Public License, the +Free Software Foundation gives you unlimited permission to link the +compiled version of this file into combinations with other programs, +and to distribute those combinations without any restriction coming +from the use of this file. (The General Public License restrictions +do apply in other respects; for example, they cover modification of +the file, and distribution when not linked into a combine +executable.) + +Libgfortran is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public +License along with libgfortran; see the file COPYING. If not, +write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ + +#include "libgfortran.h" +#include <stdlib.h> +#include <assert.h> + + +#if defined (HAVE_GFC_REAL_10) + +/* Allocates a block of memory with internal_malloc if the array needs + repacking. */ + +GFC_REAL_10 * +internal_pack_r10 (gfc_array_r10 * source) +{ + index_type count[GFC_MAX_DIMENSIONS]; + index_type extent[GFC_MAX_DIMENSIONS]; + index_type stride[GFC_MAX_DIMENSIONS]; + index_type stride0; + index_type dim; + index_type ssize; + const GFC_REAL_10 *src; + GFC_REAL_10 *dest; + GFC_REAL_10 *destptr; + int n; + int packed; + + /* TODO: Investigate how we can figure out if this is a temporary + since the stride=0 thing has been removed from the frontend. */ + + dim = GFC_DESCRIPTOR_RANK (source); + ssize = 1; + packed = 1; + for (n = 0; n < dim; n++) + { + count[n] = 0; + stride[n] = source->dim[n].stride; + extent[n] = source->dim[n].ubound + 1 - source->dim[n].lbound; + if (extent[n] <= 0) + { + /* Do nothing. */ + packed = 1; + break; + } + + if (ssize != stride[n]) + packed = 0; + + ssize *= extent[n]; + } + + if (packed) + return source->data; + + /* Allocate storage for the destination. */ + destptr = (GFC_REAL_10 *)internal_malloc_size (ssize * sizeof (GFC_REAL_10)); + dest = destptr; + src = source->data; + stride0 = stride[0]; + + + while (src) + { + /* Copy the data. */ + *(dest++) = *src; + /* Advance to the next element. */ + src += stride0; + count[0]++; + /* Advance to the next source element. */ + n = 0; + while (count[n] == extent[n]) + { + /* When we get to the end of a dimension, reset it and increment + the next dimension. */ + count[n] = 0; + /* We could precalculate these products, but this is a less + frequently used path so probably not worth it. */ + src -= stride[n] * extent[n]; + n++; + if (n == dim) + { + src = NULL; + break; + } + else + { + count[n]++; + src += stride[n]; + } + } + } + return destptr; +} + +#endif + diff --git a/libgfortran/generated/in_pack_r16.c b/libgfortran/generated/in_pack_r16.c new file mode 100644 index 00000000000..15ab585050f --- /dev/null +++ b/libgfortran/generated/in_pack_r16.c @@ -0,0 +1,124 @@ +/* Helper function for repacking arrays. + Copyright 2003, 2006, 2007 Free Software Foundation, Inc. + Contributed by Paul Brook <paul@nowt.org> + +This file is part of the GNU Fortran 95 runtime library (libgfortran). + +Libgfortran is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public +License as published by the Free Software Foundation; either +version 2 of the License, or (at your option) any later version. + +In addition to the permissions in the GNU General Public License, the +Free Software Foundation gives you unlimited permission to link the +compiled version of this file into combinations with other programs, +and to distribute those combinations without any restriction coming +from the use of this file. (The General Public License restrictions +do apply in other respects; for example, they cover modification of +the file, and distribution when not linked into a combine +executable.) + +Libgfortran is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public +License along with libgfortran; see the file COPYING. If not, +write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ + +#include "libgfortran.h" +#include <stdlib.h> +#include <assert.h> + + +#if defined (HAVE_GFC_REAL_16) + +/* Allocates a block of memory with internal_malloc if the array needs + repacking. */ + +GFC_REAL_16 * +internal_pack_r16 (gfc_array_r16 * source) +{ + index_type count[GFC_MAX_DIMENSIONS]; + index_type extent[GFC_MAX_DIMENSIONS]; + index_type stride[GFC_MAX_DIMENSIONS]; + index_type stride0; + index_type dim; + index_type ssize; + const GFC_REAL_16 *src; + GFC_REAL_16 *dest; + GFC_REAL_16 *destptr; + int n; + int packed; + + /* TODO: Investigate how we can figure out if this is a temporary + since the stride=0 thing has been removed from the frontend. */ + + dim = GFC_DESCRIPTOR_RANK (source); + ssize = 1; + packed = 1; + for (n = 0; n < dim; n++) + { + count[n] = 0; + stride[n] = source->dim[n].stride; + extent[n] = source->dim[n].ubound + 1 - source->dim[n].lbound; + if (extent[n] <= 0) + { + /* Do nothing. */ + packed = 1; + break; + } + + if (ssize != stride[n]) + packed = 0; + + ssize *= extent[n]; + } + + if (packed) + return source->data; + + /* Allocate storage for the destination. */ + destptr = (GFC_REAL_16 *)internal_malloc_size (ssize * sizeof (GFC_REAL_16)); + dest = destptr; + src = source->data; + stride0 = stride[0]; + + + while (src) + { + /* Copy the data. */ + *(dest++) = *src; + /* Advance to the next element. */ + src += stride0; + count[0]++; + /* Advance to the next source element. */ + n = 0; + while (count[n] == extent[n]) + { + /* When we get to the end of a dimension, reset it and increment + the next dimension. */ + count[n] = 0; + /* We could precalculate these products, but this is a less + frequently used path so probably not worth it. */ + src -= stride[n] * extent[n]; + n++; + if (n == dim) + { + src = NULL; + break; + } + else + { + count[n]++; + src += stride[n]; + } + } + } + return destptr; +} + +#endif + diff --git a/libgfortran/generated/in_pack_r4.c b/libgfortran/generated/in_pack_r4.c new file mode 100644 index 00000000000..a1f352c4fdd --- /dev/null +++ b/libgfortran/generated/in_pack_r4.c @@ -0,0 +1,124 @@ +/* Helper function for repacking arrays. + Copyright 2003, 2006, 2007 Free Software Foundation, Inc. + Contributed by Paul Brook <paul@nowt.org> + +This file is part of the GNU Fortran 95 runtime library (libgfortran). + +Libgfortran is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public +License as published by the Free Software Foundation; either +version 2 of the License, or (at your option) any later version. + +In addition to the permissions in the GNU General Public License, the +Free Software Foundation gives you unlimited permission to link the +compiled version of this file into combinations with other programs, +and to distribute those combinations without any restriction coming +from the use of this file. (The General Public License restrictions +do apply in other respects; for example, they cover modification of +the file, and distribution when not linked into a combine +executable.) + +Libgfortran is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public +License along with libgfortran; see the file COPYING. If not, +write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ + +#include "libgfortran.h" +#include <stdlib.h> +#include <assert.h> + + +#if defined (HAVE_GFC_REAL_4) + +/* Allocates a block of memory with internal_malloc if the array needs + repacking. */ + +GFC_REAL_4 * +internal_pack_r4 (gfc_array_r4 * source) +{ + index_type count[GFC_MAX_DIMENSIONS]; + index_type extent[GFC_MAX_DIMENSIONS]; + index_type stride[GFC_MAX_DIMENSIONS]; + index_type stride0; + index_type dim; + index_type ssize; + const GFC_REAL_4 *src; + GFC_REAL_4 *dest; + GFC_REAL_4 *destptr; + int n; + int packed; + + /* TODO: Investigate how we can figure out if this is a temporary + since the stride=0 thing has been removed from the frontend. */ + + dim = GFC_DESCRIPTOR_RANK (source); + ssize = 1; + packed = 1; + for (n = 0; n < dim; n++) + { + count[n] = 0; + stride[n] = source->dim[n].stride; + extent[n] = source->dim[n].ubound + 1 - source->dim[n].lbound; + if (extent[n] <= 0) + { + /* Do nothing. */ + packed = 1; + break; + } + + if (ssize != stride[n]) + packed = 0; + + ssize *= extent[n]; + } + + if (packed) + return source->data; + + /* Allocate storage for the destination. */ + destptr = (GFC_REAL_4 *)internal_malloc_size (ssize * sizeof (GFC_REAL_4)); + dest = destptr; + src = source->data; + stride0 = stride[0]; + + + while (src) + { + /* Copy the data. */ + *(dest++) = *src; + /* Advance to the next element. */ + src += stride0; + count[0]++; + /* Advance to the next source element. */ + n = 0; + while (count[n] == extent[n]) + { + /* When we get to the end of a dimension, reset it and increment + the next dimension. */ + count[n] = 0; + /* We could precalculate these products, but this is a less + frequently used path so probably not worth it. */ + src -= stride[n] * extent[n]; + n++; + if (n == dim) + { + src = NULL; + break; + } + else + { + count[n]++; + src += stride[n]; + } + } + } + return destptr; +} + +#endif + diff --git a/libgfortran/generated/in_pack_r8.c b/libgfortran/generated/in_pack_r8.c new file mode 100644 index 00000000000..76cee7afe86 --- /dev/null +++ b/libgfortran/generated/in_pack_r8.c @@ -0,0 +1,124 @@ +/* Helper function for repacking arrays. + Copyright 2003, 2006, 2007 Free Software Foundation, Inc. + Contributed by Paul Brook <paul@nowt.org> + +This file is part of the GNU Fortran 95 runtime library (libgfortran). + +Libgfortran is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public +License as published by the Free Software Foundation; either +version 2 of the License, or (at your option) any later version. + +In addition to the permissions in the GNU General Public License, the +Free Software Foundation gives you unlimited permission to link the +compiled version of this file into combinations with other programs, +and to distribute those combinations without any restriction coming +from the use of this file. (The General Public License restrictions +do apply in other respects; for example, they cover modification of +the file, and distribution when not linked into a combine +executable.) + +Libgfortran is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public +License along with libgfortran; see the file COPYING. If not, +write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ + +#include "libgfortran.h" +#include <stdlib.h> +#include <assert.h> + + +#if defined (HAVE_GFC_REAL_8) + +/* Allocates a block of memory with internal_malloc if the array needs + repacking. */ + +GFC_REAL_8 * +internal_pack_r8 (gfc_array_r8 * source) +{ + index_type count[GFC_MAX_DIMENSIONS]; + index_type extent[GFC_MAX_DIMENSIONS]; + index_type stride[GFC_MAX_DIMENSIONS]; + index_type stride0; + index_type dim; + index_type ssize; + const GFC_REAL_8 *src; + GFC_REAL_8 *dest; + GFC_REAL_8 *destptr; + int n; + int packed; + + /* TODO: Investigate how we can figure out if this is a temporary + since the stride=0 thing has been removed from the frontend. */ + + dim = GFC_DESCRIPTOR_RANK (source); + ssize = 1; + packed = 1; + for (n = 0; n < dim; n++) + { + count[n] = 0; + stride[n] = source->dim[n].stride; + extent[n] = source->dim[n].ubound + 1 - source->dim[n].lbound; + if (extent[n] <= 0) + { + /* Do nothing. */ + packed = 1; + break; + } + + if (ssize != stride[n]) + packed = 0; + + ssize *= extent[n]; + } + + if (packed) + return source->data; + + /* Allocate storage for the destination. */ + destptr = (GFC_REAL_8 *)internal_malloc_size (ssize * sizeof (GFC_REAL_8)); + dest = destptr; + src = source->data; + stride0 = stride[0]; + + + while (src) + { + /* Copy the data. */ + *(dest++) = *src; + /* Advance to the next element. */ + src += stride0; + count[0]++; + /* Advance to the next source element. */ + n = 0; + while (count[n] == extent[n]) + { + /* When we get to the end of a dimension, reset it and increment + the next dimension. */ + count[n] = 0; + /* We could precalculate these products, but this is a less + frequently used path so probably not worth it. */ + src -= stride[n] * extent[n]; + n++; + if (n == dim) + { + src = NULL; + break; + } + else + { + count[n]++; + src += stride[n]; + } + } + } + return destptr; +} + +#endif + diff --git a/libgfortran/generated/in_unpack_i1.c b/libgfortran/generated/in_unpack_i1.c new file mode 100644 index 00000000000..4b455b73d28 --- /dev/null +++ b/libgfortran/generated/in_unpack_i1.c @@ -0,0 +1,112 @@ +/* Helper function for repacking arrays. + Copyright 2003, 2006, 2007 Free Software Foundation, Inc. + Contributed by Paul Brook <paul@nowt.org> + +This file is part of the GNU Fortran 95 runtime library (libgfortran). + +Libgfortran is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public +License as published by the Free Software Foundation; either +version 2 of the License, or (at your option) any later version. + +In addition to the permissions in the GNU General Public License, the +Free Software Foundation gives you unlimited permission to link the +compiled version of this file into combinations with other programs, +and to distribute those combinations without any restriction coming +from the use of this file. (The General Public License restrictions +do apply in other respects; for example, they cover modification of +the file, and distribution when not linked into a combine +executable.) + +Libgfortran is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public +License along with libgfortran; see the file COPYING. If not, +write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ + +#include "libgfortran.h" +#include <stdlib.h> +#include <assert.h> +#include <string.h> + + +#if defined (HAVE_GFC_INTEGER_1) + +void +internal_unpack_1 (gfc_array_i1 * d, const GFC_INTEGER_1 * src) +{ + index_type count[GFC_MAX_DIMENSIONS]; + index_type extent[GFC_MAX_DIMENSIONS]; + index_type stride[GFC_MAX_DIMENSIONS]; + index_type stride0; + index_type dim; + index_type dsize; + GFC_INTEGER_1 *dest; + int n; + + dest = d->data; + if (src == dest || !src) + return; + + dim = GFC_DESCRIPTOR_RANK (d); + dsize = 1; + for (n = 0; n < dim; n++) + { + count[n] = 0; + stride[n] = d->dim[n].stride; + extent[n] = d->dim[n].ubound + 1 - d->dim[n].lbound; + if (extent[n] <= 0) + abort (); + + if (dsize == stride[n]) + dsize *= extent[n]; + else + dsize = 0; + } + + if (dsize != 0) + { + memcpy (dest, src, dsize * sizeof (GFC_INTEGER_1)); + return; + } + + stride0 = stride[0]; + + while (dest) + { + /* Copy the data. */ + *dest = *(src++); + /* Advance to the next element. */ + dest += stride0; + count[0]++; + /* Advance to the next source element. */ + n = 0; + while (count[n] == extent[n]) + { + /* When we get to the end of a dimension, reset it and increment + the next dimension. */ + count[n] = 0; + /* We could precalculate these products, but this is a less + frequently used path so probably not worth it. */ + dest -= stride[n] * extent[n]; + n++; + if (n == dim) + { + dest = NULL; + break; + } + else + { + count[n]++; + dest += stride[n]; + } + } + } +} + +#endif + diff --git a/libgfortran/generated/in_unpack_i2.c b/libgfortran/generated/in_unpack_i2.c new file mode 100644 index 00000000000..91e6fca9ded --- /dev/null +++ b/libgfortran/generated/in_unpack_i2.c @@ -0,0 +1,112 @@ +/* Helper function for repacking arrays. + Copyright 2003, 2006, 2007 Free Software Foundation, Inc. + Contributed by Paul Brook <paul@nowt.org> + +This file is part of the GNU Fortran 95 runtime library (libgfortran). + +Libgfortran is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public +License as published by the Free Software Foundation; either +version 2 of the License, or (at your option) any later version. + +In addition to the permissions in the GNU General Public License, the +Free Software Foundation gives you unlimited permission to link the +compiled version of this file into combinations with other programs, +and to distribute those combinations without any restriction coming +from the use of this file. (The General Public License restrictions +do apply in other respects; for example, they cover modification of +the file, and distribution when not linked into a combine +executable.) + +Libgfortran is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public +License along with libgfortran; see the file COPYING. If not, +write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ + +#include "libgfortran.h" +#include <stdlib.h> +#include <assert.h> +#include <string.h> + + +#if defined (HAVE_GFC_INTEGER_2) + +void +internal_unpack_2 (gfc_array_i2 * d, const GFC_INTEGER_2 * src) +{ + index_type count[GFC_MAX_DIMENSIONS]; + index_type extent[GFC_MAX_DIMENSIONS]; + index_type stride[GFC_MAX_DIMENSIONS]; + index_type stride0; + index_type dim; + index_type dsize; + GFC_INTEGER_2 *dest; + int n; + + dest = d->data; + if (src == dest || !src) + return; + + dim = GFC_DESCRIPTOR_RANK (d); + dsize = 1; + for (n = 0; n < dim; n++) + { + count[n] = 0; + stride[n] = d->dim[n].stride; + extent[n] = d->dim[n].ubound + 1 - d->dim[n].lbound; + if (extent[n] <= 0) + abort (); + + if (dsize == stride[n]) + dsize *= extent[n]; + else + dsize = 0; + } + + if (dsize != 0) + { + memcpy (dest, src, dsize * sizeof (GFC_INTEGER_2)); + return; + } + + stride0 = stride[0]; + + while (dest) + { + /* Copy the data. */ + *dest = *(src++); + /* Advance to the next element. */ + dest += stride0; + count[0]++; + /* Advance to the next source element. */ + n = 0; + while (count[n] == extent[n]) + { + /* When we get to the end of a dimension, reset it and increment + the next dimension. */ + count[n] = 0; + /* We could precalculate these products, but this is a less + frequently used path so probably not worth it. */ + dest -= stride[n] * extent[n]; + n++; + if (n == dim) + { + dest = NULL; + break; + } + else + { + count[n]++; + dest += stride[n]; + } + } + } +} + +#endif + diff --git a/libgfortran/generated/in_unpack_r10.c b/libgfortran/generated/in_unpack_r10.c new file mode 100644 index 00000000000..5514763146f --- /dev/null +++ b/libgfortran/generated/in_unpack_r10.c @@ -0,0 +1,112 @@ +/* Helper function for repacking arrays. + Copyright 2003, 2006, 2007 Free Software Foundation, Inc. + Contributed by Paul Brook <paul@nowt.org> + +This file is part of the GNU Fortran 95 runtime library (libgfortran). + +Libgfortran is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public +License as published by the Free Software Foundation; either +version 2 of the License, or (at your option) any later version. + +In addition to the permissions in the GNU General Public License, the +Free Software Foundation gives you unlimited permission to link the +compiled version of this file into combinations with other programs, +and to distribute those combinations without any restriction coming +from the use of this file. (The General Public License restrictions +do apply in other respects; for example, they cover modification of +the file, and distribution when not linked into a combine +executable.) + +Libgfortran is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public +License along with libgfortran; see the file COPYING. If not, +write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ + +#include "libgfortran.h" +#include <stdlib.h> +#include <assert.h> +#include <string.h> + + +#if defined (HAVE_GFC_REAL_10) + +void +internal_unpack_r10 (gfc_array_r10 * d, const GFC_REAL_10 * src) +{ + index_type count[GFC_MAX_DIMENSIONS]; + index_type extent[GFC_MAX_DIMENSIONS]; + index_type stride[GFC_MAX_DIMENSIONS]; + index_type stride0; + index_type dim; + index_type dsize; + GFC_REAL_10 *dest; + int n; + + dest = d->data; + if (src == dest || !src) + return; + + dim = GFC_DESCRIPTOR_RANK (d); + dsize = 1; + for (n = 0; n < dim; n++) + { + count[n] = 0; + stride[n] = d->dim[n].stride; + extent[n] = d->dim[n].ubound + 1 - d->dim[n].lbound; + if (extent[n] <= 0) + abort (); + + if (dsize == stride[n]) + dsize *= extent[n]; + else + dsize = 0; + } + + if (dsize != 0) + { + memcpy (dest, src, dsize * sizeof (GFC_REAL_10)); + return; + } + + stride0 = stride[0]; + + while (dest) + { + /* Copy the data. */ + *dest = *(src++); + /* Advance to the next element. */ + dest += stride0; + count[0]++; + /* Advance to the next source element. */ + n = 0; + while (count[n] == extent[n]) + { + /* When we get to the end of a dimension, reset it and increment + the next dimension. */ + count[n] = 0; + /* We could precalculate these products, but this is a less + frequently used path so probably not worth it. */ + dest -= stride[n] * extent[n]; + n++; + if (n == dim) + { + dest = NULL; + break; + } + else + { + count[n]++; + dest += stride[n]; + } + } + } +} + +#endif + diff --git a/libgfortran/generated/in_unpack_r16.c b/libgfortran/generated/in_unpack_r16.c new file mode 100644 index 00000000000..3abe19df076 --- /dev/null +++ b/libgfortran/generated/in_unpack_r16.c @@ -0,0 +1,112 @@ +/* Helper function for repacking arrays. + Copyright 2003, 2006, 2007 Free Software Foundation, Inc. + Contributed by Paul Brook <paul@nowt.org> + +This file is part of the GNU Fortran 95 runtime library (libgfortran). + +Libgfortran is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public +License as published by the Free Software Foundation; either +version 2 of the License, or (at your option) any later version. + +In addition to the permissions in the GNU General Public License, the +Free Software Foundation gives you unlimited permission to link the +compiled version of this file into combinations with other programs, +and to distribute those combinations without any restriction coming +from the use of this file. (The General Public License restrictions +do apply in other respects; for example, they cover modification of +the file, and distribution when not linked into a combine +executable.) + +Libgfortran is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public +License along with libgfortran; see the file COPYING. If not, +write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ + +#include "libgfortran.h" +#include <stdlib.h> +#include <assert.h> +#include <string.h> + + +#if defined (HAVE_GFC_REAL_16) + +void +internal_unpack_r16 (gfc_array_r16 * d, const GFC_REAL_16 * src) +{ + index_type count[GFC_MAX_DIMENSIONS]; + index_type extent[GFC_MAX_DIMENSIONS]; + index_type stride[GFC_MAX_DIMENSIONS]; + index_type stride0; + index_type dim; + index_type dsize; + GFC_REAL_16 *dest; + int n; + + dest = d->data; + if (src == dest || !src) + return; + + dim = GFC_DESCRIPTOR_RANK (d); + dsize = 1; + for (n = 0; n < dim; n++) + { + count[n] = 0; + stride[n] = d->dim[n].stride; + extent[n] = d->dim[n].ubound + 1 - d->dim[n].lbound; + if (extent[n] <= 0) + abort (); + + if (dsize == stride[n]) + dsize *= extent[n]; + else + dsize = 0; + } + + if (dsize != 0) + { + memcpy (dest, src, dsize * sizeof (GFC_REAL_16)); + return; + } + + stride0 = stride[0]; + + while (dest) + { + /* Copy the data. */ + *dest = *(src++); + /* Advance to the next element. */ + dest += stride0; + count[0]++; + /* Advance to the next source element. */ + n = 0; + while (count[n] == extent[n]) + { + /* When we get to the end of a dimension, reset it and increment + the next dimension. */ + count[n] = 0; + /* We could precalculate these products, but this is a less + frequently used path so probably not worth it. */ + dest -= stride[n] * extent[n]; + n++; + if (n == dim) + { + dest = NULL; + break; + } + else + { + count[n]++; + dest += stride[n]; + } + } + } +} + +#endif + diff --git a/libgfortran/generated/in_unpack_r4.c b/libgfortran/generated/in_unpack_r4.c new file mode 100644 index 00000000000..c3c27425095 --- /dev/null +++ b/libgfortran/generated/in_unpack_r4.c @@ -0,0 +1,112 @@ +/* Helper function for repacking arrays. + Copyright 2003, 2006, 2007 Free Software Foundation, Inc. + Contributed by Paul Brook <paul@nowt.org> + +This file is part of the GNU Fortran 95 runtime library (libgfortran). + +Libgfortran is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public +License as published by the Free Software Foundation; either +version 2 of the License, or (at your option) any later version. + +In addition to the permissions in the GNU General Public License, the +Free Software Foundation gives you unlimited permission to link the +compiled version of this file into combinations with other programs, +and to distribute those combinations without any restriction coming +from the use of this file. (The General Public License restrictions +do apply in other respects; for example, they cover modification of +the file, and distribution when not linked into a combine +executable.) + +Libgfortran is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public +License along with libgfortran; see the file COPYING. If not, +write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ + +#include "libgfortran.h" +#include <stdlib.h> +#include <assert.h> +#include <string.h> + + +#if defined (HAVE_GFC_REAL_4) + +void +internal_unpack_r4 (gfc_array_r4 * d, const GFC_REAL_4 * src) +{ + index_type count[GFC_MAX_DIMENSIONS]; + index_type extent[GFC_MAX_DIMENSIONS]; + index_type stride[GFC_MAX_DIMENSIONS]; + index_type stride0; + index_type dim; + index_type dsize; + GFC_REAL_4 *dest; + int n; + + dest = d->data; + if (src == dest || !src) + return; + + dim = GFC_DESCRIPTOR_RANK (d); + dsize = 1; + for (n = 0; n < dim; n++) + { + count[n] = 0; + stride[n] = d->dim[n].stride; + extent[n] = d->dim[n].ubound + 1 - d->dim[n].lbound; + if (extent[n] <= 0) + abort (); + + if (dsize == stride[n]) + dsize *= extent[n]; + else + dsize = 0; + } + + if (dsize != 0) + { + memcpy (dest, src, dsize * sizeof (GFC_REAL_4)); + return; + } + + stride0 = stride[0]; + + while (dest) + { + /* Copy the data. */ + *dest = *(src++); + /* Advance to the next element. */ + dest += stride0; + count[0]++; + /* Advance to the next source element. */ + n = 0; + while (count[n] == extent[n]) + { + /* When we get to the end of a dimension, reset it and increment + the next dimension. */ + count[n] = 0; + /* We could precalculate these products, but this is a less + frequently used path so probably not worth it. */ + dest -= stride[n] * extent[n]; + n++; + if (n == dim) + { + dest = NULL; + break; + } + else + { + count[n]++; + dest += stride[n]; + } + } + } +} + +#endif + diff --git a/libgfortran/generated/in_unpack_r8.c b/libgfortran/generated/in_unpack_r8.c new file mode 100644 index 00000000000..9ece8b0a4d2 --- /dev/null +++ b/libgfortran/generated/in_unpack_r8.c @@ -0,0 +1,112 @@ +/* Helper function for repacking arrays. + Copyright 2003, 2006, 2007 Free Software Foundation, Inc. + Contributed by Paul Brook <paul@nowt.org> + +This file is part of the GNU Fortran 95 runtime library (libgfortran). + +Libgfortran is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public +License as published by the Free Software Foundation; either +version 2 of the License, or (at your option) any later version. + +In addition to the permissions in the GNU General Public License, the +Free Software Foundation gives you unlimited permission to link the +compiled version of this file into combinations with other programs, +and to distribute those combinations without any restriction coming +from the use of this file. (The General Public License restrictions +do apply in other respects; for example, they cover modification of +the file, and distribution when not linked into a combine +executable.) + +Libgfortran is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public +License along with libgfortran; see the file COPYING. If not, +write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ + +#include "libgfortran.h" +#include <stdlib.h> +#include <assert.h> +#include <string.h> + + +#if defined (HAVE_GFC_REAL_8) + +void +internal_unpack_r8 (gfc_array_r8 * d, const GFC_REAL_8 * src) +{ + index_type count[GFC_MAX_DIMENSIONS]; + index_type extent[GFC_MAX_DIMENSIONS]; + index_type stride[GFC_MAX_DIMENSIONS]; + index_type stride0; + index_type dim; + index_type dsize; + GFC_REAL_8 *dest; + int n; + + dest = d->data; + if (src == dest || !src) + return; + + dim = GFC_DESCRIPTOR_RANK (d); + dsize = 1; + for (n = 0; n < dim; n++) + { + count[n] = 0; + stride[n] = d->dim[n].stride; + extent[n] = d->dim[n].ubound + 1 - d->dim[n].lbound; + if (extent[n] <= 0) + abort (); + + if (dsize == stride[n]) + dsize *= extent[n]; + else + dsize = 0; + } + + if (dsize != 0) + { + memcpy (dest, src, dsize * sizeof (GFC_REAL_8)); + return; + } + + stride0 = stride[0]; + + while (dest) + { + /* Copy the data. */ + *dest = *(src++); + /* Advance to the next element. */ + dest += stride0; + count[0]++; + /* Advance to the next source element. */ + n = 0; + while (count[n] == extent[n]) + { + /* When we get to the end of a dimension, reset it and increment + the next dimension. */ + count[n] = 0; + /* We could precalculate these products, but this is a less + frequently used path so probably not worth it. */ + dest -= stride[n] * extent[n]; + n++; + if (n == dim) + { + dest = NULL; + break; + } + else + { + count[n]++; + dest += stride[n]; + } + } + } +} + +#endif + diff --git a/libgfortran/io/list_read.c b/libgfortran/io/list_read.c index f1d0e6961e1..d295431bc3a 100644 --- a/libgfortran/io/list_read.c +++ b/libgfortran/io/list_read.c @@ -120,6 +120,9 @@ free_saved (st_parameter_dt *dtp) static void free_line (st_parameter_dt *dtp) { + dtp->u.p.item_count = 0; + dtp->u.p.line_buffer_enabled = 0; + if (dtp->u.p.line_buffer == NULL) return; @@ -157,8 +160,8 @@ next_char (st_parameter_dt *dtp) goto done; } - dtp->u.p.item_count = 0; - dtp->u.p.line_buffer_enabled = 0; + dtp->u.p.item_count = 0; + dtp->u.p.line_buffer_enabled = 0; } /* Handle the end-of-record and end-of-file conditions for @@ -356,6 +359,11 @@ eat_separator (st_parameter_dt *dtp) { eat_line (dtp); c = next_char (dtp); + if (c == '!') + { + eat_line (dtp); + c = next_char (dtp); + } } } while (c == '\n' || c == '\r' || c == ' '); @@ -680,6 +688,9 @@ read_logical (st_parameter_dt *dtp, int length) return; /* Null value. */ default: + /* Save the character in case it is the beginning + of the next object name. */ + unget_char (dtp, c); goto bad_logical; } @@ -695,8 +706,6 @@ read_logical (st_parameter_dt *dtp, int length) unget_char (dtp, c); eat_separator (dtp); - dtp->u.p.item_count = 0; - dtp->u.p.line_buffer_enabled = 0; set_integer ((int *) dtp->u.p.value, v, length); free_line (dtp); @@ -750,8 +759,6 @@ read_logical (st_parameter_dt *dtp, int length) logical_done: - dtp->u.p.item_count = 0; - dtp->u.p.line_buffer_enabled = 0; dtp->u.p.saved_type = BT_LOGICAL; dtp->u.p.saved_length = length; set_integer ((int *) dtp->u.p.value, v, length); @@ -1635,8 +1642,6 @@ read_real (st_parameter_dt *dtp, int length) push_char (dtp, 'n'); } - dtp->u.p.item_count = 0; - dtp->u.p.line_buffer_enabled = 0; free_line (dtp); goto done; diff --git a/libgfortran/libgfortran.h b/libgfortran/libgfortran.h index 427b2fadbab..98af40e2ba2 100644 --- a/libgfortran/libgfortran.h +++ b/libgfortran/libgfortran.h @@ -609,10 +609,15 @@ extern void reshape_packed (char *, index_type, const char *, index_type, const char *, index_type); internal_proto(reshape_packed); -/* Repacking functions. */ +/* Repacking functions. These are called internally by internal_pack + and internal_unpack. */ + +GFC_INTEGER_1 *internal_pack_1 (gfc_array_i1 *); +internal_proto(internal_pack_1); + +GFC_INTEGER_2 *internal_pack_2 (gfc_array_i2 *); +internal_proto(internal_pack_2); -/* ??? These aren't currently used by the compiler, though we - certainly could do so. */ GFC_INTEGER_4 *internal_pack_4 (gfc_array_i4 *); internal_proto(internal_pack_4); @@ -624,6 +629,22 @@ GFC_INTEGER_16 *internal_pack_16 (gfc_array_i16 *); internal_proto(internal_pack_16); #endif +GFC_REAL_4 *internal_pack_r4 (gfc_array_r4 *); +internal_proto(internal_pack_r4); + +GFC_REAL_8 *internal_pack_r8 (gfc_array_r8 *); +internal_proto(internal_pack_r8); + +#if defined HAVE_GFC_REAL_10 +GFC_REAL_10 *internal_pack_r10 (gfc_array_r10 *); +internal_proto(internal_pack_r10); +#endif + +#if defined HAVE_GFC_REAL_16 +GFC_REAL_16 *internal_pack_r16 (gfc_array_r16 *); +internal_proto(internal_pack_r16); +#endif + GFC_COMPLEX_4 *internal_pack_c4 (gfc_array_c4 *); internal_proto(internal_pack_c4); @@ -635,6 +656,17 @@ GFC_COMPLEX_10 *internal_pack_c10 (gfc_array_c10 *); internal_proto(internal_pack_c10); #endif +#if defined HAVE_GFC_COMPLEX_16 +GFC_COMPLEX_16 *internal_pack_c16 (gfc_array_c16 *); +internal_proto(internal_pack_c16); +#endif + +extern void internal_unpack_1 (gfc_array_i1 *, const GFC_INTEGER_1 *); +internal_proto(internal_unpack_1); + +extern void internal_unpack_2 (gfc_array_i2 *, const GFC_INTEGER_2 *); +internal_proto(internal_unpack_2); + extern void internal_unpack_4 (gfc_array_i4 *, const GFC_INTEGER_4 *); internal_proto(internal_unpack_4); @@ -646,6 +678,22 @@ extern void internal_unpack_16 (gfc_array_i16 *, const GFC_INTEGER_16 *); internal_proto(internal_unpack_16); #endif +extern void internal_unpack_r4 (gfc_array_r4 *, const GFC_REAL_4 *); +internal_proto(internal_unpack_r4); + +extern void internal_unpack_r8 (gfc_array_r8 *, const GFC_REAL_8 *); +internal_proto(internal_unpack_r8); + +#if defined HAVE_GFC_REAL_10 +extern void internal_unpack_r10 (gfc_array_r10 *, const GFC_REAL_10 *); +internal_proto(internal_unpack_r10); +#endif + +#if defined HAVE_GFC_REAL_16 +extern void internal_unpack_r16 (gfc_array_r16 *, const GFC_REAL_16 *); +internal_proto(internal_unpack_r16); +#endif + extern void internal_unpack_c4 (gfc_array_c4 *, const GFC_COMPLEX_4 *); internal_proto(internal_unpack_c4); diff --git a/libgfortran/runtime/in_pack_generic.c b/libgfortran/runtime/in_pack_generic.c index 59205ead999..067cd280e08 100644 --- a/libgfortran/runtime/in_pack_generic.c +++ b/libgfortran/runtime/in_pack_generic.c @@ -65,25 +65,65 @@ internal_pack (gfc_array_char * source) { case GFC_DTYPE_INTEGER: case GFC_DTYPE_LOGICAL: - case GFC_DTYPE_REAL: switch (size) { - case 4: - return internal_pack_4 ((gfc_array_i4 *)source); + case sizeof (GFC_INTEGER_1): + return internal_pack_1 ((gfc_array_i1 *) source); + + case sizeof (GFC_INTEGER_2): + return internal_pack_2 ((gfc_array_i2 *) source); + + case sizeof (GFC_INTEGER_4): + return internal_pack_4 ((gfc_array_i4 *) source); - case 8: - return internal_pack_8 ((gfc_array_i8 *)source); + case sizeof (GFC_INTEGER_8): + return internal_pack_8 ((gfc_array_i8 *) source); + +#if defined(HAVE_GFC_INTEGER_16) + case sizeof (GFC_INTEGER_16): + return internal_pack_16 ((gfc_array_i16 *) source); +#endif } break; + case GFC_DTYPE_REAL: + switch (size) + { + case sizeof (GFC_REAL_4): + return internal_pack_r4 ((gfc_array_r4 *) source); + + case sizeof (GFC_REAL_8): + return internal_pack_r8 ((gfc_array_r8 *) source); + +#if defined (HAVE_GFC_REAL_10) + case sizeof (GFC_REAL_10): + return internal_pack_r10 ((gfc_array_r10 *) source); +#endif + +#if defined (HAVE_GFC_REAL_16) + case sizeof (GFC_REAL_16): + return internal_pack_r16 ((gfc_array_r16 *) source); +#endif + } case GFC_DTYPE_COMPLEX: switch (size) { - case 8: - return internal_pack_c4 ((gfc_array_c4 *)source); + case sizeof (GFC_COMPLEX_4): + return internal_pack_c4 ((gfc_array_c4 *) source); - case 16: - return internal_pack_c8 ((gfc_array_c8 *)source); + case sizeof (GFC_COMPLEX_8): + return internal_pack_c8 ((gfc_array_c8 *) source); + +#if defined (HAVE_GFC_COMPLEX_10) + case sizeof (GFC_COMPLEX_10): + return internal_pack_c10 ((gfc_array_c10 *) source); +#endif + +#if defined (HAVE_GFC_COMPLEX_16) + case sizeof (GFC_COMPLEX_16): + return internal_pack_c16 ((gfc_array_c16 *) source); +#endif + } break; diff --git a/libgfortran/runtime/in_unpack_generic.c b/libgfortran/runtime/in_unpack_generic.c index 25ab64f9c01..8b51fe92e72 100644 --- a/libgfortran/runtime/in_unpack_generic.c +++ b/libgfortran/runtime/in_unpack_generic.c @@ -62,29 +62,80 @@ internal_unpack (gfc_array_char * d, const void * s) { case GFC_DTYPE_INTEGER: case GFC_DTYPE_LOGICAL: - case GFC_DTYPE_REAL: switch (size) { - case 4: - internal_unpack_4 ((gfc_array_i4 *)d, (const GFC_INTEGER_4 *)s); + case sizeof (GFC_INTEGER_1): + internal_unpack_1 ((gfc_array_i1 *) d, (const GFC_INTEGER_1 *) s); + return; + + case sizeof (GFC_INTEGER_2): + internal_unpack_2 ((gfc_array_i2 *) d, (const GFC_INTEGER_2 *) s); + return; + + case sizeof (GFC_INTEGER_4): + internal_unpack_4 ((gfc_array_i4 *) d, (const GFC_INTEGER_4 *) s); + return; + + case sizeof (GFC_INTEGER_8): + internal_unpack_8 ((gfc_array_i8 *) d, (const GFC_INTEGER_8 *) s); return; - case 8: - internal_unpack_8 ((gfc_array_i8 *)d, (const GFC_INTEGER_8 *)s); +#if defined (HAVE_GFC_INTEGER_16) + case sizeof (GFC_INTEGER_16): + internal_unpack_16 ((gfc_array_i16 *) d, (const GFC_INTEGER_16 *) s); return; +#endif } break; + case GFC_DTYPE_REAL: + switch (size) + { + case sizeof (GFC_REAL_4): + internal_unpack_r4 ((gfc_array_r4 *) d, (const GFC_REAL_4 *) s); + return; + + case sizeof (GFC_REAL_8): + internal_unpack_r8 ((gfc_array_r8 *) d, (const GFC_REAL_8 *) s); + return; + +#if defined(HAVE_GFC_REAL_10) + case sizeof (GFC_REAL_10): + internal_unpack_r10 ((gfc_array_r10 *) d, (const GFC_REAL_10 *) s); + return; +#endif + +#if defined(HAVE_GFC_REAL_16) + case sizeof (GFC_REAL_16): + internal_unpack_r16 ((gfc_array_r16 *) d, (const GFC_REAL_16 *) s); + return; +#endif + + } + case GFC_DTYPE_COMPLEX: switch (size) { - case 8: + case sizeof (GFC_COMPLEX_4): internal_unpack_c4 ((gfc_array_c4 *)d, (const GFC_COMPLEX_4 *)s); return; - case 16: + case sizeof (GFC_COMPLEX_8): internal_unpack_c8 ((gfc_array_c8 *)d, (const GFC_COMPLEX_8 *)s); return; + +#if defined(HAVE_GFC_COMPLEX_10) + case sizeof (GFC_COMPLEX_10): + internal_unpack_c10 ((gfc_array_c10 *) d, (const GFC_COMPLEX_10 *) s); + return; +#endif + +#if defined(HAVE_GFC_COMPLEX_16) + case sizeof (GFC_COMPLEX_16): + internal_unpack_c16 ((gfc_array_c16 *) d, (const GFC_COMPLEX_16 *) s); + return; +#endif + } default: break; diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog index 5440f59f726..c456e7d8ef3 100644 --- a/libgomp/ChangeLog +++ b/libgomp/ChangeLog @@ -1,3 +1,13 @@ +2008-03-18 Jakub Jelinek <jakub@redhat.com> + + PR middle-end/35611 + * testsuite/libgomp.c/atomic-4.c: New test. + + PR libgomp/35625 + * iter.c (gomp_iter_guided_next_locked): If q > n, set end to ws->end. + (gomp_iter_guided_next): Likewise. + * testsuite/libgomp.c/pr35625.c: New test. + 2008-03-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> * aclocal.m4: Regenerate. diff --git a/libgomp/iter.c b/libgomp/iter.c index 1a8a2a7d04f..2d5dd2edd5a 100644 --- a/libgomp/iter.c +++ b/libgomp/iter.c @@ -242,16 +242,16 @@ gomp_iter_guided_next_locked (long *pstart, long *pend) if (ws->next == ws->end) return false; - n = (ws->end - ws->next) / ws->incr; + start = ws->next; + n = (ws->end - start) / ws->incr; q = (n + nthreads - 1) / nthreads; if (q < ws->chunk_size) q = ws->chunk_size; - if (q > n) - q = n; - - start = ws->next; - end = start + q * ws->incr; + if (q <= n) + end = start + q * ws->incr; + else + end = ws->end; ws->next = end; *pstart = start; @@ -286,15 +286,15 @@ gomp_iter_guided_next (long *pstart, long *pend) if (start == end) return false; - n = (end - start) / ws->incr; + n = (end - start) / incr; q = (n + nthreads - 1) / nthreads; if (q < chunk_size) q = chunk_size; - if (q > n) - q = n; - - nend = start + q * incr; + if (__builtin_expect (q <= n, 1)) + nend = start + q * incr; + else + nend = end; tmp = __sync_val_compare_and_swap (&ws->next, start, nend); if (__builtin_expect (tmp == start, 1)) diff --git a/libgomp/testsuite/libgomp.c/atomic-4.c b/libgomp/testsuite/libgomp.c/atomic-4.c new file mode 100644 index 00000000000..10f8197b0b6 --- /dev/null +++ b/libgomp/testsuite/libgomp.c/atomic-4.c @@ -0,0 +1,18 @@ +/* PR middle-end/35611 */ +/* { dg-options "-O2" } */ + +extern void abort (void); + +int +main (void) +{ + long double d = .0L; + int i; + #pragma omp parallel for shared (d) + for (i = 0; i < 1000; i++) + #pragma omp atomic + d += 1.0L; + if (d != 1000.0L) + abort (); + return 0; +} diff --git a/libgomp/testsuite/libgomp.c/pr35625.c b/libgomp/testsuite/libgomp.c/pr35625.c new file mode 100644 index 00000000000..f2978f91164 --- /dev/null +++ b/libgomp/testsuite/libgomp.c/pr35625.c @@ -0,0 +1,18 @@ +/* PR libgomp/35625 */ +/* { dg-do run } */ +/* { dg-options "-std=c99" } */ + +int +main (void) +{ +#pragma omp parallel + { + #pragma omp for schedule (guided, 10) + for (int i = 0; i < 1826; i += 10) + ; + #pragma omp for schedule (guided, 10) + for (int i = 0; i > -1826; i -= 10) + ; + } + return 0; +} diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 7ae26c60672..996bed982f8 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,9 @@ +2008-03-18 Benjamin Kosnik <bkoz@redhat.com> + + * configure.ac (libtool_VERSION): To 6:11:0. + * configure: Regenerate. + * aclocal.m4: Regenerate. + 2008-03-16 Paolo Carlini <pcarlini@suse.de> * testsuite/17_intro/headers/c++200x/all_multiple_inclusion.cc: diff --git a/libstdc++-v3/Makefile.in b/libstdc++-v3/Makefile.in index 146704405ff..76397b3b914 100644 --- a/libstdc++-v3/Makefile.in +++ b/libstdc++-v3/Makefile.in @@ -54,7 +54,6 @@ am__aclocal_m4_deps = $(top_srcdir)/../config/enable.m4 \ $(top_srcdir)/../config/lib-prefix.m4 \ $(top_srcdir)/../config/multi.m4 \ $(top_srcdir)/../config/no-executables.m4 \ - $(top_srcdir)/../config/proginstall.m4 \ $(top_srcdir)/../config/unwind_ipinfo.m4 \ $(top_srcdir)/../libtool.m4 $(top_srcdir)/../ltoptions.m4 \ $(top_srcdir)/../ltsugar.m4 $(top_srcdir)/../ltversion.m4 \ diff --git a/libstdc++-v3/aclocal.m4 b/libstdc++-v3/aclocal.m4 index 9996d14fc96..baabee6eb6a 100644 --- a/libstdc++-v3/aclocal.m4 +++ b/libstdc++-v3/aclocal.m4 @@ -589,7 +589,6 @@ m4_include([../config/lib-link.m4]) m4_include([../config/lib-prefix.m4]) m4_include([../config/multi.m4]) m4_include([../config/no-executables.m4]) -m4_include([../config/proginstall.m4]) m4_include([../config/unwind_ipinfo.m4]) m4_include([../libtool.m4]) m4_include([../ltoptions.m4]) diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure index b17a093f6e2..05b123e596e 100755 --- a/libstdc++-v3/configure +++ b/libstdc++-v3/configure @@ -1549,7 +1549,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu ### am handles this now? ORIGINAL_LD_FOR_MULTILIBS=$LD # For libtool versioning info, format is CURRENT:REVISION:AGE -libtool_VERSION=6:10:0 +libtool_VERSION=6:11:0 # Find the rest of the source tree framework. @@ -1769,7 +1769,6 @@ am__api_version="1.9" # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. -# Reject install programs that cannot install multiple files. echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 if test -z "$INSTALL"; then @@ -1803,18 +1802,8 @@ case $as_dir/ in # program-specific install script used by HP pwplus--don't use. : else - rm -rf conftest.one conftest.two conftest.dir - echo one > conftest.one - echo two > conftest.two - mkdir conftest.dir - if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && - test -s conftest.one && test -s conftest.two && - test -s conftest.dir/conftest.one && - test -s conftest.dir/conftest.two - then - ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" - break 3 - fi + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 fi fi done @@ -1823,16 +1812,15 @@ case $as_dir/ in esac done -rm -rf conftest.one conftest.two conftest.dir fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else - # As a last resort, use the slow shell script. Don't cache a - # value for INSTALL within a source directory, because that will + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will # break other packages using the cache if that directory is - # removed, or if the value is a relative name. + # removed, or if the path is relative. INSTALL=$ac_install_sh fi fi @@ -4657,13 +4645,13 @@ if test "${lt_cv_nm_interface+set}" = set; then else lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext - (eval echo "\"\$as_me:4660: $ac_compile\"" >&5) + (eval echo "\"\$as_me:4648: $ac_compile\"" >&5) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&5 - (eval echo "\"\$as_me:4663: $NM \\\"conftest.$ac_objext\\\"\"" >&5) + (eval echo "\"\$as_me:4651: $NM \\\"conftest.$ac_objext\\\"\"" >&5) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&5 - (eval echo "\"\$as_me:4666: output\"" >&5) + (eval echo "\"\$as_me:4654: output\"" >&5) cat conftest.out >&5 if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" @@ -5707,7 +5695,7 @@ ia64-*-hpux*) ;; *-*-irix6*) # Find out which ABI we are using. - echo '#line 5710 "configure"' > conftest.$ac_ext + echo '#line 5698 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -7169,11 +7157,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:7172: $lt_compile\"" >&5) + (eval echo "\"\$as_me:7160: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:7176: \$? = $ac_status" >&5 + echo "$as_me:7164: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -7491,11 +7479,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:7494: $lt_compile\"" >&5) + (eval echo "\"\$as_me:7482: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:7498: \$? = $ac_status" >&5 + echo "$as_me:7486: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -7596,11 +7584,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:7599: $lt_compile\"" >&5) + (eval echo "\"\$as_me:7587: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:7603: \$? = $ac_status" >&5 + echo "$as_me:7591: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -7651,11 +7639,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:7654: $lt_compile\"" >&5) + (eval echo "\"\$as_me:7642: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:7658: \$? = $ac_status" >&5 + echo "$as_me:7646: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -10503,7 +10491,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 10506 "configure" +#line 10494 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -10603,7 +10591,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 10606 "configure" +#line 10594 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -12641,11 +12629,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:12644: $lt_compile\"" >&5) + (eval echo "\"\$as_me:12632: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:12648: \$? = $ac_status" >&5 + echo "$as_me:12636: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -12740,11 +12728,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:12743: $lt_compile\"" >&5) + (eval echo "\"\$as_me:12731: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:12747: \$? = $ac_status" >&5 + echo "$as_me:12735: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -12792,11 +12780,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:12795: $lt_compile\"" >&5) + (eval echo "\"\$as_me:12783: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:12799: \$? = $ac_status" >&5 + echo "$as_me:12787: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -13841,7 +13829,7 @@ fi; # # Fake what AC_TRY_COMPILE does. XXX Look at redoing this new-style. cat > conftest.$ac_ext << EOF -#line 13844 "configure" +#line 13832 "configure" struct S { ~S(); }; void bar(); void foo() @@ -17860,7 +17848,7 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu # Fake what AC_TRY_COMPILE does. XXX Look at redoing this new-style. cat > conftest.$ac_ext << EOF -#line 17991 "configure" +#line 17979 "configure" int main() { // NB: _Atomic_word not necessarily int. diff --git a/libstdc++-v3/configure.ac b/libstdc++-v3/configure.ac index 3411b97afc8..1760aebdf0d 100644 --- a/libstdc++-v3/configure.ac +++ b/libstdc++-v3/configure.ac @@ -12,7 +12,7 @@ AC_CONFIG_HEADER(config.h) ### am handles this now? ORIGINAL_LD_FOR_MULTILIBS=$LD # For libtool versioning info, format is CURRENT:REVISION:AGE -libtool_VERSION=6:10:0 +libtool_VERSION=6:11:0 AC_SUBST(libtool_VERSION) # Find the rest of the source tree framework. diff --git a/libstdc++-v3/doc/Makefile.in b/libstdc++-v3/doc/Makefile.in index da58aa6abf0..b40e51059af 100644 --- a/libstdc++-v3/doc/Makefile.in +++ b/libstdc++-v3/doc/Makefile.in @@ -49,7 +49,6 @@ am__aclocal_m4_deps = $(top_srcdir)/../config/enable.m4 \ $(top_srcdir)/../config/lib-prefix.m4 \ $(top_srcdir)/../config/multi.m4 \ $(top_srcdir)/../config/no-executables.m4 \ - $(top_srcdir)/../config/proginstall.m4 \ $(top_srcdir)/../config/unwind_ipinfo.m4 \ $(top_srcdir)/../libtool.m4 $(top_srcdir)/../ltoptions.m4 \ $(top_srcdir)/../ltsugar.m4 $(top_srcdir)/../ltversion.m4 \ diff --git a/libstdc++-v3/include/Makefile.in b/libstdc++-v3/include/Makefile.in index 6d52f75866e..94038f8435f 100644 --- a/libstdc++-v3/include/Makefile.in +++ b/libstdc++-v3/include/Makefile.in @@ -49,7 +49,6 @@ am__aclocal_m4_deps = $(top_srcdir)/../config/enable.m4 \ $(top_srcdir)/../config/lib-prefix.m4 \ $(top_srcdir)/../config/multi.m4 \ $(top_srcdir)/../config/no-executables.m4 \ - $(top_srcdir)/../config/proginstall.m4 \ $(top_srcdir)/../config/unwind_ipinfo.m4 \ $(top_srcdir)/../libtool.m4 $(top_srcdir)/../ltoptions.m4 \ $(top_srcdir)/../ltsugar.m4 $(top_srcdir)/../ltversion.m4 \ diff --git a/libstdc++-v3/libmath/Makefile.in b/libstdc++-v3/libmath/Makefile.in index c2302be25a7..f423f83e53e 100644 --- a/libstdc++-v3/libmath/Makefile.in +++ b/libstdc++-v3/libmath/Makefile.in @@ -49,7 +49,6 @@ am__aclocal_m4_deps = $(top_srcdir)/../config/enable.m4 \ $(top_srcdir)/../config/lib-prefix.m4 \ $(top_srcdir)/../config/multi.m4 \ $(top_srcdir)/../config/no-executables.m4 \ - $(top_srcdir)/../config/proginstall.m4 \ $(top_srcdir)/../config/unwind_ipinfo.m4 \ $(top_srcdir)/../libtool.m4 $(top_srcdir)/../ltoptions.m4 \ $(top_srcdir)/../ltsugar.m4 $(top_srcdir)/../ltversion.m4 \ diff --git a/libstdc++-v3/libsupc++/Makefile.in b/libstdc++-v3/libsupc++/Makefile.in index 631a3f3fa0d..7453d3da8f1 100644 --- a/libstdc++-v3/libsupc++/Makefile.in +++ b/libstdc++-v3/libsupc++/Makefile.in @@ -51,7 +51,6 @@ am__aclocal_m4_deps = $(top_srcdir)/../config/enable.m4 \ $(top_srcdir)/../config/lib-prefix.m4 \ $(top_srcdir)/../config/multi.m4 \ $(top_srcdir)/../config/no-executables.m4 \ - $(top_srcdir)/../config/proginstall.m4 \ $(top_srcdir)/../config/unwind_ipinfo.m4 \ $(top_srcdir)/../libtool.m4 $(top_srcdir)/../ltoptions.m4 \ $(top_srcdir)/../ltsugar.m4 $(top_srcdir)/../ltversion.m4 \ diff --git a/libstdc++-v3/po/Makefile.in b/libstdc++-v3/po/Makefile.in index c7ce1cafb32..e6a32044d1f 100644 --- a/libstdc++-v3/po/Makefile.in +++ b/libstdc++-v3/po/Makefile.in @@ -49,7 +49,6 @@ am__aclocal_m4_deps = $(top_srcdir)/../config/enable.m4 \ $(top_srcdir)/../config/lib-prefix.m4 \ $(top_srcdir)/../config/multi.m4 \ $(top_srcdir)/../config/no-executables.m4 \ - $(top_srcdir)/../config/proginstall.m4 \ $(top_srcdir)/../config/unwind_ipinfo.m4 \ $(top_srcdir)/../libtool.m4 $(top_srcdir)/../ltoptions.m4 \ $(top_srcdir)/../ltsugar.m4 $(top_srcdir)/../ltversion.m4 \ diff --git a/libstdc++-v3/src/Makefile.in b/libstdc++-v3/src/Makefile.in index b115d7ccc2e..450e97f9538 100644 --- a/libstdc++-v3/src/Makefile.in +++ b/libstdc++-v3/src/Makefile.in @@ -50,7 +50,6 @@ am__aclocal_m4_deps = $(top_srcdir)/../config/enable.m4 \ $(top_srcdir)/../config/lib-prefix.m4 \ $(top_srcdir)/../config/multi.m4 \ $(top_srcdir)/../config/no-executables.m4 \ - $(top_srcdir)/../config/proginstall.m4 \ $(top_srcdir)/../config/unwind_ipinfo.m4 \ $(top_srcdir)/../libtool.m4 $(top_srcdir)/../ltoptions.m4 \ $(top_srcdir)/../ltsugar.m4 $(top_srcdir)/../ltversion.m4 \ diff --git a/libstdc++-v3/testsuite/Makefile.in b/libstdc++-v3/testsuite/Makefile.in index 63d92370dcb..44749597aef 100644 --- a/libstdc++-v3/testsuite/Makefile.in +++ b/libstdc++-v3/testsuite/Makefile.in @@ -49,7 +49,6 @@ am__aclocal_m4_deps = $(top_srcdir)/../config/enable.m4 \ $(top_srcdir)/../config/lib-prefix.m4 \ $(top_srcdir)/../config/multi.m4 \ $(top_srcdir)/../config/no-executables.m4 \ - $(top_srcdir)/../config/proginstall.m4 \ $(top_srcdir)/../config/unwind_ipinfo.m4 \ $(top_srcdir)/../libtool.m4 $(top_srcdir)/../ltoptions.m4 \ $(top_srcdir)/../ltsugar.m4 $(top_srcdir)/../ltversion.m4 \ |