Commit Graph

185092 Commits

Author SHA1 Message Date
Uros Bizjak
92f372f009 i386: Do not emit mask compares for mode sizes < 16 [PR100445]
Recent addition of v*cond* patterns for MMXMODEI modes allows 64bit MMX
modes to enter ix86_expand_sse_cmp. ix86_use_mask_cmp_p was not prepared
to reject mode sizes < 16, resulting in ICE due to unavailability of 64bit
masked PCOM instructions.

2021-05-07  Uroš Bizjak  <ubizjak@gmail.com>

gcc/
	PR target/100445
	* config/i386/i386-expand.c (ix86_use_mask_cmp_p):
	Return false for mode sizes < 16.

gcc/testsuite/

	PR target/100445
	* gcc.target/i386/pr100445-1.c: New test.
2021-05-07 11:16:34 +02:00
Jakub Jelinek
323b18d54b i386: Fix up 8-byte vcond* with -mxop [PR100445]
ix86_expand_sse_movcc has special TARGET_XOP handling and the recent
addition of support of v*cond* patterns for MMXMODEI modes results in
ICEs because the expected pattern doesn't exist.  We can handle it
using 128-bit vpcmov (if we ignore the upper 64 bits like we ignore in
other TARGET_MMX_WITH_SSE support).

2021-05-07  Jakub Jelinek  <jakub@redhat.com>

	PR target/100445
	* config/i386/mmx.md (*xop_pcmov_<mode>): New define_insn.

	* gcc.target/i386/pr100445.c: New test.
2021-05-07 10:37:52 +02:00
GCC Administrator
cfe82a0cbe Daily bump. 2021-05-07 00:16:33 +00:00
Joseph Myers
8f51cf38bb preprocessor: Fix pp-number lexing of digit separators [PR83873, PR97604]
When the preprocessor lexes preprocessing numbers in lex_number, it
accepts digit separators in more cases than actually permitted in
pp-numbers by the standard syntax.

One thing this accepts is adjacent digit separators; there is some
code to reject those later, but as noted in bug 83873 it fails to
cover the case of adjacent digit separators within a floating-point
exponent.  Accepting adjacent digit separators only results in a
missing diagnostic, not in valid code being rejected or being accepted
with incorrect semantics, because the correct lexing in such a case
would have '' start the following preprocessing tokens, and no valid
preprocessing token starts '' while ' isn't valid on its own as a
preprocessing token either.  So this patch fixes that case by moving
the error for adjacent digit separators to lex_number (allowing a more
specific diagnostic than if '' were excluded from the pp-number
completely).

Other cases inappropriately accepted involve digit separators before
'.', 'e+', 'e-', 'p+' or 'p-' (or corresponding uppercase variants).
In those cases, as shown by the test digit-sep-pp-number.C added, this
can result in valid code being wrongly rejected as a result of too
many characters being included in the pp-number.  So this case is
fixed by terminating the pp-number at the correct character according
to the standard.  That test also covers the case where a digit
separator was followed by an identifier-nondigit that is not a
nondigit (e.g. a UCN); that case was already handled correctly.

Bootstrapped with no regressions for x86_64-pc-linux-gnu.

libcpp/
	PR c++/83873
	PR preprocessor/97604
	* lex.c (lex_number): Reject adjacent digit separators here.  Do
	not allow digit separators before '.' or an exponent with sign.
	* expr.c (cpp_classify_number): Do not check for adjacent digit
	separators here.

gcc/testsuite/
	PR c++/83873
	PR preprocessor/97604
	* g++.dg/cpp1y/digit-sep-neg-2.C,
	g++.dg/cpp1y/digit-sep-pp-number.C: New tests.
	* g++.dg/cpp1y/digit-sep-line-neg.C, g++.dg/cpp1y/digit-sep-neg.C:
	Adjust expected messages.
2021-05-06 23:20:35 +00:00
Jonathan Wakely
07dd185755 libstdc++: Improve static assert messages
The message used for static assertions should be phrased so that it's
unambiguous whether the condition should be true or false. The message
should definitely not state the negative condition.

libstdc++-v3/ChangeLog:

	* include/bits/stl_algobase.h (__copy_move, __copy_move_backward):
	Improve static_assert messages.
	* testsuite/25_algorithms/copy/58982.cc: Adjust expected output.
	* testsuite/25_algorithms/copy_n/58982.cc: Likewise.
