@R update for gcc-3.4.6

This commit is contained in:
bebbo
2017-06-20 19:15:26 +02:00
parent 39fa13909e
commit b7d28569a0
2 changed files with 243 additions and 6 deletions
+51 -6
View File
@@ -1,5 +1,5 @@
--- gcc-3.4.6/gcc/c-parse.in 2013-05-19 20:02:45.000000000 +0200
+++ gcc-3.4.6-patched/gcc/c-parse.in 2013-05-19 20:23:32.000000000 +0200
--- gcc-3.4.6.orig/gcc/c-parse.in 2017-06-20 08:51:51.803406400 +0200
+++ gcc-3.4.6/gcc/c-parse.in 2016-10-15 16:46:07.899976800 +0200
@@ -29,7 +29,7 @@
written by AT&T, but I have never seen it. */
@@ -9,7 +9,52 @@
@@end_ifc
%{
@@ -1927,20 +1927,25 @@
@@ -252,6 +252,11 @@
@@end_ifobjc
%{
+
+#ifndef YYLEX
+#define YYLEX yylex()
+#endif
+
/* Number of statements (loosely speaking) and compound statements
seen so far. */
static int stmt_count;
@@ -1730,7 +1735,7 @@
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 +1746,7 @@
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 +1755,12 @@
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 +1932,25 @@
| absdcl1
;
@@ -47,7 +92,7 @@
absdcl1: /* a nonempty absolute declarator */
absdcl1_ea
@@ -2596,33 +2601,37 @@
@@ -2596,33 +2606,37 @@
}
;
@@ -99,7 +144,7 @@
POP_DECLSPEC_STACK; }
| declspecs_nots setspecs absdcl_maybe_attribute
@@ -2633,29 +2642,33 @@
@@ -2633,29 +2647,33 @@
/* The first parm, which must suck attributes from off the top of the parser
stack. */
firstparm:
@@ -145,7 +190,7 @@
setspecs_fp:
setspecs
@@ -3055,28 +3068,32 @@
@@ -3055,28 +3073,32 @@
{ pedwarn ("empty declaration"); }
;
+192
View File
@@ -0,0 +1,192 @@
--- gcc-3.4.6.orig/gcc/c-parse.y 2017-06-20 09:04:44.380935100 +0200
+++ gcc-3.4.6/gcc/c-parse.y 2016-10-15 16:46:07.900981000 +0200
@@ -29,7 +29,7 @@
/* To whomever it may concern: I have heard that such a thing was once
written by AT&T, but I have never seen it. */
-%expect 10 /* shift/reduce conflicts, and no reduce/reduce conflicts. */
+%expect 11 /* shift/reduce conflicts, and no reduce/reduce conflicts. */
%{
#include "config.h"
@@ -232,6 +232,11 @@
%{
+
+#ifndef YYLEX
+#define YYLEX yylex()
+#endif
+
/* Number of statements (loosely speaking) and compound statements
seen so far. */
static int stmt_count;
@@ -1647,7 +1652,7 @@
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
@@ -1658,7 +1663,7 @@
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)); }
@@ -1667,12 +1672,12 @@
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)); }
@@ -1839,20 +1844,25 @@
| 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
@@ -2451,33 +2461,37 @@
}
;
+/* 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
@@ -2488,29 +2502,33 @@
/* 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