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: expanding addrs for initializers


> I think this patch is better :-(

As you wish, but...

> It seems a lot of code assumes that a no-op convert of a different
> size "just works" by the time it gets to this function, although it
> clearly does NOT work for m32c because of the blind padding problem.
> I recall having reservations about this part of the patch before, it
> seems they were justfied.

...I think it is still valuable for "regular" conversions and...

> So, rather than add exception after exception, let's just drop the
> check and go back to the way it was before.

...this was very likely the last exception for Ada.

> Index: varasm.c
> ===================================================================
> RCS file: /cvs/gcc/gcc/gcc/varasm.c,v
> retrieving revision 1.529
> diff -p -U3 -r1.529 varasm.c
> --- varasm.c	18 Sep 2005 17:11:11 -0000	1.529
> +++ varasm.c	19 Sep 2005 19:58:14 -0000
> @@ -3880,15 +3880,6 @@ output_constant (tree exp, unsigned HOST
>        HOST_WIDE_INT type_size = int_size_in_bytes (TREE_TYPE (exp));
>        HOST_WIDE_INT op_size = int_size_in_bytes (TREE_TYPE (TREE_OPERAND
> (exp, 0)));
>
> -      /* Make sure eliminating the conversion is really a no-op, except
> with -	 VIEW_CONVERT_EXPRs to allow for wild Ada unchecked conversions and
> -	 union types to allow for Ada unchecked unions.  */
> -      if (type_size != op_size
> -	  && TREE_CODE (exp) != VIEW_CONVERT_EXPR
> -	  && TREE_CODE (TREE_TYPE (exp)) != UNION_TYPE)
> -	internal_error ("no-op convert from %wd to %wd bytes in initializer",
> -			op_size, type_size);
> -
>        exp = TREE_OPERAND (exp, 0);
>      }

That's not a complete reversion.  You need to scrap the entire {} block and 
only put back the assignment to 'exp'.

-- 
Eric Botcazou


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