Bug 485940 - DW_TAG_label without DW_AT_low_pc
Summary: DW_TAG_label without DW_AT_low_pc
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: gcc
Version: 5.2
Hardware: All
OS: Linux
low
medium
Target Milestone: rc
: ---
Assignee: Jakub Jelinek
QA Contact: BaseOS QE
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-02-17 16:03 UTC by Stan Cox
Modified: 2009-03-31 17:38 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-03-31 17:38:51 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
test program (48.34 KB, application/x-bzip2)
2009-02-17 16:03 UTC, Stan Cox
no flags Details

Description Stan Cox 2009-02-17 16:03:06 UTC
Created attachment 332235 [details]
test program

Description of problem:
The majority of the time a DW_TAG_label has an associated DW_AT_low_pc, however in some circumstances it does not.

Version-Release number of selected component (if applicable):
Tested with both 4.3.2 and 4.4.0


How reproducible:


Steps to Reproduce:
1. gcc -O2 -Wall -W -c xact.i -g && readelf --debug-dump xact.o | less -pstapprobe
2.
3.
  
Actual results:
    <1220>   DW_AT_name        : (indirect string, offset: 0xf10): _stapprobe1_t
ransaction__start_1550  
    <1224>   DW_AT_decl_file   : 1      
    <1225>   DW_AT_decl_line   : 13348  


Expected results:
above plus
    <1273>   DW_AT_low_pc      : 0x0   

Additional info:

Comment 1 Mark Wielaard 2009-02-17 16:17:18 UTC
Same issue can be seen with the system compiler:

$ gcc --version
gcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-44)

 [  11f8]      label
               name                 "_stapprobe1_transaction__start_1550"
               decl_file            1
               decl_line            13348

But no low_pc.

Comment 2 Jakub Jelinek 2009-03-11 12:26:43 UTC
        .uleb128 0x1f   # (DIE (0x122d) DW_TAG_label)
        .long   .LASF464        # DW_AT_name: "_stapprobe1_transaction__start_1550"
        .byte   0x1     # DW_AT_decl_file (xact.i)
        .value  0x3424  # DW_AT_decl_line
...
        .uleb128 0x2a   # (DIE (0x12fa) DW_TAG_label)
        .long   0x122d  # DW_AT_abstract_origin
        .quad   .L6     # DW_AT_low_pc

Why do you consider that a bug?  That DW_TAG_label die is just the abstract origin of the label, there is another DW_TAG_label with DW_AT_abstract_origin and DW_AT_loc_pw later on.  Why should we emit a DW_AT_low_pc when there isn't really one?  2.17 says:
"If an entity has no associated machine code, none of these attributes are specified."
and that's the case here.

Comment 3 Roland McGrath 2009-03-11 19:55:43 UTC
There is no bug if all observed cases missing PC attrs are like this one.
The consumer just needs to be using smarter methods.

Comment 4 Jakub Jelinek 2009-03-31 17:38:51 UTC
Closing, if you find a case where DW_TAG_label without DW_AT_low_pc doesn't have corresponding DW_TAG_label with it and pointing to it through DW_AT_abstract_origin (possibly transitively), please reopen.


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