public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* gcc 4.6.1 expand is playing tricks on me
@ 2011-07-08 13:21 Paulo J. Matos
  2011-07-08 14:35 ` Michael Matz
  0 siblings, 1 reply; 4+ messages in thread
From: Paulo J. Matos @ 2011-07-08 13:21 UTC (permalink / raw)
  To: gcc

Hi,

I got a few size regressions when moving from 4.5.3 to 4.6.1, all due to 
the same issue.

I have code that is basically a double word memory move:
void simple1(uint32 *a, uint32 *b) { *a = *b; }

GCC 4.6.1 is from this gimple:
simple1 (uint32 * a, uint32 * b)
{
   uint32 D.1927;

   # BLOCK 2 freq:10000
   # PRED: ENTRY [100.0%]  (fallthru,exec)
   D.1927_2 = *b_1(D);
   *a_3(D) = D.1927_2;
   return;
   # SUCC: EXIT [100.0%]

}

calling gen_movhi twice with:
call1 :
operand[0]: (reg:HI 19 [ D.1927 ])
operand[1]: (mem:HI (reg/v/f:QI 21 [ b ]))

call2 :
operand[0]: (mem:HI (reg/v/f:QI 20 [ a ]))
operand[1]: (reg:HI 19 [ D.1927 ])

while GCC 4.5.3 for _exactly_ the same gimple (as far as it is shown in 
the logs) it only calls gen_movhi with:
operand[0]: (mem:HI (reg/v/f:QI 20 [ a ]))
operand[1]: (mem:HI (reg/v/f:QI 21 [ b ]))

This seems to boil down to code that looks exactly the same between 
4.5.3-4.6.1 in cfgexpand.c, expand_gimple_basic_block:
	      def_operand_p def_p;
	      def_p = SINGLE_SSA_DEF_OPERAND (stmt, SSA_OP_DEF);

	      if (def_p != NULL)
		{
		  /* Ignore this stmt if it is in the list of
		     replaceable expressions.  */
		  if (SA.values
		      && bitmap_bit_p (SA.values,
				       SSA_NAME_VERSION (DEF_FROM_PTR (def_p))))
		    continue;
		}
	      last = expand_gimple_stmt (stmt);
	      maybe_dump_rtl_for_gimple_stmt (stmt, last);
	

gcc4.5.3 hits continue the first time it gets there and gcc4.6.1 fails 
the inner if and enters expand_gimple_stmt twice.

 From the comment in ssaexpand.h for the definition of SA.values, it says:
   /* For an SSA name version V bit V is set iff TER decided that 
 

      its definition should be forwarded.  */
   bitmap values;

What is TER? Any hints on why GCC 4.6.1 has now a different behaviour to 
GCC 4.5.3?

Cheers,
-- 
Paulo Matos

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

end of thread, other threads:[~2011-07-08 17:11 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-08 13:21 gcc 4.6.1 expand is playing tricks on me Paulo J. Matos
2011-07-08 14:35 ` Michael Matz
2011-07-08 14:59   ` Paulo J. Matos
2011-07-08 17:11     ` Paulo J. Matos

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