aboutsummaryrefslogtreecommitdiff
path: root/gcc/dwarf2out.c
diff options
context:
space:
mode:
authorGeoffrey Keating <geoffk@apple.com>2006-04-26 06:57:01 +0000
committerGeoffrey Keating <geoffk@gcc.gnu.org>2006-04-26 06:57:01 +0000
commit887dc802b3408d0c815ff2aaecd791fa2fd90725 (patch)
tree39a499f914cf499706cbd95051e7527c1797be08 /gcc/dwarf2out.c
parentf7acbf4c824c9486072210648c86a7df28eb8f3e (diff)
downloadgcc-887dc802b3408d0c815ff2aaecd791fa2fd90725.zip
gcc-887dc802b3408d0c815ff2aaecd791fa2fd90725.tar.gz
gcc-887dc802b3408d0c815ff2aaecd791fa2fd90725.tar.bz2
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
Diffstat (limited to 'gcc/dwarf2out.c')
-rw-r--r--gcc/dwarf2out.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index 39a8c5c..4ef7d02 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;