aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgeoffk <geoffk@138bc75d-0d04-0410-961f-82ee72b054a4>2006-04-26 06:57:01 +0000
committergeoffk <geoffk@138bc75d-0d04-0410-961f-82ee72b054a4>2006-04-26 06:57:01 +0000
commit2fa2456e019557b04ba55c89d7827a49716480c4 (patch)
tree39a499f914cf499706cbd95051e7527c1797be08
parente051aa149e8ebf7904372578305284945674f6ec (diff)
* dwarf2out.c (size_of_locs): Don't fill dw_loc_addr if there
are no branches. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@113267 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog3
-rw-r--r--gcc/dwarf2out.c18
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 <geoffk@apple.com>
+ * 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;