2021-05-06 16:07:10 +01:00
Martin Jambor
717d278af9 ipa-sra: Do not bail out when callers cannot be cloned
IPA-SRA fails to produce (very simple) edge summaries when a caller
cannot be cloned or its signature cannot be changed which makes it
less powerful for no good reason.  This patch fixes that problem.

gcc/ChangeLog:

2021-04-12  Martin Jambor  <mjambor@suse.cz>

	* ipa-sra.c (ipa_sra_dump_all_summaries): Dump edge summaries even
	when there is no function summary.
	(ipa_sra_summarize_function): produce edge summaries even when
	bailing out early.

gcc/testsuite/ChangeLog:

2021-04-12  Martin Jambor  <mjambor@suse.cz>

	* gcc.dg/ipa/ipa-sra-1.c (main): Revert change done by
	05193687dd, make the argv again pointer to an array.
2021-05-06 16:53:58 +02:00
Tom Tromey
861c6411ea go: use htab_eq_string in godump
This changes godump to use the new htab_eq_string function.

gcc

	* godump.c (string_hash_eq): Remove.
	(go_finish): Use htab_eq_string.
2021-05-06 08:51:28 -06:00
Tom Tromey
72c65a877e gcc: use htab_eq_string
This changes one spot in GCC to use the new htab_eq_string function.

gcc

	* gengtype-state.c (read_state): Use htab_eq_string.
	(string_eq): Remove.
2021-05-06 08:51:28 -06:00
Tom Tromey
77380c6806 libiberty: add htab_eq_string
The libiberty hash table includes a helper function for strings, but
no equality function.  Consequently, this equality function has been
reimplemented a number of times in both the gcc and binutils-gdb
source trees.  This patch adds the function to the libiberty hash
table, as a step toward the goal of removing all the copies.

One change to gcc is included here.  Normally I would have put this in
the next patch, but gensupport.c used the most natural name for its
reimplementation of this function, and this can't coexist with the
extern function in libiberty.

include

	* hashtab.h (htab_eq_string): Declare.

libiberty

	* hashtab.c (htab_eq_string): New function.

gcc

	* gensupport.c (htab_eq_string): Remove.
2021-05-06 08:51:28 -06:00
Bernd Edlinger
e69ac02037 Add line debug info for virtual thunks
There is no debug info when the DECL_IGNORED_P flag
is set.  But sometimes we have the line info of the
function decl, as in the case of on virtual thunks.
So instead of no line info at all, we emit at least
the location of the function decl.
On the other side, there are DECL_IGNORED_P functions
which do not have any source line info at all.
Remove those from the debug_range info, to make it
clear for the debugger that the line info for these
functions is invalid.  This has the effect that the
debugger will not step into the function without
debug info.

2021-05-06  Bernd Edlinger  <bernd.edlinger@hotmail.de>

	PR ipa/97937
	* debug.h (gcc_debug_hooks): Add set_ignored_loc function pointer.
	* dwarf2out.h (dw_fde_node::ignored_debug): New data item.
	* dbxout.c (dbx_debug_hooks, xcoff_debug_hooks): Add dummy
	set_ignored_loc callbacks.
	* debug.c (do_nothing_debug_hooks): Likewise.
	* vmsdbgout.c (vmsdbg_debug_hooks): Likewise.
	* dwarf2out.c (text_section_used, cold_text_section_used): Remove.
	(in_text_section_p, last_text_label, last_cold_label,
	switch_text_ranges, switch_cold_ranges): New data items.
	(dwarf2out_note_section_used): Remove.
	(dwarf2out_begin_prologue): Set fde->ignored_debug and
	in_text_section_p.
	(mark_ignored_debug_section): New helper function.
	(dwarf2out_end_epilogue, dwarf2out_switch_text_section): Call
	mark_ignored_debug_section.
	(dwarf2_debug_hooks): Use dwarf2out_set_ignored_loc.
	(dwarf2_lineno_debug_hooks): Use dummy for set_ignored_loc.
	(size_of_aranges): Adjust formula for multi-part text ranges size.
	(output_aranges): Output multi-part text ranges.
	(dwarf2out_set_ignored_loc): New callback function.
	(dwarf2out_finish): Output multi-part text ranges.
	(dwarf2out_c_finalize): Clear new data items.
	* final.c (final_start_function_1): Call set_ignored_loc callback.
	(final_scan_insn_1): Likewise.
	* ggc-page.c (gt_ggc_mx): New helper function.
	* stringpool.c (gt_pch_nx): Likewise.
