* [tuples] Fix remaining compile.exp failures
@ 2007-08-03 22:36 Diego Novillo
2007-08-05 9:28 ` Aldy Hernandez
0 siblings, 1 reply; 2+ messages in thread
From: Diego Novillo @ 2007-08-03 22:36 UTC (permalink / raw)
To: gcc-patches, Christopher Matthews, Aldy Hernandez
[-- Attachment #1: Type: text/plain, Size: 219 bytes --]
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.
[-- Attachment #2: 20070803-fix-compile.exp.diff --]
[-- Type: text/x-patch, Size: 3337 bytes --]
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;
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [tuples] Fix remaining compile.exp failures
2007-08-03 22:36 [tuples] Fix remaining compile.exp failures Diego Novillo
@ 2007-08-05 9:28 ` Aldy Hernandez
0 siblings, 0 replies; 2+ messages in thread
From: Aldy Hernandez @ 2007-08-05 9:28 UTC (permalink / raw)
To: Diego Novillo; +Cc: gcc-patches, Christopher Matthews
On Fri, Aug 03, 2007 at 06:36:27PM -0400, Diego Novillo wrote:
>
> 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.
By the way, I am working on lowering gimple to gimple low. I should
have "something" by the end of the week.
Thanks for the patch.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-08-05 9:28 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-08-03 22:36 [tuples] Fix remaining compile.exp failures Diego Novillo
2007-08-05 9:28 ` Aldy Hernandez
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).