[Bug ipa/67600] [5/6 Regression] Segfault when assigning only one char to ostreambuf_iterator<char> compiled with -O2 or -O3

rguenth at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Sep 16 11:35:00 GMT 2015


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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
      Known to work|                            |4.9.3
           Keywords|                            |wrong-code
   Last reconfirmed|                            |2015-09-16
          Component|libstdc++                   |ipa
                 CC|                            |hubicka at gcc dot gnu.org
     Ever confirmed|0                           |1
            Summary|[5/6] Segfault when         |[5/6 Regression] Segfault
                   |assigning only one char to  |when assigning only one
                   |ostreambuf_iterator<char>   |char to
                   |compiled with -O2 or -O3    |ostreambuf_iterator<char>
                   |                            |compiled with -O2 or -O3
   Target Milestone|---                         |5.3
      Known to fail|                            |5.2.0

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
Confirmed.

  <bb 2>:
  std::basic_ostringstream<char>::basic_ostringstream (&ostr, 16);
  _52 = MEM[(char_type * *)&ostr + 48B];

returns NULL.

Dump of assembler code for function main():
   0x0000000000400ad0 <+0>:     push   %rbx
   0x0000000000400ad1 <+1>:     mov    $0x10,%esi
   0x0000000000400ad6 <+6>:     sub    $0x180,%rsp
   0x0000000000400add <+13>:    lea    0x20(%rsp),%rdi
   0x0000000000400ae2 <+18>:    callq  0x400ab0
<_ZNSt19basic_ostringstreamIcSt11char_traitsIcESaIcEEC1ESt13_Ios_Openmode@plt>
   0x0000000000400ae7 <+23>:    mov    0x50(%rsp),%rax
   0x0000000000400aec <+28>:    lea    0x28(%rsp),%rsi
   0x0000000000400af1 <+33>:    lea    0x10(%rsp),%rdi
=> 0x0000000000400af6 <+38>:    movb   $0x58,(%rax)

looks like a devirt issue again, -fno-devirtualize fixes it and -fdump-tree-all
without it ICEs:

> /space/rguenther/install/gcc-5.2/bin/g++ t.c -O2 -g -fdump-tree-all
t.c: In function 'int main()':
t.c:4:5: internal compiler error: Segmentation fault
 int main()
     ^
0xacaeff crash_signal
        /space/rguenther/src/svn/gcc-5-branch/gcc/toplev.c:383
0x7cce20 symtab_node::name() const
        /space/rguenther/src/svn/gcc-5-branch/gcc/symtab.c:479
0xbe1083 eliminate_dom_walker::before_dom_children(basic_block_def*)
        /space/rguenther/src/svn/gcc-5-branch/gcc/tree-ssa-pre.c:4405
0xfaf581 dom_walker::walk(basic_block_def*)
        /space/rguenther/src/svn/gcc-5-branch/gcc/domwalk.c:188
0xbdf58b eliminate
        /space/rguenther/src/svn/gcc-5-branch/gcc/tree-ssa-pre.c:4540
0xbdf8a5 execute
        /space/rguenther/src/svn/gcc-5-branch/gcc/tree-ssa-pre.c:4978
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.



More information about the Gcc-bugs mailing list