Commit Graph

180548 Commits

Author SHA1 Message Date
Ghjuvan Lacambre
c12e23c467 [Ada] CUDA: Use internal types instead of public ones
gcc/ada/

	* exp_prag.adb (Get_Launch_Kernel_Arg_Type): Renamed to
	Get_Nth_Arg_Type and made more generic.
	(Build_Dim3_Declaration): Now builds a CUDA.Internal.Dim3
	instead of a CUDA.Vector_Types.Dim3.
	(Build_Shared_Memory_Declaration): Now infers needed type from
	Launch_Kernel instead of using a hard-coded type.
	(Expand_Pragma_CUDA_Execute): Build additional temporaries to
	store Grids and Blocks.
	* rtsfind.ads: Move Launch_Kernel from public to internal
	package.
2020-10-23 04:24:51 -04:00
Arnaud Charlet
0e3ccc6a04 [Ada] Missing detection of unused with_clause
gcc/ada/

	* sem_ch4.adb (Complete_Object_Operation): Only mark entities
	referenced if we are compiling the extended main unit.
	* sem_attr.adb (Analyze_Attribute [Attribute_Tag]): Record a
	reference on the type and its scope.
2020-10-23 04:24:50 -04:00
Ed Schonberg
c875250d42 [Ada] Prevent copying uninitialized array with address clause
gcc/ada/

	* freeze.adb (Is_Uninitialized_Aggregate): Recognize an array
	aggregate with box initialization, scalar components, and no
	component default values.
	(Freeze_Entity, Check_Address_Clause): Call it, and simplify
	freeze code for entity by removing useless assignment.
2020-10-23 04:24:49 -04:00
Javier Miranda
4d245fdaf7 [Ada] Spurious errors on tagged types with renamed subprograms
gcc/ada/

	* sem_ch3.adb (Check_Abstract_Overriding): Subprogram renamings
	cannot be overridden.
	(Derive_Subprogram): Enable setting attribute
	Requires_Overriding on functions with controlling access results
	of record extensions with a null extension part require
	overriding (AI95-00391/06).
2020-10-23 04:24:48 -04:00
Piotr Trojanek
70b590e248 [Ada] Fix scope of index parameter inside a delta aggregate
gcc/ada/

	* sem_aggr.adb (Resolve_Delta_Array_Aggregate): Push scope of
	the implicit loop before entering name of the index parameter,
	not after; enter name no matter if the identifier has been
	decorated before.
2020-10-23 04:24:47 -04:00
Gary Dismukes
f9c20bd785 [Ada] Better error for illegal call to abstract operation in instantiations
gcc/ada/

	* sem_ch4.adb (Analyze_Call): In the case where the call is not
	overloaded, check for a call to an abstract nondispatching
	operation and flag an error.
2020-10-23 04:24:46 -04:00
Eric Botcazou
ca5d8b9072 [Ada] Always enable the support for 128-bit integer types on 64-bit platforms
gcc/ada/

	* gnat1drv.adb (Adjust_Global_Switches): Rewrite again code enabling
	or disabling the support for 128-bit integer types.
2020-10-23 04:24:45 -04:00
Arnaud Charlet
b740cf2853 [Ada] Update header of front-end files
gcc/ada/

	* alloc.ads, aspects.adb, aspects.ads, atree.adb, atree.ads,
	casing.adb, casing.ads, csets.adb, csets.ads, debug.adb, debug.ads,
	einfo.adb, einfo.ads, elists.adb, elists.ads, fname.adb, fname.ads,
	gnatvsn.adb, gnatvsn.ads, hostparm.ads, indepsw-aix.adb,
	indepsw-darwin.adb, indepsw-gnu.adb, indepsw.adb, indepsw.ads,
	krunch.adb, krunch.ads, lib-list.adb, lib-sort.adb, lib.adb, lib.ads,
	namet-sp.adb, namet-sp.ads, namet.adb, namet.ads, nlists.adb,
	nlists.ads, opt.adb, opt.ads, output.adb, output.ads, rident.ads,
	scans.adb, scans.ads, scil_ll.adb, scil_ll.ads, sem_aux.ads,
	sem_aux.adb, sfn_scan.adb, sinfo.adb, sinfo.ads, sinput.adb,
	sinput.ads, snames.adb-tmpl, snames.ads-tmpl, stand.ads,
	stringt.adb, stringt.ads, table.adb, table.ads, types.adb,
	types.ads, uintp.adb, uintp.ads, uname.adb, uname.ads,
	urealp.adb, urealp.ads, vast.adb, vast.ads, widechar.adb,
	widechar.ads: Update header.
