Created attachment 39685 [details] Preprocessed input file (generated with -save-temps) About four, five days ago, I started to see Wine fail to build with my daily builds of GCC on i?86-unknown-freebsd10: gmake[1]: Entering directory '/home/gerald/wine/dlls/msvcr100' /home/gerald/gcc-ref10-i386/bin/gcc -c -o math.o ../msvcrt/math.c -I. -I../msvcrt -I../../include -D__WINESRC__ -D_MT \ -D_MSVCR_VER=100 -D_REENTRANT -fPIC -Wall -pipe -fno-strict-aliasing -Wdeclaration-after-statement \ -Wduplicated-cond -Wempty-body -Wignored-qualifiers -Wshift-overflow=2 -Wstrict-prototypes \ -Wtype-limits -Wunused-but-set-parameter -Wno-unused-const-variable -Wvla -Wwrite-strings \ -Wpointer-arith -Wlogical-op -gdwarf-2 -gstrict-dwarf -fno-omit-frame-pointer \ -I/home/gerald/10-i386/include -g -O2 ../msvcrt/math.c: In function ‘MSVCRT__ecvt’: ../msvcrt/math.c:1370:14: internal compiler error: in format_floating, at gimple-ssa-sprintf.c:1165 char * CDECL MSVCRT__ecvt( double number, int ndigits, int *decpt, int *sign ) ^~~~~~~~~~~~
The minimum invocation to reproduce the issue is /some/where/gcc -c math.i -Wall -O1 Both warnings _and_ at least -O1 are required.
Confirmed on x86_64-linux-gnu with: gcc pr77740.i -c -O1 -Wall -m32 Started with r240298
Minimal test-case: char *MSVCRT__ecvt_data_0; void foo() { __builtin_snprintf (MSVCRT__ecvt_data_0, 0, "%.*le"); } On x86_64-linux-gnu, minimal command line causing the ICE: $ gcc pr77740.i -Wformat pr77740.i:3:6: internal compiler error: in gimple_call_arg, at gimple.h:3156 void foo() ^~~ 0x12686d5 gimple_call_arg ../../gcc/gimple.h:3156 0x126872b gimple_call_arg ../../gcc/gimple.h:3164 0x126d719 compute_format_length ../../gcc/gimple-ssa-sprintf.c:2212 0x126e65f handle_gimple_call ../../gcc/gimple-ssa-sprintf.c:2654 0x126e767 execute ../../gcc/gimple-ssa-sprintf.c:2680
This is a duplicate of bug 77683 a patch for which is in the review queue: https://gcc.gnu.org/ml/gcc-patches/2016-09/msg01470.html *** This bug has been marked as a duplicate of bug 77683 ***