Commit Graph

145371 Commits

Author SHA1 Message Date
Arnaud Charlet 7e22a38c2f [multiple changes]
2016-04-20  Ed Schonberg  <schonberg@adacore.com>

	* 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.

From-SVN: r235253
2016-04-20 12:10:32 +02:00
Hristian Kirtchev b83dd5ecea s-imgllu.adb, [...]: Minor reformatting.
2016-04-20  Hristian Kirtchev  <kirtchev@adacore.com>

	* s-imgllu.adb, sem_util.adb, s-imgint.adb, s-imguns.adb,
	s-imglli.adb: Minor reformatting.

From-SVN: r235251
2016-04-20 12:05:41 +02:00
Marek Polacek 2697b18902 re PR tree-optimization/70725 (Internal compiler error (ICE) on valid code)
PR tree-optimization/70725
	* tree-if-conv.c (is_false_predicate): New function.
	(predicate_mem_writes): Use it.

	* gcc.dg/pr70725.c: New test.

From-SVN: r235250
2016-04-20 09:32:45 +00:00
Hristian Kirtchev d566e90a16 sem_res.adb (Rewrite_Renamed_Operator): Do not rewrite the renamed operator when the associated node appears within a...
2016-04-20  Hristian Kirtchev  <kirtchev@adacore.com>

	* 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.

From-SVN: r235249
2016-04-20 11:22:59 +02:00
Arnaud Charlet 9a476d752d [multiple changes]
2016-04-20  Yannick Moy  <moy@adacore.com>

	* 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.

From-SVN: r235248
2016-04-20 11:21:59 +02:00
Arnaud Charlet 88438c0e87 exp_attr.adb (Expand_N_Attribute_Reference [Attribute_Valid]): Disable expansion when generating C code.
2016-04-20  Arnaud Charlet  <charlet@adacore.com>

	* exp_attr.adb (Expand_N_Attribute_Reference [Attribute_Valid]):
	Disable expansion when generating C code.
	* sinfo.ads, inline.ads: Minor editing.

From-SVN: r235247
2016-04-20 11:18:59 +02:00
Hristian Kirtchev c37e6613f5 sem_util.adb, [...]: Minor reformatting.
2016-04-20  Hristian Kirtchev  <kirtchev@adacore.com>

	* sem_util.adb, contracts.adb, ghost.adb, exp_ch6.adb: Minor
	reformatting.

From-SVN: r235246
2016-04-20 11:17:15 +02:00
Javier Miranda 7f5e1dee7c contracts.adb (Build_Postconditions_Procedure): Code cleanup.
2016-04-20  Javier Miranda  <miranda@adacore.com>

	* 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.

From-SVN: r235245
2016-04-20 11:15:47 +02:00
Arnaud Charlet 31ae1b4629 [multiple changes]
2016-04-20  Arnaud Charlet  <charlet@adacore.com>

	* 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.

From-SVN: r235244
2016-04-20 11:14:02 +02:00
Arnaud Charlet 1ba563f5f9 [multiple changes]
2016-04-20  Javier Miranda  <miranda@adacore.com>

	* 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.

From-SVN: r235243
2016-04-20 11:11:42 +02:00
Arnaud Charlet e361e9a1db [multiple changes]
2016-04-20  Javier Miranda  <miranda@adacore.com>

	* 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.

From-SVN: r235242
2016-04-20 11:08:55 +02:00
Arnaud Charlet d67ffa886d [multiple changes]
2016-04-20  Vincent Celier  <celier@adacore.com>

	* 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.

From-SVN: r235241
2016-04-20 11:07:12 +02:00
Arnaud Charlet 93e90bf474 [multiple changes]
2016-04-20  Gary Dismukes  <dismukes@adacore.com>

	* 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.

2016-04-20  Arnaud Charlet  <charlet@adacore.com>

	* a-dispat.ads (Yield): add Global contract.
	* a-calend.ads, a-reatim.ads: Added Initializes => Clock_Time.
	* a-taside.adb: Added Initializes => Tasking_State.