2021-05-06 16:37:58 +02:00
Eric Botcazou
0f442f1378 Fix PR testsuite/100454
gcc/testsuite/
	* gnat.dg/opt93.adb: Compile only for LP64 targets.
2021-05-06 16:29:44 +02:00
Robin Dapp
5edc7a0af6 testsuite: Add s390 to vect_*_cvt checks.
This patch adds s390 to vect_*_cvt checks in target-supports.exp.

gcc/testsuite/ChangeLog:

	* lib/target-supports.exp: Add s390 checks for vect conversions.
2021-05-06 16:15:38 +02:00
Robin Dapp
1e27ffde96 testsuite: Add vect_floatint_cvt to gcc.dg/vect/pr56541.c
pr56541.c converts a float vector to an int (bool) vector.  Add
vect_floatint_cvt in order to select the right targets.

gcc/testsuite/ChangeLog:

	* gcc.dg/vect/pr56541.c: Add vect_floatint_cvt.
2021-05-06 16:15:38 +02:00
Paul Thomas
a2c593009f Fortran: Assumed and explicit size class arrays [PR46691/99819].
2021-05-06  Paul Thomas  <pault@gcc.gnu.org>

gcc/fortran/ChangeLog

	PR fortran/46691
	PR fortran/99819
	* class.c (gfc_build_class_symbol): Remove the error that
	disables assumed size class arrays. Class array types that are
	not deferred shape or assumed rank are given a unique name and
	placed in the procedure namespace.
	* trans-array.c (gfc_trans_g77_array): Obtain the data pointer
	for class arrays.
	(gfc_trans_dummy_array_bias): Suppress the runtime error for
	extent violations in explicit shape class arrays because it
	always fails.
	* trans-expr.c (gfc_conv_procedure_call): Handle assumed size
	class actual arguments passed to non-descriptor formal args by
	using the data pointer, stored as the symbol's backend decl.

gcc/testsuite/ChangeLog

	PR fortran/46691
	PR fortran/99819
	* gfortran.dg/class_dummy_6.f90: New test.
	* gfortran.dg/class_dummy_7.f90: New test.
2021-05-06 14:42:59 +01:00
Patrick Palka
eb1aa9ad2a libstdc++: Implement LWG 3533 changes to foo_view::iterator::base()
libstdc++-v3/ChangeLog:

	* include/std/ranges (filter_view::_Iterator::base): Make the
	const& overload unconstrained and return a const reference as
	per LWG 3533.  Make unconditionally noexcept.
	(transform_view::_Iterator::base): Likewise.
	(elements_view::_Iterator::base): Likewise.
2021-05-06 09:11:44 -04:00
Patrick Palka
08f3287eef libstdc++: Implement LWG 3391 changes to move/counted_iterator::base()
libstdc++-v3/ChangeLog:

	* include/bits/stl_iterator.h (move_iterator::base): Make the
	const& overload unconstrained and return a const reference as
	per LWG 3391.  Make unconditionally noexcept.
	(counted_iterator::base): Likewise.
	* testsuite/24_iterators/move_iterator/lwg3391.cc: New test.
	* testsuite/24_iterators/move_iterator/move_only.cc: Adjust
	has_member_base concept to decay-copy the result of base().
2021-05-06 09:11:42 -04:00
Richard Biener
ee5361a16d refactor SSA rewriting timevars
This avoids too deep stacks of timevars during incremental
SSA rewrite and basically use TV_TREE_INTO_SSA for all into-SSA
rewrite work and TV_TREE_SSA_INCREMENTAL for update_ssa.

