https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94055
Bug ID: 94055
Summary: Segmentation fault in memet function
Product: gcc
Version: 8.1.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: haoxintu at gmail dot com
Target Milestone: ---
Hi, this code test.c
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
int main (int argc, char* argv[]) {
int size = 10000000;
printf("%d \n", size);
int array[size];
memset(array,0,size*sizeof(int));
return 0;
}
get "Segmentation fault" when I use a larger size, that is to say, smaller size
is ok (in ubuntu 16.04, gcc 8.1.0).
Surprisingly, when I use O1, O2, O3, or Os to compile, it works well.