This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Avoid setting first GIMPLE_DEBUG operand to MEM_REF in lto streaming (PR lto/46879)


Hi!

The first operand of GIMPLE_DEBUG must be a DECL, not a MEM_REF, so the
DECL -> MEM_REF replacement output_gimple_stmt does is wrong for it.

Fixed thusly, bootstrapped/regtested on x86_64-linux and i686-linux, ok for
trunk?

2010-12-10  Jakub Jelinek  <jakub@redhat.com>

	PR lto/46879
	* lto-streamer-out.c (output_gimple_stmt): Never replace first
	GIMPLE_DEBUG argument with MEM_REF.

--- gcc/lto-streamer-out.c.jj	2010-12-02 11:51:31.000000000 +0100
+++ gcc/lto-streamer-out.c	2010-12-10 17:13:32.000000000 +0100
@@ -1759,8 +1759,9 @@ output_gimple_stmt (struct output_block 
 	  tree op = gimple_op (stmt, i);
 	  /* Wrap all uses of non-automatic variables inside MEM_REFs
 	     so that we do not have to deal with type mismatches on
-	     merged symbols during IL read in.  */
-	  if (op)
+	     merged symbols during IL read in.  The first operand
+	     of GIMPLE_DEBUG must be a decl, not MEM_REF, though.  */
+	  if (op && (i || !is_gimple_debug (stmt)))
 	    {
 	      tree *basep = &op;
 	      while (handled_component_p (*basep))

	Jakub


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]