This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/48174] DWARF for subroutine with no args indicates 'varargs'


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

--- Comment #4 from Bill Long <longb at cray dot com> 2011-03-18 16:08:37 UTC ---
Additional comment from originator of the bug at Cray:

The DIE tag DW_TAG_unspecified_parameters indicates that a variable argument
list starts. Try a simple C program for contrast. Just create x.c

#include <stdarg.h>

int foo (int a, ...)
{
        return a;
}

and do

gcc -c -g x.c

then

readelf -wip x.o

and you'll see a subprogram, followed by the first formal parameter, then the
unspecified parameters. This doesn't seem to make sense in the Fortran context.

...
 <1><37>: Abbrev Number: 4 (DW_TAG_subprogram)
    <38>   DW_AT_external    : 1    
    <39>   DW_AT_name        : foo    
    <3d>   DW_AT_decl_file   : 1    
    <3e>   DW_AT_decl_line   : 4    
    <3f>   DW_AT_prototyped  : 1    
    <40>   DW_AT_type        : <0x6b>    
    <44>   DW_AT_low_pc      : 0x0    
    <4c>   DW_AT_high_pc     : 0x91    
    <54>   DW_AT_frame_base  : 0x0    (location list)
    <58>   DW_AT_sibling     : <0x6b>    
 <2><5c>: Abbrev Number: 5 (DW_TAG_formal_parameter)
    <5d>   DW_AT_name        : a    
    <5f>   DW_AT_decl_file   : 1    
    <60>   DW_AT_decl_line   : 3    
    <61>   DW_AT_type        : <0x6b>    
    <65>   DW_AT_location    : 3 byte block: 91 bc 7e     (DW_OP_fbreg: -196)
 <2><69>: Abbrev Number: 6 (DW_TAG_unspecified_parameters)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]