From-SVN: r235240
2016-04-20 11:04:48 +02:00
Hristian Kirtchev ae3d8837bd sem_ch13.adb (Build_Invariant_Procedure): Reimplement the invariant procedure spec and body insertion.
2016-04-20  Hristian Kirtchev  <kirtchev@adacore.com>

	* sem_ch13.adb (Build_Invariant_Procedure):
	Reimplement the invariant procedure spec and body insertion.

From-SVN: r235239
2016-04-20 11:00:58 +02:00
Arnaud Charlet 776fbb7478 [multiple changes]
2016-04-20  Hristian Kirtchev  <kirtchev@adacore.com>

	* 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.

From-SVN: r235238
2016-04-20 10:59:02 +02:00
Richard Biener 60d393e89c re PR tree-optimization/70726 (Internal compiler error (ICE) on valid code)
2016-04-20  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/70726
	* tree-vect-stmts.c (vectorizable_shift): Do not use scalar
	shift amounts from a pattern stmt operand.

	* g++.dg/vect/pr70726.cc: New testcase.

From-SVN: r235236
2016-04-20 07:20:16 +00:00
Andreas Krebbel 82c6f58aaf 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.

From-SVN: r235234
2016-04-20 07:13:23 +00:00
Jakub Jelinek 843110834c re PR middle-end/70680 (OpenMP SIMD linear variable privatized too eagerly)
PR middle-end/70680
	* gimplify.c (gimplify_omp_for): Call omp_notice_variable for
	implicitly linear or lastprivate iterator on the outer context.

	* testsuite/libgomp.c/pr70680-1.c: New test.
	* testsuite/libgomp.c/pr70680-2.c: New test.

From-SVN: r235232
2016-04-20 03:42:24 +02:00
Ben Elliston 743af9719d Attach PR number to most recent entry.
From-SVN: r235231
2016-04-20 10:44:21 +10:00
GCC Administrator afe0fab2a5 Daily bump.
From-SVN: r235230
2016-04-20 00:16:22 +00:00
H.J. Lu 6048e2ed5e 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.

	* config/i386/i386.c (ix86_legitimate_combined_insn): Remove
	alignment check.
	* config/i386/i386.md (ssememalign): Removed.
	* config/i386/sse.md: Remove ssememalign attribute from patterns.

From-SVN: r235224
2016-04-19 15:39:28 -07:00
Ben Elliston 14f0f2fc44 libjava.exp (libjava_arguments): Use 'file normalize' rather than the defunct DejaGnu 'absolute' proc.
* testsuite/lib/libjava.exp (libjava_arguments): Use 'file
	normalize' rather than the defunct DejaGnu 'absolute' proc.

From-SVN: r235222
2016-04-20 07:08:47 +10:00
Jason Merrill 76f3944041 PR c++/66543 - -Wunused-but-set* false positives
* expr.c (mark_exp_read): Handle NON_DEPENDENT_EXPR.
	* pt.c (make_pack_expansion): Call mark_exp_read.
	* semantics.c (finish_id_expression): Call mark_type_use in
	unevaluated context.

From-SVN: r235221
2016-04-19 15:30:22 -04:00
Jerry DeLisle 90eeab20f7 re PR libfortran/70684 (incorrect reading of values from file on Windows)
2016-04-19  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libgfortran/70684
	* io/list_read (check_buffers): Add '\r' to check for end of line.
	factor.

	* gfortran.dg/list_read_14.f90: New test.

From-SVN: r235220
2016-04-19 19:24:28 +00:00
Jason Merrill 218e9dde70 DR 2137 - copy-constructor rank in list-initialization
* call.c (implicit_conversion): If we choose a copy constructor
	for list-initialization from the same type, the conversion is an
	exact match.

From-SVN: r235219
2016-04-19 14:50:08 -04:00
Jason Merrill 06ec22b7f6 Improve constexpr handling of other loop forms.
* constexpr.c (breaks): Handle EXIT_EXPR.
	(cxx_eval_loop_expr): Handle COMPOUND_EXPR body.
	(cxx_eval_constant_expression): Handle EXIT_EXPR, improve handling
	of COMPOUND_EXPR.

From-SVN: r235218
2016-04-19 14:50:01 -04:00
Jason Merrill f937929e9b PR c++/68206 - Fix constexpr diagnostics with loops.
PR c++/68530
	* constexpr.c (potential_constant_expression_1): Handle LOOP_EXPR
	and GOTO_EXPR.

