Commit Graph

190691 Commits

Author SHA1 Message Date
Jonathan Wakely
e19e2989c3 libstdc++: Increase timeout for pthread7-rope.cc test
This test spawns thousands of threads and so times out if the tests are
run with a low timeout value and the machine is busy.

libstdc++-v3/ChangeLog:

	* testsuite/ext/rope/pthread7-rope.cc: Add dg-timeout-factor.
2022-01-06 14:56:33 +00:00
Jonathan Wakely
c83ecfbe74 libstdc++: Do not use std::isdigit in <charconv> [PR103911]
This avoids a potential race condition if std::setlocale is used
concurrently with std::from_chars.

libstdc++-v3/ChangeLog:

	PR libstdc++/103911
	* include/std/charconv (__from_chars_alpha_to_num): Return
	char instead of unsigned char. Change invalid return value to
	127 instead of using numeric trait.
	(__from_chars_alnum): Fix comment. Do not use std::isdigit.
	Change type of variable to char.
2022-01-06 14:56:12 +00:00
Jakub Jelinek
db33b1059b expr: Workaround profiledbootstrap uninit false positive [PR103899]
The threader changes resulted in a false positive warning during
profiledbootstrap:
In file included from ../../gcc/expr.c:26:
../../gcc/tree.h: In function ‘rtx_def* expand_expr_real_1(tree, rtx, machine_mode, expand_modifier, rtx_def**, bool)’:
../../gcc/tree.h:244:56: error: ‘context’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
  244 | #define TREE_CODE(NODE) ((enum tree_code) (NODE)->base.code)
      |                                                        ^~~~
../../gcc/expr.c:10343:8: note: ‘context’ was declared here
10343 |   tree context;
      |        ^~~~~~~
While it will be nice to improve the uninit pass to handle it if possible
(I do not want to close the PR until that is done), doing profiledbootstrap
is a common thing to do, so a workaround is handy, especially as in this
case when the workaround seems to be the right thing to do, as it moves
a variable declaration to the only place where it is set and used and avoids
the weird and for uninit asking
  tree context;
...
  if (exp)
    context = ...;
  gcc_assert (!exp
              || use (context)
              || use_some_more (context));

2022-01-06  Jakub Jelinek  <jakub@redhat.com>

	PR tree-optimization/103899
	* expr.c (expand_expr_real_1): Add a workaround for bogus uninit
	warning by moving context variable to the only spot where it is used
	and moving gcc_assert into if body.
2022-01-06 15:32:57 +01:00
Olivier Hainque
75b8a72617 Add VxWworks fixincludes hack, don't expect yvals.h from gcc
yvals.h on VxWorks expects the toolchain to provide its own
version of the header, which we don't do. Arrange to fallback
on the common system definitions instead.

2021-12-16  Olivier Hainque  <hainque@adacore.com>

fixincludes/
	* inclhack.def (vxworks_next_yvals): New hack.
	* tests/base/yvals.h: New expected test result.
	* fixincl.x: Regenerate.
2022-01-06 12:04:13 +00:00
Jakub Jelinek
80ad67e2af ifcvt: Check for asm goto at the end of then_bb/else_bb in ifcvt [PR103908]
On the following testcase, RTL ifcvt sees then_bb
(note 7 6 8 3 [bb 3] NOTE_INSN_BASIC_BLOCK)
(insn 8 7 9 3 (set (mem/c:SI (symbol_ref:DI ("b") [flags 0x2]  <var_decl 0x7fdccf5b0cf0 b>) [1 b+0 S4 A32])
        (const_int 1 [0x1])) "pr103908.c":6:7 81 {*movsi_internal}
     (nil))
(jump_insn 9 8 13 3 (parallel [
            (asm_operands/v ("# insn 1") ("") 0 []
                 []
                 [
                    (label_ref:DI 21)
                ] pr103908.c:7)
            (clobber (reg:CC 17 flags))
        ]) "pr103908.c":7:5 -1
     (expr_list:REG_UNUSED (reg:CC 17 flags)
        (nil))
 -> 21)
and similarly else_bb (just with a different asm_operands template).
It checks that those basic blocks have a single successor and
uses last_active_insn which intentionally skips over JUMP_INSNs, sees
both basic blocks contain the same set and merges them (or if the
sets are different, attempts some other noce optimization).
But we can't assume that the jump, even when it has only a single successor,
has no side-effects.

