summaryrefslogtreecommitdiff
path: root/gcc/README.gnat
blob: 77e21c097e645d9c71ef776fc59ea060be80b7fd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
The following patches are needed in order to build GNAT with EGCS.

These patches were tested with egcs-980308 and gnat-3.10p on a mips-sgi-irix6.3
system.  The gnat build succeeded as per the instructions in the gnat
README.BUILD file for building one library, except that CFLAGS="-O -g" and
GNATLIBCFLAGS="-O -g" were substituted for the recommended "-O2" so that the
build could be debugged.  There was no attempt to run the resulting build
against any testsuite or validation suite.

--

Developers Notes:

Every use of sizetype in the Ada front end should be checked to see if perhaps
it should be using bitsizetype instead.  The change to maybe_pad_type is just
a hack to work around this problem, and may not be desirable in the long term.

There are many places in the Ada front end where it calls operand_equal_p to
see if two type sizes are the same.  operand_equal_p fails if the two
arguments have different TYPE_MODEs.  sizetype and bitsizetype can have
different TYPE_MODEs.  Thus this code can fail if one type size is based
on sizetype, and the other is based on bitsizetype.  The change to
maybe_pad_type fixes one very critical place where this happens.  There may
be others.

--

Mon Mar 16 11:00:25 1998  Jim Wilson  <wilson@cygnus.com>

	* a-gtran3.c (maybe_pad_type): Convert both size and orig_size to
	sizetype if they have differing modes.
	* a-misc.c (gnat_tree_code_type): Change from string to char array.
	(init_lex): Delete realloc calls for tree_code_* globals.  Adjust
	bcopy call for gnat_tree_code_type change.
	* a-tree.def: Adjust for tree_code_* type changes.

	* a-misc.c (init_lex): Rename to init_parse.

diff -c ada/a-gtran3.c /home/brolley/comp/egcs/tmp/ada/a-gtran3.c
*** ada/a-gtran3.c	Mon Mar 30 16:29:04 1998
--- /home/brolley/comp/egcs/tmp/ada/a-gtran3.c	Thu Apr  2 17:16:15 1998
***************
*** 3329,3334 ****
--- 3329,3341 ----
       isn't changing.  Likewise, clear the alignment if it isn't being
       changed.  Then return if we aren't doing anything.  */
  
