Commit Graph

177867 Commits

Author SHA1 Message Date
Christophe Lyon
634e6f4910 Fix use of inaccessible member in pr94052.C
The recent PR41437 fix exposed a latent use of an inaccessible member in
the below testcase.

	gcc/testsuite/ChangeLog:

	* g++.target/aarch64/pr94052.C: Give z::ad public access.
2020-06-18 15:27:21 +00:00
Martin Liska
72cb486456
vectorizer: add _bb_vec_info::region_stmts and reverse_region_stmts
gcc/ChangeLog:

	* coretypes.h (struct iterator_range): New type.
	* tree-vect-patterns.c (vect_determine_precisions): Use
	range-based iterator.
	(vect_pattern_recog): Likewise.
	* tree-vect-slp.c (_bb_vec_info):  Likewise.
	(_bb_vec_info::~_bb_vec_info): Likewise.
	(vect_slp_check_for_constructors): Likewise.
	* tree-vectorizer.h:Add new iterators
	and functions that use it.
2020-06-18 16:58:27 +02:00
Jonathan Wakely
bd0a89dcd8 Add missing PR number to ChangeLog (PR 95378)
gcc/c-family/ChangeLog:

	* ChangeLog:
2020-06-18 15:34:51 +01:00
Martin Liska
e68cc3a8f8
rs6000: Fix creation of VEC_COND_EXPR
gcc/ChangeLog:

	* config/rs6000/rs6000-call.c (fold_build_vec_cmp):
	Since 502d63b6d6, first argument
	of a VEC_COND_EXPR cannot be tcc_comparison and so that
	a SSA_NAME needs to be created before we use it for the first
	argument of the VEC_COND_EXPR.
	(fold_compare_helper): Pass gsi to fold_build_vec_cmp.
2020-06-18 16:12:06 +02:00
Tobias Burnus
ac70b20b10 OpenMP/Fortran: Reject allocatable components in map clause
gcc/fortran/ChangeLog:

	* openmp.c (resolve_omp_clauses): Reject vars with
	allocatable components in OpenMP map clauses.

gcc/testsuite/ChangeLog:

	* gfortran.dg/gomp/map-alloc-comp-1.f90: New test.
2020-06-18 15:27:30 +02:00
Richard Biener
eccc3d4326 middle-end/95739 - fix vector condition IFN expansion
This fixes the omission of moving the expansion result to the
target.

2020-06-18  Richard Biener  <rguenther@suse.de>

	PR middle-end/95739
	* internal-fn.c (expand_vect_cond_optab_fn): Move the result
	to the target if necessary.
	(expand_vect_cond_mask_optab_fn): Likewise.
2020-06-18 14:47:34 +02:00
Martin Liska
9435fb9668
Fix typo in tree-ssa-reassoc.c.
gcc/ChangeLog:

	* tree-ssa-reassoc.c (ovce_extract_ops): Replace *vcond with
	vcond as we check for NULL pointer.
2020-06-18 14:46:02 +02:00
Martin Liska
9b4bdaf794
gcc-changelog: checkout & pull order
contrib/ChangeLog:

	* gcc-changelog/git_update_version.py: First checkout and then
	run git pull ---rebase.
2020-06-18 14:45:39 +02:00
Marek Polacek
81caacc273 c++: Fix tsubst ICE with invalid static_cast [PR95728]
Since r11-423 tsubst_copy_and_build/TREE_LIST uses tsubst_tree_list
instead of open coding it.  While the latter could return an error
node wrapped in a TREE_LIST, the former can return a naked error node.

That broke in tsubst_copy_and_build/NEW_EXPR:
  tree placement = RECUR (TREE_OPERAND (t, 0));
  // placement is now error_mark_node, so...
  for (; placement != NULL_TREE; placement = TREE_CHAIN (placement))
  // ... this crashes

If we just return, we avoid the ICE and improve the diagnostic a bit.

gcc/cp/ChangeLog:

	PR c++/95728
	* pt.c (tsubst_copy_and_build) <case NEW_EXPR>: Return error_mark_node
	if placement is erroneous.

gcc/testsuite/ChangeLog:

	PR c++/95728
	* g++.dg/template/cast6.C: New test.
