From 20f220a963ca009013fbeebb46bd5069ede012f4 Mon Sep 17 00:00:00 2001
From: geoffk <geoffk@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Tue, 18 Apr 2006 21:52:49 +0000
Subject: [PATCH] 	* dwarf2out.c (prune_unused_types_update_strings):
 Don't add strings 	to hash table twice when the debug_str section has
 SECTION_MERGE.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@113057 138bc75d-0d04-0410-961f-82ee72b054a4
---
 gcc/ChangeLog   | 5 +++++
 gcc/dwarf2out.c | 5 ++---
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index e6efdcd89391..e044e2b1b6a8 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2006-04-18  Geoffrey Keating  <geoffk@apple.com>
+
+	* dwarf2out.c (prune_unused_types_update_strings): Don't add strings
+	to hash table twice when the debug_str section has SECTION_MERGE.
+
 2006-04-18  Joseph S. Myers  <joseph@codesourcery.com>
 
 	* config/soft-fp: New directory.  From glibc.
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index 818ddb8f6718..db07bb81b30a 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -13998,9 +13998,8 @@ prune_unused_types_update_strings (dw_die_ref die)
 	s->refcount++;
 	/* Avoid unnecessarily putting strings that are used less than
 	   twice in the hash table.  */
-	if (s->refcount == 2
-	    || (s->refcount == 1 
-		&& (debug_str_section->common.flags & SECTION_MERGE) != 0))
+	if (s->refcount
+	    == ((DEBUG_STR_SECTION_FLAGS & SECTION_MERGE) ? 1 : 2))
 	  {
 	    void ** slot;
 	    slot = htab_find_slot_with_hash (debug_str_hash, s->str,
-- 
GitLab