Commit Graph

181726 Commits

Author SHA1 Message Date
Jonathan Wakely
637800c7bb libstdc++: Reduce default test timeout to 360 seconds
The current default of 10 minutes is much longer than most tests need on
common hardware. The slow tests all now have a dg-timeout-factor
directive that gives them more time to run relative to the default. The
default can also be overridden in ~/.dejagnurc or DEJAGNU=site.exp, so
it seems unnecessary to have such a large default.

This reduces the default from 10 minutes to 6 minutes, which still seems
more than enough.

libstdc++-v3/ChangeLog:

	* testsuite/lib/libstdc++.exp (libstdc++_init): Reduce
	default tool_timeout to 360.
2020-11-30 14:39:54 +00:00
Jonathan Wakely
b6a8e3479e libstdc++: Set dg-timeout-factor for more slow tests
As in r11-5449, this adds a muliplier to the timeout for slow tests.
This covers the majority of the <regex> and PSTL tests.

libstdc++-v3/ChangeLog:

	* testsuite/20_util/specialized_algorithms/pstl/*: Add
	dg-timeout-factor.
	* testsuite/25_algorithms/pstl/*: Likewise.
	* testsuite/26_numerics/pstl/*: Likewise.
	* testsuite/28_regex/*: Likewise.
2020-11-30 14:39:54 +00:00
Tobias Burnus
1d6f6ac693 Fortran: With OpenACC, ignore OpenMP's cond comp sentinels
gcc/fortran/ChangeLog:

	PR fortran/98011
	* scanner.c (skip_free_comments, skip_fixed_comments): If only
	-fopenacc but not -fopenmp is used, ignore OpenMP's conditional
	compilation sentinels. Fix indentation, use 'else if' for readability.

gcc/testsuite/ChangeLog:

	PR fortran/98011
	* gfortran.dg/goacc/sentinel-free-form.f95:
	* gfortran.dg/goacc-gomp/fixed-1.f: New test.
	* gfortran.dg/goacc-gomp/free-1.f90: New test.
	* gfortran.dg/goacc/fixed-5.f: New test.
2020-11-30 15:31:22 +01:00
Tobias Burnus
f4e7ea81d1 Fortran: -fno-automatic and -fopenacc / recusion check cleanup
Options: -fopenmp and -fopenacc imply concurrent calls to a
procedure; now also -fopenacc implies -frecursive, disabling
that larger local const-size array variables use static memory.

Run-time recursion check: Always reset the check variable at the
end of the procedure; this avoids a bogus error with -fopenmp
when called twice nonconcurrently/nonrecursively. (Issue requires
using -fno-automatic or -fmax-stack-var-size= to trigger.)

gcc/fortran/ChangeLog:

	PR fortran/98010
	PR fortran/98013
	* options.c (gfc_post_options): Also imply recursive with
	-fopenacc.
	* trans-decl.c (gfc_generate_function_code): Simplify condition.
2020-11-30 15:27:44 +01:00
Tobias Burnus
2610c786f7 Fortran's dump-parse-tree.c: Use '==' not '=' for '.eq.'.
gcc/fortran/
	* dump-parse-tree.c (show_expr): Use '==' not '=' for '.eq.'.
2020-11-30 15:21:21 +01:00
Pierre-Marie de Rodat
69bde2d1e0 [Ada] s-trasym.ads: update the list of supported platforms
gcc/ada/

	* libgnat/s-trasym.ads: Update the list of supported platforms.
2020-11-30 09:16:22 -05:00
Arnaud Charlet
e76a8cacb4 [Ada] Remove all ^L characters
gcc/ada/

	* gcc-interface/Makefile.in, gcc-interface/trans.c: Remove ^L
	characters.
2020-11-30 09:16:22 -05:00
Arnaud Charlet
b60170728e [Ada] Enable checks on runtime by default
gcc/ada/

	* gcc-interface/Makefile.in (GNATLIBFLAGS): Enable checks by
	default.
	* libgnat/s-bitfie.ads: Suppress alignment checks.
	* libgnat/s-bituti.adb: Minor reformatting.
	* libgnat/s-secsta.adb (SS_Allocate): Support Size = 0.
2020-11-30 09:16:21 -05:00
Arnaud Charlet
19b95c22c0 [Ada] Wrong replacement of Component.Discriminant
gcc/ada/

	* exp_ch3.adb (Replace_Discr_Ref): Removed, no longer needed.
2020-11-30 09:16:21 -05:00
Piotr Trojanek
1c4dfafe68 [Ada] Minor reuse Is_Assignable
gcc/ada/

	* sem_ch5.adb (Process_Statements): Replace low-level membership
	test with a high-level wrapper.
2020-11-30 09:16:21 -05:00
Piotr Trojanek
ad6be99f1a [Ada] Simplify analysis of assignment statements
gcc/ada/

	* sem_ch5.adb (Set_Assignment_Type): Combine calls to Ekind
	using membership test.
	(Should_Transform_BIP_Assignment): Replace assignment to a
	"Result" variable with simple return statements; avoid repeated
	calls to Unqual_Conv by declaring a local constant.
2020-11-30 09:16:21 -05:00
Piotr Trojanek
3480505630 [Ada] Minor reuse Is_Protected_Component
gcc/ada/

	* lib-xref.adb (Generate_Reference): Fix reference to
	Analyze_Assignment.
	* sem_ch5.adb (Diagnose_Non_Variable_Lhs): Reuse existing
	utility function.
2020-11-30 09:16:20 -05:00
Eric Botcazou
c1a69c9871 [Ada] Fix internal error on extended return and fixed-point result
gcc/ada/

	* contracts.adb (Check_Type_Or_Object_External_Properties): Make
	sure to exclude all return objects from the SPARK legality rule
	on effectively volatile variables.
	* exp_ch6.adb (Expand_N_Extended_Return_Statement): Use the fast
	track only when the declaration of the return object can be
	dropped.
2020-11-30 09:16:20 -05:00
Gary Dismukes
f7937111e8 [Ada] Implement inheritance for Default_Initial_Condition and address other gaps
gcc/ada/

	* einfo.ads (Is_Partial_DIC_Procedure): New function.
	(Partial_DIC_Procedure): New procedure.
	* einfo.adb (Is_Partial_DIC_Procedure): New function to return
	whether a subprogram is a partial Default_Initial_Condition
	procedure by checking the name (to avoid adding a new field).
	(DIC_Procedure): Add a test that excludes partial DIC procedures
	from being returned.
	(Partial_DIC_Procedure): New procedure to return the partial DIC
	procedure of a type, if it has one (otherwise returns Empty).
	(Set_DIC_Procedure): Remove check for duplicate DIC procedures.
	* exp_aggr.adb (Gen_Assign): Generate a call to the type's DIC
	procedure in the case where an array component is default
	initialized (due to an association with a box).
	(Build_Record_Aggr_Code): For an extension aggregate, generate a
	call to the ancestor type's DIC procedure (if any) when the
	ancestor part is a subtype mark. For a record component
	association that was specified with a box (tested for by
	checking the new flag Was_Default_Init_Box_Association),
	generate a call to the component type's DIC procedure (if it has
	one).
	* exp_ch4.adb (Expand_N_Allocator): When the allocated object is
	default initialized and the designated type has a DIC aspect,
	generate a call to the DIC procedure.
	* exp_util.ads (Build_DIC_Call): Change the formal Obj_Id to
	name Obj_Name, and change its type from Entity_Id to Node_Id
	(and update comment).
	(Build_DIC_Procedure_Body): Add formal Partial_DIC, remove
	formal For_Freeze, and update comment accordingly.
	(Build_DIC_Procedure_Declaration): Add formal Partial_DIC and
	update comment.
	* exp_util.adb
	(Build_DIC_Call): Revised to use its Obj_Name (formerly Obj_Id)
	formal directly rather than calling New_Occurrence_Of on it, to
	allow arbitrary names to be passed rather than being limited to
	Entity_Ids.
	(Build_DIC_Procedure_Body): Call Add_Parent_DICs to generate
	checks for DICs associated with any parent types, implementing
	the required "additive" semantics for DICs. When building a DIC
	procedure body for a partial view (when Partial_DIC is True),
	call Add_Own_DIC when the type has its own DIC.  In the case of
	"full" DIC procedures, a call is generated to any partial DIC
	procedure of the type (unless the procedure has a null body),
	along with checks for any DICs inherited by the full view.
	(Build_DIC_Procedure_Declaration): Add handling for partial DIC
	procedures.  For the suffix of a regular DIC procedure's name,
	use "DIC" (instead of "Default_Initial_Condition"), and for the
	suffix of a partial DIC procedure's name, use "Partial_DIC".
	(Add_DIC_Check): Add the DIC pragma to the list of seen pragmas
	(Pragmas_Seen).
	(Add_Inherited_Tagged_DIC): Remove the formals Par_Typ,
	Deriv_Typ, and Obj_Id, and add formal Expr, which denotes DIC's
	expression. Remove the call to Replace_References (which is now
	done in Add_Inherited_DICs).
	(Add_Inherited_DICs): New procedure to locate a DIC pragma
	associated with a parent type, replace its references
	appropriately (such as any current instance references), and add
	a check for the DIC.
	(Add_Own_DIC): Add an Obj_Id formal to allow caller to pass the
	_init formal of the generated DIC procedure.
	(Add_Parent_DICs): New procedure to traverse a type's parents,
	looking for DICs associated with those and calling
	Add_Inherited_DICs to apply the appropriate DIC checks.
	(Is_Verifiable_DIC_Pragma): Treat pragmas that have an Empty
	first argument the same as a pragma without any arguments
	(returning False for that case).
	* exp_ch3.adb (Init_One_Dimension): Generate calls to the
	component's DIC procedure when needed.
	(Possible_DIC_Call): New function nested in Init_One_Dimension
	to build a call to the array component type's DIC-checking
	function when appropriate.
	(Build_Array_Init_Proc): The presence of a DIC on the component
	type is an additional condition for generating an init proc for
	an array type.
	(Build_Init_Statements): When the record component's type has a
	DIC, and the component declaration does not have an
	initialization expression, generate a call to the component
	type's DIC procedure.
	(Expand_N_Object_Declaration): Modify the call to Build_DIC_Call
	to pass a new occurrence of the object's defining id rather than
	the id itself.
	(Freeze_Type): Only build a type's DIC procedure (if it has one)
	for types that are not interfaces.
	* exp_spark.adb (Expand_SPARK_N_Freeze_Type): Remove From_Freeze
	actual and add a ??? comment.
	(Expand_SPARK_N_Object_Declaration): Modify call to
	Build_DIC_Call to pass a new occurrence of the object id rather
	than the object id itself.
	* sem_aggr.adb (Resolve_Record_Aggregate): Declare local flag
	Is_Box_Init_By_Default and set it in cases where the component
	association has a box and the component is being initialized by
	default (as opposed to initialized by an initialization
	expression associated with the component's declaration).
	(Add_Association): If the association has a box for a component
	initialized by default, the flag
	Was_Default_Init_Box_Association is set on the new component
	association (for later testing during expansion).
	(Get_Value): Reset Is_Box_Init_By_Default to False.
	* sem_ch3.adb (Build_Assertion_Bodies_For_Type): Rearrange code
	to build DIC procedure bodies for a (noninterface) type that
	Has_Own_DIC (for partial type views) or Has_DIC (for full type
	views) as appropriate.
	* sem_ch13.adb (Analyze_Aspect_Specifications,
	Aspect_Default_Initial_Condition): Add an extra argument to the
	DIC pragma to denote the type associated with the pragma (for
	use in Build_DIC_Procedure_Body).
	* sem_prag.adb (Analyze_Pragma): Allow two arguments for pragma
	Default_Initial_Condition.  If not already present, add an extra
	argument denoting the type that the pragma is associated with.
	* sem_util.adb (Propagate_DIC_Attributes): Retrieve any partial
	DIC procedure associated with the type and add it to the type's
	list of subprograms (Subprograms_For_Type).
	* sinfo.ads (Was_Default_Init_Box_Association): New flag on
	N_Component_Association nodes.  Add subprograms to get and set
	flag, as well as updating the documentation.
	* sinfo.adb (Was_Default_Init_Box_Association): New function to
	retrieve the corresponding flag (Flag14).
	(Set_Was_Default_Init_Box_Association): New procedure to set the
	corresponding flag (Flag14).
2020-11-30 09:16:20 -05:00
Arnaud Charlet
7b76fe3dcf [Ada] Improve error recovery
gcc/ada/

	* par-ch6.adb (P_Formal_Part): Remove extra call to Scan.
	* par-tchk.adb: Minor reformatting.
2020-11-30 09:16:19 -05:00
Eric Botcazou
5a85f3129c [Ada] Reimplement Ada.Numerics.Big_Numbers.Big_Reals.Fixed_Conversions
gcc/ada/

	* libgnat/a-nbnbre.adb (Float_Conversions): Instantiate Conv
	package only once in the body.
	(Fixed_Conversions.Float_Aux): New instance.
	(Fixed_Conversions.Conv_I): Likewise.
	(Fixed_Conversions.Conv_U): Likewise.
	(Fixed_Conversions.LLLI): New subtype.
	(Fixed_Conversions.LLLU): Likewise.
	(Fixed_Conversions.Too_Large): New constant.
	(Fixed_Conversions.To_Big_Real): Reimplement.
	(Fixed_Conversions.From_Big_Real): Likewise.
2020-11-30 09:16:19 -05:00
Bob Duff
e783561e9c [Ada] Compiler crash on limited conditional expressions
gcc/ada/

	* exp_ch3.adb (Expand_N_Object_Declaration): Avoid crash in case
	of conditional expression.
2020-11-30 09:16:19 -05:00
Eric Botcazou
2bf891fa75 [Ada] Expand integer-only implementation of ordinary fixed-point types
gcc/ada/

	* doc/gnat_rm/implementation_defined_attributes.rst (Pool_Address):
	Fix pasto.
	(Small_Denominator): New entry.
	(Small_Numerator): Likewise.
	* doc/gnat_rm/implementation_defined_characteristics.rst (3.5.9):
	Relax conditions on 128-bit smalls and integer-only implementation.
	* gnat_rm.texi: Regenerate.
	* exp_attr.adb (Expand_N_Attribute_Reference) <Attribute_Fore>:
	Relax conditions on integer implementation for ordinary fixed-point
	types and pass a third parameter to the routine.
	<Attribute_Small_Denominator>: Raise Program_Error.
	<Attribute_Small_Numerator>: Likewise.
	* exp_fixd.adb (Expand_Convert_Fixed_To_Fixed): Use a scaled divide
	if the numerator and denominator of the small ratio are sufficiently
	small integers.
	(Expand_Convert_Fixed_To_Integer): Use a scaled divide if numerator
	and denominator of the small value are sufficiently small integers.
	(Expand_Convert_Integer_To_Fixed): Likewise.
	* exp_imgv.adb (Expand_Image_Attribute): Relax the conditions on the
	integer implementation for ordinary fixed-point types.
	(Expand_Value_Attribute): Likewise.
	* freeze.adb (Freeze_Fixed_Point_Type): Relax conditions on 128-bit
	smalls.
	* sem_attr.adb (Analyze_Attribute) <Attribute_Small_Denominator>:
	Check no arguments, fixed-point and set type to Universal_Integer.
	<Attribute_Small_Numerator>: Likewise.
	(Eval_Attribute) <Attribute_Small_Denominator>: Fold statically.
	<Attribute_Small_Numerator>: Likewise.
	* snames.ads-tmpl (Name_Small_Denominator): New attribute name.
	(Name_Small_Numerator): Likewise.
	(Attribute_Id): Add Attribute_Small_{Denominator,Numerator}.
	* libgnat/a-tifiio.adb (Exact): Delete.
	(Need_64): Likewise.
	(OK_Get_32): New boolean constant.
	(OK_Put_32): Likewise.
	(OK_Get_64): Likewise.
	(OK_Put_64): Likewise.
	(E): Adjust.
	(Get procedures): Likewise.
	(Put procedures): Likewise.
	* libgnat/a-tifiio__128.adb (Exact): Delete.
	(Need_64): Likewise.
	(Need_128): Likewise.
	(OK_Get_32): New boolean constant.
	(OK_Put_32): Likewise.
	(OK_Get_64): Likewise.
	(OK_Put_64): Likewise.
	(OK_Get_128): Likewise.
	(OK_Put_128): Likewise.
	(E): Adjust.
	(Get procedures): Likewise.
	(Put procedures): Likewise.
	* libgnat/a-wtfiio.adb (Exact): Delete.
	(Need_64): Likewise.
	(OK_Get_32): New boolean constant.
	(OK_Put_32): Likewise.
	(OK_Get_64): Likewise.
	(OK_Put_64): Likewise.
	(E): Adjust.
	(Get procedures): Likewise.
	(Put procedures): Likewise.
	* libgnat/a-wtfiio__128.adb (Exact): Delete.
	(Need_64): Likewise.
	(Need_128): Likewise.
	(OK_Get_32): New boolean constant.
	(OK_Put_32): Likewise.
	(OK_Get_64): Likewise.
	(OK_Put_64): Likewise.
	(OK_Get_128): Likewise.
	(OK_Put_128): Likewise.
	(E): Adjust.
	(Get procedures): Likewise.
	(Put procedures): Likewise.
	* libgnat/a-ztfiio.adb (Exact): Delete.
	(Need_64): Likewise.
	(OK_Get_32): New boolean constant.
	(OK_Put_32): Likewise.
	(OK_Get_64): Likewise.
	(OK_Put_64): Likewise.
	(E): Adjust.
	(Get procedures): Likewise.
	(Put procedures): Likewise.
	* libgnat/a-ztfiio__128.adb (Exact): Delete.
	(Need_64): Likewise.
	(Need_128): Likewise.
	(OK_Get_32): New boolean constant.
	(OK_Put_32): Likewise.
	(OK_Get_64): Likewise.
	(OK_Put_64): Likewise.
	(OK_Get_128): Likewise.
	(OK_Put_128): Likewise.
	(E): Adjust.
	(Get procedures): Likewise.
	(Put procedures): Likewise.
	* libgnat/s-fore_f.ads (Fore_Fixed): Adjust signature.
	* libgnat/s-fore_f.adb (Fore_Fixed): Reimplement.
	* libgnat/s-fofi32.ads (Fore_Fixed32): Adjust signature.
	* libgnat/s-fofi64.ads (Fore_Fixed64): Likewise.
	* libgnat/s-fofi128.ads (Fore_Fixed128): Likewise.
	* libgnat/s-imagef.ads: Adjust description.
	* libgnat/s-imagef.adb (Maxdigs): Move around.
	(Set_Image_Integer): Remove assertion.
	* libgnat/s-valuef.ads: Adjust description.
	* libgnat/s-valuef.adb (Integer_To_Fixed): Minor tweak.
2020-11-30 09:16:19 -05:00
Ghjuvan Lacambre
a18d46a4b6 [Ada] Implement -gnateb switch
gcc/ada/

	* doc/gnat_ugn/building_executable_programs_with_gnat.rst:
	Describe -gnateb switch.
	* doc/gnat_ugn/the_gnat_compilation_model.rst: Mention -gnateb
	switch in configuration pragma files section.
	* gnat_ugn.texi: Regenerate.
	* lib-writ.adb (Write_ALI): Strip directories from configuration
	files path if needed.
	* opt.ads: Declare Config_Files_Store_Basename option.
	* par.adb (Par): Save configuration file checksum.
	* switch-c.adb (Scan_Front_End_Switches): Set
	Config_Files_Store_Basename true if -gnateb is present.
2020-11-30 09:16:18 -05:00
Arnaud Charlet
b514643cae [Ada] Potential read of uninitialized variable in exp_dist.adb
gcc/ada/

	* exp_dist.adb (RCI_Cache): Initialize.
2020-11-30 09:16:18 -05:00
Arnaud Charlet
336aa630a0 [Ada] Address warning compiling terminals.c
gcc/ada/

	* terminals.c (allocate_pty_desc): Copy one less byte since the
	last byte will always be set to 0.
2020-11-30 09:16:18 -05:00
Eric Botcazou
a09afbd1c6 [Ada] Add stream-oriented attributes support for 128-bit integer types
gcc/ada/

	* doc/gnat_ugn/building_executable_programs_with_gnat.rst (-xdr):
	Document that XDR is not supported for 128-bit integer types.
	* gnat_ugn.texi: Regenerate.
	* exp_strm.adb (Build_Elementary_Input_Call): Deal with types
	larger than Long_Long_Integer.
	(Build_Elementary_Write_Call): Likewise.
	* rtsfind.ads (RE_Id): Add RE_I_LLL{I,U] and RE_W_LLL{I,U}.
	(RE_Unit_Table): Add entries for them.
	* libgnat/s-stratt.ads (I_LLLI): New inline function.
	(I_LLLU): Likewise.
	(W_LLLI): New inline procedure.
	(W_LLLU): Likewise.
	* libgnat/s-stratt.adb (S_LLLI): New subtype of SEA.
	(S_LLLU): Likewise.
	(From_LLLI): New instance of Unchecked_Conversion.
	(From_LLLU): Likewise.
	(To_LLLI): Likewise.
	(To_LLLU): Likewise.
	(I_LLLI): Implement.
	(I_LLLU): Likewise.
	(W_LLLI): Likewise.
	(W_LLLU): Likewise.
2020-11-30 09:16:18 -05:00
Ed Schonberg
4056d9abfa [Ada] Spurious error on iterator over container with modified private part
gcc/ada/

	* exp_ch5.adb (Expand_Iterator_Loop_Over_Container): Check the
	signature of the private operation Get_Element_Access to prevent
	accidental use of a user-defined homonym subprogram.
2020-11-30 09:16:17 -05:00
Yannick Moy
602c7bc215 [Ada] Add comment on special Heap variable used in GNATprove
gcc/ada/

	* spark_xrefs.ads: Add comment for Heap that it may remain
	Empty.
2020-11-30 09:16:17 -05:00
Pascal Obry
50a2820f9d [Ada] Fix serial port control setting on GNU/Linux
gcc/ada/

	* libgnat/g-sercom__linux.adb (Set): Fix control flags of the
	serial port setting.
2020-11-30 09:16:17 -05:00
Pascal Obry
a6617b2950 [Ada] Minor style fixes
gcc/ada/

	* libgnat/g-sercom__linux.adb: Minor style fixes.
2020-11-30 09:16:17 -05:00
Piotr Trojanek
9784779754 [Ada] Fix folding of comparison operators in GNATprove mode
gcc/ada/

	* exp_util.adb (Get_Current_Value_Condition): Don't use current
	value tracking in GNATprove mode.
	* sem_res.adb (Resolve_Comparison_Op): Remove incomplete
	special-casing for folding in GNATprove mode.
2020-11-30 09:16:16 -05:00
Bob Duff
a442bed36c [Ada] Crash on ghost assignment check for illegal code
gcc/ada/

	* errout.adb (Error_Msg_NEL): Do not call Set_Posted if errors
	are being ignored.
	(Error_Msg): Change Errors_Must_Be_Ignored to use the getter.
	* sem_ch8.adb (Find_Direct_Name): Do not skip all the error
	checks when ignoring errors, but instead do not add an entry to
	the Urefs table if errors are being ignored.
	* exp_ch5.adb: Minor comment fix.
2020-11-30 09:16:16 -05:00
Yannick Moy
f456de4c43 [Ada] Add continuation message when others choice not allowed
gcc/ada/

	* sem_aggr.adb (Resolve_Array_Aggregate): Improve error message.
2020-11-30 09:16:16 -05:00
Eric Botcazou
c161b39d05 [Ada] Small cleanup in System.Value_F
gcc/ada/

	* libgnat/s-valuef.adb (Integer_To_Fixed): Do not modify numerator
	or denominator in order to reduce the exponent.
2020-11-30 09:16:16 -05:00
Arnaud Charlet
b50706ef31 [Ada] Confusion in Transform_Function_Array and internal subprograms
gcc/ada/

	* ali-util.adb (Get_File_Checksum): Remove dead code.
	* exp_ch4.adb (Expand_Boolean_Operator, Expand_N_Op_Not,
	Make_Boolean_Array_Op): Take Transform_Function_Array into
	account.
	* exp_ch6.adb (Expand_Call_Helper): Update comment. Code
	cleanup.
	* exp_util.adb (Build_Procedure_Form): Use new predefined name
	Name_UP_RESULT.
	* snames.ads-tmpl (Name_UP_RESULT): New predefined name.  Code
	cleanup: remove unused names from the project parser, moved to
	gprbuild sources.
	* xsnamest.adb: Add support for uppercase names.
2020-11-30 09:16:15 -05:00
Ed Schonberg
86b747a553 [Ada] Spurious visibility error in subprogram body in with_clause
gcc/ada/

	* sem_util.adb (Enter_Name): When an inherited operation for a
	local derived type is hidden by an explicit declaration of a
	non-overloadable entity in the same scope, make the inherited
	operation non-visible to prevent its accidental use elsewhere.
2020-11-30 09:16:15 -05:00
Richard Biener
ebbe3f2951 tree-optimization/98064 - fix BB SLP live lane extract wrt LC SSA
This avoids breaking LC SSA when SLP codegen pulled an out-of-loop
def into a loop when merging with in-loop defs for an external def.

2020-11-30  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/98064
	* tree-vect-loop.c (vectorizable_live_operation): Avoid
	breaking LC SSA for BB vectorization.

	* g++.dg/vect/pr98064.cc: New testcase.
2020-11-30 14:29:57 +01:00
Martin Liska
1e5c644fb6 changelog: allow subdir wildcard entry
contrib/ChangeLog:

	* gcc-changelog/git_commit.py: Allow sub-directory wildcard
	changelog entry. Fix a typo caused by apostrophe escaping.
	* gcc-changelog/test_email.py: Test it.
	* gcc-changelog/test_patches.txt: Likewise.
2020-11-30 13:42:25 +01:00
Jonathan Wakely
d795a8ef4e doc: Fix description of dg-require-effective-target
The optional target selector for the dg-require-effective-target
directive needs to be { target selector } not just { selector } as
currently documented.

gcc/ChangeLog:

	* doc/sourcebuild.texi (Directives): Fix description of
	dg-require-effective-target to include "target" in selector.
2020-11-30 12:29:01 +00:00
Richard Biener
4bcded23eb tree-optimization/98048 - fix vector lowering of ABSU_EXPR
This makes sure to use the correct type for the LHS of the scalar
replacement statement.

20220-11-30  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/98048
	* tree-vect-generic.c (expand_vector_operations_1): Use the
	correct type for the scalar LHS replacement.

	* gcc.dg/vect/pr98048.c: New testcase.
2020-11-30 13:27:56 +01:00
Martin Liska
5877c544c1 gimple ISEL: fix BB stmt iteration
gcc/ChangeLog:

	PR tree-optimization/98066
	* gimple-isel.cc (gimple_expand_vec_exprs): Return when
	gimple_expand_vec_exprs replaces last stmt.
2020-11-30 12:57:31 +01:00
Jonathan Wakely
08cd56a6b3 gcc-changelog: Add libstdc++-v3/testsuite to wildcard prefixes
This allows using "testsuite/*" in libstdc++-v3/ChangeLog entries, which
was one of the original motivations for adding wildcard support in the
first place:
https://gcc.gnu.org/pipermail/gcc/2020-June/232719.html

contrib/ChangeLog:

	* gcc-changelog/git_commit.py (wildcard_prefixes): Add libstdc++
	testsuite directory.
2020-11-30 11:41:03 +00:00
Ilya Leoshkevich
4380d5ae72 rtl_dump_bb: fix segfault when reporting internal error
During ICE reporting, sometimes rtl_dump_bb is called on partially
initialized basic blocks.  This produces another ICE, obscuring the
original problem.

Fix by checking that that basic blocks are initialized before touching
their bb_infos.

gcc/ChangeLog:

2020-11-25  Ilya Leoshkevich  <iii@linux.ibm.com>

	* cfgrtl.c (rtl_bb_info_initialized_p): New function.
	(rtl_dump_bb): Use rtl_bb_info_initialized_p before accessing bb
	insns.
2020-11-30 11:50:30 +01:00
Iain Buclaw
e855b30c28 d: Add freebsd support for D compiler and runtime
gcc/ChangeLog:

	PR d/87818
	* config.gcc (*-*-freebsd*): Add freebsd-d.o and t-freebsd.
	* config/freebsd-d.c: New file.
	* config/t-freebsd: New file.

libphobos/ChangeLog:

	PR d/87818
	* configure.tgt: Add x86_64-*-freebsd* and i?86-*-freebsd* as
	supported targets.
2020-11-30 11:45:15 +01:00
Stam Markianos-Wright
dee11eb742 [Obvious] arm: Fix test from failing on some targets [PR91816]
This recently submitted test was found to fail on some Cortex-M
targets. This was because codegen on these CPUs would emit a ldr
instead of a movw/movt pair, resulting in an overall smaller test
(i.e. the branch wasn't as far) and the behaviour being tested
for not being triggered.

This commit doubles the size of the test to account for this.

gcc/testsuite/ChangeLog:

	* gcc.target/arm/pr91816.c: New test.
2020-11-30 10:36:26 +00:00
Jakub Jelinek
4d87bd39ba expansion: Improve double-word modulo by certain constant divisors [PR97459]
As discussed in the PR, e.g. on x86_64 (both -m32 and -m64) there is no
double-word modulo and so we expand it to a __{,u}mod[dt]i3 call.
For certain constant divisors we can do better.  E.g. consider
32-bit word-size, 0x100000000ULL % 3 == 1, so we can use partly the Hacker's
delight modulo by summing digits approach and optimize
unsigned long long foo (unsigned long long x) { return x % 3; }
as
unsigned long long foo (unsigned long long x) {
  unsigned int sum, carry;
  carry = __builtin_add_overflow ((unsigned int) x, (unsigned int) (x >> 32), &sum);
  sum += carry;
  return sum % 3;
}
Similarly, 0x10000000ULL % 5 == 1 (note, 1 << 28), so
unsigned long long bar (unsigned long long x) { return x % 5; }
as
unsigned long long bar (unsigned long long x) {
  unsigned int sum = x & ((1 << 28) - 1);
  sum += (x >> 28) & ((1 << 28) - 1);
  sum += (x >> 56);
  return sum % 5;
}
etc.
And we can do also signed modulo,
long long baz (long long x) { return x % 5; }
as
long long baz (long long x) {
  unsigned int sum = x & ((1 << 28) - 1);
  sum += ((unsigned long long) x >> 28) & ((1 << 28) - 1);
  sum += ((unsigned long long) x >> 56);
  /* Sum adjustment for negative x.  */
  sum += (x >> 63) & 3;
  unsigned int rem = sum % 5;
  /* And finally adjust it to the right interval for negative values.  */
  return (int) (rem + ((x >> 63) & -4));
}