2020-10-23 04:24:44 -04:00
Arnaud Charlet
44f30851a7 [Ada] Take advantage of Long_Long_Long_Integer in From_String
gcc/ada/

	* libgnat/a-nbnbin.adb (From_String): Take advantage of
	Long_Long_Long_Integer.
	* libgnat/s-genbig.ads, libgnat/s-genbig.adb (To_Bignum): New
	function taking a Long_Long_Long_Integer.
2020-10-23 04:24:43 -04:00
Justin Squirek
01364aeb56 [Ada] Iterative patch for accessibility cleanup
gcc/ada/

	* sem_util.adb (Accessibility_Call_Helper): In the selected
	component case, test if a prefix is a function call and whether
	the subprogram call is not being used in its entirety and use
	the Innermost_Master_Scope_Depth in that case.
	(Innermost_Master_Scope_Depth): Test against the node_par
	instead of its identifier to avoid misattributing unnamed blocks
	as not being from source.
	(Function_Call_Level): Add calculation for whether a subprogram
	call is initializing an object in its entirety.
	(Subprogram_Call_Level): Renamed to Function_Call_Level.
2020-10-23 04:24:42 -04:00
Piotr Trojanek
4d4ba374a7 [Ada] Sync code for external properties with SPARK RM
gcc/ada/

	* sem_prag.adb (Check_External_Properties): Rewrite to match the
	SPARK RM description.
2020-10-23 04:24:41 -04:00
Piotr Trojanek
846744902e [Ada] Fix whitespace in code for external property pragmas
gcc/ada/

	* contracts.adb (Check_Type_Or_Object_External_Properties):
	Cleanup.
2020-10-23 04:24:40 -04:00
Piotr Trojanek
9d0761c76b [Ada] Fix default value for re-analysis of external property pragmas
gcc/ada/

	* sem_prag.adb (Analyze_External_Property_In_Decl_Part): Set the
	output parameter Expr_Val to the (implicit) pragma argument even
	when returning early.
2020-10-23 04:24:39 -04:00
Jakub Jelinek
9a83366b62 Fix up plugin header install
Jeff has noticed and I've confirmed that config/i386/i386.h header which is
installed on x86 in plugin/include/ directory newly in GCC 11 has
which breaks all plugins that include tm.h etc. because that header is not
shipped.
The following patch seems to fix that.  Unfortunately it isn't just a matter
of TM_H += t-i386 change, because the header has full path and therefore
needs to be installed in its full path.
Additionally, I've noticed that the b-header-vars generation is completely
broken, it will just throw many of the dependencies away, because it
incorrectly removed everything from first ... remaining till the last /,
while what it clearly wants to do is remove each ... till last / in the same
header path (i.e. instead of .* should have used [^     ]* and g modifier).
I've also noticed that some other headers mentioned in #include of other
headers aren't included (gomp-constants.h as dependency of omp-general.h
and various dependencies of expr.h (where omp-general.h and expr.h were
previously installed)).

2020-10-23  Jakub Jelinek  <jakub@redhat.com>

	* Makefile.in (PLUGIN_HEADERS): Add gomp-constants.h and $(EXPR_H).
	(s-header-vars): Accept not just spaces but also tabs between *_H name
	and =.  Handle common/config/ headers similarly to config.  Don't
	throw away everything from first ... to last / on the remaining
	string, instead skip just ... to corresponding last / without
	intervening spaces and tabs.
	(install-plugin): Treat common/config headers like config headers.
	* config/i386/t-i386 (TM_H): Add
	$(srcdir)/common/config/i386/i386-cpuinfo.h.
2020-10-23 10:11:41 +02:00
Jakub Jelinek
50bc94898f stor-layout: Reject forming arrays with elt sizes not divisible by elt alignment [PR97164]
As mentioned in the PR, since 2005 we reject if array elements are smaller
than their alignment (i.e. overaligned elements), because such arrays don't
make much sense, only their first element is guaranteed to be aligned as
user requested, but the next element can't be.
The following testcases show something we've been silent about but is
equally bad, the 2005 case is just the most common special case of that
the array element size is not divisible by the alignment.  In those arrays
too only the first element is guaranteed to be properly aligned and the
second one can't be.

This patch rejects those cases too, but keeps the existing wording for the
old common case.

Unfortunately, the patch breaks bootstrap, because libbid uses this mess
(forms arrays with 24 byte long elements with 16 byte element alignment).
I don't really see justification for that, so I've decreased the alignment
to 8 bytes instead.

2020-10-23  Jakub Jelinek  <jakub@redhat.com>

	PR tree-optimization/97164
gcc/
	* stor-layout.c (layout_type): Also reject arrays where element size
	is constant, but not a multiple of element alignment.
gcc/testsuite/
	* c-c++-common/pr97164.c: New test.
	* gcc.c-torture/execute/pr36093.c: Move ...
	* gcc.dg/pr36093.c: ... here.  Add dg-do compile and dg-error
	directives.
	* gcc.c-torture/execute/pr43783.c: Move ...
	* gcc.dg/pr43783.c: ... here.  Add dg-do compile, dg-options and
	dg-error directives.
