This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Patch: PR middle-end/8784: ARRAY_TYPE should not use store_expr
- From: Mark Mitchell <mark at codesourcery dot com>
- To: David Edelsohn <dje at watson dot ibm dot com>, "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: Sun, 22 Dec 2002 20:47:13 -0800
- Subject: Re: Patch: PR middle-end/8784: ARRAY_TYPE should not use store_expr
--On Friday, December 20, 2002 02:06:29 PM -0500 David Edelsohn
<dje@watson.ibm.com> wrote:
The testcase attached to PR 8784 creates a VAR_DECL with type
ARRAY_TYPE in the internally-generated
__static_initialization_and_destruction_0(int, int)
function. Despite the type, VAR_DECL avoids the special treatment for
ARRAY_REFS, so expand_assignment uses store_expr which calls
convert_to_mode. The ARRAY_TYPE becomes BLKmode which convert_to_mode and
friends cannot handle, leading to ICE.
This patch recognizes the ARRAY_TYPE and applies the same special
treatment for ARRAY_REFS.
If I understand correctly, we're generating something like:
int i[10];
int j[10];
i = j;
This isn't legal C, but we've generated with trees.
Your patch causes that assignment to work, is that right?
What is the type of the array elements? I'm worried that we shouldn't
be doing a bitwise copy, i.e., that this is a bug in the C++ front end.
Thanks,
--
Mark Mitchell mark@codesourcery.com
CodeSourcery, LLC http://www.codesourcery.com