From: Ian Lance Taylor Date: Fri, 18 Jan 2008 15:46:43 +0000 (+0000) Subject: common.opt: Add fmerge-debug-strings. X-Git-Tag: releases/gcc-4.3.0~547 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=28a0816854bc2a988f69f6f6a41455208b97ac96;p=thirdparty%2Fgcc.git common.opt: Add fmerge-debug-strings. ./: * common.opt: Add fmerge-debug-strings. * dwarf2out.c (DEBUG_STR_SECTION_FLAGS): Test flag_merge_debug_strings rather than flag_merge_constants. * doc/invoke.texi (Option Summary): Mention -fmerge-debug-strings. (Debugging Options): Document -fmerge-debug-strings. testsuite/: * gcc.dg/debug/dwarf2/var1.c: Add -fno-merge-debug-strings. From-SVN: r131630 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a4c939c813ea..3c5183a990b4 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,12 @@ +2008-01-18 Ian Lance Taylor + + * common.opt: Add fmerge-debug-strings. + * dwarf2out.c (DEBUG_STR_SECTION_FLAGS): Test + flag_merge_debug_strings rather than flag_merge_constants. + * doc/invoke.texi (Option Summary): Mention + -fmerge-debug-strings. + (Debugging Options): Document -fmerge-debug-strings. + 2008-01-18 Ian Lance Taylor PR c++/33407 diff --git a/gcc/common.opt b/gcc/common.opt index e4916e4c7b45..5c659e4d3079 100644 --- a/gcc/common.opt +++ b/gcc/common.opt @@ -1,6 +1,7 @@ ; Options for the language- and target-independent parts of the compiler. -; Copyright (C) 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. +; Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 +; Free Software Foundation, Inc. ; ; This file is part of GCC. ; @@ -664,6 +665,10 @@ fmerge-constants Common Report Var(flag_merge_constants,1) VarExists Optimization Attempt to merge identical constants across compilation units +fmerge-debug-strings +Common Report Var(flag_merge_debug_strings) Init(1) +Attempt to merge identical debug strings across compilation units + fmessage-length= Common RejectNegative Joined UInteger -fmessage-length= Limit diagnostics to characters per line. 0 suppresses line-wrapping diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index f864cb076da5..ea54e454c8a2 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -1,5 +1,5 @@ @c Copyright (C) 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -@c 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 +@c 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 @c Free Software Foundation, Inc. @c This is part of the GCC manual. @c For copying conditions, see the file gcc.texi. @@ -11,8 +11,8 @@ @c man begin COPYRIGHT Copyright @copyright{} 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, -1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, -2007 Free Software Foundation, Inc. +1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 +Free Software Foundation, Inc. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or @@ -304,7 +304,7 @@ Objective-C and Objective-C++ Dialects}. -ftest-coverage -ftime-report -fvar-tracking @gol -g -g@var{level} -gcoff -gdwarf-2 @gol -ggdb -gstabs -gstabs+ -gvms -gxcoff -gxcoff+ @gol --fdebug-prefix-map=@var{old}=@var{new} @gol +-fmerge-debug-strings -fdebug-prefix-map=@var{old}=@var{new} @gol -femit-struct-debug-baseonly -femit-struct-debug-reduced @gol -femit-struct-debug-detailed@r{[}=@var{spec-list}@r{]} @gol -p -pg -print-file-name=@var{library} -print-libgcc-file-name @gol @@ -4162,6 +4162,14 @@ The default is @samp{-femit-struct-debug-detailed=all}. This option works only with DWARF 2. +@item -fmerge-debug-strings +@opindex fmerge-debug-strings +Direct the linker to merge together strings which are identical in +different object files. This is not supported by all assemblers or +linker. This decreases the size of the debug information in the +output file at the cost of increasing link processing time. This is +on by default. + @item -fdebug-prefix-map=@var{old}=@var{new} @opindex fdebug-prefix-map When compiling files in directory @file{@var{old}}, record debugging diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index d06e499bd2ed..3a5b897c8776 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -4393,7 +4393,7 @@ static int maybe_emit_file (struct dwarf_file_data *fd); /* Section flags for .debug_str section. */ #define DEBUG_STR_SECTION_FLAGS \ - (HAVE_GAS_SHF_MERGE && flag_merge_constants \ + (HAVE_GAS_SHF_MERGE && flag_merge_debug_strings \ ? SECTION_DEBUG | SECTION_MERGE | SECTION_STRINGS | 1 \ : SECTION_DEBUG) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index cc3ec9c2a3bf..2c3053c2fa4e 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2008-01-18 Ian Lance Taylor + + * gcc.dg/debug/dwarf2/var1.c: Add -fno-merge-debug-strings. + 2008-01-18 Ian Lance Taylor PR c++/33407 diff --git a/gcc/testsuite/gcc.dg/debug/dwarf2/var1.c b/gcc/testsuite/gcc.dg/debug/dwarf2/var1.c index 75804507e236..04dd1297694f 100644 --- a/gcc/testsuite/gcc.dg/debug/dwarf2/var1.c +++ b/gcc/testsuite/gcc.dg/debug/dwarf2/var1.c @@ -1,6 +1,6 @@ /* PR 23190 */ /* { dg-do compile } -/* { dg-options "-gdwarf-2 -dA" } */ +/* { dg-options "-gdwarf-2 -dA -fno-merge-debug-strings" } */ /* { dg-final { scan-assembler "xyzzy\[^\\n\\r\]+DW_AT_name" } } */ void f(void)