libgcc/config/libbid/
	* bid_functions.h (UINT192): Decrease alignment to 8 bytes.
2020-10-23 10:07:36 +02:00
Eric Botcazou
5f966d6897 Do not use doloop pattern with pragma Unroll
This fixes the following Ada failure on 64-bit PowerPC:

-FAIL: gnat.dg/unroll4.adb scan-rtl-dump-times loop2_unroll "optimized:
loop unrolled 7 times" 2

The IVOPTS pass detects a doloop pattern and consequently discombobulates
the loop sufficiently as to make it hard for the RTL unrolling pass to
compute the best number of iterations.

gcc/ChangeLog:
	* tree-ssa-loop-ivopts.c (analyze_and_mark_doloop_use): Bail out if
	the loop is subject to a pragma Unroll with no specific count.
2020-10-23 09:58:33 +02:00
Dennis Zhang
98161c248c arm: Auto-vectorization for MVE: vsub
This patch enables MVE vsub instructions for auto-vectorization.
The sub<mode>3 in vec-common.md is modified to use new mode macros
to include MVE extension for vectorization. MVE vsub insns in mve.md are
modified to use 'minus' instead of unspec expression to support
sub<mode>3. Use VDQ instead fo VALL to cover all supported modes. The
redundant sub<mode>3 insns in neon.md are then removed.

gcc/ChangeLog:

2020-10-23  Dennis Zhang  <dennis.zhang@arm.com>

	* config/arm/mve.md (mve_vsubq<mode>): New entry for vsub instruction
	using expression 'minus'.
	(mve_vsubq_f<mode>): Use minus instead of VSUBQ_F unspec.
	* config/arm/neon.md (sub<mode>3, sub<mode>3_fp16): Removed.
	(neon_vsub<mode>): Use gen_sub<mode>3 instead of gen_sub<mode>3_fp16.
	* config/arm/vec-common.md (sub<mode>3): Use the new mode macros
	ARM_HAVE_<MODE>_ARITH. Use iterator VDQ instead of VALL.

gcc/testsuite/ChangeLog:

	* gcc.target/arm/simd/mve-vsub_1.c: New test.
2020-10-23 08:53:53 +01:00
Martin Liska
6fade5a604 LTO: check that make command works
gcc/ChangeLog:

	PR lto/97524
	* lto-wrapper.c (make_exists): New function.
	(run_gcc): Use it to check that make is present and working
	for parallel execution.
2020-10-23 09:48:10 +02:00
Richard Biener
7cda498920 Revert "middle-end/97521 - fix VECTOR_CST expansion"
2020-10-23  Richard Biener  <rguenther@suse.de>

	PR middle-end/97521
	* expr.c (expand_expr_real_1): Revert last change.

	* gcc.target/i386/pr97521.c: Remove.
This reverts commit b960a9c83a.
2020-10-23 08:22:00 +02:00
Kewen Lin
67b8991b54 vect: Remove redundant LOOP_VINFO_FULLY_MASKED_P
Remove one redundant LOOP_VINFO_FULLY_MASKED_P condition check
which will be checked in vect_use_loop_mask_for_alignment_p.

gcc/ChangeLog:

	* tree-vect-loop.c (vect_transform_loop): Remove the redundant
	LOOP_VINFO_FULLY_MASKED_P check.
2020-10-22 22:47:39 -05:00
GCC Administrator
43868df37b Daily bump. 2020-10-23 00:16:30 +00:00
Jonathan Wakely
ca021ac617 libstdc++: Ensure std::forward_as_tuple is defined
The recent changes to reduce includes in <memory_resource> went a bit
too far, and it's possible for std::forward_as_tuple to not be defined
when used.

While doing this, I noticed the problematic calls to forward_as_tuple
were not qualified, so performed unwanted ADL.

libstdc++-v3/ChangeLog:

	* include/experimental/memory_resource: Include <tuple>.
	(polymorphic_allocator::construct): Qualify forward_as_tuple.
	* include/std/memory_resource: Likewise.
2020-10-23 01:12:00 +01:00
Alan Modra
5c1506304c [RS6000] Power10 vec-splati-runnable multiple test failures
FAIL: gcc.target/powerpc/vec-splati-runnable.c 1 blank line(s) in output
FAIL: gcc.target/powerpc/vec-splati-runnable.c (test for excess errors)
Excess errors:
rs6000_emit_xxspltidp_v2df called ...

and running the test fails.  As the comment says
  /* Although the instruction says the results are not defined, it does seem
     to work, at least on Mambo.  But no guarentees!  */