+     if (size != 0
+ 	&& TYPE_MODE (TREE_TYPE (size)) != TYPE_MODE (TREE_TYPE (orig_size)))
+       {
+ 	size = convert (sizetype, size);
+ 	orig_size = convert (sizetype, orig_size);
+       }
+  
    if (size != 0
        && (operand_equal_p (size, orig_size, 0)
  	  || (TREE_CODE (orig_size) == INTEGER_CST
diff -c ada/a-misc.c /home/brolley/comp/egcs/tmp/ada/a-misc.c
*** ada/a-misc.c	Mon Mar 30 16:29:05 1998
--- /home/brolley/comp/egcs/tmp/ada/a-misc.c	Thu Apr  2 17:36:19 1998
***************
*** 70,77 ****
  
  #define DEFTREECODE(SYM, NAME, TYPE, LENGTH) TYPE,
  
! char *gnat_tree_code_type[] = {
!   "x",
  #include "a-tree.def"
  };
  #undef DEFTREECODE
--- 70,77 ----
  
  #define DEFTREECODE(SYM, NAME, TYPE, LENGTH) TYPE,
  
! char gnat_tree_code_type[] = {
!   'x',
  #include "a-tree.def"
  };
  #undef DEFTREECODE
***************
*** 254,259 ****
--- 254,268 ----
  print_lang_statistics ()
  {}
  
+ void
+ lang_print_xnode (file, node, indent)
+      FILE *file;
+      tree node;
+      int indent;
+ {
+ }
+  
+ 
  /* integrate_decl_tree calls this function, but since we don't use the
     DECL_LANG_SPECIFIC field, this is a no-op.  */
  
***************
*** 603,622 ****
     it, but it's where g++ does it.  */
  
  void
! init_lex ()
  {
    lang_expand_expr = gnat_expand_expr;
  
-   tree_code_type
-     = (char **) realloc (tree_code_type,
- 			 sizeof (char *) * LAST_GNAT_TREE_CODE);
-   tree_code_length
-     = (int *) realloc (tree_code_length,
- 		       sizeof (int) * LAST_GNAT_TREE_CODE);
-   tree_code_name
-     = (char **) realloc (tree_code_name,
- 			 sizeof (char *) * LAST_GNAT_TREE_CODE);
- 
    bcopy ((char *) gnat_tree_code_type,
  	 (char *) (tree_code_type + (int) LAST_AND_UNUSED_TREE_CODE),
  	 ((LAST_GNAT_TREE_CODE - (int) LAST_AND_UNUSED_TREE_CODE)
--- 612,622 ----
     it, but it's where g++ does it.  */
  
  void
! init_parse (filename)
!      char *filename;
  {
    lang_expand_expr = gnat_expand_expr;
  
    bcopy ((char *) gnat_tree_code_type,
  	 (char *) (tree_code_type + (int) LAST_AND_UNUSED_TREE_CODE),
  	 ((LAST_GNAT_TREE_CODE - (int) LAST_AND_UNUSED_TREE_CODE)
***************
*** 629,636 ****
  
    bcopy ((char *) gnat_tree_code_name,
  	 (char *) (tree_code_name + (int) LAST_AND_UNUSED_TREE_CODE),
! 	 ((LAST_GNAT_TREE_CODE - (int) LAST_AND_UNUSED_TREE_CODE)
! 	  * sizeof (char *)));
  }
  
  /* Sets some debug flags for the parsed. It does nothing here.  */
--- 629,640 ----
  
    bcopy ((char *) gnat_tree_code_name,
  	 (char *) (tree_code_name + (int) LAST_AND_UNUSED_TREE_CODE),
! 	 LAST_GNAT_TREE_CODE - (int) LAST_AND_UNUSED_TREE_CODE);
! }
! 
! void
! finish_parse ()
! {
  }
  
  /* Sets some debug flags for the parsed. It does nothing here.  */
diff -c ada/a-tree.def /home/brolley/comp/egcs/tmp/ada/a-tree.def
*** ada/a-tree.def	Mon Mar 30 16:29:09 1998
--- /home/brolley/comp/egcs/tmp/ada/a-tree.def	Thu Apr  2 17:20:38 1998
***************
*** 31,69 ****
     The only field used if TREE_COMPLEXITY, which contains the GNAT node
     number.  */
  
! DEFTREECODE (TRANSFORM_EXPR, "transform_expr", "e", 0)
  
  /* Perform an unchecked conversion between the input and the output. 
     if TREE_ADDRESSABLE is set, it means this is in an LHS; in that case,
     we can only use techniques, such as pointer punning, that leave the
     expression a "name".  */
  
! DEFTREECODE (UNCHECKED_CONVERT_EXPR, "unchecked_convert_expr", "1", 1)
  
  /* A type that is an unconstrained array itself.  This node is never passed
     to GCC. TREE_TYPE is the type of the fat pointer and TYPE_OBJECT_RECORD_TYPE
     is the type of a record containing the template and data.  */
  
! DEFTREECODE (UNCONSTRAINED_ARRAY_TYPE, "unconstrained_array_type", "t", 0)
  
  /* A reference to an unconstrained array.  This node only exists as an
     intermediate node during the translation of a GNAT tree to a GCC tree;
     it is never passed to GCC.  The only field used is operand 0, which
     is the fat pointer object.  */
  
! DEFTREECODE (UNCONSTRAINED_ARRAY_REF, "unconstrained_array_ref", "r", 1)
  
  /* An expression that returns an RTL suitable for its type.  Operand 0
     is an expression to be evaluated for side effects only.  */
  
! DEFTREECODE (NULL_EXPR, "null_expr", "e", 1)
  
  /* An expression that emits a USE for its single operand.  */
  
! DEFTREECODE (USE_EXPR, "use_expr", "e", 1)
  
  /* An expression that is treated as a conversion while generating code, but is
     used to prevent infinite recursion when conversions of biased types are
     involved.  */
  
! DEFTREECODE (GNAT_NOP_EXPR, "gnat_nop_expr", "1", 1)
--- 31,69 ----
     The only field used if TREE_COMPLEXITY, which contains the GNAT node
     number.  */
  
! DEFTREECODE (TRANSFORM_EXPR, "transform_expr", 'e', 0)
  
  /* Perform an unchecked conversion between the input and the output. 
     if TREE_ADDRESSABLE is set, it means this is in an LHS; in that case,
     we can only use techniques, such as pointer punning, that leave the
     expression a "name".  */
  
! DEFTREECODE (UNCHECKED_CONVERT_EXPR, "unchecked_convert_expr", '1', 1)
  
  /* A type that is an unconstrained array itself.  This node is never passed
     to GCC. TREE_TYPE is the type of the fat pointer and TYPE_OBJECT_RECORD_TYPE
     is the type of a record containing the template and data.  */
  
! DEFTREECODE (UNCONSTRAINED_ARRAY_TYPE, "unconstrained_array_type", 't', 0)
  
  /* A reference to an unconstrained array.  This node only exists as an
     intermediate node during the translation of a GNAT tree to a GCC tree;
     it is never passed to GCC.  The only field used is operand 0, which
     is the fat pointer object.  */
  
! DEFTREECODE (UNCONSTRAINED_ARRAY_REF, "unconstrained_array_ref", 'r', 1)
  
  /* An expression that returns an RTL suitable for its type.  Operand 0
     is an expression to be evaluated for side effects only.  */
  
! DEFTREECODE (NULL_EXPR, "null_expr", 'e', 1)
  
  /* An expression that emits a USE for its single operand.  */
  
! DEFTREECODE (USE_EXPR, "use_expr", 'e', 1)
  
  /* An expression that is treated as a conversion while generating code, but is
     used to prevent infinite recursion when conversions of biased types are
     involved.  */
  
! DEFTREECODE (GNAT_NOP_EXPR, "gnat_nop_expr", '1', 1)