public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Maxim Kuvyrkov <maxim.kuvyrkov@linaro.org>
To: Andreas Schwab <schwab@suse.de>
Cc: Torsten Duwe <duwe@suse.de>,
	"Richard Earnshaw (lists)" <Richard.Earnshaw@arm.com>,
	Sandra Loosemore <sandra@codesourcery.com>,
	Marek Polacek <polacek@redhat.com>,
	GCC Patches <gcc-patches@gcc.gnu.org>,
	Szabolcs Nagy <szabolcs.nagy@arm.com>,
	nd@arm.com, Li Bin <huawei.libin@huawei.com>,
	Jiri Kosina <jkosina@suse.cz>,
	Marcus Shawcroft <Marcus.Shawcroft@arm.com>,
	Takahiro Akashi <takahiro.akashi@linaro.org>,
	Andrew Wafaa <Andrew.Wafaa@arm.com>
Subject: Re: [PATCH v12] add -fpatchable-function-entry=N,M option
Date: Mon, 31 Jul 2017 11:47:00 -0000	[thread overview]
Message-ID: <F3E4420A-1F0D-48F0-978B-4A6C0B65A4E1@linaro.org> (raw)
In-Reply-To: <mvm379juv2y.fsf@suse.de>

On Jul 26, 2017, at 5:33 PM, Andreas Schwab <schwab@suse.de> wrote:
> 
> On Jul 26 2017, Torsten Duwe <duwe@suse.de> wrote:
> 
>> On Wed, Jul 26, 2017 at 04:16:25PM +0200, Andreas Schwab wrote:
>>> On Jul 07 2017, Torsten Duwe <duwe@suse.de> wrote:
>>> 
>>>> diff --git a/gcc/testsuite/c-c++-common/patchable_function_entry-decl.c b/gcc/testsuite/c-c++-common/patchable_function_entry-decl.c
>>>> new file mode 100644
>>>> index 00000000000..8514b10e820
>>>> --- /dev/null
>>>> +++ b/gcc/testsuite/c-c++-common/patchable_function_entry-decl.c
>>>> @@ -0,0 +1,16 @@
>>>> +/* { dg-do compile } */
>>>> +/* { dg-options "-O2 -fpatchable-function-entry=3,1" } */
>>>> +/* { dg-final { scan-assembler-times "nop" 2 } } */
>>> 
>>> This fails on ia64.
>> 
>> The solution is fairly obvious: on architectures where the nop is not called
>> "nop" provide a custom, cpu-specific test, or document the failure.
> 
> But on ia64, a nop _is_ called nop.

The problem here is that ia64 backend emits "nop" instructions to pad IA64 bundles.  The 2 nops at the beginning are [as expected] from the patchable attribute, but [unexpected] nops after ld8.mov and before "add r8" are generated by ia64 bundle packing.

	nop 0
	nop 0
	.prologue
	.body
	.mmi
	addl r14 = @ltoffx(a#), r1
	;;
	ld8.mov r14 = [r14], a#
	nop 0
	;;
	.mmi
	ld4 r14 = [r14]
	;;
	shladd r8 = r14, 2, r0
	nop 0
	;;
	.mib
	nop 0
	add r8 = r8, r14
	br.ret.sptk.many b0

I don't see an easy way to correctly differentiate between "attribute" nops and "bundle" nops, so XFAILing these tests on ia64 seems like a valid approach.

I speculate that other tests fail on ia64 for the same reason, but I didn't check.

--
Maxim Kuvyrkov
www.linaro.org



  reply	other threads:[~2017-07-31 11:47 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-06 14:03 [PATCH v11] " Torsten Duwe
2017-07-07 13:58 ` Richard Earnshaw (lists)
2017-07-07 19:30   ` [PATCH v12] " Torsten Duwe
2017-07-17 12:10     ` Torsten Duwe
2017-07-20 10:58       ` Maxim Kuvyrkov
2017-07-20 12:06         ` Torsten Duwe
2017-07-20 13:12           ` Maxim Kuvyrkov
2017-07-25  7:16             ` Maxim Kuvyrkov
2017-07-25  8:07               ` Torsten Duwe
2017-07-25 13:03               ` Torsten Duwe
2017-07-26 14:16     ` Andreas Schwab
2017-07-26 14:26       ` Torsten Duwe
2017-07-26 14:33         ` Andreas Schwab
2017-07-31 11:47           ` Maxim Kuvyrkov [this message]
2017-08-01 10:43             ` Gerald Pfeifer
2017-08-01 10:53               ` Andreas Schwab
2017-08-01 13:03                 ` Maxim Kuvyrkov
2017-08-01 13:36                   ` Andreas Schwab
2017-08-11 12:42                   ` [PATCH] skip patchable_function_entry tests on ia64 Torsten Duwe
2017-08-14 16:50                     ` Jim Wilson

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=F3E4420A-1F0D-48F0-978B-4A6C0B65A4E1@linaro.org \
    --to=maxim.kuvyrkov@linaro.org \
    --cc=Andrew.Wafaa@arm.com \
    --cc=Marcus.Shawcroft@arm.com \
    --cc=Richard.Earnshaw@arm.com \
    --cc=duwe@suse.de \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=huawei.libin@huawei.com \
    --cc=jkosina@suse.cz \
    --cc=nd@arm.com \
    --cc=polacek@redhat.com \
    --cc=sandra@codesourcery.com \
    --cc=schwab@suse.de \
    --cc=szabolcs.nagy@arm.com \
    --cc=takahiro.akashi@linaro.org \
    /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).