The following patch fixes it by punting if test_bb ends with a JUMP_INSN
that isn't onlyjump_p.

2022-01-06  Jakub Jelinek  <jakub@redhat.com>

	PR rtl-optimization/103908
	* ifcvt.c (bb_valid_for_noce_process_p): Punt on bbs ending with
	asm goto.

	* gcc.target/i386/pr103908.c: New test.
2022-01-06 09:29:34 +01:00
Marek Polacek
1935db2968 Avoid more -Wformat-diag warnings [PR103758]
Let's use "%<x>, %<y>, or %<z>" rather than "[x|y|z]" as in the rest of
our codebase.

	PR c++/103758

gcc/c-family/ChangeLog:

	* c-pragma.c (handle_pragma_scalar_storage_order): Use %< %> in
	diagnostic messages.
	(handle_pragma_diagnostic): Likewise.

gcc/testsuite/ChangeLog:

	* gcc.dg/sso-6.c: Update dg-warning.
2022-01-05 19:42:45 -05:00
GCC Administrator
0fbefa25b3 Daily bump. 2022-01-06 00:16:32 +00:00
Bill Schmidt
4ec62dbafe rs6000: Skip overload instances with uninitialized fntype (PR103622)
2022-01-05  Bill Schmidt  <wschmidt@linux.ibm.com>

gcc/
	PR target/103622
	* config/rs6000/rs6000-c.c (altivec_resolve_overloaded_builtin):
	Skip over instances with undefined function types.
2022-01-05 16:54:48 -06:00
Andrew Pinski
d243f4009d Fix target/103910: missing GTY on x86_mfence causing PCH usage to ICE
With -O3 -march=opteron, a mfence builtin is added after the loop
to say the nontemporal stores are no longer needed. This all good
without precompiled headers as the function decl that is referneced
by x86_mfence is referenced in another variable but with precompiled
headers, x86_mfence is all messed up and the decl was GC'ed away.
This fixes the problem by marking x86_mfence as GTY to save/restore
during precompiled headers just like most other variables in
the header file.

Committed as obvious after a bootstrap/test on x86_64-linux-gnu.

gcc/ChangeLog:

	PR target/103910
	* config/i386/i386.h (x86_mfence): Mark with GTY.
2022-01-05 22:37:19 +00:00
Uros Bizjak
c166632bd2 i386: Introduce V2QImode minmax, abs and uavgv2hi3_ceil [PR103861]
Add V2QImode minmax, abs and uavxv2qi3_ceil operations with SSE registers.

2022-01-05  Uroš Bizjak  <ubizjak@gmail.com>

gcc/ChangeLog:

	PR target/103861
	* config/i386/mmx.md (VI_16_32): New mode iterator.
	(VI1_16_32): Ditto.
	(mmxvecsize): Handle V2QI mode.
	(<smaxmin:code><mode>3): Rename from <smaxmin:code>v4qi3.
	Use VI1_16_32 mode iterator.
	(<umaxmin:code><mode>3): Rename from <umaxmin:code>v4qi3.
	Use VI1_16_32 mode iterator.
	(abs<mode>2): Use VI_16_32 mode iterator.
	(uavgv2qi3_ceil): New insn pattern.

gcc/testsuite/ChangeLog:

	PR target/103861
	* gcc.target/i386/pr103861-3.c: New test.
	* g++.dg/vect/slp-pr98855.cc (dg-final): Check that
	no vectorization using SLP was performed.
2022-01-05 23:17:25 +01:00
François Dumont
e3ef832a9e libstdc++: Optimize operations on small size hashtable [PR 68303]
When hasher is identified as slow and the number of elements is limited in the
container use a brute-force loop on those elements to look for a given key using
the key_equal functor. For the moment the default threshold to consider the
container as small is 20.

