Bug 11279 - [3.3/3.4 Regression] DWARF-2 output mishandles large enums
Summary: [3.3/3.4 Regression] DWARF-2 output mishandles large enums
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: debug (show other bugs)
Version: 3.4.0
: P2 normal
Target Milestone: 3.3.1
Assignee: Mark Mitchell
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-06-21 20:53 UTC by Daniel Jacobowitz
Modified: 2004-01-17 04:22 UTC (History)
1 user (show)

See Also:
Host: i386-pc-linux-gnu
Target: i386-pc-linux-gnu
Build: i386-pc-linux-gnu
Known to work:
Known to fail:
Last reconfirmed: 2003-07-05 15:19:56


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Jacobowitz 2003-06-21 20:53:28 UTC
Given this line:
enum e {I, J=(unsigned)0xffffffff} e = J;

Compiled with -gdwarf-2, we get:
 <2><2f>: Abbrev Number: 3 (DW_TAG_enumerator)
     DW_AT_name        : I
     DW_AT_const_value : 0
 <2><33>: Abbrev Number: 4 (DW_TAG_enumerator)
     DW_AT_name        : J

There is no DW_AT_const_value for J, so GDB can not figure out
the value of J.
Comment 1 Andrew Pinski 2003-07-05 15:19:56 UTC
I can confirm this on 3.2.3, 3.3.1 (20030616) and the mainline (20030705), but on 3.0.4, I 
get:

 <2><61>: Abbrev Number: 4 (DW_TAG_enumerator)
     DW_AT_name        : J
     DW_AT_const_value : -1

So this is a regression wrt 3.0.4.
Comment 2 GCC Commits 2003-07-20 07:23:05 UTC
Subject: Bug 11279

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-3_3-branch
Changes by:	mmitchel@gcc.gnu.org	2003-07-20 07:22:59

Modified files:
	gcc            : ChangeLog dwarf2out.c 

Log message:
	PR debug/11279
	* dwarf2out.c (gen_enumeration_type_die): Remember that
	enumerators can be unsigned.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.16114.2.675&r2=1.16114.2.676
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/dwarf2out.c.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.390.2.7&r2=1.390.2.8

Comment 3 GCC Commits 2003-07-20 07:25:01 UTC
Subject: Bug 11279

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	mmitchel@gcc.gnu.org	2003-07-20 07:24:58

Modified files:
	gcc            : ChangeLog dwarf2out.c 

Log message:
	PR debug/11279
	* dwarf2out.c (gen_enumeration_type_die): Remember that
	enumerators can be unsigned.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.573&r2=2.574
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/dwarf2out.c.diff?cvsroot=gcc&r1=1.443&r2=1.444

Comment 4 Mark Mitchell 2003-07-20 07:27:38 UTC
Fixed in GCC 3.3.1 and GCC 3.4.