[Bug c/83198] ICE internal compiler error: in format_floating, at gimple-ssa-sprintf.c:1900

msebor at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Nov 28 17:26:00 GMT 2017


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83198

Martin Sebor <msebor at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ice-on-invalid-code
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2017-11-28
                 CC|                            |msebor at gcc dot gnu.org
     Ever confirmed|0                           |1
      Known to fail|                            |7.2.0, 8.0

--- Comment #1 from Martin Sebor <msebor at gcc dot gnu.org> ---
Confirmed.  A simplified test case is below.  As the -Wformat warning suggests,
the sprintf calls are undefined, but the printf-return-value pass isn't
prepared to handle them.

$ cat pr83198.c && gcc -O2 -S -Wall pr83198.c 
void f (char *d, int x)
{
  __builtin_sprintf (d, "%.a", x);
}
pr83198.c: In function ‘f’:
pr83198.c:3:28: warning: format ‘%a’ expects argument of type ‘double’, but
argument 3 has type ‘int’ [-Wformat=]
   __builtin_sprintf (d, "%.a", x);
                          ~~^   ~
                          %.d
during GIMPLE pass: printf-return-value
pr83198.c:1:6: internal compiler error: in format_floating, at
gimple-ssa-sprintf.c:1900
 void f (char *d, int x)
      ^
0x1b13be5 format_floating
        /ssd/src/gcc/git/gcc/gimple-ssa-sprintf.c:1900
0x1b15e5f format_directive
        /ssd/src/gcc/git/gcc/gimple-ssa-sprintf.c:2755
0x1b17c9d compute_format_length
        /ssd/src/gcc/git/gcc/gimple-ssa-sprintf.c:3483
0x1b18e2b handle_gimple_call
        /ssd/src/gcc/git/gcc/gimple-ssa-sprintf.c:3970
0x1b18f78 before_dom_children
        /ssd/src/gcc/git/gcc/gimple-ssa-sprintf.c:4003
0x1ac8f59 dom_walker::walk(basic_block_def*)
        /ssd/src/gcc/git/gcc/domwalk.c:308
0x1b18feb execute
        /ssd/src/gcc/git/gcc/gimple-ssa-sprintf.c:4023
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.


More information about the Gcc-bugs mailing list