2021-05-06  Richard Biener  <rguenther@suse.de>

	* timevar.def (TV_TREE_INSERT_PHI_NODES): Remove.
	(TV_TREE_SSA_REWRITE_BLOCKS): Likewise.
	(TV_TREE_INTO_SSA): New.
	* tree-into-ssa.c (insert_phi_nodes): Do not account separately.
	(rewrite_blocks): Likewise.
	(pass_data_build_ssa): Account to TV_TREE_INTO_SSA.
2021-05-06 14:52:02 +02:00
Jonathan Wakely
0e79e63026 libstdc++: Fix definition of std::remove_cvref_t
I originally defined std::remove_cvref_t in terms of the internal
__remove_cvref_t trait, to avoid instantiating the remove_cvref class
template. However, as described in P1715R0 that is observable by users
and is thus non-conforming.

This defines remove_cvref_t as specified in the standard.

libstdc++-v3/ChangeLog:

	* include/std/type_traits (remove_cvref_t): Define in terms of
	remove_cvref.
	* testsuite/20_util/remove_cvref/value.cc: Check alias.
2021-05-06 13:41:15 +01:00
Jonathan Wakely
7411554686 Revert "libstdc++: Use unsigned char argument to std::isdigit"
This reverts commit d0d6ca0197.
2021-05-06 13:41:09 +01:00
Jakub Jelinek
cfd65e8d52 phiopt: Use gphi *phi instead of gimple *phi some more
Various functions in phiopt are also called with a gphi * but use
gimple * argument for it.

2021-05-06  Jakub Jelinek  <jakub@redhat.com>

	* tree-ssa-phiopt.c (value_replacement, minmax_replacement,
	abs_replacement, xor_replacement,
	cond_removal_in_popcount_clz_ctz_pattern,
	replace_phi_edge_with_variable): Change type of phi argument from
	gimple * to gphi *.
2021-05-06 14:05:06 +02:00
Richard Biener
a1ac9ffb5a Avoid update_ssa quadraticness in loop splitting
We already take care to not apply loop splitting to IL produced
by splitting so we should be able to delay updating SSA and
loop-closed SSA that was left broken after loop versioning
until after we processed all opportunities.

2021-05-06  Richard Biener  <rguenther@suse.de>

	* tree-ssa-loop-split.c (split_loop): Delay updating SSA form.
	Output an opt-info message.
	(do_split_loop_on_cond): Likewise.
	(tree_ssa_split_loops): Update SSA form here.
2021-05-06 13:54:02 +02:00
Richard Biener
1698f496c5 Fix IPA SRA removal of DECL_BY_REFERENCE return
While doing bogus call LHS removal I noticed that cloning with
dropping a return value creates a bogus replacement for a
DECL_BY_REFERENCE DECL_RESULT, resulting in MEM_REFs of
aggregates rather than pointers.  The following fixes this
latent issue.

2021-05-06  Richard Biener  <rguenther@suse.de>

	* tree-inline.c (tree_function_versioning): Fix DECL_BY_REFERENCE
	return variable removal.
2021-05-06 13:54:02 +02:00
Christophe Lyon
e82e87a851 testsuite: gcc.c-torture/execute/ieee/cdivchkld.c needs fmaxl
The new test gcc.c-torture/execute/ieee/cdivchkld.c needs fmaxl(),
which may not be available, for instance on aarch64-elf with newlib.
As discussed in the PR, requiring c99_runtime enables to skip the test
in this case.

2021-05-06  Christophe Lyon  <christophe.lyon@linaro.org>

	PR testsuite/100355
	gcc/testsuite/
	* gcc.c-torture/execute/ieee/cdivchkld.x: New.
2021-05-06 09:05:52 +00:00
Marius Hillenbrand
3c33c00f43 IBM Z: Fix error checking for builtin vec_permi
The builtin vec_permi is peculiar in that its immediate operand is
encoded differently than the immediate operand that is backing the
builtin. This fixes the check for the immediate operand, adding a
regression test in the process.

This partially reverts commit 3191c1f448

2021-05-06  Marius Hillenbrand  <mhillen@linux.ibm.com>

gcc/ChangeLog:

	* config/s390/s390-builtins.def (O_M5, O1_M5, ...): Remove unused macros.
	(s390_vec_permi_s64, s390_vec_permi_b64, s390_vec_permi_u64)
	(s390_vec_permi_dbl, s390_vpdi): Use the O3_U2 type for the immediate
	operand.
	* config/s390/s390.c (s390_const_operand_ok): Remove unused
	values.

