[PATCH][tuples] Tuplify FRE/PRE

Richard Guenther rguenther@suse.de
Mon Jul 14 14:17:00 GMT 2008


This patch tuplifies FRE/PRE.  It includes the PRE fixes from the
trunk which made the earlier libcpp miscompile go away.  Parts of
the patch are appropriate for trunk as well, I am testing a
patch and commit them there.

Bootstrapped and tested on x86_64-unknown-linux-gnu with 
--disable-libcxx-pch.

Now the unfortunate thing is that pch generation is broken by

*************** process_scc (VEC (tree, heap) *scc)
*** 2357,2362 ****
--- 2391,2398 ----
          empty_alloc_pool (optimistic_info->phis_pool);
          empty_alloc_pool (optimistic_info->references_pool);
          for (i = 0; VEC_iterate (tree, scc, i, var); i++)
+           VN_INFO (var)->expr = NULL_TREE;
+         for (i = 0; VEC_iterate (tree, scc, i, var); i++)
            changed |= visit_use (var);
        }

(reproducible on the trunk as well with that change), but without
that we miscompile genmodes - the above change is correct and somehow
triggers the latent issue.

You can also see this in the number of failures in the pch 
testsuite.  (results attached)

IMHO we should try to go forward with FRE/PRE and disable pch
generation on the branch for now to make bootstrap succeed.

Any other opinions?

Thanks,
Richard.

2008-07-09  Richard Guenther  <rguenther@suse.de>

	* tree-ssa-pre.c: Tuplify.  Enable FRE and PRE.
	(execute_pre): Disable SCCVN insertion even for FRE.
	* tree-ssa-sccvn.h (copy_reference_ops_from_call): Declare.
	* tree-ssa-sccvn.c (copy_reference_ops_from_call): Export.
	(vn_get_expr_for): Handle more expression kinds.
	(visit_reference_op_load): Properly set a value id for
	inserted names.
	(simplify_binary_expression): Use valid_gimple_rhs_p instead of
	valid_gimple_expression_p.
	(simplify_unary_expression): Likewise.
	(process_scc): Clear the cached/simplified expressions at the
	start of the iteration.
	(free_scc_vn): Do not clear SSA_NAME_VALUE.
	(run_scc_vn): Remove broken special case in printing VNs.
	* tree-ssa-propagate.c (valid_gimple_rhs_p): Allow
	gimple-min-invariants and SSA names.

Index: gimple-tuples-branch/gcc/tree-ssa-pre.c
===================================================================
*** gimple-tuples-branch.orig/gcc/tree-ssa-pre.c	2008-07-14 11:11:52.000000000 +0200
--- gimple-tuples-branch/gcc/tree-ssa-pre.c	2008-07-14 14:39:55.000000000 +0200
*************** along with GCC; see the file COPYING3.
*** 48,55 ****
  #include "params.h"
  #include "dbgcnt.h"
  
- /* FIXME tuples.  */
- #if 0
  /* TODO:
  
     1. Avail sets can be shared by making an avail_find_leader that
--- 48,53 ----
*************** static struct
*** 424,430 ****
  } pre_stats;
  
  static bool do_partial_partial;
! static pre_expr bitmap_find_leader (bitmap_set_t, unsigned int , tree);
  static void bitmap_value_insert_into_set (bitmap_set_t, pre_expr);
  static void bitmap_value_replace_in_set (bitmap_set_t, pre_expr);
  static void bitmap_set_copy (bitmap_set_t, bitmap_set_t);
--- 422,428 ----
  } pre_stats;
  
  static bool do_partial_partial;
! static pre_expr bitmap_find_leader (bitmap_set_t, unsigned int, gimple);
  static void bitmap_value_insert_into_set (bitmap_set_t, pre_expr);
  static void bitmap_value_replace_in_set (bitmap_set_t, pre_expr);
  static void bitmap_set_copy (bitmap_set_t, bitmap_set_t);
*************** static bool bitmap_set_contains_value (b
*** 432,440 ****
  static void bitmap_insert_into_set (bitmap_set_t, pre_expr);
  static void bitmap_insert_into_set_1 (bitmap_set_t, pre_expr, bool);
  static bitmap_set_t bitmap_set_new (void);
! static tree create_expression_by_pieces (basic_block, pre_expr, tree, tree,
! 					 tree);
! static tree find_or_generate_expression (basic_block, pre_expr, tree, tree);
  
  /* We can add and remove elements and entries to and from sets
     and hash tables, so we use alloc pools for them.  */
--- 430,439 ----
  static void bitmap_insert_into_set (bitmap_set_t, pre_expr);
  static void bitmap_insert_into_set_1 (bitmap_set_t, pre_expr, bool);
  static bitmap_set_t bitmap_set_new (void);
! static tree create_expression_by_pieces (basic_block, pre_expr, gimple_seq *,
! 					 gimple, tree);
! static tree find_or_generate_expression (basic_block, pre_expr, gimple_seq *,
! 					 gimple);
  
  /* We can add and remove elements and entries to and from sets
     and hash tables, so we use alloc pools for them.  */
*************** fully_constant_expression (pre_expr e)
*** 1070,1077 ****
  	      tree const1 = get_constant_for_value_id (vrep1);
  	      tree result = NULL;
  	      if (const0 && const1)
! 		result = fold_binary (nary->opcode, nary->type, const0,
! 				      const1);
  	      if (result && is_gimple_min_invariant (result))
  		return get_or_alloc_expr_for_constant (result);
  	      return e;
--- 1069,1080 ----
  	      tree const1 = get_constant_for_value_id (vrep1);
  	      tree result = NULL;
  	      if (const0 && const1)
! 		{
! 		  const0 = fold_convert (TREE_TYPE (naryop0), const0);
! 		  const1 = fold_convert (TREE_TYPE (naryop1), const1);
! 		  result = fold_binary (nary->opcode, nary->type, const0,
! 					const1);
! 		}
  	      if (result && is_gimple_min_invariant (result))
  		return get_or_alloc_expr_for_constant (result);
  	      return e;
*************** fully_constant_expression (pre_expr e)
*** 1086,1092 ****
  	      tree const0 = get_constant_for_value_id (vrep0);
  	      tree result = NULL;
  	      if (const0)
! 		result = fold_unary (nary->opcode, nary->type, const0);
  	      if (result && is_gimple_min_invariant (result))
  		return get_or_alloc_expr_for_constant (result);
  	      return e;
--- 1089,1098 ----
  	      tree const0 = get_constant_for_value_id (vrep0);
  	      tree result = NULL;
  	      if (const0)
! 		{
! 		  const0 = fold_convert (TREE_TYPE (naryop0), const0);
! 		  result = fold_unary (nary->opcode, nary->type, const0);
! 		}
  	      if (result && is_gimple_min_invariant (result))
  		return get_or_alloc_expr_for_constant (result);
  	      return e;
*************** translate_vuses_through_block (VEC (tree
*** 1116,1123 ****
  
    for (i = 0; VEC_iterate (tree, vuses, i, oldvuse); i++)
      {
!       tree phi = SSA_NAME_DEF_STMT (oldvuse);
!       if (TREE_CODE (phi) == PHI_NODE
  	  && gimple_bb (phi) == phiblock)
  	{
  	  edge e = find_edge (block, gimple_bb (phi));
--- 1122,1129 ----
  
    for (i = 0; VEC_iterate (tree, vuses, i, oldvuse); i++)
      {
!       gimple phi = SSA_NAME_DEF_STMT (oldvuse);
!       if (gimple_code (phi) == GIMPLE_PHI
  	  && gimple_bb (phi) == phiblock)
  	{
  	  edge e = find_edge (block, gimple_bb (phi));
*************** find_leader_in_sets (unsigned int val, b
*** 1154,1162 ****
  {
    pre_expr result;
  
!   result = bitmap_find_leader (set1, val, NULL_TREE);
    if (!result && set2)
!     result = bitmap_find_leader (set2, val, NULL_TREE);
    return result;
  }
  
--- 1160,1168 ----
  {
    pre_expr result;
  
!   result = bitmap_find_leader (set1, val, NULL);
    if (!result && set2)
!     result = bitmap_find_leader (set2, val, NULL);
    return result;
  }
  
*************** get_representative_for (const pre_expr e
*** 1255,1261 ****
        get_var_ann (pretemp);
      }
  
!   name = make_ssa_name (pretemp, build_empty_stmt ());
    VN_INFO_GET (name)->value_id = value_id;
    if (e->kind == CONSTANT)
      VN_INFO (name)->valnum = PRE_EXPR_CONSTANT (e);
--- 1261,1267 ----
        get_var_ann (pretemp);
      }
  
!   name = make_ssa_name (pretemp, gimple_build_nop ());
    VN_INFO_GET (name)->value_id = value_id;
    if (e->kind == CONSTANT)
      VN_INFO (name)->valnum = PRE_EXPR_CONSTANT (e);
*************** phi_translate_1 (pre_expr expr, bitmap_s
*** 1401,1408 ****
  		if (constant != expr)
  		  return constant;
  		get_or_alloc_expression_id (expr);
- 		add_to_value (new_val_id, expr);
  	      }
  	  }
  	phi_trans_add (oldexpr, expr, pred);
  	return expr;
--- 1407,1414 ----
  		if (constant != expr)
  		  return constant;
  		get_or_alloc_expression_id (expr);
  	      }
+ 	    add_to_value (new_val_id, expr);
  	  }
  	phi_trans_add (oldexpr, expr, pred);
  	return expr;
*************** phi_translate_1 (pre_expr expr, bitmap_s
*** 1534,1541 ****
  						     result, new_val_id);
  		PRE_EXPR_REFERENCE (expr) = newref;
  		get_or_alloc_expression_id (expr);
- 		add_to_value (new_val_id, expr);
  	      }
  	  }
  	phi_trans_add (oldexpr, expr, pred);
  	return expr;
--- 1540,1547 ----
  						     result, new_val_id);
  		PRE_EXPR_REFERENCE (expr) = newref;
  		get_or_alloc_expression_id (expr);
  	      }
+ 	    add_to_value (new_val_id, expr);
  	  }
  	phi_trans_add (oldexpr, expr, pred);
  	return expr;
