From patchwork Fri Jul 20 11:55:05 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ryan Mansfield X-Patchwork-Id: 172207 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 52D3F2C0339 for ; Fri, 20 Jul 2012 21:55:25 +1000 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1343390126; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:Received:Message-ID:Date:From:User-Agent:MIME-Version: To:CC:Subject:References:In-Reply-To:Content-Type:Mailing-List: Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:Sender:Delivered-To; bh=J98K0dK3CBIOYO2CKwATKawRAGY=; b=APOjFWtBwBT3YKKO/IBOQSa8seupW49xoNyshNMJnfyylXzEUYjmSsz0Ri1RAC zw+byBRVjOLjN+qWBD+WN+P46PI0M5nG4ITC/MXnf5ZOS+00rBeFgU4g4tFwE1a/ ZAXgYGT5+ygDhJJ+gyLjPuSyyc7xdW0QqpvmKCX615Ba4= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Received:Received:Received:Message-ID:Date:From:User-Agent:MIME-Version:To:CC:Subject:References:In-Reply-To:Content-Type:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=txtEzlz8iXpd5gg3rEys93IoD8+FmKLNYMVIZKKE17iSmjQmm3rj7X6i06gi/6 M3MmBk3sIX6RiSIo3izVfQrVr1E0xEx2BlpCCiv9FgGK9DFJEtxNxkJqoK8A4iNB TmWQlPWYCh7kBGqWfMgxP/L6oVqbXRCECxAMuDefGZGYA=; Received: (qmail 29988 invoked by alias); 20 Jul 2012 11:55:22 -0000 Received: (qmail 29980 invoked by uid 22791); 20 Jul 2012 11:55:22 -0000 X-SWARE-Spam-Status: No, hits=-3.9 required=5.0 tests=AWL, BAYES_00, KHOP_RCVD_UNTRUST, KHOP_THREADED, RCVD_IN_HOSTKARMA_W, RCVD_IN_HOSTKARMA_WL X-Spam-Check-By: sourceware.org Received: from na3sys009aog108.obsmtp.com (HELO na3sys009aog108.obsmtp.com) (74.125.149.199) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 20 Jul 2012 11:55:09 +0000 Received: from mx10.qnx.com ([209.226.137.110]) (using TLSv1) by na3sys009aob108.postini.com ([74.125.148.12]) with SMTP ID DSNKUAlHGhgXvq8GxKEN/QoJ87J+C6w6qLrO@postini.com; Fri, 20 Jul 2012 04:55:09 PDT Received: by mx10.qnx.com (Postfix, from userid 500) id 39DC420E19; Fri, 20 Jul 2012 07:54:52 -0400 (EDT) Received: from exhts.ott.qnx.com (exhts2 [10.222.2.120]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mx10.qnx.com (Postfix) with ESMTPS id A8CFC1FD6E; Fri, 20 Jul 2012 07:54:51 -0400 (EDT) Received: from [10.222.207.33] (10.222.207.33) by exhts2.ott.qnx.com (10.222.2.25) with Microsoft SMTP Server id 14.2.298.4; Fri, 20 Jul 2012 07:54:51 -0400 Message-ID: <50094719.6050301@qnx.com> Date: Fri, 20 Jul 2012 07:55:05 -0400 From: Ryan Mansfield User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20120714 Thunderbird/14.0 MIME-Version: 1.0 To: Gabriel Dos Reis CC: Subject: Re: Diagnostics from GCC_DRIVER_HOST_INITIALIZATION References: <5008788E.6000306@qnx.com> In-Reply-To: X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org On 12-07-19 06:06 PM, Gabriel Dos Reis wrote: > On Thu, Jul 19, 2012 at 4:13 PM, Ryan Mansfield wrote: >> GCC_DRIVER_HOST_INITIALIZATION happens before diagnostic_initialize, this >> can cause crashes if it call diagnostics such as warning, or fatal_error are >> used in the macro. One example would be in darwin-driver.c where >> darwin_find_version_from_kernel can call warning(). Another example is in >> xm-djgpp.h where it calls fatal (this appears to have bit-rotted with the >> fatal -> fatal_error switch) >> >> Would moving the GCC_DRIVER_HOST_INITIALIZATION after diagnostic_initialize >> be OK? > > yes, I think so. OK, then here's a changelog entry for the diff. 2012-07-20 Ryan Mansfield * gcc.c (main): Move GCC_DRIVER_HOST_INITIALIZATION after diagnostic_initialize. Could someone please apply the change? Regards, Ryan Mansfield Index: gcc.c =================================================================== --- gcc.c (revision 189716) +++ gcc.c (working copy) @@ -6189,17 +6189,18 @@ CL_DRIVER, &decoded_options, &decoded_options_count); -#ifdef GCC_DRIVER_HOST_INITIALIZATION - /* Perform host dependent initialization when needed. */ - GCC_DRIVER_HOST_INITIALIZATION; -#endif - /* Unlock the stdio streams. */ unlock_std_streams (); gcc_init_libintl (); diagnostic_initialize (global_dc, 0); + +#ifdef GCC_DRIVER_HOST_INITIALIZATION + /* Perform host dependent initialization when needed. */ + GCC_DRIVER_HOST_INITIALIZATION; +#endif + if (atexit (delete_temp_files) != 0) fatal_error ("atexit failed");