libstdc++-v3/ChangeLog:

	PR libstdc++/68303
	* include/bits/hashtable_policy.h
	(_Hashtable_hash_traits<_Hash>): New.
	(_Hash_code_base<>::_M_hash_code(const _Hash_node_value<>&)): New.
	(_Hashtable_base<>::_M_key_equals): New.
	(_Hashtable_base<>::_M_equals): Use latter.
	(_Hashtable_base<>::_M_key_equals_tr): New.
	(_Hashtable_base<>::_M_equals_tr): Use latter.
	* include/bits/hashtable.h
	(_Hashtable<>::__small_size_threshold()): New, use _Hashtable_hash_traits.
	(_Hashtable<>::find): Loop through elements to look for key if size is lower
	than __small_size_threshold().
	(_Hashtable<>::_M_emplace(true_type, _Args&&...)): Likewise.
	(_Hashtable<>::_M_insert_unique(_Kt&&, _Args&&, const _NodeGenerator&)): Likewise.
	(_Hashtable<>::_M_compute_hash_code(const_iterator, const key_type&)): New.
	(_Hashtable<>::_M_emplace(const_iterator, false_type, _Args&&...)): Use latter.
	(_Hashtable<>::_M_find_before_node(const key_type&)): New.
	(_Hashtable<>::_M_erase(true_type, const key_type&)): Use latter.
	(_Hashtable<>::_M_erase(false_type, const key_type&)): Likewise.
	* src/c++11/hashtable_c++0x.cc: Include <bits/functional_hash.h>.
	* testsuite/util/testsuite_performance.h
	(report_performance): Use 9 width to display memory.
	* testsuite/performance/23_containers/insert_erase/unordered_small_size.cc:
	New performance test case.
2022-01-05 21:46:52 +01:00
Martin Sebor
194f712f8b Avoid -Wformat-diag.
gcc/ChangeLog:
	* gimple-ssa-warn-access.cc (pass_waccess::maybe_warn_memmodel): Use
	%qs to avoid -Wformat-diag.
2022-01-05 13:32:24 -07:00
Uros Bizjak
6aa44066b3 i386: Fix type of one_cmplv2qi2 alternatives 1,2 [PR103915]
2022-01-05  Uroš Bizjak  <ubizjak@gmail.com>

gcc/ChangeLog:

	PR target/103915
	* config/i386/mmx.md (one_cmplv2qi2): Change
	alternatives 1,2 type from sselog to sselog1.

gcc/testsuite/ChangeLog:

	PR target/103915
	* gcc.target/i386/pr103915.c: New test.
2022-01-05 20:08:15 +01:00
Uros Bizjak
877c9e332f i386: Fix expand_vec_perm_pshufb for narrow modes [PR103905]
2022-01-05  Uroš Bizjak  <ubizjak@gmail.com>

gcc/ChangeLog:

	PR target/103905
	* config/i386/i386-expand.c (expand_vec_perm_pshufb): Fix number of
	narrow mode remapped elements for !one_operand_p case.

gcc/testsuite/ChangeLog:

	PR target/103905
	* gcc.target/i386/pr103905.c: New test.
2022-01-05 20:07:22 +01:00
Sandra Loosemore
85a3442c85 Fortran: Fix ICE caused by missing error for untyped symbol [PR103258]
The bit on a symbol to mark that it had already been diagnosed as
lacking a type was getting set even when the error was suppressed or
discarded, specifically when doing early resolution on a character
length expression to see if it can be constant-folded.  Explicitly
suppress errors before doing that, then check whether they are
suppressed before setting the bit.

2022-01-04  Sandra Loosemore  <sandra@codesourcery.com>

	PR fortran/103258

	gcc/fortran/
	* decl.c (gfc_match_char_spec): Suppress errors around call
	to gfc_reduce_init_expr.
	* error.c (gfc_query_suppress_errors): New.
	* gfortran.h (gfc_query_suppress_errors): Declare.
	* symbol.c (gfc_set_default_type): Check gfc_query_suppress_errors.

	gcc/testsuite/
	* gfortran.dg/pr103258.f90: New.
2022-01-05 09:02:22 -08:00
Jonathan Wakely
6aa0859afa libstdc++: Fix overconstrained std::string constructor [PR103919]
The C++17 basic_string(const T&, size_t, size_t) constructor is
overconstrained, so it can't be used for a NTBS and a temporary string
gets constructed (potentially allocating memory). There is no
corresponding constructor taking an NTBS, so no need to disambiguate
from it. Accepting an NTBS avoids the temporary (and potential
allocation) and is what the standard requires.

