diff options
author | mrs <mrs@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-09-20 23:01:12 +0000 |
---|---|---|
committer | mrs <mrs@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-09-20 23:01:12 +0000 |
commit | e1dfbe3090ccf6cfbc7275cfdfa38f71647de3ed (patch) | |
tree | 8c98991ecdce73acfe22e53e466031d83b2524c1 /gcc/c | |
parent | 6f44b17da48973c9fe4f7b690879dd90bf8a8c90 (diff) | |
parent | 1b2bf75690af8115739ebba710a44d05388c7a1a (diff) | |
download | gcc-e1dfbe3090ccf6cfbc7275cfdfa38f71647de3ed.tar.gz |
Merge in trunk.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/wide-int@202802 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c')
-rw-r--r-- | gcc/c/ChangeLog | 23 | ||||
-rw-r--r-- | gcc/c/c-decl.c | 3 | ||||
-rw-r--r-- | gcc/c/c-typeck.c | 17 |
3 files changed, 32 insertions, 11 deletions
diff --git a/gcc/c/ChangeLog b/gcc/c/ChangeLog index 3401228c039..81b2018e8c0 100644 --- a/gcc/c/ChangeLog +++ b/gcc/c/ChangeLog @@ -1,3 +1,26 @@ +2013-09-18 Marek Polacek <polacek@redhat.com> + + PR sanitize/58443 + * c-typeck.c (build_binary_op): Properly honor -fsanitize options. + Remove unnecessary check. + +2013-09-18 Marek Polacek <polacek@redhat.com> + + PR sanitizer/58411 + * c-typeck.c (build_binary_op): Don't sanitize function if it has the + no_sanitize_undefined attribute. + +2013-09-13 Kai Tietz <ktietz@redhat.com> + + PR target/57848 + * c-decl.c (c_builtin_function_ext_scope): Remove + wrong assumption that it is never called on prexisting + symbol. + +2013-09-08 Joern Rennecke <joern.rennecke@embecosm.com> + + * c-typeck.c (build_binary_op): Use vector_types_compatible_elements_p. + 2013-09-03 Gabriel Dos Reis <gdr@integrable-solutions.net> * c-objc-common.c (c_tree_printer): Tidy. diff --git a/gcc/c/c-decl.c b/gcc/c/c-decl.c index 321ae0bf53c..5c90f09e85e 100644 --- a/gcc/c/c-decl.c +++ b/gcc/c/c-decl.c @@ -3629,9 +3629,6 @@ c_builtin_function_ext_scope (tree decl) const char *name = IDENTIFIER_POINTER (id); C_DECL_BUILTIN_PROTOTYPE (decl) = prototype_p (type); - /* Should never be called on a symbol with a preexisting meaning. */ - gcc_assert (!I_SYMBOL_BINDING (id)); - bind (id, decl, external_scope, /*invisible=*/false, /*nested=*/false, UNKNOWN_LOCATION); diff --git a/gcc/c/c-typeck.c b/gcc/c/c-typeck.c index de654e6701d..14d5979624d 100644 --- a/gcc/c/c-typeck.c +++ b/gcc/c/c-typeck.c @@ -9989,7 +9989,7 @@ build_binary_op (location_t location, enum tree_code code, if (code0 == VECTOR_TYPE && code1 == VECTOR_TYPE) { tree intt; - if (TREE_TYPE (type0) != TREE_TYPE (type1)) + if (!vector_types_compatible_elements_p (type0, type1)) { error_at (location, "comparing vectors with different " "element types"); @@ -10126,7 +10126,7 @@ build_binary_op (location_t location, enum tree_code code, if (code0 == VECTOR_TYPE && code1 == VECTOR_TYPE) { tree intt; - if (TREE_TYPE (type0) != TREE_TYPE (type1)) + if (!vector_types_compatible_elements_p (type0, type1)) { error_at (location, "comparing vectors with different " "element types"); @@ -10232,8 +10232,7 @@ build_binary_op (location_t location, enum tree_code code, if (code0 == VECTOR_TYPE && code1 == VECTOR_TYPE && (!tree_int_cst_equal (TYPE_SIZE (type0), TYPE_SIZE (type1)) - || !same_scalar_type_ignoring_signedness (TREE_TYPE (type0), - TREE_TYPE (type1)))) + || !vector_types_compatible_elements_p (type0, type1))) { binary_op_error (location, code, type0, type1); return error_mark_node; @@ -10499,8 +10498,10 @@ build_binary_op (location_t location, enum tree_code code, return error_mark_node; } - if (flag_sanitize & SANITIZE_UNDEFINED + if ((flag_sanitize & (SANITIZE_SHIFT | SANITIZE_DIVIDE)) && current_function_decl != 0 + && !lookup_attribute ("no_sanitize_undefined", + DECL_ATTRIBUTES (current_function_decl)) && (doing_div_or_mod || doing_shift)) { /* OP0 and/or OP1 might have side-effects. */ @@ -10508,9 +10509,9 @@ build_binary_op (location_t location, enum tree_code code, op1 = c_save_expr (op1); op0 = c_fully_fold (op0, false, NULL); op1 = c_fully_fold (op1, false, NULL); - if (doing_div_or_mod) + if (doing_div_or_mod && (flag_sanitize & SANITIZE_DIVIDE)) instrument_expr = ubsan_instrument_division (location, op0, op1); - else if (doing_shift) + else if (doing_shift && (flag_sanitize & SANITIZE_SHIFT)) instrument_expr = ubsan_instrument_shift (location, code, op0, op1); } @@ -10538,7 +10539,7 @@ build_binary_op (location_t location, enum tree_code code, ret = build1 (EXCESS_PRECISION_EXPR, semantic_result_type, ret); protected_set_expr_location (ret, location); - if ((flag_sanitize & SANITIZE_UNDEFINED) && instrument_expr != NULL) + if (instrument_expr != NULL) ret = fold_build2 (COMPOUND_EXPR, TREE_TYPE (ret), instrument_expr, ret); |