From 887dc802b3408d0c815ff2aaecd791fa2fd90725 Mon Sep 17 00:00:00 2001 From: Geoffrey Keating Date: Wed, 26 Apr 2006 06:57:01 +0000 Subject: [PATCH] dwarf2out.c (size_of_locs): Don't fill dw_loc_addr if there are no branches. * dwarf2out.c (size_of_locs): Don't fill dw_loc_addr if there are no branches. From-SVN: r113267 --- gcc/ChangeLog | 3 +++ gcc/dwarf2out.c | 18 +++++++++++++++--- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 7bf04eff71a..3600d043a98 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -20,6 +20,9 @@ 2006-04-25 Geoffrey Keating + * dwarf2out.c (size_of_locs): Don't fill dw_loc_addr if there + are no branches. + * dwarf2asm.c (dw2_asm_output_data): Don't generate RTL just to print an integer. diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index 39a8c5c2496..4ef7d029b6f 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -3228,12 +3228,24 @@ size_of_loc_descr (dw_loc_descr_ref loc) static unsigned long size_of_locs (dw_loc_descr_ref loc) { + dw_loc_descr_ref l; unsigned long size; - for (size = 0; loc != NULL; loc = loc->dw_loc_next) + /* If there are no skip or bra opcodes, don't fill in the dw_loc_addr + field, to avoid writing to a PCH file. */ + for (size = 0, l = loc; l != NULL; l = l->dw_loc_next) { - loc->dw_loc_addr = size; - size += size_of_loc_descr (loc); + if (l->dw_loc_opc == DW_OP_skip || l->dw_loc_opc == DW_OP_bra) + break; + size += size_of_loc_descr (l); + } + if (! l) + return size; + + for (size = 0, l = loc; l != NULL; l = l->dw_loc_next) + { + l->dw_loc_addr = size; + size += size_of_loc_descr (l); } return size; -- 2.30.2