Re: [Ada] Set Always_Compatible_Rep to False everywhere

2016-10-20 Thread Eric Botcazou
> Agreed, let's do that for starters.

And a small follow-up fix for a blunder.


2016-10-20  Nicolas Roche  

* gcc-interface/Makefile (x86-64/Linux): Restore missing pairs.
(x86/Darwin): Likewise.

-- 
Eric BotcazouIndex: gcc-interface/Makefile.in
===
--- gcc-interface/Makefile.in	(revision 324803)
+++ gcc-interface/Makefile.in	(revision 324804)
@@ -2449,6 +2449,9 @@ ifeq ($(strip $(filter-out darwin%,$(tar
 
 ifeq ($(strip $(MULTISUBDIR)),/x86_64)
   SO_OPTS += -m64
+  LIBGNAT_TARGET_PAIRS += $(X86_64_TARGET_PAIRS)
+else
+  LIBGNAT_TARGET_PAIRS += $(X86_TARGET_PAIRS)
 endif
 
 EXTRA_GNATRTL_NONTASKING_OBJS=g-sse.o g-ssvety.o
@@ -2465,6 +2468,9 @@ ifeq ($(strip $(filter-out darwin%,$(tar
 
 ifeq ($(strip $(MULTISUBDIR)),/i386)
   SO_OPTS += -m32
+  LIBGNAT_TARGET_PAIRS += $(X86_TARGET_PAIRS)
+else
+  LIBGNAT_TARGET_PAIRS += $(X86_64_TARGET_PAIRS)
 endif
 
 EXTRA_GNATRTL_NONTASKING_OBJS=g-sse.o g-ssvety.o


Re: [Ada] Set Always_Compatible_Rep to False everywhere

2016-10-19 Thread Eric Botcazou
> Agreed, let's do that for starters.

And a small follow-up change.


2016-10-19  Eric Botcazou  

* system-linux-armel.ads: Rename into...
* system-linux-arm.ads: ...this
* gcc-interface/Makefile.in (ARM/Android): Adjust to above renaming.
(ARM/Linux): Likewise.
(Aarch64/Linux): Likewise.

-- 
Eric BotcazouIndex: gcc-interface/Makefile.in
===
--- gcc-interface/Makefile.in	(revision 241326)
+++ gcc-interface/Makefile.in	(working copy)
@@ -1222,7 +1222,7 @@ ifeq ($(strip $(filter-out arm% linux-an
   s-tpopsp.adbhttp://www.gnu.org/licenses/>.  --
---  --
--- GNAT was originally developed  by the GNAT team at  New York University. --
--- Extensive contributions were provided by Ada Core Technologies Inc.  --
---  --
---
-
-package System is
-   pragma Pure;
-   --  Note that we take advantage of the implementation permission to make
-   --  this unit Pure instead of Preelaborable; see RM 13.7.1(15). In Ada
-   --  2005, this is Pure in any case (AI-362).
-
-   pragma No_Elaboration_Code_All;
-   --  Allow the use of that restriction in units that WITH this unit
-
-   type Name is (SYSTEM_NAME_GNAT);
-   System_Name : constant Name := SYSTEM_NAME_GNAT;
-
-   --  System-Dependent Named Numbers
-
-   Min_Int   : constant := Long_Long_Integer'First;
-   Max_Int   : constant := Long_Long_Integer'Last;
-
-   Max_Binary_Modulus: constant := 2 ** Long_Long_Integer'Size;
-   Max_Nonbinary_Modulus : constant := 2 ** Integer'Size - 1;
-
-   Max_Base_Digits   : constant := Long_Long_Float'Digits;
-   Max_Digits: constant := Long_Long_Float'Digits;
-
-   Max_Mantissa  : constant := 63;
-   Fine_Delta: constant := 2.0 ** (-Max_Mantissa);
-
-   Tick  : constant := 0.000_001;
-
-   --  Storage-related Declarations
-
-   type Address is private;
-   pragma Preelaborable_Initialization (Address);
-   Null_Address : constant Address;
-
-   Storage_Unit : constant := 8;
-   Word_Size: constant := Standard'Word_Size;
-   Memory_Size  : constant := 2 ** Word_Size;
-
-   --  Address comparison
-
-   function "<"  (Left, Right : Address) return Boolean;
-   function "<=" (Left, Right : Address) return Boolean;
-   function ">"  (Left, Right : Address) return Boolean;
-   function ">=" (Left, Right : Address) return Boolean;
-   function "="  (Left, Right : Address) return Boolean;
-
-   pragma Import (Intrinsic, "<");
-   pragma Import (Intrinsic, "<=");
-   pragma Import (Intrinsic, ">");
-   pragma Import (Intrinsic, ">=");
-   pragma Import (Intrinsic, "=");
-
-   --  Other System-Dependent Declarations
-
-   type Bit_Order is (High_Order_First, Low_Order_First);
-   Default_Bit_Order : constant Bit_Order := Low_Order_First;
-   pragma Warnings (Off, Default_Bit_Order); -- kill constant condition warning
-
-   --  Priority-related Declarations (RM D.1)
-
-   --  0 .. 98 corresponds to the system priority range 1 .. 99.
-   --
-   --  If the scheduling policy is SCHED_FIFO or SCHED_RR the runtime makes use
-   --  of the entire range provided by the system.
-   --
-   --  If the scheduling policy is SCHED_OTHER the only valid system priority
-   --  is 1 and other values are simply ignored.
-
-   Max_Priority   : constant Positive := 97;
-   Max_Interrupt_Priority : constant Positive := 98;
-
-   subtype Any_Priority   is Integer  range  0 .. 98;
-   subtype Priority   is Any_Priority range  0 .. 97;
-   subtype Interrupt_Priority is Any_Priority range 98 .. 98;
-
-   Default_Priority : constant Priority := 48;
-
-private
-
-   type Address is mod Memory_Size;
-   Null_Address : constant Address := 0;
-
-   --
-   -- System Implementation Parameters --
-   --
-
-   --  These parameters provide information about the target that is used
-   --  by the compiler. They are in the private part of System, where they
-   --  can be accessed using the special circuitry in the Targparm unit
-   --  whose source should be consulted for more detailed descriptions
-   --  of the individual switch values.
-
-   Backend_Divide_Checks : constant Boolean := False;
-   Backend_Overflow_Checks   : constant Boolean := True;
-   Command_Line_Args : constant Boolean := True;
-   Configurable_Run_Time : constant Boolean := False;
-   Denorm: constant Boolean := True;
-   Duration_32_Bits  : constant Boolean := False;
-   Exit_Status_Supported : constant Boolean := True;
-   Fractional_Fixed_Ops  : constant Boolean := False;
-   Frontend_Layout   : constan

Re: [Ada] Set Always_Compatible_Rep to False everywhere

2016-10-18 Thread Eric Botcazou
> Agreed, let's do that for starters.

Here it is, applied on the mainline.


2016-10-18  Eric Botcazou  

* gcc-interface/Makefile.in (EXTRA_GNATRTL_NONTASKING_OBJS): Define.
(EXTRA_GNATRTL_TASKING_OBJS): Likewise.
(ARM/Android): Add atomic support.
(SPARC/Solaris): Simplify.
(x86/Solaris): Likewise.
(x86/Linux): Likewise.
(x86-64/kFreeBDS): Adjust and use system-freebsd-x86.ads
(x86/FreeBSD): Add s-mudido-affinity.adb.
(x86-64/FreeBSD): Likewise and use system-freebsd-x86.ads.
(s390/Linux): Simplify.
(PowerPC/AIX): Likewise.
(Cygwin/Mingw): Likewise.
(MIPSel/Linux): Likewise.
(ARM/Linux): Add atomic support.
(Aarch64/Linux): Use system-linux-armel.ads.
(SPARC/Linux): Simplify.
(IA-64/Linux): Minor tweak.
(IA-64/HP-UX): Likewise.
(Alpha/Linux): Likewise.
(x86-64/Linux): Use system-linux-x86.ads.
(x86/Darwin): Simplify.
(PowerPC/Darwin): Likewise.
(ARM/Darwin): Use system-darwin-arm.ads.
(ADA_EXCLUDE_SRCS): Minor reformatting.
* system-aix.ads (Word_Size): Change to Standard'Word_Size.
(Memory_Size): Change to 2 ** Word_Size.
(Support_Atomic_Primitives): Set to True.
* system-aix64.ads: Delete.
* system-darwin-arm.ads: New.
* system-darwin-ppc.ads (Word_Size): Change to Standard'Word_Size.
(Memory_Size): Change to 2 ** Word_Size.
(Support_Atomic_Primitives): Set to True.
* system-darwin-ppc64.ads: New.
* system-darwin-x86.ads (Word_Size): Change to Standard'Word_Size.
(Memory_Size): Change to 2 ** Word_Size.
* system-darwin-x86_64.ads: Delete.
* system-freebsd-x86.ads (Word_Size): Change to Standard'Word_Size.
(Memory_Size): Change to 2 ** Word_Size.
* system-freebsd-x86_64.ads: Delete.
* system-linux-alpha.ads (Support_Atomic_Primitives): Set to True.
* system-linux-armeb.ads (Word_Size): Change to Standard'Word_Size.
(Memory_Size): Change to 2 ** Word_Size.
(Support_Atomic_Primitives): Set to True.
* system-linux-armel.ads (Word_Size): Change to Standard'Word_Size.
(Memory_Size): Change to 2 ** Word_Size.
(Support_Atomic_Primitives): Set to True.
* system-linux-mips.ads: (Word_Size): Change to Standard'Word_Size.
(Memory_Size): Change to 2 ** Word_Size.
* system-linux-mipsel.ads (Word_Size): Change to Standard'Word_Size.
(Memory_Size): Change to 2 ** Word_Size.
* system-linux-s390.ads (Word_Size): Change to Standard'Word_Size.
(Memory_Size): Change to 2 ** Word_Size.
(Stack_Check_Probes): Set to True.
* system-linux-s390x.ads: Delete.
* system-linux-sparc.ads (Word_Size): Change to Standard'Word_Size.
(Memory_Size): Change to 2 ** Word_Size.
* system-linux-sparcv9.ads: Delete.
* system-linux-x86.ads (Word_Size): Change to Standard'Word_Size.
(Memory_Size): Change to 2 ** Word_Size.
* system-linux-x86_64.ads: Delete.
* system-mingw-x86_64.ads: Delete.
* system-mingw.ads (Word_Size): Change to Standard'Word_Size.
(Memory_Size): Change to 2 ** Word_Size.
* system-solaris-sparc.ads (Word_Size): Change to Standard'Word_Size.
(Memory_Size): Change to 2 ** Word_Size.
(Support_Atomic_Primitives): Set to True.
* system-solaris-sparcv9.ads: Delete.
* system-solaris-x86.ads (Word_Size): Change to Standard'Word_Size.
(Memory_Size): Change to 2 ** Word_Size.
* system-solaris-x86_64.ads: Delete.

-- 
Eric BotcazouIndex: gcc-interface/Makefile.in
===
--- gcc-interface/Makefile.in	(revision 241294)
+++ gcc-interface/Makefile.in	(working copy)
@@ -444,6 +444,12 @@ EXTRA_LIBGNAT_OBJS=
 # specific header files required to rebuild the runtime library from sources.
 EXTRA_LIBGNAT_SRCS=
 
+# Additionnal object files from Ada sources to be added in libgnat
+EXTRA_GNATRTL_NONTASKING_OBJS=
+
+# Additionnal object files from Ada sources to be added in libgnarl
+EXTRA_GNATRTL_TASKING_OBJS=
+
 # Subsets of extra libgnat sources that always go together
 VX_SIGTRAMP_EXTRA_SRCS=sigtramp.h sigtramp-vxworks-target.inc
 
@@ -454,13 +460,7 @@ EXTRA_ADALIB_OBJS=
 VX_CRTBE_EXTRA_ADALIB_OBJS=vx_crtbegin.o vx_crtbegin_auto.o vx_crtend.o
 
 # GCC spec files to be installed in $(libsubdir), so --specs=
-# finds them at runtime. Sequences of alphanum characters prefixed with '_' in
-# the filename are stripped off at installation time. This is used to strip
-# the architecture indications in vxsim spec filenames, installing e.g.
-# vxsim_ppc.spec as vxsim.spec. This allows setting up pretty general self
-# specs to perform -vxsim -> --specs=<...> translations without causing
-# conflicts since the specs are installed in a target spec

Re: [Ada] Set Always_Compatible_Rep to False everywhere

2016-10-17 Thread Eric Botcazou
> Some files could be easily merged (like what was done for ppc and ppc-64). 

Agreed, let's do that for starters.

-- 
Eric Botcazou


Re: [Ada] Set Always_Compatible_Rep to False everywhere

2016-10-17 Thread Tristan Gingold

> On 16 Oct 2016, at 21:40, Eric Botcazou  wrote:
> 
>> Can this be refactored to avoid having to duplicate the whole file for
>> every target?
> 
> I'm not sure, maybe entries could be omitted if they match the default though.

Some files could be easily merged (like what was done for ppc and ppc-64).  For 
example:

$ diff system-linux-x86*
8c8
< -- (GNU-Linux/x86 Version)  --
---
> --   (GNU-Linux/x86-64 Version) --
72,73c72,73
Word_Size: constant := Standard'Word_Size;
>Memory_Size  : constant := 2 ** Word_Size;


Tristan.



Re: [Ada] Set Always_Compatible_Rep to False everywhere

2016-10-16 Thread Eric Botcazou
> Can this be refactored to avoid having to duplicate the whole file for
> every target?

I'm not sure, maybe entries could be omitted if they match the default though.

-- 
Eric Botcazou


Re: [Ada] Set Always_Compatible_Rep to False everywhere

2016-10-16 Thread Andreas Schwab
On Okt 16 2016, Eric Botcazou  wrote:

>   * system-aix.ads (Always_Compatible_Rep): Change to False.
>   * system-aix64.ads (Always_Compatible_Rep): Likewise.
>   * system-hpux-ia64.ads (Always_Compatible_Rep): Likewise.
>   * system-hpux.ads (Always_Compatible_Rep): Likewise.
>   * system-linux-alpha.ads (Always_Compatible_Rep): Likewise.
>   * system-linux-hppa.ads (Always_Compatible_Rep): Likewise.
>   * system-linux-ia64.ads (Always_Compatible_Rep): Likewise.
>   * system-linux-mips.ads (Always_Compatible_Rep): Likewise.
>   * system-linux-mips64el.ads (Always_Compatible_Rep): Likewise.
>   * system-linux-mipsel.ads (Always_Compatible_Rep): Likewise.
>   * system-linux-s390.ads (Always_Compatible_Rep): Likewise.
>   * system-linux-s390x.ads (Always_Compatible_Rep): Likewise.
>   * system-linux-sh4.ads (Always_Compatible_Rep): Likewise.
>   * system-linux-sparc.ads (Always_Compatible_Rep): Likewise.
>   * system-linux-sparcv9.ads (Always_Compatible_Rep): Likewise.
>   * system-rtems.ads (Always_Compatible_Rep): Likewise.

Can this be refactored to avoid having to duplicate the whole file for
every target?

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."


[Ada] Set Always_Compatible_Rep to False everywhere

2016-10-16 Thread Eric Botcazou
It's not clear why this was set to True in some configuration files.

Applied on the mainline.


2016-10-16  Eric Botcazou  

* system-aix.ads (Always_Compatible_Rep): Change to False.
* system-aix64.ads (Always_Compatible_Rep): Likewise.
* system-hpux-ia64.ads (Always_Compatible_Rep): Likewise.
* system-hpux.ads (Always_Compatible_Rep): Likewise.
* system-linux-alpha.ads (Always_Compatible_Rep): Likewise.
* system-linux-hppa.ads (Always_Compatible_Rep): Likewise.
* system-linux-ia64.ads (Always_Compatible_Rep): Likewise.
* system-linux-mips.ads (Always_Compatible_Rep): Likewise.
* system-linux-mips64el.ads (Always_Compatible_Rep): Likewise.
* system-linux-mipsel.ads (Always_Compatible_Rep): Likewise.
* system-linux-s390.ads (Always_Compatible_Rep): Likewise.
* system-linux-s390x.ads (Always_Compatible_Rep): Likewise.
* system-linux-sh4.ads (Always_Compatible_Rep): Likewise.
* system-linux-sparc.ads (Always_Compatible_Rep): Likewise.
* system-linux-sparcv9.ads (Always_Compatible_Rep): Likewise.
* system-rtems.ads (Always_Compatible_Rep): Likewise.

-- 
Eric BotcazouIndex: system-aix64.ads
===
--- system-aix64.ads	(revision 241147)
+++ system-aix64.ads	(working copy)
@@ -7,7 +7,7 @@
 -- S p e c  --
 --   (PPC/AIX64 Version)--
 --  --
---  Copyright (C) 2009-2015, Free Software Foundation, Inc. --
+--  Copyright (C) 2009-2016, Free Software Foundation, Inc. --
 --  --
 -- This specification is derived from the Ada Reference Manual for use with --
 -- GNAT. The copyright notice above, and the license provisions that follow --
@@ -148,7 +148,7 @@ private
Support_Composite_Assign  : constant Boolean := True;
Support_Composite_Compare : constant Boolean := True;
Support_Long_Shifts   : constant Boolean := True;
-   Always_Compatible_Rep : constant Boolean := True;
+   Always_Compatible_Rep : constant Boolean := False;
Suppress_Standard_Library : constant Boolean := False;
Use_Ada_Main_Program_Name : constant Boolean := False;
Frontend_Exceptions   : constant Boolean := False;
Index: system-aix.ads
===
--- system-aix.ads	(revision 241147)
+++ system-aix.ads	(working copy)
@@ -7,7 +7,7 @@
 -- S p e c  --
 --(AIX/PPC Version) --
 --  --
---  Copyright (C) 1992-2015, Free Software Foundation, Inc. --
+--  Copyright (C) 1992-2016, Free Software Foundation, Inc. --
 --  --
 -- This specification is derived from the Ada Reference Manual for use with --
 -- GNAT. The copyright notice above, and the license provisions that follow --
@@ -148,7 +148,7 @@ private
Support_Composite_Assign  : constant Boolean := True;
Support_Composite_Compare : constant Boolean := True;
Support_Long_Shifts   : constant Boolean := True;
-   Always_Compatible_Rep : constant Boolean := True;
+   Always_Compatible_Rep : constant Boolean := False;
Suppress_Standard_Library : constant Boolean := False;
Use_Ada_Main_Program_Name : constant Boolean := False;
Frontend_Exceptions   : constant Boolean := False;
Index: system-hpux.ads
===
--- system-hpux.ads	(revision 241147)
+++ system-hpux.ads	(working copy)
@@ -7,7 +7,7 @@
 -- S p e c  --
 -- (HP-UX Version)  --
 --  --
---  Copyright (C) 1992-2015, Free Software Foundation, Inc. --
+--  Copyright (C) 1992-2016, Free Software Foundation, Inc. --
 --  --
 -- This specification is derived from the Ada Reference Manual for use with --
 -- GNAT. The copyright notice above, and the license provisions that follow --
@@ -138,7 +138,7 @@ private
Support_Composite_Assign  : constant Boolean := True;
Support_Composite_Compare : constant Boolean := True;
Support_Long_Shifts   : constant Boolean := True;
-   Always_Compatible_Rep : constant Boolean := True;
+   Always_Compatible_Rep : constant Boolean := False;
Suppress_Stand