https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66062
Sujoy <ssaraswati at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |ssaraswati at gmail dot com
--- Comment #1 from Sujoy <ssaraswati at gmail dot com> ---
(In reply to huangcunjian from comment #0)
Hi,
I can reproduce this on x86_64 as well. The test case as such has an issue
that it does an out of bound access for an array. However, I believe gcc
shouldn't crash in any case. This can be reproduced with a shorter test case as
shown below.
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
struct S0 {
unsigned int i : 2;
};
static struct S0 g[5] = {{0}, {1}, {0}, {1}, {0}};
static int64_t idx = 0x979516CD4BBA2AEDLL;
int main()
{
struct S0 l = {0};
g[(idx + 1)] = l;
return g[3].i;
}
$ gcc -O2 small_test.c
small_test.c: In function âmainâ:
small_test.c:15:16: internal compiler error: in expand_assignment, at
expr.c:4721
g[(idx + 1)] = l;
^
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-4.8/README.Bugs> for instructions.
Preprocessed source stored into /tmp/ccueDw3V.out file, please attach this to
your bugreport.