From-SVN: r235217
2016-04-19 14:49:54 -04:00
Jonathan Wakely 29ca91f72e 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.

From-SVN: r235216
2016-04-19 19:02:46 +01:00
Jonathan Wakely 1490525104 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().

From-SVN: r235215
2016-04-19 19:02:39 +01:00
Jonathan Wakely 9c476ad426 Add noexcept to Filesystem TS operators
* include/experimental/bits/fs_fwd.h (operator&, operator|, operator^,
	operator~ operator&=, operator|=, operator^=): Add noexcept to
	overloaded operators for copy_options, perms and directory_options.
	* src/filesystem/ops.cc (make_file_type, make_file_status,
	is_not_found_errno, file_time): Add noexcept.

From-SVN: r235214
2016-04-19 19:02:32 +01:00
Jason Merrill b1e47084d3 Tiny C++ cleanups.
* pt.c (tsubst_expr): Remove shadowing declaration.
	(tsubst_pack_expansion): Add assert.
	* semantics.c (add_decl_expr): Use DECL_SOURCE_LOCATION.

From-SVN: r235213
2016-04-19 13:49:34 -04:00
H.J. Lu 831698b8f7 Allocate memory on cache line if requested
Since GTM::gtm_thread has

gtm_thread *next_thread __attribute__((__aligned__(HW_CACHELINE_SIZE)));

GTM::gtm_thread::operator new () calls xmalloc with separate_cl == true.
xmalloc must return memory on cache line in this case.

	PR libitm/70456
	* util.cc (xmalloc): Use posix_memalign to allocate memory on
	on cache line if requested.

From-SVN: r235211
2016-04-19 10:01:11 -07:00
Edward Smith-Rowland d855ad89cb c++14_warning.h: Do not refer C++14 as experimental.
2016-04-19  Edward Smith-Rowland  <3dw4rd@verizon.net>

	* include/bits/c++14_warning.h: Do not refer C++14 as experimental.

From-SVN: r235210
2016-04-19 16:29:05 +00:00
H.J. Lu fc9cf6da84 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.

From-SVN: r235209
2016-04-19 07:33:36 -07:00
Richard Biener ea8927ea15 re PR tree-optimization/70171 (Poor code generated when return struct using ternary operator)
2016-04-19  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/70171
	* tree-ssa-phiprop.c: Include stor-layout.h.
	(phiprop_insert_phi): Handle the aggregate copy case.
	(propagate_with_phi): Likewise.

	* g++.dg/tree-ssa/pr70171.C: New testcase.

