Commit Graph

181745 Commits

Author SHA1 Message Date
David Malcolm
c1c6750f8d Unbreak build with --disable-analyzer
I broke the build with --disable-analyzer with
g:66dde7bc64b75d4a338266333c9c490b12d49825, due to:

../../src/gcc/analyzer/analyzer-pass.cc: In member function ‘virtual unsigned int {anonymous}::pass_analyzer::execute(function*)’:
../../src/gcc/analyzer/analyzer-pass.cc:86:3: error: ‘sorry_no_analyzer’ was not declared in this scope
   86 |   sorry_no_analyzer ();
      |   ^~~~~~~~~~~~~~~~~

Fixed by including the relevant header file.
Sorry about the breakage.

gcc/analyzer/ChangeLog:
	* analyzer-pass.cc: Include "analyzer/analyzer.h" for the
	declaration of sorry_no_analyzer; include "tree.h" and
	"function.h" as these are needed by it.
2020-11-30 17:37:50 -05:00
Jeff Law
dccae0f42e Add function comments for recently added member functions.
gcc/
	* symtab.c (set_section_for_node): Add function comment.
	(set_section_from_node): Likewise.
2020-11-30 15:21:38 -07:00
Ian Lance Taylor
eafb46ce90 internal/cpu: don't define CacheLinePadSize for mips64x
For libgo the definition comes from the generated file cpugen.go.

Fixes PR go/98041

Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/273866
2020-11-30 12:24:17 -08:00
Ian Lance Taylor
9ebad4b01c compiler, runtime: check len/cap for append(s, make(T, l)...)
The overflow checks done in growslice always reported an error for the
capacity argument, even if it was the length argument that overflowed.
This change lets the code pass the current issue4085b.go test.

Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/273806
2020-11-30 12:22:14 -08:00
Ian Lance Taylor
e848a83f46 libgo: define SO_RCVTIMEO on 32-bit GNU/Linux
Fixes golang/go#42872

Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/273892
2020-11-30 12:17:01 -08:00
Ian Lance Taylor
5ba975e668 compiler: improve error messages for expected curly brace
For golang/go#17328

Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/273890
2020-11-30 12:14:23 -08:00
Ian Lance Taylor
c7f272e05e compiler: use correct assignment order for type assertions
For "a, b := v.(T)" we must set a before b.

For golang/go#13433

Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/273906
2020-11-30 12:10:26 -08:00
Ian Lance Taylor
8d8fea8a57 compiler: always use int context for index values
For golang/go#14844

Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/273889
2020-11-30 12:07:39 -08:00
Ian Lance Taylor
38f1084181 compiler: better error messages for missing interface method
For golang/go#10700

Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/273886
2020-11-30 12:03:25 -08:00
Ian Lance Taylor
4f32eced9d compiler: improve error for import of non-string
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/273867
2020-11-30 12:00:15 -08:00
David Malcolm
66dde7bc64 Add analyzer plugin support and CPython GIL example
This patch adds a new GCC plugin event: PLUGIN_ANALYZER_INIT, called
when -fanalyzer is starting, allowing for GCC plugins to register
additional state-machine-based checks within -fanalyzer.  The idea
is that 3rd-party code might want to add domain-specific checks for
its own APIs - with the caveat that the analyzer is itself still
rather experimental.

As an example, the patch adds a proof-of-concept plugin to the testsuite
for checking CPython code: verifying that code that relinquishes
CPython's global interpreter lock doesn't attempt to do anything with
PyObjects in the sections where the lock isn't held.  It also adds a
warning about nested releases of the lock, which is forbidden.
For example:

