* [COMMITTED] PR46932: Fix unresolved in testsuite
@ 2017-08-07 13:59 Wilco Dijkstra
2017-08-07 14:37 ` Richard Earnshaw (lists)
0 siblings, 1 reply; 8+ messages in thread
From: Wilco Dijkstra @ 2017-08-07 13:59 UTC (permalink / raw)
To: GCC Patches; +Cc: nd
Build only if pre-increment is supported. Given there is no config test,
add a list of targets which have HAVE_PRE_INCREMENT set.
Committed as obvious.
2017-08-07 Wilco Dijkstra <wdijkstr@arm.com>
PR middle-end/46932
* gcc.dg/pr46932.c: Compile on targets with pre-increment.
--
diff --git a/gcc/testsuite/gcc.dg/pr46932.c b/gcc/testsuite/gcc.dg/pr46932.c
index b96febcc095fbec2cc4e02d1155871220d17cc99..4eb1a99e1bd9403f8b1c5d0d71ef731ad4a65128 100644
--- a/gcc/testsuite/gcc.dg/pr46932.c
+++ b/gcc/testsuite/gcc.dg/pr46932.c
@@ -1,5 +1,8 @@
/* { dg-options "-O2 -fdump-rtl-auto_inc_dec" } */
+/* Build on targets which have pre increment. */
+/* { dg-do compile { target aarch64*-*-* arm*-*-* rs6000-*-* powerpc*-*-* arc*-*-* m32r-*-* tic6x-*-* } } */
+
/* Check that accesses based on the frame pointer do not
use auto increment. */
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [COMMITTED] PR46932: Fix unresolved in testsuite
2017-08-07 13:59 [COMMITTED] PR46932: Fix unresolved in testsuite Wilco Dijkstra
@ 2017-08-07 14:37 ` Richard Earnshaw (lists)
2017-08-07 14:42 ` Wilco Dijkstra
0 siblings, 1 reply; 8+ messages in thread
From: Richard Earnshaw (lists) @ 2017-08-07 14:37 UTC (permalink / raw)
To: Wilco Dijkstra, GCC Patches; +Cc: nd
On 07/08/17 14:59, Wilco Dijkstra wrote:
> Build only if pre-increment is supported. Given there is no config test,
> add a list of targets which have HAVE_PRE_INCREMENT set.
>
> Committed as obvious.
>
Except that I think this would be better done as an 'effective target'
test; something like
dg-require-effective-target autoincdec
that way new ports will be more likely to pick up relevant tests like this.
R.
> 2017-08-07 Wilco Dijkstra <wdijkstr@arm.com>
>
> PR middle-end/46932
> * gcc.dg/pr46932.c: Compile on targets with pre-increment.
> --
>
> diff --git a/gcc/testsuite/gcc.dg/pr46932.c b/gcc/testsuite/gcc.dg/pr46932.c
> index b96febcc095fbec2cc4e02d1155871220d17cc99..4eb1a99e1bd9403f8b1c5d0d71ef731ad4a65128 100644
> --- a/gcc/testsuite/gcc.dg/pr46932.c
> +++ b/gcc/testsuite/gcc.dg/pr46932.c
> @@ -1,5 +1,8 @@
> /* { dg-options "-O2 -fdump-rtl-auto_inc_dec" } */
>
> +/* Build on targets which have pre increment. */
> +/* { dg-do compile { target aarch64*-*-* arm*-*-* rs6000-*-* powerpc*-*-* arc*-*-* m32r-*-* tic6x-*-* } } */
> +
> /* Check that accesses based on the frame pointer do not
> use auto increment. */
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [COMMITTED] PR46932: Fix unresolved in testsuite
2017-08-07 14:37 ` Richard Earnshaw (lists)
@ 2017-08-07 14:42 ` Wilco Dijkstra
2017-08-07 14:45 ` Richard Earnshaw (lists)
0 siblings, 1 reply; 8+ messages in thread
From: Wilco Dijkstra @ 2017-08-07 14:42 UTC (permalink / raw)
To: Richard Earnshaw, GCC Patches; +Cc: nd
Richard Earnshaw wrote:
>
> Except that I think this would be better done as an 'effective target'
> test; something like
>
> dg-require-effective-target autoincdec
>
> that way new ports will be more likely to pick up relevant tests like this.
Sure but what would be a correct implementation of "autoincdec"?
Wilco
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [COMMITTED] PR46932: Fix unresolved in testsuite
2017-08-07 14:42 ` Wilco Dijkstra
@ 2017-08-07 14:45 ` Richard Earnshaw (lists)
2017-08-09 11:37 ` [PATCH][testsuite] Add check_effective_target_autoincdec Wilco Dijkstra
0 siblings, 1 reply; 8+ messages in thread
From: Richard Earnshaw (lists) @ 2017-08-07 14:45 UTC (permalink / raw)
To: Wilco Dijkstra, GCC Patches; +Cc: nd
On 07/08/17 15:42, Wilco Dijkstra wrote:
> Richard Earnshaw wrote:
>>
>> Except that I think this would be better done as an 'effective target'
>> test; something like
>>
>> dg-require-effective-target autoincdec
>>
>> that way new ports will be more likely to pick up relevant tests like this.
>
> Sure but what would be a correct implementation of "autoincdec"?
>
> Wilco
>
The list of targets that support the operation. Start with your list.
See, eg, check_effective_target_vect_int. I think you only need a
static test of whether the autoinc pass is enabled and the documentation
(comments) should make that clear.
R.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH][testsuite] Add check_effective_target_autoincdec
2017-08-07 14:45 ` Richard Earnshaw (lists)
@ 2017-08-09 11:37 ` Wilco Dijkstra
2017-08-09 12:50 ` Richard Earnshaw (lists)
2017-08-11 16:12 ` Rainer Orth
0 siblings, 2 replies; 8+ messages in thread
From: Wilco Dijkstra @ 2017-08-09 11:37 UTC (permalink / raw)
To: Richard Earnshaw, GCC Patches; +Cc: nd
Richard Earnshaw wrote:
> Except that I think this would be better done as an 'effective target'
> test; something like
>
> dg-require-effective-target autoincdec
Right I figured out how to do this - not trivial as it needs a secret flag in the
glob call - if anyone knows a better way of doing this I'd like to know!
Add check_effective_target_autoincdec that returns true if a target
runs the auto_inc_dec optimization pass.
OK for commit?
ChangeLog:
2017-08-08 Wilco Dijkstra <wdijkstr@arm.com>
gcc/testsuite/
* gcc.dg/pr46932.c: Use effective_target autoincdec.
* lib/target-supports.exp: Add check_effective_target_autoincdec.
--
diff --git a/gcc/testsuite/gcc.dg/pr46932.c b/gcc/testsuite/gcc.dg/pr46932.c
index 4eb1a99e1bd9403f8b1c5d0d71ef731ad4a65128..2b39990d036035d22e226b98351a4900a5dbb309 100644
--- a/gcc/testsuite/gcc.dg/pr46932.c
+++ b/gcc/testsuite/gcc.dg/pr46932.c
@@ -1,7 +1,5 @@
/* { dg-options "-O2 -fdump-rtl-auto_inc_dec" } */
-
-/* Build on targets which have pre increment. */
-/* { dg-do compile { target aarch64*-*-* arm*-*-* rs6000-*-* powerpc*-*-* arc*-*-* m32r-*-* tic6x-*-* } } */
+/* { dg-require-effective-target autoincdec } */
/* Check that accesses based on the frame pointer do not
use auto increment. */
diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
index 5a6562794b2bdd5f370fc5b26d6887777f02779a..5219fbf4671e83a6fa7affdab926115e8a23f9cb 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -8482,3 +8482,18 @@ proc check_effective_target_arm_coproc4_ok { } {
return [check_cached_effective_target arm_coproc4_ok \
check_effective_target_arm_coproc4_ok_nocache]
}
+
+# Return 1 if the target supports the auto_inc_dec optimization pass.
+proc check_effective_target_autoincdec { } {
+ if { ![check_no_compiler_messages auto_incdec assembly { void f () { }
+ } "-O2 -fdump-rtl-auto_inc_dec" ] } {
+ return 0
+ }
+
+ set dumpfile [glob -nocomplain "auto_incdec[pid].c.\[0-9\]\[0-9\]\[0-9\]r.auto_inc_dec"]
+ if { [file exists $dumpfile ] } {
+ file delete $dumpfile
+ return 1
+ }
+ return 0
+}
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH][testsuite] Add check_effective_target_autoincdec
2017-08-09 11:37 ` [PATCH][testsuite] Add check_effective_target_autoincdec Wilco Dijkstra
@ 2017-08-09 12:50 ` Richard Earnshaw (lists)
2017-08-10 0:26 ` Mike Stump
2017-08-11 16:12 ` Rainer Orth
1 sibling, 1 reply; 8+ messages in thread
From: Richard Earnshaw (lists) @ 2017-08-09 12:50 UTC (permalink / raw)
To: Wilco Dijkstra, GCC Patches
On 09/08/17 12:37, Wilco Dijkstra wrote:
> Richard Earnshaw wrote:
>> Except that I think this would be better done as an 'effective target'
>> test; something like
>>
>> dg-require-effective-target autoincdec
>
> Right I figured out how to do this - not trivial as it needs a secret flag in the
> glob call - if anyone knows a better way of doing this I'd like to know!
>
>
> Add check_effective_target_autoincdec that returns true if a target
> runs the auto_inc_dec optimization pass.
>
> OK for commit?
>
LGTM. Please give Mike 24 hours to respond, before committing.
R.
> ChangeLog:
> 2017-08-08 Wilco Dijkstra <wdijkstr@arm.com>
>
> gcc/testsuite/
>
> * gcc.dg/pr46932.c: Use effective_target autoincdec.
> * lib/target-supports.exp: Add check_effective_target_autoincdec.
> --
>
> diff --git a/gcc/testsuite/gcc.dg/pr46932.c b/gcc/testsuite/gcc.dg/pr46932.c
> index 4eb1a99e1bd9403f8b1c5d0d71ef731ad4a65128..2b39990d036035d22e226b98351a4900a5dbb309 100644
> --- a/gcc/testsuite/gcc.dg/pr46932.c
> +++ b/gcc/testsuite/gcc.dg/pr46932.c
> @@ -1,7 +1,5 @@
> /* { dg-options "-O2 -fdump-rtl-auto_inc_dec" } */
> -
> -/* Build on targets which have pre increment. */
> -/* { dg-do compile { target aarch64*-*-* arm*-*-* rs6000-*-* powerpc*-*-* arc*-*-* m32r-*-* tic6x-*-* } } */
> +/* { dg-require-effective-target autoincdec } */
>
> /* Check that accesses based on the frame pointer do not
> use auto increment. */
> diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
> index 5a6562794b2bdd5f370fc5b26d6887777f02779a..5219fbf4671e83a6fa7affdab926115e8a23f9cb 100644
> --- a/gcc/testsuite/lib/target-supports.exp
> +++ b/gcc/testsuite/lib/target-supports.exp
> @@ -8482,3 +8482,18 @@ proc check_effective_target_arm_coproc4_ok { } {
> return [check_cached_effective_target arm_coproc4_ok \
> check_effective_target_arm_coproc4_ok_nocache]
> }
> +
> +# Return 1 if the target supports the auto_inc_dec optimization pass.
> +proc check_effective_target_autoincdec { } {
> + if { ![check_no_compiler_messages auto_incdec assembly { void f () { }
> + } "-O2 -fdump-rtl-auto_inc_dec" ] } {
> + return 0
> + }
> +
> + set dumpfile [glob -nocomplain "auto_incdec[pid].c.\[0-9\]\[0-9\]\[0-9\]r.auto_inc_dec"]
> + if { [file exists $dumpfile ] } {
> + file delete $dumpfile
> + return 1
> + }
> + return 0
> +}
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH][testsuite] Add check_effective_target_autoincdec
2017-08-09 12:50 ` Richard Earnshaw (lists)
@ 2017-08-10 0:26 ` Mike Stump
0 siblings, 0 replies; 8+ messages in thread
From: Mike Stump @ 2017-08-10 0:26 UTC (permalink / raw)
To: Richard Earnshaw (lists); +Cc: Wilco Dijkstra, GCC Patches
On Aug 9, 2017, at 5:50 AM, Richard Earnshaw (lists) <Richard.Earnshaw@arm.com> wrote:
>
> On 09/08/17 12:37, Wilco Dijkstra wrote:
>> Richard Earnshaw wrote:
>>> Except that I think this would be better done as an 'effective target'
>>> test; something like
>>>
>>> dg-require-effective-target autoincdec
>>
>> Right I figured out how to do this - not trivial as it needs a secret flag in the
>> glob call - if anyone knows a better way of doing this I'd like to know!
>>
>>
>> Add check_effective_target_autoincdec that returns true if a target
>> runs the auto_inc_dec optimization pass.
>>
>> OK for commit?
>>
>
> LGTM. Please give Mike 24 hours to respond, before committing.
Ok. I'm happy for things like this to just go in on port or front-end review alone. It's a pretty standard sort of change, dare say, kinda trivial.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH][testsuite] Add check_effective_target_autoincdec
2017-08-09 11:37 ` [PATCH][testsuite] Add check_effective_target_autoincdec Wilco Dijkstra
2017-08-09 12:50 ` Richard Earnshaw (lists)
@ 2017-08-11 16:12 ` Rainer Orth
1 sibling, 0 replies; 8+ messages in thread
From: Rainer Orth @ 2017-08-11 16:12 UTC (permalink / raw)
To: Wilco Dijkstra; +Cc: Richard Earnshaw, GCC Patches, nd
Hi Wilco,
> Richard Earnshaw wrote:
>> Except that I think this would be better done as an 'effective target'
>> test; something like
>>
>> dg-require-effective-target autoincdec
>
> Right I figured out how to do this - not trivial as it needs a secret flag
> in the
> glob call - if anyone knows a better way of doing this I'd like to know!
>
>
> Add check_effective_target_autoincdec that returns true if a target
> runs the auto_inc_dec optimization pass.
>
> OK for commit?
>
> ChangeLog:
> 2017-08-08 Wilco Dijkstra <wdijkstr@arm.com>
>
> gcc/testsuite/
>
> * gcc.dg/pr46932.c: Use effective_target autoincdec.
> * lib/target-supports.exp: Add check_effective_target_autoincdec.
> --
>
> diff --git a/gcc/testsuite/gcc.dg/pr46932.c b/gcc/testsuite/gcc.dg/pr46932.c
> index 4eb1a99e1bd9403f8b1c5d0d71ef731ad4a65128..2b39990d036035d22e226b98351a4900a5dbb309 100644
> --- a/gcc/testsuite/gcc.dg/pr46932.c
> +++ b/gcc/testsuite/gcc.dg/pr46932.c
> @@ -1,7 +1,5 @@
> /* { dg-options "-O2 -fdump-rtl-auto_inc_dec" } */
> -
> -/* Build on targets which have pre increment. */
> -/* { dg-do compile { target aarch64*-*-* arm*-*-* rs6000-*-* powerpc*-*-* arc*-*-* m32r-*-* tic6x-*-* } } */
> +/* { dg-require-effective-target autoincdec } */
>
> /* Check that accesses based on the frame pointer do not
> use auto increment. */
> diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
> index 5a6562794b2bdd5f370fc5b26d6887777f02779a..5219fbf4671e83a6fa7affdab926115e8a23f9cb 100644
> --- a/gcc/testsuite/lib/target-supports.exp
> +++ b/gcc/testsuite/lib/target-supports.exp
> @@ -8482,3 +8482,18 @@ proc check_effective_target_arm_coproc4_ok { } {
> return [check_cached_effective_target arm_coproc4_ok \
> check_effective_target_arm_coproc4_ok_nocache]
> }
> +
> +# Return 1 if the target supports the auto_inc_dec optimization pass.
> +proc check_effective_target_autoincdec { } {
> + if { ![check_no_compiler_messages auto_incdec assembly { void f () { }
> + } "-O2 -fdump-rtl-auto_inc_dec" ] } {
> + return 0
> + }
> +
> + set dumpfile [glob -nocomplain "auto_incdec[pid].c.\[0-9\]\[0-9\]\[0-9\]r.auto_inc_dec"]
> + if { [file exists $dumpfile ] } {
> + file delete $dumpfile
> + return 1
> + }
> + return 0
> +}
the new keyword needs documenting in sourcebuild.texi (often forgotten ;-)
Rainer
--
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2017-08-11 14:36 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-07 13:59 [COMMITTED] PR46932: Fix unresolved in testsuite Wilco Dijkstra
2017-08-07 14:37 ` Richard Earnshaw (lists)
2017-08-07 14:42 ` Wilco Dijkstra
2017-08-07 14:45 ` Richard Earnshaw (lists)
2017-08-09 11:37 ` [PATCH][testsuite] Add check_effective_target_autoincdec Wilco Dijkstra
2017-08-09 12:50 ` Richard Earnshaw (lists)
2017-08-10 0:26 ` Mike Stump
2017-08-11 16:12 ` Rainer Orth
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).