diff options
author | Tim Josling <tej@melbpc.org.au> | 2003-05-09 21:43:54 +0000 |
---|---|---|
committer | Tim Josling <timjosling@gcc.gnu.org> | 2003-05-09 21:43:54 +0000 |
commit | 886c07bcc7d1cd0d7159dcba88df6161b7f4b156 (patch) | |
tree | 8439fc0e799f5fba76ae0d889da6cc9b6918f57b /gcc | |
parent | 1476c9d9eeea8d3401ee864a3f3eeb2b1e6e0ccb (diff) | |
download | gcc-886c07bcc7d1cd0d7159dcba88df6161b7f4b156.zip gcc-886c07bcc7d1cd0d7159dcba88df6161b7f4b156.tar.gz gcc-886c07bcc7d1cd0d7159dcba88df6161b7f4b156.tar.bz2 |
Treelang fixes including built failures on PPC and others.
From-SVN: r66647
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/treelang/ChangeLog | 15 | ||||
-rw-r--r-- | gcc/treelang/Make-lang.in | 2 | ||||
-rw-r--r-- | gcc/treelang/parse.y | 6 | ||||
-rw-r--r-- | gcc/treelang/treelang.h | 6 | ||||
-rw-r--r-- | gcc/treelang/treetree.c | 10 |
5 files changed, 31 insertions, 8 deletions
diff --git a/gcc/treelang/ChangeLog b/gcc/treelang/ChangeLog index 4ea22aea..2e3d1d7 100644 --- a/gcc/treelang/ChangeLog +++ b/gcc/treelang/ChangeLog @@ -1,3 +1,18 @@ +2003-05-09 Tim Josling <tej@melbpc.org.au> + + * Make-lang.in (TREE_BE_LIBS): Add C_TARGET_OBJS to object files + to link (needed by some front ends such as PPC). + + * treetree.c (tree_code_create_function_initial): Fix long line. + Initialize tree_code_int_size and tree_code_char_size to + meaningful values. + (tree_code_get_numeric_type): Add check that size1 parameter is + valid. + + * parse.y: Fix extra long lines in prototypes. + + * treelang.h: Fix extra long lines in macro definitions. + 2003-05-07 Zack Weinberg <zack@codesourcery.com> * Make-lang.in: Set -Wno-error for treelang/lex.o. diff --git a/gcc/treelang/Make-lang.in b/gcc/treelang/Make-lang.in index 8f3885a..0027eab 100644 --- a/gcc/treelang/Make-lang.in +++ b/gcc/treelang/Make-lang.in @@ -47,7 +47,7 @@ TREELANGSED = sed TREELANGSEDFLAGS = -n # back end compiler libraries etc -TREE_BE_LIBS = $(BACKEND) $(LIBIBERTY) $(INTLLIBS) $(LIBS) $(LIBDEPS) +TREE_BE_LIBS = $(C_TARGET_OBJS) $(BACKEND) $(LIBIBERTY) $(INTLLIBS) $(LIBS) $(LIBDEPS) GCC_EXTRAS = -B./ -B$(build_tooldir)/bin/ -isystem $(build_tooldir)/include # ./xgcc is the just built compiler. See GCC_FOR_TARGET in the GCC Makefile.in. diff --git a/gcc/treelang/parse.y b/gcc/treelang/parse.y index bb530f9..5222a88 100644 --- a/gcc/treelang/parse.y +++ b/gcc/treelang/parse.y @@ -81,7 +81,8 @@ void print_token (FILE * file, unsigned int type ATTRIBUTE_UNUSED, YYSTYPE value static struct prod_token_parm_item *reverse_prod_list (struct prod_token_parm_item *old_first); static void ensure_not_void (unsigned int type, struct prod_token_parm_item* name); static int check_type_match (int type_num, struct prod_token_parm_item *exp); -static int get_common_type (struct prod_token_parm_item *type1, struct prod_token_parm_item *type2); +static int get_common_type (struct prod_token_parm_item *type1, + struct prod_token_parm_item *type2); static struct prod_token_parm_item *make_integer_constant (struct prod_token_parm_item* value); static struct prod_token_parm_item *make_plus_expression (struct prod_token_parm_item* tok, struct prod_token_parm_item* op1, @@ -306,7 +307,8 @@ storage typename NAME LEFT_PARENTHESIS parameters RIGHT_PARENTHESIS SEMICOLON { abort (); this_parms->tp.par.variable_name = this_parm_var->tp.pro.main_token->tp.tok.chars; this_parms->category = parameter_category; - this_parms->type = NUMERIC_TYPE (( (struct prod_token_parm_item*)EXPRESSION_TYPE (this_parm_var))); + this_parms->type = NUMERIC_TYPE + (( (struct prod_token_parm_item*)EXPRESSION_TYPE (this_parm_var))); if (last_parms) { last_parms->tp.par.next = this_parms; diff --git a/gcc/treelang/treelang.h b/gcc/treelang/treelang.h index abeeb1e..656f418 100644 --- a/gcc/treelang/treelang.h +++ b/gcc/treelang/treelang.h @@ -62,7 +62,8 @@ struct token_part GTY(()) /* Definitions for fields in production. */ #define NESTING_LEVEL(a) a->tp.pro.info[0] /* Level used for variable definitions. */ -#define NUMERIC_TYPE(a) a->tp.pro.info[1] /* Numeric type used in type definitions and expressions. */ +/* Numeric type used in type definitions and expressions. */ +#define NUMERIC_TYPE(a) a->tp.pro.info[1] #define SUB_COUNT 5 #define SYMBOL_TABLE_NAME(a) (a->tp.pro.sub[0]) /* Name token. */ #define EXPRESSION_TYPE(a) (a->tp.pro.sub[1]) /* Type identifier. */ @@ -71,7 +72,8 @@ struct token_part GTY(()) #define VARIABLE(a) (a->tp.pro.sub[2]) /* Parameter variable ptr. */ #define VAR_INIT(a) (a->tp.pro.sub[2]) /* Variable init. */ #define OP2(a) (a->tp.pro.sub[3]) /* Exp operand2. */ -#define FIRST_PARMS(a) (a->tp.pro.sub[3]) /* Function parameters linked via struct tree_parameter_list. */ +/* Function parameters linked via struct tree_parameter_list. */ +#define FIRST_PARMS(a) (a->tp.pro.sub[3]) #define OP3(a) (a->tp.pro.sub[4]) /* Exp operand3. */ #define STORAGE_CLASS_TOKEN(a) (a->tp.pro.sub[4]) /* Storage class token. */ #define STORAGE_CLASS(a) a->tp.pro.flag1 /* Values in treetree.h. */ diff --git a/gcc/treelang/treetree.c b/gcc/treelang/treetree.c index 4ff2c2f..397f436 100644 --- a/gcc/treelang/treetree.c +++ b/gcc/treelang/treetree.c @@ -143,8 +143,9 @@ const char *const tree_code_name[] = { /* Number of bits in int and char - accessed by front end. */ -unsigned int tree_code_int_size = 0; -unsigned int tree_code_char_size = 0; +unsigned int tree_code_int_size = SIZEOF_INT * HOST_BITS_PER_CHAR; + +unsigned int tree_code_char_size = HOST_BITS_PER_CHAR; /* Return the tree stuff for this type TYPE_NUM. */ @@ -327,7 +328,8 @@ tree_code_create_function_initial (tree prev_saved, /* Prepare creation of rtl for a new function. */ - resultdecl = DECL_RESULT (fn_decl) = build_decl (RESULT_DECL, NULL_TREE, TREE_TYPE (TREE_TYPE (fn_decl))); + resultdecl = DECL_RESULT (fn_decl) + = build_decl (RESULT_DECL, NULL_TREE, TREE_TYPE (TREE_TYPE (fn_decl))); DECL_CONTEXT (DECL_RESULT (fn_decl)) = fn_decl; DECL_SOURCE_LOCATION (resultdecl) = loc; @@ -779,6 +781,8 @@ tree tree_code_get_numeric_type (unsigned int size1, unsigned int sign1) { tree ret1; + if (!size1) + abort (); if (size1 == tree_code_int_size) { if (sign1) |