2020-06-18 08:32:21 -04:00
Martin Liska
2c53566539
gcc-changelog: support merge commits in git_update_version
contrib/ChangeLog:

	* gcc-changelog/git_update_version.py: Support merge commits
	and walk only on the branch that is being merged and generate
	missing ChangeLog entries.
2020-06-18 14:30:47 +02:00
Tobias Burnus
3870268b27 silence empty-body warning
gcc/ChangeLog:

	* gimple-pretty-print.c (dump_binary_rhs): Use braces to
	silence empty-body warning with gcc_fallthrough.
2020-06-18 13:19:03 +02:00
Jakub Jelinek
2e0f4a18bc phiopt: Improve minmax optimization [PR95699]
As discussed in the PR, the
x < 0x80000000U to (int) x >= 0
optimization stands in the way of minmax_replacement optimization,
so for comparisons with most of the constants it works well, but when the
above mentioned optimization triggers, it is unable to do it.
The match.pd (cond (cmp (convert? x) c1) (op x c2) c3) -> (op (minmax x c1) c2)
optimization is able to look through that and this patch
teaches minmax_replacement about it too.

2020-06-18  Jakub Jelinek  <jakub@redhat.com>

	PR tree-optimization/95699
	* tree-ssa-phiopt.c (minmax_replacement): Treat (signed int)x < 0
	as x > INT_MAX and (signed int)x >= 0 as x <= INT_MAX.  Move variable
	declarations to the statements that set them where possible.

	* gcc.dg/tree-ssa/pr95699.c: New test.
2020-06-18 12:12:43 +02:00
Jakub Jelinek
9a875db43c forwprop: simplify_vector_constructor follow-up fix [PR95713]
As the following testcase shows, the exception for the aarch64
vec_pack_trunc_di is not sufficient on x86, the halfvectype
"vectors" have SImode but the x86 vec_pack_trunc_si meant for
the bool bitmasks combines 2x SImode into DImode, while in the
testcase the halfvectype is 1x SImode "vector" with SImode and
result is 2x HImode "vector" with SImode.

Richard Sandiford's reply:
FWIW, since the aarch64 case was only found by inspection and might
not be useful, personally I'd prefer to drop that case after all.

2020-06-18  Jakub Jelinek  <jakub@redhat.com>

	PR target/95713
	* tree-ssa-forwprop.c (simplify_vector_constructor): Don't allow
	scalar mode halfvectype other than vector boolean for
	VEC_PACK_TRUNC_EXPR.

	* gcc.dg/pr95713.c: New test.
2020-06-18 12:12:43 +02:00
Richard Biener
5553433d7b avoid early asm output
This avoids early assembler output via the gimplifier creating
new static CTORs.  The output machinery seems to be prepared to
output constants recursively and it's just a matter of
appropriately defering or not defering output.

This also has the advantage of not outputting .string for
optimized away local aggregate initializers containing string
references.

2020-06-18  Richard Biener  <rguenther@suse.de>

	* varasm.c (assemble_variable): Make sure to not
	defer output when outputting addressed constants.
	(output_constant_def_contents): Likewise.
	(add_constant_to_table): Take and pass on whether to
	defer output.
	(output_addressed_constants): Likewise.
	(output_constant_def): Pass on whether to defer output
	to add_constant_to_table.
	(tree_output_constant_def): Defer output of constants.
2020-06-18 12:11:44 +02:00
Richard Biener
da2b7c7f0a remove SLP_TREE_TWO_OPERATORS, add SLP permutation node
This removes the SLP_TREE_TWO_OPERATORS hack in favor of having
explicit SLP nodes for both computations and the blend operation.
For this introduce a generic merge + select + permute SLP node
(with implementation limits).

Building upon earlier patches it adds vect_stmt_dominates_stmt_p
and the ability to compute a vector insertion place from
vectorized stmts (which now have UID zero) as needed for
the permute node.

