1. 04 Sep, 2014 2 commits
    • Revert incorrect merging of debug-early branch. · 9de41e57
      From-SVN: r214914
      Aldy Hernandez committed
    • + * c/c-decl.c (write_global_declarations_1): Call global_decl() + with early=true. · 989f386c
      +       * c/c-decl.c (write_global_declarations_1): Call global_decl()
      +       with early=true.
      +       (write_global_declarations_2): Call global_decl() with
      +       early=false.
      +       * dbxout.c (dbxout_global_decl): New argument.
      +       * debug.c (do_nothing_debug_hooks): Use debug_nothing_tree_bool
      +       for global_decl hook.
      +       (debug_nothing_tree_bool): New.
      +       (struct gcc_debug_hooks): New argument to global_decl.
      +       * dwarf2out.c (output_die): Add misc debugging information.
      +       (gen_variable_die): Do not reparent children.
      +       (dwarf2out_global_decl): Add new documentation.  Add EARLY
      +       argument.
      +       (dwarf2out_decl): Make sure we don't generate new DIEs if we
      +       already have a DIE.
      +       * cp/name-lookup.c (do_namespace_alias): New argument to
      +       global_decl debug hook.
      +       * fortran/trans-decl.c (gfc_emit_parameter_debug_info): Same.
      +       * godump.c (go_global_decl): Same.
      +       * lto/lto-lang.c (lto_write_globals): Same.
      +       * sdbout.c (sdbout_global_decl): Same.
      +       * toplev.c (emit_debug_global_declarations): Same.
      +       * vmsdbgout.c (vmsdbgout_global_decl): Same.
      +       * tree.c (free_lang_data_in_decl): Do not call
      +       dwarf2out_early_decl from here.
      
      From-SVN: r214911
      Aldy Hernandez committed
  2. 03 Sep, 2014 1 commit
  3. 02 Sep, 2014 1 commit
    • cilk-builtins.def (__cilkrts_cilk_for_32): New. · 9a771876
      gcc/
      	* cilk-builtins.def (__cilkrts_cilk_for_32): New.
      	(__cilkrts_cilk_for_64): Likewise.
      	* cilk-common.c (declare_cilk_for_builtin): New function.
      	(cilk_init_builtins): Declare __cilkrts_cilk_for_32 and
      	__cilkrts_cilk_for_64 bultins.
      	* cilk.h (enum cilk_tree_index): Added CILK_TI_F_LOOP_32 and
      	CILK_TI_F_LOOP_64.
      	(cilk_for_32_fndecl): New define.
      	(cilk_for_64_fndecl): Likewise.
      	* gimple-pretty-print.c (dump_gimple_omp_for): Correct hadling of
      	GF_OMP_FOR_KIND_CILKFOR cases; Added NE_EXPR case.
      	* gimple.h (enum gf_mask): Added GF_OMP_FOR_KIND_CILKFOR; adjusted
      	GF_OMP_FOR_KIND_MASK, GF_OMP_FOR_SIMD, GF_OMP_FOR_COMBINED,
      	GF_OMP_FOR_COMBINED_INTO.
      	* gimplify.c (gimplify_scan_omp_clauses): Added
      	OMP_CLAUSE__CILK_FOR_COUNT_ case.
      	(gimplify_adjust_omp_clauses): Ditto.
      	(gimplify_omp_for): Added CILK_FOR case.
      	(gimplify_expr): Ditto.
      	* omp-low.c: Include cilk.h.
      	(extract_omp_for_data): Set appropriate kind for
      	GF_OMP_FOR_KIND_CILKFOR; added check for GF_OMP_FOR_KIND_CILKFOR.
      	(scan_sharing_clauses): Added OMP_CLAUSE__CILK_FOR_COUNT_ cases.
      	(create_omp_child_function_name): Added second argument to handle
      	cilk_for case.
      	(cilk_for_check_loop_diff_type): New function.
      	(expand_cilk_for_call): Likewise.
      	(expand_cilk_for): Likewise.
      	(create_omp_child_function): Set cilk_for_count; handle the cases when
      	it is true; call create_omp_child_function_name with second argument.
      	(expand_omp_taskreg): Set is_cilk_for and handle cases when it's true.
      	(expand_omp_for): Handle case of GF_OMP_FOR_KIND_CILKFOR.
      	* tree-core.h (omp_clause_code): Added OMP_CLAUSE__CILK_FOR_COUNT_.
      	* tree-nested.c (convert_nonlocal_omp_clauses): Added
      	OMP_CLAUSE__CILK_FOR_COUNT_ case.
      	(convert_local_omp_clauses): Ditto.
      	* tree-pretty-print.c (dump_omp_clause): Added
      	OMP_CLAUSE__CILK_FOR_COUNT_ and OMP_CLAUSE_SCHEDULE_CILKFOR cases.
      	(dump_generic_node): Added CILK_FOR case.
      	* tree.c (omp_clause_num_ops): New element
      	OMP_CLAUSE__CILK_FOR_COUNT_ (1).
      	(omp_clause_code_name): New element _Cilk_for_count_.
      	(walk_tree_1): Added OMP_CLAUSE__CILK_FOR_COUNT_ case.
      	* tree.def: Add tree code for CILK_FOR.
      
      gcc/c/
      	* c-parser.c (c_parser_cilk_for): New function.
      	(c_parser_cilk_grainsize): Likewise.
      	(c_get_temp_regvar): Likewise.
      	(c_parser_statement_after_labels): Added RID_CILK_FOR case.
      	(c_parser_pragma): Added PRAGMA_CILK_GRAINSIZE case.
      	(c_parser_omp_for_loop): Added CILK_FOR and CILK_SIMD checks.
      	* c-typeck.c (c_finish_omp_clauses): Added OMP_CLAUSE__CILK_FOR_COUNT_
      	case.
      
      gcc/cp/
      	* cp-cilkplus.c (cpp_validate_cilk_plus_loop_aux): Loc definition
      	simplified.
      	* parser.c (cp_parser_cilk_for): New function.
      	(cp_parser_cilk_grainsize): Likewise.
      	(cp_parser_statement): Added RID_CILK_FOR case.
      	(cp_parser_omp_for_cond): Added CILK_FOR check.
      	(cp_parser_omp_for_loop_init): Change function argument to accept
      	tree_code instead just a bool flag; change the check to use that
      	tree_code; check for initialization declaration in case of Cilk_for.
      	(cp_parser_omp_for_loop): Added checks for CILK_FOR and RID_CILK_FOR;
      	changed call to cp_parser_omp_for_loop_init according new arguments'
      	list.
      	(cp_parser_pragma): Added PRAGMA_CILK_GRAINSIZE case.
      	* pt.c (tsubst_expr): Added CILK_FOR case.
      	* semantics.c: Include convert.h.
      	(finish_omp_clauses): Properly handle OMP_CLAUSE_SCHEDULE_CILKFOR
      	case; added OMP_CLAUSE__CILK_FOR_COUNT_.
      	(handle_omp_for_class_iterator): New argument lastp and its usage;
      	added NE_EXPR case.
      	(finish_omp_for): Changed call to handle_omp_for_class_iterator
      	according new arguments' list; in case of Cilk_for save very first
      	decl and create empty stmt_list block; use block to build correct
      	statement tree.
      
      gcc/c-family/
      	* c-cilkplus.c (cilk_for_number_of_iterations): New function.
      	* c-common.c (c_common_reswords): Added _Cilk_for.
      	* c-common.h (enum rid): Added RID_CILK_FOR.
      	(cilk_for_number_of_iterations): Add declaration.
      	* c-omp.c (c_finish_omp_for): Added checks for CILK_SIMD and
      	CILK_FOR.
      	* c-pragma.c (init_pragma): Register "grainsize" pragma.
      	* c-pragma.h (enum pragma_kind): Add PRAGMA_CILK_GRAINSIZE.
      
      gcc/testsuite/
      	* c-c++-common/cilk-plus/CK/cilk-fors.c: New test.
      	* c-c++-common/cilk-plus/CK/cilk-for-2.c: New test.
      	* c-c++-common/cilk-plus/CK/cilk-for-3.c: New test.
      	* c-c++-common/cilk-plus/CK/cilk_for_errors.c: New test.
      	* c-c++-common/cilk-plus/CK/cilk_for_grain.c: New test.
      	* c-c++-common/cilk-plus/CK/cilk_for_grain_errors.c: New test.
      	* c-c++-common/cilk-plus/CK/cilk_for_ptr_iter.c: New test.
      	* c-c++-common/cilk-plus/CK/nested_cilk_for.c: New test.
      	* g++.dg/cilk-plus/CK/cf3.cc: New test.
      	* g++.dg/cilk-plus/CK/cilk-for-tplt.cc: New test.
      	* g++.dg/cilk-plus/CK/for1.cc: New test.
      	* g++.dg/cilk-plus/CK/stl_iter.cc: New test.
      	* g++.dg/cilk-plus/CK/stl_rev_iter.cc: New test.
      	* g++.dg/cilk-plus/CK/stl_test.cc: New test.
      
      Co-Authored-By: Balaji V. Iyer <balaji.v.iyer@intel.com>
      Co-Authored-By: Igor Zamyatin <igor.zamyatin@intel.com>
      
      From-SVN: r214818
      Jakub Jelinek committed
  4. 27 Aug, 2014 1 commit
  5. 25 Aug, 2014 1 commit
    • IPA C++ refactoring 4/N · 3dafb85c
      	* cgraph.h (symtab_node):
      	(bool needed_p (void)): created from decide_is_symbol_needed
      	(bool referred_to_p (void)): created from referred_to_p
      	(static cgraph_node *get_for_asmname (tree asmname)): created from symtab_node_for_asm
      	* cgraph.h (cgraph_node):
      	(void assemble_thunks_and_aliases (void)): created from assemble_thunks_and_aliases
      	(void expand (void)): created from expand_function
      	(static void finalize_function (tree, bool)): created from cgraph_finalize_function
      	(static cgraph_local_info *local_info (tree decl)): created from cgraph_local_info
      	(static cgraph_global_info *global_info (tree)): created from cgraph_global_info
      	(static cgraph_rtl_info *rtl_info (tree)): created from cgraph_rtl_info
      	* cgraph.h (varpool_node):
      	(static void add (tree decl): created from varpool_add_new_variable
      	* cgraph.h (cgraph_edge):
      	void remove (void);
      	(void remove_caller (void)): created from cgraph_edge_remove_caller
      	(void remove_callee (void)): created from cgraph_edge_remove_callee
      	(void set_call_stmt (gimple new_stmt, bool update_speculative = true)):
      	  created from cgraph_set_call_stmt	
      	(void redirect_callee (cgraph_node *n)): created from cgraph_redirect_edge_callee
      	(cgraph_edge *make_direct (cgraph_node *callee)): created from cgraph_make_edge_direct
      	(cgraph_edge *make_speculative (cgraph_node *n2, gcov_type direct_count,
      	  gimple redirect_call_stmt_to_callee (void)): created from cgraph_turn_edge_to_speculative
      	(void speculative_call_info (cgraph_edge *&direct, cgraph_edge *&indirect, ipa_ref *&reference)):
      	  created from cgraph_speculative_call_info
      	(cgraph_edge * clone (cgraph_node *n, gimple call_stmt, unsigned stmt_uid, gcov_type count_scale,
      	  int freq_scale, bool update_original)): created from cgraph_clone_edge
      	(cgraph_edge *resolve_speculation (tree callee_decl)): created from cgraph_resolve_speculation
      	(bool cannot_lead_to_return_p (void)): created from cannot_lead_to_return_p
      	(bool recursive_p (void)): created from cgraph_edge_recursive_p
      	(bool maybe_hot_p (void)): created from cgraph_maybe_hot_edge_p
      	(static unsigned int rebuild_edges (void)): created from rebuild_cgraph_edges 
      	(static void rebuild_references (void)): created from cgraph_rebuild_references
      	* cgraph.h (symbol_table):
      	(create_reference): renamed from add_reference
      	(maybe_create_reference): renamed from maybe_add_reference
      	(void register_symbol (symtab_node *node)): new function
      	(void clear_asm_symbols (void)): new function
      	(void unregister (symtab_node *node)): new function
      	(void release_symbol (cgraph_node *node, int uid)): new function
      	(cgraph_node * allocate_cgraph_symbol (void)): new function
      	(void initialize (void)): created from cgraph_init
      	(symtab_node *first_symbol (void)):new function
      	(asm_node *first_asm_symbol (void)):new function
      	(symtab_node *first_defined_symbol (void)):new function
      	(varpool_node *first_variable (void)):new function
      	(varpool_node *next_variable (varpool_node *node)):new function
      	(varpool_node *first_static_initializer (void)):new function
      	(varpool_node *next_static_initializer (varpool_node *node)):new function
      	(varpool_node *first_defined_variable (void)):new function
      	(varpool_node *next_defined_variable (varpool_node *node)):new function
      	(cgraph_node *first_defined_function (void)):new function
      	(cgraph_node *next_defined_function (cgraph_node *node)):new function
      	(cgraph_node *first_function (void)):new function
      	(cgraph_node *next_function (cgraph_node *node)):new function
      	(cgraph_node *first_function_with_gimple_body (void)):new function
      	(asm_node *finalize_toplevel_asm (tree asm_str)): created from add_asm_node
      	(bool remove_unreachable_nodes (bool before_inlining_p, FILE *file)):
      	  created from symtab_remove_unreachable_nodes
      	(void remove_unreferenced_decls (void)): created from varpool_remove_unreferenced_decls
      	(void process_new_functions (void)): created from cgraph_process_new_functions
      	(void process_same_body_aliases (void)): created from cgraph_process_same_body_aliases
      	(bool output_variables (void)): created from varpool_node::output_variables
      	(void output_asm_statements (void)): created from output_asm_statements
      	(void finalize_compilation_unit (void)): created from finalize_compilation_unit
      	(void compile (void)): created from compile
      	(void output_weakrefs (void)): created from output_weakrefs
      	(cgraph_node *create_empty (void)): created from cgraph_node::create_empty
      	(cgraph_edge *create_edge (cgraph_node *caller, cgraph_node *callee, gimple call_stmt,
      	  gcov_type count, int freq, bool indir_unknown_callee)): created from cgraph_node::create_edge
      	(void free_edge (cgraph_edge *e)): created from cgraph_free_edge
      	(cgraph_node *next_function_with_gimple_body (cgraph_node *node)):
      	  created from cgraph_next_function_with_gimple_body
      	(void remove_edge_removal_hook (cgraph_edge_hook_list *)):
      	  created from cgraph_remove_edge_removal_hook
      	(cgraph_node_hook_list *add_cgraph_removal_hook (cgraph_node_hook, void *)):
      	  created from cgraph_add_node_removal_hook
      	(void remove_cgraph_removal_hook (cgraph_node_hook_list *)):
      	  created from cgraph_remove_node_removal_hook
      	(varpool_node_hook_list *add_varpool_removal_hook (varpool_node_hook, void *)):
      	  created from varpool_add_node_removal_hook
      	(void remove_varpool_removal_hook (varpool_node_hook_list *)):
      	  created from varpool_remove_node_removal_hook
      	(cgraph_node_hook_list *add_cgraph_insertion_hook (cgraph_node_hook, void *)):
      	  created from cgraph_add_function_insertion_hook
      	(void remove_cgraph_insertion_hook (cgraph_node_hook_list *)):
      	  created from cgraph_remove_function_insertion_hook
      	(varpool_node_hook_list *add_varpool_insertion_hook (varpool_node_hook, void *)):
      	  created from varpool_add_variable_insertion_hook
      	(void remove_varpool_insertion_hook (varpool_node_hook_list *)):
      	  created from varpool_remove_variable_insertion_hook
      	(cgraph_2edge_hook_list *add_edge_duplication_hook (cgraph_2edge_hook, void *)):
      	  created from cgraph_add_edge_duplication_hook
      	(void remove_edge_duplication_hook (cgraph_2edge_hook_list *)):
      	  created from cgraph_remove_edge_duplication_hook
      	(cgraph_2node_hook_list *add_cgraph_duplication_hook (cgraph_2node_hook, void *)):
      	  created from cgraph_add_node_duplication_hook
      	(void remove_cgraph_duplication_hook (cgraph_2node_hook_list *)):
      	  created from cgraph_remove_node_duplication_hook
      	(void call_edge_removal_hooks (cgraph_edge *e)):
      	  created from cgraph_call_edge_removal_hooks
      	(void call_cgraph_insertion_hooks (cgraph_node *node)):
      	  created from call_function_insertion_hooks 
      	(void call_cgraph_removal_hooks (cgraph_node *node)):
      	  created from cgraph_call_node_removal_hooks 
      	(void call_cgraph_duplication_hooks (cgraph_node *node, cgraph_node *node2)):
      	  created from cgraph_node::call_duplication_hooks 
      	(void call_edge_duplication_hooks (cgraph_edge *cs1, cgraph_edge *cs2)):
      	  created from cgraph_call_edge_duplication_hooks
      	(void call_varpool_removal_hooks (varpool_node *node)):
      	  created from varpool_call_node_removal_hooks
      	(void call_varpool_insertion_hooks (varpool_node *node)):
      	  created from varpool_call_variable_insertion_hooks
      	(void insert_to_assembler_name_hash (symtab_node *node, bool with_clones)):
      	  created from insert_to_assembler_name_hash
      	(void unlink_from_assembler_name_hash (symtab_node *node, bool with_clones)):
      	  created from unlink_from_assembler_name_hash
      	(void symtab_prevail_in_asm_name_hash (symtab_node *node)):
      	  created from symtab_prevail_in_asm_name_hash
      	(void symtab_initialize_asm_name_hash (void)):
      	  created from symtab_initialize_asm_name_hash
      	(void change_decl_assembler_name (tree decl, tree name)):
      	  created from change_decl_assembler_name
      	(void materialize_all_clones (void)): created from cgraph_materialize_all_clones
      	(static hashval_t decl_assembler_name_hash (const_tree asmname)):
      	  created from decl_assembler_name_hash
      	(static bool decl_assembler_name_equal (tree decl, const_tree asmname)):
      	  created from decl_assembler_name_equal
      	(static hashval_t hash_node_by_assembler_name (const void *p)):
      	  created from hash_node_by_assembler_name
      	(static int eq_assembler_name (const void *p1, const void *p2)):
      	  created from eq_assembler_name
      
      From-SVN: r214422
      Martin Liska committed
  6. 22 Aug, 2014 2 commits
    • re PR c++/62199 (ICE with -Wlogical-not-parentheses) · 59ea0364
      	PR c++/62199
      	* doc/invoke.texi: Update -Wlogical-not-parentheses description.
      c-family/
      	* c-common.c (warn_logical_not_parentheses): Don't check LHS.  Don't
      	check for vector types.  Drop LHS argument.
      	* c-common.h (warn_logical_not_parentheses): Adjust.
      c/
      	* c-typeck.c (parser_build_binary_op): Adjust call to
      	warn_logical_not_parentheses.
      cp/
      	* parser.c (cp_parser_binary_expression): Check each LHS if it's
      	preceded with logical not.  Adjust call to
      	warn_logical_not_parentheses.
      testsuite/
      	* c-c++-common/pr62199.c: New test.
      	* c-c++-common/pr62199-2.c: New test.
      	* g++.dg/warn/Wparentheses-25.C: Drop XFAILs.
      
      From-SVN: r214360
      Marek Polacek committed
    • re PR other/62008 (CilkPlus Array Notation ICE in build_array_notation_ref when… · 671a475e
      re PR other/62008 (CilkPlus Array Notation ICE in build_array_notation_ref when trying to build  a multidimensional array from a pointer.)
      
      PR other/62008
      gcc/c/
      	* c-parser.c (c_parser_array_notation): Check for correct
      	type of an array added.
      
      gcc/cp/
      	* cp-array-notation.c (build_array_notation_ref): Added correct
      	handling of case with incorrect array.
      
      gcc/testsuite/
      	* c-c++-common/cilk-plus/AN/pr62008.c: New test.
      
      From-SVN: r214305
      Igor Zamyatin committed
  7. 19 Aug, 2014 4 commits
    • re PR c++/62153 (warn for bool expression compared with integer different from 0/1) · 04159acf
      	PR c++/62153
      	* doc/invoke.texi: Document -Wbool-compare.
      c-family/
      	* c-common.c (maybe_warn_bool_compare): New function.
      	* c-common.h (maybe_warn_bool_compare): Declare.
      	* c.opt (Wbool-compare): New option.
      c/
      	* c-typeck.c (build_binary_op): If either operand of a comparison
      	is a boolean expression, call maybe_warn_bool_compare.
      cp/
      	* call.c (build_new_op_1): Remember the type of arguments for
      	a comparison.  If either operand of a comparison is a boolean
      	expression, call maybe_warn_bool_compare.
      testsuite/
      	* c-c++-common/Wbool-compare-1.c: New test.
      
      From-SVN: r214183
      Marek Polacek committed
    • re PR c/45584 (typeof with casting from const to non-const does not work properly) · c77935ee
      2014-08-19  Patrick Palka  <ppalka@gcc.gnu.org>
      
      	PR c/45584
      	* c-typeck.c (build_c_cast): Do a conversion even when the
      	TYPE_MAIN_VARIANTs are the same.
      
      2014-08-19  Patrick Palka  <ppalka@gcc.gnu.org>
      
      	PR c/45584
      	* gcc.dg/pr13519-1.c: Adjust.
      
      From-SVN: r214151
      Patrick Palka committed
    • invoke.texi: Document -Wc99-c11-compat. · 35aff4fb
      	* doc/invoke.texi: Document -Wc99-c11-compat.
      c-family/
      	* c.opt (Wc99-c11-compat): New option.
      c/
      	* c-decl.c (diagnose_mismatched_decls): Unconditionally call
      	pedwarn_c99 instead of pedwarn.
      	(grokfield): Likewise.
      	(warn_defaults_to): New function.
      	(grokdeclarator): Call warn_defaults_to instead of pedwarn_c99.
      	Unconditionally call pedwarn_c99 instead of pedwarn.
      	(start_function): Call warn_defaults_to instead of pedwarn_c99.
      	(declspecs_add_scspec): Call pedwarn_c99 instead of pedwarn, don't
      	check flag_isoc11 before.
      	* c-errors.c (pedwarn_c99): Change the return type to bool.
      	Handle -Wc99-c11-compat.
      	* c-parser.c (disable_extension_diagnostics): Handle
      	warn_c99_c11_compat.
      	(restore_extension_diagnostics): Likewise.
      	(c_parser_static_assert_declaration_no_semi): Call pedwarn_c99
      	instead of pedwarn, don't check flag_isoc11 before.
      	(c_parser_declspecs): Likewise.
      	(c_parser_alignas_specifier): Likewise.
      	(c_parser_alignof_expression): Likewise.
      	(c_parser_generic_selection): Likewise.
      	* c-tree.h (pedwarn_c99): Update declaration.
      	* c-typeck.c (c_finish_return): Call pedwarn or warning_at instead
      	of pedwarn_c99.
      testsuite/
      	* gcc.dg/Wc99-c11-compat-1.c: New test.
      	* gcc.dg/Wc99-c11-compat-2.c: New test.
      	* gcc.dg/Wc99-c11-compat-3.c: New test.
      	* gcc.dg/Wc99-c11-compat-4.c: New test.
      	* gcc.dg/Wc99-c11-compat-5.c: New test.
      	* gcc.dg/Wc99-c11-compat-6.c: New test.
      	* gcc.dg/Wc99-c11-compat-7.c: New test.
      
      From-SVN: r214133
      Marek Polacek committed
    • c-opts.c (sanitize_cpp_opts): Make warn_long_long be set according to warn_c90_c99_compat. · 177cce46
      gcc/c-family/
      	* c-opts.c (sanitize_cpp_opts): Make warn_long_long be set according
      	to warn_c90_c99_compat.
      	* c.opt (Wc90-c99-compat, Wdeclaration-after-statement): Initialize
      	to -1.
      gcc/c/
      	* c-decl.c (warn_variable_length_array): Pass OPT_Wvla unconditionally
      	to pedwarn_c90.
      	* c-errors.c: Include "opts.h".
      	(pedwarn_c90): Rewrite to handle -Wno-c90-c99-compat better.
      	* c-parser.c (disable_extension_diagnostics): Handle negative value
      	of warn_c90_c99_compat, too.
      	(restore_extension_diagnostics): Likewise.
      	(c_parser_compound_statement_nostart): Pass
      	OPT_Wdeclaration_after_statement unconditionally to pedwarn_c90.
      gcc/testsuite/
      	* gcc.dg/Wc90-c99-compat-4.c: Remove all dg-warnings.
      	* gcc.dg/Wc90-c99-compat-5.c: Remove all dg-errors.
      	* gcc.dg/Wc90-c99-compat-7.c: New test.
      	* gcc.dg/Wc90-c99-compat-8.c: New test.
      	* gcc.dg/Wdeclaration-after-statement-4.c: New test.
      libcpp/
      	* charset.c (_cpp_valid_ucn): Warn only if -Wc90-c99-compat.
      	* lex.c (_cpp_lex_direct): Likewise.
      	* macro.c (replace_args): Likewise.
      	(parse_params): Likewise.
      	* include/cpplib.h (cpp_options): Change cpp_warn_c90_c99_compat
      	to char.
      
      From-SVN: r214131
      Marek Polacek committed
  8. 12 Aug, 2014 1 commit
    • c-parser.c (c_parser_postfix_expression): Add pedwarn. · 6dc99c33
      	* c-parser.c (c_parser_postfix_expression) <case RID_FUNCTION_NAME>:
      	Add pedwarn.
      	(c_parser_postfix_expression) <case RID_PRETTY_FUNCTION_NAME>:
      	Likewise.
      	(c_parser_postfix_expression) <case RID_C99_FUNCTION_NAME>: Likewise.
      
      	* gcc.dg/concat.c: Add dg-options.
      	* gcc.dg/func-outside-2.c: Add __extension__.
      	* gcc.dg/pr19967.c: Use -std=c99.
      	* gcc.dg/pr22458-1.c: Add dg-options.
      	* gcc.dg/pr33676.c: Add dg-options.
      	* gcc.dg/gnu-predef-1.c: New test.
      	* gcc.dg/c90-func-1.c: New test.
      	* gcc.dg/c90-func-2.c: New test.
      	* gcc.dg/c90-func-2.h: New test.
      
      From-SVN: r213875
      Marek Polacek committed
  9. 10 Aug, 2014 1 commit
    • re PR c/51849 (-Wc99-compat would be considered useful) · f3bede71
      	PR c/51849
      gcc/
      	* gcc/doc/invoke.texi: Document -Wc90-c99-compat.
      gcc/c-family/
      	* c-opts.c (sanitize_cpp_opts): Pass warn_c90_c99_compat to libcpp.
      	* c.opt (Wc90-c99-compat): Add option.
      gcc/c/
      	* c-decl.c (build_array_declarator): Remove check for !flag_isoc99.
      	Call pedwarn_c90 instead of pedwarn.
      	(check_bitfield_type_and_width): Likewise.
      	(declspecs_add_qual): Likewise.
      	(declspecs_add_type): Likewise.
      	(warn_variable_length_array): Unify function for -pedantic and -Wvla.
      	Adjust to only call pedwarn_c90.
      	(grokdeclarator): Remove pedantic && !flag_isoc99 check.  Call
      	pedwarn_c90 instead of pedwarn.
      	* c-errors.c (pedwarn_c90): Handle -Wc90-c99-compat.
      	* c-parser.c (disable_extension_diagnostics): Handle
      	warn_c90_c99_compat.
      	(restore_extension_diagnostics): Likewise.
      	(c_parser_enum_specifier): Remove check for !flag_isoc99.  Call
      	pedwarn_c90 instead of pedwarn.
      	(c_parser_initelt): Likewise.
      	(c_parser_postfix_expression): Likewise.
      	(c_parser_postfix_expression_after_paren_type): Likewise.
      	(c_parser_compound_statement_nostart): Remove check for !flag_isoc99.
      	* c-tree.h: Fix formatting.
      	* c-typeck.c (build_array_ref): Remove check for !flag_isoc99.  Call
      	pedwarn_c90 instead of pedwarn.
      gcc/testsuite/
      	* gcc.dg/Wc90-c99-compat-1.c: New test.
      	* gcc.dg/Wc90-c99-compat-2.c: New test.
      	* gcc.dg/Wc90-c99-compat-3.c: New test.
      	* gcc.dg/Wc90-c99-compat-4.c: New test.
      	* gcc.dg/Wc90-c99-compat-5.c: New test.
      	* gcc.dg/Wc90-c99-compat-6.c: New test.
      	* gcc.dg/wvla-1.c: Adjust dg-warning.
      	* gcc.dg/wvla-2.c: Adjust dg-warning.
      	* gcc.dg/wvla-4.c: Adjust dg-warning.
      	* gcc.dg/wvla-6.c: Adjust dg-warning.
      libcpp/
      	* lex.c (_cpp_lex_direct): Warn when -Wc90-c99-compat is in effect.
      	* charset.c (_cpp_valid_ucn): Likewise.
      	* include/cpplib.h (cpp_options): Add cpp_warn_c90_c99_compat.
      	* macro.c (replace_args): Warn when -Wc90-c99-compat is in effect.
      	(parse_params): Likewise.
      
      From-SVN: r213786
      Marek Polacek committed
  10. 07 Aug, 2014 2 commits
    • remove pointer-set.[ch] · 9f25a338
      gcc/
      
      	* Makefile.in: Remove references to pointer-set.c and pointer-set.h.
      	* alias.c, cfgexpand.c, cgraphbuild.c,
      	config/aarch64/aarch64-builtins.c, config/aarch64/aarch64.c,
      	config/alpha/alpha.c, config/darwin.c, config/i386/i386.c,
      	config/i386/winnt.c, config/ia64/ia64.c, config/m32c/m32c.c,
      	config/mep/mep.c, config/mips/mips.c, config/rs6000/rs6000.c,
      	config/s390/s390.c, config/sh/sh.c, config/sparc/sparc.c,
      	config/spu/spu.c, config/stormy16/stormy16.c, config/tilegx/tilegx.c,
      	config/tilepro/tilepro.c, config/xtensa/xtensa.c, dominance.c,
      	dse.c, except.c, gengtype.c, gimple-expr.c,
      	gimple-ssa-strength-reduction.c, gimplify.c, ifcvt.c,
      	ipa-visibility.c, lto-streamer.h, omp-low.c, predict.c, stmt.c,
      	tree-affine.c, tree-cfg.c, tree-eh.c, tree-inline.c, tree-nested.c,
      	tree-scalar-evolution.c, tree-ssa-loop-im.c, tree-ssa-loop-niter.c,
      	tree-ssa-phiopt.c, tree-ssa-structalias.c, tree-ssa-uninit.c,
      	tree-ssa.c, tree.c, var-tracking.c, varpool.c: Remove includes of
      	pointer-set.h.
      	* pointer-set.c: Remove file.
      	* pointer-set.h: Remove file.
      
      gcc/c-family/
      
      	* c-gimplify.c, cilk.c: Remove includes of pointer-set.h.
      
      gcc/c/
      
      	* c-typeck.c: Remove include of pointer-set.h.
      
      gcc/cp/
      
      	* class.c, cp-gimplify.c, decl.c, decl2.c, error.c, method.c,
      	optimize.c, pt.c, semantics.c: Remove includes of pointer-set.h.
      
      From-SVN: r213738
      Trevor Saunders committed
    • fold-const.c (fold_binary_loc): Add folding of (PTR0 - (PTR1 p+ A) -> (PTR0 - PTR1) - A. · 044331a8
      	* fold-const.c (fold_binary_loc): Add folding of 
      	(PTR0 - (PTR1 p+ A) -> (PTR0 - PTR1) - A.
      c/
      	* c-typeck.c (pointer_diff): Remove P - (P + CST) optimization.
      testsuite/
      	* gcc.dg/fold-reassoc-3.c: New test.
      
      From-SVN: r213700
      Marek Polacek committed
  11. 02 Aug, 2014 2 commits
    • convert many uses of pointer_map to hash_map · b787e7a2
      gcc/c-family/
      
      	* cilk.c: Use hash_map instead of pointer_map.
      
      gcc/c/
      
      	* c-typeck.c: Use hash_map instead of pointer_map.
      
      gcc/cp/
      
      	* optimize.c, semantics.c: Use hash_map instead of pointer_map.
      
      gcc/
      
      	* hash-map.h (default_hashmap_traits::mark_key_deleted):
      	Fix cast.
      	(hash_map::remove): New method.
      (hash_map::traverse): New method.
      	* cgraph.h, except.c, except.h, gimple-ssa-strength-reduction.c,
      	ipa-utils.c, lto-cgraph.c, lto-streamer.h, omp-low.c, predict.c,
      	tree-cfg.c, tree-cfgcleanup.c, tree-eh.c, tree-eh.h, tree-inline.c,
      	tree-inline.h, tree-nested.c, tree-sra.c, tree-ssa-loop-im.c,
      	tree-ssa-loop-ivopts.c, tree-ssa-reassoc.c, tree-ssa-structalias.c,
      	tree-ssa.c, tree-ssa.h, var-tracking.c: Use hash_map instead of
       pointer_map.
      
      From-SVN: r213517
      Trevor Saunders committed
    • add a hash_set based on hash_table · 6e2830c3
      This allows us to replace the usage of pointer_set outside of
      pointer_map with a nicer interface.
      
      gcc/ada/
      
      	* gcc-interface/trans.c: Use hash_set instead of pointer_set.
      
      gcc/c-family/
      
      	* c-gimplify.c: Use hash_set instead of pointer_set.
      
      gcc/c/
      
      	* c-decl.c: Use hash_set instead of pointer_set.
      
      gcc/cp/
      
      	* class.c, cp-gimplify.c, cp-tree.h, decl.c, decl2.c, error.c,
      	method.c, name-lookup.c, pt.c, semantics.c, tree.c: Use hash_set
      	instead of pointer_set.
      
      gcc/fortran/
      
      	* openmp.c, trans-decl.c: Use hash_set instead of pointer_set.
      
      gcc/
      
      	* hash-set.h: new File.
      	* cfgexpand.c, cfgloop.c, cgraph.c, cgraphbuild.c, cgraphunit.c,
      	cprop.c, cse.c, gimple-walk.c, gimple-walk.h, gimplify.c, godump.c,
      	ipa-devirt.c, ipa-pure-const.c, ipa-visibility.c, ipa.c, lto-cgraph.c,
      	lto-streamer-out.c, stmt.c, tree-cfg.c, tree-core.h, tree-eh.c,
      	tree-inline.c, tree-inline.h, tree-nested.c, tree-pretty-print.c,
      	tree-ssa-loop-niter.c, tree-ssa-phiopt.c, tree-ssa-threadedge.c,
      	tree-ssa-uninit.c, tree.c, tree.h, value-prof.c, varasm.c,
      	varpool.c: Use hash_set instead of pointer_set.
      
      gcc/lto/
      
      	* lto-partition.c, lto-partition.h: Use hash_set instead of
      	pointer_set.
      
      From-SVN: r213516
      Trevor Saunders committed
  12. 01 Aug, 2014 1 commit
  13. 31 Jul, 2014 1 commit
    • re PR c++/60517 (warning/error for taking address of member of a temporary object) · b4dfdc11
      2014-07-31  Marc Glisse  <marc.glisse@inria.fr>
      
      	PR c++/60517
      gcc/c/
      	* c-typeck.c (c_finish_return): Return 0 instead of the address of
      	a local variable.
      gcc/cp/
      	* typeck.c (maybe_warn_about_returning_address_of_local): Return
      	whether it is returning the address of a local variable.
      	(check_return_expr): Return 0 instead of the address of a local
      	variable.
      gcc/c-family/
      	* c.opt (-Wreturn-local-addr): Move to common.opt.
      gcc/
      	* common.opt (-Wreturn-local-addr): Moved from c.opt.
      	* gimple-ssa-isolate-paths.c: Include diagnostic-core.h and intl.h.
      	(isolate_path): New argument to avoid inserting a trap.
      	(find_implicit_erroneous_behaviour): Handle returning the address
      	of a local variable.
      	(find_explicit_erroneous_behaviour): Likewise.
      gcc/testsuite/
      	* c-c++-common/addrtmp.c: New file.
      	* c-c++-common/uninit-G.c: Adapt.
      
      From-SVN: r213323
      Marc Glisse committed
  14. 30 Jul, 2014 1 commit
    • re PR c/59855 (Support sparse-style __attribute__((designated_init)) on… · 976d5a22
      re PR c/59855 (Support sparse-style __attribute__((designated_init)) on structures, requiring designated initializers)
      
      2014-07-30  Tom Tromey  <tromey@redhat.com>
      
      	PR c/59855
      	* doc/invoke.texi (Warning Options): Document -Wdesignated-init.
      	* doc/extend.texi (Type Attributes): Document designated_init
      	attribute.
      
      2014-07-30  Tom Tromey  <tromey@redhat.com>
      
      	PR c/59855
      	* c.opt (Wdesignated-init): New option.
      	* c-common.c (c_common_attribute_table): Add "designated_init".
      	(handle_designated_init): New function.
      
      2014-07-30  Tom Tromey  <tromey@redhat.com>
      
      	* c-typeck.c (struct constructor_stack) <designator_depth>: New
      	field.
      	(really_start_incremental_init, push_init_level): Initialize
      	designator_depth.
      	(pop_init_level): Set global designator_depth.
      	(process_init_element): Check for designated_init attribute.
      
      From-SVN: r213293
      Tom Tromey committed
  15. 24 Jul, 2014 1 commit
    • IPA C++ refactoring 1/N · d52f5295
        * cgraph.h (symtab_node):
        (void register_symbol (void)): created from symtab_register_node
        (void remove (void)): created from symtab_remove_node
        (void dump (FILE *f)): created from dump_symtab_node
        (void DEBUG_FUNCTION debug (void)): created from debug_symtab_node
        (void DEBUG_FUNCTION verify (void)): created from verify_symtab_node
        (struct ipa_ref *add_reference (symtab_node *referred_node,
          enum ipa_ref_use use_type)): created from add_reference 
        (struct ipa_ref *add_reference (symtab_node *referred_node,
          enum ipa_ref_use use_type, gimple stmt)): created from add_reference
        (struct ipa_ref *maybe_add_reference (tree val, enum ipa_ref_use use_type,
          gimple stmt)): created from maybe_add_reference
        (bool semantically_equivalent_p (symtab_node *target)): created from
          symtab_semantically_equivalent_p
        (void remove_from_same_comdat_group (void)): created from
          remove_from_same_comdat_group
        (void add_to_same_comdat_group (symtab_node *old_node)): created from
          symtab_add_to_same_comdat_group
        (void dissolve_same_comdat_group_list (void)): created from
          symtab_dissolve_same_comdat_group_list
        (bool used_from_object_file_p (void)): created from symtab_used_from_object_file_p
        (symtab_node *ultimate_alias_target (enum availability *avail = NULL)):
          created from symtab_alias_ultimate_target
        (inline symtab_node *next_defined_symbol (void)): created from
          symtab_next_defined_symbol
        (bool resolve_alias (symtab_node *target)): created from
          symtab_resolve_alias
        (bool call_for_symbol_and_aliases (bool (*callback) (symtab_node *, void *),
          void *data, bool include_overwrite)): created from symtab_for_node_and_aliases
        (symtab_node *noninterposable_alias (void)): created from symtab_nonoverwritable_alias
        (inline symtab_node *get_alias_target (void)): created from symtab_alias_target
        (void set_section (const char *section)): created from set_section_1 
        (enum availability get_availability (void)): created from symtab_node_availability
        (void make_decl_local (void)): created from symtab_make_decl_local
        (bool real_symbol_p (void)): created from symtab_read_node
        (can_be_discarded_p (void)): created from symtab_can_be_discarded
        (inline bool comdat_local_p (void)): created from symtab_comdat_local_p
        (inline bool in_same_comdat_group_p (symtab_node *target)): created from
          symtab_in_same_comdat_p;
        (bool address_taken_from_non_vtable_p (void)): created from
          address_taken_from_non_vtable_p
        (static inline symtab_node *get (const_tree decl)): created from symtab_get_node
        (static void dump_table (FILE *)): created from dump_symtab
        (static inline DEBUG_FUNCTION void debug_symtab (void)): created from debug_symtab
        (static DEBUG_FUNCTION void verify_symtab_nodes (void)): created from verify_symtab
        (static bool used_from_object_file_p_worker (symtab_node *node)): created from
          symtab_used_from_object_file_p 
        (void dump_base (FILE *)): created from dump_symtab_base
        (bool DEBUG_FUNCTION verify_base (void)): created from verify_symtab_base
        (void unregister (void)): created from symtab_unregister_node
        (struct symbol_priority_map *priority_info (void)): created from symtab_priority_info
        (static bool set_implicit_section (symtab_node *n, void *)): created from set_implicit_section
        (static bool noninterposable_alias (symtab_node *node, void *data)): created from
          symtab_nonoverwritable_alias_1
        * cgraph.h (cgraph_node):
        (bool remove_symbol_and_inline_clones (cgraph_node *forbidden_node = NULL)):
          created from cgraph_remove_node_and_inline_clones
        (void record_stmt_references (gimple stmt)): created from ipa_record_stmt_references
        (void set_call_stmt_including_clones (gimple old_stmt, gimple new_stmt,
          bool update_speculative = true)): created from cgraph_set_call_stmt_including_clones
        (cgraph_node *function_symbol (enum availability *avail = NULL)):
          created from cgraph_function_node
        (cgraph_node *create_clone (tree decl, gcov_type count, int freq, bool update_original,
          vec<cgraph_edge *> redirect_callers, bool call_duplication_hook,
          struct cgraph_node *new_inlined_to, bitmap args_to_skip)):
          created from cgraph_create_clone 
        (cgraph_node *create_virtual_clone (vec<cgraph_edge *> redirect_callers,
          vec<ipa_replace_map *, va_gc> *tree_map, bitmap args_to_skip, const char * suffix)):
          created from cgraph_create_virtual_clone
        (cgraph_node *find_replacement (void)): created from cgraph_find_replacement_node
        (cgraph_node *create_version_clone (tree new_decl, vec<cgraph_edge *> redirect_callers,
          bitmap bbs_to_copy)): created from cgraph_copy_node_for_versioning
        (cgraph_node *create_version_clone_with_body (vec<cgraph_edge *> redirect_callers,
          vec<ipa_replace_map *, va_gc> *tree_map, bitmap args_to_skip, bool skip_return,
          bitmap bbs_to_copy, basic_block new_entry_block, const char *clone_name)):
          created from cgraph_function_version_info
        (struct cgraph_function_version_info *insert_new_function_version (void)):
          created from insert_new_cgraph_node_version
        (struct cgraph_function_version_info *function_version (void)): created from
          get_cgraph_node_version
        (void analyze (void)): created from analyze_function
        (cgraph_node * create_thunk (tree alias, tree, bool this_adjusting,
          HOST_WIDE_INT fixed_offset, HOST_WIDE_INT virtual_value, tree virtual_offset,
          tree real_alias) cgraph_add_thunk
        (inline cgraph_node *get_alias_target (void)): created from cgraph_alias_target
        (cgraph_node *ultimate_alias_target (availability *availability = NULL)):
          created from cgraph_function_or_thunk_node
        (bool expand_thunk (bool output_asm_thunks, bool force_gimple_thunk)):
          created from expand_thunk
        (void reset (void)): created from cgraph_reset_node
        (void create_wrapper (cgraph_node *target)): created from cgraph_make_wrapper
        (void DEBUG_FUNCTION verify_node (void)): created from verify_cgraph_node
        (void remove (void)): created from cgraph_remove_node
        (void dump (FILE *f)): created from dump_cgraph_node
        (void DEBUG_FUNCTION debug (void)): created from debug_cgraph_node
        (bool get_body (void)): created from cgraph_get_body
        (void release_body (void)): created from cgraph_release_function_body
        (void unnest (void)): created from cgraph_unnest_node
        (void make_local (void)): created from cgraph_make_node_local
        (void mark_address_taken (void)): created from cgraph_mark_address_taken_node
        (struct cgraph_edge *create_edge (cgraph_node *callee, gimple call_stmt,
          gcov_type count, int freq)): created from cgraph_create_edge
        (struct cgraph_edge *create_indirect_edge (gimple call_stmt, int ecf_flags,
          gcov_type count, int freq)): created from cgraph_create_indirect_edge
        (void create_edge_including_clones (struct cgraph_node *callee, gimple old_stmt,
          gimple stmt, gcov_type count, int freq, cgraph_inline_failed_t reason)):
          created from cgraph_create_edge_including_clones
        (cgraph_edge *get_edge (gimple call_stmt)): created from cgraph_edge
        (vec<cgraph_edge *> collect_callers (void)): created from collect_callers_of_node
        (void remove_callers (void)): created from cgraph_node_remove_callers
        (void remove_callees (void)): created from cgraph_node_remove_callees
        (enum availability get_availability (void)): created from cgraph_function_body_availability
        (void set_nothrow_flag (bool nothrow)): created from cgraph_set_nothrow_flag
        (void set_const_flag (bool readonly, bool looping)): created from cgraph_set_const_flag
        (void set_pure_flag (bool pure, bool looping)): created from cgraph_set_pure_flag
        (void call_duplication_hooks (cgraph_node *node2)): created from
          cgraph_call_node_duplication_hooks
        (bool call_for_symbol_and_aliases (bool (*callback) (cgraph_node *, void *),
          void *data, bool include_overwritable)): created from cgraph_for_node_and_aliases
        (bool call_for_symbol_thunks_and_aliases (bool (*callback) (cgraph_node *node, void *data),
          void *data, bool include_overwritable)): created from cgraph_for_node_thunks_and_aliases
        (void call_function_insertion_hooks (void)):
          created from cgraph_call_function_insertion_hooks
        (inline void mark_force_output (void)): created from cgraph_mark_force_output_node
        (bool local_p (void)): created from cgraph_local_node
        (bool can_be_local_p (void)): created from cgraph_node_can_be_local_p
        (bool cannot_return_p (void)): created from cgraph_node_cannot_return
        (bool only_called_directly_p (void)): created from cgraph_only_called_directly_p
        (inline bool only_called_directly_or_aliased_p (void)):
          created from cgraph_only_called_directly_or_aliased_p
        (bool will_be_removed_from_program_if_no_direct_calls_p (void)):
          created from cgraph_will_be_removed_from_program_if_no_direct_calls
        (bool can_remove_if_no_direct_calls_and_refs_p (void)):
          created from cgraph_can_remove_if_no_direct_calls_and_refs_p
        (bool can_remove_if_no_direct_calls_p (void)):
          created from cgraph_can_remove_if_no_direct_calls_p
        (inline bool has_gimple_body_p (void)):
          created from cgraph_function_with_gimple_body_p
        (bool optimize_for_size_p (void)): created from cgraph_optimize_for_size_p
        (static void dump_cgraph (FILE *f)): created from dump_cgraph
        (static inline void debug_cgraph (void)): created from debug_cgraph
        (static void record_function_versions (tree decl1, tree decl2)):
          created from record_function_versions
        (static void delete_function_version (tree decl)):
          created from delete_function_version
        (static void add_new_function (tree fndecl, bool lowered)):
          created from cgraph_add_new_function
        (static inline cgraph_node *get (const_tree decl)): created from cgraph_get_node
        (static cgraph_node * create (tree decl)): created from cgraph_create_node
        (static cgraph_node * create_empty (void)): created from cgraph_create_empty_node
        (static cgraph_node * get_create (tree)): created from cgraph_get_create_node
        (static cgraph_node *get_for_asmname (tree asmname)):
          created from cgraph_node_for_asm
        (static cgraph_node * create_same_body_alias (tree alias, tree decl)):
          created from cgraph_same_body_alias 
        (static bool used_from_object_file_p_worker (cgraph_node *node,
          void *): new function
        (static bool non_local_p (cgraph_node *node, void *)):
          created from cgraph_non_local_node_p_1
        (static void DEBUG_FUNCTION verify_cgraph_nodes (void)):
          created from verify_cgraph
        (static bool make_local (cgraph_node *node, void *)):
          created from cgraph_make_node_local
        (static cgraph_node *create_alias (tree alias, tree target)):
          created from cgraph_create_function_alias
        (static cgraph_edge * create_edge (cgraph_node *caller, cgraph_node *callee,
          gimple call_stmt, gcov_type count, int freq, bool indir_unknown_callee)):
          created from cgraph_create_edge_1
        * cgraph.h (varpool_node):
        (void remove (void)): created from varpool_remove_node
        (void dump (FILE *f)): created from dump_varpool_node
      
      From-SVN: r212982
      Martin Liska committed
  16. 20 Jul, 2014 1 commit
  17. 14 Jul, 2014 1 commit
    • re PR middle-end/61294 (erroneous memset used with constant zero length parameter warning) · b108f48f
      	PR middle-end/61294
      gcc/c-family/
      	* c.opt (Wmemset-transposed-args): New warning.
      gcc/c/
      	* c-parser.c (c_parser_expr_list): Add new argument literal_zero_mask.
      	If non-NULL, call c_parser_check_literal_zero.
      	(c_parser_check_literal_zero): New function.
      	(c_parser_postfix_expression_after_primary): Adjust
      	c_parser_expr_list caller, handle -Wmemset-transposed-args.
      gcc/cp/
      	* cp-tree.h (LITERAL_ZERO_P): Define.
      	* parser.c (cp_parser_parenthesized_expression_list): Add
      	want_literal_zero_p argument, if true, for literal zeros
      	insert INTEGER_CSTs with LITERAL_ZERO_P flag set.
      	(cp_parser_postfix_expression): Adjust
      	cp_parser_parenthesized_expression_list caller, handle
      	-Wmemset-transposed-args.
      	(literal_zeros): New variable.
      gcc/
      	* doc/invoke.texi (-Wmemset-transposed-args): Document.
      gcc/testsuite/
      	* c-c++-common/Wmemset-transposed-args1.c: New test.
      	* c-c++-common/Wmemset-transposed-args2.c: New test.
      	* g++.dg/warn/Wmemset-transposed-args-1.C: New test.
      
      From-SVN: r212510
      Jakub Jelinek committed
  18. 06 Jul, 2014 1 commit
    • re PR c/6940 (taking sizeof array parameter should trigger a warning) · 773ec47f
      	PR c/6940
      	* doc/invoke.texi: Document -Wsizeof-array-argument.
      c-family/
      	* c.opt (Wsizeof-array-argument): New option.
      c/
      	* c-decl.c (grokdeclarator): Set C_ARRAY_PARAMETER.
      	* c-tree.h (C_ARRAY_PARAMETER): Define.
      	* c-typeck.c (c_expr_sizeof_expr): Warn when using sizeof on an array
      	function parameter.
      cp/
      	* cp-tree.h (DECL_ARRAY_PARAMETER_P): Define.
      	* decl.c (grokdeclarator): Set DECL_ARRAY_PARAMETER_P.
      	* typeck.c (cxx_sizeof_expr): Warn when using sizeof on an array
      	function parameter.
      testsuite/
      	* c-c++-common/Wsizeof-pointer-memaccess1.c: Use
      	-Wno-sizeof-array-argument.
      	* c-c++-common/Wsizeof-pointer-memaccess2.c: Likewise.
      	* g++.dg/warn/Wsizeof-pointer-memaccess-1.C: Likewise.
      	* gcc.dg/Wsizeof-pointer-memaccess1.c: Likewise.
      	* g++.dg/torture/Wsizeof-pointer-memaccess1.C: Likewise.
      	* g++.dg/torture/Wsizeof-pointer-memaccess2.C: Likewise.
      	* gcc.dg/torture/Wsizeof-pointer-memaccess1.c: Likewise.
      	* c-c++-common/sizeof-array-argument.c: New test.
      	* gcc.dg/vla-5.c: Add dg-warnings.
      ../libgomp/	* testsuite/libgomp.c/appendix-a/a.29.1.c (f): Add dg-warnings.
      
      From-SVN: r212312
      Marek Polacek committed
  19. 02 Jul, 2014 1 commit
  20. 01 Jul, 2014 2 commits
  21. 30 Jun, 2014 2 commits
    • convert.c (convert_to_integer): Don't instrument conversions if the function has… · 6a7253a4
      convert.c (convert_to_integer): Don't instrument conversions if the function has no_sanitize_undefined attribute.
      
      	* convert.c (convert_to_integer): Don't instrument conversions if the
      	function has no_sanitize_undefined attribute.
      	* ubsan.c: Don't run the ubsan pass if the function has
      	no_sanitize_undefined attribute.
      c/
      	* c-decl.c (grokdeclarator): Don't instrument VLAs if the function
      	has no_sanitize_undefined attribute.
      cp/
      	* cp-gimplify.c (cp_genericize): Don't instrument returns if the
      	function has no_sanitize_undefined attribute.
      	* decl.c (compute_array_index_type): Don't instrument VLAs if the
      	function has no_sanitize_undefined attribute.
      testsuite/
      	* c-c++-common/ubsan/attrib-2.c: New test.
      	* g++.dg/ubsan/return-3.C: New test.
      
      From-SVN: r212148
      Marek Polacek committed
    • re PR middle-end/57541 ([Cilkplus]: internal compiler error: in gimplify_expr, at gimplify.c:7809) · 5e88a8f4
      PR middle-end/57541
      gcc/c/
      	* c-array-notation.c (fix_builtin_array_notation_fn):
      	Check for 0 arguments in builtin call. Check that bultin argument is
      	correct.
      	* c-parser.c (c_parser_array_notation): Check for incorrect initial
      	index.
      
      gcc/cpp/
      	* cp-array-notation.c (expand_sec_reduce_builtin):
      	Check that bultin argument is correct.
      	* call.c (build_cxx_call): Check for 0 arguments in builtin call.
      
      gcc/testsuite/
      	* c-c++-common/cilk-plus/AN/pr57541.c: New case added.
      	* c-c++-common/cilk-plus/AN/pr57541-2.c: New test.
      
      From-SVN: r212138
      Igor Zamyatin committed
  22. 27 Jun, 2014 1 commit
  23. 25 Jun, 2014 2 commits
    • re PR c/61162 (possibly bad error location with -Wc++-compat) · 6e07c515
      	PR c/61162
      	* c-parser.c (c_parser_statement_after_labels): Pass the location of
      	the return expression to c_finish_return.
      
      	* gcc.dg/pr61162.c: Adjust dg-warning.
      	* gcc.dg/pr61162-2.c: New test.
      
      From-SVN: r211978
      Marek Polacek committed
    • langhooks-def.h (LANG_HOOKS_OMP_CLAUSE_LINEAR_CTOR): Define. · da6f124d
      	* langhooks-def.h (LANG_HOOKS_OMP_CLAUSE_LINEAR_CTOR): Define.
      	(LANG_HOOKS_DECLS): Add it.
      	* gimplify.c (gimplify_omp_for): Make sure OMP_CLAUSE_LINEAR_STEP
      	has correct type.
      	* tree.h (OMP_CLAUSE_LINEAR_ARRAY): Define.
      	* langhooks.h (struct lang_hooks_for_decls): Add
      	omp_clause_linear_ctor hook.
      	* omp-low.c (lower_rec_input_clauses): Set max_vf even if
      	OMP_CLAUSE_LINEAR_ARRAY is set.  Don't fold_convert
      	OMP_CLAUSE_LINEAR_STEP.  For OMP_CLAUSE_LINEAR_ARRAY in
      	combined simd loop use omp_clause_linear_ctor hook.
      gcc/c/
      	* c-typeck.c (c_finish_omp_clauses): Make sure
      	OMP_CLAUSE_LINEAR_STEP has correct type.
      gcc/cp/
      	* semantics.c (finish_omp_clauses): Make sure
      	OMP_CLAUSE_LINEAR_STEP has correct type.
      gcc/fortran/
      	* trans.h (gfc_omp_clause_linear_ctor): New prototype.
      	* trans-openmp.c (gfc_omp_linear_clause_add_loop,
      	gfc_omp_clause_linear_ctor): New functions.
      	(gfc_trans_omp_clauses): Make sure OMP_CLAUSE_LINEAR_STEP has
      	correct type.  Set OMP_CLAUSE_LINEAR_ARRAY flag if needed.
      	* f95-lang.c (LANG_HOOKS_OMP_CLAUSE_LINEAR_CTOR): Redefine.
      libgomp/
      	* testsuite/libgomp.fortran/simd5.f90: New test.
      	* testsuite/libgomp.fortran/simd6.f90: New test.
      	* testsuite/libgomp.fortran/simd7.f90: New test.
      
      From-SVN: r211971
      Jakub Jelinek committed
  24. 24 Jun, 2014 2 commits
    • Remove a layer of indirection from hash_table · c203e8a7
      gcc/
      
      	* hash-table.h: Remove a layer of indirection from hash_table so that
      	it contains the hash table's data instead of a pointer to the data.
      	* alloc-pool.c, asan.c, attribs.c, bitmap.c, cfg.c,
      	config/arm/arm.c, config/i386/winnt.c, config/ia64/ia64.c,
      	config/mips/mips.c, config/sol2.c, coverage.c, cselib.c,
      	data-streamer-out.c, dse.c, dwarf2cfi.c, dwarf2out.c, except.c,
      	fold-const.c, gcse.c, ggc-common.c,
      	gimple-ssa-strength-reduction.c, gimplify.c,
      	graphite-clast-to-gimple.c, graphite-dependences.c,
      	graphite-htab.h, graphite.c, haifa-sched.c, ipa-devirt.c,
      	ipa-profile.c, ira-color.c, ira-costs.c, loop-invariant.c,
      	loop-iv.c, loop-unroll.c, lto-streamer-in.c, lto-streamer-out.c,
      	lto-streamer.c, lto-streamer.h, passes.c, plugin.c,
      	postreload-gcse.c, sese.c, statistics.c, store-motion.c,
      	trans-mem.c, tree-browser.c, tree-cfg.c, tree-complex.c,
      	tree-eh.c, tree-into-ssa.c, tree-parloops.c, tree-sra.c,
      	tree-ssa-ccp.c, tree-ssa-coalesce.c, tree-ssa-dom.c,
      	tree-ssa-live.c, tree-ssa-loop-im.c,
      	tree-ssa-loop-ivopts.c, tree-ssa-phiopt.c, tree-ssa-pre.c,
      	tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-ssa-strlen.c,
      	tree-ssa-structalias.c, tree-ssa-tail-merge.c,
      	tree-ssa-threadupdate.c, tree-ssa-uncprop.c,
      tree-vect-data-refs.c, tree-vect-loop.c, tree-vectorizer.c,
      tree-vectorizer.h, valtrack.c, valtrack.h, var-tracking.c,
      vtable-verify.c, vtable-verify.h: Adjust.
      
      gcc/c/
      
      	* c-decl.c: Adjust.
      
      gcc/cp/
      
      	* class.c, semantics.c, tree.c, vtable-class-hierarchy.c:
      	Adjust.
      
      gcc/java/
      
      	* jcf-io.c: Adjust.
      
      gcc/lto/
      
      	* lto.c: Adjust.
      
      gcc/objc/
      
      	* objc-act.c: Adjust.
      
      From-SVN: r211936
      Trevor Saunders committed
    • gimplify.c (gimplify_omp_for): For #pragma omp for simd iterator not mentioned… · 56ad0e38
      gimplify.c (gimplify_omp_for): For #pragma omp for simd iterator not mentioned in clauses use private clause if...
      
      	* gimplify.c (gimplify_omp_for): For #pragma omp for simd iterator
      	not mentioned in clauses use private clause if the iterator is
      	declared in #pragma omp for simd, and when adding lastprivate
      	instead, add it to the outer #pragma omp for too.  Diagnose
      	if the variable is private in outer context.  For simd collapse > 1
      	loops, replace all iterators with temporaries.
      	* omp-low.c (lower_rec_input_clauses): Handle LINEAR clause the
      	same even in collapse > 1 loops.
      gcc/c/
      	* c-parser.c (c_parser_omp_for_loop): For
      	#pragma omp parallel for simd move lastprivate clause from parallel
      	to for rather than simd.
      gcc/cp/
      	* parser.c (cp_parser_omp_for_loop): For
      	#pragma omp parallel for simd move lastprivate clause from parallel
      	to for rather than simd.
      libgomp/
      	* testsuite/libgomp.c/for-2.c: Define SC to static for
      	#pragma omp for simd testing.
      	* testsuite/libgomp.c/for-2.h (SC): Define if not defined.
      	(N(f5), N(f6), N(f7), N(f8), N(f10), N(f12), N(f14)): Use
      	SC macro.
      	* testsuite/libgomp.c/simd-14.c: New test.
      	* testsuite/libgomp.c/simd-15.c: New test.
      	* testsuite/libgomp.c/simd-16.c: New test.
      	* testsuite/libgomp.c/simd-17.c: New test.
      	* testsuite/libgomp.c++/for-10.C: Define SC to static for
      	#pragma omp for simd testing.
      	* testsuite/libgomp.c++/simd10.C: New test.
      	* testsuite/libgomp.c++/simd11.C: New test.
      	* testsuite/libgomp.c++/simd12.C: New test.
      	* testsuite/libgomp.c++/simd13.C: New test.
      
      From-SVN: r211930
      Jakub Jelinek committed
  25. 23 Jun, 2014 1 commit
  26. 15 Jun, 2014 1 commit
    • c-common.c (handle_tls_model_attribute): Use set_decl_tls_model. · 56363ffd
      	* c-family/c-common.c (handle_tls_model_attribute): Use set_decl_tls_model.
      	* cgraph.h (struct varpool_node): Add tls_model.
      	* tree.c (decl_tls_model, set_decl_tls_model): New functions.
      	* tree.h (DECL_TLS_MODEL): Update.
      	(DECL_THREAD_LOCAL_P): Check that variable is static.
      	(decl_tls_model): Declare.
      	(set_decl_tls_model): Declare.
      	* tree-emutls.c (get_emutls_init_templ_addr): First build decl and then
      	set symbol prorperties.
      	(get_emutls_init_templ_addr): Cleanup.
      	(new_emutls_decl): Update.
      	* lto-cgraph.c (lto_output_varpool_node): Stream TLS model
      	(lto_input_varpool_node): Likewise.
      	* lto-streamer-out.c (hash_tree): Likewise.
      	* tree-streamer-in.c (unpack_ts_decl_with_vis_value_fields): Do
      	not stream DECL_TLS_MODEL.
      	* tree-profile.c (init_ic_make_global_vars): Use
      	set_decl_tls_model.
      	* tree-core.h (tree_decl_with_vis): Remove tls_model;
      	update comments.
      
      	* c-parser.c (c_parser_omp_threadprivate): Likewise.
      	* c-decl.c (merge_decls): Likewise.
      
      	* decl.c (duplicate_decls): Use set_decl_tls_model.
      	(grokdeclarator): Likewise.
      	* semantics.c (finish_id_expression): Check TLS only for
      	static variables.
      	(finish_omp_threadprivate): Use decl_default_tls_model.
      	* decl2.c (get_guard): Likewise.
      	* call.c (make_temporary_var_for_ref_to_temp): Likewise.
      
      	* gcc-interface/utils.c (process_attributes): Use
      	set_decl_tls_model.
      
      	* trans-common.c (build_common_decl): Use
      	set_decl_tls_model.
      	* trans-decl.c (gfc_finish_var_decl): Likewise.
      	(get_proc_pointer_decl): Likewise.
      
      	* lto.c (compare_tree_sccs_1): Do not compare DECL_TLS_MODEL.
      
      From-SVN: r211689
      Jan Hubicka committed
  27. 12 Jun, 2014 1 commit
    • symtab.c (section_hash): New hash. · f961457f
      	* symtab.c (section_hash): New hash.
      	(symtab_unregister_node): Clear section before freeing.
      	(hash_section_hash_entry): New haser.
      	(eq_sections): New function.
      	(symtab_node::set_section_for_node): New method.
      	(set_section_1): Update.
      	(symtab_node::set_section): Take string instead of tree as parameter.
      	(symtab_resolve_alias): Update.
      	* cgraph.h (section_hash_entry_d): New structure.
      	(section_hash_entry): New typedef.
      	(cgraph_node): Change comdat_group_ to x_comdat_group,
      	change section_ to x_section and turn into section_hash_entry;
      	update accestors; put set_section_for_node offline.
      	* tree.c (decl_section_name): Turn into string.
      	(set_decl_section_name): Change parameter to be string.
      	* tree.h (decl_section_name, set_decl_section_name): Update prototypes.
      	* sdbout.c (sdbout_one_type): Update.
      	* tree-vect-data-refs.c (vect_can_force_dr_alignment_p): Update.
      	* varasm.c (IN_NAMED_SECTION, get_named_section, resolve_unique_section,
      	hot_function_section, get_named_text_section, USE_SELECT_SECTION_FOR_FUNCTIONS,
      	default_function_rodata_section, make_decl_rtl, default_unique_section):
      	Update.
      	* config/c6x/c6x.c (c6x_in_small_data_p): Update.
      	(c6x_elf_unique_section): Update.
      	* config/nios2/nios2.c (nios2_in_small_data_p): Update.
      	* config/pa/pa.c (pa_function_section): Update.
      	* config/pa/pa.h (IN_NAMED_SECTION_P): Update.
      	* config/ia64/ia64.c (ia64_in_small_data_p): Update.
      	* config/arc/arc.c (arc_in_small_data_p): Update.
      	* config/arm/unknown-elf.h (IN_NAMED_SECTION_P): Update.
      	* config/mcore/mcore.c (mcore_unique_section): Update.
      	* config/mips/mips.c (mips16_build_function_stub): Update.
      	(mips16_build_call_stub): Update.
      	(mips_function_rodata_section): Update.
      	(mips_in_small_data_p): Update.
      	* config/score/score.c (score_in_small_data_p): Update.
      	* config/rx/rx.c (rx_in_small_data): Update.
      	* config/rs6000/rs6000.c (rs6000_elf_in_small_data_p): Update.
      	(rs6000_xcoff_asm_named_section): Update.
      	(rs6000_xcoff_unique_section): Update.
      	* config/frv/frv.c (frv_string_begins_with): Update.
      	(frv_in_small_data_p): Update.
      	* config/v850/v850.c (v850_encode_data_area): Update.
      	* config/bfin/bfin.c (DECL_SECTION_NAME): Update.
      	(bfin_handle_l1_data_attribute): Update.
      	(bfin_handle_l2_attribute): Update.
      	* config/mep/mep.c (mep_unique_section): Update.
      	* config/microblaze/microblaze.c (microblaze_elf_in_small_data_p): Update.
      	* config/h8300/h8300.c (h8300_handle_eightbit_data_attribute): Update.
      	(h8300_handle_tiny_data_attribute): Update.
      	* config/m32r/m32r.c (m32r_in_small_data_p): Update.
      	(m32r_in_small_data_p): Update.
      	* config/alpha/alpha.c (alpha_in_small_data_p): Update.
      	* config/i386/i386.c (ix86_in_large_data_p): Update.
      	* config/i386/winnt.c (i386_pe_unique_section): Update.
      	* config/darwin.c (darwin_function_section): Update.
      	* config/lm32/lm32.c (lm32_in_small_data_p): Update.
      	* tree-emutls.c (get_emutls_init_templ_addr): Update.
      	(new_emutls_decl): Update.
      	* lto-cgraph.c (lto_output_node, input_node, input_varpool_node,
      	input_varpool_node): Update.
      	(ead_string_cst): Turn to ...
      	(read_string): ... this one.
      	* dwarf2out.c (secname_for_decl): Update.
      	* asan.c (asan_protect_global): Update.
      
      	* c-family/c-common.c (handle_section_attribute): Update handling for
      	section names that are no longer trees.
      
      	* java/class.c (build_utf8_ref): Update handling for section names
      	that are no longer trees.
      	(emit_register_classes_in_jcr_section): Update.
      
      	* vtable-class-hierarchy.c: Update handling for section names
      	that are no longer trees.
      	* decl.c (duplicate_decls): Likewise.
      
      	* gcc-interface/utils.c:  Update handling for section names
      	that are no longer trees.
      
      From-SVN: r211489
      Jan Hubicka committed
  28. 09 Jun, 2014 2 commits
    • re PR c/36446 (unexplained warning in struct initialization) · d7ff7ae5
      	PR c/36446
      	* c-typeck.c (error_init): Call inform instead of error_at.
      	(pedwarn_init): Call inform instead of pedwarn.
      	(warning_init): Call inform instead of warning_at.
      
      	* gcc.dg/Wcxx-compat-6.c: Change dg-warning to dg-message.
      	* gcc.dg/array-2.c: Likewise.
      	* gcc.dg/array-const-2.c: Likewise.
      	* gcc.dg/ucnid-8.c: Likewise.
      	* gcc.dg/vla-init-1.c: Likewise.
      	* gcc.dg/array-const-3.c: Change dg-error to dg-message.
      	* gcc.dg/c99-flex-array-7.c: Likewise.
      	* gcc.dg/init-bad-1.c: Likewise.
      	* gcc.dg/init-bad-3.c: Likewise.
      	* gcc.dg/init-bad-2.c: Change dg-error and dg-warning to dg-message.
      	* gcc.dg/pedwarn-init.c: Add dg-warning.
      	* gcc.dg/pr53119.c: Remove dg-excess-errors.
      
      From-SVN: r211388
      Marek Polacek committed
    • symtab.c (dump_symtab_base): Update dumping. · 24d047a3
      	* symtab.c (dump_symtab_base): Update dumping.
      	(symtab_make_decl_local): Clear only DECL_COMDAT.
      	* tree-vect-data-refs.c (Check that variable is static before
      	tampering with sections.
      	* cgraphclones.c (duplicate_thunk_for_node): Do not clear section name.
      	(cgraph_create_virtual_clone): Likewise.
      	* tree.c (decl_comdat_group, decl_comdat_group_id): Constify argument.
      	(decl_section_name, set_decl_section_name): New accessors.
      	(find_decls_types_r): Do not walk section name
      	* tree.h (DECL_SECTION_NAME): Implement using
      	decl_section_name.
      	(decl_comdat_group, decl_comdat_group_id): Constify.
      	(decl_section_name, set_decl_section_name): Update.
      	* varpool.c (varpool_finalize_named_section_flags): Use
      	get_section.
      	* cgraph.c (cgraph_add_thunk): Reset node instead of rebuilding.
      	(cgraph_make_node_local_1): Clear section and comdat group.
      	* cgraph.h (set_comdat_group): Sanity check.
      	(get_section, set_section): New.
      	* ipa-comdats.c (ipa_comdats): Use get_section.
      	* ipa.c (ipa_discover_readonly_nonaddressable_var): Likewise.
      	* lto-streamer-out.c: Do not follow section names.
      	* c-family/c-common.c (handle_section_attribute):
      	Update.
      	* lto-cgraph.c (lto_output_node): Output section.
      	(lto_output_varpool_node): Likewise.
      	(read_comdat_group): Rename to ...
      	(read_identifier): ... this one.
      	(read_string_cst): New function.
      	(input_node, input_varpool_node): Input section names.
      	* tree-emutls.c (get_emutls_init_templ_addr): Update.
      	(new_emutls_decl): Update.
      	(secname_for_decl): Check section names only of static
      	vars.
      	* config/mep/mep.c (mep_unique_section): Use set_decl_section_name.
      	* config/i386/winnt.c (i386_pe_unique_section): Likewise.
      	* config/i386/i386.c (x86_64_elf_unique_section): Likewise.
      	* config/c6x/c6x.c (c6x_elf_unique_section): Likewise.
      	* config/rs6000/rs6000.c (rs6000_xcoff_unique_section): Likewise.
      	* config/mcore/mcore.c (mcore_unique_section): Likewise.
      	* config/mips/mips.c (mips16_build_function_stub): Likewise.
      	* config/v850/v850.c (v850_insert_attributes): Likewise.
      	* config/h8300/h8300.c: (h8300_handle_eightbit_data_attribute):
      	Likewise.
      	(h8300_handle_tiny_data_attribute): Likewise.
      	* config/bfin/bfin.c (bfin_handle_l1_text_attribute): Likewise.
      	(bfin_handle_l2_attribute): Likewise.
      	* tree-streamer-in.c (lto_input_ts_decl_with_vis_tree_pointers): Do not read section name.
      
      	* lto.c (mentions_vars_p_decl_with_vis, compare_tree_sccs_1,
      	lto_fixup_prevailing_decls): Skip section names.
      
      	* go-gcc.cc (global_variable_set_init): Use
      	set_decl_section_name.
      
      	* gcc-interface/utils.c (process_attributes): Use it.
      
      	* c-decl.c (merge_decls): Use set_decl_section_name.
      	(duplicate_decls): Remove node if it exists.
      
      	* class.c (build_utf8_ref): Use set_decl_section_name.
      	(emit_register_classes_in_jcr_section): Likewise.
      	(emit_register_classes_in_jcr_section): Likewise.
      
      	* method.c (use_thunk): Use set_decl_section_name.
      	* optimize.c (maybe_clone_body): Use set_decl_section_name.
      	* decl.c (duplicate_decls): Likewise.
      	* vtable-class-hierarchy.c: Likewise.
      
      From-SVN: r211363
      Jan Hubicka committed