gcc/testsuite/ChangeLog:

	* gcc.target/s390/zvector/imm-range-error-1.c: Fix test for
	__builtin_s390_vpdi.
	* gcc.target/s390/zvector/vec-permi.c: New test for builtin
	vec_permi.
2021-05-06 10:49:18 +02:00
Jakub Jelinek
ad96c867e1 phiopt: Optimize (x <=> y) cmp z [PR94589]
genericize_spaceship genericizes i <=> j to approximately
({ int c; if (i == j) c = 0; else if (i < j) c = -1; else c = 1; c; })
for strong ordering and
({ int c; if (i == j) c = 0; else if (i < j) c = -1; else if (i > j) c = 1; else c = 2; c; })
for partial ordering.
The C++ standard supports then == or != comparisons of that against
strong/partial ordering enums, or </<=/==/!=/>/>= comparisons of <=> result
against literal 0.

In some cases we already optimize that but in many cases we keep performing
all the 2 or 3 comparisons, compute the spaceship value and then compare
that.

The following patch recognizes those patterns if the <=> operands are
integral types or floating point (the latter only for -ffast-math) and
optimizes it to the single comparison that is needed (plus adds debug stmts
if needed for the spaceship result).

There is one thing I'd like to address in a follow-up: the pr94589-2.C
testcase should be matching just 12 times each, but runs
into operator>=(partial_ordering, unspecified) being defined as
(_M_value&1)==_M_value
rather than _M_value>=0.  When not honoring NaNs, the 2 case should be
unreachable and so (_M_value&1)==_M_value is then equivalent to _M_value>=0,
but is not a single use but two uses.  I'll need to pattern match that case
specially.

2021-05-06  Jakub Jelinek  <jakub@redhat.com>

	PR tree-optimization/94589
	* tree-ssa-phiopt.c (tree_ssa_phiopt_worker): Call
	spaceship_replacement.
	(cond_only_block_p, spaceship_replacement): New functions.

	* gcc.dg/pr94589-1.c: New test.
	* gcc.dg/pr94589-2.c: New test.
	* gcc.dg/pr94589-3.c: New test.
	* gcc.dg/pr94589-4.c: New test.
	* g++.dg/opt/pr94589-1.C: New test.
	* g++.dg/opt/pr94589-2.C: New test.
	* g++.dg/opt/pr94589-3.C: New test.
	* g++.dg/opt/pr94589-4.C: New test.
2021-05-06 10:15:40 +02:00
Richard Biener
b5254d6b75 ipa/100373 - fix emutls lowering compare-debug issue
emutls figured that tls uses in debug-insns need lowering but
that obviously has effects on code-generation as can be seen
in the following IL diff with the new testcase:

   <bb 2> [local count: 1073741824]:
-  a = 0;
+  # DEBUG BEGIN_STMT
   _4 = __builtin___emutls_get_address (&__emutls_v.b);
+  # DEBUG D#1 => *_4
+  # DEBUG d => (long int) D#1
+  # DEBUG BEGIN_STMT
+  a = 0;
+  # DEBUG BEGIN_STMT
   *_4 = 0;
   return;

where it figured the debug use of b in the original

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  # DEBUG D#1 => b
  # DEBUG d => (long int) D#1
  # DEBUG BEGIN_STMT
  a = 0;