2020-06-17  Richard Biener  <rguenther@suse.de>

	* tree-vectorizer.h (_slp_tree::two_operators): Remove.
	(_slp_tree::lane_permutation): New member.
	(_slp_tree::code): Likewise.
	(SLP_TREE_TWO_OPERATORS): Remove.
	(SLP_TREE_LANE_PERMUTATION): New.
	(SLP_TREE_CODE): Likewise.
	(vect_stmt_dominates_stmt_p): Declare.
	* tree-vectorizer.c (vect_stmt_dominates_stmt_p): New function.
	* tree-vect-stmts.c (vect_model_simple_cost): Remove
	SLP_TREE_TWO_OPERATORS handling.
	* tree-vect-slp.c (_slp_tree::_slp_tree): Amend.
	(_slp_tree::~_slp_tree): Likewise.
	(vect_two_operations_perm_ok_p): Remove.
	(vect_build_slp_tree_1): Remove verification of two-operator
	permutation here.
	(vect_build_slp_tree_2): When we have two different operators
	build two computation SLP nodes and a blend.
	(vect_print_slp_tree): Print the lane permutation if it exists.
	(slp_copy_subtree): Copy it.
	(vect_slp_rearrange_stmts): Re-arrange it.
	(vect_slp_analyze_node_operations_1): Handle SLP_TREE_CODE
	VEC_PERM_EXPR explicitely.
	(vect_schedule_slp_instance): Likewise.  Remove old
	SLP_TREE_TWO_OPERATORS code.
	(vectorizable_slp_permutation): New function.
2020-06-18 12:05:37 +02:00
Eric Botcazou
2ab42c70a6 [Ada] Fix small inefficiency in previous change to expander
2020-06-18  Eric Botcazou  <ebotcazou@adacore.com>

gcc/ada/

	* exp_ch4.adb (Get_Size_For_Range): Only make sure to return a
	size lower than that of the original type if possible.
	* libgnat/s-rannum.adb (Random_Discrete): Back out optimization
	added for 32-bit types.
2020-06-18 05:08:37 -04:00
Arnaud Charlet
424ce99fb5 [Ada] ACATS 4.1J - B854003 - Subtype conformance check missed
2020-06-18  Arnaud Charlet  <charlet@adacore.com>

gcc/ada/

	* sem_ch6.ads, sem_ch6.adb (Check_Formal_Conformance): New
	subprogram.
	(Check_Conformance): Move code to Check_Formal_Conformance.
	* sem_ch8.adb (Analyze_Subprogram_Renaming): Check for formal
	conformance when needed.
2020-06-18 05:08:36 -04:00
Eric Botcazou
6c8e4f7e38 [Ada] Narrow large arithmetic and comparison operations
2020-06-18  Eric Botcazou  <ebotcazou@adacore.com>

gcc/ada/

	* exp_ch4.adb (Narrow_Large_Operation): New procedure to try
	and narrow large arithmetic and comparison operations.
	(Expand_N_In): Call it.
	(Expand_N_Op_Abs): Likewise.
	(Expand_N_Op_Add): Likewise.
	(Expand_N_Op_Divide): Likewise.
	(Expand_N_Op_Eq): Likewise.
	(Expand_N_Op_Ge): Likewise.
	(Expand_N_Op_Gt): Likewise.
	(Expand_N_Op_Le): Likewise.
	(Expand_N_Op_Lt): Likewise.
	(Expand_N_Op_Minus): Likewise.
	(Expand_N_Op_Mod): Likewise.
	(Expand_N_Op_Multiply): Likewise.
	(Expand_N_Op_Ne): Likewise.
	(Expand_N_Op_Plus): Likewise.
	(Expand_N_Op_Rem): Likewise.
	(Expand_N_Op_Subtract): Likewise.
	(Expand_N_Type_Conversion): Use Convert_To procedure.
	* exp_ch9.adb (Is_Pure_Barrier) <N_Identifier>: Skip all
	numeric types.
	<N_Type_Conversion>: Use explicit criterion.
2020-06-18 05:08:36 -04:00
Eric Botcazou
4bfab79a72 [Ada] Small cleanup in constraint checking code for allocators
2020-06-18  Eric Botcazou  <ebotcazou@adacore.com>

gcc/ada/

	* exp_ch4.adb (Expand_Allocator_Expression): Apply constraint
	and predicate checks for the qualified expression on entry,
	followed by constraint and predicate checks for the allocator
	itself, and return early if this results in a static error.
	(Expand_N_Allocator): Do not do the same here.  Instead apply
	constraint and predicate checks for arrays in the subtype
	indication case.
	* exp_ch5.adb (Expand_N_Assignment_Statement): Do not apply
	range checks to allocators here.
