aboutsummaryrefslogtreecommitdiff
path: root/gcc/c
AgeCommit message (Collapse)AuthorFilesLines
2017-06-09Reverted r249005 until PowerPC and AIX issues sorted.Tamar Christina1-2/+0
From-SVN: r249050
2017-06-08re PR c/81006 (ICE with zero-size array and #pragma omp task depend)Jakub Jelinek2-3/+9
PR c/81006 * c-typeck.c (handle_omp_array_sections_1): Convert TYPE_MAX_VALUE to sizetype before size_binop. * semantics.c (handle_omp_array_sections_1): Convert TYPE_MAX_VALUE to sizetype before size_binop. * c-c++-common/gomp/pr81006.c: New test. From-SVN: r249035
2017-06-08re PR middle-end/77925 (Add __builtin_issubnormal)Tamar Christina1-0/+2
2017-06-08 Tamar Christina <tamar.christina@arm.com> PR middle-end/77925 PR middle-end/77926 PR middle-end/66462 * gcc/builtins.c (fold_builtin_fpclassify): Remove. (fold_builtin_interclass_mathfn): Remove. (expand_builtin): Add builtins to lowering list. (fold_builtin_n): Remove fold_builtin_varargs. (fold_builtin_varargs): Remove. * gcc/builtins.def (BUILT_IN_ISZERO, BUILT_IN_ISSUBNORMAL): New. * gcc/real.h (get_min_float): New. (real_format): Add is_ieee_compatible field. * gcc/real.c (get_min_float): New. (ieee_single_format): Set is_ieee_compatible flag. * gcc/gimple-low.c (lower_stm): Define BUILT_IN_FPCLASSIFY, CASE_FLT_FN (BUILT_IN_ISINF), BUILT_IN_ISINFD32, BUILT_IN_ISINFD64, BUILT_IN_ISINFD128, BUILT_IN_ISNAND32, BUILT_IN_ISNAND64, BUILT_IN_ISNAND128, BUILT_IN_ISNAN, BUILT_IN_ISNORMAL, BUILT_IN_ISZERO, BUILT_IN_ISSUBNORMAL, CASE_FLT_FN (BUILT_IN_FINITE), BUILT_IN_FINITED32 BUILT_IN_FINITED64, BUILT_IN_FINITED128, BUILT_IN_ISFINITE. (lower_builtin_fpclassify, is_nan, is_normal, is_infinity): New. (is_zero, is_subnormal, is_finite, use_ieee_int_mode): Likewise. (lower_builtin_isnan, lower_builtin_isinfinite): Likewise. (lower_builtin_isnormal, lower_builtin_iszero): Likewise. (lower_builtin_issubnormal, lower_builtin_isfinite): Likewise. (emit_tree_cond, get_num_as_int, emit_tree_and_return_var): New. (mips_single_format): Likewise. (motorola_single_format): Likewise. (spu_single_format): Likewise. (ieee_double_format): Likewise. (mips_double_format): Likewise. (motorola_double_format): Likewise. (ieee_extended_motorola_format): Likewise. (ieee_extended_intel_128_format): Likewise. (ieee_extended_intel_96_round_53_format): Likewise. (ibm_extended_format): Likewise. (mips_extended_format): Likewise. (ieee_quad_format): Likewise. (mips_quad_format): Likewise. (vax_f_format): Likewise. (vax_d_format): Likewise. (vax_g_format): Likewise. (decimal_single_format): Likewise. (decimal_quad_format): Likewise. (iee_half_format): Likewise. (mips_single_format): Likewise. (arm_half_format): Likewise. (real_internal_format): Likewise. * gcc/doc/extend.texi: Add documentation for built-ins. * gcc/c/c-typeck.c (convert_arguments): Add BUILT_IN_ISZERO and BUILT_IN_ISSUBNORMAL. gcc/testsuite/ 2017-06-08 Tamar Christina <tamar.christina@arm.com> * gcc.target/aarch64/builtin-fpclassify.c: New codegen test. * gcc.dg/fold-notunord.c: Removed. * gcc.dg/torture/floatn-tg-4.h: Add tests for iszero and issubnormal. * gcc.dg/torture/float128-tg-4.c: Likewise. * gcc.dg/torture/float128x-tg-4: Likewise. * gcc.dg/torture/float16-tg-4.c: Likewise. * gcc.dg/torture/float32-tg-4.c: Likewise. * gcc.dg/torture/float32x-tg-4.c: Likewise. * gcc.dg/torture/float64-tg-4.c: Likewise. * gcc.dg/torture/float64x-tg-4.c: Likewise. * gcc.dg/pr28796-1.c: Add -O2. * gcc.dg/builtins-43.c: Check lower instead of gimple. * gcc.dg/tg-tests.h: Add iszero and issubnormal. * gcc.dg/pr77925.c: Add to test safe cases. From-SVN: r249005
2017-06-07dumpfile.h (enum tree_dump_index): Rename TDI_generic to TDI_gimple.Jakub Jelinek2-1/+6
* dumpfile.h (enum tree_dump_index): Rename TDI_generic to TDI_gimple. (class dump_manager): Add register_dumps method. * dumpfile.c: Include langhooks.h. (dump_files): Use 0 instead of 3/4/5 for TDI_{original,gimple,nested}. (FIRST_AUTO_NUMBERED_DUMP): Decrease to 1. (FIRST_ME_AUTO_NUMBERED_DUMP): Define. (dump_manager::dump_register): Start with 512 entries instead of 32. (dump_manager::register_dumps): New method. * toplev.c (general_init): Instead of invoking register_dumps langhook, invoke register_dumps method on the dump manager. * gimplify.c (gimplify_function_tree): Use TDI_gimple instead of TDI_generic. * gimple-parser.c (c_parser_parse_gimple_body): Use TDI_gimple instead of TDI_generic. From-SVN: r248947
2017-06-06re PR c/79983 (Improve enum and struct redefinition diagnostic)Marek Polacek2-1/+14
PR c/79983 * c-decl.c (start_struct): Use the location of TYPE_STUB_DECL of ref. (start_enum): Use the location of TYPE_STUB_DECL of enumtype. * gcc.dg/pr79983.c: New test. From-SVN: r248927
2017-06-02invoke.texi: Document the -Wsizeof-pointer-div warning.Bernd Edlinger4-14/+48
gcc: 2017-06-02 Bernd Edlinger <bernd.edlinger@hotmail.de> * doc/invoke.texi: Document the -Wsizeof-pointer-div warning. gcc/c-family: 2017-06-02 Bernd Edlinger <bernd.edlinger@hotmail.de> * c.opt (Wsizeof-pointer-div): New warning option. gcc/c: 2017-06-02 Bernd Edlinger <bernd.edlinger@hotmail.de> * c-parser.c (c_parser_binary_expression): Implement the -Wsizeof_pointer_div warning. (c_parser_postfix_expression): Allow SIZEOF_EXPR as expr.original_code from a parenthesized expression. (c_parser_expr_list): Use c_last_sizeof_loc. * c-tree.h (c_last_sizeof_loc): New external. * c-typeck.c (c_last_sizeof_loc): New variable. (c_expr_sizeof_expr, c_expr_sizeof_type): Assign c_last_sizeof_loc. gcc/cp: 2017-06-02 Bernd Edlinger <bernd.edlinger@hotmail.de> * typeck.c (cp_build_binary_op): Implement the -Wsizeof_pointer_div warning. gcc/testsuite: 2017-06-02 Bernd Edlinger <bernd.edlinger@hotmail.de> * c-c++-common/Wsizeof-pointer-div.c: New test. * gcc.dg/Wsizeof-pointer-memaccess1.c: Add test cases with parens. * gcc.dg/torture/Wsizeof-pointer-memaccess1.c: Likewise. * gcc.target/i386/sse-init-v4hi-1.c: Fix test case. * gcc.target/i386/sse-init-v4sf-1.c: Likewise. * gcc.target/i386/sse-set-ps-1.c: Likewise. * gcc.target/i386/sse2-init-v16qi-1.c: Likewise. * gcc.target/i386/sse2-init-v2di-1.c: Likewise. * gcc.target/i386/sse2-init-v4si-1.c: Likewise. * gcc.target/i386/sse2-init-v8hi-1.c: Likewise. * gcc.target/i386/sse2-set-epi32-1.c: Likewise. * gcc.target/i386/sse2-set-epi64x-1.c: Likewise. * gcc.target/i386/sse4_1-init-v16qi-1.c: Likewise. * gcc.target/i386/sse4_1-init-v2di-1.c: Likewise. * gcc.target/i386/sse4_1-init-v4sf-1.c: Likewise. * gcc.target/i386/sse4_1-init-v4si-1.c: Likewise. * gcc.target/i386/sse4_1-set-epi32-1.c: Likewise. * gcc.target/i386/sse4_1-set-epi64x-1.c: Likewise. * gcc.target/i386/sse4_1-set-ps-1.c: Likewise. * libgomp.c/pr39591-2.c: Likewise. * libgomp.c/pr39591-3.c: Likewise. From-SVN: r248811
2017-05-31GIMPLEFE: Handle missing labels in goto statementsMikhail Maltsev2-1/+16
gcc/c/ PR testsuite/80580 * gimple-parser.c (c_parser_gimple_if_stmt): Check for empty labels. gcc/testsuite/ PR testsuite/80580 * gcc.dg/gimplefe-error-7.c: New test. From-SVN: r248738
2017-05-30C++ template type diff printingDavid Malcolm2-2/+8
gcc/ChangeLog: * diagnostic-color.c (color_dict): Add "type-diff". (parse_gcc_colors): Update comment. * doc/invoke.texi (Diagnostic Message Formatting Options): Add -fdiagnostics-show-template-tree and -fno-elide-type. (GCC_COLORS): Add type-diff to example. (type-diff=): New. (-fdiagnostics-show-template-tree): New. (-fno-elide-type): New. * pretty-print.c (pp_format): Pass quote and formatters[argno] to the pp_format_decoder callback. Call any m_format_postprocessor's "handle" method. (pretty_printer::pretty_printer): Initialize m_format_postprocessor. (pretty_printer::~pretty_printer): Delete any m_format_postprocessor. * pretty-print.h (printer_fn): Add bool and const char ** parameters. (class format_postprocessor): New class. (struct pretty_printer::format_decoder): Document the new parameters. (struct pretty_printer::m_format_postprocessor): New field. * tree-diagnostic.c (default_tree_printer): Update for new bool and const char ** params. * tree-diagnostic.h (default_tree_printer): Likewise. gcc/c/ChangeLog: * c-objc-common.c (c_tree_printer): Gain bool and const char ** parameters. gcc/c-family/ChangeLog: * c-format.c (gcc_cxxdiag_char_table): Add 'H' and 'I' to format_chars. * c.opt (fdiagnostics-show-template-tree): New option. (felide-type): New option. gcc/cp/ChangeLog: * call.c (perform_implicit_conversion_flags): Convert "from %qT to %qT" to "from %qH to %qI" in diagnostic. (print_conversion_rejection): Replace pairs of %qT with %qH and %qI in various places. (build_user_type_conversion_1): Likewise. (build_integral_nontype_arg_conv): Likewise. (build_conditional_expr_1): Likewise. (convert_like_real): Likewise. (convert_arg_to_ellipsis): Likewise. (joust): Likewise. (initialize_reference): Likewise. * cvt.c (cp_convert_to_pointer): Likewise. (cp_convert_to_pointer): Likewise. (convert_to_reference): Likewise. (ocp_convert): Likewise. * error.c (cp_printer): Gain bool and const char ** parameters. (struct deferred_printed_type): New struct. (class cxx_format_postprocessor): New class. (cxx_initialize_diagnostics): Wire up a cxx_format_postprocessor to pp->m_format_postprocessor. (comparable_template_types_p): New function. (newline_and_indent): New function. (arg_to_string): New function. (print_nonequal_arg): New function. (print_template_differences): New function. (type_to_string_with_compare): New function. (print_template_tree_comparison): New function. (append_formatted_chunk): New function. (add_quotes): New function. (cxx_format_postprocessor::handle): New function. (defer_phase_2_of_type_diff): New function. (cp_printer): Add "quoted" and "buffer_ptr" params. Implement %H and %I. * typeck.c (cp_build_binary_op): Replace pairs of %qT with %qH and %qI in various places. (convert_member_func_to_ptr): Likewise. (build_reinterpret_cast_1): Likewise. (convert_for_assignment): Likewise. * typeck2.c (check_narrowing): Likewise. gcc/fortran/ChangeLog: * error.c (gfc_format_decoder): Update for new bool and const char ** params. gcc/testsuite/ChangeLog: * g++.dg/plugin/plugin.exp (plugin_test_list): Add... * g++.dg/plugin/show-template-tree-color-no-elide-type.C: New test case. * g++.dg/plugin/show-template-tree-color.C: New test case. * g++.dg/plugin/show_template_tree_color_plugin.c: New plugin. * g++.dg/template/show-template-tree-2.C: New test case. * g++.dg/template/show-template-tree-3.C: New test case. * g++.dg/template/show-template-tree-4.C: New test case. * g++.dg/template/show-template-tree-no-elide-type.C: New test case. * g++.dg/template/show-template-tree.C: New test case. From-SVN: r248698
2017-05-24PR c/80731 - poor -Woverflow warningsMartin Sebor3-3/+9
gcc/c-family/ChangeLog: PR c/80731 * c-common.h (unsafe_conversion_p): Add a function argument. * c-common.c (unsafe_conversion_p): Same. Add type names and values to diagnostics. (scalar_to_vector): Adjust. * c-warn.c (constant_expression_error): Add a function argument. Add type names and values to diagnostics. (conversion_warning): Add a function argument. Add type names and values to diagnostics. (warnings_for_convert_and_check): Same. gcc/c/ChangeLog: PR c/80731 * c-fold.c (c_fully_fold_internal): Adjust. * c-typeck.c (parser_build_unary_op): Adjust. gcc/cp/ChangeLog: PR c/80731 * call.c (fully_fold_internal): Adjust. gcc/testsuite/ChangeLog: PR c/80731 * c-c++-common/Wfloat-conversion.c: Adjust. * c-c++-common/dfp/convert-int-saturate.c: Same. * c-c++-common/pr68657-1.c: Same. * g++.dg/ext/utf-cvt.C: Same. * g++.dg/ext/utf16-4.C: Same. * g++.dg/warn/Wconversion-real-integer-3.C: Same. * g++.dg/warn/Wconversion-real-integer2.C: Same. * g++.dg/warn/Wconversion3.C: Same. * g++.dg/warn/Wconversion4.C: Same. * g++.dg/warn/Wsign-conversion.C: Same. * g++.dg/warn/overflow-warn-1.C: Same. * g++.dg/warn/overflow-warn-3.C: Same. * g++.dg/warn/overflow-warn-4.C: Same. * g++.dg/warn/pr35635.C: Same. * g++.old-deja/g++.mike/enum1.C: Same. * gcc.dg/Wconversion-3.c: Same. * gcc.dg/Wconversion-5.c: Same. * gcc.dg/Wconversion-complex-c99.c: Same. * gcc.dg/Wconversion-complex-gnu.c: Same. * gcc.dg/Wconversion-integer.c: Same. * gcc.dg/Wsign-conversion.c: Same. * gcc.dg/bitfld-2.c: Same. * gcc.dg/c90-const-expr-11.c: Same. * gcc.dg/c90-const-expr-7.c: Same. * gcc.dg/c99-const-expr-7.c: Same. * gcc.dg/overflow-warn-1.c: Same. * gcc.dg/overflow-warn-2.c: Same. * gcc.dg/overflow-warn-3.c: Same. * gcc.dg/overflow-warn-4.c: Same. * gcc.dg/overflow-warn-5.c: Same. * gcc.dg/overflow-warn-8.c: Same. * gcc.dg/overflow-warn-9.c: New test. * gcc.dg/pr35635.c: Adjust. * gcc.dg/pr59940.c: Same. * gcc.dg/pr59963-2.c: Same. * gcc.dg/pr60114.c: Same. * gcc.dg/switch-warn-2.c: Same. * gcc.dg/utf-cvt.c: Same. * gcc.dg/utf16-4.c: Same. From-SVN: r248431
2017-05-23OpenACC 2.5 kernels construct: num_gangs, num_workers, vector_length clausesThomas Schwinge2-0/+9
gcc/c/ * c-parser.c (OACC_KERNELS_CLAUSE_MASK): Add "PRAGMA_OACC_CLAUSE_NUM_GANGS", "PRAGMA_OACC_CLAUSE_NUM_WORKERS", "VECTOR_LENGTH". gcc/cp/ * parser.c (OACC_KERNELS_CLAUSE_MASK): Add "PRAGMA_OACC_CLAUSE_NUM_GANGS", "PRAGMA_OACC_CLAUSE_NUM_WORKERS", "VECTOR_LENGTH". gcc/fortran/ * openmp.c (OACC_KERNELS_CLAUSES): Add "OMP_CLAUSE_NUM_GANGS", "OMP_CLAUSE_NUM_WORKERS", "OMP_CLAUSE_VECTOR_LENGTH". gcc/ * omp-offload.c (execute_oacc_device_lower): Remove the parallelism dimensions function attributes for unparallelized OpenACC kernels constructs. gcc/testsuite/ * c-c++-common/goacc/parallel-dims-1.c: Update. * c-c++-common/goacc/parallel-dims-2.c: Likewise. * c-c++-common/goacc/routine-1.c: Likewise. * c-c++-common/goacc/uninit-dim-clause.c: Likewise. * g++.dg/goacc/template.C: Likewise. * gfortran.dg/goacc/kernels-tree.f95: Likewise. * gfortran.dg/goacc/routine-3.f90: Likewise. * gfortran.dg/goacc/sie.f95: Likewise. * gfortran.dg/goacc/uninit-dim-clause.f95: Likewise. libgomp/ * testsuite/libgomp.oacc-c-c++-common/kernels-loop-2.c: Update. * testsuite/libgomp.oacc-c-c++-common/parallel-dims.c: Likewise. * testsuite/libgomp.oacc-fortran/kernels-loop-2.f95: Likewise. From-SVN: r248370
2017-05-23c-parser.c (c_parser_compound_statement_nostart): Remove redundant quotes.Marek Polacek2-1/+6
* c-parser.c (c_parser_compound_statement_nostart): Remove redundant quotes. From-SVN: r248363
2017-05-22c-fold.c (c_fully_fold_internal): Save the c_fully_fold_internal result for ↵Jakub Jelinek2-10/+13
SAVE_EXPR operand and set... * c-fold.c (c_fully_fold_internal): Save the c_fully_fold_internal result for SAVE_EXPR operand and set SAVE_EXPR_FOLDED_P even if it returned invariant. Call tree_invariant_p unconditionally afterwards to decide whether to return expr or op0. From-SVN: r248347
2017-05-22invoke.texi (fdump-translation-unit): Delete documentation.Nathan Sidwell2-12/+4
gcc/ * doc/invoke.texi (fdump-translation-unit): Delete documentation. (fdump-lang): Document 'raw' option. * dumpfile.h (TDI_tu): Delete. * dumpfile.c (dump_files): Remove translation-unit. (FIRST_AUTO_NUMBERED_DUMP): Decrement. gcc/cp/ * cp-objcp-common.c (cp_register_dumps): Register raw dumper. * cp-tree.h (raw_dump_id): Declare. * decl2.c (raw_dump_id): Define. (dump_tu): Use raw_dump_id. gcc/c/ * c-decl.c (c_parse_final_cleanups): Drop TDI_tu handling. From-SVN: r248333
2017-05-19OpenACC 2.5 default (present) clauseThomas Schwinge2-4/+15
gcc/c/ * c-parser.c (c_parser_omp_clause_default): Handle "OMP_CLAUSE_DEFAULT_PRESENT". gcc/cp/ * parser.c (cp_parser_omp_clause_default): Handle "OMP_CLAUSE_DEFAULT_PRESENT". gcc/fortran/ * gfortran.h (enum gfc_omp_default_sharing): Add "OMP_DEFAULT_PRESENT". * dump-parse-tree.c (show_omp_clauses): Handle it. * openmp.c (gfc_match_omp_clauses): Likewise. * trans-openmp.c (gfc_trans_omp_clauses): Likewise. gcc/ * tree-core.h (enum omp_clause_default_kind): Add "OMP_CLAUSE_DEFAULT_PRESENT". * tree-pretty-print.c (dump_omp_clause): Handle it. * gimplify.c (enum gimplify_omp_var_data): Add "GOVD_MAP_FORCE_PRESENT". (gimplify_adjust_omp_clauses_1): Map it to "GOMP_MAP_FORCE_PRESENT". (oacc_default_clause): Handle "OMP_CLAUSE_DEFAULT_PRESENT". gcc/testsuite/ * c-c++-common/goacc/default-1.c: Update. * c-c++-common/goacc/default-2.c: Likewise. * c-c++-common/goacc/default-4.c: Likewise. * gfortran.dg/goacc/default-1.f95: Likewise. * gfortran.dg/goacc/default-4.f: Likewise. * c-c++-common/goacc/default-5.c: New file. * gfortran.dg/goacc/default-5.f: Likewise. libgomp/ * testsuite/libgomp.oacc-c++/template-reduction.C: Update. * testsuite/libgomp.oacc-c-c++-common/nested-2.c: Update. * testsuite/libgomp.oacc-fortran/data-4-2.f90: Likewise. * testsuite/libgomp.oacc-fortran/default-1.f90: Likewise. * testsuite/libgomp.oacc-fortran/non-scalar-data.f90: Likewise. From-SVN: r248280
2017-05-18c-format.c (local_tree_type_node): Add GTY attribute.Bernd Edlinger2-1/+5
gcc/c-family: 2017-05-18 Bernd Edlinger <bernd.edlinger@hotmail.de> * c-format.c (local_tree_type_node): Add GTY attribute. gcc/c: 2017-05-18 Bernd Edlinger <bernd.edlinger@hotmail.de> * config-lang.in (gtfiles): Add c-family/c-format.c. From-SVN: r248242
2017-05-18* c-decl.c (pushdecl_top_level): Delete unused function.Nathan Sidwell2-28/+4
From-SVN: r248199
2017-05-18c-common.c (c_common_type_for_size): Use NULL_TREE instead of 0.Marek Polacek3-15/+30
* c-common.c (c_common_type_for_size): Use NULL_TREE instead of 0. (c_common_fixed_point_type_for_size): Likewise. (c_common_type_for_mode): Likewise. (shorten_compare): Likewise. (c_promoting_integer_type_p): Use false/true instead of 0/1. * c-pragma.c (maybe_apply_renaming_pragma): Use NULL_TREE instead of 0. * c-decl.c (match_builtin_function_types): Use NULL_TREE instead of 0. (check_earlier_gotos): Likewise. (define_label): Likewise. (pending_xref_error): Likewise. (smallest_type_quals_location): Likewise. (grokdeclarator): Likewise. (grokparms): Likewise. (identifier_global_value): Likewise. * c-typeck.c (set_nonincremental_init_from_string): Likewise. (find_init_member): Likewise. From-SVN: r248195
2017-05-18c-common.c (self_promoting_args_p): Change the return type to bool.Marek Polacek4-32/+44
* c-common.c (self_promoting_args_p): Change the return type to bool. Use false/true instead of 0/1. * c-common.h (self_promoting_args_p): Update. * c-decl.c (start_decl): Use false/true instead of 0/1. (grokdeclarator): Likewise. (finish_struct): Likewise. (start_function): Change the return type to bool. Use false/true instead of 0/1. (declspecs_add_qual): Use UNKNOWN_LOCATION instead of 0. * c-tree.h (start_function): Update. * c-typeck.c (same_translation_unit_p): Change the return type to bool. (set_designator): Change the return type to bool. Use false/true instead of 0/1. From-SVN: r248192
2017-05-17c-common.c: Use NULL_TREE instead of 0 where appropriate.Marek Polacek3-163/+173
* c-common.c: Use NULL_TREE instead of 0 where appropriate. * c-warn.c: Likewise. * c-decl.c: Use NULL_TREE instead of 0 where appropriate. * c-typeck.c: Likewise. From-SVN: r248161
2017-05-17re PR sanitizer/80659 (-fsanitize=address evokes ICE in in gimplify_switch_expr)Marek Polacek2-2/+8
PR sanitizer/80659 * c-decl.c (build_compound_literal): Set DECL_ARTIFICIAL and DECL_IGNORED_P even for non-static compound literals. * gcc.dg/asan/pr80659.c: New test. From-SVN: r248143
2017-05-17Introduce dump_flags_t type and use it instead of int type.Martin Liska2-1/+6
2017-05-17 Martin Liska <mliska@suse.cz> * class.c (dump_class_hierarchy): Introduce dump_flags_t type and use it instead of int type. (dump_vtable): Likewise. (dump_vtt): Likewise. * decl2.c (dump_tu): Likewise. 2017-05-17 Martin Liska <mliska@suse.cz> * c-common.h: Introduce dump_flags_t type and use it instead of int type. * c-gimplify.c (c_genericize): Likewise. * c-opts.c: Likewise. 2017-05-17 Martin Liska <mliska@suse.cz> * c-decl.c (c_parse_final_cleanups): Introduce dump_flags_t type and use it instead of int type. 2017-05-17 Martin Liska <mliska@suse.cz> * cfg.c: Introduce dump_flags_t type and use it instead of int type. * cfg.h: Likewise. * cfghooks.c: Likewise. * cfghooks.h (struct cfg_hooks): Likewise. * cfgrtl.c: Likewise. * cfgrtl.h: Likewise. * cgraph.c (cgraph_node::get_body): Likewise. * coretypes.h: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dumpfile.c (struct dump_option_value_info): Likewise. (dump_enable_all): Likewise. (dump_switch_p_1): Likewise. (opt_info_switch_p): Likewise. * dumpfile.h (enum tree_dump_index): Likewise. (struct dump_file_info): Likewise. * genemit.c: Likewise. * generic-match-head.c: Likewise. * gengtype.c (open_base_files): Likewise. * gimple-pretty-print.c: Likewise. * gimple-pretty-print.h: Likewise. * graph.c (print_graph_cfg): Likewise. * graphite-scop-detection.c (dot_all_sese): Likewise. * ipa-devirt.c (build_type_inheritance_graph): Likewise. * loop-unroll.c (report_unroll): Likewise. * passes.c (pass_manager::register_one_dump_file): Likewise. * print-tree.c: Likewise. * statistics.c: Likewise. * tree-cfg.c: Likewise. * tree-cfg.h: Likewise. * tree-dfa.c: Likewise. * tree-dfa.h: Likewise. * tree-dump.c (dump_function): Likewise. * tree-dump.h (struct dump_info): Likewise. * tree-pretty-print.c: Likewise. * tree-pretty-print.h: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ivcanon.c (try_unroll_loop_completely): Likewise. * tree-vect-loop.c: Likewise. * tree-vect-slp.c: Likewise. From-SVN: r248140
2017-05-17Bye bye, c_save_expr.Marek Polacek7-50/+57
From-SVN: r248139
2017-05-12OpenACC C front end maintenance: c_parser_oacc_single_int_clauseThomas Schwinge2-125/+55
gcc/c/ * c-parser.c (c_parser_omp_clause_num_gangs) (c_parser_omp_clause_num_workers) (c_parser_omp_clause_vector_length): Merge functions into... (c_parser_oacc_single_int_clause): ... this new function. Adjust all users. gcc/testsuite/ * c-c++-common/goacc/parallel-dims-1.c: New file. * c-c++-common/goacc/parallel-dims-2.c: Likewise. From-SVN: r247960
2017-05-11dumpfle.h (dump_function): Declare here ...Nathan Sidwell2-1/+4
* dumpfle.h (dump_function): Declare here ... * tree-dump.h (dump_function): ... not here. * dumpfile.c: #include tree-cfg.h. (dump_function): Move here from ... * tree-dump.c (dump_function): ... here. * gimplify.c: #include splay-tree.h, not tree-dump.h. * graphite-poly.c: Don't include tree-dump.h. * cgraphclones.c: Include dumpfile.h not tree-dump.h. * print-tree.c: Likewise. * stor-layout.c: Likewise. * tree-nested.c: Likewise. c/ * gimple-parser.c: Don't #include tree-dump.h. fortran/ * trans-decl.c: Include dumpfile.h not tree-dump.h, From-SVN: r247916
2017-05-11GIMPLEFE: Handle invalid SSA namesMikhail Maltsev2-0/+12
gcc/testsuite/ PR testsuite/80580 * gcc.dg/gimplefe-error-6.c: New test. gcc/c/ PR testsuite/80580 * gimple-parser.c (c_parser_parse_ssa_name): Validate SSA name base. From-SVN: r247903
2017-05-11GIMPLEFE: handle invalid __MEMMikhail Maltsev2-0/+16
gcc/c/ PR testsuite/80580 * gimple-parser.c (c_parser_gimple_postfix_expression): Handle incorrect __MEM syntax. gcc/testsuite/ PR testsuite/80580 * gcc.dg/gimplefe-error-5.c: New test. From-SVN: r247900
2017-05-11GIMPLEFE: Handle invalid unary "*" operand typeMikhail Maltsev2-0/+11
gcc/c/ PR testsuite/80580 * gimple-parser.c (c_parser_gimple_unary_expression): Check argument type of unary '*'. gcc/testsuite/ PR testsuite/80580 * gcc.dg/gimplefe-error-4.c: New test. From-SVN: r247899
2017-05-09c-tree.h (pushdecl): Declare.Nathan Sidwell2-0/+5
gcc/c/ * c-tree.h (pushdecl): Declare. gcc/cp/ * cp-lang.c (get_global_decls, cxx_pushdecl): New. (LANG_HOOKS_GETDECLS, LANG_HOOKS_PUSHDECL): Override. * name-lookup.h (pushdecl_top_level): Declare. gcc/c-family/ * c-common.c (c_register_builtin_type): Use pushdecl lang_hook. * c-common.h (pushdecl_top_level, pushdecl): Don't declare here. gcc/objc/ * objc-gnu-runtime-abi-01.c (objc_add_static_instance): Use pushdecl lang_hook. From-SVN: r247785
2017-05-05Eliminate report_diagnostic macroDavid Malcolm3-6/+13
This patch eliminates the report_diagnostic macro, manually expanding it in all sites in the code. No functional change intended. gcc/c-family/ChangeLog: * c-common.c (c_cpp_error): Replace report_diagnostic with diagnostic_report_diagnostic. gcc/c/ChangeLog: * c-decl.c (warn_defaults_to): Replace report_diagnostic with diagnostic_report_diagnostic. * c-errors.c (pedwarn_c99): Likewise. (pedwarn_c90): Likewise. gcc/cp/ChangeLog: * error.c (pedwarn_cxx98): Replace report_diagnostic with diagnostic_report_diagnostic. gcc/ChangeLog: * diagnostic.c (diagnostic_impl): Replace report_diagnostic with diagnostic_report_diagnostic. (diagnostic_n_impl_richloc): Likewise. * diagnostic.h (report_diagnostic): Delete macro. * rtl-error.c (diagnostic_for_asm): Replace report_diagnostic with diagnostic_report_diagnostic. * substring-locations.c (format_warning_va): Likewise. gcc/fortran/ChangeLog: * cpp.c (cb_cpp_error): Replace report_diagnostic with diagnostic_report_diagnostic. * error.c (gfc_warning): Likewise. (gfc_warning_now_at): Likewise. (gfc_warning_now): Likewise. (gfc_warning_internal): Likewise. (gfc_error_now): Likewise. (gfc_fatal_error): Likewise. (gfc_error_opt): Likewise. (gfc_internal_error): Likewise. From-SVN: r247663
2017-05-01re PR c++/80038 (Random segfault using local vectors in Cilk function)Xi Ruoyao2-7/+7
2017-05-01 Xi Ruoyao <ryxi@stu.xidian.edu.cn> PR c++/80038 * cilk_common.c (expand_builtin_cilk_detach): Move pedigree operations here. * gimplify.c (gimplify_cilk_detach): New function. (gimplify_call_expr, gimplify_modify_expr): Call it as needed. * tree-core.h: Document EXPR_CILK_SPAWN. * tree.h (EXPR_CILK_SPAWN): Define. PR c++/80038 * c-common.h (cilk_gimplify_call_params_in_spawned_fn): Remove prototype. (cilk_install_body_pedigree_operations): Likewise. * cilk.c (cilk_set_spawn_marker): Mark functions that should be detatched. (cilk_gimplify_call_params_in_spawned_fn): Remove. (cilk_install_body_pedigree_operations): Likewise. (gimplify_cilk_spawn): Add EXPR_STMT and CLEANUP_POINT_EXPR unwrapping. PR c++/80038 * c-gimplify.c (c_gimplify_expr): Remove calls to cilk_gimplifY_call_params_in_spawned_fn. PR c++/80038 * cp-cilkplus.c (cilk_install_body_with_frame_cleanup): Don't add pedigree operation and detach call here. * cp-gimplify.c (cp_gimplify_expr): Remove the calls to cilk_cp_gimplify_call_params_in_spawned_fn. (cilk_cp_gimplify_call_params_in_spawned_fn): Remove function. * semantics.c (simplify_aggr_init_expr): Copy EXPR_CILK_SPAWN. PR c++/80038 * lto-lang.c (lto_init): Set in_lto_p earlier. PR c++/80038 * g++.dg/cilk-plus/CK/pr80038.cc: New test. From-SVN: r247446
2017-04-25C: fix-it hint for removing stray semicolonsDavid Malcolm2-2/+12
gcc/c/ChangeLog: * c-parser.c (c_parser_struct_or_union_specifier): Add fix-it hint for removing extra semicolon. gcc/testsuite/ChangeLog: * gcc.dg/semicolon-fixits.c: New test case. From-SVN: r247243
2017-04-21re PR c/80468 (ICE on invalid AVX512 code with -m32)Jakub Jelinek2-3/+12
PR c/80468 * c-decl.c (finish_declspecs) <case cts_int_n>: If int_n_idx is not enabled, set specs->type to integer_type_node. * gcc.dg/pr80468.c: New test. From-SVN: r247052
2017-04-03Fix numerous typos in commentsJonathan Wakely2-1/+5
gcc: * alias.c (base_alias_check): Fix typo in comment. * cgraph.h (class ipa_polymorphic_call_context): Likewise. * cgraphunit.c (symbol_table::compile): Likewise. * collect2.c (maybe_run_lto_and_relink): Likewise. * config/arm/arm.c (arm_thumb1_mi_thunk): Likewise. * config/avr/avr-arch.h (avr_arch_info_t): Likewise. * config/avr/avr.c (avr_map_op_t): Likewise. * config/cr16/cr16.h (DATA_ALIGNMENT): Likewise. * config/epiphany/epiphany.c (TARGET_ARG_PARTIAL_BYTES): Likewise. * config/epiphany/epiphany.md (movcc): Likewise. * config/i386/i386.c (legitimize_pe_coff_extern_decl): Likewise. * config/m68k/m68k.c (struct _sched_ib, m68k_sched_variable_issue): Likewise. * config/mips/mips.c (mips_save_restore_reg): Likewise. * config/rx/rx.c (rx_is_restricted_memory_address): Likewise. * config/s390/s390.c (Z10_EARLYLOAD_DISTANCE): Likewise. * config/sh/sh.c (sh_rtx_costs): Likewise. * fold-const.c (fold_truth_andor): Likewise. * genautomata.c (collapse_flag): Likewise. * gengtype.h (struct type::u::s): Likewise. * gensupport.c (has_subst_attribute, add_mnemonic_string): Likewise. * input.c (FORMAT_AMOUNT): Likewise. * ipa-cp.c (class ipcp_lattice, agg_replacements_to_vector) (known_aggs_to_agg_replacement_list): Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline.h (estimate_edge_time, estimate_edge_hints): Likewise. * ipa-polymorphic-call.c (ipa_polymorphic_call_context::restrict_to_inner_class): Likewise. * loop-unroll.c (analyze_insn_to_expand_var): Likewise. * lra.c (lra_optional_reload_pseudos, lra_subreg_reload_pseudos): Likewise. * modulo-sched.c (apply_reg_moves): Likewise. * omp-expand.c (build_omp_regions_1): Likewise. * trans-mem.c (struct tm_wrapper_hasher): Likewise. * tree-ssa-loop-ivopts.c (may_eliminate_iv): Likewise. * tree-ssa-loop-niter.c (maybe_lower_iteration_bound): Likewise. * tree-vect-data-refs.c (vect_enhance_data_refs_alignment): Likewise. * value-prof.c: Likewise. * var-tracking.c (val_reset): Likewise. gcc/ada: * doc/gnat_ugn/gnat_and_program_execution.rst: Fix typo. * g-socket.adb (To_Host_Entry): Fix typo in comment. * gnat_ugn.texi: Fix typo. * raise.c (_gnat_builtin_longjmp): Fix capitalization in comment. * s-stposu.adb (Allocate_Any_Controlled): Fix typo in comment. * sem_ch3.adb (Build_Derived_Record_Type): Likewise. * sem_util.adb (Mark_Coextensions): Likewise. * sem_util.ads (Available_Full_View_Of_Component): Likewise. gcc/c: * c-array-notation.c: Fix typo in comment. gcc/c-family: * c-warn.c (do_warn_double_promotion): Fix typo in comment. gcc/cp: * class.c (update_vtable_entry_for_fn): Fix typo in comment. * decl2.c (one_static_initialization_or_destruction): Likewise. * name-lookup.c (store_bindings): Likewise. * parser.c (make_call_declarator): Likewise. * pt.c (check_explicit_specialization): Likewise. gcc/testsuite: * g++.old-deja/g++.benjamin/scope02.C: Fix typo in comment. * gcc.dg/20031012-1.c: Likewise. * gcc.dg/ipa/ipcp-1.c: Likewise. * gcc.dg/torture/matrix-3.c: Likewise. * gcc.target/powerpc/ppc-spe.c: Likewise. * gcc.target/rx/zero-width-bitfield.c: Likewise. libcpp: * include/line-map.h (LINEMAPS_MACRO_MAPS): Fix typo in comment. * lex.c (search_line_fast): Likewise. * pch.h (cpp_valid_state): Likewise. libdecnumber: * decCommon.c (decFloatFromPackedChecked): Fix typo in comment. * decNumber.c (decNumberPower, decMultiplyOp): Likewise. libgcc: * config/c6x/pr-support.c (__gnu_unwind_execute): Fix typo in comment. libitm: * libitm_i.h (sutrct gtm_thread): Fix typo in comment. From-SVN: r246664
2017-03-29re PR c/79730 (ICE tree check: expected var_decl, have function_decl in ↵Marek Polacek2-1/+6
finish_decl, at c/c-decl.c:5063) PR c/79730 * c-decl.c (finish_decl): Check VAR_P. * gcc.dg/pr79730.c: New test. From-SVN: r246578
2017-03-27re PR target/80162 (ICE on invalid code (address of register variable))Jakub Jelinek3-4/+23
PR middle-end/80162 c-family/ * c-common.c (c_common_mark_addressable_vec): Don't set TREE_ADDRESSABLE on DECL_HARD_REGISTER. c/ * c-tree.h (c_mark_addressable): Add array_ref_p argument. * c-typeck.c (c_mark_addressable): Likewise. Look through VIEW_CONVERT_EXPR unless array_ref_p and VCE is from VECTOR_TYPE to ARRAY_TYPE. (build_array_ref): Pass true as array_ref_p to c_mark_addressable. cp/ * cp-tree.h (cxx_mark_addressable): Add array_ref_p argument. * typeck.c (cxx_mark_addressable): Likewise. Look through VIEW_CONVERT_EXPR unless array_ref_p and VCE is from VECTOR_TYPE to ARRAY_TYPE. (cp_build_array_ref): Pass true as array_ref_p to cxx_mark_addressable. testsuite/ * c-c++-common/pr80162-1.c: New test. * c-c++-common/pr80162-2.c: New test. * c-c++-common/pr80162-3.c: New test. From-SVN: r246512
2017-03-23c-tree.h: Remove a C_RID_YYCODE reference.Marek Polacek2-2/+5
* c-tree.h: Remove a C_RID_YYCODE reference. * cp-tree.h: Remove a C_RID_YYCODE reference. From-SVN: r246416
2017-03-21re PR c/80097 (internal compiler error in c_fully_fold_internal with std=c89 ↵Jakub Jelinek2-2/+10
and -fsanitize=float-divide-by-zero) PR c/80097 * c-typeck.c (build_binary_op): Add EXCESS_PRECISION_EXPR only around optional COMPOUND_EXPR with ubsan instrumentation. * gcc.dg/ubsan/pr80097.c: New test. From-SVN: r246302
2017-03-17* c-parser.c: Add C11 references.Marek Polacek2-43/+48
From-SVN: r246249
2017-03-15* c-parser.c (c_parser_enum_specifier): Remove redundant line.Marek Polacek2-1/+4
From-SVN: r246156
2017-03-11* c-decl.c (implicit_decl_warning): Add a comment. Fix formatting.Marek Polacek2-33/+44
From-SVN: r246069
2017-03-11Simplify uses of "%<%s%>" to "%qs" (PR translation/79848)David Malcolm3-9/+16
gcc/c-family/ChangeLog: PR translation/79848 * c-format.c (check_format_string): Simplify uses of "%<%s%>" to "%qs". gcc/c/ChangeLog: PR translation/79848 * c-decl.c (declspecs_add_type): Simplify uses of "%<%s%>" to "%qs". * c-parser.c (c_parser_oacc_shape_clause): Likewise. gcc/cp/ChangeLog: PR translation/79848 * decl.c (grokfndecl): Simplify uses of "%<%s%>" to "%qs". gcc/ChangeLog: PR translation/79848 * ipa-devirt.c (warn_types_mismatch): Simplify uses of "%<%s%>" to "%qs". * ipa-pure-const.c (suggest_attribute): Likewise. Convert _ to G_ to avoid double translation. From-SVN: r246068
2017-03-09re PR sanitizer/79757 (ICE in declare_vars, at gimplify.c:634)Marek Polacek2-0/+18
PR sanitizer/79757 * c-parser.c (c_parser_declaration_or_fndef): Don't sanitize old-style parameter declarations with initializers. * gcc.dg/ubsan/pr79757-1.c: New test. * gcc.dg/ubsan/pr79757-2.c: New test. * gcc.dg/ubsan/pr79757-3.c: New test. * gcc.dg/ubsan/pr79757-4.c: New test. * gcc.dg/ubsan/pr79757-5.c: New test. From-SVN: r246010
2017-03-09re PR c/79969 (C FE emits locus of forward enum declaration rather than ↵Jakub Jelinek2-0/+10
definition into debug info) PR c/79969 * c-decl.c (start_enum): Adjust DECL_SOURCE_LOCATION of TYPE_STUB_DECL. * gcc.dg/debug/dwarf2/enum-loc1.c: New test. From-SVN: r246009
2017-03-07re PR c/79834 (c/c-parser.c: make code more i18n-friendly)Jakub Jelinek2-45/+48
PR c/79834 c/ * c-parser.c (c_parser_pragma): Use error_at instead of c_parser_error for "may only be used in compound statements" diagnostics, change it such that the same translatable string is used for all pragmas. For PRAGMA_OACC_WAIT use "acc wait" rather than "acc enter data" in the diagnostics. (c_parser_omp_cancellation_point, c_parser_omp_target_update, c_parser_omp_target_enter_data, c_parser_omp_target_exit_data): Change "may only be used in compound statements" diagnostics, such that the same translatable string is used for all pragmas. cp/ * parser.c (cp_parser_omp_cancellation_point, cp_parser_omp_target_enter_data, cp_parser_omp_target_exit_data, cp_parser_omp_target_update): Change "may only be used in compound statements" diagnostics, such that the same translatable string is used for all pragmas. (cp_parser_pragma): Likewise. Use error_at instead of cp_parser_error for that diagnostics. testsuite/ * c-c++-common/goacc/pragma_context.c (f2): Adjust expected diagnostics. From-SVN: r245959
2017-03-04re PR c/79847 (diagnostics: missing space in "implicit declaration of function")Marek Polacek2-1/+6
PR c/79847 * c-decl.c (implicit_decl_warning): Add missing space. From-SVN: r245893
2017-03-03re PR c/79758 (ICE: tree check: expected class 'type', have 'exceptional' ↵Marek Polacek2-7/+17
(error_mark) in store_parm_decls_oldstyle, at c/c-decl.c:8973) PR c/79758 * c-decl.c (store_parm_decls_oldstyle): Check if the element of current_function_prototype_arg_types is error_mark_node. Fix formatting. Use TREE_VALUE instead of TREE_TYPE. * gcc.dg/noncompile/pr79758.c: New test. From-SVN: r245886
2017-03-03re PR c/79837 (incomplete diagnostic in c-parser: expected +, *, -, &, ^, |, ↵Jakub Jelinek2-2/+8
&&, ||, min or identifier) PR c/79837 * c-parser.c (c_parser_omp_clause_reduction): Don't mention %<min%> or %<max%> in the diagnostics, instead mention identifier. (c_parser_omp_declare_reduction): Don't mention %<min%> in the diagnostics. From-SVN: r245885
2017-03-03re PR c/79836 (typo in c/c-parser.c: pragma omp ordered)Jakub Jelinek2-3/+12
PR c/79836 * c-parser.c (c_parser_generic_selection): Use %<_Generic%> instead of %<_Generic>. (c_parser_omp_ordered): Use %<depend%> instead of %<depend>. (c_parser_omp_target_exit_data): Use %<release%> instead of %<release>. From-SVN: r245883
2017-02-28i386.c: Include intl.h.Jakub Jelinek2-10/+20
* config/i386/i386.c: Include intl.h. (ix86_option_override_internal): Use cond ? G_("...") : G_("...") instead of just cond ? "..." : "...". * config/nvptx/nvptx.c (nvptx_goacc_validate_dims): Likewise. * coverage.c (read_counts_file): Likewise. * omp-offload.c: Include intl.h. (oacc_loop_fixed_partitions): Use cond ? G_("...") : G_("...") instead of just cond ? "..." : "...". * gcov.c (read_count_file): Use cond ? N_("...") : N_("...") instead of just cond ? "..." : "...". c/ * c-parser.c (c_parser_asm_statement): Use cond ? G_("...") : G_("...") instead of just cond ? "..." : "...". (c_parser_oacc_enter_exit_data): Use %s and ternary operator only for "enter"/"exit" keyword. (c_finish_oacc_routine): Don't use %s to supply portions of the message. cp/ * decl.c (find_decomp_class_base): Use cond ? G_("...") : G_("...") instead of just cond ? "..." : "...". (grokdeclarator): Likewise. (build_enumerator): Likewise. * init.c (build_new_1): Likewise. * call.c (build_new_method_call_1): Likewise. * parser.c: Include intl.h. (cp_parser_oacc_enter_exit_data): Use %s and ternary operator only for "enter"/"exit" keyword. (cp_finalize_oacc_routine): Don't use %s to supply portions of the message. fortran/ * parse.c (parse_critical_block): Use cond ? G_("...") : G_("...") instead of just cond ? "..." : "...". * scanner.c (gfc_next_char_literal): Likewise. * match.c (match_exit_cycle): Likewise. From-SVN: r245778
2017-02-24re PR c++/79588 (ICE in warn_for_restrict with -Wrestrict)Jakub Jelinek3-23/+10
PR c++/79588 c-family/ * c-common.c (check_function_restrict): New function. (check_function_arguments): Add FNDECL argument. Call check_function_restrict if -Wrestrict. * c-warn.c (warn_for_restrict): Remove ARGS argument, add ARGARRAY and NARGS. Use auto_vec for ARG_POSITIONS, simplify. * c-common.h (check_function_arguments): Add FNDECL argument. (warn_for_restrict): Remove ARGS argument, add ARGARRAY and NARGS. c/ * c-parser.c (c_parser_postfix_expression_after_primary): Don't handle -Wrestrict here. * c-typeck.c (build_function_call_vec): Adjust check_function_arguments caller. cp/ * call.c (build_over_call): Call check_function_arguments even for -Wrestrict, adjust check_function_arguments caller. * parser.c (cp_parser_postfix_expression): Don't handle -Wrestrict here. * typeck.c (cp_build_function_call_vec): Adjust check_function_arguments caller. testsuite/ * g++.dg/warn/Wrestrict-1.C: New test. * g++.dg/warn/Wrestrict-2.C: New test. From-SVN: r245719