This patch uses subreg_size_lowpart_offset in places that open-coded
the calculation. The reload use (and the LRA one that was based on it)
seemed to ignore the BYTES_BIG_ENDIAN != WORDS_BIG_ENDIAN case; it's not
obvious whether that was deliberate or an oversight.
2017-10-22 Richard Sandiford <richard.sandiford@linaro.org>
Alan Hayward <alan.hayward@arm.com>
David Sherwood <david.sherwood@arm.com>
Add wide_int version of inchash::hash::add_wide_int
This patch adds an inchash hasher for wide_int-based types.
It means that hash_tree no longer hashes TREE_INT_CST_EXT_NUNITS,
but that was redundant with hashing the type.
2017-10-22 Richard Sandiford <richard.sandiford@linaro.org>
gcc/
* inchash.h (inchash::hash::add_wide_int): New function.
* lto-streamer-out.c (hash_tree): Use it.
Igor Tsimbalist [Sat, 21 Oct 2017 21:16:32 +0000 (23:16 +0200)]
Add x86 CET documentation.
gcc/doc/
* extend.texi: Add x86 specific to 'nocf_check' attribute.
List CET intrinsics.
* invoke.texi: Add -mcet, -mibt, -mshstk options. Add x86
specific to -fcf-protection option.
Igor Tsimbalist [Sat, 21 Oct 2017 21:09:53 +0000 (23:09 +0200)]
Update x86 backend to enable Intel CET.
All platforms except i386 will report the error and do no
instrumentation with -finstrument-control-flow option. i386
will provide the implementation based on a specification
published by Intel for a new technology called Control-flow
Enforcement Technology (CET). The spec is available at
The implementation in this patch:
1) enables Control-flow Enforcement Technology (CET), published by
Intel. This part introduces i386 specific options -mcet, -mibt and
-mshstk, new instructions and intrinsics;
2) provides support for -fcf-protection option and 'nocf_check'
attribute by doing needed code instrumentation, which is based on
CET features.
case scalar_load:
- return ix86_cost->scalar_load_cost;
+ /* load/store costs are relative to register move which is 2. Recompute
+ it to COSTS_N_INSNS so everything have same base. */
+ return COSTS_N_INSNS (fp ? ix86_cost->sse_load[0]
+ : ix86_cost->int_load [2]) / 2;
case vec_to_scalar:
- return ix86_cost->vec_to_scalar_cost;
-
case scalar_to_vec:
- return ix86_cost->scalar_to_vec_cost;
+ return ix86_vec_cost (mode, ix86_cost->sse_op, true);
+ /* We should have separate costs for unaligned loads and gather/scatter.
+ Do that incrementally. */
case unaligned_load:
- case unaligned_store:
case vector_gather_load:
+ return ix86_vec_cost (mode,
+ COSTS_N_INSNS (ix86_cost->sse_load[2]),
+ true);
+
+ case unaligned_store:
case vector_scatter_store:
- return ix86_cost->vec_unalign_load_cost;
+ return ix86_vec_cost (mode,
+ COSTS_N_INSNS (ix86_cost->sse_store[2]),
+ true);
case cond_branch_taken:
return ix86_cost->cond_taken_branch_cost;
@@ -44091,10 +44115,11 @@ ix86_builtin_vectorization_cost (enum ve
case vec_perm:
case vec_promote_demote:
- return ix86_cost->vec_stmt_cost;
+ return ix86_vec_cost (mode,
+ ix86_cost->sse_op, true);
Eric Botcazou [Sat, 21 Oct 2017 09:53:50 +0000 (09:53 +0000)]
utils.c (pad_type_hash): Use hashval_t for hash value.
* gcc-interface/utils.c (pad_type_hash): Use hashval_t for hash value.
(convert): Do not use an unchecked conversion for converting from a
type to another type padding it.
Paul Thomas [Sat, 21 Oct 2017 09:02:17 +0000 (09:02 +0000)]
re PR fortran/82586 ([PDT] ICE: write_symbol(): bad module symbol)
2017-10-21 Paul Thomas <pault@gcc.gnu.org>
PR fortran/82586
* decl.c (gfc_get_pdt_instance): Remove the error message that
the parameter does not have a corresponding component since
this is now taken care of when the derived type is resolved. Go
straight to error return instead.
(gfc_match_formal_arglist): Make the PDT relevant errors
immediate so that parsing of the derived type can continue.
(gfc_match_derived_decl): Do not check the match status on
return from gfc_match_formal_arglist for the same reason.
* resolve.c (resolve_fl_derived0): Check that each type
parameter has a corresponding component.
PR fortran/82587
* resolve.c (resolve_generic_f): Check that the derived type
can be used before resolving the struture constructor.
PR fortran/82589
* symbol.c (check_conflict): Add the conflicts involving PDT
KIND and LEN attributes.
2017-10-21 Paul Thomas <pault@gcc.gnu.org>
PR fortran/82586
* gfortran.dg/pdt_16.f03 : New test.
* gfortran.dg/pdt_4.f03 : Catch the changed messages.
* gfortran.dg/pdt_8.f03 : Ditto.
PR fortran/82587
* gfortran.dg/pdt_17.f03 : New test.
PR fortran/82589
* gfortran.dg/pdt_18.f03 : New test.
Jonathan Wakely [Fri, 20 Oct 2017 21:05:11 +0000 (22:05 +0100)]
Update value of __cpp_lib_chrono feature-test macro
* include/std/chrono (__cpp_lib_chrono): Update macro value to
indicate support for P0505R0.
* testsuite/20_util/duration/arithmetic/constexpr_c++17.cc: Check
for updated macro.
Ian Lance Taylor [Fri, 20 Oct 2017 18:34:36 +0000 (18:34 +0000)]
debug/dwarf: support 64-bit DWARF in byte order check
Also fix 64-bit DWARF to read a 64-bit abbrev offset in the
compilation unit.
This is a backport of https://golang.org/cl/71171, which will be in
the Go 1.10 release, to the gofrontend copy. Doing it now because AIX
is pretty much the only system that uses 64-bit DWARF.
s-osinte__linux.ads (Relative_Timed_Wait): Add variable needed for using monotonic clock.
gcc/ada/
2017-10-20 Doug Rupp <rupp@adacore.com>
* libgnarl/s-osinte__linux.ads (Relative_Timed_Wait): Add variable
needed for using monotonic clock.
* libgnarl/s-taprop__linux.adb: Revert previous monotonic clock
changes.
* libgnarl/s-taprop__linux.adb, s-taprop__posix.adb: Unify and factor
out monotonic clock related functions body.
(Timed_Sleep, Timed_Delay, Montonic_Clock, RT_Resolution,
Compute_Deadline): Move to...
* libgnarl/s-tpopmo.adb: ... here. New separate package body.
2017-10-20 Ed Schonberg <schonberg@adacore.com>
* sem_util.adb (Is_Controlling_Limited_Procedure): Handle properly the
case where the controlling formal is an anonymous access to interface
type.
* exp_ch9.adb (Extract_Dispatching_Call): If controlling actual is an
access type, handle properly the the constructed dereference that
designates the object used in the rewritten synchronized call.
(Parameter_Block_Pack): If the type of the actual is by-copy, its
generated declaration in the parameter block does not need an
initialization even if the type is a null-excluding access type,
because it will be initialized with the value of the actual later on.
(Parameter_Block_Pack): Do not add controlling actual to parameter
block when its type is by-copy.
2017-10-20 Justin Squirek <squirek@adacore.com>
* sem_ch8.adb (Update_Use_Clause_Chain): Add sanity check to verify
scope stack traversal into the context clause.
gcc/testsuite/
2017-10-20 Ed Schonberg <schonberg@adacore.com>
* gnat.dg/sync_iface_call.adb, gnat.dg/sync_iface_call_pkg.ads,
gnat.dg/sync_iface_call_pkg2.adb, gnat.dg/sync_iface_call_pkg2.ads:
New testcase.
sem_dim.adb (Analyze_Dimension_Binary_Op): Accept with a warning to compare a dimensioned expression with a literal.
gcc/ada/
2017-10-20 Yannick Moy <moy@adacore.com>
* sem_dim.adb (Analyze_Dimension_Binary_Op): Accept with a warning to
compare a dimensioned expression with a literal.
(Dim_Warning_For_Numeric_Literal): Do not issue a warning for the
special value zero.
* doc/gnat_ugn/gnat_and_program_execution.rst: Update description of
dimensionality system in GNAT.
* gnat_ugn.texi: Regenerate.
2017-10-20 Yannick Moy <moy@adacore.com>
* sem_ch6.adb (Analyze_Expression_Function.Freeze_Expr_Types): Remove
inadequate silencing of errors.
* sem_util.adb (Check_Part_Of_Reference): Do not issue an error when
checking the subprogram body generated from an expression function,
when this is done as part of the preanalysis done on expression
functions, as the subprogram body may not yet be attached in the AST.
The error if any will be issued later during the analysis of the body.
(Is_Aliased_View): Trivial rewrite with Is_Formal_Object.
2017-10-20 Arnaud Charlet <charlet@adacore.com>
* sem_ch8.adb (Update_Chain_In_Scope): Add missing [-gnatwu] marker for
warning on ineffective use clause.
2017-10-20 Eric Botcazou <ebotcazou@adacore.com>
* exp_ch11.ads (Warn_If_No_Local_Raise): Declare.
* exp_ch11.adb (Expand_Exception_Handlers): Use Warn_If_No_Local_Raise
to issue the warning on the absence of local raise.
(Possible_Local_Raise): Do not issue the warning for Call_Markers.
(Warn_If_No_Local_Raise): New procedure to issue the warning on the
absence of local raise.
* sem_elab.adb: Add with and use clauses for Exp_Ch11.
(Record_Elaboration_Scenario): Call Possible_Local_Raise in the cases
where a scenario could give rise to raising Program_Error.
* sem_elab.adb: Typo fixes.
* fe.h (Warn_If_No_Local_Raise): Declare.
* gcc-interface/gigi.h (get_exception_label): Change return type.
* gcc-interface/trans.c (gnu_constraint_error_label_stack): Change to
simple vector of Entity_Id.
(gnu_storage_error_label_stack): Likewise.
(gnu_program_error_label_stack): Likewise.
(gigi): Adjust to above changes.
(Raise_Error_to_gnu): Likewise.
(gnat_to_gnu) <N_Goto_Statement>: Set TREE_USED on the label.
(N_Push_Constraint_Error_Label): Push the label onto the stack.
(N_Push_Storage_Error_Label): Likewise.
(N_Push_Program_Error_Label): Likewise.
(N_Pop_Constraint_Error_Label): Pop the label from the stack and issue
a warning on the absence of local raise.
(N_Pop_Storage_Error_Label): Likewise.
(N_Pop_Program_Error_Label): Likewise.
(push_exception_label_stack): Delete.
(get_exception_label): Change return type to Entity_Id and adjust.
* gcc-interface/utils2.c (build_goto_raise): Change type of first
parameter to Entity_Id and adjust. Set TREE_USED on the label.
(build_call_raise): Adjust calls to get_exception_label and also
build_goto_raise.
(build_call_raise_column): Likewise.
(build_call_raise_range): Likewise.
* doc/gnat_ugn/building_executable_programs_with_gnat.rst (-gnatw.x):
Document actual default behavior.
2017-10-20 Piotr Trojanek <trojanek@adacore.com>
* einfo.ads: Minor consistent punctuation in comment. All numbered
items in the comment of Is_Internal are now terminated with a period.
2017-10-20 Piotr Trojanek <trojanek@adacore.com>
* exp_util.adb (Build_Temporary): Mark created temporary entity as
internal.
2017-10-20 Piotr Trojanek <trojanek@adacore.com>
* sem_type.adb (In_Generic_Actual): Simplified.
2017-10-20 Justin Squirek <squirek@adacore.com>
* sem_ch12.adb (Check_Formal_Package_Instance): Add sanity check to
verify a renaming exists for a generic formal before comparing it to
the actual as defaulted formals will not have a renamed_object.
2017-10-20 Javier Miranda <miranda@adacore.com>
* exp_ch6.adb (Replace_Returns): Fix wrong management of
N_Block_Statement nodes.
gcc/testsuite/
2017-10-20 Justin Squirek <squirek@adacore.com>
* gnat.dg/default_pkg_actual.adb, gnat.dg/default_pkg_actual2.adb: New
testcases.
exp_aggr.adb (Initialize_Array_Component): Avoid adjusting a component of an array aggregate if...
gcc/ada/
2017-10-20 Bob Duff <duff@adacore.com>
* exp_aggr.adb (Initialize_Array_Component): Avoid adjusting a
component of an array aggregate if it is initialized by a
build-in-place function call.
* exp_ch6.adb (Is_Build_In_Place_Result_Type): Use -gnatd.9 to disable
bip for nonlimited types.
* debug.adb: Document -gnatd.9.
2017-10-20 Bob Duff <duff@adacore.com>
* sem_ch12.adb: Remove redundant setting of Parent.
2017-10-20 Eric Botcazou <ebotcazou@adacore.com>
* sem_ch4.adb (Find_Concatenation_Types): Filter out operators if one
of the operands is a string literal.
2017-10-20 Bob Duff <duff@adacore.com>
* einfo.ads: Comment fix.
2017-10-20 Clement Fumex <fumex@adacore.com>
* switch-c.adb: Remove -gnatwm from the switches triggered by -gnateC.
2017-10-20 Ed Schonberg <schonberg@adacore.com>
* sem_dim.adb (Extract_Power): Accept dimension values that are not
non-negative integers when the dimensioned base type is an Integer
type.
gcc/testsuite/
2017-10-20 Ed Schonberg <schonberg@adacore.com>
* gnat.dg/dimensions.adb, gnat.dg/dimensions.ads: New testcase.
Bob Duff [Fri, 20 Oct 2017 14:51:32 +0000 (14:51 +0000)]
sinfo.ads, sinfo.adb (Alloc_For_BIP_Return): New flag to indicate that an allocator came from a b-i-p return statement.
2017-10-20 Bob Duff <duff@adacore.com>
* sinfo.ads, sinfo.adb (Alloc_For_BIP_Return): New flag to indicate
that an allocator came from a b-i-p return statement.
* exp_ch4.adb (Expand_Allocator_Expression): Avoid adjusting the return
object of a nonlimited build-in-place function call.
* exp_ch6.adb (Expand_N_Extended_Return_Statement): Set the
Alloc_For_BIP_Return flag on generated allocators.
* sem_ch5.adb (Analyze_Assignment): Move Assert to where it can't fail.
If the N_Assignment_Statement has been transformed into something else,
then Should_Transform_BIP_Assignment won't work.
* exp_ch3.adb (Expand_N_Object_Declaration): A previous revision said,
"Remove Adjust if we're building the return object of an extended
return statement in place." Back out that part of the change, because
the Alloc_For_BIP_Return flag is now used for that.
A proposal is to introduce a target independent flag
-fcf-protection=[none|branch|return|full] with a semantic to
instrument a code to control validness or integrity of control-flow
transfers using jump and call instructions. The main goal is to detect
and block a possible malware execution through transfer the execution
to unknown target address. Implementation could be either software or
target based. Any target platforms can provide their implementation
for instrumentation under this option.
The compiler should instrument any control-flow transfer points in a
program (ex. call/jmp/ret) as well as any landing pads, which are
targets of control-flow transfers.
A new 'nocf_check' attribute is introduced to provide hand tuning
support. The attribute directs the compiler to skip a call to a
function and a function's landing pad from instrumentation. The
attribute can be used for function and pointer to function types,
otherwise it will be ignored.
Currently all platforms except i386 will report the error and do no
instrumentation. i386 will provide the implementation based on a
specification published by Intel for a new technology called
Control-flow Enforcement Technology (CET).
gcc/c-family/
* c-attribs.c (handle_nocf_check_attribute): New function.
(c_common_attribute_table): Add 'nocf_check' handling.
gcc/c/
* gimple-parser.c: Add second argument NULL to
gimple_build_call_from_tree.
gcc/
* attrib.c (comp_type_attributes): Check nocf_check attribute.
* cfgexpand.c (expand_call_stmt): Set REG_CALL_NOCF_CHECK for
call insn.
* combine.c (distribute_notes): Add REG_CALL_NOCF_CHECK handling.
* common.opt: Add fcf-protection flag.
* emit-rtl.c (try_split): Add REG_CALL_NOCF_CHECK handling.
* flag-types.h: Add enum cf_protection_level.
* gimple.c (gimple_build_call_from_tree): Add second parameter.
Add 'nocf_check' attribute propagation to gimple call.
* gimple.h (gf_mask): Add GF_CALL_NOCF_CHECK.
(gimple_build_call_from_tree): Update prototype.
(gimple_call_nocf_check_p): New function.
(gimple_call_set_nocf_check): Likewise.
* gimplify.c: Add second argument to gimple_build_call_from_tree.
* ipa-icf.c: Add nocf_check attribute in statement hash.
* recog.c (peep2_attempt): Add REG_CALL_NOCF_CHECK handling.
* reg-notes.def: Add REG_NOTE (CALL_NOCF_CHECK).
* toplev.c (process_options): Add flag_cf_protection handling.
Richard Earnshaw [Fri, 20 Oct 2017 12:33:39 +0000 (12:33 +0000)]
[arm] Fix architecture selection when building libatomic with automatic FPU selection
Libatomic builds a few functions for Arm with an explicit -march
option. This option does not specify an FPU, which can lead to
problems when targeting a hard-float or softfp environment since the
architecture appears to be incompatible with the selected ABI.
The fix is simple enough, just add +fp (the minimum floating point
option) to the architecture. We don't use anything from the FP
architecture, so it shouldn't really change anything; and if we are
building for -mfloat-abi=soft the canonicalization process will remove
the unnecessary fp attributes anyway.
* Makefile.am: (IFUNC_OPTIONS): Set the architecture to
-march=armv7-a+fp on Linux/Arm.
* Makefile.in: Regenerated.
Jakub Jelinek [Fri, 20 Oct 2017 07:35:48 +0000 (09:35 +0200)]
re PR target/82158 (_Noreturn functions that do return clobber caller's registers on ARM32 (but not other arches))
PR target/82158
* tree-cfg.c (pass_warn_function_return::execute): In noreturn
functions when optimizing replace GIMPLE_RETURN stmts with
calls to __builtin_unreachable ().
Jakub Jelinek [Fri, 20 Oct 2017 07:32:35 +0000 (09:32 +0200)]
re PR sanitizer/82595 (bootstrap fails in libsanitizer on powerpc64-unknown-linux-gnu)
PR sanitizer/82595
* config/gnu-user.h (LIBTSAN_EARLY_SPEC): Add libtsan_preinit.o
for -fsanitize=thread link of executables.
(LIBLSAN_EARLY_SPEC): Add liblsan_preinit.o for -fsanitize=leak
link of executables.
Jakub Jelinek [Fri, 20 Oct 2017 07:30:33 +0000 (09:30 +0200)]
re PR target/82370 (AVX512 can use a memory operand for immediate-count vpsrlw, but gcc doesn't.)
PR target/82370
* config/i386/sse.md (VI248_AVX2, VI248_AVX512BW, VI248_AVX512BW_2):
New mode iterators.
(<shift_insn><mode>3<mask_name>): Change the last of the 3
define_insns for logical vector shifts to use VI248_AVX512BW
iterator instead of VI48_AVX512, remove <mask_mode512bit_condition>
condition, useless isa and prefix attributes. Change the first
2 of these define_insns to ...
(<mask_codefor><shift_insn><mode>3<mask_name>): ... this, new
define_insn for avx512vl.
(<shift_insn><mode>3): ... and this, new define_insn without
masking for non-avx512vl.
* gcc.target/i386/avx-pr82370.c: New test.
* gcc.target/i386/avx2-pr82370.c: New test.
* gcc.target/i386/avx512f-pr82370.c: New test.
* gcc.target/i386/avx512bw-pr82370.c: New test.
* gcc.target/i386/avx512vl-pr82370.c: New test.
* gcc.target/i386/avx512vlbw-pr82370.c: New test.
Jakub Jelinek [Fri, 20 Oct 2017 07:28:25 +0000 (09:28 +0200)]
re PR target/82370 (AVX512 can use a memory operand for immediate-count vpsrlw, but gcc doesn't.)
PR target/82370
* config/i386/sse.md (*andnot<mode>3,
<mask_codefor><code><mode>3<mask_name>, *<code><mode>3): Split
(=v,v,vm) alternative into (=x,x,xm) and (=v,v,vm), for 128-bit
and 256-bit vectors, the (=x,x,xm) alternative and when mask is
not applied use empty suffix even for TARGET_AVX512VL.
* config/i386/subst.md (mask_prefix3, mask_prefix4): When mask
is applied, supply evex,evex or evex,evex,evex instead of just
evex.
* sem_elab.adb (Compilation_Unit): Handle the case of a subprogram
instantiation that acts as a compilation unit.
(Find_Code_Unit): Reimplemented.
(Find_Top_Unit): Reimplemented.
(Find_Unit_Entity): New routine.
(Process_Instantiation_SPARK): Correct the elaboration requirement a
package instantiation imposes on a unit.
2017-10-19 Bob Duff <duff@adacore.com>
* exp_ch6.adb (Is_Build_In_Place_Result_Type): Enable build-in-place
for a narrow set of controlled types.
* exp_attr.adb (Expand_N_Attribute_Reference): Disable
Make_Build_In_Place_Call_... for F(...)'Old, where F(...) is a
build-in-place function call so that the temp is declared in the right
place.
Alan Modra [Thu, 19 Oct 2017 23:06:20 +0000 (09:36 +1030)]
PR82575, lto debugobj references __gnu_lto_slim, ld test liblto-17 fails
If __gnu_lto_slim is global, undefined, default visibility in the
early debug object, then it finds its way into .dynsym when creating
shared libraries. __gnu_lto_slim in a symbol table (.dynsym or
.symtab) signals nm and other binutils that the object is an LTO
object needing a plugin, but that isn't the case for the ld liblti-17
tests. So, make __gnu_lto_slim hidden to prevent it becoming
dynamic. Further, make it weak because some linkers may warn on
finding an undefined global non-default visibility symbol.
PR lto/82575
* simple-object-elf.c (simple_object_elf_copy_lto_debug_sections):
Make discarded non-local symbols weak and hidden.
Jonathan Wakely [Thu, 19 Oct 2017 13:57:10 +0000 (14:57 +0100)]
Improve tests for error reporting in Filesystem TS
* testsuite/experimental/filesystem/iterators/
recursive_directory_iterator.cc: Ensure that error_code arguments are
cleared when required.
* testsuite/experimental/filesystem/operations/create_directory.cc:
Remove redundant check.
* testsuite/experimental/filesystem/operations/temp_directory_path.cc:
Ensure that error_code argument is cleared when required.
Jonathan Wakely [Thu, 19 Oct 2017 13:57:06 +0000 (14:57 +0100)]
Fix path::iterator post-increment and post-decrement
* include/experimental/bits/fs_path.h (path::iterator++(int))
(path::iterator--(int)): Fix for paths with only one component.
* testsuite/experimental/filesystem/path/itr/traversal.cc: Test
post-increment and post-decrement.
Eric Botcazou [Thu, 19 Oct 2017 13:50:10 +0000 (13:50 +0000)]
re PR debug/82509 (DW_AT_endianity issues with attribute scalar_storage_order)
PR debug/82509
* dwarf2out.c (new_die_raw): New static inline function.
(new_die): Use it to create the DIE.
(add_AT_external_die_ref): Likewise.
(clone_die): Likewise.
(clone_as_declaration): Likewise.
(dwarf2out_vms_debug_main_pointer): Likewise.
(base_type_die): Likewise. Remove early return for corner cases.
Do not call add_pubtype on the DIE here.
(is_base_type): Remove ERROR_MARK and return 0 for VOID_TYPE.
(modified_type_die): Adjust the lookup for reverse order DIEs. Skip
typedefs for base types with DW_AT_endianity. Make sure a DIE with
native order exists for base types, attach the DIE manually and call
add_pubtype on it. Do not equate a reverse order DIE to the type.
Peephole patterns exist in the arm backend to spot load/store
operations to adjacent memory operations in order to convert them into
ldrd/strd instructions. However, when we have strict alignment
enforced, then we can only do this if the accesses are known to be
64-bit aligned; this is unlikely to be the case for most loads. The
patch adds some alignment checking to the code that validates the
addresses for use in the peephole patterns. This should also fix
incorrect generation of ldrd/strd with unaligned accesses that could
previously have occurred on ARMv5e where all such operations must be
64-bit aligned.
I've added some new tests as well. In doing so I discovered that the
ldrd/strd peephole tests could never fail since they would match the
source file name in the scanned assembly as well as any instructions
of the intended type. I've fixed those by tightening the scan results
slightly.
gcc:
* config/arm/arm.c (align_ok_ldrd_strd): New function.
(mem_ok_for_ldrd_strd): New parameter align. Extract the alignment of the
mem into it.
(gen_operands_ldrd_strd): Validate the alignment of the accesses.
testsuite:
* gcc.target/arm/peep-ldrd-1.c: Tighten test scan pattern.
* gcc.target/arm/peep-strd-1.c: Likewise.
* gcc.target/arm/peep-ldrd-2.c: New test.
* gcc.target/arm/peep-strd-2.c: New test.
Jakub Jelinek [Thu, 19 Oct 2017 11:23:59 +0000 (13:23 +0200)]
ubsan.c (ubsan_expand_null_ifn): Use _v1 suffixed type mismatch builtins...
* ubsan.c (ubsan_expand_null_ifn): Use _v1 suffixed type mismatch
builtins, store max (log2 (align), 0) into uchar field instead of
align into uptr field.
(ubsan_expand_objsize_ifn): Use _v1 suffixed type mismatch builtins,
store uchar 0 field instead of uptr 0 field.
(instrument_nonnull_return): Use _v1 suffixed nonnull return builtin,
instead of passing one address of struct with 2 locations pass
two addresses of structs with 1 location each.
* sanitizer.def (BUILT_IN_UBSAN_HANDLE_TYPE_MISMATCH,
BUILT_IN_UBSAN_HANDLE_TYPE_MISMATCH_ABORT,
BUILT_IN_UBSAN_HANDLE_NONNULL_RETURN,
BUILT_IN_UBSAN_HANDLE_NONNULL_RETURN_ABORT): Removed.
(BUILT_IN_UBSAN_HANDLE_TYPE_MISMATCH_V1,
BUILT_IN_UBSAN_HANDLE_TYPE_MISMATCH_V1_ABORT,
BUILT_IN_UBSAN_HANDLE_NONNULL_RETURN_V1,
BUILT_IN_UBSAN_HANDLE_NONNULL_RETURN_V1_ABORT): New builtins.
* c-c++-common/ubsan/float-cast-overflow-1.c: Drop value keyword
from expected output regexps.
* c-c++-common/ubsan/float-cast-overflow-2.c: Likewise.
* c-c++-common/ubsan/float-cast-overflow-3.c: Likewise.
* c-c++-common/ubsan/float-cast-overflow-4.c: Likewise.
* c-c++-common/ubsan/float-cast-overflow-5.c: Likewise.
* c-c++-common/ubsan/float-cast-overflow-6.c: Likewise.
* c-c++-common/ubsan/float-cast-overflow-8.c: Likewise.
* c-c++-common/ubsan/float-cast-overflow-9.c: Likewise.
* c-c++-common/ubsan/float-cast-overflow-10.c: Likewise.
* g++.dg/ubsan/float-cast-overflow-bf.C: Likewise.
* gcc.dg/ubsan/float-cast-overflow-bf.c: Likewise.
* g++.dg/asan/default-options-1.C (__asan_default_options): Add
used attribute.
* g++.dg/asan/asan_test.C: Run with ASAN_OPTIONS=handle_segv=2
in the environment.
Currently gen* warn about a missing mode on an UNSPEC_TOCSLOT unspec in
some call patterns. Those unspecs are created from rs6000.c, with Pmode
always. This patch fixes the patterns to say :P as well.
* config/rs6000/rs6000.md (*call_indirect_aix<mode>,
*call_value_indirect_aix<mode>, *call_indirect_elfv2<mode>,
*call_value_indirect_elfv2<mode>): Add correct mode to the unspec.
Martin Liska [Thu, 19 Oct 2017 07:50:48 +0000 (09:50 +0200)]
Do not instrument use-after-scope for vars with large alignment (PR sanitizer/82517).
2017-10-19 Martin Liska <mliska@suse.cz>
PR sanitizer/82517
* gimplify.c (gimplify_decl_expr): Do not instrument variables
that have a large alignment.
(gimplify_target_expr): Likewise.
2017-10-19 Martin Liska <mliska@suse.cz>
PR sanitizer/82517
* gcc.dg/asan/pr82517.c: New test.
Use Levenshtein spelling suggestions in Fortran FE
gcc/fortran/ChangeLog
2017-10-19 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
* gfortran.h (gfc_lookup_function_fuzzy): New declaration.
(gfc_closest_fuzzy_match): New declaration.
(vec_push): New definition.
* misc.c (gfc_closest_fuzzy_match): New definition.
* resolve.c: Include spellcheck.h.
(lookup_function_fuzzy_find_candidates): New static function.
(lookup_uop_fuzzy_find_candidates): Likewise.
(lookup_uop_fuzzy): Likewise.
(resolve_operator) <INTRINSIC_USER>: Call lookup_uop_fuzzy.
(gfc_lookup_function_fuzzy): New definition.
(resolve_unknown_f): Call gfc_lookup_function_fuzzy.
* interface.c (check_interface0): Likewise.
(lookup_arg_fuzzy_find_candidates): New static function.
(lookup_arg_fuzzy ): Likewise.
(compare_actual_formal): Call lookup_arg_fuzzy.
* symbol.c: Include spellcheck.h.
(lookup_symbol_fuzzy_find_candidates): New static function.
(lookup_symbol_fuzzy): Likewise.
(gfc_set_default_type): Call lookup_symbol_fuzzy.
(lookup_component_fuzzy_find_candidates): New static function.
(lookup_component_fuzzy): Likewise.
(gfc_find_component): Call lookup_component_fuzzy.
gcc/testsuite/ChangeLog
2017-10-19 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
* gfortran.dg/spellcheck-operator.f90: New testcase.
* gfortran.dg/spellcheck-procedure_1.f90: New testcase.
* gfortran.dg/spellcheck-procedure_2.f90: New testcase.
* gfortran.dg/spellcheck-structure.f90: New testcase.
* gfortran.dg/spellcheck-parameter.f90: New testcase.
Thomas Koenig [Wed, 18 Oct 2017 21:29:37 +0000 (21:29 +0000)]
re PR fortran/82567 ([6/7/8] gfortran takes a long time to compile a simple implied-do with -Optimization.)
2017-10-18 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/82567
* frontend-passes.c (combine_array_constructor): If an array
constructor is all constants and has more elements than a small
constant, don't convert a*[b,c] to [a*b,a*c] to reduce compilation
times.
2017-10-18 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/82567
* gfortran.dg/array_constructor_51.f90: New test.
Bin Cheng [Wed, 18 Oct 2017 16:04:16 +0000 (16:04 +0000)]
tree-loop-distribution.c (INCLUDE_ALGORITHM): New header file.
* tree-loop-distribution.c (INCLUDE_ALGORITHM): New header file.
(tree-ssa-loop-ivopts.h): New header file.
(struct builtin_info): New fields.
(classify_builtin_1): Compute and record base and offset parts for
memset builtin partition by calling strip_offset.
(offset_cmp, fuse_memset_builtins): New functions.
(finalize_partitions): Fuse adjacent memset partitions by calling
above function.
* tree-ssa-loop-ivopts.c (strip_offset): Delete static declaration.
Expose the interface.
* tree-ssa-loop-ivopts.h (strip_offset): New declaration.
* gcc.dg/tree-ssa/ldist-17.c: Adjust test string.
* gcc.dg/tree-ssa/ldist-32.c: New test.
* gcc.dg/tree-ssa/ldist-35.c: New test.
* gcc.dg/tree-ssa/ldist-36.c: New test.
Bin Cheng [Wed, 18 Oct 2017 15:56:15 +0000 (15:56 +0000)]
re PR tree-optimization/82574 (wrong code at -O3 on x86_64-linux-gnu)
PR tree-optimization/82574
* tree-loop-distribution.c (find_single_drs): New parameter. Check
that data reference must be executed exactly once per iteration
against the outermost loop in nest.
(classify_partition): Update call to above function.
gcc/testsuite
* gcc.dg/tree-ssa/pr82574.c: New test.
Martin Liska [Wed, 18 Oct 2017 12:44:08 +0000 (14:44 +0200)]
Fix failing test-case
2017-10-18 Martin Liska <mliska@suse.cz>
* gcc.dg/tree-prof/switch-case-2.c: Scan IPA profile dump
file instead of expand. Reason is that switch statement is
not yet expanded as decision tree, which also contains a BB
with count == 2000.
Jakub Jelinek [Wed, 18 Oct 2017 09:20:31 +0000 (11:20 +0200)]
re PR lto/82598 (lto debugobj lacks .note.GNU-stack)
PR lto/82598
* simple-object.c (handle_lto_debug_sections): Copy over also
.note.GNU-stack section with unchanged name.
* simple-object-elf.c (SHF_EXECINSTR): Define.
(simple_object_elf_copy_lto_debug_section): Drop SHF_EXECINSTR bit
on .note.GNU-stack section.
Robin Dapp [Wed, 18 Oct 2017 09:14:16 +0000 (09:14 +0000)]
S/390: Do not end groups after fallthru edge.
gcc/ChangeLog:
2017-10-17 Robin Dapp <rdapp@linux.vnet.ibm.com>
* config/s390/s390.c (s390_bb_fallthru_entry_likely): New function.
(s390_sched_init): Do not reset s390_sched_state if we entered the
current basic block via a fallthru edge and all others are unlikely.
Robin Dapp [Wed, 18 Oct 2017 09:10:09 +0000 (09:10 +0000)]
S/390: Handle long-running instructions.
gcc/ChangeLog:
2017-10-18 Robin Dapp <rdapp@linux.vnet.ibm.com>
* config/s390/s390.c (NUM_SIDES): New variable.
(LONGRUNNING_THRESHOLD): New variable.
(LATENCY_FACTOR): New variable.
(s390_sched_score): Decrease score for long-running instructions on
wrong side.
(s390_sched_variable_issue): Perform bookkeeping for long-running
instructions.
Paul Thomas [Wed, 18 Oct 2017 08:55:27 +0000 (08:55 +0000)]
re PR fortran/82550 (program using submodules fails to link)
2017-10-18 Paul Thomas <pault@gcc.gnu.org>
PR fortran/82550
* trans_decl.c (gfc_get_symbol_decl): Procedure symbols that
have the 'used_in_submodule' attribute should be processed by
'gfc_get_extern_function_decl'.
2017-10-18 Paul Thomas <pault@gcc.gnu.org>
PR fortran/82550
* gfortran.dg/submodule_30.f08 : New test.
Andreas Krebbel [Wed, 18 Oct 2017 08:21:45 +0000 (08:21 +0000)]
S/390: Fix vec-cmp-2 testcase
The functions all call foo and therefore need a stack frame what makes
them subject to shrink wrapping. Also all the additional instructions
in the function body makes it fragile wrt instruction scheduling. Just
set a global variable instead to circumvent this.
gcc/testsuite/ChangeLog:
2017-10-18 Andreas Krebbel <krebbel@linux.vnet.ibm.com>