2020-06-18 05:08:35 -04:00
Javier Miranda
b93d80bc8f [Ada] Crash in tagged type constructor with task components
2020-06-18  Javier Miranda  <miranda@adacore.com>

gcc/ada/

	* exp_ch6.adb (BIP_Suffix_Kind, Is_Build_In_Place_Entity): Move
	declarations...
	* exp_ch6.ads: Here.
	* exp_util.adb (Is_Secondary_Stack_BIP_Func_Call): Do not rely
	on the name of the scope to locate the extra formal BIPalloc
	since they are copied when the pointer type associated with
	dispatching calls is built; rely on routines
	Is_Build_In_Place_Entity and BIP_Suffix_Kind.
	* exp_disp.adb (Expand_Dispatching_Call): Set the scope of the
	first extra formal of the internally built pointer type.
	* sem_ch3.adb (Derive_Subprogram): Do not inherit extra formals
	from a limited interface parent since limitedness is not
	inherited in such case (AI-419) and this affects the extra
	formals.
	* sprint.adb (Write_Itype): Output extra formals of subprogram
	types.
2020-06-18 05:08:34 -04:00
Ghjuvan Lacambre
4f4fd8ae2c [Ada] Update output of verbose error summary
2020-06-18  Ghjuvan Lacambre  <lacambre@adacore.com>

gcc/ada/

	* errout.adb (Write_Error_Summary): Display number of warnings
	treated as errors.
	* errutil.ads: Update comment.
2020-06-18 05:08:33 -04:00
Eric Botcazou
3874e79d94 [Ada] Small cleanup in the attribute code of the expander
2020-06-18  Eric Botcazou  <ebotcazou@adacore.com>

gcc/ada/

	* exp_attr.adb (Analyze_Attribute) <Asm_{In,Out}put>: Alphabetize.
	<Component_Size>: Add check for universal integer attribute.
	<Aft>, <Bit_Order>, <Definite>, <Max_Alignment_For_Allocation>,
	<Scalar_Storage_Order>: Raise Program_Error on them.
	* sem_attr.adb (Eval_Attribute) <Component_Size>: Add comment on
	the packed array case.
2020-06-18 05:08:32 -04:00
Steve Baird
13175003d4 [Ada] Implement AI12-0032 fixes for 'Old attribute accessibility
2020-06-18  Steve Baird  <baird@adacore.com>

gcc/ada/

	* sem_util.adb (Object_Access_Level): Treat a 'Old attribute
	reference like an aggregate in determining its static
	accessibility level; after the evaluation of the relevant
	post-condition, the implicitly declared constant associated with
	an Old attribute reference ceases to exist. Similarly for
	Loop_Entry attribute.
	* exp_ch6.adb (Expand_Call_Helper): For an attribute reference
	that is expanded into a reference to an implicitly declared
	constant (e.g., a 'Old or 'Loop_Entry attribute), compute the
	dynamic accessibility level of that constant by looking at the
	declaration of the constant (as opposed to looking at the
	attribute reference).
2020-06-18 05:08:31 -04:00
Steve Baird
a6c467131b [Ada] No Default_Initial_Condition check when declaring an imported object
2020-06-18  Steve Baird  <baird@adacore.com>

gcc/ada/

	* exp_ch3.adb (Expand_N_Object_Declaration): Do not generate a
	default initial condition check for the declaration of an
	imported object.
2020-06-18 05:08:30 -04:00
Arnaud Charlet
8cd7aec26f [Ada] Add support for XDR streaming in the default runtime
2020-06-18  Arnaud Charlet  <charlet@adacore.com>

gcc/ada/

	* Makefile.rtl: Add s-statxd.o.
	* bindgen.adb (Gen_Adainit): Add support for XDR_Stream.
	* bindusg.adb (Display): Add mention of -xdr.
	* gnatbind.adb: Process -xdr switch.
	* init.c (__gl_xdr_stream): New.
	* opt.ads (XDR_Stream): New.
	* libgnat/s-stratt__xdr.adb: Rename to...
	* libgnat/s-statxd.adb: this and adjust.
	* libgnat/s-statxd.ads: New.
	* libgnat/s-stratt.ads, libgnat/s-stratt.adb: Choose between
	default and XDR implementation at runtime.
	* libgnat/s-ststop.ads: Update comments.
	* doc/gnat_rm/implementation_advice.rst: Update doc on XDR
	streaming.
	* gnat_rm.texi: Regenerate.
