On S/390, __builtin_return_address and __builtin_frame_address
require the -mbackchain option to work for arbitrary stack frames.
The attached patch adds the option to two test cases to make them
work.

Ciao

Dominik ^_^  ^_^

-- 

Dominik Vogt
IBM Germany
gcc/testsuite/ChangeLog

        * gcc.dg/Wframe-address.c: S/390 requires the -mbackchain option to
        access arbitrary stack frames.
        * gcc.dg/Wno-frame-address.c: Likewise.
>From 3461500e48e8f83bd18d5d6ea771ddf2d5ee7c35 Mon Sep 17 00:00:00 2001
From: Dominik Vogt <v...@linux.vnet.ibm.com>
Date: Fri, 4 Dec 2015 01:07:38 +0100
Subject: [PATCH] S/390: Add -mbackchain options to fix test failure.

---
 gcc/testsuite/gcc.dg/Wframe-address.c    | 1 +
 gcc/testsuite/gcc.dg/Wno-frame-address.c | 1 +
 2 files changed, 2 insertions(+)

diff --git a/gcc/testsuite/gcc.dg/Wframe-address.c b/gcc/testsuite/gcc.dg/Wframe-address.c
index 7481baf..29bdfa3 100644
--- a/gcc/testsuite/gcc.dg/Wframe-address.c
+++ b/gcc/testsuite/gcc.dg/Wframe-address.c
@@ -1,5 +1,6 @@
 /* { dg-do compile } */
 /* { dg-options "-Wframe-address" } */
+/* { dg-additional-options "-mbackchain" { target { s390*-*-* } } } */
 
 void* __attribute__ ((noclone, noinline))
 test_builtin_frame_address (unsigned i)
diff --git a/gcc/testsuite/gcc.dg/Wno-frame-address.c b/gcc/testsuite/gcc.dg/Wno-frame-address.c
index 6409b29..e5d078f 100644
--- a/gcc/testsuite/gcc.dg/Wno-frame-address.c
+++ b/gcc/testsuite/gcc.dg/Wno-frame-address.c
@@ -1,6 +1,7 @@
 /* { dg-do compile } */
 /* { dg-skip-if "Cannot access arbitrary stack frames" { arm*-*-* hppa*-*-* visium-*-* } } */
 /* { dg-options "-Werror" } */
+/* { dg-additional-options "-mbackchain" { target { s390*-*-* } } } */
 
 /* Verify that -Wframe-address is not enabled by default by enabling
    -Werror and verifying the test still compiles.  */
-- 
2.3.0

Reply via email to