So the simulator works but not real hardware.

gcc/
	* config/rs6000/rs6000.c (rs6000_emit_xxspltidp_v2df): Delete
	debug printf.  Remove trailing ".\n" from inform message.
	Break long line.
gcc/testsuite/
	* gcc.target/powerpc/vec-splati-runnable.c: Don't abort on
	undefined output.
2020-10-23 10:08:41 +10:30
Jonathan Wakely
0a74a0e1a2 libstdc++: Fix custom clock in test
This test fails in C++20 mode because std::is_clock is false for the
test clock, because it doesn't define a duration member.

libstdc++-v3/ChangeLog:

	* testsuite/30_threads/condition_variable/members/68519.cc:
	Define recent_epoch_float_clock::duration to meet the Cpp17Clock
	requirements.
2020-10-22 23:14:13 +01:00
David Edelsohn
3307a810d9 testsuite: Adjust expected results for rlwimi-2.c and vec-rlmi-rlnm.c
Enable rlwimi-2.c and vec-rlmi-rlmn.c testcases for additional
target configurtions and update the expected results.

gcc/testsuite/ChangeLog:

	* gcc.target/powerpc/rlwimi-2.c: Adjust expected results for lp64.
	* gcc.target/powerpc/vec-rlmi-rlnm.c: Remove target and LP64.
	Adjust xxlor expected results.
2020-10-22 16:54:34 -04:00
Andrew MacLeod
76d6782207 Use precision and sign to compare types for ranges
Updated to only use range_compatible_p in range assert sanity checks,
not for actual type cmpatibility.

	* gimple-range-gori.cc (is_gimple_logical_p): Use types_compatible_p
	for logical compatibility.
	(logical_stmt_cache::cacheable_p): Ditto.
2020-10-22 16:50:23 -04:00
Jonathan Wakely
f5d9bc8ae8 libstdc++: Only include <condition_variable> in <shared_mutex> if needed
The <condition_variable> header is not small, so <shared_mutex> should
not include it unless it actually needs std::condition_variable, which
is only the case when we don't have pthread_rwlock_t and the POSIX
Timers option.

The <shared_mutex> header would be even smaller if we had a header for
std::condition_variable (separate from std::condition_variable_any).
That's already planned for a future change.

And <memory_resource> would be even smaller if it was possible to get
std::shared_mutex without std::shared_timed_mutex (which depends on
<chrono>). For that to be effective, the synchronized_pool_resource
would have to create its own simpler version of std::shared_lock without
the timed waiting functions. I have no plans to do that.

libstdc++-v3/ChangeLog:

	* include/std/shared_mutex: Only include <condition_variable>
	when pthread_rwlock_t and POSIX timers are not available.
	(__cpp_lib_shared_mutex, __cpp_lib_shared_timed_mutex): Change
	value to be type 'long'.
	* include/std/version (__cpp_lib_shared_mutex)
	(__cpp_lib_shared_timed_mutex): Likewise.
2020-10-22 18:49:38 +01:00
Jonathan Wakely
b1e7c6fce1 libstdc++: Reduce header dependencies in and on <memory>
By moving std::make_obj_using_allocator and the related "utility
functions for uses-allocator construction" to a new header, we can avoid
including the whole of <memory> in <scoped_allocator> and
<memory_resource>.

In order to simplify the implementation of those utility functions they
now use concepts unconditionally. They are no longer defined if
__cpp_concepts is not defined. To simplify the code that uses those
functions I've introduced a __cpp_lib_make_obj_using_allocator feature
test macro (not specified in the standard, which might be an oversight).
That allows the code in <memory_resource> and <scoped_allocator> to
check the feature test macro to decide whether to use the new utilities,
or fall back to the C++17 code.

At the same time, this reshuffles some of the headers included by
<memory> so that they are (mostly?) self-contained. It should no longer
be necessary to include other headers before <bits/shared_ptr.h> when
other parts of the library want to use std::shared_ptr without including
the whole of <memory>.

libstdc++-v3/ChangeLog:

	* include/Makefile.am: Add new header.
	* include/Makefile.in: Regenerate.
	* include/bits/shared_ptr.h: Include <iosfwd>.
	* include/bits/shared_ptr_base.h: Include required headers here
	directly, instead of in <memory>.
	* include/bits/uses_allocator_args.h: New file. Move utility
	functions for uses-allocator construction from <memory> to here.
	Only define the utility functions when concepts are available.
	(__cpp_lib_make_obj_using_allocator): Define non-standard
	feature test macro.
	* include/std/condition_variable: Remove unused headers.
	* include/std/future: Likewise.
	* include/std/memory: Remove headers that are not needed
	directly, and are now inclkuded where they're needed. Include
	new <bits/uses_allocator_args.h> header.
	* include/std/memory_resource: Include only the necessary
	headers. Use new feature test macro to detect support for the
	utility functions.
	* include/std/scoped_allocator: Likewise.
	* include/std/version (__cpp_lib_make_obj_using_allocator):
	Define.
