public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Martin Liška" <mliska@suse.cz>
To: Peter Bergner <bergner@linux.ibm.com>,
	"Kewen.Lin" <linkw@linux.ibm.com>,
	 Segher Boessenkool <segher@kernel.crashing.org>
Cc: Bill Schmidt <wschmidt@linux.ibm.com>,
	GCC Patches <gcc-patches@gcc.gnu.org>,
	David Edelsohn <dje.gcc@gmail.com>,
	Michael Meissner <meissner@linux.ibm.com>,
	Richard Biener <richard.guenther@gmail.com>
Subject: Re: [PATCH v2] rs6000: Fix some issues in rs6000_can_inline_p [PR102059]
Date: Mon, 6 Dec 2021 10:35:00 +0100	[thread overview]
Message-ID: <8905cc4f-0390-9890-8084-ec8492dc7fbf@suse.cz> (raw)
In-Reply-To: <51fa45ff-cfb2-7b2a-5f42-3344b5aa3280@linux.ibm.com>

On 12/4/21 00:23, Peter Bergner wrote:
> On 12/2/21 9:46 PM, Kewen.Lin via Gcc-patches wrote:
>> on 2021/11/30 上午12:57, Segher Boessenkool wrote:
>>> On Wed, Sep 01, 2021 at 02:55:51PM +0800, Kewen.Lin wrote:
>>>> This patch is to fix the inconsistent behaviors for non-LTO mode
>>>> and LTO mode.  As Martin pointed out, currently the function
>>>> rs6000_can_inline_p simply makes it inlinable if callee_tree is
>>>> NULL, but it's wrong, we should use the command line options
>>>> from target_option_default_node as default.
>>>
>>> This is not documented.
>>>
>>
>> Yeah, but according to the document for the target attribute [1],
>> "Multiple target back ends implement the target attribute to specify
>> that a function is to be compiled with different target options than
>> specified on the command line. The original target command-line options
>> are ignored. ", it seems to say the function without any target
>> attribute/pragma will be compiled with target options specified on the
>> command line.  I think it's a normal expectation for users.
>>
>> Excepting for the inconsistent behaviors between LTO and non-LTO,
>> it can also make the below case different.
> 
> I thought Martin and richi mentioned that target attribute options
> are treated as if they are appended to the end of the command line
> options, so they can potentially override earlier options, but they
> don't actually ignore them?

No, the described behavior is true for optimize attribute:

optimize (string, …)
...
The optimize attribute arguments of a function behave behave as if appended to the command-line.

but:

target (string, …)
...
The original target command-line options are ignored.

As seen here:
https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#Common-Function-Attributes

Cheers,
Martin

> 
> Peter
> 


  reply	other threads:[~2021-12-06  9:35 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-01  6:55 [PATCH] " Kewen.Lin
2021-09-15  8:42 ` PING^1 " Kewen.Lin
2021-09-28  8:58   ` PING^2 " Kewen.Lin
2021-10-13  2:33     ` PING^3 " Kewen.Lin
2021-10-20  9:30       ` PING^4 " Kewen.Lin
2021-11-04 10:57         ` PING^5 " Kewen.Lin
2021-11-22  2:24           ` PING^6 " Kewen.Lin
2021-11-29 16:57 ` Segher Boessenkool
2021-12-03  0:51   ` Michael Meissner
2021-12-03  3:30     ` Kewen.Lin
2021-12-03  3:46   ` [PATCH v2] " Kewen.Lin
2021-12-03 23:23     ` Peter Bergner
2021-12-06  9:35       ` Martin Liška [this message]
2021-12-06 14:40         ` Peter Bergner
2021-12-06 13:06     ` Segher Boessenkool
2021-12-06 14:52       ` Peter Bergner
2021-12-07  3:42       ` Kewen.Lin

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=8905cc4f-0390-9890-8084-ec8492dc7fbf@suse.cz \
    --to=mliska@suse.cz \
    --cc=bergner@linux.ibm.com \
    --cc=dje.gcc@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=linkw@linux.ibm.com \
    --cc=meissner@linux.ibm.com \
    --cc=richard.guenther@gmail.com \
    --cc=segher@kernel.crashing.org \
    --cc=wschmidt@linux.ibm.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).