From-SVN: r235208
2016-04-19 14:03:59 +00:00
Uros Bizjak 9a81dba68a i386.c (ix86_decompose_address): Use lowpart_subreg instead of simplify_gen_subreg (...
* config/i386/i386.c (ix86_decompose_address): Use lowpart_subreg
	instead of simplify_gen_subreg (... , 0).
	(ix86_delegitimize_address): Ditto.
	(ix86_split_divmod): Ditto.
	(ix86_split_copysign_const): Ditto.
	(ix86_split_copysign_var): Ditto.
	(ix86_expand_args_builtin): Ditto.
	(ix86_expand_round_builtin): Ditto.
	(ix86_expand_special_args_builtin): Ditto.
	* config/i386/i386.md (TARGET_USE_VECTOR_FP_CONVERTS splitters): Ditto.
	(TARGET_SSE_PARTIAL_REG_DEPENDENCY splitters and peephole2s): Ditto.
	(udivmodqi4): Ditto.
	(absneg splitters): Ditto.
	(*jcc_bt<mode>_1): Ditto.

From-SVN: r235207
2016-04-19 16:01:21 +02:00
Jason Merrill 3ba065e89e re PR c++/70522 (Hidden friend functions block qualified name lookup into nested unnamed namespace)
PR c++/70522

	* name-lookup.c (qualified_lookup_using_namespace): Look through
	hidden names.

From-SVN: r235206
2016-04-19 09:40:03 -04:00
Arnaud Charlet a017690335 standard_and_implementation_defined_restrictions.rst, [...]: Update documentation.
* doc/gnat_rm/standard_and_implementation_defined_restrictions.rst,
        gnat_rm.texi: Update documentation.

From-SVN: r235205
2016-04-19 15:30:03 +02:00
Arnaud Charlet 009c026845 [multiple changes]
2016-04-19  Olivier Hainque  <hainque@adacore.com>

	* 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.

From-SVN: r235204
2016-04-19 15:24:36 +02:00
Richard Biener 65f52ee9b9 re PR tree-optimization/70724 (Miscompiles python3 with FDO)
2016-04-19  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/70724
	* tree-ssa-sccvn.c (scc_vn_restore_ssa_info): Split SSA info
	restoring out from ...
	(free_scc_vn): ... here.
	* tree-ssa-sccvn.h (scc_vn_restore_ssa_info): Declare.
	* tres-ssa-pre.c (pass_pre::execute): Restore SSA info before
	tail merging.
	(pass_fre::execute): Restore SSA info.

	* gcc.dg/torture/pr70724.c: New testcase.

From-SVN: r235203
2016-04-19 13:22:19 +00:00
Olivier Hainque 27b95a6541 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.

From-SVN: r235202
2016-04-19 15:19:45 +02:00
Arnaud Charlet b4213ffdaf [multiple changes]
2016-04-19  Hristian Kirtchev  <kirtchev@adacore.com>

	* 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.

From-SVN: r235200
2016-04-19 15:10:35 +02:00
Arnaud Charlet b314303784 [multiple changes]
2016-04-19  Arnaud Charlet  <charlet@adacore.com>

	* sem_prag.adb, sem_attr.adb, par-prag.adb, exp_aggr.adb, sem_type.adb
	sem_ch12.adb, sem_ch3.adb, exp_ch7.adb, exp_ch9.adb: Code cleanup.
	* sem_res.adb, sem_util.ads, sem_util.adb (Is_OK_Volatile_Context):
	Promoted from being a nested subprogram in Sem_Res.Resolve_Entity_Name
	to publicly visible routine in Sem_Util.

2016-04-19  Ed Schonberg  <schonberg@adacore.com>

	* checks.adb (Apply_Parameter_Aliasing_Checks): Do not apply
	the check if the type of the actual is By_Reference.

From-SVN: r235199
2016-04-19 15:09:07 +02:00
Arnaud Charlet e90e9503df 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.

From-SVN: r235197
2016-04-19 15:06:01 +02:00
Arnaud Charlet db7e372172 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.

From-SVN: r235196
2016-04-19 15:03:49 +02:00
Eric Botcazou 681014998b 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.

From-SVN: r235195
2016-04-19 15:02:27 +02:00
Arnaud Charlet 16e764a7f4 [multiple changes]
2016-04-19  Ed Schonberg  <schonberg@adacore.com>

	* sem_attr.adb (Resolve_Attribute, case 'Access): Freeze
	overloadable entity if originally overloaded.

2016-04-19  Arnaud Charlet  <charlet@adacore.com>

	* exp_aggr.adb, exp_ch3.adb, exp_ch7.adb, exp_ch9.adb, exp_code.adb,
	exp_fixd.adb, namet.adb, osint.adb, osint.ads, par-ch2.adb,
	sem_ch10.adb, sem_ch12.adb, sem_disp.adb, sem_elab.adb, sem_elim.adb
	sem_util.adb, styleg.adb, styleg.ads, stylesw.ads: Minor code
	clean up.

From-SVN: r235194
2016-04-19 14:59:27 +02:00
Arnaud Charlet 4754d4e86a 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.

From-SVN: r235193
2016-04-19 14:24:29 +02:00
Arnaud Charlet 87fd683607 [multiple changes]
2016-04-19  Ed Schonberg  <schonberg@adacore.com>

	* 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.

2016-04-19  Hristian Kirtchev  <kirtchev@adacore.com>

	* 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.

From-SVN: r235192
2016-04-19 14:22:12 +02:00
Arnaud Charlet b35e5dcb14 [multiple changes]
2016-04-19  Bob Duff  <duff@adacore.com>

	* 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.

2016-04-19  Hristian Kirtchev  <kirtchev@adacore.com>

	* 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.

From-SVN: r235191
2016-04-19 14:18:59 +02:00