public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH][LTO] Clean up special casing for case GIMPLE_CHANGE_DYNAMIC_TYPE
@ 2008-09-29 22:10 Doug Kwan (關振德)
  2008-09-29 22:33 ` Diego Novillo
  0 siblings, 1 reply; 3+ messages in thread
From: Doug Kwan (關振德) @ 2008-09-29 22:10 UTC (permalink / raw)
  To: gcc-patches, Diego Novillo

Hi Diego,

   After your last check-in, the streamer handles types as expression
operands.  I think these are no longer required.  Tested on
i686-unknown-linux-gnu.

-Doug

008-09-29  Doug Kwan  <dougkwan@google.com>

        * lto-function-out.c (output_gimple_stmt): Remove special
        case code for GIMPLE_CHANGE_DYNAMIC_TYPE.  Use the general
        code to handle this gimple code.
        * lto-function-in.c (input_gimple_stmt): Ditto.

Index: gcc/gcc/lto-function-out.c
===================================================================
--- gcc/gcc/lto-function-out.c	(revision 140763)
+++ gcc/gcc/lto-function-out.c	(working copy)
@@ -1858,6 +1858,7 @@ output_gimple_stmt (struct output_block
     case GIMPLE_GOTO:
     case GIMPLE_PREDICT:
     case GIMPLE_RESX:
+    case GIMPLE_CHANGE_DYNAMIC_TYPE:
       for (i = 0; i < gimple_num_ops (stmt); i++)
 	{
 	  tree op = gimple_op (stmt, i);
@@ -1868,13 +1869,6 @@ output_gimple_stmt (struct output_block
 	}
       break;

-    case GIMPLE_CHANGE_DYNAMIC_TYPE:
-      /* The first operand of GIMPLE_CHANGE_DYNAMIC_TYPE is a type.
-	 So have to handle it specially.  */
-      output_type_ref (ob, gimple_cdt_new_type (stmt));
-      output_expr_operand (ob, gimple_cdt_location (stmt));
-      break;
-
     default:
       gcc_unreachable ();
     }
Index: gcc/gcc/lto-function-in.c
===================================================================
--- gcc/gcc/lto-function-in.c	(revision 140763)
+++ gcc/gcc/lto-function-in.c	(working copy)
@@ -2033,35 +2033,16 @@ input_gimple_stmt (struct lto_input_bloc
       stmt->gimple_asm.string = TREE_STRING_POINTER (str);
     }

-  /* GIMPLE_CHANGE_DYNAMIC_TYPE is special.  The first operand is a
-     type.  So handle it specially.  We assume both operands are
-     never NULL. */
-  if (code == GIMPLE_CHANGE_DYNAMIC_TYPE)
+  for (i = 0; i < num_ops; i++)
     {
-      tree new_type, location;
-      enum LTO_tags tag;
-
-      new_type = input_type_ref (data_in, ib);
-      gimple_cdt_set_new_type (stmt, new_type);
-
-      tag = input_record_start (ib);
-      gcc_assert (tag);
-      location = input_expr_operand (ib, data_in, fn, tag);
-      gimple_cdt_set_location (stmt, location);
-    }
-  else
-    {
-      for (i = 0; i < num_ops; i++)
+      enum LTO_tags tag = input_record_start (ib);
+      if (tag)
 	{
-	  enum LTO_tags tag = input_record_start (ib);
-	  if (tag)
-	    {
-	      /* FIXME lto.  We shouldn't be writing NULL operands.  Use
-		 alternate tags to identify tuple variants (e.g.,
-		 GIMPLE_CALLs without a return value).  */
-	      tree op = input_expr_operand (ib, data_in, fn, tag);
-	      gimple_set_op (stmt, i, op);
-	    }
+	  /* FIXME lto.  We shouldn't be writing NULL operands.  Use
+	     alternate tags to identify tuple variants (e.g.,
+	     GIMPLE_CALLs without a return value).  */
+	  tree op = input_expr_operand (ib, data_in, fn, tag);
+	  gimple_set_op (stmt, i, op);
 	}
     }

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH][LTO] Clean up special casing for case GIMPLE_CHANGE_DYNAMIC_TYPE
  2008-09-29 22:10 [PATCH][LTO] Clean up special casing for case GIMPLE_CHANGE_DYNAMIC_TYPE Doug Kwan (關振德)
@ 2008-09-29 22:33 ` Diego Novillo
  2008-09-29 23:49   ` Doug Kwan (關振德)
  0 siblings, 1 reply; 3+ messages in thread
From: Diego Novillo @ 2008-09-29 22:33 UTC (permalink / raw)
  To: Doug Kwan (關振德); +Cc: gcc-patches

On Mon, Sep 29, 2008 at 17:19, Doug Kwan (關振德) <dougkwan@google.com> wrote:
> Hi Diego,
>
>   After your last check-in, the streamer handles types as expression
> operands.  I think these are no longer required.  Tested on
> i686-unknown-linux-gnu.

Ah, yes, good catch.

>        * lto-function-out.c (output_gimple_stmt): Remove special
>        case code for GIMPLE_CHANGE_DYNAMIC_TYPE.  Use the general
>        code to handle this gimple code.
>        * lto-function-in.c (input_gimple_stmt): Ditto.

OK.


Diego.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH][LTO] Clean up special casing for case GIMPLE_CHANGE_DYNAMIC_TYPE
  2008-09-29 22:33 ` Diego Novillo
@ 2008-09-29 23:49   ` Doug Kwan (關振德)
  0 siblings, 0 replies; 3+ messages in thread
From: Doug Kwan (關振德) @ 2008-09-29 23:49 UTC (permalink / raw)
  To: Diego Novillo; +Cc: gcc-patches

Thanks.  I've just commited the patch.

-Doug

2008/9/29 Diego Novillo <dnovillo@google.com>:
> On Mon, Sep 29, 2008 at 17:19, Doug Kwan (關振德) <dougkwan@google.com> wrote:
>> Hi Diego,
>>
>>   After your last check-in, the streamer handles types as expression
>> operands.  I think these are no longer required.  Tested on
>> i686-unknown-linux-gnu.
>
> Ah, yes, good catch.
>
>>        * lto-function-out.c (output_gimple_stmt): Remove special
>>        case code for GIMPLE_CHANGE_DYNAMIC_TYPE.  Use the general
>>        code to handle this gimple code.
>>        * lto-function-in.c (input_gimple_stmt): Ditto.
>
> OK.
>
>
> Diego.
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-09-29 21:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-09-29 22:10 [PATCH][LTO] Clean up special casing for case GIMPLE_CHANGE_DYNAMIC_TYPE Doug Kwan (關振德)
2008-09-29 22:33 ` Diego Novillo
2008-09-29 23:49   ` Doug Kwan (關振德)

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