public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Diego Novillo <dnovillo@google.com>
To: gcc-patches@gcc.gnu.org,
	Christopher Matthews <chrismatthews@google.com>,
	        Aldy Hernandez <aldyh@redhat.com>
Subject: [tuples] Fix remaining compile.exp failures
Date: Fri, 03 Aug 2007 22:36:00 -0000	[thread overview]
Message-ID: <46B3ADEB.5000303@google.com> (raw)

[-- 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;
 

             reply	other threads:[~2007-08-03 22:36 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-03 22:36 Diego Novillo [this message]
2007-08-05  9:28 ` Aldy Hernandez

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=46B3ADEB.5000303@google.com \
    --to=dnovillo@google.com \
    --cc=aldyh@redhat.com \
    --cc=chrismatthews@google.com \
    --cc=gcc-patches@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).