public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Kugan <kugan.vivekanandarajah@linaro.org>
To: Ramana Radhakrishnan <ramana.radhakrishnan@foss.arm.com>,
	Charles Baylis <charles.baylis@linaro.org>,
	Kyrill Tkachov <kyrylo.tkachov@arm.com>
Cc: "gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>,
	Richard Earnshaw <Richard.Earnshaw@arm.com>
Subject: Re: Incorrect code due to indirect tail call of varargs function with hard float ABI
Date: Mon, 25 Jan 2016 21:54:00 -0000	[thread overview]
Message-ID: <56A69999.7060204@linaro.org> (raw)
In-Reply-To: <565E269A.1090102@linaro.org>


This issue also remains in 4.9 and 5.0 branches. Is this OK to backport
to the release branches.

Thanks,
Kugan

On 02/12/15 10:00, Kugan wrote:
> 
>>>
>>> gcc/ChangeLog:
>>>
>>> 2015-11-18  Kugan Vivekanandarajah  <kuganv@linaro.org>
>>>
>>> 	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  <kuganv@linaro.org>
>>>
>>> 	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
>>

> 

      reply	other threads:[~2016-01-25 21:54 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-16 22:25 Kugan
2015-11-17  1:00 ` Charles Baylis
2015-11-17  1:27   ` Kugan
2015-11-17  2:38   ` Kugan
2015-11-17 10:05     ` Ramana Radhakrishnan
2015-11-17 19:56       ` Kugan
2015-11-18  0:32         ` Kugan
2015-11-18  9:19           ` Ramana Radhakrishnan
2015-12-01 23:00             ` Kugan
2016-01-25 21:54               ` Kugan [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56A69999.7060204@linaro.org \
    --to=kugan.vivekanandarajah@linaro.org \
    --cc=Richard.Earnshaw@arm.com \
    --cc=charles.baylis@linaro.org \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=kyrylo.tkachov@arm.com \
    --cc=ramana.radhakrishnan@foss.arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).