[LLVMbugs] [Bug 9640] New: clang++ optimizer causes std::bad_alloc in boost::unordered_set<>::insert

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Apr 7 05:09:59 PDT 2011


           Summary: clang++ optimizer causes std::bad_alloc in
           Product: clang
           Version: 2.8
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: matthias.andree at gmx.de
                CC: llvmbugs at cs.uiuc.edu, dgregor at apple.com

Created an attachment (id=6402)
 --> (http://llvm.org/bugs/attachment.cgi?id=6402)
C++ code to show misoptimization causing std::bad_alloc

clang version 2.8 (branches/release_28)
Target: i386-pc-linux-gnu
Thread model: posix

LSB Version:   
Distributor ID:    SUSE LINUX
Description:    openSUSE 11.4 (i586)
Release:    11.4
Codename:    Celadon



the attached program works OK when compiled with g++ 4.5:

copying tokens to capabilities
token FOO
token BAR
token BAZ
IMAPCapa::IMAPCapa(const std::string &) completed

but barfs when compiled with clang++ 2.8:

$ clang++ -Wall -pedantic-errors -Wextra -g -O -fexceptions -march=athlon-xp -o
break break.cpp 
$ ./break
copying tokens to capabilities
token FOO
caught std::bad_alloc

Apparently clang version 2.9 (trunk 116146) Target: x86_64-unknown-linux-gnu
and libboost1.40-dev (Ubuntu 10.10) fares better (and succeeds like g++ 4.5

Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

More information about the llvm-bugs mailing list