We need to be able to set the static chain on a few calls within the
Go runtime, so expose this with __builtin_call_with_static_chain.
* c-family/c-common.c (c_common_reswords): Add
__builtin_call_with_static_chain.
* c-family/c-common.h (RID_BUILTIN_CALL_WITH_STATIC_CHAIN): New.
* c/c-parser.c (c_parser_postfix_expression): Handle it.
* doc/extend.texi (__builtin_call_with_static_chain): Document it.
From-SVN: r217771
And, at the same time, allow indirect calls to have a static chain.
We'll always eliminate the static chain if we can prove it's unused.
* calls.c (prepare_call_address): Allow decl or type for first arg.
(expand_call): Pass type to prepare_call_address if no decl.
* gimple-fold.c (gimple_fold_call): Eliminate the static chain if
the function doesn't use it; fold it otherwise.
* gimplify.c (gimplify_call_expr): Gimplify the static chain.
* tree-cfg.c (verify_gimple_call): Allow a static chain on indirect
function calls.
From-SVN: r217770
As opposed to always being a decl. This is a prerequisite
to allowing the static chain to be loaded for indirect calls.
* targhooks.c (default_static_chain): Remove check for
DECL_STATIC_CHAIN.
* config/moxie/moxie.c (moxie_static_chain): Likewise.
* config/i386/i386.c (ix86_static_chain): Allow decl or type
as the first argument.
* config/xtensa/xtensa.c (xtensa_static_chain): Change the name
of the unused first parameter.
* doc/tm.texi (TARGET_STATIC_CHAIN): Document the first parameter
may be a type.
* target.def (static_chain): Likewise.
From-SVN: r217769
PR sanitizer/63879
* fold-const.c (negate_expr_p) <case NEGATE_EXPR>: Return
!TYPE_OVERFLOW_SANITIZED.
(fold_negate_expr) <case INTEGER_CST>: Fold when overflow
does not trap and when overflow wraps, or when SANITIZE_SI_OVERFLOW
is 0.
* c-c++-common/ubsan/pr63879-1.c: New test.
* c-c++-common/ubsan/pr63879-2.c: New test.
From-SVN: r217766
2014-11-19 Tom de Vries <tom@codesourcery.com>
PR tree-optimization/62167
* tree-ssa-tail-merge.c (stmt_local_def): Handle statements with vuse
conservatively.
(gimple_equal_p): Don't use vn_valueize to compare for lhs equality of
assigns.
* gcc.dg/pr51879-12.c: Add xfails.
* gcc.dg/pr62167-run.c: New test.
* gcc.dg/pr62167.c: New test.
From-SVN: r217761
PR tree-optimization/63915
* tree-vect-stmts.c (vectorizable_simd_clone_call): Pass
true instead of false as last argument to gsi_replace.
* c-c++-common/gomp/pr60823-4.c: New test.
From-SVN: r217759
PR sanitizer/63520
* internal-fn.c (expand_ubsan_result_store): New function.
(expand_addsub_overflow, expand_neg_overflow, expand_mul_overflow):
Use it instead of just emit_move_insn.
* c-c++-common/ubsan/pr63520.c: New test.
From-SVN: r217758
2014-11-19 Richard Biener <rguenther@suse.de>
PR tree-optimization/63844
* omp-low.c (fixup_child_record_type): Use a restrict qualified
referece type for the receiver parameter.
From-SVN: r217757
PR sanitizer/63913
* ubsan.c: Include tree-eh.h.
(instrument_bool_enum_load): Handle loads that can throw.
* g++.dg/ubsan/pr63913.C: New test.
From-SVN: r217755
PR rtl-optimization/63843
* simplify-rtx.c (simplify_binary_operation_1) <case ASHIFTRT>: For
optimization of ashiftrt of subreg of lshiftrt, check that code
is ASHIFTRT.
* gcc.c-torture/execute/pr63843.c: New test.
From-SVN: r217753
2014-11-18 Andrew MacLeod <amacleod@redhat.com>
* attribs.c (decl_attributes): Remove always true condition,
TREE_TYPE(x) will never compare equal to a TYPE_DECL.
From-SVN: r217750
PR sanitizer/63813
* c-ubsan.c (ubsan_maybe_instrument_reference_or_call): Change type
argument to ptype, set type to TREE_TYPE (ptype). Don't call
get_pointer_alignment for non-pointers. Use ptype, or if it is
reference type, corresponding pointer type, as type of kind
argument.
(ubsan_maybe_instrument_reference,
ubsan_maybe_instrument_member_call): Adjust callers.
* g++.dg/ubsan/pr63813.C: New test.
From-SVN: r217741
* fibonacci_heap.h: New file.
(fibonacci_heap::insert): Created from fibheap_insert.
(fibonacci_heap::empty): Created from fibheap_empty.
(fibonacci_heap::nodes): Created from fibheap_nodes.
(fibonacci_heap::min_key): Created from fibheap_min_key.
(fibonacci_heap::decrease_key): Created from fibheap_replace_key.
(fibonacci_heap::replace_key_data): Created from fibheap_replace_key_data.
(fibonacci_heap::extract_min): Created from fibheap_extract_min.
(fibonacci_heap::min): Created from fibheap_min.
(fibonacci_heap::replace_data): Created from fibheap_replace_data.
(fibonacci_heap::delete_node): Created from fibheap_delete_node.
(fibonacci_heap::union_with): Created from fibheap_union.
* ipa-inline.c (update_edge_key): New heap API is used.
(update_caller_keys): Likewise.
(update_callee_keys): Likewise.
(lookup_recursive_calls): Likewise.
(recursive_inlining): Likewise.
(add_new_edges_to_heap): Likewise.
(heap_edge_removal_hook): Likewise.
(inline_small_functions): Likewise.
From-SVN: r217720