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: [patch] Basic block SLP


On Sun, May 24, 2009 at 2:15 AM, Ira Rosen <IRAR@il.ibm.com> wrote:
>
>
> Richard Guenther <richard.guenther@gmail.com> wrote on 21/05/2009 15:00:11:
>
>> On Thu, May 21, 2009 at 1:55 PM, Ira Rosen <IRAR@il.ibm.com> wrote:
> ...
>
>> >> >> > 2. there are 23 tests that fail with: "error: alignment of array
>> >> > elements
>> >> >> > is greater than element size" (e.g.
>> >> > gcc.dg/torture/stackalign/nested-2.c
>> >> >> > and g++.dg/torture/stackalign/eh-alloca-1.C). They all have
>> >> >> > __attribute__((aligned(64))). The failure occurs when we are
> trying
>> > to
>> >> >> > vectorize the basic block and get a vector type for the aligned
>> > type. I
>> >> >> > guess, otherwise, we just never get to this check. Hence, these
>> >> > failures
>> >> >> > are not really related to SLP. What is the best way to handle
> this?
>> >> >>
>> >> >> You need to use the TYPE_MAIN_VARIANT for the element type
>> >> >> of the vector (though I don't see where arrays or SLP should come
>> >> >> into play in these testcases at all...).
>> >> >
>> >> > SLP checks every basic block, and if it finds data references, it
>> > checks if
>> >> > there is a vector type for the scalar type of the data reference. It
>> > calls
>> >> > make_vector_type() for a vector type, where array of this type is
> built
>> > for
>> >> > debug representation purposes (AFAIU).
>> >>
>> >> Doh indeed. ?The problem is the layout_type call there. ?As we
>> >> strip the single array type from the single FIELD_DECL of the
>> >> struct we build here in _all_ places I think a proper fix would
>> >> be to simply not build a structure here but directly set the
>> >> array type as TYPE_DEBUG_REPRESENTATION_TYPE
>> >> (which doesn't need layout_type).
>> >
>> > It is in layout_type call, but not in the call from make_vector_type,
> but
>> > from build_array_type:
>> >
>> > Breakpoint 1, layout_type (type=0x2b2860eb2240)
>> > at ../../gcc/gcc/stor-layout.c:1848
>> > 1848 ? ? ? ? ? ? ?error ("alignment of array elements is greater than
>> > element size");
>> > (gdb) back
>> > #0 ?layout_type (type=0x2b2860eb2240)
> at ../../gcc/gcc/stor-layout.c:1848
>> > #1 ?0x00000000008dc33c in type_hash_lookup (hashcode=2524125531,
> type=0x40)
>> > at ../../gcc/gcc/tree.c:4721
>> > #2 ?0x00000000008dc3c9 in type_hash_canon (hashcode=2524125531,
> type=0x40)
>> > at ../../gcc/gcc/tree.c:4772
>> > #3 ?0x00000000008dd1d1 in build_array_type (elt_type=0x2b2860e52600,
>> > index_type=0x2b2860dd90c0) at ../../gcc/gcc/tree.c:5851
>> > #4 ?0x00000000008f4d1d in make_vector_type (innertype=0x2b2860e52600,
>> > nunits=4, mode=VOIDmode) at ../../gcc/gcc/tree.c:7441
>> > #5 ?0x000000000089d9c8 in get_vectype_for_scalar_type
>> > (scalar_type=0x2b2860e52600) at ../../gcc/gcc/tree-vect-stmts.c:4348
>> > #6 ?0x0000000000bbc3ef in vect_analyze_data_refs (loop_vinfo=<value
>> > optimized out>, bb_vinfo=<value optimized out>)
>> > ? ?at ../../gcc/gcc/tree-vect-data-refs.c:2050
>> > ...
>> > (gdb) p debug_generic_expr (type)
>> > aligned[4]
>> > $6 = void
>> >
>> > So, the problem is in building the array type...
>>
>> Hmm, ok. ?I suggest you ignore these failures for now and file a
> bugreport.
>> I will take care of it.
>
> Thanks!
> Committed revision 147829.
> Opened PR 40233.
>

This also caused:

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40244
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40245

-- 
H.J.


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