2020-10-22 18:42:03 +01:00
Olivier Hainque
d667beea36 Scope libstdc++ configuration for vxworks to all versions
When libstdc++ is enabled, the current high level configuration
bits should apply the same to all versions of VxWorks.  Adjust the
config triplets matching rules accordingly.

2010-10-21  Olivier Hainque  <hainque@adacore.com>

libstdc++-v3/
	* crossconfig.m4: Turn vxworks matcher into vxworks*.
	* configure.host: Likewise.
	* configure: Regenerate.
2020-10-22 16:40:57 +00:00
Jan Hubicka
0e590b68fa Materialize clones on demand
this patch removes the pass to materialize all clones and instead this
is now done on demand.  The motivation is to reduce lifetime of function
bodies in ltrans that should noticeably reduce memory use for highly
parallel compilations of large programs (like Martin does) or with
partitioning reduced/disabled. For cc1 with one partition the memory use
seems to go down from 4gb to cca 1.5gb (seeing from top, so this is not
particularly accurate).

gcc/ChangeLog:

2020-10-22  Jan Hubicka  <hubicka@ucw.cz>

	* cgraph.c (cgraph_node::get_untransformed_body): Perform lazy
	clone materialization.
	* cgraph.h (cgraph_node::materialize_clone): Declare.
	(symbol_table::materialize_all_clones): Remove.
	* cgraphclones.c (cgraph_materialize_clone): Turn to ...
	(cgraph_node::materialize_clone): .. this one; move here
	dumping from symbol_table::materialize_all_clones.
	(symbol_table::materialize_all_clones): Remove.
	* cgraphunit.c (mark_functions_to_output): Clear stmt references.
	(cgraph_node::expand): Initialize bitmaps early;
	do not call execute_all_ipa_transforms if there are no transforms.
	* ipa-inline-transform.c (save_inline_function_body): Fix formating.
	(inline_transform): Materialize all clones before function is modified.
	* ipa-param-manipulation.c (ipa_param_adjustments::modify_call):
	Materialize clone if needed.
	* ipa.c (class pass_materialize_all_clones): Remove.
	(make_pass_materialize_all_clones): Remove.
	* passes.c (execute_all_ipa_transforms): Materialize all clones.
	* passes.def: Remove pass_materialize_all_clones.
	* tree-pass.h (make_pass_materialize_all_clones): Remove.
	* tree-ssa-structalias.c (ipa_pta_execute): Clear refs.
2020-10-22 17:32:32 +02:00
Tobias Burnus
c26d7df103 OpenMP: Fortran - support omp flush's memorder clauses
gcc/fortran/ChangeLog:

	* gfortran.h (enum gfc_omp_memorder): Add.
	(gfc_omp_clauses): Use it.
	* openmp.c (gfc_match_omp_flush): Match memorder clauses.
	* trans-openmp.c (gfc_trans_omp_flush): Handle them.
	(gfc_trans_omp_directive): Update call.

gcc/testsuite/ChangeLog:

	* gfortran.dg/gomp/flush-1.f90: New test.
	* gfortran.dg/gomp/flush-2.f90: New test.
2020-10-22 17:09:22 +02:00
Will Schmidt
b69c00612d [PATCH, rs6000] VSX load/store rightmost element operations
Hi,
  This adds support for the VSX load/store rightmost element operations.
  This includes the instructions lxvrbx, lxvrhx, lxvrwx, lxvrdx,
  stxvrbx, stxvrhx, stxvrwx, stxvrdx; And the builtins
  vec_xl_sext() /* vector load sign extend */
  vec_xl_zext() /* vector load zero extend */
  vec_xst_trunc() /* vector store truncate */.

  Testcase results show that the instructions added with this patch show
  up at low/no optimization (-O0), with a number of those being replaced
  with other load and store instructions at higher optimization levels.
  For consistency I've left the tests at -O0.

  [v2] Refreshed per review comments.  Comments cleaned up, indentation
  corrected.