*************** phi_translate_1 (pre_expr expr, bitmap_s
*** 1543,1555 ****
        break;
      case NAME:
        {
! 	tree phi = NULL;
  	edge e;
  	gimple def_stmt;
  	tree name = PRE_EXPR_NAME (expr);
  
  	def_stmt = SSA_NAME_DEF_STMT (name);
! 	if (TREE_CODE (def_stmt) == PHI_NODE
  	    && gimple_bb (def_stmt) == phiblock)
  	  phi = def_stmt;
  	else
--- 1549,1561 ----
        break;
      case NAME:
        {
! 	gimple phi = NULL;
  	edge e;
  	gimple def_stmt;
  	tree name = PRE_EXPR_NAME (expr);
  
  	def_stmt = SSA_NAME_DEF_STMT (name);
! 	if (gimple_code (def_stmt) == GIMPLE_PHI
  	    && gimple_bb (def_stmt) == phiblock)
  	  phi = def_stmt;
  	else
*************** value_dies_in_block_x (pre_expr expr, ba
*** 1705,1715 ****
       rather than stores.  */
    for (i = 0; VEC_iterate (tree, vuses, i, vuse); i++)
      {
!       tree def = SSA_NAME_DEF_STMT (vuse);
  
        if (gimple_bb (def) != block)
  	continue;
!       if (TREE_CODE (def) == PHI_NODE)
  	continue;
        return true;
      }
--- 1711,1721 ----
       rather than stores.  */
    for (i = 0; VEC_iterate (tree, vuses, i, vuse); i++)
      {
!       gimple def = SSA_NAME_DEF_STMT (vuse);
  
        if (gimple_bb (def) != block)
  	continue;
!       if (gimple_code (def) == GIMPLE_PHI)
  	continue;
        return true;
      }
*************** can_value_number_call (gimple stmt)
*** 2325,2333 ****
     FILTER_EXPR or EXC_PTR_EXPR.  */
  
  static bool
! is_exception_related (tree op)
  {
!   return TREE_CODE (op) == FILTER_EXPR || TREE_CODE (op) == EXC_PTR_EXPR;
  }
  
  /* Return true if OP is a tree which we can perform PRE on
--- 2331,2341 ----
     FILTER_EXPR or EXC_PTR_EXPR.  */
  
  static bool
! is_exception_related (gimple stmt)
  {
!   return (gimple_code (stmt) == GIMPLE_ASSIGN
! 	  && (gimple_assign_rhs_code (stmt) == FILTER_EXPR
! 	      || gimple_assign_rhs_code (stmt) == EXC_PTR_EXPR));
  }
  
  /* Return true if OP is a tree which we can perform PRE on
*************** can_PRE_operation (tree op)
*** 2351,2362 ****
  /* Inserted expressions are placed onto this worklist, which is used
     for performing quick dead code elimination of insertions we made
     that didn't turn out to be necessary.   */
! static VEC(tree,heap) *inserted_exprs;
  
  /* Pool allocated fake store expressions are placed onto this
     worklist, which, after performing dead code elimination, is walked
     to see which expressions need to be put into GC'able memory  */
! static VEC(tree, heap) *need_creation;
  
  /* For COMPONENT_REF's and ARRAY_REF's, we can't have any intermediates for the
     COMPONENT_REF or INDIRECT_REF or ARRAY_REF portion, because we'd end up with
--- 2359,2370 ----
  /* Inserted expressions are placed onto this worklist, which is used
     for performing quick dead code elimination of insertions we made
     that didn't turn out to be necessary.   */
! static VEC(gimple,heap) *inserted_exprs;
  
  /* Pool allocated fake store expressions are placed onto this
     worklist, which, after performing dead code elimination, is walked
     to see which expressions need to be put into GC'able memory  */
! static VEC(gimple, heap) *need_creation;
  
  /* For COMPONENT_REF's and ARRAY_REF's, we can't have any intermediates for the
     COMPONENT_REF or INDIRECT_REF or ARRAY_REF portion, because we'd end up with
*************** static VEC(tree, heap) *need_creation;
*** 2374,2381 ****
  static tree
  create_component_ref_by_pieces (basic_block block, vn_reference_t ref,
  				unsigned int operand,
! 				tree stmts,
! 				tree domstmt,
  				bool in_call)
  {
    vn_reference_op_t currop = VEC_index (vn_reference_op_s, ref->operands,
--- 2382,2389 ----
  static tree
  create_component_ref_by_pieces (basic_block block, vn_reference_t ref,
  				unsigned int operand,
! 				gimple_seq *stmts,
! 				gimple domstmt,
  				bool in_call)
  {
    vn_reference_op_t currop = VEC_index (vn_reference_op_s, ref->operands,
*************** create_component_ref_by_pieces (basic_bl
*** 2398,2404 ****
  						      operand + 2 + i, stmts,
  						      domstmt, true);
  	  }
! 	folded = build_call_array (currop->type, declop->op0, nargs, args);
  	free (args);
  	return folded;
        }
--- 2406,2416 ----
  						      operand + 2 + i, stmts,
  						      domstmt, true);
  	  }
! 	folded = build_call_array (currop->type,
! 				   TREE_CODE (declop->op0) == FUNCTION_DECL
! 				   ? build_fold_addr_expr (declop->op0)
! 				   : declop->op0,
! 				   nargs, args);
  	free (args);
  	return folded;
        }
*************** create_component_ref_by_pieces (basic_bl
*** 2448,2457 ****
  	    if (!genop1)
  	      return NULL_TREE;
  	    genop1 = fold_convert (build_pointer_type (currop->type),
! 		genop1);
  
  	    folded = fold_build1 (currop->opcode, currop->type,
! 		genop1);
  	    return folded;
  	  }
        }
--- 2460,2469 ----
  	    if (!genop1)
  	      return NULL_TREE;
  	    genop1 = fold_convert (build_pointer_type (currop->type),
! 				   genop1);
  
  	    folded = fold_build1 (currop->opcode, currop->type,
! 				  genop1);
  	    return folded;
  	  }
        }
*************** create_component_ref_by_pieces (basic_bl
*** 2585,2592 ****
     on failure.  */
  
  static tree
! find_or_generate_expression (basic_block block, pre_expr expr, tree stmts,
! 			     tree domstmt)
  {
    pre_expr leader = bitmap_find_leader (AVAIL_OUT (block),
  					get_expr_value_id (expr), domstmt);
--- 2597,2604 ----
     on failure.  */
  
  static tree
! find_or_generate_expression (basic_block block, pre_expr expr,
! 			     gimple_seq *stmts, gimple domstmt)
  {
    pre_expr leader = bitmap_find_leader (AVAIL_OUT (block),
  					get_expr_value_id (expr), domstmt);
*************** find_or_generate_expression (basic_block
*** 2630,2636 ****
    return genop;
  }
  
! #define NECESSARY(stmt)		stmt->base.asm_written_flag
  
  /* Create an expression in pieces, so that we can handle very complex
     expressions that may be ANTIC, but not necessary GIMPLE.
--- 2642,2648 ----
    return genop;
  }
  
! #define NECESSARY GF_PLF_1
  
  /* Create an expression in pieces, so that we can handle very complex
     expressions that may be ANTIC, but not necessary GIMPLE.
*************** find_or_generate_expression (basic_block
*** 2651,2666 ****
     can return NULL_TREE to signal failure.  */
  
  static tree
! create_expression_by_pieces (basic_block block, pre_expr expr, tree stmts,
! 			     tree domstmt,
! 			     tree type)
  {
    tree temp, name;
!   tree folded, forced_stmts, newexpr;
    unsigned int value_id;
!   tree_stmt_iterator tsi;
    tree exprtype = type ? type : get_expr_type (expr);
    pre_expr nameexpr;
  
    switch (expr->kind)
      {
--- 2663,2679 ----
     can return NULL_TREE to signal failure.  */
  
  static tree
! create_expression_by_pieces (basic_block block, pre_expr expr,
! 			     gimple_seq *stmts, gimple domstmt, tree type)
  {
    tree temp, name;
!   tree folded, newexpr;
!   gimple_seq forced_stmts;
    unsigned int value_id;
!   gimple_stmt_iterator gsi;
    tree exprtype = type ? type : get_expr_type (expr);
    pre_expr nameexpr;
+   gimple newstmt;
  
    switch (expr->kind)
      {
*************** create_expression_by_pieces (basic_block
*** 2694,2703 ****
--- 2707,2719 ----
  							 stmts, domstmt);
  	      if (!genop1 || !genop2)
  		return NULL_TREE;
+ 	      genop1 = fold_convert (TREE_TYPE (nary->op[0]), genop1);
  	      /* Ensure op2 is a sizetype for POINTER_PLUS_EXPR.  It
  		 may be a constant with the wrong type.  */
  	      if (nary->opcode == POINTER_PLUS_EXPR)
  		genop2 = fold_convert (sizetype, genop2);
+ 	      else
+ 		genop2 = fold_convert (TREE_TYPE (nary->op[1]), genop2);
  	      folded = fold_build2 (nary->opcode, nary->type,
  				    genop1, genop2);
  	    }
*************** create_expression_by_pieces (basic_block
*** 2709,2714 ****
--- 2725,2731 ----
  							 stmts, domstmt);
  	      if (!genop1)
  		return NULL_TREE;
+ 	      genop1 = fold_convert (TREE_TYPE (nary->op[0]), genop1);
  	      folded = fold_build1 (nary->opcode, nary->type,
  				    genop1);
  	    }
*************** create_expression_by_pieces (basic_block
*** 2733,2746 ****
       to the value sets and chain them in the instruction stream.  */
    if (forced_stmts)
      {
!       tsi = tsi_start (forced_stmts);
!       for (; !tsi_end_p (tsi); tsi_next (&tsi))
  	{
! 	  tree stmt = tsi_stmt (tsi);
! 	  tree forcedname = GIMPLE_STMT_OPERAND (stmt, 0);
  	  pre_expr nameexpr;
  
! 	  VEC_safe_push (tree, heap, inserted_exprs, stmt);
  	  if (TREE_CODE (forcedname) == SSA_NAME)
  	    {
  	      VN_INFO_GET (forcedname)->valnum = forcedname;
--- 2750,2763 ----
       to the value sets and chain them in the instruction stream.  */
    if (forced_stmts)
      {
!       gsi = gsi_start (forced_stmts);
!       for (; !gsi_end_p (gsi); gsi_next (&gsi))
  	{
! 	  gimple stmt = gsi_stmt (gsi);
! 	  tree forcedname = gimple_get_lhs (stmt);
  	  pre_expr nameexpr;
  
! 	  VEC_safe_push (gimple, heap, inserted_exprs, stmt);
  	  if (TREE_CODE (forcedname) == SSA_NAME)
  	    {
  	      VN_INFO_GET (forcedname)->valnum = forcedname;
*************** create_expression_by_pieces (basic_block
*** 2752,2759 ****
  	    }
  	  mark_symbols_for_renaming (stmt);
  	}
!       tsi = tsi_last (stmts);
!       tsi_link_after (&tsi, forced_stmts, TSI_CONTINUE_LINKING);
      }
  
    /* Build and insert the assignment of the end result to the temporary
--- 2769,2775 ----
  	    }
  	  mark_symbols_for_renaming (stmt);
  	}
!       gimple_seq_add_seq (stmts, forced_stmts);
      }
  
    /* Build and insert the assignment of the end result to the temporary
*************** create_expression_by_pieces (basic_block
*** 2771,2787 ****
        || TREE_CODE (exprtype) == VECTOR_TYPE)
      DECL_GIMPLE_REG_P (temp) = 1;
  
!   newexpr = build_gimple_modify_stmt (temp, newexpr);
!   name = make_ssa_name (temp, newexpr);
!   GIMPLE_STMT_OPERAND (newexpr, 0) = name;
!   NECESSARY (newexpr) = 0;
! 
!   tsi = tsi_last (stmts);
!   tsi_link_after (&tsi, newexpr, TSI_CONTINUE_LINKING);
!   VEC_safe_push (tree, heap, inserted_exprs, newexpr);
  
    /* All the symbols in NEWEXPR should be put into SSA form.  */
!   mark_symbols_for_renaming (newexpr);
  
    /* Add a value number to the temporary.
       The value may already exist in either NEW_SETS, or AVAIL_OUT, because
--- 2787,2802 ----
        || TREE_CODE (exprtype) == VECTOR_TYPE)
      DECL_GIMPLE_REG_P (temp) = 1;
  
!   newstmt = gimple_build_assign (temp, newexpr);
!   name = make_ssa_name (temp, newstmt);
!   gimple_assign_set_lhs (newstmt, name);
!   gimple_set_plf (newstmt, NECESSARY, false);
! 
!   gimple_seq_add_stmt (stmts, newstmt);
!   VEC_safe_push (gimple, heap, inserted_exprs, newstmt);
  
    /* All the symbols in NEWEXPR should be put into SSA form.  */
!   mark_symbols_for_renaming (newstmt);
  
    /* Add a value number to the temporary.
       The value may already exist in either NEW_SETS, or AVAIL_OUT, because
*************** create_expression_by_pieces (basic_block
*** 2801,2807 ****
    if (dump_file && (dump_flags & TDF_DETAILS))
      {
        fprintf (dump_file, "Inserted ");
!       print_generic_expr (dump_file, newexpr, 0);
        fprintf (dump_file, " in predecessor %d\n", block->index);
      }
  
--- 2816,2822 ----
    if (dump_file && (dump_flags & TDF_DETAILS))
      {
        fprintf (dump_file, "Inserted ");
!       print_gimple_stmt (dump_file, newstmt, 0, 0);
        fprintf (dump_file, " in predecessor %d\n", block->index);
      }
  
*************** insert_into_preds_of_block (basic_block
*** 2829,2834 ****
--- 2844,2850 ----
    edge_iterator ei;
    tree type = get_expr_type (expr);
    tree temp;
+   gimple phi;
  
    if (dump_file && (dump_flags & TDF_DETAILS))
      {
*************** insert_into_preds_of_block (basic_block
*** 2860,2866 ****
    /* Make the necessary insertions.  */
    FOR_EACH_EDGE (pred, ei, block->preds)
      {
!       tree stmts = alloc_stmt_list ();
        tree builtexpr;
        bprime = pred->src;
        eprime = avail[bprime->index];
--- 2876,2882 ----
    /* Make the necessary insertions.  */
    FOR_EACH_EDGE (pred, ei, block->preds)
      {
!       gimple_seq stmts = NULL;
        tree builtexpr;
        bprime = pred->src;
        eprime = avail[bprime->index];
*************** insert_into_preds_of_block (basic_block
*** 2869,2878 ****
  	{
  	  builtexpr = create_expression_by_pieces (bprime,
  						   eprime,
! 						   stmts, NULL_TREE,
  						   type);
  	  gcc_assert (!(pred->flags & EDGE_ABNORMAL));
! 	  bsi_insert_on_edge (pred, stmts);
  	  avail[bprime->index] = get_or_alloc_expr_for_name (builtexpr);
  	  insertions = true;
  	}
--- 2885,2894 ----
  	{
  	  builtexpr = create_expression_by_pieces (bprime,
  						   eprime,
! 						   &stmts, NULL,
  						   type);
  	  gcc_assert (!(pred->flags & EDGE_ABNORMAL));
! 	  gsi_insert_seq_on_edge (pred, stmts);
  	  avail[bprime->index] = get_or_alloc_expr_for_name (builtexpr);
  	  insertions = true;
  	}
*************** insert_into_preds_of_block (basic_block
*** 2907,2924 ****
  			}
  		      if (stmts)
  			{
! 			  tree_stmt_iterator tsi;
! 			  tsi = tsi_start (stmts);
! 			  for (; !tsi_end_p (tsi); tsi_next (&tsi))
  			    {
! 			      tree stmt = tsi_stmt (tsi);
! 			      tree lhs = GIMPLE_STMT_OPERAND (stmt, 0);
! 			      VEC_safe_push (tree, heap, inserted_exprs, stmt);
! 			      NECESSARY (lhs) = 0;
  			    }
! 			  bsi_insert_on_edge (pred, stmts);
  			}
! 		      NECESSARY (forcedexpr) = 0;
  		      avail[bprime->index] = get_or_alloc_expr_for_name (forcedexpr);
  		    }
  		}
--- 2923,2940 ----
  			}
  		      if (stmts)
  			{
! 			  gimple_stmt_iterator gsi;
! 			  gsi = gsi_start (stmts);
! 			  for (; !gsi_end_p (gsi); gsi_next (&gsi))
  			    {
! 			      gimple stmt = gsi_stmt (gsi);
! 			      VEC_safe_push (gimple, heap, inserted_exprs, stmt);
! 			      gimple_set_plf (stmt, NECESSARY, false);
  			    }
! 			  gsi_insert_seq_on_edge (pred, stmts);
  			}
! 		      /* FIXME tuples
! 		      gimple_set_plf (forcedexpr, NECESSARY, false); */
  		      avail[bprime->index] = get_or_alloc_expr_for_name (forcedexpr);
  		    }
  		}
*************** insert_into_preds_of_block (basic_block
*** 2931,2948 ****
  	     our IL requires all operands of a phi node have the same
  	     type.  */
  	  tree name = PRE_EXPR_NAME (eprime);
! 	  if (TREE_TYPE (name) != type)
  	    {
  	      tree builtexpr;
  	      tree forcedexpr;
! 	      /* When eliminating casts through unions,
! 		 we sometimes want to convert a real to an integer,
! 		 which fold_convert will ICE on  */
! 	      if (fold_convertible_p (type, name))
! 		builtexpr = fold_convert (type, name);
! 	      else
! 		builtexpr = convert (type, name);
! 
  	      forcedexpr = force_gimple_operand (builtexpr,
  						 &stmts, true,
  						 NULL);
--- 2947,2957 ----
  	     our IL requires all operands of a phi node have the same
  	     type.  */
  	  tree name = PRE_EXPR_NAME (eprime);
! 	  if (!useless_type_conversion_p (type, TREE_TYPE (name)))
  	    {
  	      tree builtexpr;
  	      tree forcedexpr;
! 	      builtexpr = fold_convert (type, name);
  	      forcedexpr = force_gimple_operand (builtexpr,
  						 &stmts, true,
  						 NULL);
*************** insert_into_preds_of_block (basic_block
*** 2955,2972 ****
  
  	      if (stmts)
  		{
! 		  tree_stmt_iterator tsi;
! 		  tsi = tsi_start (stmts);
! 		  for (; !tsi_end_p (tsi); tsi_next (&tsi))
  		    {
! 		      tree stmt = tsi_stmt (tsi);
! 		      tree lhs = GIMPLE_STMT_OPERAND (stmt, 0);
! 		      VEC_safe_push (tree, heap, inserted_exprs, stmt);
! 		      NECESSARY (lhs) = 0;
  		    }
! 		  bsi_insert_on_edge (pred, stmts);
  		}
! 	      NECESSARY (forcedexpr) = 0;
  	      avail[bprime->index] = get_or_alloc_expr_for_name (forcedexpr);
  	    }
  	}
--- 2964,2981 ----
  
  	      if (stmts)
  		{
! 		  gimple_stmt_iterator gsi;
! 		  gsi = gsi_start (stmts);
! 		  for (; !gsi_end_p (gsi); gsi_next (&gsi))
  		    {
! 		      gimple stmt = gsi_stmt (gsi);
! 		      VEC_safe_push (gimple, heap, inserted_exprs, stmt);
! 		      gimple_set_plf (stmt, NECESSARY, false);
  		    }
! 		  gsi_insert_seq_on_edge (pred, stmts);
  		}
! 	      /* FIXME tuples
! 	      gimple_set_plf (forcedexpr, NECESSARY, false); */
  	      avail[bprime->index] = get_or_alloc_expr_for_name (forcedexpr);
  	    }
  	}
*************** insert_into_preds_of_block (basic_block
*** 2993,3016 ****
    if (TREE_CODE (type) == COMPLEX_TYPE
        || TREE_CODE (type) == VECTOR_TYPE)
      DECL_GIMPLE_REG_P (temp) = 1;
!   temp = create_phi_node (temp, block);
  
!   NECESSARY (temp) = 0;
!   VN_INFO_GET (PHI_RESULT (temp))->valnum = PHI_RESULT (temp);
!   VN_INFO (PHI_RESULT (temp))->value_id = val;
!   VEC_safe_push (tree, heap, inserted_exprs, temp);
    FOR_EACH_EDGE (pred, ei, block->preds)
      {
        pre_expr ae = avail[pred->src->index];
        gcc_assert (get_expr_type (ae) == type
  		  || useless_type_conversion_p (type, get_expr_type (ae)));
        if (ae->kind == CONSTANT)
! 	add_phi_arg (temp, PRE_EXPR_CONSTANT (ae), pred);
        else
! 	add_phi_arg (temp, PRE_EXPR_NAME (avail[pred->src->index]), pred);
      }
  
!   newphi = get_or_alloc_expr_for_name (PHI_RESULT (temp));
    add_to_value (val, newphi);
  
    /* The value should *not* exist in PHI_GEN, or else we wouldn't be doing
--- 3002,3025 ----
    if (TREE_CODE (type) == COMPLEX_TYPE
        || TREE_CODE (type) == VECTOR_TYPE)
      DECL_GIMPLE_REG_P (temp) = 1;
!   phi = create_phi_node (temp, block);
  
!   gimple_set_plf (phi, NECESSARY, false);
!   VN_INFO_GET (gimple_phi_result (phi))->valnum = gimple_phi_result (phi);
!   VN_INFO (gimple_phi_result (phi))->value_id = val;
!   VEC_safe_push (gimple, heap, inserted_exprs, phi);
    FOR_EACH_EDGE (pred, ei, block->preds)
      {
        pre_expr ae = avail[pred->src->index];
        gcc_assert (get_expr_type (ae) == type
  		  || useless_type_conversion_p (type, get_expr_type (ae)));
        if (ae->kind == CONSTANT)
! 	add_phi_arg (phi, PRE_EXPR_CONSTANT (ae), pred);
        else
! 	add_phi_arg (phi, PRE_EXPR_NAME (avail[pred->src->index]), pred);
      }
  
!   newphi = get_or_alloc_expr_for_name (gimple_phi_result (phi));
    add_to_value (val, newphi);
  
    /* The value should *not* exist in PHI_GEN, or else we wouldn't be doing
*************** insert_into_preds_of_block (basic_block
*** 3036,3042 ****
    if (dump_file && (dump_flags & TDF_DETAILS))
      {
        fprintf (dump_file, "Created phi ");
!       print_generic_expr (dump_file, temp, 0);
        fprintf (dump_file, " in block %d\n", block->index);
      }
    pre_stats.phis++;
--- 3045,3051 ----
    if (dump_file && (dump_flags & TDF_DETAILS))
      {
        fprintf (dump_file, "Created phi ");
!       print_gimple_stmt (dump_file, phi, 0, 0);
        fprintf (dump_file, " in block %d\n", block->index);
      }
    pre_stats.phis++;
*************** do_regular_insertion (basic_block block,
*** 3132,3138 ****
  	      eprime = fully_constant_expression (eprime);
  	      vprime = get_expr_value_id (eprime);
  	      edoubleprime = bitmap_find_leader (AVAIL_OUT (bprime),
! 						 vprime, NULL_TREE);
  	      if (edoubleprime == NULL)
  		{
  		  avail[bprime->index] = eprime;
--- 3141,3147 ----
  	      eprime = fully_constant_expression (eprime);
  	      vprime = get_expr_value_id (eprime);
  	      edoubleprime = bitmap_find_leader (AVAIL_OUT (bprime),
! 						 vprime, NULL);
  	      if (edoubleprime == NULL)
  		{
  		  avail[bprime->index] = eprime;
*************** do_partial_partial_insertion (basic_bloc
*** 3266,3272 ****
  	      eprime = fully_constant_expression (eprime);
  	      vprime = get_expr_value_id (eprime);
  	      edoubleprime = bitmap_find_leader (AVAIL_OUT (bprime),
! 						 vprime, NULL_TREE);
  	      if (edoubleprime == NULL)
  		{
  		  by_all = false;
--- 3275,3281 ----
  	      eprime = fully_constant_expression (eprime);
  	      vprime = get_expr_value_id (eprime);
  	      edoubleprime = bitmap_find_leader (AVAIL_OUT (bprime),
! 						 vprime, NULL);
  	      if (edoubleprime == NULL)
  		{
  		  by_all = false;
*************** add_to_exp_gen (basic_block block, tree
*** 3380,3390 ****
        result = get_or_alloc_expr_for_name (op);
        bitmap_value_insert_into_set (EXP_GEN (block), result);
        if (TREE_CODE (op) != SSA_NAME
! 	  || TREE_CODE (SSA_NAME_DEF_STMT (op)) != PHI_NODE)
  	bitmap_value_insert_into_set (maximal_set, result);
      }
  }
  
  /* For each real store operation of the form
     *a = <value> that we see, create a corresponding fake store of the
     form storetmp_<version> = *a.
--- 3389,3401 ----
        result = get_or_alloc_expr_for_name (op);
        bitmap_value_insert_into_set (EXP_GEN (block), result);
        if (TREE_CODE (op) != SSA_NAME
! 	  || gimple_code (SSA_NAME_DEF_STMT (op)) != GIMPLE_PHI)
  	bitmap_value_insert_into_set (maximal_set, result);
      }
  }
  
+ /* FIXME tuples */
+ #if 0
  /* For each real store operation of the form
     *a = <value> that we see, create a corresponding fake store of the
     form storetmp_<version> = *a.
*************** insert_fake_stores (void)
*** 3404,3413 ****
  
    FOR_ALL_BB (block)
      {
!       block_stmt_iterator bsi;
!       for (bsi = bsi_start (block); !bsi_end_p (bsi); bsi_next (&bsi))
  	{
! 	  tree stmt = bsi_stmt (bsi);
  
  	  /* We can't generate SSA names for stores that are complex
  	     or aggregate.  We also want to ignore things whose
--- 3415,3424 ----
  
    FOR_ALL_BB (block)
      {
!       gimple_stmt_iterator gsi;
!       for (gsi = gsi_start_bb (block); !gsi_end_p (gsi); gsi_next (&gsi))
  	{
! 	  gimple stmt = gsi_stmt (gsi);
  
  	  /* We can't generate SSA names for stores that are complex
  	     or aggregate.  We also want to ignore things whose
*************** insert_fake_stores (void)
*** 3452,3460 ****
  	      GIMPLE_STMT_OPERAND (new_tree, 0) = new_lhs;
  	      create_ssa_artificial_load_stmt (new_tree, stmt, false);
  
! 	      NECESSARY (new_tree) = 0;
! 	      VEC_safe_push (tree, heap, inserted_exprs, new_tree);
! 	      VEC_safe_push (tree, heap, need_creation, new_tree);
  	      bsi_insert_after (&bsi, new_tree, BSI_NEW_STMT);
  	    }
  	}
--- 3463,3471 ----
  	      GIMPLE_STMT_OPERAND (new_tree, 0) = new_lhs;
  	      create_ssa_artificial_load_stmt (new_tree, stmt, false);
  
! 	      gimple_set_plf (new_tree, NECESSARY, false);
! 	      VEC_safe_push (gimple, heap, inserted_exprs, new_tree);
! 	      VEC_safe_push (gimple, heap, need_creation, new_tree);
  	      bsi_insert_after (&bsi, new_tree, BSI_NEW_STMT);
  	    }
  	}
*************** realify_fake_stores (void)
*** 3471,3479 ****
    unsigned int i;
    tree stmt;
  
!   for (i = 0; VEC_iterate (tree, need_creation, i, stmt); i++)
      {
!       if (NECESSARY (stmt))
  	{
  	  block_stmt_iterator bsi, bsi2;
  	  tree rhs;
--- 3482,3490 ----
    unsigned int i;
    tree stmt;
  
!   for (i = 0; VEC_iterate (gimple, need_creation, i, stmt); i++)
      {
!       if (gimple_plf (stmt, NECESSARY))
  	{
  	  block_stmt_iterator bsi, bsi2;
  	  tree rhs;
*************** realify_fake_stores (void)
*** 3495,3507 ****
  	release_defs (stmt);
      }
  }
  
  /* Create value ids for PHI in BLOCK.  */
  
  static void
! make_values_for_phi (tree phi, basic_block block)
  {
!   tree result = PHI_RESULT (phi);
    /* We have no need for virtual phis, as they don't represent
       actual computations.  */
    if (is_gimple_reg (result))
--- 3506,3520 ----
  	release_defs (stmt);
      }
  }
+ #endif
  
  /* Create value ids for PHI in BLOCK.  */
  
  static void
! make_values_for_phi (gimple phi, basic_block block)
  {
!   tree result = gimple_phi_result (phi);
! 
    /* We have no need for virtual phis, as they don't represent
       actual computations.  */
    if (is_gimple_reg (result))
*************** compute_avail (void)
*** 3585,3592 ****
    /* Loop until the worklist is empty.  */
    while (sp)
      {
!       block_stmt_iterator bsi;
!       tree stmt, phi;
        basic_block dom;
        unsigned int stmt_uid = 1;
  
--- 3598,3605 ----
    /* Loop until the worklist is empty.  */
    while (sp)
      {
!       gimple_stmt_iterator gsi;
!       gimple stmt;
        basic_block dom;
        unsigned int stmt_uid = 1;
  
*************** compute_avail (void)
*** 3600,3620 ****
  	bitmap_set_copy (AVAIL_OUT (block), AVAIL_OUT (dom));
  
        /* Generate values for PHI nodes.  */
!       for (phi = phi_nodes (block); phi; phi = PHI_CHAIN (phi))
! 	make_values_for_phi (phi, block);
  
        /* Now compute value numbers and populate value sets with all
  	 the expressions computed in BLOCK.  */
!       for (bsi = bsi_start (block); !bsi_end_p (bsi); bsi_next (&bsi))
  	{
- 	  stmt_ann_t ann;
  	  ssa_op_iter iter;
  	  tree op;
  
! 	  stmt = bsi_stmt (bsi);
! 	  ann = stmt_ann (stmt);
! 
! 	  set_gimple_stmt_uid (stmt, stmt_uid++);
  
  	  FOR_EACH_SSA_TREE_OPERAND (op, stmt, iter, SSA_OP_DEF)
  	    {
--- 3613,3630 ----
  	bitmap_set_copy (AVAIL_OUT (block), AVAIL_OUT (dom));
  
        /* Generate values for PHI nodes.  */
!       for (gsi = gsi_start_phis (block); !gsi_end_p (gsi); gsi_next (&gsi))
! 	make_values_for_phi (gsi_stmt (gsi), block);
  
        /* Now compute value numbers and populate value sets with all
  	 the expressions computed in BLOCK.  */
!       for (gsi = gsi_start_bb (block); !gsi_end_p (gsi); gsi_next (&gsi))
  	{
  	  ssa_op_iter iter;
  	  tree op;
  
! 	  stmt = gsi_stmt (gsi);
! 	  gimple_set_uid (stmt, stmt_uid++);
  
  	  FOR_EACH_SSA_TREE_OPERAND (op, stmt, iter, SSA_OP_DEF)
  	    {
*************** compute_avail (void)
*** 3629,3734 ****
  	      bitmap_value_insert_into_set (AVAIL_OUT (block), e);
  	    }
  
! 	  switch (TREE_CODE (stmt))
  	    {
! 	    case RETURN_EXPR:
! 	      if (!ann->has_volatile_ops)
! 		FOR_EACH_SSA_TREE_OPERAND (op, stmt, iter, SSA_OP_USE)
! 		  add_to_exp_gen (block, op);
  	      continue;
! 	    case GIMPLE_MODIFY_STMT:
  	      {
! 		tree rhs = GIMPLE_STMT_OPERAND (stmt, 1);
! 		if (!ann->has_volatile_ops
! 		    && !tree_could_throw_p (stmt))
! 		  {
! 		    pre_expr result = NULL;
! 		    switch (TREE_CODE_CLASS (TREE_CODE (rhs)))
! 		      {
! 		      case tcc_unary:
! 			if (is_exception_related (rhs))
! 			  continue;
! 		      case tcc_binary:
! 			{
! 			  vn_nary_op_t nary;
! 			  unsigned int i;
  
! 			  vn_nary_op_lookup (rhs, &nary);
  
! 			  if (!nary)
! 			    continue;
  
! 			  for (i = 0; i < nary->length; i++)
! 			    if (TREE_CODE (nary->op[i]) == SSA_NAME)
! 			      add_to_exp_gen (block, nary->op[i]);
! 
! 			  result = (pre_expr) pool_alloc (pre_expr_pool);
! 			  result->kind = NARY;
! 			  result->id = 0;
! 			  PRE_EXPR_NARY (result) = nary;
! 			}
! 			break;
! 		      case tcc_vl_exp:
! 			if (!can_value_number_call (rhs))
! 			  continue;
  
! 		      case tcc_declaration:
! 		      case tcc_reference:
! 			{
! 			  vn_reference_t ref;
! 			  unsigned int i;
! 			  vn_reference_op_t vro;
! 
! 			  vn_reference_lookup (rhs,
! 					       shared_vuses_from_stmt (stmt),
! 					       true, &ref);
! 			  if (!ref)
! 			    continue;
! 
! 			  for (i = 0; VEC_iterate (vn_reference_op_s,
! 						   ref->operands, i,
! 						   vro); i++)
! 			    {
! 			      if (vro->op0 && TREE_CODE (vro->op0) == SSA_NAME)
! 				add_to_exp_gen (block, vro->op0);
! 			      if (vro->op1 && TREE_CODE (vro->op1) == SSA_NAME)
! 				add_to_exp_gen (block, vro->op1);
! 			    }
! 			  result = (pre_expr) pool_alloc (pre_expr_pool);
! 			  result->kind = REFERENCE;
! 			  result->id = 0;
! 			  PRE_EXPR_REFERENCE (result) = ref;
! 			}
! 			break;
! 		      default:
  			{
! 			  /* For any other statement that we don't
! 			     recognize, simply add all referenced
! 			     SSA_NAMEs to EXP_GEN.  */
! 			  FOR_EACH_SSA_TREE_OPERAND (op, stmt, iter, SSA_OP_USE)
! 			    add_to_exp_gen (block, op);
! 			  continue;
  			}
! 		      }
! 		    get_or_alloc_expression_id (result);
! 		    add_to_value (get_expr_value_id (result), result);
! 		    if (!in_fre)
! 		      {
! 			bitmap_value_insert_into_set (EXP_GEN (block),
! 						      result);
! 			bitmap_value_insert_into_set (maximal_set, result);
! 		      }
  
  		  }
  		continue;
  	      }
  	    default:
  	      break;
- 
  	    }
- 
- 
  	}
        /* Put the dominator children of BLOCK on the worklist of blocks
  	 to compute available sets for.  */
        for (son = first_dom_son (CDI_DOMINATORS, block);
--- 3639,3785 ----
  	      bitmap_value_insert_into_set (AVAIL_OUT (block), e);
  	    }
  
! 	  if (gimple_has_volatile_ops (stmt)
! 	      || stmt_could_throw_p (stmt))
! 	    continue;
! 
! 	  switch (gimple_code (stmt))
  	    {
! 	    case GIMPLE_RETURN:
! 	      FOR_EACH_SSA_TREE_OPERAND (op, stmt, iter, SSA_OP_USE)
! 		add_to_exp_gen (block, op);
  	      continue;
! 
! 	    case GIMPLE_CALL:
  	      {
! 		vn_reference_t ref;
! 		unsigned int i;
! 		vn_reference_op_t vro;
! 		pre_expr result = NULL;
! 		VEC(vn_reference_op_s, heap) *ops = NULL;
! 
! 		if (!can_value_number_call (stmt))
! 		  continue;
  
! 		copy_reference_ops_from_call (stmt, &ops);
! 		vn_reference_lookup_pieces (shared_vuses_from_stmt (stmt),
! 					    ops, &ref);
! 		VEC_free (vn_reference_op_s, heap, ops);
! 		if (!ref)
! 		  continue;
  
! 		for (i = 0; VEC_iterate (vn_reference_op_s,
! 					 ref->operands, i,
! 					 vro); i++)
! 		  {
! 		    if (vro->op0 && TREE_CODE (vro->op0) == SSA_NAME)
! 		      add_to_exp_gen (block, vro->op0);
! 		    if (vro->op1 && TREE_CODE (vro->op1) == SSA_NAME)
! 		      add_to_exp_gen (block, vro->op1);
! 		  }
! 		result = (pre_expr) pool_alloc (pre_expr_pool);
! 		result->kind = REFERENCE;
! 		result->id = 0;
! 		PRE_EXPR_REFERENCE (result) = ref;
! 
! 		get_or_alloc_expression_id (result);
! 		add_to_value (get_expr_value_id (result), result);
! 		if (!in_fre)
! 		  {
! 		    bitmap_value_insert_into_set (EXP_GEN (block),
! 						  result);
! 		    bitmap_value_insert_into_set (maximal_set, result);
! 		  }
! 		continue;
! 	      }
  
! 	    case GIMPLE_ASSIGN:
! 	      {
! 		pre_expr result = NULL;
! 		switch (TREE_CODE_CLASS (gimple_assign_rhs_code (stmt)))
! 		  {
! 		  case tcc_unary:
! 		    if (is_exception_related (stmt))
! 		      continue;
! 		  case tcc_binary:
! 		    {
! 		      vn_nary_op_t nary;
! 		      unsigned int i;
  
! 		      vn_nary_op_lookup_pieces (gimple_num_ops (stmt) - 1,
! 						gimple_assign_rhs_code (stmt),
! 						gimple_expr_type (stmt),
! 						gimple_assign_rhs1 (stmt),
! 						gimple_assign_rhs2 (stmt),
! 						NULL_TREE, NULL_TREE, &nary);
! 
! 		      if (!nary)
! 			continue;
! 
! 		      for (i = 0; i < nary->length; i++)
! 			if (TREE_CODE (nary->op[i]) == SSA_NAME)
! 			  add_to_exp_gen (block, nary->op[i]);
! 
! 		      result = (pre_expr) pool_alloc (pre_expr_pool);
! 		      result->kind = NARY;
! 		      result->id = 0;
! 		      PRE_EXPR_NARY (result) = nary;
! 		      break;
! 		    }
! 
! 		  case tcc_declaration:
! 		  case tcc_reference:
! 		    {
! 		      vn_reference_t ref;
! 		      unsigned int i;
! 		      vn_reference_op_t vro;
! 
! 		      vn_reference_lookup (gimple_assign_rhs1 (stmt),
! 					   shared_vuses_from_stmt (stmt),
! 					   false, &ref);
! 		      if (!ref)
! 			continue;
! 
! 		      for (i = 0; VEC_iterate (vn_reference_op_s,
! 					       ref->operands, i,
! 					       vro); i++)
  			{
! 			  if (vro->op0 && TREE_CODE (vro->op0) == SSA_NAME)
! 			    add_to_exp_gen (block, vro->op0);
! 			  if (vro->op1 && TREE_CODE (vro->op1) == SSA_NAME)
! 			    add_to_exp_gen (block, vro->op1);
  			}
! 		      result = (pre_expr) pool_alloc (pre_expr_pool);
! 		      result->kind = REFERENCE;
! 		      result->id = 0;
! 		      PRE_EXPR_REFERENCE (result) = ref;
! 		      break;
! 		    }
! 
! 		  default:
! 		    /* For any other statement that we don't
! 		       recognize, simply add all referenced
! 		       SSA_NAMEs to EXP_GEN.  */
! 		    FOR_EACH_SSA_TREE_OPERAND (op, stmt, iter, SSA_OP_USE)
! 		      add_to_exp_gen (block, op);
! 		    continue;
! 		  }
  
+ 		get_or_alloc_expression_id (result);
+ 		add_to_value (get_expr_value_id (result), result);
+ 		if (!in_fre)
+ 		  {
+ 		    bitmap_value_insert_into_set (EXP_GEN (block), result);
+ 		    bitmap_value_insert_into_set (maximal_set, result);
  		  }
+ 
  		continue;
  	      }
  	    default:
  	      break;
  	    }
  	}
+ 
        /* Put the dominator children of BLOCK on the worklist of blocks
  	 to compute available sets for.  */
        for (son = first_dom_son (CDI_DOMINATORS, block);
*************** static tree
*** 3749,3756 ****
  do_SCCVN_insertion (gimple stmt, tree ssa_vn)
  {
    basic_block bb = gimple_bb (stmt);
!   block_stmt_iterator bsi;
!   tree expr, stmts;
    pre_expr e;
  
    /* First create a value expression from the expression we want
--- 3800,3808 ----
  do_SCCVN_insertion (gimple stmt, tree ssa_vn)
  {
    basic_block bb = gimple_bb (stmt);
!   gimple_stmt_iterator gsi;
!   gimple_seq stmts = NULL;
!   tree expr;
    pre_expr e;
  
    /* First create a value expression from the expression we want
*************** do_SCCVN_insertion (gimple stmt, tree ss
*** 3761,3775 ****
    if (e == NULL)
      return NULL_TREE;
  
! /* Then use create_expression_by_pieces to generate a valid
       expression to insert at this point of the IL stream.  */
!   stmts = alloc_stmt_list ();
!   expr = create_expression_by_pieces (bb, e, stmts, stmt,
! 				      NULL);
    if (expr == NULL_TREE)
      return NULL_TREE;
!   bsi = bsi_for_stmt (stmt);
!   bsi_insert_before (&bsi, stmts, BSI_SAME_STMT);
  
    return expr;
  }
--- 3813,3825 ----
    if (e == NULL)
      return NULL_TREE;
  
!   /* Then use create_expression_by_pieces to generate a valid
       expression to insert at this point of the IL stream.  */
!   expr = create_expression_by_pieces (bb, e, &stmts, stmt, NULL);
    if (expr == NULL_TREE)
      return NULL_TREE;
!   gsi = gsi_for_stmt (stmt);
!   gsi_insert_seq_before (&gsi, stmts, GSI_SAME_STMT);
  
    return expr;
  }
*************** eliminate (void)
*** 3784,3813 ****
  
    FOR_EACH_BB (b)
      {
!       block_stmt_iterator i;
  
!       for (i = bsi_start (b); !bsi_end_p (i); bsi_next (&i))
  	{
! 	  tree stmt = bsi_stmt (i);
  
  	  /* Lookup the RHS of the expression, see if we have an
  	     available computation for it.  If so, replace the RHS with
  	     the available computation.  */
! 	  if (TREE_CODE (stmt) == GIMPLE_MODIFY_STMT
! 	      && TREE_CODE (GIMPLE_STMT_OPERAND (stmt, 0)) == SSA_NAME
! 	      && TREE_CODE (GIMPLE_STMT_OPERAND (stmt, 1)) != SSA_NAME
! 	      && !is_gimple_min_invariant (GIMPLE_STMT_OPERAND (stmt, 1))
! 	      && !stmt_ann (stmt)->has_volatile_ops)
  	    {
! 	      tree lhs = GIMPLE_STMT_OPERAND (stmt, 0);
! 	      tree *rhs_p = &GIMPLE_STMT_OPERAND (stmt, 1);
  	      tree sprime = NULL;
  	      pre_expr lhsexpr = get_or_alloc_expr_for_name (lhs);
  	      pre_expr sprimeexpr;
  
  	      sprimeexpr = bitmap_find_leader (AVAIL_OUT (b),
  					       get_expr_value_id (lhsexpr),
! 					       NULL_TREE);
  
  	      if (sprimeexpr)
  		{
--- 3834,3867 ----
  
    FOR_EACH_BB (b)
      {
!       gimple_stmt_iterator i;
  
!       for (i = gsi_start_bb (b); !gsi_end_p (i); gsi_next (&i))
  	{
! 	  gimple stmt = gsi_stmt (i);
  
  	  /* Lookup the RHS of the expression, see if we have an
  	     available computation for it.  If so, replace the RHS with
  	     the available computation.  */
! 	  if (gimple_has_lhs (stmt)
! 	      && TREE_CODE (gimple_get_lhs (stmt)) == SSA_NAME
! 	      && !gimple_assign_ssa_name_copy_p (stmt)
! 	      && (!gimple_assign_single_p (stmt)
! 		  || !is_gimple_min_invariant (gimple_assign_rhs1 (stmt)))
! 	      && !gimple_has_volatile_ops  (stmt))
  	    {
! 	      tree lhs = gimple_get_lhs (stmt);
! 	      tree rhs = NULL_TREE;
  	      tree sprime = NULL;
  	      pre_expr lhsexpr = get_or_alloc_expr_for_name (lhs);
  	      pre_expr sprimeexpr;
  
+ 	      if (gimple_assign_single_p (stmt))
+ 		rhs = gimple_assign_rhs1 (stmt);
+ 
  	      sprimeexpr = bitmap_find_leader (AVAIL_OUT (b),
  					       get_expr_value_id (lhsexpr),
! 					       NULL);
  
  	      if (sprimeexpr)
  		{
*************** eliminate (void)
*** 3822,3840 ****
  		 value is constant, use that constant.  */
  	      if (!sprime && is_gimple_min_invariant (VN_INFO (lhs)->valnum))
  		{
! 		  sprime = VN_INFO (lhs)->valnum;
! 
  		  if (dump_file && (dump_flags & TDF_DETAILS))
  		    {
  		      fprintf (dump_file, "Replaced ");
! 		      print_generic_expr (dump_file, *rhs_p, 0);
  		      fprintf (dump_file, " with ");
  		      print_generic_expr (dump_file, sprime, 0);
  		      fprintf (dump_file, " in ");
! 		      print_generic_stmt (dump_file, stmt, 0);
  		    }
  		  pre_stats.eliminations++;
! 		  propagate_tree_value (rhs_p, sprime);
  		  update_stmt (stmt);
  		  continue;
  		}
--- 3876,3895 ----
  		 value is constant, use that constant.  */
  	      if (!sprime && is_gimple_min_invariant (VN_INFO (lhs)->valnum))
  		{
! 		  sprime = fold_convert (TREE_TYPE (lhs),
! 					 VN_INFO (lhs)->valnum);
  		  if (dump_file && (dump_flags & TDF_DETAILS))
  		    {
  		      fprintf (dump_file, "Replaced ");
! 		      print_gimple_expr (dump_file, stmt, 0, 0);
  		      fprintf (dump_file, " with ");
  		      print_generic_expr (dump_file, sprime, 0);
  		      fprintf (dump_file, " in ");
! 		      print_gimple_stmt (dump_file, stmt, 0, 0);
  		    }
  		  pre_stats.eliminations++;
! 		  propagate_tree_value_into_stmt (&i, sprime);
! 		  stmt = gsi_stmt (i);
  		  update_stmt (stmt);
  		  continue;
  		}
*************** eliminate (void)
*** 3853,3885 ****
  		}
  	      if (sprime
  		  && sprime != lhs
! 		  && (TREE_CODE (*rhs_p) != SSA_NAME
! 		      || may_propagate_copy (*rhs_p, sprime)))
  		{
! 		  gcc_assert (sprime != *rhs_p);
  
  		  if (dump_file && (dump_flags & TDF_DETAILS))
  		    {
  		      fprintf (dump_file, "Replaced ");
! 		      print_generic_expr (dump_file, *rhs_p, 0);
  		      fprintf (dump_file, " with ");
  		      print_generic_expr (dump_file, sprime, 0);
  		      fprintf (dump_file, " in ");
! 		      print_generic_stmt (dump_file, stmt, 0);
  		    }
  
  		  if (TREE_CODE (sprime) == SSA_NAME)
! 		    NECESSARY (SSA_NAME_DEF_STMT (sprime)) = 1;
  		  /* We need to make sure the new and old types actually match,
  		     which may require adding a simple cast, which fold_convert
  		     will do for us.  */
! 		  if (TREE_CODE (*rhs_p) != SSA_NAME
! 		      && !useless_type_conversion_p (TREE_TYPE (*rhs_p),
! 						    TREE_TYPE (sprime)))
! 		    sprime = fold_convert (TREE_TYPE (*rhs_p), sprime);
  
  		  pre_stats.eliminations++;
! 		  propagate_tree_value (rhs_p, sprime);
  		  update_stmt (stmt);
  
  		  /* If we removed EH side effects from the statement, clean
--- 3908,3943 ----
  		}
  	      if (sprime
  		  && sprime != lhs
! 		  && (rhs == NULL_TREE
! 		      || TREE_CODE (rhs) != SSA_NAME
! 		      || may_propagate_copy (rhs, sprime)))
  		{
! 		  gcc_assert (sprime != rhs);
  
  		  if (dump_file && (dump_flags & TDF_DETAILS))
  		    {
  		      fprintf (dump_file, "Replaced ");
! 		      print_gimple_expr (dump_file, stmt, 0, 0);
  		      fprintf (dump_file, " with ");
  		      print_generic_expr (dump_file, sprime, 0);
  		      fprintf (dump_file, " in ");
! 		      print_gimple_stmt (dump_file, stmt, 0, 0);
  		    }
  
  		  if (TREE_CODE (sprime) == SSA_NAME)
! 		    gimple_set_plf (SSA_NAME_DEF_STMT (sprime),
! 				    NECESSARY, true);
  		  /* We need to make sure the new and old types actually match,
  		     which may require adding a simple cast, which fold_convert
  		     will do for us.  */
! 		  if ((!rhs || TREE_CODE (rhs) != SSA_NAME)
! 		      && !useless_type_conversion_p (gimple_expr_type (stmt),
! 						     TREE_TYPE (sprime)))
! 		    sprime = fold_convert (gimple_expr_type (stmt), sprime);
  
  		  pre_stats.eliminations++;
! 		  propagate_tree_value_into_stmt (&i, sprime);
! 		  stmt = gsi_stmt (i);
  		  update_stmt (stmt);
  
  		  /* If we removed EH side effects from the statement, clean
*************** eliminate (void)
*** 3895,3930 ****
  	    }
  	  /* Visit COND_EXPRs and fold the comparison with the
  	     available value-numbers.  */
! 	  else if (TREE_CODE (stmt) == COND_EXPR
! 		   && COMPARISON_CLASS_P (COND_EXPR_COND (stmt)))
  	    {
! 	      tree cond = COND_EXPR_COND (stmt);
! 	      tree op0 = TREE_OPERAND (cond, 0);
! 	      tree op1 = TREE_OPERAND (cond, 1);
  	      tree result;
  
  	      if (TREE_CODE (op0) == SSA_NAME)
  		op0 = VN_INFO (op0)->valnum;
  	      if (TREE_CODE (op1) == SSA_NAME)
  		op1 = VN_INFO (op1)->valnum;
! 	      result = fold_binary (TREE_CODE (cond), TREE_TYPE (cond),
  				    op0, op1);
  	      if (result && TREE_CODE (result) == INTEGER_CST)
  		{
! 		  COND_EXPR_COND (stmt) = result;
! 		  update_stmt (stmt);
! 		  todo = TODO_cleanup_cfg;
! 		}
! 	    }
! 	  else if (TREE_CODE (stmt) == COND_EXPR
! 		   && TREE_CODE (COND_EXPR_COND (stmt)) == SSA_NAME)
! 	    {
! 	      tree op = COND_EXPR_COND (stmt);
! 	      op = VN_INFO (op)->valnum;
! 	      if (TREE_CODE (op) == INTEGER_CST)
! 		{
! 		  COND_EXPR_COND (stmt) = integer_zerop (op)
! 		    ? boolean_false_node : boolean_true_node;
  		  update_stmt (stmt);
  		  todo = TODO_cleanup_cfg;
  		}
--- 3953,3976 ----
  	    }
  	  /* Visit COND_EXPRs and fold the comparison with the
  	     available value-numbers.  */
! 	  else if (gimple_code (stmt) == GIMPLE_COND)
  	    {
! 	      tree op0 = gimple_cond_lhs (stmt);
! 	      tree op1 = gimple_cond_rhs (stmt);
  	      tree result;
  
  	      if (TREE_CODE (op0) == SSA_NAME)
  		op0 = VN_INFO (op0)->valnum;
  	      if (TREE_CODE (op1) == SSA_NAME)
  		op1 = VN_INFO (op1)->valnum;
! 	      result = fold_binary (gimple_cond_code (stmt), boolean_type_node,
  				    op0, op1);
  	      if (result && TREE_CODE (result) == INTEGER_CST)
  		{
! 		  if (integer_zerop (result))
! 		    gimple_cond_make_false (stmt);
! 		  else
! 		    gimple_cond_make_true (stmt);
  		  update_stmt (stmt);
  		  todo = TODO_cleanup_cfg;
  		}
*************** eliminate (void)
*** 3943,3952 ****
     mark that statement necessary. Return the stmt, if it is newly
     necessary.  */
  
! static inline tree
  mark_operand_necessary (tree op)
  {
!   tree stmt;
  
    gcc_assert (op);
  
--- 3989,3998 ----
     mark that statement necessary. Return the stmt, if it is newly
     necessary.  */
  
! static inline gimple
  mark_operand_necessary (tree op)
  {
!   gimple stmt;
  
    gcc_assert (op);
  
*************** mark_operand_necessary (tree op)
*** 3956,3966 ****
    stmt = SSA_NAME_DEF_STMT (op);
    gcc_assert (stmt);
  
!   if (NECESSARY (stmt)
!       || IS_EMPTY_STMT (stmt))
      return NULL;
  
!   NECESSARY (stmt) = 1;
    return stmt;
  }
  
--- 4002,4012 ----
    stmt = SSA_NAME_DEF_STMT (op);
    gcc_assert (stmt);
  
!   if (gimple_plf (stmt, NECESSARY)
!       || gimple_nop_p (stmt))
      return NULL;
  
!   gimple_set_plf (stmt, NECESSARY, true);
    return stmt;
  }
  
*************** mark_operand_necessary (tree op)
*** 3972,4007 ****
  static void
  remove_dead_inserted_code (void)
  {
!   VEC(tree,heap) *worklist = NULL;
    int i;
!   tree t;
  
!   worklist = VEC_alloc (tree, heap, VEC_length (tree, inserted_exprs));
!   for (i = 0; VEC_iterate (tree, inserted_exprs, i, t); i++)
      {
!       if (NECESSARY (t))
! 	VEC_quick_push (tree, worklist, t);
      }
!   while (VEC_length (tree, worklist) > 0)
      {
!       t = VEC_pop (tree, worklist);
  
        /* PHI nodes are somewhat special in that each PHI alternative has
  	 data and control dependencies.  All the statements feeding the
  	 PHI node's arguments are always necessary. */
!       if (TREE_CODE (t) == PHI_NODE)
  	{
! 	  int k;
  
! 	  VEC_reserve (tree, heap, worklist, PHI_NUM_ARGS (t));
! 	  for (k = 0; k < PHI_NUM_ARGS (t); k++)
  	    {
  	      tree arg = PHI_ARG_DEF (t, k);
  	      if (TREE_CODE (arg) == SSA_NAME)
  		{
! 		  arg = mark_operand_necessary (arg);
! 		  if (arg)
! 		    VEC_quick_push (tree, worklist, arg);
  		}
  	    }
  	}
--- 4018,4053 ----
  static void
  remove_dead_inserted_code (void)
  {
!   VEC(gimple,heap) *worklist = NULL;
    int i;
!   gimple t;
  
!   worklist = VEC_alloc (gimple, heap, VEC_length (gimple, inserted_exprs));
!   for (i = 0; VEC_iterate (gimple, inserted_exprs, i, t); i++)
      {
!       if (gimple_plf (t, NECESSARY))
! 	VEC_quick_push (gimple, worklist, t);
      }
!   while (VEC_length (gimple, worklist) > 0)
      {
!       t = VEC_pop (gimple, worklist);
  
        /* PHI nodes are somewhat special in that each PHI alternative has
  	 data and control dependencies.  All the statements feeding the
  	 PHI node's arguments are always necessary. */
!       if (gimple_code (t) == GIMPLE_PHI)
  	{
! 	  unsigned k;
  
! 	  VEC_reserve (gimple, heap, worklist, gimple_phi_num_args (t));
! 	  for (k = 0; k < gimple_phi_num_args (t); k++)
  	    {
  	      tree arg = PHI_ARG_DEF (t, k);
  	      if (TREE_CODE (arg) == SSA_NAME)
  		{
! 		  gimple n = mark_operand_necessary (arg);
! 		  if (n)
! 		    VEC_quick_push (gimple, worklist, n);
  		}
  	    }
  	}
*************** remove_dead_inserted_code (void)
*** 4020,4057 ****
  
  	  FOR_EACH_SSA_TREE_OPERAND (use, t, iter, SSA_OP_ALL_USES)
  	    {
! 	      tree n = mark_operand_necessary (use);
  	      if (n)
! 		VEC_safe_push (tree, heap, worklist, n);
  	    }
  	}
      }
  
!   for (i = 0; VEC_iterate (tree, inserted_exprs, i, t); i++)
      {
!       if (!NECESSARY (t))
  	{
! 	  block_stmt_iterator bsi;
  
  	  if (dump_file && (dump_flags & TDF_DETAILS))
  	    {
  	      fprintf (dump_file, "Removing unnecessary insertion:");
! 	      print_generic_stmt (dump_file, t, 0);
  	    }
  
! 	  if (TREE_CODE (t) == PHI_NODE)
! 	    {
! 	      remove_phi_node (t, NULL_TREE, true);
! 	    }
  	  else
! 	    {
! 	      bsi = bsi_for_stmt (t);
! 	      bsi_remove (&bsi, true);
! 	      release_defs (t);
! 	    }
  	}
      }
!   VEC_free (tree, heap, worklist);
  }
  
  /* Initialize data structures used by PRE.  */
--- 4066,4099 ----
  
  	  FOR_EACH_SSA_TREE_OPERAND (use, t, iter, SSA_OP_ALL_USES)
  	    {
! 	      gimple n = mark_operand_necessary (use);
  	      if (n)
! 		VEC_safe_push (gimple, heap, worklist, n);
  	    }
  	}
      }
  
!   for (i = 0; VEC_iterate (gimple, inserted_exprs, i, t); i++)
      {
!       if (!gimple_plf (t, NECESSARY))
  	{
! 	  gimple_stmt_iterator gsi;
  
  	  if (dump_file && (dump_flags & TDF_DETAILS))
  	    {
  	      fprintf (dump_file, "Removing unnecessary insertion:");
! 	      print_gimple_stmt (dump_file, t, 0, 0);
  	    }
  
! 	  gsi = gsi_for_stmt (t);
! 	  if (gimple_code (t) == GIMPLE_PHI)
! 	    remove_phi_node (&gsi, true);
  	  else
! 	    gsi_remove (&gsi, true);
! 	  release_defs (t);
  	}
      }
!   VEC_free (gimple, heap, worklist);
  }
  
  /* Initialize data structures used by PRE.  */
*************** fini_pre (void)
*** 4122,4129 ****
  
    free (postorder);
    VEC_free (bitmap_set_t, heap, value_expressions);
!   VEC_free (tree, heap, inserted_exprs);
!   VEC_free (tree, heap, need_creation);
    bitmap_obstack_release (&grand_bitmap_obstack);
    free_alloc_pool (bitmap_set_pool);
    free_alloc_pool (pre_expr_pool);
--- 4164,4171 ----
  
    free (postorder);
    VEC_free (bitmap_set_t, heap, value_expressions);
!   VEC_free (gimple, heap, inserted_exprs);
!   VEC_free (gimple, heap, need_creation);
    bitmap_obstack_release (&grand_bitmap_obstack);
    free_alloc_pool (bitmap_set_pool);
    free_alloc_pool (pre_expr_pool);
*************** fini_pre (void)
*** 4141,4147 ****
  
    if (!bitmap_empty_p (need_eh_cleanup))
      {
!       tree_purge_all_dead_eh_edges (need_eh_cleanup);
        cleanup_tree_cfg ();
      }
  
--- 4183,4189 ----
  
    if (!bitmap_empty_p (need_eh_cleanup))
      {
!       gimple_purge_all_dead_eh_edges (need_eh_cleanup);
        cleanup_tree_cfg ();
      }
  
*************** fini_pre (void)
*** 4150,4156 ****
    if (current_loops != NULL)
      loop_optimizer_finalize ();
  }
- #endif
  
  /* Main entry point to the SSA-PRE pass.  DO_FRE is true if the caller
     only wants to do full redundancy elimination.  */
--- 4192,4197 ----
*************** fini_pre (void)
*** 4158,4169 ****
  static unsigned int
  execute_pre (bool do_fre ATTRIBUTE_UNUSED)
  {
-   /* FIXME tuples.  */
-   if (run_scc_vn (do_fre))
-     free_scc_vn ();
- 
-   /* FIXME tuples.  */
- #if 0
    unsigned int todo = 0;
  
    do_partial_partial = optimize > 2;
--- 4199,4204 ----
*************** execute_pre (bool do_fre ATTRIBUTE_UNUSE
*** 4172,4184 ****
       loop_optimizer_init may create new phis, etc.  */
    if (!do_fre)
      loop_optimizer_init (LOOPS_NORMAL);
    if (0 && !do_fre)
      insert_fake_stores ();
  
!   if (!run_scc_vn (do_fre))
      {
        if (!do_fre)
! 	remove_dead_inserted_code ();
        return 0;
      }
    init_pre (do_fre);
--- 4207,4226 ----
       loop_optimizer_init may create new phis, etc.  */
    if (!do_fre)
      loop_optimizer_init (LOOPS_NORMAL);
+   /* FIXME tuples */
+ #if 0
    if (0 && !do_fre)
      insert_fake_stores ();
+ #endif
  
!   if (!run_scc_vn (false /* FIXME tuples: do_fre */))
      {
        if (!do_fre)
! 	{
! 	  remove_dead_inserted_code ();
! 	  loop_optimizer_finalize ();
! 	}
! 
        return 0;
      }
    init_pre (do_fre);
*************** execute_pre (bool do_fre ATTRIBUTE_UNUSE
*** 4220,4241 ****
    statistics_counter_event (cfun, "New PHIs", pre_stats.phis);
    statistics_counter_event (cfun, "Eliminated", pre_stats.eliminations);
    statistics_counter_event (cfun, "Constified", pre_stats.constified);
!   bsi_commit_edge_inserts ();
  
    clear_expression_ids ();
    free_scc_vn ();
    if (!do_fre)
      {
        remove_dead_inserted_code ();
        if (0)
  	realify_fake_stores ();
      }
  
    fini_pre ();
  
    return todo;
- #endif
-   return 0;
  }
  
  /* Gate and execute functions for PRE.  */
--- 4262,4284 ----
    statistics_counter_event (cfun, "New PHIs", pre_stats.phis);
    statistics_counter_event (cfun, "Eliminated", pre_stats.eliminations);
    statistics_counter_event (cfun, "Constified", pre_stats.constified);
!   gsi_commit_edge_inserts ();
  
    clear_expression_ids ();
    free_scc_vn ();
    if (!do_fre)
      {
        remove_dead_inserted_code ();
+   /* FIXME tuples */
+ #if 0
        if (0)
  	realify_fake_stores ();
+ #endif
      }
  
    fini_pre ();
  
    return todo;
  }
  
  /* Gate and execute functions for PRE.  */
Index: gimple-tuples-branch/gcc/tree-ssa-sccvn.c
===================================================================
*** gimple-tuples-branch.orig/gcc/tree-ssa-sccvn.c	2008-07-14 11:12:52.000000000 +0200
--- gimple-tuples-branch/gcc/tree-ssa-sccvn.c	2008-07-14 11:46:09.000000000 +0200
*************** vn_get_expr_for (tree name)
*** 223,229 ****
  {
    vn_ssa_aux_t vn = VN_INFO (name);
    gimple def_stmt;
!   tree expr;
  
    if (vn->valnum == VN_TOP)
      return name;
--- 223,229 ----
  {
    vn_ssa_aux_t vn = VN_INFO (name);
    gimple def_stmt;
!   tree expr = NULL_TREE;
  
    if (vn->valnum == VN_TOP)
      return name;
*************** vn_get_expr_for (tree name)
*** 248,260 ****
    /* Otherwise use the defining statement to build the expression.  */
    def_stmt = SSA_NAME_DEF_STMT (vn->valnum);
  
!   /* If the value number is a default-definition use it directly.  */
!   if (gimple_nop_p (def_stmt))
      return vn->valnum;
  
!   /* ???  This will return NULL_TREE if the stmt cannot be simplified.  */
!   expr = gimple_fold (def_stmt);
!   if (!expr)
      return vn->valnum;
  
    /* Cache the expression.  */
--- 248,291 ----
    /* Otherwise use the defining statement to build the expression.  */
    def_stmt = SSA_NAME_DEF_STMT (vn->valnum);
  
!   /* If the value number is a default-definition or a PHI result
!      use it directly.  */
!   if (gimple_nop_p (def_stmt)
!       || gimple_code (def_stmt) == GIMPLE_PHI)
      return vn->valnum;
  
!   if (!is_gimple_assign (def_stmt))
!     return vn->valnum;
! 
!   /* FIXME tuples.  This is incomplete and likely will miss some
!      simplifications.  */
!   switch (TREE_CODE_CLASS (gimple_assign_rhs_code (def_stmt)))
!     {
!     case tcc_reference:
!       if (gimple_assign_rhs_code (def_stmt) == VIEW_CONVERT_EXPR
! 	  && gimple_assign_rhs_code (def_stmt) == REALPART_EXPR
! 	  && gimple_assign_rhs_code (def_stmt) == IMAGPART_EXPR)
! 	expr = fold_build1 (gimple_assign_rhs_code (def_stmt),
! 			    gimple_expr_type (def_stmt),
! 			    TREE_OPERAND (gimple_assign_rhs1 (def_stmt), 0));
!       break;
! 
!     case tcc_unary:
!       expr = fold_build1 (gimple_assign_rhs_code (def_stmt),
! 			  gimple_expr_type (def_stmt),
! 			  gimple_assign_rhs1 (def_stmt));
!       break;
! 
!     case tcc_binary:
!       expr = fold_build2 (gimple_assign_rhs_code (def_stmt),
! 			  gimple_expr_type (def_stmt),
! 			  gimple_assign_rhs1 (def_stmt),
! 			  gimple_assign_rhs2 (def_stmt));
!       break;
! 
!     default:;
!     }
!   if (expr == NULL_TREE)
      return vn->valnum;
  
    /* Cache the expression.  */
*************** copy_reference_ops_from_ref (tree ref, V
*** 627,633 ****
  /* Copy the operations present in load/store/call REF into RESULT, a vector of
     vn_reference_op_s's.  */
  
! static void
  copy_reference_ops_from_call (gimple call,
  			      VEC(vn_reference_op_s, heap) **result)
  {
--- 658,664 ----
  /* Copy the operations present in load/store/call REF into RESULT, a vector of
     vn_reference_op_s's.  */
  
! void
  copy_reference_ops_from_call (gimple call,
  			      VEC(vn_reference_op_s, heap) **result)
  {
*************** visit_reference_op_load (tree lhs, tree
*** 1601,1606 ****
--- 1632,1638 ----
  	  result = make_ssa_name (SSA_NAME_VAR (lhs), NULL);
  	  /* Initialize value-number information properly.  */
  	  VN_INFO_GET (result)->valnum = result;
+ 	  VN_INFO (result)->value_id = get_next_value_id ();
  	  VN_INFO (result)->expr = val;
  	  VN_INFO (result)->has_constants = expr_has_constants (val);
  	  VN_INFO (result)->needs_insertion = true;
*************** simplify_binary_expression (gimple stmt)
*** 1949,1962 ****
    result = fold_binary (gimple_assign_rhs_code (stmt),
  			TREE_TYPE (gimple_get_lhs (stmt)), op0, op1);
  
!   fold_undefer_overflow_warnings (result && valid_gimple_expression_p (result),
  				  stmt, 0);
  
    /* Make sure result is not a complex expression consisting
       of operators of operators (IE (a + b) + (a + c))
       Otherwise, we will end up with unbounded expressions if
       fold does anything at all.  */
!   if (result && valid_gimple_expression_p (result))
      return result;
  
    return NULL_TREE;
--- 1981,1994 ----
    result = fold_binary (gimple_assign_rhs_code (stmt),
  			TREE_TYPE (gimple_get_lhs (stmt)), op0, op1);
  
!   fold_undefer_overflow_warnings (result && valid_gimple_rhs_p (result),
  				  stmt, 0);
  
    /* Make sure result is not a complex expression consisting
       of operators of operators (IE (a + b) + (a + c))
       Otherwise, we will end up with unbounded expressions if
       fold does anything at all.  */
!   if (result && valid_gimple_rhs_p (result))
      return result;
  
    return NULL_TREE;
*************** simplify_unary_expression (gimple stmt)
*** 1978,1985 ****
      op0 = valueize_expr (vn_get_expr_for (op0));
    else if (gimple_assign_cast_p (stmt)
  	   || gimple_assign_rhs_code (stmt) == REALPART_EXPR
! 	   || gimple_assign_rhs_code (stmt) == IMAGPART_EXPR
! 	   || gimple_assign_rhs_code (stmt) == VIEW_CONVERT_EXPR)
      {
        /* We want to do tree-combining on conversion-like expressions.
           Make sure we feed only SSA_NAMEs or constants to fold though.  */
--- 2010,2016 ----
      op0 = valueize_expr (vn_get_expr_for (op0));
    else if (gimple_assign_cast_p (stmt)
  	   || gimple_assign_rhs_code (stmt) == REALPART_EXPR
! 	   || gimple_assign_rhs_code (stmt) == IMAGPART_EXPR)
      {
        /* We want to do tree-combining on conversion-like expressions.
           Make sure we feed only SSA_NAMEs or constants to fold though.  */
*************** simplify_unary_expression (gimple stmt)
*** 1997,2007 ****
      return NULL_TREE;
  
    result = fold_unary (gimple_assign_rhs_code (stmt),
! 		       TREE_TYPE (gimple_get_lhs (stmt)), op0);
    if (result)
      {
        STRIP_USELESS_TYPE_CONVERSION (result);
!       if (valid_gimple_expression_p (result))
          return result;
      }
  
--- 2028,2038 ----
      return NULL_TREE;
  
    result = fold_unary (gimple_assign_rhs_code (stmt),
! 		       gimple_expr_type (stmt), op0);
    if (result)
      {
        STRIP_USELESS_TYPE_CONVERSION (result);
!       if (valid_gimple_rhs_p (result))
          return result;
      }
  
*************** process_scc (VEC (tree, heap) *scc)
*** 2349,2354 ****
--- 2380,2388 ----
  	{
  	  changed = false;
  	  iterations++;
+ 	  /* As we are value-numbering optimistically we have to
+ 	     clear the expression tables and the simplified expressions
+ 	     in each iteration until we converge.  */
  	  htab_empty (optimistic_info->nary);
  	  htab_empty (optimistic_info->phis);
  	  htab_empty (optimistic_info->references);
*************** process_scc (VEC (tree, heap) *scc)
*** 2357,2362 ****
--- 2391,2398 ----
  	  empty_alloc_pool (optimistic_info->phis_pool);
  	  empty_alloc_pool (optimistic_info->references_pool);
  	  for (i = 0; VEC_iterate (tree, scc, i, var); i++)
+ 	    VN_INFO (var)->expr = NULL_TREE;
+ 	  for (i = 0; VEC_iterate (tree, scc, i, var); i++)
  	    changed |= visit_use (var);
  	}
  
*************** free_scc_vn (void)
*** 2637,2645 ****
      {
        tree name = ssa_name (i);
        if (name
- 	  && SSA_NAME_VALUE (name))
- 	SSA_NAME_VALUE (name) = NULL;
-       if (name
  	  && VN_INFO (name)->needs_insertion)
  	release_ssa_name (name);
      }
--- 2673,2678 ----
*************** run_scc_vn (bool may_insert_arg)
*** 2828,2843 ****
        for (i = 0; i < num_ssa_names; i++)
  	{
  	  tree name = ssa_name (i);
! 	  if (name && VN_INFO (name)->visited
! 	      && (SSA_VAL (name) != name
! 		  || is_gimple_min_invariant (vn_get_expr_for (name))))
  	    {
  	      print_generic_expr (dump_file, name, 0);
  	      fprintf (dump_file, " = ");
! 	      if (is_gimple_min_invariant (vn_get_expr_for (name)))
! 		print_generic_expr (dump_file, vn_get_expr_for (name), 0);
! 	      else
! 		print_generic_expr (dump_file, SSA_VAL (name), 0);
  	      fprintf (dump_file, "\n");
  	    }
  	}
--- 2861,2873 ----
        for (i = 0; i < num_ssa_names; i++)
  	{
  	  tree name = ssa_name (i);
! 	  if (name
! 	      && VN_INFO (name)->visited
! 	      && SSA_VAL (name) != name)
  	    {
  	      print_generic_expr (dump_file, name, 0);
  	      fprintf (dump_file, " = ");
! 	      print_generic_expr (dump_file, SSA_VAL (name), 0);
  	      fprintf (dump_file, "\n");
  	    }
  	}
Index: gimple-tuples-branch/gcc/tree-ssa-sccvn.h
===================================================================
*** gimple-tuples-branch.orig/gcc/tree-ssa-sccvn.h	2008-07-14 11:11:52.000000000 +0200
--- gimple-tuples-branch/gcc/tree-ssa-sccvn.h	2008-07-14 11:13:30.000000000 +0200
*************** vn_nary_op_t vn_nary_op_insert_stmt (gim
*** 152,157 ****
--- 152,158 ----
  vn_nary_op_t vn_nary_op_insert_pieces (unsigned int, enum tree_code,
  				       tree, tree, tree, tree,
  				       tree, tree, unsigned int);
+ void copy_reference_ops_from_call (gimple, VEC(vn_reference_op_s, heap) **);
  tree vn_reference_lookup_pieces (VEC (tree, gc) *,
  				 VEC (vn_reference_op_s, heap) *,
  				 vn_reference_t *);
Index: gimple-tuples-branch/gcc/tree-ssa-propagate.c
===================================================================
*** gimple-tuples-branch.orig/gcc/tree-ssa-propagate.c	2008-07-14 11:12:52.000000000 +0200
--- gimple-tuples-branch/gcc/tree-ssa-propagate.c	2008-07-14 11:13:30.000000000 +0200
*************** valid_gimple_rhs_p (tree expr)
*** 599,605 ****
          {
          case ADDR_EXPR:
            {
!             tree t = TREE_OPERAND (expr, 0);
              while (handled_component_p (t))
                {
                  /* ??? More checks needed, see the GIMPLE verifier.  */
--- 599,608 ----
          {
          case ADDR_EXPR:
            {
! 	    tree t;
! 	    if (is_gimple_min_invariant (expr))
! 	      return true;
!             t = TREE_OPERAND (expr, 0);
              while (handled_component_p (t))
                {
                  /* ??? More checks needed, see the GIMPLE verifier.  */
*************** valid_gimple_rhs_p (tree expr)
*** 642,647 ****
--- 645,651 ----
      case tcc_exceptional:
        if (code != SSA_NAME)
          return false;
+       break;
  
      default:
        return false;
-------------- next part --------------
cat <<'EOF' |
LAST_UPDATED: 
Native configuration is x86_64-unknown-linux-gnu

		=== g++ tests ===


Running target unix
FAIL: g++.dg/eh/init-temp2.C (test for excess errors)
FAIL: g++.dg/other/PR23205.C scan-assembler .stabs.*foobar:c=i
FAIL: g++.dg/other/str_empty.C  (test for warnings, line 13)
FAIL: g++.dg/tree-ssa/pr19637.C scan-tree-dump-times dom1 "return 1;" 3
FAIL: g++.dg/tree-ssa/pr23948.C scan-tree-dump-times recip " / " 1
FAIL: g++.dg/tree-ssa/pr31146.C scan-tree-dump forwprop2 "i\\[j.*\\] = 1;"
FAIL: g++.dg/warn/Wreturn-type-2.C (test for excess errors)
FAIL: g++.dg/warn/unused-result1.C  (test for warnings, line 9)
FAIL: 102:is -:should be 1
FAIL: 141:is 8:should be 5
FAIL: 143:is 6:should be 3
FAIL: 150:is 3:should be 2
FAIL: g++.dg/gcov/gcov-1.C gcov: 4 failures in line counts, 0 in branch percentages, 0 in return percentages
FAIL: ./local-1.H -g (internal compiler error)
FAIL: ./local-1.H -g (test for excess errors)
FAIL: g++.dg/pch/local-1.C -g
FAIL: g++.dg/pch/local-1.C -g assembly comparison
FAIL: ./local-1.H -O2 -g (internal compiler error)
FAIL: ./local-1.H -O2 -g (test for excess errors)
FAIL: g++.dg/pch/local-1.C -O2 -g
FAIL: g++.dg/pch/local-1.C -O2 -g assembly comparison
FAIL: ./local-1.H -O2 (internal compiler error)
FAIL: ./local-1.H -O2 (test for excess errors)
FAIL: g++.dg/pch/local-1.C -O2
FAIL: g++.dg/pch/local-1.C -O2 assembly comparison
FAIL: ./system-1.H -g (internal compiler error)
FAIL: ./system-1.H -g (test for excess errors)
FAIL: g++.dg/pch/system-1.C -g
FAIL: g++.dg/pch/system-1.C -g assembly comparison
FAIL: ./system-1.H -O2 -g (internal compiler error)
FAIL: ./system-1.H -O2 -g (test for excess errors)
FAIL: g++.dg/pch/system-1.C -O2 -g
FAIL: g++.dg/pch/system-1.C -O2 -g assembly comparison
FAIL: ./system-1.H -O2 (internal compiler error)
FAIL: ./system-1.H -O2 (test for excess errors)
FAIL: g++.dg/pch/system-1.C -O2
FAIL: g++.dg/pch/system-1.C -O2 assembly comparison
FAIL: ./system-2.H -g (internal compiler error)
FAIL: ./system-2.H -g (test for excess errors)
FAIL: g++.dg/pch/system-2.C -g
FAIL: g++.dg/pch/system-2.C -g assembly comparison
FAIL: ./system-2.H -O2 -g (internal compiler error)
FAIL: ./system-2.H -O2 -g (test for excess errors)
FAIL: g++.dg/pch/system-2.C -O2 -g
FAIL: g++.dg/pch/system-2.C -O2 -g assembly comparison
FAIL: ./system-2.H -O2 (internal compiler error)
FAIL: ./system-2.H -O2 (test for excess errors)
FAIL: g++.dg/pch/system-2.C -O2
FAIL: g++.dg/pch/system-2.C -O2 assembly comparison
FAIL: ./uninst.H -g (internal compiler error)
FAIL: ./uninst.H -g (test for excess errors)
FAIL: g++.dg/pch/uninst.C -g
FAIL: g++.dg/pch/uninst.C -g assembly comparison
FAIL: ./uninst.H -O2 -g (internal compiler error)
FAIL: ./uninst.H -O2 -g (test for excess errors)
FAIL: g++.dg/pch/uninst.C -O2 -g
FAIL: g++.dg/pch/uninst.C -O2 -g assembly comparison
FAIL: ./uninst.H -O2 (internal compiler error)
FAIL: ./uninst.H -O2 (test for excess errors)
FAIL: g++.dg/pch/uninst.C -O2
FAIL: g++.dg/pch/uninst.C -O2 assembly comparison
FAIL: g++.old-deja/g++.mike/p5469.C execution test
FAIL: g++.old-deja/g++.mike/p5469a.C execution test

		=== g++ Summary ===

# of expected passes		17668
# of unexpected failures	63
# of expected failures		82
# of unsupported tests		123
/space/rguenther/obj/gcc/testsuite/g++/../../g++  version 4.4.0 20080708 (experimental) (gimple-tuples-branch merged with rev 137633) 

		=== gcc tests ===


Running target unix
FAIL: gcc.c-torture/compile/limits-exprparen.c  -O0  (test for excess errors)
FAIL: gcc.c-torture/compile/limits-exprparen.c  -O1  (test for excess errors)
FAIL: gcc.c-torture/compile/limits-exprparen.c  -O2  (test for excess errors)
FAIL: gcc.c-torture/compile/limits-exprparen.c  -O3 -fomit-frame-pointer  (test for excess errors)
FAIL: gcc.c-torture/compile/limits-exprparen.c  -O3 -g  (test for excess errors)
FAIL: gcc.c-torture/compile/limits-exprparen.c  -Os  (test for excess errors)
FAIL: gcc.c-torture/execute/stdarg-3.c execution,  -Os 
FAIL: gcc.dg/debug/dwarf2/var1.c scan-assembler xyzzy[^\\\\n\\\\r]+DW_AT_name
FAIL: gcc.dg/Wstrict-aliasing-float-ptr-int-obj.c  (test for warnings, line 14)
FAIL: gcc.dg/Wstrict-aliasing-float-ptr-int-obj.c  (test for warnings, line 16)
FAIL: gcc.dg/builtins-61.c scan-tree-dump optimized "return 0.0"
FAIL: gcc.dg/fold-alloca-1.c scan-tree-dump-times useless "link_error" 0
FAIL: gcc.dg/uninit-13.c unconditional (test for warnings, line 8)
FAIL: gcc.dg/gomp/complex-1.c (internal compiler error)
FAIL: gcc.dg/gomp/complex-1.c (test for excess errors)
FAIL: gcc.dg/matrix/matrix-1.c scan-ipa-dump-times matrix-reorg "Flattened 3 dimensions" 1: dump file does not exist
FAIL: gcc.dg/matrix/matrix-2.c scan-ipa-dump-times matrix-reorg "Flattened 2 dimensions" 1: dump file does not exist
FAIL: gcc.dg/matrix/matrix-3.c scan-ipa-dump-times matrix-reorg "Flattened 2 dimensions" 1: dump file does not exist
FAIL: gcc.dg/matrix/matrix-4.c scan-ipa-dump-times matrix-reorg "Flattened" 0: dump file does not exist
FAIL: gcc.dg/matrix/matrix-5.c scan-ipa-dump-times matrix-reorg "Flattened" 0: dump file does not exist
FAIL: gcc.dg/matrix/matrix-6.c scan-ipa-dump-times matrix-reorg "Flattened 2 dimensions" 1: dump file does not exist
FAIL: gcc.dg/matrix/transpose-1.c scan-ipa-dump-times matrix-reorg "Flattened 3 dimensions" 1: dump file does not exist
FAIL: gcc.dg/matrix/transpose-1.c scan-ipa-dump-times matrix-reorg "Transposed" 3: dump file does not exist
FAIL: gcc.dg/matrix/transpose-2.c scan-ipa-dump-times matrix-reorg "Flattened 3 dimensions" 1: dump file does not exist
FAIL: gcc.dg/matrix/transpose-2.c scan-ipa-dump-times matrix-reorg "Transposed" 0: dump file does not exist
FAIL: gcc.dg/matrix/transpose-3.c scan-ipa-dump-times matrix-reorg "Flattened 2 dimensions" 1: dump file does not exist
FAIL: gcc.dg/matrix/transpose-3.c scan-ipa-dump-times matrix-reorg "Transposed" 2: dump file does not exist
FAIL: gcc.dg/matrix/transpose-4.c scan-ipa-dump-times matrix-reorg "Flattened 3 dimensions" 1: dump file does not exist
FAIL: gcc.dg/matrix/transpose-4.c scan-ipa-dump-times matrix-reorg "Transposed" 2: dump file does not exist
FAIL: gcc.dg/matrix/transpose-5.c scan-ipa-dump-times matrix-reorg "Flattened 3 dimensions" 1: dump file does not exist
FAIL: gcc.dg/matrix/transpose-5.c scan-ipa-dump-times matrix-reorg "Transposed" 0: dump file does not exist
FAIL: gcc.dg/matrix/transpose-6.c scan-ipa-dump-times matrix-reorg "Flattened 3 dimensions" 1: dump file does not exist
FAIL: gcc.dg/matrix/transpose-6.c scan-ipa-dump-times matrix-reorg "Transposed" 0: dump file does not exist
FAIL: gcc.dg/tree-ssa/20030709-2.c scan-tree-dump-times cddce ".rtmem" 0
FAIL: gcc.dg/tree-ssa/20030807-2.c scan-tree-dump-times dom3 "if " 0
FAIL: gcc.dg/tree-ssa/20030922-1.c scan-tree-dump-times dom3 "if " 0
FAIL: gcc.dg/tree-ssa/asm-3.c scan-tree-dump-times optimized "bar [(]t[)]" 1
XPASS: gcc.dg/tree-ssa/loadpre1.c scan-tree-dump-times pre "Eliminated: 1" 1
FAIL: gcc.dg/tree-ssa/loop-15.c scan-tree-dump-times optimized "n \\* n" 1
FAIL: gcc.dg/tree-ssa/loop-17.c scan-tree-dump sccp "set_nb_iterations_in_loop = 1"
FAIL: gcc.dg/tree-ssa/loop-19.c scan-tree-dump-times final_cleanup "MEM.(base: &|symbol: )a," 2
FAIL: gcc.dg/tree-ssa/loop-19.c scan-tree-dump-times final_cleanup "MEM.(base: &|symbol: )c," 2
FAIL: gcc.dg/tree-ssa/loop-35.c scan-tree-dump-times lim "Executing store motion of" 8
XPASS: gcc.dg/tree-ssa/ltrans-3.c scan-tree-dump-times ltrans "transformed loop" 1
FAIL: gcc.dg/tree-ssa/pr16721.c scan-tree-dump-times optimized "->addr" 1
FAIL: gcc.dg/tree-ssa/pr20139.c scan-tree-dump-times final_cleanup "link_error" 0
FAIL: gcc.dg/tree-ssa/pr32901.c scan-tree-dump-times gimple "thefoo.* = {}" 1
FAIL: gcc.dg/tree-ssa/recip-7.c scan-tree-dump-times recip " / " 1
FAIL: gcc.dg/tree-ssa/ssa-fre-13.c scan-tree-dump fre "Inserted .* &a"
FAIL: gcc.dg/tree-ssa/ssa-fre-13.c scan-tree-dump fre "Replaced tmp1_.\\(D\\)->data"
FAIL: gcc.dg/tree-ssa/ssa-fre-14.c scan-tree-dump fre "Inserted .* &a"
FAIL: gcc.dg/tree-ssa/ssa-fre-14.c scan-tree-dump fre "Replaced tmp1.data"
FAIL: gcc.dg/tree-ssa/ssa-fre-15.c scan-tree-dump fre "Replaced"
FAIL: gcc.dg/tree-ssa/ssa-fre-16.c scan-tree-dump-not fre "link_error"
FAIL: gcc.dg/tree-ssa/ssa-fre-7.c scan-tree-dump-times fre "Inserted pretmp" 1
FAIL: gcc.dg/tree-ssa/ssa-fre-7.c scan-tree-dump-times fre "Replaced a.u.f with pretmp" 3
FAIL: gcc.dg/tree-ssa/ssa-fre-7.c scan-tree-dump-times fre "Replaced a.u.k with j" 1
FAIL: gcc.dg/tree-ssa/ssa-fre-7.c scan-tree-dump fre "= VIEW_CONVERT_EXPR<float>\\(j_"
FAIL: gcc.dg/tree-ssa/ssa-fre-7.c scan-tree-dump optimized "return j"
FAIL: gcc.dg/tree-ssa/ssa-fre-8.c scan-tree-dump-times fre "Replaced u.f with pretmp" 2
FAIL: gcc.dg/tree-ssa/ssa-fre-8.c scan-tree-dump-times fre "Inserted pretmp" 2
FAIL: gcc.dg/tree-ssa/ssa-fre-9.c scan-tree-dump-times fre "Eliminated: 1" 2
FAIL: gcc.dg/tree-ssa/ssa-fre-9.c scan-tree-dump-times fre "Insertions: 1" 2
FAIL: gcc.dg/tree-ssa/ssa-pre-15.c scan-tree-dump optimized "= 0;"
FAIL: gcc.dg/vect/vect-67.c scan-tree-dump-times vect "vectorized 1 loops" 1
FAIL: gcc.dg/vect/vect-iv-9.c scan-tree-dump-times vect "vectorized 1 loops" 2
FAIL: gcc.dg/vect/no-math-errno-slp-32.c (internal compiler error)
FAIL: gcc.dg/vect/no-math-errno-slp-32.c (test for excess errors)
FAIL: gcc.dg/vect/no-scevccp-outer-13.c scan-tree-dump-times vect "OUTER LOOP VECTORIZED." 1
FAIL: gcc.dg/vect/no-scevccp-outer-7.c scan-tree-dump-times vect "OUTER LOOP VECTORIZED." 1
FAIL: 96:is -:should be 1
FAIL: 132:is 8:should be 5
FAIL: 133:is 6:should be 3
FAIL: 138:is 3:should be 2
FAIL: gcc.misc-tests/gcov-4.c gcov: 4 failures in line counts, 0 in branch percentages, 0 in return percentages

		=== gcc Summary ===

# of expected passes		50106
# of unexpected failures	73
# of unexpected successes	2
# of expected failures		170
# of unsupported tests		642
/space/rguenther/obj/gcc/xgcc  version 4.4.0 20080708 (experimental) (gimple-tuples-branch merged with rev 137633) 

		=== gfortran tests ===


Running target unix
FAIL: gfortran.dg/parameter_array_init_4.f90  -O0  (test for excess errors)
FAIL: gfortran.dg/parameter_array_init_4.f90  -O1  (test for excess errors)
FAIL: gfortran.dg/parameter_array_init_4.f90  -O2  (test for excess errors)
FAIL: gfortran.dg/parameter_array_init_4.f90  -O3 -fomit-frame-pointer  (test for excess errors)
FAIL: gfortran.dg/parameter_array_init_4.f90  -O3 -fomit-frame-pointer -funroll-loops  (test for excess errors)
FAIL: gfortran.dg/parameter_array_init_4.f90  -O3 -fomit-frame-pointer -funroll-all-loops -finline-functions  (test for excess errors)
FAIL: gfortran.dg/parameter_array_init_4.f90  -O3 -g  (test for excess errors)
FAIL: gfortran.dg/parameter_array_init_4.f90  -Os  (test for excess errors)

		=== gfortran Summary ===

# of expected passes		26967
# of unexpected failures	8
# of expected failures		8
# of unsupported tests		34
/space/rguenther/obj/gcc/testsuite/gfortran/../../gfortran  version 4.4.0 20080708 (experimental) (gimple-tuples-branch merged with rev 137633) 

		=== objc tests ===


Running target unix

		=== objc Summary ===

# of expected passes		1814
# of expected failures		7
# of unsupported tests		24
/space/rguenther/obj/gcc/xgcc  version 4.4.0 20080708 (experimental) (gimple-tuples-branch merged with rev 137633) 

		=== libffi tests ===


Running target unix

		=== libffi Summary ===

# of expected passes		1389
# of unsupported tests		10
		=== libgomp tests ===


Running target unix
FAIL: libgomp.c/autopar-1.c (internal compiler error)
FAIL: libgomp.c/autopar-1.c (test for excess errors)
WARNING: libgomp.c/autopar-1.c compilation failed to produce executable
WARNING: program timed out.
FAIL: libgomp.c/collapse-1.c execution test
FAIL: libgomp.c/critical-2.c execution test
FAIL: libgomp.c/private-1.c execution test
FAIL: libgomp.c/task-1.c execution test
FAIL: libgomp.c++/task-1.C  -O  execution test
FAIL: libgomp.c++/task-6.C  -O  execution test

		=== libgomp Summary ===

# of expected passes		2281
# of unexpected failures	8
		=== libjava tests ===


Running target unix
FAIL: TestClosureGC run
FAIL: Array_3 execution - source compiled test
FAIL: Array_3 -findirect-dispatch execution - source compiled test
FAIL: Array_3 -O3 execution - source compiled test
FAIL: Array_3 -O3 -findirect-dispatch execution - source compiled test
FAIL: Divide_1 execution - source compiled test
FAIL: Divide_1 -findirect-dispatch execution - source compiled test
FAIL: Divide_1 -O3 execution - source compiled test
FAIL: Divide_1 -O3 -findirect-dispatch execution - source compiled test
FAIL: Invoke_1 execution - source compiled test
FAIL: Invoke_1 -findirect-dispatch execution - source compiled test
FAIL: Invoke_1 -O3 execution - source compiled test
FAIL: Invoke_1 -O3 -findirect-dispatch execution - source compiled test
FAIL: pr83 -findirect-dispatch execution - source compiled test
FAIL: pr83 -O3 -findirect-dispatch execution - source compiled test

		=== libjava Summary ===

# of expected passes		2545
# of unexpected failures	15
# of untested testcases		15
		=== libmudflap tests ===


Running target unix

		=== libmudflap Summary ===

# of expected passes		1865
		=== libstdc++ tests ===


Running target unix
FAIL: 22_locale/num_put/put/wchar_t/20914.cc execution test
FAIL: 23_containers/deque/invalidation/4.cc execution test
FAIL: ext/pb_ds/regression/trie_data_map_rand.cc execution test
FAIL: tr1/3_function_objects/function/5.cc (test for excess errors)
WARNING: tr1/3_function_objects/function/5.cc compilation failed to produce executable

		=== libstdc++ Summary ===

# of expected passes		5913
# of unexpected failures	4
# of expected failures		80
# of unsupported tests		10

Compiler version: 4.4.0 20080708 (experimental) (gimple-tuples-branch merged with rev 137633) 
Platform: x86_64-unknown-linux-gnu
configure flags: --disable-libstdcxx-pch --disable-nls
EOF
Mail -s "Results for 4.4.0 20080708 (experimental) (gimple-tuples-branch merged with rev 137633) testsuite on x86_64-unknown-linux-gnu" gcc-testresults@gcc.gnu.org &&
mv /space/rguenther/obj/./gcc/testsuite/g++/g++.sum /space/rguenther/obj/./gcc/testsuite/g++/g++.sum.sent &&
mv /space/rguenther/obj/./gcc/testsuite/gcc/gcc.sum /space/rguenther/obj/./gcc/testsuite/gcc/gcc.sum.sent &&
mv /space/rguenther/obj/./gcc/testsuite/gfortran/gfortran.sum /space/rguenther/obj/./gcc/testsuite/gfortran/gfortran.sum.sent &&
mv /space/rguenther/obj/./gcc/testsuite/objc/objc.sum /space/rguenther/obj/./gcc/testsuite/objc/objc.sum.sent &&
mv /space/rguenther/obj/./x86_64-unknown-linux-gnu/libffi/testsuite/libffi.sum /space/rguenther/obj/./x86_64-unknown-linux-gnu/libffi/testsuite/libffi.sum.sent &&
mv /space/rguenther/obj/./x86_64-unknown-linux-gnu/libgomp/testsuite/libgomp.sum /space/rguenther/obj/./x86_64-unknown-linux-gnu/libgomp/testsuite/libgomp.sum.sent &&
mv /space/rguenther/obj/./x86_64-unknown-linux-gnu/libjava/testsuite/libjava.sum /space/rguenther/obj/./x86_64-unknown-linux-gnu/libjava/testsuite/libjava.sum.sent &&
mv /space/rguenther/obj/./x86_64-unknown-linux-gnu/libmudflap/testsuite/libmudflap.sum /space/rguenther/obj/./x86_64-unknown-linux-gnu/libmudflap/testsuite/libmudflap.sum.sent &&
mv /space/rguenther/obj/./x86_64-unknown-linux-gnu/libstdc++-v3/testsuite/libstdc++.sum /space/rguenther/obj/./x86_64-unknown-linux-gnu/libstdc++-v3/testsuite/libstdc++.sum.sent &&
mv /space/rguenther/obj/./gcc/testsuite/g++/g++.log /space/rguenther/obj/./gcc/testsuite/g++/g++.log.sent &&
mv /space/rguenther/obj/./gcc/testsuite/gcc/gcc.log /space/rguenther/obj/./gcc/testsuite/gcc/gcc.log.sent &&
mv /space/rguenther/obj/./gcc/testsuite/gfortran/gfortran.log /space/rguenther/obj/./gcc/testsuite/gfortran/gfortran.log.sent &&
mv /space/rguenther/obj/./gcc/testsuite/objc/objc.log /space/rguenther/obj/./gcc/testsuite/objc/objc.log.sent &&
mv /space/rguenther/obj/./x86_64-unknown-linux-gnu/libffi/testsuite/libffi.log /space/rguenther/obj/./x86_64-unknown-linux-gnu/libffi/testsuite/libffi.log.sent &&
mv /space/rguenther/obj/./x86_64-unknown-linux-gnu/libgomp/testsuite/libgomp.log /space/rguenther/obj/./x86_64-unknown-linux-gnu/libgomp/testsuite/libgomp.log.sent &&
mv /space/rguenther/obj/./x86_64-unknown-linux-gnu/libjava/testsuite/libjava.log /space/rguenther/obj/./x86_64-unknown-linux-gnu/libjava/testsuite/libjava.log.sent &&
mv /space/rguenther/obj/./x86_64-unknown-linux-gnu/libmudflap/testsuite/libmudflap.log /space/rguenther/obj/./x86_64-unknown-linux-gnu/libmudflap/testsuite/libmudflap.log.sent &&
mv /space/rguenther/obj/./x86_64-unknown-linux-gnu/libstdc++-v3/testsuite/libstdc++.log /space/rguenther/obj/./x86_64-unknown-linux-gnu/libstdc++-v3/testsuite/libstdc++.log.sent &&
true


More information about the Gcc-patches mailing list