diff options
author | Kelvin Nilsen <kelvin@gcc.gnu.org> | 2017-03-31 19:43:25 +0000 |
---|---|---|
committer | Kelvin Nilsen <kelvin@gcc.gnu.org> | 2017-03-31 19:43:25 +0000 |
commit | 2f9500a38e37f843e59496682efb29e516f8043e (patch) | |
tree | 55616c415caed57a02eee2608bc906030df4df5a | |
parent | 35c18d1a20f1f421b2c17590b3153f41f232a8d4 (diff) |
working checkpointibm/bz80108
git-svn-id: https://gcc.gnu.org/svn/gcc/branches/ibm/bz80108@246624 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/config/rs6000/rs6000.c | 24 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/powerpc/ppc-fortran/ppc-fortran.exp | 65 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/powerpc/ppc-fortran/pr80108-1.f90 | 54 |
3 files changed, 142 insertions, 1 deletions
diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index c63eebfdb3a..48990ef127c 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -4273,8 +4273,30 @@ rs6000_option_override_internal (bool global_init_p) /* For the newer switches (vsx, dfp, etc.) set some of the older options, unless the user explicitly used the -mno-<option> to disable the code. */ if (TARGET_P9_VECTOR || TARGET_MODULO || TARGET_P9_DFORM_SCALAR - || TARGET_P9_DFORM_VECTOR || TARGET_P9_DFORM_BOTH > 0 || TARGET_P9_MINMAX) + || TARGET_P9_DFORM_VECTOR || TARGET_P9_DFORM_BOTH > 0) rs6000_isa_flags |= (ISA_3_0_MASKS_SERVER & ~rs6000_isa_flags_explicit); + else if (TARGET_P9_MINMAX) + { + if (have_cpu) + { + if (cpu_index == PROCESSOR_POWER9) + /* legacy behavior: allow -mcpu-power9 with certain capabilities + (eg -mno-vsx) explicitly disabled. */ + rs6000_isa_flags |= + (ISA_3_0_MASKS_SERVER & ~rs6000_isa_flags_explicit); + else + error ("Power9 target option is incompatible with -mcpu=<xxx> for " + "<xxx> less than power9"); + } + else if ((ISA_3_0_MASKS_SERVER & rs6000_isa_flags_explicit) + != (ISA_3_0_MASKS_SERVER & rs6000_isa_flags + & rs6000_isa_flags_explicit)) + /* Enforce that none of the ISA_3_0_MASKS_SERVER flags + were explicitly cleared. */ + error ("-mpower9-minmax incompatible with explicitly disabled options"); + else + rs6000_isa_flags |= ISA_3_0_MASKS_SERVER; + } else if (TARGET_P8_VECTOR || TARGET_DIRECT_MOVE || TARGET_CRYPTO) rs6000_isa_flags |= (ISA_2_7_MASKS_SERVER & ~rs6000_isa_flags_explicit); else if (TARGET_VSX) diff --git a/gcc/testsuite/gcc.target/powerpc/ppc-fortran/ppc-fortran.exp b/gcc/testsuite/gcc.target/powerpc/ppc-fortran/ppc-fortran.exp new file mode 100644 index 00000000000..82cbb210b92 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/ppc-fortran/ppc-fortran.exp @@ -0,0 +1,65 @@ +# Copyright (C) 2004-2017 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GCC; see the file COPYING3. If not see +# <http://www.gnu.org/licenses/>. + +# GCC testsuite that uses the `dg.exp' driver. + +# Load support procs. +load_lib gfortran-dg.exp + +# If a testcase doesn't have special options, use these. +global DEFAULT_FFLAGS +if ![info exists DEFAULT_FFLAGS] then { + set DEFAULT_FFLAGS " -pedantic-errors" +} + +# Initialize `dg'. +dg-init + +global gfortran_test_path +global gfortran_aux_module_flags +set gfortran_test_path $srcdir/$subdir +set gfortran_aux_module_flags $DEFAULT_FFLAGS +proc dg-compile-aux-modules { args } { + global gfortran_test_path + global gfortran_aux_module_flags + if { [llength $args] != 2 } { + error "dg-set-target-env-var: needs one argument" + return + } + + set level [info level] + if { [info procs dg-save-unknown] != [list] } { + rename dg-save-unknown dg-save-unknown-level-$level + } + + dg-test $gfortran_test_path/[lindex $args 1] "" $gfortran_aux_module_flags + # cleanup-modules is intentionally not invoked here. + + if { [info procs dg-save-unknown-level-$level] != [list] } { + rename dg-save-unknown-level-$level dg-save-unknown + } +} + +# Main loop. +gfortran-dg-runtest [lsort \ + [glob -nocomplain $srcdir/$subdir/*.\[fF\]{,90,95,03,08} ] ] "" $DEFAULT_FFLAGS + +gfortran-dg-runtest [lsort \ + [glob -nocomplain $srcdir/$subdir/g77/*.\[fF\] ] ] "" $DEFAULT_FFLAGS + + +# All done. +dg-finish diff --git a/gcc/testsuite/gcc.target/powerpc/ppc-fortran/pr80108-1.f90 b/gcc/testsuite/gcc.target/powerpc/ppc-fortran/pr80108-1.f90 new file mode 100644 index 00000000000..38adac0b4b9 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/ppc-fortran/pr80108-1.f90 @@ -0,0 +1,54 @@ +! PR80108.c Stream IO test 11, tests formatted form. +! Originally contributed by Tobias Burnas. +! { dg-do compile { target { powerpc*-*-* } } } +! { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } +! { dg-require-effective-target powerpc_p9vector_ok } +! { dg-options "-m32 -mcpu=405 -mpower9-minmax -mfloat128-type" } +! { dg-excess-errors "expect error due to conflicting target options" } +! Since the error message is not associated with a particular line +! number, we cannot use the dg-error directive and cannot specify a +! regexp to describe the expected error message. The expected error +! message is: +! "Power9 target option is incompatible with -mcpu=<xxx> for <xxx> +! less than power9" + +program stream_test + implicit none + character(len=*), parameter :: rec1 = 'record1' + character(len=*), parameter :: rec2 = 'record2' + character(len=50) :: str1,str2 + integer :: len, i + real :: r + + open(10,form='formatted',access='stream',& + status='scratch',position='rewind') + write(10,'(a)') rec1//new_line('a')//rec2 + rewind(10) + read(10,*) str1 + read(10,*) str2 + if(str1 /= rec1 .or. str2 /= rec2) call abort() + rewind(10) + read(10,'(a)') str1 + read(10,'(a)') str2 + if(str1 /= rec1 .or. str2 /= rec2) call abort() + close(10) + + open(10,form='formatted',access='stream',& + status='scratch',position='rewind') + write(10,*) '123 '//trim(rec1)//' 1e-12' + write(10,*) '12345.6789' + rewind(10) + read(10,*) i,str1 + read(10,*) r + if(i /= 123 .or. str1 /= rec1 .or. r /= 12345.6789) & + call abort() + close(10) + + open(unit=10,form='unformatted',access='stream', & + status='scratch',position='rewind') + write(10) rec1//new_line('a')//rec2 + len = len_trim(rec1//new_line('a')//rec2) + rewind(10) + read(10) str1(1:len) + if(str1 /= rec1//new_line('a')//rec2) call abort() +end program stream_test |