From: Michael Meissner Date: Thu, 26 Jan 2017 04:16:11 +0000 (+0000) Subject: re PR target/79179 (PowerPC64: -mcpu=power9 creates stxsd with bad offset) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b5aa1281e13a78507de6b19e0a765ad7709d7dd9;p=gcc.git re PR target/79179 (PowerPC64: -mcpu=power9 creates stxsd with bad offset) [gcc] 2017-01-25 Michael Meissner PR target/79179 * config/rs6000/vsx.md (vsx_extract__store): Use wY constraint instead of o for the stxsd instruction. [gcc/testsuite] 2017-01-25 Michael Meissner PR target/79179 * gcc.target/powerpc/pr79179.c: New test. From-SVN: r244917 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 4712d7c40d9..a068478407a 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2017-01-25 Michael Meissner + + PR target/79179 + * config/rs6000/vsx.md (vsx_extract__store): Use wY + constraint instead of o for the stxsd instruction. + 2017-01-25 Carl Love * config/rs6000/rs6000-c (altivec_overloaded_builtins): Fix order diff --git a/gcc/config/rs6000/vsx.md b/gcc/config/rs6000/vsx.md index 28bbeb2a7d9..b10ade40db6 100644 --- a/gcc/config/rs6000/vsx.md +++ b/gcc/config/rs6000/vsx.md @@ -2323,7 +2323,7 @@ ;; Optimize storing a single scalar element that is the right location to ;; memory (define_insn "*vsx_extract__store" - [(set (match_operand: 0 "memory_operand" "=m,Z,o") + [(set (match_operand: 0 "memory_operand" "=m,Z,wY") (vec_select: (match_operand:VSX_D 1 "register_operand" "d,wv,wb") (parallel [(match_operand:QI 2 "vsx_scalar_64bit" "wD,wD,wD")])))] diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 99bec45d5a7..1cce5212987 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2017-01-25 Michael Meissner + + PR target/79179 + * gcc.target/powerpc/pr79179.c: New test. + 2017-01-25 Bill Schmidt * gcc.target/powerpc/vsx-elemrev-4.c: Change expected code diff --git a/gcc/testsuite/gcc.target/powerpc/pr79179.c b/gcc/testsuite/gcc.target/powerpc/pr79179.c new file mode 100644 index 00000000000..0815a2e38b6 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/pr79179.c @@ -0,0 +1,23 @@ +/* { dg-do assemble { target { powerpc*-*-* && lp64 } } } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */ +/* { dg-require-effective-target powerpc_p9vector_ok } */ +/* { dg-options "-mcpu=power9 -O3" } */ + +/* Compile with -O3 -mcpu=power9. It originally generated + + stxsd 12,1(9) + + which is illegal. */ + +#pragma pack(1) +struct { + signed : 1; + unsigned long a; +} b; + +void c(void) +{ + b.a = 0; + for (; b.a <= 45; b.a = (long)b.a + 1) + ; +}