public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] PR68972: g++.dg/cpp1y/vla-initlist1.C test case fails on power
@ 2017-02-06 22:20 Kelvin Nilsen
  2017-02-06 23:13 ` Rainer Orth
  2017-06-26 22:22 ` [PATCH] PR68972: g++.dg/cpp1y/vla-initlist1.C test case fails on power (backport) Kelvin Nilsen
  0 siblings, 2 replies; 3+ messages in thread
From: Kelvin Nilsen @ 2017-02-06 22:20 UTC (permalink / raw)
  To: gcc-patches, law


The test g++.dg/cpp1y/vla-initlist1.C makes assumptions that the memory
used to represent the private temporary variables of neighboring control
blocks at the same control nesting level is:

1. found at the same address, and
2. not overwritten between when the first block ends and the second
block begins.

While these assumptions are valid with some optimization choices on some
architectures, these assumptions do not hold universally.

With optimization disabled on the power architecture, the
g++.dg/cpp1y/vla-initlist1.C test program runs initialization code to
allocate the variable-length array a[] before entry into the second of
two neighboring control blocks.  This initialization code overwrites the
first two cells of the array i[] that were initialized by the first of
the two neighboring control blocks.  Thus, the initialization value
stored into i[1] is no longer present when this value is subsequently
fetched as a[1].i from within the second control block.

This patch disables this particular test case on power hardware.

The patch has been bootstrapped and tested on
powerpc64le-unknown-linux with no regressions.

Is this ok for trunk?

gcc/testsuite/ChangeLog:

2017-02-06  Kelvin Nilsen  <kelvin@gcc.gnu.org>

	PR target/68972
	* g++.dg/cpp1y/vla-initlist1.C: Add dg-skip-if directive to
	disable this test on power architecture.

Index: gcc/testsuite/g++.dg/cpp1y/vla-initlist1.C
===================================================================
--- gcc/testsuite/g++.dg/cpp1y/vla-initlist1.C	(revision 245156)
+++ gcc/testsuite/g++.dg/cpp1y/vla-initlist1.C	(working copy)
@@ -1,4 +1,5 @@
 // { dg-do run { target c++11 } }
+// { dg-skip-if "power overwrites two slots of array i" { "power*-*-*"
} { "*" } { "" } }
 // { dg-options "-Wno-vla" }

 #include <initializer_list>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] PR68972: g++.dg/cpp1y/vla-initlist1.C test case fails on power
  2017-02-06 22:20 [PATCH] PR68972: g++.dg/cpp1y/vla-initlist1.C test case fails on power Kelvin Nilsen
@ 2017-02-06 23:13 ` Rainer Orth
  2017-06-26 22:22 ` [PATCH] PR68972: g++.dg/cpp1y/vla-initlist1.C test case fails on power (backport) Kelvin Nilsen
  1 sibling, 0 replies; 3+ messages in thread
From: Rainer Orth @ 2017-02-06 23:13 UTC (permalink / raw)
  To: Kelvin Nilsen; +Cc: gcc-patches, law

Kelvin Nilsen <kdnilsen@linux.vnet.ibm.com> writes:

> Index: gcc/testsuite/g++.dg/cpp1y/vla-initlist1.C
> ===================================================================
> --- gcc/testsuite/g++.dg/cpp1y/vla-initlist1.C	(revision 245156)
> +++ gcc/testsuite/g++.dg/cpp1y/vla-initlist1.C	(working copy)
> @@ -1,4 +1,5 @@
>  // { dg-do run { target c++11 } }
> +// { dg-skip-if "power overwrites two slots of array i" { "power*-*-*"
> } { "*" } { "" } }

Please omit the default args to dg-skip-if: they're unnecessary.

	Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] PR68972: g++.dg/cpp1y/vla-initlist1.C test case fails on power (backport)
  2017-02-06 22:20 [PATCH] PR68972: g++.dg/cpp1y/vla-initlist1.C test case fails on power Kelvin Nilsen
  2017-02-06 23:13 ` Rainer Orth
@ 2017-06-26 22:22 ` Kelvin Nilsen
  1 sibling, 0 replies; 3+ messages in thread
From: Kelvin Nilsen @ 2017-06-26 22:22 UTC (permalink / raw)
  To: gcc-patches, law


Is this ok for backport to GCC 6?

On 02/06/2017 03:20 PM, Kelvin Nilsen wrote:
> 
> The test g++.dg/cpp1y/vla-initlist1.C makes assumptions that the memory
> used to represent the private temporary variables of neighboring control
> blocks at the same control nesting level is:
> 
> 1. found at the same address, and
> 2. not overwritten between when the first block ends and the second
> block begins.
> 
> While these assumptions are valid with some optimization choices on some
> architectures, these assumptions do not hold universally.
> 
> With optimization disabled on the power architecture, the
> g++.dg/cpp1y/vla-initlist1.C test program runs initialization code to
> allocate the variable-length array a[] before entry into the second of
> two neighboring control blocks.  This initialization code overwrites the
> first two cells of the array i[] that were initialized by the first of
> the two neighboring control blocks.  Thus, the initialization value
> stored into i[1] is no longer present when this value is subsequently
> fetched as a[1].i from within the second control block.
> 
> This patch disables this particular test case on power hardware.
> 
> The patch has been bootstrapped and tested on
> powerpc64le-unknown-linux with no regressions.
> 
> Is this ok for trunk?
> 
> gcc/testsuite/ChangeLog:
> 
> 2017-02-06  Kelvin Nilsen  <kelvin@gcc.gnu.org>
> 
> 	PR target/68972
> 	* g++.dg/cpp1y/vla-initlist1.C: Add dg-skip-if directive to
> 	disable this test on power architecture.
> 
> Index: gcc/testsuite/g++.dg/cpp1y/vla-initlist1.C
> ===================================================================
> --- gcc/testsuite/g++.dg/cpp1y/vla-initlist1.C	(revision 245156)
> +++ gcc/testsuite/g++.dg/cpp1y/vla-initlist1.C	(working copy)
> @@ -1,4 +1,5 @@
>  // { dg-do run { target c++11 } }
> +// { dg-skip-if "power overwrites two slots of array i" { "power*-*-*"
> } { "*" } { "" } }
>  // { dg-options "-Wno-vla" }
> 
>  #include <initializer_list>
> 
> 

-- 
Kelvin Nilsen, Ph.D.  kdnilsen@linux.vnet.ibm.com
home office: 801-756-4821, cell: 520-991-6727
IBM Linux Technology Center - PPC Toolchain

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-06-26 22:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-06 22:20 [PATCH] PR68972: g++.dg/cpp1y/vla-initlist1.C test case fails on power Kelvin Nilsen
2017-02-06 23:13 ` Rainer Orth
2017-06-26 22:22 ` [PATCH] PR68972: g++.dg/cpp1y/vla-initlist1.C test case fails on power (backport) Kelvin Nilsen

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).