public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/60989] New: automatic increase of global array for vectorization doesn't work due to flag_section_anchors==0
@ 2014-04-28 15:21 andi-gcc at firstfloor dot org
  2014-04-28 15:28 ` [Bug tree-optimization/60989] " jakub at gcc dot gnu.org
  2014-04-29  0:18 ` andi-gcc at firstfloor dot org
  0 siblings, 2 replies; 3+ messages in thread
From: andi-gcc at firstfloor dot org @ 2014-04-28 15:21 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 60989
           Summary: automatic increase of global array for vectorization
                    doesn't work due to flag_section_anchors==0
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: andi-gcc at firstfloor dot org

Target x86_64-linux

Following simple test case:

#define N 64
#define ALIGN // __attribute__((aligned(64)))
int a[N] ALIGN;
int b[N] ALIGN;

main()
{
        int i;
        for (i = 0; i < N; i++)
                a[i] = b[i] + 1;
}

If I leave the ALIGN commented out  I get really horrible manual alignment
prologue code like
-O3 -mavx512f

   .cfi_startproc
        movl    $a, %eax
        andl    $63, %eax
        shrq    $2, %rax
        negq    %rax
        andl    $15, %eax
        je      .L7
        movl    b(%rip), %edi
        cmpl    $1, %eax
        leal    1(%rdi), %edx
        movl    %edx, a(%rip)
        je      .L8
...
   lots of repeats upto 63


With ALIGN it's a nice short perfectly vectorized loop.

It seems the automatic alignment of global variables doesn't work anymore.

I checked the increase_alignment/ipa_increase_alignment pass in
tree-vectorize.c and both don't run because flag_section_anchors is 0 in the
gate.

I'm not fully sure what the flag means?


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug tree-optimization/60989] automatic increase of global array for vectorization doesn't work due to flag_section_anchors==0
  2014-04-28 15:21 [Bug tree-optimization/60989] New: automatic increase of global array for vectorization doesn't work due to flag_section_anchors==0 andi-gcc at firstfloor dot org
@ 2014-04-28 15:28 ` jakub at gcc dot gnu.org
  2014-04-29  0:18 ` andi-gcc at firstfloor dot org
  1 sibling, 0 replies; 3+ messages in thread
From: jakub at gcc dot gnu.org @ 2014-04-28 15:28 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
You need C++ or -fno-common.  Common variables really can't have alignment
increased by the compiler.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug tree-optimization/60989] automatic increase of global array for vectorization doesn't work due to flag_section_anchors==0
  2014-04-28 15:21 [Bug tree-optimization/60989] New: automatic increase of global array for vectorization doesn't work due to flag_section_anchors==0 andi-gcc at firstfloor dot org
  2014-04-28 15:28 ` [Bug tree-optimization/60989] " jakub at gcc dot gnu.org
@ 2014-04-29  0:18 ` andi-gcc at firstfloor dot org
  1 sibling, 0 replies; 3+ messages in thread
From: andi-gcc at firstfloor dot org @ 2014-04-29  0:18 UTC (permalink / raw)
  To: gcc-bugs

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

Andi Kleen <andi-gcc at firstfloor dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |INVALID

--- Comment #2 from Andi Kleen <andi-gcc at firstfloor dot org> ---
Ok fair enough.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-04-29  0:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-28 15:21 [Bug tree-optimization/60989] New: automatic increase of global array for vectorization doesn't work due to flag_section_anchors==0 andi-gcc at firstfloor dot org
2014-04-28 15:28 ` [Bug tree-optimization/60989] " jakub at gcc dot gnu.org
2014-04-29  0:18 ` andi-gcc at firstfloor dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).