needs lowering (it maybe does when we want to produce perfect
debug but that's just bad luck).

The following patch fixes this by avoiding to create a new
emutls address when visiting debug stmts and instead resets them.
Another option might be to simply not lower debug stmt uses
but I have no way to verify actual debug info for this.

2021-05-05  Richard Biener  <rguenther@suse.de>

	PR ipa/100373
	* tree-emutls.c (gen_emutls_addr): Pass in whether we're
	dealing with a debug use and only query existing addresses
	if so.
	(lower_emutls_1): Avoid splitting out addresses for debug
	stmts, reset the debug stmt when we fail to find existing
	lowered addresses.
	(lower_emutls_phi_arg): Set wi.stmt.

	* gcc.dg/pr100373.c: New testcase.
2021-05-06 10:08:16 +02:00
Javier Miranda
2fd7689cb2 [Ada] ACATS 4.1R-c611a04: Class-wide preconditions in dispatching calls
gcc/ada/

	* exp_disp.adb (Build_Class_Wide_Check): Extending the
	functionality of this routine to climb to the ancestors
	searching for the enclosing overridden dispatching primitive
	that has a class-wide precondition to generate the check.
2021-05-06 03:51:45 -04:00
Piotr Trojanek
60b803a7f1 [Ada] Avoid repeated analysis of constraint ranges
gcc/ada/

	* sem_ch3.adb (Constraint_Index): Remove redundant problematic
	analysis.
2021-05-06 03:51:44 -04:00
Arnaud Charlet
05b7561e37 [Ada] Assert failure on E_Enumeration_Literal and front-end unnesting
gcc/ada/

	* exp_unst.adb (Note_Uplevel_Bound): Exclude
	E_Enumeration_Literal.
2021-05-06 03:51:43 -04:00
Arnaud Charlet
369965ea43 [Ada] Bad expansion with -gnato2 and if expression
gcc/ada/

	* exp_ch4.adb (Expand_N_If_Expression):
	Apply_Arithmetic_Overflow_Check will not deal with
	Then/Else_Actions so skip minimizing overflow checks if any
	actions are present.
2021-05-06 03:51:42 -04:00
Boris Yakobowski
c4aeb3c3a2 [Ada] In CodePeer mode, use regular-exception handling
gcc/ada/

	* gnat1drv.adb (Adjust_Global_Switches): Simplify logic.
2021-05-06 03:51:41 -04:00
Arnaud Charlet
cfcbb5c741 [Ada] AI12-0411: Add "bool" to Interfaces.C
gcc/ada/

	* libgnat/i-c.ads (bool): New type.
	* libgnat/i-cexten.ads, libgnat/i-cexten__128.ads (bool): Now
	a subtype of Interfaces.C.bool.
	* libgnarl/s-interr__vxworks.adb (Interrupt_Manager): Qualify
	False.
	* libgnarl/s-interr.adb, libgnarl/s-interr__hwint.adb,
	libgnarl/s-tasini.adb, libgnarl/s-tasren.adb,
	libgnarl/s-tassta.adb, libgnarl/s-tpobmu.adb,
	libgnarl/s-tpobop.adb, libgnarl/s-tpopmo.adb: Replace
	Assert (False) by Assert (Standard.False).
2021-05-06 03:51:40 -04:00
Ghjuvan Lacambre
364ffbe348 [Ada] Explain meaning of Non_Std_Executable
gcc/ada/

	* make.adb (Compute_Executable): Document parameter.
2021-05-06 03:51:39 -04:00
Eric Botcazou
b6f9471df1 [Ada] Do not second-guess the hardware for underflow handling of Scaling
gcc/ada/

	* libgnat/s-fatgen.adb (Scaling): Use single handling of
	underflow.  Add pragma Annotate.
2021-05-06 03:51:38 -04:00
Ghjuvan Lacambre
1075946d06 [Ada] Make Is_OK_Static_Subtype use Is_Static_Subtype
gcc/ada/

	* sem_eval.adb (Is_OK_Static_Subtype): Call Is_Static_Subtype,
	remove redundant checks.
2021-05-06 03:51:38 -04:00
Piotr Trojanek
a86fbc250c [Ada] Remove repeated calls in Resolve_Range
gcc/ada/

	* sem_res.adb (First_Last_Ref): Simplify "if [condition] then
	return True" in "return [condition]".
	(Resolve_Range): Remove calls appearing in IF condition from the
	THEN statements.
2021-05-06 03:51:37 -04:00
Piotr Trojanek
ef4a0de035 [Ada] Use high-level Make_Character_Literal instead of low-level New_Node
gcc/ada/

	* sem_case.adb (Missing_Choice): Fix typo in comment.
	(Lit_Of): Simplify with Make_Character_Literal.
	(Check_Choices): Remove extra spaces in parameter
	specifications.
	* sem_case.ads: Same reformatting.
2021-05-06 03:51:36 -04:00
Ed Schonberg
e84d25c995 [Ada] Missing semantic error on ineffective Others_Clause
gcc/ada/

	* exp_aggr.adb (Expand_Array_Aggregate): If the expression in an
	Others_Clause has not been analyzed because previous analysis of
	the enclosing aggregate showed the clause to be ineffective i.e.
	cover a null range, analyze it now to detect a possible type
	illegality.
2021-05-06 03:51:35 -04:00
Eric Botcazou
bcc6807c4b [Ada] Fix off-by-one bug in underflow handling of Scaling
gcc/ada/

	* libgnat/s-fatgen.adb (Scaling): Fix off-by-one bug for underflow.
2021-05-06 03:51:34 -04:00
Arnaud Charlet
e18e1b5f52 [Ada] Assert failure on pragma Inline in procedure body
gcc/ada/

	* sem_ch6.adb (Is_Inline_Pragma): Protect against N not being a
	list member in both branches.
2021-05-06 03:51:33 -04:00
Piotr Trojanek
952da35cc6 [Ada] Remove hardcoded pragma Warnings from the formal vectors library
gcc/ada/

	* libgnat/a-cofove.adb (Insert_Space): Remove hardcoded pragma
	Warnings.
2021-05-06 03:51:32 -04:00
Piotr Trojanek
0632f86866 [Ada] Set Raises_CE flag only in Apply_Compile_Time_Constraint_Error
gcc/ada/

	* sem_ch4.adb (Analyze_Selected_Component): Remove explicit call
	to Set_Raises_Constraint_Error on statically missing component.
	* sem_eval.adb (Eval_Arithmetic_Op): Likewise for static
	divisions by integer and real zeros.
	* sem_util.adb (Apply_Compile_Time_Constraint_Error): Call
	Set_Raises_Constraint_Error before exiting early in GNATprove
	mode.
2021-05-06 03:51:31 -04:00
Justin Squirek
55b93bbc21 [Ada] Spurious constraint error on conversion of access types
gcc/ada/

	* checks.adb (Make_Discriminant_Constraint_Check): Add check for
	null when the type being converted is an access type.
2021-05-06 03:51:30 -04:00
Arnaud Charlet
5413faaec7 [Ada] Fix handling of PATs
gcc/ada/

	* exp_pakd.adb (Expand_Packed_Eq): Fix handling of PATs.
2021-05-06 03:51:30 -04:00
Piotr Trojanek
6068795883 [Ada] Remove unused initial value in Read_Library_Info_From_Full
gcc/ada/

	* osint.adb (Read_Library_Info_From_Full): Cleanup unused
	initial value.
2021-05-06 03:51:29 -04:00
Eric Botcazou
d07cc0d126 [Ada] Document a few more characteristics of floating-point support
gcc/ada/

	* doc/gnat_rm/implementation_defined_characteristics.rst (3.5.7):
	Mention the IEEE standard explicitly.  Use current format names.
	Document assumed rounding mode and new features of I/O support.
	* gnat_rm.texi: Regenerate.
2021-05-06 03:51:28 -04:00
Eric Botcazou
1bc178bb6c [Ada] Reset x87 FPU to 64-bit precision for floating-point I/O on Linux
gcc/ada/

	* init.c (__gnat_init_float): Use full version on Linux too.
2021-05-06 03:51:27 -04:00
Eric Botcazou
799dfd944a [Ada] Make new implementation of System.Fat_Gen.Valid more robust
gcc/ada/

	* libgnat/s-fatgen.adb (Valid): Do a bit comparison with 0.0
	when denormalized numbers are not supported.
2021-05-06 03:51:26 -04:00
Piotr Trojanek
af9833a10a [Ada] Fix restriction No_Enumeration_Maps on both Image attributes
gcc/ada/

	* sem_attr.adb (Check_Enum_Image): Reword comment; add
	Check_Enumeration_Maps parameter.  Now this routine combines
	both referencing enumeration literals and checking restriction
	No_Enumeration_Maps, if required.
	(Analyze_Attribute): Remove duplicated code and instead call
	Check_Enum_Image.
2021-05-06 03:51:25 -04:00
Piotr Trojanek
e45796fe05 [Ada] Remove redundant condition for Image attribute and Ada version
gcc/ada/

	* sem_attr.adb (Analyze_Image_Attribute): Remove redundant
	condition; add a missing header box.
2021-05-06 03:51:24 -04:00