This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: expanding addrs for initializers
On 10/7/05, DJ Delorie <dj@redhat.com> wrote:
>
> > Certainly looks plausible. Ok if it regression tests well.
>
> Tested OK, committed.
>
> /me wonders if the test should limit to non-aggregate types.
g++.dg/init/struct3.C still fails, because instead of restricting the
error to expanding conversions, you restricted it to truncating conversions.
The following fixes that.
Richard.
Index: varasm.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/varasm.c,v
retrieving revision 1.531
diff -c -3 -p -r1.531 varasm.c
*** varasm.c 7 Oct 2005 18:44:26 -0000 1.531
--- varasm.c 11 Oct 2005 14:34:03 -0000
*************** output_constant (tree exp, unsigned HOST
*** 3889,3895 ****
/* 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",
--- 3889,3895 ----
/* 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",