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]

[tuples] Fix remaining compile.exp failures


This patch fixes the remaining failures in compile.exp.  I will start
poking at the tuples->RTL translation early next week.  In the meantime,
we can continue running the other testsuites and fixing gimplifier ICEs.


2007-08-03  Diego Novillo  <dnovillo@google.com>

	* gimple-pretty-print.c (INDENT): Tidy.
	(dump_binary_rhs): New.
	(dump_gimple_assign): Call it.
	* gimplify.c (gimplify_modify_expr_complex_part): If the value
	is not interesting, nullify *EXPR_P.
	(gimplify_body): Do not add the sequence to the GIMPLE_BIND more
	than once.

Index: gimple-pretty-print.c
===================================================================
--- gimple-pretty-print.c	(revision 127180)
+++ gimple-pretty-print.c	(working copy)
@@ -34,8 +34,8 @@ Software Foundation, 51 Franklin Street,
 #include "tree-pass.h"
 #include "gimple.h"
 
-#define INDENT(SPACE) do { \
-  int i; for (i = 0; i<SPACE; i++) pp_space (buffer); } while (0)
+#define INDENT(SPACE)							\
+  do { int i; for (i = 0; i < SPACE; i++) pp_space (buffer); } while (0)
 
 static pretty_printer buffer;
 static bool initialized = false;
@@ -140,6 +140,32 @@ debug_gimple_seq (gimple_seq seq)
 }
 
 
+/* Helper for dump_gimple_assign.  Print the binary RHS of the
+   assignment GS.  BUFFER, SPC and FLAGS are as in dump_gimple_stmt.  */
+
+static void
+dump_binary_rhs (pretty_printer *buffer, gimple gs, int spc, int flags)
+{
+  switch (gimple_flags (gs))
+    {
+    case COMPLEX_EXPR:
+      pp_string (buffer, "COMPLEX_EXPR <");
+      dump_generic_node (buffer, gimple_assign_rhs1 (gs), spc, flags, false);
+      pp_string (buffer, ", ");
+      dump_generic_node (buffer, gimple_assign_rhs2 (gs), spc, flags, false);
+      pp_string (buffer, ">");
+      break;
+
+    default:
+      dump_generic_node (buffer, gimple_assign_rhs1 (gs), spc, flags, false);
+      pp_space (buffer);
+      pp_string (buffer, op_symbol_code (gimple_flags (gs)));
+      pp_space (buffer);
+      dump_generic_node (buffer, gimple_assign_rhs2 (gs), spc, flags, false);
+    }
+}
+
+
 /* Dump the gimple assignment GS.  BUFFER, SPC and FLAGS are as in
    dump_gimple_stmt.  */
 
@@ -154,13 +180,7 @@ dump_gimple_assign (pretty_printer *buff
   if (gimple_num_ops (gs) == 2)
     dump_generic_node (buffer, gimple_assign_rhs1 (gs), spc, flags, false);
   else if (gimple_num_ops (gs) == 3)
-    {
-      dump_generic_node (buffer, gimple_assign_rhs1 (gs), spc, flags, false);
-      pp_space (buffer);
-      pp_string (buffer, op_symbol_code (gimple_flags (gs)));
-      pp_space (buffer);
-      dump_generic_node (buffer, gimple_assign_rhs2 (gs), spc, flags, false);
-    }
+    dump_binary_rhs (buffer, gs, spc, flags);
   else
     gcc_unreachable ();
 }
Index: gimplify.c
===================================================================
--- gimplify.c	(revision 127180)
+++ gimplify.c	(working copy)
@@ -3724,10 +3724,9 @@ gimplify_modify_expr_complex_part (tree 
   else
     new_rhs = build2 (COMPLEX_EXPR, TREE_TYPE (lhs), realpart, imagpart);
 
-  if (want_value)
-    *expr_p = rhs;
-
   gimple_add (pre_p, build_gimple_assign (lhs, new_rhs));
+  *expr_p = (want_value) ? rhs : NULL_TREE;
+
   return GS_ALL_DONE;
 }
 
@@ -6628,10 +6627,7 @@ gimplify_body (tree *body_p, gimple_seq 
 
   /* If there isn't an outer GIMPLE_BIND, add one.  */
   if (gimple_code (outer_bind) != GIMPLE_BIND)
-    {
-      outer_bind = build_gimple_bind (NULL_TREE, seq_p);
-      gimple_add (seq_p, outer_bind);
-    }
+    outer_bind = build_gimple_bind (NULL_TREE, seq_p);
 
   *body_p = NULL_TREE;
 

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