Bugzilla will be upgraded to version 5.0 on a still to be determined date in the near future. The original upgrade date has been delayed.
Bug 113909 - g++ optimizer (-O2) causes error with template
g++ optimizer (-O2) causes error with template
Product: Red Hat Raw Hide
Classification: Retired
Component: gcc (Show other bugs)
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
David Lawrence
Depends On:
  Show dependency treegraph
Reported: 2004-01-19 20:04 EST by William Cohen
Modified: 2007-04-18 13:01 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2004-10-29 04:38:39 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description William Cohen 2004-01-19 20:04:50 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030922

Description of problem:
g++ fails to generate executable code when -O2 is use, but g++ will
generate code when code is unoptimized. The arrange_profile.ii
available from ftp://people.redhat.com/wcohen/arrange_profiles.ii

following command line works (no optimization):
g++   -g   -c -o arrange_profiles.o arrange_profiles.ii

following fails with optimization:
g++   -g -O2   -c -o arrange_profiles.o arrange_profiles.ii
/usr/include/c++/3.3.2/bits/stl_function.h: In member function `bool
   std::less<_Tp>::operator()(const _Tp&, const _Tp&) const [with _Tp =
/usr/include/c++/3.3.2/bits/stl_tree.h:1042:   instantiated from
`std::pair<std::_Rb_tree_iterator<_Val, _Val&, _Val*>, bool>
std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare,
_Alloc>::insert_unique(const _Val&) [with _Key = profile_class, _Val =
profile_class, _KeyOfValue = std::_Identity<profile_class>, _Compare =
std::less<profile_class>, _Alloc = std::allocator<profile_class>]'
/usr/include/c++/3.3.2/bits/stl_set.h:155:   instantiated from
`std::pair<typename std::_Rb_tree<_Key, _Key, std::_Identity<_Key>,
_Compare, _Alloc>::const_iterator, bool> std::set<_Key, _Compare,
_Alloc>::insert(const _Key&) [with _Key = profile_class, _Compare =
std::less<profile_class>, _Alloc = std::allocator<profile_class>]'
arrange_profiles.cpp:340:   instantiated from here
/usr/include/c++/3.3.2/bits/stl_function.h:197: error: no match for
   in '__x < __y'

Version-Release number of selected component (if applicable):
gcc-c++-3.3.2-5 libstdc++-devel-3.3.2-1

How reproducible:

Steps to Reproduce:
Look at the description above

Actual Results:  Failure listed above.

Expected Results:  Compiles successfully with -O2

Additional info:

The original source code is OProfile cvs (2004/01/19),
Comment 1 Jakub Jelinek 2004-10-29 04:38:39 EDT
Works with g++ 3.4.2 (after replacing the preprocessed STL includes
with #include directives).

Note You need to log in before you can comment on or make changes to this bug.