This is the mail archive of the gcc-bugs@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]

[Bug middle-end/50716] New: Segmentation fault caused by misaligned vector access


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

             Bug #: 50716
           Summary: Segmentation fault caused by misaligned vector access
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: tema@gcc.gnu.org


The following code segfaults on i386 + sse targets:

typedef int vec __attribute__((vector_size(16)));
int main ()
{
 int * arr = __builtin_malloc (1024);
 vec *p = (vec *) &arr[1];
 *p = (vec){1, 2, 3, 4};
 return *(char *)p;
}

The problem is that *p = (vec){1,2,3,4} produces aligned move instead of
unaligned.  Most likely this could be reproduced on any target with SIMD
extensions, where aligned move differs from unaligned.


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