From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28383 invoked by alias); 8 May 2002 13:36:02 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 28343 invoked by uid 71); 8 May 2002 13:36:01 -0000 Date: Wed, 08 May 2002 06:36:00 -0000 Message-ID: <20020508133601.28341.qmail@sources.redhat.com> To: jason@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, From: Jason Merrill Subject: Re: c++/6381: [PATCH] Missing assembler label Reply-To: Jason Merrill X-SW-Source: 2002-05/txt/msg00229.txt.bz2 List-Id: The following reply was made to PR c++/6381; it has been noted by GNATS. From: Jason Merrill To: Richard Henderson Cc: gcc-patches@gcc.gnu.org, gcc-gnats@gcc.gnu.org Subject: Re: c++/6381: [PATCH] Missing assembler label Date: Wed, 08 May 2002 14:32:40 +0100 --=-=-= >>>>> "Richard" == Richard Henderson writes: > On Tue, May 07, 2002 at 04:14:22PM +0100, Jason Merrill wrote: >> 6381 is a regression whereby compiling with -g -O causes us to end up with >> an undefined reference to a static local variable because we wrote out the >> initializer for another variable in dwarf2out. The simple fix is to >> disable the problematic code; it means that the debug info will be somewhat >> less useful for unexpanded constants, but is safe. > Hum. Wouldn't it be more useful to allow at least INTEGER_CST? > Oh well, perhaps your better fix can be moved to 3.1.1. That's what I was thinking. Here's a patch that allows a bit more; doing any better would require some sort of support for speculative expansion, and I'm not sure it would be much of a win. Bootstrapping now; will apply to the trunk when done, and to the branch after 3.1. Or now, if Mark would prefer. 2002-05-08 Jason Merrill * dwarf2out.c (rtl_for_decl_location): Only expand INTEGER_CST and REAL_CST. --=-=-= Content-Type: text/x-patch Content-Disposition: inline *** dwarf2out.c.~1~ Sun May 5 22:06:08 2002 --- dwarf2out.c Wed May 8 14:16:58 2002 *************** rtl_for_decl_location (decl) *** 8941,8955 **** == strlen (TREE_STRING_POINTER (init)) + 1)) rtl = gen_rtx_CONST_STRING (VOIDmode, TREE_STRING_POINTER (init)); } ! ! if (rtl == NULL) { rtl = expand_expr (DECL_INITIAL (decl), NULL_RTX, VOIDmode, EXPAND_INITIALIZER); ! /* If expand_expr returned a MEM, we cannot use it, since ! it won't be output, leading to unresolved symbol. */ if (rtl && GET_CODE (rtl) == MEM) ! rtl = NULL; } } --- 8941,8957 ---- == strlen (TREE_STRING_POINTER (init)) + 1)) rtl = gen_rtx_CONST_STRING (VOIDmode, TREE_STRING_POINTER (init)); } ! /* If the initializer is something that we know will expand into an ! immediate RTL constant, expand it now. Expanding anything else ! tends to produce unresolved symbols; see debug/5770 and c++/6381. */ ! else if (TREE_CODE (DECL_INITIAL (decl)) == INTEGER_CST ! || TREE_CODE (DECL_INITIAL (decl)) == REAL_CST) { rtl = expand_expr (DECL_INITIAL (decl), NULL_RTX, VOIDmode, EXPAND_INITIALIZER); ! /* If expand_expr returns a MEM, it wasn't immediate. */ if (rtl && GET_CODE (rtl) == MEM) ! abort (); } } --=-=-=--