summaryrefslogtreecommitdiff
path: root/m68k-unknown-amigaos/recipes/patches/gcc/gcc.c-parse.in.p
blob: bedb438ea2b2020e5c8aa3e5c1a786904fa2b0da (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
--- c-parse.in	2004-10-15 00:12:53.000000000 +0100
+++ gcc/c-parse.in	2015-01-01 13:56:51.039003490 +0000
@@ -29,7 +29,7 @@ Software Foundation, 59 Temple Place - S
    written by AT&T, but I have never seen it.  */
 
 @@ifc
-%expect 10 /* shift/reduce conflicts, and no reduce/reduce conflicts.  */
+%expect 11 /* shift/reduce conflicts, and no reduce/reduce conflicts.  */
 @@end_ifc
 
 %{
@@ -1730,7 +1730,7 @@ enum_head:
 
 structsp_attr:
 	  struct_head identifier '{'
-		{ $$ = start_struct (RECORD_TYPE, $2);
+		{ $<ttype>$ = start_struct (RECORD_TYPE, $2);
 		  /* Start scope of tag before parsing components.  */
 		}
 	  component_decl_list '}' maybe_attribute
@@ -1741,7 +1741,7 @@ structsp_attr:
 				      nreverse ($3), chainon ($1, $5));
 		}
 	| union_head identifier '{'
-		{ $$ = start_struct (UNION_TYPE, $2); }
+		{ $<ttype>$ = start_struct (UNION_TYPE, $2); }
 	  component_decl_list '}' maybe_attribute
 		{ $$ = finish_struct ($<ttype>4, nreverse ($5),
 				      chainon ($1, $7)); }
@@ -1750,12 +1750,12 @@ structsp_attr:
 				      nreverse ($3), chainon ($1, $5));
 		}
 	| enum_head identifier '{'
-		{ $$ = start_enum ($2); }
+		{ $<ttype>$ = start_enum ($2); }
 	  enumlist maybecomma_warn '}' maybe_attribute
 		{ $$ = finish_enum ($<ttype>4, nreverse ($5),
 				    chainon ($1, $8)); }
 	| enum_head '{'
-		{ $$ = start_enum (NULL_TREE); }
+		{ $<ttype>$ = start_enum (NULL_TREE); }
 	  enumlist maybecomma_warn '}' maybe_attribute
 		{ $$ = finish_enum ($<ttype>3, nreverse ($4),
 				    chainon ($1, $7)); }
@@ -1927,20 +1927,25 @@ absdcl:   /* an absolute declarator */
 	| absdcl1
 	;
 
+/* begin-GG-local: explicit register specification for parameters */
 absdcl_maybe_attribute:   /* absdcl maybe_attribute, but not just attributes */
-	/* empty */
-		{ $$ = build_tree_list (build_tree_list (current_declspecs,
-							 NULL_TREE),
-					all_prefix_attributes); }
-	| absdcl1
-		{ $$ = build_tree_list (build_tree_list (current_declspecs,
-							 $1),
-					all_prefix_attributes); }
-	| absdcl1_noea attributes
-		{ $$ = build_tree_list (build_tree_list (current_declspecs,
-							 $1),
-					chainon ($2, all_prefix_attributes)); }
+	maybeasm
+		{ $$ = build_tree_list (
+			 build_tree_list (build_tree_list (current_declspecs, NULL_TREE),
+					all_prefix_attributes),
+			 $1); }
+	| absdcl1 maybeasm
+		{ $$ = build_tree_list (
+			 build_tree_list (build_tree_list (current_declspecs, $1),
+					  all_prefix_attributes),
+			 $2); }
+	| absdcl1_noea maybeasm attributes
+		{ $$ = build_tree_list (
+			 build_tree_list (build_tree_list (current_declspecs, $1),
+					  chainon ($3, all_prefix_attributes)),
+			 $2); }
 	;
+/* end-GG-local */
 
 absdcl1:  /* a nonempty absolute declarator */
 	  absdcl1_ea
@@ -2596,33 +2601,37 @@ parmlist_2:  /* empty */
 		}
 	;
 
+/* begin-GG-local: explicit register specification for parameters */
 parms:
 	firstparm
-		{ push_parm_decl ($1); }
+		{ push_parm_decl (TREE_PURPOSE($1), TREE_VALUE($1)); }
 	| parms ',' parm
-		{ push_parm_decl ($3); }
+		{ push_parm_decl (TREE_PURPOSE($3), TREE_VALUE($3)); }
 	;
 
 /* A single parameter declaration or parameter type name,
    as found in a parmlist.  */
 parm:
