Bug 464018 - typedef of unnamed struct debug info lost in C++
Summary: typedef of unnamed struct debug info lost in C++
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: gcc
Version: 5.2
Hardware: i386
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Jakub Jelinek
QA Contact: BaseOS QE
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2008-09-25 21:33 UTC by Hiroto Shibuya
Modified: 2013-11-13 14:47 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-11-13 14:47:01 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
foo.cc which reproduces the problem (49 bytes, text/plain)
2008-09-25 21:33 UTC, Hiroto Shibuya
no flags Details


Links
System ID Private Priority Status Summary Last Updated
GNU Compiler Collection 35463 0 None None None Never

Description Hiroto Shibuya 2008-09-25 21:33:06 UTC
Created attachment 317733 [details]
foo.cc which reproduces the problem

Description of problem:

When C++ code includes typedefed unamed struct, typedefed type name
is not included in the object file.  It works fine if the struct
is named or compiled in C.  It was working fine with
g++ (GCC) 3.4.6 20060404 (Red Hat 3.4.6-3).

Version-Release number of selected component (if applicable):

g++ (GCC) 4.1.2 20071124 (Red Hat 4.1.2-42)

How reproducible:

always

Steps to Reproduce:
1. Compile the attached source:
   $ g++ -g -c foo.cc
2. Load the object into gdb
   $ gdb foo.o
3. Try to use the typedefed name "FooT"
   gdb> p sizeof(FooT)

  
Actual results:
No symbol "FooT" in current context.

Expected results:
$1 = 4

Additional info:

gdb> info types
All defined types:

File foo.cc:
._0;
typedef ._0;
typedef ::;
typedef int;
typedef int;

When compiled with gcc 3.4, it will show:
(gdb) info types
All defined types:

File foo.cc:
typedef ::;
FooT;
typedef FooT;
typedef int;

Comment 1 Hiroto Shibuya 2008-09-26 21:02:27 UTC
This seems to be the corresponding GCC bug. 

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

As I noted there, I confirmed this to have regressed between 4.0.4 and 4.1.0.

Comment 2 Hiroto Shibuya 2009-04-30 13:19:49 UTC
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35463#c4 is updated

------- Comment #4 From Jakub Jelinek 2009-04-30 13:05 [reply] -------
I think this has been fixed by
http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=146137
http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=146290
http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=146897
on the trunk

Comment 3 Jeff Law 2013-11-13 14:47:01 UTC
"This Bugzilla has been reviewed by Red Hat and is not planned on being
addressed in Red Hat Enterprise Linux 5, and therefore will be closed.
If this bug is critical to production systems, please contact your Red
Hat support representative and provide sufficient business
justification. Issue is already fixed in RHEL-6/7."


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