From patchwork Tue Feb 10 11:07:40 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Martin_Li=C5=A1ka?= X-Patchwork-Id: 438332 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 6AF6C140151 for ; Tue, 10 Feb 2015 22:08:19 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:cc:subject:content-type; q=dns; s=default; b=KeBal+qFVBqGiymXtFQxaK/XKD2ERuwclI2CM0XVFor z4i1TP3elHhbalYBJ8rywQoTIra2DpyuTjuWEPJUCp/gQtjlQ/Hetlu4F94OVnVR qq5rSYrHZ48hgM20S3SvWHKrHh+3GYFHHhABl2rh5rTM1Eg+EeQ4+gG0AtUCKWaU = 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 :message-id:date:from:mime-version:to:cc:subject:content-type; s=default; bh=n6F6ECxmOU47ep1GbwT788eEGF4=; b=j11n8kiHeRdq4u0tX 5/Ga73Mp4V9hSgu4WKh9SoOGCymiy7VEAOqlH1dZb5kyz+tXjSPa/ZJN3ZYo3TTR VkBYrxXr9M2hwqWicrjuwk3S2FkeKWpNMn+GiwttB9RpxaPiSGeB13MCyaFz+usB N5WM17EGcehYdsVk4ush9n7RCQ= Received: (qmail 1023 invoked by alias); 10 Feb 2015 11:07:46 -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 1011 invoked by uid 89); 10 Feb 2015 11:07:46 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.2 required=5.0 tests=AWL, BAYES_00 autolearn=ham version=3.3.2 X-HELO: mx2.suse.de Received: from cantor2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (CAMELLIA256-SHA encrypted) ESMTPS; Tue, 10 Feb 2015 11:07:44 +0000 Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 7423DAC97; Tue, 10 Feb 2015 11:07:41 +0000 (UTC) Message-ID: <54D9E67C.209@suse.cz> Date: Tue, 10 Feb 2015 12:07:40 +0100 From: =?UTF-8?B?TWFydGluIExpxaFrYQ==?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: GCC Patches CC: dominique Dhumieres Subject: [PATCH] Fix PR ipa/64813 X-IsSubscribed: yes Hello. Following patch is fix for PR ipa/64813. The patch was tested on a darwin target by Dominique. Ready for trunk? Thanks, Martin From ce1c7031e2616d840ce55559c1bc45587d64134f Mon Sep 17 00:00:00 2001 From: mliska Date: Fri, 30 Jan 2015 15:12:59 +0100 Subject: [PATCH] Handle noreturn function thunk creation. gcc/ChangeLog: 2015-02-09 Martin Liska PR ipa/64813 * cgraphunit.c (cgraph_node::expand_thunk): Do not create a return value for call to a function that is noreturn. --- gcc/cgraphunit.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c index 8280fc4..77c8dd8 100644 --- a/gcc/cgraphunit.c +++ b/gcc/cgraphunit.c @@ -1572,6 +1572,7 @@ cgraph_node::expand_thunk (bool output_asm_thunks, bool force_gimple_thunk) gcall *call; greturn *ret; + bool alias_is_noreturn = TREE_THIS_VOLATILE (alias); if (in_lto_p) get_untransformed_body (); @@ -1608,7 +1609,7 @@ cgraph_node::expand_thunk (bool output_asm_thunks, bool force_gimple_thunk) bsi = gsi_start_bb (bb); /* Build call to the function being thunked. */ - if (!VOID_TYPE_P (restype)) + if (!VOID_TYPE_P (restype) && !alias_is_noreturn) { if (DECL_BY_REFERENCE (resdecl)) { @@ -1667,14 +1668,14 @@ cgraph_node::expand_thunk (bool output_asm_thunks, bool force_gimple_thunk) callees->call_stmt = call; gimple_call_set_from_thunk (call, true); gimple_call_set_with_bounds (call, instrumentation_clone); - if (restmp) + if (restmp && !alias_is_noreturn) { gimple_call_set_lhs (call, restmp); gcc_assert (useless_type_conversion_p (TREE_TYPE (restmp), TREE_TYPE (TREE_TYPE (alias)))); } gsi_insert_after (&bsi, call, GSI_NEW_STMT); - if (!(gimple_call_flags (call) & ECF_NORETURN)) + if (!alias_is_noreturn) { if (restmp && !this_adjusting && (fixed_offset || virtual_offset)) -- 2.1.2