2020-06-18 05:08:30 -04:00
Eric Botcazou
5b3950bed9 [Ada] Fix host/target confusion for attribute To_Address
2020-06-18  Eric Botcazou  <ebotcazou@adacore.com>

gcc/ada/

	* sem_attr.adb (Analyze_Attribute) <To_Address>: Use the address
	size of the target instead of the host when checking the value of
	a static expression.  Also use standard idiom for exponentiation.
2020-06-18 05:08:29 -04:00
Eric Botcazou
0c32ab8232 [Ada] Add second warning for convention C_Variadic_n
2020-06-18  Eric Botcazou  <ebotcazou@adacore.com>

gcc/ada/

	* sem_prag.adb (Process_Convention): Give a warning on C_Variadic_n
	being applied to a subprogram with exactly n parameters.
2020-06-18 05:08:28 -04:00
Arnaud Charlet
c9a56fd316 [Ada] Profile mismatch between C and Ada functions
2020-06-18  Arnaud Charlet  <charlet@adacore.com>

gcc/ada/

	* libgnarl/s-osinte__linux.ads, libgnat/g-io.adb,
	libgnat/g-socket.adb, libgnat/g-socthi.adb,
	libgnat/g-socthi.ads, libgnat/g-socthi__vxworks.adb,
	libgnat/g-socthi__vxworks.ads, libgnat/g-sothco.ads,
	libgnat/s-io.adb, libgnat/a-except.adb: Fix function profile
	mismatch with imported C functions.
2020-06-18 05:08:27 -04:00
Eric Botcazou
5126ca1fa7 [Ada] Minor cleanup in Expand_Call_Helper
2020-06-18  Eric Botcazou  <ebotcazou@adacore.com>

gcc/ada/

	* exp_ch6.adb (Expand_Call_Helper): Remove superfluous calls
	to Relocate_Node and merge calls to Analyze and Resolve in a
	couple of places.  Do not attempt to generate a range check
	for an actual parameter against the formal's type of a derived
	subprogram after generating a conversion to the formal's type
	of the parent subprogram.
2020-06-18 05:08:26 -04:00
Eric Botcazou
12be130c3f [Ada] Improve compile-time evaluation of value ranges
2020-06-18  Eric Botcazou  <ebotcazou@adacore.com>

gcc/ada/

	* checks.adb (Compute_Range_For_Arithmetic_Op): New procedure to
	compute a range for an arithmetical operation extracted from...
	(Minimize_Eliminate_Overflows): ...here.  Call it.
	(Determine_Range_Cache_O): New cache for Original_Node nodes.
	(Determine_Range): Call Compute_Range_For_Arithmetic_Op for all
	arithmetic expressions. Use Attribute_Id in lieu of Attribute_Name
	for attributes. Add handling for Range_Length alongside Length.
	Add specific handling for Alignment, Bit, First_Bit, Last_Bit,
	Max_Size_In_Storage_Elements, Position, Bit_Position,
	Component_Size, Object_Size, Size, Value_Size, Descriptor_Size.
	(Enable_Overflow_Check): Omit the check for Abs and Minus if the
	operand cannot be the largest negative number.
	(Selected_Length_Checks): Use Pos for Number_Dimensions.
	* exp_attr.adb (Expand_N_Attribute_Reference): Move compile-time
	handling of Bit_Position, Descriptor_Size, First_Bit, Last_Bit
	and Position to...
	* sem_attr.adb (Eval_Attribute): ...here.  Move up Alignment for
	objects and use Compile_Time_Known_Attribute in this case too.
2020-06-18 05:08:25 -04:00
Ghjuvan Lacambre
78689aa295 [Ada] Do not treat pragma Compile_Time_Warning as error even with -gnatwe
2020-06-18  Ghjuvan Lacambre  <lacambre@adacore.com>

