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, Aldy Hernandez <aldyh@redhat.com>,
	        Christopher Matthews <chrismatthews@google.com>
Subject: [tuples] Fix libgcc gimplification
Date: Tue, 31 Jul 2007 00:01:00 -0000	[thread overview]
Message-ID: <46AE6A9B.6030107@google.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 487 bytes --]


With this patch we can now gimplify all of libgcc without ICEing.  The
library isn't built, of course, as we still do not generate any code,
but at least we can gimplify all of it.

Aldy, Chris, we should add this as another test whenever we test
patches.  Make sure that we can continue going through libgcc and
gimple.exp.

Will commit as soon as I regain connectivity to gcc.gnu.org (not sure if
it's a local problem, as this machine is having issues with some other
sites as well).

[-- Attachment #2: 20070730-fix-libgcc.diff --]
[-- Type: text/x-patch, Size: 1362 bytes --]

2007-07-30  Diego Novillo  <dnovillo@google.com>

	* gimplify.c (get_tmp_var_for): When creating a new temporary
	for a GIMPLE_CALL, use the type returned by the function call
	instead of the type of the function decl.
	* gimple.c (build_gimple_return): Accept NULL and RESULT_DECL
	return values.

Index: gimplify.c
===================================================================
--- gimplify.c	(revision 127067)
+++ gimplify.c	(working copy)
@@ -640,7 +640,8 @@ get_tmp_var_for (gimple stmt)
   if (code == GIMPLE_ASSIGN)
     return create_tmp_from_val (gimple_assign_operand (stmt, 1));
   else if (code == GIMPLE_CALL)
-    return create_tmp_from_val (gimple_call_fn (stmt));
+    return create_tmp_var (TREE_TYPE (TREE_TYPE (gimple_call_fn (stmt))),
+			   get_name (gimple_call_fn (stmt)));
   else
     gcc_unreachable ();
 
Index: gimple.c
===================================================================
--- gimple.c	(revision 127018)
+++ gimple.c	(working copy)
@@ -145,7 +145,9 @@ gimple
 build_gimple_return (bool result_decl_p, tree retval)
 {
   gimple s = build_gimple_with_ops (GIMPLE_RETURN, (int) result_decl_p, 1);
-  gcc_assert (is_gimple_val (retval));
+  gcc_assert (retval == NULL_TREE
+              || TREE_CODE (retval) == RESULT_DECL
+	      || is_gimple_val (retval));
   gimple_return_set_retval (s, retval);
   return s;
 }

                 reply	other threads:[~2007-07-30 22:48 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=46AE6A9B.6030107@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).