gcc/ChangeLog:
	* config/rs6000/altivec.h (vec_xl_zext, vec_xl_sext, vec_xst_trunc):
	New defines.
	* config/rs6000/rs6000-builtin.def (BU_P10V_OVERLOAD_X): New builtin
	macro.
	(BU_P10V_AV_X): New builtin macro.
	(se_lxvrhbx, se_lxrbhx, se_lxvrwx, se_lxvrdx): Define internal names
	for load and sign extend vector element.
	(ze_lxvrbx, ze_lxvrhx, ze_lxvrwx, ze_lxvrdx): Define internal names
	for load and zero extend vector element.
	(tr_stxvrbx, tr_stxvrhx, tr_stxvrwx, tr_stxvrdx): Define internal names
	for truncate and store vector element.
	(se_lxvrx, ze_lxvrx, tr_stxvrx): Define internal names for overloaded
	load/store rightmost element.
	* config/rs6000/rs6000-call.c (altivec_builtin_types): Define the
	internal monomorphs P10_BUILTIN_SE_LXVRBX, P10_BUILTIN_SE_LXVRHX,
	P10_BUILTIN_SE_LXVRWX, P10_BUILTIN_SE_LXVRDX,
	P10_BUILTIN_ZE_LXVRBX, P10_BUILTIN_ZE_LXVRHX, P10_BUILTIN_ZE_LXVRWX,
	P10_BUILTIN_ZE_LXVRDX,
	P10_BUILTIN_TR_STXVRBX, P10_BUILTIN_TR_STXVRHX, P10_BUILTIN_TR_STXVRWX,
	P10_BUILTIN_TR_STXVRDX,
	(altivec_expand_lxvr_builtin): New expansion for load element builtins.
	(altivec_expand_stv_builtin): Update to for truncate and store builtins.
	(altivec_expand_builtin): Add clases for load/store rightmost builtins.
	(altivec_init_builtins): Add def_builtin entries for
	__builtin_altivec_se_lxvrbx, __builtin_altivec_se_lxvrhx,
	__builtin_altivec_se_lxvrwx, __builtin_altivec_se_lxvrdx,
	__builtin_altivec_ze_lxvrbx, __builtin_altivec_ze_lxvrhx,
	__builtin_altivec_ze_lxvrwx, __builtin_altivec_ze_lxvrdx,
	__builtin_altivec_tr_stxvrbx, __builtin_altivec_tr_stxvrhx,
	__builtin_altivec_tr_stxvrwx, __builtin_altivec_tr_stxvrdx,
	__builtin_vec_se_lxvrx, __builtin_vec_ze_lxvrx, __builtin_vec_tr_stxvrx.
	* config/rs6000/vsx.md (vsx_lxvr<wd>x, vsx_stxvr<wd>x, vsx_stxvr<wd>x):
	New define_insn entries.
	* doc/extend.texi:  Add documentation for vsx_xl_sext, vsx_xl_zext,
	and vec_xst_trunc.

gcc/testsuite/ChangeLog:
	* gcc.target/powerpc/vsx-load-element-extend-char.c: New test.
	* gcc.target/powerpc/vsx-load-element-extend-int.c: New test.
	* gcc.target/powerpc/vsx-load-element-extend-longlong.c: New test.
	* gcc.target/powerpc/vsx-load-element-extend-short.c: New test.
	* gcc.target/powerpc/vsx-store-element-truncate-char.c: New test.
	* gcc.target/powerpc/vsx-store-element-truncate-int.c: New test.
	* gcc.target/powerpc/vsx-store-element-truncate-longlong.c: New test.
	* gcc.target/powerpc/vsx-store-element-truncate-short.c: New test.
2020-10-22 09:46:23 -05:00
Will Schmidt
8732511910 [PATCH, rs6000] int128 sign extention instructions (partial prereq)
Hi
  This is a sub-set of the 128-bit sign extension support patch series
  that will be fully implemented in a subsequent patch from Carl.
  This is a necessary pre-requisite for the vector-load/store rightmost
  element patch that follows in this thread.

  [v2] Refreshed and touched up per review comments.
  - updated set_attr entries.  removed superfluous set_attr entries.
  - moved define_insn and define_expand entries to vsx.md.


gcc/ChangeLog:
	* config/rs6000/vsx.md (enum unspec): Add
	UNSPEC_EXTENDDITI2 and UNSPEC_MTVSRD_DITI_W1 entries.
	(mtvsrdd_diti_w1, extendditi2_vector): New define_insns.
	(extendditi2): New define_expand.
2020-10-22 09:42:52 -05:00
Eric Botcazou
dfb7345cd5 [Ada] Enable the support of 128-bit integer types by default
gcc/ada/

	* Makefile.rtl (GNATRTL_128BIT_PAIRS): Add i-cexten.ads.
	* debug.adb (d.H): Document new usage.
	* doc/gnat_rm/representation_clauses_and_pragmas.rst (Size Clauses):
	Document new limit on 64-bit platforms.
	(Component_Size Clauses): Likewise.
	(Pragma Pack for Arrays): Likewise.
	(Pragma Pack for Records): Likewise.
	(Record Representation Clauses): Likewise.
	* gnat_rm.texi: Regenerate.
	* gnat1drv.adb (Adjust_Global_Switches): Rewrite code enabling or
	disabling the support for 128-bit integer types.
	* switch-c.adb (Scan_Front_End_Switches): Do not deal with e128.
	* usage.adb (Write_Switch_Char): Do not print -gnate128 switch.
	* libgnat/i-cexten__128.ads: New file.

