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: [applied] C++ patch to fix arrays of vectors


> *************** 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


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