public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/96075] New: bogus alignment for negative step grouped access
@ 2020-07-06 12:11 rguenth at gcc dot gnu.org
  2020-07-06 12:16 ` [Bug tree-optimization/96075] [8/9/10/11 Regression] " rguenth at gcc dot gnu.org
                   ` (17 more replies)
  0 siblings, 18 replies; 19+ messages in thread
From: rguenth at gcc dot gnu.org @ 2020-07-06 12:11 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96075

            Bug ID: 96075
           Summary: bogus alignment for negative step grouped access
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: rguenth at gcc dot gnu.org
  Target Milestone: ---

double x[1024], y[1024];

void __attribute__((noipa)) boo()
{
  for (int i = 0; i < 512; ++i)
    {
      x[2*i] = y[2*(511-i)];
      x[2*i+1] = y[2*(511-i)];
    }
}

int
main ()
{   
  for (int i = 0; i < 1024; ++i)
    {
      x[i] = 0;
      y[i] = i;
      __asm__ volatile ("");
    }

  boo ();
  for (int i = 0; i < 1024; ++i)
    if (x[i] != y[2*(511 - i/2)])
      abort ();

  return 0;
}


segfaults because we emit

boo:
.LFB8:
        .cfi_startproc
        xorl    %eax, %eax
        .p2align 4,,10
        .p2align 3
.L21:
        movapd  y+8168(%rax), %xmm0
        movq    %rax, %rdx

where this is obviously misaligned.

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

end of thread, other threads:[~2021-05-14 13:59 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-06 12:11 [Bug tree-optimization/96075] New: bogus alignment for negative step grouped access rguenth at gcc dot gnu.org
2020-07-06 12:16 ` [Bug tree-optimization/96075] [8/9/10/11 Regression] " rguenth at gcc dot gnu.org
2020-07-06 12:39 ` rguenth at gcc dot gnu.org
2020-07-06 13:18 ` rguenth at gcc dot gnu.org
2020-07-06 13:52 ` rsandifo at gcc dot gnu.org
2020-07-06 14:13 ` rguenther at suse dot de
2020-07-06 14:32 ` cvs-commit at gcc dot gnu.org
2020-07-06 14:32 ` [Bug tree-optimization/96075] [8/9/10 " rguenth at gcc dot gnu.org
2020-07-06 14:35 ` rguenth at gcc dot gnu.org
2020-07-07 11:01 ` cvs-commit at gcc dot gnu.org
2020-07-29  9:18 ` [Bug tree-optimization/96075] [8/9 " marxin at gcc dot gnu.org
2020-07-29  9:41 ` rguenth at gcc dot gnu.org
2020-12-02 13:23 ` cvs-commit at gcc dot gnu.org
2020-12-03  8:54 ` [Bug tree-optimization/96075] [8 " clyon at gcc dot gnu.org
2020-12-03 11:08 ` rguenther at suse dot de
2020-12-03 13:46 ` clyon at gcc dot gnu.org
2020-12-04 10:41 ` cvs-commit at gcc dot gnu.org
2020-12-04 10:41 ` cvs-commit at gcc dot gnu.org
2021-05-14 13:59 ` jakub at gcc dot gnu.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).