This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Patch] Treelang misc fixes including ppc build failure


Various treelang fixes.

Includes a fix for PPC build failure (and probably several other architectures as well).

I will apply in the morning assuming my bootstrap on i686-pc-linux-gnu and treelang.check go OK again.

The PPC problem was a symptom of the 'using C/Objc/C++ language code' issue. I am looking at tree-ssa which may provide solution to this.

Tim Josling

Matthias,
Could you let me know if this does indeed fix the ppc build failure.
Tim


+ 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. +
Index: gcc/gcc/treelang/ChangeLog
===================================================================
RCS file: /cvs/gcc/gcc/gcc/treelang/ChangeLog,v
retrieving revision 1.39
diff -c -r1.39 ChangeLog
*** gcc/gcc/treelang/ChangeLog	7 May 2003 21:14:48 -0000	1.39
--- gcc/gcc/treelang/ChangeLog	9 May 2003 11:37:45 -0000
***************
*** 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: gcc/gcc/treelang/Make-lang.in
===================================================================
RCS file: /cvs/gcc/gcc/gcc/treelang/Make-lang.in,v
retrieving revision 1.21
diff -c -r1.21 Make-lang.in
*** gcc/gcc/treelang/Make-lang.in	7 May 2003 21:14:48 -0000	1.21
--- gcc/gcc/treelang/Make-lang.in	9 May 2003 11:37:47 -0000
***************
*** 47,53 ****
  TREELANGSEDFLAGS = -n
  
  # back end compiler libraries etc
! TREE_BE_LIBS = $(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.
--- 47,53 ----
  TREELANGSEDFLAGS = -n
  
  # back end compiler libraries etc
! 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: gcc/gcc/treelang/parse.y
===================================================================
RCS file: /cvs/gcc/gcc/gcc/treelang/parse.y,v
retrieving revision 1.8
diff -c -r1.8 parse.y
*** gcc/gcc/treelang/parse.y	6 May 2003 09:18:46 -0000	1.8
--- gcc/gcc/treelang/parse.y	9 May 2003 11:37:47 -0000
***************
*** 81,87 ****
  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 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,
--- 81,88 ----
  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 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,312 ****
          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)));
        if (last_parms)
          {
            last_parms->tp.par.next = this_parms;
--- 307,314 ----
          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)));
        if (last_parms)
          {
            last_parms->tp.par.next = this_parms;
Index: gcc/gcc/treelang/treelang.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/treelang/treelang.h,v
retrieving revision 1.5
diff -c -r1.5 treelang.h
*** gcc/gcc/treelang/treelang.h	6 May 2003 09:18:46 -0000	1.5
--- gcc/gcc/treelang/treelang.h	9 May 2003 11:37:49 -0000
***************
*** 62,68 ****
  
  /* 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.  */
  #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.  */
--- 62,69 ----
  
  /* Definitions for fields in production.  */
  #define NESTING_LEVEL(a) a->tp.pro.info[0]  /* Level used for variable definitions.  */
! /* 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,77 ****
  #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.  */
  #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.  */
--- 72,79 ----
  #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.  */
! /* 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: gcc/gcc/treelang/treetree.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/treelang/treetree.c,v
retrieving revision 1.20
diff -c -r1.20 treetree.c
*** gcc/gcc/treelang/treetree.c	6 May 2003 09:18:46 -0000	1.20
--- gcc/gcc/treelang/treetree.c	9 May 2003 11:37:51 -0000
***************
*** 143,150 ****
  
  /* 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;
  
  /* Return the tree stuff for this type TYPE_NUM.  */
  
--- 143,151 ----
  
  /* Number of bits in int and char - accessed by front end.  */
  
! 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,333 ****
  
    /* 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)));
    DECL_CONTEXT (DECL_RESULT (fn_decl)) = fn_decl;
    DECL_SOURCE_LOCATION (resultdecl) = loc;
  
--- 328,335 ----
  
    /* 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)));
    DECL_CONTEXT (DECL_RESULT (fn_decl)) = fn_decl;
    DECL_SOURCE_LOCATION (resultdecl) = loc;
  
***************
*** 779,784 ****
--- 781,788 ----
  tree_code_get_numeric_type (unsigned int size1, unsigned int sign1)
  {
    tree ret1;
+   if (!size1)
+     abort ();
    if (size1 == tree_code_int_size)
      {
        if (sign1)

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]