[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


http://llvm.org/bugs/show_bug.cgi?id=9640

           Summary: clang++ optimizer causes std::bad_alloc in
                    boost::unordered_set<>::insert
           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:   
core-2.0-noarch:core-3.2-noarch:core-4.0-noarch:core-2.0-ia32:core-3.2-ia32:core-4.0-ia32:desktop-4.0-ia32:desktop-4.0-noarch:graphics-2.0-ia32:graphics-2.0-noarch:graphics-3.2-ia32:graphics-3.2-noarch:graphics-4.0-ia32:graphics-4.0-noarch
Distributor ID:    SUSE LINUX
Description:    openSUSE 11.4 (i586)
Release:    11.4
Codename:    Celadon

boost-devel-1.44.0-5.1.i586

Greetings,

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
does).

-- 
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