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: [RFC] PR27770 (alignment with -fsection-anchors and vectorization) fix


Attached below is the patch I committed - there are bits in the testsuite
that weren't reviewed that I added in order to overcome this:

> - The patch increases the alignment of (global) arrays only. We have a
few
> testcases though (e.g. vect-69.c) that have global structs that contain
> fields that are arrays. Aligning the beginning of these structs can
> sometime align one/some of their array fields. Since this patch does not
> attempt to do that, we have some tests that will now fail (or fail on
> targets that don't support unaligned accesses).

Which other targets should be added to target-supports.exp as targets that
support section-anchors? (seems like some of the mips targets maybe?)

Thanks to Vladimir for testing this patch (bootstrap and vectorizer
testcases) on i686-pc-linux-gnu.

thanks,
dorit

        PR tree-optimization/27770
        * tree-vectorizer.h (get_vectype_for_scalar_type): Function
        declaration removed (moved to tree-flow.h).
        (vect_can_force_dr_alignment_p): Likewise.
        * tree-flow.h (get_vectype_for_scalar_type): New function
declaration
        (moved from tree-vectorizer.h).
        (vect_can_force_dr_alignment_p): Likewise.
        * tree-vectorizer.c (vect_print_dump_info): Allow calling this
function
        from outside the vectorizer - in particular from cgraph stage.
        * tree-vect-analyze.c (vect_compute_data_ref_alignment): Don't
increase
        the alignment of global arrays when -fsection-anchors is enabled.
        * cgraphunit.c (cgraph_increase_alignment): New function.
        (cgraph_optimize): Call cgraph_increase_alignment.


        PR tree-optimization/27770
        * lib/target-support.exp: New target keyword "section_anchors".
        * gcc.dg/vect/vect.exp: Add -fsection-anchors to compilation of
some
        tests.
        * gcc.dg/vect/section-anchors-pr27770.c: New test.
        * gcc.dg/vect/vect-69.c: Removed. Replaced by:
        * gcc.dg/vect/section-anchors-vect-69.c: New test.
        * gcc.dg/vect/no-section-anchors-vect-69.c: New test.



(See attached file: pr27770.fix.aug3.txt)


Mark Mitchell <mark@codesourcery.com> wrote on 03/08/2006 02:25:19 AM:

> Dorit Nuzman wrote:
> > Here's an attempt to address PR27770. In the testcase, when using
> > -fsection-anchors, we compile the function 'bar' assuming natural
alignment
> > for global array 'f', and later, when compiling the function foo, the
> > vectorizer increases the alignmnet of array 'f', which makes the code
we
> > generated for fucntion bar incorrect.
>
> Thanks for the detailed analysis.  Given Richard's agreement, I think we
> should go with your patch, so, patch approved.  Here's one minor comment:
>
> +       && UNITS_PER_SIMD_WORD /* CHECKME */)
>
> Remove the /* CHECKME */.  Or, if it still needs checking, check. :-)
>
> Thanks,
>
> --
> Mark Mitchell
> CodeSourcery
> mark@codesourcery.com
> (650) 331-3385 x713

Attachment: pr27770.fix.aug3.txt
Description: Text document


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