[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#701082: gcc-4.7: gcc generates incorrect code with -O2 compiling libffi example



I did an
   apt-get -t experimental install gcc-4.7 gcc-4.8
and updated libffi

gcc -O0 -o ffi-test ffi-test.c -lffi
./ffi-test
Hello World!
This is cool!

gcc -O1 -o ffi-test ffi-test.c -lffi
./ffi-test
Hello World!
This is cool!

gcc -O2 -o ffi-test ffi-test.c -lffi
./ffi-test
Hello World!
Segmentation fault

ldd ffi-test
        linux-vdso.so.1 (0x00007fff80fff000)
libffi.so.6 => /usr/lib/x86_64-linux-gnu/libffi.so.6 (0x00007f9ffbaca000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f9ffb71d000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f9ffbd0e000)


Reply to: