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
2016-11-05 Paul Thomas <pault@gcc.gnu.org>
PR fortran/67564
* trans-expr.c (gfc_conv_class_to_class): Return _len component
of unlimited polymorphic entities.
2016-11-05 Paul Thomas <pault@gcc.gnu.org>
PR fortran/67564
* gfortran.dg/select_type_39.f03: New test.
From-SVN: r241869
PR go/78172.
libgo: avoid confusion in upcase_fields in mksysinfo.sh
The mksysinfo.sh script could get confused when there were multiple
types starting with the same name. I believe this is the underlying
cause of GCC PR 78172.
Also redirect a grep to /dev/null to avoid extraneous messages during
the build.
Reviewed-on: https://go-review.googlesource.com/32821
From-SVN: r241868
Adjust some comments, add some explicit fall through comments or explicit
returns where necessary to not get implicit-fallthrough warnings.
All fall throughs were deliberate. In one case I added an explicit return
false for clarity instead of falling through a default case (that also
would return false).
libiberty/ChangeLog:
* cplus-dem.c (demangle_signature): Move fall through comment.
(demangle_fund_type): Add fall through comment between 'G' and 'I'.
* hashtab.c (iterative_hash): Add fall through comments.
* regex.c (regex_compile): Add Fall through comment after '+'/'?'.
(byte_re_match_2_internal): Add Fall through comment after jump_n.
Change "Note fall through" to "Fall through".
(common_op_match_null_string_p): Return false after set_number_at
instead of fall through.
From-SVN: r241864
2016-04-19 Paul Thomas <pault@gcc.gnu.org>
PR fortran/64933
* primary.c (gfc_match_varspec): If selector expression is
unambiguously an array, make sure that the associate name
is an array and has an array spec. Modify the original
condition for doing this to exclude character types.
2016-04-19 Paul Thomas <pault@gcc.gnu.org>
PR fortran/64933
* gfortran.dg/associate_23.f90: New test.
From-SVN: r241860
gcc/ChangeLog:
* config/i386/i386.c: Include "selftest.h" and "selftest-rtl.h".
(selftest::ix86_test_dumping_hard_regs): New function.
(selftest::ix86_run_selftests): New function.
(TARGET_RUN_TARGET_SELFTESTS): When CHECKING_P, wire this up to
selftest::ix86_run_selftests.
* doc/tm.texi.in (TARGET_RUN_TARGET_SELFTESTS): New.
* doc/tm.texi: Regenerate
* selftest-rtl.h: New file.
* rtl-tests.c: Include "selftest-rtl.h".
(selftest::assert_rtl_dump_eq): Make non-static.
(ASSERT_RTL_DUMP_EQ): Move to selftest-rtl.h.
(selftest::test_dumping_regs): Update comment.
* selftest-run-tests.c: Include "target.h".
(selftest::run_tests): If non-NULL, call
targetm.run_target_selftests.
* target.def (run_target_selftests): New hook.
From-SVN: r241851
2016-11-04 Thomas Preud'homme <thomas.preudhomme@arm.com>
gcc/
* config/arm/arm-arches.def (armv8-m.main+dsp): Set Cortex-M33 as
representative core for this architecture.
* config/arm/arm-cores.def (cortex-m33): Define new processor.
* config/arm/arm-tables.opt: Regenerate.
* config/arm/arm-tune.md: Likewise.
* config/arm/bpabi.h (BE8_LINK_SPEC): Add Cortex-M33 to the list of
valid -mcpu options.
* doc/invoke.texi (ARM Options): Document new Cortex-M33 processor.
From-SVN: r241849
2016-11-04 Thomas Preud'homme <thomas.preudhomme@arm.com>
gcc/
* config/arm/arm-arches.def (armv8-m.base): Set Cortex-M23 as
representative core for this architecture.
* config/arm/arm-cores.def (cortex-m23): Define new processor.
* config/arm/arm-tables.opt: Regenerate.
* config/arm/arm-tune.md: Likewise.
* config/arm/arm.c (arm_v6m_tune): Add Cortex-M23 to the list of cores
this tuning parameters apply to in the comment.
* config/arm/bpabi.h (BE8_LINK_SPEC): Add Cortex-M23 to the list of
valid -mcpu options.
* doc/invoke.texi (ARM Options): Document new Cortex-M23 processor.
From-SVN: r241848
* fold-const.c (fold_cond_expr_with_comparison): Remove call
to pedantic_non_lvalue_loc. Remove useless code for lvalue
where cond_expr can't be a lvalue.
From-SVN: r241847
2016-11-04 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
PR tree-optimization/78210
* gcc.dg/tree-ssa/slsr-8.c: Fix slsr scan to include the
possibility of widening multiplies.
From-SVN: r241845
2016-11-03 Michael Meissner <meissner@linux.vnet.ibm.com>
PR target/78192
* config/rs6000/vsx.md (vsx_extract_<mode>_di): The element number
has already been adjusted for endianness, so don't adjust it any
further.
From-SVN: r241834
2016-11-03 Michael Meissner <meissner@linux.vnet.ibm.com>
PR target/77993
* config/rs6000/rs6000.h (FLOAT128_IBM_P): Do not allow IFmode or
ICmode unless we have standard PowerPC floating point.
* config/rs6000/rs6000.md (FP iterator): Likewise.
(FMOVE128 iterator): Likewise.
From-SVN: r241833
PR debug/28767
PR debug/56974
* langhooks.h (struct lang_hooks_for_types): Add type_dwarf_attribute
langhook.
* langhooks.c (lhd_type_dwarf_attribute): New function.
* langhooks-def.h (lhd_type_dwarf_attribute): Declare.
(LANG_HOOKS_TYPE_DWARF_ATTRIBUTE): Define.
(LANG_HOOKS_FOR_TYPES_INITIALIZER): Add
LANG_HOOKS_TYPE_DWARF_ATTRIBUTE.
(check_qualified_type, check_aligned_type): Call it.
* dwarf2out.c (modified_type_die): Don't use type_main_variant
for FUNCTION_TYPE or METHOD_TYPE, instead walk over variants with
check_base_type and check_lang_type.
(gen_ptr_to_mbr_type_die): If lookup_type_die is already non-NULL,
return early. For pointer-to-data-member add DW_AT_use_location
attribute.
(gen_subroutine_type_die): Add DW_AT_{,rvalue_}reference attribute
if needed.
(gen_type_die_with_usage): Don't use type_main_variant
for FUNCTION_TYPE or METHOD_TYPE, instead walk over variants with
check_base_type and check_lang_type. Formatting fixes. Call
get_debug_type langhook.
cp/
* tree.c (cp_check_qualified_type): Use check_base_type and
TYPE_QUALS comparison instead of check_qualified_type.
(cxx_type_hash_eq): Return false if type_memfn_rqual don't match.
* cp-objcp-common.c (cp_get_debug_type): New function.
(cp_decl_dwarf_attribute): Don't handle types here.
(cp_type_dwarf_attribute): New function.
* cp-objcp-common.h (cp_get_debug_type, cp_type_dwarf_attribute):
Declare.
(LANG_HOOKS_GET_DEBUG_TYPE, LANG_HOOKS_TYPE_DWARF_ATTRIBUTE):
Define.
testsuite/
* g++.dg/debug/dwarf2/ptrdmem-1.C: New test.
* g++.dg/debug/dwarf2/ref-3.C: New test.
* g++.dg/debug/dwarf2/ref-4.C: New test.
* g++.dg/debug/dwarf2/refqual-1.C: New test.
* g++.dg/debug/dwarf2/refqual-2.C: New test.
From-SVN: r241832
gcc/
* tree.c (check_lang_type): New.
(check_qualified_type): Use it.
(check_aligned_type): Use it.
* tree.h: Declare it.
gcc/cp/
* tree.c (cp_check_qualified_type): Call check_base_type instead
of check_qualified_type.
(cxx_type_hash_eq): Check ref-qualifiers.
* typeck.c (apply_memfn_quals): No need to mess with TYPE_CANONICAL.
From-SVN: r241831