1. 02 May, 2012 5 commits
    • Revert 2012-02-24 Dave Korn <dave.korn.cygwin@gmail.com> · 69416e98
      gcc/ada/
      
      2012-05-02  Pascal Obry  <obry@adacore.com>
      
      	Revert 2012-02-24  Dave Korn  <dave.korn.cygwin@gmail.com>
      
      libada/
      
      2012-05-02  Pascal Obry  <obry@adacore.com>
      
      	Revert 2012-02-24  Dave Korn  <dave.korn.cygwin@gmail.com>
      
      From-SVN: r187047
      Arnaud Charlet committed
    • tree.c (valid_constant_size_p): New function. · 56099f00
      2012-05-02  Richard Guenther  <rguenther@suse.de>
      
      	* tree.c (valid_constant_size_p): New function.
      	* tree.h (valid_constant_size_p): Declare.
      	* cfgexpand.c (expand_one_var): Adjust check for too large
      	variables by using valid_constant_size_p.
      	* varasm.c (assemble_variable): Likewise.
      
      	c/
      	* c-decl.c (grokdeclarator): Properly check for sizes that
      	cover more than half of the address-space.
      
      	cp/
      	* decl.c (grokdeclarator): Properly check for sizes that
      	cover more than half of the address-space.
      
      2012-05-02  Richard Guenther  <rguenther@suse.de>
      
      	* fold-const.c (div_if_zero_remainder): sizetypes no longer
      	sign-extend.
      	(int_const_binop_1): New worker for int_const_binop with
      	overflowable parameter.  Pass it through
      	to force_fit_type_double.
      	(int_const_binop): Wrap around int_const_binop_1 with overflowable
      	equal to one.
      	(size_binop_loc): Call int_const_binop_1 with overflowable equal
      	to minus one, forcing overflow detection for even unsigned types.
      	(extract_muldiv_1): Remove bogus TYPE_IS_SIZETYPE special-casing.
      	(fold_binary_loc): Call try_move_mult_to_index with signed offset.
      	* stor-layout.c (initialize_sizetypes): sizetypes no longer
      	sign-extend.
      	(layout_type): For zero-sized arrays ignore overflow on the
      	size calculations.
      	* tree-ssa-ccp.c (bit_value_unop_1): Likewise.
      	(bit_value_binop_1): Likewise.
      	* tree.c (double_int_to_tree): Likewise.
      	(double_int_fits_to_tree_p): Likewise.
      	(force_fit_type_double): Likewise.
      	(host_integerp): Likewise.
      	(int_fits_type_p): Likewise.
      	* varasm.c (output_constructor_regular_field): Sign-extend the
      	field-offset to cater for negative offsets produced by the Ada frontend.
      	* omp-low.c (extract_omp_for_data): Convert the loop step to
      	signed for pointer adjustments.
      
      	* g++.dg/tree-ssa/pr19807.C: Adjust.
      
      From-SVN: r187042
      Richard Guenther committed
    • re PR tree-optimization/53163 (crash due to null ptr deref) · 795e8869
      	PR tree-optimization/53163
      	* tree-ssa-phiopt.c (cond_if_else_store_replacement): Don't ignore
      	return value from compute_all_dependences.
      
      	* gcc.c-torture/compile/pr53163.c: New test.
      
      From-SVN: r187038
      Jakub Jelinek committed
    • re PR rtl-optimization/53160 (likely wrong code bug) · 6aae324c
      	PR rtl-optimization/53160
      	* ree.c (combine_reaching_defs): Handle the case where cand->insn
      	has been modified by ree pass already.
      
      	* gcc.c-torture/execute/pr53160.c: New test.
      
      From-SVN: r187035
      Jakub Jelinek committed
    • Daily bump. · 481c45f6
      From-SVN: r187034
      GCC Administrator committed
  2. 01 May, 2012 12 commits
    • re PR c/37303 (const compound initializers in structs are written to .data instead of .rodata) · a845a7f5
      gcc/:
      	PR c/37303
      	* c-decl.c (build_compound_literal): Make the decl readonly if it
      	an array of a readonly type.
      	* gimplify.c (gimplify_compound_literal_expr): Add fallback
      	parameter.  Change all callers.  If the decl is not addressable
      	and is not an l-value, make it readonly.
      gcc/testsuite:
      	PR c/37303
      	* gcc.dg/pr37303.c: New test.
      
      From-SVN: r187027
      Ian Lance Taylor committed
    • re PR libstdc++/53115 (_Hashtable::_M_rehash_aux(false_type) is broken) · b7a9facb
      2012-05-01  François Dumont  <fdumont@gcc.gnu.org>
      
      	PR libstdc++/53115
      	* include/bits/hashtable.h
      	(_Hashtable<>::_M_rehash_aux(size_type, false_type)): Fix buckets
      	after insertion of several equivalent elements.
      	* testsuite/23_containers/unordered_multiset/insert/53115.cc: New.
      	* testsuite/23_containers/unordered_multimap/insert/53115.cc: New.
      
      From-SVN: r187025
      François Dumont committed
    • ira.c (allocated_reg_info_size): New static variable. · fb99ee9b
      	* ira.c (allocated_reg_info_size): New static variable.
      	(expand_reg_info): Manage it. Call
      	setup_preferred_alternate_classes_for_new_pseudos.
      	(ira): Don't do it here.  Remove local allocated_reg_info_size,
      	set the global before calling find_moveable_pseudos.
      	(find_moveable_pseudos): Call expand_reg_info rather than
      	resize_reg_info.
      
      From-SVN: r187019
      Bernd Schmidt committed
    • Add libatomic as a target library. · 48310492
      From-SVN: r187018
      Richard Henderson committed
    • Add -fno-sync-libcalls. · e8053cf5
              * common.opt (fsync-libcalls): New.
              * doc/invoke.texi: Document it.
              * optabs.c (init_sync_libfuncs): Honor it.
      
      From-SVN: r187017
      Richard Henderson committed
    • * lib/target-supports.exp · 0f2f3389
              (check_effective_target_sync_long_long_runtime): True for
              check_effective_target_powerpc64.
      
      From-SVN: r187016
      Richard Henderson committed
    • Makefile.in (lower-subreg.o, [...]): Depend on lower-subreg.h. · af4ba423
      gcc/
      2012-03-31  Kenneth Zadeck  <zadeck@naturalbridge.com>
      	    Richard Sandiford  <r.sandiford@uk.ibm.com>
      
      	* Makefile.in (lower-subreg.o, target-globals.o): Depend on
      	lower-subreg.h.
      	* lower-subreg.h: New file.
      	* target-globals.h (this_target_lower_subreg): Declare.
      	(target_globals): Add lower_subreg;
      	(restore_target_globals): Restore this_target_lower_subreg.
      	* target-globals.c: Include it.
      	(default_target_globals): Add default_target_lower_subreg.
      	(save_target_globals): Initialize target_lower_subreg.
      	* rtl.h (init_lower_subreg): Added declaration.
      	* toplev.c (backend_init_target): Call initializer for lower-subreg
      	pass.
      	* lower-subreg.c (LOG_COSTS, FORCE_LOWERING): New macros.
      	(default_target_lower_subreg): New variable.
      	(this_target_lower_subreg): Likewise.
      	(twice_word_mode, choices): New macros.
      	(shift_cost, compute_splitting_shift, compute_costs)
      	(init_lower_subreg): New functions.
      	(resolve_simple_move): Add speed_p argument.  Check choices.
      	(find_pseudo_copy): Don't check the mode size here.
      	(resolve_simple_move): Assert the mode size.
      	(find_decomposable_shift_zext): Add speed_p argument and return
      	a bool.  Check choices.
      	(resolve_shift_zext): Add comment.
      	(dump_shift_choices, dump_choices): New functions.
      	(decompose_multiword_subregs): Dump list of profitable
      	transformations.  Add code to skip non profitable transformations.
      	Update calls to simple_move and find_decomposable_shift_zext.
      
      Co-Authored-By: Richard Sandiford <r.sandiford@uk.ibm.com>
      
      From-SVN: r187015
      Kenneth Zadeck committed
    • arm-protos.h (thumb_unexpanded_epilogue): Rename to... · 90911ab6
      2012-05-01  Ian Bolton  <ian.bolton@arm.com>
                  Sameera Deshpande  <sameera.deshpande@arm.com>
                  Greta Yorsh  <greta.yorsh@arm.com>
      
      	* config/arm/arm-protos.h (thumb_unexpanded_epilogue): Rename to...
              (thumb1_unexpanded_epilogue): ...this.
      	* config/arm/arm.c (thumb_unexpanded_epilogue): Rename to...
              (thumb1_unexpanded_epilogue): ...this.
      	* config/arm/arm.md (thumb_unexpanded_epilogue): Rename to...
              (thumb1_unexpanded_epilogue): ...this.
      
      
      
      Co-Authored-By: Greta Yorsh <greta.yorsh@arm.com>
      Co-Authored-By: Sameera Deshpande <sameera.deshpande@arm.com>
      
      From-SVN: r187014
      Ian Bolton committed
    • MAINTAINERS (Write After Approval): Add myself. · 77f496df
      2012-05-01  Greta Yorsh  <Greta.Yorsh@arm.com>
      
      	* MAINTAINERS (Write After Approval): Add myself.
      
      From-SVN: r187013
      Greta Yorsh committed
    • linux-eabi.h (GLIBC_DYNAMIC_LINKER_DEFAULT): Avoid ifdef comparing enumeration values. · 6302b84b
      	* arm/linux-eabi.h (GLIBC_DYNAMIC_LINKER_DEFAULT): Avoid ifdef
      	comparing enumeration values.  Update comments.
      
      From-SVN: r187012
      Richard Earnshaw committed
    • re PR target/53038 (cfi_restore for cr before cr is actually restored) · 56ca756c
      	PR target/53038
      	* config/rs6000/rs6000.c (load_lr_save, restore_saved_lr,
      	load_cr_save, add_crlr_cfa_restore): New functions.
      	(rs6000_restore_saved_cr): Rename to..
      	(restore_saved_cr): ..this.  Add cfa_restore notes for cr.
      	(rs6000_emit_epilogue): Use new functions.  Adjust condition
      	for emitting lr and cr cfa_restore.  Emit cfa_restores for fp
      	regs when using out-of-line restore only when shrink wrapping.
      
      From-SVN: r187010
      Alan Modra committed
    • Daily bump. · f8e4c7e6
      From-SVN: r187007
      GCC Administrator committed
  3. 30 Apr, 2012 23 commits
    • re PR middle-end/53136 (Use after free in ipa_make_edge_direct_to_target,… · 036c0102
      re PR middle-end/53136 (Use after free in ipa_make_edge_direct_to_target, cxx_printable_name_internal problem)
      
      	PR middle-end/53136
      	* ipa-prop.c (ipa_print_node_jump_functions): Wrap multiple
      	calls to cgraph_node_name in xstrdup.
      	(ipa_make_edge_direct_to_target): Ditto.
      	* cgraph.c (dump_cgraph_node): Ditto.
      	* tree-sra.c (convert_callers_for_node): Ditto.
      	* lto-symtab.c (lto_cgraph_replace_node): Ditto.
      	* ipa-cp.c (perhaps_add_new_callers): Ditto.
      	* cgraphunit.c (cgraph_redirect_edge_call_stmt_to_callee): Ditto.
      	(cgraph_materialize_all_clones): Ditto.
      	* ipa-inline.c (report_inline_failed_reason): Ditto.
      	(want_early_inline_function_p): Ditto.
      	(edge_badness): Ditto.
      	(update_edge_key): Ditto.
      	(flatten_function): Ditto.
      	(ipa_inline): Ditto.
      	(inlinw_always_inline_functions): Ditto.
      	(early_inline_small_functions): Ditto.
      
      From-SVN: r187001
      Uros Bizjak committed
    • re PR target/53141 (gcc.target/i386/bmi2-mulx32-[12]a.c) · 24b2a15a
      	PR target/53141
      	* config/i386/i386.md (*umul<mode><dwi>3_1): Switch places of
      	constraints 0 and 1.
      
      From-SVN: r187000
      Uros Bizjak committed
    • cgraph.c (ld_plugin_symbol_resolution_names): Move to symtab.c · 65d630d4
      	* cgraph.c (ld_plugin_symbol_resolution_names): Move to symtab.c
      	(cgraph_asm_nodes, cgraph_asm_last_node): Move to cgraphunit.c
      	(cgraph_add_to_same_comdat_group): Remove.
      	(cgraph_add_asm_node): Move to cgraphunit.c.
      	(cgraph_make_decl_local): Move to symtab.c
      	(cgraph_make_node_local_1): Update.
      	(cgraph_can_remove_if_no_direct_calls_and): Update.
      	(used_from_object_file_p): Update.
      	(resolution_used_from_other_file_p): Move to symtab.c
      	(cgraph_used_from_object_file_p): move to symtab.c
      	(verify_cgraph_node): Verify same comdat groups.
      	* cgraph.h (cgraph_asm_node): Rename to ...
      	(asm_node): ... this one.
      	(cgraph_asm_nodes): Rename to ...
      	(asm_nodes): ... this one.
      	(symtab_add_to_same_comdat_group): New function.
      	(symtab_dissolve_same_comdat_group_list): New function.
      	(symtab_used_from_object_file_p): Declare.
      	(symtab_make_decl_local): Declare.
      	(cgraph_add_to_same_comdat_group): Remove.
      	(cgraph_add_asm_node): Remove.
      	(cgraph_used_from_object_file_p, varpool_used_from_object_file_p):
      	Remove.
      	(cgraph_finalize_compilation_unit): Rename to ...
      	(finalize_compilation_unit): ... this one.
      	(cgraph_optimize): Rename to ....
      	(compile): ... this one.
      	(add_asm_node): Declare.
      	(fixup_same_cpp_alias_visibility): Declare.
      	(cgraph_make_decl_local): Remove.
      	(varpool_assemble_pending_decls): Rename to ...
      	(varpool_output_variables): ... this one.
      	(varpool_remove_unreferenced_decls): Remove.
      	* ipa-inline-transform.c (clone_inlined_nodes): Dissolve comdat groups.
      	(preserve_function_body_p): Make static.
      	* toplev.c (compile_file): Update comments;
      	update.
      	* cgraphunit.c: Update comments.
      	(cgraph_expand_all_functions): Rename to ...
      	(expand_all_functions): ... this one; update.
      	(cgraph_mark_functions_to_output): Rename to ...
      	(mark_functions_to_output): ... this one; cleanup.
      	(cgraph_output_pending_asms): Remove prototype.
      	(asm_nodes, asm_last_node): New static vars.
      	(cgraph_process_new_functions): Update.
      	(cgraph_reset_node): Cleanup; add comment.
      	(cgraph_add_new_function): Update.
      	(cgraph_output_pending_asms): Rename to ...
      	(output_asm_statements): ... this one.
      	(add_asm_node): New function.
      	(fixup_same_cpp_alias_visibility): New function based on code
      	in cgraph_analyze_function.
      	(cgraph_analyze_function): Use it.
      	(cgraph_order_sort): Update.
      	(cgraph_output_in_order): Update.
      	(cgraph_function_versioning): Update.
      	(cgraph_optimize): Rename to ...
      	(compile): ... this one; initialize streamer hooks here.
      	(cgraph_finalize_compilation_unit): Rename to ...
      	(finalize_compilation_unit): ... this one; do not initialize streamer
      	hook here.
      	* lto-streamer-out.c (lto_output_toplevel_asms): Update.
      	* dwarf2out.c: Update ocmment.
      	* optimize.c (maybe_clone_body): Use symtab_add_to_same_comdat_group.
      	* method.c (use_thunk): Likewise.
      	* semantics.c (maybe_add_lambda_conv_op): Likewise.
      	* decl2.c (maybe_emit_vtables): Likewise.	
      	(cp_write_global_declarations): Use finalize_compilation_unit.
      	* parser.c (cp_parser_asm_definition): Use add_asm_node.
      	* lto-streamer-in.c (lto_input_toplevel_asms): Use add_asm_node
      	* c-decl.c (c_write_global_declarations): Use finalize_compilation_unit.
      	* langhooks.c (write_global_declarations): Update.
      	* ipa.c (cgraph_externally_visible_p): Update.
      	(dissolve_same_comdat_group_list): Remove.
      	(function_and_variable_visibility): Update.
      	* symtab.c: Inlcude lto-streamer.h and rtl.h
      	(ld_plugin_symbol_resolution_names): New.
      	(symtab_add_to_same_comdat_group): New.
      	(symtab_dissolve_same_comdat_group_list): New.
      	(resolution_used_from_other_file_p): Move here from cgraph.c
      	(symtab_used_from_object_file_p): New.
      	(symtab_make_decl_local): New.
      	* passes.c (register_pass): Update comments.
      	* c-parser.c (c_parser_asm_definition): Update.
      	* varpool.c (varpool_analyze_node): Use fixup_same_cpp_alias_visibility.
      	(varpool_remove_unreferenced_decls): Make static.
      	(varpool_assemble_pending_decls): Rename to ...
      	(varpool_output_variables): ... this one; call
      	varpool_remove_unreferenced_decls.
      	(varpool_used_from_object_file_p): Remove.
      
      	* gogo-tree.cc (Gogo::write_globals): Use finalize_compilation_unit.
      
      	* gcc-interface/utils.c (rest_of_subprog_body_compilation): Update
      	comment.
      	(gnat_write_global_declarations): Use finalize_compilation_unit.
      
      	* f95-lang.c (gfc_finish): Update comments.
      
      	* lto.c (lto_main): Use compile ().
      	* lto-partition.c (partition_cgraph_node_p): Use symtab_used_from_object_file_p.
      	(partition_varpool_node_p): Likewise.
      
      From-SVN: r186998
      Jan Hubicka committed
    • re PR c++/51033 (generic vector subscript and shuffle support was not added to C++) · 7edaa4d2
      	PR c++/51033
      gcc/
      	* c-typeck.c (build_array_ref): Call
      	convert_vector_to_pointer_for_subscript.
      gcc/c-family
      	* c-common.c (convert_vector_to_pointer_for_subscript): New function.
      	* c-common.h (convert_vector_to_pointer_for_subscript): Declare it.
      gcc/cp/
      	* typeck.c (cp_build_array_ref): Handle VECTOR_TYPE.
      	* decl2.c (grok_array_decl): Likewise.
      
      From-SVN: r186994
      Marc Glisse committed
    • i386.md (and<mode>3): Change runtime operand mode checks to compile-time "mode… · f45d8c45
      i386.md (and<mode>3): Change runtime operand mode checks to compile-time "mode == <MODE>mode" checks.
      
      	* config/i386/i386.md (and<mode>3): Change runtime operand mode checks
      	to compile-time "mode == <MODE>mode" checks.
      	(and splitter): Ditto.
      
      From-SVN: r186993
      Uros Bizjak committed
    • * libcpp/ChangeLog: Fix PR number. · 3efc2959
      From-SVN: r186992
      Manuel López-Ibáñez committed
    • re PR c++/52974 (Canonicalize include paths in diagnostics) · b193dfa8
      2012-04-30  Manuel López-Ibáñez  <manu@gcc.gnu.org>
      	    Dodji Seketeli  <dodji@seketeli.org>
      
      	PR c++/52974
      	* libcpp/files.c (maybe_shorter_path): New.
      	(find_file_in_dir): Use it.
      
      Co-Authored-By: Dodji Seketeli <dodji@seketeli.org>
      
      From-SVN: r186991
      Manuel López-Ibáñez committed
    • arm.md (UNSPEC_LL): New. · a7b8107f
              * config/arm/arm.md (UNSPEC_LL): New.
              * config/arm/sync.md (atomic_loaddi, atomic_loaddi_1): New.
              (arm_load_exclusivedi): Use %H0.
      
      From-SVN: r186990
      Richard Henderson committed
    • dwarf2out.c (comdat_symbol_id): Add const. · 85dd5559
      	* dwarf2out.c (comdat_symbol_id): Add const.
      	(union die_symbol_or_type_node): Add const to die_symbol.
      	(output_die_symbol, output_die, output_comp_unit): Adjust.
      
      From-SVN: r186989
      Jason Merrill committed
    • re PR c++/51314 ([C++0x] sizeof... and parentheses) · 1941b0ca
      	PR c++/51314
      	* parser.c (cp_parser_sizeof_operand): Require parentheses for
      	sizeof...
      
      From-SVN: r186988
      Marc Glisse committed
    • re PR go/52586 (libgo fails to build for mips*64-linux-gnu (reference to… · 81b95894
      re PR go/52586 (libgo fails to build for mips*64-linux-gnu (reference to undefined name 'SYS_GETDENTS64'))
      
      	PR go/52586
      mksysinfo, syscall: Make sure SYS_GETDENTS64 is defined.
      
      Fixes build on MIPS GNU/Linux.
      
      From-SVN: r186986
      Ian Lance Taylor committed
    • Fix failure in gcc.dg/pr52283.c by adding the missing · b944e97a
      dg-warning and dg-options.
      
      From-SVN: r186985
      Greta Yorsh committed
    • arm.md (negdi2): Use gen_negdi2_neon. · b8fb55d1
      2012-04-30  Andrew Stubbs  <ams@codesourcery.com>
      
      	* config/arm/arm.md (negdi2): Use gen_negdi2_neon.
      	* config/arm/neon.md (negdi2_neon): New insn.
      	Also add splitters for core and NEON registers.
      
      From-SVN: r186984
      Andrew Stubbs committed
    • arm.c (neon_valid_immediate): Allow const_int. · 00a3a76a
      2012-04-30  Andrew Stubbs  <ams@codesourcery.com>
      
      	* config/arm/arm.c (neon_valid_immediate): Allow const_int.
      	(arm_print_operand): Add 'x' format.
      	* config/arm/constraints.md (Dn): Allow const_int.
      	* config/arm/neon.md (neon_mov<mode>): Use VDX to allow DImode.
      	Use 'x' format to print constants.
      	* config/arm/predicates.md (imm_for_neon_mov_operand): Allow const_int.
      	* config/arm/vfp.md (movdi_vfp): Disable for const_int when neon
      	is enabled.
      	(movdi_vfp_cortexa8): Likewise.
      
      From-SVN: r186983
      Andrew Stubbs committed
    • Fix email addresses · 84ba0835
      From-SVN: r186982
      Richard Earnshaw committed
    • 2012-04-24 Ian Bolton <ian.bolton at arm.com> Sameera Deshpande... · fb40241d
      2012-04-24  Ian Bolton  <ian.bolton at arm.com>
                  Sameera Deshpande  <sameera.deshpande at arm.com>
                  Greta Yorsh  <greta.yorsh at arm.com>
      
              * config/arm/arm-protos.h (ldm_stm_operation_p): New parameters.
              * config/arm/arm.c (ldm_stm_operation_p): New parameters.
              * config/arm/predicates.md (load_multiple_operation): Add arguments.
              (store_multiple_operation): Likewise.
      
      Co-Authored-By: Greta Yorsh <greta.yorsh@arm.com>
      Co-Authored-By: Sameera Deshpande <sameera.deshpande@arm.com>
      
      From-SVN: r186981
      Ian Bolton committed
    • 2012-04-30 Ian Bolton <ian.bolton at arm.com> Sameera Deshpande... · 5991e156
      2012-04-30  Ian Bolton	<ian.bolton at arm.com>
      	    Sameera Deshpande  <sameera.deshpande at arm.com>
      	    Greta Yorsh	 <greta.yorsh at arm.com>
      
      	* config/arm/arm-protos.h (ldm_stm_operation_p): New declaration.
      	* config/arm/arm.c (ldm_stm_operation_p): New function.
      	* config/arm/predicates.md (load_multiple_operation): Update predicate.
      	(store_multiple_operation): Likewise.
      
      Co-Authored-By: Greta Yorsh <greta.yorsh@arm.com>
      Co-Authored-By: Sameera Deshpande <sameera.deshpande@arm.com>
      
      From-SVN: r186980
      Ian Bolton committed
    • i386.md (and<mode>3): Expand masking operations with 0xff... · d55d2c84
      	* config/i386/i386.md (and<mode>3): Expand masking operations with
      	0xff, 0xffff or 0xffffffff immediates to corresponding zero_extend RTX.
      	(and splitter): Split to DImode zero_extend RTX for DImode operand[0].
      
      From-SVN: r186979
      Uros Bizjak committed
    • Add -Wvarargs option · b9c8da34
      Several warnings related to questionable usage cases of variadic
      function related macros (like va_start) could not be controlled by any
      warning-related macro.  Fixed thus, by introducing the -Wvarargs
      option.
      
      Tested on x86_64-unknown-linux-gnu against trunk.
      
      gcc/c-family/
      
      	* c.opt (Wvarargs):  Define new option.
      
      gcc/
      	* builtins.c (fold_builtin_next_arg):  Use OPT_Wvarargs as an
      	argument for the various warning_at calls.
      
      gcc/doc/
      
      	* invoke.texi: Update the documentation.
      
      gcc/testsuite/
      
      	* c-c++-common/Wvarargs.c: New test case.
      	* c-c++-common/Wvarargs-2.c: Likewise.
      
      From-SVN: r186978
      Dodji Seketeli committed
    • Switch -ftrack-macro-expansion=2 on by default. · 51fce2d3
      This switches the compiler to -ftrack-macro-expansion=2 by default.
      
      Tested and bootstrapped on x86_64-unknown-linux-gnu against trunk.
      
      libcpp/
      
      	* init.c (cpp_create_reader): Switch -ftrack-macro-expansion=2 on
      	by default.  Add comments.
      
      gcc/docs/
      
      	* cppopts.texi: Adjust for enabling -ftrack-macro-expansion=2 by
      	default.
      
      From-SVN: r186977
      Dodji Seketeli committed
    • Adjust relevant test cases wrt -ftrack-macro-expansion=[0|2] · dde9c193
      Even after all the patches I have already submitted, some test cases
      where errors happens on tokens that are defined in macros see their
      output change in an incompatible way, when you run them with or
      without -ftrack-macro-expansion.
      
      I think this is expected, because the (spelling) locus inside the
      definition of the macro pointed to with -ftrack-macro-expansion is
      different from the locus of the expansion point of the macro pointed
      to without -ftrack-macro-expansion.
      
      In those cases this patch either adjusts the test case and forces it
      be run either with -ftrack-macro-expansion, or it just forces it to be
      run without -ftrack-macro-expansion.
      
      There are so many libstdc++ tests that were failing because of that
      benign issue that I preferred to just run them with
      -ftrack-macro-expansion diabled, after inspecting each of them to be
      sure there was nothing more serious underneath.
      
      Boostrapped on x86_64-unknown-linux-gnu against trunk with and without
      -ftrack-macro-expansion turned on.
      
      gcc/testsuite/
      
      	* objc.dg/foreach-7.m: Force the test case to run without
      	-ftrack-macro-expansion.
      	* c-c++-common/tm/attrib-1.c: Likewise.
      	* c-c++-common/warn-ommitted-condop.c: Likewise.
      	* gcc.dg/assign-warn-1.c: Likewise.
      	* gcc.dg/assign-warn-2.c: Likewise.
      	* gcc.dg/attr-alloc_size.c: Likewise.
      	* gcc.dg/builtin-stringop-chk-1.c: Likewise.
      	* gcc.dg/builtin-stringop-chk-2.c: Likewise.
      	* gcc.dg/builtin-strncat-chk-1.c: Likewise.
      	* gcc.dg/c90-const-expr-9.c: Likewise.
      	* gcc.dg/c99-const-expr-9.c: Likewise.
      	* gcc.dg/cpp/direct2.c: Likewise.  Adjust.
      	* gcc.dg/cpp/direct2s.c: Likewise.
      	* gcc/testsuite/gcc.dg/cpp/pr28709.c: Likewise.
      	* gcc.dg/cpp/pragma-diagnostic-1.c: Likewise.
      	* gcc.dg/dfp/composite-type.c: Likewise.
      	* gcc.dg/uninit-6-O0.c: Adjust the test case and force it to run
      	with -ftrack-macro-expansion
      	* g++.dg/cpp0x/constexpr-ex3.C: Likewise.
      	* g++.dg/cpp0x/constexpr-overflow.C: Likewise.
      	* g++.dg/ext/cleanup-1.C: Likewise.
      	* g++.dg/ext/gnu-inline-global-reject.C: Likewise.
      	* g++.dg/template/sfinae10.C: Likewise.
      	* g++.dg/tm/wrap-2.C: Likewise.
      	* g++.dg/warn/Wconversion-real-integer.C: Likewise.
      	* g++.dg/warn/Wsign-conversion.C: Likewise.
      	* g++.dg/warn/multiple-overflow-warn-1.C: Likewise.
      	* g++.old-deja/g++.mike/p10769b.C: Likewise.
      	* g++.dg/warn/Wdouble-promotion.C: Adjust the test case and force
      	it to run with -ftrack-macro-expansion.
      	* libstdc++-v3/scripts/testsuite_flags.in: By default, run the
      	test cases without -ftrack-macro-expansion.
      
      From-SVN: r186976
      Dodji Seketeli committed
    • Fix va_start related location · 34c88790
      In gcc/testsuite/gcc.dg/pr30457.c, the first warning was not being
      emitted because the relevant location was inside the var_start macro
      defined in a system header.  It can even point to a token for a
      builtin macro there.  This patch unwinds to the first token in real
      source code in that case.
      
      Tested on x86_64-unknown-linux-gnu against trunk.
      
      	* builtins.c (fold_builtin_next_arg): Unwinds to the first
      	location in real source code.
      
      From-SVN: r186975
      Dodji Seketeli committed
    • Fix location for static class members · bfd93a72
      Consider the test case g++.dg/other/offsetof5.C:
      
          #include <stddef.h>
      
          struct A
          {
            char c;
            int &i;
          };
      
          int j = offsetof (A, i);		// { dg-warning "invalid access|offsetof" }
      
          template <typename T>
          struct S
          {
            T h;
            T &i;
            static const int j = offsetof (S, i);	// { dg-warning "invalid access|offsetof" }
          };
      
          int k = S<int>::j;			// { dg-message "required from here" }
      
      The second warning (that involves the instantiation of the S template)
      is not emitted when -ftrack-macro-expansion is on.
      
      This is because during the instantiation of the member j of S
      template, the location that is used for the warning is the one for the
      DECL j (set by instantiate_decl).  And that location is inaccurately
      set to the locus of 'offsetof', which is a macro defined in a system
      header, so it's discarded by the diagnostics machinery.
      
      Note that when we reach the point where we emit the warning in
      build_class_member_access_expr offsetof expression has long been
      folded, so we cannot use e.g, the location of the ')' token that would
      have been in the source code.  So I believe the location of 'j' is the
      best we can get at this point.
      
      The patch below sets the location of the DECL for 'j' to what I
      believe is its precise location; with that, the test case passes with
      and without -ftrack-macro-expansion.  But I had to adjust
      g++.dg/template/sfinae6_neg.C for that.
      
      Tested on x86_64-unknown-linux-gnu against trunk.
      
      gcc/cp
      
      	* decl.c (grokdeclarator): Use the location carried by the
      	declarator for the DECL of the static class member.
      
      gcc/testsuite/
      
      	* g++.dg/template/sfinae6_neg.C: Adjust.
      
      From-SVN: r186974
      Dodji Seketeli committed