From patchwork Thu Jan 5 14:24:25 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Biener X-Patchwork-Id: 134483 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 A6D941007D6 for ; Fri, 6 Jan 2012 01:24:44 +1100 (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=1326378284; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Date: From:To:Subject:Message-ID:User-Agent:MIME-Version:Content-Type: Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:Sender:Delivered-To; bh=W9Oynwocr34XcOWUT7gb J3wNW40=; b=imOaLzuWKwXQstyf8EXFvcSTBF/LNZQfZzYn/OMLsd2nJT8H0RMr AqrL/fCqsgJoZyekjDOi1OZ6JjW8n3kFpVUzR6CwSBIrwFViyH90Q9SoKDrHMT5x S0psfHOvrWoco/Cr1N4iXJE45gwBAS/6zILJtF4rCd7/mp0MUbf2whI= 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:Date:From:To:Subject:Message-ID:User-Agent:MIME-Version:Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=CqTEf+/q5TleXid89Q9ivVadzMireegca+S7LPpkeSlaDW8JtjRucriIbvCyb7 ZOr0Vz0kwQyHWiK7jPIZiBewDXInDRoyaXIjJALKyq1YN3bxH5Bs0uXJS0qI08QM 625kv7mi/3LGvuswcIjFbrQczdAhIesH1hfkpjFC9V3IY=; Received: (qmail 20269 invoked by alias); 5 Jan 2012 14:24:41 -0000 Received: (qmail 20260 invoked by uid 22791); 5 Jan 2012 14:24:40 -0000 X-SWARE-Spam-Status: No, hits=-3.2 required=5.0 tests=AWL, BAYES_00, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from cantor2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 05 Jan 2012 14:24:26 +0000 Received: from relay1.suse.de (nat.nue.novell.com [195.135.221.2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx2.suse.de (Postfix) with ESMTP id 8BC058ADF6 for ; Thu, 5 Jan 2012 15:24:25 +0100 (CET) Date: Thu, 5 Jan 2012 15:24:25 +0100 (CET) From: Richard Guenther To: gcc-patches@gcc.gnu.org Subject: [PATCH] mudflap and LTO interaction Message-ID: User-Agent: Alpine 2.00 (LNX 1167 2008-08-23) MIME-Version: 1.0 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 This should improve the situation a bit, avoiding ICEs and irritating "Please submit a full bug report" messages. It restricts the command-line options to the set of supported languages and rejects compiling with -flto -fmudflap (we then silently drop -fmudflap if you choose to only apply it at link time). I'm giving this some testing and will apply it if that succeeds. In reality mudflap needs to stop doing the split approach and finish itself before we write out LTO IL. Richard. 2012-01-05 Richard Guenther PR middle-end/51764 * common.opt (Wmudflap, fmudflap, fmudflapth, fmudflapir): Move to c.opt. * toplev.c (process_options): Reject combining mudflap and LTO. * tree-nomudflap.c (nogo): Use sorry instead of internal_error. c-family/ * c.opt (Wmudflap, fmudflap, fmudflapth, fmudflapir): Move here from common.opt. Index: gcc/common.opt =================================================================== --- gcc/common.opt (revision 182908) +++ gcc/common.opt (working copy) @@ -570,10 +570,6 @@ Wmissing-noreturn Common Var(warn_missing_noreturn) Warning Warn about functions which might be candidates for __attribute__((noreturn)) -Wmudflap -Common Var(warn_mudflap) Init(1) Warning -Warn about constructs not instrumented by -fmudflap - Woverflow Common Var(warn_overflow) Init(1) Warning Warn about overflow in arithmetic expressions @@ -1465,18 +1461,6 @@ fmove-loop-invariants Common Report Var(flag_move_loop_invariants) Init(1) Optimization Move loop invariant computations out of loops -fmudflap -Common RejectNegative Report Var(flag_mudflap) -Add mudflap bounds-checking instrumentation for single-threaded program - -fmudflapth -Common RejectNegative Report Var(flag_mudflap,2) -Add mudflap bounds-checking instrumentation for multi-threaded program - -fmudflapir -Common RejectNegative Report Var(flag_mudflap_ignore_reads) -Ignore read operations when inserting mudflap instrumentation - fdce Common Var(flag_dce) Init(1) Optimization Use the RTL dead code elimination pass Index: gcc/c-family/c.opt =================================================================== --- gcc/c-family/c.opt (revision 182908) +++ gcc/c-family/c.opt (working copy) @@ -489,6 +489,10 @@ Wmissing-prototypes C ObjC Var(warn_missing_prototypes) Warning Warn about global functions without prototypes +Wmudflap +C ObjC C++ ObjC++ Var(warn_mudflap) Init(1) Warning +Warn about constructs not instrumented by -fmudflap + Wmultichar C ObjC C++ ObjC++ Warning Warn about use of multi-character character constants @@ -865,6 +869,18 @@ fms-extensions C ObjC C++ ObjC++ Var(flag_ms_extensions) Don't warn about uses of Microsoft extensions +fmudflap +C ObjC C++ ObjC++ RejectNegative Report Var(flag_mudflap) +Add mudflap bounds-checking instrumentation for single-threaded program + +fmudflapth +C ObjC C++ ObjC++ RejectNegative Report Var(flag_mudflap,2) +Add mudflap bounds-checking instrumentation for multi-threaded program + +fmudflapir +C ObjC C++ ObjC++ RejectNegative Report Var(flag_mudflap_ignore_reads) +Ignore read operations when inserting mudflap instrumentation + fname-mangling-version- C++ ObjC++ Joined Ignore Warn(switch %qs is no longer supported) Index: gcc/toplev.c =================================================================== --- gcc/toplev.c (revision 182908) +++ gcc/toplev.c (working copy) @@ -1325,6 +1325,9 @@ process_options (void) "and -ftree-loop-linear)"); #endif + if (flag_mudflap && flag_lto) + sorry ("mudflap cannot be used together with link-time optimization"); + /* One region RA really helps to decrease the code size. */ if (flag_ira_region == IRA_REGION_AUTODETECT) flag_ira_region Index: gcc/tree-nomudflap.c =================================================================== --- gcc/tree-nomudflap.c (revision 182908) +++ gcc/tree-nomudflap.c (working copy) @@ -44,7 +44,7 @@ along with GCC; see the file COPYING3. static void nogo (void) { - internal_error ("mudflap: this language is not supported"); + sorry ("mudflap: this language is not supported"); } void