2020-11-30  Jakub Jelinek  <jakub@redhat.com>

	PR rtl-optimization/97459
	* internal-fn.h (expand_addsub_overflow): Declare.
	* internal-fn.c (expand_addsub_overflow): No longer static.
	* optabs.c (expand_doubleword_mod): New function.
	(expand_binop): Optimize double-word mod with constant divisor.

	* gcc.dg/pr97459-1.c: New test.
	* gcc.dg/pr97459-2.c: New test.
2020-11-30 10:55:43 +01:00
Martin Liska
fbbce1c6e9 changelog: Allow wildcard pattern only.
contrib/ChangeLog:

	* gcc-changelog/git_commit.py: Allow wildcard pattern only.
2020-11-30 10:40:36 +01:00
Kito Cheng
a5ad5d5c47 RISC-V: Always define MULTILIB_DEFAULTS
- Define MULTILIB_DEFAULTS can reduce the total number of multilib if
   the default arch and ABI are listed in the multilib config.

 - This also simplify the implementation of --with-multilib-list.

gcc/ChangeLog:

	* config.gcc (riscv*-*-*): Add TARGET_RISCV_DEFAULT_ABI and
	TARGET_RISCV_DEFAULT_ARCH to tm_defines.
	Remove including riscv/withmultilib.h for --with-multilib-list.
	* config/riscv/riscv.h (STRINGIZING): New.
	(__STRINGIZING): Ditto.
	(MULTILIB_DEFAULTS): Ditto.
	* config/riscv/withmultilib.h: Remove.
