* call.c (standard_conversion): Reorganize pointer conversions.
* pt.c (convert_nontype_argument_function): Convert to ref here.
(convert_nontype_argument): Not here.
(convert_template_argument): Add original type to error message.
(RECUR_AND_CHECK_FAILURE): Remove trailing semicolon.
(unify): Compare function-qualifiers.
* typeck.c (same_type_ignoring_top_level_qualifiers_p): Use
cp_build_qualified_type rather than TYPE_MAIN_VARIANT.
From-SVN: r241943
2016-11-07 François Dumont <fdumont@gcc.gnu.org>
* config/abi/pre/gnu-versioned-namespace.ver: Export C++17 new of
over-aligned types symbols.
From-SVN: r241936
We transform floating point divide instructions to a faster series of
simple instructions, "swdiv". Currently we do not do that until the
first splitter pass, which is much too late for most optimisations
that can happen on those new instructions, e.g. the constant loads
are not CSEd inside an unrolled loop. This patch changes things so
those divide instructions are expanded during expand already.
* config/rs6000/rs6000.md (div<mode>3): Expand using rs6000_emit_swdiv
if appropriate.
* config/rs6000/vector.md (div<mode>3): Ditto.
From-SVN: r241935
2016-11-07 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/78226
* expr.c (gfc_generate_initializer): Add where to EXPR_NULL
statement.
* iresolve.c (gfc_resolve_extends_type_of): Add where to
both arguments of the function.
* resolve.c (resolve_select_type): Add where to the
second argument of the new statement.
From-SVN: r241927
2016-11-07 Martin Jambor <mjambor@suse.cz>
* tree.c (verify_type_variant): Use pointer comparison to check that
TYPE_SIZE_UNIT match.
From-SVN: r241918
PR target/78227
* config/i386/i386.c (ix86_expand_sse_cmp): Force dest into
cmp_mode argument even for -O0 if cmp_mode != mode and maskcmp.
* gcc.target/i386/pr78227-1.c: New test.
* gcc.target/i386/pr78227-2.c: New test.
From-SVN: r241916
PR rtl-optimization/77309
* combine.c (make_compound_operation): Allow EQ for IN_CODE, and
don't assume an equality comparison for plain COMPARE.
(simplify_comparison): Pass a more accurate code to
make_compound_operation.
testsuite/
PR rtl-optimization/77309
* gcc.dg/torture/pr77309.c: New test.
From-SVN: r241912
2016-11-07 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/78826
* match.c (gfc_match_select_type): Add where for expr1.
* resolve.c (resolev_select_type): Add where for expr1 of new
statement.
From-SVN: r241909
gcc/ChangeLog:
* print-rtl.c (rtx_writer::operand_has_default_value_p): New
method.
(rtx_writer::print_rtx): In compact mode, omit trailing operands
that have the default values.
* print-rtl.h (rtx_writer::operand_has_default_value_p): New
method.
* rtl-tests.c (selftest::test_dumping_insns): Remove empty
label string from expected dump.
(seltest::test_uncond_jump): Remove trailing "(nil)" for REG_NOTES
from expected dump.
From-SVN: r241908
PR middle-end/71529
* gcc.target/i386/pr71529.C: Moved to ...
* g++.dg/opt/pr71529.C: ... here. New test. Guard for i?86/x86_64.
PR target/64411
* gcc.target/i386/pr64411.C: Moved to ...
* g++.dg/opt/pr64411.C: ... here. New test. Guard for i?86/x86_64
lp64.
PR target/65105
* gcc.target/i386/pr65105-4.C: Moved to ...
* g++.dg/opt/pr65105-4.C: ... here. New test. Guard for i?86/x86_64.
Run into compile test rather than execute test.
From-SVN: r241903
2016-11-07 Richard Biener <rguenther@suse.de>
PR target/78229
* config/i386/i386.c (ix86_gimple_fold_builtin): Do not adjust
EH info.
* g++.dg/pr78229.C: New testcase.
From-SVN: r241901
2016-11-07 Richard Biener <rguenther@suse.de>
PR tree-optimization/78218
* gimple-ssa-store-merging.c
(pass_store_merging::terminate_all_aliasing_chains):
Drop unused argument, fix alias check to also consider uses.
(pass_store_merging::execute): Adjust.
* gcc.dg/torture/pr78218.c: New testcase.
From-SVN: r241900
PR target/77822
* config/aarch64/aarch64.md (*tb<optab><mode>1): Use
aarch64_simd_shift_imm_<mode> predicate for operand 1.
(<optab>, ANY_EXTRACT): Use tighter predicates on operands 2 and 3
to restrict them to an appropriate range and add FAIL check if the
region they specify is out of range. Delete useless constraint
strings.
(*<optab><mode>, ANY_EXTRACT): Add appropriate predicates on operands
2 and 3 to restrict their range and add pattern predicate.
* g++.dg/torture/pr77822.C: New test.
From-SVN: r241898
* c-warn.c (warn_for_unused_label): Save all labels used
in goto or in &label.
* asan.c (enum asan_check_flags): Move the enum to header file.
(asan_init_shadow_ptr_types): Make type creation more generic.
(shadow_mem_size): New function.
(asan_emit_stack_protection): Use newly added ASAN_SHADOW_GRANULARITY.
Rewritten stack unpoisoning code.
(build_shadow_mem_access): Add new argument return_address.
(instrument_derefs): Instrument local variables if use after scope
sanitization is enabled.
(asan_store_shadow_bytes): New function.
(asan_expand_mark_ifn): Likewise.
(asan_sanitize_stack_p): Moved from asan_sanitize_stack_p.
* asan.h (enum asan_mark_flags): Moved here from asan.c
(asan_protect_stack_decl): Protect all declaration that need
to live in memory.
(asan_sanitize_use_after_scope): New function.
(asan_no_sanitize_address_p): Likewise.
* cfgexpand.c (partition_stack_vars): Consider
asan_sanitize_use_after_scope in condition.
(expand_stack_vars): Likewise.
* common.opt (-fsanitize-address-use-after-scope): New option.
* doc/invoke.texi (use-after-scope-direct-emission-threshold):
Explain the parameter.
* flag-types.h (enum sanitize_code): Define SANITIZE_USE_AFTER_SCOPE.
* gimplify.c (build_asan_poison_call_expr): New function.
(asan_poison_variable): Likewise.
(gimplify_bind_expr): Generate poisoning/unpoisoning for local
variables that have address taken.
(gimplify_decl_expr): Likewise.
(gimplify_target_expr): Likewise for C++ temporaries.
(sort_by_decl_uid): New function.
(gimplify_expr): Unpoison all variables for a label we can jump
from outside of a scope.
(gimplify_switch_expr): Unpoison variables defined in the switch
context.
(gimplify_function_tree): Clear asan_poisoned_variables.
(asan_poison_variables): New function.
(warn_switch_unreachable_r): Handle IFN_ASAN_MARK.
* internal-fn.c (expand_ASAN_MARK): New function.
* internal-fn.def (ASAN_MARK): Declare.
* opts.c (finish_options): Handle -fstack-reuse if
-fsanitize-address-use-after-scope is enabled.
(common_handle_option): Enable address sanitization if
-fsanitize-address-use-after-scope is enabled.
* params.def (PARAM_USE_AFTER_SCOPE_DIRECT_EMISSION_THRESHOLD):
New parameter.
* params.h: Likewise.
* sancov.c (pass_sanopt::execute): Handle IFN_ASAN_MARK.
* sanitizer.def: Define __asan_poison_stack_memory and
__asan_unpoison_stack_memory functions.
* asan.c (asan_mark_poison_p): New function.
(transform_statements): Handle asan_mark_poison_p calls.
* gimple.c (nonfreeing_call_p): Handle IFN_ASAN_MARK.
From-SVN: r241896
2016-11-07 Richard Biener <rguenther@suse.de>
PR tree-optimization/37150
* tree-vectorizer.h (vect_transform_slp_perm_load): Add n_perms
parameter.
* tree-vect-slp.c (vect_supported_load_permutation_p): Adjust.
(vect_analyze_slp_cost_1): Account for the real number of
permutations emitted and for dead loads.
(vect_transform_slp_perm_load): Add n_perms parameter counting
the number of emitted permutations.
* tree-vect-stmts.c (vectorizable_load): Adjust.
From-SVN: r241893
gcc/testsuite/ChangeLog:
2016-11-06 Andre Vehreschild <vehre@gcc.gnu.org>
* gfortran.dg/allocate_with_source_14.f03: Fixed number mallocs
occuring.
gcc/fortran/ChangeLog:
2016-11-06 Andre Vehreschild <vehre@gcc.gnu.org>
* expr.c (is_non_empty_structure_constructor): New function to detect
non-empty structure constructor.
(gfc_has_default_initializer): Analyse initializers.
* resolve.c (cond_init): Removed.
(resolve_allocate_expr): Removed dead code. Moved invariant code out
of the loop over all objects to allocate.
(resolve_allocate_deallocate): Added the invariant code remove from
resolve_allocate_expr.
* trans-array.c (gfc_array_allocate): Removed nullify of structure
components in favour of doing this in gfc_trans_allocate for both
scalars and arrays in the same place.
* trans-expr.c (gfc_trans_init_assign): Always using _vptr->copy for
class objects.
* trans-stmt.c (allocate_get_initializer): Get the initializer
expression for object allocated.
(gfc_trans_allocate): Nullify a derived type only, when no SOURCE=
or MOLD= is present preventing duplicate work. Moved the creation
of the init-expression here to prevent code for conditions that
can not occur on freshly allocated object, like checking for the need
to free allocatable components.
From-SVN: r241885
2016-11-05 Paul Thomas <pault@gcc.gnu.org>
* check.c (gfc_check_move_alloc): Introduce error to prevent
aliasing between to and from arguments.
2016-11-05 Paul Thomas <pault@gcc.gnu.org>
* gfortran.dg/move_alloc_17.f03: New test.
From-SVN: r241872