* set_targ.adb (Read_Target_Dependent_Values):
close target description file once its contents is read.
* s-os_lib.adb (Non_Blocking_Spawn, version with Stdout_File
and Stderr_File): Close local file descriptors before spawning
child process.
* exp_util.adb (Containing_Package_With_Ext_Axioms): Limit scope of
local variables to make the code easier to understand and avoid
duplicated calls to Parent and Generic_Parent.
H.J. Lu [Wed, 20 Apr 2016 19:44:52 +0000 (19:44 +0000)]
Update load scan avx256-unaligned-load-1.c
Since avx_loadups256 and sse_loadups have been replaced by movv8sf_internal
and movv4sf_internal, respectively, we need to scan movv8sf_internal and
movv4sf_internal for load.
Bin Cheng [Wed, 20 Apr 2016 15:41:45 +0000 (15:41 +0000)]
re PR tree-optimization/56625 (After if-conversion vectorizer doesn't recognize similar loads)
PR tree-optimization/56625
PR tree-optimization/69489
* tree-data-ref.h (DR_INNERMOST): New macro.
* tree-if-conv.c (innermost_loop_behavior_hash): New class for
hashing struct innermost_loop_behavior.
(ref_DR_map): Remove.
(innermost_DR_map): New map.
(baseref_DR_map): Revise comment.
(hash_memrefs_baserefs_and_store_DRs_read_written_info): Store DR
to innermost_DR_map accroding to its innermost loop behavior.
(ifcvt_memrefs_wont_trap): Get DR from innermost_DR_map according
to its innermost loop behavior.
(if_convertible_loop_p_1): Remove intialization for ref_DR_map.
Add initialization for innermost_DR_map. Record memory reference
in DR_BASE_ADDRESS if the reference is compound one or it doesn't
have innermost loop behavior.
(if_convertible_loop_p): Remove release for ref_DR_map. Release
innermost_DR_map.
gcc/testsuite/ChangeLog
PR tree-optimization/56625
PR tree-optimization/69489
* gcc.dg/vect/pr56625.c: New test.
* gcc.dg/tree-ssa/ifc-pr69489-1.c: New test.
H.J. Lu [Wed, 20 Apr 2016 14:41:55 +0000 (14:41 +0000)]
Don't build 32-bit libatomic with -march=i486 on x86-64
Gcc uses the same -march= for both -m32 and -m64 on x86-64 unless
--with-arch-32= is used. There is no need for -march=i486 to compile
32-bit libatomic on x86-64.
PR target/70454
* configure.tgt (XCFLAGS): Don't add -march=i486 to compile
32-bit x86 target library on x86-64.
i386.md (*lea<mode>_general_1): Rename from *lea_general_1.
* config/i386/i386.md (*lea<mode>_general_1): Rename from
*lea_general_1. Use explicit SWI12 mode interator.
(*lea<mode>_general_2): Rename from *lea_general_2.
Use explicit SWI12 mode interator.
(*lea<mode>_general_3): Rename from *lea_general_3.
Use explicit SWI12 mode interator.
(*lea<SWI12:mode>_general_4): Split from *lea_general_4.
Use explicit SWI12 mode interator.
(*lea<SWI48:mode>_general_4): Split from *lea_general_4.
Use explicit SWI48 mode interator.
H.J. Lu [Wed, 20 Apr 2016 13:39:28 +0000 (13:39 +0000)]
Simplify ix86_expand_vector_move_misalign
Since mov<mode>_internal patterns handle both aligned/unaligned load
and store, we can simplify ix86_avx256_split_vector_move_misalign and
ix86_expand_vector_move_misalign.
* config/i386/i386.c (ix86_avx256_split_vector_move_misalign):
Short-cut unaligned load and store cases. Handle all integer
vector modes.
(ix86_expand_vector_move_misalign): Short-cut unaligned load
and store cases. Call ix86_avx256_split_vector_move_misalign
directly without checking mode class.
* exp_ch5.adb (Expand_N_Assignment_Statement): Do no generate
a discriminant check for a type whose partial view has unknown
discriminants when the full view has discriminants with defaults.
2016-04-20 Javier Miranda <miranda@adacore.com>
* exp_util.adb (Remove_Side_Effects): When generating C code
remove side effect of type conversion of access to unconstrained
array type.
(Side_Effect_Free): Return false for the type
conversion of access to unconstrained array type when generating
C code.
* sem_res.adb (Resolved_Type_Conversion): Remove side effects
of access to unconstrained array type conversion when generating
C code.
2016-04-20 Ed Schonberg <schonberg@adacore.com>
* sem_ch13.adb (Build_Predicate_Function_Declaration): New
function, to construct the declaration of a predicate function
at the end of the current declarative part rather than at the
(possibly later) freeze point of the type. This also allows uses
of a type with predicates in instantiations elsewhere.
(Resolve_Aspect_Expression): New procedure to detect visiblity
errors in aspect expressions, at the end of the declarative part
that includes the type declaration.
* sem_ch3.adb (Complete_Private_Subtype): Propagate properly the
predicate function from private to full view.
* einfo.adb (Predicate_Function): Refine search for predicate
function when type has a full view and predicate function may
be defined on either view.
2016-04-20 Javier Miranda <miranda@adacore.com>
* frontend.adb: Passing the root of the tree to
Unnest_Subprograms().
* exp_ch6.adb (Expand_N_Subprogram_Body): Remove code that
took care of adding subprograms to the Unest_Bodies table since
performing such action too early disables the ability to process
generic instantiations.
(Unnest_Subprograms): Adding parameter.
(Search_Unnesting_Subprograms): New subprogram.
* exp_ch6.ads (Unnest_Subrograms): Update documentation.
* exp_util.adb, freeze.adb, sem_util.adb: Minor reformatting.
2016-04-20 Ed Schonberg <schonberg@adacore.com>
* exp_unst.adb (Check_Static_Type): For a private type, check
full view.
2016-04-20 Ed Schonberg <schonberg@adacore.com>
* sem_attr.adb (Check_Type): Reject an attribute reference in
an aspect expression, when the prefix of the reference is the
current instance of the type to which the aspect applies.
* sem_ch6.adb (Enter_Overloaded_Entity): Do not warn about
hiding unless we're actually hiding something. The previous
code would (for example) warn about a "<" on a record type
because it incorrectly thought it was hiding the "<" on Boolean
in Standard. We need to check that the homonym S is in fact a
homograph of a predefined operator.
2016-04-20 Ed Schonberg <schonberg@adacore.com>
* exp_util.ads, exp_util.adb (Build_Procedure_Form): Moved here
from exp_ch6.adb, for use in SPARK_To_C mode when creating the
procedure equivalent to a function returning an array, when this
construction is deferred to the freeze point of the function.
* sem_util.adb (Is_Unchecked_Conversion_Instance): Include a
function that renames an instance of Unchecked_Conversion.
* freeze.adb (Freeze_Subprogram): Generate the proper procedure
declaration for a function returning an array.
* exp_ch6.adb (Build_Procedure_Form): Moved to exp_util.
Ed Schonberg [Wed, 20 Apr 2016 10:46:57 +0000 (10:46 +0000)]
sem_util.ads, [...] (Is_Expanded_Priority_Attribute): New predicate to determine that in a context with full run-time...
2016-04-20 Ed Schonberg <schonberg@adacore.com>
* sem_util.ads, sem_util.adb (Is_Expanded_Priority_Attribute):
New predicate to determine that in a context with full run-time,
a function call is an expansion of a reference to attribute
Priority.
* sem_ch5.adb (Analyze_Function_Call): use it.
* exp_ch5.adb (Expand_N_Subprogram_Call): use it.
* einfo.adb Flag286 is now used as Is_Exception_Handler.
(Is_Exception_Handler): New routine.
(Set_Is_Exception_Handler): New routine.
(Write_Entity_Flags): Output the status of Is_Exception_Handler.
* einfo.ads New attribute Is_Exception_Handler along with
occurrences in entities.
(Is_Exception_Handler): New routine along with pragma Inline.
(Set_Is_Exception_Handler): New routine along with pragma Inline.
* exp_ch7.adb (Make_Transient_Block): Ignore blocks generated
for exception handlers with a choice parameter.
* sem_ch11.adb (Analyze_Exception_Handlers): Mark the scope
generated for a choice parameter as an exception handler.
2016-04-20 Ed Schonberg <schonberg@adacore.com>
* sem_ch3.adb (Build_Derived_Access_Type): Remove dead code.
(Constrain_Discriminated_Type): In an instance, if the type has
unknown discriminants, use its full view.
(Process_Subtype): Check that the base type is private before
adding subtype to Private_Dependents list.
* sem_ch4.adb (Analyze_Selected_Component): A reference to the
current instance of a task type is legal if the prefix is an
expression of that task type and the selector is an entry or
entry family.
2016-04-20 Arnaud Charlet <charlet@adacore.com>
* a-cfdlli.ads (List): Type is no longer tagged, not needed. Move
varsize field at the end for efficiency.
* gnatcmd.adb: Do not invoke gprls when the invocation of "gnat
ls" includes the switch -V.
* clean.adb: "<target>-gnatclean -P" now calls "gprclean
--target=<target>"
* make.adb: "<target>-gnatmake -P" now calls "gprbuild
--target=<target>"
* exp_ch4.adb (Expand_Allocator_Expression): Ensure that the
tag assignment and adjustment preceed the accessibility check.
* exp_ch7.adb (Is_Subprogram_Call): Reimplemented.
* sem_ch12.adb (Copy_Generic_Node): Handle the special
qualification installed for universal literals that act as
operands in binary or unary operators. (Qualify_Operand): Mark
the qualification to signal the instantiation mechanism how to
handle global reference propagation.
* sinfo.adb (Is_Qualified_Universal_Literal): New routine.
(Set_Is_Qualified_Universal_Literal): New routine.
* sinfo.ads New attribute Is_Qualified_Universal_Literal along
with occurrences in nodes.
(Is_Qualified_Universal_Literal):
New routine along with pragma Inline.
(Set_Is_Qualified_Universal_Literal): New routine along with
pragma Inline.
2016-04-20 Ed Schonberg <schonberg@adacore.com>
* sem.adb (Do_Analyze): Save and restore Style_Max_Line_Length
so that the corresponding checks are preserved across compilations
that include System.Constants in their context.
2016-04-20 Gary Dismukes <dismukes@adacore.com>
* sem_type.adb: Minor typo fix and reformatting.
* a-conhel.ads: Update comment.
2016-04-20 Bob Duff <duff@adacore.com>
* a-cihama.adb, a-cihase.adb, a-coinve.adb (Copy): Rewrite the
code so it doesn't trigger an "uninit var" warning.
* sem_attr.ads Add new table Universal_Type_Attribute.
* sem_util.adb (Yields_Universal_Type): Use a table lookup when
checking attributes.
2016-04-20 Ed Schonberg <schonberg@adacore.com>
* exp_aggr.adb (Init_Stored_Discriminants,
Init_Visible_Discriminants): New procedures, subsidiary of
Build_Record_Aggr_Code, to handle properly the construction
of aggregates for a derived type that constrains some parent
discriminants and renames others.
* sem_ch12.adb (Qualify_Universal_Operands): New routine.
(Save_References_In_Operator): Add explicit qualifications in
the generic template for all operands of universal type.
* sem_type.adb (Disambiguate): Update the call to Matches.
(Matches): Reimplemented.
* sem_util.ads, sem_util.adb (Yields_Universal_Type): New routine.
* sem_ch13.adb (Rep_Item_Too_Late): Better error message for
an illegal aspect that freezes the entity to which it applies.
2016-04-20 Bob Duff <duff@adacore.com>
* a-stwibo.ads, a-stzbou.ads
("="): Add overriding keyword before function to avoid crash when
compiler is called with -gnatyO (check overriding indicators).
2016-04-20 Ed Schonberg <schonberg@adacore.com>
* sem_prag.adb (Analyze_Pragma, case Check_Policy): If this
is a configuration pragma and it uses the ARG syntax, insert
the rewritten pragma after the current one rather than using
Insert_Actions.
2016-04-20 Arnaud Charlet <charlet@adacore.com>
* exp_aggr.adb (Backend_Processing_Possible): Add handling of
C back-end.
* sem_res.adb (Rewrite_Renamed_Operator): Do not rewrite the
renamed operator when the associated node appears within a
pre/postcondition.
* sem_util.ads, sem_util.adb (In_Pre_Post_Condition): New routine.
* osint.adb (Relocate_Path): Fix test when Path is shorter than Prefix.
* einfo.adb (Set_Overridden_Operation): Add assertion.
* sem_util.adb (Unique_Entity): for renaming-as-body return the spec
entity.
2016-04-20 Javier Miranda <miranda@adacore.com>
* exp_unst.adb (Append_Unique_Call): New subprogram.
(Unnest_Subprogram): Replace the unique occurrence
of Call.Append() by Append_Unique_Call() which protects us from
adding to the Calls table duplicated entries.
2016-04-20 Arnaud Charlet <charlet@adacore.com>
* exp_attr.adb (Is_GCC_Target): Fix for C backend.
* xref_lib.ads (Dependencies_Tables): instantiate
Table package with types that guarantee its safe use.
* s-imgllu.adb, s-imgint.adb, s-imguns.adb, s-imglli.adb: Avoid nested
procedures.
* contracts.adb (Build_Postconditions_Procedure): Code cleanup.
* ghost.adb (Os_OK_Ghost_Context.Is_OK_Declaration): Handle the
declaration of the internally built _postcondition procedure.
* snames.ads-tmpl (Internal_Attribute_Id, Attribute_Class_Array): Fix
indentation.
* sem_util.adb (Is_Unchecked_Conversion_Instance):
defense against library-level renamings of other functions,
which are never instances of Unchecked_Conversion.
* einfo.ads: minor fix of casing in comment
2016-04-20 Ed Schonberg <schonberg@adacore.com>
* exp_ch6.adb (Expand_N_Subprogram_Stub): Do not expand a body
that has been analyzed and expanded already. Qualify the names
in the proper body for use in the generation of C code.
* contracts.adb (Build_Postconditions_Procedure): Force its
inlining when generating C code.
* sem_attr.adb (Analyze_Attribute_Old_Result): Handle inlined
_postconditions when generating C code.
* exp_ch6.adb (Inlined_Subprogram): Inline calls to
_postconditions when generating C code.
* sinfo.ads, sinfo.adb (Corresponding_Spec, Set_Corresponding_Spec):
types of return value and argument changed from Node_Id to
Entity_Id.
2016-04-20 Vincent Celier <celier@adacore.com>
* make.adb, clean.adb, gnatname.adb: Revert previous change for now.
2016-04-20 Eric Botcazou <ebotcazou@adacore.com>
* sem_ch12.adb (Analyze_Instance_And_Renamings): Do not reset
the Has_Delayed_Freeze flag on the anonymous instance node.
* sem_ch5.adb (Analyze_Iterator_Specification): Remove transient
scope associated with the renaming object declaration.
* exp_util.adb (Insert_Actions): Remove handling of iterator
loop marked as requiring the secondary stack.
2016-04-20 Ed Schonberg <schonberg@adacore.com>
* sem_attr.adb (Analyze_Attribute, case 'Image): Implement
AI12-0124, which extends the functionality of the attribute so it
reflects the semantics of GNAT 'Img when applied to scalar types.
* lib-xref.adb: minor whitespace layout fix.
* clean.adb (Gnatclean): Fail if project file specified and
gprclean is not available.
* gnatname.adb: Fail is -P is used and gprname is not available.
* make.adb (Initialize): Fail if project file specified and
gprbuild is not available.
2016-04-20 Bob Duff <duff@adacore.com>
* sem_ch5.adb (Analyze_Iterator_Specification): Do not use secondary
stack when possible.
* par_sco.adb, sem_util.adb, sem_ch13.adb: Minor typo corrections and
reformatting.
2016-04-20 Ed Schonberg <schonberg@adacore.com>
* sem_prag.adb (Analyze_Pragma, case Default_Storage_Pool):
If the pragma comes from an aspect specification, verify that
the aspect applies to an entity with a declarative part.
* exp_ch5.adb: Code cleanup.
2016-04-20 Ed Schonberg <schonberg@adacore.com>
* sem_res.adb (Resolve_If_Expression): If first expression is
universal, resolve subsequent ones with the corresponding class
type (Any_Integer or Any_Real).
2016-04-20 Ed Schonberg <schonberg@adacore.com>
* sem_ch5.adb (Analyze_Iterator_Specification): If expansion is
disabled, complete the analysis of the iterator name to ensure
that reference for entities within are properly generated.
* sem_ch13.adb (Add_Invariant): Do not replace
the saved expression of an invariatn aspect when inheriting
a class-wide type invariant as this clobbers the existing
expression. Do not use New_Copy_List as it is unnecessary
and leaves the parent pointers referencing the wrong part of
the tree. Do not replace the type references for ASIS when
inheriting a class-wide type invariant as this clobbers the
existing replacement.
2016-04-20 Ed Schonberg <schonberg@adacore.com>
* sem_util.adb (Build_Explicit_Dereference): If the designated
expression is an entity name, generate reference to the entity
because it will not be resolved again.
Andreas Krebbel [Wed, 20 Apr 2016 07:13:23 +0000 (07:13 +0000)]
PR70674: S/390: Add memory barrier to stack pointer restore from fpr.
This patches fixes a problem with stack variable accesses being
scheduled after the stack pointer restore instructions. In the
testcase this happened with the stack variable 'a' accessed through the
frame pointer.
The existing stack_tie we have in the backend is basically useless
when trying to block stack variable accesses from being scheduled
across an insn. The alias set of stack variables and the frame alias
set usually differ and hence aren't in conflict with each other. The
solution appears to be a magic MEM term with a scratch register which
is handled as a full memory barrier when analyzing scheduling
dependencies.
With the patch a (clobber (mem:BLK (scratch))) is being added to the
restore instruction in order to prevent any memory operations to be
scheduled across the insn. The patch does that only for the one case
where the stack pointer is restored from an FPR. Theoretically this
might happen also in the case where the stack pointer gets restored
using a load multiple. However, triggering that problem with
load-multiple appears to be much harder since the load-multiple will
restore the frame pointer as well. So in order to see the problem a
different call-clobbered register would need to be used as temporary
stack pointer.
Another case which needs to be handled some day is the stack pointer
allocation part. It needs to be a memory barrier as well.
Bootstrapped and regression tested with --with-arch z196 and z13 on
s390 and s390x.
-Andreas-
gcc/ChangeLog:
2016-04-20 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
PR target/70674
* config/s390/s390.c (s390_restore_gprs_from_fprs): Pick the new
stack_restore_from_fpr pattern when restoring r15.
(s390_optimize_prologue): Strip away the memory barrier in the
parallel when trying to get rid of restore insns.
* config/s390/s390.md ("stack_restore_from_fpr"): New insn
definition for loading the stack pointer from an FPR. Compared to
the normal move insn this pattern includes a full memory barrier.
gcc/testsuite/ChangeLog:
2016-04-20 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
PR target/70674
* gcc.target/s390/pr70674.c: New test.
H.J. Lu [Tue, 19 Apr 2016 22:39:28 +0000 (22:39 +0000)]
Remove ssememalign
From INSTRUCTION EXCEPTION SPECIFICATION section in Intel software
developer manual volume 2, only legacy SSE instructions with memory
operand not 16-byte aligned get General Protection fault. There is
no need to check 1, 2, 4, 8 byte alignments. Since x86 backend has
accurate constraints and predicates for 16-byte alignment, we can
remove alignment check in ix86_legitimate_combined_insn.
Jonathan Wakely [Tue, 19 Apr 2016 18:02:46 +0000 (19:02 +0100)]
libstdc++/69703 ignore endianness in codecvt_utf8
PR libstdc++/69703
* src/c++11/codecvt.cc (__codecvt_utf8_base<char16_t>::do_in)):
Override endianness bit in mode.
* testsuite/22_locale/codecvt/codecvt_utf8/69703.cc: New test.
* testsuite/22_locale/codecvt/codecvt_utf8_utf16/66855.cc: Test
that little_endian mode is ignored.
* testsuite/experimental/filesystem/path/native/string.cc: New test.
Jonathan Wakely [Tue, 19 Apr 2016 18:02:39 +0000 (19:02 +0100)]
libstdc++/70609 fix filesystem::copy()
PR libstdc++/70609
* src/filesystem/ops.cc (close_fd): New function.
(do_copy_file): Set permissions before copying file contents. Check
result of closing file descriptors. Don't copy streambuf when file
is empty.
(copy(const path&, const path&, copy_options, error_code&)): Use
lstat for source file when copy_symlinks is set.
* testsuite/experimental/filesystem/operations/copy.cc: Test copy().
H.J. Lu [Tue, 19 Apr 2016 14:33:36 +0000 (14:33 +0000)]
Remove UNSPEC_LOADU and UNSPEC_STOREU
Since *mov<mode>_internal and <avx512>_(load|store)<mode>_mask patterns
can handle unaligned load and store, we can remove UNSPEC_LOADU and
UNSPEC_STOREU. We use function prototypes with pointer to scalar for
unaligned load/store builtin functions so that memory passed to
*mov<mode>_internal is unaligned.
gcc/
PR target/69201
* config/i386/avx512bwintrin.h (_mm512_mask_loadu_epi16): Pass
const short * to __builtin_ia32_loaddquhi512_mask.
(_mm512_maskz_loadu_epi16): Likewise.
(_mm512_mask_storeu_epi16): Pass short * to
__builtin_ia32_storedquhi512_mask.
(_mm512_mask_loadu_epi8): Pass const char * to
__builtin_ia32_loaddquqi512_mask.
(_mm512_maskz_loadu_epi8): Likewise.
(_mm512_mask_storeu_epi8): Pass char * to
__builtin_ia32_storedquqi512_mask.
* config/i386/avx512fintrin.h (_mm512_loadu_pd): Pass
const double * to __builtin_ia32_loadupd512_mask.
(_mm512_mask_loadu_pd): Likewise.
(_mm512_maskz_loadu_pd): Likewise.
(_mm512_storeu_pd): Pass double * to
__builtin_ia32_storeupd512_mask.
(_mm512_mask_storeu_pd): Likewise.
(_mm512_loadu_ps): Pass const float * to
__builtin_ia32_loadups512_mask.
(_mm512_mask_loadu_ps): Likewise.
(_mm512_maskz_loadu_ps): Likewise.
(_mm512_storeu_ps): Pass float * to
__builtin_ia32_storeups512_mask.
(_mm512_mask_storeu_ps): Likewise.
(_mm512_mask_loadu_epi64): Pass const long long * to
__builtin_ia32_loaddqudi512_mask.
(_mm512_maskz_loadu_epi64): Likewise.
(_mm512_mask_storeu_epi64): Pass long long *
to __builtin_ia32_storedqudi512_mask.
(_mm512_loadu_si512): Pass const int * to
__builtin_ia32_loaddqusi512_mask.
(_mm512_mask_loadu_epi32): Likewise.
(_mm512_maskz_loadu_epi32): Likewise.
(_mm512_storeu_si512): Pass int * to
__builtin_ia32_storedqusi512_mask.
(_mm512_mask_storeu_epi32): Likewise.
* config/i386/avx512vlbwintrin.h (_mm256_mask_storeu_epi8): Pass
char * to __builtin_ia32_storedquqi256_mask.
(_mm_mask_storeu_epi8): Likewise.
(_mm256_mask_loadu_epi16): Pass const short * to
__builtin_ia32_loaddquhi256_mask.
(_mm256_maskz_loadu_epi16): Likewise.
(_mm_mask_loadu_epi16): Pass const short * to
__builtin_ia32_loaddquhi128_mask.
(_mm_maskz_loadu_epi16): Likewise.
(_mm256_mask_loadu_epi8): Pass const char * to
__builtin_ia32_loaddquqi256_mask.
(_mm256_maskz_loadu_epi8): Likewise.
(_mm_mask_loadu_epi8): Pass const char * to
__builtin_ia32_loaddquqi128_mask.
(_mm_maskz_loadu_epi8): Likewise.
(_mm256_mask_storeu_epi16): Pass short * to.
__builtin_ia32_storedquhi256_mask.
(_mm_mask_storeu_epi16): Pass short * to.
__builtin_ia32_storedquhi128_mask.
* config/i386/avx512vlintrin.h (_mm256_mask_loadu_pd): Pass
const double * to __builtin_ia32_loadupd256_mask.
(_mm256_maskz_loadu_pd): Likewise.
(_mm_mask_loadu_pd): Pass onst double * to
__builtin_ia32_loadupd128_mask.
(_mm_maskz_loadu_pd): Likewise.
(_mm256_mask_storeu_pd): Pass double * to
__builtin_ia32_storeupd256_mask.
(_mm_mask_storeu_pd): Pass double * to
__builtin_ia32_storeupd128_mask.
(_mm256_mask_loadu_ps): Pass const float * to
__builtin_ia32_loadups256_mask.
(_mm256_maskz_loadu_ps): Likewise.
(_mm_mask_loadu_ps): Pass const float * to
__builtin_ia32_loadups128_mask.
(_mm_maskz_loadu_ps): Likewise.
(_mm256_mask_storeu_ps): Pass float * to
__builtin_ia32_storeups256_mask.
(_mm_mask_storeu_ps): ass float * to
__builtin_ia32_storeups128_mask.
(_mm256_mask_loadu_epi64): Pass const long long * to
__builtin_ia32_loaddqudi256_mask.
(_mm256_maskz_loadu_epi64): Likewise.
(_mm_mask_loadu_epi64): Pass const long long * to
__builtin_ia32_loaddqudi128_mask.
(_mm_maskz_loadu_epi64): Likewise.
(_mm256_mask_storeu_epi64): Pass long long * to
__builtin_ia32_storedqudi256_mask.
(_mm_mask_storeu_epi64): Pass long long * to
__builtin_ia32_storedqudi128_mask.
(_mm256_mask_loadu_epi32): Pass const int * to
__builtin_ia32_loaddqusi256_mask.
(_mm256_maskz_loadu_epi32): Likewise.
(_mm_mask_loadu_epi32): Pass const int * to
__builtin_ia32_loaddqusi128_mask.
(_mm_maskz_loadu_epi32): Likewise.
(_mm256_mask_storeu_epi32): Pass int * to
__builtin_ia32_storedqusi256_mask.
(_mm_mask_storeu_epi32): Pass int * to
__builtin_ia32_storedqusi128_mask.
* config/i386/i386-builtin-types.def (PCSHORT): New.
(PINT64): Likewise.
(V64QI_FTYPE_PCCHAR_V64QI_UDI): Likewise.
(V32HI_FTYPE_PCSHORT_V32HI_USI): Likewise.
(V32QI_FTYPE_PCCHAR_V32QI_USI): Likewise.
(V16SF_FTYPE_PCFLOAT_V16SF_UHI): Likewise.
(V8DF_FTYPE_PCDOUBLE_V8DF_UQI): Likewise.
(V16SI_FTYPE_PCINT_V16SI_UHI): Likewise.
(V16HI_FTYPE_PCSHORT_V16HI_UHI): Likewise.
(V16QI_FTYPE_PCCHAR_V16QI_UHI): Likewise.
(V8SF_FTYPE_PCFLOAT_V8SF_UQI): Likewise.
(V8DI_FTYPE_PCINT64_V8DI_UQI): Likewise.
(V8SI_FTYPE_PCINT_V8SI_UQI): Likewise.
(V8HI_FTYPE_PCSHORT_V8HI_UQI): Likewise.
(V4DF_FTYPE_PCDOUBLE_V4DF_UQI): Likewise.
(V4SF_FTYPE_PCFLOAT_V4SF_UQI): Likewise.
(V4DI_FTYPE_PCINT64_V4DI_UQI): Likewise.
(V4SI_FTYPE_PCINT_V4SI_UQI): Likewise.
(V2DF_FTYPE_PCDOUBLE_V2DF_UQI): Likewise.
(V2DI_FTYPE_PCINT64_V2DI_UQI): Likewise.
(VOID_FTYPE_PDOUBLE_V8DF_UQI): Likewise.
(VOID_FTYPE_PDOUBLE_V4DF_UQI): Likewise.
(VOID_FTYPE_PDOUBLE_V2DF_UQI): Likewise.
(VOID_FTYPE_PFLOAT_V16SF_UHI): Likewise.
(VOID_FTYPE_PFLOAT_V8SF_UQI): Likewise.
(VOID_FTYPE_PFLOAT_V4SF_UQI): Likewise.
(VOID_FTYPE_PINT64_V8DI_UQI): Likewise.
(VOID_FTYPE_PINT64_V4DI_UQI): Likewise.
(VOID_FTYPE_PINT64_V2DI_UQI): Likewise.
(VOID_FTYPE_PINT_V16SI_UHI): Likewise.
(VOID_FTYPE_PINT_V8SI_UHI): Likewise.
(VOID_FTYPE_PINT_V4SI_UHI): Likewise.
(VOID_FTYPE_PSHORT_V32HI_USI): Likewise.
(VOID_FTYPE_PSHORT_V16HI_UHI): Likewise.
(VOID_FTYPE_PSHORT_V8HI_UQI): Likewise.
(VOID_FTYPE_PCHAR_V64QI_UDI): Likewise.
(VOID_FTYPE_PCHAR_V32QI_USI): Likewise.
(VOID_FTYPE_PCHAR_V16QI_UHI): Likewise.
(V64QI_FTYPE_PCV64QI_V64QI_UDI): Removed.
(V32HI_FTYPE_PCV32HI_V32HI_USI): Likewise.
(V32QI_FTYPE_PCV32QI_V32QI_USI): Likewise.
(V16HI_FTYPE_PCV16HI_V16HI_UHI): Likewise.
(V16QI_FTYPE_PCV16QI_V16QI_UHI): Likewise.
(V8HI_FTYPE_PCV8HI_V8HI_UQI): Likewise.
(VOID_FTYPE_PV32HI_V32HI_USI): Likewise.
(VOID_FTYPE_PV16HI_V16HI_UHI): Likewise.
(VOID_FTYPE_PV8HI_V8HI_UQI): Likewise.
(VOID_FTYPE_PV64QI_V64QI_UDI): Likewise.
(VOID_FTYPE_PV32QI_V32QI_USI): Likewise.
(VOID_FTYPE_PV16QI_V16QI_UHI): Likewise.
* config/i386/i386.c (ix86_emit_save_reg_using_mov): Don't
use UNSPEC_STOREU.
(ix86_emit_restore_sse_regs_using_mov): Don't use UNSPEC_LOADU.
(ix86_avx256_split_vector_move_misalign): Don't use unaligned
load nor store.
(ix86_expand_vector_move_misalign): Likewise.
(bdesc_special_args): Use CODE_FOR_movvNXY_internal and pointer
to scalar function prototype for unaligned load/store builtins.
(ix86_expand_special_args_builtin): Updated.
* config/i386/sse.md (UNSPEC_LOADU): Removed.
(UNSPEC_STOREU): Likewise.
(VI_ULOADSTORE_BW_AVX512VL): Likewise.
(VI_ULOADSTORE_F_AVX512VL): Likewise.
(ssescalarsize): Handle V4TI, V2TI and V1TI.
(<sse>_loadu<ssemodesuffix><avxsizesuffix><mask_name>): Likewise.
(*<sse>_loadu<ssemodesuffix><avxsizesuffix><mask_name>): Likewise.
(<sse>_storeu<ssemodesuffix><avxsizesuffix>): Likewise.
(<avx512>_storeu<ssemodesuffix><avxsizesuffix>_mask): Likewise.
(<sse2_avx_avx512f>_loaddqu<mode><mask_name>): Likewise.
(*<sse2_avx_avx512f>_loaddqu<mode><mask_name>"): Likewise.
(sse2_avx_avx512f>_storedqu<mode>): Likewise.
(<avx512>_storedqu<mode>_mask): Likewise.
(*sse4_2_pcmpestr_unaligned): Likewise.
(*sse4_2_pcmpistr_unaligned): Likewise.
(*mov<mode>_internal): Renamed to ...
(mov<mode>_internal): This. Remove check of AVX and IAMCU on
misaligned operand. Replace vmovdqu64 with vmovdqu<ssescalarsize>.
(movsd/movhpd to movupd peephole): Don't use UNSPEC_LOADU.
(movlpd/movhpd to movupd peephole): Don't use UNSPEC_STOREU.
gcc/testsuite/
PR target/69201
* gcc.target/i386/avx256-unaligned-store-1.c (a): Make it
extern to force it misaligned.
(b): Likewise.
(c): Likewise.
(d): Likewise.
Check vmovups.*movv8sf_internal/3 instead of avx_storeups256.
Don't check `*' before movv4sf_internal.
* gcc.target/i386/avx256-unaligned-store-2.c: Check
vmovups.*movv32qi_internal/3 instead of avx_storeups256.
Don't check `*' before movv16qi_internal.
* gcc.target/i386/avx256-unaligned-store-3.c (a): Make it
extern to force it misaligned.
(b): Likewise.
(c): Likewise.
(d): Likewise.
Check vmovups.*movv4df_internal/3 instead of avx_storeupd256.
Don't check `*' before movv2df_internal.
* gcc.target/i386/avx256-unaligned-store-4.c (a): Make it
extern to force it misaligned.
(b): Likewise.
(c): Likewise.
(d): Likewise.
Check movv8sf_internal instead of avx_storeups256.
Check movups.*movv4sf_internal/3 instead of avx_storeups256.
* par_sco.adb (Traverse_One, case N_Case_Statement):
Skip pragmas before the first alternative.
(Traverse_Handled_Statement_Sequence, Exception_Handlers): Likewise.
2016-04-19 Tristan Gingold <gingold@adacore.com>
* adaint.c (__gnat_lwp_self): New function (for darwin).
* s-osinte-darwin.ads, s-osinte-darwin.adb (lwp_self): Import
of __gnat_lwp_self.
sem_util.adb (Build_Elaboration_Entity): Always request an elab counter when preserving control-flow.
2016-04-19 Olivier Hainque <hainque@adacore.com>
* sem_util.adb (Build_Elaboration_Entity): Always request an
elab counter when preserving control-flow.
2016-04-19 Olivier Hainque <hainque@adacore.com>
* sem_ch13.adb (Build_Invariant_Procedure_Declaration): Set
Needs_Debug_Info when producing SCOs.
* par_sco.adb (Traverse_Aspects): Fix categorization of
Type_Invariant to match actual processing as activated depending
on pragma Assertion_Policy.
* sem_prag.adb (Analyze_Pragma): Remove special case for
Name_Invariant regarding SCO generation, which completely disabled
the production of SCOs for Invariant pragmas and aspects.
* checks.adb, sem_util.adb, sem_res.adb, sem_attr.adb: Minor
reformatting.
2016-04-19 Ed Schonberg <schonberg@adacore.com>
* freeze.adb (Freeze_Profile): Refine predicate that checks
whether a function that returns a limited view is declared in
another unit and cannot be frozen at this point.
2016-04-19 Ed Schonberg <schonberg@adacore.com>
* exp_aggr.adb (Component_Count): Handle properly superflat
arrays, i.e. empty arrays where Hi < Lo - 1, to ensure that the
return value of the function is Natural, rather than leaving
the handling of such arrays to the caller of this function.
sem_res.adb (Within_Subprogram_Call): Detect also nodes that appear in entry calls.
2016-04-19 Arnaud Charlet <charlet@adacore.com>
* sem_res.adb (Within_Subprogram_Call): Detect
also nodes that appear in entry calls.
(Resolve_Actuals, Insert_Default): Propagate
dimension information if any, from default expression to the
copy that appears in the list of actuals.
* uintp.ads: minor whitespace fix in comment.
* sem_prag.adb, stringt.adb, inline.adb, lib-xref-spark_specific.adb:
Minor code cleanup.
* set_targ.adb (Set_Targ): convert directly from
Natural to Pos, without intermediate conversion to Int.
sem_ch6.adb (Process_Formals): Mark suspicious reference to SPARK RM in comment.
2016-04-19 Arnaud Charlet <charlet@adacore.com>
* sem_ch6.adb (Process_Formals): Mark suspicious reference to
SPARK RM in comment.
* sem_prag.adb (Analyze_Global_Item): Fix reference to SPARK RM
in comment.
* sem_res.adb (Property_Error, Resolve_Actuals): Fix reference
to SPARK RM in both comment and error message.
Eric Botcazou [Tue, 19 Apr 2016 13:02:27 +0000 (13:02 +0000)]
sem_ch6.adb (Possible_Freeze): If the type is an incomplete CW type...
2016-04-19 Eric Botcazou <ebotcazou@adacore.com>
* sem_ch6.adb (Possible_Freeze): If the type is an incomplete
CW type, then the subprogram must have a delayed freeze. This
ensures that the backend can properly recover the full view when
elaborating the access subprogram declaration.
sem_util.adb (Copy_Node_With_Replacement): use Set_Comes_From_Source instead of directly manipulating internals of the...
2016-04-19 Arnaud Charlet <charlet@adacore.com>
* sem_util.adb (Copy_Node_With_Replacement):
use Set_Comes_From_Source instead of directly manipulating
internals of the node table.
* sem_util.adb (Within_Scope): refactored to remove duplicated code.
* sem_aux.adb (Get_Rep_Pragma,
Subprogram_Body_Entity, Subprogram_Spec): declare variables that
do not change as constants and initialize them in the declaration.
(Get_Rep_Pragma, Subprogram_Body_Entity, Subprogram_Spec): declare
variables that do not change as constants and initialize them
in the declaration.
* sem_res.adb (Resolve_Entry_Call): If the entry has
preconditions it is rewritten by means of a wrapper that
incorporates the original call. Before rewriting generate a
reference to the entry being called to prevent spurious warnings
and provide correct cross-reference information.
* sem_disp.adb (Check_Dispatching_Context): Code cleanup. Add
local constant Scop. Ignore any internally generated loops when
performing the check concerning an abstract subprogram call
without a controlling argument.
* sem_util.ads, sem_util.adb (Current_Scope_No_Loops): New routine.
* sem_elab.adb (Check_A_Call): There are cases where we have No
(Ent) after the Alias loop, even when there was no previous error,
so we can't assert that there was an error.
2016-04-19 Ed Schonberg <schonberg@adacore.com>
* sem_attr.adb (Analyze_Access_Attribute, OK_Self_Reference):
Reject use of type name as a prefix to 'access within an aggregate
in a context that is not the declarative region of a type.
2016-04-19 Vincent Celier <celier@adacore.com>
* gnatcmd.adb: Make "gnat ls -P" invoke gprls Make "gnat bind
-P" invoke "gprbuild -b" Make "gnat link -P" invoke "gprbuild
-l" Fail if the invocation is "gnat find -P" or "gnat xref -P"
Remove anything related to project files
* g-mbdira.adb: minor whitespace cleanup
* g-spipat.adb: minor removal of extra spaces after closing paren
2016-04-19 Ed Schonberg <schonberg@adacore.com>
* exp_ch6.adb (Expand_Actuals): If post-statements are present
and the enclosing context is a function call or indexing, build
an Expression_With_Actions for the call.
* lib-writ.adb (Write_With_Lines): Code cleanup. Do not generate
a with line for an ignored Ghost unit.
* sem_ch7.adb (Analyze_Package_Declaration): Add local constant
Par. A child package is Ghost when its parent is Ghost.
* sem_prag.adb (Analyze_Pragma): Pragma Ghost can now apply to
a subprogram declaration that acts as a compilation unit.
* gimple-walk.h (struct walk_stmt_info): Add stmt member.
* gimple-walk.c (walk_gimple_op): Initialize it.
(walk_gimple_asm): Set wi->is_lhs before each callback invocation.
* tree-inline.c (remap_gimple_op_r): Set SSA_NAME_DEF_STMT when
remapping SSA names of defs.
(copy_bb): Remove walk over all SSA defs and SSA_NAME_DEF_STMT
adjustment.
Vladimir Makarov [Tue, 19 Apr 2016 02:49:54 +0000 (02:49 +0000)]
re PR middle-end/70689 (ICE on valid code at -O1 in 32-bit mode on x86_64-linux-gnu in curr_insn_transform, at lra-constraints.c:3564)
2016-04-18 Vladimir Makarov <vmakarov@redhat.com>
PR middle-end/70689
* lra-constraints.c (equiv_substition_p): New.
(process_alt_operands): Use it.
(swap_operands): Swap it.
(curr_insn_transform): Update it.
* tree.h (TYPE_ALIGN, DECL_ALIGN): Return shifted amount.
(SET_TYPE_ALIGN, SET_DECL_ALIGN): New.
* tree-core.h (tree_type_common.align): Use bit-field.
(tree_type_common.spare): New.
(tree_decl_common.off_align): Make smaller.
(tree_decl_common.align): Use bit-field.
* expr.c (expand_expr_addr_expr_1): Use SET_TYPE_ALIGN.
* omp-low.c (install_var_field): Use SET_DECL_ALIGN.
(scan_sharing_clauses): Ditto.
(finish_taskreg_scan): Use SET_DECL_ALIGN and SET_TYPE_ALIGN.
(omp_finish_file): Ditto.
* stor-layout.c (do_type_align): Use SET_DECL_ALIGN.
(layout_decl): Ditto.
(relayout_decl): Ditto.
(finalize_record_size): Use SET_TYPE_ALIGN.
(finalize_type_size): Ditto.
(finish_builtin_struct): Ditto.
(layout_type): Ditto.
(initialize_sizetypes): Ditto.
* targhooks.c (std_gimplify_va_arg_expr): Use SET_TYPE_ALIGN.
* tree-nested.c (insert_field_into_struct): Use SET_TYPE_ALIGN.
(lookup_field_for_decl): Use SET_DECL_ALIGN.
(get_chain_field): Ditto.
(get_trampoline_type): Ditto.
(get_nl_goto_field): Ditto.
* tree-streamer-in.c (unpack_ts_decl_common_value_fields): Use
SET_DECL_ALIGN.
(unpack_ts_type_common_value_fields): Use SET_TYPE_ALIGN.
* gimple-expr.c (copy_var_decl): Use SET_DECL_ALIGN.
* tree.c (make_node_stat): Use SET_DECL_ALIGN and SET_TYPE_ALIGN.
(build_qualified_type): Use SET_TYPE_ALIGN.
(build_aligned_type, build_range_type_1): Ditto.
(build_atomic_base): Ditto.
(build_common_tree_nodes): Ditto.
* cfgexpand.c (align_local_variable): Use SET_DECL_ALIGN.
(expand_one_stack_var_at): Ditto.
* coverage.c (build_var): Use SET_DECL_ALIGN.
* except.c (init_eh): Ditto.
* function.c (assign_parm_setup_block): Ditto.
* symtab.c (increase_alignment_1): Ditto.
* tree-ssa-ccp.c (fold_builtin_alloca_with_align): Ditto.
* tree-vect-stmts.c (ensure_base_align): Ditto.
* varasm.c (align_variable): Ditto.
(assemble_variable): Ditto.
(build_constant_desc): Ditto.
(output_constant_def_contents): Ditto.
* config/arm/arm.c (arm_relayout_function): Use SET_DECL_ALIGN.
* config/avr/avr.c (avr_adjust_type_node): Use SET_TYPE_ALIGN.
* config/mips/mips.c (mips_std_gimplify_va_arg_expr): Ditto.
* config/msp430/msp430.c (msp430_gimplify_va_arg_expr): Ditto.
* config/spu/spu.c (spu_build_builtin_va_list): Use SET_DECL_ALIGN.
ada/
* gcc-interface/decl.c (gnat_to_gnu_entity): Use SET_TYPE_ALIGN.
(gnat_to_gnu_field): Ditto.
(components_to_record): Ditto.
(create_variant_part_from): Ditto.
(copy_and_substitute_in_size): Ditto.
(substitute_in_type): Ditto.
* gcc-interface/utils.c (make_aligning_type): Use SET_TYPE_ALIGN.
(make_packable_type): Ditto.
(maybe_pad_type): Ditto.
(finish_fat_pointer_type): Ditto.
(finish_record_type): Ditto and use SET_DECL_ALIGN.
(rest_of_record_type_compilation): Use SET_TYPE_ALIGN.
(create_field_decl): Use SET_DECL_ALIGN.
c-family/
* c-common.c (handle_aligned_attribute): Use SET_TYPE_ALIGN
and SET_DECL_ALIGN.
c/
* c-decl.c (merge_decls): Use SET_DECL_ALIGN and SET_TYPE_ALIGN.
(grokdeclarator, parser_xref_tag, finish_enum): Use SET_TYPE_ALIGN.
cp/
* class.c (build_vtable): Use SET_DECL_ALIGN and SET_TYPE_ALIGN.
(layout_class_type): Ditto.
(build_base_field): Use SET_DECL_ALIGN.
(fixup_attribute_variants): Use SET_TYPE_ALIGN.
* decl.c (duplicate_decls): Use SET_DECL_ALIGN.
(record_unknown_type): Use SET_TYPE_ALIGN.
(cxx_init_decl_processing): Ditto.
(copy_type_enum): Ditto.
(grokfndecl): Use SET_DECL_ALIGN.
(copy_type_enum): Use SET_TYPE_ALIGN.
* pt.c (instantiate_class_template_1): Use SET_TYPE_ALIGN.
(tsubst): Ditto.
* tree.c (cp_build_qualified_type_real): Use SET_TYPE_ALIGN.
* lambda.c (maybe_add_lambda_conv_op): Use SET_DECL_ALIGN.
* method.c (implicitly_declare_fn): Use SET_DECL_ALIGN.
* rtti.c (emit_tinfo_decl): Ditto.
fortran/
* trans-io.c (gfc_build_io_library_fndecls): Use SET_TYPE_ALIGN.
* trans-common.c (build_common_decl): Use SET_DECL_ALIGN.
* trans-types.c (gfc_add_field_to_struct): Use SET_DECL_ALIGN.
go/
* go-gcc.cc (Gcc_backend::implicit_variable): Use SET_DECL_ALIGN.
* doc/install.texi (Specific, i?86-*-solaris2.10): Update gas and
gld requirements.
(Specific, *-*-solaris2*): Update Solaris 11 bundled gcc
versions.
Mention Solaris 11 packaging changes.
Update gas and gld requirements.
Remove reference to pre-Solaris 10 bug.
(Specific, sparc-sun-solaris2*): Remove reference to pre-Solaris 10
systems and bugs.
(Specific, sparc64-*-solaris2*): Remove reference to bootstrap
with cc.
Jonathan Wakely [Mon, 18 Apr 2016 15:44:25 +0000 (16:44 +0100)]
Make use of extensions more explicit in libstdc++ tests
* testsuite/18_support/bad_exception/23591_thread-1.c: Add
-Wno-pedantic to dg-options.
* testsuite/20_util/align/2.cc: Use type as operand of alignof.
* testsuite/20_util/is_floating_point/value.cc: Add -Wno-pedantic
to dg-options.
* testsuite/20_util/specialized_algorithms/uninitialized_fill/32158.cc:
Remove extra semi-colon.
* testsuite/23_containers/array/tuple_interface/tuple_element.cc:
Always supply second argument to static_assert.
* testsuite/25_algorithms/lower_bound/no_operator_ne.cc: Remove extra
semi-colon.
* testsuite/26_numerics/complex/c99.cc: Add -Wno-pedantic to
dg-options.
* testsuite/26_numerics/complex/literals/values.cc: Likewise.
* testsuite/29_atomics/atomic/60695.cc: Likewise.
* testsuite/29_atomics/atomic/62259.cc: use __alignof__ instead of
alignof when operand is an object not a type.
* testsuite/decimal/ctor.cc: Add -Wno-pedantic to dg-options.
* testsuite/decimal/make-decimal.cc: Likewise.
* testsuite/experimental/type_traits/value.cc: Always supply second
argument to static_assert.
* testsuite/util/testsuite_common_types.h: Use __extension__ for
__int128 types.