diff options
Diffstat (limited to 'gcc-4.9/gcc/c')
-rw-r--r-- | gcc-4.9/gcc/c/ChangeLog | 51 | ||||
-rw-r--r-- | gcc-4.9/gcc/c/c-array-notation.c | 18 | ||||
-rw-r--r-- | gcc-4.9/gcc/c/c-decl.c | 374 | ||||
-rw-r--r-- | gcc-4.9/gcc/c/c-lang.c | 21 | ||||
-rw-r--r-- | gcc-4.9/gcc/c/c-parser.c | 36 | ||||
-rw-r--r-- | gcc-4.9/gcc/c/c-tree.h | 15 | ||||
-rw-r--r-- | gcc-4.9/gcc/c/c-typeck.c | 3 |
7 files changed, 473 insertions, 45 deletions
diff --git a/gcc-4.9/gcc/c/ChangeLog b/gcc-4.9/gcc/c/ChangeLog index 5f4a207a7..e31d4a8a3 100644 --- a/gcc-4.9/gcc/c/ChangeLog +++ b/gcc-4.9/gcc/c/ChangeLog @@ -1,3 +1,54 @@ +2014-06-30 Jakub Jelinek <jakub@redhat.com> + + Backported from mainline + 2014-06-25 Jakub Jelinek <jakub@redhat.com> + + * c-typeck.c (c_finish_omp_clauses): Make sure + OMP_CLAUSE_LINEAR_STEP has correct type. + +2014-06-30 Sebastian Huber <sebastian.huber@embedded-brains.de> + + * c-parser.c (c_parser_declaration_or_fndef): Discard all type + qualifiers in __auto_type for atomic types. + (c_parser_typeof_specifier): Discard all type qualifiers in + __typeof__ for atomic types. + +2014-06-30 Igor Zamyatin <igor.zamyatin@intel.com> + + PR middle-end/57541 + * 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. + +2014-06-24 Jakub Jelinek <jakub@redhat.com> + + * c-parser.c (c_parser_omp_for_loop): For + #pragma omp parallel for simd move lastprivate clause from parallel + to for rather than simd. + +2014-06-04 Igor Zamyatin <igor.zamyatin@intel.com> + + PR c/58942 + * c-array-notation.c (fix_builtin_array_notation_fn): Handle the case + with a pointer. + +2014-06-04 Marek Polacek <polacek@redhat.com> + + Backport from mainline + 2014-05-08 Marek Polacek <polacek@redhat.com> + + PR c/61053 + * c-decl.c (grokdeclarator): Use min_align_of_type instead of + TYPE_ALIGN_UNIT. + +2014-05-26 Igor Zamyatin <igor.zamyatin@intel.com> + + PR c/61191 + * c-array-notation.c (fix_builtin_array_notation_fn): Check invalid + function parameters. + 2014-04-24 Jakub Jelinek <jakub@redhat.com> * c-parser.c (c_parser_omp_atomic): Allow seq_cst before diff --git a/gcc-4.9/gcc/c/c-array-notation.c b/gcc-4.9/gcc/c/c-array-notation.c index 0ac6ba8e1..2305e1e03 100644 --- a/gcc-4.9/gcc/c/c-array-notation.c +++ b/gcc-4.9/gcc/c/c-array-notation.c @@ -214,6 +214,13 @@ fix_builtin_array_notation_fn (tree an_builtin_fn, tree *new_var) if (an_type == BUILT_IN_NONE) return NULL_TREE; + /* Builtin call should contain at least one argument. */ + if (call_expr_nargs (an_builtin_fn) == 0) + { + error_at (EXPR_LOCATION (an_builtin_fn), "Invalid builtin arguments"); + return error_mark_node; + } + if (an_type == BUILT_IN_CILKPLUS_SEC_REDUCE || an_type == BUILT_IN_CILKPLUS_SEC_REDUCE_MUTATING) { @@ -229,6 +236,8 @@ fix_builtin_array_notation_fn (tree an_builtin_fn, tree *new_var) /* Fully fold any EXCESSIVE_PRECISION EXPR that can occur in the function parameter. */ func_parm = c_fully_fold (func_parm, false, NULL); + if (func_parm == error_mark_node) + return error_mark_node; location = EXPR_LOCATION (an_builtin_fn); @@ -236,7 +245,10 @@ fix_builtin_array_notation_fn (tree an_builtin_fn, tree *new_var) return error_mark_node; if (rank == 0) - return an_builtin_fn; + { + error_at (location, "Invalid builtin arguments"); + return error_mark_node; + } else if (rank > 1 && (an_type == BUILT_IN_CILKPLUS_SEC_REDUCE_MAX_IND || an_type == BUILT_IN_CILKPLUS_SEC_REDUCE_MIN_IND)) @@ -308,7 +320,9 @@ fix_builtin_array_notation_fn (tree an_builtin_fn, tree *new_var) || an_type == BUILT_IN_CILKPLUS_SEC_REDUCE_MIN_IND) array_ind_value = build_decl (location, VAR_DECL, NULL_TREE, TREE_TYPE (func_parm)); - array_op0 = (*array_operand)[0]; + array_op0 = (*array_operand)[0]; + if (TREE_CODE (array_op0) == INDIRECT_REF) + array_op0 = TREE_OPERAND (array_op0, 0); switch (an_type) { case BUILT_IN_CILKPLUS_SEC_REDUCE_ADD: diff --git a/gcc-4.9/gcc/c/c-decl.c b/gcc-4.9/gcc/c/c-decl.c index df84980e3..ac3819823 100644 --- a/gcc-4.9/gcc/c/c-decl.c +++ b/gcc-4.9/gcc/c/c-decl.c @@ -60,6 +60,7 @@ along with GCC; see the file COPYING3. If not see #include "hash-table.h" #include "langhooks-def.h" #include "pointer-set.h" +#include "l-ipo.h" #include "plugin.h" #include "c-family/c-ada-spec.h" #include "cilk.h" @@ -537,6 +538,27 @@ static tree grokdeclarator (const struct c_declarator *, bool *, enum deprecated_states); static tree grokparms (struct c_arg_info *, bool); static void layout_array_type (tree); +static void pop_ext_scope (void); + +/* LIPO support */ +/* The list of block nodes. A member node is created + when an external scope is popped. */ +static GTY (()) vec<tree, va_gc> *ext_blocks = NULL; +static inline void +apply_for_each_ext_block (void (*func) (tree)) +{ + if (L_IPO_COMP_MODE) + { + size_t i; + tree eb; + + for (i = 0; + ext_blocks->iterate (i, &eb); + ++i) + func (BLOCK_VARS (eb)); + } +} + /* T is a statement. Add it to the statement-tree. This is the C/ObjC version--C++ has a slightly different version of this @@ -686,6 +708,8 @@ bind (tree name, tree decl, struct c_scope *scope, bool invisible, b->shadowed = *here; *here = b; + + add_decl_to_current_module_scope (decl, scope); } /* Clear the binding structure B, stick it on the binding_freelist, @@ -1214,8 +1238,18 @@ pop_scope (void) binding in the home scope. */ if (!b->nested) { - DECL_CHAIN (p) = BLOCK_VARS (block); - BLOCK_VARS (block) = p; + /* In LIPO mode compilation, ext_scope is popped out + at end of each module to block name lookup across + modules. The ext_scope is used to keep the list of + global variables in that module scope. Other decls + are filtered out. */ + if (!L_IPO_COMP_MODE + || scope != external_scope + || TREE_CODE (p) == VAR_DECL) + { + DECL_CHAIN (p) = BLOCK_VARS (block); + BLOCK_VARS (block) = p; + } } else if (VAR_OR_FUNCTION_DECL_P (p) && scope != file_scope) { @@ -1316,6 +1350,11 @@ push_file_scope (void) push_scope (); file_scope = current_scope; + /* LIPO support -- do this before file scope bindings + are created for visible_builtins -- only need to remember + external scope bindings. */ + push_module_scope (); + start_fname_decls (); for (decl = visible_builtins; decl; decl = DECL_CHAIN (decl)) @@ -1350,7 +1389,18 @@ pop_file_scope (void) pop_scope (); file_scope = 0; - maybe_apply_pending_pragma_weaks (); + if (!L_IPO_COMP_MODE) + maybe_apply_pending_pragma_weaks (); + else + { + pop_ext_scope (); + gcc_assert (current_scope == 0 && external_scope == 0); + push_scope (); + external_scope = current_scope; + /* Prepare for parsing for the next module -- including + builtin re-binding. */ + pop_module_scope (); + } } /* Adjust the bindings for the start of a statement expression. */ @@ -2552,7 +2602,9 @@ warn_if_shadowing (tree new_decl) struct c_binding *b; /* Shadow warnings wanted? */ - if (!warn_shadow + if (!(warn_shadow + || warn_shadow_local + || warn_shadow_compatible_local) /* No shadow warnings for internally generated vars. */ || DECL_IS_BUILTIN (new_decl) /* No shadow warnings for vars made for inlining. */ @@ -2569,14 +2621,25 @@ warn_if_shadowing (tree new_decl) tree old_decl = b->decl; if (old_decl == error_mark_node) - { - warning (OPT_Wshadow, "declaration of %q+D shadows previous " - "non-variable", new_decl); - break; - } + warning (OPT_Wshadow, "declaration of %q+D shadows previous " + "non-variable", new_decl); else if (TREE_CODE (old_decl) == PARM_DECL) - warning (OPT_Wshadow, "declaration of %q+D shadows a parameter", - new_decl); + { + enum opt_code warning_code; + + /* If '-Wshadow-compatible-local' is specified without other + -Wshadow flags, we will warn only when the types of the + shadowing variable (i.e. new_decl) and the shadowed variable + (old_decl) are compatible. */ + if (comptypes (TREE_TYPE (old_decl), TREE_TYPE (new_decl))) + warning_code = OPT_Wshadow_compatible_local; + else + warning_code = OPT_Wshadow_local; + warning (warning_code, + "declaration of %q+D shadows a parameter", new_decl); + warning_at (DECL_SOURCE_LOCATION (old_decl), warning_code, + "shadowed declaration is here"); + } else if (DECL_FILE_SCOPE_P (old_decl)) { /* Do not warn if a variable shadows a function, unless @@ -2586,23 +2649,34 @@ warn_if_shadowing (tree new_decl) && !FUNCTION_POINTER_TYPE_P (TREE_TYPE (new_decl))) continue; - warning_at (DECL_SOURCE_LOCATION (new_decl), OPT_Wshadow, - "declaration of %qD shadows a global declaration", - new_decl); + warning (OPT_Wshadow, "declaration of %q+D shadows a global " + "declaration", new_decl); + warning_at (DECL_SOURCE_LOCATION (old_decl), OPT_Wshadow, + "shadowed declaration is here"); } else if (TREE_CODE (old_decl) == FUNCTION_DECL && DECL_BUILT_IN (old_decl)) - { warning (OPT_Wshadow, "declaration of %q+D shadows " "a built-in function", new_decl); - break; - } else - warning (OPT_Wshadow, "declaration of %q+D shadows a previous local", - new_decl); - - warning_at (DECL_SOURCE_LOCATION (old_decl), OPT_Wshadow, - "shadowed declaration is here"); + { + enum opt_code warning_code; + + /* If '-Wshadow-compatible-local' is specified without other + -Wshadow flags, we will warn only when the types of the + shadowing variable (i.e. new_decl) and the shadowed variable + (old_decl) are compatible. */ + if (comptypes (TREE_TYPE (old_decl), TREE_TYPE (new_decl))) + warning_code = OPT_Wshadow_compatible_local; + else + warning_code = OPT_Wshadow_local; + warning (warning_code, + "declaration of %q+D shadows a previous local", + new_decl); + + warning_at (DECL_SOURCE_LOCATION (old_decl), warning_code, + "shadowed declaration is here"); + } break; } @@ -4486,12 +4560,25 @@ finish_decl (tree decl, location_t init_loc, tree init, when a tentative file-scope definition is seen. But at end of compilation, do output code for them. */ DECL_DEFER_OUTPUT (decl) = 1; + + /* In LIPO mode, create varpool_node early + enough so that module id of the current source file being + parsed is captured. */ + if (flag_dyn_ipa && TREE_CODE (decl) == VAR_DECL) + varpool_node_for_decl (decl); + if (asmspec && C_DECL_REGISTER (decl)) DECL_HARD_REGISTER (decl) = 1; rest_of_decl_compilation (decl, true, 0); } else { + /* LIPO: capture module id. */ + if (flag_dyn_ipa + && TREE_CODE (decl) == VAR_DECL + && TREE_STATIC (decl)) + varpool_node_for_decl (decl); + /* In conjunction with an ASMSPEC, the `register' keyword indicates that we should place the variable in a particular register. */ @@ -5911,7 +5998,7 @@ grokdeclarator (const struct c_declarator *declarator, else if (declspecs->align_log != -1) { alignas_align = 1U << declspecs->align_log; - if (alignas_align < TYPE_ALIGN_UNIT (type)) + if (alignas_align < min_align_of_type (type)) { if (name) error_at (loc, "%<_Alignas%> specifiers cannot reduce " @@ -10391,7 +10478,12 @@ c_write_global_declarations (void) through wrapup_global_declarations and check_global_declarations. */ FOR_EACH_VEC_ELT (*all_translation_units, i, t) c_write_global_declarations_1 (BLOCK_VARS (DECL_INITIAL (t))); - c_write_global_declarations_1 (BLOCK_VARS (ext_block)); + if (ext_block) + c_write_global_declarations_1 (BLOCK_VARS (ext_block)); + apply_for_each_ext_block (c_write_global_declarations_1); + + if (L_IPO_COMP_MODE) + maybe_apply_pending_pragma_weaks (); timevar_stop (TV_PHASE_DEFERRED); timevar_start (TV_PHASE_OPT_GEN); @@ -10410,7 +10502,9 @@ c_write_global_declarations (void) timevar_push (TV_SYMOUT); FOR_EACH_VEC_ELT (*all_translation_units, i, t) c_write_global_declarations_2 (BLOCK_VARS (DECL_INITIAL (t))); - c_write_global_declarations_2 (BLOCK_VARS (ext_block)); + if (ext_block) + c_write_global_declarations_2 (BLOCK_VARS (ext_block)); + apply_for_each_ext_block (c_write_global_declarations_2); timevar_pop (TV_SYMOUT); } @@ -10418,6 +10512,236 @@ c_write_global_declarations (void) timevar_stop (TV_PHASE_DBGINFO); } + +/* LIPO support */ + +typedef struct GTY (()) c_sb +{ + tree decl; + tree id; + tree decl_copy_pre; /* copy at the start of file parsing. */ + tree decl_copy_post; /* copy at the end of module_scope. */ + int invisible; +} c_saved_builtin; + +static GTY (()) vec<c_saved_builtin, va_gc> *saved_builtins = NULL; + +/* Return the needed size of lang_decl structure for tree T. */ + +int +c_get_lang_decl_size (tree t) +{ + if (!DECL_LANG_SPECIFIC (t)) + return 0; + return sizeof (struct lang_decl); +} + +/* Return true if S is external or file scope. */ + +bool +c_is_global_scope (tree decl ATTRIBUTE_UNUSED, void *s) +{ + struct c_scope *scope = (struct c_scope *)s; + + if (scope == external_scope || scope == file_scope) + return true; + + return false; +} + +/* Add DECL to the list of builtins. */ + +void +c_add_built_in_decl (tree decl) +{ + c_saved_builtin *sb; + struct c_binding *b = NULL; + + if (!flag_dyn_ipa) + return; + + if (at_eof) + return; + + if (parser_parsing_start) + return; + + sb = vec_safe_push (saved_builtins, c_saved_builtin ()); + sb->decl = decl; + sb->decl_copy_pre = NULL; + sb->decl_copy_post = NULL; + sb->id = get_type_or_decl_name (decl); + + switch (TREE_CODE (decl)) + { + case TYPE_DECL: + case FUNCTION_DECL: + case CONST_DECL: + b = I_SYMBOL_BINDING (sb->id); + break; + case ENUMERAL_TYPE: + case UNION_TYPE: + case RECORD_TYPE: + b = I_TAG_BINDING (sb->id); + break; + default: + gcc_unreachable (); + } + + gcc_assert (b && b->decl == decl + && b->id == sb->id && b->depth == 0); + sb->invisible = b->invisible; +} + +/* Pop the external scope at the end of parsing of a file. */ + +static void +pop_ext_scope (void) +{ + tree ext_b; + if (!L_IPO_COMP_MODE) + return; + ext_b = pop_scope (); + vec_safe_push (ext_blocks, ext_b); + gcc_assert (!current_scope); + external_scope = 0; + + /* Now remove non var_decls from BLOCK_VARS -- + this is needed to avoid tree-chain contamination + from other modules due to builtin (shared) decls. */ + { + tree *p = &BLOCK_VARS (ext_b); + tree decl = BLOCK_VARS (ext_b); + for (; decl; decl = TREE_CHAIN (decl)) + { + if (TREE_CODE (decl) != VAR_DECL) + { + gcc_assert (0); + *p = TREE_CHAIN (decl); + } + else + p = &TREE_CHAIN (decl); + } + } +} + +/* Save a copy of SB->decl before file parsing start. */ + +static void +c_save_built_in_decl_pre_parsing_1 (c_saved_builtin *sb) +{ + tree decl = sb->decl; + + sb->decl_copy_pre = lipo_save_decl (decl); + sb->decl_copy_post = NULL; + return; +} + +/* Make copies of builtin decls before file parsing. */ + +void +c_save_built_in_decl_pre_parsing (void) +{ + size_t i; + c_saved_builtin *bi; + + for (i = 0; + saved_builtins->iterate (i, &bi); + ++i) + c_save_built_in_decl_pre_parsing_1 (bi); +} + +/* Restore builtins to their values before file parsing ( + the initial default value). */ + +void +c_restore_built_in_decl_pre_parsing (void) +{ + size_t i; + c_saved_builtin *bi; + + /* Now re-bind the builtins in the external scope. */ + gcc_assert (current_scope && current_scope == external_scope); + for (i = 0; + saved_builtins->iterate (i, &bi); + ++i) + { + tree id; + tree decl = bi->decl; + id = bi->id; + + lipo_restore_decl (decl, bi->decl_copy_pre); + if (id) + bind (id, decl, external_scope, + bi->invisible, false /*nested*/, + DECL_SOURCE_LOCATION (decl)); + } +} + +/* Save values of builtins after parsing of a file. */ + +void +c_save_built_in_decl_post_parsing (void) +{ + size_t i; + c_saved_builtin *bi; + + for (i = 0; + saved_builtins->iterate (i, &bi); + ++i) + { + /* Skip builtin decls in the predefined state. + The static flag for defined builtins are not set, so + do not check it. */ + if (DECL_ARTIFICIAL (bi->decl) + || TREE_CODE (bi->decl) != FUNCTION_DECL + || !DECL_STRUCT_FUNCTION (bi->decl)) + continue; + /* Remember the defining module. */ + cgraph_link_node (cgraph_get_create_node (bi->decl)); + if (!bi->decl_copy_post) + bi->decl_copy_post = lipo_save_decl (bi->decl); + } +} + +/* Restore builtins to their values (non-default) + after parsing finishes. */ + +void +c_restore_built_in_decl_post_parsing (void) +{ + c_saved_builtin *bi; + unsigned i; + for (i = 0; + saved_builtins->iterate (i, &bi); + ++i) + { + tree decl = bi->decl; + /* Now restore the decl's state */ + if (bi->decl_copy_post) + lipo_restore_decl (decl, bi->decl_copy_post); + } +} + +/* Return true if type T is compiler generated. */ + +bool +c_is_compiler_generated_type (tree t ATTRIBUTE_UNUSED) +{ + return false; +} + +/* Return 1 if lang specific attribute of T1 and T2 are + equivalent. */ + +int +c_cmp_lang_type (tree t1 ATTRIBUTE_UNUSED, + tree t2 ATTRIBUTE_UNUSED) +{ + return 1; +} + + /* Register reserved keyword WORD as qualifier for address space AS. */ void diff --git a/gcc-4.9/gcc/c/c-lang.c b/gcc-4.9/gcc/c/c-lang.c index 97c044362..2b096cf70 100644 --- a/gcc-4.9/gcc/c/c-lang.c +++ b/gcc-4.9/gcc/c/c-lang.c @@ -45,6 +45,27 @@ enum c_language_kind c_language = clk_c; #undef LANG_HOOKS_INIT_TS #define LANG_HOOKS_INIT_TS c_common_init_ts +/* LIPO support. */ +#undef LANG_HOOKS_ADD_BUILT_IN_DECL +#define LANG_HOOKS_ADD_BUILT_IN_DECL c_add_built_in_decl +#undef LANG_HOOKS_SAVE_BUILT_IN_PRE +#define LANG_HOOKS_SAVE_BUILT_IN_PRE c_save_built_in_decl_pre_parsing +#undef LANG_HOOKS_RESTORE_BUILT_IN_PRE +#define LANG_HOOKS_RESTORE_BUILT_IN_PRE c_restore_built_in_decl_pre_parsing +#undef LANG_HOOKS_SAVE_BUILT_IN_POST +#define LANG_HOOKS_SAVE_BUILT_IN_POST c_save_built_in_decl_post_parsing +#undef LANG_HOOKS_RESTORE_BUILT_IN_POST +#define LANG_HOOKS_RESTORE_BUILT_IN_POST c_restore_built_in_decl_post_parsing +#undef LANG_HOOKS_HAS_GLOBAL_NAME +#define LANG_HOOKS_HAS_GLOBAL_NAME c_is_global_scope +#undef LANG_HOOKS_GET_LANG_DECL_SIZE +#define LANG_HOOKS_GET_LANG_DECL_SIZE c_get_lang_decl_size +#undef LANG_HOOKS_IS_GENERATED_TYPE +#define LANG_HOOKS_IS_GENERATED_TYPE c_is_compiler_generated_type +#undef LANG_HOOKS_CMP_LANG_TYPE +#define LANG_HOOKS_CMP_LANG_TYPE c_cmp_lang_type + + /* Each front end provides its own lang hook initializer. */ struct lang_hooks lang_hooks = LANG_HOOKS_INITIALIZER; diff --git a/gcc-4.9/gcc/c/c-parser.c b/gcc-4.9/gcc/c/c-parser.c index 6eb235c5c..a51af2e30 100644 --- a/gcc-4.9/gcc/c/c-parser.c +++ b/gcc-4.9/gcc/c/c-parser.c @@ -1707,14 +1707,10 @@ c_parser_declaration_or_fndef (c_parser *parser, bool fndef_ok, " initializer"); init = convert_lvalue_to_rvalue (init_loc, init, true, true); tree init_type = TREE_TYPE (init.value); - /* As with typeof, remove _Atomic and const - qualifiers from atomic types. */ + /* As with typeof, remove all qualifiers from atomic types. */ if (init_type != error_mark_node && TYPE_ATOMIC (init_type)) init_type - = c_build_qualified_type (init_type, - (TYPE_QUALS (init_type) - & ~(TYPE_QUAL_ATOMIC - | TYPE_QUAL_CONST))); + = c_build_qualified_type (init_type, TYPE_UNQUALIFIED); bool vm_type = variably_modified_type_p (init_type, NULL_TREE); if (vm_type) @@ -3011,16 +3007,11 @@ c_parser_typeof_specifier (c_parser *parser) if (was_vm) ret.expr = c_fully_fold (expr.value, false, &ret.expr_const_operands); pop_maybe_used (was_vm); - /* For use in macros such as those in <stdatomic.h>, remove - _Atomic and const qualifiers from atomic types. (Possibly - all qualifiers should be removed; const can be an issue for - more macros using typeof than just the <stdatomic.h> - ones.) */ + /* For use in macros such as those in <stdatomic.h>, remove all + qualifiers from atomic types. (const can be an issue for more macros + using typeof than just the <stdatomic.h> ones.) */ if (ret.spec != error_mark_node && TYPE_ATOMIC (ret.spec)) - ret.spec = c_build_qualified_type (ret.spec, - (TYPE_QUALS (ret.spec) - & ~(TYPE_QUAL_ATOMIC - | TYPE_QUAL_CONST))); + ret.spec = c_build_qualified_type (ret.spec, TYPE_UNQUALIFIED); } c_parser_skip_until_found (parser, CPP_CLOSE_PAREN, "expected %<)%>"); return ret; @@ -11881,8 +11872,17 @@ c_parser_omp_for_loop (location_t loc, c_parser *parser, enum tree_code code, tree l = build_omp_clause (OMP_CLAUSE_LOCATION (*c), OMP_CLAUSE_LASTPRIVATE); OMP_CLAUSE_DECL (l) = OMP_CLAUSE_DECL (*c); - OMP_CLAUSE_CHAIN (l) = clauses; - clauses = l; + if (code == OMP_SIMD) + { + OMP_CLAUSE_CHAIN (l) + = cclauses[C_OMP_CLAUSE_SPLIT_FOR]; + cclauses[C_OMP_CLAUSE_SPLIT_FOR] = l; + } + else + { + OMP_CLAUSE_CHAIN (l) = clauses; + clauses = l; + } OMP_CLAUSE_SET_CODE (*c, OMP_CLAUSE_SHARED); } } @@ -14064,7 +14064,7 @@ c_parser_array_notation (location_t loc, c_parser *parser, tree initial_index, tree value_tree = NULL_TREE, type = NULL_TREE, array_type = NULL_TREE; tree array_type_domain = NULL_TREE; - if (array_value == error_mark_node) + if (array_value == error_mark_node || initial_index == error_mark_node) { /* No need to continue. If either of these 2 were true, then an error must be emitted already. Thus, no need to emit them twice. */ diff --git a/gcc-4.9/gcc/c/c-tree.h b/gcc-4.9/gcc/c/c-tree.h index 85df8858d..50fa18074 100644 --- a/gcc-4.9/gcc/c/c-tree.h +++ b/gcc-4.9/gcc/c/c-tree.h @@ -677,4 +677,19 @@ extern tree c_check_omp_declare_reduction_r (tree *, int *, void *); extern void pedwarn_c90 (location_t, int opt, const char *, ...) ATTRIBUTE_GCC_DIAG(3,4); extern void pedwarn_c99 (location_t, int opt, const char *, ...) ATTRIBUTE_GCC_DIAG(3,4); +/* LIPO support. */ + +extern int c_get_lang_decl_size (tree t); +extern void c_lipo_dup_lang_type (tree src, tree dest); +extern void c_lipo_copy_lang_type (tree src, tree dest); +extern bool c_is_global_scope (tree decl, void *scope); +extern void c_clear_name_bindings (tree id); +extern void c_add_built_in_decl (tree decl); +extern void c_save_built_in_decl_pre_parsing (void); +extern void c_restore_built_in_decl_pre_parsing (void); +extern void c_save_built_in_decl_post_parsing (void); +extern void c_restore_built_in_decl_post_parsing (void); +extern bool c_is_compiler_generated_type (tree t); +extern int c_cmp_lang_type (tree t1, tree t2); + #endif /* ! GCC_C_TREE_H */ diff --git a/gcc-4.9/gcc/c/c-typeck.c b/gcc-4.9/gcc/c/c-typeck.c index 65aad4565..5838d6a72 100644 --- a/gcc-4.9/gcc/c/c-typeck.c +++ b/gcc-4.9/gcc/c/c-typeck.c @@ -11925,6 +11925,9 @@ c_finish_omp_clauses (tree clauses) s = size_one_node; OMP_CLAUSE_LINEAR_STEP (c) = s; } + else + OMP_CLAUSE_LINEAR_STEP (c) + = fold_convert (TREE_TYPE (t), OMP_CLAUSE_LINEAR_STEP (c)); goto check_dup_generic; check_dup_generic: |