public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Peter Bergner <bergner@linux.ibm.com>
To: Segher Boessenkool <segher@kernel.crashing.org>,
	"Kewen.Lin" <linkw@linux.ibm.com>
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>
Subject: Re: [PATCH v2] rs6000: Fix some issues in rs6000_can_inline_p [PR102059]
Date: Mon, 6 Dec 2021 08:52:09 -0600	[thread overview]
Message-ID: <daa940a7-ed34-aa8a-59a3-fc8ddccf1984@linux.ibm.com> (raw)
In-Reply-To: <20211206130638.GP614@gate.crashing.org>

On 12/6/21 7:06 AM, Segher Boessenkool wrote:
> On Fri, Dec 03, 2021 at 11:46:53AM +0800, Kewen.Lin wrot
>> Without this fix, bar inlines foo but get the error as below:
>>
>> In function ‘foo’,
>>     inlined from ‘bar’ at test.c:8:8:
>> test.c:3:9: error: ‘__builtin_ttest’ requires the ‘-mhtm’ option
>>     3 |   *b += __builtin_ttest();
>>       |         ^~~~~~~~~~~~~~~~~
>>
>> Since bar doesn't support foo's required HTM feature.
>>
>> With this fix, bar doesn't inline foo and the case gets compiled well.
> 
> And if you inline something no-htm into something that allows htm?  That
> should work fine, be allowed just fine.

It is only ok to inline a function to be compiled with no-htm into a
function that will be compiled with htm if the no-htm function is
being compiled with no-htm by default.  If the user explicitly used
-fno-htm on the function, then we should not inline the htm function
into it.  Ditto for the other way around.  Meaning, the caller's
option flags should be a superset of the callee's flags, but the
explicit flags used on both functions need to match exactly.

Peter


  reply	other threads:[~2021-12-06 14:52 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
2021-12-06 14:40         ` Peter Bergner
2021-12-06 13:06     ` Segher Boessenkool
2021-12-06 14:52       ` Peter Bergner [this message]
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=daa940a7-ed34-aa8a-59a3-fc8ddccf1984@linux.ibm.com \
    --to=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=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).