gcc/ada/

	* erroutc.ads: Declare new Is_Compile_Time_Msg boolean,
	add new Compile_Time_Pragma field to Error_Msg_Object type.
	(Count_Compile_Time_Pragma_Warnings): New function.
	* erroutc.adb (Count_Compile_Time_Pragma_Warnings): New
	function.
	(Compilation_Errors): Take Compile_Time warnings into account
	when tallying Errors/Warnings.
	* errout.ads (Error_Msg): New procedure.
	* errout.adb (Error_Msg): New procedure.
	(Error_Msg_Internal): Set new Compile_Time_Pragma field in
	Error_Msg_Object.
	* errutil.adb (Error_Msg): Set new Compile_Time_Pragma field in
	Error_Msg_Object.
	* sem_prag.adb (Validate_Compile_Time_Warning_Or_Error): Pass
	True to new Error_Msg procedure.
	* doc/gnat_rm/implementation_defined_pragmas.rst: Update doc for
	the Compile_Time_Warning pragma.
	* gnat_rm.texi: Regenerate.
	* opt.ads: Update comment.
2020-06-18 05:08:24 -04:00
Arnaud Charlet
668fb87d74 [Ada] Suppress CodePeer message on possible uninitialized variable
2020-06-18  Arnaud Charlet  <charlet@adacore.com>

gcc/ada/

	* sem_ch4.adb (Check_Compatible_Profiles): Add explicit
	initialization.
2020-06-18 05:08:23 -04:00
Piotr Trojanek
a9fb2055f3 [Ada] Fix failed assertion on a slice indexed by a subtype_indication
2020-06-18  Piotr Trojanek  <trojanek@adacore.com>

gcc/ada/

	* checks.adb (Generate_Index_Checks): Handle
	N_Subtype_Indication returned from Scalar_Range.
2020-06-18 05:08:22 -04:00
Piotr Trojanek
c94bbfbe57 [Ada] Cleanups in code related to static expressions
2020-06-18  Piotr Trojanek  <trojanek@adacore.com>

gcc/ada/

	* checks.adb, sem_ch3.adb: Minor refactorings.
	* sem_eval.adb (Eval_Qualified_Expression): Fix reference to RM
	rule in comment; only set a local variable Hex in the branch
	where it is used.
2020-06-18 05:08:22 -04:00
Piotr Trojanek
0f7b6a2eb3 [Ada] Avoid forced loading of System.Priority in CodePeer mode
2020-06-18  Piotr Trojanek  <trojanek@adacore.com>

gcc/ada/

	* sem_eval.adb (Check_Non_Static_Context): Use Is_RTE.
2020-06-18 05:08:20 -04:00
Arnaud Charlet
606e70fd3d [Ada] ACATS 4.1L - B452002 - Wrong universal access "=" rules
2020-06-18  Arnaud Charlet  <charlet@adacore.com>

gcc/ada/

	* sem_ch4.adb (Find_Equality_Types.Check_Access_Object_Types):
	New function, used to implement RM 4.5.2 (9.6/2).
	(Find_Equality_Types.Check_Compatible_Profiles): New function,
	used to implement RM 4.5.2(9.7/2).
	(Find_Equality_Types.Reference_Anonymous_Access_Type): New
	function.
	(Find_Equality_Types.Try_One_Interp): Fix handling of anonymous
	access types which was accepting both too much and too little.
	Remove accumulated special and incomplete cases for
	instantiations, replaced by Has_Compatible_Type.
	(Analyze_Overloaded_Selected_Component): Use
	Is_Anonymous_Access_Type instead of Ekind_In.
	* sem_res.adb: Code cleanup and bug fix: use
	Is_Anonymous_Access_Type instead of Ekind_In.  Relax checking of
	anonymous access parameter when universal_access "=" is
	involved.
	* sem_type.adb: Likewise.
	(Find_Unique_Type): Move code from here...
	(Specific_Type): ...to here. Also add missing handling of access
	to class wide types.
	* einfo.ads, einfo.adb (Is_Access_Object_Type): New.
2020-06-18 05:08:20 -04:00
Bob Duff
41e52aa585 [Ada] AI12-0293-1 Implement storage streams
2020-06-18  Bob Duff  <duff@adacore.com>

gcc/ada/

	* libgnat/a-strsto.ads, libgnat/a-ststbo.adb,
	libgnat/a-ststbo.ads, libgnat/a-ststun.adb,
	libgnat/a-ststun.ads: New files, containing packages
	Ada.Streams.Storage, Ada.Streams.Storage.Bounded, and
	Ada.Streams.Storage.Unbounded.
	* impunit.adb, Makefile.rtl: Add new file names.
