This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [applied] C++ patch to fix arrays of vectors
- From: Mark Mitchell <mark at codesourcery dot com>
- To: Aldy Hernandez <aldyh at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: 04 Jun 2003 18:21:05 -0700
- Subject: Re: [applied] C++ patch to fix arrays of vectors
- References: <697D8A5B-9628-11D7-93B0-000393750C1E@redhat.com>
> *************** reshape_init (tree type, tree *initp)
> *** 7483,7490 ****
> non-empty subaggregate, brace elision is assumed and the
> initializer is considered for the initialization of the first
> member of the subaggregate. */
> ! if (CLASS_TYPE_P (type)
> ! && !brace_enclosed_p
> && can_convert_arg (type, TREE_TYPE (old_init_value),
> old_init_value))
> {
> *initp = TREE_CHAIN (old_init);
> --- 7484,7490 ----
> non-empty subaggregate, brace elision is assumed and the
> initializer is considered for the initialization of the first
> member of the subaggregate. */
> ! if (!brace_enclosed_p
> && can_convert_arg (type, TREE_TYPE (old_init_value),
> old_init_value))
> {
> *initp = TREE_CHAIN (old_init);
This hunk is potentially dangerous and definitely suboptimal.
Please revise this to check for
CLASS_TYPE_P (type) || TREE_CODE (type) == VECTOR_TYPE
We shouldn't be going into that code for an array type.
Thanks,
--
Mark Mitchell
CodeSourcery, LLC
mark@codesourcery.com