aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/libgnat
AgeCommit message (Collapse)AuthorFilesLines
2020-10-18revamp ada.numerics.auxAlexandre Oliva14-464/+584
Instead of mapping elementary functions for all types to a single type, use the intrinsics available for the various base types. A new Ada.Numerics.Aux_Generic_Float is introduced to explicitly dispatch, based on the 'Digits attribute of the base type, to the various newly-added Aux_Short_Float, Aux_Float, Aux_Long_Float, or Aux_Long_Long_Float. The Aux_Short_Float unit is implemented in terms of the Aux_Float one, and the others rely on the elementary functions from the C Math library for float, double and long double types, respectively. An Aux_Linker_Options is added, and units that import intrinsics from libm/libc depend on it to provide the "-lm" linker option if needed. The option is provided by default, but there is an alternate version that doesn't, that is used for vxworks targets. The Aux variant that used to open-code Sin and Cos for the ancient ppc-darwin, because of insufficient precision in libc, is dropped, along with the alternate dummy body for Aux. Both are presumed no longer needed. The original Ada.Numerics.Aux is retained, for backward compatibility, as a wrapper for a newly-added Aux_Compat, that renames Aux_Long_Float, except on x86, in which an alternate version renames Aux_Long_Long_Float. Generic_Elementary_Functions and Generic_Complex_Types are adjusted to use Aux_Generic_Float, avoiding the type conversions and inefficiencies of computing results in higher precision than requested. Generic_Complex_Elementary_Functions is adjusted to enable an additional instance of the sincos optimization, even without -gnatn. for gcc/ada/ChangeLog * Makefile.rtl (GNATRTL_NONTASKING_OBJS): Compile Ada.Numerics child units Aux_Generic_Float, Aux_Long_Long_Float, Aux_Long_Float, Aux_Float, Aux_Short_Float, Aux_Compat, and Aux_Linker_Options. (X86_TARGET_PAIRS): Drop dummy body for Aux. Use x86 version of Aux_Compat. (X86_64_TARGET_PAIRS): Likewise. (LIBGNAT_TARGET_PAIRS): On VxWorks, select the nolibm variants. Drop the darwin version of Aux. Drop the redundant libc-x86 numaux variants on x86* kfreebsd variants. * libgnat/a-nagefl.ads: New Aux_Generic_Float. * libgnat/a-naliop.ads: New Aux_Linker_Options. * libgnat/a-naliop__nolibm.ads: New. * libgnat/a-nallfl.ads: New Aux_Long_Long_Float. * libgnat/a-nalofl.ads: New Aux_Long_Float. * libgnat/a-nuaufl.ads: New Aux_Float. * libgnat/a-nashfl.ads: New Aux_Short_Float. * libgnat/a-ngcefu.adb (Exp): Factor out the Im (X) passed to Sin and Cos in the Complex variant too. * libgnat/a-ngcoty.adb: Switch to Aux_Generic_Float. Drop redundant conversions. * libgnat/a-ngelfu.adb: Likewise. * libgnat/a-nuauco.ads: New Aux_Compat. * libgnat/a-nuauco__x86.ads: New. * libgnat/a-numaux.ads: Replace with Compat wrapper. * libgnat/a-numaux__darwin.adb: Remove. * libgnat/a-numaux__darwin.ads: Remove. * libgnat/a-numaux__dummy.adb: Remove. * libgnat/a-numaux__libc-x86.ads: Remove. * libgnat/a-numaux__vxworks.ads: Remove.
2020-10-16[Ada] Remove non-ASCII characterBob Duff1-1/+4
gcc/ada/ * libgnat/a-numeri.ads: Remove the greek letter.
2020-10-16[Ada] Clean up in system.ads dependencies during compiler buildArnaud Charlet1-184/+0
gcc/ada/ * gcc-interface/Make-lang.in: Update dependencies on system.ads, add gnatbind switch -t to avoid timestamp inconsistencies during build. * libgnat/system.ads: Move... * gcc-interface/system.ads: ... here.
2020-10-16[Ada] Convert from UTF_16 to UTF_8 fails for large valuesArnaud Charlet1-1/+1
gcc/ada/ PR ada/95953 * libgnat/a-suenco.adb (Convert): Fix handling of third UTF-8 byte.
2020-10-16[Ada] Use new Max_Integer_Size attribute in system.ads filesEric Botcazou63-195/+195
gcc/ada/ * libgnat/system-aix.ads: Likewise. * libgnat/system-darwin-arm.ads: Likewise. * libgnat/system-darwin-ppc.ads: Likewise. * libgnat/system-darwin-x86.ads: Likewise. * libgnat/system-djgpp.ads: Likewise. * libgnat/system-dragonfly-x86_64.ads: Likewise. * libgnat/system-freebsd.ads: Likewise. * libgnat/system-hpux-ia64.ads: Likewise. * libgnat/system-hpux.ads: Likewise. * libgnat/system-linux-alpha.ads: Likewise. * libgnat/system-linux-arm.ads: Likewise. * libgnat/system-linux-hppa.ads: Likewise. * libgnat/system-linux-ia64.ads: Likewise. * libgnat/system-linux-m68k.ads: Likewise. * libgnat/system-linux-mips.ads: Likewise. * libgnat/system-linux-ppc.ads: Likewise. * libgnat/system-linux-riscv.ads: Likewise. * libgnat/system-linux-s390.ads: Likewise. * libgnat/system-linux-sh4.ads: Likewise. * libgnat/system-linux-sparc.ads: Likewise. * libgnat/system-linux-x86.ads: Likewise. * libgnat/system-lynxos178-ppc.ads: Likewise. * libgnat/system-lynxos178-x86.ads: Likewise. * libgnat/system-mingw.ads: Likewise. * libgnat/system-qnx-aarch64.ads: Likewise. * libgnat/system-rtems.ads: Likewise. * libgnat/system-solaris-sparc.ads: Likewise. * libgnat/system-solaris-x86.ads: Likewise. * libgnat/system-vxworks-arm-rtp-smp.ads: Likewise. * libgnat/system-vxworks-arm-rtp.ads: Likewise. * libgnat/system-vxworks-arm.ads: Likewise. * libgnat/system-vxworks-e500-kernel.ads: Likewise. * libgnat/system-vxworks-e500-rtp-smp.ads: Likewise. * libgnat/system-vxworks-e500-rtp.ads: Likewise. * libgnat/system-vxworks-e500-vthread.ads: Likewise. * libgnat/system-vxworks-ppc-kernel.ads: Likewise. * libgnat/system-vxworks-ppc-ravenscar.ads: Likewise. * libgnat/system-vxworks-ppc-rtp-smp.ads: Likewise. * libgnat/system-vxworks-ppc-rtp.ads: Likewise. * libgnat/system-vxworks-ppc-vthread.ads: Likewise. * libgnat/system-vxworks-ppc.ads: Likewise. * libgnat/system-vxworks-x86-kernel.ads: Likewise. * libgnat/system-vxworks-x86-rtp-smp.ads: Likewise. * libgnat/system-vxworks-x86-rtp.ads: Likewise. * libgnat/system-vxworks-x86-vthread.ads: Likewise. * libgnat/system-vxworks-x86.ads: Likewise. * libgnat/system-vxworks7-aarch64-rtp-smp.ads: Likewise. * libgnat/system-vxworks7-aarch64.ads: Likewise. * libgnat/system-vxworks7-arm-rtp-smp.ads: Likewise. * libgnat/system-vxworks7-arm.ads: Likewise. * libgnat/system-vxworks7-e500-kernel.ads: Likewise. * libgnat/system-vxworks7-e500-rtp-smp.ads: Likewise. * libgnat/system-vxworks7-e500-rtp.ads: Likewise. * libgnat/system-vxworks7-ppc-kernel.ads: Likewise. * libgnat/system-vxworks7-ppc-rtp-smp.ads: Likewise. * libgnat/system-vxworks7-ppc-rtp.ads: Likewise. * libgnat/system-vxworks7-ppc64-kernel.ads: Likewise. * libgnat/system-vxworks7-ppc64-rtp-smp.ads: Likewise. * libgnat/system-vxworks7-x86-kernel.ads: Likewise. * libgnat/system-vxworks7-x86-rtp-smp.ads: Likewise. * libgnat/system-vxworks7-x86-rtp.ads: Likewise. * libgnat/system-vxworks7-x86_64-kernel.ads: Likewise. * libgnat/system-vxworks7-x86_64-rtp-smp.ads: Likewise.
2020-10-16[Ada] Remove support for -gnatP and pragma PollingArnaud Charlet19-210/+0
gcc/ada/ * Makefile.rtl, gnat1drv.adb, expander.adb doc/gnat_rm/implementation_defined_pragmas.rst, doc/gnat_ugn/building_executable_programs_with_gnat.rst, doc/gnat_ugn/the_gnat_compilation_model.rst, exp_ch5.ads, exp_ch5.adb, exp_ch6.adb, exp_ch7.adb, exp_util.adb, exp_util.ads, libgnarl/s-osinte__aix.adb, libgnarl/s-osinte__android.adb, libgnarl/s-osinte__darwin.adb, libgnarl/s-osinte__gnu.adb, libgnarl/s-osinte__hpux-dce.adb, libgnarl/s-osinte__lynxos178.adb, libgnarl/s-osinte__posix.adb, libgnarl/s-osinte__qnx.adb, libgnarl/s-osinte__rtems.adb, libgnarl/s-osinte__solaris.adb, libgnarl/s-osinte__vxworks.adb, libgnarl/s-osinte__x32.adb, libgnarl/s-solita.adb, libgnarl/s-taasde.adb, libgnarl/s-taprob.adb, libgnarl/s-taprop__dummy.adb, libgnarl/s-taprop__hpux-dce.adb, libgnarl/s-taprop__linux.adb, libgnarl/s-taprop__mingw.adb, libgnarl/s-taprop__posix.adb, libgnarl/s-taprop__qnx.adb, libgnarl/s-taprop__solaris.adb, libgnarl/s-taprop__vxworks.adb, libgnarl/s-tarest.adb, libgnarl/s-tasini.adb, libgnarl/s-taskin.adb, libgnarl/s-taspri__dummy.ads, libgnarl/s-taspri__hpux-dce.ads, libgnarl/s-taspri__lynxos.ads, libgnarl/s-taspri__mingw.ads, libgnarl/s-taspri__posix-noaltstack.ads, libgnarl/s-taspri__posix.ads, libgnarl/s-taspri__solaris.ads, libgnarl/s-taspri__vxworks.ads, libgnarl/s-tassta.adb, libgnarl/s-tasuti.adb, libgnarl/s-tposen.adb, libgnat/a-except.adb, libgnat/a-except.ads, libgnat/s-dwalin.adb, libgnat/s-dwalin.ads, libgnat/s-mastop.ads, libgnat/s-soflin.adb, libgnat/s-stalib.adb, libgnat/s-stalib.ads, libgnat/s-stchop.adb, libgnat/s-stchop.ads, libgnat/s-stchop__limit.ads, libgnat/s-traceb.ads, libgnat/s-traent.adb, libgnat/s-traent.ads, libgnat/s-trasym.adb, libgnat/s-trasym.ads, libgnat/s-trasym__dwarf.adb, opt.adb, opt.ads, par-prag.adb, sem_prag.adb, snames.ads-tmpl, switch-c.adb, targparm.adb, targparm.ads, usage.adb: Remove support for -gnatP and pragma Polling. * gnat_ugn.texi: Regenerate. * libgnat/a-excpol.adb, libgnat/a-excpol__abort.adb: Removed.
2020-10-15[Ada] Spurious visibility on private with packageArnaud Charlet2-2/+3
gcc/ada/ * sem_ch10.adb (Install_With_Clause): Fix implementation of Ada 2005 AI-262 by taking into account generic packages. Minor reformatting. * libgnat/a-cbhase.ads, libgnat/a-cbhase.adb: Remove use clause on runtime unit spec.
2020-10-15[Ada] Do not use maximal values from System in runtime unitsEric Botcazou5-9/+5
gcc/ada/ * libgnat/a-cfinve.adb (Int): Use subtype of Long_Long_Integer. * libgnat/a-cofove.adb (Int): Likewise. * libgnat/a-cgcaso.adb (T): Likewise. * libgnat/a-cogeso.adb (T): Likewise. * libgnat/g-debpoo.ads (Byte_Count): Use Long_Long_Integer'Size.
2020-10-15[Ada] Ada_2020: Add aspect Aggregate to standard container unitsEd Schonberg22-17/+174
gcc/ada/ * exp_aggr.adb (Expand_N_Aggregate): A record aggregate requires a non-private type. * sem_ch13.adb (Valid_Assign_Indexed): New subprogram local to Resolve_Aspect_Aggregate, to handle the case when the corresponding name appearing in the aspect specification for an indexed aggregate is an overloaded operation. * libgnat/a-convec.ads, libgnat/a-convec.adb, libgnat/a-coinve.ads, libgnat/a-coinve.adb, libgnat/a-cobove.ads, libgnat/a-cobove.adb, libgnat/a-cdlili.ads, libgnat/a-cdlili.adb, libgnat/a-cbdlli.ads, libgnat/a-cbdlli.adb, libgnat/a-cohama.ads, libgnat/a-cihama.ads, libgnat/a-cbhama.ads, libgnat/a-cborma.ads, libgnat/a-ciorma.ads, libgnat/a-coorma.ads, libgnat/a-cihase.ads, libgnat/a-cohase.ads, libgnat/a-cbhase.ads, libgnat/a-cborse.ads, libgnat/a-ciorse.ads, libgnat/a-coorse.ads: Add Ada_2020 aspect Aggregate to types declared in standard containers, as well as new subprograms where required.
2020-10-15[Ada] Add iterators over GNAT.Array_Split.Slice_SetArnaud Charlet2-11/+51
gcc/ada/ * libgnat/g-arrspl.ads, libgnat/g-arrspl.adb (Create, First_Cursor, Advance, Has_Element): New.
2020-10-15[Ada] AI12-0385 Predefined shifts and rotates should be staticArnaud Charlet2-0/+200
gcc/ada/ * Makefile.rtl: Add target pair for interfac.ads. * libgnat/interfac.ads: Add a comment. * libgnat/interfac__2020.ads: New, used for bootstrap purposes. * sem_util.adb (Is_Static_Function): Always return False for pre Ada 2020 to e.g. ignore the Static aspect in Interfaces for Ada < 2020.
2020-10-12make sin and cos generics inlineableAlexandre Oliva1-0/+2
Enable the sincos optimization within callers of these (single-argument) elementary functions. for gcc/ada/ChangeLog * libgnat/a-ngelfu.ads (Sin, Cos): Make the single-argument functions inline.
2020-10-11import elementary functions as intrinsicsAlexandre Oliva4-50/+50
Importing them as intrinsics enables GCC to treat them as builtins whose behavior is known by GCC. Specifically, if they aren't intrinsics, calls to Sin and Cos won't be combined into sincos. We still need to make Sin and Cos wrappers inline in user-exposed interfaces to get users the benefit of this transformation. That is forthcoming in a separate patch. for gcc/ada/ChangeLog * libgnat/a-numaux.ads: Make all imports Intrinsic. * libgnat/a-numaux__darwin.ads: Likewise. * libgnat/a-numaux__libc-x86.ads: Likewise. * libgnat/a-numaux__vxworks.ads: Likewise.
2020-07-27[Ada] Switch Ada_Version_Runtime to Ada 2020Arnaud Charlet30-52/+6
gcc/ada/ * opt.ads (Ada_Version_Runtime): Set to Ada_2020. * sem_ch3.adb (Analyze_Subtype_Declaration): Propagate Is_Independent flag to subtypes. * libgnarl/s-taprop__linux.adb: Adapt to Ada 2020 warning. * libgnat/a-nbnbin.adb, libgnat/a-nbnbin.ads, libgnat/a-nbnbin__gmp.adb, libgnat/a-nbnbre.adb, libgnat/a-nbnbre.ads, libgnat/a-stobbu.adb, libgnat/a-stobbu.ads, libgnat/a-stobfi.adb, libgnat/a-stobfi.ads, libgnat/a-stoubu.adb, libgnat/a-stoubu.ads, libgnat/a-stoufi.adb, libgnat/a-stoufi.ads, libgnat/a-stoufo.adb, libgnat/a-stoufo.ads, libgnat/a-stouut.adb, libgnat/a-stouut.ads, libgnat/a-strsto.ads, libgnat/a-ststbo.adb, libgnat/a-ststbo.ads, libgnat/a-ststun.adb, libgnat/a-ststun.ads, libgnat/a-stteou.ads, libgnat/s-aoinar.ads, libgnat/s-aomoar.ads, libgnat/s-atopex.ads, libgnat/s-putaim.adb, libgnat/s-putaim.ads, libgnat/s-putima.adb, libgnat/s-putima.ads: Remove pragma Ada_2020, now redundant.
2020-07-27[Ada] Unbounded string overriding controlDmitriy Anisimkov2-38/+150
gcc/ada/ * libgnat/a-strunb.adb (Sum, Mul, Saturated_Sum, Saturated_Mul): New routines. Use them when resulting string size more that length of the strings in parameters. (Unbounded_Slice): Use "- 1" instead of "+ 1" in opposite side of condition to avoid overflow. * libgnat/a-strunb__shared.adb (Sum, Mul): New routines. (Allocate): New routine with 2 parameters. Use routine above when resulting string size more that length of the strings in parameters. (Aligned_Max_Length): Do not try to align to more than Natural'Last. (Unbounded_Slice): Use "- 1" instead of "+ 1" in opposite side of condition to avoid overflow.
2020-07-27[Ada] Ada2020: AI12-0304 Put_Image attrs of lang-def typesBob Duff6-3/+52
gcc/ada/ * libgnat/s-rannum.ads, libgnat/s-rannum.adb: Add Put_Image. This will be inherited by the language-defined packages Ada.Numerics.Discrete_Random and Ada.Numerics.Float_Random. * libgnat/a-convec.ads, libgnat/a-convec.adb: Add Put_Image. * libgnat/s-putima.ads: Add pragma Preelaborate, so this can be imported into containers packages. * libgnat/s-putima.adb: Move Digit to private part; otherwise reference to Base is illegal in Preelaborate generic. * exp_put_image.adb (Build_Record_Put_Image_Procedure): Use the base type.
2020-07-16[Ada] Wrong execution of Tan on large argumentArnaud Charlet2-623/+2
gcc/ada/ * Makefile.rtl: replace a-numaux__x86.ads by a-numaux__libc-x86.ads and a-numaux__x86.adb by a-numaux__dummy.adb. * libgnat/a-numaux__x86.ads, libgnat/a-numaux__x86.adb: Removed. * libgnat/a-numaux__dummy.adb: New.
2020-07-16[Ada] v7r2cert: minor refactoringDoug Rupp1-35/+20
gcc/ada/ * libgnat/s-thread__ae653.adb (taskVarAdd): Defunct, so remove. (Current_ATSD): Make it a TLS variable. (OK): Move to package scope. (System.Storage_Elements): Import and Use.
2020-07-16[Ada] AI12-0004 Normalization and allowed charactersArnaud Charlet12-5/+482
gcc/ada/ * scng.adb (Scan): Detect wide characters not in NFKC. * libgnat/a-chahan.adb, libgnat/a-chahan.ads, libgnat/a-wichha.adb, libgnat/a-wichha.ads, libgnat/a-wichun.adb, libgnat/a-wichun.ads, libgnat/a-zchhan.adb, libgnat/a-zchhan.ads, libgnat/a-zchuni.adb, libgnat/a-zchuni.ads (Is_NFKC): New. * libgnat/s-utf_32.ads, libgnat/s-utf_32.adb (Is_UTF_32_NFKC): New.
2020-07-16[Ada] Ada2020: AI12-0117 Restriction No_Tasks_Unassigned_To_CPUBob Duff1-0/+1
gcc/ada/ * libgnat/s-rident.ads (Restriction_Id): Add No_Tasks_Unassigned_To_CPU.
2020-07-16[Ada] Ada2020: AI12-0055 No_Dynamic_CPU_Assignment restrictionBob Duff1-4/+11
gcc/ada/ * libgnat/s-rident.ads (No_Dynamic_CPU_Assignment): New restriction. Add it to all relevant profiles. * sem_ch13.adb (Attribute_CPU): Check No_Dynamic_CPU_Assignment restriction. (Attribute_CPU, Attribute_Dispatching_Domain, Attribute_Interrupt_Priority): Remove error checks -- these are checked in the parser. * sem_prag.adb (Pragma_CPU): Check No_Dynamic_CPU_Assignment restriction. We've got a little violation of DRY here. * sem.ads, sem_ch3.ads: Minor comment fix.
2020-07-16[Ada] Overflow in string streamingArnaud Charlet2-10/+19
gcc/ada/ * libgnat/s-ststop.ads: Fix typo. * libgnat/s-ststop.adb (Read, Write): Fix block number computation to avoid overflows in case of large strings.
2020-07-16[Ada] Add centralized capacity check in Generic_BignumsArnaud Charlet1-19/+12
gcc/ada/ * libgnat/s-genbig.adb ("**"): Remove capacity limit check. Improve code by using an extended return. (Normalize): Perform capacity limit check here instead which is the centralized place where (potentially large) big integers are allocated.
2020-07-15[Ada] Fix logic in Allocate_Any_ControlledArnaud Charlet1-6/+9
gcc/ada/ * libgnat/s-stposu.adb (Allocate_Any_Controlled): Fix logic in lock/unlock.
2020-07-15[Ada] Mark standard containers as not in SPARKYannick Moy48-48/+144
gcc/ada/ * libgnat/a-cbdlli.adb, libgnat/a-cbdlli.ads, libgnat/a-cbhama.adb, libgnat/a-cbhama.ads, libgnat/a-cbhase.adb, libgnat/a-cbhase.ads, libgnat/a-cbmutr.adb, libgnat/a-cbmutr.ads, libgnat/a-cborma.adb, libgnat/a-cborma.ads, libgnat/a-cborse.adb, libgnat/a-cborse.ads, libgnat/a-cbprqu.adb, libgnat/a-cbprqu.ads, libgnat/a-cbsyqu.adb, libgnat/a-cbsyqu.ads, libgnat/a-cdlili.adb, libgnat/a-cdlili.ads, libgnat/a-cidlli.adb, libgnat/a-cidlli.ads, libgnat/a-cihama.adb, libgnat/a-cihama.ads, libgnat/a-cihase.adb, libgnat/a-cihase.ads, libgnat/a-cimutr.adb, libgnat/a-cimutr.ads, libgnat/a-ciorma.adb, libgnat/a-ciorma.ads, libgnat/a-ciormu.adb, libgnat/a-ciormu.ads, libgnat/a-ciorse.adb, libgnat/a-ciorse.ads, libgnat/a-cohama.adb, libgnat/a-cohama.ads, libgnat/a-cohase.adb, libgnat/a-cohase.ads, libgnat/a-coinve.adb, libgnat/a-coinve.ads, libgnat/a-comutr.adb, libgnat/a-comutr.ads, libgnat/a-convec.adb, libgnat/a-convec.ads, libgnat/a-coorma.adb, libgnat/a-coorma.ads, libgnat/a-coormu.adb, libgnat/a-coormu.ads, libgnat/a-coorse.adb, libgnat/a-coorse.ads: Add SPARK_Mode => Off.
2020-07-15[Ada] Fix typo in "accommodate" in docs and commentsPiotr Trojanek1-1/+1
gcc/ada/ * doc/gnat_rm/representation_clauses_and_pragmas.rst: Fix typo. * gnat_rm.texi: Regenerate. * libgnat/s-secsta.ads (Memory_Alignment): Likewise.
2020-07-15[Ada] Fix potentially uninitialized variable flagged by CodePeerArnaud Charlet1-0/+3
gcc/ada/ * libgnat/g-socket.adb (Wait_On_Socket): Fix potentially uninitialized variable.
2020-07-10[Ada] Ada2020: AI12-0368 Declare expressions can be staticBob Duff2-12/+30
gcc/ada/ * sem_res.adb (Resolve_Expression_With_Actions): Check the rules of AI12-0368, and mark the declare expression as static or known at compile time as appropriate. * sem_ch4.adb: Minor reformatting. * libgnat/a-stoufo.ads, libgnat/a-stoufo.adb: Allow up to 9 replacement parameters. I'm planning to use this in the test case for this ticket.
2020-07-10[Ada] Fix memory leak in routine Wait_On_SocketPascal Obry1-7/+15
gcc/ada/ * libgnat/g-socket.adb (Wait_On_Socket): Fix memory leaks and file descriptor leaks. A memory leak was created each time the routine was called without a selector (Selector = Null). Also, in case of exception in the routine a memory leak and descriptor leak was created as the created file selector was not closed.
2020-07-10[Ada] Minor style fixesPascal Obry1-8/+10
gcc/ada/ * libgnat/g-socket.adb: Minor style fixes.
2020-07-10[Ada] Add global contracts to Ada.Numerics.Big_Numbers librariesJoffrey Huguet2-76/+135
gcc/ada/ * libgnat/a-nbnbin.ads, libgnat/a-nbnbre.ads: Add global contract (Global => null) to all functions.
2020-07-10[Ada] Make System.Generic_Bignums more flexibleArnaud Charlet7-394/+624
gcc/ada/ * Makefile.rtl (GNATRTL_NONTASKING_OBJS): Add s-shabig.o. * libgnat/s-shabig.ads: New file to share definitions. * libgnat/s-genbig.ads, libgnat/s-genbig.adb: Reorganized to make it more generic and flexible in terms of memory allocation and data structure returned. (To_String): Moved to System.Generic_Bignums to allow sharing this code. (Big_And, Big_Or, Big_Shift_Left, Big_Shift_Right): New. * libgnat/s-bignum.adb, libgnat/s-bignum.ads: Adapt to new System.Generic_Bignums spec. * libgnat/a-nbnbin.adb: Likewise. (To_String): Moved to System.Generic_Bignums to allow sharing this code. * libgnat/a-nbnbre.adb (Normalize): Fix handling of Num = 0 leading to an exception.
2020-07-08[Ada] Clean up in Interfaces.C.ExtensionsArnaud Charlet3-5/+3
gcc/ada/ * libgnat/i-cexten.ads (long_long, unsigned_long_long): Now subtypes of Interfaces.C types. * libgnat/a-calcon.ads, libgnat/a-calcon.adb (To_Unix_Nano_Time): Use Interfaces.C.long_long instead of Interfaces.C.Extensions.long_long.
2020-07-08[Ada] ACATS 4.1R - BD10001 - Error missedArnaud Charlet1-2/+0
gcc/ada/ * sem_prag.adb (Process_Inline): Check for duplicate pragma+aspect Inline. Minor code cleanup. (Check_Duplicate_Pragma): Add warning for duplicate pragma [No_]Inline under -gnatwr. * sinfo.ads, sinfo.adb (Next_Rep_Item): Allow N_Null_Statement which can appear when a pragma is rewritten. * sem_util.ads, sem_util.adb, bindo-writers.adb: Fix bad copy/paste now flagged. * libgnat/s-mmap.ads: Remove redundant pragma Inline.
2020-07-07[Ada] ACATS 4.1K - C452003Arnaud Charlet2-5/+4
gcc/ada/ * exp_ch4.adb (Tagged_Membership): Generate a call to CW_Membership instead of using Build_CW_Membership. (Expand_N_In): Remove wrong handling of null access types and corresponding comment. * exp_intr.adb (Expand_Dispatching_Constructor_Call): Generate a call to CW_Membership instead of using Build_CW_Membership. * rtsfind.ads: Add CW_Membership. * exp_atag.ads, exp_atag.adb (Build_CW_Membership): Removed. * einfo.ads: Fix typo. * libgnat/a-tags.ads, libgnat/a-tags.adb (CW_Membership): Moved back to spec.
2020-07-07[Ada] Use pragma Unsuppress in Time_IOBob Duff1-13/+12
gcc/ada/ * libgnat/g-catiio.adb (Value, Parse_ISO_8601): Unsuppress checks, and don't rely on 'Valid.
2020-07-06[Ada] Time_IO.Image: Allow printing the time zoneBob Duff2-6/+77
gcc/ada/ * libgnat/g-catiio.ads: Document newly supported format. Add ISO_Time constant, for convenience. * libgnat/g-catiio.adb (Image_Helper): New helper function to do all the formatting work, called by the two exported Image functions. Add support for "%:::z" here. Add a Time_Zone parameter used by the "%:::z" processing. This parameter is not used for the actual time zone computations; local time is always used for that, for ease of implementation reasons. It would make sense to use Append throughout this function, but that's a cleanup for another day. (Image): Modify these to pass the local time zone, or the specified time zone, as appropriate.
2020-07-06[Ada] Time_IO.Value: Allow subseconds and time zones togetherBob Duff2-25/+25
gcc/ada/ * libgnat/g-catiio.ads: Change the regular expression that documents the allowed format to match what ISO-8601 allows. * libgnat/g-catiio.adb (Scan_Subsecond): Rewrite so it doesn't assume the subsecond comes last. (Parse_ISO_8601): Parse an optional subsecond, followed by an optional time zone, rather than making these alternatives to each other.
2020-07-06[Ada] Clean up GNAT.Calendar.Time_IO.ValueBob Duff1-62/+55
gcc/ada/ * libgnat/g-catiio.adb (Parse_ISO_8601): Minor cleanups: Give some objects clearer names. Make some objects more local to where they are used. Remove some validity checks that can't fail, because some of the variables tested have been moved so they're not visible here. Anyway, Wrong_Syntax is about errors in the input, not data validity. Use Time_Zone_Seen instead of Local_Sign = ' ' to determine that a time zone indication was seen. We don't need to distinguish two different kinds of syntax error (End_Of_Source_Reached and Wrong_Syntax), so use Wrong_Syntax always. Remove comment, "Certain scanning scenarios may handle this exception on their own."; there are no such scenarios.
2020-07-06[Ada] Implement Time_IO.Image with Time_ZoneBob Duff2-2/+30
gcc/ada/ * libgnat/g-catiio.ads, libgnat/g-catiio.adb (Image): New function. It might seem like the local-time Image should be implemented in terms of the Time_Zone Image, but that would be far harder to implement, so we do it the other way around.
2020-07-06[Ada] Use Stream_Element_Arrays internally for secure hash computationsThomas Quinot3-75/+84
gcc/ada/ * libgnat/g-sechas.ads, libgnat/g-sechas.adb: Refactor to use Stream_Element_Array as the internal buffer type. * libgnat/g-shshco.adb: Adjust to use Stream_Element_Offset instead of Integer as the index in the internal state buffer.
2020-07-06[Ada] Correct time zone in GNAT.Calendar.Time_IO.ValueBob Duff6-64/+62
gcc/ada/ * libgnat/g-catiio.adb (Parse_ISO_8601): New name for Parse_ISO_8861_UTC. 8601 is the correct ISO standard number. Also, "UTC" was confusing. All Time values are represented in UTC, but the ISO 8601 date strings include a time zone. If a time zone was specified, call Ada.Calendar.Formatting.Time_Of instead of GNAT.Calendar.Time_Of, because the latter adjusts to the current time zone, whereas we want to use (just) the time zone specified in the ISO string. This allows us to pass Time_Zone instead to Time_Of, instead of adjusting by Local_Disp by hand. If no time zone was specified, call GNAT.Calendar.Time_Of as before. Use expanded names to clarify which Time_Of is being called. Remove redundant comment, and move nonredundant part of the commment to the spec. (Value): Minor: use "not in" instead of "or else". * libgnat/g-catiio.ads: Comment moved here. Correct the ISO standard number. * libgnat/g-calend.adb: Add ??? comments. * libgnat/a-calend.ads, libgnat/a-calend.adb: Update obsolete comments regarding the representation of type Time. Move the information about the epoch (year 2150) to the spec, and avoid uttering "2150" more than once. * libgnat/a-catizo.ads (Time_Offset): Add comment.
2020-07-06[Ada] AI12-0366 Changes to Big_Integer and Big_RealArnaud Charlet3-10/+11
gcc/ada/ * libgnat/a-nbnbin.ads, libgnat/a-nbnbin.adb, libgnat/a-nbnbin__gmp.adb: Use more Valid_Big_Integer.
2020-06-19[Ada] AI12-0293-1 Remove pragma AssertBob Duff1-9/+12
2020-06-19 Bob Duff <duff@adacore.com> gcc/ada/ * libgnat/a-ststbo.adb (Write): Replace pragma Assert with "if ... raise Constraint_Error".
2020-06-19[Ada] AI12-0366 Changes to Big_Integer and Big_RealArnaud Charlet5-167/+154
2020-06-19 Arnaud Charlet <charlet@adacore.com> gcc/ada/ * libgnat/a-nbnbin.adb, libgnat/a-nbnbin.ads, libgnat/a-nbnbin__gmp.adb, libgnat/a-nbnbre.adb, libgnat/a-nbnbre.ads: Update spec according to AI12-0366.
2020-06-18[Ada] Fix small inefficiency in previous change to expanderEric Botcazou1-66/+24
2020-06-18 Eric Botcazou <ebotcazou@adacore.com> gcc/ada/ * exp_ch4.adb (Get_Size_For_Range): Only make sure to return a size lower than that of the original type if possible. * libgnat/s-rannum.adb (Random_Discrete): Back out optimization added for 32-bit types.
2020-06-18[Ada] Add support for XDR streaming in the default runtimeArnaud Charlet5-97/+380
2020-06-18 Arnaud Charlet <charlet@adacore.com> gcc/ada/ * Makefile.rtl: Add s-statxd.o. * bindgen.adb (Gen_Adainit): Add support for XDR_Stream. * bindusg.adb (Display): Add mention of -xdr. * gnatbind.adb: Process -xdr switch. * init.c (__gl_xdr_stream): New. * opt.ads (XDR_Stream): New. * libgnat/s-stratt__xdr.adb: Rename to... * libgnat/s-statxd.adb: this and adjust. * libgnat/s-statxd.ads: New. * libgnat/s-stratt.ads, libgnat/s-stratt.adb: Choose between default and XDR implementation at runtime. * libgnat/s-ststop.ads: Update comments. * doc/gnat_rm/implementation_advice.rst: Update doc on XDR streaming. * gnat_rm.texi: Regenerate.
2020-06-18[Ada] Profile mismatch between C and Ada functionsArnaud Charlet9-51/+51
2020-06-18 Arnaud Charlet <charlet@adacore.com> gcc/ada/ * libgnarl/s-osinte__linux.ads, libgnat/g-io.adb, libgnat/g-socket.adb, libgnat/g-socthi.adb, libgnat/g-socthi.ads, libgnat/g-socthi__vxworks.adb, libgnat/g-socthi__vxworks.ads, libgnat/g-sothco.ads, libgnat/s-io.adb, libgnat/a-except.adb: Fix function profile mismatch with imported C functions.
2020-06-18[Ada] AI12-0293-1 Implement storage streamsBob Duff5-0/+476
2020-06-18 Bob Duff <duff@adacore.com> gcc/ada/ * libgnat/a-strsto.ads, libgnat/a-ststbo.adb, libgnat/a-ststbo.ads, libgnat/a-ststun.adb, libgnat/a-ststun.ads: New files, containing packages Ada.Streams.Storage, Ada.Streams.Storage.Bounded, and Ada.Streams.Storage.Unbounded. * impunit.adb, Makefile.rtl: Add new file names.
2020-06-17[Ada] Ada2020: AI12-0110 Tampering checks are performed firstBob Duff26-335/+313
2020-06-17 Bob Duff <duff@adacore.com> gcc/ada/ * libgnat/a-cbdlli.adb, libgnat/a-cbhama.adb, libgnat/a-cbhase.adb, libgnat/a-cbmutr.adb, libgnat/a-cborma.adb, libgnat/a-cborse.adb, libgnat/a-cdlili.adb, libgnat/a-chtgbk.adb, libgnat/a-chtgke.adb, libgnat/a-cidlli.adb, libgnat/a-cihama.adb, libgnat/a-cihase.adb, libgnat/a-cimutr.adb, libgnat/a-ciorma.adb, libgnat/a-ciorse.adb, libgnat/a-cobove.adb, libgnat/a-cohama.adb, libgnat/a-cohase.adb, libgnat/a-coinve.adb, libgnat/a-comutr.adb, libgnat/a-convec.adb, libgnat/a-coorma.adb, libgnat/a-coorse.adb, libgnat/a-crbtgk.adb, libgnat/a-crbtgo.adb, libgnat/a-rbtgso.adb: Move tampering checks earlier.