2020-11-30 11:50:30 +08:00
Kito Cheng
3a5d8ed231 Fix print_multilib_info when default arguments appear in the option list with '!'
This issue is found when we try to always define MULTILIB_DEFAULTS for -march
and -mabi for RISC-V back-end, however `-print-multi-lib` will skip
multi-lib setting if match any one of flag in MULTILIB_DEFAULTS, even
some options are specified in the option list with '!'.

e.g.

We have default march=rv32i and mabi=ilp32.

And we have following multi-lib set:

". !march=rv32i !march=rv32im !march=rv32imafc !mabi=ilp32 !mabi=ilp32f;"
"rv32i/ilp32 march=rv32i !march=rv32im !march=rv32imafc mabi=ilp32 !mabi=ilp32f;"
"rv32im/ilp32 !march=rv32i march=rv32im !march=rv32imafc mabi=ilp32 !mabi=ilp32f;"
"rv32imafc/ilp32f !march=rv32i !march=rv32ic !march=rv32im march=rv32imafc !mabi=ilp32 mabi=ilp32f;"

`-print-multi-lib` willl show `.` and `rv32imafc/ilp32f` only, because
the mabi=ilp32 is matched, however there is `!march=rv32i` in `rv32im/ilp32`, so
`rv32im/ilp32` should keep, because it reject march=rv32i.

