From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 113372 invoked by alias); 1 Dec 2015 23:00:52 -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 113349 invoked by uid 89); 1 Dec 2015 23:00:52 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-pa0-f47.google.com Received: from mail-pa0-f47.google.com (HELO mail-pa0-f47.google.com) (209.85.220.47) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Tue, 01 Dec 2015 23:00:51 +0000 Received: by pacdm15 with SMTP id dm15so19245462pac.3 for ; Tue, 01 Dec 2015 15:00:49 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-type :content-transfer-encoding; bh=nt7DA+/0Z+W1FjgW17V7iBSw6IPOJObBir3I9UwR9yw=; b=bggHjg8gO9L3i2Be6tutiwOwSmX6nAR2wK+4zj7eh/HEJILXnwb+ar61xMBQmgaCzG 3yhKtpSftEXDfrYCAg3VVAkjQQyW4o21t6cb3+sWfe54HAsXpV0uSJGWyFqn5C7vp6gl wRX7W+/aolPHN0XPlNZfw2Slr4hm+6c0xs7refzqnhmVolZUAPlN5mgaOpxQlvFcP0kC W+N1stj6vMrQ7RxMKDSjimE2fl3ngcr+D/Oa0c1S9LMCK4Qh8mIzKbn0beb1v/d2k2nC IjbUvRaLU7BxJxZdUXEyVqsMMsFmmOS+AEQIP+YsfHXrIyfcErqCWuvzxIAAk9mxekrP ydqg== X-Gm-Message-State: ALoCoQluEOSGjhYYAKPvxpXBZspz5XKXCxFzGu5t6CxskJYDC5uA5L2qP1v42rbBZbIxcWEK2n7T X-Received: by 10.98.87.136 with SMTP id i8mr83067377pfj.94.1449010849053; Tue, 01 Dec 2015 15:00:49 -0800 (PST) Received: from [10.1.1.10] (58-6-183-210.dyn.iinet.net.au. [58.6.183.210]) by smtp.googlemail.com with ESMTPSA id q129sm55480pfq.19.2015.12.01.15.00.45 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 01 Dec 2015 15:00:47 -0800 (PST) Subject: Re: Incorrect code due to indirect tail call of varargs function with hard float ABI To: Ramana Radhakrishnan , Charles Baylis References: <564A57BA.7050504@linaro.org> <564A9327.8070607@linaro.org> <564AFBEE.9050801@foss.arm.com> <564B8655.1060509@linaro.org> <564BC70C.70805@linaro.org> <564C42B7.9040702@foss.arm.com> Cc: "gcc-patches@gcc.gnu.org" , Richard Earnshaw , Kyrill Tkachov From: Kugan Message-ID: <565E269A.1090102@linaro.org> Date: Tue, 01 Dec 2015 23:00:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <564C42B7.9040702@foss.arm.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2015-12/txt/msg00177.txt.bz2 >> >> gcc/ChangeLog: >> >> 2015-11-18 Kugan Vivekanandarajah >> >> PR target/68390 >> * config/arm/arm.c (arm_function_ok_for_sibcall): Get function type >> for indirect function call. >> >> gcc/testsuite/ChangeLog: >> >> 2015-11-18 Kugan Vivekanandarajah >> >> PR target/68390 >> * gcc.target/arm/PR68390.c: New test. >> > > s/PR/pr in the test name and put this in gcc.c-torture/execute instead - there is nothing ARM specific about the test. Tests in gcc.target/arm should really only be architecture specific. This isn't. > >> >> >> >> p.txt >> >> >> diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c >> index a379121..0dae7da 100644 >> --- a/gcc/config/arm/arm.c >> +++ b/gcc/config/arm/arm.c >> @@ -6680,8 +6680,13 @@ arm_function_ok_for_sibcall (tree decl, tree exp) >> a VFP register but then need to transfer it to a core >> register. */ >> rtx a, b; >> + tree fn_decl = decl; > > Call it decl_or_type instead - it's really that ... > >> >> - a = arm_function_value (TREE_TYPE (exp), decl, false); >> + /* If it is an indirect function pointer, get the function type. */ >> + if (!decl) >> + fn_decl = TREE_TYPE (TREE_TYPE (CALL_EXPR_FN (exp))); >> + > > This is probably just my mail client - but please watch out for indentation. > >> + a = arm_function_value (TREE_TYPE (exp), fn_decl, false); >> b = arm_function_value (TREE_TYPE (DECL_RESULT (cfun->decl)), >> cfun->decl, false); >> if (!rtx_equal_p (a, b)) > > > OK with those changes. > > Ramana > Hi Ramana, This issue also remains in 4.9 and 5.0 branches. Is this OK to backport to the release branches. Thanks, Kugan