libstdc++-v3/ChangeLog:

	PR libstdc++/103919
	* include/bits/basic_string.h (basic_string(const T&, size_t, size_t)):
	Relax constraints on string_view parameter.
	* include/bits/cow_string.h (basic_string(const T&, size_t, size_t)):
	Likewise.
	* testsuite/21_strings/basic_string/cons/char/103919.cc: New test.
2022-01-05 15:31:04 +00:00
Jonathan Wakely
3633cc5428 libstdc++: Implement P1328 "Making std::type_info::operator== constexpr"
This feature is present in the C++23 draft.

With Jakub's recent front-end changes we can implement constexpr
equality by comparing the addresses of std::type_info objects. We do not
need string comparisons, because for constant evaluation cases we know
we aren't dealing with std::type_info objects defined in other
translation units.

The ARM EABI requires that the type_info::operator== function can be
defined out-of-line (and suggests that should be the default), but to be
a constexpr function it must be defined inline (at least for C++23
mode). To meet these conflicting requirements we make the inline version
of operator== call a new __equal function when called at runtime. That
is an alias for the non-inline definition of operator== defined in
libsupc++.

libstdc++-v3/ChangeLog:

	* config/abi/pre/gnu.ver (GLIBCXX_3.4.30): Export new symbol for
	ARM EABI.
	* include/bits/c++config (_GLIBCXX23_CONSTEXPR): Define.
	* include/std/version (__cpp_lib_constexpr_typeinfo): Define.
	* libsupc++/tinfo.cc: Add #error to ensure non-inline definition
	is emitted.
	(type_info::__equal): Define alias symbol.
	* libsupc++/typeinfo (type_info::before): Combine different
	implementations into one.
	(type_info::operator==): Likewise. Use address equality for
	constant evaluation. Call __equal for targets that require the
	definition to be non-inline.
	* testsuite/18_support/type_info/constexpr.cc: New test.
2022-01-05 14:43:01 +00:00
Jonathan Wakely
096228d84e libstdc++: Improvements to standard error category objects (part deux)
In r12-3860 the error categories in <system_error> were made final and
immortal, but I missed the categories for <future> and <ios>. This makes
the same changes to those.

libstdc++-v3/ChangeLog:

	* src/c++11/cxx11-ios_failure.cc (io_error_category): Define
	class and virtual functions as 'final'.
	(io_category_instance): Use constinit union to make the object
	immortal.
	* src/c++11/future.cc (future_error_category): Define class and
	virtual functions as 'final'.
	(future_category_instance): Use constinit union.
2022-01-05 14:17:51 +00:00
Jonathan Wakely
1918067e2d libstdc++: Fix std::error_code pretty printer for versioned namespace
libstdc++-v3/ChangeLog:

	* python/libstdcxx/v6/printers.py (StdErrorCodePrinter): Strip
	versioned namespace from the type name that is printed.
2022-01-05 14:17:50 +00:00
Jonathan Wakely
7a2f2d91aa libstdc++: Add pretty printer for std::regex internals
This helps visualize the NFA states in a std::regex.  It probably isn't
very useful for users, but helps when working on the implementation.

libstdc++-v3/ChangeLog:

	* python/libstdcxx/v6/printers.py (StdRegexStatePrinter): New
	printer for std::regex NFA states.
2022-01-05 13:47:02 +00:00
Jonathan Wakely
749ee73406 libstdc++: Fix comments in std::forward_list tests
libstdc++-v3/ChangeLog:

	* testsuite/23_containers/forward_list/operations/1.cc: Fill in
	placeholders in comments.
	* testsuite/23_containers/forward_list/operations/2.cc:
	Likewise.
	* testsuite/23_containers/forward_list/operations/3.cc:
	Likewise.
	* testsuite/23_containers/forward_list/operations/4.cc:
	Likewise.
	* testsuite/23_containers/forward_list/operations/5.cc:
	Likewise.
	* testsuite/23_containers/forward_list/operations/6.cc:
	Likewise.
	* testsuite/23_containers/forward_list/operations/7.cc:
	Likewise.
2022-01-05 13:47:02 +00:00
Jonathan Wakely
76a45931ab libstdc++: Avoid -Wzero-as-null-pointer-constant warning [PR103848]
libstdc++-v3/ChangeLog:

	PR libstdc++/103848
	* include/bits/stl_deque.h (operator-): Do not use 0 as null
	pointer constant.