demo.c: In function 'foo':
demo.c:11:3: warning: use of PyObject '*(obj)' without the GIL
   11 |   Py_INCREF (obj);
      |   ^~~~~~~~~
  'test': events 1-3
    |
    |   15 | void test (PyObject *obj)
    |      |      ^~~~
    |      |      |
    |      |      (1) entry to 'test'
    |   16 | {
    |   17 |   Py_BEGIN_ALLOW_THREADS
    |      |   ~~~~~~~~~~~~~~~~~~~~~~
    |      |   |
    |      |   (2) releasing the GIL here
    |   18 |   foo (obj);
    |      |   ~~~~~~~~~
    |      |   |
    |      |   (3) calling 'foo' from 'test'
    |
    +--> 'foo': events 4-5
           |
           |    9 | foo (PyObject *obj)
           |      | ^~~
           |      | |
           |      | (4) entry to 'foo'
           |   10 | {
           |   11 |   Py_INCREF (obj);
           |      |   ~~~~~~~~~
           |      |   |
           |      |   (5) PyObject '*(obj)' used here without the GIL
           |

Doing so requires adding some logic for ignoring macro expansions in
analyzer diagnostics, since the insides of Py_INCREF and
Py_BEGIN_ALLOW_THREADS are not of interest to the user for these cases.

gcc/analyzer/ChangeLog:
	* analyzer-pass.cc (pass_analyzer::execute): Move sorry call to...
	(sorry_no_analyzer): New.
	* analyzer.h (class state_machine): New forward decl.
	(class logger): New forward decl.
	(class plugin_analyzer_init_iface): New.
	(sorry_no_analyzer): New decl.
	* checker-path.cc (checker_path::fixup_locations): New.
	* checker-path.h (checker_event::set_location): New.
	(checker_path::fixup_locations): New decl.
	* diagnostic-manager.cc
	(diagnostic_manager::emit_saved_diagnostic): Call
	checker_path::fixup_locations, and call fixup_location
	on the primary location.
	* engine.cc: Include "plugin.h".
	(class plugin_analyzer_init_impl): New.
	(impl_run_checkers): Invoke PLUGIN_ANALYZER_INIT callbacks.
	* pending-diagnostic.h (pending_diagnostic::fixup_location): New
	vfunc.

gcc/ChangeLog:
	* doc/plugins.texi (Plugin callbacks): Add PLUGIN_ANALYZER_INIT.
	* plugin.c (register_callback): Likewise.
	(invoke_plugin_callbacks_full): Likewise.
	* plugin.def (PLUGIN_ANALYZER_INIT): New event.

gcc/testsuite/ChangeLog:
	* gcc.dg/plugin/analyzer_gil_plugin.c: New test.
	* gcc.dg/plugin/gil-1.c: New test.
	* gcc.dg/plugin/gil.h: New header.
	* gcc.dg/plugin/plugin.exp (plugin_test_list): Add the new plugin
	and test.
2020-11-30 14:32:28 -05:00
Jeff Law
5ddb6eca28 Remove dead cc0 code from H8 port
gcc/
	* config/h8300/bitfield.md: Remove "cc" attribute on any
	insns where it remained.
	* config/h8300/combiner.md: Likewise.
	* config/h8300/jumpcall.md: Likewise.
	* config/h8300/logical.md: Likewise.
	* config/h8300/testcompare.md: Likewise.
	* config/h8300/h8300.md (old_cc attr): Renamed from cc attr.
	* config/h8300/h8300.c (notice_update_cc): Remove.
	(compute_plussi_cc): Change references to CC_* to OLD_CC_.
	(compute_logical_op_cc): Likewise.
	(shift_one, shift_two): Likewise.
	(compute_a_shift_cc): Likewise.
	(get_shift_alg): Likewise.
	(struct shift_insn): Change type of cc_valid field.
	(struct shift_info): Likewise.
	* config/h8300/save.md: Remove accidentially created file.
2020-11-30 12:11:34 -07:00
Ilya Leoshkevich
b46314c780 profopt-execute: unset testname_with_flags if create_gcov fails
When diffing test results, there sometimes occur spurious "New tests
that PASS" / "Old tests that passed, that have disappeared" messages.
The reason is that if create_gcov is not installed, then the cached
testname_with_flags is not cleared and is carried over to the next
test.

gcc/testsuite/ChangeLog:

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

	* lib/profopt.exp: Unset testname_with_flags if create_gcov
	fails.
2020-11-30 19:11:56 +01:00
Richard Sandiford
f835e9f656 dse: Cope with bigger-than-integer modes [PR98037]
dse.c:find_shift_sequence tries to represent a store and load
back as a shift right followed by a truncation.  It therefore
needs to find an integer mode in which to do the shift right.
The loop it uses has the form:

  FOR_EACH_MODE_FROM (new_mode_iter,
		      smallest_int_mode_for_size (GET_MODE_BITSIZE (read_mode)))

which implicitly assumes that read_mode has an equivalent integer mode.
As shown in the testcase, not all modes have such an integer mode.

This patch just makes the code start from the smallest integer mode and
skip modes that are too small.  The loop already breaks at the first
mode wider than word_mode.

gcc/
	PR rtl-optimization/98037
	* dse.c (find_shift_sequence): Iterate over all integers and
	skip modes that are too small.

gcc/testsuite/
	PR rtl-optimization/98037
	* gcc.target/aarch64/sve/acle/general/pr98037.c: New test.
2020-11-30 17:15:47 +00:00
Eugene Rozenfeld
28a7fdd81e Optimize or+and+or pattern to and+or
gcc/
	PR tree-optimization/96679
	* match.pd (((b | c) & a) | b -> (a & c) | b): New pattern.
2020-11-30 09:48:58 -07:00
Martin Liska
167ab4b153 ipa: dump symtab to emergency dump file
gcc/ChangeLog:

	* passes.c (emergency_dump_function): Dump symtab when
	we are in an IPA pass.
2020-11-30 17:30:34 +01:00
Martin Liska
57cbb7acdb changelog: add hint for a file mismatch
contrib/ChangeLog:

	* gcc-changelog/git_commit.py: Suggest close file for
	'unchanged file mentioned in a ChangeLog' error.
	* gcc-changelog/test_email.py: Test it.
2020-11-30 17:19:41 +01:00
Jeff Law
e40fece7c9 Fix non-unique testnames
gcc/testsuite

	* g++.dg/warn/Wnonnull5.C: Fix non-unique testnames.
	* g++.dg/warn/Wplacement-new-size-8.C: Likewise.
2020-11-30 09:00:14 -07:00
Jonathan Wakely
82ac923da6 libstdc++: Add new C++20 headers to Doxygen settings
This doesn't actually have any effect unless you also change the
predefined value of __cplusplus, as it's currently 201703L. But if
somebody does want to do that, the new headers will get processed now.

libstdc++-v3/ChangeLog:

	* doc/doxygen/user.cfg.in (INPUT): Add <latch> and <semaphore>.
2020-11-30 15:02:03 +00:00
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