Intel® C++ Compiler
Support and discussions for creating C++ code that runs on platforms based on Intel® processors.
Announcements
This community is designed for sharing of public information. Please do not share Intel or third-party confidential information here.
7681 Discussions

Internal compiler error on struct initialization

tandreas
Beginner
152 Views

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
152 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