aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog1157
-rw-r--r--gcc/DATESTAMP2
-rw-r--r--gcc/Makefile.in3
-rw-r--r--gcc/ada/ChangeLog33
-rw-r--r--gcc/ada/gcc-interface/decl.c16
-rw-r--r--gcc/ada/gcc-interface/trans.c48
-rw-r--r--gcc/ada/locales.c2
-rw-r--r--gcc/ada/sem_ch8.adb6
-rw-r--r--gcc/ada/sem_elab.adb16
-rw-r--r--gcc/ada/sem_spark.adb4
-rw-r--r--gcc/ada/sem_util.adb43
-rw-r--r--gcc/ada/sem_util.ads21
-rw-r--r--gcc/c-family/ChangeLog42
-rw-r--r--gcc/c-family/c-ada-spec.c12
-rw-r--r--gcc/c-family/c-common.h1
-rw-r--r--gcc/c-family/c-lex.c7
-rw-r--r--gcc/c-family/c-omp.c22
-rw-r--r--gcc/c-family/c-warn.c2
-rw-r--r--gcc/c/ChangeLog30
-rw-r--r--gcc/c/c-parser.c111
-rw-r--r--gcc/c/c-typeck.c7
-rw-r--r--gcc/calls.c13
-rw-r--r--gcc/cfgcleanup.c36
-rw-r--r--gcc/common/config/s390/s390-common.c4
-rw-r--r--gcc/config.gcc13
-rw-r--r--gcc/config/aarch64/aarch64-option-extensions.def2
-rw-r--r--gcc/config/aarch64/aarch64.md6
-rw-r--r--gcc/config/aarch64/aarch64.opt6
-rw-r--r--gcc/config/alpha/alpha.c3
-rw-r--r--gcc/config/arc/arc.c16
-rw-r--r--gcc/config/arc/arc.md22
-rw-r--r--gcc/config/arm/arm.c84
-rw-r--r--gcc/config/arm/arm.md74
-rw-r--r--gcc/config/arm/arm.opt6
-rw-r--r--gcc/config/arm/arm_acle.h8
-rw-r--r--gcc/config/arm/t-multilib29
-rw-r--r--gcc/config/avr/avr.c15
-rw-r--r--gcc/config/darwin-driver.c44
-rw-r--r--gcc/config/darwin-protos.h2
-rw-r--r--gcc/config/darwin.c479
-rw-r--r--gcc/config/darwin.h170
-rw-r--r--gcc/config/darwin.opt401
-rw-r--r--gcc/config/darwin10.h9
-rw-r--r--gcc/config/darwin9.h6
-rw-r--r--gcc/config/i386/avx2intrin.h2
-rw-r--r--gcc/config/i386/avxintrin.h1
-rw-r--r--gcc/config/i386/darwin.h18
-rw-r--r--gcc/config/i386/emmintrin.h2
-rw-r--r--gcc/config/i386/i386.c36
-rw-r--r--gcc/config/i386/i386.h4
-rw-r--r--gcc/config/i386/intelmic-mkoffload.c5
-rw-r--r--gcc/config/i386/sse.md2
-rw-r--r--gcc/config/mips/mips.c4
-rw-r--r--gcc/config/mips/mips.md4
-rw-r--r--gcc/config/pa/pa.c195
-rw-r--r--gcc/config/pa/pa.h15
-rw-r--r--gcc/config/pa/pa.md52
-rw-r--r--gcc/config/pa/pa.opt8
-rw-r--r--gcc/config/riscv/riscv-protos.h4
-rw-r--r--gcc/config/riscv/riscv.c45
-rw-r--r--gcc/config/riscv/riscv.md36
-rw-r--r--gcc/config/rs6000/altivec.md227
-rw-r--r--gcc/config/rs6000/darwin.h35
-rw-r--r--gcc/config/rs6000/darwin.md27
-rw-r--r--gcc/config/rs6000/rs6000-builtin.def92
-rw-r--r--gcc/config/rs6000/rs6000-p8swap.c5
-rw-r--r--gcc/config/rs6000/rs6000.c153
-rw-r--r--gcc/config/rs6000/rs6000.md233
-rw-r--r--gcc/config/s390/8561.md92
-rw-r--r--gcc/config/s390/driver-native.c4
-rw-r--r--gcc/config/s390/s390-builtins.def2
-rw-r--r--gcc/config/s390/s390-c.c15
-rw-r--r--gcc/config/s390/s390-opts.h2
-rw-r--r--gcc/config/s390/s390.c58
-rw-r--r--gcc/config/s390/s390.h18
-rw-r--r--gcc/config/s390/s390.md58
-rw-r--r--gcc/config/s390/s390.opt5
-rw-r--r--gcc/config/s390/vector.md2
-rw-r--r--gcc/config/s390/vx-builtins.md6
-rw-r--r--gcc/config/sh/sh.c19
-rw-r--r--gcc/config/sh/sh.h2
-rw-r--r--gcc/config/sh/sh.md90
-rw-r--r--gcc/config/sparc/sparc-protos.h1
-rw-r--r--gcc/config/sparc/sparc.c116
-rw-r--r--gcc/config/sparc/sparc.h7
-rw-r--r--gcc/config/sparc/sparc.md5
-rw-r--r--gcc/config/xtensa/xtensa.c3
-rwxr-xr-xgcc/configure10
-rw-r--r--gcc/configure.ac5
-rw-r--r--gcc/cp/ChangeLog168
-rw-r--r--gcc/cp/call.c9
-rw-r--r--gcc/cp/class.c1
-rw-r--r--gcc/cp/constexpr.c12
-rw-r--r--gcc/cp/cp-gimplify.c24
-rw-r--r--gcc/cp/cp-tree.h5
-rw-r--r--gcc/cp/decl.c33
-rw-r--r--gcc/cp/parser.c19
-rw-r--r--gcc/cp/pt.c9
-rw-r--r--gcc/cp/semantics.c8
-rw-r--r--gcc/cp/tree.c62
-rw-r--r--gcc/cp/typeck.c24
-rw-r--r--gcc/doc/avr-mmcu.texi2
-rw-r--r--gcc/doc/install.texi2
-rw-r--r--gcc/doc/invoke.texi2
-rw-r--r--gcc/dwarf2out.c35
-rw-r--r--gcc/expmed.c21
-rw-r--r--gcc/fold-const.c10
-rw-r--r--gcc/fortran/ChangeLog312
-rw-r--r--gcc/fortran/array.c53
-rw-r--r--gcc/fortran/check.c56
-rw-r--r--gcc/fortran/class.c3
-rw-r--r--gcc/fortran/decl.c206
-rw-r--r--gcc/fortran/expr.c77
-rw-r--r--gcc/fortran/frontend-passes.c16
-rw-r--r--gcc/fortran/gfortran.h6
-rw-r--r--gcc/fortran/gfortran.texi49
-rw-r--r--gcc/fortran/intrinsic.c54
-rw-r--r--gcc/fortran/io.c72
-rw-r--r--gcc/fortran/match.c18
-rw-r--r--gcc/fortran/match.h5
-rw-r--r--gcc/fortran/parse.c37
-rw-r--r--gcc/fortran/primary.c15
-rw-r--r--gcc/fortran/resolve.c36
-rw-r--r--gcc/fortran/scanner.c26
-rw-r--r--gcc/fortran/simplify.c58
-rw-r--r--gcc/fortran/trans-array.c13
-rw-r--r--gcc/fortran/trans-decl.c65
-rw-r--r--gcc/fortran/trans-expr.c84
-rw-r--r--gcc/fortran/trans-stmt.c27
-rw-r--r--gcc/fortran/trans-types.c1
-rw-r--r--gcc/function.c19
-rw-r--r--gcc/gcov.c10
-rw-r--r--gcc/generic-match-head.c1
-rw-r--r--gcc/ggc-none.c5
-rw-r--r--gcc/ggc-page.c49
-rw-r--r--gcc/ggc.h3
-rw-r--r--gcc/gimple-fold.c1
-rw-r--r--gcc/gimple-streamer-out.c10
-rw-r--r--gcc/gimplify.c6
-rw-r--r--gcc/go/gofrontend/expressions.cc18
-rw-r--r--gcc/internal-fn.c27
-rw-r--r--gcc/ipa-cp.c1
-rw-r--r--gcc/ipa-prop.c12
-rw-r--r--gcc/ipa-prop.h1
-rw-r--r--gcc/ira.c9
-rw-r--r--gcc/lto-streamer-out.c110
-rw-r--r--gcc/lto-streamer.h1
-rw-r--r--gcc/lto/ChangeLog25
-rw-r--r--gcc/lto/lto-lang.c3
-rw-r--r--gcc/lto/lto.c9
-rw-r--r--gcc/match.pd147
-rw-r--r--gcc/optabs.c19
-rw-r--r--gcc/optc-save-gen.awk2
-rw-r--r--gcc/passes.c37
-rw-r--r--gcc/passes.def2
-rw-r--r--gcc/po/ChangeLog16
-rw-r--r--gcc/po/es.po435
-rw-r--r--gcc/po/fi.po64
-rw-r--r--gcc/rtlanal.c2
-rw-r--r--gcc/symbol-summary.h4
-rw-r--r--gcc/testsuite/ChangeLog792
-rw-r--r--gcc/testsuite/c-c++-common/cpp/pr92296-1.c32
-rw-r--r--gcc/testsuite/c-c++-common/cpp/pr92296-2.c73
-rw-r--r--gcc/testsuite/c-c++-common/gomp/pr88203-1.c61
-rw-r--r--gcc/testsuite/c-c++-common/gomp/pr88203-2.c65
-rw-r--r--gcc/testsuite/c-c++-common/gomp/pr88203-3.c28
-rw-r--r--gcc/testsuite/c-c++-common/gomp/pr91401-1.c10
-rw-r--r--gcc/testsuite/c-c++-common/gomp/pr91401-2.c15
-rw-r--r--gcc/testsuite/c-c++-common/gomp/pr91920.c19
-rw-r--r--gcc/testsuite/g++.dg/conversion/packed2.C15
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/constexpr-92015.C7
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/constexpr-odr1.C19
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/constexpr-odr2.C19
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/nontype5.C17
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/overload-conv-4.C23
-rw-r--r--gcc/testsuite/g++.dg/cpp1y/constexpr-incr2.C66
-rw-r--r--gcc/testsuite/g++.dg/cpp1y/nontype1.C42
-rw-r--r--gcc/testsuite/g++.dg/cpp1y/var-templ63.C5
-rw-r--r--gcc/testsuite/g++.dg/cpp1z/decomp50.C51
-rw-r--r--gcc/testsuite/g++.dg/cpp1z/eval-order5.C31
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/attr-likely6.C14
-rw-r--r--gcc/testsuite/g++.dg/debug/dwarf2/pr91887.C12
-rw-r--r--gcc/testsuite/g++.dg/diagnostic/pr90767-1.C15
-rw-r--r--gcc/testsuite/g++.dg/diagnostic/pr90767-2.C15
-rw-r--r--gcc/testsuite/g++.dg/ext/is_final.C14
-rw-r--r--gcc/testsuite/g++.dg/gomp/pr92504.C29
-rw-r--r--gcc/testsuite/g++.dg/init/array54.C13
-rw-r--r--gcc/testsuite/g++.dg/lto/pr91572_0.C12
-rw-r--r--gcc/testsuite/g++.dg/opt/pr91351.C38
-rw-r--r--gcc/testsuite/g++.dg/opt/pr92007.C32
-rw-r--r--gcc/testsuite/g++.dg/other/pr92201.C7
-rw-r--r--gcc/testsuite/g++.dg/pr92022.C13
-rw-r--r--gcc/testsuite/g++.dg/torture/pr91155.C18
-rw-r--r--gcc/testsuite/g++.dg/torture/pr91606.C109
-rw-r--r--gcc/testsuite/g++.dg/torture/pr92384.C38
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/20191108-1.c14
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/pr90840.c19
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/pr91001.c31
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/pr92056.c18
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/pr92231.c9
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/20190901-1.c36
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/20191023-1.c73
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/pr91450-1.c88
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/pr91450-2.c76
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/pr91597.c48
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/pr91632.c30
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/pr91635.c57
-rw-r--r--gcc/testsuite/gcc.dg/Wnonnull.c9
-rw-r--r--gcc/testsuite/gcc.dg/gomp/pr90637.c14
-rw-r--r--gcc/testsuite/gcc.dg/pr89435.c21
-rw-r--r--gcc/testsuite/gcc.dg/pr89795.c25
-rw-r--r--gcc/testsuite/gcc.dg/pr90898.c16
-rw-r--r--gcc/testsuite/gcc.dg/pr91269.c70
-rw-r--r--gcc/testsuite/gcc.dg/pr91720.c22
-rw-r--r--gcc/testsuite/gcc.dg/pr91734.c97
-rw-r--r--gcc/testsuite/gcc.dg/pr91885.c47
-rw-r--r--gcc/testsuite/gcc.dg/pr92430.c25
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr90278.c13
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr91812.c26
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/gen-vect-11.c6
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/gen-vect-26.c5
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/gen-vect-28.c5
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/gen-vect-32.c4
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/reassoc-24.c4
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/reassoc-25.c4
-rw-r--r--gcc/testsuite/gcc.dg/vect/pr91665.c15
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-fma-3.c17
-rw-r--r--gcc/testsuite/gcc.target/aarch64/no-inline-lrint_3.c17
-rw-r--r--gcc/testsuite/gcc.target/aarch64/nosplit-di-const-volatile_1.c15
-rw-r--r--gcc/testsuite/gcc.target/arc/delay-slot-limm.c52
-rw-r--r--gcc/testsuite/gcc.target/arc/pic-2.c23
-rw-r--r--gcc/testsuite/gcc.target/arm/acle/crc_hf_1.c14
-rw-r--r--gcc/testsuite/gcc.target/arm/multilib.exp22
-rw-r--r--gcc/testsuite/gcc.target/arm/pr88167-1.c15
-rw-r--r--gcc/testsuite/gcc.target/arm/pr88167-2.c18
-rw-r--r--gcc/testsuite/gcc.target/i386/indirect-thunk-1.c2
-rw-r--r--gcc/testsuite/gcc.target/i386/indirect-thunk-2.c2
-rw-r--r--gcc/testsuite/gcc.target/i386/indirect-thunk-3.c2
-rw-r--r--gcc/testsuite/gcc.target/i386/indirect-thunk-4.c2
-rw-r--r--gcc/testsuite/gcc.target/i386/indirect-thunk-attr-1.c2
-rw-r--r--gcc/testsuite/gcc.target/i386/indirect-thunk-attr-2.c2
-rw-r--r--gcc/testsuite/gcc.target/i386/indirect-thunk-attr-3.c2
-rw-r--r--gcc/testsuite/gcc.target/i386/indirect-thunk-attr-4.c2
-rw-r--r--gcc/testsuite/gcc.target/i386/indirect-thunk-attr-5.c2
-rw-r--r--gcc/testsuite/gcc.target/i386/indirect-thunk-attr-6.c2
-rw-r--r--gcc/testsuite/gcc.target/i386/indirect-thunk-extern-1.c2
-rw-r--r--gcc/testsuite/gcc.target/i386/indirect-thunk-extern-2.c2
-rw-r--r--gcc/testsuite/gcc.target/i386/indirect-thunk-extern-3.c2
-rw-r--r--gcc/testsuite/gcc.target/i386/indirect-thunk-extern-4.c2
-rw-r--r--gcc/testsuite/gcc.target/i386/indirect-thunk-inline-1.c2
-rw-r--r--gcc/testsuite/gcc.target/i386/indirect-thunk-inline-2.c2
-rw-r--r--gcc/testsuite/gcc.target/i386/indirect-thunk-inline-3.c2
-rw-r--r--gcc/testsuite/gcc.target/i386/indirect-thunk-inline-4.c2
-rw-r--r--gcc/testsuite/gcc.target/i386/pr32219-2.c2
-rw-r--r--gcc/testsuite/gcc.target/i386/pr32219-3.c2
-rw-r--r--gcc/testsuite/gcc.target/i386/pr32219-4.c2
-rw-r--r--gcc/testsuite/gcc.target/i386/pr32219-7.c2
-rw-r--r--gcc/testsuite/gcc.target/i386/pr32219-8.c2
-rw-r--r--gcc/testsuite/gcc.target/i386/pr87853.c20
-rw-r--r--gcc/testsuite/gcc.target/i386/pr90867.c30
-rw-r--r--gcc/testsuite/gcc.target/i386/pr91623.c32
-rw-r--r--gcc/testsuite/gcc.target/i386/pr91704.c14
-rw-r--r--gcc/testsuite/gcc.target/i386/pr92225.c19
-rw-r--r--gcc/testsuite/gcc.target/i386/ret-thunk-14.c2
-rw-r--r--gcc/testsuite/gcc.target/i386/ret-thunk-15.c2
-rw-r--r--gcc/testsuite/gcc.target/i386/ret-thunk-9.c2
-rw-r--r--gcc/testsuite/gcc.target/mips/cfgcleanup-jalr1.c19
-rw-r--r--gcc/testsuite/gcc.target/mips/cfgcleanup-jalr2.c23
-rw-r--r--gcc/testsuite/gcc.target/mips/cfgcleanup-jalr3.c23
-rw-r--r--gcc/testsuite/gcc.target/mips/pr91769.c19
-rw-r--r--gcc/testsuite/gcc.target/powerpc/darn-3.c16
-rw-r--r--gcc/testsuite/gcc.target/powerpc/pr70010-1.c18
-rw-r--r--gcc/testsuite/gcc.target/powerpc/pr70010-2.c18
-rw-r--r--gcc/testsuite/gcc.target/powerpc/pr70010-3.c17
-rw-r--r--gcc/testsuite/gcc.target/powerpc/pr70010-4.c17
-rw-r--r--gcc/testsuite/gcc.target/powerpc/pr70010.c19
-rw-r--r--gcc/testsuite/gcc.target/powerpc/pr91275.c26
-rw-r--r--gcc/testsuite/gcc.target/powerpc/pure-builtin-redundant-load.c47
-rw-r--r--gcc/testsuite/gcc.target/riscv/shift-shift-4.c13
-rw-r--r--gcc/testsuite/gcc.target/riscv/shift-shift-5.c16
-rw-r--r--gcc/testsuite/gcc.target/s390/s390.exp22
-rw-r--r--gcc/testsuite/gcc.target/s390/sigfpe-eh.c10
-rw-r--r--gcc/testsuite/gcc.target/sparc/20161111-1.c2
-rw-r--r--gcc/testsuite/gcc.target/sparc/overflow-1.c2
-rw-r--r--gcc/testsuite/gcc.target/sparc/overflow-2.c2
-rw-r--r--gcc/testsuite/gcc.target/sparc/overflow-3.c2
-rw-r--r--gcc/testsuite/gcc.target/sparc/overflow-4.c2
-rw-r--r--gcc/testsuite/gcc.target/sparc/overflow-5.c2
-rw-r--r--gcc/testsuite/gfortran.dg/ISO_Fortran_binding_1.c57
-rw-r--r--gcc/testsuite/gfortran.dg/ISO_Fortran_binding_13.c12
-rw-r--r--gcc/testsuite/gfortran.dg/ISO_Fortran_binding_13.f9039
-rw-r--r--gcc/testsuite/gfortran.dg/ISO_Fortran_binding_14.f9041
-rw-r--r--gcc/testsuite/gfortran.dg/ISO_Fortran_binding_17.c25
-rw-r--r--gcc/testsuite/gfortran.dg/ISO_Fortran_binding_17.f9077
-rw-r--r--gcc/testsuite/gfortran.dg/allocated_3.f906
-rw-r--r--gcc/testsuite/gfortran.dg/associate_49.f9034
-rw-r--r--gcc/testsuite/gfortran.dg/bind-c-intent-out.f9042
-rw-r--r--gcc/testsuite/gfortran.dg/bind_c_array_params_3.f9039
-rw-r--r--gcc/testsuite/gfortran.dg/bind_c_array_params_3_aux.c26
-rw-r--r--gcc/testsuite/gfortran.dg/char_result_19.f9024
-rw-r--r--gcc/testsuite/gfortran.dg/char_result_mod_19.f9018
-rw-r--r--gcc/testsuite/gfortran.dg/class_71.f9013
-rw-r--r--gcc/testsuite/gfortran.dg/dec_type_print_3.f904
-rw-r--r--gcc/testsuite/gfortran.dg/directive_unroll_5.f902
-rw-r--r--gcc/testsuite/gfortran.dg/do_subscript_6.f9011
-rw-r--r--gcc/testsuite/gfortran.dg/function_kinds_5.f901
-rw-r--r--gcc/testsuite/gfortran.dg/gomp/pr87752.f9012
-rw-r--r--gcc/testsuite/gfortran.dg/matmul_blas_2.f9025
-rw-r--r--gcc/testsuite/gfortran.dg/pdt_4.f034
-rw-r--r--gcc/testsuite/gfortran.dg/pr47054_1.f9015
-rw-r--r--gcc/testsuite/gfortran.dg/pr47054_2.f9041
-rw-r--r--gcc/testsuite/gfortran.dg/pr69455_1.f9014
-rw-r--r--gcc/testsuite/gfortran.dg/pr69455_2.f9013
-rw-r--r--gcc/testsuite/gfortran.dg/pr85543.f901
-rw-r--r--gcc/testsuite/gfortran.dg/pr89943_1.f9031
-rw-r--r--gcc/testsuite/gfortran.dg/pr89943_2.f9033
-rw-r--r--gcc/testsuite/gfortran.dg/pr89943_3.f9028
-rw-r--r--gcc/testsuite/gfortran.dg/pr89943_4.f9029
-rw-r--r--gcc/testsuite/gfortran.dg/pr91496.f9038
-rw-r--r--gcc/testsuite/gfortran.dg/pr91552.f9010
-rw-r--r--gcc/testsuite/gfortran.dg/pr91553.f908
-rw-r--r--gcc/testsuite/gfortran.dg/pr91564.f9016
-rw-r--r--gcc/testsuite/gfortran.dg/pr91565.f9017
-rw-r--r--gcc/testsuite/gfortran.dg/pr91566.f9014
-rw-r--r--gcc/testsuite/gfortran.dg/pr91568.f11
-rw-r--r--gcc/testsuite/gfortran.dg/pr91587.f9012
-rw-r--r--gcc/testsuite/gfortran.dg/pr91589.f9015
-rw-r--r--gcc/testsuite/gfortran.dg/pr91641.f907
-rw-r--r--gcc/testsuite/gfortran.dg/pr91642.f9019
-rw-r--r--gcc/testsuite/gfortran.dg/pr91649.f9023
-rw-r--r--gcc/testsuite/gfortran.dg/pr91660_1.f909
-rw-r--r--gcc/testsuite/gfortran.dg/pr91660_2.f909
-rw-r--r--gcc/testsuite/gfortran.dg/pr91714.f9010
-rw-r--r--gcc/testsuite/gfortran.dg/pr91715.f905
-rw-r--r--gcc/testsuite/gfortran.dg/pr91727.f909
-rw-r--r--gcc/testsuite/gfortran.dg/pr91785.f908
-rw-r--r--gcc/testsuite/gfortran.dg/pr91801.f907
-rw-r--r--gcc/testsuite/gfortran.dg/pr91802.f909
-rw-r--r--gcc/testsuite/gfortran.dg/pr91864.f9022
-rw-r--r--gcc/testsuite/gfortran.dg/pr91942.f9010
-rw-r--r--gcc/testsuite/gfortran.dg/pr92208.f9039
-rw-r--r--gcc/testsuite/gfortran.dg/pr92277.f9032
-rw-r--r--gcc/testsuite/gfortran.dg/typebound_call_22.f032
-rw-r--r--gcc/testsuite/gfortran.dg/warn_unused_dummy_argument_5.f9016
-rw-r--r--gcc/testsuite/obj-c++.dg/stubify-1.mm12
-rw-r--r--gcc/testsuite/obj-c++.dg/stubify-2.mm9
-rw-r--r--gcc/testsuite/objc.dg/stubify-1.m12
-rw-r--r--gcc/testsuite/objc.dg/stubify-2.m11
-rw-r--r--gcc/tree-cfg.c2
-rw-r--r--gcc/tree-cfgcleanup.c2
-rw-r--r--gcc/tree-dfa.c10
-rw-r--r--gcc/tree-dfa.h2
-rw-r--r--gcc/tree-object-size.c3
-rw-r--r--gcc/tree-pass.h2
-rw-r--r--gcc/tree-ssa-ccp.c8
-rw-r--r--gcc/tree-ssa-dse.c2
-rw-r--r--gcc/tree-ssa-forwprop.c2
-rw-r--r--gcc/tree-ssa-math-opts.c2
-rw-r--r--gcc/tree-ssa-phiprop.c11
-rw-r--r--gcc/tree-ssa-reassoc.c26
-rw-r--r--gcc/tree-ssa-sink.c5
-rw-r--r--gcc/tree-switch-conversion.c22
-rw-r--r--gcc/tree-vect-loop.c5
-rw-r--r--gcc/tree-vect-slp.c23
-rw-r--r--gcc/tree-vect-stmts.c6
-rw-r--r--gcc/tree-vectorizer.c2
-rw-r--r--gcc/tree-vectorizer.h19
-rw-r--r--gcc/tree-vrp.c17
-rw-r--r--gcc/tree.c82
-rw-r--r--gcc/tree.h12
370 files changed, 9946 insertions, 2389 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index bc3342a0bf6..d67cce795e0 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,1160 @@
+2019-11-20 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/90840
+ * expmed.c (store_bit_field_1): Handle the case where op0 is not a MEM
+ and has a mode that doesn't have corresponding integral type.
+
+ PR target/90867
+ * config/i386/i386.c (ix86_valid_target_attribute_tree): Don't
+ clear opts->x_ix86_isa_flags{,2} here...
+ (ix86_valid_target_attribute_inner_p): ... but here when seeing
+ arch=. Also clear opts->x_ix86_isa_flags{,2}_explicit.
+
+ PR c/90898
+ * tree-ssa-ccp.c (insert_clobber_before_stack_restore): Remove
+ assertion.
+ (insert_clobbers_for_var): Fix a typo in function comment.
+
+2019-11-19 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/91450
+ * internal-fn.c (expand_mul_overflow): For s1 * s2 -> ur, if one
+ operand is negative and one non-negative, compare the non-negative
+ one against 0 rather than comparing s1 & s2 against 0. Otherwise,
+ don't compare (s1 & s2) == 0, but compare separately both s1 == 0
+ and s2 == 0, unless one of them is known to be negative. Remove
+ tem2 variable, use tem where tem2 has been used before.
+
+2019-11-19 Eric Botcazou <ebotcazou@adacore.com>
+
+ * doc/invoke.texi (-gno-internal-reset-location-views): Fix typo.
+
+2019-11-18 Segher Boessenkool <segher@kernel.crashing.org>
+
+ Backport from trunk
+ 2019-11-12 Segher Boessenkool <segher@kernel.crashing.org>
+
+ * config/rs6000/rs6000.md (rs6000_set_fpscr_drn): Use ULL on big
+ hexadecimal literal.
+
+2019-11-15 Tamar Christina <tamar.christina@arm.com>
+
+ Backport from mainline
+ 2019-09-24 Stamatis Markianos-Wright <stam.markianos-wright@arm.com>
+
+ * config/aarch64/aarch64-option-extensions.def (fp16fml):
+ Update hwcap string for fp16fml.
+
+2019-11-15 Ilya Leoshkevich <iii@linux.ibm.com>
+
+ Backport from mainline
+ PR rtl-optimization/92430
+ * cfgcleanup.c (pass_jump_after_combine::gate): New function.
+ (pass_jump_after_combine::execute): Free
+ dominance info at the beginning.
+
+2019-11-13 Claudiu Zissulescu <claziss@gmail.com>
+
+ Backport from mainline
+ * config/arc/arc.md (movsi_ne): Reorder instruction variants and
+ use new register constraint letters.
+ * config/arc/arc.c (arc_legitimize_pic_address): Consider UNSPECs
+ as well, if interesting recover the symbol and re-legitimize the
+ pic address.
+
+2019-11-14 Martin Liska <mliska@suse.cz>
+
+ Backport from mainline
+ 2019-11-14 Martin Liska <mliska@suse.cz>
+
+ PR target/92389
+ * config/i386/i386.h: Add PTA_AVX512VPOPCNTDQ to
+ PTA_ICELAKE_CLIENT which is later interited by
+ PTA_ICELAKE_SERVER and PTA_TIGERLAKE.
+
+2019-11-13 Dragan Mladjenovic <dmladjenovic@wavecomp.com>
+
+ Backport from mainline
+ * config/mips/mips.md (rotr<mode>3): Sanitize the constant argument
+ instead of asserting its value.
+
+2019-11-11 Richard Biener <rguenther@suse.de>
+
+ Backport from mainline
+ 2019-06-25 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/90930
+ * tree-ssa-reassoc.c (reassociate_bb): Only rewrite expression
+ into parallel form in the last pass instance.
+
+2019-11-11 H.J. Lu <hjl.tools@gmail.com>
+
+ Backport from trunk:
+ PR target/87833
+ * config/i386/intelmic-mkoffload.c (prepare_target_image): Put
+ -fPIC and -shared the last to create offload image.
+
+2019-11-11 Thomas Schwinge <thomas@codesourcery.com>
+
+ Backport from trunk:
+ * gimplify.c (gimplify_scan_omp_clauses): Assert 'offset2' instead
+ of 'offset'.
+
+ Backport from trunk:
+ * Makefile.in (LANG_CONFIGUREFRAGS): Define.
+ (config.status): Use/depend on it.
+ * configure.ac (all_lang_configurefrags): Track, 'AC_SUBST'.
+ * configure: Regenerate.
+
+2019-11-09 John David Anglin <danglin@gcc.gnu.org>
+
+ Backport from mainline
+ 2019-11-07 John David Anglin <danglin@gcc.gnu.org>
+
+ * config/pa/pa.md (memory_barrier): Revise to use ldcw barriers.
+ Enhance comment.
+ (memory_barrier_coherent, memory_barrier_64, memory_barrier_32): New
+ insn patterns using ldcw instruction.
+ (memory_barrier): Remove insn pattern using sync instruction.
+ * config/pa/pa.opt (coherent-ldcw): New option.
+ (ordered): New option.
+
+2019-11-08 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/92384
+ * function.c (assign_parm_setup_block, assign_parm_setup_stack): Don't
+ copy TYPE_EMPTY_P arguments from data->entry_parm to data->stack_parm
+ slot.
+ (assign_parms): For TREE_ADDRESSABLE parms with TYPE_EMPTY_P type
+ force creation of a unique data.stack_parm slot.
+
+ Backported from mainline
+ 2019-10-31 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/92231
+ * tree.h (fndecl_built_in_p): Use fndecl_built_in_p instead of
+ DECL_BUILT_IN in comment. Remove redundant ()s around return
+ argument.
+ * tree.c (free_lang_data_in_decl): Check if var is FUNCTION_DECL
+ before calling fndecl_built_in_p.
+ * gimple-fold.c (gimple_fold_stmt_to_constant_1): Check if
+ TREE_OPERAND (fn, 0) is a FUNCTION_DECL before calling
+ fndecl_built_in_p on it.
+
+ PR c++/90947
+ * tree.h (type_initializer_zero_p): Remove.
+ * tree.c (type_initializer_zero_p): Remove.
+
+ 2019-10-29 Jakub Jelinek <jakub@redhat.com>
+
+ * doc/install.texi (--enable-offload-targets): Fix up a typo in the
+ example, use actual names of supported offload targets.
+
+2019-11-08 Eric Botcazou <ebotcazou@adacore.com>
+
+ PR target/92095
+ * config/sparc/sparc-protos.h (output_load_pcrel_sym): Declare.
+ * config/sparc/sparc.c (sparc_cannot_force_const_mem): Revert latest
+ change.
+ (got_helper_needed): New static variable.
+ (output_load_pcrel_sym): New function.
+ (get_pc_thunk_name): Remove after inlining...
+ (load_got_register): ...here. Rework the initialization of the GOT
+ register and of the GOT helper.
+ (save_local_or_in_reg_p): Test the REGNO of the GOT register.
+ (sparc_file_end): Test got_helper_needed to decide whether the GOT
+ helper must be emitted. Use output_asm_insn instead of fprintf.
+ (sparc_init_pic_reg): In PIC mode, always initialize the PIC register
+ if optimization is enabled.
+ * config/sparc/sparc.md (load_pcrel_sym<P:mode>): Emit the assembly
+ by calling output_load_pcrel_sym.
+
+2019-11-06 Ilya Leoshkevich <iii@linux.ibm.com>
+
+ Backport from mainline
+ * config/s390/s390.c (s390_canonicalize_comparison): Use XEXP
+ (*op0, 1) instead of XEXP (*op1, 0).
+
+2019-11-05 Segher Boessenkool <segher@kernel.crashing.org>
+
+ Backport from trunk
+ 2019-10-24 Segher Boessenkool <segher@kernel.crashing.org>
+
+ * config/rs6000/altivec.md (altivec_vavgu<VI_char>): Rename to...
+ (uavg<mode>3_ceil): ... This.
+ (altivec_vavgs<VI_char>): Rename to...
+ (avg<mode>3_ceil): ... This.
+ * config/rs6000/rs6000-builtin.def (VAVGUB, VAVGSB, VAVGUH, VAVGSH,
+ VAVGUW, VAVGSW): Adjust.
+
+2019-11-05 Segher Boessenkool <segher@kernel.crashing.org>
+
+ Backport from trunk
+ 2019-10-26 Segher Boessenkool <segher@kernel.crashing.org>
+
+ PR target/91289
+ * config/rs6000/rs6000.c (rs6000_emit_allocate_stack): Don't add an
+ immediate to r0; use r11 instead. Save and restore r11 to r0 around
+ this.
+
+2019-11-05 Andreas Krebbel <krebbel@linux.ibm.com>
+
+ Backport from mainline
+ 2019-11-05 Andreas Krebbel <krebbel@linux.ibm.com>
+
+ * config/s390/s390.c (s390_vector_alignment): Check if the value
+ fits into uhwi before using it.
+
+2019-11-01 John David Anglin <danglin@gcc.gnu.org>
+
+ Backport from mainline
+ 2019-10-03 John David Anglin <danglin@gcc.gnu.org>
+
+ * config/pa/pa.c (pa_output_call): Remove 64-bit sibcall sequence.
+ (pa_attr_length_call): Adjust length for 64-bit plabel sequence.
+
+2019-11-01 John David Anglin <danglin@gcc.gnu.org>
+
+ Backport from mainline
+ 2019-10-03 John David Anglin <danglin@gcc.gnu.org>
+
+ * config/pa/pa.h (MAX_PCREL17F_OFFSET): Adjust.
+
+2019-10-30 Iain Sandoe <iain@sandoe.co.uk>
+
+ Backport from mainline
+ 2019-10-13 Iain Sandoe <iain@sandoe.co.uk>
+
+ * config/darwin.c (machopic_indirection_name): Rework the
+ function to emit linker-visible symbols only for indirections
+ in the data section. Clean up the code and update comments.
+
+2019-10-30 Iain Sandoe <iain@sandoe.co.uk>
+
+ Backport from mainline
+ 2019-10-09 Iain Sandoe <iain@sandoe.co.uk>
+
+ * config/darwin.c (darwin_override_options): Make the check for
+ Objective-C ABI version more specific for 64bit code.
+
+ Backport from mainline
+ 2019-10-06 Iain Sandoe <iain@sandoe.co.uk>
+
+ * config/darwin.c (darwin_override_options): Adjust objective-c
+ ABI version error messages to avoid punctuation and contracted
+ negations.
+
+2019-10-30 Iain Sandoe <iain@sandoe.co.uk>
+
+ Backport from mainline
+ 2019-07-03 Iain Sandoe <iain@sandoe.co.uk>
+
+ * config/darwin.h (REAL_LIBGCC_SPEC): Adjust for earlier Darwin.
+ (STARTFILE_SPEC): Split crt3 into a separate spec.
+ (DARWIN_EXTRA_SPECS): Add crt2 and crt3 spec.
+ (DARWIN_CRT2_SPEC): New.
+ (DARWIN_CRT3_SPEC): New.
+ (MIN_LD64_OMIT_STUBS): Revise to 62.1.
+ * config/rs6000/darwin.h (DARWIN_CRT2_SPEC): Revise conditions.
+ (DARWIN_CRT3_SPEC): New.
+
+2019-10-30 Iain Sandoe <iain@sandoe.co.uk>
+
+ Backport from mainline
+ 2019-06-27 Iain Sandoe <iain@sandoe.co.uk>
+
+ * config/rs6000/darwin.h (ENDFILE_SPEC): Correct whitespace in the
+ spec.
+
+ Backport from mainline
+ 2019-06-25 Iain Sandoe <iain@sandoe.co.uk>
+
+ * config/rs6000/darwin.h (ENDFILE_SPEC): New.
+
+2019-10-30 Iain Sandoe <iain@sandoe.co.uk>
+
+ Backport from mainline
+ 2019-06-18 Iain Sandoe <iain@sandoe.co.uk>
+
+ * config/darwin.c (darwin_emit_unwind_label): New.
+ (darwin_override_options): Set darwin_emit_unwind_label as needed.
+
+2019-10-30 Iain Sandoe <iain@sandoe.co.uk>
+
+ Backport from mainline
+ 2019-08-13 Iain Sandoe <iain@sandoe.co.uk>
+
+ * config/darwin.c (machopic_indirect_call_target): Rename symbol stub
+ flag.
+ (darwin_override_options): Likewise.
+ * config/darwin.h: Likewise.
+ * config/darwin.opt: Likewise.
+ * config/i386/i386.c (output_pic_addr_const): Likewise.
+ * config/rs6000/darwin.h: Likewise.
+ * config/rs6000/rs6000.c (rs6000_call_darwin_1): Likewise.
+ * config/i386/darwin.h (TARGET_MACHO_PICSYM_STUBS): Rename to ...
+ ... this TARGET_MACHO_SYMBOL_STUBS.
+ (FUNCTION_PROFILER):Likewise.
+ * config/i386/i386.h: Likewise.
+
+ Backport from mainline
+ 2019-06-16 Iain Sandoe <iain@sandoe.co.uk>
+
+ * config/darwin.c (machopic_indirect_call_target): Use renamed
+ darwin_picsymbol_stubs to decide on output.
+ (darwin_override_options): Handle darwin_picsymbol_stubs.
+ * config/darwin.h (MIN_LD64_OMIT_STUBS): New.
+ (LD64_VERSION): Revise default.
+ * config/darwin.opt: (mpic-symbol-stubs): New option.
+ (darwin_picsymbol_stubs): New variable.
+ * config/i386/darwin.h (TARGET_MACHO_BRANCH_ISLANDS):
+ rename to TARGET_MACHO_PICSYM_STUBS.
+ * config/i386/i386.c (output_pic_addr_const): Likewise.
+ * config/i386/i386.h Likewise.
+ * config/rs6000/darwin.h: Likewise.
+ * config/rs6000/rs6000.c (rs6000_call_darwin_1): Use renamed
+ darwin_picsymbol_stubs.
+
+2019-10-30 Dragan Mladjenovic <dmladjenovic@wavecomp.com>
+
+ Backport from mainline
+ 2019-07-09 Dragan Mladjenovic <dmladjenovic@wavecomp.com>
+
+ * cfgcleanup.c (old_insns_match_p): Check if used hard regs set is equal
+ for both call instructions.
+
+2019-10-30 Thomas Schwinge <thomas@codesourcery.com>
+
+ Backport from trunk:
+
+ 2019-05-06 Richard Biener <rguenther@suse.de>
+
+ * dwarf2out.c (mem_loc_descriptor): Initialize int_mode.
+
+2019-10-28 Uroš Bizjak <ubizjak@gmail.com>
+
+ PR target/92225
+ * config/i386/sse.md (REDUC_SSE_SMINMAX_MODE): Use TARGET_SSE4_2
+ condition for V2DImode.
+
+2019-10-28 Ilya Leoshkevich <iii@linux.ibm.com>
+
+ Backport from mainline
+ PR rtl-optimization/92007
+ * cfgcleanup.c (thread_jump): Add an assertion that we don't
+ call it after reload if hot/cold partitioning has been done.
+ (class pass_postreload_jump): Rename to
+ pass_jump_after_combine.
+ (make_pass_postreload_jump): Rename to
+ make_pass_jump_after_combine.
+ * passes.def(pass_postreload_jump): Move before reload, rename
+ to pass_jump_after_combine.
+ * tree-pass.h (make_pass_postreload_jump): Rename to
+ make_pass_jump_after_combine.
+
+2019-10-28 Peter Bergner <bergner@linux.ibm.com>
+ Jiufu Guo <guojiufu@linux.ibm.com>
+
+ PR target/70010
+ * config/rs6000/rs6000.c (rs6000_can_inline_p): Prohibit inlining if
+ the callee explicitly disables some isa_flags the caller is using.
+
+2019-10-27 Iain Sandoe <iain@sandoe.co.uk>
+
+ Backport from mainline
+ 2019-10-17 Iain Sandoe <iain@sandoe.co.uk>
+
+ PR target/65342
+ * config/rs6000/darwin.md (movdi_low, movsi_low_st): Delete.
+ (movdi_low_st): Delete.
+ * config/rs6000/rs6000.c
+ (darwin_rs6000_legitimate_lo_sum_const_p): New.
+ (mem_operand_gpr): Validate Mach-O LO_SUM cases separately.
+ * config/rs6000/rs6000.md (movsi_low): Delete.
+
+2019-10-27 Iain Sandoe <iain@sandoe.co.uk>
+
+ Backport from mainline
+ 2019-10-12 Iain Sandoe <iain@sandoe.co.uk>
+
+ PR target/67183
+ * config/darwin.c (machopic_indirection): New field to flag
+ non-lazy-symbol-pointers in the data section.
+ (machopic_indirection_name): Compute if an indirection should
+ appear in the data section.
+ (machopic_output_data_section_indirection): New callback split
+ from machopic_output_indirection.
+ (machopic_output_stub_indirection): Likewise.
+ (machopic_output_indirection): Retain the code for non-lazy
+ symbol pointers in their regular section.
+ (machopic_finish): Use the new callbacks to order the indirection
+ output.
+
+2019-10-27 Iain Sandoe <iain@sandoe.co.uk>
+
+ Backport from mainline
+ 2019-10-12 Iain Sandoe <iain@sandoe.co.uk>
+
+ * config/darwin-protos.h (machopic_finish): Delete.
+ * config/darwin.c (machopic_finish): Make static.
+
+ Backport from mainline
+ 2019-10-09 Iain Sandoe <iain@sandoe.co.uk>
+
+ * config/darwin.c (machopic_indirect_data_reference): Set flag to
+ indicate that the new symbol is an indirection.
+ (machopic_indirect_call_target): Likewise.
+ * config/darwin.h (MACHO_SYMBOL_FLAG_INDIRECTION): New.
+ (MACHO_SYMBOL_INDIRECTION_P): New.
+ (MACHO_SYMBOL_FLAG_STATIC): Adjust bit number.
+
+ Backport from mainline
+ 2019-10-08 Iain Sandoe <iain@sandoe.co.uk>
+
+ * config/darwin.c (machopic_indirect_data_reference): Check for
+ required indirections before making direct access to defined
+ values.
+ (machopic_output_indirection): Place the indirected pointes for
+ required indirections into the non-lazy symbol pointers section.
+ (darwin_encode_section_info):
+ * config/darwin.h (MACHO_SYMBOL_FLAG_MUST_INDIRECT): New.
+ (MACHO_SYMBOL_MUST_INDIRECT_P): New.
+
+ Backport from mainline
+ 2019-10-07 Iain Sandoe <iain@sandoe.co.uk>
+
+ * config/darwin.c (machopic_output_indirection): Don't put
+ hidden symbol indirections into the .data section, use the
+ non-lazy symbol pointers section as normal.
+ (darwin_encode_section_info): Record if a symbol is hidden.
+ * config/darwin.h (MACHO_SYMBOL_FLAG_HIDDEN_VIS): New.
+ (MACHO_SYMBOL_HIDDEN_VIS_P): New.
+
+ Backport from mainline
+ 2019-10-07 Iain Sandoe <iain@sandoe.co.uk>
+
+ * config/darwin.c (machopic_symbol_defined_p): Use symbol flag
+ predicates instead of accessing bits directly.
+ (machopic_indirect_call_target): Likewise.
+ (machopic_output_indirection): Likewise.
+ (darwin_encode_section_info): Improve description. Use renamed
+ symbol flags. Use predicate macros for variables and functions.
+ * config/darwin.h:
+ Rename MACHO_SYMBOL_VARIABLE to MACHO_SYMBOL_FLAG_VARIABLE.
+ Rename MACHO_SYMBOL_DEFINED to MACHO_SYMBOL_FLAG_DEFINED.
+ Rename MACHO_SYMBOL_STATIC to MACHO_SYMBOL_FLAG_STATIC.
+ (MACHO_SYMBOL_VARIABLE_P): New.
+ (MACHO_SYMBOL_DEFINED_P):New.
+ (MACHO_SYMBOL_STATIC_P): New.
+ * config/i386/darwin.h (MACHO_SYMBOL_FLAG_VARIABLE): Delete.
+ (SYMBOL_FLAG_SUBT_DEP): New.
+ * config/rs6000/darwin.h (SYMBOL_FLAG_SUBT_DEP): New.
+
+2019-10-25 Jan Hubicka <hubicka@ucw.cz>
+
+ Backport from mainline
+ 2019-10-11 Jan Hubicka <hubicka@ucw.cz>
+ * gimple-streamer-out.c (output_gimple_stmt): Add explicit function
+ parameter.
+ * lto-streamer-out.c: Include tree-dfa.h.
+ (output_cfg): Do not use cfun.
+ (lto_prepare_function_for_streaming): New.
+ (output_function): Do not push cfun; do not initialize loop optimizer.
+ * lto-streamer.h (lto_prepare_function_for_streaming): Declare.
+ * passes.c (ipa_write_summaries): Use it.
+ (ipa_write_optimization_summaries): Do not modify bodies.
+ * tree-dfa.c (renumber_gimple_stmt_uids): Add function parameter.
+ * tree.dfa.h (renumber_gimple_stmt_uids): Update prototype.
+ * tree-ssa-dse.c (pass_dse::execute): Update use of
+ renumber_gimple_stmt_uids.
+ * tree-ssa-math-opts.c (pass_optimize_widening_mul::execute): Likewise.
+
+ 2019-10-12 Jan Hubicka <hubicka@ucw.cz>
+ * lto-streamer-out.c (collect_block_tree_leafs): Renumber statements
+ so non-virutal are before virutals.
+ (output_function): Avoid body modifications.
+
+2019-10-25 Richard Earnshaw <rearnsha@arm.com>
+
+ Backport from mainline
+ 2019-05-08 Mihail Ionescu <mihail.ionescu@arm.com>
+ Richard Earnshaw <rearnsha@arm.com>
+ PR target/88167
+ * config/arm/arm.c (thumb1_prologue_unused_call_clobbered_lo_regs): New
+ function.
+ (thumb1_epilogue_unused_call_clobbered_lo_regs): New function.
+ (thumb1_compute_save_core_reg_mask): Don't force a spare work
+ register if both the epilogue and prologue can use call-clobbered
+ regs.
+ (thumb1_unexpanded_epilogue): Use
+ thumb1_epilogue_unused_call_clobbered_lo_regs. Reverse the logic for
+ picking temporaries for restoring high regs to match that of the
+ prologue where possible.
+ (thumb1_expand_prologue): Add any usable call-clobbered low registers to
+ the list of work registers. Detect if the return address is still live
+ at the end of the prologue and avoid using it for a work register if so.
+ If the return address is not live, add LR to the list of pushable regs
+ after the first pass.
+
+2019-10-25 Jan Hubicka <hubicka@ucw.cz>
+
+ Backport from mainline
+ 2019-10-24 Jan Hubicka <hubicka@ucw.cz>
+ * symbols-summary.h (fast_function_summary<T *, V>::release,
+ fast_call_summary<T *, V>::release): Free m_vector.
+
+2019-10-25 Jan Hubicka <hubicka@ucw.cz>
+
+ Backport from mainline
+
+ 2019-10-18 Jakub Jelinek <jakub@redhat.com>
+ PR middle-end/92153
+ * ggc-page.c (release_pages): Read g->alloc_size before free rather
+ than after it.
+
+ 2019-10-11 Jan Hubicka <hubicka@ucw.cz>
+ * ggc-page.c (release_pages): Output statistics when !quiet_flag.
+ (ggc_collect): Dump later to not interfere with release_page dump.
+ (ggc_trim): New function.
+ * ggc-none.c (ggc_trim): New.
+ * ggc.h (ggc_trim): Declare.
+
+2019-10-24 Mihail Ionescu <mihail.ionescu@arm.com>
+
+ Backport from mainline
+ 2019-10-18 Andre Vieira <andre.simoesdiasvieira@arm.com>
+
+ * config/arm/t-multilib: Add new multilib variants and new
+ mappings.
+
+2019-10-24 Iain Sandoe <iain@sandoe.co.uk>
+
+ Backport from mainline
+ 2019-10-23 Iain Sandoe <iain@sandoe.co.uk>
+ * config/rs6000/darwin.h (ASM_OUTPUT_MAX_SKIP_ALIGN): Guard
+ against out of range max skip or log values.
+
+2019-10-23 Peter Bergner <bergner@linux.ibm.com>
+
+ Backport from mainline
+ 2019-10-08 Tulio Magno Quites Machado Filho <tuliom@linux.ibm.com>
+
+ * config.gcc: Move -L usage from LINK_OS_EXTRA_SPEC32 and
+ LINK_OS_EXTRA_SPEC64 to MD_STARTFILE_PREFIX and
+ MD_STARTFILE_PREFIX_1 when using --with-advance-toolchain.
+
+2019-10-23 Martin Liska <mliska@suse.cz>
+
+ Backport from mainline
+ 2019-09-26 Martin Liska <mliska@suse.cz>
+
+ PR tree-optimization/91885
+ * tree-vectorizer.c (try_vectorize_loop_1):
+ Add TODO_update_ssa_only_virtuals similarly to what slp
+ pass does.
+
+2019-10-23 Eric Botcazou <ebotcazou@adacore.com>
+
+ PR tree-optimization/92131
+ * tree-vrp.c (extract_range_from_plus_minus_expr): If the resulting
+ range would be symbolic, drop to varying for any explicit overflow
+ in the constant part or if neither range is a singleton.
+
+2019-10-23 Richard Biener <rguenther@suse.de>
+
+ Backport from mainline
+ 2019-10-17 Richard Biener <rguenther@suse.de>
+
+ PR debug/91887
+ * dwarf2out.c (gen_formal_parameter_die): Also try to match
+ context_die against a DW_TAG_GNU_formal_parameter_pack parent.
+
+2019-10-21 Jakub Jelinek <jakub@redhat.com>
+
+ Backported from mainline
+ 2019-10-17 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/92056
+ * tree-object-size.c (cond_expr_object_size): Return early if then_
+ processing resulted in unknown size.
+
+ 2019-10-05 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/91734
+ * generic-match-head.c: Include fold-const-call.h.
+ * match.pd (sqrt(x) cmp c): Check the boundary value and
+ in case inexact computation of c*c affects comparison of the boundary,
+ turn LT_EXPR into LE_EXPR, GE_EXPR into GT_EXPR, LE_EXPR into LT_EXPR
+ or GT_EXPR into GE_EXPR. Punt for sqrt comparisons against NaN and
+ for -frounding-math. For c2, try the next smaller or larger floating
+ point constant depending on comparison code and if it has the same
+ sqrt as c2, use it instead of c2.
+
+ 2019-09-29 Jakub Jelinek <jakub@redhat.com>
+
+ PR bootstrap/90543
+ * optc-save-gen.awk: Fix up printing string option differences.
+
+ 2019-09-27 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/91920
+ * gimplify.c (omp_default_clause): Predetermine DECL_IN_CONSTANT_POOL
+ variables as shared.
+
+ 2019-09-11 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/91723
+ * tree-vect-stmts.c (vectorizable_call): Use types_compatible_p check
+ instead of pointer equality when checking if argument vectypes are
+ the same.
+
+ 2019-09-07 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/91665
+ * tree-vect-loop.c (vectorizable_reduction): Punt if base has type
+ incompatible with the type of PHI result.
+
+ 2019-09-06 Jakub Jelinek <jakub@redhat.com>
+
+ * function.c (assign_parm_find_data_types): Use RECORD_OR_UNION_TYPE_P
+ before testing TYPE_TRANSPARENT_AGGR.
+ * calls.c (initialize_argument_information, load_register_parameters):
+ Likewise.
+
+ 2019-09-05 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/91001
+ PR middle-end/91105
+ PR middle-end/91106
+ * calls.c (load_register_parameters): For TYPE_TRANSPARENT_AGGR
+ types, use type of their first field instead of type of
+ args[i].tree_value.
+
+ 2019-09-02 Jakub Jelinek <jakub@redhat.com>
+
+ PR go/91617
+ * fold-const.c (range_check_type): For enumeral and boolean
+ type, pass 1 to type_for_size langhook instead of
+ TYPE_UNSIGNED (etype). Return unsigned_type_for result whenever
+ etype isn't TYPE_UNSIGNED INTEGER_TYPE.
+ (build_range_check): Don't call unsigned_type_for for pointer types.
+ * match.pd (X / C1 op C2): Don't call unsigned_type_for on
+ range_check_type result.
+
+ 2019-09-01 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/91623
+ * optabs.c (expand_vec_cond_expr): If op0 is a VECTOR_CST and only
+ EQ_EXPR/NE_EXPR is supported, verify that op0 only contains
+ zeros or negative elements and use NE_EXPR instead of LT_EXPR against
+ zero vector.
+
+ PR lto/91572
+ * tree.c (find_decls_types_in_node): Also walk TREE_PURPOSE of
+ GIMPLE_ASM TREE_LIST operands.
+
+ 2019-08-29 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/91351
+ * tree-cfg.c (generate_range_test): Use range_check_type instead of
+ unsigned_type_for.
+ * tree-cfgcleanup.c (convert_single_case_switch): Punt if
+ range_check_type returns NULL.
+ * tree-switch-conversion.c (switch_conversion::build_one_array):
+ Use range_check_type instead of unsigned_type_for, don't perform
+ linear opt if it returns NULL.
+ (bit_test_cluster::find_bit_tests): Formatting fix.
+ (bit_test_cluster::emit): Use range_check_type instead of
+ unsigned_type_for.
+ (switch_decision_tree::try_switch_expansion): Punt if range_check_type
+ returns NULL.
+
+2019-10-18 Georg-Johann Lay <avr@gjlay.de>
+
+ Backport from 2019-10-18 trunk r277143.
+
+ PR target/86040
+ * config/avr/avr.c (avr_out_lpm): Do not shortcut-return.
+
+2019-10-18 Iain Sandoe <iain@sandoe.co.uk>
+
+ Backport from mainline
+ 2019-10-05 Iain Sandoe <iain@sandoe.co.uk>
+
+ PR target/59888
+ * config/darwin.c (darwin_rodata_section): Add relocation flag,
+ choose const_data section for constants with relocations.
+ (machopic_select_section): Pass relocation flag to
+ darwin_rodata_section ().
+
+2019-10-18 Iain Sandoe <iain@sandoe.co.uk>
+
+ Backport from mainline
+ 2019-09-21 Iain Sandoe <iain@sandoe.co.uk>
+
+ * config/darwin.c (machopic_legitimize_pic_address): Check
+ for lra, rather than reload.
+
+2019-10-17 John David Anglin <danglin@gcc.gnu.org>
+
+ * config/pa/pa.c (pa_output_indirect_call): Fix typos in last change.
+
+2019-10-17 Richard Earnshaw <rearnsha@arm.com>
+
+ Backport from mainline
+ 2019-05-03 Richard Earnshaw <rearnsha@arm.com>
+
+ PR target/89400
+ * config/arm/arm.md (unaligned_loadsi): Add variant for thumb1.
+ Restrict 'all' variant to 32-bit configurations.
+ (unaligned_loadhiu): Likewise.
+ (unaligned_storehi): Likewise.
+ (unaligned_storesi): Likewise.
+ (unaligned_loadhis): Disable when compiling for thumb1.
+
+2019-10-16 Iain Sandoe <iain@sandoe.co.uk>
+
+ Backport from mainline
+ 2019-10-03 Iain Sandoe <iain@sandoe.co.uk>
+
+ PR target/87243
+ * config/darwin-driver.c (maybe_get_sysroot_from_sdkroot): New.
+ (darwin_driver_init): Use the sysroot provided by SDKROOT when that
+ is available and the user has not set one on the command line.
+
+2019-10-16 Iain Sandoe <iain@sandoe.co.uk>
+
+ Backport from mainline
+ 2019-07-03 Iain Sandoe <iain@sandoe.co.uk>
+
+ * config/darwin.h (DRIVER_SELF_SPECS): Remove the linker cases.
+ (RDYNAMIC): Rename to, DARWIN_RDYNAMIC.
+ (DARWIN_PIE_SPEC, DARWIN_NOPIE_SPEC): Adjust to remove the Xlinker
+ clauses.
+ (LINK_COMMAND_SPEC_A): Add DARWIN_RDYNAMIC, DARWIN_PIE_SPEC and
+ DARWIN_NOPIE_SPEC.
+
+ Backport from mainline
+ 2019-06-19 Iain Sandoe <iain@sandoe.co.uk>
+
+ * config/darwin.h (DRIVER_SELF_SPECS): Add RDYNAMIC, DARWIN_PIE_SPEC
+ and DARWIN_NOPIE_SPEC.
+ (RDYNAMIC): New, modified from DARWIN_EXPORT_DYNAMIC.
+ (DARWIN_PIE_SPEC): Collate from darwin.h and darwin9.h.
+ (DARWIN_NOPIE_SPEC): Collate from darwin10.h.
+ (DARWIN_NOCOMPACT_UNWIND): New from darwin10.h
+ (DARWIN_EXPORT_DYNAMIC): Delete.
+ * config/darwin10.h (LINK_GCC_C_SEQUENCE_SPEC): Move no_compact_unwind
+ and pie options processing to darwin.h.
+ * config/darwin9.h (DARWIN_PIE_SPEC): Move pie processing to darwin.h
+
+2019-10-16 Richard Biener <rguenther@suse.de>
+
+ Backport from mainline
+ 2019-10-04 Richard Biener <rguenther@suse.de>
+
+ PR lto/91968
+ * tree.c (find_decls_types_r): Do not remove LABEL_DECLs from
+ BLOCK_VARS.
+
+ 2019-09-19 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/91812
+ * tree-ssa-phiprop.c (propagate_with_phi): Do not replace
+ volatile loads.
+
+ 2019-09-17 Richard Biener <rguenther@suse.de>
+
+ PR debug/91772
+ * dwarf2out.c (dwarf2out_late_global_decl): If early dwarf
+ was missing generate locations only once.
+
+ 2019-09-17 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/91790
+ * tree-vect-stmts.c (vectorizable_load): For BB vectorization
+ use the correct DR for setting up realignment.
+
+2019-10-14 Will Schmidt <will_schmidt@vnet.ibm.com>
+
+ Backport from trunk
+ 2019-09-26 Will Schmidt <will_schmidt@vnet.ibm.com>
+
+ * config/rs6000/rs6000-builtin.def: (LVSL, LVSR, LVEBX, LVEHX,
+ LVEWX, LVXL, LVXL_V2DF, LVXL_V2DI, LVXL_V4SF, LVXL_V4SI, LVXL_V8HI,
+ LVXL_V16QI, LVX, LVX_V1TI, LVX_V2DF, LVX_V2DI, LVX_V4SF, LVX_V4SI,
+ LVX_V8HI, LVX_V16QI, LVLX, LVLXL, LVRX, LVRXL, LXSDX, LXVD2X_V1TI,
+ LXVD2X_V2DF, LXVD2X_V2DI, LXVDSX, LXVW4X_V4SF, LXVW4X_V4SI,
+ LXVW4X_V8HI, LXVW4X_V16QI, LD_ELEMREV_V1TI, LD_ELEMREV_V2DF,
+ LD_ELEMREV_V2DI, LD_ELEMREV_V4SF, LD_ELEMREV_V4SI, LD_ELEMREV_V8HI,
+ LD_ELEMREV_V16QI): Use the PURE attribute.
+
+2019-10-10 Uroš Bizjak <ubizjak@gmail.com>
+
+ PR target/92022
+ * config/alpha/alpha.c (alpha_handle_trap_shadows): Skip DEBUG_INSN.
+
+2019-10-10 Oleg Endo <olegendo@gcc.gnu.org>
+
+ Backport from mainline
+ 2019-10-10 Oleg Endo <olegendo@gcc.gnu.org>
+
+ PR target/88630
+ * config/sh/sh.h (TARGET_FPU_SH4_300): New macro.
+ * config/sh/sh.c (sh_option_override): Enable fsca and fsrra insns
+ also for TARGET_FPU_SH4_300.
+ (sh_emit_mode_set): Check for TARGET_FPU_SH4_300 instead of
+ TARGET_SH4_300.
+ * config/sh/sh.md (toggle_pr): Add TARGET_FPU_SH4_300 condition.
+ (negsf2): Expand to either negsf2_fpscr or negsf2_no_fpscr.
+ (*negsf2_i): Split into ...
+ (negsf2_fpscr, negsf2_no_fpscr): ... these new patterns.
+ (abssf2): Expand to either abssf2_fpsc or abssf2_no_fpsc.
+ (**abssf2_i): Split into ...
+ (abssf2_fpscr, abssf2_no_fpscr): ... these new patterns.
+ (negdf2): Expand to either negdf2_fpscr or negdf2_no_fpscr.
+ (*negdf2_i): Split into ...
+ (negdf2_fpscr, negdf2_no_fpscr): ... these new patterns.
+ (absdf2): Expand to either absdf2_fpscr or absdf2_no_fpsc.
+ (**abssf2_i): Split into ...
+ (absdf2_fpscr, absdf2_no_fpscr): ... these new patterns.
+
+2019-10-10 Andreas Krebbel <krebbel@linux.ibm.com>
+
+ Backport from mainline
+ 2019-10-10 Andreas Krebbel <krebbel@linux.ibm.com>
+
+ * common/config/s390/s390-common.c (PF_ARCH13): Rename to...
+ (PF_Z15): ... this.
+ * config.gcc: Add z15 as option for --with-arch and --with-tune
+ configure switches.
+ * config/s390/s390-c.c (s390_resolve_overloaded_builtin): Add
+ error reporting for unsupported builtins.
+ * config/s390/s390-opts.h (enum processor_type): Rename
+ PROCESSOR_8561_ARCH13 to PROCESSOR_8561_Z15.
+ * config/s390/8561.md: Rename arch13 to z15 throughout the file.
+ * config/s390/driver-native.c (s390_host_detect_local_cpu):
+ Likewise.
+ * config/s390/s390-builtins.def: Likewise.
+ * config/s390/s390.c (processor_table): Add z15 as option and keep arch13 as alternative.
+ (s390_expand_builtin): Add missing check for unsupported builtins.
+ (s390_canonicalize_comparison): Rename TARGET_ARCH13 to TARGET_Z15.
+ (s390_rtx_costs): Likewise.
+ (s390_get_sched_attrmask): Rename arch13 to z15.
+ (s390_get_unit_mask): Likewise.
+ (s390_is_fpd): Likewise.
+ (s390_is_fxd): Likewise.
+ * config/s390/s390.h (enum processor_flags): Likewise.
+ * config/s390/s390.md: Likewise.
+ * config/s390/vector.md: Likewise.
+ * config/s390/vx-builtins.md: Likewise.
+ * config/s390/s390.opt: Add z15 to processor_type value.
+
+2019-10-07 Bill Schmidt <wschmidt@linux.ibm.com>
+
+ Backport from mainline
+ 2019-10-01 Bill Schmidt <wschmidt@linux.ibm.com>
+
+ PR target/91275
+ * config/rs6000/rs6000-p8swap.c (rtx_is_swappable_p): Don't swap
+ vpmsumd.
+
+2019-10-05 Andrea Corallo <andrea.corallo@arm.com>
+
+ Backport from mainline
+ 2019-10-03 Andrea Corallo <andrea.corallo@arm.com>
+ * gcc/ipa-cp.c (ipa_cp_c_finalize): Release ipcp_transformation_sum
+ when finished.
+ * ipa-prop.c (ipcp_free_transformation_sum): New function.
+ * ipa-prop.h (ipcp_free_transformation_sum): Add declaration.
+
+2019-10-04 Dragan Mladjenovic <dmladjenovic@wavecomp.com>
+
+ Backport from mainline
+ 2019-10-03 Dragan Mladjenovic <dmladjenovic@wavecomp.com>
+
+ PR target/91769
+ * config/mips/mips.c (mips_split_move): Use reg_overlap_mentioned_p
+ instead of REGNO equality check on addr.reg.
+
+2019-10-04 Dragan Mladjenovic <dmladjenovic@wavecomp.com>
+
+ Backport from mainline
+ 2019-07-07 Richard Sandiford <richard.sandiford@arm.com>
+
+ * config/mips/mips.c (mips_split_move): Zero-initialize addr
+ and check whether addr.reg is nonnull before using it.
+
+2019-10-02 Bernd Edlinger <bernd.edlinger@hotmail.de>
+
+ Backport from mainline
+
+ 2019-09-13 Bernd Edlinger <bernd.edlinger@hotmail.de>
+
+ PR fortran/91716
+ * trans-array.c (gfc_conv_array_initializer): Always assign the
+ array type of the field to the string constant.
+
+2019-10-01 Oleg Endo <olegendo@gcc.gnu.org>
+
+ Backport from mainline
+
+ 2019-10-01 Oleg Endo <olegendo@gcc.gnu.org>
+
+ PR target/88562
+ * config/sh/sh.c (sh_extending_set_of_reg::use_as_extended_reg): Use
+ sh_check_add_incdec_notes to preserve REG_INC notes when replacing
+ a memory access insn.
+
+
+2019-10-01 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
+
+ Backport from mainline
+ 2019-09-24 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
+
+ * config/aarch64/aarch64.md (mov<mode>): Don't call
+ aarch64_split_dimode_const_store on volatile MEM.
+
+2019-10-01 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
+
+ Backport from mainline
+ 2019-09-26 Matt Turner <mattst88@gmail.com>
+
+ PR driver/69471
+ * config/aarch64/aarch64.opt (march=): Add Negative(march=).
+ (mtune=): Add Negative(mtune=).
+ (mcpu=): Add Negative(mcpu=).
+ * config/arm/arm.opt: Likewise.
+
+2019-09-28 Oleg Endo <olegendo@gcc.gnu.org>
+
+ Backport from mainline
+ 2019-09-28 Oleg Endo <olegendo@gcc.gnu.org>
+
+ PR target/86805
+ * config/sh/sh.c (TARGET_HAVE_SPECULATION_SAFE_VALUE): Define.
+
+2019-09-28 Oleg Endo <olegendo@gcc.gnu.org>
+
+ Backport from mainline
+ 2019-09-28 Oleg Endo <olegendo@gcc.gnu.org>
+
+ PR target/80672
+ * config/sh/sh.c (parse_validate_atomic_model_option): Use
+ std::string::compare instead of std::string::find.
+
+2019-09-25 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
+
+ Backport from mainline
+ 2019-08-22 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
+
+ * config/arm/arm_acle.h: Use arch=armv8-a+crc+simd pragma for CRC32
+ intrinsics if __ARM_FP.
+ Use __ARM_FEATURE_CRC32 ifdef guard.
+
+2019-09-23 Max Filippov <jcmvbkbc@gmail.com>
+
+ Backport from mainline
+ 2019-06-18 Max Filippov <jcmvbkbc@gmail.com>
+
+ * config/xtensa/xtensa.c (xtensa_expand_prologue): Add stack
+ pointer adjustment for the case of no callee-saved registers and
+ stack frame bigger than 128 bytes.
+
+2019-09-22 Iain Sandoe <iain@sandoe.co.uk>
+
+ Backport from mainline
+ 2019-06-16 Iain Sandoe <iain@sandoe.co.uk>
+
+ * config/darwin.opt (prebind, noprebind, seglinkedit,
+ noseglinkedit): Add RejectNegative.
+
+ Backport from mainline
+ 2019-06-14 Iain Sandoe <iain@sandoe.co.uk>
+
+ * config/darwin.opt: Add RejectNegative where needed, reorder
+ and add minimal functional descriptions.
+
+2019-09-20 John David Anglin <danglin@gcc.gnu.org>
+
+ * config/pa/pa.c (pa_trampoline_init): Remove spurious extended
+ character.
+
+2019-09-20 Andreas Krebbel <krebbel@linux.ibm.com>
+
+ Backport from mainline
+ 2019-06-06 Andreas Krebbel <krebbel@linux.ibm.com>
+
+ PR rtl-optimization/88751
+ * ira.c (ira): Use the number of the actually referenced registers
+ when calculating the threshold.
+
+2019-09-20 Kito Cheng <kito.cheng@sifive.com>
+
+ Backport from mainline
+ 2019-09-18 Jim Wilson <jimw@sifive.com>
+
+ PR target/91683
+ * config/riscv/riscv-protos.h (riscv_split_symbol): New bool parameter.
+ (riscv_move_integer): Likewise.
+ * config/riscv/riscv.c (riscv_split_integer): Pass FALSE for new
+ riscv_move_integer arg.
+ (riscv_legitimize_move): Likewise.
+ (riscv_force_temporary): New parameter in_splitter. Don't call
+ force_reg if true.
+ (riscv_unspec_offset_high): Pass FALSE for new riscv_force_temporary
+ arg.
+ (riscv_add_offset): Likewise.
+ (riscv_split_symbol): New parameter in_splitter. Pass to
+ riscv_force_temporary.
+ (riscv_legitimize_address): Pass FALSE for new riscv_split_symbol
+ arg.
+ (riscv_move_integer): New parameter in_splitter. New local
+ can_create_psuedo. Don't call riscv_split_integer or force_reg when
+ in_splitter TRUE.
+ (riscv_legitimize_const_move): Pass FALSE for new riscv_move_integer,
+ riscv_split_symbol, and riscv_force_temporary args.
+ * config/riscv/riscv.md (low<mode>+1): Pass TRUE for new
+ riscv_move_integer arg.
+ (low<mode>+2): Pass TRUE for new riscv_split_symbol arg.
+
+2019-09-20 Eric Botcazou <ebotcazou@adacore.com>
+
+ PR target/91269
+ * config/sparc/sparc.h (HARD_REGNO_CALLER_SAVE_MODE): Define.
+
+2019-09-19 Kito Cheng <kito.cheng@sifive.com>
+
+ Backport from mainline
+ 2019-09-05 Jakub Jelinek <jakub@redhat.com>
+ Jim Wilson <jimw@sifive.com>
+
+ PR target/91635
+ * config/riscv/riscv.md (zero_extendsidi2, zero_extendhi<GPR:mode>2,
+ extend<SHORT:mode><SUPERQI:mode>2): Don't split if
+ paradoxical_subreg_p (operands[0]).
+ (*lshrsi3_zero_extend_3+1, *lshrsi3_zero_extend_3+2): Add clobber and
+ use as intermediate value.
+
+2019-09-11 Eric Botcazou <ebotcazou@adacore.com>
+
+ PR rtl-optimization/89795
+ * rtlanal.c (nonzero_bits1) <SUBREG>: Do not propagate results from
+ inner REGs to paradoxical SUBREGs if WORD_REGISTER_OPERATIONS is set.
+
+2019-09-09 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/87853
+ * config/i386/emmintrin.h (_mm_cmpeq_epi8): Use casts to __v16qi
+ instead of __v16qs.
+
+ PR target/91704
+ * config/i386/avxintrin.h (__v32qs): New typedef.
+ * config/i386/avx2intrin.h (_mm256_cmpgt_epi8): Use casts to __v32qs
+ instead of __v32qi.
+
+2019-09-04 Wilco Dijkstra <wdijkstr@arm.com>
+
+ Backport from mainline
+ 2019-08-13 Wilco Dijkstra <wdijkstr@arm.com>
+
+ PR target/81800
+ * gcc/config/aarch64/aarch64.md (lrint): Disable lrint pattern if GPF
+ operand is larger than a long int.
+
+2019-09-03 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/91597
+ * tree-vrp.c (extract_range_from_binary_expr): Remove unsafe
+ BIT_AND_EXPR optimization for pointers, even if both operand
+ ranges don't include NULL, the result can be NULL.
+
+2019-09-02 Martin Liska <mliska@suse.cz>
+
+ Backport from mainline
+ 2019-09-02 Martin Liska <mliska@suse.cz>
+
+ PR gcov-profile/91601
+ * gcov.c (path_contains_zero_cycle_arc): Rename to ...
+ (path_contains_zero_or_negative_cycle_arc): ... this and handle
+ also negative edges.
+ (circuit): Handle also negative edges as they can happen
+ in some situations.
+
+2019-09-01 Eric Botcazou <ebotcazou@adacore.com>
+
+ PR target/91472
+ * config/sparc/sparc.c (sparc_cannot_force_const_mem): Return true
+ during LRA/reload in PIC mode if the PIC register hasn't been used yet.
+ (sparc_pic_register_p): Test reload_in_progress for consistency's sake.
+
+2019-08-31 Iain Sandoe <iain@sandoe.co.uk>
+
+ Backport from mainline
+ 2019-08-23 Iain Sandoe <iain@sandoe.co.uk>
+
+ PR pch/61250
+ * ggc-page.c (ggc_pch_read): Read the ggc_pch_ondisk structure
+ and issue any diagnostics needed before collecting the pre-PCH
+ state.
+
+2019-08-30 Segher Boessenkool <segher@kernel.crashing.org>
+
+ Backport from trunk
+ 2019-08-22 Segher Boessenkool <segher@kernel.crashing.org>
+
+ PR target/91481
+ * config/rs6000/rs6000.md (unspec): Delete UNSPEC_DARN, UNSPEC_DARN_32,
+ and UNSPEC_DARN_RAW.
+ (unspecv): New enumerator values UNSPECV_DARN, UNSPECV_DARN_32, and
+ UNSPECV_DARN_RAW.
+ (darn_32): Use an unspec_volatile, and UNSPECV_DARN_32.
+ (darn_raw): Use an unspec_volatile, and UNSPECV_DARN_RAW.
+ (darn): Use an unspec_volatile, and UNSPECV_DARN.
+
+2019-08-30 Segher Boessenkool <segher@kernel.crashing.org>
+
+ Backport from trunk
+ 2019-08-22 Segher Boessenkool <segher@kernel.crashing.org>
+
+ * config/rs6000/altivec.md (unspec): Delete UNSPEC_DARN, UNSPEC_DARN_32,
+ UNSPEC_DARN_RAW, UNSPEC_CMPRB, UNSPEC_CMPRB2, UNSPEC_CMPEQB; move to...
+ * config/rs6000/rs6000.md (unspec): ... here.
+ * config/rs6000/altivec.md (darn_32, darn_raw, darn, cmprb,
+ *cmprb_internal, setb_signed, setb_unsigned, cmprb2, *cmprb2_internal,
+ cmpeqb, *cmpeqb_internal): Delete, move to...
+ * config/rs6000/rs6000.md (darn_32, darn_raw, darn, cmprb,
+ *cmprb_internal, setb_signed, setb_unsigned, cmprb2, *cmprb2_internal,
+ cmpeqb, *cmpeqb_internal): ... here.
+
+2019-08-30 Richard Biener <rguenther@suse.de>
+
+ Backport from mainline
+ 2019-04-29 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/90278
+ * tree-ssa-forwprop.c (pass_forwprop::execute): Transfer/clean
+ EH on comparison simplification.
+
+2019-08-29 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/91568
+ * tree-vectorizer.h (_slp_tree::max_nunits): Add.
+ (vect_update_max_nunits): Add overload for poly_uint64.
+ * tree-vect-slp.c (vect_create_new_slp_node): Initialize it.
+ (vect_build_slp_tree): Record max_nunits into the subtree
+ and merge it upwards.
+ (vect_print_slp_tree): Print max_nunits.
+
+2019-08-28 Richard Biener <rguenther@suse.de>
+
+ Backport from mainline
+ 2019-05-27 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/90637
+ * tree-ssa-sink.c (statement_sink_location): Honor the
+ computed sink location for single-uses.
+
2019-08-26 Xiong Hu Luo <luoxhu@linux.ibm.com>
Backport r274411 from trunk to gcc-9-branch.
diff --git a/gcc/DATESTAMP b/gcc/DATESTAMP
index 3f31c4a2b92..85589dce961 100644
--- a/gcc/DATESTAMP
+++ b/gcc/DATESTAMP
@@ -1 +1 @@
-20190827
+20191120
diff --git a/gcc/Makefile.in b/gcc/Makefile.in
index 59f2089f846..016ffc5a1cd 100644
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -1120,6 +1120,7 @@ endif
# Support for additional languages (other than C).
# C can be supported this way too (leave for later).
+LANG_CONFIGUREFRAGS = @all_lang_configurefrags@
LANG_MAKEFRAGS = @all_lang_makefrags@
# Used by gcc/jit/Make-lang.in
@@ -1894,7 +1895,7 @@ cstamp-h: config.in config.status
# Really, really stupid make features, such as SUN's KEEP_STATE, may force
# a target to build even if it is up-to-date. So we must verify that
# config.status does not exist before failing.
-config.status: $(srcdir)/configure $(srcdir)/config.gcc
+config.status: $(srcdir)/configure $(srcdir)/config.gcc $(LANG_CONFIGUREFRAGS)
@if [ ! -f config.status ] ; then \
echo You must configure gcc. Look at http://gcc.gnu.org/install/ for details.; \
false; \
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index adcf225a1a4..a60cd5f9618 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,36 @@
+2019-11-08 Jakub Jelinek <jakub@redhat.com>
+
+ Backported from mainline
+ 2019-10-27 Jakub Jelinek <jakub@redhat.com>
+
+ * locales.c (iso_3166): Add missing comma after "United-States".
+
+2019-10-12 Eric Botcazou <ebotcazou@adacore.com>
+
+ PR ada/91995
+ * sem_ch8.adb (Chain_Use_Clause): Remove second argument in calls
+ to Defining_Entity.
+ * sem_elab.adb (Find_Unit_Entity): Likewise. Deal with N_Subunit
+ here in lieu of in Defining_Entity.
+ * sem_spark.adb (Check_Callable_Body): Likewise.
+ (Check_Package_Body): Likewise.
+ * sem_util.ads (Defining_Entity): Remove 2nd and 3th parameters.
+ * sem_util.adb (Defining_Entity): Remove 2nd and 3th parameters,
+ and adjust accordingly. Deal with N_Compilation_Unit.
+
+2019-10-11 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gcc-interface/decl.c (annotate_value) <INTEGER_CST>: Really test the
+ sign of the value when deciding to build a NEGATE_EXPR.
+ <PLUS_EXPR>: Remove redundant line.
+ <BIT_AND_EXPR>: Do the negation here.
+
+2019-09-23 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gcc-interface/trans.c (Attribute_to_gnu): Test Can_Use_Internal_Rep
+ on the underlying type of the node.
+ (Call_to_gnu): Likewise with the type of the prefix.
+
2019-08-12 Release Manager
* GCC 9.2.0 released.
diff --git a/gcc/ada/gcc-interface/decl.c b/gcc/ada/gcc-interface/decl.c
index 4e73df0d7f0..a724ba693fd 100644
--- a/gcc/ada/gcc-interface/decl.c
+++ b/gcc/ada/gcc-interface/decl.c
@@ -8255,9 +8255,8 @@ annotate_value (tree gnu_size)
{
case INTEGER_CST:
/* For negative values, build NEGATE_EXPR of the opposite. Such values
- can appear for discriminants in expressions for variants. Note that,
- sizetype being unsigned, we don't directly use tree_int_cst_sgn. */
- if (tree_int_cst_sign_bit (gnu_size))
+ can appear for discriminants in expressions for variants. */
+ if (tree_int_cst_sgn (gnu_size) < 0)
{
tree t = wide_int_to_tree (sizetype, -wi::to_wide (gnu_size));
tcode = Negate_Expr;
@@ -8335,9 +8334,8 @@ annotate_value (tree gnu_size)
&& tree_int_cst_sign_bit (TREE_OPERAND (gnu_size, 1)))
{
tcode = Minus_Expr;
- ops[0] = annotate_value (TREE_OPERAND (gnu_size, 0));
- wide_int op1 = -wi::to_wide (TREE_OPERAND (gnu_size, 1));
- ops[1] = annotate_value (wide_int_to_tree (sizetype, op1));
+ wide_int wop1 = -wi::to_wide (TREE_OPERAND (gnu_size, 1));
+ ops[1] = annotate_value (wide_int_to_tree (sizetype, wop1));
break;
}
@@ -8378,9 +8376,9 @@ annotate_value (tree gnu_size)
Such values can appear in expressions with aligning patterns. */
if (TREE_CODE (TREE_OPERAND (gnu_size, 1)) == INTEGER_CST)
{
- wide_int op1 = wi::sext (wi::to_wide (TREE_OPERAND (gnu_size, 1)),
- TYPE_PRECISION (sizetype));
- ops[1] = annotate_value (wide_int_to_tree (sizetype, op1));
+ wide_int wop1 = -wi::to_wide (TREE_OPERAND (gnu_size, 1));
+ tree op1 = wide_int_to_tree (sizetype, wop1);
+ ops[1] = annotate_value (build1 (NEGATE_EXPR, sizetype, op1));
}
break;
diff --git a/gcc/ada/gcc-interface/trans.c b/gcc/ada/gcc-interface/trans.c
index 49fd34656ad..f08f6aac330 100644
--- a/gcc/ada/gcc-interface/trans.c
+++ b/gcc/ada/gcc-interface/trans.c
@@ -2248,32 +2248,29 @@ Attribute_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, int attribute)
/* For other address attributes applied to a nested function,
find an inner ADDR_EXPR and annotate it so that we can issue
a useful warning with -Wtrampolines. */
- else if (FUNC_OR_METHOD_TYPE_P (TREE_TYPE (gnu_prefix)))
+ else if (FUNC_OR_METHOD_TYPE_P (TREE_TYPE (gnu_prefix))
+ && (gnu_expr = remove_conversions (gnu_result, false))
+ && TREE_CODE (gnu_expr) == ADDR_EXPR
+ && decl_function_context (TREE_OPERAND (gnu_expr, 0)))
{
- gnu_expr = remove_conversions (gnu_result, false);
+ set_expr_location_from_node (gnu_expr, gnat_node);
- if (TREE_CODE (gnu_expr) == ADDR_EXPR
- && decl_function_context (TREE_OPERAND (gnu_expr, 0)))
- {
- set_expr_location_from_node (gnu_expr, gnat_node);
-
- /* Also check the inlining status. */
- check_inlining_for_nested_subprog (TREE_OPERAND (gnu_expr, 0));
-
- /* Moreover, for 'Access or 'Unrestricted_Access with non-
- foreign-compatible representation, mark the ADDR_EXPR so
- that we can build a descriptor instead of a trampoline. */
- if ((attribute == Attr_Access
- || attribute == Attr_Unrestricted_Access)
- && targetm.calls.custom_function_descriptors > 0
- && Can_Use_Internal_Rep (Etype (gnat_node)))
- FUNC_ADDR_BY_DESCRIPTOR (gnu_expr) = 1;
-
- /* Otherwise, we need to check that we are not violating the
- No_Implicit_Dynamic_Code restriction. */
- else if (targetm.calls.custom_function_descriptors != 0)
- Check_Implicit_Dynamic_Code_Allowed (gnat_node);
- }
+ /* Also check the inlining status. */
+ check_inlining_for_nested_subprog (TREE_OPERAND (gnu_expr, 0));
+
+ /* Moreover, for 'Access or 'Unrestricted_Access with non-
+ foreign-compatible representation, mark the ADDR_EXPR so
+ that we can build a descriptor instead of a trampoline. */
+ if ((attribute == Attr_Access
+ || attribute == Attr_Unrestricted_Access)
+ && targetm.calls.custom_function_descriptors > 0
+ && Can_Use_Internal_Rep (Underlying_Type (Etype (gnat_node))))
+ FUNC_ADDR_BY_DESCRIPTOR (gnu_expr) = 1;
+
+ /* Otherwise, we need to check that we are not violating the
+ No_Implicit_Dynamic_Code restriction. */
+ else if (targetm.calls.custom_function_descriptors != 0)
+ Check_Implicit_Dynamic_Code_Allowed (gnat_node);
}
break;
@@ -5103,7 +5100,8 @@ Call_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, tree gnu_target,
/* If the access type doesn't require foreign-compatible representation,
be prepared for descriptors. */
if (targetm.calls.custom_function_descriptors > 0
- && Can_Use_Internal_Rep (Etype (Prefix (Name (gnat_node)))))
+ && Can_Use_Internal_Rep
+ (Underlying_Type (Etype (Prefix (Name (gnat_node))))))
by_descriptor = true;
}
else if (Nkind (Name (gnat_node)) == N_Attribute_Reference)
diff --git a/gcc/ada/locales.c b/gcc/ada/locales.c
index 2bf900319ca..9372bdb2d58 100644
--- a/gcc/ada/locales.c
+++ b/gcc/ada/locales.c
@@ -529,7 +529,7 @@ static char* iso_3166[] =
"UM", "United States Minor Outlying Islands",
"US", "United States",
"US", "United States of America",
- "US", "United-States"
+ "US", "United-States",
"UY", "Uruguay",
"UZ", "Uzbekistan",
diff --git a/gcc/ada/sem_ch8.adb b/gcc/ada/sem_ch8.adb
index a5e821da1b4..340aa49bd11 100644
--- a/gcc/ada/sem_ch8.adb
+++ b/gcc/ada/sem_ch8.adb
@@ -4256,16 +4256,14 @@ package body Sem_Ch8 is
-- Common case for compilation unit
- elsif Defining_Entity (N => Parent (N),
- Empty_On_Errors => True) = Current_Scope
- then
+ elsif Defining_Entity (Parent (N)) = Current_Scope then
null;
else
-- If declaration appears in some other scope, it must be in some
-- parent unit when compiling a child.
- Pack := Defining_Entity (Parent (N), Empty_On_Errors => True);
+ Pack := Defining_Entity (Parent (N));
if not In_Open_Scopes (Pack) then
null;
diff --git a/gcc/ada/sem_elab.adb b/gcc/ada/sem_elab.adb
index b74f88d0461..ee0c49ba40c 100644
--- a/gcc/ada/sem_elab.adb
+++ b/gcc/ada/sem_elab.adb
@@ -5544,13 +5544,23 @@ package body Sem_Elab is
N_Procedure_Instantiation)
and then Nkind (Context) = N_Compilation_Unit
then
- return
- Related_Instance (Defining_Entity (N, Concurrent_Subunit => True));
+ return Related_Instance (Defining_Entity (N));
+
+ -- The unit denotes a concurrent body acting as a subunit. Such bodies
+ -- are generally rewritten into null statements. The proper entity is
+ -- that of the "original node".
+
+ elsif Nkind (N) = N_Subunit
+ and then Nkind (Proper_Body (N)) = N_Null_Statement
+ and then Nkind_In (Original_Node (Proper_Body (N)), N_Protected_Body,
+ N_Task_Body)
+ then
+ return Defining_Entity (Original_Node (Proper_Body (N)));
-- Otherwise the proper entity is the defining entity
else
- return Defining_Entity (N, Concurrent_Subunit => True);
+ return Defining_Entity (N);
end if;
end Find_Unit_Entity;
diff --git a/gcc/ada/sem_spark.adb b/gcc/ada/sem_spark.adb
index cfa6df81854..439d29fe9dc 100644
--- a/gcc/ada/sem_spark.adb
+++ b/gcc/ada/sem_spark.adb
@@ -804,7 +804,7 @@ package body Sem_SPARK is
if Present (SPARK_Pragma (Defining_Entity (Body_N))) then
if Get_SPARK_Mode_From_Annotation
- (SPARK_Pragma (Defining_Entity (Body_N, False))) /= Opt.On
+ (SPARK_Pragma (Defining_Entity (Body_N))) /= Opt.On
then
return;
end if;
@@ -1914,7 +1914,7 @@ package body Sem_SPARK is
CorSp : Node_Id;
begin
- if Present (SPARK_Pragma (Defining_Entity (Pack, False))) then
+ if Present (SPARK_Pragma (Defining_Entity (Pack))) then
if Get_SPARK_Mode_From_Annotation
(SPARK_Pragma (Defining_Entity (Pack))) /= Opt.On
then
diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb
index 16c671111e4..eedfaf1376e 100644
--- a/gcc/ada/sem_util.adb
+++ b/gcc/ada/sem_util.adb
@@ -5827,11 +5827,7 @@ package body Sem_Util is
-- Defining_Entity --
---------------------
- function Defining_Entity
- (N : Node_Id;
- Empty_On_Errors : Boolean := False;
- Concurrent_Subunit : Boolean := False) return Entity_Id
- is
+ function Defining_Entity (N : Node_Id) return Entity_Id is
begin
case Nkind (N) is
when N_Abstract_Subprogram_Declaration
@@ -5882,24 +5878,11 @@ package body Sem_Util is
=>
return Defining_Identifier (N);
- when N_Subunit =>
- declare
- Bod : constant Node_Id := Proper_Body (N);
- Orig_Bod : constant Node_Id := Original_Node (Bod);
-
- begin
- -- Retrieve the entity of the original protected or task body
- -- if requested by the caller.
+ when N_Compilation_Unit =>
+ return Defining_Entity (Unit (N));
- if Concurrent_Subunit
- and then Nkind (Bod) = N_Null_Statement
- and then Nkind_In (Orig_Bod, N_Protected_Body, N_Task_Body)
- then
- return Defining_Entity (Orig_Bod);
- else
- return Defining_Entity (Bod);
- end if;
- end;
+ when N_Subunit =>
+ return Defining_Entity (Proper_Body (N));
when N_Function_Instantiation
| N_Function_Specification
@@ -5925,14 +5908,10 @@ package body Sem_Util is
-- can continue semantic analysis.
elsif Nam = Error then
- if Empty_On_Errors then
- return Empty;
- else
- Err := Make_Temporary (Sloc (N), 'T');
- Set_Defining_Unit_Name (N, Err);
+ Err := Make_Temporary (Sloc (N), 'T');
+ Set_Defining_Unit_Name (N, Err);
- return Err;
- end if;
+ return Err;
-- If not an entity, get defining identifier
@@ -5947,11 +5926,7 @@ package body Sem_Util is
return Entity (Identifier (N));
when others =>
- if Empty_On_Errors then
- return Empty;
- else
- raise Program_Error;
- end if;
+ raise Program_Error;
end case;
end Defining_Entity;
diff --git a/gcc/ada/sem_util.ads b/gcc/ada/sem_util.ads
index 4e4d4ba8826..f098ea44d97 100644
--- a/gcc/ada/sem_util.ads
+++ b/gcc/ada/sem_util.ads
@@ -543,10 +543,7 @@ package Sem_Util is
-- in the case of a descendant of a generic formal type (returns Int'Last
-- instead of 0).
- function Defining_Entity
- (N : Node_Id;
- Empty_On_Errors : Boolean := False;
- Concurrent_Subunit : Boolean := False) return Entity_Id;
+ function Defining_Entity (N : Node_Id) return Entity_Id;
-- Given a declaration N, returns the associated defining entity. If the
-- declaration has a specification, the entity is obtained from the
-- specification. If the declaration has a defining unit name, then the
@@ -557,22 +554,6 @@ package Sem_Util is
-- local entities declared during loop expansion. These entities need
-- debugging information, generated through Qualify_Entity_Names, and
-- the loop declaration must be placed in the table Name_Qualify_Units.
- --
- -- Set flag Empty_On_Error to change the behavior of this routine as
- -- follows:
- --
- -- * True - A declaration that lacks a defining entity returns Empty.
- -- A node that does not allow for a defining entity returns Empty.
- --
- -- * False - A declaration that lacks a defining entity is given a new
- -- internally generated entity which is subsequently returned. A node
- -- that does not allow for a defining entity raises Program_Error.
- --
- -- The former semantics is appropriate for the back end; the latter
- -- semantics is appropriate for the front end.
- --
- -- Set flag Concurrent_Subunit to handle rewritings of concurrent bodies
- -- which act as subunits. Such bodies are generally rewritten as null.
function Denotes_Discriminant
(N : Node_Id;
diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog
index acdfe79894e..e7f0127dcf2 100644
--- a/gcc/c-family/ChangeLog
+++ b/gcc/c-family/ChangeLog
@@ -1,3 +1,45 @@
+2019-11-13 Eric Botcazou <ebotcazou@adacore.com>
+
+ * c-ada-spec.c (get_underlying_decl): Do not look through typedefs.
+ (dump_forward_type): Do not generate a declaration for function types.
+ (dump_nested_type) <ARRAY_TYPE>: Do not generate a nested declaration
+ of the component type if it is declared in another file.
+
+2019-10-21 Jakub Jelinek <jakub@redhat.com>
+
+ Backported from mainline
+ 2019-10-01 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/91925
+ * c-warn.c (check_alignment_of_packed_member): Ignore FIELD_DECLs
+ with NULL DECL_FIELD_OFFSET.
+
+ 2019-09-27 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/88203
+ * c-common.h (c_omp_predefined_variable): Declare.
+ * c-omp.c (c_omp_predefined_variable): New function.
+ (c_omp_predetermined_sharing): Return OMP_CLAUSE_DEFAULT_SHARED
+ for predefined variables.
+
+2019-09-02 Martin Liska <mliska@suse.cz>
+
+ Backport from mainline
+ 2019-09-02 Martin Liska <mliska@suse.cz>
+
+ PR c++/91155
+ * c-common.c (fname_as_string): Use cxx_printable_name for
+ __PRETTY_FUNCTION__ same as was used before r265711.
+
+2019-08-31 Iain Sandoe <iain@sandoe.co.uk>
+
+ Backport from mainline
+ 2019-08-23 Iain Sandoe <iain@sandoe.co.uk>
+
+ PR pch/61250
+ * c-lex.c (c_lex_with_flags): Don't call
+ c_common_no_more_pch () from here.
+
2019-08-12 Release Manager
* GCC 9.2.0 released.
diff --git a/gcc/c-family/c-ada-spec.c b/gcc/c-family/c-ada-spec.c
index 76e736964de..0fee9a0d037 100644
--- a/gcc/c-family/c-ada-spec.c
+++ b/gcc/c-family/c-ada-spec.c
@@ -1025,7 +1025,9 @@ get_underlying_decl (tree type)
if (TYPE_P (type))
{
- type = TYPE_MAIN_VARIANT (type);
+ /* Strip qualifiers but do not look through typedefs. */
+ if (TYPE_QUALS_NO_ADDR_SPACE (type))
+ type = TYPE_MAIN_VARIANT (type);
/* type is a typedef. */
if (TYPE_NAME (type) && DECL_P (TYPE_NAME (type)))
@@ -2451,6 +2453,9 @@ dump_forward_type (pretty_printer *buffer, tree type, tree t, int spc)
if (DECL_SOURCE_FILE (decl) != DECL_SOURCE_FILE (t))
return;
+ if (TREE_CODE (type) == FUNCTION_TYPE)
+ return;
+
/* Generate an incomplete type declaration. */
pp_string (buffer, "type ");
dump_ada_node (buffer, decl, NULL_TREE, spc, false, true);
@@ -2519,7 +2524,10 @@ dump_nested_type (pretty_printer *buffer, tree field, tree t, tree parent,
while (TREE_CODE (tmp) == ARRAY_TYPE)
tmp = TREE_TYPE (tmp);
decl = get_underlying_decl (tmp);
- if (decl && !DECL_NAME (decl) && !TREE_VISITED (decl))
+ if (decl
+ && !DECL_NAME (decl)
+ && DECL_SOURCE_FILE (decl) == DECL_SOURCE_FILE (t)
+ && !TREE_VISITED (decl))
{
/* Generate full declaration. */
dump_nested_type (buffer, decl, t, parent, spc);
diff --git a/gcc/c-family/c-common.h b/gcc/c-family/c-common.h
index 1cf2cae6395..e9ef16aff29 100644
--- a/gcc/c-family/c-common.h
+++ b/gcc/c-family/c-common.h
@@ -1184,6 +1184,7 @@ extern void c_omp_split_clauses (location_t, enum tree_code, omp_clause_mask,
tree, tree *);
extern tree c_omp_declare_simd_clauses_to_numbers (tree, tree);
extern void c_omp_declare_simd_clauses_to_decls (tree, tree);
+extern bool c_omp_predefined_variable (tree);
extern enum omp_clause_default_kind c_omp_predetermined_sharing (tree);
/* Return next tree in the chain for chain_next walking of tree nodes. */
diff --git a/gcc/c-family/c-lex.c b/gcc/c-family/c-lex.c
index 0a368a33a58..3c92103a5d4 100644
--- a/gcc/c-family/c-lex.c
+++ b/gcc/c-family/c-lex.c
@@ -394,7 +394,6 @@ enum cpp_ttype
c_lex_with_flags (tree *value, location_t *loc, unsigned char *cpp_flags,
int lex_flags)
{
- static bool no_more_pch;
const cpp_token *tok;
enum cpp_ttype type;
unsigned char add_flags = 0;
@@ -628,12 +627,6 @@ c_lex_with_flags (tree *value, location_t *loc, unsigned char *cpp_flags,
if (cpp_flags)
*cpp_flags = tok->flags | add_flags;
- if (!no_more_pch)
- {
- no_more_pch = true;
- c_common_no_more_pch ();
- }
-
timevar_pop (TV_CPP);
return type;
diff --git a/gcc/c-family/c-omp.c b/gcc/c-family/c-omp.c
index 1f288a6fbb2..ebe0b4e8155 100644
--- a/gcc/c-family/c-omp.c
+++ b/gcc/c-family/c-omp.c
@@ -2023,6 +2023,25 @@ c_omp_declare_simd_clauses_to_decls (tree fndecl, tree clauses)
}
}
+/* Return true for __func__ and similar function-local predefined
+ variables (which are in OpenMP predetermined shared, allowed in
+ shared/firstprivate clauses). */
+
+bool
+c_omp_predefined_variable (tree decl)
+{
+ if (VAR_P (decl)
+ && DECL_ARTIFICIAL (decl)
+ && TREE_READONLY (decl)
+ && TREE_STATIC (decl)
+ && DECL_NAME (decl)
+ && (DECL_NAME (decl) == ridpointers[RID_C99_FUNCTION_NAME]
+ || DECL_NAME (decl) == ridpointers[RID_FUNCTION_NAME]
+ || DECL_NAME (decl) == ridpointers[RID_PRETTY_FUNCTION_NAME]))
+ return true;
+ return false;
+}
+
/* True if OpenMP sharing attribute of DECL is predetermined. */
enum omp_clause_default_kind
@@ -2036,5 +2055,8 @@ c_omp_predetermined_sharing (tree decl)
&& INTEGRAL_TYPE_P (TREE_TYPE (decl)))
return OMP_CLAUSE_DEFAULT_SHARED;
+ if (c_omp_predefined_variable (decl))
+ return OMP_CLAUSE_DEFAULT_SHARED;
+
return OMP_CLAUSE_DEFAULT_UNSPECIFIED;
}
diff --git a/gcc/c-family/c-warn.c b/gcc/c-family/c-warn.c
index 322cf98eb02..67dce9e125a 100644
--- a/gcc/c-family/c-warn.c
+++ b/gcc/c-family/c-warn.c
@@ -2784,6 +2784,8 @@ check_alignment_of_packed_member (tree type, tree field, bool rvalue)
/* Check alignment of the data member. */
if (TREE_CODE (field) == FIELD_DECL
&& (DECL_PACKED (field) || TYPE_PACKED (TREE_TYPE (field)))
+ /* Ignore FIELDs not laid out yet. */
+ && DECL_FIELD_OFFSET (field)
&& (!rvalue || TREE_CODE (TREE_TYPE (field)) == ARRAY_TYPE))
{
/* Check the expected alignment against the field alignment. */
diff --git a/gcc/c/ChangeLog b/gcc/c/ChangeLog
index 89e5b25d020..126a51e5748 100644
--- a/gcc/c/ChangeLog
+++ b/gcc/c/ChangeLog
@@ -1,3 +1,33 @@
+2019-10-21 Jakub Jelinek <jakub@redhat.com>
+
+ Backported from mainline
+ 2019-09-27 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/88203
+ * c-parser.c (c_parser_predefined_identifier): New function.
+ (c_parser_postfix_expression): Use it.
+ (c_parser_omp_variable_list): Parse predefined identifiers.
+ * c-typeck.c (c_finish_omp_clauses): Allow predefined variables
+ in shared and firstprivate clauses, even when they are predetermined
+ shared.
+
+ 2019-08-09 Jakub Jelinek <jakub@redhat.com>
+
+ PR c/91401
+ * c-parser.c (c_parser_omp_clause_dist_schedule): Fix up typos in the
+ check_no_duplicate_clause call. Comment it out, instead emit a
+ warning for duplicate dist_schedule clauses.
+
+2019-08-31 Iain Sandoe <iain@sandoe.co.uk>
+
+ Backport from mainline.
+ 2019-08-23 Iain Sandoe <iain@sandoe.co.uk>
+
+ PR pch/61250
+ * c-parser.c (c_parse_file): Call c_common_no_more_pch ()
+ after determining that the first token is not
+ PRAGMA_GCC_PCH_PREPROCESS.
+
2019-08-12 Release Manager
* GCC 9.2.0 released.
diff --git a/gcc/c/c-parser.c b/gcc/c/c-parser.c
index f8d1fb3fa78..aafe8d1740b 100644
--- a/gcc/c/c-parser.c
+++ b/gcc/c/c-parser.c
@@ -8012,6 +8012,41 @@ enum tgmath_parm_kind
tgmath_fixed, tgmath_real, tgmath_complex
};
+/* Helper function for c_parser_postfix_expression. Parse predefined
+ identifiers. */
+
+static struct c_expr
+c_parser_predefined_identifier (c_parser *parser)
+{
+ location_t loc = c_parser_peek_token (parser)->location;
+ switch (c_parser_peek_token (parser)->keyword)
+ {
+ case RID_FUNCTION_NAME:
+ pedwarn (loc, OPT_Wpedantic, "ISO C does not support %qs predefined "
+ "identifier", "__FUNCTION__");
+ break;
+ case RID_PRETTY_FUNCTION_NAME:
+ pedwarn (loc, OPT_Wpedantic, "ISO C does not support %qs predefined "
+ "identifier", "__PRETTY_FUNCTION__");
+ break;
+ case RID_C99_FUNCTION_NAME:
+ pedwarn_c90 (loc, OPT_Wpedantic, "ISO C90 does not support "
+ "%<__func__%> predefined identifier");
+ break;
+ default:
+ gcc_unreachable ();
+ }
+
+ struct c_expr expr;
+ expr.original_code = ERROR_MARK;
+ expr.original_type = NULL;
+ expr.value = fname_decl (loc, c_parser_peek_token (parser)->keyword,
+ c_parser_peek_token (parser)->value);
+ set_c_expr_source_range (&expr, loc, loc);
+ c_parser_consume_token (parser);
+ return expr;
+}
+
/* Parse a postfix expression (C90 6.3.1-6.3.2, C99 6.5.1-6.5.2,
C11 6.5.1-6.5.2). Compound literals aren't handled here; callers have to
call c_parser_postfix_expression_after_paren_type on encountering them.
@@ -8232,31 +8267,9 @@ c_parser_postfix_expression (c_parser *parser)
switch (c_parser_peek_token (parser)->keyword)
{
case RID_FUNCTION_NAME:
- pedwarn (loc, OPT_Wpedantic, "ISO C does not support "
- "%<__FUNCTION__%> predefined identifier");
- expr.value = fname_decl (loc,
- c_parser_peek_token (parser)->keyword,
- c_parser_peek_token (parser)->value);
- set_c_expr_source_range (&expr, loc, loc);
- c_parser_consume_token (parser);
- break;
case RID_PRETTY_FUNCTION_NAME:
- pedwarn (loc, OPT_Wpedantic, "ISO C does not support "
- "%<__PRETTY_FUNCTION__%> predefined identifier");
- expr.value = fname_decl (loc,
- c_parser_peek_token (parser)->keyword,
- c_parser_peek_token (parser)->value);
- set_c_expr_source_range (&expr, loc, loc);
- c_parser_consume_token (parser);
- break;
case RID_C99_FUNCTION_NAME:
- pedwarn_c90 (loc, OPT_Wpedantic, "ISO C90 does not support "
- "%<__func__%> predefined identifier");
- expr.value = fname_decl (loc,
- c_parser_peek_token (parser)->keyword,
- c_parser_peek_token (parser)->value);
- set_c_expr_source_range (&expr, loc, loc);
- c_parser_consume_token (parser);
+ expr = c_parser_predefined_identifier (parser);
break;
case RID_VA_ARG:
{
@@ -11950,15 +11963,9 @@ c_parser_omp_variable_list (c_parser *parser,
{
auto_vec<c_token> tokens;
unsigned int tokens_avail = 0;
+ bool first = true;
- if (kind != OMP_CLAUSE_DEPEND
- && (c_parser_next_token_is_not (parser, CPP_NAME)
- || c_parser_peek_token (parser)->id_kind != C_ID_ID))
- c_parser_error (parser, "expected identifier");
-
- while (kind == OMP_CLAUSE_DEPEND
- || (c_parser_next_token_is (parser, CPP_NAME)
- && c_parser_peek_token (parser)->id_kind == C_ID_ID))
+ while (1)
{
bool array_section_p = false;
if (kind == OMP_CLAUSE_DEPEND)
@@ -11979,6 +11986,7 @@ c_parser_omp_variable_list (c_parser *parser,
break;
c_parser_consume_token (parser);
+ first = false;
continue;
}
@@ -12029,16 +12037,35 @@ c_parser_omp_variable_list (c_parser *parser,
parser->tokens_avail = tokens.length ();
}
- tree t = lookup_name (c_parser_peek_token (parser)->value);
+ tree t = NULL_TREE;
- if (t == NULL_TREE)
+ if (c_parser_next_token_is (parser, CPP_NAME)
+ && c_parser_peek_token (parser)->id_kind == C_ID_ID)
{
- undeclared_variable (c_parser_peek_token (parser)->location,
- c_parser_peek_token (parser)->value);
- t = error_mark_node;
- }
+ t = lookup_name (c_parser_peek_token (parser)->value);
- c_parser_consume_token (parser);
+ if (t == NULL_TREE)
+ {
+ undeclared_variable (c_parser_peek_token (parser)->location,
+ c_parser_peek_token (parser)->value);
+ t = error_mark_node;
+ }
+
+ c_parser_consume_token (parser);
+ }
+ else if (c_parser_next_token_is (parser, CPP_KEYWORD)
+ && (c_parser_peek_token (parser)->keyword == RID_FUNCTION_NAME
+ || (c_parser_peek_token (parser)->keyword
+ == RID_PRETTY_FUNCTION_NAME)
+ || (c_parser_peek_token (parser)->keyword
+ == RID_C99_FUNCTION_NAME)))
+ t = c_parser_predefined_identifier (parser).value;
+ else
+ {
+ if (first)
+ c_parser_error (parser, "expected identifier");
+ break;
+ }
if (t == error_mark_node)
;
@@ -12176,6 +12203,7 @@ c_parser_omp_variable_list (c_parser *parser,
break;
c_parser_consume_token (parser);
+ first = false;
}
return list;
@@ -14707,7 +14735,10 @@ c_parser_omp_clause_dist_schedule (c_parser *parser, tree list)
c_parser_skip_until_found (parser, CPP_CLOSE_PAREN,
"expected %<,%> or %<)%>");
- check_no_duplicate_clause (list, OMP_CLAUSE_SCHEDULE, "schedule");
+ /* check_no_duplicate_clause (list, OMP_CLAUSE_DIST_SCHEDULE,
+ "dist_schedule"); */
+ if (omp_find_clause (list, OMP_CLAUSE_DIST_SCHEDULE))
+ warning_at (loc, 0, "too many %qs clauses", "dist_schedule");
if (t == error_mark_node)
return list;
@@ -19859,6 +19890,8 @@ c_parse_file (void)
if (c_parser_peek_token (&tparser)->pragma_kind == PRAGMA_GCC_PCH_PREPROCESS)
c_parser_pragma_pch_preprocess (&tparser);
+ else
+ c_common_no_more_pch ();
the_parser = ggc_alloc<c_parser> ();
*the_parser = tparser;
diff --git a/gcc/c/c-typeck.c b/gcc/c/c-typeck.c
index 4a4eb08b73f..be12a0a605e 100644
--- a/gcc/c/c-typeck.c
+++ b/gcc/c/c-typeck.c
@@ -14713,6 +14713,13 @@ c_finish_omp_clauses (tree clauses, enum c_omp_region_type ort)
case OMP_CLAUSE_DEFAULT_UNSPECIFIED:
break;
case OMP_CLAUSE_DEFAULT_SHARED:
+ if ((OMP_CLAUSE_CODE (c) == OMP_CLAUSE_SHARED
+ || OMP_CLAUSE_CODE (c) == OMP_CLAUSE_FIRSTPRIVATE)
+ && c_omp_predefined_variable (t))
+ /* The __func__ variable and similar function-local
+ predefined variables may be listed in a shared or
+ firstprivate clause. */
+ break;
share_name = "shared";
break;
case OMP_CLAUSE_DEFAULT_PRIVATE:
diff --git a/gcc/calls.c b/gcc/calls.c
index c8a42680041..56795995650 100644
--- a/gcc/calls.c
+++ b/gcc/calls.c
@@ -1971,8 +1971,7 @@ initialize_argument_information (int num_actuals ATTRIBUTE_UNUSED,
/* If TYPE is a transparent union or record, pass things the way
we would pass the first field of the union or record. We have
already verified that the modes are the same. */
- if ((TREE_CODE (type) == UNION_TYPE || TREE_CODE (type) == RECORD_TYPE)
- && TYPE_TRANSPARENT_AGGR (type))
+ if (RECORD_OR_UNION_TYPE_P (type) && TYPE_TRANSPARENT_AGGR (type))
type = TREE_TYPE (first_field (type));
/* Decide where to pass this arg.
@@ -2750,6 +2749,9 @@ load_register_parameters (struct arg_data *args, int num_actuals,
poly_int64 size = 0;
HOST_WIDE_INT const_size = 0;
rtx_insn *before_arg = get_last_insn ();
+ tree type = TREE_TYPE (args[i].tree_value);
+ if (RECORD_OR_UNION_TYPE_P (type) && TYPE_TRANSPARENT_AGGR (type))
+ type = TREE_TYPE (first_field (type));
/* Set non-negative if we must move a word at a time, even if
just one word (e.g, partial == 4 && mode == DFmode). Set
to -1 if we just use a normal move insn. This value can be
@@ -2762,11 +2764,11 @@ load_register_parameters (struct arg_data *args, int num_actuals,
gcc_assert (partial % UNITS_PER_WORD == 0);
nregs = partial / UNITS_PER_WORD;
}
- else if (TYPE_MODE (TREE_TYPE (args[i].tree_value)) == BLKmode)
+ else if (TYPE_MODE (type) == BLKmode)
{
/* Variable-sized parameters should be described by a
PARALLEL instead. */
- const_size = int_size_in_bytes (TREE_TYPE (args[i].tree_value));
+ const_size = int_size_in_bytes (type);
gcc_assert (const_size >= 0);
nregs = (const_size + (UNITS_PER_WORD - 1)) / UNITS_PER_WORD;
size = const_size;
@@ -2893,8 +2895,7 @@ load_register_parameters (struct arg_data *args, int num_actuals,
if (GET_CODE (reg) == PARALLEL)
use_group_regs (call_fusage, reg);
else if (nregs == -1)
- use_reg_mode (call_fusage, reg,
- TYPE_MODE (TREE_TYPE (args[i].tree_value)));
+ use_reg_mode (call_fusage, reg, TYPE_MODE (type));
else if (nregs > 0)
use_regs (call_fusage, REGNO (reg), nregs);
}
diff --git a/gcc/cfgcleanup.c b/gcc/cfgcleanup.c
index 992912ce195..01e13b9dc4f 100644
--- a/gcc/cfgcleanup.c
+++ b/gcc/cfgcleanup.c
@@ -53,6 +53,7 @@ along with GCC; see the file COPYING3. If not see
#include "dce.h"
#include "dbgcnt.h"
#include "rtl-iter.h"
+#include "regs.h"
#define FORWARDER_BLOCK_P(BB) ((BB)->flags & BB_FORWARDER_BLOCK)
@@ -257,6 +258,10 @@ thread_jump (edge e, basic_block b)
bool failed = false;
reg_set_iterator rsi;
+ /* Jump threading may cause fixup_partitions to introduce new crossing edges,
+ which is not allowed after reload. */
+ gcc_checking_assert (!reload_completed || !crtl->has_bb_partition);
+
if (b->flags & BB_NONTHREADABLE_BLOCK)
return NULL;
@@ -1224,6 +1229,14 @@ old_insns_match_p (int mode ATTRIBUTE_UNUSED, rtx_insn *i1, rtx_insn *i2)
}
}
}
+
+ HARD_REG_SET i1_used, i2_used;
+
+ get_call_reg_set_usage (i1, &i1_used, call_used_reg_set);
+ get_call_reg_set_usage (i2, &i2_used, call_used_reg_set);
+
+ if (!hard_reg_set_equal_p (i1_used, i2_used))
+ return dir_none;
}
/* If both i1 and i2 are frame related, verify all the CFA notes
@@ -3269,10 +3282,10 @@ make_pass_jump (gcc::context *ctxt)
namespace {
-const pass_data pass_data_postreload_jump =
+const pass_data pass_data_jump_after_combine =
{
RTL_PASS, /* type */
- "postreload_jump", /* name */
+ "jump_after_combine", /* name */
OPTGROUP_NONE, /* optinfo_flags */
TV_JUMP, /* tv_id */
0, /* properties_required */
@@ -3282,31 +3295,34 @@ const pass_data pass_data_postreload_jump =
0, /* todo_flags_finish */
};
-class pass_postreload_jump : public rtl_opt_pass
+class pass_jump_after_combine : public rtl_opt_pass
{
public:
- pass_postreload_jump (gcc::context *ctxt)
- : rtl_opt_pass (pass_data_postreload_jump, ctxt)
+ pass_jump_after_combine (gcc::context *ctxt)
+ : rtl_opt_pass (pass_data_jump_after_combine, ctxt)
{}
/* opt_pass methods: */
+ virtual bool gate (function *) { return flag_thread_jumps; }
virtual unsigned int execute (function *);
-}; // class pass_postreload_jump
+}; // class pass_jump_after_combine
unsigned int
-pass_postreload_jump::execute (function *)
+pass_jump_after_combine::execute (function *)
{
- cleanup_cfg (flag_thread_jumps ? CLEANUP_THREADING : 0);
+ /* Jump threading does not keep dominators up-to-date. */
+ free_dominance_info (CDI_DOMINATORS);
+ cleanup_cfg (CLEANUP_THREADING);
return 0;
}
} // anon namespace
rtl_opt_pass *
-make_pass_postreload_jump (gcc::context *ctxt)
+make_pass_jump_after_combine (gcc::context *ctxt)
{
- return new pass_postreload_jump (ctxt);
+ return new pass_jump_after_combine (ctxt);
}
namespace {
diff --git a/gcc/common/config/s390/s390-common.c b/gcc/common/config/s390/s390-common.c
index f9c3a95f897..2e1914e3768 100644
--- a/gcc/common/config/s390/s390-common.c
+++ b/gcc/common/config/s390/s390-common.c
@@ -47,9 +47,9 @@ EXPORTED_CONST int processor_flags_table[] =
/* z14 */ PF_IEEE_FLOAT | PF_ZARCH | PF_LONG_DISPLACEMENT
| PF_EXTIMM | PF_DFP | PF_Z10 | PF_Z196 | PF_ZEC12 | PF_TX
| PF_Z13 | PF_VX | PF_VXE | PF_Z14,
- /* arch13 */ PF_IEEE_FLOAT | PF_ZARCH | PF_LONG_DISPLACEMENT
+ /* z15 */ PF_IEEE_FLOAT | PF_ZARCH | PF_LONG_DISPLACEMENT
| PF_EXTIMM | PF_DFP | PF_Z10 | PF_Z196 | PF_ZEC12 | PF_TX
- | PF_Z13 | PF_VX | PF_VXE | PF_Z14 | PF_VXE2 | PF_ARCH13
+ | PF_Z13 | PF_VX | PF_VXE | PF_Z14 | PF_VXE2 | PF_Z15
};
/* Change optimizations to be performed, depending on the
diff --git a/gcc/config.gcc b/gcc/config.gcc
index ddd3b8f4d9d..b2282ecdf0b 100644
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -4700,14 +4700,12 @@ case "${target}" in
echo "#undef LINK_OS_EXTRA_SPEC32"
echo "#define LINK_OS_EXTRA_SPEC32" \
"\"%(link_os_new_dtags)" \
- "-rpath $prefix/lib -rpath $at/lib" \
- "-L $prefix/lib -L $at/lib\""
+ "-rpath $prefix/lib -rpath $at/lib\""
echo
echo "#undef LINK_OS_EXTRA_SPEC64"
echo "#define LINK_OS_EXTRA_SPEC64" \
"\"%(link_os_new_dtags)" \
- "-rpath $prefix/lib64 -rpath $at/lib64" \
- "-L $prefix/lib64 -L $at/lib64\""
+ "-rpath $prefix/lib64 -rpath $at/lib64\""
echo
echo "#undef LINK_OS_NEW_DTAGS_SPEC"
echo "#define LINK_OS_NEW_DTAGS_SPEC" \
@@ -4720,7 +4718,10 @@ case "${target}" in
echo "#define MD_EXEC_PREFIX \"$at/bin/\""
echo
echo "#undef MD_STARTFILE_PREFIX"
- echo "#define MD_STARTFILE_PREFIX \"$at/lib/\"") \
+ echo "#define MD_STARTFILE_PREFIX \"$prefix/lib/\""
+ echo
+ echo "#undef MD_STARTFILE_PREFIX_1"
+ echo "#define MD_STARTFILE_PREFIX_1 \"$at/lib/\"") \
> advance-toolchain.h
else
echo "Unknown advance-toolchain $with_advance_toolchain"
@@ -4743,7 +4744,7 @@ case "${target}" in
for which in arch tune; do
eval "val=\$with_$which"
case ${val} in
- "" | native | z900 | z990 | z9-109 | z9-ec | z10 | z196 | zEC12 | z13 | z14 | arch5 | arch6 | arch7 | arch8 | arch9 | arch10 | arch11 | arch12 | arch13 )
+ "" | native | z900 | z990 | z9-109 | z9-ec | z10 | z196 | zEC12 | z13 | z14 | z15 | arch5 | arch6 | arch7 | arch8 | arch9 | arch10 | arch11 | arch12 | arch13 )
# OK
;;
*)
diff --git a/gcc/config/aarch64/aarch64-option-extensions.def b/gcc/config/aarch64/aarch64-option-extensions.def
index 53dcd03590d..010fd3ccf76 100644
--- a/gcc/config/aarch64/aarch64-option-extensions.def
+++ b/gcc/config/aarch64/aarch64-option-extensions.def
@@ -108,7 +108,7 @@ AARCH64_OPT_EXTENSION("sm4", AARCH64_FL_SM4, AARCH64_FL_SIMD, 0, false, "sm3 sm4
/* Enabling "fp16fml" also enables "fp" and "fp16".
Disabling "fp16fml" just disables "fp16fml". */
-AARCH64_OPT_EXTENSION("fp16fml", AARCH64_FL_F16FML, AARCH64_FL_FP | AARCH64_FL_F16, 0, false, "asimdfml")
+AARCH64_OPT_EXTENSION("fp16fml", AARCH64_FL_F16FML, AARCH64_FL_FP | AARCH64_FL_F16, 0, false, "asimdfhm")
/* Enabling "sve" also enables "fp16", "fp" and "simd".
Disabling "sve" just disables "sve". */
diff --git a/gcc/config/aarch64/aarch64.md b/gcc/config/aarch64/aarch64.md
index 5a1894063a1..cc5a887d404 100644
--- a/gcc/config/aarch64/aarch64.md
+++ b/gcc/config/aarch64/aarch64.md
@@ -1059,8 +1059,8 @@
(match_operand:GPI 1 "general_operand" ""))]
""
"
- if (MEM_P (operands[0]) && CONST_INT_P (operands[1])
- && <MODE>mode == DImode
+ if (MEM_P (operands[0]) && !MEM_VOLATILE_P (operands[0])
+ && CONST_INT_P (operands[1]) && <MODE>mode == DImode
&& aarch64_split_dimode_const_store (operands[0], operands[1]))
DONE;
@@ -6304,7 +6304,7 @@
[(match_operand:GPI 0 "register_operand")
(match_operand:GPF 1 "register_operand")]
"TARGET_FLOAT
- && ((GET_MODE_SIZE (<GPF:MODE>mode) <= GET_MODE_SIZE (<GPI:MODE>mode))
+ && ((GET_MODE_BITSIZE (<GPF:MODE>mode) <= LONG_TYPE_SIZE)
|| !flag_trapping_math || flag_fp_int_builtin_inexact)"
{
rtx cvt = gen_reg_rtx (<GPF:MODE>mode);
diff --git a/gcc/config/aarch64/aarch64.opt b/gcc/config/aarch64/aarch64.opt
index 7719c3b6352..3c6d1cc90ad 100644
--- a/gcc/config/aarch64/aarch64.opt
+++ b/gcc/config/aarch64/aarch64.opt
@@ -119,15 +119,15 @@ EnumValue
Enum(aarch64_tls_size) String(48) Value(48)
march=
-Target RejectNegative ToLower Joined Var(aarch64_arch_string)
+Target RejectNegative Negative(march=) ToLower Joined Var(aarch64_arch_string)
Use features of architecture ARCH.
mcpu=
-Target RejectNegative ToLower Joined Var(aarch64_cpu_string)
+Target RejectNegative Negative(mcpu=) ToLower Joined Var(aarch64_cpu_string)
Use features of and optimize for CPU.
mtune=
-Target RejectNegative ToLower Joined Var(aarch64_tune_string)
+Target RejectNegative Negative(mtune=) ToLower Joined Var(aarch64_tune_string)
Optimize for CPU.
mabi=
diff --git a/gcc/config/alpha/alpha.c b/gcc/config/alpha/alpha.c
index 984540f0b53..524379d3763 100644
--- a/gcc/config/alpha/alpha.c
+++ b/gcc/config/alpha/alpha.c
@@ -8839,6 +8839,9 @@ alpha_handle_trap_shadows (void)
case CODE_LABEL:
goto close_shadow;
+ case DEBUG_INSN:
+ break;
+
default:
gcc_unreachable ();
}
diff --git a/gcc/config/arc/arc.c b/gcc/config/arc/arc.c
index ee1f70bbb51..e6e4fb18ce1 100644
--- a/gcc/config/arc/arc.c
+++ b/gcc/config/arc/arc.c
@@ -5992,6 +5992,22 @@ arc_legitimize_pic_address (rtx addr)
switch (GET_CODE (addr))
{
+ case UNSPEC:
+ /* Can be one or our GOT or GOTOFFPC unspecs. This situation
+ happens when an address is not a legitimate constant and we
+ need the resolve it via force_reg in
+ prepare_move_operands. */
+ switch (XINT (addr, 1))
+ {
+ case ARC_UNSPEC_GOT:
+ case ARC_UNSPEC_GOTOFFPC:
+ /* Recover the symbol ref. */
+ addr = XVECEXP (addr, 0, 0);
+ break;
+ default:
+ return addr;
+ }
+ /* Fall through. */
case SYMBOL_REF:
/* TLS symbols are handled in different place. */
if (SYMBOL_REF_TLS_MODEL (addr))
diff --git a/gcc/config/arc/arc.md b/gcc/config/arc/arc.md
index 78e304d4c71..722cccd8be3 100644
--- a/gcc/config/arc/arc.md
+++ b/gcc/config/arc/arc.md
@@ -3742,20 +3742,20 @@ core_3, archs4x, archs4xd, archs4xd_slow"
; cond_exec patterns
(define_insn "*movsi_ne"
[(cond_exec
- (ne (match_operand:CC_Z 2 "cc_use_register" "Rcc, Rcc, Rcc,Rcc,Rcc") (const_int 0))
- (set (match_operand:SI 0 "dest_reg_operand" "=Rcq#q,Rcq#q,Rcq#q, w,w")
- (match_operand:SI 1 "nonmemory_operand" "C_0, h, ?Cal, Lc,?Cal")))]
+ (ne (match_operand:CC_Z 2 "cc_use_register" "Rcc,Rcc,Rcc,Rcc,Rcc") (const_int 0))
+ (set (match_operand:SI 0 "dest_reg_operand" "=q, q, r, q, r")
+ (match_operand:SI 1 "nonmemory_operand" "C_0, h, Lr,Cal,Cal")))]
""
"@
- * current_insn_predicate = 0; return \"sub%?.ne %0,%0,%0%&\";
- * current_insn_predicate = 0; return \"mov%?.ne %0,%1\";
- * current_insn_predicate = 0; return \"mov%?.ne %0,%1\";
- mov.ne %0,%1
- mov.ne %0,%1"
+ * current_insn_predicate = 0; return \"sub%?.ne\\t%0,%0,%0\";
+ * current_insn_predicate = 0; return \"mov%?.ne\\t%0,%1\";
+ mov.ne\\t%0,%1
+ * current_insn_predicate = 0; return \"mov%?.ne\\t%0,%1\";
+ mov.ne\\t%0,%1"
[(set_attr "type" "cmove")
- (set_attr "iscompact" "true,true,true_limm,false,false")
- (set_attr "length" "2,2,6,4,8")
- (set_attr "cpu_facility" "*,av2,av2,*,*")])
+ (set_attr "iscompact" "true,true,false,true_limm,false")
+ (set_attr "length" "2,2,4,6,8")
+ (set_attr "cpu_facility" "*,av2,*,av2,*")])
(define_insn "*movsi_cond_exec"
[(cond_exec
diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
index 45abcd89963..91bb65130b8 100644
--- a/gcc/config/arm/arm.c
+++ b/gcc/config/arm/arm.c
@@ -19670,6 +19670,35 @@ arm_compute_save_core_reg_mask (void)
return save_reg_mask;
}
+/* Return a mask for the call-clobbered low registers that are unused
+ at the end of the prologue. */
+static unsigned long
+thumb1_prologue_unused_call_clobbered_lo_regs (void)
+{
+ unsigned long mask = 0;
+
+ for (int reg = 0; reg <= LAST_LO_REGNUM; reg++)
+ if (!callee_saved_reg_p (reg)
+ && !REGNO_REG_SET_P (df_get_live_out (ENTRY_BLOCK_PTR_FOR_FN (cfun)),
+ reg))
+ mask |= 1 << reg;
+ return mask;
+}
+
+/* Similarly for the start of the epilogue. */
+static unsigned long
+thumb1_epilogue_unused_call_clobbered_lo_regs (void)
+{
+ unsigned long mask = 0;
+
+ for (int reg = 0; reg <= LAST_LO_REGNUM; reg++)
+ if (!callee_saved_reg_p (reg)
+ && !REGNO_REG_SET_P (df_get_live_in (EXIT_BLOCK_PTR_FOR_FN (cfun)),
+ reg))
+ mask |= 1 << reg;
+ return mask;
+}
+
/* Compute a bit mask of which core registers need to be
saved on the stack for the current function. */
static unsigned long
@@ -19701,10 +19730,19 @@ thumb1_compute_save_core_reg_mask (void)
if (mask & 0xff || thumb_force_lr_save ())
mask |= (1 << LR_REGNUM);
- /* Make sure we have a low work register if we need one.
- We will need one if we are going to push a high register,
- but we are not currently intending to push a low register. */
+ bool call_clobbered_scratch
+ = (thumb1_prologue_unused_call_clobbered_lo_regs ()
+ && thumb1_epilogue_unused_call_clobbered_lo_regs ());
+
+ /* Make sure we have a low work register if we need one. We will
+ need one if we are going to push a high register, but we are not
+ currently intending to push a low register. However if both the
+ prologue and epilogue have a spare call-clobbered low register,
+ then we won't need to find an additional work register. It does
+ not need to be the same register in the prologue and
+ epilogue. */
if ((mask & 0xff) == 0
+ && !call_clobbered_scratch
&& ((mask & 0x0f00) || TARGET_BACKTRACE))
{
/* Use thumb_find_work_register to choose which register
@@ -24930,12 +24968,7 @@ thumb1_unexpanded_epilogue (void)
unsigned long mask = live_regs_mask & 0xff;
int next_hi_reg;
- /* The available low registers depend on the size of the value we are
- returning. */
- if (size <= 12)
- mask |= 1 << 3;
- if (size <= 8)
- mask |= 1 << 2;
+ mask |= thumb1_epilogue_unused_call_clobbered_lo_regs ();
if (mask == 0)
/* Oh dear! We have no low registers into which we can pop
@@ -24943,7 +24976,7 @@ thumb1_unexpanded_epilogue (void)
internal_error
("no low registers available for popping high registers");
- for (next_hi_reg = 8; next_hi_reg < 13; next_hi_reg++)
+ for (next_hi_reg = 12; next_hi_reg > LAST_LO_REGNUM; next_hi_reg--)
if (live_regs_mask & (1 << next_hi_reg))
break;
@@ -24951,7 +24984,7 @@ thumb1_unexpanded_epilogue (void)
{
/* Find lo register(s) into which the high register(s) can
be popped. */
- for (regno = 0; regno <= LAST_LO_REGNUM; regno++)
+ for (regno = LAST_LO_REGNUM; regno >= 0; regno--)
{
if (mask & (1 << regno))
high_regs_pushed--;
@@ -24959,20 +24992,22 @@ thumb1_unexpanded_epilogue (void)
break;
}
- mask &= (2 << regno) - 1; /* A noop if regno == 8 */
+ if (high_regs_pushed == 0 && regno >= 0)
+ mask &= ~((1 << regno) - 1);
/* Pop the values into the low register(s). */
thumb_pop (asm_out_file, mask);
/* Move the value(s) into the high registers. */
- for (regno = 0; regno <= LAST_LO_REGNUM; regno++)
+ for (regno = LAST_LO_REGNUM; regno >= 0; regno--)
{
if (mask & (1 << regno))
{
asm_fprintf (asm_out_file, "\tmov\t%r, %r\n", next_hi_reg,
regno);
- for (next_hi_reg++; next_hi_reg < 13; next_hi_reg++)
+ for (next_hi_reg--; next_hi_reg > LAST_LO_REGNUM;
+ next_hi_reg--)
if (live_regs_mask & (1 << next_hi_reg))
break;
}
@@ -25354,10 +25389,20 @@ thumb1_expand_prologue (void)
break;
/* Here we need to mask out registers used for passing arguments
- even if they can be pushed. This is to avoid using them to stash the high
- registers. Such kind of stash may clobber the use of arguments. */
+ even if they can be pushed. This is to avoid using them to
+ stash the high registers. Such kind of stash may clobber the
+ use of arguments. */
pushable_regs = l_mask & (~arg_regs_mask);
- if (lr_needs_saving)
+ pushable_regs |= thumb1_prologue_unused_call_clobbered_lo_regs ();
+
+ /* Normally, LR can be used as a scratch register once it has been
+ saved; but if the function examines its own return address then
+ the value is still live and we need to avoid using it. */
+ bool return_addr_live
+ = REGNO_REG_SET_P (df_get_live_out (ENTRY_BLOCK_PTR_FOR_FN (cfun)),
+ LR_REGNUM);
+
+ if (lr_needs_saving || return_addr_live)
pushable_regs &= ~(1 << LR_REGNUM);
if (pushable_regs == 0)
@@ -25398,6 +25443,11 @@ thumb1_expand_prologue (void)
push_mask |= 1 << LR_REGNUM;
real_regs_mask |= 1 << LR_REGNUM;
lr_needs_saving = false;
+ /* If the return address is not live at this point, we
+ can add LR to the list of registers that we can use
+ for pushes. */
+ if (!return_addr_live)
+ pushable_regs |= 1 << LR_REGNUM;
}
insn = thumb1_emit_multi_reg_push (push_mask, real_regs_mask);
diff --git a/gcc/config/arm/arm.md b/gcc/config/arm/arm.md
index 0aecd03891c..ae582172ab9 100644
--- a/gcc/config/arm/arm.md
+++ b/gcc/config/arm/arm.md
@@ -4483,62 +4483,78 @@
; ARMv6+ unaligned load/store instructions (used for packed structure accesses).
(define_insn "unaligned_loadsi"
- [(set (match_operand:SI 0 "s_register_operand" "=l,r")
- (unspec:SI [(match_operand:SI 1 "memory_operand" "Uw,m")]
+ [(set (match_operand:SI 0 "s_register_operand" "=l,l,r")
+ (unspec:SI [(match_operand:SI 1 "memory_operand" "m,Uw,m")]
UNSPEC_UNALIGNED_LOAD))]
"unaligned_access"
- "ldr%?\t%0, %1\t@ unaligned"
- [(set_attr "arch" "t2,any")
- (set_attr "length" "2,4")
- (set_attr "predicable" "yes")
- (set_attr "predicable_short_it" "yes,no")
+ "@
+ ldr\t%0, %1\t@ unaligned
+ ldr%?\t%0, %1\t@ unaligned
+ ldr%?\t%0, %1\t@ unaligned"
+ [(set_attr "arch" "t1,t2,32")
+ (set_attr "length" "2,2,4")
+ (set_attr "predicable" "no,yes,yes")
+ (set_attr "predicable_short_it" "no,yes,no")
(set_attr "type" "load_4")])
+;; The 16-bit Thumb1 variant of ldrsh requires two registers in the
+;; address (there's no immediate format). That's tricky to support
+;; here and we don't really need this pattern for that case, so only
+;; enable for 32-bit ISAs.
(define_insn "unaligned_loadhis"
[(set (match_operand:SI 0 "s_register_operand" "=r")
(sign_extend:SI
(unspec:HI [(match_operand:HI 1 "memory_operand" "Uh")]
UNSPEC_UNALIGNED_LOAD)))]
- "unaligned_access"
+ "unaligned_access && TARGET_32BIT"
"ldrsh%?\t%0, %1\t@ unaligned"
[(set_attr "predicable" "yes")
(set_attr "type" "load_byte")])
(define_insn "unaligned_loadhiu"
- [(set (match_operand:SI 0 "s_register_operand" "=l,r")
+ [(set (match_operand:SI 0 "s_register_operand" "=l,l,r")
(zero_extend:SI
- (unspec:HI [(match_operand:HI 1 "memory_operand" "Uw,m")]
+ (unspec:HI [(match_operand:HI 1 "memory_operand" "m,Uw,m")]
UNSPEC_UNALIGNED_LOAD)))]
"unaligned_access"
- "ldrh%?\t%0, %1\t@ unaligned"
- [(set_attr "arch" "t2,any")
- (set_attr "length" "2,4")
- (set_attr "predicable" "yes")
- (set_attr "predicable_short_it" "yes,no")
+ "@
+ ldrh\t%0, %1\t@ unaligned
+ ldrh%?\t%0, %1\t@ unaligned
+ ldrh%?\t%0, %1\t@ unaligned"
+ [(set_attr "arch" "t1,t2,32")
+ (set_attr "length" "2,2,4")
+ (set_attr "predicable" "no,yes,yes")
+ (set_attr "predicable_short_it" "no,yes,no")
(set_attr "type" "load_byte")])
(define_insn "unaligned_storesi"
- [(set (match_operand:SI 0 "memory_operand" "=Uw,m")
- (unspec:SI [(match_operand:SI 1 "s_register_operand" "l,r")]
+ [(set (match_operand:SI 0 "memory_operand" "=m,Uw,m")
+ (unspec:SI [(match_operand:SI 1 "s_register_operand" "l,l,r")]
UNSPEC_UNALIGNED_STORE))]
"unaligned_access"
- "str%?\t%1, %0\t@ unaligned"
- [(set_attr "arch" "t2,any")
- (set_attr "length" "2,4")
- (set_attr "predicable" "yes")
- (set_attr "predicable_short_it" "yes,no")
+ "@
+ str\t%1, %0\t@ unaligned
+ str%?\t%1, %0\t@ unaligned
+ str%?\t%1, %0\t@ unaligned"
+ [(set_attr "arch" "t1,t2,32")
+ (set_attr "length" "2,2,4")
+ (set_attr "predicable" "no,yes,yes")
+ (set_attr "predicable_short_it" "no,yes,no")
(set_attr "type" "store_4")])
(define_insn "unaligned_storehi"
- [(set (match_operand:HI 0 "memory_operand" "=Uw,m")
- (unspec:HI [(match_operand:HI 1 "s_register_operand" "l,r")]
+ [(set (match_operand:HI 0 "memory_operand" "=m,Uw,m")
+ (unspec:HI [(match_operand:HI 1 "s_register_operand" "l,l,r")]
UNSPEC_UNALIGNED_STORE))]
"unaligned_access"
- "strh%?\t%1, %0\t@ unaligned"
- [(set_attr "arch" "t2,any")
- (set_attr "length" "2,4")
- (set_attr "predicable" "yes")
- (set_attr "predicable_short_it" "yes,no")
+ "@
+ strh\t%1, %0\t@ unaligned
+ strh%?\t%1, %0\t@ unaligned
+ strh%?\t%1, %0\t@ unaligned"
+ [(set_attr "arch" "t1,t2,32")
+ (set_attr "length" "2,2,4")
+ (set_attr "predicable" "no,yes,yes")
+ (set_attr "predicable_short_it" "no,yes,no")
(set_attr "type" "store_4")])
diff --git a/gcc/config/arm/arm.opt b/gcc/config/arm/arm.opt
index 9067d491b9c..78f3878e037 100644
--- a/gcc/config/arm/arm.opt
+++ b/gcc/config/arm/arm.opt
@@ -82,7 +82,7 @@ mapcs-stack-check
Target Report Mask(APCS_STACK) Undocumented
march=
-Target RejectNegative ToLower Joined Var(arm_arch_string)
+Target RejectNegative Negative(march=) ToLower Joined Var(arm_arch_string)
Specify the name of the target architecture.
; Other arm_arch values are loaded from arm-tables.opt
@@ -107,7 +107,7 @@ Target Report Mask(CALLER_INTERWORKING)
Thumb: Assume function pointers may go to non-Thumb aware code.
mcpu=
-Target RejectNegative ToLower Joined Var(arm_cpu_string)
+Target RejectNegative Negative(mcpu=) ToLower Joined Var(arm_cpu_string)
Specify the name of the target CPU.
mfloat-abi=
@@ -232,7 +232,7 @@ Target Report Mask(TPCS_LEAF_FRAME)
Thumb: Generate (leaf) stack frames even if not needed.
mtune=
-Target RejectNegative ToLower Joined Var(arm_tune_string)
+Target RejectNegative Negative(mtune=) ToLower Joined Var(arm_tune_string)
Tune code for the given processor.
mprint-tune-info
diff --git a/gcc/config/arm/arm_acle.h b/gcc/config/arm/arm_acle.h
index 2c7acc698ea..6857ab1787d 100644
--- a/gcc/config/arm/arm_acle.h
+++ b/gcc/config/arm/arm_acle.h
@@ -174,8 +174,12 @@ __arm_mrrc2 (const unsigned int __coproc, const unsigned int __opc1,
#endif /* (!__thumb__ || __thumb2__) && __ARM_ARCH >= 4. */
#pragma GCC push_options
-#if __ARM_ARCH >= 8
+#ifdef __ARM_FEATURE_CRC32
+#ifdef __ARM_FP
+#pragma GCC target ("arch=armv8-a+crc+simd")
+#else
#pragma GCC target ("arch=armv8-a+crc")
+#endif
__extension__ static __inline uint32_t __attribute__ ((__always_inline__))
__crc32b (uint32_t __a, uint8_t __b)
@@ -235,7 +239,7 @@ __crc32cd (uint32_t __a, uint64_t __b)
}
#endif
-#endif /* __ARM_ARCH >= 8. */
+#endif /* __ARM_FEATURE_CRC32 */
#pragma GCC pop_options
#ifdef __cplusplus
diff --git a/gcc/config/arm/t-multilib b/gcc/config/arm/t-multilib
index 08526302283..dc97c8f09fb 100644
--- a/gcc/config/arm/t-multilib
+++ b/gcc/config/arm/t-multilib
@@ -24,6 +24,8 @@
# values during the configure step. We enforce this during the
# top-level configury.
+s-mlib: $(srcdir)/config/arm/t-multilib $(srcdir)/config/arm/t-aprofile $(srcdir)/config/arm/t-rmprofile
+
MULTILIB_OPTIONS =
MULTILIB_DIRNAMES =
MULTILIB_EXCEPTIONS =
@@ -63,6 +65,8 @@ all_early_arch := armv5tej armv6 armv6j armv6k armv6z armv6kz \
v7_a_arch_variants := $(call all_feat_combs, mp sec)
v7_a_nosimd_variants := +fp +vfpv3 +vfpv3-d16-fp16 +vfpv3-fp16 +vfpv4-d16 +vfpv4
v7_a_simd_variants := +simd +neon-fp16 +neon-vfpv4
+v7_r_sp_variants := +fp.sp +fp.sp+idiv +vfpv3xd-fp16 +vfpv3xd-fp16+idiv
+v7_r_dp_variants := +fp +fp+idiv +vfpv3-d16-fp16 +vfpv3-d16-fp16+idiv
v7ve_nosimd_variants := +vfpv3-d16 +vfpv3 +vfpv3-d16-fp16 +vfpv3-fp16 +fp +vfpv4
v7ve_vfpv3_simd_variants := +neon +neon-fp16
v7ve_vfpv4_simd_variants := +simd
@@ -86,8 +90,8 @@ SEP := $(and $(HAS_APROFILE),$(HAS_RMPROFILE),/)
MULTILIB_OPTIONS += marm/mthumb
MULTILIB_DIRNAMES += arm thumb
-MULTILIB_OPTIONS += march=armv5te+fp/march=armv7/march=armv7+fp/$(MULTI_ARCH_OPTS_A)$(SEP)$(MULTI_ARCH_OPTS_RM)
-MULTILIB_DIRNAMES += v5te v7 v7+fp $(MULTI_ARCH_DIRS_A) $(MULTI_ARCH_DIRS_RM)
+MULTILIB_OPTIONS += march=armv5te+fp/march=armv7/march=armv7+fp/march=armv7-r+fp.sp/$(MULTI_ARCH_OPTS_A)$(SEP)$(MULTI_ARCH_OPTS_RM)
+MULTILIB_DIRNAMES += v5te v7 v7+fp v7-r+fp.sp $(MULTI_ARCH_DIRS_A) $(MULTI_ARCH_DIRS_RM)
MULTILIB_OPTIONS += mfloat-abi=soft/mfloat-abi=softfp/mfloat-abi=hard
MULTILIB_DIRNAMES += nofp softfp hard
@@ -100,22 +104,31 @@ MULTILIB_REQUIRED += mthumb/march=armv7/mfloat-abi=soft
MULTILIB_REQUIRED += mthumb/march=armv7+fp/mfloat-abi=softfp
MULTILIB_REQUIRED += mthumb/march=armv7+fp/mfloat-abi=hard
-# Map v7-r down onto common v7 code.
+MULTILIB_REQUIRED += mthumb/march=armv7-r+fp.sp/mfloat-abi=softfp
+MULTILIB_REQUIRED += mthumb/march=armv7-r+fp.sp/mfloat-abi=hard
+
+# Map v7-r with double precision down onto common v7 code.
MULTILIB_MATCHES += march?armv7=march?armv7-r
MULTILIB_MATCHES += march?armv7=march?armv7-r+idiv
-MULTILIB_MATCHES += march?armv7+fp=march?armv7-r+fp
-MULTILIB_MATCHES += march?armv7+fp=march?armv7-r+fp+idiv
+MULTILIB_MATCHES += $(foreach ARCH, $(v7_r_dp_variants), \
+ march?armv7+fp=march?armv7-r$(ARCH))
+
+# Map v7-r single precision variants to v7-r with single precision.
+MULTILIB_MATCHES += $(foreach ARCH, \
+ $(filter-out +fp.sp, $(v7_r_sp_variants)), \
+ march?armv7-r+fp.sp=march?armv7-r$(ARCH))
MULTILIB_MATCHES += $(foreach ARCH, $(all_early_arch), \
march?armv5te+fp=march?$(ARCH)+fp)
-# Map v8-r down onto common v7 code.
+# Map v8-r down onto common v7 code or v7-r sp.
MULTILIB_MATCHES += march?armv7=march?armv8-r
MULTILIB_MATCHES += $(foreach ARCH, $(v8_r_nosimd_variants), \
march?armv7=march?armv8-r$(ARCH))
MULTILIB_MATCHES += $(foreach ARCH,+simd +crypto, \
march?armv7+fp=march?armv8-r$(ARCH) \
march?armv7+fp=march?armv8-r+crc$(ARCH))
-
+MULTILIB_MATCHES += march?armv7-r+fp.sp=march?armv8-r+fp.sp
+MULTILIB_MATCHES += march?armv7-r+fp.sp=march?armv8-r+crc+fp.sp
ifeq (,$(HAS_APROFILE))
# Map all v7-a
@@ -177,7 +190,7 @@ MULTILIB_MATCHES += $(foreach ARCH, $(v8_5_a_simd_variants), \
MULTILIB_REUSE += mthumb/march.armv7/mfloat-abi.soft=marm/march.armv7/mfloat-abi.soft
MULTILIB_REUSE += $(foreach ABI, hard softfp, \
- $(foreach ARCH, armv7+fp, \
+ $(foreach ARCH, armv7+fp armv7-r+fp\.sp, \
mthumb/march.$(ARCH)/mfloat-abi.$(ABI)=marm/march.$(ARCH)/mfloat-abi.$(ABI)))
# Softfp but no FP, use the soft-float libraries.
diff --git a/gcc/config/avr/avr.c b/gcc/config/avr/avr.c
index a9f72b314c2..cb4b14ae379 100644
--- a/gcc/config/avr/avr.c
+++ b/gcc/config/avr/avr.c
@@ -3797,13 +3797,14 @@ avr_out_lpm (rtx_insn *insn, rtx *op, int *plen)
gcc_unreachable();
case 1:
- return avr_asm_len ("%4lpm %0,%a2", xop, plen, 1);
+ avr_asm_len ("%4lpm %0,%a2", xop, plen, 1);
+ break;
case 2:
if (REGNO (dest) == REG_Z)
- return avr_asm_len ("%4lpm %5,%a2+" CR_TAB
- "%4lpm %B0,%a2" CR_TAB
- "mov %A0,%5", xop, plen, 3);
+ avr_asm_len ("%4lpm %5,%a2+" CR_TAB
+ "%4lpm %B0,%a2" CR_TAB
+ "mov %A0,%5", xop, plen, 3);
else
{
avr_asm_len ("%4lpm %A0,%a2+" CR_TAB
@@ -3832,9 +3833,9 @@ avr_out_lpm (rtx_insn *insn, rtx *op, int *plen)
"%4lpm %B0,%a2+", xop, plen, 2);
if (REGNO (dest) == REG_Z - 2)
- return avr_asm_len ("%4lpm %5,%a2+" CR_TAB
- "%4lpm %C0,%a2" CR_TAB
- "mov %D0,%5", xop, plen, 3);
+ avr_asm_len ("%4lpm %5,%a2+" CR_TAB
+ "%4lpm %C0,%a2" CR_TAB
+ "mov %D0,%5", xop, plen, 3);
else
{
avr_asm_len ("%4lpm %C0,%a2+" CR_TAB
diff --git a/gcc/config/darwin-driver.c b/gcc/config/darwin-driver.c
index 3d85f29cb3d..b3577c416bc 100644
--- a/gcc/config/darwin-driver.c
+++ b/gcc/config/darwin-driver.c
@@ -210,6 +210,28 @@ darwin_default_min_version (void)
return new_flag;
}
+/* See if we can find the sysroot from the SDKROOT environment variable. */
+
+static const char *
+maybe_get_sysroot_from_sdkroot ()
+{
+ const char *maybe_sysroot = getenv ("SDKROOT");
+
+ /* We'll use the same rules as the clang driver, for compatibility.
+ 1) The path must be absolute
+ 2) Ignore "/", that is the default anyway and we do not want the
+ sysroot semantics to be applied to it.
+ 3) It must exist (actually, we'll check it's readable too). */
+
+ if (maybe_sysroot == NULL
+ || *maybe_sysroot != '/'
+ || strlen (maybe_sysroot) == 1
+ || access (maybe_sysroot, R_OK) == -1)
+ return NULL;
+
+ return xstrndup (maybe_sysroot, strlen (maybe_sysroot));
+}
+
/* Translate -filelist and -framework options in *DECODED_OPTIONS
(size *DECODED_OPTIONS_COUNT) to use -Xlinker so that they are
considered to be linker inputs in the case that no other inputs are
@@ -234,6 +256,7 @@ darwin_driver_init (unsigned int *decoded_options_count,
bool appendM64 = false;
const char *vers_string = NULL;
bool seen_version_min = false;
+ bool seen_sysroot_p = false;
for (i = 1; i < *decoded_options_count; i++)
{
@@ -314,6 +337,11 @@ darwin_driver_init (unsigned int *decoded_options_count,
--*decoded_options_count;
break;
+ case OPT__sysroot_:
+ case OPT_isysroot:
+ seen_sysroot_p = true;
+ break;
+
default:
break;
}
@@ -375,6 +403,22 @@ darwin_driver_init (unsigned int *decoded_options_count,
&(*decoded_options)[*decoded_options_count - 1]);
}
+ if (! seen_sysroot_p)
+ {
+ /* We will pick up an SDKROOT if we didn't specify a sysroot and treat
+ it as overriding any configure-time --with-sysroot. */
+ const char *sdkroot = maybe_get_sysroot_from_sdkroot ();
+ if (sdkroot)
+ {
+ ++*decoded_options_count;
+ *decoded_options = XRESIZEVEC (struct cl_decoded_option,
+ *decoded_options,
+ *decoded_options_count);
+ generate_option (OPT__sysroot_, sdkroot, 1, CL_DRIVER,
+ &(*decoded_options)[*decoded_options_count - 1]);
+ }
+ }
+
/* We will need to know the OS X version we're trying to build for here
so that we can figure out the mechanism and source for the sysroot to
be used. */
diff --git a/gcc/config/darwin-protos.h b/gcc/config/darwin-protos.h
index e5614b627d7..afeca81f807 100644
--- a/gcc/config/darwin-protos.h
+++ b/gcc/config/darwin-protos.h
@@ -53,8 +53,6 @@ extern void darwin_set_default_type_attributes (tree);
#endif /* TREE_CODE */
-extern void machopic_finish (FILE *);
-
extern int machopic_reloc_rw_mask (void);
extern section *machopic_select_section (tree, int, unsigned HOST_WIDE_INT);
diff --git a/gcc/config/darwin.c b/gcc/config/darwin.c
index b9862353843..a7610829f75 100644
--- a/gcc/config/darwin.c
+++ b/gcc/config/darwin.c
@@ -75,15 +75,9 @@ along with GCC; see the file COPYING3. If not see
setting the second word in the .non_lazy_symbol_pointer data
structure to symbol. See indirect_data for the code that handles
the extra indirection, and machopic_output_indirection and its use
- of MACHO_SYMBOL_STATIC for the code that handles @code{static}
+ of MACHO_SYMBOL_FLAG_STATIC for the code that handles @code{static}
symbol indirection. */
-/* For darwin >= 9 (OSX 10.5) the linker is capable of making the necessary
- branch islands and we no longer need to emit darwin stubs.
- However, if we are generating code for earlier systems (or for use in the
- kernel) the stubs might still be required, and this will be set true. */
-int darwin_emit_branch_islands = false;
-
typedef struct GTY(()) cdtor_record {
rtx symbol;
int priority; /* [con/de]structor priority */
@@ -105,6 +99,10 @@ int generating_for_darwin_version ;
for weak or single-definition items. */
static bool ld_uses_coal_sects = false;
+/* Very old (ld_classic) linkers need a symbol to mark the start of
+ each FDE. */
+static bool ld_needs_eh_markers = false;
+
/* Section names. */
section * darwin_sections[NUM_DARWIN_SECTIONS];
@@ -250,7 +248,7 @@ name_needs_quotes (const char *name)
int
machopic_symbol_defined_p (rtx sym_ref)
{
- if (SYMBOL_REF_FLAGS (sym_ref) & MACHO_SYMBOL_FLAG_DEFINED)
+ if (MACHO_SYMBOL_DEFINED_P (sym_ref))
return true;
/* If a symbol references local and is not an extern to this
@@ -259,7 +257,7 @@ machopic_symbol_defined_p (rtx sym_ref)
{
/* If the symbol references a variable and the variable is a
common symbol, then this symbol is not defined. */
- if (SYMBOL_REF_FLAGS (sym_ref) & MACHO_SYMBOL_FLAG_VARIABLE)
+ if (MACHO_SYMBOL_VARIABLE_P (sym_ref))
{
tree decl = SYMBOL_REF_DECL (sym_ref);
if (!decl)
@@ -455,6 +453,13 @@ typedef struct GTY ((for_user)) machopic_indirection
bool stub_p;
/* True iff this stub or pointer has been referenced. */
bool used;
+ /* True iff a non-lazy symbol pointer should be emitted into the .data
+ section, rather than the non-lazy symbol pointers section. The cases
+ for which this occurred seem to have been unintentional, and later
+ toolchains emit all of the indirections to the 'usual' section. We
+ are keeping this in case it is necessary to preserve compatibility with
+ older toolchains. */
+ bool nlsp_in_data_section;
} machopic_indirection;
struct indirection_hasher : ggc_ptr_hash<machopic_indirection>
@@ -489,7 +494,7 @@ indirection_hasher::equal (machopic_indirection *s, const char *k)
/* Return the name of the non-lazy pointer (if STUB_P is false) or
stub (if STUB_B is true) corresponding to the given name.
- If we have a situation like:
+ PR71767 - If we have a situation like:
global_weak_symbol:
....
@@ -498,36 +503,22 @@ Lnon_weak_local:
ld64 will be unable to split this into two atoms (because the "L" makes
the second symbol 'invisible'). This means that legitimate direct accesses
- to the second symbol will appear to be non-allowed direct accesses to an
- atom of type weak, global which are not allowed.
-
- To avoid this, we make the indirections have a leading 'l' (lower-case L)
- which has a special meaning: linker can see this and use it to determine
- atoms, but it is not placed into the final symbol table.
+ to the second symbol will appear to be direct accesses to an atom of type
+ weak, global which are not allowed.
- The implementation here is somewhat heavy-handed in that it will also mark
- indirections to the __IMPORT,__pointers section the same way which is
- really unnecessary, since ld64 _can_ split those into atoms as they are
- fixed size. FIXME: determine if this is a penalty worth extra code to
- fix.
+ To avoid this, we make any data-section indirections have a leading 'l'
+ (lower-case L) which has a special meaning: linker can see this and use
+ it to determine atoms, but it is not placed into the final symbol table.
+ Symbols in the non-lazy symbol pointers section (or stubs) do not have this
+ problem because ld64 already knows the size of each entry.
*/
const char *
machopic_indirection_name (rtx sym_ref, bool stub_p)
{
- char *buffer;
const char *name = XSTR (sym_ref, 0);
- size_t namelen = strlen (name);
- machopic_indirection *p;
- bool needs_quotes;
- const char *suffix;
- char L_or_l = 'L';
- const char *prefix = user_label_prefix;
- const char *quote = "";
- tree id;
-
- id = maybe_get_identifier (name);
+ tree id = maybe_get_identifier (name);
if (id)
{
tree id_orig = id;
@@ -535,43 +526,47 @@ machopic_indirection_name (rtx sym_ref, bool stub_p)
while (IDENTIFIER_TRANSPARENT_ALIAS (id))
id = TREE_CHAIN (id);
if (id != id_orig)
- {
- name = IDENTIFIER_POINTER (id);
- namelen = strlen (name);
- }
+ name = IDENTIFIER_POINTER (id);
}
+ const char *prefix = user_label_prefix;
+ /* If we are emitting the label 'verbatim' then omit the U_L_P and count
+ the name without the leading '*'. */
if (name[0] == '*')
{
prefix = "";
++name;
- --namelen;
- }
-
- needs_quotes = name_needs_quotes (name);
- if (needs_quotes)
- {
- quote = "\"";
}
- if (stub_p)
- suffix = STUB_SUFFIX;
- else
- {
- suffix = NON_LAZY_POINTER_SUFFIX;
- /* Let the linker see this. */
- L_or_l = 'l';
- }
-
- buffer = XALLOCAVEC (char, 2 /* strlen ("&L") or ("&l") */
- + strlen (prefix)
- + namelen
- + strlen (suffix)
- + 2 * strlen (quote)
- + 1 /* '\0' */);
+ /* Here we are undoing a number of causes that placed some indirections
+ (apparently erroneously) into the .data section. Specifically, some
+ symbols that are ABI mandated indirections and some hidden symbols
+ were being placed there - which cause difficulties with later
+ versions of ld64. Iff (after these checks) some symbol still gets an
+ indirection in the data section, we want to adjust the indirection
+ name to be linker visible to deal with PR71767 (notes above). */
+ bool nlsp_in_data_section =
+ ! MACHO_SYMBOL_MUST_INDIRECT_P (sym_ref)
+ && ! MACHO_SYMBOL_HIDDEN_VIS_P (sym_ref)
+ && (machopic_symbol_defined_p (sym_ref) || SYMBOL_REF_LOCAL_P (sym_ref))
+ && ! indirect_data (sym_ref);
+
+ const char *suffix = stub_p ? STUB_SUFFIX : NON_LAZY_POINTER_SUFFIX;
+ /* If the indirection is in the data section, let the linker see it. */
+ char L_or_l = (!stub_p && nlsp_in_data_section) ? 'l' : 'L';
+ /* We have mangled symbols with spaces and punctuation which typically
+ need surrounding in quotes for the assembler to consume them. */
+ const char *quote = name_needs_quotes (name) ? "\"" : "";
+ char *buffer = XALLOCAVEC (char, 2 /* strlen ("&L") or ("&l") */
+ + strlen (prefix)
+ + strlen (name)
+ + strlen (suffix)
+ + 2 * strlen (quote)
+ + 1 /* '\0' */);
/* Construct the name of the non-lazy pointer or stub. */
- sprintf (buffer, "&%s%c%s%s%s%s", quote, L_or_l, prefix, name, suffix, quote);
+ sprintf (buffer, "&%s%c%s%s%s%s", quote, L_or_l, prefix, name,
+ suffix, quote);
if (!machopic_indirections)
machopic_indirections = hash_table<indirection_hasher>::create_ggc (37);
@@ -580,10 +575,9 @@ machopic_indirection_name (rtx sym_ref, bool stub_p)
= machopic_indirections->find_slot_with_hash (buffer,
htab_hash_string (buffer),
INSERT);
+ machopic_indirection *p;
if (*slot)
- {
- p = *slot;
- }
+ p = *slot;
else
{
p = ggc_alloc<machopic_indirection> ();
@@ -591,6 +585,7 @@ machopic_indirection_name (rtx sym_ref, bool stub_p)
p->ptr_name = xstrdup (buffer);
p->stub_p = stub_p;
p->used = false;
+ p->nlsp_in_data_section = nlsp_in_data_section;
*slot = p;
}
@@ -666,7 +661,7 @@ machopic_indirect_data_reference (rtx orig, rtx reg)
/* some other cpu -- writeme! */
gcc_unreachable ();
}
- else if (defined)
+ else if (defined && ! MACHO_SYMBOL_MUST_INDIRECT_P (orig))
{
rtx offset = NULL;
if (DARWIN_PPC || HAVE_lo_sum)
@@ -708,6 +703,7 @@ machopic_indirect_data_reference (rtx orig, rtx reg)
machopic_indirection_name (orig, /*stub_p=*/false)));
SYMBOL_REF_DATA (ptr_ref) = SYMBOL_REF_DATA (orig);
+ SYMBOL_REF_FLAGS (ptr_ref) |= MACHO_SYMBOL_FLAG_INDIRECTION;
ptr_ref = gen_const_mem (Pmode, ptr_ref);
machopic_define_symbol (ptr_ref);
@@ -790,7 +786,7 @@ machopic_indirect_data_reference (rtx orig, rtx reg)
rtx
machopic_indirect_call_target (rtx target)
{
- if (! darwin_emit_branch_islands)
+ if (! darwin_symbol_stubs)
return target;
if (GET_CODE (target) != MEM)
@@ -798,8 +794,7 @@ machopic_indirect_call_target (rtx target)
if (MACHOPIC_INDIRECT
&& GET_CODE (XEXP (target, 0)) == SYMBOL_REF
- && !(SYMBOL_REF_FLAGS (XEXP (target, 0))
- & MACHO_SYMBOL_FLAG_DEFINED))
+ && ! MACHO_SYMBOL_DEFINED_P (XEXP (target, 0)))
{
rtx sym_ref = XEXP (target, 0);
const char *stub_name = machopic_indirection_name (sym_ref,
@@ -808,6 +803,7 @@ machopic_indirect_call_target (rtx target)
XEXP (target, 0) = gen_rtx_SYMBOL_REF (mode, stub_name);
SYMBOL_REF_DATA (XEXP (target, 0)) = SYMBOL_REF_DATA (sym_ref);
+ SYMBOL_REF_FLAGS (XEXP (target, 0)) |= MACHO_SYMBOL_FLAG_INDIRECTION;
MEM_READONLY_P (target) = 1;
MEM_NOTRAP_P (target) = 1;
}
@@ -844,7 +840,7 @@ machopic_legitimize_pic_address (rtx orig, machine_mode mode, rtx reg)
{
if (reg == 0)
{
- gcc_assert (!reload_in_progress);
+ gcc_assert (!lra_in_progress);
reg = gen_reg_rtx (Pmode);
}
@@ -928,7 +924,7 @@ machopic_legitimize_pic_address (rtx orig, machine_mode mode, rtx reg)
emit_use (gen_rtx_REG (Pmode, PIC_OFFSET_TABLE_REGNUM));
#endif
- if (reload_in_progress)
+ if (lra_in_progress)
df_set_regs_ever_live (REGNO (pic), true);
pic_ref = gen_rtx_PLUS (Pmode, pic,
machopic_gen_offset (XEXP (orig, 0)));
@@ -952,7 +948,7 @@ machopic_legitimize_pic_address (rtx orig, machine_mode mode, rtx reg)
if (reg == 0)
{
- gcc_assert (!reload_in_progress);
+ gcc_assert (!lra_in_progress);
reg = gen_reg_rtx (Pmode);
}
@@ -998,7 +994,7 @@ machopic_legitimize_pic_address (rtx orig, machine_mode mode, rtx reg)
#if 0
emit_use (pic_offset_table_rtx);
#endif
- if (reload_in_progress)
+ if (lra_in_progress)
df_set_regs_ever_live (REGNO (pic), true);
pic_ref = gen_rtx_PLUS (Pmode,
pic,
@@ -1069,129 +1065,160 @@ machopic_legitimize_pic_address (rtx orig, machine_mode mode, rtx reg)
return pic_ref;
}
-/* Output the stub or non-lazy pointer in *SLOT, if it has been used.
- DATA is the FILE* for assembly output. Called from
- htab_traverse. */
+/* Callbacks to output the stub or non-lazy pointers.
+ Each works on the item in *SLOT,if it has been used.
+ DATA is the FILE* for assembly output.
+ Called from htab_traverses, invoked from machopic_finish(). */
int
-machopic_output_indirection (machopic_indirection **slot, FILE *asm_out_file)
+machopic_output_data_section_indirection (machopic_indirection **slot,
+ FILE *asm_out_file)
{
machopic_indirection *p = *slot;
- rtx symbol;
- const char *sym_name;
- const char *ptr_name;
- if (!p->used)
+ if (!p->used || !p->nlsp_in_data_section)
return 1;
- symbol = p->symbol;
- sym_name = XSTR (symbol, 0);
- ptr_name = p->ptr_name;
+ rtx symbol = p->symbol;
+ /* The original symbol name. */
+ const char *sym_name = XSTR (symbol, 0);
+ /* The name of the indirection symbol. */
+ const char *ptr_name = p->ptr_name;
- if (p->stub_p)
- {
- char *sym;
- char *stub;
- tree id;
+ switch_to_section (data_section);
+ assemble_align (GET_MODE_ALIGNMENT (Pmode));
+ assemble_label (asm_out_file, ptr_name);
+ assemble_integer (gen_rtx_SYMBOL_REF (Pmode, sym_name),
+ GET_MODE_SIZE (Pmode),
+ GET_MODE_ALIGNMENT (Pmode), 1);
- id = maybe_get_identifier (sym_name);
- if (id)
- {
- tree id_orig = id;
+ return 1;
+}
- while (IDENTIFIER_TRANSPARENT_ALIAS (id))
- id = TREE_CHAIN (id);
- if (id != id_orig)
- sym_name = IDENTIFIER_POINTER (id);
- }
+int
+machopic_output_stub_indirection (machopic_indirection **slot,
+ FILE *asm_out_file)
+{
+ machopic_indirection *p = *slot;
- sym = XALLOCAVEC (char, strlen (sym_name) + 2);
- if (sym_name[0] == '*' || sym_name[0] == '&')
- strcpy (sym, sym_name + 1);
- else if (sym_name[0] == '-' || sym_name[0] == '+')
- strcpy (sym, sym_name);
- else
- sprintf (sym, "%s%s", user_label_prefix, sym_name);
+ if (!p->used || !p->stub_p)
+ return 1;
- stub = XALLOCAVEC (char, strlen (ptr_name) + 2);
- if (ptr_name[0] == '*' || ptr_name[0] == '&')
- strcpy (stub, ptr_name + 1);
- else
- sprintf (stub, "%s%s", user_label_prefix, ptr_name);
+ rtx symbol = p->symbol;
+ /* The original symbol name. */
+ const char *sym_name = XSTR (symbol, 0);
+ /* The name of the stub symbol. */
+ const char *ptr_name = p->ptr_name;
- machopic_output_stub (asm_out_file, sym, stub);
- }
- else if (! indirect_data (symbol)
- && (machopic_symbol_defined_p (symbol)
- || SYMBOL_REF_LOCAL_P (symbol)))
+ tree id = maybe_get_identifier (sym_name);
+ if (id)
{
- switch_to_section (data_section);
- assemble_align (GET_MODE_ALIGNMENT (Pmode));
- assemble_label (asm_out_file, ptr_name);
- assemble_integer (gen_rtx_SYMBOL_REF (Pmode, sym_name),
- GET_MODE_SIZE (Pmode),
- GET_MODE_ALIGNMENT (Pmode), 1);
+ tree id_orig = id;
+
+ while (IDENTIFIER_TRANSPARENT_ALIAS (id))
+ id = TREE_CHAIN (id);
+ if (id != id_orig)
+ sym_name = IDENTIFIER_POINTER (id);
}
+
+ char *sym = XALLOCAVEC (char, strlen (sym_name) + 2);
+ if (sym_name[0] == '*' || sym_name[0] == '&')
+ strcpy (sym, sym_name + 1);
+ else if (sym_name[0] == '-' || sym_name[0] == '+')
+ strcpy (sym, sym_name);
else
- {
- rtx init = const0_rtx;
+ sprintf (sym, "%s%s", user_label_prefix, sym_name);
+
+ char *stub = XALLOCAVEC (char, strlen (ptr_name) + 2);
+ if (ptr_name[0] == '*' || ptr_name[0] == '&')
+ strcpy (stub, ptr_name + 1);
+ else
+ sprintf (stub, "%s%s", user_label_prefix, ptr_name);
- switch_to_section (darwin_sections[machopic_nl_symbol_ptr_section]);
+ machopic_output_stub (asm_out_file, sym, stub);
- /* Mach-O symbols are passed around in code through indirect
- references and the original symbol_ref hasn't passed through
- the generic handling and reference-catching in
- output_operand, so we need to manually mark weak references
- as such. */
- if (SYMBOL_REF_WEAK (symbol))
+ return 1;
+}
+
+int
+machopic_output_indirection (machopic_indirection **slot, FILE *asm_out_file)
+{
+ machopic_indirection *p = *slot;
+
+ if (!p->used || p->stub_p || p->nlsp_in_data_section)
+ return 1;
+
+ rtx symbol = p->symbol;
+ /* The original symbol name. */
+ const char *sym_name = XSTR (symbol, 0);
+ /* The nonlazy-stub symbol name. */
+ const char *ptr_name = p->ptr_name;
+
+ switch_to_section (darwin_sections[machopic_nl_symbol_ptr_section]);
+
+ /* Mach-O symbols are passed around in code through indirect references and
+ the original symbol_ref hasn't passed through the generic handling and
+ reference-catching in output_operand, so we need to manually mark weak
+ references as such. */
+
+ if (SYMBOL_REF_WEAK (symbol))
+ {
+ tree decl = SYMBOL_REF_DECL (symbol);
+ gcc_checking_assert (DECL_P (decl));
+
+ if (decl != NULL_TREE
+ && DECL_EXTERNAL (decl) && TREE_PUBLIC (decl)
+ /* Handle only actual external-only definitions, not
+ e.g. extern inline code or variables for which
+ storage has been allocated. */
+ && !TREE_STATIC (decl))
{
- tree decl = SYMBOL_REF_DECL (symbol);
- gcc_assert (DECL_P (decl));
-
- if (decl != NULL_TREE
- && DECL_EXTERNAL (decl) && TREE_PUBLIC (decl)
- /* Handle only actual external-only definitions, not
- e.g. extern inline code or variables for which
- storage has been allocated. */
- && !TREE_STATIC (decl))
- {
- fputs ("\t.weak_reference ", asm_out_file);
- assemble_name (asm_out_file, sym_name);
- fputc ('\n', asm_out_file);
- }
+ fputs ("\t.weak_reference ", asm_out_file);
+ assemble_name (asm_out_file, sym_name);
+ fputc ('\n', asm_out_file);
}
+ }
- assemble_name (asm_out_file, ptr_name);
- fprintf (asm_out_file, ":\n");
+ assemble_name (asm_out_file, ptr_name);
+ fprintf (asm_out_file, ":\n");
- fprintf (asm_out_file, "\t.indirect_symbol ");
- assemble_name (asm_out_file, sym_name);
- fprintf (asm_out_file, "\n");
+ fprintf (asm_out_file, "\t.indirect_symbol ");
+ assemble_name (asm_out_file, sym_name);
+ fprintf (asm_out_file, "\n");
- /* Variables that are marked with MACHO_SYMBOL_STATIC need to
- have their symbol name instead of 0 in the second entry of
- the non-lazy symbol pointer data structure when they are
- defined. This allows the runtime to rebind newer instances
- of the translation unit with the original instance of the
- symbol. */
+ /* Variables that are marked with MACHO_SYMBOL_FLAG_STATIC need to
+ have their symbol name instead of 0 in the second entry of
+ the non-lazy symbol pointer data structure when they are
+ defined. This allows the runtime to rebind newer instances
+ of the translation unit with the original instance of the
+ symbol. */
- if ((SYMBOL_REF_FLAGS (symbol) & MACHO_SYMBOL_STATIC)
- && machopic_symbol_defined_p (symbol))
- init = gen_rtx_SYMBOL_REF (Pmode, sym_name);
+ rtx init = const0_rtx;
+ if (MACHO_SYMBOL_STATIC_P (symbol) && machopic_symbol_defined_p (symbol))
+ init = gen_rtx_SYMBOL_REF (Pmode, sym_name);
- assemble_integer (init, GET_MODE_SIZE (Pmode),
- GET_MODE_ALIGNMENT (Pmode), 1);
- }
+ assemble_integer (init, GET_MODE_SIZE (Pmode),
+ GET_MODE_ALIGNMENT (Pmode), 1);
return 1;
}
-void
+static void
machopic_finish (FILE *asm_out_file)
{
- if (machopic_indirections)
- machopic_indirections
- ->traverse_noresize<FILE *, machopic_output_indirection> (asm_out_file);
+ if (!machopic_indirections)
+ return;
+
+ /* First output an symbol indirections that have been placed into .data
+ (we don't expect these now). */
+ machopic_indirections->traverse_noresize
+ <FILE *, machopic_output_data_section_indirection> (asm_out_file);
+
+ machopic_indirections->traverse_noresize
+ <FILE *, machopic_output_stub_indirection> (asm_out_file);
+
+ machopic_indirections->traverse_noresize
+ <FILE *, machopic_output_indirection> (asm_out_file);
}
int
@@ -1206,25 +1233,51 @@ machopic_operand_p (rtx op)
&& XINT (XEXP (op, 0), 1) == UNSPEC_MACHOPIC_OFFSET);
}
-/* This function records whether a given name corresponds to a defined
- or undefined function or variable, for machopic_classify_ident to
- use later. */
+/* This function:
+ computes and caches a series of flags that characterise the symbol's
+ properties that affect Mach-O code gen (including accidental cases
+ from older toolchains).
+
+ TODO:
+ Here we also need to do enough analysis to determine if a symbol's
+ name needs to be made linker-visible. This is more tricky - since
+ it depends on whether we've previously seen a global weak definition
+ in the same section.
+ */
void
-darwin_encode_section_info (tree decl, rtx rtl, int first ATTRIBUTE_UNUSED)
+darwin_encode_section_info (tree decl, rtx rtl, int first)
{
- rtx sym_ref;
+ /* Careful not to prod global register variables. */
+ if (!MEM_P (rtl))
+ return;
- /* Do the standard encoding things first. */
+ /* Do the standard encoding things first; this sets:
+ SYMBOL_FLAG_FUNCTION,
+ SYMBOL_FLAG_LOCAL, (binds_local_p)
+ TLS_MODEL, SYMBOL_FLAG_SMALL
+ SYMBOL_FLAG_EXTERNAL. */
default_encode_section_info (decl, rtl, first);
- if (TREE_CODE (decl) != FUNCTION_DECL && TREE_CODE (decl) != VAR_DECL)
+ if (! VAR_OR_FUNCTION_DECL_P (decl))
return;
- sym_ref = XEXP (rtl, 0);
- if (TREE_CODE (decl) == VAR_DECL)
+ rtx sym_ref = XEXP (rtl, 0);
+ if (VAR_P (decl))
SYMBOL_REF_FLAGS (sym_ref) |= MACHO_SYMBOL_FLAG_VARIABLE;
+ /* Only really common if there's no initialiser. */
+ bool really_common_p = (DECL_COMMON (decl)
+ && (DECL_INITIAL (decl) == NULL
+ || (!in_lto_p
+ && DECL_INITIAL (decl) == error_mark_node)));
+
+ /* For Darwin, if we have specified visibility and it's not the default
+ that's counted 'hidden'. */
+ if (DECL_VISIBILITY_SPECIFIED (decl)
+ && DECL_VISIBILITY (decl) != VISIBILITY_DEFAULT)
+ SYMBOL_REF_FLAGS (sym_ref) |= MACHO_SYMBOL_FLAG_HIDDEN_VIS;
+
if (!DECL_EXTERNAL (decl)
&& (!TREE_PUBLIC (decl) || !DECL_WEAK (decl))
&& ! lookup_attribute ("weakref", DECL_ATTRIBUTES (decl))
@@ -1235,7 +1288,13 @@ darwin_encode_section_info (tree decl, rtx rtl, int first ATTRIBUTE_UNUSED)
SYMBOL_REF_FLAGS (sym_ref) |= MACHO_SYMBOL_FLAG_DEFINED;
if (! TREE_PUBLIC (decl))
- SYMBOL_REF_FLAGS (sym_ref) |= MACHO_SYMBOL_STATIC;
+ SYMBOL_REF_FLAGS (sym_ref) |= MACHO_SYMBOL_FLAG_STATIC;
+
+ /* Short cut check for Darwin 'must indirect' rules. */
+ if (really_common_p
+ || (DECL_WEAK (decl) && ! MACHO_SYMBOL_HIDDEN_VIS_P (sym_ref))
+ || lookup_attribute ("weakref", DECL_ATTRIBUTES (decl)))
+ SYMBOL_REF_FLAGS (sym_ref) |= MACHO_SYMBOL_FLAG_MUST_INDIRECT;
}
void
@@ -1252,12 +1311,13 @@ darwin_mark_decl_preserved (const char *name)
}
static section *
-darwin_rodata_section (int use_coal, bool zsize)
+darwin_rodata_section (int use_coal, bool zsize, int reloc)
{
return (use_coal
? darwin_sections[const_coal_section]
: (zsize ? darwin_sections[zobj_const_section]
- : darwin_sections[const_section]));
+ : reloc ? darwin_sections[const_data_section]
+ : darwin_sections[const_section]));
}
static section *
@@ -1550,7 +1610,7 @@ machopic_select_section (tree decl,
case SECCAT_RODATA:
case SECCAT_SRODATA:
- base_section = darwin_rodata_section (use_coal, zsize);
+ base_section = darwin_rodata_section (use_coal, zsize, reloc);
break;
case SECCAT_RODATA_MERGE_STR:
@@ -2086,11 +2146,11 @@ darwin_emit_unwind_label (FILE *file, tree decl, int for_eh, int empty)
static int invok_count = 0;
static tree last_fun_decl = NULL_TREE;
- /* We use the linker to emit the .eh labels for Darwin 9 and above. */
- if (! for_eh || generating_for_darwin_version >= 9)
+ /* Modern linkers can produce distinct FDEs without compiler support. */
+ if (! for_eh || ! ld_needs_eh_markers)
return;
- /* FIXME: This only works when the eh for all sections of a function is
+ /* FIXME: This only works when the eh for all sections of a function are
emitted at the same time. If that changes, we would need to use a lookup
table of some form to determine what to do. Also, we should emit the
unadorned label for the partition containing the public label for a
@@ -3148,17 +3208,19 @@ darwin_override_options (void)
: (generating_for_darwin_version >= 9) ? 1
: 0);
- /* Objective-C family ABI 2 is only valid for next/m64 at present. */
if (global_options_set.x_flag_objc_abi && flag_next_runtime)
{
- if (TARGET_64BIT && global_options.x_flag_objc_abi < 2)
- error_at (UNKNOWN_LOCATION, "%<-fobjc-abi-version%> >= 2 must be"
- " used for %<-m64%> targets with"
- " %<-fnext-runtime%>");
- if (!TARGET_64BIT && global_options.x_flag_objc_abi >= 2)
- error_at (UNKNOWN_LOCATION, "%<-fobjc-abi-version%> >= 2 is not"
- " supported on %<-m32%> targets with"
- " %<-fnext-runtime%>");
+ if (TARGET_64BIT && global_options.x_flag_objc_abi != 2)
+ /* The Objective-C family ABI 2 is the only valid version NeXT/m64. */
+ error_at (UNKNOWN_LOCATION,
+ "%<-fobjc-abi-version%> 2 must be used for 64 bit targets"
+ " with %<-fnext-runtime%>");
+ else if (!TARGET_64BIT && global_options.x_flag_objc_abi >= 2)
+ /* ABI versions 0 and 1 are the only valid versions NeXT/m32. */
+ error_at (UNKNOWN_LOCATION,
+ "%<-fobjc-abi-version%> %d is not supported for 32 bit"
+ " targets with %<-fnext-runtime%>",
+ global_options.x_flag_objc_abi);
}
/* Don't emit DWARF3/4 unless specifically selected. This is a
@@ -3261,11 +3323,44 @@ darwin_override_options (void)
flag_pic = 2;
}
- /* It is assumed that branch island stubs are needed for earlier systems. */
- if (generating_for_darwin_version < 9)
- darwin_emit_branch_islands = true;
- else
- emit_aligned_common = true; /* Later systems can support aligned common. */
+ /* Linkers >= ld64-62.1 (at least) are capable of making the necessary PIC
+ indirections and we no longer need to emit pic symbol stubs.
+ However, if we are generating code for earlier ones (or for use in the
+ kernel) the stubs might still be required, and this will be set true.
+ If the user sets it on or off - then that takes precedence.
+
+ Linkers that don't need stubs, don't need the EH symbol markers either.
+ */
+
+ if (!global_options_set.x_darwin_symbol_stubs)
+ {
+ if (darwin_target_linker)
+ {
+ if (strverscmp (darwin_target_linker, MIN_LD64_OMIT_STUBS) < 0)
+ {
+ darwin_symbol_stubs = true;
+ ld_needs_eh_markers = true;
+ }
+ }
+ else if (generating_for_darwin_version < 9)
+ {
+ /* If we don't know the linker version and we're targeting an old
+ system, we know no better than to assume the use of an earlier
+ linker. */
+ darwin_symbol_stubs = true;
+ ld_needs_eh_markers = true;
+ }
+ }
+ else if (DARWIN_X86 && darwin_symbol_stubs && TARGET_64BIT)
+ {
+ inform (input_location,
+ "%<-msymbol-stubs%> is not required for 64b code (ignored)");
+ darwin_symbol_stubs = false;
+ }
+
+ if (generating_for_darwin_version >= 9)
+ /* Later systems can support aligned common. */
+ emit_aligned_common = true;
/* The c_dialect...() macros are not available to us here. */
darwin_running_cxx = (strstr (lang_hooks.name, "C++") != 0);
diff --git a/gcc/config/darwin.h b/gcc/config/darwin.h
index 0e253cb0dfa..be261e73a7b 100644
--- a/gcc/config/darwin.h
+++ b/gcc/config/darwin.h
@@ -126,6 +126,24 @@ extern GTY(()) int darwin_ms_struct;
"%{gsplit-dwarf:%ngsplit-dwarf is not supported on this platform} \
%<gsplit-dwarf"
+#if LD64_HAS_EXPORT_DYNAMIC
+#define DARWIN_RDYNAMIC "%{rdynamic:-export_dynamic}"
+#else
+#define DARWIN_RDYNAMIC "%{rdynamic:%nrdynamic is not supported}"
+#endif
+
+/* FIXME: we should check that the linker supports the -pie and -no_pie.
+ options. */
+#define DARWIN_PIE_SPEC \
+"%{pie|fpie|fPIE:\
+ %{mdynamic-no-pic: \
+ %n'-mdynamic-no-pic' overrides '-pie', '-fpie' or '-fPIE'; \
+ :%:version-compare(>= 10.5 mmacosx-version-min= -pie) }} "
+
+#define DARWIN_NOPIE_SPEC \
+"%{no-pie|fno-pie|fno-PIE: \
+ %:version-compare(>= 10.7 mmacosx-version-min= -no_pie) }"
+
#define DARWIN_CC1_SPEC \
"%{findirect-virtual-calls: -fapple-kext} %<findirect-virtual-calls " \
"%{fterminated-vtables: -fapple-kext} %<fterminated-vtables " \
@@ -156,20 +174,31 @@ extern GTY(()) int darwin_ms_struct;
#define CPP_SPEC "%{static:%{!dynamic:-D__STATIC__}}%{!static:-D__DYNAMIC__}" \
" %{pthread:-D_REENTRANT}"
-/* This is mostly a clone of the standard LINK_COMMAND_SPEC, plus
- precomp, libtool, and fat build additions.
+/* This is a fix for PR41260 by passing -no_compact_unwind on darwin10 and
+ later until the assembler, linker and libunwind are able to deal with the
+ output from GCC.
+
+ FIXME: we should check that the linker supports the option.
+*/
+
+#define DARWIN_NOCOMPACT_UNWIND \
+" %:version-compare(>= 10.6 mmacosx-version-min= -no_compact_unwind) "
+
+/* In Darwin linker specs we can put -lcrt0.o and ld will search the library
+ path for crt0.o or -lcrtx.a and it will search for for libcrtx.a. As for
+ other ports, we can also put xxx.{o,a}%s and get the appropriate complete
+ startfile absolute directory. This latter point is important when we want
+ to override ld's rule of .dylib being found ahead of .a and the user wants
+ the convenience library to be linked. */
+
+/* The LINK_COMMAND spec is mostly a clone of the standard LINK_COMMAND_SPEC,
+ plus precomp, libtool, and fat build additions.
In general, random Darwin linker flags should go into LINK_SPEC
instead of LINK_COMMAND_SPEC. The command spec is better for
specifying the handling of options understood by generic Unix
linkers, and for positional arguments like libraries. */
-#if LD64_HAS_EXPORT_DYNAMIC
-#define DARWIN_EXPORT_DYNAMIC " %{rdynamic:-export_dynamic}"
-#else
-#define DARWIN_EXPORT_DYNAMIC " %{rdynamic: %nrdynamic is not supported}"
-#endif
-
#define LINK_COMMAND_SPEC_A \
"%{!fdump=*:%{!fsyntax-only:%{!c:%{!M:%{!MM:%{!E:%{!S:\
%(linker)" \
@@ -190,10 +219,14 @@ extern GTY(()) int darwin_ms_struct;
%{%:sanitize(address): -lasan } \
%{%:sanitize(undefined): -lubsan } \
%(link_ssp) \
- " DARWIN_EXPORT_DYNAMIC " %<rdynamic \
%(link_gcc_c_sequence) \
}}}\
- %{!nostdlib:%{!r:%{!nostartfiles:%E}}} %{T*} %{F*} }}}}}}}"
+ %{!nostdlib:%{!r:%{!nostartfiles:%E}}} %{T*} %{F*} "\
+ DARWIN_PIE_SPEC \
+ DARWIN_NOPIE_SPEC \
+ DARWIN_RDYNAMIC \
+ DARWIN_NOCOMPACT_UNWIND \
+ "}}}}}}} %<pie %<no-pie %<rdynamic "
#define DSYMUTIL "\ndsymutil"
@@ -230,8 +263,6 @@ extern GTY(()) int darwin_ms_struct;
#define STANDARD_STARTFILE_PREFIX_1 ""
#define STANDARD_STARTFILE_PREFIX_2 ""
-#define DARWIN_PIE_SPEC "%{fpie|pie|fPIE:}"
-
/* Please keep the random linker options in alphabetical order (modulo
'Z' and 'no' prefixes). Note that options taking arguments may appear
multiple times on a command line with different arguments each time,
@@ -295,7 +326,6 @@ extern GTY(()) int darwin_ms_struct;
%:version-compare(< 10.5 mmacosx-version-min= -multiply_defined) \
%:version-compare(< 10.5 mmacosx-version-min= suppress)}} \
%{Zmultiplydefinedunused*:-multiply_defined_unused %*} \
- " DARWIN_PIE_SPEC " \
%{prebind} %{noprebind} %{nofixprebinding} %{prebind_all_twolevel_modules} \
%{read_only_relocs} \
%{sectcreate*} %{sectorder*} %{seg1addr*} %{segprot*} \
@@ -327,43 +357,42 @@ extern GTY(()) int darwin_ms_struct;
/* Support -mmacosx-version-min by supplying different (stub) libgcc_s.dylib
libraries to link against, and by not linking against libgcc_s on
- earlier-than-10.3.9.
+ earlier-than-10.3.9. If we need exceptions, prior to 10.3.9, then we have
+ to link the static eh lib, since there's no shared version on the system.
- Note that by default, -lgcc_eh is not linked against! This is
- because in a future version of Darwin the EH frame information may
- be in a new format, or the fallback routine might be changed; if
- you want to explicitly link against the static version of those
- routines, because you know you don't need to unwind through system
- libraries, you need to explicitly say -static-libgcc.
+ Note that by default, except as above, -lgcc_eh is not linked against.
+ This is because,in general, we need to unwind through system libraries that
+ are linked with the shared unwinder in libunwind (or libgcc_s for 10.4/5).
- If it is linked against, it has to be before -lgcc, because it may
+ The static version of the current libgcc unwinder (which differs from the
+ implementation in libunwind.dylib on systems Darwin10 [10.6]+) can be used
+ by specifying -static-libgcc.
+
+ If libgcc_eh is linked against, it has to be before -lgcc, because it might
need symbols from -lgcc. */
+
#undef REAL_LIBGCC_SPEC
#define REAL_LIBGCC_SPEC \
"%{static-libgcc|static: -lgcc_eh -lgcc; \
- shared-libgcc|fexceptions|fgnu-runtime: \
- %:version-compare(!> 10.5 mmacosx-version-min= -lgcc_s.10.4) \
+ shared-libgcc|fexceptions|fobjc-exceptions|fgnu-runtime: \
+ %:version-compare(!> 10.3.9 mmacosx-version-min= -lgcc_eh) \
+ %:version-compare(>< 10.3.9 10.5 mmacosx-version-min= -lgcc_s.10.4) \
%:version-compare(>< 10.5 10.6 mmacosx-version-min= -lgcc_s.10.5) \
- %:version-compare(!> 10.5 mmacosx-version-min= -lgcc_ext.10.4) \
+ %:version-compare(>< 10.3.9 10.5 mmacosx-version-min= -lgcc_ext.10.4) \
%:version-compare(>= 10.5 mmacosx-version-min= -lgcc_ext.10.5) \
-lgcc ; \
:%:version-compare(>< 10.3.9 10.5 mmacosx-version-min= -lgcc_s.10.4) \
%:version-compare(>< 10.5 10.6 mmacosx-version-min= -lgcc_s.10.5) \
- %:version-compare(!> 10.5 mmacosx-version-min= -lgcc_ext.10.4) \
+ %:version-compare(>< 10.3.9 10.5 mmacosx-version-min= -lgcc_ext.10.4) \
%:version-compare(>= 10.5 mmacosx-version-min= -lgcc_ext.10.5) \
-lgcc }"
-/* We specify crt0.o as -lcrt0.o so that ld will search the library path.
-
- crt3.o provides __cxa_atexit on systems that don't have it. Since
- it's only used with C++, which requires passing -shared-libgcc, key
- off that to avoid unnecessarily adding a destructor to every
- powerpc program built. */
+/* We specify crt0.o as -lcrt0.o so that ld will search the library path. */
#undef STARTFILE_SPEC
#define STARTFILE_SPEC \
- "%{Zdynamiclib: %(darwin_dylib1) %{fgnu-tm: -lcrttms.o}} \
- %{!Zdynamiclib:%{Zbundle:%{!static: \
+"%{Zdynamiclib: %(darwin_dylib1) %{fgnu-tm: -lcrttms.o}} \
+ %{!Zdynamiclib:%{Zbundle:%{!static: \
%:version-compare(< 10.6 mmacosx-version-min= -lbundle1.o) \
%{fgnu-tm: -lcrttms.o}}} \
%{!Zbundle:%{pg:%{static:-lgcrt0.o} \
@@ -377,7 +406,7 @@ extern GTY(()) int darwin_ms_struct;
%{!object:%{preload:-lcrt0.o} \
%{!preload: %(darwin_crt1) \
%(darwin_crt2)}}}}}} \
- %{shared-libgcc:%:version-compare(< 10.5 mmacosx-version-min= crt3.o%s)}"
+ %(darwin_crt3)"
/* We want a destructor last in the list. */
#define TM_DESTRUCTOR "%{fgnu-tm: -lcrttme.o}"
@@ -385,18 +414,30 @@ extern GTY(()) int darwin_ms_struct;
#define DARWIN_EXTRA_SPECS \
{ "darwin_crt1", DARWIN_CRT1_SPEC }, \
+ { "darwin_crt2", DARWIN_CRT2_SPEC }, \
+ { "darwin_crt3", DARWIN_CRT3_SPEC }, \
{ "darwin_dylib1", DARWIN_DYLIB1_SPEC },
-#define DARWIN_DYLIB1_SPEC \
- "%:version-compare(!> 10.5 mmacosx-version-min= -ldylib1.o) \
- %:version-compare(>< 10.5 10.6 mmacosx-version-min= -ldylib1.10.5.o)"
-
#define DARWIN_CRT1_SPEC \
"%:version-compare(!> 10.5 mmacosx-version-min= -lcrt1.o) \
%:version-compare(>< 10.5 10.6 mmacosx-version-min= -lcrt1.10.5.o) \
%:version-compare(>< 10.6 10.8 mmacosx-version-min= -lcrt1.10.6.o) \
%{fgnu-tm: -lcrttms.o}"
+#define DARWIN_CRT2_SPEC ""
+
+/* crt3.o provides __cxa_atexit on systems that don't have it (and a fix
+ up for faulty versions on 10.4). Since it's only used with C++, which
+ requires passing -shared-libgcc, key off that to avoid unnecessarily
+ adding a destructor to every program built for 10.4 or earlier. */
+
+#define DARWIN_CRT3_SPEC \
+"%{shared-libgcc:%:version-compare(< 10.5 mmacosx-version-min= crt3.o%s)}"
+
+#define DARWIN_DYLIB1_SPEC \
+ "%:version-compare(!> 10.5 mmacosx-version-min= -ldylib1.o) \
+ %:version-compare(>< 10.5 10.6 mmacosx-version-min= -ldylib1.10.5.o)"
+
#ifdef HAVE_AS_MMACOSX_VERSION_MIN_OPTION
/* Emit macosx version (but only major). */
#define ASM_MMACOSX_VERSION_MIN_SPEC \
@@ -762,21 +803,52 @@ extern GTY(()) section * darwin_sections[NUM_DARWIN_SECTIONS];
#undef TARGET_ASM_MARK_DECL_PRESERVED
#define TARGET_ASM_MARK_DECL_PRESERVED darwin_mark_decl_preserved
-/* Set on a symbol with SYMBOL_FLAG_FUNCTION or
- MACHO_SYMBOL_FLAG_VARIABLE to indicate that the function or
- variable has been defined in this translation unit.
- When porting Mach-O to new architectures you need to make
- sure these aren't clobbered by the backend. */
+/* Any port using this header needs to define the first available
+ subtarget symbol bit: SYMBOL_FLAG_SUBT_DEP. */
-#define MACHO_SYMBOL_FLAG_VARIABLE (SYMBOL_FLAG_MACH_DEP)
-#define MACHO_SYMBOL_FLAG_DEFINED ((SYMBOL_FLAG_MACH_DEP) << 1)
+/* Is a variable. */
+#define MACHO_SYMBOL_FLAG_VARIABLE (SYMBOL_FLAG_SUBT_DEP)
+#define MACHO_SYMBOL_VARIABLE_P(RTX) \
+ ((SYMBOL_REF_FLAGS (RTX) & MACHO_SYMBOL_FLAG_VARIABLE) != 0)
+
+/* Set on a symbol that must be indirected, even when there is a
+ definition in the TU. The ABI mandates that common symbols are so
+ indirected, as are weak. If 'fix-and-continue' is operational then
+ data symbols might also be. */
+
+#define MACHO_SYMBOL_FLAG_MUST_INDIRECT ((SYMBOL_FLAG_SUBT_DEP) << 1)
+#define MACHO_SYMBOL_MUST_INDIRECT_P(RTX) \
+ ((SYMBOL_REF_FLAGS (RTX) & MACHO_SYMBOL_FLAG_MUST_INDIRECT) != 0)
+
+/* Set on a symbol with SYMBOL_FLAG_FUNCTION or MACHO_SYMBOL_FLAG_VARIABLE
+ to indicate that the function or variable is considered defined in this
+ translation unit. */
+
+#define MACHO_SYMBOL_FLAG_DEFINED ((SYMBOL_FLAG_SUBT_DEP) << 2)
+#define MACHO_SYMBOL_DEFINED_P(RTX) \
+ ((SYMBOL_REF_FLAGS (RTX) & MACHO_SYMBOL_FLAG_DEFINED) != 0)
+
+/* Set on a symbol that has specified non-default visibility. */
+
+#define MACHO_SYMBOL_FLAG_HIDDEN_VIS ((SYMBOL_FLAG_SUBT_DEP) << 3)
+#define MACHO_SYMBOL_HIDDEN_VIS_P(RTX) \
+ ((SYMBOL_REF_FLAGS (RTX) & MACHO_SYMBOL_FLAG_HIDDEN_VIS) != 0)
+
+/* Set on a symbol that is a pic stub or symbol indirection (i.e. the
+ L_xxxxx${stub,non_lazy_ptr,lazy_ptr}. */
+
+#define MACHO_SYMBOL_FLAG_INDIRECTION ((SYMBOL_FLAG_SUBT_DEP) << 5)
+#define MACHO_SYMBOL_INDIRECTION_P(RTX) \
+ ((SYMBOL_REF_FLAGS (RTX) & MACHO_SYMBOL_FLAG_INDIRECTION) != 0)
/* Set on a symbol to indicate when fix-and-continue style code
generation is being used and the symbol refers to a static symbol
that should be rebound from new instances of a translation unit to
the original instance of the data. */
-#define MACHO_SYMBOL_STATIC ((SYMBOL_FLAG_MACH_DEP) << 2)
+#define MACHO_SYMBOL_FLAG_STATIC ((SYMBOL_FLAG_SUBT_DEP) << 6)
+#define MACHO_SYMBOL_STATIC_P(RTX) \
+ ((SYMBOL_REF_FLAGS (RTX) & MACHO_SYMBOL_FLAG_STATIC) != 0)
/* Symbolic names for various things we might know about a symbol. */
@@ -969,8 +1041,12 @@ extern void darwin_driver_init (unsigned int *,struct cl_decoded_option **);
_tested_ version known to support this so far. */
#define MIN_LD64_NO_COAL_SECTS "236.4"
+/* From at least version 62.1, ld64 can build symbol indirection stubs as
+ needed, and there is no need for the compiler to emit them. */
+#define MIN_LD64_OMIT_STUBS "85.2"
+
#ifndef LD64_VERSION
-#define LD64_VERSION "85.2"
+#define LD64_VERSION "62.1"
#else
#define DEF_LD64 LD64_VERSION
#endif
diff --git a/gcc/config/darwin.opt b/gcc/config/darwin.opt
index 22667def0a1..7f5616cbe07 100644
--- a/gcc/config/darwin.opt
+++ b/gcc/config/darwin.opt
@@ -18,240 +18,382 @@
; along with GCC; see the file COPYING3. If not see
; <http://www.gnu.org/licenses/>.
-; Various linker options have a -Z added so that they can get to specs
-; processing without interference. Note that an option name with a
-; prefix that matches another option name, that also takes an
-; argument, being mapped to a -Z linker option, needs to be modified
-; so the prefix is different, otherwise a '*' after the shorter option
-; will match with the longer one.
+; We have a lot of Driver options, many of which are obsolete or very very
+; rarely used so, to keep this file easier to manage:
+
+; Please place all Non-driver options first (in alphabetical order), followed
+; by Driver-only options.
+
+; Non-driver options.
+
+dependency-file
+C ObjC C++ ObjC++ Separate Alias(MF) MissingArgError(missing filename after %qs)
+
+fapple-kext
+Target Report C++ Var(flag_apple_kext)
+Generate code for darwin loadable kernel extensions.
+
+iframework
+Target RejectNegative C ObjC C++ ObjC++ Joined Separate
+-iframework <dir> Add <dir> to the end of the system framework include path.
+
+mconstant-cfstrings
+Target Report Var(darwin_constant_cfstrings) Init(1)
+Generate compile-time CFString objects.
+
+Wnonportable-cfstrings
+Target Report Var(darwin_warn_nonportable_cfstrings) Init(1) Warning
+Warn if constant CFString objects contain non-portable characters.
+
+; Use new-style pic stubs if this is true, x86 only so far.
+matt-stubs
+Target Report Var(darwin_macho_att_stub) Init(1)
+Generate AT&T-style stubs for Mach-O.
+
+mdynamic-no-pic
+Target Common Report Mask(MACHO_DYNAMIC_NO_PIC)
+Generate code suitable for executables (NOT shared libs).
+
+mfix-and-continue
+Target Report Var(darwin_fix_and_continue)
+Generate code suitable for fast turn around debugging.
+
+mkernel
+Target Report Var(flag_mkernel)
+Generate code for the kernel or loadable kernel extensions.
+
+; The Init here is for the convenience of GCC developers, so that cc1
+; and cc1plus don't crash if no -mmacosx-version-min is passed. The
+; driver will always pass a -mmacosx-version-min, so in normal use the
+; Init is never used.
+mmacosx-version-min=
+Target RejectNegative Joined Report Var(darwin_macosx_version_min) Init(DEF_MIN_OSX_VERSION)
+The earliest MacOS X version on which this program will run.
+
+; Really, only relevant to PowerPC which has a 4 byte bool by default.
+mone-byte-bool
+Target RejectNegative Report Var(darwin_one_byte_bool)
+Set sizeof(bool) to 1.
+
+msymbol-stubs
+Target Report Var(darwin_symbol_stubs) Init(0)
+Force generation of external symbol indirection stubs.
+
+; Some code-gen may be improved / adjusted if the linker is sufficiently modern.
+mtarget-linker=
+Target RejectNegative Joined Report Alias(mtarget-linker)
+
+mtarget-linker
+Target RejectNegative Joined Separate Report Var(darwin_target_linker) Init(LD64_VERSION)
+The version of ld64 in use for this toolchain.
+
+; Driver options.
all_load
-Driver Alias(Zall_load)
+Driver RejectNegative Alias(Zall_load)
+Loads all members of archive libraries
allowable_client
-Driver Separate Alias(Zallowable_client)
+Driver RejectNegative Separate Alias(Zallowable_client)
+-allowable_client <name> The output dylib is private to the client(s) named
arch
Driver RejectNegative Separate
+-arch <name> Specify that the output file should be generated for architecture \"name\"
arch_errors_fatal
-Driver Alias(Zarch_errors_fatal)
+Driver RejectNegative Alias(Zarch_errors_fatal)
+Mismatches between file architecture and the \"-arch\" are errors instead of warnings
asm_macosx_version_min=
Driver RejectNegative Joined
+The earliest MacOS X version on which this program will run (formatted for the assembler)
bind_at_load
-Driver Alias(Zbind_at_load)
+Driver RejectNegative Alias(Zbind_at_load)
+Produce an output file that will bind symbols on load, rather than lazily.
bundle
-Driver Alias(Zbundle)
+Driver RejectNegative Alias(Zbundle)
+Produce a Mach-O bundle (file type MH_BUNDLE)
bundle_loader
-Driver Separate Alias(Zbundle_loader)
+Driver RejectNegative Separate Alias(Zbundle_loader)
+-bundle_loader <executable> Treat \"executable\" (that will be loading this bundle) as if it was one of the dynamic libraries the bundle is linked against for symbol resolution
-dead_strip
-Driver Alias(Zdead_strip)
+client_name
+Driver RejectNegative Separate
+-client_name <name> Enable the executable being built to link against a private dylib (using allowable_client)
-dependency-file
-C ObjC C++ ObjC++ Separate Alias(MF) MissingArgError(missing filename after %qs)
+compatibility_version
+Driver RejectNegative Separate
+-compatibility_version <number> Set the minimum version for the client interface. Clients must record a greater number than this or the binding will fail at runtime
+
+current_version
+Driver RejectNegative Separate
+-current_version <number> Set the current version for the library.
+
+dead_strip
+Driver RejectNegative Alias(Zdead_strip)
+Remove code and data that is unreachable from any exported symbol (including the entry point)
dylib_file
Driver Separate Alias(Zdylib_file)
dylinker
-Driver
+Driver RejectNegative
+Produce a Mach-O dylinker (file type MH_DYLINKER), only used for building dyld.
+
+dylinker_install_name
+Driver RejectNegative Separate
+-dylinker_install_name <path> Only used for building dyld.
dynamic
-Driver Alias(Zdynamic)
+Driver RejectNegative Alias(Zdynamic)
+The default (and opposite of -static), implied by user mode executables, shared libraries and bundles.
dynamiclib
-Driver Alias(Zdynamiclib)
+Driver RejectNegative Alias(Zdynamiclib)
+Produce a Mach-O shared library (file type MH_DYLIB), synonym for -shared
exported_symbols_list
-Driver Separate Alias(Zexported_symbols_list)
+Driver RejectNegative Separate Alias(Zexported_symbols_list)
+-exported_symbols_list <filename> Global symbols in \"filename\" will be exported from the linked output file, any symbols not mentioned will be treated as hidden.
filelist
Driver RejectNegative Separate
+Supply a list of objects to be linked from a file, rather than the command line
findirect-virtual-calls
Driver RejectNegative
+Used for generating code for some older kernel revisions.
flat_namespace
Driver RejectNegative Alias(Zflat_namespace)
+Ignore the normal two-level namespace; resolve symbols in command line order and do not record which library provided the resolved symbol.
force_cpusubtype_ALL
Driver RejectNegative Alias(Zforce_cpusubtype_ALL)
+For the assembler (and linker) permit any architecture sub-variant to be used without error.
force_flat_namespace
Driver RejectNegative Alias(Zforce_flat_namespace)
+Set the output object such that, on loading, dyld will ignore any two-level information and resolve symbols in the discovery order for loaded libs.
framework
Driver RejectNegative Separate
+-framework <name> The linker should search for the named framework in the framework search path.
fterminated-vtables
Driver RejectNegative
+Used for generating code for some older kernel revisions.
gfull
Driver RejectNegative
+Abbreviation for \"-g -fno-eliminate-unused-debug-symbols\"
gused
Driver RejectNegative
+Abbreviation for \"-g -feliminate-unused-debug-symbols\"
headerpad_max_install_names
-Driver
+Driver RejectNegative
+Automatically adds space for longer path names in load commands (up to MAXPATHLEN)
image_base
-Driver Separate Alias(Zimage_base)
+Driver RejectNegative Separate Alias(Zimage_base)
+-image_base <address> Choose a base address for a dylib or bundle.
init
-Driver Separate Alias(Zinit)
+Driver RejectNegative Separate Alias(Zinit)
+-init <symbol_name> The symbol \"symbol_name\" will be used as the first initialiser for a dylib.
install_name
-Driver Separate Alias(Zinstall_name)
+Driver RejectNegative Separate Alias(Zinstall_name)
+-install_name <name> Set the install name for a dylib.
keep_private_externs
-Driver
-
-mconstant-cfstrings
-Target Report Var(darwin_constant_cfstrings) Init(1)
-Generate compile-time CFString objects.
+Driver RejectNegative
+Usually \"private extern\" (hidden) symbols are made local when linking, this command suppresses that such that they remain exported.
multi_module
Driver RejectNegative Alias(Zmulti_module)
+(Obsolete after 10.4) Multi modules are ignored at runtime since MacOS 10.4
multiply_defined
Driver RejectNegative Separate Alias(Zmultiply_defined)
+(Obsolete after 10.4) -multiply_defined <treatment> Provided a mechanism for warning about symbols defined in multiple dylibs.
multiply_defined_unused
Driver RejectNegative Separate Alias(Zmultiplydefinedunused)
+(Obsolete after 10.4) -multiply_defined_unused <treatment> Provided a mechanism for warning about symbols defined in the current executable also being defined in linked dylibs.
no_dead_strip_inits_and_terms
-Driver Alias(Zno_dead_strip_inits_and_terms)
+Driver RejectNegative Alias(Zno_dead_strip_inits_and_terms)
+(Obsolete) The linker never dead strips these items, so the option is not needed.
nofixprebinding
-Driver
+Driver RejectNegative
+(Obsolete after 10.3.9) Set MH_NOPREFIXBINDING, in an exectuable.
nomultidefs
-Driver
+Driver RejectNegative
+(Obsolete after 10.4) Set MH_NOMULTIDEFS in an umbrella framework.
noprebind
-Driver
+Driver RejectNegative Negative(prebind)
+(Obsolete) LD_PREBIND is no longer supported.
noseglinkedit
-Driver
+Driver RejectNegative Negative(seglinkedit)
+(Obsolete) This is the default.
object
-Driver
+Driver RejectNegative
+
+pagezero_size
+Driver RejectNegative Separate
+-pagezero_size size Allows setting the page 0 size to 4kb for certain special cases.
prebind
-Driver
+Driver RejectNegative Negative(noprebind)
+(Obsolete) LD_PREBIND is no longer supported.
prebind_all_twolevel_modules
-Driver
+Driver RejectNegative
+(Obsolete) LD_PREBIND is no longer supported.
preload
-Driver
+Driver RejectNegative
+Produces a Mach-O file suitable for embedded/ROM use.
private_bundle
-Driver
+Driver RejectNegative
+(Obsolete) Allowed linking to proceed with \"-flat_namespace\" when a linked bundle contained a symbol also exported from the main executable.
pthread
-Driver
+Driver RejectNegative
rdynamic
-Driver
+Driver RejectNegative
+Synonym for \"-export-dynamic\" for linker versions that support it.
+
+read_only_relocs
+Driver RejectNegative Separate
+-read_only_relocs <treatment> This will allow relocs in read-only pages (not advisable).
+
+sectalign
+Driver RejectNegative Separate Args(3)
+-sectalign <segname> <sectname> <value> Set section \"sectname\" in segment \"segname\" to have alignment \"value\" which must be an integral power of two expressed in hexadecimal form.
+
+sectcreate
+Driver RejectNegative Separate Args(3)
+-sectcreate <segname> <sectname> <file> Create section \"sectname\" in segment \"segname\" from the contents of \"file\".
+
+sectobjectsymbols
+Driver RejectNegative Separate Args(2)
+(Obsolete) -sectobjectsymbols <segname> <sectname> Setting a local symbol at the start of a section is no longer supported.
+
+sectorder
+Driver RejectNegative Separate Args(3)
+(Obsolete) -sectorder <segname> <sectname> orderfile Replaced by a more general option \"-order_file\".
seg_addr_table
-Driver Separate Alias(Zseg_addr_table)
+Driver RejectNegative Separate Alias(Zseg_addr_table)
+-seg_addr_table <file> Specify the base addresses for dynamic libraries, \"file\" contains a line for each library.
+; This is only usable by the ld_classic linker.
seg_addr_table_filename
-Driver Separate Alias(Zfn_seg_addr_table_filename)
+Driver RejectNegative Separate Alias(Zfn_seg_addr_table_filename)
+(Obsolete, ld_classic only) -seg_addr_table_filename <path>
+
+seg1addr
+Driver RejectNegative Separate
+Synonym for \"image_base\"
segaddr
-Driver Separate Args(2) Alias(Zsegaddr)
+Driver RejectNegative Separate Args(2) Alias(Zsegaddr)
+-segaddr <name> <address> Set the base address of segment \"name\" to \"address\" which must be aligned to a page boundary (currently 4kb).
+
+; This is only usable by the ld_classic linker.
+segcreate
+Driver RejectNegative Separate Args(3)
+(Obsolete, ld_classic only) -sectcreate segname sectname file
seglinkedit
-Driver
+Driver RejectNegative Negative(noseglinkedit)
+(Obsolete) Object files with LINKEDIT sections are no longer supported.
+
+segprot
+Driver RejectNegative Separate Args(3)
+-segprot <segname> max_prot init_prot The protection values are \"r\", \"w\", \"x\" or \"-\" the latter meaning \"no access\".
segs_read_only_addr
-Driver Separate Alias(Zsegs_read_only_addr)
+Driver RejectNegative Separate Alias(Zsegs_read_only_addr)
+-segs_read_only_addr address Allows specifying the address of the read only portion of a dylib.
segs_read_write_addr
-Driver Separate Alias(Zsegs_read_write_addr)
+Driver RejectNegative Separate Alias(Zsegs_read_write_addr)
+-segs_read_write_addr address Allows specifying the address of the read/write portion of a dylib.
single_module
-Driver Alias(Zsingle_module)
+Driver RejectNegative Alias(Zsingle_module)
+(Obsolete) This is the default.
+
+sub_library
+Driver RejectNegative Separate
+-sub_library <name> Library named \"name\" will be re-exported (only useful for dylibs).
+
+sub_umbrella
+Driver RejectNegative Separate
+-sub_umbrella <name> Framework named \"name\" will be re-exported (only useful for dylibs).
twolevel_namespace
-Driver
+Driver RejectNegative
+This is the default
twolevel_namespace_hints
-Driver
+Driver RejectNegative
+Specifies content that can speed up dynamic loading when the binaries are unchanged.
umbrella
-Driver Separate Alias(Zumbrella)
+Driver RejectNegative Separate Alias(Zumbrella)
+-umbrella <framework> The specified framework will be re-exported.
+
+undefined
+Driver RejectNegative Separate
+-undefined <treatment> Specify the handling for undefined symbols (default is error).
unexported_symbols_list
-Driver Separate Alias(Zunexported_symbols_list)
+Driver RejectNegative Separate Alias(Zunexported_symbols_list)
+-unexported_symbols_list <filename> Don't export global symbols listed in filename.
weak_reference_mismatches
-Driver Separate Alias(Zweak_reference_mismatches)
+Driver RejectNegative Separate Alias(Zweak_reference_mismatches)
+-weak_reference_mismatches <treatment> Specifies what to do if a symbol import conflicts between file (weak in one and not in another) the default is to treat the symbol as non-weak.
whatsloaded
-Driver
+Driver RejectNegative
+Logs the object files the linker loads
whyload
-Driver
+Driver RejectNegative
+Logs which symbol(s) caused an object to be loaded.
+
+;(Obsolete, ignored) Strip symbols starting with "L", this is the default.
+X
+Driver RejectNegative
y
-Driver Joined
+Driver RejectNegative Joined
+(Obsolete, ignored) Old support similar to whyload.
Mach
-Driver
-
-Wnonportable-cfstrings
-Target Report Var(darwin_warn_nonportable_cfstrings) Init(1) Warning
-Warn if constant CFString objects contain non-portable characters.
-
-; Use new-style pic stubs if this is true, x86 only so far.
-matt-stubs
-Target Report Var(darwin_macho_att_stub) Init(1)
-Generate AT&T-style stubs for Mach-O.
-
-mdynamic-no-pic
-Target Common Report Mask(MACHO_DYNAMIC_NO_PIC)
-Generate code suitable for executables (NOT shared libs).
-
-mfix-and-continue
-Target Report Var(darwin_fix_and_continue)
-Generate code suitable for fast turn around debugging.
-
-; The Init here is for the convenience of GCC developers, so that cc1
-; and cc1plus don't crash if no -mmacosx-version-min is passed. The
-; driver will always pass a -mmacosx-version-min, so in normal use the
-; Init is never used.
-mmacosx-version-min=
-Target Joined Report Var(darwin_macosx_version_min) Init(DEF_MIN_OSX_VERSION)
-The earliest MacOS X version on which this program will run.
-
-mone-byte-bool
-Target RejectNegative Report Var(darwin_one_byte_bool)
-Set sizeof(bool) to 1.
-
-fapple-kext
-Target Report C++ Var(flag_apple_kext)
-Generate code for darwin loadable kernel extensions.
-
-mkernel
-Target Report Var(flag_mkernel)
-Generate code for the kernel or loadable kernel extensions.
-
-iframework
-Target RejectNegative C ObjC C++ ObjC++ Joined Separate
--iframework <dir> Add <dir> to the end of the system framework include path.
+Driver RejectNegative
+(Obsolete and unhandled by ld64, ignored) ld should produce an executable (only handled by ld_classic).
-X
-Driver
+;; These are not "real" options, but placeholders used to hide the real options
+;; from generic options processing... FIXME: they can be eliminated now.
Zall_load
Driver
@@ -343,62 +485,3 @@ Driver Separate
Zweak_reference_mismatches
Driver Separate
-client_name
-Driver Separate
-
-compatibility_version
-Driver Separate
-
-current_version
-Driver Separate
-
-dylinker_install_name
-Driver Separate
-
-pagezero_size
-Driver Separate
-
-read_only_relocs
-Driver Separate
-
-sectalign
-Driver Separate Args(3)
-
-sectcreate
-Driver Separate Args(3)
-
-sectobjectsymbols
-Driver Separate Args(2)
-
-sectorder
-Driver Separate Args(3)
-
-seg1addr
-Driver Separate
-
-segcreate
-Driver Separate Args(3)
-
-segprot
-Driver Separate Args(3)
-
-segs_read_only_addr
-Driver Separate
-
-segs_read_write_addr
-Driver Separate
-
-sub_library
-Driver Separate
-
-sub_umbrella
-Driver Separate
-
-; Certain aspects of code-gen may be improved / adjusted if the version of ld64
-; is sufficiently modern.
-mtarget-linker
-Target RejectNegative Joined Separate Report Var(darwin_target_linker) Init(LD64_VERSION)
-The version of ld64 in use for this toolchain.
-
-undefined
-Driver Separate
diff --git a/gcc/config/darwin10.h b/gcc/config/darwin10.h
index 07a2b465a04..a6d1eba6ebd 100644
--- a/gcc/config/darwin10.h
+++ b/gcc/config/darwin10.h
@@ -18,17 +18,12 @@ 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/>. */
-/* Fix PR41260 by passing -no_compact_unwind on darwin10 and later until
- unwinder in libSystem is fixed to digest new epilog unwinding notes.
+/* Fix PR47558 by linking against libSystem ahead of libgcc_ext. */
- Fix PR47558 by linking against libSystem ahead of libgcc_ext. */
#undef LINK_GCC_C_SEQUENCE_SPEC
#define LINK_GCC_C_SEQUENCE_SPEC \
-"%:version-compare(>= 10.6 mmacosx-version-min= -no_compact_unwind) \
- %{!static:%{!static-libgcc: \
+"%{!static:%{!static-libgcc: \
%:version-compare(>= 10.6 mmacosx-version-min= -lSystem) } } \
- %{fno-pic|fno-PIC|fno-pie|fno-PIE|fapple-kext|mkernel|static|mdynamic-no-pic: \
- %:version-compare(>= 10.7 mmacosx-version-min= -no_pie) } \
%{!nostdlib:%:version-compare(>< 10.6 10.7 mmacosx-version-min= -ld10-uwfef.o)} \
%G %{!nolibc:%L}"
diff --git a/gcc/config/darwin9.h b/gcc/config/darwin9.h
index ca5c51718c8..1fd1604aed8 100644
--- a/gcc/config/darwin9.h
+++ b/gcc/config/darwin9.h
@@ -35,12 +35,6 @@ along with GCC; see the file COPYING3. If not see
/* Tell collect2 to run dsymutil for us as necessary. */
#define COLLECT_RUN_DSYMUTIL 1
-#undef DARWIN_PIE_SPEC
-#define DARWIN_PIE_SPEC \
- "%{fpie|pie|fPIE: \
- %{mdynamic-no-pic: %n'-mdynamic-no-pic' overrides '-pie', '-fpie' or '-fPIE'; \
- :-pie}}"
-
/* Only ask as for debug data if the debug style is stabs (since as doesn't
yet generate dwarf.) */
diff --git a/gcc/config/i386/avx2intrin.h b/gcc/config/i386/avx2intrin.h
index 7606efdbf79..372d77f84fe 100644
--- a/gcc/config/i386/avx2intrin.h
+++ b/gcc/config/i386/avx2intrin.h
@@ -258,7 +258,7 @@ extern __inline __m256i
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
_mm256_cmpgt_epi8 (__m256i __A, __m256i __B)
{
- return (__m256i) ((__v32qi)__A > (__v32qi)__B);
+ return (__m256i) ((__v32qs)__A > (__v32qs)__B);
}
extern __inline __m256i
diff --git a/gcc/config/i386/avxintrin.h b/gcc/config/i386/avxintrin.h
index 29115a11a0d..3301451e4de 100644
--- a/gcc/config/i386/avxintrin.h
+++ b/gcc/config/i386/avxintrin.h
@@ -47,6 +47,7 @@ typedef unsigned int __v8su __attribute__ ((__vector_size__ (32)));
typedef short __v16hi __attribute__ ((__vector_size__ (32)));
typedef unsigned short __v16hu __attribute__ ((__vector_size__ (32)));
typedef char __v32qi __attribute__ ((__vector_size__ (32)));
+typedef signed char __v32qs __attribute__ ((__vector_size__ (32)));
typedef unsigned char __v32qu __attribute__ ((__vector_size__ (32)));
/* The Intel API is flexible enough that we must allow aliasing with other
diff --git a/gcc/config/i386/darwin.h b/gcc/config/i386/darwin.h
index 1e96350fa71..bdb36f00959 100644
--- a/gcc/config/i386/darwin.h
+++ b/gcc/config/i386/darwin.h
@@ -90,14 +90,12 @@ along with GCC; see the file COPYING3. If not see
#undef WCHAR_TYPE_SIZE
#define WCHAR_TYPE_SIZE 32
-/* Generate branch islands stubs if this is true. */
-extern int darwin_emit_branch_islands;
-
-#undef TARGET_MACHO_BRANCH_ISLANDS
-#define TARGET_MACHO_BRANCH_ISLANDS darwin_emit_branch_islands
+/* Generate pic symbol indirection stubs if this is true. */
+#undef TARGET_MACHO_SYMBOL_STUBS
+#define TARGET_MACHO_SYMBOL_STUBS (darwin_symbol_stubs)
/* For compatibility with OSX system tools, use the new style of pic stub
- if this is set. */
+ if this is set (default). */
#undef MACHOPIC_ATT_STUB
#define MACHOPIC_ATT_STUB (darwin_macho_att_stub)
@@ -245,7 +243,7 @@ extern int darwin_emit_branch_islands;
#undef FUNCTION_PROFILER
#define FUNCTION_PROFILER(FILE, LABELNO) \
do { \
- if (TARGET_MACHO_BRANCH_ISLANDS \
+ if (TARGET_MACHO_SYMBOL_STUBS \
&& MACHOPIC_INDIRECT && !TARGET_64BIT) \
{ \
const char *name = machopic_mcount_stub_name (); \
@@ -326,10 +324,8 @@ extern int darwin_emit_branch_islands;
} \
}
-/* This needs to move since i386 uses the first flag and other flags are
- used in Mach-O. */
-#undef MACHO_SYMBOL_FLAG_VARIABLE
-#define MACHO_SYMBOL_FLAG_VARIABLE ((SYMBOL_FLAG_MACH_DEP) << 3)
+/* First available SYMBOL flag bit for use by subtargets. */
+#define SYMBOL_FLAG_SUBT_DEP (SYMBOL_FLAG_MACH_DEP << 5)
#undef MACHOPIC_NL_SYMBOL_PTR_SECTION
#define MACHOPIC_NL_SYMBOL_PTR_SECTION \
diff --git a/gcc/config/i386/emmintrin.h b/gcc/config/i386/emmintrin.h
index f9e7b33b0dd..1683d842c65 100644
--- a/gcc/config/i386/emmintrin.h
+++ b/gcc/config/i386/emmintrin.h
@@ -1308,7 +1308,7 @@ _mm_xor_si128 (__m128i __A, __m128i __B)
extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
_mm_cmpeq_epi8 (__m128i __A, __m128i __B)
{
- return (__m128i) ((__v16qs)__A == (__v16qs)__B);
+ return (__m128i) ((__v16qi)__A == (__v16qi)__B);
}
extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 2b37296e537..ce3fbd120ed 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -5423,7 +5423,25 @@ ix86_valid_target_attribute_inner_p (tree args, char *p_strings[],
ret = false;
}
else
- p_strings[opt] = xstrdup (p + opt_len);
+ {
+ p_strings[opt] = xstrdup (p + opt_len);
+ if (opt == IX86_FUNCTION_SPECIFIC_ARCH)
+ {
+ /* If arch= is set, clear all bits in x_ix86_isa_flags,
+ except for ISA_64BIT, ABI_64, ABI_X32, and CODE16
+ and all bits in x_ix86_isa_flags2. */
+ opts->x_ix86_isa_flags &= (OPTION_MASK_ISA_64BIT
+ | OPTION_MASK_ABI_64
+ | OPTION_MASK_ABI_X32
+ | OPTION_MASK_CODE16);
+ opts->x_ix86_isa_flags_explicit &= (OPTION_MASK_ISA_64BIT
+ | OPTION_MASK_ABI_64
+ | OPTION_MASK_ABI_X32
+ | OPTION_MASK_CODE16);
+ opts->x_ix86_isa_flags2 = 0;
+ opts->x_ix86_isa_flags2_explicit = 0;
+ }
+ }
}
else if (type == ix86_opt_enum)
@@ -5498,18 +5516,8 @@ ix86_valid_target_attribute_tree (tree args,
/* If we are using the default tune= or arch=, undo the string assigned,
and use the default. */
if (option_strings[IX86_FUNCTION_SPECIFIC_ARCH])
- {
- opts->x_ix86_arch_string
- = ggc_strdup (option_strings[IX86_FUNCTION_SPECIFIC_ARCH]);
-
- /* If arch= is set, clear all bits in x_ix86_isa_flags,
- except for ISA_64BIT, ABI_64, ABI_X32, and CODE16. */
- opts->x_ix86_isa_flags &= (OPTION_MASK_ISA_64BIT
- | OPTION_MASK_ABI_64
- | OPTION_MASK_ABI_X32
- | OPTION_MASK_CODE16);
- opts->x_ix86_isa_flags2 = 0;
- }
+ opts->x_ix86_arch_string
+ = ggc_strdup (option_strings[IX86_FUNCTION_SPECIFIC_ARCH]);
else if (!orig_arch_specified)
opts->x_ix86_arch_string = NULL;
@@ -16960,7 +16968,7 @@ output_pic_addr_const (FILE *file, rtx x, int code)
break;
case SYMBOL_REF:
- if (TARGET_64BIT || ! TARGET_MACHO_BRANCH_ISLANDS)
+ if (TARGET_64BIT || ! TARGET_MACHO_SYMBOL_STUBS)
output_addr_const (file, x);
else
{
diff --git a/gcc/config/i386/i386.h b/gcc/config/i386/i386.h
index 2cb16d9fbf6..934352d6331 100644
--- a/gcc/config/i386/i386.h
+++ b/gcc/config/i386/i386.h
@@ -640,7 +640,7 @@ extern tree x86_mfence;
/* Replace MACH-O, ifdefs by in-line tests, where possible.
(a) Macros defined in config/i386/darwin.h */
#define TARGET_MACHO 0
-#define TARGET_MACHO_BRANCH_ISLANDS 0
+#define TARGET_MACHO_SYMBOL_STUBS 0
#define MACHOPIC_ATT_STUB 0
/* (b) Macros defined in config/darwin.h */
#define MACHO_DYNAMIC_NO_PIC_P 0
@@ -2380,7 +2380,7 @@ const wide_int_bitmask PTA_CANNONLAKE = PTA_SKYLAKE | PTA_AVX512F
| PTA_AVX512VBMI | PTA_AVX512IFMA | PTA_SHA;
const wide_int_bitmask PTA_ICELAKE_CLIENT = PTA_CANNONLAKE | PTA_AVX512VNNI
| PTA_GFNI | PTA_VAES | PTA_AVX512VBMI2 | PTA_VPCLMULQDQ | PTA_AVX512BITALG
- | PTA_RDPID | PTA_CLWB;
+ | PTA_RDPID | PTA_CLWB | PTA_AVX512VPOPCNTDQ;
const wide_int_bitmask PTA_ICELAKE_SERVER = PTA_ICELAKE_CLIENT | PTA_PCONFIG
| PTA_WBNOINVD;
const wide_int_bitmask PTA_KNL = PTA_BROADWELL | PTA_AVX512PF | PTA_AVX512ER
diff --git a/gcc/config/i386/intelmic-mkoffload.c b/gcc/config/i386/intelmic-mkoffload.c
index 2a3e912ee74..0b12edc72c1 100644
--- a/gcc/config/i386/intelmic-mkoffload.c
+++ b/gcc/config/i386/intelmic-mkoffload.c
@@ -453,8 +453,6 @@ prepare_target_image (const char *target_compiler, int argc, char **argv)
if (verbose)
obstack_ptr_grow (&argv_obstack, "-v");
obstack_ptr_grow (&argv_obstack, "-xlto");
- obstack_ptr_grow (&argv_obstack, "-shared");
- obstack_ptr_grow (&argv_obstack, "-fPIC");
obstack_ptr_grow (&argv_obstack, opt1);
for (int i = 1; i < argc; i++)
{
@@ -466,6 +464,9 @@ prepare_target_image (const char *target_compiler, int argc, char **argv)
if (!out_obj_filename)
fatal_error (input_location, "output file not specified");
obstack_ptr_grow (&argv_obstack, opt2);
+ /* NB: Put -fPIC and -shared the last to create shared library. */
+ obstack_ptr_grow (&argv_obstack, "-fPIC");
+ obstack_ptr_grow (&argv_obstack, "-shared");
obstack_ptr_grow (&argv_obstack, "-o");
obstack_ptr_grow (&argv_obstack, target_so_filename);
compile_for_target (&argv_obstack);
diff --git a/gcc/config/i386/sse.md b/gcc/config/i386/sse.md
index 152b7cc77f1..c1b7ce99125 100644
--- a/gcc/config/i386/sse.md
+++ b/gcc/config/i386/sse.md
@@ -2625,7 +2625,7 @@
;; Modes handled by reduc_sm{in,ax}* patterns.
(define_mode_iterator REDUC_SSE_SMINMAX_MODE
[(V4SF "TARGET_SSE") (V2DF "TARGET_SSE")
- (V2DI "TARGET_SSE") (V4SI "TARGET_SSE") (V8HI "TARGET_SSE")
+ (V2DI "TARGET_SSE4_2") (V4SI "TARGET_SSE") (V8HI "TARGET_SSE")
(V16QI "TARGET_SSE")])
(define_expand "reduc_<code>_scal_<mode>"
diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c
index 2dfc7c73cce..d758fbf1be6 100644
--- a/gcc/config/mips/mips.c
+++ b/gcc/config/mips/mips.c
@@ -4849,7 +4849,7 @@ mips_split_move (rtx dest, rtx src, enum mips_split_type split_type, rtx insn_)
can forward SRC for DEST. This is most useful if the next insn is a
simple store. */
rtx_insn *insn = (rtx_insn *)insn_;
- struct mips_address_info addr;
+ struct mips_address_info addr = {};
if (insn)
{
rtx_insn *next = next_nonnote_nondebug_insn_bb (insn);
@@ -4862,7 +4862,7 @@ mips_split_move (rtx dest, rtx src, enum mips_split_type split_type, rtx insn_)
{
rtx tmp = XEXP (src, 0);
mips_classify_address (&addr, tmp, GET_MODE (tmp), true);
- if (REGNO (addr.reg) != REGNO (dest))
+ if (addr.reg && !reg_overlap_mentioned_p (dest, addr.reg))
validate_change (next, &SET_SRC (set), src, false);
}
else
diff --git a/gcc/config/mips/mips.md b/gcc/config/mips/mips.md
index a9b0c86be07..3cfb1a751e9 100644
--- a/gcc/config/mips/mips.md
+++ b/gcc/config/mips/mips.md
@@ -5836,8 +5836,8 @@
"ISA_HAS_ROR"
{
if (CONST_INT_P (operands[2]))
- gcc_assert (INTVAL (operands[2]) >= 0
- && INTVAL (operands[2]) < GET_MODE_BITSIZE (<MODE>mode));
+ operands[2] = GEN_INT (INTVAL (operands[2])
+ & (GET_MODE_BITSIZE (<MODE>mode) - 1));
return "<d>ror\t%0,%1,%2";
}
diff --git a/gcc/config/pa/pa.c b/gcc/config/pa/pa.c
index 707ae5822c3..6d75f26e02f 100644
--- a/gcc/config/pa/pa.c
+++ b/gcc/config/pa/pa.c
@@ -7856,7 +7856,7 @@ pa_attr_length_call (rtx_insn *insn, int sibcall)
/* 64-bit plabel sequence. */
else if (TARGET_64BIT && !local_call)
- length += sibcall ? 28 : 24;
+ length += 24;
/* non-pic long absolute branch sequence. */
else if ((TARGET_LONG_ABS_CALL || local_call) && !flag_pic)
@@ -7928,38 +7928,24 @@ pa_output_call (rtx_insn *insn, rtx call_dest, int sibcall)
xoperands[0] = pa_get_deferred_plabel (call_dest);
xoperands[1] = gen_label_rtx ();
- /* If this isn't a sibcall, we put the load of %r27 into the
- delay slot. We can't do this in a sibcall as we don't
- have a second call-clobbered scratch register available.
- We don't need to do anything when generating fast indirect
- calls. */
- if (seq_length != 0 && !sibcall)
+ /* Put the load of %r27 into the delay slot. We don't need to
+ do anything when generating fast indirect calls. */
+ if (seq_length != 0)
{
final_scan_insn (NEXT_INSN (insn), asm_out_file,
optimize, 0, NULL);
/* Now delete the delay insn. */
SET_INSN_DELETED (NEXT_INSN (insn));
- seq_length = 0;
}
output_asm_insn ("addil LT'%0,%%r27", xoperands);
output_asm_insn ("ldd RT'%0(%%r1),%%r1", xoperands);
output_asm_insn ("ldd 0(%%r1),%%r1", xoperands);
-
- if (sibcall)
- {
- output_asm_insn ("ldd 24(%%r1),%%r27", xoperands);
- output_asm_insn ("ldd 16(%%r1),%%r1", xoperands);
- output_asm_insn ("bve (%%r1)", xoperands);
- }
- else
- {
- output_asm_insn ("ldd 16(%%r1),%%r2", xoperands);
- output_asm_insn ("bve,l (%%r2),%%r2", xoperands);
- output_asm_insn ("ldd 24(%%r1),%%r27", xoperands);
- seq_length = 1;
- }
+ output_asm_insn ("ldd 16(%%r1),%%r2", xoperands);
+ output_asm_insn ("bve,l (%%r2),%%r2", xoperands);
+ output_asm_insn ("ldd 24(%%r1),%%r27", xoperands);
+ seq_length = 1;
}
else
{
@@ -8052,20 +8038,22 @@ pa_output_call (rtx_insn *insn, rtx call_dest, int sibcall)
{
output_asm_insn ("addil LT'%0,%%r19", xoperands);
output_asm_insn ("ldw RT'%0(%%r1),%%r1", xoperands);
- output_asm_insn ("ldw 0(%%r1),%%r1", xoperands);
+ output_asm_insn ("ldw 0(%%r1),%%r22", xoperands);
}
else
{
output_asm_insn ("addil LR'%0-$global$,%%r27",
xoperands);
- output_asm_insn ("ldw RR'%0-$global$(%%r1),%%r1",
+ output_asm_insn ("ldw RR'%0-$global$(%%r1),%%r22",
xoperands);
}
- output_asm_insn ("bb,>=,n %%r1,30,.+16", xoperands);
- output_asm_insn ("depi 0,31,2,%%r1", xoperands);
- output_asm_insn ("ldw 4(%%sr0,%%r1),%%r19", xoperands);
- output_asm_insn ("ldw 0(%%sr0,%%r1),%%r1", xoperands);
+ output_asm_insn ("bb,>=,n %%r22,30,.+16", xoperands);
+ output_asm_insn ("depi 0,31,2,%%r22", xoperands);
+ /* Should this be an ordered load to ensure the target
+ address is loaded before the global pointer? */
+ output_asm_insn ("ldw 0(%%r22),%%r1", xoperands);
+ output_asm_insn ("ldw 4(%%r22),%%r19", xoperands);
if (!sibcall && !TARGET_PA_20)
{
@@ -8158,10 +8146,6 @@ pa_attr_length_indirect_call (rtx_insn *insn)
if (TARGET_PORTABLE_RUNTIME)
return 16;
- /* Inline version of $$dyncall. */
- if ((TARGET_NO_SPACE_REGS || TARGET_PA_20) && !optimize_size)
- return 20;
-
if (!TARGET_LONG_CALLS
&& ((TARGET_PA_20 && !TARGET_SOM && distance < 7600000)
|| distance < MAX_PCREL17F_OFFSET))
@@ -8171,12 +8155,15 @@ pa_attr_length_indirect_call (rtx_insn *insn)
if (!flag_pic)
return 12;
- /* Inline version of $$dyncall. */
- if (TARGET_NO_SPACE_REGS || TARGET_PA_20)
- return 20;
-
+ /* Inline versions of $$dyncall. */
if (!optimize_size)
- return 36;
+ {
+ if (TARGET_NO_SPACE_REGS)
+ return 28;
+
+ if (TARGET_PA_20)
+ return 32;
+ }
/* Long PIC pc-relative call. */
return 20;
@@ -8214,22 +8201,6 @@ pa_output_indirect_call (rtx_insn *insn, rtx call_dest)
return "blr %%r0,%%r2\n\tbv,n %%r0(%%r31)";
}
- /* Maybe emit a fast inline version of $$dyncall. */
- if ((TARGET_NO_SPACE_REGS || TARGET_PA_20) && !optimize_size)
- {
- output_asm_insn ("bb,>=,n %%r22,30,.+12\n\t"
- "ldw 2(%%r22),%%r19\n\t"
- "ldw -2(%%r22),%%r22", xoperands);
- pa_output_arg_descriptor (insn);
- if (TARGET_NO_SPACE_REGS)
- {
- if (TARGET_PA_20)
- return "bve,l,n (%%r22),%%r2\n\tnop";
- return "ble 0(%%sr4,%%r22)\n\tcopy %%r31,%%r2";
- }
- return "bve,l (%%r22),%%r2\n\tstw %%r2,-24(%%sp)";
- }
-
/* Now the normal case -- we can reach $$dyncall directly or
we're sure that we can get there via a long-branch stub.
@@ -8258,35 +8229,40 @@ pa_output_indirect_call (rtx_insn *insn, rtx call_dest)
return "ble R'$$dyncall(%%sr4,%%r2)\n\tcopy %%r31,%%r2";
}
- /* Maybe emit a fast inline version of $$dyncall. The long PIC
- pc-relative call sequence is five instructions. The inline PA 2.0
- version of $$dyncall is also five instructions. The PA 1.X versions
- are longer but still an overall win. */
- if (TARGET_NO_SPACE_REGS || TARGET_PA_20 || !optimize_size)
+ /* The long PIC pc-relative call sequence is five instructions. So,
+ let's use an inline version of $$dyncall when the calling sequence
+ has a roughly similar number of instructions and we are not optimizing
+ for size. We need two instructions to load the return pointer plus
+ the $$dyncall implementation. */
+ if (!optimize_size)
{
- output_asm_insn ("bb,>=,n %%r22,30,.+12\n\t"
- "ldw 2(%%r22),%%r19\n\t"
- "ldw -2(%%r22),%%r22", xoperands);
if (TARGET_NO_SPACE_REGS)
{
pa_output_arg_descriptor (insn);
- if (TARGET_PA_20)
- return "bve,l,n (%%r22),%%r2\n\tnop";
- return "ble 0(%%sr4,%%r22)\n\tcopy %%r31,%%r2";
+ output_asm_insn ("bl .+8,%%r2\n\t"
+ "ldo 20(%%r2),%%r2\n\t"
+ "extru,<> %%r22,30,1,%%r0\n\t"
+ "bv,n %%r0(%%r22)\n\t"
+ "ldw -2(%%r22),%%r21\n\t"
+ "bv %%r0(%%r21)\n\t"
+ "ldw 2(%%r22),%%r19", xoperands);
+ return "";
}
if (TARGET_PA_20)
{
pa_output_arg_descriptor (insn);
- return "bve,l (%%r22),%%r2\n\tstw %%r2,-24(%%sp)";
+ output_asm_insn ("bl .+8,%%r2\n\t"
+ "ldo 24(%%r2),%%r2\n\t"
+ "stw %%r2,-24(%%sp)\n\t"
+ "extru,<> %r22,30,1,%%r0\n\t"
+ "bve,n (%%r22)\n\t"
+ "ldw -2(%%r22),%%r21\n\t"
+ "bve (%%r21)\n\t"
+ "ldw 2(%%r22),%%r19", xoperands);
+ return "";
}
- output_asm_insn ("bl .+8,%%r2\n\t"
- "ldo 16(%%r2),%%r2\n\t"
- "ldsid (%%r22),%%r1\n\t"
- "mtsp %%r1,%%sr0", xoperands);
- pa_output_arg_descriptor (insn);
- return "be 0(%%sr0,%%r22)\n\tstw %%r2,-24(%%sp)";
}
-
+
/* We need a long PIC call to $$dyncall. */
xoperands[0] = gen_rtx_SYMBOL_REF (Pmode, "$$dyncall");
xoperands[1] = gen_rtx_REG (Pmode, 2);
@@ -10048,7 +10024,7 @@ pa_modes_tieable_p (machine_mode mode1, machine_mode mode2)
/* Length in units of the trampoline instruction code. */
-#define TRAMPOLINE_CODE_SIZE (TARGET_64BIT ? 24 : (TARGET_PA_20 ? 32 : 40))
+#define TRAMPOLINE_CODE_SIZE (TARGET_64BIT ? 24 : (TARGET_PA_20 ? 36 : 48))
/* Output assembler code for a block containing the constant parts
@@ -10069,27 +10045,46 @@ pa_asm_trampoline_template (FILE *f)
{
if (!TARGET_64BIT)
{
- fputs ("\tldw 36(%r22),%r21\n", f);
- fputs ("\tbb,>=,n %r21,30,.+16\n", f);
- if (ASSEMBLER_DIALECT == 0)
- fputs ("\tdepi 0,31,2,%r21\n", f);
- else
- fputs ("\tdepwi 0,31,2,%r21\n", f);
- fputs ("\tldw 4(%r21),%r19\n", f);
- fputs ("\tldw 0(%r21),%r21\n", f);
if (TARGET_PA_20)
{
- fputs ("\tbve (%r21)\n", f);
- fputs ("\tldw 40(%r22),%r29\n", f);
+ fputs ("\tmfia %r20\n", f);
+ fputs ("\tldw 48(%r20),%r22\n", f);
+ fputs ("\tcopy %r22,%r21\n", f);
+ fputs ("\tbb,>=,n %r22,30,.+16\n", f);
+ fputs ("\tdepwi 0,31,2,%r22\n", f);
+ fputs ("\tldw 0(%r22),%r21\n", f);
+ fputs ("\tldw 4(%r22),%r19\n", f);
+ fputs ("\tbve (%r21)\n", f);
+ fputs ("\tldw 52(%r1),%r29\n", f);
+ fputs ("\t.word 0\n", f);
fputs ("\t.word 0\n", f);
fputs ("\t.word 0\n", f);
}
else
{
+ if (ASSEMBLER_DIALECT == 0)
+ {
+ fputs ("\tbl .+8,%r20\n", f);
+ fputs ("\tdepi 0,31,2,%r20\n", f);
+ }
+ else
+ {
+ fputs ("\tb,l .+8,%r20\n", f);
+ fputs ("\tdepwi 0,31,2,%r20\n", f);
+ }
+ fputs ("\tldw 40(%r20),%r22\n", f);
+ fputs ("\tcopy %r22,%r21\n", f);
+ fputs ("\tbb,>=,n %r22,30,.+16\n", f);
+ if (ASSEMBLER_DIALECT == 0)
+ fputs ("\tdepi 0,31,2,%r22\n", f);
+ else
+ fputs ("\tdepwi 0,31,2,%r22\n", f);
+ fputs ("\tldw 0(%r22),%r21\n", f);
+ fputs ("\tldw 4(%r22),%r19\n", f);
fputs ("\tldsid (%r21),%r1\n", f);
fputs ("\tmtsp %r1,%sr0\n", f);
- fputs ("\tbe 0(%sr0,%r21)\n", f);
- fputs ("\tldw 40(%r22),%r29\n", f);
+ fputs ("\tbe 0(%sr0,%r21)\n", f);
+ fputs ("\tldw 44(%r20),%r29\n", f);
}
fputs ("\t.word 0\n", f);
fputs ("\t.word 0\n", f);
@@ -10103,11 +10098,11 @@ pa_asm_trampoline_template (FILE *f)
fputs ("\t.dword 0\n", f);
fputs ("\t.dword 0\n", f);
fputs ("\tmfia %r31\n", f);
- fputs ("\tldd 24(%r31),%r1\n", f);
- fputs ("\tldd 24(%r1),%r27\n", f);
- fputs ("\tldd 16(%r1),%r1\n", f);
- fputs ("\tbve (%r1)\n", f);
+ fputs ("\tldd 24(%r31),%r27\n", f);
fputs ("\tldd 32(%r31),%r31\n", f);
+ fputs ("\tldd 16(%r27),%r1\n", f);
+ fputs ("\tbve (%r1)\n", f);
+ fputs ("\tldd 24(%r27),%r27\n", f);
fputs ("\t.dword 0 ; fptr\n", f);
fputs ("\t.dword 0 ; static link\n", f);
}
@@ -10117,10 +10112,10 @@ pa_asm_trampoline_template (FILE *f)
FNADDR is an RTX for the address of the function's pure code.
CXT is an RTX for the static chain value for the function.
- Move the function address to the trampoline template at offset 36.
- Move the static chain value to trampoline template at offset 40.
- Move the trampoline address to trampoline template at offset 44.
- Move r19 to trampoline template at offset 48. The latter two
+ Move the function address to the trampoline template at offset 48.
+ Move the static chain value to trampoline template at offset 52.
+ Move the trampoline address to trampoline template at offset 56.
+ Move r19 to trampoline template at offset 60. The latter two
words create a plabel for the indirect call to the trampoline.
A similar sequence is used for the 64-bit port but the plabel is
@@ -10146,15 +10141,15 @@ pa_trampoline_init (rtx m_tramp, tree fndecl, rtx chain_value)
if (!TARGET_64BIT)
{
- tmp = adjust_address (m_tramp, Pmode, 36);
+ tmp = adjust_address (m_tramp, Pmode, 48);
emit_move_insn (tmp, fnaddr);
- tmp = adjust_address (m_tramp, Pmode, 40);
+ tmp = adjust_address (m_tramp, Pmode, 52);
emit_move_insn (tmp, chain_value);
/* Create a fat pointer for the trampoline. */
- tmp = adjust_address (m_tramp, Pmode, 44);
+ tmp = adjust_address (m_tramp, Pmode, 56);
emit_move_insn (tmp, r_tramp);
- tmp = adjust_address (m_tramp, Pmode, 48);
+ tmp = adjust_address (m_tramp, Pmode, 60);
emit_move_insn (tmp, gen_rtx_REG (Pmode, 19));
/* fdc and fic only use registers for the address to flush,
@@ -10206,20 +10201,20 @@ pa_trampoline_init (rtx m_tramp, tree fndecl, rtx chain_value)
}
#ifdef HAVE_ENABLE_EXECUTE_STACK
-  emit_library_call (gen_rtx_SYMBOL_REF (Pmode, "__enable_execute_stack"),
+ emit_library_call (gen_rtx_SYMBOL_REF (Pmode, "__enable_execute_stack"),
LCT_NORMAL, VOIDmode, XEXP (m_tramp, 0), Pmode);
#endif
}
/* Perform any machine-specific adjustment in the address of the trampoline.
ADDR contains the address that was passed to pa_trampoline_init.
- Adjust the trampoline address to point to the plabel at offset 44. */
+ Adjust the trampoline address to point to the plabel at offset 56. */
static rtx
pa_trampoline_adjust_address (rtx addr)
{
if (!TARGET_64BIT)
- addr = memory_address (Pmode, plus_constant (Pmode, addr, 46));
+ addr = memory_address (Pmode, plus_constant (Pmode, addr, 58));
return addr;
}
diff --git a/gcc/config/pa/pa.h b/gcc/config/pa/pa.h
index 561efa51882..24739e56f97 100644
--- a/gcc/config/pa/pa.h
+++ b/gcc/config/pa/pa.h
@@ -689,7 +689,7 @@ extern int may_call_alloca;
/* Length in units of the trampoline for entering a nested function. */
-#define TRAMPOLINE_SIZE (TARGET_64BIT ? 72 : 52)
+#define TRAMPOLINE_SIZE (TARGET_64BIT ? 72 : 64)
/* Alignment required by the trampoline. */
@@ -1293,13 +1293,12 @@ do { \
#endif
/* The maximum offset in bytes for a PA 1.X pc-relative call to the
- head of the preceding stub table. The selected offsets have been
- chosen so that approximately one call stub is allocated for every
- 86.7 instructions. A long branch stub is two instructions when
- not generating PIC code. For HP-UX and ELF targets, PIC stubs are
- seven and four instructions, respectively. */
-#define MAX_PCREL17F_OFFSET \
- (flag_pic ? (TARGET_HPUX ? 198164 : 221312) : 240000)
+ head of the preceding stub table. A long branch stub is two or three
+ instructions for non-PIC and PIC, respectively. Import stubs are
+ seven and five instructions for HP-UX and ELF targets, respectively.
+ The default stub group size for ELF targets is 217856 bytes.
+ FIXME: We need an option to set the maximum offset. */
+#define MAX_PCREL17F_OFFSET (TARGET_HPUX ? 198164 : 217856)
#define NEED_INDICATE_EXEC_STACK 0
diff --git a/gcc/config/pa/pa.md b/gcc/config/pa/pa.md
index 84630ad536d..e273cddc01d 100644
--- a/gcc/config/pa/pa.md
+++ b/gcc/config/pa/pa.md
@@ -10091,23 +10091,55 @@ add,l %2,%3,%3\;bv,n %%r0(%3)"
(set_attr "length" "4,16")])
;; PA 2.0 hardware supports out-of-order execution of loads and stores, so
-;; we need a memory barrier to enforce program order for memory references.
-;; Since we want PA 1.x code to be PA 2.0 compatible, we also need the
-;; barrier when generating PA 1.x code.
+;; we need memory barriers to enforce program order for memory references
+;; when the TLB and PSW O bits are not set. We assume all PA 2.0 systems
+;; are weakly ordered since neither HP-UX or Linux set the PSW O bit. Since
+;; we want PA 1.x code to be PA 2.0 compatible, we also need barriers when
+;; generating PA 1.x code even though all PA 1.x systems are strongly ordered.
+
+;; When barriers are needed, we use a strongly ordered ldcw instruction as
+;; the barrier. Most PA 2.0 targets are cache coherent. In that case, we
+;; can use the coherent cache control hint and avoid aligning the ldcw
+;; address. In spite of its description, it is not clear that the sync
+;; instruction works as a barrier.
(define_expand "memory_barrier"
- [(set (match_dup 0)
- (unspec:BLK [(match_dup 0)] UNSPEC_MEMORY_BARRIER))]
+ [(parallel
+ [(set (match_dup 0) (unspec:BLK [(match_dup 0)] UNSPEC_MEMORY_BARRIER))
+ (clobber (match_dup 1))])]
""
{
- operands[0] = gen_rtx_MEM (BLKmode, gen_rtx_SCRATCH (Pmode));
+ /* We don't need a barrier if the target uses ordered memory references. */
+ if (TARGET_ORDERED)
+ FAIL;
+ operands[1] = gen_reg_rtx (Pmode);
+ operands[0] = gen_rtx_MEM (BLKmode, operands[1]);
MEM_VOLATILE_P (operands[0]) = 1;
})
-(define_insn "*memory_barrier"
+(define_insn "*memory_barrier_coherent"
[(set (match_operand:BLK 0 "" "")
- (unspec:BLK [(match_dup 0)] UNSPEC_MEMORY_BARRIER))]
- ""
- "sync"
+ (unspec:BLK [(match_dup 0)] UNSPEC_MEMORY_BARRIER))
+ (clobber (match_operand 1 "pmode_register_operand" "=r"))]
+ "TARGET_PA_20 && TARGET_COHERENT_LDCW"
+ "ldcw,co 0(%%sp),%1"
[(set_attr "type" "binary")
(set_attr "length" "4")])
+
+(define_insn "*memory_barrier_64"
+ [(set (match_operand:BLK 0 "" "")
+ (unspec:BLK [(match_dup 0)] UNSPEC_MEMORY_BARRIER))
+ (clobber (match_operand 1 "pmode_register_operand" "=&r"))]
+ "TARGET_64BIT"
+ "ldo 15(%%sp),%1\n\tdepd %%r0,63,3,%1\n\tldcw 0(%1),%1"
+ [(set_attr "type" "binary")
+ (set_attr "length" "12")])
+
+(define_insn "*memory_barrier_32"
+ [(set (match_operand:BLK 0 "" "")
+ (unspec:BLK [(match_dup 0)] UNSPEC_MEMORY_BARRIER))
+ (clobber (match_operand 1 "pmode_register_operand" "=&r"))]
+ ""
+ "ldo 15(%%sp),%1\n\t{dep|depw} %%r0,31,3,%1\n\tldcw 0(%1),%1"
+ [(set_attr "type" "binary")
+ (set_attr "length" "12")])
diff --git a/gcc/config/pa/pa.opt b/gcc/config/pa/pa.opt
index b32b3d8abc0..4cb81109933 100644
--- a/gcc/config/pa/pa.opt
+++ b/gcc/config/pa/pa.opt
@@ -45,6 +45,10 @@ mcaller-copies
Target Report Mask(CALLER_COPIES)
Caller copies function arguments passed by hidden reference.
+mcoherent-ldcw
+Target Report Var(TARGET_COHERENT_LDCW) Init(1)
+Use ldcw/ldcd coherent cache-control hint.
+
mdisable-fpregs
Target Report Mask(DISABLE_FPREGS)
Disable FP regs.
@@ -90,6 +94,10 @@ mno-space-regs
Target RejectNegative Report Mask(NO_SPACE_REGS)
Disable space regs.
+mordered
+Target Report Var(TARGET_ORDERED) Init(0)
+Assume memory references are ordered and barriers are not needed.
+
mpa-risc-1-0
Target RejectNegative
Generate PA1.0 code.
diff --git a/gcc/config/riscv/riscv-protos.h b/gcc/config/riscv/riscv-protos.h
index 8b510f87df8..5b0bbdd7cb4 100644
--- a/gcc/config/riscv/riscv-protos.h
+++ b/gcc/config/riscv/riscv-protos.h
@@ -44,10 +44,10 @@ extern int riscv_const_insns (rtx);
extern int riscv_split_const_insns (rtx);
extern int riscv_load_store_insns (rtx, rtx_insn *);
extern rtx riscv_emit_move (rtx, rtx);
-extern bool riscv_split_symbol (rtx, rtx, machine_mode, rtx *);
+extern bool riscv_split_symbol (rtx, rtx, machine_mode, rtx *, bool);
extern bool riscv_split_symbol_type (enum riscv_symbol_type);
extern rtx riscv_unspec_address (rtx, enum riscv_symbol_type);
-extern void riscv_move_integer (rtx, rtx, HOST_WIDE_INT);
+extern void riscv_move_integer (rtx, rtx, HOST_WIDE_INT, bool);
extern bool riscv_legitimize_move (machine_mode, rtx, rtx);
extern rtx riscv_subword (rtx, bool);
extern bool riscv_split_64bit_move_p (rtx, rtx);
diff --git a/gcc/config/riscv/riscv.c b/gcc/config/riscv/riscv.c
index 35219956c80..5cb295d3abb 100644
--- a/gcc/config/riscv/riscv.c
+++ b/gcc/config/riscv/riscv.c
@@ -508,8 +508,8 @@ riscv_split_integer (HOST_WIDE_INT val, machine_mode mode)
unsigned HOST_WIDE_INT hival = sext_hwi ((val - loval) >> 32, 32);
rtx hi = gen_reg_rtx (mode), lo = gen_reg_rtx (mode);
- riscv_move_integer (hi, hi, hival);
- riscv_move_integer (lo, lo, loval);
+ riscv_move_integer (hi, hi, hival, FALSE);
+ riscv_move_integer (lo, lo, loval, FALSE);
hi = gen_rtx_fmt_ee (ASHIFT, mode, hi, GEN_INT (32));
hi = force_reg (mode, hi);
@@ -1021,9 +1021,12 @@ riscv_force_binary (machine_mode mode, enum rtx_code code, rtx x, rtx y)
are allowed, copy it into a new register, otherwise use DEST. */
static rtx
-riscv_force_temporary (rtx dest, rtx value)
+riscv_force_temporary (rtx dest, rtx value, bool in_splitter)
{
- if (can_create_pseudo_p ())
+ /* We can't call gen_reg_rtx from a splitter, because this might realloc
+ the regno_reg_rtx array, which would invalidate reg rtx pointers in the
+ combine undo buffer. */
+ if (can_create_pseudo_p () && !in_splitter)
return force_reg (Pmode, value);
else
{
@@ -1082,7 +1085,7 @@ static rtx
riscv_unspec_offset_high (rtx temp, rtx addr, enum riscv_symbol_type symbol_type)
{
addr = gen_rtx_HIGH (Pmode, riscv_unspec_address (addr, symbol_type));
- return riscv_force_temporary (temp, addr);
+ return riscv_force_temporary (temp, addr, FALSE);
}
/* Load an entry from the GOT for a TLS GD access. */
@@ -1130,7 +1133,8 @@ static rtx riscv_tls_add_tp_le (rtx dest, rtx base, rtx sym)
is guaranteed to be a legitimate address for mode MODE. */
bool
-riscv_split_symbol (rtx temp, rtx addr, machine_mode mode, rtx *low_out)
+riscv_split_symbol (rtx temp, rtx addr, machine_mode mode, rtx *low_out,
+ bool in_splitter)
{
enum riscv_symbol_type symbol_type;
@@ -1146,7 +1150,7 @@ riscv_split_symbol (rtx temp, rtx addr, machine_mode mode, rtx *low_out)
case SYMBOL_ABSOLUTE:
{
rtx high = gen_rtx_HIGH (Pmode, copy_rtx (addr));
- high = riscv_force_temporary (temp, high);
+ high = riscv_force_temporary (temp, high, in_splitter);
*low_out = gen_rtx_LO_SUM (Pmode, high, addr);
}
break;
@@ -1205,8 +1209,9 @@ riscv_add_offset (rtx temp, rtx reg, HOST_WIDE_INT offset)
overflow, so we need to force a sign-extension check. */
high = gen_int_mode (CONST_HIGH_PART (offset), Pmode);
offset = CONST_LOW_PART (offset);
- high = riscv_force_temporary (temp, high);
- reg = riscv_force_temporary (temp, gen_rtx_PLUS (Pmode, high, reg));
+ high = riscv_force_temporary (temp, high, FALSE);
+ reg = riscv_force_temporary (temp, gen_rtx_PLUS (Pmode, high, reg),
+ FALSE);
}
return plus_constant (Pmode, reg, offset);
}
@@ -1315,7 +1320,7 @@ riscv_legitimize_address (rtx x, rtx oldx ATTRIBUTE_UNUSED,
return riscv_legitimize_tls_address (x);
/* See if the address can split into a high part and a LO_SUM. */
- if (riscv_split_symbol (NULL, x, mode, &addr))
+ if (riscv_split_symbol (NULL, x, mode, &addr, FALSE))
return riscv_force_address (addr, mode);
/* Handle BASE + OFFSET using riscv_add_offset. */
@@ -1337,17 +1342,23 @@ riscv_legitimize_address (rtx x, rtx oldx ATTRIBUTE_UNUSED,
/* Load VALUE into DEST. TEMP is as for riscv_force_temporary. */
void
-riscv_move_integer (rtx temp, rtx dest, HOST_WIDE_INT value)
+riscv_move_integer (rtx temp, rtx dest, HOST_WIDE_INT value,
+ bool in_splitter)
{
struct riscv_integer_op codes[RISCV_MAX_INTEGER_OPS];
machine_mode mode;
int i, num_ops;
rtx x;
+ /* We can't call gen_reg_rtx from a splitter, because this might realloc
+ the regno_reg_rtx array, which would invalidate reg rtx pointers in the
+ combine undo buffer. */
+ bool can_create_pseudo = can_create_pseudo_p () && ! in_splitter;
+
mode = GET_MODE (dest);
num_ops = riscv_build_integer (codes, value, mode);
- if (can_create_pseudo_p () && num_ops > 2 /* not a simple constant */
+ if (can_create_pseudo && num_ops > 2 /* not a simple constant */
&& num_ops >= riscv_split_integer_cost (value))
x = riscv_split_integer (value, mode);
else
@@ -1357,7 +1368,7 @@ riscv_move_integer (rtx temp, rtx dest, HOST_WIDE_INT value)
for (i = 1; i < num_ops; i++)
{
- if (!can_create_pseudo_p ())
+ if (!can_create_pseudo)
x = riscv_emit_set (temp, x);
else
x = force_reg (mode, x);
@@ -1381,12 +1392,12 @@ riscv_legitimize_const_move (machine_mode mode, rtx dest, rtx src)
/* Split moves of big integers into smaller pieces. */
if (splittable_const_int_operand (src, mode))
{
- riscv_move_integer (dest, dest, INTVAL (src));
+ riscv_move_integer (dest, dest, INTVAL (src), FALSE);
return;
}
/* Split moves of symbolic constants into high/low pairs. */
- if (riscv_split_symbol (dest, src, MAX_MACHINE_MODE, &src))
+ if (riscv_split_symbol (dest, src, MAX_MACHINE_MODE, &src, FALSE))
{
riscv_emit_set (dest, src);
return;
@@ -1407,7 +1418,7 @@ riscv_legitimize_const_move (machine_mode mode, rtx dest, rtx src)
if (offset != const0_rtx
&& (targetm.cannot_force_const_mem (mode, src) || can_create_pseudo_p ()))
{
- base = riscv_force_temporary (dest, base);
+ base = riscv_force_temporary (dest, base, FALSE);
riscv_emit_move (dest, riscv_add_offset (NULL, base, INTVAL (offset)));
return;
}
@@ -1416,7 +1427,7 @@ riscv_legitimize_const_move (machine_mode mode, rtx dest, rtx src)
/* When using explicit relocs, constant pool references are sometimes
not legitimate addresses. */
- riscv_split_symbol (dest, XEXP (src, 0), mode, &XEXP (src, 0));
+ riscv_split_symbol (dest, XEXP (src, 0), mode, &XEXP (src, 0), FALSE);
riscv_emit_move (dest, src);
}
diff --git a/gcc/config/riscv/riscv.md b/gcc/config/riscv/riscv.md
index a8bac170e72..e40535c9e40 100644
--- a/gcc/config/riscv/riscv.md
+++ b/gcc/config/riscv/riscv.md
@@ -1051,7 +1051,9 @@
"@
#
lwu\t%0,%1"
- "&& reload_completed && REG_P (operands[1])"
+ "&& reload_completed
+ && REG_P (operands[1])
+ && !paradoxical_subreg_p (operands[0])"
[(set (match_dup 0)
(ashift:DI (match_dup 1) (const_int 32)))
(set (match_dup 0)
@@ -1068,7 +1070,9 @@
"@
#
lhu\t%0,%1"
- "&& reload_completed && REG_P (operands[1])"
+ "&& reload_completed
+ && REG_P (operands[1])
+ && !paradoxical_subreg_p (operands[0])"
[(set (match_dup 0)
(ashift:GPR (match_dup 1) (match_dup 2)))
(set (match_dup 0)
@@ -1117,7 +1121,9 @@
"@
#
l<SHORT:size>\t%0,%1"
- "&& reload_completed && REG_P (operands[1])"
+ "&& reload_completed
+ && REG_P (operands[1])
+ && !paradoxical_subreg_p (operands[0])"
[(set (match_dup 0) (ashift:SI (match_dup 1) (match_dup 2)))
(set (match_dup 0) (ashiftrt:SI (match_dup 0) (match_dup 2)))]
{
@@ -1278,7 +1284,7 @@
""
[(const_int 0)]
{
- riscv_move_integer (operands[2], operands[0], INTVAL (operands[1]));
+ riscv_move_integer (operands[2], operands[0], INTVAL (operands[1]), TRUE);
DONE;
})
@@ -1287,11 +1293,11 @@
[(set (match_operand:P 0 "register_operand")
(match_operand:P 1))
(clobber (match_operand:P 2 "register_operand"))]
- "riscv_split_symbol (operands[2], operands[1], MAX_MACHINE_MODE, NULL)"
+ "riscv_split_symbol (operands[2], operands[1], MAX_MACHINE_MODE, NULL, TRUE)"
[(set (match_dup 0) (match_dup 3))]
{
riscv_split_symbol (operands[2], operands[1],
- MAX_MACHINE_MODE, &operands[3]);
+ MAX_MACHINE_MODE, &operands[3], TRUE);
})
;; 64-bit integer moves
@@ -1765,15 +1771,20 @@
;; Handle AND with 2^N-1 for N from 12 to XLEN. This can be split into
;; two logical shifts. Otherwise it requires 3 instructions: lui,
;; xor/addi/srli, and.
+
+;; Generating a temporary for the shift output gives better combiner results;
+;; and also fixes a problem where op0 could be a paradoxical reg and shifting
+;; by amounts larger than the size of the SUBREG_REG doesn't work.
(define_split
[(set (match_operand:GPR 0 "register_operand")
(and:GPR (match_operand:GPR 1 "register_operand")
- (match_operand:GPR 2 "p2m1_shift_operand")))]
+ (match_operand:GPR 2 "p2m1_shift_operand")))
+ (clobber (match_operand:GPR 3 "register_operand"))]
""
- [(set (match_dup 0)
+ [(set (match_dup 3)
(ashift:GPR (match_dup 1) (match_dup 2)))
(set (match_dup 0)
- (lshiftrt:GPR (match_dup 0) (match_dup 2)))]
+ (lshiftrt:GPR (match_dup 3) (match_dup 2)))]
{
/* Op2 is a VOIDmode constant, so get the mode size from op1. */
operands[2] = GEN_INT (GET_MODE_BITSIZE (GET_MODE (operands[1]))
@@ -1785,12 +1796,13 @@
(define_split
[(set (match_operand:DI 0 "register_operand")
(and:DI (match_operand:DI 1 "register_operand")
- (match_operand:DI 2 "high_mask_shift_operand")))]
+ (match_operand:DI 2 "high_mask_shift_operand")))
+ (clobber (match_operand:DI 3 "register_operand"))]
"TARGET_64BIT"
- [(set (match_dup 0)
+ [(set (match_dup 3)
(lshiftrt:DI (match_dup 1) (match_dup 2)))
(set (match_dup 0)
- (ashift:DI (match_dup 0) (match_dup 2)))]
+ (ashift:DI (match_dup 3) (match_dup 2)))]
{
operands[2] = GEN_INT (ctz_hwi (INTVAL (operands[2])));
})
diff --git a/gcc/config/rs6000/altivec.md b/gcc/config/rs6000/altivec.md
index 4a1150e0994..654d756647c 100644
--- a/gcc/config/rs6000/altivec.md
+++ b/gcc/config/rs6000/altivec.md
@@ -80,9 +80,6 @@
UNSPEC_VUPKHPX
UNSPEC_VUPKLPX
UNSPEC_CONVERT_4F32_8I16
- UNSPEC_DARN
- UNSPEC_DARN_32
- UNSPEC_DARN_RAW
UNSPEC_DST
UNSPEC_DSTT
UNSPEC_DSTST
@@ -161,9 +158,6 @@
UNSPEC_BCDADD
UNSPEC_BCDSUB
UNSPEC_BCD_OVERFLOW
- UNSPEC_CMPRB
- UNSPEC_CMPRB2
- UNSPEC_CMPEQB
UNSPEC_VRLMI
UNSPEC_VRLNM
])
@@ -566,7 +560,7 @@
[(set_attr "type" "vecsimple")])
;;
-(define_insn "altivec_vavgu<VI_char>"
+(define_insn "uavg<mode>3_ceil"
[(set (match_operand:VI 0 "register_operand" "=v")
(unspec:VI [(match_operand:VI 1 "register_operand" "v")
(match_operand:VI 2 "register_operand" "v")]
@@ -575,7 +569,7 @@
"vavgu<VI_char> %0,%1,%2"
[(set_attr "type" "vecsimple")])
-(define_insn "altivec_vavgs<VI_char>"
+(define_insn "avg<mode>3_ceil"
[(set (match_operand:VI 0 "register_operand" "=v")
(unspec:VI [(match_operand:VI 1 "register_operand" "v")
(match_operand:VI 2 "register_operand" "v")]
@@ -4101,223 +4095,6 @@
"bcd<bcd_add_sub>. %0,%1,%2,%3"
[(set_attr "type" "vecsimple")])
-(define_insn "darn_32"
- [(set (match_operand:SI 0 "register_operand" "=r")
- (unspec:SI [(const_int 0)] UNSPEC_DARN_32))]
- "TARGET_P9_MISC"
- "darn %0,0"
- [(set_attr "type" "integer")])
-
-(define_insn "darn_raw"
- [(set (match_operand:DI 0 "register_operand" "=r")
- (unspec:DI [(const_int 0)] UNSPEC_DARN_RAW))]
- "TARGET_P9_MISC && TARGET_64BIT"
- "darn %0,2"
- [(set_attr "type" "integer")])
-
-(define_insn "darn"
- [(set (match_operand:DI 0 "register_operand" "=r")
- (unspec:DI [(const_int 0)] UNSPEC_DARN))]
- "TARGET_P9_MISC && TARGET_64BIT"
- "darn %0,1"
- [(set_attr "type" "integer")])
-
-;; Test byte within range.
-;;
-;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
-;; represents a byte whose value is ignored in this context and
-;; vv, the least significant byte, holds the byte value that is to
-;; be tested for membership within the range specified by operand 2.
-;; The bytes of operand 2 are organized as xx:xx:hi:lo.
-;;
-;; Return in target register operand 0 a value of 1 if lo <= vv and
-;; vv <= hi. Otherwise, set register operand 0 to 0.
-;;
-;; Though the instructions to which this expansion maps operate on
-;; 64-bit registers, the current implementation only operates on
-;; SI-mode operands as the high-order bits provide no information
-;; that is not already available in the low-order bits. To avoid the
-;; costs of data widening operations, future enhancements might allow
-;; DI mode for operand 0 and/or might allow operand 1 to be QI mode.
-(define_expand "cmprb"
- [(set (match_dup 3)
- (unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
- (match_operand:SI 2 "gpc_reg_operand" "r")]
- UNSPEC_CMPRB))
- (set (match_operand:SI 0 "gpc_reg_operand" "=r")
- (if_then_else:SI (lt (match_dup 3)
- (const_int 0))
- (const_int -1)
- (if_then_else (gt (match_dup 3)
- (const_int 0))
- (const_int 1)
- (const_int 0))))]
- "TARGET_P9_MISC"
-{
- operands[3] = gen_reg_rtx (CCmode);
-})
-
-;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
-;; represents a byte whose value is ignored in this context and
-;; vv, the least significant byte, holds the byte value that is to
-;; be tested for membership within the range specified by operand 2.
-;; The bytes of operand 2 are organized as xx:xx:hi:lo.
-;;
-;; Set bit 1 (the GT bit, 0x4) of CR register operand 0 to 1 if
-;; lo <= vv and vv <= hi. Otherwise, set the GT bit to 0. The other
-;; 3 bits of the target CR register are all set to 0.
-(define_insn "*cmprb_internal"
- [(set (match_operand:CC 0 "cc_reg_operand" "=y")
- (unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
- (match_operand:SI 2 "gpc_reg_operand" "r")]
- UNSPEC_CMPRB))]
- "TARGET_P9_MISC"
- "cmprb %0,0,%1,%2"
- [(set_attr "type" "logical")])
-
-;; Set operand 0 register to -1 if the LT bit (0x8) of condition
-;; register operand 1 is on. Otherwise, set operand 0 register to 1
-;; if the GT bit (0x4) of condition register operand 1 is on.
-;; Otherwise, set operand 0 to 0. Note that the result stored into
-;; register operand 0 is non-zero iff either the LT or GT bits are on
-;; within condition register operand 1.
-(define_insn "setb_signed"
- [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
- (if_then_else:SI (lt (match_operand:CC 1 "cc_reg_operand" "y")
- (const_int 0))
- (const_int -1)
- (if_then_else (gt (match_dup 1)
- (const_int 0))
- (const_int 1)
- (const_int 0))))]
- "TARGET_P9_MISC"
- "setb %0,%1"
- [(set_attr "type" "logical")])
-
-(define_insn "setb_unsigned"
- [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
- (if_then_else:SI (ltu (match_operand:CCUNS 1 "cc_reg_operand" "y")
- (const_int 0))
- (const_int -1)
- (if_then_else (gtu (match_dup 1)
- (const_int 0))
- (const_int 1)
- (const_int 0))))]
- "TARGET_P9_MISC"
- "setb %0,%1"
- [(set_attr "type" "logical")])
-
-;; Test byte within two ranges.
-;;
-;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
-;; represents a byte whose value is ignored in this context and
-;; vv, the least significant byte, holds the byte value that is to
-;; be tested for membership within the range specified by operand 2.
-;; The bytes of operand 2 are organized as hi_1:lo_1:hi_2:lo_2.
-;;
-;; Return in target register operand 0 a value of 1 if (lo_1 <= vv and
-;; vv <= hi_1) or if (lo_2 <= vv and vv <= hi_2). Otherwise, set register
-;; operand 0 to 0.
-;;
-;; Though the instructions to which this expansion maps operate on
-;; 64-bit registers, the current implementation only operates on
-;; SI-mode operands as the high-order bits provide no information
-;; that is not already available in the low-order bits. To avoid the
-;; costs of data widening operations, future enhancements might allow
-;; DI mode for operand 0 and/or might allow operand 1 to be QI mode.
-(define_expand "cmprb2"
- [(set (match_dup 3)
- (unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
- (match_operand:SI 2 "gpc_reg_operand" "r")]
- UNSPEC_CMPRB2))
- (set (match_operand:SI 0 "gpc_reg_operand" "=r")
- (if_then_else:SI (lt (match_dup 3)
- (const_int 0))
- (const_int -1)
- (if_then_else (gt (match_dup 3)
- (const_int 0))
- (const_int 1)
- (const_int 0))))]
- "TARGET_P9_MISC"
-{
- operands[3] = gen_reg_rtx (CCmode);
-})
-
-;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
-;; represents a byte whose value is ignored in this context and
-;; vv, the least significant byte, holds the byte value that is to
-;; be tested for membership within the ranges specified by operand 2.
-;; The bytes of operand 2 are organized as hi_1:lo_1:hi_2:lo_2.
-;;
-;; Set bit 1 (the GT bit, 0x4) of CR register operand 0 to 1 if
-;; (lo_1 <= vv and vv <= hi_1) or if (lo_2 <= vv and vv <= hi_2).
-;; Otherwise, set the GT bit to 0. The other 3 bits of the target
-;; CR register are all set to 0.
-(define_insn "*cmprb2_internal"
- [(set (match_operand:CC 0 "cc_reg_operand" "=y")
- (unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
- (match_operand:SI 2 "gpc_reg_operand" "r")]
- UNSPEC_CMPRB2))]
- "TARGET_P9_MISC"
- "cmprb %0,1,%1,%2"
- [(set_attr "type" "logical")])
-
-;; Test byte membership within set of 8 bytes.
-;;
-;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
-;; represents a byte whose value is ignored in this context and
-;; vv, the least significant byte, holds the byte value that is to
-;; be tested for membership within the set specified by operand 2.
-;; The bytes of operand 2 are organized as e0:e1:e2:e3:e4:e5:e6:e7.
-;;
-;; Return in target register operand 0 a value of 1 if vv equals one
-;; of the values e0, e1, e2, e3, e4, e5, e6, or e7. Otherwise, set
-;; register operand 0 to 0. Note that the 8 byte values held within
-;; operand 2 need not be unique.
-;;
-;; Though the instructions to which this expansion maps operate on
-;; 64-bit registers, the current implementation requires that operands
-;; 0 and 1 have mode SI as the high-order bits provide no information
-;; that is not already available in the low-order bits. To avoid the
-;; costs of data widening operations, future enhancements might allow
-;; DI mode for operand 0 and/or might allow operand 1 to be QI mode.
-(define_expand "cmpeqb"
- [(set (match_dup 3)
- (unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
- (match_operand:DI 2 "gpc_reg_operand" "r")]
- UNSPEC_CMPEQB))
- (set (match_operand:SI 0 "gpc_reg_operand" "=r")
- (if_then_else:SI (lt (match_dup 3)
- (const_int 0))
- (const_int -1)
- (if_then_else (gt (match_dup 3)
- (const_int 0))
- (const_int 1)
- (const_int 0))))]
- "TARGET_P9_MISC && TARGET_64BIT"
-{
- operands[3] = gen_reg_rtx (CCmode);
-})
-
-;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
-;; represents a byte whose value is ignored in this context and
-;; vv, the least significant byte, holds the byte value that is to
-;; be tested for membership within the set specified by operand 2.
-;; The bytes of operand 2 are organized as e0:e1:e2:e3:e4:e5:e6:e7.
-;;
-;; Set bit 1 (the GT bit, 0x4) of CR register operand 0 to 1 if vv
-;; equals one of the values e0, e1, e2, e3, e4, e5, e6, or e7. Otherwise,
-;; set the GT bit to zero. The other 3 bits of the target CR register
-;; are all set to 0.
-(define_insn "*cmpeqb_internal"
- [(set (match_operand:CC 0 "cc_reg_operand" "=y")
- (unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
- (match_operand:DI 2 "gpc_reg_operand" "r")]
- UNSPEC_CMPEQB))]
- "TARGET_P9_MISC && TARGET_64BIT"
- "cmpeqb %0,%1,%2"
- [(set_attr "type" "logical")])
-
(define_expand "bcd<bcd_add_sub>_<code>"
[(parallel [(set (reg:CCFP CR6_REGNO)
(compare:CCFP
diff --git a/gcc/config/rs6000/darwin.h b/gcc/config/rs6000/darwin.h
index 98ecf0ad2fe..e36de59ca25 100644
--- a/gcc/config/rs6000/darwin.h
+++ b/gcc/config/rs6000/darwin.h
@@ -75,9 +75,6 @@
} \
while (0)
-/* Generate branch islands stubs if this is true. */
-extern int darwin_emit_branch_islands;
-
#define SUBTARGET_OVERRIDE_OPTIONS darwin_rs6000_override_options ()
#define C_COMMON_OVERRIDE_OPTIONS do { \
@@ -139,9 +136,30 @@ extern int darwin_emit_branch_islands;
%:version-compare(>< 10.5 10.7 mmacosx-version-min= -lcrt1.10.5.o) \
%{fgnu-tm: -lcrttms.o}"
-/* crt2.o is at least partially required for 10.3.x and earlier. */
+/* crt2.o is at least partially required for 10.3.x and earlier.
+ It deals with registration of the unwind frames, where this is not
+ automatically provided by the system. So we need it for any case that
+ might use exceptions. */
+#undef DARWIN_CRT2_SPEC
#define DARWIN_CRT2_SPEC \
- "%{!m64:%:version-compare(!> 10.4 mmacosx-version-min= crt2.o%s)}"
+"%{!m64:%{shared-libgcc|static-libstdc++|fexceptions|fobjc-exceptions|fgnu-runtime: \
+ %:version-compare(!> 10.4 mmacosx-version-min= crt2.o%s) \
+ }}"
+
+/* crt3 deals with providing cxa_atexit on earlier systems (or fixing it up,
+ for broken versions). It's only needed for c++ code, so we can make it
+ conditional on shared-libgcc since that's forced on for c++. */
+#undef DARWIN_CRT3_SPEC
+#define DARWIN_CRT3_SPEC \
+"%{!m64:%{shared-libgcc|static-libstdc++: \
+ %:version-compare(>< 10.4 10.5 mmacosx-version-min= crt3.o%s) \
+ %:version-compare(!> 10.4 mmacosx-version-min= crt3_2.o%s) \
+ }}"
+
+/* The PPC regs save/restore functions are leaves and could, conceivably
+ be used by the tm destructor. */
+#undef ENDFILE_SPEC
+#define ENDFILE_SPEC TM_DESTRUCTOR " -lef_ppc"
#undef SUBTARGET_EXTRA_SPECS
#define SUBTARGET_EXTRA_SPECS \
@@ -291,9 +309,9 @@ extern int darwin_emit_branch_islands;
/* This is supported in cctools 465 and later. The macro test
above prevents using it in earlier build environments. */
#define ASM_OUTPUT_MAX_SKIP_ALIGN(FILE,LOG,MAX_SKIP) \
- if ((LOG) != 0) \
+ if ((LOG) > 0) \
{ \
- if ((MAX_SKIP) == 0) \
+ if ((MAX_SKIP) <= 0) \
fprintf ((FILE), "\t.p2align %d\n", (LOG)); \
else \
fprintf ((FILE), "\t.p2align %d,,%d\n", (LOG), (MAX_SKIP)); \
@@ -468,6 +486,9 @@ do { \
this will need to be modified similar to the x86 case. */
#define TARGET_FOLD_BUILTIN SUBTARGET_FOLD_BUILTIN
+/* First available SYMBOL flag bit for use by subtargets. */
+#define SYMBOL_FLAG_SUBT_DEP (SYMBOL_FLAG_MACH_DEP)
+
/* Use standard DWARF numbering for DWARF debugging information. */
#define RS6000_USE_DWARF_NUMBERING
diff --git a/gcc/config/rs6000/darwin.md b/gcc/config/rs6000/darwin.md
index 471058dd417..a1a46a9e7ea 100644
--- a/gcc/config/rs6000/darwin.md
+++ b/gcc/config/rs6000/darwin.md
@@ -122,33 +122,6 @@ You should have received a copy of the GNU General Public License
[(set_attr "type" "store")])
;; 64-bit MachO load/store support
-(define_insn "movdi_low"
- [(set (match_operand:DI 0 "gpc_reg_operand" "=r,*!d")
- (mem:DI (lo_sum:DI (match_operand:DI 1 "gpc_reg_operand" "b,b")
- (match_operand 2 "" ""))))]
- "TARGET_MACHO && TARGET_64BIT"
- "@
- ld %0,lo16(%2)(%1)
- lfd %0,lo16(%2)(%1)"
- [(set_attr "type" "load")])
-
-(define_insn "movsi_low_st"
- [(set (mem:SI (lo_sum:SI (match_operand:SI 1 "gpc_reg_operand" "b")
- (match_operand 2 "" "")))
- (match_operand:SI 0 "gpc_reg_operand" "r"))]
- "TARGET_MACHO && ! TARGET_64BIT"
- "stw %0,lo16(%2)(%1)"
- [(set_attr "type" "store")])
-
-(define_insn "movdi_low_st"
- [(set (mem:DI (lo_sum:DI (match_operand:DI 1 "gpc_reg_operand" "b,b")
- (match_operand 2 "" "")))
- (match_operand:DI 0 "gpc_reg_operand" "r,*!d"))]
- "TARGET_MACHO && TARGET_64BIT"
- "@
- std %0,lo16(%2)(%1)
- stfd %0,lo16(%2)(%1)"
- [(set_attr "type" "store")])
;; Mach-O PIC trickery.
(define_expand "macho_high"
diff --git a/gcc/config/rs6000/rs6000-builtin.def b/gcc/config/rs6000/rs6000-builtin.def
index 0a2bdb79e15..0feee7cafca 100644
--- a/gcc/config/rs6000/rs6000-builtin.def
+++ b/gcc/config/rs6000/rs6000-builtin.def
@@ -1002,12 +1002,12 @@ BU_ALTIVEC_2 (VADDUWS, "vadduws", CONST, altivec_vadduws)
BU_ALTIVEC_2 (VADDSWS, "vaddsws", CONST, altivec_vaddsws)
BU_ALTIVEC_2 (VAND, "vand", CONST, andv4si3)
BU_ALTIVEC_2 (VANDC, "vandc", CONST, andcv4si3)
-BU_ALTIVEC_2 (VAVGUB, "vavgub", CONST, altivec_vavgub)
-BU_ALTIVEC_2 (VAVGSB, "vavgsb", CONST, altivec_vavgsb)
-BU_ALTIVEC_2 (VAVGUH, "vavguh", CONST, altivec_vavguh)
-BU_ALTIVEC_2 (VAVGSH, "vavgsh", CONST, altivec_vavgsh)
-BU_ALTIVEC_2 (VAVGUW, "vavguw", CONST, altivec_vavguw)
-BU_ALTIVEC_2 (VAVGSW, "vavgsw", CONST, altivec_vavgsw)
+BU_ALTIVEC_2 (VAVGUB, "vavgub", CONST, uavgv16qi3_ceil)
+BU_ALTIVEC_2 (VAVGSB, "vavgsb", CONST, avgv16qi3_ceil)
+BU_ALTIVEC_2 (VAVGUH, "vavguh", CONST, uavgv8hi3_ceil)
+BU_ALTIVEC_2 (VAVGSH, "vavgsh", CONST, avgv8hi3_ceil)
+BU_ALTIVEC_2 (VAVGUW, "vavguw", CONST, uavgv4si3_ceil)
+BU_ALTIVEC_2 (VAVGSW, "vavgsw", CONST, avgv4si3_ceil)
BU_ALTIVEC_2 (VCFUX, "vcfux", CONST, altivec_vcfux)
BU_ALTIVEC_2 (VCFSX, "vcfsx", CONST, altivec_vcfsx)
BU_ALTIVEC_2 (VCMPBFP, "vcmpbfp", CONST, altivec_vcmpbfp)
@@ -1177,26 +1177,26 @@ BU_ALTIVEC_X (MTVSCR, "mtvscr", MISC)
BU_ALTIVEC_X (MFVSCR, "mfvscr", MISC)
BU_ALTIVEC_X (DSSALL, "dssall", MISC)
BU_ALTIVEC_X (DSS, "dss", MISC)
-BU_ALTIVEC_X (LVSL, "lvsl", MEM)
-BU_ALTIVEC_X (LVSR, "lvsr", MEM)
-BU_ALTIVEC_X (LVEBX, "lvebx", MEM)
-BU_ALTIVEC_X (LVEHX, "lvehx", MEM)
-BU_ALTIVEC_X (LVEWX, "lvewx", MEM)
-BU_ALTIVEC_X (LVXL, "lvxl", MEM)
-BU_ALTIVEC_X (LVXL_V2DF, "lvxl_v2df", MEM)
-BU_ALTIVEC_X (LVXL_V2DI, "lvxl_v2di", MEM)
-BU_ALTIVEC_X (LVXL_V4SF, "lvxl_v4sf", MEM)
-BU_ALTIVEC_X (LVXL_V4SI, "lvxl_v4si", MEM)
-BU_ALTIVEC_X (LVXL_V8HI, "lvxl_v8hi", MEM)
-BU_ALTIVEC_X (LVXL_V16QI, "lvxl_v16qi", MEM)
-BU_ALTIVEC_X (LVX, "lvx", MEM)
-BU_ALTIVEC_X (LVX_V1TI, "lvx_v1ti", MEM)
-BU_ALTIVEC_X (LVX_V2DF, "lvx_v2df", MEM)
-BU_ALTIVEC_X (LVX_V2DI, "lvx_v2di", MEM)
-BU_ALTIVEC_X (LVX_V4SF, "lvx_v4sf", MEM)
-BU_ALTIVEC_X (LVX_V4SI, "lvx_v4si", MEM)
-BU_ALTIVEC_X (LVX_V8HI, "lvx_v8hi", MEM)
-BU_ALTIVEC_X (LVX_V16QI, "lvx_v16qi", MEM)
+BU_ALTIVEC_X (LVSL, "lvsl", PURE)
+BU_ALTIVEC_X (LVSR, "lvsr", PURE)
+BU_ALTIVEC_X (LVEBX, "lvebx", PURE)
+BU_ALTIVEC_X (LVEHX, "lvehx", PURE)
+BU_ALTIVEC_X (LVEWX, "lvewx", PURE)
+BU_ALTIVEC_X (LVXL, "lvxl", PURE)
+BU_ALTIVEC_X (LVXL_V2DF, "lvxl_v2df", PURE)
+BU_ALTIVEC_X (LVXL_V2DI, "lvxl_v2di", PURE)
+BU_ALTIVEC_X (LVXL_V4SF, "lvxl_v4sf", PURE)
+BU_ALTIVEC_X (LVXL_V4SI, "lvxl_v4si", PURE)
+BU_ALTIVEC_X (LVXL_V8HI, "lvxl_v8hi", PURE)
+BU_ALTIVEC_X (LVXL_V16QI, "lvxl_v16qi", PURE)
+BU_ALTIVEC_X (LVX, "lvx", PURE)
+BU_ALTIVEC_X (LVX_V1TI, "lvx_v1ti", PURE)
+BU_ALTIVEC_X (LVX_V2DF, "lvx_v2df", PURE)
+BU_ALTIVEC_X (LVX_V2DI, "lvx_v2di", PURE)
+BU_ALTIVEC_X (LVX_V4SF, "lvx_v4sf", PURE)
+BU_ALTIVEC_X (LVX_V4SI, "lvx_v4si", PURE)
+BU_ALTIVEC_X (LVX_V8HI, "lvx_v8hi", PURE)
+BU_ALTIVEC_X (LVX_V16QI, "lvx_v16qi", PURE)
BU_ALTIVEC_X (STVX, "stvx", MEM)
BU_ALTIVEC_X (STVX_V2DF, "stvx_v2df", MEM)
BU_ALTIVEC_X (STVX_V2DI, "stvx_v2di", MEM)
@@ -1204,10 +1204,10 @@ BU_ALTIVEC_X (STVX_V4SF, "stvx_v4sf", MEM)
BU_ALTIVEC_X (STVX_V4SI, "stvx_v4si", MEM)
BU_ALTIVEC_X (STVX_V8HI, "stvx_v8hi", MEM)
BU_ALTIVEC_X (STVX_V16QI, "stvx_v16qi", MEM)
-BU_ALTIVEC_C (LVLX, "lvlx", MEM)
-BU_ALTIVEC_C (LVLXL, "lvlxl", MEM)
-BU_ALTIVEC_C (LVRX, "lvrx", MEM)
-BU_ALTIVEC_C (LVRXL, "lvrxl", MEM)
+BU_ALTIVEC_C (LVLX, "lvlx", PURE)
+BU_ALTIVEC_C (LVLXL, "lvlxl", PURE)
+BU_ALTIVEC_C (LVRX, "lvrx", PURE)
+BU_ALTIVEC_C (LVRXL, "lvrxl", PURE)
BU_ALTIVEC_X (STVEBX, "stvebx", MEM)
BU_ALTIVEC_X (STVEHX, "stvehx", MEM)
BU_ALTIVEC_X (STVEWX, "stvewx", MEM)
@@ -1718,15 +1718,15 @@ BU_VSX_P (XVCMPGEDP_P, "xvcmpgedp_p", CONST, vector_ge_v2df_p)
BU_VSX_P (XVCMPGTDP_P, "xvcmpgtdp_p", CONST, vector_gt_v2df_p)
/* VSX builtins that are handled as special cases. */
-BU_VSX_X (LXSDX, "lxsdx", MEM)
-BU_VSX_X (LXVD2X_V1TI, "lxvd2x_v1ti", MEM)
-BU_VSX_X (LXVD2X_V2DF, "lxvd2x_v2df", MEM)
-BU_VSX_X (LXVD2X_V2DI, "lxvd2x_v2di", MEM)
-BU_VSX_X (LXVDSX, "lxvdsx", MEM)
-BU_VSX_X (LXVW4X_V4SF, "lxvw4x_v4sf", MEM)
-BU_VSX_X (LXVW4X_V4SI, "lxvw4x_v4si", MEM)
-BU_VSX_X (LXVW4X_V8HI, "lxvw4x_v8hi", MEM)
-BU_VSX_X (LXVW4X_V16QI, "lxvw4x_v16qi", MEM)
+BU_VSX_X (LXSDX, "lxsdx", PURE)
+BU_VSX_X (LXVD2X_V1TI, "lxvd2x_v1ti", PURE)
+BU_VSX_X (LXVD2X_V2DF, "lxvd2x_v2df", PURE)
+BU_VSX_X (LXVD2X_V2DI, "lxvd2x_v2di", PURE)
+BU_VSX_X (LXVDSX, "lxvdsx", PURE)
+BU_VSX_X (LXVW4X_V4SF, "lxvw4x_v4sf", PURE)
+BU_VSX_X (LXVW4X_V4SI, "lxvw4x_v4si", PURE)
+BU_VSX_X (LXVW4X_V8HI, "lxvw4x_v8hi", PURE)
+BU_VSX_X (LXVW4X_V16QI, "lxvw4x_v16qi", PURE)
BU_VSX_X (STXSDX, "stxsdx", MEM)
BU_VSX_X (STXVD2X_V1TI, "stxvd2x_v1ti", MEM)
BU_VSX_X (STXVD2X_V2DF, "stxvd2x_v2df", MEM)
@@ -1735,13 +1735,13 @@ BU_VSX_X (STXVW4X_V4SF, "stxvw4x_v4sf", MEM)
BU_VSX_X (STXVW4X_V4SI, "stxvw4x_v4si", MEM)
BU_VSX_X (STXVW4X_V8HI, "stxvw4x_v8hi", MEM)
BU_VSX_X (STXVW4X_V16QI, "stxvw4x_v16qi", MEM)
-BU_VSX_X (LD_ELEMREV_V1TI, "ld_elemrev_v1ti", MEM)
-BU_VSX_X (LD_ELEMREV_V2DF, "ld_elemrev_v2df", MEM)
-BU_VSX_X (LD_ELEMREV_V2DI, "ld_elemrev_v2di", MEM)
-BU_VSX_X (LD_ELEMREV_V4SF, "ld_elemrev_v4sf", MEM)
-BU_VSX_X (LD_ELEMREV_V4SI, "ld_elemrev_v4si", MEM)
-BU_VSX_X (LD_ELEMREV_V8HI, "ld_elemrev_v8hi", MEM)
-BU_VSX_X (LD_ELEMREV_V16QI, "ld_elemrev_v16qi", MEM)
+BU_VSX_X (LD_ELEMREV_V1TI, "ld_elemrev_v1ti", PURE)
+BU_VSX_X (LD_ELEMREV_V2DF, "ld_elemrev_v2df", PURE)
+BU_VSX_X (LD_ELEMREV_V2DI, "ld_elemrev_v2di", PURE)
+BU_VSX_X (LD_ELEMREV_V4SF, "ld_elemrev_v4sf", PURE)
+BU_VSX_X (LD_ELEMREV_V4SI, "ld_elemrev_v4si", PURE)
+BU_VSX_X (LD_ELEMREV_V8HI, "ld_elemrev_v8hi", PURE)
+BU_VSX_X (LD_ELEMREV_V16QI, "ld_elemrev_v16qi", PURE)
BU_VSX_X (ST_ELEMREV_V1TI, "st_elemrev_v1ti", MEM)
BU_VSX_X (ST_ELEMREV_V2DF, "st_elemrev_v2df", MEM)
BU_VSX_X (ST_ELEMREV_V2DI, "st_elemrev_v2di", MEM)
diff --git a/gcc/config/rs6000/rs6000-p8swap.c b/gcc/config/rs6000/rs6000-p8swap.c
index c3b98315503..d30e5dec980 100644
--- a/gcc/config/rs6000/rs6000-p8swap.c
+++ b/gcc/config/rs6000/rs6000-p8swap.c
@@ -791,6 +791,11 @@ rtx_is_swappable_p (rtx op, unsigned int *special)
case UNSPEC_REDUC_PLUS:
case UNSPEC_REDUC:
return 1;
+ case UNSPEC_VPMSUM:
+ /* vpmsumd is not swappable, but vpmsum[bhw] are. */
+ if (GET_MODE (op) == V2DImode)
+ return 0;
+ break;
}
}
diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index 6b5f1cd06f7..760967c06d0 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -7671,6 +7671,104 @@ address_offset (rtx op)
return NULL_RTX;
}
+/* This tests that a lo_sum {constant, symbol, symbol+offset} is valid for
+ the mode. If we can't find (or don't know) the alignment of the symbol
+ we assume (optimistically) that it's sufficiently aligned [??? maybe we
+ should be pessimistic]. Offsets are validated in the same way as for
+ reg + offset. */
+static bool
+darwin_rs6000_legitimate_lo_sum_const_p (rtx x, machine_mode mode)
+{
+ /* We should not get here with this. */
+ gcc_checking_assert (! mode_supports_dq_form (mode));
+
+ if (GET_CODE (x) == CONST)
+ x = XEXP (x, 0);
+
+ if (GET_CODE (x) == UNSPEC && XINT (x, 1) == UNSPEC_MACHOPIC_OFFSET)
+ x = XVECEXP (x, 0, 0);
+
+ rtx sym = NULL_RTX;
+ unsigned HOST_WIDE_INT offset = 0;
+
+ if (GET_CODE (x) == PLUS)
+ {
+ sym = XEXP (x, 0);
+ if (! SYMBOL_REF_P (sym))
+ return false;
+ if (!CONST_INT_P (XEXP (x, 1)))
+ return false;
+ offset = INTVAL (XEXP (x, 1));
+ }
+ else if (SYMBOL_REF_P (x))
+ sym = x;
+ else if (CONST_INT_P (x))
+ offset = INTVAL (x);
+ else if (GET_CODE (x) == LABEL_REF)
+ offset = 0; // We assume code labels are Pmode aligned
+ else
+ return false; // not sure what we have here.
+
+ /* If we don't know the alignment of the thing to which the symbol refers,
+ we assume optimistically it is "enough".
+ ??? maybe we should be pessimistic instead. */
+ unsigned align = 0;
+
+ if (sym)
+ {
+ tree decl = SYMBOL_REF_DECL (sym);
+#if TARGET_MACHO
+ if (MACHO_SYMBOL_INDIRECTION_P (sym))
+ /* The decl in an indirection symbol is the original one, which might
+ be less aligned than the indirection. Our indirections are always
+ pointer-aligned. */
+ ;
+ else
+#endif
+ if (decl && DECL_ALIGN (decl))
+ align = DECL_ALIGN_UNIT (decl);
+ }
+
+ unsigned int extra = 0;
+ switch (mode)
+ {
+ case E_DFmode:
+ case E_DDmode:
+ case E_DImode:
+ /* If we are using VSX scalar loads, restrict ourselves to reg+reg
+ addressing. */
+ if (VECTOR_MEM_VSX_P (mode))
+ return false;
+
+ if (!TARGET_POWERPC64)
+ extra = 4;
+ else if ((offset & 3) || (align & 3))
+ return false;
+ break;
+
+ case E_TFmode:
+ case E_IFmode:
+ case E_KFmode:
+ case E_TDmode:
+ case E_TImode:
+ case E_PTImode:
+ extra = 8;
+ if (!TARGET_POWERPC64)
+ extra = 12;
+ else if ((offset & 3) || (align & 3))
+ return false;
+ break;
+
+ default:
+ break;
+ }
+
+ /* We only care if the access(es) would cause a change to the high part. */
+ offset = ((offset & 0xffff) ^ 0x8000) - 0x8000;
+ return IN_RANGE (offset, -(HOST_WIDE_INT_1 << 15),
+ (HOST_WIDE_INT_1 << 15) - 1 - extra);
+}
+
/* Return true if the MEM operand is a memory operand suitable for use
with a (full width, possibly multiple) gpr load/store. On
powerpc64 this means the offset must be divisible by 4.
@@ -7705,7 +7803,13 @@ mem_operand_gpr (rtx op, machine_mode mode)
&& legitimate_indirect_address_p (XEXP (addr, 0), false))
return true;
- /* Don't allow non-offsettable addresses. See PRs 83969 and 84279. */
+ /* We need to look through Mach-O PIC unspecs to determine if a lo_sum is
+ really OK. Doing this early avoids teaching all the other machinery
+ about them. */
+ if (TARGET_MACHO && GET_CODE (addr) == LO_SUM)
+ return darwin_rs6000_legitimate_lo_sum_const_p (XEXP (addr, 1), mode);
+
+ /* Only allow offsettable addresses. See PRs 83969 and 84279. */
if (!rs6000_offsettable_memref_p (op, mode, false))
return false;
@@ -21330,7 +21434,7 @@ print_operand (FILE *file, rtx x, int code)
{
const char *name = XSTR (x, 0);
#if TARGET_MACHO
- if (darwin_emit_branch_islands
+ if (darwin_symbol_stubs
&& MACHOPIC_INDIRECT
&& machopic_classify_symbol (x) == MACHOPIC_UNDEFINED_FUNCTION)
name = machopic_indirection_name (x, /*stub_p=*/true);
@@ -25729,10 +25833,14 @@ rs6000_emit_allocate_stack (HOST_WIDE_INT size, rtx copy_reg, int copy_off)
stack_limit_rtx,
GEN_INT (size)));
- emit_insn (gen_elf_high (tmp_reg, toload));
- emit_insn (gen_elf_low (tmp_reg, tmp_reg, toload));
- emit_insn (gen_cond_trap (LTU, stack_reg, tmp_reg,
- const0_rtx));
+ /* We cannot use r0 with elf_low. Lamely solve this problem by
+ moving registers around. */
+ rtx r11_reg = gen_rtx_REG (Pmode, 11);
+ emit_move_insn (tmp_reg, r11_reg);
+ emit_insn (gen_elf_high (r11_reg, toload));
+ emit_insn (gen_elf_low (r11_reg, r11_reg, toload));
+ emit_insn (gen_cond_trap (LTU, stack_reg, r11_reg, const0_rtx));
+ emit_move_insn (r11_reg, tmp_reg);
}
else
warning (0, "stack limit expression is not supported");
@@ -37779,25 +37887,31 @@ rs6000_can_inline_p (tree caller, tree callee)
tree caller_tree = DECL_FUNCTION_SPECIFIC_TARGET (caller);
tree callee_tree = DECL_FUNCTION_SPECIFIC_TARGET (callee);
- /* If callee has no option attributes, then it is ok to inline. */
+ /* If the callee has no option attributes, then it is ok to inline. */
if (!callee_tree)
ret = true;
- /* If caller has no option attributes, but callee does then it is not ok to
- inline. */
- else if (!caller_tree)
- ret = false;
-
else
{
- struct cl_target_option *caller_opts = TREE_TARGET_OPTION (caller_tree);
+ HOST_WIDE_INT caller_isa;
struct cl_target_option *callee_opts = TREE_TARGET_OPTION (callee_tree);
+ HOST_WIDE_INT callee_isa = callee_opts->x_rs6000_isa_flags;
+ HOST_WIDE_INT explicit_isa = callee_opts->x_rs6000_isa_flags_explicit;
- /* Callee's options should a subset of the caller's, i.e. a vsx function
- can inline an altivec function but a non-vsx function can't inline a
- vsx function. */
- if ((caller_opts->x_rs6000_isa_flags & callee_opts->x_rs6000_isa_flags)
- == callee_opts->x_rs6000_isa_flags)
+ /* If the caller has option attributes, then use them.
+ Otherwise, use the command line options. */
+ if (caller_tree)
+ caller_isa = TREE_TARGET_OPTION (caller_tree)->x_rs6000_isa_flags;
+ else
+ caller_isa = rs6000_isa_flags;
+
+ /* The callee's options must be a subset of the caller's options, i.e.
+ a vsx function may inline an altivec function, but a no-vsx function
+ must not inline a vsx function. However, for those options that the
+ callee has explicitly enabled or disabled, then we must enforce that
+ the callee's and caller's options match exactly; see PR70010. */
+ if (((caller_isa & callee_isa) == callee_isa)
+ && (caller_isa & explicit_isa) == (callee_isa & explicit_isa))
ret = true;
}
@@ -38290,7 +38404,8 @@ rs6000_call_darwin_1 (rtx value, rtx func_desc, rtx tlsarg,
if ((cookie_val & CALL_LONG) != 0
&& GET_CODE (func_desc) == SYMBOL_REF)
{
- if (darwin_emit_branch_islands && TARGET_32BIT)
+ /* FIXME: the longcall opt should not hang off picsymbol stubs. */
+ if (darwin_symbol_stubs && TARGET_32BIT)
make_island = true; /* Do nothing yet, retain the CALL_LONG flag. */
else
{
diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md
index ad80592765d..7bfa5eea2ee 100644
--- a/gcc/config/rs6000/rs6000.md
+++ b/gcc/config/rs6000/rs6000.md
@@ -137,6 +137,9 @@
UNSPEC_LSQ
UNSPEC_FUSION_GPR
UNSPEC_STACK_CHECK
+ UNSPEC_CMPRB
+ UNSPEC_CMPRB2
+ UNSPEC_CMPEQB
UNSPEC_ADD_ROUND_TO_ODD
UNSPEC_SUB_ROUND_TO_ODD
UNSPEC_MUL_ROUND_TO_ODD
@@ -164,6 +167,9 @@
UNSPECV_EH_RR ; eh_reg_restore
UNSPECV_ISYNC ; isync instruction
UNSPECV_MFTB ; move from time base
+ UNSPECV_DARN ; darn 1 (deliver a random number)
+ UNSPECV_DARN_32 ; darn 2
+ UNSPECV_DARN_RAW ; darn 0
UNSPECV_NLGR ; non-local goto receiver
UNSPECV_MFFS ; Move from FPSCR
UNSPECV_MFFSL ; Move from FPSCR light instruction version
@@ -5930,7 +5936,7 @@
/* Insert new RN mode into FSCPR. */
emit_insn (gen_rs6000_mffs (tmp_df));
tmp_di = simplify_gen_subreg (DImode, tmp_df, DFmode, 0);
- emit_insn (gen_anddi3 (tmp_di, tmp_di, GEN_INT (0xFFFFFFF8FFFFFFFF)));
+ emit_insn (gen_anddi3 (tmp_di, tmp_di, GEN_INT (0xFFFFFFF8FFFFFFFFULL)));
emit_insn (gen_iordi3 (tmp_di, tmp_di, tmp_rn));
/* Need to write to field 7. The fields are [0:15]. The equation to
@@ -6818,13 +6824,6 @@
;; do the load 16-bits at a time. We could do this by loading from memory,
;; and this is even supposed to be faster, but it is simpler not to get
;; integers in the TOC.
-(define_insn "movsi_low"
- [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
- (mem:SI (lo_sum:SI (match_operand:SI 1 "gpc_reg_operand" "b")
- (match_operand 2 "" ""))))]
- "TARGET_MACHO && ! TARGET_64BIT"
- "lwz %0,lo16(%2)(%1)"
- [(set_attr "type" "load")])
;; MR LA LWZ LFIWZX LXSIWZX
;; STW STFIWX STXSIWX LI LIS
@@ -14322,7 +14321,225 @@
"xscmpuqp %0,%1,%2"
[(set_attr "type" "veccmp")
(set_attr "size" "128")])
+
+;; Miscellaneous ISA 3.0 (power9) instructions
+
+(define_insn "darn_32"
+ [(set (match_operand:SI 0 "register_operand" "=r")
+ (unspec_volatile:SI [(const_int 0)] UNSPECV_DARN_32))]
+ "TARGET_P9_MISC"
+ "darn %0,0"
+ [(set_attr "type" "integer")])
+(define_insn "darn_raw"
+ [(set (match_operand:DI 0 "register_operand" "=r")
+ (unspec_volatile:DI [(const_int 0)] UNSPECV_DARN_RAW))]
+ "TARGET_P9_MISC && TARGET_64BIT"
+ "darn %0,2"
+ [(set_attr "type" "integer")])
+
+(define_insn "darn"
+ [(set (match_operand:DI 0 "register_operand" "=r")
+ (unspec_volatile:DI [(const_int 0)] UNSPECV_DARN))]
+ "TARGET_P9_MISC && TARGET_64BIT"
+ "darn %0,1"
+ [(set_attr "type" "integer")])
+
+;; Test byte within range.
+;;
+;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
+;; represents a byte whose value is ignored in this context and
+;; vv, the least significant byte, holds the byte value that is to
+;; be tested for membership within the range specified by operand 2.
+;; The bytes of operand 2 are organized as xx:xx:hi:lo.
+;;
+;; Return in target register operand 0 a value of 1 if lo <= vv and
+;; vv <= hi. Otherwise, set register operand 0 to 0.
+;;
+;; Though the instructions to which this expansion maps operate on
+;; 64-bit registers, the current implementation only operates on
+;; SI-mode operands as the high-order bits provide no information
+;; that is not already available in the low-order bits. To avoid the
+;; costs of data widening operations, future enhancements might allow
+;; DI mode for operand 0 and/or might allow operand 1 to be QI mode.
+(define_expand "cmprb"
+ [(set (match_dup 3)
+ (unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
+ (match_operand:SI 2 "gpc_reg_operand" "r")]
+ UNSPEC_CMPRB))
+ (set (match_operand:SI 0 "gpc_reg_operand" "=r")
+ (if_then_else:SI (lt (match_dup 3)
+ (const_int 0))
+ (const_int -1)
+ (if_then_else (gt (match_dup 3)
+ (const_int 0))
+ (const_int 1)
+ (const_int 0))))]
+ "TARGET_P9_MISC"
+{
+ operands[3] = gen_reg_rtx (CCmode);
+})
+
+;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
+;; represents a byte whose value is ignored in this context and
+;; vv, the least significant byte, holds the byte value that is to
+;; be tested for membership within the range specified by operand 2.
+;; The bytes of operand 2 are organized as xx:xx:hi:lo.
+;;
+;; Set bit 1 (the GT bit, 0x4) of CR register operand 0 to 1 if
+;; lo <= vv and vv <= hi. Otherwise, set the GT bit to 0. The other
+;; 3 bits of the target CR register are all set to 0.
+(define_insn "*cmprb_internal"
+ [(set (match_operand:CC 0 "cc_reg_operand" "=y")
+ (unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
+ (match_operand:SI 2 "gpc_reg_operand" "r")]
+ UNSPEC_CMPRB))]
+ "TARGET_P9_MISC"
+ "cmprb %0,0,%1,%2"
+ [(set_attr "type" "logical")])
+
+;; Set operand 0 register to -1 if the LT bit (0x8) of condition
+;; register operand 1 is on. Otherwise, set operand 0 register to 1
+;; if the GT bit (0x4) of condition register operand 1 is on.
+;; Otherwise, set operand 0 to 0. Note that the result stored into
+;; register operand 0 is non-zero iff either the LT or GT bits are on
+;; within condition register operand 1.
+(define_insn "setb_signed"
+ [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
+ (if_then_else:SI (lt (match_operand:CC 1 "cc_reg_operand" "y")
+ (const_int 0))
+ (const_int -1)
+ (if_then_else (gt (match_dup 1)
+ (const_int 0))
+ (const_int 1)
+ (const_int 0))))]
+ "TARGET_P9_MISC"
+ "setb %0,%1"
+ [(set_attr "type" "logical")])
+
+(define_insn "setb_unsigned"
+ [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
+ (if_then_else:SI (ltu (match_operand:CCUNS 1 "cc_reg_operand" "y")
+ (const_int 0))
+ (const_int -1)
+ (if_then_else (gtu (match_dup 1)
+ (const_int 0))
+ (const_int 1)
+ (const_int 0))))]
+ "TARGET_P9_MISC"
+ "setb %0,%1"
+ [(set_attr "type" "logical")])
+
+;; Test byte within two ranges.
+;;
+;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
+;; represents a byte whose value is ignored in this context and
+;; vv, the least significant byte, holds the byte value that is to
+;; be tested for membership within the range specified by operand 2.
+;; The bytes of operand 2 are organized as hi_1:lo_1:hi_2:lo_2.
+;;
+;; Return in target register operand 0 a value of 1 if (lo_1 <= vv and
+;; vv <= hi_1) or if (lo_2 <= vv and vv <= hi_2). Otherwise, set register
+;; operand 0 to 0.
+;;
+;; Though the instructions to which this expansion maps operate on
+;; 64-bit registers, the current implementation only operates on
+;; SI-mode operands as the high-order bits provide no information
+;; that is not already available in the low-order bits. To avoid the
+;; costs of data widening operations, future enhancements might allow
+;; DI mode for operand 0 and/or might allow operand 1 to be QI mode.
+(define_expand "cmprb2"
+ [(set (match_dup 3)
+ (unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
+ (match_operand:SI 2 "gpc_reg_operand" "r")]
+ UNSPEC_CMPRB2))
+ (set (match_operand:SI 0 "gpc_reg_operand" "=r")
+ (if_then_else:SI (lt (match_dup 3)
+ (const_int 0))
+ (const_int -1)
+ (if_then_else (gt (match_dup 3)
+ (const_int 0))
+ (const_int 1)
+ (const_int 0))))]
+ "TARGET_P9_MISC"
+{
+ operands[3] = gen_reg_rtx (CCmode);
+})
+
+;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
+;; represents a byte whose value is ignored in this context and
+;; vv, the least significant byte, holds the byte value that is to
+;; be tested for membership within the ranges specified by operand 2.
+;; The bytes of operand 2 are organized as hi_1:lo_1:hi_2:lo_2.
+;;
+;; Set bit 1 (the GT bit, 0x4) of CR register operand 0 to 1 if
+;; (lo_1 <= vv and vv <= hi_1) or if (lo_2 <= vv and vv <= hi_2).
+;; Otherwise, set the GT bit to 0. The other 3 bits of the target
+;; CR register are all set to 0.
+(define_insn "*cmprb2_internal"
+ [(set (match_operand:CC 0 "cc_reg_operand" "=y")
+ (unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
+ (match_operand:SI 2 "gpc_reg_operand" "r")]
+ UNSPEC_CMPRB2))]
+ "TARGET_P9_MISC"
+ "cmprb %0,1,%1,%2"
+ [(set_attr "type" "logical")])
+
+;; Test byte membership within set of 8 bytes.
+;;
+;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
+;; represents a byte whose value is ignored in this context and
+;; vv, the least significant byte, holds the byte value that is to
+;; be tested for membership within the set specified by operand 2.
+;; The bytes of operand 2 are organized as e0:e1:e2:e3:e4:e5:e6:e7.
+;;
+;; Return in target register operand 0 a value of 1 if vv equals one
+;; of the values e0, e1, e2, e3, e4, e5, e6, or e7. Otherwise, set
+;; register operand 0 to 0. Note that the 8 byte values held within
+;; operand 2 need not be unique.
+;;
+;; Though the instructions to which this expansion maps operate on
+;; 64-bit registers, the current implementation requires that operands
+;; 0 and 1 have mode SI as the high-order bits provide no information
+;; that is not already available in the low-order bits. To avoid the
+;; costs of data widening operations, future enhancements might allow
+;; DI mode for operand 0 and/or might allow operand 1 to be QI mode.
+(define_expand "cmpeqb"
+ [(set (match_dup 3)
+ (unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
+ (match_operand:DI 2 "gpc_reg_operand" "r")]
+ UNSPEC_CMPEQB))
+ (set (match_operand:SI 0 "gpc_reg_operand" "=r")
+ (if_then_else:SI (lt (match_dup 3)
+ (const_int 0))
+ (const_int -1)
+ (if_then_else (gt (match_dup 3)
+ (const_int 0))
+ (const_int 1)
+ (const_int 0))))]
+ "TARGET_P9_MISC && TARGET_64BIT"
+{
+ operands[3] = gen_reg_rtx (CCmode);
+})
+
+;; The bytes of operand 1 are organized as xx:xx:xx:vv, where xx
+;; represents a byte whose value is ignored in this context and
+;; vv, the least significant byte, holds the byte value that is to
+;; be tested for membership within the set specified by operand 2.
+;; The bytes of operand 2 are organized as e0:e1:e2:e3:e4:e5:e6:e7.
+;;
+;; Set bit 1 (the GT bit, 0x4) of CR register operand 0 to 1 if vv
+;; equals one of the values e0, e1, e2, e3, e4, e5, e6, or e7. Otherwise,
+;; set the GT bit to zero. The other 3 bits of the target CR register
+;; are all set to 0.
+(define_insn "*cmpeqb_internal"
+ [(set (match_operand:CC 0 "cc_reg_operand" "=y")
+ (unspec:CC [(match_operand:SI 1 "gpc_reg_operand" "r")
+ (match_operand:DI 2 "gpc_reg_operand" "r")]
+ UNSPEC_CMPEQB))]
+ "TARGET_P9_MISC && TARGET_64BIT"
+ "cmpeqb %0,%1,%2"
+ [(set_attr "type" "logical")])
(include "sync.md")
diff --git a/gcc/config/s390/8561.md b/gcc/config/s390/8561.md
index e5a345f4dba..2442349271b 100644
--- a/gcc/config/s390/8561.md
+++ b/gcc/config/s390/8561.md
@@ -1,4 +1,4 @@
-;; Scheduling description for arch13.
+;; Scheduling description for z15.
;; Copyright (C) 2019 Free Software Foundation, Inc.
;; Contributed by Robin Dapp (rdapp@linux.ibm.com)
;; This file is part of GCC.
@@ -17,12 +17,12 @@
;; along with GCC; see the file COPYING3. If not see
;; <http://www.gnu.org/licenses/>.
-(define_attr "arch13_unit_fpd" ""
+(define_attr "z15_unit_fpd" ""
(cond [(eq_attr "mnemonic" "ddb,ddbr,deb,debr,dxbr,sqdb,sqdbr,sqeb,\
sqebr,sqxbr,vfddb,vfdsb,vfsqdb,vfsqsb,wfddb,wfdsb,wfdxb,wfsqdb,wfsqxb")
(const_int 1)] (const_int 0)))
-(define_attr "arch13_unit_fxa" ""
+(define_attr "z15_unit_fxa" ""
(cond [(eq_attr "mnemonic" "a,afi,ag,agf,agfi,agfr,agh,aghi,aghik,\
agr,agrk,ah,ahi,ahik,ahy,al,alc,alcg,alcgr,alcr,alfi,alg,algf,algfi,algfr,\
alghsik,algr,algrk,alhsik,alr,alrk,aly,ar,ark,ay,bras,brasl,etnd,exrl,flogr,\
@@ -39,7 +39,7 @@ slgrk,sll,sllg,sllk,slr,slrk,sly,sr,sra,srag,srak,srk,srl,srlg,srlk,sy,x,xg,\
xgr,xgrk,xihf,xilf,xr,xrk,xy")
(const_int 1)] (const_int 0)))
-(define_attr "arch13_unit_fxb" ""
+(define_attr "z15_unit_fxb" ""
(cond [(eq_attr "mnemonic" "agsi,algsi,alsi,asi,b,bc,bcr,bi,br,brcl,\
c,cfi,cg,cgf,cgfi,cgfr,cgfrl,cgh,cghi,cghrl,cghsi,cgit,cgr,cgrl,cgrt,ch,\
chi,chrl,chsi,chy,cit,cl,clfhsi,clfi,clfit,clg,clgf,clgfi,clgfr,clgfrl,\
@@ -52,11 +52,11 @@ tmhl,tml,tmlh,tmll,tmy,vlgvb,vlgvf,vlgvg,vlgvh,vlr,vlvgb,vlvgf,vlvgg,vlvgh,\
vlvgp,vst,vstef,vsteg,vstl,vstrl,vstrlr,xi,xiy")
(const_int 1)] (const_int 0)))
-(define_attr "arch13_unit_fxd" ""
+(define_attr "z15_unit_fxd" ""
(cond [(eq_attr "mnemonic" "dlgr,dlr,dr,dsgfr,dsgr")
(const_int 1)] (const_int 0)))
-(define_attr "arch13_unit_lsu" ""
+(define_attr "z15_unit_lsu" ""
(cond [(eq_attr "mnemonic" "a,adb,aeb,ag,agf,agh,agsi,ah,ahy,al,alc,\
alcg,alg,algf,algsi,alsi,aly,asi,ay,c,cdb,ceb,cg,cgf,cgfrl,cgh,cghrl,cghsi,\
cgrl,ch,chrl,chsi,chy,cl,clc,clfhsi,clg,clgf,clgfrl,clghrl,clghsi,clgrl,\
@@ -73,7 +73,7 @@ vllezf,vllezg,vllezh,vllezlf,vlrepb,vlrepf,vlrepg,vlreph,vlrl,vlrlr,vst,\
vstef,vsteg,vstl,vstrl,vstrlr,x,xg,xi,xiy,xy")
(const_int 1)] (const_int 0)))
-(define_attr "arch13_unit_vfu" ""
+(define_attr "z15_unit_vfu" ""
(cond [(eq_attr "mnemonic" "adb,adbr,adtr,aeb,aebr,axbr,axtr,cdb,\
cdbr,cdtr,ceb,cebr,cpsdr,cxbr,cxtr,ddtr,dxtr,fidbr,fidbra,fidtr,fiebr,\
fiebra,fixbr,fixbra,fixtr,lcdbr,lcebr,lcxbr,ldeb,ldebr,ldetr,le,ledbr,ledtr,\
@@ -115,7 +115,7 @@ wflpxb,wfmadb,wfmasb,wfmaxb,wfmaxxb,wfmdb,wfminxb,wfmsb,wfmsdb,wfmssb,wfmsxb,\
wfmxb,wfnmaxb,wfnmsxb,wfsdb,wfssb,wfsxb,wldeb,wledb")
(const_int 1)] (const_int 0)))
-(define_attr "arch13_cracked" ""
+(define_attr "z15_cracked" ""
(cond [(eq_attr "mnemonic" "bas,basr,cdfbr,cdftr,cdgbr,cdgtr,cdlfbr,\
cdlftr,cdlgbr,cdlgtr,cefbr,cegbr,celfbr,celgbr,cfdbr,cfebr,cfxbr,cgdbr,cgdtr,\
cgebr,cgxbr,cgxtr,chhsi,clfdbr,clfdtr,clfebr,clfxbr,clfxtr,clgdbr,clgdtr,\
@@ -123,13 +123,13 @@ clgebr,clgxbr,clgxtr,cs,csg,csy,d,efpc,ex,lcgfr,lngfr,lpgfr,lpq,lxr,lzxr,\
rxsbg,stpq,vgef,vgeg,vscef,vsceg,vsteb,vsteh")
(const_int 1)] (const_int 0)))
-(define_attr "arch13_expanded" ""
+(define_attr "z15_expanded" ""
(cond [(eq_attr "mnemonic" "cds,cdsg,cdsy,cxfbr,cxftr,cxgbr,cxgtr,\
cxlfbr,cxlftr,cxlgbr,cxlgtr,dl,dlg,dsg,dsgf,lam,lm,lmg,lmy,sldl,srda,srdl,\
stam,stm,stmg,stmy,tbegin,tbeginc")
(const_int 1)] (const_int 0)))
-(define_attr "arch13_groupalone" ""
+(define_attr "z15_groupalone" ""
(cond [(eq_attr "mnemonic" "alc,alcg,alcgr,alcr,axbr,axtr,clc,cxbr,\
cxtr,dlgr,dlr,dr,dsgfr,dsgr,dxbr,dxtr,fixbr,fixbra,fixtr,flogr,lcxbr,lnxbr,\
lpxbr,ltxbr,ltxtr,lxdb,lxdbr,lxdtr,lxeb,lxebr,m,madb,maeb,maebr,mfy,mg,mgrk,\
@@ -137,11 +137,11 @@ ml,mlg,mlgr,mlr,mr,msdb,mseb,msebr,mvc,mxbr,mxtr,nc,oc,ppa,sfpc,slb,slbg,\
slbgr,slbr,sqxbr,sxbr,sxtr,tabort,tcxb,tdcxt,tend,xc")
(const_int 1)] (const_int 0)))
-(define_attr "arch13_endgroup" ""
+(define_attr "z15_endgroup" ""
(cond [(eq_attr "mnemonic" "bras,brasl,exrl,ipm")
(const_int 1)] (const_int 0)))
-(define_attr "arch13_groupoftwo" ""
+(define_attr "z15_groupoftwo" ""
(cond [(eq_attr "mnemonic" "vacccq,vacq,vfmadb,vfmasb,vfmsdb,vfmssb,\
vfnmadb,vfnmasb,vfnmsdb,vfnmssb,vgfmab,vgfmaf,vgfmag,vgfmah,vmaeb,vmaef,vmaeh,\
vmahb,vmahf,vmahh,vmalb,vmaleb,vmalef,vmaleh,vmalf,vmalhb,vmalhf,vmalhh,\
@@ -149,8 +149,8 @@ vmalhw,vmalob,vmalof,vmaloh,vmaob,vmaof,vmaoh,vmslg,vperm,vsbcbiq,vsbiq,vsel,\
wfmadb,wfmasb,wfmaxb,wfmsdb,wfmssb,wfmsxb,wfnmaxb,wfnmsxb")
(const_int 1)] (const_int 0)))
-(define_insn_reservation "arch13_0" 0
- (and (eq_attr "cpu" "arch13")
+(define_insn_reservation "z15_0" 0
+ (and (eq_attr "cpu" "z15")
(eq_attr "mnemonic" "a,afi,ag,agfi,aghi,aghik,agr,agrk,ahi,ahik,al,\
alfi,alg,algf,algfi,algfr,alghsik,algr,algrk,alhsik,alr,alrk,aly,ar,ark,ay,\
b,bc,bcr,bi,br,bras,brasl,brcl,c,cfi,cg,cgfi,cghi,cghsi,cgit,cgr,cgrl,\
@@ -168,8 +168,8 @@ sllk,slr,slrk,sly,sr,sra,srag,srak,srda,srdl,srk,srl,srlg,srlk,sy,tm,tmh,\
tmhh,tmhl,tml,tmlh,tmll,tmy,vlr,vlvgb,vlvgf,vlvgg,vlvgh,x,xg,xgr,xgrk,xihf,\
xilf,xr,xrk,xy")) "nothing")
-(define_insn_reservation "arch13_1" 1
- (and (eq_attr "cpu" "arch13")
+(define_insn_reservation "z15_1" 1
+ (and (eq_attr "cpu" "z15")
(eq_attr "mnemonic" "agf,agfr,agh,agsi,ah,ahy,algsi,alsi,asi,cgf,\
cgfr,cgfrl,cgh,cghrl,ch,chrl,chy,clm,clmy,cpsdr,laa,laag,lan,lang,lao,laog,\
lax,laxg,le,ler,ley,loc,locg,locghi,locgr,lochi,locr,mvghi,mvhhi,mvhi,mvi,\
@@ -196,8 +196,8 @@ wfcedb,wfcesb,wfcexb,wfchdb,wfchedb,wfchesb,wfchexb,wfchsb,wfchxb,wflcdb,\
wflcsb,wflcxb,wflndb,wflnsb,wflnxb,wflpdb,wflpsb,wflpxb,wfmaxxb,wfminxb,xi,\
xiy")) "nothing")
-(define_insn_reservation "arch13_2" 2
- (and (eq_attr "cpu" "arch13")
+(define_insn_reservation "z15_2" 2
+ (and (eq_attr "cpu" "z15")
(eq_attr "mnemonic" "cdb,cdbr,ceb,cebr,ear,ipm,l,lcbb,lcdbr,lcebr,ld,\
lde,ldy,lg,lgdr,lgrl,llc,llgc,llgf,llgfrl,llgh,llghrl,llgt,llh,llhrl,lm,\
lmg,lmy,lndbr,lnebr,lpdbr,lpebr,lrl,ltdbr,ltebr,ly,popcnt,sar,tcdb,tceb,\
@@ -208,8 +208,8 @@ vistrh,vlgvb,vlgvf,vlgvg,vlgvh,vllezb,vllezf,vllezg,vllezh,vllezlf,vlrepb,\
vlrepf,vlrepg,vlreph,vlrl,vlvgp,vpklsfs,vpklsgs,vpklshs,vpksfs,vpksgs,vpkshs,\
wfcdb,wfcexbs,wfchexbs,wfchxbs,wfcsb")) "nothing")
-(define_insn_reservation "arch13_3" 3
- (and (eq_attr "cpu" "arch13")
+(define_insn_reservation "z15_3" 3
+ (and (eq_attr "cpu" "z15")
(eq_attr "mnemonic" "cds,cdsy,mgh,mghi,mh,mhi,mhy,std,stdy,ste,stey,\
vcksm,vfeezbs,vfeezfs,vfeezhs,vgfmab,vgfmaf,vgfmag,vgfmah,vgfmb,vgfmf,vgfmg,\
vgfmh,vistrbs,vistrfs,vistrhs,vl,vlbb,vll,vlrlr,vmaeb,vmaef,vmaeh,vmahb,\
@@ -218,14 +218,14 @@ vmalob,vmalof,vmaloh,vmaob,vmaof,vmaoh,vmeb,vmef,vmeh,vmhb,vmhf,vmhh,vmlb,\
vmleb,vmlef,vmleh,vmlf,vmlhb,vmlhf,vmlhh,vmlhw,vmlob,vmlof,vmloh,vmob,vmof,\
vmoh,vsumb,vsumgf,vsumgh,vsumh,vsumqf,vsumqg,vtm")) "nothing")
-(define_insn_reservation "arch13_4" 4
- (and (eq_attr "cpu" "arch13")
+(define_insn_reservation "z15_4" 4
+ (and (eq_attr "cpu" "z15")
(eq_attr "mnemonic" "bas,basr,chhsi,clc,ex,lam,lcgfr,lngfr,lpgfr,lxr,\
lzxr,ms,msfi,msgf,msgfi,msgfr,msr,msy,mvc,nc,oc,ppa,rxsbg,tabort,tbegin,\
tbeginc,tend,vst,vstef,vsteg,vstl,vstrl,vstrlr,xc")) "nothing")
-(define_insn_reservation "arch13_5" 5
- (and (eq_attr "cpu" "arch13")
+(define_insn_reservation "z15_5" 5
+ (and (eq_attr "cpu" "z15")
(eq_attr "mnemonic" "adb,adbr,aeb,aebr,alc,alcg,alcgr,alcr,cs,csg,\
csy,fidbr,fidbra,fiebr,fiebra,ldeb,ldebr,ledbr,madbr,mdb,mdbr,meeb,meebr,\
msdbr,msrkc,sdb,sdbr,seb,sebr,slb,slbg,slbgr,slbr,stm,stmg,stmy,vfadb,vfasb,\
@@ -233,53 +233,53 @@ vfidb,vfisb,vfmadb,vfmasb,vfmdb,vfmsb,vfmsdb,vfmssb,vfnmadb,vfnmasb,vfnmsdb,\
vfnmssb,vfsdb,vfssb,vldeb,vledb,vmslg,wfadb,wfasb,wfidb,wfisb,wflld,wfmadb,\
wfmasb,wfmdb,wfmsb,wfmsdb,wfmssb,wfsdb,wfssb,wldeb,wledb")) "nothing")
-(define_insn_reservation "arch13_6" 6
- (and (eq_attr "cpu" "arch13")
+(define_insn_reservation "z15_6" 6
+ (and (eq_attr "cpu" "z15")
(eq_attr "mnemonic" "msg,msgr,sfpc")) "nothing")
-(define_insn_reservation "arch13_7" 7
- (and (eq_attr "cpu" "arch13")
+(define_insn_reservation "z15_7" 7
+ (and (eq_attr "cpu" "z15")
(eq_attr "mnemonic" "adtr,cdtr,fidtr,ldetr,ltdtr,msgrkc,sdtr,tdcdt,\
tdcet,vgef,vgeg")) "nothing")
-(define_insn_reservation "arch13_8" 8
- (and (eq_attr "cpu" "arch13")
+(define_insn_reservation "z15_8" 8
+ (and (eq_attr "cpu" "z15")
(eq_attr "mnemonic" "cdsg,flogr,lpq,stpq,vsteb,vsteh")) "nothing")
-(define_insn_reservation "arch13_9" 9
- (and (eq_attr "cpu" "arch13")
+(define_insn_reservation "z15_9" 9
+ (and (eq_attr "cpu" "z15")
(eq_attr "mnemonic" "cdfbr,cdgbr,cdlfbr,cdlgbr,cefbr,cegbr,celfbr,\
celgbr,cxfbr,cxgbr,cxlfbr,cxlgbr,m,madb,maeb,maebr,mfy,ml,mlr,mr,msdb,mseb,\
msebr,stam,wfaxb,wfixb,wfsxb")) "nothing")
-(define_insn_reservation "arch13_10" 10
- (and (eq_attr "cpu" "arch13")
+(define_insn_reservation "z15_10" 10
+ (and (eq_attr "cpu" "z15")
(eq_attr "mnemonic" "lxdb,lxdbr,lxeb,lxebr,vscef,vsceg")) "nothing")
-(define_insn_reservation "arch13_11" 11
- (and (eq_attr "cpu" "arch13")
+(define_insn_reservation "z15_11" 11
+ (and (eq_attr "cpu" "z15")
(eq_attr "mnemonic" "cfdbr,cfebr,cgdbr,cgebr,clfdbr,clfebr,clgdbr,\
clgebr,mg,mgrk,mlg,mlgr")) "nothing")
-(define_insn_reservation "arch13_12" 12
- (and (eq_attr "cpu" "arch13")
+(define_insn_reservation "z15_12" 12
+ (and (eq_attr "cpu" "z15")
(eq_attr "mnemonic" "cxbr,cxftr,cxlftr,cxtr,tcxb,tdcxt")) "nothing")
-(define_insn_reservation "arch13_13" 13
- (and (eq_attr "cpu" "arch13")
+(define_insn_reservation "z15_13" 13
+ (and (eq_attr "cpu" "z15")
(eq_attr "mnemonic" "axbr,axtr,fixbr,fixbra,fixtr,lcxbr,lnxbr,lpxbr,\
ltxbr,ltxtr,lxdtr,sxbr,sxtr")) "nothing")
-(define_insn_reservation "arch13_14" 14
- (and (eq_attr "cpu" "arch13")
+(define_insn_reservation "z15_14" 14
+ (and (eq_attr "cpu" "z15")
(eq_attr "mnemonic" "cfxbr,cgxbr,clfxbr,clgxbr,ledtr")) "nothing")
-(define_insn_reservation "arch13_16" 16
- (and (eq_attr "cpu" "arch13")
+(define_insn_reservation "z15_16" 16
+ (and (eq_attr "cpu" "z15")
(eq_attr "mnemonic" "cdftr,cdlftr")) "nothing")
-(define_insn_reservation "arch13_20" 20
- (and (eq_attr "cpu" "arch13")
+(define_insn_reservation "z15_20" 20
+ (and (eq_attr "cpu" "z15")
(eq_attr "mnemonic" "cdgtr,cdlgtr,cgdtr,cgxtr,clfdtr,clfxtr,clgdtr,\
clgxtr,cxgtr,cxlgtr,d,ddb,ddbr,ddtr,deb,debr,dl,dlg,dlgr,dlr,dr,dsg,dsgf,\
dsgfr,dsgr,dxbr,dxtr,efpc,mdtr,mxbr,mxtr,sqdb,sqdbr,sqeb,sqebr,sqxbr,vfddb,\
diff --git a/gcc/config/s390/driver-native.c b/gcc/config/s390/driver-native.c
index a386d633a87..6bc7d590668 100644
--- a/gcc/config/s390/driver-native.c
+++ b/gcc/config/s390/driver-native.c
@@ -121,10 +121,10 @@ s390_host_detect_local_cpu (int argc, const char **argv)
break;
case 0x8561:
case 0x8562:
- cpu = "arch13";
+ cpu = "z15";
break;
default:
- cpu = "arch13";
+ cpu = "z15";
break;
}
}
diff --git a/gcc/config/s390/s390-builtins.def b/gcc/config/s390/s390-builtins.def
index fbf7d9f50e8..3f39b9d3b88 100644
--- a/gcc/config/s390/s390-builtins.def
+++ b/gcc/config/s390/s390-builtins.def
@@ -281,7 +281,7 @@
#define B_HTM (1 << 1) /* Builtins requiring the transactional execution facility. */
#define B_VX (1 << 2) /* Builtins requiring the z13 vector extensions. */
#define B_VXE (1 << 3) /* Builtins requiring the z14 vector extensions. */
-#define B_VXE2 (1 << 4) /* Builtins requiring the arch13 vector extensions. */
+#define B_VXE2 (1 << 4) /* Builtins requiring the z15 vector extensions. */
#define B_DEP (1 << 5) /* Builtin has been deprecated and a warning should be issued. */
/* B_DEF defines a standard (not overloaded) builtin
diff --git a/gcc/config/s390/s390-c.c b/gcc/config/s390/s390-c.c
index 97debdc3905..c2f9b507011 100644
--- a/gcc/config/s390/s390-c.c
+++ b/gcc/config/s390/s390-c.c
@@ -905,6 +905,12 @@ s390_resolve_overloaded_builtin (location_t loc,
return error_mark_node;
}
+ if (!TARGET_VXE2 && (ob_flags & B_VXE2))
+ {
+ error_at (loc, "%qF requires z15 or higher", ob_fndecl);
+ return error_mark_node;
+ }
+
ob_fcode -= S390_BUILTIN_MAX;
for (b_arg_chain = TYPE_ARG_TYPES (TREE_TYPE (ob_fndecl));
@@ -983,6 +989,15 @@ s390_resolve_overloaded_builtin (location_t loc,
return error_mark_node;
}
+
+ if (!TARGET_VXE2
+ && bflags_overloaded_builtin_var[last_match_index] & B_VXE2)
+ {
+ error_at (loc, "%qs matching variant requires z15 or higher",
+ IDENTIFIER_POINTER (DECL_NAME (ob_fndecl)));
+ return error_mark_node;
+ }
+
if (bflags_overloaded_builtin_var[last_match_index] & B_DEP)
warning_at (loc, 0, "%qs matching variant is deprecated.",
IDENTIFIER_POINTER (DECL_NAME (ob_fndecl)));
diff --git a/gcc/config/s390/s390-opts.h b/gcc/config/s390/s390-opts.h
index ab41cb883f3..502edea719b 100644
--- a/gcc/config/s390/s390-opts.h
+++ b/gcc/config/s390/s390-opts.h
@@ -37,7 +37,7 @@ enum processor_type
PROCESSOR_2827_ZEC12,
PROCESSOR_2964_Z13,
PROCESSOR_3906_Z14,
- PROCESSOR_8561_ARCH13,
+ PROCESSOR_8561_Z15,
PROCESSOR_NATIVE,
PROCESSOR_max
};
diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c
index fc4571d0d0c..db3f94978ec 100644
--- a/gcc/config/s390/s390.c
+++ b/gcc/config/s390/s390.c
@@ -337,7 +337,7 @@ const struct s390_processor processor_table[] =
{ "zEC12", "zEC12", PROCESSOR_2827_ZEC12, &zEC12_cost, 10 },
{ "z13", "z13", PROCESSOR_2964_Z13, &zEC12_cost, 11 },
{ "z14", "arch12", PROCESSOR_3906_Z14, &zEC12_cost, 12 },
- { "arch13", "", PROCESSOR_8561_ARCH13, &zEC12_cost, 13 },
+ { "z15", "arch13", PROCESSOR_8561_Z15, &zEC12_cost, 13 },
{ "native", "", PROCESSOR_NATIVE, NULL, 0 }
};
@@ -811,6 +811,12 @@ s390_expand_builtin (tree exp, rtx target, rtx subtarget ATTRIBUTE_UNUSED,
error ("Builtin %qF requires z14 or higher.", fndecl);
return const0_rtx;
}
+
+ if ((bflags & B_VXE2) && !TARGET_VXE2)
+ {
+ error ("Builtin %qF requires z15 or higher.", fndecl);
+ return const0_rtx;
+ }
}
if (fcode >= S390_OVERLOADED_BUILTIN_VAR_OFFSET
&& fcode < S390_ALL_BUILTIN_MAX)
@@ -1782,7 +1788,7 @@ s390_canonicalize_comparison (int *code, rtx *op0, rtx *op1,
if (*code == EQ)
new_code = reversed_comparison_code_parts (GET_CODE (*op0),
XEXP (*op0, 0),
- XEXP (*op1, 0), NULL);
+ XEXP (*op0, 1), NULL);
else
new_code = GET_CODE (*op0);
@@ -1795,7 +1801,7 @@ s390_canonicalize_comparison (int *code, rtx *op0, rtx *op1,
}
/* ~a==b -> ~(a^b)==0 ~a!=b -> ~(a^b)!=0 */
- if (TARGET_ARCH13
+ if (TARGET_Z15
&& (*code == EQ || *code == NE)
&& (GET_MODE (*op0) == DImode || GET_MODE (*op0) == SImode)
&& GET_CODE (*op0) == NOT)
@@ -1807,7 +1813,7 @@ s390_canonicalize_comparison (int *code, rtx *op0, rtx *op1,
}
/* a&b == -1 -> ~a|~b == 0 a|b == -1 -> ~a&~b == 0 */
- if (TARGET_ARCH13
+ if (TARGET_Z15
&& (*code == EQ || *code == NE)
&& (GET_CODE (*op0) == AND || GET_CODE (*op0) == IOR)
&& (GET_MODE (*op0) == DImode || GET_MODE (*op0) == SImode)
@@ -3529,7 +3535,7 @@ s390_rtx_costs (rtx x, machine_mode mode, int outer_code,
/* It is a real IF-THEN-ELSE. An additional move will be
needed to implement that. */
- if (!TARGET_ARCH13
+ if (!TARGET_Z15
&& reload_completed
&& !rtx_equal_p (dst, then)
&& !rtx_equal_p (dst, els))
@@ -3551,7 +3557,7 @@ s390_rtx_costs (rtx x, machine_mode mode, int outer_code,
case IOR:
/* nnrk, nngrk */
- if (TARGET_ARCH13
+ if (TARGET_Z15
&& (mode == SImode || mode == DImode)
&& GET_CODE (XEXP (x, 0)) == NOT
&& GET_CODE (XEXP (x, 1)) == NOT)
@@ -3598,7 +3604,7 @@ s390_rtx_costs (rtx x, machine_mode mode, int outer_code,
case AND:
/* nork, nogrk */
- if (TARGET_ARCH13
+ if (TARGET_Z15
&& (mode == SImode || mode == DImode)
&& GET_CODE (XEXP (x, 0)) == NOT
&& GET_CODE (XEXP (x, 1)) == NOT)
@@ -3770,7 +3776,7 @@ s390_rtx_costs (rtx x, machine_mode mode, int outer_code,
*total = COSTS_N_INSNS (1);
/* nxrk, nxgrk ~(a^b)==0 */
- if (TARGET_ARCH13
+ if (TARGET_Z15
&& GET_CODE (XEXP (x, 0)) == NOT
&& XEXP (x, 1) == const0_rtx
&& GET_CODE (XEXP (XEXP (x, 0), 0)) == XOR
@@ -3785,7 +3791,7 @@ s390_rtx_costs (rtx x, machine_mode mode, int outer_code,
}
/* nnrk, nngrk, nork, nogrk */
- if (TARGET_ARCH13
+ if (TARGET_Z15
&& (GET_CODE (XEXP (x, 0)) == AND || GET_CODE (XEXP (x, 0)) == IOR)
&& XEXP (x, 1) == const0_rtx
&& (GET_MODE (XEXP (x, 0)) == SImode || GET_MODE (XEXP (x, 0)) == DImode)
@@ -14440,16 +14446,16 @@ s390_get_sched_attrmask (rtx_insn *insn)
if (get_attr_z14_groupoftwo (insn))
mask |= S390_SCHED_ATTR_MASK_GROUPOFTWO;
break;
- case PROCESSOR_8561_ARCH13:
- if (get_attr_arch13_cracked (insn))
+ case PROCESSOR_8561_Z15:
+ if (get_attr_z15_cracked (insn))
mask |= S390_SCHED_ATTR_MASK_CRACKED;
- if (get_attr_arch13_expanded (insn))
+ if (get_attr_z15_expanded (insn))
mask |= S390_SCHED_ATTR_MASK_EXPANDED;
- if (get_attr_arch13_endgroup (insn))
+ if (get_attr_z15_endgroup (insn))
mask |= S390_SCHED_ATTR_MASK_ENDGROUP;
- if (get_attr_arch13_groupalone (insn))
+ if (get_attr_z15_groupalone (insn))
mask |= S390_SCHED_ATTR_MASK_GROUPALONE;
- if (get_attr_arch13_groupoftwo (insn))
+ if (get_attr_z15_groupoftwo (insn))
mask |= S390_SCHED_ATTR_MASK_GROUPOFTWO;
break;
default:
@@ -14487,15 +14493,15 @@ s390_get_unit_mask (rtx_insn *insn, int *units)
if (get_attr_z14_unit_vfu (insn))
mask |= 1 << 3;
break;
- case PROCESSOR_8561_ARCH13:
+ case PROCESSOR_8561_Z15:
*units = 4;
- if (get_attr_arch13_unit_lsu (insn))
+ if (get_attr_z15_unit_lsu (insn))
mask |= 1 << 0;
- if (get_attr_arch13_unit_fxa (insn))
+ if (get_attr_z15_unit_fxa (insn))
mask |= 1 << 1;
- if (get_attr_arch13_unit_fxb (insn))
+ if (get_attr_z15_unit_fxb (insn))
mask |= 1 << 2;
- if (get_attr_arch13_unit_vfu (insn))
+ if (get_attr_z15_unit_vfu (insn))
mask |= 1 << 3;
break;
default:
@@ -14511,7 +14517,7 @@ s390_is_fpd (rtx_insn *insn)
return false;
return get_attr_z13_unit_fpd (insn) || get_attr_z14_unit_fpd (insn)
- || get_attr_arch13_unit_fpd (insn);
+ || get_attr_z15_unit_fpd (insn);
}
static bool
@@ -14521,7 +14527,7 @@ s390_is_fxd (rtx_insn *insn)
return false;
return get_attr_z13_unit_fxd (insn) || get_attr_z14_unit_fxd (insn)
- || get_attr_arch13_unit_fxd (insn);
+ || get_attr_z15_unit_fxd (insn);
}
/* Returns TRUE if INSN is a long-running instruction. */
@@ -15968,13 +15974,19 @@ s390_support_vector_misalignment (machine_mode mode ATTRIBUTE_UNUSED,
static HOST_WIDE_INT
s390_vector_alignment (const_tree type)
{
+ tree size = TYPE_SIZE (type);
+
if (!TARGET_VX_ABI)
return default_vector_alignment (type);
if (TYPE_USER_ALIGN (type))
return TYPE_ALIGN (type);
- return MIN (64, tree_to_shwi (TYPE_SIZE (type)));
+ if (tree_fits_uhwi_p (size)
+ && tree_to_uhwi (size) < BIGGEST_ALIGNMENT)
+ return tree_to_uhwi (size);
+
+ return BIGGEST_ALIGNMENT;
}
/* Implement TARGET_CONSTANT_ALIGNMENT. Alignment on even addresses for
diff --git a/gcc/config/s390/s390.h b/gcc/config/s390/s390.h
index 969f58a2ba0..f7023d985f1 100644
--- a/gcc/config/s390/s390.h
+++ b/gcc/config/s390/s390.h
@@ -41,12 +41,12 @@ enum processor_flags
PF_Z14 = 2048,
PF_VXE = 4096,
PF_VXE2 = 8192,
- PF_ARCH13 = 16384
+ PF_Z15 = 16384
};
/* This is necessary to avoid a warning about comparing different enum
types. */
-#define s390_tune_attr ((enum attr_cpu)(s390_tune > PROCESSOR_8561_ARCH13 ? PROCESSOR_8561_ARCH13 : s390_tune ))
+#define s390_tune_attr ((enum attr_cpu)(s390_tune > PROCESSOR_8561_Z15 ? PROCESSOR_8561_Z15 : s390_tune ))
/* These flags indicate that the generated code should run on a cpu
providing the respective hardware facility regardless of the
@@ -100,10 +100,10 @@ enum processor_flags
(s390_arch_flags & PF_VXE)
#define TARGET_CPU_VXE_P(opts) \
(opts->x_s390_arch_flags & PF_VXE)
-#define TARGET_CPU_ARCH13 \
- (s390_arch_flags & PF_ARCH13)
-#define TARGET_CPU_ARCH13_P(opts) \
- (opts->x_s390_arch_flags & PF_ARCH13)
+#define TARGET_CPU_Z15 \
+ (s390_arch_flags & PF_Z15)
+#define TARGET_CPU_Z15_P(opts) \
+ (opts->x_s390_arch_flags & PF_Z15)
#define TARGET_CPU_VXE2 \
(s390_arch_flags & PF_VXE2)
#define TARGET_CPU_VXE2_P(opts) \
@@ -160,9 +160,9 @@ enum processor_flags
(TARGET_VX && TARGET_CPU_VXE)
#define TARGET_VXE_P(opts) \
(TARGET_VX_P (opts) && TARGET_CPU_VXE_P (opts))
-#define TARGET_ARCH13 (TARGET_ZARCH && TARGET_CPU_ARCH13)
-#define TARGET_ARCH13_P(opts) \
- (TARGET_ZARCH_P (opts->x_target_flags) && TARGET_CPU_ARCH13_P (opts))
+#define TARGET_Z15 (TARGET_ZARCH && TARGET_CPU_Z15)
+#define TARGET_Z15_P(opts) \
+ (TARGET_ZARCH_P (opts->x_target_flags) && TARGET_CPU_Z15_P (opts))
#define TARGET_VXE2 \
(TARGET_VX && TARGET_CPU_VXE2)
#define TARGET_VXE2_P(opts) \
diff --git a/gcc/config/s390/s390.md b/gcc/config/s390/s390.md
index 714d8b00a80..5a3496ac92e 100644
--- a/gcc/config/s390/s390.md
+++ b/gcc/config/s390/s390.md
@@ -513,11 +513,11 @@
;; Processor type. This attribute must exactly match the processor_type
;; enumeration in s390.h.
-(define_attr "cpu" "z900,z990,z9_109,z9_ec,z10,z196,zEC12,z13,z14,arch13"
+(define_attr "cpu" "z900,z990,z9_109,z9_ec,z10,z196,zEC12,z13,z14,z15"
(const (symbol_ref "s390_tune_attr")))
(define_attr "cpu_facility"
- "standard,ieee,zarch,cpu_zarch,longdisp,extimm,dfp,z10,z196,zEC12,vx,z13,z14,vxe,arch13,vxe2"
+ "standard,ieee,zarch,cpu_zarch,longdisp,extimm,dfp,z10,z196,zEC12,vx,z13,z14,vxe,z15,vxe2"
(const_string "standard"))
(define_attr "enabled" ""
@@ -575,8 +575,8 @@
(match_test "TARGET_VXE"))
(const_int 1)
- (and (eq_attr "cpu_facility" "arch13")
- (match_test "TARGET_ARCH13"))
+ (and (eq_attr "cpu_facility" "z15")
+ (match_test "TARGET_Z15"))
(const_int 1)
(and (eq_attr "cpu_facility" "vxe2")
@@ -613,7 +613,7 @@
;; Pipeline description for z14
(include "3906.md")
-;; Pipeline description for arch13
+;; Pipeline description for z15
(include "8561.md")
;; Predicates
@@ -642,7 +642,7 @@
(define_mode_iterator DD_DF [DF DD])
(define_mode_iterator TD_TF [TF TD])
-; 32 bit int<->fp conversion instructions are available since VXE2 (arch13).
+; 32 bit int<->fp conversion instructions are available since VXE2 (z15).
(define_mode_iterator VX_CONV_BFP [DF (SF "TARGET_VXE2")])
(define_mode_iterator VX_CONV_INT [DI (SI "TARGET_VXE2")])
@@ -6749,7 +6749,7 @@
stoc<g>%C1\t%3,%0
stoc<g>%D1\t%4,%0"
[(set_attr "op_type" "RRF,RRF,RRF,RSY,RSY,RIE,RIE,RSY,RSY")
- (set_attr "cpu_facility" "*,*,arch13,*,*,z13,z13,*,*")])
+ (set_attr "cpu_facility" "*,*,z15,*,*,z13,z13,*,*")])
;;
;;- Multiply instructions.
@@ -7568,7 +7568,7 @@
(and:GPR (not:GPR (match_operand:GPR 1 "nonimmediate_operand" ""))
(match_operand:GPR 2 "general_operand" "")))
(clobber (reg:CC CC_REGNUM))]
- "!TARGET_ARCH13
+ "!TARGET_Z15
&& ! reload_completed
&& (GET_CODE (operands[0]) != MEM
/* Ensure that s390_logical_operator_ok_p will succeed even
@@ -7925,7 +7925,7 @@
(set (match_operand:GPR 0 "register_operand" "=d")
(ANDOR:GPR (not:GPR (match_dup 1))
(match_dup 2)))]
- "TARGET_ARCH13 && s390_match_ccmode(insn, CCTmode)"
+ "TARGET_Z15 && s390_match_ccmode(insn, CCTmode)"
"<ANDOR:noxa>c<GPR:g>rk\t%0,%2,%1"
[(set_attr "op_type" "RRF")])
@@ -7937,7 +7937,7 @@
(match_operand:GPR 2 "register_operand" "d"))
(const_int 0)))
(clobber (match_scratch:GPR 0 "=d"))]
- "TARGET_ARCH13 && s390_match_ccmode(insn, CCTmode)"
+ "TARGET_Z15 && s390_match_ccmode(insn, CCTmode)"
"<ANDOR:noxa>c<GPR:g>rk\t%0,%2,%1"
[(set_attr "op_type" "RRF")])
@@ -7947,7 +7947,7 @@
(ANDOR:GPR (not:GPR (match_operand:GPR 1 "register_operand" "d"))
(match_operand:GPR 2 "register_operand" "d")))
(clobber (reg:CC CC_REGNUM))]
- "TARGET_ARCH13"
+ "TARGET_Z15"
"<ANDOR:noxa>c<GPR:g>rk\t%0,%2,%1"
[(set_attr "op_type" "RRF")])
@@ -7965,7 +7965,7 @@
(set (match_operand:GPR 0 "register_operand" "=d")
(ANDOR:GPR (not:GPR (match_dup 1))
(not:GPR (match_dup 2))))]
- "TARGET_ARCH13 && s390_match_ccmode(insn, CCTmode)"
+ "TARGET_Z15 && s390_match_ccmode(insn, CCTmode)"
"n<ANDOR:inv_no><GPR:g>rk\t%0,%1,%2"
[(set_attr "op_type" "RRF")])
@@ -7977,7 +7977,7 @@
(not:GPR (match_operand:GPR 2 "register_operand" "d")))
(const_int 0)))
(clobber (match_scratch:GPR 0 "=d"))]
- "TARGET_ARCH13 && s390_match_ccmode(insn, CCTmode)"
+ "TARGET_Z15 && s390_match_ccmode(insn, CCTmode)"
"n<ANDOR:inv_no><GPR:g>rk\t%0,%1,%2"
[(set_attr "op_type" "RRF")])
@@ -7987,7 +7987,7 @@
(ANDOR:GPR (not:GPR (match_operand:GPR 1 "register_operand" "d"))
(not:GPR (match_operand:GPR 2 "register_operand" "d"))))
(clobber (reg:CC CC_REGNUM))]
- "TARGET_ARCH13"
+ "TARGET_Z15"
"n<ANDOR:inv_no><GPR:g>rk\t%0,%1,%2"
[(set_attr "op_type" "RRF")])
@@ -8371,7 +8371,7 @@
(set (match_operand:GPR 0 "register_operand" "=d")
(xor:GPR (not:GPR (match_dup 1))
(match_dup 2)))]
- "TARGET_ARCH13 && s390_match_ccmode(insn, CCTmode)"
+ "TARGET_Z15 && s390_match_ccmode(insn, CCTmode)"
"nx<GPR:g>rk\t%0,%1,%2"
[(set_attr "op_type" "RRF")])
@@ -8383,7 +8383,7 @@
(match_operand:GPR 2 "register_operand" "d")))
(const_int 0)))
(clobber (match_scratch:GPR 0 "=d"))]
- "TARGET_ARCH13 && s390_match_ccmode(insn, CCTmode)"
+ "TARGET_Z15 && s390_match_ccmode(insn, CCTmode)"
"nx<GPR:g>rk\t%0,%1,%2"
[(set_attr "op_type" "RRF")])
@@ -8393,7 +8393,7 @@
(not:GPR (xor:GPR (match_operand:GPR 1 "register_operand" "d")
(match_operand:GPR 2 "register_operand" "d"))))
(clobber (reg:CC CC_REGNUM))]
- "TARGET_ARCH13"
+ "TARGET_Z15"
"nx<GPR:g>rk\t%0,%1,%2"
[(set_attr "op_type" "RRF")])
@@ -11351,34 +11351,34 @@
; Population count instruction
;
-(define_insn "*popcountdi_arch13_cc"
+(define_insn "*popcountdi_z15_cc"
[(set (reg CC_REGNUM)
(compare (popcount:DI (match_operand:DI 1 "register_operand" "d"))
(const_int 0)))
(set (match_operand:DI 0 "register_operand" "=d")
(match_dup 1))]
- "TARGET_ARCH13 && s390_match_ccmode (insn, CCTmode)"
+ "TARGET_Z15 && s390_match_ccmode (insn, CCTmode)"
"popcnt\t%0,%1,8"
[(set_attr "op_type" "RRF")])
-(define_insn "*popcountdi_arch13_cconly"
+(define_insn "*popcountdi_z15_cconly"
[(set (reg CC_REGNUM)
(compare (popcount:DI (match_operand:DI 1 "register_operand" "d"))
(const_int 0)))
(clobber (match_scratch:DI 0 "=d"))]
- "TARGET_ARCH13 && s390_match_ccmode(insn, CCTmode)"
+ "TARGET_Z15 && s390_match_ccmode(insn, CCTmode)"
"popcnt\t%0,%1,8"
[(set_attr "op_type" "RRF")])
-(define_insn "*popcountdi_arch13"
+(define_insn "*popcountdi_z15"
[(set (match_operand:DI 0 "register_operand" "=d")
(popcount:DI (match_operand:DI 1 "register_operand" "d")))
(clobber (reg:CC CC_REGNUM))]
- "TARGET_ARCH13"
+ "TARGET_Z15"
"popcnt\t%0,%1,8"
[(set_attr "op_type" "RRF")])
-; The pre-arch13 popcount instruction counts the bits of op1 in 8 byte
+; The pre-z15 popcount instruction counts the bits of op1 in 8 byte
; portions and stores the result in the corresponding bytes in op0.
(define_insn "*popcount<mode>_z196"
[(set (match_operand:INT 0 "register_operand" "=d")
@@ -11422,7 +11422,7 @@
(clobber (reg:CC CC_REGNUM))])]
"TARGET_Z196"
{
- if (!TARGET_ARCH13)
+ if (!TARGET_Z15)
{
emit_insn (gen_popcountdi2_z196 (operands[0], operands[1]));
DONE;
@@ -11453,7 +11453,7 @@
; popcount always counts on the full 64 bit. With the z196 version
; counting bits per byte we just ignore the upper 4 bytes. With the
-; arch13 version we have to zero out the upper 32 bits first.
+; z15 version we have to zero out the upper 32 bits first.
(define_expand "popcountsi2"
[(set (match_dup 2)
(zero_extend:DI (match_operand:SI 1 "register_operand")))
@@ -11463,7 +11463,7 @@
(subreg:SI (match_dup 3) 4))]
"TARGET_Z196"
{
- if (!TARGET_ARCH13)
+ if (!TARGET_Z15)
{
emit_insn (gen_popcountsi2_z196 (operands[0], operands[1]));
DONE;
@@ -11501,7 +11501,7 @@
(subreg:HI (match_dup 3) 6))]
"TARGET_Z196"
{
- if (!TARGET_ARCH13)
+ if (!TARGET_Z15)
{
emit_insn (gen_popcounthi2_z196 (operands[0], operands[1]));
DONE;
@@ -11516,7 +11516,7 @@
; For popcount on a single byte the old z196 style popcount
; instruction is ideal. Since it anyway does a byte-wise popcount we
; just use it instead of zero extending the QImode input to DImode and
-; using the arch13 popcount variant.
+; using the z15 popcount variant.
(define_expand "popcountqi2"
[; popcnt op0, op1
(parallel [(set (match_operand:QI 0 "register_operand" "")
diff --git a/gcc/config/s390/s390.opt b/gcc/config/s390/s390.opt
index 639f1679a56..6a6e1f75736 100644
--- a/gcc/config/s390/s390.opt
+++ b/gcc/config/s390/s390.opt
@@ -110,7 +110,10 @@ EnumValue
Enum(processor_type) String(arch12) Value(PROCESSOR_3906_Z14)
EnumValue
-Enum(processor_type) String(arch13) Value(PROCESSOR_8561_ARCH13)
+Enum(processor_type) String(z15) Value(PROCESSOR_8561_Z15)
+
+EnumValue
+Enum(processor_type) String(arch13) Value(PROCESSOR_8561_Z15)
EnumValue
Enum(processor_type) String(native) Value(PROCESSOR_NATIVE) DriverOnly
diff --git a/gcc/config/s390/vector.md b/gcc/config/s390/vector.md
index 140ef474a92..21cc76534b1 100644
--- a/gcc/config/s390/vector.md
+++ b/gcc/config/s390/vector.md
@@ -70,7 +70,7 @@
(define_mode_iterator V_128_NOSINGLE [V16QI V8HI V4SI V4SF V2DI V2DF])
-; 32 bit int<->fp vector conversion instructions are available since VXE2 (arch13).
+; 32 bit int<->fp vector conversion instructions are available since VXE2 (z15).
(define_mode_iterator VX_VEC_CONV_BFP [V2DF (V4SF "TARGET_VXE2")])
(define_mode_iterator VX_VEC_CONV_INT [V2DI (V4SI "TARGET_VXE2")])
diff --git a/gcc/config/s390/vx-builtins.md b/gcc/config/s390/vx-builtins.md
index 3020bc94d3e..5ec3fb4fe58 100644
--- a/gcc/config/s390/vx-builtins.md
+++ b/gcc/config/s390/vx-builtins.md
@@ -2147,7 +2147,7 @@
"<vw>fmax<sdx>b\t%v0,%v1,%v2,%b3"
[(set_attr "op_type" "VRR")])
-; The element reversal builtins introduced with arch13 have been made
+; The element reversal builtins introduced with z15 have been made
; available also for older CPUs down to z13.
(define_expand "eltswap<mode>"
[(set (match_operand:VEC_HW 0 "nonimmediate_operand" "")
@@ -2181,8 +2181,8 @@
vster<bhfgq>\t%v1,%v0"
[(set_attr "op_type" "*,VRX,VRX")])
-; arch13 has instructions for doing element reversal from mem to reg
-; or the other way around. For reg to reg or on pre arch13 machines
+; z15 has instructions for doing element reversal from mem to reg
+; or the other way around. For reg to reg or on pre z15 machines
; we have to emulate it with vector permute.
(define_insn_and_split "*eltswap<mode>_emu"
[(set (match_operand:VEC_HW 0 "nonimmediate_operand" "=vR")
diff --git a/gcc/config/sh/sh.c b/gcc/config/sh/sh.c
index 8dc79a764df..11440988f1a 100644
--- a/gcc/config/sh/sh.c
+++ b/gcc/config/sh/sh.c
@@ -664,6 +664,9 @@ static const struct attribute_spec sh_attribute_table[] =
#undef TARGET_CONSTANT_ALIGNMENT
#define TARGET_CONSTANT_ALIGNMENT constant_alignment_word_strings
+#undef TARGET_HAVE_SPECULATION_SAFE_VALUE
+#define TARGET_HAVE_SPECULATION_SAFE_VALUE speculation_safe_value_not_needed
+
struct gcc_target targetm = TARGET_INITIALIZER;
@@ -737,7 +740,7 @@ got_mode_name:;
{
if (tokens[i] == "strict")
ret.strict = true;
- else if (tokens[i].find ("gbr-offset=") == 0)
+ else if (!tokens[i].compare (0, strlen ("gbr-offset="), "gbr-offset="))
{
std::string offset_str = tokens[i].substr (strlen ("gbr-offset="));
ret.tcb_gbr_offset = integral_argument (offset_str.c_str ());
@@ -958,11 +961,13 @@ sh_option_override (void)
if (flag_unsafe_math_optimizations)
{
/* Enable fsca insn for SH4A if not otherwise specified by the user. */
- if (global_options_set.x_TARGET_FSCA == 0 && TARGET_SH4A_FP)
+ if (global_options_set.x_TARGET_FSCA == 0
+ && (TARGET_SH4A_FP || TARGET_FPU_SH4_300))
TARGET_FSCA = 1;
/* Enable fsrra insn for SH4A if not otherwise specified by the user. */
- if (global_options_set.x_TARGET_FSRRA == 0 && TARGET_SH4A_FP)
+ if (global_options_set.x_TARGET_FSRRA == 0
+ && (TARGET_SH4A_FP || TARGET_FPU_SH4_300))
TARGET_FSRRA = 1;
}
@@ -12087,9 +12092,11 @@ sh_extending_set_of_reg::use_as_extended_reg (rtx_insn* use_at_insn) const
rtx r = gen_reg_rtx (SImode);
rtx_insn* i0;
if (from_mode == QImode)
- i0 = emit_insn_after (gen_extendqisi2 (r, set_src), insn);
+ i0 = sh_check_add_incdec_notes (
+ emit_insn_after (gen_extendqisi2 (r, set_src), insn));
else if (from_mode == HImode)
- i0 = emit_insn_after (gen_extendhisi2 (r, set_src), insn);
+ i0 = sh_check_add_incdec_notes (
+ emit_insn_after (gen_extendhisi2 (r, set_src), insn));
else
gcc_unreachable ();
@@ -12507,7 +12514,7 @@ static void
sh_emit_mode_set (int entity ATTRIBUTE_UNUSED, int mode,
int prev_mode, HARD_REG_SET regs_live ATTRIBUTE_UNUSED)
{
- if ((TARGET_SH4A_FP || TARGET_SH4_300)
+ if ((TARGET_SH4A_FP || TARGET_FPU_SH4_300)
&& prev_mode != FP_MODE_NONE && prev_mode != mode)
{
emit_insn (gen_toggle_pr ());
diff --git a/gcc/config/sh/sh.h b/gcc/config/sh/sh.h
index 0204872eae7..9372fcfa699 100644
--- a/gcc/config/sh/sh.h
+++ b/gcc/config/sh/sh.h
@@ -69,6 +69,8 @@ extern int code_for_indirect_jump_scratch;
FPU is disabled (which makes it compatible with SH4al-dsp). */
#define TARGET_SH4A_FP (TARGET_SH4A && TARGET_FPU_ANY)
+/* True if the FPU is a SH4-300 variant. */
+#define TARGET_FPU_SH4_300 (TARGET_FPU_ANY && TARGET_SH4_300)
/* This is not used by the SH2E calling convention */
#define TARGET_VARARGS_PRETEND_ARGS(FUN_DECL) \
diff --git a/gcc/config/sh/sh.md b/gcc/config/sh/sh.md
index 83543778619..fdb80d5d9d6 100644
--- a/gcc/config/sh/sh.md
+++ b/gcc/config/sh/sh.md
@@ -9163,7 +9163,7 @@
(xor:SI (reg:SI FPSCR_REG) (const_int FPSCR_PR)))
(set (reg:SI FPSCR_MODES_REG)
(unspec_volatile:SI [(const_int 0)] UNSPECV_FPSCR_MODES))]
- "TARGET_SH4A_FP"
+ "TARGET_SH4A_FP || TARGET_FPU_SH4_300"
"fpchg"
[(set_attr "type" "fpscr_toggle")])
@@ -9391,15 +9391,31 @@
(define_expand "negsf2"
[(set (match_operand:SF 0 "fp_arith_reg_operand")
(neg:SF (match_operand:SF 1 "fp_arith_reg_operand")))]
- "TARGET_SH2E")
+ "TARGET_FPU_ANY"
+{
+ if (TARGET_FPU_SH4_300)
+ emit_insn (gen_negsf2_fpscr (operands[0], operands[1]));
+ else
+ emit_insn (gen_negsf2_no_fpscr (operands[0], operands[1]));
+ DONE;
+})
-(define_insn "*negsf2_i"
+(define_insn "negsf2_no_fpscr"
[(set (match_operand:SF 0 "fp_arith_reg_operand" "=f")
(neg:SF (match_operand:SF 1 "fp_arith_reg_operand" "0")))]
- "TARGET_SH2E"
+ "TARGET_FPU_ANY && !TARGET_FPU_SH4_300"
"fneg %0"
[(set_attr "type" "fmove")])
+(define_insn "negsf2_fpscr"
+ [(set (match_operand:SF 0 "fp_arith_reg_operand" "=f")
+ (neg:SF (match_operand:SF 1 "fp_arith_reg_operand" "0")))
+ (use (reg:SI FPSCR_MODES_REG))]
+ "TARGET_FPU_SH4_300"
+ "fneg %0"
+ [(set_attr "type" "fmove")
+ (set_attr "fp_mode" "single")])
+
(define_expand "sqrtsf2"
[(set (match_operand:SF 0 "fp_arith_reg_operand" "")
(sqrt:SF (match_operand:SF 1 "fp_arith_reg_operand" "")))]
@@ -9489,15 +9505,31 @@
(define_expand "abssf2"
[(set (match_operand:SF 0 "fp_arith_reg_operand")
(abs:SF (match_operand:SF 1 "fp_arith_reg_operand")))]
- "TARGET_SH2E")
+ "TARGET_FPU_ANY"
+{
+ if (TARGET_FPU_SH4_300)
+ emit_insn (gen_abssf2_fpscr (operands[0], operands[1]));
+ else
+ emit_insn (gen_abssf2_no_fpscr (operands[0], operands[1]));
+ DONE;
+})
-(define_insn "*abssf2_i"
+(define_insn "abssf2_no_fpscr"
[(set (match_operand:SF 0 "fp_arith_reg_operand" "=f")
(abs:SF (match_operand:SF 1 "fp_arith_reg_operand" "0")))]
- "TARGET_SH2E"
+ "TARGET_FPU_ANY && !TARGET_FPU_SH4_300"
"fabs %0"
[(set_attr "type" "fmove")])
+(define_insn "abssf2_fpscr"
+ [(set (match_operand:SF 0 "fp_arith_reg_operand" "=f")
+ (abs:SF (match_operand:SF 1 "fp_arith_reg_operand" "0")))
+ (use (reg:SI FPSCR_MODES_REG))]
+ "TARGET_FPU_SH4_300"
+ "fabs %0"
+ [(set_attr "type" "fmove")
+ (set_attr "fp_mode" "single")])
+
(define_expand "adddf3"
[(set (match_operand:DF 0 "fp_arith_reg_operand" "")
(plus:DF (match_operand:DF 1 "fp_arith_reg_operand" "")
@@ -9673,12 +9705,28 @@
(define_expand "negdf2"
[(set (match_operand:DF 0 "fp_arith_reg_operand")
(neg:DF (match_operand:DF 1 "fp_arith_reg_operand")))]
- "TARGET_FPU_DOUBLE")
+ "TARGET_FPU_DOUBLE"
+{
+ if (TARGET_FPU_SH4_300)
+ emit_insn (gen_negdf2_fpscr (operands[0], operands[1]));
+ else
+ emit_insn (gen_negdf2_no_fpscr (operands[0], operands[1]));
+ DONE;
+})
-(define_insn "*negdf2_i"
+(define_insn "negdf2_fpscr"
+ [(set (match_operand:DF 0 "fp_arith_reg_operand" "=f")
+ (neg:DF (match_operand:DF 1 "fp_arith_reg_operand" "0")))
+ (use (reg:SI FPSCR_MODES_REG))]
+ "TARGET_FPU_SH4_300"
+ "fneg %0"
+ [(set_attr "type" "fmove")
+ (set_attr "fp_mode" "double")])
+
+(define_insn "negdf2_no_fpscr"
[(set (match_operand:DF 0 "fp_arith_reg_operand" "=f")
(neg:DF (match_operand:DF 1 "fp_arith_reg_operand" "0")))]
- "TARGET_FPU_DOUBLE"
+ "TARGET_FPU_DOUBLE && !TARGET_FPU_SH4_300"
"fneg %0"
[(set_attr "type" "fmove")])
@@ -9704,15 +9752,31 @@
(define_expand "absdf2"
[(set (match_operand:DF 0 "fp_arith_reg_operand")
(abs:DF (match_operand:DF 1 "fp_arith_reg_operand")))]
- "TARGET_FPU_DOUBLE")
+ "TARGET_FPU_DOUBLE"
+{
+ if (TARGET_FPU_SH4_300)
+ emit_insn (gen_absdf2_fpscr (operands[0], operands[1]));
+ else
+ emit_insn (gen_absdf2_no_fpscr (operands[0], operands[1]));
+ DONE;
+})
-(define_insn "*absdf2_i"
+(define_insn "absdf2_no_fpscr"
[(set (match_operand:DF 0 "fp_arith_reg_operand" "=f")
(abs:DF (match_operand:DF 1 "fp_arith_reg_operand" "0")))]
- "TARGET_FPU_DOUBLE"
+ "TARGET_FPU_DOUBLE && !TARGET_FPU_SH4_300"
"fabs %0"
[(set_attr "type" "fmove")])
+(define_insn "absdf2_fpscr"
+ [(set (match_operand:DF 0 "fp_arith_reg_operand" "=f")
+ (abs:DF (match_operand:DF 1 "fp_arith_reg_operand" "0")))
+ (use (reg:SI FPSCR_MODES_REG))]
+ "TARGET_FPU_SH4_300"
+ "fabs %0"
+ [(set_attr "type" "fmove")
+ (set_attr "fp_mode" "double")])
+
(define_expand "extendsfdf2"
[(set (match_operand:DF 0 "fp_arith_reg_operand" "")
(float_extend:DF (match_operand:SF 1 "fpul_operand" "")))]
diff --git a/gcc/config/sparc/sparc-protos.h b/gcc/config/sparc/sparc-protos.h
index 9bdae7b9faa..ef1adb69ede 100644
--- a/gcc/config/sparc/sparc-protos.h
+++ b/gcc/config/sparc/sparc-protos.h
@@ -69,6 +69,7 @@ extern void sparc_split_reg_mem (rtx, rtx, machine_mode);
extern void sparc_split_mem_reg (rtx, rtx, machine_mode);
extern int sparc_split_reg_reg_legitimate (rtx, rtx);
extern void sparc_split_reg_reg (rtx, rtx, machine_mode);
+extern const char *output_load_pcrel_sym (rtx *);
extern const char *output_ubranch (rtx, rtx_insn *);
extern const char *output_cbranch (rtx, rtx, int, int, int, rtx_insn *);
extern const char *output_return (rtx_insn *);
diff --git a/gcc/config/sparc/sparc.c b/gcc/config/sparc/sparc.c
index 93479ab6bdc..ca783a68e2d 100644
--- a/gcc/config/sparc/sparc.c
+++ b/gcc/config/sparc/sparc.c
@@ -4243,9 +4243,11 @@ sparc_cannot_force_const_mem (machine_mode mode, rtx x)
}
/* Global Offset Table support. */
-static GTY(()) rtx got_helper_rtx = NULL_RTX;
-static GTY(()) rtx got_register_rtx = NULL_RTX;
static GTY(()) rtx got_symbol_rtx = NULL_RTX;
+static GTY(()) rtx got_register_rtx = NULL_RTX;
+static GTY(()) rtx got_helper_rtx = NULL_RTX;
+
+static GTY(()) bool got_helper_needed = false;
/* Return the SYMBOL_REF for the Global Offset Table. */
@@ -4258,27 +4260,6 @@ sparc_got (void)
return got_symbol_rtx;
}
-#ifdef HAVE_GAS_HIDDEN
-# define USE_HIDDEN_LINKONCE 1
-#else
-# define USE_HIDDEN_LINKONCE 0
-#endif
-
-static void
-get_pc_thunk_name (char name[32], unsigned int regno)
-{
- const char *reg_name = reg_names[regno];
-
- /* Skip the leading '%' as that cannot be used in a
- symbol name. */
- reg_name += 1;
-
- if (USE_HIDDEN_LINKONCE)
- sprintf (name, "__sparc_get_pc_thunk.%s", reg_name);
- else
- ASM_GENERATE_INTERNAL_LABEL (name, "LADDPC", regno);
-}
-
/* Wrapper around the load_pcrel_sym{si,di} patterns. */
static rtx
@@ -4298,30 +4279,78 @@ gen_load_pcrel_sym (rtx op0, rtx op1, rtx op2)
return insn;
}
+/* Output the load_pcrel_sym{si,di} patterns. */
+
+const char *
+output_load_pcrel_sym (rtx *operands)
+{
+ if (flag_delayed_branch)
+ {
+ output_asm_insn ("sethi\t%%hi(%a1-4), %0", operands);
+ output_asm_insn ("call\t%a2", operands);
+ output_asm_insn (" add\t%0, %%lo(%a1+4), %0", operands);
+ }
+ else
+ {
+ output_asm_insn ("sethi\t%%hi(%a1-8), %0", operands);
+ output_asm_insn ("add\t%0, %%lo(%a1-4), %0", operands);
+ output_asm_insn ("call\t%a2", operands);
+ output_asm_insn (" nop", NULL);
+ }
+
+ if (operands[2] == got_helper_rtx)
+ got_helper_needed = true;
+
+ return "";
+}
+
+#ifdef HAVE_GAS_HIDDEN
+# define USE_HIDDEN_LINKONCE 1
+#else
+# define USE_HIDDEN_LINKONCE 0
+#endif
+
/* Emit code to load the GOT register. */
void
load_got_register (void)
{
- if (!got_register_rtx)
- got_register_rtx = gen_rtx_REG (Pmode, GLOBAL_OFFSET_TABLE_REGNUM);
+ rtx insn;
if (TARGET_VXWORKS_RTP)
- emit_insn (gen_vxworks_load_got ());
+ {
+ if (!got_register_rtx)
+ got_register_rtx = pic_offset_table_rtx;
+
+ insn = gen_vxworks_load_got ();
+ }
else
{
+ if (!got_register_rtx)
+ got_register_rtx = gen_rtx_REG (Pmode, GLOBAL_OFFSET_TABLE_REGNUM);
+
/* The GOT symbol is subject to a PC-relative relocation so we need a
helper function to add the PC value and thus get the final value. */
if (!got_helper_rtx)
{
char name[32];
- get_pc_thunk_name (name, GLOBAL_OFFSET_TABLE_REGNUM);
+
+ /* Skip the leading '%' as that cannot be used in a symbol name. */
+ if (USE_HIDDEN_LINKONCE)
+ sprintf (name, "__sparc_get_pc_thunk.%s",
+ reg_names[REGNO (got_register_rtx)] + 1);
+ else
+ ASM_GENERATE_INTERNAL_LABEL (name, "LADDPC",
+ REGNO (got_register_rtx));
+
got_helper_rtx = gen_rtx_SYMBOL_REF (Pmode, ggc_strdup (name));
}
- emit_insn (gen_load_pcrel_sym (got_register_rtx, sparc_got (),
- got_helper_rtx));
+ insn
+ = gen_load_pcrel_sym (got_register_rtx, sparc_got (), got_helper_rtx);
}
+
+ emit_insn (insn);
}
/* Ensure that we are not using patterns that are not OK with PIC. */
@@ -4457,7 +4486,7 @@ sparc_pic_register_p (rtx x)
return true;
if (!HARD_REGISTER_P (pic_offset_table_rtx)
- && (HARD_REGISTER_P (x) || lra_in_progress)
+ && (HARD_REGISTER_P (x) || lra_in_progress || reload_in_progress)
&& ORIGINAL_REGNO (x) == REGNO (pic_offset_table_rtx))
return true;
@@ -5486,7 +5515,7 @@ save_local_or_in_reg_p (unsigned int regno, int leaf_function)
return true;
/* GOT register (%l7) if needed. */
- if (regno == GLOBAL_OFFSET_TABLE_REGNUM && got_register_rtx)
+ if (got_register_rtx && regno == REGNO (got_register_rtx))
return true;
/* If the function accesses prior frames, the frame pointer and the return
@@ -12529,10 +12558,9 @@ static void
sparc_file_end (void)
{
/* If we need to emit the special GOT helper function, do so now. */
- if (got_helper_rtx)
+ if (got_helper_needed)
{
const char *name = XSTR (got_helper_rtx, 0);
- const char *reg_name = reg_names[GLOBAL_OFFSET_TABLE_REGNUM];
#ifdef DWARF2_UNWIND_INFO
bool do_cfi;
#endif
@@ -12569,17 +12597,22 @@ sparc_file_end (void)
#ifdef DWARF2_UNWIND_INFO
do_cfi = dwarf2out_do_cfi_asm ();
if (do_cfi)
- fprintf (asm_out_file, "\t.cfi_startproc\n");
+ output_asm_insn (".cfi_startproc", NULL);
#endif
if (flag_delayed_branch)
- fprintf (asm_out_file, "\tjmp\t%%o7+8\n\t add\t%%o7, %s, %s\n",
- reg_name, reg_name);
+ {
+ output_asm_insn ("jmp\t%%o7+8", NULL);
+ output_asm_insn (" add\t%%o7, %0, %0", &got_register_rtx);
+ }
else
- fprintf (asm_out_file, "\tadd\t%%o7, %s, %s\n\tjmp\t%%o7+8\n\t nop\n",
- reg_name, reg_name);
+ {
+ output_asm_insn ("add\t%%o7, %0, %0", &got_register_rtx);
+ output_asm_insn ("jmp\t%%o7+8", NULL);
+ output_asm_insn (" nop", NULL);
+ }
#ifdef DWARF2_UNWIND_INFO
if (do_cfi)
- fprintf (asm_out_file, "\t.cfi_endproc\n");
+ output_asm_insn (".cfi_endproc", NULL);
#endif
}
@@ -13085,7 +13118,10 @@ sparc_init_pic_reg (void)
edge entry_edge;
rtx_insn *seq;
- if (!crtl->uses_pic_offset_table)
+ /* In PIC mode, we need to always initialize the PIC register if optimization
+ is enabled, because we are called from IRA and LRA may later force things
+ to the constant pool for optimization purposes. */
+ if (!flag_pic || (!crtl->uses_pic_offset_table && !optimize))
return;
start_sequence ();
diff --git a/gcc/config/sparc/sparc.h b/gcc/config/sparc/sparc.h
index 015065ffb81..4b09fc86b78 100644
--- a/gcc/config/sparc/sparc.h
+++ b/gcc/config/sparc/sparc.h
@@ -736,6 +736,13 @@ along with GCC; see the file COPYING3. If not see
register window instruction in the prologue. */
#define HARD_REGNO_RENAME_OK(FROM, TO) ((FROM) != 1)
+/* Select a register mode required for caller save of hard regno REGNO.
+ Contrary to what is documented, the default is not the smallest suitable
+ mode but the largest suitable mode for the given (REGNO, NREGS) pair and
+ it quickly creates paradoxical subregs that can be problematic. */
+#define HARD_REGNO_CALLER_SAVE_MODE(REGNO, NREGS, MODE) \
+ ((MODE) == VOIDmode ? choose_hard_reg_mode (REGNO, NREGS, false) : (MODE))
+
/* Specify the registers used for certain standard purposes.
The values of these macros are register numbers. */
diff --git a/gcc/config/sparc/sparc.md b/gcc/config/sparc/sparc.md
index 7af62d599b9..0a6e27ffa83 100644
--- a/gcc/config/sparc/sparc.md
+++ b/gcc/config/sparc/sparc.md
@@ -1604,10 +1604,7 @@
(clobber (reg:P O7_REG))]
"REGNO (operands[0]) == INTVAL (operands[3])"
{
- if (flag_delayed_branch)
- return "sethi\t%%hi(%a1-4), %0\n\tcall\t%a2\n\t add\t%0, %%lo(%a1+4), %0";
- else
- return "sethi\t%%hi(%a1-8), %0\n\tadd\t%0, %%lo(%a1-4), %0\n\tcall\t%a2\n\t nop";
+ return output_load_pcrel_sym (operands);
}
[(set (attr "type") (const_string "multi"))
(set (attr "length")
diff --git a/gcc/config/xtensa/xtensa.c b/gcc/config/xtensa/xtensa.c
index 19bd616d67f..ee5612441e2 100644
--- a/gcc/config/xtensa/xtensa.c
+++ b/gcc/config/xtensa/xtensa.c
@@ -2865,7 +2865,8 @@ xtensa_expand_prologue (void)
gen_rtx_SET (mem, reg));
}
}
- if (total_size > 1024)
+ if (total_size > 1024
+ || (!callee_save_size && total_size > 128))
{
rtx tmp_reg = gen_rtx_REG (Pmode, A9_REG);
emit_move_insn (tmp_reg, GEN_INT (total_size -
diff --git a/gcc/configure b/gcc/configure
index 29cce8430f6..29be5e80f9a 100755
--- a/gcc/configure
+++ b/gcc/configure
@@ -701,6 +701,7 @@ build_exeext
all_selected_languages
all_languages
all_lang_makefrags
+all_lang_configurefrags
all_gtfiles
all_compilers
srcdir
@@ -18646,7 +18647,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 18649 "configure"
+#line 18650 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -18752,7 +18753,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 18755 "configure"
+#line 18756 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -29584,7 +29585,8 @@ lang_tree_files=
all_languages=
all_compilers=
all_outputs='Makefile'
-# List of language makefile fragments.
+# List of language configure and makefile fragments.
+all_lang_configurefrags=
all_lang_makefrags=
# Additional files for gengtype
all_gtfiles="$target_gtfiles"
@@ -29670,6 +29672,7 @@ do
esac
$ok || continue
+ all_lang_configurefrags="$all_lang_configurefrags \$(srcdir)/$gcc_subdir/config-lang.in"
all_lang_makefrags="$all_lang_makefrags \$(srcdir)/$gcc_subdir/Make-lang.in"
if test -f $srcdir/$gcc_subdir/lang.opt; then
lang_opt_files="$lang_opt_files $srcdir/$gcc_subdir/lang.opt"
@@ -29842,6 +29845,7 @@ fi
+
# Echo link setup.
if test x${build} = x${host} ; then
if test x${host} = x${target} ; then
diff --git a/gcc/configure.ac b/gcc/configure.ac
index 09a8d22c671..48281d6b137 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -6206,7 +6206,8 @@ lang_tree_files=
all_languages=
all_compilers=
all_outputs='Makefile'
-# List of language makefile fragments.
+# List of language configure and makefile fragments.
+all_lang_configurefrags=
all_lang_makefrags=
# Additional files for gengtype
all_gtfiles="$target_gtfiles"
@@ -6294,6 +6295,7 @@ changequote([,])dnl
esac
$ok || continue
+ all_lang_configurefrags="$all_lang_configurefrags \$(srcdir)/$gcc_subdir/config-lang.in"
all_lang_makefrags="$all_lang_makefrags \$(srcdir)/$gcc_subdir/Make-lang.in"
if test -f $srcdir/$gcc_subdir/lang.opt; then
lang_opt_files="$lang_opt_files $srcdir/$gcc_subdir/lang.opt"
@@ -6401,6 +6403,7 @@ AC_SUBST(subdirs)
AC_SUBST(srcdir)
AC_SUBST(all_compilers)
AC_SUBST(all_gtfiles)
+AC_SUBST(all_lang_configurefrags)
AC_SUBST(all_lang_makefrags)
AC_SUBST(all_languages)
AC_SUBST(all_selected_languages)
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index adc0a839708..ae4ba4a372a 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,171 @@
+2019-11-20 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/90767
+ * call.c (complain_about_no_candidates_for_method_call): If
+ conv->from is not a type, pass to complain_about_bad_argument
+ lvalue_type of conv->from.
+
+ Backported from mainline
+ 2019-11-19 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/92504
+ * semantics.c (handle_omp_for_class_iterator): Don't call
+ cp_fully_fold on cond.
+
+2019-11-08 Marek Polacek <polacek@redhat.com>
+
+ Backported from mainline
+ 2019-10-29 Marek Polacek <polacek@redhat.com>
+
+ PR c++/90998 - ICE with copy elision in init by ctor and -Wconversion.
+ * call.c (joust): Don't attempt to warn if ->second_conv is null.
+
+2019-11-08 Jakub Jelinek <jakub@redhat.com>
+
+ Backported from mainline
+ 2019-11-05 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/92343
+ * constexpr.c (potential_constant_expression_1): Return true rather
+ than false for PREDICT_EXPR.
+
+ 2019-10-31 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/90947
+ * cp-tree.h (type_initializer_zero_p): Declare.
+ * decl.c (reshape_init_array_1): Formatting fix.
+ * tree.c (type_initializer_zero_p): New function. Moved from
+ ../tree.c, use next_initializable_field, formatting fix. Return
+ false for TYPE_NON_AGGREGATE_CLASS types.
+
+ 2019-10-22 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/85887
+ * decl.c (expand_static_init): Drop ECF_LEAF from __cxa_guard_acquire
+ and __cxa_guard_release.
+
+ 2019-10-21 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/92015
+ * constexpr.c (cxx_eval_component_reference, cxx_eval_bit_field_ref):
+ Use STRIP_ANY_LOCATION_WRAPPER on CONSTRUCTOR elts.
+
+2019-10-29 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/92201
+ * cp-gimplify.c (cp_gimplify_expr): If gimplify_to_rvalue changes the
+ function pointer type, re-add cast to the original one.
+
+2018-10-26 Ville Voutilainen <ville.voutilainen@gmail.com>
+
+ Backport from mainline
+
+ 2019-06-01 Ville Voutilainen <ville.voutilainen@gmail.com>
+
+ PR c++/85254
+ * class.c (fixup_type_variants): Handle CLASSTYPE_FINAL.
+
+2019-10-24 Marek Polacek <polacek@redhat.com>
+
+ * decl.c (reshape_init_r): Add missing space.
+
+2019-10-22 Marek Polacek <polacek@redhat.com>
+
+ Backported from mainline
+ 2019-10-21 Marek Polacek <polacek@redhat.com>
+
+ PR c++/92106 - ICE with structured bindings and -Wreturn-local-addr.
+ * typeck.c (maybe_warn_about_returning_address_of_local): Avoid
+ recursing on null initializer and return false instead.
+
+ PR c++/92062 - ODR-use ignored for static member of class template.
+ * pt.c (has_value_dependent_address): Strip location wrappers.
+
+2019-10-21 Jakub Jelinek <jakub@redhat.com>
+
+ Backported from mainline
+ 2019-10-04 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/91974
+ * cp-gimplify.c (cp_gimplify_expr) <case CALL_EXPR>: For
+ -fstrong-eval-order ensure CALL_EXPR_FN side-effects are evaluated
+ before any arguments. Additionally, ensure CALL_EXPR_FN that isn't
+ invariant nor OBJ_TYPE_REF nor SSA_NAME is forced into a temporary.
+
+ 2019-09-27 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/88203
+ * parser.c (cp_parser_omp_var_list_no_open): Parse predefined
+ variables.
+ * semantics.c (finish_omp_clauses): Allow predefined variables in
+ shared and firstprivate clauses, even when they are predetermined
+ shared.
+ * cp-gimplify.c (cxx_omp_predetermined_sharing_1): Return
+ OMP_CLAUSE_DEFAULT_SHARED for predefined variables.
+
+ 2019-08-09 Jakub Jelinek <jakub@redhat.com>
+
+ PR c/91401
+ * parser.c (cp_parser_omp_clause_dist_schedule): Comment out the
+ check_no_duplicate_clause call, instead emit a warning for duplicate
+ dist_schedule clauses.
+
+2019-10-16 Richard Biener <rguenther@suse.de>
+
+ Backport from mainline
+ 2019-10-02 Richard Biener <rguenther@suse.de>
+
+ PR c++/91606
+ * decl.c (build_ptrmemfunc_type): Mark pointer-to-member
+ fat pointer structure members as DECL_NONADDRESSABLE_P.
+
+2019-10-08 Marek Polacek <polacek@redhat.com>
+
+ Backported from mainline
+ 2019-09-15 Marek Polacek <polacek@redhat.com>
+
+ PR c++/91740 - ICE with constexpr call and ?: in ARRAY_REF.
+ * pt.c (build_non_dependent_expr): Call build_non_dependent_expr for
+ the first operand.
+
+2019-09-28 Marek Polacek <polacek@redhat.com>
+
+ Backported from mainline
+ 2019-09-28 Marek Polacek <polacek@redhat.com>
+
+ PR c++/91923 - failure-to-SFINAE with class type NTTP in C++17.
+ * pt.c (invalid_nontype_parm_type_p): Only emit errors when
+ tf_error.
+
+2019-09-10 Marek Polacek <polacek@redhat.com>
+
+ Backported from mainline
+ 2019-09-10 Marek Polacek <polacek@redhat.com>
+
+ PR c++/91705 - constexpr evaluation rejects ++/-- on floats.
+ * constexpr.c (cxx_eval_increment_expression): Call fold_simple on
+ the offset.
+
+2019-09-01 Marek Polacek <polacek@redhat.com>
+
+ Backported from mainline
+ 2019-09-01 Marek Polacek <polacek@redhat.com>
+
+ PR c++/91129 - wrong error with binary op in template argument.
+ * typeck.c (warn_for_null_address): Use fold_for_warn instead of
+ fold_non_dependent_expr.
+ (cp_build_binary_op): Likewise.
+
+2019-08-31 Iain Sandoe <iain@sandoe.co.uk>
+
+ Backported from mainline
+ 2019-08-23 Iain Sandoe <iain@sandoe.co.uk>
+
+ PR pch/61250
+ * parser.c (cp_parser_initial_pragma): Call c_common_no_more_pch ()
+ after determining that the first token is not
+ PRAGMA_GCC_PCH_PREPROCESS.
+
2019-08-23 Marek Polacek <polacek@redhat.com>
Backported from mainline
diff --git a/gcc/cp/call.c b/gcc/cp/call.c
index 14ddc98f301..8e56705d6ce 100644
--- a/gcc/cp/call.c
+++ b/gcc/cp/call.c
@@ -9558,8 +9558,11 @@ complain_about_no_candidates_for_method_call (tree instance,
if (const conversion_info *conv
= maybe_get_bad_conversion_for_unmatched_call (candidate))
{
+ tree from_type = conv->from;
+ if (!TYPE_P (conv->from))
+ from_type = lvalue_type (conv->from);
complain_about_bad_argument (conv->loc,
- conv->from, conv->to_type,
+ from_type, conv->to_type,
candidate->fn, conv->n_arg);
return;
}
@@ -10739,7 +10742,9 @@ joust (struct z_candidate *cand1, struct z_candidate *cand2, bool warn,
either between a constructor and a conversion op, or between two
conversion ops. */
if ((complain & tf_warning)
- && winner && warn_conversion && cand1->second_conv
+ /* In C++17, the constructor might have been elided, which means that
+ an originally null ->second_conv could become non-null. */
+ && winner && warn_conversion && cand1->second_conv && cand2->second_conv
&& (!DECL_CONSTRUCTOR_P (cand1->fn) || !DECL_CONSTRUCTOR_P (cand2->fn))
&& winner != compare_ics (cand1->second_conv, cand2->second_conv))
{
diff --git a/gcc/cp/class.c b/gcc/cp/class.c
index b3b06eca374..f7059fb7341 100644
--- a/gcc/cp/class.c
+++ b/gcc/cp/class.c
@@ -1907,6 +1907,7 @@ fixup_type_variants (tree t)
= TYPE_HAS_NONTRIVIAL_DESTRUCTOR (t);
TYPE_POLYMORPHIC_P (variants) = TYPE_POLYMORPHIC_P (t);
+ CLASSTYPE_FINAL (variants) = CLASSTYPE_FINAL (t);
TYPE_BINFO (variants) = TYPE_BINFO (t);
diff --git a/gcc/cp/constexpr.c b/gcc/cp/constexpr.c
index f6f21b33396..9845416a812 100644
--- a/gcc/cp/constexpr.c
+++ b/gcc/cp/constexpr.c
@@ -2703,7 +2703,10 @@ cxx_eval_component_reference (const constexpr_ctx *ctx, tree t,
: field == part)
{
if (value)
- return value;
+ {
+ STRIP_ANY_LOCATION_WRAPPER (value);
+ return value;
+ }
else
/* We're in the middle of initializing it. */
break;
@@ -2793,6 +2796,7 @@ cxx_eval_bit_field_ref (const constexpr_ctx *ctx, tree t,
FOR_EACH_CONSTRUCTOR_ELT (CONSTRUCTOR_ELTS (whole), i, field, value)
{
tree bitpos = bit_position (field);
+ STRIP_ANY_LOCATION_WRAPPER (value);
if (bitpos == start && DECL_SIZE (field) == TREE_OPERAND (t, 1))
return value;
if (TREE_CODE (TREE_TYPE (field)) == INTEGER_TYPE
@@ -3973,6 +3977,10 @@ cxx_eval_increment_expression (const constexpr_ctx *ctx, tree t,
tree offset = TREE_OPERAND (t, 1);
gcc_assert (TREE_CONSTANT (offset));
+ /* OFFSET is constant, but perhaps not constant enough. We need to
+ e.g. bash FLOAT_EXPRs to REAL_CSTs. */
+ offset = fold_simple (offset);
+
/* The operand as an lvalue. */
op = cxx_eval_constant_expression (ctx, op, true,
non_constant_p, overflow_p);
@@ -5917,6 +5925,7 @@ potential_constant_expression_1 (tree t, bool want_rval, bool strict, bool now,
case LABEL_DECL:
case LABEL_EXPR:
case CASE_LABEL_EXPR:
+ case PREDICT_EXPR:
case CONST_DECL:
case SIZEOF_EXPR:
case ALIGNOF_EXPR:
@@ -6751,7 +6760,6 @@ potential_constant_expression_1 (tree t, bool want_rval, bool strict, bool now,
case CLEANUP_STMT:
case EMPTY_CLASS_EXPR:
- case PREDICT_EXPR:
return false;
case GOTO_EXPR:
diff --git a/gcc/cp/cp-gimplify.c b/gcc/cp/cp-gimplify.c
index 17d10456341..a7121b70a3b 100644
--- a/gcc/cp/cp-gimplify.c
+++ b/gcc/cp/cp-gimplify.c
@@ -816,6 +816,27 @@ cp_gimplify_expr (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p)
case CALL_EXPR:
ret = GS_OK;
+ if (flag_strong_eval_order == 2
+ && CALL_EXPR_FN (*expr_p)
+ && cp_get_callee_fndecl_nofold (*expr_p) == NULL_TREE)
+ {
+ tree fnptrtype = TREE_TYPE (CALL_EXPR_FN (*expr_p));
+ enum gimplify_status t
+ = gimplify_expr (&CALL_EXPR_FN (*expr_p), pre_p, NULL,
+ is_gimple_call_addr, fb_rvalue);
+ if (t == GS_ERROR)
+ ret = GS_ERROR;
+ else if (is_gimple_variable (CALL_EXPR_FN (*expr_p))
+ && TREE_CODE (CALL_EXPR_FN (*expr_p)) != SSA_NAME)
+ CALL_EXPR_FN (*expr_p)
+ = get_initialized_tmp_var (CALL_EXPR_FN (*expr_p), pre_p,
+ NULL);
+ /* GIMPLE considers most pointer conversion useless, but for
+ calls we actually care about the exact function pointer type. */
+ if (t != GS_ERROR && TREE_TYPE (CALL_EXPR_FN (*expr_p)) != fnptrtype)
+ CALL_EXPR_FN (*expr_p)
+ = build1 (NOP_EXPR, fnptrtype, CALL_EXPR_FN (*expr_p));
+ }
if (!CALL_EXPR_FN (*expr_p))
/* Internal function call. */;
else if (CALL_EXPR_REVERSE_ARGS (*expr_p))
@@ -2050,6 +2071,9 @@ cxx_omp_predetermined_sharing_1 (tree decl)
tree ctx = CP_DECL_CONTEXT (decl);
if (TYPE_P (ctx) && MAYBE_CLASS_TYPE_P (ctx))
return OMP_CLAUSE_DEFAULT_SHARED;
+
+ if (c_omp_predefined_variable (decl))
+ return OMP_CLAUSE_DEFAULT_SHARED;
}
/* this may not be specified in data-sharing clauses, still we need
diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h
index e15a07392ca..050e4b0f3a7 100644
--- a/gcc/cp/cp-tree.h
+++ b/gcc/cp/cp-tree.h
@@ -7325,6 +7325,11 @@ extern tree cxx_copy_lang_qualifiers (const_tree, const_tree);
extern void cxx_print_statistics (void);
extern bool maybe_warn_zero_as_null_pointer_constant (tree, location_t);
+/* Analogous to initializer_zerop but also examines the type for
+ which the initializer is being used. Unlike initializer_zerop,
+ considers empty strings to be zero initializers for arrays and
+ non-zero for pointers. */
+extern bool type_initializer_zero_p (tree, tree);
/* in ptree.c */
extern void cxx_print_xnode (FILE *, tree, int);
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 05ceda89d4c..444332e53ba 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -4474,13 +4474,27 @@ cp_fname_init (const char* name, tree *type_p)
static tree
cp_make_fname_decl (location_t loc, tree id, int type_dep)
{
- const char *const name = (type_dep && in_template_function ()
- ? NULL : fname_as_string (type_dep));
+ const char * name = NULL;
+ bool release_name = false;
+ if (!(type_dep && in_template_function ()))
+ {
+ if (current_function_decl == NULL_TREE)
+ name = "top level";
+ else if (type_dep == 1) /* __PRETTY_FUNCTION__ */
+ name = cxx_printable_name (current_function_decl, 2);
+ else if (type_dep == 0) /* __FUNCTION__ */
+ {
+ name = fname_as_string (type_dep);
+ release_name = true;
+ }
+ else
+ gcc_unreachable ();
+ }
tree type;
tree init = cp_fname_init (name, &type);
tree decl = build_decl (loc, VAR_DECL, id, type);
- if (name)
+ if (release_name)
free (CONST_CAST (char *, name));
/* As we're using pushdecl_with_scope, we must set the context. */
@@ -5836,9 +5850,8 @@ reshape_init_array_1 (tree elt_type, tree max_index, reshape_iter *d,
/* Pointers initialized to strings must be treated as non-zero
even if the string is empty. */
tree init_type = TREE_TYPE (elt_init);
- if ((POINTER_TYPE_P (elt_type) != POINTER_TYPE_P (init_type)))
- last_nonzero = index;
- else if (!type_initializer_zero_p (elt_type, elt_init))
+ if (POINTER_TYPE_P (elt_type) != POINTER_TYPE_P (init_type)
+ || !type_initializer_zero_p (elt_type, elt_init))
last_nonzero = index;
/* This can happen with an invalid initializer (c++/54501). */
@@ -6115,7 +6128,7 @@ reshape_init_r (tree type, reshape_iter *d, bool first_initializer_p,
(CONSTRUCTOR_ELT (stripped_init,0)->value))))
{
if (complain & tf_error)
- error ("too many braces around scalar initializer"
+ error ("too many braces around scalar initializer "
"for type %qT", type);
init = error_mark_node;
}
@@ -8408,14 +8421,14 @@ expand_static_init (tree decl, tree init)
(acquire_name, build_function_type_list (integer_type_node,
TREE_TYPE (guard_addr),
NULL_TREE),
- NULL_TREE, ECF_NOTHROW | ECF_LEAF);
+ NULL_TREE, ECF_NOTHROW);
if (!release_fn || !abort_fn)
vfntype = build_function_type_list (void_type_node,
TREE_TYPE (guard_addr),
NULL_TREE);
if (!release_fn)
release_fn = push_library_fn (release_name, vfntype, NULL_TREE,
- ECF_NOTHROW | ECF_LEAF);
+ ECF_NOTHROW);
if (!abort_fn)
abort_fn = push_library_fn (abort_name, vfntype, NULL_TREE,
ECF_NOTHROW | ECF_LEAF);
@@ -9540,10 +9553,12 @@ build_ptrmemfunc_type (tree type)
TYPE_PTRMEMFUNC_FLAG (t) = 1;
field = build_decl (input_location, FIELD_DECL, pfn_identifier, type);
+ DECL_NONADDRESSABLE_P (field) = 1;
fields = field;
field = build_decl (input_location, FIELD_DECL, delta_identifier,
delta_type_node);
+ DECL_NONADDRESSABLE_P (field) = 1;
DECL_CHAIN (field) = fields;
fields = field;
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index 58b44abd109..3fac495d293 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -32468,6 +32468,14 @@ cp_parser_omp_var_list_no_open (cp_parser *parser, enum omp_clause_code kind,
decl = TREE_OPERAND (decl, 0);
cp_lexer_consume_token (parser->lexer);
}
+ else if (cp_parser_is_keyword (token, RID_FUNCTION_NAME)
+ || cp_parser_is_keyword (token, RID_PRETTY_FUNCTION_NAME)
+ || cp_parser_is_keyword (token, RID_C99_FUNCTION_NAME))
+ {
+ cp_id_kind idk;
+ decl = cp_parser_primary_expression (parser, false, false, false,
+ &idk);
+ }
else
{
name = cp_parser_id_expression (parser, /*template_p=*/false,
@@ -34896,8 +34904,10 @@ cp_parser_omp_clause_dist_schedule (cp_parser *parser, tree list,
else if (!cp_parser_require (parser, CPP_CLOSE_PAREN, RT_COMMA_CLOSE_PAREN))
goto resync_fail;
- check_no_duplicate_clause (list, OMP_CLAUSE_DIST_SCHEDULE, "dist_schedule",
- location);
+ /* check_no_duplicate_clause (list, OMP_CLAUSE_DIST_SCHEDULE,
+ "dist_schedule", location); */
+ if (omp_find_clause (list, OMP_CLAUSE_DIST_SCHEDULE))
+ warning_at (location, 0, "too many %qs clauses", "dist_schedule");
OMP_CLAUSE_CHAIN (c) = list;
return c;
@@ -40751,7 +40761,10 @@ cp_parser_initial_pragma (cp_token *first_token)
cp_lexer_get_preprocessor_token (NULL, first_token);
if (cp_parser_pragma_kind (first_token) != PRAGMA_GCC_PCH_PREPROCESS)
- return;
+ {
+ c_common_no_more_pch ();
+ return;
+ }
cp_lexer_get_preprocessor_token (NULL, first_token);
if (first_token->type == CPP_STRING)
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index b3fe901097c..48d8dbb6ad2 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -6353,6 +6353,8 @@ check_valid_ptrmem_cst_expr (tree type, tree expr,
static bool
has_value_dependent_address (tree op)
{
+ STRIP_ANY_LOCATION_WRAPPER (op);
+
/* We could use get_inner_reference here, but there's no need;
this is only relevant for template non-type arguments, which
can only be expressed as &id-expression. */
@@ -25231,8 +25233,9 @@ invalid_nontype_parm_type_p (tree type, tsubst_flags_t complain)
{
if (cxx_dialect < cxx2a)
{
- error ("non-type template parameters of class type only available "
- "with %<-std=c++2a%> or %<-std=gnu++2a%>");
+ if (complain & tf_error)
+ error ("non-type template parameters of class type only available "
+ "with %<-std=c++2a%> or %<-std=gnu++2a%>");
return true;
}
if (dependent_type_p (type))
@@ -26714,7 +26717,7 @@ build_non_dependent_expr (tree expr)
if (TREE_CODE (expr) == COND_EXPR)
return build3 (COND_EXPR,
TREE_TYPE (expr),
- TREE_OPERAND (expr, 0),
+ build_non_dependent_expr (TREE_OPERAND (expr, 0)),
(TREE_OPERAND (expr, 1)
? build_non_dependent_expr (TREE_OPERAND (expr, 1))
: build_non_dependent_expr (TREE_OPERAND (expr, 0))),
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c
index 6d40b145fcb..b8a279f8b08 100644
--- a/gcc/cp/semantics.c
+++ b/gcc/cp/semantics.c
@@ -7790,6 +7790,13 @@ finish_omp_clauses (tree clauses, enum c_omp_region_type ort)
case OMP_CLAUSE_DEFAULT_UNSPECIFIED:
break;
case OMP_CLAUSE_DEFAULT_SHARED:
+ if ((OMP_CLAUSE_CODE (c) == OMP_CLAUSE_SHARED
+ || OMP_CLAUSE_CODE (c) == OMP_CLAUSE_FIRSTPRIVATE)
+ && c_omp_predefined_variable (t))
+ /* The __func__ variable and similar function-local predefined
+ variables may be listed in a shared or firstprivate
+ clause. */
+ break;
if (VAR_P (t)
&& OMP_CLAUSE_CODE (c) == OMP_CLAUSE_FIRSTPRIVATE
&& TREE_STATIC (t)
@@ -8187,7 +8194,6 @@ handle_omp_for_class_iterator (int i, location_t locus, enum tree_code code,
if (init && EXPR_HAS_LOCATION (init))
elocus = EXPR_LOCATION (init);
- cond = cp_fully_fold (cond);
switch (TREE_CODE (cond))
{
case GT_EXPR:
diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c
index 1339e9fd204..ae9bfd24cfb 100644
--- a/gcc/cp/tree.c
+++ b/gcc/cp/tree.c
@@ -5487,6 +5487,68 @@ maybe_warn_zero_as_null_pointer_constant (tree expr, location_t loc)
return false;
}
+/* Given an initializer INIT for a TYPE, return true if INIT is zero
+ so that it can be replaced by value initialization. This function
+ distinguishes betwen empty strings as initializers for arrays and
+ for pointers (which make it return false). */
+
+bool
+type_initializer_zero_p (tree type, tree init)
+{
+ if (type == error_mark_node || init == error_mark_node)
+ return false;
+
+ STRIP_NOPS (init);
+
+ if (POINTER_TYPE_P (type))
+ return TREE_CODE (init) != STRING_CST && initializer_zerop (init);
+
+ if (TREE_CODE (init) != CONSTRUCTOR)
+ return initializer_zerop (init);
+
+ if (TREE_CODE (type) == ARRAY_TYPE)
+ {
+ tree elt_type = TREE_TYPE (type);
+ elt_type = TYPE_MAIN_VARIANT (elt_type);
+ if (elt_type == char_type_node)
+ return initializer_zerop (init);
+
+ tree elt_init;
+ unsigned HOST_WIDE_INT i;
+ FOR_EACH_CONSTRUCTOR_VALUE (CONSTRUCTOR_ELTS (init), i, elt_init)
+ if (!type_initializer_zero_p (elt_type, elt_init))
+ return false;
+ return true;
+ }
+
+ if (TREE_CODE (type) != RECORD_TYPE)
+ return initializer_zerop (init);
+
+ if (TYPE_NON_AGGREGATE_CLASS (type))
+ return false;
+
+ tree fld = TYPE_FIELDS (type);
+
+ tree fld_init;
+ unsigned HOST_WIDE_INT i;
+ FOR_EACH_CONSTRUCTOR_VALUE (CONSTRUCTOR_ELTS (init), i, fld_init)
+ {
+ fld = next_initializable_field (fld);
+ if (!fld)
+ return true;
+
+ tree fldtype = TREE_TYPE (fld);
+ if (!type_initializer_zero_p (fldtype, fld_init))
+ return false;
+
+ fld = DECL_CHAIN (fld);
+ if (!fld)
+ break;
+ }
+
+ return true;
+}
+
#if defined ENABLE_TREE_CHECKING && (GCC_VERSION >= 2007)
/* Complain that some language-specific thing hanging off a tree
node has been accessed improperly. */
diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c
index bc4a7606582..2169f8c4efd 100644
--- a/gcc/cp/typeck.c
+++ b/gcc/cp/typeck.c
@@ -4309,7 +4309,7 @@ warn_for_null_address (location_t location, tree op, tsubst_flags_t complain)
|| TREE_NO_WARNING (op))
return;
- tree cop = fold_non_dependent_expr (op, complain);
+ tree cop = fold_for_warn (op);
if (TREE_CODE (cop) == ADDR_EXPR
&& decl_with_nonnull_addr_p (TREE_OPERAND (cop, 0))
@@ -4632,9 +4632,8 @@ cp_build_binary_op (const op_location_t &location,
|| code1 == COMPLEX_TYPE || code1 == VECTOR_TYPE))
{
enum tree_code tcode0 = code0, tcode1 = code1;
- tree cop1 = fold_non_dependent_expr (op1, complain);
doing_div_or_mod = true;
- warn_for_div_by_zero (location, cop1);
+ warn_for_div_by_zero (location, fold_for_warn (op1));
if (tcode0 == COMPLEX_TYPE || tcode0 == VECTOR_TYPE)
tcode0 = TREE_CODE (TREE_TYPE (TREE_TYPE (op0)));
@@ -4673,11 +4672,8 @@ cp_build_binary_op (const op_location_t &location,
case TRUNC_MOD_EXPR:
case FLOOR_MOD_EXPR:
- {
- tree cop1 = fold_non_dependent_expr (op1, complain);
- doing_div_or_mod = true;
- warn_for_div_by_zero (location, cop1);
- }
+ doing_div_or_mod = true;
+ warn_for_div_by_zero (location, fold_for_warn (op1));
if (code0 == VECTOR_TYPE && code1 == VECTOR_TYPE
&& TREE_CODE (TREE_TYPE (type0)) == INTEGER_TYPE
@@ -4770,7 +4766,7 @@ cp_build_binary_op (const op_location_t &location,
}
else if (code0 == INTEGER_TYPE && code1 == INTEGER_TYPE)
{
- tree const_op1 = fold_non_dependent_expr (op1, complain);
+ tree const_op1 = fold_for_warn (op1);
if (TREE_CODE (const_op1) != INTEGER_CST)
const_op1 = op1;
result_type = type0;
@@ -4816,10 +4812,10 @@ cp_build_binary_op (const op_location_t &location,
}
else if (code0 == INTEGER_TYPE && code1 == INTEGER_TYPE)
{
- tree const_op0 = fold_non_dependent_expr (op0, complain);
+ tree const_op0 = fold_for_warn (op0);
if (TREE_CODE (const_op0) != INTEGER_CST)
const_op0 = op0;
- tree const_op1 = fold_non_dependent_expr (op1, complain);
+ tree const_op1 = fold_for_warn (op1);
if (TREE_CODE (const_op1) != INTEGER_CST)
const_op1 = op1;
result_type = type0;
@@ -9296,8 +9292,10 @@ maybe_warn_about_returning_address_of_local (tree retval)
tree base = DECL_DECOMP_BASE (whats_returned);
if (TYPE_REF_P (TREE_TYPE (base)))
{
- tree init = DECL_INITIAL (base);
- return maybe_warn_about_returning_address_of_local (init);
+ if (tree init = DECL_INITIAL (base))
+ return maybe_warn_about_returning_address_of_local (init);
+ else
+ return false;
}
}
bool w = false;
diff --git a/gcc/doc/avr-mmcu.texi b/gcc/doc/avr-mmcu.texi
index ea0161ecccb..99cd93cb23b 100644
--- a/gcc/doc/avr-mmcu.texi
+++ b/gcc/doc/avr-mmcu.texi
@@ -21,7 +21,7 @@
@*@var{mcu}@tie{}= @code{ata5272}, @code{ata6616c}, @code{attiny13}, @code{attiny13a}, @code{attiny2313}, @code{attiny2313a}, @code{attiny24}, @code{attiny24a}, @code{attiny25}, @code{attiny261}, @code{attiny261a}, @code{attiny43u}, @code{attiny4313}, @code{attiny44}, @code{attiny44a}, @code{attiny441}, @code{attiny45}, @code{attiny461}, @code{attiny461a}, @code{attiny48}, @code{attiny828}, @code{attiny84}, @code{attiny84a}, @code{attiny841}, @code{attiny85}, @code{attiny861}, @code{attiny861a}, @code{attiny87}, @code{attiny88}, @code{at86rf401}.
@item avr3
-``Classic'' devices with 16@tie{}KiB up to 64@tie{}KiB of program memory.
+``Classic'' devices with 16@tie{}KiB up to 64@tie{}KiB of program memory.
@*@var{mcu}@tie{}= @code{at43usb355}, @code{at76c711}.
@item avr31
diff --git a/gcc/doc/install.texi b/gcc/doc/install.texi
index 911875f9578..78a59e6b21c 100644
--- a/gcc/doc/install.texi
+++ b/gcc/doc/install.texi
@@ -2129,7 +2129,7 @@ specifying paths @var{path1}, @dots{}, @var{pathN}.
@smallexample
% @var{srcdir}/configure \
- --enable-offload-target=i686-unknown-linux-gnu=/path/to/i686/compiler,x86_64-pc-linux-gnu
+ --enable-offload-targets=x86_64-intelmicemul-linux-gnu=/path/to/x86_64/compiler,nvptx-none,hsa
@end smallexample
If @samp{hsa} is specified as one of the targets, the compiler will be
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index 6ef36ce02aa..b3fdcde8b4d 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -8027,7 +8027,7 @@ consumers are not expected to support this extended format, and they
would be rendered unable to decode location lists using it.
@item -ginternal-reset-location-views
-@itemx -gnointernal-reset-location-views
+@itemx -gno-internal-reset-location-views
@opindex ginternal-reset-location-views
@opindex gno-internal-reset-location-views
Attempt to determine location views that can be omitted from location
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index 1cec00f2b85..ae47387b763 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -15461,7 +15461,7 @@ mem_loc_descriptor (rtx rtl, machine_mode mode,
if (mode != GET_MODE (rtl) && GET_MODE (rtl) != VOIDmode)
return NULL;
- scalar_int_mode int_mode, inner_mode, op1_mode;
+ scalar_int_mode int_mode = BImode, inner_mode, op1_mode;
switch (GET_CODE (rtl))
{
case POST_INC:
@@ -22284,19 +22284,18 @@ gen_formal_parameter_die (tree node, tree origin, bool emit_name_p,
/* If the contexts differ, we may not be talking about the same
thing.
??? When in LTO the DIE parent is the "abstract" copy and the
- context_die is the specification "copy". But this whole block
- should eventually be no longer needed. */
- if (parm_die && parm_die->die_parent != context_die && !in_lto_p)
+ context_die is the specification "copy". */
+ if (parm_die
+ && parm_die->die_parent != context_die
+ && (parm_die->die_parent->die_tag != DW_TAG_GNU_formal_parameter_pack
+ || parm_die->die_parent->die_parent != context_die)
+ && !in_lto_p)
{
- if (!DECL_ABSTRACT_P (node))
- {
- /* This can happen when creating an inlined instance, in
- which case we need to create a new DIE that will get
- annotated with DW_AT_abstract_origin. */
- parm_die = NULL;
- }
- else
- gcc_unreachable ();
+ gcc_assert (!DECL_ABSTRACT_P (node));
+ /* This can happen when creating a concrete instance, in
+ which case we need to create a new DIE that will get
+ annotated with DW_AT_abstract_origin. */
+ parm_die = NULL;
}
if (parm_die && parm_die->die_parent == NULL)
@@ -26647,16 +26646,12 @@ dwarf2out_late_global_decl (tree decl)
{
dw_die_ref die = lookup_decl_die (decl);
- /* We may have to generate early debug late for LTO in case debug
+ /* We may have to generate full debug late for LTO in case debug
was not enabled at compile-time or the target doesn't support
the LTO early debug scheme. */
if (! die && in_lto_p)
- {
- dwarf2out_decl (decl);
- die = lookup_decl_die (decl);
- }
-
- if (die)
+ dwarf2out_decl (decl);
+ else if (die)
{
/* We get called via the symtab code invoking late_global_decl
for symbols that are optimized out.
diff --git a/gcc/expmed.c b/gcc/expmed.c
index d7f8e9a5d76..c5f5499c013 100644
--- a/gcc/expmed.c
+++ b/gcc/expmed.c
@@ -838,6 +838,27 @@ store_bit_field_1 (rtx str_rtx, poly_uint64 bitsize, poly_uint64 bitnum,
if (MEM_P (op0))
op0 = adjust_bitfield_address_size (op0, op0_mode.else_blk (),
0, MEM_SIZE (op0));
+ else if (!op0_mode.exists ())
+ {
+ if (ibitnum == 0
+ && known_eq (ibitsize, GET_MODE_BITSIZE (GET_MODE (op0)))
+ && MEM_P (value)
+ && !reverse)
+ {
+ value = adjust_address (value, GET_MODE (op0), 0);
+ emit_move_insn (op0, value);
+ return true;
+ }
+ if (!fallback_p)
+ return false;
+ rtx temp = assign_stack_temp (GET_MODE (op0),
+ GET_MODE_SIZE (GET_MODE (op0)));
+ emit_move_insn (temp, op0);
+ store_bit_field_1 (temp, bitsize, bitnum, 0, 0, fieldmode, value,
+ reverse, fallback_p);
+ emit_move_insn (op0, temp);
+ return true;
+ }
else
op0 = gen_lowpart (op0_mode.require (), op0);
}
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index f0e43b5fda2..9feaea9fde5 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -4935,10 +4935,9 @@ range_check_type (tree etype)
/* First make sure that arithmetics in this type is valid, then make sure
that it wraps around. */
if (TREE_CODE (etype) == ENUMERAL_TYPE || TREE_CODE (etype) == BOOLEAN_TYPE)
- etype = lang_hooks.types.type_for_size (TYPE_PRECISION (etype),
- TYPE_UNSIGNED (etype));
+ etype = lang_hooks.types.type_for_size (TYPE_PRECISION (etype), 1);
- if (TREE_CODE (etype) == INTEGER_TYPE && !TYPE_OVERFLOW_WRAPS (etype))
+ if (TREE_CODE (etype) == INTEGER_TYPE && !TYPE_UNSIGNED (etype))
{
tree utype, minv, maxv;
@@ -4956,6 +4955,8 @@ range_check_type (tree etype)
else
return NULL_TREE;
}
+ else if (POINTER_TYPE_P (etype))
+ etype = unsigned_type_for (etype);
return etype;
}
@@ -5046,9 +5047,6 @@ build_range_check (location_t loc, tree type, tree exp, int in_p,
if (etype == NULL_TREE)
return NULL_TREE;
- if (POINTER_TYPE_P (etype))
- etype = unsigned_type_for (etype);
-
high = fold_convert_loc (loc, etype, high);
low = fold_convert_loc (loc, etype, low);
exp = fold_convert_loc (loc, etype, exp);
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index 01ea2cddfe5..42430e46ef6 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,4 +1,312 @@
-2019-08-18 Steven G. Kargl <kargl@gcc.gnu.org>
+2019-11-10 Thomas Koenig <tkoenig@gcc.gnu.org>
+
+ Backport from trunk
+ PR fortran/92113
+ * trans-decl.c (gfc_get_symbol_decl): If __def_init actually
+ contains a value, put it into the read-only section.
+
+2019-11-10 Thomas Koenig <tkoenig@gcc.gnu.org>
+
+ Backport from trunk
+ PR fortran/92321
+ * frontend-passes.c (call_external_blas): Commit symbol for
+ external BLAS routine.
+
+2019-11-08 Tobias Burnus <tobias@codesourcery.com
+
+ Backport from mainline
+ 2019-11-08 Tobias Burnus <tobias@codesourcery.com
+
+ PR fortran/91253
+ * scanner.c (skip_fixed_comments): Move comment
+ lines to next if block.
+ (gfc_next_char_literal): Fix continue_line setting.
+ (get_file): Remove bogus ATTRIBUTE_UNUSED.
+
+2019-11-05 Tobias Burnus <tobias@codesourcery.com>
+
+ PR fortran/92208
+ Backport from mainline
+ 2019-10-31 Tobias Burnus <tobias@codesourcery.com>
+
+ PR fortran/92277
+ * trans-expr.c (gfc_conv_gfc_desc_to_cfi_desc): Fix DECL_ARTIFICIAL
+ checking.
+
+2019-11-04 Tobias Burnus <tobias@codesourcery.com>
+
+ Backport from mainline
+ 2019-10-30 Tobias Burnus <tobias@codesourcery.com>
+
+ PR fortran/92208
+ * trans-array.c (gfc_conv_array_parameter): Only copy
+ string-length backend_decl if expression is not a function.
+
+2019-11-04 Tobias Burnus <tobias@codesourcery.com>
+
+ Backport from mainline
+ 2019-10-31 Tobias Burnus <tobias@codesourcery.com>
+
+ PR fortran/92284.
+ * trans-expr.c (gfc_conv_gfc_desc_to_cfi_desc): Free CFI descriptor
+ at the end; partial revised revert of Rev. 277502.
+
+2019-10-28  Paul Thomas  <pault@gcc.gnu.org>
+
+ Backport from trunk
+ PR fortran/91926
+ * trans-expr.c (gfc_conv_gfc_desc_to_cfi_desc): Correct the
+ assignment of the attribute field to account correctly for an
+ assumed shape dummy. Assign separately to the gfc and cfi
+ descriptors since the atribute can be different. Add branch to
+ correctly handle missing optional dummies.
+
+2019-10-28 Tobias Burnus <tobias@codesourcery.com>
+
+ Backport from mainline
+ 2019-10-28 Tobias Burnus <tobias@codesourcery.com>
+
+ PR fortran/91863
+ * trans-expr.c (gfc_conv_gfc_desc_to_cfi_desc): Don't free data
+ memory as that's done on the Fortran side.
+ (gfc_conv_procedure_call): Handle void* pointers from
+ gfc_conv_gfc_desc_to_cfi_desc.
+
+2019-10-27 Paul Thomas <pault@gcc.gnu.org>
+
+ Backport from mainline
+ PR fortran/86248
+ * resolve.c (flag_fn_result_spec): Correct a typo before the
+ function declaration.
+ * trans-decl.c (gfc_sym_identifier): Boost the length of 'name'
+ to allow for all variants. Simplify the code by using a pointer
+ to the symbol's proc_name and taking the return out of each of
+ the conditional branches. Allow symbols with fn_result_spec set
+ that do not come from a procedure namespace and have a module
+ name to go through the non-fn_result_spec branch.
+
+2019-10-22 Steven G. Kargl <kargl@gcc.gnu.org>
+
+ PR fortran/92174
+ * decl.c (attr_decl1): Move check for F2018:C822 from here ...
+ * array.c (gfc_set_array_spec): ... to here.
+
+2019-10-18 Steven G. Kargl <kargl@gcc.gnu.org>
+
+ PR fortran/69455
+ * trans-decl.c (generate_local_decl): Avoid misconstructed
+ intrinsic modules in a BLOCK construct.
+
+2019-10-18 Tobias Burnus <tobias@codesourcery.com>
+
+ Backport from mainline
+ 2019-10-18 Tobias Burnus <tobias@codesourcery.com>
+
+ PR fortran/91586
+ * class.c (gfc_find_derived_vtab): Return NULL
+ instead of deref'ing NULL pointer.
+
+2019-10-17 Steven G. Kargl <kargl@gcc.gnu.org>
+
+ PR fortran/83113
+ PR fortran/89943
+ decl.c (gfc_match_function_decl): Ignore duplicate BIND(C) for function
+ declaration in submodule. Implement at check for F2018 C1550.
+ (gfc_match_entry): Use temporary for locus, which allows removal of
+ one gfc_error_now().
+ (gfc_match_subroutine): Ignore duplicate BIND(C) for subroutine
+ declaration in submodule. Implement at check for F2018 C1550.
+
+2019-10-11 Steven G. Kargl <kargl@gcc.gnu.org>
+
+ PR fortran/91715
+ * decl.c (gfc_match_prefix): If matching a type-spec returns an error,
+ it's an error so re-act correctly.
+
+2019-10-11 Steven G. Kargl <kargl@gcc.gnu.org>
+
+ PR fortran/91649
+ check.c (gfc_check_findloc): Additional checking for valid arguments
+
+2019-10-10 Steven G. Kargl <kargl@gcc.gnu.org>
+
+ PR fortran/91801
+ * simplify.c (gfc_simplify_reshape): Convert a gcc_assert into a
+ gfc_error as a user can easily hit the condition.
+
+2019-10-07 Thomas Koenig <tkoenig@gcc.gnu.org>
+
+ Backport from trunk
+ PR fortran/84487
+ * trans-decl.c (gfc_get_symbol_decl): For __def_init, set
+ DECL_ARTIFICAL and do not set TREE_READONLY.
+
+2019-10-05 Steven G. Kargl <kargl@gcc.gnu.org>
+
+ PR fortran/47054
+ * decl.c (variable_decl): Do not search parent namespace for symbol.
+
+2019-10-04 Steven G. Kargl <kargl@gcc.gnu.org>
+
+ PR fortran/91942
+ * io.c (match_vtag): Check for non-NULL result->symtree.
+ (match_out_tag): Check for invalid constant due to inquiry parameter.
+ (match_filepos): Instead of a syntax error, go to cleanup to get better
+ error messages.
+
+2019-10-04 Steven G. Kargl <kargl@gcc.gnu.org>
+
+ PR fortran/91785
+ * primary.c (gfc_match_varspec): Ensure an inquiry parameter has
+ it locus set.
+
+2019-10-01 Steven G. Kargl <kargl@gcc.gnu.org>
+
+ PR fortran/91864
+ * gcc/fortran/io.c (match_io_element): An inquiry parameter cannot be
+ read into.
+ * gcc/fortran/match.c (gfc_match_allocate): An inquiry parameter
+ can be neither an allocate-object nor stat variable.
+ (gfc_match_deallocate): An inquiry parameter cannot be deallocated.
+
+2019-10-01 Steven G. Kargl <kargl@gcc.ngu.org>
+
+ Backport of r276254+276265
+ PR fortran/91802
+ * decl.c (attr_decl1): Check if rank+corank > 15.
+
+2019-10-01 Steven G. Kargl <kargl@gcc.gnu.org>
+
+ PR fortran/91714
+ * decl.c (gfc_match_decl_type_spec): Issue errors for a few
+ mangled types.
+
+2019-10-01 Steven G. Kargl <kargl@gcc.gnu.org>
+
+ PR fortran/91641
+ * check.c (gfc_check_is_contiguous): null() cannot be an actual
+ argument to is_contiguous().
+
+2019-09-21 Paul Thomas <pault@gcc.gnu.org>
+
+ Backport from mainline
+ PR fortran/91588
+ * expr.c (check_inquiry): Remove extended component refs by
+ using symbol pointers. If a function argument is an associate
+ variable with a constant target, copy the target expression in
+ place of the argument expression. Check that the charlen is not
+ NULL before using the string length.
+
+2019-09-19 Steven G. Kargl <kargl@gcc.gnu.org>
+
+ PR fortran/91727
+ * resolve.c (conformable_arrays): If array-spec is NULL, then
+ allocate-object is a scalar. a conformability check only occurs
+ for an array source-expr.
+
+2019-09-18 Thomas Koenig <tkoenig@gcc.gnu.org>
+
+ Backport from trunk
+ PR fortran/91550
+ * frontend-passes.c (do_subscript): If step equals
+ zero, a previuos error has been reported; do nothing
+ in this case.
+ * resolve.c (gfc_resolve_iterator): Move error checking
+ after type conversion.
+
+2019-09-15 Thomas Koenig <tkoenig@gcc.gnu.org>
+
+ Backport from trunk
+ PR fortran/91557
+ * trans-decl.c (generate_local_decl): Do not warn if the symbol
+ is artificial.
+ * trans-types.c (get_formal_from_actual_arglist): Set artificial
+ attribute on dummy arguments.
+
+2019-09-14 Steven G. Kargl <kargl@gcc.gnu.org>
+
+ PR fortran/91553
+ * simplify.c (gfc_convert_constant): During conversion check if the
+ constant is enclosed in parenthesis, and simplify expression.
+
+2019-09-14 Steven G. Kargl <kargl@gcc.gnu.org>
+
+ PR fortran/91566
+ * simplify.c (gfc_simplify_merge): Need to simplify expression
+ after insertation of parenthesis.
+
+2019-09-14 Steven G. Kargl <kargl@gcc.gnu.org>
+
+ PR fortran/91642
+ * io.c (gfc_match_inquire): null() cannot be in an iolength inquire
+ list.
+
+2019-09-07 Paul Thomas <pault@gcc.gnu.org>
+
+ Backport from mainline
+ PR fortran/91589
+ * primary.c (gfc_match_varspec): Return MATCH_NO on an apparent
+ component ref, when the primary type is intrinsic.
+
+2019-09-05 Harald Anlauf <anlauf@gmx.de>
+
+ Backport from mainline
+ PR fortran/91496
+ * gfortran.h: Extend struct gfc_iterator for loop annotations.
+ * array.c (gfc_copy_iterator): Copy loop annotations by IVDEP,
+ VECTOR, and NOVECTOR pragmas.
+ * decl.c (gfc_match_gcc_ivdep, gfc_match_gcc_vector)
+ (gfc_match_gcc_novector): New matcher functions handling IVDEP,
+ VECTOR, and NOVECTOR pragmas.
+ * match.h: Declare prototypes of matcher functions handling IVDEP,
+ VECTOR, and NOVECTOR pragmas.
+ * parse.c (decode_gcc_attribute, parse_do_block)
+ (parse_executable): Decode IVDEP, VECTOR, and NOVECTOR pragmas;
+ emit warning for unrecognized pragmas instead of error.
+ * trans-stmt.c (gfc_trans_simple_do, gfc_trans_do): Add code to
+ emit annotations for IVDEP, VECTOR, and NOVECTOR pragmas.
+ * gfortran.texi: Document IVDEP, VECTOR, and NOVECTOR pragmas.
+
+ PR fortran/91496
+ * parse.c (parse_executable): Improve error messages for
+ improperly placed pragmas not preceeding a loop.
+
+2019-09-05 Steven G. Kargl <kargl@gcc.gnu.org>
+
+ PR fortran/91660
+ * decl.c (gfc_match_decl_type_spec): Improve and restore error
+ message for malformed types-spec.
+
+2019-09-02 Steven G. Kargl <kargl@gc.gnu.org>
+
+ PR fortran/91552
+ * array.c (walk_array_constructor): New function.
+ (gfc_match_array_constructor): Use it.
+
+2019-08-30 Steven G. Kargl <kargl@gcc.gnu.org>
+
+ PR fortran/91587
+ * io.c (match_filepos): MATCH_ERROR should branch to a syntax error.
+
+2019-08-30 Steven G. Kargl <kargl@gcc.gnu.org>
+
+ PR fortran/91565
+ * simplify.c (gfc_simplify_reshape): Add additional checks of the
+ ORDER dummy argument.
+
+2019-08-30 Steven G. Kargl <kargl@gcc.gnu.org>
+
+ PR fortran/91564
+ * check.c (gfc_check_kill_sub): Additional checks on status dummy
+ argument.
+
+2019-08-30 Steven G. Kargl <kargl@gcc.gnu.org>
+
+ PR fortran/91551
+ * intrinsic.c (sort_actual): ALLOCATED has one argument. Check for
+ no argument case.
+
+2019-08-30 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/91485
module.c (gfc_match_use): User defined operator cannot conflict with
@@ -43,7 +351,7 @@
PR fortran/90563
* frontend-passes.c (insert_index): Suppress errors while
simplifying the resulting expression.
-
+
2019-08-13 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/88072
diff --git a/gcc/fortran/array.c b/gcc/fortran/array.c
index 0aee220e68d..6d20cbb9d36 100644
--- a/gcc/fortran/array.c
+++ b/gcc/fortran/array.c
@@ -843,6 +843,10 @@ gfc_set_array_spec (gfc_symbol *sym, gfc_array_spec *as, locus *error_loc)
sym->as->cotype = as->cotype;
sym->as->corank = as->corank;
+ /* Check F2018:C822. */
+ if (sym->as->rank + sym->as->corank > GFC_MAX_DIMENSIONS)
+ goto too_many;
+
for (i = 0; i < as->corank; i++)
{
sym->as->lower[sym->as->rank + i] = as->lower[i];
@@ -861,6 +865,10 @@ gfc_set_array_spec (gfc_symbol *sym, gfc_array_spec *as, locus *error_loc)
sym->as->cray_pointee = as->cray_pointee;
sym->as->cp_was_assumed = as->cp_was_assumed;
+ /* Check F2018:C822. */
+ if (sym->as->rank + sym->as->corank > GFC_MAX_DIMENSIONS)
+ goto too_many;
+
for (i = 0; i < sym->as->corank; i++)
{
sym->as->lower[as->rank + i] = sym->as->lower[i];
@@ -875,6 +883,12 @@ gfc_set_array_spec (gfc_symbol *sym, gfc_array_spec *as, locus *error_loc)
free (as);
return true;
+
+too_many:
+
+ gfc_error ("rank + corank of %qs exceeds %d at %C", sym->name,
+ GFC_MAX_DIMENSIONS);
+ return false;
}
@@ -1124,6 +1138,31 @@ match_array_cons_element (gfc_constructor_base *result)
}
+/* Convert components of an array constructor to the type in ts. */
+
+static match
+walk_array_constructor (gfc_typespec *ts, gfc_constructor_base head)
+{
+ gfc_constructor *c;
+ gfc_expr *e;
+ match m;
+
+ for (c = gfc_constructor_first (head); c; c = gfc_constructor_next (c))
+ {
+ e = c->expr;
+ if (e->expr_type == EXPR_ARRAY && e->ts.type == BT_UNKNOWN
+ && !e->ref && e->value.constructor)
+ {
+ m = walk_array_constructor (ts, e->value.constructor);
+ if (m == MATCH_ERROR)
+ return m;
+ }
+ else if (!gfc_convert_type (e, ts, 1) && e->ts.type != BT_UNKNOWN)
+ return MATCH_ERROR;
+ }
+ return MATCH_YES;
+}
+
/* Match an array constructor. */
match
@@ -1253,14 +1292,13 @@ done:
}
}
- /* Walk the constructor and ensure type conversion for numeric types. */
+ /* Walk the constructor, and if possible, do type conversion for
+ numeric types. */
if (gfc_numeric_ts (&ts))
{
- c = gfc_constructor_first (head);
- for (; c; c = gfc_constructor_next (c))
- if (!gfc_convert_type (c->expr, &ts, 1)
- && c->expr->ts.type != BT_UNKNOWN)
- return MATCH_ERROR;
+ m = walk_array_constructor (&ts, head);
+ if (m == MATCH_ERROR)
+ return m;
}
}
else
@@ -2175,6 +2213,9 @@ gfc_copy_iterator (gfc_iterator *src)
dest->end = gfc_copy_expr (src->end);
dest->step = gfc_copy_expr (src->step);
dest->unroll = src->unroll;
+ dest->ivdep = src->ivdep;
+ dest->vector = src->vector;
+ dest->novector = src->novector;
return dest;
}
diff --git a/gcc/fortran/check.c b/gcc/fortran/check.c
index b0e002034ad..4ef354f0a6e 100644
--- a/gcc/fortran/check.c
+++ b/gcc/fortran/check.c
@@ -2785,6 +2785,22 @@ gfc_check_kill_sub (gfc_expr *pid, gfc_expr *sig, gfc_expr *status)
if (!scalar_check (status, 2))
return false;
+
+ if (status->expr_type != EXPR_VARIABLE)
+ {
+ gfc_error ("STATUS at %L shall be an INTENT(OUT) variable",
+ &status->where);
+ return false;
+ }
+
+ if (status->expr_type == EXPR_VARIABLE
+ && status->symtree && status->symtree->n.sym
+ && status->symtree->n.sym->attr.intent == INTENT_IN)
+ {
+ gfc_error ("%qs at %L shall be an INTENT(OUT) variable",
+ status->symtree->name, &status->where);
+ return false;
+ }
}
return true;
@@ -3347,26 +3363,27 @@ bool
gfc_check_findloc (gfc_actual_arglist *ap)
{
gfc_expr *a, *v, *m, *d, *k, *b;
+ bool a1, v1;
a = ap->expr;
if (!intrinsic_type_check (a, 0) || !array_check (a, 0))
return false;
v = ap->next->expr;
- if (!scalar_check (v,1))
+ if (!intrinsic_type_check (v, 1) || !scalar_check (v,1))
return false;
- /* Check if the type is compatible. */
+ /* Check if the type are both logical. */
+ a1 = a->ts.type == BT_LOGICAL;
+ v1 = v->ts.type == BT_LOGICAL;
+ if ((a1 && !v1) || (!a1 && v1))
+ goto incompat;
- if ((a->ts.type == BT_LOGICAL && v->ts.type != BT_LOGICAL)
- || (a->ts.type != BT_LOGICAL && v->ts.type == BT_LOGICAL))
- {
- gfc_error ("Argument %qs of %qs intrinsic at %L must be in type "
- "conformance to argument %qs at %L",
- gfc_current_intrinsic_arg[0]->name,
- gfc_current_intrinsic, &a->where,
- gfc_current_intrinsic_arg[1]->name, &v->where);
- }
+ /* Check if the type are both character. */
+ a1 = a->ts.type == BT_CHARACTER;
+ v1 = v->ts.type == BT_CHARACTER;
+ if ((a1 && !v1) || (!a1 && v1))
+ goto incompat;
d = ap->next->next->expr;
m = ap->next->next->next->expr;
@@ -3414,6 +3431,14 @@ gfc_check_findloc (gfc_actual_arglist *ap)
return false;
return true;
+
+incompat:
+ gfc_error ("Argument %qs of %qs intrinsic at %L must be in type "
+ "conformance to argument %qs at %L",
+ gfc_current_intrinsic_arg[0]->name,
+ gfc_current_intrinsic, &a->where,
+ gfc_current_intrinsic_arg[1]->name, &v->where);
+ return false;
}
@@ -6553,6 +6578,14 @@ gfc_check_ttynam_sub (gfc_expr *unit, gfc_expr *name)
bool
gfc_check_is_contiguous (gfc_expr *array)
{
+ if (array->expr_type == EXPR_NULL
+ && array->symtree->n.sym->attr.pointer == 1)
+ {
+ gfc_error ("Actual argument at %L of %qs intrinsic shall be an "
+ "associated pointer", &array->where, gfc_current_intrinsic);
+ return false;
+ }
+
if (!array_check (array, 0))
return false;
@@ -6560,7 +6593,6 @@ gfc_check_is_contiguous (gfc_expr *array)
}
-
bool
gfc_check_isatty (gfc_expr *unit)
{
diff --git a/gcc/fortran/class.c b/gcc/fortran/class.c
index 8a1f43f116c..9117121e5fe 100644
--- a/gcc/fortran/class.c
+++ b/gcc/fortran/class.c
@@ -2241,6 +2241,9 @@ gfc_find_derived_vtab (gfc_symbol *derived)
if (!derived->attr.unlimited_polymorphic && derived->attr.is_class)
derived = gfc_get_derived_super_type (derived);
+ if (!derived)
+ return NULL;
+
/* Find the gsymbol for the module of use associated derived types. */
if ((derived->attr.use_assoc || derived->attr.used_in_submodule)
&& !derived->attr.vtype && !derived->attr.is_class)
diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c
index 3513d177e5e..52a98cd44ed 100644
--- a/gcc/fortran/decl.c
+++ b/gcc/fortran/decl.c
@@ -99,6 +99,11 @@ bool gfc_matching_function;
/* Set upon parsing a !GCC$ unroll n directive for use in the next loop. */
int directive_unroll = -1;
+/* Set upon parsing supported !GCC$ pragmas for use in the next loop. */
+bool directive_ivdep = false;
+bool directive_vector = false;
+bool directive_novector = false;
+
/* Map of middle-end built-ins that should be vectorized. */
hash_map<nofree_string_hash, int> *gfc_vectorized_builtins;
@@ -2644,7 +2649,7 @@ variable_decl (int elem)
then we want to set the type & bail out. */
if (flag_cray_pointer && !gfc_comp_struct (gfc_current_state ()))
{
- gfc_find_symbol (name, gfc_current_ns, 1, &sym);
+ gfc_find_symbol (name, gfc_current_ns, 0, &sym);
if (sym != NULL && sym->attr.cray_pointee)
{
m = MATCH_YES;
@@ -3991,7 +3996,6 @@ gfc_match_decl_type_spec (gfc_typespec *ts, int implicit_flag)
return MATCH_YES;
}
-
m = gfc_match (" type (");
matched_type = (m == MATCH_YES);
if (matched_type)
@@ -4039,7 +4043,10 @@ gfc_match_decl_type_spec (gfc_typespec *ts, int implicit_flag)
m = MATCH_YES;
if (matched_type && m == MATCH_YES && gfc_match_char (')') != MATCH_YES)
- m = MATCH_ERROR;
+ {
+ gfc_error ("Malformed type-spec at %C");
+ return MATCH_ERROR;
+ }
return m;
}
@@ -4062,8 +4069,12 @@ gfc_match_decl_type_spec (gfc_typespec *ts, int implicit_flag)
&& !gfc_notify_std (GFC_STD_F2008, "TYPE with "
"intrinsic-type-spec at %C"))
return MATCH_ERROR;
+
if (matched_type && gfc_match_char (')') != MATCH_YES)
- return MATCH_ERROR;
+ {
+ gfc_error ("Malformed type-spec at %C");
+ return MATCH_ERROR;
+ }
ts->type = BT_REAL;
ts->kind = gfc_default_double_kind;
@@ -4093,7 +4104,10 @@ gfc_match_decl_type_spec (gfc_typespec *ts, int implicit_flag)
return MATCH_ERROR;
if (matched_type && gfc_match_char (')') != MATCH_YES)
- return MATCH_ERROR;
+ {
+ gfc_error ("Malformed type-spec at %C");
+ return MATCH_ERROR;
+ }
ts->type = BT_COMPLEX;
ts->kind = gfc_default_double_kind;
@@ -4114,7 +4128,13 @@ gfc_match_decl_type_spec (gfc_typespec *ts, int implicit_flag)
if (m == MATCH_ERROR)
return m;
- m = gfc_match_char (')');
+ gfc_gobble_whitespace ();
+ if (gfc_peek_ascii_char () != ')')
+ {
+ gfc_error ("Malformed type-spec at %C");
+ return MATCH_ERROR;
+ }
+ m = gfc_match_char (')'); /* Burn closing ')'. */
}
if (m != MATCH_YES)
@@ -4397,6 +4417,7 @@ get_kind:
gfc_next_ascii_char ();
return MATCH_YES;
}
+ gfc_error ("Malformed type-spec at %C");
return MATCH_NO;
}
}
@@ -4410,7 +4431,10 @@ get_kind:
}
if (matched_type && gfc_match_char (')') != MATCH_YES)
- return MATCH_ERROR;
+ {
+ gfc_error ("Malformed type-spec at %C");
+ return MATCH_ERROR;
+ }
/* Defer association of the KIND expression of function results
until after USE and IMPORT statements. */
@@ -6145,13 +6169,17 @@ gfc_match_prefix (gfc_typespec *ts)
found_prefix = true;
}
- if (!seen_type && ts != NULL
- && gfc_match_decl_type_spec (ts, 0) == MATCH_YES
- && gfc_match_space () == MATCH_YES)
+ if (!seen_type && ts != NULL)
{
-
- seen_type = true;
- found_prefix = true;
+ match m;
+ m = gfc_match_decl_type_spec (ts, 0);
+ if (m == MATCH_ERROR)
+ goto error;
+ if (m == MATCH_YES && gfc_match_space () == MATCH_YES)
+ {
+ seen_type = true;
+ found_prefix = true;
+ }
}
if (gfc_match ("elemental% ") == MATCH_YES)
@@ -7202,13 +7230,16 @@ gfc_match_function_decl (void)
if (sym->attr.is_bind_c == 1)
{
sym->attr.is_bind_c = 0;
- if (sym->old_symbol != NULL)
- gfc_error_now ("BIND(C) attribute at %L can only be used for "
- "variables or common blocks",
- &(sym->old_symbol->declared_at));
- else
- gfc_error_now ("BIND(C) attribute at %L can only be used for "
- "variables or common blocks", &gfc_current_locus);
+
+ if (gfc_state_stack->previous
+ && gfc_state_stack->previous->state != COMP_SUBMODULE)
+ {
+ locus loc;
+ loc = sym->old_symbol != NULL
+ ? sym->old_symbol->declared_at : gfc_current_locus;
+ gfc_error_now ("BIND(C) attribute at %L can only be used for "
+ "variables or common blocks", &loc);
+ }
}
if (found_match != MATCH_YES)
@@ -7222,6 +7253,24 @@ gfc_match_function_decl (void)
found_match = suffix_match;
}
+ /* F2018 C1550 (R1526) If MODULE appears in the prefix of a module
+ subprogram and a binding label is specified, it shall be the
+ same as the binding label specified in the corresponding module
+ procedure interface body. */
+ if (sym->attr.is_bind_c && sym->attr.module_procedure && sym->old_symbol
+ && strcmp (sym->name, sym->old_symbol->name) == 0
+ && strcmp (sym->binding_label, sym->old_symbol->binding_label) != 0)
+ {
+ const char *null = "NULL", *s1, *s2;
+ s1 = sym->binding_label;
+ if (!s1) s1 = null;
+ s2 = sym->old_symbol->binding_label;
+ if (!s2) s2 = null;
+ gfc_error ("Mismatch in BIND(C) names (%qs/%qs) at %C", s1, s2);
+ sym->refs++; /* Needed to avoid an ICE in gfc_release_symbol */
+ return MATCH_ERROR;
+ }
+
if(found_match != MATCH_YES)
m = MATCH_ERROR;
else
@@ -7460,15 +7509,15 @@ gfc_match_entry (void)
not allowed for procedures. */
if (entry->attr.is_bind_c == 1)
{
+ locus loc;
+
entry->attr.is_bind_c = 0;
- if (entry->old_symbol != NULL)
- gfc_error_now ("BIND(C) attribute at %L can only be used for "
- "variables or common blocks",
- &(entry->old_symbol->declared_at));
- else
- gfc_error_now ("BIND(C) attribute at %L can only be used for "
- "variables or common blocks", &gfc_current_locus);
- }
+
+ loc = entry->old_symbol != NULL
+ ? entry->old_symbol->declared_at : gfc_current_locus;
+ gfc_error_now ("BIND(C) attribute at %L can only be used for "
+ "variables or common blocks", &loc);
+ }
/* Check what next non-whitespace character is so we can tell if there
is the required parens if we have a BIND(C). */
@@ -7668,13 +7717,16 @@ gfc_match_subroutine (void)
if (sym->attr.is_bind_c == 1)
{
sym->attr.is_bind_c = 0;
- if (sym->old_symbol != NULL)
- gfc_error_now ("BIND(C) attribute at %L can only be used for "
- "variables or common blocks",
- &(sym->old_symbol->declared_at));
- else
- gfc_error_now ("BIND(C) attribute at %L can only be used for "
- "variables or common blocks", &gfc_current_locus);
+
+ if (gfc_state_stack->previous
+ && gfc_state_stack->previous->state != COMP_SUBMODULE)
+ {
+ locus loc;
+ loc = sym->old_symbol != NULL
+ ? sym->old_symbol->declared_at : gfc_current_locus;
+ gfc_error_now ("BIND(C) attribute at %L can only be used for "
+ "variables or common blocks", &loc);
+ }
}
/* C binding names are not allowed for internal procedures. */
@@ -7716,6 +7768,24 @@ gfc_match_subroutine (void)
return MATCH_ERROR;
}
+ /* F2018 C1550 (R1526) If MODULE appears in the prefix of a module
+ subprogram and a binding label is specified, it shall be the
+ same as the binding label specified in the corresponding module
+ procedure interface body. */
+ if (sym->attr.module_procedure && sym->old_symbol
+ && strcmp (sym->name, sym->old_symbol->name) == 0
+ && strcmp (sym->binding_label, sym->old_symbol->binding_label) != 0)
+ {
+ const char *null = "NULL", *s1, *s2;
+ s1 = sym->binding_label;
+ if (!s1) s1 = null;
+ s2 = sym->old_symbol->binding_label;
+ if (!s2) s2 = null;
+ gfc_error ("Mismatch in BIND(C) names (%qs/%qs) at %C", s1, s2);
+ sym->refs++; /* Needed to avoid an ICE in gfc_release_symbol */
+ return MATCH_ERROR;
+ }
+
/* Scan the dummy arguments for an alternate return. */
for (arg = sym->formal; arg; arg = arg->next)
if (!arg->sym)
@@ -10161,6 +10231,20 @@ gfc_match_derived_decl (void)
return MATCH_ERROR;
}
+ /* In free source form, need to check for TYPE XXX as oppose to TYPEXXX.
+ But, we need to simply return for TYPE(. */
+ if (m == MATCH_NO && gfc_current_form == FORM_FREE)
+ {
+ char c = gfc_peek_ascii_char ();
+ if (c == '(')
+ return m;
+ if (!gfc_is_whitespace (c))
+ {
+ gfc_error ("Mangled derived type definition at %C");
+ return MATCH_NO;
+ }
+ }
+
m = gfc_match (" %n ", name);
if (m != MATCH_YES)
return m;
@@ -10168,7 +10252,7 @@ gfc_match_derived_decl (void)
/* Make sure that we don't identify TYPE IS (...) as a parameterized
derived type named 'is'.
TODO Expand the check, when 'name' = "is" by matching " (tname) "
- and checking if this is a(n intrinsic) typename. his picks up
+ and checking if this is a(n intrinsic) typename. This picks up
misplaced TYPE IS statements such as in select_type_1.f03. */
if (gfc_peek_ascii_char () == '(')
{
@@ -11472,3 +11556,53 @@ gfc_match_gcc_builtin (void)
return MATCH_YES;
}
+
+/* Match an !GCC$ IVDEP statement.
+ When we come here, we have already matched the !GCC$ IVDEP string. */
+
+match
+gfc_match_gcc_ivdep (void)
+{
+ if (gfc_match_eos () == MATCH_YES)
+ {
+ directive_ivdep = true;
+ return MATCH_YES;
+ }
+
+ gfc_error ("Syntax error in !GCC$ IVDEP directive at %C");
+ return MATCH_ERROR;
+}
+
+/* Match an !GCC$ VECTOR statement.
+ When we come here, we have already matched the !GCC$ VECTOR string. */
+
+match
+gfc_match_gcc_vector (void)
+{
+ if (gfc_match_eos () == MATCH_YES)
+ {
+ directive_vector = true;
+ directive_novector = false;
+ return MATCH_YES;
+ }
+
+ gfc_error ("Syntax error in !GCC$ VECTOR directive at %C");
+ return MATCH_ERROR;
+}
+
+/* Match an !GCC$ NOVECTOR statement.
+ When we come here, we have already matched the !GCC$ NOVECTOR string. */
+
+match
+gfc_match_gcc_novector (void)
+{
+ if (gfc_match_eos () == MATCH_YES)
+ {
+ directive_novector = true;
+ directive_vector = false;
+ return MATCH_YES;
+ }
+
+ gfc_error ("Syntax error in !GCC$ NOVECTOR directive at %C");
+ return MATCH_ERROR;
+}
diff --git a/gcc/fortran/expr.c b/gcc/fortran/expr.c
index 33a332efdff..cad0dd36a67 100644
--- a/gcc/fortran/expr.c
+++ b/gcc/fortran/expr.c
@@ -2603,6 +2603,8 @@ check_inquiry (gfc_expr *e, int not_restricted)
int i = 0;
gfc_actual_arglist *ap;
+ gfc_symbol *sym;
+ gfc_symbol *asym;
if (!e->value.function.isym
|| !e->value.function.isym->inquiry)
@@ -2612,20 +2614,22 @@ check_inquiry (gfc_expr *e, int not_restricted)
if (e->symtree == NULL)
return MATCH_NO;
- if (e->symtree->n.sym->from_intmod)
+ sym = e->symtree->n.sym;
+
+ if (sym->from_intmod)
{
- if (e->symtree->n.sym->from_intmod == INTMOD_ISO_FORTRAN_ENV
- && e->symtree->n.sym->intmod_sym_id != ISOFORTRAN_COMPILER_OPTIONS
- && e->symtree->n.sym->intmod_sym_id != ISOFORTRAN_COMPILER_VERSION)
+ if (sym->from_intmod == INTMOD_ISO_FORTRAN_ENV
+ && sym->intmod_sym_id != ISOFORTRAN_COMPILER_OPTIONS
+ && sym->intmod_sym_id != ISOFORTRAN_COMPILER_VERSION)
return MATCH_NO;
- if (e->symtree->n.sym->from_intmod == INTMOD_ISO_C_BINDING
- && e->symtree->n.sym->intmod_sym_id != ISOCBINDING_C_SIZEOF)
+ if (sym->from_intmod == INTMOD_ISO_C_BINDING
+ && sym->intmod_sym_id != ISOCBINDING_C_SIZEOF)
return MATCH_NO;
}
else
{
- name = e->symtree->n.sym->name;
+ name = sym->name;
functions = inquiry_func_gnu;
if (gfc_option.warn_std & GFC_STD_F2003)
@@ -2650,41 +2654,48 @@ check_inquiry (gfc_expr *e, int not_restricted)
if (!ap->expr)
continue;
+ asym = ap->expr->symtree ? ap->expr->symtree->n.sym : NULL;
+
if (ap->expr->ts.type == BT_UNKNOWN)
{
- if (ap->expr->symtree->n.sym->ts.type == BT_UNKNOWN
- && !gfc_set_default_type (ap->expr->symtree->n.sym, 0, gfc_current_ns))
+ if (asym && asym->ts.type == BT_UNKNOWN
+ && !gfc_set_default_type (asym, 0, gfc_current_ns))
return MATCH_NO;
- ap->expr->ts = ap->expr->symtree->n.sym->ts;
+ ap->expr->ts = asym->ts;
}
- /* Assumed character length will not reduce to a constant expression
- with LEN, as required by the standard. */
- if (i == 5 && not_restricted && ap->expr->symtree
- && ap->expr->symtree->n.sym->ts.type == BT_CHARACTER
- && (ap->expr->symtree->n.sym->ts.u.cl->length == NULL
- || ap->expr->symtree->n.sym->ts.deferred))
- {
- gfc_error ("Assumed or deferred character length variable %qs "
- "in constant expression at %L",
- ap->expr->symtree->n.sym->name,
- &ap->expr->where);
- return MATCH_ERROR;
- }
- else if (not_restricted && !gfc_check_init_expr (ap->expr))
- return MATCH_ERROR;
+ if (asym && asym->assoc && asym->assoc->target
+ && asym->assoc->target->expr_type == EXPR_CONSTANT)
+ {
+ gfc_free_expr (ap->expr);
+ ap->expr = gfc_copy_expr (asym->assoc->target);
+ }
- if (not_restricted == 0
- && ap->expr->expr_type != EXPR_VARIABLE
- && !check_restricted (ap->expr))
+ /* Assumed character length will not reduce to a constant expression
+ with LEN, as required by the standard. */
+ if (i == 5 && not_restricted && asym
+ && asym->ts.type == BT_CHARACTER
+ && ((asym->ts.u.cl && asym->ts.u.cl->length == NULL)
+ || asym->ts.deferred))
+ {
+ gfc_error ("Assumed or deferred character length variable %qs "
+ "in constant expression at %L",
+ asym->name, &ap->expr->where);
return MATCH_ERROR;
+ }
+ else if (not_restricted && !gfc_check_init_expr (ap->expr))
+ return MATCH_ERROR;
- if (not_restricted == 0
- && ap->expr->expr_type == EXPR_VARIABLE
- && ap->expr->symtree->n.sym->attr.dummy
- && ap->expr->symtree->n.sym->attr.optional)
- return MATCH_NO;
+ if (not_restricted == 0
+ && ap->expr->expr_type != EXPR_VARIABLE
+ && !check_restricted (ap->expr))
+ return MATCH_ERROR;
+
+ if (not_restricted == 0
+ && ap->expr->expr_type == EXPR_VARIABLE
+ && asym->attr.dummy && asym->attr.optional)
+ return MATCH_NO;
}
return MATCH_YES;
diff --git a/gcc/fortran/frontend-passes.c b/gcc/fortran/frontend-passes.c
index 08503ea5d1d..ec374b684e0 100644
--- a/gcc/fortran/frontend-passes.c
+++ b/gcc/fortran/frontend-passes.c
@@ -2580,6 +2580,7 @@ do_subscript (gfc_expr **e)
bool have_do_start, have_do_end;
bool error_not_proven;
int warn;
+ int sgn;
dl = lp->c;
if (dl == NULL)
@@ -2608,7 +2609,16 @@ do_subscript (gfc_expr **e)
Do not warn in this case. */
if (dl->ext.iterator->step->expr_type == EXPR_CONSTANT)
- mpz_init_set (do_step, dl->ext.iterator->step->value.integer);
+ {
+ sgn = mpz_cmp_ui (dl->ext.iterator->step->value.integer, 0);
+ /* This can happen, but then the error has been
+ reported previusly. */
+ if (sgn == 0)
+ continue;
+
+ mpz_init_set (do_step, dl->ext.iterator->step->value.integer);
+ }
+
else
continue;
@@ -2634,9 +2644,8 @@ do_subscript (gfc_expr **e)
/* No warning inside a zero-trip loop. */
if (have_do_start && have_do_end)
{
- int sgn, cmp;
+ int cmp;
- sgn = mpz_cmp_ui (do_step, 0);
cmp = mpz_cmp (do_end, do_start);
if ((sgn > 0 && cmp < 0) || (sgn < 0 && cmp > 0))
break;
@@ -4628,6 +4637,7 @@ call_external_blas (gfc_code **c, int *walk_subtrees ATTRIBUTE_UNUSED,
call->symtree->n.sym->attr.procedure = 1;
call->symtree->n.sym->attr.flavor = FL_PROCEDURE;
call->resolved_sym = call->symtree->n.sym;
+ gfc_commit_symbol (call->resolved_sym);
/* Argument TRANSA. */
next = gfc_get_actual_arglist ();
diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h
index 2bb82980e8e..29b962d889c 100644
--- a/gcc/fortran/gfortran.h
+++ b/gcc/fortran/gfortran.h
@@ -2407,6 +2407,9 @@ typedef struct
{
gfc_expr *var, *start, *end, *step;
unsigned short unroll;
+ bool ivdep;
+ bool vector;
+ bool novector;
}
gfc_iterator;
@@ -2783,6 +2786,9 @@ gfc_finalizer;
bool gfc_in_match_data (void);
match gfc_match_char_spec (gfc_typespec *);
extern int directive_unroll;
+extern bool directive_ivdep;
+extern bool directive_vector;
+extern bool directive_novector;
/* SIMD clause enum. */
enum gfc_simd_clause
diff --git a/gcc/fortran/gfortran.texi b/gcc/fortran/gfortran.texi
index 6a8337a4bbf..733403a129d 100644
--- a/gcc/fortran/gfortran.texi
+++ b/gcc/fortran/gfortran.texi
@@ -3542,6 +3542,9 @@ as this requires the new array descriptor.
* ATTRIBUTES directive::
* UNROLL directive::
* BUILTIN directive::
+* IVDEP directive::
+* VECTOR directive::
+* NOVECTOR directive::
@end menu
@node ATTRIBUTES directive
@@ -3653,6 +3656,52 @@ for the built-in that should be vectorized. Example usage:
The purpose of the directive is to provide an API among the GCC compiler and
the GNU C Library which would define vector implementations of math routines.
+
+@node IVDEP directive
+@subsection IVDEP directive
+
+The syntax of the directive is
+
+@code{!GCC$ ivdep}
+
+This directive tells the compiler to ignore vector dependencies in the
+following loop. It must be placed immediately before a @code{DO} loop
+and applies only to the loop that follows.
+
+Sometimes the compiler may not have sufficient information to decide
+whether a particular loop is vectorizable due to potential
+dependencies between iterations. The purpose of the directive is to
+tell the compiler that vectorization is safe.
+
+This directive is intended for annotation of existing code. For new
+code it is recommended to consider OpenMP SIMD directives as potential
+alternative.
+
+
+@node VECTOR directive
+@subsection VECTOR directive
+
+The syntax of the directive is
+
+@code{!GCC$ vector}
+
+This directive tells the compiler to vectorize the following loop. It
+must be placed immediately before a @code{DO} loop and applies only to
+the loop that follows.
+
+
+@node NOVECTOR directive
+@subsection NOVECTOR directive
+
+The syntax of the directive is
+
+@code{!GCC$ novector}
+
+This directive tells the compiler to not vectorize the following loop.
+It must be placed immediately before a @code{DO} loop and applies only
+to the loop that follows.
+
+
@node Non-Fortran Main Program
@section Non-Fortran Main Program
diff --git a/gcc/fortran/intrinsic.c b/gcc/fortran/intrinsic.c
index d0f7c10a438..357a35052eb 100644
--- a/gcc/fortran/intrinsic.c
+++ b/gcc/fortran/intrinsic.c
@@ -4182,35 +4182,45 @@ sort_actual (const char *name, gfc_actual_arglist **ap,
/* ALLOCATED has two mutually exclusive keywords, but only one
can be present at time and neither is optional. */
- if (strcmp (name, "allocated") == 0 && a->name)
+ if (strcmp (name, "allocated") == 0)
{
- if (strcmp (a->name, "scalar") == 0)
+ if (!a)
{
- if (a->next)
- goto whoops;
- if (a->expr->rank != 0)
- {
- gfc_error ("Scalar entity required at %L", &a->expr->where);
- return false;
- }
- return true;
+ gfc_error ("ALLOCATED intrinsic at %L requires an array or scalar "
+ "allocatable entity", where);
+ return false;
}
- else if (strcmp (a->name, "array") == 0)
+
+ if (a->name)
{
- if (a->next)
- goto whoops;
- if (a->expr->rank == 0)
+ if (strcmp (a->name, "scalar") == 0)
+ {
+ if (a->next)
+ goto whoops;
+ if (a->expr->rank != 0)
+ {
+ gfc_error ("Scalar entity required at %L", &a->expr->where);
+ return false;
+ }
+ return true;
+ }
+ else if (strcmp (a->name, "array") == 0)
{
- gfc_error ("Array entity required at %L", &a->expr->where);
+ if (a->next)
+ goto whoops;
+ if (a->expr->rank == 0)
+ {
+ gfc_error ("Array entity required at %L", &a->expr->where);
+ return false;
+ }
+ return true;
+ }
+ else
+ {
+ gfc_error ("Invalid keyword %qs in %qs intrinsic function at %L",
+ a->name, name, &a->expr->where);
return false;
}
- return true;
- }
- else
- {
- gfc_error ("Invalid keyword %qs in %qs intrinsic function at %L",
- a->name, name, &a->expr->where);
- return false;
}
}
diff --git a/gcc/fortran/io.c b/gcc/fortran/io.c
index 9828897852a..b9a29a0f932 100644
--- a/gcc/fortran/io.c
+++ b/gcc/fortran/io.c
@@ -1441,24 +1441,29 @@ match_vtag (const io_tag *tag, gfc_expr **v)
return MATCH_ERROR;
}
- if (result->symtree->n.sym->attr.intent == INTENT_IN)
+ if (result->symtree)
{
- gfc_error ("Variable %s cannot be INTENT(IN) at %C", tag->name);
- gfc_free_expr (result);
- return MATCH_ERROR;
- }
+ bool impure;
- bool impure = gfc_impure_variable (result->symtree->n.sym);
- if (impure && gfc_pure (NULL))
- {
- gfc_error ("Variable %s cannot be assigned in PURE procedure at %C",
- tag->name);
- gfc_free_expr (result);
- return MATCH_ERROR;
- }
+ if (result->symtree->n.sym->attr.intent == INTENT_IN)
+ {
+ gfc_error ("Variable %s cannot be INTENT(IN) at %C", tag->name);
+ gfc_free_expr (result);
+ return MATCH_ERROR;
+ }
- if (impure)
- gfc_unset_implicit_pure (NULL);
+ impure = gfc_impure_variable (result->symtree->n.sym);
+ if (impure && gfc_pure (NULL))
+ {
+ gfc_error ("Variable %s cannot be assigned in PURE procedure at %C",
+ tag->name);
+ gfc_free_expr (result);
+ return MATCH_ERROR;
+ }
+
+ if (impure)
+ gfc_unset_implicit_pure (NULL);
+ }
*v = result;
return MATCH_YES;
@@ -1474,7 +1479,16 @@ match_out_tag (const io_tag *tag, gfc_expr **result)
m = match_vtag (tag, result);
if (m == MATCH_YES)
- gfc_check_do_variable ((*result)->symtree);
+ {
+ if ((*result)->symtree)
+ gfc_check_do_variable ((*result)->symtree);
+
+ if ((*result)->expr_type == EXPR_CONSTANT)
+ {
+ gfc_error ("Expecting a variable at %L", &(*result)->where);
+ return MATCH_ERROR;
+ }
+ }
return m;
}
@@ -2804,7 +2818,7 @@ match_filepos (gfc_statement st, gfc_exec_op op)
m = match_file_element (fp);
if (m == MATCH_ERROR)
- goto done;
+ goto cleanup;
if (m == MATCH_NO)
{
m = gfc_match_expr (&fp->unit);
@@ -3608,7 +3622,17 @@ match_io_element (io_kind k, gfc_code **cpp)
{
m = gfc_match_variable (&expr, 0);
if (m == MATCH_NO)
- gfc_error ("Expected variable in READ statement at %C");
+ {
+ gfc_error ("Expecting variable in READ statement at %C");
+ m = MATCH_ERROR;
+ }
+
+ if (m == MATCH_YES && expr->expr_type == EXPR_CONSTANT)
+ {
+ gfc_error ("Expecting variable or io-implied-do in READ statement "
+ "at %L", &expr->where);
+ m = MATCH_ERROR;
+ }
if (m == MATCH_YES
&& expr->expr_type == EXPR_VARIABLE
@@ -3618,7 +3642,6 @@ match_io_element (io_kind k, gfc_code **cpp)
&expr->where);
m = MATCH_ERROR;
}
-
}
else
{
@@ -4583,6 +4606,17 @@ gfc_match_inquire (void)
if (m == MATCH_NO)
goto syntax;
+ for (gfc_code *c = code; c; c = c->next)
+ if (c->expr1 && c->expr1->expr_type == EXPR_FUNCTION
+ && c->expr1->symtree && c->expr1->symtree->n.sym->attr.function
+ && !c->expr1->symtree->n.sym->attr.external
+ && strcmp (c->expr1->symtree->name, "null") == 0)
+ {
+ gfc_error ("NULL() near %L cannot appear in INQUIRE statement",
+ &c->expr1->where);
+ goto cleanup;
+ }
+
new_st.op = EXEC_IOLENGTH;
new_st.expr1 = inquire->iolength;
new_st.ext.inquire = inquire;
diff --git a/gcc/fortran/match.c b/gcc/fortran/match.c
index 2d91a2bbace..efc0c2d7bc3 100644
--- a/gcc/fortran/match.c
+++ b/gcc/fortran/match.c
@@ -4219,6 +4219,12 @@ gfc_match_allocate (void)
if (m == MATCH_ERROR)
goto cleanup;
+ if (tail->expr->expr_type == EXPR_CONSTANT)
+ {
+ gfc_error ("Unexpected constant at %C");
+ goto cleanup;
+ }
+
if (gfc_check_do_variable (tail->expr->symtree))
goto cleanup;
@@ -4351,6 +4357,12 @@ alloc_opt_list:
tmp = NULL;
saw_stat = true;
+ if (stat->expr_type == EXPR_CONSTANT)
+ {
+ gfc_error ("STAT tag at %L cannot be a constant", &stat->where);
+ goto cleanup;
+ }
+
if (gfc_check_do_variable (stat->symtree))
goto cleanup;
@@ -4627,6 +4639,12 @@ gfc_match_deallocate (void)
if (m == MATCH_NO)
goto syntax;
+ if (tail->expr->expr_type == EXPR_CONSTANT)
+ {
+ gfc_error ("Unexpected constant at %C");
+ goto cleanup;
+ }
+
if (gfc_check_do_variable (tail->expr->symtree))
goto cleanup;
diff --git a/gcc/fortran/match.h b/gcc/fortran/match.h
index ac47d992f4a..29854ee9000 100644
--- a/gcc/fortran/match.h
+++ b/gcc/fortran/match.h
@@ -246,8 +246,11 @@ match gfc_match_contiguous (void);
match gfc_match_dimension (void);
match gfc_match_external (void);
match gfc_match_gcc_attributes (void);
-match gfc_match_gcc_unroll (void);
match gfc_match_gcc_builtin (void);
+match gfc_match_gcc_ivdep (void);
+match gfc_match_gcc_novector (void);
+match gfc_match_gcc_unroll (void);
+match gfc_match_gcc_vector (void);
match gfc_match_import (void);
match gfc_match_intent (void);
match gfc_match_intrinsic (void);
diff --git a/gcc/fortran/parse.c b/gcc/fortran/parse.c
index 66d84b4118f..86af947d152 100644
--- a/gcc/fortran/parse.c
+++ b/gcc/fortran/parse.c
@@ -1079,12 +1079,20 @@ decode_gcc_attribute (void)
match ("attributes", gfc_match_gcc_attributes, ST_ATTR_DECL);
match ("unroll", gfc_match_gcc_unroll, ST_NONE);
match ("builtin", gfc_match_gcc_builtin, ST_NONE);
+ match ("ivdep", gfc_match_gcc_ivdep, ST_NONE);
+ match ("vector", gfc_match_gcc_vector, ST_NONE);
+ match ("novector", gfc_match_gcc_novector, ST_NONE);
/* All else has failed, so give up. See if any of the matchers has
stored an error message of some sort. */
if (!gfc_error_check ())
- gfc_error_now ("Unclassifiable GCC directive at %C");
+ {
+ if (pedantic)
+ gfc_error_now ("Unclassifiable GCC directive at %C");
+ else
+ gfc_warning_now (0, "Unclassifiable GCC directive at %C, ignored");
+ }
reject_statement ();
@@ -4672,6 +4680,21 @@ parse_do_block (void)
new_st.ext.iterator->unroll = directive_unroll;
directive_unroll = -1;
}
+ if (directive_ivdep)
+ {
+ new_st.ext.iterator->ivdep = directive_ivdep;
+ directive_ivdep = false;
+ }
+ if (directive_vector)
+ {
+ new_st.ext.iterator->vector = directive_vector;
+ directive_vector = false;
+ }
+ if (directive_novector)
+ {
+ new_st.ext.iterator->novector = directive_novector;
+ directive_novector = false;
+ }
}
else
stree = NULL;
@@ -5431,7 +5454,17 @@ parse_executable (gfc_statement st)
}
if (directive_unroll != -1)
- gfc_error ("%<GCC unroll%> directive does not commence a loop at %C");
+ gfc_error ("%<GCC unroll%> directive not at the start of a loop at %C");
+
+ if (directive_ivdep)
+ gfc_error ("%<GCC ivdep%> directive not at the start of a loop at %C");
+
+ if (directive_vector)
+ gfc_error ("%<GCC vector%> directive not at the start of a loop at %C");
+
+ if (directive_novector)
+ gfc_error ("%<GCC novector%> "
+ "directive not at the start of a loop at %C");
st = next_statement ();
}
diff --git a/gcc/fortran/primary.c b/gcc/fortran/primary.c
index 4af1db5f4bd..8408e9c3d0d 100644
--- a/gcc/fortran/primary.c
+++ b/gcc/fortran/primary.c
@@ -1990,6 +1990,7 @@ gfc_match_varspec (gfc_expr *primary, int equiv_flag, bool sub_flag,
match m;
bool unknown;
bool inquiry;
+ bool intrinsic;
locus old_loc;
char sep;
@@ -2194,11 +2195,15 @@ gfc_match_varspec (gfc_expr *primary, int equiv_flag, bool sub_flag,
if (m != MATCH_YES)
return MATCH_ERROR;
+ intrinsic = false;
if (primary->ts.type != BT_CLASS && primary->ts.type != BT_DERIVED)
{
inquiry = is_inquiry_ref (name, &tmp);
if (inquiry)
sym = NULL;
+
+ if (sep == '%' && primary->ts.type != BT_UNKNOWN)
+ intrinsic = true;
}
else
inquiry = false;
@@ -2258,12 +2263,16 @@ gfc_match_varspec (gfc_expr *primary, int equiv_flag, bool sub_flag,
break;
}
- if (!inquiry)
+ if (!inquiry && !intrinsic)
component = gfc_find_component (sym, name, false, false, &tmp);
else
component = NULL;
- if (component == NULL && !inquiry)
+ /* In some cases, returning MATCH_NO gives a better error message. Most
+ cases return "Unclassifiable statement at..." */
+ if (intrinsic && !inquiry)
+ return MATCH_NO;
+ else if (component == NULL && !inquiry)
return MATCH_ERROR;
/* Extend the reference chain determined by gfc_find_component or
@@ -2284,6 +2293,8 @@ gfc_match_varspec (gfc_expr *primary, int equiv_flag, bool sub_flag,
if (tmp && tmp->type == REF_INQUIRY)
{
+ if (!primary->where.lb || !primary->where.nextc)
+ primary->where = gfc_current_locus;
gfc_simplify_expr (primary, 0);
if (primary->expr_type == EXPR_CONSTANT)
diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c
index 9647ef2c46a..b3807576653 100644
--- a/gcc/fortran/resolve.c
+++ b/gcc/fortran/resolve.c
@@ -1866,7 +1866,7 @@ resolve_procedure_expression (gfc_expr* expr)
/* Check that name is not a derived type. */
-
+
static bool
is_dt_name (const char *name)
{
@@ -7059,19 +7059,6 @@ gfc_resolve_iterator (gfc_iterator *iter, bool real_ok, bool own_scope)
"Step expression in DO loop"))
return false;
- if (iter->step->expr_type == EXPR_CONSTANT)
- {
- if ((iter->step->ts.type == BT_INTEGER
- && mpz_cmp_ui (iter->step->value.integer, 0) == 0)
- || (iter->step->ts.type == BT_REAL
- && mpfr_sgn (iter->step->value.real) == 0))
- {
- gfc_error ("Step expression in DO loop at %L cannot be zero",
- &iter->step->where);
- return false;
- }
- }
-
/* Convert start, end, and step to the same type as var. */
if (iter->start->ts.kind != iter->var->ts.kind
|| iter->start->ts.type != iter->var->ts.type)
@@ -7085,6 +7072,19 @@ gfc_resolve_iterator (gfc_iterator *iter, bool real_ok, bool own_scope)
|| iter->step->ts.type != iter->var->ts.type)
gfc_convert_type (iter->step, &iter->var->ts, 1);
+ if (iter->step->expr_type == EXPR_CONSTANT)
+ {
+ if ((iter->step->ts.type == BT_INTEGER
+ && mpz_cmp_ui (iter->step->value.integer, 0) == 0)
+ || (iter->step->ts.type == BT_REAL
+ && mpfr_sgn (iter->step->value.real) == 0))
+ {
+ gfc_error ("Step expression in DO loop at %L cannot be zero",
+ &iter->step->where);
+ return false;
+ }
+ }
+
if (iter->start->expr_type == EXPR_CONSTANT
&& iter->end->expr_type == EXPR_CONSTANT
&& iter->step->expr_type == EXPR_CONSTANT)
@@ -7439,7 +7439,7 @@ conformable_arrays (gfc_expr *e1, gfc_expr *e2)
for (tail = e2->ref; tail && tail->next; tail = tail->next);
/* First compare rank. */
- if ((tail && e1->rank != tail->u.ar.as->rank)
+ if ((tail && (!tail->u.ar.as || e1->rank != tail->u.ar.as->rank))
|| (!tail && e1->rank != e2->rank))
{
gfc_error ("Source-expr at %L must be scalar or have the "
@@ -13539,7 +13539,7 @@ resolve_typebound_procedure (gfc_symtree* stree)
}
else
{
- /* If proc has not been resolved at this point, proc->name may
+ /* If proc has not been resolved at this point, proc->name may
actually be a USE associated entity. See PR fortran/89647. */
if (!proc->resolved
&& proc->attr.function == 0 && proc->attr.subroutine == 0)
@@ -16554,8 +16554,8 @@ resolve_equivalence (gfc_equiv *eq)
}
-/* Function called by resolve_fntype to flag other symbol used in the
- length type parameter specification of function resuls. */
+/* Function called by resolve_fntype to flag other symbols used in the
+ length type parameter specification of function results. */
static bool
flag_fn_result_spec (gfc_expr *expr,
diff --git a/gcc/fortran/scanner.c b/gcc/fortran/scanner.c
index e54d483baff..40c06b6b674 100644
--- a/gcc/fortran/scanner.c
+++ b/gcc/fortran/scanner.c
@@ -1050,6 +1050,10 @@ skip_fixed_comments (void)
return;
}
+ if (gfc_current_locus.lb != NULL
+ && continue_line < gfc_linebuf_linenum (gfc_current_locus.lb))
+ continue_line = gfc_linebuf_linenum (gfc_current_locus.lb);
+
/* If -fopenmp/-fopenacc, we need to handle here 2 things:
1) don't treat !$omp/!$acc|c$omp/c$acc|*$omp / *$acc as comments,
but directives
@@ -1057,10 +1061,6 @@ skip_fixed_comments (void)
!$|c$|*$ should be treated as 2 spaces if the characters
in columns 3 to 6 are valid fixed form label columns
characters. */
- if (gfc_current_locus.lb != NULL
- && continue_line < gfc_linebuf_linenum (gfc_current_locus.lb))
- continue_line = gfc_linebuf_linenum (gfc_current_locus.lb);
-
if ((flag_openmp || flag_openmp_simd) && !flag_openacc)
{
if (next_char () == '$')
@@ -1313,6 +1313,14 @@ restart:
if (flag_openacc)
prev_openacc_flag = openacc_flag;
+ /* This can happen if the input file changed or via cpp's #line
+ without getting reset (e.g. via input_stmt). It also happens
+ when pre-including files via -fpre-include=. */
+ if (continue_count == 0
+ && gfc_current_locus.lb
+ && continue_line > gfc_linebuf_linenum (gfc_current_locus.lb) + 1)
+ continue_line = gfc_linebuf_linenum (gfc_current_locus.lb) + 1;
+
continue_flag = 1;
if (c == '!')
skip_comment_line ();
@@ -1475,6 +1483,14 @@ restart:
if (flag_openacc)
prev_openacc_flag = openacc_flag;
+ /* This can happen if the input file changed or via cpp's #line
+ without getting reset (e.g. via input_stmt). It also happens
+ when pre-including files via -fpre-include=. */
+ if (continue_count == 0
+ && gfc_current_locus.lb
+ && continue_line > gfc_linebuf_linenum (gfc_current_locus.lb) + 1)
+ continue_line = gfc_linebuf_linenum (gfc_current_locus.lb) + 1;
+
continue_flag = 1;
old_loc = gfc_current_locus;
@@ -1943,7 +1959,7 @@ next_char:
the file stack. */
static gfc_file *
-get_file (const char *name, enum lc_reason reason ATTRIBUTE_UNUSED)
+get_file (const char *name, enum lc_reason reason)
{
gfc_file *f;
diff --git a/gcc/fortran/simplify.c b/gcc/fortran/simplify.c
index 6c1f4bd4fce..58b4652b010 100644
--- a/gcc/fortran/simplify.c
+++ b/gcc/fortran/simplify.c
@@ -4808,8 +4808,12 @@ gfc_simplify_merge (gfc_expr *tsource, gfc_expr *fsource, gfc_expr *mask)
gfc_constructor *tsource_ctor, *fsource_ctor, *mask_ctor;
if (mask->expr_type == EXPR_CONSTANT)
- return gfc_get_parentheses (gfc_copy_expr (mask->value.logical
- ? tsource : fsource));
+ {
+ result = gfc_copy_expr (mask->value.logical ? tsource : fsource);
+ result = gfc_get_parentheses (result);
+ gfc_simplify_expr (result, 1);
+ return result;
+ }
if (!mask->rank || !is_constant_array_expr (mask)
|| !is_constant_array_expr (tsource) || !is_constant_array_expr (fsource))
@@ -6684,6 +6688,9 @@ gfc_simplify_reshape (gfc_expr *source, gfc_expr *shape_exp,
mpz_init (index);
rank = 0;
+ for (i = 0; i < GFC_MAX_DIMENSIONS; i++)
+ x[i] = 0;
+
for (;;)
{
e = gfc_constructor_lookup_expr (shape_exp->value.constructor, rank);
@@ -6708,8 +6715,28 @@ gfc_simplify_reshape (gfc_expr *source, gfc_expr *shape_exp,
}
else
{
- for (i = 0; i < rank; i++)
- x[i] = 0;
+ mpz_t size;
+ int order_size, shape_size;
+
+ if (order_exp->rank != shape_exp->rank)
+ {
+ gfc_error ("Shapes of ORDER at %L and SHAPE at %L are different",
+ &order_exp->where, &shape_exp->where);
+ return &gfc_bad_expr;
+ }
+
+ gfc_array_size (shape_exp, &size);
+ shape_size = mpz_get_ui (size);
+ mpz_clear (size);
+ gfc_array_size (order_exp, &size);
+ order_size = mpz_get_ui (size);
+ mpz_clear (size);
+ if (order_size != shape_size)
+ {
+ gfc_error ("Sizes of ORDER at %L and SHAPE at %L are different",
+ &order_exp->where, &shape_exp->where);
+ return &gfc_bad_expr;
+ }
for (i = 0; i < rank; i++)
{
@@ -6718,9 +6745,22 @@ gfc_simplify_reshape (gfc_expr *source, gfc_expr *shape_exp,
gfc_extract_int (e, &order[i]);
- gcc_assert (order[i] >= 1 && order[i] <= rank);
+ if (order[i] < 1 || order[i] > rank)
+ {
+ gfc_error ("Element with a value of %d in ORDER at %L must be "
+ "in the range [1, ..., %d] for the RESHAPE intrinsic "
+ "near %L", order[i], &order_exp->where, rank,
+ &shape_exp->where);
+ return &gfc_bad_expr;
+ }
+
order[i]--;
- gcc_assert (x[order[i]] == 0);
+ if (x[order[i]] != 0)
+ {
+ gfc_error ("ORDER at %L is not a permutation of the size of "
+ "SHAPE at %L", &order_exp->where, &shape_exp->where);
+ return &gfc_bad_expr;
+ }
x[order[i]] = 1;
}
}
@@ -8494,6 +8534,12 @@ gfc_convert_constant (gfc_expr *e, bt type, int kind)
{
if (c->expr->expr_type == EXPR_ARRAY)
tmp = gfc_convert_constant (c->expr, type, kind);
+ else if (c->expr->expr_type == EXPR_OP
+ && c->expr->value.op.op == INTRINSIC_PARENTHESES)
+ {
+ gfc_simplify_expr (c->expr, 1);
+ tmp = f (c->expr, kind);
+ }
else
tmp = f (c->expr, kind);
}
diff --git a/gcc/fortran/trans-array.c b/gcc/fortran/trans-array.c
index 583425c516d..3945d116180 100644
--- a/gcc/fortran/trans-array.c
+++ b/gcc/fortran/trans-array.c
@@ -6110,17 +6110,20 @@ gfc_conv_array_initializer (tree type, gfc_expr * expr)
tree atype = type;
while (TREE_CODE (TREE_TYPE (atype)) == ARRAY_TYPE)
atype = TREE_TYPE (atype);
- if (TREE_CODE (TREE_TYPE (atype)) == INTEGER_TYPE
- && tree_to_uhwi (TYPE_SIZE_UNIT (TREE_TYPE (se.expr)))
- > tree_to_uhwi (TYPE_SIZE_UNIT (atype)))
+ gcc_checking_assert (TREE_CODE (TREE_TYPE (atype))
+ == INTEGER_TYPE);
+ gcc_checking_assert (TREE_TYPE (TREE_TYPE (se.expr))
+ == TREE_TYPE (atype));
+ if (tree_to_uhwi (TYPE_SIZE_UNIT (TREE_TYPE (se.expr)))
+ > tree_to_uhwi (TYPE_SIZE_UNIT (atype)))
{
unsigned HOST_WIDE_INT size
= tree_to_uhwi (TYPE_SIZE_UNIT (atype));
const char *p = TREE_STRING_POINTER (se.expr);
se.expr = build_string (size, p);
- TREE_TYPE (se.expr) = atype;
}
+ TREE_TYPE (se.expr) = atype;
}
break;
@@ -8024,7 +8027,7 @@ gfc_conv_array_parameter (gfc_se * se, gfc_expr * expr, bool g77,
/* The components shall be deallocated before their containing entity. */
gfc_prepend_expr_to_block (&se->post, tmp);
}
- if (expr->ts.type == BT_CHARACTER)
+ if (expr->ts.type == BT_CHARACTER && expr->expr_type != EXPR_FUNCTION)
se->string_length = expr->ts.u.cl->backend_decl;
if (size)
array_parameter_size (se->expr, expr, size);
diff --git a/gcc/fortran/trans-decl.c b/gcc/fortran/trans-decl.c
index 5d1d1ecb19c..27613f761e3 100644
--- a/gcc/fortran/trans-decl.c
+++ b/gcc/fortran/trans-decl.c
@@ -369,44 +369,37 @@ gfc_sym_identifier (gfc_symbol * sym)
static const char *
mangled_identifier (gfc_symbol *sym)
{
- static char name[GFC_MAX_MANGLED_SYMBOL_LEN + 1];
+ gfc_symbol *proc = sym->ns->proc_name;
+ static char name[3*GFC_MAX_MANGLED_SYMBOL_LEN + 14];
/* Prevent the mangling of identifiers that have an assigned
binding label (mainly those that are bind(c)). */
if (sym->attr.is_bind_c == 1 && sym->binding_label)
return sym->binding_label;
- if (!sym->fn_result_spec)
+ if (!sym->fn_result_spec
+ || (sym->module && !(proc && proc->attr.flavor == FL_PROCEDURE)))
{
if (sym->module == NULL)
return sym_identifier (sym);
else
- {
- snprintf (name, sizeof name, "__%s_MOD_%s", sym->module, sym->name);
- return name;
- }
+ snprintf (name, sizeof name, "__%s_MOD_%s", sym->module, sym->name);
}
else
{
/* This is an entity that is actually local to a module procedure
that appears in the result specification expression. Since
sym->module will be a zero length string, we use ns->proc_name
- instead. */
- if (sym->ns->proc_name && sym->ns->proc_name->module)
- {
- snprintf (name, sizeof name, "__%s_MOD__%s_PROC_%s",
- sym->ns->proc_name->module,
- sym->ns->proc_name->name,
- sym->name);
- return name;
- }
+ to provide the module name instead. */
+ if (proc && proc->module)
+ snprintf (name, sizeof name, "__%s_MOD__%s_PROC_%s",
+ proc->module, proc->name, sym->name);
else
- {
- snprintf (name, sizeof name, "__%s_PROC_%s",
- sym->ns->proc_name->name, sym->name);
- return name;
- }
+ snprintf (name, sizeof name, "__%s_PROC_%s",
+ proc->name, sym->name);
}
+
+ return name;
}
/* Get mangled identifier, adding the symbol to the global table if
@@ -1892,9 +1885,18 @@ gfc_get_symbol_decl (gfc_symbol * sym)
if (sym->attr.associate_var)
GFC_DECL_ASSOCIATE_VAR_P (decl) = 1;
- if (sym->attr.vtab
- || (sym->name[0] == '_' && gfc_str_startswith (sym->name, "__def_init")))
- TREE_READONLY (decl) = 1;
+ /* We only mark __def_init as read-only if it actually has an
+ initializer so it does not needlessly take up space in the
+ read-only section and can go into the BSS instead, see PR 84487.
+ Marking this as artificial means that OpenMP will treat this as
+ predetermined shared. */
+
+ if (sym->attr.vtab || gfc_str_startswith (sym->name, "__def_init"))
+ {
+ DECL_ARTIFICIAL (decl) = 1;
+ if (sym->attr.vtab || sym->value)
+ TREE_READONLY (decl) = 1;
+ }
return decl;
}
@@ -5862,9 +5864,11 @@ generate_local_decl (gfc_symbol * sym)
}
else if (warn_unused_dummy_argument)
{
- gfc_warning (OPT_Wunused_dummy_argument,
- "Unused dummy argument %qs at %L", sym->name,
- &sym->declared_at);
+ if (!sym->attr.artificial)
+ gfc_warning (OPT_Wunused_dummy_argument,
+ "Unused dummy argument %qs at %L", sym->name,
+ &sym->declared_at);
+
if (sym->backend_decl != NULL_TREE)
TREE_NO_WARNING(sym->backend_decl) = 1;
}
@@ -5956,7 +5960,14 @@ generate_local_decl (gfc_symbol * sym)
if (sym->ns && sym->ns->construct_entities)
{
- if (sym->attr.referenced)
+ /* Construction of the intrinsic modules within a BLOCK
+ construct, where ONLY and RENAMED entities are included,
+ seems to be bogus. This is a workaround that can be removed
+ if someone ever takes on the task to creating full-fledge
+ modules. See PR 69455. */
+ if (sym->attr.referenced
+ && sym->from_intmod != INTMOD_ISO_C_BINDING
+ && sym->from_intmod != INTMOD_ISO_FORTRAN_ENV)
gfc_get_symbol_decl (sym);
sym->mark = 1;
}
diff --git a/gcc/fortran/trans-expr.c b/gcc/fortran/trans-expr.c
index 4b8794b0f1e..52a8cdd6902 100644
--- a/gcc/fortran/trans-expr.c
+++ b/gcc/fortran/trans-expr.c
@@ -4989,21 +4989,30 @@ gfc_conv_gfc_desc_to_cfi_desc (gfc_se *parmse, gfc_expr *e, gfc_symbol *fsym)
tree gfc_desc_ptr;
tree type;
tree cond;
+ tree desc_attr;
int attribute;
+ int cfi_attribute;
symbol_attribute attr = gfc_expr_attr (e);
- stmtblock_t block;
/* If this is a full array or a scalar, the allocatable and pointer
attributes can be passed. Otherwise it is 'CFI_attribute_other'*/
attribute = 2;
if (!e->rank || gfc_get_full_arrayspec_from_expr (e))
{
- if (fsym->attr.pointer)
+ if (attr.pointer)
attribute = 0;
- else if (fsym->attr.allocatable)
+ else if (attr.allocatable)
attribute = 1;
}
+ /* If the formal argument is assumed shape and neither a pointer nor
+ allocatable, it is unconditionally CFI_attribute_other. */
+ if (fsym->as->type == AS_ASSUMED_SHAPE
+ && !fsym->attr.pointer && !fsym->attr.allocatable)
+ cfi_attribute = 2;
+ else
+ cfi_attribute = attribute;
+
if (e->rank != 0)
{
parmse->force_no_tmp = 1;
@@ -5018,6 +5027,10 @@ gfc_conv_gfc_desc_to_cfi_desc (gfc_se *parmse, gfc_expr *e, gfc_symbol *fsym)
parmse->expr = build_fold_indirect_ref_loc (input_location,
parmse->expr);
+ bool is_artificial = (INDIRECT_REF_P (parmse->expr)
+ ? DECL_ARTIFICIAL (TREE_OPERAND (parmse->expr, 0))
+ : DECL_ARTIFICIAL (parmse->expr));
+
/* Unallocated allocatable arrays and unassociated pointer arrays
need their dtype setting if they are argument associated with
assumed rank dummies. */
@@ -5036,7 +5049,7 @@ gfc_conv_gfc_desc_to_cfi_desc (gfc_se *parmse, gfc_expr *e, gfc_symbol *fsym)
type = e->ts.type != BT_ASSUMED ? gfc_typenode_for_spec (&e->ts) :
NULL_TREE;
- if (type && DECL_ARTIFICIAL (parmse->expr)
+ if (type && is_artificial
&& type != gfc_get_element_type (TREE_TYPE (parmse->expr)))
{
/* Obtain the offset to the data. */
@@ -5048,8 +5061,7 @@ gfc_conv_gfc_desc_to_cfi_desc (gfc_se *parmse, gfc_expr *e, gfc_symbol *fsym)
gfc_conv_descriptor_dtype (parmse->expr),
gfc_get_dtype_rank_type (e->rank, type));
}
- else if (type == NULL_TREE
- || (!is_subref_array (e) && !DECL_ARTIFICIAL (parmse->expr)))
+ else if (type == NULL_TREE || (!is_subref_array (e) && !is_artificial))
{
/* Make sure that the span is set for expressions where it
might not have been done already. */
@@ -5070,41 +5082,40 @@ gfc_conv_gfc_desc_to_cfi_desc (gfc_se *parmse, gfc_expr *e, gfc_symbol *fsym)
parmse->expr, attr);
}
- /* Set the CFI attribute field. */
- tmp = gfc_conv_descriptor_attribute (parmse->expr);
+ /* Set the CFI attribute field through a temporary value for the
+ gfc attribute. */
+ desc_attr = gfc_conv_descriptor_attribute (parmse->expr);
tmp = fold_build2_loc (input_location, MODIFY_EXPR,
- void_type_node, tmp,
- build_int_cst (TREE_TYPE (tmp), attribute));
+ void_type_node, desc_attr,
+ build_int_cst (TREE_TYPE (desc_attr), cfi_attribute));
gfc_add_expr_to_block (&parmse->pre, tmp);
/* Now pass the gfc_descriptor by reference. */
parmse->expr = gfc_build_addr_expr (NULL_TREE, parmse->expr);
- /* Variables to point to the gfc and CFI descriptors. */
+ /* Variables to point to the gfc and CFI descriptors; cfi = NULL implies
+ that the CFI descriptor is allocated by the gfor_fndecl_gfc_to_cfi call. */
gfc_desc_ptr = parmse->expr;
cfi_desc_ptr = gfc_create_var (pvoid_type_node, "cfi");
- gfc_add_modify (&parmse->pre, cfi_desc_ptr,
- build_int_cst (pvoid_type_node, 0));
+ gfc_add_modify (&parmse->pre, cfi_desc_ptr, null_pointer_node);
- /* Allocate the CFI descriptor and fill the fields. */
+ /* Allocate the CFI descriptor itself and fill the fields. */
tmp = gfc_build_addr_expr (NULL_TREE, cfi_desc_ptr);
tmp = build_call_expr_loc (input_location,
gfor_fndecl_gfc_to_cfi, 2, tmp, gfc_desc_ptr);
gfc_add_expr_to_block (&parmse->pre, tmp);
+ /* Now set the gfc descriptor attribute. */
+ tmp = fold_build2_loc (input_location, MODIFY_EXPR,
+ void_type_node, desc_attr,
+ build_int_cst (TREE_TYPE (desc_attr), attribute));
+ gfc_add_expr_to_block (&parmse->pre, tmp);
+
/* The CFI descriptor is passed to the bind_C procedure. */
parmse->expr = cfi_desc_ptr;
/* Free the CFI descriptor. */
- gfc_init_block (&block);
- cond = fold_build2_loc (input_location, NE_EXPR,
- logical_type_node, cfi_desc_ptr,
- build_int_cst (TREE_TYPE (cfi_desc_ptr), 0));
tmp = gfc_call_free (cfi_desc_ptr);
- gfc_add_expr_to_block (&block, tmp);
- tmp = build3_v (COND_EXPR, cond,
- gfc_finish_block (&block),
- build_empty_stmt (input_location));
gfc_prepend_expr_to_block (&parmse->post, tmp);
/* Transfer values back to gfc descriptor. */
@@ -5112,6 +5123,25 @@ gfc_conv_gfc_desc_to_cfi_desc (gfc_se *parmse, gfc_expr *e, gfc_symbol *fsym)
tmp = build_call_expr_loc (input_location,
gfor_fndecl_cfi_to_gfc, 2, gfc_desc_ptr, tmp);
gfc_prepend_expr_to_block (&parmse->post, tmp);
+
+ /* Deal with an optional dummy being passed to an optional formal arg
+ by finishing the pre and post blocks and making their execution
+ conditional on the dummy being present. */
+ if (fsym->attr.optional && e->expr_type == EXPR_VARIABLE
+ && e->symtree->n.sym->attr.optional)
+ {
+ cond = gfc_conv_expr_present (e->symtree->n.sym);
+ tmp = fold_build2 (MODIFY_EXPR, void_type_node,
+ cfi_desc_ptr,
+ build_int_cst (pvoid_type_node, 0));
+ tmp = build3_v (COND_EXPR, cond,
+ gfc_finish_block (&parmse->pre), tmp);
+ gfc_add_expr_to_block (&parmse->pre, tmp);
+ tmp = build3_v (COND_EXPR, cond,
+ gfc_finish_block (&parmse->post),
+ build_empty_stmt (input_location));
+ gfc_add_expr_to_block (&parmse->post, tmp);
+ }
}
@@ -6001,8 +6031,14 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym,
gfc_add_expr_to_block (&se->pre, tmp);
}
- tmp = build_fold_indirect_ref_loc (input_location,
- parmse.expr);
+ tmp = parmse.expr;
+ /* With bind(C), the actual argument is replaced by a bind-C
+ descriptor; in this case, the data component arrives here,
+ which shall not be dereferenced, but still freed and
+ nullified. */
+ if (TREE_TYPE(tmp) != pvoid_type_node)
+ tmp = build_fold_indirect_ref_loc (input_location,
+ parmse.expr);
if (GFC_DESCRIPTOR_TYPE_P (TREE_TYPE (tmp)))
tmp = gfc_conv_descriptor_data_get (tmp);
tmp = gfc_deallocate_with_status (tmp, NULL_TREE, NULL_TREE,
diff --git a/gcc/fortran/trans-stmt.c b/gcc/fortran/trans-stmt.c
index 5fa182bf05a..b839d6c73e1 100644
--- a/gcc/fortran/trans-stmt.c
+++ b/gcc/fortran/trans-stmt.c
@@ -2171,6 +2171,19 @@ gfc_trans_simple_do (gfc_code * code, stmtblock_t *pblock, tree dovar,
build_int_cst (integer_type_node, annot_expr_unroll_kind),
build_int_cst (integer_type_node, code->ext.iterator->unroll));
+ if (code->ext.iterator->ivdep && cond != error_mark_node)
+ cond = build3 (ANNOTATE_EXPR, TREE_TYPE (cond), cond,
+ build_int_cst (integer_type_node, annot_expr_ivdep_kind),
+ integer_zero_node);
+ if (code->ext.iterator->vector && cond != error_mark_node)
+ cond = build3 (ANNOTATE_EXPR, TREE_TYPE (cond), cond,
+ build_int_cst (integer_type_node, annot_expr_vector_kind),
+ integer_zero_node);
+ if (code->ext.iterator->novector && cond != error_mark_node)
+ cond = build3 (ANNOTATE_EXPR, TREE_TYPE (cond), cond,
+ build_int_cst (integer_type_node, annot_expr_no_vector_kind),
+ integer_zero_node);
+
/* The loop exit. */
tmp = fold_build1_loc (loc, GOTO_EXPR, void_type_node, exit_label);
TREE_USED (exit_label) = 1;
@@ -2501,6 +2514,20 @@ gfc_trans_do (gfc_code * code, tree exit_cond)
= build3 (ANNOTATE_EXPR, TREE_TYPE (cond), cond,
build_int_cst (integer_type_node, annot_expr_unroll_kind),
build_int_cst (integer_type_node, code->ext.iterator->unroll));
+
+ if (code->ext.iterator->ivdep && cond != error_mark_node)
+ cond = build3 (ANNOTATE_EXPR, TREE_TYPE (cond), cond,
+ build_int_cst (integer_type_node, annot_expr_ivdep_kind),
+ integer_zero_node);
+ if (code->ext.iterator->vector && cond != error_mark_node)
+ cond = build3 (ANNOTATE_EXPR, TREE_TYPE (cond), cond,
+ build_int_cst (integer_type_node, annot_expr_vector_kind),
+ integer_zero_node);
+ if (code->ext.iterator->novector && cond != error_mark_node)
+ cond = build3 (ANNOTATE_EXPR, TREE_TYPE (cond), cond,
+ build_int_cst (integer_type_node, annot_expr_no_vector_kind),
+ integer_zero_node);
+
tmp = fold_build1_loc (loc, GOTO_EXPR, void_type_node, exit_label);
tmp = fold_build3_loc (loc, COND_EXPR, void_type_node,
cond, tmp, build_empty_stmt (loc));
diff --git a/gcc/fortran/trans-types.c b/gcc/fortran/trans-types.c
index d3b61e78887..3c8188b30c4 100644
--- a/gcc/fortran/trans-types.c
+++ b/gcc/fortran/trans-types.c
@@ -3021,6 +3021,7 @@ get_formal_from_actual_arglist (gfc_symbol *sym, gfc_actual_arglist *actual_args
}
}
s->attr.dummy = 1;
+ s->attr.artificial = 1;
s->attr.intent = INTENT_UNKNOWN;
(*f)->sym = s;
}
diff --git a/gcc/function.c b/gcc/function.c
index c6e862b3369..acf9f9e60c7 100644
--- a/gcc/function.c
+++ b/gcc/function.c
@@ -2449,8 +2449,7 @@ assign_parm_find_data_types (struct assign_parm_data_all *all, tree parm,
/* If the parm is to be passed as a transparent union or record, use the
type of the first field for the tests below. We have already verified
that the modes are the same. */
- if ((TREE_CODE (passed_type) == UNION_TYPE
- || TREE_CODE (passed_type) == RECORD_TYPE)
+ if (RECORD_OR_UNION_TYPE_P (passed_type)
&& TYPE_TRANSPARENT_AGGR (passed_type))
passed_type = TREE_TYPE (first_field (passed_type));
@@ -3079,7 +3078,7 @@ assign_parm_setup_block (struct assign_parm_data_all *all,
move_block_from_reg (REGNO (entry_parm), mem,
size_stored / UNITS_PER_WORD);
}
- else if (data->stack_parm == 0)
+ else if (data->stack_parm == 0 && !TYPE_EMPTY_P (data->passed_type))
{
push_to_sequence2 (all->first_conversion_insn, all->last_conversion_insn);
emit_block_move (stack_parm, data->entry_parm, GEN_INT (size),
@@ -3455,7 +3454,9 @@ assign_parm_setup_stack (struct assign_parm_data_all *all, tree parm,
dest = validize_mem (copy_rtx (data->stack_parm));
src = validize_mem (copy_rtx (data->entry_parm));
- if (MEM_P (src))
+ if (TYPE_EMPTY_P (data->passed_type))
+ /* Empty types don't really need to be copied. */;
+ else if (MEM_P (src))
{
/* Use a block move to handle potentially misaligned entry_parm. */
if (!to_conversion)
@@ -3611,6 +3612,16 @@ assign_parms (tree fndecl)
{
assign_parm_find_stack_rtl (parm, &data);
assign_parm_adjust_entry_rtl (&data);
+ /* For arguments that occupy no space in the parameter
+ passing area, have non-zero size and have address taken,
+ force creation of a stack slot so that they have distinct
+ address from other parameters. */
+ if (TYPE_EMPTY_P (data.passed_type)
+ && TREE_ADDRESSABLE (parm)
+ && data.entry_parm == data.stack_parm
+ && MEM_P (data.entry_parm)
+ && int_size_in_bytes (data.passed_type))
+ data.stack_parm = NULL_RTX;
}
/* Record permanently how this parm was passed. */
if (data.passed_pointer)
diff --git a/gcc/gcov.c b/gcc/gcov.c
index b06a6714c2e..7e51c2efb30 100644
--- a/gcc/gcov.c
+++ b/gcc/gcov.c
@@ -725,10 +725,10 @@ unblock (const block_info *u, block_vector_t &blocked,
/* Return true when PATH contains a zero cycle arc count. */
static bool
-path_contains_zero_cycle_arc (arc_vector_t &path)
+path_contains_zero_or_negative_cycle_arc (arc_vector_t &path)
{
for (unsigned i = 0; i < path.size (); i++)
- if (path[i]->cs_count == 0)
+ if (path[i]->cs_count <= 0)
return true;
return false;
}
@@ -754,7 +754,7 @@ circuit (block_info *v, arc_vector_t &path, block_info *start,
{
block_info *w = arc->dst;
if (w < start
- || arc->cs_count == 0
+ || arc->cs_count <= 0
|| !linfo.has_block (w))
continue;
@@ -765,7 +765,7 @@ circuit (block_info *v, arc_vector_t &path, block_info *start,
handle_cycle (path, count);
loop_found = true;
}
- else if (!path_contains_zero_cycle_arc (path)
+ else if (!path_contains_zero_or_negative_cycle_arc (path)
&& find (blocked.begin (), blocked.end (), w) == blocked.end ())
loop_found |= circuit (w, path, start, blocked, block_lists, linfo,
count);
@@ -780,7 +780,7 @@ circuit (block_info *v, arc_vector_t &path, block_info *start,
{
block_info *w = arc->dst;
if (w < start
- || arc->cs_count == 0
+ || arc->cs_count <= 0
|| !linfo.has_block (w))
continue;
diff --git a/gcc/generic-match-head.c b/gcc/generic-match-head.c
index a46f375017b..3478cf59f91 100644
--- a/gcc/generic-match-head.c
+++ b/gcc/generic-match-head.c
@@ -28,6 +28,7 @@ along with GCC; see the file COPYING3. If not see
#include "ssa.h"
#include "cgraph.h"
#include "fold-const.h"
+#include "fold-const-call.h"
#include "stor-layout.h"
#include "tree-dfa.h"
#include "builtins.h"
diff --git a/gcc/ggc-none.c b/gcc/ggc-none.c
index 6edec27868c..737429f9e49 100644
--- a/gcc/ggc-none.c
+++ b/gcc/ggc-none.c
@@ -72,3 +72,8 @@ void
ggc_grow (void)
{
}
+
+void
+ggc_trim (void)
+{
+}
diff --git a/gcc/ggc-page.c b/gcc/ggc-page.c
index 143986be58f..3c9636d0fe7 100644
--- a/gcc/ggc-page.c
+++ b/gcc/ggc-page.c
@@ -1016,6 +1016,8 @@ free_page (page_entry *entry)
static void
release_pages (void)
{
+ size_t n1 = 0;
+ size_t n2 = 0;
#ifdef USING_MADVISE
page_entry *p, *start_p;
char *start;
@@ -1061,6 +1063,7 @@ release_pages (void)
else
G.free_pages = p;
G.bytes_mapped -= mapped_len;
+ n1 += len;
continue;
}
prev = newprev;
@@ -1092,6 +1095,7 @@ release_pages (void)
/* Don't count those pages as mapped to not touch the garbage collector
unnecessarily. */
G.bytes_mapped -= len;
+ n2 += len;
while (start_p != p)
{
start_p->discarded = true;
@@ -1124,6 +1128,7 @@ release_pages (void)
}
munmap (start, len);
+ n1 += len;
G.bytes_mapped -= len;
}
@@ -1151,11 +1156,21 @@ release_pages (void)
{
*gp = g->next;
G.bytes_mapped -= g->alloc_size;
+ n1 += g->alloc_size;
free (g->allocation);
}
else
gp = &g->next;
#endif
+ if (!quiet_flag && (n1 || n2))
+ {
+ fprintf (stderr, " {GC");
+ if (n1)
+ fprintf (stderr, " released %luk", (unsigned long)(n1 / 1024));
+ if (n2)
+ fprintf (stderr, " madv_dontneed %luk", (unsigned long)(n2 / 1024));
+ fprintf (stderr, "}");
+ }
}
/* This table provides a fast way to determine ceil(log_2(size)) for
@@ -2178,19 +2193,22 @@ ggc_collect (void)
return;
timevar_push (TV_GC);
- if (!quiet_flag)
- fprintf (stderr, " {GC %luk -> ", (unsigned long) G.allocated / 1024);
if (GGC_DEBUG_LEVEL >= 2)
fprintf (G.debug_file, "BEGIN COLLECTING\n");
/* Zero the total allocated bytes. This will be recalculated in the
sweep phase. */
+ size_t allocated = G.allocated;
G.allocated = 0;
/* Release the pages we freed the last time we collected, but didn't
reuse in the interim. */
release_pages ();
+ /* Output this later so we do not interfere with release_pages. */
+ if (!quiet_flag)
+ fprintf (stderr, " {GC %luk -> ", (unsigned long) allocated / 1024);
+
/* Indicate that we've seen collections at this context depth. */
G.context_depth_collections = ((unsigned long)1 << (G.context_depth + 1)) - 1;
@@ -2221,9 +2239,25 @@ ggc_collect (void)
fprintf (G.debug_file, "END COLLECTING\n");
}
-/* Assume that all GGC memory is reachable and grow the limits for next collection.
- With checking, trigger GGC so -Q compilation outputs how much of memory really is
- reachable. */
+/* Return free pages to the system. */
+
+void
+ggc_trim ()
+{
+ timevar_push (TV_GC);
+ G.allocated = 0;
+ sweep_pages ();
+ release_pages ();
+ if (!quiet_flag)
+ fprintf (stderr, " {GC trimmed to %luk, %luk mapped}",
+ (unsigned long) G.allocated / 1024,
+ (unsigned long) G.bytes_mapped / 1024);
+ timevar_pop (TV_GC);
+}
+
+/* Assume that all GGC memory is reachable and grow the limits for next
+ collection. With checking, trigger GGC so -Q compilation outputs how much
+ of memory really is reachable. */
void
ggc_grow (void)
@@ -2556,6 +2590,9 @@ ggc_pch_read (FILE *f, void *addr)
count_old_page_tables = G.by_depth_in_use;
+ if (fread (&d, sizeof (d), 1, f) != 1)
+ fatal_error (input_location, "cannot read PCH file: %m");
+
/* We've just read in a PCH file. So, every object that used to be
allocated is now free. */
clear_marks ();
@@ -2584,8 +2621,6 @@ ggc_pch_read (FILE *f, void *addr)
/* Allocate the appropriate page-table entries for the pages read from
the PCH file. */
- if (fread (&d, sizeof (d), 1, f) != 1)
- fatal_error (input_location, "can%'t read PCH file: %m");
for (i = 0; i < NUM_ORDERS; i++)
{
diff --git a/gcc/ggc.h b/gcc/ggc.h
index 60273f2e57d..31606dc843f 100644
--- a/gcc/ggc.h
+++ b/gcc/ggc.h
@@ -243,6 +243,9 @@ extern const char *ggc_alloc_string (const char *contents, int length
function is called, not during allocations. */
extern void ggc_collect (void);
+/* Return unused memory pages to the system. */
+extern void ggc_trim (void);
+
/* Assume that all GGC memory is reachable and grow the limits for next collection. */
extern void ggc_grow (void);
diff --git a/gcc/gimple-fold.c b/gcc/gimple-fold.c
index f30818042ee..d00f1e2b035 100644
--- a/gcc/gimple-fold.c
+++ b/gcc/gimple-fold.c
@@ -6557,6 +6557,7 @@ gimple_fold_stmt_to_constant_1 (gimple *stmt, tree (*valueize) (tree),
fn = (*valueize) (gimple_call_fn (stmt));
if (TREE_CODE (fn) == ADDR_EXPR
+ && TREE_CODE (TREE_OPERAND (fn, 0)) == FUNCTION_DECL
&& fndecl_built_in_p (TREE_OPERAND (fn, 0))
&& gimple_builtin_call_types_compatible_p (stmt,
TREE_OPERAND (fn, 0)))
diff --git a/gcc/gimple-streamer-out.c b/gcc/gimple-streamer-out.c
index 34b8d6fda7d..7185c07f36b 100644
--- a/gcc/gimple-streamer-out.c
+++ b/gcc/gimple-streamer-out.c
@@ -57,7 +57,7 @@ output_phi (struct output_block *ob, gphi *phi)
/* Emit statement STMT on the main stream of output block OB. */
static void
-output_gimple_stmt (struct output_block *ob, gimple *stmt)
+output_gimple_stmt (struct output_block *ob, struct function *fn, gimple *stmt)
{
unsigned i;
enum gimple_code code;
@@ -80,7 +80,7 @@ output_gimple_stmt (struct output_block *ob, gimple *stmt)
as_a <gassign *> (stmt)),
1);
bp_pack_value (&bp, gimple_has_volatile_ops (stmt), 1);
- hist = gimple_histogram_value (cfun, stmt);
+ hist = gimple_histogram_value (fn, stmt);
bp_pack_value (&bp, hist != NULL, 1);
bp_pack_var_len_unsigned (&bp, stmt->subcode);
@@ -139,7 +139,7 @@ output_gimple_stmt (struct output_block *ob, gimple *stmt)
so that we do not have to deal with type mismatches on
merged symbols during IL read in. The first operand
of GIMPLE_DEBUG must be a decl, not MEM_REF, though. */
- if (op && (i || !is_gimple_debug (stmt)))
+ if (!flag_wpa && op && (i || !is_gimple_debug (stmt)))
{
basep = &op;
if (TREE_CODE (*basep) == ADDR_EXPR)
@@ -147,7 +147,7 @@ output_gimple_stmt (struct output_block *ob, gimple *stmt)
while (handled_component_p (*basep))
basep = &TREE_OPERAND (*basep, 0);
if (VAR_P (*basep)
- && !auto_var_in_fn_p (*basep, current_function_decl)
+ && !auto_var_in_fn_p (*basep, fn->decl)
&& !DECL_REGISTER (*basep))
{
bool volatilep = TREE_THIS_VOLATILE (*basep);
@@ -228,7 +228,7 @@ output_bb (struct output_block *ob, basic_block bb, struct function *fn)
print_gimple_stmt (streamer_dump_file, stmt, 0, TDF_SLIM);
}
- output_gimple_stmt (ob, stmt);
+ output_gimple_stmt (ob, fn, stmt);
/* Emit the EH region holding STMT. */
region = lookup_stmt_eh_lp_fn (fn, stmt);
diff --git a/gcc/gimplify.c b/gcc/gimplify.c
index 98408b981dc..a0cb6c402bc 100644
--- a/gcc/gimplify.c
+++ b/gcc/gimplify.c
@@ -7058,6 +7058,8 @@ omp_default_clause (struct gimplify_omp_ctx *ctx, tree decl,
kind = lang_hooks.decls.omp_predetermined_sharing (decl);
if (kind != OMP_CLAUSE_DEFAULT_UNSPECIFIED)
default_kind = kind;
+ else if (VAR_P (decl) && TREE_STATIC (decl) && DECL_IN_CONSTANT_POOL (decl))
+ default_kind = OMP_CLAUSE_DEFAULT_SHARED;
switch (default_kind)
{
@@ -8716,8 +8718,8 @@ gimplify_scan_omp_clauses (tree *list_p, gimple_seq *pre_p,
break;
if (scp)
continue;
- gcc_assert (offset == NULL_TREE
- || poly_int_tree_p (offset));
+ gcc_assert (offset2 == NULL_TREE
+ || poly_int_tree_p (offset2));
tree d1 = OMP_CLAUSE_DECL (*sc);
tree d2 = OMP_CLAUSE_DECL (c);
while (TREE_CODE (d1) == ARRAY_REF)
diff --git a/gcc/go/gofrontend/expressions.cc b/gcc/go/gofrontend/expressions.cc
index 6f9775dd5a2..859c1ece5da 100644
--- a/gcc/go/gofrontend/expressions.cc
+++ b/gcc/go/gofrontend/expressions.cc
@@ -2036,7 +2036,11 @@ class Integer_expression : public Expression
int
do_inlining_cost() const
- { return 1; }
+ {
+ if (this->type_ != NULL && this->type_->named_type() != NULL)
+ return 0x100000;
+ return 1;
+ }
void
do_export(Export_function_body*) const;
@@ -2451,7 +2455,11 @@ class Float_expression : public Expression
int
do_inlining_cost() const
- { return 1; }
+ {
+ if (this->type_ != NULL && this->type_->named_type() != NULL)
+ return 0x100000;
+ return 1;
+ }
void
do_export(Export_function_body*) const;
@@ -2664,7 +2672,11 @@ class Complex_expression : public Expression
int
do_inlining_cost() const
- { return 2; }
+ {
+ if (this->type_ != NULL && this->type_->named_type() != NULL)
+ return 0x100000;
+ return 2;
+ }
void
do_export(Export_function_body*) const;
diff --git a/gcc/internal-fn.c b/gcc/internal-fn.c
index 04081f36c4d..95788dfee7d 100644
--- a/gcc/internal-fn.c
+++ b/gcc/internal-fn.c
@@ -1407,7 +1407,7 @@ expand_mul_overflow (location_t loc, tree lhs, tree arg0, tree arg1,
/* s1 * s2 -> ur */
if (!uns0_p && !uns1_p && unsr_p)
{
- rtx tem, tem2;
+ rtx tem;
switch (pos_neg0 | pos_neg1)
{
case 1: /* Both operands known to be non-negative. */
@@ -1437,10 +1437,8 @@ expand_mul_overflow (location_t loc, tree lhs, tree arg0, tree arg1,
ops.op2 = NULL_TREE;
ops.location = loc;
res = expand_expr_real_2 (&ops, NULL_RTX, mode, EXPAND_NORMAL);
- tem = expand_binop (mode, and_optab, op0, op1, NULL_RTX, false,
- OPTAB_LIB_WIDEN);
- do_compare_rtx_and_jump (tem, const0_rtx, EQ, true, mode,
- NULL_RTX, NULL, done_label,
+ do_compare_rtx_and_jump (pos_neg0 == 1 ? op0 : op1, const0_rtx, EQ,
+ true, mode, NULL_RTX, NULL, done_label,
profile_probability::very_likely ());
goto do_error_label;
}
@@ -1471,16 +1469,23 @@ expand_mul_overflow (location_t loc, tree lhs, tree arg0, tree arg1,
arg1 = error_mark_node;
emit_jump (do_main_label);
emit_label (after_negate_label);
- tem2 = expand_binop (mode, xor_optab, op0, op1, NULL_RTX, false,
- OPTAB_LIB_WIDEN);
- do_compare_rtx_and_jump (tem2, const0_rtx, GE, false, mode, NULL_RTX,
- NULL, do_main_label, profile_probability::very_likely ());
+ tem = expand_binop (mode, xor_optab, op0, op1, NULL_RTX, false,
+ OPTAB_LIB_WIDEN);
+ do_compare_rtx_and_jump (tem, const0_rtx, GE, false, mode, NULL_RTX,
+ NULL, do_main_label,
+ profile_probability::very_likely ());
/* One argument is negative here, the other positive. This
overflows always, unless one of the arguments is 0. But
if e.g. s2 is 0, (U) s1 * 0 doesn't overflow, whatever s1
is, thus we can keep do_main code oring in overflow as is. */
- do_compare_rtx_and_jump (tem, const0_rtx, EQ, true, mode, NULL_RTX,
- NULL, do_main_label, profile_probability::very_likely ());
+ if (pos_neg0 != 2)
+ do_compare_rtx_and_jump (op0, const0_rtx, EQ, true, mode, NULL_RTX,
+ NULL, do_main_label,
+ profile_probability::very_unlikely ());
+ if (pos_neg1 != 2)
+ do_compare_rtx_and_jump (op1, const0_rtx, EQ, true, mode, NULL_RTX,
+ NULL, do_main_label,
+ profile_probability::very_unlikely ());
expand_arith_set_overflow (lhs, target);
emit_label (do_main_label);
goto do_main;
diff --git a/gcc/ipa-cp.c b/gcc/ipa-cp.c
index 32b352328a9..d414632e602 100644
--- a/gcc/ipa-cp.c
+++ b/gcc/ipa-cp.c
@@ -5190,4 +5190,5 @@ ipa_cp_c_finalize (void)
max_count = profile_count::uninitialized ();
overall_size = 0;
max_new_size = 0;
+ ipcp_free_transformation_sum ();
}
diff --git a/gcc/ipa-prop.c b/gcc/ipa-prop.c
index d86c2f3db55..848180aa441 100644
--- a/gcc/ipa-prop.c
+++ b/gcc/ipa-prop.c
@@ -3725,6 +3725,18 @@ ipcp_transformation_initialize (void)
ipcp_transformation_sum = ipcp_transformation_t::create_ggc (symtab);
}
+/* Release the IPA CP transformation summary. */
+
+void
+ipcp_free_transformation_sum (void)
+{
+ if (!ipcp_transformation_sum)
+ return;
+
+ ipcp_transformation_sum->release ();
+ ipcp_transformation_sum = NULL;
+}
+
/* Set the aggregate replacements of NODE to be AGGVALS. */
void
diff --git a/gcc/ipa-prop.h b/gcc/ipa-prop.h
index 7257a6d04f1..5ab3d07a6de 100644
--- a/gcc/ipa-prop.h
+++ b/gcc/ipa-prop.h
@@ -558,6 +558,7 @@ struct GTY(()) ipcp_transformation
void ipa_set_node_agg_value_chain (struct cgraph_node *node,
struct ipa_agg_replacement_value *aggvals);
void ipcp_transformation_initialize (void);
+void ipcp_free_transformation_sum (void);
/* ipa_edge_args stores information related to a callsite and particularly its
arguments. It can be accessed by the IPA_EDGE_REF macro. */
diff --git a/gcc/ira.c b/gcc/ira.c
index fd481d6e0e2..b330f2a287b 100644
--- a/gcc/ira.c
+++ b/gcc/ira.c
@@ -5198,6 +5198,8 @@ ira (FILE *f)
int ira_max_point_before_emit;
bool saved_flag_caller_saves = flag_caller_saves;
enum ira_region saved_flag_ira_region = flag_ira_region;
+ unsigned int i;
+ int num_used_regs = 0;
clear_bb_flags ();
@@ -5213,12 +5215,17 @@ ira (FILE *f)
ira_conflicts_p = optimize > 0;
+ /* Determine the number of pseudos actually requiring coloring. */
+ for (i = FIRST_PSEUDO_REGISTER; i < DF_REG_SIZE (df); i++)
+ num_used_regs += !!(DF_REG_USE_COUNT (i) + DF_REG_DEF_COUNT (i));
+
/* If there are too many pseudos and/or basic blocks (e.g. 10K
pseudos and 10K blocks or 100K pseudos and 1K blocks), we will
use simplified and faster algorithms in LRA. */
lra_simple_p
= (ira_use_lra_p
- && max_reg_num () >= (1 << 26) / last_basic_block_for_fn (cfun));
+ && num_used_regs >= (1 << 26) / last_basic_block_for_fn (cfun));
+
if (lra_simple_p)
{
/* It permits to skip live range splitting in LRA. */
diff --git a/gcc/lto-streamer-out.c b/gcc/lto-streamer-out.c
index e07085770a5..42f382ecf21 100644
--- a/gcc/lto-streamer-out.c
+++ b/gcc/lto-streamer-out.c
@@ -43,6 +43,7 @@ along with GCC; see the file COPYING3. If not see
#include "debug.h"
#include "omp-offload.h"
#include "print-tree.h"
+#include "tree-dfa.h"
static void lto_write_tree (struct output_block*, tree, bool);
@@ -1891,7 +1892,7 @@ output_cfg (struct output_block *ob, struct function *fn)
streamer_write_hwi (ob, -1);
- bb = ENTRY_BLOCK_PTR_FOR_FN (cfun);
+ bb = ENTRY_BLOCK_PTR_FOR_FN (fn);
while (bb->next_bb)
{
streamer_write_hwi (ob, bb->next_bb->index);
@@ -1900,9 +1901,6 @@ output_cfg (struct output_block *ob, struct function *fn)
streamer_write_hwi (ob, -1);
- /* ??? The cfgloop interface is tied to cfun. */
- gcc_assert (cfun == fn);
-
/* Output the number of loops. */
streamer_write_uhwi (ob, number_of_loops (fn));
@@ -2063,6 +2061,62 @@ collect_block_tree_leafs (tree root, vec<tree> &leafs)
collect_block_tree_leafs (BLOCK_SUBBLOCKS (root), leafs);
}
+/* This performs function body modifications that are needed for streaming
+ to work. */
+
+void
+lto_prepare_function_for_streaming (struct cgraph_node *node)
+{
+ struct function *fn = DECL_STRUCT_FUNCTION (node->decl);
+ basic_block bb;
+
+ if (number_of_loops (fn))
+ {
+ push_cfun (fn);
+ loop_optimizer_init (AVOID_CFG_MODIFICATIONS);
+ loop_optimizer_finalize ();
+ pop_cfun ();
+ }
+ /* We will renumber the statements. The code that does this uses
+ the same ordering that we use for serializing them so we can use
+ the same code on the other end and not have to write out the
+ statement numbers. We do not assign UIDs to PHIs here because
+ virtual PHIs get re-computed on-the-fly which would make numbers
+ inconsistent. */
+ set_gimple_stmt_max_uid (fn, 0);
+ FOR_ALL_BB_FN (bb, fn)
+ {
+ for (gphi_iterator gsi = gsi_start_phis (bb); !gsi_end_p (gsi);
+ gsi_next (&gsi))
+ {
+ gphi *stmt = gsi.phi ();
+
+ /* Virtual PHIs are not going to be streamed. */
+ if (!virtual_operand_p (gimple_phi_result (stmt)))
+ gimple_set_uid (stmt, inc_gimple_stmt_max_uid (fn));
+ }
+ for (gimple_stmt_iterator gsi = gsi_start_bb (bb); !gsi_end_p (gsi);
+ gsi_next (&gsi))
+ {
+ gimple *stmt = gsi_stmt (gsi);
+ gimple_set_uid (stmt, inc_gimple_stmt_max_uid (fn));
+ }
+ }
+ /* To avoid keeping duplicate gimple IDs in the statements, renumber
+ virtual phis now. */
+ FOR_ALL_BB_FN (bb, fn)
+ {
+ for (gphi_iterator gsi = gsi_start_phis (bb); !gsi_end_p (gsi);
+ gsi_next (&gsi))
+ {
+ gphi *stmt = gsi.phi ();
+ if (virtual_operand_p (gimple_phi_result (stmt)))
+ gimple_set_uid (stmt, inc_gimple_stmt_max_uid (fn));
+ }
+ }
+
+}
+
/* Output the body of function NODE->DECL. */
static void
@@ -2086,9 +2140,6 @@ output_function (struct cgraph_node *node)
gcc_assert (current_function_decl == NULL_TREE && cfun == NULL);
- /* Set current_function_decl and cfun. */
- push_cfun (fn);
-
/* Make string 0 be a NULL string. */
streamer_write_char_stream (ob->string_stream, 0);
@@ -2125,9 +2176,6 @@ output_function (struct cgraph_node *node)
debug info. */
if (gimple_has_body_p (function))
{
- /* Fixup loops if required to match discovery done in the reader. */
- loop_optimizer_init (AVOID_CFG_MODIFICATIONS);
-
streamer_write_uhwi (ob, 1);
output_struct_function_base (ob, fn);
@@ -2137,45 +2185,6 @@ output_function (struct cgraph_node *node)
/* Output any exception handling regions. */
output_eh_regions (ob, fn);
-
- /* We will renumber the statements. The code that does this uses
- the same ordering that we use for serializing them so we can use
- the same code on the other end and not have to write out the
- statement numbers. We do not assign UIDs to PHIs here because
- virtual PHIs get re-computed on-the-fly which would make numbers
- inconsistent. */
- set_gimple_stmt_max_uid (cfun, 0);
- FOR_ALL_BB_FN (bb, cfun)
- {
- for (gphi_iterator gsi = gsi_start_phis (bb); !gsi_end_p (gsi);
- gsi_next (&gsi))
- {
- gphi *stmt = gsi.phi ();
-
- /* Virtual PHIs are not going to be streamed. */
- if (!virtual_operand_p (gimple_phi_result (stmt)))
- gimple_set_uid (stmt, inc_gimple_stmt_max_uid (cfun));
- }
- for (gimple_stmt_iterator gsi = gsi_start_bb (bb); !gsi_end_p (gsi);
- gsi_next (&gsi))
- {
- gimple *stmt = gsi_stmt (gsi);
- gimple_set_uid (stmt, inc_gimple_stmt_max_uid (cfun));
- }
- }
- /* To avoid keeping duplicate gimple IDs in the statements, renumber
- virtual phis now. */
- FOR_ALL_BB_FN (bb, cfun)
- {
- for (gphi_iterator gsi = gsi_start_phis (bb); !gsi_end_p (gsi);
- gsi_next (&gsi))
- {
- gphi *stmt = gsi.phi ();
- if (virtual_operand_p (gimple_phi_result (stmt)))
- gimple_set_uid (stmt, inc_gimple_stmt_max_uid (cfun));
- }
- }
-
/* Output the code for the function. */
FOR_ALL_BB_FN (bb, fn)
output_bb (ob, bb, fn);
@@ -2184,9 +2193,6 @@ output_function (struct cgraph_node *node)
streamer_write_record_start (ob, LTO_null);
output_cfg (ob, fn);
-
- loop_optimizer_finalize ();
- pop_cfun ();
}
else
streamer_write_uhwi (ob, 0);
diff --git a/gcc/lto-streamer.h b/gcc/lto-streamer.h
index 04b79dbce3b..ac3ecc9e5ed 100644
--- a/gcc/lto-streamer.h
+++ b/gcc/lto-streamer.h
@@ -879,6 +879,7 @@ void lto_output_decl_state_refs (struct output_block *,
struct lto_out_decl_state *);
void lto_output_location (struct output_block *, struct bitpack_d *, location_t);
void lto_output_init_mode_table (void);
+void lto_prepare_function_for_streaming (cgraph_node *);
/* In lto-cgraph.c */
diff --git a/gcc/lto/ChangeLog b/gcc/lto/ChangeLog
index eb2653be616..e381db79f17 100644
--- a/gcc/lto/ChangeLog
+++ b/gcc/lto/ChangeLog
@@ -1,3 +1,28 @@
+2019-11-08 Jakub Jelinek <jakub@redhat.com>
+
+ Backported from mainline
+ 2019-10-31 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/92231
+ * lto-lang.c (handle_const_attribute): Don't call fndecl_built_in_p
+ on *node that is not FUNCTION_DECL.
+
+2019-10-26 Jan Hubicka <hubicka@ucw.cz>
+
+ Backport from mainline
+
+ 2019-10-12 Jan Hubicka <hubicka@ucw.cz>
+ * lto.c (lto_wpa_write_files): Do not update bodies of clones.
+
+ 2019-10-11 Jan Hubicka <hubicka@ucw.cz>
+ * lto.c (lto_wpa_write_files): Prepare all bodies for streaming.
+
+2019-10-25 Jan Hubicka <hubicka@ucw.cz>
+
+ Backport from mainline
+ * lto-partition.c (add_symbol_to_partition_1): Update.
+ (undo_parittion): Update.
+
2019-08-12 Release Manager
* GCC 9.2.0 released.
diff --git a/gcc/lto/lto-lang.c b/gcc/lto/lto-lang.c
index 5a35d4794c2..4ef228fcb45 100644
--- a/gcc/lto/lto-lang.c
+++ b/gcc/lto/lto-lang.c
@@ -303,7 +303,8 @@ handle_const_attribute (tree *node, tree ARG_UNUSED (name),
tree ARG_UNUSED (args), int ARG_UNUSED (flags),
bool * ARG_UNUSED (no_add_attrs))
{
- if (!fndecl_built_in_p (*node))
+ if (TREE_CODE (*node) != FUNCTION_DECL
+ || !fndecl_built_in_p (*node))
inform (UNKNOWN_LOCATION, "%s:%s: %E: %E", __FILE__, __func__, *node, name);
tree type = TREE_TYPE (*node);
diff --git a/gcc/lto/lto.c b/gcc/lto/lto.c
index 4367928a515..4dde8c001e1 100644
--- a/gcc/lto/lto.c
+++ b/gcc/lto/lto.c
@@ -2446,6 +2446,15 @@ lto_wpa_write_files (void)
timevar_push (TV_WHOPR_WPA_IO);
+ ggc_trim ();
+
+ cgraph_node *node;
+ /* Do body modifications needed for streaming before we fork out
+ worker processes. */
+ FOR_EACH_FUNCTION_WITH_GIMPLE_BODY (node)
+ if (!node->clone_of && gimple_has_body_p (node->decl))
+ lto_prepare_function_for_streaming (node);
+
/* Generate a prefix for the LTRANS unit files. */
blen = strlen (ltrans_output_list);
temp_filename = (char *) xmalloc (blen + sizeof ("2147483648.o"));
diff --git a/gcc/match.pd b/gcc/match.pd
index 039ddacfed1..bd3e3bf1ae9 100644
--- a/gcc/match.pd
+++ b/gcc/match.pd
@@ -1519,8 +1519,6 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
tree etype = range_check_type (TREE_TYPE (@0));
if (etype)
{
- if (! TYPE_UNSIGNED (etype))
- etype = unsigned_type_for (etype);
hi = fold_convert (etype, hi);
lo = fold_convert (etype, lo);
hi = const_binop (MINUS_EXPR, etype, hi, lo);
@@ -3381,8 +3379,7 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
(cmp { tem; } @1)))))
/* Fold comparisons against built-in math functions. */
- (if (flag_unsafe_math_optimizations
- && ! flag_errno_math)
+ (if (flag_unsafe_math_optimizations && ! flag_errno_math)
(for sq (SQRT)
(simplify
(cmp (sq @0) REAL_CST@1)
@@ -3417,56 +3414,108 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
if x is negative or NaN. Due to -funsafe-math-optimizations,
the results for other x follow from natural arithmetic. */
(cmp @0 @1)))
- (if (cmp == GT_EXPR || cmp == GE_EXPR)
+ (if ((cmp == LT_EXPR
+ || cmp == LE_EXPR
+ || cmp == GT_EXPR
+ || cmp == GE_EXPR)
+ && !REAL_VALUE_ISNAN (TREE_REAL_CST (@1))
+ /* Give up for -frounding-math. */
+ && !HONOR_SIGN_DEPENDENT_ROUNDING (TREE_TYPE (@0)))
(with
{
- REAL_VALUE_TYPE c2;
+ REAL_VALUE_TYPE c2;
+ enum tree_code ncmp = cmp;
+ const real_format *fmt
+ = REAL_MODE_FORMAT (TYPE_MODE (TREE_TYPE (@0)));
real_arithmetic (&c2, MULT_EXPR,
&TREE_REAL_CST (@1), &TREE_REAL_CST (@1));
- real_convert (&c2, TYPE_MODE (TREE_TYPE (@0)), &c2);
- }
- (if (REAL_VALUE_ISINF (c2))
- /* sqrt(x) > y is x == +Inf, when y is very large. */
- (if (HONOR_INFINITIES (@0))
- (eq @0 { build_real (TREE_TYPE (@0), c2); })
- { constant_boolean_node (false, type); })
- /* sqrt(x) > c is the same as x > c*c. */
- (cmp @0 { build_real (TREE_TYPE (@0), c2); }))))
- (if (cmp == LT_EXPR || cmp == LE_EXPR)
- (with
- {
- REAL_VALUE_TYPE c2;
- real_arithmetic (&c2, MULT_EXPR,
- &TREE_REAL_CST (@1), &TREE_REAL_CST (@1));
- real_convert (&c2, TYPE_MODE (TREE_TYPE (@0)), &c2);
+ real_convert (&c2, fmt, &c2);
+ /* See PR91734: if c2 is inexact and sqrt(c2) < c (or sqrt(c2) >= c),
+ then change LT_EXPR into LE_EXPR or GE_EXPR into GT_EXPR. */
+ if (!REAL_VALUE_ISINF (c2))
+ {
+ tree c3 = fold_const_call (CFN_SQRT, TREE_TYPE (@0),
+ build_real (TREE_TYPE (@0), c2));
+ if (c3 == NULL_TREE || TREE_CODE (c3) != REAL_CST)
+ ncmp = ERROR_MARK;
+ else if ((cmp == LT_EXPR || cmp == GE_EXPR)
+ && real_less (&TREE_REAL_CST (c3), &TREE_REAL_CST (@1)))
+ ncmp = cmp == LT_EXPR ? LE_EXPR : GT_EXPR;
+ else if ((cmp == LE_EXPR || cmp == GT_EXPR)
+ && real_less (&TREE_REAL_CST (@1), &TREE_REAL_CST (c3)))
+ ncmp = cmp == LE_EXPR ? LT_EXPR : GE_EXPR;
+ else
+ {
+ /* With rounding to even, sqrt of up to 3 different values
+ gives the same normal result, so in some cases c2 needs
+ to be adjusted. */
+ REAL_VALUE_TYPE c2alt, tow;
+ if (cmp == LT_EXPR || cmp == GE_EXPR)
+ tow = dconst0;
+ else
+ real_inf (&tow);
+ real_nextafter (&c2alt, fmt, &c2, &tow);
+ real_convert (&c2alt, fmt, &c2alt);
+ if (REAL_VALUE_ISINF (c2alt))
+ ncmp = ERROR_MARK;
+ else
+ {
+ c3 = fold_const_call (CFN_SQRT, TREE_TYPE (@0),
+ build_real (TREE_TYPE (@0), c2alt));
+ if (c3 == NULL_TREE || TREE_CODE (c3) != REAL_CST)
+ ncmp = ERROR_MARK;
+ else if (real_equal (&TREE_REAL_CST (c3),
+ &TREE_REAL_CST (@1)))
+ c2 = c2alt;
+ }
+ }
+ }
}
- (if (REAL_VALUE_ISINF (c2))
- (switch
- /* sqrt(x) < y is always true, when y is a very large
- value and we don't care about NaNs or Infinities. */
- (if (! HONOR_NANS (@0) && ! HONOR_INFINITIES (@0))
- { constant_boolean_node (true, type); })
- /* sqrt(x) < y is x != +Inf when y is very large and we
- don't care about NaNs. */
- (if (! HONOR_NANS (@0))
- (ne @0 { build_real (TREE_TYPE (@0), c2); }))
- /* sqrt(x) < y is x >= 0 when y is very large and we
- don't care about Infinities. */
- (if (! HONOR_INFINITIES (@0))
- (ge @0 { build_real (TREE_TYPE (@0), dconst0); }))
- /* sqrt(x) < y is x >= 0 && x != +Inf, when y is large. */
- (if (GENERIC)
- (truth_andif
- (ge @0 { build_real (TREE_TYPE (@0), dconst0); })
- (ne @0 { build_real (TREE_TYPE (@0), c2); }))))
- /* sqrt(x) < c is the same as x < c*c, if we ignore NaNs. */
- (if (! HONOR_NANS (@0))
- (cmp @0 { build_real (TREE_TYPE (@0), c2); })
- /* sqrt(x) < c is the same as x >= 0 && x < c*c. */
- (if (GENERIC)
- (truth_andif
- (ge @0 { build_real (TREE_TYPE (@0), dconst0); })
- (cmp @0 { build_real (TREE_TYPE (@0), c2); })))))))))
+ (if (cmp == GT_EXPR || cmp == GE_EXPR)
+ (if (REAL_VALUE_ISINF (c2))
+ /* sqrt(x) > y is x == +Inf, when y is very large. */
+ (if (HONOR_INFINITIES (@0))
+ (eq @0 { build_real (TREE_TYPE (@0), c2); })
+ { constant_boolean_node (false, type); })
+ /* sqrt(x) > c is the same as x > c*c. */
+ (if (ncmp != ERROR_MARK)
+ (if (ncmp == GE_EXPR)
+ (ge @0 { build_real (TREE_TYPE (@0), c2); })
+ (gt @0 { build_real (TREE_TYPE (@0), c2); }))))
+ /* else if (cmp == LT_EXPR || cmp == LE_EXPR) */
+ (if (REAL_VALUE_ISINF (c2))
+ (switch
+ /* sqrt(x) < y is always true, when y is a very large
+ value and we don't care about NaNs or Infinities. */
+ (if (! HONOR_NANS (@0) && ! HONOR_INFINITIES (@0))
+ { constant_boolean_node (true, type); })
+ /* sqrt(x) < y is x != +Inf when y is very large and we
+ don't care about NaNs. */
+ (if (! HONOR_NANS (@0))
+ (ne @0 { build_real (TREE_TYPE (@0), c2); }))
+ /* sqrt(x) < y is x >= 0 when y is very large and we
+ don't care about Infinities. */
+ (if (! HONOR_INFINITIES (@0))
+ (ge @0 { build_real (TREE_TYPE (@0), dconst0); }))
+ /* sqrt(x) < y is x >= 0 && x != +Inf, when y is large. */
+ (if (GENERIC)
+ (truth_andif
+ (ge @0 { build_real (TREE_TYPE (@0), dconst0); })
+ (ne @0 { build_real (TREE_TYPE (@0), c2); }))))
+ /* sqrt(x) < c is the same as x < c*c, if we ignore NaNs. */
+ (if (ncmp != ERROR_MARK && ! HONOR_NANS (@0))
+ (if (ncmp == LT_EXPR)
+ (lt @0 { build_real (TREE_TYPE (@0), c2); })
+ (le @0 { build_real (TREE_TYPE (@0), c2); }))
+ /* sqrt(x) < c is the same as x >= 0 && x < c*c. */
+ (if (ncmp != ERROR_MARK && GENERIC)
+ (if (ncmp == LT_EXPR)
+ (truth_andif
+ (ge @0 { build_real (TREE_TYPE (@0), dconst0); })
+ (lt @0 { build_real (TREE_TYPE (@0), c2); }))
+ (truth_andif
+ (ge @0 { build_real (TREE_TYPE (@0), dconst0); })
+ (le @0 { build_real (TREE_TYPE (@0), c2); })))))))))))
/* Transform sqrt(x) cmp sqrt(y) -> x cmp y. */
(simplify
(cmp (sq @0) (sq @1))
diff --git a/gcc/optabs.c b/gcc/optabs.c
index a0e361b8bfe..7d7efe0a4a2 100644
--- a/gcc/optabs.c
+++ b/gcc/optabs.c
@@ -5819,6 +5819,25 @@ expand_vec_cond_expr (tree vec_cond_type, tree op0, tree op1, tree op2,
icode = get_vcond_icode (mode, cmp_op_mode, unsignedp);
if (icode == CODE_FOR_nothing)
{
+ if (tcode == LT_EXPR
+ && op0a == op0
+ && TREE_CODE (op0) == VECTOR_CST)
+ {
+ /* A VEC_COND_EXPR condition could be folded from EQ_EXPR/NE_EXPR
+ into a constant when only get_vcond_eq_icode is supported.
+ Verify < 0 and != 0 behave the same and change it to NE_EXPR. */
+ unsigned HOST_WIDE_INT nelts;
+ if (!VECTOR_CST_NELTS (op0).is_constant (&nelts))
+ {
+ if (VECTOR_CST_STEPPED_P (op0))
+ return 0;
+ nelts = vector_cst_encoded_nelts (op0);
+ }
+ for (unsigned int i = 0; i < nelts; ++i)
+ if (tree_int_cst_sgn (vector_cst_elt (op0, i)) == 1)
+ return 0;
+ tcode = NE_EXPR;
+ }
if (tcode == EQ_EXPR || tcode == NE_EXPR)
icode = get_vcond_eq_icode (mode, cmp_op_mode);
if (icode == CODE_FOR_nothing)
diff --git a/gcc/optc-save-gen.awk b/gcc/optc-save-gen.awk
index 74096bc5462..cf1c3689eff 100644
--- a/gcc/optc-save-gen.awk
+++ b/gcc/optc-save-gen.awk
@@ -332,7 +332,7 @@ for (i = 0; i < n_opt_string; i++) {
print " indent_to, \"\",";
print " \"" name "\",";
print " ptr1->x_" name " ? ptr1->x_" name " : \"(null)\",";
- print " ptr2->x_" name " ? ptr1->x_" name " : \"(null)\");";
+ print " ptr2->x_" name " ? ptr2->x_" name " : \"(null)\");";
print "";
}
diff --git a/gcc/passes.c b/gcc/passes.c
index 092dafbd488..e071a878301 100644
--- a/gcc/passes.c
+++ b/gcc/passes.c
@@ -2719,20 +2719,12 @@ ipa_write_summaries (void)
{
struct cgraph_node *node = order[i];
- if (gimple_has_body_p (node->decl))
+ if (node->definition && node->need_lto_streaming)
{
- /* When streaming out references to statements as part of some IPA
- pass summary, the statements need to have uids assigned and the
- following does that for all the IPA passes here. Naturally, this
- ordering then matches the one IPA-passes get in their stmt_fixup
- hooks. */
-
- push_cfun (DECL_STRUCT_FUNCTION (node->decl));
- renumber_gimple_stmt_uids ();
- pop_cfun ();
+ if (gimple_has_body_p (node->decl))
+ lto_prepare_function_for_streaming (node);
+ lto_set_symtab_encoder_in_partition (encoder, node);
}
- if (node->definition && node->need_lto_streaming)
- lto_set_symtab_encoder_in_partition (encoder, node);
}
FOR_EACH_DEFINED_FUNCTION (node)
@@ -2800,28 +2792,13 @@ void
ipa_write_optimization_summaries (lto_symtab_encoder_t encoder)
{
struct lto_out_decl_state *state = lto_new_out_decl_state ();
- lto_symtab_encoder_iterator lsei;
state->symtab_node_encoder = encoder;
lto_output_init_mode_table ();
lto_push_out_decl_state (state);
- for (lsei = lsei_start_function_in_partition (encoder);
- !lsei_end_p (lsei); lsei_next_function_in_partition (&lsei))
- {
- struct cgraph_node *node = lsei_cgraph_node (lsei);
- /* When streaming out references to statements as part of some IPA
- pass summary, the statements need to have uids assigned.
-
- For functions newly born at WPA stage we need to initialize
- the uids here. */
- if (node->definition
- && gimple_has_body_p (node->decl))
- {
- push_cfun (DECL_STRUCT_FUNCTION (node->decl));
- renumber_gimple_stmt_uids ();
- pop_cfun ();
- }
- }
+
+ /* Be sure that we did not forget to renumber stmt uids. */
+ gcc_checking_assert (flag_wpa);
gcc_assert (flag_wpa);
pass_manager *passes = g->get_passes ();
diff --git a/gcc/passes.def b/gcc/passes.def
index bc147c4444d..9a859070b26 100644
--- a/gcc/passes.def
+++ b/gcc/passes.def
@@ -434,6 +434,7 @@ along with GCC; see the file COPYING3. If not see
NEXT_PASS (pass_ud_rtl_dce);
NEXT_PASS (pass_combine);
NEXT_PASS (pass_if_after_combine);
+ NEXT_PASS (pass_jump_after_combine);
NEXT_PASS (pass_partition_blocks);
NEXT_PASS (pass_outof_cfg_layout_mode);
NEXT_PASS (pass_split_all_insns);
@@ -450,7 +451,6 @@ along with GCC; see the file COPYING3. If not see
NEXT_PASS (pass_reload);
NEXT_PASS (pass_postreload);
PUSH_INSERT_PASSES_WITHIN (pass_postreload)
- NEXT_PASS (pass_postreload_jump);
NEXT_PASS (pass_postreload_cse);
NEXT_PASS (pass_gcse2);
NEXT_PASS (pass_split_after_reload);
diff --git a/gcc/po/ChangeLog b/gcc/po/ChangeLog
index 0399bd8d166..bf3dc9c10ef 100644
--- a/gcc/po/ChangeLog
+++ b/gcc/po/ChangeLog
@@ -1,3 +1,19 @@
+2019-10-11 Joseph Myers <joseph@codesourcery.com>
+
+ * fi.po: Update.
+
+2019-09-30 Joseph Myers <joseph@codesourcery.com>
+
+ * es.po: Update.
+
+2019-08-31 Joseph Myers <joseph@codesourcery.com>
+
+ * es.po: Update.
+
+2019-08-28 Joseph Myers <joseph@codesourcery.com>
+
+ * es.po: Update.
+
2019-08-23 Joseph Myers <joseph@codesourcery.com>
* zh_CN.po: Update.
diff --git a/gcc/po/es.po b/gcc/po/es.po
index 2f3a21984ac..c6eed017b3f 100644
--- a/gcc/po/es.po
+++ b/gcc/po/es.po
@@ -43,7 +43,7 @@ msgstr ""
"Project-Id-Version: gcc 9.1.0\n"
"Report-Msgid-Bugs-To: https://gcc.gnu.org/bugs/\n"
"POT-Creation-Date: 2019-05-02 20:28+0000\n"
-"PO-Revision-Date: 2019-05-17 05:23+0200\n"
+"PO-Revision-Date: 2019-09-30 17:16+0200\n"
"Last-Translator: Antonio Ceballos Roa <aceballos@gmail.com>\n"
"Language-Team: Spanish <es@tp.org.es>\n"
"Language: es\n"
@@ -174,17 +174,11 @@ msgstr "compilación terminada.\n"
#: diagnostic.c:618
msgid "In file included from"
-msgstr ""
+msgstr "En el fichero incluido desde"
#: diagnostic.c:619
-#, fuzzy
-#| msgid ""
-#| ",\n"
-#| " from %s:%u"
msgid " from"
-msgstr ""
-",\n"
-" de %s:%u"
+msgstr " desde"
#: diagnostic.c:991
#, c-format
@@ -796,10 +790,9 @@ msgstr ""
"%s.\n"
#: gcov-tool.c:528
-#, fuzzy, c-format
-#| msgid "Copyright %s 2018 Free Software Foundation, Inc.\n"
+#, c-format
msgid "Copyright %s 2019 Free Software Foundation, Inc.\n"
-msgstr "Copyright %s 2018 Free Software Foundation, Inc.\n"
+msgstr "Copyright %s 2019 Free Software Foundation, Inc.\n"
#: gcov-tool.c:531 gcov.c:925
#, c-format
@@ -867,10 +860,9 @@ msgid " -h, --help Print this help, then exit\n"
msgstr " -h, --help Muestra esta información, y finaliza\n"
#: gcov.c:894
-#, fuzzy, c-format
-#| msgid " -n, --no-output Do not create an output file\n"
+#, c-format
msgid " -i, --json-format Output JSON intermediate format into .gcov.json.gz file\n"
-msgstr " -n, --no-output No crea un fichero de salida\n"
+msgstr " -i, --json-format Salida con formato JSON intermedia en el fichero .gcov.json.gz\n"
#: gcov.c:895
#, c-format
@@ -912,10 +904,9 @@ msgid " -p, --preserve-paths Preserve all pathname components\n"
msgstr " -p, --preserve-paths Preserva todos los nombres de ruta de los componentes\n"
#: gcov.c:903
-#, fuzzy, c-format
-#| msgid " -k, --use-colors Emit colored output\n"
+#, c-format
msgid " -q, --use-hotness-colors Emit perf-like colored output for hot lines\n"
-msgstr " -k, --use-colors Emite salida con colores\n"
+msgstr " -q, --use-hotness-colors Emite salida con colores de tipo perf para las líneas calientes\n"
#: gcov.c:904
#, c-format
@@ -928,10 +919,9 @@ msgid " -s, --source-prefix DIR Source prefix to elide\n"
msgstr " -s, --source-prefix DIR Prefijo de fuente a omitir\n"
#: gcov.c:906
-#, fuzzy, c-format
-#| msgid " -n, --no-output Do not create an output file\n"
+#, c-format
msgid " -t, --stdout Output to stdout instead of a file\n"
-msgstr " -n, --no-output No crea un fichero de salida\n"
+msgstr " -t, --stdout Salida en stdout en lugar de un fichero\n"
#: gcov.c:907
#, c-format
@@ -959,10 +949,9 @@ msgid "gcov %s%s\n"
msgstr "gcov %s%s\n"
#: gcov.c:1250
-#, fuzzy, c-format
-#| msgid "Treat the input file as already preprocessed."
+#, c-format
msgid "'%s' file is already processed\n"
-msgstr "Trata al fichero de entrada como previamente preprocesado."
+msgstr "El fichero '%s' ya está procesado\n"
#: gcov.c:1364
#, c-format
@@ -990,16 +979,14 @@ msgid "\n"
msgstr "\n"
#: gcov.c:1489
-#, fuzzy, c-format
-#| msgid "%s: Cannot open output file: %s\n"
+#, c-format
msgid "Cannot open JSON output file %s\n"
-msgstr "%s: No se puede abrir el fichero de salida: %s\n"
+msgstr "No se puede abrir el fichero de salida JSON %s\n"
#: gcov.c:1497
-#, fuzzy, c-format
-#| msgid "Error writing output file '%s'\n"
+#, c-format
msgid "Error writing JSON output file %s\n"
-msgstr "Error al escribir el fichero de salida '%s'\n"
+msgstr "Error al escribir el fichero de salida JSON %s\n"
#: gcov.c:1664
#, c-format
@@ -1266,10 +1253,8 @@ msgid "this is the insn:"
msgstr "este es la insn:"
#: lra-constraints.c:2971
-#, fuzzy
-#| msgid "unable to generate reloads for:"
msgid "unable to generate reloads for impossible constraints:"
-msgstr "no se pueden generar recargas para:"
+msgstr "no se pueden generar recargas para restricciones imposibles:"
#: lra-constraints.c:3962 reload.c:3814
msgid "unable to generate reloads for:"
@@ -1327,12 +1312,13 @@ msgid " All options with the desired characteristics have already been displayed
msgstr "Ya se mostraron todas las opciones con las características deseadas\n"
#: opts.c:1581
-#, fuzzy, c-format
-#| msgid "invalid argument %qs to %qs"
+#, c-format
msgid ""
" Known valid arguments for %s option:\n"
" "
-msgstr "argumento %qs no válido para %qs"
+msgstr ""
+" Argumentos válidos conocidos para la opción %s:\n"
+" "
#: opts.c:1631
msgid "The following options are target specific"
@@ -1430,16 +1416,12 @@ msgid "created and used with differing settings of '%s'"
msgstr "creado y usado con diferentes opciones de '%s'"
#: targhooks.c:2038
-#, fuzzy
-#| msgid "created and used with different settings of -fpic"
msgid "created and used with different settings of %<-fpic%>"
-msgstr "creado y usado con diferentes opciones de -fpic"
+msgstr "creado y usado con diferentes opciones de %<-fpic%>"
#: targhooks.c:2040
-#, fuzzy
-#| msgid "created and used with different settings of -fpie"
msgid "created and used with different settings of %<-fpie%>"
-msgstr "creado y usado con diferentes opciones de -fpie"
+msgstr "creado y usado con diferentes opciones de %<-fpie%>"
#: tlink.c:387
#, c-format
@@ -1703,16 +1685,14 @@ msgid "The maximum number of instructions when inlining for size."
msgstr "El número máximo de instrucciones cuando se hace inclusión en línea por tamaño."
#: params.def:97
-#, fuzzy, no-c-format
-#| msgid "Use subroutines for function prologues and epilogues."
+#, no-c-format
msgid "Instruction accounted for function prologue, epilogue and other overhead."
-msgstr "Usa subrutinas para los prólogos y epílogos de función."
+msgstr "Instrucción contabilizada para el prólogo y epílogo de la función y otras sobrecargas."
#: params.def:103
-#, fuzzy, no-c-format
-#| msgid "Use subroutines for function prologues and epilogues."
+#, no-c-format
msgid "Time accounted for function prologue, epilogue and other overhead."
-msgstr "Usa subrutinas para los prólogos y epílogos de función."
+msgstr "Tiempo contabilizado para el prólogo y epílogo de la función y otras sobrecargas."
#: params.def:109
#, no-c-format
@@ -1946,10 +1926,9 @@ msgstr "El número máximo de eliminación de opciones en un solo bucle."
# 'desfactorizar' no me gusta. ¿Alguna sugerencia? - cfuga
#: params.def:393
-#, fuzzy, no-c-format
-#| msgid "The maximum number of insns to duplicate when unfactoring computed gotos."
+#, no-c-format
msgid "The maximum number of insns in loop header duplicated by the copy loop headers pass."
-msgstr "El número máximo de insns a duplicar al desfactorizar gotos calculados."
+msgstr "El número máximo de instrucciones en encabezamiento de bucle a duplicar en el paso de encabezamientos de bucles."
#: params.def:400
#, no-c-format
@@ -1982,16 +1961,14 @@ msgid "A threshold on the average loop count considered by the swing modulo sche
msgstr "Umbral en el número promedio de bucles considerado por el planificador de cambio de módulo."
#: params.def:430
-#, fuzzy, no-c-format
-#| msgid "Select fraction of the maximal count of repetitions of basic block in program given basic block needs to have to be considered hot"
+#, no-c-format
msgid "Select fraction of the maximal count of repetitions of basic block in program given basic block needs to have to be considered hot (used in non-LTO mode)."
-msgstr "La selección de fracción de la cuenta maximal de repeticiones del bloque básico en el bloque básico dado de programa que necesita para ser considerado caliente"
+msgstr "La selección de fracción de la cuenta maximal de repeticiones del bloque básico en el bloque básico dado de programa que necesita para ser considerado caliente (utilizado en modo no LTO)."
#: params.def:435
-#, fuzzy, no-c-format
-#| msgid "A basic block profile count is considered hot if it contributes to the given permillage of the entire profiled execution."
+#, no-c-format
msgid "A basic block profile count is considered hot if it contributes to the given permillage of the entire profiled execution (used in LTO mode)."
-msgstr "El número de perfiles de bloque básicos se considera caliente si contribuye al pormillaje dado de la ejecución perfilada completa."
+msgstr "El número de perfiles de bloque básicos se considera caliente si contribuye al pormillaje dado de la ejecución perfilada completa (utilizado en modo LTO)."
#: params.def:440
#, no-c-format
@@ -2009,8 +1986,7 @@ msgid "Select fraction of the maximal frequency of executions of basic block in
msgstr "Selección de fracción de la frecuencia máxima de ejecuciones de bloque básico en la función dada para la que el bloque básico consigue alinear."
#: params.def:455
-#, fuzzy, no-c-format
-#| msgid "Loops iterating at least selected number of iterations will get loop alignment.."
+#, no-c-format
msgid "Loops iterating at least selected number of iterations will get loop alignment."
msgstr "Iterar ciclos por lo menos el número seleccionado de iteraciones que logrará alineación de bucles."
@@ -2121,10 +2097,9 @@ msgid "Maximum size (in bytes) of objects tracked bytewise by dead store elimina
msgstr "Número máximo (en bytes) de objetos rastreados en btyes por la eliminación de almacenamiento muerto."
#: params.def:593
-#, fuzzy, no-c-format
-#| msgid "Maximum number of times that an insn could be scheduled."
+#, no-c-format
msgid "Maximum number of queries into the alias oracle per store."
-msgstr "El número máximo de veces que se puede planificar una insns."
+msgstr "El número máximo de consultas al oráculo de alias por almacenamiento."
#: params.def:598
#, no-c-format
@@ -2495,22 +2470,19 @@ msgid "Maximum size of a list of values associated with each parameter for inter
msgstr "Tamaño máximo de una lista de valores asociada con cada parámetro para propagación constante entre procedimientos."
#: params.def:1092
-#, fuzzy, no-c-format
-#| msgid "Threshold ipa-cp opportunity evaluation that is still considered beneficial to clone.."
+#, no-c-format
msgid "Threshold ipa-cp opportunity evaluation that is still considered beneficial to clone."
-msgstr "Rango de evaluación de oportunidad ipa-cp que aún se considera beneficioso para clonar.."
+msgstr "Rango de evaluación de oportunidad ipa-cp que aún se considera beneficioso para clonar."
#: params.def:1098
-#, fuzzy, no-c-format
-#| msgid "Percentage penalty the recursive functions will receive when they are evaluated for cloning.."
+#, no-c-format
msgid "Percentage penalty the recursive functions will receive when they are evaluated for cloning."
-msgstr "Penalización porcentual que recibirán las funciones recursivas cuando se evalúen para clonación.."
+msgstr "Penalización porcentual que recibirán las funciones recursivas cuando se evalúen para clonación."
#: params.def:1104
-#, fuzzy, no-c-format
-#| msgid "Percentage penalty functions containing a single call to another function will receive when they are evaluated for cloning.."
+#, no-c-format
msgid "Percentage penalty functions containing a single call to another function will receive when they are evaluated for cloning."
-msgstr "Penalización porcentual que recibirán las funciones que contien una sola llamada a otra función cuando se evalúen para clonación.."
+msgstr "Penalización porcentual que recibirán las funciones que contien una sola llamada a otra función cuando se evalúen para clonación."
#: params.def:1110
#, no-c-format
@@ -2518,16 +2490,14 @@ msgid "Maximum number of aggregate content items for a parameter in jump functio
msgstr "Número máximo de elementos de contenido agregado de un parámetro en funciones de salto y celosías."
#: params.def:1116
-#, fuzzy, no-c-format
-#| msgid "Compile-time bonus IPA-CP assigns to candidates which make loop bounds or strides known.."
+#, no-c-format
msgid "Compile-time bonus IPA-CP assigns to candidates which make loop bounds or strides known."
-msgstr "Bonificación de tiempo de compilación que IPA-CP asigna a los candidatos que dan a conocer los límites o los pasos de los bucles.."
+msgstr "Bonificación de tiempo de compilación que IPA-CP asigna a los candidatos que dan a conocer los límites o los pasos de los bucles."
#: params.def:1122
-#, fuzzy, no-c-format
-#| msgid "Compile-time bonus IPA-CP assigns to candidates which make an array index known.."
+#, no-c-format
msgid "Compile-time bonus IPA-CP assigns to candidates which make an array index known."
-msgstr "Bonificación de tiempo de compilación que IPA-CP asigna a los candidatos que dan conocer el índice de un array.."
+msgstr "Bonificación de tiempo de compilación que IPA-CP asigna a los candidatos que dan conocer el índice de un array."
#: params.def:1128
#, no-c-format
@@ -2576,10 +2546,9 @@ msgid "Allow new data races on stores to be introduced."
msgstr "Permite que se introduzcan carreras de datos nuevos en stores."
#: params.def:1187
-#, fuzzy, no-c-format
-#| msgid "Set the maximum number of instructions executed in parallel in reassociated tree. If 0, use the target dependent heuristic.."
+#, no-c-format
msgid "Set the maximum number of instructions executed in parallel in reassociated tree. If 0, use the target dependent heuristic."
-msgstr "Establece el número máximo de instrucciones ejecutadas en paralelo en el árbol de reasociación. Si es 0, usa la heurística dependiente del objetivo.."
+msgstr "Establece el número máximo de instrucciones ejecutadas en paralelo en el árbol de reasociación. Si es 0, usa la heurística dependiente del objetivo."
#: params.def:1193
#, no-c-format
@@ -2748,10 +2717,9 @@ msgid "Maximum number of may-defs visited when devirtualizing speculatively."
msgstr "Número máximo de definiciones posibles visitadas cuando se desvirtualiza especulativamente."
#: params.def:1375
-#, fuzzy, no-c-format
-#| msgid "Maximum number of constant stores to merge in the store merging pass."
+#, no-c-format
msgid "Maximum number of assertions to add along the default edge of a switch statement during VRP."
-msgstr "Número máximo de almacenamientos constantes que hay que mezclar en el paso de mezcla de almacenamientos."
+msgstr "Número máximo de aserciones que hay que añadir a lo largo del borde predefinido de una sentencia switch durante VRP."
#: params.def:1381
#, no-c-format
@@ -2766,7 +2734,7 @@ msgstr ""
#: params.def:1391
#, no-c-format
msgid "Maximum unroll factor for the unroll-and-jam transformation."
-msgstr ""
+msgstr "Máximo factor de desenrrollado para la transformación unroll-and-jam."
#: params.def:1396
#, no-c-format
@@ -2776,19 +2744,17 @@ msgstr "Número máximo de bits para el cual evitamos crear FMAs."
#: params.def:1401
#, no-c-format
msgid "True if a non-short-circuit operation is optimal."
-msgstr ""
+msgstr "Verdadero si una operación de non-short-circuit es óptima."
#: params.def:1406
-#, fuzzy, no-c-format
-#| msgid "Maximum number of instructions in basic block to be considered for SLP vectorization."
+#, no-c-format
msgid "The maximum number of instructions in an inner loop that is being considered for versioning."
-msgstr "El número máximo de instrucciones en bloque básico que se consideran para vectorización SLP."
+msgstr "El número máximo de instrucciones en un bucle interior que se consideran para versionar."
#: params.def:1412
-#, fuzzy, no-c-format
-#| msgid "The maximum number of instructions to consider to unroll in a loop."
+#, no-c-format
msgid "The maximum number of instructions in an outer loop that is being considered for versioning, on top of the instructions in inner loops."
-msgstr "El número máximo de instrucciones para considerar el desenrollo en un bucle."
+msgstr "El número máximo de instrucciones ien un bucle exterior que se consideran para versionar, por encima de las instrucciones en los bucles interiores."
#: c-family/c-format.c:404
msgid "format"
@@ -3655,15 +3621,14 @@ msgstr "operando output_condmove_single erróneo"
#: config/gcn/gcn.c:5637 config/gcn/gcn.c:5648 config/gcn/gcn.c:5651
#, c-format
msgid "bad ADDR_SPACE_GLOBAL address"
-msgstr ""
+msgstr "dirección ADDR_SPACE_GLOBAL errónea"
#: config/gcn/gcn.c:5423 config/gcn/gcn.c:5446 config/gcn/gcn.c:5475
#: config/gcn/gcn.c:5491 config/gcn/gcn.c:5510 config/gcn/gcn.c:5586
#: config/gcn/gcn.c:5782 config/gcn/gcn.c:5879
-#, fuzzy, c-format
-#| msgid "invalid operand to %%Z code"
+#, c-format
msgid "invalid operand %%xn code"
-msgstr "operando no válido para el código %%Z"
+msgstr "operando no válido para el código %%xn"
#: config/gcn/gcn.c:5949
#, c-format
@@ -3962,22 +3927,19 @@ msgid "invalid zero extract"
msgstr "extracto de cero no válido"
#: config/or1k/or1k.c:1124 config/or1k/or1k.c:1132
-#, fuzzy, c-format
-#| msgid "invalid operation"
+#, c-format
msgid "invalid relocation"
-msgstr "operación no válida"
+msgstr "reubicación no válida"
#: config/or1k/or1k.c:1226
-#, fuzzy, c-format
-#| msgid "invalid %H value"
+#, c-format
msgid "invalid %%H value"
-msgstr "valor %H no válido"
+msgstr "valor %%H no válido"
#: config/or1k/or1k.c:1274
-#, fuzzy, c-format
-#| msgid "unknown punctuation '%c'"
+#, c-format
msgid "unknown operand letter: '%c'"
-msgstr "puntuación '%c' desconocida"
+msgstr "letra de operando desconocida: '%c'"
#: config/rl78/rl78.c:2009 config/rl78/rl78.c:2095
#, c-format
@@ -3995,46 +3957,32 @@ msgid "Try running '%s' in the shell to raise its limit.\n"
msgstr "Pruebe ejecutar '%s' en el intérprete de órdenes para elevar su límite.\n"
#: config/rs6000/rs6000.c:3995
-#, fuzzy
-#| msgid "-mvsx requires hardware floating point"
msgid "%<-mvsx%> requires hardware floating point"
-msgstr "-mvsx requiere coma flotante de hardware"
+msgstr "%<-mvsx%> requiere coma flotante de hardware"
#: config/rs6000/rs6000.c:4003
-#, fuzzy
-#| msgid "-mvsx needs indexed addressing"
msgid "%<-mvsx%> needs indexed addressing"
-msgstr "-mvsx necesita direccionamiento indizado"
+msgstr "%<-mvsx%> necesita direccionamiento indexado"
#: config/rs6000/rs6000.c:4008
-#, fuzzy
-#| msgid "-mvsx and -mno-altivec are incompatible"
msgid "%<-mvsx%> and %<-mno-altivec%> are incompatible"
-msgstr "-mvsx y -mno-altivec son incompatibles"
+msgstr "%<-mvsx%> y -%<mno-altivec%> son incompatibles"
#: config/rs6000/rs6000.c:4010
-#, fuzzy
-#| msgid "-mno-altivec disables vsx"
msgid "%<-mno-altivec%> disables vsx"
-msgstr "-mno-altivec desactiva vsx"
+msgstr "%<-mno-altivec%> desactiva vsx"
#: config/rs6000/rs6000.c:4136
-#, fuzzy
-#| msgid "-mquad-memory requires 64-bit mode"
msgid "%<-mquad-memory%> requires 64-bit mode"
-msgstr "-mquad-memory requiere modo de 64 bits"
+msgstr "%<-mquad-memory%> requiere modo de 64 bits"
#: config/rs6000/rs6000.c:4139
-#, fuzzy
-#| msgid "-mquad-memory-atomic requires 64-bit mode"
msgid "%<-mquad-memory-atomic%> requires 64-bit mode"
-msgstr "-mquad-memory-atomic requiere modo de 64 bits"
+msgstr "%<-mquad-memory-atomic%> requiere modo de 64 bits"
#: config/rs6000/rs6000.c:4151
-#, fuzzy
-#| msgid "-mquad-memory is not available in little endian mode"
msgid "%<-mquad-memory%> is not available in little endian mode"
-msgstr "-mquad-memory no está disponible en modo little endian"
+msgstr "%<-mquad-memory%> no está disponible en modo little endian"
#: config/rs6000/rs6000.c:10374
msgid "bad move"
@@ -4100,10 +4048,9 @@ msgid "invalid %%q value"
msgstr "valor %%q no válido"
#: config/rs6000/rs6000.c:21141
-#, fuzzy, c-format
-#| msgid "invalid %%J value"
+#, c-format
msgid "invalid %%t value"
-msgstr "valor %%J no válido"
+msgstr "valor %%t no válido"
#: config/rs6000/rs6000.c:21158
#, c-format
@@ -4121,10 +4068,9 @@ msgid "invalid %%v value"
msgstr "valor %%v no válido"
#: config/rs6000/rs6000.c:21234
-#, fuzzy, c-format
-#| msgid "invalid %%J value"
+#, c-format
msgid "invalid %%V value"
-msgstr "valor %%J no válido"
+msgstr "valor %%V no válido"
#: config/rs6000/rs6000.c:21251 config/xtensa/xtensa.c:2439
#, c-format
@@ -4696,10 +4642,8 @@ msgid "enters synchronized or atomic statement"
msgstr "entra en la sentencia sincronizada o atómica"
#: cp/decl.c:3254
-#, fuzzy
-#| msgid "expected statement"
msgid "enters constexpr if statement"
-msgstr "se esperaba una declaración"
+msgstr "entre en la sentencia if de expresión constante"
#: cp/error.c:375
msgid "<missing>"
@@ -5032,10 +4976,8 @@ msgid "Integer outside symmetric range implied by Standard Fortran at %L"
msgstr "Rango simétrico fuera de entero implicado por Standard Fortran en %L"
#: fortran/arith.c:118
-#, fuzzy
-#| msgid "Illegal character in BOZ constant at %C"
msgid "Illegal type in character concatenation at %L"
-msgstr "Carácter ilegal en la constante BOZ en %C"
+msgstr "Typo ilegal en concatenación de caracteres en %L"
#: fortran/arith.c:1384
msgid "elemental binary operation"
@@ -5397,10 +5339,9 @@ msgid "Operand of unary numeric operator %%<%s%%> at %%L is %s"
msgstr "El operando del operador numérico unitario %%<%s%%> en %%L es %s"
#: fortran/resolve.c:3949
-#, fuzzy, c-format
-#| msgid "Operands of binary numeric operator %%<%s%%> at %%L are %s/%s"
+#, c-format
msgid "Unexpected derived-type entities in binary intrinsic numeric operator %%<%s%%> at %%L"
-msgstr "Los operandos del operador numérico binario %%<%s%%> en %%L son %s/%s"
+msgstr "Entidades de tipos derivados no esperadas en el operador numérico intrínseco binario %%<%s%%> en %%L"
#: fortran/resolve.c:3954
#, c-format
@@ -5517,7 +5458,7 @@ msgstr "Desborde entero al calcular la cantidad de memoria a reservar"
#: fortran/trans-array.c:9544
#, c-format
msgid "The value of the PDT LEN parameter '%s' does not agree with that in the dummy declaration"
-msgstr ""
+msgstr "El valor del parámetro PDT LEN '%s' no concuerda con el de la declaración «dummy»"
#: fortran/trans-decl.c:6025
#, c-format
@@ -5719,10 +5660,8 @@ msgid "-E or -x required when input is from standard input"
msgstr "se requiere -E ó -x cuando la entrada es de entrada estándar"
#: config/darwin.h:126 config/darwin.h:427
-#, fuzzy
-#| msgid "-pg not supported on this platform"
msgid "gsplit-dwarf is not supported on this platform"
-msgstr "-pg no se admite en esta plataforma"
+msgstr "gsplit-dwarf no se admite en esta plataforma"
#: config/darwin.h:170
msgid "rdynamic is not supported"
@@ -5788,8 +5727,6 @@ msgstr "-Xbind-now y -Xbind-lazy son incompatibles"
#: config/aarch64/aarch64-freebsd.h:37 config/arm/freebsd.h:49
#: config/riscv/freebsd.h:44
-#, fuzzy
-#| msgid "consider using `-pg' instead of `-p' with gprof (1) "
msgid "consider using `-pg' instead of `-p' with gprof (1)"
msgstr "considere usar `-pg' en lugar de `-p' con gprof (1)"
@@ -5868,7 +5805,7 @@ msgstr "considere usar `-pg' en lugar de `-p' con gprof(1)"
#: config/rs6000/rs6000.h:139
msgid "Missing -mcpu option in ASM_CPU_SPEC?"
-msgstr ""
+msgstr "¿Falta la opción -mcpu en ASM_CPU_SPEC?"
#: config/rx/rx.h:80
msgid "-mas100-syntax is incompatible with -gdwarf"
@@ -5891,10 +5828,8 @@ msgid "SH2a does not support little-endian"
msgstr "SH2a no se admite para little-endian"
#: config/sparc/linux64.h:148
-#, fuzzy
-#| msgid "-pie is not supported in this configuration"
msgid "-fsanitize=address is not supported in this configuration"
-msgstr "-pie no se admite en esta configuración"
+msgstr "-fsanitize=dirección no se admite en esta configuración"
#: config/sparc/linux64.h:162 config/sparc/linux64.h:168
#: config/sparc/netbsd-elf.h:108 config/sparc/netbsd-elf.h:117
@@ -5960,7 +5895,7 @@ msgstr "Avisa sobre la creación de matrices temporales."
#: fortran/lang.opt:214
msgid "Warn about type and rank mismatches between arguments and parameters."
-msgstr ""
+msgstr "Avisa sobre discordancias de tipo y rango entre argumentos y parámetros."
#: fortran/lang.opt:218
msgid "Warn if the type of a variable might be not interoperable with C."
@@ -6243,7 +6178,7 @@ msgstr "-ffree-line-length-<n>\tUsa n como ancho de línea de carácter en modo
#: fortran/lang.opt:565
msgid "Try to interchange loops if profitable."
-msgstr ""
+msgstr "Intenta intercambiar bucles si es provechoso."
#: fortran/lang.opt:569
msgid "Enable front end optimization."
@@ -6259,7 +6194,7 @@ msgstr "-finit-character=<n>\tInicializa las variables de carácter locales al v
#: fortran/lang.opt:581
msgid "Initialize components of derived type variables according to other init flags."
-msgstr ""
+msgstr "Inicializa componentes de variables de tipo derivado en conformidad con otros indicadores de inicialización."
#: fortran/lang.opt:585
msgid "-finit-integer=<n>\tInitialize local integer variables to n."
@@ -6315,7 +6250,7 @@ msgstr "Protege paréntesis en las expresiones."
#: fortran/lang.opt:675
msgid "Path to header file that should be pre-included before each compilation unit."
-msgstr ""
+msgstr "Ruta de fichero de cabecera que debería preincluirse antes de cada unidad de compilación."
#: fortran/lang.opt:679
msgid "Enable range checking during compilation."
@@ -6517,7 +6452,7 @@ msgstr "Avisa si un subojeto tiene un atributo abi_tag que el objeto completo no
#: c-family/c.opt:276
msgid "Warn on suspicious calls of standard functions computing absolute values."
-msgstr ""
+msgstr "Advierte de llamadas sospechosas de funciones estándar que calculan valores absolutos."
#: c-family/c.opt:280
msgid "Warn about suspicious uses of memory addresses."
@@ -6545,7 +6480,7 @@ msgstr "-Walloc-size-larger-than=<bytes> Avierte de llamadas a funciones de rese
#: c-family/c.opt:317
msgid "-Wno-alloc-size-larger-than Disable Walloc-size-larger-than= warning. Equivalent to Walloc-size-larger-than=<SIZE_MAX> or larger."
-msgstr ""
+msgstr "-Wno-alloc-size-larger-than Desactiva el aviso Walloc-size-larger-than=. Equivalente a Walloc-size-larger-than=<MAX_TAMAÑO> o mayor."
#: c-family/c.opt:321
msgid "-Walloc-zero Warn for calls to allocation functions that specify zero bytes."
@@ -6557,7 +6492,7 @@ msgstr "-Walloca-larger-than=<número>\tAdvierte de usos no acotados de alloca y
#: c-family/c.opt:331
msgid "-Wno-alloca-larger-than Disable Walloca-larger-than= warning. Equivalent to Walloca-larger-than=<SIZE_MAX> or larger."
-msgstr ""
+msgstr "-Wno-alloca-larger-than Desactiva el aviso Walloca-larger-than=. Equivalente a Walloca-larger-than=<MAX_TAMAÑO> o mayor."
#: c-family/c.opt:343
msgid "Warn whenever an Objective-C assignment is being intercepted by the garbage collector."
@@ -6588,10 +6523,8 @@ msgid "Warn when a built-in preprocessor macro is undefined or redefined."
msgstr "Avisa cuando una macro de preprocesador interna está sin definir o redefinida."
#: c-family/c.opt:371
-#, fuzzy
-#| msgid "Warn about features not present in ISO C99, but present in ISO C11."
msgid "Warn about features not present in ISO C11, but present in ISO C2X."
-msgstr "Avisa sobre características no presentes en ISO C99, pero presentes en ISO C11."
+msgstr "Avisa sobre características no presentes en ISO C11, pero presentes en ISO C2X."
#: c-family/c.opt:375
msgid "Warn about features not present in ISO C90, but present in ISO C99."
@@ -6641,10 +6574,8 @@ msgstr "Avisa sobre subíndices cuyo tipo es \"char\"."
#: c-family/c.opt:1369 c-family/c.opt:1373 c-family/c.opt:1377
#: c-family/c.opt:1381 c-family/c.opt:1385 c-family/c.opt:1389
#: config/i386/i386.opt:967
-#, fuzzy
-#| msgid "Deprecated in GCC 8. This switch has no effect."
msgid "Deprecated in GCC 9. This switch has no effect."
-msgstr "Obsoleto en GCC 8. Esta opción no tiene efecto."
+msgstr "Obsoleto en GCC 9. Esta opción no tiene efecto."
#: c-family/c.opt:429
msgid "Warn about variables that might be changed by \"longjmp\" or \"vfork\"."
@@ -6676,7 +6607,7 @@ msgstr "Avisa cuando todos los constructores y destructores son privados."
#: c-family/c.opt:461
msgid "Warn about dangling else."
-msgstr "Avisa sobre else colgados."
+msgstr "Avisa sobre else congante."
#: c-family/c.opt:465
msgid "Warn about __TIME__, __DATE__ and __TIMESTAMP__ usage."
@@ -6696,11 +6627,11 @@ msgstr "Avisa al borrar objetos polimórficos con destructores que no son virtua
#: c-family/c.opt:485
msgid "Mark implicitly-declared copy operations as deprecated if the class has a user-provided copy operation."
-msgstr ""
+msgstr "Marca las operaciones de copia declaradas implícitamente como obsoletas si la clase tiene una operación de copia definida por el usuario."
#: c-family/c.opt:490
msgid "Mark implicitly-declared copy operations as deprecated if the class has a user-provided copy operation or destructor."
-msgstr ""
+msgstr "Marca las operaciones de copia declaradas implícitamente como obsoletas si la clase tiene una operación de copia o un destructor definidos por el usuario."
#: c-family/c.opt:495
msgid "Warn about positional initialization of structs requiring designated initializers."
@@ -6776,7 +6707,7 @@ msgstr "Avisa sobre el uso de cadenas de formato que no son literales."
#: c-family/c.opt:575
msgid "Warn about function calls with format strings that write past the end of the destination region. Same as -Wformat-overflow=1."
-msgstr ""
+msgstr "Advierte de llamadas a función con cadenas de formato que escriben más allá del final de la región de destino. Igual que -Wformat-overflow=1."
#: c-family/c.opt:580
msgid "Warn about possible security problems with format functions."
@@ -6788,7 +6719,7 @@ msgstr "Advierte de diferencias de signo en funciones de formato."
#: c-family/c.opt:588
msgid "Warn about calls to snprintf and similar functions that truncate output. Same as -Wformat-truncation=1."
-msgstr ""
+msgstr "Advierte de llamadas a snprintf y funciones similares que truncan la salida. Igual que -Wformat-truncation=1."
#: c-family/c.opt:593
msgid "Warn about strftime formats yielding 2-digit years."
@@ -6824,7 +6755,7 @@ msgstr "Avisa cuando hay conversión entre punteros de tipos incompatibles."
#: c-family/c.opt:630
msgid "Warn when the address of packed member of struct or union is taken."
-msgstr ""
+msgstr "Avisa cuando se toma la dirección del miembro empaquetado de una estructura o unión."
#: c-family/c.opt:634
msgid "Warn about variables which are initialized to themselves."
@@ -6832,7 +6763,7 @@ msgstr "Avisa sobre variables que se inicialicen ellas mismas."
#: c-family/c.opt:638
msgid "Warn about uses of std::initializer_list that can result in dangling pointers."
-msgstr ""
+msgstr "Avisa sobre usos de std::initializer_list que pueden resultar en punteros "
#: c-family/c.opt:642
msgid "Warn about implicit declarations."
@@ -6864,7 +6795,7 @@ msgstr "Advierte de conversiones de entero a puntero y viceversa incompatibles."
#: c-family/c.opt:677
msgid "Warn for suspicious integer expressions in boolean context."
-msgstr ""
+msgstr "Advierte de expresiones enteras sospechosas en contexto booleano."
#: c-family/c.opt:681
msgid "Warn when there is a cast to a pointer from an integer of a different size."
@@ -6928,7 +6859,7 @@ msgstr "Avisa sobre campos faltantes en los inicializadores de struct."
#: c-family/c.opt:745
msgid "Warn about unsafe macros expanding to multiple statements used as a body of a clause such as if, else, while, switch, or for."
-msgstr ""
+msgstr "Advierte de expansiones de macros no seguras a sentencias múltiples utilizadas como cuerpo de una cláusula como if, while, switch o for."
#: c-family/c.opt:749
msgid "Warn on direct multiple inheritance."
@@ -6940,7 +6871,7 @@ msgstr "Advierta de la definición de espacios de nombres."
#: c-family/c.opt:757
msgid "Warn when fields in a struct with the packed attribute are misaligned."
-msgstr ""
+msgstr "Avisa cuando un struct con el atributo «packed» tiene campos desalineados."
#: c-family/c.opt:761
msgid "Warn about missing sized deallocation functions."
@@ -6948,7 +6879,7 @@ msgstr "Advierte de funciones de desasignación con tamaño ausentes."
#: c-family/c.opt:765
msgid "Warn about suspicious divisions of two sizeof expressions that don't work correctly with pointers."
-msgstr ""
+msgstr "Advierte de divisiones sospechosas de dos expresiones sizeof que no funcionan correctamente con punteros."
#: c-family/c.opt:769
msgid "Warn about suspicious length parameters to certain string functions if the argument uses sizeof."
@@ -6960,7 +6891,7 @@ msgstr "Avisa cuando se aplica sizeof a parámetros declarados como array."
#: c-family/c.opt:777
msgid "Warn about buffer overflow in string manipulation functions like memcpy and strcpy."
-msgstr ""
+msgstr "Advierte de desbordamiento de búfer en funciones que manipulan cadenas, como memcpy y strcpy."
#: c-family/c.opt:782
msgid "Under the control of Object Size type, warn about buffer overflow in string manipulation functions like memcpy and strcpy."
@@ -7039,14 +6970,12 @@ msgid "Warn when non-templatized friend functions are declared within a template
msgstr "Avisa cuando las funciones friend sin plantillas se declaran dentro de una plantilla."
#: c-family/c.opt:868
-#, fuzzy
-#| msgid "conversion to void will never use a type conversion operator"
msgid "Warn when a conversion function will never be called due to the type it converts to."
-msgstr "la conversión a void nunca usará un operador de conversión de tipo"
+msgstr "Avisa cuando una función de conversión nunca será llamada debido al tipo al que convierte."
#: c-family/c.opt:872
msgid "Warn for unsafe raw memory writes to objects of class types."
-msgstr ""
+msgstr "Avisa en caso de escrituras de memoria en bruto no seguras a objetivos de tipos de clase."
#: c-family/c.opt:876
msgid "Warn about non-virtual destructors."
@@ -7130,7 +7059,7 @@ msgstr "Avisa sobre malos usos de pragmas."
#: c-family/c.opt:991
msgid "Warn if constructor or destructors with priorities from 0 to 100 are used."
-msgstr ""
+msgstr "Avisa si se usan constructores o destructores con prioridades entre 0 y 100."
#: c-family/c.opt:995
msgid "Warn if a property for an Objective-C object has no assign semantics specified."
@@ -7150,7 +7079,7 @@ msgstr "Avisa sobre declaraciones múltiples del mismo objeto."
#: c-family/c.opt:1015
msgid "Warn about redundant calls to std::move."
-msgstr ""
+msgstr "Advierte de llamadas redundantes a std::move."
#: c-family/c.opt:1019
msgid "Warn about uses of register storage specifier."
@@ -7293,14 +7222,12 @@ msgid "Warn if a variable length array is used."
msgstr "Avisa si se usa una matriz de longitud variable."
#: c-family/c.opt:1199
-#, fuzzy
-#| msgid "-Wvla-larger-than=<number>\tWarn on unbounded uses of variable-length arrays, and on bounded uses of variable-length arrays whose bound can be larger than <number> bytes."
msgid "-Wvla-larger-than=<number>\tWarn on unbounded uses of variable-length arrays, and on bounded uses of variable-length arrays whose bound can be larger than <number> bytes. <number> bytes."
-msgstr "-Wvla-larger-than=<número>\tAdvierte de usos no acotados de arrays de longitud variable y de usos acotados de arrays de longitud variable cuyo límite pueda ser más grande que <número> bytes."
+msgstr "-Wvla-larger-than=<número>\tAdvierte de usos no acotados de arrays de longitud variable y de usos acotados de arrays de longitud variable cuyo límite pueda ser más grande que <número> bytes. <número> bytes"
#: c-family/c.opt:1206
msgid "-Wno-vla-larger-than Disable Wvla-larger-than= warning. Equivalent to Wvla-larger-than=<SIZE_MAX> or larger."
-msgstr ""
+msgstr "-Wno-vla-larger-than Desactiva el aviso Wvla-larger-than=. Equivalente a Wvla-larger-than=<MAX_TAMAÑO> o mayor."
#: c-family/c.opt:1210
msgid "Warn when a register variable is declared volatile."
@@ -7356,11 +7283,11 @@ msgstr "-fada-spec-parent=unidad Vuelca specs de Ada como unidades hijas del pa
#: c-family/c.opt:1267
msgid "Support C++17 allocation of over-aligned types."
-msgstr ""
+msgstr "Admite alojamiento C++17 de tipos sobrealineados."
#: c-family/c.opt:1271
msgid "-faligned-new=<N> Use C++17 over-aligned type allocation for alignments greater than N."
-msgstr ""
+msgstr "-faligned-new=<N> Usa alojamiento de tipo sobrealineado de C++17 para alineamientos mayores que N."
#: c-family/c.opt:1278
msgid "Allow variadic functions without named parameter."
@@ -7385,7 +7312,7 @@ msgstr "Donde acorte, usar rutas canonicalizadas para cabeceras de sistemas."
#: c-family/c.opt:1305
msgid "Enable the char8_t fundamental type and use it as the type for UTF-8 string and character literals."
-msgstr ""
+msgstr "Habilita el tipo fundamental char8_t y lo usa como el tipo para los literales de cadenas UTF-8 y de caracteres."
#: c-family/c.opt:1393
msgid "Deprecated in GCC 8. This switch has no effect."
@@ -7412,10 +7339,8 @@ msgid "-fconstexpr-loop-limit=<number>\tSpecify maximum constexpr loop iteration
msgstr "-fconstexpr-loop-limit=<número>\tEspecifica el número de iteraciones de bucle constexpr máximo."
#: c-family/c.opt:1421
-#, fuzzy
-#| msgid "-fconstexpr-loop-limit=<number>\tSpecify maximum constexpr loop iteration count."
msgid "-fconstexpr-ops-limit=<number>\tSpecify maximum number of constexpr operations during a single constexpr evaluation."
-msgstr "-fconstexpr-loop-limit=<número>\tEspecifica el número de iteraciones de bucle constexpr máximo."
+msgstr "-fconstexpr-ops-limit=<número>\tEspecifica el número máximo de operaciones constexpr durante una evaluación de constexpr."
#: c-family/c.opt:1425
msgid "Emit debug annotations during preprocessing."
@@ -7431,7 +7356,7 @@ msgstr "Factoriza constructores y destructores complejos para favorecer el espac
#: c-family/c.opt:1441
msgid "Print hierarchical comparisons when template types are mismatched."
-msgstr ""
+msgstr "Imprime comparaciones jerárquicas cuando los tipos de plantilla no coinciden."
#: c-family/c.opt:1445
msgid "Preprocess directives only."
@@ -7443,7 +7368,7 @@ msgstr "Permite '$' como un identificador de carácter."
#: c-family/c.opt:1453
msgid "-fmacro-prefix-map=<old>=<new> Map one directory name to another in __FILE__, __BASE_FILE__, and __builtin_FILE()."
-msgstr ""
+msgstr "-fmacro-prefix-map=<viejo>=<nuevo> Asocia un nombre de directorio a otro en __FILE__, __BASE_FILE__, y __builtin_FILE()."
#: c-family/c.opt:1457
msgid "Write all declarations as Ada code transitively."
@@ -7851,16 +7776,12 @@ msgstr "Obsoleto en favor de -std=c11."
#: c-family/c.opt:2017 c-family/c.opt:2021 c-family/c.opt:2139
#: c-family/c.opt:2143
-#, fuzzy
-#| msgid "Conform to the ISO 2017 C standard (expected to be published in 2018)."
msgid "Conform to the ISO 2017 C standard (published in 2018)."
-msgstr "Conforma al estándar ISO 2017 C (publicación prevista en 2018)."
+msgstr "Conforma al estándar ISO 2017 C (publicado en 2018)."
#: c-family/c.opt:2025
-#, fuzzy
-#| msgid "Conform to the ISO 2011 C standard (experimental and incomplete support)"
msgid "Conform to the ISO 202X C standard draft (experimental and incomplete support)."
-msgstr "Conforma al estándar ISO 2011 C (soporte experimental e incompleto)"
+msgstr "Conforma al borrador del estándar ISO 202X C (soporte experimental e incompleto)"
#: c-family/c.opt:2029 c-family/c.opt:2033 c-family/c.opt:2119
msgid "Conform to the ISO 1990 C standard."
@@ -7915,16 +7836,12 @@ msgid "Deprecated in favor of -std=gnu11."
msgstr "Obsoleto en favor de -std=gnu11."
#: c-family/c.opt:2091 c-family/c.opt:2095
-#, fuzzy
-#| msgid "Conform to the ISO 2017 C standard (expected to be published in 2018) with GNU extensions."
msgid "Conform to the ISO 2017 C standard (published in 2018) with GNU extensions."
-msgstr "Conforma al estándar ISO 2017 C (publicación prevista en 2018) con extensiones GNU."
+msgstr "Conforma al estándar ISO 2017 C (publicado en 2018) con extensiones GNU."
#: c-family/c.opt:2099
-#, fuzzy
-#| msgid "Conform to the ISO 2011 C standard with GNU extensions (experimental and incomplete support)"
msgid "Conform to the ISO 202X C standard draft with GNU extensions (experimental and incomplete support)."
-msgstr "Conforma al estándar ISO 2011 C con extensiones GNU (soporte experimental e incompleto)"
+msgstr "Conforma al borrador del estándar ISO 202X C con extensiones GNU (soporte experimental e incompleto)."
#: c-family/c.opt:2103 c-family/c.opt:2107
msgid "Conform to the ISO 1990 C standard with GNU extensions."
@@ -7992,99 +7909,79 @@ msgstr "No considerada."
#: d/lang.opt:51
msgid "-Hd <dir>\tWrite D interface files to directory <dir>."
-msgstr ""
+msgstr "-Hd <dir>\tEscribe los ficheros de interfaz de D en el directorio <dir>."
#: d/lang.opt:55
-#, fuzzy
-#| msgid "-o <file>\tPlace output into <file>."
msgid "-Hf <file>\tWrite D interface to <file>."
-msgstr "-o <fichero>\tColoca la salida en el <fichero>."
+msgstr "-Hf <fichero>\tEscribe el interfaz de D en el <fichero>."
#: d/lang.opt:123
-#, fuzzy
-#| msgid "Warn about casts which discard qualifiers."
msgid "Warn about casts that will produce a null result."
-msgstr "Avisa sobre conversiones que descartan calificadores."
+msgstr "Avisa sobre conversiones que darán resultado nulo."
#: d/lang.opt:139
msgid "Warn from speculative compiles such as __traits(compiles)."
msgstr ""
#: d/lang.opt:151
-#, fuzzy
-#| msgid "Generate H8S code."
msgid "Generate JSON file."
-msgstr "Genera código H8S."
+msgstr "Genera fichero JSON."
#: d/lang.opt:155
-#, fuzzy
-#| msgid "-MF <file>\tWrite dependency output to the given file."
msgid "-Xf <file>\tWrite JSON output to the given <file>."
-msgstr "-MF <fichero>\tEscribe la salida de dependencias al fichero dado."
+msgstr "-Xf <fichero>\tEscribe salida JSON al <fichero> dado."
#: d/lang.opt:159
msgid "Debug library to use instead of phobos."
-msgstr ""
+msgstr "Biblioteca de depuración que se utilizará en lugar de phobos."
#: d/lang.opt:163
msgid "Default library to use instead of phobos."
-msgstr ""
+msgstr "Biblioteca predefinida que se utilizará en lugar de phobos."
#: d/lang.opt:167
msgid "Do link the standard D startup files in the compilation."
msgstr ""
#: d/lang.opt:174
-#, fuzzy
-#| msgid "Generate code for built-in atomic operations."
msgid "Generate code for all template instantiations."
-msgstr "Genera código para operaciones atómicas internas."
+msgstr "Genera código para todas las instanciaciones de plantillas."
#: d/lang.opt:178
-#, fuzzy
-#| msgid "Generate code for GNU assembler (gas)."
msgid "Generate code for assert contracts."
-msgstr "Genera código para el ensamblador de GNU (gas)."
+msgstr "Genera código para contratos de assert."
#: d/lang.opt:186
msgid "-fbounds-check=[on|safeonly|off]\tTurn array bounds checks on, in @safe code only, or off."
-msgstr ""
+msgstr "-fbounds-check=[on|safeonly|off]\tActiva o desactiva las comprobaciones de límites de matrices, solo en código @safe."
#: d/lang.opt:210
-#, fuzzy
-#| msgid "incompatible index mode"
msgid "Compile in debug code."
-msgstr "modo de índices incompatibles"
+msgstr "Compila en código de depuración."
#: d/lang.opt:214
msgid "-fdebug=<level|ident>\tCompile in debug code, code <= <level>, or code identified by <ident>."
-msgstr ""
+msgstr "-fdebug=<level|ident>\tCompila en código de depuración, código <= <nivel>, o código identificado por <ident>."
#: d/lang.opt:218
-#, fuzzy
-#| msgid "Generate norm instruction."
msgid "Generate documentation."
-msgstr "Genera instrucciones norm."
+msgstr "Genera documentación."
#: d/lang.opt:222
msgid "-fdoc-dir=<dir>\tWrite documentation file to directory <dir>."
-msgstr ""
+msgstr "-fdoc-dir=<dir>\tEscribe el fichero de documentación en el directorio <dir>."
#: d/lang.opt:226
-#, fuzzy
-#| msgid "-o <file>\tPlace output into <file>."
msgid "-fdoc-file=<file>\tWrite documentation to <file>."
-msgstr "-o <fichero>\tColoca la salida en el <fichero>."
+msgstr "-fdoc-file=<fichero>\tEscribe la documentación en <fichero>."
#: d/lang.opt:230
msgid "-fdoc-inc=<file>\tInclude a Ddoc macro <file>."
-msgstr ""
+msgstr "-fdoc-inc=<fichero>\tIncluye un <fichero> de macros Ddoc."
#: d/lang.opt:234
-#, fuzzy
-#| msgid "Do not assume that standard C libraries and \"main\" exist."
msgid "Assume that standard D runtime libraries and \"D main\" exist."
-msgstr "No asume que existen las bibliotecas C estándar y \"main\"."
+msgstr "Asume que existen bibliotecas D estándar de tiempo de ejecución y \"D main\"."
#: d/lang.opt:238
#, fuzzy
@@ -8094,7 +7991,7 @@ msgstr "Muestra el árbol del código después de analizar; opción obsoleta."
#: d/lang.opt:242
msgid "Ignore unsupported pragmas."
-msgstr ""
+msgstr "Hace caso omiso de pragmas no admitidas."
#: d/lang.opt:246
#, fuzzy
@@ -8104,11 +8001,11 @@ msgstr "Genera código para operaciones atómicas internas."
#: d/lang.opt:250
msgid "Generate a default D main() function when compiling."
-msgstr ""
+msgstr "Genera una función main() de D predefinida al compilar."
#: d/lang.opt:254
msgid "-fmodule-file=<package.module>=<filespec>\tuse <filespec> as source file for <package.module>."
-msgstr ""
+msgstr "-fmodule-file=<paquete.módulo>=<especfich>\tutiliza <especfich> como fichero fuente para <paquete.módulo>."
#: d/lang.opt:258
#, fuzzy
@@ -8118,19 +8015,15 @@ msgstr "Genera código para el modo de usuario."
#: d/lang.opt:262
msgid "Process all modules specified on the command line, but only generate code for the module specified by the argument."
-msgstr ""
+msgstr "Procesa todos los módulos especificados en la línea de órdenes, pero solo genera código para el módulo especificado por el argumento."
#: d/lang.opt:266
-#, fuzzy
-#| msgid "Generate code for built-in atomic operations."
msgid "Generate code for postcondition contracts."
-msgstr "Genera código para operaciones atómicas internas."
+msgstr "Genera código para contratos de postcondiciones."
#: d/lang.opt:270
-#, fuzzy
-#| msgid "Generate code for built-in atomic operations."
msgid "Generate code for precondition contracts."
-msgstr "Genera código para operaciones atómicas internas."
+msgstr "Genera código para contratos de precondiciones."
#: d/lang.opt:274
#, fuzzy
@@ -8139,14 +8032,12 @@ msgid "Compile release version."
msgstr "Muestra la versión del compilador."
#: d/lang.opt:282
-#, fuzzy
-#| msgid "Generate code for the supervisor mode (default)."
msgid "Generate code for switches without a default case."
-msgstr "Genera código para el modo supervisor (predeterminado)."
+msgstr "Genera código para las opciones sin caso predefinido."
#: d/lang.opt:286
msgid "List information on all language changes."
-msgstr ""
+msgstr "Muestra información sobre todos los cambios del lenguaje."
#: d/lang.opt:290
msgid "Give deprecation messages about -ftransition=import anomalies."
@@ -8154,7 +8045,7 @@ msgstr ""
#: d/lang.opt:294
msgid "List all usages of complex or imaginary types."
-msgstr ""
+msgstr "Enumera todos los usos de los tipos complejo o imaginario."
#: d/lang.opt:298
msgid "Implement DIP1000: Scoped pointers (experimental)."
@@ -8166,21 +8057,19 @@ msgstr ""
#: d/lang.opt:306
msgid "List all non-mutable fields which occupy an object instance."
-msgstr ""
+msgstr "Enumera todos los campos no mutables que ocupan la instancia de un objeto."
#: d/lang.opt:310
msgid "Revert to single phase name lookup."
-msgstr ""
+msgstr "Revierta a búsqueda de nombres de una sola fase."
#: d/lang.opt:314
msgid "List all hidden GC allocations."
msgstr ""
#: d/lang.opt:318
-#, fuzzy
-#| msgid "Use given thread-local storage dialect."
msgid "List all variables going into thread local storage."
-msgstr "Usa el dialecto de almacenamiento thread-local dado."
+msgstr "Enumera todas las variables que van al almacenamiento local del hilo."
#: d/lang.opt:322
#, fuzzy
@@ -8193,18 +8082,16 @@ msgid "-fversion=<level|ident>\tCompile in version code >= <level> or identified
msgstr ""
#: d/lang.opt:350
-#, fuzzy
-#| msgid "Do not assume that standard C libraries and \"main\" exist."
msgid "Do not link the standard D library in the compilation."
-msgstr "No asume que existen las bibliotecas C estándar y \"main\"."
+msgstr "No enlaza la biblioteca D estándar en la compilación."
#: d/lang.opt:358
msgid "Link the standard D library statically in the compilation."
-msgstr ""
+msgstr "Enlaza la biblioteca D estándar estáticamente en la compilación."
#: d/lang.opt:362
msgid "Link the standard D library dynamically in the compilation."
-msgstr ""
+msgstr "Enlaza la biblioteca D estándar dinámicamente en la compilación."
#: go/lang.opt:42
msgid "-fgo-c-header=<file>\tWrite Go struct definitions to file as C code."
@@ -8271,16 +8158,12 @@ msgid "-mpointer-size=[no,32,short,64,long]\tSet the default pointer size."
msgstr "-mpointer-size=[no,32,short,64,long]\tEstablece el tamaña predeterminado de los punteros."
#: config/mcore/mcore.opt:23
-#, fuzzy
-#| msgid "Generate code for the M*Core M210"
msgid "Generate code for the M*Core M210."
-msgstr "Genera código para el M*Core M210"
+msgstr "Genera código para el M*Core M210."
#: config/mcore/mcore.opt:27
-#, fuzzy
-#| msgid "Generate code for the M*Core M340"
msgid "Generate code for the M*Core M340."
-msgstr "Genera código para el M*Core M340"
+msgstr "Genera código para el M*Core M340."
#: config/mcore/mcore.opt:31
msgid "Force functions to be aligned to a 4 byte boundary."
@@ -8650,7 +8533,7 @@ msgstr "Activa la biblioteca compartida basada en ID."
#: config/m68k/m68k.opt:147
msgid "Use 32-bit offsets in jump tables rather than 16-bit offsets."
-msgstr ""
+msgstr "Usa desplazamientos de 32 bits en las tablas de saltos en lugar de desplazamientos de 16 bits."
#: config/m68k/m68k.opt:151
msgid "Do not use the bit-field instructions."
@@ -8761,11 +8644,11 @@ msgstr "Utiliza operadores %reloc() en vez de macros de ensamblador para cargar
#: config/riscv/riscv.opt:114
msgid "Take advantage of linker relaxations to reduce the number of instructions required to materialize symbol addresses."
-msgstr ""
+msgstr "Aprovecha los descansos del enlazador para reducir el número de instrucciones requeridas para materializar direcciones de símbolos."
#: config/riscv/riscv.opt:133
msgid "Emit RISC-V ELF attribute."
-msgstr ""
+msgstr "Emite el atributo ELF de RISC-V."
#: config/m32c/m32c.opt:23
msgid "-msim\tUse simulator runtime."
diff --git a/gcc/po/fi.po b/gcc/po/fi.po
index c66de8afab4..b4b27c40017 100644
--- a/gcc/po/fi.po
+++ b/gcc/po/fi.po
@@ -33,7 +33,7 @@ msgstr ""
"Project-Id-Version: gcc 9.1.0\n"
"Report-Msgid-Bugs-To: https://gcc.gnu.org/bugs/\n"
"POT-Creation-Date: 2019-05-02 20:28+0000\n"
-"PO-Revision-Date: 2019-05-29 18:58+0300\n"
+"PO-Revision-Date: 2019-10-11 20:03+0300\n"
"Last-Translator: Lauri Nurmi <lanurmi@iki.fi>\n"
"Language-Team: Finnish <translation-team-fi@lists.sourceforge.net>\n"
"Language: fi\n"
@@ -67,9 +67,9 @@ msgid "[cannot find %s]"
msgstr "lähdetiedostoa %s ei löydy"
#: collect2.c:1632
-#, fuzzy, c-format
+#, c-format
msgid "collect2 version %s\n"
-msgstr "gcc-versio %s %s\n"
+msgstr "collect2-versio %s\n"
#: collect2.c:1737
#, c-format
@@ -118,9 +118,9 @@ msgid "const/copy propagation disabled"
msgstr "const-/kopioinnin-eteneminen poistettu käytöstä"
#: diagnostic.c:145
-#, fuzzy, c-format
+#, c-format
msgid "%s: all warnings being treated as errors"
-msgstr "Käsittele kaikki varoitukset virheinä"
+msgstr "%s: kaikki varoitukset käsitellään virheinä"
#: diagnostic.c:150
#, c-format
@@ -6142,9 +6142,8 @@ msgid "gfortran does not support -E without -cpp"
msgstr "gfortran ei tue valitsinta -E ilman valitsinta -cpp"
#: objc/lang-specs.h:30 objc/lang-specs.h:41
-#, fuzzy
msgid "GNU Objective C no longer supports traditional compilation"
-msgstr "GCC ei enää tue valitsinta -traditional ilman valitsinta -E"
+msgstr "GNU Objective C ei enää tue perinteistä kääntämistä"
#: objc/lang-specs.h:55
msgid "objc-cpp-output is deprecated; please use objective-c-cpp-output instead"
@@ -6688,9 +6687,8 @@ msgid "Conform to the ISO Fortran 95 standard."
msgstr "Noudata ISO Fortran 95 -standardia"
#: fortran/lang.opt:827
-#, fuzzy
msgid "Conform to nothing in particular."
-msgstr "Älä noudata mitään erityisesti"
+msgstr "Älä noudata mitään erityisesti."
#: fortran/lang.opt:831
msgid "Accept extensions to support legacy code."
@@ -6732,24 +6730,20 @@ msgid "-I <dir>\tAdd <dir> to the end of the main include path."
msgstr "-isystem <hakemisto>\tLisää <hakemisto> järjestelmän include-polun alkuun"
#: c-family/c.opt:217
-#, fuzzy
msgid "Generate make dependencies."
-msgstr "Luo make-riippuvuudet"
+msgstr "Luo make-riippuvuudet."
#: c-family/c.opt:221
-#, fuzzy
msgid "Generate make dependencies and compile."
-msgstr "Luo make-riippuvuudet ja käännä"
+msgstr "Luo make-riippuvuudet ja käännä."
#: c-family/c.opt:225
-#, fuzzy
msgid "-MF <file>\tWrite dependency output to the given file."
-msgstr "Kirjoita riippuvuustuloste annettuun tiedostoon"
+msgstr "-MF <tiedosto>\tKirjoita riippuvuustuloste annettuun tiedostoon."
#: c-family/c.opt:229
-#, fuzzy
msgid "Treat missing header files as generated files."
-msgstr "Käsittele puuttuvia otsikkotiedostoja luotavina tiedostoina"
+msgstr "Käsittele puuttuvia otsikkotiedostoja luotavina tiedostoina."
#: c-family/c.opt:233
msgid "Like -M but ignore system header files."
@@ -6773,9 +6767,8 @@ msgid "-MT <target>\tAdd an unquoted target."
msgstr ""
#: c-family/c.opt:253
-#, fuzzy
msgid "Do not generate #line directives."
-msgstr "Älä luo #line-direktiivejä"
+msgstr "Älä luo #line-direktiivejä."
#: c-family/c.opt:257
#, fuzzy
@@ -6817,11 +6810,9 @@ msgstr ""
msgid "Enable most warning messages."
msgstr "Subject: Fetchmailin varoitus liian suuresta viestistä"
-# vähän fuzzy
#: c-family/c.opt:308
-#, fuzzy
msgid "Warn on any use of alloca."
-msgstr "Varoita pragmain väärästä käytöstä."
+msgstr "Varoita kaikesta allocan käytöstä."
#: c-family/c.opt:312
#, fuzzy
@@ -6931,9 +6922,8 @@ msgstr "Varoita ”char”-tyypillä indeksoinnista."
#: c-family/c.opt:1369 c-family/c.opt:1373 c-family/c.opt:1377
#: c-family/c.opt:1381 c-family/c.opt:1385 c-family/c.opt:1389
#: config/i386/i386.opt:967
-#, fuzzy
msgid "Deprecated in GCC 9. This switch has no effect."
-msgstr "Vanhentunut. Tämä valitsin ei vaikuta mihinkään."
+msgstr "Vanhentunut GCC 9:ssä. Tämä valitsin ei vaikuta mihinkään."
#: c-family/c.opt:429
msgid "Warn about variables that might be changed by \"longjmp\" or \"vfork\"."
@@ -6964,9 +6954,8 @@ msgid "Warn when all constructors and destructors are private."
msgstr "Varoita kun kaikki muodostimet ja hajottimet ovat yksityisiä."
#: c-family/c.opt:461
-#, fuzzy
msgid "Warn about dangling else."
-msgstr "Varoita implisiittisistä funktioesittelyistä."
+msgstr "Varoita orvosta elsestä."
#: c-family/c.opt:465
msgid "Warn about __TIME__, __DATE__ and __TIMESTAMP__ usage."
@@ -7119,9 +7108,8 @@ msgid "Warn whenever type qualifiers are ignored."
msgstr "Varoita tyyppimääreiden huomiotta jättämisestä."
#: c-family/c.opt:622
-#, fuzzy
msgid "Warn whenever attributes are ignored."
-msgstr "Varoita tyyppimääreiden huomiotta jättämisestä."
+msgstr "Varoita attribuuttien huomiotta jättämisestä."
#: c-family/c.opt:626
#, fuzzy
@@ -7196,9 +7184,8 @@ msgid "Warn when a string or character literal is followed by a ud-suffix which
msgstr ""
#: c-family/c.opt:701
-#, fuzzy
msgid "Warn when a logical operator is suspiciously always evaluating to true or false."
-msgstr "Varoita vertailusta, joka on aina tosi tai aina epätosi."
+msgstr "Varoita, kun looginen operaattori on aina tosi tai aina epätosi."
#: c-family/c.opt:705
msgid "Warn when logical not is used on the left hand side operand of a comparison."
@@ -7429,9 +7416,8 @@ msgid "Warn about packed bit-fields whose offset changed in GCC 4.4."
msgstr "Varoita pakatuista bittikentistä, joiden siirrososoite vaihtui GCC 4.4:ssä"
#: c-family/c.opt:955
-#, fuzzy
msgid "Warn about possibly missing parentheses."
-msgstr "Varoita mahdollisesti puuttuvista sulkeista"
+msgstr "Varoita mahdollisesti puuttuvista sulkeista."
#: c-family/c.opt:963
msgid "Warn about calling std::move on a local object in a return statement preventing copy elision."
@@ -7975,9 +7961,8 @@ msgid "Enable OpenMP's SIMD directives."
msgstr "Luokittelematon lause IF-lauseessa kohdassa %C"
#: c-family/c.opt:1681
-#, fuzzy
msgid "Recognize C++ keywords like \"compl\" and \"xor\"."
-msgstr "Tunnista C++:n avainsanat kuten ”compl” ja ”xor”"
+msgstr "Tunnista C++:n avainsanat kuten ”compl” ja ”xor”."
#: c-family/c.opt:1692
msgid "Look for and use PCH files even when preprocessing."
@@ -8732,9 +8717,8 @@ msgid "Set the maximum amount for a single stack increment operation."
msgstr ""
#: config/mcore/mcore.opt:75
-#, fuzzy
msgid "Always treat bitfields as int-sized."
-msgstr "Käsittele bittikenttiä aina int-kokoisina"
+msgstr "Käsittele bittikenttiä aina int-kokoisina."
#: config/linux-android.opt:23
msgid "Generate code for the Android platform."
@@ -19730,7 +19714,7 @@ msgstr "%qs-attribuuttia ei huomioida %qs:lle"
#: cgraphunit.c:976 c/c-decl.c:11507
#, fuzzy, gcc-internal-format
msgid "%q+F used but never defined"
-msgstr "nimike %q+D määritelty mutta käytettämättä"
+msgstr "nimike %q+D määritelty mutta käyttämättä"
#: cgraphunit.c:978 c/c-decl.c:11517
#, fuzzy, gcc-internal-format
@@ -29294,7 +29278,7 @@ msgstr "%<X<=Y<=Z%> -tyylisillä vertailuilla on eri merkitys kuin matematiikass
#: c-family/c-warn.c:2021
#, gcc-internal-format
msgid "label %q+D defined but not used"
-msgstr "nimike %q+D määritelty mutta käytettämättä"
+msgstr "nimike %q+D määritelty mutta käyttämättä"
#: c-family/c-warn.c:2023
#, gcc-internal-format
@@ -68642,7 +68626,7 @@ msgstr "(%qs:n alustuksen lähistöllä)"
#, fuzzy
#~ msgid "variable %q+D set but not used"
-#~ msgstr "nimike %q+D määritelty mutta käytettämättä"
+#~ msgstr "nimike %q+D määritelty mutta käyttämättä"
#~ msgid "jump to label %q+D"
#~ msgstr "hyppy nimiöön %q+D"
@@ -68659,7 +68643,7 @@ msgstr "(%qs:n alustuksen lähistöllä)"
#, fuzzy
#~ msgid "parameter %q+D set but not used"
-#~ msgstr "nimike %q+D määritelty mutta käytettämättä"
+#~ msgstr "nimike %q+D määritelty mutta käyttämättä"
#~ msgid "%q+D declared here"
#~ msgstr "%q+D esitelty täällä"
diff --git a/gcc/rtlanal.c b/gcc/rtlanal.c
index 268a38799d6..01af063a222 100644
--- a/gcc/rtlanal.c
+++ b/gcc/rtlanal.c
@@ -4793,7 +4793,7 @@ nonzero_bits1 (const_rtx x, scalar_int_mode mode, const_rtx known_x,
|| ((extend_op = load_extend_op (inner_mode)) == SIGN_EXTEND
? val_signbit_known_set_p (inner_mode, nonzero)
: extend_op != ZERO_EXTEND)
- || (!MEM_P (SUBREG_REG (x)) && !REG_P (SUBREG_REG (x))))
+ || !MEM_P (SUBREG_REG (x)))
&& xmode_width > inner_width)
nonzero
|= (GET_MODE_MASK (GET_MODE (x)) & ~GET_MODE_MASK (inner_mode));
diff --git a/gcc/symbol-summary.h b/gcc/symbol-summary.h
index 0219f3a81ea..74544fbf879 100644
--- a/gcc/symbol-summary.h
+++ b/gcc/symbol-summary.h
@@ -461,6 +461,8 @@ fast_function_summary<T *, V>::release ()
if ((*m_vector)[i] != NULL)
this->release ((*m_vector)[i]);
+ vec_free (m_vector);
+
this->m_released = true;
}
@@ -926,6 +928,8 @@ fast_call_summary<T *, V>::release ()
if ((*m_vector)[i] != NULL)
this->release ((*m_vector)[i]);
+ vec_free (m_vector);
+
this->m_released = true;
}
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 6b9060000d6..c15f694e7bd 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,765 @@
+2019-11-20 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/90767
+ * g++.dg/diagnostic/pr90767-1.C: New test.
+ * g++.dg/diagnostic/pr90767-2.C: New test.
+
+ PR middle-end/90840
+ * gcc.c-torture/compile/pr90840.c: New test.
+
+ PR target/90867
+ * gcc.target/i386/pr90867.c: New test.
+
+ PR c/90898
+ * gcc.dg/pr90898.c: New test.
+
+ Backported from mainline
+ 2019-11-19 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/92504
+ * g++.dg/gomp/pr92504.C: New test.
+
+2019-11-19 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/91450
+ * gcc.c-torture/execute/pr91450-1.c: New test.
+ * gcc.c-torture/execute/pr91450-2.c: New test.
+
+2019-11-15 Ilya Leoshkevich <iii@linux.ibm.com>
+
+ Backport from mainline
+ PR rtl-optimization/92430
+ * gcc.dg/pr92430.c: New test (from Arseny Solokha).
+
+2019-11-13 Claudiu Zissulescu <claziss@gmail.com>
+
+ Backport from mainline
+ * gcc.target/arc/delay-slot-limm.c: New test.
+ * gcc.target/arc/pic-2.c: New file.
+
+2019-11-13 Tobias Burnus <tobias@codesourcery.com>
+
+ PR fortran/92470
+ PR fortran/92500
+ * gfortran.dg/ISO_Fortran_binding_17.c: Include
+ ISO_Fortran_binding.h with relative path.
+
+2019-11-13 Tobias Burnus <tobias@codesourcery.com>
+
+ Backport from mainline
+ 2019-11-13 Tobias Burnus <tobias@codesourcery.com>
+
+ PR fortran/92470
+ * gfortran.dg/ISO_Fortran_binding_1.c (establish_c): Add assert for
+ lower_bound == 0.
+
+ 2019-11-12 Tobias Burnus <tobias@codesourcery.com>
+
+ PR fortran/92470
+ * gfortran.dg/ISO_Fortran_binding_17.c: New.
+ * gfortran.dg/ISO_Fortran_binding_17.f90: New.
+ * gfortran.dg/ISO_Fortran_binding_1.c (elemental_mult_c, allocate_c,
+ section_c, select_part_c): Update for CFI_{address} changes;
+ add asserts.
+
+2019-11-11 Richard Biener <rguenther@suse.de>
+
+ Backport from mainline
+ 2019-06-25 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/90930
+ * gcc.dg/tree-ssa/reassoc-24.c: Adjust.
+ * gcc.dg/tree-ssa/reassoc-25.c: Likewise.
+
+2019-11-10 Thomas Koenig <tkoenig@gcc.gnu.org>
+
+ Backport from trunk
+ PR fortran/92321
+ * gfortran.dg/matmul_blas_2.f90: New test.
+
+2019-11-08 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/92384
+ * g++.dg/torture/pr92384.C: New test.
+
+ Backported from mainline
+ 2019-11-05 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/92343
+ * g++.dg/cpp2a/attr-likely6.C: New test.
+
+ 2019-10-31 Jakub Jelinek <jakub@redhat.com>
+
+ PR preprocessor/92296
+ * c-c++-common/cpp/pr92296-1.c: New test.
+ * c-c++-common/cpp/pr92296-2.c: New test.
+
+ PR middle-end/92231
+ * gcc.c-torture/compile/pr92231.c: New test.
+
+ 2019-10-21 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/92015
+ * g++.dg/cpp0x/constexpr-92015.C: New test.
+
+2019-11-08 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gcc.c-torture/compile/20191108-1.c: New test.
+ * gcc.target/sparc/overflow-1.c: Add -fno-pie to the options.
+ * gcc.target/sparc/overflow-2.c: Likewise.
+ * gcc.target/sparc/overflow-3.c: Likewise.
+ * gcc.target/sparc/overflow-4.c: Likewise.
+ * gcc.target/sparc/overflow-5.c: Likewise.
+
+2019-11-06 Ilya Leoshkevich <iii@linux.ibm.com>
+
+ Backport from mainline
+ * gcc.target/s390/sigfpe-eh.c: New test.
+
+2019-11-05 Andreas Krebbel <krebbel@linux.ibm.com>
+
+ Backport from mainline
+ 2019-11-05 Andreas Krebbel <krebbel@linux.ibm.com>
+
+ * gcc.dg/tree-ssa/gen-vect-26.c: Disable loop peeling check for
+ IBM Z.
+ * gcc.dg/tree-ssa/gen-vect-28.c: Likewise.
+
+2019-11-05 Andreas Krebbel <krebbel@linux.ibm.com>
+
+ Backport from mainline
+ 2019-11-05 Andreas Krebbel <krebbel@linux.ibm.com>
+
+ * gcc.dg/tree-ssa/gen-vect-11.c: Add --param min-vect-loop-bound=0
+ for IBM Z.
+ * gcc.dg/tree-ssa/gen-vect-32.c: Likewise.
+
+2019-11-05 Andreas Krebbel <krebbel@linux.ibm.com>
+
+ Backport from mainline
+ 2019-11-05 Andreas Krebbel <krebbel@linux.ibm.com>
+
+ * gcc.target/s390/s390.exp
+ (check_effective_target_s390_useable_hw): Add inline asm for z14
+ and z15. Replace instruction for z13 with lochiz. Add register
+ clobbers. Check also for __zarch__ when doing the __VX__ test.
+
+2019-11-04 Iain Sandoe <iain@sandoe.co.uk>
+
+ Backport from mainline.
+ 2019-06-20 Iain Sandoe <iain@sandoe.co.uk>
+
+ * obj-c++.dg/stubify-1.mm: Adjust options and scan-asm checks.
+ * obj-c++.dg/stubify-2.mm: Likewise.
+ * objc.dg/stubify-1.m: Likewise.
+ * objc.dg/stubify-2.m: Likewise.
+
+2019-11-04 Tobias Burnus <tobias@codesourcery.com>
+
+ Backport from mainline
+ 2019-10-30 Tobias Burnus <tobias@codesourcery.com>
+
+ PR fortran/92208
+ * gfortran.dg/pr92208.f90: New.
+
+2019-11-04 Tobias Burnus <tobias@codesourcery.com>
+
+ Backport from mainline
+ 2019-10-31 Jakub Jelinek <jakub@redhat.com>
+
+ PR fortran/92284
+ * gfortran.dg/bind_c_array_params_3_aux.c: Include
+ ../../../libgfortran/ISO_Fortran_binding.h rather than
+ ISO_Fortran_binding.h.
+
+ 2019-10-31 Tobias Burnus <tobias@codesourcery.com>
+
+ PR fortran/92284
+ * gfortran.dg/bind-c-intent-out.f90: Update expected dump;
+ extend comment.
+ * gfortran.dg/bind_c_array_params_3.f90: New.
+ * gfortran.dg/bind_c_array_params_3_aux.c: New.
+
+ 2019-10-31 Tobias Burnus <tobias@codesourcery.com>
+
+ PR fortran/92277
+ * fortran.dg/pr92277.f90: New.
+
+
+2019-10-30 Iain Sandoe <iain@sandoe.co.uk>
+
+ Backport from mainline.
+ 2019-10-22 Iain Sandoe <iain@sandoe.co.uk>
+
+ * gcc.dg/Wnonnull.c: Provide prototypes for strlen and memcpy.
+ Use __SIZE_TYPE__ instead of size_t.
+
+ Backport from mainline.
+ 2019-10-19 Iain Sandoe <iain@sandoe.co.uk>
+
+ * gcc.dg/Wnonnull.c: Add attributed function declarations for
+ memcpy and strlen for Darwin.
+
+2019-10-30 Iain Sandoe <iain@sandoe.co.uk>
+
+ Backport from mainline.
+ 2019-10-13 Iain Sandoe <iain@sandoe.co.uk>
+
+ * gcc.target/i386/indirect-thunk-1.c: Allow 'l' or 'L' in
+ indirection label prefix, for Darwin.
+ * gcc.target/i386/indirect-thunk-2.c: Likewise.
+ * gcc.target/i386/indirect-thunk-3.c: Likewise.
+ * gcc.target/i386/indirect-thunk-4.c: Likewise.
+ * gcc.target/i386/indirect-thunk-attr-1.c: Likewise.
+ * gcc.target/i386/indirect-thunk-attr-2.c: Likewise.
+ * gcc.target/i386/indirect-thunk-attr-3.c: Likewise.
+ * gcc.target/i386/indirect-thunk-attr-4.c: Likewise.
+ * gcc.target/i386/indirect-thunk-attr-5.c: Likewise.
+ * gcc.target/i386/indirect-thunk-attr-6.c: Likewise.
+ * gcc.target/i386/indirect-thunk-extern-1.c: Likewise.
+ * gcc.target/i386/indirect-thunk-extern-2.c: Likewise.
+ * gcc.target/i386/indirect-thunk-extern-3.c: Likewise.
+ * gcc.target/i386/indirect-thunk-extern-4.c: Likewise.
+ * gcc.target/i386/indirect-thunk-inline-1.c: Likewise.
+ * gcc.target/i386/indirect-thunk-inline-2.c: Likewise.
+ * gcc.target/i386/indirect-thunk-inline-3.c: Likewise.
+ * gcc.target/i386/indirect-thunk-inline-4.c: Likewise.
+ * gcc.target/i386/pr32219-2.c: Likewise.
+ * gcc.target/i386/pr32219-3.c: Likewise.
+ * gcc.target/i386/pr32219-4.c: Likewise.
+ * gcc.target/i386/pr32219-7.c: Likewise.
+ * gcc.target/i386/pr32219-8.c: Likewise.
+ * gcc.target/i386/ret-thunk-14.c: Likewise.
+ * gcc.target/i386/ret-thunk-15.c: Likewise.
+ * gcc.target/i386/ret-thunk-9.c: Likewise.
+
+2019-10-30 Iain Sandoe <iain@sandoe.co.uk>
+
+ Backport from mainline.
+ 2019-08-13 Iain Sandoe <iain@sandoe.co.uk>
+
+ * obj-c++.dg/stubify-1.mm: Rename symbol stub option.
+ * obj-c++.dg/stubify-2.mm: Likewise.
+ * objc.dg/stubify-1.m: Likewise.
+ * objc.dg/stubify-2.m: Likewise.
+
+2019-10-30 Dragan Mladjenovic <dmladjenovic@wavecomp.com>
+
+ Backport from mainline
+ 2019-07-09 Dragan Mladjenovic <dmladjenovic@wavecomp.com>
+
+ * gcc.target/mips/cfgcleanup-jalr1.c: New test.
+ * gcc.target/mips/cfgcleanup-jalr2.c: New test.
+ * gcc.target/mips/cfgcleanup-jalr3.c: New test.
+
+2019-10-29 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/92201
+ * g++.dg/other/pr92201.C: New test.
+
+2019-10-28  Paul Thomas  <pault@gcc.gnu.org>
+
+ Backport from trunk
+ PR fortran/91926
+ * gfortran.dg/ISO_Fortran_binding_13.f90: New test.
+ * gfortran.dg/ISO_Fortran_binding_13.c: Additional source.
+ * gfortran.dg/ISO_Fortran_binding_14.f90: New test.
+
+2019-10-28 Jiufu Guo <guojiufu@linux.ibm.com>
+
+ Backport from mainline
+ PR target/70010
+ * gcc.target/powerpc/pr70010.c: Add -Wno-psabi.
+ * gcc.target/powerpc/pr70010-1.c: Require LTO.
+ * gcc.target/powerpc/pr70010-2.c: Require LTO.
+
+2019-10-28 Uroš Bizjak <ubizjak@gmail.com>
+
+ PR target/92225
+ * gcc.target/i386/pr92225.c: New test.
+
+2019-10-28 Ilya Leoshkevich <iii@linux.ibm.com>
+
+ Backport from mainline
+ PR rtl-optimization/92007
+ * g++.dg/opt/pr92007.C: New test (from Arseny Solokha).
+
+2019-10-28 Peter Bergner <bergner@linux.ibm.com>
+ Jiufu Guo <guojiufu@linux.ibm.com>
+
+ PR target/70010
+ * gcc.target/powerpc/pr70010.c: New test.
+ * gcc.target/powerpc/pr70010-1.c: New test.
+ * gcc.target/powerpc/pr70010-2.c: New test.
+ * gcc.target/powerpc/pr70010-3.c: New test.
+ * gcc.target/powerpc/pr70010-4.c: New test.
+
+2019-10-28 Tobias Burnus <tobias@codesourcery.com>
+
+ Backport from mainline
+ 2019-10-28 Tobias Burnus <tobias@codesourcery.com>
+
+ PR fortran/91863
+ * gfortran.dg/bind-c-intent-out.f90: New.
+
+2019-10-27 Paul Thomas <pault@gcc.gnu.org>
+
+ Backport from mainline
+ PR fortran/86248
+ * gfortran.dg/char_result_19.f90: New test.
+ * gfortran.dg/char_result_mod_19.f90: Module for the new test.
+
+2019-10-25 Richard Earnshaw <rearnsha@arm.com>
+
+ Backport from mainline
+ 2019-05-08 Mihail Ionescu <mihail.ionescu@arm.com>
+ Richard Earnshaw <rearnsha@arm.com>
+ PR target/88167
+ * gcc.target/arm/pr88167-1.c: New test.
+ * gcc.target/arm/pr88167-2.c: New test.
+
+2019-10-24 Mihail Ionescu <mihail.ionescu@arm.com>
+
+ Backport from mainline
+ 2019-10-18 Andre Vieira <andre.simoesdiasvieira@arm.com>
+
+ * gcc.target/arm/multilib.exp: Add extra tests.
+
+2019-10-23 Martin Liska <mliska@suse.cz>
+
+ Backport from mainline
+ 2019-09-27 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/91885
+ * gcc.dg/pr91885.c (__int64_t): Change from long to long long.
+ (__uint64_t): Change from unsigned long to unsigned long long.
+
+2019-10-23 Martin Liska <mliska@suse.cz>
+
+ Backport from mainline
+ 2019-09-26 Martin Liska <mliska@suse.cz>
+
+ PR tree-optimization/91885
+ * gcc.dg/pr91885.c: New test.
+
+2019-10-23 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gcc.c-torture/execute/20191023-1.c: New test.
+
+2019-10-23 Richard Biener <rguenther@suse.de>
+
+ Backport from mainline
+ 2019-10-17 Richard Biener <rguenther@suse.de>
+
+ PR debug/91887
+ * g++.dg/debug/dwarf2/pr91887.C: New testcase.
+
+2019-10-21 Jakub Jelinek <jakub@redhat.com>
+
+ Backported from mainline
+ 2019-10-17 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/92056
+ * gcc.c-torture/compile/pr92056.c: New test.
+
+ PR fortran/87752
+ * gfortran.dg/gomp/pr87752.f90: New test.
+
+ 2019-10-05 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/91734
+ * gcc.dg/pr91734.c: New test.
+
+ 2019-10-04 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/91974
+ * g++.dg/cpp1z/eval-order5.C: New test.
+
+ 2019-10-01 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/91925
+ * g++.dg/conversion/packed2.C: New test.
+
+ 2019-09-27 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/88203
+ * c-c++-common/gomp/pr88203-1.c: New test.
+ * c-c++-common/gomp/pr88203-2.c: New test.
+ * c-c++-common/gomp/pr88203-3.c: New test.
+
+ PR middle-end/91920
+ * c-c++-common/gomp/pr91920.c: New test.
+
+ 2019-09-11 Jakub Jelinek <jakub@redhat.com>
+
+ PR rtl-optimization/89435
+ PR rtl-optimization/89795
+ PR rtl-optimization/91720
+ * gcc.dg/pr89435.c: New test.
+ * gcc.dg/pr89795.c: New test.
+ * gcc.dg/pr91720.c: New test.
+
+ PR tree-optimization/91723
+ * gcc.dg/vect/vect-fma-3.c: New test.
+
+ 2019-09-07 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/91665
+ * gcc.dg/vect/pr91665.c: New test.
+
+ 2019-09-05 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/91001
+ PR middle-end/91105
+ PR middle-end/91106
+ * gcc.c-torture/compile/pr91001.c: New test.
+
+ 2019-09-02 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/91632
+ * gcc.c-torture/execute/pr91632.c: New test.
+
+ 2019-09-01 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/91623
+ * gcc.target/i386/pr91623.c: New test.
+
+ PR lto/91572
+ * g++.dg/lto/pr91572_0.C: New test.
+
+ 2019-08-29 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/91351
+ * g++.dg/opt/pr91351.C: New test.
+
+ 2019-08-09 Jakub Jelinek <jakub@redhat.com>
+
+ PR c/91401
+ * c-c++-common/gomp/pr91401-1.c: New test.
+ * c-c++-common/gomp/pr91401-2.c: New test.
+
+2019-10-18 Steven G. Kargl <kargl@gcc.gnu.org>
+
+ PR fortran/69455
+ * gfortran.dg/pr69455_1.f90: New test.
+ * gfortran.dg/pr69455_2.f90: Ditto.
+
+2019-10-18 Tobias Burnus <tobias@codesourcery.com>
+
+ Backport from mainline
+ 2019-10-18 Tobias Burnus <tobias@codesourcery.com>
+
+ PR fortran/91586
+ * gfortran.dg/class_71.f90: New.
+
+2019-10-17 Steven G. Kargl <kargl@gcc.gnu.org>
+
+ PR fortran/83113
+ PR fortran/89943
+ * gfortran.dg/pr89943_1.f90: New test.
+ * gfortran.dg/pr89943_2.f90: Ditto.
+ * gfortran.dg/pr89943_3.f90: Ditto.
+ * gfortran.dg/pr89943_4.f90: Ditto.
+
+2019-10-17 Bill Schmidt <wschmidt@linux.ibm.com>
+
+ Backport from mainline
+ 2019-10-15 Bill Schmidt <wschmidt@linux.ibm.com>
+
+ PR target/92093
+ * gcc.target/powerpc/pr91275.c: Fix type and endian issues.
+
+2019-10-16 Richard Biener <rguenther@suse.de>
+
+ Backport from mainline
+ 2019-10-02 Richard Biener <rguenther@suse.de>
+
+ PR c++/91606
+ * g++.dg/torture/pr91606.C: New testcase.
+
+ 2019-09-19 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/91812
+ * gcc.dg/torture/pr91812.c: New testcase.
+
+2019-10-14 Will Schmidt <will_schmidt@vnet.ibm.com>
+
+ Backport from trunk.
+ 2019-09-26 Will Schmidt <will_schmidt@vnet.ibm.com>
+
+ * gcc.target/powerpc/pure-builtin-redundant-load.c: New.
+
+2019-10-11 Steven G. Kargl <kargl@gcc.gnu.org>
+
+ PR fortran/91715
+ * gfortran.dg/function_kinds_5.f90: Prune run-on error.
+ * gfortran.dg/pr85543.f90: Ditto.
+ * gfortran.dg/pr91715.f90: New test.
+
+2019-10-11 Steven G. Kargl <kargl@gcc.gnu.org>
+
+ PR fortran/91649
+ * gfortran.dg/pr91649.f90: New test.
+
+2019-10-10 Steven G. Kargl <kargl@gcc.gnu.org>
+
+ PR fortran/91801
+ * gfortran.dg/pr91801.f90: New test.
+
+2019-10-10 Uroš Bizjak <ubizjak@gmail.com>
+
+ PR target/92022
+ * g++.dg/pr92022.C: New test.
+
+2019-10-07 Thomas Koenig <tkoenig@gcc.gnu.org>
+
+ Backport from trunk
+ PR fortran/84487
+ * gfortran.dg/typebound_call_22.f03: xfail.
+
+2019-10-07 Bill Schmidt <wschmidt@linux.ibm.com>
+
+ Backport from mainline
+ 2019-10-01 Bill Schmidt <wschmdit@linux.ibm.com>
+
+ PR target/91275
+ * gcc.target/powerpc/pr91275.c: New.
+
+2019-10-05 Steven G. Kargl <kargl@gcc.gnu.org>
+
+ PR fortran/47054
+ * gfortran.dg/pr47054_1.f90: New test
+ * gfortran.dg/pr47054_2.f90: Ditto.
+
+2019-10-05 Steven G. Kargl <kargl@gcc.gnu.org>
+
+ PR fortran/91942
+ * gfortran.dg/pr91587.f90: Update dg-error regex.
+ * gfortran.dg/pr91942.f90: New test.
+
+2019-10-04 Steven G. Kargl <kargl@gcc.gnu.org>
+
+ PR fortran/91785
+ * gfortran.dg/pr91785.f90: New test.
+
+2019-10-04 Dragan Mladjenovic <dmladjenovic@wavecomp.com>
+
+ Backport from mainline
+ 2019-10-03 Dragan Mladjenovic <dmladjenovic@wavecomp.com>
+
+ PR target/91769
+ * gcc.target/mips/pr91769.c: New test.
+
+2019-10-02 Bernd Edlinger <bernd.edlinger@hotmail.de>
+
+ Backport from mainline
+
+ 2019-09-13 Bernd Edlinger <bernd.edlinger@hotmail.de>
+
+ PR fortran/91716
+ * gfortran.dg/pr91716.f90: New test.
+
+2019-10-01 Steven G. Kargl <kargl@gcc.gnu.org>
+
+ PR fortran/91864
+ * gcc/testsuite/gfortran.dg/pr91864.f90
+
+2019-10-01 Steven G. Kargl <kargl@gcc.ngu.org>
+
+ PR fortran/91802
+ * gfortran.dg/pr91802.f90: New test.
+
+2019-10-01 Steven G. Kargl <kargl@gcc.gnu.org>
+
+ PR fortran/91714
+ * gfortran.dg/dec_type_print_3.f90: Update dg-error regex.
+ * gfortran.dg/pr91714.f90: New test.
+
+2019-10-01 Steven G. Kargl <kargl@gcc.gnu.org>
+
+ PR fortran/91641
+ * gfortran.dg/pr91641.f90: New test.
+
+2019-10-01 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
+
+ Backport from mainline
+ 2019-09-24 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
+
+ * gcc.target/aarch64/nosplit-di-const-volatile_1.c: New test.
+
+2019-09-25 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
+
+ Backport from mainline
+ 2019-08-22 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
+
+ * gcc.target/arm/acle/crc_hf_1.c: New test.
+
+2019-09-21 Paul Thomas <pault@gcc.gnu.org>
+
+ Backport from mainline
+ PR fortran/91588
+ * gfortran.dg/associate_49.f90: New test.
+
+2019-09-20 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gcc.dg/pr91269.c: New test.
+
+2019-09-19 Steven G. Kargl <kargl@gcc.gnu.org>
+
+ PR fortran/91727
+ * gfortran.dg/pr91727.f90: New test.
+
+2019-09-19 Kito Cheng <kito.cheng@sifive.com>
+
+ Backport from mainline
+ 2019-09-05 Jakub Jelinek <jakub@redhat.com>
+ Jim Wilson <jimw@sifive.com>
+
+ PR target/91635
+ * gcc.c-torture/execute/pr91635.c: New test.
+ * gcc.target/riscv/shift-shift-4.c: New test.
+ * gcc.target/riscv/shift-shift-5.c: New test.
+
+2019-09-18 Thomas Koenig <tkoenig@gcc.gnu.org>
+
+ Backport from trunk
+ PR fortran/91550
+ * gfortran.dg/do_subscript_6.f90: New test.
+
+2019-09-15 Thomas Koenig <tkoenig@gcc.gnu.org>
+
+ Backport from trunk
+ PR fortran/91557
+ * gfortran.dg/warn_unused_dummy_argument_5.f90: New test.
+
+2019-09-14 Steven G. Kargl <kargl@gcc.gnu.org>
+
+ PR fortran/91553
+ * gfortran.dg/pr91553.f90: New test.
+
+2019-09-14 Steven G. Kargl <kargl@gcc.gnu.org>
+
+ PR fortran/91566
+ * gfortran.dg/pr91566.f90: New test.
+
+2019-09-14 Steven G. Kargl <kargl@gcc.gnu.org>
+
+ PR fortran/91642
+ * gfortran.dg/pr91642.f90: New test.
+
+2019-09-11 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gcc.target/sparc/20161111-1.c: XFAIL redundant zero-extension test.
+
+2019-09-09 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/87853
+ * gcc.target/i386/pr87853.c: New test.
+
+ PR target/91704
+ * gcc.target/i386/pr91704.c: New test.
+
+2019-09-07 Paul Thomas <pault@gcc.gnu.org>
+
+ Backport from mainline
+ PR fortran/91589
+ * gfortran.dg/pr91589.f90: New test.
+
+2019-09-05 Harald Anlauf <anlauf@gmx.de>
+
+ Backport from mainline
+ PR fortran/91496
+ * gfortran.dg/pr91496.f90: New testcase.
+
+ PR fortran/91496
+ * gfortran.dg/directive_unroll_5.f90: Adjust error message.
+
+2019-09-05 Steven G. Kargl <kargl@gcc.gnu.org>
+
+ PR fortran/91660
+ * gfortran.dg/pdt_4.f03: Fix invalid code.
+ * gfortran.dg/pr91660_1.f90: New test.
+ * gfortran.dg/pr91660_2.f90: Ditto.
+
+2019-09-04 Wilco Dijkstra <wdijkstr@arm.com>
+
+ Backport from mainline
+ 2019-08-13 Wilco Dijkstra <wdijkstr@arm.com>
+
+ PR target/81800
+ * gcc.target/aarch64/no-inline-lrint_3.c: New test.
+
+2019-09-03 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/91597
+ * gcc.c-torture/execute/pr91597.c: New test.
+
+2019-09-02 Steven G. Kargl <kargl@gc.gnu.org>
+
+ PR fortran/91552
+ * gfortran.dg/pr91552.f90: New test.
+
+2019-09-02 Martin Liska <mliska@suse.cz>
+
+ Backport from mainline
+ 2019-09-02 Martin Liska <mliska@suse.cz>
+
+ PR c++/91155
+ * g++.dg/torture/pr91155.C: New test.
+
+2019-09-01 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gcc.c-torture/execute/20190901-1.c: New test.
+
+2019-08-30 Steven G. Kargl <kargl@gcc.gnu.org>
+
+ PR fortran/91587
+ * gfortran.dg/pr91587.f90: New test.
+
+2019-08-30 Steven G. Kargl <kargl@gcc.gnu.org>
+
+ PR fortran/91565
+ * gfortran.dg/pr91565.f90: New test.
+
+2019-08-30 Steven G. Kargl <kargl@gcc.gnu.org>
+
+ PR fortran/91564
+ * gfortran.dg/pr91564.f90: New test.
+
+2019-08-30 Steven G. Kargl <kargl@gcc.gnu.org>
+
+ PR fortran/91551
+ * gfortran.dg/allocated_3.f90
+
+2019-08-30 Segher Boessenkool <segher@kernel.crashing.org>
+
+ Backport from trunk
+ 2019-08-23 Segher Boessenkool <segher@kernel.crashing.org>
+
+ PR target/91481
+ * gcc.target/powerpc/darn-3.c: New testcase.
+
+2019-08-30 Richard Biener <rguenther@suse.de>
+
+ Backport from mainline
+ 2019-04-29 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/90278
+ * gcc.dg/torture/pr90278.c: New testcase.
+
+2019-08-29 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/91568
+ * gfortran.dg/pr91568.f: New testcase.
+
+2019-08-28 Richard Biener <rguenther@suse.de>
+
+ Backport from mainline
+ 2019-05-27 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/90637
+ * gcc.dg/gomp/pr90637.c: New testcase.
+
2019-08-23 Mihailo Stojanovic <mistojanovic@wavecomp.com>
* gcc.target/mips/get-fcsr-3.c: New test.
@@ -558,7 +1320,7 @@
Backport from mainline.
2019-05-15 Iain Sandoe <iain@sandoe.co.uk>
- * lib/target-supports.exp
+ * lib/target-supports.exp
(check_effective_target_powerpc_p8vector_ok): No support for Darwin.
(check_effective_target_powerpc_p9vector_ok): Likewise.
(check_effective_target_powerpc_float128_sw_ok): Likewise.
@@ -851,7 +1613,7 @@
Backport from mainline
PR fortran/91077
- * gfortran.dg/pointer_array_11.f90 : New test.
+ * gfortran.dg/pointer_array_11.f90: New test.
2019-07-05 Szabolcs Nagy <szabolcs.nagy@arm.com>
@@ -1100,7 +1862,7 @@
* gcc.target/i386/pr82699-6.c: Likewise
* gcc.target/i386/returninst1.c: Likewise
* gcc.target/i386/returninst2.c: Likewise
- * gcc.target/i386/returninst3.c : Likewise
+ * gcc.target/i386/returninst3.c: Likewise
2019-05-30 Iain Sandoe <iain@sandoe.co.uk>
@@ -1262,7 +2024,7 @@
Backport from trunk
PR fortran/90498
- * gfortran.dg/associate_48.f90 : New test.
+ * gfortran.dg/associate_48.f90: New test.
2019-05-17 Jakub Jelinek <jakub@redhat.com>
@@ -3932,21 +4694,21 @@
2019-02-23 Paul Thomas <pault@gcc.gnu.org>
PR fortran/88117
- * gfortran.dg/deferred_character_32.f90 : New test
+ * gfortran.dg/deferred_character_32.f90: New test
2019-02-23 Paul Thomas <pault@gcc.gnu.org>
PR fortran/89385
- * gfortran.dg/ISO_Fortran_binding_1.f90 : Correct test for
+ * gfortran.dg/ISO_Fortran_binding_1.f90: Correct test for
previously incorrect lbound for allocatable expressions. Also
correct stop values to avoid repetition.
- * gfortran.dg/ISO_Fortran_binding_5.f90 : New test
- * gfortran.dg/ISO_Fortran_binding_5.c : Support previous test.
+ * gfortran.dg/ISO_Fortran_binding_5.f90: New test
+ * gfortran.dg/ISO_Fortran_binding_5.c: Support previous test.
PR fortran/89366
- * gfortran.dg/ISO_Fortran_binding_6.f90 : New test
- * gfortran.dg/ISO_Fortran_binding_6.c : Support previous test.
- * gfortran.dg/pr32599.f03 : Set standard to F2008.
+ * gfortran.dg/ISO_Fortran_binding_6.f90: New test
+ * gfortran.dg/ISO_Fortran_binding_6.c: Support previous test.
+ * gfortran.dg/pr32599.f03: Set standard to F2008.
2019-02-22 David Malcolm <dmalcolm@redhat.com>
@@ -4575,7 +5337,7 @@
2019-02-09 Paul Thomas <pault@gcc.gnu.org>
PR fortran/89200
- * gfortran.dg/array_reference_2.f90 : New test.
+ * gfortran.dg/array_reference_2.f90: New test.
2019-02-09 Jakub Jelinek <jakub@redhat.com>
@@ -4835,17 +5597,17 @@
2019-02-02 Paul Thomas <pault@gcc.gnu.org>
PR fortran/88393
- * gfortran.dg/alloc_comp_assign_16.f03 : New test.
+ * gfortran.dg/alloc_comp_assign_16.f03: New test.
2019-02-02 Paul Thomas <pault@gcc.gnu.org>
PR fortran/88980
- * gfortran.dg/realloc_on_assign_32.f90 : New test.
+ * gfortran.dg/realloc_on_assign_32.f90: New test.
2019-02-02 Paul Thomas <pault@gcc.gnu.org>
PR fortran/88685
- * gfortran.dg/pointer_array_component_3.f90 : New test.
+ * gfortran.dg/pointer_array_component_3.f90: New test.
2019-02-02 Jakub Jelinek <jakub@redhat.com>
diff --git a/gcc/testsuite/c-c++-common/cpp/pr92296-1.c b/gcc/testsuite/c-c++-common/cpp/pr92296-1.c
new file mode 100644
index 00000000000..4bd69c8be87
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/cpp/pr92296-1.c
@@ -0,0 +1,32 @@
+/* PR preprocessor/92296 */
+/* { dg-do preprocess } */
+
+#pragma push_macro("__TIMESTAMP__")
+#pragma pop_macro("__TIMESTAMP__")
+
+#pragma push_macro("__TIME__")
+#pragma pop_macro("__TIME__")
+
+#pragma push_macro("__DATE__")
+#pragma pop_macro("__DATE__")
+
+#pragma push_macro("__FILE__")
+#pragma pop_macro("__FILE__")
+
+#pragma push_macro("__BASE_FILE__")
+#pragma pop_macro("__BASE_FILE__")
+
+#pragma push_macro("__LINE__")
+#pragma pop_macro("__LINE__")
+
+#pragma push_macro("__INCLUDE_LEVEL__")
+#pragma pop_macro("__INCLUDE_LEVEL__")
+
+#pragma push_macro("__COUNTER__")
+#pragma pop_macro("__COUNTER__")
+
+#pragma push_macro("__has_attribute")
+#pragma pop_macro("__has_attribute")
+
+#pragma push_macro("__has_cpp_attribute")
+#pragma pop_macro("__has_cpp_attribute")
diff --git a/gcc/testsuite/c-c++-common/cpp/pr92296-2.c b/gcc/testsuite/c-c++-common/cpp/pr92296-2.c
new file mode 100644
index 00000000000..15362a4bdc3
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/cpp/pr92296-2.c
@@ -0,0 +1,73 @@
+/* PR preprocessor/92296 */
+/* { dg-do preprocess } */
+/* { dg-options "-Wno-builtin-macro-redefined" } */
+
+#pragma push_macro("__TIMESTAMP__")
+#undef __TIMESTAMP__
+#define __TIMESTAMP__ "Thu Oct 31 12:00:00 2019"
+timestamp1 = __TIMESTAMP__
+#pragma pop_macro("__TIMESTAMP__")
+timestamp2 = __TIMESTAMP__
+
+#pragma push_macro("__TIME__")
+#undef __TIME__
+#define __TIME__ "12:00:00"
+time1 = __TIME__
+#pragma pop_macro("__TIME__")
+time2 = __TIME__
+
+#pragma push_macro("__DATE__")
+#undef __DATE__
+#define __DATE__ "Oct 31 2019"
+date1 = __DATE__
+#pragma pop_macro("__DATE__")
+date2 = __DATE__
+
+#pragma push_macro("__FILE__")
+#undef __FILE__
+#define __FILE__ "pr92296-3.c"
+file1 = __FILE__ /* { dg-final { scan-file pr92296-2.i "file1 = \"pr92296-3.c\"" } } */
+#pragma pop_macro("__FILE__")
+file2 = __FILE__ /* { dg-final { scan-file-not pr92296-2.i "file2 = \"pr92296-3.c\"" } } */
+
+#pragma push_macro("__BASE_FILE__")
+#undef __BASE_FILE__
+#define __BASE_FILE__ "pr92296-4.c"
+filebase1 = __BASE_FILE__ /* { dg-final { scan-file pr92296-2.i "filebase1 = \"pr92296-4.c\"" } } */
+#pragma pop_macro("__BASE_FILE__")
+filebase2 = __BASE_FILE__ /* { dg-final { scan-file-not pr92296-2.i "filebase2 = \"pr92296-4.c\"" } } */
+
+#pragma push_macro("__LINE__")
+#undef __LINE__ /* { dg-warning "undefining" } */
+#define __LINE__ 142
+line1 = __LINE__ /* { dg-final { scan-file pr92296-2.i "line1 = 142" } } */
+#pragma pop_macro("__LINE__")
+line2 = __LINE__ /* { dg-final { scan-file pr92296-2.i "line2 = 45" } } */
+
+#pragma push_macro("__INCLUDE_LEVEL__")
+#undef __INCLUDE_LEVEL__ /* { dg-warning "undefining" } */
+#define __INCLUDE_LEVEL__ 42
+includelevel1 = __INCLUDE_LEVEL__ /* { dg-final { scan-file pr92296-2.i "includelevel1 = 42" } } */
+#pragma pop_macro("__INCLUDE_LEVEL__")
+includelevel2 = __INCLUDE_LEVEL__ /* { dg-final { scan-file pr92296-2.i "includelevel2 = 0" } } */
+
+#pragma push_macro("__COUNTER__")
+#undef __COUNTER__ /* { dg-warning "undefining" } */
+#define __COUNTER__ 172
+counter1 = __COUNTER__ /* { dg-final { scan-file pr92296-2.i "counter1 = 172" } } */
+#pragma pop_macro("__COUNTER__")
+counter2 = __COUNTER__ /* { dg-final { scan-file-not pr92296-2.i "counter2 = 172" } } */
+
+#pragma push_macro("__has_attribute")
+#undef __has_attribute /* { dg-warning "undefining" } */
+#define __has_attribute(x) 0
+hasattr1 = __has_attribute(noreturn) /* { dg-final { scan-file pr92296-2.i "hasattr1 = 0" } } */
+#pragma pop_macro("__has_attribute")
+hasattr2 = __has_attribute(noreturn) /* { dg-final { scan-file-not pr92296-2.i "hasattr2 = 0" } } */
+
+#pragma push_macro("__has_cpp_attribute")
+#undef __has_cpp_attribute /* { dg-warning "undefining" } */
+#define __has_cpp_attribute(x) 0
+hasattrcpp1 = __has_cpp_attribute(noreturn) /* { dg-final { scan-file pr92296-2.i "hasattrcpp1 = 0" } } */
+#pragma pop_macro("__has_cpp_attribute")
+hasattrcpp2 = __has_cpp_attribute(noreturn) /* { dg-final { scan-file-not pr92296-2.i "hasattrcpp2 = 0" } } */
diff --git a/gcc/testsuite/c-c++-common/gomp/pr88203-1.c b/gcc/testsuite/c-c++-common/gomp/pr88203-1.c
new file mode 100644
index 00000000000..54a686487c9
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/gomp/pr88203-1.c
@@ -0,0 +1,61 @@
+/* PR c++/88203 */
+/* { dg-do compile } */
+/* { dg-additional-options "-std=c99" { target c } } */
+/* { dg-additional-options "-std=c++11" { target c++ } } */
+
+void foo (const char *);
+#pragma omp declare target to (foo)
+
+void
+f1 (void)
+{
+ #pragma omp parallel default(none)
+ foo (__func__);
+}
+
+void
+f2 (void)
+{
+ #pragma omp parallel default(none) shared(__func__)
+ foo (__func__);
+}
+
+void
+f3 (void)
+{
+ #pragma omp parallel default(none) firstprivate(__func__)
+ foo (__func__);
+}
+
+void
+f4 (void)
+{
+ foo (__func__);
+ #pragma omp parallel default(none)
+ foo (__func__);
+}
+
+void
+f5 (void)
+{
+ foo (__func__);
+ #pragma omp parallel default(none) shared(__func__)
+ foo (__func__);
+}
+
+void
+f6 (void)
+{
+ foo (__func__);
+ #pragma omp parallel default(none) firstprivate(__func__)
+ foo (__func__);
+}
+
+void
+f7 (void)
+{
+ #pragma omp target map(to: __func__)
+ foo (__func__);
+ #pragma omp task depend(inout:__func__)
+ foo (__func__);
+}
diff --git a/gcc/testsuite/c-c++-common/gomp/pr88203-2.c b/gcc/testsuite/c-c++-common/gomp/pr88203-2.c
new file mode 100644
index 00000000000..90c4a720774
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/gomp/pr88203-2.c
@@ -0,0 +1,65 @@
+/* PR c++/88203 */
+/* { dg-do compile } */
+/* { dg-additional-options "-std=gnu99" { target c } } */
+/* { dg-additional-options "-std=gnu++11" { target c++ } } */
+
+void foo (const char *, const char *);
+#pragma omp declare target to (foo)
+
+void
+f1 (void)
+{
+ #pragma omp parallel default(none)
+ foo (__FUNCTION__, __PRETTY_FUNCTION__);
+}
+
+void
+f2 (void)
+{
+ #pragma omp parallel default(none) shared(__FUNCTION__, __PRETTY_FUNCTION__)
+ foo (__FUNCTION__, __PRETTY_FUNCTION__);
+ #pragma omp parallel default(none) shared(__FUNCTION__) firstprivate(__PRETTY_FUNCTION__)
+ foo (__FUNCTION__, __PRETTY_FUNCTION__);
+}
+
+void
+f3 (void)
+{
+ #pragma omp parallel default(none) firstprivate(__FUNCTION__, __PRETTY_FUNCTION__)
+ foo (__FUNCTION__, __PRETTY_FUNCTION__);
+ #pragma omp parallel default(none) firstprivate(__FUNCTION__), shared(__PRETTY_FUNCTION__)
+ foo (__FUNCTION__, __PRETTY_FUNCTION__);
+}
+
+void
+f4 (void)
+{
+ foo (__FUNCTION__, __PRETTY_FUNCTION__);
+ #pragma omp parallel default(none)
+ foo (__FUNCTION__, __PRETTY_FUNCTION__);
+}
+
+void
+f5 (void)
+{
+ foo (__FUNCTION__, __PRETTY_FUNCTION__);
+ #pragma omp parallel default(none) shared(__FUNCTION__, __PRETTY_FUNCTION__)
+ foo (__FUNCTION__, __PRETTY_FUNCTION__);
+}
+
+void
+f6 (void)
+{
+ foo (__FUNCTION__, __PRETTY_FUNCTION__);
+ #pragma omp parallel default(none) firstprivate(__FUNCTION__, __PRETTY_FUNCTION__)
+ foo (__FUNCTION__, __PRETTY_FUNCTION__);
+}
+
+void
+f7 (void)
+{
+ #pragma omp target map(to: __FUNCTION__, __PRETTY_FUNCTION__)
+ foo (__FUNCTION__, __PRETTY_FUNCTION__);
+ #pragma omp task depend(inout:__FUNCTION__, __PRETTY_FUNCTION__)
+ foo (__FUNCTION__, __PRETTY_FUNCTION__);
+}
diff --git a/gcc/testsuite/c-c++-common/gomp/pr88203-3.c b/gcc/testsuite/c-c++-common/gomp/pr88203-3.c
new file mode 100644
index 00000000000..6a9585d3281
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/gomp/pr88203-3.c
@@ -0,0 +1,28 @@
+/* PR c++/88203 */
+/* { dg-do compile } */
+/* { dg-additional-options "-std=c99" { target c } } */
+/* { dg-additional-options "-std=c++11" { target c++ } } */
+
+void foo (const char *);
+#pragma omp declare target to (foo)
+
+void
+f1 (void)
+{
+ #pragma omp parallel for lastprivate (__func__) /* { dg-error "'__func__' is predetermined 'shared' for 'lastprivate'" } */
+ for (int i = 0; i < 2; i++)
+ foo (__func__);
+ #pragma omp parallel private (__func__) /* { dg-error "'__func__' is predetermined 'shared' for 'private'" } */
+ foo (__func__);
+}
+
+void
+f2 (void)
+{
+ foo (__func__);
+ #pragma omp parallel default(none) private (__func__) /* { dg-error "'__func__' is predetermined 'shared' for 'private'" } */
+ foo (__func__);
+ #pragma omp parallel for default(none) lastprivate (__func__) /* { dg-error "'__func__' is predetermined 'shared' for 'lastprivate'" } */
+ for (int i = 0; i < 2; i++)
+ foo (__func__);
+}
diff --git a/gcc/testsuite/c-c++-common/gomp/pr91401-1.c b/gcc/testsuite/c-c++-common/gomp/pr91401-1.c
new file mode 100644
index 00000000000..f588bf6f16c
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/gomp/pr91401-1.c
@@ -0,0 +1,10 @@
+/* PR c/91401 */
+
+void
+foo (void)
+{
+ int i;
+ #pragma omp distribute parallel for schedule (static) dist_schedule (static)
+ for (i = 0; i < 64; i++)
+ ;
+}
diff --git a/gcc/testsuite/c-c++-common/gomp/pr91401-2.c b/gcc/testsuite/c-c++-common/gomp/pr91401-2.c
new file mode 100644
index 00000000000..f537e66e27c
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/gomp/pr91401-2.c
@@ -0,0 +1,15 @@
+#pragma omp declare target
+void f0 (void);
+
+void
+f1 (void)
+{
+ int i;
+ #pragma omp distribute dist_schedule(static) dist_schedule(static) /* { dg-warning "too many 'dist_schedule' clauses" } */
+ for (i = 0; i < 8; ++i)
+ f0 ();
+ #pragma omp distribute dist_schedule(static,2) dist_schedule(static,4) /* { dg-warning "too many 'dist_schedule' clauses" } */
+ for (i = 0; i < 8; ++i)
+ f0 ();
+}
+#pragma omp end declare target
diff --git a/gcc/testsuite/c-c++-common/gomp/pr91920.c b/gcc/testsuite/c-c++-common/gomp/pr91920.c
new file mode 100644
index 00000000000..604fd5986f8
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/gomp/pr91920.c
@@ -0,0 +1,19 @@
+/* PR middle-end/91920 */
+
+void bar (float *);
+
+void
+foo (void)
+{
+ int i;
+ float f[3] = { 0.0f, 0.0f, 0.0f };
+#pragma omp parallel for default(none) reduction(+:f[:3])
+ for (i = 0; i < 1000; i++)
+ {
+ int j;
+ float k[3] = { 0.25f, 0.5f, 0.75f };
+ for (j = 0; j < 3; j++)
+ f[j] += k[j];
+ }
+ bar (f);
+}
diff --git a/gcc/testsuite/g++.dg/conversion/packed2.C b/gcc/testsuite/g++.dg/conversion/packed2.C
new file mode 100644
index 00000000000..7df74dc110b
--- /dev/null
+++ b/gcc/testsuite/g++.dg/conversion/packed2.C
@@ -0,0 +1,15 @@
+// PR c++/91925
+// { dg-do compile { target c++11 } }
+// { dg-options "-fpack-struct" }
+
+struct A {};
+int foo (A);
+struct B {
+ A a;
+ decltype (foo (a)) p;
+};
+template <typename T> T bar (T);
+class C {
+ A a;
+ decltype (bar (a)) p;
+};
diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-92015.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-92015.C
new file mode 100644
index 00000000000..60f288ee993
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-92015.C
@@ -0,0 +1,7 @@
+// PR c++/92015
+// { dg-do compile { target c++11 } }
+
+struct S1 { char c[6] {'h', 'e', 'l', 'l', 'o', 0}; };
+struct S2 { char c[6] = "hello"; };
+static_assert (S1{}.c[0] == 'h', "");
+static_assert (S2{}.c[0] == 'h', "");
diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-odr1.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-odr1.C
new file mode 100644
index 00000000000..cf3f95f0565
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-odr1.C
@@ -0,0 +1,19 @@
+// PR c++/92062 - ODR-use ignored for static member of class template.
+// { dg-do run { target c++11 } }
+
+template<int> struct A {
+ static const bool x;
+ static_assert(&x, ""); // odr-uses A<...>::x
+};
+
+int g;
+
+template<int I>
+const bool A<I>::x = (g = 42, false);
+
+void f(A<0>) {} // A<0> must be complete, so is instantiated
+int main()
+{
+ if (g != 42)
+ __builtin_abort ();
+}
diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-odr2.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-odr2.C
new file mode 100644
index 00000000000..0927488e569
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-odr2.C
@@ -0,0 +1,19 @@
+// PR c++/92062 - ODR-use ignored for static member of class template.
+// { dg-do run { target c++11 } }
+
+template<int> struct A {
+ static const bool x;
+ enum { force_instantiation =! &x}; // odr-uses A<...>::x
+};
+
+int g;
+
+template<int I>
+const bool A<I>::x = (g = 42, false);
+
+void f(A<0>) {} // A<0> must be complete, so is instantiated
+int main()
+{
+ if (g != 42)
+ __builtin_abort ();
+}
diff --git a/gcc/testsuite/g++.dg/cpp0x/nontype5.C b/gcc/testsuite/g++.dg/cpp0x/nontype5.C
new file mode 100644
index 00000000000..c31134581aa
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/nontype5.C
@@ -0,0 +1,17 @@
+// PR c++/91923 - failure-to-SFINAE with class type NTTP in C++17.
+// { dg-do compile { target c++11 } }
+
+template<typename T>
+constexpr bool is_integral_(...) {
+ return false;
+}
+template<typename T, T = 1>
+constexpr bool is_integral_(long) {
+ return true;
+}
+
+static_assert(is_integral_<int>(42), "");
+static_assert(!is_integral_<void>(42), "");
+
+struct S {};
+static_assert(!is_integral_<S>(42), "");
diff --git a/gcc/testsuite/g++.dg/cpp0x/overload-conv-4.C b/gcc/testsuite/g++.dg/cpp0x/overload-conv-4.C
new file mode 100644
index 00000000000..6fcdbbaa6a4
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/overload-conv-4.C
@@ -0,0 +1,23 @@
+// PR c++/90998 - ICE with copy elision in init by ctor and -Wconversion.
+// { dg-do compile { target c++11 } }
+// { dg-options "-Wconversion" }
+
+struct B;
+
+struct A {
+ operator B();
+};
+
+struct B {
+ B(A const &rs);
+ B(B const &rs);
+};
+
+B
+f (A x)
+{
+ // C++14: we call B::B(A const &)
+ // C++17: we call A::operator B()
+ return B(x); // { dg-warning "choosing .A::operator B\\(\\). over .B::B\\(const A&\\)" "" { target c++17 } }
+ // { dg-warning "for conversion from .A. to .B." "" { target c++17 } .-1 }
+}
diff --git a/gcc/testsuite/g++.dg/cpp1y/constexpr-incr2.C b/gcc/testsuite/g++.dg/cpp1y/constexpr-incr2.C
new file mode 100644
index 00000000000..0d22851e4b2
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp1y/constexpr-incr2.C
@@ -0,0 +1,66 @@
+// PR c++/91705 - constexpr evaluation rejects ++/-- on floats.
+// { dg-do compile { target c++14 } }
+
+#define SA(X) static_assert((X),#X)
+
+template <class T>
+constexpr T fn1(T t)
+{
+ return ++t;
+}
+
+constexpr float fn2(float t)
+{
+ return ++t;
+}
+
+template <class T>
+constexpr T fn3(T t)
+{
+ return --t;
+}
+
+constexpr float fn4(float t)
+{
+ return --t;
+}
+
+template <class T>
+constexpr T fn5(T t)
+{
+ return t++;
+}
+
+constexpr float fn6(float t)
+{
+ return t++;
+}
+
+template <class T>
+constexpr T fn7(T t)
+{
+ return t--;
+}
+
+constexpr float fn8(float t)
+{
+ return t--;
+}
+
+constexpr double r1 = fn1(2.0f);
+SA(r1 == 3);
+constexpr double r2 = fn2(2.0f);
+SA(r2 == 3);
+constexpr double r3 = fn3(2.0f);
+SA(r3 == 1);
+constexpr double r4 = fn4(2.0f);
+SA(r4 == 1);
+
+constexpr double r5 = fn5(2.0f);
+SA(r5 == 2);
+constexpr double r6 = fn6(2.0f);
+SA(r6 == 2);
+constexpr double r7 = fn7(2.0f);
+SA(r7 == 2);
+constexpr double r8 = fn8(2.0f);
+SA(r8 == 2);
diff --git a/gcc/testsuite/g++.dg/cpp1y/nontype1.C b/gcc/testsuite/g++.dg/cpp1y/nontype1.C
new file mode 100644
index 00000000000..a37e996a3ff
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp1y/nontype1.C
@@ -0,0 +1,42 @@
+// PR c++/91129 - wrong error with binary op in template argument.
+// { dg-do compile { target c++14 } }
+
+template<class T, T v>
+struct C
+{
+ constexpr operator T() const { return v; }
+ constexpr auto operator()() const { return v; }
+};
+
+template<class T, int N>
+struct A
+{
+};
+
+template<int N>
+void foo ()
+{
+ A<int, C<int, 6>{}> a0;
+ A<int, !C<int, 6>{}> a1;
+ A<int, N / C<int, 6>{}> a2;
+ A<int, N % C<int, 6>{}> a3;
+ A<int, N * C<int, 6>{}> a4;
+ A<int, N ^ C<int, 6>{}> a5;
+ A<int, N | C<int, 6>{}> a6;
+ A<int, N & C<int, 6>{}> a7;
+ A<int, N + C<int, 6>{}> a8;
+ A<int, N - C<int, 6>{}> a9;
+ A<int, -C<int, 6>{}> a10;
+ A<int, (N >> C<int, 6>{})> a11;
+ A<int, N << C<int, 6>{}> a12;
+ A<int, ~C<int, 6>{}> a13;
+ A<int, N || C<int, 6>{}> a14;
+ A<int, N && C<int, 6>{}> a15;
+ A<int, N == C<int, 6>{}> a16;
+ A<int, N != C<int, 6>{}> a17;
+}
+
+int main()
+{
+ foo<10>();
+}
diff --git a/gcc/testsuite/g++.dg/cpp1y/var-templ63.C b/gcc/testsuite/g++.dg/cpp1y/var-templ63.C
new file mode 100644
index 00000000000..a65f53b2963
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp1y/var-templ63.C
@@ -0,0 +1,5 @@
+// PR c++/91740 - ICE with constexpr call and ?: in ARRAY_REF.
+// { dg-do compile { target c++14 } }
+
+constexpr bool f(const char*) { return true; }
+template<typename T> const char c = "FOO"[f("BAR") ? 1 : 0];
diff --git a/gcc/testsuite/g++.dg/cpp1z/decomp50.C b/gcc/testsuite/g++.dg/cpp1z/decomp50.C
new file mode 100644
index 00000000000..5400a826948
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp1z/decomp50.C
@@ -0,0 +1,51 @@
+// PR c++/92106 - ICE with structured bindings and -Wreturn-local-addr.
+// { dg-do compile { target c++17 } }
+
+template <typename> struct B;
+template <typename _Tp> struct B<_Tp *> { typedef _Tp& reference; };
+struct C {
+ template <typename _Up> using rebind = _Up *;
+};
+template <typename _Iterator, typename> class D {
+public:
+ typename B<_Iterator>::reference operator*();
+ void operator++();
+};
+
+template <typename _Iterator, typename _Container>
+bool operator!=(D<_Iterator, _Container>, D<_Iterator, _Container>);
+template <typename _Tp> class F {
+public:
+ typedef _Tp value_type;
+};
+
+template <typename _Alloc> struct G {
+ template <typename _Tp> struct H { using type = C::rebind<_Tp>; };
+ using const_pointer = typename H<typename _Alloc::value_type>::type;
+};
+template <typename _Tp, typename _Alloc = F<_Tp>> class I {
+ typedef D<typename G<_Alloc>::const_pointer, int> const_iterator;
+
+public:
+ const_iterator begin();
+ const_iterator end();
+};
+
+struct A {
+ struct J {
+ int name;
+ int value;
+ };
+ I<J> members;
+ template <typename Key> const int *find(Key) {
+ for (const auto &[name, value] : members)
+ // See <https://gcc.gnu.org/ml/gcc-patches/2019-10/msg01107.html>
+ // for why we don't warn here.
+ return &value; // { dg-bogus "address of local variable" }
+ return nullptr;
+ }
+};
+int main() {
+ A a;
+ a.find("");
+}
diff --git a/gcc/testsuite/g++.dg/cpp1z/eval-order5.C b/gcc/testsuite/g++.dg/cpp1z/eval-order5.C
new file mode 100644
index 00000000000..a8f06ed421a
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp1z/eval-order5.C
@@ -0,0 +1,31 @@
+// PR c++/91974
+// { dg-do run }
+// { dg-options "-fstrong-eval-order" }
+
+extern "C" void abort ();
+
+bool ok = false;
+
+void
+foo (int x)
+{
+ if (x != 0)
+ abort ();
+ ok = true;
+}
+
+void
+bar (int)
+{
+ abort ();
+}
+
+int
+main ()
+{
+ typedef void (*T) (int);
+ T fn = foo;
+ fn ((fn = bar, 0));
+ if (fn != bar || !ok)
+ abort ();
+}
diff --git a/gcc/testsuite/g++.dg/cpp2a/attr-likely6.C b/gcc/testsuite/g++.dg/cpp2a/attr-likely6.C
new file mode 100644
index 00000000000..a04021e5037
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp2a/attr-likely6.C
@@ -0,0 +1,14 @@
+// PR c++/92343
+// { dg-do compile { target c++14 } }
+
+constexpr bool
+foo (bool x)
+{
+ if (x)
+ [[unlikely]] return true;
+ else
+ [[likely]] return false;
+}
+
+static_assert (foo (true), "");
+static_assert (!foo (false), "");
diff --git a/gcc/testsuite/g++.dg/debug/dwarf2/pr91887.C b/gcc/testsuite/g++.dg/debug/dwarf2/pr91887.C
new file mode 100644
index 00000000000..6cd99cc9bb8
--- /dev/null
+++ b/gcc/testsuite/g++.dg/debug/dwarf2/pr91887.C
@@ -0,0 +1,12 @@
+// { dg-do compile }
+// { dg-require-effective-target c++11 }
+// { dg-options "-g -fdebug-types-section" }
+class A {
+public:
+ A();
+ template <typename U> A(U);
+};
+template <class> struct B { typedef A type; };
+template <class R, typename... Args>
+int Bind(R(Args...), typename B<Args>::type...) { return 0; }
+void KeepBufferRefs(A, A) { A a, b(Bind(KeepBufferRefs, a, b)); }
diff --git a/gcc/testsuite/g++.dg/diagnostic/pr90767-1.C b/gcc/testsuite/g++.dg/diagnostic/pr90767-1.C
new file mode 100644
index 00000000000..7d1cd3db398
--- /dev/null
+++ b/gcc/testsuite/g++.dg/diagnostic/pr90767-1.C
@@ -0,0 +1,15 @@
+// PR c++/90767
+// { dg-do compile }
+
+struct X {
+ int n;
+ void foo (); // { dg-message "initializing argument 'this'" }
+
+ template<typename T>
+ operator T () const
+ {
+ if (n == 0)
+ foo (); // { dg-error "cannot convert 'const X\\*' to 'X\\*'" }
+ return n;
+ }
+};
diff --git a/gcc/testsuite/g++.dg/diagnostic/pr90767-2.C b/gcc/testsuite/g++.dg/diagnostic/pr90767-2.C
new file mode 100644
index 00000000000..550762b2db9
--- /dev/null
+++ b/gcc/testsuite/g++.dg/diagnostic/pr90767-2.C
@@ -0,0 +1,15 @@
+// PR c++/90767
+// { dg-do compile }
+
+struct A {
+ struct B { B (int) {} };
+
+ template <typename T>
+ void foo ()
+ {
+ int x = 0;
+ bar (x); // { dg-error "cannot convert 'int' to 'A::B&'" }
+ }
+
+ void bar (B &arg) {} // { dg-message "initializing argument 1" }
+};
diff --git a/gcc/testsuite/g++.dg/ext/is_final.C b/gcc/testsuite/g++.dg/ext/is_final.C
index b3875ad04ae..20e5d629ff5 100644
--- a/gcc/testsuite/g++.dg/ext/is_final.C
+++ b/gcc/testsuite/g++.dg/ext/is_final.C
@@ -43,3 +43,17 @@ static_assert( __is_final (Ff<int>), "Ff<int> is final" );
static_assert( __is_final (Ff<A>), "Ff<A> is final" );
static_assert( __is_final (Ff<Af>), "Ff<Af> is final" );
+// PR 85254
+
+template <class T> struct final_trait_wrap{ typedef T type; };
+
+template <class T> struct my_is_final
+{
+ static const bool value = __is_final(typename final_trait_wrap<T>::type);
+};
+
+struct final1 final {};
+template <typename T> struct final2 final {};
+
+static_assert( my_is_final<final1>::value, "final1 is final" );
+static_assert( my_is_final<final2<int>>::value, "final2<int> is final" );
diff --git a/gcc/testsuite/g++.dg/gomp/pr92504.C b/gcc/testsuite/g++.dg/gomp/pr92504.C
new file mode 100644
index 00000000000..8df67621532
--- /dev/null
+++ b/gcc/testsuite/g++.dg/gomp/pr92504.C
@@ -0,0 +1,29 @@
+// PR c++/92504
+// { dg-do compile { target c++11 } }
+// { dg-additional-options "-O2" }
+
+namespace std {
+ typedef __SIZE_TYPE__ size_t;
+ typedef __PTRDIFF_TYPE__ ptrdiff_t;
+}
+
+struct A {
+ A ();
+ A (const A &);
+ A & operator++ ();
+ bool operator != (const A &) const;
+ std::ptrdiff_t operator - (const A &);
+ A & operator += (std::size_t);
+ int a;
+ A & begin ();
+ A & end (); // { dg-message "declared here" }
+};
+
+void
+bar ()
+{
+ A a;
+ #pragma omp for
+ for (auto b = a; b != a.end; ++b) // { dg-error "invalid use of non-static member function" }
+ ;
+}
diff --git a/gcc/testsuite/g++.dg/init/array54.C b/gcc/testsuite/g++.dg/init/array54.C
new file mode 100644
index 00000000000..f6be350ba72
--- /dev/null
+++ b/gcc/testsuite/g++.dg/init/array54.C
@@ -0,0 +1,13 @@
+// PR c++/90947
+// { dg-do run { target c++11 } }
+
+#include <atomic>
+
+static std::atomic<int> a[1] { {1} };
+
+int
+main ()
+{
+ if (a[0].load () != 1)
+ __builtin_abort ();
+}
diff --git a/gcc/testsuite/g++.dg/lto/pr91572_0.C b/gcc/testsuite/g++.dg/lto/pr91572_0.C
new file mode 100644
index 00000000000..95a7e9fabf5
--- /dev/null
+++ b/gcc/testsuite/g++.dg/lto/pr91572_0.C
@@ -0,0 +1,12 @@
+// PR lto/91572
+// { dg-lto-do link }
+// { dg-lto-options { { -O -fPIC -flto } } }
+// { dg-require-effective-target shared }
+// { dg-require-effective-target fpic }
+// { dg-extra-ld-options "-shared" }
+
+void foo (char);
+namespace N {
+ class A { A (); };
+ A::A () { asm ("" : : "g" (0)); }
+}
diff --git a/gcc/testsuite/g++.dg/opt/pr91351.C b/gcc/testsuite/g++.dg/opt/pr91351.C
new file mode 100644
index 00000000000..f793a2f1b11
--- /dev/null
+++ b/gcc/testsuite/g++.dg/opt/pr91351.C
@@ -0,0 +1,38 @@
+// PR tree-optimization/91351
+// { dg-do run }
+// { dg-options "-O2 -fstrict-enums" }
+
+enum E { e0, e1, e2, e3, e4, e5, e6, e7, e8, e9, e10, e11, e12,
+ e13, e14, e15, e16, e17, e18, e19, e20, e21, e22, e23, e24, e25 };
+
+__attribute__((noipa)) void
+foo ()
+{
+ __builtin_abort ();
+}
+
+__attribute__((noipa)) void
+bar ()
+{
+}
+
+__attribute__((noipa)) void
+baz (E e)
+{
+ switch (e)
+ {
+ case e11:
+ case e12:
+ case e13: foo (); break;
+ case e24: break;
+ case e14:
+ case e15: break;
+ default: bar (); break;
+ }
+}
+
+int
+main ()
+{
+ baz (e3);
+}
diff --git a/gcc/testsuite/g++.dg/opt/pr92007.C b/gcc/testsuite/g++.dg/opt/pr92007.C
new file mode 100644
index 00000000000..9434cc929dd
--- /dev/null
+++ b/gcc/testsuite/g++.dg/opt/pr92007.C
@@ -0,0 +1,32 @@
+// PR rtl-optimization/92007
+// { dg-do compile }
+// { dg-options "-O2 -fno-tree-dominator-opts -fno-tree-forwprop --param max-cse-insns=0 -Wno-return-type -std=gnu++98 -freorder-blocks-and-partition" }
+
+void
+sb (int *);
+
+class d4 {
+public:
+ ~d4();
+ void gb ();
+ int op () { return no; }
+ int wl () { return tf; }
+ bool ee () try { gb (); } catch (...) { return false; }
+ bool b1 () { return (tf == no) ? false : ee (); }
+
+private:
+ int no, tf;
+};
+
+void
+hs (int *v9)
+{
+ d4 p6;
+
+ p6.gb ();
+ if (p6.op () > p6.wl ())
+ {
+ p6.b1 ();
+ sb (v9);
+ }
+}
diff --git a/gcc/testsuite/g++.dg/other/pr92201.C b/gcc/testsuite/g++.dg/other/pr92201.C
new file mode 100644
index 00000000000..15ba1a12525
--- /dev/null
+++ b/gcc/testsuite/g++.dg/other/pr92201.C
@@ -0,0 +1,7 @@
+// PR c++/92201
+
+int
+foo (void (*p) ())
+{
+ return (*reinterpret_cast<int (*)()> (p)) ();
+}
diff --git a/gcc/testsuite/g++.dg/pr92022.C b/gcc/testsuite/g++.dg/pr92022.C
new file mode 100644
index 00000000000..066d984ffc5
--- /dev/null
+++ b/gcc/testsuite/g++.dg/pr92022.C
@@ -0,0 +1,13 @@
+// { dg-do compile { target alpha*-*-* } }
+// { dg-options "-O1 -g -fno-var-tracking -mcpu=ev4 -mieee" }
+
+struct a {
+ a(long);
+};
+long b;
+void c() {
+ a d(1);
+ double e = b;
+ for (; b;)
+ d = e;
+}
diff --git a/gcc/testsuite/g++.dg/torture/pr91155.C b/gcc/testsuite/g++.dg/torture/pr91155.C
new file mode 100644
index 00000000000..04e4f7ab41b
--- /dev/null
+++ b/gcc/testsuite/g++.dg/torture/pr91155.C
@@ -0,0 +1,18 @@
+/* PR c++/91155. */
+
+template< char C > struct dummy {};
+
+template< typename T > const char *test()
+{
+ __builtin_printf ("test: %s\n", __PRETTY_FUNCTION__);
+ return __PRETTY_FUNCTION__;
+}
+
+int main()
+{
+ if (__builtin_strcmp ("const char* test() [with T = dummy<\'\\000\'>]", test< dummy< '\0' > > ()) != 0)
+ {};// __builtin_abort ();
+ if (__builtin_strcmp ("const char* test() [with T = dummy<\'\\\'\'>]", test< dummy< '\'' > > ()) != 0)
+ {};// __builtin_abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/g++.dg/torture/pr91606.C b/gcc/testsuite/g++.dg/torture/pr91606.C
new file mode 100644
index 00000000000..37a05a5e3a5
--- /dev/null
+++ b/gcc/testsuite/g++.dg/torture/pr91606.C
@@ -0,0 +1,109 @@
+/* { dg-do run } */
+/* { dg-additional-options "-fstrict-aliasing" } */
+
+#include <cstdlib>
+#include <array>
+#include <type_traits>
+
+template <typename T1, typename T2>
+struct variant
+{
+ constexpr variant(T1 arg)
+ : f1(arg),
+ index(0)
+ {}
+
+ constexpr variant(T2 arg)
+ : f2(arg),
+ index(1)
+ {}
+
+ union
+ {
+ T1 f1;
+ T2 f2;
+ };
+ std::size_t index = 0;
+};
+
+template <typename T1, typename T2>
+constexpr const T1* get_if(const variant<T1, T2>* v)
+{
+ if (v->index != 0)
+ {
+ return nullptr;
+ }
+ return &v->f1;
+}
+
+template <typename T2, typename T1>
+constexpr const T2* get_if(const variant<T1, T2>* v)
+{
+ if (v->index != 1)
+ {
+ return nullptr;
+ }
+ return &v->f2;
+}
+
+template <typename T, size_t N>
+struct my_array
+{
+ constexpr const T* begin() const
+ {
+ return data;
+ }
+
+ constexpr const T* end() const
+ {
+ return data + N;
+ }
+
+ T data[N];
+};
+
+template <typename ...Ts>
+constexpr auto get_array_of_variants(Ts ...ptrs)
+{
+ return std::array<variant<std::decay_t<Ts>...>, sizeof...(Ts)>{ ptrs... };
+}
+
+template <typename T>
+constexpr auto get_member_functions();
+
+template <typename Member, typename Class>
+constexpr int getFuncId(Member (Class::*memFuncPtr))
+{
+ int idx = 0u;
+ for (auto &anyFunc : get_member_functions<Class>())
+ {
+ if (auto *specificFunc = get_if<Member (Class::*)>(&anyFunc))
+ {
+ if (*specificFunc == memFuncPtr)
+ {
+ return idx;
+ }
+ }
+ ++idx;
+ }
+ std::abort();
+}
+
+struct MyStruct
+{
+ void fun1(int /*a*/) {}
+
+ int fun2(char /*b*/, short /*c*/, bool /*d*/) { return 0; }
+
+};
+
+template <>
+constexpr auto get_member_functions<MyStruct>()
+{
+ return get_array_of_variants(&MyStruct::fun1, &MyStruct::fun2);
+}
+
+int main()
+{
+ return getFuncId(&MyStruct::fun1);
+}
diff --git a/gcc/testsuite/g++.dg/torture/pr92384.C b/gcc/testsuite/g++.dg/torture/pr92384.C
new file mode 100644
index 00000000000..049a45a0154
--- /dev/null
+++ b/gcc/testsuite/g++.dg/torture/pr92384.C
@@ -0,0 +1,38 @@
+// PR c++/92384
+// { dg-do run }
+
+struct S {};
+struct T : public S { S a, b, c, d, e, f, g, h, i, j, k, l, m; };
+struct U { long long a, b, c; };
+
+U
+foo (S, S, S, T, T, T, U g)
+{
+ return g;
+}
+
+__attribute__((noipa)) bool
+bar (S a, S b, S c, T d, T e, T f, U g, void **h)
+{
+ h[0] = (void *) &a;
+ h[1] = (void *) &b;
+ h[2] = (void *) &c;
+ h[3] = (void *) &d;
+ h[4] = (void *) &e;
+ h[5] = (void *) &f;
+ h[6] = (void *) &g;
+ asm volatile ("" : : "r" (h) : "memory");
+ return (h[0] != h[1] && h[1] != h[2] && h[2] != h[3]
+ && h[3] != h[4] && h[4] != h[5] && h[5] != h[6]);
+}
+
+int
+main ()
+{
+ S a;
+ T b;
+ U c = { 1, 2, 3 };
+ void *d[7];
+ if (!bar (a, a, a, b, b, b, c, d))
+ __builtin_abort ();
+}
diff --git a/gcc/testsuite/gcc.c-torture/compile/20191108-1.c b/gcc/testsuite/gcc.c-torture/compile/20191108-1.c
new file mode 100644
index 00000000000..7929751bb06
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/20191108-1.c
@@ -0,0 +1,14 @@
+/* PR target/92095 */
+/* Testcase by Sergei Trofimovich <slyfox@inbox.ru> */
+
+typedef union {
+ double a;
+ int b[2];
+} c;
+
+double d(int e)
+{
+ c f;
+ (&f)->b[0] = 15728640;
+ return e ? -(&f)->a : (&f)->a;
+}
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr90840.c b/gcc/testsuite/gcc.c-torture/compile/pr90840.c
new file mode 100644
index 00000000000..94a6f3f4baf
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/pr90840.c
@@ -0,0 +1,19 @@
+/* PR middle-end/90840 */
+struct S { long long a; int b; };
+struct S foo (void);
+struct __attribute__((packed)) T { long long a; char b; };
+struct T baz (void);
+
+void
+bar (void)
+{
+ _Complex long double c;
+ *(struct S *) &c = foo ();
+}
+
+void
+qux (void)
+{
+ _Complex long double c;
+ *(struct T *) &c = baz ();
+}
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr91001.c b/gcc/testsuite/gcc.c-torture/compile/pr91001.c
new file mode 100644
index 00000000000..4b6a017c860
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/pr91001.c
@@ -0,0 +1,31 @@
+/* PR middle-end/91001 */
+/* PR middle-end/91105 */
+/* PR middle-end/91106 */
+
+struct __attribute__((packed)) S { short b; char c; };
+struct T { short b, c, d; };
+struct __attribute__((packed)) R { int b; char c; };
+union __attribute__((aligned(128), transparent_union)) U { struct S c; } u;
+union __attribute__((aligned(32), transparent_union)) V { struct T c; } v;
+union __attribute__((aligned(32), transparent_union)) W { struct R c; } w;
+void foo (union U);
+void bar (union V);
+void baz (union W);
+
+void
+qux (void)
+{
+ foo (u);
+}
+
+void
+quux (void)
+{
+ bar (v);
+}
+
+void
+corge (void)
+{
+ baz (w);
+}
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr92056.c b/gcc/testsuite/gcc.c-torture/compile/pr92056.c
new file mode 100644
index 00000000000..d04da763e15
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/pr92056.c
@@ -0,0 +1,18 @@
+/* PR tree-optimization/92056 */
+
+const char *d;
+
+void
+foo (int c, char *e, const char *a, const char *b)
+{
+ switch (c)
+ {
+ case 33:
+ for (;; d++)
+ if (__builtin_strcmp (b ? : "", d))
+ return;
+ break;
+ case 4:
+ __builtin_sprintf (e, a);
+ }
+}
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr92231.c b/gcc/testsuite/gcc.c-torture/compile/pr92231.c
new file mode 100644
index 00000000000..1813add63c6
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/pr92231.c
@@ -0,0 +1,9 @@
+/* PR middle-end/92231 */
+
+extern int bar (void);
+
+int
+foo (void)
+{
+ return (&bar + 4096) ();
+}
diff --git a/gcc/testsuite/gcc.c-torture/execute/20190901-1.c b/gcc/testsuite/gcc.c-torture/execute/20190901-1.c
new file mode 100644
index 00000000000..c78715ef2c1
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/20190901-1.c
@@ -0,0 +1,36 @@
+/* PR target/91472 */
+/* Reported by John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de> */
+
+typedef unsigned int gmp_uint_least32_t;
+
+union ieee_double_extract
+{
+ struct
+ {
+ gmp_uint_least32_t sig:1;
+ gmp_uint_least32_t exp:11;
+ gmp_uint_least32_t manh:20;
+ gmp_uint_least32_t manl:32;
+ } s;
+ double d;
+};
+
+double __attribute__((noipa))
+tests_infinity_d (void)
+{
+ union ieee_double_extract x;
+ x.s.exp = 2047;
+ x.s.manl = 0;
+ x.s.manh = 0;
+ x.s.sig = 0;
+ return x.d;
+}
+
+int
+main (void)
+{
+ double x = tests_infinity_d ();
+ if (x == 0.0)
+ __builtin_abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.c-torture/execute/20191023-1.c b/gcc/testsuite/gcc.c-torture/execute/20191023-1.c
new file mode 100644
index 00000000000..3811ebca151
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/20191023-1.c
@@ -0,0 +1,73 @@
+/* PR tree-optimization/92131 */
+/* Testcase by Armin Rigo <arigo@tunes.org> */
+
+long b, c, d, e, f, i;
+char g, h, j, k;
+int *aa;
+
+static void error (void) __attribute__((noipa));
+static void error (void) { __builtin_abort(); }
+
+static void see_me_here (void) __attribute__((noipa));
+static void see_me_here (void) {}
+
+static void aaa (void) __attribute__((noipa));
+static void aaa (void) {}
+
+static void a (void) __attribute__((noipa));
+static void a (void) {
+ long am, ao;
+ if (aa == 0) {
+ aaa();
+ if (j)
+ goto ay;
+ }
+ return;
+ay:
+ aaa();
+ if (k) {
+ aaa();
+ goto az;
+ }
+ return;
+az:
+ if (i)
+ if (g)
+ if (h)
+ if (e)
+ goto bd;
+ return;
+bd:
+ am = 0;
+ while (am < e) {
+ switch (c) {
+ case 8:
+ goto bh;
+ case 4:
+ return;
+ }
+ bh:
+ if (am >= 0)
+ b = -am;
+ ao = am + b;
+ f = ao & 7;
+ if (f == 0)
+ see_me_here();
+ if (ao >= 0)
+ am++;
+ else
+ error();
+ }
+}
+
+int main (void)
+{
+ j++;
+ k++;
+ i++;
+ g++;
+ h++;
+ e = 1;
+ a();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr91450-1.c b/gcc/testsuite/gcc.c-torture/execute/pr91450-1.c
new file mode 100644
index 00000000000..9aafc5f791a
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/pr91450-1.c
@@ -0,0 +1,88 @@
+/* PR middle-end/91450 */
+
+__attribute__((noipa)) unsigned long long
+foo (int a, int b)
+{
+ unsigned long long r;
+ if (!__builtin_mul_overflow (a, b, &r))
+ __builtin_abort ();
+ return r;
+}
+
+__attribute__((noipa)) unsigned long long
+bar (int a, int b)
+{
+ unsigned long long r;
+ if (a >= 0)
+ return 0;
+ if (!__builtin_mul_overflow (a, b, &r))
+ __builtin_abort ();
+ return r;
+}
+
+__attribute__((noipa)) unsigned long long
+baz (int a, int b)
+{
+ unsigned long long r;
+ if (b >= 0)
+ return 0;
+ if (!__builtin_mul_overflow (a, b, &r))
+ __builtin_abort ();
+ return r;
+}
+
+__attribute__((noipa)) unsigned long long
+qux (int a, int b)
+{
+ unsigned long long r;
+ if (a >= 0)
+ return 0;
+ if (b < 0)
+ return 0;
+ if (!__builtin_mul_overflow (a, b, &r))
+ __builtin_abort ();
+ return r;
+}
+
+__attribute__((noipa)) unsigned long long
+quux (int a, int b)
+{
+ unsigned long long r;
+ if (a < 0)
+ return 0;
+ if (b >= 0)
+ return 0;
+ if (!__builtin_mul_overflow (a, b, &r))
+ __builtin_abort ();
+ return r;
+}
+
+int
+main ()
+{
+ if (foo (-4, 2) != -8ULL)
+ __builtin_abort ();
+ if (foo (2, -4) != -8ULL)
+ __builtin_abort ();
+ if (bar (-4, 2) != -8ULL)
+ __builtin_abort ();
+ if (baz (2, -4) != -8ULL)
+ __builtin_abort ();
+ if (qux (-4, 2) != -8ULL)
+ __builtin_abort ();
+ if (quux (2, -4) != -8ULL)
+ __builtin_abort ();
+ if (foo (-2, 1) != -2ULL)
+ __builtin_abort ();
+ if (foo (1, -2) != -2ULL)
+ __builtin_abort ();
+ if (bar (-2, 1) != -2ULL)
+ __builtin_abort ();
+ if (baz (1, -2) != -2ULL)
+ __builtin_abort ();
+ if (qux (-2, 1) != -2ULL)
+ __builtin_abort ();
+ if (quux (1, -2) != -2ULL)
+ __builtin_abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr91450-2.c b/gcc/testsuite/gcc.c-torture/execute/pr91450-2.c
new file mode 100644
index 00000000000..bfaabbb5ac6
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/pr91450-2.c
@@ -0,0 +1,76 @@
+/* PR middle-end/91450 */
+
+__attribute__((noipa)) void
+foo (int a, int b)
+{
+ unsigned long long r;
+ if (__builtin_mul_overflow (a, b, &r))
+ __builtin_abort ();
+ if (r != 0)
+ __builtin_abort ();
+}
+
+__attribute__((noipa)) void
+bar (int a, int b)
+{
+ unsigned long long r;
+ if (a >= 0)
+ return;
+ if (__builtin_mul_overflow (a, b, &r))
+ __builtin_abort ();
+ if (r != 0)
+ __builtin_abort ();
+}
+
+__attribute__((noipa)) void
+baz (int a, int b)
+{
+ unsigned long long r;
+ if (b >= 0)
+ return;
+ if (__builtin_mul_overflow (a, b, &r))
+ __builtin_abort ();
+ if (r != 0)
+ __builtin_abort ();
+}
+
+__attribute__((noipa)) void
+qux (int a, int b)
+{
+ unsigned long long r;
+ if (a >= 0)
+ return;
+ if (b < 0)
+ return;
+ if (__builtin_mul_overflow (a, b, &r))
+ __builtin_abort ();
+ if (r != 0)
+ __builtin_abort ();
+}
+
+__attribute__((noipa)) void
+quux (int a, int b)
+{
+ unsigned long long r;
+ if (a < 0)
+ return;
+ if (b >= 0)
+ return;
+ if (__builtin_mul_overflow (a, b, &r))
+ __builtin_abort ();
+ if (r != 0)
+ __builtin_abort ();
+}
+
+int
+main ()
+{
+ foo (-4, 0);
+ foo (0, -4);
+ foo (0, 0);
+ bar (-4, 0);
+ baz (0, -4);
+ qux (-4, 0);
+ quux (0, -4);
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr91597.c b/gcc/testsuite/gcc.c-torture/execute/pr91597.c
new file mode 100644
index 00000000000..6a917cb58af
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/pr91597.c
@@ -0,0 +1,48 @@
+/* PR tree-optimization/91597 */
+
+enum E { A, B, C };
+struct __attribute__((aligned (4))) S { enum E e; };
+
+enum E
+foo (struct S *o)
+{
+ if (((__UINTPTR_TYPE__) (o) & 1) == 0)
+ return o->e;
+ else
+ return A;
+}
+
+int
+bar (struct S *o)
+{
+ return foo (o) == B || foo (o) == C;
+}
+
+static inline void
+baz (struct S *o, int d)
+{
+ if (__builtin_expect (!bar (o), 0))
+ __builtin_abort ();
+ if (d > 2) return;
+ baz (o, d + 1);
+}
+
+void
+qux (struct S *o)
+{
+ switch (o->e)
+ {
+ case A: return;
+ case B: baz (o, 0); break;
+ case C: baz (o, 0); break;
+ }
+}
+
+struct S s = { C };
+
+int
+main ()
+{
+ qux (&s);
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr91632.c b/gcc/testsuite/gcc.c-torture/execute/pr91632.c
new file mode 100644
index 00000000000..c16c3da4efd
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/pr91632.c
@@ -0,0 +1,30 @@
+/* PR tree-optimization/91632 */
+/* { dg-additional-options "-fwrapv" } */
+
+static int
+__attribute__((noipa))
+foo (char x)
+{
+ switch (x)
+ {
+ case '"':
+ case '<':
+ case '>':
+ case '\\':
+ case '^':
+ case '`':
+ case '{':
+ case '|':
+ case '}':
+ return 0;
+ }
+ return 1;
+}
+
+int
+main ()
+{
+ if (foo ('h') == 0)
+ __builtin_abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr91635.c b/gcc/testsuite/gcc.c-torture/execute/pr91635.c
new file mode 100644
index 00000000000..878a491fc36
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/pr91635.c
@@ -0,0 +1,57 @@
+/* PR target/91635 */
+
+#if __CHAR_BIT__ == 8 && __SIZEOF_SHORT__ == 2 \
+ && __SIZEOF_INT__ == 4 && __SIZEOF_LONG_LONG__ == 8
+unsigned short b, c;
+int u, v, w, x;
+
+__attribute__ ((noipa)) int
+foo (unsigned short c)
+{
+ c <<= __builtin_add_overflow (-c, -1, &b);
+ c >>= 1;
+ return c;
+}
+
+__attribute__ ((noipa)) int
+bar (unsigned short b)
+{
+ b <<= -14 & 15;
+ b = b >> -~1;
+ return b;
+}
+
+__attribute__ ((noipa)) int
+baz (unsigned short e)
+{
+ e <<= 1;
+ e >>= __builtin_add_overflow (8719476735, u, &v);
+ return e;
+}
+
+__attribute__ ((noipa)) int
+qux (unsigned int e)
+{
+ c = ~1;
+ c *= e;
+ c = c >> (-15 & 5);
+ return c + w + x;
+}
+#endif
+
+int
+main ()
+{
+#if __CHAR_BIT__ == 8 && __SIZEOF_SHORT__ == 2 \
+ && __SIZEOF_INT__ == 4 && __SIZEOF_LONG_LONG__ == 8
+ if (foo (0xffff) != 0x7fff)
+ __builtin_abort ();
+ if (bar (5) != 5)
+ __builtin_abort ();
+ if (baz (~0) != 0x7fff)
+ __builtin_abort ();
+ if (qux (2) != 0x7ffe)
+ __builtin_abort ();
+#endif
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/Wnonnull.c b/gcc/testsuite/gcc.dg/Wnonnull.c
index be89a5a755c..0ed06aabe68 100644
--- a/gcc/testsuite/gcc.dg/Wnonnull.c
+++ b/gcc/testsuite/gcc.dg/Wnonnull.c
@@ -2,7 +2,10 @@
{ dg-do compile }
{ dg-options "-O2 -Wall" } */
-#include <string.h>
+extern __SIZE_TYPE__ strlen (const char *__s)
+ __attribute ((pure)) __attribute ((nonnull (1)));
+extern void *memcpy (void *__restrict __dest, const void *__restrict __src,
+ __SIZE_TYPE__ __n) __attribute ((nonnull (1, 2)));
char buf[100];
@@ -14,9 +17,9 @@ struct Test
__attribute ((nonnull (1, 2)))
inline char*
-my_strcpy (char *restrict dst, const char *restrict src, size_t size)
+my_strcpy (char *restrict dst, const char *restrict src, __SIZE_TYPE__ size)
{
- size_t len = strlen (src); /* { dg-warning "argument 1 null where non-null expected" } */
+ __SIZE_TYPE__ len = strlen (src); /* { dg-warning "argument 1 null where non-null expected" } */
if (len < size)
memcpy (dst, src, len + 1); /* { dg-warning "argument 2 null where non-null expected" } */
else
diff --git a/gcc/testsuite/gcc.dg/gomp/pr90637.c b/gcc/testsuite/gcc.dg/gomp/pr90637.c
new file mode 100644
index 00000000000..983e03e7574
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/gomp/pr90637.c
@@ -0,0 +1,14 @@
+/* PR tree-optimization/90637 */
+/* { dg-do compile } */
+/* { dg-options "-fopenmp -O1 --param sink-frequency-threshold=90" } */
+
+int v;
+
+void
+foo (int c)
+{
+ int i;
+#pragma omp for simd if (c) lastprivate (v) schedule (static, 16)
+ for (i = 0; i < 64; ++i)
+ v = i;
+}
diff --git a/gcc/testsuite/gcc.dg/pr89435.c b/gcc/testsuite/gcc.dg/pr89435.c
new file mode 100644
index 00000000000..d72d087f5ce
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr89435.c
@@ -0,0 +1,21 @@
+/* PR rtl-optimization/89435 */
+/* { dg-do run } */
+/* { dg-options "-O1 -fno-forward-propagate -fno-tree-forwprop -fno-tree-ccp" } */
+
+unsigned short a;
+unsigned int b, c, d, e, f;
+
+int
+main ()
+{
+#if __CHAR_BIT__ == 8 && __SIZEOF_INT__ == 4
+ unsigned char g = e = __builtin_mul_overflow_p (5, 542624702, 0);
+ d = __builtin_bswap64 (a);
+ b = __builtin_sub_overflow ((unsigned char) -e, (unsigned int) d, &g);
+ e = __builtin_mul_overflow (b, c, &a);
+ f = g + e;
+ if (f != 0xff)
+ __builtin_abort ();
+#endif
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/pr89795.c b/gcc/testsuite/gcc.dg/pr89795.c
new file mode 100644
index 00000000000..4ceaa433f3c
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr89795.c
@@ -0,0 +1,25 @@
+/* PR rtl-optimization/89795 */
+/* { dg-do run } */
+/* { dg-options "-O2 -fno-dce -fno-forward-propagate -fno-sched-pressure" } */
+
+unsigned char a;
+unsigned b, c, d;
+
+int
+main ()
+{
+#if __CHAR_BIT__ == 8
+ unsigned x;
+ int e, f;
+ unsigned char g;
+ e = __builtin_bswap32 (a);
+ f = __builtin_ffs (~(unsigned short) e);
+ a = __builtin_mul_overflow ((unsigned char) 0xf7, f, &g);
+ a |= __builtin_sub_overflow_p (c, 0, (unsigned char) 0);
+ d = g + b;
+ x = d;
+ if (x != 0xf7)
+ __builtin_abort ();
+#endif
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/pr90898.c b/gcc/testsuite/gcc.dg/pr90898.c
new file mode 100644
index 00000000000..e992ea34cd9
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr90898.c
@@ -0,0 +1,16 @@
+/* PR c/90898 */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+void *p;
+int bar (void);
+void baz (int *);
+
+void
+foo (void)
+{
+ p = __builtin_stack_save ();
+ int a[(bar (), 2)];
+ baz (a);
+ __builtin_stack_restore (p);
+}
diff --git a/gcc/testsuite/gcc.dg/pr91269.c b/gcc/testsuite/gcc.dg/pr91269.c
new file mode 100644
index 00000000000..8c03ba8dab2
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr91269.c
@@ -0,0 +1,70 @@
+/* PR target/91269 */
+/* Testcase by Sergei Trofimovich <slyfox@inbox.ru> */
+
+/* { dg-do assemble } */
+/* { dg-options "-O2 -Wno-int-conversion" } */
+/* { dg-additional-options "-fcall-used-g6 -fPIE -mcpu=niagara4" { target sparc*-*-* } } */
+
+struct m;
+
+enum { a = 2 };
+int b[1];
+int d[2715];
+int e, f, h;
+enum { i = 2 } j;
+inline int c(int k) {
+ char *cp;
+ if (k >= 62 && k <= 247)
+ cp = b[k];
+ if (cp)
+ return 65533;
+ return 2;
+}
+inline int g(int k) {
+ if (k < sizeof(d))
+ return e;
+ return 0;
+}
+
+int u(struct m*, char*, char*);
+
+int l(struct m *k, char n, long o, int *p) {
+ int q, flags = j, r, s, lasttwo = *p;
+ char inptr, outptr;
+ while (inptr) {
+ if (__builtin_expect(h, 0))
+ break;
+ unsigned ch = inptr;
+ if (lasttwo) {
+ long need = lasttwo >> 3;
+ if (__builtin_expect(need > n, 0))
+ break;
+ } else if (s == i) {
+ long t = c(ch);
+ if (t != 65533) {
+ int jch = g(ch);
+ if (jch & 8)
+ continue;
+ }
+ }
+ if (ch <= 5)
+ ;
+ else {
+ long t = c(ch);
+ if (t != 65533)
+ ;
+ else {
+ switch (f >> 8)
+ case 79:
+ q = f == 20308 || f == 20350;
+ if (q)
+ if (j)
+ r = u(k, &inptr, &outptr);
+ s = *p;
+ if (r)
+ if (o && flags & a)
+ break;
+ }
+ }
+ }
+}
diff --git a/gcc/testsuite/gcc.dg/pr91720.c b/gcc/testsuite/gcc.dg/pr91720.c
new file mode 100644
index 00000000000..4abdace94da
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr91720.c
@@ -0,0 +1,22 @@
+/* PR rtl-optimization/91720 */
+/* { dg-do run } */
+/* { dg-options "-Og -fno-forward-propagate -frerun-cse-after-loop -fno-tree-fre" } */
+
+unsigned a, b;
+
+int
+main ()
+{
+#if __CHAR_BIT__ == 8
+ unsigned c = 1;
+ unsigned long long d = 0;
+ unsigned char e = 0;
+ e = __builtin_sub_overflow (d, e, &a) ? 0 : 0x80;
+ e = e << 7 | e >> c;
+ __builtin_memmove (&d, &a, 2);
+ b = e;
+ if (b != 0x40)
+ __builtin_abort ();
+#endif
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/pr91734.c b/gcc/testsuite/gcc.dg/pr91734.c
new file mode 100644
index 00000000000..1cc3e40ccbc
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr91734.c
@@ -0,0 +1,97 @@
+/* PR tree-optimization/91734 */
+/* { dg-do run } */
+/* { dg-add-options ieee } */
+/* { dg-additional-options "-O2 -std=gnu99" } */
+
+__attribute__((noipa, optimize ("Ofast"))) int
+f1 (float x)
+{
+ return __builtin_sqrtf (x) < __FLT_MIN__;
+}
+
+__attribute__((noipa, optimize ("Ofast"))) int
+f2 (float x)
+{
+ return __builtin_sqrtf (x) < 0x1.2dd3d0p-65f;
+}
+
+__attribute__((noipa, optimize ("Ofast"))) int
+f3 (float x)
+{
+ return __builtin_sqrtf (x) >= 0x1.2dd3d0p-65f;
+}
+
+__attribute__((noipa, optimize ("Ofast"))) int
+f4 (float x)
+{
+ return __builtin_sqrtf (x) >= 0x1.5642e6p+54f;
+}
+
+__attribute__((noipa, optimize ("Ofast"))) int
+f5 (float x)
+{
+ return __builtin_sqrtf (x) > 0x1.5642e6p+54f;
+}
+
+__attribute__((noipa, optimize ("Ofast"))) int
+f6 (float x)
+{
+ return __builtin_sqrtf (x) < 0x1.4da1cp-19f;
+}
+
+__attribute__((noipa, optimize ("Ofast"))) int
+f7 (float x)
+{
+ return __builtin_sqrtf (x) <= 0x1.4da1cp-19f;
+}
+
+__attribute__((noipa, optimize ("Ofast"))) int
+f8 (float x)
+{
+ return __builtin_sqrtf (x) < 0x1.50cb62p-65f;
+}
+
+__attribute__((noipa, optimize ("Ofast"))) int
+f9 (float x)
+{
+ return __builtin_sqrtf (x) <= 0x1.4fc00cp-73f;
+}
+
+__attribute__((noipa, optimize ("Ofast"))) int
+f10 (float x)
+{
+ return __builtin_sqrtf (x) < 0x1.001002p+0f;
+}
+
+int
+main ()
+{
+ if (__FLT_RADIX__ != 2
+ || __FLT_MANT_DIG__ != 24
+ || __FLT_MIN_EXP__ != -125
+ || __FLT_MAX_EXP__ != 128
+ || __FLT_HAS_DENORM__ != 1
+ || __FLT_HAS_INFINITY__ != 1)
+ return 0;
+ if (!f1 (0.0f) || f1 (0x1.0p-149f))
+ __builtin_abort ();
+ if (!f2 (0x1.63dbc0p-130f))
+ __builtin_abort ();
+ if (f3 (0x1.63dbc0p-130f))
+ __builtin_abort ();
+ if (!f4 (0x1.c996d0p+108f) || !f4 (0x1.c996cep+108f) || f4 (0x1.c996ccp+108f))
+ __builtin_abort ();
+ if (f5 (0x1.c996d0p+108f) || f5 (0x1.c996d2p+108f) || !f5 (0x1.c996d4p+108f))
+ __builtin_abort ();
+ if (!f6 (0x1.b2ce3p-38f) || f6 (0x1.b2ce32p-38f) || f6 (0x1.b2ce34p-38f))
+ __builtin_abort ();
+ if (!f7 (0x1.b2ce3p-38f) || !f7 (0x1.b2ce34p-38f) || !f7 (0x1.b2ce36p-38f) || f7 (0x1.b2ce38p-38f))
+ __builtin_abort ();
+ if (!f8 (0x1.bb166p-130f) || !f8 (0x1.bb168p-130f) || f8 (0x1.bb16ap-130f) || f8 (0x1.bb16cp-130f))
+ __builtin_abort ();
+ if (!f9 (0x1.8p-146f) || !f9 (0x1.ap-146f) || f9 (0x1.cp-146f) || f9 (0x1.ep-146f))
+ __builtin_abort ();
+ if (f10 (0x1.002004p+0f))
+ __builtin_abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/pr91885.c b/gcc/testsuite/gcc.dg/pr91885.c
new file mode 100644
index 00000000000..35be32be559
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr91885.c
@@ -0,0 +1,47 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -fprofile-generate" } */
+/* { dg-require-profiling "-fprofile-generate" } */
+
+typedef signed long long int __int64_t;
+typedef unsigned long long int __uint64_t;
+typedef __int64_t int64_t;
+typedef __uint64_t uint64_t;
+inline void
+BLI_endian_switch_int64 (int64_t *val)
+{
+ uint64_t tval = *val;
+ *val = ((tval >> 56)) | ((tval << 40) & 0x00ff000000000000ll)
+ | ((tval << 24) & 0x0000ff0000000000ll)
+ | ((tval << 8) & 0x000000ff00000000ll)
+ | ((tval >> 8) & 0x00000000ff000000ll)
+ | ((tval >> 24) & 0x0000000000ff0000ll)
+ | ((tval >> 40) & 0x000000000000ff00ll) | ((tval << 56));
+}
+typedef struct anim_index_entry
+{
+ unsigned long long seek_pos_dts;
+ unsigned long long pts;
+} anim_index_entry;
+extern struct anim_index_entry *
+MEM_callocN (int);
+struct anim_index
+{
+ int num_entries;
+ struct anim_index_entry *entries;
+};
+struct anim_index *
+IMB_indexer_open (const char *name)
+{
+ char header[13];
+ struct anim_index *idx;
+ int i;
+ idx->entries = MEM_callocN (8);
+ if (((1 == 0) != (header[8] == 'V')))
+ {
+ for (i = 0; i < idx->num_entries; i++)
+ {
+ BLI_endian_switch_int64 ((int64_t *) &idx->entries[i].seek_pos_dts);
+ BLI_endian_switch_int64 ((int64_t *) &idx->entries[i].pts);
+ }
+ }
+}
diff --git a/gcc/testsuite/gcc.dg/pr92430.c b/gcc/testsuite/gcc.dg/pr92430.c
new file mode 100644
index 00000000000..915606893ba
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr92430.c
@@ -0,0 +1,25 @@
+// PR rtl-optimization/92430
+// { dg-do compile }
+// { dg-options "-Os -fno-if-conversion -fno-tree-dce -fno-tree-loop-optimize -fno-tree-vrp" }
+
+int eb, ko;
+
+void
+e9 (int pe, int lx)
+{
+ int ir;
+
+ for (ir = 0; ir < 1; ++ir)
+ {
+ for (ko = 0; ko < 1; ++ko)
+ {
+ for (eb = 0; eb < 1; ++eb)
+ ko += pe;
+
+ for (ko = 0; ko < 1; ++ko)
+ ;
+ }
+
+ pe = ir = lx;
+ }
+}
diff --git a/gcc/testsuite/gcc.dg/torture/pr90278.c b/gcc/testsuite/gcc.dg/torture/pr90278.c
new file mode 100644
index 00000000000..617246a6d4c
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr90278.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-additional-options "-fexceptions -fnon-call-exceptions" } */
+
+double
+hc (void)
+{
+ double dp = 0.0;
+ double ek[1];
+
+ ek[0] = 1.0 / dp < 0.0;
+
+ return ek[0];
+}
diff --git a/gcc/testsuite/gcc.dg/torture/pr91812.c b/gcc/testsuite/gcc.dg/torture/pr91812.c
new file mode 100644
index 00000000000..ebc67a01e33
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr91812.c
@@ -0,0 +1,26 @@
+/* { dg-do compile } */
+/* { dg-skip-if "" { *-*-* } { "-fno-fat-lto-objects" } { "" } } */
+/* { dg-options "-fdump-tree-optimized-blocks" } */
+
+unsigned register1;
+unsigned register2;
+
+void busy_wait_for_register (int x)
+{
+ volatile unsigned* ptr;
+ switch(x) {
+ case 0x1111:
+ ptr = &register1;
+ break;
+
+ case 0x2222:
+ ptr = &register2;
+ break;
+
+ default:
+ return;
+ }
+ while (*ptr) {}
+}
+
+/* { dg-final { scan-tree-dump "loop depth 1" "optimized" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-11.c b/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-11.c
index 650e73a5ee8..dd1c0ac3eba 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-11.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-11.c
@@ -1,6 +1,10 @@
/* { dg-do run { target vect_cmdline_needed } } */
/* { dg-options "-O2 -ftree-vectorize -fwrapv -fdump-tree-vect-details -fvect-cost-model=dynamic" } */
-/* { dg-options "-O2 -ftree-vectorize -fwrapv -fdump-tree-vect-details -fvect-cost-model=dynamic -mno-sse" { target { i?86-*-* x86_64-*-* } } } */
+/* { dg-additional-options "-mno-sse" { target { i?86-*-* x86_64-*-* } } } */
+/* The IBM Z backend sets the min-vect-loop-bound param to 2 to avoid
+ awkward epilogue code generation in some cases. This line needs to
+ be removed after finding an alternate way to fix this. */
+/* { dg-additional-options "--param min-vect-loop-bound=0" { target { s390*-*-* } } } */
#include <stdlib.h>
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-26.c b/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-26.c
index 8e5f1410612..b0933831ca6 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-26.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-26.c
@@ -30,5 +30,6 @@ int main ()
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { ! avr-*-* } } } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" { target { ! avr-*-* } } } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { target { ! avr-*-* } } } } */
+/* IBM Z does not require special alignment for vectorization. */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" { target { ! { avr-*-* s390*-*-* } } } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { target { ! { avr-*-* s390*-*-* } } } } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-28.c b/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-28.c
index ce97e0970b5..e35b41d03b1 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-28.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-28.c
@@ -38,5 +38,6 @@ int main (void)
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { ! avr-*-* } } } } */
-/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" { target { ! avr-*-* } } } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { target { ! avr-*-* } } } } */
+/* IBM Z does not require special alignment for vectorization. */
+/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" { target { ! { avr-*-* s390*-*-* } } } } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { target { ! { avr-*-* s390*-*-* } } } } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-32.c b/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-32.c
index 8fce4385d0b..2ec698968a9 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-32.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/gen-vect-32.c
@@ -1,6 +1,10 @@
/* { dg-do run { target vect_cmdline_needed } } */
/* { dg-options "-O2 -ftree-vectorize -fdump-tree-vect-details -fno-vect-cost-model" } */
/* { dg-additional-options "-mno-sse" { target { i?86-*-* x86_64-*-* } } } */
+/* The IBM Z backend sets the min-vect-loop-bound param to 2 to avoid
+ awkward epilogue code generation in some cases. This line needs to
+ be removed after finding an alternate way to fix this. */
+/* { dg-additional-options "--param min-vect-loop-bound=0" { target { s390*-*-* } } } */
#include <stdlib.h>
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/reassoc-24.c b/gcc/testsuite/gcc.dg/tree-ssa/reassoc-24.c
index 4503cd74009..c320d1cb71b 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/reassoc-24.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/reassoc-24.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O2 --param tree-reassoc-width=2 -fdump-tree-reassoc1" } */
+/* { dg-options "-O2 --param tree-reassoc-width=2 -fdump-tree-reassoc2" } */
unsigned int
foo (void)
@@ -21,4 +21,4 @@ foo (void)
/* Verify there are two pairs of __asm__ statements with no
intervening stmts. */
-/* { dg-final { scan-tree-dump-times "__asm__\[^;\n]*;\n *__asm__" 2 "reassoc1"} } */
+/* { dg-final { scan-tree-dump-times "__asm__\[^;\n]*;\n *__asm__" 2 "reassoc2"} } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/reassoc-25.c b/gcc/testsuite/gcc.dg/tree-ssa/reassoc-25.c
index 553736bc391..dbb02683778 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/reassoc-25.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/reassoc-25.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O2 --param tree-reassoc-width=3 -fdump-tree-reassoc1-details" } */
+/* { dg-options "-O2 --param tree-reassoc-width=3 -fdump-tree-reassoc2-details" } */
unsigned int
foo (int a, int b, int c, int d)
@@ -15,4 +15,4 @@ foo (int a, int b, int c, int d)
}
/* Verify reassociation width was chosen to be 2. */
-/* { dg-final { scan-tree-dump-times "Width = 2" 1 "reassoc1"} } */
+/* { dg-final { scan-tree-dump-times "Width = 2" 1 "reassoc2"} } */
diff --git a/gcc/testsuite/gcc.dg/vect/pr91665.c b/gcc/testsuite/gcc.dg/vect/pr91665.c
new file mode 100644
index 00000000000..6b69ea030b1
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vect/pr91665.c
@@ -0,0 +1,15 @@
+/* PR tree-optimization/91665 */
+/* { dg-do compile } */
+/* { dg-additional-options "-Ofast" } */
+
+short int v;
+
+void
+foo (short int x, short int y)
+{
+ short int *p = &v;
+
+ x = 1;
+ while (x != 0)
+ x += ++y || (*p = x);
+}
diff --git a/gcc/testsuite/gcc.dg/vect/vect-fma-3.c b/gcc/testsuite/gcc.dg/vect/vect-fma-3.c
new file mode 100644
index 00000000000..b231a328fa5
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vect/vect-fma-3.c
@@ -0,0 +1,17 @@
+/* PR tree-optimization/91723 */
+/* { dg-do compile { target { scalar_all_fma || { i?86-*-* x86_64-*-* } } } } */
+/* { dg-additional-options "-mfma" { target { i?86-*-* x86_64-*-* } } } */
+
+void
+foo (double *restrict r, const double *restrict a,
+ const double *restrict b, const double *restrict c)
+{
+ for (int i = 0; i < 1024; i++)
+ {
+ double x = __builtin_fma (a[i], b[i], c[i]);
+ x = __builtin_fma (a[i], b[i], x);
+ r[i] = x;
+ }
+}
+
+/* { dg-final { scan-tree-dump-times "LOOP VECTORIZED" 1 "vect" { target vect_double } } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/no-inline-lrint_3.c b/gcc/testsuite/gcc.target/aarch64/no-inline-lrint_3.c
new file mode 100644
index 00000000000..ca772cb999e
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/no-inline-lrint_3.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target ilp32 } */
+/* { dg-options "-O3 -fno-math-errno -fno-fp-int-builtin-inexact" } */
+
+#define TEST(name, float_type, int_type, fn) void f_##name (float_type x) \
+{ \
+ volatile int_type b = __builtin_##fn (x); \
+}
+
+TEST (dld, double, long, lrint)
+TEST (flf, float , long, lrintf)
+
+TEST (did, double, int, lrint)
+TEST (fif, float , int, lrintf)
+
+/* { dg-final { scan-assembler-times "fcvtzs\tw\[0-9\]+, \[d,s\]\[0-9\]+" 2 } } */
+/* { dg-final { scan-assembler-times "bl\tlrint" 2 } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/nosplit-di-const-volatile_1.c b/gcc/testsuite/gcc.target/aarch64/nosplit-di-const-volatile_1.c
new file mode 100644
index 00000000000..da5975ad165
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/nosplit-di-const-volatile_1.c
@@ -0,0 +1,15 @@
+/* Check that storing the 64-bit immediate to a volatile location is done
+ with a single store. */
+
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+typedef unsigned long long u64;
+
+void bar (u64 *x)
+{
+ *(volatile u64 *)x = 0xabcdef10abcdef10ULL;
+}
+
+/* { dg-final { scan-assembler-times "str\tx..?, .*" 1 } } */
+/* { dg-final { scan-assembler-not "str\tw..?, .*" } } */
diff --git a/gcc/testsuite/gcc.target/arc/delay-slot-limm.c b/gcc/testsuite/gcc.target/arc/delay-slot-limm.c
new file mode 100644
index 00000000000..e5de3c4badd
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arc/delay-slot-limm.c
@@ -0,0 +1,52 @@
+/* We have encountered an issue that a "mov_s.ne" instruction *
+ * with an immediate value was put in the delay slot of a *
+ * branch: *
+ * *
+ * bne.d @.L1 # 33 [c=20 l=4] *branch_insn *
+ * mov_s.ne r0,7 # 35 [c=0 l=6] *movsi_ne/2 *
+ * *
+ * This is not sanctioned and must not happen. The test below *
+ * is a reduced version of the source code leading to the *
+ * problem. */
+
+/* { dg-do compile } */
+/* { dg-skip-if "" { ! { clmcpu } } } */
+/* { dg-options "-mcpu=archs -Og" } */
+typedef struct
+{
+ struct
+ {
+ int length;
+ } table;
+} room;
+
+struct house
+{
+ room *r;
+};
+
+int glob;
+
+_Bool bar();
+
+int func(struct house *h, int i, int whatever)
+{
+ for (;;)
+ {
+ _Bool a;
+ if (h && h->r[i].table.length == glob)
+ {
+ if (whatever)
+ {
+ a = bar();
+ if (__builtin_expect(!a, 0))
+ return 7;
+ }
+ break;
+ }
+ }
+ return 0;
+}
+
+/* no 'mov_s.ne r,limm' in a delay slot */
+/* { dg-final { scan-assembler-not "bne.d\.*\n\\s\+mov_s.ne\\s+r\[0-9\]+,7" } } */
diff --git a/gcc/testsuite/gcc.target/arc/pic-2.c b/gcc/testsuite/gcc.target/arc/pic-2.c
new file mode 100644
index 00000000000..4b0e17126e9
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arc/pic-2.c
@@ -0,0 +1,23 @@
+/* { dg-do compile } */
+/* { dg-skip-if "PIC not available for ARC6xx" { arc6xx } } */
+/* { dg-options "-mno-sdata -O2 -fpic -fno-builtin" } */
+
+/* Check if we resolve correctly complex PIC addresses. */
+
+char *foo (unsigned size)
+{
+ static char buf[32];
+ register int i;
+
+ if (size > 31)
+ size = 31;
+
+ for (i = 0; i < size; i++)
+ {
+ buf[i] = ' ';
+ }
+ buf[size] = '\0';
+ return buf;
+}
+
+/* { dg-final { scan-assembler "@buf.\[0-9\]\+@pcl-1" } } */
diff --git a/gcc/testsuite/gcc.target/arm/acle/crc_hf_1.c b/gcc/testsuite/gcc.target/arm/acle/crc_hf_1.c
new file mode 100644
index 00000000000..e6cbfc0b33e
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/acle/crc_hf_1.c
@@ -0,0 +1,14 @@
+/* Test that using an Armv8-a hard-float target doesn't
+ break CRC intrinsics. */
+
+/* { dg-do compile } */
+/* { dg-require-effective-target arm_hard_vfp_ok } */
+/* { dg-options "-mfloat-abi=hard -march=armv8-a+simd+crc" } */
+
+#include <arm_acle.h>
+
+uint32_t
+foo (uint32_t a, uint32_t b)
+{
+ return __crc32cw (a, b);
+}
diff --git a/gcc/testsuite/gcc.target/arm/multilib.exp b/gcc/testsuite/gcc.target/arm/multilib.exp
index d82306ed630..dcea829965e 100644
--- a/gcc/testsuite/gcc.target/arm/multilib.exp
+++ b/gcc/testsuite/gcc.target/arm/multilib.exp
@@ -753,6 +753,28 @@ if {[multilib_config "rmprofile"] } {
{-march=armv8-m.main+fp.dp -mfpu=fpv5-d16 -mfloat-abi=softfp} "thumb/v8-m.main+dp/softfp"
{-march=armv8-m.main+fp+dsp -mfpu=fpv5-d16 -mfloat-abi=softfp} "thumb/v8-m.main+dp/softfp"
{-march=armv8-m.main+fp.dp+dsp -mfpu=fpv5-d16 -mfloat-abi=softfp} "thumb/v8-m.main+dp/softfp"
+ {-march=armv7-r+fp -mfpu=auto -mfloat-abi=softfp} "thumb/v7+fp/softfp"
+ {-march=armv7-r+fp -mfpu=auto -mfloat-abi=hard} "thumb/v7+fp/hard"
+ {-march=armv7-r+fp+idiv -mfpu=auto -mfloat-abi=softfp} "thumb/v7+fp/softfp"
+ {-march=armv7-r+fp+idiv -mfpu=auto -mfloat-abi=hard} "thumb/v7+fp/hard"
+ {-march=armv7-r+vfpv3-d16-fp16 -mfpu=auto -mfloat-abi=softfp} "thumb/v7+fp/softfp"
+ {-march=armv7-r+vfpv3-d16-fp16 -mfpu=auto -mfloat-abi=hard} "thumb/v7+fp/hard"
+ {-march=armv7-r+vfpv3-d16-fp16+idiv -mfpu=auto -mfloat-abi=softfp} "thumb/v7+fp/softfp"
+ {-march=armv7-r+vfpv3-d16-fp16+idiv -mfpu=auto -mfloat-abi=hard} "thumb/v7+fp/hard"
+ {-march=armv7-r+fp.sp -mfpu=auto -mfloat-abi=softfp} "thumb/v7-r+fp.sp/softfp"
+ {-march=armv7-r+fp.sp -mfpu=auto -mfloat-abi=hard} "thumb/v7-r+fp.sp/hard"
+ {-march=armv7-r+fp.sp+idiv -mfpu=auto -mfloat-abi=softfp} "thumb/v7-r+fp.sp/softfp"
+ {-march=armv7-r+fp.sp+idiv -mfpu=auto -mfloat-abi=hard} "thumb/v7-r+fp.sp/hard"
+ {-march=armv7-r+vfpv3xd -mfpu=auto -mfloat-abi=softfp} "thumb/v7-r+fp.sp/softfp"
+ {-march=armv7-r+vfpv3xd -mfpu=auto -mfloat-abi=hard} "thumb/v7-r+fp.sp/hard"
+ {-march=armv7-r+vfpv3xd+idiv -mfpu=auto -mfloat-abi=softfp} "thumb/v7-r+fp.sp/softfp"
+ {-march=armv7-r+vfpv3xd+idiv -mfpu=auto -mfloat-abi=hard} "thumb/v7-r+fp.sp/hard"
+ {-march=armv7-r+vfpv3xd-fp16+idiv -mfpu=auto -mfloat-abi=softfp} "thumb/v7-r+fp.sp/softfp"
+ {-march=armv7-r+vfpv3xd-fp16+idiv -mfpu=auto -mfloat-abi=hard} "thumb/v7-r+fp.sp/hard"
+ {-march=armv8-r+fp.sp -mfpu=auto -mfloat-abi=softfp} "thumb/v7-r+fp.sp/softfp"
+ {-march=armv8-r+fp.sp -mfpu=auto -mfloat-abi=hard} "thumb/v7-r+fp.sp/hard"
+ {-march=armv8-r+crc+fp.sp -mfpu=auto -mfloat-abi=softfp} "thumb/v7-r+fp.sp/softfp"
+ {-march=armv8-r+crc+fp.sp -mfpu=auto -mfloat-abi=hard} "thumb/v7-r+fp.sp/hard"
} {
check_multi_dir $opts $dir
}
diff --git a/gcc/testsuite/gcc.target/arm/pr88167-1.c b/gcc/testsuite/gcc.target/arm/pr88167-1.c
new file mode 100644
index 00000000000..517a86d6e4b
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/pr88167-1.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target arm_thumb1_ok } */
+/* { dg-options "-O2 -mthumb" } */
+
+void *retaddr;
+
+void foo (void) {
+ retaddr = __builtin_return_address (0);
+
+ /* Used for enforcing registers stacking. */
+ asm volatile ("" : : : "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7",
+ "r8", "r9", "r10", "r11", "r12");
+}
+
+/* { dg-final { scan-assembler-not "mov\tlr," } } */
diff --git a/gcc/testsuite/gcc.target/arm/pr88167-2.c b/gcc/testsuite/gcc.target/arm/pr88167-2.c
new file mode 100644
index 00000000000..6a303345eb9
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/pr88167-2.c
@@ -0,0 +1,18 @@
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+/* { dg-skip-if "" { ! { arm_thumb1 } } } */
+
+int __attribute__((noclone, noinline))
+foo (int a, long long b) {
+ /* Used for enforcing registers stacking. */
+ asm volatile ("" : : : "r0", "r1", "r2", "r3",
+ "r8", "r9", "r10", "r11", "r12");
+ return (int) b;
+}
+
+int main ()
+{
+ if (foo (1, 0x1000000000000003LL) != 3)
+ __builtin_abort ();
+ __builtin_exit (0);
+}
diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-1.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-1.c
index 052d24dabdf..e2914a8333c 100644
--- a/gcc/testsuite/gcc.target/i386/indirect-thunk-1.c
+++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-1.c
@@ -14,7 +14,7 @@ male_indirect_jump (long offset)
/* { dg-final { scan-assembler "mov(?:l|q)\[ \t\]*dispatch" { target *-*-linux* } } } */
/* { dg-final { scan-assembler {movq[ \t]*_dispatch} { target { lp64 && *-*-darwin* } } } } */
-/* { dg-final { scan-assembler {movl[ \t]*l_dispatch\$non_lazy_ptr-L[0-9]+\$pb} { target { ia32 && *-*-darwin* } } } } */
+/* { dg-final { scan-assembler {movl[ \t]*[Ll]_dispatch\$non_lazy_ptr-L[0-9]+\$pb} { target { ia32 && *-*-darwin* } } } } */
/* { dg-final { scan-assembler "jmp\[ \t\]*_?__x86_indirect_thunk_(r|e)ax" } } */
/* { dg-final { scan-assembler {jmp[ \t]*\.?LIND} } } */
/* { dg-final { scan-assembler {call[ \t]*\.?LIND} } } */
diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-2.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-2.c
index 2cfbd728b4b..d2b7c74b143 100644
--- a/gcc/testsuite/gcc.target/i386/indirect-thunk-2.c
+++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-2.c
@@ -14,7 +14,7 @@ male_indirect_jump (long offset)
/* { dg-final { scan-assembler "mov(?:l|q)\[ \t\]*dispatch" { target *-*-linux* } } } */
/* { dg-final { scan-assembler {movq[ \t]*_dispatch} { target { lp64 && *-*-darwin* } } } } */
-/* { dg-final { scan-assembler {movl[ \t]*l_dispatch\$non_lazy_ptr-L[0-9]+\$pb} { target { ia32 && *-*-darwin* } } } } */
+/* { dg-final { scan-assembler {movl[ \t]*[Ll]_dispatch\$non_lazy_ptr-L[0-9]+\$pb} { target { ia32 && *-*-darwin* } } } } */
/* { dg-final { scan-assembler "jmp\[ \t\]*_?__x86_indirect_thunk_(r|e)ax" } } */
/* { dg-final { scan-assembler {jmp[ \t]*\.?LIND} } } */
/* { dg-final { scan-assembler {call[ \t]*\.?LIND} } } */
diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-3.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-3.c
index 59bb08613b7..129fb2125f0 100644
--- a/gcc/testsuite/gcc.target/i386/indirect-thunk-3.c
+++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-3.c
@@ -15,7 +15,7 @@ male_indirect_jump (long offset)
/* { dg-final { scan-assembler "mov(?:l|q)\[ \t\]*dispatch" { target *-*-linux* } } } */
/* { dg-final { scan-assembler {movq[ \t]*_dispatch} { target { lp64 && *-*-darwin* } } } } */
-/* { dg-final { scan-assembler {movl[ \t]*l_dispatch\$non_lazy_ptr-L[0-9]+\$pb} { target { ia32 && *-*-darwin* } } } } */
+/* { dg-final { scan-assembler {movl[ \t]*[Ll]_dispatch\$non_lazy_ptr-L[0-9]+\$pb} { target { ia32 && *-*-darwin* } } } } */
/* { dg-final { scan-assembler "call\[ \t\]*_?__x86_indirect_thunk_(r|e)ax" } } */
/* { dg-final { scan-assembler {jmp[ \t]*\.?LIND} } } */
/* { dg-final { scan-assembler {call[ \t]*\.?LIND} } } */
diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-4.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-4.c
index 59640fab8f1..01996fb029f 100644
--- a/gcc/testsuite/gcc.target/i386/indirect-thunk-4.c
+++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-4.c
@@ -15,7 +15,7 @@ male_indirect_jump (long offset)
/* { dg-final { scan-assembler "mov(?:l|q)\[ \t\]*dispatch" { target *-*-linux* } } } */
/* { dg-final { scan-assembler {movq[ \t]*_dispatch} { target { lp64 && *-*-darwin* } } } } */
-/* { dg-final { scan-assembler {movl[ \t]*l_dispatch\$non_lazy_ptr-L[0-9]+\$pb} { target { ia32 && *-*-darwin* } } } } */
+/* { dg-final { scan-assembler {movl[ \t]*[Ll]_dispatch\$non_lazy_ptr-L[0-9]+\$pb} { target { ia32 && *-*-darwin* } } } } */
/* { dg-final { scan-assembler "call\[ \t\]*_?__x86_indirect_thunk_(r|e)ax" } } */
/* { dg-final { scan-assembler {jmp[ \t]*\.?LIND} } } */
/* { dg-final { scan-assembler {call[ \t]*\.?LIND} } } */
diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-1.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-1.c
index 8620bf1d836..1493e18243b 100644
--- a/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-1.c
+++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-1.c
@@ -17,7 +17,7 @@ male_indirect_jump (long offset)
/* { dg-final { scan-assembler "mov(?:l|q)\[ \t\]*dispatch" { target *-*-linux* } } } */
/* { dg-final { scan-assembler {movq[ \t]*_dispatch} { target { lp64 && *-*-darwin* } } } } */
-/* { dg-final { scan-assembler {movl[ \t]*l_dispatch\$non_lazy_ptr-L[0-9]+\$pb} { target { ia32 && *-*-darwin* } } } } */
+/* { dg-final { scan-assembler {movl[ \t]*[Ll]_dispatch\$non_lazy_ptr-L[0-9]+\$pb} { target { ia32 && *-*-darwin* } } } } */
/* { dg-final { scan-assembler "jmp\[ \t\]*_?__x86_indirect_thunk_(r|e)ax" } } */
/* { dg-final { scan-assembler {jmp[ \t]*\.?LIND} } } */
/* { dg-final { scan-assembler {call[ \t]*\.?LIND} } } */
diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-2.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-2.c
index 42e83416965..3ddd4980b69 100644
--- a/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-2.c
+++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-2.c
@@ -15,7 +15,7 @@ male_indirect_jump (long offset)
/* { dg-final { scan-assembler "mov(?:l|q)\[ \t\]*dispatch" { target *-*-linux* } } } */
/* { dg-final { scan-assembler {movq[ \t]*_dispatch} { target { lp64 && *-*-darwin* } } } } */
-/* { dg-final { scan-assembler {movl[ \t]*l_dispatch\$non_lazy_ptr-L[0-9]+\$pb} { target { ia32 && *-*-darwin* } } } } */
+/* { dg-final { scan-assembler {movl[ \t]*[Ll]_dispatch\$non_lazy_ptr-L[0-9]+\$pb} { target { ia32 && *-*-darwin* } } } } */
/* { dg-final { scan-assembler "jmp\[ \t\]*_?__x86_indirect_thunk_(r|e)ax" } } */
/* { dg-final { scan-assembler {jmp[ \t]*\.?LIND} } } */
/* { dg-final { scan-assembler {call[ \t]*\.?LIND} } } */
diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-3.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-3.c
index 6a9c51337d9..43d5f95b4fb 100644
--- a/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-3.c
+++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-3.c
@@ -17,7 +17,7 @@ male_indirect_jump (long offset)
/* { dg-final { scan-assembler "mov(?:l|q)\[ \t\]*dispatch" { target *-*-linux* } } } */
/* { dg-final { scan-assembler {movq[ \t]*_dispatch} { target { lp64 && *-*-darwin* } } } } */
-/* { dg-final { scan-assembler {movl[ \t]*l_dispatch\$non_lazy_ptr-L[0-9]+\$pb} { target { ia32 && *-*-darwin* } } } } */
+/* { dg-final { scan-assembler {movl[ \t]*[Ll]_dispatch\$non_lazy_ptr-L[0-9]+\$pb} { target { ia32 && *-*-darwin* } } } } */
/* { dg-final { scan-assembler-times {jmp[ \t]*\.?LIND} 2 } } */
/* { dg-final { scan-assembler-times {call[ \t]*\.?LIND} 2 } } */
/* { dg-final { scan-assembler {\tpause} } } */
diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-4.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-4.c
index 85ec57b5a8d..bf62636c63c 100644
--- a/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-4.c
+++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-4.c
@@ -16,7 +16,7 @@ male_indirect_jump (long offset)
/* { dg-final { scan-assembler "mov(?:l|q)\[ \t\]*dispatch" { target *-*-linux* } } } */
/* { dg-final { scan-assembler {movq[ \t]*_dispatch} { target { lp64 && *-*-darwin* } } } } */
-/* { dg-final { scan-assembler {movl[ \t]*l_dispatch\$non_lazy_ptr-L[0-9]+\$pb} { target { ia32 && *-*-darwin* } } } } */
+/* { dg-final { scan-assembler {movl[ \t]*[Ll]_dispatch\$non_lazy_ptr-L[0-9]+\$pb} { target { ia32 && *-*-darwin* } } } } */
/* { dg-final { scan-assembler-times {jmp[ \t]*\.?LIND} 2 } } */
/* { dg-final { scan-assembler-times {call[ \t]*\.?LIND} 2 } } */
/* { dg-final { scan-assembler {\tpause} } } */
diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-5.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-5.c
index db1d8fb9979..27ba82932e4 100644
--- a/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-5.c
+++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-5.c
@@ -17,7 +17,7 @@ male_indirect_jump (long offset)
/* { dg-final { scan-assembler "mov(?:l|q)\[ \t\]*dispatch" { target *-*-linux* } } } */
/* { dg-final { scan-assembler {movq[ \t]*_dispatch} { target { lp64 && *-*-darwin* } } } } */
-/* { dg-final { scan-assembler {movl[ \t]*l_dispatch\$non_lazy_ptr-L[0-9]+\$pb} { target { ia32 && *-*-darwin* } } } } */
+/* { dg-final { scan-assembler {movl[ \t]*[Ll]_dispatch\$non_lazy_ptr-L[0-9]+\$pb} { target { ia32 && *-*-darwin* } } } } */
/* { dg-final { scan-assembler "call\[ \t\]*_?__x86_indirect_thunk_(r|e)ax" } } */
/* { dg-final { scan-assembler-not {\t(lfence|pause)} } } */
/* { dg-final { scan-assembler-not {jmp[ \t]*\.?LIND} } } */
diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-6.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-6.c
index 24fc43b3ba5..bdf15d36bac 100644
--- a/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-6.c
+++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-attr-6.c
@@ -16,7 +16,7 @@ male_indirect_jump (long offset)
/* { dg-final { scan-assembler "mov(?:l|q)\[ \t\]*dispatch" { target *-*-linux* } } } */
/* { dg-final { scan-assembler {movq[ \t]*_dispatch} { target { lp64 && *-*-darwin* } } } } */
-/* { dg-final { scan-assembler {movl[ \t]*l_dispatch\$non_lazy_ptr-L[0-9]+\$pb} { target { ia32 && *-*-darwin* } } } } */
+/* { dg-final { scan-assembler {movl[ \t]*[Ll]_dispatch\$non_lazy_ptr-L[0-9]+\$pb} { target { ia32 && *-*-darwin* } } } } */
/* { dg-final { scan-assembler "call\[ \t\]*_?__x86_indirect_thunk_(r|e)ax" } } */
/* { dg-final { scan-assembler-not {\t(lfence|pause)} } } */
/* { dg-final { scan-assembler-not {jmp[ \t]*\.?LIND} } } */
diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-extern-1.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-extern-1.c
index 3dc02f80ff5..c30c331c23b 100644
--- a/gcc/testsuite/gcc.target/i386/indirect-thunk-extern-1.c
+++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-extern-1.c
@@ -14,7 +14,7 @@ male_indirect_jump (long offset)
/* { dg-final { scan-assembler "mov(?:l|q)\[ \t\]*dispatch" { target *-*-linux* } } } */
/* { dg-final { scan-assembler {movq[ \t]*_dispatch} { target { lp64 && *-*-darwin* } } } } */
-/* { dg-final { scan-assembler {movl[ \t]*l_dispatch\$non_lazy_ptr-L[0-9]+\$pb} { target { ia32 && *-*-darwin* } } } } */
+/* { dg-final { scan-assembler {movl[ \t]*[Ll]_dispatch\$non_lazy_ptr-L[0-9]+\$pb} { target { ia32 && *-*-darwin* } } } } */
/* { dg-final { scan-assembler "jmp\[ \t\]*_?__x86_indirect_thunk_(r|e)ax" } } */
/* { dg-final { scan-assembler-not {\t(lfence|pause)} } } */
/* { dg-final { scan-assembler-not {jmp[ \t]*\.?LIND} } } */
diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-extern-2.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-extern-2.c
index c4adae23dd3..7edd7313027 100644
--- a/gcc/testsuite/gcc.target/i386/indirect-thunk-extern-2.c
+++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-extern-2.c
@@ -14,7 +14,7 @@ male_indirect_jump (long offset)
/* { dg-final { scan-assembler "mov(?:l|q)\[ \t\]*dispatch" { target *-*-linux* } } } */
/* { dg-final { scan-assembler {movq[ \t]*_dispatch} { target { lp64 && *-*-darwin* } } } } */
-/* { dg-final { scan-assembler {movl[ \t]*l_dispatch\$non_lazy_ptr-L[0-9]+\$pb} { target { ia32 && *-*-darwin* } } } } */
+/* { dg-final { scan-assembler {movl[ \t]*[Ll]_dispatch\$non_lazy_ptr-L[0-9]+\$pb} { target { ia32 && *-*-darwin* } } } } */
/* { dg-final { scan-assembler "jmp\[ \t\]*_?__x86_indirect_thunk_(r|e)ax" } } */
/* { dg-final { scan-assembler-not {\t(lfence|pause)} } } */
/* { dg-final { scan-assembler-not {jmp[ \t]*\.?LIND} } } */
diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-extern-3.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-extern-3.c
index b800b40b055..8e391797c5e 100644
--- a/gcc/testsuite/gcc.target/i386/indirect-thunk-extern-3.c
+++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-extern-3.c
@@ -15,7 +15,7 @@ male_indirect_jump (long offset)
/* { dg-final { scan-assembler "mov(?:l|q)\[ \t\]*dispatch" { target *-*-linux* } } } */
/* { dg-final { scan-assembler {movq[ \t]*_dispatch} { target { lp64 && *-*-darwin* } } } } */
-/* { dg-final { scan-assembler {movl[ \t]*l_dispatch\$non_lazy_ptr-L[0-9]+\$pb} { target { ia32 && *-*-darwin* } } } } */
+/* { dg-final { scan-assembler {movl[ \t]*[Ll]_dispatch\$non_lazy_ptr-L[0-9]+\$pb} { target { ia32 && *-*-darwin* } } } } */
/* { dg-final { scan-assembler "call\[ \t\]*_?__x86_indirect_thunk_(r|e)ax" } } */
/* { dg-final { scan-assembler-not {\t(lfence|pause)} } } */
/* { dg-final { scan-assembler-not {jmp[ \t]*\.?LIND} } } */
diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-extern-4.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-extern-4.c
index f68902ddc25..6033d13e8a7 100644
--- a/gcc/testsuite/gcc.target/i386/indirect-thunk-extern-4.c
+++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-extern-4.c
@@ -15,6 +15,6 @@ male_indirect_jump (long offset)
/* { dg-final { scan-assembler "mov(?:l|q)\[ \t\]*dispatch" { target *-*-linux* } } } */
/* { dg-final { scan-assembler {movq[ \t]*_dispatch} { target { lp64 && *-*-darwin* } } } } */
-/* { dg-final { scan-assembler {movl[ \t]*l_dispatch\$non_lazy_ptr-L[0-9]+\$pb} { target { ia32 && *-*-darwin* } } } } */
+/* { dg-final { scan-assembler {movl[ \t]*[Ll]_dispatch\$non_lazy_ptr-L[0-9]+\$pb} { target { ia32 && *-*-darwin* } } } } */
/* { dg-final { scan-assembler "call\[ \t\]*_?__x86_indirect_thunk_(r|e)ax" } } */
/* { dg-final { scan-assembler-not {\t(lfence|pause)} } } */
diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-inline-1.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-inline-1.c
index 7301490d49c..ef3577d2934 100644
--- a/gcc/testsuite/gcc.target/i386/indirect-thunk-inline-1.c
+++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-inline-1.c
@@ -14,7 +14,7 @@ male_indirect_jump (long offset)
/* { dg-final { scan-assembler "mov(?:l|q)\[ \t\]*dispatch" { target *-*-linux* } } } */
/* { dg-final { scan-assembler {movq[ \t]*_dispatch} { target { lp64 && *-*-darwin* } } } } */
-/* { dg-final { scan-assembler {movl[ \t]*l_dispatch\$non_lazy_ptr-L[0-9]+\$pb} { target { ia32 && *-*-darwin* } } } } */
+/* { dg-final { scan-assembler {movl[ \t]*[Ll]_dispatch\$non_lazy_ptr-L[0-9]+\$pb} { target { ia32 && *-*-darwin* } } } } */
/* { dg-final { scan-assembler {jmp[ \t]*\.?LIND} } } */
/* { dg-final { scan-assembler {call[ \t]*\.?LIND} } } */
/* { dg-final { scan-assembler {\tpause} } } */
diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-inline-2.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-inline-2.c
index ef1ba02978d..f26a5fb9015 100644
--- a/gcc/testsuite/gcc.target/i386/indirect-thunk-inline-2.c
+++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-inline-2.c
@@ -14,7 +14,7 @@ male_indirect_jump (long offset)
/* { dg-final { scan-assembler "mov(?:l|q)\[ \t\]*dispatch" { target *-*-linux* } } } */
/* { dg-final { scan-assembler {movq[ \t]*_dispatch} { target { lp64 && *-*-darwin* } } } } */
-/* { dg-final { scan-assembler {movl[ \t]*l_dispatch\$non_lazy_ptr-L[0-9]+\$pb} { target { ia32 && *-*-darwin* } } } } */
+/* { dg-final { scan-assembler {movl[ \t]*[Ll]_dispatch\$non_lazy_ptr-L[0-9]+\$pb} { target { ia32 && *-*-darwin* } } } } */
/* { dg-final { scan-assembler {jmp[ \t]*\.?LIND} } } */
/* { dg-final { scan-assembler {call[ \t]*\.?LIND} } } */
/* { dg-final { scan-assembler {\tpause} } } */
diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-inline-3.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-inline-3.c
index 58de8f0393e..3b8a1eeaffb 100644
--- a/gcc/testsuite/gcc.target/i386/indirect-thunk-inline-3.c
+++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-inline-3.c
@@ -15,7 +15,7 @@ male_indirect_jump (long offset)
/* { dg-final { scan-assembler "mov(?:l|q)\[ \t\]*dispatch" { target *-*-linux* } } } */
/* { dg-final { scan-assembler {movq[ \t]*_dispatch} { target { lp64 && *-*-darwin* } } } } */
-/* { dg-final { scan-assembler {movl[ \t]*l_dispatch\$non_lazy_ptr-L[0-9]+\$pb} { target { ia32 && *-*-darwin* } } } } */
+/* { dg-final { scan-assembler {movl[ \t]*[Ll]_dispatch\$non_lazy_ptr-L[0-9]+\$pb} { target { ia32 && *-*-darwin* } } } } */
/* { dg-final { scan-assembler-times {jmp[ \t]*\.?LIND} 2 } } */
/* { dg-final { scan-assembler-times {call[ \t]*\.?LIND} 2 } } */
/* { dg-final { scan-assembler-times {\tpause} 1 } } */
diff --git a/gcc/testsuite/gcc.target/i386/indirect-thunk-inline-4.c b/gcc/testsuite/gcc.target/i386/indirect-thunk-inline-4.c
index 3be3ce07527..40d31803a2e 100644
--- a/gcc/testsuite/gcc.target/i386/indirect-thunk-inline-4.c
+++ b/gcc/testsuite/gcc.target/i386/indirect-thunk-inline-4.c
@@ -15,7 +15,7 @@ male_indirect_jump (long offset)
/* { dg-final { scan-assembler "mov(?:l|q)\[ \t\]*dispatch" { target *-*-linux* } } } */
/* { dg-final { scan-assembler {movq[ \t]*_dispatch} { target { lp64 && *-*-darwin* } } } } */
-/* { dg-final { scan-assembler {movl[ \t]*l_dispatch\$non_lazy_ptr-L[0-9]+\$pb} { target { ia32 && *-*-darwin* } } } } */
+/* { dg-final { scan-assembler {movl[ \t]*[Ll]_dispatch\$non_lazy_ptr-L[0-9]+\$pb} { target { ia32 && *-*-darwin* } } } } */
/* { dg-final { scan-assembler-times {jmp[ \t]*\.?LIND} 2 } } */
/* { dg-final { scan-assembler-times {call[ \t]*\.?LIND} 2 } } */
/* { dg-final { scan-assembler-times {\tpause} 1 } } */
diff --git a/gcc/testsuite/gcc.target/i386/pr32219-2.c b/gcc/testsuite/gcc.target/i386/pr32219-2.c
index cb587db47aa..b6212f7dd4c 100644
--- a/gcc/testsuite/gcc.target/i386/pr32219-2.c
+++ b/gcc/testsuite/gcc.target/i386/pr32219-2.c
@@ -20,5 +20,5 @@ foo ()
/* { dg-final { scan-assembler "movl\[ \t\]xxx@GOT\\(%\[^,\]*\\), %" { target { ia32 && { ! *-*-darwin* } } } } } */
/* Darwin m32 defaults to PIC but common symbols need to be indirected. */
-/* { dg-final { scan-assembler {movl[ \t]l_xxx\$non_lazy_ptr-L1\$pb\(%eax\),[ \t]%eax} { target { ia32 && *-*-darwin* } } } } */
+/* { dg-final { scan-assembler {movl[ \t][Ll]_xxx\$non_lazy_ptr-L1\$pb\(%eax\),[ \t]%eax} { target { ia32 && *-*-darwin* } } } } */
diff --git a/gcc/testsuite/gcc.target/i386/pr32219-3.c b/gcc/testsuite/gcc.target/i386/pr32219-3.c
index f9cfca7d72c..a1b0df28d0d 100644
--- a/gcc/testsuite/gcc.target/i386/pr32219-3.c
+++ b/gcc/testsuite/gcc.target/i386/pr32219-3.c
@@ -24,4 +24,4 @@ foo ()
/* For Darwin, we need PIC to allow PIE, but also we must indirect weak symbols so that
they can be indirected. Again, dyld knows how to deal with this. */
-/* { dg-final { scan-assembler {movl[ \t]l_xxx\$non_lazy_ptr-L1\$pb\(%eax\),[ \t]%eax} { target { ia32 && *-*-darwin* } } } } */
+/* { dg-final { scan-assembler {movl[ \t][Ll]_xxx\$non_lazy_ptr-L1\$pb\(%eax\),[ \t]%eax} { target { ia32 && *-*-darwin* } } } } */
diff --git a/gcc/testsuite/gcc.target/i386/pr32219-4.c b/gcc/testsuite/gcc.target/i386/pr32219-4.c
index 0ac0674ae17..31d0710b7ed 100644
--- a/gcc/testsuite/gcc.target/i386/pr32219-4.c
+++ b/gcc/testsuite/gcc.target/i386/pr32219-4.c
@@ -21,4 +21,4 @@ foo ()
/* { dg-final { scan-assembler "movl\[ \t\]xxx@GOT\\(%\[^,\]*\\), %" { target { ia32 && { ! *-*-darwin* } } } } } */
/* Darwin m32 equivalent (indirect and PIC). */
-/* { dg-final { scan-assembler {movl[ \t]l_xxx\$non_lazy_ptr-L1\$pb\(%eax\),[ \t]%eax} { target { ia32 && *-*-darwin* } } } } */
+/* { dg-final { scan-assembler {movl[ \t][Ll]_xxx\$non_lazy_ptr-L1\$pb\(%eax\),[ \t]%eax} { target { ia32 && *-*-darwin* } } } } */
diff --git a/gcc/testsuite/gcc.target/i386/pr32219-7.c b/gcc/testsuite/gcc.target/i386/pr32219-7.c
index 469e9e38b07..20fef8dd063 100644
--- a/gcc/testsuite/gcc.target/i386/pr32219-7.c
+++ b/gcc/testsuite/gcc.target/i386/pr32219-7.c
@@ -23,4 +23,4 @@ foo ()
/* { dg-final { scan-assembler-not "movl\[ \t\]xxx@GOT\\(%\[^,\]*\\), %eax" { target { ia32 && { ! *-*-darwin* } } } } } */
/* Darwin m32 equivalent (indirect and PIC). */
-/* { dg-final { scan-assembler {movl[ \t]l_xxx\$non_lazy_ptr-L1\$pb\(%eax\),[ \t]%eax} { target { ia32 && *-*-darwin* } } } } */
+/* { dg-final { scan-assembler {movl[ \t][Ll]_xxx\$non_lazy_ptr-L1\$pb\(%eax\),[ \t]%eax} { target { ia32 && *-*-darwin* } } } } */
diff --git a/gcc/testsuite/gcc.target/i386/pr32219-8.c b/gcc/testsuite/gcc.target/i386/pr32219-8.c
index 75eb287fc59..767928f049e 100644
--- a/gcc/testsuite/gcc.target/i386/pr32219-8.c
+++ b/gcc/testsuite/gcc.target/i386/pr32219-8.c
@@ -21,4 +21,4 @@ foo ()
/* { dg-final { scan-assembler "movl\[ \t\]xxx@GOT\\(%\[^,\]*\\), %" { target { ia32 && { ! *-*-darwin* } } } } } */
/* Darwin m32 default to PIC but needs indirection for the weak symbol. */
-/* { dg-final { scan-assembler {movl[ \t]l_xxx\$non_lazy_ptr-L1\$pb\(%eax\),[ \t]%eax} { target { ia32 && *-*-darwin* } } } } */
+/* { dg-final { scan-assembler {movl[ \t][Ll]_xxx\$non_lazy_ptr-L1\$pb\(%eax\),[ \t]%eax} { target { ia32 && *-*-darwin* } } } } */
diff --git a/gcc/testsuite/gcc.target/i386/pr87853.c b/gcc/testsuite/gcc.target/i386/pr87853.c
new file mode 100644
index 00000000000..9a288879679
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr87853.c
@@ -0,0 +1,20 @@
+/* PR target/87853 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -funsigned-char -msse2 -mno-sse3 -masm=att" } */
+/* { dg-final { scan-assembler-times "\tpcmpgtb\t%xmm" 2 } } */
+/* { dg-final { scan-assembler-not "\tpsubusb\t" } } */
+/* { dg-final { scan-assembler-not "\tpcmpeqb\t" } } */
+
+#include <x86intrin.h>
+
+__m128i
+foo (__m128i x, __m128i y)
+{
+ return _mm_cmpgt_epi8 (x, y);
+}
+
+__m128i
+bar (__m128i x, __m128i y)
+{
+ return _mm_cmplt_epi8 (x, y);
+}
diff --git a/gcc/testsuite/gcc.target/i386/pr90867.c b/gcc/testsuite/gcc.target/i386/pr90867.c
new file mode 100644
index 00000000000..1ed96b582ed
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr90867.c
@@ -0,0 +1,30 @@
+/* PR target/90867 */
+/* { dg-do run { target lp64 } } */
+/* { dg-options "-O2 -msse2" } */
+
+unsigned long long freq = 3600000000UL; /* 3.6 GHz = 3600.0 MHz */
+
+__attribute__((noipa)) void
+bar (double x)
+{
+ static double d = 3600000000.0;
+ if (x != d)
+ __builtin_abort ();
+ d /= 1000.0;
+}
+
+__attribute__ ((target ("arch=x86-64"))) int
+foo ()
+{
+ bar ((double) freq);
+ bar (1e-3 * freq);
+ bar (1e-6 * freq);
+ bar (1e-9 * freq);
+ return 0;
+}
+
+int
+main ()
+{
+ return foo ();
+}
diff --git a/gcc/testsuite/gcc.target/i386/pr91623.c b/gcc/testsuite/gcc.target/i386/pr91623.c
new file mode 100644
index 00000000000..94de4f91c6d
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr91623.c
@@ -0,0 +1,32 @@
+/* PR middle-end/91623 */
+/* { dg-do compile } */
+/* { dg-options "-O3 -msse4.1 -mno-sse4.2" } */
+
+typedef long long V __attribute__((__vector_size__(16)));
+V e, h;
+int d;
+const int i;
+
+void foo (void);
+
+void
+bar (int k, int l)
+{
+ if (d && 0 <= k - 1 && l)
+ foo ();
+}
+
+void
+baz (void)
+{
+ V n = (V) { 1 };
+ V g = (V) {};
+ V o = g;
+ for (int f = 0; f < i; ++f)
+ {
+ V a = o == n;
+ h = a;
+ bar (f, i);
+ o = e;
+ }
+}
diff --git a/gcc/testsuite/gcc.target/i386/pr91704.c b/gcc/testsuite/gcc.target/i386/pr91704.c
new file mode 100644
index 00000000000..b996e24ad74
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr91704.c
@@ -0,0 +1,14 @@
+/* PR target/91704 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -funsigned-char -mavx2 -mavx512f -masm=att" } */
+/* { dg-final { scan-assembler-times "\tvpcmpgtb\t%ymm" 1 } } */
+/* { dg-final { scan-assembler-not "\tvpsubusb\t" } } */
+/* { dg-final { scan-assembler-not "\tvpcmpeqb\t" } } */
+
+#include <x86intrin.h>
+
+__m256i
+foo (__m256i x, __m256i y)
+{
+ return _mm256_cmpgt_epi8 (x, y);
+}
diff --git a/gcc/testsuite/gcc.target/i386/pr92225.c b/gcc/testsuite/gcc.target/i386/pr92225.c
new file mode 100644
index 00000000000..b1232195b45
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr92225.c
@@ -0,0 +1,19 @@
+/* PR target/92225 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-vectorize -msse2 -mno-sse4" } */
+
+void a (long);
+
+unsigned *b;
+
+void
+c ()
+{
+ long d = 2;
+ int e = 0;
+
+ for (; e < 1024; e++)
+ if (b[e] > d)
+ d = b[e];
+ a (d);
+}
diff --git a/gcc/testsuite/gcc.target/i386/ret-thunk-14.c b/gcc/testsuite/gcc.target/i386/ret-thunk-14.c
index 3eaddee8c34..881f541772c 100644
--- a/gcc/testsuite/gcc.target/i386/ret-thunk-14.c
+++ b/gcc/testsuite/gcc.target/i386/ret-thunk-14.c
@@ -19,6 +19,6 @@ foo (void)
/* { dg-final { scan-assembler {call[ \t]*\.?LIND} } } */
/* { dg-final { scan-assembler "mov(?:l|q)\[ \t\]*bar" { target *-*-linux* } } } */
/* { dg-final { scan-assembler {movq[ \t]*_bar} { target { lp64 && *-*-darwin* } } } } */
-/* { dg-final { scan-assembler {movl[ \t]*l_bar\$non_lazy_ptr-L[0-9]+\$pb} { target { ia32 && *-*-darwin* } } } } */
+/* { dg-final { scan-assembler {movl[ \t]*[Ll]_bar\$non_lazy_ptr-L[0-9]+\$pb} { target { ia32 && *-*-darwin* } } } } */
/* { dg-final { scan-assembler "call\[ \t\]*_?__x86_indirect_thunk_(r|e)ax" } } */
/* { dg-final { scan-assembler-not "pushq\[ \t\]%rax" } } */
diff --git a/gcc/testsuite/gcc.target/i386/ret-thunk-15.c b/gcc/testsuite/gcc.target/i386/ret-thunk-15.c
index 2793f72cdc1..5687440bf31 100644
--- a/gcc/testsuite/gcc.target/i386/ret-thunk-15.c
+++ b/gcc/testsuite/gcc.target/i386/ret-thunk-15.c
@@ -19,6 +19,6 @@ foo (void)
/* { dg-final { scan-assembler-times {\tlfence} 1 } } */
/* { dg-final { scan-assembler "mov(?:l|q)\[ \t\]*bar" { target *-*-linux* } } } */
/* { dg-final { scan-assembler {movq[ \t]*_bar} { target { lp64 && *-*-darwin* } } } } */
-/* { dg-final { scan-assembler {movl[ \t]*l_bar\$non_lazy_ptr-L[0-9]+\$pb} { target { ia32 && *-*-darwin* } } } } */
+/* { dg-final { scan-assembler {movl[ \t]*[Ll]_bar\$non_lazy_ptr-L[0-9]+\$pb} { target { ia32 && *-*-darwin* } } } } */
/* { dg-final { scan-assembler "call\[ \t\]*_?__x86_indirect_thunk_(r|e)ax" } } */
/* { dg-final { scan-assembler-not "pushq\[ \t\]%rax" } } */
diff --git a/gcc/testsuite/gcc.target/i386/ret-thunk-9.c b/gcc/testsuite/gcc.target/i386/ret-thunk-9.c
index 63af6741e05..3d4497000dc 100644
--- a/gcc/testsuite/gcc.target/i386/ret-thunk-9.c
+++ b/gcc/testsuite/gcc.target/i386/ret-thunk-9.c
@@ -17,7 +17,7 @@ foo (void)
/* { dg-final { scan-assembler "_?__x86_return_thunk:" } } */
/* { dg-final { scan-assembler "mov(?:l|q)\[ \t\]*bar" { target *-*-linux* } } } */
/* { dg-final { scan-assembler {movq[ \t]*_bar} { target { lp64 && *-*-darwin* } } } } */
-/* { dg-final { scan-assembler {movl[ \t]*l_bar\$non_lazy_ptr-L[0-9]+\$pb} { target { ia32 && *-*-darwin* } } } } */
+/* { dg-final { scan-assembler {movl[ \t]*[Ll]_bar\$non_lazy_ptr-L[0-9]+\$pb} { target { ia32 && *-*-darwin* } } } } */
/* { dg-final { scan-assembler-times {\tpause} 2 } } */
/* { dg-final { scan-assembler-times {\tlfence} 2 } } */
/* { dg-final { scan-assembler "call\[ \t\]*_?__x86_indirect_thunk_(r|e)ax" } } */
diff --git a/gcc/testsuite/gcc.target/mips/cfgcleanup-jalr1.c b/gcc/testsuite/gcc.target/mips/cfgcleanup-jalr1.c
new file mode 100644
index 00000000000..24c18262b1a
--- /dev/null
+++ b/gcc/testsuite/gcc.target/mips/cfgcleanup-jalr1.c
@@ -0,0 +1,19 @@
+/* { dg-do compile } */
+/* { dg-options "-mabicalls -fpic -mno-mips16 -mno-micromips" } */
+/* { dg-skip-if "needs codesize optimization" { *-*-* } { "-O0" "-O1" "-O2" "-O3" } { "" } } */
+
+extern void foo (void*);
+
+extern void bar (void*);
+
+void
+test (void* p)
+{
+ if (!p)
+ foo(p);
+ else
+ bar(p);
+}
+
+/* { dg-final { scan-assembler-not "\\\.reloc\t1f,R_MIPS_JALR,foo" } } */
+/* { dg-final { scan-assembler-not "\\\.reloc\t1f,R_MIPS_JALR,bar" } } */
diff --git a/gcc/testsuite/gcc.target/mips/cfgcleanup-jalr2.c b/gcc/testsuite/gcc.target/mips/cfgcleanup-jalr2.c
new file mode 100644
index 00000000000..9fd75c98773
--- /dev/null
+++ b/gcc/testsuite/gcc.target/mips/cfgcleanup-jalr2.c
@@ -0,0 +1,23 @@
+/* { dg-do compile } */
+/* { dg-options "-mabicalls -fpic -mno-mips16 -mno-micromips" } */
+/* { dg-additional-options "-fno-inline -fipa-ra -mcompact-branches=never" } */
+/* { dg-skip-if "needs codesize optimization" { *-*-* } { "-O0" "-O1" "-O2" "-O3" } { "" } } */
+
+static int foo (void* p) { __asm__ (""::"r"(p):"$t0"); return 0; }
+
+static int bar (void* p) { return 1; }
+
+int
+test (void* p)
+{
+ int res = !p ? foo(p) : bar(p);
+
+ register int tmp __asm__("$t0") = -1;
+ __asm__ (""::"r"(tmp));
+
+ return res;
+}
+
+/* { dg-final { scan-assembler "\\\.reloc\t1f,R_MIPS_JALR,foo" } } */
+/* { dg-final { scan-assembler "\\\.reloc\t1f,R_MIPS_JALR,bar" } } */
+/* { dg-final { scan-assembler-not "\\.set\tnomacro\n\tjalr\t\\\$25" } } */
diff --git a/gcc/testsuite/gcc.target/mips/cfgcleanup-jalr3.c b/gcc/testsuite/gcc.target/mips/cfgcleanup-jalr3.c
new file mode 100644
index 00000000000..580c6ec069d
--- /dev/null
+++ b/gcc/testsuite/gcc.target/mips/cfgcleanup-jalr3.c
@@ -0,0 +1,23 @@
+/* { dg-do compile } */
+/* { dg-options "-mabicalls -fpic -mno-mips16 -mno-micromips" } */
+/* { dg-additional-options "-fno-inline -fipa-ra -mcompact-branches=never" } */
+/* { dg-skip-if "needs codesize optimization" { *-*-* } { "-O0" "-O1" "-O2" "-O3" } { "" } } */
+
+static int foo (void* p) { return 0; }
+
+static int bar (void* p) { return 1; }
+
+int
+test (void* p)
+{
+ int res = !p ? foo(p) : bar(p);
+
+ register int tmp __asm__("$t0") = -1;
+ __asm__ (""::"r"(tmp));
+
+ return res;
+}
+
+/* { dg-final { scan-assembler-not "\\\.reloc\t1f,R_MIPS_JALR,foo" } } */
+/* { dg-final { scan-assembler-not "\\\.reloc\t1f,R_MIPS_JALR,bar" } } */
+/* { dg-final { scan-assembler "\\.set\tnomacro\n\tjalr\t\\\$25" } } */
diff --git a/gcc/testsuite/gcc.target/mips/pr91769.c b/gcc/testsuite/gcc.target/mips/pr91769.c
new file mode 100644
index 00000000000..c9ad70d7f75
--- /dev/null
+++ b/gcc/testsuite/gcc.target/mips/pr91769.c
@@ -0,0 +1,19 @@
+/* PR target/91769 */
+/* { dg-do compile } */
+/* { dg-skip-if "naming registers makes this a code quality test" { *-*-* } { "-O0" "-g" } { "" } } */
+/* { dg-options "-EL -mgp32 -mhard-float" } */
+
+NOCOMPRESSION double
+foo (void)
+{
+ register double* pf __asm__ ("$a1");
+ __asm__ __volatile__ ("":"=r"(pf));
+ double f = *pf;
+
+ if (f != f)
+ f = -f;
+ return f;
+}
+
+/* { dg-final { scan-assembler-not "lw\t\\\$4,0\\(\\\$5\\)\n\tlw\t\\\$5,4\\(\\\$5\\)\n\tldc1\t\\\$.*,0\\(\\\$5\\)" } } */
+/* { dg-final { scan-assembler "lw\t\\\$4,0\\(\\\$5\\)\n\tlw\t\\\$5,4\\(\\\$5\\)\n\tmtc1\t\\\$4,\\\$.*\n\tmthc1\t\\\$5,\\\$.*" } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/darn-3.c b/gcc/testsuite/gcc.target/powerpc/darn-3.c
new file mode 100644
index 00000000000..477901fde70
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/darn-3.c
@@ -0,0 +1,16 @@
+/* { dg-do compile { target { powerpc*-*-* } } } */
+/* { dg-skip-if "" { powerpc*-*-aix* } } */
+/* { dg-options "-O2 -mdejagnu-cpu=power9" } */
+
+static int darn32(void) { return __builtin_darn_32(); }
+
+int four(void)
+{
+ int sum = 0;
+ int i;
+ for (i = 0; i < 4; i++)
+ sum += darn32();
+ return sum;
+}
+
+/* { dg-final { scan-assembler-times {(?n)\mdarn .*,0\M} 4 } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/pr70010-1.c b/gcc/testsuite/gcc.target/powerpc/pr70010-1.c
new file mode 100644
index 00000000000..4b3abb7d8fe
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/pr70010-1.c
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -flto -mvsx" } */
+/* { dg-require-effective-target lto } */
+
+vector int c, a, b;
+
+static inline void __attribute__ ((__always_inline__, target ("no-vsx")))
+foo () /* { dg-error "inlining failed in call to .* target specific option mismatch" } */
+{
+ c = a + b;
+}
+
+int
+main ()
+{
+ foo (); /* { dg-message "called from here" } */
+ c = a + b;
+}
diff --git a/gcc/testsuite/gcc.target/powerpc/pr70010-2.c b/gcc/testsuite/gcc.target/powerpc/pr70010-2.c
new file mode 100644
index 00000000000..0c04c5390db
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/pr70010-2.c
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -flto -mno-vsx" } */
+/* { dg-require-effective-target lto } */
+
+vector int c, a, b;
+
+static inline void __attribute__ ((__always_inline__, target ("no-vsx")))
+foo ()
+{
+ c = a + b;
+}
+
+int
+main ()
+{
+ foo ();
+ c = a + b;
+}
diff --git a/gcc/testsuite/gcc.target/powerpc/pr70010-3.c b/gcc/testsuite/gcc.target/powerpc/pr70010-3.c
new file mode 100644
index 00000000000..bca31875632
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/pr70010-3.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -mno-vsx" } */
+
+vector int c, a, b;
+
+static inline void __attribute__ ((__always_inline__, target ("no-vsx")))
+foo ()
+{
+ c = a + b;
+}
+
+int
+main ()
+{
+ foo ();
+ c = a + b;
+}
diff --git a/gcc/testsuite/gcc.target/powerpc/pr70010-4.c b/gcc/testsuite/gcc.target/powerpc/pr70010-4.c
new file mode 100644
index 00000000000..c575cff1b52
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/pr70010-4.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -mvsx" } */
+
+vector int c, a, b;
+
+static inline void __attribute__ ((__always_inline__, target ("no-vsx")))
+foo () /* { dg-error "inlining failed in call to .* target specific option mismatch" } */
+{
+ c = a + b;
+}
+
+int
+main ()
+{
+ foo (); /* { dg-message "called from here" } */
+ c = a + b;
+}
diff --git a/gcc/testsuite/gcc.target/powerpc/pr70010.c b/gcc/testsuite/gcc.target/powerpc/pr70010.c
new file mode 100644
index 00000000000..679034fae43
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/pr70010.c
@@ -0,0 +1,19 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -finline-functions -Wno-psabi -mvsx" } */
+/* { dg-final { scan-assembler {\mbl \.?vadd_no_vsx\M} } } */
+
+typedef int vec_t __attribute__((vector_size(16)));
+
+static vec_t
+__attribute__((__target__("no-vsx")))
+vadd_no_vsx (vec_t a, vec_t b)
+{
+ return a + b;
+}
+
+vec_t
+__attribute__((__target__("vsx")))
+call_vadd_no_vsx (vec_t x, vec_t y, vec_t z)
+{
+ return vadd_no_vsx (x, y) - z;
+}
diff --git a/gcc/testsuite/gcc.target/powerpc/pr91275.c b/gcc/testsuite/gcc.target/powerpc/pr91275.c
new file mode 100644
index 00000000000..cd461158af7
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/pr91275.c
@@ -0,0 +1,26 @@
+/* Test that we generate vpmsumd correctly without a swap error. */
+
+/* { dg-do run { target { p8vector_hw } } } */
+/* { dg-options "-O2 -std=gnu11" } */
+
+#include <altivec.h>
+
+int main() {
+
+ const unsigned long long r0l = 0x8e7dfceac070e3a0;
+ vector unsigned long long r0 = (vector unsigned long long) {r0l, 0}, v;
+ const vector unsigned long long pd
+ = (vector unsigned long long) {0xc2LLU << 56, 0};
+
+ v = __builtin_crypto_vpmsumd ((vector unsigned long long) {r0[0], 0}, pd);
+
+#if __LITTLE_ENDIAN__
+ if (v[0] != 0x4000000000000000 || v[1] != 0x65bd7ab605a4a8ff)
+ __builtin_abort ();
+#else
+ if (v[1] != 0x4000000000000000 || v[0] != 0x65bd7ab605a4a8ff)
+ __builtin_abort ();
+#endif
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/powerpc/pure-builtin-redundant-load.c b/gcc/testsuite/gcc.target/powerpc/pure-builtin-redundant-load.c
new file mode 100644
index 00000000000..16ab6abfc3b
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/pure-builtin-redundant-load.c
@@ -0,0 +1,47 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target powerpc_vsx_ok } */
+/* { dg-options "-O2 -fdump-tree-fre-all -mvsx" } */
+
+/* Verify we remove a redundant load that occurs both before and after
+we call a vector load builtin.
+This testcase is introduced as we updated a number of our vector load
+built-ins with the attribute of PURE instead of MEM, to indicate that
+those builtins only read from memory, versus reading from and writing
+to the same.
+This means we can identify the redundant load instructions in an earlier
+pass, and optimize them away. */
+
+#include <altivec.h>
+
+vector signed short load_data;
+
+vector signed short foo()
+{
+ vector signed short r11,r12,r13;
+ r11 = load_data;
+ r12 = vec_xl (0, &load_data[0]);
+ r13 = load_data;
+ return (r11 + r12 + r13);
+}
+
+vector signed short biz()
+{
+ vector signed short r21,r22,r23;
+ r21 = load_data;
+ r22 = vec_lvehx (0, &load_data[0]);
+ r23 = load_data;
+ return (r21 + r22 + r23);
+}
+
+vector signed short bar()
+{
+ vector signed short r31,r32,r33;
+ r31 = load_data;
+ r32 = vec_lvx (0, &load_data[0]);
+ r33 = load_data;
+ return (r31 + r32 + r33);
+}
+
+/* { dg-final { scan-tree-dump-times "Removing dead stmt r13_. = load_data;" 1 "fre1" } } */
+/* { dg-final { scan-tree-dump-times "Removing dead stmt r23_. = load_data;" 1 "fre1" } } */
+/* { dg-final { scan-tree-dump-times "Removing dead stmt r33_. = load_data;" 1 "fre1" } } */
diff --git a/gcc/testsuite/gcc.target/riscv/shift-shift-4.c b/gcc/testsuite/gcc.target/riscv/shift-shift-4.c
new file mode 100644
index 00000000000..72a45ee87ae
--- /dev/null
+++ b/gcc/testsuite/gcc.target/riscv/shift-shift-4.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-march=rv32i -mabi=ilp32 -O2" } */
+
+/* One zero-extend shift can be eliminated by modifying the constant in the
+ greater than test. Started working after modifying the splitter
+ lshrsi3_zero_extend_3+1 to use a temporary reg for the first split dest. */
+int
+sub (int i)
+{
+ i &= 0x7fffffff;
+ return i > 0x7f800000;
+}
+/* { dg-final { scan-assembler-not "srli" } } */
diff --git a/gcc/testsuite/gcc.target/riscv/shift-shift-5.c b/gcc/testsuite/gcc.target/riscv/shift-shift-5.c
new file mode 100644
index 00000000000..5b2ae89a471
--- /dev/null
+++ b/gcc/testsuite/gcc.target/riscv/shift-shift-5.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-options "-march=rv64gc -mabi=lp64d -O2" } */
+
+/* Fails if lshrsi3_zero_extend_3+1 uses a temp reg which has no REG_DEST
+ note. */
+unsigned long
+sub (long l)
+{
+ union u {
+ struct s { int a : 19; unsigned int b : 13; int x; } s;
+ long l;
+ } u;
+ u.l = l;
+ return u.s.b;
+}
+/* { dg-final { scan-assembler "srliw" } } */
diff --git a/gcc/testsuite/gcc.target/s390/s390.exp b/gcc/testsuite/gcc.target/s390/s390.exp
index 86f7e4398eb..ee94a806766 100644
--- a/gcc/testsuite/gcc.target/s390/s390.exp
+++ b/gcc/testsuite/gcc.target/s390/s390.exp
@@ -86,18 +86,22 @@ proc check_effective_target_s390_useable_hw { } {
int main (void)
{
asm (".machinemode zarch" : : );
- #if __ARCH__ >= 11
- asm ("lcbb %%r2,0(%%r15),0" : : );
+ #if __ARCH__ >= 13
+ asm ("ncrk %%r2,%%r2,%%r2" : : : "r2");
+ #elif __ARCH__ >= 12
+ asm ("agh %%r2,0(%%r15)" : : : "r2");
+ #elif __ARCH__ >= 11
+ asm ("lochiz %%r2,42" : : : "r2");
#elif __ARCH__ >= 10
- asm ("risbgn %%r2,%%r2,0,0,0" : : );
+ asm ("risbgn %%r2,%%r2,0,0,0" : : : "r2");
#elif __ARCH__ >= 9
- asm ("sgrk %%r2,%%r2,%%r2" : : );
+ asm ("sgrk %%r2,%%r2,%%r2" : : : "r2");
#elif __ARCH__ >= 8
- asm ("rosbg %%r2,%%r2,0,0,0" : : );
+ asm ("rosbg %%r2,%%r2,0,0,0" : : : "r2");
#elif __ARCH__ >= 7
- asm ("nilf %%r2,0" : : );
+ asm ("nilf %%r2,0" : : : "r2");
#elif __ARCH__ >= 6
- asm ("lay %%r2,0(%%r15)" : : );
+ asm ("lay %%r2,0(%%r15)" : : : "r2");
#elif __ARCH__ >= 5
asm ("tam" : : );
#endif
@@ -107,8 +111,8 @@ proc check_effective_target_s390_useable_hw { } {
asm ("etnd %0" : "=d" (nd));
}
#endif
- #ifdef __VX__
- asm ("vzero %%v0" : : );
+ #if defined (__VX__) && defined (__zarch__)
+ asm ("vzero %%v0" : : : "v0");
#endif
return 0;
}
diff --git a/gcc/testsuite/gcc.target/s390/sigfpe-eh.c b/gcc/testsuite/gcc.target/s390/sigfpe-eh.c
new file mode 100644
index 00000000000..52b0bf39d9e
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/sigfpe-eh.c
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+/* { dg-options "-march=z196 -O2 -fexceptions -fnon-call-exceptions" } */
+
+extern float f (void);
+extern float g (void);
+
+float h (float x, float y)
+{
+ return x < y ? f () : g ();
+}
diff --git a/gcc/testsuite/gcc.target/sparc/20161111-1.c b/gcc/testsuite/gcc.target/sparc/20161111-1.c
index eda8b0a9f12..8195fec8990 100644
--- a/gcc/testsuite/gcc.target/sparc/20161111-1.c
+++ b/gcc/testsuite/gcc.target/sparc/20161111-1.c
@@ -14,4 +14,4 @@ unsigned char ee_isdigit2(unsigned int i)
return retval;
}
-/* { dg-final { scan-assembler-not "and\t%" } } */
+/* { dg-final { scan-assembler-not "and\t%" { xfail *-*-* } } } */
diff --git a/gcc/testsuite/gcc.target/sparc/overflow-1.c b/gcc/testsuite/gcc.target/sparc/overflow-1.c
index e3fa0d04573..75f69ba4f9d 100644
--- a/gcc/testsuite/gcc.target/sparc/overflow-1.c
+++ b/gcc/testsuite/gcc.target/sparc/overflow-1.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O -mcpu=v8" } */
+/* { dg-options "-O -fno-pie -mcpu=v8" } */
/* { dg-require-effective-target ilp32 } */
#include <stdbool.h>
diff --git a/gcc/testsuite/gcc.target/sparc/overflow-2.c b/gcc/testsuite/gcc.target/sparc/overflow-2.c
index 9e42bd214de..feb3f194828 100644
--- a/gcc/testsuite/gcc.target/sparc/overflow-2.c
+++ b/gcc/testsuite/gcc.target/sparc/overflow-2.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O -mcpu=v8" } */
+/* { dg-options "-O -fno-pie -mcpu=v8" } */
/* { dg-require-effective-target ilp32 } */
#include <stdbool.h>
diff --git a/gcc/testsuite/gcc.target/sparc/overflow-3.c b/gcc/testsuite/gcc.target/sparc/overflow-3.c
index 86dddfb09e6..52d6ab2b688 100644
--- a/gcc/testsuite/gcc.target/sparc/overflow-3.c
+++ b/gcc/testsuite/gcc.target/sparc/overflow-3.c
@@ -1,6 +1,6 @@
/* { dg-do compile } */
/* { dg-require-effective-target lp64 } */
-/* { dg-options "-O" } */
+/* { dg-options "-O -fno-pie" } */
#include <stdbool.h>
#include <stdint.h>
diff --git a/gcc/testsuite/gcc.target/sparc/overflow-4.c b/gcc/testsuite/gcc.target/sparc/overflow-4.c
index 019feee335c..c6121b958c3 100644
--- a/gcc/testsuite/gcc.target/sparc/overflow-4.c
+++ b/gcc/testsuite/gcc.target/sparc/overflow-4.c
@@ -1,6 +1,6 @@
/* { dg-do compile } */
/* { dg-require-effective-target lp64 } */
-/* { dg-options "-O -mno-vis3 -mno-vis4" } */
+/* { dg-options "-O -fno-pie -mno-vis3 -mno-vis4" } */
#include <stdbool.h>
#include <stdint.h>
diff --git a/gcc/testsuite/gcc.target/sparc/overflow-5.c b/gcc/testsuite/gcc.target/sparc/overflow-5.c
index 67d4ac38095..f00283f6e7b 100644
--- a/gcc/testsuite/gcc.target/sparc/overflow-5.c
+++ b/gcc/testsuite/gcc.target/sparc/overflow-5.c
@@ -1,6 +1,6 @@
/* { dg-do compile } */
/* { dg-require-effective-target lp64 } */
-/* { dg-options "-O -mvis3" } */
+/* { dg-options "-O -fno-pie -mvis3" } */
#include <stdbool.h>
#include <stdint.h>
diff --git a/gcc/testsuite/gfortran.dg/ISO_Fortran_binding_1.c b/gcc/testsuite/gfortran.dg/ISO_Fortran_binding_1.c
index a6353c7cca6..a5714593c52 100644
--- a/gcc/testsuite/gfortran.dg/ISO_Fortran_binding_1.c
+++ b/gcc/testsuite/gfortran.dg/ISO_Fortran_binding_1.c
@@ -1,6 +1,7 @@
/* Test F2008 18.5: ISO_Fortran_binding.h functions. */
#include "../../../libgfortran/ISO_Fortran_binding.h"
+#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <complex.h>
@@ -33,13 +34,34 @@ int elemental_mult_c(CFI_cdesc_t * a_desc, CFI_cdesc_t * b_desc,
|| c_desc->rank != 2)
return err;
- for (idx[0] = 0; idx[0] < a_desc->dim[0].extent; idx[0]++)
- for (idx[1] = 0; idx[1] < a_desc->dim[1].extent; idx[1]++)
- {
- res_addr = CFI_address (a_desc, idx);
- *res_addr = *(int*)CFI_address (b_desc, idx)
- * *(int*)CFI_address (c_desc, idx);
- }
+ if (a_desc->attribute == CFI_attribute_other)
+ {
+ assert (a_desc->dim[0].lower_bound == 0);
+ assert (a_desc->dim[1].lower_bound == 0);
+ for (idx[0] = 0; idx[0] < a_desc->dim[0].extent; idx[0]++)
+ for (idx[1] = 0; idx[1] < a_desc->dim[1].extent; idx[1]++)
+ {
+ res_addr = CFI_address (a_desc, idx);
+ *res_addr = *(int*)CFI_address (b_desc, idx)
+ * *(int*)CFI_address (c_desc, idx);
+ }
+ }
+ else
+ {
+ assert (a_desc->attribute == CFI_attribute_allocatable
+ || a_desc->attribute == CFI_attribute_pointer);
+ for (idx[0] = a_desc->dim[0].lower_bound;
+ idx[0] < a_desc->dim[0].extent + a_desc->dim[0].lower_bound;
+ idx[0]++)
+ for (idx[1] = a_desc->dim[1].lower_bound;
+ idx[1] < a_desc->dim[1].extent + a_desc->dim[1].lower_bound;
+ idx[1]++)
+ {
+ res_addr = CFI_address (a_desc, idx);
+ *res_addr = *(int*)CFI_address (b_desc, idx)
+ * *(int*)CFI_address (c_desc, idx);
+ }
+ }
return 0;
}
@@ -57,15 +79,16 @@ int allocate_c(CFI_cdesc_t * da, CFI_index_t lower[], CFI_index_t upper[])
CFI_index_t idx[2];
int *res_addr;
+ if (da->attribute == CFI_attribute_other) return err;
if (CFI_allocate(da, lower, upper, 0)) return err;
+ assert (da->dim[0].lower_bound == lower[0]);
+ assert (da->dim[1].lower_bound == lower[1]);
-
- for (idx[0] = 0; idx[0] < da->dim[0].extent; idx[0]++)
- for (idx[1] = 0; idx[1] < da->dim[1].extent; idx[1]++)
+ for (idx[0] = lower[0]; idx[0] < da->dim[0].extent + lower[0]; idx[0]++)
+ for (idx[1] = lower[1]; idx[1] < da->dim[1].extent + lower[1]; idx[1]++)
{
res_addr = CFI_address (da, idx);
- *res_addr = (int)((idx[0] + da->dim[0].lower_bound)
- * (idx[1] + da->dim[1].lower_bound));
+ *res_addr = (int)(idx[0] * idx[1]);
}
return 0;
@@ -86,6 +109,7 @@ int establish_c(CFI_cdesc_t * desc)
CFI_attribute_pointer,
CFI_type_struct,
sizeof(t), 1, extent);
+ assert (desc->dim[0].lower_bound == 0);
for (idx[0] = 0; idx[0] < extent[0]; idx[0]++)
{
res_addr = (t*)CFI_address (desc, idx);
@@ -118,10 +142,11 @@ float section_c(int *std_case, CFI_cdesc_t * source, int *low, int *str)
CFI_type_float, 0, 1, NULL);
if (ind) return -1.0;
ind = CFI_section((CFI_cdesc_t *)&section, source, lower, NULL, strides);
+ assert (section.dim[0].lower_bound == lower[0]);
if (ind) return -2.0;
/* Sum over the section */
- for (idx[0] = 0; idx[0] < section.dim[0].extent; idx[0]++)
+ for (idx[0] = lower[0]; idx[0] < section.dim[0].extent + lower[0]; idx[0]++)
ans += *(float*)CFI_address ((CFI_cdesc_t*)&section, idx);
return ans;
}
@@ -138,10 +163,12 @@ float section_c(int *std_case, CFI_cdesc_t * source, int *low, int *str)
if (ind) return -1.0;
ind = CFI_section((CFI_cdesc_t *)&section, source,
lower, upper, strides);
+ assert (section.rank == 1);
+ assert (section.dim[0].lower_bound == lower[0]);
if (ind) return -2.0;
/* Sum over the section */
- for (idx[0] = 0; idx[0] < section.dim[0].extent; idx[0]++)
+ for (idx[0] = lower[0]; idx[0] < section.dim[0].extent + lower[0]; idx[0]++)
ans += *(float*)CFI_address ((CFI_cdesc_t*)&section, idx);
return ans;
}
@@ -166,6 +193,8 @@ double select_part_c (CFI_cdesc_t * source)
CFI_type_double_Complex, sizeof(double _Complex),
2, extent);
(void)CFI_select_part(comp_cdesc, source, offsetof(t,y), 0);
+ assert (comp_cdesc->dim[0].lower_bound == 0);
+ assert (comp_cdesc->dim[1].lower_bound == 0);
/* Sum over comp_cdesc[4,:] */
size = comp_cdesc->dim[1].extent;
diff --git a/gcc/testsuite/gfortran.dg/ISO_Fortran_binding_13.c b/gcc/testsuite/gfortran.dg/ISO_Fortran_binding_13.c
new file mode 100644
index 00000000000..1ac9fc89eb1
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/ISO_Fortran_binding_13.c
@@ -0,0 +1,12 @@
+/* Test the fix for PR91926. */
+
+/* Contributed by José Rui Faustino de Sousa <jrfsousa@hotmail.com> */
+
+#include <stdlib.h>
+
+int ifb_echo(void*);
+
+int ifb_echo(void *this)
+{
+ return this == NULL ? 1 : 2;
+}
diff --git a/gcc/testsuite/gfortran.dg/ISO_Fortran_binding_13.f90 b/gcc/testsuite/gfortran.dg/ISO_Fortran_binding_13.f90
new file mode 100644
index 00000000000..132a97cd4c4
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/ISO_Fortran_binding_13.f90
@@ -0,0 +1,39 @@
+! { dg-do run { target c99_runtime } }
+! { dg-additional-sources ISO_Fortran_binding_13.c }
+!
+! Test the fix for PR91926. The additional source is the main program.
+!
+! Contributed by José Rui Faustino de Sousa <jrfsousa@hotmail.com>
+!
+program ifb_p
+
+ implicit none
+
+ integer :: i = 42
+
+ interface
+ integer function ifb_echo_aux(this) bind(c, name="ifb_echo")
+ implicit none
+ type(*), dimension(..), & ! removing assumed rank solves segmentation fault
+ optional, intent(in) :: this
+ end function ifb_echo_aux
+ end interface
+
+ if (ifb_echo_aux() .ne. 1) STOP 1 ! worked
+ if (ifb_echo() .ne. 1) stop 2 ! segmentation fault
+ if (ifb_echo_aux(i) .ne. 2) stop 3 ! worked
+ if (ifb_echo(i) .ne. 2) stop 4 ! worked
+
+ stop
+
+contains
+
+ integer function ifb_echo(this)
+ type(*), dimension(..), &
+ optional, intent(in) :: this
+
+ ifb_echo = ifb_echo_aux(this)
+ return
+ end function ifb_echo
+
+end program ifb_p
diff --git a/gcc/testsuite/gfortran.dg/ISO_Fortran_binding_14.f90 b/gcc/testsuite/gfortran.dg/ISO_Fortran_binding_14.f90
new file mode 100644
index 00000000000..388c5438252
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/ISO_Fortran_binding_14.f90
@@ -0,0 +1,41 @@
+! { dg-do run }
+!
+! Correct an error in the eveluation of the CFI descriptor attribute for
+! the case where the bind_C formal argument is not an assumed shape array
+! and not allocatable or pointer.
+!
+! Contributed by Gilles Gouaillardet <gilles@rist.or.jp>
+!
+MODULE FOO
+INTERFACE
+SUBROUTINE dummy(buf) BIND(C, name="sync")
+type(*), dimension(..) :: buf
+END SUBROUTINE
+END INTERFACE
+END MODULE
+
+PROGRAM main
+ USE FOO
+ IMPLICIT NONE
+ integer(8) :: before, after
+
+ INTEGER, parameter :: n = 1
+
+ INTEGER, ALLOCATABLE :: buf(:)
+ INTEGER :: buf2(n)
+ INTEGER :: i
+
+ ALLOCATE(buf(n))
+ before = LOC(buf(1))
+ CALL dummy (buf)
+ after = LOC(buf(1))
+
+ if (before .NE. after) stop 1
+
+ before = LOC(buf2(1))
+ CALL dummy (buf)
+ after = LOC(buf2(1))
+
+ if (before .NE. after) stop 2
+
+END PROGRAM
diff --git a/gcc/testsuite/gfortran.dg/ISO_Fortran_binding_17.c b/gcc/testsuite/gfortran.dg/ISO_Fortran_binding_17.c
new file mode 100644
index 00000000000..14dfcc90c4e
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/ISO_Fortran_binding_17.c
@@ -0,0 +1,25 @@
+/* PR fortran/92470 - to be used with ISO_Fortran_binding_17.f90 */
+
+#include <stdio.h>
+#include <assert.h>
+#include "../../../libgfortran/ISO_Fortran_binding.h"
+
+void Csub(const CFI_cdesc_t *, size_t, CFI_index_t invalid);
+
+void Csub(const CFI_cdesc_t * dv, size_t locd, CFI_index_t invalid) {
+
+ CFI_index_t lb[1];
+ lb[0] = dv->dim[0].lower_bound;
+ size_t ld = (size_t)CFI_address(dv, lb);
+
+ if (ld != locd)
+ printf ("In C function: CFI_address of dv = %I64x\n", ld);
+ assert( ld == locd );
+
+ lb[0] = invalid;
+ /* Shall return NULL and produce stderr diagnostic with -fcheck=array. */
+ ld = (size_t)CFI_address(dv, lb);
+ assert (ld == 0);
+
+ return;
+}
diff --git a/gcc/testsuite/gfortran.dg/ISO_Fortran_binding_17.f90 b/gcc/testsuite/gfortran.dg/ISO_Fortran_binding_17.f90
new file mode 100644
index 00000000000..fa341a7f3d4
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/ISO_Fortran_binding_17.f90
@@ -0,0 +1,77 @@
+! { dg-do run }
+! { dg-additional-sources ISO_Fortran_binding_17.c }
+! { dg-options "-fcheck=all" }
+! { dg-warning "command line option '-fcheck=all' is valid for Fortran but not for C" "" { target *-*-* } 0 }
+!
+! PR fortran/92470
+!
+! https://github.com/j3-fortran/fortran_proposals/issues/57#issuecomment-552680503
+!
+! Unit Test #: Test-1.F2018-2.7.5
+! Author : FortranFan
+! Reference : The New Features of Fortran 2018, John Reid, August 2, 2018
+! ISO/IEC JTC1/SC22/WG5 N2161
+! Description:
+! Test item 2.7.5 Fortran subscripting
+! void *CFI_address(const CFI_cdesc_t *dv, const CFI_index_t subscripts[]);
+! that returns the C address of a scalar or of an element of an array using
+! Fortran sub-scripting.
+!
+ use, intrinsic :: iso_c_binding, only: c_int, c_size_t, c_loc
+ implicit none
+
+ integer, parameter :: LB_A = -2
+ integer, parameter :: UB_A = 1
+ character(len=*), parameter :: fmtg = "(*(g0,1x))"
+ character(len=*), parameter :: fmth = "(g0,1x,z0)"
+
+ blk1: block
+ interface
+ subroutine Csub(a, loc_a_1, invalid_idx) bind(C, name="Csub")
+ import :: c_size_t
+ type(*), intent(in) :: a(:)
+ integer(c_size_t), intent(in), value :: loc_a_1, invalid_idx
+ end subroutine
+ end interface
+
+ integer(c_int), target :: a( LB_A:UB_A )
+ integer(c_size_t) :: loc_a
+
+ print fmtg, "Block 1"
+
+ loc_a = transfer( c_loc(a(lbound(a,dim=1))), mold=loc_a)
+ print fmth, "Address of a: ", loc_a
+
+ call Csub(a, loc_a, -1_c_size_t) ! LB starts at 0
+ call Csub(a, loc_a, 5_c_size_t) ! 4 elements + 1
+ print *
+ end block blk1
+
+ blk2: block
+ interface
+ subroutine Csub(a, loc_a_1, invalid_idx) bind(C, name="Csub")
+ import :: c_int, c_size_t
+ integer(kind=c_int), allocatable, intent(in) :: a(:)
+ integer(c_size_t), intent(in), value :: loc_a_1, invalid_idx
+ end subroutine
+ end interface
+
+ integer(c_int), allocatable, target :: a(:)
+ integer(c_size_t) :: loc_a
+
+ print fmtg, "Block 2"
+
+ allocate( a( LB_A:UB_A ) )
+ loc_a = transfer( c_loc(a(lbound(a,dim=1))), mold=loc_a )
+ print fmth, "Address of a: ", loc_a
+
+ call Csub(a, loc_a, LB_A-1_c_size_t)
+ call Csub(a, loc_a, UB_A+1_c_size_t)
+ print *
+ end block blk2
+end
+
+! { dg-output "CFI_address: subscripts\\\[0\\\] is out of bounds. For dimension = 0, subscripts = -1, lower_bound = 0, upper bound = 4, extend = 4(\n|\r\n|\r)" }
+! { dg-output "CFI_address: subscripts\\\[0\\\] is out of bounds. For dimension = 0, subscripts = 5, lower_bound = 0, upper bound = 4, extend = 4(\n|\r\n|\r).*" }
+! { dg-output "CFI_address: subscripts\\\[0\\\] is out of bounds. For dimension = 0, subscripts = -3, lower_bound = -2, upper bound = 6, extend = 4(\n|\r\n|\r)" }
+! { dg-output "CFI_address: subscripts\\\[0\\\] is out of bounds. For dimension = 0, subscripts = 2, lower_bound = -2, upper bound = 6, extend = 4(\n|\r\n|\r)" }
diff --git a/gcc/testsuite/gfortran.dg/allocated_3.f90 b/gcc/testsuite/gfortran.dg/allocated_3.f90
new file mode 100644
index 00000000000..66748d6142f
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/allocated_3.f90
@@ -0,0 +1,6 @@
+! { dg-do compile }
+! PR fortran/91551
+! Contributed by Gerhard Steinmetz
+program p
+ if (allocated()) stop 1 ! { dg-error "requires an array or scalar allocatable" }
+end
diff --git a/gcc/testsuite/gfortran.dg/associate_49.f90 b/gcc/testsuite/gfortran.dg/associate_49.f90
new file mode 100644
index 00000000000..1b205950556
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/associate_49.f90
@@ -0,0 +1,34 @@
+! { dg-do run }
+!
+! Test the fix for PR91588, in which the declaration of 'a' caused
+! an ICE.
+!
+! Contributed by Gerhardt Steinmetz <gscfq@t-online.de>
+!
+program p
+ character(4), parameter :: parm = '7890'
+ associate (z => '1234')
+ block
+ integer(len(z)) :: a
+ if (kind(a) .ne. 4) stop 1
+ end block
+ end associate
+ associate (z => '123')
+ block
+ integer(len(z)+1) :: a
+ if (kind(a) .ne. 4) stop 2
+ end block
+ end associate
+ associate (z => 1_8)
+ block
+ integer(kind(z)) :: a
+ if (kind(a) .ne. 8) stop 3
+ end block
+ end associate
+ associate (z => parm)
+ block
+ integer(len(z)) :: a
+ if (kind(a) .ne. 4) stop 4
+ end block
+ end associate
+end
diff --git a/gcc/testsuite/gfortran.dg/bind-c-intent-out.f90 b/gcc/testsuite/gfortran.dg/bind-c-intent-out.f90
new file mode 100644
index 00000000000..39822c0753a
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/bind-c-intent-out.f90
@@ -0,0 +1,42 @@
+! { dg-do compile }
+! { dg-options "-fdump-tree-original" }
+!
+! PR fortran/91863
+!
+! Contributed by G. Steinmetz
+!
+
+subroutine sub(x) bind(c)
+ implicit none (type, external)
+ integer, allocatable, intent(out) :: x(:)
+
+ allocate(x(3:5))
+ x(:) = [1, 2, 3]
+end subroutine sub
+
+
+program p
+ implicit none (type, external)
+ interface
+ subroutine sub(x) bind(c)
+ integer, allocatable, intent(out) :: x(:)
+ end
+ end interface
+ integer, allocatable :: a(:)
+
+ call sub(a)
+ if (.not.allocated(a)) stop 1
+ if (any(shape(a) /= [3])) stop 2
+ if (lbound(a,1) /= 3 .or. ubound(a,1) /= 5) stop 3
+ if (any(a /= [1, 2, 3])) stop 4
+end program p
+
+! "cfi" only appears in context of "a" -> bind-C descriptor
+! the intent(out) implies freeing in the callee (!), hence the "free"
+! It is the only 'free' as 'a' is part of the main program and, hence, implicitly has the SAVE attribute.
+! The 'cfi = 0' appears before the call due to the deallocate and when preparing the C descriptor
+! As cfi (i.e. the descriptor itself) is allocated in libgomp, it has to be freed after the call.
+
+! { dg-final { scan-tree-dump-times "__builtin_free" 2 "original" } }
+! { dg-final { scan-tree-dump-times "__builtin_free \\(cfi\\.\[0-9\]+\\);" 2 "original" } }
+! { dg-final { scan-tree-dump-times "cfi\\.\[0-9\]+ = 0B;" 2 "original" } }
diff --git a/gcc/testsuite/gfortran.dg/bind_c_array_params_3.f90 b/gcc/testsuite/gfortran.dg/bind_c_array_params_3.f90
new file mode 100644
index 00000000000..d5bad7d03f2
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/bind_c_array_params_3.f90
@@ -0,0 +1,39 @@
+! { dg-do run }
+! { dg-additional-sources bind_c_array_params_3_aux.c }
+!
+! PR fortran/92284
+!
+! Contributed by José Rui Faustino de Sousa
+!
+program arr_p
+ use, intrinsic :: iso_c_binding, only: c_int
+ implicit none (type, external)
+
+ integer(kind=c_int), pointer :: arr(:)
+ integer :: i
+
+ nullify(arr)
+ call arr_set(arr)
+
+ if (.not.associated(arr)) stop 1
+ if (lbound(arr,dim=1) /= 1) stop 2
+ if (ubound(arr,dim=1) /= 9) stop 3
+ if (any (arr /= [(i, i=0,8)])) stop 4
+ deallocate(arr)
+
+contains
+
+ subroutine arr_set(this) !bind(c)
+ integer(kind=c_int), pointer, intent(out) :: this(:)
+
+ interface
+ subroutine arr_set_c(this) bind(c)
+ use, intrinsic :: iso_c_binding, only: c_int
+ implicit none
+ integer(kind=c_int), pointer, intent(out) :: this(:)
+ end subroutine arr_set_c
+ end interface
+
+ call arr_set_c(this)
+ end subroutine arr_set
+end program arr_p
diff --git a/gcc/testsuite/gfortran.dg/bind_c_array_params_3_aux.c b/gcc/testsuite/gfortran.dg/bind_c_array_params_3_aux.c
new file mode 100644
index 00000000000..07d1a033c5a
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/bind_c_array_params_3_aux.c
@@ -0,0 +1,26 @@
+/* Used by bind_c_array_params_3.f90. */
+/* PR fortran/92284. */
+
+#include <assert.h>
+#include <errno.h>
+#include <stdio.h>
+
+#include "../../../libgfortran/ISO_Fortran_binding.h"
+
+void arr_set_c(CFI_cdesc_t*);
+
+void arr_set_c(CFI_cdesc_t *arr){
+ int i, stat, *auxp = NULL;
+ CFI_index_t lb[] = {1};
+ CFI_index_t ub[] = {9};
+
+ assert(arr);
+ assert(arr->rank==1);
+ assert(!arr->base_addr);
+ stat = CFI_allocate(arr, lb, ub, sizeof(int));
+ assert(stat==CFI_SUCCESS);
+ auxp = (int*)arr->base_addr;
+ assert(auxp);
+ for(i=0; i<ub[0]-lb[0]+1; i++) auxp[i]=i;
+ return;
+}
diff --git a/gcc/testsuite/gfortran.dg/char_result_19.f90 b/gcc/testsuite/gfortran.dg/char_result_19.f90
new file mode 100644
index 00000000000..e66ebdcda53
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/char_result_19.f90
@@ -0,0 +1,24 @@
+! { dg-do preprocess }
+! { dg-additional-options "-cpp" }
+!
+! Test the fix for PR86248
+!
+! Contributed by Bill Long <longb@cray.com>
+!
+program test
+ use test_module
+ implicit none
+ integer :: i
+ character(:), allocatable :: chr
+ do i = 0, 2
+ chr = func_1 (i)
+ select case (i)
+ case (0)
+ if (chr .ne. 'el0') stop i
+ case (1)
+ if (chr .ne. 'el11') stop i
+ case (2)
+ if (chr .ne. 'el2') stop i
+ end select
+ end do
+end program test
diff --git a/gcc/testsuite/gfortran.dg/char_result_mod_19.f90 b/gcc/testsuite/gfortran.dg/char_result_mod_19.f90
new file mode 100644
index 00000000000..a2b5e94f1b6
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/char_result_mod_19.f90
@@ -0,0 +1,18 @@
+! { dg-do run }
+! { dg-additional-sources char_result_19.f90 }
+!
+! Module for char_result_19.f90
+! Tests fix for PR86248
+!
+module test_module
+ implicit none
+ public :: func_1
+ private
+ character(len=*),dimension(0:2),parameter :: darray = (/"el0 ","el11","el2 "/)
+contains
+ function func_1 (func_1_input) result(f)
+ integer, intent(in) :: func_1_input
+ character(len = len_trim (darray(func_1_input))) :: f
+ f = darray(func_1_input)
+ end function func_1
+end module test_module
diff --git a/gcc/testsuite/gfortran.dg/class_71.f90 b/gcc/testsuite/gfortran.dg/class_71.f90
new file mode 100644
index 00000000000..bc0ffcd2305
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/class_71.f90
@@ -0,0 +1,13 @@
+! { dg-do compile }
+!
+! PR fortran/91586
+!
+! Contributed by G. Steinmetz
+!
+program p
+ type t
+ class(*), allocatable :: a
+ end type
+ class(t) :: x, y ! { dg-error "must be dummy, allocatable or pointer" }
+ y = x ! { dg-error "Nonallocatable variable must not be polymorphic in intrinsic assignment" }
+end
diff --git a/gcc/testsuite/gfortran.dg/dec_type_print_3.f90 b/gcc/testsuite/gfortran.dg/dec_type_print_3.f90
index e5b455eea26..6836c257e14 100644
--- a/gcc/testsuite/gfortran.dg/dec_type_print_3.f90
+++ b/gcc/testsuite/gfortran.dg/dec_type_print_3.f90
@@ -8,9 +8,9 @@
include 'dec_type_print.f90'
-! { dg-error "Invalid character in name" "" { target *-*-* } 52 }
+! { dg-error "Mangled derived type definition" "" { target *-*-* } 52 }
! { dg-error "Invalid character in name" "" { target *-*-* } 53 }
-! { dg-error "Invalid character in name" "" { target *-*-* } 54 }
+! { dg-error "Mangled derived type definition" "" { target *-*-* } 54 }
! { dg-error "Invalid character in name" "" { target *-*-* } 55 }
! { dg-error "Invalid character in name" "" { target *-*-* } 56 }
! { dg-error "Invalid character in name" "" { target *-*-* } 57 }
diff --git a/gcc/testsuite/gfortran.dg/directive_unroll_5.f90 b/gcc/testsuite/gfortran.dg/directive_unroll_5.f90
index b88b4b2c380..33f2fda537f 100644
--- a/gcc/testsuite/gfortran.dg/directive_unroll_5.f90
+++ b/gcc/testsuite/gfortran.dg/directive_unroll_5.f90
@@ -31,7 +31,7 @@ subroutine wrong3(a, b, n)
integer :: a(n), b(n)
integer (kind=4) :: i
!GCC$ unroll 8
- write (*,*) "wrong"! { dg-error "directive does not commence a loop" }
+ write (*,*) "wrong"! { dg-error "directive not at the start of a loop" }
DO i=n, 1, -1
call dummy2(a(i), b(i), i)
ENDDO
diff --git a/gcc/testsuite/gfortran.dg/do_subscript_6.f90 b/gcc/testsuite/gfortran.dg/do_subscript_6.f90
new file mode 100644
index 00000000000..d78b9d39056
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/do_subscript_6.f90
@@ -0,0 +1,11 @@
+! { dg-do compile }
+! { dg-options "-std=legacy" }
+! PR 91550 - this used to cause an ICE
+! Test case by Gerhard Steinmetz
+program p
+ real :: a(3)
+ integer :: i
+ do i = 1, 3, .1 ! { dg-error "cannot be zero" }
+ a(i) = i
+ end do
+end
diff --git a/gcc/testsuite/gfortran.dg/function_kinds_5.f90 b/gcc/testsuite/gfortran.dg/function_kinds_5.f90
index e48484ec30d..106431fe206 100644
--- a/gcc/testsuite/gfortran.dg/function_kinds_5.f90
+++ b/gcc/testsuite/gfortran.dg/function_kinds_5.f90
@@ -8,3 +8,4 @@
real (bad_kind(0d0)) function foo () ! { dg-error "must be an intrinsic function" }
foo = real (kind (foo))
end function
+! { dg-prune-output "Bad kind expression for function" }
diff --git a/gcc/testsuite/gfortran.dg/gomp/pr87752.f90 b/gcc/testsuite/gfortran.dg/gomp/pr87752.f90
new file mode 100644
index 00000000000..072de218253
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/gomp/pr87752.f90
@@ -0,0 +1,12 @@
+! PR fortran/87752
+! { dg-do compile }
+! { dg-additional-options "-Ofast" }
+
+subroutine foo (n, u, v)
+ integer :: n
+ real, pointer :: u(:), v(:)
+ !$omp parallel do simd
+ do i = 1, n
+ u(:) = v(:)
+ end do
+end
diff --git a/gcc/testsuite/gfortran.dg/matmul_blas_2.f90 b/gcc/testsuite/gfortran.dg/matmul_blas_2.f90
new file mode 100644
index 00000000000..237f4a10d89
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/matmul_blas_2.f90
@@ -0,0 +1,25 @@
+! { dg-do compile }
+! { dg-options "-O3 -fdump-tree-original -fexternal-blas" }
+! PR fortran/92321 - this used to cause an ICE. Original test case
+! by Nathan Wukie.
+
+module mod_badmatmul
+ implicit none
+contains
+
+ subroutine test(c)
+ real, intent(inout) :: c(3,3)
+ real :: a(3,3), b(3,3)
+ c = matmul(a, b)
+ end subroutine test
+
+end module mod_badmatmul
+
+program main
+ use mod_badmatmul, only: test
+ implicit none
+
+ real :: a(3,3)
+ call test(a)
+
+end program main
diff --git a/gcc/testsuite/gfortran.dg/pdt_4.f03 b/gcc/testsuite/gfortran.dg/pdt_4.f03
index 0bb58f91c67..c1af65a5248 100644
--- a/gcc/testsuite/gfortran.dg/pdt_4.f03
+++ b/gcc/testsuite/gfortran.dg/pdt_4.f03
@@ -97,9 +97,9 @@ contains
type (mytype(4, *)) :: arg ! OK
end subroutine
subroutine bar(arg) ! { dg-error "is neither allocatable nor a pointer" }
- type (thytype(8, :, 4) :: arg
+ type (thytype(8, :, 4)) :: arg
end subroutine
subroutine foobar(arg) ! OK
- type (thytype(8, *, 4) :: arg
+ type (thytype(8, *, 4)) :: arg
end subroutine
end
diff --git a/gcc/testsuite/gfortran.dg/pr47054_1.f90 b/gcc/testsuite/gfortran.dg/pr47054_1.f90
new file mode 100644
index 00000000000..3665edbd72b
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr47054_1.f90
@@ -0,0 +1,15 @@
+! { dg-do compile }
+! { dg-options "-fcray-pointer" }
+! PR fortran/47054
+subroutine host_sub
+ implicit none
+ real xg
+ pointer (paxg, xg)
+ call internal_sub
+ contains
+ subroutine internal_sub
+ implicit none
+ real xg
+ pointer (paxg, xg)
+ end subroutine internal_sub
+end subroutine host_sub
diff --git a/gcc/testsuite/gfortran.dg/pr47054_2.f90 b/gcc/testsuite/gfortran.dg/pr47054_2.f90
new file mode 100644
index 00000000000..3b7c4aaf815
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr47054_2.f90
@@ -0,0 +1,41 @@
+! { dg-do compile }
+! { dg-options "-fcray-pointer" }
+! PR fortran/47054
+! Code contributed by Deji Akingunola <deji_aking at yahoo dot ca>
+subroutine host_sub(F_su,F_nk)
+ implicit none
+
+ integer :: F_nk
+ real,dimension(F_nk) :: F_su
+ integer G_ni, G_nj
+ real*8 G_xg_8, G_yg_8
+ pointer (paxg_8, G_xg_8(G_ni))
+ pointer (payg_8, G_yg_8(G_nj))
+ common / G_p / paxg_8,payg_8
+ common / G / G_ni, G_nj
+
+ call internal_sub(F_su,F_nk)
+ return
+contains
+
+ subroutine internal_sub(F_su,F_nk)
+ implicit none
+ integer G_ni, G_nj
+ real*8 G_xg_8, G_yg_8
+ pointer (paxg_8, G_xg_8(G_ni))
+ pointer (payg_8, G_yg_8(G_nj))
+ common / G_p / paxg_8,payg_8
+ common / G / G_ni, G_nj
+
+ integer :: F_nk
+ real,dimension(F_nk) :: F_su
+ integer k,k2
+
+ k2 = 0
+ do k = 1, F_nk, 2
+ k2 = k2+1
+ F_su(k) = F_su(k) + 1.0
+ enddo
+ return
+ end subroutine internal_sub
+end subroutine host_sub
diff --git a/gcc/testsuite/gfortran.dg/pr69455_1.f90 b/gcc/testsuite/gfortran.dg/pr69455_1.f90
new file mode 100644
index 00000000000..fe62e5c1b0b
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr69455_1.f90
@@ -0,0 +1,14 @@
+! { dg-do run }
+program foo
+ block
+ use, intrinsic :: iso_c_binding, only: wp => c_float, ik => c_int
+ if (ik /= 4) stop 1
+ if (wp /= 4) stop 2
+ end block
+ block
+ use, intrinsic :: iso_c_binding, only: wp => c_double, ik => c_int64_t
+ if (ik /= 8) stop 3
+ if (wp /= 8) stop 4
+ end block
+end program foo
+
diff --git a/gcc/testsuite/gfortran.dg/pr69455_2.f90 b/gcc/testsuite/gfortran.dg/pr69455_2.f90
new file mode 100644
index 00000000000..8f9fb35021f
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr69455_2.f90
@@ -0,0 +1,13 @@
+! { dg-do run }
+program foo
+ block
+ use, intrinsic :: ISO_FORTRAN_ENV, only: wp => REAL32, ik => INT32
+ if (ik /= 4) stop 1
+ if (wp /= 4) stop 2
+ end block
+ block
+ use, intrinsic :: ISO_FORTRAN_ENV, only: wp => REAL64, ik => INT64
+ if (ik /= 8) stop 3
+ if (wp /= 8) stop 4
+ end block
+end program foo
diff --git a/gcc/testsuite/gfortran.dg/pr85543.f90 b/gcc/testsuite/gfortran.dg/pr85543.f90
index d3f83276a7f..b0faa8d5927 100644
--- a/gcc/testsuite/gfortran.dg/pr85543.f90
+++ b/gcc/testsuite/gfortran.dg/pr85543.f90
@@ -6,3 +6,4 @@ contains
real(z()) function f() ! { dg-error "in initialization expression at" }
end
end
+! { dg-prune-output "Bad kind expression for function" }
diff --git a/gcc/testsuite/gfortran.dg/pr89943_1.f90 b/gcc/testsuite/gfortran.dg/pr89943_1.f90
new file mode 100644
index 00000000000..3aa9c36d628
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr89943_1.f90
@@ -0,0 +1,31 @@
+! { dg-do compile }
+! PR fortran/89943
+! Code contributed by Alberto Luaces <aluaces at udc dot se>
+module Foo_mod
+
+ implicit none
+
+ interface
+ module subroutine runFoo4C(ndim) bind(C, name="runFoo")
+ use, intrinsic :: iso_c_binding
+ implicit none
+ integer(c_int32_t) , intent(in) :: ndim
+ end subroutine runFoo4C
+ end interface
+
+ contains
+
+end module Foo_mod
+
+submodule(Foo_mod) Foo_smod
+
+ contains
+
+ module subroutine runFoo4C(ndim) bind(C, name="runFoo")
+ use, intrinsic :: iso_c_binding
+ implicit none
+ integer(c_int32_t) , intent(in) :: ndim
+ end subroutine runFoo4C
+
+end submodule Foo_smod
+
diff --git a/gcc/testsuite/gfortran.dg/pr89943_2.f90 b/gcc/testsuite/gfortran.dg/pr89943_2.f90
new file mode 100644
index 00000000000..ac69ec3af56
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr89943_2.f90
@@ -0,0 +1,33 @@
+! { dg-do compile }
+! PR fortran/89943
+! Code contributed by Alberto Luaces <aluaces at udc dot se>
+module Foo_mod
+
+ implicit none
+
+ interface
+ module function runFoo4C(ndim) bind(C, name="runFoo")
+ use, intrinsic :: iso_c_binding
+ implicit none
+ integer runFoo4c
+ integer(c_int32_t) , intent(in) :: ndim
+ end function runFoo4C
+ end interface
+
+ contains
+
+end module Foo_mod
+
+submodule(Foo_mod) Foo_smod
+
+ contains
+
+ module function runFoo4C(ndim) bind(C, name="runFoo")
+ use, intrinsic :: iso_c_binding
+ implicit none
+ integer runFoo4c
+ integer(c_int32_t) , intent(in) :: ndim
+ end function runFoo4C
+
+end submodule Foo_smod
+
diff --git a/gcc/testsuite/gfortran.dg/pr89943_3.f90 b/gcc/testsuite/gfortran.dg/pr89943_3.f90
new file mode 100644
index 00000000000..38b723e2458
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr89943_3.f90
@@ -0,0 +1,28 @@
+! { dg-do compile }
+module Foo_mod
+
+ implicit none
+
+ interface
+ module subroutine runFoo4C(ndim) bind(C, name="runFoo")
+ use, intrinsic :: iso_c_binding
+ implicit none
+ integer(c_int32_t) , intent(in) :: ndim
+ end subroutine runFoo4C
+ end interface
+
+ contains
+
+end module Foo_mod
+
+submodule(Foo_mod) Foo_smod
+
+ contains
+
+ module subroutine runFoo4C(ndim) bind(C, name="runFu") ! { dg-error "Mismatch in BIND" }
+ use, intrinsic :: iso_c_binding ! { dg-error "Unexpected USE statement" }
+ implicit none ! { dg-error "Unexpected IMPLICIT NONE statement" }
+ integer(c_int32_t) , intent(in) :: ndim ! { dg-error "Unexpected data declaration" }
+ end subroutine runFoo4C ! { dg-error " Expecting END SUBMODULE" }
+
+end submodule Foo_smod
diff --git a/gcc/testsuite/gfortran.dg/pr89943_4.f90 b/gcc/testsuite/gfortran.dg/pr89943_4.f90
new file mode 100644
index 00000000000..8eba2eda171
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr89943_4.f90
@@ -0,0 +1,29 @@
+! { dg-do compile }
+module Foo_mod
+
+ implicit none
+
+ interface
+ module function runFoo4C(ndim) bind(C, name="runFoo")
+ use, intrinsic :: iso_c_binding
+ implicit none
+ integer runFoo4c
+ integer(c_int32_t) , intent(in) :: ndim
+ end function runFoo4C
+ end interface
+
+ contains
+
+end module Foo_mod
+
+submodule(Foo_mod) Foo_smod
+
+ contains
+
+ module function runFoo4C(ndim) bind(C, name="runFu") ! { dg-error "Mismatch in BIND" }
+ use, intrinsic :: iso_c_binding ! { dg-error "Unexpected USE statement in" }
+ implicit none ! { dg-error "Unexpected IMPLICIT NONE statement" }
+ integer(c_int32_t) , intent(in) :: ndim ! { dg-error "Unexpected data declaration" }
+ end function runFoo4C ! { dg-error "Expecting END SUBMODULE" }
+
+end submodule Foo_smod
diff --git a/gcc/testsuite/gfortran.dg/pr91496.f90 b/gcc/testsuite/gfortran.dg/pr91496.f90
new file mode 100644
index 00000000000..cb316748f0e
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr91496.f90
@@ -0,0 +1,38 @@
+! { dg-do compile }
+! { dg-options "-fdump-tree-original" }
+!
+subroutine foo (a, b, c, n)
+ implicit none
+ real a(*), b(*), c(*)
+ integer :: i, n
+ external bar
+!DIR$ unroll (4)
+!GCC$ unroll 4
+ do i = 1, n
+ a(i) = b(i) + c(i)
+ end do
+!DIR$ ivdep
+!GCC$ ivdep
+ do i = 1, n
+ a(i) = b(i) + c(i)
+ end do
+!DIR$ vector
+!GCC$ vector
+ do i = 1, n
+ a(i) = b(i) + c(i)
+ end do
+!DIR$ novector
+!GCC$ novector
+ do i = 1, n
+ a(i) = b(i) + c(i)
+ end do
+!GCC$ ivdep
+!GCC$ vector
+ do i = 1, n
+ a(i) = b(i) + c(i)
+ end do
+!DIR$ noinline
+!GCC$ noinline ! { dg-warning "Unclassifiable GCC directive" }
+ call bar (a)
+end subroutine foo
+! { dg-final { scan-tree-dump-times "ANNOTATE_EXPR" 6 "original" } }
diff --git a/gcc/testsuite/gfortran.dg/pr91552.f90 b/gcc/testsuite/gfortran.dg/pr91552.f90
new file mode 100644
index 00000000000..bb959185cf9
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr91552.f90
@@ -0,0 +1,10 @@
+! { dg-do run }
+! PR fortran/91552
+! Code contributed by Gerhard Steinmetz.
+program p
+ real :: y(3), z(4)
+ y = 2.0 * [real :: 1, [2], 3]
+ z = 2.0 * [real :: 1, [2, [4]], 3]
+ if (any(y /= [2., 4., 6.])) stop 1
+ if (any(z /= [2., 4., 8., 6.])) stop 2
+end
diff --git a/gcc/testsuite/gfortran.dg/pr91553.f90 b/gcc/testsuite/gfortran.dg/pr91553.f90
new file mode 100644
index 00000000000..2d0b018dded
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr91553.f90
@@ -0,0 +1,8 @@
+! { dg-do run }
+! Code contributed by Gerhard Steinmetz
+program p
+ complex z(1)
+ z = (1.0, 2.0) * [real :: (3.0 + 4.0)]
+ if (real(z(1)) /= 7.) stop 1
+ if (aimag(z(1)) /= 14.) stop 2
+end
diff --git a/gcc/testsuite/gfortran.dg/pr91564.f90 b/gcc/testsuite/gfortran.dg/pr91564.f90
new file mode 100644
index 00000000000..57783abe1f8
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr91564.f90
@@ -0,0 +1,16 @@
+! { dg-do compile }
+! PR fortran/91564
+! Contributed by Gerhard Steinmetz.
+program p
+ integer i, j
+ call kill (1, 2, 3) ! { dg-error "shall be an INTENT" }
+ i = 42
+ call bar(i, j)
+end
+
+subroutine bar(n, m)
+ integer, intent(in) :: n
+ integer, intent(inout) :: m
+ call kill (1, 3, n) ! { dg-error "shall be an INTENT" }
+ call kill (1, 3, m)
+end subroutine bar
diff --git a/gcc/testsuite/gfortran.dg/pr91565.f90 b/gcc/testsuite/gfortran.dg/pr91565.f90
new file mode 100644
index 00000000000..b43a57acf13
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr91565.f90
@@ -0,0 +1,17 @@
+! { dg-do compile }
+! PR fortran/91565
+! Contributed by Gerhard Steinmetz
+program p
+ integer, parameter :: a(2) = [2,2] ! { dg-error "\(1\)" }
+ print *, reshape([1,2,3,4,5,6], [2,3], order=a) ! { dg-error "not a permutation" }
+end
+
+subroutine foo
+ integer, parameter :: a(1) = 1 ! { dg-error "\(1\)" }
+ print *, reshape([1,2,3,4,5,6], [2,3], order=a) ! { dg-error "are different" }
+end
+
+subroutine bar
+ integer, parameter :: a(1,2) = 1 ! { dg-error "\(1\)" }
+ print *, reshape([1,2,3,4,5,6], [2,3], order=a) ! { dg-error "are different" }
+end
diff --git a/gcc/testsuite/gfortran.dg/pr91566.f90 b/gcc/testsuite/gfortran.dg/pr91566.f90
new file mode 100644
index 00000000000..fdb35b44199
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr91566.f90
@@ -0,0 +1,14 @@
+! { dg-do compile }
+! Code contributed by Gerhard Steinmetz
+program p
+ call q
+ call r
+end program p
+
+subroutine q
+ print *, -merge([3,4], 0, [.false.,.true.])
+end
+
+subroutine r
+ print *, 2 + merge([3,4], 0, [.false.,.true.])
+end
diff --git a/gcc/testsuite/gfortran.dg/pr91568.f b/gcc/testsuite/gfortran.dg/pr91568.f
new file mode 100644
index 00000000000..4ada559d692
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr91568.f
@@ -0,0 +1,11 @@
+! { dg-do compile }
+! { dg-options "-Ofast" }
+ subroutine h3dall(z,hvec,hder,nterms)
+ complex *16 hvec(0:1),hder(0:1)
+ complex *16 z,zinv,ztmp/1.0/
+ zinv=1.0/z
+ do i=1,nterms
+ ztmp=zinv*i
+ hder(i)=hvec(i-1)-ztmp*hvec(i)
+ enddo
+ end
diff --git a/gcc/testsuite/gfortran.dg/pr91587.f90 b/gcc/testsuite/gfortran.dg/pr91587.f90
new file mode 100644
index 00000000000..c304be116c0
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr91587.f90
@@ -0,0 +1,12 @@
+! { dg-do compile }
+! PR fortran/91587
+! Code contributed by Gerhard Steinmetz
+program p
+ backspace(err=!) ! { dg-error "Invalid value for" }
+ flush(err=!) ! { dg-error "Invalid value for" }
+ rewind(err=!) ! { dg-error "Invalid value for" }
+end
+
+subroutine bar ! An other matcher runs, and gives a different error.
+ endfile(err=!) ! { dg-error "Expecting END" }
+end
diff --git a/gcc/testsuite/gfortran.dg/pr91589.f90 b/gcc/testsuite/gfortran.dg/pr91589.f90
new file mode 100644
index 00000000000..d02cb64bfc2
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr91589.f90
@@ -0,0 +1,15 @@
+! { dg-do compile }
+!
+! Check the fix for PR91589, in which the invalid expression caused an ICE.
+! Other statements using this invalid expression cause "Unclassifiable statement at..."
+!
+! Contributed by Gerhardt Steinmetz <gscfq@t-online.de>
+!
+program p
+ type t
+ integer :: a
+ end type
+ type(t) :: x = t(1)
+ call sub (x%a%a) ! { dg-error "Syntax error in argument list" }
+end
+
diff --git a/gcc/testsuite/gfortran.dg/pr91641.f90 b/gcc/testsuite/gfortran.dg/pr91641.f90
new file mode 100644
index 00000000000..1970824a946
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr91641.f90
@@ -0,0 +1,7 @@
+! { dg-do compile }
+! PR fortran/91641
+! Code conyributed by Gerhard Steinmetz
+program p
+ real, pointer :: z(:)
+ print *, is_contiguous (null(z)) ! { dg-error "shall be an associated" }
+end
diff --git a/gcc/testsuite/gfortran.dg/pr91642.f90 b/gcc/testsuite/gfortran.dg/pr91642.f90
new file mode 100644
index 00000000000..8c41cd2dae0
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr91642.f90
@@ -0,0 +1,19 @@
+! { dg-do compile }
+! PR fortran/91642
+! Code contributed by Gerhard Steinmetz
+program p
+ integer i
+ integer :: iol
+ integer, external :: null
+ i = 0
+ inquire (iolength=iol) i, null()
+ if (iol == 4) stop 1
+end
+
+subroutine q
+ integer i
+ integer :: iol
+ i = 0
+ inquire (iolength=iol) i, null() ! { dg-error "cannot appear in INQUIRE" }
+ if (iol == 4) stop 1
+end
diff --git a/gcc/testsuite/gfortran.dg/pr91649.f90 b/gcc/testsuite/gfortran.dg/pr91649.f90
new file mode 100644
index 00000000000..0e6acb9ac8d
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr91649.f90
@@ -0,0 +1,23 @@
+! { dg-do compile }
+! PR fortran/91649
+! Code originally contributed by Gerhard Steinmetz
+subroutine p
+ logical :: back = .true.
+ integer :: x(1) = findloc([1, 2, 1], '1', back=back) ! { dg-error "must be in type conformance" }
+ print *, x
+end
+
+subroutine q
+ type t
+ end type
+ logical :: back = .false.
+ integer :: x(1) = findloc([1, 2, 1], t(), back=back) ! { dg-error "must be of intrinsic type" }
+ print *, x
+end
+
+subroutine s
+ character(4) :: c = '1234'
+ integer :: x(1) = findloc([1, 2, 1], c, back=.true.) ! { dg-error "must be in type conformance" }
+ print *, x
+end
+
diff --git a/gcc/testsuite/gfortran.dg/pr91660_1.f90 b/gcc/testsuite/gfortran.dg/pr91660_1.f90
new file mode 100644
index 00000000000..53a1a808a7b
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr91660_1.f90
@@ -0,0 +1,9 @@
+! { dg-do compile }
+! PR fortran/91660
+! Code contributed by Gerhard Steinmetz
+program p
+ type t
+ end type
+ type (t x ! { dg-error "Malformed type-spec" }
+ x = t() ! { dg-error "Cannot convert" }
+end
diff --git a/gcc/testsuite/gfortran.dg/pr91660_2.f90 b/gcc/testsuite/gfortran.dg/pr91660_2.f90
new file mode 100644
index 00000000000..0072aba1680
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr91660_2.f90
@@ -0,0 +1,9 @@
+! { dg-do compile }
+! PR fortran/91660
+program foo
+ type(doubleprecision :: x ! { dg-error "Malformed type-spec" }
+ type(double precision :: y ! { dg-error "Malformed type-spec" }
+ type(character(len=3) :: a ! { dg-error "Malformed type-spec" }
+ type(doublecomplex :: b ! { dg-error "Malformed type-spec" }
+ type(double complex :: c ! { dg-error "Malformed type-spec" }
+end program foo
diff --git a/gcc/testsuite/gfortran.dg/pr91714.f90 b/gcc/testsuite/gfortran.dg/pr91714.f90
new file mode 100644
index 00000000000..8b855d90318
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr91714.f90
@@ -0,0 +1,10 @@
+! { dg-do compile }
+! Contributed by Gerhard Steinmetz
+program p
+ typea ! { dg-error "Mangled derived type" }
+ integer b
+ end type ! { dg-error "Expecting END PROGRAM" }
+ type(a) :: c ! { dg-error "is being used before it" }
+ c = a(1)
+ print *, c
+end
diff --git a/gcc/testsuite/gfortran.dg/pr91715.f90 b/gcc/testsuite/gfortran.dg/pr91715.f90
new file mode 100644
index 00000000000..a3d9b8d1d9a
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr91715.f90
@@ -0,0 +1,5 @@
+! { dg-do compile }
+! PR fortran/91715
+! Code contributed Gerhard Steinmetz
+character(1function f() ! { dg-error "Syntax error in CHARACTER" }
+end
diff --git a/gcc/testsuite/gfortran.dg/pr91727.f90 b/gcc/testsuite/gfortran.dg/pr91727.f90
new file mode 100644
index 00000000000..54276b45d33
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr91727.f90
@@ -0,0 +1,9 @@
+! { dg-do compile }
+! Code contributed by Gerhard Steinmetz.
+program p
+ type t
+ class(*), allocatable :: a
+ end type
+ type(t) :: x
+ allocate (x%a, source=[1]) ! { dg-error "have the same rank as" }
+end
diff --git a/gcc/testsuite/gfortran.dg/pr91785.f90 b/gcc/testsuite/gfortran.dg/pr91785.f90
new file mode 100644
index 00000000000..fb3d964fc06
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr91785.f90
@@ -0,0 +1,8 @@
+! { dg-do compile }
+! PR fortran/91785
+! Code contributed by Gerhard Steinmetz
+program p
+ complex :: a(*) ! { dg-error "Assumed size array at" }
+ real :: b(2)
+ b = a%im ! { dg-error "upper bound in the last dimension" }
+end
diff --git a/gcc/testsuite/gfortran.dg/pr91801.f90 b/gcc/testsuite/gfortran.dg/pr91801.f90
new file mode 100644
index 00000000000..d2d82b88464
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr91801.f90
@@ -0,0 +1,7 @@
+! { dg-do compile }
+! PR fortran/91801
+! Code contributed by Gerhard Steinmetz
+program p
+ integer, parameter :: a(2) = [2,0] ! { dg-error "Element with a value of" }
+ print *, reshape([1,2,3,4,5,6], [2,3], order=a) ! { dg-error "for the RESHAPE intrinsic near" }
+end
diff --git a/gcc/testsuite/gfortran.dg/pr91802.f90 b/gcc/testsuite/gfortran.dg/pr91802.f90
new file mode 100644
index 00000000000..277d61aae82
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr91802.f90
@@ -0,0 +1,9 @@
+! { dg-do compile }
+! { dg-options "-fcoarray=single" }
+! Code contributed by Gerhard Steinmetz
+! PR fortran/91802
+module m
+ real :: x
+ dimension :: x(1,2,1,2,1,2,1,2)
+ codimension :: x[1,2,1,2,1,2,1,*] ! { dg-error "exceeds 15" }
+end
diff --git a/gcc/testsuite/gfortran.dg/pr91864.f90 b/gcc/testsuite/gfortran.dg/pr91864.f90
new file mode 100644
index 00000000000..a17187dcdc0
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr91864.f90
@@ -0,0 +1,22 @@
+program p
+ integer :: i
+ read (*,*) i%kind ! { dg-error "Expecting variable or io-implied-do" }
+end
+
+subroutine t
+ integer, allocatable :: x(:)
+ integer :: stat
+ allocate (x(3), stat=stat%kind) ! { dg-error "cannot be a constant" }
+end
+
+subroutine u
+ integer, allocatable :: x(:)
+ integer :: stat
+ allocate (x(3), stat%kind=stat) ! { dg-error "Unexpected constant" }
+end
+
+subroutine v
+ integer, allocatable :: x(:)
+ integer :: stat
+ deallocate (x, stat%kind=stat) ! { dg-error "Unexpected constant" }
+end
diff --git a/gcc/testsuite/gfortran.dg/pr91942.f90 b/gcc/testsuite/gfortran.dg/pr91942.f90
new file mode 100644
index 00000000000..cd237d38660
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr91942.f90
@@ -0,0 +1,10 @@
+! { dg-do compile }
+! PR fortran/91942
+! Code contributed by Gerhard Steinmetz
+program p
+ integer :: i
+ backspace (iostat=i%kind) ! { dg-error "Expecting a variable at" }
+ endfile (iostat=i%kind) ! { dg-error "Expecting END PROGRAM" }
+ flush (iostat=i%kind) ! { dg-error "Expecting a variable at" }
+ rewind (iostat=i%kind) ! { dg-error "Expecting a variable at" }
+end
diff --git a/gcc/testsuite/gfortran.dg/pr92208.f90 b/gcc/testsuite/gfortran.dg/pr92208.f90
new file mode 100644
index 00000000000..9de7f4b24b5
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr92208.f90
@@ -0,0 +1,39 @@
+! { dg-do run }
+!
+! PR fortran/92208
+!
+! Contributed by Nils Reiche
+!
+program stringtest
+ implicit none
+ integer, parameter :: noVars = 2
+
+! print*, "varNames: ", createVarnames("var",noVars)
+ call function1(noVars,createVarnames("var",noVars),"path")
+
+contains
+
+function createVarnames(string,noVars) result(stringArray)
+ implicit none
+ character(len=*), intent(in) :: string
+ integer, intent(in) :: noVars
+ character(len=len_trim(string)+6), dimension(noVars) :: stringArray
+ integer :: i
+ do i=1,noVars
+ write(stringArray(i),'(a,i0)') string, i
+ enddo
+end function createVarnames
+
+subroutine function1(noVars,varNames,path)
+ implicit none
+ integer, intent(in) :: noVars
+ character(len=*), intent(in) :: path
+ character(len=*), dimension(noVars) :: varNames
+
+ if (path /= 'path') stop 1
+ if (any(varNames /= ['var1', 'var2'])) stop 2
+ !print*, "function1-path : ", trim(path)
+ !print*, "function1-varNames: ", varNames
+end subroutine function1
+
+end program stringtest
diff --git a/gcc/testsuite/gfortran.dg/pr92277.f90 b/gcc/testsuite/gfortran.dg/pr92277.f90
new file mode 100644
index 00000000000..5121063f5f3
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr92277.f90
@@ -0,0 +1,32 @@
+! { dg-do compile }
+!
+! PR fortran/92277
+!
+! Contributed by José Rui Faustino de Sousa
+!
+module arr_m
+ implicit none
+contains
+ subroutine arr_set(this, that)
+ integer, intent(out) :: this(..)
+ integer, optional, intent(out) :: that(..)
+
+ interface
+ subroutine arr_set_c(this) bind(c)
+ use, intrinsic :: iso_c_binding, only: c_int
+ implicit none
+ integer(kind=c_int), intent(out) :: this(..)
+ end subroutine arr_set_c
+ subroutine arr_set_c_opt(this) bind(c)
+ use, intrinsic :: iso_c_binding, only: c_int
+ implicit none
+ integer(kind=c_int), optional, intent(out) :: this(..)
+ end subroutine arr_set_c_opt
+ end interface
+
+ call arr_set_c(this)
+ call arr_set_c(that)
+ call arr_set_c_opt(this)
+ call arr_set_c_opt(that)
+ end subroutine arr_set
+end module arr_m
diff --git a/gcc/testsuite/gfortran.dg/typebound_call_22.f03 b/gcc/testsuite/gfortran.dg/typebound_call_22.f03
index b9f0b712573..30f86937fe2 100644
--- a/gcc/testsuite/gfortran.dg/typebound_call_22.f03
+++ b/gcc/testsuite/gfortran.dg/typebound_call_22.f03
@@ -26,4 +26,4 @@ program test
call x%bar ()
end program
-! { dg-final { scan-tree-dump-times "base \\(\\);" 1 "optimized" } }
+! { dg-final { scan-tree-dump-times "base \\(\\);" 1 "optimized" { xfail *-*-* } } }
diff --git a/gcc/testsuite/gfortran.dg/warn_unused_dummy_argument_5.f90 b/gcc/testsuite/gfortran.dg/warn_unused_dummy_argument_5.f90
new file mode 100644
index 00000000000..fa93f1d7ff2
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/warn_unused_dummy_argument_5.f90
@@ -0,0 +1,16 @@
+! { dg-do compile }
+! { dg-additional-options "-Wunused-dummy-argument" }
+! PR 91557 - this used to generate a bogus warning
+! Test case by Gerhard Steinmetz
+program p
+ integer :: a, b
+ a = 1
+ call g
+contains
+ subroutine g
+ integer :: x, y
+ call h (x, y)
+ if ( a > 0 ) y = y - 1
+ b = y - x + 1
+ end
+end
diff --git a/gcc/testsuite/obj-c++.dg/stubify-1.mm b/gcc/testsuite/obj-c++.dg/stubify-1.mm
index c2355437afc..e8f21882de9 100644
--- a/gcc/testsuite/obj-c++.dg/stubify-1.mm
+++ b/gcc/testsuite/obj-c++.dg/stubify-1.mm
@@ -4,7 +4,7 @@
/* { dg-do compile { target *-*-darwin* } } */
/* { dg-skip-if "" { *-*-* } { "-fgnu-runtime" } { "" } } */
/* { dg-require-effective-target ilp32 } */
-/* { dg-options "-Os -mdynamic-no-pic -fno-exceptions -mmacosx-version-min=10.4" } */
+/* { dg-options "-mdynamic-no-pic -fno-exceptions -mmacosx-version-min=10.4 -msymbol-stubs" } */
typedef struct objc_object { } *id ;
int x = 41 ;
@@ -32,8 +32,8 @@ extern "C" {
}
@end
-/* { dg-final { scan-assembler-not "\(bl|call\)\[ \t\]+_objc_msgSend\n" } } */
-/* { dg-final { scan-assembler "\(bl|call\)\[ \t\]+L_objc_msgSend\\\$stub\n" } } */
-/* { dg-final { scan-assembler-not "\(bl|call\)\[ \t\]+_bogonic\n" } } */
-/* { dg-final { scan-assembler "\(bl|call\)\[ \t\]+L_bogonic\\\$stub\n" } } */
-/* { dg-final { scan-assembler-not "\\\$non_lazy_ptr" } } */
+/* { dg-final { scan-assembler-not {(bl|call)[ \t]+_objc_msgSend\n} } } */
+/* { dg-final { scan-assembler {(bl|call)[ \t]+L_objc_msgSend\$stub\n} } } */
+/* { dg-final { scan-assembler-not {(bl|call)[ \t]+_bogonic\n} } } */
+/* { dg-final { scan-assembler {(bl|call)[ \t]+L_bogonic\$stub\n} } } */
+/* { dg-final { scan-assembler-not {\$non_lazy_ptr} } } */
diff --git a/gcc/testsuite/obj-c++.dg/stubify-2.mm b/gcc/testsuite/obj-c++.dg/stubify-2.mm
index a9f66cac5d2..1863f986ce0 100644
--- a/gcc/testsuite/obj-c++.dg/stubify-2.mm
+++ b/gcc/testsuite/obj-c++.dg/stubify-2.mm
@@ -4,7 +4,7 @@
/* { dg-do compile { target *-*-darwin* } } */
/* { dg-skip-if "" { *-*-* } { "-fgnu-runtime" } { "" } } */
/* { dg-require-effective-target ilp32 } */
-/* { dg-options "-mdynamic-no-pic -fdump-rtl-jump -mmacosx-version-min=10.4" } */
+/* { dg-options "-mdynamic-no-pic -mmacosx-version-min=10.4 -msymbol-stubs" } */
typedef struct objc_object { } *id ;
int x = 41 ;
@@ -30,4 +30,9 @@ extern int bogonic (int, int, int) ;
/* Any symbol_ref of an un-stubified objc_msgSend is an error; look
for "objc_msgSend" in quotes, without the $stub suffix. */
-/* { dg-final { scan-rtl-dump-not "symbol_ref.*\"objc_msgSend\"" "jump" } } */
+
+/* { dg-final { scan-assembler-not {(bl|call)[ \t]+_objc_msgSend\n} } } */
+/* { dg-final { scan-assembler {(bl|call)[ \t]+L_objc_msgSend\$stub\n} } } */
+/* { dg-final { scan-assembler-not {(bl|call)[ \t]+_Z7bogoniciii\n} } } */
+/* { dg-final { scan-assembler {(bl|call)[ \t]+L__Z7bogoniciii\$stub\n} } } */
+/* { dg-final { scan-assembler-not {\$non_lazy_ptr} } } */
diff --git a/gcc/testsuite/objc.dg/stubify-1.m b/gcc/testsuite/objc.dg/stubify-1.m
index 91bf73a14f7..641595ccfe4 100644
--- a/gcc/testsuite/objc.dg/stubify-1.m
+++ b/gcc/testsuite/objc.dg/stubify-1.m
@@ -4,7 +4,7 @@
/* { dg-do compile { target *-*-darwin* } } */
/* { dg-skip-if "" { *-*-* } { "-fgnu-runtime" } { "" } } */
/* { dg-require-effective-target ilp32 } */
-/* { dg-options "-Os -mdynamic-no-pic -mmacosx-version-min=10.4" } */
+/* { dg-options "-Os -mdynamic-no-pic -mmacosx-version-min=10.4 -msymbol-stubs" } */
typedef struct objc_object { } *id ;
int x = 41 ;
@@ -28,8 +28,8 @@ extern int bogonic (int, int, int) ;
}
@end
-/* { dg-final { scan-assembler-not "\(bl|call\)\[ \t\]+_objc_msgSend\n" } } */
-/* { dg-final { scan-assembler "\(bl|call\)\[ \t\]+L_objc_msgSend\\\$stub\n" } } */
-/* { dg-final { scan-assembler-not "\(bl|call\)\[ \t\]+_bogonic\n" } } */
-/* { dg-final { scan-assembler "\(bl|call\)\[ \t\]+L_bogonic\\\$stub\n" } } */
-/* { dg-final { scan-assembler-not "\\\$non_lazy_ptr" } } */
+/* { dg-final { scan-assembler-not {(bl|call)[ \t]+_objc_msgSend\n} } } */
+/* { dg-final { scan-assembler {(bl|call)[ \t]+L_objc_msgSend\$stub\n} } } */
+/* { dg-final { scan-assembler-not {(bl|call)[ \t]+_bogonic\n} } } */
+/* { dg-final { scan-assembler {(bl|call)[ \t]+L_bogonic\$stub\n} } } */
+/* { dg-final { scan-assembler-not {\$non_lazy_ptr} } } */
diff --git a/gcc/testsuite/objc.dg/stubify-2.m b/gcc/testsuite/objc.dg/stubify-2.m
index eaf4b964e4b..2930e46fc13 100644
--- a/gcc/testsuite/objc.dg/stubify-2.m
+++ b/gcc/testsuite/objc.dg/stubify-2.m
@@ -1,10 +1,10 @@
/* All calls must be properly stubified, m32 only. */
/* Testcase extracted from TextEdit:Document.m. */
-/* { dg-do compile { target powerpc*-*-darwin* } } */
+/* { dg-do compile { target *-*-darwin* } } */
/* { dg-skip-if "" { *-*-* } { "-fgnu-runtime" } { "" } } */
/* { dg-require-effective-target ilp32 } */
-/* { dg-options "-mdynamic-no-pic -fdump-rtl-jump -mmacosx-version-min=10.4" } */
+/* { dg-options "-mdynamic-no-pic -mmacosx-version-min=10.4 -msymbol-stubs" } */
typedef struct objc_object { } *id ;
int x = 41 ;
@@ -30,4 +30,9 @@ extern int bogonic (int, int, int) ;
/* Any symbol_ref of an un-stubified objc_msgSend is an error; look
for "objc_msgSend" in quotes, without the $stub suffix. */
-/* { dg-final { scan-rtl-dump-not "symbol_ref.*\"objc_msgSend\"" "jump" } } */
+
+/* { dg-final { scan-assembler-not {(bl|call)[ \t]+_objc_msgSend\n} } } */
+/* { dg-final { scan-assembler {(bl|call)[ \t]+L_objc_msgSend\$stub\n} } } */
+/* { dg-final { scan-assembler-not {(bl|call)[ \t]+_bogonic\n} } } */
+/* { dg-final { scan-assembler {(bl|call)[ \t]+L_bogonic\$stub\n} } } */
+/* { dg-final { scan-assembler-not {\$non_lazy_ptr} } } */
diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c
index 32be59acfb0..d27cc65f883 100644
--- a/gcc/tree-cfg.c
+++ b/gcc/tree-cfg.c
@@ -9151,7 +9151,7 @@ generate_range_test (basic_block bb, tree index, tree low, tree high,
tree *lhs, tree *rhs)
{
tree type = TREE_TYPE (index);
- tree utype = unsigned_type_for (type);
+ tree utype = range_check_type (type);
low = fold_convert (utype, low);
high = fold_convert (utype, high);
diff --git a/gcc/tree-cfgcleanup.c b/gcc/tree-cfgcleanup.c
index 183b491ab1d..4bac38ab00c 100644
--- a/gcc/tree-cfgcleanup.c
+++ b/gcc/tree-cfgcleanup.c
@@ -101,6 +101,8 @@ convert_single_case_switch (gswitch *swtch, gimple_stmt_iterator &gsi)
if (high)
{
tree lhs, rhs;
+ if (range_check_type (TREE_TYPE (index)) == NULL_TREE)
+ return false;
generate_range_test (bb, index, low, high, &lhs, &rhs);
cond = gimple_build_cond (LE_EXPR, lhs, rhs, NULL_TREE, NULL_TREE);
}
diff --git a/gcc/tree-dfa.c b/gcc/tree-dfa.c
index 9ba627c90b5..64991ba92fa 100644
--- a/gcc/tree-dfa.c
+++ b/gcc/tree-dfa.c
@@ -61,23 +61,23 @@ static void collect_dfa_stats (struct dfa_stats_d *);
/* Renumber all of the gimple stmt uids. */
void
-renumber_gimple_stmt_uids (void)
+renumber_gimple_stmt_uids (struct function *fun)
{
basic_block bb;
- set_gimple_stmt_max_uid (cfun, 0);
- FOR_ALL_BB_FN (bb, cfun)
+ set_gimple_stmt_max_uid (fun, 0);
+ FOR_ALL_BB_FN (bb, fun)
{
gimple_stmt_iterator bsi;
for (bsi = gsi_start_phis (bb); !gsi_end_p (bsi); gsi_next (&bsi))
{
gimple *stmt = gsi_stmt (bsi);
- gimple_set_uid (stmt, inc_gimple_stmt_max_uid (cfun));
+ gimple_set_uid (stmt, inc_gimple_stmt_max_uid (fun));
}
for (bsi = gsi_start_bb (bb); !gsi_end_p (bsi); gsi_next (&bsi))
{
gimple *stmt = gsi_stmt (bsi);
- gimple_set_uid (stmt, inc_gimple_stmt_max_uid (cfun));
+ gimple_set_uid (stmt, inc_gimple_stmt_max_uid (fun));
}
}
}
diff --git a/gcc/tree-dfa.h b/gcc/tree-dfa.h
index 98810080c65..aa4ab7eb946 100644
--- a/gcc/tree-dfa.h
+++ b/gcc/tree-dfa.h
@@ -20,7 +20,7 @@ along with GCC; see the file COPYING3. If not see
#ifndef GCC_TREE_DFA_H
#define GCC_TREE_DFA_H
-extern void renumber_gimple_stmt_uids (void);
+extern void renumber_gimple_stmt_uids (struct function *);
extern void renumber_gimple_stmt_uids_in_blocks (basic_block *, int);
extern void dump_variable (FILE *, tree);
extern void debug_variable (tree);
diff --git a/gcc/tree-object-size.c b/gcc/tree-object-size.c
index f9ad7e83943..25c5ced57b7 100644
--- a/gcc/tree-object-size.c
+++ b/gcc/tree-object-size.c
@@ -890,6 +890,9 @@ cond_expr_object_size (struct object_size_info *osi, tree var, gimple *stmt)
else
expr_object_size (osi, var, then_);
+ if (object_sizes[object_size_type][varno] == unknown[object_size_type])
+ return reexamine;
+
if (TREE_CODE (else_) == SSA_NAME)
reexamine |= merge_object_sizes (osi, var, else_, 0);
else
diff --git a/gcc/tree-pass.h b/gcc/tree-pass.h
index b27dbdd0cb7..f6c230b169c 100644
--- a/gcc/tree-pass.h
+++ b/gcc/tree-pass.h
@@ -562,6 +562,7 @@ extern rtl_opt_pass *make_pass_stack_ptr_mod (gcc::context *ctxt);
extern rtl_opt_pass *make_pass_initialize_regs (gcc::context *ctxt);
extern rtl_opt_pass *make_pass_combine (gcc::context *ctxt);
extern rtl_opt_pass *make_pass_if_after_combine (gcc::context *ctxt);
+extern rtl_opt_pass *make_pass_jump_after_combine (gcc::context *ctxt);
extern rtl_opt_pass *make_pass_ree (gcc::context *ctxt);
extern rtl_opt_pass *make_pass_partition_blocks (gcc::context *ctxt);
extern rtl_opt_pass *make_pass_match_asm_constraints (gcc::context *ctxt);
@@ -579,7 +580,6 @@ extern rtl_opt_pass *make_pass_clean_state (gcc::context *ctxt);
extern rtl_opt_pass *make_pass_branch_prob (gcc::context *ctxt);
extern rtl_opt_pass *make_pass_value_profile_transformations (gcc::context
*ctxt);
-extern rtl_opt_pass *make_pass_postreload_jump (gcc::context *ctxt);
extern rtl_opt_pass *make_pass_postreload_cse (gcc::context *ctxt);
extern rtl_opt_pass *make_pass_gcse2 (gcc::context *ctxt);
extern rtl_opt_pass *make_pass_split_after_reload (gcc::context *ctxt);
diff --git a/gcc/tree-ssa-ccp.c b/gcc/tree-ssa-ccp.c
index e6bcc216e7c..8db6a34e059 100644
--- a/gcc/tree-ssa-ccp.c
+++ b/gcc/tree-ssa-ccp.c
@@ -2079,8 +2079,6 @@ insert_clobber_before_stack_restore (tree saved_val, tree var,
else if (gimple_assign_ssa_name_copy_p (stmt))
insert_clobber_before_stack_restore (gimple_assign_lhs (stmt), var,
visited);
- else
- gcc_assert (is_gimple_debug (stmt));
}
/* Advance the iterator to the previous non-debug gimple statement in the same
@@ -2105,9 +2103,9 @@ gsi_prev_dom_bb_nondebug (gimple_stmt_iterator *i)
/* Find a BUILT_IN_STACK_SAVE dominating gsi_stmt (I), and insert
a clobber of VAR before each matching BUILT_IN_STACK_RESTORE.
- It is possible that BUILT_IN_STACK_SAVE cannot be find in a dominator when a
- previous pass (such as DOM) duplicated it along multiple paths to a BB. In
- that case the function gives up without inserting the clobbers. */
+ It is possible that BUILT_IN_STACK_SAVE cannot be found in a dominator when
+ a previous pass (such as DOM) duplicated it along multiple paths to a BB.
+ In that case the function gives up without inserting the clobbers. */
static void
insert_clobbers_for_var (gimple_stmt_iterator i, tree var)
diff --git a/gcc/tree-ssa-dse.c b/gcc/tree-ssa-dse.c
index aa998f416c7..efe5b31cc0a 100644
--- a/gcc/tree-ssa-dse.c
+++ b/gcc/tree-ssa-dse.c
@@ -984,7 +984,7 @@ pass_dse::execute (function *fun)
{
need_eh_cleanup = BITMAP_ALLOC (NULL);
- renumber_gimple_stmt_uids ();
+ renumber_gimple_stmt_uids (cfun);
/* We might consider making this a property of each pass so that it
can be [re]computed on an as-needed basis. Particularly since
diff --git a/gcc/tree-ssa-forwprop.c b/gcc/tree-ssa-forwprop.c
index eeb6281c652..bbfa1bc6fae 100644
--- a/gcc/tree-ssa-forwprop.c
+++ b/gcc/tree-ssa-forwprop.c
@@ -2496,6 +2496,8 @@ pass_forwprop::execute (function *fun)
{
int did_something;
did_something = forward_propagate_into_comparison (&gsi);
+ if (maybe_clean_or_replace_eh_stmt (stmt, gsi_stmt (gsi)))
+ bitmap_set_bit (to_purge, bb->index);
if (did_something == 2)
cfg_changed = true;
changed = did_something != 0;
diff --git a/gcc/tree-ssa-math-opts.c b/gcc/tree-ssa-math-opts.c
index b7bbde4e402..bf9466b417f 100644
--- a/gcc/tree-ssa-math-opts.c
+++ b/gcc/tree-ssa-math-opts.c
@@ -3840,7 +3840,7 @@ pass_optimize_widening_mul::execute (function *fun)
memset (&widen_mul_stats, 0, sizeof (widen_mul_stats));
calculate_dominance_info (CDI_DOMINATORS);
- renumber_gimple_stmt_uids ();
+ renumber_gimple_stmt_uids (cfun);
math_opts_dom_walker (&cfg_changed).walk (ENTRY_BLOCK_PTR_FOR_FN (cfun));
diff --git a/gcc/tree-ssa-phiprop.c b/gcc/tree-ssa-phiprop.c
index d710582a915..e90ae6a89cb 100644
--- a/gcc/tree-ssa-phiprop.c
+++ b/gcc/tree-ssa-phiprop.c
@@ -338,8 +338,15 @@ propagate_with_phi (basic_block bb, gphi *phi, struct phiprop_d *phivn,
&& (!type
|| types_compatible_p
(TREE_TYPE (gimple_assign_lhs (use_stmt)), type))
- /* We cannot replace a load that may throw or is volatile. */
- && !stmt_can_throw_internal (cfun, use_stmt)))
+ /* We cannot replace a load that may throw or is volatile.
+ For volatiles the transform can change the number of
+ executions if the load is inside a loop but the address
+ computations outside (PR91812). We could relax this
+ if we guard against that appropriately. For loads that can
+ throw we could relax things if the moved loads all are
+ known to not throw. */
+ && !stmt_can_throw_internal (cfun, use_stmt)
+ && !gimple_has_volatile_ops (use_stmt)))
continue;
/* Check if we can move the loads. The def stmt of the virtual use
diff --git a/gcc/tree-ssa-reassoc.c b/gcc/tree-ssa-reassoc.c
index 7161c4c36c3..6794fbde29e 100644
--- a/gcc/tree-ssa-reassoc.c
+++ b/gcc/tree-ssa-reassoc.c
@@ -6013,12 +6013,7 @@ reassociate_bb (basic_block bb)
{
machine_mode mode = TYPE_MODE (TREE_TYPE (lhs));
int ops_num = ops.length ();
- int width = get_reassociation_width (ops_num, rhs_code, mode);
-
- if (dump_file && (dump_flags & TDF_DETAILS))
- fprintf (dump_file,
- "Width = %d was chosen for reassociation\n", width);
-
+ int width;
/* For binary bit operations, if there are at least 3
operands and the last last operand in OPS is a constant,
@@ -6032,10 +6027,21 @@ reassociate_bb (basic_block bb)
&& TREE_CODE (ops.last ()->op) == INTEGER_CST)
std::swap (*ops[0], *ops[ops_num - 1]);
- if (width > 1
- && ops.length () > 3)
- rewrite_expr_tree_parallel (as_a <gassign *> (stmt),
- width, ops);
+ /* Only rewrite the expression tree to parallel in the
+ last reassoc pass to avoid useless work back-and-forth
+ with initial linearization. */
+ if (!reassoc_insert_powi_p
+ && ops.length () > 3
+ && (width = get_reassociation_width (ops_num, rhs_code,
+ mode)) > 1)
+ {
+ if (dump_file && (dump_flags & TDF_DETAILS))
+ fprintf (dump_file,
+ "Width = %d was chosen for reassociation\n",
+ width);
+ rewrite_expr_tree_parallel (as_a <gassign *> (stmt),
+ width, ops);
+ }
else
{
/* When there are three operands left, we want
diff --git a/gcc/tree-ssa-sink.c b/gcc/tree-ssa-sink.c
index fe762f54d96..8a64ab084e5 100644
--- a/gcc/tree-ssa-sink.c
+++ b/gcc/tree-ssa-sink.c
@@ -439,7 +439,10 @@ statement_sink_location (gimple *stmt, basic_block frombb,
if (sinkbb == frombb)
return false;
- *togsi = gsi_for_stmt (use);
+ if (sinkbb == gimple_bb (use))
+ *togsi = gsi_for_stmt (use);
+ else
+ *togsi = gsi_after_labels (sinkbb);
return true;
}
diff --git a/gcc/tree-switch-conversion.c b/gcc/tree-switch-conversion.c
index c3f2baf39d7..dd6dd8064de 100644
--- a/gcc/tree-switch-conversion.c
+++ b/gcc/tree-switch-conversion.c
@@ -605,7 +605,9 @@ switch_conversion::build_one_array (int num, tree arr_index_type,
vec<constructor_elt, va_gc> *constructor = m_constructors[num];
wide_int coeff_a, coeff_b;
bool linear_p = contains_linear_function_p (constructor, &coeff_a, &coeff_b);
- if (linear_p)
+ tree type;
+ if (linear_p
+ && (type = range_check_type (TREE_TYPE ((*constructor)[0].value))))
{
if (dump_file && coeff_a.to_uhwi () > 0)
fprintf (dump_file, "Linear transformation with A = %" PRId64
@@ -613,13 +615,12 @@ switch_conversion::build_one_array (int num, tree arr_index_type,
coeff_b.to_shwi ());
/* We must use type of constructor values. */
- tree t = unsigned_type_for (TREE_TYPE ((*constructor)[0].value));
gimple_seq seq = NULL;
- tree tmp = gimple_convert (&seq, t, m_index_expr);
- tree tmp2 = gimple_build (&seq, MULT_EXPR, t,
- wide_int_to_tree (t, coeff_a), tmp);
- tree tmp3 = gimple_build (&seq, PLUS_EXPR, t, tmp2,
- wide_int_to_tree (t, coeff_b));
+ tree tmp = gimple_convert (&seq, type, m_index_expr);
+ tree tmp2 = gimple_build (&seq, MULT_EXPR, type,
+ wide_int_to_tree (type, coeff_a), tmp);
+ tree tmp3 = gimple_build (&seq, PLUS_EXPR, type, tmp2,
+ wide_int_to_tree (type, coeff_b));
tree tmp4 = gimple_convert (&seq, TREE_TYPE (name), tmp3);
gsi_insert_seq_before (&gsi, seq, GSI_SAME_STMT);
load = gimple_build_assign (name, tmp4);
@@ -1350,7 +1351,7 @@ bit_test_cluster::find_bit_tests (vec<cluster *> &clusters)
entire));
}
else
- for (int i = end - 1; i >= start; i--)
+ for (int i = end - 1; i >= start; i--)
output.safe_push (clusters[i]);
end = start;
@@ -1483,7 +1484,7 @@ bit_test_cluster::emit (tree index_expr, tree index_type,
unsigned int i, j, k;
unsigned int count;
- tree unsigned_index_type = unsigned_type_for (index_type);
+ tree unsigned_index_type = range_check_type (index_type);
gimple_stmt_iterator gsi;
gassign *shift_stmt;
@@ -1793,7 +1794,8 @@ switch_decision_tree::try_switch_expansion (vec<cluster *> &clusters)
tree index_type = TREE_TYPE (index_expr);
basic_block bb = gimple_bb (m_switch);
- if (gimple_switch_num_labels (m_switch) == 1)
+ if (gimple_switch_num_labels (m_switch) == 1
+ || range_check_type (index_type) == NULL_TREE)
return false;
/* Find the default case target label. */
diff --git a/gcc/tree-vect-loop.c b/gcc/tree-vect-loop.c
index 337e078df00..0308b26b808 100644
--- a/gcc/tree-vect-loop.c
+++ b/gcc/tree-vect-loop.c
@@ -6445,10 +6445,13 @@ vectorizable_reduction (stmt_vec_info stmt_info, gimple_stmt_iterator *gsi,
gcc_assert (TREE_CODE (base) == INTEGER_CST
&& TREE_CODE (step) == INTEGER_CST);
cond_reduc_val = NULL_TREE;
+ tree res = PHI_RESULT (STMT_VINFO_STMT (cond_stmt_vinfo));
+ if (!types_compatible_p (TREE_TYPE (res), TREE_TYPE (base)))
+ ;
/* Find a suitable value, for MAX_EXPR below base, for MIN_EXPR
above base; punt if base is the minimum value of the type for
MAX_EXPR or maximum value of the type for MIN_EXPR for now. */
- if (tree_int_cst_sgn (step) == -1)
+ else if (tree_int_cst_sgn (step) == -1)
{
cond_reduc_op_code = MIN_EXPR;
if (tree_int_cst_sgn (base) == -1)
diff --git a/gcc/tree-vect-slp.c b/gcc/tree-vect-slp.c
index 017bfa873f7..05e14569ee0 100644
--- a/gcc/tree-vect-slp.c
+++ b/gcc/tree-vect-slp.c
@@ -129,6 +129,7 @@ vect_create_new_slp_node (vec<stmt_vec_info> scalar_stmts)
SLP_TREE_TWO_OPERATORS (node) = false;
SLP_TREE_DEF_TYPE (node) = vect_internal_def;
node->refcnt = 1;
+ node->max_nunits = 1;
unsigned i;
FOR_EACH_VEC_ELT (scalar_stmts, i, stmt_info)
@@ -1051,15 +1052,24 @@ vect_build_slp_tree (vec_info *vinfo,
dump_printf_loc (MSG_NOTE, vect_location, "re-using %sSLP tree %p\n",
*leader ? "" : "failed ", *leader);
if (*leader)
- (*leader)->refcnt++;
+ {
+ (*leader)->refcnt++;
+ vect_update_max_nunits (max_nunits, (*leader)->max_nunits);
+ }
return *leader;
}
- slp_tree res = vect_build_slp_tree_2 (vinfo, stmts, group_size, max_nunits,
+ poly_uint64 this_max_nunits = 1;
+ slp_tree res = vect_build_slp_tree_2 (vinfo, stmts, group_size,
+ &this_max_nunits,
matches, npermutes, tree_size,
max_tree_size, bst_map);
- /* Keep a reference for the bst_map use. */
if (res)
- res->refcnt++;
+ {
+ res->max_nunits = this_max_nunits;
+ vect_update_max_nunits (max_nunits, this_max_nunits);
+ /* Keep a reference for the bst_map use. */
+ res->refcnt++;
+ }
bst_map->put (stmts.copy (), res);
return res;
}
@@ -1463,9 +1473,10 @@ vect_print_slp_tree (dump_flags_t dump_kind, dump_location_t loc,
dump_metadata_t metadata (dump_kind, loc.get_impl_location ());
dump_user_location_t user_loc = loc.get_user_location ();
- dump_printf_loc (metadata, user_loc, "node%s %p\n",
+ dump_printf_loc (metadata, user_loc, "node%s %p (max_nunits=%u)\n",
SLP_TREE_DEF_TYPE (node) != vect_internal_def
- ? " (external)" : "", node);
+ ? " (external)" : "", node,
+ estimated_poly_value (node->max_nunits));
FOR_EACH_VEC_ELT (SLP_TREE_SCALAR_STMTS (node), i, stmt_info)
dump_printf_loc (metadata, user_loc, "\tstmt %d %G", i, stmt_info->stmt);
if (SLP_TREE_CHILDREN (node).is_empty ())
diff --git a/gcc/tree-vect-stmts.c b/gcc/tree-vect-stmts.c
index 17769c88b6a..8263889cbe4 100644
--- a/gcc/tree-vect-stmts.c
+++ b/gcc/tree-vect-stmts.c
@@ -3279,7 +3279,7 @@ vectorizable_call (stmt_vec_info stmt_info, gimple_stmt_iterator *gsi,
if (!vectype_in)
vectype_in = vectypes[i];
else if (vectypes[i]
- && vectypes[i] != vectype_in)
+ && !types_compatible_p (vectypes[i], vectype_in))
{
if (dump_enabled_p ())
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
@@ -8276,7 +8276,9 @@ vectorizable_load (stmt_vec_info stmt_info, gimple_stmt_iterator *gsi,
|| alignment_support_scheme == dr_explicit_realign)
&& !compute_in_loop)
{
- msq = vect_setup_realignment (first_stmt_info, gsi, &realignment_token,
+ msq = vect_setup_realignment (first_stmt_info_for_drptr
+ ? first_stmt_info_for_drptr
+ : first_stmt_info, gsi, &realignment_token,
alignment_support_scheme, NULL_TREE,
&at_loop);
if (alignment_support_scheme == dr_explicit_realign_optimized)
diff --git a/gcc/tree-vectorizer.c b/gcc/tree-vectorizer.c
index d27104933a9..d89ec3b7c76 100644
--- a/gcc/tree-vectorizer.c
+++ b/gcc/tree-vectorizer.c
@@ -941,7 +941,7 @@ try_vectorize_loop_1 (hash_table<simduid_to_vf> *&simduid_to_vf_htab,
fold_loop_internal_call (loop_vectorized_call,
boolean_true_node);
loop_vectorized_call = NULL;
- ret |= TODO_cleanup_cfg;
+ ret |= TODO_cleanup_cfg | TODO_update_ssa_only_virtuals;
}
}
/* If outer loop vectorization fails for LOOP_VECTORIZED guarded
diff --git a/gcc/tree-vectorizer.h b/gcc/tree-vectorizer.h
index d5fd4690b1d..148b9a7f215 100644
--- a/gcc/tree-vectorizer.h
+++ b/gcc/tree-vectorizer.h
@@ -132,6 +132,9 @@ struct _slp_tree {
unsigned int vec_stmts_size;
/* Reference count in the SLP graph. */
unsigned int refcnt;
+ /* The maximum number of vector elements for the subtree rooted
+ at this node. */
+ poly_uint64 max_nunits;
/* Whether the scalar computations use two different operators. */
bool two_operators;
/* The DEF type of this node. */
@@ -1350,19 +1353,27 @@ vect_get_num_copies (loop_vec_info loop_vinfo, tree vectype)
}
/* Update maximum unit count *MAX_NUNITS so that it accounts for
- the number of units in vector type VECTYPE. *MAX_NUNITS can be 1
- if we haven't yet recorded any vector types. */
+ NUNITS. *MAX_NUNITS can be 1 if we haven't yet recorded anything. */
static inline void
-vect_update_max_nunits (poly_uint64 *max_nunits, tree vectype)
+vect_update_max_nunits (poly_uint64 *max_nunits, poly_uint64 nunits)
{
/* All unit counts have the form current_vector_size * X for some
rational X, so two unit sizes must have a common multiple.
Everything is a multiple of the initial value of 1. */
- poly_uint64 nunits = TYPE_VECTOR_SUBPARTS (vectype);
*max_nunits = force_common_multiple (*max_nunits, nunits);
}
+/* Update maximum unit count *MAX_NUNITS so that it accounts for
+ the number of units in vector type VECTYPE. *MAX_NUNITS can be 1
+ if we haven't yet recorded any vector types. */
+
+static inline void
+vect_update_max_nunits (poly_uint64 *max_nunits, tree vectype)
+{
+ vect_update_max_nunits (max_nunits, TYPE_VECTOR_SUBPARTS (vectype));
+}
+
/* Return the vectorization factor that should be used for costing
purposes while vectorizing the loop described by LOOP_VINFO.
Pick a reasonable estimate if the vectorization factor isn't
diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c
index 795d7184a65..2140101d7d2 100644
--- a/gcc/tree-vrp.c
+++ b/gcc/tree-vrp.c
@@ -1702,9 +1702,7 @@ extract_range_from_binary_expr (value_range_base *vr,
{
/* For pointer types, we are really only interested in asserting
whether the expression evaluates to non-NULL. */
- if (!range_includes_zero_p (&vr0) && !range_includes_zero_p (&vr1))
- vr->set_nonnull (expr_type);
- else if (range_is_null (&vr0) || range_is_null (&vr1))
+ if (range_is_null (&vr0) || range_is_null (&vr1))
vr->set_null (expr_type);
else
vr->set_varying ();
@@ -1772,18 +1770,19 @@ extract_range_from_binary_expr (value_range_base *vr,
combine_bound (code, wmin, min_ovf, expr_type, min_op0, min_op1);
combine_bound (code, wmax, max_ovf, expr_type, max_op0, max_op1);
- /* If we have overflow for the constant part and the resulting
- range will be symbolic, drop to VR_VARYING. */
- if (((bool)min_ovf && sym_min_op0 != sym_min_op1)
- || ((bool)max_ovf && sym_max_op0 != sym_max_op1))
+ /* If the resulting range will be symbolic, we need to eliminate any
+ explicit or implicit overflow introduced in the above computation
+ because compare_values could make an incorrect use of it. That's
+ why we require one of the ranges to be a singleton. */
+ if ((sym_min_op0 != sym_min_op1 || sym_max_op0 != sym_max_op1)
+ && ((bool)min_ovf || (bool)max_ovf
+ || (min_op0 != max_op0 && min_op1 != max_op1)))
{
vr->set_varying ();
return;
}
/* Adjust the range for possible overflow. */
- min = NULL_TREE;
- max = NULL_TREE;
set_value_range_with_overflow (type, min, max, expr_type,
wmin, wmax, min_ovf, max_ovf);
if (type == VR_VARYING)
diff --git a/gcc/tree.c b/gcc/tree.c
index 337b95a85e2..1549bde9147 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -5777,7 +5777,8 @@ free_lang_data_in_decl (tree decl, struct free_lang_data_d *fld)
while (*nextp)
{
tree var = *nextp;
- if (fndecl_built_in_p (var))
+ if (TREE_CODE (var) == FUNCTION_DECL
+ && fndecl_built_in_p (var))
*nextp = TREE_CHAIN (var);
else
nextp = &TREE_CHAIN (var);
@@ -5936,8 +5937,9 @@ find_decls_types_r (tree *tp, int *ws, void *data)
{
for (tree *tem = &BLOCK_VARS (t); *tem; )
{
- if (TREE_CODE (*tem) != VAR_DECL
- || !auto_var_in_fn_p (*tem, DECL_CONTEXT (*tem)))
+ if (TREE_CODE (*tem) != LABEL_DECL
+ && (TREE_CODE (*tem) != VAR_DECL
+ || !auto_var_in_fn_p (*tem, DECL_CONTEXT (*tem))))
{
gcc_assert (TREE_CODE (*tem) != RESULT_DECL
&& TREE_CODE (*tem) != PARM_DECL);
@@ -6106,6 +6108,13 @@ find_decls_types_in_node (struct cgraph_node *n, struct free_lang_data_d *fld)
{
tree arg = gimple_op (stmt, i);
find_decls_types (arg, fld);
+ /* find_decls_types doesn't walk TREE_PURPOSE of TREE_LISTs,
+ which we need for asm stmts. */
+ if (arg
+ && TREE_CODE (arg) == TREE_LIST
+ && TREE_PURPOSE (arg)
+ && gimple_code (stmt) == GIMPLE_ASM)
+ find_decls_types (TREE_PURPOSE (arg), fld);
}
}
}
@@ -11356,73 +11365,6 @@ initializer_each_zero_or_onep (const_tree expr)
}
}
-/* Given an initializer INIT for a TYPE, return true if INIT is zero
- so that it can be replaced by value initialization. This function
- distinguishes betwen empty strings as initializers for arrays and
- for pointers (which make it return false). */
-
-bool
-type_initializer_zero_p (tree type, tree init)
-{
- if (type == error_mark_node || init == error_mark_node)
- return false;
-
- STRIP_NOPS (init);
-
- if (POINTER_TYPE_P (type))
- return TREE_CODE (init) != STRING_CST && initializer_zerop (init);
-
- if (TREE_CODE (init) != CONSTRUCTOR)
- return initializer_zerop (init);
-
- if (TREE_CODE (type) == ARRAY_TYPE)
- {
- tree elt_type = TREE_TYPE (type);
- elt_type = TYPE_MAIN_VARIANT (elt_type);
- if (elt_type == char_type_node)
- return initializer_zerop (init);
-
- tree elt_init;
- unsigned HOST_WIDE_INT i;
- FOR_EACH_CONSTRUCTOR_VALUE (CONSTRUCTOR_ELTS (init), i, elt_init)
- if (!type_initializer_zero_p (elt_type, elt_init))
- return false;
- return true;
- }
-
- if (TREE_CODE (type) != RECORD_TYPE)
- return initializer_zerop (init);
-
- tree fld = TYPE_FIELDS (type);
-
- tree fld_init;
- unsigned HOST_WIDE_INT i;
- FOR_EACH_CONSTRUCTOR_VALUE (CONSTRUCTOR_ELTS (init), i, fld_init)
- {
- /* Advance to the next member, skipping over everything that
- canot be initialized (including unnamed bit-fields). */
- while (TREE_CODE (fld) != FIELD_DECL
- || DECL_ARTIFICIAL (fld)
- || (DECL_BIT_FIELD (fld) && !DECL_NAME (fld)))
- {
- fld = DECL_CHAIN (fld);
- if (!fld)
- return true;
- continue;
- }
-
- tree fldtype = TREE_TYPE (fld);
- if (!type_initializer_zero_p (fldtype, fld_init))
- return false;
-
- fld = DECL_CHAIN (fld);
- if (!fld)
- break;
- }
-
- return true;
-}
-
/* Check if vector VEC consists of all the equal elements and
that the number of elements corresponds to the type of VEC.
The function returns first element of the vector
diff --git a/gcc/tree.h b/gcc/tree.h
index 331edfcb1c3..43dabd1a3bf 100644
--- a/gcc/tree.h
+++ b/gcc/tree.h
@@ -4525,12 +4525,6 @@ extern tree first_field (const_tree);
extern bool initializer_zerop (const_tree, bool * = NULL);
extern bool initializer_each_zero_or_onep (const_tree);
-/* Analogous to initializer_zerop but also examines the type for
- which the initializer is being used. Unlike initializer_zerop,
- considers empty strings to be zero initializers for arrays and
- non-zero for pointers. */
-extern bool type_initializer_zero_p (tree, tree);
-
extern wide_int vector_cst_int_elt (const_tree, unsigned int);
extern tree vector_cst_elt (const_tree, unsigned int);
@@ -5952,12 +5946,12 @@ type_has_mode_precision_p (const_tree t)
Note that it is different from the DECL_IS_BUILTIN accessor. For
instance, user declared prototypes of C library functions are not
- DECL_IS_BUILTIN but may be DECL_BUILT_IN. */
+ DECL_IS_BUILTIN but may be fndecl_built_in_p. */
inline bool
fndecl_built_in_p (const_tree node)
{
- return (DECL_BUILT_IN_CLASS (node) != NOT_BUILT_IN);
+ return DECL_BUILT_IN_CLASS (node) != NOT_BUILT_IN;
}
/* Return true if a FUNCTION_DECL NODE is a GCC built-in function
@@ -5966,7 +5960,7 @@ fndecl_built_in_p (const_tree node)
inline bool
fndecl_built_in_p (const_tree node, built_in_class klass)
{
- return (fndecl_built_in_p (node) && DECL_BUILT_IN_CLASS (node) == klass);
+ return fndecl_built_in_p (node) && DECL_BUILT_IN_CLASS (node) == klass;
}
/* Return true if a FUNCTION_DECL NODE is a GCC built-in function