Bug 77740 - [7 regression] internal compiler error: in format_floating, at gimple-ssa-sprintf.c:1165
Summary: [7 regression] internal compiler error: in format_floating, at gimple-ssa-spr...
Status: RESOLVED DUPLICATE of bug 77683
Alias: None
Product: gcc
Classification: Unclassified
Component: middle-end (show other bugs)
Version: 7.0
: P3 normal
Target Milestone: 7.0
Assignee: Martin Sebor
URL:
Keywords: diagnostic, ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2016-09-26 08:29 UTC by Gerald Pfeifer
Modified: 2016-09-27 17:24 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2016-09-27 00:00:00


Attachments
Preprocessed input file (generated with -save-temps) (49.46 KB, application/x-xz)
2016-09-26 08:29 UTC, Gerald Pfeifer
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Gerald Pfeifer 2016-09-26 08:29:31 UTC
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 )
              ^~~~~~~~~~~~
Comment 1 Gerald Pfeifer 2016-09-26 09:08:44 UTC
The minimum invocation to reproduce the issue is

  /some/where/gcc -c math.i -Wall -O1

Both warnings _and_ at least -O1 are required.
Comment 2 Martin Liška 2016-09-27 07:12:32 UTC
Confirmed on x86_64-linux-gnu with: gcc pr77740.i -c -O1 -Wall -m32

Started with r240298
Comment 3 Martin Liška 2016-09-27 07:29:39 UTC
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
Comment 4 Martin Sebor 2016-09-27 17:24:16 UTC
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 ***