public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/46038] New: Vectorizer generates misaligned address for vld1 qn, [rn:alignment]
@ 2010-10-15 14:59 belagod at gcc dot gnu.org
  2015-03-12 11:12 ` [Bug tree-optimization/46038] " renlin at gcc dot gnu.org
  2015-03-14  5:57 ` mshawcroft at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: belagod at gcc dot gnu.org @ 2010-10-15 14:59 UTC (permalink / raw)
  To: gcc-bugs

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

           Summary: Vectorizer generates misaligned address for vld1 qn,
                    [rn:alignment]
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: belagod@gcc.gnu.org
                CC: jules@gcc.gnu.org


This test case:

extern void abort (void);

void foo (short *__restrict in, int n, int l,
       short *__restrict o) __attribute__((noinline));

void foo (short *__restrict in, int n, int l , 
      short *__restrict o)
{
  int A=0, lg, i;
   for (lg = 0; lg < n; lg++) 
    {
      A = 0;
      for (i = 0; i < l; i++)
         A += (int)in[i] +  (int)in[i+lg];
    }

   if (A != 256)
     abort ();
}

int main()
{
  short in[32];
  short o[4];
  int i;

  for (i=0;i<32;i++) in[i] = i;
  foo (in, 2, 16, o);
  return 0;
}

aborts.
It's compiled with -c -static -mcpu=cortex-a8 -mfpu=neon -mfloat-abi=softfp
foo.c -marm -O3.

The first iteration's result 'A' is correct. The second iteration's result is
broken.

The bug seems to be during the second iteration of the outer loop in
foo(), the vld1.16 at 0x8514 seems to be getting a bogus base address
that isn't 8-byte aligned inspite of the assertion [rn:64]. This might be a
potential source of the bug.

The output of dmesg on a cortex-a8 is:

Alignment trap: not handling instruction edc30b00 at [<0000c64c>]
Unhandled fault: alignment exception (0x801) at 0xbe8818c9


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

end of thread, other threads:[~2015-03-14  5:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-10-15 14:59 [Bug tree-optimization/46038] New: Vectorizer generates misaligned address for vld1 qn, [rn:alignment] belagod at gcc dot gnu.org
2015-03-12 11:12 ` [Bug tree-optimization/46038] " renlin at gcc dot gnu.org
2015-03-14  5:57 ` mshawcroft 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).