This is the mail archive of the gcc-patches@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]

Re: [PATCH] Debug info extensions to support optimized out parameters


On 08/19/10 19:00:30, Jakub Jelinek wrote:
> This is an implementation of something I've sent earlier this week to
> Dwarf-Discuss.
> I'm attaching patch, two small testcases that can show what are these
> extensions useful for and the two proposals sent to Dwarf-Discuss.
> The patch implements this as vendor extension instead, as DWARF5 is
> probably quite far away.  If possible, it would be nice if the
> vendor codes just matched what will end up in DWARF5, then we'd just
> switch to using the standard codes.
[...]

Recently, we merged GCC 4.5.1 into a version of GCC/UPC that we are testing.
While running tests (with compiler checks enabled), we see the following
(on an i686 running CentOS release 5.5):

../../gcc/xupc  -O1  -fupc-pthreads-model-tls -g test19.upc -o test19
test19.upc: In function 'test19':
test19.upc:80:1: note: non-delegitimized UNSPEC 5 found in variable location
test19.upc:80:1: note: non-delegitimized UNSPEC 5 found in variable location

Apart from the notes above, the test passes.

In the GCC/UPC implementation, UPC threads are usually implemented as
Unix processes, but with the -fupc-pthreads-model-tls switch asserted,
a UPC thread will be mapped to a pthread, and further all
normal "C" static/global variable references will be translated
into TLS references.  This mapping is done so that the global
variables will be "per-thread" as they would be when a UPC
thread is implemented as a full process.  This mapping will result
in programs that have quite a few more TLS references than is typical.
In the past, we have seen this extensive use of TLS variables "stress"
the linker and the operating system/runtime library.

Debugging the program above, the first note is issued here:

#1  0x0829cc24 in const_ok_for_output_1 (rtlp=0xb7a29f7c, data=0x0)
    at /eng/upc/dev/gary/gcc-upc-dev/gccupc/src/gcc/dwarf2out.c:12918
12918         inform (current_function_decl
(gdb) l
12913     if (GET_CODE (rtl) == UNSPEC)
12914       {
12915         /* If delegitimize_address couldn't do anything with the UNSPEC,
assume
12916            we can't express it in the debug info.  */
12917   #ifdef ENABLE_CHECKING
12918         inform (current_function_decl
12919                 ? DECL_SOURCE_LOCATION (current_function_decl)
12920                 : UNKNOWN_LOCATION,
12921                 "non-delegitimized UNSPEC %d found in variable location",
12922                 XINT (rtl, 1));
12923   #endif
12924         expansion_failed (NULL_TREE, rtl,
12925                           "UNSPEC hasn't been delegitimized.\n");
12926         return 1;
12927       }

(We have made some patches to dwarf2out.c that *should* be unrelated.
The line numbers above are likely different than in the original 4.5.1
release.)

The relevant values are:

(gdb) p rtl
$1 = (rtx) 0xb7a425b8
(gdb) pr
(unspec:SI [
        (symbol_ref:SI ("sizes") [flags 0x2a] <var_decl 0xb7c48ba0 sizes>)
    ] 5)
(gdb) p 0xb7c48ba0
$2 = 3083111328
(gdb) pt
 <var_decl 0xb7c48ba0 sizes
    type <array_type 0xb7ca1680
        type <integer_type 0xb7d6d820 size_t sizes-gimplified asm_written
public unsigned SI
            size <integer_cst 0xb7cf14b4 constant 32>
            unit size <integer_cst 0xb7cf12a0 constant 4>
            align 32 symtab -1210682528 alias set -1 canonical type 0xb7d02340
precision 32 min <integer_cst 0xb7cf14d0 0> max <integer_cst 0xb7cf1498
4294967295>
            pointer_to_this <pointer_type 0xb7c096e8>>
        BLK
        size <integer_cst 0xb7ca22bc constant 67136>
        unit size <integer_cst 0xb7ca2310 constant 8392>
        align 32 symtab 0 alias set -1 canonical type 0xb7ca16e8
        domain <integer_type 0xb7ca1410 type <integer_type 0xb7d02000 unsigned
int>
            SI size <integer_cst 0xb7cf14b4 32> unit size <integer_cst
0xb7cf12a0 4>
            align 32 symtab 0 alias set -1 canonical type 0xb7ca1410 precision
32 min <integer_cst 0xb7cf12bc 0> max <integer_cst 0xb7ca2230 2097>>
        pointer_to_this <pointer_type 0xb79de000>>
    addressable used public static tls-local-exec BLK file test19.upc line 61
col 8 size <integer_cst 0xb7ca22bc 67136> unit size <integer_cst 0xb7ca2310
8392>
    align 32
    (mem/s/c:BLK (symbol_ref:SI ("sizes") [flags 0x2a] <var_decl 0xb7c48ba0
sizes>) [0 sizes+0 S8392 A32]) chain <var_decl 0xb7c48c00 N>>

Please let me know if there is some additional information that you
would like for me to supply.  The full source code of the compiler
can obviously be provided if you want to try and duplicate the
problem yourself.

thanks,
- Gary


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