From patchwork Thu Jul 19 21:13:50 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ryan Mansfield X-Patchwork-Id: 172060 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 882162C0333 for ; Fri, 20 Jul 2012 07:14:11 +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=1343337252; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:Received:Message-ID:Date:From:User-Agent:MIME-Version: To:Subject:Content-Type:Content-Transfer-Encoding:Mailing-List: Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:Sender:Delivered-To; bh=LsKoTJm9uL+DgPwWFYIkMQSaytg=; b=cWb6lrF0GsLM69MTVdeHjT1rHEEy+edYYQgzpRHc/6+kYG1VsGWcKGjUHZF3JJ +0fxIMaptA/MUMK1jBUQd/bjA4q+jUJmZu/39qiW05KNmxW6mBW8cFLkkaFOdtjE 63ikOn+DAoKBNSw/JfDzzhfkjFrtKD6OIOLd/3noIZtwg= 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:Subject:Content-Type:Content-Transfer-Encoding:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=I13YIPYb5UthM4xsMT6K3z0wsOVi7huFdbuMt7jVkONo89V1jv9SveMUvsp+50 Z2bn661ele+fE8+2e3BT8fu4jdWSNOeMCbtpuIAsoS6B92mm0Jdf/u76xOFihyBs OGTw+mNVn5t9tldHno6ZoaVPcxPgPHJWmdgNf1whlLG0w=; Received: (qmail 5305 invoked by alias); 19 Jul 2012 21:14:07 -0000 Received: (qmail 5294 invoked by uid 22791); 19 Jul 2012 21:14:05 -0000 X-SWARE-Spam-Status: No, hits=-3.5 required=5.0 tests=BAYES_00, KHOP_RCVD_UNTRUST, RCVD_IN_HOSTKARMA_W, RCVD_IN_HOSTKARMA_WL X-Spam-Check-By: sourceware.org Received: from na3sys009aog121.obsmtp.com (HELO na3sys009aog121.obsmtp.com) (74.125.149.145) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 19 Jul 2012 21:13:52 +0000 Received: from mx20.qnx.com ([72.1.200.103]) (using TLSv1) by na3sys009aob121.postini.com ([74.125.148.12]) with SMTP ID DSNKUAh4j+xQHkAaJvo84EyY1tyS9burBQyM@postini.com; Thu, 19 Jul 2012 14:13:52 PDT Received: by mx20.qnx.com (Postfix, from userid 500) id 3EEA020E1D; Thu, 19 Jul 2012 17:13:37 -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 mx20.qnx.com (Postfix) with ESMTPS id 125331FBA9 for ; Thu, 19 Jul 2012 17:13:36 -0400 (EDT) Received: from [10.222.101.165] (10.222.101.165) by exhts2.ott.qnx.com (10.222.2.25) with Microsoft SMTP Server id 14.2.298.4; Thu, 19 Jul 2012 17:13:36 -0400 Message-ID: <5008788E.6000306@qnx.com> Date: Thu, 19 Jul 2012 17:13:50 -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: Subject: Diagnostics from GCC_DRIVER_HOST_INITIALIZATION 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 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? Regards, Ryan Mansfield Index: gcc.c =================================================================== --- gcc.c (revision 189681) +++ 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");