2020-06-18 05:08:19 -04:00
Javier Miranda
02bf80a34e [Ada] Missing error on aspects Input and Output
2020-06-18  Javier Miranda  <miranda@adacore.com>

gcc/ada/

	* sem_ch13.adb (Has_Good_Profile): Enforce strictness in the
	check. Required to detect wrong profiles for Input and Output.
	(Analyze_Stream_TSS_Definition): Minor enhancement in the text
	of the error for class-wide attributes.
2020-06-18 05:08:18 -04:00
Eric Botcazou
25a11453ca [Ada] Small adjustment to Get_Integer_Type function
2020-06-18  Eric Botcazou  <ebotcazou@adacore.com>

gcc/ada/

	* exp_attr.adb (Get_Integer_Type): Pick an unsigned type based
	on the Esize of the base type of the input type.
2020-06-18 05:08:17 -04:00
Eric Botcazou
2e64cf0552 [Ada] Fix invalid expression sharing in Expand_Array_Equality
2020-06-18  Eric Botcazou  <ebotcazou@adacore.com>

gcc/ada/

	* exp_ch4.adb (Expand_Array_Equality): For the optimization of
	the 2-element case, build new expression lists for the indices.
2020-06-18 05:08:16 -04:00
Richard Kenner
e49f6ee11d [Ada] Properly test for Protected_Body_Subprogram
2020-06-18  Richard Kenner  <kenner@adacore.com>

gcc/ada/

	* sem_util.adb (Enclosing_Subprogram): No longer need
	Convention_Protected.
2020-06-18 05:08:15 -04:00
Claire Dross
3e395e356e [Ada] The definition of constants in declare expressions is an interfering context
2020-06-18  Claire Dross  <dross@adacore.com>

gcc/ada/

	* sem_util.adb (Is_OK_Volatile_Context): Return False on
	definitions of constants declared in declare expressions.
2020-06-18 05:08:15 -04:00
Piotr Trojanek
6ba3247dc7 [Ada] List aspect Relaxed_Initialization in GNAT RM
2020-06-18  Piotr Trojanek  <trojanek@adacore.com>

gcc/ada/

	* doc/gnat_rm/implementation_defined_aspects.rst
	(Relaxed_Initialization): New implementation-defined aspect.
	* doc/gnat_rm/implementation_defined_attributes.rst
	(Initialized): New implementation-defined attribute.
	* gnat_rm.texi: Regenerate.
2020-06-18 05:08:14 -04:00
Javier Miranda
01264f72d9 [Ada] Crash in tagged type constructor with task components
2020-06-18  Javier Miranda  <miranda@adacore.com>

gcc/ada/

	* exp_disp.adb (Expand_Dispatching_Call): Add missing decoration
	of attribute Extra_Accessibility_Of_Result.
	* freeze.adb (Check_Extra_Formals): No check required if
	expansion is disabled; Adding check on
	Extra_Accessibilty_Of_Result.
	(Freeze_Subprogram): Fix decoration of
	Extra_Accessibility_Of_Result.
	* sem_ch3.adb (Derive_Subprogram): Fix decoration of
	Extra_Accessibility_Of_Result
2020-06-18 05:08:13 -04:00
Eric Botcazou
52531a6203 [Ada] Small improvement to Optimize_Length_Comparison
2020-06-18  Eric Botcazou  <ebotcazou@adacore.com>

gcc/ada/

	* exp_ch4.adb (Optimize_Length_Comparison): Accept 32-bit values
	in the full unsigned range.
2020-06-18 05:08:12 -04:00
Martin Liska
d11c9841d5
Add missing check for gassign.
gcc/ChangeLog:

	* tree-vect-generic.c (expand_vector_condition): Check
	for gassign before inspecting RHS.
2020-06-18 10:09:40 +02:00
Martin Liska
09f9c1eefb
gcc-changelog: fix Backported from timestamp.
contrib/ChangeLog:

	* gcc-changelog/git_commit.py: Fix Backported from timestamp when
	use_commit_ts=True is used.