2022-01-05 13:47:02 +00:00
Jonathan Wakely
917c7b136e libstdc++: Simplify std::allocator_traits<allocator<void>>::construct
We don't need a preprocessor condition to decide whether to use
placement new or std::construct_at, because std::_Construct already does
that.

libstdc++-v3/ChangeLog:

	* include/bits/alloc_traits.h (allocator_traits<allocator<void>>):
	Use std::_Construct for construct.
2022-01-05 13:47:01 +00:00
Jonathan Wakely
cebe875f6f libstdc++: Fix example preprocessor command in FAQ [PR103877]
libstdc++-v3/ChangeLog:

	PR libstdc++/103877
	* doc/xml/faq.xml: Add '-x c++' to preprocessor command.
	* doc/html/faq.html: Regenerate.
2022-01-05 13:47:01 +00:00
Jonathan Wakely
e09366718a libstdc++: Reduce template instantiations in <regex>
This moves the last two template parameters of __regex_algo_impl to be
runtime function parameters instead, so that we don't need four
different instantiations for the possible ways to call it. Most of the
function (and what it instantiates) is the same in all cases, so making
them compile-time choices doesn't really have much benefit.

Use  'if constexpr' for conditions that check template parameters, so
that when we do depend on a compile-time condition we only instantiate
what we need to.

libstdc++-v3/ChangeLog:

	* include/bits/regex.h (__regex_algo_impl): Change __policy and
	__match_mode template parameters to be function parameters.
	(regex_match, regex_search): Pass policy and match mode as
	function arguments.
	* include/bits/regex.tcc (__regex_algo_impl): Change template
	parameters to function parameters.
	* include/bits/regex_compiler.h (_RegexTranslatorBase): Use
	'if constexpr' for conditions using template parameters.
	(_RegexTranslator): Likewise.
	* include/bits/regex_executor.tcc (_Executor::_M_handle_accept):
	Likewise.
	* testsuite/util/testsuite_regex.h (regex_match_debug)
	(regex_search_debug): Move template arguments to function
	arguments.
2022-01-05 13:47:01 +00:00
Jonathan Wakely
9a2451c101 libstdc++: Compare match_results for failed regex_match
The regex_match_debug testsuite helper doesn't compare the
std::match_results objects after a failed match, but it should do. The
standard says that the effects of a failed match on the match-results
are unspecified, except that [conditions testable by operator==]. So we
can check that the two sets of results compare equal even if the match
failed.

libstdc++-v3/ChangeLog:

	* testsuite/util/testsuite_regex.h (regex_match_debug): Compare
	results even if the match failed.
2022-01-05 13:47:00 +00:00
Jonathan Wakely
260a5334ee libstdc++: Improve std::regex_error::what() strings
This replaces the vague "regex_error" for std::regex_error::what() with
a string that corresponds to the error_type enum passed to the
constructor. This allows us to remove many of the strings passed to
__throw_regex_error, because the default string is at least as good.
When a string argument to __throw_regex_error is kept it should add some
context-specific detail absent from the default string.

Also remove full stops (periods) from the end of those strings, to make
it easier to include them in logs and other output. I've left them
starting with an upper-case letter, which is consistent with strerror
output for (at least) Glibc, Solaris and BSD. I'm ambivalent whether
that's the right choice.

This also adds the missing noreturn attribute to __throw_regex_error.

libstdc++-v3/ChangeLog:

	* include/bits/regex_compiler.tcc: Adjust all calls to
	__throw_regex_error.
	* include/bits/regex_error.h (__throw_regex_error): Add noreturn
	attribute.
	* include/bits/regex_scanner.tcc: Likewise.
	* src/c++11/regex.cc (desc): New helper function.
	(regex_error::regex_error(error_type)): Use desc to get a string
	corresponding to the error code.
2022-01-05 13:47:00 +00:00
Nathan Sidwell
b1e701dc4a [c++] Adjust mark used member in instantiated class scope
The fix for PR97966 caused a regression with (non-template) member
functions of template classes.  We need to mark them used in the
instantiated class's scope, rather than the scope we were in before
instantiating, as the latter may itself be in template and change the
behaviour of marking a function as used.

	gcc/cp/
	* pt.c (instantiate_class_template_1): Process attribute((used)) set
	in class's context.
	gcc/testsuite/
	* g++.dg/template/attr-used.C: New.
