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] Bring IA64 closer to bootstrap


When folding 'memcpy (dest, "", 0);' to 'dest' we were creating a
statement consisting of just a VAR_DECL.  This patch detects the
situation and converts the statement into a NOP.

This allows IA64 to bootstrap the compiler but we still ICE while
building libjava.  I think the libjava failure is due to the tree
recombination pass.  I've asked Andrew about it, so it should be fixed
shortly.


Diego.


	* tree-ssa-ccp.c (set_rhs): Replace with an empty statement when
	the replacement has no side effects.

Index: tree-ssa-ccp.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-ssa-ccp.c,v
retrieving revision 1.1.2.113
diff -d -c -p -r1.1.2.113 tree-ssa-ccp.c
*** tree-ssa-ccp.c	19 Nov 2003 20:10:01 -0000	1.1.2.113
--- tree-ssa-ccp.c	20 Nov 2003 19:06:26 -0000
*************** set_rhs (tree *stmt_p, tree expr)
*** 1950,1957 ****
      LABEL_EXPR_LABEL (stmt) = expr;
    else
      {
        stmt_ann_t ann = stmt_ann (stmt);
!       *stmt_p = expr;
        (*stmt_p)->common.ann = (tree_ann) ann;
      }
  }
--- 1950,1959 ----
      LABEL_EXPR_LABEL (stmt) = expr;
    else
      {
+       /* Replace the whole statement with EXPR.  If EXPR has no side
+ 	 effects, then replace *STMT_P with an empty statement.  */
        stmt_ann_t ann = stmt_ann (stmt);
!       *stmt_p = TREE_SIDE_EFFECTS (expr) ? expr : build_empty_stmt ();
        (*stmt_p)->common.ann = (tree_ann) ann;
      }
  }



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