Treelang fixes committed

Tim Josling tej@melbpc.org.au
Sat Mar 1 12:00:00 GMT 2003


I am about to commit this fix, which I bootstrapped on i686-pc-linux-gnu and
ran make treelang.check OK.

The problem does not relate to the previous commit, but is is a long standing
incompatibility with bison 1.75.

Andreas please let me know if this fixes the problem,

Tim Josling

diff -c -r1.25 ChangeLog
*** gcc/gcc/treelang/ChangeLog  1 Mar 2003 02:05:37 -0000       1.25
--- gcc/gcc/treelang/ChangeLog  1 Mar 2003 11:20:26 -0000
***************
*** 1,3 ****
--- 1,12 ----
+ 2003-03-01  Tim Josling  <tej@melbpc.org.au>
+ 
+         Name clashes with rtl.h fixed.
+       
+       * lex.l: Tokens PLUS, MINUS, RETURN changed to tl_PLUS tl_MINUS
+       tl_RETURN.
+ 
+       * parse.y: Ditto.       
+       




Andreas Jaeger wrote:
> 
> Tim Josling <tej@melbpc.org.au> writes:
> 
> > I posted the patch a few days ago, just committed it now,
> 
> Not a good idea, bootstrap fails with current CVS now on
> i686-linux-gnu:
> 
> stage1/xgcc -Bstage1/ -B/opt/gcc/3.4-devel/i686-pc-linux-gnu/bin/ -c   -g -O2 -D
> IN_GCC   -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -W -W
> all -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -pedantic -Wno-long
> -long -Wmissing-prototypes -Wmissing-declarations -fno-common -Werror   -DHAVE_C
> ONFIG_H    -I. -Itreelang -I/cvs/gcc/gcc -I/cvs/gcc/gcc/treelang -I/cvs/gcc/gcc/
> config -I/cvs/gcc/gcc/../include /cvs/gcc/gcc/treelang/treetree.c -o treelang/tr
> eetree.o
> In file included from /cvs/gcc/gcc/treelang/treetree.c:76:
> /cvs/gcc/gcc/treelang/parse.h:46: error: conflicting types for `PLUS'
> /cvs/gcc/gcc/rtl.def:928: error: previous declaration of `PLUS'
> /cvs/gcc/gcc/treelang/parse.h:47: error: conflicting types for `MINUS'
> /cvs/gcc/gcc/rtl.def:931: error: previous declaration of `MINUS'
> /cvs/gcc/gcc/treelang/parse.h:51: error: conflicting types for `RETURN'
> /cvs/gcc/gcc/rtl.def:761: error: previous declaration of `RETURN'
> /cvs/gcc/gcc/treelang/parse.h:74: internal compiler error: Segmentation fault
> Please submit a full bug report,
> with preprocessed source if appropriate.
> See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions.
> 
> Andreas
> --
>  Andreas Jaeger
>   SuSE Labs aj@suse.de
>    private aj@arthur.inka.de
>     http://www.suse.de/~aj
-------------- next part --------------
? gcc/Makefile.in.tim
? gcc/gcc/Makefile.in.tim
Index: gcc/gcc/treelang/ChangeLog
===================================================================
RCS file: /cvs/gcc/gcc/gcc/treelang/ChangeLog,v
retrieving revision 1.25
diff -c -r1.25 ChangeLog
*** gcc/gcc/treelang/ChangeLog	1 Mar 2003 02:05:37 -0000	1.25
--- gcc/gcc/treelang/ChangeLog	1 Mar 2003 11:20:26 -0000
***************
*** 1,3 ****
--- 1,12 ----
+ 2003-03-01  Tim Josling  <tej@melbpc.org.au>
+ 
+         Name clashes with rtl.h fixed.
+ 	
+ 	* lex.l: Tokens PLUS, MINUS, RETURN changed to tl_PLUS tl_MINUS
+ 	tl_RETURN.
+ 
+ 	* parse.y: Ditto.	
+ 	
  2003-02-24  Tim Josling  <tej@melbpc.org.au>
  
  	* parse.y (my_yylex): New - ensure lexer time is charged to
