From: Alan Modra Date: Thu, 14 Jul 2016 04:26:36 +0000 (+0930) Subject: [RS6000] -mno-vsx should force -mno-power9-dform X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b799a4819ae2c4002ca86c339ac6a2a1fb840bdf;p=gcc.git [RS6000] -mno-vsx should force -mno-power9-dform PR target/71733 gcc/ * config/rs6000/rs6000.c (rs6000_option_override_internal): Deal with p9_vector override before power9-dform override. gcc/testsuite/ * gcc.target/powerpc/p9-novsx.c: New. From-SVN: r238326 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 134db049278..a1cf7424d9d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2016-07-14 Alan Modra + + PR target/71733 + * config/rs6000/rs6000.c (rs6000_option_override_internal): Deal + with p9_vector override before power9-dform override. + 2016-07-13 Andi Kleen * value-prof.c (gimple_value_profile_transformations): Don't run diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index 99a2e36911b..63655b1d267 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -4256,6 +4256,14 @@ rs6000_option_override_internal (bool global_init_p) && !(rs6000_isa_flags_explicit & OPTION_MASK_TOC_FUSION)) rs6000_isa_flags |= OPTION_MASK_TOC_FUSION; + /* ISA 3.0 vector instructions include ISA 2.07. */ + if (TARGET_P9_VECTOR && !TARGET_P8_VECTOR) + { + if (rs6000_isa_flags_explicit & OPTION_MASK_P8_VECTOR) + error ("-mpower9-vector requires -mpower8-vector"); + rs6000_isa_flags &= ~OPTION_MASK_P9_VECTOR; + } + /* -mpower9-dform turns on both -mpower9-dform-scalar and -mpower9-dform-vector. */ if (TARGET_P9_DFORM_BOTH > 0) @@ -4298,14 +4306,6 @@ rs6000_option_override_internal (bool global_init_p) rs6000_isa_flags &= ~OPTION_MASK_P9_DFORM_SCALAR; } - /* ISA 3.0 vector instructions include ISA 2.07. */ - if (TARGET_P9_VECTOR && !TARGET_P8_VECTOR) - { - if (rs6000_isa_flags_explicit & OPTION_MASK_P8_VECTOR) - error ("-mpower9-vector requires -mpower8-vector"); - rs6000_isa_flags &= ~OPTION_MASK_P9_VECTOR; - } - /* There have been bugs with -mvsx-timode that don't show up with -mlra, but do show up with -mno-lra. Given -mlra will become the default once PR 69847 is fixed, turn off the options with problems by default if diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 6119421f7b4..4591803c5fa 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2016-07-14 Alan Modra + + PR target/71733 + * gcc.target/powerpc/p9-novsx.c: New. + 2016-07-13 Andi Kleen * g++.dg/tree-prof/indir-call-prof.C: Basic fixes for autofdo. diff --git a/gcc/testsuite/gcc.target/powerpc/p9-novsx.c b/gcc/testsuite/gcc.target/powerpc/p9-novsx.c new file mode 100644 index 00000000000..7e410307dd2 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/p9-novsx.c @@ -0,0 +1,21 @@ +/* { dg-do compile } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */ +/* { dg-options "-mcpu=power9 -mno-vsx -O1" } */ +/* { dg-require-effective-target powerpc_altivec_ok } */ +/* { dg-final { scan-assembler-times "lvx %?v?2,%?r?3" 1 } } */ +/* { dg-final { scan-assembler-times "stvx %?v?2,%?r?3" 1 } } */ + +/* PR target/71733. */ +typedef __attribute__ ((altivec(vector__), aligned(16))) unsigned char vec_t; + +vec_t +f1 (vec_t *dst) +{ + return dst[1]; +} + +void +f2 (vec_t *dst, vec_t src) +{ + dst[1] = src; +}