void bar(int v) { short w[v]; }
>gcc -mx32 bar.c bar.c: In function 'bar': bar.c:5:8: internal compiler error: in copy_to_mode_reg, at explow.c:601 short w[v]; ^ Please submit a full bug report, with preprocessed source if appropriate. See <http://sourceforge.net/projects/mingw-w64> for instructions.
>gcc --version gcc (x86_64-win32-sjlj, Built by MinGW-W64 project) 6.1.0
What is 'x32' ?
https://gcc.gnu.org/onlinedocs/gcc-6.1.0/gcc/x86-Options.html#x86-Options
"The -mx32 option sets int, long, and pointer types to 32 bits, and generates code for the x86-64 architecture. "
My other builds(4.9,5.3,5.4) produce the same error?
Last edit: niXman 2016-07-20
All these versions do: 4.8.3, 4.9.2, 5.1.0, 5.2.0, 5.3.0, 5.4.0, 6.1.0
Last edit: Thomas B 2016-07-20
An ICE isn't a good thing, but AFAIK -mx32 hasn't ever been valid for x64 either. (have we ever had an x32 abi for windows???)
As far as I can tell code compiled with -mx32 works just fine but since there is no x32 ABI the use is limited. Calling library functions that pass parameters in register and on the stack (e.g. printf) work fine but as soon as you need to pass around structs that contain pointers things break.
A user could however write a wrapper for those functions, compile it with -m64 and link it to the code compiled with -mx32.
Leaving this feature in a half broken state does not feel right, so I think the best option here ist to fix the bugs and warn the user about the shortcomings or disable the feature entirely.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71958
I think there was a missunderstanding: all other versions I listed produce the error too, not just 6.1.0.
Fixed.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71958
Closed.