[PATCH] Add early assert in gimplifier for volatile objects

Eric Botcazou ebotcazou@adacore.com
Wed Apr 5 14:44:00 GMT 2006


Hi,

I've an Ada testcase that blows up in cfgexpand.c because of an automatic 
variable with variable size.  It turns out that the variable has been created 
by the gimplifier

      else if (COMPLETE_TYPE_P (TREE_TYPE (*expr_p)))
	{
	  /* Historically, the compiler has treated a bare
	     reference to a volatile lvalue as forcing a load.  */
	  tree type = TYPE_MAIN_VARIANT (TREE_TYPE (*expr_p));
	  /* Normally, we do not want to create a temporary for a
	     TREE_ADDRESSABLE type because such a type should not be
	     copied by bitwise-assignment.  However, we make an
	     exception here, as all we are doing here is ensuring that
	     we read the bytes that make up the type.  We use
	     create_tmp_var_raw because create_tmp_var will abort when
	     given a TREE_ADDRESSABLE type.  */

The code bypasses the sanity check on the size in create_tmp_var so I'm 
proposing to add it there.  Lightly tested on AMD64/Linux.


2006-04-05  Eric Botcazou  <ebotcazou@adacore.com>

	* gimplify.c (gimplify_expr): Assert that the type has constant
	size before calling create_tmp_var_raw.


-- 
Eric Botcazou
-------------- next part --------------
A non-text attachment was scrubbed...
Name: p.diff
Type: text/x-diff
Size: 1106 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20060405/a4ee08fa/attachment.bin>


More information about the Gcc-patches mailing list