diff mbox

[v2] PR68972: g++.dg/cpp1y/vla-initlist1.C test case fails on power

Message ID b77c9aa7-4b8d-e32c-cdcc-5d1fabee5fc3@linux.vnet.ibm.com
State New
Headers show

Commit Message

Kelvin Nilsen Feb. 7, 2017, 6 p.m. UTC
This second version of the proposed patch removes redundant and unnecessary
default arguments to the dg-skip-if directive, as requested by Rainer Orth.
Thank you Rainer for your review and feedback.

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

Comments

Mike Stump Feb. 7, 2017, 6:46 p.m. UTC | #1
On Feb 7, 2017, at 10:00 AM, Kelvin Nilsen <kdnilsen@linux.vnet.ibm.com> wrote:
> 
> While these assumptions are valid with some optimization choices on some
> architectures, these assumptions do not hold universally.

> Is this ok for trunk?

Ok.

I'm working on the assumption that this doesn't fail too often.  If it did, then I'd rather it be made portable, or list only system where it is known to work, or just be removed.

I'd welcome someone trying their hand at making the test case portable...
diff mbox

Patch

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>