Community
cancel
Showing results for 
Search instead for 
Did you mean: 
tandreas
Beginner
74 Views

Internal compiler error on struct initialization

The following c code compiles with gcc, but fails to compile with icc: file ier.c:

[bash]typedef struct ar_u { short raw; } ar_t;

typedef union format_u { struct { ar_t ar; unsigned limit; }; } format_t; int main () { format_t data = { .limit = 0x31 }; return 0; } [/bash]

Error message:

ier.c(8): internal error: assertion failed at: "shared/edgcpfe/decl_inits.c", line 1964

format_t data = { .limit = 0x31 };

^

compilation aborted for ier.c (code 4)

0 Kudos
1 Reply
JenniferJ
Moderator
74 Views

Hi,
Thanks for reporting the issue and with a testcase.

I can duplicate it with our latest 11.1 for Linux. But the 12.0 works fine.

$ icc -c er.c
er.c(7): internal error: assertion failed at: "shared/edgcpfe/decl_inits.c", line 1975

format_t data = { .limit = 0x31 };
^

compilation aborted for er.c (code 4)


The 12.0 version will be coming out shortly. so please wait.


Thanks again,
Jennifer
Reply