-	  declspecs_ts setspecs parm_declarator maybe_attribute
-		{ $$ = build_tree_list (build_tree_list (current_declspecs,
-							 $3),
-					chainon ($4, all_prefix_attributes));
+	  declspecs_ts setspecs parm_declarator maybeasm maybe_attribute
+		{ $$ = build_tree_list (
+			 build_tree_list (build_tree_list (current_declspecs, $3),
+					  chainon ($5, all_prefix_attributes)),
+			 $4);
 		  POP_DECLSPEC_STACK; }
-	| declspecs_ts setspecs notype_declarator maybe_attribute
-		{ $$ = build_tree_list (build_tree_list (current_declspecs,
-							 $3),
-					chainon ($4, all_prefix_attributes));
+	| declspecs_ts setspecs notype_declarator maybeasm maybe_attribute
+		{ $$ = build_tree_list (
+			 build_tree_list (build_tree_list (current_declspecs, $3),
+					  chainon ($5, all_prefix_attributes)),
+			 $4);
 		  POP_DECLSPEC_STACK; }
 	| declspecs_ts setspecs absdcl_maybe_attribute
 		{ $$ = $3;
 		  POP_DECLSPEC_STACK; }
-	| declspecs_nots setspecs notype_declarator maybe_attribute
-		{ $$ = build_tree_list (build_tree_list (current_declspecs,
-							 $3),
-					chainon ($4, all_prefix_attributes));
+	| declspecs_nots setspecs notype_declarator maybeasm maybe_attribute
+		{ $$ = build_tree_list (
+			 build_tree_list (build_tree_list (current_declspecs, $3),
+					  chainon ($5, all_prefix_attributes)),
+			 $4);
 		  POP_DECLSPEC_STACK; }
 
 	| declspecs_nots setspecs absdcl_maybe_attribute
@@ -2633,29 +2642,33 @@ parm:
 /* The first parm, which must suck attributes from off the top of the parser
    stack.  */
 firstparm:
-	  declspecs_ts_nosa setspecs_fp parm_declarator maybe_attribute
-		{ $$ = build_tree_list (build_tree_list (current_declspecs,
-							 $3),
-					chainon ($4, all_prefix_attributes));
+	  declspecs_ts_nosa setspecs_fp parm_declarator maybeasm maybe_attribute
+		{ $$ = build_tree_list (
+			 build_tree_list (build_tree_list (current_declspecs, $3),
+					  chainon ($5, all_prefix_attributes)),
+			 $4);
 		  POP_DECLSPEC_STACK; }
-	| declspecs_ts_nosa setspecs_fp notype_declarator maybe_attribute
-		{ $$ = build_tree_list (build_tree_list (current_declspecs,
-							 $3),
-					chainon ($4, all_prefix_attributes));
+	| declspecs_ts_nosa setspecs_fp notype_declarator maybeasm maybe_attribute
+		{ $$ = build_tree_list (
+			 build_tree_list (build_tree_list (current_declspecs, $3),
+					  chainon ($5, all_prefix_attributes)),
+			 $4);
 		  POP_DECLSPEC_STACK; }
 	| declspecs_ts_nosa setspecs_fp absdcl_maybe_attribute
 		{ $$ = $3;
 		  POP_DECLSPEC_STACK; }
-	| declspecs_nots_nosa setspecs_fp notype_declarator maybe_attribute
-		{ $$ = build_tree_list (build_tree_list (current_declspecs,
-							 $3),
-					chainon ($4, all_prefix_attributes));
+	| declspecs_nots_nosa setspecs_fp notype_declarator maybeasm maybe_attribute
+		{ $$ = build_tree_list (
+			 build_tree_list (build_tree_list (current_declspecs, $3),
+					  chainon ($5, all_prefix_attributes)),
+			 $4);
 		  POP_DECLSPEC_STACK; }
 
 	| declspecs_nots_nosa setspecs_fp absdcl_maybe_attribute
 		{ $$ = $3;
 		  POP_DECLSPEC_STACK; }
 	;
+/* end-GG-local */
 
 setspecs_fp:
 	  setspecs
@@ -3055,28 +3068,32 @@ mydecl:
 		{ pedwarn ("empty declaration"); }
 	;
 
+/* begin-GG-local: explicit register specification for parameters */
 myparms:
 	myparm
-		{ push_parm_decl ($1); }
+		{ push_parm_decl (TREE_PURPOSE($1), TREE_VALUE($1)); }
 	| myparms ',' myparm
-		{ push_parm_decl ($3); }
+		{ push_parm_decl (TREE_PURPOSE($3), TREE_VALUE($3)); }
 	;
 
 /* A single parameter declaration or parameter type name,
    as found in a parmlist. DOES NOT ALLOW AN INITIALIZER OR ASMSPEC */
 
 myparm:
-	  parm_declarator maybe_attribute
-		{ $$ = build_tree_list (build_tree_list (current_declspecs,
-							 $1),
-					chainon ($2, all_prefix_attributes)); }
-	| notype_declarator maybe_attribute
-		{ $$ = build_tree_list (build_tree_list (current_declspecs,
-							 $1),
-					chainon ($2, all_prefix_attributes)); }
+	  parm_declarator maybeasm maybe_attribute
+		{ $$ = build_tree_list (
+			 build_tree_list (build_tree_list (current_declspecs, $1),
+					  chainon ($3, all_prefix_attributes)),
+			 $2); }
+	| notype_declarator maybeasm maybe_attribute
+		{ $$ = build_tree_list (
+			 build_tree_list (build_tree_list (current_declspecs, $1),
+					  chainon ($2, all_prefix_attributes)),
+			 $2); }
 	| absdcl_maybe_attribute
 		{ $$ = $1; }
 	;
+/* end-GG-local */
 
 optparmlist:
 	  /* empty */