Bug 50508 - Bad gcc/g++ (.s) output when using -ggdb, -O and -fPIC with stl <queue>
Summary: Bad gcc/g++ (.s) output when using -ggdb, -O and -fPIC with stl <queue>
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: gcc   
(Show other bugs)
Version: 7.1
Hardware: i386
OS: Linux
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: David Lawrence
Depends On:
TreeView+ depends on / blocked
Reported: 2001-07-31 19:11 UTC by Rune Jortveit
Modified: 2007-04-18 16:35 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2001-07-31 19:11:40 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

Description Rune Jortveit 2001-07-31 19:11:34 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.2) Gecko/20010701

Description of problem:
Any -Ox with x > 0 together with -fPIC and -ggdb will make gcc(both 2.96.81
& 2.96.85) produce bad assembler code for the following c++ source:

---- start c++ ----
#include <queue>

queue<int> qiDummy1;
queue<int> qiDummy2;
---- end c++ ----

[~/work/gccbug] 16: gcc -v -c -fPIC -O3 -ggdb test.cpp
Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/2.96/specs
gcc version 2.96 20000731 (Red Hat Linux 7.1 2.96-85)
 /usr/lib/gcc-lib/i386-redhat-linux/2.96/cpp0 -lang-c++ -D__GNUG__=2
-D__ELF__ -Dunix -Dlinux -D__ELF__ -D__unix__ -D__linux__ -D__unix
-D__linux -Asystem(posix) -D__OPTIMIZE__ -Acpu(i386) -Amachine(i386) -Di386
-D__i386 -D__i386__ -D__tune_i386__ -D__PIC__ -D__pic__ test.cpp
GNU CPP version 2.96 20000731 (Red Hat Linux 7.1 2.96-85) (cpplib) (i386
ignoring nonexistent directory "/usr/local/include"
ignoring nonexistent directory "/usr/i386-redhat-linux/include"
ignoring duplicate directory "/net/devdisk/linux/include"
ignoring duplicate directory "/usr/lib/qt-2.3.0/include"
#include "..." search starts here:
#include <...> search starts here:
End of search list.
 /usr/lib/gcc-lib/i386-redhat-linux/2.96/cc1plus /tmp/cctDAdBn.ii -quiet
-dumpbase test.cpp -ggdb -O3 -version -fPIC -o /tmp/ccaLb3DH.s
GNU C++ version 2.96 20000731 (Red Hat Linux 7.1 2.96-85)
(i386-redhat-linux) compiled by GNU C version 2.96 20000731 (Red Hat Linux
7.1 2.96-85).
 as -V -Qy -o test.o /tmp/ccaLb3DH.s
GNU assembler version 2.10.91 (i386-redhat-linux) using BFD version
/tmp/ccaLb3DH.s: Assembler messages:
/tmp/ccaLb3DH.s:5349: Error: Rest of line ignored. First ignored character
is `@'.
(rune@ws002 21:07:30)
[~/work/gccbug] 17:

How reproducible:

Steps to Reproduce:
1. Make test.cpp with the following contents
> #include <queue>
> queue<int> qiDummy1;
> queue<int> qiDummy2;

2. Try to compile file with 'gcc -c -fPIC -O3 -ggdb test.cpp'

3. Done

Actual Results:

Expected Results:

Additional info:

1. Removing either -O, -fPIC or -ggdb should make the code snippet compile.
2. I haven't experienced this bug with any other STL container.
3. Occured with both 2.96.81 and 2.96.85

Comment 1 Jakub Jelinek 2001-08-09 11:25:01 UTC
Cannot reproduce this with gcc-2.96-95.

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