2020-06-18 10:07:59 +02:00
GCC Administrator
aff95ee7cc Daily bump. 2020-06-18 00:16:37 +00:00
Thomas Schwinge
4f2ab6b89e [OpenMP, gimplifier] 'inform' after 'error' diagnostic
This is not a thorough review of the code, just a few cases I noticed while
scanning 'gcc/gimplify.c' for "enclosing".

	gcc/
	* gimplify.c (omp_notice_threadprivate_variable)
	(omp_default_clause, omp_notice_variable): 'inform' after 'error'
	diagnostic.  Adjust all users.
	gcc/testsuite/
	* c-c++-common/gomp/default-1.c: Update.
	* c-c++-common/gomp/defaultmap-3.c: Likewise.
	* c-c++-common/gomp/order-4.c: Likewise.
	* g++.dg/gomp/parallel-2.C: Likewise.
	* g++.dg/gomp/predetermined-1.C: Likewise.
	* g++.dg/gomp/sharing-1.C: Likewise.
	* gcc.dg/gomp/appendix-a/a.24.1.c: Likewise.
	* gcc.dg/gomp/parallel-2.c: Likewise.
	* gcc.dg/gomp/pr44085.c: Likewise.
	* gcc.dg/gomp/sharing-1.c: Likewise.
	* gcc.dg/gomp/vla-1.c: Likewise.
	* gfortran.dg/gomp/appendix-a/a.24.1.f90: Likewise.
	* gfortran.dg/gomp/crayptr3.f90: Likewise.
	* gfortran.dg/gomp/pr33439.f90: Likewise.
	* gfortran.dg/gomp/pr44036-1.f90: Likewise.
	* gfortran.dg/gomp/pr44085.f90: Likewise.
	* gfortran.dg/gomp/pr44536.f90: Likewise.
	* gfortran.dg/gomp/pr94672.f90: Likewise.
	* gfortran.dg/gomp/sharing-1.f90: Likewise.
	* gfortran.dg/gomp/sharing-2.f90: Likewise.
	* gfortran.dg/gomp/sharing-3.f90: Likewise.
2020-06-18 00:15:24 +02:00
Thomas Schwinge
5864930754 Add 'dg-do run' to 'libgomp.fortran/use_device_ptr-optional-3.f90' [PR94848]
Fix-up for r279858/commit f760c0c77f "Fortran]
OpenMP/OpenACC – fix more issues with OPTIONAL".

With offloading enabled, we then saw:

    PASS: libgomp.fortran/use_device_ptr-optional-3.f90   -O0  (test for excess errors)
    PASS: libgomp.fortran/use_device_ptr-optional-3.f90   -O0  execution test
    PASS: libgomp.fortran/use_device_ptr-optional-3.f90   -O1  (test for excess errors)
    PASS: libgomp.fortran/use_device_ptr-optional-3.f90   -O1  execution test
    FAIL: libgomp.fortran/use_device_ptr-optional-3.f90   -O2  (test for excess errors)
    UNRESOLVED: libgomp.fortran/use_device_ptr-optional-3.f90   -O2  compilation failed to produce executable
    FAIL: libgomp.fortran/use_device_ptr-optional-3.f90   -O3 -fomit-frame-pointer -funroll-loops -fpeel-loops -ftracer -finline-functions  (test for excess errors)
    UNRESOLVED: libgomp.fortran/use_device_ptr-optional-3.f90   -O3 -fomit-frame-pointer -funroll-loops -fpeel-loops -ftracer -finline-functions  compilation failed to produce executable
    FAIL: libgomp.fortran/use_device_ptr-optional-3.f90   -O3 -g  (test for excess errors)
    UNRESOLVED: libgomp.fortran/use_device_ptr-optional-3.f90   -O3 -g  compilation failed to produce executable
    FAIL: libgomp.fortran/use_device_ptr-optional-3.f90   -Os  (test for excess errors)
    UNRESOLVED: libgomp.fortran/use_device_ptr-optional-3.f90   -Os  compilation failed to produce executable

 ... due to:

    /tmp/cciVc43I.o:(.gnu.offload_vars+0x10): undefined reference to `A.12.4064'
    [...]

..., but after the recent PR94848, PR95551 changes, that problem is now gone.

	libgomp/
	PR lto/94848
	* testsuite/libgomp.fortran/use_device_ptr-optional-3.f90: Add
	'dg-do run'.
2020-06-18 00:14:46 +02:00