2022-01-05 04:13:56 -08:00
Nathan Sidwell
f2da9e26f5 Fix diagnostic recursion ICE
The [with T = $TYPE] diagnostic machinery must not cause recursion. So let's
not unilaterally warn about new alignment.  (template extracted from Open3D.)

	gcc/cp/
	* init.c (build_new_1): Check complain before alignment warning.
	gcc/testsuite/
	* g++.dg/diagnostic/recur-align.C: New.
2022-01-05 04:04:01 -08:00
Nathan Sidwell
77e7161953 DCO Entry
* MAINTAINERS: Add DCO entry.  Sort that list.
2022-01-05 04:03:58 -08:00
Steve Baird
5e51d85e2e [Ada] Improve support for casing on types with controlled parts
gcc/ada/

	* exp_ch5.adb (Finish_Binding_Object_Declaration): Fix a bug
	that was introduced in the previous commit.  The previous
	version initialized a Boolean constant Declare_Copy before the
	variable Decl had been initialized properly.
2022-01-05 11:32:38 +00:00
Piotr Trojanek
a7b4fbd9b4 [Ada] Simplify detection of alphabetic characters with membership test
gcc/ada/

	* sem_prag.adb (Adjust_External_Name_Case): Use membership test.
2022-01-05 11:32:38 +00:00
Piotr Trojanek
2af751b3b8 [Ada] Expand controlling function wrapper into expression function
gcc/ada/

	* exp_ch3.adb (Make_Controlling_Function_Wrappers): For
	GNATprove build the wrapper as an expression function.
2022-01-05 11:32:38 +00:00
Piotr Trojanek
3531f20f6c [Ada] Expand controlling functions wrappers in GNATprove mode
gcc/ada/

	* exp_ch3.ads (Make_Controlling_Function_Wrappers): Move
	declaration from body to spec, so it can be called by
	SPARK-specific expansion.
	* exp_ch3.adb (Make_Controlling_Function_Wrappers): Likewise.
	* exp_spark.adb (SPARK_Freeze_Type): Enable expansion of
	wrappers for function with controlling result types.
2022-01-05 11:32:37 +00:00
Piotr Trojanek
48b8a564c9 [Ada] Use Add_Char_To_Name_Buffer for 1-character strings
gcc/ada/

	* exp_dbug.adb, sem_dim.adb: Replace Add_Str_To_Name_Buffer with
	Add_Char_To_Name_Buffer.
2022-01-05 11:32:37 +00:00
Piotr Trojanek
ad2fd234e7 [Ada] Simplify calls to Name_Find with known string parameter
gcc/ada/

	* gnatls.adb (Gnatls): Use Name_Find function.
	* targparm.adb (Get_Target_Parameters): Likewise.
2022-01-05 11:32:37 +00:00
Bob Duff
f3799ac534 [Ada] Compiler crash with -gnatR2 and with of child
gcc/ada/

	* repinfo.adb (List_Entities): The code was assuming that if we
	encounter a package in the current scope, then it must be
	a (physically) nested package.  That was wrong, because it could
	be a child package.  Avoid recursing into child packages; they
	have not been annotated with representation information, and
	-gnatR2 queries that information.
2022-01-05 11:32:37 +00:00
Marc Poulhiès
76cc077330 [Ada] Remove obsolete s-sopco* and s-strops units
gcc/ada/

	* libgnat/s-sopco3.ads, libgnat/s-sopco3.adb: Remove.
	* libgnat/s-sopco4.ads, libgnat/s-sopco4.adb: Remove.
	* libgnat/s-sopco5.ads, libgnat/s-sopco5.adb: Remove.
	* libgnat/s-strops.ads, libgnat/s-strops.adb: Remove.
	* Makefile.rtl (ADA_EXCLUDE_SRCS): Remove occurences of removed
	units.
	* gcc-interface/Make-lang.in (ada/sdefault.o): Remove
	dependencies on removed units.
	(GNATBIND_OBJS): Remove occurences of removed units.
2022-01-05 11:32:37 +00:00
Piotr Trojanek
3077fc46e9 [Ada] Remove extra whitespace in declarations and parameters lists
gcc/ada/

	* exp_ch3.adb (Build_Dcheck_Function): Remove extra whitespace.
	* libgnarl/s-taskin.adb (Initialize_ATCB): Likewise.
