This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[tuples] Fix libgcc gimplification
- From: Diego Novillo <dnovillo at google dot com>
- To: gcc-patches at gcc dot gnu dot org, Aldy Hernandez <aldyh at redhat dot com>, Christopher Matthews <chrismatthews at google dot com>
- Date: Mon, 30 Jul 2007 18:47:55 -0400
- Subject: [tuples] Fix libgcc gimplification
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).
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;
}