From: Christian Borntraeger Date: Fri, 8 Jun 2012 06:39:43 +0000 (+0000) Subject: CDSG needs quad word (16 byte) aligned data structures. Since the stack X-Git-Tag: svn/VALGRIND_3_8_0~248 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=22e12f07a186ff9773d47d0d663cc8ee361e69c6;p=thirdparty%2Fvalgrind.git CDSG needs quad word (16 byte) aligned data structures. Since the stack on s390 has only 8 byte alignment gcc cant guarantee 16 byte alignment for local variables. As a global variable gcc can do that. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12620 --- diff --git a/none/tests/s390x/cdsg.c b/none/tests/s390x/cdsg.c index b1392d3ec2..f4f7f9f855 100644 --- a/none/tests/s390x/cdsg.c +++ b/none/tests/s390x/cdsg.c @@ -4,21 +4,26 @@ typedef struct { uint64_t high; uint64_t low; -} quad_word; +} __attribute__((aligned(16))) quad_word; -void + +/* CDSG needs quad-word alignment */ +quad_word op1, op2, op3; + +void test(quad_word op1_init, quad_word op2_init, quad_word op3_init, int expected_cc) { + quad_word op1_before, op2_before, op3_before; int cc = 1 - expected_cc; - quad_word op1 = op1_init; - quad_word op2 = op2_init; - quad_word op3 = op3_init; + op1 = op1_init; + op2 = op2_init; + op3 = op3_init; - quad_word op1_before = op1; - quad_word op2_before = op2; - quad_word op3_before = op3; + op1_before = op1; + op2_before = op2; + op3_before = op3; printf("before op1 = (%#lx, %#lx)\n", op1.high, op1.low); printf("before op2 = (%#lx, %#lx)\n", op2.high, op2.low);