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]

Re: RFA: Fix PR c++/46634


I can't approve this, but:

On Wed, 24 Nov 2010, Joern Rennecke wrote:

> @@ -881,7 +881,7 @@ digest_init_r (tree type, tree init, boo
>  	{
>  	  tree char_type = TYPE_MAIN_VARIANT (TREE_TYPE (TREE_TYPE (init)));
>  
> -	  if (TYPE_PRECISION (typ1) == BITS_PER_UNIT)
> +	  if (TYPE_PRECISION (typ1) == TYPE_PRECISION (char_type_node))
>  	    {
>  	      if (char_type != char_type_node)
>  		{

I think this is correct.

> @@ -907,7 +907,9 @@ digest_init_r (tree type, tree init, boo
>  	  if (TYPE_DOMAIN (type) != 0 && TREE_CONSTANT (TYPE_SIZE (type)))
>  	    {
>  	      int size = TREE_INT_CST_LOW (TYPE_SIZE (type));
> -	      size = (size + BITS_PER_UNIT - 1) / BITS_PER_UNIT;
> +	      unsigned char_size = TYPE_PRECISION (char_type_node);
> +
> +	      size = (size + char_size - 1) / char_size;

I think this is wrong, as I think TREE_STRING_LENGTH does count in 
BITS_PER_UNIT.

-- 
Joseph S. Myers
joseph@codesourcery.com


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