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

            Bug ID: 63590
           Summary: wrong code with -mstringop-strategy=vector_loop
           Product: gcc
           Version: 5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: zsojka at seznam dot cz

Created attachment 33755
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=33755&action=edit
reduced testcase

Output:
$ gcc -O -mstringop-strategy=vector_loop testcase.c
$ valgrind -q ./a.out 
==6236== Jump to the invalid address stated on the next line
==6236==    at 0x0: ???
==6236==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==6236== 
==6236== 
==6236== Process terminating with default action of signal 11 (SIGSEGV)
==6236==  Bad permissions for mapped region at address 0x0
==6236==    at 0x0: ???
Segmentation fault

The return address is being overwritten while initialising l[].

Tested revisions:
r216420 - fail
4_9 r213788 - fail
4_8 - unrecognized argument in option '-mstringop-strategy=vector_loop'

Reply via email to