OSDN Git Service

Treelang fixes including built failures on PPC and others.
authortimjosling <timjosling@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 9 May 2003 21:43:54 +0000 (21:43 +0000)
committertimjosling <timjosling@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 9 May 2003 21:43:54 +0000 (21:43 +0000)
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@66647 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/treelang/ChangeLog
gcc/treelang/Make-lang.in
gcc/treelang/parse.y
gcc/treelang/treelang.h
gcc/treelang/treetree.c

index 4ea22ae..2e3d1d7 100644 (file)
@@ -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.
index 8f3885a..0027eab 100644 (file)
@@ -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.
index bb530f9..5222a88 100644 (file)
@@ -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;
index abeeb1e..656f418 100644 (file)
@@ -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.  */
index 4ff2c2f..397f436 100644 (file)
@@ -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)