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]

[tree-ssa] fix alpha bootstrap


STMT_LINENO and C_EXP_ORIGINAL_CODE both use TREE_COMPLEXITY.
Setting the one clobbers the other, which leads to all sorts
of nastiness later.

Something about the alpha's glibc string.h macros differs from
those on x86, amd64, ppc and ia64, because this problem didn't
show up on any of those platforms.


r~


        * c-parse.in (primary): Use annotate_with_locus instead of
        STMT_LINENO for STMT_EXPR.
        * c-simplify.c (gimplify_stmt_expr): Likewise. 

Index: c-parse.in
===================================================================
RCS file: /cvs/gcc/gcc/gcc/c-parse.in,v
retrieving revision 1.144.2.25
diff -c -p -d -r1.144.2.25 c-parse.in
*** c-parse.in	4 Dec 2003 02:19:21 -0000	1.144.2.25
--- c-parse.in	4 Dec 2003 23:43:58 -0000
*************** primary:
*** 678,685 ****
  		  if (!last_expr_type)
  		    last_expr_type = void_type_node;
  		  $$ = build1 (STMT_EXPR, last_expr_type, $1);
- 		  STMT_LINENO ($$) = input_line;
  		  TREE_SIDE_EFFECTS ($$) = 1;
  		}
  	| compstmt_primary_start error ')'
  		{
--- 678,685 ----
  		  if (!last_expr_type)
  		    last_expr_type = void_type_node;
  		  $$ = build1 (STMT_EXPR, last_expr_type, $1);
  		  TREE_SIDE_EFFECTS ($$) = 1;
+ 		  annotate_with_locus ($$, input_location);
  		}
  	| compstmt_primary_start error ')'
  		{
Index: c-simplify.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/c-simplify.c,v
retrieving revision 1.1.4.85
diff -c -p -d -r1.1.4.85 c-simplify.c
*** c-simplify.c	4 Dec 2003 02:19:21 -0000	1.1.4.85
--- c-simplify.c	4 Dec 2003 23:43:58 -0000
*************** gimplify_stmt_expr (tree *expr_p)
*** 970,977 ****
  	      && VOID_TYPE_P (TREE_TYPE (last_stmt))))
  	{
  	  location_t loc;
! 	  loc.file = input_filename;
! 	  loc.line = STMT_LINENO (last_stmt ? last_stmt : *expr_p);
  	  warning ("%Hstatement-expressions should end with a "
  		   "non-void expression", &loc);
  	  last_expr = NULL_TREE;
--- 970,984 ----
  	      && VOID_TYPE_P (TREE_TYPE (last_stmt))))
  	{
  	  location_t loc;
! 	  if (last_stmt)
! 	    {
! 	      loc.file = input_filename;
! 	      loc.line = STMT_LINENO (last_stmt);
! 	    }
! 	  else if (EXPR_LOCUS (*expr_p))
! 	    loc = *EXPR_LOCUS (*expr_p);
! 	  else
! 	    loc = input_location;
  	  warning ("%Hstatement-expressions should end with a "
  		   "non-void expression", &loc);
  	  last_expr = NULL_TREE;


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