gcc/testsuite/

	* ada/acats/run_all.sh: Define and substitute target_{max,min}_int.
	* ada/acats/support/macro.dfs: Parameterize {MAX,MIN}_INT.
	* gnat.dg/assert1.adb: Adjust conditionally to 128-bit integer types.
	* gnat.dg/size_clause1.adb: Do not expect a warning for LP64 targets.
	* gnat.dg/warn11.adb: Likewise.
	* gnat.dg/specs/rep_clause5.ads (Array_2_Type): Add alignment clause.
2020-10-22 08:11:28 -04:00
Javier Miranda
b2dea70e92 [Ada] ACATS 4.1H - B853001 - missed errors for renamed limited
gcc/ada/

	* einfo.ads (Has_Limited_View): New synthesized attribute.
	* einfo.adb (Has_Limited_View): New synthesized attribute.
	(Set_Limited_View): Complete assertion.
	* sem_ch10.ads (Is_Visible_Through_Renamings): Make this routine
	public to invoke it from Find_Expanded_Name and avoid reporting
	spurious errors on renamings of limited-with packages.
	(Load_Needed_Body): Moved to have this spec alphabetically
	ordered.
	* sem_ch10.adb (Is_Visible_Through_Renamings): Moved to library
	level.
	(Is_Limited_Withed_Unit): New subprogram.
	* sem_ch3.adb (Access_Type_Declaration): Adding protection to
	avoid reading attribute Entity() when not available.
	* sem_ch8.adb (Analyze_Package_Renaming): Report error on
	renamed package not visible through context clauses.
	(Find_Expanded_Name): Report error on renamed package not
	visible through context clauses; handle special case where the
	prefix is a renaming of a (now visible) shadow package.
2020-10-22 08:11:27 -04:00
Ghjuvan Lacambre
f0c57fcd0a [Ada] CUDA: discover runtime types instead of hard-coding
gcc/ada/

	* exp_prag.adb (Get_Launch_Kernel_Arg_Type): New function.
	(Build_Shared_Memory_Declaration): Use
	Get_Launch_Kernel_Arg_Type.
	(Build_Stream_Declaration): Use Get_Launch_Kernel_Arg_Type.
	* rtsfind.ads: Remove RO_IC_Unsigned_Long_Long.
2020-10-22 08:11:27 -04:00
Arnaud Charlet
d4194d74fa [Ada] Add more annotations and assertions in the runtime
gcc/ada/

	* libgnat/s-imenne.adb, libgnat/s-imgrea.adb: Add assertions.
2020-10-22 08:11:27 -04:00
Arnaud Charlet
41a5205049 [Ada] Update annotations for codepeer analysis on GNAT runtime
gcc/ada/

	* libgnat/s-imgrea.adb (Set_Image_Real): Update annotations.
2020-10-22 08:11:27 -04:00
Steve Baird
7b3bda2ce2 [Ada] AI12-0211: Consistency of inherited nonoverridable aspects
gcc/ada/

	* aspects.ads: Introduce the subtype Nonoverridable_Aspect_Id,
	whose Static_Predicate reflects the list of nonoverridable
	aspects given in Ada RM 13.1.1(18.7).
	* sem_util.ads, sem_util.adb: Add two new visible subprograms,
	Check_Inherited_Nonoverridable_Aspects and Is_Confirming. The
	former is used to check the consistency of inherited
	nonoverridable aspects from multiple sources. The latter
	indicates whether two aspect specifications for a nonoverridable
	aspect are confirming. Because of compatibility concerns in
	compiling QGen, Is_Confirming always returns True if
	Relaxed_RM_Semantics (i.e., -gnatd.M) is specified.
	* sem_ch3.adb (Derived_Type_Declaration): Call new
	Check_Inherited_Nonoverridable_Aspects procedure if interface
	list is non-empty.
	* sem_ch9.adb (Check_Interfaces): Call new
	Check_Inherited_Nonoverridable_Aspects procedure if interface
	list is non-empty.
	* sem_ch13.adb (Analyze_Aspect_Specifications): When an explicit
	aspect specification overrides an inherited nonoverridable
	aspect, check that the explicit specification is confirming.
2020-10-22 08:11:26 -04:00
Eric Botcazou
944fed738c [Ada] Update the head comment of Check_Compile_Time_Size
gcc/ada/

	* freeze.ads (Check_Compile_Time_Size): Adjust size limit.
2020-10-22 08:11:26 -04:00
Richard Kenner
44b9c6715c [Ada] Allow use of debug routines when output is going elsewhere
gcc/ada/

	* sprint.adb (pg, po, ps): Use {Push,Pop}_Output.
	* treepr.adb (pl, pn): Likewise.
