From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 94442 invoked by alias); 14 Mar 2017 10:24:44 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 94190 invoked by uid 89); 14 Mar 2017 10:24:19 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:1605 X-HELO: mx2.suse.de Received: from mx2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 14 Mar 2017 10:24:18 +0000 Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 36B2AAAB9 for ; Tue, 14 Mar 2017 10:24:17 +0000 (UTC) Subject: [PATCH 4/N] Do not ICE on an invalid input for MV. To: gcc-patches@gcc.gnu.org References: From: =?UTF-8?Q?Martin_Li=c5=a1ka?= Message-ID: <5fce5d4b-fd4f-ebf2-a7a9-4c911d606bcc@suse.cz> Date: Tue, 14 Mar 2017 10:24:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.1 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/mixed; boundary="------------11B5E4CA489E531A548725A4" X-IsSubscribed: yes X-SW-Source: 2017-03/txt/msg00713.txt.bz2 This is a multi-part message in MIME format. --------------11B5E4CA489E531A548725A4 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit Content-length: 510 Hello. This fixes ICE when one does not provide valid target names: __attribute__((target_clones("default,foo,bar"))) In that situation I suggest to print: $ ./xgcc -B. /tmp/mvc-ice.c /tmp/mvc-ice.c:6:1: error: attribute(target("foo")) is unknown foo () ^~~ /tmp/mvc-ice.c:6:1: error: attribute(target("bar")) is unknown /tmp/mvc-ice.c: In function ‘foo.resolver’: cc1: fatal error: At least one more version other than the default is expected Should I add a test-case for a fatal error? Thanks, Martin --------------11B5E4CA489E531A548725A4 Content-Type: text/x-patch; name="0001-Do-not-ICE-on-an-invalid-input-for-MV.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="0001-Do-not-ICE-on-an-invalid-input-for-MV.patch" Content-length: 1076 >From b00d0845869e82e7607fad692f278083520d6b47 Mon Sep 17 00:00:00 2001 From: marxin Date: Tue, 14 Mar 2017 11:16:51 +0100 Subject: [PATCH] Do not ICE on an invalid input for MV. gcc/ChangeLog: 2017-03-14 Martin Liska * config/i386/i386.c (dispatch_function_versions): Display fatal error instead of ICE. --- gcc/config/i386/i386.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 5fcd51f1385..ded9f14d02c 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -32670,7 +32670,10 @@ dispatch_function_versions (tree dispatch_decl, /* At least one more version other than the default. */ num_versions = fndecls->length (); - gcc_assert (num_versions >= 2); + if (num_versions < 2) + fatal_error (UNKNOWN_LOCATION, + "At least one more version other than the default is " + "expected"); function_version_info = (struct _function_version_info *) XNEWVEC (struct _function_version_info, (num_versions - 1)); -- 2.11.1 --------------11B5E4CA489E531A548725A4--