2022-01-05 11:32:37 +00:00
Piotr Trojanek
31593d2627 [Ada] Remove explicit "in" in internal parameter association
gcc/ada/

	* exp_attr.adb (Build_Array_VS_Func): Remove explicit "IN" in
	spec of the generated array validation function; it was
	redundant, just like it would be in a user-written code.
2022-01-05 11:32:36 +00:00
Piotr Trojanek
17b7c44f00 [Ada] Align arrows in parameter associations
gcc/ada/

	* exp_ch4.adb (Expand_N_Op_Ne): Fix whitespace.
	* sem_dim.adb (Expand_Put_Call_With_Symbol): Likewise.
	(Reduce): Likewise.
2022-01-05 11:32:36 +00:00
Piotr Trojanek
08613129bb [Ada] Remove extra space in parameter associations
gcc/ada/

	* exp_aggr.adb (Two_Pass_Aggregate_Expansion): Fix whitespace.
	* libgnat/a-cofuve.ads (Add): Likewise.
	* sem_ch3.adb (Build_Access_Subprogram_Wrapper): Likewise.
2022-01-05 11:32:36 +00:00
Piotr Trojanek
82faa04d97 [Ada] Fix layout of parameters in calls to Predef_Spec_Or_Body
gcc/ada/

	* exp_ch3.adb (Make_Eq_Body, Make_Neq_Body,
	Make_Predefined_Primitive_Eq_Spec,
	Make_Predefined_Primitive_Specs): Fix whitespace.
2022-01-05 11:32:36 +00:00
Etienne Servais
e2642e2b2c [Ada] Fix condition to build subtype for discriminated types
gcc/ada/

	* sem_ch3.adb (Analyze_Component_Declaration): Rework condition
	to build subtypes.
	(Analyze_Object_Declaration): Likewise.
	(Should_Build_Subtype): New.
2022-01-05 11:32:36 +00:00
Yannick Moy
bfcc4dd71b [Ada] Add contracts for the proof of System.Arith_128
gcc/ada/

	* libgnat/s-arit128.adb: Mark in SPARK.
	* libgnat/s-arit128.ads: Add functional contracts.
2022-01-05 11:32:36 +00:00
Piotr Trojanek
7c58372ad2 [Ada] Simplify handling of user-defined numeric literals
gcc/ada/

	* sem_util.adb (String_From_Numeric_Literal): Simplify using
	membership tests and ranges; fix whitespace.
2022-01-05 11:32:36 +00:00
Yannick Moy
3814652309 [Ada] Proof of runtime units for integer exponentiation (checks on)
gcc/ada/

	* libgnat/s-expint.ads: Mark in SPARK. Adapt to change to
	package.
	* libgnat/s-explli.ads: Likewise.
	* libgnat/s-expllli.ads: Likewise.
	* libgnat/s-expont.adb: Add lemmas and ghost code.
	* libgnat/s-expont.ads: Add functional contract.
2022-01-05 11:32:35 +00:00
Piotr Trojanek
1702fb6bf9 [Ada] Remove unnecessary check for missing parameter specifications
gcc/ada/

	* exp_disp.adb (Gen_Parameters_Profile): Remove redundant guard.
2022-01-05 11:32:35 +00:00
Claire Dross
c239773dd1 [Ada] Introduce expression functions for contract of Scan_Exponent
gcc/ada/

	* libgnat/s-valuti.ads (Starts_As_Exponent_Format_Ghost): Ghost
	function to determine if a string is recognized as something
	which might be an exponent.
	(Is_Opt_Exponent_Format_Ghost): Ghost function to determine if a
	string has the correct format for an optional exponent.
	(Scan_Exponent): Use ghost functions to factorize contracts.
2022-01-05 11:32:35 +00:00
Bob Duff
a6505936a3 [Ada] Prevent Get_Current_Value_Condition from returning the same node
gcc/ada/

	* exp_util.ads (Get_Current_Value_Condition): Belt: Add a
	postcondition that Val /= Var.
	* sem_util.adb (Known_Null): Suspenders: Raise Program_Error if
	Get_Current_Value_Condition returned the same value. This will
	be enabled even without assertions, because infinite recursion
	is a nuisance -- better to crash if this bug ever occurs.
2022-01-05 11:32:35 +00:00