2020-10-22 08:11:26 -04:00
Eric Botcazou
47c53b0a23 [Ada] Minor fix in GNAT RM
gcc/ada/

	* doc/gnat_rm/implementation_advice.rst: Minor fix.
	* gnat_rm.texi: Regenerate.
2020-10-22 08:11:26 -04:00
Steve Baird
9a678fedcb [Ada] Implement AI12-0280's interactions with container aggregates
gcc/ada/

	* sem_util.adb (Is_Container_Aggregate): A new local predicates
	which indicates whether a given expression is a container
	aggregate. The implementation of this function is incomplete; in
	the unusual case of a record aggregate (i.e., not a container
	aggregate) of a type whose Aggregate aspect is specified, the
	function will incorrectly return True.
	(Immediate_Context_Implies_Is_Potentially_Unevaluated): Improve
	handling of aggregate components.
	(Is_Repeatedly_Evaluated): Test for container aggregate
	components along with existing test for array aggregate
	components.
2020-10-22 08:11:25 -04:00
Eric Botcazou
d7a6aa4969 [Ada] Get rid of useless if-then-else in Exp_Fixd.Fpt_Value
gcc/ada/

	* exp_fixd.adb (Fpt_Value): Fold if-then-else with identical arms.
2020-10-22 08:11:25 -04:00
Ed Schonberg
daaf017932 [Ada] Ada_2020 AI12-0250: Iterator filters in Iterated_Element_Assocations
gcc/ada/

	* par-ch4.adb (P_Iterated_Component_Association): If the
	construct includes an iterator filter it corresponds to an
	Iterated_Element_Association, so build the proper node for it.
	* exp_aggr.adb (Expand_Container_Aggregate, Aggregate_Size): If
	the component is an Iterated_Element_Association, treat it as
	having a non-static size.
2020-10-22 08:11:25 -04:00
Ghjuvan Lacambre
e354dca602 [Ada] Fix parser not detecting casing issues in keywords
gcc/ada/

	* scng.adb (Scan): Check if any letter of the token is
	uppercase.
2020-10-22 08:11:25 -04:00
Justin Squirek
d302be6eba [Ada] Wrong accessibility for conversion to named access
gcc/ada/

	* sem_util.adb (Accessibility_Level_Helper): Conversions to
	named access types get the level associated with the named
	access type.
2020-10-22 08:11:24 -04:00
Eric Botcazou
67a3b519af [Ada] Adjust documentation for Has_Constrained_Partial_View flag
gcc/ada/

	* einfo.ads (Has_Constrained_Partial_View): Add "base type" marker.
2020-10-22 08:11:24 -04:00
Gary Dismukes
84d7433aff [Ada] AI12-0095 Formal types and Constrained Partial Views
gcc/ada/

	* einfo.adb (Has_Constrained_Partial_View): Apply Base_Type to Id.
	* sem_res.adb (Resolve_Actuals.Check_Aliased_Parameter): Remove
	"not Is_Generic_Type" test and call
	Object_Type_Has_Constrained_Partial_View instead of
	Has_Constrained_Partial_View. Improve related error message to
	say "does not statically match" instead of just "does not
	match".
2020-10-22 08:11:24 -04:00
Steve Baird
29f2d76c65 [Ada] Implement AI12-0030: Stream attribute availability
gcc/ada/

	* sem_util.ads, sem_util.adb: Declare and implement a new
	predicate, Derivation_Too_Early_To_Inherit.  This function
	indicates whether a given derived type fails to inherit a given
	streaming-related attribute from its parent type because the
	declaration of the derived type precedes the corresponding
	attribute_definition_clause of the parent.
	* exp_tss.adb (Find_Inherited_TSS): Call
	Derivation_Too_Early_To_Inherit instead of unconditionally
	assuming that a parent type's streaming attribute is available
	for inheritance by an immediate descendant type.
	* sem_attr.adb (Stream_Attribute_Available): Call
	Derivation_Too_Early_To_Inherit instead of unconditionally
	assuming that a parent type's streaming attribute is available
	for inheritance by an immediate descendant type.
	* exp_attr.adb (Default_Streaming_Unavailable): A new predicate;
	given a type, indicates whether predefined (as opposed to
	user-defined) streaming operations for the type should be
	implemented by raising Program_Error.
	(Expand_N_Attribute_Reference): For each of the 4
	streaming-related attributes (i.e., Read, Write, Input, Output),
	after determining that no user-defined implementation is
	available (including a Stream_Convert pragma), call
	Default_Streaming_Unavailable; if that call returns True, then
	implement the streaming operation as "raise Program_Error;".
2020-10-22 08:11:24 -04:00