From patchwork Fri Dec 7 16:06:45 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Don't drop DECL_INITIAL if -g for DWARF2+ (PR fortran/55395) From: Jakub Jelinek X-Patchwork-Id: 204567 Message-Id: <20121207160645.GA2315@tucnak.redhat.com> To: Richard Biener Cc: Jan Hubicka , gcc-patches@gcc.gnu.org Date: Fri, 7 Dec 2012 17:06:45 +0100 On Fri, Dec 07, 2012 at 12:36:58PM +0100, Richard Biener wrote: > Hmm. Then make it DINFO_LEVEL_NONE and put in a fixme comment refering > to the bugreport. Here is what I've committed after another bootstrap/regtest: 2012-12-07 Jakub Jelinek PR fortran/55395 * varpool.c (varpool_remove_node): Don't drop DECL_INITIAL for -g for any kind of debug info. Jakub --- gcc/varpool.c.jj 2012-12-06 21:34:16.000000000 +0100 +++ gcc/varpool.c 2012-12-07 13:25:42.005710625 +0100 @@ -63,12 +63,8 @@ varpool_remove_node (struct varpool_node && !DECL_IN_CONSTANT_POOL (node->symbol.decl) /* Keep vtables for BINFO folding. */ && !DECL_VIRTUAL_P (node->symbol.decl) - /* dbxout output constant initializers for readonly vars. */ - && (!host_integerp (DECL_INITIAL (node->symbol.decl), 0) - || !TREE_READONLY (node->symbol.decl)) - /* dwarf2out can use most of the initializers. */ - && write_symbols != DWARF2_DEBUG - && write_symbols != VMS_AND_DWARF2_DEBUG) + /* FIXME: http://gcc.gnu.org/PR55395 */ + && debug_info_level == DINFO_LEVEL_NONE) DECL_INITIAL (node->symbol.decl) = error_mark_node; ggc_free (node); }