aboutsummaryrefslogtreecommitdiff
path: root/gcc/c
AgeCommit message (Collapse)AuthorFilesLines
2019-11-14Update ChangeLog and version files for releasereleases/gcc-7.5.0releases/gcc-7Richard Biener1-0/+4
From-SVN: r278197
2019-09-05[c-family] Backport fix for PCH / PR61250.Iain Sandoe2-0/+12
When we are parsing a source file, the very first token might be a PRAGMA_GCC_PCH_PREPROCESS. This indicates that we are going read in a PCH file (named as the value of the pragma). If we don't see this pragma, then we know that it's OK to release any resources that the host might have set aside for the PCH file. There is a thinko in the current implementation, in that the decision to release resources is happening unconditionally right after the first token is extracted but before it's been checked or acted upon. This leads to the pch bug on Darwin, because we actually do release resources - which are subsequently (reasonably) assumed to be available when reading a PCH file. We then get random crashes or hangs depending on the interaction between unmmap and malloc. The bug is present everywhere but doesn't show on (say) Linux, since the release of PCH resources is a NOP there. This effects all the c-family front ends, because they all use c_lex_with_flags () to implement this. The solution is to check for the PRAGMA_GCC_PCH_PREPROCESS and only call c_common_no_more_pch () when that is not the first token. A secondary effect of the collection is that the name of the PCH file can be collected during the ggc_pch_read() reset of state. Therefore we should issue any diagnostic that might name the file before the collections are triggered. gcc/ 2019-09-05 Iain Sandoe <iain@sandoe.co.uk> Backport from mainline 2019-08-23 Iain Sandoe <iain@sandoe.co.uk> PR pch/61250 * ggc-page.c (ggc_pch_read): Read the ggc_pch_ondisk structure and issue any diagnostics needed before collecting the pre-PCH state. gcc/c-family/ 2019-09-05 Iain Sandoe <iain@sandoe.co.uk> Backport from mainline 2019-08-23 Iain Sandoe <iain@sandoe.co.uk> PR pch/61250 * c-lex.c (c_lex_with_flags): Don't call c_common_no_more_pch () from here. gcc/c 2019-09-05 Iain Sandoe <iain@sandoe.co.uk> Backport from mainline. 2019-08-23 Iain Sandoe <iain@sandoe.co.uk> PR pch/61250 * c-parser.c (c_parse_file): Call c_common_no_more_pch () after determining that the first token is not PRAGMA_GCC_PCH_PREPROCESS. gcc/cp/ 2019-09-05 Iain Sandoe <iain@sandoe.co.uk> Backported from mainline 2019-08-23 Iain Sandoe <iain@sandoe.co.uk> PR pch/61250 * parser.c (cp_parser_initial_pragma): Call c_common_no_more_pch () after determining that the first token is not PRAGMA_GCC_PCH_PREPROCESS. From-SVN: r275431
2019-08-30backport: re PR c++/90108 (ICE: Segmentation fault (in c_tree_chain_next))Jakub Jelinek2-1/+25
Backported from mainline 2019-04-19 Jakub Jelinek <jakub@redhat.com> PR c++/90108 * c-decl.c (merge_decls): If remove is main variant and DECL_ORIGINAL_TYPE is some other type, remove a DECL_ORIGINAL_TYPE variant that has newdecl as TYPE_NAME if any. * decl.c (duplicate_decls): If remove is main variant and DECL_ORIGINAL_TYPE is some other type, remove a DECL_ORIGINAL_TYPE variant that has newdecl as TYPE_NAME if any. * c-c++-common/pr90108.c: New test. From-SVN: r275150
2019-08-30backport: re PR c/89933 (ICE in merge_decls, at c/c-decl.c:2517)Jakub Jelinek2-7/+17
Backported from mainline 2019-04-12 Jakub Jelinek <jakub@redhat.com> PR c/89933 * c-decl.c (merge_decls): When newdecl's type is its main variant, don't try to remove it from the variant list, but instead assert it has no variants. * decl.c (duplicate_decls): When newdecl's type is its main variant, don't try to remove it from the variant list, but instead assert it has no variants. * c-c++-common/pr89933.c: New test. From-SVN: r275147
2019-08-30backport: re PR c/89734 (const qualifier on return type not erased inside ↵Jakub Jelinek2-4/+14
__typeof__) Backported from mainline 2019-03-19 Jakub Jelinek <jakub@redhat.com> PR c/89734 * c-decl.c (grokdeclarator): Call c_build_qualified_type on function return type even if quals_used is 0. Formatting fixes. * gcc.dg/pr89734.c: New test. From-SVN: r275134
2019-01-16Fix diagnostics for never-defined inline and nested functions (PR c/88720, ↵Joseph Myers2-2/+15
PR c/88726). Bugs 88720 and 88726 report issues where a function is declared inline in an inner scope, resulting in spurious diagnostics about it being declared but never defined when that scope is left (possibly in some cases also wrongly referring to the function as a nested function). These are regressions that were introduced with the support for C99 inline semantics in 4.3 (they don't appear with 4.2; it's possible some aspects of the bugs might have been introduced later than 4.3). For the case of functions being wrongly referred to as nested, DECL_EXTERNAL was not the right condition for a function being non-nested; TREE_PUBLIC is appropriate for the case of non-nested functions with external linkage, while !b->nested means this is the outermost scope in which the function was declared and so avoids catching the case of a file-scope static being redeclared inline inside a function. For the non-nested, external-linkage case, the code attempts to avoid duplicate diagnostics by diagnosing only when scope != external_scope, but actually scope == external_scope is more appropriate, as it's only when the file and external scopes are popped that the code can actually tell whether a function ended up being defined, and all such functions will appear in the (GCC-internal) external scope. Bootstrapped with no regressions on x86_64-pc-linux-gnu. gcc/c: Backport from mainline 2019-01-07 Joseph Myers <joseph@codesourcery.com> PR c/88720 PR c/88726 * c-decl.c (pop_scope): Use TREE_PUBLIC and b->nested to determine whether a function is nested, not DECL_EXTERNAL. Diagnose inline functions declared but never defined only for external scope, not for other scopes. gcc/testsuite: Backport from mainline 2019-01-07 Joseph Myers <joseph@codesourcery.com> PR c/88720 PR c/88726 * gcc.dg/inline-40.c, gcc.dg/inline-41.c: New tests. From-SVN: r267987
2019-01-02Backport of the "asm inline" patchesSegher Boessenkool4-40/+140
From-SVN: r267536
2018-12-06Update ChangeLog and version files for releasereleases/gcc-7.4.0Richard Biener1-0/+4
From-SVN: r266844
2018-06-22backport: re PR c/85696 (OpenMP with variably modified and default(none) ↵Jakub Jelinek2-14/+9
won't compile) Backported from mainline 2018-05-11 Jakub Jelinek <jakub@redhat.com> PR c/85696 * c-omp.c (c_omp_predetermined_sharing): Return OMP_CLAUSE_DEFAULT_SHARED for artificial vars with integral type. * c-typeck.c (c_finish_omp_clauses): Don't use c_omp_predetermined_sharing, instead just check TREE_READONLY. * cp-tree.h (cxx_omp_predetermined_sharing_1): New prototype. * cp-gimplify.c (cxx_omp_predetermined_sharing): New wrapper around cxx_omp_predetermined_sharing_1. Rename old function to ... (cxx_omp_predetermined_sharing_1): ... this. * semantics.c (finish_omp_clauses): Use cxx_omp_predetermined_sharing_1 instead of cxx_omp_predetermined_sharing. * c-c++-common/gomp/pr85696.c: New test. From-SVN: r261963
2018-06-22backport: re PR c++/85662 ("error: non-constant condition for static ↵Jakub Jelinek3-2/+12
assertion" from __builtin_offsetof in C++) Backported from mainline 2018-06-22 Jakub Jelinek <jakub@redhat.com> PR c++/85662 * g++.dg/ext/offsetof3.C: New test. 2018-05-10 Jakub Jelinek <jakub@redhat.com> PR c++/85662 * c-common.h (fold_offsetof_1): Removed. (fold_offsetof): Add TYPE argument defaulted to size_type_node and CTX argument defaulted to ERROR_MARK. * c-common.c (fold_offsetof_1): Renamed to ... (fold_offsetof): ... this. Remove wrapper function. Add TYPE argument, convert the pointer constant to TYPE and use size_binop with PLUS_EXPR instead of fold_build_pointer_plus if type is not a pointer type. Adjust recursive calls. * c-fold.c (c_fully_fold_internal): Use fold_offsetof rather than fold_offsetof_1, pass TREE_TYPE (expr) as TYPE to it and drop the fold_convert_loc. * c-typeck.c (build_unary_op): Use fold_offsetof rather than fold_offsetof_1, pass argtype as TYPE to it and drop the fold_convert_loc. * cp-gimplify.c (cp_fold): Use fold_offsetof rather than fold_offsetof_1, pass TREE_TYPE (x) as TYPE to it and drop the fold_convert. * g++.dg/ext/offsetof2.C: New test. From-SVN: r261962
2018-06-22backport: re PR c/84999 (ICE in make_vector_type, at tree.c:9561)Jakub Jelinek2-0/+20
Backported from mainline 2018-03-21 Jakub Jelinek <jakub@redhat.com> PR c/84999 * c-typeck.c (build_binary_op): If c_common_type_for_size fails when building vector comparison, diagnose it and return error_mark_node. * c-c++-common/pr84999.c: New test. From-SVN: r261934
2018-06-22backport: re PR c/84853 (ICE: verify_gimple failed (expand_shift_1))Jakub Jelinek2-2/+14
Backported from mainline 2018-03-15 Jakub Jelinek <jakub@redhat.com> PR c/84853 * c-typeck.c (build_binary_op) <case RSHIFT_EXPR, case LSHIFT_EXPR>: If code1 is INTEGER_TYPE, only allow code0 VECTOR_TYPE if it has INTEGER_TYPE element type. * gcc.dg/pr84853.c: New test. From-SVN: r261922
2018-01-25Update ChangeLog and version files for releasereleases/gcc-7.3.0Richard Biener1-0/+4
From-SVN: r257041
2017-12-22re PR debug/83550 (Bad location of DW_TAG_structure_type with forward ↵Jakub Jelinek2-8/+15
declaration since r224161) PR debug/83550 * c-decl.c (finish_struct): Set DECL_SOURCE_LOCATION on TYPE_STUB_DECL and call rest_of_type_compilation before processing incomplete vars rather than after it. * c-c++-common/dwarf2/pr83550.c: New test. From-SVN: r255982
2017-12-10Backport "Fix condition folding in c_parser_omp_for_loop"Tom de Vries2-1/+17
2017-12-10 Tom de Vries <tom@codesourcery.com> backport from trunk: 2017-09-16 Tom de Vries <tom@codesourcery.com> PR c/81875 * c-parser.c (c_parser_omp_for_loop): Fold only operands of cond, not cond itself. * testsuite/libgomp.c/pr81875.c: New test. From-SVN: r255531
2017-09-30backport: re PR c/82340 (volatile ignored in compound literal)Jakub Jelinek2-3/+10
Backported from mainline 2017-09-29 Jakub Jelinek <jakub@redhat.com> PR c/82340 * c-decl.c (build_compound_literal): Use c_apply_type_quals_to_decl instead of trying to set just TREE_READONLY manually. * gcc.dg/tree-ssa/pr82340.c: New test. From-SVN: r253319
2017-08-14Update ChangeLog and version files for releasereleases/gcc-7.2.0Richard Biener1-0/+4
From-SVN: r251081
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: r249036
2017-05-26re PR sanitizer/80659 (-fsanitize=address evokes ICE in in gimplify_switch_expr)Marek Polacek2-2/+11
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: r248491
2017-05-03backport: re PR c/80468 (ICE on invalid AVX512 code with -m32)Jakub Jelinek2-3/+15
Backported from mainline 2017-04-21 Jakub Jelinek <jakub@redhat.com> 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: r247534
2017-05-02Update ChangeLog and version files for releasereleases/gcc-7.1.0GCC Administrator1-0/+4
From-SVN: r247493
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
2017-02-23re PR c/79684 (Conditional jump or move depends on uninitialised value in ↵Richard Biener2-8/+14
GIMPLE FE) 2017-02-23 Richard Biener <rguenther@suse.de> PR c/79684 * gimple-parser.c (c_parser_gimple_statement): Use set_error to initialize c_exprs to return. (c_parser_gimple_binary_expression): Likewise. (c_parser_gimple_unary_expression): Likewise. (c_parser_gimple_postfix_expression): Likewise. From-SVN: r245681
2017-02-22re PR c/79662 (ICE on invalid code in convert_arguments in c/c-typeck.c:3452)Marek Polacek2-4/+12
PR c/79662 * c-typeck.c (convert_arguments): Handle error_mark_node. * gcc.dg/enum-incomplete-4.c: New test. From-SVN: r245660
2017-02-19gimple-parser.c (c_parser_gimple_postfix_expression): Check return value of ↵Prathamesh Kulkarni2-0/+15
c_parser_parse_ssa_name against error_mark_node and emit... 2017-02-19 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org> * gimple-parser.c (c_parser_gimple_postfix_expression): Check return value of c_parser_parse_ssa_name against error_mark_node and emit error if ssa name is anonymous and written as default definition. From-SVN: r245571
2017-02-19gimple-pretty-print.c (dump_ternary_rhs): Adjust gimple dump format for ↵Prathamesh Kulkarni2-0/+27
FMA_EXPR. 2017-02-19 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org> * gimple-pretty-print.c (dump_ternary_rhs): Adjust gimple dump format for FMA_EXPR. c/ * gimple-parser.c (c_parser_gimple_postfix_expression): Handle FMA_EXPR. testsuite/ * gcc.dg/gimplefe-26.c: New test. From-SVN: r245570
2017-02-16re PR c++/79512 (ICE: Segfault in gimple_build_call_1, at gimple.c:218)Jakub Jelinek2-0/+11
PR c++/79512 c/ * c-parser.c (c_parser_omp_target): For -fopenmp-simd ignore #pragma omp target even when not followed by identifier. cp/ * parser.c (cp_parser_omp_target): For -fopenmp-simd ignore #pragma omp target even when not followed by identifier. testsuite/ * c-c++-common/gomp/pr79512.c: New test. From-SVN: r245504
2017-02-14gimple-pretty-print.c (dump_unary_rhs): Adjust dump format for ABS_EXPR for ↵Prathamesh Kulkarni2-1/+26
gimple dump. 2017-02-14 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org> * gimple-pretty-print.c (dump_unary_rhs): Adjust dump format for ABS_EXPR for gimple dump. c/ * gimpler-parser.c (c_parser_gimple_statement): Handle ABS_EXPR. (c_parser_gimple_unary_expression): Likewise. testsuite/ * gcc.dg/gimplefe-25.c: New test. From-SVN: r245422
2017-02-13cprop.c (cprop_jump): Add missing space in string literal.Jakub Jelinek2-1/+6
* cprop.c (cprop_jump): Add missing space in string literal. * tree-ssa-structalias.c (rewrite_constraints): Likewise. (get_constraint_for_component_ref): Likewise. * df-core.c (df_worklist_dataflow_doublequeue): Likewise. * tree-outof-ssa.c (insert_partition_copy_on_edge): Likewise. * lra-constraints.c (process_alt_operands): Likewise. * ipa-inline.c (inline_small_functions): Likewise. * tree-ssa-sccvn.c (visit_reference_op_store): Likewise. * cgraph.c (cgraph_edge::redirect_call_stmt_to_callee): Likewise. * trans-mem.c (diagnose_tm_1_op): Likewise. * omp-grid.c (grid_find_single_omp_among_assignments): Likewise. (grid_parallel_clauses_gridifiable): Likewise. c/ * c-parser.c (c_parser_oacc_declare): Add missing space in diagnostics. fortran/ * trans-expr.c (gfc_conv_substring): Add missing space in diagnostics. From-SVN: r245409
2017-02-13re PR c/79478 (possible gimple error with gcc.dg/gimplefe-16.c)Prathamesh Kulkarni2-0/+7
2017-02-13 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org> PR c/79478 * gimple-parser.c (c_parser_gimple_postfix_expression): Call set_c_expr_source_range when parsing ssa-name. From-SVN: r245406
2017-02-10gimple-parser.c (c_parser_gimple_binary_expression): Avoid building IL when ↵Prasad Ghangal2-15/+36
arguments are error_mark_node. 2017-02-10 Prasad Ghangal <prasad.ghangal@gmail.com> Richard Biener <rguenther@suse.de> * gimple-parser.c (c_parser_gimple_binary_expression): Avoid building IL when arguments are error_mark_node. (c_parser_gimple_unary_expression): Likewise. (c_parser_gimple_if_stmt): Likewise. (c_parser_gimple_switch_stmt): Likewise. (c_parser_gimple_return_stmt): Likewise. (c_parser_parse_ssa_name): When name lookup fails do not build an SSA name. Use undeclared rather than not declared in error reporting. * gcc.dg/gimplefe-error-1.c: New testcase. * gcc.dg/gimplefe-error-2.c: New testcase. * gcc.dg/gimplefe-error-3.c: New testcase. Co-Authored-By: Richard Biener <rguenther@suse.de> From-SVN: r245326
2017-02-09re PR c/79428 (ICE in c_parser_consume_token, at c/c-parser.c:770)Marek Polacek2-1/+7
PR c/79428 * c-parser.c (c_parser_omp_ordered): Call c_parser_skip_to_pragma_eol instead of c_parser_skip_until_found. * c-c++-common/cilk-plus/CK/pr79428-4.c: New test. * c-c++-common/cilk-plus/CK/pr79428-7.c: New test. * c-c++-common/goacc/pr79428-1.c: New test. * c-c++-common/gomp/pr79428-2.c: New test. * c-c++-common/gomp/pr79428-5.c: New test. * c-c++-common/gomp/pr79428-6.c: New test. * c-c++-common/pr79428-3.c: New test. From-SVN: r245309
2017-02-09re PR c/79431 (ICE in get, at cgraph.h:397)Jakub Jelinek2-1/+10
PR c/79431 * gimplify.c (gimplify_adjust_omp_clauses): Ignore "omp declare target link" attribute unless is_global_var. * omp-offload.c (find_link_var_op): Likewise. c/ * c-parser.c (c_parser_omp_declare_target): Don't invoke symtab_node::get on automatic variables. cp/ * parser.c (cp_parser_oacc_declare): Formatting fix. (cp_parser_omp_declare_target): Don't invoke symtab_node::get on automatic variables. testsuite/ * c-c++-common/gomp/pr79431.c: New test. From-SVN: r245302