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

            Bug ID: 70441
           Summary: vector<__float128> crashes on two push_back calls with
                    -mavx
           Product: gcc
           Version: 5.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: b7.10110111 at gmail dot com
  Target Milestone: ---

The following simple program reproduces the bug:


#include <vector>

int main()
{
    std::vector<__float128> tests;
    tests.push_back(0);
    tests.push_back(0);
}


I compiled it with this command line:

g++ test.cpp -o test -g -mavx

On attempt to run it reliably crashes on `vmovaps XMMWORD PTR [eax],xmm2`
instruction, where eax==0x804fa38, i.e. not aligned on 16-byte boundary. The
calling code is the second push_back(). Here's the full backtrace:

0x08048d30 in __gnu_cxx::new_allocator<__float128>::construct (this=0xffffd444,
__p=0x804fa38, __val=@0xffffd460: <error reading variable>) at
/opt/gcc-5.2/include/c++/5.2.0/ext/new_allocator.h:130
130           { ::new((void *)__p) _Tp(__val); }
(gdb) bt
#0  0x08048d30 in __gnu_cxx::new_allocator<__float128>::construct
(this=0xffffd444, __p=0x804fa38, __val=@0xffffd460: <error reading variable>)
at /opt/gcc-5.2/include/c++/5.2.0/ext/new_allocator.h:130
#1  0x080489bd in __gnu_cxx::__alloc_traits<std::allocator<__float128>
>::construct<__float128> (__a=..., __p=0x804fa38, __arg=@0xffffd460: <error
reading variable>)
    at /opt/gcc-5.2/include/c++/5.2.0/ext/alloc_traits.h:189
#2  0x08048ae1 in std::vector<__float128, std::allocator<__float128>
>::_M_insert_aux (this=0xffffd444, __position=<error reading variable>,
__x=@0xffffd460: <error reading variable>)
    at /opt/gcc-5.2/include/c++/5.2.0/bits/vector.tcc:361
#3  0x080488e9 in std::vector<__float128, std::allocator<__float128>
>::push_back (this=0xffffd444, __x=@0xffffd460: <error reading variable>) at
/opt/gcc-5.2/include/c++/5.2.0/bits/stl_vector.h:925
#4  0x080487c2 in main () at test.cpp:7

Reply via email to