3
2013-03-23 Mikael Pettersson <mikpe@it.uu.se>
6
* cse.c (fold_rtx) <case CC0>: If prev_insn_cc0 is NULL
7
return the orginal expression x.
11
2011-10-12 Mikael Pettersson <mikpe@it.uu.se>
14
* gcc-interface/Makefile.in: Add support for m68k-linux.
15
* system-linux-m68k.ads: New file based on system-linux-ppc.ads
16
and system-vxworks-m68k.ads.
17
* s-memory.adb (Gnat_Malloc): New wrapper around Alloc, returning
18
the memory address as a pointer not an integer.
19
Add Gnat_Malloc -> __gnat_malloc export.
20
* s-memory.ads: Remove Alloc -> __gnat_malloc export.
22
2012-01-28 Mikael Pettersson <mikpe@it.uu.se>
25
* gcc-interface/misc.c (enumerate_modes): Pass both precision and
26
bitsize to callback function. Adjust prototype of callback function.
27
gcc-interface/gigi.h (enumerate_modes): Likewise.
28
back_end.ads (Register_Type_Proc): Likewise.
29
cstand.adb (Register_Float_Type): Likewise. Use given precision
30
rather than deriving it incorrectly from size.
32
--- a/src/gcc/ada/gcc-interface/Makefile.in
33
+++ b/src/gcc/ada/gcc-interface/Makefile.in
34
@@ -1919,6 +1919,35 @@ ifeq ($(strip $(filter-out arm%-linux,$(
35
LIBRARY_VERSION := $(LIB_VERSION)
39
+ifeq ($(strip $(filter-out m68k% linux%,$(arch) $(osys))),)
40
+ LIBGNAT_TARGET_PAIRS = \
41
+ a-intnam.ads<a-intnam-linux.ads \
42
+ s-inmaop.adb<s-inmaop-posix.adb \
43
+ s-intman.adb<s-intman-posix.adb \
44
+ s-linux.ads<s-linux.ads \
45
+ s-osinte.adb<s-osinte-posix.adb \
46
+ s-osinte.ads<s-osinte-linux.ads \
47
+ s-osprim.adb<s-osprim-posix.adb \
48
+ s-taprop.adb<s-taprop-linux.adb \
49
+ s-tasinf.ads<s-tasinf-linux.ads \
50
+ s-tasinf.adb<s-tasinf-linux.adb \
51
+ s-taspri.ads<s-taspri-posix-noaltstack.ads \
52
+ s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
53
+ system.ads<system-linux-m68k.ads
55
+ TOOLS_TARGET_PAIRS = \
56
+ mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb \
57
+ indepsw.adb<indepsw-gnu.adb
59
+ EXTRA_GNATRTL_TASKING_OBJS=s-linux.o
61
+ THREADSLIB = -lpthread
62
+ GNATLIB_SHARED = gnatlib-shared-dual
64
+ LIBRARY_VERSION := $(LIB_VERSION)
68
ifeq ($(strip $(filter-out sparc% linux%,$(arch) $(osys))),)
69
LIBGNAT_TARGET_PAIRS_COMMON = \
70
--- a/src/gcc/ada/s-memory.adb
71
+++ b/src/gcc/ada/s-memory.adb
72
@@ -47,6 +47,7 @@ with Ada.Exceptions;
73
with System.Soft_Links;
74
with System.Parameters;
76
+with Ada.Unchecked_Conversion;
78
package body System.Memory is
80
@@ -100,6 +101,22 @@ package body System.Memory is
84
+ type Char_Ptr is access all Character;
85
+ pragma Convention (C, Char_Ptr);
86
+ pragma No_Strict_Aliasing (Char_Ptr);
88
+ function To_Char_Ptr is
89
+ new Ada.Unchecked_Conversion (System.Address, Char_Ptr);
91
+ -- The function exported as __gnat_malloc MUST return a pointer type.
92
+ function Gnat_Malloc (Size : size_t) return Char_Ptr;
93
+ pragma Export (C, Gnat_Malloc, "__gnat_malloc");
95
+ function Gnat_Malloc (Size : size_t) return Char_Ptr is
97
+ return To_Char_Ptr (Alloc (Size));
103
--- a/src/gcc/ada/s-memory.ads
104
+++ b/src/gcc/ada/s-memory.ads
105
@@ -100,7 +100,6 @@ private
107
-- The following names are used from the generated compiler code
109
- pragma Export (C, Alloc, "__gnat_malloc");
110
pragma Export (C, Free, "__gnat_free");
111
pragma Export (C, Realloc, "__gnat_realloc");
114
+++ b/src/gcc/ada/system-linux-m68k.ads
116
+------------------------------------------------------------------------------
118
+-- GNAT RUN-TIME COMPONENTS --
123
+-- (GNU-Linux/M68K Version) --
125
+-- Copyright (C) 1992-2009, Free Software Foundation, Inc. --
127
+-- This specification is derived from the Ada Reference Manual for use with --
128
+-- GNAT. The copyright notice above, and the license provisions that follow --
129
+-- apply solely to the contents of the part following the private keyword. --
131
+-- GNAT is free software; you can redistribute it and/or modify it under --
132
+-- terms of the GNU General Public License as published by the Free Soft- --
133
+-- ware Foundation; either version 3, or (at your option) any later ver- --
134
+-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
135
+-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
136
+-- or FITNESS FOR A PARTICULAR PURPOSE. --
138
+-- As a special exception under Section 7 of GPL version 3, you are granted --
139
+-- additional permissions described in the GCC Runtime Library Exception, --
140
+-- version 3.1, as published by the Free Software Foundation. --
142
+-- You should have received a copy of the GNU General Public License and --
143
+-- a copy of the GCC Runtime Library Exception along with this program; --
144
+-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
145
+-- <http://www.gnu.org/licenses/>. --
147
+-- GNAT was originally developed by the GNAT team at New York University. --
148
+-- Extensive contributions were provided by Ada Core Technologies Inc. --
150
+------------------------------------------------------------------------------
154
+ -- Note that we take advantage of the implementation permission to make
155
+ -- this unit Pure instead of Preelaborable; see RM 13.7.1(15). In Ada
156
+ -- 2005, this is Pure in any case (AI-362).
158
+ type Name is (SYSTEM_NAME_GNAT);
159
+ System_Name : constant Name := SYSTEM_NAME_GNAT;
161
+ -- System-Dependent Named Numbers
163
+ Min_Int : constant := Long_Long_Integer'First;
164
+ Max_Int : constant := Long_Long_Integer'Last;
166
+ Max_Binary_Modulus : constant := 2 ** Long_Long_Integer'Size;
167
+ Max_Nonbinary_Modulus : constant := 2 ** Integer'Size - 1;
169
+ Max_Base_Digits : constant := Long_Long_Float'Digits;
170
+ Max_Digits : constant := Long_Long_Float'Digits;
172
+ Max_Mantissa : constant := 63;
173
+ Fine_Delta : constant := 2.0 ** (-Max_Mantissa);
175
+ Tick : constant := 0.000_001;
177
+ -- Storage-related Declarations
179
+ type Address is private;
180
+ pragma Preelaborable_Initialization (Address);
181
+ Null_Address : constant Address;
183
+ Storage_Unit : constant := 8;
184
+ Word_Size : constant := 32;
185
+ Memory_Size : constant := 2 ** 32;
187
+ -- Address comparison
189
+ function "<" (Left, Right : Address) return Boolean;
190
+ function "<=" (Left, Right : Address) return Boolean;
191
+ function ">" (Left, Right : Address) return Boolean;
192
+ function ">=" (Left, Right : Address) return Boolean;
193
+ function "=" (Left, Right : Address) return Boolean;
195
+ pragma Import (Intrinsic, "<");
196
+ pragma Import (Intrinsic, "<=");
197
+ pragma Import (Intrinsic, ">");
198
+ pragma Import (Intrinsic, ">=");
199
+ pragma Import (Intrinsic, "=");
201
+ -- Other System-Dependent Declarations
203
+ type Bit_Order is (High_Order_First, Low_Order_First);
204
+ Default_Bit_Order : constant Bit_Order := High_Order_First;
205
+ pragma Warnings (Off, Default_Bit_Order); -- kill constant condition warning
207
+ -- Priority-related Declarations (RM D.1)
209
+ -- 0 .. 98 corresponds to the system priority range 1 .. 99.
211
+ -- If the scheduling policy is SCHED_FIFO or SCHED_RR the runtime makes use
212
+ -- of the entire range provided by the system.
214
+ -- If the scheduling policy is SCHED_OTHER the only valid system priority
215
+ -- is 1 and other values are simply ignored.
217
+ Max_Priority : constant Positive := 97;
218
+ Max_Interrupt_Priority : constant Positive := 98;
220
+ subtype Any_Priority is Integer range 0 .. 98;
221
+ subtype Priority is Any_Priority range 0 .. 97;
222
+ subtype Interrupt_Priority is Any_Priority range 98 .. 98;
224
+ Default_Priority : constant Priority := 48;
228
+ type Address is mod Memory_Size;
229
+ Null_Address : constant Address := 0;
231
+ --------------------------------------
232
+ -- System Implementation Parameters --
233
+ --------------------------------------
235
+ -- These parameters provide information about the target that is used
236
+ -- by the compiler. They are in the private part of System, where they
237
+ -- can be accessed using the special circuitry in the Targparm unit
238
+ -- whose source should be consulted for more detailed descriptions
239
+ -- of the individual switch values.
241
+ Backend_Divide_Checks : constant Boolean := False;
242
+ Backend_Overflow_Checks : constant Boolean := True;
243
+ Command_Line_Args : constant Boolean := True;
244
+ Configurable_Run_Time : constant Boolean := False;
245
+ Denorm : constant Boolean := True;
246
+ Duration_32_Bits : constant Boolean := False;
247
+ Exit_Status_Supported : constant Boolean := True;
248
+ Fractional_Fixed_Ops : constant Boolean := False;
249
+ Frontend_Layout : constant Boolean := False;
250
+ Machine_Overflows : constant Boolean := False;
251
+ Machine_Rounds : constant Boolean := True;
252
+ Preallocated_Stacks : constant Boolean := False;
253
+ Signed_Zeros : constant Boolean := False;
254
+ Stack_Check_Default : constant Boolean := False;
255
+ Stack_Check_Probes : constant Boolean := False;
256
+ Stack_Check_Limits : constant Boolean := False;
257
+ Support_64_Bit_Divides : constant Boolean := True;
258
+ Support_Aggregates : constant Boolean := True;
259
+ Support_Composite_Assign : constant Boolean := True;
260
+ Support_Composite_Compare : constant Boolean := True;
261
+ Support_Long_Shifts : constant Boolean := True;
262
+ Always_Compatible_Rep : constant Boolean := True;
263
+ Suppress_Standard_Library : constant Boolean := False;
264
+ Use_Ada_Main_Program_Name : constant Boolean := False;
265
+ ZCX_By_Default : constant Boolean := True;
266
+ GCC_ZCX_Support : constant Boolean := True;
271
@@ -3137,6 +3137,8 @@ fold_rtx (rtx x, rtx insn)
275
+ if (! prev_insn_cc0)
277
return prev_insn_cc0;
280
--- a/src/gcc/ada/back_end.ads
281
+++ b/src/gcc/ada/back_end.ads
282
@@ -55,6 +55,7 @@ package Back_End is
283
Complex : Boolean; -- True iff type has real and imaginary parts
284
Count : Natural; -- Number of elements in vector, 0 otherwise
285
Float_Rep : Float_Rep_Kind; -- Representation used for fpt type
286
+ Prec : Positive; -- Precision in bits
287
Size : Positive; -- Size of representation in bits
288
Alignment : Natural); -- Required alignment in bits
289
pragma Convention (C, Register_Type_Proc);
290
--- a/src/gcc/ada/cstand.adb
291
+++ b/src/gcc/ada/cstand.adb
292
@@ -151,6 +151,7 @@ package body CStand is
293
Complex : Boolean; -- True iff type has real and imaginary parts
294
Count : Natural; -- Number of elements in vector, 0 otherwise
295
Float_Rep : Float_Rep_Kind; -- Representation used for fpt type
296
+ Prec : Positive; -- Precision in bits
297
Size : Positive; -- Size of representation in bits
298
Alignment : Natural); -- Required alignment in bits
299
pragma Convention (C, Register_Float_Type);
300
@@ -2014,6 +2015,7 @@ package body CStand is
303
Float_Rep : Float_Rep_Kind;
308
@@ -2063,7 +2065,7 @@ package body CStand is
311
Write_Str ("mod 2**");
312
- Write_Int (Int (Size / Positive'Max (1, Count)));
313
+ Write_Int (Int (Prec / Positive'Max (1, Count)));
317
@@ -2100,7 +2102,7 @@ package body CStand is
318
Make_Name (Ent, T (1 .. Last));
319
Set_Scope (Ent, Standard_Standard);
320
Build_Float_Type (Ent, Esize, Float_Rep, Pos (Digs));
321
- Set_RM_Size (Ent, UI_From_Int (Int (Size)));
322
+ Set_RM_Size (Ent, UI_From_Int (Int (Prec)));
323
Set_Alignment (Ent, UI_From_Int (Int (Alignment / 8)));
325
if No (Back_End_Float_Types) then
326
--- a/src/gcc/ada/gcc-interface/gigi.h
327
+++ b/src/gcc/ada/gcc-interface/gigi.h
328
@@ -1014,7 +1014,7 @@ extern Nat get_target_double_scalar_alig
329
/* This function is called by the front-end to enumerate all the supported
330
modes for the machine, as well as some predefined C types. */
331
extern void enumerate_modes (void (*f) (const char *, int, int, int, int, int,
337
--- a/src/gcc/ada/gcc-interface/misc.c
338
+++ b/src/gcc/ada/gcc-interface/misc.c
339
@@ -664,11 +664,12 @@ must_pass_by_ref (tree gnu_type)
340
COMPLEX_P nonzero is this represents a complex mode
341
COUNT count of number of items, nonzero for vector mode
342
FLOAT_REP Float_Rep_Kind for FP, otherwise undefined
343
+ PREC number of bits of precision
344
SIZE number of bits used to store data
345
ALIGN number of bits to which mode is aligned. */
348
-enumerate_modes (void (*f) (const char *, int, int, int, int, int, int))
349
+enumerate_modes (void (*f) (const char *, int, int, int, int, int, int, int))
352
= { float_type_node, double_type_node, long_double_type_node };
353
@@ -751,9 +752,11 @@ enumerate_modes (void (*f) (const char *
355
if (TYPE_MODE (typ) == i)
357
+ int prec = TYPE_PRECISION (typ);
358
+ int size = float_p ? fp_prec_to_size (prec) : prec;
359
f (nam, digs, complex_p,
360
vector_p ? GET_MODE_NUNITS (i) : 0, float_rep,
361
- TYPE_PRECISION (typ), TYPE_ALIGN (typ));
362
+ prec, size, TYPE_ALIGN (typ));
366
@@ -763,7 +766,7 @@ enumerate_modes (void (*f) (const char *
368
f (GET_MODE_NAME (i), digs, complex_p,
369
vector_p ? GET_MODE_NUNITS (i) : 0, float_rep,
370
- GET_MODE_PRECISION (i), GET_MODE_ALIGNMENT (i));
371
+ GET_MODE_PRECISION (i), GET_MODE_BITSIZE (i), GET_MODE_ALIGNMENT (i));