Note: This can be reproduced via following configure options with patch [1]:
gcc/configure --target=riscv64-elf --with-arch=rv32i --with-abi=ilp32 \
  --with-multilib-generator="rv32i-ilp32--;rv32im-ilp32--;rv32imafc-ilp32f--"

[1] https://gcc.gnu.org/pipermail/gcc-patches/2020-November/559707.html

gcc/ChangeLog:

	* gcc.c (print_multilib_info): Check default arguments not
	appeared in multi-lib option list with '!'
2020-11-30 11:50:30 +08:00
Stefan Kanthak
a8ae23920f fixed _bswapsi2 function
libgcc

	* libgcc2.c (bswapsi2): Make constants unsigned.
2020-11-29 18:05:46 -07:00
Jeff Law
5f628fb5ce Fix minor bug in ft32 widening multiply
gcc/
	* config/ft32/ft32.md (umulsidi3): Do not allow constants as
	arguments.
2020-11-29 18:03:28 -07:00
GCC Administrator
a9625c50dd Daily bump. 2020-11-30 00:16:27 +00:00
Harald Anlauf
bb67ad5cff PR fortran/98017 - Suspected regression using PACK
When substituting a parameter variable of type character, the character
length was reset to 1.  Fix this by copying the length.

gcc/fortran/ChangeLog:

	* expr.c (simplify_parameter_variable): Fix up character length
	after copying an array-valued expression.

gcc/testsuite/ChangeLog:

	* gfortran.dg/pr98017.f90: New test.
2020-11-29 23:24:45 +01:00
Jan Hubicka
ccea13715b Fix handling of ignore_stores in ipa_merge_modref_summary_after_inlining
* ipa-modref.c (ipa_merge_modref_summary_after_inlining): Fix
	handling of ignore_stores.
2020-11-29 23:23:33 +01:00