From patchwork Mon Feb 8 10:34:39 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom de Vries X-Patchwork-Id: 580229 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]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 38120140BA7 for ; Mon, 8 Feb 2016 21:35:05 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=fD8npDHe; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to :from:subject:message-id:date:mime-version:content-type; q=dns; s=default; b=D0r4urIEpTxBLXjCuZz0oCWhdXgG0VdKtPrMW6fJ9SNu/u4zlS z5hme5smGyOc/SYnKXXtupP2JH+KBKfs+2VBrn4UR4Jgtq0es6crZGeJENm3TWXn qwC2mLrt3Ax6gOinnzPbq8ThNYGxr2e+1DEka/gW28fJjQKb7aI4d7EKo= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to :from:subject:message-id:date:mime-version:content-type; s= default; bh=LMmnCk5j3Aa6WTpDGIShzb0s+W8=; b=fD8npDHe/mF400v5emZT P5F1sGyrpTWaHQ6mchkYv0XJV7OsJRimP6h+YzMdtU3vq+CjBoAVw+MzZBQVc0+m qBIBTfgtKZQGb1AwO9IoxCb4OMvXPeDMxrmOlwRhfvGUpibMo+a12V4KWFEnsFdI 9tCx0EdhPBqB2ae1lgAk2aw= Received: (qmail 81501 invoked by alias); 8 Feb 2016 10:34:57 -0000 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 Received: (qmail 81484 invoked by uid 89); 8 Feb 2016 10:34:56 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.1 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD, SPF_PASS autolearn=ham version=3.3.2 spammy=joined, picked, Joined, RejectNegative X-HELO: fencepost.gnu.org Received: from fencepost.gnu.org (HELO fencepost.gnu.org) (208.118.235.10) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Mon, 08 Feb 2016 10:34:54 +0000 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49071) by fencepost.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1aSj9g-0007uP-8q for gcc-patches@gnu.org; Mon, 08 Feb 2016 05:34:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aSj9c-0007nW-Jc for gcc-patches@gnu.org; Mon, 08 Feb 2016 05:34:51 -0500 Received: from relay1.mentorg.com ([192.94.38.131]:48176) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aSj9c-0007nK-Dy for gcc-patches@gnu.org; Mon, 08 Feb 2016 05:34:48 -0500 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=SVR-IES-FEM-01.mgc.mentorg.com) by relay1.mentorg.com with esmtp id 1aSj9a-00049J-SW from Tom_deVries@mentor.com for gcc-patches@gnu.org; Mon, 08 Feb 2016 02:34:47 -0800 Received: from [127.0.0.1] (137.202.0.76) by SVR-IES-FEM-01.mgc.mentorg.com (137.202.0.104) with Microsoft SMTP Server id 14.3.224.2; Mon, 8 Feb 2016 10:34:45 +0000 To: "gcc-patches@gnu.org" From: Tom de Vries Subject: [PATCH, PR69707] Handle -fdiagnostics-color in lto Message-ID: <56B86F3F.3030201@mentor.com> Date: Mon, 8 Feb 2016 11:34:39 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Windows NT kernel [generic] [fuzzy] X-Received-From: 192.94.38.131 Hi, when running libgomp.oacc-c-c++-common/parallel-dims.c with -flto -fno-use-linker-plugin, we run into a failing 'test for excess errors'. The problem is that while -fdiagnostics-color=never is passed to gcc, it's not propagated to lto1, and the error message is annotated with color information, which confuses the test for excess errors. This patch fixes the problem by making sure that -fdiagnostics-color is propagated to lto1, in the same way that -fdiagnostics-show-caret is propagated to lto1. Bootstrapped and reg-tested on x86_64. OK for trunk, stage1? Thanks, - Tom Handle -fdiagnostics-color in lto 2016-02-08 Tom de Vries PR lto/69707 * common.opt (fdiagnostics-color=): Remove Driver flag. * lto-wrapper.c (merge_and_complain, append_compiler_options): Handle OPT_fdiagnostics_color_. * testsuite/libgomp.oacc-c-c++-common/parallel-dims-2.c: New test. --- gcc/common.opt | 2 +- gcc/lto-wrapper.c | 2 ++ .../libgomp.oacc-c-c++-common/parallel-dims-2.c | 19 +++++++++++++++++++ 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/gcc/common.opt b/gcc/common.opt index 520fa9c..a740dcb 100644 --- a/gcc/common.opt +++ b/gcc/common.opt @@ -1153,7 +1153,7 @@ Common Alias(fdiagnostics-color=,always,never) ; fdiagnostics-color= -Driver Common Joined RejectNegative Var(flag_diagnostics_show_color) Enum(diagnostic_color_rule) Init(DIAGNOSTICS_COLOR_NO) +Common Joined RejectNegative Var(flag_diagnostics_show_color) Enum(diagnostic_color_rule) Init(DIAGNOSTICS_COLOR_NO) -fdiagnostics-color=[never|always|auto] Colorize diagnostics. ; Required for these enum values. diff --git a/gcc/lto-wrapper.c b/gcc/lto-wrapper.c index ced6f2f..484dbc1 100644 --- a/gcc/lto-wrapper.c +++ b/gcc/lto-wrapper.c @@ -232,6 +232,7 @@ merge_and_complain (struct cl_decoded_option **decoded_options, break; /* Fallthru. */ + case OPT_fdiagnostics_color_: case OPT_fdiagnostics_show_caret: case OPT_fdiagnostics_show_option: case OPT_fdiagnostics_show_location_: @@ -497,6 +498,7 @@ append_compiler_options (obstack *argv_obstack, struct cl_decoded_option *opts, on any CL_TARGET flag and a few selected others. */ switch (option->opt_index) { + case OPT_fdiagnostics_color_: case OPT_fdiagnostics_show_caret: case OPT_fdiagnostics_show_option: case OPT_fdiagnostics_show_location_: diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/parallel-dims-2.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/parallel-dims-2.c new file mode 100644 index 0000000..eea8c7e --- /dev/null +++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/parallel-dims-2.c @@ -0,0 +1,19 @@ +/* { dg-do run { target { openacc_nvidia_accel_selected && lto } } } */ +/* { dg-additional-options "-flto -fno-use-linker-plugin" } */ + +/* Worker and vector size checks. Picked an outrageously large + value. */ + +int main () +{ +#pragma acc parallel num_workers (2<<20) /* { dg-error "using num_workers" } */ + { + } + +#pragma acc parallel vector_length (2<<20) /* { dg-error "using vector_length" } */ + { + } + + return 0; +} +