public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/55131] New: Segmentation fault happened after upgraded g++ from 3.4.6 to 4.7.0
@ 2012-10-30  2:17 mawenqi108 at gmail dot com
  2012-10-30  2:21 ` [Bug c++/55131] Segmentation fault happened in resulting code (inline-asm) " pinskia at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: mawenqi108 at gmail dot com @ 2012-10-30  2:17 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55131

             Bug #: 55131
           Summary: Segmentation fault happened after upgraded g++ from
                    3.4.6 to 4.7.0
    Classification: Unclassified
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: blocker
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: mawenqi108@gmail.com


Created attachment 28570
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=28570
The source file

Recently I have upgraded the build environment from RHEL 4.7 (32bit) with g++
3.4.6 to CentOS 6.3 (32bit) with g++ 4.7.0. While an inline assembly function,
which implements the atomic comparison and exchange function, could not work
anymore.The attachment is the source file for your reference.

On the old RHEL 4.7 environment:
# g++ -v
Reading specs from /usr/lib/gcc/i386-redhat-linux/3.4.6/specs
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man
--infodir=/usr/share/info --enable-shared --enable-threads=posix
--disable-checking --with-system-zlib --enable-__cxa_atexit
--disable-libunwind-exceptions --enable-java-awt=gtk --host=i386-redhat-linux
Thread model: posix
gcc version 3.4.6 20060404 (Red Hat 3.4.6-10)

# g++ -Wall -Wextra -g -o test test.cpp
test.cpp:37: warning: unused parameter 'argc'
test.cpp:37: warning: unused parameter 'argv'

# ./test
1 val = 0, oldv = 0, newv = 20
2 val = 20, oldv = 0, newv = 20
3 val = 20, oldv = 20, newv = 20

However, on the new CentOS 6.3 environment:
# g++47 -v
Using built-in specs.
COLLECT_GCC=g++47
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/i686-redhat-linux4.7.0/4.7.0/lto-wrapper
Target: i686-redhat-linux4.7.0
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man
--infodir=/usr/share/info --enable-bootstrap --enable-shared
--enable-threads=posix --enable-checking=release --disable-build-with-cxx
--with-system-zlib --enable-__cxa_atexit --enable-languages=c,c++
--disable-profiling --enable-ld --disable-libgcj --disable-java --disable-gcj
--disable-libgcj-multifile --disable-plugin --enable-linker-build-id
--with-tune=generic --with-arch=i686 --build=i686-redhat-linux4.7.0
Thread model: posix
gcc version 4.7.0 20120507 (Red Hat 4.7.0-3) (GCC)

# g++47 -Wall -Wextra -g -fno-strict-aliasing -fwrapv -o test test.cpp
test.cpp:36:5: warning: unused parameter ‘argc’ [-Wunused-parameter]
test.cpp:36:5: warning: unused parameter ‘argv’ [-Wunused-parameter]

# ./test 
1 val = 0, oldv = 0, newv = 20
Segmentation fault (core dumped)

GDB print following info:
(gdb) r
Starting program: /home/share/tmp/test 
1 val = 0, oldv = 0, newv = 20

Program received signal SIGSEGV, Segmentation fault.
0x08048831 in MyAtomic_CAS64 (tgt=0xbffff610, old=0xbffff608, rep=20) at
test.cpp:31
31            : "memory", "edx", "esi", "edi", "cc");

Thanks!


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2012-10-30  9:28 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-10-30  2:17 [Bug c++/55131] New: Segmentation fault happened after upgraded g++ from 3.4.6 to 4.7.0 mawenqi108 at gmail dot com
2012-10-30  2:21 ` [Bug c++/55131] Segmentation fault happened in resulting code (inline-asm) " pinskia at gcc dot gnu.org
2012-10-30  2:28 ` [Bug inline-asm/55131] " pinskia at gcc dot gnu.org
2012-10-30  6:22 ` [Bug c++/55131] " mawenqi108 at gmail dot com
2012-10-30  6:25 ` mawenqi108 at gmail dot com
2012-10-30  9:28 ` redi at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).