Index: gcc/gcc/treelang/lex.l
===================================================================
RCS file: /cvs/gcc/gcc/gcc/treelang/lex.l,v
retrieving revision 1.5
diff -c -r1.5 lex.l
*** gcc/gcc/treelang/lex.l	1 Mar 2003 02:05:37 -0000	1.5
--- gcc/gcc/treelang/lex.l	1 Mar 2003 11:20:26 -0000
***************
*** 122,133 ****
    
  "+" {
    update_lineno_charno ();
!   SAVE_RETURN (PLUS);
  }
    
  "-" {
    update_lineno_charno ();
!   SAVE_RETURN (MINUS);
  }
    
  "=" {
--- 122,133 ----
    
  "+" {
    update_lineno_charno ();
!   SAVE_RETURN (tl_PLUS);
  }
    
  "-" {
    update_lineno_charno ();
!   SAVE_RETURN (tl_MINUS);
  }
    
  "=" {
***************
*** 187,193 ****
    
  "return" {
    update_lineno_charno ();
!   SAVE_RETURN (RETURN);
  }
    
  "if" {
--- 187,193 ----
    
  "return" {
    update_lineno_charno ();
!   SAVE_RETURN (tl_RETURN);
  }
    
  "if" {
Index: gcc/gcc/treelang/parse.y
===================================================================
RCS file: /cvs/gcc/gcc/gcc/treelang/parse.y,v
retrieving revision 1.5
diff -c -r1.5 parse.y
*** gcc/gcc/treelang/parse.y	1 Mar 2003 02:05:37 -0000	1.5
--- gcc/gcc/treelang/parse.y	1 Mar 2003 11:20:27 -0000
***************
*** 106,113 ****
  %token COMMA
  %right EQUALS
  %right ASSIGN
! %left  PLUS
! %left  MINUS
  
  /* Literals.  */
  %token INTEGER
--- 106,113 ----
  %token COMMA
  %right EQUALS
  %right ASSIGN
! %left  tl_PLUS
! %left  tl_MINUS
  
  /* Literals.  */
  %token INTEGER
***************
*** 115,121 ****
  /* Keywords.  */
  %token IF
  %token ELSE
! %token RETURN
  %token CHAR
  %token INT
  %token UNSIGNED
--- 115,121 ----
  /* Keywords.  */
  %token IF
  %token ELSE
! %token tl_RETURN
  %token CHAR
  %token INT
  %token UNSIGNED
***************
*** 505,511 ****
  
  
  return:
! RETURN expression_opt {
    struct prod_token_parm_item *type_prod;
    struct prod_token_parm_item* ret_tok;
    ret_tok = $1;
--- 505,511 ----
  
  
  return:
! tl_RETURN expression_opt {
    struct prod_token_parm_item *type_prod;
    struct prod_token_parm_item* ret_tok;
    ret_tok = $1;
***************
*** 568,574 ****
  |variable_ref {
    $$ = $1;
  }
! |expression PLUS expression {
    struct prod_token_parm_item* tok;
    struct prod_token_parm_item *prod;
    struct prod_token_parm_item *op1;
--- 568,574 ----
  |variable_ref {
    $$ = $1;
  }
! |expression tl_PLUS expression {
    struct prod_token_parm_item* tok;
    struct prod_token_parm_item *prod;
    struct prod_token_parm_item *op1;
***************
*** 597,603 ****
      }
    $$ = prod;
  }
! |expression MINUS expression %prec PLUS {
    struct prod_token_parm_item* tok;
    struct prod_token_parm_item *prod;
    struct prod_token_parm_item *op1;
--- 597,603 ----
      }
    $$ = prod;
  }
! |expression tl_MINUS expression %prec tl_PLUS {
    struct prod_token_parm_item* tok;
    struct prod_token_parm_item *prod;
    struct prod_token_parm_item *op1;


More information about the Gcc-patches mailing list