public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [tuples] Fix libgcc gimplification
@ 2007-07-31  0:01 Diego Novillo
  0 siblings, 0 replies; only message in thread
From: Diego Novillo @ 2007-07-31  0:01 UTC (permalink / raw)
  To: gcc-patches, Aldy Hernandez, Christopher Matthews

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2007-07-30 22:48 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-07-31  0:01 [tuples] Fix libgcc gimplification Diego Novillo

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).