summaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog2590
-rw-r--r--gcc/ChangeLog-20106
-rw-r--r--gcc/ChangeLog.graphite466
-rw-r--r--gcc/DATESTAMP2
-rw-r--r--gcc/Makefile.in29
-rw-r--r--gcc/acinclude.m44
-rw-r--r--gcc/ada/ChangeLog40
-rw-r--r--gcc/ada/gcc-interface/Make-lang.in2
-rw-r--r--gcc/ada/gcc-interface/Makefile.in12
-rw-r--r--gcc/ada/gcc-interface/gigi.h9
-rw-r--r--gcc/ada/gcc-interface/misc.c13
-rw-r--r--gcc/ada/gcc-interface/trans.c6
-rw-r--r--gcc/ada/gcc-interface/utils.c196
-rw-r--r--gcc/ada/gcc-interface/utils2.c54
-rw-r--r--gcc/ada/gnat_ugn.texi2
-rw-r--r--gcc/ada/targext.c8
-rw-r--r--gcc/builtins.c9
-rw-r--r--gcc/c-decl.c119
-rw-r--r--gcc/c-family/ChangeLog39
-rw-r--r--gcc/c-family/c-ada-spec.c1
-rw-r--r--gcc/c-family/c-common.c39
-rw-r--r--gcc/c-family/c-common.h1
-rw-r--r--gcc/c-family/c-lex.c15
-rw-r--r--gcc/c-family/c-opts.c8
-rw-r--r--gcc/c-family/c.opt16
-rw-r--r--gcc/c-typeck.c8
-rw-r--r--gcc/caller-save.c164
-rw-r--r--gcc/cfgcleanup.c3
-rw-r--r--gcc/cfgexpand.c72
-rw-r--r--gcc/cgraph.c34
-rw-r--r--gcc/cgraph.h11
-rw-r--r--gcc/cgraphbuild.c5
-rw-r--r--gcc/cgraphunit.c92
-rw-r--r--gcc/combine.c15
-rw-r--r--gcc/common.opt51
-rw-r--r--gcc/compare-elim.c642
-rw-r--r--gcc/config.gcc109
-rw-r--r--gcc/config.host6
-rw-r--r--gcc/config.in24
-rw-r--r--gcc/config/alpha/elf.opt30
-rw-r--r--gcc/config/alpha/host-osf.c147
-rw-r--r--gcc/config/alpha/osf5.opt42
-rw-r--r--gcc/config/alpha/x-osf4
-rw-r--r--gcc/config/arc/arc.opt8
-rw-r--r--gcc/config/arm/arm-protos.h2
-rw-r--r--gcc/config/arm/arm.c91
-rw-r--r--gcc/config/arm/arm.h49
-rw-r--r--gcc/config/arm/arm.md14
-rw-r--r--gcc/config/arm/arm1026ejs.md2
-rw-r--r--gcc/config/arm/cortex-a5.md4
-rw-r--r--gcc/config/arm/cortex-m4-fpu.md4
-rw-r--r--gcc/config/arm/fpa.md16
-rw-r--r--gcc/config/arm/vfp.md8
-rw-r--r--gcc/config/arm/vxworks.opt60
-rwxr-xr-xgcc/config/avr/avr-devices.c4
-rw-r--r--gcc/config/avr/libgcc.S2
-rw-r--r--gcc/config/bfin/bfin.h6
-rw-r--r--gcc/config/cris/elf.opt5
-rw-r--r--gcc/config/darwin-c.c3
-rw-r--r--gcc/config/darwin-protos.h3
-rw-r--r--gcc/config/darwin-sections.def41
-rw-r--r--gcc/config/darwin.c405
-rw-r--r--gcc/config/darwin.h19
-rw-r--r--gcc/config/darwin.opt11
-rw-r--r--gcc/config/darwin10.h15
-rw-r--r--gcc/config/fr30/constraints.md72
-rw-r--r--gcc/config/fr30/fr30.h71
-rw-r--r--gcc/config/fr30/fr30.md1
-rw-r--r--gcc/config/freebsd-spec.h3
-rw-r--r--gcc/config/freebsd.opt8
-rw-r--r--gcc/config/frv/constraints.md174
-rw-r--r--gcc/config/frv/frv.c45
-rw-r--r--gcc/config/frv/frv.h151
-rw-r--r--gcc/config/frv/frv.md1
-rw-r--r--gcc/config/gnu-user.opt39
-rw-r--r--gcc/config/gnu.h10
-rw-r--r--gcc/config/hpux11.opt33
-rw-r--r--gcc/config/i386/avxintrin.h4
-rw-r--r--gcc/config/i386/biarch32.h29
-rw-r--r--gcc/config/i386/cygming.opt5
-rw-r--r--gcc/config/i386/darwin.h12
-rw-r--r--gcc/config/i386/djgpp.opt5
-rw-r--r--gcc/config/i386/gnu.h4
-rw-r--r--gcc/config/i386/i386.c218
-rw-r--r--gcc/config/i386/i386.md14
-rw-r--r--gcc/config/i386/mach.h44
-rw-r--r--gcc/config/i386/netware.h5
-rw-r--r--gcc/config/i386/netware.opt33
-rw-r--r--gcc/config/i386/nto.opt33
-rw-r--r--gcc/config/i386/sol2-10.h4
-rw-r--r--gcc/config/i386/sol2.h5
-rw-r--r--gcc/config/i386/sysv4.h63
-rw-r--r--gcc/config/i386/t-cygming10
-rw-r--r--gcc/config/i386/t-dlldir6
-rw-r--r--gcc/config/i386/t-dlldir-x9
-rw-r--r--gcc/config/i386/t-i3862
-rw-r--r--gcc/config/ia64/ia64-protos.h2
-rw-r--r--gcc/config/ia64/ia64.c184
-rw-r--r--gcc/config/ia64/predicates.md4
-rw-r--r--gcc/config/ia64/vect.md555
-rw-r--r--gcc/config/ia64/vms.opt30
-rw-r--r--gcc/config/interix.opt5
-rw-r--r--gcc/config/iq2000/constraints.md79
-rw-r--r--gcc/config/iq2000/iq2000.h53
-rw-r--r--gcc/config/iq2000/iq2000.md46
-rw-r--r--gcc/config/lm32/lm32.h4
-rw-r--r--gcc/config/lm32/t-lm322
-rw-r--r--gcc/config/m32c/m32c.c10
-rw-r--r--gcc/config/m32c/m32c.h19
-rw-r--r--gcc/config/m32r/constraints.md16
-rw-r--r--gcc/config/m32r/m32r.c109
-rw-r--r--gcc/config/m32r/m32r.h95
-rw-r--r--gcc/config/m68k/linux.h5
-rw-r--r--gcc/config/m68k/uclinux.opt36
-rw-r--r--gcc/config/mcore/constraints.md112
-rw-r--r--gcc/config/mcore/mcore.c13
-rw-r--r--gcc/config/mcore/mcore.h93
-rw-r--r--gcc/config/mcore/mcore.md1
-rw-r--r--gcc/config/microblaze/microblaze.opt20
-rw-r--r--gcc/config/mips/iris6.h5
-rw-r--r--gcc/config/mips/iris6.opt45
-rw-r--r--gcc/config/mips/mips.opt13
-rw-r--r--gcc/config/mn10300/constraints.md6
-rw-r--r--gcc/config/mn10300/mn10300.c743
-rw-r--r--gcc/config/mn10300/mn10300.h4
-rw-r--r--gcc/config/mn10300/mn10300.md205
-rw-r--r--gcc/config/mn10300/mn10300.opt10
-rw-r--r--gcc/config/mn10300/predicates.md4
-rw-r--r--gcc/config/openbsd.opt5
-rw-r--r--gcc/config/pa/pa-hpux.opt8
-rw-r--r--gcc/config/pa/pa-hpux10.opt (renamed from gcc/config/rs6000/aix.opt)20
-rw-r--r--gcc/config/pa/pa-hpux11.h11
-rw-r--r--gcc/config/pa/pa-linux.h5
-rw-r--r--gcc/config/pa/pa64-hpux.h18
-rw-r--r--gcc/config/pa/stublib.c17
-rw-r--r--gcc/config/pa/t-pa-hpux117
-rw-r--r--gcc/config/pa/t-pa647
-rw-r--r--gcc/config/rs6000/aix61.h8
-rw-r--r--gcc/config/rs6000/aix64.opt8
-rw-r--r--gcc/config/rs6000/altivec.h4
-rw-r--r--gcc/config/rs6000/altivec.md22
-rw-r--r--gcc/config/rs6000/darwin.h3
-rw-r--r--gcc/config/rs6000/linux64.h9
-rw-r--r--gcc/config/rs6000/predicates.md8
-rw-r--r--gcc/config/rs6000/rs6000-builtin.def29
-rw-r--r--gcc/config/rs6000/rs6000-c.c210
-rw-r--r--gcc/config/rs6000/rs6000-protos.h4
-rw-r--r--gcc/config/rs6000/rs6000.c232
-rw-r--r--gcc/config/rs6000/rs6000.h6
-rw-r--r--gcc/config/rs6000/rs6000.md2
-rw-r--r--gcc/config/rs6000/sysv4.h5
-rw-r--r--gcc/config/rs6000/vector.md39
-rw-r--r--gcc/config/rs6000/vsx.md32
-rw-r--r--gcc/config/rs6000/vxworks.h4
-rw-r--r--gcc/config/rs6000/xilinx.opt33
-rw-r--r--gcc/config/rx/predicates.md4
-rw-r--r--gcc/config/rx/rx-protos.h4
-rw-r--r--gcc/config/rx/rx.c234
-rw-r--r--gcc/config/rx/rx.h15
-rw-r--r--gcc/config/rx/rx.md227
-rw-r--r--gcc/config/s390/s390-protos.h1
-rw-r--r--gcc/config/s390/s390.c36
-rw-r--r--gcc/config/s390/s390.h17
-rw-r--r--gcc/config/sh/embed-elf.h4
-rw-r--r--gcc/config/sh/superh64.h49
-rw-r--r--gcc/config/sol2.h5
-rw-r--r--gcc/config/sparc/freebsd.h5
-rw-r--r--gcc/config/sparc/linux.h5
-rw-r--r--gcc/config/sparc/linux64.h9
-rw-r--r--gcc/config/sparc/sol2-bi.h6
-rw-r--r--gcc/config/sparc/sol2-unwind.h648
-rw-r--r--gcc/config/sparc/sp-elf.h5
-rw-r--r--gcc/config/sparc/sparc.h7
-rw-r--r--gcc/config/sparc/sysv4.h4
-rw-r--r--gcc/config/sparc/vxworks.h5
-rw-r--r--gcc/config/spu/spu-elf.h3
-rw-r--r--gcc/config/spu/spu.c13
-rw-r--r--gcc/config/stormy16/constraints.md119
-rw-r--r--gcc/config/stormy16/predicates.md4
-rw-r--r--gcc/config/stormy16/stormy16-protos.h6
-rw-r--r--gcc/config/stormy16/stormy16.c97
-rw-r--r--gcc/config/stormy16/stormy16.h61
-rw-r--r--gcc/config/stormy16/stormy16.md1
-rw-r--r--gcc/config/t-darwin2
-rw-r--r--gcc/config/v850/constraints.md108
-rw-r--r--gcc/config/v850/predicates.md5
-rw-r--r--gcc/config/v850/v850.h126
-rw-r--r--gcc/config/v850/v850.md1
-rw-r--r--gcc/config/v850/v850.opt8
-rw-r--r--gcc/config/vax/elf.opt30
-rw-r--r--gcc/config/vms/vms.opt8
-rw-r--r--gcc/config/xtensa/elf.opt30
-rw-r--r--gcc/config/xtensa/xtensa-protos.h8
-rw-r--r--gcc/config/xtensa/xtensa.c110
-rw-r--r--gcc/config/xtensa/xtensa.h40
-rwxr-xr-xgcc/configure47
-rw-r--r--gcc/configure.ac24
-rw-r--r--gcc/cp/ChangeLog241
-rw-r--r--gcc/cp/call.c7
-rw-r--r--gcc/cp/class.c99
-rw-r--r--gcc/cp/cp-tree.h19
-rw-r--r--gcc/cp/cvt.c13
-rw-r--r--gcc/cp/decl.c18
-rw-r--r--gcc/cp/decl2.c20
-rw-r--r--gcc/cp/error.c6
-rw-r--r--gcc/cp/g++spec.c6
-rw-r--r--gcc/cp/init.c5
-rw-r--r--gcc/cp/mangle.c56
-rw-r--r--gcc/cp/method.c28
-rw-r--r--gcc/cp/name-lookup.c16
-rw-r--r--gcc/cp/name-lookup.h1
-rw-r--r--gcc/cp/optimize.c1
-rw-r--r--gcc/cp/parser.c58
-rw-r--r--gcc/cp/pt.c124
-rw-r--r--gcc/cp/semantics.c330
-rw-r--r--gcc/cp/tree.c13
-rw-r--r--gcc/cselib.c312
-rw-r--r--gcc/cselib.h8
-rw-r--r--gcc/df-problems.c2
-rw-r--r--gcc/df-scan.c29
-rw-r--r--gcc/doc/cpp.texi7
-rw-r--r--gcc/doc/extend.texi92
-rw-r--r--gcc/doc/install.texi52
-rw-r--r--gcc/doc/invoke.texi100
-rw-r--r--gcc/doc/lto.texi2
-rw-r--r--gcc/doc/options.texi15
-rw-r--r--gcc/doc/sourcebuild.texi10
-rw-r--r--gcc/doc/tm.texi4
-rw-r--r--gcc/doc/tm.texi.in2
-rw-r--r--gcc/dse.c89
-rw-r--r--gcc/dwarf2out.c124
-rw-r--r--gcc/emit-rtl.c2
-rw-r--r--gcc/except.c100
-rw-r--r--gcc/expr.c21
-rw-r--r--gcc/final.c7
-rw-r--r--gcc/fortran/ChangeLog418
-rw-r--r--gcc/fortran/check.c9
-rw-r--r--gcc/fortran/class.c16
-rw-r--r--gcc/fortran/decl.c29
-rw-r--r--gcc/fortran/dump-parse-tree.c9
-rw-r--r--gcc/fortran/error.c6
-rw-r--r--gcc/fortran/expr.c23
-rw-r--r--gcc/fortran/f95-lang.c17
-rw-r--r--gcc/fortran/gfortran.h6
-rw-r--r--gcc/fortran/gfortran.texi41
-rw-r--r--gcc/fortran/gfortranspec.c4
-rw-r--r--gcc/fortran/interface.c142
-rw-r--r--gcc/fortran/intrinsic.c5
-rw-r--r--gcc/fortran/intrinsic.h6
-rw-r--r--gcc/fortran/intrinsic.texi124
-rw-r--r--gcc/fortran/io.c3
-rw-r--r--gcc/fortran/iresolve.c32
-rw-r--r--gcc/fortran/match.c19
-rw-r--r--gcc/fortran/module.c61
-rw-r--r--gcc/fortran/options.c3
-rw-r--r--gcc/fortran/parse.c1
-rw-r--r--gcc/fortran/primary.c17
-rw-r--r--gcc/fortran/resolve.c238
-rw-r--r--gcc/fortran/scanner.c4
-rw-r--r--gcc/fortran/simplify.c20
-rw-r--r--gcc/fortran/symbol.c11
-rw-r--r--gcc/fortran/trans-array.c116
-rw-r--r--gcc/fortran/trans-decl.c319
-rw-r--r--gcc/fortran/trans-expr.c275
-rw-r--r--gcc/fortran/trans-io.c56
-rw-r--r--gcc/fortran/trans-stmt.c149
-rw-r--r--gcc/fortran/trans-types.c229
-rw-r--r--gcc/fortran/trans.c13
-rw-r--r--gcc/fortran/trans.h6
-rw-r--r--gcc/fwprop.c53
-rw-r--r--gcc/gcc.c33
-rw-r--r--gcc/gcse.c2
-rw-r--r--gcc/gimple-fold.c43
-rw-r--r--gcc/gimple-low.c16
-rw-r--r--gcc/gimple-pretty-print.c2
-rw-r--r--gcc/ginclude/stddef.h12
-rw-r--r--gcc/go/ChangeLog16
-rw-r--r--gcc/go/gccgo.texi4
-rw-r--r--gcc/go/go-c.h3
-rw-r--r--gcc/go/go-lang.c8
-rw-r--r--gcc/go/gofrontend/export.cc2
-rw-r--r--gcc/go/gofrontend/export.h4
-rw-r--r--gcc/go/gofrontend/expressions.cc358
-rw-r--r--gcc/go/gofrontend/expressions.h3
-rw-r--r--gcc/go/gofrontend/go.cc4
-rw-r--r--gcc/go/gofrontend/gogo-tree.cc49
-rw-r--r--gcc/go/gofrontend/gogo.cc80
-rw-r--r--gcc/go/gofrontend/gogo.h12
-rw-r--r--gcc/go/gofrontend/import.cc2
-rw-r--r--gcc/go/gofrontend/parse.cc27
-rw-r--r--gcc/go/gofrontend/statements.cc68
-rw-r--r--gcc/go/gofrontend/types.cc241
-rw-r--r--gcc/go/gofrontend/types.h46
-rw-r--r--gcc/go/gofrontend/unsafe.cc7
-rw-r--r--gcc/go/gospec.c6
-rw-r--r--gcc/godump.c306
-rw-r--r--gcc/graphite-dependences.c226
-rw-r--r--gcc/graphite-interchange.c16
-rw-r--r--gcc/graphite-poly.c13
-rw-r--r--gcc/graphite-poly.h3
-rw-r--r--gcc/graphite-ppl.c61
-rw-r--r--gcc/graphite-ppl.h3
-rw-r--r--gcc/graphite-scop-detection.c77
-rw-r--r--gcc/graphite-sese-to-poly.c225
-rw-r--r--gcc/gthr-dce.h2
-rw-r--r--gcc/haifa-sched.c66
-rw-r--r--gcc/hwint.h29
-rw-r--r--gcc/ipa-cp.c77
-rw-r--r--gcc/ipa-inline.c53
-rw-r--r--gcc/ipa-prop.c18
-rw-r--r--gcc/ipa-pure-const.c10
-rw-r--r--gcc/ipa-ref.c4
-rw-r--r--gcc/ipa-reference.c6
-rw-r--r--gcc/ipa-split.c33
-rw-r--r--gcc/ipa-struct-reorg.c2
-rw-r--r--gcc/ira-color.c3
-rw-r--r--gcc/ira.c18
-rw-r--r--gcc/java/ChangeLog10
-rw-r--r--gcc/java/decl.c15
-rw-r--r--gcc/java/jvspec.c4
-rw-r--r--gcc/lambda-code.c2855
-rw-r--r--gcc/lambda-mat.c608
-rw-r--r--gcc/lambda-trans.c80
-rw-r--r--gcc/lambda.h524
-rw-r--r--gcc/loop-init.c12
-rw-r--r--gcc/loop-unroll.c2
-rw-r--r--gcc/lto-cgraph.c6
-rw-r--r--gcc/lto-streamer-in.c26
-rw-r--r--gcc/lto-streamer-out.c13
-rw-r--r--gcc/lto-streamer.h1
-rw-r--r--gcc/lto-symtab.c1
-rw-r--r--gcc/lto-wrapper.c8
-rw-r--r--gcc/lto/ChangeLog22
-rw-r--r--gcc/lto/Make-lang.in2
-rw-r--r--gcc/lto/lto-lang.c1
-rw-r--r--gcc/lto/lto-tree.h3
-rw-r--r--gcc/lto/lto.c20
-rw-r--r--gcc/machmode.def14
-rw-r--r--gcc/modulo-sched.c8
-rw-r--r--gcc/objc/ChangeLog160
-rw-r--r--gcc/objc/Make-lang.in49
-rw-r--r--gcc/objc/config-lang.in6
-rw-r--r--gcc/objc/objc-act.c5808
-rw-r--r--gcc/objc/objc-act.h199
-rw-r--r--gcc/objc/objc-gnu-runtime-abi-01.c2269
-rw-r--r--gcc/objc/objc-lang.c10
-rw-r--r--gcc/objc/objc-next-metadata-tags.h172
-rw-r--r--gcc/objc/objc-next-runtime-abi-01.c2981
-rw-r--r--gcc/objc/objc-next-runtime-abi-02.c3778
-rw-r--r--gcc/objc/objc-runtime-hooks.h111
-rw-r--r--gcc/objc/objc-runtime-shared-support.c736
-rw-r--r--gcc/objc/objc-runtime-shared-support.h90
-rw-r--r--gcc/objcp/ChangeLog25
-rw-r--r--gcc/objcp/Make-lang.in54
-rw-r--r--gcc/objcp/config-lang.in5
-rw-r--r--gcc/objcp/objcp-lang.c18
-rw-r--r--gcc/omega.c18
-rw-r--r--gcc/optc-gen.awk6
-rw-r--r--gcc/opth-gen.awk9
-rw-r--r--gcc/opts-common.c27
-rw-r--r--gcc/opts.c53
-rw-r--r--gcc/output.h6
-rw-r--r--gcc/params.def5
-rw-r--r--gcc/passes.c11
-rw-r--r--gcc/po/ChangeLog12
-rw-r--r--gcc/po/ja.po3055
-rw-r--r--gcc/po/sv.po22
-rw-r--r--gcc/postreload.c16
-rw-r--r--gcc/predict.c2
-rw-r--r--gcc/recog.h5
-rw-r--r--gcc/reg-notes.def5
-rw-r--r--gcc/reload.c13
-rw-r--r--gcc/reload1.c26
-rw-r--r--gcc/rtl.h14
-rw-r--r--gcc/rtlanal.c117
-rw-r--r--gcc/sched-deps.c21
-rw-r--r--gcc/sched-ebb.c4
-rw-r--r--gcc/sched-int.h17
-rw-r--r--gcc/sched-rgn.c2
-rw-r--r--gcc/sel-sched-dump.c4
-rw-r--r--gcc/sel-sched.c9
-rw-r--r--gcc/target.def9
-rw-r--r--gcc/testsuite/ChangeLog1718
-rw-r--r--gcc/testsuite/ChangeLog-201023
-rw-r--r--gcc/testsuite/c-c++-common/pr20000.c4
-rw-r--r--gcc/testsuite/g++.dg/abi/mangle26.C2
-rw-r--r--gcc/testsuite/g++.dg/abi/mangle39.C2
-rw-r--r--gcc/testsuite/g++.dg/abi/mangle40.C2
-rw-r--r--gcc/testsuite/g++.dg/abi/mangle45.C25
-rw-r--r--gcc/testsuite/g++.dg/abi/packed1.C2
-rw-r--r--gcc/testsuite/g++.dg/conversion/op4.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/auto21.C5
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/bracket1.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/bracket2.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/bracket4.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/constexpr-array-tparm.C5
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/constexpr-ctor6.C9
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/constexpr-ctor7.C17
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/constexpr-data1.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/constexpr-data2.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/constexpr-diag2.C5
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/constexpr-ex1.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/constexpr-ex2.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/constexpr-function1.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/constexpr-function2.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/constexpr-function3.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/constexpr-object1.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/constexpr-object2.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/constexpr-stmtexpr.C8
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/constexpr-synth1.C14
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/decltype1.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/decltype2.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/decltype3.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/decltype4.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/decltype5.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/decltype6.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/enum8.C10
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/fntmpdefarg2.C14
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/implicit-trivial1.C23
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/lambda/lambda-capture-const-ref.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/lambda/lambda-const.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/lambda/lambda-conv.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/lambda/lambda-copy-default.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/lambda/lambda-copy.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/lambda/lambda-deduce.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/lambda/lambda-ice3.C23
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/lambda/lambda-ice4.C14
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/lambda/lambda-in-class.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/lambda/lambda-mixed.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/lambda/lambda-mutable.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/lambda/lambda-nested.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/lambda/lambda-non-const.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/lambda/lambda-nop.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/lambda/lambda-pass.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/lambda/lambda-recursive.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/lambda/lambda-ref-default.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/lambda/lambda-ref.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/pr38646.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/pr39639.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/pr47416.C225
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/pr47476.C10
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/range-for10.C18
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/regress/README3
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/regress/abi-empty7.C20
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/regress/debug-debug7.C19
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/regress/enum1.C8
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/regress/ext-cond1.C4
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/regress/ext-label10.C17
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/regress/no-elide1.C14
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/regress/parse-ambig5.C8
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/regress/regress1.C (renamed from gcc/testsuite/g++.dg/cpp0x/constexpr-regress1.C)0
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/regress/regress2.C13
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/regress/regress3.C13
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/regress/template-function1.C28
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/rvo.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/trailing1.C5
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/variadic-bind.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/variadic-crash2.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/variadic-function.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/variadic-mem_fn.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/variadic-new.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/variadic-new2.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/variadic-tuple.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/variadic106.C22
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/variadic20.C4
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/variadic68.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/variadic70.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/variadic73.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/vt-40092.C2
-rw-r--r--gcc/testsuite/g++.dg/debug/pr46583.C40
-rw-r--r--gcc/testsuite/g++.dg/debug/pr47106.C38
-rw-r--r--gcc/testsuite/g++.dg/debug/pr47283.C58
-rw-r--r--gcc/testsuite/g++.dg/expr/bound-mem-fun.C2
-rw-r--r--gcc/testsuite/g++.dg/expr/cond6.C2
-rw-r--r--gcc/testsuite/g++.dg/expr/stmt-expr-1.C2
-rw-r--r--gcc/testsuite/g++.dg/ext/altivec-15.C2
-rw-r--r--gcc/testsuite/g++.dg/ext/altivec-types-1.C2
-rw-r--r--gcc/testsuite/g++.dg/ext/altivec-types-2.C2
-rw-r--r--gcc/testsuite/g++.dg/ext/altivec-types-3.C2
-rw-r--r--gcc/testsuite/g++.dg/ext/altivec-types-4.C2
-rw-r--r--gcc/testsuite/g++.dg/ext/dllexport4.C54
-rw-r--r--gcc/testsuite/g++.dg/ext/dllexport4a.cc21
-rwxr-xr-xgcc/testsuite/g++.dg/ext/dllexport5.C52
-rw-r--r--gcc/testsuite/g++.dg/ext/dllexport5a.cc21
-rw-r--r--gcc/testsuite/g++.dg/ext/has_nothrow_assign.C2
-rw-r--r--gcc/testsuite/g++.dg/ext/has_nothrow_assign_odr.C2
-rw-r--r--gcc/testsuite/g++.dg/ext/has_nothrow_constructor.C2
-rw-r--r--gcc/testsuite/g++.dg/ext/has_nothrow_constructor_odr.C2
-rw-r--r--gcc/testsuite/g++.dg/ext/has_nothrow_copy-1.C2
-rw-r--r--gcc/testsuite/g++.dg/ext/has_nothrow_copy-2.C2
-rw-r--r--gcc/testsuite/g++.dg/ext/has_nothrow_copy-3.C2
-rw-r--r--gcc/testsuite/g++.dg/ext/has_nothrow_copy-4.C2
-rw-r--r--gcc/testsuite/g++.dg/ext/has_nothrow_copy-5.C2
-rw-r--r--gcc/testsuite/g++.dg/ext/has_nothrow_copy-6.C2
-rw-r--r--gcc/testsuite/g++.dg/ext/has_nothrow_copy-7.C2
-rw-r--r--gcc/testsuite/g++.dg/ext/has_nothrow_copy_odr.C2
-rw-r--r--gcc/testsuite/g++.dg/ext/has_trivial_assign.C2
-rw-r--r--gcc/testsuite/g++.dg/ext/has_trivial_constructor.C2
-rw-r--r--gcc/testsuite/g++.dg/ext/has_trivial_copy.C2
-rw-r--r--gcc/testsuite/g++.dg/ext/has_trivial_destructor-1.C2
-rw-r--r--gcc/testsuite/g++.dg/ext/has_virtual_destructor.C2
-rw-r--r--gcc/testsuite/g++.dg/ext/is_abstract.C2
-rw-r--r--gcc/testsuite/g++.dg/ext/is_base_of.C2
-rw-r--r--gcc/testsuite/g++.dg/ext/is_class.C2
-rw-r--r--gcc/testsuite/g++.dg/ext/is_empty.C2
-rw-r--r--gcc/testsuite/g++.dg/ext/is_enum.C2
-rw-r--r--gcc/testsuite/g++.dg/ext/is_pod.C2
-rw-r--r--gcc/testsuite/g++.dg/ext/is_polymorphic.C2
-rw-r--r--gcc/testsuite/g++.dg/ext/is_union.C2
-rw-r--r--gcc/testsuite/g++.dg/ext/label10.C6
-rw-r--r--gcc/testsuite/g++.dg/ext/vla1.C2
-rw-r--r--gcc/testsuite/g++.dg/inherit/covariant16.C2
-rw-r--r--gcc/testsuite/g++.dg/inherit/implicit-trivial1.C23
-rw-r--r--gcc/testsuite/g++.dg/inherit/virtual7.C27
-rw-r--r--gcc/testsuite/g++.dg/init/aggr5.C2
-rw-r--r--gcc/testsuite/g++.dg/init/brace6.C2
-rw-r--r--gcc/testsuite/g++.dg/init/error2.C2
-rw-r--r--gcc/testsuite/g++.dg/init/pr29571.C8
-rw-r--r--gcc/testsuite/g++.dg/ipa/pr43695.C20
-rw-r--r--gcc/testsuite/g++.dg/lookup/friend11.C2
-rw-r--r--gcc/testsuite/g++.dg/lto/pr47333.C944
-rw-r--r--gcc/testsuite/g++.dg/opt/devirt1.C2
-rw-r--r--gcc/testsuite/g++.dg/opt/inline17.C80
-rw-r--r--gcc/testsuite/g++.dg/opt/pr19650.C2
-rw-r--r--gcc/testsuite/g++.dg/opt/pr47355.C39
-rw-r--r--gcc/testsuite/g++.dg/opt/pr47366.C22
-rw-r--r--gcc/testsuite/g++.dg/opt/pr47615.C711
-rw-r--r--gcc/testsuite/g++.dg/opt/pr47632.C18
-rw-r--r--gcc/testsuite/g++.dg/opt/pr47639.c17
-rw-r--r--gcc/testsuite/g++.dg/other/anon5.C2
-rw-r--r--gcc/testsuite/g++.dg/other/default2.C2
-rw-r--r--gcc/testsuite/g++.dg/other/default3.C2
-rw-r--r--gcc/testsuite/g++.dg/other/default5.C2
-rw-r--r--gcc/testsuite/g++.dg/other/dtor2.C2
-rw-r--r--gcc/testsuite/g++.dg/other/friend5.C2
-rw-r--r--gcc/testsuite/g++.dg/other/pr47218.C4
-rw-r--r--gcc/testsuite/g++.dg/other/warning1.C1
-rw-r--r--gcc/testsuite/g++.dg/overload/conv-op1.C17
-rw-r--r--gcc/testsuite/g++.dg/overload/defarg4.C2
-rw-r--r--gcc/testsuite/g++.dg/parse/bitfield3.C2
-rw-r--r--gcc/testsuite/g++.dg/parse/constant1.C2
-rw-r--r--gcc/testsuite/g++.dg/parse/constant5.C2
-rw-r--r--gcc/testsuite/g++.dg/parse/constructor3.C2
-rw-r--r--gcc/testsuite/g++.dg/parse/crash31.C2
-rw-r--r--gcc/testsuite/g++.dg/parse/crash34.C2
-rw-r--r--gcc/testsuite/g++.dg/parse/crash35.C2
-rw-r--r--gcc/testsuite/g++.dg/parse/crash40.C2
-rw-r--r--gcc/testsuite/g++.dg/parse/crash56.C2
-rw-r--r--gcc/testsuite/g++.dg/parse/ctor9.C2
-rw-r--r--gcc/testsuite/g++.dg/parse/defarg12.C2
-rw-r--r--gcc/testsuite/g++.dg/parse/dtor13.C2
-rw-r--r--gcc/testsuite/g++.dg/parse/error14.C2
-rw-r--r--gcc/testsuite/g++.dg/parse/error2.C2
-rw-r--r--gcc/testsuite/g++.dg/parse/error32.C2
-rw-r--r--gcc/testsuite/g++.dg/parse/error33.C2
-rw-r--r--gcc/testsuite/g++.dg/parse/error37.C2
-rw-r--r--gcc/testsuite/g++.dg/parse/parameter-declaration-1.C2
-rw-r--r--gcc/testsuite/g++.dg/parse/semicolon3.C50
-rw-r--r--gcc/testsuite/g++.dg/parse/semicolon4.C37
-rw-r--r--gcc/testsuite/g++.dg/parse/struct-4.C2
-rw-r--r--gcc/testsuite/g++.dg/parse/template23.C2
-rw-r--r--gcc/testsuite/g++.dg/pr46868.C4
-rw-r--r--gcc/testsuite/g++.dg/pr46890.C6
-rw-r--r--gcc/testsuite/g++.dg/pr47053.C22
-rw-r--r--gcc/testsuite/g++.dg/pr47589.C26
-rw-r--r--gcc/testsuite/g++.dg/template/access19.C2
-rw-r--r--gcc/testsuite/g++.dg/template/call7.C2
-rw-r--r--gcc/testsuite/g++.dg/template/canon-type-1.C2
-rw-r--r--gcc/testsuite/g++.dg/template/canon-type-10.C2
-rw-r--r--gcc/testsuite/g++.dg/template/canon-type-11.C2
-rw-r--r--gcc/testsuite/g++.dg/template/canon-type-12.C2
-rw-r--r--gcc/testsuite/g++.dg/template/canon-type-13.C2
-rw-r--r--gcc/testsuite/g++.dg/template/canon-type-2.C2
-rw-r--r--gcc/testsuite/g++.dg/template/canon-type-3.C2
-rw-r--r--gcc/testsuite/g++.dg/template/canon-type-4.C2
-rw-r--r--gcc/testsuite/g++.dg/template/canon-type-5.C2
-rw-r--r--gcc/testsuite/g++.dg/template/canon-type-6.C2
-rw-r--r--gcc/testsuite/g++.dg/template/canon-type-7.C2
-rw-r--r--gcc/testsuite/g++.dg/template/canon-type-9.C4
-rw-r--r--gcc/testsuite/g++.dg/template/char1.C2
-rw-r--r--gcc/testsuite/g++.dg/template/const3.C2
-rw-r--r--gcc/testsuite/g++.dg/template/crash105.C14
-rw-r--r--gcc/testsuite/g++.dg/template/crash14.C2
-rw-r--r--gcc/testsuite/g++.dg/template/for1.C23
-rw-r--r--gcc/testsuite/g++.dg/template/function1.C8
-rw-r--r--gcc/testsuite/g++.dg/template/inherit6.C23
-rw-r--r--gcc/testsuite/g++.dg/template/init7.C2
-rw-r--r--gcc/testsuite/g++.dg/template/instantiate9.C2
-rw-r--r--gcc/testsuite/g++.dg/template/local4.C3
-rw-r--r--gcc/testsuite/g++.dg/template/nontype3.C1
-rw-r--r--gcc/testsuite/g++.dg/template/param1.C4
-rw-r--r--gcc/testsuite/g++.dg/template/param2.C8
-rw-r--r--gcc/testsuite/g++.dg/template/ref3.C4
-rw-r--r--gcc/testsuite/g++.dg/template/sfinae26.C2
-rw-r--r--gcc/testsuite/g++.dg/template/sizeof-template-argument.C2
-rw-r--r--gcc/testsuite/g++.dg/template/spec36.C2
-rw-r--r--gcc/testsuite/g++.dg/template/static9.C2
-rw-r--r--gcc/testsuite/g++.dg/template/ttp22.C2
-rw-r--r--gcc/testsuite/g++.dg/template/typedef37.C58
-rw-r--r--gcc/testsuite/g++.dg/template/typedef38.C27
-rw-r--r--gcc/testsuite/g++.dg/template/union2.C2
-rw-r--r--gcc/testsuite/g++.dg/torture/pr47382.C30
-rw-r--r--gcc/testsuite/g++.dg/torture/pr47541.C27
-rw-r--r--gcc/testsuite/g++.dg/torture/pr47559.C8
-rw-r--r--gcc/testsuite/g++.dg/tree-prof/partition1.C1
-rw-r--r--gcc/testsuite/g++.dg/tree-prof/partition2.C1
-rw-r--r--gcc/testsuite/g++.dg/tree-prof/partition3.C18
-rw-r--r--gcc/testsuite/g++.dg/tree-prof/tree-prof.exp2
-rw-r--r--gcc/testsuite/g++.dg/tree-ssa/inline-3.C8
-rw-r--r--gcc/testsuite/g++.dg/tree-ssa/pr47707.C29
-rw-r--r--gcc/testsuite/g++.dg/warn/Walways-true-1.C2
-rw-r--r--gcc/testsuite/g++.dg/warn/Walways-true-2.C2
-rw-r--r--gcc/testsuite/g++.dg/warn/Wlogical-op-1.C2
-rw-r--r--gcc/testsuite/g++.dg/warn/Wreturn-type-6.C2
-rw-r--r--gcc/testsuite/g++.dg/warn/Wuninitialized-5.C4
-rw-r--r--gcc/testsuite/g++.dg/warn/Wunused-parm-4.C24
-rw-r--r--gcc/testsuite/g++.old-deja/g++.bugs/900119_01.C2
-rw-r--r--gcc/testsuite/g++.old-deja/g++.gb/scope06.C2
-rw-r--r--gcc/testsuite/g++.old-deja/g++.law/cvt11.C4
-rw-r--r--gcc/testsuite/g++.old-deja/g++.law/init1.C1
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/crash41.C2
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/20110126-1.c18
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/20110131-1.c38
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/pr46002.c10
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/pr46856.c26
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/pr47265.c20
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/pr47427.c28
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/pr47428.c42
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/pr47237.c22
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/pr47538.c73
-rw-r--r--gcc/testsuite/gcc.dg/Walways-true-1.c2
-rw-r--r--gcc/testsuite/gcc.dg/Walways-true-2.c2
-rw-r--r--gcc/testsuite/gcc.dg/Wlogical-op-1.c2
-rw-r--r--gcc/testsuite/gcc.dg/attr-alias-5.c1
-rw-r--r--gcc/testsuite/gcc.dg/attr-weak-hidden-1.c2
-rw-r--r--gcc/testsuite/gcc.dg/attr-weakref-3.c3
-rw-r--r--gcc/testsuite/gcc.dg/attr-weakref-4.c4
-rw-r--r--gcc/testsuite/gcc.dg/autopar/outer-2.c2
-rw-r--r--gcc/testsuite/gcc.dg/autopar/pr46194.c24
-rw-r--r--gcc/testsuite/gcc.dg/builtins-config.h4
-rw-r--r--gcc/testsuite/gcc.dg/cpp/include7.c3
-rw-r--r--gcc/testsuite/gcc.dg/debug/pr47498.c11
-rw-r--r--gcc/testsuite/gcc.dg/debug/pr47501.c11
-rw-r--r--gcc/testsuite/gcc.dg/dll-10.c54
-rw-r--r--gcc/testsuite/gcc.dg/dll-10a.c21
-rw-r--r--gcc/testsuite/gcc.dg/dll-11.c52
-rw-r--r--gcc/testsuite/gcc.dg/dll-11a.c21
-rw-r--r--gcc/testsuite/gcc.dg/dll-12.c52
-rw-r--r--gcc/testsuite/gcc.dg/dll-12a.c21
-rw-r--r--gcc/testsuite/gcc.dg/dll-9.c54
-rw-r--r--gcc/testsuite/gcc.dg/dll-9a.c21
-rw-r--r--gcc/testsuite/gcc.dg/graphite/block-0.c3
-rw-r--r--gcc/testsuite/gcc.dg/graphite/block-1.c5
-rw-r--r--gcc/testsuite/gcc.dg/graphite/block-4.c2
-rw-r--r--gcc/testsuite/gcc.dg/graphite/block-7.c3
-rw-r--r--gcc/testsuite/gcc.dg/graphite/block-8.c58
-rw-r--r--gcc/testsuite/gcc.dg/graphite/graphite.exp2
-rw-r--r--gcc/testsuite/gcc.dg/graphite/id-pr46834.c12
-rw-r--r--gcc/testsuite/gcc.dg/graphite/interchange-1.c4
-rw-r--r--gcc/testsuite/gcc.dg/graphite/interchange-11.c3
-rw-r--r--gcc/testsuite/gcc.dg/graphite/interchange-12.c3
-rw-r--r--gcc/testsuite/gcc.dg/graphite/interchange-13.c54
-rw-r--r--gcc/testsuite/gcc.dg/graphite/interchange-14.c58
-rw-r--r--gcc/testsuite/gcc.dg/graphite/interchange-15.c53
-rw-r--r--gcc/testsuite/gcc.dg/graphite/interchange-8.c5
-rw-r--r--gcc/testsuite/gcc.dg/graphite/interchange-mvt.c3
-rw-r--r--gcc/testsuite/gcc.dg/graphite/pr18792.c (renamed from gcc/testsuite/gcc.dg/pr18792.c)0
-rw-r--r--gcc/testsuite/gcc.dg/graphite/pr19910.c (renamed from gcc/testsuite/gcc.dg/pr19910.c)0
-rw-r--r--gcc/testsuite/gcc.dg/graphite/pr20041110-1.c (renamed from gcc/testsuite/gcc.dg/tree-ssa/20041110-1.c)0
-rw-r--r--gcc/testsuite/gcc.dg/graphite/pr20256.c (renamed from gcc/testsuite/gcc.dg/tree-ssa/pr20256.c)7
-rw-r--r--gcc/testsuite/gcc.dg/graphite/pr23625.c (renamed from gcc/testsuite/gcc.dg/pr23625.c)0
-rw-r--r--gcc/testsuite/gcc.dg/graphite/pr23820.c (renamed from gcc/testsuite/gcc.dg/tree-ssa/pr23820.c)0
-rw-r--r--gcc/testsuite/gcc.dg/graphite/pr24309.c (renamed from gcc/testsuite/gcc.dg/tree-ssa/pr24309.c)0
-rw-r--r--gcc/testsuite/gcc.dg/graphite/pr26435.c (renamed from gcc/testsuite/gcc.dg/tree-ssa/pr26435.c)7
-rw-r--r--gcc/testsuite/gcc.dg/graphite/pr29330.c (renamed from gcc/testsuite/gcc.dg/pr29330.c)0
-rw-r--r--gcc/testsuite/gcc.dg/graphite/pr29581-1.c (renamed from gcc/testsuite/gcc.dg/pr29581-1.c)0
-rw-r--r--gcc/testsuite/gcc.dg/graphite/pr29581-2.c (renamed from gcc/testsuite/gcc.dg/pr29581-2.c)0
-rw-r--r--gcc/testsuite/gcc.dg/graphite/pr29581-3.c (renamed from gcc/testsuite/gcc.dg/pr29581-3.c)0
-rw-r--r--gcc/testsuite/gcc.dg/graphite/pr29581-4.c (renamed from gcc/testsuite/gcc.dg/pr29581-4.c)0
-rw-r--r--gcc/testsuite/gcc.dg/graphite/pr30565.c (renamed from gcc/testsuite/gcc.dg/tree-ssa/loop-27.c)0
-rw-r--r--gcc/testsuite/gcc.dg/graphite/pr31183.c (renamed from gcc/testsuite/gcc.dg/tree-ssa/pr31183.c)0
-rw-r--r--gcc/testsuite/gcc.dg/graphite/pr33576.c (renamed from gcc/testsuite/gcc.dg/tree-ssa/pr33576.c)0
-rw-r--r--gcc/testsuite/gcc.dg/graphite/pr33766.c (renamed from gcc/testsuite/gcc.dg/tree-ssa/pr33766.c)0
-rw-r--r--gcc/testsuite/gcc.dg/graphite/pr34016.c (renamed from gcc/testsuite/gcc.dg/pr34016.c)0
-rw-r--r--gcc/testsuite/gcc.dg/graphite/pr34017.c (renamed from gcc/testsuite/gcc.dg/tree-ssa/pr34017.c)0
-rw-r--r--gcc/testsuite/gcc.dg/graphite/pr34123.c (renamed from gcc/testsuite/gcc.dg/tree-ssa/pr34123.c)0
-rw-r--r--gcc/testsuite/gcc.dg/graphite/pr35356-2.c4
-rw-r--r--gcc/testsuite/gcc.dg/graphite/pr36287.c (renamed from gcc/testsuite/gcc.dg/tree-ssa/pr36287.c)0
-rw-r--r--gcc/testsuite/gcc.dg/graphite/pr37686.c (renamed from gcc/testsuite/gcc.dg/tree-ssa/pr37686.c)0
-rw-r--r--gcc/testsuite/gcc.dg/graphite/pr42917.c13
-rw-r--r--gcc/testsuite/gcc.dg/graphite/pr43567.c26
-rw-r--r--gcc/testsuite/gcc.dg/graphite/pr43657.c52
-rw-r--r--gcc/testsuite/gcc.dg/graphite/pr46168.c15
-rw-r--r--gcc/testsuite/gcc.dg/graphite/pr46215.c12
-rw-r--r--gcc/testsuite/gcc.dg/graphite/pr46970.c28
-rw-r--r--gcc/testsuite/gcc.dg/guality/pr41353-1.c2
-rw-r--r--gcc/testsuite/gcc.dg/guality/pr41353-2.c2
-rw-r--r--gcc/testsuite/gcc.dg/lto/20110201-1_0.c19
-rw-r--r--gcc/testsuite/gcc.dg/noreturn-1.c2
-rw-r--r--gcc/testsuite/gcc.dg/opts-6.c6
-rw-r--r--gcc/testsuite/gcc.dg/parse-error-3.c2
-rw-r--r--gcc/testsuite/gcc.dg/pr23200.c22
-rw-r--r--gcc/testsuite/gcc.dg/pr24225.c2
-rw-r--r--gcc/testsuite/gcc.dg/pr31490-2.c7
-rw-r--r--gcc/testsuite/gcc.dg/pr31490-3.c7
-rw-r--r--gcc/testsuite/gcc.dg/pr31490-4.c10
-rw-r--r--gcc/testsuite/gcc.dg/pr39666-2.c4
-rw-r--r--gcc/testsuite/gcc.dg/pr41619.c14
-rw-r--r--gcc/testsuite/gcc.dg/pr42917.c16
-rw-r--r--gcc/testsuite/gcc.dg/pr43082.c10
-rw-r--r--gcc/testsuite/gcc.dg/pr46130-1.c23
-rw-r--r--gcc/testsuite/gcc.dg/pr46130-2.c32
-rw-r--r--gcc/testsuite/gcc.dg/pr46494.c9
-rw-r--r--gcc/testsuite/gcc.dg/pr46620.c76
-rw-r--r--gcc/testsuite/gcc.dg/pr46878-1.c30
-rw-r--r--gcc/testsuite/gcc.dg/pr46909.c9
-rw-r--r--gcc/testsuite/gcc.dg/pr47276.c1
-rw-r--r--gcc/testsuite/gcc.dg/pr47391.c22
-rw-r--r--gcc/testsuite/gcc.dg/pr47443.c14
-rw-r--r--gcc/testsuite/gcc.dg/pr47555.c36
-rw-r--r--gcc/testsuite/gcc.dg/pr47610.c8
-rw-r--r--gcc/testsuite/gcc.dg/pr47684.c20
-rw-r--r--gcc/testsuite/gcc.dg/pr47763.c9
-rw-r--r--gcc/testsuite/gcc.dg/struct-parse-2.c2
-rw-r--r--gcc/testsuite/gcc.dg/tls/pr42894.c12
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr47228.c31
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr47365.c39
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr47370.c27
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr47411.c42
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr47426-1.c23
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr47426-2.c19
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr47473.c14
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr47621.c14
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr47677.c34
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr47743.c22
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/data-dep-1.c28
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/foldcast-1.c2
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/foldconst-2.c6
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/ifc-pr47271.c49
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/inline-7.c9
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/ldist-pr45948.c2
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/ltrans-1.c24
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/ltrans-2.c26
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/ltrans-3.c22
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/ltrans-4.c21
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/ltrans-5.c18
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/ltrans-6.c22
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/ltrans-8.c15
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/pr42585.c7
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/pr42893.c30
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/pr45122.c50
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/pr47392.c42
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/struct-aliasing-1.c2
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/struct-aliasing-2.c2
-rw-r--r--gcc/testsuite/gcc.dg/ucnid-10.c1
-rw-r--r--gcc/testsuite/gcc.dg/ucnid-13.c1
-rw-r--r--gcc/testsuite/gcc.dg/ucnid-7.c1
-rw-r--r--gcc/testsuite/gcc.dg/ucnid-8.c3
-rw-r--r--gcc/testsuite/gcc.dg/uninit-pr19430.c4
-rw-r--r--gcc/testsuite/gcc.dg/vect/costmodel/spu/costmodel-vect-33.c9
-rw-r--r--gcc/testsuite/gcc.dg/vect/costmodel/spu/costmodel-vect-76a.c2
-rw-r--r--gcc/testsuite/gcc.dg/vect/costmodel/spu/costmodel-vect-76c.c2
-rw-r--r--gcc/testsuite/gcc.target/arm/neon-thumb2-move.c1
-rw-r--r--gcc/testsuite/gcc.target/arm/pr45701-1.c24
-rw-r--r--gcc/testsuite/gcc.target/arm/pr45701-2.c26
-rw-r--r--gcc/testsuite/gcc.target/arm/pr45701-3.c27
-rw-r--r--gcc/testsuite/gcc.target/i386/asm-6.c17
-rw-r--r--gcc/testsuite/gcc.target/i386/headmerge-1.c2
-rw-r--r--gcc/testsuite/gcc.target/i386/headmerge-2.c2
-rw-r--r--gcc/testsuite/gcc.target/i386/parity-1.c2
-rw-r--r--gcc/testsuite/gcc.target/i386/parity-2.c2
-rw-r--r--gcc/testsuite/gcc.target/i386/pr31167.c2
-rw-r--r--gcc/testsuite/gcc.target/i386/pr32280-1.c2
-rw-r--r--gcc/testsuite/gcc.target/i386/pr38240.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/pr43653.c14
-rw-r--r--gcc/testsuite/gcc.target/i386/pr46178.c13
-rw-r--r--gcc/testsuite/gcc.target/i386/pr47312.c25
-rw-r--r--gcc/testsuite/gcc.target/i386/pr47564.c42
-rw-r--r--gcc/testsuite/gcc.target/i386/pr47581.c10
-rw-r--r--gcc/testsuite/gcc.target/i386/pr47665.c11
-rw-r--r--gcc/testsuite/gcc.target/i386/pr47780.c14
-rw-r--r--gcc/testsuite/gcc.target/i386/pr47800.c15
-rw-r--r--gcc/testsuite/gcc.target/i386/pr47809.c13
-rw-r--r--gcc/testsuite/gcc.target/i386/vecinit-1.c2
-rw-r--r--gcc/testsuite/gcc.target/i386/vecinit-2.c2
-rw-r--r--gcc/testsuite/gcc.target/mips/save-restore-1.c1
-rw-r--r--gcc/testsuite/gcc.target/mips/save-restore-3.c1
-rw-r--r--gcc/testsuite/gcc.target/mips/save-restore-4.c1
-rw-r--r--gcc/testsuite/gcc.target/mips/save-restore-5.c1
-rw-r--r--gcc/testsuite/gcc.target/powerpc/altivec-11.c2
-rw-r--r--gcc/testsuite/gcc.target/powerpc/altivec-14.c2
-rw-r--r--gcc/testsuite/gcc.target/powerpc/altivec-33.c2
-rw-r--r--gcc/testsuite/gcc.target/powerpc/altivec-types-1.c2
-rw-r--r--gcc/testsuite/gcc.target/powerpc/altivec-types-2.c2
-rw-r--r--gcc/testsuite/gcc.target/powerpc/altivec-types-3.c2
-rw-r--r--gcc/testsuite/gcc.target/powerpc/altivec-types-4.c2
-rw-r--r--gcc/testsuite/gcc.target/powerpc/avoid-indexed-addresses.c2
-rw-r--r--gcc/testsuite/gcc.target/powerpc/ppc-vector-memcpy.c2
-rw-r--r--gcc/testsuite/gcc.target/powerpc/ppc-vector-memset.c2
-rw-r--r--gcc/testsuite/gcc.target/powerpc/ppc32-abi-dfp-1.c184
-rw-r--r--gcc/testsuite/gcc.target/powerpc/ppc64-abi-dfp-1.c325
-rw-r--r--gcc/testsuite/gcc.target/powerpc/pr47251.c8
-rw-r--r--gcc/testsuite/gcc.target/powerpc/pr47755.c16
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vsx-builtin-8.c97
-rw-r--r--gcc/testsuite/gcc.target/rx/builtins.c27
-rw-r--r--gcc/testsuite/gfortran.dg/Wall.f902
-rw-r--r--gcc/testsuite/gfortran.dg/abstract_type_1.f902
-rw-r--r--gcc/testsuite/gfortran.dg/abstract_type_2.f032
-rw-r--r--gcc/testsuite/gfortran.dg/abstract_type_3.f032
-rw-r--r--gcc/testsuite/gfortran.dg/abstract_type_4.f032
-rw-r--r--gcc/testsuite/gfortran.dg/abstract_type_5.f032
-rw-r--r--gcc/testsuite/gfortran.dg/abstract_type_6.f032
-rw-r--r--gcc/testsuite/gfortran.dg/alloc_comp_constraint_1.f902
-rw-r--r--gcc/testsuite/gfortran.dg/alloc_comp_constraint_6.f902
-rw-r--r--gcc/testsuite/gfortran.dg/alloc_comp_init_expr.f032
-rw-r--r--gcc/testsuite/gfortran.dg/allocatable_function_5.f9048
-rw-r--r--gcc/testsuite/gfortran.dg/allocatable_scalar_11.f902
-rw-r--r--gcc/testsuite/gfortran.dg/allocatable_scalar_12.f9030
-rw-r--r--gcc/testsuite/gfortran.dg/allocate_deferred_char_scalar_1.f03267
-rw-r--r--gcc/testsuite/gfortran.dg/allocate_deferred_char_scalar_2.f0321
-rw-r--r--gcc/testsuite/gfortran.dg/allocate_derived_1.f9027
-rw-r--r--gcc/testsuite/gfortran.dg/allocate_scalar_with_shape.f902
-rw-r--r--gcc/testsuite/gfortran.dg/allocate_with_source_1.f9029
-rw-r--r--gcc/testsuite/gfortran.dg/argument_checking_13.f906
-rw-r--r--gcc/testsuite/gfortran.dg/argument_checking_15.f904
-rw-r--r--gcc/testsuite/gfortran.dg/argument_checking_17.f9026
-rw-r--r--gcc/testsuite/gfortran.dg/argument_checking_18.f9034
-rw-r--r--gcc/testsuite/gfortran.dg/argument_checking_3.f906
-rw-r--r--gcc/testsuite/gfortran.dg/argument_checking_6.f902
-rw-r--r--gcc/testsuite/gfortran.dg/array_constructor_33.f901
-rw-r--r--gcc/testsuite/gfortran.dg/array_constructor_36.f9021
-rw-r--r--gcc/testsuite/gfortran.dg/array_function_5.f902
-rw-r--r--gcc/testsuite/gfortran.dg/asynchronous_3.f032
-rw-r--r--gcc/testsuite/gfortran.dg/auto_dealloc_2.f9029
-rw-r--r--gcc/testsuite/gfortran.dg/bessel_6.f905
-rw-r--r--gcc/testsuite/gfortran.dg/bessel_7.f905
-rw-r--r--gcc/testsuite/gfortran.dg/bounds_check_10.f902
-rw-r--r--gcc/testsuite/gfortran.dg/bounds_temporaries_1.f902
-rw-r--r--gcc/testsuite/gfortran.dg/c_loc_tests_16.f9025
-rw-r--r--gcc/testsuite/gfortran.dg/char4_iunit_1.f034
-rw-r--r--gcc/testsuite/gfortran.dg/char_expr_1.f902
-rw-r--r--gcc/testsuite/gfortran.dg/class_14.f032
-rw-r--r--gcc/testsuite/gfortran.dg/class_30.f904
-rw-r--r--gcc/testsuite/gfortran.dg/class_36.f0314
-rw-r--r--gcc/testsuite/gfortran.dg/class_37.f03263
-rw-r--r--gcc/testsuite/gfortran.dg/class_38.f0322
-rw-r--r--gcc/testsuite/gfortran.dg/class_39.f0313
-rw-r--r--gcc/testsuite/gfortran.dg/class_40.f0336
-rw-r--r--gcc/testsuite/gfortran.dg/class_7.f033
-rw-r--r--gcc/testsuite/gfortran.dg/coarray_14.f902
-rw-r--r--gcc/testsuite/gfortran.dg/complex_intrinsic_5.f902
-rw-r--r--gcc/testsuite/gfortran.dg/continuation_1.f902
-rw-r--r--gcc/testsuite/gfortran.dg/continuation_9.f906
-rw-r--r--gcc/testsuite/gfortran.dg/count_init_expr.f032
-rw-r--r--gcc/testsuite/gfortran.dg/cray_pointers_2.f906
-rw-r--r--gcc/testsuite/gfortran.dg/data_array_6.f2
-rw-r--r--gcc/testsuite/gfortran.dg/data_invalid.f902
-rw-r--r--gcc/testsuite/gfortran.dg/deferred_type_param_2.f906
-rw-r--r--gcc/testsuite/gfortran.dg/derived_constructor_comps_4.f9018
-rw-r--r--gcc/testsuite/gfortran.dg/do_check_5.f904
-rw-r--r--gcc/testsuite/gfortran.dg/dot_product_1.f032
-rw-r--r--gcc/testsuite/gfortran.dg/entry_17.f904
-rw-r--r--gcc/testsuite/gfortran.dg/entry_19.f902
-rw-r--r--gcc/testsuite/gfortran.dg/erf_2.F907
-rw-r--r--gcc/testsuite/gfortran.dg/extends_11.f0341
-rw-r--r--gcc/testsuite/gfortran.dg/fmt_error.f902
-rw-r--r--gcc/testsuite/gfortran.dg/fmt_f0_1.f9057
-rw-r--r--gcc/testsuite/gfortran.dg/fmt_g.f43
-rw-r--r--gcc/testsuite/gfortran.dg/fmt_read_2.f904
-rw-r--r--gcc/testsuite/gfortran.dg/func_derived_5.f902
-rw-r--r--gcc/testsuite/gfortran.dg/func_result_4.f902
-rw-r--r--gcc/testsuite/gfortran.dg/func_result_6.f9073
-rw-r--r--gcc/testsuite/gfortran.dg/g77/12632.f2
-rw-r--r--gcc/testsuite/gfortran.dg/g77/970625-2.f2
-rw-r--r--gcc/testsuite/gfortran.dg/g77/980615-0.f2
-rw-r--r--gcc/testsuite/gfortran.dg/generic_actual_arg.f902
-rw-r--r--gcc/testsuite/gfortran.dg/global_references_1.f902
-rw-r--r--gcc/testsuite/gfortran.dg/gomp/pr43711.f904
-rw-r--r--gcc/testsuite/gfortran.dg/goto_8.f904
-rw-r--r--gcc/testsuite/gfortran.dg/graphite/graphite.exp6
-rw-r--r--gcc/testsuite/gfortran.dg/graphite/id-23.f13
-rw-r--r--gcc/testsuite/gfortran.dg/graphite/id-24.f9
-rw-r--r--gcc/testsuite/gfortran.dg/graphite/id-25.f10
-rw-r--r--gcc/testsuite/gfortran.dg/graphite/id-pr46994.f9014
-rw-r--r--gcc/testsuite/gfortran.dg/graphite/id-pr46995.f9016
-rw-r--r--gcc/testsuite/gfortran.dg/graphite/interchange-3.f902
-rw-r--r--gcc/testsuite/gfortran.dg/graphite/interchange-4.f29
-rw-r--r--gcc/testsuite/gfortran.dg/graphite/interchange-5.f30
-rw-r--r--gcc/testsuite/gfortran.dg/graphite/pr29290.f90 (renamed from gcc/testsuite/gfortran.dg/loop_nest_1.f90)0
-rw-r--r--gcc/testsuite/gfortran.dg/graphite/pr29581.f90 (renamed from gcc/testsuite/gfortran.dg/pr29581.f90)0
-rw-r--r--gcc/testsuite/gfortran.dg/graphite/pr29832.f9026
-rw-r--r--gcc/testsuite/gfortran.dg/graphite/pr36286.f90 (renamed from gcc/testsuite/gfortran.dg/pr36286.f90)0
-rw-r--r--gcc/testsuite/gfortran.dg/graphite/pr36922.f (renamed from gcc/testsuite/gfortran.dg/pr36922.f)0
-rw-r--r--gcc/testsuite/gfortran.dg/graphite/pr39516.f (renamed from gcc/testsuite/gfortran.dg/pr39516.f)0
-rw-r--r--gcc/testsuite/gfortran.dg/graphite/vect-pr40979.f9026
-rw-r--r--gcc/testsuite/gfortran.dg/implied_do_1.f902
-rw-r--r--gcc/testsuite/gfortran.dg/initialization_1.f902
-rw-r--r--gcc/testsuite/gfortran.dg/initialization_25.f902
-rw-r--r--gcc/testsuite/gfortran.dg/initialization_26.f902
-rw-r--r--gcc/testsuite/gfortran.dg/inquire_14.f9013
-rw-r--r--gcc/testsuite/gfortran.dg/interface_34.f9033
-rw-r--r--gcc/testsuite/gfortran.dg/io_constraints_1.f904
-rw-r--r--gcc/testsuite/gfortran.dg/io_constraints_2.f902
-rw-r--r--gcc/testsuite/gfortran.dg/io_constraints_3.f908
-rw-r--r--gcc/testsuite/gfortran.dg/iostat_3.f904
-rw-r--r--gcc/testsuite/gfortran.dg/iso_c_binding_init_expr.f032
-rw-r--r--gcc/testsuite/gfortran.dg/keyword_symbol_1.f902
-rw-r--r--gcc/testsuite/gfortran.dg/large_real_kind_1.f902
-rw-r--r--gcc/testsuite/gfortran.dg/lto/20091016-1_0.f902
-rw-r--r--gcc/testsuite/gfortran.dg/lto/pr45586_0.f9029
-rw-r--r--gcc/testsuite/gfortran.dg/lto/pr47839_0.f908
-rw-r--r--gcc/testsuite/gfortran.dg/lto/pr47839_1.f907
-rw-r--r--gcc/testsuite/gfortran.dg/ltrans-7.f9031
-rw-r--r--gcc/testsuite/gfortran.dg/matmul_8.f032
-rw-r--r--gcc/testsuite/gfortran.dg/merge_init_expr.f902
-rw-r--r--gcc/testsuite/gfortran.dg/module_nan.f902
-rw-r--r--gcc/testsuite/gfortran.dg/namelist_3.f903
-rw-r--r--gcc/testsuite/gfortran.dg/namelist_34.f904
-rw-r--r--gcc/testsuite/gfortran.dg/namelist_35.f902
-rw-r--r--gcc/testsuite/gfortran.dg/namelist_5.f906
-rw-r--r--gcc/testsuite/gfortran.dg/namelist_63.f902
-rw-r--r--gcc/testsuite/gfortran.dg/namelist_69.f90233
-rw-r--r--gcc/testsuite/gfortran.dg/namelist_70.f90442
-rw-r--r--gcc/testsuite/gfortran.dg/namelist_assumed_char.f9015
-rw-r--r--gcc/testsuite/gfortran.dg/nan_7.f9015
-rw-r--r--gcc/testsuite/gfortran.dg/nested_allocatables_1.f9028
-rw-r--r--gcc/testsuite/gfortran.dg/pack_assign_1.f902
-rw-r--r--gcc/testsuite/gfortran.dg/pack_vector_1.f902
-rw-r--r--gcc/testsuite/gfortran.dg/pointer_check_8.f902
-rw-r--r--gcc/testsuite/gfortran.dg/pointer_init_6.f9039
-rw-r--r--gcc/testsuite/gfortran.dg/pointer_target_4.f9015
-rw-r--r--gcc/testsuite/gfortran.dg/pr25923.f904
-rw-r--r--gcc/testsuite/gfortran.dg/pr39666-2.f904
-rw-r--r--gcc/testsuite/gfortran.dg/pr47574.f9036
-rw-r--r--gcc/testsuite/gfortran.dg/pr47614.f37
-rw-r--r--gcc/testsuite/gfortran.dg/pr47757-1.f9040
-rw-r--r--gcc/testsuite/gfortran.dg/pr47757-2.f9016
-rw-r--r--gcc/testsuite/gfortran.dg/pr47757-3.f9012
-rw-r--r--gcc/testsuite/gfortran.dg/pr47878.f9010
-rw-r--r--gcc/testsuite/gfortran.dg/proc_decl_25.f9022
-rw-r--r--gcc/testsuite/gfortran.dg/proc_ptr_comp_30.f9015
-rw-r--r--gcc/testsuite/gfortran.dg/product_init_expr.f032
-rw-r--r--gcc/testsuite/gfortran.dg/public_private_module.f904
-rw-r--r--gcc/testsuite/gfortran.dg/pure_formal_1.f9016
-rw-r--r--gcc/testsuite/gfortran.dg/pure_formal_2.f9018
-rw-r--r--gcc/testsuite/gfortran.dg/read_infnan_1.f904
-rw-r--r--gcc/testsuite/gfortran.dg/real_const_3.f906
-rw-r--r--gcc/testsuite/gfortran.dg/realloc_on_assign_2.f031
-rw-r--r--gcc/testsuite/gfortran.dg/realloc_on_assign_3.f0388
-rw-r--r--gcc/testsuite/gfortran.dg/realloc_on_assign_4.f0350
-rw-r--r--gcc/testsuite/gfortran.dg/realloc_on_assign_5.f0318
-rw-r--r--gcc/testsuite/gfortran.dg/redefined_intrinsic_assignment_2.f9068
-rw-r--r--gcc/testsuite/gfortran.dg/reshape_order_5.f902
-rw-r--r--gcc/testsuite/gfortran.dg/reshape_shape_1.f902
-rw-r--r--gcc/testsuite/gfortran.dg/reshape_zerosize_2.f902
-rw-r--r--gcc/testsuite/gfortran.dg/same_name_2.f902
-rw-r--r--gcc/testsuite/gfortran.dg/select_type_22.f0317
-rw-r--r--gcc/testsuite/gfortran.dg/selected_real_kind_1.f902
-rw-r--r--gcc/testsuite/gfortran.dg/shape_6.f9029
-rw-r--r--gcc/testsuite/gfortran.dg/spread_init_expr.f032
-rw-r--r--gcc/testsuite/gfortran.dg/stmt_func_1.f9012
-rw-r--r--gcc/testsuite/gfortran.dg/sum_init_expr.f036
-rw-r--r--gcc/testsuite/gfortran.dg/transpose_3.f032
-rw-r--r--gcc/testsuite/gfortran.dg/transpose_optimization_2.f901
-rw-r--r--gcc/testsuite/gfortran.dg/typebound_assignment_1.f0335
-rw-r--r--gcc/testsuite/gfortran.dg/typebound_assignment_2.f0339
-rw-r--r--gcc/testsuite/gfortran.dg/typebound_call_19.f0351
-rw-r--r--gcc/testsuite/gfortran.dg/typebound_call_20.f0341
-rw-r--r--gcc/testsuite/gfortran.dg/typebound_proc_13.f039
-rw-r--r--gcc/testsuite/gfortran.dg/typebound_proc_19.f9043
-rw-r--r--gcc/testsuite/gfortran.dg/typebound_proc_20.f9068
-rw-r--r--gcc/testsuite/gfortran.dg/typebound_proc_21.f9027
-rw-r--r--gcc/testsuite/gfortran.dg/unpack_init_expr.f032
-rw-r--r--gcc/testsuite/gfortran.dg/vect/fast-math-pr38968.f902
-rw-r--r--gcc/testsuite/gfortran.dg/vect/fast-math-vect-8.f903
-rw-r--r--gcc/testsuite/gfortran.dg/volatile3.f902
-rw-r--r--gcc/testsuite/gfortran.dg/warn_conversion.f902
-rw-r--r--gcc/testsuite/gfortran.dg/warn_conversion_2.f902
-rw-r--r--gcc/testsuite/gfortran.dg/warn_intent_out_not_set.f902
-rw-r--r--gcc/testsuite/gfortran.dg/warn_unused_dummy_argument_1.f902
-rw-r--r--gcc/testsuite/gfortran.dg/warn_unused_dummy_argument_2.f902
-rw-r--r--gcc/testsuite/gfortran.dg/warning-directive-2.F902
-rw-r--r--gcc/testsuite/gfortran.dg/warnings_are_errors_1.f2
-rw-r--r--gcc/testsuite/gfortran.dg/whole_file_1.f904
-rw-r--r--gcc/testsuite/gfortran.dg/whole_file_16.f902
-rw-r--r--gcc/testsuite/gfortran.dg/whole_file_17.f902
-rw-r--r--gcc/testsuite/gfortran.dg/whole_file_18.f902
-rw-r--r--gcc/testsuite/gfortran.dg/whole_file_2.f904
-rw-r--r--gcc/testsuite/gfortran.dg/whole_file_20.f032
-rw-r--r--gcc/testsuite/gfortran.dg/whole_file_28.f9012
-rw-r--r--gcc/testsuite/gfortran.dg/whole_file_29.f9027
-rw-r--r--gcc/testsuite/gfortran.dg/whole_file_3.f904
-rw-r--r--gcc/testsuite/gfortran.dg/whole_file_30.f9015
-rw-r--r--gcc/testsuite/gfortran.dg/whole_file_31.f9021
-rw-r--r--gcc/testsuite/gfortran.dg/whole_file_32.f9020
-rw-r--r--gcc/testsuite/gfortran.dg/whole_file_5.f902
-rw-r--r--gcc/testsuite/gfortran.dg/whole_file_6.f902
-rw-r--r--gcc/testsuite/gfortran.dg/write_invalid_format.f902
-rw-r--r--gcc/testsuite/gfortran.dg/zero_sized_6.f902
-rw-r--r--gcc/testsuite/gfortran.fortran-torture/execute/nan_inf_fmt.f9015
-rw-r--r--gcc/testsuite/gnat.dg/array7.adb1
-rw-r--r--gcc/testsuite/gnat.dg/atomic1.adb1
-rw-r--r--gcc/testsuite/gnat.dg/include.adb4
-rw-r--r--gcc/testsuite/gnat.dg/loop_optimization6.adb1
-rw-r--r--gcc/testsuite/gnat.dg/null_pointer_deref1.adb2
-rw-r--r--gcc/testsuite/gnat.dg/opt11.adb2
-rw-r--r--gcc/testsuite/gnat.dg/uninit_func.adb4
-rw-r--r--gcc/testsuite/go.test/test/blank.go53
-rw-r--r--gcc/testsuite/go.test/test/cmplx.go20
-rw-r--r--gcc/testsuite/go.test/test/cmplxdivide1.go4803
-rw-r--r--gcc/testsuite/go.test/test/complit.go70
-rw-r--r--gcc/testsuite/go.test/test/const1.go109
-rw-r--r--gcc/testsuite/go.test/test/convlit.go44
-rw-r--r--gcc/testsuite/go.test/test/ddd.go34
-rw-r--r--gcc/testsuite/go.test/test/decl.go12
-rw-r--r--gcc/testsuite/go.test/test/declbad.go22
-rw-r--r--gcc/testsuite/go.test/test/fixedbugs/bug006.go15
-rw-r--r--gcc/testsuite/go.test/test/fixedbugs/bug007.go4
-rw-r--r--gcc/testsuite/go.test/test/fixedbugs/bug010.go10
-rw-r--r--gcc/testsuite/go.test/test/fixedbugs/bug011.go16
-rw-r--r--gcc/testsuite/go.test/test/fixedbugs/bug035.go8
-rw-r--r--gcc/testsuite/go.test/test/fixedbugs/bug047.go18
-rw-r--r--gcc/testsuite/go.test/test/fixedbugs/bug080.go14
-rw-r--r--gcc/testsuite/go.test/test/fixedbugs/bug109.go9
-rw-r--r--gcc/testsuite/go.test/test/fixedbugs/bug167.go14
-rw-r--r--gcc/testsuite/go.test/test/fixedbugs/bug193.go12
-rw-r--r--gcc/testsuite/go.test/test/fixedbugs/bug206.go4
-rw-r--r--gcc/testsuite/go.test/test/fixedbugs/bug220.go8
-rw-r--r--gcc/testsuite/go.test/test/fixedbugs/bug230.go7
-rw-r--r--gcc/testsuite/go.test/test/fixedbugs/bug238.go2
-rw-r--r--gcc/testsuite/go.test/test/fixedbugs/bug248.dir/bug2.go2
-rw-r--r--gcc/testsuite/go.test/test/fixedbugs/bug248.dir/bug3.go2
-rw-r--r--gcc/testsuite/go.test/test/fixedbugs/bug252.go4
-rw-r--r--gcc/testsuite/go.test/test/fixedbugs/bug299.go4
-rw-r--r--gcc/testsuite/go.test/test/func.go14
-rw-r--r--gcc/testsuite/go.test/test/func1.go4
-rw-r--r--gcc/testsuite/go.test/test/interface/explicit.go20
-rw-r--r--gcc/testsuite/go.test/test/iota.go12
-rw-r--r--gcc/testsuite/go.test/test/ken/cplx0.go2
-rw-r--r--gcc/testsuite/go.test/test/ken/cplx1.go2
-rw-r--r--gcc/testsuite/go.test/test/ken/cplx3.go12
-rw-r--r--gcc/testsuite/go.test/test/ken/cplx4.go8
-rw-r--r--gcc/testsuite/go.test/test/ken/cplx5.go32
-rw-r--r--gcc/testsuite/go.test/test/ken/robfunc.go96
-rw-r--r--gcc/testsuite/go.test/test/ken/simpconv.go27
-rw-r--r--gcc/testsuite/go.test/test/ken/slicearray.go8
-rw-r--r--gcc/testsuite/go.test/test/ken/sliceslice.go10
-rw-r--r--gcc/testsuite/go.test/test/literal.go69
-rw-r--r--gcc/testsuite/go.test/test/map.go167
-rw-r--r--gcc/testsuite/go.test/test/method1.go4
-rw-r--r--gcc/testsuite/go.test/test/named.go2
-rw-r--r--gcc/testsuite/go.test/test/nil.go7
-rw-r--r--gcc/testsuite/go.test/test/recover2.go8
-rw-r--r--gcc/testsuite/go.test/test/test0.go40
-rw-r--r--gcc/testsuite/go.test/test/typeswitch.go13
-rw-r--r--gcc/testsuite/go.test/test/zerodivide.go207
-rw-r--r--gcc/testsuite/lib/compat.exp1
-rw-r--r--gcc/testsuite/lib/gfortran-dg.exp19
-rw-r--r--gcc/testsuite/lib/gfortran.exp5
-rw-r--r--gcc/testsuite/lib/gnat-dg.exp44
-rw-r--r--gcc/testsuite/lib/gnat.exp173
-rw-r--r--gcc/testsuite/lib/scanasm.exp5
-rw-r--r--gcc/testsuite/lib/target-supports-dg.exp13
-rw-r--r--gcc/testsuite/lib/target-supports.exp34
-rw-r--r--gcc/testsuite/obj-c++.dg/attributes/class-attribute-1.mm1
-rw-r--r--gcc/testsuite/obj-c++.dg/attributes/method-noreturn-1.mm4
-rw-r--r--gcc/testsuite/obj-c++.dg/attributes/method-sentinel-1.mm2
-rw-r--r--gcc/testsuite/obj-c++.dg/attributes/proto-attribute-2.mm1
-rw-r--r--gcc/testsuite/obj-c++.dg/attributes/proto-attribute-3.mm2
-rw-r--r--gcc/testsuite/obj-c++.dg/basic.mm29
-rw-r--r--gcc/testsuite/obj-c++.dg/exceptions-2.mm6
-rw-r--r--gcc/testsuite/obj-c++.dg/method-11.mm7
-rw-r--r--gcc/testsuite/obj-c++.dg/pr24393.mm2
-rw-r--r--gcc/testsuite/obj-c++.dg/pr45735.mm2
-rw-r--r--gcc/testsuite/obj-c++.dg/property/dotsyntax-22.mm19
-rw-r--r--gcc/testsuite/obj-c++.dg/property/property.exp7
-rw-r--r--gcc/testsuite/obj-c++.dg/proto-lossage-3.mm7
-rw-r--r--gcc/testsuite/obj-c++.dg/selector-3.mm5
-rw-r--r--gcc/testsuite/obj-c++.dg/template-8.mm1
-rw-r--r--gcc/testsuite/obj-c++.dg/torture/strings/const-str-10.mm5
-rw-r--r--gcc/testsuite/obj-c++.dg/torture/strings/const-str-11.mm7
-rw-r--r--gcc/testsuite/obj-c++.dg/torture/strings/const-str-9.mm7
-rw-r--r--gcc/testsuite/obj-c++.dg/try-catch-2.mm2
-rw-r--r--gcc/testsuite/obj-c++.dg/try-catch-9.mm2
-rw-r--r--gcc/testsuite/objc.dg/attributes/class-attribute-1.m1
-rw-r--r--gcc/testsuite/objc.dg/attributes/method-noreturn-1.m4
-rw-r--r--gcc/testsuite/objc.dg/attributes/method-sentinel-1.m1
-rw-r--r--gcc/testsuite/objc.dg/attributes/objc-exception-1.m32
-rw-r--r--gcc/testsuite/objc.dg/attributes/proto-attribute-2.m1
-rw-r--r--gcc/testsuite/objc.dg/attributes/proto-attribute-3.m1
-rw-r--r--gcc/testsuite/objc.dg/encode-7-next-64bit.m58
-rw-r--r--gcc/testsuite/objc.dg/image-info.m13
-rw-r--r--gcc/testsuite/objc.dg/layout-2.m14
-rw-r--r--gcc/testsuite/objc.dg/lookup-1.m3
-rw-r--r--gcc/testsuite/objc.dg/method-4.m4
-rw-r--r--gcc/testsuite/objc.dg/next-runtime-1.m15
-rw-r--r--gcc/testsuite/objc.dg/pr23214.m15
-rw-r--r--gcc/testsuite/objc.dg/pr24393.m2
-rw-r--r--gcc/testsuite/objc.dg/pr45735.m2
-rw-r--r--gcc/testsuite/objc.dg/property/dotsyntax-22.m19
-rw-r--r--gcc/testsuite/objc.dg/property/property.exp5
-rw-r--r--gcc/testsuite/objc.dg/selector-3.m5
-rw-r--r--gcc/testsuite/objc.dg/special/load-category-1.m1
-rw-r--r--gcc/testsuite/objc.dg/special/load-category-1a.m1
-rw-r--r--gcc/testsuite/objc.dg/special/load-category-2.m1
-rw-r--r--gcc/testsuite/objc.dg/special/load-category-2a.m1
-rw-r--r--gcc/testsuite/objc.dg/special/load-category-3.m1
-rw-r--r--gcc/testsuite/objc.dg/special/load-category-3a.m1
-rw-r--r--gcc/testsuite/objc.dg/special/unclaimed-category-1.h4
-rw-r--r--gcc/testsuite/objc.dg/special/unclaimed-category-1.m4
-rw-r--r--gcc/testsuite/objc.dg/symtab-1.m9
-rw-r--r--gcc/testsuite/objc.dg/torture/forward-1.m12
-rw-r--r--gcc/testsuite/objc.dg/torture/strings/const-str-10.m5
-rw-r--r--gcc/testsuite/objc.dg/torture/strings/const-str-11.m5
-rw-r--r--gcc/testsuite/objc.dg/torture/strings/const-str-9.m5
-rw-r--r--gcc/testsuite/objc.dg/type-size-3.m6
-rw-r--r--gcc/testsuite/objc.dg/type-size-4.m23
-rw-r--r--gcc/testsuite/objc.dg/type-size-5.m22
-rw-r--r--gcc/testsuite/objc.dg/zero-link-1.m3
-rw-r--r--gcc/testsuite/objc.dg/zero-link-2.m6
-rw-r--r--gcc/testsuite/objc/execute/accessing_ivars.m5
-rw-r--r--gcc/testsuite/objc/execute/bf-common.h7
-rw-r--r--gcc/testsuite/objc/execute/bycopy-2.m3
-rw-r--r--gcc/testsuite/objc/execute/bycopy-3.m12
-rw-r--r--gcc/testsuite/objc/execute/class-tests-1.h1
-rw-r--r--gcc/testsuite/objc/execute/class-tests-2.h1
-rw-r--r--gcc/testsuite/objc/execute/compatibility_alias.m1
-rw-r--r--gcc/testsuite/objc/execute/enumeration-1.m1
-rw-r--r--gcc/testsuite/objc/execute/enumeration-2.m1
-rw-r--r--gcc/testsuite/objc/execute/exceptions/catchall-1.m1
-rw-r--r--gcc/testsuite/objc/execute/exceptions/exceptions.exp1
-rw-r--r--gcc/testsuite/objc/execute/exceptions/finally-1.m17
-rw-r--r--gcc/testsuite/objc/execute/exceptions/foward-1.m27
-rw-r--r--gcc/testsuite/objc/execute/exceptions/foward-1.x11
-rw-r--r--gcc/testsuite/objc/execute/exceptions/local-variables-1.m1
-rw-r--r--gcc/testsuite/objc/execute/formal_protocol-1.m2
-rw-r--r--gcc/testsuite/objc/execute/formal_protocol-2.m2
-rw-r--r--gcc/testsuite/objc/execute/formal_protocol-3.m2
-rw-r--r--gcc/testsuite/objc/execute/formal_protocol-4.m2
-rw-r--r--gcc/testsuite/objc/execute/formal_protocol-5.m4
-rw-r--r--gcc/testsuite/objc/execute/formal_protocol-6.m3
-rw-r--r--gcc/testsuite/objc/execute/formal_protocol-7.m2
-rw-r--r--gcc/testsuite/objc/execute/no_clash.m1
-rw-r--r--gcc/testsuite/objc/execute/object_is_class.m11
-rw-r--r--gcc/testsuite/objc/execute/object_is_meta_class.m11
-rw-r--r--gcc/toplev.c33
-rw-r--r--gcc/tree-cfg.c1
-rw-r--r--gcc/tree-chrec.c8
-rw-r--r--gcc/tree-data-ref.c239
-rw-r--r--gcc/tree-data-ref.h126
-rw-r--r--gcc/tree-dfa.c8
-rw-r--r--gcc/tree-dump.c3
-rw-r--r--gcc/tree-eh.c14
-rw-r--r--gcc/tree-flow-inline.h25
-rw-r--r--gcc/tree-flow.h15
-rw-r--r--gcc/tree-if-conv.c25
-rw-r--r--gcc/tree-inline.c128
-rw-r--r--gcc/tree-inline.h2
-rw-r--r--gcc/tree-into-ssa.c8
-rw-r--r--gcc/tree-loop-linear.c423
-rw-r--r--gcc/tree-nrv.c2
-rw-r--r--gcc/tree-parloops.c119
-rw-r--r--gcc/tree-pass.h7
-rw-r--r--gcc/tree-predcom.c4
-rw-r--r--gcc/tree-scalar-evolution.c2
-rw-r--r--gcc/tree-sra.c82
-rw-r--r--gcc/tree-ssa-alias.c5
-rw-r--r--gcc/tree-ssa-ccp.c19
-rw-r--r--gcc/tree-ssa-copyrename.c27
-rw-r--r--gcc/tree-ssa-dom.c7
-rw-r--r--gcc/tree-ssa-dse.c18
-rw-r--r--gcc/tree-ssa-forwprop.c51
-rw-r--r--gcc/tree-ssa-live.c44
-rw-r--r--gcc/tree-ssa-loop-ch.c6
-rw-r--r--gcc/tree-ssa-loop-im.c37
-rw-r--r--gcc/tree-ssa-loop-niter.c2
-rw-r--r--gcc/tree-ssa-loop-prefetch.c3
-rw-r--r--gcc/tree-ssa-loop.c51
-rw-r--r--gcc/tree-ssa-pre.c45
-rw-r--r--gcc/tree-ssa-reassoc.c5
-rw-r--r--gcc/tree-ssa-sccvn.c29
-rw-r--r--gcc/tree-ssa-sccvn.h8
-rw-r--r--gcc/tree-ssa-sink.c5
-rw-r--r--gcc/tree-ssa-structalias.c59
-rw-r--r--gcc/tree-ssa-ter.c32
-rw-r--r--gcc/tree-ssa.c92
-rw-r--r--gcc/tree-ssanames.c2
-rw-r--r--gcc/tree-tailcall.c4
-rw-r--r--gcc/tree-vect-data-refs.c2
-rw-r--r--gcc/tree-vect-generic.c15
-rw-r--r--gcc/tree-vect-stmts.c2
-rw-r--r--gcc/tree-vrp.c7
-rw-r--r--gcc/tree.c26
-rw-r--r--gcc/tree.def2
-rw-r--r--gcc/value-prof.c8
-rw-r--r--gcc/var-tracking.c48
-rw-r--r--gcc/varasm.c93
-rw-r--r--gcc/varpool.c25
-rw-r--r--gcc/web.c12
1199 files changed, 43801 insertions, 20614 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 51869a29a65..030167f9bcd 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,11 +1,2563 @@
+2011-02-25 Eric Botcazou <ebotcazou@adacore.com>
+
+ PR tree-optimization/45470
+ * tree-vect-data-refs.c (vect_analyze_data_refs): Fail if a statement
+ can throw internally only.
+ * tree-vect-stmts.c (vectorizable_call): Likewise.
+
+2011-02-24 Anatoly Sokolov <aesok@post.ru>
+
+ * config/stormy16/stormy16.h (PREFERRED_RELOAD_CLASS,
+ PREFERRED_OUTPUT_RELOAD_CLASS): Remove.
+ * config/stormy16/stormy16-protos.h
+ (xstormy16_preferred_reload_class): Remove.
+ * config/stormy16/stormy16.c (xstormy16_preferred_reload_class): Make
+ static. Change 'rclass' argument and return type to reg_class_t.
+ (TARGET_PREFERRED_RELOAD_CLASS,
+ TARGET_PREFERRED_OUTPUT_RELOAD_CLASS): Define.
+
+2011-02-24 Richard Guenther <rguenther@suse.de>
+
+ * lto-streamer-in.c (input_bb): Do not find referenced vars
+ in debug statements.
+
+2011-02-23 Jason Merrill <jason@redhat.com>
+
+ * common.opt (fabi-version): Document v5 and v6.
+
+2011-02-23 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/47849
+ * tree-if-conv.c (main_tree_if_conversion): Free postdom info.
+
+2011-02-23 Jie Zhang <jie@codesourcery.com>
+
+ * opts-common.c (decode_cmdline_option): Print empty string
+ argument as "" in decoded->orig_option_with_args_text.
+ * gcc.c (execute): Print empty string argument as ""
+ in the verbose output.
+ (do_spec_1): Keep empty string argument.
+
+2011-02-23 Nathan Froyd <froydnj@codesourcery.com>
+
+ * config.gcc: Declare score-* and crx-* obsolete.
+
+2011-02-23 Jie Zhang <jie@codesourcery.com>
+
+ PR rtl-optimization/47763
+ * web.c (web_main): Ignore naked clobber when replacing register.
+
+2011-02-22 Anatoly Sokolov <aesok@post.ru>
+
+ * config/stormy16/stormy16.h (REG_OK_FOR_BASE_P, REG_OK_FOR_INDEX_P):
+ Remove.
+
+2011-02-22 Sebastian Pop <sebastian.pop@amd.com>
+
+ PR doc/47848
+ * doc/invoke.texi: Do not mention -ftree-loop-if-convert-memory-writes.
+
+2011-02-22 Mike Stump <mikestump@comcast.net>
+
+ * acinclude.m4 (gcc_cv_gas_vers): Add -arch ppc for probing darwin
+ assembler.
+ * configure: Regenerate.
+
+2011-02-21 Chung-Lin Tang <cltang@codesourcery.com>
+
+ PR rtl-optimization/46002
+ * ira-color.c (update_copy_costs): Change class intersection
+ test to reg_class_contents[] test of 'hard_regno'.
+
+2011-02-21 Joseph Myers <joseph@codesourcery.com>
+
+ * config/alpha/osf5.opt (mno-mips-tfile): Mark as Target rather
+ than Driver option.
+ * config/hpux11.opt (mt): Likewise.
+ * config/microblaze/microblaze.opt (mxl-mode-xilkernel): Likewise.
+ * config/rs6000/xilinx.opt (mno-clearbss, mppcperflib): Likewise.
+ * config/vax/elf.opt (mno-asm-pic): Likewise.
+ * config/vms/vms.opt (map, mvms-return-codes): Likewise.
+
+2011-02-21 Mike Stump <mikestump@comcast.net>
+
+ PR target/47822
+ * config/darwin-protos.h (darwin_init_cfstring_builtins): Return a
+ tree so we can get save the type.
+ * config/i386/darwin.h (SUBTARGET_INIT_BUILTINS): Reserve builtin slot
+ for CFString instead of trying to use past the end of the builtins.
+ * config/i386/i386.c (IX86_BUILTIN_CFSTRING): Likewise.
+ * config/rs6000/rs6000-builtin.def (RS6000_BUILTIN_CFSTRING): Likewise.
+ * config/rs6000/darwin.h (SUBTARGET_INIT_BUILTINS): Likewise.
+ * config/darwin.c (DARWIN_BUILTIN_CFSTRINGMAKECONSTANTSTRING):
+ Rename to darwin_builtin_cfstring.
+ (darwin_init_cfstring_builtins): Return the built type.
+
+2011-02-21 Uros Bizjak <ubizjak@gmail.com>
+
+ PR target/47840
+ * config/i386/avxintrin.h (_mm256_insert_epi32): Use _mm_insert_epi32.
+ (_mm256_insert_epi64): Use _mm_insert_epi64.
+
+2011-02-21 Anatoly Sokolov <aesok@post.ru>
+
+ * config/stormy16/stormy16.h (GO_IF_MODE_DEPENDENT_ADDRESS): Remove.
+ * config/stormy16/stormy16-protos.h
+ (xstormy16_mode_dependent_address_p): Remove.
+ * config/stormy16/stormy16.c (xstormy16_mode_dependent_address_p):
+ Make static. Change return type to bool. Change argument type to
+ const_rtx. Remove dead code.
+ (TARGET_MODE_DEPENDENT_ADDRESS_P): Define.
+
+2011-02-21 Richard Guenther <rguenther@suse.de>
+
+ PR lto/47820
+ * lto-streamer-in.c (lto_input_ts_decl_common_tree_pointers):
+ Do not stream DECL_INITIAL for TRANSLATION_UNIT_DECLs.
+ (lto_input_ts_block_tree_pointers): Hook a BLOCK into the
+ TUs context.
+ * lto-streamer-out.c (lto_output_ts_decl_common_tree_pointers):
+ Do not stream DECL_INITIAL for TRANSLATION_UNIT_DECLs.
+
+2011-02-20 Richard Guenther <rguenther@suse.de>
+
+ PR lto/47822
+ * tree.c (free_lang_data_in_decl): Clean builtins from
+ the TU decl BLOCK_VARS.
+
+2011-02-19 Alexandre Oliva <aoliva@redhat.com>
+
+ PR debug/47620
+ PR debug/47630
+ * haifa-sched.c (fix_tick_ready): Skip tick computation
+ for debug insns.
+
+2011-02-19 Richard Guenther <rguenther@suse.de>
+
+ PR lto/47647
+ * lto-streamer-in.c (lto_input_ts_decl_minimal_tree_pointers):
+ Remove lazy BLOCK_VARS streaming.
+ (lto_input_ts_block_tree_pointers): Likewise.
+ * lto-streamer-out.c (lto_output_ts_block_tree_pointers): Likewise.
+
+2011-02-19 Joseph Myers <joseph@codesourcery.com>
+
+ * config.gcc (i[34567]86-pc-msdosdjgpp*): Use i386/djgpp-stdint.h.
+
+2011-02-19 Joseph Myers <joseph@codesourcery.com>
+
+ * config/i386/biarch32.h, config/i386/mach.h,
+ config/rs6000/aix.opt, config/sh/superh64.h: Remove.
+
+2011-02-19 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/47800
+ * config/i386/i386.md (peephole2 for shift and plus): Use
+ operands[1] original mode in the first insn.
+
+2011-02-18 Mike Stump <mikestump@comcast.net>
+
+ * config/t-darwin (TM_H): Add dependency on darwin-sections.def.
+
+2011-02-18 Jan Hubicka <jh@suse.cz>
+
+ PR middle-end/47788
+ * ipa-inline.c (compute_inline_parameters): Set disregard_inline_limits
+ to zero when the function is not inlinable at all.
+
+2011-02-18 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
+
+ * config.gcc (hppa[12]*-*-hpux11*): Set extra_parts.
+ * config/pa/stublib.c (pthread_default_stacksize_np, pthread_mutex_lock,
+ pthread_mutex_unlock, pthread_once): Reinstate pthread stubs.
+ * config/pa/t-pa-hpux11: Add rules to build pthread stubs.
+ * config/pa/t-pa64: Likewise.
+ * config/pa/pa-hpux11.h (LINK_GCC_C_SEQUENCE_SPEC): Define.
+
+2011-02-18 Jakub Jelinek <jakub@redhat.com>
+
+ PR driver/47787
+ * gcc.c (default_compilers): Clear combinable field for "@cpp-output".
+
+2011-02-18 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
+
+ PR target/47792
+ * gthr-dce.h (__gthread_mutx_destroy): Fix typo in name.
+
+2011-02-18 Anatoly Sokolov <aesok@post.ru>
+
+ * config/m32r/m32r.h (REG_OK_FOR_BASE_P, REG_OK_FOR_INDEX_P,
+ RTX_OK_FOR_BASE_P, RTX_OK_FOR_OFFSET_P, LEGITIMATE_OFFSET_ADDRESS_P,
+ LEGITIMATE_LO_SUM_ADDRESS_P, LOAD_POSTINC_P, STORE_PREINC_PREDEC_P,
+ GO_IF_LEGITIMATE_ADDRESS): Remove macros.
+ * config/m32r/m32r.c (TARGET_LEGITIMATE_ADDRESS_P): Define.
+ (m32r_rtx_ok_for_base_p, m32r_rtx_ok_for_offset_p,
+ m32r_legitimate_offset_addres_p, m32r_legitimate_lo_sum_addres_p,
+ m32r_load_postinc_p, m32r_store_preinc_predec_p,
+ m32r_legitimate_address_p): New functions.
+ * config/m32r/constraints.md (constraint "S"): Don't use
+ STORE_PREINC_PREDEC_P.
+ (constraint "U"): Don't use LOAD_POSTINC_P.
+
+2011-02-18 Chung-Lin Tang <cltang@codesourcery.com>
+
+ PR rtl-optimization/46178
+ * ira.c (setup_hard_regno_class): Use ira_class_translate[] to
+ compute ira_hard_regno_cover_class[].
+
+2011-02-18 Richard Guenther <rguenther@suse.de>
+
+ PR lto/47798
+ * lto-streamer.h (lto_global_var_decls): Declare.
+ * lto-streamer-in.c (lto_register_var_decl_in_symtab): Register
+ statics for global var processing.
+
+2011-02-18 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/47737
+ * tree-ssa-loop-im.c (extract_true_false_args_from_phi): Fix
+ edge dominance check.
+
+2011-02-18 Jakub Jelinek <jakub@redhat.com>
+
+ PR debug/47780
+ * cfgexpand.c (expand_debug_expr) <case SSA_NAME>: Call copy_rtx to
+ avoid invalid rtx sharing.
+
+2011-02-18 Gerald Pfeifer <gerald@pfeifer.com>
+
+ * doc/cpp.texi (Obsolete Features): Add background on the
+ origin of assertions.
+
+2011-02-17 Iain Sandoe <iains@gcc.gnu.org>
+
+ * config/darwin-c.c (darwin_cpp_builtins): Define __OBJC2__ for
+ objc_abi == 2.
+ * config/darwin.c (output_objc_section_asm_op): Added support for
+ ABI v1 and v2.
+ (is_objc_metadata): New.
+ (darwin_objc2_section): New.
+ (darwin_objc1_section): New.
+ (machopic_select_section): Added support for ABI v1 and v2.
+ (darwin_emit_objc_zeroed): New.
+ (darwin_output_aligned_bss): Detect objc metadata and treat it
+ appropriately.
+ (darwin_asm_output_aligned_decl_common): Same.
+ (darwin_asm_output_aligned_decl_local): Same.
+ * config/darwin-sections.def: Updated for ABI v1 and v2.
+ * config/darwin.h (SUBTARGET_C_COMMON_OVERRIDE_OPTIONS): When
+ compiling Objective-C code for the NeXT runtime, default to using
+ ABI version 0 for 32-bit, and version 2 for 64-bit.
+
+2011-02-17 Joseph Myers <joseph@codesourcery.com>
+
+ * common.opt (optimize_fast): New Variable.
+ * opts.c (default_options_optimization): Use opts->x_optimize_fast
+ instead of local variable ofast.
+
+2011-02-17 Nicola Pero <nicola.pero@meta-innovation.com>
+
+ * doc/invoke.texi (fobjc-abi-version): Documented.
+ (fobjc-nilcheck): Documented.
+ (fno-nil-receiver): Updated documentation to refer to the NeXT ABI
+ version.
+
+2011-02-17 Joseph Myers <joseph@codesourcery.com>
+
+ PR driver/47390
+ * common.opt (export-dynamic): New Driver option.
+ * gcc.c (LINK_COMMAND_SPEC): Add comment about %{e*}.
+
+2011-02-17 Joseph Myers <joseph@codesourcery.com>
+
+ * config/rx/rx.h (LIB_SPEC): Match -msim not -msim*.
+
+2011-02-17 Alexandre Oliva <aoliva@redhat.com>
+ Jan Hubicka <jh@suse.cz>
+
+ PR debug/47106
+ PR debug/47402
+ * cfgexpand.c (account_used_vars_for_block): Remove.
+ (estimated_stack_frame_size): Use referenced vars.
+ * tree-inline.c (remap_decl): Only mark VAR_DECLs as referenced
+ that were referenced in the original function. Test src_fn
+ rather than cfun. Drop redundant get_var_ann.
+ (setup_one_parameter): Drop redundant get_var_ann.
+ (declare_return_variable): Likewise.
+ (copy_decl_for_dup_finish): Mark VAR_DECLs referenced in src_fn.
+ (copy_arguments_for_versioning): Drop redundant get_var_ann.
+ * ipa-inline.c (compute_inline_parameters): Do not compute
+ disregard_inline_limits here.
+ (compute_inlinable_for_current, pass_inlinable): New.
+ (pass_inline_parameters): Require PROP_referenced_vars.
+ * cgraphunit.c (cgraph_process_new_functions): Don't run
+ compute_inline_parameters explicitly unless function is in SSA form.
+ (cgraph_analyze_function): Set .disregard_inline_limits.
+ * tree-sra.c (convert_callers): Compute inliner parameters
+ only for functions already in SSA form.
+
+2011-02-17 Joseph Myers <joseph@codesourcery.com>
+
+ * config/sparc/sparc.h (CPP_ENDIAN_SPEC): Don't handle
+ -mlittle-endian-data.
+
+2011-02-17 Joseph Myers <joseph@codesourcery.com>
+
+ * config/sparc/linux64.h (OPTION_DEFAULT_SPECS): Match -mfpu and
+ -mno-fpu, not -fpu and -no-fpu.
+ * config/sparc/sol2-bi.h (OPTION_DEFAULT_SPECS): Likewise.
+ * config/sparc/sparc.h (OPTION_DEFAULT_SPECS): Likewise.
+
+2011-02-17 Uros Bizjak <ubizjak@gmail.com>
+
+ PR target/43653
+ * config/i386/i386.c (ix86_secondary_reload): Handle SSE
+ input reload with PLUS RTX.
+
+2011-02-16 Joseph Myers <joseph@codesourcery.com>
+
+ * config/mips/mips.opt (mno-mdmx): Use Var(TARGET_MDMX, 0) instead
+ of InverseVar(MDMX).
+
+2011-02-16 Joseph Myers <joseph@codesourcery.com>
+
+ * config/sh/embed-elf.h (LIBGCC_SPEC): Match -m4-340 instead of
+ --m4-340.
+
+2011-02-16 Joseph Myers <joseph@codesourcery.com>
+
+ * config/mn10300/mn10300.opt (mno-crt0): New.
+
+2011-02-16 Joseph Myers <joseph@codesourcery.com>
+
+ * config/m68k/uclinux.opt (static-libc): New Driver option.
+
+2011-02-16 Joseph Myers <joseph@codesourcery.com>
+
+ * config/m32c/m32c.h (LIB_SPEC): Match -msim not -msim*.
+
+2011-02-16 Joseph Myers <joseph@codesourcery.com>
+
+ * config/lm32/lm32.h (ASM_SPEC): Use %{muser-enabled} instead of
+ %{muser-extend-enabled}.
+
+2011-02-16 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/47738
+ * tree-ssa-loop.c (run_tree_predictive_commoning): Return
+ the TODO from tree_predictive_commoning.
+
+2011-02-15 Jeff Law <law@redhat.com>
+
+ Revert
+ 2011-01-25 Jeff Law <law@redhat.com>
+
+ PR rtl-optimization/37273
+ * ira-costs.c (scan_one_insn): Detect constants living in memory and
+ handle them like argument loads from stack slots. Do not double
+ count memory for memory constants and argument loads from stack slots.
+
+2011-02-15 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR middle-end/47725
+ * combine.c (cant_combine_insn_p): Revert the last change.
+
+2011-02-15 Michael Meissner <meissner@linux.vnet.ibm.com>
+
+ PR target/47755
+ * config/rs6000/predicates.md (easy_vector_constant): Allow V2DI
+ mode for vector constants. Remove code that checks for TImode.
+
+2011-02-15 Alexandre Oliva <aoliva@redhat.com>
+
+ PR debug/47106
+ PR debug/47402
+ * cgraph.h (compute_inline_parameters): Return void.
+ * ipa-inline.c (compute_inline_parameters): Adjust.
+
+2011-02-15 Alexandre Oliva <aoliva@redhat.com>
+
+ PR debug/47106
+ PR debug/47402
+ * tree-inline.h (estimated_stack_frame_size): Take cgraph node
+ rather than decl.
+ * cfgexpand.c (estimated_stack_frame_size): Likewise.
+ * ipa-inline.c (compute_inline_parameters): Adjust.
+
+2011-02-15 Alexandre Oliva <aoliva@redhat.com>
+
+ PR debug/47106
+ PR debug/47402
+ * tree-flow.h (FOR_EACH_REFERENCED_VAR): Add FN argument.
+ Adjust all users. Pass FN to...
+ * tree-flow-inline.h (first_referenced_var): ... this. Add
+ fn argument.
+ * ipa-struct-reorg.c: Adjust.
+ * tree-dfa.c: Adjust.
+ * tree-into-ssa.c: Adjust.
+ * tree-sra.c: Adjust.
+ * tree-ssa-alias.c: Adjust.
+ * tree-ssa-live.c: Adjust.
+ * tree-ssa.c: Adjust.
+ * tree-ssanames.c: Adjust.
+ * tree-tailcall.c: Adjust.
+
+2011-02-15 Alexandre Oliva <aoliva@redhat.com>
+
+ PR debug/47106
+ PR debug/47402
+ * tree-flow.h (referenced_var_lookup): Add fn parameter.
+ Adjust all callers.
+ * tree-dfa.c (referenced_var_lookup): Use fn instead of cfun.
+ * tree-flow-inline.h: Adjust.
+ * gimple-pretty-print.c: Adjust.
+ * tree-into-ssa.c: Adjust.
+ * tree-ssa.c: Adjust.
+ * cfgexpand.c: Adjust.
+
+2011-02-15 Nathan Froyd <froydnj@codesourcery.com>
+
+ * config/iq2000/i2000.h (REG_CLASS_FROM_LETTER): Delete.
+ (CONST_OK_FOR_LETTER_P, CONST_DOUBLE_OK_FOR_LETTER_P): Delete.
+ (EXTRA_CONSTRAINT): Delete.
+ * config/iq2000/constraints.md: New file.
+ * config/iq2000/iq2000.md: Include it.
+ (define_insn ""): Delete.
+ (movsi_internal2, movhi_internal2, movqi_internal2): Delete
+ unsupported constraint letters from patterns.
+ (call_value, call_value_internal1): Likewise.
+ (call_value_multiple_internal1): Likewise.
+
+2011-02-15 Nick Clifton <nickc@redhat.com>
+
+ * config/mn10300/mn10300.c: Include tm-constrs.h.
+ (struct liw_data): New data structure describing an LIW candidate
+ instruction.
+ (extract_bundle): Use struct liw_data. Allow small integer
+ operands for some instructions.
+ (check_liw_constraints): Use struct liw_data. Remove swapped
+ parameter. Add comments describing the checks. Fix bug when
+ assigning the source of liw1 to the source of liw2.
+ (liw_candidate): Delete. Code moved into extract_bundle.
+ (mn10300_bundle_liw): Use struct liw_data. Check constraints
+ before swapping.
+ * config/mn10300/predicates.md (liw_operand): New predicate.
+ Allows registers and small integer constants.
+ * config/mn10300/constraints.md (O): New constraint. Accetps
+ integers in the range -8 to +7 inclusive.
+ * config/mn10300/mn10300.md (movesi_internal): Add an alternative
+ for moving a small integer into a register. Give this alternative
+ LIW attributes.
+ (addsi3, subsi3, cmpsi, lshrsi3, ashrsi3): Likewise.
+ (ashlsi3): Likewise, plus give LIW attributes to the alternatives
+ using the J,K,L and M constraints,
+ (liw): Remove SI mode on second operands to allow for HI and QI
+ mode values.
+ (cmp_liw, liw_cmp): Likewise. Plus fix order of operands in the
+ instruction.
+
+2011-02-15 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR middle-end/47725
+ * combine.c (cant_combine_insn_p): Check zero/sign extended
+ hard registers.
+
+2011-02-15 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/47743
+ * tree-ssa-pre.c (phi_translate_1): If we didn't get a value-number
+ for a non-type-compatible VN lookup bail out.
+
+2011-02-15 Nathan Froyd <froydnj@codesourcery.com>
+
+ * config/fr30/constraints.md: New file.
+ * config/fr30/fr30.md: Include it.
+ * config/fr30/fr30.h (REG_CLASS_FROM_LETTER): Delete.
+ (CONST_OK_FOR_LETTER_P, CONST_DOUBLE_OK_FOR_LETTER_P): Delete.
+ (EXTRA_CONSTRAINT): Delete.
+
+2011-02-15 Nathan Froyd <froydnj@codesourcery.com>
+
+ * config/frv/constraints.md: New file.
+ * config/frv/predicates.md: Include it.
+ * config/frv/frv.c (reg_class_from_letter): Delete.
+ (frv_option_override): Don't initialize it.
+ * config/frv/frv.h (REG_CLASS_FROM_LETTER): Delete.
+ (CONST_OK_FOR_I, CONST_OK_FOR_J, CONST_OK_FOR_K): Delete.
+ (CONST_OK_FOR_L, CONST_OK_FOR_M, CONST_OK_FOR_N): Delete.
+ (CONST_OK_FOR_O, CONST_OK_FOR_P, CONST_OK_FOR_LETTER_P): Delete.
+ (CONST_DOUBLE_OK_FOR_G, CONST_DOUBLE_OK_FOR_H): Delete.
+ (CONST_DOUBLE_OK_FOR_LETTER_P): Delete.
+ (EXTRA_CONSTRAINT_FOR_Q, EXTRA_CONSTRAINT_FOR_R): Delete.
+ (EXTRA_CONSTRAINT_FOR_S, EXTRA_CONSTRAINT_FOR_T): Delete.
+ (EXTRA_CONSTRAINT_FOR_U, EXTRA_CONSTRAINT): Delete.
+ (EXTRA_MEMORY_CONSTRAINT, CONSTRAINT_LEN): Delete.
+ (REG_CLASS_FROM_CONSTRAINT): Delete.
+
+2011-02-15 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/47581
+ * config/i386/i386.c (ix86_compute_frame_size): Don't align offset
+ if frame size is 0 in a leaf function.
+
+2011-02-15 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ PR pch/14940
+ * config/alpha/host-osf.c: New file.
+ * config/alpha/x-osf: New file.
+ * config.host (alpha*-dec-osf*): Use it.
+
+2011-02-14 Anatoly Sokolov <aesok@post.ru>
+
+ * config/rx/rx.h (GO_IF_MODE_DEPENDENT_ADDRESS): Remove.
+ * config/rx/rx-protos.h (rx_is_mode_dependent_addr): Remove.
+ * config/xtensa/xtensa.c (rx_is_mode_dependent_addr): Rename to...
+ (rx_mode_dependent_address_p): ...this. Make static. Change argument
+ type to const_rtx.
+ (TARGET_MODE_DEPENDENT_ADDRESS_P): Define.
+
+2011-02-14 Nathan Froyd <froydnj@codesourcery.com>
+
+ * config/stormy16/constraints.md: New file.
+ * config/stormy16/predicates.md (nonimmediate_nonstack_operand):
+ Use satisfies_constraint_Q and satisfies_constraint_R.
+ * config/stormy16/stomry16-protos.h (xstormy16_extra_constraint_p):
+ Delete.
+ (xstormy16_legitiamte_address_p): Declare.
+ * config/stormy16/stormy16.h (REG_CLASS_FROM_LETTER): Delete.
+ (CONST_OK_FOR_LETTER_P, CONST_DOUBLE_OK_FOR_LETTER_P): Delete.
+ (EXTRA_CONSTRAINT): Delete.
+ * config/stormy16/stormy16.c (xstormy16_legitimate_address_p):
+ Un-staticize.
+ (xstormy16_extra_constraint_p): Delete.
+
+2011-02-14 Eric Botcazou <ebotcazou@adacore.com>
+
+ PR tree-optimization/46494
+ * loop-unroll.c (split_edge_and_insert): Adjust comment.
+ * loop-init.c (loop_optimizer_finalize): Do not call verify_flow_info.
+ (pass_rtl_loop_done): Add TODO_verify_flow.
+ * fwprop.c (pass_rtl_fwprop): Likewise.
+ * modulo-sched.c (pass_sms): Likewise.
+ * tree-ssa-dom.c (pass_dominator): Likewise.
+ * tree-ssa-loop-ch.c (pass_ch): Likewise.
+ * tree-ssa-loop.c (pass_complete_unrolli): Likewise.
+ (pass_tree_loop_done): Likewise.
+ * tree-ssa-pre.c (execute_pre): Likewise.
+ * tree-ssa-reassoc.c (pass_reassoc): Likewise.
+ * tree-ssa-sink.c (pass_sink_code): Likewise.
+ * tree-vrp.c (pass_vrp): Likewise.
+
+2011-02-14 Nathan Froyd <froydnj@codesourcery.com>
+
+ * config/v850/constraints.md: New file.
+ * config/v850/v850.md: Include it.
+ * config/v850/predicates.md (reg_or_0_operand): Use
+ satisfies_constraint_G.
+ (special_symbolref_operand): Use satisfies_constraint_K.
+ * config/v850/v850.h (CONSTANT_ADDRESS_P): Use constraint_satisfied_p.
+ (GO_IF_LEGITIMATE_ADDRESS): Likewise.
+ (REG_CLASS_FROM_LETTER, INT_7_BITS, INT_8_BITS): Delete.
+ (CONST_OK_FOR_P, CONST_OK_FOR_LETTER_P): Delete.
+ (EXTRA_CONSTRAINT): Delete.
+ (CONST_OK_FOR_I, CONST_OK_FOR_J): Use insn_const_int_ok_for_constraint.
+ (CONST_OK_FOR_K, CONST_OK_FOR_L, CONST_OK_FOR_M): Likewise.
+ (CONST_OK_FOR_N, CONST_OK_FOR_O): Likewise.
+
+2011-02-14 Anatoly Sokolov <aesok@post.ru>
+
+ PR target/47696
+ * config/avr/avr-devices.c (avr_mcu_types): Fix ATmega2560 device
+ description.
+
+2011-02-14 Nathan Froyd <froydnj@codesourcery.com>
+
+ * config/mcore/constraints.md: New file.
+ * config/mcore/mcore.md: Include it.
+ * config/mcore/mcore.c (reg_class_from_letter): Delete.
+ * config/mcore/mcore.h (reg_class_from_letter): Delete.
+ (REG_CLASS_FROM_LETTER): Delete.
+ (CONST_OK_FOR_I, CONST_OK_FOR_J, CONST_OK_FOR_L): Use
+ insn_const_int_ok_for_constraint.
+ (CONST_OK_FOR_K, CONST_OK_FOR_M, CONST_OK_FOR_N): Likewise.
+ (CONST_OK_FOR_O, CONST_OK_FOR_P): Likewise.
+ (CONST_OK_FOR_LETTER_P, CONST_DOUBLE_OK_FOR_LETTER_P): Delete.
+ (EXTRA_CONSTRAINT): Delete.
+
+2011-02-14 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ PR ada/41929
+ * config/sparc/sol2-unwind.h: Include <sys/frame.h>, <sys/stack.h>
+ (IS_SIGHANDLER): Define.
+ (sparc64_is_sighandler): New function, split off from
+ sparc64_fallback_frame_state.
+ (sparc_is_sighandler): New function, split off from
+ sparc_fallback_frame_state.
+ (sparc64_fallback_frame_state): Merge with ...
+ (sparc_fallback_frame_state): ... this into ...
+ (MD_FALLBACK_FRAME_STATE_FOR): ... this.
+ Change new_cfa to long. Remove regs_off, fpu_save_off, fpu_save.
+ Define nframes, mctx. Use IS_SIGHANDLER, handler_args, mctx, walk
+ stack instead of hardcoded offsets.
+
+2011-02-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
+
+ * go/gccgo.texi (Top, Import and Export): Fix a typo and a markup nit.
+
+2011-02-14 Andriy Gapon <avg@freebsd.org>
+
+ PR target/45808
+ * config/freebsd-spec.h (FBSD_LIB_SPEC): Handle the shared case.
+
+2011-02-13 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
+
+ * configure: Regenerate.
+
+2011-02-12 Joseph Myers <joseph@codesourcery.com>
+
+ PR driver/45731
+ * gcc.c (asm_options): Correct spec matching --target-help.
+
+2011-02-12 Martin Jambor <mjambor@suse.cz>
+
+ * tree-cfg.c (verify_gimple_call): Return true upon invalid argument
+ to gimple call error.
+
+2011-02-12 Mike Stump <mikestump@comcast.net>
+
+ * config/frv/frv.h (TRANSFER_FROM_TRAMPOLINE): Canonicalize
+ comments in backslash regions.
+
+2011-02-12 Mike Stump <mikestump@comcast.net>
+ Jakub Jelinek <jakub@redhat.com>
+ Iain Sandoe <iains@gcc.gnu.org>
+
+ PR target/47324
+ * dwarf2out.c (output_cfa_loc): When required, apply the
+ DWARF2_FRAME_REG_OUT macro to adjust register numbers.
+ (output_loc_sequence): Likewise.
+ (output_loc_operands_raw): Likewise.
+ (output_loc_sequence_raw): Likewise.
+ (output_cfa_loc): Likewise.
+ (output_loc_list): Suppress register number adjustment when
+ calling output_loc_sequence()
+ (output_die): Likewise.
+
+2011-02-12 Anatoly Sokolov <aesok@post.ru>
+
+ * config/xtensa/xtensa.h (REGISTER_MOVE_COST, MEMORY_MOVE_COST):
+ Remove macros.
+ * config/xtensa/xtensa.c (xtensa_register_move_cost,
+ xtensa_memory_move_cost): New functions.
+ (TARGET_REGISTER_MOVE_COST, TARGET_REGISTER_MOVE_COST): Define.
+
+2011-02-12 Alexandre Oliva <aoliva@redhat.com>
+
+ PR lto/47225
+ * configure.ac (gcc_cv_lto_plugin): Test for liblto_plugin.la
+ in the current directory.
+ * configure: Rebuilt.
+
+2011-02-12 Iain Sandoe <iains@gcc.gnu.org>
+
+ * config/darwin.c (darwin_override_options): Add a hunk missed
+ from the commit of r168571. Trim comment line lengths and
+ correct indents of the preceding block.
+
+2011-02-12 Iain Sandoe <iains@gcc.gnu.org>
+
+ * gcc.c (driver_handle_option): Concatenate the argument to -F with
+ the switch.
+
+2011-02-11 Joseph Myers <joseph@codesourcery.com>
+
+ * common.opt (nostartfiles): New Driver option.
+
+2011-02-11 Xinliang David Li <davidxl@google.com>
+
+ PR tree-optimization/47707
+ * tree-chrec.c (convert_affine_scev): Keep type precision.
+
+2011-02-11 Eric Botcazou <ebotcazou@adacore.com>
+
+ PR tree-optimization/47420
+ * ipa-split.c (visit_bb): Punt on any kind of GIMPLE_RESX.
+
+2011-02-11 Pat Haugen <pthaugen@us.ibm.com>
+
+ PR rtl-optimization/47614
+ * rtl.h (check_for_inc_dec): Declare.
+ * dse.c (check_for_inc_dec): Externalize...
+ * postreload.c (reload_cse_simplify): ...use it before deleting stmt.
+ (reload_cse_simplify_operands): Don't simplify opnds with side effects.
+
+2011-02-11 Joseph Myers <joseph@codesourcery.com>
+
+ PR driver/47678
+ * gcc.c (main): Do not compile inputs if there were errors in
+ option handling.
+ * opts-common.c (read_cmdline_option): Check for wrong language
+ after other error checks.
+
+2011-02-11 Nathan Froyd <froydnj@codesourcery.com>
+
+ * cgraph.c: Fix comment typos.
+ * cgraph.h: Likewise.
+ * cgraphunit.c: Likewise.
+ * ipa-cp.c: Likewise.
+ * ipa-inline.c: Likewise.
+ * ipa-prop.c: Likewise.
+ * ipa-pure-const.c: Likewise.
+ * ipa-ref.c: Likewise.
+ * ipa-reference.c: Likewise.
+
+2011-02-11 Jakub Jelinek <jakub@redhat.com>
+
+ PR debug/47684
+ * tree-predcom.c (single_nonlooparound_use): Ignore debug uses.
+
+2011-02-11 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ PR testsuite/47400
+ * doc/sourcebuild.texi (Require Support): Document
+ dg-require-ascii-locale.
+
+2011-02-11 Mingjie Xing <mingjie.xing@gmail.com>
+
+ * doc/lto.texi (Write summary): Fix missing parentheses.
+
+2011-02-10 DJ Delorie <dj@redhat.com>
+
+ * config/m32c/m32c.c (m32c_option_override): Disable
+ -fcombine-stack-adjustments until flag value tracking and compare
+ optimization can be rewritten.
+
+2011-02-10 Peter Bergner <bergner@vnet.ibm.com>
+
+ * config/rs6000/linux64.h (PROCESSOR_DEFAULT): Change to
+ PROCESSOR_POWER7.
+ (PROCESSOR_DEFAULT64): Likewise.
+
+2011-02-10 Richard Henderson <rth@redhat.com>
+
+ * config/rx/predicates.md (rx_zs_comparison_operator): Revert
+ change from 2011-02-03.
+ * config/rx/rx.c (flags_from_code): Likewise.
+ (rx_print_operand) ['B']: For LT/GE, use lt/ge if overflow flag
+ is valid, n/pz otherwise.
+ (rx_select_cc_mode): Return CCmode if Y is not zero.
+
+2011-02-10 Richard Guenther <rguenther@suse.de>
+
+ * tree-ssa-structalias.c (bitpos_of_field): Use BITS_PER_UNIT, not 8.
+
+2011-02-10 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/47677
+ * tree-vrp.c (vrp_bitmap_equal_p): Fix comparison of empty bitmaps.
+
+2011-02-10 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/47665
+ * combine.c (make_compound_operation): Only change shifts into
+ multiplication for SCALAR_INT_MODE_P.
+
+2011-02-10 Jie Zhang <jie@codesourcery.com>
+
+ PR testsuite/47622
+ Revert
+ 2011-02-05 Jie Zhang <jie@codesourcery.com>
+ PR debug/42631
+ * web.c (entry_register): Don't clobber the number of the
+ first uninitialized reference in used[].
+
+2011-02-09 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/47664
+ * ipa-inline.c (cgraph_decide_inlining_incrementally): Visit
+ all edges again.
+
+2011-02-09 David Edelsohn <dje.gcc@gmail.com>
+
+ PR target/46481
+ PR target/47032
+ * config/rs6000/aix61.h (PROCESSOR_DEFAULT): Change to
+ PROCESSOR_POWER7.
+ (PROCESSOR_DEFAULT64): Same.
+ (RS6000_DEFAULT_LONG_DOUBLE_SIZE): Delete.
+
+2011-02-09 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * config/mips/iris6.h (TARGET_C99_FUNCTIONS): Define.
+
+2011-02-09 Martin Jambor <mjambor@suse.cz>
+
+ PR middle-end/45505
+ * tree-sra.c (struct access): New flags grp_scalar_read and
+ grp_scalar_write. Changed description of assignment read and write
+ flags.
+ (dump_access): Dump new flags, reorder all of them.
+ (sort_and_splice_var_accesses): Set the new flag accordingly, use them
+ to detect multiple scalar reads.
+ (analyze_access_subtree): Use the new scalar read write flags instead
+ of the old flags. Adjusted comments.
+
+2011-02-08 DJ Delorie <dj@redhat.com>
+
+ PR target/47548
+ * config/m32c/m32c.c (m32c_subreg): Don't try to validate interim
+ patterns.
+
+2011-02-08 Joseph Myers <joseph@codesourcery.com>
+
+ * config/m68k/uclinux.opt: New.
+ * config.gcc (m68k-*-uclinux*): Use m68k/uclinux.opt.
+
+2011-02-08 Joseph Myers <joseph@codesourcery.com>
+
+ * config/cris/elf.opt (sim): New Driver option.
+
+2011-02-08 Joseph Myers <joseph@codesourcery.com>
+
+ * config/xtensa/elf.opt: New.
+ * config.gcc (xtensa*-*-elf*): Use xtensa/elf.opt.
+
+2011-02-08 Joseph Myers <joseph@codesourcery.com>
+
+ * config/vax/elf.opt: New.
+ * config.gcc (vax-*-linux*, vax-*-netbsdelf*): Use vax/elf.opt.
+
+2011-02-08 Joseph Myers <joseph@codesourcery.com>
+
+ * config/rs6000/aix64.opt (posix, pthread): New Driver options.
+
+2011-02-08 Joseph Myers <joseph@codesourcery.com>
+
+ * config/gnu-user.opt: New.
+ * config.gcc (*-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu |
+ *-*-knetbsd*-gnu | *-*-gnu* | *-*-kopensolaris*-gnu,
+ *-*-uclinux*): Use gnu-user.opt.
+
+2011-02-08 Thomas Schwinge <thomas@schwinge.name>
+
+ * config/gnu.h (CPP_SPEC, LIB_SPEC): Remove handling of -bsd option.
+ * config/i386/gnu.h (CPP_SPEC): Likewise.
+
+2011-02-08 Ian Lance Taylor <iant@google.com>
+
+ * common.opt (fcx-limited-range): Add SetByCombined flag.
+ (ffinite-math-only, fmath-errno, frounding-math): Likewise.
+ (fsignaling-nans, fsigned-zeros, ftrapping-math): Likewise.
+ (fassociative-math, freciprocal-math): Likewise.
+ (funsafe-math-optimizations): Likewise.
+ * opth-gen.awk: Handle SetByCombined.
+ * optc-gen.awk: Likewise.
+ * opts.c (set_fast_math_flags): Don't override flag if set by frontend.
+ (set_unsafe_math_optimizations_flags): Likewise.
+ * doc/options.texi (Option properties): Document SetByCombined.
+
+2011-02-08 Joseph Myers <joseph@codesourcery.com>
+
+ * config.gcc (arc-*, alpha*-*-gnu*, arm*-*-netbsd*, arm-*-pe*,
+ i[34567]86-*-interix3*, i[34567]86-*-netbsd*, i[34567]86-*-pe,
+ m68hc11-*-*, m6811-*-*, m68hc12-*-*, m6812-*-*,
+ m68k-*-uclinuxoldabi*, mcore-*-pe*, powerpc*-*-gnu*,
+ sh*-*-symbianelf*, vax-*-netbsd*): Mark obsolete.
+
+2011-02-08 Sebastian Pop <sebastian.pop@amd.com>
+
+ PR tree-optimization/46834
+ PR tree-optimization/46994
+ PR tree-optimization/46995
+ * graphite-sese-to-poly.c (used_outside_reduction): New.
+ (detect_commutative_reduction): Call used_outside_reduction.
+ (rewrite_commutative_reductions_out_of_ssa_close_phi): Call
+ translate_scalar_reduction_to_array only when at least one
+ loop-phi/close-phi tuple has been detected.
+
+2011-02-08 Richard Guenther <rguenther@suse.de>
+
+ PR middle-end/47639
+ * tree-vect-generic.c (expand_vector_operations_1): Update
+ stmts here ...
+ (expand_vector_operations): ... not here. Cleanup EH info
+ and the CFG if required.
+
+2011-02-08 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/47641
+ * tree-ssa.c (execute_update_addresses_taken): For asm outputs
+ require type compatibility.
+
+2011-02-08 Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
+
+ * gimple-low.c (lower_function_body): Don't remove the location of
+ the return statement here.
+ (lower_gimple_return): Do it here instead but only if the return
+ statement is actually used twice.
+
+2011-02-08 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/47632
+ * tree-ssa-forwprop.c (remove_prop_source_from_use): Remove
+ unused up_to_stmt parameter, return whether cfg-cleanup is
+ necessary, remove EH info properly.
+ (forward_propagate_into_gimple_cond): Adjust caller.
+ (forward_propagate_into_cond): Likewise.
+ (forward_propagate_comparison): Likewise.
+ (tree_ssa_forward_propagate_single_use_vars): Make
+ forward_propagate_comparison case similar to the two others.
+
+2011-02-08 Nick Clifton <nickc@redhat.com>
+
+ * config/mn10300/mn10300.opt (mliw): New command line option.
+ * config/mn10300/mn10300.md (UNSPEC_LIW): New unspec.
+ (liw_bundling): New automaton.
+ (liw): New attribute.
+ (liw_op): New attribute.
+ (liw_op1, liw_op2, liw_both, liw_either): New reservations.
+ (movsi_internal): Add LIW attributes.
+ (andsi3): Likewise.
+ (iorsi3): Likewise.
+ (xorsi3): Likewise.
+ (addsi3): Separate register and immediate alternatives.
+ Add LIW attributes.
+ (subsi3): Likewise.
+ (cmpsi): Likewise.
+ (aslsi3): Likewise.
+ (lshrsi3): Likewise.
+ (ashrsi3): Likewise.
+ (liw): New pattern.
+ * config/mn10300/mn10300.c (liw_op_names): New
+ (mn10300_print_operand): Handle 'W' operand descriptor.
+ (extract_bundle): New function.
+ (check_liw_constraints): New function.
+ (liw_candidate): New function.
+ (mn10300_bundle_liw): New function.
+ (mn10300_reorg): New function.
+ (TARGET_MACHINE_DEPENDENT_REORG): Define.
+ (TARGET_DEFAULT_TARGET_FLAGS): Add MASK_ALLOW_LIW.
+ * config/mn10300/mn10300.h (TARGET_CPU_CPP_BUILTINS): Define
+ __LIW__ or __NO_LIW__.
+ * doc/invoke.texi: Describe the -mliw command line option.
+
+2011-02-07 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
+
+ * config.gcc (hppa[12]*-*-hpux11*): Don't set extra_parts.
+ * config/pa/stublib.c (pthread_default_stacksize_np, pthread_mutex_lock,
+ pthread_mutex_unlock): Remove.
+ * config/pa/t-pa-hpux11: Remove rules to build pthread stubs.
+ * config/pa/t-pa64: Likewise.
+ * config/pa/pa64-hpux.h (LIB_SPEC): In static links, link against
+ shared libc if not linking against libpthread.
+ * config/pa/pa-hpux11.h (LIB_SPEC): Likewise.
+
+2011-02-07 Iain Sandoe <iains@gcc.gnu.org>
+
+ PR target/47558
+ * config/darwin10.h (LINK_GCC_C_SEQUENCE_SPEC): Put -lSystem first
+ on 10.6 and later to ensure that we always use the unwinder from
+ the system. Only add -no_compact_unwind when tarteting darwin
+ 10.6 or later.
+
+2011-02-07 Steve Ellcey <sje@cup.hp.com>
+
+ PR target/46997
+ * vect.md (vec_interleave_highv2sf): Change fmix for TARGET_BIG_ENDIAN.
+ (vec_interleave_lowv2sf): Ditto.
+ (vec_extract_evenv2sf): Add TARGET_BIG_ENDIAN check.
+ (vec_extract_oddv2sf): Ditto.
+
+2011-02-07 Mike Stump <mikestump@comcast.net>
+
+ PR target/42333
+ Add __ieee_divdc3 entry point.
+ * config/i386/darwin.h (DECLARE_LIBRARY_RENAMES): Retain ___divdc3
+ entry point.
+ (SUBTARGET_INIT_BUILTINS): Call darwin_rename_builtins.
+ * config/i386/i386.c (TARGET_INIT_LIBFUNCS): Likewise.
+ * config/darwin.c (darwin_rename_builtins): Add.
+ * config/darwin-protos.h (darwin_rename_builtins): Add.
+
+2011-02-07 Michael Meissner <meissner@linux.vnet.ibm.com>
+
+ PR target/47636
+ * config/rs6000/rs6000.md (rsqrt<mode>2): Use the correct macro
+ for the condition.
+
+2011-02-07 Mike Stump <mikestump@comcast.net>
+
+ * config/darwin.opt (mmacosx-version-min): Update default OS version.
+
+2011-02-07 Denis Chertykov <chertykov@gmail.com>
+
+ PR target/47534
+ * config/avr/libgcc.S (exit): Move .endfunc
+
+2011-02-07 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/47615
+ * tree-ssa-sccvn.h (run_scc_vn): Take a vn-walk mode argument.
+ * tree-ssa-sccvn.c (default_vn_walk_kind): New global.
+ (run_scc_vn): Initialize it.
+ (visit_reference_op_load): Use it.
+ * tree-ssa-pre.c (execute_pre): Use VN_WALK if in PRE.
+
+2011-02-07 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
+
+ * config/spu/spu.c (spu_init_libfuncs): Install SImode and
+ DImode trapping arithmetic libfuncs.
+
+2011-02-07 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/47621
+ * tree-ssa.c (non_rewritable_lvalue_p): New function, split out from
+ two duplicates ...
+ (execute_update_addresses_taken): ... here. Make it more
+ conservative in what we accept.
+
+2011-02-06 Joseph Myers <joseph@codesourcery.com>
+
+ * config/sparc/freebsd.h (ASM_SPEC): Define.
+ * config/sparc/vxworks.h (ASM_SPEC): Define.
+
+2011-02-06 Joseph Myers <joseph@codesourcery.com>
+
+ * config/sparc/sol2-bi.h (CC1_SPEC): Remove %{sun4:} %{target:}.
+
+2011-02-06 Steven Bosscher <steven@gcc.gnu.org>
+
+ * doc/invoke.texi: Remove reference to compiler internals from
+ user documentation.
+
+ * reg-notes.def: Remove REG_VALUE_PROFILE.
+ * combine.c (distribute_notes): Do not handle REG_VALUE_PROFILE.
+
+2011-02-05 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/47610
+ * varasm.c (default_section_type_flags): If decl is NULL,
+ and name is .data.rel.ro or .data.rel.ro.local, set SECTION_RELRO bit.
+
+2011-02-05 Jie Zhang <jie@codesourcery.com>
+
+ PR debug/42631
+ * web.c (entry_register): Don't clobber the number of the
+ first uninitialized reference in used[].
+
+2011-02-04 Sebastian Pop <sebastian.pop@amd.com>
+
+ PR tree-optimization/46194
+ * tree-data-ref.c (analyze_miv_subscript): Remove comment.
+ (build_classic_dist_vector_1): Do not represent classic distance
+ vectors when the access functions are variating in different loops.
+
+2011-02-04 Joseph Myers <joseph@codesourcery.com>
+
+ * config/mips/iris6.opt: New.
+ * config.gcc (mips-sgi-irix6.5*): Use mips/iris6.opt.
+
+2011-02-04 Richard Henderson <rth@redhat.com>
+ Steve Ellcey <sje@cup.hp.com>
+
+ PR target/46997
+ * config/ia64/predicates.md (mux1_brcst_element): New.
+ * config/ia64/ia64-protos.h (ia64_unpack_assemble): New.
+ * config/ia64/ia64.c (ia64_unpack_assemble): New.
+ (ia64_unpack_sign): New.
+ (ia64_expand_unpack): Rewrite using new routines.
+ (ia64_expand_widen_sum): Ditto.
+ (ia64_expand_dot_prod_v8qi): Ditto.
+ * config/ia64/vect.md (mulv8qi3): Rewrite to use new
+ routines, add endian check.
+ (pmpy2_even): Rename from pmpy2_r, add endian check.
+ (pmpy2_odd): Rename from pmpy2_l, add endian check.
+ (vec_widen_smult_lo_v4hi): Rewrite using new routines.
+ (vec_widen_smult_hi_v4hi): Ditto.
+ (vec_widen_umult_lo_v4hi): Ditto.
+ (vec_widen_umult_hi_v4hi): Ditto.
+ (mulv2si3): Change endian checks.
+ (sdot_prodv4hi): Rewrite with new calls.
+ (udot_prodv4hi): New.
+ (vec_pack_ssat_v4hi): Add endian check.
+ (vec_pack_usat_v4hi): Ditto.
+ (vec_pack_ssat_v2si): Ditto.
+ (max1_even): Rename from max1_r, add endian check.
+ (max1_odd): Rename from max1_l, add endian check.
+ (*mux1_rev): Format change.
+ (*mux1_mix): Ditto.
+ (*mux1_shuf): Ditto.
+ (*mux1_alt): Ditto.
+ (*mux1_brcst_v8qi): Use new predicate.
+ (vec_extract_evenv8qi): Remove endian check.
+ (vec_extract_oddv8qi): Ditto.
+ (vec_interleave_lowv4hi): Format change.
+ (vec_interleave_highv4hi): Ditto.
+ (mix2_even): Rename from mix2_r, add endian check.
+ (mix2_odd): Rename from mux2_l, add endian check.
+ (*mux2): Fix mask setting for TARGET_BIG_ENDIAN.
+ (vec_extract_evenodd_helper): Format change.
+ (vec_extract_evenv4hi): Remove endian check.
+ (vec_extract_oddv4hi): Remove endian check.
+ (vec_interleave_lowv2si): Format change.
+ (vec_interleave_highv2si): Format change.
+ (vec_initv2si): Remove endian check.
+ (vecinit_v2si): Add endian check.
+ (reduc_splus_v2sf): Add endian check.
+ (reduc_smax_v2sf): Ditto.
+ (reduc_smin_v2sf): Ditto.
+ (vec_initv2sf): Remove endian check.
+ (fpack): Add endian check.
+ (fswap): Add endian check.
+ (vec_interleave_highv2sf): Add endian check.
+ (vec_interleave_lowv2sf): Add endian check.
+ (fmix_lr): Add endian check.
+ (vec_setv2sf): Format change.
+ (*vec_extractv2sf_0_be): Use shift to extract operand.
+ (*vec_extractv2sf_1_be): New.
+ (vec_pack_trunc_v4hi): Add endian check.
+ (vec_pack_trunc_v2si): Format change.
+
+2011-02-04 Jakub Jelinek <jakub@redhat.com>
+
+ PR inline-asm/23200
+ * tree-ssa-ter.c (is_replaceable_p): Add TER argument. Don't
+ do bb, locus and block comparison and disallow loads if it is not set.
+ (stmt_is_replaceable_p): New function.
+ (process_replaceable, find_replaceable_in_bb): Adjust is_replaceable_p
+ callers.
+ * expr.c (expand_expr_real_1) <case SSA_NAME>: If
+ get_gimple_for_ssa_name try for EXPAND_INITIALIZER harder to use
+ SSA_NAME_DEF_STMT.
+ * tree-flow.h (stmt_is_replaceable_p): New prototype.
+
+2011-02-04 Joseph Myers <joseph@codesourcery.com>
+
+ * config/rs6000/xilinx.opt: New.
+ * config.gcc (powerpc-xilinx-eabi*): Use rs6000/xilinx.opt.
+
+2011-02-04 Joseph Myers <joseph@codesourcery.com>
+
+ * config/mips/mips.opt (EB, EL, noasmopt): New Driver options.
+
+2011-02-03 Anatoly Sokolov <aesok@post.ru>
+
+ * config/xtensa/xtensa.h (PREFERRED_RELOAD_CLASS,
+ PREFERRED_OUTPUT_RELOAD_CLASS): Remove.
+ * config/xtensa/xtensa-protos.h (xtensa_preferred_reload_class,
+ secondary_reload_info, xtensa_secondary_reload): Remove.
+ * config/xtensa/xtensa.c (TARGET_PREFERRED_RELOAD_CLASS,
+ TARGET_PREFERRED_OUTPUT_RELOAD_CLASS): Define.
+ (xtensa_preferred_reload_class): Make static. Change return and
+ 'rclass' argument type to reg_class_t. Remove 'isoutput' argument.
+ Use CONST_DOUBLE_P predicate.
+ (xtensa_preferred_output_reload_class): New function.
+ (xtensa_secondary_reload): Make static.
+
+2011-02-03 Joseph Myers <joseph@codesourcery.com>
+
+ * config/microblaze/microblaze.opt (Zxl-mode-bootstrap,
+ Zxl-mode-executable, Zxl-mode-novectors, Zxl-mode-xilkernel,
+ Zxl-mode-xmdstub, mxl-mode-xilkernel): New Driver options.
+
+2011-02-03 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/31490
+ * output.h (SECTION_RELRO): Define.
+ (SECTION_MACH_DEP): Adjust.
+ (get_variable_section): New prototype.
+ * varpool.c (varpool_finalize_named_section_flags): New function.
+ (varpool_assemble_pending_decls): Call it.
+ * cgraph.h (varpool_finalize_named_section_flags): New prototype.
+ * cgraphunit.c (cgraph_output_in_order): Call
+ varpool_finalize_named_section_flags.
+ * varasm.c (get_section): Allow section flags conflicts between
+ relro and read-only sections if the section hasn't been declared yet.
+ Set SECTION_OVERRIDE after diagnosing section type conflict.
+ (get_variable_section): No longer static.
+ (default_section_type_flags): Use SECTION_WRITE | SECTION_RELRO for
+ readonly sections that need relocations.
+ (decl_readonly_section_1): New function.
+ (decl_readonly_section): Use it.
+
+ Revert:
+ 2010-11-17 Dinar Temirbulatov <dtemirbulatov@gmail.com>
+ Steve Ellcey <sje@cup.hp.com>
+
+ PR middle-end/31490
+ * varasm.c (categorize_decl_for_section): Ignore reloc_rw_mask
+ if section attribute used.
+
+2011-02-03 Jakub Jelinek <jakub@redhat.com>
+
+ * config/darwin.h (SECTION_NO_ANCHOR): Remove.
+ * config/darwin.c (SECTION_NO_ANCHOR): Define.
+ (darwin_init_sections): Remove assertion.
+
+2011-02-03 Nick Clifton <nickc@redhat.com>
+
+ * config/rx/predicates.md (rx_zs_comparison_operator): Remove
+ lt and ge.
+ * config/rx/rx.md (abssi2_flags): Use CC_ZSmode rather than CC_ZSOmode.
+ * config/rx/rx.c (rx_print_operand): Use "lt" and "ge" suffixes
+ instead of "n" and "pz".
+ (flags_from_code): LT and GE tests need CC_FLAG_O as well as
+ CC_FLAG_S.
+
+2011-02-03 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/47312
+ * expr.c (expand_expr_real_2) <case FMA_EXPR>: If target doesn't expand
+ fma, expand FMA_EXPR as fma{,f,l} call.
+
+ PR lto/47274
+ * lto-streamer-out.c (write_symbol): When writing kind and visibility,
+ copy them into a unsigned char variable and pass address of it to
+ lto_output_data_stream.
+
+ PR target/47564
+ * toplev.c (target_reinit): Save and restore *crtl and regno_reg_rtx
+ around backend_init_target and lang_dependent_init_target calls.
+ * cgraphunit.c (cgraph_debug_gimple_stmt): New function.
+ (verify_cgraph_node): Don't call set_cfun here. Use
+ cgraph_debug_gimple_stmt instead of debug_gimple_stmt.
+ Set error_found for incorrectly represented calls to thunks.
+
+2011-02-03 Alexandre Oliva <aoliva@redhat.com>
+
+ PR debug/43092
+ PR rtl-optimization/43494
+ * rtl.h (for_each_inc_dec_fn): New type.
+ (for_each_inc_dec): Declare.
+ * rtlanal.c (struct for_each_inc_dec_ops): New type.
+ (for_each_inc_dec_find_inc_dec): New fn.
+ (for_each_inc_dec_find_mem): New fn.
+ (for_each_inc_dec): New fn.
+ * dse.c (struct insn_size): Remove.
+ (replace_inc_dec, replace_inc_dec_mem): Remove.
+ (emit_inc_dec_insn_before): New fn.
+ (check_for_inc_dec): Use it, along with for_each_inc_dec.
+ (canon_address): Pass mem modes to cselib_lookup.
+ * cselib.h (cselib_lookup): Add memmode argument. Adjust callers.
+ (cselib_lookup_from_insn): Likewise.
+ (cselib_subst_to_values): Likewise.
+ * cselib.c (find_slot_memmode): New var.
+ (cselib_find_slot): New fn. Use it instead of
+ htab_find_slot_with_hash everywhere.
+ (entry_and_rtx_equal_p): Use find_slot_memmode.
+ (autoinc_split): New fn.
+ (rtx_equal_for_cselib_p): Rename and implement in terms of...
+ (rtx_equal_for_cselib_1): ... this. Take memmode, pass it on.
+ Deal with autoinc. Special-case recursion into MEMs.
+ (cselib_hash_rtx): Likewise.
+ (cselib_lookup_mem): Infer pmode from address mode. Distinguish
+ address and MEM modes.
+ (cselib_subst_to_values): Add memmode, pass it on.
+ Deal with autoinc.
+ (cselib_lookup): Add memmode argument, pass it on.
+ (cselib_lookup_from_insn): Add memmode.
+ (cselib_invalidate_rtx): Discard obsolete push_operand handling.
+ (struct cselib_record_autoinc_data): New.
+ (cselib_record_autoinc_cb): New fn.
+ (cselib_record_sets): Use it, along with for_each_inc_dec. Pass MEM
+ mode to cselib_lookup. Reset autoinced REGs here instead of...
+ (cselib_process_insn): ... here.
+ * var-tracking.c (replace_expr_with_values, use_type): Pass MEM mode
+ to cselib_lookup.
+ (add_uses): Likewise, also to cselib_subst_to_values.
+ (add_stores): Likewise.
+ * sched-deps.c (add_insn_mem_dependence): Pass mode to
+ cselib_subst_to_values.
+ (sched_analyze_1, sched_analyze_2): Likewise. Adjusted.
+ * gcse.c (do_local_cprop): Adjusted.
+ * postreload.c (reload_cse_simplify_set): Adjusted.
+ (reload_cse_simplify_operands): Adjusted.
+ * sel-sched-dump (debug_mem_addr_value): Pass mode.
+
+2011-02-03 Alexandre Oliva <aoliva@redhat.com>
+
+ PR tree-optimization/45122
+ * tree-ssa-loop-niter.c (number_of_iterations_exit): Don't make
+ unsafe assumptions when there's more than one loop exit.
+
+2011-02-02 Michael Meissner <meissner@linux.vnet.ibm.com>
+
+ PR target/47272
+ * doc/extend.texi (PowerPC AltiVec/VSX Built-in Functions):
+ Document using vector double with the load/store builtins, and
+ that the load/store builtins always use Altivec instructions.
+
+ * config/rs6000/vector.md (vector_altivec_load_<mode>): New insns
+ to use altivec memory instructions, even on VSX.
+ (vector_altivec_store_<mode>): Ditto.
+
+ * config/rs6000/rs6000-protos.h (rs6000_address_for_altivec): New
+ function.
+
+ * config/rs6000/rs6000-c.c (altivec_overloaded_builtins): Add
+ V2DF, V2DI support to load/store overloaded builtins.
+
+ * config/rs6000/rs6000-builtin.def (ALTIVEC_BUILTIN_*): Add
+ altivec load/store builtins for V2DF/V2DI types.
+
+ * config/rs6000/rs6000.c (rs6000_option_override_internal): Don't
+ set avoid indexed addresses on power6 if -maltivec.
+ (altivec_expand_ld_builtin): Add V2DF, V2DI support, use
+ vector_altivec_load/vector_altivec_store builtins.
+ (altivec_expand_st_builtin): Ditto.
+ (altivec_expand_builtin): Add VSX memory builtins.
+ (rs6000_init_builtins): Add V2DI types to internal types.
+ (altivec_init_builtins): Add support for V2DF/V2DI altivec
+ load/store builtins.
+ (rs6000_address_for_altivec): Insure memory address is appropriate
+ for Altivec.
+
+ * config/rs6000/vsx.md (vsx_load_<mode>): New expanders for
+ vec_vsx_ld and vec_vsx_st.
+ (vsx_store_<mode>): Ditto.
+
+ * config/rs6000/rs6000.h (RS6000_BTI_long_long): New type
+ variables to hold long long types for VSX vector memory builtins.
+ (RS6000_BTI_unsigned_long_long): Ditto.
+ (long_long_integer_type_internal_node): Ditti.
+ (long_long_unsigned_type_internal_node): Ditti.
+
+ * config/rs6000/altivec.md (UNSPEC_LVX): New UNSPEC.
+ (altivec_lvx_<mode>): Make altivec_lvx use a mode iterator.
+ (altivec_stvx_<mode>): Make altivec_stvx use a mode iterator.
+
+ * config/rs6000/altivec.h (vec_vsx_ld): Define VSX memory builtin
+ short cuts.
+ (vec_vsx_st): Ditto.
+
+2011-02-02 Joseph Myers <joseph@codesourcery.com>
+
+ * config/pa/pa-hpux10.opt: New.
+ * config/hpux11.opt (pthread): New Driver option.
+ * config/pa/pa-hpux.opt (nolibdld, rdynamic): New Driver options.
+ * config.gcc (hppa[12]*-*-hpux10*): Use pa/pa-hpux10.opt.
+
+2011-02-02 Joseph Myers <joseph@codesourcery.com>
+
+ * config/ia64/vms.opt: New.
+ * config.gcc (ia64-hp-*vms*): Use ia64/vms.opt.
+
+2011-02-01 Michael Meissner <meissner@linux.vnet.ibm.com>
+
+ PR target/47580
+ * config/rs6000/vsx.md (vsx_float<VSi><mode>2): Use
+ gpc_reg_operand instead of vsx_register_operand to match rs6000.md
+ generator functions.
+ (vsx_floatuns<VSi><mode>2): Ditto.
+ (vsx_fix_trunc<mode><VSi>2): Ditto.
+ (vsx_fixuns_trunc<mode><VSi>2): Ditto.
+
+2011-02-02 Joseph Myers <joseph@codesourcery.com>
+
+ * config/i386/djgpp.opt (posix): New Driver option.
+
+2011-02-02 Gerald Pfeifer <gerald@pfeifer.com>
+
+ * config.gcc (*-*-freebsd[12], *-*-freebsd[12].*, *-*-freebsd*aout*):
+ Move to the unsupported targets list.
+
+2011-02-02 Peter Bergner <bergner@vnet.ibm.com>
+
+ PR rtl-optimization/47525
+ * df-scan.c: Update copyright years.
+ (df_get_call_refs): Do not mark global registers as DF_REF_REG_USE
+ and non-clobber DF_REF_REG_DEF for calls to const and pure functions.
+
+2011-02-02 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * config/i386/sysv4.h (TARGET_VERSION): Remove.
+ (SUBTARGET_RETURN_IN_MEMORY): Remove.
+ (ASM_OUTPUT_ASCII): Remove.
+ * config/i386/sol2.h (SUBTARGET_RETURN_IN_MEMORY): Remove #undef.
+
+2011-02-02 Jeff Law <law@redhat.com>
+
+ PR middle-end/47543
+ * reload.c (find_reloads_address): Handle reg+d address where both
+ components are invalid by reloading the entire address.
+
+2011-02-02 Sebastian Pop <sebastian.pop@amd.com>
+ Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/40979
+ PR bootstrap/47044
+ * passes.c (init_optimization_passes): After LIM call copy_prop
+ and DCE to clean up.
+ * tree-ssa-loop.c (pass_graphite_transforms): Add TODO_dump_func.
+
+2011-02-02 Sebastian Pop <sebastian.pop@amd.com>
+
+ PR tree-optimization/47576
+ PR tree-optimization/47555
+ * doc/invoke.texi (scev-max-expr-complexity): Documented.
+ * params.def (PARAM_SCEV_MAX_EXPR_SIZE): Bump the value to 100.
+ (PARAM_SCEV_MAX_EXPR_COMPLEXITY): Declared.
+ * tree-scalar-evolution.c (follow_ssa_edge): Use
+ PARAM_SCEV_MAX_EXPR_COMPLEXITY.
+
+2011-02-02 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/47566
+ * builtins.c (builtin_save_expr): No SAVE_EXPR for SSA_NAMEs.
+
+2011-02-02 Alexandre Oliva <aoliva@redhat.com>
+
+ PR debug/47106
+ PR debug/47402
+ * tree-inline.c (declare_return_variable): Remove unused caller
+ variable.
+
+ PR debug/47106
+ PR debug/47402
+ * tree-flow-inline.h (clear_is_used, is_used_p): New.
+ * cfgexpand.c (account_used_vars_for_block): Use them.
+ * tree-nrv.c (tree_nrv): Likewise.
+ * tree-ssa-live.c (remove_unused_scope_block_p): Likewise.
+ (dump_scope_block): Likewise.
+ (remove_unused_locals): Likewise.
+
+ PR debug/47106
+ PR debug/47402
+ * tree-inline.c (declare_return_variable): Add result decl to
+ local decls only once.
+ * gimple-low.c (record_vars_into): Mark newly-created variables
+ as referenced.
+
+2011-02-02 Alexandre Oliva <aoliva@redhat.com>
+
+ PR debug/47498
+ PR debug/47501
+ PR debug/45136
+ PR debug/45130
+ * haifa-sched.c (get_ebb_head_tail): Move notes across boundary
+ debug insns.
+ (no_real_insns_p, schedule_block, set_priorities): Drop special
+ treatment of boundary debug insns.
+ * sched-deps.c (sd_init_insn, sd_finish_insn): Don't mark debug insns.
+ * sched-ebb.c (schedule_ebbs): Adjust skipping of debug insns.
+ * sched-int.h (DEBUG_INSN_SCHED_P): Remove.
+ (BOUNDARY_DEBUG_INSN_P): Likewise.
+ (SCHEDULE_DEBUG_INSN_P): Likewise.
+ * sched-rgn.c (init_ready_list): Drop special treatment of
+ boundary debug insns.
+ * final.c (rest_of_clean_state): Clear notes' BB.
+
+2011-02-01 Joseph Myers <joseph@codesourcery.com>
+
+ * config/openbsd.opt (assert=): New Driver option.
+
+2011-02-01 Joseph Myers <joseph@codesourcery.com>
+
+ * config/i386/nto.opt: New.
+ * config.gcc (i[34567]86-*-nto-qnx*): Use i386/nto.opt.
+
+2011-02-01 Joseph Myers <joseph@codesourcery.com>
+
+ * config/i386/netware.opt: New.
+ * config.gcc (i[3456x]86-*-netware*): Use i386/netware.opt.
+
+2011-02-01 Joseph Myers <joseph@codesourcery.com>
+
+ * config/interix.opt (posix): New Driver option.
+
+2011-02-01 DJ Delorie <dj@redhat.com>
+
+ * config/m32c/m32c.h (PTRDIFF_TYPE): Remove extra definition.
+
+ * config/m32c/m32c.c (m32c_regno_reg_class): Return smallest reg
+ class for A0/A1.
+
+2011-02-01 Sebastian Pop <sebastian.pop@amd.com>
+
+ PR tree-optimization/47561
+ * toplev.c (process_options): Print the Graphite flags. Add
+ flag_loop_flatten to the list of options requiring Graphite.
+
+2011-02-01 Joseph Myers <joseph@codesourcery.com>
+
+ * config/i386/cygming.opt (posix): New Driver option.
+
+2011-02-01 Joseph Myers <joseph@codesourcery.com>
+
+ * config/arm/vxworks.opt: New.
+ * config.gcc (arm-wrs-vxworks): Use arm/vxworks.opt.
+
+2011-02-01 Joseph Myers <joseph@codesourcery.com>
+
+ * config/alpha/elf.opt: New.
+ * config.gcc (alpha*-*-linux*, alpha*-*-gnu*, alpha*-*-freebsd*,
+ alpha*-*-netbsd*, alpha*-*-openbsd*): Use alpha/elf.opt.
+
+2011-02-01 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/47559
+ * tree-ssa-loop-im.c (can_sm_ref_p): Do not perform
+ store-motion on references that can throw.
+
+2011-02-01 Bernd Schmidt <bernds@codesourcery.com>
+
+ * tree-dump.c (dump_option_value_info): Add entry for TDF_CSELIB.
+ * tree-pass.h (TDF_CSELIB): New macro.
+ * cselib.c (new_cselib_val, expand_loc, cselib_expand_value_rtx_1,
+ cselib_lookup): Check for it rather than for TDF_DETAILS.
+
+2011-02-01 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR driver/47547
+ * lto-wrapper.c (run_gcc): Don't add -dumpdir if linker_output
+ is HOST_BIT_BUCKET.
+
+ * opts.c (finish_options): Don't add x_aux_base_name if it is
+ HOST_BIT_BUCKET.
+
+2011-02-01 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/47555
+ Revert
+ 2010-07-15 Sebastian Pop <sebastian.pop@amd.com>
+
+ * params.def (PARAM_SCEV_MAX_EXPR_SIZE): Bump the value to 100.
+
+2011-02-01 Sebastien Bourdeauducq <sebastien@milkymist.org>
+
+ PR gcc/46692
+ * config/lm32/t-lm32: Add multilib for all CPU options.
+
+2011-02-01 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/47541
+ * tree-ssa-structalias.c (push_fields_onto_fieldstack): Make
+ sure to have a field at offset zero.
+
+2011-01-31 Joseph Myers <joseph@codesourcery.com>
+
+ * config/arc/arc.opt (EB, EL): New Driver options.
+
+2011-01-31 Joseph Myers <joseph@codesourcery.com>
+
+ * config/alpha/osf5.opt: New.
+ * config.gcc (alpha*-dec-osf5.1*): Use alpha/osf5.opt.
+
+2011-01-31 Joseph Myers <joseph@codesourcery.com>
+
+ * config/vms/vms.opt (map, mvms-return-codes): New Driver options.
+
+2011-01-31 Sebastian Pop <sebastian.pop@amd.com>
+
+ * common.opt (ftree-loop-linear): Use Alias to make it an alias of
+ -floop-interchange.
+ * invoke.texi (-ftree-loop-linear): Make it clear that this flag
+ is an alias of -floop-interchange and that it requires the
+ Graphite infrastructure.
+ * tree-ssa-loop.c (gate_graphite_transforms): Do not set
+ flag_loop_interchange based on the value of flag_tree_loop_linear.
+
+2011-01-31 Jakub Jelinek <jakub@redhat.com>
+ Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/47538
+ * tree-ssa-ccp.c (bit_value_binop_1): For uns computation use
+ type instead of r1type, except for comparisons. For right
+ shifts and comparisons punt if there are mismatches in
+ sizetype vs. non-sizetype types.
+
+2011-01-31 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * doc/sourcebuild.texi (Effective-Target Keywords): Document
+ avx_runtime.
+
+2011-01-31 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * configure.ac (gcc_cv_ld_eh_frame_hdr): Update minimal Sun ld
+ version number.
+ * configure: Regenerate.
+
+2011-01-31 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * configure.ac (gcc_cv_ld_static_option): Define.
+ (gcc_cv_ld_dynamic_option): Define.
+ (gcc_cv_ld_static_dynamic): Tru64 UNIX support -noso/-so_archive
+ instead.
+ (HAVE_LD_STATIC_DYNAMIC): Update message.
+ (LD_STATIC_OPTION): Define.
+ (LD_DYNAMIC_OPTION): Define.
+ * configure: Regenerate.
+ * config.in: Regenerate.
+ * gcc.c (init_spec) [USE_LIBUNWIND_EXCEPTIONS &&
+ HAVE_LD_STATIC_DYNAMIC]: Use them.
+
+2011-01-31 Nick Clifton <nickc@redhat.com>
+
+ * config/rx/rx.c (rx_get_stack_layout): Only save call clobbered
+ registers inside interrupt handlers if the handler is not a leaf
+ function.
+
+2011-01-31 Nick Clifton <nickc@redhat.com>
+
+ * config/mn10300/mn10300.c (mn10300_regno_in_class_p): Check for
+ reg_renumber returning an INVALID_REGNUM.
+
+2011-01-31 Alexandre Oliva <aoliva@redhat.com>
+
+ PR libgcj/44341
+ * doc/install.texi: Document host options discarded when cross
+ configuring target libraries.
+
+2011-01-31 Alexandre Oliva <aoliva@redhat.com>
+
+ Reverted:
+ 2011-01-25 Alexandre Oliva <aoliva@redhat.com>
+ PR debug/45136
+ PR debug/45130
+ * haifa-sched.c (get_ebb_head_tail): Move notes across boundary
+ debug insns.
+ (no_real_insns_p, schedule_block, set_priorities): Drop special
+ treatment of boundary debug insns.
+ * sched-deps.c (sd_init_insn, sd_finish_insn): Don't mark debug insns.
+ * sched-ebb.c (schedule_ebbs): Don't skip debug insns.
+ * sched-int.h (DEBUG_INSN_SCHED_P): Remove.
+ (BOUNDARY_DEBUG_INSN_P): Likewise.
+ (SCHEDULE_DEBUG_INSN_P): Likewise.
+ * sched-rgn.c (init_ready_list): Drop special treatment of
+ boundary debug insns.
+ * final.c (rest_of_clean-state): Clear notes' BB.
+
+2011-01-31 Alan Modra <amodra@gmail.com>
+
+ * config/rs6000/rs6000.c (print_operand): Rearrange addends in
+ toc relative expressions as we do in print_operand_address.
+
+2011-01-30 Kazu Hirata <kazu@codesourcery.com>
+
+ * doc/extend.texi: Follow spelling conventions.
+ * doc/invoke.texi: Fix a typo.
+
+2011-01-30 Joseph Myers <joseph@codesourcery.com>
+
+ * config/hpux11.opt: New.
+ * config.gcc (hppa*64*-*-hpux11*, hppa[12]*-*-hpux11*,
+ ia64*-*-hpux*): Use hpux11.opt.
+
+2011-01-30 Jonathan Yong <jon_y@users.sourceforge.net>
+
+ * config.gcc (i[34567]86-*-pe | i[34567]86-*-cygwin*): Add t-dfprules
+ to tmake_file.
+
+2011-01-30 Gerald Pfeifer <gerald@pfeifer.com>
+
+ * doc/install.texi (hppa-hp-hpux10): Remove references to HP
+ support sites.
+
+2011-01-30 Gerald Pfeifer <gerald@pfeifer.com>
+
+ * doc/install.texi (Binaries): Remove outdated reference for
+ Motorola 68HC11/68HC12 downloads.
+
+2011-01-30 Gerald Pfeifer <gerald@pfeifer.com>
+
+ * doc/extend.texi (Thread-Local): Adjust reference to Ulrich
+ Drepper's paper.
+
+2011-01-29 Jonathan Wakely <jwakely.gcc@gmail.com>
+
+ PR bootstrap/47147
+ * ginclude/stddef.h: Check for _X86_64_ANSI_H_ and _I386_ANSI_H_ as
+ used by NetBSD.
+
+2011-01-28 Ahmad Sharif <asharif@google.com>
+
+ * value-prof.c (check_counter): Corrected error message.
+
+2011-01-29 Jie Zhang <jie@codesourcery.com>
+
+ * config/arm/arm.c (arm_legitimize_reload_address): New.
+ * config/arm/arm.h (ARM_LEGITIMIZE_RELOAD_ADDRESS): Use
+ arm_legitimize_reload_address.
+ * config/arm/arm-protos.h (arm_legitimize_reload_address): Declare.
+
+2011-01-28 Ian Lance Taylor <iant@google.com>
+
+ * godump.c (go_define): Ignore macros whose definitions include
+ two adjacent operands.
+
+2011-01-28 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/42894
+ * varasm.c (force_const_mem): Store copy of x in desc->constant
+ instead of x itself.
+ * expr.c (emit_move_insn): Add a copy of y_cst instead of y_cst
+ itself into REG_EQUAL note.
+
+2011-01-28 Joseph Myers <joseph@codesourcery.com>
+
+ * config/freebsd.opt (posix, rdynamic): New Driver options.
+
+2011-01-28 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * configure.ac (gcc_cv_ld_static_dynamic): IRIX 6 ld supports
+ -Bstatic/-Bdynamic.
+ * configure: Regenerate.
+
+2011-01-27 Joseph Myers <joseph@codesourcery.com>
+
+ * config/rs6000/sysv4.h (LIB_NETBSD_SPEC): Don't handle -profile.
+ * config/rs6000/vxworks.h (CC1_SPEC): Don't handle -profile.
+
+2011-01-27 Anatoly Sokolov <aesok@post.ru>
+
+ * config/s390/s390.h (PREFERRED_RELOAD_CLASS): Remove.
+ * config/s390/s390-protos.h (s390_preferred_reload_class): Remove.
+ * config/s390/s390.c (TARGET_PREFERRED_RELOAD_CLASS): Define.
+ (s390_preferred_reload_class): Make static. Change return and
+ 'rclass' argument type to reg_class_t.
+
+2011-01-27 Jan Hubicka <jh@suse.cz>
+
+ PR middle-end/46949
+ * cgraphunit.c (process_common_attributes): Fix use of remove_attribute.
+ (process_function_and_variable_attributes): Check defined weakrefs.
+
+2011-01-27 Martin Jambor <mjambor@suse.cz>
+
+ PR tree-optimization/47228
+ * tree-sra.c (sra_modify_assign): Use build_ref_for_model instead of
+ build_ref_for_offset.
+
+2011-01-27 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
+
+ * config/spu/spu-elf.h (ASM_SPEC): Remove.
+
+2011-01-26 Mikael Pettersson <mikpe@it.uu.se>
+
+ PR rtl-optimization/46856
+ * postreload.c (reload_combine_recognize_const_pattern): Do not
+ separate cc0 setter and user on cc0 targets.
+
+2011-01-26 Nicola Pero <nicola.pero@meta-innovation.com>
+
+ PR c/43082
+ * c-typeck.c (c_objc_common_truthvalue_conversion): If we are
+ passed a VOID_TYPE expression, immediately emit an error and
+ return error_mark_node.
+
+2011-01-26 Jeff Law <law@redhat.com>
+
+ PR rtl-optimization/47464
+ * df-problems.c (can_move_insn_across): Use may_trap_or_fault_p
+ rather than may_trap_p as needed.
+
+2011-01-26 DJ Delorie <dj@redhat.com>
+
+ PR rtl-optimization/46878
+ * combine.c (insn_a_feeds_b): Check for the implicit cc0
+ setter/user dependency as well.
+
+2011-01-26 Eric Botcazou <ebotcazou@adacore.com>
+
+ PR rtl-optimization/44469
+ * cfgcleanup.c (try_optimize_cfg): Iterate in CFG layout mode too
+ after removing trivially dead basic blocks.
+
+2011-01-26 Joseph Myers <joseph@codesourcery.com>
+
+ * config/bfin/bfin.h (LINK_SPEC): Remove %{Qy:} %{!Qn:-Qy}.
+ * config/frv/frv.h (LINK_SPEC): Likewise.
+ * config/i386/netware.h (LINK_SPEC): Likewise.
+ * config/m68k/linux.h (ASM_SPEC): Likewise.
+ * config/rs6000/linux64.h (ASM_SPEC_COMMON): Likewise.
+ * config/rs6000/sysv4.h (LINK_SPEC): Likewise.
+ * config/rs6000/vxworks.h (ASM_SPEC): Likewise.
+ * config/sparc/linux.h (ASM_SPEC): Likewise.
+ * config/sparc/linux64.h (ASM_SPEC): Likewise.
+ * config/sparc/sp-elf.h (ASM_SPEC): Likewise.
+
+2011-01-26 Joseph Myers <joseph@codesourcery.com>
+
+ * config/bfin/bfin.h (ASM_SPEC): Remove %{Ym,*}.
+ * config/frv/frv.h (ASM_SPEC): Likewise.
+ * config/m68k/linux.h (ASM_SPEC): Likewise.
+ * config/pa/pa-linux.h (ASM_SPEC): Likewise.
+ * config/rs6000/linux64.h (ASM_SPEC): Likewise.
+ * config/rs6000/vxworks.h (ASM_SPEC): Likewise.
+ * config/sparc/linux.h (ASM_SPEC): Likewise.
+ * config/sparc/linux64.h (ASM_SPEC): Likewise.
+ * config/sparc/sp-elf.h (ASM_SPEC): Likewise.
+
+2011-01-26 Joseph Myers <joseph@codesourcery.com>
+
+ * config/bfin/bfin.h (LINK_SPEC): Remove %{YP,*}.
+ * config/frv/frv.h (LINK_SPEC): Likewise.
+ * config/rs6000/sysv4.h (LINK_SPEC): Likewise.
+
+2011-01-26 Joseph Myers <joseph@codesourcery.com>
+
+ * config/bfin/bfin.h (ASM_SPEC): Remove %{Yd,*}.
+ * config/frv/frv.h (ASM_SPEC): Likewise.
+ * config/i386/sol2-10.h (ASM_SPEC): Likewise.
+ * config/m68k/linux.h (ASM_SPEC): Likewise.
+ * config/pa/pa-linux.h (ASM_SPEC): Likewise.
+ * config/rs6000/linux64.h (ASM_SPEC32): Likewise.
+ * config/rs6000/vxworks.h (ASM_SPEC): Likewise.
+ * config/sol2.h (ASM_SPEC): Remove comment about -Yd,.
+ * config/sparc/linux.h (ASM_SPEC): Likewise.
+ * config/sparc/linux64.h (ASM_SPEC): Likewise.
+ * config/sparc/sp-elf.h (ASM_SPEC): Likewise.
+ * config/sparc/sysv4.h (ASM_SPEC): Remove %{Yd,*}.
+
+2011-01-26 Steve Ellcey <sje@cup.hp.com>
+
+ PR target/46997
+ * config/ia64/vect.md (mulv2si3): Enable and fix for TARGET_BIG_ENDIAN.
+ (*mux2): Ditto.
+ (vec_extract_evenodd_help): Ditto.
+ (vec_extract_evenv4hi): Ditto.
+ (vec_extract_oddv4hi): Ditto.
+ (vec_interleave_lowv2si): Ditto.
+ (vec_interleave_highv2si): Ditto.
+ (vec_extract_evenv2si): Ditto.
+ (vec_extract_oddv2si: Ditto.
+ (vec_pack_trunc_v2si): Ditto.
+
+2011-01-22 Jan Hubicka <jh@suse.cz>
+
+ PR target/47237
+ * cgraph.h (cgraph_local_info): New field can_change_signature.
+ * ipa-cp.c (ipcp_update_callgraph): Only compute args_to_skip if callee
+ signature can change.
+ (ipcp_estimate_growth): Call sequence simplify only if calle signature
+ can change.
+ (ipcp_insert_stage): Only compute args_to_skip if signature can change.
+ (cgraph_function_versioning): We can not change signature of functions
+ that don't allow that.
+ * lto-cgraph.c (lto_output_node): Stream local.can_change_signature.
+ (lto_input_node): Likewise.
+ * ipa-inline.c (compute_inline_parameters): Compute
+ local.can_change_signature.
+ * ipa-split.c (visit_bb): Never split away APPLY_ARGS.
+ * tree-sra.c (ipa_sra_preliminary_function_checks): Give up on
+ functions that can not change signature.
+ * i386.c (ix86_function_regparm, ix86_function_sseregparm,
+ init_cumulative_args): Do not use local calling conventions
+ for functions that can not change signature.
+
+2011-01-22 Jan Hubicka <jh@suse.cz>
+
+ * doc/invoke.texi (hot-bb-frequency-fraction): Commit forgotten hunk.
+
+2011-01-26 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/47190
+ * cgraphunit.c (process_common_attributes): New function.
+ (process_function_and_variable_attributes): Use it.
+
+2011-01-26 Richard Guenther <rguenther@suse.de>
+
+ PR lto/47423
+ * cgraphbuild.c (record_eh_tables): Record reference to personality
+ function.
+
+2011-01-26 Alexandre Oliva <aoliva@redhat.com>
+
+ PR debug/45454
+ * sel-sched.c (moveup_expr): Don't let debug insns prevent
+ non-debug insns from moving up.
+
+2011-01-26 Dave Korn <dave.korn.cygwin@gmail.com>
+
+ PR target/40125
+ * config.gcc (i[34567]86-*-pe | i[34567]86-*-cygwin*): Select suitable
+ t-dlldir{,-x} fragment for build and add it to tmake_file.
+ (i[34567]86-*-mingw* | x86_64-*-mingw*): Likewise.
+ * Makefile.in (libgcc.mvars): Also export SHLIB_DLLDIR to libgcc.
+ * config/i386/t-dlldir: New file.
+ (SHLIB_DLLDIR): Define.
+ * config/i386/t-dlldir-x: New file.
+ (SHLIB_DLLDIR): Define.
+ * config/i386/t-cygming: Error out if SHLIB_DLLDIR is not set.
+ (SHLIB_INSTALL): Use it.
+
+2011-01-26 Chung-Lin Tang <cltang@codesourcery.com>
+
+ PR target/47246
+ * config/arm/arm.c (thumb2_legitimate_index_p): Change the
+ lower bound of the allowed Thumb-2 coprocessor load/store
+ index range to -256. Add explaining comment.
+
+2011-01-25 Ian Lance Taylor <iant@google.com>
+
+ * godump.c (go_define): Improve lexing of macro expansion to only
+ accept expressions which match Go spec.
+
+2011-01-26 Dave Korn <dave.korn.cygwin@gmail.com>
+
+ PR c++/43601
+ * tree.c (handle_dll_attribute): Handle it.
+ * doc/extend.texi (@item dllexport): Mention it.
+ * doc/invoke.texi (@item -fno-keep-inline-dllexport): Document it.
+
+2011-01-25 Ian Lance Taylor <iant@google.com>
+
+ PR tree-optimization/26854
+ * c-decl.c (struct c_scope): Add field has_jump_unsafe_decl.
+ (decl_jump_unsafe): Move higher in file, with no other change.
+ (bind): Set has_jump_unsafe_decl if appropriate.
+ (update_label_decls): Test has_jump_unsafe_decl to avoid loop.
+ (check_earlier_gotos): Likewise.
+ (c_check_switch_jump_warnings): Likewise.
+
+2011-01-25 Jonathan Wakely <jwakely.gcc@gmail.com>
+
+ * doc/invoke.texi (Warning Options): Add missing hyphen.
+ (-fprofile-dir): Minor grammatical fixes.
+ (-fbranch-probabilities): Likewise.
+
+2011-01-25 Alexandre Oliva <aoliva@redhat.com>
+
+ PR debug/45136
+ PR debug/45130
+ * haifa-sched.c (get_ebb_head_tail): Move notes across boundary
+ debug insns.
+ (no_real_insns_p, schedule_block, set_priorities): Drop special
+ treatment of boundary debug insns.
+ * sched-deps.c (sd_init_insn, sd_finish_insn): Don't mark debug insns.
+ * sched-ebb.c (schedule_ebbs): Don't skip debug insns.
+ * sched-int.h (DEBUG_INSN_SCHED_P): Remove.
+ (BOUNDARY_DEBUG_INSN_P): Likewise.
+ (SCHEDULE_DEBUG_INSN_P): Likewise.
+ * sched-rgn.c (init_ready_list): Drop special treatment of
+ boundary debug insns.
+ * final.c (rest_of_clean-state): Clear notes' BB.
+
+2011-01-25 Sebastian Pop <sebastian.pop@amd.com>
+
+ * Makefile.in (LAMBDA_H): Removed.
+ (TREE_DATA_REF_H): Remove dependence on LAMBDA_H.
+ (OBJS-common): Remove dependence on lambda-code.o, lambda-mat.o,
+ lambda-trans.o, and tree-loop-linear.o.
+ (lto-symtab.o): Remove dependence on LAMBDA_H.
+ (tree-loop-linear.o): Remove rule.
+ (lambda-mat.o): Same.
+ (lambda-trans.o): Same.
+ (lambda-code.o): Same.
+ (tree-vect-loop.o): Add missing dependence on TREE_DATA_REF_H.
+ (tree-vect-slp.o): Same.
+ * hwint.h (gcd): Moved here.
+ (least_common_multiple): Same.
+ * lambda-code.c: Removed.
+ * lambda-mat.c: Removed.
+ * lambda-trans.c: Removed.
+ * lambda.h: Removed.
+ * tree-loop-linear.c: Removed.
+ * lto-symtab.c: Do not include lambda.h.
+ * omega.c (gcd): Removed.
+ * passes.c (init_optimization_passes): Remove pass_linear_transform.
+ * tree-data-ref.c (print_lambda_vector): Moved here.
+ (lambda_vector_copy): Same.
+ (lambda_matrix_copy): Same.
+ (lambda_matrix_id): Same.
+ (lambda_vector_first_nz): Same.
+ (lambda_matrix_row_add): Same.
+ (lambda_matrix_row_exchange): Same.
+ (lambda_vector_mult_const): Same.
+ (lambda_vector_negate): Same.
+ (lambda_matrix_row_negate): Same.
+ (lambda_vector_equal): Same.
+ (lambda_matrix_right_hermite): Same.
+ * tree-data-ref.h: Do not include lambda.h.
+ (lambda_vector): Moved here.
+ (lambda_matrix): Same.
+ (dependence_level): Same.
+ (lambda_transform_legal_p): Removed declaration.
+ (lambda_collect_parameters): Same.
+ (lambda_compute_access_matrices): Same.
+ (lambda_vector_gcd): Same.
+ (lambda_vector_new): Same.
+ (lambda_vector_clear): Same.
+ (lambda_vector_lexico_pos): Same.
+ (lambda_vector_zerop): Same.
+ (lambda_matrix_new): Same.
+ * tree-flow.h (least_common_multiple): Removed declaration.
+ * tree-parloops.c (lambda_trans_matrix): Moved here.
+ (LTM_MATRIX): Same.
+ (LTM_ROWSIZE): Same.
+ (LTM_COLSIZE): Same.
+ (LTM_DENOMINATOR): Same.
+ (lambda_trans_matrix_new): Same.
+ (lambda_matrix_vector_mult): Same.
+ (lambda_transform_legal_p): Same.
+ * tree-pass.h (pass_linear_transform): Removed declaration.
+ * tree-ssa-loop.c (tree_linear_transform): Removed.
+ (gate_tree_linear_transform): Removed.
+ (pass_linear_transform): Removed.
+ (gate_graphite_transforms): Make flag_tree_loop_linear an alias of
+ flag_loop_interchange.
+
+2011-01-25 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/47265
+ PR tree-optimization/47443
+ * tree-ssa-forwprop.c (forward_propagate_addr_expr): Return false
+ if name still has some uses.
+
+2011-01-25 Martin Jambor <mjambor@suse.cz>
+
+ PR tree-optimization/47382
+ * gimple-fold.c (gimple_fold_obj_type_ref_call): Removed.
+ (gimple_fold_call): Do not call gimple_fold_obj_type_ref_call.
+
+2011-01-25 Joel Sherrill <joel.sherrill@oarcorp.com>
+
+ * config/m32r/m32r.c: Define TARGET_EXCEPT_UNWIND_INFO to
+ sjlj_except_unwind_info.
+
+2011-01-25 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/47426
+ * tree-ssa-structalias.c (ipa_pta_execute): Make externally
+ visible functions results escape.
+
+2011-01-25 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/45701
+ * config/arm/arm.c (any_sibcall_uses_r3): New function.
+ (arm_get_frame_offsets): Use it.
+
+2011-01-25 Sebastian Pop <sebastian.pop@amd.com>
+ Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/47271
+ * tree-if-conv.c (bb_postdominates_preds): New.
+ (if_convertible_bb_p): Call bb_postdominates_preds.
+ (if_convertible_loop_p_1): Compute CDI_POST_DOMINATORS.
+ (predicate_scalar_phi): Call bb_postdominates_preds.
+
+2011-01-25 Nick Clifton <nickc@redhat.com>
+
+ * config/rx/rx.h (LIBCALL_VALUE): Do not promote complex types.
+ * config/rx/rx.c (rx_function_value): Likewise.
+ (rx_promote_function_mode): Likewise.
+ (gen_safe_add): Place an outsized immediate value inside an UNSPEC
+ in order to make it legitimate.
+ * config/rx/rx.md (adddi3_internal): If the second operand is a MEM
+ make sure that the first operand is the same as the result register.
+ (addsi3_unspec): Delete.
+ (subdi3): Do not accept immediate operands.
+ (subdi3_internal): Likewise.
+
+2011-01-25 Jeff Law <law@redhat.com>
+
+ PR rtl-optimization/37273
+ * ira-costs.c (scan_one_insn): Detect constants living in memory and
+ handle them like argument loads from stack slots. Do not double
+ count memory for memory constants and argument loads from stack slots.
+
+2011-01-25 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/47427
+ PR tree-optimization/47428
+ * tree-ssa-copyrename.c (copy_rename_partition_coalesce): Don't
+ coalesce if the new root var would be TREE_READONLY.
+
+2011-01-25 Richard Guenther <rguenther@suse.de>
+
+ PR middle-end/47414
+ * tree-ssa-alias.c (indirect_ref_may_alias_decl_p): Use the
+ correct type for TBAA.
+
+2011-01-25 Sebastian Pop <sebastian.pop@amd.com>
+
+ * graphite-sese-to-poly.c (dr_indices_valid_in_loop): New.
+ (close_phi_written_to_memory): Call for_each_index with
+ dr_indices_valid_in_loop.
+
+2011-01-25 Sebastian Pop <sebastian.pop@amd.com>
+
+ * graphite-sese-to-poly.c (new_pbb_from_pbb): Only copy PBB_DOMAIN
+ when it is initialized.
+
+2011-01-25 Sebastian Pop <sebastian.pop@amd.com>
+
+ * graphite-scop-detection.c (stmt_has_simple_data_refs_p): Update
+ call to graphite_find_data_references_in_stmt.
+ * graphite-sese-to-poly.c (outermost_loop_in_sese_1): New.
+ (try_generate_gimple_bb): Call outermost_loop_in_sese_1. Update
+ call to graphite_find_data_references_in_stmt.
+ (analyze_drs_in_stmts): Same.
+ * tree-data-ref.c (dr_analyze_indices): Pass in parameter the loop
+ in which the scalar analysis of indices is performed.
+ (create_data_ref): Same. Update call to dr_analyze_indices.
+ (find_data_references_in_stmt): Update call to create_data_ref.
+ (graphite_find_data_references_in_stmt): Same.
+ * tree-data-ref.h (graphite_find_data_references_in_stmt): Update
+ declaration.
+ (create_data_ref): Same.
+ * tree-ssa-loop-prefetch.c (determine_loop_nest_reuse): Update
+ call to create_data_ref.
+
+2011-01-25 Sebastian Pop <sebastian.pop@amd.com>
+
+ * graphite-sese-to-poly.c (build_poly_scop): Move
+ rewrite_commutative_reductions_out_of_ssa before find_scop_parameters.
+
+2011-01-25 Sebastian Pop <sebastian.pop@amd.com>
+
+ * graphite-sese-to-poly.c (close_phi_written_to_memory): Also allow
+ VAR_DECL, PARM_DECL, and RESULT_DECL.
+
+2011-01-25 Sebastian Pop <sebastian.pop@amd.com>
+
+ * graphite-dependences.c (reduction_dr_1): Allow several reductions
+ in a reduction PBB.
+ * graphite-sese-to-poly.c (split_reduction_stmt): Do not split PBBs
+ that have already been marked as PBB_IS_REDUCTION.
+
+2011-01-25 Sebastian Pop <sebastian.pop@amd.com>
+
+ * graphite-scop-detection.c (same_close_phi_node): New.
+ (remove_duplicate_close_phi): New.
+ (make_close_phi_nodes_unique): New.
+ (canonicalize_loop_closed_ssa): Call make_close_phi_nodes_unique.
+
+2011-01-25 Sebastian Pop <sebastian.pop@amd.com>
+
+ * graphite-dependences.c (new_poly_ddr): Call same_pdr_p.
+ * graphite-poly.h (same_pdr_p): Do not expect that the PDR_TYPE
+ of both data references to be the same.
+
+2011-01-25 Sebastian Pop <sebastian.pop@amd.com>
+
+ * graphite-dependences.c (build_lexicographical_constraint): Remove
+ the gdim parameter.
+ (build_lexicographical_constraint): Adjust call to
+ ppl_powerset_is_empty.
+ (dependence_polyhedron): Same.
+ (graphite_legal_transform_dr): Same.
+ (graphite_carried_dependence_level_k): Same.
+ * graphite-ppl.c (ppl_powerset_is_empty): Remove the nb_params
+ parameter.
+ * graphite-ppl.h (ppl_powerset_is_empty): Adjust declaration.
+
+2011-01-25 Sebastian Pop <sebastian.pop@amd.com>
+
+ * graphite-sese-to-poly.c
+ (translate_scalar_reduction_to_array_for_stmt): Call unshare_expr.
+ (close_phi_written_to_memory): New.
+ (translate_scalar_reduction_to_array): Call close_phi_written_to_memory
+ and unshare_expr.
+
+2011-01-25 Sebastian Pop <sebastian.pop@amd.com>
+
+ * doc/install.texi: Update the expected version number of PPL to 0.11.
+ * graphite-ppl.c (ppl_powerset_is_empty): Remove now dead code under
+ #if PPL_VERSION_MINOR < 11.
+
+2011-01-25 Sebastian Pop <sebastian.pop@amd.com>
+
+ * graphite-dependences.c: Include graphite-cloog-util.h.
+ (new_poly_ddr): Inlined into dependence_polyhedron.
+ (free_poly_ddr): Moved close by new_poly_ddr.
+ (dependence_polyhedron_1): Renamed dependence_polyhedron.
+ Early return NULL when ppl_powerset_is_empty returns true.
+ (dependence_polyhedron): Renamed new_poly_ddr. Call only once
+ poly_drs_may_alias_p. Avoid one call to ppl_powerset_is_empty.
+ (graphite_legal_transform_dr): Call new_poly_ddr.
+ (graphite_carried_dependence_level_k): Same.
+ (dot_original_deps_stmt_1): Renamed dot_deps_stmt_2. Use new_poly_ddr.
+ (dot_transformed_deps_stmt_1): Removed.
+ (dot_deps_stmt_1): Call dot_deps_stmt_2.
+ (dot_original_deps): Renamed dot_deps_2. Call new_poly_ddr.
+ (dot_deps_1): Call dot_deps_2.
+ * Makefile.in (graphite-dependences.o): Add missing dependence on
+ graphite-cloog-util.h.
+
+2011-01-25 Sebastian Pop <sebastian.pop@amd.com>
+
+ * graphite-dependences.c (new_poly_dr): Call ppl_powerset_is_empty.
+ (build_lexicographical_constraint): Same.
+ (dependence_polyhedron_1): Same.
+ (graphite_legal_transform_dr): Same.
+ (graphite_carried_dependence_level_k): Same.
+ * graphite-ppl.c (ppl_powerset_is_empty): New.
+ * graphite-ppl.h (ppl_powerset_is_empty): Declared.
+ * tree-data-ref.c (dump_data_reference): Print the basic block index.
+
+2011-01-25 Sebastian Pop <sebastian.pop@amd.com>
+
+ * graphite-dependences.c (build_pairwise_scheduling): Correctly compute
+ the "a followed by b" relation and document it.
+
+2011-01-25 Sebastian Pop <sebastian.pop@amd.com>
+
+ * graphite-dependences.c (build_lexicographical_constraint): Stop the
+ iteration when the bag of constraints is empty.
+
+2011-01-25 Sebastian Pop <sebastian.pop@amd.com>
+
+ * graphite-poly.c (pbb_remove_duplicate_pdrs): Make it work.
+
+2011-01-25 Sebastian Pop <sebastian.pop@amd.com>
+
+ * graphite-interchange.c (lst_interchange_profitable_p): Takes a loop
+ nest and two loop depths as parameters.
+ (lst_try_interchange_loops): Call lst_interchange_profitable_p after
+ lst_perfect_nestify.
+
+2011-01-25 Sebastian Pop <sebastian.pop@amd.com>
+
+ * graphite-dependences.c (print_pddr): Call
+ ppl_io_fprint_Pointset_Powerset_C_Polyhedron.
+
+2011-01-25 Sebastian Pop <sebastian.pop@amd.com>
+
+ * graphite-ppl.c (debug_gmp_value): New.
+ * graphite-ppl.h (debug_gmp_value): Declared.
+
+2011-01-25 Tobias Grosser <grosser@fim.uni-passau.de>
+
+ * doc/install.texi: Document availability of cloog-0.16.
+
+2011-01-25 Vladimir Kargov <kargov@gmail.com>
+
+ * graphite-scop-detection.c (canonicalize_loop_closed_ssa): Free
+ invalid postdominance info.
+
+2011-01-24 Jan Hubicka <jh@suse.cz>
+
+ PR c/21659
+ * doc/extend.texi (weak pragma): Drop claim that it must
+ appear before definition.
+ * varasm.c (merge_weak, declare_weak): Only sanity check
+ that DECL is not output at a time it is declared weak.
+
+2011-01-24 Kenneth Zadeck <zadeck@naturalbridge.com>
+
+ * machmode.def: Fixed comments.
+
+2011-01-24 Kai Tietz <kai.tietz@onevision.com>
+
+ * emit-rtl.c (reg_attrs_htab_hash): Replace long by intptr_t.
+
+2011-01-24 Paul Koning <ni1d@arrl.net>
+
+ * builtins.c (c_readstr): Fix byte order if BYTES_BIG_ENDIAN !=
+ WORDS_BIG_ENDIAN.
+
+2011-01-24 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR target/46519
+ * config/i386/i386.c: Include sbitmap.h and fibheap.h.
+ (block_info): Add scanned and prev.
+ (move_or_delete_vzeroupper_2): Return if the basic block
+ has been scanned and the upper 128bit state is unchanged
+ from the last scan.
+ (move_or_delete_vzeroupper_1): Return true if the exit
+ state is changed.
+ (move_or_delete_vzeroupper): Visit basic blocks using the
+ work-list based algorithm based on vt_find_locations in
+ var-tracking.c.
+
+ * config/i386/t-i386: Also depend on sbitmap.h and $(FIBHEAP_H).
+
+2011-01-24 Nick Clifton <nickc@redhat.com>
+
+ * config/v850/v850.opt (mv850es): New option - alias for -mv850e1.
+ * config/v850/v850.h (ASM_SPEC): If -mv850es is specified pass
+ -mv850e1 to the assembler. If -mv850e1 or -mv850es is specified
+ then define __v850e1__.
+ * doc/invoke.texi: Document -mv850es.
+
+2011-01-24 Richard Henderson <rth@redhat.com>
+
+ * config/rx/predicates.md (rx_fp_comparison_operator): Don't accept
+ compound unordered comparisons.
+ * config/rx/rx.c (rx_split_fp_compare): Remove.
+ * config/rx/rx-protos.h: Update.
+ * config/rx/rx.md (gcc_conds, rx_conds): Remove.
+ (cbranchsf4): Don't call rx_split_fp_compare.
+ (*cbranchsf4): Use rx_split_cbranch.
+ (*cmpsf): Don't accept "i" constraint.
+ (*conditional_branch): Only valid after reload.
+ (cstoresf4): Merge expander with insn. Don't call rx_split_fp_compare.
+
+2011-01-24 Michael Meissner <meissner@linux.vnet.ibm.com>
+
+ PR target/47385
+ * config/rs6000/altivec.md (vector constant splitters): Add
+ support for creating vector single precision constants if -mvsx is
+ used and we would create the constant using Altivec primitives.
+
+2011-01-23 Bernd Schmidt <bernds@codesourcery.com>
+ Richard Sandiford <rdsandiford@googlemail.com>
+
+ PR rtl-optimization/47166
+ * reload1.c (emit_reload_insns): Disable the spill_reg_store
+ mechanism for PRE_MODIFY and POST_MODIFY.
+ (inc_for_reload): For PRE_MODIFY, return the insn that sets the
+ reloadreg.
+
+2011-01-23 Andreas Schwab <schwab@linux-m68k.org>
+
+ * compare-elim.c (maybe_select_cc_mode): Add ATTRIBUTE_UNUSED markers.
+
+2011-01-22 Jan Hubicka <jh@suse.cz>
+
+ PR lto/47333
+ * lto-cgraph.c (reachable_from_this_partition_p): Fix pasto.
+
+2011-01-22 Jan Hubicka <jh@suse.cz>
+
+ PR tree-optimization/43884
+ PR lto/44334
+ * predict.c (maybe_hot_frequency_p): Use entry block frequency as base.
+ * doc/invoke.texi (hot-bb-frequency-fraction): Update docs.
+
+2011-01-22 Anatoly Sokolov <aesok@post.ru>
+
+ * config/s390/s390.h (REGISTER_MOVE_COST, MEMORY_MOVE_COST): Remove.
+ * config/s390/s390.c (s390_register_move_cost,
+ s390_memory_move_cost): New.
+ (TARGET_REGISTER_MOVE_COST, TARGET_MEMORY_MOVE_COST): Define.
+
+2011-01-22 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
+
+ PR middle-end/47401
+ * except.c (sjlj_assign_call_site_values): Move setting the
+ crtl->uses_eh_lsda flag to ...
+ (sjlj_mark_call_sites): ... here.
+ (sjlj_emit_function_enter): Support NULL dispatch label.
+ (sjlj_build_landing_pads): In a function with no landing pads
+ that still has must-not-throw regions, generate code to register
+ a personality function with empty LSDA.
+
+2011-01-21 Richard Henderson <rth@redhat.com>
+
+ * config/rx/rx.c (TARGET_FLAGS_REGNUM): New.
+
+ * config/mn10300/mn10300.c (TARGET_FLAGS_REGNUM): New.
+
+ * compare-elim.c: New file.
+ * Makefile.in (OBJS-common): Add it.
+ (compare-elim.o): New.
+ * common.opt (fcompare-elim): New.
+ * opts.c (default_options_table): Add OPT_fcompare_elim.
+ * tree-pass.h (pass_compare_elim_after_reload): New.
+ * passes.c (init_optimization_passes): Add it.
+ * recog.h: Protect against re-inclusion.
+ * target.def (TARGET_FLAGS_REGNUM): New POD hook.
+ * doc/invoke.texi (-fcompare-elim): Document it.
+ * doc/tm.texi.in (TARGET_FLAGS_REGNUM): Document it.
+ * doc/tm.texi: Rebuild.
+
+2011-01-22 Nick Clifton <nickc@redhat.com>
+
+ * config/rx/rx.md (cstoresf4): Pass comparison operator to
+ rx_split_fp_compare.
+
+2011-01-22 Nick Clifton <nickc@redhat.com>
+
+ * config/rx/rx.md (UNSPEC_CONST): New.
+ (deallocate_and_return): Wrap the amount popped off the stack in
+ an UNSPEC_CONST in order to stop it being rejected by
+ -mmax-constant-size.
+ (pop_and_return): Add a "(return)" rtx.
+ (call): Drop the immediate operand.
+ (call_internal): Likewise.
+ (call_value): Likewise.
+ (call_value_internal): Likewise.
+ (sibcall_internal): Likewise.
+ (sibcall_value_internal): Likewise.
+ (sibcall): Likewise. Generate an explicit call using
+ sibcall_internal.
+ (sibcall_value): Likewise.
+ (mov<>): FAIL if a constant operand is not legitimate.
+ (addsi3_unpsec): New pattern.
+
+ * config/rx/rx.c (rx_print_operand_address): Handle UNSPEC CONSTs.
+ (ok_for_max_constant): New function.
+ (gen_safe_add): New function.
+ (rx_expand_prologue): Use gen_safe_add.
+ (rx_expand_epilogue): Likewise.
+ (rx_is_legitimate_constant): Use ok_for_max_constant. Handle
+ UNSPEC CONSTs.
+
+2011-01-21 Jeff Law <law@redhat.com>
+
+ PR tree-optimization/47053
+ * tree-ssa-dse.c (need_eh_cleanup): New bitmap.
+ (dse_optimize_stmt): Set the appropriate bit in NEED_EH_CLEANUP when
+ statements are deleted.
+ (tree_ssa_dse): Allocate & free NEED_EH_CLEANUP. If NEED_EH_CLEANUP
+ is nonempty, then purge dead edges and cleanup the CFG.
+
+2011-01-21 Alexandre Oliva <aoliva@redhat.com>
+
+ PR debug/47402
+ Temporarily revert:
+ 2011-01-21 Alexandre Oliva <aoliva@redhat.com>
+ PR debug/47106
+ * tree-dfa.c (create_var_ann): Mark variable as used.
+
+2011-01-21 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/45566
+ * except.c (convert_to_eh_region_ranges): Emit queued no-region
+ notes from other section in hot/cold partitioning even if
+ last_action is -3. Increment call_site_base.
+
+ PR rtl-optimization/47366
+ * fwprop.c (forward_propagate_into): Return bool. If
+ any changes are made, -fnon-call-exceptions is used and
+ REG_EH_REGION note is present, call purge_dead_edges
+ and return true if it purged anything.
+ (fwprop_addr): Adjust callers, call cleanup_cfg (0) if
+ any EH edges were purged.
+
+2011-01-21 Jeff Law <law@redhat.com>
+
+ PR rtl-optimization/41619
+ * caller-save.c (setup_save_areas): Break out code to determine
+ which hard regs are live across calls by examining the reload chains
+ so that it is always used.
+ Eliminate code which checked REG_N_CALLS_CROSSED.
+
+2011-01-21 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/47355
+ * tree-eh.c (cleanup_empty_eh_merge_phis): Give up if
+ NOP has non-debug uses beyond PHIs in new_bb.
+
+2011-01-21 Alexandre Oliva <aoliva@redhat.com>
+
+ PR debug/47106
+ * cfgexpand.c (account_used_vars_for_block): Only account vars
+ that are annotated as used.
+ (estimated_stack_frame_size): Don't set TREE_USED.
+ * tree-dfa.c (create_var_ann): Mark variable as used.
+
+2011-01-21 Richard Guenther <rguenther@suse.de>
+
+ PR middle-end/47395
+ * tree.def (WIDEN_MULT_MINUS_EXPR): Fix printed name.
+
+2011-01-21 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/47365
+ * tree-ssa-sccvn.h (vn_lookup_kind): Declare.
+ (vn_reference_lookup_pieces): Adjust.
+ (vn_reference_lookup): Likewise.
+ * tree-ssa-sccvn.c (vn_walk_kind): New static global.
+ (vn_reference_lookup_3): Only look through kills if in
+ VN_WALKREWRITE mode.
+ (vn_reference_lookup_pieces): Adjust.
+ (vn_reference_lookup): Likewise.
+ (visit_reference_op_load): Likewise.
+ (visit_reference_op_store): Likewise.
+ * tree-ssa-pre.c (phi_translate_1): Use VN_WALK mode.
+ (compute_avail): Likewise.
+ (eliminate): Likewise.
+
+2011-01-21 Jakub Jelinek <jakub@redhat.com>
+
+ * tree-ssa-live.c (remove_unused_scope_block_p): Don't remove
+ DECL_IGNORED_P non-reg vars if they are used.
+
+ PR tree-optimization/47391
+ * varpool.c (const_value_known_p): Return false if
+ decl is volatile.
+
+2011-01-21 Kai Tietz <kai.tietz@onevision.com>
+
+ PR bootstrap/47215
+ * config/i386/i386.c (ix86_local_alignment): Handle
+ case for va_list_type_node is nil.
+ (ix86_canonical_va_list_type): Likewise.
+
+2011-01-21 Alan Modra <amodra@gmail.com>
+
+ * config/rs6000/rs6000-c.c (rs6000_cpu_cpp_builtins): Add
+ builtin_define __CMODEL_MEDIUM__ and __CMODEL_LARGE__.
+
+2011-01-20 Ramana Radhakrishnan <ramana.radhakrishnan@arm.com>
+
+ * config/arm/arm.md (define_attr type): Rename f_load
+ and f_store to f_fpa_load and f_fpa_store. Update.
+ (write_conflict): Deal with rename fallout.
+ (*push_fp_multi): Likewise.
+ * config/arm/fpa.md (f_load): Use f_fpa_load.
+ (f_store): Use f_fpa_store.
+ (*movsf_fpa): Likewise.
+ (*movdf_fpa): Likewise.
+ (*movxf_fpa): Likewise.
+ (*thumb2_movsf_fpa): Likewise.
+ (*thumb2_movdf_fpa): Likewise.
+ (*thumb2_movxf_fpa): Likewise.
+ * config/arm/vfp.md (*thumb2_movdf_vfp): Fix attribute to
+ f_loadd and f_stored.
+ (*thumb2_movdi_vfp): Likewise.
+ (*thumb2_movsf_vfp): Fix attribute to f_loads.
+ (*thumb2_movsi_vfp): Likewise.
+ * config/arm/cortex-m4-fpu.md (cortex_m4_f_load):
+ Use f_loads instead of f_load.
+ * config/arm/cortex-a5.md (cortex_a5_f_loads): Remove f_load.
+
+2011-01-20 Anatoly Sokolov <aesok@post.ru>
+
+ * config/xtensa/xtensa.h (GO_IF_MODE_DEPENDENT_ADDRESS): Remove.
+ * config/xtensa/xtensa-protos.h (constantpool_address_p): Remove.
+ * config/xtensa/xtensa.c (TARGET_MODE_DEPENDENT_ADDRESS_P): Define.
+ (xtensa_mode_dependent_address_p): New function.
+ (constantpool_address_p): Make static. Change return type to bool.
+ Change argument type to const_rtx. Use CONST_INT_P predicate.
+
+2011-01-20 Alexandre Oliva <aoliva@redhat.com>
+
+ PR debug/46583
+ * tree-ssa-live.c (remove_unused_scope_block_p): Keep type decls.
+
+2011-01-20 Jakub Jelinek <jakub@redhat.com>
+
+ PR debug/47283
+ * cfgexpand.c (expand_debug_expr): Instead of generating
+ (mem (debug_implicit_ptr)) for MEM_REFs use COMPONENT_REF
+ etc. handling.
+
+2011-01-20 Richard Guenther <rguenther@suse.de>
+
+ PR middle-end/47370
+ * tree-inline.c (remap_gimple_op_r): Recurse manually for
+ the pointer operand of MEM_REFs.
+
+2011-01-20 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/46130
+ * ipa-split.c (consider_split): If return_bb contains non-virtual
+ PHIs other than for retval or if split_function would not adjust it,
+ refuse to split.
+
+2011-01-20 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/47167
+ * tree-ssa-copyrename.c (copy_rename_partition_coalesce):
+ Revert previous change, only avoid enumeral type changes.
+
+2011-01-19 Mike Stump <mikestump@comcast.net>
+
+ * doc/tm.texi.in (BRANCH_COST): Englishify.
+ * doc/tm.texi (BRANCH_COST): Likewise.
+
2011-01-19 Dodji Seketeli <dodji@redhat.com>
PR c++/47291
* dwarf2out.c (generic_type_p, schedule_generic_params_dies_gen)
- (gen_scheduled_generic_parms_dies): New functions.
- (gen_struct_or_union_type_die): Schedule template parameters DIEs
- generation for the end of CU compilation.
- (dwarf2out_finish): Generate template parameters DIEs here.
+ (gen_scheduled_generic_parms_dies): New functions.
+ (gen_struct_or_union_type_die): Schedule template parameters DIEs
+ generation for the end of CU compilation.
+ (dwarf2out_finish): Generate template parameters DIEs here.
2011-01-19 Alexandre Oliva <aoliva@redhat.com>
@@ -253,7 +2805,7 @@
(*movsi_internal): Use "r" instead of "dax" in constraints. Use "A"
as the source/destination of moves from/to SP.
(movsf): Only allow for AM33-2.
- (*movsf_internal): Use "r" instead of "dax"; use "F" instead of
+ (*movsf_internal): Use "r" instead of "dax"; use "F" instead of
any integer constant constraint. Only allow for AM33-2. Tidy
all of the alternative outputs.
(movdi, movdf, *am33_2_movdf, *mn10300_movdf): Remove.
@@ -338,16 +2890,14 @@
2011-01-18 Ramana Radhakrishnan <ramana.radhakrishnan@arm.com>
- * config/arm/cortex-a9.md (cortex-a9-neon.md): Actually
- include.
- (cortex_a9_dp): Handle neon types correctly.
+ * config/arm/cortex-a9.md (cortex-a9-neon.md): Actually include.
+ (cortex_a9_dp): Handle neon types correctly.
2011-01-18 Jakub Jelinek <jakub@redhat.com>
PR rtl-optimization/47299
* expr.c (expand_expr_real_2) <case WIDEN_MULT_EXPR>: Don't use
- subtarget. Use normal multiplication if both operands are
- constants.
+ subtarget. Use normal multiplication if both operands are constants.
* expmed.c (expand_widening_mult): Don't try to optimize constant
multiplication if op0 has VOIDmode. Convert op1 constant to mode
before using it.
@@ -514,8 +3064,8 @@
(avx_maskstore<ssemodesuffix><avxmodesuffix>): Likewise.
2011-01-17 Olivier Hainque <hainque@adacore.com>
- Michael Haubenwallner <michael.haubenwallner@salomon.at>
- Eric Botcazou <ebotcazou@adacore.com>
+ Michael Haubenwallner <michael.haubenwallner@salomon.at>
+ Eric Botcazou <ebotcazou@adacore.com>
PR target/46655
* xcoffout.c (ASM_OUTPUT_LINE): Output line only if positive, and only
@@ -594,8 +3144,7 @@
2011-01-14 Joseph Myers <joseph@codesourcery.com>
- * config/rs6000/vxworks.h (CC1_SPEC): Don't handle -fvec or
- -fvec-eabi.
+ * config/rs6000/vxworks.h (CC1_SPEC): Don't handle -fvec or -fvec-eabi.
2011-01-14 Mike Stump <mikestump@comcast.net>
@@ -620,8 +3169,7 @@
2011-01-14 Joseph Myers <joseph@codesourcery.com>
- * config/microblaze/microblaze.h (ASM_SPEC): Remove
- %{microblaze1}.
+ * config/microblaze/microblaze.h (ASM_SPEC): Remove %{microblaze1}.
2011-01-14 Joseph Myers <joseph@codesourcery.com>
@@ -791,14 +3339,14 @@
PR debug/PR46973
* dwarf2out.c (prune_unused_types_mark_generic_parms_dies): New
static function.
- (prune_unused_types_mark): Use it.
+ (prune_unused_types_mark): Use it.
2011-01-13 Andrey Belevantsev <abel@ispras.ru>
PR rtl-optimization/45352
- * sel-sched.c: Update copyright years.
+ * sel-sched.c: Update copyright years.
(reset_sched_cycles_in_current_ebb): Also recheck the DFA state
- in the advancing loop when we have issued issue_rate insns.
+ in the advancing loop when we have issued issue_rate insns.
2011-01-12 Richard Henderson <rth@redhat.com>
@@ -900,7 +3448,7 @@
* opts.c (common_handle_option): Disable ipa-reference with profile
feedback.
-2011-01-12 Nicola Pero <nicola.pero@meta-innovation.com>
+2011-01-12 Nicola Pero <nicola.pero@meta-innovation.com>
* c-parser.c (c_parser_objc_at_property_declaration): Improved
error message.
@@ -1066,7 +3614,7 @@
2011-01-10 Jan Hubicka <jh@suse.cz>
- PR tree-optimization/47234
+ PR tree-optimization/47234
* tree-pass.h (TODO_rebuild_cgraph_edges): New TODO.
(pass_feedback_split_functions): Declare.
* passes.c (init_optimization_passes): Add ipa-split as subpass of
diff --git a/gcc/ChangeLog-2010 b/gcc/ChangeLog-2010
index 2462691404b..917704a0746 100644
--- a/gcc/ChangeLog-2010
+++ b/gcc/ChangeLog-2010
@@ -84,9 +84,9 @@
2010-12-30 Nathan Froyd <froydnj@codesourcery.com>
- PR target/44606
- * reload1.c (choose_reload_regs): Don't look for equivalences for
- output reloads of constant loads.
+ PR target/44606
+ * reload1.c (choose_reload_regs): Don't look for equivalences for
+ output reloads of constant loads.
2010-12-30 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite
index 507afdb3621..c3fd0094f58 100644
--- a/gcc/ChangeLog.graphite
+++ b/gcc/ChangeLog.graphite
@@ -1,3 +1,469 @@
+2011-01-20 Sebastian Pop <sebastian.pop@amd.com>
+
+ * graphite-sese-to-poly.c (dr_indices_valid_in_loop): New.
+ (close_phi_written_to_memory): Call for_each_index with
+ dr_indices_valid_in_loop.
+
+ * gfortran.dg/graphite/id-24.f: New.
+ * gfortran.dg/graphite/id-25.f: New.
+
+2011-01-19 Sebastian Pop <sebastian.pop@amd.com>
+
+ * graphite-sese-to-poly.c (new_pbb_from_pbb): Only copy PBB_DOMAIN
+ when it is initialized.
+
+ * gfortran.dg/graphite/id-23.f: New.
+
+2011-01-19 Sebastian Pop <sebastian.pop@amd.com>
+
+ * graphite-scop-detection.c (stmt_has_simple_data_refs_p): Update
+ call to graphite_find_data_references_in_stmt.
+ * graphite-sese-to-poly.c (outermost_loop_in_sese_1): New.
+ (try_generate_gimple_bb): Call outermost_loop_in_sese_1. Update
+ call to graphite_find_data_references_in_stmt.
+ (analyze_drs_in_stmts): Same.
+ * tree-data-ref.c (dr_analyze_indices): Pass in parameter the loop
+ in which the scalar analysis of indices is performed.
+ (create_data_ref): Same. Update call to dr_analyze_indices.
+ (find_data_references_in_stmt): Update call to create_data_ref.
+ (graphite_find_data_references_in_stmt): Same.
+ * tree-data-ref.h (graphite_find_data_references_in_stmt): Update
+ declaration.
+ (create_data_ref): Same.
+ * tree-ssa-loop-prefetch.c (determine_loop_nest_reuse): Update
+ call to create_data_ref.
+
+2011-01-19 Sebastian Pop <sebastian.pop@amd.com>
+
+ * graphite-sese-to-poly.c (build_poly_scop): Move
+ rewrite_commutative_reductions_out_of_ssa before
+ find_scop_parameters.
+
+2011-01-18 Sebastian Pop <sebastian.pop@amd.com>
+
+ PR tree-optimization/46970
+ * gcc.dg/graphite/pr46970.c: New.
+
+2011-01-18 Sebastian Pop <sebastian.pop@amd.com>
+
+ PR tree-optimization/46215
+ * gcc.dg/graphite/pr46215.c: New.
+
+2011-01-18 Sebastian Pop <sebastian.pop@amd.com>
+
+ PR tree-optimization/46168
+ * gcc.dg/graphite/pr46168.c: New.
+
+2011-01-18 Sebastian Pop <sebastian.pop@amd.com>
+
+ PR tree-optimization/43657
+ * gcc.dg/graphite/pr43657.c: New.
+
+2011-01-18 Sebastian Pop <sebastian.pop@amd.com>
+
+ PR tree-optimization/29832
+ * gfortran.dg/graphite/pr29832.f90: New.
+
+2011-01-18 Sebastian Pop <sebastian.pop@amd.com>
+
+ PR tree-optimization/43567
+ * gcc.dg/graphite/pr43567.c: New.
+
+2011-01-18 Sebastian Pop <sebastian.pop@amd.com>
+
+ PR tree-optimization/43567
+ * gcc.dg/graphite/pr43567.c: New.
+
+2011-01-17 Sebastian Pop <sebastian.pop@amd.com>
+
+ * Makefile.in (LAMBDA_H): Removed.
+ (TREE_DATA_REF_H): Remove dependence on LAMBDA_H.
+ (OBJS-common): Remove dependence on lambda-code.o, lambda-mat.o,
+ lambda-trans.o, and tree-loop-linear.o.
+ (lto-symtab.o): Remove dependence on LAMBDA_H.
+ (tree-loop-linear.o): Remove rule.
+ (lambda-mat.o): Same.
+ (lambda-trans.o): Same.
+ (lambda-code.o): Same.
+ (tree-vect-loop.o): Add missing dependence on TREE_DATA_REF_H.
+ (tree-vect-slp.o): Same.
+ * hwint.h (gcd): Moved here.
+ (least_common_multiple): Same.
+ * lambda-code.c: Removed.
+ * lambda-mat.c: Removed.
+ * lambda-trans.c: Removed.
+ * lambda.h: Removed.
+ * tree-loop-linear.c: Removed.
+ * lto-symtab.c: Do not include lambda.h.
+ * omega.c (gcd): Removed.
+ * passes.c (init_optimization_passes): Remove pass_linear_transform.
+ * tree-data-ref.c (print_lambda_vector): Moved here.
+ (lambda_vector_copy): Same.
+ (lambda_matrix_copy): Same.
+ (lambda_matrix_id): Same.
+ (lambda_vector_first_nz): Same.
+ (lambda_matrix_row_add): Same.
+ (lambda_matrix_row_exchange): Same.
+ (lambda_vector_mult_const): Same.
+ (lambda_vector_negate): Same.
+ (lambda_matrix_row_negate): Same.
+ (lambda_vector_equal): Same.
+ (lambda_matrix_right_hermite): Same.
+ * tree-data-ref.h: Do not include lambda.h.
+ (lambda_vector): Moved here.
+ (lambda_matrix): Same.
+ (dependence_level): Same.
+ (lambda_transform_legal_p): Removed declaration.
+ (lambda_collect_parameters): Same.
+ (lambda_compute_access_matrices): Same.
+ (lambda_vector_gcd): Same.
+ (lambda_vector_new): Same.
+ (lambda_vector_clear): Same.
+ (lambda_vector_lexico_pos): Same.
+ (lambda_vector_zerop): Same.
+ (lambda_matrix_new): Same.
+ * tree-flow.h (least_common_multiple): Removed declaration.
+ * tree-parloops.c (lambda_trans_matrix): Moved here.
+ (LTM_MATRIX): Same.
+ (LTM_ROWSIZE): Same.
+ (LTM_COLSIZE): Same.
+ (LTM_DENOMINATOR): Same.
+ (lambda_trans_matrix_new): Same.
+ (lambda_matrix_vector_mult): Same.
+ (lambda_transform_legal_p): Same.
+ * tree-pass.h (pass_linear_transform): Removed declaration.
+ * tree-ssa-loop.c (tree_linear_transform): Removed.
+ (gate_tree_linear_transform): Removed.
+ (pass_linear_transform): Removed.
+ (gate_graphite_transforms): Make flag_tree_loop_linear an alias of
+ flag_loop_interchange.
+
+ * gfortran.dg/graphite/interchange-4.f: New.
+ * gfortran.dg/graphite/interchange-5.f: New.
+
+ * gcc.dg/tree-ssa/ltrans-1.c: Removed.
+ * gcc.dg/tree-ssa/ltrans-2.c: Removed.
+ * gcc.dg/tree-ssa/ltrans-3.c: Removed.
+ * gcc.dg/tree-ssa/ltrans-4.c: Removed.
+ * gcc.dg/tree-ssa/ltrans-5.c: Removed.
+ * gcc.dg/tree-ssa/ltrans-6.c: Removed.
+ * gcc.dg/tree-ssa/ltrans-8.c: Removed.
+ * gfortran.dg/ltrans-7.f90: Removed.
+ * gcc.dg/tree-ssa/data-dep-1.c: Removed.
+
+ * gcc.dg/pr18792.c: -> gcc.dg/graphite/pr18792.c
+ * gcc.dg/pr19910.c: -> gcc.dg/graphite/pr19910.c
+ * gcc.dg/tree-ssa/20041110-1.c: -> gcc.dg/graphite/pr20041110-1.c
+ * gcc.dg/tree-ssa/pr20256.c: -> gcc.dg/graphite/pr20256.c
+ * gcc.dg/pr23625.c: -> gcc.dg/graphite/pr23625.c
+ * gcc.dg/tree-ssa/pr23820.c: -> gcc.dg/graphite/pr23820.c
+ * gcc.dg/tree-ssa/pr24309.c: -> gcc.dg/graphite/pr24309.c
+ * gcc.dg/tree-ssa/pr26435.c: -> gcc.dg/graphite/pr26435.c
+ * gcc.dg/pr29330.c: -> gcc.dg/graphite/pr29330.c
+ * gcc.dg/pr29581-1.c: -> gcc.dg/graphite/pr29581-1.c
+ * gcc.dg/pr29581-2.c: -> gcc.dg/graphite/pr29581-2.c
+ * gcc.dg/pr29581-3.c: -> gcc.dg/graphite/pr29581-3.c
+ * gcc.dg/pr29581-4.c: -> gcc.dg/graphite/pr29581-4.c
+ * gcc.dg/tree-ssa/loop-27.c: -> gcc.dg/graphite/pr30565.c
+ * gcc.dg/tree-ssa/pr31183.c: -> gcc.dg/graphite/pr31183.c
+ * gcc.dg/tree-ssa/pr33576.c: -> gcc.dg/graphite/pr33576.c
+ * gcc.dg/tree-ssa/pr33766.c: -> gcc.dg/graphite/pr33766.c
+ * gcc.dg/pr34016.c: -> gcc.dg/graphite/pr34016.c
+ * gcc.dg/tree-ssa/pr34017.c: -> gcc.dg/graphite/pr34017.c
+ * gcc.dg/tree-ssa/pr34123.c: -> gcc.dg/graphite/pr34123.c
+ * gcc.dg/tree-ssa/pr36287.c: -> gcc.dg/graphite/pr36287.c
+ * gcc.dg/tree-ssa/pr37686.c: -> gcc.dg/graphite/pr37686.c
+ * gcc.dg/pr42917.c: -> gcc.dg/graphite/pr42917.c
+ * gcc.dg/tree-ssa/data-dep-1.c
+ * gfortran.dg/loop_nest_1.f90: -> gfortran.dg/graphite/pr29290.f90
+ * gfortran.dg/pr29581.f90: -> gfortran.dg/graphite/pr29581.f90
+ * gfortran.dg/pr36286.f90: -> gfortran.dg/graphite/pr36286.f90
+ * gfortran.dg/pr36922.f: -> gfortran.dg/graphite/pr36922.f
+ * gfortran.dg/pr39516.f: -> gfortran.dg/graphite/pr39516.f
+
+2011-01-17 Sebastian Pop <sebastian.pop@amd.com>
+
+ * graphite-sese-to-poly.c (close_phi_written_to_memory): Also allow
+ VAR_DECL, PARM_DECL, and RESULT_DECL.
+
+ * gfortran.dg/graphite/interchange-3.f90: Un-XFAILed.
+
+2011-01-17 Sebastian Pop <sebastian.pop@amd.com>
+
+ * graphite-dependences.c (reduction_dr_1): Allow several reductions
+ in a reduction PBB.
+ * graphite-sese-to-poly.c (split_reduction_stmt): Do not split PBBs
+ that have already been marked as PBB_IS_REDUCTION.
+
+2011-01-17 Sebastian Pop <sebastian.pop@amd.com>
+
+ * graphite-scop-detection.c (same_close_phi_node): New.
+ (remove_duplicate_close_phi): New.
+ (make_close_phi_nodes_unique): New.
+ (canonicalize_loop_closed_ssa): Call make_close_phi_nodes_unique.
+
+2011-01-17 Sebastian Pop <sebastian.pop@amd.com>
+
+ * graphite-dependences.c (new_poly_ddr): Call same_pdr_p.
+ * graphite-poly.h (same_pdr_p): Do not expect that the PDR_TYPE
+ of both data references to be the same.
+
+2011-01-17 Sebastian Pop <sebastian.pop@amd.com>
+
+ * graphite-dependences.c (build_lexicographical_constraint): Remove the
+ gdim parameter.
+ (build_lexicographical_constraint): Adjust call to ppl_powerset_is_empty.
+ (dependence_polyhedron): Same.
+ (graphite_legal_transform_dr): Same.
+ (graphite_carried_dependence_level_k): Same.
+ * graphite-ppl.c (ppl_powerset_is_empty): Remove the nb_params parameter.
+ * graphite-ppl.h (ppl_powerset_is_empty): Adjust declaration.
+
+2011-01-15 Sebastian Pop <sebastian.pop@amd.com>
+
+ * graphite-sese-to-poly.c
+ (translate_scalar_reduction_to_array_for_stmt): Call unshare_expr.
+ (close_phi_written_to_memory): New.
+ (translate_scalar_reduction_to_array): Call close_phi_written_to_memory
+ and unshare_expr.
+
+ * gcc.dg/graphite/block-0.c: Un-XFAILed.
+ * gcc.dg/graphite/block-1.c: Un-XFAILed.
+ * gcc.dg/graphite/block-7.c: Un-XFAILed.
+ * gcc.dg/graphite/block-8.c: Un-XFAILed.
+ * gcc.dg/graphite/interchange-12.c: Un-XFAILed.
+ * gcc.dg/graphite/interchange-14.c: Un-XFAILed.
+ * gcc.dg/graphite/interchange-15.c: Un-XFAILed.
+ * gcc.dg/graphite/interchange-8.c: Un-XFAILed.
+ * gcc.dg/graphite/interchange-mvt.c: Un-XFAILed.
+
+2011-01-15 Sebastian Pop <sebastian.pop@amd.com>
+
+ * doc/install.texi: Update the expected version number of PPL to 0.11.
+ * graphite-ppl.c (ppl_powerset_is_empty): Remove now dead code under
+ #if PPL_VERSION_MINOR < 11.
+
+2011-01-15 Sebastian Pop <sebastian.pop@amd.com>
+
+ * graphite-dependences.c (new_poly_ddr): Inlined into
+ dependence_polyhedron.
+ (free_poly_ddr): Moved close by new_poly_ddr.
+ (dependence_polyhedron_1): Renamed dependence_polyhedron.
+ Early return NULL when ppl_powerset_is_empty returns true.
+ (dependence_polyhedron): Renamed new_poly_ddr. Call only once
+ poly_drs_may_alias_p. Avoid one call to ppl_powerset_is_empty.
+ (graphite_legal_transform_dr): Call new_poly_ddr.
+ (graphite_carried_dependence_level_k): Same.
+ (dot_original_deps_stmt_1): Renamed dot_deps_stmt_2. Use new_poly_ddr.
+ (dot_transformed_deps_stmt_1): Removed.
+ (dot_deps_stmt_1): Call dot_deps_stmt_2.
+ (dot_original_deps): Renamed dot_deps_2. Call new_poly_ddr.
+ (dot_deps_1): Call dot_deps_2.
+
+2011-01-15 Sebastian Pop <sebastian.pop@amd.com>
+
+ * graphite-dependences.c (new_poly_dr): Call ppl_powerset_is_empty.
+ (build_lexicographical_constraint): Same.
+ (dependence_polyhedron_1): Same.
+ (graphite_legal_transform_dr): Same.
+ (graphite_carried_dependence_level_k): Same.
+ * graphite-ppl.c (ppl_powerset_is_empty): New.
+ * graphite-ppl.h (ppl_powerset_is_empty): Declared.
+ * tree-data-ref.c (dump_data_reference): Print the basic block index.
+
+ * gcc.dg/graphite/block-0.c: Add documentation.
+ * gcc.dg/graphite/block-4.c: Same.
+ * gcc.dg/graphite/block-7.c: Same.
+ * gcc.dg/graphite/block-8.c: New.
+ * gcc.dg/graphite/interchange-1.c: Un-XFAILed.
+ * gcc.dg/graphite/interchange-11.c: Un-XFAILed.
+ * gcc.dg/graphite/interchange-12.c: Add documentation.
+ * gcc.dg/graphite/interchange-13.c: New.
+ * gcc.dg/graphite/interchange-14.c: New.
+ * gcc.dg/graphite/interchange-15.c: New.
+ * gcc.dg/graphite/interchange-8.c: Add documentation.
+ * gcc.dg/graphite/interchange-mvt.c: Same.
+
+2011-01-15 Sebastian Pop <sebastian.pop@amd.com>
+
+ * graphite-dependences.c (build_pairwise_scheduling): Correctly compute
+ the "a followed by b" relation and document it.
+
+2011-01-15 Sebastian Pop <sebastian.pop@amd.com>
+
+ * graphite-dependences.c (build_lexicographical_constraint): Stop the
+ iteration when the bag of constraints is empty.
+
+2011-01-15 Sebastian Pop <sebastian.pop@amd.com>
+
+ * graphite-poly.c (pbb_remove_duplicate_pdrs): Make it work.
+
+2011-01-15 Sebastian Pop <sebastian.pop@amd.com>
+
+ * graphite-interchange.c (lst_interchange_profitable_p): Takes a loop
+ nest and two loop depths as parameters.
+ (lst_try_interchange_loops): Call lst_interchange_profitable_p after
+ lst_perfect_nestify.
+
+2011-01-15 Sebastian Pop <sebastian.pop@amd.com>
+
+ * graphite-dependences.c (print_pddr): Call
+ ppl_io_fprint_Pointset_Powerset_C_Polyhedron.
+
+2011-01-15 Sebastian Pop <sebastian.pop@amd.com>
+
+ * graphite-ppl.c (debug_gmp_value): New.
+ * graphite-ppl.h (debug_gmp_value): Declared.
+
+2011-01-13 Tobias Grosser <grosser@fim.uni-passau.de>
+
+ * doc/install.texi: Document availability of cloog-0.16
+
+2011-01-05 Vladimir Kargov <kargov@gmail.com>
+
+ * graphite-scop-detection.c (is_valid_stmt_p): Pass the entry basic
+ block instead of region start to the instantiation.
+ (is_valid_bb_p): Add support for basic blocks with conditional
+ statements.
+ (find_scops_new): Recalculate dominance info before SCOP
+ detection.
+
+2011-01-05 Vladimir Kargov <kargov@gmail.com>
+
+ * graphite-scop-detection.c (get_outermost_loop_in_region): New.
+ (is_valid_loop_p): Correct loop passed to stmt_has_simple_data_refs_p
+
+2011-01-05 Vladimir Kargov <kargov@gmail.com>
+
+ * graphite-scop-detection.c (canonicalize_loop_closed_ssa): Free
+ invalid postdominance info
+
+2010-12-29 Sebastian Pop <sebastian.pop@amd.com>
+
+ * Makefile.in (graphite-opencl-codegen.o): Update dependences.
+ (graphite-opencl-meta-clast.o): Same.
+ (graphite-opencl.o): Same.
+ (refined-regions.o): Same.
+ * graphite-opencl-codegen.c: Do not include unnecessary .h files.
+ * graphite-opencl-meta-clast.c: Same.
+ * graphite-opencl.c: Same.
+ * refined-regions.c: Same.
+
+2010-12-27 Sebastian Pop <sebastian.pop@amd.com>
+
+ * graphite-opencl-codegen.c: Use FOR_EACH_VEC_ELT.
+ * graphite-opencl-meta-clast.c: Same.
+ * graphite-opencl.c: Same.
+
+2010-12-27 Sebastian Pop <sebastian.pop@amd.com>
+
+ * graphite-opencl-codegen.c: Do not include sys/time.h.
+ * graphite-opencl.c: Same.
+
+2010-12-27 Sebastian Pop <sebastian.pop@amd.com>
+
+ * graphite-opencl.c (h_context, h_cmd_queue, h_program): Moved
+ out of ifdef HAVE_cloog section.
+
+2010-12-27 Sebastian Pop <sebastian.pop@amd.com>
+
+ * Makefile.in (graphite-opencl.o): Depends on
+ graphite-opencl-functions.def.
+ * graphite-opencl-functions.def: New.
+ * graphite-opencl.c (enum OPENCL_FUNCTIONS): Read data from
+ graphite-opencl-functions.def.
+ (opencl_function_names): Same.
+ (opencl_create_function_decl): Use the enum OPENCL_FUNCTIONS
+ as indices of opencl_function_names.
+
+2010-12-27 Sebastian Pop <sebastian.pop@amd.com>
+
+ * graphite-opencl-codegen.c: Fix formatting.
+ * graphite-opencl-meta-clast.c: Same.
+ * graphite-opencl.c: Same.
+
+2010-12-27 Sebastian Pop <sebastian.pop@amd.com>
+
+ * graphite-opencl-codegen.c: Fix formating problems.
+ * graphite-opencl-meta-clast.c: Same.
+ * graphite-opencl.c: Same.
+ * graphite-opencl.h: Same.
+
+2010-12-27 Sebastian Pop <sebastian.pop@amd.com>
+
+ * graphite-opencl-codegen.c: Sort topologically static functions.
+ * graphite-opencl.c: Same.
+
+2010-12-25 Sebastian Pop <sebastian.pop@amd.com>
+
+ * graphite-cloog-compat.h (cloog_names_nb_scattering): New.
+ (cloog_names_scattering): New.
+ * graphite-opencl-codegen.c (opencl_constant_expression_p): Use
+ clast_expr_* instead of expr_*. Call clast_name_to_str.
+ (opencl_clast_name_to_tree): Now takes a clast_name_p in parameter.
+ (opencl_get_scat_real_name): Same. Call clast_name_to_str.
+ (opencl_add_scat_as_arg): Same.
+ (opencl_print_local_vars): Call cloog_names_scattering and
+ cloog_names_nb_scattering.
+ (opencl_print_for): Do not call value_*.
+ (opencl_print_term): Same.
+ (opencl_print_expr): Use clast_expr_* instead of expr_*.
+ (opencl_print_sum): Same.
+ (opencl_print_binary): Same.
+
+2010-12-25 Alexey Kravets <kayrick@ispras.ru>
+
+ * Makefile.in (OBJS-common): Add graphite-opencl-codegen.o,
+ graphite-opencl-meta-clast.o and graphite-opencl.o.
+ (graphite-opencl-codegen.o): New.
+ (graphite-opencl-meta-clast.o): New.
+ (graphite-opencl.o): New.
+ (GTFILES): Add graphite-opencl.c.
+ * common.opt (fgraphite-opencl): New.
+ (fgraphite-opencl-cpu): New.
+ (fgraphite-opencl-ignore-depth-heuristic): New.
+ (fgraphite-opencl-ignore-mem-heuristic): New.
+ (fgraphite-opencl-ignore-dep): New.
+ (fgraphite-opencl-ignore-types): New.
+ (fgraphite-opencl-depth-base): New.
+ (fgraphite-opencl-debug): New.
+ * graphite-opencl-codegen.c: New file.
+ * graphite-opencl-meta-clast.c: New file.
+ * graphite-opencl.c: New file.
+ * graphite-opencl.h: New file.
+ * graphite.c (graphite_transform_loops): Call graphite_opencl_init and
+ graphite_opencl_finalize.
+ * tree-ssa-loop.c (gate_graphite_transforms): Handle
+ flag_graphite_opencl.
+ * graphite-clast-to-gimple.c (gloog): Call opencl_transform_clast.
+ * dbgcnt.def (opencl_scop_cnt): New counter.
+
+2010-12-25 Alexander Monakov <amonakov@ispras.ru>
+
+ * graphite-dependences.c (graphite_outer_subscript_bound): New.
+ (graphite_carried_dependence_level_k): Export.
+ * graphite-dependences.h (graphite_outer_subscript_bound): Declare.
+ (graphite_carried_dependence_level_k): Ditto.
+
+2010-12-25 Alexey Kravets <kayrick@ispras.ru>
+
+ * graphite-clast-to-gimple.c (struct clast_name_index): Move
+ definition to graphite-clast-to-gimple.h.
+ (clast_name_to_index): Ditto.
+ (clast_name_index_elt_info): Ditto.
+ (eq_clast_name_indexes): Ditto.
+ (save_clast_name_index): Export.
+ (clast_name_to_gcc): Ditto.
+ (clast_to_gcc_expression): Ditto.
+ (gcc_type_for_clast_expr): Ditto.
+ (graphite_create_new_guard): Ditto.
+ (gcc_type_for_iv_of_clast_loop): Ditto.
+ (graphite_create_new_loop): Ditto.
+ (build_iv_mapping): Ditto.
+ (graphite_create_new_loop_guard): Ditto.
+ (debug_clast_name_index): New.
+ (debug_clast_name_indices): New debug function.
+
2010-12-21 Sebastian Pop <sebastian.pop@amd.com>
PR tree-optimization/47021
diff --git a/gcc/DATESTAMP b/gcc/DATESTAMP
index 27e70987b2b..04c279fab7e 100644
--- a/gcc/DATESTAMP
+++ b/gcc/DATESTAMP
@@ -1 +1 @@
-20110120
+20110225
diff --git a/gcc/Makefile.in b/gcc/Makefile.in
index 9cd6e079b41..23c86a05c5c 100644
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -966,8 +966,7 @@ DIAGNOSTIC_H = diagnostic.h $(DIAGNOSTIC_CORE_H) $(PRETTY_PRINT_H)
C_PRETTY_PRINT_H = c-family/c-pretty-print.h $(PRETTY_PRINT_H) \
$(C_COMMON_H) $(TREE_H)
SCEV_H = tree-scalar-evolution.h $(GGC_H) tree-chrec.h $(PARAMS_H)
-LAMBDA_H = lambda.h $(TREE_H) $(VEC_H) $(GGC_H)
-TREE_DATA_REF_H = tree-data-ref.h $(LAMBDA_H) omega.h graphds.h $(SCEV_H)
+TREE_DATA_REF_H = tree-data-ref.h omega.h graphds.h $(SCEV_H)
TREE_INLINE_H = tree-inline.h vecir.h
REAL_H = real.h $(MACHMODE_H)
IRA_INT_H = ira.h ira-int.h $(CFGLOOP_H) alloc-pool.h
@@ -1205,6 +1204,7 @@ OBJS-common = \
cfgrtl.o \
combine.o \
combine-stack-adj.o \
+ compare-elim.o \
convert.o \
coverage.o \
cse.o \
@@ -1278,9 +1278,6 @@ OBJS-common = \
ira-emit.o \
ira-lives.o \
jump.o \
- lambda-code.o \
- lambda-mat.o \
- lambda-trans.o \
langhooks.o \
lcm.o \
lists.o \
@@ -1378,7 +1375,6 @@ OBJS-common = \
tree-into-ssa.o \
tree-iterator.o \
tree-loop-distribution.o \
- tree-loop-linear.o \
tree-nested.o \
tree-nrv.o \
tree-object-size.o \
@@ -1913,6 +1909,7 @@ libgcc.mvars: config.status Makefile $(LIB2ADD) $(LIB2ADD_ST) specs \
echo GCC_EXTRA_PARTS = '$(GCC_EXTRA_PARTS)' >> tmp-libgcc.mvars
echo SHLIB_LINK = '$(subst $(GCC_FOR_TARGET),$$(GCC_FOR_TARGET),$(SHLIB_LINK))' >> tmp-libgcc.mvars
echo SHLIB_INSTALL = '$(SHLIB_INSTALL)' >> tmp-libgcc.mvars
+ echo SHLIB_DLLDIR = '$(SHLIB_DLLDIR)' >> tmp-libgcc.mvars
echo SHLIB_EXT = '$(SHLIB_EXT)' >> tmp-libgcc.mvars
echo SHLIB_MKMAP = '$(call srcdirify,$(SHLIB_MKMAP))' >> tmp-libgcc.mvars
echo SHLIB_MKMAP_OPTS = '$(SHLIB_MKMAP_OPTS)' >> tmp-libgcc.mvars
@@ -2330,7 +2327,7 @@ lto-section-out.o : lto-section-out.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
$(CGRAPH_H) $(FUNCTION_H) $(GGC_H) $(EXCEPT_H) pointer-set.h \
$(BITMAP_H) langhooks.h $(LTO_STREAMER_H) lto-compress.h
lto-symtab.o: lto-symtab.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
- $(TREE_H) $(GIMPLE_H) $(GGC_H) $(LAMBDA_H) $(HASHTAB_H) \
+ $(TREE_H) $(GIMPLE_H) $(GGC_H) $(HASHTAB_H) \
$(LTO_STREAMER_H) $(LINKER_PLUGIN_API_H) gt-lto-symtab.h
lto-opts.o: lto-opts.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TREE_H) \
$(HASHTAB_H) $(GGC_H) $(BITMAP_H) $(FLAGS_H) $(OPTS_H) $(OPTIONS_H) \
@@ -2684,7 +2681,8 @@ graphite-cloog-util.o : graphite-cloog-util.c $(CONFIG_H) $(SYSTEM_H) \
coretypes.h graphite-cloog-util.h graphite-cloog-compat.h
graphite-dependences.o : graphite-dependences.c $(CONFIG_H) $(SYSTEM_H) \
coretypes.h $(TREE_FLOW_H) $(TREE_DUMP_H) $(CFGLOOP_H) $(TREE_DATA_REF_H) \
- sese.h graphite-ppl.h graphite-poly.h graphite-dependences.h
+ sese.h graphite-ppl.h graphite-poly.h graphite-dependences.h \
+ graphite-cloog-util.h
graphite-flattening.o : graphite-flattening.c $(CONFIG_H) $(SYSTEM_H) \
coretypes.h $(TREE_FLOW_H) $(TREE_DUMP_H) $(CFGLOOP_H) $(TREE_DATA_REF_H) \
sese.h graphite-ppl.h graphite-poly.h
@@ -2708,7 +2706,7 @@ tree-vect-loop.o: tree-vect-loop.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
$(TM_H) $(GGC_H) $(TREE_H) $(BASIC_BLOCK_H) $(DIAGNOSTIC_H) $(TREE_FLOW_H) \
$(TREE_DUMP_H) $(CFGLOOP_H) $(CFGLAYOUT_H) $(EXPR_H) $(RECOG_H) $(OPTABS_H) \
$(DIAGNOSTIC_CORE_H) $(SCEV_H) $(TREE_VECTORIZER_H) tree-pretty-print.h \
- gimple-pretty-print.h $(TARGET_H)
+ gimple-pretty-print.h $(TARGET_H) $(TREE_DATA_REF_H)
tree-vect-loop-manip.o: tree-vect-loop-manip.c $(CONFIG_H) $(SYSTEM_H) \
coretypes.h $(TM_H) $(GGC_H) $(TREE_H) $(BASIC_BLOCK_H) $(DIAGNOSTIC_H) \
$(TREE_FLOW_H) $(TREE_DUMP_H) $(CFGLOOP_H) $(CFGLAYOUT_H) $(EXPR_H) $(DIAGNOSTIC_CORE_H) \
@@ -2723,7 +2721,7 @@ tree-vect-slp.o: tree-vect-slp.c $(CONFIG_H) $(SYSTEM_H) \
coretypes.h $(TM_H) $(GGC_H) $(TREE_H) $(TARGET_H) $(BASIC_BLOCK_H) \
$(DIAGNOSTIC_H) $(TREE_FLOW_H) $(TREE_DUMP_H) $(CFGLOOP_H) $(CFGLAYOUT_H) \
$(EXPR_H) $(RECOG_H) $(OPTABS_H) $(TREE_VECTORIZER_H) tree-pretty-print.h \
- gimple-pretty-print.h
+ gimple-pretty-print.h $(TREE_DATA_REF_H)
tree-vect-stmts.o: tree-vect-stmts.c $(CONFIG_H) $(SYSTEM_H) \
coretypes.h $(TM_H) $(GGC_H) $(TREE_H) $(TARGET_H) $(BASIC_BLOCK_H) \
$(DIAGNOSTIC_H) $(TREE_FLOW_H) $(TREE_DUMP_H) $(CFGLOOP_H) $(CFGLAYOUT_H) \
@@ -2739,8 +2737,6 @@ tree-vectorizer.o: tree-vectorizer.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
$(TM_H) $(GGC_H) $(TREE_H) $(DIAGNOSTIC_H) $(TREE_FLOW_H) $(TREE_DUMP_H) \
$(CFGLOOP_H) $(TREE_PASS_H) $(TREE_VECTORIZER_H) $(TIMEVAR_H) \
tree-pretty-print.h
-tree-loop-linear.o: tree-loop-linear.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
- $(TREE_FLOW_H) $(CFGLOOP_H) $(TREE_DATA_REF_H) $(TREE_PASS_H) $(LAMBDA_H)
tree-loop-distribution.o: tree-loop-distribution.c $(CONFIG_H) $(SYSTEM_H) \
coretypes.h $(TREE_FLOW_H) $(CFGLOOP_H) $(TREE_DATA_REF_H) $(TREE_PASS_H)
tree-parloops.o: tree-parloops.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
@@ -3350,6 +3346,9 @@ combine-stack-adj.o : combine-stack-adj.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
$(TM_H) $(RTL_H) insn-config.h $(TIMEVAR_H) $(TREE_PASS_H) \
$(RECOG_H) output.h $(REGS_H) hard-reg-set.h $(FLAGS_H) $(FUNCTION_H) \
$(EXPR_H) $(BASIC_BLOCK_H) $(DIAGNOSTIC_CORE_H) $(TM_P_H) $(DF_H) $(EXCEPT_H) reload.h
+compare-elim.o : compare-elim.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
+ $(TM_H) $(RTL_H) $(TM_P_H) insn-config.h $(RECOG_H) $(FLAGS_H) \
+ $(BASIC_BLOCK_H) $(TREE_PASS_H) $(TARGET_H) $(DF_H) domwalk.h
ddg.o : ddg.c $(DDG_H) $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TARGET_H) \
$(DIAGNOSTIC_CORE_H) $(RTL_H) $(TM_P_H) $(REGS_H) $(FUNCTION_H) \
$(FLAGS_H) insn-config.h $(INSN_ATTR_H) $(EXCEPT_H) $(RECOG_H) \
@@ -3454,12 +3453,6 @@ ifcvt.o : ifcvt.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
$(TARGET_H) $(BASIC_BLOCK_H) $(EXPR_H) output.h $(EXCEPT_H) $(TM_P_H) \
$(OPTABS_H) $(CFGLOOP_H) hard-reg-set.h $(TIMEVAR_H) \
$(TREE_PASS_H) $(DF_H) $(DBGCNT_H)
-lambda-mat.o : lambda-mat.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TREE_FLOW_H) \
- $(LAMBDA_H)
-lambda-trans.o : lambda-trans.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
- $(TREE_FLOW_H) $(LAMBDA_H)
-lambda-code.o : lambda-code.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
- $(TREE_FLOW_H) $(CFGLOOP_H) $(TREE_DATA_REF_H) $(LAMBDA_H) $(TREE_PASS_H)
params.o : params.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(PARAMS_H) \
$(DIAGNOSTIC_CORE_H)
pointer-set.o: pointer-set.c pointer-set.h $(CONFIG_H) $(SYSTEM_H)
diff --git a/gcc/acinclude.m4 b/gcc/acinclude.m4
index 6f0f979d78c..3eec559e8f5 100644
--- a/gcc/acinclude.m4
+++ b/gcc/acinclude.m4
@@ -452,6 +452,10 @@ AC_DEFUN([gcc_GAS_FLAGS],
dnl Always pass --32 to ia32 Linux assembler.
gcc_cv_as_flags="--32"
;;
+ powerpc*-*-darwin*)
+ dnl Always pass -arch ppc to assembler.
+ gcc_cv_as_flags="-arch ppc"
+ ;;
*)
gcc_cv_as_flags=" "
;;
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index fbb70e42b08..defad830e15 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,43 @@
+2011-02-14 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gcc-interface/misc.c (gnat_init_options): Do not concatenate -I and
+ its argument, except for the special -I- switch.
+
+2011-02-12 Gerald Pfeifer <gerald@pfeifer.com>
+
+ * gnat_ugn.texi (Compiling Different Versions of Ada): Update
+ link to "Ada Issues".
+
+2011-02-08 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gcc-interface/Makefile.in (x86-64 darwin): Handle multilibs.
+
+2011-02-03 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gcc-interface/gigi.h (fill_vms_descriptor): Take GNU_TYPE instead of
+ GNAT_FORMAL.
+ * gcc-interface/utils2.c (fill_vms_descriptor): Move from here to...
+ * gcc-interface/utils.c (fill_vms_descriptor): ...here. Take GNU_TYPE
+ instead of GNAT_FORMAL. Protect the expression against multiple uses.
+ Do not generate the check directly, instead instantiate the template
+ check present in the descriptor.
+ (make_descriptor_field): Move around.
+ (build_vms_descriptor32): Build a template check in the POINTER field.
+ (build_vms_descriptor): Remove useless suffixes.
+ * gcc-interface/trans.c (call_to_gnu): Adjust fill_vms_descriptor call.
+
+2011-01-26 Eric Botcazou <ebotcazou@adacore.com>
+
+ PR bootstrap/47467
+ * targext.c: Include target files if IN_RTS is defined.
+
+2011-01-26 Richard Guenther <rguenther@suse.de>
+
+ PR bootstrap/47467
+ * targext.c: Include config.h.
+ * gcc-interface/Make-lang.in (ada/targext.o): Add $(CONFIG_H)
+ dependency.
+
2011-01-04 Pascal Obry <obry@adacore.com>
Eric Botcazou <ebotcazou@adacore.com>
diff --git a/gcc/ada/gcc-interface/Make-lang.in b/gcc/ada/gcc-interface/Make-lang.in
index b320e438b76..637a686f676 100644
--- a/gcc/ada/gcc-interface/Make-lang.in
+++ b/gcc/ada/gcc-interface/Make-lang.in
@@ -1189,7 +1189,7 @@ ada/final.o : ada/final.c $(CONFIG_H) $(SYSTEM_H) ada/raise.h
ada/link.o : ada/link.c
-ada/targext.o : ada/targext.c $(SYSTEM_H) coretypes.h $(TM_H)
+ada/targext.o : ada/targext.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H)
$(COMPILER) -c $(ALL_COMPILERFLAGS) $(ADA_CFLAGS) \
$(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
diff --git a/gcc/ada/gcc-interface/Makefile.in b/gcc/ada/gcc-interface/Makefile.in
index 29a79d778e2..b64ba55792b 100644
--- a/gcc/ada/gcc-interface/Makefile.in
+++ b/gcc/ada/gcc-interface/Makefile.in
@@ -2142,12 +2142,18 @@ ifeq ($(strip $(filter-out darwin%,$(osys))),)
s-taprop.adb<s-taprop-posix.adb \
s-taspri.ads<s-taspri-posix.ads \
s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
- a-numaux.ads<a-numaux-x86.ads \
- a-numaux.adb<a-numaux-x86.adb \
g-trasym.ads<g-trasym-unimplemented.ads \
g-trasym.adb<g-trasym-unimplemented.adb \
- system.ads<system-darwin-x86_64.ads \
+ a-numaux.ads<a-numaux-x86.ads \
+ a-numaux.adb<a-numaux-x86.adb \
$(ATOMICS_TARGET_PAIRS)
+ ifeq ($(strip $(MULTISUBDIR)),/i386)
+ LIBGNAT_TARGET_PAIRS += \
+ system.ads<system-darwin-x86.ads
+ else
+ LIBGNAT_TARGET_PAIRS += \
+ system.ads<system-darwin-x86_64.ads
+ endif
endif
ifeq ($(strip $(filter-out powerpc%,$(arch))),)
diff --git a/gcc/ada/gcc-interface/gigi.h b/gcc/ada/gcc-interface/gigi.h
index 67a7a472abd..e45cf138337 100644
--- a/gcc/ada/gcc-interface/gigi.h
+++ b/gcc/ada/gcc-interface/gigi.h
@@ -6,7 +6,7 @@
* *
* C Header File *
* *
- * Copyright (C) 1992-2010, Free Software Foundation, Inc. *
+ * Copyright (C) 1992-2011, Free Software Foundation, Inc. *
* *
* GNAT is free software; you can redistribute it and/or modify it under *
* terms of the GNU General Public License as published by the Free Soft- *
@@ -861,10 +861,9 @@ extern tree build_allocator (tree type, tree init, tree result_type,
Entity_Id gnat_proc, Entity_Id gnat_pool,
Node_Id gnat_node, bool);
-/* Fill in a VMS descriptor for EXPR and return a constructor for it.
- GNAT_FORMAL is how we find the descriptor record. GNAT_ACTUAL is how
- we derive the source location on a C_E */
-extern tree fill_vms_descriptor (tree expr, Entity_Id gnat_formal,
+/* Fill in a VMS descriptor of GNU_TYPE for GNU_EXPR and return the result.
+ GNAT_ACTUAL is the actual parameter for which the descriptor is built. */
+extern tree fill_vms_descriptor (tree gnu_type, tree gnu_expr,
Node_Id gnat_actual);
/* Indicate that we need to take the address of T and that it therefore
diff --git a/gcc/ada/gcc-interface/misc.c b/gcc/ada/gcc-interface/misc.c
index 360ebab8aed..4f7a5e1da1d 100644
--- a/gcc/ada/gcc-interface/misc.c
+++ b/gcc/ada/gcc-interface/misc.c
@@ -195,13 +195,12 @@ gnat_init_options (unsigned int decoded_options_count,
|| num_elements == 0)
continue;
- if (decoded_options[i].opt_index == OPT_I)
- {
- gcc_assert (num_elements == 2);
- save_argv[save_argc++]
- = concat (decoded_options[i].canonical_option[0],
- decoded_options[i].canonical_option[1], NULL);
- }
+ /* Deal with -I- specially since it must be a single switch. */
+ if (decoded_options[i].opt_index == OPT_I
+ && num_elements == 2
+ && decoded_options[i].canonical_option[1][0] == '-'
+ && decoded_options[i].canonical_option[1][1] == '\0')
+ save_argv[save_argc++] = "-I-";
else
{
gcc_assert (num_elements >= 1 && num_elements <= 2);
diff --git a/gcc/ada/gcc-interface/trans.c b/gcc/ada/gcc-interface/trans.c
index 30dbf7a969a..e438960ee3b 100644
--- a/gcc/ada/gcc-interface/trans.c
+++ b/gcc/ada/gcc-interface/trans.c
@@ -3071,9 +3071,9 @@ call_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, tree gnu_target)
= convert (DECL_ARG_TYPE (gnu_formal), integer_zero_node);
else
gnu_actual = build_unary_op (ADDR_EXPR, NULL_TREE,
- fill_vms_descriptor (gnu_actual,
- gnat_formal,
- gnat_actual));
+ fill_vms_descriptor
+ (TREE_TYPE (TREE_TYPE (gnu_formal)),
+ gnu_actual, gnat_actual));
}
else
{
diff --git a/gcc/ada/gcc-interface/utils.c b/gcc/ada/gcc-interface/utils.c
index 19a17f9394a..eac87e0bbc9 100644
--- a/gcc/ada/gcc-interface/utils.c
+++ b/gcc/ada/gcc-interface/utils.c
@@ -6,7 +6,7 @@
* *
* C Implementation File *
* *
- * Copyright (C) 1992-2010, Free Software Foundation, Inc. *
+ * Copyright (C) 1992-2011, Free Software Foundation, Inc. *
* *
* GNAT is free software; you can redistribute it and/or modify it under *
* terms of the GNU General Public License as published by the Free Soft- *
@@ -203,7 +203,6 @@ static tree split_plus (tree, tree *);
static tree float_type_for_precision (int, enum machine_mode);
static tree convert_to_fat_pointer (tree, tree);
static tree convert_to_thin_pointer (tree, tree);
-static tree make_descriptor_field (const char *,tree, tree, tree, tree);
static bool potential_alignment_gap (tree, tree, tree);
static void process_attributes (tree, struct attrib *);
@@ -2280,6 +2279,22 @@ build_template (tree template_type, tree array_type, tree expr)
return gnat_build_constructor (template_type, template_elts);
}
+/* Helper routine to make a descriptor field. FIELD_LIST is the list of decls
+ being built; the new decl is chained on to the front of the list. */
+
+static tree
+make_descriptor_field (const char *name, tree type, tree rec_type,
+ tree initial, tree field_list)
+{
+ tree field
+ = create_field_decl (get_identifier (name), type, rec_type, NULL_TREE,
+ NULL_TREE, 0, 0);
+
+ DECL_INITIAL (field) = initial;
+ DECL_CHAIN (field) = field_list;
+ return field;
+}
+
/* Build a 32-bit VMS descriptor from a Mechanism_Type, which must specify a
descriptor type, and the GCC type of an object. Each FIELD_DECL in the
type contains in its DECL_INITIAL the expression to use when a constructor
@@ -2291,15 +2306,11 @@ tree
build_vms_descriptor32 (tree type, Mechanism_Type mech, Entity_Id gnat_entity)
{
tree record_type = make_node (RECORD_TYPE);
- tree pointer32_type;
+ tree pointer32_type, pointer64_type;
tree field_list = NULL_TREE;
- int klass;
- int dtype = 0;
- tree inner_type;
- int ndim;
- int i;
+ int klass, ndim, i, dtype = 0;
+ tree inner_type, tem;
tree *idx_arr;
- tree tem;
/* If TYPE is an unconstrained array, use the underlying array type. */
if (TREE_CODE (type) == UNCONSTRAINED_ARRAY_TYPE)
@@ -2439,15 +2450,22 @@ build_vms_descriptor32 (tree type, Mechanism_Type mech, Entity_Id gnat_entity)
= make_descriptor_field ("CLASS", gnat_type_for_size (8, 1), record_type,
size_int (klass), field_list);
- /* Of course this will crash at run time if the address space is not
- within the low 32 bits, but there is nothing else we can do. */
pointer32_type = build_pointer_type_for_mode (type, SImode, false);
+ pointer64_type = build_pointer_type_for_mode (type, DImode, false);
+
+ /* Ensure that only 32-bit pointers are passed in 32-bit descriptors. Note
+ that we cannot build a template call to the CE routine as it would get a
+ wrong source location; instead we use a second placeholder for it. */
+ tem = build_unary_op (ADDR_EXPR, pointer64_type,
+ build0 (PLACEHOLDER_EXPR, type));
+ tem = build3 (COND_EXPR, pointer32_type,
+ build_binary_op (GE_EXPR, boolean_type_node, tem,
+ build_int_cstu (pointer64_type, 0x80000000)),
+ build0 (PLACEHOLDER_EXPR, void_type_node),
+ convert (pointer32_type, tem));
field_list
- = make_descriptor_field ("POINTER", pointer32_type, record_type,
- build_unary_op (ADDR_EXPR,
- pointer32_type,
- build0 (PLACEHOLDER_EXPR, type)),
+ = make_descriptor_field ("POINTER", pointer32_type, record_type, tem,
field_list);
switch (mech)
@@ -2488,7 +2506,6 @@ build_vms_descriptor32 (tree type, Mechanism_Type mech, Entity_Id gnat_entity)
= make_descriptor_field ("DIGITS", gnat_type_for_size (8, 1),
record_type, size_zero_node, field_list);
-
field_list
= make_descriptor_field ("AFLAGS", gnat_type_for_size (8, 1),
record_type,
@@ -2587,16 +2604,12 @@ build_vms_descriptor32 (tree type, Mechanism_Type mech, Entity_Id gnat_entity)
tree
build_vms_descriptor (tree type, Mechanism_Type mech, Entity_Id gnat_entity)
{
- tree record64_type = make_node (RECORD_TYPE);
+ tree record_type = make_node (RECORD_TYPE);
tree pointer64_type;
- tree field_list64 = NULL_TREE;
- int klass;
- int dtype = 0;
- tree inner_type;
- int ndim;
- int i;
+ tree field_list = NULL_TREE;
+ int klass, ndim, i, dtype = 0;
+ tree inner_type, tem;
tree *idx_arr;
- tree tem;
/* If TYPE is an unconstrained array, use the underlying array type. */
if (TREE_CODE (type) == UNCONSTRAINED_ARRAY_TYPE)
@@ -2718,32 +2731,32 @@ build_vms_descriptor (tree type, Mechanism_Type mech, Entity_Id gnat_entity)
/* Make the type for a 64-bit descriptor for VMS. The first six fields
are the same for all types. */
- field_list64
+ field_list
= make_descriptor_field ("MBO", gnat_type_for_size (16, 1),
- record64_type, size_int (1), field_list64);
- field_list64
+ record_type, size_int (1), field_list);
+ field_list
= make_descriptor_field ("DTYPE", gnat_type_for_size (8, 1),
- record64_type, size_int (dtype), field_list64);
- field_list64
+ record_type, size_int (dtype), field_list);
+ field_list
= make_descriptor_field ("CLASS", gnat_type_for_size (8, 1),
- record64_type, size_int (klass), field_list64);
- field_list64
+ record_type, size_int (klass), field_list);
+ field_list
= make_descriptor_field ("MBMO", gnat_type_for_size (32, 1),
- record64_type, ssize_int (-1), field_list64);
- field_list64
+ record_type, ssize_int (-1), field_list);
+ field_list
= make_descriptor_field ("LENGTH", gnat_type_for_size (64, 1),
- record64_type,
+ record_type,
size_in_bytes (mech == By_Descriptor_A
? inner_type : type),
- field_list64);
+ field_list);
pointer64_type = build_pointer_type_for_mode (type, DImode, false);
- field_list64
- = make_descriptor_field ("POINTER", pointer64_type, record64_type,
+ field_list
+ = make_descriptor_field ("POINTER", pointer64_type, record_type,
build_unary_op (ADDR_EXPR, pointer64_type,
build0 (PLACEHOLDER_EXPR, type)),
- field_list64);
+ field_list);
switch (mech)
{
@@ -2752,31 +2765,31 @@ build_vms_descriptor (tree type, Mechanism_Type mech, Entity_Id gnat_entity)
break;
case By_Descriptor_SB:
- field_list64
+ field_list
= make_descriptor_field ("SB_L1", gnat_type_for_size (64, 1),
- record64_type,
+ record_type,
(TREE_CODE (type) == ARRAY_TYPE
? TYPE_MIN_VALUE (TYPE_DOMAIN (type))
: size_zero_node),
- field_list64);
- field_list64
+ field_list);
+ field_list
= make_descriptor_field ("SB_U1", gnat_type_for_size (64, 1),
- record64_type,
+ record_type,
(TREE_CODE (type) == ARRAY_TYPE
? TYPE_MAX_VALUE (TYPE_DOMAIN (type))
: size_zero_node),
- field_list64);
+ field_list);
break;
case By_Descriptor_A:
case By_Descriptor_NCA:
- field_list64
+ field_list
= make_descriptor_field ("SCALE", gnat_type_for_size (8, 1),
- record64_type, size_zero_node, field_list64);
+ record_type, size_zero_node, field_list);
- field_list64
+ field_list
= make_descriptor_field ("DIGITS", gnat_type_for_size (8, 1),
- record64_type, size_zero_node, field_list64);
+ record_type, size_zero_node, field_list);
dtype = (mech == By_Descriptor_NCA
? 0
@@ -2785,22 +2798,22 @@ build_vms_descriptor (tree type, Mechanism_Type mech, Entity_Id gnat_entity)
: (TREE_CODE (type) == ARRAY_TYPE
&& TYPE_CONVENTION_FORTRAN_P (type)
? 224 : 192));
- field_list64
+ field_list
= make_descriptor_field ("AFLAGS", gnat_type_for_size (8, 1),
- record64_type, size_int (dtype),
- field_list64);
+ record_type, size_int (dtype),
+ field_list);
- field_list64
+ field_list
= make_descriptor_field ("DIMCT", gnat_type_for_size (8, 1),
- record64_type, size_int (ndim), field_list64);
+ record_type, size_int (ndim), field_list);
- field_list64
+ field_list
= make_descriptor_field ("MBZ", gnat_type_for_size (32, 1),
- record64_type, size_int (0), field_list64);
- field_list64
+ record_type, size_int (0), field_list);
+ field_list
= make_descriptor_field ("ARSIZE", gnat_type_for_size (64, 1),
- record64_type, size_in_bytes (type),
- field_list64);
+ record_type, size_in_bytes (type),
+ field_list);
/* Now build a pointer to the 0,0,0... element. */
tem = build0 (PLACEHOLDER_EXPR, type);
@@ -2810,10 +2823,10 @@ build_vms_descriptor (tree type, Mechanism_Type mech, Entity_Id gnat_entity)
convert (TYPE_DOMAIN (inner_type), size_zero_node),
NULL_TREE, NULL_TREE);
- field_list64
- = make_descriptor_field ("A0", pointer64_type, record64_type,
+ field_list
+ = make_descriptor_field ("A0", pointer64_type, record_type,
build1 (ADDR_EXPR, pointer64_type, tem),
- field_list64);
+ field_list);
/* Next come the addressing coefficients. */
tem = size_one_node;
@@ -2830,9 +2843,9 @@ build_vms_descriptor (tree type, Mechanism_Type mech, Entity_Id gnat_entity)
fname[0] = (mech == By_Descriptor_NCA ? 'S' : 'M');
fname[1] = '0' + i, fname[2] = 0;
- field_list64
+ field_list
= make_descriptor_field (fname, gnat_type_for_size (64, 1),
- record64_type, idx_length, field_list64);
+ record_type, idx_length, field_list);
if (mech == By_Descriptor_NCA)
tem = idx_length;
@@ -2844,16 +2857,16 @@ build_vms_descriptor (tree type, Mechanism_Type mech, Entity_Id gnat_entity)
char fname[3];
fname[0] = 'L', fname[1] = '0' + i, fname[2] = 0;
- field_list64
+ field_list
= make_descriptor_field (fname, gnat_type_for_size (64, 1),
- record64_type,
- TYPE_MIN_VALUE (idx_arr[i]), field_list64);
+ record_type,
+ TYPE_MIN_VALUE (idx_arr[i]), field_list);
fname[0] = 'U';
- field_list64
+ field_list
= make_descriptor_field (fname, gnat_type_for_size (64, 1),
- record64_type,
- TYPE_MAX_VALUE (idx_arr[i]), field_list64);
+ record_type,
+ TYPE_MAX_VALUE (idx_arr[i]), field_list);
}
break;
@@ -2861,26 +2874,41 @@ build_vms_descriptor (tree type, Mechanism_Type mech, Entity_Id gnat_entity)
post_error ("unsupported descriptor type for &", gnat_entity);
}
- TYPE_NAME (record64_type) = create_concat_name (gnat_entity, "DESC64");
- finish_record_type (record64_type, nreverse (field_list64), 0, false);
- return record64_type;
+ TYPE_NAME (record_type) = create_concat_name (gnat_entity, "DESC64");
+ finish_record_type (record_type, nreverse (field_list), 0, false);
+ return record_type;
}
-/* Utility routine for above code to make a field. FIELD_LIST is the
- list of decls being built; the new decl is chained on to the front of
- the list. */
+/* Fill in a VMS descriptor of GNU_TYPE for GNU_EXPR and return the result.
+ GNAT_ACTUAL is the actual parameter for which the descriptor is built. */
-static tree
-make_descriptor_field (const char *name, tree type,
- tree rec_type, tree initial, tree field_list)
+tree
+fill_vms_descriptor (tree gnu_type, tree gnu_expr, Node_Id gnat_actual)
{
- tree field
- = create_field_decl (get_identifier (name), type, rec_type, NULL_TREE,
- NULL_TREE, 0, 0);
+ VEC(constructor_elt,gc) *v = NULL;
+ tree field;
- DECL_INITIAL (field) = initial;
- DECL_CHAIN (field) = field_list;
- return field;
+ gnu_expr = maybe_unconstrained_array (gnu_expr);
+ gnu_expr = gnat_protect_expr (gnu_expr);
+ gnat_mark_addressable (gnu_expr);
+
+ /* We may need to substitute both GNU_EXPR and a CALL_EXPR to the raise CE
+ routine in case we have a 32-bit descriptor. */
+ gnu_expr = build2 (COMPOUND_EXPR, void_type_node,
+ build_call_raise (CE_Range_Check_Failed, gnat_actual,
+ N_Raise_Constraint_Error),
+ gnu_expr);
+
+ for (field = TYPE_FIELDS (gnu_type); field; field = DECL_CHAIN (field))
+ {
+ tree value
+ = convert (TREE_TYPE (field),
+ SUBSTITUTE_PLACEHOLDER_IN_EXPR (DECL_INITIAL (field),
+ gnu_expr));
+ CONSTRUCTOR_APPEND_ELT (v, field, value);
+ }
+
+ return gnat_build_constructor (gnu_type, v);
}
/* Convert GNU_EXPR, a pointer to a 64bit VMS descriptor, to GNU_TYPE, a
diff --git a/gcc/ada/gcc-interface/utils2.c b/gcc/ada/gcc-interface/utils2.c
index 905b9aa481e..07d6b5bd0bf 100644
--- a/gcc/ada/gcc-interface/utils2.c
+++ b/gcc/ada/gcc-interface/utils2.c
@@ -6,7 +6,7 @@
* *
* C Implementation File *
* *
- * Copyright (C) 1992-2010, Free Software Foundation, Inc. *
+ * Copyright (C) 1992-2011, Free Software Foundation, Inc. *
* *
* GNAT is free software; you can redistribute it and/or modify it under *
* terms of the GNU General Public License as published by the Free Soft- *
@@ -2216,58 +2216,6 @@ build_allocator (tree type, tree init, tree result_type, Entity_Id gnat_proc,
return convert (result_type, result);
}
-/* Fill in a VMS descriptor for EXPR and return a constructor for it.
- GNAT_FORMAL is how we find the descriptor record. GNAT_ACTUAL is
- how we derive the source location to raise C_E on an out of range
- pointer. */
-
-tree
-fill_vms_descriptor (tree expr, Entity_Id gnat_formal, Node_Id gnat_actual)
-{
- tree parm_decl = get_gnu_tree (gnat_formal);
- tree record_type = TREE_TYPE (TREE_TYPE (parm_decl));
- tree field;
- const bool do_range_check
- = strcmp ("MBO",
- IDENTIFIER_POINTER (DECL_NAME (TYPE_FIELDS (record_type))));
- VEC(constructor_elt,gc) *v = NULL;
-
- expr = maybe_unconstrained_array (expr);
- gnat_mark_addressable (expr);
-
- for (field = TYPE_FIELDS (record_type); field; field = DECL_CHAIN (field))
- {
- tree conexpr = convert (TREE_TYPE (field),
- SUBSTITUTE_PLACEHOLDER_IN_EXPR
- (DECL_INITIAL (field), expr));
-
- /* Check to ensure that only 32-bit pointers are passed in
- 32-bit descriptors */
- if (do_range_check
- && strcmp (IDENTIFIER_POINTER (DECL_NAME (field)), "POINTER") == 0)
- {
- tree pointer64type
- = build_pointer_type_for_mode (void_type_node, DImode, false);
- tree addr64expr = build_unary_op (ADDR_EXPR, pointer64type, expr);
- tree malloc64low
- = build_int_cstu (long_integer_type_node, 0x80000000);
-
- add_stmt (build3 (COND_EXPR, void_type_node,
- build_binary_op (GE_EXPR, boolean_type_node,
- convert (long_integer_type_node,
- addr64expr),
- malloc64low),
- build_call_raise (CE_Range_Check_Failed,
- gnat_actual,
- N_Raise_Constraint_Error),
- NULL_TREE));
- }
- CONSTRUCTOR_APPEND_ELT (v, field, conexpr);
- }
-
- return gnat_build_constructor (record_type, v);
-}
-
/* Indicate that we need to take the address of T and that it therefore
should not be allocated in a register. Returns true if successful. */
diff --git a/gcc/ada/gnat_ugn.texi b/gcc/ada/gnat_ugn.texi
index 48a38ba0aee..d843106df94 100644
--- a/gcc/ada/gnat_ugn.texi
+++ b/gcc/ada/gnat_ugn.texi
@@ -7008,7 +7008,7 @@ may generally be compiled using this switch (see the description of the
for further information).
For information about the approved ``Ada Issues'' that have been incorporated
-into Ada 2012, see @url{http://www.ada-auth.org/cgi-bin/cvsweb.cgi/AIs}.
+into Ada 2012, see @url{http://www.ada-auth.org/ais.html}.
Included with GNAT releases is a file @file{features-ada12} that describes
the set of implemented Ada 2012 features.
diff --git a/gcc/ada/targext.c b/gcc/ada/targext.c
index 72e6c2ca486..b37cc28c6be 100644
--- a/gcc/ada/targext.c
+++ b/gcc/ada/targext.c
@@ -6,7 +6,7 @@
* *
* C Implementation File *
* *
- * Copyright (C) 2005-2009 Free Software Foundation, Inc. *
+ * Copyright (C) 2005-2011, Free Software Foundation, Inc. *
* *
* GNAT is free software; you can redistribute it and/or modify it under *
* terms of the GNU General Public License as published by the Free Soft- *
@@ -33,7 +33,13 @@
/* extension for object and executable files. It is used by the compiler, */
/* binder and tools. */
+#ifdef IN_RTS
+#include "tconfig.h"
+#include "tsystem.h"
+#else
+#include "config.h"
#include "system.h"
+#endif
#include "coretypes.h"
#include "tm.h"
diff --git a/gcc/builtins.c b/gcc/builtins.c
index ec0aecf98ea..106b2ca10b0 100644
--- a/gcc/builtins.c
+++ b/gcc/builtins.c
@@ -605,7 +605,7 @@ c_readstr (const char *str, enum machine_mode mode)
if (WORDS_BIG_ENDIAN)
j = GET_MODE_SIZE (mode) - i - 1;
if (BYTES_BIG_ENDIAN != WORDS_BIG_ENDIAN
- && GET_MODE_SIZE (mode) > UNITS_PER_WORD)
+ && GET_MODE_SIZE (mode) >= UNITS_PER_WORD)
j = j + UNITS_PER_WORD - 2 * (j % UNITS_PER_WORD) - 1;
j *= BITS_PER_UNIT;
gcc_assert (j < 2 * HOST_BITS_PER_WIDE_INT);
@@ -652,9 +652,10 @@ target_char_cast (tree cst, char *p)
static tree
builtin_save_expr (tree exp)
{
- if (TREE_ADDRESSABLE (exp) == 0
- && (TREE_CODE (exp) == PARM_DECL
- || (TREE_CODE (exp) == VAR_DECL && !TREE_STATIC (exp))))
+ if (TREE_CODE (exp) == SSA_NAME
+ || (TREE_ADDRESSABLE (exp) == 0
+ && (TREE_CODE (exp) == PARM_DECL
+ || (TREE_CODE (exp) == VAR_DECL && !TREE_STATIC (exp)))))
return exp;
return save_expr (exp);
diff --git a/gcc/c-decl.c b/gcc/c-decl.c
index 4d24c602b54..b438b066c83 100644
--- a/gcc/c-decl.c
+++ b/gcc/c-decl.c
@@ -404,6 +404,13 @@ struct GTY((chain_next ("%h.outer"))) c_scope {
up searching for labels when popping scopes, particularly since
labels are normally only found at function scope. */
BOOL_BITFIELD has_label_bindings : 1;
+
+ /* True if we should issue a warning if a goto statement crosses any
+ of the bindings. We still need to check the list of bindings to
+ find the specific ones we need to warn about. This is true if
+ decl_jump_unsafe would return true for any of the bindings. This
+ is used to avoid looping over all the bindings unnecessarily. */
+ BOOL_BITFIELD has_jump_unsafe_decl : 1;
};
/* The scope currently in effect. */
@@ -554,6 +561,31 @@ add_stmt (tree t)
return t;
}
+/* Return true if we will want to say something if a goto statement
+ crosses DECL. */
+
+static bool
+decl_jump_unsafe (tree decl)
+{
+ if (decl == error_mark_node || TREE_TYPE (decl) == error_mark_node)
+ return false;
+
+ /* Always warn about crossing variably modified types. */
+ if ((TREE_CODE (decl) == VAR_DECL || TREE_CODE (decl) == TYPE_DECL)
+ && variably_modified_type_p (TREE_TYPE (decl), NULL_TREE))
+ return true;
+
+ /* Otherwise, only warn if -Wgoto-misses-init and this is an
+ initialized automatic decl. */
+ if (warn_jump_misses_init
+ && TREE_CODE (decl) == VAR_DECL
+ && !TREE_STATIC (decl)
+ && DECL_INITIAL (decl) != NULL_TREE)
+ return true;
+
+ return false;
+}
+
void
c_print_identifier (FILE *file, tree node, int indent)
@@ -602,6 +634,9 @@ bind (tree name, tree decl, struct c_scope *scope, bool invisible,
b->prev = scope->bindings;
scope->bindings = b;
+ if (decl_jump_unsafe (decl))
+ scope->has_jump_unsafe_decl = 1;
+
if (!name)
return;
@@ -758,31 +793,6 @@ set_spot_bindings (struct c_spot_bindings *p, bool defining)
p->left_stmt_expr = false;
}
-/* Return true if we will want to say something if a goto statement
- crosses DECL. */
-
-static bool
-decl_jump_unsafe (tree decl)
-{
- if (decl == error_mark_node || TREE_TYPE (decl) == error_mark_node)
- return false;
-
- /* Always warn about crossing variably modified types. */
- if ((TREE_CODE (decl) == VAR_DECL || TREE_CODE (decl) == TYPE_DECL)
- && variably_modified_type_p (TREE_TYPE (decl), NULL_TREE))
- return true;
-
- /* Otherwise, only warn if -Wgoto-misses-init and this is an
- initialized automatic decl. */
- if (warn_jump_misses_init
- && TREE_CODE (decl) == VAR_DECL
- && !TREE_STATIC (decl)
- && DECL_INITIAL (decl) != NULL_TREE)
- return true;
-
- return false;
-}
-
/* Update spot bindings P as we pop out of SCOPE. Return true if we
should push decls for a label. */
@@ -969,6 +979,7 @@ update_label_decls (struct c_scope *scope)
{
struct c_label_vars *label_vars;
struct c_binding *b1;
+ bool hjud;
unsigned int ix;
struct c_goto_bindings *g;
@@ -977,18 +988,26 @@ update_label_decls (struct c_scope *scope)
label_vars = b->u.label;
b1 = label_vars->label_bindings.bindings_in_scope;
+ if (label_vars->label_bindings.scope == NULL)
+ hjud = false;
+ else
+ hjud = label_vars->label_bindings.scope->has_jump_unsafe_decl;
if (update_spot_bindings (scope, &label_vars->label_bindings))
{
/* This label is defined in this scope. */
- for (; b1 != NULL; b1 = b1->prev)
+ if (hjud)
{
- /* A goto from later in the function to this
- label will never see the initialization of
- B1, if any. Save it to issue a warning if
- needed. */
- if (decl_jump_unsafe (b1->decl))
- VEC_safe_push (tree, gc, label_vars->decls_in_scope,
- b1->decl);
+ for (; b1 != NULL; b1 = b1->prev)
+ {
+ /* A goto from later in the function to this
+ label will never see the initialization
+ of B1, if any. Save it to issue a
+ warning if needed. */
+ if (decl_jump_unsafe (b1->decl))
+ VEC_safe_push (tree, gc,
+ label_vars->decls_in_scope,
+ b1->decl);
+ }
}
}
@@ -3165,12 +3184,15 @@ check_earlier_gotos (tree label, struct c_label_vars* label_vars)
/* We have a goto to this label. The goto is going forward. In
g->scope, the goto is going to skip any binding which was
defined after g->bindings_in_scope. */
- for (b = g->goto_bindings.scope->bindings;
- b != g->goto_bindings.bindings_in_scope;
- b = b->prev)
+ if (g->goto_bindings.scope->has_jump_unsafe_decl)
{
- if (decl_jump_unsafe (b->decl))
- warn_about_goto (g->loc, label, b->decl);
+ for (b = g->goto_bindings.scope->bindings;
+ b != g->goto_bindings.bindings_in_scope;
+ b = b->prev)
+ {
+ if (decl_jump_unsafe (b->decl))
+ warn_about_goto (g->loc, label, b->decl);
+ }
}
/* We also need to warn about decls defined in any scopes
@@ -3180,14 +3202,17 @@ check_earlier_gotos (tree label, struct c_label_vars* label_vars)
scope = scope->outer)
{
gcc_assert (scope != NULL);
- if (scope == label_vars->label_bindings.scope)
- b = label_vars->label_bindings.bindings_in_scope;
- else
- b = scope->bindings;
- for (; b != NULL; b = b->prev)
+ if (scope->has_jump_unsafe_decl)
{
- if (decl_jump_unsafe (b->decl))
- warn_about_goto (g->loc, label, b->decl);
+ if (scope == label_vars->label_bindings.scope)
+ b = label_vars->label_bindings.bindings_in_scope;
+ else
+ b = scope->bindings;
+ for (; b != NULL; b = b->prev)
+ {
+ if (decl_jump_unsafe (b->decl))
+ warn_about_goto (g->loc, label, b->decl);
+ }
}
}
@@ -3303,6 +3328,10 @@ c_check_switch_jump_warnings (struct c_spot_bindings *switch_bindings,
struct c_binding *b;
gcc_assert (scope != NULL);
+
+ if (!scope->has_jump_unsafe_decl)
+ continue;
+
for (b = scope->bindings; b != NULL; b = b->prev)
{
if (decl_jump_unsafe (b->decl))
diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog
index f55bc2d49cf..f89502dfcef 100644
--- a/gcc/c-family/ChangeLog
+++ b/gcc/c-family/ChangeLog
@@ -1,3 +1,42 @@
+2011-02-19 Jakub Jelinek <jakub@redhat.com>
+
+ PR c/47809
+ * c-common.c (c_fully_fold_internal): Handle VIEW_CONVERT_EXPR.
+
+2011-02-17 Iain Sandoe <iains@gcc.gnu.org>
+
+ * c.opt (fobjc-abi-version=) New.
+ (fobjc-nilcheck): New.
+
+2011-02-03 Nathan Froyd <froydnj@codesourcery.com>
+
+ PR c++/46890
+ * c-common.h (keyword_is_decl_specifier): Declare.
+ * c-common.c (keyword_is_decl_specifier): Define.
+ (keyword_is_function_specifier): New function.
+
+2011-01-26 Jakub Jelinek <jakub@redhat.com>
+
+ PR c/47473
+ * c-lex.c (interpret_float): If CPP_N_IMAGINARY, ensure
+ EXCESS_PRECISION_EXPR is created with COMPLEX_TYPE instead of
+ REAL_TYPE.
+
+2011-01-26 Arnaud Charlet <charlet@adacore.com>
+
+ * c-ada-spec.c (dump_generic_ada_node): Avoid dereferencing null type.
+
+2011-01-26 Jakub Jelinek <jakub@redhat.com>
+
+ PR pch/47430
+ * c-opts.c (c_common_post_options): Call c_common_no_more_pch
+ after init_c_lex if pch_file is set.
+
+2011-01-26 Dave Korn <dave.korn.cygwin@gmail.com>
+
+ PR c++/43601
+ * c.opt (-fkeep-inline-dllexport): New switch.
+
2011-01-12 Richard Guenther <rguenther@suse.de>
PR middle-end/32511
diff --git a/gcc/c-family/c-ada-spec.c b/gcc/c-family/c-ada-spec.c
index 455151a7f51..335acb0e325 100644
--- a/gcc/c-family/c-ada-spec.c
+++ b/gcc/c-family/c-ada-spec.c
@@ -2035,6 +2035,7 @@ dump_generic_ada_node (pretty_printer *buffer, tree node, tree type,
|| !TYPE_FIELDS (TREE_TYPE (underlying_type))))
/* Pointer to opaque structure. */
+ || underlying_type == NULL_TREE
|| (!typ2
&& !TREE_VISITED (underlying_type)
&& !TREE_VISITED (type_name)
diff --git a/gcc/c-family/c-common.c b/gcc/c-family/c-common.c
index 2156fa8b0d0..d696b5f9d8d 100644
--- a/gcc/c-family/c-common.c
+++ b/gcc/c-family/c-common.c
@@ -1213,6 +1213,7 @@ c_fully_fold_internal (tree expr, bool in_init, bool *maybe_const_operands,
case FIX_TRUNC_EXPR:
case FLOAT_EXPR:
CASE_CONVERT:
+ case VIEW_CONVERT_EXPR:
case NON_LVALUE_EXPR:
case NEGATE_EXPR:
case BIT_NOT_EXPR:
@@ -9653,4 +9654,42 @@ keyword_is_storage_class_specifier (enum rid keyword)
}
}
+/* Return true if KEYWORD names a function-specifier [dcl.fct.spec]. */
+
+static bool
+keyword_is_function_specifier (enum rid keyword)
+{
+ switch (keyword)
+ {
+ case RID_INLINE:
+ case RID_VIRTUAL:
+ case RID_EXPLICIT:
+ return true;
+ default:
+ return false;
+ }
+}
+
+/* Return true if KEYWORD names a decl-specifier [dcl.spec] or a
+ declaration-specifier (C99 6.7). */
+
+bool
+keyword_is_decl_specifier (enum rid keyword)
+{
+ if (keyword_is_storage_class_specifier (keyword)
+ || keyword_is_type_qualifier (keyword)
+ || keyword_is_function_specifier (keyword))
+ return true;
+
+ switch (keyword)
+ {
+ case RID_TYPEDEF:
+ case RID_FRIEND:
+ case RID_CONSTEXPR:
+ return true;
+ default:
+ return false;
+ }
+}
+
#include "gt-c-family-c-common.h"
diff --git a/gcc/c-family/c-common.h b/gcc/c-family/c-common.h
index 05456d33abd..406def96e16 100644
--- a/gcc/c-family/c-common.h
+++ b/gcc/c-family/c-common.h
@@ -741,6 +741,7 @@ extern bool float_const_decimal64_p (void);
extern bool keyword_begins_type_specifier (enum rid);
extern bool keyword_is_storage_class_specifier (enum rid);
extern bool keyword_is_type_qualifier (enum rid);
+extern bool keyword_is_decl_specifier (enum rid);
#define c_sizeof(LOC, T) c_sizeof_or_alignof_type (LOC, T, true, 1)
#define c_alignof(LOC, T) c_sizeof_or_alignof_type (LOC, T, false, 1)
diff --git a/gcc/c-family/c-lex.c b/gcc/c-family/c-lex.c
index 778e4246749..1ea57f1cdda 100644
--- a/gcc/c-family/c-lex.c
+++ b/gcc/c-family/c-lex.c
@@ -1,7 +1,7 @@
/* Mainly the interface between cpplib and the C front ends.
Copyright (C) 1987, 1988, 1989, 1992, 1994, 1995, 1996, 1997
- 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010
- Free Software Foundation, Inc.
+ 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010,
+ 2011 Free Software Foundation, Inc.
This file is part of GCC.
@@ -752,8 +752,15 @@ interpret_float (const cpp_token *token, unsigned int flags)
/* Create a node with determined type and value. */
value = build_real (const_type, real);
if (flags & CPP_N_IMAGINARY)
- value = build_complex (NULL_TREE, convert (const_type, integer_zero_node),
- value);
+ {
+ value = build_complex (NULL_TREE, convert (const_type,
+ integer_zero_node), value);
+ if (type != const_type)
+ {
+ const_type = TREE_TYPE (value);
+ type = build_complex_type (type);
+ }
+ }
if (type != const_type)
value = build1 (EXCESS_PRECISION_EXPR, type, value);
diff --git a/gcc/c-family/c-opts.c b/gcc/c-family/c-opts.c
index befd64498a4..8d6e6e7e243 100644
--- a/gcc/c-family/c-opts.c
+++ b/gcc/c-family/c-opts.c
@@ -1,5 +1,5 @@
/* C/ObjC/C++ command line option handling.
- Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
+ Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
Free Software Foundation, Inc.
Contributed by Neil Booth.
@@ -995,6 +995,12 @@ c_common_post_options (const char **pfilename)
{
init_c_lex ();
+ /* When writing a PCH file, avoid reading some other PCH file,
+ because the default address space slot then can't be used
+ for the output PCH file. */
+ if (pch_file)
+ c_common_no_more_pch ();
+
/* Yuk. WTF is this? I do know ObjC relies on it somewhere. */
input_location = UNKNOWN_LOCATION;
}
diff --git a/gcc/c-family/c.opt b/gcc/c-family/c.opt
index 868247168fe..bb928fa9146 100644
--- a/gcc/c-family/c.opt
+++ b/gcc/c-family/c.opt
@@ -1,6 +1,6 @@
; Options for the C, ObjC, C++ and ObjC++ front ends.
-; Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
-; Free Software Foundation, Inc.
+; Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
+; 2011 Free Software Foundation, Inc.
;
; This file is part of GCC.
;
@@ -814,6 +814,10 @@ ffriend-injection
C++ ObjC++ Var(flag_friend_injection)
Inject friend functions into enclosing namespace
+fkeep-inline-dllexport
+C C++ ObjC ObjC++ Var(flag_keep_inline_dllexport) Init(1) Report Condition(TARGET_DLLIMPORT_DECL_ATTRIBUTES)
+Don't emit dllexported inline functions unless needed
+
flabels-ok
C++ ObjC++ Ignore Warn(switch %qs is no longer supported)
@@ -849,6 +853,10 @@ fnothrow-opt
C++ ObjC++ Optimization Var(flag_nothrow_opt)
Treat a throw() exception specification as noexcept to improve code size
+fobjc-abi-version=
+ObjC ObjC++ Joined Report RejectNegative UInteger Var(flag_objc_abi)
+Specify which ABI to use for Objective-C family code and meta-data generation.
+
; Generate special '- .cxx_construct' and '- .cxx_destruct' methods
; to initialize any non-POD ivars in Objective-C++ classes.
fobjc-call-cxx-cdtors
@@ -869,6 +877,10 @@ fobjc-gc
ObjC ObjC++ Var(flag_objc_gc)
Enable garbage collection (GC) in Objective-C/Objective-C++ programs
+fobjc-nilcheck
+ObjC ObjC++ Var(flag_objc_nilcheck,1)
+Enable inline checks for nil receivers with the NeXT runtime and ABI version 2.
+
; Nonzero means that we generate NeXT setjmp based exceptions.
fobjc-sjlj-exceptions
ObjC ObjC++ Var(flag_objc_sjlj_exceptions) Init(-1)
diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c
index 689423ea028..a22bb737533 100644
--- a/gcc/c-typeck.c
+++ b/gcc/c-typeck.c
@@ -10270,6 +10270,10 @@ c_objc_common_truthvalue_conversion (location_t location, tree expr)
error_at (location, "used union type value where scalar is required");
return error_mark_node;
+ case VOID_TYPE:
+ error_at (location, "void value not ignored as it ought to be");
+ return error_mark_node;
+
case FUNCTION_TYPE:
gcc_unreachable ();
@@ -10282,8 +10286,8 @@ c_objc_common_truthvalue_conversion (location_t location, tree expr)
if (int_operands)
expr = remove_c_maybe_const_expr (expr);
- /* ??? Should we also give an error for void and vectors rather than
- leaving those to give errors later? */
+ /* ??? Should we also give an error for vectors rather than leaving
+ those to give errors later? */
expr = c_common_truthvalue_conversion (location, expr);
if (TREE_CODE (expr) == INTEGER_CST && int_operands && !int_const)
diff --git a/gcc/caller-save.c b/gcc/caller-save.c
index 8bf235b2b05..8b796b9d2fa 100644
--- a/gcc/caller-save.c
+++ b/gcc/caller-save.c
@@ -1,6 +1,6 @@
/* Save and restore call-clobbered registers which are live across a call.
Copyright (C) 1989, 1992, 1994, 1995, 1997, 1998, 1999, 2000,
- 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
+ 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
Free Software Foundation, Inc.
This file is part of GCC.
@@ -415,101 +415,93 @@ saved_hard_reg_compare_func (const void *v1p, const void *v2p)
void
setup_save_areas (void)
{
- int i, j, k;
- unsigned int r;
+ int i, j, k, freq;
HARD_REG_SET hard_regs_used;
+ struct saved_hard_reg *saved_reg;
+ rtx insn;
+ struct insn_chain *chain, *next;
+ unsigned int regno;
+ HARD_REG_SET hard_regs_to_save, used_regs, this_insn_sets;
+ reg_set_iterator rsi;
- /* Allocate space in the save area for the largest multi-register
- pseudos first, then work backwards to single register
- pseudos. */
-
- /* Find and record all call-used hard-registers in this function. */
CLEAR_HARD_REG_SET (hard_regs_used);
- for (i = FIRST_PSEUDO_REGISTER; i < max_regno; i++)
- if (reg_renumber[i] >= 0 && REG_N_CALLS_CROSSED (i) > 0)
- {
- unsigned int regno = reg_renumber[i];
- unsigned int endregno
- = end_hard_regno (GET_MODE (crtl->emit.regno_reg_rtx[i]), regno);
- for (r = regno; r < endregno; r++)
- if (call_used_regs[r])
- SET_HARD_REG_BIT (hard_regs_used, r);
- }
- if (optimize && flag_ira_share_save_slots)
+ /* Find every CALL_INSN and record which hard regs are live across the
+ call into HARD_REG_MAP and HARD_REGS_USED. */
+ initiate_saved_hard_regs ();
+ /* Create hard reg saved regs. */
+ for (chain = reload_insn_chain; chain != 0; chain = next)
{
- rtx insn, slot;
- struct insn_chain *chain, *next;
- char *saved_reg_conflicts;
- unsigned int regno;
- int next_k, freq;
- struct saved_hard_reg *saved_reg, *saved_reg2, *saved_reg3;
- int call_saved_regs_num;
- struct saved_hard_reg *call_saved_regs[FIRST_PSEUDO_REGISTER];
- HARD_REG_SET hard_regs_to_save, used_regs, this_insn_sets;
- reg_set_iterator rsi;
- int best_slot_num;
- int prev_save_slots_num;
- rtx prev_save_slots[FIRST_PSEUDO_REGISTER];
-
- initiate_saved_hard_regs ();
- /* Create hard reg saved regs. */
- for (chain = reload_insn_chain; chain != 0; chain = next)
+ insn = chain->insn;
+ next = chain->next;
+ if (!CALL_P (insn)
+ || find_reg_note (insn, REG_NORETURN, NULL))
+ continue;
+ freq = REG_FREQ_FROM_BB (BLOCK_FOR_INSN (insn));
+ REG_SET_TO_HARD_REG_SET (hard_regs_to_save,
+ &chain->live_throughout);
+ COPY_HARD_REG_SET (used_regs, call_used_reg_set);
+
+ /* Record all registers set in this call insn. These don't
+ need to be saved. N.B. the call insn might set a subreg
+ of a multi-hard-reg pseudo; then the pseudo is considered
+ live during the call, but the subreg that is set
+ isn't. */
+ CLEAR_HARD_REG_SET (this_insn_sets);
+ note_stores (PATTERN (insn), mark_set_regs, &this_insn_sets);
+ /* Sibcalls are considered to set the return value. */
+ if (SIBLING_CALL_P (insn) && crtl->return_rtx)
+ mark_set_regs (crtl->return_rtx, NULL_RTX, &this_insn_sets);
+
+ AND_COMPL_HARD_REG_SET (used_regs, call_fixed_reg_set);
+ AND_COMPL_HARD_REG_SET (used_regs, this_insn_sets);
+ AND_HARD_REG_SET (hard_regs_to_save, used_regs);
+ for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++)
+ if (TEST_HARD_REG_BIT (hard_regs_to_save, regno))
+ {
+ if (hard_reg_map[regno] != NULL)
+ hard_reg_map[regno]->call_freq += freq;
+ else
+ saved_reg = new_saved_hard_reg (regno, freq);
+ SET_HARD_REG_BIT (hard_regs_used, regno);
+ }
+ /* Look through all live pseudos, mark their hard registers. */
+ EXECUTE_IF_SET_IN_REG_SET
+ (&chain->live_throughout, FIRST_PSEUDO_REGISTER, regno, rsi)
{
- insn = chain->insn;
- next = chain->next;
- if (!CALL_P (insn)
- || find_reg_note (insn, REG_NORETURN, NULL))
- continue;
- freq = REG_FREQ_FROM_BB (BLOCK_FOR_INSN (insn));
- REG_SET_TO_HARD_REG_SET (hard_regs_to_save,
- &chain->live_throughout);
- COPY_HARD_REG_SET (used_regs, call_used_reg_set);
+ int r = reg_renumber[regno];
+ int bound;
- /* Record all registers set in this call insn. These don't
- need to be saved. N.B. the call insn might set a subreg
- of a multi-hard-reg pseudo; then the pseudo is considered
- live during the call, but the subreg that is set
- isn't. */
- CLEAR_HARD_REG_SET (this_insn_sets);
- note_stores (PATTERN (insn), mark_set_regs, &this_insn_sets);
- /* Sibcalls are considered to set the return value. */
- if (SIBLING_CALL_P (insn) && crtl->return_rtx)
- mark_set_regs (crtl->return_rtx, NULL_RTX, &this_insn_sets);
+ if (r < 0)
+ continue;
- AND_COMPL_HARD_REG_SET (used_regs, call_fixed_reg_set);
- AND_COMPL_HARD_REG_SET (used_regs, this_insn_sets);
- AND_HARD_REG_SET (hard_regs_to_save, used_regs);
- for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++)
- if (TEST_HARD_REG_BIT (hard_regs_to_save, regno))
+ bound = r + hard_regno_nregs[r][PSEUDO_REGNO_MODE (regno)];
+ for (; r < bound; r++)
+ if (TEST_HARD_REG_BIT (used_regs, r))
{
- if (hard_reg_map[regno] != NULL)
- hard_reg_map[regno]->call_freq += freq;
+ if (hard_reg_map[r] != NULL)
+ hard_reg_map[r]->call_freq += freq;
else
- saved_reg = new_saved_hard_reg (regno, freq);
+ saved_reg = new_saved_hard_reg (r, freq);
+ SET_HARD_REG_BIT (hard_regs_to_save, r);
+ SET_HARD_REG_BIT (hard_regs_used, r);
}
- /* Look through all live pseudos, mark their hard registers. */
- EXECUTE_IF_SET_IN_REG_SET
- (&chain->live_throughout, FIRST_PSEUDO_REGISTER, regno, rsi)
- {
- int r = reg_renumber[regno];
- int bound;
+ }
+ }
- if (r < 0)
- continue;
+ /* If requested, figure out which hard regs can share save slots. */
+ if (optimize && flag_ira_share_save_slots)
+ {
+ rtx slot;
+ char *saved_reg_conflicts;
+ int next_k;
+ struct saved_hard_reg *saved_reg2, *saved_reg3;
+ int call_saved_regs_num;
+ struct saved_hard_reg *call_saved_regs[FIRST_PSEUDO_REGISTER];
+ int best_slot_num;
+ int prev_save_slots_num;
+ rtx prev_save_slots[FIRST_PSEUDO_REGISTER];
- bound = r + hard_regno_nregs[r][PSEUDO_REGNO_MODE (regno)];
- for (; r < bound; r++)
- if (TEST_HARD_REG_BIT (used_regs, r))
- {
- if (hard_reg_map[r] != NULL)
- hard_reg_map[r]->call_freq += freq;
- else
- saved_reg = new_saved_hard_reg (r, freq);
- SET_HARD_REG_BIT (hard_regs_to_save, r);
- }
- }
- }
/* Find saved hard register conflicts. */
saved_reg_conflicts = (char *) xmalloc (saved_regs_num * saved_regs_num);
memset (saved_reg_conflicts, 0, saved_regs_num * saved_regs_num);
@@ -667,8 +659,10 @@ setup_save_areas (void)
}
else
{
- /* Now run through all the call-used hard-registers and allocate
- space for them in the caller-save area. Try to allocate space
+ /* We are not sharing slots.
+
+ Run through all the call-used hard-registers and allocate
+ space for each in the caller-save area. Try to allocate space
in a manner which allows multi-register saves/restores to be done. */
for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
diff --git a/gcc/cfgcleanup.c b/gcc/cfgcleanup.c
index bf6ca45990e..aaa0ea5d232 100644
--- a/gcc/cfgcleanup.c
+++ b/gcc/cfgcleanup.c
@@ -2341,8 +2341,7 @@ try_optimize_cfg (int mode)
}
}
delete_basic_block (b);
- if (!(mode & CLEANUP_CFGLAYOUT))
- changed = true;
+ changed = true;
/* Avoid trying to remove ENTRY_BLOCK_PTR. */
b = (c == ENTRY_BLOCK_PTR ? c->next_bb : c);
continue;
diff --git a/gcc/cfgexpand.c b/gcc/cfgexpand.c
index f1aa7393d4c..19278c30162 100644
--- a/gcc/cfgexpand.c
+++ b/gcc/cfgexpand.c
@@ -520,7 +520,7 @@ update_alias_info_with_stack_vars (void)
for -O0 where we are preserving even unreferenced variables. */
gcc_assert (DECL_P (decl)
&& (!optimize
- || referenced_var_lookup (DECL_UID (decl))));
+ || referenced_var_lookup (cfun, DECL_UID (decl))));
bitmap_set_bit (part, uid);
*((bitmap *) pointer_map_insert (decls_to_partitions,
(void *)(size_t) uid)) = part;
@@ -1311,30 +1311,6 @@ create_stack_guard (void)
crtl->stack_protect_guard = guard;
}
-/* A subroutine of expand_used_vars. Walk down through the BLOCK tree
- expanding variables. Those variables that can be put into registers
- are allocated pseudos; those that can't are put on the stack.
-
- TOPLEVEL is true if this is the outermost BLOCK. */
-
-static HOST_WIDE_INT
-account_used_vars_for_block (tree block, bool toplevel)
-{
- tree t;
- HOST_WIDE_INT size = 0;
-
- /* Expand all variables at this level. */
- for (t = BLOCK_VARS (block); t ; t = DECL_CHAIN (t))
- if (TREE_USED (t))
- size += expand_one_var (t, toplevel, false);
-
- /* Expand all variables at containing levels. */
- for (t = BLOCK_SUBBLOCKS (block); t ; t = BLOCK_CHAIN (t))
- size += account_used_vars_for_block (t, false);
-
- return size;
-}
-
/* Prepare for expanding variables. */
static void
init_vars_expansion (void)
@@ -1366,34 +1342,30 @@ fini_vars_expansion (void)
stack_vars_alloc = stack_vars_num = 0;
}
-/* Make a fair guess for the size of the stack frame of the decl
- passed. This doesn't have to be exact, the result is only used
- in the inline heuristics. So we don't want to run the full stack
- var packing algorithm (which is quadratic in the number of stack
- vars). Instead, we calculate the total size of all stack vars.
- This turns out to be a pretty fair estimate -- packing of stack
- vars doesn't happen very often. */
+/* Make a fair guess for the size of the stack frame of the function
+ in NODE. This doesn't have to be exact, the result is only used in
+ the inline heuristics. So we don't want to run the full stack var
+ packing algorithm (which is quadratic in the number of stack vars).
+ Instead, we calculate the total size of all stack vars. This turns
+ out to be a pretty fair estimate -- packing of stack vars doesn't
+ happen very often. */
HOST_WIDE_INT
-estimated_stack_frame_size (tree decl)
+estimated_stack_frame_size (struct cgraph_node *node)
{
HOST_WIDE_INT size = 0;
size_t i;
- tree var, outer_block = DECL_INITIAL (current_function_decl);
- unsigned ix;
+ tree var;
tree old_cur_fun_decl = current_function_decl;
- current_function_decl = decl;
- push_cfun (DECL_STRUCT_FUNCTION (decl));
+ referenced_var_iterator rvi;
+ struct function *fn = DECL_STRUCT_FUNCTION (node->decl);
- init_vars_expansion ();
+ current_function_decl = node->decl;
+ push_cfun (fn);
- FOR_EACH_LOCAL_DECL (cfun, ix, var)
- {
- if (TREE_USED (var))
- size += expand_one_var (var, true, false);
- TREE_USED (var) = 1;
- }
- size += account_used_vars_for_block (outer_block, true);
+ gcc_checking_assert (gimple_referenced_vars (fn));
+ FOR_EACH_REFERENCED_VAR (fn, var, rvi)
+ size += expand_one_var (var, true, false);
if (stack_vars_num > 0)
{
@@ -2567,6 +2539,13 @@ expand_debug_expr (tree exp)
if (TREE_CODE (exp) == MEM_REF)
{
+ if (GET_CODE (op0) == DEBUG_IMPLICIT_PTR
+ || (GET_CODE (op0) == PLUS
+ && GET_CODE (XEXP (op0, 0)) == DEBUG_IMPLICIT_PTR))
+ /* (mem (debug_implicit_ptr)) might confuse aliasing.
+ Instead just use get_inner_reference. */
+ goto component_ref;
+
op1 = expand_debug_expr (TREE_OPERAND (exp, 1));
if (!op1 || !CONST_INT_P (op1))
return NULL;
@@ -2605,6 +2584,7 @@ expand_debug_expr (tree exp)
return op0;
+ component_ref:
case ARRAY_REF:
case ARRAY_RANGE_REF:
case COMPONENT_REF:
@@ -3124,7 +3104,7 @@ expand_debug_expr (tree exp)
gcc_assert (part >= 0 && (unsigned)part < SA.map->num_partitions);
- op0 = SA.partition_to_pseudo[part];
+ op0 = copy_rtx (SA.partition_to_pseudo[part]);
}
goto adjust_mode;
}
diff --git a/gcc/cgraph.c b/gcc/cgraph.c
index c8f9b04bb12..dd7eeadc705 100644
--- a/gcc/cgraph.c
+++ b/gcc/cgraph.c
@@ -164,28 +164,28 @@ static GTY(()) struct cgraph_asm_node *cgraph_asm_last_node;
them, to support -fno-toplevel-reorder. */
int cgraph_order;
-/* List of hooks trigerred on cgraph_edge events. */
+/* List of hooks triggered on cgraph_edge events. */
struct cgraph_edge_hook_list {
cgraph_edge_hook hook;
void *data;
struct cgraph_edge_hook_list *next;
};
-/* List of hooks trigerred on cgraph_node events. */
+/* List of hooks triggered on cgraph_node events. */
struct cgraph_node_hook_list {
cgraph_node_hook hook;
void *data;
struct cgraph_node_hook_list *next;
};
-/* List of hooks trigerred on events involving two cgraph_edges. */
+/* List of hooks triggered on events involving two cgraph_edges. */
struct cgraph_2edge_hook_list {
cgraph_2edge_hook hook;
void *data;
struct cgraph_2edge_hook_list *next;
};
-/* List of hooks trigerred on events involving two cgraph_nodes. */
+/* List of hooks triggered on events involving two cgraph_nodes. */
struct cgraph_2node_hook_list {
cgraph_2node_hook hook;
void *data;
@@ -588,7 +588,7 @@ cgraph_same_body_alias (tree alias, tree decl)
}
/* Add thunk alias into callgraph. The alias declaration is ALIAS and it
- alises DECL with an adjustments made into the first parameter.
+ aliases DECL with an adjustments made into the first parameter.
See comments in thunk_adjust for detail on the parameters. */
struct cgraph_node *
@@ -937,7 +937,7 @@ cgraph_create_edge_including_clones (struct cgraph_node *orig,
/* It is possible that clones already contain the edge while
master didn't. Either we promoted indirect call into direct
call in the clone or we are processing clones of unreachable
- master where edges has been rmeoved. */
+ master where edges has been removed. */
if (edge)
cgraph_set_call_stmt (edge, stmt);
else if (!cgraph_edge (node, stmt))
@@ -997,7 +997,7 @@ cgraph_create_edge_1 (struct cgraph_node *caller, struct cgraph_node *callee,
have not been loaded yet. */
if (call_stmt)
{
- /* This is a rather expensive check possibly trigerring
+ /* This is a rather expensive check possibly triggering
construction of call stmt hashtable. */
gcc_checking_assert (!cgraph_edge (caller, call_stmt));
@@ -1252,7 +1252,7 @@ cgraph_update_edges_for_call_stmt_node (struct cgraph_node *node,
if (!new_call && !old_call)
return;
/* See if we turned indirect call into direct call or folded call to one builtin
- into different bultin. */
+ into different builtin. */
if (old_call != new_call)
{
struct cgraph_edge *e = cgraph_edge (node, old_stmt);
@@ -1973,7 +1973,7 @@ dump_cgraph_node (FILE *f, struct cgraph_node *node)
fprintf (f, " %s/%i", cgraph_node_name (n), n->uid);
if (n->thunk.thunk_p)
{
- fprintf (f, " (thunk of %s fixed ofset %i virtual value %i has "
+ fprintf (f, " (thunk of %s fixed offset %i virtual value %i has "
"virtual offset %i",
lang_hooks.decl_printable_name (n->thunk.alias, 2),
(int)n->thunk.fixed_offset,
@@ -2300,6 +2300,8 @@ cgraph_create_virtual_clone (struct cgraph_node *old_node,
if (!flag_wpa)
gcc_checking_assert (tree_versionable_function_p (old_decl));
+ gcc_assert (old_node->local.can_change_signature || !args_to_skip);
+
/* Make a new FUNCTION_DECL tree node */
if (!args_to_skip)
new_decl = copy_node (old_decl);
@@ -2409,8 +2411,8 @@ cgraph_function_body_availability (struct cgraph_node *node)
avail = AVAIL_LOCAL;
else if (!node->local.externally_visible)
avail = AVAIL_AVAILABLE;
- /* Inline functions are safe to be analyzed even if their sybol can
- be overwritten at runtime. It is not meaningful to enfore any sane
+ /* Inline functions are safe to be analyzed even if their symbol can
+ be overwritten at runtime. It is not meaningful to enforce any sane
behaviour on replacing inline function by different body. */
else if (DECL_DECLARED_INLINE_P (node->decl))
avail = AVAIL_AVAILABLE;
@@ -2704,9 +2706,9 @@ cgraph_propagate_frequency (struct cgraph_node *node)
if (edge->caller != node)
{
only_called_at_startup &= edge->caller->only_called_at_startup;
- /* It makes snese to put main() together with the static constructors.
+ /* It makes sense to put main() together with the static constructors.
It will be executed for sure, but rest of functions called from
- main are definitly not at startup only. */
+ main are definitely not at startup only. */
if (MAIN_NAME_P (DECL_NAME (edge->caller->decl)))
only_called_at_startup = 0;
only_called_at_exit &= edge->caller->only_called_at_exit;
@@ -2841,7 +2843,7 @@ cgraph_can_remove_if_no_direct_calls_and_refs_p (struct cgraph_node *node)
return true;
}
-/* Return true when function NODE can be excpected to be removed
+/* Return true when function NODE can be expected to be removed
from program when direct calls in this compilation unit are removed.
As a special case COMDAT functions are
@@ -2850,7 +2852,7 @@ cgraph_can_remove_if_no_direct_calls_and_refs_p (struct cgraph_node *node)
unit)
This function behaves as cgraph_only_called_directly_p because eliminating
- all uses of COMDAT function does not make it neccesarily disappear from
+ all uses of COMDAT function does not make it necessarily disappear from
the program unless we are compiling whole program or we do LTO. In this
case we know we win since dynamic linking will not really discard the
linkonce section. */
@@ -2872,7 +2874,7 @@ cgraph_will_be_removed_from_program_if_no_direct_calls (struct cgraph_node *node
}
/* Return true when RESOLUTION indicate that linker will use
- the symbol from non-LTo object files. */
+ the symbol from non-LTO object files. */
bool
resolution_used_from_other_file_p (enum ld_plugin_symbol_resolution resolution)
diff --git a/gcc/cgraph.h b/gcc/cgraph.h
index 1e04c63e0cb..5e1c1418dbf 100644
--- a/gcc/cgraph.h
+++ b/gcc/cgraph.h
@@ -1,5 +1,5 @@
/* Callgraph handling code.
- Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
+ Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
Free Software Foundation, Inc.
Contributed by Jan Hubicka
@@ -114,6 +114,10 @@ struct GTY(()) cgraph_local_info {
Currently computed and used only by ipa-cp. */
unsigned versionable : 1;
+ /* False when function calling convention and signature can not be changed.
+ This is the case when __builtin_apply_args is used. */
+ unsigned can_change_signature : 1;
+
/* True when function should be inlined independently on its size. */
unsigned disregard_inline_limits : 1;
@@ -716,6 +720,7 @@ bool cgraph_node_can_be_local_p (struct cgraph_node *);
struct varpool_node * varpool_get_node (const_tree decl);
void varpool_remove_node (struct varpool_node *node);
+void varpool_finalize_named_section_flags (struct varpool_node *node);
bool varpool_assemble_pending_decls (void);
bool varpool_assemble_decl (struct varpool_node *node);
bool varpool_analyze_pending_decls (void);
@@ -764,7 +769,7 @@ varpool_next_static_initializer (struct varpool_node *node)
/* In ipa-inline.c */
void cgraph_clone_inlined_nodes (struct cgraph_edge *, bool, bool);
-unsigned int compute_inline_parameters (struct cgraph_node *);
+void compute_inline_parameters (struct cgraph_node *);
/* Create a new static variable of type TYPE. */
@@ -939,7 +944,7 @@ varpool_can_remove_if_no_refs (struct varpool_node *node)
/* Return true when all references to VNODE must be visible in ipa_ref_list.
i.e. if the variable is not externally visible or not used in some magic
way (asm statement or such).
- The magic uses are all sumarized in force_output flag. */
+ The magic uses are all summarized in force_output flag. */
static inline bool
varpool_all_refs_explicit_p (struct varpool_node *vnode)
diff --git a/gcc/cgraphbuild.c b/gcc/cgraphbuild.c
index 7bfeac78581..6b8116a612a 100644
--- a/gcc/cgraphbuild.c
+++ b/gcc/cgraphbuild.c
@@ -141,6 +141,11 @@ record_eh_tables (struct cgraph_node *node, struct function *fun)
{
eh_region i;
+ if (DECL_FUNCTION_PERSONALITY (node->decl))
+ ipa_record_reference (node, NULL,
+ cgraph_node (DECL_FUNCTION_PERSONALITY (node->decl)),
+ NULL, IPA_REF_ADDR, NULL);
+
i = fun->eh->region_tree;
if (!i)
return;
diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c
index 92e5aa95461..049d1b9f7b6 100644
--- a/gcc/cgraphunit.c
+++ b/gcc/cgraphunit.c
@@ -246,13 +246,14 @@ cgraph_process_new_functions (void)
cgraph_analyze_function (node);
push_cfun (DECL_STRUCT_FUNCTION (fndecl));
current_function_decl = fndecl;
- compute_inline_parameters (node);
if ((cgraph_state == CGRAPH_STATE_IPA_SSA
&& !gimple_in_ssa_p (DECL_STRUCT_FUNCTION (fndecl)))
/* When not optimizing, be sure we run early local passes anyway
to expand OMP. */
|| !optimize)
execute_pass_list (pass_early_local_passes.pass.sub);
+ else
+ compute_inline_parameters (node);
free_dominance_info (CDI_POST_DOMINATORS);
free_dominance_info (CDI_DOMINATORS);
pop_cfun ();
@@ -364,7 +365,7 @@ cgraph_finalize_function (tree decl, bool nested)
|| DECL_STATIC_CONSTRUCTOR (decl)
|| DECL_STATIC_DESTRUCTOR (decl)
/* COMDAT virtual functions may be referenced by vtable from
- other compilatoin unit. Still we want to devirtualize calls
+ other compilation unit. Still we want to devirtualize calls
to those so we need to analyze them.
FIXME: We should introduce may edges for this purpose and update
their handling in unreachable function removal and inliner too. */
@@ -431,7 +432,7 @@ verify_edge_count_and_frequency (struct cgraph_edge *e)
!= compute_call_stmt_bb_frequency (e->caller->decl,
gimple_bb (e->call_stmt))))
{
- error ("caller edge frequency %i does not match BB freqency %i",
+ error ("caller edge frequency %i does not match BB frequency %i",
e->frequency,
compute_call_stmt_bb_frequency (e->caller->decl,
gimple_bb (e->call_stmt)));
@@ -440,13 +441,22 @@ verify_edge_count_and_frequency (struct cgraph_edge *e)
return error_found;
}
+/* Switch to THIS_CFUN if needed and print STMT to stderr. */
+static void
+cgraph_debug_gimple_stmt (struct function *this_cfun, gimple stmt)
+{
+ /* debug_gimple_stmt needs correct cfun */
+ if (cfun != this_cfun)
+ set_cfun (this_cfun);
+ debug_gimple_stmt (stmt);
+}
+
/* Verify cgraph nodes of given cgraph node. */
DEBUG_FUNCTION void
verify_cgraph_node (struct cgraph_node *node)
{
struct cgraph_edge *e;
struct function *this_cfun = DECL_STRUCT_FUNCTION (node->decl);
- struct function *saved_cfun = cfun;
basic_block this_block;
gimple_stmt_iterator gsi;
bool error_found = false;
@@ -455,8 +465,6 @@ verify_cgraph_node (struct cgraph_node *node)
return;
timevar_push (TV_CGRAPH_VERIFY);
- /* debug_generic_stmt needs correct cfun */
- set_cfun (this_cfun);
for (e = node->callees; e; e = e->next_callee)
if (e->aux)
{
@@ -499,7 +507,7 @@ verify_cgraph_node (struct cgraph_node *node)
error ("An indirect edge from %s is not marked as indirect or has "
"associated indirect_info, the corresponding statement is: ",
identifier_to_locale (cgraph_node_name (e->caller)));
- debug_gimple_stmt (e->call_stmt);
+ cgraph_debug_gimple_stmt (this_cfun, e->call_stmt);
error_found = true;
}
}
@@ -642,7 +650,7 @@ verify_cgraph_node (struct cgraph_node *node)
if (e->aux)
{
error ("shared call_stmt:");
- debug_gimple_stmt (stmt);
+ cgraph_debug_gimple_stmt (this_cfun, stmt);
error_found = true;
}
if (!e->indirect_unknown_callee)
@@ -676,7 +684,8 @@ verify_cgraph_node (struct cgraph_node *node)
{
error ("a call to thunk improperly represented "
"in the call graph:");
- debug_gimple_stmt (stmt);
+ cgraph_debug_gimple_stmt (this_cfun, stmt);
+ error_found = true;
}
}
else if (decl)
@@ -685,14 +694,14 @@ verify_cgraph_node (struct cgraph_node *node)
"corresponding to a call_stmt with "
"a known declaration:");
error_found = true;
- debug_gimple_stmt (e->call_stmt);
+ cgraph_debug_gimple_stmt (this_cfun, e->call_stmt);
}
e->aux = (void *)1;
}
else if (decl)
{
error ("missing callgraph edge for call stmt:");
- debug_gimple_stmt (stmt);
+ cgraph_debug_gimple_stmt (this_cfun, stmt);
error_found = true;
}
}
@@ -710,7 +719,7 @@ verify_cgraph_node (struct cgraph_node *node)
error ("edge %s->%s has no corresponding call_stmt",
identifier_to_locale (cgraph_node_name (e->caller)),
identifier_to_locale (cgraph_node_name (e->callee)));
- debug_gimple_stmt (e->call_stmt);
+ cgraph_debug_gimple_stmt (this_cfun, e->call_stmt);
error_found = true;
}
e->aux = 0;
@@ -721,7 +730,7 @@ verify_cgraph_node (struct cgraph_node *node)
{
error ("an indirect edge from %s has no corresponding call_stmt",
identifier_to_locale (cgraph_node_name (e->caller)));
- debug_gimple_stmt (e->call_stmt);
+ cgraph_debug_gimple_stmt (this_cfun, e->call_stmt);
error_found = true;
}
e->aux = 0;
@@ -732,7 +741,6 @@ verify_cgraph_node (struct cgraph_node *node)
dump_cgraph_node (stderr, node);
internal_error ("verify_cgraph_node failed");
}
- set_cfun (saved_cfun);
timevar_pop (TV_CGRAPH_VERIFY);
}
@@ -776,6 +784,11 @@ cgraph_analyze_function (struct cgraph_node *node)
assign_assembler_name_if_neeeded (node->decl);
+ /* disregard_inline_limits affects topological order of the early optimization,
+ so we need to compute it ahead of rest of inline parameters. */
+ node->local.disregard_inline_limits
+ = DECL_DISREGARD_INLINE_LIMITS (node->decl);
+
/* Make sure to gimplify bodies only once. During analyzing a
function we lower it, which will require gimplified nested
functions, so we can end up here with an already gimplified
@@ -791,6 +804,24 @@ cgraph_analyze_function (struct cgraph_node *node)
current_function_decl = save;
}
+/* Process attributes common for vars and functions. */
+
+static void
+process_common_attributes (tree decl)
+{
+ tree weakref = lookup_attribute ("weakref", DECL_ATTRIBUTES (decl));
+
+ if (weakref && !lookup_attribute ("alias", DECL_ATTRIBUTES (decl)))
+ {
+ warning_at (DECL_SOURCE_LOCATION (decl), OPT_Wattributes,
+ "%<weakref%> attribute should be accompanied with"
+ " an %<alias%> attribute");
+ DECL_WEAK (decl) = 0;
+ DECL_ATTRIBUTES (decl) = remove_attribute ("weakref",
+ DECL_ATTRIBUTES (decl));
+ }
+}
+
/* Look for externally_visible and used attributes and mark cgraph nodes
accordingly.
@@ -843,6 +874,17 @@ process_function_and_variable_attributes (struct cgraph_node *first,
else if (node->local.finalized)
cgraph_mark_needed_node (node);
}
+ if (lookup_attribute ("weakref", DECL_ATTRIBUTES (decl))
+ && node->local.finalized)
+ {
+ warning_at (DECL_SOURCE_LOCATION (node->decl), OPT_Wattributes,
+ "%<weakref%> attribute ignored"
+ " because function is defined");
+ DECL_WEAK (decl) = 0;
+ DECL_ATTRIBUTES (decl) = remove_attribute ("weakref",
+ DECL_ATTRIBUTES (decl));
+ }
+ process_common_attributes (decl);
}
for (vnode = varpool_nodes; vnode != first_var; vnode = vnode->next)
{
@@ -869,6 +911,18 @@ process_function_and_variable_attributes (struct cgraph_node *first,
else if (vnode->finalized)
varpool_mark_needed_node (vnode);
}
+ if (lookup_attribute ("weakref", DECL_ATTRIBUTES (decl))
+ && vnode->finalized
+ && DECL_INITIAL (decl))
+ {
+ warning_at (DECL_SOURCE_LOCATION (vnode->decl), OPT_Wattributes,
+ "%<weakref%> attribute ignored"
+ " because variable is initialized");
+ DECL_WEAK (decl) = 0;
+ DECL_ATTRIBUTES (decl) = remove_attribute ("weakref",
+ DECL_ATTRIBUTES (decl));
+ }
+ process_common_attributes (decl);
}
}
@@ -1502,7 +1556,7 @@ cgraph_expand_function (struct cgraph_node *node)
alias && alias->next; alias = alias->next)
;
/* Walk aliases in the order they were created; it is possible that
- thunks reffers to the aliases made earlier. */
+ thunks refers to the aliases made earlier. */
for (; alias; alias = next)
{
next = alias->previous;
@@ -1667,6 +1721,10 @@ cgraph_output_in_order (void)
varpool_empty_needed_queue ();
for (i = 0; i < max; ++i)
+ if (nodes[i].kind == ORDER_VAR)
+ varpool_finalize_named_section_flags (nodes[i].u.v);
+
+ for (i = 0; i < max; ++i)
{
switch (nodes[i].kind)
{
@@ -1995,6 +2053,8 @@ cgraph_function_versioning (struct cgraph_node *old_version_node,
if (!tree_versionable_function_p (old_decl))
return NULL;
+ gcc_assert (old_version_node->local.can_change_signature || !args_to_skip);
+
/* Make a new FUNCTION_DECL tree node for the
new version. */
if (!args_to_skip)
@@ -2274,7 +2334,7 @@ cgraph_materialize_all_clones (void)
{
if (cgraph_dump_file)
{
- fprintf (cgraph_dump_file, "clonning %s to %s\n",
+ fprintf (cgraph_dump_file, "cloning %s to %s\n",
cgraph_node_name (node->clone_of),
cgraph_node_name (node));
if (node->clone.tree_map)
diff --git a/gcc/combine.c b/gcc/combine.c
index 5f28c9692c3..57f1d89cd4e 100644
--- a/gcc/combine.c
+++ b/gcc/combine.c
@@ -1032,7 +1032,9 @@ clear_log_links (void)
/* Walk the LOG_LINKS of insn B to see if we find a reference to A. Return
true if we found a LOG_LINK that proves that A feeds B. This only works
if there are no instructions between A and B which could have a link
- depending on A, since in that case we would not record a link for B. */
+ depending on A, since in that case we would not record a link for B.
+ We also check the implicit dependency created by a cc0 setter/user
+ pair. */
static bool
insn_a_feeds_b (rtx a, rtx b)
@@ -1041,6 +1043,10 @@ insn_a_feeds_b (rtx a, rtx b)
for (links = LOG_LINKS (b); links; links = XEXP (links, 1))
if (XEXP (links, 0) == a)
return true;
+#ifdef HAVE_cc0
+ if (sets_cc0_p (a))
+ return true;
+#endif
return false;
}
@@ -7482,7 +7488,8 @@ make_compound_operation (rtx x, enum rtx_code in_code)
an address. */
if (in_code == MEM && CONST_INT_P (XEXP (x, 1))
&& INTVAL (XEXP (x, 1)) < HOST_BITS_PER_WIDE_INT
- && INTVAL (XEXP (x, 1)) >= 0)
+ && INTVAL (XEXP (x, 1)) >= 0
+ && SCALAR_INT_MODE_P (mode))
{
HOST_WIDE_INT count = INTVAL (XEXP (x, 1));
HOST_WIDE_INT multval = (HOST_WIDE_INT) 1 << count;
@@ -13146,10 +13153,6 @@ distribute_notes (rtx notes, rtx from_insn, rtx i3, rtx i2, rtx elim_i2,
place = i3;
break;
- case REG_VALUE_PROFILE:
- /* Just get rid of this note, as it is unused later anyway. */
- break;
-
case REG_NON_LOCAL_GOTO:
if (JUMP_P (i3))
place = i3;
diff --git a/gcc/common.opt b/gcc/common.opt
index 7c93c8339ac..2717b11cc1c 100644
--- a/gcc/common.opt
+++ b/gcc/common.opt
@@ -1,6 +1,6 @@
; Options for the language- and target-independent parts of the compiler.
-; Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
+; Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
; Free Software Foundation, Inc.
;
; This file is part of GCC.
@@ -32,6 +32,11 @@ int optimize
Variable
int optimize_size
+; Not used directly to control optimizations, only to save -Ofast
+; setting for "optimize" attributes.
+Variable
+int optimize_fast
+
; 0 means straightforward implementation of complex divide acceptable.
; 1 means wide ranges of inputs must work for complex divide.
; 2 means C99-like requirements for complex multiply and divide.
@@ -712,6 +717,13 @@ Driver
e
Driver Joined Separate
+; This option has historically been passed down to the linker by an
+; accident of a %{e*} spec, so ensure it continues to be passed down
+; as a single option. The supported option for this purpose is
+; -rdynamic. See PR 47390.
+export-dynamic
+Driver Undocumented
+
; The version of the C++ ABI in use. The following values are allowed:
;
; 0: The version of the ABI believed most conformant with the C++ ABI
@@ -729,6 +741,12 @@ Driver Joined Separate
; 4: The version of the ABI that introduces unambiguous mangling of
; vector types.
;
+; 5: The version of the ABI that ignores attribute const/noreturn
+; in function pointer mangling.
+;
+; 6: The version of the ABI that corrects mangling of decltype and
+; function parameters used in other parameters and the return type.
+;
; Additional positive integers will be assigned as new versions of
; the ABI become the default version of the ABI.
fabi-version=
@@ -853,6 +871,10 @@ fcompare-debug-second
Common Driver RejectNegative Var(flag_compare_debug)
Run only the second compilation of -fcompare-debug
+fcompare-elim
+Common Report Var(flag_compare_elim_after_reload) Optimization
+Perform comparison elimination after register allocation has finished
+
fconserve-stack
Common Var(flag_conserve_stack) Optimization
Do not perform optimizations increasing noticeably stack usage
@@ -874,7 +896,7 @@ Common Ignore
Does nothing. Preserved for backward compatibility.
fcx-limited-range
-Common Report Var(flag_cx_limited_range) Optimization
+Common Report Var(flag_cx_limited_range) Optimization SetByCombined
Omit range reduction step when performing complex division
fcx-fortran-rules
@@ -1020,7 +1042,7 @@ ffast-math
Common
ffinite-math-only
-Common Report Var(flag_finite_math_only) Optimization
+Common Report Var(flag_finite_math_only) Optimization SetByCombined
Assume no NaNs or infinities are generated
ffixed-
@@ -1336,7 +1358,7 @@ Common Report Var(flag_lto_report) Init(0) Optimization
Report various link-time optimization statistics
fmath-errno
-Common Report Var(flag_errno_math) Init(1) Optimization
+Common Report Var(flag_errno_math) Init(1) Optimization SetByCombined
Set errno after built-in math functions
fmax-errors=
@@ -1573,7 +1595,7 @@ Common Ignore
Does nothing. Preserved for backward compatibility.
frounding-math
-Common Report Var(flag_rounding_math) Optimization
+Common Report Var(flag_rounding_math) Optimization SetByCombined
Disable optimizations that assume default FP rounding behavior
fsched-interblock
@@ -1702,11 +1724,11 @@ Common Report Var(flag_show_column) Init(1)
Show column numbers in diagnostics, when available. Default on
fsignaling-nans
-Common Report Var(flag_signaling_nans) Optimization
+Common Report Var(flag_signaling_nans) Optimization SetByCombined
Disable optimizations observable by IEEE signaling NaNs
fsigned-zeros
-Common Report Var(flag_signed_zeros) Init(1) Optimization
+Common Report Var(flag_signed_zeros) Init(1) Optimization SetByCombined
Disable floating point optimizations that ignore the IEEE signedness of zero
fsingle-precision-constant
@@ -1823,7 +1845,7 @@ Perform superblock formation via tail duplication
; (user-visible) trap. This is the case, for example, in nonstop
; IEEE 754 arithmetic.
ftrapping-math
-Common Report Var(flag_trapping_math) Init(1) Optimization
+Common Report Var(flag_trapping_math) Init(1) Optimization SetByCombined
Assume floating-point operations can trap
ftrapv
@@ -1899,8 +1921,8 @@ Common Report Var(flag_tree_loop_im) Init(1) Optimization
Enable loop invariant motion on trees
ftree-loop-linear
-Common Report Var(flag_tree_loop_linear) Optimization
-Enable linear loop transforms on trees
+Common Alias(floop-interchange)
+Enable loop interchange transforms. Same as -floop-interchange
ftree-loop-ivcanon
Common Report Var(flag_tree_loop_ivcanon) Init(1) Optimization
@@ -1974,12 +1996,12 @@ Common Report Var(flag_unsafe_loop_optimizations) Optimization
Allow loop optimizations to assume that the loops behave in normal way
fassociative-math
-Common Report Var(flag_associative_math)
+Common Report Var(flag_associative_math) SetByCombined
Allow optimization for floating-point arithmetic which may change the
result of the operation due to rounding.
freciprocal-math
-Common Report Var(flag_reciprocal_math)
+Common Report Var(flag_reciprocal_math) SetByCombined
Same as -fassociative-math for expressions which include division.
; Nonzero means that unsafe floating-point math optimizations are allowed
@@ -1987,7 +2009,7 @@ Same as -fassociative-math for expressions which include division.
; are allowed to assume that their arguments and results are "normal"
; (e.g., nonnegative for SQRT).
funsafe-math-optimizations
-Common Report Var(flag_unsafe_math_optimizations) Optimization
+Common Report Var(flag_unsafe_math_optimizations) Optimization SetByCombined
Allow math optimizations that may violate IEEE or ISO standards
funswitch-loops
@@ -2172,6 +2194,9 @@ Driver
nodefaultlibs
Driver
+nostartfiles
+Driver
+
nostdlib
Driver
diff --git a/gcc/compare-elim.c b/gcc/compare-elim.c
new file mode 100644
index 00000000000..c3eecfa280b
--- /dev/null
+++ b/gcc/compare-elim.c
@@ -0,0 +1,642 @@
+/* Post-reload compare elimination.
+ Copyright (C) 2010, 2011
+ Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 3, or (at your option) any later
+version.
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING3. If not see
+<http://www.gnu.org/licenses/>. */
+
+/* There is a set of targets whose general-purpose move or addition
+ instructions clobber the flags. These targets cannot split their
+ CBRANCH/CSTORE etc patterns before reload is complete, lest reload
+ itself insert these instructions in between the flags setter and user.
+ Because these targets cannot split the compare from the use, they
+ cannot make use of the comparison elimination offered by the combine pass.
+
+ This is a small pass intended to provide comparison elimination similar to
+ what is available via NOTICE_UPDATE_CC for cc0 targets. This should help
+ encourage cc0 targets to convert to an explicit post-reload representation
+ of the flags.
+
+ This pass assumes:
+
+ (0) CBRANCH/CSTORE etc have been split in pass_split_after_reload.
+
+ (1) All comparison patterns are represented as
+
+ [(set (reg:CC) (compare:CC (reg) (immediate)))]
+
+ (2) All insn patterns that modify the flags are represented as
+
+ [(set (reg) (operation)
+ (clobber (reg:CC))]
+
+ (3) If an insn of form (2) can usefully set the flags, there is
+ another pattern of the form
+
+ [(set (reg) (operation)
+ (set (reg:CCM) (compare:CCM (operation) (immediate)))]
+
+ The mode CCM will be chosen as if by SELECT_CC_MODE.
+
+ Note that unlike NOTICE_UPDATE_CC, we do not handle memory operands.
+ This could be handled as a future enhancement.
+*/
+
+#include "config.h"
+#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
+#include "rtl.h"
+#include "tm_p.h"
+#include "insn-config.h"
+#include "recog.h"
+#include "flags.h"
+#include "basic-block.h"
+#include "tree-pass.h"
+#include "target.h"
+#include "df.h"
+#include "domwalk.h"
+
+
+/* These structures describe a comparison and how it is used. */
+
+/* The choice of maximum 3 uses comes from wanting to eliminate the two
+ duplicate compares from a three-way branch on the sign of a value.
+ This is also sufficient to eliminate the duplicate compare against the
+ high-part of a double-word comparison. */
+#define MAX_CMP_USE 3
+
+struct comparison_use
+{
+ /* The instruction in which the result of the compare is used. */
+ rtx insn;
+ /* The location of the flags register within the use. */
+ rtx *loc;
+ /* The comparison code applied against the flags register. */
+ enum rtx_code code;
+};
+
+struct comparison
+{
+ /* The comparison instruction. */
+ rtx insn;
+
+ /* The insn prior to the comparison insn that clobbers the flags. */
+ rtx prev_clobber;
+
+ /* The two values being compared. These will be either REGs or
+ constants. */
+ rtx in_a, in_b;
+
+ /* Information about how this comparison is used. */
+ struct comparison_use uses[MAX_CMP_USE];
+
+ /* The original CC_MODE for this comparison. */
+ enum machine_mode orig_mode;
+
+ /* The number of uses identified for this comparison. */
+ unsigned short n_uses;
+
+ /* True if not all uses of this comparison have been identified.
+ This can happen either for overflowing the array above, or if
+ the flags register is used in some unusual context. */
+ bool missing_uses;
+
+ /* True if its inputs are still valid at the end of the block. */
+ bool inputs_valid;
+};
+
+typedef struct comparison *comparison_struct_p;
+DEF_VEC_P(comparison_struct_p);
+DEF_VEC_ALLOC_P(comparison_struct_p, heap);
+
+static VEC(comparison_struct_p, heap) *all_compares;
+
+/* Look for a "conforming" comparison, as defined above. If valid, return
+ the rtx for the COMPARE itself. */
+
+static rtx
+conforming_compare (rtx insn)
+{
+ rtx set, src, dest;
+
+ set = single_set (insn);
+ if (set == NULL)
+ return NULL;
+
+ src = SET_SRC (set);
+ if (GET_CODE (src) != COMPARE)
+ return NULL;
+
+ dest = SET_DEST (set);
+ if (!REG_P (dest) || REGNO (dest) != targetm.flags_regnum)
+ return NULL;
+
+ if (REG_P (XEXP (src, 0))
+ && REG_P (XEXP (src, 0))
+ && (REG_P (XEXP (src, 1)) || CONSTANT_P (XEXP (src, 1))))
+ return src;
+
+ return NULL;
+}
+
+/* Look for a pattern of the "correct" form for an insn with a flags clobber
+ for which we may be able to eliminate a compare later. We're not looking
+ to validate any inputs at this time, merely see that the basic shape is
+ correct. The term "arithmetic" may be somewhat misleading... */
+
+static bool
+arithmetic_flags_clobber_p (rtx insn)
+{
+ rtx pat, x;
+
+ if (!NONJUMP_INSN_P (insn))
+ return false;
+ pat = PATTERN (insn);
+ if (extract_asm_operands (pat))
+ return false;
+
+ if (GET_CODE (pat) == PARALLEL && XVECLEN (pat, 0) == 2)
+ {
+ x = XVECEXP (pat, 0, 0);
+ if (GET_CODE (x) != SET)
+ return false;
+ x = SET_DEST (x);
+ if (!REG_P (x))
+ return false;
+
+ x = XVECEXP (pat, 0, 1);
+ if (GET_CODE (x) == CLOBBER)
+ {
+ x = XEXP (x, 0);
+ if (REG_P (x) && REGNO (x) == targetm.flags_regnum)
+ return true;
+ }
+ }
+
+ return false;
+}
+
+/* Look for uses of FLAGS in INSN. If we find one we can analyze, record
+ it in CMP; otherwise indicate that we've missed a use. */
+
+static void
+find_flags_uses_in_insn (struct comparison *cmp, rtx insn)
+{
+ df_ref *use_rec, use;
+
+ /* If we've already lost track of uses, don't bother collecting more. */
+ if (cmp->missing_uses)
+ return;
+
+ /* Find a USE of the flags register. */
+ for (use_rec = DF_INSN_USES (insn); (use = *use_rec) != NULL; use_rec++)
+ if (DF_REF_REGNO (use) == targetm.flags_regnum)
+ {
+ rtx x, *loc;
+
+ /* If this is an unusual use, quit. */
+ if (DF_REF_TYPE (use) != DF_REF_REG_USE)
+ goto fail;
+
+ /* If we've run out of slots to record uses, quit. */
+ if (cmp->n_uses == MAX_CMP_USE)
+ goto fail;
+
+ /* Unfortunately the location of the flags register, while present
+ in the reference structure, doesn't help. We need to find the
+ comparison code that is outer to the actual flags use. */
+ loc = DF_REF_LOC (use);
+ x = PATTERN (insn);
+ if (GET_CODE (x) == PARALLEL)
+ x = XVECEXP (x, 0, 0);
+ x = SET_SRC (x);
+ if (GET_CODE (x) == IF_THEN_ELSE)
+ x = XEXP (x, 0);
+ if (COMPARISON_P (x)
+ && loc == &XEXP (x, 0)
+ && XEXP (x, 1) == const0_rtx)
+ {
+ /* We've found a use of the flags that we understand. */
+ struct comparison_use *cuse = &cmp->uses[cmp->n_uses++];
+ cuse->insn = insn;
+ cuse->loc = loc;
+ cuse->code = GET_CODE (x);
+ }
+ else
+ goto fail;
+ }
+ return;
+
+ fail:
+ /* We failed to recognize this use of the flags register. */
+ cmp->missing_uses = true;
+}
+
+/* Identify comparison instructions within BB. If the flags from the last
+ compare in the BB is live at the end of the block, install the compare
+ in BB->AUX. Called via walk_dominators_tree. */
+
+static void
+find_comparisons_in_bb (struct dom_walk_data *data ATTRIBUTE_UNUSED,
+ basic_block bb)
+{
+ struct comparison *last_cmp;
+ rtx insn, next, last_clobber;
+ bool last_cmp_valid;
+ bitmap killed;
+
+ killed = BITMAP_ALLOC (NULL);
+
+ /* The last comparison that was made. Will be reset to NULL
+ once the flags are clobbered. */
+ last_cmp = NULL;
+
+ /* True iff the last comparison has not been clobbered, nor
+ have its inputs. Used to eliminate duplicate compares. */
+ last_cmp_valid = false;
+
+ /* The last insn that clobbered the flags, if that insn is of
+ a form that may be valid for eliminating a following compare.
+ To be reset to NULL once the flags are set otherwise. */
+ last_clobber = NULL;
+
+ /* Propagate the last live comparison throughout the extended basic block. */
+ if (single_pred_p (bb))
+ {
+ last_cmp = (struct comparison *) single_pred (bb)->aux;
+ if (last_cmp)
+ last_cmp_valid = last_cmp->inputs_valid;
+ }
+
+ for (insn = BB_HEAD (bb); insn; insn = next)
+ {
+ rtx src;
+
+ next = (insn == BB_END (bb) ? NULL_RTX : NEXT_INSN (insn));
+ if (!NONDEBUG_INSN_P (insn))
+ continue;
+
+ /* Compute the set of registers modified by this instruction. */
+ bitmap_clear (killed);
+ df_simulate_find_defs (insn, killed);
+
+ src = conforming_compare (insn);
+ if (src)
+ {
+ /* Eliminate a compare that's redundant with the previous. */
+ if (last_cmp_valid
+ && rtx_equal_p (last_cmp->in_a, XEXP (src, 0))
+ && rtx_equal_p (last_cmp->in_b, XEXP (src, 1)))
+ {
+ delete_insn (insn);
+ continue;
+ }
+
+ last_cmp = XCNEW (struct comparison);
+ last_cmp->insn = insn;
+ last_cmp->prev_clobber = last_clobber;
+ last_cmp->in_a = XEXP (src, 0);
+ last_cmp->in_b = XEXP (src, 1);
+ last_cmp->orig_mode = GET_MODE (SET_DEST (single_set (insn)));
+ VEC_safe_push (comparison_struct_p, heap, all_compares, last_cmp);
+
+ /* It's unusual, but be prepared for comparison patterns that
+ also clobber an input, or perhaps a scratch. */
+ last_clobber = NULL;
+ last_cmp_valid = true;
+ }
+
+ /* Notice if this instruction kills the flags register. */
+ else if (bitmap_bit_p (killed, targetm.flags_regnum))
+ {
+ /* See if this insn could be the "clobber" that eliminates
+ a future comparison. */
+ last_clobber = (arithmetic_flags_clobber_p (insn) ? insn : NULL);
+
+ /* In either case, the previous compare is no longer valid. */
+ last_cmp = NULL;
+ last_cmp_valid = false;
+ continue;
+ }
+
+ /* Notice if this instruction uses the flags register. */
+ else if (last_cmp)
+ find_flags_uses_in_insn (last_cmp, insn);
+
+ /* Notice if any of the inputs to the comparison have changed. */
+ if (last_cmp_valid
+ && (bitmap_bit_p (killed, REGNO (last_cmp->in_a))
+ || (REG_P (last_cmp->in_b)
+ && bitmap_bit_p (killed, REGNO (last_cmp->in_b)))))
+ last_cmp_valid = false;
+ }
+
+ BITMAP_FREE (killed);
+
+ /* Remember the live comparison for subsequent members of
+ the extended basic block. */
+ if (last_cmp)
+ {
+ bb->aux = last_cmp;
+ last_cmp->inputs_valid = last_cmp_valid;
+
+ /* Look to see if the flags register is live outgoing here, and
+ incoming to any successor not part of the extended basic block. */
+ if (bitmap_bit_p (&DF_LIVE_BB_INFO (bb)->out, targetm.flags_regnum))
+ {
+ edge e;
+ edge_iterator ei;
+
+ FOR_EACH_EDGE (e, ei, bb->succs)
+ {
+ basic_block dest = e->dest;
+ if (bitmap_bit_p (&DF_LIVE_BB_INFO (dest)->in,
+ targetm.flags_regnum)
+ && !single_pred_p (dest))
+ {
+ last_cmp->missing_uses = true;
+ break;
+ }
+ }
+ }
+ }
+}
+
+/* Find all comparisons in the function. */
+
+static void
+find_comparisons (void)
+{
+ struct dom_walk_data data;
+
+ memset (&data, 0, sizeof(data));
+ data.dom_direction = CDI_DOMINATORS;
+ data.before_dom_children = find_comparisons_in_bb;
+
+ calculate_dominance_info (CDI_DOMINATORS);
+
+ init_walk_dominator_tree (&data);
+ walk_dominator_tree (&data, ENTRY_BLOCK_PTR);
+ fini_walk_dominator_tree (&data);
+
+ clear_aux_for_blocks ();
+ free_dominance_info (CDI_DOMINATORS);
+}
+
+/* Select an alternate CC_MODE for a comparison insn comparing A and B.
+ Note that inputs are almost certainly different than the IN_A and IN_B
+ stored in CMP -- we're called while attempting to eliminate the compare
+ after all. Return the new FLAGS rtx if successful, else return NULL.
+ Note that this function may start a change group. */
+
+static rtx
+maybe_select_cc_mode (struct comparison *cmp, rtx a ATTRIBUTE_UNUSED,
+ rtx b ATTRIBUTE_UNUSED)
+{
+ enum machine_mode sel_mode;
+ const int n = cmp->n_uses;
+ rtx flags = NULL;
+
+#ifndef SELECT_CC_MODE
+ /* Minimize code differences when this target macro is undefined. */
+ return NULL;
+#define SELECT_CC_MODE(A,B,C) (gcc_unreachable (), VOIDmode)
+#endif
+
+ /* If we don't have access to all of the uses, we can't validate. */
+ if (cmp->missing_uses || n == 0)
+ return NULL;
+
+ /* Find a new mode that works for all of the uses. Special case the
+ common case of exactly one use. */
+ if (n == 1)
+ {
+ sel_mode = SELECT_CC_MODE (cmp->uses[0].code, a, b);
+ if (sel_mode != cmp->orig_mode)
+ {
+ flags = gen_rtx_REG (sel_mode, targetm.flags_regnum);
+ validate_change (cmp->uses[0].insn, cmp->uses[0].loc, flags, true);
+ }
+ }
+ else
+ {
+ int i;
+
+ sel_mode = SELECT_CC_MODE (cmp->uses[0].code, a, b);
+ for (i = 1; i < n; ++i)
+ {
+ enum machine_mode new_mode;
+ new_mode = SELECT_CC_MODE (cmp->uses[i].code, a, b);
+ if (new_mode != sel_mode)
+ {
+ sel_mode = targetm.cc_modes_compatible (sel_mode, new_mode);
+ if (sel_mode == VOIDmode)
+ return NULL;
+ }
+ }
+
+ if (sel_mode != cmp->orig_mode)
+ {
+ flags = gen_rtx_REG (sel_mode, targetm.flags_regnum);
+ for (i = 0; i < n; ++i)
+ validate_change (cmp->uses[i].insn, cmp->uses[i].loc, flags, true);
+ }
+ }
+
+ return flags;
+}
+
+/* Attempt to replace a comparison with a prior arithmetic insn that can
+ compute the same flags value as the comparison itself. Return true if
+ successful, having made all rtl modifications necessary. */
+
+static bool
+try_eliminate_compare (struct comparison *cmp)
+{
+ rtx x, insn, bb_head, flags, in_a, cmp_src;
+
+ /* We must have found an interesting "clobber" preceeding the compare. */
+ if (cmp->prev_clobber == NULL)
+ return false;
+
+ /* ??? For the moment we don't handle comparisons for which IN_B
+ is a register. We accepted these during initial comparison
+ recognition in order to eliminate duplicate compares.
+ An improvement here would be to handle x = a - b; if (a cmp b). */
+ if (!CONSTANT_P (cmp->in_b))
+ return false;
+
+ /* Verify that IN_A is not clobbered in between CMP and PREV_CLOBBER.
+ Given that this target requires this pass, we can assume that most
+ insns do clobber the flags, and so the distance between the compare
+ and the clobber is likely to be small. */
+ /* ??? This is one point at which one could argue that DF_REF_CHAIN would
+ be useful, but it is thought to be too heavy-weight a solution here. */
+
+ in_a = cmp->in_a;
+ insn = cmp->insn;
+ bb_head = BB_HEAD (BLOCK_FOR_INSN (insn));
+ for (insn = PREV_INSN (insn);
+ insn != cmp->prev_clobber;
+ insn = PREV_INSN (insn))
+ {
+ const int abnormal_flags
+ = (DF_REF_CONDITIONAL | DF_REF_PARTIAL | DF_REF_MAY_CLOBBER
+ | DF_REF_MUST_CLOBBER | DF_REF_SIGN_EXTRACT
+ | DF_REF_ZERO_EXTRACT | DF_REF_STRICT_LOW_PART
+ | DF_REF_PRE_POST_MODIFY);
+ df_ref *def_rec, def;
+
+ /* Note that the BB_HEAD is always either a note or a label, but in
+ any case it means that IN_A is defined outside the block. */
+ if (insn == bb_head)
+ return false;
+ if (NOTE_P (insn) || DEBUG_INSN_P (insn))
+ continue;
+
+ /* Find a possible def of IN_A in INSN. */
+ for (def_rec = DF_INSN_DEFS (insn); (def = *def_rec) != NULL; def_rec++)
+ if (DF_REF_REGNO (def) == REGNO (in_a))
+ break;
+
+ /* No definitions of IN_A; continue searching. */
+ if (def == NULL)
+ continue;
+
+ /* Bail if this is not a totally normal set of IN_A. */
+ if (DF_REF_IS_ARTIFICIAL (def))
+ return false;
+ if (DF_REF_FLAGS (def) & abnormal_flags)
+ return false;
+
+ /* We've found an insn between the compare and the clobber that sets
+ IN_A. Given that pass_cprop_hardreg has not yet run, we still find
+ situations in which we can usefully look through a copy insn. */
+ x = single_set (insn);
+ if (x == NULL)
+ return false;
+ in_a = SET_SRC (x);
+ if (!REG_P (in_a))
+ return false;
+ }
+
+ /* We've reached PREV_CLOBBER without finding a modification of IN_A.
+ Validate that PREV_CLOBBER itself does in fact refer to IN_A. Do
+ recall that we've already validated the shape of PREV_CLOBBER. */
+ x = XVECEXP (PATTERN (insn), 0, 0);
+ if (!rtx_equal_p (SET_DEST (x), in_a))
+ return false;
+ cmp_src = SET_SRC (x);
+
+ /* Determine if we ought to use a different CC_MODE here. */
+ flags = maybe_select_cc_mode (cmp, cmp_src, cmp->in_b);
+ if (flags == NULL)
+ flags = gen_rtx_REG (cmp->orig_mode, targetm.flags_regnum);
+
+ /* Generate a new comparison for installation in the setter. */
+ x = copy_rtx (cmp_src);
+ x = gen_rtx_COMPARE (GET_MODE (flags), x, cmp->in_b);
+ x = gen_rtx_SET (VOIDmode, flags, x);
+
+ /* Succeed if the new instruction is valid. Note that we may have started
+ a change group within maybe_select_cc_mode, therefore we must continue. */
+ validate_change (insn, &XVECEXP (PATTERN (insn), 0, 1), x, true);
+ if (!apply_change_group ())
+ return false;
+
+ /* Success. Delete the compare insn... */
+ delete_insn (cmp->insn);
+
+ /* ... and any notes that are now invalid due to multiple sets. */
+ x = find_regno_note (insn, REG_UNUSED, targetm.flags_regnum);
+ if (x)
+ remove_note (insn, x);
+ x = find_reg_note (insn, REG_EQUAL, NULL);
+ if (x)
+ remove_note (insn, x);
+ x = find_reg_note (insn, REG_EQUIV, NULL);
+ if (x)
+ remove_note (insn, x);
+
+ return true;
+}
+
+/* Main entry point to the pass. */
+
+static unsigned int
+execute_compare_elim_after_reload (void)
+{
+ df_set_flags (DF_DEFER_INSN_RESCAN);
+ df_live_add_problem ();
+ df_analyze ();
+
+ gcc_checking_assert (all_compares == NULL);
+
+ /* Locate all comparisons and their uses, and eliminate duplicates. */
+ find_comparisons ();
+ if (all_compares)
+ {
+ struct comparison *cmp;
+ size_t i;
+
+ /* Eliminate comparisons that are redundant with flags computation. */
+ FOR_EACH_VEC_ELT (comparison_struct_p, all_compares, i, cmp)
+ {
+ try_eliminate_compare (cmp);
+ XDELETE (cmp);
+ }
+
+ VEC_free (comparison_struct_p, heap, all_compares);
+ all_compares = NULL;
+
+ df_analyze ();
+ }
+
+ return 0;
+}
+
+static bool
+gate_compare_elim_after_reload (void)
+{
+ /* Setting this target hook value is how a backend indicates the need. */
+ if (targetm.flags_regnum == INVALID_REGNUM)
+ return false;
+ return flag_compare_elim_after_reload;
+}
+
+struct rtl_opt_pass pass_compare_elim_after_reload =
+{
+ {
+ RTL_PASS,
+ "cmpelim", /* name */
+ gate_compare_elim_after_reload, /* gate */
+ execute_compare_elim_after_reload, /* execute */
+ NULL, /* sub */
+ NULL, /* next */
+ 0, /* static_pass_number */
+ TV_NONE, /* tv_id */
+ 0, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ TODO_df_finish
+ | TODO_df_verify
+ | TODO_verify_rtl_sharing
+ | TODO_dump_func
+ | TODO_ggc_collect /* todo_flags_finish */
+ }
+};
diff --git a/gcc/config.gcc b/gcc/config.gcc
index 0f6aae17717..1c133007243 100644
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -225,16 +225,41 @@ xm_file=
md_file=
# Obsolete configurations.
-#case ${target} in
-# )
-# if test "x$enable_obsolete" != xyes; then
-# echo "*** Configuration ${target} is obsolete." >&2
-# echo "*** Specify --enable-obsolete to build it anyway." >&2
-# echo "*** Support will be REMOVED in the next major release of GCC," >&2
-# echo "*** unless a maintainer comes forward." >&2
-# exit 1
-# fi;;
-#esac
+case ${target} in
+# Avoid cases below matching.
+ alpha*-*-linux* \
+ | arm*-wince-pe* \
+ | arm*-*-netbsdelf* \
+ | i[34567]86-*-netbsdelf* \
+ | powerpc*-*-linux* \
+ | vax-*-netbsdelf*) ;;
+ arc-* \
+ | alpha*-*-gnu* \
+ | arm*-*-netbsd* \
+ | arm-*-pe* \
+ | crx-* \
+ | i[34567]86-*-interix3* \
+ | i[34567]86-*-netbsd* \
+ | i[34567]86-*-pe \
+ | m68hc11-*-* \
+ | m6811-*-* \
+ | m68hc12-*-* \
+ | m6812-*-* \
+ | m68k-*-uclinuxoldabi* \
+ | mcore-*-pe* \
+ | powerpc*-*-gnu* \
+ | score-* \
+ | sh*-*-symbianelf* \
+ | vax-*-netbsd* \
+ )
+ if test "x$enable_obsolete" != xyes; then
+ echo "*** Configuration ${target} is obsolete." >&2
+ echo "*** Specify --enable-obsolete to build it anyway." >&2
+ echo "*** Support will be REMOVED in the next major release of GCC," >&2
+ echo "*** unless a maintainer comes forward." >&2
+ exit 1
+ fi;;
+esac
# Unsupported targets list. Do not put an entry in this list unless
# it would otherwise be caught by a more permissive pattern. The list
@@ -246,6 +271,8 @@ case ${target} in
| pdp11-*-bsd \
| sparc-hal-solaris2* \
| thumb-*-* \
+ | *-*-freebsd[12] | *-*-freebsd[12].* \
+ | *-*-freebsd*aout* \
| *-*-linux*aout* \
| *-*-linux*coff* \
| *-*-linux*libc1* \
@@ -480,15 +507,6 @@ case ${target} in
"" | yes | posix) thread_file='posix' ;;
esac
;;
-*-*-freebsd[12] | *-*-freebsd[12].* | *-*-freebsd*aout*)
- # This is the place-holder for the generic a.out configuration
- # of FreeBSD. No actual configuration resides here since
- # there was only ever a bare-bones ix86 configuration for
- # a.out and it exists solely in the machine-specific section.
- # This place-holder must exist to avoid dropping into
- # the generic ELF configuration of FreeBSD (i.e. it must be
- # ordered before that section).
- ;;
*-*-freebsd*)
# This is the generic ELF configuration of FreeBSD. Later
# machine-specific sections may refine and add to this
@@ -543,6 +561,7 @@ case ${target} in
use_gcc_stdint=wrap
;;
*-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-knetbsd*-gnu | *-*-gnu* | *-*-kopensolaris*-gnu)
+ extra_options="$extra_options gnu-user.opt"
extra_parts="crtbegin.o crtbeginS.o crtbeginT.o crtend.o crtendS.o"
gas=yes
gnu_ld=yes
@@ -657,6 +676,7 @@ case ${target} in
use_gcc_stdint=wrap
;;
*-*-uclinux*)
+ extra_options="$extra_options gnu-user.opt"
use_gcc_stdint=wrap
tm_defines="$tm_defines DEFAULT_LIBC=LIBC_UCLIBC SINGLE_LIBC"
;;
@@ -695,30 +715,34 @@ case ${target} in
;;
alpha*-*-linux*)
tm_file="${tm_file} alpha/elf.h alpha/linux.h alpha/linux-elf.h glibc-stdint.h"
+ extra_options="${extra_options} alpha/elf.opt"
target_cpu_default="MASK_GAS"
tmake_file="${tmake_file} alpha/t-crtfm alpha/t-alpha alpha/t-ieee alpha/t-linux"
;;
alpha*-*-gnu*)
tm_file="$tm_file alpha/elf.h alpha/linux.h alpha/linux-elf.h gnu.h glibc-stdint.h alpha/gnu.h"
+ extra_options="${extra_options} alpha/elf.opt"
target_cpu_default="MASK_GAS"
tmake_file="${tmake_file} alpha/t-crtfm alpha/t-alpha alpha/t-ieee"
;;
alpha*-*-freebsd*)
tm_file="${tm_file} ${fbsd_tm_file} alpha/elf.h alpha/freebsd.h"
+ extra_options="${extra_options} alpha/elf.opt"
target_cpu_default="MASK_GAS"
tmake_file="${tmake_file} alpha/t-crtfm alpha/t-alpha alpha/t-ieee"
extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o crtbeginT.o"
;;
alpha*-*-netbsd*)
tm_file="${tm_file} netbsd.h alpha/elf.h netbsd-elf.h alpha/netbsd.h"
- extra_options="${extra_options} netbsd.opt netbsd-elf.opt"
+ extra_options="${extra_options} netbsd.opt netbsd-elf.opt \
+ alpha/elf.opt"
target_cpu_default="MASK_GAS"
tmake_file="${tmake_file} alpha/t-alpha alpha/t-ieee"
;;
alpha*-*-openbsd*)
tm_defines="${tm_defines} OBSD_HAS_DECLARE_FUNCTION_NAME OBSD_HAS_DECLARE_FUNCTION_SIZE OBSD_HAS_DECLARE_OBJECT"
tm_file="alpha/alpha.h alpha/elf.h openbsd.h openbsd-stdint.h alpha/openbsd.h openbsd-libpthread.h"
- extra_options="${extra_options} openbsd.opt"
+ extra_options="${extra_options} openbsd.opt alpha/elf.opt"
# default x-alpha is only appropriate for dec-osf.
target_cpu_default="MASK_GAS"
tmake_file="${tmake_file} alpha/t-alpha alpha/t-ieee"
@@ -736,7 +760,7 @@ alpha*-dec-osf5.1*)
tmake_file="alpha/t-alpha alpha/t-ieee alpha/t-crtfm alpha/t-osf5"
tm_file="${tm_file} alpha/osf5.h"
tm_defines="${tm_defines} TARGET_SUPPORT_ARCH=1"
- extra_options="${extra_options} rpath.opt"
+ extra_options="${extra_options} rpath.opt alpha/osf5.opt"
extra_headers=va_list.h
use_gcc_stdint=provide
case ${enable_threads} in
@@ -770,6 +794,7 @@ arc-*-elf*)
;;
arm-wrs-vxworks)
tm_file="elfos.h arm/elf.h arm/aout.h ${tm_file} vx-common.h vxworks.h arm/vxworks.h"
+ extra_options="${extra_options} arm/vxworks.opt"
tmake_file="${tmake_file} arm/t-arm arm/t-vxworks"
;;
arm*-*-freebsd*)
@@ -1039,7 +1064,7 @@ hppa[12]*-*-hpux10*)
esac
tm_file="${tm_file} pa/pa32-regs.h dbxelf.h pa/som.h \
pa/pa-hpux.h pa/pa-hpux10.h"
- extra_options="${extra_options} pa/pa-hpux.opt"
+ extra_options="${extra_options} pa/pa-hpux.opt pa/pa-hpux10.opt"
case ${target} in
*-*-hpux10.[1-9]*)
tm_file="${tm_file} pa/pa-hpux1010.h"
@@ -1091,7 +1116,7 @@ hppa*64*-*-hpux11*)
;;
esac
extra_options="${extra_options} pa/pa-hpux.opt \
- pa/pa-hpux1010.opt pa/pa64-hpux.opt"
+ pa/pa-hpux1010.opt pa/pa64-hpux.opt hpux11.opt"
need_64bit_hwint=yes
tmake_file="pa/t-pa64 pa/t-pa-hpux pa/t-hpux-shlib"
# Set the libgcc version number
@@ -1127,7 +1152,8 @@ hppa[12]*-*-hpux11*)
esac
tm_file="${tm_file} pa/pa32-regs.h dbxelf.h pa/som.h \
pa/pa-hpux.h pa/pa-hpux1010.h pa/pa-hpux11.h"
- extra_options="${extra_options} pa/pa-hpux.opt pa/pa-hpux1010.opt"
+ extra_options="${extra_options} pa/pa-hpux.opt pa/pa-hpux1010.opt \
+ hpux11.opt"
case ${target} in
*-*-hpux11.[1-9]*)
tm_file="${tm_file} pa/pa-hpux1111.h"
@@ -1274,7 +1300,7 @@ x86_64-*-linux* | x86_64-*-kfreebsd*-gnu | x86_64-*-knetbsd*-gnu)
;;
i[34567]86-pc-msdosdjgpp*)
xm_file=i386/xm-djgpp.h
- tm_file="dbxcoff.h ${tm_file} i386/unix.h i386/bsd.h i386/gas.h i386/djgpp.h"
+ tm_file="dbxcoff.h ${tm_file} i386/unix.h i386/bsd.h i386/gas.h i386/djgpp.h i386/djgpp-stdint.h"
tmake_file="${tmake_file} i386/t-djgpp"
extra_options="${extra_options} i386/djgpp.opt"
gnu_ld=yes
@@ -1295,6 +1321,7 @@ i[3456x]86-*-netware*)
tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h tm-dwarf2.h i386/netware.h"
tmake_file="${tmake_file} i386/t-netware"
extra_objs=netware.o
+ extra_options="${extra_options} i386/netware.opt"
case /${with_ld} in
*/nwld)
extra_objs="$extra_objs nwld.o"
@@ -1312,6 +1339,7 @@ i[3456x]86-*-netware*)
;;
i[34567]86-*-nto-qnx*)
tm_file="${tm_file} i386/att.h dbxelf.h tm-dwarf2.h elfos.h i386/unix.h i386/nto.h"
+ extra_options="${extra_options} i386/nto.opt"
tmake_file="${tmake_file} i386/t-nto"
gnu_ld=yes
gas=yes
@@ -1424,7 +1452,13 @@ i[34567]86-*-pe | i[34567]86-*-cygwin*)
else
tmake_eh_file="i386/t-sjlj-eh"
fi
- tmake_file="${tmake_file} ${tmake_eh_file} i386/t-cygming i386/t-cygwin"
+ # Shared libgcc DLL install dir depends on cross/native build.
+ if test x${host} = x${target} ; then
+ tmake_dlldir_file="i386/t-dlldir"
+ else
+ tmake_dlldir_file="i386/t-dlldir-x"
+ fi
+ tmake_file="${tmake_file} ${tmake_eh_file} ${tmake_dlldir_file} i386/t-cygming i386/t-cygwin t-dfprules"
target_gtfiles="\$(srcdir)/config/i386/winnt.c"
extra_options="${extra_options} i386/cygming.opt"
extra_objs="winnt.o winnt-stubs.o"
@@ -1480,7 +1514,13 @@ i[34567]86-*-mingw* | x86_64-*-mingw*)
else
tmake_eh_file="i386/t-sjlj-eh"
fi
- tmake_file="${tmake_file} ${tmake_eh_file} i386/t-cygming t-dfprules"
+ # Shared libgcc DLL install dir depends on cross/native build.
+ if test x${host} = x${target} ; then
+ tmake_dlldir_file="i386/t-dlldir"
+ else
+ tmake_dlldir_file="i386/t-dlldir-x"
+ fi
+ tmake_file="${tmake_file} ${tmake_eh_file} ${tmake_dlldir_file} i386/t-cygming t-dfprules"
case ${target} in
x86_64-w64-*)
tmake_file="${tmake_file} i386/t-mingw-w64"
@@ -1580,7 +1620,7 @@ ia64*-*-hpux*)
use_collect2=no
c_target_objs="ia64-c.o"
cxx_target_objs="ia64-c.o"
- extra_options="${extra_options} ia64/ilp32.opt"
+ extra_options="${extra_options} ia64/ilp32.opt hpux11.opt"
use_gcc_stdint=wrap
tm_file="${tm_file} hpux-stdint.h"
;;
@@ -1596,7 +1636,7 @@ ia64-hp-*vms*)
fi
exeext=.exe
install_headers_dir=install-headers-cp
- extra_options="${extra_options} vms/vms.opt"
+ extra_options="${extra_options} vms/vms.opt ia64/vms.opt"
;;
iq2000*-*-elf*)
tm_file="elfos.h newlib-stdint.h iq2000/iq2000.h"
@@ -1731,6 +1771,7 @@ m68k-*-uclinux*) # Motorola m68k/ColdFire running uClinux
default_m68k_cpu=68020
default_cf_cpu=5206
tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h flat.h m68k/linux.h m68k/uclinux.h ./sysroot-suffix.h"
+ extra_options="${extra_options} m68k/uclinux.opt"
tm_defines="${tm_defines} MOTOROLA=1"
tmake_file="m68k/t-floatlib m68k/t-uclinux m68k/t-mlibs"
;;
@@ -1797,7 +1838,7 @@ microblaze*-*-*)
mips-sgi-irix6.5*)
tm_file="elfos.h ${tm_file} mips/iris6.h"
tmake_file="mips/t-iris mips/t-iris6 mips/t-slibgcc-irix"
- extra_options="${extra_options} rpath.opt"
+ extra_options="${extra_options} rpath.opt mips/iris6.opt"
target_cpu_default="MASK_ABICALLS"
tm_defines="${tm_defines} MIPS_ISA_DEFAULT=3 MIPS_ABI_DEFAULT=ABI_N32"
# Only IRIX Development Foundation 1.3 for IRIX 6.5 provides stdint.h.
@@ -2072,7 +2113,7 @@ powerpc-*-eabialtivec*)
;;
powerpc-xilinx-eabi*)
tm_file="${tm_file} dbxelf.h elfos.h usegas.h freebsd-spec.h newlib-stdint.h rs6000/sysv4.h rs6000/eabi.h rs6000/singlefp.h rs6000/xfpu.h rs6000/xilinx.h"
- extra_options="${extra_options} rs6000/sysv4.opt"
+ extra_options="${extra_options} rs6000/sysv4.opt rs6000/xilinx.opt"
tmake_file="rs6000/t-fprules rs6000/t-fprules-fpbit rs6000/t-ppcgas rs6000/t-ppccomm rs6000/t-xilinx"
use_gcc_stdint=wrap
;;
@@ -2667,11 +2708,12 @@ v850-*-*)
;;
vax-*-linux*)
tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h linux.h vax/elf.h vax/linux.h"
+ extra_options="${extra_options} vax/elf.opt"
tmake_file="${tmake_file} vax/t-linux"
;;
vax-*-netbsdelf*)
tm_file="${tm_file} elfos.h netbsd.h netbsd-elf.h vax/elf.h vax/netbsd-elf.h"
- extra_options="${extra_options} netbsd.opt netbsd-elf.opt"
+ extra_options="${extra_options} netbsd.opt netbsd-elf.opt vax/elf.opt"
;;
vax-*-netbsd*)
tm_file="${tm_file} netbsd.h netbsd-aout.h vax/netbsd.h"
@@ -2697,6 +2739,7 @@ xstormy16-*-elf)
;;
xtensa*-*-elf*)
tm_file="${tm_file} dbxelf.h elfos.h newlib-stdint.h xtensa/elf.h"
+ extra_options="${extra_options} xtensa/elf.opt"
tmake_file="xtensa/t-xtensa xtensa/t-elf"
;;
xtensa*-*-linux*)
diff --git a/gcc/config.host b/gcc/config.host
index 5b56f834a74..d0342b996e6 100644
--- a/gcc/config.host
+++ b/gcc/config.host
@@ -1,6 +1,6 @@
# GCC host-specific configuration file.
# Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2006, 2007, 2008, 2009,
-# 2010 Free Software Foundation, Inc.
+# 2010, 2011 Free Software Foundation, Inc.
#This file is part of GCC.
@@ -169,6 +169,10 @@ case ${host} in
prefix=/gnu
local_prefix=/gnu/local
;;
+ alpha*-dec-osf*)
+ out_host_hook_obj=host-osf.o
+ host_xmake_file="${host_xmake_file} alpha/x-osf"
+ ;;
alpha*-dec-*vms*)
host_xm_file="vms/xm-vms.h"
host_xmake_file=vms/x-vms
diff --git a/gcc/config.in b/gcc/config.in
index 9df41a1635c..f3b0eee3126 100644
--- a/gcc/config.in
+++ b/gcc/config.in
@@ -1142,10 +1142,6 @@
#undef HAVE_LDFCN_H
#endif
-/* Define if your linker supports plugin. */
-#ifndef USED_FOR_TARGET
-#undef HAVE_LTO_PLUGIN
-#endif
/* Define if your linker supports --as-needed and --no-as-needed options. */
#ifndef USED_FOR_TARGET
@@ -1213,7 +1209,7 @@
#endif
-/* Define if your linker supports -Bstatic/-Bdynamic option. */
+/* Define if your linker supports -Bstatic/-Bdynamic or equivalent options. */
#ifndef USED_FOR_TARGET
#undef HAVE_LD_STATIC_DYNAMIC
#endif
@@ -1249,6 +1245,12 @@
#endif
+/* Define if your linker supports plugin. */
+#ifndef USED_FOR_TARGET
+#undef HAVE_LTO_PLUGIN
+#endif
+
+
/* Define to 1 if you have the <malloc.h> header file. */
#ifndef USED_FOR_TARGET
#undef HAVE_MALLOC_H
@@ -1544,6 +1546,18 @@
#endif
+/* Define to the linker option to enable use of shared objects. */
+#ifndef USED_FOR_TARGET
+#undef LD_DYNAMIC_OPTION
+#endif
+
+
+/* Define to the linker option to disable use of shared objects. */
+#ifndef USED_FOR_TARGET
+#undef LD_STATIC_OPTION
+#endif
+
+
/* Define to the linker flags to use for -pthread. */
#ifndef USED_FOR_TARGET
#undef LIB_THREAD_LDFLAGS_SPEC
diff --git a/gcc/config/alpha/elf.opt b/gcc/config/alpha/elf.opt
new file mode 100644
index 00000000000..edafd5d37f5
--- /dev/null
+++ b/gcc/config/alpha/elf.opt
@@ -0,0 +1,30 @@
+; Alpha ELF options.
+
+; Copyright (C) 2011
+; Free Software Foundation, Inc.
+;
+; This file is part of GCC.
+;
+; GCC is free software; you can redistribute it and/or modify it under
+; the terms of the GNU General Public License as published by the Free
+; Software Foundation; either version 3, or (at your option) any later
+; version.
+;
+; GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+; WARRANTY; without even the implied warranty of MERCHANTABILITY or
+; FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+; for more details.
+;
+; You should have received a copy of the GNU General Public License
+; along with GCC; see the file COPYING3. If not see
+; <http://www.gnu.org/licenses/>.
+
+; See the GCC internals manual (options.texi) for a description of
+; this file's format.
+
+; Please try to keep this file in ASCII collating order.
+
+relax
+Driver
+
+; This comment is to ensure we retain the blank line above.
diff --git a/gcc/config/alpha/host-osf.c b/gcc/config/alpha/host-osf.c
new file mode 100644
index 00000000000..0a554b3ec2c
--- /dev/null
+++ b/gcc/config/alpha/host-osf.c
@@ -0,0 +1,147 @@
+/* Tru64 UNIX host-specific hook definitions.
+ Copyright (C) 2011 Free Software Foundation, Inc.
+
+ This file is part of GCC.
+
+ GCC is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published
+ by the Free Software Foundation; either version 3, or (at your
+ option) any later version.
+
+ GCC is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
+ License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with GCC; see the file COPYING3. If not see
+ <http://www.gnu.org/licenses/>. */
+
+#include "config.h"
+#include "system.h"
+#include "coretypes.h"
+#include <sys/mman.h>
+/* Inhibit inclusion of <sys/mount.h>, unnecessary and errors out due to
+ use of poisoned bcmp, bcopy. */
+#define _SYS_MOUNT_H_
+#include <sys/procfs.h>
+#include "hosthooks.h"
+#include "hosthooks-def.h"
+
+
+#undef HOST_HOOKS_GT_PCH_GET_ADDRESS
+#define HOST_HOOKS_GT_PCH_GET_ADDRESS osf_gt_pch_get_address
+#undef HOST_HOOKS_GT_PCH_USE_ADDRESS
+#define HOST_HOOKS_GT_PCH_USE_ADDRESS osf_gt_pch_use_address
+
+/* The mmap ADDR parameter may be ignored without MAP_FIXED set. Before we
+ give up, check existing mappings with ioctl(PIOCMAP) to see if the space
+ is really free. */
+
+static void *
+mmap_fixed (void *addr, size_t len, int prot, int flags, int fd, off_t off)
+{
+ void *base;
+
+ base = mmap ((caddr_t) addr, len, prot, flags, fd, off);
+
+ if (base != addr)
+ {
+ /* PID_MAX is SHRT_MAX on Tru64 UNIX V4.0, but INT_MAX on V5.1.
+ Allow for both. "/proc/" + INT_MAX + '\0'. */
+ char pname[6+10+1];
+ int procfd, nmap;
+ prmap_t *pmap;
+ int i, overlap = 0;
+
+ if (base != (void *) MAP_FAILED)
+ munmap ((caddr_t) base, len);
+
+ /* Check if there's any mapping overlapping [addr, addr+len). */
+
+ snprintf (pname, sizeof (pname), "/proc/%d", getpid ());
+ procfd = open (pname, O_RDONLY);
+ if (procfd == -1)
+ return ((void *) MAP_FAILED);
+ if (ioctl (procfd, PIOCNMAP, &nmap) == -1)
+ return ((void *) MAP_FAILED);
+ pmap = (prmap_t *) xmalloc (sizeof (*pmap) * (nmap+1));
+ if (ioctl (procfd, PIOCMAP, pmap) == -1)
+ return ((void *) MAP_FAILED);
+
+ /* It seems like pmap[] is sorted by address, but can we rely on
+ that? */
+ for (i = 0; i < nmap; i++)
+ {
+ uintptr_t map_start = (uintptr_t) pmap[i].pr_vaddr;
+ uintptr_t map_end = map_start + pmap[i].pr_size;
+
+ if ((uintptr_t) addr < map_end
+ && (uintptr_t) addr+len > map_start)
+ {
+ overlap = 1;
+ break;
+ }
+ }
+ free (pmap);
+ close (procfd);
+
+ if (!overlap)
+ base = mmap ((caddr_t) addr, len, prot, flags | MAP_FIXED, fd, off);
+ else
+ base = mmap ((caddr_t) addr, len, prot, flags, fd, off);
+ }
+
+ return base;
+}
+
+/* For various ports, try to guess a fixed spot in the vm space that's
+ probably free. Take the middle between start of text segment and
+ dynamic loader space. See <sys/machine/addrconf.h> and Tru64 UNIX
+ Assembly Language Programmer's Guide, p.6-18, Figure 6-3: Default Layout
+ of Memory (User Program View). */
+#define TRY_EMPTY_VM_SPACE 0x20050000000
+
+/* Determine a location where we might be able to reliably allocate
+ SIZE bytes. FD is the PCH file, though we should return with the
+ file unmapped. */
+
+static void *
+osf_gt_pch_get_address (size_t size, int fd)
+{
+ void *addr;
+
+ addr = mmap_fixed ((caddr_t) TRY_EMPTY_VM_SPACE, size,
+ PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, 0);
+
+ /* If we failed the map, that means there's *no* free space. */
+ if (addr == (void *) MAP_FAILED)
+ return NULL;
+ /* Unmap the area before returning. */
+ munmap ((caddr_t) addr, size);
+
+ return addr;
+}
+
+/* Map SIZE bytes of FD+OFFSET at BASE. Return 1 if we succeeded at
+ mapping the data at BASE, -1 if we couldn't. */
+
+static int
+osf_gt_pch_use_address (void *base, size_t size, int fd, size_t offset)
+{
+ void *addr;
+
+ /* We're called with size == 0 if we're not planning to load a PCH
+ file at all. This allows the hook to free any static space that
+ we might have allocated at link time. */
+ if (size == 0)
+ return -1;
+
+ addr = mmap_fixed ((caddr_t) base, size,
+ PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, offset);
+
+ return addr == base ? 1 : -1;
+}
+
+
+const struct host_hooks host_hooks = HOST_HOOKS_INITIALIZER;
diff --git a/gcc/config/alpha/osf5.opt b/gcc/config/alpha/osf5.opt
new file mode 100644
index 00000000000..ba70e7ce9a5
--- /dev/null
+++ b/gcc/config/alpha/osf5.opt
@@ -0,0 +1,42 @@
+; Tru64 UNIX options.
+
+; Copyright (C) 2011
+; Free Software Foundation, Inc.
+;
+; This file is part of GCC.
+;
+; GCC is free software; you can redistribute it and/or modify it under
+; the terms of the GNU General Public License as published by the Free
+; Software Foundation; either version 3, or (at your option) any later
+; version.
+;
+; GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+; WARRANTY; without even the implied warranty of MERCHANTABILITY or
+; FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+; for more details.
+;
+; You should have received a copy of the GNU General Public License
+; along with GCC; see the file COPYING3. If not see
+; <http://www.gnu.org/licenses/>.
+
+; See the GCC internals manual (options.texi) for a description of
+; this file's format.
+
+; Please try to keep this file in ASCII collating order.
+
+K
+Driver
+
+mno-mips-tfile
+Target RejectNegative
+
+pthread
+Driver
+
+taso
+Driver
+
+threads
+Driver
+
+; This comment is to ensure we retain the blank line above.
diff --git a/gcc/config/alpha/x-osf b/gcc/config/alpha/x-osf
new file mode 100644
index 00000000000..5bb9c90986e
--- /dev/null
+++ b/gcc/config/alpha/x-osf
@@ -0,0 +1,4 @@
+host-osf.o : $(srcdir)/config/alpha/host-osf.c $(CONFIG_H) $(SYSTEM_H) \
+ coretypes.h hosthooks.h hosthooks-def.h $(HOOKS_H)
+ $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
+ $(srcdir)/config/alpha/host-osf.c
diff --git a/gcc/config/arc/arc.opt b/gcc/config/arc/arc.opt
index dc47fc8f890..e5381f95afc 100644
--- a/gcc/config/arc/arc.opt
+++ b/gcc/config/arc/arc.opt
@@ -1,6 +1,6 @@
; Options for the Argonaut ARC port of the compiler
;
-; Copyright (C) 2005, 2007 Free Software Foundation, Inc.
+; Copyright (C) 2005, 2007, 2011 Free Software Foundation, Inc.
;
; This file is part of GCC.
;
@@ -18,6 +18,12 @@
; along with GCC; see the file COPYING3. If not see
; <http://www.gnu.org/licenses/>.
+EB
+Driver
+
+EL
+Driver
+
malign-loops
Target Undocumented Report Mask(ALIGN_LOOPS)
diff --git a/gcc/config/arm/arm-protos.h b/gcc/config/arm/arm-protos.h
index 53923bdfbae..f037a456a06 100644
--- a/gcc/config/arm/arm-protos.h
+++ b/gcc/config/arm/arm-protos.h
@@ -54,6 +54,8 @@ extern rtx legitimize_pic_address (rtx, enum machine_mode, rtx);
extern rtx legitimize_tls_address (rtx, rtx);
extern int arm_legitimate_address_outer_p (enum machine_mode, rtx, RTX_CODE, int);
extern int thumb_legitimate_offset_p (enum machine_mode, HOST_WIDE_INT);
+extern bool arm_legitimize_reload_address (rtx *, enum machine_mode, int, int,
+ int);
extern rtx thumb_legitimize_reload_address (rtx *, enum machine_mode, int, int,
int);
extern int arm_const_double_rtx (rtx);
diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
index 3e75d7c9c4d..85150027b9d 100644
--- a/gcc/config/arm/arm.c
+++ b/gcc/config/arm/arm.c
@@ -1,6 +1,6 @@
/* Output routines for GCC for ARM.
Copyright (C) 1991, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
- 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
+ 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
Free Software Foundation, Inc.
Contributed by Pieter `Tiggr' Schoenmakers (rcpieter@win.tue.nl)
and Martin Simmons (@harleqn.co.uk).
@@ -5786,7 +5786,11 @@ thumb2_legitimate_index_p (enum machine_mode mode, rtx index, int strict_p)
&& (mode == SFmode || mode == DFmode
|| (TARGET_MAVERICK && mode == DImode)))
return (code == CONST_INT && INTVAL (index) < 1024
- && INTVAL (index) > -1024
+ /* Thumb-2 allows only > -256 index range for it's core register
+ load/stores. Since we allow SF/DF in core registers, we have
+ to use the intersection between -256~4096 (core) and -1024~1024
+ (coprocessor). */
+ && INTVAL (index) > -256
&& (INTVAL (index) & 3) == 0);
if (TARGET_REALLY_IWMMXT && VALID_IWMMXT_REG_MODE (mode))
@@ -6388,6 +6392,62 @@ thumb_legitimize_address (rtx x, rtx orig_x, enum machine_mode mode)
return x;
}
+bool
+arm_legitimize_reload_address (rtx *p,
+ enum machine_mode mode,
+ int opnum, int type,
+ int ind_levels ATTRIBUTE_UNUSED)
+{
+ if (GET_CODE (*p) == PLUS
+ && GET_CODE (XEXP (*p, 0)) == REG
+ && ARM_REGNO_OK_FOR_BASE_P (REGNO (XEXP (*p, 0)))
+ && GET_CODE (XEXP (*p, 1)) == CONST_INT)
+ {
+ HOST_WIDE_INT val = INTVAL (XEXP (*p, 1));
+ HOST_WIDE_INT low, high;
+
+ if (mode == DImode || (mode == DFmode && TARGET_SOFT_FLOAT))
+ low = ((val & 0xf) ^ 0x8) - 0x8;
+ else if (TARGET_MAVERICK && TARGET_HARD_FLOAT)
+ /* Need to be careful, -256 is not a valid offset. */
+ low = val >= 0 ? (val & 0xff) : -((-val) & 0xff);
+ else if (mode == SImode
+ || (mode == SFmode && TARGET_SOFT_FLOAT)
+ || ((mode == HImode || mode == QImode) && ! arm_arch4))
+ /* Need to be careful, -4096 is not a valid offset. */
+ low = val >= 0 ? (val & 0xfff) : -((-val) & 0xfff);
+ else if ((mode == HImode || mode == QImode) && arm_arch4)
+ /* Need to be careful, -256 is not a valid offset. */
+ low = val >= 0 ? (val & 0xff) : -((-val) & 0xff);
+ else if (GET_MODE_CLASS (mode) == MODE_FLOAT
+ && TARGET_HARD_FLOAT && TARGET_FPA)
+ /* Need to be careful, -1024 is not a valid offset. */
+ low = val >= 0 ? (val & 0x3ff) : -((-val) & 0x3ff);
+ else
+ return false;
+
+ high = ((((val - low) & (unsigned HOST_WIDE_INT) 0xffffffff)
+ ^ (unsigned HOST_WIDE_INT) 0x80000000)
+ - (unsigned HOST_WIDE_INT) 0x80000000);
+ /* Check for overflow or zero */
+ if (low == 0 || high == 0 || (high + low != val))
+ return false;
+
+ /* Reload the high part into a base reg; leave the low part
+ in the mem. */
+ *p = gen_rtx_PLUS (GET_MODE (*p),
+ gen_rtx_PLUS (GET_MODE (*p), XEXP (*p, 0),
+ GEN_INT (high)),
+ GEN_INT (low));
+ push_reload (XEXP (*p, 0), NULL_RTX, &XEXP (*p, 0), NULL,
+ MODE_BASE_REG_CLASS (mode), GET_MODE (*p),
+ VOIDmode, 0, 0, opnum, (enum reload_type) type);
+ return true;
+ }
+
+ return false;
+}
+
rtx
thumb_legitimize_reload_address (rtx *x_p,
enum machine_mode mode,
@@ -15188,6 +15248,31 @@ thumb_force_lr_save (void)
}
+/* Return true if r3 is used by any of the tail call insns in the
+ current function. */
+
+static bool
+any_sibcall_uses_r3 (void)
+{
+ edge_iterator ei;
+ edge e;
+
+ if (!crtl->tail_call_emit)
+ return false;
+ FOR_EACH_EDGE (e, ei, EXIT_BLOCK_PTR->preds)
+ if (e->flags & EDGE_SIBCALL)
+ {
+ rtx call = BB_END (e->src);
+ if (!CALL_P (call))
+ call = prev_nonnote_nondebug_insn (call);
+ gcc_assert (CALL_P (call) && SIBLING_CALL_P (call));
+ if (find_regno_fusage (call, USE, 3))
+ return true;
+ }
+ return false;
+}
+
+
/* Compute the distance from register FROM to register TO.
These can be the arg pointer (26), the soft frame pointer (25),
the stack pointer (13) or the hard frame pointer (11).
@@ -15352,7 +15437,7 @@ arm_get_frame_offsets (void)
/* If it is safe to use r3, then do so. This sometimes
generates better code on Thumb-2 by avoiding the need to
use 32-bit push/pop instructions. */
- if (!crtl->tail_call_emit
+ if (! any_sibcall_uses_r3 ()
&& arm_size_return_regs () <= 12
&& (offsets->saved_regs_mask & (1 << 3)) == 0)
{
diff --git a/gcc/config/arm/arm.h b/gcc/config/arm/arm.h
index 9951553e419..6abc8326ed5 100644
--- a/gcc/config/arm/arm.h
+++ b/gcc/config/arm/arm.h
@@ -1273,53 +1273,8 @@ enum reg_class
#define ARM_LEGITIMIZE_RELOAD_ADDRESS(X, MODE, OPNUM, TYPE, IND, WIN) \
do \
{ \
- if (GET_CODE (X) == PLUS \
- && GET_CODE (XEXP (X, 0)) == REG \
- && REGNO (XEXP (X, 0)) < FIRST_PSEUDO_REGISTER \
- && REG_MODE_OK_FOR_BASE_P (XEXP (X, 0), MODE) \
- && GET_CODE (XEXP (X, 1)) == CONST_INT) \
- { \
- HOST_WIDE_INT val = INTVAL (XEXP (X, 1)); \
- HOST_WIDE_INT low, high; \
- \
- if (MODE == DImode || (MODE == DFmode && TARGET_SOFT_FLOAT)) \
- low = ((val & 0xf) ^ 0x8) - 0x8; \
- else if (TARGET_MAVERICK && TARGET_HARD_FLOAT) \
- /* Need to be careful, -256 is not a valid offset. */ \
- low = val >= 0 ? (val & 0xff) : -((-val) & 0xff); \
- else if (MODE == SImode \
- || (MODE == SFmode && TARGET_SOFT_FLOAT) \
- || ((MODE == HImode || MODE == QImode) && ! arm_arch4)) \
- /* Need to be careful, -4096 is not a valid offset. */ \
- low = val >= 0 ? (val & 0xfff) : -((-val) & 0xfff); \
- else if ((MODE == HImode || MODE == QImode) && arm_arch4) \
- /* Need to be careful, -256 is not a valid offset. */ \
- low = val >= 0 ? (val & 0xff) : -((-val) & 0xff); \
- else if (GET_MODE_CLASS (MODE) == MODE_FLOAT \
- && TARGET_HARD_FLOAT && TARGET_FPA) \
- /* Need to be careful, -1024 is not a valid offset. */ \
- low = val >= 0 ? (val & 0x3ff) : -((-val) & 0x3ff); \
- else \
- break; \
- \
- high = ((((val - low) & (unsigned HOST_WIDE_INT) 0xffffffff) \
- ^ (unsigned HOST_WIDE_INT) 0x80000000) \
- - (unsigned HOST_WIDE_INT) 0x80000000); \
- /* Check for overflow or zero */ \
- if (low == 0 || high == 0 || (high + low != val)) \
- break; \
- \
- /* Reload the high part into a base reg; leave the low part \
- in the mem. */ \
- X = gen_rtx_PLUS (GET_MODE (X), \
- gen_rtx_PLUS (GET_MODE (X), XEXP (X, 0), \
- GEN_INT (high)), \
- GEN_INT (low)); \
- push_reload (XEXP (X, 0), NULL_RTX, &XEXP (X, 0), NULL, \
- MODE_BASE_REG_CLASS (MODE), GET_MODE (X), \
- VOIDmode, 0, 0, OPNUM, TYPE); \
- goto WIN; \
- } \
+ if (arm_legitimize_reload_address (&X, MODE, OPNUM, TYPE, IND)) \
+ goto WIN; \
} \
while (0)
diff --git a/gcc/config/arm/arm.md b/gcc/config/arm/arm.md
index 5a9a914da4d..73a879e9384 100644
--- a/gcc/config/arm/arm.md
+++ b/gcc/config/arm/arm.md
@@ -299,10 +299,10 @@
; ffarith Fast floating point arithmetic (2 cycle)
; float_em a floating point arithmetic operation that is normally emulated
; even on a machine with an fpa.
-; f_load a floating point load from memory
-; f_store a floating point store to memory
-; f_load[sd] single/double load from memory
-; f_store[sd] single/double store to memory
+; f_fpa_load a floating point load from memory. Only for the FPA.
+; f_fpa_store a floating point store to memory. Only for the FPA.
+; f_load[sd] A single/double load from memory. Used for VFP unit.
+; f_store[sd] A single/double store to memory. Used for VFP unit.
; f_flag a transfer of co-processor flags to the CPSR
; f_mem_r a transfer of a floating point register to a real reg via mem
; r_mem_f the reverse of f_mem_r
@@ -326,7 +326,7 @@
;
(define_attr "type"
- "alu,alu_shift,alu_shift_reg,mult,block,float,fdivx,fdivd,fdivs,fmul,fmuls,fmuld,fmacs,fmacd,ffmul,farith,ffarith,f_flag,float_em,f_load,f_store,f_loads,f_loadd,f_stores,f_stored,f_mem_r,r_mem_f,f_2_r,r_2_f,f_cvt,branch,call,load_byte,load1,load2,load3,load4,store1,store2,store3,store4,mav_farith,mav_dmult,fconsts,fconstd,fadds,faddd,ffariths,ffarithd,fcmps,fcmpd,fcpys"
+ "alu,alu_shift,alu_shift_reg,mult,block,float,fdivx,fdivd,fdivs,fmul,fmuls,fmuld,fmacs,fmacd,ffmul,farith,ffarith,f_flag,float_em,f_fpa_load,f_fpa_store,f_loads,f_loadd,f_stores,f_stored,f_mem_r,r_mem_f,f_2_r,r_2_f,f_cvt,branch,call,load_byte,load1,load2,load3,load4,store1,store2,store3,store4,mav_farith,mav_dmult,fconsts,fconstd,fadds,faddd,ffariths,ffarithd,fcmps,fcmpd,fcpys"
(if_then_else
(eq_attr "insn" "smulxy,smlaxy,smlalxy,smulwy,smlawx,mul,muls,mla,mlas,umull,umulls,umlal,umlals,smull,smulls,smlal,smlals")
(const_string "mult")
@@ -450,7 +450,7 @@
; to stall the processor. Used with model_wbuf above.
(define_attr "write_conflict" "no,yes"
(if_then_else (eq_attr "type"
- "block,float_em,f_load,f_store,f_mem_r,r_mem_f,call,load1")
+ "block,float_em,f_fpa_load,f_fpa_store,f_mem_r,r_mem_f,call,load1")
(const_string "yes")
(const_string "no")))
@@ -10285,7 +10285,7 @@
output_asm_insn (pattern, operands);
return \"\";
}"
- [(set_attr "type" "f_store")]
+ [(set_attr "type" "f_fpa_store")]
)
;; Special patterns for dealing with the constant pool
diff --git a/gcc/config/arm/arm1026ejs.md b/gcc/config/arm/arm1026ejs.md
index 0d33f99d08f..e6221363898 100644
--- a/gcc/config/arm/arm1026ejs.md
+++ b/gcc/config/arm/arm1026ejs.md
@@ -127,7 +127,7 @@
;; output (such as umull) make their results available in two cycles;
;; the least significant word is available before the most significant
;; word. That fact is not modeled; instead, the instructions are
-;; described.as if the entire result was available at the end of the
+;; described as if the entire result was available at the end of the
;; cycle in which both words are available.
;; The "umull", "umlal", "smull", and "smlal" instructions all take
diff --git a/gcc/config/arm/cortex-a5.md b/gcc/config/arm/cortex-a5.md
index 471f588022e..eb154e29803 100644
--- a/gcc/config/arm/cortex-a5.md
+++ b/gcc/config/arm/cortex-a5.md
@@ -270,7 +270,7 @@
(define_insn_reservation "cortex_a5_f_loadd" 5
(and (eq_attr "tune" "cortexa5")
- (eq_attr "type" "f_load,f_loadd"))
+ (eq_attr "type" "f_loadd"))
"cortex_a5_ex1+cortex_a5_branch, cortex_a5_ex1")
(define_insn_reservation "cortex_a5_f_stores" 0
@@ -280,7 +280,7 @@
(define_insn_reservation "cortex_a5_f_stored" 0
(and (eq_attr "tune" "cortexa5")
- (eq_attr "type" "f_store,f_stored"))
+ (eq_attr "type" "f_stored"))
"cortex_a5_ex1+cortex_a5_branch, cortex_a5_ex1")
;; Load-to-use for floating-point values has a penalty of one cycle,
diff --git a/gcc/config/arm/cortex-m4-fpu.md b/gcc/config/arm/cortex-m4-fpu.md
index 7de115c5209..6fd5faf74ee 100644
--- a/gcc/config/arm/cortex-m4-fpu.md
+++ b/gcc/config/arm/cortex-m4-fpu.md
@@ -76,12 +76,12 @@
(define_insn_reservation "cortex_m4_f_load" 2
(and (eq_attr "tune" "cortexm4")
- (eq_attr "type" "f_load"))
+ (eq_attr "type" "f_loads"))
"cortex_m4_ex_v*2")
(define_insn_reservation "cortex_m4_f_store" 2
(and (eq_attr "tune" "cortexm4")
- (eq_attr "type" "f_store"))
+ (eq_attr "type" "f_stores"))
"cortex_m4_ex_v*2")
(define_insn_reservation "cortex_m4_f_loadd" 3
diff --git a/gcc/config/arm/fpa.md b/gcc/config/arm/fpa.md
index 515de43d28b..6e6dd8d43c1 100644
--- a/gcc/config/arm/fpa.md
+++ b/gcc/config/arm/fpa.md
@@ -83,11 +83,11 @@
"core+fpa*2")
(define_insn_reservation "f_load" 3
- (and (eq_attr "fpu" "fpa") (eq_attr "type" "f_load"))
+ (and (eq_attr "fpu" "fpa") (eq_attr "type" "f_fpa_load"))
"fpa_mem+core*3")
(define_insn_reservation "f_store" 4
- (and (eq_attr "fpu" "fpa") (eq_attr "type" "f_store"))
+ (and (eq_attr "fpu" "fpa") (eq_attr "type" "f_fpa_store"))
"core*4")
(define_insn_reservation "r_mem_f" 6
@@ -545,7 +545,7 @@
[(set_attr "length" "4,4,4,4,8,8,4,4,4")
(set_attr "predicable" "yes")
(set_attr "type"
- "ffarith,ffarith,f_load,f_store,r_mem_f,f_mem_r,*,load1,store1")
+ "ffarith,ffarith,f_fpa_load,f_fpa_store,r_mem_f,f_mem_r,*,load1,store1")
(set_attr "pool_range" "*,*,1024,*,*,*,*,4096,*")
(set_attr "neg_pool_range" "*,*,1012,*,*,*,*,4084,*")]
)
@@ -580,7 +580,7 @@
[(set_attr "length" "4,4,8,8,8,4,4,4,4,8,8")
(set_attr "predicable" "yes")
(set_attr "type"
- "load1,store2,*,store2,load1,ffarith,ffarith,f_load,f_store,r_mem_f,f_mem_r")
+ "load1,store2,*,store2,load1,ffarith,ffarith,f_fpa_load,f_fpa_store,r_mem_f,f_mem_r")
(set_attr "pool_range" "*,*,*,*,1020,*,*,1024,*,*,*")
(set_attr "neg_pool_range" "*,*,*,*,1008,*,*,1008,*,*,*")]
)
@@ -609,7 +609,7 @@
"
[(set_attr "length" "4,4,4")
(set_attr "predicable" "yes")
- (set_attr "type" "ffarith,f_load,f_store")]
+ (set_attr "type" "ffarith,f_fpa_load,f_fpa_store")]
)
;; stfs/ldfs always use a conditional infix. This works around the
@@ -635,7 +635,7 @@
(set_attr "ce_count" "1,1,1,1,2,2,1,1,1")
(set_attr "predicable" "yes")
(set_attr "type"
- "ffarith,ffarith,f_load,f_store,r_mem_f,f_mem_r,*,load1,store1")
+ "ffarith,ffarith,f_fpa_load,f_fpa_store,r_mem_f,f_mem_r,*,load1,store1")
(set_attr "pool_range" "*,*,1024,*,*,*,*,4096,*")
(set_attr "neg_pool_range" "*,*,1012,*,*,*,*,0,*")]
)
@@ -669,7 +669,7 @@
"
[(set_attr "length" "4,4,8,8,8,4,4,4,4,8,8")
(set_attr "type"
- "load1,store2,*,store2,load1,ffarith,ffarith,f_load,f_store,r_mem_f,f_mem_r")
+ "load1,store2,*,store2,load1,ffarith,ffarith,f_fpa_load,f_fpa_store,r_mem_f,f_mem_r")
(set_attr "pool_range" "*,*,*,*,4092,*,*,1024,*,*,*")
(set_attr "neg_pool_range" "*,*,*,*,0,*,*,1020,*,*,*")]
)
@@ -698,7 +698,7 @@
}
"
[(set_attr "length" "4,4,4,4,8,8,12")
- (set_attr "type" "ffarith,ffarith,f_load,f_store,r_mem_f,f_mem_r,*")
+ (set_attr "type" "ffarith,ffarith,f_fpa_load,f_fpa_store,r_mem_f,f_mem_r,*")
(set_attr "pool_range" "*,*,1024,*,*,*,*")
(set_attr "neg_pool_range" "*,*,1004,*,*,*,*")]
)
diff --git a/gcc/config/arm/vfp.md b/gcc/config/arm/vfp.md
index 3061e5db854..1ac2d0c2d80 100644
--- a/gcc/config/arm/vfp.md
+++ b/gcc/config/arm/vfp.md
@@ -124,7 +124,7 @@
}
"
[(set_attr "predicable" "yes")
- (set_attr "type" "*,*,*,*,load1,load1,store1,store1,r_2_f,f_2_r,fcpys,f_load,f_store")
+ (set_attr "type" "*,*,*,*,load1,load1,store1,store1,r_2_f,f_2_r,fcpys,f_loads,f_stores")
(set_attr "insn" "mov,mov,mvn,mov,*,*,*,*,*,*,*,*,*")
(set_attr "pool_range" "*,*,*,*,1020,4096,*,*,*,*,*,1020,*")
(set_attr "neg_pool_range" "*,*,*,*, 0, 0,*,*,*,*,*,1008,*")]
@@ -200,7 +200,7 @@
abort ();
}
"
- [(set_attr "type" "*,load2,store2,r_2_f,f_2_r,ffarithd,f_load,f_store")
+ [(set_attr "type" "*,load2,store2,r_2_f,f_2_r,ffarithd,f_loadd,f_stored")
(set (attr "length") (cond [(eq_attr "alternative" "0,1,2") (const_int 8)
(eq_attr "alternative" "5")
(if_then_else
@@ -391,7 +391,7 @@
"
[(set_attr "predicable" "yes")
(set_attr "type"
- "r_2_f,f_2_r,fconsts,f_load,f_store,load1,store1,fcpys,*")
+ "r_2_f,f_2_r,fconsts,f_loads,f_stores,load1,store1,fcpys,*")
(set_attr "insn" "*,*,*,*,*,*,*,*,mov")
(set_attr "pool_range" "*,*,*,1020,*,4092,*,*,*")
(set_attr "neg_pool_range" "*,*,*,1008,*,0,*,*,*")]
@@ -478,7 +478,7 @@
}
"
[(set_attr "type"
- "r_2_f,f_2_r,fconstd,load2,store2,f_load,f_store,ffarithd,*")
+ "r_2_f,f_2_r,fconstd,load2,store2,f_loadd,f_stored,ffarithd,*")
(set (attr "length") (cond [(eq_attr "alternative" "3,4,8") (const_int 8)
(eq_attr "alternative" "7")
(if_then_else
diff --git a/gcc/config/arm/vxworks.opt b/gcc/config/arm/vxworks.opt
new file mode 100644
index 00000000000..bc847839121
--- /dev/null
+++ b/gcc/config/arm/vxworks.opt
@@ -0,0 +1,60 @@
+; ARM VxWorks options.
+
+; Copyright (C) 2011
+; Free Software Foundation, Inc.
+;
+; This file is part of GCC.
+;
+; GCC is free software; you can redistribute it and/or modify it under
+; the terms of the GNU General Public License as published by the Free
+; Software Foundation; either version 3, or (at your option) any later
+; version.
+;
+; GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+; WARRANTY; without even the implied warranty of MERCHANTABILITY or
+; FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+; for more details.
+;
+; You should have received a copy of the GNU General Public License
+; along with GCC; see the file COPYING3. If not see
+; <http://www.gnu.org/licenses/>.
+
+; See the GCC internals manual (options.texi) for a description of
+; this file's format.
+
+; Please try to keep this file in ASCII collating order.
+
+t4
+Driver
+
+t4be
+Driver
+
+t4t
+Driver
+
+t4tbe
+Driver
+
+t5
+Driver
+
+t5be
+Driver
+
+t5t
+Driver
+
+t5tbe
+Driver
+
+tstrongarm
+Driver
+
+txscale
+Driver
+
+txscalebe
+Driver
+
+; This comment is to ensure we retain the blank line above.
diff --git a/gcc/config/avr/avr-devices.c b/gcc/config/avr/avr-devices.c
index d62d22e4278..d2884f6b18a 100755
--- a/gcc/config/avr/avr-devices.c
+++ b/gcc/config/avr/avr-devices.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009, 2010
+/* Copyright (C) 2009, 2010, 2011
Free Software Foundation, Inc.
Contributed by Anatoly Sokolov (aesok@post.ru)
@@ -214,7 +214,7 @@ const struct mcu_type_s avr_mcu_types[] = {
{ "at90usb1287", ARCH_AVR51, "__AVR_AT90USB1287__", 0, 0x0100, "usb1286" },
/* 3-Byte PC. */
{ "avr6", ARCH_AVR6, NULL, 0, 0x0200, "m2561" },
- { "atmega2560", ARCH_AVR6, "__AVR_ATmega2560__", 0, 0x0200, "m2561" },
+ { "atmega2560", ARCH_AVR6, "__AVR_ATmega2560__", 0, 0x0200, "m2560" },
{ "atmega2561", ARCH_AVR6, "__AVR_ATmega2561__", 0, 0x0200, "m2561" },
/* Assembler only. */
{ "avr1", ARCH_AVR1, NULL, 0, 0x0060, "s1200" },
diff --git a/gcc/config/avr/libgcc.S b/gcc/config/avr/libgcc.S
index 07a50b20e31..4a15f94a721 100644
--- a/gcc/config/avr/libgcc.S
+++ b/gcc/config/avr/libgcc.S
@@ -645,6 +645,7 @@ __epilogue_restores__:
_exit:
.weak exit
exit:
+ .endfunc
/* Code from .fini8 ... .fini1 sections inserted by ld script. */
@@ -652,7 +653,6 @@ exit:
cli
__stop_program:
rjmp __stop_program
- .endfunc
#endif /* defined (L_exit) */
#ifdef L_cleanup
diff --git a/gcc/config/bfin/bfin.h b/gcc/config/bfin/bfin.h
index 5ebc1ebd98b..c26b41cc5d6 100644
--- a/gcc/config/bfin/bfin.h
+++ b/gcc/config/bfin/bfin.h
@@ -1,5 +1,6 @@
/* Definitions for the Blackfin port.
- Copyright (C) 2005, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2007, 2008, 2009, 2010, 2011
+ Free Software Foundation, Inc.
Contributed by Analog Devices.
This file is part of GCC.
@@ -240,7 +241,6 @@ extern unsigned int bfin_workarounds;
#undef ASM_SPEC
#define ASM_SPEC "\
-%{Ym,*} %{Yd,*} \
%{mno-fdpic:-mnopic} %{mfdpic}"
#define LINK_SPEC "\
@@ -249,8 +249,6 @@ extern unsigned int bfin_workarounds;
%{static:-dn -Bstatic} \
%{shared:-G -Bdynamic} \
%{symbolic:-Bsymbolic} \
-%{YP,*} \
-%{Qy:} %{!Qn:-Qy} \
-init __init -fini __fini "
/* Generate DSP instructions, like DSP halfword loads */
diff --git a/gcc/config/cris/elf.opt b/gcc/config/cris/elf.opt
index 8505be23c1b..00ced56b091 100644
--- a/gcc/config/cris/elf.opt
+++ b/gcc/config/cris/elf.opt
@@ -1,6 +1,6 @@
; ELF-specific options for the CRIS port of the compiler.
-; Copyright (C) 2005, 2007 Free Software Foundation, Inc.
+; Copyright (C) 2005, 2007, 2011 Free Software Foundation, Inc.
;
; This file is part of GCC.
;
@@ -20,3 +20,6 @@
melf
Target Report RejectNegative Undocumented
+
+sim
+Driver JoinedOrMissing
diff --git a/gcc/config/darwin-c.c b/gcc/config/darwin-c.c
index c246f70daa4..0c713ba7e85 100644
--- a/gcc/config/darwin-c.c
+++ b/gcc/config/darwin-c.c
@@ -629,6 +629,9 @@ darwin_cpp_builtins (cpp_reader *pfile)
builtin_define ("__strong=");
builtin_define ("__weak=");
}
+
+ if (flag_objc_abi == 2)
+ builtin_define ("__OBJC2__");
}
/* Handle C family front-end options. */
diff --git a/gcc/config/darwin-protos.h b/gcc/config/darwin-protos.h
index bf81ed97c4c..4a9961119c5 100644
--- a/gcc/config/darwin-protos.h
+++ b/gcc/config/darwin-protos.h
@@ -110,7 +110,7 @@ extern void darwin_asm_output_aligned_decl_common (FILE *, tree, const char *,
extern bool darwin_binds_local_p (const_tree);
extern void darwin_cpp_builtins (struct cpp_reader *);
-extern void darwin_init_cfstring_builtins (unsigned);
+extern tree darwin_init_cfstring_builtins (unsigned);
extern tree darwin_fold_builtin (tree, int, tree *, bool);
extern tree darwin_objc_construct_string (tree);
extern bool darwin_cfstring_p (tree);
@@ -124,3 +124,4 @@ extern bool darwin_use_anchors_for_symbol_p (const_rtx symbol);
extern bool darwin_kextabi_p (void);
extern void darwin_override_options (void);
extern void darwin_patch_builtins (void);
+extern void darwin_rename_builtins (void);
diff --git a/gcc/config/darwin-sections.def b/gcc/config/darwin-sections.def
index 62d1d8d44d3..61b6f69b123 100644
--- a/gcc/config/darwin-sections.def
+++ b/gcc/config/darwin-sections.def
@@ -94,7 +94,7 @@ DEF_SECTION (mod_term_section, 0, ".mod_term_func", 0)
DEF_SECTION (constructor_section, 0, ".constructor", 0)
DEF_SECTION (destructor_section, 0, ".destructor", 0)
-/* Objective-C (V1) sections. */
+/* Objective-C ABI=0 (Original version) sections. */
DEF_SECTION (objc_class_section, 0, ".objc_class", 1)
DEF_SECTION (objc_meta_class_section, 0, ".objc_meta_class", 1)
DEF_SECTION (objc_category_section, 0, ".objc_category", 1)
@@ -112,7 +112,7 @@ DEF_SECTION (objc_module_info_section, 0, ".objc_module_info", 1)
DEF_SECTION (objc_protocol_section, 0, ".objc_protocol", 1)
DEF_SECTION (objc_string_object_section, 0, ".objc_string_object", 1)
DEF_SECTION (objc_constant_string_object_section, 0,
- ".section __OBJC, __cstring_object, regular, no_dead_strip", 1)
+ ".section __OBJC, __cstring_object, regular, no_dead_strip", 0)
/* Fix-and-Continue image marker. */
DEF_SECTION (objc_image_info_section, 0,
@@ -156,3 +156,40 @@ DEF_SECTION (darwin_exception_section, SECTION_NO_ANCHOR,
DEF_SECTION (darwin_eh_frame_section, SECTION_NO_ANCHOR,
".section " EH_FRAME_SECTION_NAME ",__eh_frame"
EH_FRAME_SECTION_ATTR, 0)
+
+/* Sections for ObjC ABI=1 (ObjC 'V1' extensions) */
+DEF_SECTION (objc1_class_ext_section, 0,
+ ".section __OBJC, __class_ext, regular, no_dead_strip", 1)
+DEF_SECTION (objc1_prop_list_section, 0,
+ ".section __OBJC, __property, regular, no_dead_strip", 1)
+DEF_SECTION (objc1_protocol_ext_section, 0,
+ ".section __OBJC, __protocol_ext, regular, no_dead_strip", 1)
+
+/* Sections for ObjC ABI=2 (m64). */
+DEF_SECTION (objc2_message_refs_section, 0,
+ ".section __DATA, __objc_msgrefs, regular, no_dead_strip", 1)
+DEF_SECTION (objc2_classdefs_section, 0, ".section __DATA, __objc_data", 1)
+DEF_SECTION (objc2_metadata_section, 0, ".section __DATA, __objc_const", 1)
+
+DEF_SECTION (objc2_classrefs_section, 0,
+ ".section __DATA, __objc_classrefs, regular, no_dead_strip", 1)
+DEF_SECTION (objc2_classlist_section, 0,
+ ".section __DATA, __objc_classlist, regular, no_dead_strip", 1)
+DEF_SECTION (objc2_categorylist_section, 0,
+ ".section __DATA, __objc_catlist, regular, no_dead_strip", 1)
+DEF_SECTION (objc2_selector_refs_section, 0,
+ ".section __DATA, __objc_selrefs, literal_pointers, no_dead_strip", 1)
+DEF_SECTION (objc2_nonlazy_class_section, 0,
+ ".section __DATA, __objc_nlclslist, regular, no_dead_strip", 1)
+DEF_SECTION (objc2_nonlazy_category_section, 0,
+ ".section __DATA, __objc_nlcatlist, regular, no_dead_strip", 1)
+DEF_SECTION (objc2_protocollist_section, 0,
+ ".section __DATA, __objc_protolist, regular, no_dead_strip", 1)
+DEF_SECTION (objc2_protocolrefs_section, 0,
+ ".section __DATA, __objc_protorefs, regular, no_dead_strip", 1)
+DEF_SECTION (objc2_super_classrefs_section, 0,
+ ".section __DATA, __objc_superrefs, regular, no_dead_strip", 1)
+DEF_SECTION (objc2_image_info_section, 0,
+ ".section __DATA, __objc_imageinfo, regular, no_dead_strip", 1)
+DEF_SECTION (objc2_constant_string_object_section, 0,
+ ".section __DATA, __objc_stringobj, regular, no_dead_strip", 1)
diff --git a/gcc/config/darwin.c b/gcc/config/darwin.c
index 5c96cfd53cd..5e358b13f09 100644
--- a/gcc/config/darwin.c
+++ b/gcc/config/darwin.c
@@ -1,6 +1,6 @@
/* Functions for generic Darwin as target machine for GNU C compiler.
Copyright (C) 1989, 1990, 1991, 1992, 1993, 2000, 2001, 2002, 2003, 2004,
- 2005, 2006, 2007, 2008, 2009, 2010
+ 2005, 2006, 2007, 2008, 2009, 2010, 2011
Free Software Foundation, Inc.
Contributed by Apple Computer Inc.
@@ -148,18 +148,58 @@ output_objc_section_asm_op (const void *directive)
objc_class_vars_section,
objc_instance_vars_section,
objc_module_info_section,
- objc_symbols_section
+ objc_symbols_section,
};
+ /* ABI=1 */
+ static const enum darwin_section_enum tomarkv1[] =
+ {
+ objc1_protocol_ext_section,
+ objc1_class_ext_section,
+ objc1_prop_list_section
+ } ;
+ /* ABI=2 */
+ static const enum darwin_section_enum tomarkv2[] =
+ {
+ objc2_message_refs_section,
+ objc2_classdefs_section,
+ objc2_metadata_section,
+ objc2_classrefs_section,
+ objc2_classlist_section,
+ objc2_categorylist_section,
+ objc2_selector_refs_section,
+ objc2_nonlazy_class_section,
+ objc2_nonlazy_category_section,
+ objc2_protocollist_section,
+ objc2_protocolrefs_section,
+ objc2_super_classrefs_section,
+ objc2_image_info_section,
+ objc2_constant_string_object_section
+ } ;
size_t i;
been_here = true;
- for (i = 0; i < ARRAY_SIZE (tomark); i++)
- switch_to_section (darwin_sections[tomark[i]]);
+ if (flag_objc_abi < 2)
+ {
+ for (i = 0; i < ARRAY_SIZE (tomark); i++)
+ switch_to_section (darwin_sections[tomark[i]]);
+ if (flag_objc_abi == 1)
+ for (i = 0; i < ARRAY_SIZE (tomarkv1); i++)
+ switch_to_section (darwin_sections[tomarkv1[i]]);
+ }
+ else
+ for (i = 0; i < ARRAY_SIZE (tomarkv2); i++)
+ switch_to_section (darwin_sections[tomarkv2[i]]);
+ /* Make sure we don't get varasm.c out of sync with us. */
switch_to_section (saved_in_section);
}
output_section_asm_op (directive);
}
+
+/* Private flag applied to disable section-anchors in a particular section. */
+#define SECTION_NO_ANCHOR SECTION_MACH_DEP
+
+
/* Implement TARGET_ASM_INIT_SECTIONS. */
void
@@ -177,10 +217,6 @@ darwin_init_sections (void)
readonly_data_section = darwin_sections[const_section];
exception_section = darwin_sections[darwin_exception_section];
eh_frame_section = darwin_sections[darwin_eh_frame_section];
-
- /* Make sure that there is no conflict between the 'no anchor' section
- flag declared in darwin.h and the section flags declared in output.h. */
- gcc_assert (SECTION_NO_ANCHOR > SECTION_MACH_DEP);
}
int
@@ -276,7 +312,6 @@ indirect_data (rtx sym_ref)
return ! lprefix;
}
-
static int
machopic_data_defined_p (rtx sym_ref)
{
@@ -1232,6 +1267,177 @@ machopic_reloc_rw_mask (void)
return MACHOPIC_INDIRECT ? 3 : 0;
}
+/* We have to deal with ObjC/C++ metadata section placement in the common
+ code, since it will also be called from LTO.
+
+ Return metadata attributes, if present (searching for ABI=2 first)
+ Return NULL_TREE if no such attributes are found. */
+
+static tree
+is_objc_metadata (tree decl)
+{
+ if (DECL_P (decl)
+ && (TREE_CODE (decl) == VAR_DECL || TREE_CODE (decl) == CONST_DECL)
+ && DECL_ATTRIBUTES (decl))
+ {
+ tree meta = lookup_attribute ("OBJC2META", DECL_ATTRIBUTES (decl));
+ if (meta)
+ return meta;
+ meta = lookup_attribute ("OBJC1META", DECL_ATTRIBUTES (decl));
+ if (meta)
+ return meta;
+ }
+ return NULL_TREE;
+}
+
+/* Return the section required for Objective C ABI 2 metadata. */
+static section *
+darwin_objc2_section (tree decl ATTRIBUTE_UNUSED, tree meta, section * base)
+{
+ const char *p;
+ tree ident = TREE_VALUE (meta);
+ gcc_assert (TREE_CODE (ident) == IDENTIFIER_NODE);
+ p = IDENTIFIER_POINTER (ident);
+
+ /* If we are in LTO, then we don't know the state of flag_next_runtime
+ or flag_objc_abi when the code was generated. We set these from the
+ meta-data - which is needed to deal with const string constructors. */
+
+ flag_next_runtime = 1;
+ flag_objc_abi = 2;
+
+ if (base == data_section)
+ base = darwin_sections[objc2_metadata_section];
+
+ /* Most of the OBJC2 META-data end up in the base section, so check it
+ first. */
+ if (!strncmp (p, "V2_BASE", 7))
+ return base;
+ else if (!strncmp (p, "V2_STRG", 7))
+ return darwin_sections[cstring_section];
+
+ else if (!strncmp (p, "G2_META", 7) || !strncmp (p, "G2_CLAS", 7))
+ return darwin_sections[objc2_classdefs_section];
+ else if (!strncmp (p, "V2_MREF", 7))
+ return darwin_sections[objc2_message_refs_section];
+ else if (!strncmp (p, "V2_CLRF", 7))
+ return darwin_sections[objc2_classrefs_section];
+ else if (!strncmp (p, "V2_SURF", 7))
+ return darwin_sections[objc2_super_classrefs_section];
+ else if (!strncmp (p, "V2_NLCL", 7))
+ return darwin_sections[objc2_nonlazy_class_section];
+ else if (!strncmp (p, "V2_CLAB", 7))
+ return darwin_sections[objc2_classlist_section];
+ else if (!strncmp (p, "V2_SRFS", 7))
+ return darwin_sections[objc2_selector_refs_section];
+ else if (!strncmp (p, "V2_NLCA", 7))
+ return darwin_sections[objc2_nonlazy_category_section];
+ else if (!strncmp (p, "V2_CALA", 7))
+ return darwin_sections[objc2_categorylist_section];
+
+ else if (!strncmp (p, "V2_PLST", 7))
+ return darwin_sections[objc2_protocollist_section];
+ else if (!strncmp (p, "V2_PRFS", 7))
+ return darwin_sections[objc2_protocolrefs_section];
+
+ else if (!strncmp (p, "V2_INFO", 7))
+ return darwin_sections[objc2_image_info_section];
+
+ else if (!strncmp (p, "V2_EHTY", 7))
+ return darwin_sections[data_coal_section];
+
+ else if (!strncmp (p, "V2_CSTR", 7))
+ return darwin_sections[objc2_constant_string_object_section];
+
+ /* Not recognized, default. */
+ return base;
+}
+
+/* Return the section required for Objective C ABI 0/1 metadata. */
+static section *
+darwin_objc1_section (tree decl ATTRIBUTE_UNUSED, tree meta, section * base)
+{
+ const char *p;
+ tree ident = TREE_VALUE (meta);
+ gcc_assert (TREE_CODE (ident) == IDENTIFIER_NODE);
+ p = IDENTIFIER_POINTER (ident);
+
+ /* If we are in LTO, then we don't know the state of flag_next_runtime
+ or flag_objc_abi when the code was generated. We set these from the
+ meta-data - which is needed to deal with const string constructors. */
+ flag_next_runtime = 1;
+ if (!global_options_set.x_flag_objc_abi)
+ flag_objc_abi = 1;
+
+ /* String sections first, cos there are lots of strings. */
+ if (!strncmp (p, "V1_STRG", 7))
+ return darwin_sections[cstring_section];
+ else if (!strncmp (p, "V1_CLSN", 7))
+ return darwin_sections[objc_class_names_section];
+ else if (!strncmp (p, "V1_METN", 7))
+ return darwin_sections[objc_meth_var_names_section];
+ else if (!strncmp (p, "V1_METT", 7))
+ return darwin_sections[objc_meth_var_types_section];
+
+ else if (!strncmp (p, "V1_CLAS", 7))
+ return darwin_sections[objc_class_section];
+ else if (!strncmp (p, "V1_META", 7))
+ return darwin_sections[objc_meta_class_section];
+ else if (!strncmp (p, "V1_CATG", 7))
+ return darwin_sections[objc_category_section];
+ else if (!strncmp (p, "V1_PROT", 7))
+ return darwin_sections[objc_protocol_section];
+
+ else if (!strncmp (p, "V1_CLCV", 7))
+ return darwin_sections[objc_class_vars_section];
+ else if (!strncmp (p, "V1_CLIV", 7))
+ return darwin_sections[objc_instance_vars_section];
+
+ else if (!strncmp (p, "V1_CLCM", 7))
+ return darwin_sections[objc_cls_meth_section];
+ else if (!strncmp (p, "V1_CLIM", 7))
+ return darwin_sections[objc_inst_meth_section];
+ else if (!strncmp (p, "V1_CACM", 7))
+ return darwin_sections[objc_cat_cls_meth_section];
+ else if (!strncmp (p, "V1_CAIM", 7))
+ return darwin_sections[objc_cat_inst_meth_section];
+ else if (!strncmp (p, "V1_PNSM", 7))
+ return darwin_sections[objc_cat_inst_meth_section];
+ else if (!strncmp (p, "V1_PCLM", 7))
+ return darwin_sections[objc_cat_cls_meth_section];
+
+ else if (!strncmp (p, "V1_CLPR", 7))
+ return darwin_sections[objc_cat_cls_meth_section];
+ else if (!strncmp (p, "V1_CAPR", 7))
+ return darwin_sections[objc_category_section]; /* ??? CHECK me. */
+
+ else if (!strncmp (p, "V1_PRFS", 7))
+ return darwin_sections[objc_cat_cls_meth_section];
+ else if (!strncmp (p, "V1_CLRF", 7))
+ return darwin_sections[objc_cls_refs_section];
+ else if (!strncmp (p, "V1_SRFS", 7))
+ return darwin_sections[objc_selector_refs_section];
+
+ else if (!strncmp (p, "V1_MODU", 7))
+ return darwin_sections[objc_module_info_section];
+ else if (!strncmp (p, "V1_SYMT", 7))
+ return darwin_sections[objc_symbols_section];
+ else if (!strncmp (p, "V1_INFO", 7))
+ return darwin_sections[objc_image_info_section];
+
+ else if (!strncmp (p, "V1_PLST", 7))
+ return darwin_sections[objc1_prop_list_section];
+ else if (!strncmp (p, "V1_PEXT", 7))
+ return darwin_sections[objc1_protocol_ext_section];
+ else if (!strncmp (p, "V1_CEXT", 7))
+ return darwin_sections[objc1_class_ext_section];
+
+ else if (!strncmp (p, "V2_CSTR", 7))
+ return darwin_sections[objc_constant_string_object_section];
+
+ return base;
+}
+
section *
machopic_select_section (tree decl,
int reloc,
@@ -1330,7 +1536,25 @@ machopic_select_section (tree decl,
gcc_unreachable ();
}
- /* Darwin weird special cases. */
+ /* Darwin weird special cases.
+ a) OBJC Meta-data. */
+ if (DECL_P (decl)
+ && (TREE_CODE (decl) == VAR_DECL
+ || TREE_CODE (decl) == CONST_DECL)
+ && DECL_ATTRIBUTES (decl))
+ {
+ tree meta = lookup_attribute ("OBJC2META", DECL_ATTRIBUTES (decl));
+ if (meta)
+ return darwin_objc2_section (decl, meta, base_section);
+ meta = lookup_attribute ("OBJC1META", DECL_ATTRIBUTES (decl));
+ if (meta)
+ return darwin_objc1_section (decl, meta, base_section);
+ meta = lookup_attribute ("OBJC1METG", DECL_ATTRIBUTES (decl));
+ if (meta)
+ return base_section; /* GNU runtime is happy with it all in one pot. */
+ }
+
+ /* b) Constant string objects. */
if (TREE_CODE (decl) == CONSTRUCTOR
&& TREE_TYPE (decl)
&& TREE_CODE (TREE_TYPE (decl)) == RECORD_TYPE
@@ -1340,29 +1564,53 @@ machopic_select_section (tree decl,
if (TREE_CODE (name) == TYPE_DECL)
name = DECL_NAME (name);
+ /* FIXME: This is unsatisfactory for LTO, since it relies on other
+ metadata determining the source FE. */
if (!strcmp (IDENTIFIER_POINTER (name), "__builtin_ObjCString"))
- {
- if (flag_next_runtime)
- return darwin_sections[objc_constant_string_object_section];
- else
- return darwin_sections[objc_string_object_section];
- }
+ {
+ if (flag_next_runtime)
+ {
+ if (flag_objc_abi == 2)
+ return darwin_sections[objc2_constant_string_object_section];
+ else
+ return darwin_sections[objc_constant_string_object_section];
+ }
+ else
+ return darwin_sections[objc_string_object_section];
+ }
else if (!strcmp (IDENTIFIER_POINTER (name), "__builtin_CFString"))
return darwin_sections[cfstring_constant_object_section];
else
- return base_section;
+ return base_section;
}
+ /* c) legacy meta-data selection. */
else if (TREE_CODE (decl) == VAR_DECL
&& DECL_NAME (decl)
&& TREE_CODE (DECL_NAME (decl)) == IDENTIFIER_NODE
&& IDENTIFIER_POINTER (DECL_NAME (decl))
+ && flag_next_runtime
&& !strncmp (IDENTIFIER_POINTER (DECL_NAME (decl)), "_OBJC_", 6))
{
const char *name = IDENTIFIER_POINTER (DECL_NAME (decl));
-
+ static bool warned_objc_46 = false;
/* We shall assert that zero-sized objects are an error in ObjC
meta-data. */
gcc_assert (tree_low_cst (DECL_SIZE_UNIT (decl), 1) != 0);
+
+ /* ??? This mechanism for determining the metadata section is
+ broken when LTO is in use, since the frontend that generated
+ the data is not identified. We will keep the capability for
+ the short term - in case any non-Objective-C programs are using
+ it to place data in specified sections. */
+ if (!warned_objc_46)
+ {
+ location_t loc = DECL_SOURCE_LOCATION (decl);
+ warning_at (loc, 0, "the use of _OBJC_-prefixed variable names"
+ " to select meta-data sections is deprecated at 4.6"
+ " and will be removed in 4.7");
+ warned_objc_46 = true;
+ }
+
if (!strncmp (name, "_OBJC_CLASS_METHODS_", 20))
return darwin_sections[objc_cls_meth_section];
else if (!strncmp (name, "_OBJC_INSTANCE_METHODS_", 23))
@@ -1910,6 +2158,30 @@ darwin_emit_weak_or_comdat (FILE *fp, tree decl, const char *name,
assemble_zeros (size);
}
+/* Emit a chunk of data for ObjC meta-data that got placed in BSS erroneously. */
+static void
+darwin_emit_objc_zeroed (FILE *fp, tree decl, const char *name,
+ unsigned HOST_WIDE_INT size,
+ unsigned int align, tree meta)
+{
+ section *ocs = data_section;
+
+ if (TREE_PURPOSE (meta) == get_identifier("OBJC2META"))
+ ocs = darwin_objc2_section (decl, meta, ocs);
+ else
+ ocs = darwin_objc1_section (decl, meta, ocs);
+
+ switch_to_section (ocs);
+
+ /* We shall declare that zero-sized meta-data are not valid (yet). */
+ gcc_assert (size);
+ fprintf (fp, "\t.align\t%d\n", floor_log2 (align / BITS_PER_UNIT));
+
+ /* ... and we let it deal with outputting one byte of zero for them too. */
+ darwin_asm_declare_object_name (fp, name, decl);
+ assemble_zeros (size);
+}
+
/* This routine emits 'local' storage:
When Section Anchors are off this routine emits .zerofill commands in
@@ -2041,6 +2313,7 @@ darwin_output_aligned_bss (FILE *fp, tree decl, const char *name,
{
unsigned int l2align;
bool one, pub, weak;
+ tree meta;
pub = TREE_PUBLIC (decl);
one = DECL_ONE_ONLY (decl);
@@ -2057,6 +2330,14 @@ fprintf (fp, "# albss: %s (%lld,%d) ro %d cst %d stat %d com %d"
pub, weak, one, (unsigned long)DECL_INITIAL (decl));
#endif
+ /* ObjC metadata can get put in BSS because varasm.c decides it's BSS
+ before the target has a chance to comment. */
+ if ((meta = is_objc_metadata (decl)))
+ {
+ darwin_emit_objc_zeroed (fp, decl, name, size, DECL_ALIGN (decl), meta);
+ return;
+ }
+
/* Check that any initializer is valid. */
gcc_assert ((DECL_INITIAL (decl) == NULL)
|| (DECL_INITIAL (decl) == error_mark_node)
@@ -2151,6 +2432,8 @@ darwin_asm_output_aligned_decl_common (FILE *fp, tree decl, const char *name,
{
unsigned int l2align;
bool one, weak;
+ tree meta;
+
/* No corresponding var. */
if (decl==NULL)
{
@@ -2175,6 +2458,14 @@ fprintf (fp, "# adcom: %s (%lld,%d) ro %d cst %d stat %d com %d pub %d"
TREE_PUBLIC (decl), weak, one, (unsigned long)DECL_INITIAL (decl));
#endif
+ /* ObjC metadata can get put in BSS because varasm.c decides it's BSS
+ before the target has a chance to comment. */
+ if ((meta = is_objc_metadata (decl)))
+ {
+ darwin_emit_objc_zeroed (fp, decl, name, size, DECL_ALIGN (decl), meta);
+ return;
+ }
+
/* We shouldn't be messing with this if the decl has a section name. */
gcc_assert (DECL_SECTION_NAME (decl) == NULL);
@@ -2221,6 +2512,7 @@ darwin_asm_output_aligned_decl_local (FILE *fp, tree decl, const char *name,
{
unsigned long l2align;
bool one, weak;
+ tree meta;
one = DECL_ONE_ONLY (decl);
weak = (DECL_P (decl)
@@ -2236,6 +2528,14 @@ fprintf (fp, "# adloc: %s (%lld,%d) ro %d cst %d stat %d one %d pub %d"
weak , (unsigned long)DECL_INITIAL (decl));
#endif
+ /* ObjC metadata can get put in BSS because varasm.c decides it's BSS
+ before the target has a chance to comment. */
+ if ((meta = is_objc_metadata (decl)))
+ {
+ darwin_emit_objc_zeroed (fp, decl, name, size, DECL_ALIGN (decl), meta);
+ return;
+ }
+
/* We shouldn't be messing with this if the decl has a section name. */
gcc_assert (DECL_SECTION_NAME (decl) == NULL);
@@ -2579,22 +2879,29 @@ darwin_override_options (void)
&& !TARGET_64BIT)
global_options.x_flag_asynchronous_unwind_tables = 0;
- /* Disable -freorder-blocks-and-partition when unwind tables are being emitted
- for Darwin < 10 (OSX 10.6).
- The strategy is, "Unless the User has specifically set/unset an unwind flag
- we will switch off -freorder-blocks-and-partition when unwind tables will be
- generated". If the User specifically sets flags... we assume (s)he knows
- why... */
+ /* Disable -freorder-blocks-and-partition when unwind tables are being
+ emitted for Darwin < 9 (OSX 10.5).
+ The strategy is, "Unless the User has specifically set/unset an unwind
+ flag we will switch off -freorder-blocks-and-partition when unwind tables
+ will be generated". If the User specifically sets flags... we assume
+ (s)he knows why... */
if (generating_for_darwin_version < 9
&& global_options_set.x_flag_reorder_blocks_and_partition
&& ((global_options.x_flag_exceptions /* User, c++, java */
&& !global_options_set.x_flag_exceptions) /* User specified... */
|| (global_options.x_flag_unwind_tables
- && !global_options_set.x_flag_unwind_tables)
+ && !global_options_set.x_flag_unwind_tables)
|| (global_options.x_flag_non_call_exceptions
- && !global_options_set.x_flag_non_call_exceptions)
+ && !global_options_set.x_flag_non_call_exceptions)
|| (global_options.x_flag_asynchronous_unwind_tables
- && !global_options_set.x_flag_asynchronous_unwind_tables)))
+ && !global_options_set.x_flag_asynchronous_unwind_tables)))
+ {
+ inform (input_location,
+ "-freorder-blocks-and-partition does not work with exceptions "
+ "on this architecture");
+ flag_reorder_blocks_and_partition = 0;
+ flag_reorder_blocks = 1;
+ }
if (flag_mkernel || flag_apple_kext)
{
@@ -2694,7 +3001,7 @@ static GTY(()) tree pccfstring_type_node = NULL_TREE;
static GTY(()) tree pcint_type_node = NULL_TREE;
static GTY(()) tree pcchar_type_node = NULL_TREE;
-static enum built_in_function DARWIN_BUILTIN_CFSTRINGMAKECONSTANTSTRING;
+static enum built_in_function darwin_builtin_cfstring;
/* Store all constructed constant CFStrings in a hash table so that
they get uniqued properly. */
@@ -2724,14 +3031,14 @@ add_builtin_field_decl (tree type, const char *name, tree **chain)
return field;
}
-void
-darwin_init_cfstring_builtins (unsigned first_avail)
+tree
+darwin_init_cfstring_builtins (unsigned builtin_cfstring)
{
tree cfsfun, fields, pccfstring_ftype_pcchar;
tree *chain = NULL;
- DARWIN_BUILTIN_CFSTRINGMAKECONSTANTSTRING =
- (enum built_in_function) first_avail;
+ darwin_builtin_cfstring =
+ (enum built_in_function) builtin_cfstring;
/* struct __builtin_CFString {
const int *isa; (will point at
@@ -2777,7 +3084,7 @@ darwin_init_cfstring_builtins (unsigned first_avail)
DECL_LANG_SPECIFIC (cfsfun) = NULL;
(*lang_hooks.dup_lang_specific_decl) (cfsfun);
DECL_BUILT_IN_CLASS (cfsfun) = BUILT_IN_MD;
- DECL_FUNCTION_CODE (cfsfun) = DARWIN_BUILTIN_CFSTRINGMAKECONSTANTSTRING;
+ DECL_FUNCTION_CODE (cfsfun) = darwin_builtin_cfstring;
lang_hooks.builtin_function (cfsfun);
/* extern int __CFConstantStringClassReference[]; */
@@ -2793,6 +3100,8 @@ darwin_init_cfstring_builtins (unsigned first_avail)
/* Initialize the hash table used to hold the constant CFString objects. */
cfstring_htab = htab_create_ggc (31, cfstring_hash, cfstring_eq, NULL);
+
+ return cfstring_type_node;
}
tree
@@ -2801,7 +3110,7 @@ darwin_fold_builtin (tree fndecl, int n_args, tree *argp,
{
unsigned int fcode = DECL_FUNCTION_CODE (fndecl);
- if (fcode == DARWIN_BUILTIN_CFSTRINGMAKECONSTANTSTRING)
+ if (fcode == darwin_builtin_cfstring)
{
if (!darwin_constant_cfstrings)
{
@@ -2822,6 +3131,34 @@ darwin_fold_builtin (tree fndecl, int n_args, tree *argp,
return NULL_TREE;
}
+void
+darwin_rename_builtins (void)
+{
+ /* The system ___divdc3 routine in libSystem on darwin10 is not
+ accurate to 1ulp, ours is, so we avoid ever using the system name
+ for this routine and instead install a non-conflicting name that
+ is accurate.
+
+ When -ffast-math or -funsafe-math-optimizations is given, we can
+ use the faster version. */
+ if (!flag_unsafe_math_optimizations)
+ {
+ int dcode = (BUILT_IN_COMPLEX_DIV_MIN
+ + DCmode - MIN_MODE_COMPLEX_FLOAT);
+ tree fn = built_in_decls[dcode];
+ /* Fortran and c call TARGET_INIT_BUILTINS and
+ TARGET_INIT_LIBFUNCS at different times, so we have to put a
+ call into each to ensure that at least one of them is called
+ after build_common_builtin_nodes. A better fix is to add a
+ new hook to run after build_common_builtin_nodes runs. */
+ if (fn)
+ set_user_assembler_name (fn, "___ieee_divdc3");
+ fn = implicit_built_in_decls[dcode];
+ if (fn)
+ set_user_assembler_name (fn, "___ieee_divdc3");
+ }
+}
+
static hashval_t
cfstring_hash (const void *ptr)
{
diff --git a/gcc/config/darwin.h b/gcc/config/darwin.h
index 74ced9c31ca..0526d851fc3 100644
--- a/gcc/config/darwin.h
+++ b/gcc/config/darwin.h
@@ -1,6 +1,6 @@
/* Target definitions for Darwin (Mac OS X) systems.
Copyright (C) 1989, 1990, 1991, 1992, 1993, 2000, 2001, 2002, 2003, 2004,
- 2005, 2006, 2007, 2008, 2009, 2010
+ 2005, 2006, 2007, 2008, 2009, 2010, 2011
Free Software Foundation, Inc.
Contributed by Apple Computer Inc.
@@ -140,6 +140,16 @@ extern GTY(()) int darwin_ms_struct;
} while (0)
#define SUBTARGET_C_COMMON_OVERRIDE_OPTIONS do { \
+ /* Unless set, force ABI=2 for NeXT and m64, 0 otherwise. */ \
+ if (!global_options_set.x_flag_objc_abi) \
+ global_options.x_flag_objc_abi \
+ = (flag_next_runtime && TARGET_64BIT) ? 2 : 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 is only" \
+ " supported on %<-m64%> targets for" \
+ " %<-fnext-runtime%>"); \
/* Sort out ObjC exceptions: If the runtime is NeXT we default to \
sjlj for m32 only. */ \
if (!global_options_set.x_flag_objc_sjlj_exceptions) \
@@ -599,7 +609,7 @@ int darwin_label_is_anonymous_local_objc_name (const char *name);
} \
else if (xname[0] == '+' || xname[0] == '-') \
fprintf (FILE, "\"%s\"", xname); \
- else if (darwin_label_is_anonymous_local_objc_name (xname)) \
+ else if (darwin_label_is_anonymous_local_objc_name (xname)) \
fprintf (FILE, "L%s", xname); \
else if (!strncmp (xname, ".objc_class_name_", 17)) \
fprintf (FILE, "%s", xname); \
@@ -651,11 +661,6 @@ int darwin_label_is_anonymous_local_objc_name (const char *name);
/* The generic version, archs should over-ride where required. */
#define MACHOPIC_NL_SYMBOL_PTR_SECTION ".non_lazy_symbol_pointer"
-/* Private flag applied to disable section-anchors in a particular section.
- This needs to be kept in sync with the flags used by varasm.c (defined in
- output.h). */
-#define SECTION_NO_ANCHOR 0x2000000
-
/* Declare the section variables. */
#ifndef USED_FOR_TARGET
enum darwin_section_enum {
diff --git a/gcc/config/darwin.opt b/gcc/config/darwin.opt
index 0d8c4b542c2..a31ee074cf0 100644
--- a/gcc/config/darwin.opt
+++ b/gcc/config/darwin.opt
@@ -217,12 +217,13 @@ 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.
+; 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. Useful for setting the OS on which people
+; ususally debug.
mmacosx-version-min=
-Target Joined Report Var(darwin_macosx_version_min) Init("10.1")
+Target Joined Report Var(darwin_macosx_version_min) Init("10.6")
The earliest MacOS X version on which this program will run
mone-byte-bool
diff --git a/gcc/config/darwin10.h b/gcc/config/darwin10.h
index 50f8e1b3b5e..5c205945cdc 100644
--- a/gcc/config/darwin10.h
+++ b/gcc/config/darwin10.h
@@ -1,5 +1,5 @@
/* Target definitions for Darwin (Mac OS X) systems.
- Copyright (C) 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 2009, 2010, 2011 Free Software Foundation, Inc.
Contributed by Jack Howarth <howarth@bromo.med.uc.edu>.
This file is part of GCC.
@@ -18,8 +18,15 @@ 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/>. */
+#undef LIB_SPEC
+#define LIB_SPEC "%{!static: -lSystem }"
+
/* Fix PR41260 by passing -no_compact_unwind on darwin10 and later until
-unwinder in libSystem is fixed to digest new epilog unwinding notes. */
+ unwinder in libSystem is fixed to digest new epilog unwinding notes.
-#undef LIB_SPEC
-#define LIB_SPEC "%{!static:-no_compact_unwind -lSystem}"
+ 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: \
+ %:version-compare(>= 10.6 mmacosx-version-min= -lSystem) } } %G %L"
diff --git a/gcc/config/fr30/constraints.md b/gcc/config/fr30/constraints.md
new file mode 100644
index 00000000000..2fb0491598e
--- /dev/null
+++ b/gcc/config/fr30/constraints.md
@@ -0,0 +1,72 @@
+;; Constraint definitions for the FR30.
+;; Copyright (C) 2011
+;; Free Software Foundation, Inc.
+
+;; This file is part of GCC.
+
+;; GCC is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 3, or (at your option)
+;; any later version.
+
+;; GCC is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GCC; see the file COPYING3. If not see
+;; <http://www.gnu.org/licenses/>.
+
+;; Register constraints.
+(define_register_constraint "d" "MULTIPLY_64_REG"
+ "The MDH,MDL register pair as used by MUL and MULU.")
+
+(define_register_constraint "e" "MULTIPLY_32_REG"
+ "The MDL register as used by MULH and MULUH.")
+
+(define_register_constraint "h" "HIGH_REGS"
+ "Registers 8 through 15.")
+
+(define_register_constraint "l" "LOW_REGS"
+ "Registers 0 through 7.")
+
+(define_register_constraint "a" "ALL_REGS"
+ "@internal")
+
+;; Integer constraints.
+(define_constraint "I"
+ "An integer in the range 0 to 15."
+ (and (match_code "const_int")
+ (match_test "IN_RANGE (ival, 0, 15)")))
+
+(define_constraint "J"
+ "An integer in the range -16 to -1."
+ (and (match_code "const_int")
+ (match_test "IN_RANGE (ival, -16, -1)")))
+
+(define_constraint "K"
+ "An integer in the range 16 to 31."
+ (and (match_code "const_int")
+ (match_test "IN_RANGE (ival, 16, 31)")))
+
+(define_constraint "L"
+ "An integer in the range 0 to 255."
+ (and (match_code "const_int")
+ (match_test "IN_RANGE (ival, 0, 255)")))
+
+(define_constraint "M"
+ "An integer in the range 0 to 1048575."
+ (and (match_code "const_int")
+ (match_test "IN_RANGE (ival, 0, 1048575)")))
+
+(define_constraint "P"
+ "An integer in the range -256 to 255."
+ (and (match_code "const_int")
+ (match_test "IN_RANGE (ival, -256, 255)")))
+
+;; Extra constraints.
+(define_constraint "Q"
+ "@internal"
+ (and (match_code "mem")
+ (match_code "symbol_ref" "0")))
diff --git a/gcc/config/fr30/fr30.h b/gcc/config/fr30/fr30.h
index 549c9275c2d..d20d7fb79c3 100644
--- a/gcc/config/fr30/fr30.h
+++ b/gcc/config/fr30/fr30.h
@@ -350,30 +350,6 @@ enum reg_class
(as well as added to a displacement). */
#define INDEX_REG_CLASS REAL_REGS
-/* A C expression which defines the machine-dependent operand constraint
- letters for register classes. If CHAR is such a letter, the value should be
- the register class corresponding to it. Otherwise, the value should be
- `NO_REGS'. The register letter `r', corresponding to class `GENERAL_REGS',
- will not be passed to this macro; you do not need to handle it.
-
- The following letters are unavailable, due to being used as
- constraints:
- '0'..'9'
- '<', '>'
- 'E', 'F', 'G', 'H'
- 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P'
- 'Q', 'R', 'S', 'T', 'U'
- 'V', 'X'
- 'g', 'i', 'm', 'n', 'o', 'p', 'r', 's' */
-
-#define REG_CLASS_FROM_LETTER(CHAR) \
- ( (CHAR) == 'd' ? MULTIPLY_64_REG \
- : (CHAR) == 'e' ? MULTIPLY_32_REG \
- : (CHAR) == 'h' ? HIGH_REGS \
- : (CHAR) == 'l' ? LOW_REGS \
- : (CHAR) == 'a' ? ALL_REGS \
- : NO_REGS)
-
/* A C expression which is nonzero if register number NUM is suitable for use
as a base register in operand addresses. It may be either a suitable hard
register or a pseudo register that has been allocated such a hard register. */
@@ -404,53 +380,6 @@ enum reg_class
#define CLASS_MAX_NREGS(CLASS, MODE) HARD_REGNO_NREGS (0, MODE)
/*}}}*/
-/*{{{ CONSTANTS. */
-
-/* A C expression that defines the machine-dependent operand constraint letters
- (`I', `J', `K', .. 'P') that specify particular ranges of integer values.
- If C is one of those letters, the expression should check that VALUE, an
- integer, is in the appropriate range and return 1 if so, 0 otherwise. If C
- is not one of those letters, the value should be 0 regardless of VALUE. */
-#define CONST_OK_FOR_LETTER_P(VALUE, C) \
- ( (C) == 'I' ? IN_RANGE (VALUE, 0, 15) \
- : (C) == 'J' ? IN_RANGE (VALUE, -16, -1) \
- : (C) == 'K' ? IN_RANGE (VALUE, 16, 31) \
- : (C) == 'L' ? IN_RANGE (VALUE, 0, (1 << 8) - 1) \
- : (C) == 'M' ? IN_RANGE (VALUE, 0, (1 << 20) - 1) \
- : (C) == 'P' ? IN_RANGE (VALUE, -(1 << 8), (1 << 8) - 1) \
- : 0)
-
-/* A C expression that defines the machine-dependent operand constraint letters
- (`G', `H') that specify particular ranges of `const_double' values.
-
- If C is one of those letters, the expression should check that VALUE, an RTX
- of code `const_double', is in the appropriate range and return 1 if so, 0
- otherwise. If C is not one of those letters, the value should be 0
- regardless of VALUE.
-
- `const_double' is used for all floating-point constants and for `DImode'
- fixed-point constants. A given letter can accept either or both kinds of
- values. It can use `GET_MODE' to distinguish between these kinds. */
-#define CONST_DOUBLE_OK_FOR_LETTER_P(VALUE, C) 0
-
-/* A C expression that defines the optional machine-dependent constraint
- letters (`Q', `R', `S', `T', `U') that can be used to segregate specific
- types of operands, usually memory references, for the target machine.
- Normally this macro will not be defined. If it is required for a particular
- target machine, it should return 1 if VALUE corresponds to the operand type
- represented by the constraint letter C. If C is not defined as an extra
- constraint, the value returned should be 0 regardless of VALUE.
-
- For example, on the ROMP, load instructions cannot have their output in r0
- if the memory reference contains a symbolic address. Constraint letter `Q'
- is defined as representing a memory address that does *not* contain a
- symbolic address. An alternative is specified with a `Q' constraint on the
- input and `r' on the output. The next alternative specifies `m' on the
- input and a register class that does not include r0 on the output. */
-#define EXTRA_CONSTRAINT(VALUE, C) \
- ((C) == 'Q' ? (GET_CODE (VALUE) == MEM && GET_CODE (XEXP (VALUE, 0)) == SYMBOL_REF) : 0)
-
-/*}}}*/
/*{{{ Basic Stack Layout. */
/* Define this macro if pushing a word onto the stack moves the stack pointer
diff --git a/gcc/config/fr30/fr30.md b/gcc/config/fr30/fr30.md
index f95559f3d46..6b35599837f 100644
--- a/gcc/config/fr30/fr30.md
+++ b/gcc/config/fr30/fr30.md
@@ -54,6 +54,7 @@
)
(include "predicates.md")
+(include "constraints.md")
;;}}}
;;{{{ Moves
diff --git a/gcc/config/freebsd-spec.h b/gcc/config/freebsd-spec.h
index 00b7407b1f4..d8b338226b8 100644
--- a/gcc/config/freebsd-spec.h
+++ b/gcc/config/freebsd-spec.h
@@ -121,6 +121,9 @@ is built with the --enable-threads configure-time option.} \
%{!shared: \
%{!pg: %{pthread:-lpthread} -lc} \
%{pg: %{pthread:-lpthread_p} -lc_p} \
+ } \
+ %{shared: \
+ %{pthread:-lpthread} -lc \
}"
#endif
#endif
diff --git a/gcc/config/freebsd.opt b/gcc/config/freebsd.opt
index eb8ebcb5ccd..2cffdb67b7f 100644
--- a/gcc/config/freebsd.opt
+++ b/gcc/config/freebsd.opt
@@ -1,6 +1,6 @@
; FreeBSD options.
-; Copyright (C) 2010
+; Copyright (C) 2010, 2011
; Free Software Foundation, Inc.
;
; This file is part of GCC.
@@ -35,12 +35,18 @@ Driver Separate
defsym=
Driver JoinedOrMissing
+posix
+Driver
+
profile
Driver
pthread
Driver
+rdynamic
+Driver
+
rpath-link
Driver Separate
diff --git a/gcc/config/frv/constraints.md b/gcc/config/frv/constraints.md
new file mode 100644
index 00000000000..792706b0333
--- /dev/null
+++ b/gcc/config/frv/constraints.md
@@ -0,0 +1,174 @@
+;; Constraint definitions for FRV.
+;; Copyright (C) 2001 Free Software Foundation, Inc.
+;;
+;; This file is part of GCC.
+;;
+;; GCC is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 3, or (at your option)
+;; any later version.
+;;
+;; GCC is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+;;
+;; You should have received a copy of the GNU General Public License
+;; along with GCC; see the file COPYING3. If not see
+;; <http://www.gnu.org/licenses/>.
+
+;; Register constraints.
+(define_register_constraint "a" "ACC_REGS"
+ "@internal")
+
+(define_register_constraint "b" "EVEN_ACC_REGS"
+ "@internal")
+
+(define_register_constraint "c" "CC_REGS"
+ "@internal")
+
+(define_register_constraint "d" "GPR_REGS"
+ "@internal")
+
+(define_register_constraint "e" "EVEN_REGS"
+ "@internal")
+
+(define_register_constraint "f" "FPR_REGS"
+ "@internal")
+
+(define_register_constraint "h" "FEVEN_REGS"
+ "@internal")
+
+(define_register_constraint "l" "LR_REG"
+ "@internal")
+
+(define_register_constraint "q" "QUAD_REGS"
+ "@internal")
+
+(define_register_constraint "t" "ICC_REGS"
+ "@internal")
+
+(define_register_constraint "u" "FCC_REGS"
+ "@internal")
+
+(define_register_constraint "v" "ICR_REGS"
+ "@internal")
+
+(define_register_constraint "w" "FCR_REGS"
+ "@internal")
+
+(define_register_constraint "x" "QUAD_FPR_REGS"
+ "@internal")
+
+(define_register_constraint "y" "LCR_REG"
+ "@internal")
+
+(define_register_constraint "z" "SPR_REGS"
+ "@internal")
+
+(define_register_constraint "A" "QUAD_ACC_REGS"
+ "@internal")
+
+(define_register_constraint "B" "ACCG_REGS"
+ "@internal")
+
+(define_register_constraint "C" "CR_REGS"
+ "@internal")
+
+(define_register_constraint "D89" "GR89_REGS"
+ "@internal")
+
+(define_register_constraint "D09" "GR9_REGS"
+ "@internal")
+
+(define_register_constraint "D08" "GR8_REGS"
+ "@internal")
+
+(define_register_constraint "D14" "FDPIC_FPTR_REGS"
+ "@internal")
+
+(define_register_constraint "D15" "FDPIC_REGS"
+ "@internal")
+
+(define_register_constraint "W" "FDPIC_CALL_REGS"
+ "@internal")
+
+(define_register_constraint "Z" "FDPIC_REGS"
+ "@internal")
+
+;; Integer constraints.
+(define_constraint "I"
+ "A signed 6-bit immediate."
+ (and (match_code "const_int")
+ (match_test "IN_RANGE (ival, -32, 31)")))
+
+(define_constraint "J"
+ "A signed 10-bit immediate."
+ (and (match_code "const_int")
+ (match_test "IN_RANGE (ival, -512, 511)")))
+
+(define_constraint "K"
+ "@internal"
+ ;; Unused.
+ (and (match_code "const_int")
+ (match_test "0")))
+
+(define_constraint "L"
+ "A signed 16-bit immediate."
+ (and (match_code "const_int")
+ (match_test "IN_RANGE (ival, -32768, 32767)")))
+
+(define_constraint "M"
+ "An unsigned 16-bit immediate."
+ (and (match_code "const_int")
+ (match_test "IN_RANGE (ival, 0, 65535)")))
+
+(define_constraint "N"
+ "A signed 12-bit immediate that is negative."
+ (and (match_code "const_int")
+ (match_test "IN_RANGE (ival, -2048, -1)")))
+
+(define_constraint "O"
+ "Zero."
+ (and (match_code "const_int")
+ (match_test "ival == 0")))
+
+(define_constraint "P"
+ "A signed 12-bit immediate that is positive."
+ (and (match_code "const_int")
+ (match_test "IN_RANGE (ival, 1, 2047)")))
+
+;; Floating-point constraints.
+(define_constraint "G"
+ "Floating-point zero."
+ (and (match_code "const_double")
+ (ior (and (match_test "mode == VOIDmode")
+ (match_test "hval == 0 && lval == 0"))
+ (and (match_test "mode == SFmode || mode == DFmode")
+ (match_test "op == CONST0_RTX (mode)")))))
+
+(define_constraint "H"
+ "@internal"
+ ;; Unused.
+ (and (match_code "const_double")
+ (match_test "0")))
+
+(define_constraint "Q"
+ "12-bit relocations."
+ (match_test "got12_operand (op, mode)"))
+
+(define_memory_constraint "R"
+ "Double word memory ops that take one instruction."
+ (match_test "dbl_memory_one_insn_operand (op, mode)"))
+
+(define_constraint "S"
+ "SYMBOL_REF."
+ (match_test "CONSTANT_P (op) && call_operand (op, VOIDmode)"))
+
+(define_memory_constraint "T"
+ "Double word memory ops that take two instructions."
+ (match_test "dbl_memory_two_insn_operand (op, mode)"))
+
+(define_memory_constraint "U"
+ "Memory operand for conditional execution."
+ (match_test "condexec_memory_operand (op, mode)"))
diff --git a/gcc/config/frv/frv.c b/gcc/config/frv/frv.c
index 0f59265532e..229b9feb735 100644
--- a/gcc/config/frv/frv.c
+++ b/gcc/config/frv/frv.c
@@ -252,9 +252,6 @@ static /* GTY(()) */ frv_ifcvt_t frv_ifcvt;
/* Map register number to smallest register class. */
enum reg_class regno_reg_class[FIRST_PSEUDO_REGISTER];
-/* Map class letter into register class. */
-enum reg_class reg_class_from_letter[256];
-
/* Cached value of frv_stack_info. */
static frv_stack_t *frv_stack_cache = (frv_stack_t *)0;
@@ -809,48 +806,6 @@ frv_option_override (void)
if (!global_options_set.x_g_switch_value && !TARGET_LIBPIC)
g_switch_value = SDATA_DEFAULT_SIZE;
- /* A C expression which defines the machine-dependent operand
- constraint letters for register classes. If CHAR is such a
- letter, the value should be the register class corresponding to
- it. Otherwise, the value should be `NO_REGS'. The register
- letter `r', corresponding to class `GENERAL_REGS', will not be
- passed to this macro; you do not need to handle it.
-
- The following letters are unavailable, due to being used as
- constraints:
- '0'..'9'
- '<', '>'
- 'E', 'F', 'G', 'H'
- 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P'
- 'Q', 'R', 'S', 'T', 'U'
- 'V', 'X'
- 'g', 'i', 'm', 'n', 'o', 'p', 'r', 's' */
-
- for (i = 0; i < 256; i++)
- reg_class_from_letter[i] = NO_REGS;
-
- reg_class_from_letter['a'] = ACC_REGS;
- reg_class_from_letter['b'] = EVEN_ACC_REGS;
- reg_class_from_letter['c'] = CC_REGS;
- reg_class_from_letter['d'] = GPR_REGS;
- reg_class_from_letter['e'] = EVEN_REGS;
- reg_class_from_letter['f'] = FPR_REGS;
- reg_class_from_letter['h'] = FEVEN_REGS;
- reg_class_from_letter['l'] = LR_REG;
- reg_class_from_letter['q'] = QUAD_REGS;
- reg_class_from_letter['t'] = ICC_REGS;
- reg_class_from_letter['u'] = FCC_REGS;
- reg_class_from_letter['v'] = ICR_REGS;
- reg_class_from_letter['w'] = FCR_REGS;
- reg_class_from_letter['x'] = QUAD_FPR_REGS;
- reg_class_from_letter['y'] = LCR_REG;
- reg_class_from_letter['z'] = SPR_REGS;
- reg_class_from_letter['A'] = QUAD_ACC_REGS;
- reg_class_from_letter['B'] = ACCG_REGS;
- reg_class_from_letter['C'] = CR_REGS;
- reg_class_from_letter['W'] = FDPIC_CALL_REGS; /* gp14+15 */
- reg_class_from_letter['Z'] = FDPIC_REGS; /* gp15 */
-
/* There is no single unaligned SI op for PIC code. Sometimes we
need to use ".4byte" and sometimes we need to use ".picptr".
See frv_assemble_integer for details. */
diff --git a/gcc/config/frv/frv.h b/gcc/config/frv/frv.h
index d7bc0828c16..299a85676ba 100644
--- a/gcc/config/frv/frv.h
+++ b/gcc/config/frv/frv.h
@@ -1,6 +1,6 @@
/* Target macros for the FRV port of GCC.
Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009,
- 2010
+ 2010, 2011
Free Software Foundation, Inc.
Contributed by Red Hat Inc.
@@ -57,7 +57,7 @@
#undef ASM_SPEC
#define ASM_SPEC "\
-%{G*} %{Ym,*} %{Yd,*} \
+%{G*} \
%{mtomcat-stats} \
%{!mno-eflags: \
%{mcpu=*} \
@@ -126,9 +126,7 @@
%{static:-dn -Bstatic} \
%{shared:-Bdynamic} \
%{symbolic:-Bsymbolic} \
-%{G*} \
-%{YP,*} \
-%{Qy:} %{!Qn:-Qy}"
+%{G*}"
#undef LIB_SPEC
#define LIB_SPEC "--start-group -lc -lsim --end-group"
@@ -1005,25 +1003,6 @@ extern enum reg_class regno_reg_class[];
(as well as added to a displacement). */
#define INDEX_REG_CLASS GPR_REGS
-/* A C expression which defines the machine-dependent operand constraint
- letters for register classes. If CHAR is such a letter, the value should be
- the register class corresponding to it. Otherwise, the value should be
- `NO_REGS'. The register letter `r', corresponding to class `GENERAL_REGS',
- will not be passed to this macro; you do not need to handle it.
-
- The following letters are unavailable, due to being used as
- constraints:
- '0'..'9'
- '<', '>'
- 'E', 'F', 'G', 'H'
- 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P'
- 'Q', 'R', 'S', 'T', 'U'
- 'V', 'X'
- 'g', 'i', 'm', 'n', 'o', 'p', 'r', 's' */
-
-extern enum reg_class reg_class_from_letter[];
-#define REG_CLASS_FROM_LETTER(CHAR) reg_class_from_letter [(unsigned char)(CHAR)]
-
/* A C expression which is nonzero if register number NUM is suitable for use
as a base register in operand addresses. It may be either a suitable hard
register or a pseudo register that has been allocated such a hard register. */
@@ -1069,124 +1048,6 @@ extern enum reg_class reg_class_from_letter[];
#define ZERO_P(x) (x == CONST0_RTX (GET_MODE (x)))
-/* 6-bit signed immediate. */
-#define CONST_OK_FOR_I(VALUE) IN_RANGE (VALUE, -32, 31)
-/* 10-bit signed immediate. */
-#define CONST_OK_FOR_J(VALUE) IN_RANGE (VALUE, -512, 511)
-/* Unused */
-#define CONST_OK_FOR_K(VALUE) 0
-/* 16-bit signed immediate. */
-#define CONST_OK_FOR_L(VALUE) IN_RANGE (VALUE, -32768, 32767)
-/* 16-bit unsigned immediate. */
-#define CONST_OK_FOR_M(VALUE) IN_RANGE (VALUE, 0, 65535)
-/* 12-bit signed immediate that is negative. */
-#define CONST_OK_FOR_N(VALUE) IN_RANGE (VALUE, -2048, -1)
-/* Zero */
-#define CONST_OK_FOR_O(VALUE) ((VALUE) == 0)
-/* 12-bit signed immediate that is negative. */
-#define CONST_OK_FOR_P(VALUE) IN_RANGE (VALUE, 1, 2047)
-
-/* A C expression that defines the machine-dependent operand constraint letters
- (`I', `J', `K', .. 'P') that specify particular ranges of integer values.
- If C is one of those letters, the expression should check that VALUE, an
- integer, is in the appropriate range and return 1 if so, 0 otherwise. If C
- is not one of those letters, the value should be 0 regardless of VALUE. */
-#define CONST_OK_FOR_LETTER_P(VALUE, C) \
- ( (C) == 'I' ? CONST_OK_FOR_I (VALUE) \
- : (C) == 'J' ? CONST_OK_FOR_J (VALUE) \
- : (C) == 'K' ? CONST_OK_FOR_K (VALUE) \
- : (C) == 'L' ? CONST_OK_FOR_L (VALUE) \
- : (C) == 'M' ? CONST_OK_FOR_M (VALUE) \
- : (C) == 'N' ? CONST_OK_FOR_N (VALUE) \
- : (C) == 'O' ? CONST_OK_FOR_O (VALUE) \
- : (C) == 'P' ? CONST_OK_FOR_P (VALUE) \
- : 0)
-
-
-/* A C expression that defines the machine-dependent operand constraint letters
- (`G', `H') that specify particular ranges of `const_double' values.
-
- If C is one of those letters, the expression should check that VALUE, an RTX
- of code `const_double', is in the appropriate range and return 1 if so, 0
- otherwise. If C is not one of those letters, the value should be 0
- regardless of VALUE.
-
- `const_double' is used for all floating-point constants and for `DImode'
- fixed-point constants. A given letter can accept either or both kinds of
- values. It can use `GET_MODE' to distinguish between these kinds. */
-
-#define CONST_DOUBLE_OK_FOR_G(VALUE) \
- ((GET_MODE (VALUE) == VOIDmode \
- && CONST_DOUBLE_LOW (VALUE) == 0 \
- && CONST_DOUBLE_HIGH (VALUE) == 0) \
- || ((GET_MODE (VALUE) == SFmode \
- || GET_MODE (VALUE) == DFmode) \
- && (VALUE) == CONST0_RTX (GET_MODE (VALUE))))
-
-#define CONST_DOUBLE_OK_FOR_H(VALUE) 0
-
-#define CONST_DOUBLE_OK_FOR_LETTER_P(VALUE, C) \
- ( (C) == 'G' ? CONST_DOUBLE_OK_FOR_G (VALUE) \
- : (C) == 'H' ? CONST_DOUBLE_OK_FOR_H (VALUE) \
- : 0)
-
-/* A C expression that defines the optional machine-dependent constraint
- letters (`Q', `R', `S', `T', `U') that can be used to segregate specific
- types of operands, usually memory references, for the target machine.
- Normally this macro will not be defined. If it is required for a particular
- target machine, it should return 1 if VALUE corresponds to the operand type
- represented by the constraint letter C. If C is not defined as an extra
- constraint, the value returned should be 0 regardless of VALUE.
-
- For example, on the ROMP, load instructions cannot have their output in r0
- if the memory reference contains a symbolic address. Constraint letter `Q'
- is defined as representing a memory address that does *not* contain a
- symbolic address. An alternative is specified with a `Q' constraint on the
- input and `r' on the output. The next alternative specifies `m' on the
- input and a register class that does not include r0 on the output. */
-
-/* 12-bit relocations. */
-#define EXTRA_CONSTRAINT_FOR_Q(VALUE) \
- (got12_operand (VALUE, GET_MODE (VALUE)))
-
-/* Double word memory ops that take one instruction. */
-#define EXTRA_CONSTRAINT_FOR_R(VALUE) \
- (dbl_memory_one_insn_operand (VALUE, GET_MODE (VALUE)))
-
-/* SYMBOL_REF */
-#define EXTRA_CONSTRAINT_FOR_S(VALUE) \
- (CONSTANT_P (VALUE) && call_operand (VALUE, VOIDmode))
-
-/* Double word memory ops that take two instructions. */
-#define EXTRA_CONSTRAINT_FOR_T(VALUE) \
- (dbl_memory_two_insn_operand (VALUE, GET_MODE (VALUE)))
-
-/* Memory operand for conditional execution. */
-#define EXTRA_CONSTRAINT_FOR_U(VALUE) \
- (condexec_memory_operand (VALUE, GET_MODE (VALUE)))
-
-#define EXTRA_CONSTRAINT(VALUE, C) \
- ( (C) == 'Q' ? EXTRA_CONSTRAINT_FOR_Q (VALUE) \
- : (C) == 'R' ? EXTRA_CONSTRAINT_FOR_R (VALUE) \
- : (C) == 'S' ? EXTRA_CONSTRAINT_FOR_S (VALUE) \
- : (C) == 'T' ? EXTRA_CONSTRAINT_FOR_T (VALUE) \
- : (C) == 'U' ? EXTRA_CONSTRAINT_FOR_U (VALUE) \
- : 0)
-
-#define EXTRA_MEMORY_CONSTRAINT(C,STR) \
- ((C) == 'U' || (C) == 'R' || (C) == 'T')
-
-#define CONSTRAINT_LEN(C, STR) \
- ((C) == 'D' ? 3 : DEFAULT_CONSTRAINT_LEN ((C), (STR)))
-
-#define REG_CLASS_FROM_CONSTRAINT(C, STR) \
- (((C) == 'D' && (STR)[1] == '8' && (STR)[2] == '9') ? GR89_REGS : \
- ((C) == 'D' && (STR)[1] == '0' && (STR)[2] == '9') ? GR9_REGS : \
- ((C) == 'D' && (STR)[1] == '0' && (STR)[2] == '8') ? GR8_REGS : \
- ((C) == 'D' && (STR)[1] == '1' && (STR)[2] == '4') ? FDPIC_FPTR_REGS : \
- ((C) == 'D' && (STR)[1] == '1' && (STR)[2] == '5') ? FDPIC_REGS : \
- REG_CLASS_FROM_LETTER ((C)))
-
/* Basic Stack Layout. */
@@ -1597,9 +1458,9 @@ __trampoline_setup (addr, size, fnaddr, sc) \
exit (-1); \
} \
\
- /* Create a function descriptor with the address of the code below
- and NULL as the FDPIC value. We don't need the real GOT value
- here, since we don't use it, so we use NULL, that is just as
+ /* Create a function descriptor with the address of the code below \
+ and NULL as the FDPIC value. We don't need the real GOT value \
+ here, since we don't use it, so we use NULL, that is just as \
good. */ \
desc[0] = to; \
desc[1] = NULL; \
diff --git a/gcc/config/frv/frv.md b/gcc/config/frv/frv.md
index 47364b1b473..cc4a491417f 100644
--- a/gcc/config/frv/frv.md
+++ b/gcc/config/frv/frv.md
@@ -1519,6 +1519,7 @@
;;
(include "predicates.md")
+(include "constraints.md")
;; ::::::::::::::::::::
;; ::
diff --git a/gcc/config/gnu-user.opt b/gcc/config/gnu-user.opt
new file mode 100644
index 00000000000..7624fdfd5df
--- /dev/null
+++ b/gcc/config/gnu-user.opt
@@ -0,0 +1,39 @@
+; Options for systems using gnu-user.h.
+
+; Copyright (C) 2011
+; Free Software Foundation, Inc.
+;
+; This file is part of GCC.
+;
+; GCC is free software; you can redistribute it and/or modify it under
+; the terms of the GNU General Public License as published by the Free
+; Software Foundation; either version 3, or (at your option) any later
+; version.
+;
+; GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+; WARRANTY; without even the implied warranty of MERCHANTABILITY or
+; FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+; for more details.
+;
+; You should have received a copy of the GNU General Public License
+; along with GCC; see the file COPYING3. If not see
+; <http://www.gnu.org/licenses/>.
+
+; See the GCC internals manual (options.texi) for a description of
+; this file's format.
+
+; Please try to keep this file in ASCII collating order.
+
+posix
+Driver
+
+profile
+Driver
+
+pthread
+Driver
+
+rdynamic
+Driver
+
+; This comment is to ensure we retain the blank line above.
diff --git a/gcc/config/gnu.h b/gcc/config/gnu.h
index 1299376e665..fcf6ebcd7ce 100644
--- a/gcc/config/gnu.h
+++ b/gcc/config/gnu.h
@@ -1,8 +1,8 @@
/* Configuration common to all targets running the GNU system. */
/*
-Copyright (C) 1994, 1995, 1997, 1998, 1999, 2002, 2003, 2004, 2007, 2008 Free
-Software Foundation, Inc.
+Copyright (C) 1994, 1995, 1997, 1998, 1999, 2002, 2003, 2004, 2007, 2008, 2011
+Free Software Foundation, Inc.
This file is part of GCC.
@@ -22,11 +22,11 @@ along with GCC. If not, see <http://www.gnu.org/licenses/>.
/* Provide GCC options for standard feature-test macros. */
#undef CPP_SPEC
-#define CPP_SPEC "%{posix:-D_POSIX_SOURCE} %{bsd:-D_BSD_SOURCE}"
+#define CPP_SPEC "%{posix:-D_POSIX_SOURCE}"
-/* Default C library spec. Use -lbsd-compat for gcc -bsd. */
+/* Default C library spec. */
#undef LIB_SPEC
-#define LIB_SPEC "%{pthread:-lpthread} %{bsd:-lbsd-compat} %{pg|p|profile:-lc_p;:-lc}"
+#define LIB_SPEC "%{pthread:-lpthread} %{pg|p|profile:-lc_p;:-lc}"
/* Standard include directory. In GNU, "/usr" is a four-letter word. */
#undef STANDARD_INCLUDE_DIR
diff --git a/gcc/config/hpux11.opt b/gcc/config/hpux11.opt
new file mode 100644
index 00000000000..a7541477f23
--- /dev/null
+++ b/gcc/config/hpux11.opt
@@ -0,0 +1,33 @@
+; HP-UX 11 options.
+
+; Copyright (C) 2011
+; Free Software Foundation, Inc.
+;
+; This file is part of GCC.
+;
+; GCC is free software; you can redistribute it and/or modify it under
+; the terms of the GNU General Public License as published by the Free
+; Software Foundation; either version 3, or (at your option) any later
+; version.
+;
+; GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+; WARRANTY; without even the implied warranty of MERCHANTABILITY or
+; FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+; for more details.
+;
+; You should have received a copy of the GNU General Public License
+; along with GCC; see the file COPYING3. If not see
+; <http://www.gnu.org/licenses/>.
+
+; See the GCC internals manual (options.texi) for a description of
+; this file's format.
+
+; Please try to keep this file in ASCII collating order.
+
+mt
+Target RejectNegative
+
+pthread
+Driver
+
+; This comment is to ensure we retain the blank line above.
diff --git a/gcc/config/i386/avxintrin.h b/gcc/config/i386/avxintrin.h
index 70bfce1a274..8055cc60722 100644
--- a/gcc/config/i386/avxintrin.h
+++ b/gcc/config/i386/avxintrin.h
@@ -737,7 +737,7 @@ extern __inline __m256i __attribute__((__gnu_inline__, __always_inline__, __arti
_mm256_insert_epi32 (__m256i __X, int __D, int const __N)
{
__m128i __Y = _mm256_extractf128_si256 (__X, __N >> 2);
- __Y = _mm_insert_epi16 (__Y, __D, __N % 4);
+ __Y = _mm_insert_epi32 (__Y, __D, __N % 4);
return _mm256_insertf128_si256 (__X, __Y, __N >> 2);
}
@@ -762,7 +762,7 @@ extern __inline __m256i __attribute__((__gnu_inline__, __always_inline__, __arti
_mm256_insert_epi64 (__m256i __X, int __D, int const __N)
{
__m128i __Y = _mm256_extractf128_si256 (__X, __N >> 1);
- __Y = _mm_insert_epi16 (__Y, __D, __N % 2);
+ __Y = _mm_insert_epi64 (__Y, __D, __N % 2);
return _mm256_insertf128_si256 (__X, __Y, __N >> 1);
}
#endif
diff --git a/gcc/config/i386/biarch32.h b/gcc/config/i386/biarch32.h
deleted file mode 100644
index d4f186d6cb7..00000000000
--- a/gcc/config/i386/biarch32.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/* Make configure files to produce biarch compiler defaulting to 32bit mode.
- This file must be included very first, while the OS specific file later
- to overwrite otherwise wrong defaults.
- Copyright (C) 2009 Free Software Foundation, Inc.
- Contributed by Kai Tietz <kai.tietz@onevision.com>.
-
-This file is part of GCC.
-
-GCC is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 3, or (at your option)
-any later version.
-
-GCC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-Under Section 7 of GPL version 3, you are granted additional
-permissions described in the GCC Runtime Library Exception, version
-3.1, as published by the Free Software Foundation.
-
-You should have received a copy of the GNU General Public License and
-a copy of the GCC Runtime Library Exception along with this program;
-see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
-<http://www.gnu.org/licenses/>. */
-
-#define TARGET_64BIT_DEFAULT 0
-#define TARGET_BI_ARCH 1
diff --git a/gcc/config/i386/cygming.opt b/gcc/config/i386/cygming.opt
index 89d5d09d1aa..0fb325bdeea 100644
--- a/gcc/config/i386/cygming.opt
+++ b/gcc/config/i386/cygming.opt
@@ -1,6 +1,6 @@
; Cygwin- and MinGW-specific options.
-; Copyright (C) 2005, 2007, 2009, 2010 Free Software Foundation, Inc.
+; Copyright (C) 2005, 2007, 2009, 2010, 2011 Free Software Foundation, Inc.
;
; This file is part of GCC.
;
@@ -49,3 +49,6 @@ Use the GNU extension to the PE format for aligned common data
muse-libstdc-wrappers
Target Condition({defined (USE_CYGWIN_LIBSTDCXX_WRAPPERS)})
Compile code that relies on Cygwin DLL wrappers to support C++ operator new/delete replacement
+
+posix
+Driver
diff --git a/gcc/config/i386/darwin.h b/gcc/config/i386/darwin.h
index a9a2da4040e..934ab4b8234 100644
--- a/gcc/config/i386/darwin.h
+++ b/gcc/config/i386/darwin.h
@@ -308,6 +308,16 @@ do { \
#undef SUBTARGET_INIT_BUILTINS
#define SUBTARGET_INIT_BUILTINS \
do { \
- darwin_init_cfstring_builtins ((unsigned) (IX86_BUILTIN_MAX));\
+ ix86_builtins[(int) IX86_BUILTIN_CFSTRING] \
+ = darwin_init_cfstring_builtins ((unsigned) (IX86_BUILTIN_CFSTRING)); \
+ darwin_rename_builtins (); \
} while(0)
+/* The system ___divdc3 routine in libSystem on darwin10 is not
+ accurate to 1ulp, ours is, so we avoid ever using the system name
+ for this routine and instead install a non-conflicting name that is
+ accurate. See darwin_rename_builtins. */
+#ifdef L_divdc3
+#define DECLARE_LIBRARY_RENAMES \
+ asm(".text; ___divdc3: jmp ___ieee_divdc3 ; .globl ___divdc3");
+#endif
diff --git a/gcc/config/i386/djgpp.opt b/gcc/config/i386/djgpp.opt
index 013bdf0bf51..7e4affca944 100644
--- a/gcc/config/i386/djgpp.opt
+++ b/gcc/config/i386/djgpp.opt
@@ -1,6 +1,6 @@
; DJGPP-specific options.
-; Copyright (C) 2005, 2007 Free Software Foundation, Inc.
+; Copyright (C) 2005, 2007, 2011 Free Software Foundation, Inc.
;
; This file is part of GCC.
;
@@ -23,3 +23,6 @@
mbnu210
Target Var(TARGET_BNU210)
Ignored (obsolete)
+
+posix
+Driver
diff --git a/gcc/config/i386/gnu.h b/gcc/config/i386/gnu.h
index 077933bba68..ce37683b4a2 100644
--- a/gcc/config/i386/gnu.h
+++ b/gcc/config/i386/gnu.h
@@ -2,7 +2,7 @@
/*
Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-2005, 2007, 2008 Free Software Foundation, Inc.
+2005, 2007, 2008, 2011 Free Software Foundation, Inc.
This file is part of GCC.
@@ -27,7 +27,7 @@ along with GCC. If not, see <http://www.gnu.org/licenses/>.
#define TARGET_VERSION fprintf (stderr, " (i386 GNU)");
#undef CPP_SPEC
-#define CPP_SPEC "%{pthread:-D_REENTRANT} %{posix:-D_POSIX_SOURCE} %{bsd:-D_BSD_SOURCE}"
+#define CPP_SPEC "%{pthread:-D_REENTRANT} %{posix:-D_POSIX_SOURCE}"
#undef CC1_SPEC
#define CC1_SPEC "%(cc1_cpu)"
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 4bb0429f731..d2500a19944 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -56,6 +56,8 @@ along with GCC; see the file COPYING3. If not see
#include "debug.h"
#include "dwarf2out.h"
#include "sched-int.h"
+#include "sbitmap.h"
+#include "fibheap.h"
enum upper_128bits_state
{
@@ -73,6 +75,10 @@ typedef struct block_info_def
bool unchanged;
/* TRUE if block has been processed. */
bool processed;
+ /* TRUE if block has been scanned. */
+ bool scanned;
+ /* Previous state of the upper 128bits of AVX registers at entry. */
+ enum upper_128bits_state prev;
} *block_info;
#define BLOCK_INFO(B) ((block_info) (B)->aux)
@@ -135,6 +141,16 @@ move_or_delete_vzeroupper_2 (basic_block bb,
return;
}
+ if (BLOCK_INFO (bb)->scanned && BLOCK_INFO (bb)->prev == state)
+ {
+ if (dump_file)
+ fprintf (dump_file, " [bb %i] scanned: upper 128bits: %d\n",
+ bb->index, BLOCK_INFO (bb)->state);
+ return;
+ }
+
+ BLOCK_INFO (bb)->prev = state;
+
if (dump_file)
fprintf (dump_file, " [bb %i] entry: upper 128bits: %d\n",
bb->index, state);
@@ -264,6 +280,7 @@ move_or_delete_vzeroupper_2 (basic_block bb,
BLOCK_INFO (bb)->state = state;
BLOCK_INFO (bb)->unchanged = unchanged;
+ BLOCK_INFO (bb)->scanned = true;
if (dump_file)
fprintf (dump_file, " [bb %i] exit: %s: upper 128bits: %d\n",
@@ -273,9 +290,10 @@ move_or_delete_vzeroupper_2 (basic_block bb,
/* Helper function for move_or_delete_vzeroupper. Process vzeroupper
in BLOCK and check its predecessor blocks. Treat UNKNOWN state
- as USED if UNKNOWN_IS_UNUSED is true. */
+ as USED if UNKNOWN_IS_UNUSED is true. Return TRUE if the exit
+ state is changed. */
-static void
+static bool
move_or_delete_vzeroupper_1 (basic_block block, bool unknown_is_unused)
{
edge e;
@@ -288,7 +306,7 @@ move_or_delete_vzeroupper_1 (basic_block block, bool unknown_is_unused)
block->index, BLOCK_INFO (block)->processed);
if (BLOCK_INFO (block)->processed)
- return;
+ return false;
state = unused;
@@ -324,8 +342,14 @@ done:
/* Need to rescan if the upper 128bits of AVX registers are changed
to USED at exit. */
- if (new_state != old_state && new_state == used)
- cfun->machine->rescan_vzeroupper_p = 1;
+ if (new_state != old_state)
+ {
+ if (new_state == used)
+ cfun->machine->rescan_vzeroupper_p = 1;
+ return true;
+ }
+ else
+ return false;
}
/* Go through the instruction stream looking for vzeroupper. Delete
@@ -338,14 +362,18 @@ move_or_delete_vzeroupper (void)
edge e;
edge_iterator ei;
basic_block bb;
- unsigned int count;
+ fibheap_t worklist, pending, fibheap_swap;
+ sbitmap visited, in_worklist, in_pending, sbitmap_swap;
+ int *bb_order;
+ int *rc_order;
+ int i;
/* Set up block info for each basic block. */
alloc_aux_for_blocks (sizeof (struct block_info_def));
- /* Process successor blocks of all entry points. */
+ /* Process outgoing edges of entry point. */
if (dump_file)
- fprintf (dump_file, "Process all entry points\n");
+ fprintf (dump_file, "Process outgoing edges of entry point\n");
FOR_EACH_EDGE (e, ei, ENTRY_BLOCK_PTR->succs)
{
@@ -355,25 +383,102 @@ move_or_delete_vzeroupper (void)
BLOCK_INFO (e->dest)->processed = true;
}
- /* Process all basic blocks. */
- count = 0;
- do
+ /* Compute reverse completion order of depth first search of the CFG
+ so that the data-flow runs faster. */
+ rc_order = XNEWVEC (int, n_basic_blocks - NUM_FIXED_BLOCKS);
+ bb_order = XNEWVEC (int, last_basic_block);
+ pre_and_rev_post_order_compute (NULL, rc_order, false);
+ for (i = 0; i < n_basic_blocks - NUM_FIXED_BLOCKS; i++)
+ bb_order[rc_order[i]] = i;
+ free (rc_order);
+
+ worklist = fibheap_new ();
+ pending = fibheap_new ();
+ visited = sbitmap_alloc (last_basic_block);
+ in_worklist = sbitmap_alloc (last_basic_block);
+ in_pending = sbitmap_alloc (last_basic_block);
+ sbitmap_zero (in_worklist);
+
+ /* Don't check outgoing edges of entry point. */
+ sbitmap_ones (in_pending);
+ FOR_EACH_BB (bb)
+ if (BLOCK_INFO (bb)->processed)
+ RESET_BIT (in_pending, bb->index);
+ else
+ {
+ move_or_delete_vzeroupper_1 (bb, false);
+ fibheap_insert (pending, bb_order[bb->index], bb);
+ }
+
+ if (dump_file)
+ fprintf (dump_file, "Check remaining basic blocks\n");
+
+ while (!fibheap_empty (pending))
{
- if (dump_file)
- fprintf (dump_file, "Process all basic blocks: trip %d\n",
- count);
+ fibheap_swap = pending;
+ pending = worklist;
+ worklist = fibheap_swap;
+ sbitmap_swap = in_pending;
+ in_pending = in_worklist;
+ in_worklist = sbitmap_swap;
+
+ sbitmap_zero (visited);
+
cfun->machine->rescan_vzeroupper_p = 0;
- FOR_EACH_BB (bb)
- move_or_delete_vzeroupper_1 (bb, false);
+
+ while (!fibheap_empty (worklist))
+ {
+ bb = (basic_block) fibheap_extract_min (worklist);
+ RESET_BIT (in_worklist, bb->index);
+ gcc_assert (!TEST_BIT (visited, bb->index));
+ if (!TEST_BIT (visited, bb->index))
+ {
+ edge_iterator ei;
+
+ SET_BIT (visited, bb->index);
+
+ if (move_or_delete_vzeroupper_1 (bb, false))
+ FOR_EACH_EDGE (e, ei, bb->succs)
+ {
+ if (e->dest == EXIT_BLOCK_PTR
+ || BLOCK_INFO (e->dest)->processed)
+ continue;
+
+ if (TEST_BIT (visited, e->dest->index))
+ {
+ if (!TEST_BIT (in_pending, e->dest->index))
+ {
+ /* Send E->DEST to next round. */
+ SET_BIT (in_pending, e->dest->index);
+ fibheap_insert (pending,
+ bb_order[e->dest->index],
+ e->dest);
+ }
+ }
+ else if (!TEST_BIT (in_worklist, e->dest->index))
+ {
+ /* Add E->DEST to current round. */
+ SET_BIT (in_worklist, e->dest->index);
+ fibheap_insert (worklist, bb_order[e->dest->index],
+ e->dest);
+ }
+ }
+ }
+ }
+
+ if (!cfun->machine->rescan_vzeroupper_p)
+ break;
}
- while (cfun->machine->rescan_vzeroupper_p && count++ < 20);
- /* FIXME: Is 20 big enough? */
- if (count >= 20)
- gcc_unreachable ();
+ free (bb_order);
+ fibheap_delete (worklist);
+ fibheap_delete (pending);
+ sbitmap_free (visited);
+ sbitmap_free (in_worklist);
+ sbitmap_free (in_pending);
if (dump_file)
- fprintf (dump_file, "Process all basic blocks\n");
+ fprintf (dump_file, "Process remaining basic blocks\n");
FOR_EACH_BB (bb)
move_or_delete_vzeroupper_1 (bb, true);
@@ -5388,7 +5493,7 @@ ix86_function_regparm (const_tree type, const_tree decl)
{
/* FIXME: remove this CONST_CAST when cgraph.[ch] is constified. */
struct cgraph_local_info *i = cgraph_local_info (CONST_CAST_TREE (decl));
- if (i && i->local)
+ if (i && i->local && i->can_change_signature)
{
int local_regparm, globals = 0, regno;
@@ -5465,7 +5570,7 @@ ix86_function_sseregparm (const_tree type, const_tree decl, bool warn)
{
/* FIXME: remove this CONST_CAST when cgraph.[ch] is constified. */
struct cgraph_local_info *i = cgraph_local_info (CONST_CAST_TREE(decl));
- if (i && i->local)
+ if (i && i->local && i->can_change_signature)
return TARGET_SSE2 ? 2 : 1;
}
@@ -5849,7 +5954,7 @@ init_cumulative_args (CUMULATIVE_ARGS *cum, /* Argument info to initialize */
va_start so for local functions maybe_vaarg can be made aggressive
helping K&R code.
FIXME: once typesytem is fixed, we won't need this code anymore. */
- if (i && i->local)
+ if (i && i->local && i->can_change_signature)
fntype = TREE_TYPE (fndecl);
cum->maybe_vaarg = (fntype
? (!prototype_p (fntype) || stdarg_p (fntype))
@@ -9202,7 +9307,13 @@ ix86_compute_frame_layout (struct ix86_frame *frame)
offset += frame->va_arg_size;
/* Align start of frame for local function. */
- offset = (offset + stack_alignment_needed - 1) & -stack_alignment_needed;
+ if (stack_realign_fp
+ || offset != frame->sse_reg_save_offset
+ || size != 0
+ || !current_function_is_leaf
+ || cfun->calls_alloca
+ || ix86_current_function_calls_tls_descriptor)
+ offset = (offset + stack_alignment_needed - 1) & -stack_alignment_needed;
/* Frame pointer points here. */
frame->frame_pointer_offset = offset;
@@ -22933,8 +23044,9 @@ ix86_local_alignment (tree exp, enum machine_mode mode,
&& TARGET_SSE)
{
if (AGGREGATE_TYPE_P (type)
- && (TYPE_MAIN_VARIANT (type)
- != TYPE_MAIN_VARIANT (va_list_type_node))
+ && (va_list_type_node == NULL_TREE
+ || (TYPE_MAIN_VARIANT (type)
+ != TYPE_MAIN_VARIANT (va_list_type_node)))
&& TYPE_SIZE (type)
&& TREE_CODE (TYPE_SIZE (type)) == INTEGER_CST
&& (TREE_INT_CST_LOW (TYPE_SIZE (type)) >= 16
@@ -24227,6 +24339,9 @@ enum ix86_builtins
IX86_BUILTIN_CVTPS2PH,
IX86_BUILTIN_CVTPS2PH256,
+ /* CFString built-in for darwin */
+ IX86_BUILTIN_CFSTRING,
+
IX86_BUILTIN_MAX
};
@@ -28183,7 +28298,8 @@ ix86_secondary_reload (bool in_p, rtx x, reg_class_t rclass,
{
/* QImode spills from non-QI registers require
intermediate register on 32bit targets. */
- if (!in_p && mode == QImode && !TARGET_64BIT
+ if (!TARGET_64BIT
+ && !in_p && mode == QImode
&& (rclass == GENERAL_REGS
|| rclass == LEGACY_REGS
|| rclass == INDEX_REGS))
@@ -28203,6 +28319,45 @@ ix86_secondary_reload (bool in_p, rtx x, reg_class_t rclass,
return Q_REGS;
}
+ /* This condition handles corner case where an expression involving
+ pointers gets vectorized. We're trying to use the address of a
+ stack slot as a vector initializer.
+
+ (set (reg:V2DI 74 [ vect_cst_.2 ])
+ (vec_duplicate:V2DI (reg/f:DI 20 frame)))
+
+ Eventually frame gets turned into sp+offset like this:
+
+ (set (reg:V2DI 21 xmm0 [orig:74 vect_cst_.2 ] [74])
+ (vec_duplicate:V2DI (plus:DI (reg/f:DI 7 sp)
+ (const_int 392 [0x188]))))
+
+ That later gets turned into:
+
+ (set (reg:V2DI 21 xmm0 [orig:74 vect_cst_.2 ] [74])
+ (vec_duplicate:V2DI (plus:DI (reg/f:DI 7 sp)
+ (mem/u/c/i:DI (symbol_ref/u:DI ("*.LC0") [flags 0x2]) [0 S8 A64]))))
+
+ We'll have the following reload recorded:
+
+ Reload 0: reload_in (DI) =
+ (plus:DI (reg/f:DI 7 sp)
+ (mem/u/c/i:DI (symbol_ref/u:DI ("*.LC0") [flags 0x2]) [0 S8 A64]))
+ reload_out (V2DI) = (reg:V2DI 21 xmm0 [orig:74 vect_cst_.2 ] [74])
+ SSE_REGS, RELOAD_OTHER (opnum = 0), can't combine
+ reload_in_reg: (plus:DI (reg/f:DI 7 sp) (const_int 392 [0x188]))
+ reload_out_reg: (reg:V2DI 21 xmm0 [orig:74 vect_cst_.2 ] [74])
+ reload_reg_rtx: (reg:V2DI 22 xmm1)
+
+ Which isn't going to work since SSE instructions can't handle scalar
+ additions. Returning GENERAL_REGS forces the addition into integer
+ register and reload can handle subsequent reloads without problems. */
+
+ if (in_p && GET_CODE (x) == PLUS
+ && SSE_CLASS_P (rclass)
+ && SCALAR_INT_MODE_P (mode))
+ return GENERAL_REGS;
+
return NO_REGS;
}
@@ -33684,7 +33839,7 @@ ix86_canonical_va_list_type (tree type)
else if (POINTER_TYPE_P (type) && TREE_CODE (TREE_TYPE (type)) == ARRAY_TYPE)
type = TREE_TYPE (type);
- if (TARGET_64BIT)
+ if (TARGET_64BIT && va_list_type_node != NULL_TREE)
{
wtype = va_list_type_node;
gcc_assert (wtype != NULL_TREE);
@@ -34936,6 +35091,11 @@ ix86_autovectorize_vector_sizes (void)
#undef TARGET_CONDITIONAL_REGISTER_USAGE
#define TARGET_CONDITIONAL_REGISTER_USAGE ix86_conditional_register_usage
+#if TARGET_MACHO
+#undef TARGET_INIT_LIBFUNCS
+#define TARGET_INIT_LIBFUNCS darwin_rename_builtins
+#endif
+
struct gcc_target targetm = TARGET_INITIALIZER;
#include "gt-i386.h"
diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
index 1f14f5ce4d7..a17ab7aceee 100644
--- a/gcc/config/i386/i386.md
+++ b/gcc/config/i386/i386.md
@@ -1,6 +1,6 @@
;; GCC machine description for IA-32 and x86-64.
;; Copyright (C) 1988, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
-;; 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
+;; 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
;; Free Software Foundation, Inc.
;; Mostly by William Schelter.
;; x86_64 support added by Jan Hubicka
@@ -17461,7 +17461,7 @@
(plus (match_dup 0)
(match_operand 4 "x86_64_general_operand" "")))
(clobber (reg:CC FLAGS_REG))])]
- "INTVAL (operands[2]) >= 0 && INTVAL (operands[2]) <= 3
+ "IN_RANGE (INTVAL (operands[2]), 1, 3)
/* Validate MODE for lea. */
&& ((!TARGET_PARTIAL_REG_STALL
&& (GET_MODE (operands[0]) == QImode
@@ -17475,7 +17475,8 @@
[(set (match_dup 5) (match_dup 4))
(set (match_dup 0) (match_dup 1))]
{
- enum machine_mode mode = GET_MODE (operands[1]) == DImode ? DImode : SImode;
+ enum machine_mode op1mode = GET_MODE (operands[1]);
+ enum machine_mode mode = op1mode == DImode ? DImode : SImode;
int scale = 1 << INTVAL (operands[2]);
rtx index = gen_lowpart (Pmode, operands[1]);
rtx base = gen_lowpart (Pmode, operands[5]);
@@ -17485,10 +17486,9 @@
gen_rtx_MULT (Pmode, index, GEN_INT (scale)));
operands[5] = base;
if (mode != Pmode)
- {
- operands[1] = gen_rtx_SUBREG (mode, operands[1], 0);
- operands[5] = gen_rtx_SUBREG (mode, operands[5], 0);
- }
+ operands[1] = gen_rtx_SUBREG (mode, operands[1], 0);
+ if (op1mode != Pmode)
+ operands[5] = gen_rtx_SUBREG (op1mode, operands[5], 0);
operands[0] = dest;
})
diff --git a/gcc/config/i386/mach.h b/gcc/config/i386/mach.h
deleted file mode 100644
index 75d4a81c1b4..00000000000
--- a/gcc/config/i386/mach.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/* Configuration for an i386 running Mach as the target machine.
-
-Copyright (C) 1992, 1993, 1997, 1998, 2000, 2001,
-2002 Free Software Foundation, Inc.
-
-This file is part of GCC.
-
-GCC is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free
-Software Foundation; either version 3, or (at your option) any later
-version.
-
-GCC is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-for more details.
-
-Under Section 7 of GPL version 3, you are granted additional
-permissions described in the GCC Runtime Library Exception, version
-3.1, as published by the Free Software Foundation.
-
-You should have received a copy of the GNU General Public License and
-a copy of the GCC Runtime Library Exception along with this program;
-see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
-<http://www.gnu.org/licenses/>. */
-
-#define TARGET_VERSION fprintf (stderr, " (80386, Mach)");
-
-#define TARGET_OS_CPP_BUILTINS() \
- do \
- { \
- builtin_define_std ("unix"); \
- builtin_define_std ("MACH"); \
- builtin_assert ("system=unix"); \
- builtin_assert ("system=mach"); \
- } \
- while (0)
-
-/* Specify extra dir to search for include files. */
-#define SYSTEM_INCLUDE_DIR "/usr/mach/include"
-
-/* Don't default to pcc-struct-return, because gcc is the only compiler, and
- we want to retain compatibility with older gcc versions. */
-#define DEFAULT_PCC_STRUCT_RETURN 0
diff --git a/gcc/config/i386/netware.h b/gcc/config/i386/netware.h
index 72d9e340658..7f63f4518b3 100644
--- a/gcc/config/i386/netware.h
+++ b/gcc/config/i386/netware.h
@@ -1,6 +1,6 @@
/* Core target definitions for GCC for Intel 80x86 running Netware.
and using dwarf for the debugging format.
- Copyright (C) 1993, 1994, 2004, 2007, 2008, 2009, 2010
+ Copyright (C) 1993, 1994, 2004, 2007, 2008, 2009, 2010, 2011
Free Software Foundation, Inc.
Written by David V. Henkel-Wallace (gumby@cygnus.com)
@@ -34,8 +34,7 @@ along with GCC; see the file COPYING3. If not see
/* Kinda useless, but what the hell */
#undef LINK_SPEC
-#define LINK_SPEC "%{h*} %{v:-V} \
- %{Qy:} %{!Qn:-Qy}"
+#define LINK_SPEC "%{h*} %{v:-V}"
#undef STARTFILE_SPEC
#define STARTFILE_SPEC ""
diff --git a/gcc/config/i386/netware.opt b/gcc/config/i386/netware.opt
new file mode 100644
index 00000000000..e1d903a2f7f
--- /dev/null
+++ b/gcc/config/i386/netware.opt
@@ -0,0 +1,33 @@
+; Netware options.
+
+; Copyright (C) 2011
+; Free Software Foundation, Inc.
+;
+; This file is part of GCC.
+;
+; GCC is free software; you can redistribute it and/or modify it under
+; the terms of the GNU General Public License as published by the Free
+; Software Foundation; either version 3, or (at your option) any later
+; version.
+;
+; GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+; WARRANTY; without even the implied warranty of MERCHANTABILITY or
+; FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+; for more details.
+;
+; You should have received a copy of the GNU General Public License
+; along with GCC; see the file COPYING3. If not see
+; <http://www.gnu.org/licenses/>.
+
+; See the GCC internals manual (options.texi) for a description of
+; this file's format.
+
+; Please try to keep this file in ASCII collating order.
+
+posix
+Driver
+
+pthread
+Driver
+
+; This comment is to ensure we retain the blank line above.
diff --git a/gcc/config/i386/nto.opt b/gcc/config/i386/nto.opt
new file mode 100644
index 00000000000..ddfaa90c97f
--- /dev/null
+++ b/gcc/config/i386/nto.opt
@@ -0,0 +1,33 @@
+; QNX options.
+
+; Copyright (C) 2011
+; Free Software Foundation, Inc.
+;
+; This file is part of GCC.
+;
+; GCC is free software; you can redistribute it and/or modify it under
+; the terms of the GNU General Public License as published by the Free
+; Software Foundation; either version 3, or (at your option) any later
+; version.
+;
+; GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+; WARRANTY; without even the implied warranty of MERCHANTABILITY or
+; FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+; for more details.
+;
+; You should have received a copy of the GNU General Public License
+; along with GCC; see the file COPYING3. If not see
+; <http://www.gnu.org/licenses/>.
+
+; See the GCC internals manual (options.texi) for a description of
+; this file's format.
+
+; Please try to keep this file in ASCII collating order.
+
+G
+Driver
+
+YP,
+Driver Joined
+
+; This comment is to ensure we retain the blank line above.
diff --git a/gcc/config/i386/sol2-10.h b/gcc/config/i386/sol2-10.h
index e8f9dbaab2e..c3decd2ef24 100644
--- a/gcc/config/i386/sol2-10.h
+++ b/gcc/config/i386/sol2-10.h
@@ -1,5 +1,5 @@
/* Solaris 10 configuration.
- Copyright (C) 2004, 2006, 2007, 2008, 2009, 2010
+ Copyright (C) 2004, 2006, 2007, 2008, 2009, 2010, 2011
Free Software Foundation, Inc.
Contributed by CodeSourcery, LLC.
@@ -28,7 +28,7 @@ along with GCC; see the file COPYING3. If not see
#ifdef USE_GAS
#define ASM_SPEC "%{m32:--32} %{m64:--64} -s %(asm_cpu)"
#else
-#define ASM_SPEC "%{v:-V} %{Qy:} %{!Qn:-Qy} %{Ym,*} %{Yd,*} " \
+#define ASM_SPEC "%{v:-V} %{Qy:} %{!Qn:-Qy} %{Ym,*} " \
"%{m32:-xarch=generic} %{m64:-xarch=generic64} " \
"-s %(asm_cpu)"
#endif
diff --git a/gcc/config/i386/sol2.h b/gcc/config/i386/sol2.h
index 411e02dc8d5..baddbb0b929 100644
--- a/gcc/config/i386/sol2.h
+++ b/gcc/config/i386/sol2.h
@@ -1,6 +1,6 @@
/* Target definitions for GCC for Intel 80386 running Solaris 2
Copyright (C) 1993, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
- 2004, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+ 2004, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
Contributed by Fred Fish (fnf@cygnus.com).
This file is part of GCC.
@@ -137,9 +137,6 @@ along with GCC; see the file COPYING3. If not see
/* Register the Solaris-specific #pragma directives. */
#define REGISTER_SUBTARGET_PRAGMAS() solaris_register_pragmas ()
-/* Undo i386/sysv4.h version. */
-#undef SUBTARGET_RETURN_IN_MEMORY
-
/* Augment i386/unix.h version to return 8-byte vectors in memory, matching
Sun Studio compilers until version 12, the only ones supported on
Solaris 8 and 9. */
diff --git a/gcc/config/i386/sysv4.h b/gcc/config/i386/sysv4.h
index 63c0cbc85a7..64026e72b66 100644
--- a/gcc/config/i386/sysv4.h
+++ b/gcc/config/i386/sysv4.h
@@ -1,5 +1,6 @@
/* Target definitions for GCC for Intel 80386 running System V.4
- Copyright (C) 1991, 2001, 2002, 2007, 2008 Free Software Foundation, Inc.
+ Copyright (C) 1991, 2001, 2002, 2007, 2008, 2011
+ Free Software Foundation, Inc.
Written by Ron Guilmette (rfg@netcom.com).
@@ -19,16 +20,6 @@ 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/>. */
-
-#define TARGET_VERSION fprintf (stderr, " (i386 System V Release 4)");
-
-/* The svr4 ABI for the i386 says that records and unions are returned
- in memory. */
-
-#define SUBTARGET_RETURN_IN_MEMORY(TYPE, FNTYPE) \
- (TYPE_MODE (TYPE) == BLKmode \
- || (VECTOR_MODE_P (TYPE_MODE (TYPE)) && int_size_in_bytes (TYPE) == 8));
-
/* Output at beginning of assembler file. */
/* The .file command should always begin the output. */
@@ -39,56 +30,6 @@ along with GCC; see the file COPYING3. If not see
#undef DBX_REGISTER_NUMBER
#define DBX_REGISTER_NUMBER(n) svr4_dbx_register_map[n]
-/* The routine used to output sequences of byte values. We use a special
- version of this for most svr4 targets because doing so makes the
- generated assembly code more compact (and thus faster to assemble)
- as well as more readable. Note that if we find subparts of the
- character sequence which end with NUL (and which are shorter than
- STRING_LIMIT) we output those using ASM_OUTPUT_LIMITED_STRING. */
-
-#undef ASM_OUTPUT_ASCII
-#define ASM_OUTPUT_ASCII(FILE, STR, LENGTH) \
- do \
- { \
- const unsigned char *_ascii_bytes = \
- (const unsigned char *) (STR); \
- const unsigned char *limit = _ascii_bytes + (LENGTH); \
- unsigned bytes_in_chunk = 0; \
- for (; _ascii_bytes < limit; _ascii_bytes++) \
- { \
- const unsigned char *p; \
- if (bytes_in_chunk >= 64) \
- { \
- fputc ('\n', (FILE)); \
- bytes_in_chunk = 0; \
- } \
- for (p = _ascii_bytes; p < limit && *p != '\0'; p++) \
- continue; \
- if (p < limit && (p - _ascii_bytes) <= (long) STRING_LIMIT) \
- { \
- if (bytes_in_chunk > 0) \
- { \
- fputc ('\n', (FILE)); \
- bytes_in_chunk = 0; \
- } \
- ASM_OUTPUT_LIMITED_STRING ((FILE), _ascii_bytes); \
- _ascii_bytes = p; \
- } \
- else \
- { \
- if (bytes_in_chunk == 0) \
- fputs (ASM_BYTE, (FILE)); \
- else \
- fputc (',', (FILE)); \
- fprintf ((FILE), "0x%02x", *_ascii_bytes); \
- bytes_in_chunk += 5; \
- } \
- } \
- if (bytes_in_chunk > 0) \
- fputc ('\n', (FILE)); \
- } \
- while (0)
-
/* A C statement (sans semicolon) to output to the stdio stream
FILE the assembler definition of uninitialized global DECL named
NAME whose size is SIZE bytes and alignment is ALIGN bytes.
diff --git a/gcc/config/i386/t-cygming b/gcc/config/i386/t-cygming
index 6d54e4971a6..ccae237d301 100644
--- a/gcc/config/i386/t-cygming
+++ b/gcc/config/i386/t-cygming
@@ -72,6 +72,11 @@ SHLIB_MAP = @shlib_map_file@
SHLIB_OBJS = @shlib_objs@
SHLIB_DIR = @multilib_dir@/shlib
SHLIB_SLIBDIR_QUAL = @shlib_slibdir_qual@
+# SHLIB_DLLDIR is defined by including one of either t-dlldir or t-dlldir-x
+# (native/cross build respectively) in the tmake_file list in gcc/config.gcc.
+ifndef SHLIB_DLLDIR
+$(error SHLIB_DLLDIR must be defined)
+endif
SHLIB_LINK = $(LN_S) -f $(SHLIB_MAP) $(SHLIB_MAP).def && \
if [ ! -d $(SHLIB_DIR) ]; then \
@@ -91,9 +96,10 @@ SHLIB_LINK = $(LN_S) -f $(SHLIB_MAP) $(SHLIB_MAP).def && \
# $(slibdir) double quoted to protect it from expansion while building
# libgcc.mk. We want this delayed until actual install time.
SHLIB_INSTALL = \
- $$(mkinstalldirs) $$(DESTDIR)$$(slibdir)$(SHLIB_SLIBDIR_QUAL); \
+ $$(mkinstalldirs) $$(DESTDIR)$$(SHLIB_DLLDIR) \
+ $$(DESTDIR)$$(slibdir)$(SHLIB_SLIBDIR_QUAL); \
$(INSTALL) $(SHLIB_DIR)/$(SHLIB_SONAME) \
- $$(DESTDIR)$$(bindir)/$(SHLIB_SONAME); \
+ $$(DESTDIR)$$(SHLIB_DLLDIR)/$(SHLIB_SONAME); \
$(INSTALL_DATA) $(SHLIB_DIR)/$(SHLIB_IMPLIB) \
$$(DESTDIR)$$(slibdir)$(SHLIB_SLIBDIR_QUAL)/$(SHLIB_IMPLIB)
SHLIB_MKMAP = $(srcdir)/mkmap-flat.awk
diff --git a/gcc/config/i386/t-dlldir b/gcc/config/i386/t-dlldir
new file mode 100644
index 00000000000..a3e03317a04
--- /dev/null
+++ b/gcc/config/i386/t-dlldir
@@ -0,0 +1,6 @@
+
+# In a native build, target DLLs go in bindir, where they can be executed.
+# Note double quoting to prevent variables from being evaluated until install
+# time; we don't want to expand them during libgcc.mvars generation.
+
+SHLIB_DLLDIR = $$(bindir)
diff --git a/gcc/config/i386/t-dlldir-x b/gcc/config/i386/t-dlldir-x
new file mode 100644
index 00000000000..07dd845f0a6
--- /dev/null
+++ b/gcc/config/i386/t-dlldir-x
@@ -0,0 +1,9 @@
+
+# In a cross build, bindir contains host not target binaries, so target DLLs
+# instead go in toolexeclibdir, alongside other target binaries and static libs.
+# Note double quoting to prevent variables from being evaluated until install
+# time; we don't want to expand them during libgcc.mvars generation, and in
+# any case, $toolexeclibdir is not defined in the gcc/ subdirectory, only in
+# target lib directories.
+
+SHLIB_DLLDIR = $$(toolexeclibdir)
diff --git a/gcc/config/i386/t-i386 b/gcc/config/i386/t-i386
index 6c801a597d6..1c658a149df 100644
--- a/gcc/config/i386/t-i386
+++ b/gcc/config/i386/t-i386
@@ -23,7 +23,7 @@ i386.o: $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(RECOG_H) $(EXPR_H) $(OPTABS_H) toplev.h $(BASIC_BLOCK_H) \
$(GGC_H) $(TARGET_H) $(TARGET_DEF_H) langhooks.h $(CGRAPH_H) \
$(TREE_GIMPLE_H) $(DWARF2_H) $(DF_H) tm-constrs.h $(PARAMS_H) \
- i386-builtin-types.inc debug.h dwarf2out.h
+ i386-builtin-types.inc debug.h dwarf2out.h sbitmap.h $(FIBHEAP_H)
i386-c.o: $(srcdir)/config/i386/i386-c.c \
$(srcdir)/config/i386/i386-protos.h $(CONFIG_H) $(SYSTEM_H) coretypes.h \
diff --git a/gcc/config/ia64/ia64-protos.h b/gcc/config/ia64/ia64-protos.h
index 87e04a23d76..107a7ccb983 100644
--- a/gcc/config/ia64/ia64-protos.h
+++ b/gcc/config/ia64/ia64-protos.h
@@ -39,9 +39,9 @@ extern bool ia64_expand_movxf_movrf (enum machine_mode, rtx[]);
extern void ia64_expand_compare (rtx *, rtx *, rtx *);
extern void ia64_expand_vecint_cmov (rtx[]);
extern bool ia64_expand_vecint_minmax (enum rtx_code, enum machine_mode, rtx[]);
+extern void ia64_unpack_assemble (rtx, rtx, rtx, bool);
extern void ia64_expand_unpack (rtx [], bool, bool);
extern void ia64_expand_widen_sum (rtx[], bool);
-extern void ia64_expand_widen_mul_v4hi (rtx [], bool, bool);
extern void ia64_expand_dot_prod_v8qi (rtx[], bool);
extern void ia64_expand_call (rtx, rtx, rtx, int);
extern void ia64_split_call (rtx, rtx, rtx, rtx, rtx, int, int);
diff --git a/gcc/config/ia64/ia64.c b/gcc/config/ia64/ia64.c
index 1842555502b..1d3f8b18d34 100644
--- a/gcc/config/ia64/ia64.c
+++ b/gcc/config/ia64/ia64.c
@@ -1972,12 +1972,13 @@ ia64_expand_vecint_minmax (enum rtx_code code, enum machine_mode mode,
return true;
}
-/* Emit an integral vector unpack operation. */
+/* The vectors LO and HI each contain N halves of a double-wide vector.
+ Reassemble either the first N/2 or the second N/2 elements. */
void
-ia64_expand_unpack (rtx operands[3], bool unsignedp, bool highp)
+ia64_unpack_assemble (rtx out, rtx lo, rtx hi, bool highp)
{
- enum machine_mode mode = GET_MODE (operands[1]);
+ enum machine_mode mode = GET_MODE (lo);
rtx (*gen) (rtx, rtx, rtx);
rtx x;
@@ -1993,110 +1994,66 @@ ia64_expand_unpack (rtx operands[3], bool unsignedp, bool highp)
gcc_unreachable ();
}
- /* Fill in x with the sign extension of each element in op1. */
- if (unsignedp)
- x = CONST0_RTX (mode);
- else
- {
- bool neg;
-
- x = gen_reg_rtx (mode);
-
- neg = ia64_expand_vecint_compare (LT, mode, x, operands[1],
- CONST0_RTX (mode));
- gcc_assert (!neg);
- }
-
+ x = gen_lowpart (mode, out);
if (TARGET_BIG_ENDIAN)
- emit_insn (gen (gen_lowpart (mode, operands[0]), x, operands[1]));
+ x = gen (x, hi, lo);
else
- emit_insn (gen (gen_lowpart (mode, operands[0]), operands[1], x));
+ x = gen (x, lo, hi);
+ emit_insn (x);
}
-/* Emit an integral vector widening sum operations. */
+/* Return a vector of the sign-extension of VEC. */
-void
-ia64_expand_widen_sum (rtx operands[3], bool unsignedp)
+static rtx
+ia64_unpack_sign (rtx vec, bool unsignedp)
{
- rtx l, h, x, s;
- enum machine_mode wmode, mode;
- rtx (*unpack_l) (rtx, rtx, rtx);
- rtx (*unpack_h) (rtx, rtx, rtx);
- rtx (*plus) (rtx, rtx, rtx);
-
- wmode = GET_MODE (operands[0]);
- mode = GET_MODE (operands[1]);
+ enum machine_mode mode = GET_MODE (vec);
+ rtx zero = CONST0_RTX (mode);
- switch (mode)
- {
- case V8QImode:
- unpack_l = gen_vec_interleave_lowv8qi;
- unpack_h = gen_vec_interleave_highv8qi;
- plus = gen_addv4hi3;
- break;
- case V4HImode:
- unpack_l = gen_vec_interleave_lowv4hi;
- unpack_h = gen_vec_interleave_highv4hi;
- plus = gen_addv2si3;
- break;
- default:
- gcc_unreachable ();
- }
-
- /* Fill in x with the sign extension of each element in op1. */
if (unsignedp)
- x = CONST0_RTX (mode);
+ return zero;
else
{
+ rtx sign = gen_reg_rtx (mode);
bool neg;
- x = gen_reg_rtx (mode);
-
- neg = ia64_expand_vecint_compare (LT, mode, x, operands[1],
- CONST0_RTX (mode));
+ neg = ia64_expand_vecint_compare (LT, mode, sign, vec, zero);
gcc_assert (!neg);
+
+ return sign;
}
+}
- l = gen_reg_rtx (wmode);
- h = gen_reg_rtx (wmode);
- s = gen_reg_rtx (wmode);
+/* Emit an integral vector unpack operation. */
- if (TARGET_BIG_ENDIAN)
- {
- emit_insn (unpack_l (gen_lowpart (mode, l), x, operands[1]));
- emit_insn (unpack_h (gen_lowpart (mode, h), x, operands[1]));
- }
- else
- {
- emit_insn (unpack_l (gen_lowpart (mode, l), operands[1], x));
- emit_insn (unpack_h (gen_lowpart (mode, h), operands[1], x));
- }
- emit_insn (plus (s, l, operands[2]));
- emit_insn (plus (operands[0], h, s));
+void
+ia64_expand_unpack (rtx operands[3], bool unsignedp, bool highp)
+{
+ rtx sign = ia64_unpack_sign (operands[1], unsignedp);
+ ia64_unpack_assemble (operands[0], operands[1], sign, highp);
}
+/* Emit an integral vector widening sum operations. */
+
void
-ia64_expand_widen_mul_v4hi (rtx operands[3], bool unsignedp, bool highp)
+ia64_expand_widen_sum (rtx operands[3], bool unsignedp)
{
- rtx l = gen_reg_rtx (V4HImode);
- rtx h = gen_reg_rtx (V4HImode);
- rtx (*mulhigh)(rtx, rtx, rtx, rtx);
- rtx (*interl)(rtx, rtx, rtx);
+ enum machine_mode wmode;
+ rtx l, h, t, sign;
- emit_insn (gen_mulv4hi3 (l, operands[1], operands[2]));
+ sign = ia64_unpack_sign (operands[1], unsignedp);
+
+ wmode = GET_MODE (operands[0]);
+ l = gen_reg_rtx (wmode);
+ h = gen_reg_rtx (wmode);
- /* For signed, pmpy2.r would appear to more closely match this operation.
- However, the vectorizer is more likely to use the LO and HI patterns
- in pairs. At which point, with this formulation, the first two insns
- of each can be CSEd. */
- mulhigh = unsignedp ? gen_pmpyshr2_u : gen_pmpyshr2;
- emit_insn (mulhigh (h, operands[1], operands[2], GEN_INT (16)));
+ ia64_unpack_assemble (l, operands[1], sign, false);
+ ia64_unpack_assemble (h, operands[1], sign, true);
- interl = highp ? gen_vec_interleave_highv4hi : gen_vec_interleave_lowv4hi;
- if (TARGET_BIG_ENDIAN)
- emit_insn (interl (gen_lowpart (V4HImode, operands[0]), h, l));
- else
- emit_insn (interl (gen_lowpart (V4HImode, operands[0]), l, h));
+ t = expand_binop (wmode, add_optab, l, operands[2], NULL, 0, OPTAB_DIRECT);
+ t = expand_binop (wmode, add_optab, h, t, operands[0], 0, OPTAB_DIRECT);
+ if (t != operands[0])
+ emit_move_insn (operands[0], t);
}
/* Emit a signed or unsigned V8QI dot product operation. */
@@ -2104,62 +2061,31 @@ ia64_expand_widen_mul_v4hi (rtx operands[3], bool unsignedp, bool highp)
void
ia64_expand_dot_prod_v8qi (rtx operands[4], bool unsignedp)
{
- rtx l1, l2, h1, h2, x1, x2, p1, p2, p3, p4, s1, s2, s3;
+ rtx op1, op2, sn1, sn2, l1, l2, h1, h2;
+ rtx p1, p2, p3, p4, s1, s2, s3;
- /* Fill in x1 and x2 with the sign extension of each element. */
- if (unsignedp)
- x1 = x2 = CONST0_RTX (V8QImode);
- else
- {
- bool neg;
-
- x1 = gen_reg_rtx (V8QImode);
- x2 = gen_reg_rtx (V8QImode);
-
- neg = ia64_expand_vecint_compare (LT, V8QImode, x1, operands[1],
- CONST0_RTX (V8QImode));
- gcc_assert (!neg);
- neg = ia64_expand_vecint_compare (LT, V8QImode, x2, operands[2],
- CONST0_RTX (V8QImode));
- gcc_assert (!neg);
- }
+ op1 = operands[1];
+ op2 = operands[2];
+ sn1 = ia64_unpack_sign (op1, unsignedp);
+ sn2 = ia64_unpack_sign (op2, unsignedp);
l1 = gen_reg_rtx (V4HImode);
l2 = gen_reg_rtx (V4HImode);
h1 = gen_reg_rtx (V4HImode);
h2 = gen_reg_rtx (V4HImode);
-
- if (TARGET_BIG_ENDIAN)
- {
- emit_insn (gen_vec_interleave_lowv8qi
- (gen_lowpart (V8QImode, l1), x1, operands[1]));
- emit_insn (gen_vec_interleave_lowv8qi
- (gen_lowpart (V8QImode, l2), x2, operands[2]));
- emit_insn (gen_vec_interleave_highv8qi
- (gen_lowpart (V8QImode, h1), x1, operands[1]));
- emit_insn (gen_vec_interleave_highv8qi
- (gen_lowpart (V8QImode, h2), x2, operands[2]));
- }
- else
- {
- emit_insn (gen_vec_interleave_lowv8qi
- (gen_lowpart (V8QImode, l1), operands[1], x1));
- emit_insn (gen_vec_interleave_lowv8qi
- (gen_lowpart (V8QImode, l2), operands[2], x2));
- emit_insn (gen_vec_interleave_highv8qi
- (gen_lowpart (V8QImode, h1), operands[1], x1));
- emit_insn (gen_vec_interleave_highv8qi
- (gen_lowpart (V8QImode, h2), operands[2], x2));
- }
+ ia64_unpack_assemble (l1, op1, sn1, false);
+ ia64_unpack_assemble (l2, op2, sn2, false);
+ ia64_unpack_assemble (h1, op1, sn1, true);
+ ia64_unpack_assemble (h2, op2, sn2, true);
p1 = gen_reg_rtx (V2SImode);
p2 = gen_reg_rtx (V2SImode);
p3 = gen_reg_rtx (V2SImode);
p4 = gen_reg_rtx (V2SImode);
- emit_insn (gen_pmpy2_r (p1, l1, l2));
- emit_insn (gen_pmpy2_l (p2, l1, l2));
- emit_insn (gen_pmpy2_r (p3, h1, h2));
- emit_insn (gen_pmpy2_l (p4, h1, h2));
+ emit_insn (gen_pmpy2_even (p1, l1, l2));
+ emit_insn (gen_pmpy2_even (p2, h1, h2));
+ emit_insn (gen_pmpy2_odd (p3, l1, l2));
+ emit_insn (gen_pmpy2_odd (p4, h1, h2));
s1 = gen_reg_rtx (V2SImode);
s2 = gen_reg_rtx (V2SImode);
diff --git a/gcc/config/ia64/predicates.md b/gcc/config/ia64/predicates.md
index e06c521a056..6622b2001f4 100644
--- a/gcc/config/ia64/predicates.md
+++ b/gcc/config/ia64/predicates.md
@@ -624,3 +624,7 @@
return REG_P (op) && REG_POINTER (op);
})
+;; True if this is the right-most vector element; for mux1 @brcst.
+(define_predicate "mux1_brcst_element"
+ (and (match_code "const_int")
+ (match_test "INTVAL (op) == (TARGET_BIG_ENDIAN ? 7 : 0)")))
diff --git a/gcc/config/ia64/vect.md b/gcc/config/ia64/vect.md
index 36db5753e1c..1684c8092c2 100644
--- a/gcc/config/ia64/vect.md
+++ b/gcc/config/ia64/vect.md
@@ -172,35 +172,14 @@
(match_operand:V8QI 2 "gr_register_operand" "r")))]
""
{
- rtx r1, l1, r2, l2, rm, lm;
-
- r1 = gen_reg_rtx (V4HImode);
- l1 = gen_reg_rtx (V4HImode);
- r2 = gen_reg_rtx (V4HImode);
- l2 = gen_reg_rtx (V4HImode);
-
- /* Zero-extend the QImode elements into two words of HImode elements
- by interleaving them with zero bytes. */
- emit_insn (gen_mix1_r (gen_lowpart (V8QImode, r1),
- operands[1], CONST0_RTX (V8QImode)));
- emit_insn (gen_mix1_r (gen_lowpart (V8QImode, r2),
- operands[2], CONST0_RTX (V8QImode)));
- emit_insn (gen_mix1_l (gen_lowpart (V8QImode, l1),
- operands[1], CONST0_RTX (V8QImode)));
- emit_insn (gen_mix1_l (gen_lowpart (V8QImode, l2),
- operands[2], CONST0_RTX (V8QImode)));
-
- /* Multiply. */
- rm = gen_reg_rtx (V4HImode);
- lm = gen_reg_rtx (V4HImode);
- emit_insn (gen_mulv4hi3 (rm, r1, r2));
- emit_insn (gen_mulv4hi3 (lm, l1, l2));
-
- /* Zap the high order bytes of the HImode elements by overwriting those
- in one part with the low order bytes of the other. */
- emit_insn (gen_mix1_r (operands[0],
- gen_lowpart (V8QImode, rm),
- gen_lowpart (V8QImode, lm)));
+ rtx l = gen_reg_rtx (V4HImode);
+ rtx h = gen_reg_rtx (V4HImode);
+ emit_insn (gen_vec_widen_umult_lo_v8qi (l, operands[1], operands[2]));
+ emit_insn (gen_vec_widen_umult_hi_v8qi (h, operands[1], operands[2]));
+ if (TARGET_BIG_ENDIAN)
+ emit_insn (gen_vec_pack_trunc_v4hi (operands[0], h, l));
+ else
+ emit_insn (gen_vec_pack_trunc_v4hi (operands[0], l, h));
DONE;
})
@@ -296,7 +275,7 @@
"pmpyshr2.u %0 = %1, %2, %3"
[(set_attr "itanium_class" "mmmul")])
-(define_insn "pmpy2_r"
+(define_insn "pmpy2_even"
[(set (match_operand:V2SI 0 "gr_register_operand" "=r")
(mult:V2SI
(vec_select:V2SI
@@ -308,10 +287,16 @@
(match_operand:V4HI 2 "gr_register_operand" "r"))
(parallel [(const_int 0) (const_int 2)]))))]
""
- "pmpy2.r %0 = %1, %2"
+{
+ /* Recall that vector elements are numbered in memory order. */
+ if (TARGET_BIG_ENDIAN)
+ return "%,pmpy2.l %0 = %1, %2";
+ else
+ return "%,pmpy2.r %0 = %1, %2";
+}
[(set_attr "itanium_class" "mmshf")])
-(define_insn "pmpy2_l"
+(define_insn "pmpy2_odd"
[(set (match_operand:V2SI 0 "gr_register_operand" "=r")
(mult:V2SI
(vec_select:V2SI
@@ -323,7 +308,13 @@
(match_operand:V4HI 2 "gr_register_operand" "r"))
(parallel [(const_int 1) (const_int 3)]))))]
""
- "pmpy2.l %0 = %1, %2"
+{
+ /* Recall that vector elements are numbered in memory order. */
+ if (TARGET_BIG_ENDIAN)
+ return "%,pmpy2.r %0 = %1, %2";
+ else
+ return "%,pmpy2.l %0 = %1, %2";
+}
[(set_attr "itanium_class" "mmshf")])
(define_expand "vec_widen_smult_lo_v4hi"
@@ -332,7 +323,11 @@
(match_operand:V4HI 2 "gr_register_operand" "")]
""
{
- ia64_expand_widen_mul_v4hi (operands, false, false);
+ rtx l = gen_reg_rtx (V4HImode);
+ rtx h = gen_reg_rtx (V4HImode);
+ emit_insn (gen_mulv4hi3 (l, operands[1], operands[2]));
+ emit_insn (gen_pmpyshr2 (h, operands[1], operands[2], GEN_INT (16)));
+ ia64_unpack_assemble (operands[0], l, h, false);
DONE;
})
@@ -342,7 +337,11 @@
(match_operand:V4HI 2 "gr_register_operand" "")]
""
{
- ia64_expand_widen_mul_v4hi (operands, false, true);
+ rtx l = gen_reg_rtx (V4HImode);
+ rtx h = gen_reg_rtx (V4HImode);
+ emit_insn (gen_mulv4hi3 (l, operands[1], operands[2]));
+ emit_insn (gen_pmpyshr2 (h, operands[1], operands[2], GEN_INT (16)));
+ ia64_unpack_assemble (operands[0], l, h, true);
DONE;
})
@@ -352,7 +351,11 @@
(match_operand:V4HI 2 "gr_register_operand" "")]
""
{
- ia64_expand_widen_mul_v4hi (operands, true, false);
+ rtx l = gen_reg_rtx (V4HImode);
+ rtx h = gen_reg_rtx (V4HImode);
+ emit_insn (gen_mulv4hi3 (l, operands[1], operands[2]));
+ emit_insn (gen_pmpyshr2_u (h, operands[1], operands[2], GEN_INT (16)));
+ ia64_unpack_assemble (operands[0], l, h, false);
DONE;
})
@@ -362,7 +365,11 @@
(match_operand:V4HI 2 "gr_register_operand" "")]
""
{
- ia64_expand_widen_mul_v4hi (operands, true, true);
+ rtx l = gen_reg_rtx (V4HImode);
+ rtx h = gen_reg_rtx (V4HImode);
+ emit_insn (gen_mulv4hi3 (l, operands[1], operands[2]));
+ emit_insn (gen_pmpyshr2_u (h, operands[1], operands[2], GEN_INT (16)));
+ ia64_unpack_assemble (operands[0], l, h, true);
DONE;
})
@@ -370,7 +377,7 @@
[(set (match_operand:V2SI 0 "gr_register_operand" "")
(mult:V2SI (match_operand:V2SI 1 "gr_register_operand" "r")
(match_operand:V2SI 2 "gr_register_operand" "r")))]
- "!TARGET_BIG_ENDIAN"
+ ""
{
rtx t0, t1, t2, t3, t4, t5, t6, t7, x;
rtx op1h = gen_lowpart (V4HImode, operands[1]);
@@ -405,15 +412,28 @@
emit_insn (gen_mulv4hi3 (t3, t0, op2h));
/* T4 = CY.h, CY.l, AW.h, AW.l = CY, AW. */
- emit_insn (gen_mix2_r (gen_lowpart (V4HImode, t4), t1, t2));
+ x = gen_lowpart (V4HImode, t4);
+ if (TARGET_BIG_ENDIAN)
+ x = gen_mix2_odd (x, t2, t1);
+ else
+ x = gen_mix2_even (x, t1, t2);
+ emit_insn (x);
/* T5 = CZ.l, 0, AX.l, 0 = CZ << 16, AX << 16. */
- emit_insn (gen_mix2_l (gen_lowpart (V4HImode, t5),
- CONST0_RTX (V4HImode), t3));
+ x = gen_lowpart (V4HImode, t5);
+ if (TARGET_BIG_ENDIAN)
+ x = gen_mix2_even (x, t3, CONST0_RTX (V4HImode));
+ else
+ x = gen_mix2_odd (x, CONST0_RTX (V4HImode), t3);
+ emit_insn (x);
/* T6 = DY.l, 0, BW.l, 0 = DY << 16, BW << 16. */
- emit_insn (gen_mix2_r (gen_lowpart (V4HImode, t6),
- CONST0_RTX (V4HImode), t3));
+ x = gen_lowpart (V4HImode, t6);
+ if (TARGET_BIG_ENDIAN)
+ x = gen_mix2_odd (x, t3, CONST0_RTX (V4HImode));
+ else
+ x = gen_mix2_even (x, CONST0_RTX (V4HImode), t3);
+ emit_insn (x);
emit_insn (gen_addv2si3 (t7, t4, t5));
emit_insn (gen_addv2si3 (operands[0], t6, t7));
@@ -608,16 +628,36 @@
(match_operand:V2SI 3 "gr_register_operand" "")]
""
{
- rtx l, r, t;
+ rtx e, o, t;
+
+ e = gen_reg_rtx (V2SImode);
+ o = gen_reg_rtx (V2SImode);
+ t = gen_reg_rtx (V2SImode);
+
+ emit_insn (gen_pmpy2_even (e, operands[1], operands[2]));
+ emit_insn (gen_pmpy2_odd (o, operands[1], operands[2]));
+ emit_insn (gen_addv2si3 (t, e, operands[3]));
+ emit_insn (gen_addv2si3 (operands[0], t, o));
+ DONE;
+})
+
+(define_expand "udot_prodv4hi"
+ [(match_operand:V2SI 0 "gr_register_operand" "")
+ (match_operand:V4HI 1 "gr_register_operand" "")
+ (match_operand:V4HI 2 "gr_register_operand" "")
+ (match_operand:V2SI 3 "gr_register_operand" "")]
+ ""
+{
+ rtx l, h, t;
- r = gen_reg_rtx (V2SImode);
l = gen_reg_rtx (V2SImode);
+ h = gen_reg_rtx (V2SImode);
t = gen_reg_rtx (V2SImode);
- emit_insn (gen_pmpy2_r (r, operands[1], operands[2]));
- emit_insn (gen_pmpy2_l (l, operands[1], operands[2]));
- emit_insn (gen_addv2si3 (t, r, operands[3]));
- emit_insn (gen_addv2si3 (operands[0], t, l));
+ emit_insn (gen_vec_widen_umult_lo_v4hi (l, operands[1], operands[2]));
+ emit_insn (gen_vec_widen_umult_hi_v4hi (h, operands[1], operands[2]));
+ emit_insn (gen_addv2si3 (t, l, operands[3]));
+ emit_insn (gen_addv2si3 (operands[0], t, h));
DONE;
})
@@ -673,7 +713,13 @@
(ss_truncate:V4QI
(match_operand:V4HI 2 "gr_reg_or_0_operand" "rU"))))]
""
- "pack2.sss %0 = %r1, %r2"
+{
+ /* Recall that vector elements are numbered in memory order. */
+ if (TARGET_BIG_ENDIAN)
+ return "%,pack2.sss %0 = %r2, %r1";
+ else
+ return "%,pack2.sss %0 = %r1, %r2";
+}
[(set_attr "itanium_class" "mmshf")])
(define_insn "vec_pack_usat_v4hi"
@@ -684,7 +730,13 @@
(us_truncate:V4QI
(match_operand:V4HI 2 "gr_reg_or_0_operand" "rU"))))]
""
- "pack2.uss %0 = %r1, %r2"
+{
+ /* Recall that vector elements are numbered in memory order. */
+ if (TARGET_BIG_ENDIAN)
+ return "%,pack2.uss %0 = %r2, %r1";
+ else
+ return "%,pack2.uss %0 = %r1, %r2";
+}
[(set_attr "itanium_class" "mmshf")])
(define_insn "vec_pack_ssat_v2si"
@@ -695,7 +747,13 @@
(ss_truncate:V2HI
(match_operand:V2SI 2 "gr_reg_or_0_operand" "rU"))))]
""
- "pack4.sss %0 = %r1, %r2"
+{
+ /* Recall that vector elements are numbered in memory order. */
+ if (TARGET_BIG_ENDIAN)
+ return "%,pack4.sss %0 = %r2, %r1";
+ else
+ return "%,pack4.sss %0 = %r1, %r2";
+}
[(set_attr "itanium_class" "mmshf")])
(define_insn "vec_interleave_lowv8qi"
@@ -738,54 +796,54 @@
}
[(set_attr "itanium_class" "mmshf")])
-(define_insn "mix1_r"
+(define_insn "mix1_even"
[(set (match_operand:V8QI 0 "gr_register_operand" "=r")
(vec_select:V8QI
(vec_concat:V16QI
(match_operand:V8QI 1 "gr_reg_or_0_operand" "rU")
(match_operand:V8QI 2 "gr_reg_or_0_operand" "rU"))
- (parallel [(const_int 0)
- (const_int 8)
- (const_int 2)
- (const_int 10)
- (const_int 4)
- (const_int 12)
- (const_int 6)
- (const_int 14)])))]
- ""
- "mix1.r %0 = %r2, %r1"
+ (parallel [(const_int 0) (const_int 8)
+ (const_int 2) (const_int 10)
+ (const_int 4) (const_int 12)
+ (const_int 6) (const_int 14)])))]
+ ""
+{
+ /* Recall that vector elements are numbered in memory order. */
+ if (TARGET_BIG_ENDIAN)
+ return "%,mix1.l %0 = %r1, %r2";
+ else
+ return "%,mix1.r %0 = %r2, %r1";
+}
[(set_attr "itanium_class" "mmshf")])
-(define_insn "mix1_l"
+(define_insn "mix1_odd"
[(set (match_operand:V8QI 0 "gr_register_operand" "=r")
(vec_select:V8QI
(vec_concat:V16QI
(match_operand:V8QI 1 "gr_reg_or_0_operand" "rU")
(match_operand:V8QI 2 "gr_reg_or_0_operand" "rU"))
- (parallel [(const_int 1)
- (const_int 9)
- (const_int 3)
- (const_int 11)
- (const_int 5)
- (const_int 13)
- (const_int 7)
- (const_int 15)])))]
- ""
- "mix1.l %0 = %r2, %r1"
+ (parallel [(const_int 1) (const_int 9)
+ (const_int 3) (const_int 11)
+ (const_int 5) (const_int 13)
+ (const_int 7) (const_int 15)])))]
+ ""
+{
+ /* Recall that vector elements are numbered in memory order. */
+ if (TARGET_BIG_ENDIAN)
+ return "%,mix1.r %0 = %r1, %r2";
+ else
+ return "%,mix1.l %0 = %r2, %r1";
+}
[(set_attr "itanium_class" "mmshf")])
(define_insn "*mux1_rev"
[(set (match_operand:V8QI 0 "gr_register_operand" "=r")
(vec_select:V8QI
(match_operand:V8QI 1 "gr_register_operand" "r")
- (parallel [(const_int 7)
- (const_int 6)
- (const_int 5)
- (const_int 4)
- (const_int 3)
- (const_int 2)
- (const_int 1)
- (const_int 0)])))]
+ (parallel [(const_int 7) (const_int 6)
+ (const_int 5) (const_int 4)
+ (const_int 3) (const_int 2)
+ (const_int 1) (const_int 0)])))]
""
"mux1 %0 = %1, @rev"
[(set_attr "itanium_class" "mmshf")])
@@ -794,14 +852,10 @@
[(set (match_operand:V8QI 0 "gr_register_operand" "=r")
(vec_select:V8QI
(match_operand:V8QI 1 "gr_register_operand" "r")
- (parallel [(const_int 0)
- (const_int 4)
- (const_int 2)
- (const_int 6)
- (const_int 1)
- (const_int 5)
- (const_int 3)
- (const_int 7)])))]
+ (parallel [(const_int 0) (const_int 4)
+ (const_int 2) (const_int 6)
+ (const_int 1) (const_int 5)
+ (const_int 3) (const_int 7)])))]
""
"mux1 %0 = %1, @mix"
[(set_attr "itanium_class" "mmshf")])
@@ -810,14 +864,10 @@
[(set (match_operand:V8QI 0 "gr_register_operand" "=r")
(vec_select:V8QI
(match_operand:V8QI 1 "gr_register_operand" "r")
- (parallel [(const_int 0)
- (const_int 4)
- (const_int 1)
- (const_int 5)
- (const_int 2)
- (const_int 6)
- (const_int 3)
- (const_int 7)])))]
+ (parallel [(const_int 0) (const_int 4)
+ (const_int 1) (const_int 5)
+ (const_int 2) (const_int 6)
+ (const_int 3) (const_int 7)])))]
""
"mux1 %0 = %1, @shuf"
[(set_attr "itanium_class" "mmshf")])
@@ -826,14 +876,10 @@
[(set (match_operand:V8QI 0 "gr_register_operand" "=r")
(vec_select:V8QI
(match_operand:V8QI 1 "gr_register_operand" "r")
- (parallel [(const_int 0)
- (const_int 2)
- (const_int 4)
- (const_int 6)
- (const_int 1)
- (const_int 3)
- (const_int 5)
- (const_int 7)])))]
+ (parallel [(const_int 0) (const_int 2)
+ (const_int 4) (const_int 6)
+ (const_int 1) (const_int 3)
+ (const_int 5) (const_int 7)])))]
""
"mux1 %0 = %1, @alt"
[(set_attr "itanium_class" "mmshf")])
@@ -842,14 +888,14 @@
[(set (match_operand:V8QI 0 "gr_register_operand" "=r")
(vec_select:V8QI
(match_operand:V8QI 1 "gr_register_operand" "r")
- (parallel [(const_int 0)
- (const_int 0)
- (const_int 0)
- (const_int 0)
- (const_int 0)
- (const_int 0)
- (const_int 0)
- (const_int 0)])))]
+ (parallel [(match_operand 2 "mux1_brcst_element" "")
+ (match_dup 2)
+ (match_dup 2)
+ (match_dup 2)
+ (match_dup 2)
+ (match_dup 2)
+ (match_dup 2)
+ (match_dup 2)])))]
""
"mux1 %0 = %1, @brcst"
[(set_attr "itanium_class" "mmshf")])
@@ -869,10 +915,7 @@
""
{
rtx temp = gen_reg_rtx (V8QImode);
- if (TARGET_BIG_ENDIAN)
- emit_insn (gen_mix1_l (temp, operands[2], operands[1]));
- else
- emit_insn (gen_mix1_r (temp, operands[1], operands[2]));
+ emit_insn (gen_mix1_even (temp, operands[1], operands[2]));
emit_insn (gen_mux1_alt (operands[0], temp));
DONE;
})
@@ -884,10 +927,7 @@
""
{
rtx temp = gen_reg_rtx (V8QImode);
- if (TARGET_BIG_ENDIAN)
- emit_insn (gen_mix1_r (temp, operands[2], operands[1]));
- else
- emit_insn (gen_mix1_l (temp, operands[1], operands[2]));
+ emit_insn (gen_mix1_odd (temp, operands[1], operands[2]));
emit_insn (gen_mux1_alt (operands[0], temp));
DONE;
})
@@ -898,10 +938,8 @@
(vec_concat:V8HI
(match_operand:V4HI 1 "gr_reg_or_0_operand" "rU")
(match_operand:V4HI 2 "gr_reg_or_0_operand" "rU"))
- (parallel [(const_int 0)
- (const_int 4)
- (const_int 1)
- (const_int 5)])))]
+ (parallel [(const_int 0) (const_int 4)
+ (const_int 1) (const_int 5)])))]
""
{
/* Recall that vector elements are numbered in memory order. */
@@ -918,10 +956,8 @@
(vec_concat:V8HI
(match_operand:V4HI 1 "gr_reg_or_0_operand" "rU")
(match_operand:V4HI 2 "gr_reg_or_0_operand" "rU"))
- (parallel [(const_int 2)
- (const_int 6)
- (const_int 3)
- (const_int 7)])))]
+ (parallel [(const_int 2) (const_int 6)
+ (const_int 3) (const_int 7)])))]
""
{
/* Recall that vector elements are numbered in memory order. */
@@ -932,32 +968,40 @@
}
[(set_attr "itanium_class" "mmshf")])
-(define_insn "mix2_r"
+(define_insn "mix2_even"
[(set (match_operand:V4HI 0 "gr_register_operand" "=r")
(vec_select:V4HI
(vec_concat:V8HI
(match_operand:V4HI 1 "gr_reg_or_0_operand" "rU")
(match_operand:V4HI 2 "gr_reg_or_0_operand" "rU"))
- (parallel [(const_int 0)
- (const_int 4)
- (const_int 2)
- (const_int 6)])))]
+ (parallel [(const_int 0) (const_int 4)
+ (const_int 2) (const_int 6)])))]
""
- "mix2.r %0 = %r2, %r1"
+{
+ /* Recall that vector elements are numbered in memory order. */
+ if (TARGET_BIG_ENDIAN)
+ return "%,mix2.l %0 = %r1, %r2";
+ else
+ return "%,mix2.r %0 = %r2, %r1";
+}
[(set_attr "itanium_class" "mmshf")])
-(define_insn "mix2_l"
+(define_insn "mix2_odd"
[(set (match_operand:V4HI 0 "gr_register_operand" "=r")
(vec_select:V4HI
(vec_concat:V8HI
(match_operand:V4HI 1 "gr_reg_or_0_operand" "rU")
(match_operand:V4HI 2 "gr_reg_or_0_operand" "rU"))
- (parallel [(const_int 1)
- (const_int 5)
- (const_int 3)
- (const_int 7)])))]
+ (parallel [(const_int 1) (const_int 5)
+ (const_int 3) (const_int 7)])))]
""
- "mix2.l %0 = %r2, %r1"
+{
+ /* Recall that vector elements are numbered in memory order. */
+ if (TARGET_BIG_ENDIAN)
+ return "%,mix2.r %0 = %r1, %r2";
+ else
+ return "%,mix2.l %0 = %r2, %r1";
+}
[(set_attr "itanium_class" "mmshf")])
(define_insn "*mux2"
@@ -970,11 +1014,21 @@
(match_operand 5 "const_int_2bit_operand" "")])))]
""
{
- int mask;
- mask = INTVAL (operands[2]);
- mask |= INTVAL (operands[3]) << 2;
- mask |= INTVAL (operands[4]) << 4;
- mask |= INTVAL (operands[5]) << 6;
+ int mask = 0;
+ if (TARGET_BIG_ENDIAN)
+ {
+ mask |= (3 - INTVAL (operands[2])) << 6;
+ mask |= (3 - INTVAL (operands[3])) << 4;
+ mask |= (3 - INTVAL (operands[4])) << 2;
+ mask |= 3 - INTVAL (operands[5]);
+ }
+ else
+ {
+ mask |= INTVAL (operands[2]);
+ mask |= INTVAL (operands[3]) << 2;
+ mask |= INTVAL (operands[4]) << 4;
+ mask |= INTVAL (operands[5]) << 6;
+ }
operands[2] = GEN_INT (mask);
return "%,mux2 %0 = %1, %2";
}
@@ -984,20 +1038,18 @@
[(set (match_operand:V4HI 0 "gr_register_operand" "")
(vec_select:V4HI
(match_operand:V4HI 1 "gr_register_operand" "")
- (parallel [(const_int 0)
- (const_int 2)
- (const_int 1)
- (const_int 3)])))]
- "!TARGET_BIG_ENDIAN")
+ (parallel [(const_int 0) (const_int 2)
+ (const_int 1) (const_int 3)])))]
+ "")
(define_expand "vec_extract_evenv4hi"
[(match_operand:V4HI 0 "gr_register_operand")
(match_operand:V4HI 1 "gr_reg_or_0_operand")
(match_operand:V4HI 2 "gr_reg_or_0_operand")]
- "!TARGET_BIG_ENDIAN"
+ ""
{
rtx temp = gen_reg_rtx (V4HImode);
- emit_insn (gen_mix2_r (temp, operands[1], operands[2]));
+ emit_insn (gen_mix2_even (temp, operands[1], operands[2]));
emit_insn (gen_vec_extract_evenodd_helper (operands[0], temp));
DONE;
})
@@ -1006,10 +1058,10 @@
[(match_operand:V4HI 0 "gr_register_operand")
(match_operand:V4HI 1 "gr_reg_or_0_operand")
(match_operand:V4HI 2 "gr_reg_or_0_operand")]
- "!TARGET_BIG_ENDIAN"
+ ""
{
rtx temp = gen_reg_rtx (V4HImode);
- emit_insn (gen_mix2_l (temp, operands[1], operands[2]));
+ emit_insn (gen_mix2_odd (temp, operands[1], operands[2]));
emit_insn (gen_vec_extract_evenodd_helper (operands[0], temp));
DONE;
})
@@ -1022,39 +1074,35 @@
"mux2 %0 = %1, 0"
[(set_attr "itanium_class" "mmshf")])
-;; Note that mix4.r performs the exact same operation.
(define_insn "vec_interleave_lowv2si"
[(set (match_operand:V2SI 0 "gr_register_operand" "=r")
(vec_select:V2SI
(vec_concat:V4SI
(match_operand:V2SI 1 "gr_reg_or_0_operand" "rU")
(match_operand:V2SI 2 "gr_reg_or_0_operand" "rU"))
- (parallel [(const_int 0)
- (const_int 2)])))]
+ (parallel [(const_int 0) (const_int 2)])))]
""
{
/* Recall that vector elements are numbered in memory order. */
if (TARGET_BIG_ENDIAN)
- return "%,unpack4.h %0 = %r1, %r2";
+ return "%,unpack4.l %0 = %r1, %r2";
else
return "%,unpack4.l %0 = %r2, %r1";
}
[(set_attr "itanium_class" "mmshf")])
-;; Note that mix4.l performs the exact same operation.
(define_insn "vec_interleave_highv2si"
[(set (match_operand:V2SI 0 "gr_register_operand" "=r")
(vec_select:V2SI
(vec_concat:V4SI
(match_operand:V2SI 1 "gr_reg_or_0_operand" "rU")
(match_operand:V2SI 2 "gr_reg_or_0_operand" "rU"))
- (parallel [(const_int 1)
- (const_int 3)])))]
+ (parallel [(const_int 1) (const_int 3)])))]
""
{
/* Recall that vector elements are numbered in memory order. */
if (TARGET_BIG_ENDIAN)
- return "%,unpack4.l %0 = %r1, %r2";
+ return "%,unpack4.h %0 = %r1, %r2";
else
return "%,unpack4.h %0 = %r2, %r1";
}
@@ -1064,10 +1112,14 @@
[(match_operand:V2SI 0 "gr_register_operand" "")
(match_operand:V2SI 1 "gr_register_operand" "")
(match_operand:V2SI 2 "gr_register_operand" "")]
- "!TARGET_BIG_ENDIAN"
+ ""
{
- emit_insn (gen_vec_interleave_lowv2si (operands[0], operands[1],
- operands[2]));
+ if (TARGET_BIG_ENDIAN)
+ emit_insn (gen_vec_interleave_highv2si (operands[0], operands[1],
+ operands[2]));
+ else
+ emit_insn (gen_vec_interleave_lowv2si (operands[0], operands[1],
+ operands[2]));
DONE;
})
@@ -1075,10 +1127,14 @@
[(match_operand:V2SI 0 "gr_register_operand" "")
(match_operand:V2SI 1 "gr_register_operand" "")
(match_operand:V2SI 2 "gr_register_operand" "")]
- "!TARGET_BIG_ENDIAN"
+ ""
{
- emit_insn (gen_vec_interleave_highv2si (operands[0], operands[1],
- operands[2]));
+ if (TARGET_BIG_ENDIAN)
+ emit_insn (gen_vec_interleave_lowv2si (operands[0], operands[1],
+ operands[2]));
+ else
+ emit_insn (gen_vec_interleave_highv2si (operands[0], operands[1],
+ operands[2]));
DONE;
})
@@ -1103,10 +1159,7 @@
if (!gr_reg_or_0_operand (op2, SImode))
op2 = force_reg (SImode, op2);
- if (TARGET_BIG_ENDIAN)
- x = gen_rtx_VEC_CONCAT (V2SImode, op2, op1);
- else
- x = gen_rtx_VEC_CONCAT (V2SImode, op1, op2);
+ x = gen_rtx_VEC_CONCAT (V2SImode, op1, op2);
emit_insn (gen_rtx_SET (VOIDmode, operands[0], x));
DONE;
})
@@ -1117,7 +1170,13 @@
(match_operand:SI 1 "gr_reg_or_0_operand" "rO")
(match_operand:SI 2 "gr_reg_or_0_operand" "rO")))]
""
- "unpack4.l %0 = %r2, %r1"
+{
+ /* Recall that vector elements are numbered in memory order. */
+ if (TARGET_BIG_ENDIAN)
+ return "%,unpack4.l %0 = %r1, %r2";
+ else
+ return "%,unpack4.l %0 = %r2, %r1";
+}
[(set_attr "itanium_class" "mmshf")])
;; Missing operations
@@ -1287,7 +1346,10 @@
""
{
rtx tmp = gen_reg_rtx (V2SFmode);
- emit_insn (gen_fswap (tmp, operands[1], CONST0_RTX (V2SFmode)));
+ if (TARGET_BIG_ENDIAN)
+ emit_insn (gen_fswap (tmp, CONST0_RTX (V2SFmode), operands[1]));
+ else
+ emit_insn (gen_fswap (tmp, operands[1], CONST0_RTX (V2SFmode)));
emit_insn (gen_addv2sf3 (operands[0], operands[1], tmp));
DONE;
})
@@ -1298,7 +1360,10 @@
""
{
rtx tmp = gen_reg_rtx (V2SFmode);
- emit_insn (gen_fswap (tmp, operands[1], CONST0_RTX (V2SFmode)));
+ if (TARGET_BIG_ENDIAN)
+ emit_insn (gen_fswap (tmp, CONST0_RTX (V2SFmode), operands[1]));
+ else
+ emit_insn (gen_fswap (tmp, operands[1], CONST0_RTX (V2SFmode)));
emit_insn (gen_smaxv2sf3 (operands[0], operands[1], tmp));
DONE;
})
@@ -1309,7 +1374,10 @@
""
{
rtx tmp = gen_reg_rtx (V2SFmode);
- emit_insn (gen_fswap (tmp, operands[1], CONST0_RTX (V2SFmode)));
+ if (TARGET_BIG_ENDIAN)
+ emit_insn (gen_fswap (tmp, CONST0_RTX (V2SFmode), operands[1]));
+ else
+ emit_insn (gen_fswap (tmp, operands[1], CONST0_RTX (V2SFmode)));
emit_insn (gen_sminv2sf3 (operands[0], operands[1], tmp));
DONE;
})
@@ -1375,10 +1443,7 @@
if (!fr_reg_or_fp01_operand (op2, SFmode))
op2 = force_reg (SFmode, op2);
- if (TARGET_BIG_ENDIAN)
- emit_insn (gen_fpack (operands[0], op2, op1));
- else
- emit_insn (gen_fpack (operands[0], op1, op2));
+ emit_insn (gen_fpack (operands[0], op1, op2));
DONE;
})
@@ -1388,7 +1453,13 @@
(match_operand:SF 1 "fr_reg_or_fp01_operand" "fG")
(match_operand:SF 2 "fr_reg_or_fp01_operand" "fG")))]
""
- "fpack %0 = %F2, %F1"
+{
+ /* Recall that vector elements are numbered in memory order. */
+ if (TARGET_BIG_ENDIAN)
+ return "%,fpack %0 = %F1, %F2";
+ else
+ return "%,fpack %0 = %F2, %F1";
+}
[(set_attr "itanium_class" "fmisc")])
(define_insn "fswap"
@@ -1399,7 +1470,13 @@
(match_operand:V2SF 2 "fr_reg_or_0_operand" "fU"))
(parallel [(const_int 1) (const_int 2)])))]
""
- "fswap %0 = %F1, %F2"
+{
+ /* Recall that vector elements are numbered in memory order. */
+ if (TARGET_BIG_ENDIAN)
+ return "%,fswap %0 = %F2, %F1";
+ else
+ return "%,fswap %0 = %F1, %F2";
+}
[(set_attr "itanium_class" "fmisc")])
(define_insn "vec_interleave_highv2sf"
@@ -1410,7 +1487,13 @@
(match_operand:V2SF 2 "fr_reg_or_0_operand" "fU"))
(parallel [(const_int 1) (const_int 3)])))]
""
- "fmix.l %0 = %F2, %F1"
+{
+ /* Recall that vector elements are numbered in memory order. */
+ if (TARGET_BIG_ENDIAN)
+ return "%,fmix.l %0 = %F1, %F2";
+ else
+ return "%,fmix.l %0 = %F2, %F1";
+}
[(set_attr "itanium_class" "fmisc")])
(define_insn "vec_interleave_lowv2sf"
@@ -1421,7 +1504,13 @@
(match_operand:V2SF 2 "fr_reg_or_0_operand" "fU"))
(parallel [(const_int 0) (const_int 2)])))]
""
- "fmix.r %0 = %F2, %F1"
+{
+ /* Recall that vector elements are numbered in memory order. */
+ if (TARGET_BIG_ENDIAN)
+ return "%,fmix.r %0 = %F1, %F2";
+ else
+ return "%,fmix.r %0 = %F2, %F1";
+}
[(set_attr "itanium_class" "fmisc")])
(define_insn "fmix_lr"
@@ -1432,17 +1521,27 @@
(match_operand:V2SF 2 "fr_reg_or_0_operand" "fU"))
(parallel [(const_int 0) (const_int 3)])))]
""
- "fmix.lr %0 = %F2, %F1"
+{
+ /* Recall that vector elements are numbered in memory order. */
+ if (TARGET_BIG_ENDIAN)
+ return "%,fmix.lr %0 = %F1, %F2";
+ else
+ return "%,fmix.lr %0 = %F2, %F1";
+}
[(set_attr "itanium_class" "fmisc")])
(define_expand "vec_extract_evenv2sf"
[(match_operand:V2SF 0 "gr_register_operand" "")
(match_operand:V2SF 1 "gr_register_operand" "")
(match_operand:V2SF 2 "gr_register_operand" "")]
- "!TARGET_BIG_ENDIAN"
+ ""
{
- emit_insn (gen_vec_interleave_lowv2sf (operands[0], operands[1],
- operands[2]));
+ if (TARGET_BIG_ENDIAN)
+ emit_insn (gen_vec_interleave_highv2sf (operands[0], operands[1],
+ operands[2]));
+ else
+ emit_insn (gen_vec_interleave_lowv2sf (operands[0], operands[1],
+ operands[2]));
DONE;
})
@@ -1450,30 +1549,35 @@
[(match_operand:V2SF 0 "gr_register_operand" "")
(match_operand:V2SF 1 "gr_register_operand" "")
(match_operand:V2SF 2 "gr_register_operand" "")]
- "!TARGET_BIG_ENDIAN"
+ ""
{
- emit_insn (gen_vec_interleave_highv2sf (operands[0], operands[1],
- operands[2]));
+ if (TARGET_BIG_ENDIAN)
+ emit_insn (gen_vec_interleave_lowv2sf (operands[0], operands[1],
+ operands[2]));
+ else
+ emit_insn (gen_vec_interleave_highv2sf (operands[0], operands[1],
+ operands[2]));
DONE;
})
-
(define_expand "vec_setv2sf"
[(match_operand:V2SF 0 "fr_register_operand" "")
(match_operand:SF 1 "fr_register_operand" "")
(match_operand 2 "const_int_operand" "")]
""
{
+ rtx op0 = operands[0];
rtx tmp = gen_reg_rtx (V2SFmode);
+
emit_insn (gen_fpack (tmp, operands[1], CONST0_RTX (SFmode)));
switch (INTVAL (operands[2]))
{
case 0:
- emit_insn (gen_fmix_lr (operands[0], tmp, operands[0]));
+ emit_insn (gen_fmix_lr (op0, tmp, op0));
break;
case 1:
- emit_insn (gen_vec_interleave_lowv2sf (operands[0], operands[0], tmp));
+ emit_insn (gen_vec_interleave_lowv2sf (op0, op0, tmp));
break;
default:
gcc_unreachable ();
@@ -1500,8 +1604,8 @@
})
(define_insn_and_split "*vec_extractv2sf_0_be"
- [(set (match_operand:SF 0 "register_operand" "=r,f")
- (unspec:SF [(match_operand:V2SF 1 "register_operand" "rf,r")
+ [(set (match_operand:SF 0 "register_operand" "=rf,r")
+ (unspec:SF [(match_operand:V2SF 1 "nonimmediate_operand" "m,r")
(const_int 0)]
UNSPEC_VECT_EXTR))]
"TARGET_BIG_ENDIAN"
@@ -1509,31 +1613,44 @@
"reload_completed"
[(set (match_dup 0) (match_dup 1))]
{
- if (REG_P (operands[1]) && FR_REGNO_P (REGNO (operands[1])))
- operands[0] = gen_rtx_REG (V2SFmode, REGNO (operands[0]));
+ if (MEM_P (operands[1]))
+ operands[1] = adjust_address (operands[1], SFmode, 0);
else
- operands[1] = gen_rtx_REG (SFmode, REGNO (operands[1]));
+ {
+ emit_insn (gen_lshrdi3 (operands[0], operands[1], GEN_INT (32)));
+ DONE;
+ }
})
-(define_insn_and_split "*vec_extractv2sf_1"
+(define_insn_and_split "*vec_extractv2sf_1_le"
[(set (match_operand:SF 0 "register_operand" "=r")
(unspec:SF [(match_operand:V2SF 1 "register_operand" "r")
(const_int 1)]
UNSPEC_VECT_EXTR))]
- ""
+ "!TARGET_BIG_ENDIAN"
"#"
- "reload_completed"
+ "&& reload_completed"
[(const_int 0)]
{
operands[0] = gen_rtx_REG (DImode, REGNO (operands[0]));
operands[1] = gen_rtx_REG (DImode, REGNO (operands[1]));
- if (TARGET_BIG_ENDIAN)
- emit_move_insn (operands[0], operands[1]);
- else
- emit_insn (gen_lshrdi3 (operands[0], operands[1], GEN_INT (32)));
+ emit_insn (gen_lshrdi3 (operands[0], operands[1], GEN_INT (32)));
DONE;
})
+(define_insn_and_split "*vec_extractv2sf_1_be"
+ [(set (match_operand:SF 0 "register_operand" "=rf")
+ (unspec:SF [(match_operand:V2SF 1 "register_operand" "r")
+ (const_int 1)]
+ UNSPEC_VECT_EXTR))]
+ "TARGET_BIG_ENDIAN"
+ "#"
+ "&& reload_completed"
+ [(set (match_dup 0) (match_dup 1))]
+{
+ operands[1] = gen_rtx_REG (SFmode, REGNO (operands[1]));
+})
+
(define_expand "vec_extractv2sf"
[(set (match_operand:SF 0 "register_operand" "")
(unspec:SF [(match_operand:V2SF 1 "register_operand" "")
@@ -1582,11 +1699,14 @@
[(match_operand:V8QI 0 "gr_register_operand" "")
(match_operand:V4HI 1 "gr_register_operand" "")
(match_operand:V4HI 2 "gr_register_operand" "")]
- "!TARGET_BIG_ENDIAN"
+ ""
{
- rtx op1 = gen_lowpart(V8QImode, operands[1]);
- rtx op2 = gen_lowpart(V8QImode, operands[2]);
- emit_insn (gen_vec_extract_evenv8qi (operands[0], op1, op2));
+ rtx op1 = gen_lowpart (V8QImode, operands[1]);
+ rtx op2 = gen_lowpart (V8QImode, operands[2]);
+ if (TARGET_BIG_ENDIAN)
+ emit_insn (gen_vec_extract_oddv8qi (operands[0], op1, op2));
+ else
+ emit_insn (gen_vec_extract_evenv8qi (operands[0], op1, op2));
DONE;
})
@@ -1594,11 +1714,14 @@
[(match_operand:V4HI 0 "gr_register_operand" "")
(match_operand:V2SI 1 "gr_register_operand" "")
(match_operand:V2SI 2 "gr_register_operand" "")]
- "!TARGET_BIG_ENDIAN"
+ ""
{
- rtx op1 = gen_lowpart(V4HImode, operands[1]);
- rtx op2 = gen_lowpart(V4HImode, operands[2]);
- emit_insn (gen_vec_extract_evenv4hi (operands[0], op1, op2));
+ rtx op1 = gen_lowpart (V4HImode, operands[1]);
+ rtx op2 = gen_lowpart (V4HImode, operands[2]);
+ if (TARGET_BIG_ENDIAN)
+ emit_insn (gen_vec_extract_oddv4hi (operands[0], op1, op2));
+ else
+ emit_insn (gen_vec_extract_evenv4hi (operands[0], op1, op2));
DONE;
})
diff --git a/gcc/config/ia64/vms.opt b/gcc/config/ia64/vms.opt
new file mode 100644
index 00000000000..b4cec1f4432
--- /dev/null
+++ b/gcc/config/ia64/vms.opt
@@ -0,0 +1,30 @@
+; IA64 VMS options.
+
+; Copyright (C) 2011
+; Free Software Foundation, Inc.
+;
+; This file is part of GCC.
+;
+; GCC is free software; you can redistribute it and/or modify it under
+; the terms of the GNU General Public License as published by the Free
+; Software Foundation; either version 3, or (at your option) any later
+; version.
+;
+; GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+; WARRANTY; without even the implied warranty of MERCHANTABILITY or
+; FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+; for more details.
+;
+; You should have received a copy of the GNU General Public License
+; along with GCC; see the file COPYING3. If not see
+; <http://www.gnu.org/licenses/>.
+
+; See the GCC internals manual (options.texi) for a description of
+; this file's format.
+
+; Please try to keep this file in ASCII collating order.
+
+source-listing
+Driver
+
+; This comment is to ensure we retain the blank line above.
diff --git a/gcc/config/interix.opt b/gcc/config/interix.opt
index 5c95b250236..f5032996576 100644
--- a/gcc/config/interix.opt
+++ b/gcc/config/interix.opt
@@ -1,6 +1,6 @@
; Interix options.
-; Copyright (C) 2010
+; Copyright (C) 2010, 2011
; Free Software Foundation, Inc.
;
; This file is part of GCC.
@@ -30,4 +30,7 @@ Driver
G
Driver
+posix
+Driver
+
; This comment is to ensure we retain the blank line above.
diff --git a/gcc/config/iq2000/constraints.md b/gcc/config/iq2000/constraints.md
new file mode 100644
index 00000000000..8850592d70f
--- /dev/null
+++ b/gcc/config/iq2000/constraints.md
@@ -0,0 +1,79 @@
+;; Constraints for Vitesse IQ2000 processors
+;; Copyright (C) 2011 Free Software Foundation, Inc.
+
+;; This file is part of GCC.
+
+;; GCC is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 3, or (at your option)
+;; any later version.
+
+;; GCC is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GCC; see the file COPYING3. If not see
+;; <http://www.gnu.org/licenses/>.
+
+;; Register constraints.
+(define_register_constraint "b" "ALL_REGS"
+ "@internal")
+
+(define_register_constraint "d" "GR_REGS"
+ "@internal")
+
+(define_register_constraint "y" "GR_REGS"
+ "@internal")
+
+;; Integer constraints.
+(define_constraint "I"
+ "A 16-bit signed integer."
+ (and (match_code "const_int")
+ (match_test "IN_RANGE (ival, -32768, 32767)")))
+
+(define_constraint "J"
+ "Zero."
+ (and (match_code "const_int")
+ (match_test "ival == 0")))
+
+(define_constraint "K"
+ "A 16-bit unsigned integer"
+ (and (match_code "const_int")
+ (match_test "IN_RANGE (ival, 0, 65535)")))
+
+(define_constraint "L"
+ "A 32-bit constant whose bottom 16 bits are zero."
+ (and (match_code "const_int")
+ (ior (match_test "(ival | 0x7fff0000) == 0x7fff0000")
+ (match_test "(ival | 0x7fff0000) + 0x10000 == 0"))))
+
+(define_constraint "M"
+ "Any constant not matched by 'I', 'K', or 'L'."
+ (and (match_code "const_int")
+ (match_test "!insn_const_int_ok_for_constraint (ival, CONSTRAINT_I)")
+ (match_test "!insn_const_int_ok_for_constraint (ival, CONSTRAINT_K)")
+ (match_test "!insn_const_int_ok_for_constraint (ival, CONSTRAINT_L)")))
+
+(define_constraint "N"
+ "Any constant whose lower or upper 16 bits are 0xffff."
+ (and (match_code "const_int")
+ (ior (match_test "(ival & 0xffff) == 0xffff")
+ (match_test "(ival & 0xffff0000) == 0xffff0000"))))
+
+(define_constraint "O"
+ "A 5-bit signed integer."
+ (and (match_code "const_int")
+ (match_test "IN_RANGE (ival, -31, 31)")))
+
+;; Floating-point constraints.
+(define_constraint "G"
+ "Floating-point zero."
+ (and (match_code "const_double")
+ (match_test "op == CONST0_RTX (mode)")))
+
+;; Extra constraints.
+(define_constraint "R"
+ "A memory reference which takes one word for the instruction."
+ (match_test "simple_memory_operand (op, mode)"))
diff --git a/gcc/config/iq2000/iq2000.h b/gcc/config/iq2000/iq2000.h
index 95744b6e28e..7f69d2a12b9 100644
--- a/gcc/config/iq2000/iq2000.h
+++ b/gcc/config/iq2000/iq2000.h
@@ -235,12 +235,6 @@ enum reg_class
#define INDEX_REG_CLASS NO_REGS
-#define REG_CLASS_FROM_LETTER(C) \
- ((C) == 'd' ? GR_REGS : \
- (C) == 'b' ? ALL_REGS : \
- (C) == 'y' ? GR_REGS : \
- NO_REGS)
-
#define REGNO_OK_FOR_INDEX_P(regno) 0
#define PREFERRED_RELOAD_CLASS(X,CLASS) \
@@ -257,53 +251,6 @@ enum reg_class
#define CLASS_MAX_NREGS(CLASS, MODE) \
((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)
-/* For IQ2000:
-
- `I' is used for the range of constants an arithmetic insn can
- actually contain (16-bits signed integers).
-
- `J' is used for the range which is just zero (i.e., $r0).
-
- `K' is used for the range of constants a logical insn can actually
- contain (16-bit zero-extended integers).
-
- `L' is used for the range of constants that be loaded with lui
- (i.e., the bottom 16 bits are zero).
-
- `M' is used for the range of constants that take two words to load
- (i.e., not matched by `I', `K', and `L').
-
- `N' is used for constants 0xffffnnnn or 0xnnnnffff
-
- `O' is a 5-bit zero-extended integer. */
-
-#define CONST_OK_FOR_LETTER_P(VALUE, C) \
- ((C) == 'I' ? ((unsigned HOST_WIDE_INT) ((VALUE) + 0x8000) < 0x10000) \
- : (C) == 'J' ? ((VALUE) == 0) \
- : (C) == 'K' ? ((unsigned HOST_WIDE_INT) (VALUE) < 0x10000) \
- : (C) == 'L' ? (((VALUE) & 0x0000ffff) == 0 \
- && (((VALUE) & ~2147483647) == 0 \
- || ((VALUE) & ~2147483647) == ~2147483647)) \
- : (C) == 'M' ? ((((VALUE) & ~0x0000ffff) != 0) \
- && (((VALUE) & ~0x0000ffff) != ~0x0000ffff) \
- && (((VALUE) & 0x0000ffff) != 0 \
- || (((VALUE) & ~2147483647) != 0 \
- && ((VALUE) & ~2147483647) != ~2147483647))) \
- : (C) == 'N' ? ((((VALUE) & 0xffff) == 0xffff) \
- || (((VALUE) & 0xffff0000) == 0xffff0000)) \
- : (C) == 'O' ? ((unsigned HOST_WIDE_INT) ((VALUE) + 0x20) < 0x40) \
- : 0)
-
-#define CONST_DOUBLE_OK_FOR_LETTER_P(VALUE, C) \
- ((C) == 'G' \
- && (VALUE) == CONST0_RTX (GET_MODE (VALUE)))
-
-/* `R' is for memory references which take 1 word for the instruction. */
-
-#define EXTRA_CONSTRAINT(OP,CODE) \
- (((CODE) == 'R') ? simple_memory_operand (OP, GET_MODE (OP)) \
- : FALSE)
-
/* Basic Stack Layout. */
diff --git a/gcc/config/iq2000/iq2000.md b/gcc/config/iq2000/iq2000.md
index b7856c1d9c7..7ad113d9538 100644
--- a/gcc/config/iq2000/iq2000.md
+++ b/gcc/config/iq2000/iq2000.md
@@ -194,6 +194,7 @@
(nil)])
(include "predicates.md")
+(include "constraints.md")
;; .........................
@@ -731,15 +732,15 @@
;; in FP registers (off by default, use -mdebugh to enable).
(define_insn "movsi_internal2"
- [(set (match_operand:SI 0 "nonimmediate_operand" "=d,d,d,d,d,d,R,m,*d,*z,*x,*d,*x,*d")
- (match_operand:SI 1 "move_operand" "d,S,IKL,Mnis,R,m,dJ,dJ,*z,*d,J,*x,*d,*a"))]
+ [(set (match_operand:SI 0 "nonimmediate_operand" "=d,d,d,d,d,R,m")
+ (match_operand:SI 1 "move_operand" "d,IKL,Mnis,R,m,dJ,dJ"))]
"(register_operand (operands[0], SImode)
|| register_operand (operands[1], SImode)
|| (GET_CODE (operands[1]) == CONST_INT && INTVAL (operands[1]) == 0))"
"* return iq2000_move_1word (operands, insn, FALSE);"
- [(set_attr "type" "move,load,arith,arith,load,load,store,store,xfer,xfer,move,move,move,move")
+ [(set_attr "type" "move,arith,arith,load,load,store,store")
(set_attr "mode" "SI")
- (set_attr "length" "4,8,4,8,8,8,4,8,4,4,4,4,4,4")])
+ (set_attr "length" "4,4,8,8,8,4,8")])
;; 16-bit Integer moves
@@ -770,15 +771,15 @@
;; in FP registers (off by default, use -mdebugh to enable).
(define_insn "movhi_internal2"
- [(set (match_operand:HI 0 "nonimmediate_operand" "=d,d,d,d,R,m,*d,*z,*x,*d")
- (match_operand:HI 1 "general_operand" "d,IK,R,m,dJ,dJ,*z,*d,*d,*x"))]
+ [(set (match_operand:HI 0 "nonimmediate_operand" "=d,d,d,d,R,m")
+ (match_operand:HI 1 "general_operand" "d,IK,R,m,dJ,dJ"))]
"(register_operand (operands[0], HImode)
|| register_operand (operands[1], HImode)
|| (GET_CODE (operands[1]) == CONST_INT && INTVAL (operands[1]) == 0))"
"* return iq2000_move_1word (operands, insn, TRUE);"
- [(set_attr "type" "move,arith,load,load,store,store,xfer,xfer,move,move")
+ [(set_attr "type" "move,arith,load,load,store,store")
(set_attr "mode" "HI")
- (set_attr "length" "4,4,4,8,4,8,4,4,4,4")])
+ (set_attr "length" "4,4,4,8,4,8")])
;; 8-bit Integer moves
@@ -809,15 +810,15 @@
;; in FP registers (off by default, use -mdebugh to enable).
(define_insn "movqi_internal2"
- [(set (match_operand:QI 0 "nonimmediate_operand" "=d,d,d,d,R,m,*d,*z,*x,*d")
- (match_operand:QI 1 "general_operand" "d,IK,R,m,dJ,dJ,*z,*d,*d,*x"))]
+ [(set (match_operand:QI 0 "nonimmediate_operand" "=d,d,d,d,R,m")
+ (match_operand:QI 1 "general_operand" "d,IK,R,m,dJ,dJ"))]
"(register_operand (operands[0], QImode)
|| register_operand (operands[1], QImode)
|| (GET_CODE (operands[1]) == CONST_INT && INTVAL (operands[1]) == 0))"
"* return iq2000_move_1word (operands, insn, TRUE);"
- [(set_attr "type" "move,arith,load,load,store,store,xfer,xfer,move,move")
+ [(set_attr "type" "move,arith,load,load,store,store")
(set_attr "mode" "QI")
- (set_attr "length" "4,4,4,8,4,8,4,4,4,4")])
+ (set_attr "length" "4,4,4,8,4,8")])
;; 32-bit floating point moves
@@ -1271,15 +1272,6 @@
[(set_attr "type" "arith")
(set_attr "mode" "SI")])
-(define_insn ""
- [(set (match_operand:SI 0 "register_operand" "=t")
- (gtu:SI (match_operand:SI 1 "register_operand" "d")
- (match_operand:SI 2 "register_operand" "d")))]
- ""
- "sltu\\t%2,%1"
- [(set_attr "type" "arith")
- (set_attr "mode" "SI")])
-
(define_insn "sltu_si"
[(set (match_operand:SI 0 "register_operand" "=d,=d")
(ltu:SI (match_operand:SI 1 "register_operand" "d,d")
@@ -1583,7 +1575,7 @@
;; calls.c now passes a fourth argument, make saber happy
(define_expand "call_value"
- [(parallel [(set (match_operand 0 "register_operand" "=df")
+ [(parallel [(set (match_operand 0 "register_operand" "=d")
(call (match_operand 1 "memory_operand" "m")
(match_operand 2 "" "i")))
(clobber (reg:SI 31))
@@ -1649,8 +1641,8 @@
"")
(define_insn "call_value_internal1"
- [(set (match_operand 0 "register_operand" "=df")
- (call (mem (match_operand 1 "call_insn_operand" "ri"))
+ [(set (match_operand 0 "register_operand" "=d")
+ (call (mem (match_operand 1 "call_insn_operand" "r"))
(match_operand 2 "" "i")))
(clobber (match_operand:SI 3 "register_operand" "=d"))]
""
@@ -1683,10 +1675,10 @@
;; return values.
(define_insn "call_value_multiple_internal1"
- [(set (match_operand 0 "register_operand" "=df")
- (call (mem (match_operand 1 "call_insn_operand" "ri"))
+ [(set (match_operand 0 "register_operand" "=d")
+ (call (mem (match_operand 1 "call_insn_operand" "r"))
(match_operand 2 "" "i")))
- (set (match_operand 3 "register_operand" "=df")
+ (set (match_operand 3 "register_operand" "=d")
(call (mem (match_dup 1))
(match_dup 2)))
(clobber (match_operand:SI 4 "register_operand" "=d"))]
diff --git a/gcc/config/lm32/lm32.h b/gcc/config/lm32/lm32.h
index 641d48e723e..63f1096b9cf 100644
--- a/gcc/config/lm32/lm32.h
+++ b/gcc/config/lm32/lm32.h
@@ -1,7 +1,7 @@
/* Definitions of target machine for GNU compiler, Lattice Mico32 architecture.
Contributed by Jon Beniston <jon@beniston.com>
- Copyright (C) 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 2009, 2010, 2011 Free Software Foundation, Inc.
This file is part of GCC.
@@ -54,7 +54,7 @@
%{mdivide-enabled} \
%{mbarrel-shift-enabled} \
%{msign-extend-enabled} \
-%{muser-extend-enabled} \
+%{muser-enabled} \
"
/* Let link script define all link options.
diff --git a/gcc/config/lm32/t-lm32 b/gcc/config/lm32/t-lm32
index ebe377314dc..ec9a18b73a7 100644
--- a/gcc/config/lm32/t-lm32
+++ b/gcc/config/lm32/t-lm32
@@ -1,2 +1,2 @@
# for multilib
-MULTILIB_OPTIONS = mmultiply-enabled mbarrel-shift-enabled
+MULTILIB_OPTIONS = mbarrel-shift-enabled mmultiply-enabled mdivide-enabled msign-extend-enabled
diff --git a/gcc/config/m32c/m32c.c b/gcc/config/m32c/m32c.c
index 3a741392aa0..83bf86c2071 100644
--- a/gcc/config/m32c/m32c.c
+++ b/gcc/config/m32c/m32c.c
@@ -454,6 +454,11 @@ m32c_option_override (void)
This is always worse than an absolute call. */
if (TARGET_A16)
flag_no_function_cse = 1;
+
+ /* This wants to put insns between compares and their jumps. */
+ /* FIXME: The right solution is to properly trace the flags register
+ values, but that is too much work for stage 4. */
+ flag_combine_stack_adjustments = 0;
}
#undef TARGET_OVERRIDE_OPTIONS_AFTER_CHANGE
@@ -636,8 +641,9 @@ m32c_regno_reg_class (int regno)
case R3_REGNO:
return R3_REGS;
case A0_REGNO:
+ return A0_REGS;
case A1_REGNO:
- return A_REGS;
+ return A1_REGS;
case SB_REGNO:
return SB_REGS;
case FB_REGNO:
@@ -3617,7 +3623,7 @@ m32c_subreg (enum machine_mode outer,
/* Volatile MEMs don't get simplified, but we need them to
be. We are little endian, so the subreg byte is the
offset. */
- r = adjust_address (x, outer, byte);
+ r = adjust_address_nv (x, outer, byte);
}
return r;
}
diff --git a/gcc/config/m32c/m32c.h b/gcc/config/m32c/m32c.h
index a953ee33a3e..9cabeedb846 100644
--- a/gcc/config/m32c/m32c.h
+++ b/gcc/config/m32c/m32c.h
@@ -1,5 +1,5 @@
/* Target Definitions for R8C/M16C/M32C
- Copyright (C) 2005, 2007, 2008, 2009, 2010
+ Copyright (C) 2005, 2007, 2008, 2009, 2010, 2011
Free Software Foundation, Inc.
Contributed by Red Hat.
@@ -54,13 +54,13 @@
family. Most of the logic here is making sure we do the right
thing when no CPU is specified, which defaults to R8C. */
#undef LIB_SPEC
-#define LIB_SPEC "-( -lc %{msim*:-lsim}%{!msim*:-lnosys} -) \
-%{msim*:%{!T*: %{mcpu=m32cm:%Tsim24.ld}%{mcpu=m32c:%Tsim24.ld} \
- %{!mcpu=m32cm:%{!mcpu=m32c:%Tsim16.ld}}}} \
-%{!T*:%{!msim*: %{mcpu=m16c:%Tm16c.ld} \
- %{mcpu=m32cm:%Tm32cm.ld} \
- %{mcpu=m32c:%Tm32c.ld} \
- %{!mcpu=m16c:%{!mcpu=m32cm:%{!mcpu=m32c:%Tr8c.ld}}}}} \
+#define LIB_SPEC "-( -lc %{msim:-lsim}%{!msim:-lnosys} -) \
+%{msim:%{!T*: %{mcpu=m32cm:%Tsim24.ld}%{mcpu=m32c:%Tsim24.ld} \
+ %{!mcpu=m32cm:%{!mcpu=m32c:%Tsim16.ld}}}} \
+%{!T*:%{!msim: %{mcpu=m16c:%Tm16c.ld} \
+ %{mcpu=m32cm:%Tm32cm.ld} \
+ %{mcpu=m32c:%Tm32c.ld} \
+ %{!mcpu=m16c:%{!mcpu=m32cm:%{!mcpu=m32c:%Tr8c.ld}}}}} \
"
/* Run-time Target Specification */
@@ -200,9 +200,6 @@ machine_function;
#undef SIZE_TYPE
#define SIZE_TYPE "unsigned int"
-#undef PTRDIFF_TYPE
-#define PTRDIFF_TYPE "int"
-
#undef WCHAR_TYPE
#define WCHAR_TYPE "long int"
diff --git a/gcc/config/m32r/constraints.md b/gcc/config/m32r/constraints.md
index da126c27c4b..350d48407d6 100644
--- a/gcc/config/m32r/constraints.md
+++ b/gcc/config/m32r/constraints.md
@@ -1,5 +1,5 @@
;; Constraint definitions for Renesas M32R cpu for GNU C compiler
-;; Copyright (C) 2007 Free Software Foundation, Inc.
+;; Copyright (C) 2007, 2011 Free Software Foundation, Inc.
;;
;; This file is part of GCC.
;;
@@ -118,7 +118,12 @@
(define_constraint "S"
"A store with pre {inc,dec}rement."
(and (match_code "mem")
- (match_test "STORE_PREINC_PREDEC_P (GET_MODE (op), XEXP (op, 0))")))
+ (match_test "mode == SImode || mode == SFmode")
+ (match_code "pre_inc,pre_dec" "0")
+ (match_code "reg" "00")
+ (match_test "GPR_P (REGNO (XEXP (XEXP (op, 0), 0)))
+ || REGNO (XEXP (XEXP (op, 0), 0)) == ARG_POINTER_REGNUM
+ || ! HARD_REGISTER_P (XEXP (XEXP (op, 0), 0))")))
(define_constraint "T"
"An indirect of a pointer."
@@ -128,7 +133,12 @@
(define_constraint "U"
"A load with post increment."
(and (match_code "mem")
- (match_test "LOAD_POSTINC_P (GET_MODE (op), XEXP (op, 0))")))
+ (match_test "mode == SImode || mode == SFmode")
+ (match_code "post_inc" "0")
+ (match_code "reg" "00")
+ (match_test "GPR_P (REGNO (XEXP (XEXP (op, 0), 0)))
+ || REGNO (XEXP (XEXP (op, 0), 0)) == ARG_POINTER_REGNUM
+ || ! HARD_REGISTER_P (XEXP (XEXP (op, 0), 0))")))
(define_constraint "W"
"zero immediate."
diff --git a/gcc/config/m32r/m32r.c b/gcc/config/m32r/m32r.c
index 410882766c7..444f16efbbe 100644
--- a/gcc/config/m32r/m32r.c
+++ b/gcc/config/m32r/m32r.c
@@ -1,6 +1,6 @@
/* Subroutines used for code generation on the Renesas M32R cpu.
Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
- 2005, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+ 2005, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
This file is part of GCC.
@@ -66,6 +66,7 @@ static void m32r_option_override (void);
static void init_reg_tables (void);
static void block_move_call (rtx, rtx, rtx);
static int m32r_is_insn (rtx);
+static bool m32r_legitimate_address_p (enum machine_mode, rtx, bool);
static rtx m32r_legitimize_address (rtx, rtx, enum machine_mode);
static bool m32r_mode_dependent_address_p (const_rtx);
static tree m32r_handle_model_attribute (tree *, tree, tree, int, bool *);
@@ -124,6 +125,8 @@ static const struct default_options m32r_option_optimization_table[] =
#undef TARGET_ATTRIBUTE_TABLE
#define TARGET_ATTRIBUTE_TABLE m32r_attribute_table
+#undef TARGET_LEGITIMATE_ADDRESS_P
+#define TARGET_LEGITIMATE_ADDRESS_P m32r_legitimate_address_p
#undef TARGET_LEGITIMIZE_ADDRESS
#define TARGET_LEGITIMIZE_ADDRESS m32r_legitimize_address
#undef TARGET_MODE_DEPENDENT_ADDRESS_P
@@ -210,6 +213,9 @@ static const struct default_options m32r_option_optimization_table[] =
#undef TARGET_TRAMPOLINE_INIT
#define TARGET_TRAMPOLINE_INIT m32r_trampoline_init
+#undef TARGET_EXCEPT_UNWIND_INFO
+#define TARGET_EXCEPT_UNWIND_INFO sjlj_except_unwind_info
+
struct gcc_target targetm = TARGET_INITIALIZER;
/* Implement TARGET_HANDLE_OPTION. */
@@ -2841,6 +2847,107 @@ m32r_trampoline_init (rtx m_tramp, tree fndecl, rtx chain_value)
GEN_INT (3), SImode);
}
+/* True if X is a reg that can be used as a base reg. */
+
+static bool
+m32r_rtx_ok_for_base_p (const_rtx x, bool strict)
+{
+ if (! REG_P (x))
+ return false;
+
+ if (strict)
+ {
+ if (GPR_P (REGNO (x)))
+ return true;
+ }
+ else
+ {
+ if (GPR_P (REGNO (x))
+ || REGNO (x) == ARG_POINTER_REGNUM
+ || ! HARD_REGISTER_P (x))
+ return true;
+ }
+
+ return false;
+}
+
+static inline bool
+m32r_rtx_ok_for_offset_p (const_rtx x)
+{
+ return (CONST_INT_P (x) && INT16_P (INTVAL (x)));
+}
+
+static inline bool
+m32r_legitimate_offset_addres_p (enum machine_mode mode ATTRIBUTE_UNUSED,
+ const_rtx x, bool strict)
+{
+ if (GET_CODE (x) == PLUS
+ && m32r_rtx_ok_for_base_p (XEXP (x, 0), strict)
+ && m32r_rtx_ok_for_offset_p (XEXP (x, 1)))
+ return true;
+
+ return false;
+}
+
+/* For LO_SUM addresses, do not allow them if the MODE is > 1 word,
+ since more than one instruction will be required. */
+
+static inline bool
+m32r_legitimate_lo_sum_addres_p (enum machine_mode mode, const_rtx x,
+ bool strict)
+{
+ if (GET_CODE (x) == LO_SUM
+ && (mode != BLKmode && GET_MODE_SIZE (mode) <= UNITS_PER_WORD)
+ && m32r_rtx_ok_for_base_p (XEXP (x, 0), strict)
+ && CONSTANT_P (XEXP (x, 1)))
+ return true;
+
+ return false;
+}
+
+/* Is this a load and increment operation. */
+
+static inline bool
+m32r_load_postinc_p (enum machine_mode mode, const_rtx x, bool strict)
+{
+ if ((mode == SImode || mode == SFmode)
+ && GET_CODE (x) == POST_INC
+ && REG_P (XEXP (x, 0))
+ && m32r_rtx_ok_for_base_p (XEXP (x, 0), strict))
+ return true;
+
+ return false;
+}
+
+/* Is this an increment/decrement and store operation. */
+
+static inline bool
+m32r_store_preinc_predec_p (enum machine_mode mode, const_rtx x, bool strict)
+{
+ if ((mode == SImode || mode == SFmode)
+ && (GET_CODE (x) == PRE_INC || GET_CODE (x) == PRE_DEC)
+ && REG_P (XEXP (x, 0)) \
+ && m32r_rtx_ok_for_base_p (XEXP (x, 0), strict))
+ return true;
+
+ return false;
+}
+
+/* Implement TARGET_LEGITIMATE_ADDRESS_P. */
+
+static bool
+m32r_legitimate_address_p (enum machine_mode mode, rtx x, bool strict)
+{
+ if (m32r_rtx_ok_for_base_p (x, strict)
+ || m32r_legitimate_offset_addres_p (mode, x, strict)
+ || m32r_legitimate_lo_sum_addres_p (mode, x, strict)
+ || m32r_load_postinc_p (mode, x, strict)
+ || m32r_store_preinc_predec_p (mode, x, strict))
+ return true;
+
+ return false;
+}
+
static void
m32r_conditional_register_usage (void)
{
diff --git a/gcc/config/m32r/m32r.h b/gcc/config/m32r/m32r.h
index 9b3fbcc8827..ef24ec1090c 100644
--- a/gcc/config/m32r/m32r.h
+++ b/gcc/config/m32r/m32r.h
@@ -1,6 +1,6 @@
/* Definitions of target machine for GNU compiler, Renesas M32R cpu.
Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
- 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+ 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
This file is part of GCC.
@@ -858,99 +858,6 @@ L2: .word STATIC
&& (GET_CODE (XEXP (XEXP (X, 0), 0)) == SYMBOL_REF || GET_CODE (XEXP (XEXP (X, 0), 0)) == LABEL_REF) \
&& CONST_INT_P (XEXP (XEXP (X, 0), 1)) \
&& (unsigned HOST_WIDE_INT) INTVAL (XEXP (XEXP (X, 0), 1)) > 32767))
-
-/* The macros REG_OK_FOR..._P assume that the arg is a REG rtx
- and check its validity for a certain class.
- We have two alternate definitions for each of them.
- The usual definition accepts all pseudo regs; the other rejects
- them unless they have been allocated suitable hard regs.
- The symbol REG_OK_STRICT causes the latter definition to be used.
-
- Most source files want to accept pseudo regs in the hope that
- they will get allocated to the class that the insn wants them to be in.
- Source files for reload pass need to be strict.
- After reload, it makes no difference, since pseudo regs have
- been eliminated by then. */
-
-#ifdef REG_OK_STRICT
-
-/* Nonzero if X is a hard reg that can be used as a base reg. */
-#define REG_OK_FOR_BASE_P(X) GPR_P (REGNO (X))
-/* Nonzero if X is a hard reg that can be used as an index. */
-#define REG_OK_FOR_INDEX_P(X) REG_OK_FOR_BASE_P (X)
-
-#else
-
-/* Nonzero if X is a hard reg that can be used as a base reg
- or if it is a pseudo reg. */
-#define REG_OK_FOR_BASE_P(X) \
- (GPR_P (REGNO (X)) \
- || (REGNO (X)) == ARG_POINTER_REGNUM \
- || REGNO (X) >= FIRST_PSEUDO_REGISTER)
-/* Nonzero if X is a hard reg that can be used as an index
- or if it is a pseudo reg. */
-#define REG_OK_FOR_INDEX_P(X) REG_OK_FOR_BASE_P (X)
-
-#endif
-
-/* GO_IF_LEGITIMATE_ADDRESS recognizes an RTL expression
- that is a valid memory address for an instruction.
- The MODE argument is the machine mode for the MEM expression
- that wants to use this address. */
-
-/* Local to this file. */
-#define RTX_OK_FOR_BASE_P(X) (REG_P (X) && REG_OK_FOR_BASE_P (X))
-
-/* Local to this file. */
-#define RTX_OK_FOR_OFFSET_P(X) \
- (CONST_INT_P (X) && INT16_P (INTVAL (X)))
-
-/* Local to this file. */
-#define LEGITIMATE_OFFSET_ADDRESS_P(MODE, X) \
- (GET_CODE (X) == PLUS \
- && RTX_OK_FOR_BASE_P (XEXP (X, 0)) \
- && RTX_OK_FOR_OFFSET_P (XEXP (X, 1)))
-
-/* Local to this file. */
-/* For LO_SUM addresses, do not allow them if the MODE is > 1 word,
- since more than one instruction will be required. */
-#define LEGITIMATE_LO_SUM_ADDRESS_P(MODE, X) \
- (GET_CODE (X) == LO_SUM \
- && (MODE != BLKmode && GET_MODE_SIZE (MODE) <= UNITS_PER_WORD)\
- && RTX_OK_FOR_BASE_P (XEXP (X, 0)) \
- && CONSTANT_P (XEXP (X, 1)))
-
-/* Local to this file. */
-/* Is this a load and increment operation. */
-#define LOAD_POSTINC_P(MODE, X) \
- (((MODE) == SImode || (MODE) == SFmode) \
- && GET_CODE (X) == POST_INC \
- && REG_P (XEXP (X, 0)) \
- && RTX_OK_FOR_BASE_P (XEXP (X, 0)))
-
-/* Local to this file. */
-/* Is this an increment/decrement and store operation. */
-#define STORE_PREINC_PREDEC_P(MODE, X) \
- (((MODE) == SImode || (MODE) == SFmode) \
- && (GET_CODE (X) == PRE_INC || GET_CODE (X) == PRE_DEC) \
- && REG_P (XEXP (X, 0)) \
- && RTX_OK_FOR_BASE_P (XEXP (X, 0)))
-
-#define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR) \
- do \
- { \
- if (RTX_OK_FOR_BASE_P (X)) \
- goto ADDR; \
- if (LEGITIMATE_OFFSET_ADDRESS_P ((MODE), (X))) \
- goto ADDR; \
- if (LEGITIMATE_LO_SUM_ADDRESS_P ((MODE), (X))) \
- goto ADDR; \
- if (LOAD_POSTINC_P ((MODE), (X))) \
- goto ADDR; \
- if (STORE_PREINC_PREDEC_P ((MODE), (X))) \
- goto ADDR; \
- } \
- while (0)
/* Condition code usage. */
diff --git a/gcc/config/m68k/linux.h b/gcc/config/m68k/linux.h
index 9146024acbc..82417b477bd 100644
--- a/gcc/config/m68k/linux.h
+++ b/gcc/config/m68k/linux.h
@@ -1,7 +1,7 @@
/* Definitions for Motorola 68k running Linux-based GNU systems with
ELF format.
Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2002, 2003, 2004, 2006,
- 2007, 2009, 2010 Free Software Foundation, Inc.
+ 2007, 2009, 2010, 2011 Free Software Foundation, Inc.
This file is part of GCC.
@@ -24,8 +24,7 @@ along with GCC; see the file COPYING3. If not see
/* Add %(asm_cpu_spec) to a generic definition of ASM_SPEC. */
#undef ASM_SPEC
-#define ASM_SPEC "%(asm_cpu_spec) %(asm_pcrel_spec) \
- %{Qy:} %{!Qn:-Qy} %{Ym,*} %{Yd,*}"
+#define ASM_SPEC "%(asm_cpu_spec) %(asm_pcrel_spec)"
#undef PREFERRED_STACK_BOUNDARY
#define PREFERRED_STACK_BOUNDARY 32
diff --git a/gcc/config/m68k/uclinux.opt b/gcc/config/m68k/uclinux.opt
new file mode 100644
index 00000000000..53764995244
--- /dev/null
+++ b/gcc/config/m68k/uclinux.opt
@@ -0,0 +1,36 @@
+; m68k/ColdFire uClinux options.
+
+; Copyright (C) 2011
+; Free Software Foundation, Inc.
+;
+; This file is part of GCC.
+;
+; GCC is free software; you can redistribute it and/or modify it under
+; the terms of the GNU General Public License as published by the Free
+; Software Foundation; either version 3, or (at your option) any later
+; version.
+;
+; GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+; WARRANTY; without even the implied warranty of MERCHANTABILITY or
+; FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+; for more details.
+;
+; You should have received a copy of the GNU General Public License
+; along with GCC; see the file COPYING3. If not see
+; <http://www.gnu.org/licenses/>.
+
+; See the GCC internals manual (options.texi) for a description of
+; this file's format.
+
+; Please try to keep this file in ASCII collating order.
+
+elf2flt
+Driver
+
+elf2flt=
+Driver JoinedOrMissing
+
+static-libc
+Driver
+
+; This comment is to ensure we retain the blank line above.
diff --git a/gcc/config/mcore/constraints.md b/gcc/config/mcore/constraints.md
new file mode 100644
index 00000000000..dee98077579
--- /dev/null
+++ b/gcc/config/mcore/constraints.md
@@ -0,0 +1,112 @@
+;; Constraint definitions for the Motorola MCore
+;; Copyright (C) 2011
+;; Free Software Foundation, Inc.
+
+;; This file is part of GCC.
+
+;; GCC is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 3, or (at your option)
+;; any later version.
+
+;; GCC is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GCC; see the file COPYING3. If not see
+;; <http://www.gnu.org/licenses/>.
+
+;; Register constraints.
+(define_register_constraint "a" "LRW_REGS"
+ "@internal")
+
+(define_register_constraint "b" "ONLYR1_REGS"
+ "@internal")
+
+(define_register_constraint "c" "C_REGS"
+ "@internal")
+
+(define_register_constraint "x" "ALL_REGS"
+ "@internal")
+
+;; Integer constraints.
+(define_constraint "I"
+ "An integer in the range 0 to 127."
+ (and (match_code "const_int")
+ (match_test "IN_RANGE (ival, 0, 127)")))
+
+(define_constraint "J"
+ "An integer in the range 1 to 32."
+ (and (match_code "const_int")
+ (match_test "IN_RANGE (ival, 1, 32)")))
+
+(define_constraint "K"
+ "A shift operand, an integer in the range 0 to 31."
+ (and (match_code "const_int")
+ (match_test "IN_RANGE (ival, 0, 31)")))
+
+(define_constraint "L"
+ "A negative arithmetic operand in the range -32 to -1."
+ (and (match_code "const_int")
+ (match_test "IN_RANGE (ival, -32, -1)")))
+
+(define_constraint "M"
+ "A constant loadable by bgeni."
+ (and (match_code "const_int")
+ (match_test "exact_log2 (ival) >= 0 && exact_log2 (ival) <= 30")))
+
+(define_constraint "N"
+ "A constant loadable by bmaskii, including -1."
+ (and (match_code "const_int")
+ (ior (match_test "ival == -1")
+ (and (match_test "exact_log2 (ival + 1) >= 0")
+ (match_test "exact_log2 (ival + 1) <= 30")))))
+
+(define_constraint "O"
+ "A constant allowed by cmov with two constants +/- 1 of each other."
+ (and (match_code "const_int")
+ (ior (match_test "insn_const_int_ok_for_constraint (ival, CONSTRAINT_I)")
+ (match_test "insn_const_int_ok_for_constraint (ival, CONSTRAINT_M)")
+ (match_test "insn_const_int_ok_for_constraint (ival, CONSTRAINT_N)")
+ (match_test "insn_const_int_ok_for_constraint (ival - 1, CONSTRAINT_M)")
+ (match_test "insn_const_int_ok_for_constraint (ival + 1, CONSTRAINT_N)"))))
+
+(define_constraint "P"
+ "A value that can be generated without an lrw instruction."
+ (and (match_code "const_int")
+ (match_test "mcore_const_ok_for_inline (ival)")))
+
+;; Floating-point constraints.
+(define_constraint "G"
+ "@internal"
+ (and (match_code "const_double")
+ (match_test "insn_const_int_ok_for_constraint (hval, CONSTRAINT_I)")
+ (match_test "insn_const_int_ok_for_constraint (ival, CONSTRAINT_I)")))
+
+;; Other constraints.
+(define_constraint "Q"
+ "The integer constant one."
+ (and (match_code "const_int")
+ (match_test "ival == 1")))
+
+(define_constraint "R"
+ "@internal"
+ (and (match_code "mem")
+ (match_test "GET_CODE (XEXP (op, 0)) == LABEL_REF")))
+
+(define_constraint "S"
+ "An integer constant with 0, 1, or 2 bits clear."
+ (and (match_code "const_int")
+ (match_test "mcore_num_zeros (ival) <= 2")))
+
+(define_constraint "T"
+ "An integer constant with 2 set bits."
+ (and (match_code "const_int")
+ (match_test "mcore_num_ones (ival) == 2")))
+
+(define_constraint "U"
+ "The integer constant zero."
+ (and (match_code "const_int")
+ (match_test "ival == 0")))
diff --git a/gcc/config/mcore/mcore.c b/gcc/config/mcore/mcore.c
index 6227b174c39..8118276a87b 100644
--- a/gcc/config/mcore/mcore.c
+++ b/gcc/config/mcore/mcore.c
@@ -61,19 +61,6 @@ const enum reg_class regno_reg_class[FIRST_PSEUDO_REGISTER] =
GENERAL_REGS, C_REGS, NO_REGS, NO_REGS,
};
-/* Provide reg_class from a letter such as appears in the machine
- description. */
-const enum reg_class reg_class_from_letter[] =
-{
- /* a */ LRW_REGS, /* b */ ONLYR1_REGS, /* c */ C_REGS, /* d */ NO_REGS,
- /* e */ NO_REGS, /* f */ NO_REGS, /* g */ NO_REGS, /* h */ NO_REGS,
- /* i */ NO_REGS, /* j */ NO_REGS, /* k */ NO_REGS, /* l */ NO_REGS,
- /* m */ NO_REGS, /* n */ NO_REGS, /* o */ NO_REGS, /* p */ NO_REGS,
- /* q */ NO_REGS, /* r */ GENERAL_REGS, /* s */ NO_REGS, /* t */ NO_REGS,
- /* u */ NO_REGS, /* v */ NO_REGS, /* w */ NO_REGS, /* x */ ALL_REGS,
- /* y */ NO_REGS, /* z */ NO_REGS
-};
-
struct mcore_frame
{
int arg_size; /* Stdarg spills (bytes). */
diff --git a/gcc/config/mcore/mcore.h b/gcc/config/mcore/mcore.h
index 3f76e18eab1..54c12ef3dd8 100644
--- a/gcc/config/mcore/mcore.h
+++ b/gcc/config/mcore/mcore.h
@@ -374,82 +374,23 @@ extern const enum reg_class regno_reg_class[FIRST_PSEUDO_REGISTER];
#define INDEX_REG_CLASS NO_REGS
#define BASE_REG_CLASS GENERAL_REGS
-/* Get reg_class from a letter such as appears in the machine
- description. */
-extern const enum reg_class reg_class_from_letter[];
-
-#define REG_CLASS_FROM_LETTER(C) \
- (ISLOWER (C) ? reg_class_from_letter[(C) - 'a'] : NO_REGS)
-
-/* The letters I, J, K, L, M, N, O, and P in a register constraint string
- can be used to stand for particular ranges of immediate operands.
- This macro defines what the ranges are.
- C is the letter, and VALUE is a constant value.
- Return 1 if VALUE is in the range specified by C.
- I: loadable by movi (0..127)
- J: arithmetic operand 1..32
- K: shift operand 0..31
- L: negative arithmetic operand -1..-32
- M: powers of two, constants loadable by bgeni
- N: powers of two minus 1, constants loadable by bmaski, including -1
- O: allowed by cmov with two constants +/- 1 of each other
- P: values we will generate 'inline' -- without an 'lrw'
-
- Others defined for use after reload
- Q: constant 1
- R: a label
- S: 0/1/2 cleared bits out of 32 [for bclri's]
- T: 2 set bits out of 32 [for bseti's]
- U: constant 0
- xxxS: 1 cleared bit out of 32 (complement of power of 2). for bclri
- xxxT: 2 cleared bits out of 32. for pairs of bclris. */
-#define CONST_OK_FOR_I(VALUE) (((HOST_WIDE_INT)(VALUE)) >= 0 && ((HOST_WIDE_INT)(VALUE)) <= 0x7f)
-#define CONST_OK_FOR_J(VALUE) (((HOST_WIDE_INT)(VALUE)) > 0 && ((HOST_WIDE_INT)(VALUE)) <= 32)
-#define CONST_OK_FOR_L(VALUE) (((HOST_WIDE_INT)(VALUE)) < 0 && ((HOST_WIDE_INT)(VALUE)) >= -32)
-#define CONST_OK_FOR_K(VALUE) (((HOST_WIDE_INT)(VALUE)) >= 0 && ((HOST_WIDE_INT)(VALUE)) <= 31)
-#define CONST_OK_FOR_M(VALUE) (exact_log2 (VALUE) >= 0 && exact_log2 (VALUE) <= 30)
-#define CONST_OK_FOR_N(VALUE) (((HOST_WIDE_INT)(VALUE)) == -1 || (exact_log2 ((VALUE) + 1) >= 0 && exact_log2 ((VALUE) + 1) <= 30))
-#define CONST_OK_FOR_O(VALUE) (CONST_OK_FOR_I(VALUE) || \
- CONST_OK_FOR_M(VALUE) || \
- CONST_OK_FOR_N(VALUE) || \
- CONST_OK_FOR_M((HOST_WIDE_INT)(VALUE) - 1) || \
- CONST_OK_FOR_N((HOST_WIDE_INT)(VALUE) + 1))
-
-#define CONST_OK_FOR_P(VALUE) (mcore_const_ok_for_inline (VALUE))
-
-#define CONST_OK_FOR_LETTER_P(VALUE, C) \
- ((C) == 'I' ? CONST_OK_FOR_I (VALUE) \
- : (C) == 'J' ? CONST_OK_FOR_J (VALUE) \
- : (C) == 'L' ? CONST_OK_FOR_L (VALUE) \
- : (C) == 'K' ? CONST_OK_FOR_K (VALUE) \
- : (C) == 'M' ? CONST_OK_FOR_M (VALUE) \
- : (C) == 'N' ? CONST_OK_FOR_N (VALUE) \
- : (C) == 'P' ? CONST_OK_FOR_P (VALUE) \
- : (C) == 'O' ? CONST_OK_FOR_O (VALUE) \
- : 0)
-
-/* Similar, but for floating constants, and defining letters G and H.
- Here VALUE is the CONST_DOUBLE rtx itself. */
-#define CONST_DOUBLE_OK_FOR_LETTER_P(VALUE, C) \
- ((C) == 'G' ? CONST_OK_FOR_I (CONST_DOUBLE_HIGH (VALUE)) \
- && CONST_OK_FOR_I (CONST_DOUBLE_LOW (VALUE)) \
- : 0)
-
-/* Letters in the range `Q' through `U' in a register constraint string
- may be defined in a machine-dependent fashion to stand for arbitrary
- operand types. */
-#define EXTRA_CONSTRAINT(OP, C) \
- ((C) == 'R' ? (GET_CODE (OP) == MEM \
- && GET_CODE (XEXP (OP, 0)) == LABEL_REF) \
- : (C) == 'S' ? (GET_CODE (OP) == CONST_INT \
- && mcore_num_zeros (INTVAL (OP)) <= 2) \
- : (C) == 'T' ? (GET_CODE (OP) == CONST_INT \
- && mcore_num_ones (INTVAL (OP)) == 2) \
- : (C) == 'Q' ? (GET_CODE (OP) == CONST_INT \
- && INTVAL(OP) == 1) \
- : (C) == 'U' ? (GET_CODE (OP) == CONST_INT \
- && INTVAL(OP) == 0) \
- : 0)
+/* Convenience wrappers around insn_const_int_ok_for_constraint. */
+#define CONST_OK_FOR_I(VALUE) \
+ insn_const_int_ok_for_constraint (VALUE, CONSTRAINT_I)
+#define CONST_OK_FOR_J(VALUE) \
+ insn_const_int_ok_for_constraint (VALUE, CONSTRAINT_J)
+#define CONST_OK_FOR_L(VALUE) \
+ insn_const_int_ok_for_constraint (VALUE, CONSTRAINT_L)
+#define CONST_OK_FOR_K(VALUE) \
+ insn_const_int_ok_for_constraint (VALUE, CONSTRAINT_K)
+#define CONST_OK_FOR_M(VALUE) \
+ insn_const_int_ok_for_constraint (VALUE, CONSTRAINT_M)
+#define CONST_OK_FOR_N(VALUE) \
+ insn_const_int_ok_for_constraint (VALUE, CONSTRAINT_N)
+#define CONST_OK_FOR_O(VALUE) \
+ insn_const_int_ok_for_constraint (VALUE, CONSTRAINT_O)
+#define CONST_OK_FOR_P(VALUE) \
+ insn_const_int_ok_for_constraint (VALUE, CONSTRAINT_P)
/* Given an rtx X being reloaded into a reg required to be
in class CLASS, return the class of reg to actually use.
diff --git a/gcc/config/mcore/mcore.md b/gcc/config/mcore/mcore.md
index 532181db0cc..c56a0c6aea1 100644
--- a/gcc/config/mcore/mcore.md
+++ b/gcc/config/mcore/mcore.md
@@ -54,6 +54,7 @@
"nothing")
(include "predicates.md")
+(include "constraints.md")
;; -------------------------------------------------------------------------
;; Test and bit test
diff --git a/gcc/config/microblaze/microblaze.opt b/gcc/config/microblaze/microblaze.opt
index 57380999626..97f316142b6 100644
--- a/gcc/config/microblaze/microblaze.opt
+++ b/gcc/config/microblaze/microblaze.opt
@@ -1,6 +1,6 @@
; Options for the MicroBlaze port of the compiler
;
-; Copyright 2009, 2010 Free Software Foundation, Inc.
+; Copyright 2009, 2010, 2011 Free Software Foundation, Inc.
;
; Contributed by Michael Eager <eager@eagercon.com>.
;
@@ -20,6 +20,21 @@
; along with GCC; see the file COPYING3. If not see
; <http://www.gnu.org/licenses/>. */
+Zxl-mode-bootstrap
+Driver
+
+Zxl-mode-executable
+Driver
+
+Zxl-mode-novectors
+Driver
+
+Zxl-mode-xilkernel
+Driver
+
+Zxl-mode-xmdstub
+Driver
+
msoft-float
Target Report RejectNegative Mask(SOFT_FLOAT)
Use software emulation for floating point (default)
@@ -95,3 +110,6 @@ Description for mxl-mode-bootstrap
mxl-mode-novectors
Target Mask(XL_MODE_NOVECTORS)
Description for mxl-mode-novectors
+
+mxl-mode-xilkernel
+Target
diff --git a/gcc/config/mips/iris6.h b/gcc/config/mips/iris6.h
index 4663c2a9d26..edf8020f564 100644
--- a/gcc/config/mips/iris6.h
+++ b/gcc/config/mips/iris6.h
@@ -1,6 +1,6 @@
/* Definitions of target machine for GNU compiler. IRIX 6.5 version.
Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 2000,
- 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
+ 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
Free Software Foundation, Inc.
This file is part of GCC.
@@ -38,6 +38,9 @@ along with GCC; see the file COPYING3. If not see
/* Configuration-independent MIPS rules. */ \
BASE_DRIVER_SELF_SPECS
+/* IRIX 6.5 has the float and long double forms of math functions. */
+#define TARGET_C99_FUNCTIONS 1
+
/* MIPS specific debugging info */
#define MIPS_DEBUGGING_INFO 1
diff --git a/gcc/config/mips/iris6.opt b/gcc/config/mips/iris6.opt
new file mode 100644
index 00000000000..05fc378c56b
--- /dev/null
+++ b/gcc/config/mips/iris6.opt
@@ -0,0 +1,45 @@
+; IRIX 6.5 options.
+
+; Copyright (C) 2011
+; Free Software Foundation, Inc.
+;
+; This file is part of GCC.
+;
+; GCC is free software; you can redistribute it and/or modify it under
+; the terms of the GNU General Public License as published by the Free
+; Software Foundation; either version 3, or (at your option) any later
+; version.
+;
+; GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+; WARRANTY; without even the implied warranty of MERCHANTABILITY or
+; FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+; for more details.
+;
+; You should have received a copy of the GNU General Public License
+; along with GCC; see the file COPYING3. If not see
+; <http://www.gnu.org/licenses/>.
+
+; See the GCC internals manual (options.texi) for a description of
+; this file's format.
+
+; Please try to keep this file in ASCII collating order.
+
+bestGnum
+Driver
+
+call_shared
+Driver
+
+exact_version
+Driver
+
+no_archive
+Driver
+
+non_shared
+Driver
+
+pthread
+Driver
+
+; This comment is to ensure we retain the blank line above.
diff --git a/gcc/config/mips/mips.opt b/gcc/config/mips/mips.opt
index 6ec3ddf5ba5..20b0b6cde6a 100644
--- a/gcc/config/mips/mips.opt
+++ b/gcc/config/mips/mips.opt
@@ -1,6 +1,6 @@
; Options for the MIPS port of the compiler
;
-; Copyright (C) 2005, 2007, 2008, 2010 Free Software Foundation, Inc.
+; Copyright (C) 2005, 2007, 2008, 2010, 2011 Free Software Foundation, Inc.
;
; This file is part of GCC.
;
@@ -18,6 +18,12 @@
; along with GCC; see the file COPYING3. If not see
; <http://www.gnu.org/licenses/>.
+EB
+Driver
+
+EL
+Driver
+
mabi=
Target RejectNegative Joined
-mabi=ABI Generate code that conforms to the given ABI
@@ -233,7 +239,7 @@ Target RejectNegative
Do not use a cache-flushing function before calling stack trampolines
mno-mdmx
-Target Report RejectNegative InverseVar(MDMX)
+Target Report RejectNegative Var(TARGET_MDMX, 0)
Do not use MDMX instructions
mno-mips16
@@ -299,3 +305,6 @@ Perform VR4130-specific alignment optimizations
mxgot
Target Report Var(TARGET_XGOT)
Lift restrictions on GOT size
+
+noasmopt
+Driver
diff --git a/gcc/config/mn10300/constraints.md b/gcc/config/mn10300/constraints.md
index a4816c1e20c..c8ee2d4e2d9 100644
--- a/gcc/config/mn10300/constraints.md
+++ b/gcc/config/mn10300/constraints.md
@@ -94,6 +94,12 @@
(ior (match_test "ival == 255")
(match_test "ival == 65535"))))
+(define_constraint "O"
+ "An integer between -8 and +7 inclusive."
+ (and (match_code "const_int")
+ (and (match_test "ival >= -8")
+ (match_test "ival <= 7"))))
+
;; Floating-point constraints
(define_constraint "G"
"Floating-point zero."
diff --git a/gcc/config/mn10300/mn10300.c b/gcc/config/mn10300/mn10300.c
index 8a042f658a4..0b68f2d3e85 100644
--- a/gcc/config/mn10300/mn10300.c
+++ b/gcc/config/mn10300/mn10300.c
@@ -1,6 +1,6 @@
/* Subroutines for insn-output.c for Matsushita MN10300 series
Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
- 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+ 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
Contributed by Jeff Law (law@cygnus.com).
This file is part of GCC.
@@ -40,6 +40,7 @@
#include "obstack.h"
#include "diagnostic-core.h"
#include "tm_p.h"
+#include "tm-constrs.h"
#include "target.h"
#include "target-def.h"
#include "df.h"
@@ -165,6 +166,16 @@ mn10300_file_start (void)
fprintf (asm_out_file, "\t.am33\n");
}
+/* Note: This list must match the liw_op attribute in mn10300.md. */
+
+static const char *liw_op_names[] =
+{
+ "add", "cmp", "sub", "mov",
+ "and", "or", "xor",
+ "asr", "lsr", "asl",
+ "none", "max"
+};
+
/* Print operand X using operand code CODE to assembly language output file
FILE. */
@@ -173,309 +184,319 @@ mn10300_print_operand (FILE *file, rtx x, int code)
{
switch (code)
{
- case 'b':
- case 'B':
- {
- enum rtx_code cmp = GET_CODE (x);
- enum machine_mode mode = GET_MODE (XEXP (x, 0));
- const char *str;
- int have_flags;
-
- if (code == 'B')
- cmp = reverse_condition (cmp);
- have_flags = cc_flags_for_mode (mode);
-
- switch (cmp)
- {
- case NE:
- str = "ne";
- break;
- case EQ:
- str = "eq";
- break;
- case GE:
- /* bge is smaller than bnc. */
- str = (have_flags & CC_FLAG_V ? "ge" : "nc");
- break;
- case LT:
- str = (have_flags & CC_FLAG_V ? "lt" : "ns");
- break;
- case GT:
- str = "gt";
- break;
- case LE:
- str = "le";
- break;
- case GEU:
- str = "cc";
- break;
- case GTU:
- str = "hi";
- break;
- case LEU:
- str = "ls";
- break;
- case LTU:
- str = "cs";
- break;
- case ORDERED:
- str = "lge";
- break;
- case UNORDERED:
- str = "uo";
- break;
- case LTGT:
- str = "lg";
- break;
- case UNEQ:
- str = "ue";
- break;
- case UNGE:
- str = "uge";
- break;
- case UNGT:
- str = "ug";
- break;
- case UNLE:
- str = "ule";
- break;
- case UNLT:
- str = "ul";
- break;
- default:
- gcc_unreachable ();
- }
+ case 'W':
+ {
+ unsigned int liw_op = UINTVAL (x);
- gcc_checking_assert ((cc_flags_for_code (cmp) & ~have_flags) == 0);
- fputs (str, file);
- }
+ gcc_assert (TARGET_ALLOW_LIW);
+ gcc_assert (liw_op < LIW_OP_MAX);
+ fputs (liw_op_names[liw_op], file);
break;
+ }
- case 'C':
- /* This is used for the operand to a call instruction;
- if it's a REG, enclose it in parens, else output
- the operand normally. */
- if (REG_P (x))
- {
- fputc ('(', file);
- mn10300_print_operand (file, x, 0);
- fputc (')', file);
- }
- else
- mn10300_print_operand (file, x, 0);
- break;
+ case 'b':
+ case 'B':
+ {
+ enum rtx_code cmp = GET_CODE (x);
+ enum machine_mode mode = GET_MODE (XEXP (x, 0));
+ const char *str;
+ int have_flags;
- case 'D':
- switch (GET_CODE (x))
+ if (code == 'B')
+ cmp = reverse_condition (cmp);
+ have_flags = cc_flags_for_mode (mode);
+
+ switch (cmp)
{
- case MEM:
- fputc ('(', file);
- output_address (XEXP (x, 0));
- fputc (')', file);
+ case NE:
+ str = "ne";
break;
-
- case REG:
- fprintf (file, "fd%d", REGNO (x) - 18);
+ case EQ:
+ str = "eq";
+ break;
+ case GE:
+ /* bge is smaller than bnc. */
+ str = (have_flags & CC_FLAG_V ? "ge" : "nc");
+ break;
+ case LT:
+ str = (have_flags & CC_FLAG_V ? "lt" : "ns");
+ break;
+ case GT:
+ str = "gt";
+ break;
+ case LE:
+ str = "le";
+ break;
+ case GEU:
+ str = "cc";
+ break;
+ case GTU:
+ str = "hi";
+ break;
+ case LEU:
+ str = "ls";
+ break;
+ case LTU:
+ str = "cs";
+ break;
+ case ORDERED:
+ str = "lge";
+ break;
+ case UNORDERED:
+ str = "uo";
+ break;
+ case LTGT:
+ str = "lg";
+ break;
+ case UNEQ:
+ str = "ue";
+ break;
+ case UNGE:
+ str = "uge";
+ break;
+ case UNGT:
+ str = "ug";
+ break;
+ case UNLE:
+ str = "ule";
+ break;
+ case UNLT:
+ str = "ul";
break;
-
default:
gcc_unreachable ();
}
- break;
+
+ gcc_checking_assert ((cc_flags_for_code (cmp) & ~have_flags) == 0);
+ fputs (str, file);
+ }
+ break;
+
+ case 'C':
+ /* This is used for the operand to a call instruction;
+ if it's a REG, enclose it in parens, else output
+ the operand normally. */
+ if (REG_P (x))
+ {
+ fputc ('(', file);
+ mn10300_print_operand (file, x, 0);
+ fputc (')', file);
+ }
+ else
+ mn10300_print_operand (file, x, 0);
+ break;
+
+ case 'D':
+ switch (GET_CODE (x))
+ {
+ case MEM:
+ fputc ('(', file);
+ output_address (XEXP (x, 0));
+ fputc (')', file);
+ break;
+
+ case REG:
+ fprintf (file, "fd%d", REGNO (x) - 18);
+ break;
+
+ default:
+ gcc_unreachable ();
+ }
+ break;
/* These are the least significant word in a 64bit value. */
- case 'L':
- switch (GET_CODE (x))
- {
- case MEM:
- fputc ('(', file);
- output_address (XEXP (x, 0));
- fputc (')', file);
- break;
+ case 'L':
+ switch (GET_CODE (x))
+ {
+ case MEM:
+ fputc ('(', file);
+ output_address (XEXP (x, 0));
+ fputc (')', file);
+ break;
- case REG:
- fprintf (file, "%s", reg_names[REGNO (x)]);
- break;
+ case REG:
+ fprintf (file, "%s", reg_names[REGNO (x)]);
+ break;
- case SUBREG:
- fprintf (file, "%s", reg_names[subreg_regno (x)]);
- break;
+ case SUBREG:
+ fprintf (file, "%s", reg_names[subreg_regno (x)]);
+ break;
- case CONST_DOUBLE:
- {
- long val[2];
- REAL_VALUE_TYPE rv;
+ case CONST_DOUBLE:
+ {
+ long val[2];
+ REAL_VALUE_TYPE rv;
- switch (GET_MODE (x))
- {
- case DFmode:
- REAL_VALUE_FROM_CONST_DOUBLE (rv, x);
- REAL_VALUE_TO_TARGET_DOUBLE (rv, val);
- fprintf (file, "0x%lx", val[0]);
- break;;
- case SFmode:
- REAL_VALUE_FROM_CONST_DOUBLE (rv, x);
- REAL_VALUE_TO_TARGET_SINGLE (rv, val[0]);
- fprintf (file, "0x%lx", val[0]);
- break;;
- case VOIDmode:
- case DImode:
- mn10300_print_operand_address (file,
- GEN_INT (CONST_DOUBLE_LOW (x)));
- break;
- default:
- break;
- }
+ switch (GET_MODE (x))
+ {
+ case DFmode:
+ REAL_VALUE_FROM_CONST_DOUBLE (rv, x);
+ REAL_VALUE_TO_TARGET_DOUBLE (rv, val);
+ fprintf (file, "0x%lx", val[0]);
+ break;;
+ case SFmode:
+ REAL_VALUE_FROM_CONST_DOUBLE (rv, x);
+ REAL_VALUE_TO_TARGET_SINGLE (rv, val[0]);
+ fprintf (file, "0x%lx", val[0]);
+ break;;
+ case VOIDmode:
+ case DImode:
+ mn10300_print_operand_address (file,
+ GEN_INT (CONST_DOUBLE_LOW (x)));
+ break;
+ default:
break;
}
+ break;
+ }
- case CONST_INT:
- {
- rtx low, high;
- split_double (x, &low, &high);
- fprintf (file, "%ld", (long)INTVAL (low));
- break;
+ case CONST_INT:
+ {
+ rtx low, high;
+ split_double (x, &low, &high);
+ fprintf (file, "%ld", (long)INTVAL (low));
+ break;
}
- default:
- gcc_unreachable ();
- }
- break;
+ default:
+ gcc_unreachable ();
+ }
+ break;
/* Similarly, but for the most significant word. */
- case 'H':
- switch (GET_CODE (x))
- {
- case MEM:
- fputc ('(', file);
- x = adjust_address (x, SImode, 4);
- output_address (XEXP (x, 0));
- fputc (')', file);
- break;
+ case 'H':
+ switch (GET_CODE (x))
+ {
+ case MEM:
+ fputc ('(', file);
+ x = adjust_address (x, SImode, 4);
+ output_address (XEXP (x, 0));
+ fputc (')', file);
+ break;
- case REG:
- fprintf (file, "%s", reg_names[REGNO (x) + 1]);
- break;
+ case REG:
+ fprintf (file, "%s", reg_names[REGNO (x) + 1]);
+ break;
- case SUBREG:
- fprintf (file, "%s", reg_names[subreg_regno (x) + 1]);
- break;
+ case SUBREG:
+ fprintf (file, "%s", reg_names[subreg_regno (x) + 1]);
+ break;
- case CONST_DOUBLE:
- {
- long val[2];
- REAL_VALUE_TYPE rv;
+ case CONST_DOUBLE:
+ {
+ long val[2];
+ REAL_VALUE_TYPE rv;
- switch (GET_MODE (x))
- {
- case DFmode:
- REAL_VALUE_FROM_CONST_DOUBLE (rv, x);
- REAL_VALUE_TO_TARGET_DOUBLE (rv, val);
- fprintf (file, "0x%lx", val[1]);
- break;;
- case SFmode:
- gcc_unreachable ();
- case VOIDmode:
- case DImode:
- mn10300_print_operand_address (file,
- GEN_INT (CONST_DOUBLE_HIGH (x)));
- break;
- default:
- break;
- }
+ switch (GET_MODE (x))
+ {
+ case DFmode:
+ REAL_VALUE_FROM_CONST_DOUBLE (rv, x);
+ REAL_VALUE_TO_TARGET_DOUBLE (rv, val);
+ fprintf (file, "0x%lx", val[1]);
+ break;;
+ case SFmode:
+ gcc_unreachable ();
+ case VOIDmode:
+ case DImode:
+ mn10300_print_operand_address (file,
+ GEN_INT (CONST_DOUBLE_HIGH (x)));
+ break;
+ default:
break;
}
+ break;
+ }
- case CONST_INT:
- {
- rtx low, high;
- split_double (x, &low, &high);
- fprintf (file, "%ld", (long)INTVAL (high));
- break;
- }
-
- default:
- gcc_unreachable ();
+ case CONST_INT:
+ {
+ rtx low, high;
+ split_double (x, &low, &high);
+ fprintf (file, "%ld", (long)INTVAL (high));
+ break;
}
- break;
- case 'A':
- fputc ('(', file);
- if (REG_P (XEXP (x, 0)))
- output_address (gen_rtx_PLUS (SImode, XEXP (x, 0), const0_rtx));
- else
- output_address (XEXP (x, 0));
- fputc (')', file);
- break;
+ default:
+ gcc_unreachable ();
+ }
+ break;
- case 'N':
- gcc_assert (INTVAL (x) >= -128 && INTVAL (x) <= 255);
- fprintf (file, "%d", (int)((~INTVAL (x)) & 0xff));
- break;
+ case 'A':
+ fputc ('(', file);
+ if (REG_P (XEXP (x, 0)))
+ output_address (gen_rtx_PLUS (SImode, XEXP (x, 0), const0_rtx));
+ else
+ output_address (XEXP (x, 0));
+ fputc (')', file);
+ break;
- case 'U':
- gcc_assert (INTVAL (x) >= -128 && INTVAL (x) <= 255);
- fprintf (file, "%d", (int)(INTVAL (x) & 0xff));
- break;
+ case 'N':
+ gcc_assert (INTVAL (x) >= -128 && INTVAL (x) <= 255);
+ fprintf (file, "%d", (int)((~INTVAL (x)) & 0xff));
+ break;
+
+ case 'U':
+ gcc_assert (INTVAL (x) >= -128 && INTVAL (x) <= 255);
+ fprintf (file, "%d", (int)(INTVAL (x) & 0xff));
+ break;
/* For shift counts. The hardware ignores the upper bits of
any immediate, but the assembler will flag an out of range
shift count as an error. So we mask off the high bits
of the immediate here. */
- case 'S':
- if (CONST_INT_P (x))
- {
- fprintf (file, "%d", (int)(INTVAL (x) & 0x1f));
- break;
- }
- /* FALL THROUGH */
+ case 'S':
+ if (CONST_INT_P (x))
+ {
+ fprintf (file, "%d", (int)(INTVAL (x) & 0x1f));
+ break;
+ }
+ /* FALL THROUGH */
- default:
- switch (GET_CODE (x))
- {
- case MEM:
- fputc ('(', file);
- output_address (XEXP (x, 0));
- fputc (')', file);
- break;
+ default:
+ switch (GET_CODE (x))
+ {
+ case MEM:
+ fputc ('(', file);
+ output_address (XEXP (x, 0));
+ fputc (')', file);
+ break;
- case PLUS:
- output_address (x);
- break;
+ case PLUS:
+ output_address (x);
+ break;
- case REG:
- fprintf (file, "%s", reg_names[REGNO (x)]);
- break;
+ case REG:
+ fprintf (file, "%s", reg_names[REGNO (x)]);
+ break;
- case SUBREG:
- fprintf (file, "%s", reg_names[subreg_regno (x)]);
- break;
+ case SUBREG:
+ fprintf (file, "%s", reg_names[subreg_regno (x)]);
+ break;
/* This will only be single precision.... */
- case CONST_DOUBLE:
- {
- unsigned long val;
- REAL_VALUE_TYPE rv;
-
- REAL_VALUE_FROM_CONST_DOUBLE (rv, x);
- REAL_VALUE_TO_TARGET_SINGLE (rv, val);
- fprintf (file, "0x%lx", val);
- break;
- }
+ case CONST_DOUBLE:
+ {
+ unsigned long val;
+ REAL_VALUE_TYPE rv;
- case CONST_INT:
- case SYMBOL_REF:
- case CONST:
- case LABEL_REF:
- case CODE_LABEL:
- case UNSPEC:
- mn10300_print_operand_address (file, x);
+ REAL_VALUE_FROM_CONST_DOUBLE (rv, x);
+ REAL_VALUE_TO_TARGET_SINGLE (rv, val);
+ fprintf (file, "0x%lx", val);
break;
- default:
- gcc_unreachable ();
}
- break;
- }
+
+ case CONST_INT:
+ case SYMBOL_REF:
+ case CONST:
+ case LABEL_REF:
+ case CODE_LABEL:
+ case UNSPEC:
+ mn10300_print_operand_address (file, x);
+ break;
+ default:
+ gcc_unreachable ();
+ }
+ break;
+ }
}
/* Output assembly language output for the address ADDR to FILE. */
@@ -1694,7 +1715,7 @@ mn10300_output_add (rtx operands[3], bool need_flags)
dest_class = REGNO_REG_CLASS (dest_regnum);
src1_class = REGNO_REG_CLASS (src1_regnum);
- if (GET_CODE (src2) == CONST_INT)
+ if (CONST_INT_P (src2))
{
gcc_assert (dest_regnum == src1_regnum);
@@ -1996,6 +2017,8 @@ mn10300_regno_in_class_p (unsigned regno, int rclass, bool strict)
if (!reg_renumber)
return false;
regno = reg_renumber[regno];
+ if (regno == INVALID_REGNUM)
+ return false;
}
return TEST_HARD_REG_BIT (reg_class_contents[rclass], regno);
}
@@ -2923,8 +2946,209 @@ mn10300_split_and_operand_count (rtx op)
}
}
+struct liw_data
+{
+ enum attr_liw slot;
+ enum attr_liw_op op;
+ rtx dest;
+ rtx src;
+};
+
+/* Decide if the given insn is a candidate for LIW bundling. If it is then
+ extract the operands and LIW attributes from the insn and use them to fill
+ in the liw_data structure. Return true upon success or false if the insn
+ cannot be bundled. */
+
+static bool
+extract_bundle (rtx insn, struct liw_data * pdata)
+{
+ bool allow_consts = true;
+ rtx p,s;
+
+ gcc_assert (pdata != NULL);
+
+ if (insn == NULL_RTX)
+ return false;
+ /* Make sure that we are dealing with a simple SET insn. */
+ p = single_set (insn);
+ if (p == NULL_RTX)
+ return false;
+
+ /* Make sure that it could go into one of the LIW pipelines. */
+ pdata->slot = get_attr_liw (insn);
+ if (pdata->slot == LIW_BOTH)
+ return false;
+
+ pdata->op = get_attr_liw_op (insn);
+
+ s = SET_SRC (p);
+
+ switch (pdata->op)
+ {
+ case LIW_OP_MOV:
+ pdata->dest = SET_DEST (p);
+ pdata->src = SET_SRC (p);
+ break;
+ case LIW_OP_CMP:
+ pdata->dest = XEXP (SET_SRC (p), 0);
+ pdata->src = XEXP (SET_SRC (p), 1);
+ break;
+ case LIW_OP_NONE:
+ return false;
+ case LIW_OP_AND:
+ case LIW_OP_OR:
+ case LIW_OP_XOR:
+ /* The AND, OR and XOR long instruction words only accept register arguments. */
+ allow_consts = false;
+ /* Fall through. */
+ default:
+ pdata->dest = SET_DEST (p);
+ pdata->src = XEXP (SET_SRC (p), 1);
+ break;
+ }
+
+ if (! REG_P (pdata->dest))
+ return false;
+
+ if (REG_P (pdata->src))
+ return true;
+
+ return allow_consts && satisfies_constraint_O (pdata->src);
+}
+
+/* Make sure that it is OK to execute LIW1 and LIW2 in parallel. GCC generated
+ the instructions with the assumption that LIW1 would be executed before LIW2
+ so we must check for overlaps between their sources and destinations. */
+
+static bool
+check_liw_constraints (struct liw_data * pliw1, struct liw_data * pliw2)
+{
+ /* Check for slot conflicts. */
+ if (pliw2->slot == pliw1->slot && pliw1->slot != LIW_EITHER)
+ return false;
+
+ /* If either operation is a compare, then "dest" is really an input; the real
+ destination is CC_REG. So these instructions need different checks. */
+
+ /* Changing "CMP ; OP" into "CMP | OP" is OK because the comparison will
+ check its values prior to any changes made by OP. */
+ if (pliw1->op == LIW_OP_CMP)
+ {
+ /* Two sequential comparisons means dead code, which ought to
+ have been eliminated given that bundling only happens with
+ optimization. We cannot bundle them in any case. */
+ gcc_assert (pliw1->op != pliw2->op);
+ return true;
+ }
+
+ /* Changing "OP ; CMP" into "OP | CMP" does not work if the value being compared
+ is the destination of OP, as the CMP will look at the old value, not the new
+ one. */
+ if (pliw2->op == LIW_OP_CMP)
+ {
+ if (REGNO (pliw2->dest) == REGNO (pliw1->dest))
+ return false;
+
+ if (REG_P (pliw2->src))
+ return REGNO (pliw2->src) != REGNO (pliw1->dest);
+
+ return true;
+ }
+
+ /* Changing "OP1 ; OP2" into "OP1 | OP2" does not work if they both write to the
+ same destination register. */
+ if (REGNO (pliw2->dest) == REGNO (pliw1->dest))
+ return false;
+
+ /* Changing "OP1 ; OP2" into "OP1 | OP2" generally does not work if the destination
+ of OP1 is the source of OP2. The exception is when OP1 is a MOVE instruction when
+ we can replace the source in OP2 with the source of OP1. */
+ if (REG_P (pliw2->src) && REGNO (pliw2->src) == REGNO (pliw1->dest))
+ {
+ if (pliw1->op == LIW_OP_MOV && REG_P (pliw1->src))
+ {
+ if (! REG_P (pliw1->src)
+ && (pliw2->op == LIW_OP_AND
+ || pliw2->op == LIW_OP_OR
+ || pliw2->op == LIW_OP_XOR))
+ return false;
+
+ pliw2->src = pliw1->src;
+ return true;
+ }
+ return false;
+ }
+
+ /* Everything else is OK. */
+ return true;
+}
+
+/* Combine pairs of insns into LIW bundles. */
+
+static void
+mn10300_bundle_liw (void)
+{
+ rtx r;
+
+ for (r = get_insns (); r != NULL_RTX; r = next_nonnote_nondebug_insn (r))
+ {
+ rtx insn1, insn2;
+ struct liw_data liw1, liw2;
+
+ insn1 = r;
+ if (! extract_bundle (insn1, & liw1))
+ continue;
+
+ insn2 = next_nonnote_nondebug_insn (insn1);
+ if (! extract_bundle (insn2, & liw2))
+ continue;
+
+ /* Check for source/destination overlap. */
+ if (! check_liw_constraints (& liw1, & liw2))
+ continue;
+
+ if (liw1.slot == LIW_OP2 || liw2.slot == LIW_OP1)
+ {
+ struct liw_data temp;
+
+ temp = liw1;
+ liw1 = liw2;
+ liw2 = temp;
+ }
+
+ delete_insn (insn2);
+
+ if (liw1.op == LIW_OP_CMP)
+ insn2 = gen_cmp_liw (liw2.dest, liw2.src, liw1.dest, liw1.src,
+ GEN_INT (liw2.op));
+ else if (liw2.op == LIW_OP_CMP)
+ insn2 = gen_liw_cmp (liw1.dest, liw1.src, liw2.dest, liw2.src,
+ GEN_INT (liw1.op));
+ else
+ insn2 = gen_liw (liw1.dest, liw2.dest, liw1.src, liw2.src,
+ GEN_INT (liw1.op), GEN_INT (liw2.op));
+
+ insn2 = emit_insn_after (insn2, insn1);
+ delete_insn (insn1);
+ r = insn2;
+ }
+}
+
+static void
+mn10300_reorg (void)
+{
+ if (TARGET_AM33)
+ {
+ if (TARGET_ALLOW_LIW)
+ mn10300_bundle_liw ();
+ }
+}
+
/* Initialize the GCC target structure. */
+#undef TARGET_MACHINE_DEPENDENT_REORG
+#define TARGET_MACHINE_DEPENDENT_REORG mn10300_reorg
+
#undef TARGET_EXCEPT_UNWIND_INFO
#define TARGET_EXCEPT_UNWIND_INFO sjlj_except_unwind_info
@@ -2952,7 +3176,7 @@ mn10300_split_and_operand_count (rtx op)
#define TARGET_ASM_OUTPUT_ADDR_CONST_EXTRA mn10300_asm_output_addr_const_extra
#undef TARGET_DEFAULT_TARGET_FLAGS
-#define TARGET_DEFAULT_TARGET_FLAGS MASK_MULT_BUG | MASK_PTR_A0D0
+#define TARGET_DEFAULT_TARGET_FLAGS MASK_MULT_BUG | MASK_PTR_A0D0 | MASK_ALLOW_LIW
#undef TARGET_HANDLE_OPTION
#define TARGET_HANDLE_OPTION mn10300_handle_option
#undef TARGET_OPTION_OVERRIDE
@@ -3021,4 +3245,7 @@ mn10300_split_and_operand_count (rtx op)
#undef TARGET_MD_ASM_CLOBBERS
#define TARGET_MD_ASM_CLOBBERS mn10300_md_asm_clobbers
+#undef TARGET_FLAGS_REGNUM
+#define TARGET_FLAGS_REGNUM CC_REG
+
struct gcc_target targetm = TARGET_INITIALIZER;
diff --git a/gcc/config/mn10300/mn10300.h b/gcc/config/mn10300/mn10300.h
index b10f4506805..2e97ca4ff4c 100644
--- a/gcc/config/mn10300/mn10300.h
+++ b/gcc/config/mn10300/mn10300.h
@@ -50,6 +50,10 @@
} \
else if (TARGET_AM33) \
builtin_define ("__AM33__=1"); \
+ \
+ builtin_define (TARGET_ALLOW_LIW ? \
+ "__LIW__" : "__NO_LIW__");\
+ \
} \
while (0)
diff --git a/gcc/config/mn10300/mn10300.md b/gcc/config/mn10300/mn10300.md
index 57606e492af..3d8e9147052 100644
--- a/gcc/config/mn10300/mn10300.md
+++ b/gcc/config/mn10300/mn10300.md
@@ -1,6 +1,6 @@
;; GCC machine description for Matsushita MN10300
;; Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-;; 2005, 2006, 2007, 2008, 2009, 2010
+;; 2005, 2006, 2007, 2008, 2009, 2010, 2011
;; Free Software Foundation, Inc.
;; Contributed by Jeff Law (law@cygnus.com).
@@ -39,6 +39,9 @@
(UNSPEC_EXT 6)
(UNSPEC_BSCH 7)
+
+ ;; This is used to encode LIW patterns.
+ (UNSPEC_LIW 8)
])
(include "predicates.md")
@@ -75,6 +78,43 @@
(define_mode_iterator INT [QI HI SI])
+;; Bundling of smaller insns into a long instruction word (LIW)
+(define_automaton "liw_bundling")
+(automata_option "ndfa")
+
+(define_cpu_unit "liw_op1_u,liw_op2_u" "liw_bundling")
+
+(define_attr "liw" "op1,op2,both,either"
+ (const_string "both"))
+;; Note: this list must match the one defined for liw_op_names[].
+(define_attr "liw_op" "add,cmp,sub,mov,and,or,xor,asr,lsr,asl,none,max"
+ (const_string "none"))
+
+(define_insn_reservation "liw_op1" 1
+ (and (ior (eq_attr "cpu" "am33")
+ (eq_attr "cpu" "am33_2")
+ (eq_attr "cpu" "am34"))
+ (eq_attr "liw" "op1"))
+ "liw_op1_u");
+(define_insn_reservation "liw_op2" 1
+ (and (ior (eq_attr "cpu" "am33")
+ (eq_attr "cpu" "am33_2")
+ (eq_attr "cpu" "am34"))
+ (eq_attr "liw" "op2"))
+ "liw_op2_u");
+(define_insn_reservation "liw_both" 1
+ (and (ior (eq_attr "cpu" "am33")
+ (eq_attr "cpu" "am33_2")
+ (eq_attr "cpu" "am34"))
+ (eq_attr "liw" "both"))
+ "liw_op1_u + liw_op2_u");
+(define_insn_reservation "liw_either" 1
+ (and (ior (eq_attr "cpu" "am33")
+ (eq_attr "cpu" "am33_2")
+ (eq_attr "cpu" "am34"))
+ (eq_attr "liw" "either"))
+ "liw_op1_u | liw_op2_u");
+
;; ----------------------------------------------------------------------
;; Pipeline description.
;; ----------------------------------------------------------------------
@@ -379,9 +419,9 @@
(define_insn "*movsi_internal"
[(set (match_operand:SI 0 "nonimmediate_operand"
- "=r,r,r,m,r, A,*y,*y,*z,*d")
+ "=r,r,r,r,m,r, A,*y,*y,*z,*d")
(match_operand:SI 1 "general_operand"
- " 0,i,r,r,m,*y, A, i,*d,*z"))]
+ " 0,O,i,r,r,m,*y, A, i,*d,*z"))]
"register_operand (operands[0], SImode)
|| register_operand (operands[1], SImode)"
{
@@ -389,7 +429,8 @@
{
case 0:
return "";
- case 1: /* imm-reg*/
+ case 1: /* imm-reg. */
+ case 2:
/* See movhi for a discussion of sizes for 8-bit movu. Note that the
24-bit movu is 6 bytes, which is the same size as the full 32-bit
mov form for An and Dn. So again movu is only a win for Rn. */
@@ -403,23 +444,26 @@
return "movu %1,%0";
}
/* FALLTHRU */
- case 2: /* reg-reg */
- case 3: /* reg-mem */
- case 4: /* mem-reg */
- case 5: /* sp-reg */
- case 6: /* reg-sp */
- case 7: /* imm-sp */
- case 8: /* reg-mdr */
- case 9: /* mdr-reg */
+ case 3: /* reg-reg */
+ case 4: /* reg-mem */
+ case 5: /* mem-reg */
+ case 6: /* sp-reg */
+ case 7: /* reg-sp */
+ case 8: /* imm-sp */
+ case 9: /* reg-mdr */
+ case 10: /* mdr-reg */
return "mov %1,%0";
default:
gcc_unreachable ();
}
}
- [(set_attr "isa" "*,*,*,*,*,*,*,am33,*,*")
+ [(set_attr "isa" "*,*,*,*,*,*,*,*,am33,*,*")
+ (set_attr "liw" "*,either,*,either,*,*,*,*,*,*,*")
+ (set_attr "liw_op" "mov")
(set_attr_alternative "timings"
[(const_int 11)
(const_int 22)
+ (const_int 22)
(const_int 11)
(if_then_else (eq_attr "cpu" "am34")
(const_int 11) (const_int 22))
@@ -521,13 +565,15 @@
;; ----------------------------------------------------------------------
(define_insn "addsi3"
- [(set (match_operand:SI 0 "register_operand" "=r,!*y,!r")
- (plus:SI (match_operand:SI 1 "register_operand" "%0, 0, r")
- (match_operand:SI 2 "nonmemory_operand" "ri, i, r")))
+ [(set (match_operand:SI 0 "register_operand" "=r,r,r,!*y,!r")
+ (plus:SI (match_operand:SI 1 "register_operand" "%0,0,0, 0, r")
+ (match_operand:SI 2 "nonmemory_operand" "r,O,i, i, r")))
(clobber (reg:CC CC_REG))]
""
{ return mn10300_output_add (operands, false); }
- [(set_attr "timings" "11,11,22")]
+ [(set_attr "timings" "11,11,11,11,22")
+ (set_attr "liw" "either,either,*,*,*")
+ (set_attr "liw_op" "add")]
)
;; Note that ADD IMM,SP does not set the flags, so omit that here.
@@ -714,22 +760,26 @@
;; ----------------------------------------------------------------------
(define_insn "subsi3"
- [(set (match_operand:SI 0 "register_operand" "=r,r")
- (minus:SI (match_operand:SI 1 "register_operand" " 0,r")
- (match_operand:SI 2 "nonmemory_operand" "ri,r")))
+ [(set (match_operand:SI 0 "register_operand" "=r,r,r,r")
+ (minus:SI (match_operand:SI 1 "register_operand" "0,0,0,r")
+ (match_operand:SI 2 "nonmemory_operand" "r,O,i,r")))
(clobber (reg:CC CC_REG))]
""
"@
sub %2,%0
+ sub %2,%0
+ sub %2,%0
sub %2,%1,%0"
- [(set_attr "isa" "*,am33")
- (set_attr "timings" "11,22")]
+ [(set_attr "isa" "*,*,*,am33")
+ (set_attr "liw" "either,either,*,*")
+ (set_attr "liw_op" "sub")
+ (set_attr "timings" "11,11,11,22")]
)
(define_insn "*subsi3_flags"
- [(set (match_operand:SI 0 "register_operand" "=r,r")
- (minus:SI (match_operand:SI 1 "register_operand" " 0,r")
- (match_operand:SI 2 "nonmemory_operand" "ri,r")))
+ [(set (match_operand:SI 0 "register_operand" "=r, r")
+ (minus:SI (match_operand:SI 1 "register_operand" "0, r")
+ (match_operand:SI 2 "nonmemory_operand" "ri,r")))
(set (reg CC_REG)
(compare (minus:SI (match_dup 1) (match_dup 2))
(const_int 0)))]
@@ -1125,6 +1175,8 @@
and %2,%0
and %2,%1,%0"
[(set_attr "isa" "*,*,am33")
+ (set_attr "liw" "*,op1,*")
+ (set_attr "liw_op" "and")
(set_attr "timings" "22,11,11")]
)
@@ -1210,6 +1262,8 @@
or %2,%0
or %2,%1,%0"
[(set_attr "isa" "*,*,am33")
+ (set_attr "liw" "*,op1,*")
+ (set_attr "liw_op" "or")
(set_attr "timings" "22,11,11")]
)
@@ -1244,6 +1298,8 @@
xor %2,%0
xor %2,%1,%0"
[(set_attr "isa" "*,*,am33")
+ (set_attr "liw" "*,op1,*")
+ (set_attr "liw_op" "xor")
(set_attr "timings" "22,11,11")]
)
@@ -1321,8 +1377,8 @@
(define_insn "*cmpsi"
[(set (reg CC_REG)
- (compare (match_operand:SI 0 "register_operand" "r")
- (match_operand:SI 1 "nonmemory_operand" "ri")))]
+ (compare (match_operand:SI 0 "register_operand" "r,r,r")
+ (match_operand:SI 1 "nonmemory_operand" "r,O,i")))]
"reload_completed"
{
/* The operands of CMP must be distinct registers. In the case where
@@ -1336,7 +1392,11 @@
return "cmp %1,%0";
}
[(set_attr_alternative "timings"
- [(if_then_else (eq_attr "cpu" "am34") (const_int 11) (const_int 22))])]
+ [(if_then_else (eq_attr "cpu" "am34") (const_int 11) (const_int 22))
+ (if_then_else (eq_attr "cpu" "am34") (const_int 11) (const_int 22))
+ (if_then_else (eq_attr "cpu" "am34") (const_int 11) (const_int 22))])
+ (set_attr "liw" "either,either,*")
+ (set_attr "liw_op" "cmp")]
)
(define_insn "*integer_conditional_branch"
@@ -1676,10 +1736,10 @@
;; ----------------------------------------------------------------------
(define_insn "ashlsi3"
- [(set (match_operand:SI 0 "register_operand" "=r,D,d,d, D,r")
+ [(set (match_operand:SI 0 "register_operand" "=r,D,d,d,D,D,D,r")
(ashift:SI
- (match_operand:SI 1 "register_operand" " 0,0,0,0, 0,r")
- (match_operand:QI 2 "nonmemory_operand" " J,K,M,L,Di,r")))
+ (match_operand:SI 1 "register_operand" " 0,0,0,0,0,0,0,r")
+ (match_operand:QI 2 "nonmemory_operand" " J,K,M,L,D,O,i,r")))
(clobber (reg:CC CC_REG))]
""
"@
@@ -1688,35 +1748,47 @@
asl2 %0\;add %0,%0
asl2 %0\;asl2 %0
asl %S2,%0
+ asl %S2,%0
+ asl %S2,%0
asl %2,%1,%0"
- [(set_attr "isa" "*,*,*,*,*,am33")
- (set_attr "timings" "11,11,22,22,11,11")]
+ [(set_attr "isa" "*,*,*,*,*,*,*,am33")
+ (set_attr "liw" "op2,op2,op2,op2,op2,op2,*,*")
+ (set_attr "liw_op" "asl")
+ (set_attr "timings" "11,11,22,22,11,11,11,11")]
)
(define_insn "lshrsi3"
- [(set (match_operand:SI 0 "register_operand" "=D,r")
+ [(set (match_operand:SI 0 "register_operand" "=D,D,D,r")
(lshiftrt:SI
- (match_operand:SI 1 "register_operand" " 0,r")
- (match_operand:QI 2 "nonmemory_operand" "Di,r")))
+ (match_operand:SI 1 "register_operand" "0,0,0,r")
+ (match_operand:QI 2 "nonmemory_operand" "D,O,i,r")))
(clobber (reg:CC CC_REG))]
""
"@
lsr %S2,%0
+ lsr %S2,%0
+ lsr %S2,%0
lsr %2,%1,%0"
- [(set_attr "isa" "*,am33")]
+ [(set_attr "isa" "*,*,*,am33")
+ (set_attr "liw" "op2,op2,*,*")
+ (set_attr "liw_op" "lsr")]
)
(define_insn "ashrsi3"
- [(set (match_operand:SI 0 "register_operand" "=D,r")
+ [(set (match_operand:SI 0 "register_operand" "=D,D,D,r")
(ashiftrt:SI
- (match_operand:SI 1 "register_operand" " 0,r")
- (match_operand:QI 2 "nonmemory_operand" "Di,r")))
+ (match_operand:SI 1 "register_operand" "0,0,0,r")
+ (match_operand:QI 2 "nonmemory_operand" "D,O,i,r")))
(clobber (reg:CC CC_REG))]
""
"@
asr %S2,%0
+ asr %S2,%0
+ asr %S2,%0
asr %2,%1,%0"
- [(set_attr "isa" "*,am33")]
+ [(set_attr "isa" "*,*,*,am33")
+ (set_attr "liw" "op2,op2,*,*")
+ (set_attr "liw_op" "asr")]
)
;; ----------------------------------------------------------------------
@@ -2029,3 +2101,54 @@
}
[(set_attr "timings" "66")]
)
+
+;; The mode on operand 3 has been deliberately omitted because it
+;; can be either SI (for arithmetic operations) or QI (for shifts).
+(define_insn "liw"
+ [(set (match_operand:SI 0 "register_operand" "=r")
+ (unspec:SI [(match_dup 0)
+ (match_operand 2 "liw_operand" "rO")
+ (match_operand:SI 4 "const_int_operand" "")]
+ UNSPEC_LIW))
+ (set (match_operand:SI 1 "register_operand" "=r")
+ (unspec:SI [(match_dup 1)
+ (match_operand 3 "liw_operand" "rO")
+ (match_operand:SI 5 "const_int_operand" "")]
+ UNSPEC_LIW))]
+ "TARGET_ALLOW_LIW"
+ "%W4_%W5 %2, %0, %3, %1"
+ [(set (attr "timings") (if_then_else (eq_attr "cpu" "am34")
+ (const_int 13) (const_int 12)))]
+)
+
+;; The mode on operand 1 has been deliberately omitted because it
+;; can be either SI (for arithmetic operations) or QI (for shifts).
+(define_insn "cmp_liw"
+ [(set (reg:CC CC_REG)
+ (compare:CC (match_operand:SI 2 "register_operand" "r")
+ (match_operand 3 "liw_operand" "rO")))
+ (set (match_operand:SI 0 "register_operand" "=r")
+ (unspec:SI [(match_dup 0)
+ (match_operand 1 "liw_operand" "rO")
+ (match_operand:SI 4 "const_int_operand" "")]
+ UNSPEC_LIW))]
+ "TARGET_ALLOW_LIW"
+ "cmp_%W4 %3, %2, %1, %0"
+ [(set (attr "timings") (if_then_else (eq_attr "cpu" "am34")
+ (const_int 13) (const_int 12)))]
+)
+
+(define_insn "liw_cmp"
+ [(set (match_operand:SI 0 "register_operand" "=r")
+ (unspec:SI [(match_dup 0)
+ (match_operand 1 "liw_operand" "rO")
+ (match_operand:SI 4 "const_int_operand" "")]
+ UNSPEC_LIW))
+ (set (reg:CC CC_REG)
+ (compare:CC (match_operand:SI 2 "register_operand" "r")
+ (match_operand 3 "liw_operand" "rO")))]
+ "TARGET_ALLOW_LIW"
+ "%W4_cmp %1, %0, %3, %2"
+ [(set (attr "timings") (if_then_else (eq_attr "cpu" "am34")
+ (const_int 13) (const_int 12)))]
+)
diff --git a/gcc/config/mn10300/mn10300.opt b/gcc/config/mn10300/mn10300.opt
index f2a434ef738..8909d8bd1f3 100644
--- a/gcc/config/mn10300/mn10300.opt
+++ b/gcc/config/mn10300/mn10300.opt
@@ -1,6 +1,6 @@
; Options for the Matsushita MN10300 port of the compiler.
-; Copyright (C) 2005, 2007, 2010 Free Software Foundation, Inc.
+; Copyright (C) 2005, 2007, 2010, 2011 Free Software Foundation, Inc.
;
; This file is part of GCC.
;
@@ -39,6 +39,10 @@ Target Report Mask(MULT_BUG)
Work around hardware multiply bug
; Ignored by the compiler
+mno-crt0
+Target RejectNegative
+
+; Ignored by the compiler
mrelax
Target RejectNegative
Enable linker relaxations
@@ -46,3 +50,7 @@ Enable linker relaxations
mreturn-pointer-on-d0
Target Report Mask(PTR_A0D0)
Return pointers in both a0 and d0
+
+mliw
+Target Report Mask(ALLOW_LIW)
+Allow gcc to generate LIW instructions
diff --git a/gcc/config/mn10300/predicates.md b/gcc/config/mn10300/predicates.md
index 83169901648..4c78c51e463 100644
--- a/gcc/config/mn10300/predicates.md
+++ b/gcc/config/mn10300/predicates.md
@@ -63,3 +63,7 @@
(define_predicate "CCZN_comparison_operator"
(match_code "eq,ne,lt,ge"))
+
+(define_predicate "liw_operand"
+ (ior (match_operand 0 "register_operand")
+ (match_test "satisfies_constraint_O (op)")))
diff --git a/gcc/config/openbsd.opt b/gcc/config/openbsd.opt
index b27a4689bbc..b8c8fd41698 100644
--- a/gcc/config/openbsd.opt
+++ b/gcc/config/openbsd.opt
@@ -1,6 +1,6 @@
; OpenBSD options.
-; Copyright (C) 2010
+; Copyright (C) 2010, 2011
; Free Software Foundation, Inc.
;
; This file is part of GCC.
@@ -24,6 +24,9 @@
; Please try to keep this file in ASCII collating order.
+assert=
+Driver JoinedOrMissing
+
posix
Driver
diff --git a/gcc/config/pa/pa-hpux.opt b/gcc/config/pa/pa-hpux.opt
index 4a656268166..eaed8be2d97 100644
--- a/gcc/config/pa/pa-hpux.opt
+++ b/gcc/config/pa/pa-hpux.opt
@@ -1,6 +1,6 @@
; Options for the HP PA-RISC port of the compiler.
-; Copyright (C) 2005, 2007 Free Software Foundation, Inc.
+; Copyright (C) 2005, 2007, 2011 Free Software Foundation, Inc.
;
; This file is part of GCC.
;
@@ -29,3 +29,9 @@ Specify UNIX standard for predefines and linking
mwsio
Target RejectNegative InverseMask(SIO)
Generate cpp defines for workstation IO
+
+nolibdld
+Driver
+
+rdynamic
+Driver
diff --git a/gcc/config/rs6000/aix.opt b/gcc/config/pa/pa-hpux10.opt
index 2e44fdd0e50..59056debaae 100644
--- a/gcc/config/rs6000/aix.opt
+++ b/gcc/config/pa/pa-hpux10.opt
@@ -1,7 +1,6 @@
-; AIX options.
-;
-; Copyright (C) 2005, 2007, 2010 Free Software Foundation, Inc.
-; Contributed by Aldy Hernandez <aldy@quesejoda.com>.
+; Options specific to HP-UX 10.
+
+; Copyright (C) 2011 Free Software Foundation, Inc.
;
; This file is part of GCC.
;
@@ -10,15 +9,14 @@
; Software Foundation; either version 3, or (at your option) any later
; version.
;
-; GCC is distributed in the hope that it will be useful, but WITHOUT
-; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
-; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
-; License for more details.
+; GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+; WARRANTY; without even the implied warranty of MERCHANTABILITY or
+; FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+; for more details.
;
; You should have received a copy of the GNU General Public License
; along with GCC; see the file COPYING3. If not see
; <http://www.gnu.org/licenses/>.
-mxl-compat
-Target Var(has_xl_compat_option) Save
-Conform more closely to IBM XLC semantics
+threads
+Driver
diff --git a/gcc/config/pa/pa-hpux11.h b/gcc/config/pa/pa-hpux11.h
index 462fccb6732..81dfdf3d1dd 100644
--- a/gcc/config/pa/pa-hpux11.h
+++ b/gcc/config/pa/pa-hpux11.h
@@ -114,16 +114,17 @@ along with GCC; see the file COPYING3. If not see
-z %{mlinker-opt:-O} %{!shared:-u main -u __gcc_plt_call}\
%{static:-a archive} %{shared:-b}"
-/* HP-UX 11 has posix threads. HP libc contains pthread stubs so that
- non-threaded applications can be linked with a thread-safe libc
- without a subsequent loss of performance. For more details, see
- <http://docs.hp.com/en/1896/pthreads.html>. */
+/* HP-UX 11 has posix threads. HP's shared libc contains pthread stubs
+ so that non-threaded applications can be linked with a thread-safe
+ libc without a subsequent loss of performance. For more details,
+ see <http://docs.hp.com/en/1896/pthreads.html>. */
#undef LIB_SPEC
#define LIB_SPEC \
"%{!shared:\
%{fopenmp:%{static:-a archive_shared} -lrt %{static:-a archive}}\
%{mt|pthread:-lpthread} -lc\
- %{static:%{!nolibdld:-a archive_shared -ldld -a archive -lc}}}\
+ %{static:%{!nolibdld:-a archive_shared -ldld -a archive -lc}\
+ %{!mt:%{!pthread:-a shared -lc -a archive}}}}\
%{shared:%{mt|pthread:-lpthread}}"
/* The libgcc_stub.a library needs to come last. */
diff --git a/gcc/config/pa/pa-linux.h b/gcc/config/pa/pa-linux.h
index 0eb4adf2557..64626e6fc41 100644
--- a/gcc/config/pa/pa-linux.h
+++ b/gcc/config/pa/pa-linux.h
@@ -1,5 +1,6 @@
/* Definitions for PA_RISC with ELF format
- Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009, 2010
+ Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009, 2010,
+ 2011
Free Software Foundation, Inc.
This file is part of GCC.
@@ -33,7 +34,7 @@ along with GCC; see the file COPYING3. If not see
#undef ASM_SPEC
#define ASM_SPEC \
- "%{Ym,*} %{Yd,*}"
+ ""
/* Define this for shared library support because it isn't in the main
linux.h file. */
diff --git a/gcc/config/pa/pa64-hpux.h b/gcc/config/pa/pa64-hpux.h
index 7d9f0275587..cc9724a6e7e 100644
--- a/gcc/config/pa/pa64-hpux.h
+++ b/gcc/config/pa/pa64-hpux.h
@@ -61,34 +61,40 @@ along with GCC; see the file COPYING3. If not see
"%{!shared:\
%{!p:%{!pg:%{fopenmp:%{static:-a shared} -lrt %{static:-a archive}}\
%{mt|pthread:-lpthread} -lc\
- %{static:%{!nolibdld:-a shared -ldld -a archive -lc}}}}\
+ %{static:%{!nolibdld:-a shared -ldld -a archive -lc}\
+ %{!mt:%{!pthread:-a shared -lc -a archive}}}}}\
%{p:%{!pg:%{static:%{!mhp-ld:-a shared}%{mhp-ld:-a archive_shared}}\
-lprof %{static:-a archive}\
%{fopenmp:%{static:-a shared} -lrt %{static:-a archive}}\
%{mt|pthread:-lpthread} -lc\
- %{static:%{!nolibdld:-a shared -ldld -a archive -lc}}}}\
+ %{static:%{!nolibdld:-a shared -ldld -a archive -lc}\
+ %{!mt:%{!pthread:-a shared -lc -a archive}}}}}\
%{pg:%{static:%{!mhp-ld:-a shared}%{mhp-ld:-a archive_shared}}\
-lgprof %{static:-a archive}\
%{fopenmp:%{static:-a shared} -lrt %{static:-a archive}}\
%{mt|pthread:-lpthread} -lc\
- %{static:%{!nolibdld:-a shared -ldld -a archive -lc}}}}\
+ %{static:%{!nolibdld:-a shared -ldld -a archive -lc}\
+ %{!mt:%{!pthread:-a shared -lc -a archive}}}}}\
%{shared:%{mt|pthread:-lpthread}}"
#else
#define LIB_SPEC \
"%{!shared:\
%{!p:%{!pg:%{fopenmp:%{static:-a shared} -lrt %{static:-a archive}}\
%{mt|pthread:-lpthread} -lc\
- %{static:%{!nolibdld:-a shared -ldld -a archive -lc}}}}\
+ %{static:%{!nolibdld:-a shared -ldld -a archive -lc}\
+ %{!mt:%{!pthread:-a shared -lc -a archive}}}}}\
%{p:%{!pg:%{static:%{mgnu-ld:-a shared}%{!mgnu-ld:-a archive_shared}}\
-lprof %{static:-a archive}\
%{fopenmp:%{static:-a shared} -lrt %{static:-a archive}}\
%{mt|pthread:-lpthread} -lc\
- %{static:%{!nolibdld:-a shared -ldld -a archive -lc}}}}\
+ %{static:%{!nolibdld:-a shared -ldld -a archive -lc}\
+ %{!mt:%{!pthread:-a shared -lc -a archive}}}}}\
%{pg:%{static:%{mgnu-ld:-a shared}%{!mgnu-ld:-a archive_shared}}\
-lgprof %{static:-a archive}\
%{fopenmp:%{static:-a shared} -lrt %{static:-a archive}}\
%{mt|pthread:-lpthread} -lc\
- %{static:%{!nolibdld:-a shared -ldld -a archive -lc}}}}\
+ %{static:%{!nolibdld:-a shared -ldld -a archive -lc}\
+ %{!mt:%{!pthread:-a shared -lc -a archive}}}}}\
%{shared:%{mt|pthread:-lpthread}}"
#endif
diff --git a/gcc/config/pa/stublib.c b/gcc/config/pa/stublib.c
index bcf0a37c452..d3cf559c8ab 100644
--- a/gcc/config/pa/stublib.c
+++ b/gcc/config/pa/stublib.c
@@ -70,18 +70,27 @@ pthread_default_stacksize_np (unsigned long new, unsigned long *old)
#endif
#ifdef L_pthread_mutex_lock
-int pthread_mutex_lock (void * __attribute__((unused)));
+int pthread_mutex_lock (void);
int
-pthread_mutex_lock (void *p)
+pthread_mutex_lock (void)
{
return 0;
}
#endif
#ifdef L_pthread_mutex_unlock
-int pthread_mutex_unlock (void * __attribute__((unused)));
+int pthread_mutex_unlock (void);
int
-pthread_mutex_unlock (void *p)
+pthread_mutex_unlock (void)
+{
+ return 0;
+}
+#endif
+
+#ifdef L_pthread_once
+int pthread_once (void);
+int
+pthread_once (void)
{
return 0;
}
diff --git a/gcc/config/pa/t-pa-hpux11 b/gcc/config/pa/t-pa-hpux11
index 15b0a85e166..4436b4ca640 100644
--- a/gcc/config/pa/t-pa-hpux11
+++ b/gcc/config/pa/t-pa-hpux11
@@ -2,7 +2,8 @@ TARGET_LIBGCC2_CFLAGS = -fPIC -frandom-seed=fixed-seed
LIB2FUNCS_EXTRA=lib2funcs.asm quadlib.c
LIBGCCSTUB_OBJS = pthread_default_stacksize_np-stub.o \
pthread_mutex_lock-stub.o \
- pthread_mutex_unlock-stub.o
+ pthread_mutex_unlock-stub.o \
+ pthread_once-stub.o
stublib.c: $(srcdir)/config/pa/stublib.c
rm -f stublib.c
@@ -20,6 +21,10 @@ pthread_mutex_unlock-stub.o: stublib.c $(GCC_PASSES)
$(GCC_FOR_TARGET) -c -O2 -DL_pthread_mutex_unlock stublib.c \
-o pthread_mutex_unlock-stub.o
+pthread_once-stub.o: stublib.c $(GCC_PASSES)
+ $(GCC_FOR_TARGET) -c -O2 -DL_pthread_once stublib.c \
+ -o pthread_once-stub.o
+
$(T)libgcc_stub.a: $(LIBGCCSTUB_OBJS)
-rm -rf $(T)libgcc_stub.a
$(AR) rc $(T)libgcc_stub.a $(LIBGCCSTUB_OBJS)
diff --git a/gcc/config/pa/t-pa64 b/gcc/config/pa/t-pa64
index 0a4827ee34c..e6ac7a5bb7d 100644
--- a/gcc/config/pa/t-pa64
+++ b/gcc/config/pa/t-pa64
@@ -22,7 +22,8 @@ LIB2FUNCS_EXTRA = quadlib.c
LIBGCCSTUB_OBJS = rfi-stub.o dfi-stub.o jvrc-stub.o cxaf-stub.o \
pthread_default_stacksize_np-stub.o \
pthread_mutex_lock-stub.o \
- pthread_mutex_unlock-stub.o
+ pthread_mutex_unlock-stub.o \
+ pthread_once-stub.o
stublib.c: $(srcdir)/config/pa/stublib.c
rm -f stublib.c
@@ -56,6 +57,10 @@ pthread_mutex_unlock-stub.o: stublib.c $(GCC_PASSES)
$(GCC_FOR_TARGET) -c -O2 -DL_pthread_mutex_unlock stublib.c \
-o pthread_mutex_unlock-stub.o
+pthread_once-stub.o: stublib.c $(GCC_PASSES)
+ $(GCC_FOR_TARGET) -c -O2 -DL_pthread_once stublib.c \
+ -o pthread_once-stub.o
+
$(T)libgcc_stub.a: $(LIBGCCSTUB_OBJS)
-rm -rf $(T)libgcc_stub.a
$(AR) rc $(T)libgcc_stub.a $(LIBGCCSTUB_OBJS)
diff --git a/gcc/config/rs6000/aix61.h b/gcc/config/rs6000/aix61.h
index 4f949cffe65..2170eae55ee 100644
--- a/gcc/config/rs6000/aix61.h
+++ b/gcc/config/rs6000/aix61.h
@@ -116,9 +116,9 @@ do { \
#define TARGET_DEFAULT (MASK_POWERPC | MASK_NEW_MNEMONICS)
#undef PROCESSOR_DEFAULT
-#define PROCESSOR_DEFAULT PROCESSOR_POWER5
+#define PROCESSOR_DEFAULT PROCESSOR_POWER7
#undef PROCESSOR_DEFAULT64
-#define PROCESSOR_DEFAULT64 PROCESSOR_POWER5
+#define PROCESSOR_DEFAULT64 PROCESSOR_POWER7
#undef TARGET_POWER
#define TARGET_POWER 0
@@ -197,8 +197,4 @@ extern long long int atoll(const char *);
#define TARGET_USE_JCR_SECTION 0
-/* Default to 128 bit long double. */
-
-#define RS6000_DEFAULT_LONG_DOUBLE_SIZE 128
-
#define TARGET_AIX_VERSION 61
diff --git a/gcc/config/rs6000/aix64.opt b/gcc/config/rs6000/aix64.opt
index fbc225af13b..9a10b200e81 100644
--- a/gcc/config/rs6000/aix64.opt
+++ b/gcc/config/rs6000/aix64.opt
@@ -1,6 +1,6 @@
; Options for the 64-bit flavor of AIX.
;
-; Copyright (C) 2005, 2007, 2010 Free Software Foundation, Inc.
+; Copyright (C) 2005, 2007, 2010, 2011 Free Software Foundation, Inc.
; Contributed by Aldy Hernandez <aldy@quesejoda.com>.
;
; This file is part of GCC.
@@ -30,3 +30,9 @@ Compile for 32-bit pointers
mpe
Target Report RejectNegative Var(internal_nothing_1) Save
Support message passing with the Parallel Environment
+
+posix
+Driver
+
+pthread
+Driver
diff --git a/gcc/config/rs6000/altivec.h b/gcc/config/rs6000/altivec.h
index 93dd4f9a282..583731b9668 100644
--- a/gcc/config/rs6000/altivec.h
+++ b/gcc/config/rs6000/altivec.h
@@ -1,5 +1,5 @@
/* PowerPC AltiVec include file.
- Copyright (C) 2002, 2003, 2004, 2005, 2008, 2009, 2010
+ Copyright (C) 2002, 2003, 2004, 2005, 2008, 2009, 2010, 2011
Free Software Foundation, Inc.
Contributed by Aldy Hernandez (aldyh@redhat.com).
Rewritten by Paolo Bonzini (bonzini@gnu.org).
@@ -318,6 +318,8 @@
#define vec_nearbyint __builtin_vec_nearbyint
#define vec_rint __builtin_vec_rint
#define vec_sqrt __builtin_vec_sqrt
+#define vec_vsx_ld __builtin_vec_vsx_ld
+#define vec_vsx_st __builtin_vec_vsx_st
#endif
/* Predicates.
diff --git a/gcc/config/rs6000/altivec.md b/gcc/config/rs6000/altivec.md
index b7819f59dfc..d7357ee3262 100644
--- a/gcc/config/rs6000/altivec.md
+++ b/gcc/config/rs6000/altivec.md
@@ -1,5 +1,5 @@
;; AltiVec patterns.
-;; Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
+;; Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
;; Free Software Foundation, Inc.
;; Contributed by Aldy Hernandez (aldy@quesejoda.com)
@@ -96,7 +96,7 @@
(UNSPEC_STVE 203)
(UNSPEC_SET_VSCR 213)
(UNSPEC_GET_VRSAVE 214)
- ;; 215 deleted
+ (UNSPEC_LVX 215)
(UNSPEC_REDUC_PLUS 217)
(UNSPEC_VECSH 219)
(UNSPEC_EXTEVEN_V4SI 220)
@@ -224,7 +224,7 @@
(define_split
[(set (match_operand:VM 0 "altivec_register_operand" "")
(match_operand:VM 1 "easy_vector_constant_msb" ""))]
- "VECTOR_UNIT_ALTIVEC_P (<MODE>mode) && reload_completed"
+ "VECTOR_UNIT_ALTIVEC_OR_VSX_P (<MODE>mode) && reload_completed"
[(const_int 0)]
{
rtx dest = operands[0];
@@ -251,7 +251,7 @@
(define_split
[(set (match_operand:VM 0 "altivec_register_operand" "")
(match_operand:VM 1 "easy_vector_constant_add_self" ""))]
- "VECTOR_UNIT_ALTIVEC_P (<MODE>mode) && reload_completed"
+ "VECTOR_UNIT_ALTIVEC_OR_VSX_P (<MODE>mode) && reload_completed"
[(set (match_dup 0) (match_dup 3))
(set (match_dup 0) (match_dup 4))]
{
@@ -1750,17 +1750,19 @@
"lvxl %0,%y1"
[(set_attr "type" "vecload")])
-(define_insn "altivec_lvx"
- [(set (match_operand:V4SI 0 "register_operand" "=v")
- (match_operand:V4SI 1 "memory_operand" "Z"))]
+(define_insn "altivec_lvx_<mode>"
+ [(parallel
+ [(set (match_operand:VM2 0 "register_operand" "=v")
+ (match_operand:VM2 1 "memory_operand" "Z"))
+ (unspec [(const_int 0)] UNSPEC_LVX)])]
"TARGET_ALTIVEC"
"lvx %0,%y1"
[(set_attr "type" "vecload")])
-(define_insn "altivec_stvx"
+(define_insn "altivec_stvx_<mode>"
[(parallel
- [(set (match_operand:V4SI 0 "memory_operand" "=Z")
- (match_operand:V4SI 1 "register_operand" "v"))
+ [(set (match_operand:VM2 0 "memory_operand" "=Z")
+ (match_operand:VM2 1 "register_operand" "v"))
(unspec [(const_int 0)] UNSPEC_STVX)])]
"TARGET_ALTIVEC"
"stvx %1,%y0"
diff --git a/gcc/config/rs6000/darwin.h b/gcc/config/rs6000/darwin.h
index bd4b1958131..244da0065df 100644
--- a/gcc/config/rs6000/darwin.h
+++ b/gcc/config/rs6000/darwin.h
@@ -433,5 +433,6 @@ extern int darwin_emit_branch_islands;
#define SUBTARGET_INIT_BUILTINS \
do { \
darwin_patch_builtins (); \
- darwin_init_cfstring_builtins ((unsigned) (RS6000_BUILTIN_COUNT)); \
+ rs6000_builtin_decls[(unsigned) (RS6000_BUILTIN_CFSTRING)] \
+ = darwin_init_cfstring_builtins ((unsigned) (RS6000_BUILTIN_CFSTRING)); \
} while(0)
diff --git a/gcc/config/rs6000/linux64.h b/gcc/config/rs6000/linux64.h
index 06e08a108c6..e57a6c67a25 100644
--- a/gcc/config/rs6000/linux64.h
+++ b/gcc/config/rs6000/linux64.h
@@ -1,7 +1,7 @@
/* Definitions of target machine for GNU compiler,
for 64 bit PowerPC linux.
Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
- 2009, 2010 Free Software Foundation, Inc.
+ 2009, 2010, 2011 Free Software Foundation, Inc.
This file is part of GCC.
@@ -73,9 +73,9 @@ extern int dot_symbols;
#endif
#undef PROCESSOR_DEFAULT
-#define PROCESSOR_DEFAULT PROCESSOR_POWER6
+#define PROCESSOR_DEFAULT PROCESSOR_POWER7
#undef PROCESSOR_DEFAULT64
-#define PROCESSOR_DEFAULT64 PROCESSOR_POWER6
+#define PROCESSOR_DEFAULT64 PROCESSOR_POWER7
/* We don't need to generate entries in .fixup, except when
-mrelocatable or -mrelocatable-lib is given. */
@@ -192,7 +192,7 @@ extern int dot_symbols;
#endif
#endif
-#define ASM_SPEC32 "-a32 %{Ym,*} %{Yd,*} \
+#define ASM_SPEC32 "-a32 \
%{mrelocatable} %{mrelocatable-lib} %{fpic:-K PIC} %{fPIC:-K PIC} \
%{memb} %{!memb: %{msdata=eabi: -memb}} \
%{!mlittle: %{!mlittle-endian: %{!mbig: %{!mbig-endian: \
@@ -207,7 +207,6 @@ extern int dot_symbols;
#define ASM_SPEC_COMMON "%(asm_cpu) \
%{,assembler|,assembler-with-cpp: %{mregnames} %{mno-regnames}} \
-%{Qy:} %{!Qn:-Qy} \
%{mlittle} %{mlittle-endian} %{mbig} %{mbig-endian}"
#undef SUBSUBTARGET_EXTRA_SPECS
diff --git a/gcc/config/rs6000/predicates.md b/gcc/config/rs6000/predicates.md
index db630f58ee1..1d06caeaef5 100644
--- a/gcc/config/rs6000/predicates.md
+++ b/gcc/config/rs6000/predicates.md
@@ -328,13 +328,11 @@
if (TARGET_PAIRED_FLOAT)
return false;
- if ((VSX_VECTOR_MODE (mode) || mode == TImode) && zero_constant (op, mode))
- return true;
-
- if (ALTIVEC_VECTOR_MODE (mode))
+ if (VECTOR_MEM_ALTIVEC_OR_VSX_P (mode))
{
if (zero_constant (op, mode))
- return true;
+ return true;
+
return easy_altivec_constant (op, mode);
}
diff --git a/gcc/config/rs6000/rs6000-builtin.def b/gcc/config/rs6000/rs6000-builtin.def
index 9f45a72e2c0..7bd6b20fa07 100644
--- a/gcc/config/rs6000/rs6000-builtin.def
+++ b/gcc/config/rs6000/rs6000-builtin.def
@@ -1,5 +1,5 @@
/* Builtin functions for rs6000/powerpc.
- Copyright (C) 2009, 2010
+ Copyright (C) 2009, 2010, 2011
Free Software Foundation, Inc.
Contributed by Michael Meissner (meissner@linux.vnet.ibm.com)
@@ -37,6 +37,10 @@ RS6000_BUILTIN(ALTIVEC_BUILTIN_ST_INTERNAL_16qi, RS6000_BTC_MEM)
RS6000_BUILTIN(ALTIVEC_BUILTIN_LD_INTERNAL_16qi, RS6000_BTC_MEM)
RS6000_BUILTIN(ALTIVEC_BUILTIN_ST_INTERNAL_4sf, RS6000_BTC_MEM)
RS6000_BUILTIN(ALTIVEC_BUILTIN_LD_INTERNAL_4sf, RS6000_BTC_MEM)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_ST_INTERNAL_2df, RS6000_BTC_MEM)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_LD_INTERNAL_2df, RS6000_BTC_MEM)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_ST_INTERNAL_2di, RS6000_BTC_MEM)
+RS6000_BUILTIN(ALTIVEC_BUILTIN_LD_INTERNAL_2di, RS6000_BTC_MEM)
RS6000_BUILTIN(ALTIVEC_BUILTIN_VADDUBM, RS6000_BTC_CONST)
RS6000_BUILTIN(ALTIVEC_BUILTIN_VADDUHM, RS6000_BTC_CONST)
RS6000_BUILTIN(ALTIVEC_BUILTIN_VADDUWM, RS6000_BTC_CONST)
@@ -778,12 +782,20 @@ RS6000_BUILTIN(PAIRED_BUILTIN_CMPU1, RS6000_BTC_MISC)
/* VSX builtins. */
RS6000_BUILTIN(VSX_BUILTIN_LXSDX, RS6000_BTC_MEM)
-RS6000_BUILTIN(VSX_BUILTIN_LXVD2X, RS6000_BTC_MEM)
+RS6000_BUILTIN(VSX_BUILTIN_LXVD2X_V2DF, RS6000_BTC_MEM)
+RS6000_BUILTIN(VSX_BUILTIN_LXVD2X_V2DI, RS6000_BTC_MEM)
RS6000_BUILTIN(VSX_BUILTIN_LXVDSX, RS6000_BTC_MEM)
-RS6000_BUILTIN(VSX_BUILTIN_LXVW4X, RS6000_BTC_MEM)
+RS6000_BUILTIN(VSX_BUILTIN_LXVW4X_V4SF, RS6000_BTC_MEM)
+RS6000_BUILTIN(VSX_BUILTIN_LXVW4X_V4SI, RS6000_BTC_MEM)
+RS6000_BUILTIN(VSX_BUILTIN_LXVW4X_V8HI, RS6000_BTC_MEM)
+RS6000_BUILTIN(VSX_BUILTIN_LXVW4X_V16QI, RS6000_BTC_MEM)
RS6000_BUILTIN(VSX_BUILTIN_STXSDX, RS6000_BTC_MEM)
-RS6000_BUILTIN(VSX_BUILTIN_STXVD2X, RS6000_BTC_MEM)
-RS6000_BUILTIN(VSX_BUILTIN_STXVW4X, RS6000_BTC_MEM)
+RS6000_BUILTIN(VSX_BUILTIN_STXVD2X_V2DF, RS6000_BTC_MEM)
+RS6000_BUILTIN(VSX_BUILTIN_STXVD2X_V2DI, RS6000_BTC_MEM)
+RS6000_BUILTIN(VSX_BUILTIN_STXVW4X_V4SF, RS6000_BTC_MEM)
+RS6000_BUILTIN(VSX_BUILTIN_STXVW4X_V4SI, RS6000_BTC_MEM)
+RS6000_BUILTIN(VSX_BUILTIN_STXVW4X_V8HI, RS6000_BTC_MEM)
+RS6000_BUILTIN(VSX_BUILTIN_STXVW4X_V16QI, RS6000_BTC_MEM)
RS6000_BUILTIN(VSX_BUILTIN_XSABSDP, RS6000_BTC_CONST)
RS6000_BUILTIN(VSX_BUILTIN_XSADDDP, RS6000_BTC_FP_PURE)
RS6000_BUILTIN(VSX_BUILTIN_XSCMPODP, RS6000_BTC_FP_PURE)
@@ -983,8 +995,10 @@ RS6000_BUILTIN(VSX_BUILTIN_VEC_XXPERMDI, RS6000_BTC_MISC)
RS6000_BUILTIN(VSX_BUILTIN_VEC_XXSLDWI, RS6000_BTC_MISC)
RS6000_BUILTIN(VSX_BUILTIN_VEC_XXSPLTD, RS6000_BTC_MISC)
RS6000_BUILTIN(VSX_BUILTIN_VEC_XXSPLTW, RS6000_BTC_MISC)
+RS6000_BUILTIN(VSX_BUILTIN_VEC_LD, RS6000_BTC_MISC)
+RS6000_BUILTIN(VSX_BUILTIN_VEC_ST, RS6000_BTC_MISC)
RS6000_BUILTIN_EQUATE(VSX_BUILTIN_OVERLOADED_LAST,
- VSX_BUILTIN_VEC_XXSPLTW)
+ VSX_BUILTIN_VEC_ST)
/* Combined VSX/Altivec builtins. */
RS6000_BUILTIN(VECTOR_BUILTIN_FLOAT_V4SI_V4SF, RS6000_BTC_FP_PURE)
@@ -1001,3 +1015,6 @@ RS6000_BUILTIN(RS6000_BUILTIN_RECIPF, RS6000_BTC_FP_PURE)
RS6000_BUILTIN(RS6000_BUILTIN_RSQRTF, RS6000_BTC_FP_PURE)
RS6000_BUILTIN(RS6000_BUILTIN_RSQRT, RS6000_BTC_FP_PURE)
RS6000_BUILTIN(RS6000_BUILTIN_BSWAP_HI, RS6000_BTC_CONST)
+
+/* Darwin CfString builtin. */
+RS6000_BUILTIN(RS6000_BUILTIN_CFSTRING, RS6000_BTC_MISC)
diff --git a/gcc/config/rs6000/rs6000-c.c b/gcc/config/rs6000/rs6000-c.c
index b2e0d60db5f..3f4f90b236c 100644
--- a/gcc/config/rs6000/rs6000-c.c
+++ b/gcc/config/rs6000/rs6000-c.c
@@ -1,5 +1,5 @@
/* Subroutines for the C front end on the POWER and PowerPC architectures.
- Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
+ Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
Free Software Foundation, Inc.
Contributed by Zack Weinberg <zack@codesourcery.com>
@@ -385,6 +385,20 @@ rs6000_cpu_cpp_builtins (cpp_reader *pfile)
builtin_define ("__LONGDOUBLE128");
}
+ switch (TARGET_CMODEL)
+ {
+ /* Deliberately omit __CMODEL_SMALL__ since that was the default
+ before --mcmodel support was added. */
+ case CMODEL_MEDIUM:
+ builtin_define ("__CMODEL_MEDIUM__");
+ break;
+ case CMODEL_LARGE:
+ builtin_define ("__CMODEL_LARGE__");
+ break;
+ default:
+ break;
+ }
+
switch (rs6000_current_abi)
{
case ABI_V4:
@@ -986,6 +1000,15 @@ const struct altivec_builtin_types altivec_overloaded_builtins[] = {
{ VSX_BUILTIN_VEC_DIV, VSX_BUILTIN_XVDIVDP,
RS6000_BTI_V2DF, RS6000_BTI_V2DF, RS6000_BTI_V2DF, 0 },
{ ALTIVEC_BUILTIN_VEC_LD, ALTIVEC_BUILTIN_LVX,
+ RS6000_BTI_V2DF, RS6000_BTI_INTSI, ~RS6000_BTI_V2DF, 0 },
+ { ALTIVEC_BUILTIN_VEC_LD, ALTIVEC_BUILTIN_LVX,
+ RS6000_BTI_V2DI, RS6000_BTI_INTSI, ~RS6000_BTI_V2DI, 0 },
+ { ALTIVEC_BUILTIN_VEC_LD, ALTIVEC_BUILTIN_LVX,
+ RS6000_BTI_unsigned_V2DI, RS6000_BTI_INTSI,
+ ~RS6000_BTI_unsigned_V2DI, 0 },
+ { ALTIVEC_BUILTIN_VEC_LD, ALTIVEC_BUILTIN_LVX,
+ RS6000_BTI_bool_V2DI, RS6000_BTI_INTSI, ~RS6000_BTI_bool_V2DI, 0 },
+ { ALTIVEC_BUILTIN_VEC_LD, ALTIVEC_BUILTIN_LVX,
RS6000_BTI_V4SF, RS6000_BTI_INTSI, ~RS6000_BTI_V4SF, 0 },
{ ALTIVEC_BUILTIN_VEC_LD, ALTIVEC_BUILTIN_LVX,
RS6000_BTI_V4SF, RS6000_BTI_INTSI, ~RS6000_BTI_float, 0 },
@@ -1098,9 +1121,19 @@ const struct altivec_builtin_types altivec_overloaded_builtins[] = {
{ ALTIVEC_BUILTIN_VEC_LDL, ALTIVEC_BUILTIN_LVXL,
RS6000_BTI_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_INTQI, 0 },
{ ALTIVEC_BUILTIN_VEC_LDL, ALTIVEC_BUILTIN_LVXL,
- RS6000_BTI_unsigned_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_unsigned_V16QI, 0 },
+ RS6000_BTI_unsigned_V16QI, RS6000_BTI_INTSI,
+ ~RS6000_BTI_unsigned_V16QI, 0 },
{ ALTIVEC_BUILTIN_VEC_LDL, ALTIVEC_BUILTIN_LVXL,
RS6000_BTI_unsigned_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_UINTQI, 0 },
+ { ALTIVEC_BUILTIN_VEC_LDL, ALTIVEC_BUILTIN_LVXL,
+ RS6000_BTI_V2DF, RS6000_BTI_INTSI, ~RS6000_BTI_V2DF, 0 },
+ { ALTIVEC_BUILTIN_VEC_LDL, ALTIVEC_BUILTIN_LVXL,
+ RS6000_BTI_V2DI, RS6000_BTI_INTSI, ~RS6000_BTI_V2DI, 0 },
+ { ALTIVEC_BUILTIN_VEC_LDL, ALTIVEC_BUILTIN_LVXL,
+ RS6000_BTI_unsigned_V2DI, RS6000_BTI_INTSI,
+ ~RS6000_BTI_unsigned_V2DI, 0 },
+ { ALTIVEC_BUILTIN_VEC_LDL, ALTIVEC_BUILTIN_LVXL,
+ RS6000_BTI_bool_V2DI, RS6000_BTI_INTSI, ~RS6000_BTI_bool_V2DI, 0 },
{ ALTIVEC_BUILTIN_VEC_LVSL, ALTIVEC_BUILTIN_LVSL,
RS6000_BTI_unsigned_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_UINTQI, 0 },
{ ALTIVEC_BUILTIN_VEC_LVSL, ALTIVEC_BUILTIN_LVSL,
@@ -1119,6 +1152,17 @@ const struct altivec_builtin_types altivec_overloaded_builtins[] = {
RS6000_BTI_unsigned_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_long, 0 },
{ ALTIVEC_BUILTIN_VEC_LVSL, ALTIVEC_BUILTIN_LVSL,
RS6000_BTI_unsigned_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_float, 0 },
+ { ALTIVEC_BUILTIN_VEC_LVSL, ALTIVEC_BUILTIN_LVSL,
+ RS6000_BTI_unsigned_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_double, 0 },
+ { ALTIVEC_BUILTIN_VEC_LVSL, ALTIVEC_BUILTIN_LVSL,
+ RS6000_BTI_unsigned_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_UINTDI, 0 },
+ { ALTIVEC_BUILTIN_VEC_LVSL, ALTIVEC_BUILTIN_LVSL,
+ RS6000_BTI_unsigned_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_INTDI, 0 },
+ { ALTIVEC_BUILTIN_VEC_LVSL, ALTIVEC_BUILTIN_LVSL,
+ RS6000_BTI_unsigned_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_long_long, 0 },
+ { ALTIVEC_BUILTIN_VEC_LVSL, ALTIVEC_BUILTIN_LVSL,
+ RS6000_BTI_unsigned_V16QI, RS6000_BTI_INTSI,
+ ~RS6000_BTI_unsigned_long_long, 0 },
{ ALTIVEC_BUILTIN_VEC_LVSR, ALTIVEC_BUILTIN_LVSR,
RS6000_BTI_unsigned_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_UINTQI, 0 },
{ ALTIVEC_BUILTIN_VEC_LVSR, ALTIVEC_BUILTIN_LVSR,
@@ -1137,6 +1181,17 @@ const struct altivec_builtin_types altivec_overloaded_builtins[] = {
RS6000_BTI_unsigned_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_long, 0 },
{ ALTIVEC_BUILTIN_VEC_LVSR, ALTIVEC_BUILTIN_LVSR,
RS6000_BTI_unsigned_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_float, 0 },
+ { ALTIVEC_BUILTIN_VEC_LVSR, ALTIVEC_BUILTIN_LVSR,
+ RS6000_BTI_unsigned_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_double, 0 },
+ { ALTIVEC_BUILTIN_VEC_LVSR, ALTIVEC_BUILTIN_LVSR,
+ RS6000_BTI_unsigned_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_UINTDI, 0 },
+ { ALTIVEC_BUILTIN_VEC_LVSR, ALTIVEC_BUILTIN_LVSR,
+ RS6000_BTI_unsigned_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_INTDI, 0 },
+ { ALTIVEC_BUILTIN_VEC_LVSR, ALTIVEC_BUILTIN_LVSR,
+ RS6000_BTI_unsigned_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_long_long, 0 },
+ { ALTIVEC_BUILTIN_VEC_LVSR, ALTIVEC_BUILTIN_LVSR,
+ RS6000_BTI_unsigned_V16QI, RS6000_BTI_INTSI,
+ ~RS6000_BTI_unsigned_long_long, 0 },
{ ALTIVEC_BUILTIN_VEC_LVLX, ALTIVEC_BUILTIN_LVLX,
RS6000_BTI_V4SF, RS6000_BTI_INTSI, ~RS6000_BTI_V4SF, 0 },
{ ALTIVEC_BUILTIN_VEC_LVLX, ALTIVEC_BUILTIN_LVLX,
@@ -2630,6 +2685,16 @@ const struct altivec_builtin_types altivec_overloaded_builtins[] = {
{ ALTIVEC_BUILTIN_VEC_SLD, ALTIVEC_BUILTIN_VSLDOI_16QI,
RS6000_BTI_bool_V16QI, RS6000_BTI_bool_V16QI, RS6000_BTI_bool_V16QI, RS6000_BTI_NOT_OPAQUE },
{ ALTIVEC_BUILTIN_VEC_ST, ALTIVEC_BUILTIN_STVX,
+ RS6000_BTI_void, RS6000_BTI_V2DF, RS6000_BTI_INTSI, ~RS6000_BTI_V2DF },
+ { ALTIVEC_BUILTIN_VEC_ST, ALTIVEC_BUILTIN_STVX,
+ RS6000_BTI_void, RS6000_BTI_V2DI, RS6000_BTI_INTSI, ~RS6000_BTI_V2DI },
+ { ALTIVEC_BUILTIN_VEC_ST, ALTIVEC_BUILTIN_STVX,
+ RS6000_BTI_void, RS6000_BTI_unsigned_V2DI, RS6000_BTI_INTSI,
+ ~RS6000_BTI_unsigned_V2DI },
+ { ALTIVEC_BUILTIN_VEC_ST, ALTIVEC_BUILTIN_STVX,
+ RS6000_BTI_void, RS6000_BTI_bool_V2DI, RS6000_BTI_INTSI,
+ ~RS6000_BTI_bool_V2DI },
+ { ALTIVEC_BUILTIN_VEC_ST, ALTIVEC_BUILTIN_STVX,
RS6000_BTI_void, RS6000_BTI_V4SF, RS6000_BTI_INTSI, ~RS6000_BTI_V4SF },
{ ALTIVEC_BUILTIN_VEC_ST, ALTIVEC_BUILTIN_STVX,
RS6000_BTI_void, RS6000_BTI_V4SF, RS6000_BTI_INTSI, ~RS6000_BTI_float },
@@ -2795,6 +2860,18 @@ const struct altivec_builtin_types altivec_overloaded_builtins[] = {
RS6000_BTI_void, RS6000_BTI_bool_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_INTQI },
{ ALTIVEC_BUILTIN_VEC_STL, ALTIVEC_BUILTIN_STVXL,
RS6000_BTI_void, RS6000_BTI_pixel_V8HI, RS6000_BTI_INTSI, ~RS6000_BTI_pixel_V8HI },
+ { ALTIVEC_BUILTIN_VEC_STL, ALTIVEC_BUILTIN_STVXL,
+ RS6000_BTI_void, RS6000_BTI_V2DF, RS6000_BTI_INTSI, ~RS6000_BTI_V2DF },
+ { ALTIVEC_BUILTIN_VEC_STL, ALTIVEC_BUILTIN_STVXL,
+ RS6000_BTI_void, RS6000_BTI_V2DF, RS6000_BTI_INTSI, ~RS6000_BTI_double },
+ { ALTIVEC_BUILTIN_VEC_STL, ALTIVEC_BUILTIN_STVXL,
+ RS6000_BTI_void, RS6000_BTI_V2DI, RS6000_BTI_INTSI, ~RS6000_BTI_V2DI },
+ { ALTIVEC_BUILTIN_VEC_STL, ALTIVEC_BUILTIN_STVXL,
+ RS6000_BTI_void, RS6000_BTI_unsigned_V2DI, RS6000_BTI_INTSI,
+ ~RS6000_BTI_unsigned_V2DI },
+ { ALTIVEC_BUILTIN_VEC_STL, ALTIVEC_BUILTIN_STVXL,
+ RS6000_BTI_void, RS6000_BTI_bool_V2DI, RS6000_BTI_INTSI,
+ ~RS6000_BTI_bool_V2DI },
{ ALTIVEC_BUILTIN_VEC_STVLX, ALTIVEC_BUILTIN_STVLX,
RS6000_BTI_void, RS6000_BTI_V4SF, RS6000_BTI_INTSI, ~RS6000_BTI_V4SF },
{ ALTIVEC_BUILTIN_VEC_STVLX, ALTIVEC_BUILTIN_STVLX,
@@ -2988,6 +3065,135 @@ const struct altivec_builtin_types altivec_overloaded_builtins[] = {
RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI,
RS6000_BTI_NOT_OPAQUE },
+ { VSX_BUILTIN_VEC_LD, VSX_BUILTIN_LXVD2X_V2DF,
+ RS6000_BTI_V2DF, RS6000_BTI_INTSI, ~RS6000_BTI_V2DF, 0 },
+ { VSX_BUILTIN_VEC_LD, VSX_BUILTIN_LXVD2X_V2DI,
+ RS6000_BTI_V2DI, RS6000_BTI_INTSI, ~RS6000_BTI_V2DI, 0 },
+ { VSX_BUILTIN_VEC_LD, VSX_BUILTIN_LXVD2X_V2DI,
+ RS6000_BTI_unsigned_V2DI, RS6000_BTI_INTSI,
+ ~RS6000_BTI_unsigned_V2DI, 0 },
+ { VSX_BUILTIN_VEC_LD, VSX_BUILTIN_LXVD2X_V2DI,
+ RS6000_BTI_bool_V2DI, RS6000_BTI_INTSI, ~RS6000_BTI_bool_V2DI, 0 },
+ { VSX_BUILTIN_VEC_LD, VSX_BUILTIN_LXVW4X_V4SF,
+ RS6000_BTI_V4SF, RS6000_BTI_INTSI, ~RS6000_BTI_V4SF, 0 },
+ { VSX_BUILTIN_VEC_LD, VSX_BUILTIN_LXVW4X_V4SF,
+ RS6000_BTI_V4SF, RS6000_BTI_INTSI, ~RS6000_BTI_float, 0 },
+ { VSX_BUILTIN_VEC_LD, VSX_BUILTIN_LXVW4X_V4SI,
+ RS6000_BTI_bool_V4SI, RS6000_BTI_INTSI, ~RS6000_BTI_bool_V4SI, 0 },
+ { VSX_BUILTIN_VEC_LD, VSX_BUILTIN_LXVW4X_V4SI,
+ RS6000_BTI_V4SI, RS6000_BTI_INTSI, ~RS6000_BTI_V4SI, 0 },
+ { VSX_BUILTIN_VEC_LD, VSX_BUILTIN_LXVW4X_V4SI,
+ RS6000_BTI_V4SI, RS6000_BTI_INTSI, ~RS6000_BTI_INTSI, 0 },
+ { VSX_BUILTIN_VEC_LD, VSX_BUILTIN_LXVW4X_V4SI,
+ RS6000_BTI_V4SI, RS6000_BTI_INTSI, ~RS6000_BTI_long, 0 },
+ { VSX_BUILTIN_VEC_LD, VSX_BUILTIN_LXVW4X_V4SI,
+ RS6000_BTI_unsigned_V4SI, RS6000_BTI_INTSI,
+ ~RS6000_BTI_unsigned_V4SI, 0 },
+ { VSX_BUILTIN_VEC_LD, VSX_BUILTIN_LXVW4X_V4SI,
+ RS6000_BTI_unsigned_V4SI, RS6000_BTI_INTSI, ~RS6000_BTI_UINTSI, 0 },
+ { VSX_BUILTIN_VEC_LD, VSX_BUILTIN_LXVW4X_V4SI,
+ RS6000_BTI_unsigned_V4SI, RS6000_BTI_INTSI,
+ ~RS6000_BTI_unsigned_long, 0 },
+ { VSX_BUILTIN_VEC_LD, VSX_BUILTIN_LXVW4X_V8HI,
+ RS6000_BTI_bool_V8HI, RS6000_BTI_INTSI, ~RS6000_BTI_bool_V8HI, 0 },
+ { VSX_BUILTIN_VEC_LD, VSX_BUILTIN_LXVW4X_V8HI,
+ RS6000_BTI_pixel_V8HI, RS6000_BTI_INTSI, ~RS6000_BTI_pixel_V8HI, 0 },
+ { VSX_BUILTIN_VEC_LD, VSX_BUILTIN_LXVW4X_V8HI,
+ RS6000_BTI_V8HI, RS6000_BTI_INTSI, ~RS6000_BTI_V8HI, 0 },
+ { VSX_BUILTIN_VEC_LD, VSX_BUILTIN_LXVW4X_V8HI,
+ RS6000_BTI_V8HI, RS6000_BTI_INTSI, ~RS6000_BTI_INTHI, 0 },
+ { VSX_BUILTIN_VEC_LD, VSX_BUILTIN_LXVW4X_V8HI,
+ RS6000_BTI_unsigned_V8HI, RS6000_BTI_INTSI,
+ ~RS6000_BTI_unsigned_V8HI, 0 },
+ { VSX_BUILTIN_VEC_LD, VSX_BUILTIN_LXVW4X_V8HI,
+ RS6000_BTI_unsigned_V8HI, RS6000_BTI_INTSI, ~RS6000_BTI_UINTHI, 0 },
+ { VSX_BUILTIN_VEC_LD, VSX_BUILTIN_LXVW4X_V16QI,
+ RS6000_BTI_bool_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_bool_V16QI, 0 },
+ { VSX_BUILTIN_VEC_LD, VSX_BUILTIN_LXVW4X_V16QI,
+ RS6000_BTI_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_V16QI, 0 },
+ { VSX_BUILTIN_VEC_LD, VSX_BUILTIN_LXVW4X_V16QI,
+ RS6000_BTI_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_INTQI, 0 },
+ { VSX_BUILTIN_VEC_LD, VSX_BUILTIN_LXVW4X_V16QI,
+ RS6000_BTI_unsigned_V16QI, RS6000_BTI_INTSI,
+ ~RS6000_BTI_unsigned_V16QI, 0 },
+ { VSX_BUILTIN_VEC_LD, VSX_BUILTIN_LXVW4X_V16QI,
+ RS6000_BTI_unsigned_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_UINTQI, 0 },
+
+ { VSX_BUILTIN_VEC_ST, VSX_BUILTIN_STXVD2X_V2DF,
+ RS6000_BTI_void, RS6000_BTI_V2DF, RS6000_BTI_INTSI, ~RS6000_BTI_V2DF },
+ { VSX_BUILTIN_VEC_ST, VSX_BUILTIN_STXVD2X_V2DI,
+ RS6000_BTI_void, RS6000_BTI_V2DI, RS6000_BTI_INTSI, ~RS6000_BTI_V2DI },
+ { VSX_BUILTIN_VEC_ST, VSX_BUILTIN_STXVD2X_V2DI,
+ RS6000_BTI_void, RS6000_BTI_unsigned_V2DI, RS6000_BTI_INTSI,
+ ~RS6000_BTI_unsigned_V2DI },
+ { VSX_BUILTIN_VEC_ST, VSX_BUILTIN_STXVD2X_V2DI,
+ RS6000_BTI_void, RS6000_BTI_bool_V2DI, RS6000_BTI_INTSI,
+ ~RS6000_BTI_bool_V2DI },
+ { VSX_BUILTIN_VEC_ST, VSX_BUILTIN_STXVW4X_V4SF,
+ RS6000_BTI_void, RS6000_BTI_V4SF, RS6000_BTI_INTSI, ~RS6000_BTI_V4SF },
+ { VSX_BUILTIN_VEC_ST, VSX_BUILTIN_STXVW4X_V4SF,
+ RS6000_BTI_void, RS6000_BTI_V4SF, RS6000_BTI_INTSI, ~RS6000_BTI_float },
+ { VSX_BUILTIN_VEC_ST, VSX_BUILTIN_STXVW4X_V4SI,
+ RS6000_BTI_void, RS6000_BTI_V4SI, RS6000_BTI_INTSI, ~RS6000_BTI_V4SI },
+ { VSX_BUILTIN_VEC_ST, VSX_BUILTIN_STXVW4X_V4SI,
+ RS6000_BTI_void, RS6000_BTI_V4SI, RS6000_BTI_INTSI, ~RS6000_BTI_INTSI },
+ { VSX_BUILTIN_VEC_ST, VSX_BUILTIN_STXVW4X_V4SI,
+ RS6000_BTI_void, RS6000_BTI_unsigned_V4SI, RS6000_BTI_INTSI,
+ ~RS6000_BTI_unsigned_V4SI },
+ { VSX_BUILTIN_VEC_ST, VSX_BUILTIN_STXVW4X_V4SI,
+ RS6000_BTI_void, RS6000_BTI_unsigned_V4SI, RS6000_BTI_INTSI,
+ ~RS6000_BTI_UINTSI },
+ { VSX_BUILTIN_VEC_ST, VSX_BUILTIN_STXVW4X_V4SI,
+ RS6000_BTI_void, RS6000_BTI_bool_V4SI, RS6000_BTI_INTSI,
+ ~RS6000_BTI_bool_V4SI },
+ { VSX_BUILTIN_VEC_ST, VSX_BUILTIN_STXVW4X_V4SI,
+ RS6000_BTI_void, RS6000_BTI_bool_V4SI, RS6000_BTI_INTSI,
+ ~RS6000_BTI_UINTSI },
+ { VSX_BUILTIN_VEC_ST, VSX_BUILTIN_STXVW4X_V4SI,
+ RS6000_BTI_void, RS6000_BTI_bool_V4SI, RS6000_BTI_INTSI,
+ ~RS6000_BTI_INTSI },
+ { VSX_BUILTIN_VEC_ST, VSX_BUILTIN_STXVW4X_V8HI,
+ RS6000_BTI_void, RS6000_BTI_V8HI, RS6000_BTI_INTSI, ~RS6000_BTI_V8HI },
+ { VSX_BUILTIN_VEC_ST, VSX_BUILTIN_STXVW4X_V8HI,
+ RS6000_BTI_void, RS6000_BTI_V8HI, RS6000_BTI_INTSI, ~RS6000_BTI_INTHI },
+ { VSX_BUILTIN_VEC_ST, VSX_BUILTIN_STXVW4X_V8HI,
+ RS6000_BTI_void, RS6000_BTI_unsigned_V8HI, RS6000_BTI_INTSI,
+ ~RS6000_BTI_unsigned_V8HI },
+ { VSX_BUILTIN_VEC_ST, VSX_BUILTIN_STXVW4X_V8HI,
+ RS6000_BTI_void, RS6000_BTI_unsigned_V8HI, RS6000_BTI_INTSI,
+ ~RS6000_BTI_UINTHI },
+ { VSX_BUILTIN_VEC_ST, VSX_BUILTIN_STXVW4X_V8HI,
+ RS6000_BTI_void, RS6000_BTI_bool_V8HI, RS6000_BTI_INTSI,
+ ~RS6000_BTI_bool_V8HI },
+ { VSX_BUILTIN_VEC_ST, VSX_BUILTIN_STXVW4X_V8HI,
+ RS6000_BTI_void, RS6000_BTI_bool_V8HI, RS6000_BTI_INTSI,
+ ~RS6000_BTI_UINTHI },
+ { VSX_BUILTIN_VEC_ST, VSX_BUILTIN_STXVW4X_V8HI,
+ RS6000_BTI_void, RS6000_BTI_bool_V8HI, RS6000_BTI_INTSI,
+ ~RS6000_BTI_INTHI },
+ { VSX_BUILTIN_VEC_ST, VSX_BUILTIN_STXVW4X_V16QI,
+ RS6000_BTI_void, RS6000_BTI_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_V16QI },
+ { VSX_BUILTIN_VEC_ST, VSX_BUILTIN_STXVW4X_V16QI,
+ RS6000_BTI_void, RS6000_BTI_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_INTQI },
+ { VSX_BUILTIN_VEC_ST, VSX_BUILTIN_STXVW4X_V16QI,
+ RS6000_BTI_void, RS6000_BTI_unsigned_V16QI, RS6000_BTI_INTSI,
+ ~RS6000_BTI_unsigned_V16QI },
+ { VSX_BUILTIN_VEC_ST, VSX_BUILTIN_STXVW4X_V16QI,
+ RS6000_BTI_void, RS6000_BTI_unsigned_V16QI, RS6000_BTI_INTSI,
+ ~RS6000_BTI_UINTQI },
+ { VSX_BUILTIN_VEC_ST, VSX_BUILTIN_STXVW4X_V16QI,
+ RS6000_BTI_void, RS6000_BTI_bool_V16QI, RS6000_BTI_INTSI,
+ ~RS6000_BTI_bool_V16QI },
+ { VSX_BUILTIN_VEC_ST, VSX_BUILTIN_STXVW4X_V16QI,
+ RS6000_BTI_void, RS6000_BTI_bool_V16QI, RS6000_BTI_INTSI,
+ ~RS6000_BTI_UINTQI },
+ { VSX_BUILTIN_VEC_ST, VSX_BUILTIN_STXVW4X_V16QI,
+ RS6000_BTI_void, RS6000_BTI_bool_V16QI, RS6000_BTI_INTSI,
+ ~RS6000_BTI_INTQI },
+ { VSX_BUILTIN_VEC_ST, VSX_BUILTIN_STXVW4X_V16QI,
+ RS6000_BTI_void, RS6000_BTI_pixel_V8HI, RS6000_BTI_INTSI,
+ ~RS6000_BTI_pixel_V8HI },
+
/* Predicates. */
{ ALTIVEC_BUILTIN_VCMPGT_P, ALTIVEC_BUILTIN_VCMPGTUB_P,
RS6000_BTI_INTSI, RS6000_BTI_INTSI, RS6000_BTI_bool_V16QI, RS6000_BTI_unsigned_V16QI },
diff --git a/gcc/config/rs6000/rs6000-protos.h b/gcc/config/rs6000/rs6000-protos.h
index 3eafc166cb8..d9b6bd70cad 100644
--- a/gcc/config/rs6000/rs6000-protos.h
+++ b/gcc/config/rs6000/rs6000-protos.h
@@ -1,5 +1,6 @@
/* Definitions of target machine for GNU compiler, for IBM RS/6000.
- Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
+ Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
+ 2010, 2011
Free Software Foundation, Inc.
Contributed by Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
@@ -129,6 +130,7 @@ extern void rs6000_emit_parity (rtx, rtx);
extern rtx rs6000_machopic_legitimize_pic_address (rtx, enum machine_mode,
rtx);
extern rtx rs6000_address_for_fpconvert (rtx);
+extern rtx rs6000_address_for_altivec (rtx);
extern rtx rs6000_allocate_stack_temp (enum machine_mode, bool, bool);
extern int rs6000_loop_align (rtx);
#endif /* RTX_CODE */
diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index 30f8b75dc4c..df02bef54df 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -1,6 +1,6 @@
/* Subroutines used for code generation on IBM RS/6000.
Copyright (C) 1991, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
- 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
+ 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
Free Software Foundation, Inc.
Contributed by Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
@@ -3316,9 +3316,12 @@ rs6000_option_override_internal (bool global_init_p)
/* If not explicitly specified via option, decide whether to generate indexed
load/store instructions. */
if (TARGET_AVOID_XFORM == -1)
- /* Avoid indexed addressing when targeting Power6 in order to avoid
- the DERAT mispredict penalty. */
- TARGET_AVOID_XFORM = (rs6000_cpu == PROCESSOR_POWER6 && TARGET_CMPB);
+ /* Avoid indexed addressing when targeting Power6 in order to avoid the
+ DERAT mispredict penalty. However the LVE and STVE altivec instructions
+ need indexed accesses and the type used is the scalar type of the element
+ being loaded or stored. */
+ TARGET_AVOID_XFORM = (rs6000_cpu == PROCESSOR_POWER6 && TARGET_CMPB
+ && !TARGET_ALTIVEC);
/* Set the -mrecip options. */
if (rs6000_recip_name)
@@ -11263,16 +11266,22 @@ altivec_expand_ld_builtin (tree exp, rtx target, bool *expandedp)
switch (fcode)
{
case ALTIVEC_BUILTIN_LD_INTERNAL_16qi:
- icode = CODE_FOR_vector_load_v16qi;
+ icode = CODE_FOR_vector_altivec_load_v16qi;
break;
case ALTIVEC_BUILTIN_LD_INTERNAL_8hi:
- icode = CODE_FOR_vector_load_v8hi;
+ icode = CODE_FOR_vector_altivec_load_v8hi;
break;
case ALTIVEC_BUILTIN_LD_INTERNAL_4si:
- icode = CODE_FOR_vector_load_v4si;
+ icode = CODE_FOR_vector_altivec_load_v4si;
break;
case ALTIVEC_BUILTIN_LD_INTERNAL_4sf:
- icode = CODE_FOR_vector_load_v4sf;
+ icode = CODE_FOR_vector_altivec_load_v4sf;
+ break;
+ case ALTIVEC_BUILTIN_LD_INTERNAL_2df:
+ icode = CODE_FOR_vector_altivec_load_v2df;
+ break;
+ case ALTIVEC_BUILTIN_LD_INTERNAL_2di:
+ icode = CODE_FOR_vector_altivec_load_v2di;
break;
default:
*expandedp = false;
@@ -11316,16 +11325,22 @@ altivec_expand_st_builtin (tree exp, rtx target ATTRIBUTE_UNUSED,
switch (fcode)
{
case ALTIVEC_BUILTIN_ST_INTERNAL_16qi:
- icode = CODE_FOR_vector_store_v16qi;
+ icode = CODE_FOR_vector_altivec_store_v16qi;
break;
case ALTIVEC_BUILTIN_ST_INTERNAL_8hi:
- icode = CODE_FOR_vector_store_v8hi;
+ icode = CODE_FOR_vector_altivec_store_v8hi;
break;
case ALTIVEC_BUILTIN_ST_INTERNAL_4si:
- icode = CODE_FOR_vector_store_v4si;
+ icode = CODE_FOR_vector_altivec_store_v4si;
break;
case ALTIVEC_BUILTIN_ST_INTERNAL_4sf:
- icode = CODE_FOR_vector_store_v4sf;
+ icode = CODE_FOR_vector_altivec_store_v4sf;
+ break;
+ case ALTIVEC_BUILTIN_ST_INTERNAL_2df:
+ icode = CODE_FOR_vector_altivec_store_v2df;
+ break;
+ case ALTIVEC_BUILTIN_ST_INTERNAL_2di:
+ icode = CODE_FOR_vector_altivec_store_v2di;
break;
default:
*expandedp = false;
@@ -11557,7 +11572,7 @@ altivec_expand_builtin (tree exp, rtx target, bool *expandedp)
switch (fcode)
{
case ALTIVEC_BUILTIN_STVX:
- return altivec_expand_stv_builtin (CODE_FOR_altivec_stvx, exp);
+ return altivec_expand_stv_builtin (CODE_FOR_altivec_stvx_v4si, exp);
case ALTIVEC_BUILTIN_STVEBX:
return altivec_expand_stv_builtin (CODE_FOR_altivec_stvebx, exp);
case ALTIVEC_BUILTIN_STVEHX:
@@ -11576,6 +11591,19 @@ altivec_expand_builtin (tree exp, rtx target, bool *expandedp)
case ALTIVEC_BUILTIN_STVRXL:
return altivec_expand_stv_builtin (CODE_FOR_altivec_stvrxl, exp);
+ case VSX_BUILTIN_STXVD2X_V2DF:
+ return altivec_expand_stv_builtin (CODE_FOR_vsx_store_v2df, exp);
+ case VSX_BUILTIN_STXVD2X_V2DI:
+ return altivec_expand_stv_builtin (CODE_FOR_vsx_store_v2di, exp);
+ case VSX_BUILTIN_STXVW4X_V4SF:
+ return altivec_expand_stv_builtin (CODE_FOR_vsx_store_v4sf, exp);
+ case VSX_BUILTIN_STXVW4X_V4SI:
+ return altivec_expand_stv_builtin (CODE_FOR_vsx_store_v4si, exp);
+ case VSX_BUILTIN_STXVW4X_V8HI:
+ return altivec_expand_stv_builtin (CODE_FOR_vsx_store_v8hi, exp);
+ case VSX_BUILTIN_STXVW4X_V16QI:
+ return altivec_expand_stv_builtin (CODE_FOR_vsx_store_v16qi, exp);
+
case ALTIVEC_BUILTIN_MFVSCR:
icode = CODE_FOR_altivec_mfvscr;
tmode = insn_data[icode].operand[0].mode;
@@ -11700,7 +11728,7 @@ altivec_expand_builtin (tree exp, rtx target, bool *expandedp)
return altivec_expand_lv_builtin (CODE_FOR_altivec_lvxl,
exp, target, false);
case ALTIVEC_BUILTIN_LVX:
- return altivec_expand_lv_builtin (CODE_FOR_altivec_lvx,
+ return altivec_expand_lv_builtin (CODE_FOR_altivec_lvx_v4si,
exp, target, false);
case ALTIVEC_BUILTIN_LVLX:
return altivec_expand_lv_builtin (CODE_FOR_altivec_lvlx,
@@ -11714,6 +11742,25 @@ altivec_expand_builtin (tree exp, rtx target, bool *expandedp)
case ALTIVEC_BUILTIN_LVRXL:
return altivec_expand_lv_builtin (CODE_FOR_altivec_lvrxl,
exp, target, true);
+ case VSX_BUILTIN_LXVD2X_V2DF:
+ return altivec_expand_lv_builtin (CODE_FOR_vsx_load_v2df,
+ exp, target, false);
+ case VSX_BUILTIN_LXVD2X_V2DI:
+ return altivec_expand_lv_builtin (CODE_FOR_vsx_load_v2di,
+ exp, target, false);
+ case VSX_BUILTIN_LXVW4X_V4SF:
+ return altivec_expand_lv_builtin (CODE_FOR_vsx_load_v4sf,
+ exp, target, false);
+ case VSX_BUILTIN_LXVW4X_V4SI:
+ return altivec_expand_lv_builtin (CODE_FOR_vsx_load_v4si,
+ exp, target, false);
+ case VSX_BUILTIN_LXVW4X_V8HI:
+ return altivec_expand_lv_builtin (CODE_FOR_vsx_load_v8hi,
+ exp, target, false);
+ case VSX_BUILTIN_LXVW4X_V16QI:
+ return altivec_expand_lv_builtin (CODE_FOR_vsx_load_v16qi,
+ exp, target, false);
+ break;
default:
break;
/* Fall through. */
@@ -12331,6 +12378,8 @@ rs6000_init_builtins (void)
long_integer_type_internal_node = long_integer_type_node;
long_unsigned_type_internal_node = long_unsigned_type_node;
+ long_long_integer_type_internal_node = long_long_integer_type_node;
+ long_long_unsigned_type_internal_node = long_long_unsigned_type_node;
intQI_type_internal_node = intQI_type_node;
uintQI_type_internal_node = unsigned_intQI_type_node;
intHI_type_internal_node = intHI_type_node;
@@ -12340,7 +12389,7 @@ rs6000_init_builtins (void)
intDI_type_internal_node = intDI_type_node;
uintDI_type_internal_node = unsigned_intDI_type_node;
float_type_internal_node = float_type_node;
- double_type_internal_node = float_type_node;
+ double_type_internal_node = double_type_node;
void_type_internal_node = void_type_node;
/* Initialize the modes for builtin_function_type, mapping a machine mode to
@@ -12872,19 +12921,11 @@ altivec_init_builtins (void)
size_t i;
tree ftype;
- tree pfloat_type_node = build_pointer_type (float_type_node);
- tree pint_type_node = build_pointer_type (integer_type_node);
- tree pshort_type_node = build_pointer_type (short_integer_type_node);
- tree pchar_type_node = build_pointer_type (char_type_node);
-
tree pvoid_type_node = build_pointer_type (void_type_node);
- tree pcfloat_type_node = build_pointer_type (build_qualified_type (float_type_node, TYPE_QUAL_CONST));
- tree pcint_type_node = build_pointer_type (build_qualified_type (integer_type_node, TYPE_QUAL_CONST));
- tree pcshort_type_node = build_pointer_type (build_qualified_type (short_integer_type_node, TYPE_QUAL_CONST));
- tree pcchar_type_node = build_pointer_type (build_qualified_type (char_type_node, TYPE_QUAL_CONST));
-
- tree pcvoid_type_node = build_pointer_type (build_qualified_type (void_type_node, TYPE_QUAL_CONST));
+ tree pcvoid_type_node
+ = build_pointer_type (build_qualified_type (void_type_node,
+ TYPE_QUAL_CONST));
tree int_ftype_opaque
= build_function_type_list (integer_type_node,
@@ -12907,26 +12948,6 @@ altivec_init_builtins (void)
= build_function_type_list (integer_type_node,
integer_type_node, V4SI_type_node,
V4SI_type_node, NULL_TREE);
- tree v4sf_ftype_pcfloat
- = build_function_type_list (V4SF_type_node, pcfloat_type_node, NULL_TREE);
- tree void_ftype_pfloat_v4sf
- = build_function_type_list (void_type_node,
- pfloat_type_node, V4SF_type_node, NULL_TREE);
- tree v4si_ftype_pcint
- = build_function_type_list (V4SI_type_node, pcint_type_node, NULL_TREE);
- tree void_ftype_pint_v4si
- = build_function_type_list (void_type_node,
- pint_type_node, V4SI_type_node, NULL_TREE);
- tree v8hi_ftype_pcshort
- = build_function_type_list (V8HI_type_node, pcshort_type_node, NULL_TREE);
- tree void_ftype_pshort_v8hi
- = build_function_type_list (void_type_node,
- pshort_type_node, V8HI_type_node, NULL_TREE);
- tree v16qi_ftype_pcchar
- = build_function_type_list (V16QI_type_node, pcchar_type_node, NULL_TREE);
- tree void_ftype_pchar_v16qi
- = build_function_type_list (void_type_node,
- pchar_type_node, V16QI_type_node, NULL_TREE);
tree void_ftype_v4si
= build_function_type_list (void_type_node, V4SI_type_node, NULL_TREE);
tree v8hi_ftype_void
@@ -12938,16 +12959,32 @@ altivec_init_builtins (void)
tree opaque_ftype_long_pcvoid
= build_function_type_list (opaque_V4SI_type_node,
- long_integer_type_node, pcvoid_type_node, NULL_TREE);
+ long_integer_type_node, pcvoid_type_node,
+ NULL_TREE);
tree v16qi_ftype_long_pcvoid
= build_function_type_list (V16QI_type_node,
- long_integer_type_node, pcvoid_type_node, NULL_TREE);
+ long_integer_type_node, pcvoid_type_node,
+ NULL_TREE);
tree v8hi_ftype_long_pcvoid
= build_function_type_list (V8HI_type_node,
- long_integer_type_node, pcvoid_type_node, NULL_TREE);
+ long_integer_type_node, pcvoid_type_node,
+ NULL_TREE);
tree v4si_ftype_long_pcvoid
= build_function_type_list (V4SI_type_node,
- long_integer_type_node, pcvoid_type_node, NULL_TREE);
+ long_integer_type_node, pcvoid_type_node,
+ NULL_TREE);
+ tree v4sf_ftype_long_pcvoid
+ = build_function_type_list (V4SF_type_node,
+ long_integer_type_node, pcvoid_type_node,
+ NULL_TREE);
+ tree v2df_ftype_long_pcvoid
+ = build_function_type_list (V2DF_type_node,
+ long_integer_type_node, pcvoid_type_node,
+ NULL_TREE);
+ tree v2di_ftype_long_pcvoid
+ = build_function_type_list (V2DI_type_node,
+ long_integer_type_node, pcvoid_type_node,
+ NULL_TREE);
tree void_ftype_opaque_long_pvoid
= build_function_type_list (void_type_node,
@@ -12965,6 +13002,18 @@ altivec_init_builtins (void)
= build_function_type_list (void_type_node,
V8HI_type_node, long_integer_type_node,
pvoid_type_node, NULL_TREE);
+ tree void_ftype_v4sf_long_pvoid
+ = build_function_type_list (void_type_node,
+ V4SF_type_node, long_integer_type_node,
+ pvoid_type_node, NULL_TREE);
+ tree void_ftype_v2df_long_pvoid
+ = build_function_type_list (void_type_node,
+ V2DF_type_node, long_integer_type_node,
+ pvoid_type_node, NULL_TREE);
+ tree void_ftype_v2di_long_pvoid
+ = build_function_type_list (void_type_node,
+ V2DI_type_node, long_integer_type_node,
+ pvoid_type_node, NULL_TREE);
tree int_ftype_int_v8hi_v8hi
= build_function_type_list (integer_type_node,
integer_type_node, V8HI_type_node,
@@ -12996,22 +13045,6 @@ altivec_init_builtins (void)
pcvoid_type_node, integer_type_node,
integer_type_node, NULL_TREE);
- def_builtin (MASK_ALTIVEC, "__builtin_altivec_ld_internal_4sf", v4sf_ftype_pcfloat,
- ALTIVEC_BUILTIN_LD_INTERNAL_4sf);
- def_builtin (MASK_ALTIVEC, "__builtin_altivec_st_internal_4sf", void_ftype_pfloat_v4sf,
- ALTIVEC_BUILTIN_ST_INTERNAL_4sf);
- def_builtin (MASK_ALTIVEC, "__builtin_altivec_ld_internal_4si", v4si_ftype_pcint,
- ALTIVEC_BUILTIN_LD_INTERNAL_4si);
- def_builtin (MASK_ALTIVEC, "__builtin_altivec_st_internal_4si", void_ftype_pint_v4si,
- ALTIVEC_BUILTIN_ST_INTERNAL_4si);
- def_builtin (MASK_ALTIVEC, "__builtin_altivec_ld_internal_8hi", v8hi_ftype_pcshort,
- ALTIVEC_BUILTIN_LD_INTERNAL_8hi);
- def_builtin (MASK_ALTIVEC, "__builtin_altivec_st_internal_8hi", void_ftype_pshort_v8hi,
- ALTIVEC_BUILTIN_ST_INTERNAL_8hi);
- def_builtin (MASK_ALTIVEC, "__builtin_altivec_ld_internal_16qi", v16qi_ftype_pcchar,
- ALTIVEC_BUILTIN_LD_INTERNAL_16qi);
- def_builtin (MASK_ALTIVEC, "__builtin_altivec_st_internal_16qi", void_ftype_pchar_v16qi,
- ALTIVEC_BUILTIN_ST_INTERNAL_16qi);
def_builtin (MASK_ALTIVEC, "__builtin_altivec_mtvscr", void_ftype_v4si, ALTIVEC_BUILTIN_MTVSCR);
def_builtin (MASK_ALTIVEC, "__builtin_altivec_mfvscr", v8hi_ftype_void, ALTIVEC_BUILTIN_MFVSCR);
def_builtin (MASK_ALTIVEC, "__builtin_altivec_dssall", void_ftype_void, ALTIVEC_BUILTIN_DSSALL);
@@ -13043,6 +13076,35 @@ altivec_init_builtins (void)
def_builtin (MASK_ALTIVEC, "__builtin_vec_stvebx", void_ftype_opaque_long_pvoid, ALTIVEC_BUILTIN_VEC_STVEBX);
def_builtin (MASK_ALTIVEC, "__builtin_vec_stvehx", void_ftype_opaque_long_pvoid, ALTIVEC_BUILTIN_VEC_STVEHX);
+ def_builtin (MASK_VSX, "__builtin_vsx_lxvd2x_v2df", v2df_ftype_long_pcvoid,
+ VSX_BUILTIN_LXVD2X_V2DF);
+ def_builtin (MASK_VSX, "__builtin_vsx_lxvd2x_v2di", v2di_ftype_long_pcvoid,
+ VSX_BUILTIN_LXVD2X_V2DI);
+ def_builtin (MASK_VSX, "__builtin_vsx_lxvw4x_v4sf", v4sf_ftype_long_pcvoid,
+ VSX_BUILTIN_LXVW4X_V4SF);
+ def_builtin (MASK_VSX, "__builtin_vsx_lxvw4x_v4si", v4si_ftype_long_pcvoid,
+ VSX_BUILTIN_LXVW4X_V4SI);
+ def_builtin (MASK_VSX, "__builtin_vsx_lxvw4x_v8hi",
+ v8hi_ftype_long_pcvoid, VSX_BUILTIN_LXVW4X_V8HI);
+ def_builtin (MASK_VSX, "__builtin_vsx_lxvw4x_v16qi",
+ v16qi_ftype_long_pcvoid, VSX_BUILTIN_LXVW4X_V16QI);
+ def_builtin (MASK_VSX, "__builtin_vsx_stxvd2x_v2df",
+ void_ftype_v2df_long_pvoid, VSX_BUILTIN_STXVD2X_V2DF);
+ def_builtin (MASK_VSX, "__builtin_vsx_stxvd2x_v2di",
+ void_ftype_v2di_long_pvoid, VSX_BUILTIN_STXVD2X_V2DI);
+ def_builtin (MASK_VSX, "__builtin_vsx_stxvw4x_v4sf",
+ void_ftype_v4sf_long_pvoid, VSX_BUILTIN_STXVW4X_V4SF);
+ def_builtin (MASK_VSX, "__builtin_vsx_stxvw4x_v4si",
+ void_ftype_v4si_long_pvoid, VSX_BUILTIN_STXVW4X_V4SI);
+ def_builtin (MASK_VSX, "__builtin_vsx_stxvw4x_v8hi",
+ void_ftype_v8hi_long_pvoid, VSX_BUILTIN_STXVW4X_V8HI);
+ def_builtin (MASK_VSX, "__builtin_vsx_stxvw4x_v16qi",
+ void_ftype_v16qi_long_pvoid, VSX_BUILTIN_STXVW4X_V16QI);
+ def_builtin (MASK_VSX, "__builtin_vec_vsx_ld", opaque_ftype_long_pcvoid,
+ VSX_BUILTIN_VEC_LD);
+ def_builtin (MASK_VSX, "__builtin_vec_vsx_st", void_ftype_opaque_long_pvoid,
+ VSX_BUILTIN_VEC_ST);
+
if (rs6000_cpu == PROCESSOR_CELL)
{
def_builtin (MASK_ALTIVEC, "__builtin_altivec_lvlx", v16qi_ftype_long_pcvoid, ALTIVEC_BUILTIN_LVLX);
@@ -16182,7 +16244,18 @@ print_operand (FILE *file, rtx x, int code)
output_address (XEXP (x, 0));
}
else
- output_addr_const (file, x);
+ {
+ if (toc_relative_expr_p (x))
+ /* This hack along with a corresponding hack in
+ rs6000_output_addr_const_extra arranges to output addends
+ where the assembler expects to find them. eg.
+ (const (plus (unspec [symbol_ref ("x") tocrel]) 4))
+ without this hack would be output as "x@toc+4". We
+ want "x+4@toc". */
+ output_addr_const (file, tocrel_base);
+ else
+ output_addr_const (file, x);
+ }
return;
case '&':
@@ -27914,4 +27987,29 @@ rs6000_address_for_fpconvert (rtx x)
return x;
}
+/* Given a memory reference, if it is not in the form for altivec memory
+ reference instructions (i.e. reg or reg+reg addressing with AND of -16),
+ convert to the altivec format. */
+
+rtx
+rs6000_address_for_altivec (rtx x)
+{
+ gcc_assert (MEM_P (x));
+ if (!altivec_indexed_or_indirect_operand (x, GET_MODE (x)))
+ {
+ rtx addr = XEXP (x, 0);
+ int strict_p = (reload_in_progress || reload_completed);
+
+ if (!legitimate_indexed_address_p (addr, strict_p)
+ && !legitimate_indirect_address_p (addr, strict_p))
+ addr = copy_to_mode_reg (Pmode, addr);
+
+ addr = gen_rtx_AND (Pmode, addr, GEN_INT (-16));
+ x = change_address (x, GET_MODE (x), addr);
+ }
+
+ return x;
+}
+
+
#include "gt-rs6000.h"
diff --git a/gcc/config/rs6000/rs6000.h b/gcc/config/rs6000/rs6000.h
index fb6130ffcdb..8c76d7ce101 100644
--- a/gcc/config/rs6000/rs6000.h
+++ b/gcc/config/rs6000/rs6000.h
@@ -1,7 +1,7 @@
/* Definitions of target machine for GNU compiler, for IBM RS/6000.
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
- 2010
+ 2010, 2011
Free Software Foundation, Inc.
Contributed by Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
@@ -2368,6 +2368,8 @@ enum rs6000_builtin_type_index
RS6000_BTI_pixel_V8HI, /* __vector __pixel */
RS6000_BTI_long, /* long_integer_type_node */
RS6000_BTI_unsigned_long, /* long_unsigned_type_node */
+ RS6000_BTI_long_long, /* long_long_integer_type_node */
+ RS6000_BTI_unsigned_long_long, /* long_long_unsigned_type_node */
RS6000_BTI_INTQI, /* intQI_type_node */
RS6000_BTI_UINTQI, /* unsigned_intQI_type_node */
RS6000_BTI_INTHI, /* intHI_type_node */
@@ -2411,6 +2413,8 @@ enum rs6000_builtin_type_index
#define bool_V2DI_type_node (rs6000_builtin_types[RS6000_BTI_bool_V2DI])
#define pixel_V8HI_type_node (rs6000_builtin_types[RS6000_BTI_pixel_V8HI])
+#define long_long_integer_type_internal_node (rs6000_builtin_types[RS6000_BTI_long_long])
+#define long_long_unsigned_type_internal_node (rs6000_builtin_types[RS6000_BTI_unsigned_long_long])
#define long_integer_type_internal_node (rs6000_builtin_types[RS6000_BTI_long])
#define long_unsigned_type_internal_node (rs6000_builtin_types[RS6000_BTI_unsigned_long])
#define intQI_type_internal_node (rs6000_builtin_types[RS6000_BTI_INTQI])
diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md
index 6d2f515fcf8..38a5a50b8e5 100644
--- a/gcc/config/rs6000/rs6000.md
+++ b/gcc/config/rs6000/rs6000.md
@@ -5638,7 +5638,7 @@
(define_expand "rsqrt<mode>2"
[(match_operand:RECIPF 0 "gpc_reg_operand" "")
(match_operand:RECIPF 1 "gpc_reg_operand" "")]
- "RS6000_RECIP_HAVE_RSQRT_P (<MODE>mode)"
+ "RS6000_RECIP_HAVE_RSQRTE_P (<MODE>mode)"
{
rs6000_emit_swrsqrt (operands[0], operands[1]);
DONE;
diff --git a/gcc/config/rs6000/sysv4.h b/gcc/config/rs6000/sysv4.h
index 9bb37a45d91..113ddd02bd7 100644
--- a/gcc/config/rs6000/sysv4.h
+++ b/gcc/config/rs6000/sysv4.h
@@ -619,8 +619,7 @@ extern int fixuplabelno;
#undef LINK_SPEC
#define LINK_SPEC "\
%{h*} %{v:-V} %{!msdata=none:%{G*}} %{msdata=none:-G0} \
-%{YP,*} %{R*} \
-%{Qy:} %{!Qn:-Qy} \
+%{R*} \
%(link_shlib) \
%{!T*: %(link_start) } \
%(link_target) \
@@ -873,7 +872,7 @@ extern int fixuplabelno;
/* NetBSD support. */
#define LIB_NETBSD_SPEC "\
-%{profile:-lgmon -lc_p} %{!profile:-lc}"
+-lc"
#define STARTFILE_NETBSD_SPEC "\
ncrti.o%s crt0.o%s \
diff --git a/gcc/config/rs6000/vector.md b/gcc/config/rs6000/vector.md
index 71961fbc57c..5335d9d4301 100644
--- a/gcc/config/rs6000/vector.md
+++ b/gcc/config/rs6000/vector.md
@@ -3,7 +3,7 @@
;; expander, and the actual vector instructions will be in altivec.md and
;; vsx.md
-;; Copyright (C) 2009, 2010
+;; Copyright (C) 2009, 2010, 2011
;; Free Software Foundation, Inc.
;; Contributed by Michael Meissner <meissner@linux.vnet.ibm.com>
@@ -123,6 +123,43 @@
DONE;
})
+;; Vector floating point load/store instructions that uses the Altivec
+;; instructions even if we are compiling for VSX, since the Altivec
+;; instructions silently ignore the bottom 3 bits of the address, and VSX does
+;; not.
+(define_expand "vector_altivec_load_<mode>"
+ [(set (match_operand:VEC_M 0 "vfloat_operand" "")
+ (match_operand:VEC_M 1 "memory_operand" ""))]
+ "VECTOR_MEM_ALTIVEC_OR_VSX_P (<MODE>mode)"
+ "
+{
+ gcc_assert (VECTOR_MEM_ALTIVEC_OR_VSX_P (<MODE>mode));
+
+ if (VECTOR_MEM_VSX_P (<MODE>mode))
+ {
+ operands[1] = rs6000_address_for_altivec (operands[1]);
+ emit_insn (gen_altivec_lvx_<mode> (operands[0], operands[1]));
+ DONE;
+ }
+}")
+
+(define_expand "vector_altivec_store_<mode>"
+ [(set (match_operand:VEC_M 0 "memory_operand" "")
+ (match_operand:VEC_M 1 "vfloat_operand" ""))]
+ "VECTOR_MEM_ALTIVEC_OR_VSX_P (<MODE>mode)"
+ "
+{
+ gcc_assert (VECTOR_MEM_ALTIVEC_OR_VSX_P (<MODE>mode));
+
+ if (VECTOR_MEM_VSX_P (<MODE>mode))
+ {
+ operands[0] = rs6000_address_for_altivec (operands[0]);
+ emit_insn (gen_altivec_stvx_<mode> (operands[0], operands[1]));
+ DONE;
+ }
+}")
+
+
;; Reload patterns for vector operations. We may need an addtional base
;; register to convert the reg+offset addressing to reg+reg for vector
diff --git a/gcc/config/rs6000/vsx.md b/gcc/config/rs6000/vsx.md
index e241e26db89..3f6da4c0b40 100644
--- a/gcc/config/rs6000/vsx.md
+++ b/gcc/config/rs6000/vsx.md
@@ -1,5 +1,5 @@
;; VSX patterns.
-;; Copyright (C) 2009, 2010
+;; Copyright (C) 2009, 2010, 2011
;; Free Software Foundation, Inc.
;; Contributed by Michael Meissner <meissner@linux.vnet.ibm.com>
@@ -308,6 +308,19 @@
}
[(set_attr "type" "vecstore,vecload,vecsimple,*,*,*,vecsimple,*,vecstore,vecload")])
+;; Explicit load/store expanders for the builtin functions
+(define_expand "vsx_load_<mode>"
+ [(set (match_operand:VSX_M 0 "vsx_register_operand" "")
+ (match_operand:VSX_M 1 "memory_operand" ""))]
+ "VECTOR_MEM_VSX_P (<MODE>mode)"
+ "")
+
+(define_expand "vsx_store_<mode>"
+ [(set (match_operand:VEC_M 0 "memory_operand" "")
+ (match_operand:VEC_M 1 "vsx_register_operand" ""))]
+ "VECTOR_MEM_VSX_P (<MODE>mode)"
+ "")
+
;; VSX scalar and vector floating point arithmetic instructions
(define_insn "*vsx_add<mode>3"
@@ -695,33 +708,34 @@
;; the fprs because we don't want to add the altivec registers to movdi/movsi.
;; For the unsigned tests, there isn't a generic double -> unsigned conversion
;; in rs6000.md so don't test VECTOR_UNIT_VSX_P, just test against VSX.
+;; Don't use vsx_register_operand here, use gpc_reg_operand to match rs6000.md.
(define_insn "vsx_float<VSi><mode>2"
- [(set (match_operand:VSX_B 0 "vsx_register_operand" "=<VSr>,?wa")
- (float:VSX_B (match_operand:<VSI> 1 "vsx_register_operand" "<VSr2>,<VSr3>")))]
+ [(set (match_operand:VSX_B 0 "gpc_reg_operand" "=<VSr>,?wa")
+ (float:VSX_B (match_operand:<VSI> 1 "gpc_reg_operand" "<VSr2>,<VSr3>")))]
"VECTOR_UNIT_VSX_P (<MODE>mode)"
"x<VSv>cvsx<VSc><VSs> %x0,%x1"
[(set_attr "type" "<VStype_simple>")
(set_attr "fp_type" "<VSfptype_simple>")])
(define_insn "vsx_floatuns<VSi><mode>2"
- [(set (match_operand:VSX_B 0 "vsx_register_operand" "=<VSr>,?wa")
- (unsigned_float:VSX_B (match_operand:<VSI> 1 "vsx_register_operand" "<VSr2>,<VSr3>")))]
+ [(set (match_operand:VSX_B 0 "gpc_reg_operand" "=<VSr>,?wa")
+ (unsigned_float:VSX_B (match_operand:<VSI> 1 "gpc_reg_operand" "<VSr2>,<VSr3>")))]
"VECTOR_UNIT_VSX_P (<MODE>mode)"
"x<VSv>cvux<VSc><VSs> %x0,%x1"
[(set_attr "type" "<VStype_simple>")
(set_attr "fp_type" "<VSfptype_simple>")])
(define_insn "vsx_fix_trunc<mode><VSi>2"
- [(set (match_operand:<VSI> 0 "vsx_register_operand" "=<VSr2>,?<VSr3>")
- (fix:<VSI> (match_operand:VSX_B 1 "vsx_register_operand" "<VSr>,wa")))]
+ [(set (match_operand:<VSI> 0 "gpc_reg_operand" "=<VSr2>,?<VSr3>")
+ (fix:<VSI> (match_operand:VSX_B 1 "gpc_reg_operand" "<VSr>,wa")))]
"VECTOR_UNIT_VSX_P (<MODE>mode)"
"x<VSv>cv<VSs>sx<VSc>s %x0,%x1"
[(set_attr "type" "<VStype_simple>")
(set_attr "fp_type" "<VSfptype_simple>")])
(define_insn "vsx_fixuns_trunc<mode><VSi>2"
- [(set (match_operand:<VSI> 0 "vsx_register_operand" "=<VSr2>,?<VSr3>")
- (unsigned_fix:<VSI> (match_operand:VSX_B 1 "vsx_register_operand" "<VSr>,wa")))]
+ [(set (match_operand:<VSI> 0 "gpc_reg_operand" "=<VSr2>,?<VSr3>")
+ (unsigned_fix:<VSI> (match_operand:VSX_B 1 "gpc_reg_operand" "<VSr>,wa")))]
"VECTOR_UNIT_VSX_P (<MODE>mode)"
"x<VSv>cv<VSs>ux<VSc>s %x0,%x1"
[(set_attr "type" "<VStype_simple>")
diff --git a/gcc/config/rs6000/vxworks.h b/gcc/config/rs6000/vxworks.h
index bb9bf223c34..95aedf70608 100644
--- a/gcc/config/rs6000/vxworks.h
+++ b/gcc/config/rs6000/vxworks.h
@@ -80,13 +80,11 @@ VXWORKS_ADDITIONAL_CPP_SPEC
#define CC1_SPEC \
"%{G*} %{mno-sdata:-msdata=none} %{msdata:-msdata=default} \
- %{mlittle|mlittle-endian:-mstrict-align} \
- %{profile: -p}"
+ %{mlittle|mlittle-endian:-mstrict-align}"
#define ASM_SPEC \
"%(asm_cpu) \
%{,assembler|,assembler-with-cpp: %{mregnames} %{mno-regnames}} \
- %{Qy:} %{!Qn:-Qy} %{Ym,*} %{Yd,*} \
%{mrelocatable} %{mrelocatable-lib} %{fpic:-K PIC} %{fPIC:-K PIC} -mbig"
#undef LIB_SPEC
diff --git a/gcc/config/rs6000/xilinx.opt b/gcc/config/rs6000/xilinx.opt
new file mode 100644
index 00000000000..da6c0c066c8
--- /dev/null
+++ b/gcc/config/rs6000/xilinx.opt
@@ -0,0 +1,33 @@
+; Xilinx embedded PowerPC options.
+
+; Copyright (C) 2011
+; Free Software Foundation, Inc.
+;
+; This file is part of GCC.
+;
+; GCC is free software; you can redistribute it and/or modify it under
+; the terms of the GNU General Public License as published by the Free
+; Software Foundation; either version 3, or (at your option) any later
+; version.
+;
+; GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+; WARRANTY; without even the implied warranty of MERCHANTABILITY or
+; FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+; for more details.
+;
+; You should have received a copy of the GNU General Public License
+; along with GCC; see the file COPYING3. If not see
+; <http://www.gnu.org/licenses/>.
+
+; See the GCC internals manual (options.texi) for a description of
+; this file's format.
+
+; Please try to keep this file in ASCII collating order.
+
+mno-clearbss
+Target RejectNegative
+
+mppcperflib
+Target RejectNegative
+
+; This comment is to ensure we retain the blank line above.
diff --git a/gcc/config/rx/predicates.md b/gcc/config/rx/predicates.md
index 608fca5f925..77b3353ac3e 100644
--- a/gcc/config/rx/predicates.md
+++ b/gcc/config/rx/predicates.md
@@ -287,9 +287,9 @@
(match_code "eq,ne,lt,ge")
)
-;; GT, LE, UNLE, UNGT omitted due to operand swap required.
+;; GT and LE omitted due to operand swap required.
(define_predicate "rx_fp_comparison_operator"
- (match_code "eq,ne,lt,ge,ordered,unordered,uneq,unlt,unge,ltgt")
+ (match_code "eq,ne,lt,ge,ordered,unordered")
)
(define_predicate "rshift_operator"
diff --git a/gcc/config/rx/rx-protos.h b/gcc/config/rx/rx-protos.h
index 3c3f2d47124..a6ae416e6dc 100644
--- a/gcc/config/rx/rx-protos.h
+++ b/gcc/config/rx/rx-protos.h
@@ -1,5 +1,5 @@
/* Exported function prototypes from the Renesas RX backend.
- Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
Contributed by Red Hat.
This file is part of GCC.
@@ -35,11 +35,9 @@ extern void rx_emit_stack_pushm (rtx *);
extern void rx_expand_epilogue (bool);
extern char * rx_gen_move_template (rtx *, bool);
extern bool rx_is_legitimate_constant (rtx);
-extern bool rx_is_mode_dependent_addr (rtx);
extern bool rx_is_restricted_memory_address (rtx, Mmode);
extern void rx_notice_update_cc (rtx body, rtx insn);
extern void rx_split_cbranch (Mmode, Rcode, rtx, rtx, rtx);
-extern bool rx_split_fp_compare (Rcode, Rcode *, Rcode *);
extern Mmode rx_select_cc_mode (Rcode, rtx, rtx);
extern bool rx_match_ccmode (rtx, Mmode);
#endif
diff --git a/gcc/config/rx/rx.c b/gcc/config/rx/rx.c
index 0179b1ff520..6b179e7b9a3 100644
--- a/gcc/config/rx/rx.c
+++ b/gcc/config/rx/rx.c
@@ -1,5 +1,5 @@
/* Subroutines used for code generation on Renesas RX processors.
- Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
Contributed by Red Hat.
This file is part of GCC.
@@ -199,8 +199,10 @@ rx_is_restricted_memory_address (rtx mem, enum machine_mode mode)
}
}
-bool
-rx_is_mode_dependent_addr (rtx addr)
+/* Implement TARGET_MODE_DEPENDENT_ADDRESS_P. */
+
+static bool
+rx_mode_dependent_address_p (const_rtx addr)
{
if (GET_CODE (addr) == CONST)
addr = XEXP (addr, 0);
@@ -323,10 +325,20 @@ rx_print_operand_address (FILE * file, rtx addr)
break;
}
+ case CONST:
+ if (GET_CODE (XEXP (addr, 0)) == UNSPEC)
+ {
+ addr = XEXP (addr, 0);
+ gcc_assert (XINT (addr, 1) == UNSPEC_CONST);
+
+ addr = XVECEXP (addr, 0, 0);
+ gcc_assert (CONST_INT_P (addr));
+ }
+ /* Fall through. */
case LABEL_REF:
case SYMBOL_REF:
- case CONST:
fprintf (file, "#");
+
default:
output_addr_const (file, addr);
break;
@@ -437,13 +449,14 @@ rx_print_operand (FILE * file, rtx op, int letter)
}
else
{
+ unsigned int flags = flags_from_mode (mode);
switch (code)
{
case LT:
- ret = "n";
+ ret = (flags & CC_FLAG_O ? "lt" : "n");
break;
case GE:
- ret = "pz";
+ ret = (flags & CC_FLAG_O ? "ge" : "pz");
break;
case GT:
ret = "gt";
@@ -472,8 +485,7 @@ rx_print_operand (FILE * file, rtx op, int letter)
default:
gcc_unreachable ();
}
- gcc_checking_assert ((flags_from_code (code)
- & ~flags_from_mode (mode)) == 0);
+ gcc_checking_assert ((flags_from_code (code) & ~flags) == 0);
}
fputs (ret, file);
break;
@@ -864,7 +876,10 @@ rx_function_value (const_tree ret_type,
/* RX ABI specifies that small integer types are
promoted to int when returned by a function. */
- if (GET_MODE_SIZE (mode) > 0 && GET_MODE_SIZE (mode) < 4)
+ if (GET_MODE_SIZE (mode) > 0
+ && GET_MODE_SIZE (mode) < 4
+ && ! COMPLEX_MODE_P (mode)
+ )
return gen_rtx_REG (SImode, FUNC_RETURN_REGNUM);
return gen_rtx_REG (mode, FUNC_RETURN_REGNUM);
@@ -882,6 +897,7 @@ rx_promote_function_mode (const_tree type ATTRIBUTE_UNUSED,
{
if (for_return != 1
|| GET_MODE_SIZE (mode) >= 4
+ || COMPLEX_MODE_P (mode)
|| GET_MODE_SIZE (mode) < 1)
return mode;
@@ -1123,10 +1139,12 @@ rx_get_stack_layout (unsigned int * lowest,
for (save_mask = high = low = 0, reg = 1; reg < CC_REGNUM; reg++)
{
if ((df_regs_ever_live_p (reg)
- /* Always save all call clobbered registers inside interrupt
- handlers, even if they are not live - they may be used in
- routines called from this one. */
- || (call_used_regs[reg] && is_interrupt_func (NULL_TREE)))
+ /* Always save all call clobbered registers inside non-leaf
+ interrupt handlers, even if they are not live - they may
+ be used in (non-interrupt aware) routines called from this one. */
+ || (call_used_regs[reg]
+ && is_interrupt_func (NULL_TREE)
+ && ! current_function_is_leaf))
&& (! call_used_regs[reg]
/* Even call clobbered registered must
be pushed inside interrupt handlers. */
@@ -1281,6 +1299,59 @@ mark_frame_related (rtx insn)
}
}
+static bool
+ok_for_max_constant (HOST_WIDE_INT val)
+{
+ if (rx_max_constant_size == 0 || rx_max_constant_size == 4)
+ /* If there is no constraint on the size of constants
+ used as operands, then any value is legitimate. */
+ return true;
+
+ /* rx_max_constant_size specifies the maximum number
+ of bytes that can be used to hold a signed value. */
+ return IN_RANGE (val, (-1 << (rx_max_constant_size * 8)),
+ ( 1 << (rx_max_constant_size * 8)));
+}
+
+/* Generate an ADD of SRC plus VAL into DEST.
+ Handles the case where VAL is too big for max_constant_value.
+ Sets FRAME_RELATED_P on the insn if IS_FRAME_RELATED is true. */
+
+static void
+gen_safe_add (rtx dest, rtx src, rtx val, bool is_frame_related)
+{
+ rtx insn;
+
+ if (val == NULL_RTX || INTVAL (val) == 0)
+ {
+ gcc_assert (dest != src);
+
+ insn = emit_move_insn (dest, src);
+ }
+ else if (ok_for_max_constant (INTVAL (val)))
+ insn = emit_insn (gen_addsi3 (dest, src, val));
+ else
+ {
+ /* Wrap VAL in an UNSPEC so that rx_is_legitimate_constant
+ will not reject it. */
+ val = gen_rtx_CONST (SImode, gen_rtx_UNSPEC (SImode, gen_rtvec (1, val), UNSPEC_CONST));
+ insn = emit_insn (gen_addsi3 (dest, src, val));
+
+ if (is_frame_related)
+ /* We have to provide our own frame related note here
+ as the dwarf2out code cannot be expected to grok
+ our unspec. */
+ add_reg_note (insn, REG_FRAME_RELATED_EXPR,
+ gen_rtx_SET (SImode, dest,
+ gen_rtx_PLUS (SImode, src, val)));
+ return;
+ }
+
+ if (is_frame_related)
+ RTX_FRAME_RELATED_P (insn) = 1;
+ return;
+}
+
void
rx_expand_prologue (void)
{
@@ -1370,17 +1441,8 @@ rx_expand_prologue (void)
/* If needed, set up the frame pointer. */
if (frame_pointer_needed)
- {
- if (frame_size)
- insn = emit_insn (gen_addsi3 (frame_pointer_rtx, stack_pointer_rtx,
- GEN_INT (- (HOST_WIDE_INT) frame_size)));
- else
- insn = emit_move_insn (frame_pointer_rtx, stack_pointer_rtx);
-
- RTX_FRAME_RELATED_P (insn) = 1;
- }
-
- insn = NULL_RTX;
+ gen_safe_add (frame_pointer_rtx, stack_pointer_rtx,
+ GEN_INT (- (HOST_WIDE_INT) frame_size), true);
/* Allocate space for the outgoing args.
If the stack frame has not already been set up then handle this as well. */
@@ -1389,29 +1451,26 @@ rx_expand_prologue (void)
if (frame_size)
{
if (frame_pointer_needed)
- insn = emit_insn (gen_addsi3 (stack_pointer_rtx, frame_pointer_rtx,
- GEN_INT (- (HOST_WIDE_INT)
- stack_size)));
+ gen_safe_add (stack_pointer_rtx, frame_pointer_rtx,
+ GEN_INT (- (HOST_WIDE_INT) stack_size), true);
else
- insn = emit_insn (gen_addsi3 (stack_pointer_rtx, stack_pointer_rtx,
- GEN_INT (- (HOST_WIDE_INT)
- (frame_size + stack_size))));
+ gen_safe_add (stack_pointer_rtx, stack_pointer_rtx,
+ GEN_INT (- (HOST_WIDE_INT) (frame_size + stack_size)),
+ true);
}
else
- insn = emit_insn (gen_addsi3 (stack_pointer_rtx, stack_pointer_rtx,
- GEN_INT (- (HOST_WIDE_INT) stack_size)));
+ gen_safe_add (stack_pointer_rtx, stack_pointer_rtx,
+ GEN_INT (- (HOST_WIDE_INT) stack_size), true);
}
else if (frame_size)
{
if (! frame_pointer_needed)
- insn = emit_insn (gen_addsi3 (stack_pointer_rtx, stack_pointer_rtx,
- GEN_INT (- (HOST_WIDE_INT) frame_size)));
+ gen_safe_add (stack_pointer_rtx, stack_pointer_rtx,
+ GEN_INT (- (HOST_WIDE_INT) frame_size), true);
else
- insn = emit_move_insn (stack_pointer_rtx, frame_pointer_rtx);
+ gen_safe_add (stack_pointer_rtx, frame_pointer_rtx, NULL_RTX,
+ true);
}
-
- if (insn != NULL_RTX)
- RTX_FRAME_RELATED_P (insn) = 1;
}
static void
@@ -1589,8 +1648,8 @@ rx_expand_epilogue (bool is_sibcall)
{
/* Cannot use the special instructions - deconstruct by hand. */
if (total_size)
- emit_insn (gen_addsi3 (stack_pointer_rtx, stack_pointer_rtx,
- GEN_INT (total_size)));
+ gen_safe_add (stack_pointer_rtx, stack_pointer_rtx,
+ GEN_INT (total_size), false);
if (MUST_SAVE_ACC_REGISTER)
{
@@ -1682,8 +1741,8 @@ rx_expand_epilogue (bool is_sibcall)
return;
}
- emit_insn (gen_addsi3 (stack_pointer_rtx, stack_pointer_rtx,
- GEN_INT (total_size)));
+ gen_safe_add (stack_pointer_rtx, stack_pointer_rtx,
+ GEN_INT (total_size), false);
}
if (low)
@@ -2342,8 +2401,6 @@ rx_is_ms_bitfield_layout (const_tree record_type ATTRIBUTE_UNUSED)
bool
rx_is_legitimate_constant (rtx x)
{
- HOST_WIDE_INT val;
-
switch (GET_CODE (x))
{
case CONST:
@@ -2366,7 +2423,9 @@ rx_is_legitimate_constant (rtx x)
case SYMBOL_REF:
return true;
- /* One day we may have to handle UNSPEC constants here. */
+ case UNSPEC:
+ return XINT (x, 1) == UNSPEC_CONST;
+
default:
/* FIXME: Can this ever happen ? */
abort ();
@@ -2386,17 +2445,7 @@ rx_is_legitimate_constant (rtx x)
break;
}
- if (rx_max_constant_size == 0 || rx_max_constant_size == 4)
- /* If there is no constraint on the size of constants
- used as operands, then any value is legitimate. */
- return true;
-
- val = INTVAL (x);
-
- /* rx_max_constant_size specifies the maximum number
- of bytes that can be used to hold a signed value. */
- return IN_RANGE (val, (-1 << (rx_max_constant_size * 8)),
- ( 1 << (rx_max_constant_size * 8)));
+ return ok_for_max_constant (INTVAL (x));
}
static int
@@ -2619,74 +2668,15 @@ rx_cc_modes_compatible (enum machine_mode m1, enum machine_mode m2)
/* Return the minimal CC mode needed to implement (CMP_CODE X Y). */
enum machine_mode
-rx_select_cc_mode (enum rtx_code cmp_code, rtx x, rtx y ATTRIBUTE_UNUSED)
+rx_select_cc_mode (enum rtx_code cmp_code, rtx x, rtx y)
{
if (GET_MODE_CLASS (GET_MODE (x)) == MODE_FLOAT)
return CC_Fmode;
- return mode_from_flags (flags_from_code (cmp_code));
-}
-
-/* Split the floating-point comparison IN into individual comparisons
- O1 and O2. O2 may be UNKNOWN if there is no second comparison.
- Return true iff the comparison operands must be swapped. */
-
-bool
-rx_split_fp_compare (enum rtx_code in, enum rtx_code *o1, enum rtx_code *o2)
-{
- enum rtx_code cmp1 = in, cmp2 = UNKNOWN;
- bool swap = false;
-
- switch (in)
- {
- case ORDERED:
- case UNORDERED:
- case LT:
- case GE:
- case EQ:
- case NE:
- break;
-
- case GT:
- case LE:
- cmp1 = swap_condition (cmp1);
- swap = true;
- break;
+ if (y != const0_rtx)
+ return CCmode;
- case UNEQ:
- cmp1 = UNORDERED;
- cmp2 = EQ;
- break;
- case UNLT:
- cmp1 = UNORDERED;
- cmp2 = LT;
- break;
- case UNGE:
- cmp1 = UNORDERED;
- cmp2 = GE;
- break;
- case UNLE:
- cmp1 = UNORDERED;
- cmp2 = GT;
- swap = true;
- break;
- case UNGT:
- cmp1 = UNORDERED;
- cmp2 = LE;
- swap = true;
- break;
- case LTGT:
- cmp1 = ORDERED;
- cmp2 = NE;
- break;
-
- default:
- gcc_unreachable ();
- }
-
- *o1 = cmp1;
- *o2 = cmp2;
- return swap;
+ return mode_from_flags (flags_from_code (cmp_code));
}
/* Split the conditional branch. Emit (COMPARE C1 C2) into CC_REG with
@@ -2786,6 +2776,9 @@ rx_match_ccmode (rtx insn, enum machine_mode cc_mode)
#undef TARGET_LEGITIMATE_ADDRESS_P
#define TARGET_LEGITIMATE_ADDRESS_P rx_is_legitimate_address
+#undef TARGET_MODE_DEPENDENT_ADDRESS_P
+#define TARGET_MODE_DEPENDENT_ADDRESS_P rx_mode_dependent_address_p
+
#undef TARGET_ALLOCATE_STACK_SLOTS_FOR_ARGS
#define TARGET_ALLOCATE_STACK_SLOTS_FOR_ARGS rx_allocate_stack_slots_for_args
@@ -2864,6 +2857,9 @@ rx_match_ccmode (rtx insn, enum machine_mode cc_mode)
#undef TARGET_EXCEPT_UNWIND_INFO
#define TARGET_EXCEPT_UNWIND_INFO sjlj_except_unwind_info
+#undef TARGET_FLAGS_REGNUM
+#define TARGET_FLAGS_REGNUM CC_REG
+
struct gcc_target targetm = TARGET_INITIALIZER;
/* #include "gt-rx.h" */
diff --git a/gcc/config/rx/rx.h b/gcc/config/rx/rx.h
index e2c8641685d..e3966ed173d 100644
--- a/gcc/config/rx/rx.h
+++ b/gcc/config/rx/rx.h
@@ -1,5 +1,5 @@
/* GCC backend definitions for the Renesas RX processor.
- Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
Contributed by Red Hat.
This file is part of GCC.
@@ -85,10 +85,10 @@ extern enum rx_cpu_types rx_cpu_type;
#define LIB_SPEC " \
--start-group \
-lc \
-%{msim*:-lsim}%{!msim*:-lnosys} \
+%{msim:-lsim}%{!msim:-lnosys} \
%{fprofile-arcs|fprofile-generate|coverage:-lgcov} \
--end-group \
-%{!T*: %{msim*:%Trx-sim.ld}%{!msim*:%Trx.ld}} \
+%{!T*: %{msim:%Trx-sim.ld}%{!msim:%Trx.ld}} \
"
#undef LINK_SPEC
@@ -251,6 +251,7 @@ enum reg_class
#define LIBCALL_VALUE(MODE) \
gen_rtx_REG (((GET_MODE_CLASS (MODE) != MODE_INT \
+ || COMPLEX_MODE_P (MODE) \
|| GET_MODE_SIZE (MODE) >= 4) \
? (MODE) \
: SImode), \
@@ -287,14 +288,6 @@ enum reg_class
( (REG_P (X) \
|| (GET_CODE (X) == SUBREG \
&& REG_P (SUBREG_REG (X))))))
-
-#define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR, LABEL) \
- do \
- { \
- if (rx_is_mode_dependent_addr (ADDR)) \
- goto LABEL; \
- } \
- while (0)
#define RETURN_ADDR_RTX(COUNT, FRAMEADDR) \
diff --git a/gcc/config/rx/rx.md b/gcc/config/rx/rx.md
index d8cd66d63de..7629a886e5c 100644
--- a/gcc/config/rx/rx.md
+++ b/gcc/config/rx/rx.md
@@ -1,5 +1,5 @@
;; Machine Description for Renesas RX processors
-;; Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
+;; Copyright (C) 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
;; Contributed by Red Hat.
;; This file is part of GCC.
@@ -29,16 +29,6 @@
(define_mode_iterator register_modes
[(SF "ALLOW_RX_FPU_INSNS") (SI "") (HI "") (QI "")])
-
-;; Used to map RX condition names to GCC
-;; condition names for builtin instructions.
-(define_code_iterator gcc_conds [eq ne gt ge lt le gtu geu ltu leu
- unge unlt uneq ltgt])
-(define_code_attr rx_conds [(eq "eq") (ne "ne") (gt "gt") (ge "ge") (lt "lt")
- (le "le") (gtu "gtu") (geu "geu") (ltu "ltu")
- (leu "leu") (unge "pz") (unlt "n") (uneq "o")
- (ltgt "no")])
-
(define_constants
[
(SP_REG 0)
@@ -50,6 +40,7 @@
(UNSPEC_RTE 10)
(UNSPEC_RTFI 11)
(UNSPEC_NAKED 12)
+ (UNSPEC_CONST 13)
(UNSPEC_MOVSTR 20)
(UNSPEC_MOVMEM 21)
@@ -258,46 +249,20 @@
(define_expand "cbranchsf4"
[(set (pc)
(if_then_else
- (match_operator 0 "comparison_operator"
+ (match_operator 0 "rx_fp_comparison_operator"
[(match_operand:SF 1 "register_operand")
- (match_operand:SF 2 "register_operand")])
- (label_ref (match_operand 3 ""))
+ (match_operand:SF 2 "rx_source_operand")])
+ (label_ref (match_operand 3 ""))
(pc)))]
"ALLOW_RX_FPU_INSNS"
-{
- enum rtx_code cmp1, cmp2;
-
- /* If the comparison needs swapping of operands, do that now.
- Do not split the comparison in two yet. */
- if (rx_split_fp_compare (GET_CODE (operands[0]), &cmp1, &cmp2))
- {
- rtx op1, op2;
-
- if (cmp2 != UNKNOWN)
- {
- gcc_assert (cmp1 == UNORDERED);
- if (cmp2 == GT)
- cmp1 = UNGT;
- else if (cmp2 == LE)
- cmp1 = UNLE;
- else
- gcc_unreachable ();
- }
-
- op1 = operands[2];
- op2 = operands[1];
- operands[0] = gen_rtx_fmt_ee (cmp1, VOIDmode, op1, op2);
- operands[1] = op1;
- operands[2] = op2;
- }
-})
+)
(define_insn_and_split "*cbranchsf4"
[(set (pc)
(if_then_else
(match_operator 3 "rx_fp_comparison_operator"
[(match_operand:SF 0 "register_operand" "r")
- (match_operand:SF 1 "rx_source_operand" "rFiQ")])
+ (match_operand:SF 1 "rx_source_operand" "rFQ")])
(match_operand 2 "label_ref_operand" "")
(pc)))]
"ALLOW_RX_FPU_INSNS"
@@ -305,46 +270,8 @@
"&& reload_completed"
[(const_int 0)]
{
- enum rtx_code cmp0, cmp1, cmp2;
- rtx flags, lab1, lab2, over, x;
- bool swap;
-
- cmp0 = GET_CODE (operands[3]);
- swap = rx_split_fp_compare (cmp0, &cmp1, &cmp2);
- gcc_assert (!swap);
-
- flags = gen_rtx_REG (CC_Fmode, CC_REG);
- x = gen_rtx_COMPARE (CC_Fmode, operands[0], operands[1]);
- x = gen_rtx_SET (VOIDmode, flags, x);
- emit_insn (x);
-
- over = NULL;
- lab1 = lab2 = operands[2];
-
- /* The one case of LTGT needs to be split into cmp1 && cmp2. */
- if (cmp0 == LTGT)
- {
- over = gen_label_rtx ();
- lab1 = gen_rtx_LABEL_REF (VOIDmode, over);
- cmp1 = reverse_condition_maybe_unordered (cmp1);
- }
-
- /* Otherwise we split into cmp1 || cmp2. */
- x = gen_rtx_fmt_ee (cmp1, VOIDmode, flags, const0_rtx);
- x = gen_rtx_IF_THEN_ELSE (VOIDmode, x, lab1, pc_rtx);
- x = gen_rtx_SET (VOIDmode, pc_rtx, x);
- emit_jump_insn (x);
-
- if (cmp2 != UNKNOWN)
- {
- x = gen_rtx_fmt_ee (cmp2, VOIDmode, flags, const0_rtx);
- x = gen_rtx_IF_THEN_ELSE (VOIDmode, x, lab2, pc_rtx);
- x = gen_rtx_SET (VOIDmode, pc_rtx, x);
- emit_jump_insn (x);
- }
-
- if (over)
- emit_label (over);
+ rx_split_cbranch (CC_Fmode, GET_CODE (operands[3]),
+ operands[0], operands[1], operands[2]);
DONE;
})
@@ -352,7 +279,7 @@
[(set (reg:CC_F CC_REG)
(compare:CC_F
(match_operand:SF 0 "register_operand" "r,r,r")
- (match_operand:SF 1 "rx_source_operand" "r,iF,Q")))]
+ (match_operand:SF 1 "rx_source_operand" "r,F,Q")))]
"ALLOW_RX_FPU_INSNS && reload_completed"
"fcmp\t%1, %0"
[(set_attr "timings" "11,11,33")
@@ -368,7 +295,7 @@
[(reg CC_REG) (const_int 0)])
(label_ref (match_operand 0 "" ""))
(pc)))]
- ""
+ "reload_completed"
"b%B1\t%0"
[(set_attr "length" "8") ;; This length is wrong, but it is
;; too hard to compute statically.
@@ -416,10 +343,12 @@
(set_attr "timings" "55")]
)
+;; Unspec used so that the constant will not be invalid
+;; if -mmax-constant-size has been specified.
(define_insn "deallocate_and_return"
[(set (reg:SI SP_REG)
(plus:SI (reg:SI SP_REG)
- (match_operand:SI 0 "immediate_operand" "i")))
+ (const:SI (unspec:SI [(match_operand 0 "const_int_operand" "n")] UNSPEC_CONST))))
(return)]
""
"rtsd\t%0"
@@ -431,7 +360,8 @@
[(match_parallel 1 "rx_rtsd_vector"
[(set (reg:SI SP_REG)
(plus:SI (reg:SI SP_REG)
- (match_operand:SI 0 "const_int_operand" "n")))])]
+ (match_operand:SI 0 "const_int_operand" "n")))])
+ (return)]
"reload_completed"
{
rx_emit_stack_popm (operands, false);
@@ -481,14 +411,14 @@
if (! rx_call_operand (dest, Pmode))
dest = force_reg (Pmode, dest);
- emit_call_insn (gen_call_internal (dest, operands[1]));
+ emit_call_insn (gen_call_internal (dest));
DONE;
}
)
(define_insn "call_internal"
[(call (mem:QI (match_operand:SI 0 "rx_call_operand" "r,Symbol"))
- (match_operand:SI 1 "general_operand" "g,g"))
+ (const_int 0))
(clobber (reg:CC CC_REG))]
""
"@
@@ -508,7 +438,7 @@
if (! rx_call_operand (dest, Pmode))
dest = force_reg (Pmode, dest);
- emit_call_insn (gen_call_value_internal (operands[0], dest, operands[2]));
+ emit_call_insn (gen_call_value_internal (operands[0], dest));
DONE;
}
)
@@ -516,7 +446,7 @@
(define_insn "call_value_internal"
[(set (match_operand 0 "register_operand" "=r,r")
(call (mem:QI (match_operand:SI 1 "rx_call_operand" "r,Symbol"))
- (match_operand:SI 2 "general_operand" "g,g")))
+ (const_int 0)))
(clobber (reg:CC CC_REG))]
""
"@
@@ -540,12 +470,14 @@
{
if (MEM_P (operands[0]))
operands[0] = XEXP (operands[0], 0);
+ emit_call_insn (gen_sibcall_internal (operands[0]));
+ DONE;
}
)
(define_insn "sibcall_internal"
[(call (mem:QI (match_operand:SI 0 "rx_symbolic_call_operand" "Symbol"))
- (match_operand:SI 1 "general_operand" "g"))
+ (const_int 0))
(return)]
""
"bra\t%A0"
@@ -563,13 +495,15 @@
{
if (MEM_P (operands[1]))
operands[1] = XEXP (operands[1], 0);
+ emit_call_insn (gen_sibcall_value_internal (operands[0], operands[1]));
+ DONE;
}
)
(define_insn "sibcall_value_internal"
[(set (match_operand 0 "register_operand" "=r")
(call (mem:QI (match_operand:SI 1 "rx_symbolic_call_operand" "Symbol"))
- (match_operand:SI 2 "general_operand" "g")))
+ (const_int 0)))
(return)]
""
"bra\t%A1"
@@ -621,6 +555,9 @@
{
if (MEM_P (operand0) && MEM_P (operand1))
operands[1] = copy_to_mode_reg (<register_modes:MODE>mode, operand1);
+ if (CONST_INT_P (operand1)
+ && ! rx_is_legitimate_constant (operand1))
+ FAIL;
}
)
@@ -739,95 +676,26 @@
[(set_attr "length" "3")]
)
-(define_expand "cstoresf4"
- [(parallel [(set (match_operand:SI 0 "register_operand" "")
- (match_operator:SI 1 "comparison_operator"
- [(match_operand:SF 2 "register_operand" "")
- (match_operand:SF 3 "register_operand" "")]))
- (clobber (match_scratch:SI 4))])]
- "ALLOW_RX_FPU_INSNS"
-{
- enum rtx_code cmp1, cmp2;
-
- /* If the comparison needs swapping of operands, do that now.
- Do not split the comparison in two yet. */
- if (rx_split_fp_compare (GET_CODE (operands[0]), &cmp1, &cmp2))
- {
- rtx op2, op3;
-
- if (cmp2 != UNKNOWN)
- {
- gcc_assert (cmp1 == UNORDERED);
- if (cmp2 == GT)
- cmp1 = UNGT;
- else if (cmp2 == LE)
- cmp1 = UNLE;
- else
- gcc_unreachable ();
- }
-
- op2 = operands[3];
- op3 = operands[2];
- operands[0] = gen_rtx_fmt_ee (cmp1, VOIDmode, op2, op3);
- operands[2] = op2;
- operands[3] = op3;
- }
-})
-
-(define_insn_and_split "*cstoresf4"
+(define_insn_and_split "cstoresf4"
[(set (match_operand:SI 0 "register_operand" "=r")
- (match_operator:SI 4 "rx_fp_comparison_operator"
+ (match_operator:SI 1 "rx_fp_comparison_operator"
[(match_operand:SF 2 "register_operand" "r")
- (match_operand:SF 3 "rx_source_operand" "rFiQ")]))
- (clobber (match_scratch:SI 1 "=r"))]
+ (match_operand:SF 3 "rx_source_operand" "rFQ")]))]
"ALLOW_RX_FPU_INSNS"
"#"
"reload_completed"
[(const_int 0)]
{
- enum rtx_code cmp0, cmp1, cmp2;
rtx flags, x;
- bool swap;
-
- cmp0 = GET_CODE (operands[4]);
- swap = rx_split_fp_compare (cmp0, &cmp1, &cmp2);
- gcc_assert (!swap);
flags = gen_rtx_REG (CC_Fmode, CC_REG);
x = gen_rtx_COMPARE (CC_Fmode, operands[2], operands[3]);
x = gen_rtx_SET (VOIDmode, flags, x);
emit_insn (x);
- x = gen_rtx_fmt_ee (cmp1, SImode, flags, const0_rtx);
+ x = gen_rtx_fmt_ee (GET_CODE (operands[1]), SImode, flags, const0_rtx);
x = gen_rtx_SET (VOIDmode, operands[0], x);
emit_insn (x);
-
- if (cmp0 == LTGT)
- {
- /* The one case of LTGT needs to be split into ORDERED && NE. */
- x = gen_rtx_fmt_ee (EQ, VOIDmode, flags, const0_rtx);
- x = gen_rtx_IF_THEN_ELSE (SImode, x, const0_rtx, operands[0]);
- x = gen_rtx_SET (VOIDmode, operands[0], x);
- emit_insn (x);
- }
- else if (cmp2 == EQ || cmp2 == NE)
- {
- /* Oring the two flags can be performed with a movcc operation. */
- x = gen_rtx_fmt_ee (cmp2, VOIDmode, flags, const0_rtx);
- x = gen_rtx_IF_THEN_ELSE (SImode, x, const1_rtx, operands[0]);
- x = gen_rtx_SET (VOIDmode, operands[0], x);
- emit_insn (x);
- }
- else if (cmp2 != UNKNOWN)
- {
- /* We can't use movcc, but need to or in another compare.
- Do this by storing the second operation into the scratch. */
- x = gen_rtx_fmt_ee (cmp2, SImode, flags, const0_rtx);
- x = gen_rtx_SET (VOIDmode, operands[1], x);
- emit_insn (x);
-
- emit_insn (gen_iorsi3 (operands[0], operands[0], operands[1]));
- }
DONE;
})
@@ -929,7 +797,10 @@
(set (reg CC_REG)
(compare (abs:SI (match_dup 1))
(const_int 0)))]
- "reload_completed && rx_match_ccmode (insn, CC_ZSOmode)"
+ ;; Note - although the ABS instruction does set the O bit in the processor
+ ;; status word, it does not do so in a way that is comparable with the CMP
+ ;; instruction. Hence we use CC_ZSmode rather than CC_ZSOmode.
+ "reload_completed && rx_match_ccmode (insn, CC_ZSmode)"
"@
abs\t%0
abs\t%1, %0"
@@ -1034,9 +905,9 @@
)
(define_expand "adddi3"
- [(set (match_operand:DI 0 "register_operand" "")
- (plus:DI (match_operand:DI 1 "register_operand" "")
- (match_operand:DI 2 "rx_source_operand" "")))]
+ [(set (match_operand:DI 0 "register_operand")
+ (plus:DI (match_operand:DI 1 "register_operand")
+ (match_operand:DI 2 "rx_source_operand")))]
""
{
rtx op0l, op0h, op1l, op1h, op2l, op2h;
@@ -1093,8 +964,18 @@
if (rtx_equal_p (op0l, op1l))
;
+ /* It is preferable that op0l == op1l... */
else if (rtx_equal_p (op0l, op2l))
x = op1l, op1l = op2l, op2l = x;
+ /* ... but it is only a requirement if op2l == MEM. */
+ else if (MEM_P (op2l))
+ {
+ /* Let's hope that we still have a scratch register free. */
+ gcc_assert (op1h != scratch);
+ emit_move_insn (scratch, op2l);
+ op2l = scratch;
+ }
+
emit_insn (gen_addsi3_flags (op0l, op1l, op2l));
if (rtx_equal_p (op0h, op1h))
@@ -1599,9 +1480,9 @@
)
(define_expand "subdi3"
- [(set (match_operand:DI 0 "register_operand" "")
- (minus:DI (match_operand:DI 1 "register_operand" "")
- (match_operand:DI 2 "rx_source_operand" "")))]
+ [(set (match_operand:DI 0 "register_operand")
+ (minus:DI (match_operand:DI 1 "register_operand")
+ (match_operand:DI 2 "rx_compare_operand")))]
""
{
rtx op0l, op0h, op1l, op1h, op2l, op2h;
@@ -1620,7 +1501,7 @@
(define_insn_and_split "subdi3_internal"
[(set (match_operand:SI 0 "register_operand" "=&r,&r")
(minus:SI (match_operand:SI 2 "register_operand" " 0, r")
- (match_operand:SI 3 "rx_source_operand" "rnQ, r")))
+ (match_operand:SI 3 "rx_compare_operand" "rQ, r")))
(set (match_operand:SI 1 "register_operand" "= r, r")
(minus:SI
(minus:SI
diff --git a/gcc/config/s390/s390-protos.h b/gcc/config/s390/s390-protos.h
index fdd4f1305e7..619d0e51dd7 100644
--- a/gcc/config/s390/s390-protos.h
+++ b/gcc/config/s390/s390-protos.h
@@ -70,7 +70,6 @@ extern int legitimate_constant_p (rtx);
extern bool legitimate_reload_constant_p (rtx);
extern rtx legitimize_pic_address (rtx, rtx);
extern rtx legitimize_reload_address (rtx, enum machine_mode, int, int);
-extern enum reg_class s390_preferred_reload_class (rtx, enum reg_class);
extern enum reg_class s390_secondary_input_reload_class (enum reg_class,
enum machine_mode,
rtx);
diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c
index efbf03503d0..a8c8bd94362 100644
--- a/gcc/config/s390/s390.c
+++ b/gcc/config/s390/s390.c
@@ -2426,6 +2426,31 @@ s390_float_const_zero_p (rtx value)
&& value == CONST0_RTX (GET_MODE (value)));
}
+/* Implement TARGET_REGISTER_MOVE_COST. */
+
+static int
+s390_register_move_cost (enum machine_mode mode ATTRIBUTE_UNUSED,
+ reg_class_t from, reg_class_t to)
+{
+/* On s390, copy between fprs and gprs is expensive. */
+ if ((reg_classes_intersect_p (from, GENERAL_REGS)
+ && reg_classes_intersect_p (to, FP_REGS))
+ || (reg_classes_intersect_p (from, FP_REGS)
+ && reg_classes_intersect_p (to, GENERAL_REGS)))
+ return 10;
+
+ return 1;
+}
+
+/* Implement TARGET_MEMORY_MOVE_COST. */
+
+static int
+s390_memory_move_cost (enum machine_mode mode ATTRIBUTE_UNUSED,
+ reg_class_t rclass ATTRIBUTE_UNUSED,
+ bool in ATTRIBUTE_UNUSED)
+{
+ return 1;
+}
/* Compute a (partial) cost for rtx X. Return true if the complete
cost has been computed, and false if subexpressions should be
@@ -2926,8 +2951,8 @@ legitimate_reload_fp_constant_p (rtx op)
/* Given an rtx OP being reloaded into a reg required to be in class RCLASS,
return the class of reg to actually use. */
-enum reg_class
-s390_preferred_reload_class (rtx op, enum reg_class rclass)
+static reg_class_t
+s390_preferred_reload_class (rtx op, reg_class_t rclass)
{
switch (GET_CODE (op))
{
@@ -10640,6 +10665,10 @@ s390_loop_unroll_adjust (unsigned nunroll, struct loop *loop)
#define TARGET_RTX_COSTS s390_rtx_costs
#undef TARGET_ADDRESS_COST
#define TARGET_ADDRESS_COST s390_address_cost
+#undef TARGET_REGISTER_MOVE_COST
+#define TARGET_REGISTER_MOVE_COST s390_register_move_cost
+#undef TARGET_MEMORY_MOVE_COST
+#define TARGET_MEMORY_MOVE_COST s390_memory_move_cost
#undef TARGET_MACHINE_DEPENDENT_REORG
#define TARGET_MACHINE_DEPENDENT_REORG s390_reorg
@@ -10688,6 +10717,9 @@ s390_loop_unroll_adjust (unsigned nunroll, struct loop *loop)
#undef TARGET_SCALAR_MODE_SUPPORTED_P
#define TARGET_SCALAR_MODE_SUPPORTED_P s390_scalar_mode_supported_p
+#undef TARGET_PREFERRED_RELOAD_CLASS
+#define TARGET_PREFERRED_RELOAD_CLASS s390_preferred_reload_class
+
#undef TARGET_SECONDARY_RELOAD
#define TARGET_SECONDARY_RELOAD s390_secondary_reload
diff --git a/gcc/config/s390/s390.h b/gcc/config/s390/s390.h
index ed0a2aa546c..abf4efcce27 100644
--- a/gcc/config/s390/s390.h
+++ b/gcc/config/s390/s390.h
@@ -531,11 +531,6 @@ extern const enum reg_class regclass_map[FIRST_PSEUDO_REGISTER];
#define REGNO_OK_FOR_BASE_P(REGNO) REGNO_OK_FOR_INDEX_P (REGNO)
-/* Given an rtx X being reloaded into a reg required to be in class CLASS,
- return the class of reg to actually use. */
-#define PREFERRED_RELOAD_CLASS(X, CLASS) \
- s390_preferred_reload_class ((X), (CLASS))
-
/* We need secondary memory to move data between GPRs and FPRs. With
DFP the ldgr lgdr instructions are available. But these
instructions do not handle GPR pairs so it is not possible for 31
@@ -780,18 +775,6 @@ do { \
/* Relative costs of operations. */
-/* On s390, copy between fprs and gprs is expensive. */
-#define REGISTER_MOVE_COST(MODE, CLASS1, CLASS2) \
- (( ( reg_classes_intersect_p ((CLASS1), GENERAL_REGS) \
- && reg_classes_intersect_p ((CLASS2), FP_REGS)) \
- || ( reg_classes_intersect_p ((CLASS1), FP_REGS) \
- && reg_classes_intersect_p ((CLASS2), GENERAL_REGS))) ? 10 : 1)
-
-/* A C expression for the cost of moving data of mode M between a
- register and memory. A value of 2 is the default; this cost is
- relative to those in `REGISTER_MOVE_COST'. */
-#define MEMORY_MOVE_COST(M, C, I) 1
-
/* A C expression for the cost of a branch instruction. A value of 1
is the default; other values are interpreted relative to that. */
#define BRANCH_COST(speed_p, predictable_p) 1
diff --git a/gcc/config/sh/embed-elf.h b/gcc/config/sh/embed-elf.h
index c67517812f8..a9f6d9438e7 100644
--- a/gcc/config/sh/embed-elf.h
+++ b/gcc/config/sh/embed-elf.h
@@ -1,6 +1,6 @@
/* Definitions of target machine for GNU compiler for Renesas / SuperH SH
non-Linux embedded targets.
- Copyright (C) 2002, 2003, 2007, 2010 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2003, 2007, 2010, 2011 Free Software Foundation, Inc.
Contributed by J"orn Rennecke <joern.rennecke@superh.com>
This file is part of GCC.
@@ -29,7 +29,7 @@ along with GCC; see the file COPYING3. If not see
#define LIBGCC_SPEC "%{!shared: \
%{m4-100*:-lic_invalidate_array_4-100} \
%{m4-200*:-lic_invalidate_array_4-200} \
- %{m4-300*|-m4-340:-lic_invalidate_array_4a %{!Os: -lgcc-4-300}} \
+ %{m4-300*|m4-340:-lic_invalidate_array_4a %{!Os: -lgcc-4-300}} \
%{m4a*:-lic_invalidate_array_4a}} \
%{Os: -lgcc-Os-4-200} \
-lgcc \
diff --git a/gcc/config/sh/superh64.h b/gcc/config/sh/superh64.h
deleted file mode 100644
index b2000332082..00000000000
--- a/gcc/config/sh/superh64.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- Definitions of target machine for gcc for SuperH using target sh-superh-elf,
-
- Copyright 2000, 2007 Free Software Foundation, Inc.
- Contributed by Alexandre Oliva <aoliva@redhat.com>
- Modified for SuperH by Richard Shann
-
-This file is part of GNU CC.
-
-GNU CC is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 3, or (at your option)
-any later version.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GCC; see the file COPYING3. If not see
-<http://www.gnu.org/licenses/>. */
-
-/* This header file is used when the vendor name is set to 'superh'.
- It configures the compiler for SH5 only and switches the default
- endianess to little.
- This file is intended to override sh.h, superh.h and sh64.h (which
- should have been included in that order) */
-
-
-#ifndef _SUPERH_H
- #error superh64.h should not be used without superh.h
-#endif
-
-/* We override TARGET_PROCESSOR_SWITCHES in order to remove all the unrequired cpu options */
-#undef TARGET_PROCESSOR_SWITCHES
-#define TARGET_PROCESSOR_SWITCHES \
- {"5-64media", TARGET_NONE, "" }, \
- {"5-64media", SELECT_SH5_64, "SH5 64-bit SHmedia code" }, \
- {"5-64media-nofpu", TARGET_NONE, "" }, \
- {"5-64media-nofpu", SELECT_SH5_64_NOFPU, "SH5 64-bit FPU-less SHmedia code" }, \
- {"5-32media", TARGET_NONE, "" }, \
- {"5-32media", SELECT_SH5_32, "SH5 32-bit SHmedia code" }, \
- {"5-32media-nofpu", TARGET_NONE, "" }, \
- {"5-32media-nofpu", SELECT_SH5_32_NOFPU, "SH5 32-bit FPU-less SHmedia code" }, \
- {"5-compact", TARGET_NONE, "" }, \
- {"5-compact", SELECT_SH5_COMPACT, "SH5 SHcompact code" }, \
- {"5-compact-nofpu", TARGET_NONE, "" }, \
- {"5-compact-nofpu", SELECT_SH5_COMPACT_NOFPU, "SH5 FPU-less SHcompact code" }
diff --git a/gcc/config/sol2.h b/gcc/config/sol2.h
index aace5247609..d520dbf7131 100644
--- a/gcc/config/sol2.h
+++ b/gcc/config/sol2.h
@@ -1,6 +1,6 @@
/* Operating system specific defines to be used when targeting GCC for any
Solaris 2 system.
- Copyright 2002, 2003, 2004, 2007, 2008, 2009, 2010
+ Copyright 2002, 2003, 2004, 2007, 2008, 2009, 2010, 2011
Free Software Foundation, Inc.
This file is part of GCC.
@@ -111,8 +111,7 @@ along with GCC; see the file COPYING3. If not see
/* The system headers under Solaris 2 are C++-aware since 2.0. */
#define NO_IMPLICIT_EXTERN_C
-/* The sun bundled assembler doesn't accept -Yd, (and neither does gas).
- It's safe to pass -s always, even if -g is not used. */
+/* It's safe to pass -s always, even if -g is not used. */
#undef ASM_SPEC
#define ASM_SPEC "\
%{v:-V} %{Qy:} %{!Qn:-Qy} %{Ym,*} -s \
diff --git a/gcc/config/sparc/freebsd.h b/gcc/config/sparc/freebsd.h
index 417357f13fa..f2fb65e33fb 100644
--- a/gcc/config/sparc/freebsd.h
+++ b/gcc/config/sparc/freebsd.h
@@ -1,5 +1,5 @@
/* Definitions for Sun SPARC64 running FreeBSD using the ELF format
- Copyright (C) 2001, 2002, 2004, 2005, 2006, 2007, 2010
+ Copyright (C) 2001, 2002, 2004, 2005, 2006, 2007, 2010, 2011
Free Software Foundation, Inc.
Contributed by David E. O'Brien <obrien@FreeBSD.org> and BSDi.
@@ -30,6 +30,9 @@ along with GCC; see the file COPYING3. If not see
#define CPP_CPU64_DEFAULT_SPEC \
"-D__sparc64__ -D__sparc_v9__ -D__sparcv9 -D__arch64__"
+#undef ASM_SPEC
+#define ASM_SPEC "%{fpic|fPIC|fpie|fPIE:-K PIC} %(asm_cpu)"
+
#define LINK_SPEC "%(link_arch) \
%{!mno-relax:%{!r:-relax}} \
%{p:%nconsider using '-pg' instead of '-p' with gprof(1)} \
diff --git a/gcc/config/sparc/linux.h b/gcc/config/sparc/linux.h
index ec1242445e2..b37cccebb57 100644
--- a/gcc/config/sparc/linux.h
+++ b/gcc/config/sparc/linux.h
@@ -82,12 +82,9 @@ along with GCC; see the file COPYING3. If not see
-dynamic-linker " LINUX_DYNAMIC_LINKER "} \
%{static:-static}}"
-/* The sun bundled assembler doesn't accept -Yd, (and neither does gas).
- It's safe to pass -s always, even if -g is not used. */
+/* It's safe to pass -s always, even if -g is not used. */
#undef ASM_SPEC
#define ASM_SPEC "\
-%{!Qn:-Qy} \
-%{Ym,*} \
-s \
%{fpic|fPIC|fpie|fPIE:-K PIC} \
%{!.c:%{findirect-dispatch:-K PIC}} \
diff --git a/gcc/config/sparc/linux64.h b/gcc/config/sparc/linux64.h
index 3562b465cba..a4c67dce312 100644
--- a/gcc/config/sparc/linux64.h
+++ b/gcc/config/sparc/linux64.h
@@ -176,12 +176,12 @@ along with GCC; see the file COPYING3. If not see
#define OPTION_DEFAULT_SPECS \
{"cpu", "%{!m64:%{!mcpu=*:-mcpu=%(VALUE)}}" }, \
{"tune", "%{!mtune=*:-mtune=%(VALUE)}" }, \
- {"float", "%{!msoft-float:%{!mhard-float:%{!fpu:%{!no-fpu:-m%(VALUE)-float}}}}" }
+ {"float", "%{!msoft-float:%{!mhard-float:%{!mfpu:%{!mno-fpu:-m%(VALUE)-float}}}}" }
#else
#define OPTION_DEFAULT_SPECS \
{"cpu", "%{!m32:%{!mcpu=*:-mcpu=%(VALUE)}}" }, \
{"tune", "%{!mtune=*:-mtune=%(VALUE)}" }, \
- {"float", "%{!msoft-float:%{!mhard-float:%{!fpu:%{!no-fpu:-m%(VALUE)-float}}}}" }
+ {"float", "%{!msoft-float:%{!mhard-float:%{!mfpu:%{!mno-fpu:-m%(VALUE)-float}}}}" }
#endif
#if DEFAULT_ARCH32_P
@@ -205,12 +205,9 @@ along with GCC; see the file COPYING3. If not see
#endif /* !SPARC_BI_ARCH */
-/* The sun bundled assembler doesn't accept -Yd, (and neither does gas).
- It's safe to pass -s always, even if -g is not used. */
+/* It's safe to pass -s always, even if -g is not used. */
#undef ASM_SPEC
#define ASM_SPEC "\
-%{!Qn:-Qy} \
-%{Ym,*} \
-s \
%{fpic|fPIC|fpie|fPIE:-K PIC} \
%{!.c:%{findirect-dispatch:-K PIC}} \
diff --git a/gcc/config/sparc/sol2-bi.h b/gcc/config/sparc/sol2-bi.h
index 48c9a0d11d0..d1d62ebbea7 100644
--- a/gcc/config/sparc/sol2-bi.h
+++ b/gcc/config/sparc/sol2-bi.h
@@ -229,14 +229,12 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#undef CC1_SPEC
#if DEFAULT_ARCH32_P
#define CC1_SPEC "\
-%{sun4:} %{target:} \
%{m64:%{m32:%emay not use both -m32 and -m64}} \
%{m64:-mptr64 -mstack-bias -mno-v8plus \
%{!mcpu*:-%{!mv8plus:mcpu=v9}}} \
"
#else
#define CC1_SPEC "\
-%{sun4:} %{target:} \
%{m32:%{m64:%emay not use both -m32 and -m64}} \
%{m32:-mptr32 -mno-stack-bias \
%{!mcpu*:%{!mv8plus:-mcpu=v9}}} \
@@ -258,12 +256,12 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#define OPTION_DEFAULT_SPECS \
{"cpu", "%{!m64:%{!mcpu=*:-mcpu=%(VALUE)}}" }, \
{"tune", "%{!mtune=*:-mtune=%(VALUE)}" }, \
- {"float", "%{!msoft-float:%{!mhard-float:%{!fpu:%{!no-fpu:-m%(VALUE)-float}}}}" }
+ {"float", "%{!msoft-float:%{!mhard-float:%{!mfpu:%{!mno-fpu:-m%(VALUE)-float}}}}" }
#else
#define OPTION_DEFAULT_SPECS \
{"cpu", "%{!m32:%{!mcpu=*:-mcpu=%(VALUE)}}" }, \
{"tune", "%{!mtune=*:-mtune=%(VALUE)}" }, \
- {"float", "%{!msoft-float:%{!mhard-float:%{!fpu:%{!no-fpu:-m%(VALUE)-float}}}}" }
+ {"float", "%{!msoft-float:%{!mhard-float:%{!mfpu:%{!mno-fpu:-m%(VALUE)-float}}}}" }
#endif
#if DEFAULT_ARCH32_P
diff --git a/gcc/config/sparc/sol2-unwind.h b/gcc/config/sparc/sol2-unwind.h
index aa1358dfae5..f8b99027247 100644
--- a/gcc/config/sparc/sol2-unwind.h
+++ b/gcc/config/sparc/sol2-unwind.h
@@ -1,5 +1,5 @@
/* DWARF2 EH unwinding support for SPARC Solaris.
- Copyright (C) 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 2009, 2010, 2011 Free Software Foundation, Inc.
This file is part of GCC.
@@ -26,224 +26,130 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
state data appropriately. See unwind-dw2.c for the structs. */
#include <ucontext.h>
+#include <sys/frame.h>
+#include <sys/stack.h>
#if defined(__arch64__)
-#define MD_FALLBACK_FRAME_STATE_FOR sparc64_fallback_frame_state
+#define IS_SIGHANDLER sparc64_is_sighandler
-static _Unwind_Reason_Code
-sparc64_fallback_frame_state (struct _Unwind_Context *context,
- _Unwind_FrameState *fs)
+static int
+sparc64_is_sighandler (unsigned int *pc, unsigned int *savpc, int *nframes)
{
- void *pc = context->ra;
- void *this_cfa = context->cfa;
- void *new_cfa, *ra_location, *shifted_ra_location;
- int regs_off;
- int fpu_save_off;
- unsigned char fpu_save;
- int i;
-
- /* This is the observed pattern for the sigacthandler in Solaris 8. */
- unsigned int sigacthandler_sol8_pattern []
- = {0x9401400f, 0xca5aafa0, 0x913e2000, 0x892a3003,
- 0xe0590005, 0x9fc40000, 0x9410001a, 0x80a6e008};
-
- /* This is the observed pattern for the sigacthandler in Solaris 9. */
- unsigned int sigacthandler_sol9_pattern []
- = {0xa33e2000, 0x00000000, 0x892c7003, 0x90100011,
- 0xe0590005, 0x9fc40000, 0x9410001a, 0x80a46008};
-
- /* This is the observed pattern for the __sighndlr. */
- unsigned int sighndlr_pattern []
- = {0x9de3bf50, 0x90100018, 0x92100019, 0x9fc6c000,
- 0x9410001a, 0x81c7e008, 0x81e80000};
-
- /* Deal with frame-less function from which a signal was raised. */
- if (_Unwind_IsSignalFrame (context))
+ if (/* Solaris 8 - single-threaded
+ ----------------------------
+ <sigacthandler+24>: add %g5, %o7, %o2
+ <sigacthandler+28>: ldx [ %o2 + 0xfa0 ], %g5
+ <sigacthandler+32>: sra %i0, 0, %o0
+ <sigacthandler+36>: sllx %o0, 3, %g4
+ <sigacthandler+40>: ldx [ %g4 + %g5 ], %l0
+ <sigacthandler+44>: call %l0
+ <sigacthandler+48>: mov %i2, %o2
+ <sigacthandler+52>: cmp %i3, 8 <--- PC */
+ ( pc[-7] == 0x9401400f
+ && pc[-6] == 0xca5aafa0
+ && pc[-5] == 0x913e2000
+ && pc[-4] == 0x892a3003
+ && pc[-3] == 0xe0590005
+ && pc[-2] == 0x9fc40000
+ && pc[-1] == 0x9410001a
+ && pc[ 0] == 0x80a6e008)
+
+ || /* Solaris 9 - single-threaded
+ ----------------------------
+ The pattern changes slightly in different versions of the
+ operating system, so we skip the comparison against pc[-6] for
+ Solaris 9.
+
+ <sigacthandler+24>: sra %i0, 0, %l1
+
+ Solaris 9 5/02:
+ <sigacthandler+28>: ldx [ %o2 + 0xf68 ], %g5
+ Solaris 9 9/05:
+ <sigacthandler+28>: ldx [ %o2 + 0xe50 ], %g5
+
+ <sigacthandler+32>: sllx %l1, 3, %g4
+ <sigacthandler+36>: mov %l1, %o0
+ <sigacthandler+40>: ldx [ %g4 + %g5 ], %l0
+ <sigacthandler+44>: call %l0
+ <sigacthandler+48>: mov %i2, %o2
+ <sigacthandler+52>: cmp %l1, 8 <--- PC */
+ ( pc[-7] == 0xa33e2000
+ /* skip pc[-6] */
+ && pc[-5] == 0x892c7003
+ && pc[-4] == 0x90100011
+ && pc[-3] == 0xe0590005
+ && pc[-2] == 0x9fc40000
+ && pc[-1] == 0x9410001a
+ && pc[ 0] == 0x80a46008))
{
- /* The CFA is by definition unmodified in this case. */
- fs->regs.cfa_how = CFA_REG_OFFSET;
- fs->regs.cfa_reg = __builtin_dwarf_sp_column ();
- fs->regs.cfa_offset = 0;
-
- /* This is the canonical RA column. */
- fs->retaddr_column = 15;
-
- return _URC_NO_REASON;
+ /* We need to move up one frame:
+
+ <signal handler> <-- context->cfa
+ sigacthandler
+ <kernel>
+ */
+ *nframes = 1;
+ return 1;
}
- /* Look for the sigacthandler pattern. The pattern changes slightly
- in different versions of the operating system, so we skip the
- comparison against pc-(4*6) for Solaris 9. */
- if (( *(unsigned int *)(pc-(4*7)) == sigacthandler_sol8_pattern[0]
- && *(unsigned int *)(pc-(4*6)) == sigacthandler_sol8_pattern[1]
- && *(unsigned int *)(pc-(4*5)) == sigacthandler_sol8_pattern[2]
- && *(unsigned int *)(pc-(4*4)) == sigacthandler_sol8_pattern[3]
- && *(unsigned int *)(pc-(4*3)) == sigacthandler_sol8_pattern[4]
- && *(unsigned int *)(pc-(4*2)) == sigacthandler_sol8_pattern[5]
- && *(unsigned int *)(pc-(4*1)) == sigacthandler_sol8_pattern[6]
- && *(unsigned int *)(pc-(4*0)) == sigacthandler_sol8_pattern[7] ) ||
- ( *(unsigned int *)(pc-(4*7)) == sigacthandler_sol9_pattern[0]
- /* skip pc-(4*6) */
- && *(unsigned int *)(pc-(4*5)) == sigacthandler_sol9_pattern[2]
- && *(unsigned int *)(pc-(4*4)) == sigacthandler_sol9_pattern[3]
- && *(unsigned int *)(pc-(4*3)) == sigacthandler_sol9_pattern[4]
- && *(unsigned int *)(pc-(4*2)) == sigacthandler_sol9_pattern[5]
- && *(unsigned int *)(pc-(4*1)) == sigacthandler_sol9_pattern[6]
- && *(unsigned int *)(pc-(4*0)) == sigacthandler_sol9_pattern[7] ) )
- /* We need to move up two frames (the kernel frame and the handler
- frame). Minimum stack frame size is 176 bytes (128 + 48): 128
- bytes for spilling register window (16 extended words for in
- and local registers), and 6 extended words to store at least
- 6 arguments to callees, The kernel frame and the sigacthandler
- both have this minimal stack. The ucontext_t structure is after
- this offset. */
- regs_off = 176 + 176;
-
- /* Look for the __sighndlr pattern. */
- else if ( *(unsigned int *)(pc-(4*5)) == sighndlr_pattern[0]
- && *(unsigned int *)(pc-(4*4)) == sighndlr_pattern[1]
- && *(unsigned int *)(pc-(4*3)) == sighndlr_pattern[2]
- && *(unsigned int *)(pc-(4*2)) == sighndlr_pattern[3]
- && *(unsigned int *)(pc-(4*1)) == sighndlr_pattern[4]
- && *(unsigned int *)(pc-(4*0)) == sighndlr_pattern[5]
- && *(unsigned int *)(pc+(4*1)) == sighndlr_pattern[6] )
+ if (/* Solaris 8+ - multi-threaded
+ ----------------------------
+ <__sighndlr>: save %sp, -176, %sp
+ <__sighndlr+4>: mov %i0, %o0
+ <__sighndlr+8>: mov %i1, %o1
+ <__sighndlr+12>: call %i3
+ <__sighndlr+16>: mov %i2, %o2
+ <__sighndlr+20>: ret <--- PC
+ <__sighndlr+24>: restore */
+ pc[-5] == 0x9de3bf50
+ && pc[-4] == 0x90100018
+ && pc[-3] == 0x92100019
+ && pc[-2] == 0x9fc6c000
+ && pc[-1] == 0x9410001a
+ && pc[ 0] == 0x81c7e008
+ && pc[ 1] == 0x81e80000)
{
- /* We have observed different calling frames among different
- versions of the operating system, so that we need to
- discriminate using the upper frame. We look for the return
- address of the caller frame (there is an offset of 15 double
- words between the frame address and the place where this return
- address is stored) in order to do some more pattern matching. */
- unsigned int cuh_pattern
- = *(unsigned int *)(*(unsigned long *)(this_cfa + 15*8) - 4);
-
- if (cuh_pattern == 0xd25fa7ef)
+ if (/* Solaris 8 /usr/lib/sparcv9/libthread.so.1
+ ------------------------------------------
+ Before patch 108827-08:
+ <sigacthandler+1760>: st %g4, [ %i1 + 0x1c ]
+
+ Since patch 108827-08:
+ <sigacthandler+1816>: st %l0, [ %i4 + 0x10 ] */
+ savpc[-1] == 0xc826601c
+ || savpc[-1] == 0xe0272010)
{
- /* This matches the call_user_handler pattern for Solaris 10.
- There are 2 cases so we look for the return address of the
- caller's caller frame in order to do more pattern matching. */
- unsigned int sah_pattern
- = *(unsigned int *)(*(unsigned long *)(this_cfa + 176 + 15*8) - 4);
-
- if (sah_pattern == 0x92100019)
- /* This is the same setup as for Solaris 9, see below. */
- regs_off = 176 + 176 + 176 + 304;
- else
- /* We need to move up three frames (the kernel frame, the
- call_user_handler frame, the __sighndlr frame). Two of them
- have the minimum stack frame size (kernel and __sighndlr
- frames) of 176 bytes, and there is another with a stack frame
- of 304 bytes (the call_user_handler frame). The ucontext_t
- structure is after this offset. */
- regs_off = 176 + 176 + 304;
+ /* We need to move up three frames:
+
+ <signal handler> <-- context->cfa
+ __sighndlr
+ sigacthandler
+ <kernel>
+ */
+ *nframes = 2;
}
- else if (cuh_pattern == 0x9410001a || cuh_pattern == 0x94100013)
- /* This matches the call_user_handler pattern for Solaris 9 and
- for Solaris 8 running inside Solaris Containers respectively.
- We need to move up four frames (the kernel frame, the signal
- frame, the call_user_handler frame, the __sighndlr frame).
- Three of them have the minimum stack frame size (kernel,
- signal, and __sighndlr frames) of 176 bytes, and there is
- another with a stack frame of 304 bytes (the call_user_handler
- frame). The ucontext_t structure is after this offset. */
- regs_off = 176 + 176 + 176 + 304;
- else
- /* We need to move up three frames (the kernel frame, the
- sigacthandler frame, and the __sighndlr frame). The kernel
- frame has a stack frame size of 176, the __sighndlr frames of
- 304 bytes, and there is a stack frame of 176 bytes for the
- sigacthandler frame. The ucontext_t structure is after this
- offset. */
- regs_off = 176 + 304 + 176;
- }
-
- /* Exit if the pattern at the return address does not match the
- previous three patterns. */
- else
- return _URC_END_OF_STACK;
-
- /* FPU information can be extracted from the ucontext_t structure
- that is the third argument for the signal handler, that is saved
- in the stack. There are 64 bytes between the beginning of the
- ucontext_t argument of the signal handler and the uc_mcontext
- field. There are 176 bytes between the beginning of uc_mcontext
- and the beginning of the fpregs field. */
- fpu_save_off = regs_off + (8*10) + 176;
-
- /* The fpregs field contains 32 extended words at the beginning that
- contain the FPU state. Then there are 2 extended words and two
- bytes. */
- fpu_save = *(unsigned char *)(this_cfa + fpu_save_off + (8*32) + (2*8) + 2);
-
- /* We need to get the frame pointer for the kernel frame that
- executes when the signal is raised. This frame is just the
- following to the application code that generated the signal, so
- that the later's stack pointer is the former's frame pointer.
- The stack pointer for the interrupted application code can be
- calculated from the ucontext_t structure (third argument for the
- signal handler) that is saved in the stack. There are 10 words
- between the beginning of the ucontext_t argument of the signal
- handler and the uc_mcontext.gregs field that contains the
- registers saved by the signal handler. */
- new_cfa = *(void **)(this_cfa + regs_off + (8*10) + (REG_SP*8));
- /* The frame address is %sp + STACK_BIAS in 64-bit mode. */
- new_cfa += 2047;
- fs->regs.cfa_how = CFA_REG_OFFSET;
- fs->regs.cfa_reg = __builtin_dwarf_sp_column ();
- fs->regs.cfa_offset = new_cfa - this_cfa;
-
- /* Restore global and out registers (in this order) from the
- ucontext_t structure, uc_mcontext.gregs field. */
- for (i = 1; i < 16; i++)
- {
- /* We never restore %sp as everything is purely CFA-based. */
- if ((unsigned int) i == __builtin_dwarf_sp_column ())
- continue;
-
- /* First the global registers and then the out registers. */
- fs->regs.reg[i].how = REG_SAVED_OFFSET;
- fs->regs.reg[i].loc.offset
- = this_cfa + regs_off + (8*10) + ((REG_Y+i)*8) - new_cfa;
- }
-
- /* Just above the stack pointer there are 16 extended words in which
- the register window (in and local registers) was saved. */
- for (i = 0; i < 16; i++)
- {
- fs->regs.reg[i + 16].how = REG_SAVED_OFFSET;
- fs->regs.reg[i + 16].loc.offset = i*8;
- }
-
- /* Check whether we need to restore FPU registers. */
- if (fpu_save)
- {
- for (i = 0; i < 64; i++)
+ else /* Solaris 8 /usr/lib/lwp/sparcv9/libthread.so.1, Solaris 9+
+ ---------------------------------------------------------- */
{
- if (i > 32 && (i & 1))
- continue;
-
- fs->regs.reg[i + 32].how = REG_SAVED_OFFSET;
- fs->regs.reg[i + 32].loc.offset
- = this_cfa + fpu_save_off + (i*4) - new_cfa;
+ /* We need to move up three frames:
+
+ <signal handler> <-- context->cfa
+ __sighndlr
+ call_user_handler
+ sigacthandler
+ <kernel>
+ */
+ *nframes = 3;
}
+ return 1;
}
- /* State the rules to find the kernel's code "return address", which is
- the address of the active instruction when the signal was caught.
- On the SPARC, since RETURN_ADDR_OFFSET (essentially 8) is defined, we
- need to preventively subtract it from the purported return address. */
- ra_location = this_cfa + regs_off + (8*10) + (REG_PC*8);
- shifted_ra_location = this_cfa + regs_off + (8*10) + (REG_Y*8);
- *(void **)shifted_ra_location = *(void **)ra_location - 8;
- fs->retaddr_column = 0;
- fs->regs.reg[0].how = REG_SAVED_OFFSET;
- fs->regs.reg[0].loc.offset = shifted_ra_location - new_cfa;
- fs->signal_frame = 1;
-
- return _URC_NO_REASON;
+ return 0;
}
+#define MD_FALLBACK_FRAME_STATE_FOR sparc64_fallback_frame_state
+
#define MD_FROB_UPDATE_CONTEXT sparc64_frob_update_context
static void
@@ -258,42 +164,150 @@ sparc64_frob_update_context (struct _Unwind_Context *context,
&& fs->regs.cfa_how == CFA_REG_OFFSET
&& fs->regs.cfa_offset != 0
&& !fs->signal_frame)
- context->cfa -= 2047;
+ context->cfa -= STACK_BIAS;
}
#else
+#define IS_SIGHANDLER sparc_is_sighandler
+
+static int
+sparc_is_sighandler (unsigned int *pc, unsigned int * savpc, int *nframes)
+{
+ if (/* Solaris 8, 9 - single-threaded
+ -------------------------------
+ The pattern changes slightly in different versions of the operating
+ system, so we skip the comparison against pc[-6].
+
+ <sigacthandler+16>: add %o1, %o7, %o3
+ <sigacthandler+20>: mov %i1, %o1
+
+ <sigacthandler+24>: ld [ %o3 + <offset> ], %o2
+
+ <sigacthandler+28>: sll %i0, 2, %o0
+ <sigacthandler+32>: ld [ %o0 + %o2 ], %l0
+ <sigacthandler+36>: mov %i0, %o0
+ <sigacthandler+40>: call %l0
+ <sigacthandler+44>: mov %i2, %o2
+ <sigacthandler+48>: cmp %i0, 8 <--- PC */
+ pc[-8] == 0x9602400f
+ && pc[-7] == 0x92100019
+ /* skip pc[-6] */
+ && pc[-5] == 0x912e2002
+ && pc[-4] == 0xe002000a
+ && pc[-3] == 0x90100018
+ && pc[-2] == 0x9fc40000
+ && pc[-1] == 0x9410001a
+ && pc[ 0] == 0x80a62008)
+ {
+ /* Need to move up one frame:
+
+ <signal handler> <-- context->cfa
+ sigacthandler
+ <kernel>
+ */
+ *nframes = 1;
+ return 1;
+ }
+
+ if (/* Solaris 8 - multi-threaded
+ ---------------------------
+ <__libthread_segvhdlr+212>: clr %o2
+ <__libthread_segvhdlr+216>: ld [ %fp + -28 ], %l0
+ <__libthread_segvhdlr+220>: mov %i4, %o0
+ <__libthread_segvhdlr+224>: mov %i1, %o1
+ <__libthread_segvhdlr+228>: call %l0
+ <__libthread_segvhdlr+232>: mov %i2, %o2
+ <__libthread_segvhdlr+236>: ret <--- PC
+ <__libthread_segvhdlr+240>: restore
+ <__libthread_segvhdlr+244>: cmp %o1, 0 */
+ pc[-6] == 0x94102000
+ && pc[-5] == 0xe007bfe4
+ && pc[-4] == 0x9010001c
+ && pc[-3] == 0x92100019
+ && pc[-2] == 0x9fc40000
+ && pc[-1] == 0x9410001a
+ && pc[ 0] == 0x81c7e008
+ && pc[ 1] == 0x81e80000
+ && pc[ 2] == 0x80a26000)
+ {
+ /* Need to move up one frame:
+
+ <signal handler> <-- context->cfa
+ __libthread_segvhdlr
+ <kernel>
+ */
+ *nframes = 1;
+ return 1;
+ }
+
+ if(/* Solaris 8+ - multi-threaded
+ ----------------------------
+ <__sighndlr>: save %sp, -96, %sp
+ <__sighndlr+4>: mov %i0, %o0
+ <__sighndlr+8>: mov %i1, %o1
+ <__sighndlr+12>: call %i3
+ <__sighndlr+16>: mov %i2, %o2
+ <__sighndlr+20>: ret <--- PC
+ <__sighndlr+24>: restore */
+ pc[-5] == 0x9de3bfa0
+ && pc[-4] == 0x90100018
+ && pc[-3] == 0x92100019
+ && pc[-2] == 0x9fc6c000
+ && pc[-1] == 0x9410001a
+ && pc[ 0] == 0x81c7e008
+ && pc[ 1] == 0x81e80000)
+ {
+ if (/* Solaris 8 /usr/lib/libthread.so.1
+ ----------------------------------
+ <sigacthandler+1796>: mov %i0, %o0 */
+ savpc[-1] == 0x90100018)
+ {
+ /* We need to move up two frames:
+
+ <signal handler> <-- context->cfa
+ __sighndlr
+ sigacthandler
+ <kernel>
+ */
+ *nframes = 2;
+ }
+ else /* Solaris 8 /usr/lib/lwp/libthread.so.1, Solaris 9+
+ -------------------------------------------------- */
+ {
+ /* We need to move up three frames:
+
+ <signal handler> <-- context->cfa
+ __sighndlr
+ call_user_handler
+ sigacthandler
+ <kernel>
+ */
+ *nframes = 3;
+ }
+ return 1;
+ }
+
+ return 0;
+}
+
#define MD_FALLBACK_FRAME_STATE_FOR sparc_fallback_frame_state
+#endif
+
static _Unwind_Reason_Code
-sparc_fallback_frame_state (struct _Unwind_Context *context,
- _Unwind_FrameState *fs)
+MD_FALLBACK_FRAME_STATE_FOR (struct _Unwind_Context *context,
+ _Unwind_FrameState *fs)
{
void *pc = context->ra;
+ struct frame *fp = (struct frame *) context->cfa;
+ int nframes;
void *this_cfa = context->cfa;
- void *new_cfa, *ra_location, *shifted_ra_location;
- int regs_off;
- int fpu_save_off;
- unsigned char fpu_save;
+ long new_cfa;
+ void *ra_location, *shifted_ra_location;
+ mcontext_t *mctx;
int i;
- /* This is the observed pattern for the sigacthandler. */
- unsigned int sigacthandler_pattern []
- = {0x9602400f, 0x92100019, 0x00000000, 0x912e2002,
- 0xe002000a, 0x90100018, 0x9fc40000, 0x9410001a,
- 0x80a62008};
-
- /* This is the observed pattern for the __libthread_segvhdlr. */
- unsigned int segvhdlr_pattern []
- = {0x94102000, 0xe007bfe4, 0x9010001c, 0x92100019,
- 0x9fc40000, 0x9410001a, 0x81c7e008, 0x81e80000,
- 0x80a26000};
-
- /* This is the observed pattern for the __sighndlr. */
- unsigned int sighndlr_pattern []
- = {0x9de3bfa0, 0x90100018, 0x92100019, 0x9fc6c000,
- 0x9410001a, 0x81c7e008, 0x81e80000};
-
/* Deal with frame-less function from which a signal was raised. */
if (_Unwind_IsSignalFrame (context))
{
@@ -308,102 +322,27 @@ sparc_fallback_frame_state (struct _Unwind_Context *context,
return _URC_NO_REASON;
}
- /* Look for the sigacthandler pattern. The pattern changes slightly
- in different versions of the operating system, so we skip the
- comparison against pc-(4*6). */
- if ( *(unsigned int *)(pc-(4*8)) == sigacthandler_pattern[0]
- && *(unsigned int *)(pc-(4*7)) == sigacthandler_pattern[1]
- /* skip pc-(4*6) */
- && *(unsigned int *)(pc-(4*5)) == sigacthandler_pattern[3]
- && *(unsigned int *)(pc-(4*4)) == sigacthandler_pattern[4]
- && *(unsigned int *)(pc-(4*3)) == sigacthandler_pattern[5]
- && *(unsigned int *)(pc-(4*2)) == sigacthandler_pattern[6]
- && *(unsigned int *)(pc-(4*1)) == sigacthandler_pattern[7]
- && *(unsigned int *)(pc-(4*0)) == sigacthandler_pattern[8] )
- /* We need to move up two frames (the kernel frame and the handler
- frame). Minimum stack frame size is 96 bytes (64 + 4 + 24): 64
- bytes for spilling register window (16 words for in and local
- registers), 4 bytes for a pointer to space for callees
- returning structs, and 24 bytes to store at least six argument
- to callees. The ucontext_t structure is after this offset. */
- regs_off = 96 + 96;
-
- /* Look for the __libthread_segvhdlr pattern. */
- else if ( *(unsigned int *)(pc-(4*6)) == segvhdlr_pattern[0]
- && *(unsigned int *)(pc-(4*5)) == segvhdlr_pattern[1]
- && *(unsigned int *)(pc-(4*4)) == segvhdlr_pattern[2]
- && *(unsigned int *)(pc-(4*3)) == segvhdlr_pattern[3]
- && *(unsigned int *)(pc-(4*2)) == segvhdlr_pattern[4]
- && *(unsigned int *)(pc-(4*1)) == segvhdlr_pattern[5]
- && *(unsigned int *)(pc-(4*0)) == segvhdlr_pattern[6]
- && *(unsigned int *)(pc+(4*1)) == segvhdlr_pattern[7]
- && *(unsigned int *)(pc+(4*2)) == segvhdlr_pattern[8] )
- /* We need to move up four frames (the kernel frame, the
- sigacthandler frame, the __sighndlr frame, and the
- __libthread_segvhdlr). Two of them have the minimum
- stack frame size (kernel and __sighndlr frames) of 96 bytes,
- other has a stack frame of 216 bytes (the sigacthandler frame),
- and there is another with a stack frame of 128 bytes (the
- __libthread_segvhdlr). The ucontext_t structure is after this
- offset. */
- regs_off = 96 + 96 + 128 + 216;
-
- /* Look for the __sighndlr pattern. */
- else if ( *(unsigned int *)(pc-(4*5)) == sighndlr_pattern[0]
- && *(unsigned int *)(pc-(4*4)) == sighndlr_pattern[1]
- && *(unsigned int *)(pc-(4*3)) == sighndlr_pattern[2]
- && *(unsigned int *)(pc-(4*2)) == sighndlr_pattern[3]
- && *(unsigned int *)(pc-(4*1)) == sighndlr_pattern[4]
- && *(unsigned int *)(pc-(4*0)) == sighndlr_pattern[5]
- && *(unsigned int *)(pc+(4*1)) == sighndlr_pattern[6] )
+ if (IS_SIGHANDLER (pc, (unsigned int *)fp->fr_savpc, &nframes))
{
- /* We have observed different calling frames among different
- versions of the operating system, so that we need to
- discriminate using the upper frame. We look for the return
- address of the caller frame (there is an offset of 15 words
- between the frame address and the place where this return
- address is stored) in order to do some more pattern matching. */
- unsigned int cuh_pattern
- = *(unsigned int *)(*(unsigned int *)(this_cfa + 15*4) - 4);
-
- if (cuh_pattern == 0xd407a04c)
- {
- /* This matches the call_user_handler pattern for Solaris 10.
- There are 2 cases so we look for the return address of the
- caller's caller frame in order to do more pattern matching. */
- unsigned int sah_pattern
- = *(unsigned int *)(*(unsigned int *)(this_cfa + 96 + 15*4) - 4);
-
- if (sah_pattern == 0x92100019)
- /* This is the same setup as for Solaris 9, see below. */
- regs_off = 96 + 96 + 96 + 160;
- else
- /* We need to move up three frames (the kernel frame, the
- call_user_handler frame, the __sighndlr frame). Two of them
- have the minimum stack frame size (kernel and __sighndlr
- frames) of 96 bytes, and there is another with a stack frame
- of 160 bytes (the call_user_handler frame). The ucontext_t
- structure is after this offset. */
- regs_off = 96 + 96 + 160;
- }
- else if (cuh_pattern == 0x9410001a || cuh_pattern == 0x9410001b)
- /* This matches the call_user_handler pattern for Solaris 9 and
- for Solaris 8 running inside Solaris Containers respectively.
- We need to move up four frames (the kernel frame, the signal
- frame, the call_user_handler frame, the __sighndlr frame).
- Three of them have the minimum stack frame size (kernel,
- signal, and __sighndlr frames) of 96 bytes, and there is
- another with a stack frame of 160 bytes (the call_user_handler
- frame). The ucontext_t structure is after this offset. */
- regs_off = 96 + 96 + 96 + 160;
- else
- /* We need to move up three frames (the kernel frame, the
- sigacthandler frame, and the __sighndlr frame). Two of them
- have the minimum stack frame size (kernel and __sighndlr
- frames) of 96 bytes, and there is another with a stack frame
- of 216 bytes (the sigacthandler frame). The ucontext_t
- structure is after this offset. */
- regs_off = 96 + 96 + 216;
+ struct handler_args {
+ struct frame frwin;
+ ucontext_t ucontext;
+ } *handler_args;
+ ucontext_t *ucp;
+
+ /* context->cfa points into the frame after the saved frame pointer and
+ saved pc (struct frame).
+
+ The ucontext_t structure is in the kernel frame after a struct
+ frame. Since the frame sizes vary even within OS releases, we
+ need to walk the stack to get there. */
+
+ for (i = 0; i < nframes; i++)
+ fp = (struct frame *) ((char *)fp->fr_savfp + STACK_BIAS);
+
+ handler_args = (struct handler_args *) fp;
+ ucp = &handler_args->ucontext;
+ mctx = &ucp->uc_mcontext;
}
/* Exit if the pattern at the return address does not match the
@@ -411,32 +350,13 @@ sparc_fallback_frame_state (struct _Unwind_Context *context,
else
return _URC_END_OF_STACK;
- /* FPU information can be extracted from the ucontext_t structure
- that is the third argument for the signal handler, that is saved
- in the stack. There are 10 words between the beginning of the
- ucontext_t argument of the signal handler and the uc_mcontext
- field. There are 80 bytes between the beginning of uc_mcontext
- and the beginning of the fpregs field. */
- fpu_save_off = regs_off + (4*10) + (4*20);
-
- /* The fpregs field contains 32 words at the beginning that contain
- the FPU state. Then there are 2 words and two bytes. */
- fpu_save = *(unsigned char *)(this_cfa + fpu_save_off + (4*32) + (2*4) + 2);
-
- /* We need to get the frame pointer for the kernel frame that
- executes when the signal is raised. This frame is just the
- following to the application code that generated the signal, so
- that the later's stack pointer is the former's frame pointer.
- The stack pointer for the interrupted application code can be
- calculated from the ucontext_t structure (third argument for the
- signal handler) that is saved in the stack. There are 10 words
- between the beginning of the ucontext_t argument of the signal
- handler and the uc_mcontext.gregs field that contains the
- registers saved by the signal handler. */
- new_cfa = *(void **)(this_cfa + regs_off + (4*10) + (REG_SP*4));
+ new_cfa = mctx->gregs[REG_SP];
+ /* The frame address is %sp + STACK_BIAS in 64-bit mode. */
+ new_cfa += STACK_BIAS;
+
fs->regs.cfa_how = CFA_REG_OFFSET;
fs->regs.cfa_reg = __builtin_dwarf_sp_column ();
- fs->regs.cfa_offset = new_cfa - this_cfa;
+ fs->regs.cfa_offset = new_cfa - (long) this_cfa;
/* Restore global and out registers (in this order) from the
ucontext_t structure, uc_mcontext.gregs field. */
@@ -446,44 +366,54 @@ sparc_fallback_frame_state (struct _Unwind_Context *context,
if ((unsigned int) i == __builtin_dwarf_sp_column ())
continue;
- /* First the global registers and then the out registers */
+ /* First the global registers and then the out registers. */
fs->regs.reg[i].how = REG_SAVED_OFFSET;
- fs->regs.reg[i].loc.offset
- = this_cfa + regs_off + (4*10) + ((REG_Y+i)*4) - new_cfa;
+ fs->regs.reg[i].loc.offset = (long)&mctx->gregs[REG_Y + i] - new_cfa;
}
- /* Just above the stack pointer there are 16 words in which the
- register window (in and local registers) was saved. */
+ /* Just above the stack pointer there are 16 extended words in which
+ the register window (in and local registers) was saved. */
for (i = 0; i < 16; i++)
{
fs->regs.reg[i + 16].how = REG_SAVED_OFFSET;
- fs->regs.reg[i + 16].loc.offset = i*4;
+ fs->regs.reg[i + 16].loc.offset = i*sizeof(long);
}
/* Check whether we need to restore FPU registers. */
- if (fpu_save)
+ if (mctx->fpregs.fpu_qcnt)
{
for (i = 0; i < 32; i++)
{
fs->regs.reg[i + 32].how = REG_SAVED_OFFSET;
fs->regs.reg[i + 32].loc.offset
- = this_cfa + fpu_save_off + (i*4) - new_cfa;
+ = (long)&mctx->fpregs.fpu_fr.fpu_regs[i] - new_cfa;
+ }
+
+#ifdef __arch64__
+ /* For 64-bit, fpu_fr.fpu_dregs contains 32 instead of 16 doubles. */
+ for (i = 32; i < 64; i++)
+ {
+ if (i > 32 && (i & 1))
+ continue;
+
+ fs->regs.reg[i + 32].how = REG_SAVED_OFFSET;
+ fs->regs.reg[i + 32].loc.offset
+ = (long)&mctx->fpregs.fpu_fr.fpu_dregs[i/2] - new_cfa;
}
+#endif
}
/* State the rules to find the kernel's code "return address", which is
the address of the active instruction when the signal was caught.
On the SPARC, since RETURN_ADDR_OFFSET (essentially 8) is defined, we
need to preventively subtract it from the purported return address. */
- ra_location = this_cfa + regs_off + (4*10) + (REG_PC*4);
- shifted_ra_location = this_cfa + regs_off + (4*10) + (REG_Y*4);
+ ra_location = &mctx->gregs[REG_PC];
+ shifted_ra_location = &mctx->gregs[REG_Y];
*(void **)shifted_ra_location = *(void **)ra_location - 8;
fs->retaddr_column = 0;
fs->regs.reg[0].how = REG_SAVED_OFFSET;
- fs->regs.reg[0].loc.offset = shifted_ra_location - new_cfa;
+ fs->regs.reg[0].loc.offset = (long)shifted_ra_location - new_cfa;
fs->signal_frame = 1;
return _URC_NO_REASON;
-};
-
-#endif
+}
diff --git a/gcc/config/sparc/sp-elf.h b/gcc/config/sparc/sp-elf.h
index 3e828fdf0c1..6c0797f74ba 100644
--- a/gcc/config/sparc/sp-elf.h
+++ b/gcc/config/sparc/sp-elf.h
@@ -24,11 +24,10 @@ along with GCC; see the file COPYING3. If not see
/* Don't assume anything about the header files. */
#define NO_IMPLICIT_EXTERN_C
-/* The sun bundled assembler doesn't accept -Yd, (and neither does gas).
- It's safe to pass -s always, even if -g is not used. */
+/* It's safe to pass -s always, even if -g is not used. */
#undef ASM_SPEC
#define ASM_SPEC \
- "%{Qy:} %{!Qn:-Qy} %{Ym,*} -s \
+ "-s \
%{fpic|fpie|fPIC|fPIE:-K PIC} %(asm_cpu)"
/* Use the default. */
diff --git a/gcc/config/sparc/sparc.h b/gcc/config/sparc/sparc.h
index 5137b5c1903..297844fc0ba 100644
--- a/gcc/config/sparc/sparc.h
+++ b/gcc/config/sparc/sparc.h
@@ -388,10 +388,9 @@ extern enum cmodel sparc_cmodel;
%{!m32:%{!m64:%(cpp_arch_default)}} \
"
-/* Macros to distinguish endianness. */
+/* Macro to distinguish endianness. */
#define CPP_ENDIAN_SPEC "\
-%{mlittle-endian:-D__LITTLE_ENDIAN__} \
-%{mlittle-endian-data:-D__LITTLE_ENDIAN_DATA__}"
+%{mlittle-endian:-D__LITTLE_ENDIAN__}"
/* Macros to distinguish the particular subtarget. */
#define CPP_SUBTARGET_SPEC ""
@@ -551,7 +550,7 @@ extern enum processor_type sparc_cpu;
#define OPTION_DEFAULT_SPECS \
{"cpu", "%{!mcpu=*:-mcpu=%(VALUE)}" }, \
{"tune", "%{!mtune=*:-mtune=%(VALUE)}" }, \
- {"float", "%{!msoft-float:%{!mhard-float:%{!fpu:%{!no-fpu:-m%(VALUE)-float}}}}" }
+ {"float", "%{!msoft-float:%{!mhard-float:%{!mfpu:%{!mno-fpu:-m%(VALUE)-float}}}}" }
/* sparc_select[0] is reserved for the default cpu. */
struct sparc_cpu_select
diff --git a/gcc/config/sparc/sysv4.h b/gcc/config/sparc/sysv4.h
index 8b3a77e6a72..2ffa94527b2 100644
--- a/gcc/config/sparc/sysv4.h
+++ b/gcc/config/sparc/sysv4.h
@@ -1,6 +1,6 @@
/* Target definitions for GNU compiler for SPARC running System V.4
Copyright (C) 1991, 1992, 1995, 1996, 1997, 1998, 2000, 2002, 2007, 2009,
- 2010
+ 2010, 2011
Free Software Foundation, Inc.
Contributed by Ron Guilmette (rfg@monkeys.com).
@@ -46,7 +46,7 @@ along with GCC; see the file COPYING3. If not see
/* Pass -K to the assembler when PIC. */
#undef ASM_SPEC
#define ASM_SPEC \
- "%{v:-V} %{Qy:} %{!Qn:-Qy} %{Ym,*} %{Yd,*} \
+ "%{v:-V} %{Qy:} %{!Qn:-Qy} %{Ym,*} \
%{fpic|fPIC|fpie|fPIE:-K PIC} %(asm_cpu)"
/* Define the names of various pseudo-op used by the SPARC/svr4 assembler.
diff --git a/gcc/config/sparc/vxworks.h b/gcc/config/sparc/vxworks.h
index 4d971a4bbc8..e1b596e7f79 100644
--- a/gcc/config/sparc/vxworks.h
+++ b/gcc/config/sparc/vxworks.h
@@ -1,6 +1,6 @@
/* Definitions of target machine for GNU compiler,
for SPARC targeting the VxWorks run time environment.
- Copyright (C) 2007, 2010 Free Software Foundation, Inc.
+ Copyright (C) 2007, 2010, 2011 Free Software Foundation, Inc.
This file is part of GCC.
@@ -33,6 +33,9 @@ along with GCC; see the file COPYING3. If not see
#undef CPP_SUBTARGET_SPEC
#define CPP_SUBTARGET_SPEC VXWORKS_ADDITIONAL_CPP_SPEC
+#undef ASM_SPEC
+#define ASM_SPEC "%{fpic|fPIC|fpie|fPIE:-K PIC} %(asm_cpu)"
+
#undef LIB_SPEC
#define LIB_SPEC VXWORKS_LIB_SPEC
#undef LINK_SPEC
diff --git a/gcc/config/spu/spu-elf.h b/gcc/config/spu/spu-elf.h
index dab9ad35228..818c391f994 100644
--- a/gcc/config/spu/spu-elf.h
+++ b/gcc/config/spu/spu-elf.h
@@ -78,6 +78,3 @@
mcache-size=8 :-lgcc_cache8k; \
:-lgcc_cache64k}"
-#undef ASM_SPEC
-#define ASM_SPEC ""
-
diff --git a/gcc/config/spu/spu.c b/gcc/config/spu/spu.c
index 324ac4df21c..d80d86d8cc9 100644
--- a/gcc/config/spu/spu.c
+++ b/gcc/config/spu/spu.c
@@ -5641,6 +5641,19 @@ spu_init_libfuncs (void)
set_conv_libfunc (ufloat_optab, DFmode, SImode, "__float_unssidf");
set_conv_libfunc (ufloat_optab, DFmode, DImode, "__float_unsdidf");
+ set_optab_libfunc (addv_optab, SImode, "__addvsi3");
+ set_optab_libfunc (subv_optab, SImode, "__subvsi3");
+ set_optab_libfunc (smulv_optab, SImode, "__mulvsi3");
+ set_optab_libfunc (sdivv_optab, SImode, "__divvsi3");
+ set_optab_libfunc (negv_optab, SImode, "__negvsi2");
+ set_optab_libfunc (absv_optab, SImode, "__absvsi2");
+ set_optab_libfunc (addv_optab, DImode, "__addvdi3");
+ set_optab_libfunc (subv_optab, DImode, "__subvdi3");
+ set_optab_libfunc (smulv_optab, DImode, "__mulvdi3");
+ set_optab_libfunc (sdivv_optab, DImode, "__divvdi3");
+ set_optab_libfunc (negv_optab, DImode, "__negvdi2");
+ set_optab_libfunc (absv_optab, DImode, "__absvdi2");
+
set_optab_libfunc (smul_optab, TImode, "__multi3");
set_optab_libfunc (sdiv_optab, TImode, "__divti3");
set_optab_libfunc (smod_optab, TImode, "__modti3");
diff --git a/gcc/config/stormy16/constraints.md b/gcc/config/stormy16/constraints.md
new file mode 100644
index 00000000000..5ad17bdbfd9
--- /dev/null
+++ b/gcc/config/stormy16/constraints.md
@@ -0,0 +1,119 @@
+;; Constraint definitions for XSTORMY16.
+;; Copyright (C) 2011 Free Software Foundation, Inc.
+;;
+;; This file is part of GCC.
+;;
+;; GCC is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 3, or (at your option)
+;; any later version.
+;;
+;; GCC is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+;;
+;; You should have received a copy of the GNU General Public License
+;; along with GCC; see the file COPYING3. If not see
+;; <http://www.gnu.org/licenses/>.
+
+;; Register constraints.
+(define_register_constraint "a" "R0_REGS"
+ "@internal")
+
+(define_register_constraint "b" "R1_REGS"
+ "@internal")
+
+(define_register_constraint "c" "R2_REGS"
+ "@internal")
+
+(define_register_constraint "d" "R8_REGS"
+ "@internal")
+
+(define_register_constraint "e" "EIGHT_REGS"
+ "@internal")
+
+(define_register_constraint "t" "TWO_REGS"
+ "@internal")
+
+(define_register_constraint "z" "ICALL_REGS"
+ "@internal")
+
+;; Integer constraints.
+(define_constraint "I"
+ "An integer between 0 and 3."
+ (and (match_code "const_int")
+ (match_test "IN_RANGE (ival, 0, 3)")))
+
+(define_constraint "J"
+ "A power of two."
+ (and (match_code "const_int")
+ (match_test "exact_log2 (ival) != -1")))
+
+(define_constraint "K"
+ "A power of two when inverted."
+ (and (match_code "const_int")
+ (match_test "exact_log2 (~ival) != -1")))
+
+(define_constraint "L"
+ "An 8-bit unsigned integer."
+ (and (match_code "const_int")
+ (match_test "IN_RANGE (ival, 0, 255)")))
+
+(define_constraint "M"
+ "An integer between -255 and 0."
+ (and (match_code "const_int")
+ (match_test "IN_RANGE (ival, -255, 0)")))
+
+(define_constraint "N"
+ "An integer between -3 and 0."
+ (and (match_code "const_int")
+ (match_test "IN_RANGE (ival, -3, 0)")))
+
+(define_constraint "O"
+ "An integer between 1 and 4."
+ (and (match_code "const_int")
+ (match_test "IN_RANGE (ival, 1, 4)")))
+
+(define_constraint "P"
+ "An integer between -4 and -1."
+ (and (match_code "const_int")
+ (match_test "IN_RANGE (ival, -4, -1)")))
+
+;; Extra constraints.
+(define_constraint "Q"
+ "A register push operation."
+ (and (match_code "mem")
+ (match_code "post_inc" "0")
+ (match_test "XEXP (XEXP (op, 0), 0) == stack_pointer_rtx")))
+
+(define_constraint "R"
+ "A register pop operation."
+ (and (match_code "mem")
+ (match_code "pre_dec" "0")
+ (match_test "XEXP (XEXP (op, 0), 0) == stack_pointer_rtx")))
+
+(define_constraint "S"
+ "An immediate memory address."
+ (and (match_code "mem")
+ (match_code "const_int" "0")
+ (match_test "xstormy16_legitimate_address_p (VOIDmode, XEXP (op, 0), false)")))
+
+(define_constraint "T"
+ "@internal"
+ ;; For Rx; not implemented yet.
+ (match_test "0"))
+
+(define_constraint "U"
+ "An integer not between 2 and 15."
+ (and (match_code "const_int")
+ (match_test "!IN_RANGE (ival, 2, 15)")))
+
+(define_constraint "W"
+ "@internal"
+ (match_operand 0 "xstormy16_below100_operand"))
+
+(define_constraint "Z"
+ "Zero."
+ (and (match_code "const_int")
+ (match_test "ival == 0"))) \ No newline at end of file
diff --git a/gcc/config/stormy16/predicates.md b/gcc/config/stormy16/predicates.md
index 0e1d39431f7..7270c7fe7a7 100644
--- a/gcc/config/stormy16/predicates.md
+++ b/gcc/config/stormy16/predicates.md
@@ -140,8 +140,8 @@
{
/* 'Q' is for pushes, 'R' for pops. */
return (nonimmediate_operand (op, mode)
- && ! xstormy16_extra_constraint_p (op, 'Q')
- && ! xstormy16_extra_constraint_p (op, 'R'));
+ && ! satisfies_constraint_Q (op)
+ && ! satisfies_constraint_R (op));
})
(define_predicate "xstormy16_carry_plus_operand"
diff --git a/gcc/config/stormy16/stormy16-protos.h b/gcc/config/stormy16/stormy16-protos.h
index 3edbc33959f..e9842ea09ca 100644
--- a/gcc/config/stormy16/stormy16-protos.h
+++ b/gcc/config/stormy16/stormy16-protos.h
@@ -1,5 +1,5 @@
/* Prototypes for exported functions defined in xstormy16.c
- Copyright (C) 2000, 2001, 2003, 2004, 2007, 2008, 2010
+ Copyright (C) 2000, 2001, 2003, 2004, 2007, 2008, 2010, 2011
Free Software Foundation, Inc.
Contributed by Red Hat, Inc.
@@ -44,8 +44,6 @@ extern rtx xstormy16_function_value (const_tree, const_tree);
extern void xstormy16_emit_cbranch (enum rtx_code, rtx, rtx, rtx);
extern char *xstormy16_output_cbranch_hi (rtx, const char *, int, rtx);
extern char *xstormy16_output_cbranch_si (rtx, const char *, int, rtx);
-extern int xstormy16_mode_dependent_address_p (rtx);
-extern int xstormy16_extra_constraint_p (rtx, int);
extern void xstormy16_print_operand (FILE *, rtx, int);
extern void xstormy16_print_operand_address (FILE *, rtx);
@@ -63,7 +61,6 @@ extern int short_memory_operand (rtx, enum machine_mode);
extern int nonimmediate_nonstack_operand (rtx, enum machine_mode);
extern enum reg_class xstormy16_secondary_reload_class
(enum reg_class, enum machine_mode, rtx);
-extern enum reg_class xstormy16_preferred_reload_class (rtx, enum reg_class);
extern void xstormy16_split_move (enum machine_mode, rtx, rtx);
extern void xstormy16_expand_move (enum machine_mode, rtx, rtx);
extern void xstormy16_expand_arith (enum machine_mode, enum rtx_code,
@@ -72,5 +69,6 @@ extern const char * xstormy16_output_shift (enum machine_mode, enum rtx_code,
rtx, rtx, rtx);
extern int xstormy16_below100_symbol (rtx, enum machine_mode);
extern int xstormy16_splittable_below100_operand (rtx, enum machine_mode);
+extern bool xstormy16_legitimate_address_p (enum machine_mode, rtx, bool);
#endif
diff --git a/gcc/config/stormy16/stormy16.c b/gcc/config/stormy16/stormy16.c
index fa5c5b5a8dc..03253ddc22e 100644
--- a/gcc/config/stormy16/stormy16.c
+++ b/gcc/config/stormy16/stormy16.c
@@ -1,6 +1,6 @@
/* Xstormy16 target functions.
Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
- 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+ 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
Contributed by Red Hat, Inc.
This file is part of GCC.
@@ -469,8 +469,11 @@ xstormy16_secondary_reload_class (enum reg_class rclass,
return NO_REGS;
}
-enum reg_class
-xstormy16_preferred_reload_class (rtx x, enum reg_class rclass)
+/* Worker function for TARGET_PREFERRED_RELOAD_CLASS
+ and TARGET_PREFERRED_OUTPUT_RELOAD_CLASS. */
+
+static reg_class_t
+xstormy16_preferred_reload_class (rtx x, reg_class_t rclass)
{
if (rclass == GENERAL_REGS && MEM_P (x))
return EIGHT_REGS;
@@ -615,7 +618,7 @@ xstormy16_expand_andqi3 (rtx *operands)
&& INTVAL (X) + (OFFSET) < 0x8000 \
&& (INTVAL (X) + (OFFSET) < 0x100 || INTVAL (X) + (OFFSET) >= 0x7F00))
-static bool
+bool
xstormy16_legitimate_address_p (enum machine_mode mode ATTRIBUTE_UNUSED,
rtx x, bool strict)
{
@@ -647,94 +650,27 @@ xstormy16_legitimate_address_p (enum machine_mode mode ATTRIBUTE_UNUSED,
return false;
}
-/* Return nonzero if memory address X (an RTX) can have different
- meanings depending on the machine mode of the memory reference it
- is used for or if the address is valid for some modes but not
- others.
-
- Autoincrement and autodecrement addresses typically have mode-dependent
- effects because the amount of the increment or decrement is the size of the
- operand being addressed. Some machines have other mode-dependent addresses.
- Many RISC machines have no mode-dependent addresses.
-
- You may assume that ADDR is a valid address for the machine.
+/* Worker function for TARGET_MODE_DEPENDENT_ADDRESS_P.
On this chip, this is true if the address is valid with an offset
of 0 but not of 6, because in that case it cannot be used as an
address for DImode or DFmode, or if the address is a post-increment
or pre-decrement address. */
-int
-xstormy16_mode_dependent_address_p (rtx x)
+static bool
+xstormy16_mode_dependent_address_p (const_rtx x)
{
if (LEGITIMATE_ADDRESS_CONST_INT_P (x, 0)
&& ! LEGITIMATE_ADDRESS_CONST_INT_P (x, 6))
- return 1;
+ return true;
if (GET_CODE (x) == PLUS
&& LEGITIMATE_ADDRESS_INTEGER_P (XEXP (x, 1), 0)
&& ! LEGITIMATE_ADDRESS_INTEGER_P (XEXP (x, 1), 6))
- return 1;
-
- if (GET_CODE (x) == PLUS)
- x = XEXP (x, 0);
+ return true;
/* Auto-increment addresses are now treated generically in recog.c. */
- return 0;
-}
-
-/* A C expression that defines the optional machine-dependent constraint
- letters (`Q', `R', `S', `T', `U') that can be used to segregate specific
- types of operands, usually memory references, for the target machine.
- Normally this macro will not be defined. If it is required for a particular
- target machine, it should return 1 if VALUE corresponds to the operand type
- represented by the constraint letter C. If C is not defined as an extra
- constraint, the value returned should be 0 regardless of VALUE. */
-
-int
-xstormy16_extra_constraint_p (rtx x, int c)
-{
- switch (c)
- {
- /* 'Q' is for pushes. */
- case 'Q':
- return (MEM_P (x)
- && GET_CODE (XEXP (x, 0)) == POST_INC
- && XEXP (XEXP (x, 0), 0) == stack_pointer_rtx);
-
- /* 'R' is for pops. */
- case 'R':
- return (MEM_P (x)
- && GET_CODE (XEXP (x, 0)) == PRE_DEC
- && XEXP (XEXP (x, 0), 0) == stack_pointer_rtx);
-
- /* 'S' is for immediate memory addresses. */
- case 'S':
- return (MEM_P (x)
- && CONST_INT_P (XEXP (x, 0))
- && xstormy16_legitimate_address_p (VOIDmode, XEXP (x, 0), 0));
-
- /* 'T' is for Rx. */
- case 'T':
- /* Not implemented yet. */
- return 0;
-
- /* 'U' is for CONST_INT values not between 2 and 15 inclusive,
- for allocating a scratch register for 32-bit shifts. */
- case 'U':
- return (CONST_INT_P (x) && (! IN_RANGE (INTVAL (x), 2, 15)));
-
- /* 'Z' is for CONST_INT value zero. This is for adding zero to
- a register in addhi3, which would otherwise require a carry. */
- case 'Z':
- return (CONST_INT_P (x) && (INTVAL (x) == 0));
-
- case 'W':
- return xstormy16_below100_operand (x, GET_MODE (x));
-
- default:
- return 0;
- }
+ return false;
}
int
@@ -2671,8 +2607,15 @@ static const struct default_options xstorym16_option_optimization_table[] =
#undef TARGET_MACHINE_DEPENDENT_REORG
#define TARGET_MACHINE_DEPENDENT_REORG xstormy16_reorg
+#undef TARGET_PREFERRED_RELOAD_CLASS
+#define TARGET_PREFERRED_RELOAD_CLASS xstormy16_preferred_reload_class
+#undef TARGET_PREFERRED_OUTPUT_RELOAD_CLASS
+#define TARGET_PREFERRED_OUTPUT_RELOAD_CLASS xstormy16_preferred_reload_class
+
#undef TARGET_LEGITIMATE_ADDRESS_P
#define TARGET_LEGITIMATE_ADDRESS_P xstormy16_legitimate_address_p
+#undef TARGET_MODE_DEPENDENT_ADDRESS_P
+#define TARGET_MODE_DEPENDENT_ADDRESS_P xstormy16_mode_dependent_address_p
#undef TARGET_CAN_ELIMINATE
#define TARGET_CAN_ELIMINATE xstormy16_can_eliminate
diff --git a/gcc/config/stormy16/stormy16.h b/gcc/config/stormy16/stormy16.h
index 8789d90105e..7b8f50767bb 100644
--- a/gcc/config/stormy16/stormy16.h
+++ b/gcc/config/stormy16/stormy16.h
@@ -1,6 +1,6 @@
/* Xstormy16 cpu description.
Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2007,
- 2008, 2009, 2010 Free Software Foundation, Inc.
+ 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
Contributed by Red Hat, Inc.
This file is part of GCC.
@@ -225,36 +225,10 @@ enum reg_class
#define INDEX_REG_CLASS GENERAL_REGS
-/* The following letters are unavailable, due to being used as
- constraints:
- '0'..'9'
- '<', '>'
- 'E', 'F', 'G', 'H'
- 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P'
- 'Q', 'R', 'S', 'T', 'U'
- 'V', 'X'
- 'g', 'i', 'm', 'n', 'o', 'p', 'r', 's'. */
-
-#define REG_CLASS_FROM_LETTER(CHAR) \
- ( (CHAR) == 'a' ? R0_REGS \
- : (CHAR) == 'b' ? R1_REGS \
- : (CHAR) == 'c' ? R2_REGS \
- : (CHAR) == 'd' ? R8_REGS \
- : (CHAR) == 'e' ? EIGHT_REGS \
- : (CHAR) == 't' ? TWO_REGS \
- : (CHAR) == 'z' ? ICALL_REGS \
- : NO_REGS)
-
#define REGNO_OK_FOR_BASE_P(NUM) 1
#define REGNO_OK_FOR_INDEX_P(NUM) REGNO_OK_FOR_BASE_P (NUM)
-#define PREFERRED_RELOAD_CLASS(X, CLASS) \
- xstormy16_preferred_reload_class (X, CLASS)
-
-#define PREFERRED_OUTPUT_RELOAD_CLASS(X, CLASS) \
- xstormy16_preferred_reload_class (X, CLASS)
-
/* This chip has the interesting property that only the first eight
registers can be moved to/from memory. */
#define SECONDARY_RELOAD_CLASS(CLASS, MODE, X) \
@@ -263,22 +237,6 @@ enum reg_class
#define CLASS_MAX_NREGS(CLASS, MODE) \
((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)
-#define CONST_OK_FOR_LETTER_P(VALUE, C) \
- ( (C) == 'I' ? (VALUE) >= 0 && (VALUE) <= 3 \
- : (C) == 'J' ? exact_log2 (VALUE) != -1 \
- : (C) == 'K' ? exact_log2 (~(VALUE)) != -1 \
- : (C) == 'L' ? (VALUE) >= 0 && (VALUE) <= 255 \
- : (C) == 'M' ? (VALUE) >= -255 && (VALUE) <= 0 \
- : (C) == 'N' ? (VALUE) >= -3 && (VALUE) <= 0 \
- : (C) == 'O' ? (VALUE) >= 1 && (VALUE) <= 4 \
- : (C) == 'P' ? (VALUE) >= -4 && (VALUE) <= -1 \
- : 0 )
-
-#define CONST_DOUBLE_OK_FOR_LETTER_P(VALUE, C) 0
-
-#define EXTRA_CONSTRAINT(VALUE, C) \
- xstormy16_extra_constraint_p (VALUE, C)
-
/* Basic Stack Layout. */
@@ -398,23 +356,6 @@ enum reg_class
#define MAX_REGS_PER_ADDRESS 1
-#ifdef REG_OK_STRICT
-#define REG_OK_FOR_BASE_P(X) \
- (REGNO_OK_FOR_BASE_P (REGNO (X)) && (REGNO (X) < FIRST_PSEUDO_REGISTER))
-#else
-#define REG_OK_FOR_BASE_P(X) REGNO_OK_FOR_BASE_P (REGNO (X))
-#endif
-
-#define REG_OK_FOR_INDEX_P(X) REG_OK_FOR_BASE_P (X)
-
-/* On this chip, this is true if the address is valid with an offset
- of 0 but not of 6, because in that case it cannot be used as an
- address for DImode or DFmode, or if the address is a post-increment
- or pre-decrement address. */
-#define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR,LABEL) \
- if (xstormy16_mode_dependent_address_p (ADDR)) \
- goto LABEL
-
#define LEGITIMATE_CONSTANT_P(X) 1
diff --git a/gcc/config/stormy16/stormy16.md b/gcc/config/stormy16/stormy16.md
index 8c6fd9d0f9c..3eb74b72e0f 100644
--- a/gcc/config/stormy16/stormy16.md
+++ b/gcc/config/stormy16/stormy16.md
@@ -95,6 +95,7 @@
(set_attr "psw_operand" "clobber")])
(include "predicates.md")
+(include "constraints.md")
;; ::::::::::::::::::::
;; ::
diff --git a/gcc/config/t-darwin b/gcc/config/t-darwin
index 24a7b90c3e2..ff607878291 100644
--- a/gcc/config/t-darwin
+++ b/gcc/config/t-darwin
@@ -17,6 +17,8 @@
# along with GCC; see the file COPYING3. If not see
# <http://www.gnu.org/licenses/>.
+TM_H += $(srcdir)/config/darwin-sections.def
+
darwin.o: $(srcdir)/config/darwin.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
$(TM_H) $(RTL_H) $(REGS_H) hard-reg-set.h $(REAL_H) insn-config.h \
conditions.h insn-flags.h output.h insn-attr.h flags.h $(TREE_H) expr.h \
diff --git a/gcc/config/v850/constraints.md b/gcc/config/v850/constraints.md
new file mode 100644
index 00000000000..eecdab3d4ef
--- /dev/null
+++ b/gcc/config/v850/constraints.md
@@ -0,0 +1,108 @@
+;; Constraint definitions for V850.
+;; Copyright (C) 2011 Free Software Foundation, Inc.
+;;
+;; This file is part of GCC.
+;;
+;; GCC is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 3, or (at your option)
+;; any later version.
+;;
+;; GCC is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+;;
+;; You should have received a copy of the GNU General Public License
+;; along with GCC; see the file COPYING3. If not see
+;; <http://www.gnu.org/licenses/>.
+
+(define_register_constraint "e" "EVEN_REGS"
+ "@internal")
+
+;; Integer constraints.
+(define_constraint "I"
+ "Integer constant 0."
+ (and (match_code "const_int")
+ (match_test "ival == 0")))
+
+(define_constraint "J"
+ "A signed 5-bit immediate."
+ (and (match_code "const_int")
+ (match_test "ival >= -16 && ival <= 15")))
+
+(define_constraint "K"
+ "A signed 16-bit immediate."
+ (and (match_code "const_int")
+ (match_test "ival >= -32768 && ival <= 32767")))
+
+(define_constraint "L"
+ "A valid constant for a movhi instruction."
+ (and (match_code "const_int")
+ (ior (match_test "(ival | 0x7fff0000) == 0x7fff0000")
+ (match_test "(ival | 0x7fff0000) + 0x10000 == 0"))))
+
+(define_constraint "M"
+ "An unsigned 16-bit immediate."
+ (and (match_code "const_int")
+ (match_test "ival >= 0 && ival <= 65535")))
+
+(define_constraint "N"
+ "An unsigned 5-bit immediate in shift instructions."
+ (and (match_code "const_int")
+ (match_test "ival >= 0 && ival <= 31")))
+
+(define_constraint "O"
+ "A signed 9-bit immediate for word multiply instructions."
+ (and (match_code "const_int")
+ (match_test "ival >= -255 && ival <= 255")))
+
+(define_constraint "P"
+ "@internal"
+ (and (match_code "const_int")
+ (match_test "0")))
+
+;; Floating-point constraints.
+(define_constraint "G"
+ "A zero of some form."
+ (and (match_code "const_double")
+ (ior (match_test "GET_MODE_CLASS (mode) == MODE_FLOAT")
+ (match_test "GET_MODE_CLASS (mode) == MODE_INT"))
+ (match_test "op == CONST0_RTX (mode)")))
+
+(define_constraint "H"
+ "@internal"
+ (and (match_code "const_double")
+ (match_test "0")))
+
+;;; Extra constraints.
+(define_constraint "Q"
+ "A memory address that does not contain a symbol address."
+ (and (match_code "mem")
+ (match_test "ep_memory_operand (op, mode, FALSE)")))
+
+(define_constraint "R"
+ "@internal"
+ (match_test "special_symbolref_operand (op, VOIDmode)"))
+
+(define_constraint "S"
+ "@internal"
+ (and (match_code "symbol_ref")
+ (match_test "!SYMBOL_REF_ZDA_P (op)")))
+
+(define_constraint "T"
+ "@internal"
+ (match_test "ep_memory_operand (op, mode, TRUE)"))
+
+(define_constraint "U"
+ "@internal"
+ (ior (and (match_code "symbol_ref")
+ (match_test "SYMBOL_REF_ZDA_P (op)"))
+ (and (match_code "const")
+ (match_test "GET_CODE (XEXP (op, 0)) == PLUS")
+ (match_test "GET_CODE (XEXP (XEXP (op, 0), 0)) == SYMBOL_REF")
+ (match_test "SYMBOL_REF_ZDA_P (XEXP (XEXP (op, 0), 0))"))))
+
+(define_constraint "W"
+ "@internal"
+ (match_test "disp23_operand (op, VOIDmode)"))
diff --git a/gcc/config/v850/predicates.md b/gcc/config/v850/predicates.md
index a47453fd1d8..129f00d595f 100644
--- a/gcc/config/v850/predicates.md
+++ b/gcc/config/v850/predicates.md
@@ -26,7 +26,7 @@
return INTVAL (op) == 0;
else if (GET_CODE (op) == CONST_DOUBLE)
- return CONST_DOUBLE_OK_FOR_G (op);
+ return satisfies_constraint_G (op);
else
return register_operand (op, mode);
@@ -129,8 +129,7 @@
{
if (GET_CODE (op) == CONST
&& GET_CODE (XEXP (op, 0)) == PLUS
- && GET_CODE (XEXP (XEXP (op, 0), 1)) == CONST_INT
- && CONST_OK_FOR_K (INTVAL (XEXP (XEXP (op, 0), 1))))
+ && satisfies_constraint_K (XEXP (XEXP (op, 0), 1)))
op = XEXP (XEXP (op, 0), 0);
if (GET_CODE (op) == SYMBOL_REF)
diff --git a/gcc/config/v850/v850.h b/gcc/config/v850/v850.h
index f7926f33121..892a34c6305 100644
--- a/gcc/config/v850/v850.h
+++ b/gcc/config/v850/v850.h
@@ -98,9 +98,15 @@ extern GTY(()) rtx v850_compare_op1;
#define TARGET_V850E2_ALL (TARGET_V850E2 || TARGET_V850E2V3)
-#define ASM_SPEC "%{mv*:-mv%*}"
-#define CPP_SPEC "%{mv850e2v3:-D__v850e2v3__} %{mv850e2:-D__v850e2__} %{mv850e:-D__v850e__} %{mv850:-D__v850__} %(subtarget_cpp_spec)" \
- " %{mep:-D__EP__}"
+#define ASM_SPEC "%{mv850es:-mv850e1}%{!mv850es:%{mv*:-mv%*}}"
+#define CPP_SPEC "\
+ %{mv850e2v3:-D__v850e2v3__} \
+ %{mv850e2:-D__v850e2__} \
+ %{mv850es:-D__v850e1__} \
+ %{mv850e1:-D__v850e1__} \
+ %{mv850:-D__v850__} \
+ %(subtarget_cpp_spec)" \
+ " %{mep:-D__EP__}"
#define EXTRA_SPECS \
{ "subtarget_asm_spec", SUBTARGET_ASM_SPEC }, \
@@ -351,11 +357,6 @@ enum reg_class
#define INDEX_REG_CLASS NO_REGS
#define BASE_REG_CLASS GENERAL_REGS
-/* Get reg_class from a letter such as appears in the machine description. */
-
-#define REG_CLASS_FROM_LETTER(C) \
- (C == 'e' ? EVEN_REGS : (NO_REGS))
-
/* Macros to check register numbers against specific register classes. */
/* These assume that REGNO is a hard or pseudo reg number.
@@ -378,62 +379,22 @@ enum reg_class
#define CLASS_MAX_NREGS(CLASS, MODE) \
((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)
-/* The letters I, J, K, L, M, N, O, P in a register constraint string
- can be used to stand for particular ranges of immediate operands.
- This macro defines what the ranges are.
- C is the letter, and VALUE is a constant value.
- Return 1 if VALUE is in the range specified by C. */
-
-#define INT_7_BITS(VALUE) ((unsigned) (VALUE) + 0x40 < 0x80)
-#define INT_8_BITS(VALUE) ((unsigned) (VALUE) + 0x80 < 0x100)
-/* zero */
-#define CONST_OK_FOR_I(VALUE) ((VALUE) == 0)
-/* 5-bit signed immediate */
-#define CONST_OK_FOR_J(VALUE) ((unsigned) (VALUE) + 0x10 < 0x20)
-/* 16-bit signed immediate */
-#define CONST_OK_FOR_K(VALUE) ((unsigned) (VALUE) + 0x8000 < 0x10000)
-/* valid constant for movhi instruction. */
-#define CONST_OK_FOR_L(VALUE) \
- (((unsigned) ((int) (VALUE) >> 16) + 0x8000 < 0x10000) \
- && CONST_OK_FOR_I ((VALUE & 0xffff)))
-/* 16-bit unsigned immediate */
-#define CONST_OK_FOR_M(VALUE) ((unsigned)(VALUE) < 0x10000)
-/* 5-bit unsigned immediate in shift instructions */
-#define CONST_OK_FOR_N(VALUE) ((unsigned) (VALUE) <= 31)
-/* 9-bit signed immediate for word multiply instruction. */
-#define CONST_OK_FOR_O(VALUE) ((unsigned) (VALUE) + 0x100 < 0x200)
-
-#define CONST_OK_FOR_P(VALUE) 0
-
-#define CONST_OK_FOR_LETTER_P(VALUE, C) \
- ((C) == 'I' ? CONST_OK_FOR_I (VALUE) : \
- (C) == 'J' ? CONST_OK_FOR_J (VALUE) : \
- (C) == 'K' ? CONST_OK_FOR_K (VALUE) : \
- (C) == 'L' ? CONST_OK_FOR_L (VALUE) : \
- (C) == 'M' ? CONST_OK_FOR_M (VALUE) : \
- (C) == 'N' ? CONST_OK_FOR_N (VALUE) : \
- (C) == 'O' ? CONST_OK_FOR_O (VALUE) : \
- (C) == 'P' ? CONST_OK_FOR_P (VALUE) : \
- 0)
-
-/* Similar, but for floating constants, and defining letters G and H.
- Here VALUE is the CONST_DOUBLE rtx itself.
-
- `G' is a zero of some form. */
+/* Convenience wrappers around insn_const_int_ok_for_constraint. */
-#define CONST_DOUBLE_OK_FOR_G(VALUE) \
- ((GET_MODE_CLASS (GET_MODE (VALUE)) == MODE_FLOAT \
- && (VALUE) == CONST0_RTX (GET_MODE (VALUE))) \
- || (GET_MODE_CLASS (GET_MODE (VALUE)) == MODE_INT \
- && CONST_DOUBLE_LOW (VALUE) == 0 \
- && CONST_DOUBLE_HIGH (VALUE) == 0))
-
-#define CONST_DOUBLE_OK_FOR_H(VALUE) 0
-
-#define CONST_DOUBLE_OK_FOR_LETTER_P(VALUE, C) \
- ((C) == 'G' ? CONST_DOUBLE_OK_FOR_G (VALUE) \
- : (C) == 'H' ? CONST_DOUBLE_OK_FOR_H (VALUE) \
- : 0)
+#define CONST_OK_FOR_I(VALUE) \
+ insn_const_int_ok_for_constraint (VALUE, CONSTRAINT_I)
+#define CONST_OK_FOR_J(VALUE) \
+ insn_const_int_ok_for_constraint (VALUE, CONSTRAINT_J)
+#define CONST_OK_FOR_K(VALUE) \
+ insn_const_int_ok_for_constraint (VALUE, CONSTRAINT_K)
+#define CONST_OK_FOR_L(VALUE) \
+ insn_const_int_ok_for_constraint (VALUE, CONSTRAINT_L)
+#define CONST_OK_FOR_M(VALUE) \
+ insn_const_int_ok_for_constraint (VALUE, CONSTRAINT_M)
+#define CONST_OK_FOR_N(VALUE) \
+ insn_const_int_ok_for_constraint (VALUE, CONSTRAINT_N)
+#define CONST_OK_FOR_O(VALUE) \
+ insn_const_int_ok_for_constraint (VALUE, CONSTRAINT_O)
/* Stack layout; function entry, exit and calling. */
@@ -617,9 +578,7 @@ struct cum_arg { int nbytes; int anonymous_args; };
/* ??? This seems too exclusive. May get better code by accepting more
possibilities here, in particular, should accept ZDA_NAME SYMBOL_REFs. */
-#define CONSTANT_ADDRESS_P(X) \
- (GET_CODE (X) == CONST_INT \
- && CONST_OK_FOR_K (INTVAL (X)))
+#define CONSTANT_ADDRESS_P(X) constraint_satisfied_p (X, CONSTRAINT_K)
/* Maximum number of registers that can appear in a valid memory address. */
@@ -660,39 +619,6 @@ struct cum_arg { int nbytes; int anonymous_args; };
#endif
-/* A C expression that defines the optional machine-dependent
- constraint letters that can be used to segregate specific types of
- operands, usually memory references, for the target machine.
- Normally this macro will not be defined. If it is required for a
- particular target machine, it should return 1 if VALUE corresponds
- to the operand type represented by the constraint letter C. If C
- is not defined as an extra constraint, the value returned should
- be 0 regardless of VALUE.
-
- For example, on the ROMP, load instructions cannot have their
- output in r0 if the memory reference contains a symbolic address.
- Constraint letter `Q' is defined as representing a memory address
- that does *not* contain a symbolic address. An alternative is
- specified with a `Q' constraint on the input and `r' on the
- output. The next alternative specifies `m' on the input and a
- register class that does not include r0 on the output. */
-
-#define EXTRA_CONSTRAINT(OP, C) \
- ((C) == 'Q' ? ep_memory_operand (OP, GET_MODE (OP), FALSE) \
- : (C) == 'R' ? special_symbolref_operand (OP, VOIDmode) \
- : (C) == 'S' ? (GET_CODE (OP) == SYMBOL_REF \
- && !SYMBOL_REF_ZDA_P (OP)) \
- : (C) == 'T' ? ep_memory_operand (OP, GET_MODE (OP), TRUE) \
- : (C) == 'U' ? ((GET_CODE (OP) == SYMBOL_REF \
- && SYMBOL_REF_ZDA_P (OP)) \
- || (GET_CODE (OP) == CONST \
- && GET_CODE (XEXP (OP, 0)) == PLUS \
- && GET_CODE (XEXP (XEXP (OP, 0), 0)) == SYMBOL_REF\
- && SYMBOL_REF_ZDA_P (XEXP (XEXP (OP, 0), 0)))) \
- : (C) == 'W' ? (GET_CODE (OP) == CONST_INT \
- && ((unsigned)(INTVAL (OP)) >= 0x8000) \
- && ((unsigned)(INTVAL (OP)) < 0x400000)) \
- : 0)
/* GO_IF_LEGITIMATE_ADDRESS recognizes an RTL expression
that is a valid memory address for an instruction.
@@ -732,7 +658,7 @@ do { \
goto ADDR; \
if (GET_CODE (X) == PLUS \
&& RTX_OK_FOR_BASE_P (XEXP (X, 0)) \
- && (GET_CODE (XEXP (X,1)) == CONST_INT && CONST_OK_FOR_K (INTVAL(XEXP (X,1)) + GET_MODE_NUNITS(MODE) * UNITS_PER_WORD)) \
+ && constraint_satisfied_p (XEXP (X,1), CONSTRAINT_K) \
&& ((MODE == QImode || INTVAL (XEXP (X, 1)) % 2 == 0) \
&& CONST_OK_FOR_K (INTVAL (XEXP (X, 1)) \
+ (GET_MODE_NUNITS (MODE) * UNITS_PER_WORD)))) \
diff --git a/gcc/config/v850/v850.md b/gcc/config/v850/v850.md
index 26bc5838e6d..88e42c65e90 100644
--- a/gcc/config/v850/v850.md
+++ b/gcc/config/v850/v850.md
@@ -100,6 +100,7 @@
"nothing")
(include "predicates.md")
+(include "constraints.md")
;; ----------------------------------------------------------------------
;; MOVE INSTRUCTIONS
diff --git a/gcc/config/v850/v850.opt b/gcc/config/v850/v850.opt
index 6fe0414e459..0ae14313ffe 100644
--- a/gcc/config/v850/v850.opt
+++ b/gcc/config/v850/v850.opt
@@ -68,11 +68,11 @@ Set the max size of data eligible for the TDA area
mno-strict-align
Target Report Mask(NO_STRICT_ALIGN)
-Enforce strict alignment
+Do not enforce strict alignment
mjump-tables-in-data-section
Target Report Mask(JUMP_TABLES_IN_DATA_SECTION)
-Enforce table jump
+Put jump tables for switch statements into the .data section rather than the .code section
mUS-bit-set
Target Report Mask(US_BIT_SET)
@@ -89,6 +89,10 @@ mv850e1
Target RejectNegative Mask(V850E1)
Compile for the v850e1 processor
+mv850es
+Target RejectNegative Mask(V850E1) MaskExists
+Compile for the v850es variant of the v850e1
+
mv850e2
Target Report RejectNegative Mask(V850E2)
Compile for the v850e2 processor
diff --git a/gcc/config/vax/elf.opt b/gcc/config/vax/elf.opt
new file mode 100644
index 00000000000..6296f75674b
--- /dev/null
+++ b/gcc/config/vax/elf.opt
@@ -0,0 +1,30 @@
+; VAX ELF options.
+
+; Copyright (C) 2011
+; Free Software Foundation, Inc.
+;
+; This file is part of GCC.
+;
+; GCC is free software; you can redistribute it and/or modify it under
+; the terms of the GNU General Public License as published by the Free
+; Software Foundation; either version 3, or (at your option) any later
+; version.
+;
+; GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+; WARRANTY; without even the implied warranty of MERCHANTABILITY or
+; FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+; for more details.
+;
+; You should have received a copy of the GNU General Public License
+; along with GCC; see the file COPYING3. If not see
+; <http://www.gnu.org/licenses/>.
+
+; See the GCC internals manual (options.texi) for a description of
+; this file's format.
+
+; Please try to keep this file in ASCII collating order.
+
+mno-asm-pic
+Target RejectNegative
+
+; This comment is to ensure we retain the blank line above.
diff --git a/gcc/config/vms/vms.opt b/gcc/config/vms/vms.opt
index dd4b46b333e..a1713b81154 100644
--- a/gcc/config/vms/vms.opt
+++ b/gcc/config/vms/vms.opt
@@ -1,4 +1,4 @@
-; Copyright (C) 2009 Free Software Foundation, Inc.
+; Copyright (C) 2009, 2011 Free Software Foundation, Inc.
;
; This file is part of GCC.
;
@@ -16,6 +16,9 @@
; along with GCC; see the file COPYING3. If not see
; <http://www.gnu.org/licenses/>.
+map
+Target RejectNegative
+
mmalloc64
Target Report Mask(MALLOC64)
Malloc data into P2 space
@@ -23,3 +26,6 @@ Malloc data into P2 space
mdebug-main=
Target RejectNegative Joined Var(vms_debug_main)
Set name of main routine for the debugger
+
+mvms-return-codes
+Target RejectNegative
diff --git a/gcc/config/xtensa/elf.opt b/gcc/config/xtensa/elf.opt
new file mode 100644
index 00000000000..bdeac15b24b
--- /dev/null
+++ b/gcc/config/xtensa/elf.opt
@@ -0,0 +1,30 @@
+; Xtensa ELF (bare metal) options.
+
+; Copyright (C) 2011
+; Free Software Foundation, Inc.
+;
+; This file is part of GCC.
+;
+; GCC is free software; you can redistribute it and/or modify it under
+; the terms of the GNU General Public License as published by the Free
+; Software Foundation; either version 3, or (at your option) any later
+; version.
+;
+; GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+; WARRANTY; without even the implied warranty of MERCHANTABILITY or
+; FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+; for more details.
+;
+; You should have received a copy of the GNU General Public License
+; along with GCC; see the file COPYING3. If not see
+; <http://www.gnu.org/licenses/>.
+
+; See the GCC internals manual (options.texi) for a description of
+; this file's format.
+
+; Please try to keep this file in ASCII collating order.
+
+rdynamic
+Driver
+
+; This comment is to ensure we retain the blank line above.
diff --git a/gcc/config/xtensa/xtensa-protos.h b/gcc/config/xtensa/xtensa-protos.h
index 356e0f12074..0d1738f4e8b 100644
--- a/gcc/config/xtensa/xtensa-protos.h
+++ b/gcc/config/xtensa/xtensa-protos.h
@@ -1,5 +1,5 @@
/* Prototypes of target machine for GNU compiler for Xtensa.
- Copyright 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010
+ Copyright 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010, 2011
Free Software Foundation, Inc.
Contributed by Bob Wilson (bwilson@tensilica.com) at Tensilica.
@@ -36,7 +36,6 @@ extern bool xtensa_mem_offset (unsigned, enum machine_mode);
extern int xt_true_regnum (rtx);
extern int xtensa_valid_move (enum machine_mode, rtx *);
extern int smalloffset_mem_p (rtx);
-extern int constantpool_address_p (rtx);
extern int constantpool_mem_p (rtx);
extern void xtensa_extend_reg (rtx, rtx);
extern void xtensa_expand_conditional_branch (rtx *, enum machine_mode);
@@ -64,11 +63,6 @@ extern void print_operand (FILE *, rtx, int);
extern void print_operand_address (FILE *, rtx);
extern void xtensa_output_literal (FILE *, rtx, enum machine_mode, int);
extern rtx xtensa_return_addr (int, rtx);
-extern enum reg_class xtensa_preferred_reload_class (rtx, enum reg_class, int);
-struct secondary_reload_info;
-extern reg_class_t xtensa_secondary_reload (bool, rtx, reg_class_t,
- enum machine_mode,
- struct secondary_reload_info *);
#endif /* RTX_CODE */
extern void xtensa_setup_frame_addresses (void);
diff --git a/gcc/config/xtensa/xtensa.c b/gcc/config/xtensa/xtensa.c
index 7e244e2318c..e7c395be546 100644
--- a/gcc/config/xtensa/xtensa.c
+++ b/gcc/config/xtensa/xtensa.c
@@ -126,6 +126,7 @@ static rtx fixup_subreg_mem (rtx);
static struct machine_function * xtensa_init_machine_status (void);
static rtx xtensa_legitimize_tls_address (rtx);
static rtx xtensa_legitimize_address (rtx, rtx, enum machine_mode);
+static bool xtensa_mode_dependent_address_p (const_rtx);
static bool xtensa_return_in_msb (const_tree);
static void printx (FILE *, signed int);
static void xtensa_function_epilogue (FILE *, HOST_WIDE_INT);
@@ -136,6 +137,9 @@ static unsigned int xtensa_multibss_section_type_flags (tree, const char *,
static section *xtensa_select_rtx_section (enum machine_mode, rtx,
unsigned HOST_WIDE_INT);
static bool xtensa_rtx_costs (rtx, int, int, int *, bool);
+static int xtensa_register_move_cost (enum machine_mode, reg_class_t,
+ reg_class_t);
+static int xtensa_memory_move_cost (enum machine_mode, reg_class_t, bool);
static tree xtensa_build_builtin_va_list (void);
static bool xtensa_return_in_memory (const_tree, const_tree);
static tree xtensa_gimplify_va_arg_expr (tree, tree, gimple_seq *,
@@ -161,6 +165,14 @@ static void xtensa_asm_trampoline_template (FILE *);
static void xtensa_trampoline_init (rtx, tree, rtx);
static bool xtensa_output_addr_const_extra (FILE *, rtx);
+static reg_class_t xtensa_preferred_reload_class (rtx, reg_class_t);
+static reg_class_t xtensa_preferred_output_reload_class (rtx, reg_class_t);
+static reg_class_t xtensa_secondary_reload (bool, rtx, reg_class_t,
+ enum machine_mode,
+ struct secondary_reload_info *);
+
+static bool constantpool_address_p (const_rtx addr);
+
static const int reg_nonleaf_alloc_order[FIRST_PSEUDO_REGISTER] =
REG_ALLOC_ORDER;
@@ -201,7 +213,13 @@ static const struct default_options xtensa_option_optimization_table[] =
#undef TARGET_LEGITIMIZE_ADDRESS
#define TARGET_LEGITIMIZE_ADDRESS xtensa_legitimize_address
+#undef TARGET_MODE_DEPENDENT_ADDRESS_P
+#define TARGET_MODE_DEPENDENT_ADDRESS_P xtensa_mode_dependent_address_p
+#undef TARGET_REGISTER_MOVE_COST
+#define TARGET_REGISTER_MOVE_COST xtensa_register_move_cost
+#undef TARGET_MEMORY_MOVE_COST
+#define TARGET_MEMORY_MOVE_COST xtensa_memory_move_cost
#undef TARGET_RTX_COSTS
#define TARGET_RTX_COSTS xtensa_rtx_costs
#undef TARGET_ADDRESS_COST
@@ -255,6 +273,11 @@ static const struct default_options xtensa_option_optimization_table[] =
#undef TARGET_EXPAND_BUILTIN
#define TARGET_EXPAND_BUILTIN xtensa_expand_builtin
+#undef TARGET_PREFERRED_RELOAD_CLASS
+#define TARGET_PREFERRED_RELOAD_CLASS xtensa_preferred_reload_class
+#undef TARGET_PREFERRED_OUTPUT_RELOAD_CLASS
+#define TARGET_PREFERRED_OUTPUT_RELOAD_CLASS xtensa_preferred_output_reload_class
+
#undef TARGET_SECONDARY_RELOAD
#define TARGET_SECONDARY_RELOAD xtensa_secondary_reload
@@ -494,10 +517,10 @@ smalloffset_mem_p (rtx op)
}
-int
-constantpool_address_p (rtx addr)
+static bool
+constantpool_address_p (const_rtx addr)
{
- rtx sym = addr;
+ const_rtx sym = addr;
if (GET_CODE (addr) == CONST)
{
@@ -506,21 +529,21 @@ constantpool_address_p (rtx addr)
/* Only handle (PLUS (SYM, OFFSET)) form. */
addr = XEXP (addr, 0);
if (GET_CODE (addr) != PLUS)
- return FALSE;
+ return false;
/* Make sure the address is word aligned. */
offset = XEXP (addr, 1);
- if ((GET_CODE (offset) != CONST_INT)
+ if ((!CONST_INT_P (offset))
|| ((INTVAL (offset) & 3) != 0))
- return FALSE;
+ return false;
sym = XEXP (addr, 0);
}
if ((GET_CODE (sym) == SYMBOL_REF)
&& CONSTANT_POOL_ADDRESS_P (sym))
- return TRUE;
- return FALSE;
+ return true;
+ return false;
}
@@ -1937,6 +1960,21 @@ xtensa_legitimize_address (rtx x,
return x;
}
+/* Worker function for TARGET_MODE_DEPENDENT_ADDRESS_P.
+
+ Treat constant-pool references as "mode dependent" since they can
+ only be accessed with SImode loads. This works around a bug in the
+ combiner where a constant pool reference is temporarily converted
+ to an HImode load, which is then assumed to zero-extend based on
+ our definition of LOAD_EXTEND_OP. This is wrong because the high
+ bits of a 16-bit value in the constant pool are now sign-extended
+ by default. */
+
+static bool
+xtensa_mode_dependent_address_p (const_rtx addr)
+{
+ return constantpool_address_p (addr);
+}
/* Helper for xtensa_tls_referenced_p. */
@@ -3133,11 +3171,12 @@ xtensa_expand_builtin (tree exp, rtx target,
return NULL_RTX;
}
+/* Worker function for TARGET_PREFERRED_RELOAD_CLASS. */
-enum reg_class
-xtensa_preferred_reload_class (rtx x, enum reg_class rclass, int isoutput)
+static reg_class_t
+xtensa_preferred_reload_class (rtx x, reg_class_t rclass)
{
- if (!isoutput && CONSTANT_P (x) && GET_CODE (x) == CONST_DOUBLE)
+ if (CONSTANT_P (x) && CONST_DOUBLE_P (x))
return NO_REGS;
/* Don't use the stack pointer or hard frame pointer for reloads!
@@ -3152,8 +3191,27 @@ xtensa_preferred_reload_class (rtx x, enum reg_class rclass, int isoutput)
return rclass;
}
+/* Worker function for TARGET_PREFERRED_OUTPUT_RELOAD_CLASS. */
+
+static reg_class_t
+xtensa_preferred_output_reload_class (rtx x ATTRIBUTE_UNUSED,
+ reg_class_t rclass)
+{
+ /* Don't use the stack pointer or hard frame pointer for reloads!
+ The hard frame pointer would normally be OK except that it may
+ briefly hold an incoming argument in the prologue, and reload
+ won't know that it is live because the hard frame pointer is
+ treated specially. */
+
+ if (rclass == AR_REGS || rclass == GR_REGS)
+ return RL_REGS;
+
+ return rclass;
+}
+
+/* Worker function for TARGET_SECONDARY_RELOAD. */
-reg_class_t
+static reg_class_t
xtensa_secondary_reload (bool in_p, rtx x, reg_class_t rclass,
enum machine_mode mode, secondary_reload_info *sri)
{
@@ -3256,6 +3314,34 @@ xtensa_select_rtx_section (enum machine_mode mode ATTRIBUTE_UNUSED,
return function_section (current_function_decl);
}
+/* Worker function for TARGET_REGISTER_MOVE_COST. */
+
+static int
+xtensa_register_move_cost (enum machine_mode mode ATTRIBUTE_UNUSED,
+ reg_class_t from, reg_class_t to)
+{
+ if (from == to && from != BR_REGS && to != BR_REGS)
+ return 2;
+ else if (reg_class_subset_p (from, AR_REGS)
+ && reg_class_subset_p (to, AR_REGS))
+ return 2;
+ else if (reg_class_subset_p (from, AR_REGS) && to == ACC_REG)
+ return 3;
+ else if (from == ACC_REG && reg_class_subset_p (to, AR_REGS))
+ return 3;
+ else
+ return 10;
+}
+
+/* Worker function for TARGET_MEMORY_MOVE_COST. */
+
+static int
+xtensa_memory_move_cost (enum machine_mode mode ATTRIBUTE_UNUSED,
+ reg_class_t rclass ATTRIBUTE_UNUSED,
+ bool in ATTRIBUTE_UNUSED)
+{
+ return 4;
+}
/* Compute a (partial) cost for rtx X. Return true if the complete
cost has been computed, and false if subexpressions should be
diff --git a/gcc/config/xtensa/xtensa.h b/gcc/config/xtensa/xtensa.h
index e465e8f6347..0a096cdb5e4 100644
--- a/gcc/config/xtensa/xtensa.h
+++ b/gcc/config/xtensa/xtensa.h
@@ -455,12 +455,6 @@ extern const enum reg_class xtensa_regno_to_class[FIRST_PSEUDO_REGISTER];
the RTL, as either incoming or outgoing arguments. */
#define TARGET_SMALL_REGISTER_CLASSES_FOR_MODE_P hook_bool_mode_true
-#define PREFERRED_RELOAD_CLASS(X, CLASS) \
- xtensa_preferred_reload_class (X, CLASS, 0)
-
-#define PREFERRED_OUTPUT_RELOAD_CLASS(X, CLASS) \
- xtensa_preferred_reload_class (X, CLASS, 1)
-
/* Return the maximum number of consecutive registers
needed to represent mode MODE in a register of class CLASS. */
#define CLASS_UNITS(mode, size) \
@@ -695,20 +689,6 @@ typedef struct xtensa_args
&& GET_CODE (X) != LABEL_REF \
&& GET_CODE (X) != CONST)
-/* Treat constant-pool references as "mode dependent" since they can
- only be accessed with SImode loads. This works around a bug in the
- combiner where a constant pool reference is temporarily converted
- to an HImode load, which is then assumed to zero-extend based on
- our definition of LOAD_EXTEND_OP. This is wrong because the high
- bits of a 16-bit value in the constant pool are now sign-extended
- by default. */
-
-#define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR, LABEL) \
- do { \
- if (constantpool_address_p (ADDR)) \
- goto LABEL; \
- } while (0)
-
/* Specify the machine mode that this machine uses
for the index in the tablejump instruction. */
#define CASE_VECTOR_MODE (SImode)
@@ -743,26 +723,6 @@ typedef struct xtensa_args
indexing purposes) so give the MEM rtx a words's mode. */
#define FUNCTION_MODE SImode
-/* A C expression for the cost of moving data from a register in
- class FROM to one in class TO. The classes are expressed using
- the enumeration values such as 'GENERAL_REGS'. A value of 2 is
- the default; other values are interpreted relative to that. */
-#define REGISTER_MOVE_COST(MODE, FROM, TO) \
- (((FROM) == (TO) && (FROM) != BR_REGS && (TO) != BR_REGS) \
- ? 2 \
- : (reg_class_subset_p ((FROM), AR_REGS) \
- && reg_class_subset_p ((TO), AR_REGS) \
- ? 2 \
- : (reg_class_subset_p ((FROM), AR_REGS) \
- && (TO) == ACC_REG \
- ? 3 \
- : ((FROM) == ACC_REG \
- && reg_class_subset_p ((TO), AR_REGS) \
- ? 3 \
- : 10))))
-
-#define MEMORY_MOVE_COST(MODE, CLASS, IN) 4
-
#define BRANCH_COST(speed_p, predictable_p) 3
/* How to refer to registers in assembler output.
diff --git a/gcc/configure b/gcc/configure
index f286767c45d..f0a18544b03 100755
--- a/gcc/configure
+++ b/gcc/configure
@@ -15728,10 +15728,6 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
hardcode_shlibpath_var=no
;;
- freebsd1*)
- ld_shlibs=no
- ;;
-
# FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
# support. Future versions do this automatically, but an explicit c++rt0.o
# does not break anything, and helps significantly (at the cost of a little
@@ -16650,10 +16646,6 @@ dgux*)
shlibpath_var=LD_LIBRARY_PATH
;;
-freebsd1*)
- dynamic_linker=no
- ;;
-
freebsd* | dragonfly*)
# DragonFly does not have aout. When/if they implement a new
# versioning mechanism, adjust this.
@@ -17513,7 +17505,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 17516 "configure"
+#line 17508 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -17619,7 +17611,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 17622 "configure"
+#line 17614 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -20313,10 +20305,6 @@ dgux*)
shlibpath_var=LD_LIBRARY_PATH
;;
-freebsd1*)
- dynamic_linker=no
- ;;
-
freebsd* | dragonfly*)
# DragonFly does not have aout. When/if they implement a new
# versioning mechanism, adjust this.
@@ -21368,6 +21356,9 @@ else
i[34567]86-*-linux*)
gcc_cv_as_flags="--32"
;;
+ powerpc*-*-darwin*)
+ gcc_cv_as_flags="-arch ppc"
+ ;;
*)
gcc_cv_as_flags=" "
;;
@@ -23051,6 +23042,8 @@ fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking linker -Bstatic/-Bdynamic option" >&5
$as_echo_n "checking linker -Bstatic/-Bdynamic option... " >&6; }
gcc_cv_ld_static_dynamic=no
+gcc_cv_ld_static_option='-Bstatic'
+gcc_cv_ld_dynamic_option='-Bdynamic'
if test $in_tree_ld = yes ; then
if test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 10 -o "$gcc_cv_gld_major_version" -gt 2; then
gcc_cv_ld_static_dynamic=yes
@@ -23062,6 +23055,16 @@ elif test x$gcc_cv_ld != x; then
gcc_cv_ld_static_dynamic=yes
else
case "$target" in
+ # Tru64 UNIX support -noso/-so_archive instead of -Bstatic/-Bdynamic.
+ alpha*-dec-osf*)
+ gcc_cv_ld_static_dynamic=yes
+ gcc_cv_ld_static_option="-noso"
+ gcc_cv_ld_dynamic_option="-so_archive"
+ ;;
+ # IRIX 6 ld supports -Bstatic/-Bdynamic.
+ mips-sgi-irix6*)
+ gcc_cv_ld_static_dynamic=yes
+ ;;
# Solaris 2 ld always supports -Bstatic/-Bdynamic.
*-*-solaris2*)
gcc_cv_ld_static_dynamic=yes
@@ -23073,6 +23076,16 @@ if test x"$gcc_cv_ld_static_dynamic" = xyes; then
$as_echo "#define HAVE_LD_STATIC_DYNAMIC 1" >>confdefs.h
+
+cat >>confdefs.h <<_ACEOF
+#define LD_STATIC_OPTION "$gcc_cv_ld_static_option"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define LD_DYNAMIC_OPTION "$gcc_cv_ld_dynamic_option"
+_ACEOF
+
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_ld_static_dynamic" >&5
$as_echo "$gcc_cv_ld_static_dynamic" >&6; }
@@ -23103,7 +23116,7 @@ fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking linker plugin support" >&5
$as_echo_n "checking linker plugin support... " >&6; }
gcc_cv_lto_plugin=no
-if test -f ../lto-plugin/Makefile ; then
+if test -f liblto_plugin.la; then
if test $in_tree_ld = yes -a x"$ORIGINAL_PLUGIN_LD_FOR_TARGET=" = x"$gcc_cv_ld"; then
if test x"$ld_is_gold" = xyes; then
gcc_cv_lto_plugin=yes
@@ -25310,8 +25323,8 @@ elif test x$gcc_cv_ld != x; then
else
case "$target" in
*-*-solaris2*)
- # Sun ld has various bugs in .eh_frame_hdr support before version 1.2249.
- if test "$ld_vers_major" -gt 1 || test "$ld_vers_minor" -ge 2249; then
+ # Sun ld has various bugs in .eh_frame_hdr support before version 1.2251.
+ if test "$ld_vers_major" -gt 1 || test "$ld_vers_minor" -ge 2251; then
gcc_cv_ld_eh_frame_hdr=yes
fi
;;
diff --git a/gcc/configure.ac b/gcc/configure.ac
index caaa34121d5..254c4f379e3 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -3113,6 +3113,8 @@ fi
AC_MSG_CHECKING(linker -Bstatic/-Bdynamic option)
gcc_cv_ld_static_dynamic=no
+gcc_cv_ld_static_option='-Bstatic'
+gcc_cv_ld_dynamic_option='-Bdynamic'
if test $in_tree_ld = yes ; then
if test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 10 -o "$gcc_cv_gld_major_version" -gt 2; then
gcc_cv_ld_static_dynamic=yes
@@ -3124,6 +3126,16 @@ elif test x$gcc_cv_ld != x; then
gcc_cv_ld_static_dynamic=yes
else
case "$target" in
+ # Tru64 UNIX support -noso/-so_archive instead of -Bstatic/-Bdynamic.
+ alpha*-dec-osf*)
+ gcc_cv_ld_static_dynamic=yes
+ gcc_cv_ld_static_option="-noso"
+ gcc_cv_ld_dynamic_option="-so_archive"
+ ;;
+ # IRIX 6 ld supports -Bstatic/-Bdynamic.
+ mips-sgi-irix6*)
+ gcc_cv_ld_static_dynamic=yes
+ ;;
# Solaris 2 ld always supports -Bstatic/-Bdynamic.
*-*-solaris2*)
gcc_cv_ld_static_dynamic=yes
@@ -3133,7 +3145,11 @@ elif test x$gcc_cv_ld != x; then
fi
if test x"$gcc_cv_ld_static_dynamic" = xyes; then
AC_DEFINE(HAVE_LD_STATIC_DYNAMIC, 1,
-[Define if your linker supports -Bstatic/-Bdynamic option.])
+[Define if your linker supports -Bstatic/-Bdynamic or equivalent options.])
+ AC_DEFINE_UNQUOTED(LD_STATIC_OPTION, "$gcc_cv_ld_static_option",
+[Define to the linker option to disable use of shared objects.])
+ AC_DEFINE_UNQUOTED(LD_DYNAMIC_OPTION, "$gcc_cv_ld_dynamic_option",
+[Define to the linker option to enable use of shared objects.])
fi
AC_MSG_RESULT($gcc_cv_ld_static_dynamic)
@@ -3159,7 +3175,7 @@ fi
AC_MSG_CHECKING(linker plugin support)
gcc_cv_lto_plugin=no
-if test -f ../lto-plugin/Makefile ; then
+if test -f liblto_plugin.la; then
if test $in_tree_ld = yes -a x"$ORIGINAL_PLUGIN_LD_FOR_TARGET=" = x"$gcc_cv_ld"; then
if test x"$ld_is_gold" = xyes; then
gcc_cv_lto_plugin=yes
@@ -3967,8 +3983,8 @@ elif test x$gcc_cv_ld != x; then
else
case "$target" in
*-*-solaris2*)
- # Sun ld has various bugs in .eh_frame_hdr support before version 1.2249.
- if test "$ld_vers_major" -gt 1 || test "$ld_vers_minor" -ge 2249; then
+ # Sun ld has various bugs in .eh_frame_hdr support before version 1.2251.
+ if test "$ld_vers_major" -gt 1 || test "$ld_vers_minor" -ge 2251; then
gcc_cv_ld_eh_frame_hdr=yes
fi
;;
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index a28d6727675..3dba66e335b 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,244 @@
+2011-02-24 Jason Merrill <jason@redhat.com>
+
+ * parser.c (cp_parser_constant_expression): Set
+ non_integral_constant_expression correctly for C++0x too.
+ (cp_parser_static_assert): Allow non-constant expression.
+ (cp_parser_direct_declarator): Expect non_constant_p to be set
+ properly for C++0x.
+ * pt.c (value_dependent_expression_p): Handle TYPEID_EXPR.
+ * semantics.c (maybe_constant_value): Check type_unknown_p too.
+ (potential_rvalue_constant_expression): New.
+ (require_potential_rvalue_constant_expression): New.
+
+2011-02-23 Jason Merrill <jason@redhat.com>
+
+ * cp-tree.h (DECL_PARM_LEVEL): New.
+ (struct lang_decl_parm): Add level field.
+ * name-lookup.c (function_parm_depth): New fn.
+ * name-lookup.h: Declare it.
+ * parser.c (cp_parser_parameter_declaration_list): Use it.
+ * mangle.c (struct globals): Add parm_depth field.
+ (write_bare_function_type): Adjust it.
+ (write_expression): Include the level delta in PARM_DECL mangling
+ for abi >= 6.
+
+ * semantics.c (finish_decltype_type): Remove shortcut for decltype
+ of id-expression.
+ * mangle.c (write_type) [DECLTYPE_TYPE]: Strip it here for abi < 6.
+
+2011-02-23 Nathan Froyd <froydnj@codesourcery.com>
+
+ PR c++/46868
+ * parser.c (cp_parser_class_specifier): Require a closing brace
+ to attempt error recovery.
+
+2011-02-23 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/47833
+ * pt.c (struct pending_template): Add chain_next GTY option.
+ * decl.c (struct named_label_use_entry): Likewise.
+
+2011-02-22 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/47242
+ * semantics.c (build_lambda_object): Bail out if a field is
+ error_mark_node.
+
+2011-02-22 Dodji Seketeli <dodji@redhat.com>
+
+ PR c++/47666
+ * class.c (dfs_declare_virt_assop_and_dtor)
+ (declare_virt_assop_and_dtor): New static functions.
+ (add_implicitly_declared_members): Use
+ declare_virt_assop_and_dtor.
+
+2011-02-21 Jason Merrill <jason@redhat.com>
+
+ PR c++/47207
+ * decl2.c (decl_constant_var_p): A constexpr var needs an
+ initializer to be constant.
+ * semantics.c (cxx_eval_constant_expression): Complain about
+ constexpr var used in its own initializer.
+ * call.c (set_up_extended_ref_temp): Set
+ DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P too.
+
+2011-02-20 Jason Merrill <jason@redhat.com>
+
+ PR c++/47199
+ * semantics.c (cxx_eval_call_expression): Call
+ cxx_eval_constant_expression in trivial shortcut.
+
+ PR c++/46831
+ * call.c (convert_class_to_reference): Don't try to set up a
+ second conv sequence for non-viable candidates.
+
+ PR c++/47703
+ * error.c (location_of): Handle non-tagged types.
+
+ PR c++/46472
+ * method.c (process_subob_fn): Instantiate constexpr templates.
+ * optimize.c (maybe_clone_body): Propagate DECL_DECLARED_CONSTEXPR_P.
+
+2011-02-20 Dodji Seketeli <dodji@redhat.com>
+
+ PR c++/46394
+ * pt.c (tsubst_pack_expansion): do not use
+ cp_tree_equal/same_type_p to detect an expansion of a parameter
+ pack.
+
+2011-02-19 Jason Merrill <jason@redhat.com>
+
+ PR c++/47503
+ * semantics.c (cxx_eval_call_expression): Shortcut trivial copy.
+
+2011-02-18 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/47795
+ * semantics.c (finish_non_static_data_member): Early return if
+ object is error_mark_node.
+
+2011-02-18 Dodji Seketeli <dodji@redhat.com>
+
+ PR c++/47208
+ * pt.c (do_auto_deduction): Do not mention error_mark_node in
+ diagnostics.
+ * semantics.c (finish_id_expression): Do not pass erroneous decl
+ to decl_constant_var_p.
+
+2011-02-17 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/47783
+ * cvt.c (convert_from_reference): Call mark_exp_read.
+
+2011-02-11 Dodji Seketeli <dodji@redhat.com>
+
+ PR c++/47172
+ * pt.c (finish_call_expr): Consider a call expression that has a
+ dependent "this" pointer as being dependent. Add comments.
+ (dependent_type_p, type_dependent_expression_p): Update comments.
+
+2011-02-16 Dodji Seketeli <dodji@redhat.com>
+
+ PR c++/47326
+ * pt.c (tsubst_copy)<case SIZEOF_EXPR>: Ensure that even pack
+ expansion arguments are not evaluated.
+
+2011-02-16 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/47704
+ * cp-tree.h (ENUM_FIXED_UNDERLYING_TYPE_P): Use TYPE_LANG_FLAG_5
+ instead of TYPE_LANG_FLAG_3.
+ * pt.c (lookup_template_class): Copy over
+ ENUM_FIXED_UNDERLYING_TYPE_P.
+
+2011-02-15 Jason Merrill <jason@redhat.com>
+
+ PR c++/46807
+ * method.c (synthesized_method_walk): Always exit early for
+ trivial fn in C++98 mode.
+
+2011-02-14 Jason Merrill <jason@redhat.com>
+
+ PR c++/47482
+ * parser.c (cp_parser_enumerator_definition): Call
+ fold_non_dependent_expr.
+
+2011-02-09 Jason Merrill <jason@redhat.com>
+
+ * decl.c (cp_make_fname_decl): Set DECL_THIS_STATIC at toplevel.
+ * semantics.c (finish_fname): Only return the name if we're in
+ a function.
+
+ * decl.c (build_enumerator): Don't perform integral promotions on
+ non-integral constants.
+
+ * cvt.c (convert_to_void): Handle null op1.
+
+ * class.c (type_has_constexpr_default_constructor): Make sure the
+ caller stripped an enclosing array.
+ * init.c (perform_member_init): Strip arrays before calling it.
+
+ PR c++/47511
+ * semantics.c (potential_constant_expression_1): Handle TEMPLATE_DECL.
+
+2011-02-03 Dodji Seketeli <dodji@redhat.com>
+
+ PR c++/47398
+ * tree.c (cp_tree_equal)<TEMPLATE_PARM_INDEX>: Take the number of
+ template parameters in account.
+
+2011-02-03 Nathan Froyd <froydnj@codesourcery.com>
+
+ PR c++/46890
+ * parser.c (cp_parser_class_specifier): Fix setting of
+ want_semicolon.
+
+2011-01-31 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/47416
+ * semantics.c (build_data_member_initialization): Handle
+ STATEMENT_LIST always instead of just for CLEANUP_BODY.
+
+2011-01-31 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * g++spec.c (lang_specific_driver) [HAVE_LD_STATIC_DYNAMIC] Use
+ LD_STATIC_OPTION, LD_DYNAMIC_OPTION.
+
+2011-01-29 Dodji Seketeli <dodji@redhat.com>
+
+ PR c++/47311
+ * cp-tree.h (fixup_template_parms): Declare.
+ * pt.c (end_template_parm_list): Do not fixup template parms here.
+ (fixup_template_parms): Remove static. Fix typo in the
+ comments. Remove useless code statement.
+ (fixup_template_parm): For a template template parameter, fixup
+ its attributes before fixing up its type.
+ * parser.c
+ (cp_parser_template_declaration_after_export): After parsing
+ template parameters fixup their types.
+
+2011-01-26 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/47476
+ * semantics.c (potential_constant_expression_1): Handle
+ TRUTH_XOR_EXPR.
+
+2011-01-26 Dave Korn <dave.korn.cygwin@gmail.com>
+
+ PR c++/43601
+ * semantics.c (expand_or_defer_fn_1): Handle it.
+ * decl2.c (decl_needed_p): Likewise.
+
+2011-01-21 Jason Merrill <jason@redhat.com>
+
+ PR c++/47041
+ * semantics.c (build_constexpr_constructor_member_initializers):
+ Handle trivial copy.
+
+2011-01-21 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/47388
+ * semantics.c (begin_for_stmt): If -fno-for-scope, don't
+ assume init must be NULL if scope is NULL.
+ (begin_range_for_stmt): Likewise.
+
+2011-01-21 Jason Merrill <jason@redhat.com>
+
+ PR c++/46552
+ * semantics.c (cxx_eval_constant_expression): Handle OFFSET_REF.
+
+ PR c++/46977
+ * semantics.c (potential_constant_expression_1): Split out from
+ potential_constant_expression. Add want_rval parm. Handle
+ template expression forms. Don't enforce restriction on address
+ of automatic variable here. Add a couple of diagnostics that
+ had been missing.
+ (require_potential_constant_expression): New entry point.
+ (build_data_member_initialization, register_constexpr_fundef): Adjust.
+ (maybe_constant_value): Check potential_constant_expression.
+ * pt.c (fold_non_dependent_expr_sfinae): Likewise.
+ * tree.c (build_vec_init_expr): Adjust.
+
2011-01-19 Jakub Jelinek <jakub@redhat.com>
PR c++/47303
diff --git a/gcc/cp/call.c b/gcc/cp/call.c
index 7d602b94d22..8dccbbef412 100644
--- a/gcc/cp/call.c
+++ b/gcc/cp/call.c
@@ -1230,8 +1230,10 @@ convert_class_to_reference (tree reference_type, tree s, tree expr, int flags)
rvalue of the right type is good enough. */
tree f = cand->fn;
tree t2 = TREE_TYPE (TREE_TYPE (f));
- if (TREE_CODE (t2) != REFERENCE_TYPE
- || !reference_compatible_p (t, TREE_TYPE (t2)))
+ if (cand->viable == 0)
+ /* Don't bother looking more closely. */;
+ else if (TREE_CODE (t2) != REFERENCE_TYPE
+ || !reference_compatible_p (t, TREE_TYPE (t2)))
{
/* No need to set cand->reason here; this is most likely
an ambiguous match. If it's not, either this candidate
@@ -8147,6 +8149,7 @@ set_up_extended_ref_temp (tree decl, tree expr, tree *cleanup, tree *initp)
Currently this is only useful for initializer_list temporaries,
since reference vars can't appear in constant expressions. */
DECL_DECLARED_CONSTEXPR_P (var) = true;
+ DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P (var) = true;
TREE_CONSTANT (var) = true;
}
DECL_INITIAL (var) = init;
diff --git a/gcc/cp/class.c b/gcc/cp/class.c
index 03951cfa4ea..0d485fc6ac7 100644
--- a/gcc/cp/class.c
+++ b/gcc/cp/class.c
@@ -2637,6 +2637,70 @@ maybe_add_class_template_decl_list (tree type, tree t, int friend_p)
t, CLASSTYPE_DECL_LIST (type));
}
+/* This function is called from declare_virt_assop_and_dtor via
+ dfs_walk_all.
+
+ DATA is a type that direcly or indirectly inherits the base
+ represented by BINFO. If BINFO contains a virtual assignment [copy
+ assignment or move assigment] operator or a virtual constructor,
+ declare that function in DATA if it hasn't been already declared. */
+
+static tree
+dfs_declare_virt_assop_and_dtor (tree binfo, void *data)
+{
+ tree bv, fn, t = (tree)data;
+ tree opname = ansi_assopname (NOP_EXPR);
+
+ gcc_assert (t && CLASS_TYPE_P (t));
+ gcc_assert (binfo && TREE_CODE (binfo) == TREE_BINFO);
+
+ if (!TYPE_CONTAINS_VPTR_P (BINFO_TYPE (binfo)))
+ /* A base without a vtable needs no modification, and its bases
+ are uninteresting. */
+ return dfs_skip_bases;
+
+ if (BINFO_PRIMARY_P (binfo))
+ /* If this is a primary base, then we have already looked at the
+ virtual functions of its vtable. */
+ return NULL_TREE;
+
+ for (bv = BINFO_VIRTUALS (binfo); bv; bv = TREE_CHAIN (bv))
+ {
+ fn = BV_FN (bv);
+
+ if (DECL_NAME (fn) == opname)
+ {
+ if (CLASSTYPE_LAZY_COPY_ASSIGN (t))
+ lazily_declare_fn (sfk_copy_assignment, t);
+ if (CLASSTYPE_LAZY_MOVE_ASSIGN (t))
+ lazily_declare_fn (sfk_move_assignment, t);
+ }
+ else if (DECL_DESTRUCTOR_P (fn)
+ && CLASSTYPE_LAZY_DESTRUCTOR (t))
+ lazily_declare_fn (sfk_destructor, t);
+ }
+
+ return NULL_TREE;
+}
+
+/* If the class type T has a direct or indirect base that contains a
+ virtual assignment operator or a virtual destructor, declare that
+ function in T if it hasn't been already declared. */
+
+static void
+declare_virt_assop_and_dtor (tree t)
+{
+ if (!(TYPE_POLYMORPHIC_P (t)
+ && (CLASSTYPE_LAZY_COPY_ASSIGN (t)
+ || CLASSTYPE_LAZY_MOVE_ASSIGN (t)
+ || CLASSTYPE_LAZY_DESTRUCTOR (t))))
+ return;
+
+ dfs_walk_all (TYPE_BINFO (t),
+ dfs_declare_virt_assop_and_dtor,
+ NULL, t);
+}
+
/* Create default constructors, assignment operators, and so forth for
the type indicated by T, if they are needed. CANT_HAVE_CONST_CTOR,
and CANT_HAVE_CONST_ASSIGNMENT are nonzero if, for whatever reason,
@@ -2706,34 +2770,7 @@ add_implicitly_declared_members (tree t,
/* We can't be lazy about declaring functions that might override
a virtual function from a base class. */
- if (TYPE_POLYMORPHIC_P (t)
- && (CLASSTYPE_LAZY_COPY_ASSIGN (t)
- || CLASSTYPE_LAZY_MOVE_ASSIGN (t)
- || CLASSTYPE_LAZY_DESTRUCTOR (t)))
- {
- tree binfo = TYPE_BINFO (t);
- tree base_binfo;
- int ix;
- tree opname = ansi_assopname (NOP_EXPR);
- for (ix = 0; BINFO_BASE_ITERATE (binfo, ix, base_binfo); ++ix)
- {
- tree bv;
- for (bv = BINFO_VIRTUALS (base_binfo); bv; bv = TREE_CHAIN (bv))
- {
- tree fn = BV_FN (bv);
- if (DECL_NAME (fn) == opname)
- {
- if (CLASSTYPE_LAZY_COPY_ASSIGN (t))
- lazily_declare_fn (sfk_copy_assignment, t);
- if (CLASSTYPE_LAZY_MOVE_ASSIGN (t))
- lazily_declare_fn (sfk_move_assignment, t);
- }
- else if (DECL_DESTRUCTOR_P (fn)
- && CLASSTYPE_LAZY_DESTRUCTOR (t))
- lazily_declare_fn (sfk_destructor, t);
- }
- }
- }
+ declare_virt_assop_and_dtor (t);
}
/* Subroutine of finish_struct_1. Recursively count the number of fields
@@ -4349,7 +4386,11 @@ type_has_constexpr_default_constructor (tree t)
tree fns;
if (!CLASS_TYPE_P (t))
- return false;
+ {
+ /* The caller should have stripped an enclosing array. */
+ gcc_assert (TREE_CODE (t) != ARRAY_TYPE);
+ return false;
+ }
if (CLASSTYPE_LAZY_DEFAULT_CTOR (t))
return synthesized_default_constructor_is_constexpr (t);
fns = locate_ctor (t);
diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h
index 3d39b5567c1..d5a6d5c0763 100644
--- a/gcc/cp/cp-tree.h
+++ b/gcc/cp/cp-tree.h
@@ -1,6 +1,6 @@
/* Definitions for C++ parsing and type checking.
Copyright (C) 1987, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
- 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
+ 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
Free Software Foundation, Inc.
Contributed by Michael Tiemann (tiemann@cygnus.com)
@@ -115,6 +115,7 @@ c-common.h, not after.
3: TYPE_FOR_JAVA.
4: TYPE_HAS_NONTRIVIAL_DESTRUCTOR
5: CLASS_TYPE_P (in RECORD_TYPE and UNION_TYPE)
+ ENUM_FIXED_UNDERLYING_TYPE_P (in ENUMERAL_TYPE)
6: TYPE_DEPENDENT_P_VALID
Usage of DECL_LANG_FLAG_?:
@@ -1913,6 +1914,7 @@ struct GTY(()) lang_decl_ns {
struct GTY(()) lang_decl_parm {
struct lang_decl_base base;
+ int level;
int index;
};
@@ -2107,6 +2109,13 @@ struct GTY((variable_size)) lang_decl {
#define DECL_PARM_INDEX(NODE) \
(LANG_DECL_PARM_CHECK (NODE)->index)
+/* The level of a user-declared parameter in its function, starting at 1.
+ A parameter of the function will have level 1; a parameter of the first
+ nested function declarator (i.e. t in void f (void (*p)(T t))) will have
+ level 2. */
+#define DECL_PARM_LEVEL(NODE) \
+ (LANG_DECL_PARM_CHECK (NODE)->level)
+
/* Nonzero if the VTT parm has been added to NODE. */
#define DECL_HAS_VTT_PARM_P(NODE) \
(LANG_DECL_FN_CHECK (NODE)->has_vtt_parm_p)
@@ -3098,7 +3107,7 @@ more_aggr_init_expr_args_p (const aggr_init_expr_arg_iterator *iter)
/* Determines whether an ENUMERAL_TYPE has an explicit
underlying type. */
-#define ENUM_FIXED_UNDERLYING_TYPE_P(NODE) (TYPE_LANG_FLAG_3 (NODE))
+#define ENUM_FIXED_UNDERLYING_TYPE_P(NODE) (TYPE_LANG_FLAG_5 (NODE))
/* Returns the underlying type of the given enumeration type. The
underlying type is determined in different ways, depending on the
@@ -5025,6 +5034,7 @@ extern bool is_auto (const_tree);
extern tree process_template_parm (tree, location_t, tree,
bool, bool, unsigned);
extern tree end_template_parm_list (tree);
+void fixup_template_parms (void);
extern void end_template_decl (void);
extern tree maybe_update_decl_type (tree, tree);
extern bool check_default_tmpl_args (tree, tree, int, int, int);
@@ -5245,7 +5255,10 @@ extern tree validate_constexpr_fundecl (tree);
extern tree register_constexpr_fundef (tree, tree);
extern bool check_constexpr_ctor_body (tree, tree);
extern tree ensure_literal_type_for_constexpr_object (tree);
-extern bool potential_constant_expression (tree, tsubst_flags_t);
+extern bool potential_constant_expression (tree);
+extern bool potential_rvalue_constant_expression (tree);
+extern bool require_potential_constant_expression (tree);
+extern bool require_potential_rvalue_constant_expression (tree);
extern tree cxx_constant_value (tree);
extern tree maybe_constant_value (tree);
extern tree maybe_constant_init (tree);
diff --git a/gcc/cp/cvt.c b/gcc/cp/cvt.c
index 029aec3da81..8ab00011432 100644
--- a/gcc/cp/cvt.c
+++ b/gcc/cp/cvt.c
@@ -512,6 +512,7 @@ convert_from_reference (tree val)
tree t = TREE_TYPE (TREE_TYPE (val));
tree ref = build1 (INDIRECT_REF, t, val);
+ mark_exp_read (val);
/* We *must* set TREE_READONLY when dereferencing a pointer to const,
so that we get the proper error message if the result is used
to assign to. Also, &* is supposed to be a no-op. */
@@ -892,20 +893,24 @@ convert_to_void (tree expr, impl_conv_void implicit, tsubst_flags_t complain)
/* The two parts of a cond expr might be separate lvalues. */
tree op1 = TREE_OPERAND (expr,1);
tree op2 = TREE_OPERAND (expr,2);
- bool side_effects = TREE_SIDE_EFFECTS (op1) || TREE_SIDE_EFFECTS (op2);
+ bool side_effects = ((op1 && TREE_SIDE_EFFECTS (op1))
+ || TREE_SIDE_EFFECTS (op2));
tree new_op1, new_op2;
+ new_op1 = NULL_TREE;
if (implicit != ICV_CAST && !side_effects)
{
- new_op1 = convert_to_void (op1, ICV_SECOND_OF_COND, complain);
+ if (op1)
+ new_op1 = convert_to_void (op1, ICV_SECOND_OF_COND, complain);
new_op2 = convert_to_void (op2, ICV_THIRD_OF_COND, complain);
}
else
{
- new_op1 = convert_to_void (op1, ICV_CAST, complain);
+ if (op1)
+ new_op1 = convert_to_void (op1, ICV_CAST, complain);
new_op2 = convert_to_void (op2, ICV_CAST, complain);
}
- expr = build3 (COND_EXPR, TREE_TYPE (new_op1),
+ expr = build3 (COND_EXPR, TREE_TYPE (new_op2),
TREE_OPERAND (expr, 0), new_op1, new_op2);
break;
}
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 6a13cc474ae..93c184845f9 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -1,6 +1,6 @@
/* Process declarations and variables for C++ compiler.
Copyright (C) 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
- 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
+ 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
Free Software Foundation, Inc.
Contributed by Michael Tiemann (tiemann@cygnus.com)
@@ -178,7 +178,7 @@ tree integer_two_node;
/* Used only for jumps to as-yet undefined labels, since jumps to
defined labels can have their validity checked immediately. */
-struct GTY(()) named_label_use_entry {
+struct GTY((chain_next ("%h.next"))) named_label_use_entry {
struct named_label_use_entry *next;
/* The binding level to which this entry is *currently* attached.
This is initially the binding level in which the goto appeared,
@@ -3706,7 +3706,10 @@ cp_make_fname_decl (location_t loc, tree id, int type_dep)
LOOKUP_ONLYCONVERTING);
}
else
- pushdecl_top_level_and_finish (decl, init);
+ {
+ DECL_THIS_STATIC (decl) = true;
+ pushdecl_top_level_and_finish (decl, init);
+ }
return decl;
}
@@ -5821,12 +5824,10 @@ cp_finish_decl (tree decl, tree init, bool init_const_expr_p,
if (init && TREE_CODE (decl) == VAR_DECL)
{
DECL_NONTRIVIALLY_INITIALIZED_P (decl) = 1;
- /* FIXME we rely on TREE_CONSTANT below; basing that on
- init_const_expr_p is probably wrong for C++0x. */
if (init_const_expr_p)
{
- /* Set these flags now for C++98 templates. We'll update the
- flags in store_init_value for instantiations and C++0x. */
+ /* Set these flags now for templates. We'll update the flags in
+ store_init_value for instantiations. */
DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P (decl) = 1;
if (decl_maybe_constant_var_p (decl))
TREE_CONSTANT (decl) = 1;
@@ -11869,7 +11870,8 @@ build_enumerator (tree name, tree value, tree enumtype, location_t loc)
{
value = cxx_constant_value (value);
- if (TREE_CODE (value) == INTEGER_CST)
+ if (TREE_CODE (value) == INTEGER_CST
+ && INTEGRAL_OR_ENUMERATION_TYPE_P (TREE_TYPE (value)))
{
value = perform_integral_promotions (value);
}
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c
index 288552880a7..93d44a4d6b5 100644
--- a/gcc/cp/decl2.c
+++ b/gcc/cp/decl2.c
@@ -1,7 +1,7 @@
/* Process declarations and variables for C++ compiler.
Copyright (C) 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
- 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010
- Free Software Foundation, Inc.
+ 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010,
+ 2011 Free Software Foundation, Inc.
Hacked by Michael Tiemann (tiemann@cygnus.com)
This file is part of GCC.
@@ -1781,7 +1781,8 @@ decl_needed_p (tree decl)
return true;
/* Functions marked "dllexport" must be emitted so that they are
visible to other DLLs. */
- if (lookup_attribute ("dllexport", DECL_ATTRIBUTES (decl)))
+ if (flag_keep_inline_dllexport
+ && lookup_attribute ("dllexport", DECL_ATTRIBUTES (decl)))
return true;
/* Otherwise, DECL does not need to be emitted -- yet. A subsequent
reference to DECL might cause it to be emitted later. */
@@ -3549,20 +3550,21 @@ decl_constant_var_p (tree decl)
tree type = TREE_TYPE (decl);
if (TREE_CODE (decl) != VAR_DECL)
return false;
- if (DECL_DECLARED_CONSTEXPR_P (decl))
- ret = true;
- else if (CP_TYPE_CONST_NON_VOLATILE_P (type)
- && INTEGRAL_OR_ENUMERATION_TYPE_P (type))
+ if (DECL_DECLARED_CONSTEXPR_P (decl)
+ || (CP_TYPE_CONST_NON_VOLATILE_P (type)
+ && INTEGRAL_OR_ENUMERATION_TYPE_P (type)))
{
/* We don't know if a template static data member is initialized with
- a constant expression until we instantiate its initializer. */
+ a constant expression until we instantiate its initializer. Even
+ in the case of a constexpr variable, we can't treat it as a
+ constant until its initializer is complete in case it's used in
+ its own initializer. */
mark_used (decl);
ret = DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P (decl);
}
else
ret = false;
- gcc_assert (!ret || DECL_INITIAL (decl));
return ret;
}
diff --git a/gcc/cp/error.c b/gcc/cp/error.c
index 3e91115ba9d..28305d22244 100644
--- a/gcc/cp/error.c
+++ b/gcc/cp/error.c
@@ -2493,7 +2493,11 @@ location_of (tree t)
if (TREE_CODE (t) == PARM_DECL && DECL_CONTEXT (t))
t = DECL_CONTEXT (t);
else if (TYPE_P (t))
- t = TYPE_MAIN_DECL (t);
+ {
+ t = TYPE_MAIN_DECL (t);
+ if (t == NULL_TREE)
+ return input_location;
+ }
else if (TREE_CODE (t) == OVERLOAD)
t = OVL_FUNCTION (t);
diff --git a/gcc/cp/g++spec.c b/gcc/cp/g++spec.c
index 9ebf6bc2eae..3a9faa9c1e9 100644
--- a/gcc/cp/g++spec.c
+++ b/gcc/cp/g++spec.c
@@ -1,6 +1,6 @@
/* Specific flags and argument handling of the C++ front end.
Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
- 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+ 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
This file is part of GCC.
@@ -316,7 +316,7 @@ lang_specific_driver (struct cl_decoded_option **in_decoded_options,
#ifdef HAVE_LD_STATIC_DYNAMIC
if (library > 1 && !static_link)
{
- generate_option (OPT_Wl_, "-Bstatic", 1, CL_DRIVER,
+ generate_option (OPT_Wl_, LD_STATIC_OPTION, 1, CL_DRIVER,
&new_decoded_options[j]);
j++;
}
@@ -337,7 +337,7 @@ lang_specific_driver (struct cl_decoded_option **in_decoded_options,
#ifdef HAVE_LD_STATIC_DYNAMIC
if (library > 1 && !static_link)
{
- generate_option (OPT_Wl_, "-Bdynamic", 1, CL_DRIVER,
+ generate_option (OPT_Wl_, LD_DYNAMIC_OPTION, 1, CL_DRIVER,
&new_decoded_options[j]);
j++;
}
diff --git a/gcc/cp/init.c b/gcc/cp/init.c
index 6ffdc2f3f36..e590118f3cf 100644
--- a/gcc/cp/init.c
+++ b/gcc/cp/init.c
@@ -535,8 +535,10 @@ perform_member_init (tree member, tree init)
"uninitialized member %qD with %<const%> type %qT",
member, type);
+ core_type = strip_array_types (type);
+
if (DECL_DECLARED_CONSTEXPR_P (current_function_decl)
- && !type_has_constexpr_default_constructor (type))
+ && !type_has_constexpr_default_constructor (core_type))
{
if (!DECL_TEMPLATE_INSTANTIATION (current_function_decl))
error ("uninitialized member %qD in %<constexpr%> constructor",
@@ -544,7 +546,6 @@ perform_member_init (tree member, tree init)
DECL_DECLARED_CONSTEXPR_P (current_function_decl) = false;
}
- core_type = strip_array_types (type);
if (CLASS_TYPE_P (core_type)
&& (CLASSTYPE_READONLY_FIELDS_NEED_INIT (core_type)
|| CLASSTYPE_REF_FIELDS_NEED_INIT (core_type)))
diff --git a/gcc/cp/mangle.c b/gcc/cp/mangle.c
index 4d2ace632bc..dca8b604daa 100644
--- a/gcc/cp/mangle.c
+++ b/gcc/cp/mangle.c
@@ -96,6 +96,9 @@ typedef struct GTY(()) globals {
/* The entity that is being mangled. */
tree GTY ((skip)) entity;
+ /* How many parameter scopes we are inside. */
+ int parm_depth;
+
/* True if the mangling will be different in a future version of the
ABI. */
bool need_abi_warning;
@@ -1931,6 +1934,35 @@ write_type (tree type)
gcc_assert (!DECLTYPE_FOR_LAMBDA_CAPTURE (type)
&& !DECLTYPE_FOR_LAMBDA_RETURN (type));
+ /* In ABI <6, we stripped decltype of a plain decl. */
+ if (!abi_version_at_least (6)
+ && DECLTYPE_TYPE_ID_EXPR_OR_MEMBER_ACCESS_P (type))
+ {
+ tree expr = DECLTYPE_TYPE_EXPR (type);
+ tree etype = NULL_TREE;
+ switch (TREE_CODE (expr))
+ {
+ case VAR_DECL:
+ case PARM_DECL:
+ case RESULT_DECL:
+ case FUNCTION_DECL:
+ case CONST_DECL:
+ case TEMPLATE_PARM_INDEX:
+ etype = TREE_TYPE (expr);
+ break;
+
+ default:
+ break;
+ }
+
+ if (etype && !type_uses_auto (etype))
+ {
+ G.need_abi_warning = 1;
+ write_type (etype);
+ return;
+ }
+ }
+
write_char ('D');
if (DECLTYPE_TYPE_ID_EXPR_OR_MEMBER_ACCESS_P (type))
write_char ('t');
@@ -2270,9 +2302,11 @@ write_bare_function_type (const tree type, const int include_return_type_p,
write_type (TREE_TYPE (type));
/* Now mangle the types of the arguments. */
+ ++G.parm_depth;
write_method_parms (TYPE_ARG_TYPES (type),
TREE_CODE (type) == METHOD_TYPE,
decl);
+ --G.parm_depth;
}
/* Write the mangled representation of a method parameter list of
@@ -2458,8 +2492,28 @@ write_expression (tree expr)
{
/* A function parameter used in a late-specified return type. */
int index = DECL_PARM_INDEX (expr);
+ int level = DECL_PARM_LEVEL (expr);
+ int delta = G.parm_depth - level + 1;
gcc_assert (index >= 1);
- write_string ("fp");
+ write_char ('f');
+ if (delta != 0)
+ {
+ if (abi_version_at_least (6))
+ {
+ /* Let L be the number of function prototype scopes from the
+ innermost one (in which the parameter reference occurs) up
+ to (and including) the one containing the declaration of
+ the referenced parameter. If the parameter declaration
+ clause of the innermost function prototype scope has been
+ completely seen, it is not counted (in that case -- which
+ is perhaps the most common -- L can be zero). */
+ write_char ('L');
+ write_unsigned_number (delta - 1);
+ }
+ else
+ G.need_abi_warning = true;
+ }
+ write_char ('p');
write_compact_number (index - 1);
}
else if (DECL_P (expr))
diff --git a/gcc/cp/method.c b/gcc/cp/method.c
index 3f0baed29a4..47f18081063 100644
--- a/gcc/cp/method.c
+++ b/gcc/cp/method.c
@@ -941,8 +941,17 @@ process_subob_fn (tree fn, bool move_p, tree *spec_p, bool *trivial_p,
goto bad;
}
- if (constexpr_p && !DECL_DECLARED_CONSTEXPR_P (fn))
- *constexpr_p = false;
+ if (constexpr_p)
+ {
+ /* If this is a specialization of a constexpr template, we need to
+ force the instantiation now so that we know whether or not it's
+ really constexpr. */
+ if (DECL_DECLARED_CONSTEXPR_P (fn) && DECL_TEMPLATE_INSTANTIATION (fn)
+ && !DECL_TEMPLATE_INSTANTIATED (fn))
+ instantiate_decl (fn, /*defer_ok*/false, /*expl_class*/false);
+ if (!DECL_DECLARED_CONSTEXPR_P (fn))
+ *constexpr_p = false;
+ }
return;
@@ -1153,13 +1162,15 @@ synthesized_method_walk (tree ctype, special_function_kind sfk, bool const_p,
if (trivial_p)
*trivial_p = expected_trivial;
-#ifndef ENABLE_CHECKING
/* The TYPE_HAS_COMPLEX_* flags tell us about constraints from base
class versions and other properties of the type. But a subobject
class can be trivially copyable and yet have overload resolution
choose a template constructor for initialization, depending on
rvalueness and cv-quals. So we can't exit early for copy/move
- methods in C++0x. */
+ methods in C++0x. The same considerations apply in C++98/03, but
+ there the definition of triviality does not consider overload
+ resolution, so a constructor can be trivial even if it would otherwise
+ call a non-trivial constructor. */
if (expected_trivial
&& (!copy_arg_p || cxx_dialect < cxx0x))
{
@@ -1167,7 +1178,6 @@ synthesized_method_walk (tree ctype, special_function_kind sfk, bool const_p,
*constexpr_p = synthesized_default_constructor_is_constexpr (ctype);
return;
}
-#endif
++cp_unevaluated_operand;
++c_inhibit_evaluation_warnings;
@@ -1300,14 +1310,6 @@ synthesized_method_walk (tree ctype, special_function_kind sfk, bool const_p,
if (spec_p)
*spec_p = merge_exception_specifiers (*spec_p, cleanup_spec);
}
-
-#ifdef ENABLE_CHECKING
- /* If we expected this to be trivial but it isn't, then either we're in
- C++0x mode and this is a copy/move ctor/op= or there's an error. */
- gcc_assert (!(trivial_p && expected_trivial && !*trivial_p)
- || (copy_arg_p && cxx_dialect >= cxx0x)
- || errorcount);
-#endif
}
/* DECL is a deleted function. If it's implicitly deleted, explain why and
diff --git a/gcc/cp/name-lookup.c b/gcc/cp/name-lookup.c
index e2e54507c46..4117202351d 100644
--- a/gcc/cp/name-lookup.c
+++ b/gcc/cp/name-lookup.c
@@ -1635,6 +1635,22 @@ getdecls (void)
return current_binding_level->names;
}
+/* Return how many function prototypes we are currently nested inside. */
+
+int
+function_parm_depth (void)
+{
+ int level = 0;
+ struct cp_binding_level *b;
+
+ for (b = current_binding_level;
+ b->kind == sk_function_parms;
+ b = b->level_chain)
+ ++level;
+
+ return level;
+}
+
/* For debugging. */
static int no_print_functions = 0;
static int no_print_builtins = 0;
diff --git a/gcc/cp/name-lookup.h b/gcc/cp/name-lookup.h
index f81a5659ac4..bfcac69c110 100644
--- a/gcc/cp/name-lookup.h
+++ b/gcc/cp/name-lookup.h
@@ -333,6 +333,7 @@ extern bool pushdecl_class_level (tree);
extern tree pushdecl_namespace_level (tree, bool);
extern bool push_class_level_binding (tree, tree);
extern tree getdecls (void);
+extern int function_parm_depth (void);
extern tree cp_namespace_decls (tree);
extern void set_decl_namespace (tree, tree, bool);
extern void push_decl_namespace (tree);
diff --git a/gcc/cp/optimize.c b/gcc/cp/optimize.c
index b00bc28f030..ed59f91eff3 100644
--- a/gcc/cp/optimize.c
+++ b/gcc/cp/optimize.c
@@ -256,6 +256,7 @@ maybe_clone_body (tree fn)
/* Update CLONE's source position information to match FN's. */
DECL_SOURCE_LOCATION (clone) = DECL_SOURCE_LOCATION (fn);
DECL_DECLARED_INLINE_P (clone) = DECL_DECLARED_INLINE_P (fn);
+ DECL_DECLARED_CONSTEXPR_P (clone) = DECL_DECLARED_CONSTEXPR_P (fn);
DECL_COMDAT (clone) = DECL_COMDAT (fn);
DECL_WEAK (clone) = DECL_WEAK (fn);
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index 41f82ac4747..314a2ff2c49 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -7266,10 +7266,19 @@ cp_parser_constant_expression (cp_parser* parser,
= saved_integral_constant_expression_p;
parser->allow_non_integral_constant_expression_p
= saved_allow_non_integral_constant_expression_p;
+ if (cxx_dialect >= cxx0x)
+ {
+ /* Require an rvalue constant expression here; that's what our
+ callers expect. Reference constant expressions are handled
+ separately in e.g. cp_parser_template_argument. */
+ bool is_const = potential_rvalue_constant_expression (expression);
+ parser->non_integral_constant_expression_p = !is_const;
+ if (!is_const && !allow_non_constant_p)
+ require_potential_rvalue_constant_expression (expression);
+ }
if (allow_non_constant_p)
*non_constant_p = parser->non_integral_constant_expression_p;
- else if (parser->non_integral_constant_expression_p
- && cxx_dialect < cxx0x)
+ else if (parser->non_integral_constant_expression_p)
expression = error_mark_node;
parser->non_integral_constant_expression_p
= saved_non_integral_constant_expression_p;
@@ -10212,6 +10221,7 @@ cp_parser_static_assert(cp_parser *parser, bool member_p)
tree message;
cp_token *token;
location_t saved_loc;
+ bool dummy;
/* Peek at the `static_assert' token so we can keep track of exactly
where the static assertion started. */
@@ -10231,11 +10241,12 @@ cp_parser_static_assert(cp_parser *parser, bool member_p)
/* Parse the `(' starting the static assertion condition. */
cp_parser_require (parser, CPP_OPEN_PAREN, RT_OPEN_PAREN);
- /* Parse the constant-expression. */
+ /* Parse the constant-expression. Allow a non-constant expression
+ here in order to give better diagnostics in finish_static_assert. */
condition =
cp_parser_constant_expression (parser,
- /*allow_non_constant_p=*/false,
- /*non_constant_p=*/NULL);
+ /*allow_non_constant_p=*/true,
+ /*non_constant_p=*/&dummy);
/* Parse the separating `,'. */
cp_parser_require (parser, CPP_COMMA, RT_COMMA);
@@ -13763,6 +13774,10 @@ cp_parser_enumerator_definition (cp_parser* parser, tree type)
if (check_for_bare_parameter_packs (value))
value = error_mark_node;
+ /* integral_constant_value will pull out this expression, so make sure
+ it's folded as appropriate. */
+ value = fold_non_dependent_expr (value);
+
/* Create the enumerator. */
build_enumerator (identifier, value, type, loc);
}
@@ -15111,7 +15126,7 @@ cp_parser_direct_declarator (cp_parser* parser,
= cp_parser_constant_expression (parser,
/*allow_non_constant=*/true,
&non_constant_p);
- if (!non_constant_p || cxx_dialect >= cxx0x)
+ if (!non_constant_p)
/* OK */;
/* Normally, the array bound must be an integral constant
expression. However, as an extension, we allow VLAs
@@ -15938,6 +15953,7 @@ cp_parser_parameter_declaration_list (cp_parser* parser, bool *is_error)
{
retrofit_lang_decl (decl);
DECL_PARM_INDEX (decl) = ++index;
+ DECL_PARM_LEVEL (decl) = function_parm_depth ();
}
/* Add the new parameter to the list. */
@@ -16870,6 +16886,7 @@ cp_parser_class_specifier (cp_parser* parser)
tree old_scope = NULL_TREE;
tree scope = NULL_TREE;
tree bases;
+ cp_token *closing_brace;
push_deferring_access_checks (dk_no_deferred);
@@ -16939,7 +16956,7 @@ cp_parser_class_specifier (cp_parser* parser)
cp_parser_member_specification_opt (parser);
/* Look for the trailing `}'. */
- cp_parser_require (parser, CPP_CLOSE_BRACE, RT_CLOSE_BRACE);
+ closing_brace = cp_parser_require (parser, CPP_CLOSE_BRACE, RT_CLOSE_BRACE);
/* Look for trailing attributes to apply to this class. */
if (cp_parser_allow_gnu_extensions_p (parser))
attributes = cp_parser_attributes_opt (parser);
@@ -16998,18 +17015,15 @@ cp_parser_class_specifier (cp_parser* parser)
class Z { }
static const <type> var = ...; */
case CPP_KEYWORD:
- if (keyword_is_storage_class_specifier (token->keyword)
- || keyword_is_type_qualifier (token->keyword))
+ if (keyword_is_decl_specifier (token->keyword))
{
cp_token *lookahead = cp_lexer_peek_nth_token (parser->lexer, 2);
- if (lookahead->type == CPP_KEYWORD
- && !keyword_begins_type_specifier (lookahead->keyword))
- want_semicolon = false;
- else if (lookahead->type == CPP_NAME)
- /* Handling user-defined types here would be nice, but
- very tricky. */
- want_semicolon = false;
+ /* Handling user-defined types here would be nice, but very
+ tricky. */
+ want_semicolon
+ = (lookahead->type == CPP_KEYWORD
+ && keyword_begins_type_specifier (lookahead->keyword));
}
break;
default:
@@ -17017,8 +17031,9 @@ cp_parser_class_specifier (cp_parser* parser)
}
/* If we don't have a type, then something is very wrong and we
- shouldn't try to do anything clever. */
- if (TYPE_P (type) && want_semicolon)
+ shouldn't try to do anything clever. Likewise for not seeing the
+ closing brace. */
+ if (closing_brace && TYPE_P (type) && want_semicolon)
{
cp_token_position prev
= cp_lexer_previous_token_position (parser->lexer);
@@ -19919,8 +19934,11 @@ cp_parser_template_declaration_after_export (cp_parser* parser, bool member_p)
parameter_list = NULL_TREE;
}
else
- /* Parse the template parameters. */
- parameter_list = cp_parser_template_parameter_list (parser);
+ {
+ /* Parse the template parameters. */
+ parameter_list = cp_parser_template_parameter_list (parser);
+ fixup_template_parms ();
+ }
/* Get the deferred access checks from the parameter list. These
will be checked once we know what is being declared, as for a
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index 01f8cd772fb..ed9d28b0b2f 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -53,7 +53,7 @@ typedef int (*tree_fn_t) (tree, void*);
/* The PENDING_TEMPLATES is a TREE_LIST of templates whose
instantiations have been deferred, either because their definitions
were not yet available, or because we were putting off doing the work. */
-struct GTY (()) pending_template {
+struct GTY ((chain_next ("%h.next"))) pending_template {
struct pending_template *next;
struct tinst_level *tinst;
};
@@ -194,7 +194,6 @@ static tree template_parm_to_arg (tree t);
static tree current_template_args (void);
static tree fixup_template_type_parm_type (tree, int);
static tree fixup_template_parm_index (tree, tree, int);
-static void fixup_template_parms (void);
static tree tsubst_template_parm (tree, tree, tsubst_flags_t);
/* Make the current scope suitable for access checking when we are
@@ -3614,8 +3613,6 @@ end_template_parm_list (tree parms)
TREE_CHAIN (parm) = NULL_TREE;
}
- fixup_template_parms ();
-
--processing_template_parmlist;
return saved_parmlist;
@@ -3774,21 +3771,16 @@ fixup_template_parm (tree parm_desc,
{
/* PARM is a template template parameter. This is going to
be interesting. */
- tree tparms, targs, innermost_args;
+ tree tparms, targs, innermost_args, t;
int j;
- /* First, fix up the type of the parm. */
+ /* First, fix up the parms of the template template parm
+ because the parms are involved in defining the new canonical
+ type of the template template parm. */
- tree t =
- fixup_template_type_parm_type (TREE_TYPE (parm), num_parms);
- TREE_TYPE (parm) = t;
-
- TREE_VEC_ELT (fixedup_args, idx) =
- template_parm_to_arg (parm_desc);
-
- /* Now we need to substitute the template parm types that
- have been fixed up so far into the non-type template
- parms of this template template parm. E.g, consider this:
+ /* So we need to substitute the template parm types that have
+ been fixed up so far into the template parms of this template
+ template parm. E.g, consider this:
template<class T, template<T u> class TT> class S;
@@ -3827,6 +3819,14 @@ fixup_template_parm (tree parm_desc,
TREE_VEC_LENGTH (tparms),
targs);
}
+
+ /* Now fix up the type of the template template parm. */
+
+ t = fixup_template_type_parm_type (TREE_TYPE (parm), num_parms);
+ TREE_TYPE (parm) = t;
+
+ TREE_VEC_ELT (fixedup_args, idx) =
+ template_parm_to_arg (parm_desc);
}
else if (TREE_CODE (parm) == PARM_DECL)
{
@@ -3882,11 +3882,11 @@ fixup_template_parm (tree parm_desc,
pop_deferring_access_checks ();
}
-/* Walk current the template parms and properly compute the canonical
+/* Walk the current template parms and properly compute the canonical
types of the dependent types created during
cp_parser_template_parameter_list. */
-static void
+void
fixup_template_parms (void)
{
tree arglist;
@@ -3911,8 +3911,6 @@ fixup_template_parms (void)
arglist = current_template_args ();
arglist = add_outermost_template_args (arglist, fixedup_args);
- fixedup_args = INNERMOST_TEMPLATE_ARGS (arglist);
-
/* Let's do the proper fixup now. */
for (i = 0; i < num_parms; ++i)
fixup_template_parm (TREE_VEC_ELT (parameter_vec, i),
@@ -5159,6 +5157,7 @@ fold_non_dependent_expr_sfinae (tree expr, tsubst_flags_t complain)
as two declarations of the same function, for example. */
if (processing_template_decl
&& !type_dependent_expression_p (expr)
+ && potential_constant_expression (expr)
&& !value_dependent_expression_p (expr))
{
HOST_WIDE_INT saved_processing_template_decl;
@@ -6994,6 +6993,8 @@ lookup_template_class (tree d1,
SET_SCOPED_ENUM_P (t, SCOPED_ENUM_P (template_type));
}
SET_OPAQUE_ENUM_P (t, OPAQUE_ENUM_P (template_type));
+ ENUM_FIXED_UNDERLYING_TYPE_P (t)
+ = ENUM_FIXED_UNDERLYING_TYPE_P (template_type);
}
else
{
@@ -8710,19 +8711,51 @@ tsubst_pack_expansion (tree t, tree args, tsubst_flags_t complain,
return result;
}
+ /* For clarity in the comments below let's use the
+ representation 'argument_pack<elements>' to denote an
+ argument pack and its elements.
+
+ In the 'if' block below, we want to detect cases where
+ ARG_PACK is argument_pack<PARM_PACK...>. I.e, we want to
+ check if ARG_PACK is an argument pack which sole element is
+ the expansion of PARM_PACK. That argument pack is typically
+ created by template_parm_to_arg when passed a parameter
+ pack. */
if (arg_pack
&& TREE_VEC_LENGTH (ARGUMENT_PACK_ARGS (arg_pack)) == 1
&& PACK_EXPANSION_P (TREE_VEC_ELT (ARGUMENT_PACK_ARGS (arg_pack), 0)))
{
tree expansion = TREE_VEC_ELT (ARGUMENT_PACK_ARGS (arg_pack), 0);
tree pattern = PACK_EXPANSION_PATTERN (expansion);
- if ((TYPE_P (pattern) && same_type_p (pattern, parm_pack))
- || (!TYPE_P (pattern) && cp_tree_equal (parm_pack, pattern)))
- /* The argument pack that the parameter maps to is just an
- expansion of the parameter itself, such as one would
- find in the implicit typedef of a class inside the
- class itself. Consider this parameter "unsubstituted",
- so that we will maintain the outer pack expansion. */
+ /* So we have an argument_pack<P...>. We want to test if P
+ is actually PARM_PACK. We will not use cp_tree_equal to
+ test P and PARM_PACK because during type fixup (by
+ fixup_template_parm) P can be a pre-fixup version of a
+ type and PARM_PACK be its post-fixup version.
+ cp_tree_equal would consider them as different even
+ though we would want to consider them compatible for our
+ precise purpose here.
+
+ Thus we are going to consider that P and PARM_PACK are
+ compatible if they have the same DECL. */
+ if ((/* If ARG_PACK is a type parameter pack named by the
+ same DECL as parm_pack ... */
+ (TYPE_P (pattern)
+ && TYPE_P (parm_pack)
+ && TYPE_NAME (pattern) == TYPE_NAME (parm_pack))
+ /* ... or if ARG_PACK is a non-type parameter
+ named by the same DECL as parm_pack ... */
+ || (TREE_CODE (pattern) == TEMPLATE_PARM_INDEX
+ && TREE_CODE (parm_pack) == PARM_DECL
+ && TEMPLATE_PARM_DECL (pattern)
+ == TEMPLATE_PARM_DECL (DECL_INITIAL (parm_pack))))
+ && template_parameter_pack_p (pattern))
+ /* ... then the argument pack that the parameter maps to
+ is just an expansion of the parameter itself, such as
+ one would find in the implicit typedef of a class
+ inside the class itself. Consider this parameter
+ "unsubstituted", so that we will maintain the outer
+ pack expansion. */
arg_pack = NULL_TREE;
}
@@ -11381,11 +11414,18 @@ tsubst_copy (tree t, tree args, tsubst_flags_t complain, tree in_decl)
case SIZEOF_EXPR:
if (PACK_EXPANSION_P (TREE_OPERAND (t, 0)))
{
- /* We only want to compute the number of arguments. */
- tree expanded = tsubst_pack_expansion (TREE_OPERAND (t, 0), args,
- complain, in_decl);
+
+ tree expanded;
int len = 0;
+ ++cp_unevaluated_operand;
+ ++c_inhibit_evaluation_warnings;
+ /* We only want to compute the number of arguments. */
+ expanded = tsubst_pack_expansion (TREE_OPERAND (t, 0), args,
+ complain, in_decl);
+ --cp_unevaluated_operand;
+ --c_inhibit_evaluation_warnings;
+
if (TREE_CODE (expanded) == TREE_VEC)
len = TREE_VEC_LENGTH (expanded);
@@ -17913,7 +17953,7 @@ dependent_type_p_r (tree type)
}
/* Returns TRUE if TYPE is dependent, in the sense of
- [temp.dep.type]. */
+ [temp.dep.type]. Note that a NULL type is considered dependent. */
bool
dependent_type_p (tree type)
@@ -17964,11 +18004,11 @@ dependent_scope_p (tree scope)
[temp.dep.constexpr]. EXPRESSION is already known to be a constant
expression. */
-/* FIXME this predicate is not appropriate for general expressions; the
- predicates we want instead are "valid constant expression, value
- dependent or not?", "really constant expression, not value dependent?"
- and "instantiation-dependent?". Try to integrate with
- potential_constant_expression?
+/* Note that this predicate is not appropriate for general expressions;
+ only constant expressions (that satisfy potential_constant_expression)
+ can be tested for value dependence.
+
+ We should really also have a predicate for "instantiation-dependent".
fold_non_dependent_expr: fold if constant and not type-dependent and not value-dependent.
(what about instantiation-dependent constant-expressions?)
@@ -18051,6 +18091,7 @@ value_dependent_expression_p (tree expression)
case SIZEOF_EXPR:
case ALIGNOF_EXPR:
+ case TYPEID_EXPR:
/* A `sizeof' expression is value-dependent if the operand is
type-dependent or is a pack expansion. */
expression = TREE_OPERAND (expression, 0);
@@ -18185,7 +18226,10 @@ value_dependent_expression_p (tree expression)
}
/* Returns TRUE if the EXPRESSION is type-dependent, in the sense of
- [temp.dep.expr]. */
+ [temp.dep.expr]. Note that an expression with no type is
+ considered dependent. Other parts of the compiler arrange for an
+ expression with type-dependent subexpressions to have no type, so
+ this function doesn't have to be fully recursive. */
bool
type_dependent_expression_p (tree expression)
@@ -18915,7 +18959,11 @@ do_auto_deduction (tree type, tree init, tree auto_node)
DEDUCE_CALL, LOOKUP_NORMAL);
if (val > 0)
{
- error ("unable to deduce %qT from %qE", type, init);
+ if (type && type != error_mark_node)
+ /* If type is error_mark_node a diagnostic must have been
+ emitted by now. Also, having a mention to '<type error>'
+ in the diagnostic is not really useful to the user. */
+ error ("unable to deduce %qT from %qE", type, init);
return error_mark_node;
}
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c
index 285b764e2c7..199084a6008 100644
--- a/gcc/cp/semantics.c
+++ b/gcc/cp/semantics.c
@@ -4,7 +4,7 @@
and during the instantiation of template functions.
Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
- 2008, 2009, 2010 Free Software Foundation, Inc.
+ 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
Written by Mark Mitchell (mmitchell@usa.net) based on code found
formerly in parse.y and pt.c.
@@ -860,8 +860,9 @@ begin_for_stmt (tree scope, tree init)
if (scope == NULL_TREE)
{
- gcc_assert (!init);
- scope = begin_for_scope (&init);
+ gcc_assert (!init || !(flag_new_for_scope > 0));
+ if (!init)
+ scope = begin_for_scope (&init);
}
FOR_INIT_STMT (r) = init;
TREE_CHAIN (r) = scope;
@@ -962,8 +963,9 @@ begin_range_for_stmt (tree scope, tree init)
if (scope == NULL_TREE)
{
- gcc_assert (!init);
- scope = begin_for_scope (&init);
+ gcc_assert (!init || !(flag_new_for_scope > 0));
+ if (!init)
+ scope = begin_for_scope (&init);
}
/* RANGE_FOR_STMTs do not use nor save the init tree, so we
@@ -1531,6 +1533,9 @@ finish_non_static_data_member (tree decl, tree object, tree qualifying_scope)
object = maybe_dummy_object (scope, NULL);
}
+ if (object == error_mark_node)
+ return error_mark_node;
+
/* DR 613: Can use non-static data members without an associated
object in sizeof/decltype/alignof. */
if (is_dummy_object (object) && cp_unevaluated_operand == 0
@@ -2026,8 +2031,19 @@ finish_call_expr (tree fn, VEC(tree,gc) **args, bool disallow_virtual,
if (processing_template_decl)
{
+ /* If the call expression is dependent, build a CALL_EXPR node
+ with no type; type_dependent_expression_p recognizes
+ expressions with no type as being dependent. */
if (type_dependent_expression_p (fn)
- || any_type_dependent_arguments_p (*args))
+ || any_type_dependent_arguments_p (*args)
+ /* For a non-static member function, we need to specifically
+ test the type dependency of the "this" pointer because it
+ is not included in *ARGS even though it is considered to
+ be part of the list of arguments. Note that this is
+ related to CWG issues 515 and 1005. */
+ || ((TREE_CODE (TREE_TYPE (fn)) == METHOD_TYPE)
+ && current_class_ref
+ && type_dependent_expression_p (current_class_ref)))
{
result = build_nt_call_vec (fn, *args);
KOENIG_LOOKUP_P (result) = koenig_p;
@@ -2322,7 +2338,7 @@ finish_fname (tree id)
tree decl;
decl = fname_decl (input_location, C_RID_CODE (id), id);
- if (processing_template_decl)
+ if (processing_template_decl && current_function_decl)
decl = DECL_NAME (decl);
return decl;
}
@@ -3135,7 +3151,8 @@ finish_id_expression (tree id_expression,
/* Only certain kinds of names are allowed in constant
expression. Enumerators and template parameters have already
been handled above. */
- if (integral_constant_expression_p
+ if (! error_operand_p (decl)
+ && integral_constant_expression_p
&& ! decl_constant_var_p (decl)
&& ! builtin_valid_in_constant_expr_p (decl))
{
@@ -3480,7 +3497,8 @@ expand_or_defer_fn_1 (tree fn)
if ((flag_keep_inline_functions
&& DECL_DECLARED_INLINE_P (fn)
&& !DECL_REALLY_EXTERN (fn))
- || lookup_attribute ("dllexport", DECL_ATTRIBUTES (fn)))
+ || (flag_keep_inline_dllexport
+ && lookup_attribute ("dllexport", DECL_ATTRIBUTES (fn))))
mark_needed (fn);
}
@@ -4754,6 +4772,7 @@ finish_decltype_type (tree expr, bool id_expression_or_member_access_p)
return error_mark_node;
}
+ /* FIXME instantiation-dependent */
if (type_dependent_expression_p (expr)
/* In a template, a COMPONENT_REF has an IDENTIFIER_NODE for op1 even
if it isn't dependent, so that we can check access control at
@@ -4762,27 +4781,6 @@ finish_decltype_type (tree expr, bool id_expression_or_member_access_p)
&& processing_template_decl
&& TREE_CODE (expr) == COMPONENT_REF))
{
- if (id_expression_or_member_access_p)
- {
- switch (TREE_CODE (expr))
- {
- case VAR_DECL:
- case PARM_DECL:
- case RESULT_DECL:
- case FUNCTION_DECL:
- case CONST_DECL:
- case TEMPLATE_PARM_INDEX:
- type = TREE_TYPE (expr);
- break;
-
- default:
- break;
- }
- }
-
- if (type && !type_uses_auto (type))
- return type;
-
treat_as_dependent:
type = cxx_make_type (DECLTYPE_TYPE);
DECLTYPE_TYPE_EXPR (type) = expr;
@@ -5474,6 +5472,16 @@ build_data_member_initialization (tree t, VEC(constructor_elt,gc) **vec)
t = TREE_OPERAND (t, 0);
if (t == error_mark_node)
return false;
+ if (TREE_CODE (t) == STATEMENT_LIST)
+ {
+ tree_stmt_iterator i;
+ for (i = tsi_start (t); !tsi_end_p (i); tsi_next (&i))
+ {
+ if (! build_data_member_initialization (tsi_stmt (i), vec))
+ return false;
+ }
+ return true;
+ }
if (TREE_CODE (t) == CLEANUP_STMT)
{
/* We can't see a CLEANUP_STMT in a constructor for a literal class,
@@ -5481,18 +5489,7 @@ build_data_member_initialization (tree t, VEC(constructor_elt,gc) **vec)
ignore it; either all the initialization will be constant, in which
case the cleanup can't run, or it can't be constexpr.
Still recurse into CLEANUP_BODY. */
- t = CLEANUP_BODY (t);
- if (TREE_CODE (t) == STATEMENT_LIST)
- {
- tree_stmt_iterator i;
- for (i = tsi_start (t); !tsi_end_p (i); tsi_next (&i))
- {
- if (! build_data_member_initialization (tsi_stmt (i), vec))
- return false;
- }
- return true;
- }
- return build_data_member_initialization (t, vec);
+ return build_data_member_initialization (CLEANUP_BODY (t), vec);
}
if (TREE_CODE (t) == CONVERT_EXPR)
t = TREE_OPERAND (t, 0);
@@ -5532,7 +5529,7 @@ build_data_member_initialization (tree t, VEC(constructor_elt,gc) **vec)
gcc_assert (is_empty_class (TREE_TYPE (TREE_TYPE (member))));
/* But if the initializer isn't constexpr, leave it in so we
complain later. */
- if (potential_constant_expression (init, tf_none))
+ if (potential_constant_expression (init))
return true;
}
}
@@ -5605,7 +5602,20 @@ build_constexpr_constructor_member_initializers (tree type, tree body)
body = STATEMENT_LIST_HEAD (body)->stmt;
body = BIND_EXPR_BODY (body);
if (TREE_CODE (body) == CLEANUP_POINT_EXPR)
- ok = build_data_member_initialization (body, &vec);
+ {
+ body = TREE_OPERAND (body, 0);
+ if (TREE_CODE (body) == EXPR_STMT)
+ body = TREE_OPERAND (body, 0);
+ if (TREE_CODE (body) == INIT_EXPR
+ && (same_type_ignoring_top_level_qualifiers_p
+ (TREE_TYPE (TREE_OPERAND (body, 0)),
+ current_class_type)))
+ {
+ /* Trivial copy. */
+ return TREE_OPERAND (body, 1);
+ }
+ ok = build_data_member_initialization (body, &vec);
+ }
else if (TREE_CODE (body) == STATEMENT_LIST)
{
tree_stmt_iterator i;
@@ -5658,10 +5668,11 @@ register_constexpr_fundef (tree fun, tree body)
body = unshare_expr (TREE_OPERAND (body, 0));
}
- if (!potential_constant_expression (body, (DECL_TEMPLATE_INSTANTIATION (fun)
- ? tf_none : tf_error)))
+ if (!potential_constant_expression (body))
{
DECL_DECLARED_CONSTEXPR_P (fun) = false;
+ if (!DECL_TEMPLATE_INSTANTIATION (fun))
+ require_potential_constant_expression (body);
return NULL;
}
fundef->body = body;
@@ -5988,6 +5999,14 @@ cxx_eval_call_expression (const constexpr_call *old_call, tree t,
return t;
}
+ /* Shortcut trivial copy constructor/op=. */
+ if (call_expr_nargs (t) == 2 && trivial_fn_p (fun))
+ {
+ tree arg = convert_from_reference (get_nth_callarg (t, 1));
+ return cxx_eval_constant_expression (old_call, arg, allow_non_constant,
+ addr, non_constant_p);
+ }
+
/* If in direct recursive call, optimize definition search. */
if (old_call != NULL && old_call->fundef->decl == fun)
new_call.fundef = old_call->fundef;
@@ -6729,7 +6748,10 @@ cxx_eval_constant_expression (const constexpr_call *call, tree t,
tree type = TREE_TYPE (r);
error ("the value of %qD is not usable in a constant "
"expression", r);
- if (INTEGRAL_OR_ENUMERATION_TYPE_P (type))
+ if (DECL_DECLARED_CONSTEXPR_P (r))
+ inform (DECL_SOURCE_LOCATION (r),
+ "%qD used in its own initializer", r);
+ else if (INTEGRAL_OR_ENUMERATION_TYPE_P (type))
{
if (!CP_TYPE_CONST_P (type))
inform (DECL_SOURCE_LOCATION (r),
@@ -7023,6 +7045,7 @@ cxx_eval_constant_expression (const constexpr_call *call, tree t,
case NON_DEPENDENT_EXPR:
case BASELINK:
case EXPR_STMT:
+ case OFFSET_REF:
if (!allow_non_constant)
error_at (EXPR_LOC_OR_HERE (t),
"expression %qE is not a constant-expression", t);
@@ -7115,8 +7138,8 @@ maybe_constant_value (tree t)
tree r;
if (type_dependent_expression_p (t)
- /* FIXME shouldn't check value-dependence first; see comment before
- value_dependent_expression_p. */
+ || type_unknown_p (t)
+ || !potential_constant_expression (t)
|| value_dependent_expression_p (t))
return t;
@@ -7148,6 +7171,8 @@ maybe_constant_init (tree t)
return t;
}
+#if 0
+/* FIXME see ADDR_EXPR section in potential_constant_expression_1. */
/* Return true if the object referred to by REF has automatic or thread
local storage. */
@@ -7170,6 +7195,7 @@ check_automatic_or_tls (tree ref)
dk = decl_storage_duration (decl);
return (dk == dk_auto || dk == dk_thread) ? ck_bad : ck_ok;
}
+#endif
/* Return true if the DECL designates a builtin function that is
morally constexpr, in the sense that its parameter types and
@@ -7197,13 +7223,11 @@ morally_constexpr_builtin_function_p (tree decl)
return t != NULL;
}
-/* Return true if T denotes a constant expression, or potential constant
- expression if POTENTIAL is true.
- Issue diagnostic as appropriate under control of flags. Variables
- with static storage duration initialized by constant expressions
- are guaranteed to be statically initialized.
+/* Return true if T denotes a potentially constant expression. Issue
+ diagnostic as appropriate under control of FLAGS. If WANT_RVAL is true,
+ an lvalue-rvalue conversion is implied.
- C++0x [expr.const]
+ C++0x [expr.const] used to say
6 An expression is a potential constant expression if it is
a constant expression where all occurences of function
@@ -7216,13 +7240,23 @@ morally_constexpr_builtin_function_p (tree decl)
logical OR (5.15), and conditional (5.16) operations that are
not evaluated are not considered. */
-bool
-potential_constant_expression (tree t, tsubst_flags_t flags)
+static bool
+potential_constant_expression_1 (tree t, bool want_rval, tsubst_flags_t flags)
{
+ enum { any = false, rval = true };
int i;
tree tmp;
+
+ /* C++98 has different rules for the form of a constant expression that
+ are enforced in the parser, so we can assume that anything that gets
+ this far is suitable. */
+ if (cxx_dialect < cxx0x)
+ return true;
+
if (t == error_mark_node)
return false;
+ if (t == NULL_TREE)
+ return true;
if (TREE_THIS_VOLATILE (t))
{
if (flags & tf_error)
@@ -7235,8 +7269,19 @@ potential_constant_expression (tree t, tsubst_flags_t flags)
switch (TREE_CODE (t))
{
case FUNCTION_DECL:
+ case BASELINK:
+ case TEMPLATE_DECL:
+ case OVERLOAD:
+ case TEMPLATE_ID_EXPR:
case LABEL_DECL:
case CONST_DECL:
+ case SIZEOF_EXPR:
+ case ALIGNOF_EXPR:
+ case OFFSETOF_EXPR:
+ case NOEXCEPT_EXPR:
+ case TEMPLATE_PARM_INDEX:
+ case TRAIT_EXPR:
+ case IDENTIFIER_NODE:
return true;
case PARM_DECL:
@@ -7261,7 +7306,7 @@ potential_constant_expression (tree t, tsubst_flags_t flags)
const int nargs = call_expr_nargs (t);
if (TREE_CODE (fun) != FUNCTION_DECL)
{
- if (potential_constant_expression (fun, flags))
+ if (potential_constant_expression_1 (fun, rval, flags))
/* Might end up being a constant function pointer. */
return true;
if (flags & tf_error)
@@ -7293,11 +7338,9 @@ potential_constant_expression (tree t, tsubst_flags_t flags)
if (i == 0 && DECL_NONSTATIC_MEMBER_P (fun)
&& !DECL_CONSTRUCTOR_P (fun))
{
- if (TREE_CODE (x) == ADDR_EXPR)
- x = TREE_OPERAND (x, 0);
if (is_this_parameter (x))
/* OK. */;
- else if (!potential_constant_expression (x, flags))
+ else if (!potential_constant_expression_1 (x, rval, flags))
{
if (flags & tf_error)
error ("object argument is not a potential constant "
@@ -7305,7 +7348,7 @@ potential_constant_expression (tree t, tsubst_flags_t flags)
return false;
}
}
- else if (!potential_constant_expression (x, flags))
+ else if (!potential_constant_expression_1 (x, rval, flags))
{
if (flags & tf_error)
error ("argument in position %qP is not a "
@@ -7325,10 +7368,10 @@ potential_constant_expression (tree t, tsubst_flags_t flags)
-- an lvalue of literal type that refers to non-volatile
object defined with constexpr, or that refers to a
sub-object of such an object; */
- return potential_constant_expression (TREE_OPERAND (t, 0), flags);
+ return potential_constant_expression_1 (TREE_OPERAND (t, 0), rval, flags);
case VAR_DECL:
- if (!decl_constant_var_p (t))
+ if (want_rval && !decl_constant_var_p (t))
{
if (flags & tf_error)
error ("variable %qD is not declared constexpr", t);
@@ -7358,7 +7401,8 @@ potential_constant_expression (tree t, tsubst_flags_t flags)
"cannot yield a constant expression", from);
return false;
}
- return potential_constant_expression (from, flags);
+ return (potential_constant_expression_1
+ (from, TREE_CODE (t) != VIEW_CONVERT_EXPR, flags));
}
case ADDR_EXPR:
@@ -7366,6 +7410,10 @@ potential_constant_expression (tree t, tsubst_flags_t flags)
designates an object with thread or automatic storage
duration; */
t = TREE_OPERAND (t, 0);
+#if 0
+ /* FIXME adjust when issue 1197 is fully resolved. For now don't do
+ any checking here, as we might dereference the pointer later. If
+ we remove this code, also remove check_automatic_or_tls. */
i = check_automatic_or_tls (t);
if (i == ck_ok)
return true;
@@ -7376,15 +7424,23 @@ potential_constant_expression (tree t, tsubst_flags_t flags)
"automatic storage is not a constant expression", t);
return false;
}
- return potential_constant_expression (t, flags);
+#endif
+ return potential_constant_expression_1 (t, any, flags);
case COMPONENT_REF:
case BIT_FIELD_REF:
+ case ARROW_EXPR:
+ case OFFSET_REF:
/* -- a class member access unless its postfix-expression is
of literal type or of pointer to literal type. */
/* This test would be redundant, as it follows from the
postfix-expression being a potential constant expression. */
- return potential_constant_expression (TREE_OPERAND (t, 0), flags);
+ return potential_constant_expression_1 (TREE_OPERAND (t, 0),
+ want_rval, flags);
+
+ case EXPR_PACK_EXPANSION:
+ return potential_constant_expression_1 (PACK_EXPANSION_PATTERN (t),
+ want_rval, flags);
case INDIRECT_REF:
{
@@ -7392,7 +7448,7 @@ potential_constant_expression (tree t, tsubst_flags_t flags)
STRIP_NOPS (x);
if (is_this_parameter (x))
return true;
- return potential_constant_expression (x, flags);
+ return potential_constant_expression_1 (x, rval, flags);
}
case LAMBDA_EXPR:
@@ -7417,6 +7473,10 @@ potential_constant_expression (tree t, tsubst_flags_t flags)
case MUST_NOT_THROW_EXPR:
case TRY_CATCH_EXPR:
case STATEMENT_LIST:
+ /* Don't bother trying to define a subset of statement-expressions to
+ be constant-expressions, at least for now. */
+ case STMT_EXPR:
+ case EXPR_STMT:
case BIND_EXPR:
if (flags & tf_error)
error ("expression %qE is not a constant-expression", t);
@@ -7427,7 +7487,8 @@ potential_constant_expression (tree t, tsubst_flags_t flags)
class type; */
{
tree e = TREE_OPERAND (t, 0);
- if (!TYPE_P (e) && TYPE_POLYMORPHIC_P (TREE_TYPE (e)))
+ if (!TYPE_P (e) && !type_dependent_expression_p (e)
+ && TYPE_POLYMORPHIC_P (TREE_TYPE (e)))
{
if (flags & tf_error)
error ("typeid-expression is not a constant expression "
@@ -7447,6 +7508,7 @@ potential_constant_expression (tree t, tsubst_flags_t flags)
"a constant expression");
return false;
}
+ want_rval = true;
goto binary;
case LT_EXPR:
@@ -7465,6 +7527,7 @@ potential_constant_expression (tree t, tsubst_flags_t flags)
"constant expression");
return false;
}
+ want_rval = true;
goto binary;
case REALPART_EXPR:
@@ -7477,22 +7540,41 @@ potential_constant_expression (tree t, tsubst_flags_t flags)
case ABS_EXPR:
case BIT_NOT_EXPR:
case TRUTH_NOT_EXPR:
- case PAREN_EXPR:
case FIXED_CONVERT_EXPR:
+ case UNARY_PLUS_EXPR:
+ return potential_constant_expression_1 (TREE_OPERAND (t, 0), rval,
+ flags);
+
+ case CAST_EXPR:
+ case CONST_CAST_EXPR:
+ case STATIC_CAST_EXPR:
+ case REINTERPRET_CAST_EXPR:
+ return (potential_constant_expression_1
+ (TREE_OPERAND (t, 0),
+ TREE_CODE (TREE_TYPE (t)) != REFERENCE_TYPE, flags));
+
+ case PAREN_EXPR:
+ case NON_DEPENDENT_EXPR:
/* For convenience. */
case RETURN_EXPR:
- return potential_constant_expression (TREE_OPERAND (t, 0), flags);
+ return potential_constant_expression_1 (TREE_OPERAND (t, 0),
+ want_rval, flags);
+
+ case SCOPE_REF:
+ return potential_constant_expression_1 (TREE_OPERAND (t, 1),
+ want_rval, flags);
case INIT_EXPR:
case TARGET_EXPR:
- return potential_constant_expression (TREE_OPERAND (t, 1), flags);
+ return potential_constant_expression_1 (TREE_OPERAND (t, 1),
+ rval, flags);
case CONSTRUCTOR:
{
VEC(constructor_elt, gc) *v = CONSTRUCTOR_ELTS (t);
constructor_elt *ce;
for (i = 0; VEC_iterate (constructor_elt, v, i, ce); ++i)
- if (!potential_constant_expression (ce->value, flags))
+ if (!potential_constant_expression_1 (ce->value, want_rval, flags))
return false;
return true;
}
@@ -7501,11 +7583,13 @@ potential_constant_expression (tree t, tsubst_flags_t flags)
{
gcc_assert (TREE_PURPOSE (t) == NULL_TREE
|| DECL_P (TREE_PURPOSE (t)));
- if (!potential_constant_expression (TREE_VALUE (t), flags))
+ if (!potential_constant_expression_1 (TREE_VALUE (t), want_rval,
+ flags))
return false;
if (TREE_CHAIN (t) == NULL_TREE)
return true;
- return potential_constant_expression (TREE_CHAIN (t), flags);
+ return potential_constant_expression_1 (TREE_CHAIN (t), want_rval,
+ flags);
}
case TRUNC_DIV_EXPR:
@@ -7515,10 +7599,24 @@ potential_constant_expression (tree t, tsubst_flags_t flags)
case TRUNC_MOD_EXPR:
case CEIL_MOD_EXPR:
case ROUND_MOD_EXPR:
- if (integer_zerop (maybe_constant_value (TREE_OPERAND (t, 1))))
- return false;
- else
- goto binary;
+ {
+ tree denom = TREE_OPERAND (t, 1);
+ /* We can't call maybe_constant_value on an expression
+ that hasn't been through fold_non_dependent_expr yet. */
+ if (!processing_template_decl)
+ denom = maybe_constant_value (denom);
+ if (integer_zerop (denom))
+ {
+ if (flags & tf_error)
+ error ("division by zero is not a constant-expression");
+ return false;
+ }
+ else
+ {
+ want_rval = true;
+ goto binary;
+ }
+ }
case COMPOUND_EXPR:
{
@@ -7530,7 +7628,7 @@ potential_constant_expression (tree t, tsubst_flags_t flags)
STRIP_NOPS (op1);
if ((TREE_CODE (op0) == TARGET_EXPR && op1 == TARGET_EXPR_SLOT (op0))
|| TREE_CODE (op1) == EMPTY_CLASS_EXPR)
- return potential_constant_expression (op0, flags);
+ return potential_constant_expression_1 (op0, want_rval, flags);
else
goto binary;
}
@@ -7547,12 +7645,10 @@ potential_constant_expression (tree t, tsubst_flags_t flags)
tmp = boolean_false_node;
truth:
if (TREE_OPERAND (t, 0) == tmp)
- return potential_constant_expression (TREE_OPERAND (t, 1), flags);
+ return potential_constant_expression_1 (TREE_OPERAND (t, 1), rval, flags);
else
- return potential_constant_expression (TREE_OPERAND (t, 0), flags);
+ return potential_constant_expression_1 (TREE_OPERAND (t, 0), rval, flags);
- case ARRAY_REF:
- case ARRAY_RANGE_REF:
case PLUS_EXPR:
case MULT_EXPR:
case POINTER_PLUS_EXPR:
@@ -7567,6 +7663,7 @@ potential_constant_expression (tree t, tsubst_flags_t flags)
case BIT_IOR_EXPR:
case BIT_XOR_EXPR:
case BIT_AND_EXPR:
+ case TRUTH_XOR_EXPR:
case UNLT_EXPR:
case UNLE_EXPR:
case UNGT_EXPR:
@@ -7574,10 +7671,16 @@ potential_constant_expression (tree t, tsubst_flags_t flags)
case UNEQ_EXPR:
case RANGE_EXPR:
case COMPLEX_EXPR:
+ want_rval = true;
+ /* Fall through. */
+ case ARRAY_REF:
+ case ARRAY_RANGE_REF:
+ case MEMBER_REF:
+ case DOTSTAR_EXPR:
binary:
for (i = 0; i < 2; ++i)
- if (!potential_constant_expression (TREE_OPERAND (t, i),
- flags))
+ if (!potential_constant_expression_1 (TREE_OPERAND (t, i),
+ want_rval, flags))
return false;
return true;
@@ -7587,21 +7690,28 @@ potential_constant_expression (tree t, tsubst_flags_t flags)
care about; otherwise we only require that the condition and
either of the legs be potentially constant. */
tmp = TREE_OPERAND (t, 0);
- if (!potential_constant_expression (tmp, flags))
+ if (!potential_constant_expression_1 (tmp, rval, flags))
return false;
else if (tmp == boolean_true_node)
- return potential_constant_expression (TREE_OPERAND (t, 1), flags);
+ return potential_constant_expression_1 (TREE_OPERAND (t, 1),
+ want_rval, flags);
else if (tmp == boolean_false_node)
- return potential_constant_expression (TREE_OPERAND (t, 2), flags);
+ return potential_constant_expression_1 (TREE_OPERAND (t, 2),
+ want_rval, flags);
for (i = 1; i < 3; ++i)
- if (potential_constant_expression (TREE_OPERAND (t, i), tf_none))
+ if (potential_constant_expression_1 (TREE_OPERAND (t, i),
+ want_rval, tf_none))
return true;
if (flags & tf_error)
error ("expression %qE is not a constant-expression", t);
return false;
case VEC_INIT_EXPR:
- return VEC_INIT_EXPR_IS_CONSTEXPR (t);
+ if (VEC_INIT_EXPR_IS_CONSTEXPR (t))
+ return true;
+ if (flags & tf_error)
+ error ("non-constant array initialization");
+ return false;
default:
sorry ("unexpected ast of kind %s", tree_code_name[TREE_CODE (t)]);
@@ -7610,6 +7720,37 @@ potential_constant_expression (tree t, tsubst_flags_t flags)
}
}
+/* The main entry point to the above. */
+
+bool
+potential_constant_expression (tree t)
+{
+ return potential_constant_expression_1 (t, false, tf_none);
+}
+
+/* As above, but require a constant rvalue. */
+
+bool
+potential_rvalue_constant_expression (tree t)
+{
+ return potential_constant_expression_1 (t, true, tf_none);
+}
+
+/* Like above, but complain about non-constant expressions. */
+
+bool
+require_potential_constant_expression (tree t)
+{
+ return potential_constant_expression_1 (t, false, tf_warning_or_error);
+}
+
+/* Cross product of the above. */
+
+bool
+require_potential_rvalue_constant_expression (tree t)
+{
+ return potential_constant_expression_1 (t, true, tf_warning_or_error);
+}
/* Constructor for a lambda expression. */
@@ -7651,6 +7792,12 @@ build_lambda_object (tree lambda_expr)
tree field = TREE_PURPOSE (node);
tree val = TREE_VALUE (node);
+ if (field == error_mark_node)
+ {
+ expr = error_mark_node;
+ goto out;
+ }
+
if (DECL_P (val))
mark_used (val);
@@ -7686,6 +7833,7 @@ build_lambda_object (tree lambda_expr)
expr = finish_compound_literal (type, expr);
CLASSTYPE_NON_AGGREGATE (type) = 1;
+ out:
input_location = saved_loc;
return expr;
}
diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c
index 813b88d12d2..d62d2427f1e 100644
--- a/gcc/cp/tree.c
+++ b/gcc/cp/tree.c
@@ -513,9 +513,13 @@ build_vec_init_expr (tree type, tree init)
SET_EXPR_LOCATION (init, input_location);
if (current_function_decl
- && DECL_DECLARED_CONSTEXPR_P (current_function_decl)
- && potential_constant_expression (elt_init, tf_warning_or_error))
- VEC_INIT_EXPR_IS_CONSTEXPR (init) = true;
+ && DECL_DECLARED_CONSTEXPR_P (current_function_decl))
+ {
+ if (potential_constant_expression (elt_init))
+ VEC_INIT_EXPR_IS_CONSTEXPR (init) = true;
+ else if (!processing_template_decl)
+ require_potential_constant_expression (elt_init);
+ }
VEC_INIT_EXPR_VALUE_INIT (init) = value_init;
init = build_target_expr (slot, init);
@@ -2172,6 +2176,9 @@ cp_tree_equal (tree t1, tree t2)
BASELINK_FUNCTIONS (t2)));
case TEMPLATE_PARM_INDEX:
+ if (TEMPLATE_PARM_NUM_SIBLINGS (t1)
+ != TEMPLATE_PARM_NUM_SIBLINGS (t2))
+ return false;
return (TEMPLATE_PARM_IDX (t1) == TEMPLATE_PARM_IDX (t2)
&& TEMPLATE_PARM_LEVEL (t1) == TEMPLATE_PARM_LEVEL (t2)
&& (TEMPLATE_PARM_PARAMETER_PACK (t1)
diff --git a/gcc/cselib.c b/gcc/cselib.c
index 118fb9bba73..1ea708dc27e 100644
--- a/gcc/cselib.c
+++ b/gcc/cselib.c
@@ -1,6 +1,6 @@
/* Common subexpression elimination library for GNU compiler.
Copyright (C) 1987, 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
- 1999, 2000, 2001, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
+ 1999, 2000, 2001, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
Free Software Foundation, Inc.
This file is part of GCC.
@@ -61,7 +61,8 @@ static void unchain_one_elt_loc_list (struct elt_loc_list **);
static int discard_useless_locs (void **, void *);
static int discard_useless_values (void **, void *);
static void remove_useless_values (void);
-static unsigned int cselib_hash_rtx (rtx, int);
+static int rtx_equal_for_cselib_1 (rtx, rtx, enum machine_mode);
+static unsigned int cselib_hash_rtx (rtx, int, enum machine_mode);
static cselib_val *new_cselib_val (unsigned int, enum machine_mode, rtx);
static void add_mem_for_addr (cselib_val *, cselib_val *, rtx);
static cselib_val *cselib_lookup_mem (rtx, int);
@@ -389,6 +390,26 @@ cselib_get_next_uid (void)
return next_uid;
}
+/* See the documentation of cselib_find_slot below. */
+static enum machine_mode find_slot_memmode;
+
+/* Search for X, whose hashcode is HASH, in CSELIB_HASH_TABLE,
+ INSERTing if requested. When X is part of the address of a MEM,
+ MEMMODE should specify the mode of the MEM. While searching the
+ table, MEMMODE is held in FIND_SLOT_MEMMODE, so that autoinc RTXs
+ in X can be resolved. */
+
+static void **
+cselib_find_slot (rtx x, hashval_t hash, enum insert_option insert,
+ enum machine_mode memmode)
+{
+ void **slot;
+ find_slot_memmode = memmode;
+ slot = htab_find_slot_with_hash (cselib_hash_table, x, hash, insert);
+ find_slot_memmode = VOIDmode;
+ return slot;
+}
+
/* The equality test for our hash table. The first argument ENTRY is a table
element (i.e. a cselib_val), while the second arg X is an rtx. We know
that all callers of htab_find_slot_with_hash will wrap CONST_INTs into a
@@ -418,7 +439,7 @@ entry_and_rtx_equal_p (const void *entry, const void *x_arg)
/* We don't guarantee that distinct rtx's have different hash values,
so we need to do a comparison. */
for (l = v->locs; l; l = l->next)
- if (rtx_equal_for_cselib_p (l->loc, x))
+ if (rtx_equal_for_cselib_1 (l->loc, x, find_slot_memmode))
{
promote_debug_loc (l);
return 1;
@@ -630,13 +651,65 @@ cselib_reg_set_mode (const_rtx x)
int
rtx_equal_for_cselib_p (rtx x, rtx y)
{
+ return rtx_equal_for_cselib_1 (x, y, VOIDmode);
+}
+
+/* If x is a PLUS or an autoinc operation, expand the operation,
+ storing the offset, if any, in *OFF. */
+
+static rtx
+autoinc_split (rtx x, rtx *off, enum machine_mode memmode)
+{
+ switch (GET_CODE (x))
+ {
+ case PLUS:
+ *off = XEXP (x, 1);
+ return XEXP (x, 0);
+
+ case PRE_DEC:
+ if (memmode == VOIDmode)
+ return x;
+
+ *off = GEN_INT (-GET_MODE_SIZE (memmode));
+ return XEXP (x, 0);
+ break;
+
+ case PRE_INC:
+ if (memmode == VOIDmode)
+ return x;
+
+ *off = GEN_INT (GET_MODE_SIZE (memmode));
+ return XEXP (x, 0);
+
+ case PRE_MODIFY:
+ return XEXP (x, 1);
+
+ case POST_DEC:
+ case POST_INC:
+ case POST_MODIFY:
+ return XEXP (x, 0);
+
+ default:
+ return x;
+ }
+}
+
+/* Return nonzero if we can prove that X and Y contain the same value,
+ taking our gathered information into account. MEMMODE holds the
+ mode of the enclosing MEM, if any, as required to deal with autoinc
+ addressing modes. If X and Y are not (known to be) part of
+ addresses, MEMMODE should be VOIDmode. */
+
+static int
+rtx_equal_for_cselib_1 (rtx x, rtx y, enum machine_mode memmode)
+{
enum rtx_code code;
const char *fmt;
int i;
if (REG_P (x) || MEM_P (x))
{
- cselib_val *e = cselib_lookup (x, GET_MODE (x), 0);
+ cselib_val *e = cselib_lookup (x, GET_MODE (x), 0, memmode);
if (e)
x = e->val_rtx;
@@ -644,7 +717,7 @@ rtx_equal_for_cselib_p (rtx x, rtx y)
if (REG_P (y) || MEM_P (y))
{
- cselib_val *e = cselib_lookup (y, GET_MODE (y), 0);
+ cselib_val *e = cselib_lookup (y, GET_MODE (y), 0, memmode);
if (e)
y = e->val_rtx;
@@ -668,7 +741,7 @@ rtx_equal_for_cselib_p (rtx x, rtx y)
/* Avoid infinite recursion. */
if (REG_P (t) || MEM_P (t))
continue;
- else if (rtx_equal_for_cselib_p (t, y))
+ else if (rtx_equal_for_cselib_1 (t, y, memmode))
return 1;
}
@@ -686,16 +759,37 @@ rtx_equal_for_cselib_p (rtx x, rtx y)
if (REG_P (t) || MEM_P (t))
continue;
- else if (rtx_equal_for_cselib_p (x, t))
+ else if (rtx_equal_for_cselib_1 (x, t, memmode))
return 1;
}
return 0;
}
- if (GET_CODE (x) != GET_CODE (y) || GET_MODE (x) != GET_MODE (y))
+ if (GET_MODE (x) != GET_MODE (y))
return 0;
+ if (GET_CODE (x) != GET_CODE (y))
+ {
+ rtx xorig = x, yorig = y;
+ rtx xoff = NULL, yoff = NULL;
+
+ x = autoinc_split (x, &xoff, memmode);
+ y = autoinc_split (y, &yoff, memmode);
+
+ if (!xoff != !yoff)
+ return 0;
+
+ if (xoff && !rtx_equal_for_cselib_1 (xoff, yoff, memmode))
+ return 0;
+
+ /* Don't recurse if nothing changed. */
+ if (x != xorig || y != yorig)
+ return rtx_equal_for_cselib_1 (x, y, memmode);
+
+ return 0;
+ }
+
/* These won't be handled correctly by the code below. */
switch (GET_CODE (x))
{
@@ -711,6 +805,11 @@ rtx_equal_for_cselib_p (rtx x, rtx y)
case LABEL_REF:
return XEXP (x, 0) == XEXP (y, 0);
+ case MEM:
+ /* We have to compare any autoinc operations in the addresses
+ using this MEM's mode. */
+ return rtx_equal_for_cselib_1 (XEXP (x, 0), XEXP (y, 0), GET_MODE (x));
+
default:
break;
}
@@ -743,18 +842,18 @@ rtx_equal_for_cselib_p (rtx x, rtx y)
/* And the corresponding elements must match. */
for (j = 0; j < XVECLEN (x, i); j++)
- if (! rtx_equal_for_cselib_p (XVECEXP (x, i, j),
- XVECEXP (y, i, j)))
+ if (! rtx_equal_for_cselib_1 (XVECEXP (x, i, j),
+ XVECEXP (y, i, j), memmode))
return 0;
break;
case 'e':
if (i == 1
&& targetm.commutative_p (x, UNKNOWN)
- && rtx_equal_for_cselib_p (XEXP (x, 1), XEXP (y, 0))
- && rtx_equal_for_cselib_p (XEXP (x, 0), XEXP (y, 1)))
+ && rtx_equal_for_cselib_1 (XEXP (x, 1), XEXP (y, 0), memmode)
+ && rtx_equal_for_cselib_1 (XEXP (x, 0), XEXP (y, 1), memmode))
return 1;
- if (! rtx_equal_for_cselib_p (XEXP (x, i), XEXP (y, i)))
+ if (! rtx_equal_for_cselib_1 (XEXP (x, i), XEXP (y, i), memmode))
return 0;
break;
@@ -806,6 +905,8 @@ wrap_constant (enum machine_mode mode, rtx x)
that take commutativity into account.
If we wanted to also support associative rules, we'd have to use a different
strategy to avoid returning spurious 0, e.g. return ~(~0U >> 1) .
+ MEMMODE indicates the mode of an enclosing MEM, and it's only
+ used to compute autoinc values.
We used to have a MODE argument for hashing for CONST_INTs, but that
didn't make sense, since it caused spurious hash differences between
(set (reg:SI 1) (const_int))
@@ -816,7 +917,7 @@ wrap_constant (enum machine_mode mode, rtx x)
in a comparison anyway, since relying on hash differences is unsafe. */
static unsigned int
-cselib_hash_rtx (rtx x, int create)
+cselib_hash_rtx (rtx x, int create, enum machine_mode memmode)
{
cselib_val *e;
int i, j;
@@ -831,7 +932,7 @@ cselib_hash_rtx (rtx x, int create)
{
case MEM:
case REG:
- e = cselib_lookup (x, GET_MODE (x), create);
+ e = cselib_lookup (x, GET_MODE (x), create, memmode);
if (! e)
return 0;
@@ -877,7 +978,7 @@ cselib_hash_rtx (rtx x, int create)
for (i = 0; i < units; ++i)
{
elt = CONST_VECTOR_ELT (x, i);
- hash += cselib_hash_rtx (elt, 0);
+ hash += cselib_hash_rtx (elt, 0, memmode);
}
return hash;
@@ -910,10 +1011,28 @@ cselib_hash_rtx (rtx x, int create)
case PRE_DEC:
case PRE_INC:
+ /* We can't compute these without knowing the MEM mode. */
+ gcc_assert (memmode != VOIDmode);
+ i = GET_MODE_SIZE (memmode);
+ if (code == PRE_DEC)
+ i = -i;
+ /* Adjust the hash so that (mem:MEMMODE (pre_* (reg))) hashes
+ like (mem:MEMMODE (plus (reg) (const_int I))). */
+ hash += (unsigned) PLUS - (unsigned)code
+ + cselib_hash_rtx (XEXP (x, 0), create, memmode)
+ + cselib_hash_rtx (GEN_INT (i), create, memmode);
+ return hash ? hash : 1 + (unsigned) PLUS;
+
+ case PRE_MODIFY:
+ gcc_assert (memmode != VOIDmode);
+ return cselib_hash_rtx (XEXP (x, 1), create, memmode);
+
case POST_DEC:
case POST_INC:
case POST_MODIFY:
- case PRE_MODIFY:
+ gcc_assert (memmode != VOIDmode);
+ return cselib_hash_rtx (XEXP (x, 0), create, memmode);
+
case PC:
case CC0:
case CALL:
@@ -939,7 +1058,7 @@ cselib_hash_rtx (rtx x, int create)
case 'e':
{
rtx tem = XEXP (x, i);
- unsigned int tem_hash = cselib_hash_rtx (tem, create);
+ unsigned int tem_hash = cselib_hash_rtx (tem, create, memmode);
if (tem_hash == 0)
return 0;
@@ -951,7 +1070,7 @@ cselib_hash_rtx (rtx x, int create)
for (j = 0; j < XVECLEN (x, i); j++)
{
unsigned int tem_hash
- = cselib_hash_rtx (XVECEXP (x, i, j), create);
+ = cselib_hash_rtx (XVECEXP (x, i, j), create, memmode);
if (tem_hash == 0)
return 0;
@@ -1014,7 +1133,7 @@ new_cselib_val (unsigned int hash, enum machine_mode mode, rtx x)
e->locs = 0;
e->next_containing_mem = 0;
- if (dump_file && (dump_flags & TDF_DETAILS))
+ if (dump_file && (dump_flags & TDF_CSELIB))
{
fprintf (dump_file, "cselib value %u:%u ", e->uid, hash);
if (flag_dump_noaddr || flag_dump_unnumbered)
@@ -1064,6 +1183,7 @@ static cselib_val *
cselib_lookup_mem (rtx x, int create)
{
enum machine_mode mode = GET_MODE (x);
+ enum machine_mode addr_mode;
void **slot;
cselib_val *addr;
cselib_val *mem_elt;
@@ -1074,8 +1194,12 @@ cselib_lookup_mem (rtx x, int create)
|| (FLOAT_MODE_P (mode) && flag_float_store))
return 0;
+ addr_mode = GET_MODE (XEXP (x, 0));
+ if (addr_mode == VOIDmode)
+ addr_mode = Pmode;
+
/* Look up the value for the address. */
- addr = cselib_lookup (XEXP (x, 0), mode, create);
+ addr = cselib_lookup (XEXP (x, 0), addr_mode, create, mode);
if (! addr)
return 0;
@@ -1092,8 +1216,8 @@ cselib_lookup_mem (rtx x, int create)
mem_elt = new_cselib_val (next_uid, mode, x);
add_mem_for_addr (addr, mem_elt, x);
- slot = htab_find_slot_with_hash (cselib_hash_table, wrap_constant (mode, x),
- mem_elt->hash, INSERT);
+ slot = cselib_find_slot (wrap_constant (mode, x), mem_elt->hash,
+ INSERT, mode);
*slot = mem_elt;
return mem_elt;
}
@@ -1131,7 +1255,7 @@ expand_loc (struct elt_loc_list *p, struct expand_value_data *evd,
else if (!REG_P (p->loc))
{
rtx result, note;
- if (dump_file && (dump_flags & TDF_DETAILS))
+ if (dump_file && (dump_flags & TDF_CSELIB))
{
print_inline_rtx (dump_file, p->loc, 0);
fprintf (dump_file, "\n");
@@ -1152,7 +1276,7 @@ expand_loc (struct elt_loc_list *p, struct expand_value_data *evd,
if (regno != UINT_MAX)
{
rtx result;
- if (dump_file && (dump_flags & TDF_DETAILS))
+ if (dump_file && (dump_flags & TDF_CSELIB))
fprintf (dump_file, "r%d\n", regno);
result = cselib_expand_value_rtx_1 (reg_result, evd, max_depth - 1);
@@ -1160,7 +1284,7 @@ expand_loc (struct elt_loc_list *p, struct expand_value_data *evd,
return result;
}
- if (dump_file && (dump_flags & TDF_DETAILS))
+ if (dump_file && (dump_flags & TDF_CSELIB))
{
if (reg_result)
{
@@ -1301,7 +1425,7 @@ cselib_expand_value_rtx_1 (rtx orig, struct expand_value_data *evd,
bitmap_set_bit (evd->regs_active, regno);
- if (dump_file && (dump_flags & TDF_DETAILS))
+ if (dump_file && (dump_flags & TDF_CSELIB))
fprintf (dump_file, "expanding: r%d into: ", regno);
result = expand_loc (l->elt->locs, evd, max_depth);
@@ -1366,7 +1490,7 @@ cselib_expand_value_rtx_1 (rtx orig, struct expand_value_data *evd,
{
rtx result;
- if (dump_file && (dump_flags & TDF_DETAILS))
+ if (dump_file && (dump_flags & TDF_CSELIB))
{
fputs ("\nexpanding ", dump_file);
print_rtl_single (dump_file, orig);
@@ -1525,10 +1649,11 @@ cselib_expand_value_rtx_1 (rtx orig, struct expand_value_data *evd,
with VALUE expressions. This way, it becomes independent of changes
to registers and memory.
X isn't actually modified; if modifications are needed, new rtl is
- allocated. However, the return value can share rtl with X. */
+ allocated. However, the return value can share rtl with X.
+ If X is within a MEM, MEMMODE must be the mode of the MEM. */
rtx
-cselib_subst_to_values (rtx x)
+cselib_subst_to_values (rtx x, enum machine_mode memmode)
{
enum rtx_code code = GET_CODE (x);
const char *fmt = GET_RTX_FORMAT (code);
@@ -1551,10 +1676,11 @@ cselib_subst_to_values (rtx x)
case MEM:
e = cselib_lookup_mem (x, 0);
+ /* This used to happen for autoincrements, but we deal with them
+ properly now. Remove the if stmt for the next release. */
if (! e)
{
- /* This happens for autoincrements. Assign a value that doesn't
- match any other. */
+ /* Assign a value that doesn't match any other. */
e = new_cselib_val (next_uid, GET_MODE (x), x);
}
return e->val_rtx;
@@ -1565,14 +1691,24 @@ cselib_subst_to_values (rtx x)
case CONST_FIXED:
return x;
- case POST_INC:
+ case PRE_DEC:
case PRE_INC:
+ gcc_assert (memmode != VOIDmode);
+ i = GET_MODE_SIZE (memmode);
+ if (code == PRE_DEC)
+ i = -i;
+ return cselib_subst_to_values (plus_constant (XEXP (x, 0), i),
+ memmode);
+
+ case PRE_MODIFY:
+ gcc_assert (memmode != VOIDmode);
+ return cselib_subst_to_values (XEXP (x, 1), memmode);
+
case POST_DEC:
- case PRE_DEC:
+ case POST_INC:
case POST_MODIFY:
- case PRE_MODIFY:
- e = new_cselib_val (next_uid, GET_MODE (x), x);
- return e->val_rtx;
+ gcc_assert (memmode != VOIDmode);
+ return cselib_subst_to_values (XEXP (x, 0), memmode);
default:
break;
@@ -1582,7 +1718,7 @@ cselib_subst_to_values (rtx x)
{
if (fmt[i] == 'e')
{
- rtx t = cselib_subst_to_values (XEXP (x, i));
+ rtx t = cselib_subst_to_values (XEXP (x, i), memmode);
if (t != XEXP (x, i))
{
@@ -1597,7 +1733,7 @@ cselib_subst_to_values (rtx x)
for (j = 0; j < XVECLEN (x, i); j++)
{
- rtx t = cselib_subst_to_values (XVECEXP (x, i, j));
+ rtx t = cselib_subst_to_values (XVECEXP (x, i, j), memmode);
if (t != XVECEXP (x, i, j))
{
@@ -1616,13 +1752,16 @@ cselib_subst_to_values (rtx x)
return copy;
}
-/* Look up the rtl expression X in our tables and return the value it has.
- If CREATE is zero, we return NULL if we don't know the value. Otherwise,
- we create a new one if possible, using mode MODE if X doesn't have a mode
- (i.e. because it's a constant). */
+/* Look up the rtl expression X in our tables and return the value it
+ has. If CREATE is zero, we return NULL if we don't know the value.
+ Otherwise, we create a new one if possible, using mode MODE if X
+ doesn't have a mode (i.e. because it's a constant). When X is part
+ of an address, MEMMODE should be the mode of the enclosing MEM if
+ we're tracking autoinc expressions. */
static cselib_val *
-cselib_lookup_1 (rtx x, enum machine_mode mode, int create)
+cselib_lookup_1 (rtx x, enum machine_mode mode,
+ int create, enum machine_mode memmode)
{
void **slot;
cselib_val *e;
@@ -1671,7 +1810,7 @@ cselib_lookup_1 (rtx x, enum machine_mode mode, int create)
REG_VALUES (i) = new_elt_list (REG_VALUES (i), NULL);
}
REG_VALUES (i)->next = new_elt_list (REG_VALUES (i)->next, e);
- slot = htab_find_slot_with_hash (cselib_hash_table, x, e->hash, INSERT);
+ slot = cselib_find_slot (x, e->hash, INSERT, memmode);
*slot = e;
return e;
}
@@ -1679,13 +1818,13 @@ cselib_lookup_1 (rtx x, enum machine_mode mode, int create)
if (MEM_P (x))
return cselib_lookup_mem (x, create);
- hashval = cselib_hash_rtx (x, create);
+ hashval = cselib_hash_rtx (x, create, memmode);
/* Can't even create if hashing is not possible. */
if (! hashval)
return 0;
- slot = htab_find_slot_with_hash (cselib_hash_table, wrap_constant (mode, x),
- hashval, create ? INSERT : NO_INSERT);
+ slot = cselib_find_slot (wrap_constant (mode, x), hashval,
+ create ? INSERT : NO_INSERT, memmode);
if (slot == 0)
return 0;
@@ -1699,7 +1838,8 @@ cselib_lookup_1 (rtx x, enum machine_mode mode, int create)
the hash table is inconsistent until we do so, and
cselib_subst_to_values will need to do lookups. */
*slot = (void *) e;
- e->locs = new_elt_loc_list (e->locs, cselib_subst_to_values (x));
+ e->locs = new_elt_loc_list (e->locs,
+ cselib_subst_to_values (x, memmode));
return e;
}
@@ -1707,14 +1847,14 @@ cselib_lookup_1 (rtx x, enum machine_mode mode, int create)
cselib_val *
cselib_lookup_from_insn (rtx x, enum machine_mode mode,
- int create, rtx insn)
+ int create, enum machine_mode memmode, rtx insn)
{
cselib_val *ret;
gcc_assert (!cselib_current_insn);
cselib_current_insn = insn;
- ret = cselib_lookup (x, mode, create);
+ ret = cselib_lookup (x, mode, create, memmode);
cselib_current_insn = NULL;
@@ -1725,9 +1865,10 @@ cselib_lookup_from_insn (rtx x, enum machine_mode mode,
maintains invariants related with debug insns. */
cselib_val *
-cselib_lookup (rtx x, enum machine_mode mode, int create)
+cselib_lookup (rtx x, enum machine_mode mode,
+ int create, enum machine_mode memmode)
{
- cselib_val *ret = cselib_lookup_1 (x, mode, create);
+ cselib_val *ret = cselib_lookup_1 (x, mode, create, memmode);
/* ??? Should we return NULL if we're not to create an entry, the
found loc is a debug loc and cselib_current_insn is not DEBUG?
@@ -1735,7 +1876,7 @@ cselib_lookup (rtx x, enum machine_mode mode, int create)
easiest setting cselib_current_insn to NULL before the call
above. */
- if (dump_file && (dump_flags & TDF_DETAILS))
+ if (dump_file && (dump_flags & TDF_CSELIB))
{
fputs ("cselib lookup ", dump_file);
print_inline_rtx (dump_file, x, 2);
@@ -1912,7 +2053,7 @@ cselib_invalidate_mem (rtx mem_rtx)
/* This one overlaps. */
/* We must have a mapping from this MEM's address to the
value (E). Remove that, too. */
- addr = cselib_lookup (XEXP (x, 0), VOIDmode, 0);
+ addr = cselib_lookup (XEXP (x, 0), VOIDmode, 0, GET_MODE (x));
mem_chain = &addr->addr_list;
for (;;)
{
@@ -1962,13 +2103,6 @@ cselib_invalidate_rtx (rtx dest)
cselib_invalidate_regno (REGNO (dest), GET_MODE (dest));
else if (MEM_P (dest))
cselib_invalidate_mem (dest);
-
- /* Some machines don't define AUTO_INC_DEC, but they still use push
- instructions. We need to catch that case here in order to
- invalidate the stack pointer correctly. Note that invalidating
- the stack pointer is different from invalidating DEST. */
- if (push_operand (dest, GET_MODE (dest)))
- cselib_invalidate_rtx (stack_pointer_rtx);
}
/* A wrapper for cselib_invalidate_rtx to be called via note_stores. */
@@ -2031,7 +2165,35 @@ cselib_record_set (rtx dest, cselib_val *src_elt, cselib_val *dest_addr_elt)
in a PARALLEL. Since it's fairly cheap, use a really large number. */
#define MAX_SETS (FIRST_PSEUDO_REGISTER * 2)
-/* Record the effects of any sets in INSN. */
+struct cselib_record_autoinc_data
+{
+ struct cselib_set *sets;
+ int n_sets;
+};
+
+/* Callback for for_each_inc_dec. Records in ARG the SETs implied by
+ autoinc RTXs: SRC plus SRCOFF if non-NULL is stored in DEST. */
+
+static int
+cselib_record_autoinc_cb (rtx mem ATTRIBUTE_UNUSED, rtx op ATTRIBUTE_UNUSED,
+ rtx dest, rtx src, rtx srcoff, void *arg)
+{
+ struct cselib_record_autoinc_data *data;
+ data = (struct cselib_record_autoinc_data *)arg;
+
+ data->sets[data->n_sets].dest = dest;
+
+ if (srcoff)
+ data->sets[data->n_sets].src = gen_rtx_PLUS (GET_MODE (src), src, srcoff);
+ else
+ data->sets[data->n_sets].src = src;
+
+ data->n_sets++;
+
+ return -1;
+}
+
+/* Record the effects of any sets and autoincs in INSN. */
static void
cselib_record_sets (rtx insn)
{
@@ -2040,6 +2202,8 @@ cselib_record_sets (rtx insn)
struct cselib_set sets[MAX_SETS];
rtx body = PATTERN (insn);
rtx cond = 0;
+ int n_sets_before_autoinc;
+ struct cselib_record_autoinc_data data;
body = PATTERN (insn);
if (GET_CODE (body) == COND_EXEC)
@@ -2083,6 +2247,11 @@ cselib_record_sets (rtx insn)
sets[0].src = XEXP (note, 0);
}
+ data.sets = sets;
+ data.n_sets = n_sets_before_autoinc = n_sets;
+ for_each_inc_dec (&insn, cselib_record_autoinc_cb, &data);
+ n_sets = data.n_sets;
+
/* Look up the values that are read. Do this before invalidating the
locations that are written. */
for (i = 0; i < n_sets; i++)
@@ -2101,14 +2270,15 @@ cselib_record_sets (rtx insn)
rtx src = sets[i].src;
if (cond)
src = gen_rtx_IF_THEN_ELSE (GET_MODE (dest), cond, src, dest);
- sets[i].src_elt = cselib_lookup (src, GET_MODE (dest), 1);
+ sets[i].src_elt = cselib_lookup (src, GET_MODE (dest), 1, VOIDmode);
if (MEM_P (dest))
{
enum machine_mode address_mode
= targetm.addr_space.address_mode (MEM_ADDR_SPACE (dest));
sets[i].dest_addr_elt = cselib_lookup (XEXP (dest, 0),
- address_mode, 1);
+ address_mode, 1,
+ GET_MODE (dest));
}
else
sets[i].dest_addr_elt = 0;
@@ -2123,6 +2293,9 @@ cselib_record_sets (rtx insn)
locations may go away. */
note_stores (body, cselib_invalidate_rtx_note_stores, NULL);
+ for (i = n_sets_before_autoinc; i < n_sets; i++)
+ cselib_invalidate_rtx (sets[i].dest);
+
/* If this is an asm, look for duplicate sets. This can happen when the
user uses the same value as an output multiple times. This is valid
if the outputs are not actually used thereafter. Treat this case as
@@ -2207,15 +2380,6 @@ cselib_process_insn (rtx insn)
cselib_record_sets (insn);
-#ifdef AUTO_INC_DEC
- /* Clobber any registers which appear in REG_INC notes. We
- could keep track of the changes to their values, but it is
- unlikely to help. */
- for (x = REG_NOTES (insn); x; x = XEXP (x, 1))
- if (REG_NOTE_KIND (x) == REG_INC)
- cselib_invalidate_rtx (XEXP (x, 0));
-#endif
-
/* Look for any CLOBBERs in CALL_INSN_FUNCTION_USAGE, but only
after we have processed the insn. */
if (CALL_P (insn))
diff --git a/gcc/cselib.h b/gcc/cselib.h
index d07c8330d47..3590f980e43 100644
--- a/gcc/cselib.h
+++ b/gcc/cselib.h
@@ -70,8 +70,10 @@ extern void (*cselib_discard_hook) (cselib_val *);
extern void (*cselib_record_sets_hook) (rtx insn, struct cselib_set *sets,
int n_sets);
-extern cselib_val *cselib_lookup (rtx, enum machine_mode, int);
-extern cselib_val *cselib_lookup_from_insn (rtx, enum machine_mode, int, rtx);
+extern cselib_val *cselib_lookup (rtx, enum machine_mode,
+ int, enum machine_mode);
+extern cselib_val *cselib_lookup_from_insn (rtx, enum machine_mode,
+ int, enum machine_mode, rtx);
extern void cselib_init (int);
extern void cselib_clear_table (void);
extern void cselib_finish (void);
@@ -85,7 +87,7 @@ extern rtx cselib_expand_value_rtx_cb (rtx, bitmap, int,
cselib_expand_callback, void *);
extern bool cselib_dummy_expand_value_rtx_cb (rtx, bitmap, int,
cselib_expand_callback, void *);
-extern rtx cselib_subst_to_values (rtx);
+extern rtx cselib_subst_to_values (rtx, enum machine_mode);
extern void cselib_invalidate_rtx (rtx);
extern void cselib_reset_table (unsigned int);
diff --git a/gcc/df-problems.c b/gcc/df-problems.c
index b36bc061a92..1a89824f9ac 100644
--- a/gcc/df-problems.c
+++ b/gcc/df-problems.c
@@ -3960,7 +3960,7 @@ can_move_insns_across (rtx from, rtx to, rtx across_from, rtx across_to,
break;
if (NONDEBUG_INSN_P (insn))
{
- if (may_trap_p (PATTERN (insn))
+ if (may_trap_or_fault_p (PATTERN (insn))
&& (trapping_insns_in_across || other_branch_live != NULL))
break;
diff --git a/gcc/df-scan.c b/gcc/df-scan.c
index 7c9262c0816..bbb2cc326be 100644
--- a/gcc/df-scan.c
+++ b/gcc/df-scan.c
@@ -1,6 +1,6 @@
/* Scanning of rtl for dataflow analysis.
Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
- 2008, 2009, 2010 Free Software Foundation, Inc.
+ 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
Originally contributed by Michael P. Hayes
(m.hayes@elec.canterbury.ac.nz, mhayes@redhat.com)
Major rewrite contributed by Danny Berlin (dberlin@dberlin.org)
@@ -3362,18 +3362,21 @@ df_get_call_refs (struct df_collection_rec * collection_rec,
NULL, bb, insn_info, DF_REF_REG_USE,
DF_REF_CALL_STACK_USAGE | flags);
- /* Calls may also reference any of the global registers,
- so they are recorded as used. */
- for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
- if (global_regs[i])
- {
- df_ref_record (DF_REF_BASE, collection_rec,
- crtl->emit.regno_reg_rtx[i], NULL, bb, insn_info,
- DF_REF_REG_USE, flags);
- df_ref_record (DF_REF_BASE, collection_rec,
- crtl->emit.regno_reg_rtx[i], NULL, bb, insn_info,
- DF_REF_REG_DEF, flags);
- }
+ /* Calls to const functions cannot access any global registers and calls to
+ pure functions cannot set them. All other calls may reference any of the
+ global registers, so they are recorded as used. */
+ if (!RTL_CONST_CALL_P (insn_info->insn))
+ for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
+ if (global_regs[i])
+ {
+ df_ref_record (DF_REF_BASE, collection_rec,
+ crtl->emit.regno_reg_rtx[i], NULL, bb, insn_info,
+ DF_REF_REG_USE, flags);
+ if (!RTL_PURE_CALL_P (insn_info->insn))
+ df_ref_record (DF_REF_BASE, collection_rec,
+ crtl->emit.regno_reg_rtx[i], NULL, bb, insn_info,
+ DF_REF_REG_DEF, flags);
+ }
is_sibling_call = SIBLING_CALL_P (insn_info->insn);
EXECUTE_IF_SET_IN_BITMAP (regs_invalidated_by_call_regset, 0, ui, bi)
diff --git a/gcc/doc/cpp.texi b/gcc/doc/cpp.texi
index 195fcda39e2..328cc59fae5 100644
--- a/gcc/doc/cpp.texi
+++ b/gcc/doc/cpp.texi
@@ -4200,9 +4200,10 @@ program will run on. Assertions are usually predefined, but you can
define them with preprocessing directives or command-line options.
Assertions were intended to provide a more systematic way to describe
-the compiler's target system. However, in practice they are just as
-unpredictable as the system-specific predefined macros. In addition, they
-are not part of any standard, and only a few compilers support them.
+the compiler's target system and we added them for compatibility with
+existing compilers. In practice they are just as unpredictable as the
+system-specific predefined macros. In addition, they are not part of
+any standard, and only a few compilers support them.
Therefore, the use of assertions is @strong{less} portable than the use
of system-specific predefined macros. We recommend you do not use them at
all.
diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi
index ab65fd6848e..67513608e3d 100644
--- a/gcc/doc/extend.texi
+++ b/gcc/doc/extend.texi
@@ -1,5 +1,5 @@
@c Copyright (C) 1988, 1989, 1992, 1993, 1994, 1996, 1998, 1999, 2000, 2001,
-@c 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
+@c 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
@c Free Software Foundation, Inc.
@c This is part of the GCC manual.
@@ -2213,9 +2213,14 @@ On systems that support the @code{visibility} attribute, this
attribute also implies ``default'' visibility. It is an error to
explicitly specify any other visibility.
-Currently, the @code{dllexport} attribute is ignored for inlined
-functions, unless the @option{-fkeep-inline-functions} flag has been
-used. The attribute is also ignored for undefined symbols.
+In previous versions of GCC, the @code{dllexport} attribute was ignored
+for inlined functions, unless the @option{-fkeep-inline-functions} flag
+had been used. The default behaviour now is to emit all dllexported
+inline functions; however, this can cause object file-size bloat, in
+which case the old behaviour can be restored by using
+@option{-fno-keep-inline-dllexport}.
+
+The attribute is also ignored for undefined symbols.
When applied to C++ classes, the attribute marks defined non-inlined
member functions and static data members as exports. Static consts
@@ -12354,6 +12359,12 @@ vector bool long vec_cmplt (vector double, vector double);
vector float vec_div (vector float, vector float);
vector double vec_div (vector double, vector double);
vector double vec_floor (vector double);
+vector double vec_ld (int, const vector double *);
+vector double vec_ld (int, const double *);
+vector double vec_ldl (int, const vector double *);
+vector double vec_ldl (int, const double *);
+vector unsigned char vec_lvsl (int, const volatile double *);
+vector unsigned char vec_lvsr (int, const volatile double *);
vector double vec_madd (vector double, vector double, vector double);
vector double vec_max (vector double, vector double);
vector double vec_min (vector double, vector double);
@@ -12382,6 +12393,8 @@ vector double vec_sel (vector double, vector double, vector unsigned long);
vector double vec_sub (vector double, vector double);
vector float vec_sqrt (vector float);
vector double vec_sqrt (vector double);
+void vec_st (vector double, int, vector double *);
+void vec_st (vector double, int, double *);
vector double vec_trunc (vector double);
vector double vec_xor (vector double, vector double);
vector double vec_xor (vector double, vector bool long);
@@ -12410,7 +12423,65 @@ int vec_any_ngt (vector double, vector double);
int vec_any_nle (vector double, vector double);
int vec_any_nlt (vector double, vector double);
int vec_any_numeric (vector double);
-@end smallexample
+
+vector double vec_vsx_ld (int, const vector double *);
+vector double vec_vsx_ld (int, const double *);
+vector float vec_vsx_ld (int, const vector float *);
+vector float vec_vsx_ld (int, const float *);
+vector bool int vec_vsx_ld (int, const vector bool int *);
+vector signed int vec_vsx_ld (int, const vector signed int *);
+vector signed int vec_vsx_ld (int, const int *);
+vector signed int vec_vsx_ld (int, const long *);
+vector unsigned int vec_vsx_ld (int, const vector unsigned int *);
+vector unsigned int vec_vsx_ld (int, const unsigned int *);
+vector unsigned int vec_vsx_ld (int, const unsigned long *);
+vector bool short vec_vsx_ld (int, const vector bool short *);
+vector pixel vec_vsx_ld (int, const vector pixel *);
+vector signed short vec_vsx_ld (int, const vector signed short *);
+vector signed short vec_vsx_ld (int, const short *);
+vector unsigned short vec_vsx_ld (int, const vector unsigned short *);
+vector unsigned short vec_vsx_ld (int, const unsigned short *);
+vector bool char vec_vsx_ld (int, const vector bool char *);
+vector signed char vec_vsx_ld (int, const vector signed char *);
+vector signed char vec_vsx_ld (int, const signed char *);
+vector unsigned char vec_vsx_ld (int, const vector unsigned char *);
+vector unsigned char vec_vsx_ld (int, const unsigned char *);
+
+void vec_vsx_st (vector double, int, vector double *);
+void vec_vsx_st (vector double, int, double *);
+void vec_vsx_st (vector float, int, vector float *);
+void vec_vsx_st (vector float, int, float *);
+void vec_vsx_st (vector signed int, int, vector signed int *);
+void vec_vsx_st (vector signed int, int, int *);
+void vec_vsx_st (vector unsigned int, int, vector unsigned int *);
+void vec_vsx_st (vector unsigned int, int, unsigned int *);
+void vec_vsx_st (vector bool int, int, vector bool int *);
+void vec_vsx_st (vector bool int, int, unsigned int *);
+void vec_vsx_st (vector bool int, int, int *);
+void vec_vsx_st (vector signed short, int, vector signed short *);
+void vec_vsx_st (vector signed short, int, short *);
+void vec_vsx_st (vector unsigned short, int, vector unsigned short *);
+void vec_vsx_st (vector unsigned short, int, unsigned short *);
+void vec_vsx_st (vector bool short, int, vector bool short *);
+void vec_vsx_st (vector bool short, int, unsigned short *);
+void vec_vsx_st (vector pixel, int, vector pixel *);
+void vec_vsx_st (vector pixel, int, unsigned short *);
+void vec_vsx_st (vector pixel, int, short *);
+void vec_vsx_st (vector bool short, int, short *);
+void vec_vsx_st (vector signed char, int, vector signed char *);
+void vec_vsx_st (vector signed char, int, signed char *);
+void vec_vsx_st (vector unsigned char, int, vector unsigned char *);
+void vec_vsx_st (vector unsigned char, int, unsigned char *);
+void vec_vsx_st (vector bool char, int, vector bool char *);
+void vec_vsx_st (vector bool char, int, unsigned char *);
+void vec_vsx_st (vector bool char, int, signed char *);
+@end smallexample
+
+Note that the @samp{vec_ld} and @samp{vec_st} builtins will always
+generate the Altivec @samp{LVX} and @samp{STVX} instructions even
+if the VSX instruction set is available. The @samp{vec_vsx_ld} and
+@samp{vec_vsx_st} builtins will always generate the VSX @samp{LXVD2X},
+@samp{LXVW4X}, @samp{STXVD2X}, and @samp{STXVW4X} instructions.
GCC provides a few other builtins on Powerpc to access certain instructions:
@smallexample
@@ -13024,8 +13095,7 @@ aliases.
@cindex pragma, weak
This pragma declares @var{symbol} to be weak, as if the declaration
had the attribute of the same name. The pragma may appear before
-or after the declaration of @var{symbol}, but must appear before
-either its first use or its definition. It is not an error for
+or after the declaration of @var{symbol}. It is not an error for
@var{symbol} to never be defined at all.
@item #pragma weak @var{symbol1} = @var{symbol2}
@@ -13366,7 +13436,7 @@ In C++, if an initializer is present for a thread-local variable, it must
be a @var{constant-expression}, as defined in 5.19.2 of the ANSI/ISO C++
standard.
-See @uref{http://people.redhat.com/drepper/tls.pdf,
+See @uref{http://www.akkadia.org/drepper/tls.pdf,
ELF Handling For Thread-Local Storage} for a detailed explanation of
the four thread-local storage addressing models, and how the run-time
is expected to function.
@@ -13645,9 +13715,9 @@ The C++ standard differs from the C standard in its treatment of
volatile objects. It fails to specify what constitutes a volatile
access, except to say that C++ should behave in a similar manner to C
with respect to volatiles, where possible. However, the different
-lvalueness of expressions between C and C++ complicate the behaviour.
+lvalueness of expressions between C and C++ complicate the behavior.
G++ behaves the same as GCC for volatile access, @xref{C
-Extensions,,Volatiles}, for a description of GCC's behaviour.
+Extensions,,Volatiles}, for a description of GCC's behavior.
The C and C++ language specifications differ when an object is
accessed in a void context:
@@ -13677,7 +13747,7 @@ possible to ignore the return value from functions returning volatile
references. Again, if you wish to force a read, cast the reference to
an rvalue.
-G++ implements the same behaviour as GCC does when assigning to a
+G++ implements the same behavior as GCC does when assigning to a
volatile object -- there is no reread of the assigned-to object, the
assigned rvalue is reused. Note that in C++ assignment expressions
are lvalues, and if used as an lvalue, the volatile object will be
diff --git a/gcc/doc/install.texi b/gcc/doc/install.texi
index 3546170e491..b953d7283cf 100644
--- a/gcc/doc/install.texi
+++ b/gcc/doc/install.texi
@@ -332,7 +332,7 @@ and @option{--with-mpc-include}. Alternatively, if an MPC source
distribution is found in a subdirectory of your GCC sources named
@file{mpc}, it will be built together with GCC@.
-@item Parma Polyhedra Library (PPL) version 0.10
+@item Parma Polyhedra Library (PPL) version 0.11
Necessary to build GCC with the Graphite loop optimizations.
It can be downloaded from @uref{http://www.cs.unipr.it/ppl/Download/}.
@@ -340,16 +340,23 @@ It can be downloaded from @uref{http://www.cs.unipr.it/ppl/Download/}.
The @option{--with-ppl} configure option should be used if PPL is not
installed in your default library search path.
-@item CLooG-PPL version 0.15
+@item CLooG-PPL version 0.15 or CLooG 0.16
-Necessary to build GCC with the Graphite loop optimizations. It can
-be downloaded from @uref{ftp://gcc.gnu.org/pub/gcc/infrastructure/}.
-The code in @file{cloog-ppl-0.15.tar.gz} comes from a branch of CLooG
-available from @uref{http://repo.or.cz/w/cloog-ppl.git}. CLooG-PPL
-should be configured with @option{--with-ppl}.
+Necessary to build GCC with the Graphite loop optimizations. There
+are two versions available. CLooG-PPL 0.15 as well as CLooG 0.16.
+The former is the default right now. It can be downloaded from
+@uref{ftp://gcc.gnu.org/pub/gcc/infrastructure/} as
+@file{cloog-ppl-0.15.tar.gz}.
-The @option{--with-cloog} configure option should be used if CLooG is
-not installed in your default library search path.
+CLooG 0.16 support is still in testing stage, but will be the
+default in future GCC releases. It is also available at
+@uref{ftp://gcc.gnu.org/pub/gcc/infrastructure/} as
+@file{cloog-0.16.1.tar.gz}. To use it add the additional configure
+option @option{--enable-cloog-backend=isl}. Even if CLooG 0.16
+does not use PPL, PPL is still required for Graphite.
+
+In both cases @option{--with-cloog} configure option should be used
+if CLooG is not installed in your default library search path.
@item @command{jar}, or InfoZIP (@command{zip} and @command{unzip})
@@ -1577,6 +1584,9 @@ shared libraries can be found by the dynamic linker when building and
using GCC, for example by setting the runtime shared library path
variable (@env{LD_LIBRARY_PATH} on GNU/Linux and Solaris systems).
+These flags are applicable to the host platform only. When building
+a cross compiler, they will not be used to configure target libraries.
+
@item --with-ppl=@var{pathname}
@itemx --with-ppl-include=@var{pathname}
@itemx --with-ppl-lib=@var{pathname}
@@ -1597,6 +1607,9 @@ you can explicitly specify the directory where they are installed
shorthand assumptions are not correct, you can use the explicit
include and lib options directly.
+These flags are applicable to the host platform only. When building
+a cross compiler, they will not be used to configure target libraries.
+
@item --with-host-libstdcxx=@var{linker-args}
If you are linking with a static copy of PPL, you can use this option
to specify how the linker should find the standard C++ library used
@@ -2826,10 +2839,6 @@ HP-UX:
@end itemize
@item
-Motorola 68HC11/68HC12---@uref{http://www.gnu-m68hc11.org,,GNU
-Development Tools for the Motorola 68HC11/68HC12}.
-
-@item
@uref{http://www.sco.com/skunkware/devtools/index.html#gcc,,SCO
OpenServer/Unixware}.
@@ -3378,22 +3387,7 @@ More specific information to @samp{hppa*-hp-hpux*} targets follows.
@heading @anchor{hppa-hp-hpux10}hppa*-hp-hpux10
For hpux10.20, we @emph{highly} recommend you pick up the latest sed patch
-@code{PHCO_19798} from HP@. HP has two sites which provide patches free of
-charge:
-
-@itemize @bullet
-@item
-@html
-<a href="http://us.itrc.hp.com/service/home/home.do">US, Canada, Asia-Pacific, and
-Latin-America</a>
-@end html
-@ifnothtml
-@uref{http://us.itrc.hp.com/service/home/home.do,,} US, Canada, Asia-Pacific,
-and Latin-America.
-@end ifnothtml
-@item
-@uref{http://europe.itrc.hp.com/service/home/home.do,,} Europe.
-@end itemize
+@code{PHCO_19798} from HP@.
The C++ ABI has changed incompatibly in GCC 4.0. COMDAT subspaces are
used for one-only code and data. This resolves many of the previous
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index c7187f2c42d..5388683e6d6 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -208,10 +208,12 @@ Objective-C and Objective-C++ Dialects}.
@gccoptlist{-fconstant-string-class=@var{class-name} @gol
-fgnu-runtime -fnext-runtime @gol
-fno-nil-receivers @gol
+-fobjc-abi-version=@var{n} @gol
-fobjc-call-cxx-cdtors @gol
-fobjc-direct-dispatch @gol
-fobjc-exceptions @gol
-fobjc-gc @gol
+-fobjc-nilcheck @gol
-fobjc-std=objc1 @gol
-freplace-objc-classes @gol
-fzero-link @gol
@@ -229,7 +231,7 @@ Objective-C and Objective-C++ Dialects}.
@item Warning Options
@xref{Warning Options,,Options to Request or Suppress Warnings}.
-@gccoptlist{-fsyntax-only fmax-errors=@var{n} -pedantic @gol
+@gccoptlist{-fsyntax-only -fmax-errors=@var{n} -pedantic @gol
-pedantic-errors @gol
-w -Wextra -Wall -Waddress -Waggregate-return -Warray-bounds @gol
-Wno-attributes -Wno-builtin-macro-redefined @gol
@@ -337,7 +339,7 @@ Objective-C and Objective-C++ Dialects}.
-fauto-inc-dec -fbranch-probabilities -fbranch-target-load-optimize @gol
-fbranch-target-load-optimize2 -fbtr-bb-exclusive -fcaller-saves @gol
-fcheck-data-deps -fcombine-stack-adjustments -fconserve-stack @gol
--fcprop-registers -fcrossjumping @gol
+-fcompare-elim -fcprop-registers -fcrossjumping @gol
-fcse-follow-jumps -fcse-skip-blocks -fcx-fortran-rules @gol
-fcx-limited-range @gol
-fdata-sections -fdce -fdce -fdelayed-branch @gol
@@ -390,7 +392,7 @@ Objective-C and Objective-C++ Dialects}.
-ftree-builtin-call-dce -ftree-ccp -ftree-ch -ftree-copy-prop @gol
-ftree-copyrename -ftree-dce -ftree-dominator-opts -ftree-dse @gol
-ftree-forwprop -ftree-fre -ftree-loop-if-convert @gol
--ftree-loop-if-convert-memory-writes -ftree-loop-im @gol
+-ftree-loop-if-convert-stores -ftree-loop-im @gol
-ftree-phiprop -ftree-loop-distribution -ftree-loop-distribute-patterns @gol
-ftree-loop-ivcanon -ftree-loop-linear -ftree-loop-optimize @gol
-ftree-parallelize-loops=@var{n} -ftree-pre -ftree-pta -ftree-reassoc @gol
@@ -739,7 +741,7 @@ Objective-C and Objective-C++ Dialects}.
-mno-am33 -mam33 -mam33-2 -mam34 @gol
-mtune=@var{cpu-type} @gol
-mreturn-pointer-on-d0 @gol
--mno-crt0 -mrelax}
+-mno-crt0 -mrelax -mliw}
@emph{PDP-11 Options}
@gccoptlist{-mfpu -msoft-float -mac0 -mno-ac0 -m40 -m45 -m10 @gol
@@ -890,7 +892,7 @@ See RS/6000 and PowerPC Options.
-mdisable-callt -mno-disable-callt @gol
-mv850e2v3 @gol
-mv850e2 @gol
--mv850e1 @gol
+-mv850e1 -mv850es @gol
-mv850e @gol
-mv850 -mbig-switch}
@@ -2555,8 +2557,19 @@ used.
Assume that all Objective-C message dispatches (@code{[receiver
message:arg]}) in this translation unit ensure that the receiver is
not @code{nil}. This allows for more efficient entry points in the
-runtime to be used. Currently, this option is only available in
-conjunction with the NeXT runtime on Mac OS X 10.3 and later.
+runtime to be used. This option is only available in conjunction with
+the NeXT runtime and ABI version 0 or 1.
+
+@item -fobjc-abi-version=@var{n}
+@opindex fobjc-abi-version
+Use version @var{n} of the Objective-C ABI for the selected runtime.
+This option is currently supported only for the NeXT runtime. In that
+case, Version 0 is the traditional (32-bit) ABI without support for
+properties and other Objective-C 2.0 additions. Version 1 is the
+traditional (32-bit) ABI with support for properties and other
+Objective-C 2.0 additions. Version 2 is the modern (64-bit) ABI. If
+nothing is specified, the default is Version 0 on 32-bit target
+machines, and Version 2 on 64-bit target machines.
@item -fobjc-call-cxx-cdtors
@opindex fobjc-call-cxx-cdtors
@@ -2605,6 +2618,16 @@ programs. This option is only available with the NeXT runtime; the
GNU runtime has a different garbage collection implementation that
does not require special compiler flags.
+@item -fobjc-nilcheck
+@opindex fobjc-nilcheck
+For the NeXT runtime with version 2 of the ABI, check for a nil
+receiver in method invocations before doing the actual method call.
+This is the default and can be disabled using
+@option{-fno-objc-nilcheck}. Class methods and super calls are never
+checked for nil in this way no matter what this flag is set to.
+Currently this flag does nothing when the GNU runtime, or an older
+version of the NeXT runtime ABI, is used.
+
@item -fobjc-std=objc1
@opindex fobjc-std
Conform to the language syntax of Objective-C 1.0, the language
@@ -5870,6 +5893,7 @@ compilation time.
@option{-O} turns on the following optimization flags:
@gccoptlist{
-fauto-inc-dec @gol
+-fcompare-elim @gol
-fcprop-registers @gol
-fdce @gol
-fdefer-pop @gol
@@ -6148,6 +6172,13 @@ abstract measurement of function's size. In no way does it represent a count
of assembly instructions and as such its exact meaning might change from one
release to an another.
+@item -fno-keep-inline-dllexport
+@opindex -fno-keep-inline-dllexport
+This is a more fine-grained version of @option{-fkeep-inline-functions},
+which applies only to functions that are declared using the @code{dllexport}
+attribute or declspec (@xref{Function Attributes,,Declaring Attributes of
+Functions}.)
+
@item -fkeep-inline-functions
@opindex fkeep-inline-functions
In C, emit @code{static} functions that are declared @code{inline}
@@ -6862,8 +6893,10 @@ at @option{-O} and higher.
@item -ftree-loop-linear
@opindex ftree-loop-linear
-Perform linear loop transformations on tree. This flag can improve cache
-performance and allow further loop optimizations to take place.
+Perform loop interchange transformations on tree. Same as
+@option{-floop-interchange}. To use this code transformation, GCC has
+to be configured with @option{--with-ppl} and @option{--with-cloog} to
+enable the Graphite loop transformation infrastructure.
@item -floop-interchange
@opindex floop-interchange
@@ -7682,13 +7715,25 @@ This option enables the extraction of object files with GIMPLE bytecode out of
library archives. This improves the quality of optimization by exposing more
code the the link time optimizer. This information specify what symbols
can be accessed externally (by non-LTO object or during dynamic linking).
-Resulting code quality improvements on binaries (and shared libaries that do
+Resulting code quality improvements on binaries (and shared libraries that do
use hidden visibility) is similar to @code{-fwhole-program}. See
@option{-flto} for a description on the effect of this flag and how to use it.
Enabled by default when LTO support in GCC is enabled and GCC was compiled
with linker supporting plugins (GNU ld or @code{gold}).
+@item -fcompare-elim
+@opindex fcompare-elim
+After register allocation and post-register allocation instruction splitting,
+identify arithmetic instructions that compute processor flags similar to a
+comparison operation based on that arithmetic. If possible, eliminate the
+explicit comparison operation.
+
+This pass only applies to certain targets that cannot explicitly represent
+the comparison operation before register allocation is complete.
+
+Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
+
@item -fcprop-registers
@opindex fcprop-registers
After register allocation and post-register allocation instruction splitting,
@@ -7707,13 +7752,13 @@ default, GCC will emit an error message when an inconsistent profile is detected
@item -fprofile-dir=@var{path}
@opindex fprofile-dir
-Set the directory to search the profile data files in to @var{path}.
+Set the directory to search for the profile data files in to @var{path}.
This option affects only the profile data generated by
@option{-fprofile-generate}, @option{-ftest-coverage}, @option{-fprofile-arcs}
and used by @option{-fprofile-use} and @option{-fbranch-probabilities}
and its related options.
-By default, GCC will use the current directory as @var{path}
-thus the profile data file will appear in the same directory as the object file.
+By default, GCC will use the current directory as @var{path}, thus the
+profile data file will appear in the same directory as the object file.
@item -fprofile-generate
@itemx -fprofile-generate=@var{path}
@@ -7998,7 +8043,7 @@ With @option{-fbranch-probabilities}, GCC puts a
@samp{REG_BR_PROB} note on each @samp{JUMP_INSN} and @samp{CALL_INSN}.
These can be used to improve optimization. Currently, they are only
used in one place: in @file{reorg.c}, instead of guessing which path a
-branch is mostly to take, the @samp{REG_BR_PROB} values are used to
+branch is most likely to take, the @samp{REG_BR_PROB} values are used to
exactly determine which path is taken more often.
@item -fprofile-values
@@ -8007,8 +8052,7 @@ If combined with @option{-fprofile-arcs}, it adds code so that some
data about values of expressions in the program is gathered.
With @option{-fbranch-probabilities}, it reads back the data gathered
-from profiling values of expressions and adds @samp{REG_VALUE_PROFILE}
-notes to instructions for their later usage in optimizations.
+from profiling values of expressions for usage in optimizations.
Enabled with @option{-fprofile-generate} and @option{-fprofile-use}.
@@ -8441,6 +8485,10 @@ optimization when a new iv is added to the set.
Bound on size of expressions used in the scalar evolutions analyzer.
Large expressions slow the analyzer.
+@item scev-max-expr-complexity
+Bound on the complexity of the expressions in the scalar evolutions analyzer.
+Complex expressions slow the analyzer.
+
@item omega-max-vars
The maximum number of variables in an Omega constraint system.
The default value is 128.
@@ -8489,7 +8537,7 @@ Select fraction of the maximal count of repetitions of basic block in program
given basic block needs to have to be considered hot.
@item hot-bb-frequency-fraction
-Select fraction of the maximal frequency of executions of basic block in
+Select fraction of the entry block frequency of executions of basic block in
function given basic block needs to have to be considered hot
@item max-predicted-iterations
@@ -15010,6 +15058,19 @@ to shorten branches, calls and absolute memory addresses. This option only
has an effect when used on the command line for the final link step.
This option makes symbolic debugging impossible.
+
+@item -mliw
+@opindex mliw
+Allow the compiler to generate @emph{Long Instruction Word}
+instructions if the target is the @samp{AM33} or later. This is the
+default. This option defines the preprocessor macro @samp{__LIW__}.
+
+@item -mnoliw
+@opindex mnoliw
+Do not allow the compiler to generate @emph{Long Instruction Word}
+instructions. This option defines the preprocessor macro
+@samp{__NO_LIW__}.
+
@end table
@node PDP-11 Options
@@ -17376,6 +17437,11 @@ constants @samp{__v850e2__} will be defined if
Specify that the target processor is the V850E1. The preprocessor
constants @samp{__v850e1__} and @samp{__v850e__} will be defined if
+@item -mv850es
+@opindex mv850es
+Specify that the target processor is the V850ES. This is an alias for
+the @option{-mv850e1} option.
+
@item -mv850e
@opindex mv850e
Specify that the target processor is the V850E@. The preprocessor
diff --git a/gcc/doc/lto.texi b/gcc/doc/lto.texi
index 069dafb76e3..73fd8315658 100644
--- a/gcc/doc/lto.texi
+++ b/gcc/doc/lto.texi
@@ -268,7 +268,7 @@ body and variable initializer is examined and stores relevant
information into a pass-specific data structure.
@item @emph{Write summary} (@code{write_summary} in
-@code{struct ipa_opt_pass_d}. This stage writes all the
+@code{struct ipa_opt_pass_d}). This stage writes all the
pass-specific information generated by @code{generate_summary}.
Summaries go into their own @code{LTO_section_*} sections that
have to be declared in @file{lto-streamer.h}:@code{enum
diff --git a/gcc/doc/options.texi b/gcc/doc/options.texi
index 1c8f5d9f134..e39d79e1c8f 100644
--- a/gcc/doc/options.texi
+++ b/gcc/doc/options.texi
@@ -1,4 +1,4 @@
-@c Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
+@c Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
@c Free Software Foundation, Inc.
@c This is part of the GCC manual.
@c For copying conditions, see the file gcc.texi.
@@ -436,4 +436,17 @@ the @option{--help} output.
Build the @code{cl_target_option} structure to hold a copy of the
option, add the functions @code{cl_target_option_save} and
@code{cl_target_option_restore} to save and restore the options.
+
+@item SetByCombined
+The option may also be set by a combined option such as
+@option{-ffast-math}. This causes the @code{gcc_options} struct to
+have a field @code{frontend_set_@var{name}}, where @code{@var{name}}
+is the name of the field holding the value of this option (without the
+leading @code{x_}). This gives the front end a way to indicate that
+the value has been set explicitly and should not be changed by the
+combined option. For example, some front ends use this to prevent
+@option{-ffast-math} and @option{-fno-fast-math} from changing the
+value of @option{-fmath-errno} for languages that do not use
+@code{errno}.
+
@end table
diff --git a/gcc/doc/sourcebuild.texi b/gcc/doc/sourcebuild.texi
index 57512c1d0a3..f4a2807a1bf 100644
--- a/gcc/doc/sourcebuild.texi
+++ b/gcc/doc/sourcebuild.texi
@@ -1,4 +1,4 @@
-@c Copyright (C) 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010
+@c Copyright (C) 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010, 2011
@c Free Software Foundation, Inc.
@c This is part of the GCC manual.
@c For copying conditions, see the file gcc.texi.
@@ -1588,7 +1588,10 @@ PowerPC target supports executing AltiVec instructions.
@table @code
@item avx
-Target supports compiling AVX instructions.
+Target supports compiling @code{avx} instructions.
+
+@item avx_runtime
+Target supports the execution of @code{avx} instructions.
@item cell_hw
Test system can execute AltiVec and Cell PPU instructions.
@@ -1936,6 +1939,9 @@ take arguments could be replaced with effective-target keywords.
@item dg-require-alias ""
Skip the test if the target does not support the @samp{alias} attribute.
+@item dg-require-ascii-locale ""
+Skip the test if the host does not support an ASCII locale.
+
@item dg-require-compat-dfp ""
Skip this test unless both compilers in a @file{compat} testsuite
support decimal floating point.
diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi
index 3c9e65981b0..85e1d88eec9 100644
--- a/gcc/doc/tm.texi
+++ b/gcc/doc/tm.texi
@@ -4351,6 +4351,10 @@ to return a nonzero value when it is required, the compiler will run out
of spill registers and print a fatal error message.
@end deftypefn
+@deftypevr {Target Hook} {unsigned int} TARGET_FLAGS_REGNUM
+If the target has a dedicated flags register, and it needs to use the post-reload comparison elimination pass, then this value should be set appropriately.
+@end deftypevr
+
@node Scalar Return
@subsection How Scalar Function Values Are Returned
@cindex return values in registers
diff --git a/gcc/doc/tm.texi.in b/gcc/doc/tm.texi.in
index 71d7b46914b..a799bc43564 100644
--- a/gcc/doc/tm.texi.in
+++ b/gcc/doc/tm.texi.in
@@ -4337,6 +4337,8 @@ to return a nonzero value when it is required, the compiler will run out
of spill registers and print a fatal error message.
@end deftypefn
+@hook TARGET_FLAGS_REGNUM
+
@node Scalar Return
@subsection How Scalar Function Values Are Returned
@cindex return values in registers
diff --git a/gcc/dse.c b/gcc/dse.c
index 1debafc385a..8e9b6454e39 100644
--- a/gcc/dse.c
+++ b/gcc/dse.c
@@ -806,93 +806,36 @@ free_store_info (insn_info_t insn_info)
insn_info->store_rec = NULL;
}
-
-struct insn_size {
- int size;
- rtx insn;
-};
-
-
-/* Add an insn to do the add inside a x if it is a
- PRE/POST-INC/DEC/MODIFY. D is an structure containing the insn and
- the size of the mode of the MEM that this is inside of. */
+/* Callback for for_each_inc_dec that emits an INSN that sets DEST to
+ SRC + SRCOFF before insn ARG. */
static int
-replace_inc_dec (rtx *r, void *d)
+emit_inc_dec_insn_before (rtx mem ATTRIBUTE_UNUSED,
+ rtx op ATTRIBUTE_UNUSED,
+ rtx dest, rtx src, rtx srcoff, void *arg)
{
- rtx x = *r;
- struct insn_size *data = (struct insn_size *)d;
- switch (GET_CODE (x))
- {
- case PRE_INC:
- case POST_INC:
- {
- rtx r1 = XEXP (x, 0);
- rtx c = gen_int_mode (data->size, GET_MODE (r1));
- emit_insn_before (gen_rtx_SET (VOIDmode, r1,
- gen_rtx_PLUS (GET_MODE (r1), r1, c)),
- data->insn);
- return -1;
- }
+ rtx insn = (rtx)arg;
- case PRE_DEC:
- case POST_DEC:
- {
- rtx r1 = XEXP (x, 0);
- rtx c = gen_int_mode (-data->size, GET_MODE (r1));
- emit_insn_before (gen_rtx_SET (VOIDmode, r1,
- gen_rtx_PLUS (GET_MODE (r1), r1, c)),
- data->insn);
- return -1;
- }
+ if (srcoff)
+ src = gen_rtx_PLUS (GET_MODE (src), src, srcoff);
- case PRE_MODIFY:
- case POST_MODIFY:
- {
- /* We can reuse the add because we are about to delete the
- insn that contained it. */
- rtx add = XEXP (x, 0);
- rtx r1 = XEXP (add, 0);
- emit_insn_before (gen_rtx_SET (VOIDmode, r1, add), data->insn);
- return -1;
- }
+ /* We can reuse all operands without copying, because we are about
+ to delete the insn that contained it. */
- default:
- return 0;
- }
-}
-
-
-/* If X is a MEM, check the address to see if it is PRE/POST-INC/DEC/MODIFY
- and generate an add to replace that. */
-
-static int
-replace_inc_dec_mem (rtx *r, void *d)
-{
- rtx x = *r;
- if (x != NULL_RTX && MEM_P (x))
- {
- struct insn_size data;
-
- data.size = GET_MODE_SIZE (GET_MODE (x));
- data.insn = (rtx) d;
+ emit_insn_before (gen_rtx_SET (VOIDmode, dest, src), insn);
- for_each_rtx (&XEXP (x, 0), replace_inc_dec, &data);
-
- return -1;
- }
- return 0;
+ return -1;
}
/* Before we delete INSN, make sure that the auto inc/dec, if it is
there, is split into a separate insn. */
-static void
+void
check_for_inc_dec (rtx insn)
{
rtx note = find_reg_note (insn, REG_INC, NULL_RTX);
if (note)
- for_each_rtx (&insn, replace_inc_dec_mem, insn);
+ for_each_inc_dec (&insn, emit_inc_dec_insn_before, insn);
}
@@ -1107,7 +1050,7 @@ canon_address (rtx mem,
*alias_set_out = 0;
- cselib_lookup (mem_address, address_mode, 1);
+ cselib_lookup (mem_address, address_mode, 1, GET_MODE (mem));
if (dump_file)
{
@@ -1187,7 +1130,7 @@ canon_address (rtx mem,
}
}
- *base = cselib_lookup (address, address_mode, true);
+ *base = cselib_lookup (address, address_mode, true, GET_MODE (mem));
*group_id = -1;
if (*base == NULL)
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index 1a02b18c715..0dcb3f5357f 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -470,7 +470,7 @@ static bool clobbers_queued_reg_save (const_rtx);
static void dwarf2out_frame_debug_expr (rtx, const char *);
/* Support for complex CFA locations. */
-static void output_cfa_loc (dw_cfi_ref);
+static void output_cfa_loc (dw_cfi_ref, int);
static void output_cfa_loc_raw (dw_cfi_ref);
static void get_cfa_from_loc_descr (dw_cfa_location *,
struct dw_loc_descr_struct *);
@@ -3317,7 +3317,7 @@ output_cfi (dw_cfi_ref cfi, dw_fde_ref fde, int for_eh)
case DW_CFA_def_cfa_expression:
case DW_CFA_expression:
- output_cfa_loc (cfi);
+ output_cfa_loc (cfi, for_eh);
break;
case DW_CFA_GNU_negative_offset_extended:
@@ -5053,10 +5053,15 @@ size_of_locs (dw_loc_descr_ref loc)
static HOST_WIDE_INT extract_int (const unsigned char *, unsigned);
static void get_ref_die_offset_label (char *, dw_die_ref);
-/* Output location description stack opcode's operands (if any). */
+/* Output location description stack opcode's operands (if any).
+ The for_eh_or_skip parameter controls whether register numbers are
+ converted using DWARF2_FRAME_REG_OUT, which is needed in the case that
+ hard reg numbers have been processed via DWARF_FRAME_REGNUM (i.e. for unwind
+ info). This should be suppressed for the cases that have not been converted
+ (i.e. symbolic debug info), by setting the parameter < 0. See PR47324. */
static void
-output_loc_operands (dw_loc_descr_ref loc)
+output_loc_operands (dw_loc_descr_ref loc, int for_eh_or_skip)
{
dw_val_ref val1 = &loc->dw_loc_oprnd1;
dw_val_ref val2 = &loc->dw_loc_oprnd2;
@@ -5227,14 +5232,28 @@ output_loc_operands (dw_loc_descr_ref loc)
dw2_asm_output_data_sleb128 (val1->v.val_int, NULL);
break;
case DW_OP_regx:
- dw2_asm_output_data_uleb128 (val1->v.val_unsigned, NULL);
+ {
+ unsigned r = val1->v.val_unsigned;
+ if (for_eh_or_skip >= 0)
+ r = DWARF2_FRAME_REG_OUT (r, for_eh_or_skip);
+ gcc_assert (size_of_uleb128 (r)
+ == size_of_uleb128 (val1->v.val_unsigned));
+ dw2_asm_output_data_uleb128 (r, NULL);
+ }
break;
case DW_OP_fbreg:
dw2_asm_output_data_sleb128 (val1->v.val_int, NULL);
break;
case DW_OP_bregx:
- dw2_asm_output_data_uleb128 (val1->v.val_unsigned, NULL);
- dw2_asm_output_data_sleb128 (val2->v.val_int, NULL);
+ {
+ unsigned r = val1->v.val_unsigned;
+ if (for_eh_or_skip >= 0)
+ r = DWARF2_FRAME_REG_OUT (r, for_eh_or_skip);
+ gcc_assert (size_of_uleb128 (r)
+ == size_of_uleb128 (val1->v.val_unsigned));
+ dw2_asm_output_data_uleb128 (r, NULL);
+ dw2_asm_output_data_sleb128 (val2->v.val_int, NULL);
+ }
break;
case DW_OP_piece:
dw2_asm_output_data_uleb128 (val1->v.val_unsigned, NULL);
@@ -5288,19 +5307,42 @@ output_loc_operands (dw_loc_descr_ref loc)
}
}
-/* Output a sequence of location operations. */
+/* Output a sequence of location operations.
+ The for_eh_or_skip parameter controls whether register numbers are
+ converted using DWARF2_FRAME_REG_OUT, which is needed in the case that
+ hard reg numbers have been processed via DWARF_FRAME_REGNUM (i.e. for unwind
+ info). This should be suppressed for the cases that have not been converted
+ (i.e. symbolic debug info), by setting the parameter < 0. See PR47324. */
static void
-output_loc_sequence (dw_loc_descr_ref loc)
+output_loc_sequence (dw_loc_descr_ref loc, int for_eh_or_skip)
{
for (; loc != NULL; loc = loc->dw_loc_next)
{
+ enum dwarf_location_atom opc = loc->dw_loc_opc;
/* Output the opcode. */
- dw2_asm_output_data (1, loc->dw_loc_opc,
- "%s", dwarf_stack_op_name (loc->dw_loc_opc));
+ if (for_eh_or_skip >= 0
+ && opc >= DW_OP_breg0 && opc <= DW_OP_breg31)
+ {
+ unsigned r = (opc - DW_OP_breg0);
+ r = DWARF2_FRAME_REG_OUT (r, for_eh_or_skip);
+ gcc_assert (r <= 31);
+ opc = (enum dwarf_location_atom) (DW_OP_breg0 + r);
+ }
+ else if (for_eh_or_skip >= 0
+ && opc >= DW_OP_reg0 && opc <= DW_OP_reg31)
+ {
+ unsigned r = (opc - DW_OP_reg0);
+ r = DWARF2_FRAME_REG_OUT (r, for_eh_or_skip);
+ gcc_assert (r <= 31);
+ opc = (enum dwarf_location_atom) (DW_OP_reg0 + r);
+ }
+
+ dw2_asm_output_data (1, opc,
+ "%s", dwarf_stack_op_name (opc));
/* Output the operand(s) (if any). */
- output_loc_operands (loc);
+ output_loc_operands (loc, for_eh_or_skip);
}
}
@@ -5361,9 +5403,18 @@ output_loc_operands_raw (dw_loc_descr_ref loc)
}
break;
+ case DW_OP_regx:
+ {
+ unsigned r = DWARF2_FRAME_REG_OUT (val1->v.val_unsigned, 1);
+ gcc_assert (size_of_uleb128 (r)
+ == size_of_uleb128 (val1->v.val_unsigned));
+ fputc (',', asm_out_file);
+ dw2_asm_output_data_uleb128_raw (r);
+ }
+ break;
+
case DW_OP_constu:
case DW_OP_plus_uconst:
- case DW_OP_regx:
case DW_OP_piece:
fputc (',', asm_out_file);
dw2_asm_output_data_uleb128_raw (val1->v.val_unsigned);
@@ -5414,10 +5465,15 @@ output_loc_operands_raw (dw_loc_descr_ref loc)
break;
case DW_OP_bregx:
- fputc (',', asm_out_file);
- dw2_asm_output_data_uleb128_raw (val1->v.val_unsigned);
- fputc (',', asm_out_file);
- dw2_asm_output_data_sleb128_raw (val2->v.val_int);
+ {
+ unsigned r = DWARF2_FRAME_REG_OUT (val1->v.val_unsigned, 1);
+ gcc_assert (size_of_uleb128 (r)
+ == size_of_uleb128 (val1->v.val_unsigned));
+ fputc (',', asm_out_file);
+ dw2_asm_output_data_uleb128_raw (r);
+ fputc (',', asm_out_file);
+ dw2_asm_output_data_sleb128_raw (val2->v.val_int);
+ }
break;
case DW_OP_GNU_implicit_pointer:
@@ -5435,8 +5491,24 @@ output_loc_sequence_raw (dw_loc_descr_ref loc)
{
while (1)
{
+ enum dwarf_location_atom opc = loc->dw_loc_opc;
+ /* Output the opcode. */
+ if (opc >= DW_OP_breg0 && opc <= DW_OP_breg31)
+ {
+ unsigned r = (opc - DW_OP_breg0);
+ r = DWARF2_FRAME_REG_OUT (r, 1);
+ gcc_assert (r <= 31);
+ opc = (enum dwarf_location_atom) (DW_OP_breg0 + r);
+ }
+ else if (opc >= DW_OP_reg0 && opc <= DW_OP_reg31)
+ {
+ unsigned r = (opc - DW_OP_reg0);
+ r = DWARF2_FRAME_REG_OUT (r, 1);
+ gcc_assert (r <= 31);
+ opc = (enum dwarf_location_atom) (DW_OP_reg0 + r);
+ }
/* Output the opcode. */
- fprintf (asm_out_file, "%#x", loc->dw_loc_opc);
+ fprintf (asm_out_file, "%#x", opc);
output_loc_operands_raw (loc);
if (!loc->dw_loc_next)
@@ -5451,14 +5523,16 @@ output_loc_sequence_raw (dw_loc_descr_ref loc)
description based on a cfi entry with a complex address. */
static void
-output_cfa_loc (dw_cfi_ref cfi)
+output_cfa_loc (dw_cfi_ref cfi, int for_eh)
{
dw_loc_descr_ref loc;
unsigned long size;
if (cfi->dw_cfi_opc == DW_CFA_expression)
{
- dw2_asm_output_data (1, cfi->dw_cfi_oprnd1.dw_cfi_reg_num, NULL);
+ unsigned r =
+ DWARF2_FRAME_REG_OUT (cfi->dw_cfi_oprnd1.dw_cfi_reg_num, for_eh);
+ dw2_asm_output_data (1, r, NULL);
loc = cfi->dw_cfi_oprnd2.dw_cfi_loc;
}
else
@@ -5469,7 +5543,7 @@ output_cfa_loc (dw_cfi_ref cfi)
dw2_asm_output_data_uleb128 (size, NULL);
/* Now output the operations themselves. */
- output_loc_sequence (loc);
+ output_loc_sequence (loc, for_eh);
}
/* Similar, but used for .cfi_escape. */
@@ -5482,7 +5556,9 @@ output_cfa_loc_raw (dw_cfi_ref cfi)
if (cfi->dw_cfi_opc == DW_CFA_expression)
{
- fprintf (asm_out_file, "%#x,", cfi->dw_cfi_oprnd1.dw_cfi_reg_num);
+ unsigned r =
+ DWARF2_FRAME_REG_OUT (cfi->dw_cfi_oprnd1.dw_cfi_reg_num, 1);
+ fprintf (asm_out_file, "%#x,", r);
loc = cfi->dw_cfi_oprnd2.dw_cfi_loc;
}
else
@@ -11075,7 +11151,7 @@ output_loc_list (dw_loc_list_ref list_head)
gcc_assert (size <= 0xffff);
dw2_asm_output_data (2, size, "%s", "Location expression size");
- output_loc_sequence (curr->expr);
+ output_loc_sequence (curr->expr, -1);
}
dw2_asm_output_data (DWARF2_ADDR_SIZE, 0,
@@ -11153,7 +11229,7 @@ output_die (dw_die_ref die)
else
dw2_asm_output_data (constant_size (size), size, "%s", name);
- output_loc_sequence (AT_loc (a));
+ output_loc_sequence (AT_loc (a), -1);
break;
case dw_val_class_const:
diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c
index 582b4beb271..b002654b862 100644
--- a/gcc/emit-rtl.c
+++ b/gcc/emit-rtl.c
@@ -317,7 +317,7 @@ reg_attrs_htab_hash (const void *x)
{
const reg_attrs *const p = (const reg_attrs *) x;
- return ((p->offset * 1000) ^ (long) p->decl);
+ return ((p->offset * 1000) ^ (intptr_t) p->decl);
}
/* Returns nonzero if the value represented by X (which is really a
diff --git a/gcc/except.c b/gcc/except.c
index 8033d5065b5..42d350982aa 100644
--- a/gcc/except.c
+++ b/gcc/except.c
@@ -998,8 +998,6 @@ sjlj_assign_call_site_values (void)
/* First: build the action table. */
action = collect_one_action_chain (ar_hash, lp->region);
- if (action != -1)
- crtl->uses_eh_lsda = 1;
/* Next: assign call-site values. If dwarf2 terms, this would be
the region number assigned by convert_to_eh_region_ranges, but
@@ -1065,6 +1063,9 @@ sjlj_mark_call_sites (void)
this_call_site = 0;
}
+ if (this_call_site != -1)
+ crtl->uses_eh_lsda = 1;
+
if (this_call_site == last_call_site)
continue;
@@ -1119,27 +1120,30 @@ sjlj_emit_function_enter (rtx dispatch_label)
else
emit_move_insn (mem, const0_rtx);
+ if (dispatch_label)
+ {
#ifdef DONT_USE_BUILTIN_SETJMP
- {
- rtx x, last;
- x = emit_library_call_value (setjmp_libfunc, NULL_RTX, LCT_RETURNS_TWICE,
- TYPE_MODE (integer_type_node), 1,
- plus_constant (XEXP (fc, 0),
- sjlj_fc_jbuf_ofs), Pmode);
-
- emit_cmp_and_jump_insns (x, const0_rtx, NE, 0,
- TYPE_MODE (integer_type_node), 0, dispatch_label);
- last = get_last_insn ();
- if (JUMP_P (last) && any_condjump_p (last))
- {
- gcc_assert (!find_reg_note (last, REG_BR_PROB, 0));
- add_reg_note (last, REG_BR_PROB, GEN_INT (REG_BR_PROB_BASE / 100));
- }
- }
-#else
- expand_builtin_setjmp_setup (plus_constant (XEXP (fc, 0), sjlj_fc_jbuf_ofs),
+ rtx x, last;
+ x = emit_library_call_value (setjmp_libfunc, NULL_RTX, LCT_RETURNS_TWICE,
+ TYPE_MODE (integer_type_node), 1,
+ plus_constant (XEXP (fc, 0),
+ sjlj_fc_jbuf_ofs), Pmode);
+
+ emit_cmp_and_jump_insns (x, const0_rtx, NE, 0,
+ TYPE_MODE (integer_type_node), 0,
dispatch_label);
+ last = get_last_insn ();
+ if (JUMP_P (last) && any_condjump_p (last))
+ {
+ gcc_assert (!find_reg_note (last, REG_BR_PROB, 0));
+ add_reg_note (last, REG_BR_PROB, GEN_INT (REG_BR_PROB_BASE / 100));
+ }
+#else
+ expand_builtin_setjmp_setup (plus_constant (XEXP (fc, 0),
+ sjlj_fc_jbuf_ofs),
+ dispatch_label);
#endif
+ }
emit_library_call (unwind_sjlj_register_libfunc, LCT_NORMAL, VOIDmode,
1, XEXP (fc, 0), Pmode);
@@ -1363,6 +1367,23 @@ sjlj_build_landing_pads (void)
sjlj_emit_function_exit ();
}
+ /* If we do not have any landing pads, we may still need to register a
+ personality routine and (empty) LSDA to handle must-not-throw regions. */
+ else if (function_needs_eh_personality (cfun) != eh_personality_none)
+ {
+ int align = STACK_SLOT_ALIGNMENT (sjlj_fc_type_node,
+ TYPE_MODE (sjlj_fc_type_node),
+ TYPE_ALIGN (sjlj_fc_type_node));
+ crtl->eh.sjlj_fc
+ = assign_stack_local (TYPE_MODE (sjlj_fc_type_node),
+ int_size_in_bytes (sjlj_fc_type_node),
+ align);
+
+ sjlj_mark_call_sites ();
+ sjlj_emit_function_enter (NULL_RTX);
+ sjlj_emit_function_exit ();
+ }
+
VEC_free (int, heap, sjlj_lp_call_site_index);
}
@@ -2421,30 +2442,33 @@ convert_to_eh_region_ranges (void)
if (last_action != this_action
|| last_landing_pad != this_landing_pad)
{
+ /* If there is a queued no-action region in the other section
+ with hot/cold partitioning, emit it now. */
+ if (first_no_action_insn_before_switch)
+ {
+ gcc_assert (this_action != -1
+ && last_action == (first_no_action_insn
+ ? -1 : -3));
+ call_site = add_call_site (NULL_RTX, 0, 0);
+ note = emit_note_before (NOTE_INSN_EH_REGION_BEG,
+ first_no_action_insn_before_switch);
+ NOTE_EH_HANDLER (note) = call_site;
+ note = emit_note_after (NOTE_INSN_EH_REGION_END,
+ last_no_action_insn_before_switch);
+ NOTE_EH_HANDLER (note) = call_site;
+ gcc_assert (last_action != -3
+ || (last_action_insn
+ == last_no_action_insn_before_switch));
+ first_no_action_insn_before_switch = NULL_RTX;
+ last_no_action_insn_before_switch = NULL_RTX;
+ call_site_base++;
+ }
/* If we'd not seen a previous action (-3) or the previous
action was must-not-throw (-2), then we do not need an
end note. */
if (last_action >= -1)
{
/* If we delayed the creation of the begin, do it now. */
- if (first_no_action_insn_before_switch)
- {
- call_site = add_call_site (NULL_RTX, 0, 0);
- note
- = emit_note_before (NOTE_INSN_EH_REGION_BEG,
- first_no_action_insn_before_switch);
- NOTE_EH_HANDLER (note) = call_site;
- if (first_no_action_insn)
- {
- note
- = emit_note_after (NOTE_INSN_EH_REGION_END,
- last_no_action_insn_before_switch);
- NOTE_EH_HANDLER (note) = call_site;
- }
- else
- gcc_assert (last_action_insn
- == last_no_action_insn_before_switch);
- }
if (first_no_action_insn)
{
call_site = add_call_site (NULL_RTX, 0, cur_sec);
diff --git a/gcc/expr.c b/gcc/expr.c
index cacc569f0c9..e5a669301bd 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -3398,7 +3398,7 @@ emit_move_insn (rtx x, rtx y)
&& (set = single_set (last_insn)) != NULL_RTX
&& SET_DEST (set) == x
&& ! rtx_equal_p (y_cst, SET_SRC (set)))
- set_unique_reg_note (last_insn, REG_EQUAL, y_cst);
+ set_unique_reg_note (last_insn, REG_EQUAL, copy_rtx (y_cst));
return last_insn;
}
@@ -7695,6 +7695,18 @@ expand_expr_real_2 (sepops ops, rtx target, enum machine_mode tmode,
optab opt = fma_optab;
gimple def0, def2;
+ /* If there is no insn for FMA, emit it as __builtin_fma{,f,l}
+ call. */
+ if (optab_handler (fma_optab, mode) == CODE_FOR_nothing)
+ {
+ tree fn = mathfn_built_in (TREE_TYPE (treeop0), BUILT_IN_FMA);
+ tree call_expr;
+
+ gcc_assert (fn != NULL_TREE);
+ call_expr = build_call_expr (fn, 3, treeop0, treeop1, treeop2);
+ return expand_builtin (call_expr, target, subtarget, mode, false);
+ }
+
def0 = get_def_for_expr (treeop0, NEGATE_EXPR);
def2 = get_def_for_expr (treeop2, NEGATE_EXPR);
@@ -8375,6 +8387,13 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
NULL);
g = get_gimple_for_ssa_name (exp);
+ /* For EXPAND_INITIALIZER try harder to get something simpler. */
+ if (g == NULL
+ && modifier == EXPAND_INITIALIZER
+ && !SSA_NAME_IS_DEFAULT_DEF (exp)
+ && (optimize || DECL_IGNORED_P (SSA_NAME_VAR (exp)))
+ && stmt_is_replaceable_p (SSA_NAME_DEF_STMT (exp)))
+ g = SSA_NAME_DEF_STMT (exp);
if (g)
return expand_expr_real (gimple_assign_rhs_to_tree (g), target, tmode,
modifier, NULL);
diff --git a/gcc/final.c b/gcc/final.c
index 09dec08e0ea..ceb79744c41 100644
--- a/gcc/final.c
+++ b/gcc/final.c
@@ -4402,7 +4402,11 @@ rest_of_clean_state (void)
if (LABEL_P (insn))
INSN_UID (insn) = CODE_LABEL_NUMBER (insn);
else
- INSN_UID (insn) = 0;
+ {
+ if (NOTE_P (insn))
+ set_block_for_insn (insn, NULL);
+ INSN_UID (insn) = 0;
+ }
}
}
@@ -4423,7 +4427,6 @@ rest_of_clean_state (void)
&& NOTE_KIND (insn) != NOTE_INSN_BLOCK_END
&& NOTE_KIND (insn) != NOTE_INSN_CFA_RESTORE_STATE)))
print_rtl_single (final_output, insn);
-
}
if (final_output)
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index 8bf90a95b04..8e006bc1ccf 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,421 @@
+2011-02-24 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/47872
+ * intrinsic.texi (ALLOCATED, ATAN, BESSEL_JN, BESSEL_YN): Add
+ multitable for linebreak between different syntax variants.
+
+2011-02-24 Richard Guenther <rguenther@suse.de>
+
+ PR fortran/47839
+ * f95-lang.c (pushdecl): For externs in non-global scope push
+ a copy of the decl into the BLOCK.
+
+2011-02-23 Mikael Morin <mikael@gcc.gnu.org>
+
+ PR fortran/40850
+ * trans.c (gfc_prepend_expr_to_block): New function.
+ * trans.h (gfc_prepend_expr_to_block): Declare.
+ * trans-array.c (gfc_conv_array_parameter): Replace
+ gfc_add_expr_to_block with gfc_prepend_expr_to_block.
+
+2011-02-22 Paul Thomas <pault@gcc.gnu.org>
+
+ PR fortran/45743
+ * trans-decl.c (gfc_get_extern_function_decl): Don't use the
+ gsymbol backend_decl if the procedure has a formal argument
+ that is a procedure.
+
+2011-02-22 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/41359
+ * trans-stmt.c (gfc_trans_if_1): Use correct line for
+ expressions in the if condition.
+
+2011-02-20 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/47797
+ * trans-decl.c (gfc_trans_deferred_vars): Use gfc_set_backend_locus and
+ gfc_restore_backend_locus to have better debug locations.
+ * trans-array.c (gfc_trans_deferred_array): Ditto.
+
+2011-02-20 Paul Thomas <pault@gcc.gnu.org>
+
+ PR fortran/45077
+ PR fortran/44945
+ * trans-types.c (gfc_get_derived_type): Remove code that looks
+ for decls in gsym and add call to gfc_get_module_backend_decl.
+ * trans.h : Add prototype for gfc_get_module_backend_decl.
+ * trans-decl.c (gfc_get_module_backend_decl): New function.
+ (gfc_get_symbol_decl): Call it.
+
+2011-02-19 Paul Thomas <pault@gcc.gnu.org>
+
+ PR fortran/47348
+ * trans-array.c (get_array_ctor_all_strlen): Move up in file.
+ (get_array_ctor_var_strlen): Add block dummy and add call to
+ get_array_ctor_all_strlen instead of giving up on substrings.
+ Call gcc_unreachable for default case.
+ (get_array_ctor_strlen): Add extra argument to in call to
+ get_array_ctor_var_strlen.
+
+2011-02-18 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/47789
+ * primary.c (gfc_match_structure_constructor): Handle empty parent
+ types.
+
+2011-02-18 Tobias Burnus
+
+ PR fortran/47775
+ * trans-expr.c (arrayfunc_assign_needs_temporary): Use
+ esym to check whether the specific procedure returns an
+ allocatable or pointer.
+
+2011-02-18 Michael Matz <matz@suse.de>
+
+ PR fortran/45586
+ * gfortran.h (struct gfc_component): Add norestrict_decl member.
+ * trans.h (struct lang_type): Add nonrestricted_type member.
+ * trans-expr.c (gfc_conv_component_ref): Search fields with correct
+ parent type.
+ * trans-types.c (mirror_fields, gfc_nonrestricted_type): New.
+ (gfc_sym_type): Use it.
+
+2011-02-18 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/47768
+ * resolve.c (resolve_transfer): Reject variables with procedure pointer
+ components.
+
+2011-02-18 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/47767
+ * gfortran.h (gfc_check_access): Removed prototype.
+ (gfc_check_symbol_access): Added prototype.
+ * module.c (gfc_check_access): Renamed to 'check_access', made static.
+ (gfc_check_symbol_access): New function, basically a shortcut for
+ 'check_access'.
+ (write_dt_extensions,write_symbol0,write_generic,write_symtree): Use
+ 'gfc_check_symbol_access'.
+ (write_operator,write_module): Renamed 'gfc_check_access'.
+ * resolve.c (resolve_fl_procedure,resolve_fl_derived,
+ resolve_fl_namelist,resolve_symbol,resolve_fntype): Use
+ 'gfc_check_symbol_access'.
+
+2011-02-16 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/47745
+ * class.c (gfc_build_class_symbol): Set 'class_ok' attribute.
+ * decl.c (build_sym,attr_decl1): Move setting of 'class_ok' into
+ 'gfc_build_class_symbol'.
+ (gfc_match_decl_type_spec): Reject unlimited polymorphism.
+ * interface.c (matching_typebound_op): Check for 'class_ok' attribute.
+ * match.c (select_type_set_tmp): Move setting of 'class_ok' into
+ 'gfc_build_class_symbol'.
+ * primary.c (gfc_variable_attr): Check for 'class_ok' attribute.
+
+2011-02-15 Steven G. Kargl <kargl@gcc.gnu.org>
+
+ PR fortran/47633
+ . simplify.c (gfc_simplify_compiler_version): Fix off-by-one issue.
+
+2011-02-14 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/47730
+ * parse.c (gfc_build_block_ns): Commit 'block@' symbol.
+
+2011-02-14 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/47728
+ * class.c (gfc_build_class_symbol): Give a fatal error on polymorphic
+ arrays.
+ * primary.c (gfc_match_varspec): Avoid ICE for invalid class
+ declaration.
+
+2011-02-14 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/47349
+ * interface.c (get_expr_storage_size): Handle derived-type components.
+
+2011-02-13 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/47569
+ * interface.c (compare_parameter): Avoid ICE with
+ character components.
+
+2011-02-12 Janus Weil <janus@gcc.gnu.org>
+
+ * class.c (gfc_build_class_symbol): Reject polymorphic arrays.
+ * decl.c (build_sym,build_struct,attr_decl1): Use return value of
+ 'gfc_build_class_symbol'.
+
+2011-02-12 Michael Matz <matz@suse.de>
+ Janus Weil <janus@gcc.gnu.org>
+ Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/45586
+ * trans-expr.c (conv_parent_component_references): Avoid unintendent
+ skipping of parent compounds.
+
+2011-02-11 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/47550
+ * resolve.c (resolve_formal_arglist): PURE with VALUE
+ and no INTENT: Add -std= diagnostics.
+
+2011-02-09 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/47352
+ * resolve.c (resolve_procedure_interface): If interface has a result
+ variable, copy the typespec and set result pointer to self.
+
+2011-02-09 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/47463
+ * resolve.c (resolve_typebound_subroutine): Remove erroneous line.
+
+2011-02-09 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/47637
+ * trans-decl.c (init_intent_out_dt): Handle CLASS arguments.
+
+2011-02-08 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
+ * io.c (match_io_element): Do not set dt if not inquire.
+
+2011-02-08 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/45290
+ * expr.c (gfc_check_assign_symbol): Reject pointers as pointer
+ initialization target.
+
+2011-02-07 Janne Blomqvist <jb@gcc.gnu.org>
+ Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
+
+ * gfortran.texi (Thread-safety): texinfo styling fixes.
+ * intrinsic.texi: Likewise.
+
+2011-02-06 Janne Blomqvist <jb@gcc.gnu.org>
+
+ * gfortran.texi (Compiler Characteristics): Add reference to
+ thread-safety section.
+
+2011-02-06 Janne Blomqvist <jb@gcc.gnu.org>
+
+ * gfortran.texi (Thread-safety): New section.
+ * intrinsic.texi (EXECUTE_COMMAND_LINE): Mention thread-safety.
+ (GETENV): Likewise.
+ (GET_ENVIRONMENT_VARIABLE): Likewise.
+ (SYSTEM): Likewise.
+
+2011-02-06 Paul Thomas <pault@gcc.gnu.org>
+
+ PR fortran/47592
+ * trans-stmt.c (gfc_trans_allocate): For deferred character
+ length allocations with SOURCE, store to the values and string
+ length to avoid calculating twice. Replace gfc_start_block
+ with gfc_init_block to avoid unnecessary contexts and to keep
+ declarations of temporaries where they should be. Tidy up the
+ code a bit.
+
+2011-02-05 Janne Blomqvist <jb@gcc.gnu.org>
+
+ PR fortran/42434
+ * intrinsic.texi (SYSTEM_CLOCK): Update documentation.
+
+2011-02-02 Janus Weil <janus@gcc.gnu.org>
+ Paul Thomas <pault@gcc.gnu.org>
+
+ PR fortran/47082
+ * trans-expr.c (gfc_trans_class_init_assign): Add call to
+ gfc_get_derived_type.
+ * module.c (read_cleanup): Do not use unique_symtrees for vtabs
+ or vtypes.
+
+2011-02-02 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/47572
+ * resolve.c (resolve_fl_variable): Handle polymorphic allocatables.
+
+2011-02-01 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/47565
+ * trans-expr.c (gfc_conv_structure): Handle constructors for procedure
+ pointer components with allocatable result.
+
+2011-01-31 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/47455
+ * trans-expr.c (gfc_conv_procedure_call): Handle procedure pointers
+ with pointer or allocatable result.
+
+2011-01-31 Paul Thomas <pault@gcc.gnu.org>
+
+ PR fortran/47519
+ * trans-stmt.c (gfc_trans_allocate): Improve handling of
+ deferred character lengths with SOURCE.
+ * iresolve.c (gfc_resolve_repeat): Calculate character
+ length from source length and ncopies.
+ * dump-parse-tree.c (show_code_node): Show MOLD and SOURCE
+ expressions for ALLOCATE.
+
+2011-01-31 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/47463
+ * resolve.c (resolve_typebound_subroutine): Bug fix for the case of
+ an argument of a typebound assignment being a component.
+
+2011-01-31 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * gfortranspec.c (add_arg_libgfortran) [HAVE_LD_STATIC_DYNAMIC] Use
+ LD_STATIC_OPTION, LD_DYNAMIC_OPTION.
+
+2011-01-31 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/47042
+ * resolve.c (resolve_fl_procedure): Reject stmt functions
+ with pointer/allocatable attribute.
+
+2011-01-31 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/47042
+ * interface.c (gfc_procedure_use): Add explicit interface check for
+ pointer/allocatable functions.
+
+2011-01-30 Paul Thomas <pault@gcc.gnu.org>
+
+ PR fortran/47523
+ * trans-expr.c (gfc_trans_assignment_1): If the rhs is an op
+ expr and is assigned to a deferred character length scalar,
+ make sure that the function is called before reallocation,
+ so that the length is available. Include procedure pointer
+ and procedure pointer component rhs as well.
+
+ PR fortran/45170
+ PR fortran/35810
+ PR fortran/47350
+ * gfortran.dg/allocatable_function_5.f90: New test not added by
+ mistake on 2011-01-28.
+
+2011-01-29 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/47531
+ * check.c (gfc_check_shape): Support kind argument in SHAPE.
+ * intrinsic.c (add_functions): Ditto.
+ * resolve.c (gfc_resolve_shape): Ditto.
+ * simplify.c (gfc_simplify_shape): Ditto.
+ * intrinsic.h (gfc_check_shape, gfc_resolve_shape,
+ gfc_simplify_shape): Update prototypes.
+ * intrinisc.text (SHAPE): Document kind argument.
+
+2011-01-28 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/47507
+ * resolve.c (resolve_formal_arglist): Allow arguments with VALUE
+ attribute also without INTENT.
+
+2011-01-28 Tobias Burnus <burnus@net-b.de>
+
+ * gfortran.texi (Fortran 2003 status): Mention support for
+ nonconstant namelist variables.
+
+2011-01-28 Paul Thomas <pault@gcc.gnu.org>
+ Tobias Burnus <burnus@gcc.gnu.org>
+
+ PR fortran/45170
+ PR fortran/35810
+ PR fortran/47350
+ * interface.c (compare_actual_formal): An allocatable or pointer
+ deferred length actual is only allowed if the formal argument
+ is also deferred length. Clean up whitespace.
+ * trans-expr.c (gfc_conv_procedure_call): Pass string length for
+ deferred character length formal arguments by reference. Do the
+ same for function results.
+ (gfc_trans_pointer_assignment): Do not do runtime check of lhs
+ and rhs character lengths, if deferred length lhs. In this case
+ set the lhs character length to that of the rhs.
+ (gfc_conv_string_parameter): Remove assert that string length is
+ an integer type.
+ (is_scalar_reallocatable_lhs): New function.
+ (alloc_scalar_allocatable_for_assignment): New function.
+ (gfc_trans_assignment_1): Call above new function. If the rhs is
+ a deferred character length itself, makes ure that the function
+ is called before reallocation, so that the length is available.
+ (gfc_trans_asssignment): Remove error about assignment to
+ deferred length character variables.
+ * gfortran.texi : Update entry about (re)allocation on
+ assignment.
+ * trans-stmt.c (gfc_trans_allocate): Add code to handle deferred
+ length character variables.
+ * module.c (mio_typespec): Transfer deferred characteristic.
+ * trans-types.c (gfc_get_function_type): New code to generate
+ hidden typelist, so that those character lengths that are
+ passed by reference get the right type.
+ * resolve.c (resolve_contained_fntype): Supress error for
+ deferred character length functions.
+ (resolve_function, resolve_fl_procedure) The same.
+ (check_symbols): Remove the error that support for
+ entity with deferred type parameter is not yet implemented.
+ (resolve_fl_derived): The same.
+ match.c (alloc_opt_list): Allow MOLD for deferred length object.
+ * trans-decl.c (gfc_get_symbol_decl): For deferred character
+ length dummies, generate a local variable for string length.
+ (create_function_arglist): Hidden length can be a pointer.
+ (gfc_trans_deferred_vars): For deferred character length
+ results and dummies, assign the string length to the local
+ variable from the hidden argument on entry and the other way
+ round on exit, as appropriate.
+
+2011-01-27 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/47474
+ * trans-decl.c (gfc_generate_function_code): Fix init
+ of allocatable result variable with allocatable components.
+
+2011-01-27 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/47472
+ * options.c (gfc_handle_module_path_options): Save
+ module path without trailing slash as include path.
+
+2011-01-25 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/47448
+ * interface.c (gfc_check_operator_interface): Fix
+ defined-assignment check.
+
+2011-01-23 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/47421
+ * trans-decl.c (gfc_trans_deferred_vars): Do not nullify
+ scalar allocatable dummy arguments.
+
+2011-01-22 Thomas Koenig <tkoenig@gcc.gnu.org>
+
+ PR fortran/38536
+ * resolve.c (gfc_iso_c_func_interface): For C_LOC,
+ check for array sections followed by component references
+ which are illegal. Also check for coindexed arguments.
+
+2011-01-22 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/47399
+ * primary.c (gfc_match_varspec): Relax gcc_assert to allow for
+ PARAMETER TBP.
+
+2011-01-21 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/47394
+ * error.c (gfc_error_now, gfc_fatal_error, gfc_error_check):
+ Use defined instead of magic number exit status codes.
+ * scanner.c (include_line, gfc_new_file): Ditto.
+
+2011-01-21 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/47377
+ * expr.c (gfc_check_pointer_assign): Reject expr data-targets
+ without pointer attribute.
+
2011-01-18 Janus Weil <janus@gcc.gnu.org>
PR fortran/47240
diff --git a/gcc/fortran/check.c b/gcc/fortran/check.c
index 20163f99a55..adb4b95368d 100644
--- a/gcc/fortran/check.c
+++ b/gcc/fortran/check.c
@@ -3255,7 +3255,7 @@ gfc_check_set_exponent (gfc_expr *x, gfc_expr *i)
gfc_try
-gfc_check_shape (gfc_expr *source)
+gfc_check_shape (gfc_expr *source, gfc_expr *kind)
{
gfc_array_ref *ar;
@@ -3271,6 +3271,13 @@ gfc_check_shape (gfc_expr *source)
return FAILURE;
}
+ if (kind_check (kind, 1, BT_INTEGER) == FAILURE)
+ return FAILURE;
+ if (kind && gfc_notify_std (GFC_STD_F2003, "Fortran 2003: '%s' intrinsic "
+ "with KIND argument at %L",
+ gfc_current_intrinsic, &kind->where) == FAILURE)
+ return FAILURE;
+
return SUCCESS;
}
diff --git a/gcc/fortran/class.c b/gcc/fortran/class.c
index 2227f9e72f3..85da3cb2b45 100644
--- a/gcc/fortran/class.c
+++ b/gcc/fortran/class.c
@@ -183,6 +183,22 @@ gfc_build_class_symbol (gfc_typespec *ts, symbol_attribute *attr,
gfc_symbol *fclass;
gfc_symbol *vtab;
gfc_component *c;
+
+ if (attr->class_ok)
+ /* Class container has already been built. */
+ return SUCCESS;
+
+ attr->class_ok = attr->dummy || attr->pointer || attr->allocatable;
+
+ if (!attr->class_ok)
+ /* We can not build the class container yet. */
+ return SUCCESS;
+
+ if (*as)
+ {
+ gfc_fatal_error ("Polymorphic array at %C not yet supported");
+ return FAILURE;
+ }
/* Determine the name of the encapsulating type. */
get_unique_hashed_string (tname, ts->u.derived);
diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c
index 638a7386d15..8b5f92b4f8c 100644
--- a/gcc/fortran/decl.c
+++ b/gcc/fortran/decl.c
@@ -1177,10 +1177,8 @@ build_sym (const char *name, gfc_charlen *cl, bool cl_deferred,
sym->attr.implied_index = 0;
- if (sym->ts.type == BT_CLASS
- && (sym->attr.class_ok = sym->attr.dummy || sym->attr.pointer
- || sym->attr.allocatable))
- gfc_build_class_symbol (&sym->ts, &sym->attr, &sym->as, false);
+ if (sym->ts.type == BT_CLASS)
+ return gfc_build_class_symbol (&sym->ts, &sym->attr, &sym->as, false);
return SUCCESS;
}
@@ -1639,10 +1637,9 @@ scalar:
bool delayed = (gfc_state_stack->sym == c->ts.u.derived)
|| (!c->ts.u.derived->components
&& !c->ts.u.derived->attr.zero_comp);
- gfc_build_class_symbol (&c->ts, &c->attr, &c->as, delayed);
+ return gfc_build_class_symbol (&c->ts, &c->attr, &c->as, delayed);
}
-
return t;
}
@@ -2614,6 +2611,16 @@ gfc_match_decl_type_spec (gfc_typespec *ts, int implicit_flag)
ts->type = BT_DERIVED;
else
{
+ /* Match CLASS declarations. */
+ m = gfc_match (" class ( * )");
+ if (m == MATCH_ERROR)
+ return MATCH_ERROR;
+ else if (m == MATCH_YES)
+ {
+ gfc_fatal_error ("Unlimited polymorphism at %C not yet supported");
+ return MATCH_ERROR;
+ }
+
m = gfc_match (" class ( %n )", name);
if (m != MATCH_YES)
return m;
@@ -6046,10 +6053,12 @@ attr_decl1 (void)
}
}
- if (sym->ts.type == BT_CLASS && !sym->attr.class_ok
- && (sym->attr.class_ok = sym->attr.class_ok || current_attr.allocatable
- || current_attr.pointer))
- gfc_build_class_symbol (&sym->ts, &sym->attr, &sym->as, false);
+ if (sym->ts.type == BT_CLASS
+ && gfc_build_class_symbol (&sym->ts, &sym->attr, &sym->as, false) == FAILURE)
+ {
+ m = MATCH_ERROR;
+ goto cleanup;
+ }
if (gfc_set_array_spec (sym, as, &var_locus) == FAILURE)
{
diff --git a/gcc/fortran/dump-parse-tree.c b/gcc/fortran/dump-parse-tree.c
index 24e9ea5d1d5..424feb1e68e 100644
--- a/gcc/fortran/dump-parse-tree.c
+++ b/gcc/fortran/dump-parse-tree.c
@@ -1605,6 +1605,15 @@ show_code_node (int level, gfc_code *c)
show_expr (c->expr2);
}
+ if (c->expr3)
+ {
+ if (c->expr3->mold)
+ fputs (" MOLD=", dumpfile);
+ else
+ fputs (" SOURCE=", dumpfile);
+ show_expr (c->expr3);
+ }
+
for (a = c->ext.alloc.list; a; a = a->next)
{
fputc (' ', dumpfile);
diff --git a/gcc/fortran/error.c b/gcc/fortran/error.c
index 30928286c98..bedb6297777 100644
--- a/gcc/fortran/error.c
+++ b/gcc/fortran/error.c
@@ -939,7 +939,7 @@ gfc_error_now (const char *gmsgid, ...)
buffer_flag = i;
if (flag_fatal_errors)
- exit (1);
+ exit (FATAL_EXIT_CODE);
}
@@ -956,7 +956,7 @@ gfc_fatal_error (const char *gmsgid, ...)
error_print (_("Fatal Error:"), _(gmsgid), argp);
va_end (argp);
- exit (3);
+ exit (FATAL_EXIT_CODE);
}
@@ -1019,7 +1019,7 @@ gfc_error_check (void)
gfc_increment_error_count();
if (flag_fatal_errors)
- exit (1);
+ exit (FATAL_EXIT_CODE);
}
return rc;
diff --git a/gcc/fortran/expr.c b/gcc/fortran/expr.c
index 3f1141a0e0b..b30bc64d74a 100644
--- a/gcc/fortran/expr.c
+++ b/gcc/fortran/expr.c
@@ -3507,6 +3507,15 @@ gfc_check_pointer_assign (gfc_expr *lvalue, gfc_expr *rvalue)
lvalue->symtree->n.sym->attr.subref_array_pointer = 1;
attr = gfc_expr_attr (rvalue);
+
+ if (rvalue->expr_type == EXPR_FUNCTION && !attr.pointer)
+ {
+ gfc_error ("Target expression in pointer assignment "
+ "at %L must deliver a pointer result",
+ &rvalue->where);
+ return FAILURE;
+ }
+
if (!attr.target && !attr.pointer)
{
gfc_error ("Pointer assignment target is neither TARGET "
@@ -3599,7 +3608,7 @@ gfc_check_assign_symbol (gfc_symbol *sym, gfc_expr *rvalue)
"must not be ALLOCATABLE ");
return FAILURE;
}
- if (!attr.target)
+ if (!attr.target || attr.pointer)
{
gfc_error ("Pointer initialization target at %C "
"must have the TARGET attribute");
@@ -3612,6 +3621,18 @@ gfc_check_assign_symbol (gfc_symbol *sym, gfc_expr *rvalue)
return FAILURE;
}
}
+
+ if (sym->attr.proc_pointer && rvalue->expr_type != EXPR_NULL)
+ {
+ /* F08:C1220. Additional checks for procedure pointer initialization. */
+ symbol_attribute attr = gfc_expr_attr (rvalue);
+ if (attr.proc_pointer)
+ {
+ gfc_error ("Procedure pointer initialization target at %L "
+ "may not be a procedure pointer", &rvalue->where);
+ return FAILURE;
+ }
+ }
return SUCCESS;
}
diff --git a/gcc/fortran/f95-lang.c b/gcc/fortran/f95-lang.c
index a3ac86032c6..3340dc4ee24 100644
--- a/gcc/fortran/f95-lang.c
+++ b/gcc/fortran/f95-lang.c
@@ -498,13 +498,20 @@ poplevel (int keep, int reverse, int functionbody)
tree
pushdecl (tree decl)
{
- /* External objects aren't nested, other objects may be. */
- if (DECL_EXTERNAL (decl))
- DECL_CONTEXT (decl) = NULL_TREE;
- else if (global_bindings_p ())
+ if (global_bindings_p ())
DECL_CONTEXT (decl) = current_translation_unit;
else
- DECL_CONTEXT (decl) = current_function_decl;
+ {
+ /* External objects aren't nested. For debug info insert a copy
+ of the decl into the binding level. */
+ if (DECL_EXTERNAL (decl))
+ {
+ tree orig = decl;
+ decl = copy_node (decl);
+ DECL_CONTEXT (orig) = NULL_TREE;
+ }
+ DECL_CONTEXT (decl) = current_function_decl;
+ }
/* Put the declaration on the list. The list of declarations is in reverse
order. The list will be reversed later if necessary. This needs to be
diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h
index ebba2a814fb..b64fa2014e5 100644
--- a/gcc/fortran/gfortran.h
+++ b/gcc/fortran/gfortran.h
@@ -934,6 +934,10 @@ typedef struct gfc_component
gfc_array_spec *as;
tree backend_decl;
+ /* Used to cache a FIELD_DECL matching this same component
+ but applied to a different backend containing type that was
+ generated by gfc_nonrestricted_type. */
+ tree norestrict_decl;
locus loc;
struct gfc_expr *initializer;
struct gfc_component *next;
@@ -2832,7 +2836,7 @@ gfc_try gfc_resolve_wait (gfc_wait *);
void gfc_module_init_2 (void);
void gfc_module_done_2 (void);
void gfc_dump_module (const char *, int);
-bool gfc_check_access (gfc_access, gfc_access);
+bool gfc_check_symbol_access (gfc_symbol *);
void gfc_free_use_stmts (gfc_use_list *);
/* primary.c */
diff --git a/gcc/fortran/gfortran.texi b/gcc/fortran/gfortran.texi
index 39180353111..2f63bbb7f88 100644
--- a/gcc/fortran/gfortran.texi
+++ b/gcc/fortran/gfortran.texi
@@ -830,10 +830,11 @@ type-specification with type parameter and for allocation and initialization
from a @code{SOURCE=} expression; @code{ALLOCATE} and @code{DEALLOCATE}
optionally return an error message string via @code{ERRMSG=}.
-@item Reallocation on assignment for arrays: If an intrinsic assignment is
+@item Reallocation on assignment: If an intrinsic assignment is
used, an allocatable variable on the left-hand side is automatically allocated
-(if unallocated) or reallocated (if the shape is different). Currently, the
-reallocation for scalars is not implemented.
+(if unallocated) or reallocated (if the shape is different). Currently, scalar
+deferred character length left-hand sides are correctly handled but arrays
+are not yet fully implemented.
@item Transferring of allocations via @code{MOVE_ALLOC}.
@@ -855,6 +856,9 @@ the @code{SELECTED_CHAR_KIND} and @code{NEW_LINE} intrinsic functions.
@item Support for binary, octal and hexadecimal (BOZ) constants in the
intrinsic functions @code{INT}, @code{REAL}, @code{CMPLX} and @code{DBLE}.
+@item Support for namelist variables with allocatable and pointer
+attribute and nonconstant length type parameter.
+
@item
@cindex array, constructors
@cindex @code{[...]}
@@ -1079,6 +1083,7 @@ might in some way or another become visible to the programmer.
@menu
* KIND Type Parameters::
* Internal representation of LOGICAL variables::
+* Thread-safety of the runtime library::
@end menu
@@ -1153,6 +1158,36 @@ representation of @code{LOGICAL} variables in GNU Fortran is identical
to C99 _Bool, except for a possible difference in storage size
depending on the kind.
+
+@node Thread-safety of the runtime library
+@section Thread-safety of the runtime library
+@cindex thread-safety, threads
+
+GNU Fortran can be used in programs with multiple threads, e.g.@: by
+using OpenMP, by calling OS thread handling functions via the
+@code{ISO_C_BINDING} facility, or by GNU Fortran compiled library code
+being called from a multi-threaded program.
+
+The GNU Fortran runtime library, (@code{libgfortran}), supports being
+called concurrently from multiple threads with the following
+exceptions.
+
+During library initialization, the C @code{getenv} function is used,
+which need not be thread-safe. Similarly, the @code{getenv}
+function is used to implement the @code{GET_ENVIRONMENT_VARIABLE} and
+@code{GETENV} intrinsics. It is the responsibility of the user to
+ensure that the environment is not being updated concurrently when any
+of these actions are taking place.
+
+The @code{EXECUTE_COMMAND_LINE} and @code{SYSTEM} intrinsics are
+implemented with the @code{system} function, which need not be
+thread-safe. It is the responsibility of the user to ensure that
+@code{system} is not called concurrently.
+
+Finally, for platforms not supporting thread-safe POSIX functions,
+further functionality might not be thread-safe. For details, please
+consult the documentation for your operating system.
+
@c ---------------------------------------------------------------------
@c Extensions
@c ---------------------------------------------------------------------
diff --git a/gcc/fortran/gfortranspec.c b/gcc/fortran/gfortranspec.c
index a9bc7145419..2d732fdd45b 100644
--- a/gcc/fortran/gfortranspec.c
+++ b/gcc/fortran/gfortranspec.c
@@ -192,12 +192,12 @@ add_arg_libgfortran (bool force_static ATTRIBUTE_UNUSED)
{
#ifdef HAVE_LD_STATIC_DYNAMIC
if (force_static)
- append_option (OPT_Wl_, "-Bstatic", 1);
+ append_option (OPT_Wl_, LD_STATIC_OPTION, 1);
#endif
append_option (OPT_l, FORTRAN_LIBRARY, 1);
#ifdef HAVE_LD_STATIC_DYNAMIC
if (force_static)
- append_option (OPT_Wl_, "-Bdynamic", 1);
+ append_option (OPT_Wl_, LD_DYNAMIC_OPTION, 1);
#endif
}
diff --git a/gcc/fortran/interface.c b/gcc/fortran/interface.c
index 1febb5d8587..b0b74c14b9f 100644
--- a/gcc/fortran/interface.c
+++ b/gcc/fortran/interface.c
@@ -654,11 +654,12 @@ gfc_check_operator_interface (gfc_symbol *sym, gfc_intrinsic_op op,
/* Allowed are (per F2003, 12.3.2.1.2 Defined assignments):
- First argument an array with different rank than second,
- - Types and kinds do not conform, and
+ - First argument is a scalar and second an array,
+ - Types and kinds do not conform, or
- First argument is of derived type. */
if (sym->formal->sym->ts.type != BT_DERIVED
&& sym->formal->sym->ts.type != BT_CLASS
- && (r1 == 0 || r1 == r2)
+ && (r2 == 0 || r1 == r2)
&& (sym->formal->sym->ts.type == sym->formal->next->sym->ts.type
|| (gfc_numeric_ts (&sym->formal->sym->ts)
&& gfc_numeric_ts (&sym->formal->next->sym->ts))))
@@ -1460,7 +1461,7 @@ compare_parameter (gfc_symbol *formal, gfc_expr *actual,
int ranks_must_agree, int is_elemental, locus *where)
{
gfc_ref *ref;
- bool rank_check;
+ bool rank_check, is_pointer;
/* If the formal arg has type BT_VOID, it's to one of the iso_c_binding
procs c_f_pointer or c_f_procpointer, and we need to accept most
@@ -1671,23 +1672,56 @@ compare_parameter (gfc_symbol *formal, gfc_expr *actual,
return 1;
/* At this point, we are considering a scalar passed to an array. This
- is valid (cf. F95 12.4.1.1; F2003 12.4.1.2),
+ is valid (cf. F95 12.4.1.1, F2003 12.4.1.2, and F2008 12.5.2.4),
- if the actual argument is (a substring of) an element of a
- non-assumed-shape/non-pointer array;
- - (F2003) if the actual argument is of type character. */
+ non-assumed-shape/non-pointer/non-polymorphic array; or
+ - (F2003) if the actual argument is of type character of default/c_char
+ kind. */
+
+ is_pointer = actual->expr_type == EXPR_VARIABLE
+ ? actual->symtree->n.sym->attr.pointer : false;
for (ref = actual->ref; ref; ref = ref->next)
- if (ref->type == REF_ARRAY && ref->u.ar.type == AR_ELEMENT
- && ref->u.ar.dimen > 0)
- break;
+ {
+ if (ref->type == REF_COMPONENT)
+ is_pointer = ref->u.c.component->attr.pointer;
+ else if (ref->type == REF_ARRAY && ref->u.ar.type == AR_ELEMENT
+ && ref->u.ar.dimen > 0
+ && (!ref->next
+ || (ref->next->type == REF_SUBSTRING && !ref->next->next)))
+ break;
+ }
- /* Not an array element. */
- if (formal->ts.type == BT_CHARACTER
- && (ref == NULL
- || (actual->expr_type == EXPR_VARIABLE
- && (actual->symtree->n.sym->as->type == AS_ASSUMED_SHAPE
- || actual->symtree->n.sym->attr.pointer))))
+ if (actual->ts.type == BT_CLASS && actual->expr_type != EXPR_NULL)
{
+ if (where)
+ gfc_error ("Polymorphic scalar passed to array dummy argument '%s' "
+ "at %L", formal->name, &actual->where);
+ return 0;
+ }
+
+ if (actual->expr_type != EXPR_NULL && ref && actual->ts.type != BT_CHARACTER
+ && (is_pointer || ref->u.ar.as->type == AS_ASSUMED_SHAPE))
+ {
+ if (where)
+ gfc_error ("Element of assumed-shaped or pointer "
+ "array passed to array dummy argument '%s' at %L",
+ formal->name, &actual->where);
+ return 0;
+ }
+
+ if (actual->ts.type == BT_CHARACTER && actual->expr_type != EXPR_NULL
+ && (!ref || is_pointer || ref->u.ar.as->type == AS_ASSUMED_SHAPE))
+ {
+ if (formal->ts.kind != 1 && (gfc_option.allow_std & GFC_STD_GNU) == 0)
+ {
+ if (where)
+ gfc_error ("Extension: Scalar non-default-kind, non-C_CHAR-kind "
+ "CHARACTER actual argument with array dummy argument "
+ "'%s' at %L", formal->name, &actual->where);
+ return 0;
+ }
+
if (where && (gfc_option.allow_std & GFC_STD_F2003) == 0)
{
gfc_error ("Fortran 2003: Scalar CHARACTER actual argument with "
@@ -1700,7 +1734,8 @@ compare_parameter (gfc_symbol *formal, gfc_expr *actual,
else
return 1;
}
- else if (ref == NULL && actual->expr_type != EXPR_NULL)
+
+ if (ref == NULL && actual->expr_type != EXPR_NULL)
{
if (where)
argument_rank_mismatch (formal->name, &actual->where,
@@ -1708,17 +1743,6 @@ compare_parameter (gfc_symbol *formal, gfc_expr *actual,
return 0;
}
- if (actual->expr_type == EXPR_VARIABLE
- && actual->symtree->n.sym->as
- && (actual->symtree->n.sym->as->type == AS_ASSUMED_SHAPE
- || actual->symtree->n.sym->attr.pointer))
- {
- if (where)
- gfc_error ("Element of assumed-shaped array passed to dummy "
- "argument '%s' at %L", formal->name, &actual->where);
- return 0;
- }
-
return 1;
}
@@ -1886,7 +1910,7 @@ get_expr_storage_size (gfc_expr *e)
else if (ref->type == REF_ARRAY && ref->u.ar.type == AR_ELEMENT
&& e->expr_type == EXPR_VARIABLE)
{
- if (e->symtree->n.sym->as->type == AS_ASSUMED_SHAPE
+ if (ref->u.ar.as->type == AS_ASSUMED_SHAPE
|| e->symtree->n.sym->attr.pointer)
{
elements = 1;
@@ -1915,8 +1939,6 @@ get_expr_storage_size (gfc_expr *e)
- mpz_get_si (ref->u.ar.as->lower[i]->value.integer));
}
}
- else
- return 0;
}
if (substrlen)
@@ -2092,22 +2114,34 @@ compare_actual_formal (gfc_actual_arglist **ap, gfc_formal_arglist *formal,
return 0;
}
+ if ((f->sym->attr.pointer || f->sym->attr.allocatable)
+ && f->sym->ts.deferred != a->expr->ts.deferred
+ && a->expr->ts.type == BT_CHARACTER)
+ {
+ if (where)
+ gfc_error ("Actual argument argument at %L to allocatable or "
+ "pointer dummy argument '%s' must have a deferred "
+ "length type parameter if and only if the dummy has one",
+ &a->expr->where, f->sym->name);
+ return 0;
+ }
+
actual_size = get_expr_storage_size (a->expr);
formal_size = get_sym_storage_size (f->sym);
- if (actual_size != 0
- && actual_size < formal_size
- && a->expr->ts.type != BT_PROCEDURE)
+ if (actual_size != 0 && actual_size < formal_size
+ && a->expr->ts.type != BT_PROCEDURE
+ && f->sym->attr.flavor != FL_PROCEDURE)
{
if (a->expr->ts.type == BT_CHARACTER && !f->sym->as && where)
gfc_warning ("Character length of actual argument shorter "
- "than of dummy argument '%s' (%lu/%lu) at %L",
- f->sym->name, actual_size, formal_size,
- &a->expr->where);
+ "than of dummy argument '%s' (%lu/%lu) at %L",
+ f->sym->name, actual_size, formal_size,
+ &a->expr->where);
else if (where)
gfc_warning ("Actual argument contains too few "
- "elements for dummy argument '%s' (%lu/%lu) at %L",
- f->sym->name, actual_size, formal_size,
- &a->expr->where);
+ "elements for dummy argument '%s' (%lu/%lu) at %L",
+ f->sym->name, actual_size, formal_size,
+ &a->expr->where);
return 0;
}
@@ -2673,6 +2707,30 @@ gfc_procedure_use (gfc_symbol *sym, gfc_actual_arglist **ap, locus *where)
if (sym->attr.if_source == IFSRC_UNKNOWN)
{
gfc_actual_arglist *a;
+
+ if (sym->attr.pointer)
+ {
+ gfc_error("The pointer object '%s' at %L must have an explicit "
+ "function interface or be declared as array",
+ sym->name, where);
+ return;
+ }
+
+ if (sym->attr.allocatable && !sym->attr.external)
+ {
+ gfc_error("The allocatable object '%s' at %L must have an explicit "
+ "function interface or be declared as array",
+ sym->name, where);
+ return;
+ }
+
+ if (sym->attr.allocatable)
+ {
+ gfc_error("Allocatable function '%s' at %L must have an explicit "
+ "function interface", sym->name, where);
+ return;
+ }
+
for (a = *ap; a; a = a->next)
{
/* Skip g77 keyword extensions like %VAL, %REF, %LOC. */
@@ -2866,7 +2924,11 @@ matching_typebound_op (gfc_expr** tb_base,
gfc_try result;
if (base->expr->ts.type == BT_CLASS)
- derived = CLASS_DATA (base->expr)->ts.u.derived;
+ {
+ if (!gfc_expr_attr (base->expr).class_ok)
+ continue;
+ derived = CLASS_DATA (base->expr)->ts.u.derived;
+ }
else
derived = base->expr->ts.u.derived;
diff --git a/gcc/fortran/intrinsic.c b/gcc/fortran/intrinsic.c
index 9458ca948f1..80dbaa8dd4a 100644
--- a/gcc/fortran/intrinsic.c
+++ b/gcc/fortran/intrinsic.c
@@ -2541,9 +2541,10 @@ add_functions (void)
make_generic ("set_exponent", GFC_ISYM_SET_EXPONENT, GFC_STD_F95);
- add_sym_1 ("shape", GFC_ISYM_SHAPE, CLASS_INQUIRY, ACTUAL_NO, BT_INTEGER, di, GFC_STD_F95,
+ add_sym_2 ("shape", GFC_ISYM_SHAPE, CLASS_INQUIRY, ACTUAL_NO, BT_INTEGER, di, GFC_STD_F95,
gfc_check_shape, gfc_simplify_shape, gfc_resolve_shape,
- src, BT_REAL, dr, REQUIRED);
+ src, BT_REAL, dr, REQUIRED,
+ kind, BT_INTEGER, di, OPTIONAL);
make_generic ("shape", GFC_ISYM_SHAPE, GFC_STD_F95);
diff --git a/gcc/fortran/intrinsic.h b/gcc/fortran/intrinsic.h
index 540cc8ebbf7..033bae0f68c 100644
--- a/gcc/fortran/intrinsic.h
+++ b/gcc/fortran/intrinsic.h
@@ -135,7 +135,7 @@ gfc_try gfc_check_selected_char_kind (gfc_expr *);
gfc_try gfc_check_selected_int_kind (gfc_expr *);
gfc_try gfc_check_selected_real_kind (gfc_expr *, gfc_expr *, gfc_expr *);
gfc_try gfc_check_set_exponent (gfc_expr *, gfc_expr *);
-gfc_try gfc_check_shape (gfc_expr *);
+gfc_try gfc_check_shape (gfc_expr *, gfc_expr *);
gfc_try gfc_check_shift (gfc_expr *, gfc_expr *);
gfc_try gfc_check_size (gfc_expr *, gfc_expr *, gfc_expr *);
gfc_try gfc_check_sign (gfc_expr *, gfc_expr *);
@@ -360,7 +360,7 @@ gfc_expr *gfc_simplify_selected_int_kind (gfc_expr *);
gfc_expr *gfc_simplify_selected_real_kind (gfc_expr *, gfc_expr *, gfc_expr *);
gfc_expr *gfc_simplify_set_exponent (gfc_expr *, gfc_expr *);
gfc_expr *gfc_simplify_sign (gfc_expr *, gfc_expr *);
-gfc_expr *gfc_simplify_shape (gfc_expr *);
+gfc_expr *gfc_simplify_shape (gfc_expr *, gfc_expr *);
gfc_expr *gfc_simplify_shifta (gfc_expr *, gfc_expr *);
gfc_expr *gfc_simplify_shiftl (gfc_expr *, gfc_expr *);
gfc_expr *gfc_simplify_shiftr (gfc_expr *, gfc_expr *);
@@ -531,7 +531,7 @@ void gfc_resolve_scan (gfc_expr *, gfc_expr *, gfc_expr *, gfc_expr *,
void gfc_resolve_second_sub (gfc_code *);
void gfc_resolve_secnds (gfc_expr *, gfc_expr *);
void gfc_resolve_set_exponent (gfc_expr *, gfc_expr *, gfc_expr *);
-void gfc_resolve_shape (gfc_expr *, gfc_expr *);
+void gfc_resolve_shape (gfc_expr *, gfc_expr *, gfc_expr *);
void gfc_resolve_shift (gfc_expr *, gfc_expr *, gfc_expr *);
void gfc_resolve_sign (gfc_expr *, gfc_expr *, gfc_expr *);
void gfc_resolve_signal (gfc_expr *, gfc_expr *, gfc_expr *);
diff --git a/gcc/fortran/intrinsic.texi b/gcc/fortran/intrinsic.texi
index 49f1b6ebc40..312956aeea9 100644
--- a/gcc/fortran/intrinsic.texi
+++ b/gcc/fortran/intrinsic.texi
@@ -992,7 +992,10 @@ scalar entities are available in Fortran 2003 and later.
Inquiry function
@item @emph{Syntax}:
-@code{RESULT = ALLOCATED(ARRAY)} or @code{RESULT = ALLOCATED(SCALAR)}
+@multitable @columnfractions .80
+@item @code{RESULT = ALLOCATED(ARRAY)}
+@item @code{RESULT = ALLOCATED(SCALAR)}
+@end multitable
@item @emph{Arguments}:
@multitable @columnfractions .15 .70
@@ -1395,8 +1398,10 @@ Fortran 2008 or later
Elemental function
@item @emph{Syntax}:
-@code{RESULT = ATAN(X)}
-@code{RESULT = ATAN(Y, X)}
+@multitable @columnfractions .80
+@item @code{RESULT = ATAN(X)}
+@item @code{RESULT = ATAN(Y, X)}
+@end multitable
@item @emph{Arguments}:
@multitable @columnfractions .15 .70
@@ -1666,8 +1671,10 @@ Elemental function, except for the transformational function
@code{BESSEL_JN(N1, N2, X)}
@item @emph{Syntax}:
-@code{RESULT = BESSEL_JN(N, X)}
-@code{RESULT = BESSEL_JN(N1, N2, X)}
+@multitable @columnfractions .80
+@item @code{RESULT = BESSEL_JN(N, X)}
+@item @code{RESULT = BESSEL_JN(N1, N2, X)}
+@end multitable
@item @emph{Arguments}:
@multitable @columnfractions .15 .70
@@ -1826,8 +1833,10 @@ Elemental function, except for the transformational function
@code{BESSEL_YN(N1, N2, X)}
@item @emph{Syntax}:
-@code{RESULT = BESSEL_YN(N, X)}
-@code{RESULT = BESSEL_YN(N1, N2, X)}
+@multitable @columnfractions .80
+@item @code{RESULT = BESSEL_YN(N, X)}
+@item @code{RESULT = BESSEL_YN(N1, N2, X)}
+@end multitable
@item @emph{Arguments}:
@multitable @columnfractions .15 .70
@@ -2686,7 +2695,7 @@ end program test_cmplx
@table @asis
@item @emph{Description}:
-@code{COMMAND_ARGUMENT_COUNT()} returns the number of arguments passed on the
+@code{COMMAND_ARGUMENT_COUNT} returns the number of arguments passed on the
command line when the containing program was invoked.
@item @emph{Standard}:
@@ -2730,7 +2739,7 @@ end program test_command_argument_count
@table @asis
@item @emph{Description}:
-@code{COMPILER_OPTIONS()} returns a string with the options used for
+@code{COMPILER_OPTIONS} returns a string with the options used for
compiling.
@item @emph{Standard}:
@@ -2773,7 +2782,7 @@ the @code{COMPILER_OPTIONS} intrinsic.
@table @asis
@item @emph{Description}:
-@code{COMPILER_VERSION()} returns a string with the name and the
+@code{COMPILER_VERSION} returns a string with the name and the
version of the compiler.
@item @emph{Standard}:
@@ -3209,7 +3218,7 @@ end program test_cshift
@table @asis
@item @emph{Description}:
@code{CTIME} converts a system time value, such as returned by
-@code{TIME8()}, to a string of the form @samp{Sat Aug 19 18:13:14 1995}.
+@code{TIME8}, to a string of the form @samp{Sat Aug 19 18:13:14 1995}.
This intrinsic is provided in both subroutine and function forms; however,
only one form can be used in any given program unit.
@@ -4151,10 +4160,11 @@ end program test_etime
asynchronously.
The @code{COMMAND} argument is passed to the shell and executed, using
-the C library's @code{system()} call. (The shell is @code{sh} on Unix
-systems, and @code{cmd.exe} on Windows.) If @code{WAIT} is present and
-has the value false, the execution of the command is asynchronous if the
-system supports it; otherwise, the command is executed synchronously.
+the C library's @code{system} call. (The shell is @code{sh} on Unix
+systems, and @code{cmd.exe} on Windows.) If @code{WAIT} is present
+and has the value false, the execution of the command is asynchronous
+if the system supports it; otherwise, the command is executed
+synchronously.
The three last arguments allow the user to get status information. After
synchronous execution, @code{EXITSTAT} contains the integer exit code of
@@ -4162,6 +4172,9 @@ the command, as returned by @code{system}. @code{CMDSTAT} is set to zero
if the command line was executed (whatever its exit status was).
@code{CMDMSG} is assigned an error message if an error has occurred.
+Note that the @code{system} function need not be thread-safe. It is
+the responsibility of the user to ensure that @code{system} is not
+called concurrently.
@item @emph{Standard}:
Fortran 2008 and later
@@ -4201,7 +4214,7 @@ end program test_exec
@item @emph{Note}:
-Because this intrinsic is implemented in terms of the @code{system()}
+Because this intrinsic is implemented in terms of the @code{system}
function call, its behavior with respect to signaling is processor
dependent. In particular, on POSIX-compliant systems, the SIGINT and
SIGQUIT signals will be ignored, and the SIGCHLD will be blocked. As
@@ -4909,7 +4922,7 @@ end program test_fraction
@table @asis
@item @emph{Description}:
-Frees memory previously allocated by @code{MALLOC()}. The @code{FREE}
+Frees memory previously allocated by @code{MALLOC}. The @code{FREE}
intrinsic is an extension intended to be used with Cray pointers, and is
provided in GNU Fortran to allow user to compile legacy code. For
new code using Fortran 95 pointers, the memory de-allocation intrinsic is
@@ -5452,11 +5465,15 @@ END PROGRAM
@item @emph{Description}:
Get the @var{VALUE} of the environmental variable @var{NAME}.
-This intrinsic routine is provided for backwards compatibility with
-GNU Fortran 77. In new code, programmers should consider the use of
+This intrinsic routine is provided for backwards compatibility with
+GNU Fortran 77. In new code, programmers should consider the use of
the @ref{GET_ENVIRONMENT_VARIABLE} intrinsic defined by the Fortran
2003 standard.
+Note that @code{GETENV} need not be thread-safe. It is the
+responsibility of the user to ensure that the environment is not being
+updated concurrently with a call to the @code{GETENV} intrinsic.
+
@item @emph{Standard}:
GNU extension
@@ -5501,6 +5518,11 @@ END PROGRAM
@item @emph{Description}:
Get the @var{VALUE} of the environmental variable @var{NAME}.
+Note that @code{GET_ENVIRONMENT_VARIABLE} need not be thread-safe. It
+is the responsibility of the user to ensure that the environment is
+not being updated concurrently with a call to the
+@code{GET_ENVIRONMENT_VARIABLE} intrinsic.
+
@item @emph{Standard}:
Fortran 2003 and later
@@ -5705,7 +5727,7 @@ See @code{GETPID} for an example.
@table @asis
@item @emph{Description}:
-Given a system time value @var{TIME} (as provided by the @code{TIME8()}
+Given a system time value @var{TIME} (as provided by the @code{TIME8}
intrinsic), fills @var{VALUES} with values extracted from it appropriate
to the UTC time zone (Universal Coordinated Time, also known in some
countries as GMT, Greenwich Mean Time), using @code{gmtime(3)}.
@@ -6096,7 +6118,7 @@ END PROGRAM
@table @asis
@item @emph{Description}:
-@code{IARGC()} returns the number of arguments passed on the
+@code{IARGC} returns the number of arguments passed on the
command line when the containing program was invoked.
This intrinsic routine is provided for backwards compatibility with
@@ -6411,8 +6433,8 @@ the larger argument.)
@table @asis
@item @emph{Description}:
-Returns the last system error number, as given by the C @code{errno()}
-function.
+Returns the last system error number, as given by the C @code{errno}
+variable.
@item @emph{Standard}:
GNU extension
@@ -8067,7 +8089,7 @@ To stat an open file: @ref{FSTAT}, to stat a file: @ref{STAT}
@table @asis
@item @emph{Description}:
-Given a system time value @var{TIME} (as provided by the @code{TIME8()}
+Given a system time value @var{TIME} (as provided by the @code{TIME8}
intrinsic), fills @var{VALUES} with values extracted from it appropriate
to the local time zone using @code{localtime(3)}.
@@ -8546,7 +8568,7 @@ on the UNIX function @code{clock(3)}.
@emph{Warning:} this intrinsic does not increase the range of the timing
values over that returned by @code{clock(3)}. On a system with a 32-bit
-@code{clock(3)}, @code{MCLOCK8()} will return a 32-bit value, even though
+@code{clock(3)}, @code{MCLOCK8} will return a 32-bit value, even though
it is converted to a 64-bit @code{INTEGER(8)} value. That means
overflows of the 32-bit value can still occur. Therefore, the values
returned by this intrinsic might be or become negative or numerically
@@ -10836,26 +10858,29 @@ END PROGRAM
Determines the shape of an array.
@item @emph{Standard}:
-Fortran 95 and later
+Fortran 95 and later, with @var{KIND} argument Fortran 2003 and later
@item @emph{Class}:
Inquiry function
@item @emph{Syntax}:
-@code{RESULT = SHAPE(SOURCE)}
+@code{RESULT = SHAPE(SOURCE [, KIND])}
@item @emph{Arguments}:
@multitable @columnfractions .15 .70
@item @var{SOURCE} @tab Shall be an array or scalar of any type.
If @var{SOURCE} is a pointer it must be associated and allocatable
arrays must be allocated.
+@item @var{KIND} @tab (Optional) An @code{INTEGER} initialization
+expression indicating the kind parameter of the result.
@end multitable
@item @emph{Return value}:
An @code{INTEGER} array of rank one with as many elements as @var{SOURCE}
has dimensions. The elements of the resulting array correspond to the extend
of @var{SOURCE} along the respective dimensions. If @var{SOURCE} is a scalar,
-the result is the rank one array of size zero.
+the result is the rank one array of size zero. If @var{KIND} is absent, the
+return value has the default integer kind otherwise the specified kind.
@item @emph{Example}:
@smallexample
@@ -11776,6 +11801,10 @@ and environment-dependent.
This intrinsic is provided in both subroutine and function forms;
however, only one form can be used in any given program unit.
+Note that the @code{system} function need not be thread-safe. It is
+the responsibility of the user to ensure that @code{system} is not
+called concurrently.
+
@item @emph{Standard}:
GNU extension
@@ -11809,14 +11838,29 @@ and should considered in new code for future portability.
@table @asis
@item @emph{Description}:
-Determines the @var{COUNT} of milliseconds of wall clock time since
-the Epoch (00:00:00 UTC, January 1, 1970) modulo @var{COUNT_MAX},
-@var{COUNT_RATE} determines the number of clock ticks per second.
-@var{COUNT_RATE} and @var{COUNT_MAX} are constant and specific to
-@command{gfortran}.
+Determines the @var{COUNT} of a processor clock since an unspecified
+time in the past modulo @var{COUNT_MAX}, @var{COUNT_RATE} determines
+the number of clock ticks per second. If the platform supports a high
+resolution monotonic clock, that clock is used and can provide up to
+nanosecond resolution. If a high resolution monotonic clock is not
+available, the implementation falls back to a potentially lower
+resolution realtime clock.
+
+@var{COUNT_RATE} and @var{COUNT_MAX} vary depending on the kind of the
+arguments. For @var{kind=8} arguments, @var{COUNT} represents
+nanoseconds, and for @var{kind=4} arguments, @var{COUNT} represents
+milliseconds. Other than the kind dependency, @var{COUNT_RATE} and
+@var{COUNT_MAX} are constant, however the particular values are
+specific to @command{gfortran}.
If there is no clock, @var{COUNT} is set to @code{-HUGE(COUNT)}, and
-@var{COUNT_RATE} and @var{COUNT_MAX} are set to zero
+@var{COUNT_RATE} and @var{COUNT_MAX} are set to zero.
+
+When running on a platform using the GNU C library (glibc), or a
+derivative thereof, the high resolution monotonic clock is available
+only when linking with the @var{rt} library. This can be done
+explicitly by adding the @code{-lrt} flag when linking the
+application, but is also done implicitly when using OpenMP.
@item @emph{Standard}:
Fortran 95 and later
@@ -11829,11 +11873,11 @@ Subroutine
@item @emph{Arguments}:
@multitable @columnfractions .15 .70
-@item @var{COUNT} @tab (Optional) shall be a scalar of type default
+@item @var{COUNT} @tab (Optional) shall be a scalar of type
@code{INTEGER} with @code{INTENT(OUT)}.
-@item @var{COUNT_RATE} @tab (Optional) shall be a scalar of type default
+@item @var{COUNT_RATE} @tab (Optional) shall be a scalar of type
@code{INTEGER} with @code{INTENT(OUT)}.
-@item @var{COUNT_MAX} @tab (Optional) shall be a scalar of type default
+@item @var{COUNT_MAX} @tab (Optional) shall be a scalar of type
@code{INTEGER} with @code{INTENT(OUT)}.
@end multitable
@@ -12022,7 +12066,7 @@ END IF
@item @emph{Description}:
Returns the current time encoded as an integer (in the manner of the
UNIX function @code{time(3)}). This value is suitable for passing to
-@code{CTIME()}, @code{GMTIME()}, and @code{LTIME()}.
+@code{CTIME}, @code{GMTIME}, and @code{LTIME}.
This intrinsic is not fully portable, such as to systems with 32-bit
@code{INTEGER} types but supporting times wider than 32 bits. Therefore,
@@ -12063,11 +12107,11 @@ The return value is a scalar of type @code{INTEGER(4)}.
@item @emph{Description}:
Returns the current time encoded as an integer (in the manner of the
UNIX function @code{time(3)}). This value is suitable for passing to
-@code{CTIME()}, @code{GMTIME()}, and @code{LTIME()}.
+@code{CTIME}, @code{GMTIME}, and @code{LTIME}.
@emph{Warning:} this intrinsic does not increase the range of the timing
values over that returned by @code{time(3)}. On a system with a 32-bit
-@code{time(3)}, @code{TIME8()} will return a 32-bit value, even though
+@code{time(3)}, @code{TIME8} will return a 32-bit value, even though
it is converted to a 64-bit @code{INTEGER(8)} value. That means
overflows of the 32-bit value can still occur. Therefore, the values
returned by this intrinsic might be or become negative or numerically
diff --git a/gcc/fortran/io.c b/gcc/fortran/io.c
index b8a6a4a3075..3ce7e816b9a 100644
--- a/gcc/fortran/io.c
+++ b/gcc/fortran/io.c
@@ -3091,7 +3091,8 @@ match_io_element (io_kind k, gfc_code **cpp)
cp = gfc_get_code ();
cp->op = EXEC_TRANSFER;
cp->expr1 = expr;
- cp->ext.dt = current_dt;
+ if (k != M_INQUIRE)
+ cp->ext.dt = current_dt;
*cpp = cp;
return MATCH_YES;
diff --git a/gcc/fortran/iresolve.c b/gcc/fortran/iresolve.c
index 12854fbf638..d8309d27f85 100644
--- a/gcc/fortran/iresolve.c
+++ b/gcc/fortran/iresolve.c
@@ -35,6 +35,7 @@ along with GCC; see the file COPYING3. If not see
#include "gfortran.h"
#include "intrinsic.h"
#include "constructor.h"
+#include "arith.h"
/* Given printf-like arguments, return a stable version of the result string.
@@ -2044,11 +2045,31 @@ gfc_resolve_rename (gfc_expr *f, gfc_expr *p1 ATTRIBUTE_UNUSED,
void
gfc_resolve_repeat (gfc_expr *f, gfc_expr *string,
- gfc_expr *ncopies ATTRIBUTE_UNUSED)
+ gfc_expr *ncopies)
{
+ int len;
+ gfc_expr *tmp;
f->ts.type = BT_CHARACTER;
f->ts.kind = string->ts.kind;
f->value.function.name = gfc_get_string ("__repeat_%d", string->ts.kind);
+
+ /* If possible, generate a character length. */
+ if (f->ts.u.cl == NULL)
+ f->ts.u.cl = gfc_new_charlen (gfc_current_ns, NULL);
+
+ tmp = NULL;
+ if (string->expr_type == EXPR_CONSTANT)
+ {
+ len = string->value.character.length;
+ tmp = gfc_get_int_expr (gfc_default_integer_kind, NULL , len);
+ }
+ else if (string->ts.u.cl && string->ts.u.cl->length)
+ {
+ tmp = gfc_copy_expr (string->ts.u.cl->length);
+ }
+
+ if (tmp)
+ f->ts.u.cl->length = gfc_multiply (tmp, gfc_copy_expr (ncopies));
}
@@ -2185,10 +2206,15 @@ gfc_resolve_set_exponent (gfc_expr *f, gfc_expr *x,
void
-gfc_resolve_shape (gfc_expr *f, gfc_expr *array)
+gfc_resolve_shape (gfc_expr *f, gfc_expr *array, gfc_expr *kind)
{
f->ts.type = BT_INTEGER;
- f->ts.kind = gfc_default_integer_kind;
+
+ if (kind)
+ f->ts.kind = mpz_get_si (kind->value.integer);
+ else
+ f->ts.kind = gfc_default_integer_kind;
+
f->rank = 1;
f->shape = gfc_get_shape (1);
mpz_init_set_ui (f->shape[0], array->rank);
diff --git a/gcc/fortran/match.c b/gcc/fortran/match.c
index 70f58625463..d2d9f5f934b 100644
--- a/gcc/fortran/match.c
+++ b/gcc/fortran/match.c
@@ -3134,10 +3134,11 @@ alloc_opt_list:
}
/* Check F03:C623, */
- if (saw_deferred && ts.type == BT_UNKNOWN && !source)
+ if (saw_deferred && ts.type == BT_UNKNOWN && !source && !mold)
{
gfc_error ("Allocate-object at %L with a deferred type parameter "
- "requires either a type-spec or SOURCE tag", &deferred_locus);
+ "requires either a type-spec or SOURCE tag or a MOLD tag",
+ &deferred_locus);
goto cleanup;
}
@@ -4030,13 +4031,6 @@ gfc_match_namelist (void)
gfc_error_check ();
}
- if (sym->ts.type == BT_CHARACTER && sym->ts.u.cl->length == NULL)
- {
- gfc_error ("Assumed character length '%s' in namelist '%s' at "
- "%C is not allowed", sym->name, group_name->name);
- gfc_error_check ();
- }
-
nl = gfc_get_namelist ();
nl->sym = sym;
sym->refs++;
@@ -4542,11 +4536,8 @@ select_type_set_tmp (gfc_typespec *ts)
gfc_add_pointer (&tmp->n.sym->attr, NULL);
gfc_add_flavor (&tmp->n.sym->attr, FL_VARIABLE, name, NULL);
if (ts->type == BT_CLASS)
- {
- gfc_build_class_symbol (&tmp->n.sym->ts, &tmp->n.sym->attr,
- &tmp->n.sym->as, false);
- tmp->n.sym->attr.class_ok = 1;
- }
+ gfc_build_class_symbol (&tmp->n.sym->ts, &tmp->n.sym->attr,
+ &tmp->n.sym->as, false);
tmp->n.sym->attr.select_type_temporary = 1;
/* Add an association for it, so the rest of the parser knows it is
diff --git a/gcc/fortran/module.c b/gcc/fortran/module.c
index 8de19273f34..6f1520c0205 100644
--- a/gcc/fortran/module.c
+++ b/gcc/fortran/module.c
@@ -2138,6 +2138,20 @@ mio_typespec (gfc_typespec *ts)
else
mio_charlen (&ts->u.cl);
+ /* So as not to disturb the existing API, use an ATOM_NAME to
+ transmit deferred characteristic for characters (F2003). */
+ if (iomode == IO_OUTPUT)
+ {
+ if (ts->type == BT_CHARACTER && ts->deferred)
+ write_atom (ATOM_NAME, "DEFERRED_CL");
+ }
+ else if (peek_atom () != ATOM_RPAREN)
+ {
+ if (parse_atom () != ATOM_NAME)
+ bad_module ("Expected string");
+ ts->deferred = 1;
+ }
+
mio_rparen ();
}
@@ -4205,9 +4219,23 @@ read_cleanup (pointer_info *p)
if (p->type == P_SYMBOL && p->u.rsym.state == USED && !p->u.rsym.referenced)
{
+ gfc_namespace *ns;
/* Add hidden symbols to the symtree. */
q = get_integer (p->u.rsym.ns);
- st = gfc_get_unique_symtree ((gfc_namespace *) q->u.pointer);
+ ns = (gfc_namespace *) q->u.pointer;
+
+ if (!p->u.rsym.sym->attr.vtype
+ && !p->u.rsym.sym->attr.vtab)
+ st = gfc_get_unique_symtree (ns);
+ else
+ {
+ /* There is no reason to use 'unique_symtrees' for vtabs or
+ vtypes - their name is fine for a symtree and reduces the
+ namespace pollution. */
+ st = gfc_find_symtree (ns->sym_root, p->u.rsym.sym->name);
+ if (!st)
+ st = gfc_new_symtree (&ns->sym_root, p->u.rsym.sym->name);
+ }
st->n.sym = p->u.rsym.sym;
st->n.sym->refs++;
@@ -4564,8 +4592,8 @@ read_module (void)
PRIVATE, then private, and otherwise it is public unless the default
access in this context has been declared PRIVATE. */
-bool
-gfc_check_access (gfc_access specific_access, gfc_access default_access)
+static bool
+check_access (gfc_access specific_access, gfc_access default_access)
{
if (specific_access == ACCESS_PUBLIC)
return TRUE;
@@ -4579,6 +4607,16 @@ gfc_check_access (gfc_access specific_access, gfc_access default_access)
}
+bool
+gfc_check_symbol_access (gfc_symbol *sym)
+{
+ if (sym->attr.vtab || sym->attr.vtype)
+ return true;
+ else
+ return check_access (sym->attr.access, sym->ns->default_access);
+}
+
+
/* A structure to remember which commons we've already written. */
struct written_common
@@ -4764,8 +4802,7 @@ write_equiv (void)
static void
write_dt_extensions (gfc_symtree *st)
{
- if (!gfc_check_access (st->n.sym->attr.access,
- st->n.sym->ns->default_access))
+ if (!gfc_check_symbol_access (st->n.sym))
return;
mio_lparen ();
@@ -4846,7 +4883,7 @@ write_symbol0 (gfc_symtree *st)
&& !sym->attr.subroutine && !sym->attr.function)
dont_write = true;
- if (!gfc_check_access (sym->attr.access, sym->ns->default_access))
+ if (!gfc_check_symbol_access (sym))
dont_write = true;
if (!dont_write)
@@ -4903,8 +4940,7 @@ write_operator (gfc_user_op *uop)
static char nullstring[] = "";
const char *p = nullstring;
- if (uop->op == NULL
- || !gfc_check_access (uop->access, uop->ns->default_access))
+ if (uop->op == NULL || !check_access (uop->access, uop->ns->default_access))
return;
mio_symbol_interface (&uop->name, &p, &uop->op);
@@ -4928,8 +4964,7 @@ write_generic (gfc_symtree *st)
if (!sym || check_unique_name (st->name))
return;
- if (sym->generic == NULL
- || !gfc_check_access (sym->attr.access, sym->ns->default_access))
+ if (sym->generic == NULL || !gfc_check_symbol_access (sym))
return;
if (sym->module == NULL)
@@ -4954,7 +4989,7 @@ write_symtree (gfc_symtree *st)
&& sym->ns->proc_name->attr.if_source == IFSRC_IFBODY)
return;
- if (!gfc_check_access (sym->attr.access, sym->ns->default_access)
+ if (!gfc_check_symbol_access (sym)
|| (sym->attr.flavor == FL_PROCEDURE && sym->attr.generic
&& !sym->attr.subroutine && !sym->attr.function))
return;
@@ -4985,8 +5020,8 @@ write_module (void)
if (i == INTRINSIC_USER)
continue;
- mio_interface (gfc_check_access (gfc_current_ns->operator_access[i],
- gfc_current_ns->default_access)
+ mio_interface (check_access (gfc_current_ns->operator_access[i],
+ gfc_current_ns->default_access)
? &gfc_current_ns->op[i] : NULL);
}
diff --git a/gcc/fortran/options.c b/gcc/fortran/options.c
index 1f1cdd111d6..c11610360b2 100644
--- a/gcc/fortran/options.c
+++ b/gcc/fortran/options.c
@@ -463,9 +463,10 @@ gfc_handle_module_path_options (const char *arg)
gfc_option.module_dir = (char *) gfc_getmem (strlen (arg) + 2);
strcpy (gfc_option.module_dir, arg);
- strcat (gfc_option.module_dir, "/");
gfc_add_include_path (gfc_option.module_dir, true, false);
+
+ strcat (gfc_option.module_dir, "/");
}
diff --git a/gcc/fortran/parse.c b/gcc/fortran/parse.c
index b51e12bee46..7fc3dca43be 100644
--- a/gcc/fortran/parse.c
+++ b/gcc/fortran/parse.c
@@ -3154,6 +3154,7 @@ gfc_build_block_ns (gfc_namespace *parent_ns)
t = gfc_add_flavor (&my_ns->proc_name->attr, FL_LABEL,
my_ns->proc_name->name, NULL);
gcc_assert (t == SUCCESS);
+ gfc_commit_symbol (my_ns->proc_name);
}
if (parent_ns->proc_name)
diff --git a/gcc/fortran/primary.c b/gcc/fortran/primary.c
index ed85398357a..4cda7a183d8 100644
--- a/gcc/fortran/primary.c
+++ b/gcc/fortran/primary.c
@@ -1770,8 +1770,8 @@ gfc_match_varspec (gfc_expr *primary, int equiv_flag, bool sub_flag,
if ((equiv_flag && gfc_peek_ascii_char () == '(')
|| gfc_peek_ascii_char () == '[' || sym->attr.codimension
- || (sym->attr.dimension && !sym->attr.proc_pointer
- && !gfc_is_proc_ptr_comp (primary, NULL)
+ || (sym->attr.dimension && sym->ts.type != BT_CLASS
+ && !sym->attr.proc_pointer && !gfc_is_proc_ptr_comp (primary, NULL)
&& !(gfc_matching_procptr_assignment
&& sym->attr.flavor == FL_PROCEDURE))
|| (sym->ts.type == BT_CLASS && sym->attr.class_ok
@@ -1843,7 +1843,10 @@ gfc_match_varspec (gfc_expr *primary, int equiv_flag, bool sub_flag,
return MATCH_ERROR;
gcc_assert (!tail || !tail->next);
- gcc_assert (primary->expr_type == EXPR_VARIABLE);
+ gcc_assert (primary->expr_type == EXPR_VARIABLE
+ || (primary->expr_type == EXPR_STRUCTURE
+ && primary->symtree && primary->symtree->n.sym
+ && primary->symtree->n.sym->attr.flavor));
if (tbp->n.tb->is_generic)
tbp_sym = NULL;
@@ -2030,7 +2033,7 @@ gfc_variable_attr (gfc_expr *expr, gfc_typespec *ts)
sym = expr->symtree->n.sym;
attr = sym->attr;
- if (sym->ts.type == BT_CLASS)
+ if (sym->ts.type == BT_CLASS && sym->attr.class_ok)
{
dimension = CLASS_DATA (sym)->attr.dimension;
pointer = CLASS_DATA (sym)->attr.class_pointer;
@@ -2307,6 +2310,12 @@ gfc_match_structure_constructor (gfc_symbol *sym, gfc_expr **result,
{
gfc_component *this_comp = NULL;
+ if (comp == sym->components && sym->attr.extension
+ && comp->ts.type == BT_DERIVED
+ && comp->ts.u.derived->attr.zero_comp)
+ /* Skip empty parents. */
+ comp = comp->next;
+
if (!comp_head)
comp_tail = comp_head = gfc_get_structure_ctor_component ();
else
diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c
index f2e722320dd..1fef22b2469 100644
--- a/gcc/fortran/resolve.c
+++ b/gcc/fortran/resolve.c
@@ -160,7 +160,10 @@ resolve_procedure_interface (gfc_symbol *sym)
resolve_intrinsic (ifc, &ifc->declared_at);
if (ifc->result)
- sym->ts = ifc->result->ts;
+ {
+ sym->ts = ifc->result->ts;
+ sym->result = sym;
+ }
else
sym->ts = ifc->ts;
sym->ts.interface = ifc;
@@ -339,14 +342,30 @@ resolve_formal_arglist (gfc_symbol *proc)
&& sym->attr.flavor != FL_PROCEDURE)
{
if (proc->attr.function && sym->attr.intent != INTENT_IN)
- gfc_error ("Argument '%s' of pure function '%s' at %L must be "
- "INTENT(IN)", sym->name, proc->name,
- &sym->declared_at);
+ {
+ if (sym->attr.value)
+ gfc_notify_std (GFC_STD_F2008, "Fortran 2008: Argument '%s' "
+ "of pure function '%s' at %L with VALUE "
+ "attribute but without INTENT(IN)", sym->name,
+ proc->name, &sym->declared_at);
+ else
+ gfc_error ("Argument '%s' of pure function '%s' at %L must be "
+ "INTENT(IN) or VALUE", sym->name, proc->name,
+ &sym->declared_at);
+ }
if (proc->attr.subroutine && sym->attr.intent == INTENT_UNKNOWN)
- gfc_error ("Argument '%s' of pure subroutine '%s' at %L must "
- "have its INTENT specified", sym->name, proc->name,
- &sym->declared_at);
+ {
+ if (sym->attr.value)
+ gfc_notify_std (GFC_STD_F2008, "Fortran 2008: Argument '%s' "
+ "of pure subroutine '%s' at %L with VALUE "
+ "attribute but without INTENT", sym->name,
+ proc->name, &sym->declared_at);
+ else
+ gfc_error ("Argument '%s' of pure subroutine '%s' at %L must "
+ "have its INTENT specified or have the VALUE "
+ "attribute", sym->name, proc->name, &sym->declared_at);
+ }
}
if (proc->attr.implicit_pure && !sym->attr.pointer
@@ -500,7 +519,7 @@ resolve_contained_fntype (gfc_symbol *sym, gfc_namespace *ns)
if (sym->result->ts.type == BT_CHARACTER)
{
gfc_charlen *cl = sym->result->ts.u.cl;
- if (!cl || !cl->length)
+ if ((!cl || !cl->length) && !sym->result->ts.deferred)
{
/* See if this is a module-procedure and adapt error message
accordingly. */
@@ -2699,6 +2718,9 @@ gfc_iso_c_func_interface (gfc_symbol *sym, gfc_actual_arglist *args,
}
else if (sym->intmod_sym_id == ISOCBINDING_LOC)
{
+ gfc_ref *ref;
+ bool seen_section;
+
/* Make sure we have either the target or pointer attribute. */
if (!arg_attr.target && !arg_attr.pointer)
{
@@ -2709,6 +2731,45 @@ gfc_iso_c_func_interface (gfc_symbol *sym, gfc_actual_arglist *args,
retval = FAILURE;
}
+ if (gfc_is_coindexed (args->expr))
+ {
+ gfc_error_now ("Coindexed argument not permitted"
+ " in '%s' call at %L", name,
+ &(args->expr->where));
+ retval = FAILURE;
+ }
+
+ /* Follow references to make sure there are no array
+ sections. */
+ seen_section = false;
+
+ for (ref=args->expr->ref; ref; ref = ref->next)
+ {
+ if (ref->type == REF_ARRAY)
+ {
+ if (ref->u.ar.type == AR_SECTION)
+ seen_section = true;
+
+ if (ref->u.ar.type != AR_ELEMENT)
+ {
+ gfc_ref *r;
+ for (r = ref->next; r; r=r->next)
+ if (r->type == REF_COMPONENT)
+ {
+ gfc_error_now ("Array section not permitted"
+ " in '%s' call at %L", name,
+ &(args->expr->where));
+ retval = FAILURE;
+ break;
+ }
+ }
+ }
+ }
+
+ if (seen_section && retval == SUCCESS)
+ gfc_warning ("Array section in '%s' call at %L", name,
+ &(args->expr->where));
+
/* See if we have interoperable type and type param. */
if (verify_c_interop (arg_ts) == SUCCESS
|| gfc_check_any_c_kind (arg_ts) == SUCCESS)
@@ -2948,6 +3009,7 @@ resolve_function (gfc_expr *expr)
&& sym->ts.u.cl
&& sym->ts.u.cl->length == NULL
&& !sym->attr.dummy
+ && !sym->ts.deferred
&& expr->value.function.esym == NULL
&& !sym->attr.contained)
{
@@ -5832,14 +5894,12 @@ resolve_typebound_subroutine (gfc_code *code)
/* Deal with typebound operators for CLASS objects. */
expr = code->expr1->value.compcall.base_object;
- if (expr && expr->symtree->n.sym->ts.type == BT_CLASS
- && code->expr1->value.compcall.name)
+ if (expr && expr->ts.type == BT_CLASS && code->expr1->value.compcall.name)
{
/* Since the typebound operators are generic, we have to ensure
that any delays in resolution are corrected and that the vtab
is present. */
- ts = expr->symtree->n.sym->ts;
- declared = ts.u.derived;
+ declared = expr->ts.u.derived;
c = gfc_find_component (declared, "_vptr", true, true);
if (c->ts.u.derived == NULL)
c->ts.u.derived = gfc_find_derived_vtab (declared);
@@ -5850,7 +5910,7 @@ resolve_typebound_subroutine (gfc_code *code)
/* Use the generic name if it is there. */
name = name ? name : code->expr1->value.function.esym->name;
code->expr1->symtree = expr->symtree;
- expr->symtree->n.sym->ts.u.derived = declared;
+ code->expr1->ref = gfc_copy_ref (expr->ref);
gfc_add_vptr_component (code->expr1);
gfc_add_component_ref (code->expr1, name);
code->expr1->value.function.esym = NULL;
@@ -6874,12 +6934,6 @@ check_symbols:
}
success:
- if (e->ts.deferred)
- {
- gfc_error ("Support for entity at %L with deferred type parameter "
- "not yet implemented", &e->where);
- return FAILURE;
- }
return SUCCESS;
failure:
@@ -8037,6 +8091,14 @@ resolve_transfer (gfc_code *code)
return;
}
+ /* F08:C935. */
+ if (ts->u.derived->attr.proc_pointer_comp)
+ {
+ gfc_error ("Data transfer element at %L cannot have "
+ "procedure pointer components", &code->loc);
+ return;
+ }
+
if (ts->u.derived->attr.alloc_comp)
{
gfc_error ("Data transfer element at %L cannot have "
@@ -10025,7 +10087,8 @@ resolve_fl_variable (gfc_symbol *sym, int mp_flag)
/* Reject illegal initializers. */
if (!sym->mark && sym->value)
{
- if (sym->attr.allocatable)
+ if (sym->attr.allocatable || (sym->ts.type == BT_CLASS
+ && CLASS_DATA (sym)->attr.allocatable))
gfc_error ("Allocatable '%s' at %L cannot have an initializer",
sym->name, &sym->declared_at);
else if (sym->attr.external)
@@ -10091,7 +10154,7 @@ resolve_fl_procedure (gfc_symbol *sym, int mp_flag)
the host. */
if (!(sym->ns->parent
&& sym->ns->parent->proc_name->attr.flavor == FL_MODULE)
- && gfc_check_access(sym->attr.access, sym->ns->default_access))
+ && gfc_check_symbol_access (sym))
{
gfc_interface *iface;
@@ -10100,8 +10163,7 @@ resolve_fl_procedure (gfc_symbol *sym, int mp_flag)
if (arg->sym
&& arg->sym->ts.type == BT_DERIVED
&& !arg->sym->ts.u.derived->attr.use_assoc
- && !gfc_check_access (arg->sym->ts.u.derived->attr.access,
- arg->sym->ts.u.derived->ns->default_access)
+ && !gfc_check_symbol_access (arg->sym->ts.u.derived)
&& gfc_notify_std (GFC_STD_F2003, "Fortran 2003: '%s' is of a "
"PRIVATE type and cannot be a dummy argument"
" of '%s', which is PUBLIC at %L",
@@ -10123,8 +10185,7 @@ resolve_fl_procedure (gfc_symbol *sym, int mp_flag)
if (arg->sym
&& arg->sym->ts.type == BT_DERIVED
&& !arg->sym->ts.u.derived->attr.use_assoc
- && !gfc_check_access (arg->sym->ts.u.derived->attr.access,
- arg->sym->ts.u.derived->ns->default_access)
+ && !gfc_check_symbol_access (arg->sym->ts.u.derived)
&& gfc_notify_std (GFC_STD_F2003, "Fortran 2003: Procedure "
"'%s' in PUBLIC interface '%s' at %L "
"takes dummy arguments of '%s' which is "
@@ -10148,8 +10209,7 @@ resolve_fl_procedure (gfc_symbol *sym, int mp_flag)
if (arg->sym
&& arg->sym->ts.type == BT_DERIVED
&& !arg->sym->ts.u.derived->attr.use_assoc
- && !gfc_check_access (arg->sym->ts.u.derived->attr.access,
- arg->sym->ts.u.derived->ns->default_access)
+ && !gfc_check_symbol_access (arg->sym->ts.u.derived)
&& gfc_notify_std (GFC_STD_F2003, "Fortran 2003: Procedure "
"'%s' in PUBLIC interface '%s' at %L "
"takes dummy arguments of '%s' which is "
@@ -10192,6 +10252,14 @@ resolve_fl_procedure (gfc_symbol *sym, int mp_flag)
return FAILURE;
}
+ if (sym->attr.proc == PROC_ST_FUNCTION
+ && (sym->attr.allocatable || sym->attr.pointer))
+ {
+ gfc_error ("Statement function '%s' at %L may not have pointer or "
+ "allocatable attribute", sym->name, &sym->declared_at);
+ return FAILURE;
+ }
+
/* 5.1.1.5 of the Standard: A function name declared with an asterisk
char-len-param shall not be array-valued, pointer-valued, recursive
or pure. ....snip... A character value of * may only be used in the
@@ -10225,8 +10293,11 @@ resolve_fl_procedure (gfc_symbol *sym, int mp_flag)
}
/* Appendix B.2 of the standard. Contained functions give an
- error anyway. Fixed-form is likely to be F77/legacy. */
- if (!sym->attr.contained && gfc_current_form != FORM_FIXED)
+ error anyway. Fixed-form is likely to be F77/legacy. Deferred
+ character length is an F2003 feature. */
+ if (!sym->attr.contained
+ && gfc_current_form != FORM_FIXED
+ && !sym->ts.deferred)
gfc_notify_std (GFC_STD_F95_OBS, "Obsolescent feature: "
"CHARACTER(*) function '%s' at %L",
sym->name, &sym->declared_at);
@@ -11563,7 +11634,8 @@ resolve_fl_derived (gfc_symbol *sym)
return FAILURE;
}
- if (c->ts.type == BT_CHARACTER && !c->attr.proc_pointer)
+ if (c->ts.type == BT_CHARACTER && !c->attr.proc_pointer
+ && !c->ts.deferred)
{
if (c->ts.u.cl->length == NULL
|| (resolve_charlen (c->ts.u.cl) == FAILURE)
@@ -11577,13 +11649,21 @@ resolve_fl_derived (gfc_symbol *sym)
}
}
+ if (c->ts.type == BT_CHARACTER && c->ts.deferred
+ && !c->attr.pointer && !c->attr.allocatable)
+ {
+ gfc_error ("Character component '%s' of '%s' at %L with deferred "
+ "length must be a POINTER or ALLOCATABLE",
+ c->name, sym->name, &c->loc);
+ return FAILURE;
+ }
+
if (c->ts.type == BT_DERIVED
&& sym->component_access != ACCESS_PRIVATE
- && gfc_check_access (sym->attr.access, sym->ns->default_access)
+ && gfc_check_symbol_access (sym)
&& !is_sym_host_assoc (c->ts.u.derived, sym->ns)
&& !c->ts.u.derived->attr.use_assoc
- && !gfc_check_access (c->ts.u.derived->attr.access,
- c->ts.u.derived->ns->default_access)
+ && !gfc_check_symbol_access (c->ts.u.derived)
&& gfc_notify_std (GFC_STD_F2003, "Fortran 2003: the component '%s' "
"is a PRIVATE type and cannot be a component of "
"'%s', which is PUBLIC at %L", c->name,
@@ -11684,53 +11764,76 @@ resolve_fl_namelist (gfc_symbol *sym)
for (nl = sym->namelist; nl; nl = nl->next)
{
- /* Reject namelist arrays of assumed shape. */
+ /* Check again, the check in match only works if NAMELIST comes
+ after the decl. */
+ if (nl->sym->as && nl->sym->as->type == AS_ASSUMED_SIZE)
+ {
+ gfc_error ("Assumed size array '%s' in namelist '%s' at %L is not "
+ "allowed", nl->sym->name, sym->name, &sym->declared_at);
+ return FAILURE;
+ }
+
if (nl->sym->as && nl->sym->as->type == AS_ASSUMED_SHAPE
- && gfc_notify_std (GFC_STD_F2003, "NAMELIST array object '%s' "
- "must not have assumed shape in namelist "
+ && gfc_notify_std (GFC_STD_F2003, "Fortran 2003: NAMELIST array "
+ "object '%s' with assumed shape in namelist "
"'%s' at %L", nl->sym->name, sym->name,
&sym->declared_at) == FAILURE)
- return FAILURE;
+ return FAILURE;
- /* Reject namelist arrays that are not constant shape. */
- if (is_non_constant_shape_array (nl->sym))
- {
- gfc_error ("NAMELIST array object '%s' must have constant "
- "shape in namelist '%s' at %L", nl->sym->name,
- sym->name, &sym->declared_at);
- return FAILURE;
- }
+ if (is_non_constant_shape_array (nl->sym)
+ && gfc_notify_std (GFC_STD_F2003, "Fortran 2003: NAMELIST array "
+ "object '%s' with nonconstant shape in namelist "
+ "'%s' at %L", nl->sym->name, sym->name,
+ &sym->declared_at) == FAILURE)
+ return FAILURE;
- /* Namelist objects cannot have allocatable or pointer components. */
- if (nl->sym->ts.type != BT_DERIVED)
- continue;
+ if (nl->sym->ts.type == BT_CHARACTER
+ && (nl->sym->ts.u.cl->length == NULL
+ || !gfc_is_constant_expr (nl->sym->ts.u.cl->length))
+ && gfc_notify_std (GFC_STD_F2003, "Fortran 2003: NAMELIST object "
+ "'%s' with nonconstant character length in "
+ "namelist '%s' at %L", nl->sym->name, sym->name,
+ &sym->declared_at) == FAILURE)
+ return FAILURE;
- if (nl->sym->ts.u.derived->attr.alloc_comp)
+ /* FIXME: Once UDDTIO is implemented, the following can be
+ removed. */
+ if (nl->sym->ts.type == BT_CLASS)
{
- gfc_error ("NAMELIST object '%s' in namelist '%s' at %L cannot "
- "have ALLOCATABLE components",
- nl->sym->name, sym->name, &sym->declared_at);
+ gfc_error ("NAMELIST object '%s' in namelist '%s' at %L is "
+ "polymorphic and requires a defined input/output "
+ "procedure", nl->sym->name, sym->name, &sym->declared_at);
return FAILURE;
}
- if (nl->sym->ts.u.derived->attr.pointer_comp)
+ if (nl->sym->ts.type == BT_DERIVED
+ && (nl->sym->ts.u.derived->attr.alloc_comp
+ || nl->sym->ts.u.derived->attr.pointer_comp))
{
- gfc_error ("NAMELIST object '%s' in namelist '%s' at %L cannot "
- "have POINTER components",
- nl->sym->name, sym->name, &sym->declared_at);
+ if (gfc_notify_std (GFC_STD_F2003, "Fortran 2003: NAMELIST object "
+ "'%s' in namelist '%s' at %L with ALLOCATABLE "
+ "or POINTER components", nl->sym->name,
+ sym->name, &sym->declared_at) == FAILURE)
+ return FAILURE;
+
+ /* FIXME: Once UDDTIO is implemented, the following can be
+ removed. */
+ gfc_error ("NAMELIST object '%s' in namelist '%s' at %L has "
+ "ALLOCATABLE or POINTER components and thus requires "
+ "a defined input/output procedure", nl->sym->name,
+ sym->name, &sym->declared_at);
return FAILURE;
}
}
/* Reject PRIVATE objects in a PUBLIC namelist. */
- if (gfc_check_access(sym->attr.access, sym->ns->default_access))
+ if (gfc_check_symbol_access (sym))
{
for (nl = sym->namelist; nl; nl = nl->next)
{
if (!nl->sym->attr.use_assoc
&& !is_sym_host_assoc (nl->sym, sym->ns)
- && !gfc_check_access(nl->sym->attr.access,
- nl->sym->ns->default_access))
+ && !gfc_check_symbol_access (nl->sym))
{
gfc_error ("NAMELIST object '%s' was declared PRIVATE and "
"cannot be member of PUBLIC namelist '%s' at %L",
@@ -11751,9 +11854,7 @@ resolve_fl_namelist (gfc_symbol *sym)
/* Types with private components that are defined in the same module. */
if (nl->sym->ts.type == BT_DERIVED
&& !is_sym_host_assoc (nl->sym->ts.u.derived, sym->ns)
- && !gfc_check_access (nl->sym->ts.u.derived->attr.private_comp
- ? ACCESS_PRIVATE : ACCESS_UNKNOWN,
- nl->sym->ns->default_access))
+ && nl->sym->ts.u.derived->attr.private_comp)
{
gfc_error ("NAMELIST object '%s' has PRIVATE components and "
"cannot be a member of PUBLIC namelist '%s' at %L",
@@ -12126,8 +12227,7 @@ resolve_symbol (gfc_symbol *sym)
return;
gfc_find_symbol (sym->ts.u.derived->name, sym->ns, 1, &ds);
- if (!ds && sym->attr.function
- && gfc_check_access (sym->attr.access, sym->ns->default_access))
+ if (!ds && sym->attr.function && gfc_check_symbol_access (sym))
{
symtree = gfc_new_symtree (&sym->ns->sym_root,
sym->ts.u.derived->name);
@@ -12143,9 +12243,8 @@ resolve_symbol (gfc_symbol *sym)
if (sym->ts.type == BT_DERIVED
&& sym->ns->proc_name && sym->ns->proc_name->attr.flavor == FL_MODULE
&& !sym->ts.u.derived->attr.use_assoc
- && gfc_check_access (sym->attr.access, sym->ns->default_access)
- && !gfc_check_access (sym->ts.u.derived->attr.access,
- sym->ts.u.derived->ns->default_access)
+ && gfc_check_symbol_access (sym)
+ && !gfc_check_symbol_access (sym->ts.u.derived)
&& gfc_notify_std (GFC_STD_F2003, "Fortran 2003: PUBLIC %s '%s' at %L "
"of PRIVATE derived type '%s'",
(sym->attr.flavor == FL_PARAMETER) ? "parameter"
@@ -13256,9 +13355,8 @@ resolve_fntype (gfc_namespace *ns)
if (sym->ts.type == BT_DERIVED && !sym->ts.u.derived->attr.use_assoc
&& !sym->attr.contained
- && !gfc_check_access (sym->ts.u.derived->attr.access,
- sym->ts.u.derived->ns->default_access)
- && gfc_check_access (sym->attr.access, sym->ns->default_access))
+ && !gfc_check_symbol_access (sym->ts.u.derived)
+ && gfc_check_symbol_access (sym))
{
gfc_notify_std (GFC_STD_F2003, "Fortran 2003: PUBLIC function '%s' at "
"%L of PRIVATE type '%s'", sym->name,
diff --git a/gcc/fortran/scanner.c b/gcc/fortran/scanner.c
index c226baee966..ac26a8042ca 100644
--- a/gcc/fortran/scanner.c
+++ b/gcc/fortran/scanner.c
@@ -1868,7 +1868,7 @@ include_line (gfc_char_t *line)
filename = gfc_widechar_to_char (begin, -1);
if (load_file (filename, NULL, false) == FAILURE)
- exit (1);
+ exit (FATAL_EXIT_CODE);
gfc_free (filename);
return true;
@@ -2072,7 +2072,7 @@ gfc_new_file (void)
printf ("%s:%3d %s\n", LOCATION_FILE (line_head->location),
LOCATION_LINE (line_head->location), line_head->line);
- exit (0);
+ exit (SUCCESS_EXIT_CODE);
#endif
return result;
diff --git a/gcc/fortran/simplify.c b/gcc/fortran/simplify.c
index 3beac15177c..bb8b575ded8 100644
--- a/gcc/fortran/simplify.c
+++ b/gcc/fortran/simplify.c
@@ -5496,20 +5496,19 @@ gfc_simplify_set_exponent (gfc_expr *x, gfc_expr *i)
gfc_expr *
-gfc_simplify_shape (gfc_expr *source)
+gfc_simplify_shape (gfc_expr *source, gfc_expr *kind)
{
mpz_t shape[GFC_MAX_DIMENSIONS];
gfc_expr *result, *e, *f;
gfc_array_ref *ar;
int n;
gfc_try t;
+ int k = get_kind (BT_INTEGER, kind, "SHAPE", gfc_default_integer_kind);
- if (source->rank == 0)
- return gfc_get_array_expr (BT_INTEGER, gfc_default_integer_kind,
- &source->where);
+ result = gfc_get_array_expr (BT_INTEGER, k, &source->where);
- result = gfc_get_array_expr (BT_INTEGER, gfc_default_integer_kind,
- &source->where);
+ if (source->rank == 0)
+ return result;
if (source->expr_type == EXPR_VARIABLE)
{
@@ -5530,8 +5529,7 @@ gfc_simplify_shape (gfc_expr *source)
for (n = 0; n < source->rank; n++)
{
- e = gfc_get_constant_expr (BT_INTEGER, gfc_default_integer_kind,
- &source->where);
+ e = gfc_get_constant_expr (BT_INTEGER, k, &source->where);
if (t == SUCCESS)
{
@@ -6846,9 +6844,9 @@ gfc_simplify_compiler_version (void)
char *buffer;
size_t len;
- len = strlen ("GCC version ") + strlen (version_string) + 1;
- buffer = (char*) alloca (len);
- snprintf (buffer, len, "GCC version %s", version_string);
+ len = strlen ("GCC version ") + strlen (version_string);
+ buffer = XALLOCAVEC (char, len + 1);
+ snprintf (buffer, len + 1, "GCC version %s", version_string);
return gfc_get_character_expr (gfc_default_character_kind,
&gfc_current_locus, buffer, len);
}
diff --git a/gcc/fortran/symbol.c b/gcc/fortran/symbol.c
index cb5a08f87e0..71aa518ee31 100644
--- a/gcc/fortran/symbol.c
+++ b/gcc/fortran/symbol.c
@@ -390,6 +390,14 @@ check_conflict (symbol_attribute *attr, const char *name, locus *where)
goto conflict_std;
}
+ if (attr->in_namelist && (attr->allocatable || attr->pointer))
+ {
+ a1 = in_namelist;
+ a2 = attr->allocatable ? allocatable : pointer;
+ standard = GFC_STD_F2003;
+ goto conflict_std;
+ }
+
/* Check for attributes not allowed in a BLOCK DATA. */
if (gfc_current_state () == COMP_BLOCK_DATA)
{
@@ -495,9 +503,6 @@ check_conflict (symbol_attribute *attr, const char *name, locus *where)
conf (in_equivalence, allocatable);
conf (in_equivalence, threadprivate);
- conf (in_namelist, pointer);
- conf (in_namelist, allocatable);
-
conf (entry, result);
conf (function, subroutine);
diff --git a/gcc/fortran/trans-array.c b/gcc/fortran/trans-array.c
index 4dc69d25c26..ac08c42c944 100644
--- a/gcc/fortran/trans-array.c
+++ b/gcc/fortran/trans-array.c
@@ -1495,11 +1495,55 @@ gfc_trans_array_constructor_value (stmtblock_t * pblock, tree type,
}
+/* A catch-all to obtain the string length for anything that is not a
+ a substring of non-constant length, a constant, array or variable. */
+
+static void
+get_array_ctor_all_strlen (stmtblock_t *block, gfc_expr *e, tree *len)
+{
+ gfc_se se;
+ gfc_ss *ss;
+
+ /* Don't bother if we already know the length is a constant. */
+ if (*len && INTEGER_CST_P (*len))
+ return;
+
+ if (!e->ref && e->ts.u.cl && e->ts.u.cl->length
+ && e->ts.u.cl->length->expr_type == EXPR_CONSTANT)
+ {
+ /* This is easy. */
+ gfc_conv_const_charlen (e->ts.u.cl);
+ *len = e->ts.u.cl->backend_decl;
+ }
+ else
+ {
+ /* Otherwise, be brutal even if inefficient. */
+ ss = gfc_walk_expr (e);
+ gfc_init_se (&se, NULL);
+
+ /* No function call, in case of side effects. */
+ se.no_function_call = 1;
+ if (ss == gfc_ss_terminator)
+ gfc_conv_expr (&se, e);
+ else
+ gfc_conv_expr_descriptor (&se, e, ss);
+
+ /* Fix the value. */
+ *len = gfc_evaluate_now (se.string_length, &se.pre);
+
+ gfc_add_block_to_block (block, &se.pre);
+ gfc_add_block_to_block (block, &se.post);
+
+ e->ts.u.cl->backend_decl = *len;
+ }
+}
+
+
/* Figure out the string length of a variable reference expression.
Used by get_array_ctor_strlen. */
static void
-get_array_ctor_var_strlen (gfc_expr * expr, tree * len)
+get_array_ctor_var_strlen (stmtblock_t *block, gfc_expr * expr, tree * len)
{
gfc_ref *ref;
gfc_typespec *ts;
@@ -1526,7 +1570,11 @@ get_array_ctor_var_strlen (gfc_expr * expr, tree * len)
case REF_SUBSTRING:
if (ref->u.ss.start->expr_type != EXPR_CONSTANT
|| ref->u.ss.end->expr_type != EXPR_CONSTANT)
- break;
+ {
+ /* Note that this might evaluate expr. */
+ get_array_ctor_all_strlen (block, expr, len);
+ return;
+ }
mpz_init_set_ui (char_len, 1);
mpz_add (char_len, char_len, ref->u.ss.end->value.integer);
mpz_sub (char_len, char_len, ref->u.ss.start->value.integer);
@@ -1536,10 +1584,7 @@ get_array_ctor_var_strlen (gfc_expr * expr, tree * len)
return;
default:
- /* TODO: Substrings are tricky because we can't evaluate the
- expression more than once. For now we just give up, and hope
- we can figure it out elsewhere. */
- return;
+ gcc_unreachable ();
}
}
@@ -1547,49 +1592,6 @@ get_array_ctor_var_strlen (gfc_expr * expr, tree * len)
}
-/* A catch-all to obtain the string length for anything that is not a
- constant, array or variable. */
-static void
-get_array_ctor_all_strlen (stmtblock_t *block, gfc_expr *e, tree *len)
-{
- gfc_se se;
- gfc_ss *ss;
-
- /* Don't bother if we already know the length is a constant. */
- if (*len && INTEGER_CST_P (*len))
- return;
-
- if (!e->ref && e->ts.u.cl && e->ts.u.cl->length
- && e->ts.u.cl->length->expr_type == EXPR_CONSTANT)
- {
- /* This is easy. */
- gfc_conv_const_charlen (e->ts.u.cl);
- *len = e->ts.u.cl->backend_decl;
- }
- else
- {
- /* Otherwise, be brutal even if inefficient. */
- ss = gfc_walk_expr (e);
- gfc_init_se (&se, NULL);
-
- /* No function call, in case of side effects. */
- se.no_function_call = 1;
- if (ss == gfc_ss_terminator)
- gfc_conv_expr (&se, e);
- else
- gfc_conv_expr_descriptor (&se, e, ss);
-
- /* Fix the value. */
- *len = gfc_evaluate_now (se.string_length, &se.pre);
-
- gfc_add_block_to_block (block, &se.pre);
- gfc_add_block_to_block (block, &se.post);
-
- e->ts.u.cl->backend_decl = *len;
- }
-}
-
-
/* Figure out the string length of a character array constructor.
If len is NULL, don't calculate the length; this happens for recursive calls
when a sub-array-constructor is an element but not at the first position,
@@ -1633,7 +1635,7 @@ get_array_ctor_strlen (stmtblock_t *block, gfc_constructor_base base, tree * len
case EXPR_VARIABLE:
is_const = false;
if (len)
- get_array_ctor_var_strlen (c->expr, len);
+ get_array_ctor_var_strlen (block, c->expr, len);
break;
default:
@@ -6095,10 +6097,11 @@ gfc_conv_array_parameter (gfc_se * se, gfc_expr * expr, gfc_ss * ss, bool g77,
&& expr->ts.u.derived->attr.alloc_comp
&& expr->expr_type != EXPR_VARIABLE)
{
- tmp = build_fold_indirect_ref_loc (input_location,
- se->expr);
+ tmp = build_fold_indirect_ref_loc (input_location, se->expr);
tmp = gfc_deallocate_alloc_comp (expr->ts.u.derived, tmp, expr->rank);
- gfc_add_expr_to_block (&se->post, tmp);
+
+ /* The components shall be deallocated before their containing entity. */
+ gfc_prepend_expr_to_block (&se->post, tmp);
}
if (g77 || (fsym && fsym->attr.contiguous
@@ -7154,6 +7157,8 @@ gfc_trans_deferred_array (gfc_symbol * sym, gfc_wrapped_block * block)
"allocatable attribute or derived type without allocatable "
"components.");
+ gfc_save_backend_locus (&loc);
+ gfc_set_backend_locus (&sym->declared_at);
gfc_init_block (&init);
gcc_assert (TREE_CODE (sym->backend_decl) == VAR_DECL
@@ -7170,11 +7175,10 @@ gfc_trans_deferred_array (gfc_symbol * sym, gfc_wrapped_block * block)
if (sym->attr.dummy || sym->attr.use_assoc || sym->attr.result)
{
gfc_add_init_cleanup (block, gfc_finish_block (&init), NULL_TREE);
+ gfc_restore_backend_locus (&loc);
return;
}
- gfc_save_backend_locus (&loc);
- gfc_set_backend_locus (&sym->declared_at);
descriptor = sym->backend_decl;
/* Although static, derived types with default initializers and
@@ -7223,8 +7227,8 @@ gfc_trans_deferred_array (gfc_symbol * sym, gfc_wrapped_block * block)
if (GFC_DESCRIPTOR_TYPE_P (type) && !sym->attr.save)
gfc_conv_descriptor_data_set (&init, descriptor, null_pointer_node);
- gfc_init_block (&cleanup);
gfc_restore_backend_locus (&loc);
+ gfc_init_block (&cleanup);
/* Allocatable arrays need to be freed when they go out of scope.
The allocatable components of pointers must not be touched. */
diff --git a/gcc/fortran/trans-decl.c b/gcc/fortran/trans-decl.c
index 254db76b0c5..08207e09832 100644
--- a/gcc/fortran/trans-decl.c
+++ b/gcc/fortran/trans-decl.c
@@ -1,5 +1,6 @@
/* Backend function setup
- Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
+ Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
+ 2011
Free Software Foundation, Inc.
Contributed by Paul Brook
@@ -631,6 +632,64 @@ gfc_defer_symbol_init (gfc_symbol * sym)
}
+/* Used in gfc_get_symbol_decl and gfc_get_derived_type to obtain the
+ backend_decl for a module symbol, if it all ready exists. If the
+ module gsymbol does not exist, it is created. If the symbol does
+ not exist, it is added to the gsymbol namespace. Returns true if
+ an existing backend_decl is found. */
+
+bool
+gfc_get_module_backend_decl (gfc_symbol *sym)
+{
+ gfc_gsymbol *gsym;
+ gfc_symbol *s;
+ gfc_symtree *st;
+
+ gsym = gfc_find_gsymbol (gfc_gsym_root, sym->module);
+
+ if (!gsym || (gsym->ns && gsym->type == GSYM_MODULE))
+ {
+ st = NULL;
+ s = NULL;
+
+ if (gsym)
+ gfc_find_symbol (sym->name, gsym->ns, 0, &s);
+
+ if (!s)
+ {
+ if (!gsym)
+ {
+ gsym = gfc_get_gsymbol (sym->module);
+ gsym->type = GSYM_MODULE;
+ gsym->ns = gfc_get_namespace (NULL, 0);
+ }
+
+ st = gfc_new_symtree (&gsym->ns->sym_root, sym->name);
+ st->n.sym = sym;
+ sym->refs++;
+ }
+ else if (sym->attr.flavor == FL_DERIVED)
+ {
+ if (!s->backend_decl)
+ s->backend_decl = gfc_get_derived_type (s);
+ gfc_copy_dt_decls_ifequal (s, sym, true);
+ return true;
+ }
+ else if (s->backend_decl)
+ {
+ if (sym->ts.type == BT_DERIVED)
+ gfc_copy_dt_decls_ifequal (s->ts.u.derived, sym->ts.u.derived,
+ true);
+ else if (sym->ts.type == BT_CHARACTER)
+ sym->ts.u.cl->backend_decl = s->ts.u.cl->backend_decl;
+ sym->backend_decl = s->backend_decl;
+ return true;
+ }
+ }
+ return false;
+}
+
+
/* Create an array index type variable with function scope. */
static tree
@@ -1067,6 +1126,21 @@ gfc_get_symbol_decl (gfc_symbol * sym)
gfc_find_derived_vtab (c->ts.u.derived);
}
+ /* All deferred character length procedures need to retain the backend
+ decl, which is a pointer to the character length in the caller's
+ namespace and to declare a local character length. */
+ if (!byref && sym->attr.function
+ && sym->ts.type == BT_CHARACTER
+ && sym->ts.deferred
+ && sym->ts.u.cl->passed_length == NULL
+ && sym->ts.u.cl->backend_decl
+ && TREE_CODE (sym->ts.u.cl->backend_decl) == PARM_DECL)
+ {
+ sym->ts.u.cl->passed_length = sym->ts.u.cl->backend_decl;
+ sym->ts.u.cl->backend_decl = NULL_TREE;
+ length = gfc_create_string_length (sym);
+ }
+
if ((sym->attr.dummy && ! sym->attr.function) || (sym->attr.result && byref))
{
/* Return via extra parameter. */
@@ -1087,6 +1161,20 @@ gfc_get_symbol_decl (gfc_symbol * sym)
/* Create a character length variable. */
if (sym->ts.type == BT_CHARACTER)
{
+ /* For a deferred dummy, make a new string length variable. */
+ if (sym->ts.deferred
+ &&
+ (sym->ts.u.cl->passed_length == sym->ts.u.cl->backend_decl))
+ sym->ts.u.cl->backend_decl = NULL_TREE;
+
+ if (sym->ts.deferred && sym->attr.result
+ && sym->ts.u.cl->passed_length == NULL
+ && sym->ts.u.cl->backend_decl)
+ {
+ sym->ts.u.cl->passed_length = sym->ts.u.cl->backend_decl;
+ sym->ts.u.cl->backend_decl = NULL_TREE;
+ }
+
if (sym->ts.u.cl->backend_decl == NULL_TREE)
length = gfc_create_string_length (sym);
else
@@ -1146,29 +1234,11 @@ gfc_get_symbol_decl (gfc_symbol * sym)
if (gfc_option.flag_whole_file
&& (sym->attr.flavor == FL_VARIABLE
|| sym->attr.flavor == FL_PARAMETER)
- && sym->attr.use_assoc && !intrinsic_array_parameter
- && sym->module)
- {
- gfc_gsymbol *gsym;
-
- gsym = gfc_find_gsymbol (gfc_gsym_root, sym->module);
- if (gsym && gsym->ns && gsym->type == GSYM_MODULE)
- {
- gfc_symbol *s;
- s = NULL;
- gfc_find_symbol (sym->name, gsym->ns, 0, &s);
- if (s && s->backend_decl)
- {
- if (sym->ts.type == BT_DERIVED)
- gfc_copy_dt_decls_ifequal (s->ts.u.derived, sym->ts.u.derived,
- true);
- if (sym->ts.type == BT_CHARACTER)
- sym->ts.u.cl->backend_decl = s->ts.u.cl->backend_decl;
- sym->backend_decl = s->backend_decl;
- return sym->backend_decl;
- }
- }
- }
+ && sym->attr.use_assoc
+ && !intrinsic_array_parameter
+ && sym->module
+ && gfc_get_module_backend_decl (sym))
+ return sym->backend_decl;
if (sym->attr.flavor == FL_PROCEDURE)
{
@@ -1425,6 +1495,7 @@ gfc_get_extern_function_decl (gfc_symbol * sym)
tree name;
tree mangled_name;
gfc_gsymbol *gsym;
+ bool proc_formal_arg;
if (sym->backend_decl)
return sym->backend_decl;
@@ -1441,10 +1512,27 @@ gfc_get_extern_function_decl (gfc_symbol * sym)
return the backend_decl. */
gsym = gfc_find_gsymbol (gfc_gsym_root, sym->name);
+ /* Do not use procedures that have a procedure argument because this
+ can result in problems of multiple decls during inlining. */
+ proc_formal_arg = false;
+ if (gsym && gsym->ns && gsym->ns->proc_name)
+ {
+ gfc_formal_arglist *formal = gsym->ns->proc_name->formal;
+ for (; formal; formal = formal->next)
+ {
+ if (formal->sym && formal->sym->attr.flavor == FL_PROCEDURE)
+ {
+ proc_formal_arg = true;
+ break;
+ }
+ }
+ }
+
if (gfc_option.flag_whole_file
&& (!sym->attr.use_assoc || sym->attr.if_source != IFSRC_DECL)
&& !sym->backend_decl
&& gsym && gsym->ns
+ && !proc_formal_arg
&& ((gsym->type == GSYM_SUBROUTINE) || (gsym->type == GSYM_FUNCTION))
&& (gsym->ns->proc_name->backend_decl || !sym->attr.intrinsic))
{
@@ -1793,7 +1881,6 @@ create_function_arglist (gfc_symbol * sym)
{
/* Length of character result. */
tree len_type = TREE_VALUE (TREE_CHAIN (typelist));
- gcc_assert (len_type == gfc_charlen_type_node);
length = build_decl (input_location,
PARM_DECL,
@@ -1879,7 +1966,10 @@ create_function_arglist (gfc_symbol * sym)
{
tree len_type = TREE_VALUE (hidden_typelist);
tree length = NULL_TREE;
- gcc_assert (len_type == gfc_charlen_type_node);
+ if (!f->sym->ts.deferred)
+ gcc_assert (len_type == gfc_charlen_type_node);
+ else
+ gcc_assert (POINTER_TYPE_P (len_type));
strcpy (&name[1], f->sym->name);
name[0] = '_';
@@ -3160,6 +3250,32 @@ init_intent_out_dt (gfc_symbol * proc_sym, gfc_wrapped_block * block)
else if (f->sym->value)
gfc_init_default_dt (f->sym, &init, true);
}
+ else if (f->sym && f->sym->attr.intent == INTENT_OUT
+ && f->sym->ts.type == BT_CLASS
+ && !CLASS_DATA (f->sym)->attr.class_pointer
+ && CLASS_DATA (f->sym)->ts.u.derived->attr.alloc_comp)
+ {
+ tree decl = build_fold_indirect_ref_loc (input_location,
+ f->sym->backend_decl);
+ tmp = CLASS_DATA (f->sym)->backend_decl;
+ tmp = fold_build3_loc (input_location, COMPONENT_REF,
+ TREE_TYPE (tmp), decl, tmp, NULL_TREE);
+ tmp = build_fold_indirect_ref_loc (input_location, tmp);
+ tmp = gfc_deallocate_alloc_comp (CLASS_DATA (f->sym)->ts.u.derived,
+ tmp,
+ CLASS_DATA (f->sym)->as ?
+ CLASS_DATA (f->sym)->as->rank : 0);
+
+ if (f->sym->attr.optional || f->sym->ns->proc_name->attr.entry_master)
+ {
+ present = gfc_conv_expr_present (f->sym);
+ tmp = build3_loc (input_location, COND_EXPR, TREE_TYPE (tmp),
+ present, tmp,
+ build_empty_stmt (input_location));
+ }
+
+ gfc_add_expr_to_block (&init, tmp);
+ }
gfc_add_init_cleanup (block, gfc_finish_block (&init), NULL_TREE);
}
@@ -3182,6 +3298,10 @@ gfc_trans_deferred_vars (gfc_symbol * proc_sym, gfc_wrapped_block * block)
gfc_formal_arglist *f;
stmtblock_t tmpblock;
bool seen_trans_deferred_array = false;
+ tree tmp = NULL;
+ gfc_expr *e;
+ gfc_se se;
+ stmtblock_t init;
/* Deal with implicit return variables. Explicit return variables will
already have been added. */
@@ -3213,7 +3333,37 @@ gfc_trans_deferred_vars (gfc_symbol * proc_sym, gfc_wrapped_block * block)
}
else if (proc_sym->ts.type == BT_CHARACTER)
{
- if (TREE_CODE (proc_sym->ts.u.cl->backend_decl) == VAR_DECL)
+ if (proc_sym->ts.deferred)
+ {
+ tmp = NULL;
+ gfc_save_backend_locus (&loc);
+ gfc_set_backend_locus (&proc_sym->declared_at);
+ gfc_start_block (&init);
+ /* Zero the string length on entry. */
+ gfc_add_modify (&init, proc_sym->ts.u.cl->backend_decl,
+ build_int_cst (gfc_charlen_type_node, 0));
+ /* Null the pointer. */
+ e = gfc_lval_expr_from_sym (proc_sym);
+ gfc_init_se (&se, NULL);
+ se.want_pointer = 1;
+ gfc_conv_expr (&se, e);
+ gfc_free_expr (e);
+ tmp = se.expr;
+ gfc_add_modify (&init, tmp,
+ fold_convert (TREE_TYPE (se.expr),
+ null_pointer_node));
+ gfc_restore_backend_locus (&loc);
+
+ /* Pass back the string length on exit. */
+ tmp = proc_sym->ts.u.cl->passed_length;
+ tmp = build_fold_indirect_ref_loc (input_location, tmp);
+ tmp = fold_convert (gfc_charlen_type_node, tmp);
+ tmp = fold_build2_loc (input_location, MODIFY_EXPR,
+ gfc_charlen_type_node, tmp,
+ proc_sym->ts.u.cl->backend_decl);
+ gfc_add_init_cleanup (block, gfc_finish_block (&init), tmp);
+ }
+ else if (TREE_CODE (proc_sym->ts.u.cl->backend_decl) == VAR_DECL)
gfc_trans_dummy_character (proc_sym, proc_sym->ts.u.cl, block);
}
else
@@ -3224,7 +3374,10 @@ gfc_trans_deferred_vars (gfc_symbol * proc_sym, gfc_wrapped_block * block)
/* Initialize the INTENT(OUT) derived type dummy arguments. This
should be done here so that the offsets and lbounds of arrays
are available. */
+ gfc_save_backend_locus (&loc);
+ gfc_set_backend_locus (&proc_sym->declared_at);
init_intent_out_dt (proc_sym, block);
+ gfc_restore_backend_locus (&loc);
for (sym = proc_sym->tlink; sym != proc_sym; sym = sym->tlink)
{
@@ -3243,7 +3396,12 @@ gfc_trans_deferred_vars (gfc_symbol * proc_sym, gfc_wrapped_block * block)
else if (sym->attr.pointer || sym->attr.allocatable)
{
if (TREE_STATIC (sym->backend_decl))
- gfc_trans_static_array_pointer (sym);
+ {
+ gfc_save_backend_locus (&loc);
+ gfc_set_backend_locus (&sym->declared_at);
+ gfc_trans_static_array_pointer (sym);
+ gfc_restore_backend_locus (&loc);
+ }
else
{
seen_trans_deferred_array = true;
@@ -3252,6 +3410,9 @@ gfc_trans_deferred_vars (gfc_symbol * proc_sym, gfc_wrapped_block * block)
}
else
{
+ gfc_save_backend_locus (&loc);
+ gfc_set_backend_locus (&sym->declared_at);
+
if (sym_has_alloc_comp)
{
seen_trans_deferred_array = true;
@@ -3269,8 +3430,6 @@ gfc_trans_deferred_vars (gfc_symbol * proc_sym, gfc_wrapped_block * block)
NULL_TREE);
}
- gfc_save_backend_locus (&loc);
- gfc_set_backend_locus (&sym->declared_at);
gfc_trans_auto_array_allocation (sym->backend_decl,
sym, block);
gfc_restore_backend_locus (&loc);
@@ -3304,19 +3463,15 @@ gfc_trans_deferred_vars (gfc_symbol * proc_sym, gfc_wrapped_block * block)
if (sym_has_alloc_comp && !seen_trans_deferred_array)
gfc_trans_deferred_array (sym, block);
}
- else if (sym->attr.allocatable
- || (sym->ts.type == BT_CLASS
- && CLASS_DATA (sym)->attr.allocatable))
+ else if ((!sym->attr.dummy || sym->ts.deferred)
+ && (sym->attr.allocatable
+ || (sym->ts.type == BT_CLASS
+ && CLASS_DATA (sym)->attr.allocatable)))
{
if (!sym->attr.save)
{
/* Nullify and automatic deallocation of allocatable
scalars. */
- tree tmp = NULL;
- gfc_expr *e;
- gfc_se se;
- stmtblock_t init;
-
e = gfc_lval_expr_from_sym (sym);
if (sym->ts.type == BT_CLASS)
gfc_add_data_component (e);
@@ -3326,15 +3481,50 @@ gfc_trans_deferred_vars (gfc_symbol * proc_sym, gfc_wrapped_block * block)
gfc_conv_expr (&se, e);
gfc_free_expr (e);
- /* Nullify when entering the scope. */
+ gfc_save_backend_locus (&loc);
+ gfc_set_backend_locus (&sym->declared_at);
gfc_start_block (&init);
- gfc_add_modify (&init, se.expr,
- fold_convert (TREE_TYPE (se.expr),
- null_pointer_node));
+
+ if (!sym->attr.dummy || sym->attr.intent == INTENT_OUT)
+ {
+ /* Nullify when entering the scope. */
+ gfc_add_modify (&init, se.expr,
+ fold_convert (TREE_TYPE (se.expr),
+ null_pointer_node));
+ }
+
+ if ((sym->attr.dummy ||sym->attr.result)
+ && sym->ts.type == BT_CHARACTER
+ && sym->ts.deferred)
+ {
+ /* Character length passed by reference. */
+ tmp = sym->ts.u.cl->passed_length;
+ tmp = build_fold_indirect_ref_loc (input_location, tmp);
+ tmp = fold_convert (gfc_charlen_type_node, tmp);
+
+ if (!sym->attr.dummy || sym->attr.intent == INTENT_OUT)
+ /* Zero the string length when entering the scope. */
+ gfc_add_modify (&init, sym->ts.u.cl->backend_decl,
+ build_int_cst (gfc_charlen_type_node, 0));
+ else
+ gfc_add_modify (&init, sym->ts.u.cl->backend_decl, tmp);
+
+ gfc_restore_backend_locus (&loc);
+
+ /* Pass the final character length back. */
+ if (sym->attr.intent != INTENT_IN)
+ tmp = fold_build2_loc (input_location, MODIFY_EXPR,
+ gfc_charlen_type_node, tmp,
+ sym->ts.u.cl->backend_decl);
+ else
+ tmp = NULL_TREE;
+ }
+ else
+ gfc_restore_backend_locus (&loc);
/* Deallocate when leaving the scope. Nullifying is not
needed. */
- if (!sym->attr.result)
+ if (!sym->attr.result && !sym->attr.dummy)
tmp = gfc_deallocate_scalar_with_status (se.expr, NULL, true,
NULL, sym->ts);
@@ -3343,6 +3533,9 @@ gfc_trans_deferred_vars (gfc_symbol * proc_sym, gfc_wrapped_block * block)
/* Initialize _vptr to declared type. */
gfc_symbol *vtab = gfc_find_derived_vtab (sym->ts.u.derived);
tree rhs;
+
+ gfc_save_backend_locus (&loc);
+ gfc_set_backend_locus (&sym->declared_at);
e = gfc_lval_expr_from_sym (sym);
gfc_add_vptr_component (e);
gfc_init_se (&se, NULL);
@@ -3352,11 +3545,39 @@ gfc_trans_deferred_vars (gfc_symbol * proc_sym, gfc_wrapped_block * block)
rhs = gfc_build_addr_expr (TREE_TYPE (se.expr),
gfc_get_symbol_decl (vtab));
gfc_add_modify (&init, se.expr, rhs);
+ gfc_restore_backend_locus (&loc);
}
gfc_add_init_cleanup (block, gfc_finish_block (&init), tmp);
}
}
+ else if (sym->ts.type == BT_CHARACTER && sym->ts.deferred)
+ {
+ tree tmp = NULL;
+ stmtblock_t init;
+
+ /* If we get to here, all that should be left are pointers. */
+ gcc_assert (sym->attr.pointer);
+
+ if (sym->attr.dummy)
+ {
+ gfc_start_block (&init);
+
+ /* Character length passed by reference. */
+ tmp = sym->ts.u.cl->passed_length;
+ tmp = build_fold_indirect_ref_loc (input_location, tmp);
+ tmp = fold_convert (gfc_charlen_type_node, tmp);
+ gfc_add_modify (&init, sym->ts.u.cl->backend_decl, tmp);
+ /* Pass the final character length back. */
+ if (sym->attr.intent != INTENT_IN)
+ tmp = fold_build2_loc (input_location, MODIFY_EXPR,
+ gfc_charlen_type_node, tmp,
+ sym->ts.u.cl->backend_decl);
+ else
+ tmp = NULL_TREE;
+ gfc_add_init_cleanup (block, gfc_finish_block (&init), tmp);
+ }
+ }
else if (sym->ts.deferred)
gfc_fatal_error ("Deferred type parameter not yet supported");
else if (sym_has_alloc_comp)
@@ -4601,16 +4822,18 @@ gfc_generate_function_code (gfc_namespace * ns)
&& sym->attr.function
&& !sym->attr.pointer)
{
- if (sym->ts.type == BT_DERIVED
- && sym->ts.u.derived->attr.alloc_comp)
+ if (sym->attr.allocatable && sym->attr.dimension == 0
+ && sym->result == sym)
+ gfc_add_modify (&init, result, fold_convert (TREE_TYPE (result),
+ null_pointer_node));
+ else if (sym->ts.type == BT_DERIVED
+ && sym->ts.u.derived->attr.alloc_comp
+ && !sym->attr.allocatable)
{
rank = sym->as ? sym->as->rank : 0;
tmp = gfc_nullify_alloc_comp (sym->ts.u.derived, result, rank);
gfc_add_expr_to_block (&init, tmp);
}
- else if (sym->attr.allocatable && sym->attr.dimension == 0)
- gfc_add_modify (&init, result, fold_convert (TREE_TYPE (result),
- null_pointer_node));
}
if (result == NULL_TREE)
diff --git a/gcc/fortran/trans-expr.c b/gcc/fortran/trans-expr.c
index ec1e848509c..d6c1f9f5a17 100644
--- a/gcc/fortran/trans-expr.c
+++ b/gcc/fortran/trans-expr.c
@@ -504,6 +504,26 @@ gfc_conv_component_ref (gfc_se * se, gfc_ref * ref)
field = c->backend_decl;
gcc_assert (TREE_CODE (field) == FIELD_DECL);
decl = se->expr;
+
+ /* Components can correspond to fields of different containing
+ types, as components are created without context, whereas
+ a concrete use of a component has the type of decl as context.
+ So, if the type doesn't match, we search the corresponding
+ FIELD_DECL in the parent type. To not waste too much time
+ we cache this result in norestrict_decl. */
+
+ if (DECL_FIELD_CONTEXT (field) != TREE_TYPE (decl))
+ {
+ tree f2 = c->norestrict_decl;
+ if (!f2 || DECL_FIELD_CONTEXT (f2) != TREE_TYPE (decl))
+ for (f2 = TYPE_FIELDS (TREE_TYPE (decl)); f2; f2 = DECL_CHAIN (f2))
+ if (TREE_CODE (f2) == FIELD_DECL
+ && DECL_NAME (f2) == DECL_NAME (field))
+ break;
+ gcc_assert (f2);
+ c->norestrict_decl = f2;
+ field = f2;
+ }
tmp = fold_build3_loc (input_location, COMPONENT_REF, TREE_TYPE (field),
decl, field, NULL_TREE);
@@ -538,6 +558,11 @@ conv_parent_component_references (gfc_se * se, gfc_ref * ref)
dt = ref->u.c.sym;
c = ref->u.c.component;
+ /* Return if the component is not in the parent type. */
+ for (cmp = dt->components; cmp; cmp = cmp->next)
+ if (strcmp (c->name, cmp->name) == 0)
+ return;
+
/* Build a gfc_ref to recursively call gfc_conv_component_ref. */
parent.type = REF_COMPONENT;
parent.next = NULL;
@@ -547,23 +572,11 @@ conv_parent_component_references (gfc_se * se, gfc_ref * ref)
if (dt->backend_decl == NULL)
gfc_get_derived_type (dt);
- if (dt->attr.extension && dt->components)
- {
- if (dt->attr.is_class)
- cmp = dt->components;
- else
- cmp = dt->components->next;
- /* Return if the component is not in the parent type. */
- for (; cmp; cmp = cmp->next)
- if (strcmp (c->name, cmp->name) == 0)
- return;
-
- /* Otherwise build the reference and call self. */
- gfc_conv_component_ref (se, &parent);
- parent.u.c.sym = dt->components->ts.u.derived;
- parent.u.c.component = c;
- conv_parent_component_references (se, &parent);
- }
+ /* Build the reference and call self. */
+ gfc_conv_component_ref (se, &parent);
+ parent.u.c.sym = dt->components->ts.u.derived;
+ parent.u.c.component = c;
+ conv_parent_component_references (se, &parent);
}
/* Return the contents of a variable. Also handles reference/pointer
@@ -3322,6 +3335,15 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym,
}
end_pointer_check:
+ /* Deferred length dummies pass the character length by reference
+ so that the value can be returned. */
+ if (parmse.string_length && fsym && fsym->ts.deferred)
+ {
+ tmp = parmse.string_length;
+ if (TREE_CODE (tmp) != VAR_DECL)
+ tmp = gfc_evaluate_now (parmse.string_length, &se->pre);
+ parmse.string_length = gfc_build_addr_expr (NULL_TREE, tmp);
+ }
/* Character strings are passed as two parameters, a length and a
pointer - except for Bind(c) which only passes the pointer. */
@@ -3349,7 +3371,9 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym,
we take the character length of the first argument for the result.
For dummies, we have to look through the formal argument list for
this function and use the character length found there.*/
- if (!sym->attr.dummy)
+ if (ts.deferred && (sym->attr.allocatable || sym->attr.pointer))
+ cl.backend_decl = gfc_create_var (gfc_charlen_type_node, "slen");
+ else if (!sym->attr.dummy)
cl.backend_decl = VEC_index (tree, stringargs, 0);
else
{
@@ -3534,6 +3558,15 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym,
VEC_safe_push (tree, gc, retargs, var);
}
+ if (ts.type == BT_CHARACTER && ts.deferred
+ && (sym->attr.allocatable || sym->attr.pointer))
+ {
+ tmp = len;
+ if (TREE_CODE (tmp) != VAR_DECL)
+ tmp = gfc_evaluate_now (len, &se->pre);
+ len = gfc_build_addr_expr (NULL_TREE, tmp);
+ }
+
/* Add the string length to the argument list. */
if (ts.type == BT_CHARACTER)
VEC_safe_push (tree, gc, retargs, len);
@@ -3586,10 +3619,9 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym,
x = f()
where f is pointer valued, we have to dereference the result. */
if (!se->want_pointer && !byref
- && (sym->attr.pointer || sym->attr.allocatable)
- && !gfc_is_proc_ptr_comp (expr, NULL))
- se->expr = build_fold_indirect_ref_loc (input_location,
- se->expr);
+ && ((!comp && (sym->attr.pointer || sym->attr.allocatable))
+ || (comp && (comp->attr.pointer || comp->attr.allocatable))))
+ se->expr = build_fold_indirect_ref_loc (input_location, se->expr);
/* f2c calling conventions require a scalar default real function to
return a double precision result. Convert this back to default
@@ -3642,7 +3674,10 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym,
else
se->expr = var;
- se->string_length = len;
+ if (!ts.deferred)
+ se->string_length = len;
+ else if (sym->attr.allocatable || sym->attr.pointer)
+ se->string_length = cl.backend_decl;
}
else
{
@@ -4605,7 +4640,7 @@ gfc_conv_structure (gfc_se * se, gfc_expr * expr, int init)
components. Although the latter have a default initializer
of EXPR_NULL,... by default, the static nullify is not needed
since this is done every time we come into scope. */
- if (!c->expr || cm->attr.allocatable)
+ if (!c->expr || (cm->attr.allocatable && cm->attr.flavor != FL_PROCEDURE))
continue;
if (strcmp (cm->name, "_size") == 0)
@@ -4919,8 +4954,11 @@ gfc_trans_pointer_assignment (gfc_expr * expr1, gfc_expr * expr2)
gfc_add_block_to_block (&block, &rse.pre);
/* Check character lengths if character expression. The test is only
- really added if -fbounds-check is enabled. */
+ really added if -fbounds-check is enabled. Exclude deferred
+ character length lefthand sides. */
if (expr1->ts.type == BT_CHARACTER && expr2->expr_type != EXPR_NULL
+ && !(expr1->ts.deferred
+ && (TREE_CODE (lse.string_length) == VAR_DECL))
&& !expr1->symtree->n.sym->attr.proc_pointer
&& !gfc_is_proc_ptr_comp (expr1, NULL))
{
@@ -4931,6 +4969,17 @@ gfc_trans_pointer_assignment (gfc_expr * expr1, gfc_expr * expr2)
&block);
}
+ /* The assignment to an deferred character length sets the string
+ length to that of the rhs. */
+ if (expr1->ts.deferred && (TREE_CODE (lse.string_length) == VAR_DECL))
+ {
+ if (expr2->expr_type != EXPR_NULL)
+ gfc_add_modify (&block, lse.string_length, rse.string_length);
+ else
+ gfc_add_modify (&block, lse.string_length,
+ build_int_cst (gfc_charlen_type_node, 0));
+ }
+
gfc_add_modify (&block, lse.expr,
fold_convert (TREE_TYPE (lse.expr), rse.expr));
@@ -5206,8 +5255,6 @@ gfc_conv_string_parameter (gfc_se * se)
}
gcc_assert (POINTER_TYPE_P (TREE_TYPE (se->expr)));
- gcc_assert (se->string_length
- && TREE_CODE (TREE_TYPE (se->string_length)) == INTEGER_TYPE);
}
@@ -5345,9 +5392,13 @@ arrayfunc_assign_needs_temporary (gfc_expr * expr1, gfc_expr * expr2)
if (gfc_ref_needs_temporary_p (expr1->ref))
return true;
- /* Functions returning pointers need temporaries. */
- if (expr2->symtree->n.sym->attr.pointer
- || expr2->symtree->n.sym->attr.allocatable)
+ /* Functions returning pointers or allocatables need temporaries. */
+ c = expr2->value.function.esym
+ ? (expr2->value.function.esym->attr.pointer
+ || expr2->value.function.esym->attr.allocatable)
+ : (expr2->symtree->n.sym->attr.pointer
+ || expr2->symtree->n.sym->attr.allocatable);
+ if (c)
return true;
/* Character array functions need temporaries unless the
@@ -5792,6 +5843,136 @@ expr_is_variable (gfc_expr *expr)
}
+/* Is the lhs OK for automatic reallocation? */
+
+static bool
+is_scalar_reallocatable_lhs (gfc_expr *expr)
+{
+ gfc_ref * ref;
+
+ /* An allocatable variable with no reference. */
+ if (expr->symtree->n.sym->attr.allocatable
+ && !expr->ref)
+ return true;
+
+ /* All that can be left are allocatable components. */
+ if ((expr->symtree->n.sym->ts.type != BT_DERIVED
+ && expr->symtree->n.sym->ts.type != BT_CLASS)
+ || !expr->symtree->n.sym->ts.u.derived->attr.alloc_comp)
+ return false;
+
+ /* Find an allocatable component ref last. */
+ for (ref = expr->ref; ref; ref = ref->next)
+ if (ref->type == REF_COMPONENT
+ && !ref->next
+ && ref->u.c.component->attr.allocatable)
+ return true;
+
+ return false;
+}
+
+
+/* Allocate or reallocate scalar lhs, as necessary. */
+
+static void
+alloc_scalar_allocatable_for_assignment (stmtblock_t *block,
+ tree string_length,
+ gfc_expr *expr1,
+ gfc_expr *expr2)
+
+{
+ tree cond;
+ tree tmp;
+ tree size;
+ tree size_in_bytes;
+ tree jump_label1;
+ tree jump_label2;
+ gfc_se lse;
+
+ if (!expr1 || expr1->rank)
+ return;
+
+ if (!expr2 || expr2->rank)
+ return;
+
+ /* Since this is a scalar lhs, we can afford to do this. That is,
+ there is no risk of side effects being repeated. */
+ gfc_init_se (&lse, NULL);
+ lse.want_pointer = 1;
+ gfc_conv_expr (&lse, expr1);
+
+ jump_label1 = gfc_build_label_decl (NULL_TREE);
+ jump_label2 = gfc_build_label_decl (NULL_TREE);
+
+ /* Do the allocation if the lhs is NULL. Otherwise go to label 1. */
+ tmp = build_int_cst (TREE_TYPE (lse.expr), 0);
+ cond = fold_build2_loc (input_location, NE_EXPR, boolean_type_node,
+ lse.expr, tmp);
+ tmp = build3_v (COND_EXPR, cond,
+ build1_v (GOTO_EXPR, jump_label1),
+ build_empty_stmt (input_location));
+ gfc_add_expr_to_block (block, tmp);
+
+ if (expr1->ts.type == BT_CHARACTER && expr1->ts.deferred)
+ {
+ /* Use the rhs string length and the lhs element size. */
+ size = string_length;
+ tmp = TREE_TYPE (gfc_typenode_for_spec (&expr1->ts));
+ tmp = TYPE_SIZE_UNIT (tmp);
+ size_in_bytes = fold_build2_loc (input_location, MULT_EXPR,
+ TREE_TYPE (tmp), tmp,
+ fold_convert (TREE_TYPE (tmp), size));
+ }
+ else
+ {
+ /* Otherwise use the length in bytes of the rhs. */
+ size = TYPE_SIZE_UNIT (gfc_typenode_for_spec (&expr1->ts));
+ size_in_bytes = size;
+ }
+
+ tmp = build_call_expr_loc (input_location,
+ built_in_decls[BUILT_IN_MALLOC], 1,
+ size_in_bytes);
+ tmp = fold_convert (TREE_TYPE (lse.expr), tmp);
+ gfc_add_modify (block, lse.expr, tmp);
+ if (expr1->ts.type == BT_CHARACTER && expr1->ts.deferred)
+ {
+ /* Deferred characters need checking for lhs and rhs string
+ length. Other deferred parameter variables will have to
+ come here too. */
+ tmp = build1_v (GOTO_EXPR, jump_label2);
+ gfc_add_expr_to_block (block, tmp);
+ }
+ tmp = build1_v (LABEL_EXPR, jump_label1);
+ gfc_add_expr_to_block (block, tmp);
+
+ /* For a deferred length character, reallocate if lengths of lhs and
+ rhs are different. */
+ if (expr1->ts.type == BT_CHARACTER && expr1->ts.deferred)
+ {
+ cond = fold_build2_loc (input_location, EQ_EXPR, boolean_type_node,
+ expr1->ts.u.cl->backend_decl, size);
+ /* Jump past the realloc if the lengths are the same. */
+ tmp = build3_v (COND_EXPR, cond,
+ build1_v (GOTO_EXPR, jump_label2),
+ build_empty_stmt (input_location));
+ gfc_add_expr_to_block (block, tmp);
+ tmp = build_call_expr_loc (input_location,
+ built_in_decls[BUILT_IN_REALLOC], 2,
+ fold_convert (pvoid_type_node, lse.expr),
+ size_in_bytes);
+ tmp = fold_convert (TREE_TYPE (lse.expr), tmp);
+ gfc_add_modify (block, lse.expr, tmp);
+ tmp = build1_v (LABEL_EXPR, jump_label2);
+ gfc_add_expr_to_block (block, tmp);
+
+ /* Update the lhs character length. */
+ size = string_length;
+ gfc_add_modify (block, expr1->ts.u.cl->backend_decl, size);
+ }
+}
+
+
/* Subroutine of gfc_trans_assignment that actually scalarizes the
assignment. EXPR1 is the destination/LHS and EXPR2 is the source/RHS.
init_flag indicates initialization expressions and dealloc that no
@@ -5812,6 +5993,7 @@ gfc_trans_assignment_1 (gfc_expr * expr1, gfc_expr * expr2, bool init_flag,
stmtblock_t body;
bool l_is_temp;
bool scalar_to_array;
+ bool def_clen_func;
tree string_length;
int n;
@@ -5929,6 +6111,19 @@ gfc_trans_assignment_1 (gfc_expr * expr1, gfc_expr * expr2, bool init_flag,
gfc_add_expr_to_block (&loop.post, tmp);
}
+ /* For a deferred character length function, the function call must
+ happen before the (re)allocation of the lhs, otherwise the character
+ length of the result is not known. */
+ def_clen_func = (((expr2->expr_type == EXPR_FUNCTION)
+ || (expr2->expr_type == EXPR_COMPCALL)
+ || (expr2->expr_type == EXPR_PPC))
+ && expr2->ts.deferred);
+ if (gfc_option.flag_realloc_lhs
+ && expr2->ts.type == BT_CHARACTER
+ && (def_clen_func || expr2->expr_type == EXPR_OP)
+ && expr1->ts.deferred)
+ gfc_add_block_to_block (&block, &rse.pre);
+
tmp = gfc_trans_scalar_assign (&lse, &rse, expr1->ts,
l_is_temp || init_flag,
expr_is_variable (expr2) || scalar_to_array,
@@ -5937,6 +6132,12 @@ gfc_trans_assignment_1 (gfc_expr * expr1, gfc_expr * expr2, bool init_flag,
if (lss == gfc_ss_terminator)
{
+ /* F2003: Add the code for reallocation on assignment. */
+ if (gfc_option.flag_realloc_lhs
+ && is_scalar_reallocatable_lhs (expr1))
+ alloc_scalar_allocatable_for_assignment (&block, rse.string_length,
+ expr1, expr2);
+
/* Use the scalar assignment as is. */
gfc_add_block_to_block (&block, &body);
}
@@ -5972,7 +6173,7 @@ gfc_trans_assignment_1 (gfc_expr * expr1, gfc_expr * expr2, bool init_flag,
gfc_add_expr_to_block (&body, tmp);
}
- /* Allocate or reallocate lhs of allocatable array. */
+ /* F2003: Allocate or reallocate lhs of allocatable array. */
if (gfc_option.flag_realloc_lhs
&& gfc_is_reallocatable_lhs (expr1)
&& !gfc_expr_attr (expr1).codimension
@@ -6042,13 +6243,6 @@ gfc_trans_assignment (gfc_expr * expr1, gfc_expr * expr2, bool init_flag,
{
tree tmp;
- if (expr1->ts.type == BT_CHARACTER && expr1->ts.deferred)
- {
- gfc_error ("Assignment to deferred-length character variable at %L "
- "not implemented", &expr1->where);
- return NULL_TREE;
- }
-
/* Special case a single function returning an array. */
if (expr2->expr_type == EXPR_FUNCTION && expr2->rank > 0)
{
@@ -6123,6 +6317,11 @@ gfc_trans_class_init_assign (gfc_code *code)
rhs = gfc_copy_expr (code->expr1);
gfc_add_vptr_component (rhs);
+
+ /* Make sure that the component backend_decls have been built, which
+ will not have happened if the derived types concerned have not
+ been referenced. */
+ gfc_get_derived_type (rhs->ts.u.derived);
gfc_add_def_init_component (rhs);
sz = gfc_copy_expr (code->expr1);
diff --git a/gcc/fortran/trans-io.c b/gcc/fortran/trans-io.c
index 04ad870fb7e..f6a783f38f0 100644
--- a/gcc/fortran/trans-io.c
+++ b/gcc/fortran/trans-io.c
@@ -1463,6 +1463,7 @@ nml_full_name (const char* var_name, const char* cmp_name)
return full_name;
}
+
/* nml_get_addr_expr builds an address expression from the
gfc_symbol or gfc_component backend_decl's. An offset is
provided so that the address of an element of an array of
@@ -1475,9 +1476,6 @@ nml_get_addr_expr (gfc_symbol * sym, gfc_component * c,
{
tree decl = NULL_TREE;
tree tmp;
- tree itmp;
- int array_flagged;
- int dummy_arg_flagged;
if (sym)
{
@@ -1503,18 +1501,8 @@ nml_get_addr_expr (gfc_symbol * sym, gfc_component * c,
/* Build indirect reference, if dummy argument. */
- dummy_arg_flagged = POINTER_TYPE_P (TREE_TYPE(tmp));
-
- itmp = (dummy_arg_flagged) ? build_fold_indirect_ref_loc (input_location,
- tmp) : tmp;
-
- /* If an array, set flag and use indirect ref. if built. */
-
- array_flagged = (TREE_CODE (TREE_TYPE (itmp)) == ARRAY_TYPE
- && !TYPE_STRING_FLAG (TREE_TYPE (itmp)));
-
- if (array_flagged)
- tmp = itmp;
+ if (POINTER_TYPE_P (TREE_TYPE(tmp)))
+ tmp = build_fold_indirect_ref_loc (input_location, tmp);
/* Treat the component of a derived type, using base_addr for
the derived type. */
@@ -1523,29 +1511,27 @@ nml_get_addr_expr (gfc_symbol * sym, gfc_component * c,
tmp = fold_build3_loc (input_location, COMPONENT_REF, TREE_TYPE (tmp),
base_addr, tmp, NULL_TREE);
- /* If we have a derived type component, a reference to the first
- element of the array is built. This is done so that base_addr,
- used in the build of the component reference, always points to
- a RECORD_TYPE. */
-
- if (array_flagged)
- tmp = gfc_build_array_ref (tmp, gfc_index_zero_node, NULL);
-
- /* Now build the address expression. */
-
- tmp = gfc_build_addr_expr (NULL_TREE, tmp);
+ if (GFC_DESCRIPTOR_TYPE_P (TREE_TYPE (tmp)))
+ tmp = gfc_conv_array_data (tmp);
+ else
+ {
+ if (!POINTER_TYPE_P (TREE_TYPE (tmp)))
+ tmp = gfc_build_addr_expr (NULL_TREE, tmp);
- /* If scalar dummy, resolve indirect reference now. */
+ if (TREE_CODE (TREE_TYPE (tmp)) == ARRAY_TYPE)
+ tmp = gfc_build_array_ref (tmp, gfc_index_zero_node, NULL);
- if (dummy_arg_flagged && !array_flagged)
- tmp = build_fold_indirect_ref_loc (input_location,
+ if (!POINTER_TYPE_P (TREE_TYPE (tmp)))
+ tmp = build_fold_indirect_ref_loc (input_location,
tmp);
+ }
gcc_assert (tmp && POINTER_TYPE_P (TREE_TYPE (tmp)));
return tmp;
}
+
/* For an object VAR_NAME whose base address is BASE_ADDR, generate a
call to iocall[IOCALL_SET_NML_VAL]. For derived type variable, recursively
generate calls to iocall[IOCALL_SET_NML_VAL] for each component. */
@@ -1565,6 +1551,7 @@ transfer_namelist_element (stmtblock_t * block, const char * var_name,
tree tmp;
tree dtype;
tree dt_parm_addr;
+ tree decl = NULL_TREE;
int n_dim;
int itype;
int rank = 0;
@@ -1588,7 +1575,10 @@ transfer_namelist_element (stmtblock_t * block, const char * var_name,
if (rank)
{
- dt = TREE_TYPE ((sym) ? sym->backend_decl : c->backend_decl);
+ decl = (sym) ? sym->backend_decl : c->backend_decl;
+ if (sym && sym->attr.dummy)
+ decl = build_fold_indirect_ref_loc (input_location, decl);
+ dt = TREE_TYPE (decl);
dtype = gfc_get_dtype (dt);
}
else
@@ -1622,9 +1612,9 @@ transfer_namelist_element (stmtblock_t * block, const char * var_name,
iocall[IOCALL_SET_NML_VAL_DIM], 5,
dt_parm_addr,
IARG (n_dim),
- GFC_TYPE_ARRAY_STRIDE (dt, n_dim),
- GFC_TYPE_ARRAY_LBOUND (dt, n_dim),
- GFC_TYPE_ARRAY_UBOUND (dt, n_dim));
+ gfc_conv_array_stride (decl, n_dim),
+ gfc_conv_array_lbound (decl, n_dim),
+ gfc_conv_array_ubound (decl, n_dim));
gfc_add_expr_to_block (block, tmp);
}
diff --git a/gcc/fortran/trans-stmt.c b/gcc/fortran/trans-stmt.c
index 8781d0e723c..e1202858bb2 100644
--- a/gcc/fortran/trans-stmt.c
+++ b/gcc/fortran/trans-stmt.c
@@ -1,5 +1,6 @@
/* Statement translation -- generate GCC trees from gfc_code.
- Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
+ Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
+ 2011
Free Software Foundation, Inc.
Contributed by Paul Brook <paul@nowt.org>
and Steven Bosscher <s.bosscher@student.tudelft.nl>
@@ -717,6 +718,7 @@ gfc_trans_if_1 (gfc_code * code)
{
gfc_se if_se;
tree stmt, elsestmt;
+ locus saved_loc;
location_t loc;
/* Check for an unconditional ELSE clause. */
@@ -728,8 +730,17 @@ gfc_trans_if_1 (gfc_code * code)
gfc_start_block (&if_se.pre);
/* Calculate the IF condition expression. */
+ if (code->expr1->where.lb)
+ {
+ gfc_save_backend_locus (&saved_loc);
+ gfc_set_backend_locus (&code->expr1->where);
+ }
+
gfc_conv_expr_val (&if_se, code->expr1);
+ if (code->expr1->where.lb)
+ gfc_restore_backend_locus (&saved_loc);
+
/* Translate the THEN clause. */
stmt = gfc_trans_code (code->next);
@@ -4450,14 +4461,20 @@ gfc_trans_allocate (gfc_code * code)
tree pstat;
tree error_label;
tree memsz;
+ tree expr3;
+ tree slen3;
stmtblock_t block;
+ stmtblock_t post;
+ gfc_expr *sz;
+ gfc_se se_sz;
if (!code->ext.alloc.list)
return NULL_TREE;
pstat = stat = error_label = tmp = memsz = NULL_TREE;
- gfc_start_block (&block);
+ gfc_init_block (&block);
+ gfc_init_block (&post);
/* Either STAT= and/or ERRMSG is present. */
if (code->expr1 || code->expr2)
@@ -4471,6 +4488,9 @@ gfc_trans_allocate (gfc_code * code)
TREE_USED (error_label) = 1;
}
+ expr3 = NULL_TREE;
+ slen3 = NULL_TREE;
+
for (al = code->ext.alloc.list; al != NULL; al = al->next)
{
expr = gfc_copy_expr (al->expr);
@@ -4479,7 +4499,6 @@ gfc_trans_allocate (gfc_code * code)
gfc_add_data_component (expr);
gfc_init_se (&se, NULL);
- gfc_start_block (&se.pre);
se.want_pointer = 1;
se.descriptor_only = 1;
@@ -4494,8 +4513,6 @@ gfc_trans_allocate (gfc_code * code)
{
if (code->expr3->ts.type == BT_CLASS)
{
- gfc_expr *sz;
- gfc_se se_sz;
sz = gfc_copy_expr (code->expr3);
gfc_add_vptr_component (sz);
gfc_add_size_component (sz);
@@ -4507,39 +4524,86 @@ gfc_trans_allocate (gfc_code * code)
else
memsz = TYPE_SIZE_UNIT (gfc_typenode_for_spec (&code->expr3->ts));
}
+ else if (al->expr->ts.type == BT_CHARACTER
+ && al->expr->ts.deferred && code->expr3)
+ {
+ if (!code->expr3->ts.u.cl->backend_decl)
+ {
+ /* Convert and use the length expression. */
+ gfc_init_se (&se_sz, NULL);
+ if (code->expr3->expr_type == EXPR_VARIABLE
+ || code->expr3->expr_type == EXPR_CONSTANT)
+ {
+ gfc_conv_expr (&se_sz, code->expr3);
+ memsz = se_sz.string_length;
+ }
+ else if (code->expr3->mold
+ && code->expr3->ts.u.cl
+ && code->expr3->ts.u.cl->length)
+ {
+ gfc_conv_expr (&se_sz, code->expr3->ts.u.cl->length);
+ gfc_add_block_to_block (&se.pre, &se_sz.pre);
+ se_sz.expr = gfc_evaluate_now (se_sz.expr, &se.pre);
+ gfc_add_block_to_block (&se.pre, &se_sz.post);
+ memsz = se_sz.expr;
+ }
+ else
+ {
+ /* This is would be inefficient and possibly could
+ generate wrong code if the result were not stored
+ in expr3/slen3. */
+ if (slen3 == NULL_TREE)
+ {
+ gfc_conv_expr (&se_sz, code->expr3);
+ gfc_add_block_to_block (&se.pre, &se_sz.pre);
+ expr3 = gfc_evaluate_now (se_sz.expr, &se.pre);
+ gfc_add_block_to_block (&post, &se_sz.post);
+ slen3 = gfc_evaluate_now (se_sz.string_length,
+ &se.pre);
+ }
+ memsz = slen3;
+ }
+ }
+ else
+ /* Otherwise use the stored string length. */
+ memsz = code->expr3->ts.u.cl->backend_decl;
+ tmp = al->expr->ts.u.cl->backend_decl;
+
+ /* Store the string length. */
+ if (tmp && TREE_CODE (tmp) == VAR_DECL)
+ gfc_add_modify (&se.pre, tmp, fold_convert (TREE_TYPE (tmp),
+ memsz));
+
+ /* Convert to size in bytes, using the character KIND. */
+ tmp = TREE_TYPE (gfc_typenode_for_spec (&al->expr->ts));
+ tmp = TYPE_SIZE_UNIT (tmp);
+ memsz = fold_build2_loc (input_location, MULT_EXPR,
+ TREE_TYPE (tmp), tmp,
+ fold_convert (TREE_TYPE (tmp), memsz));
+ }
else if (code->ext.alloc.ts.type != BT_UNKNOWN)
memsz = TYPE_SIZE_UNIT (gfc_typenode_for_spec (&code->ext.alloc.ts));
else
memsz = TYPE_SIZE_UNIT (TREE_TYPE (TREE_TYPE (se.expr)));
if (expr->ts.type == BT_CHARACTER && memsz == NULL_TREE)
- memsz = se.string_length;
+ {
+ memsz = se.string_length;
+
+ /* Convert to size in bytes, using the character KIND. */
+ tmp = TREE_TYPE (gfc_typenode_for_spec (&code->ext.alloc.ts));
+ tmp = TYPE_SIZE_UNIT (tmp);
+ memsz = fold_build2_loc (input_location, MULT_EXPR,
+ TREE_TYPE (tmp), tmp,
+ fold_convert (TREE_TYPE (tmp), memsz));
+ }
/* Allocate - for non-pointers with re-alloc checking. */
- {
- gfc_ref *ref;
- bool allocatable;
-
- ref = expr->ref;
-
- /* Find the last reference in the chain. */
- while (ref && ref->next != NULL)
- {
- gcc_assert (ref->type != REF_ARRAY || ref->u.ar.type == AR_ELEMENT);
- ref = ref->next;
- }
-
- if (!ref)
- allocatable = expr->symtree->n.sym->attr.allocatable;
- else
- allocatable = ref->u.c.component->attr.allocatable;
-
- if (allocatable)
- tmp = gfc_allocate_array_with_status (&se.pre, se.expr, memsz,
- pstat, expr);
- else
- tmp = gfc_allocate_with_status (&se.pre, memsz, pstat);
- }
+ if (gfc_expr_attr (expr).allocatable)
+ tmp = gfc_allocate_array_with_status (&se.pre, se.expr, memsz,
+ pstat, expr);
+ else
+ tmp = gfc_allocate_with_status (&se.pre, memsz, pstat);
tmp = fold_build2_loc (input_location, MODIFY_EXPR, void_type_node,
se.expr,
@@ -4564,11 +4628,9 @@ gfc_trans_allocate (gfc_code * code)
tmp = gfc_nullify_alloc_comp (expr->ts.u.derived, tmp, 0);
gfc_add_expr_to_block (&se.pre, tmp);
}
-
}
- tmp = gfc_finish_block (&se.pre);
- gfc_add_expr_to_block (&block, tmp);
+ gfc_add_block_to_block (&block, &se.pre);
if (code->expr3 && !code->expr3->mold)
{
@@ -4603,9 +4665,23 @@ gfc_trans_allocate (gfc_code * code)
gfc_add_block_to_block (&call.pre, &call.post);
tmp = gfc_finish_block (&call.pre);
}
+ else if (expr3 != NULL_TREE)
+ {
+ tmp = build_fold_indirect_ref_loc (input_location, se.expr);
+ gfc_trans_string_copy (&block, slen3, tmp, code->expr3->ts.kind,
+ slen3, expr3, code->expr3->ts.kind);
+ tmp = NULL_TREE;
+ }
else
- tmp = gfc_trans_assignment (gfc_expr_to_initialize (expr),
- rhs, false, false);
+ {
+ /* Switch off automatic reallocation since we have just done
+ the ALLOCATE. */
+ int realloc_lhs = gfc_option.flag_realloc_lhs;
+ gfc_option.flag_realloc_lhs = 0;
+ tmp = gfc_trans_assignment (gfc_expr_to_initialize (expr),
+ rhs, false, false);
+ gfc_option.flag_realloc_lhs = realloc_lhs;
+ }
gfc_free_expr (rhs);
gfc_add_expr_to_block (&block, tmp);
}
@@ -4727,6 +4803,9 @@ gfc_trans_allocate (gfc_code * code)
gfc_add_expr_to_block (&block, tmp);
}
+ gfc_add_block_to_block (&block, &se.post);
+ gfc_add_block_to_block (&block, &post);
+
return gfc_finish_block (&block);
}
diff --git a/gcc/fortran/trans-types.c b/gcc/fortran/trans-types.c
index 1de7e1e3a12..258685e1017 100644
--- a/gcc/fortran/trans-types.c
+++ b/gcc/fortran/trans-types.c
@@ -1,6 +1,6 @@
/* Backend support for Fortran 95 basic types and derived types.
Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
- 2010
+ 2010, 2011
Free Software Foundation, Inc.
Contributed by Paul Brook <paul@nowt.org>
and Steven Bosscher <s.bosscher@student.tudelft.nl>
@@ -1746,6 +1746,171 @@ gfc_build_pointer_type (gfc_symbol * sym, tree type)
else
return build_pointer_type (type);
}
+
+static tree gfc_nonrestricted_type (tree t);
+/* Given two record or union type nodes TO and FROM, ensure
+ that all fields in FROM have a corresponding field in TO,
+ their type being nonrestrict variants. This accepts a TO
+ node that already has a prefix of the fields in FROM. */
+static void
+mirror_fields (tree to, tree from)
+{
+ tree fto, ffrom;
+ tree *chain;
+
+ /* Forward to the end of TOs fields. */
+ fto = TYPE_FIELDS (to);
+ ffrom = TYPE_FIELDS (from);
+ chain = &TYPE_FIELDS (to);
+ while (fto)
+ {
+ gcc_assert (ffrom && DECL_NAME (fto) == DECL_NAME (ffrom));
+ chain = &DECL_CHAIN (fto);
+ fto = DECL_CHAIN (fto);
+ ffrom = DECL_CHAIN (ffrom);
+ }
+
+ /* Now add all fields remaining in FROM (starting with ffrom). */
+ for (; ffrom; ffrom = DECL_CHAIN (ffrom))
+ {
+ tree newfield = copy_node (ffrom);
+ DECL_CONTEXT (newfield) = to;
+ /* The store to DECL_CHAIN might seem redundant with the
+ stores to *chain, but not clearing it here would mean
+ leaving a chain into the old fields. If ever
+ our called functions would look at them confusion
+ will arise. */
+ DECL_CHAIN (newfield) = NULL_TREE;
+ *chain = newfield;
+ chain = &DECL_CHAIN (newfield);
+
+ if (TREE_CODE (ffrom) == FIELD_DECL)
+ {
+ tree elemtype = gfc_nonrestricted_type (TREE_TYPE (ffrom));
+ TREE_TYPE (newfield) = elemtype;
+ }
+ }
+ *chain = NULL_TREE;
+}
+
+/* Given a type T, returns a different type of the same structure,
+ except that all types it refers to (recursively) are always
+ non-restrict qualified types. */
+static tree
+gfc_nonrestricted_type (tree t)
+{
+ tree ret = t;
+
+ /* If the type isn't layed out yet, don't copy it. If something
+ needs it for real it should wait until the type got finished. */
+ if (!TYPE_SIZE (t))
+ return t;
+
+ if (!TYPE_LANG_SPECIFIC (t))
+ TYPE_LANG_SPECIFIC (t)
+ = ggc_alloc_cleared_lang_type (sizeof (struct lang_type));
+ /* If we're dealing with this very node already further up
+ the call chain (recursion via pointers and struct members)
+ we haven't yet determined if we really need a new type node.
+ Assume we don't, return T itself. */
+ if (TYPE_LANG_SPECIFIC (t)->nonrestricted_type == error_mark_node)
+ return t;
+
+ /* If we have calculated this all already, just return it. */
+ if (TYPE_LANG_SPECIFIC (t)->nonrestricted_type)
+ return TYPE_LANG_SPECIFIC (t)->nonrestricted_type;
+
+ /* Mark this type. */
+ TYPE_LANG_SPECIFIC (t)->nonrestricted_type = error_mark_node;
+
+ switch (TREE_CODE (t))
+ {
+ default:
+ break;
+
+ case POINTER_TYPE:
+ case REFERENCE_TYPE:
+ {
+ tree totype = gfc_nonrestricted_type (TREE_TYPE (t));
+ if (totype == TREE_TYPE (t))
+ ret = t;
+ else if (TREE_CODE (t) == POINTER_TYPE)
+ ret = build_pointer_type (totype);
+ else
+ ret = build_reference_type (totype);
+ ret = build_qualified_type (ret,
+ TYPE_QUALS (t) & ~TYPE_QUAL_RESTRICT);
+ }
+ break;
+
+ case ARRAY_TYPE:
+ {
+ tree elemtype = gfc_nonrestricted_type (TREE_TYPE (t));
+ if (elemtype == TREE_TYPE (t))
+ ret = t;
+ else
+ {
+ ret = build_variant_type_copy (t);
+ TREE_TYPE (ret) = elemtype;
+ if (TYPE_LANG_SPECIFIC (t)
+ && GFC_TYPE_ARRAY_DATAPTR_TYPE (t))
+ {
+ tree dataptr_type = GFC_TYPE_ARRAY_DATAPTR_TYPE (t);
+ dataptr_type = gfc_nonrestricted_type (dataptr_type);
+ if (dataptr_type != GFC_TYPE_ARRAY_DATAPTR_TYPE (t))
+ {
+ TYPE_LANG_SPECIFIC (ret)
+ = ggc_alloc_cleared_lang_type (sizeof (struct
+ lang_type));
+ *TYPE_LANG_SPECIFIC (ret) = *TYPE_LANG_SPECIFIC (t);
+ GFC_TYPE_ARRAY_DATAPTR_TYPE (ret) = dataptr_type;
+ }
+ }
+ }
+ }
+ break;
+
+ case RECORD_TYPE:
+ case UNION_TYPE:
+ case QUAL_UNION_TYPE:
+ {
+ tree field;
+ /* First determine if we need a new type at all.
+ Careful, the two calls to gfc_nonrestricted_type per field
+ might return different values. That happens exactly when
+ one of the fields reaches back to this very record type
+ (via pointers). The first calls will assume that we don't
+ need to copy T (see the error_mark_node marking). If there
+ are any reasons for copying T apart from having to copy T,
+ we'll indeed copy it, and the second calls to
+ gfc_nonrestricted_type will use that new node if they
+ reach back to T. */
+ for (field = TYPE_FIELDS (t); field; field = DECL_CHAIN (field))
+ if (TREE_CODE (field) == FIELD_DECL)
+ {
+ tree elemtype = gfc_nonrestricted_type (TREE_TYPE (field));
+ if (elemtype != TREE_TYPE (field))
+ break;
+ }
+ if (!field)
+ break;
+ ret = build_variant_type_copy (t);
+ TYPE_FIELDS (ret) = NULL_TREE;
+
+ /* Here we make sure that as soon as we know we have to copy
+ T, that also fields reaching back to us will use the new
+ copy. It's okay if that copy still contains the old fields,
+ we won't look at them. */
+ TYPE_LANG_SPECIFIC (t)->nonrestricted_type = ret;
+ mirror_fields (ret, t);
+ }
+ break;
+ }
+
+ TYPE_LANG_SPECIFIC (t)->nonrestricted_type = ret;
+ return ret;
+}
+
/* Return the type for a symbol. Special handling is required for character
types to get the correct level of indirection.
@@ -1796,6 +1961,9 @@ gfc_sym_type (gfc_symbol * sym)
restricted = !sym->attr.target && !sym->attr.pointer
&& !sym->attr.proc_pointer && !sym->attr.cray_pointee;
+ if (!restricted)
+ type = gfc_nonrestricted_type (type);
+
if (sym->attr.dimension)
{
if (gfc_is_nodesc_array (sym))
@@ -1919,7 +2087,7 @@ gfc_add_field_to_struct (tree context, tree name, tree type, tree **chain)
int
gfc_copy_dt_decls_ifequal (gfc_symbol *from, gfc_symbol *to,
- bool from_gsym)
+ bool from_gsym)
{
gfc_component *to_cm;
gfc_component *from_cm;
@@ -1992,7 +2160,6 @@ gfc_get_derived_type (gfc_symbol * derived)
gfc_component *c;
gfc_dt_list *dt;
gfc_namespace *ns;
- gfc_gsymbol *gsym;
gcc_assert (derived && derived->attr.flavor == FL_DERIVED);
@@ -2017,27 +2184,13 @@ gfc_get_derived_type (gfc_symbol * derived)
return derived->backend_decl;
}
-/* If use associated, use the module type for this one. */
+ /* If use associated, use the module type for this one. */
if (gfc_option.flag_whole_file
&& derived->backend_decl == NULL
&& derived->attr.use_assoc
- && derived->module)
- {
- gsym = gfc_find_gsymbol (gfc_gsym_root, derived->module);
- if (gsym && gsym->ns && gsym->type == GSYM_MODULE)
- {
- gfc_symbol *s;
- s = NULL;
- gfc_find_symbol (derived->name, gsym->ns, 0, &s);
- if (s)
- {
- if (!s->backend_decl)
- s->backend_decl = gfc_get_derived_type (s);
- gfc_copy_dt_decls_ifequal (s, derived, true);
- goto copy_derived_types;
- }
- }
- }
+ && derived->module
+ && gfc_get_module_backend_decl (derived))
+ goto copy_derived_types;
/* If a whole file compilation, the derived types from an earlier
namespace can be used as the the canonical type. */
@@ -2352,7 +2505,6 @@ gfc_get_function_type (gfc_symbol * sym)
tree typelist;
gfc_formal_arglist *f;
gfc_symbol *arg;
- int nstr;
int alternate_return;
/* Make sure this symbol is a function, a subroutine or the main
@@ -2363,7 +2515,6 @@ gfc_get_function_type (gfc_symbol * sym)
if (sym->backend_decl)
return TREE_TYPE (sym->backend_decl);
- nstr = 0;
alternate_return = 0;
typelist = NULL_TREE;
@@ -2392,7 +2543,16 @@ gfc_get_function_type (gfc_symbol * sym)
typelist = gfc_chainon_list (typelist, type);
if (arg->ts.type == BT_CHARACTER)
- typelist = gfc_chainon_list (typelist, gfc_charlen_type_node);
+ {
+ if (!arg->ts.deferred)
+ /* Transfer by value. */
+ typelist = gfc_chainon_list (typelist, gfc_charlen_type_node);
+ else
+ /* Deferred character lengths are transferred by reference
+ so that the value can be returned. */
+ typelist = gfc_chainon_list (typelist,
+ build_pointer_type (gfc_charlen_type_node));
+ }
}
/* Build the argument types for the function. */
@@ -2428,8 +2588,7 @@ gfc_get_function_type (gfc_symbol * sym)
Contained procedures could pass by value as these are never
used without an explicit interface, and cannot be passed as
actual parameters for a dummy procedure. */
- if (arg->ts.type == BT_CHARACTER && !sym->attr.is_bind_c)
- nstr++;
+
typelist = gfc_chainon_list (typelist, type);
}
else
@@ -2440,8 +2599,22 @@ gfc_get_function_type (gfc_symbol * sym)
}
/* Add hidden string length parameters. */
- while (nstr--)
- typelist = gfc_chainon_list (typelist, gfc_charlen_type_node);
+ for (f = sym->formal; f; f = f->next)
+ {
+ arg = f->sym;
+ if (arg && arg->ts.type == BT_CHARACTER && !sym->attr.is_bind_c)
+ {
+ if (!arg->ts.deferred)
+ /* Transfer by value. */
+ type = gfc_charlen_type_node;
+ else
+ /* Deferred character lengths are transferred by reference
+ so that the value can be returned. */
+ type = build_pointer_type (gfc_charlen_type_node);
+
+ typelist = gfc_chainon_list (typelist, type);
+ }
+ }
if (typelist)
typelist = chainon (typelist, void_list_node);
diff --git a/gcc/fortran/trans.c b/gcc/fortran/trans.c
index 1fd0dc13013..27a352ab3bd 100644
--- a/gcc/fortran/trans.c
+++ b/gcc/fortran/trans.c
@@ -1090,7 +1090,8 @@ add_expr_to_chain (tree* chain, tree expr, bool front)
*chain = expr;
}
-/* Add a statement to a block. */
+
+/* Add a statement at the end of a block. */
void
gfc_add_expr_to_block (stmtblock_t * block, tree expr)
@@ -1100,6 +1101,16 @@ gfc_add_expr_to_block (stmtblock_t * block, tree expr)
}
+/* Add a statement at the beginning of a block. */
+
+void
+gfc_prepend_expr_to_block (stmtblock_t * block, tree expr)
+{
+ gcc_assert (block);
+ add_expr_to_chain (&block->head, expr, true);
+}
+
+
/* Add a block the end of a block. */
void
diff --git a/gcc/fortran/trans.h b/gcc/fortran/trans.h
index 26ac0039e8d..1536f2e806a 100644
--- a/gcc/fortran/trans.h
+++ b/gcc/fortran/trans.h
@@ -396,6 +396,8 @@ void gfc_trans_vla_type_sizes (gfc_symbol *, stmtblock_t *);
/* Add an expression to the end of a block. */
void gfc_add_expr_to_block (stmtblock_t *, tree);
+/* Add an expression to the beginning of a block. */
+void gfc_prepend_expr_to_block (stmtblock_t *, tree);
/* Add a block to the end of a block. */
void gfc_add_block_to_block (stmtblock_t *, stmtblock_t *);
/* Add a MODIFY_EXPR to a block. */
@@ -444,6 +446,9 @@ void gfc_build_builtin_function_decls (void);
/* Set the backend source location of a decl. */
void gfc_set_decl_location (tree, locus *);
+/* Get a module symbol backend_decl if possible. */
+bool gfc_get_module_backend_decl (gfc_symbol *);
+
/* Return the variable decl for a symbol. */
tree gfc_get_symbol_decl (gfc_symbol *);
@@ -700,6 +705,7 @@ struct GTY((variable_size)) lang_type {
tree dataptr_type;
tree span;
tree base_decl[2];
+ tree nonrestricted_type;
};
struct GTY((variable_size)) lang_decl {
diff --git a/gcc/fwprop.c b/gcc/fwprop.c
index 7ff5135dbb0..b2fd9556bbb 100644
--- a/gcc/fwprop.c
+++ b/gcc/fwprop.c
@@ -1,5 +1,5 @@
/* RTL-based forward propagation pass for GNU compiler.
- Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010
+ Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011
Free Software Foundation, Inc.
Contributed by Paolo Bonzini and Steven Bosscher.
@@ -1315,9 +1315,10 @@ forward_propagate_and_simplify (df_ref use, rtx def_insn, rtx def_set)
/* Given a use USE of an insn, if it has a single reaching
- definition, try to forward propagate it into that insn. */
+ definition, try to forward propagate it into that insn.
+ Return true if cfg cleanup will be needed. */
-static void
+static bool
forward_propagate_into (df_ref use)
{
df_ref def;
@@ -1325,22 +1326,22 @@ forward_propagate_into (df_ref use)
rtx parent;
if (DF_REF_FLAGS (use) & DF_REF_READ_WRITE)
- return;
+ return false;
if (DF_REF_IS_ARTIFICIAL (use))
- return;
+ return false;
/* Only consider uses that have a single definition. */
def = get_def_for_use (use);
if (!def)
- return;
+ return false;
if (DF_REF_FLAGS (def) & DF_REF_READ_WRITE)
- return;
+ return false;
if (DF_REF_IS_ARTIFICIAL (def))
- return;
+ return false;
/* Do not propagate loop invariant definitions inside the loop. */
if (DF_REF_BB (def)->loop_father != DF_REF_BB (use)->loop_father)
- return;
+ return false;
/* Check if the use is still present in the insn! */
use_insn = DF_REF_INSN (use);
@@ -1350,19 +1351,26 @@ forward_propagate_into (df_ref use)
parent = PATTERN (use_insn);
if (!reg_mentioned_p (DF_REF_REG (use), parent))
- return;
+ return false;
def_insn = DF_REF_INSN (def);
if (multiple_sets (def_insn))
- return;
+ return false;
def_set = single_set (def_insn);
if (!def_set)
- return;
+ return false;
/* Only try one kind of propagation. If two are possible, we'll
do it on the following iterations. */
- if (!forward_propagate_and_simplify (use, def_insn, def_set))
- forward_propagate_subreg (use, def_insn, def_set);
+ if (forward_propagate_and_simplify (use, def_insn, def_set)
+ || forward_propagate_subreg (use, def_insn, def_set))
+ {
+ if (cfun->can_throw_non_call_exceptions
+ && find_reg_note (use_insn, REG_EH_REGION, NULL_RTX)
+ && purge_dead_edges (DF_REF_BB (use)))
+ return true;
+ }
+ return false;
}
@@ -1421,6 +1429,7 @@ static unsigned int
fwprop (void)
{
unsigned i;
+ bool need_cleanup = false;
fwprop_init ();
@@ -1438,10 +1447,12 @@ fwprop (void)
|| DF_REF_BB (use)->loop_father == NULL
/* The outer most loop is not really a loop. */
|| loop_outer (DF_REF_BB (use)->loop_father) == NULL)
- forward_propagate_into (use);
+ need_cleanup |= forward_propagate_into (use);
}
fwprop_done ();
+ if (need_cleanup)
+ cleanup_cfg (0);
return 0;
}
@@ -1460,8 +1471,10 @@ struct rtl_opt_pass pass_rtl_fwprop =
0, /* properties_provided */
0, /* properties_destroyed */
0, /* todo_flags_start */
- TODO_df_finish | TODO_verify_rtl_sharing |
- TODO_dump_func /* todo_flags_finish */
+ TODO_df_finish
+ | TODO_verify_flow
+ | TODO_verify_rtl_sharing
+ | TODO_dump_func /* todo_flags_finish */
}
};
@@ -1469,6 +1482,8 @@ static unsigned int
fwprop_addr (void)
{
unsigned i;
+ bool need_cleanup = false;
+
fwprop_init ();
/* Go through all the uses. df_uses_create will create new ones at the
@@ -1481,11 +1496,13 @@ fwprop_addr (void)
&& DF_REF_BB (use)->loop_father != NULL
/* The outer most loop is not really a loop. */
&& loop_outer (DF_REF_BB (use)->loop_father) != NULL)
- forward_propagate_into (use);
+ need_cleanup |= forward_propagate_into (use);
}
fwprop_done ();
+ if (need_cleanup)
+ cleanup_cfg (0);
return 0;
}
diff --git a/gcc/gcc.c b/gcc/gcc.c
index ea3403b5ca9..75f522e1db5 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -644,6 +644,7 @@ proper position among the other output files. */
directories. */
/* We pass any -flto flags on to the linker, which is expected
to understand them. In practice, this means it had better be collect2. */
+/* %{e*} includes -export-dynamic; see comment in common.opt. */
#ifndef LINK_COMMAND_SPEC
#define LINK_COMMAND_SPEC "\
%{!fsyntax-only:%{!c:%{!M:%{!MM:%{!E:%{!S:\
@@ -775,7 +776,7 @@ static const char *cc1_options =
%{coverage:-fprofile-arcs -ftest-coverage}";
static const char *asm_options =
-"%{--target-help:%:print-asm-header()} "
+"%{-target-help:%:print-asm-header()} "
#if HAVE_GNU_AS
/* If GNU AS is used, then convert -w (no warnings), -I, and -v
to the assembler equivalents. */
@@ -949,7 +950,7 @@ static const struct compiler default_compilers[] =
%W{o*:--output-pch=%*}}%V}}}}}}", 0, 0, 0},
{".i", "@cpp-output", 0, 0, 0},
{"@cpp-output",
- "%{!M:%{!MM:%{!E:cc1 -fpreprocessed %i %(cc1_options) %{!fsyntax-only:%(invoke_as)}}}}", 0, 1, 0},
+ "%{!M:%{!MM:%{!E:cc1 -fpreprocessed %i %(cc1_options) %{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0},
{".s", "@assembler", 0, 0, 0},
{"@assembler",
"%{!M:%{!MM:%{!E:%{!S:as %(asm_debug) %(asm_options) %i %A }}}}", 0, 0, 0},
@@ -1375,7 +1376,8 @@ init_spec (void)
"-lgcc_eh"
#ifdef USE_LIBUNWIND_EXCEPTIONS
# ifdef HAVE_LD_STATIC_DYNAMIC
- " %{!static:-Bstatic} -lunwind %{!static:-Bdynamic}"
+ " %{!static:" LD_STATIC_OPTION "} -lunwind"
+ " %{!static:" LD_DYNAMIC_OPTION "}"
# else
" -lunwind"
# endif
@@ -2536,13 +2538,20 @@ execute (void)
}
fputc ('"', stderr);
}
+ /* If it's empty, print "". */
+ else if (!**j)
+ fprintf (stderr, " \"\"");
else
fprintf (stderr, " %s", *j);
}
}
else
for (j = commands[i].argv; *j; j++)
- fprintf (stderr, " %s", *j);
+ /* If it's empty, print "". */
+ if (!**j)
+ fprintf (stderr, " \"\"");
+ else
+ fprintf (stderr, " %s", *j);
/* Print a pipe symbol after all but the last command. */
if (i + 1 != n_commands)
@@ -3329,6 +3338,11 @@ driver_handle_option (struct gcc_options *opts,
save_switch (concat ("-L", arg, NULL), 0, NULL, validated);
return true;
+ case OPT_F:
+ /* Likewise -F. */
+ save_switch (concat ("-F", arg, NULL), 0, NULL, validated);
+ return true;
+
case OPT_save_temps:
save_temps_flag = SAVE_TEMPS_CWD;
validated = true;
@@ -4416,6 +4430,10 @@ do_spec_1 (const char *spec, int inswitch, const char *soft_matched_part)
int i;
int value;
+ /* If it's an empty string argument to a switch, keep it as is. */
+ if (inswitch && !*p)
+ arg_going = 1;
+
while ((c = *p++))
/* If substituting a switch, treat all chars like letters.
Otherwise, NL, SPC, TAB and % are special. */
@@ -5142,7 +5160,8 @@ do_spec_1 (const char *spec, int inswitch, const char *soft_matched_part)
case '*':
if (soft_matched_part)
{
- do_spec_1 (soft_matched_part, 1, NULL);
+ if (soft_matched_part[0])
+ do_spec_1 (soft_matched_part, 1, NULL);
do_spec_1 (" ", 0, NULL);
}
else
@@ -6596,6 +6615,9 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\n"
if (n_infiles == added_libraries)
fatal_error ("no input files");
+ if (seen_error ())
+ goto out;
+
/* Make a place to record the compiler output file names
that correspond to the input files. */
@@ -6863,6 +6885,7 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\n"
printf ("%s\n", bug_report_url);
}
+ out:
return (signal_count != 0 ? 2
: seen_error () ? (pass_exit_codes ? greatest_status : 1)
: 0);
diff --git a/gcc/gcse.c b/gcc/gcse.c
index de56c247def..e337502842c 100644
--- a/gcc/gcse.c
+++ b/gcc/gcse.c
@@ -2737,7 +2737,7 @@ do_local_cprop (rtx x, rtx insn)
|| (GET_CODE (PATTERN (insn)) != USE
&& asm_noperands (PATTERN (insn)) < 0)))
{
- cselib_val *val = cselib_lookup (x, GET_MODE (x), 0);
+ cselib_val *val = cselib_lookup (x, GET_MODE (x), 0, VOIDmode);
struct elt_loc_list *l;
if (!val)
diff --git a/gcc/gimple-fold.c b/gcc/gimple-fold.c
index 042c813647e..abc2273adf8 100644
--- a/gcc/gimple-fold.c
+++ b/gcc/gimple-fold.c
@@ -1443,38 +1443,6 @@ gimple_adjust_this_by_delta (gimple_stmt_iterator *gsi, tree delta)
gimple_call_set_arg (call_stmt, 0, tmp);
}
-/* Fold a call statement to OBJ_TYPE_REF to a direct call, if possible. GSI
- determines the statement, generating new statements is allowed only if
- INPLACE is false. Return true iff the statement was changed. */
-
-static bool
-gimple_fold_obj_type_ref_call (gimple_stmt_iterator *gsi)
-{
- gimple stmt = gsi_stmt (*gsi);
- tree ref = gimple_call_fn (stmt);
- tree obj = OBJ_TYPE_REF_OBJECT (ref);
- tree binfo, fndecl, delta;
- HOST_WIDE_INT token;
-
- if (TREE_CODE (obj) != ADDR_EXPR)
- return false;
- obj = TREE_OPERAND (obj, 0);
- if (!DECL_P (obj)
- || TREE_CODE (TREE_TYPE (obj)) != RECORD_TYPE)
- return false;
- binfo = TYPE_BINFO (TREE_TYPE (obj));
- if (!binfo)
- return false;
-
- token = tree_low_cst (OBJ_TYPE_REF_TOKEN (ref), 1);
- fndecl = gimple_get_virt_mehtod_for_binfo (token, binfo, &delta, false);
- if (!fndecl)
- return false;
- gcc_assert (integer_zerop (delta));
- gimple_call_set_fndecl (stmt, fndecl);
- return true;
-}
-
/* Attempt to fold a call statement referenced by the statement iterator GSI.
The statement may be replaced by another statement, e.g., if the call
simplifies to a constant value. Return true if any changes were made.
@@ -1500,17 +1468,6 @@ gimple_fold_call (gimple_stmt_iterator *gsi, bool inplace)
return true;
}
}
- else
- {
- /* ??? Should perhaps do this in fold proper. However, doing it
- there requires that we create a new CALL_EXPR, and that requires
- copying EH region info to the new node. Easier to just do it
- here where we can just smash the call operand. */
- callee = gimple_call_fn (stmt);
- if (TREE_CODE (callee) == OBJ_TYPE_REF)
- return gimple_fold_obj_type_ref_call (gsi);
- }
-
return false;
}
diff --git a/gcc/gimple-low.c b/gcc/gimple-low.c
index 2c585e30266..67087a0aadc 100644
--- a/gcc/gimple-low.c
+++ b/gcc/gimple-low.c
@@ -148,11 +148,6 @@ lower_function_body (void)
x = gimple_build_label (t.label);
gsi_insert_after (&i, x, GSI_CONTINUE_LINKING);
-
- /* Remove the line number from the representative return statement.
- It now fills in for many such returns. Failure to remove this
- will result in incorrect results for coverage analysis. */
- gimple_set_location (t.stmt, UNKNOWN_LOCATION);
gsi_insert_after (&i, t.stmt, GSI_CONTINUE_LINKING);
}
@@ -746,7 +741,14 @@ lower_gimple_return (gimple_stmt_iterator *gsi, struct lower_data *data)
tmp_rs = *VEC_index (return_statements_t, data->return_statements, i);
if (gimple_return_retval (stmt) == gimple_return_retval (tmp_rs.stmt))
- goto found;
+ {
+ /* Remove the line number from the representative return statement.
+ It now fills in for many such returns. Failure to remove this
+ will result in incorrect results for coverage analysis. */
+ gimple_set_location (tmp_rs.stmt, UNKNOWN_LOCATION);
+
+ goto found;
+ }
}
/* Not found. Create a new label and record the return statement. */
@@ -907,6 +909,8 @@ record_vars_into (tree vars, tree fn)
/* Record the variable. */
add_local_decl (cfun, var);
+ if (gimple_referenced_vars (cfun))
+ add_referenced_var (var);
}
if (fn != current_function_decl)
diff --git a/gcc/gimple-pretty-print.c b/gcc/gimple-pretty-print.c
index cda0d169946..747e8cd404f 100644
--- a/gcc/gimple-pretty-print.c
+++ b/gcc/gimple-pretty-print.c
@@ -542,7 +542,7 @@ pp_points_to_solution (pretty_printer *buffer, struct pt_solution *pt)
pp_string (buffer, "{ ");
EXECUTE_IF_SET_IN_BITMAP (pt->vars, 0, i, bi)
{
- tree var = referenced_var_lookup (i);
+ tree var = referenced_var_lookup (cfun, i);
if (var)
{
dump_generic_node (buffer, var, 0, dump_flags, false);
diff --git a/gcc/ginclude/stddef.h b/gcc/ginclude/stddef.h
index 89e5b2ecc87..565ef7b8f84 100644
--- a/gcc/ginclude/stddef.h
+++ b/gcc/ginclude/stddef.h
@@ -61,8 +61,9 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
/* In 4.3bsd-net2, machine/ansi.h defines these symbols, which are
defined if the corresponding type is *not* defined.
- FreeBSD-2.1 defines _MACHINE_ANSI_H_ instead of _ANSI_H_ */
-#if defined(_ANSI_H_) || defined(_MACHINE_ANSI_H_)
+ FreeBSD-2.1 defines _MACHINE_ANSI_H_ instead of _ANSI_H_.
+ NetBSD defines _I386_ANSI_H_ and _X86_64_ANSI_H_ instead of _ANSI_H_ */
+#if defined(_ANSI_H_) || defined(_MACHINE_ANSI_H_) || defined(_X86_64_ANSI_H_) || defined(_I386_ANSI_H_)
#if !defined(_SIZE_T_) && !defined(_BSD_SIZE_T_)
#define _SIZE_T
#endif
@@ -89,7 +90,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#undef _WCHAR_T_
#undef _BSD_WCHAR_T_
#endif
-#endif /* defined(_ANSI_H_) || defined(_MACHINE_ANSI_H_) */
+#endif /* defined(_ANSI_H_) || defined(_MACHINE_ANSI_H_) || defined(_X86_64_ANSI_H_) || defined(_I386_ANSI_H_) */
/* Sequent's header files use _PTRDIFF_T_ in some conflicting way.
Just ignore it. */
@@ -357,7 +358,8 @@ typedef __WINT_TYPE__ wint_t;
/* In 4.3bsd-net2, leave these undefined to indicate that size_t, etc.
are already defined. */
/* BSD/OS 3.1 and FreeBSD [23].x require the MACHINE_ANSI_H check here. */
-#if defined(_ANSI_H_) || defined(_MACHINE_ANSI_H_)
+/* NetBSD 5 requires the I386_ANSI_H and X86_64_ANSI_H checks here. */
+#if defined(_ANSI_H_) || defined(_MACHINE_ANSI_H_) || defined(_X86_64_ANSI_H_) || defined(_I386_ANSI_H_)
/* The references to _GCC_PTRDIFF_T_, _GCC_SIZE_T_, and _GCC_WCHAR_T_
are probably typos and should be removed before 2.8 is released. */
#ifdef _GCC_PTRDIFF_T_
@@ -385,7 +387,7 @@ typedef __WINT_TYPE__ wint_t;
#undef _WCHAR_T_
#undef _BSD_WCHAR_T_
#endif
-#endif /* _ANSI_H_ || _MACHINE_ANSI_H_ */
+#endif /* _ANSI_H_ || _MACHINE_ANSI_H_ || _X86_64_ANSI_H_ || _I386_ANSI_H_ */
#endif /* __sys_stdtypes_h */
diff --git a/gcc/go/ChangeLog b/gcc/go/ChangeLog
index 6354ce5ea12..979247a71bc 100644
--- a/gcc/go/ChangeLog
+++ b/gcc/go/ChangeLog
@@ -1,3 +1,19 @@
+2011-02-08 Ian Lance Taylor <iant@google.com>
+
+ * go-lang.c (go_langhook_init_options_struct): Set
+ frontend_set_flag_errno_math. Don't set x_flag_trapping_math.
+
+2011-01-31 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * gospec.c (lang_specific_driver) [HAVE_LD_STATIC_DYNAMIC] Use
+ LD_STATIC_OPTION, LD_DYNAMIC_OPTION.
+
+2011-01-21 Ian Lance Taylor <iant@google.com>
+
+ * go-lang.c (go_langhook_init): Omit float_type_size when calling
+ go_create_gogo.
+ * go-c.h: Update declaration of go_create_gogo.
+
2011-01-13 Ian Lance Taylor <iant@google.com>
* go-backend.c: Include "rtl.h" and "target.h".
diff --git a/gcc/go/gccgo.texi b/gcc/go/gccgo.texi
index b6f8910a8db..dc8b0225a23 100644
--- a/gcc/go/gccgo.texi
+++ b/gcc/go/gccgo.texi
@@ -88,7 +88,7 @@ package documentation, see @uref{http://golang.org/}.
How you can share and copy this manual.
* Invoking gccgo:: How to run gccgo.
* Import and Export:: Importing and exporting package data.
-* C Interoperability:: Calling C from Go and vice-vera.
+* C Interoperability:: Calling C from Go and vice-versa.
* Index:: Index.
@end menu
@@ -186,7 +186,7 @@ export information will be stored directly in the object file. When a
package is imported, @command{gccgo} must be able to find the file.
@cindex @file{.gox}
-When Go code imports the package @file{gopackage}, @command{gccgo}
+When Go code imports the package @file{@var{gopackage}}, @command{gccgo}
will look for the import data using the following filenames, using the
first one that it finds.
diff --git a/gcc/go/go-c.h b/gcc/go/go-c.h
index a45151783cd..1c7a3b1f0c6 100644
--- a/gcc/go/go-c.h
+++ b/gcc/go/go-c.h
@@ -41,8 +41,7 @@ extern void go_set_prefix (const char*);
extern void go_add_search_path (const char*);
-extern void go_create_gogo (int int_type_size, int float_type_size,
- int pointer_size);
+extern void go_create_gogo (int int_type_size, int pointer_size);
extern void go_parse_input_files (const char**, unsigned int,
bool only_check_syntax,
diff --git a/gcc/go/go-lang.c b/gcc/go/go-lang.c
index 323f8c5331c..b59e72dd700 100644
--- a/gcc/go/go-lang.c
+++ b/gcc/go/go-lang.c
@@ -1,5 +1,5 @@
/* go-lang.c -- Go frontend gcc interface.
- Copyright (C) 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 2009, 2010, 2011 Free Software Foundation, Inc.
This file is part of GCC.
@@ -103,7 +103,7 @@ go_langhook_init (void)
to, e.g., unsigned_char_type_node) but before calling
build_common_builtin_nodes (because it calls, indirectly,
go_type_for_size). */
- go_create_gogo (INT_TYPE_SIZE, FLOAT_TYPE_SIZE, POINTER_SIZE);
+ go_create_gogo (INT_TYPE_SIZE, POINTER_SIZE);
build_common_builtin_nodes ();
@@ -149,9 +149,7 @@ go_langhook_init_options_struct (struct gcc_options *opts)
/* The builtin math functions should not set errno. */
opts->x_flag_errno_math = 0;
-
- /* By default assume that floating point math does not trap. */
- opts->x_flag_trapping_math = 0;
+ opts->frontend_set_flag_errno_math = true;
/* We turn on stack splitting if we can. */
if (targetm.supports_split_stack (false, opts))
diff --git a/gcc/go/gofrontend/export.cc b/gcc/go/gofrontend/export.cc
index 6b42d0c4930..cbf24b84025 100644
--- a/gcc/go/gofrontend/export.cc
+++ b/gcc/go/gofrontend/export.cc
@@ -345,8 +345,6 @@ Export::register_builtin_types(Gogo* gogo)
this->register_builtin_type(gogo, "int", BUILTIN_INT);
this->register_builtin_type(gogo, "uint", BUILTIN_UINT);
this->register_builtin_type(gogo, "uintptr", BUILTIN_UINTPTR);
- this->register_builtin_type(gogo, "float", BUILTIN_FLOAT);
- this->register_builtin_type(gogo, "complex", BUILTIN_COMPLEX);
this->register_builtin_type(gogo, "bool", BUILTIN_BOOL);
this->register_builtin_type(gogo, "string", BUILTIN_STRING);
}
diff --git a/gcc/go/gofrontend/export.h b/gcc/go/gofrontend/export.h
index 90c2465a5e5..4a1fd2b6424 100644
--- a/gcc/go/gofrontend/export.h
+++ b/gcc/go/gofrontend/export.h
@@ -33,14 +33,12 @@ enum Builtin_code
BUILTIN_INT = -11,
BUILTIN_UINT = -12,
BUILTIN_UINTPTR = -13,
- BUILTIN_FLOAT = -14,
BUILTIN_BOOL = -15,
BUILTIN_STRING = -16,
BUILTIN_COMPLEX64 = -17,
BUILTIN_COMPLEX128 = -18,
- BUILTIN_COMPLEX = -19,
- SMALLEST_BUILTIN_CODE = -19
+ SMALLEST_BUILTIN_CODE = -18
};
// This class manages exporting Go declarations. It handles the main
diff --git a/gcc/go/gofrontend/expressions.cc b/gcc/go/gofrontend/expressions.cc
index 6fa1b9961cd..cebcbca7a07 100644
--- a/gcc/go/gofrontend/expressions.cc
+++ b/gcc/go/gofrontend/expressions.cc
@@ -362,6 +362,8 @@ Expression::convert_type_to_interface(Translate_context* context,
first_field_value = fold_convert_loc(location, const_ptr_type_node,
method_table);
}
+ if (first_field_value == error_mark_node)
+ return error_mark_node;
// Start building a constructor for the value we will return.
@@ -716,7 +718,11 @@ Expression::float_constant_tree(mpfr_t val, tree type)
tree
Expression::complex_constant_tree(mpfr_t real, mpfr_t imag, tree type)
{
- if (TREE_CODE(type) == COMPLEX_TYPE)
+ if (type == error_mark_node)
+ return error_mark_node;
+ else if (TREE_CODE(type) == INTEGER_TYPE || TREE_CODE(type) == REAL_TYPE)
+ return Expression::float_constant_tree(real, type);
+ else if (TREE_CODE(type) == COMPLEX_TYPE)
{
REAL_VALUE_TYPE r1;
real_from_mpfr(&r1, real, TREE_TYPE(type), GMP_RNDN);
@@ -1932,7 +1938,7 @@ Float_expression::do_determine_type(const Type_context* context)
|| context->type->complex_type() != NULL))
this->type_ = context->type;
else if (!context->may_be_abstract)
- this->type_ = Type::lookup_float_type("float");
+ this->type_ = Type::lookup_float_type("float64");
}
// Return true if the floating point value VAL fits in the range of
@@ -2185,7 +2191,7 @@ Complex_expression::do_determine_type(const Type_context* context)
&& context->type->complex_type() != NULL)
this->type_ = context->type;
else if (!context->may_be_abstract)
- this->type_ = Type::lookup_complex_type("complex");
+ this->type_ = Type::lookup_complex_type("complex128");
}
// Return true if the complex value REAL/IMAG fits in the range of the
@@ -2353,6 +2359,9 @@ class Const_expression : public Expression
check_for_init_loop();
protected:
+ int
+ do_traverse(Traverse*);
+
Expression*
do_lower(Gogo*, Named_object*, int);
@@ -2408,6 +2417,16 @@ class Const_expression : public Expression
mutable bool seen_;
};
+// Traversal.
+
+int
+Const_expression::do_traverse(Traverse* traverse)
+{
+ if (this->type_ != NULL)
+ return Type::traverse(this->type_, traverse);
+ return TRAVERSE_CONTINUE;
+}
+
// Lower a constant expression. This is where we convert the
// predeclared constant iota into an integer value.
@@ -4430,7 +4449,7 @@ Binary_expression::eval_integer(Operator op, Type* left_type, mpz_t left_val,
case OPERATOR_LSHIFT:
{
unsigned long shift = mpz_get_ui(right_val);
- if (mpz_cmp_ui(right_val, shift) != 0)
+ if (mpz_cmp_ui(right_val, shift) != 0 || shift > 0x100000)
{
error_at(location, "shift count overflow");
mpz_set_ui(val, 0);
@@ -5159,7 +5178,7 @@ Binary_expression::do_lower(Gogo*, Named_object*, int)
{
// May be a type error--let it be diagnosed later.
}
- else if (is_comparison)
+ else if (op == OPERATOR_EQEQ || op == OPERATOR_NOTEQ)
{
bool b = Binary_expression::compare_complex(op,
(left_type != NULL
@@ -5412,6 +5431,9 @@ Binary_expression::do_discarding_value()
Type*
Binary_expression::do_type()
{
+ if (this->classification() == EXPRESSION_ERROR)
+ return Type::make_error_type();
+
switch (this->op_)
{
case OPERATOR_OROR:
@@ -5440,6 +5462,11 @@ Binary_expression::do_type()
return left_type;
else if (right_type->is_error_type())
return right_type;
+ else if (!Type::are_compatible_for_binop(left_type, right_type))
+ {
+ this->report_error(_("incompatible types in binary expression"));
+ return Type::make_error_type();
+ }
else if (!left_type->is_abstract() && left_type->named_type() != NULL)
return left_type;
else if (!right_type->is_abstract() && right_type->named_type() != NULL)
@@ -5536,6 +5563,9 @@ Binary_expression::do_determine_type(const Type_context* context)
subcontext.type = tright;
else
subcontext.type = tleft;
+
+ if (subcontext.type != NULL && !context->may_be_abstract)
+ subcontext.type = subcontext.type->make_non_abstract_type();
}
this->left_->determine_type(&subcontext);
@@ -5664,6 +5694,9 @@ Binary_expression::check_operator_type(Operator op, Type* type,
void
Binary_expression::do_check_types(Gogo*)
{
+ if (this->classification() == EXPRESSION_ERROR)
+ return;
+
Type* left_type = this->left_->type();
Type* right_type = this->right_->type();
if (left_type->is_error_type() || right_type->is_error_type())
@@ -5841,13 +5874,21 @@ Binary_expression::do_get_tree(Translate_context* context)
tree eval_saved = NULL_TREE;
if (is_shift_op)
{
- if (!DECL_P(left))
- left = save_expr(left);
- if (!DECL_P(right))
- right = save_expr(right);
// Make sure the values are evaluated.
- eval_saved = fold_build2_loc(this->location(), COMPOUND_EXPR,
- void_type_node, left, right);
+ if (!DECL_P(left) && TREE_SIDE_EFFECTS(left))
+ {
+ left = save_expr(left);
+ eval_saved = left;
+ }
+ if (!DECL_P(right) && TREE_SIDE_EFFECTS(right))
+ {
+ right = save_expr(right);
+ if (eval_saved == NULL_TREE)
+ eval_saved = right;
+ else
+ eval_saved = fold_build2_loc(this->location(), COMPOUND_EXPR,
+ void_type_node, eval_saved, right);
+ }
}
tree ret = fold_build2_loc(this->location(),
@@ -5896,8 +5937,9 @@ Binary_expression::do_get_tree(Translate_context* context)
ret = fold_build3_loc(this->location(), COND_EXPR, TREE_TYPE(left),
compare, ret, overflow_result);
- ret = fold_build2_loc(this->location(), COMPOUND_EXPR,
- TREE_TYPE(ret), eval_saved, ret);
+ if (eval_saved != NULL_TREE)
+ ret = fold_build2_loc(this->location(), COMPOUND_EXPR,
+ TREE_TYPE(ret), eval_saved, ret);
}
return ret;
@@ -6243,9 +6285,9 @@ Expression::comparison_tree(Translate_context* context, Operator op,
else if (left_type->interface_type() != NULL
&& right_type->interface_type() != NULL)
{
- if (left_type->interface_type()->is_empty())
+ if (left_type->interface_type()->is_empty()
+ && right_type->interface_type()->is_empty())
{
- gcc_assert(right_type->interface_type()->is_empty());
static tree empty_interface_compare_decl;
left_tree = Gogo::call_builtin(&empty_interface_compare_decl,
location,
@@ -6261,9 +6303,9 @@ Expression::comparison_tree(Translate_context* context, Operator op,
// This can panic if the type is uncomparable.
TREE_NOTHROW(empty_interface_compare_decl) = 0;
}
- else
+ else if (!left_type->interface_type()->is_empty()
+ && !right_type->interface_type()->is_empty())
{
- gcc_assert(!right_type->interface_type()->is_empty());
static tree interface_compare_decl;
left_tree = Gogo::call_builtin(&interface_compare_decl,
location,
@@ -6279,6 +6321,32 @@ Expression::comparison_tree(Translate_context* context, Operator op,
// This can panic if the type is uncomparable.
TREE_NOTHROW(interface_compare_decl) = 0;
}
+ else
+ {
+ if (left_type->interface_type()->is_empty())
+ {
+ gcc_assert(op == OPERATOR_EQEQ || op == OPERATOR_NOTEQ);
+ std::swap(left_type, right_type);
+ std::swap(left_tree, right_tree);
+ }
+ gcc_assert(!left_type->interface_type()->is_empty());
+ gcc_assert(right_type->interface_type()->is_empty());
+ static tree interface_empty_compare_decl;
+ left_tree = Gogo::call_builtin(&interface_empty_compare_decl,
+ location,
+ "__go_interface_empty_compare",
+ 2,
+ integer_type_node,
+ TREE_TYPE(left_tree),
+ left_tree,
+ TREE_TYPE(right_tree),
+ right_tree);
+ if (left_tree == error_mark_node)
+ return error_mark_node;
+ // This can panic if the type is uncomparable.
+ TREE_NOTHROW(interface_empty_compare_decl) = 0;
+ }
+
right_tree = build_int_cst_type(integer_type_node, 0);
}
@@ -6394,7 +6462,8 @@ Bound_method_expression::do_check_types(Gogo*)
tree
Bound_method_expression::do_get_tree(Translate_context*)
{
- gcc_unreachable();
+ error_at(this->location(), "reference to method other than calling it");
+ return error_mark_node;
}
// Make a method expression.
@@ -6473,7 +6542,7 @@ class Builtin_call_expression : public Call_expression
BUILTIN_CAP,
BUILTIN_CLOSE,
BUILTIN_CLOSED,
- BUILTIN_CMPLX,
+ BUILTIN_COMPLEX,
BUILTIN_COPY,
BUILTIN_IMAG,
BUILTIN_LEN,
@@ -6501,7 +6570,7 @@ class Builtin_call_expression : public Call_expression
real_imag_type(Type*);
static Type*
- cmplx_type(Type*);
+ complex_type(Type*);
// A pointer back to the general IR structure. This avoids a global
// variable, or passing it around everywhere.
@@ -6532,8 +6601,8 @@ Builtin_call_expression::Builtin_call_expression(Gogo* gogo,
this->code_ = BUILTIN_CLOSE;
else if (name == "closed")
this->code_ = BUILTIN_CLOSED;
- else if (name == "cmplx")
- this->code_ = BUILTIN_CMPLX;
+ else if (name == "complex")
+ this->code_ = BUILTIN_COMPLEX;
else if (name == "copy")
this->code_ = BUILTIN_COPY;
else if (name == "imag")
@@ -6774,9 +6843,7 @@ Builtin_call_expression::real_imag_type(Type* arg_type)
return NULL;
while (nt->real_type()->named_type() != NULL)
nt = nt->real_type()->named_type();
- if (nt->name() == "complex")
- return Type::lookup_float_type("float");
- else if (nt->name() == "complex64")
+ if (nt->name() == "complex64")
return Type::lookup_float_type("float32");
else if (nt->name() == "complex128")
return Type::lookup_float_type("float64");
@@ -6784,11 +6851,11 @@ Builtin_call_expression::real_imag_type(Type* arg_type)
return NULL;
}
-// Return the type of the cmplx function, given the type of one of the
+// Return the type of the complex function, given the type of one of the
// argments. Like real_imag_type, we have to map by name.
Type*
-Builtin_call_expression::cmplx_type(Type* arg_type)
+Builtin_call_expression::complex_type(Type* arg_type)
{
if (arg_type == NULL || arg_type->is_abstract())
return NULL;
@@ -6797,9 +6864,7 @@ Builtin_call_expression::cmplx_type(Type* arg_type)
return NULL;
while (nt->real_type()->named_type() != NULL)
nt = nt->real_type()->named_type();
- if (nt->name() == "float")
- return Type::lookup_complex_type("complex");
- else if (nt->name() == "float32")
+ if (nt->name() == "float32")
return Type::lookup_complex_type("complex64");
else if (nt->name() == "float64")
return Type::lookup_complex_type("complex128");
@@ -6868,7 +6933,7 @@ Builtin_call_expression::do_is_constant() const
return arg->field_reference_expression() != NULL;
}
- case BUILTIN_CMPLX:
+ case BUILTIN_COMPLEX:
{
const Expression_list* args = this->args();
if (args != NULL && args->size() == 2)
@@ -6949,6 +7014,8 @@ Builtin_call_expression::do_integer_constant_value(bool iota_is_constant,
if (arg_type->is_abstract())
return false;
tree arg_type_tree = arg_type->get_tree(this->gogo_);
+ if (arg_type_tree == error_mark_node)
+ return false;
unsigned long val_long;
if (this->code_ == BUILTIN_SIZEOF)
{
@@ -7053,7 +7120,7 @@ bool
Builtin_call_expression::do_complex_constant_value(mpfr_t real, mpfr_t imag,
Type** ptype) const
{
- if (this->code_ == BUILTIN_CMPLX)
+ if (this->code_ == BUILTIN_COMPLEX)
{
const Expression_list* args = this->args();
if (args == NULL || args->size() != 2)
@@ -7078,7 +7145,7 @@ Builtin_call_expression::do_complex_constant_value(mpfr_t real, mpfr_t imag,
{
mpfr_set(real, r, GMP_RNDN);
mpfr_set(imag, i, GMP_RNDN);
- *ptype = Builtin_call_expression::cmplx_type(rtype);
+ *ptype = Builtin_call_expression::complex_type(rtype);
ret = true;
}
@@ -7154,7 +7221,7 @@ Builtin_call_expression::do_type()
return t;
}
- case BUILTIN_CMPLX:
+ case BUILTIN_COMPLEX:
{
const Expression_list* args = this->args();
if (args == NULL || args->size() != 2)
@@ -7166,7 +7233,7 @@ Builtin_call_expression::do_type()
if (t->is_abstract())
t = t->make_non_abstract_type();
}
- t = Builtin_call_expression::cmplx_type(t);
+ t = Builtin_call_expression::complex_type(t);
if (t == NULL)
t = Type::make_error_type();
return t;
@@ -7195,13 +7262,13 @@ Builtin_call_expression::do_determine_type(const Type_context* context)
case BUILTIN_REAL:
case BUILTIN_IMAG:
- arg_type = Builtin_call_expression::cmplx_type(context->type);
+ arg_type = Builtin_call_expression::complex_type(context->type);
is_print = false;
break;
- case BUILTIN_CMPLX:
+ case BUILTIN_COMPLEX:
{
- // For the cmplx function the type of one operand can
+ // For the complex function the type of one operand can
// determine the type of the other, as in a binary expression.
arg_type = Builtin_call_expression::real_imag_type(context->type);
if (args != NULL && args->size() == 2)
@@ -7498,7 +7565,7 @@ Builtin_call_expression::do_check_types(Gogo*)
}
break;
- case BUILTIN_CMPLX:
+ case BUILTIN_COMPLEX:
{
const Expression_list* args = this->args();
if (args == NULL || args->size() < 2)
@@ -7512,9 +7579,9 @@ Builtin_call_expression::do_check_types(Gogo*)
this->set_is_error();
else if (!Type::are_identical(args->front()->type(),
args->back()->type(), true, NULL))
- this->report_error(_("cmplx arguments must have identical types"));
+ this->report_error(_("complex arguments must have identical types"));
else if (args->front()->type()->float_type() == NULL)
- this->report_error(_("cmplx arguments must have "
+ this->report_error(_("complex arguments must have "
"floating-point type"));
}
break;
@@ -7913,7 +7980,11 @@ Builtin_call_expression::do_get_tree(Translate_context* context)
mpz_init(val);
Type* dummy;
bool b = this->integer_constant_value(true, val, &dummy);
- gcc_assert(b);
+ if (!b)
+ {
+ gcc_assert(saw_errors());
+ return error_mark_node;
+ }
tree type = Type::lookup_integer_type("int")->get_tree(gogo);
tree ret = Expression::integer_constant_tree(val, type);
mpz_clear(val);
@@ -8077,7 +8148,7 @@ Builtin_call_expression::do_get_tree(Translate_context* context)
arg_tree);
}
- case BUILTIN_CMPLX:
+ case BUILTIN_COMPLEX:
{
const Expression_list* args = this->args();
gcc_assert(args != NULL && args->size() == 2);
@@ -8210,8 +8281,9 @@ Call_expression::do_lower(Gogo* gogo, Named_object* function, int)
for (size_t i = 0; i < rc; ++i)
args->push_back(Expression::make_call_result(call, i));
// We can't return a new call expression here, because this
- // one may be referenced by Call_result expressions. FIXME.
- delete this->args_;
+ // one may be referenced by Call_result expressions. We
+ // also can't delete the old arguments, because we may still
+ // traverse them somewhere up the call stack. FIXME.
this->args_ = args;
}
}
@@ -8289,11 +8361,6 @@ Call_expression::lower_varargs(Gogo* gogo, Named_object* function,
this->report_error(_("too many arguments"));
return this;
}
- else if (pa + 1 == old_args->end()
- && this->is_compatible_varargs_argument(function, *pa,
- varargs_type,
- &issued_error))
- new_args->push_back(*pa);
else
{
Type* element_type = varargs_type->array_type()->element_type();
@@ -8331,84 +8398,6 @@ Call_expression::lower_varargs(Gogo* gogo, Named_object* function,
return ret;
}
-// Return true if ARG is a varargs argment which should be passed to
-// the varargs parameter of type PARAM_TYPE without wrapping. ARG
-// will be the last argument passed in the call, and PARAM_TYPE will
-// be the type of the last parameter of the varargs function being
-// called.
-
-bool
-Call_expression::is_compatible_varargs_argument(Named_object* function,
- Expression* arg,
- Type* param_type,
- bool* issued_error)
-{
- *issued_error = false;
-
- Type* var_type = NULL;
-
- // The simple case is passing the varargs parameter of the caller.
- Var_expression* ve = arg->var_expression();
- if (ve != NULL && ve->named_object()->is_variable())
- {
- Variable* var = ve->named_object()->var_value();
- if (var->is_varargs_parameter())
- var_type = var->type();
- }
-
- // The complex case is passing the varargs parameter of some
- // enclosing function. This will look like passing down *c.f where
- // c is the closure variable and f is a field in the closure.
- if (function != NULL
- && function->func_value()->needs_closure()
- && arg->classification() == EXPRESSION_UNARY)
- {
- Unary_expression* ue = static_cast<Unary_expression*>(arg);
- if (ue->op() == OPERATOR_MULT)
- {
- Field_reference_expression* fre =
- ue->operand()->deref()->field_reference_expression();
- if (fre != NULL)
- {
- Var_expression* ve = fre->expr()->deref()->var_expression();
- if (ve != NULL)
- {
- Named_object* no = ve->named_object();
- Function* f = function->func_value();
- if (no == f->closure_var())
- {
- // At this point we know that this indeed a
- // reference to some enclosing variable. Now we
- // need to figure out whether that variable is a
- // varargs parameter.
- Named_object* enclosing =
- f->enclosing_var(fre->field_index());
- Variable* var = enclosing->var_value();
- if (var->is_varargs_parameter())
- var_type = var->type();
- }
- }
- }
- }
- }
-
- if (var_type == NULL)
- return false;
-
- // We only match if the parameter is the same, with an identical
- // type.
- Array_type* var_at = var_type->array_type();
- gcc_assert(var_at != NULL);
- Array_type* param_at = param_type->array_type();
- if (param_at != NULL
- && Type::are_identical(var_at->element_type(),
- param_at->element_type(), true, NULL))
- return true;
- error_at(arg->location(), "... mismatch: passing ...T as ...");
- *issued_error = true;
- return false;
-}
-
// Get the function type. Returns NULL if we don't know the type. If
// this returns NULL, and if_ERROR is true, issues an error.
@@ -9065,6 +9054,11 @@ Index_expression::do_lower(Gogo*, Named_object*, int)
Type* type = left->type();
if (type->is_error_type())
return Expression::make_error(location);
+ else if (left->is_type_expression())
+ {
+ error_at(location, "attempt to index type expression");
+ return Expression::make_error(location);
+ }
else if (type->array_type() != NULL)
return Expression::make_array_index(left, start, end, location);
else if (type->points_to() != NULL
@@ -9214,10 +9208,9 @@ void
Array_index_expression::do_determine_type(const Type_context*)
{
this->array_->determine_type_no_context();
- Type_context subcontext(NULL, true);
- this->start_->determine_type(&subcontext);
+ this->start_->determine_type_no_context();
if (this->end_ != NULL)
- this->end_->determine_type(&subcontext);
+ this->end_->determine_type_no_context();
}
// Check types of an array index.
@@ -9594,10 +9587,9 @@ void
String_index_expression::do_determine_type(const Type_context*)
{
this->string_->determine_type_no_context();
- Type_context subcontext(NULL, true);
- this->start_->determine_type(&subcontext);
+ this->start_->determine_type_no_context();
if (this->end_ != NULL)
- this->end_->determine_type(&subcontext);
+ this->end_->determine_type_no_context();
}
// Check types of a string index.
@@ -9897,12 +9889,39 @@ Map_index_expression::get_value_pointer(Translate_context* context,
// We need to pass in a pointer to the key, so stuff it into a
// variable.
- tree tmp = create_tmp_var(TREE_TYPE(index_tree), get_name(index_tree));
- DECL_IGNORED_P(tmp) = 0;
- DECL_INITIAL(tmp) = index_tree;
- tree make_tmp = build1(DECL_EXPR, void_type_node, tmp);
- tree tmpref = fold_convert(const_ptr_type_node, build_fold_addr_expr(tmp));
- TREE_ADDRESSABLE(tmp) = 1;
+ tree tmp;
+ tree make_tmp;
+ if (current_function_decl != NULL)
+ {
+ tmp = create_tmp_var(TREE_TYPE(index_tree), get_name(index_tree));
+ DECL_IGNORED_P(tmp) = 0;
+ DECL_INITIAL(tmp) = index_tree;
+ make_tmp = build1(DECL_EXPR, void_type_node, tmp);
+ TREE_ADDRESSABLE(tmp) = 1;
+ }
+ else
+ {
+ tmp = build_decl(this->location(), VAR_DECL, create_tmp_var_name("M"),
+ TREE_TYPE(index_tree));
+ DECL_EXTERNAL(tmp) = 0;
+ TREE_PUBLIC(tmp) = 0;
+ TREE_STATIC(tmp) = 1;
+ DECL_ARTIFICIAL(tmp) = 1;
+ if (!TREE_CONSTANT(index_tree))
+ make_tmp = fold_build2_loc(this->location(), INIT_EXPR, void_type_node,
+ tmp, index_tree);
+ else
+ {
+ TREE_READONLY(tmp) = 1;
+ TREE_CONSTANT(tmp) = 1;
+ DECL_INITIAL(tmp) = index_tree;
+ make_tmp = NULL_TREE;
+ }
+ rest_of_decl_compilation(tmp, 1, 0);
+ }
+ tree tmpref = fold_convert_loc(this->location(), const_ptr_type_node,
+ build_fold_addr_expr_loc(this->location(),
+ tmp));
static tree map_index_fndecl;
tree call = Gogo::call_builtin(&map_index_fndecl,
@@ -9929,9 +9948,10 @@ Map_index_expression::get_value_pointer(Translate_context* context,
return error_mark_node;
tree ptr_val_type_tree = build_pointer_type(val_type_tree);
- return build2(COMPOUND_EXPR, ptr_val_type_tree,
- make_tmp,
- fold_convert(ptr_val_type_tree, call));
+ tree ret = fold_convert_loc(this->location(), ptr_val_type_tree, call);
+ if (make_tmp != NULL_TREE)
+ ret = build2(COMPOUND_EXPR, ptr_val_type_tree, make_tmp, ret);
+ return ret;
}
// Make a map index expression.
@@ -9950,7 +9970,10 @@ Expression::make_map_index(Expression* map, Expression* index,
Type*
Field_reference_expression::do_type()
{
- Struct_type* struct_type = this->expr_->type()->struct_type();
+ Type* type = this->expr_->type();
+ if (type->is_error_type())
+ return type;
+ Struct_type* struct_type = type->struct_type();
gcc_assert(struct_type != NULL);
return struct_type->field(this->field_index_)->type();
}
@@ -9960,7 +9983,10 @@ Field_reference_expression::do_type()
void
Field_reference_expression::do_check_types(Gogo*)
{
- Struct_type* struct_type = this->expr_->type()->struct_type();
+ Type* type = this->expr_->type();
+ if (type->is_error_type())
+ return;
+ Struct_type* struct_type = type->struct_type();
gcc_assert(struct_type != NULL);
gcc_assert(struct_type->field(this->field_index_) != NULL);
}
@@ -10309,7 +10335,14 @@ Selector_expression::lower_method_expression(Gogo* gogo)
gcc_assert(vno != NULL);
Expression* ve = Expression::make_var_reference(vno, location);
Expression* bm = Type::bind_field_or_method(gogo, nt, ve, name, location);
- gcc_assert(bm != NULL && !bm->is_error_expression());
+
+ // Even though we found the method above, if it has an error type we
+ // may see an error here.
+ if (bm->is_error_expression())
+ {
+ gogo->finish_function(location);
+ return bm;
+ }
Expression_list* args;
if (method_parameters == NULL)
@@ -11142,7 +11175,15 @@ Open_array_construction_expression::do_get_tree(Translate_context* context)
return error_mark_node;
bool is_constant_initializer = TREE_CONSTANT(values);
- bool is_in_function = context->function() != NULL;
+
+ // We have to copy the initial values into heap memory if we are in
+ // a function or if the values are not constants. We also have to
+ // copy them if they may contain pointers in a non-constant context,
+ // as otherwise the garbage collector won't see them.
+ bool copy_to_heap = (context->function() != NULL
+ || !is_constant_initializer
+ || (element_type->has_pointer()
+ && !context->is_const()));
if (is_constant_initializer)
{
@@ -11152,12 +11193,12 @@ Open_array_construction_expression::do_get_tree(Translate_context* context)
TREE_PUBLIC(tmp) = 0;
TREE_STATIC(tmp) = 1;
DECL_ARTIFICIAL(tmp) = 1;
- if (is_in_function)
+ if (copy_to_heap)
{
- // If this is not a function, we will only initialize the
- // value once, so we can use this directly rather than
- // copying it. In that case we can't make it read-only,
- // because the program is permitted to change it.
+ // If we are not copying the value to the heap, we will only
+ // initialize the value once, so we can use this directly
+ // rather than copying it. In that case we can't make it
+ // read-only, because the program is permitted to change it.
TREE_READONLY(tmp) = 1;
TREE_CONSTANT(tmp) = 1;
}
@@ -11168,10 +11209,9 @@ Open_array_construction_expression::do_get_tree(Translate_context* context)
tree space;
tree set;
- if (!is_in_function && is_constant_initializer)
+ if (!copy_to_heap)
{
- // Outside of a function, we know the initializer will only run
- // once.
+ // the initializer will only run once.
space = build_fold_addr_expr(values);
set = NULL_TREE;
}
@@ -11218,7 +11258,7 @@ Open_array_construction_expression::do_get_tree(Translate_context* context)
tree constructor = build_constructor(type_tree, init);
if (constructor == error_mark_node)
return error_mark_node;
- if (!is_in_function && is_constant_initializer)
+ if (!copy_to_heap)
TREE_CONSTANT(constructor) = 1;
if (set == NULL_TREE)
@@ -12225,7 +12265,11 @@ tree
Receive_expression::do_get_tree(Translate_context* context)
{
Channel_type* channel_type = this->channel_->type()->channel_type();
- gcc_assert(channel_type != NULL);
+ if (channel_type == NULL)
+ {
+ gcc_assert(this->channel_->type()->is_error_type());
+ return error_mark_node;
+ }
Type* element_type = channel_type->element_type();
tree element_type_tree = element_type->get_tree(context->gogo());
diff --git a/gcc/go/gofrontend/expressions.h b/gcc/go/gofrontend/expressions.h
index fe4ade2c99d..c050a4a9c0c 100644
--- a/gcc/go/gofrontend/expressions.h
+++ b/gcc/go/gofrontend/expressions.h
@@ -1265,9 +1265,6 @@ class Call_expression : public Expression
private:
bool
- is_compatible_varargs_argument(Named_object*, Expression*, Type*, bool*);
-
- bool
check_argument_type(int, const Type*, const Type*, source_location, bool);
tree
diff --git a/gcc/go/gofrontend/go.cc b/gcc/go/gofrontend/go.cc
index c756084a1dc..2f30fd804b6 100644
--- a/gcc/go/gofrontend/go.cc
+++ b/gcc/go/gofrontend/go.cc
@@ -24,10 +24,10 @@ static Gogo* gogo;
GO_EXTERN_C
void
-go_create_gogo(int int_type_size, int float_type_size, int pointer_size)
+go_create_gogo(int int_type_size, int pointer_size)
{
gcc_assert(::gogo == NULL);
- ::gogo = new Gogo(int_type_size, float_type_size, pointer_size);
+ ::gogo = new Gogo(int_type_size, pointer_size);
if (!unique_prefix.empty())
::gogo->set_unique_prefix(unique_prefix);
}
diff --git a/gcc/go/gofrontend/gogo-tree.cc b/gcc/go/gofrontend/gogo-tree.cc
index ccd17c64edb..3228c42ec3b 100644
--- a/gcc/go/gofrontend/gogo-tree.cc
+++ b/gcc/go/gofrontend/gogo-tree.cc
@@ -161,7 +161,7 @@ Gogo::get_init_fn_name()
if (this->init_fn_name_.empty())
{
gcc_assert(this->package_ != NULL);
- if (this->package_name() == "main")
+ if (this->is_main_package())
{
// Use a name which the runtime knows.
this->init_fn_name_ = "__go_init_main";
@@ -186,7 +186,7 @@ Gogo::get_init_fn_name()
void
Gogo::init_imports(tree* init_stmt_list)
{
- gcc_assert(this->package_name() == "main");
+ gcc_assert(this->is_main_package());
if (this->imported_init_fns_.empty())
return;
@@ -384,7 +384,7 @@ Gogo::write_initialization_function(tree fndecl, tree init_stmt_list)
{
// Make sure that we thought we needed an initialization function,
// as otherwise we will not have reported it in the export data.
- gcc_assert(this->package_name() == "main" || this->need_init_fn_);
+ gcc_assert(this->is_main_package() || this->need_init_fn_);
if (fndecl == NULL_TREE)
fndecl = this->initialization_function_decl();
@@ -648,7 +648,7 @@ Gogo::write_globals()
tree init_fndecl = NULL_TREE;
tree init_stmt_list = NULL_TREE;
- if (this->package_name() == "main")
+ if (this->is_main_package())
this->init_imports(&init_stmt_list);
// A list of variable initializations.
@@ -804,7 +804,7 @@ Gogo::write_globals()
// This will be called if this package is imported.
if (init_stmt_list != NULL_TREE
|| this->need_init_fn_
- || this->package_name() == "main")
+ || this->is_main_package())
this->write_initialization_function(init_fndecl, init_stmt_list);
// Pass everything back to the middle-end.
@@ -1252,14 +1252,15 @@ Function::get_or_make_decl(Gogo* gogo, Named_object* no, tree id)
this->fndecl_ = decl;
- gcc_assert(no->package() == NULL);
- if (this->enclosing_ != NULL || Gogo::is_thunk(no))
+ if (no->package() != NULL)
+ ;
+ else if (this->enclosing_ != NULL || Gogo::is_thunk(no))
;
else if (Gogo::unpack_hidden_name(no->name()) == "init"
&& !this->type_->is_method())
;
else if (Gogo::unpack_hidden_name(no->name()) == "main"
- && gogo->package_name() == "main")
+ && gogo->is_main_package())
TREE_PUBLIC(decl) = 1;
// Methods have to be public even if they are hidden because
// they can be pulled into type descriptors when using
@@ -2633,26 +2634,14 @@ Gogo::build_type_descriptor_decl(const Type* type, Expression* initializer,
DECL_INITIAL(decl) = constructor;
- if (type_descriptor_location == TYPE_DESCRIPTOR_COMMON)
+ if (type_descriptor_location == TYPE_DESCRIPTOR_DEFINED)
+ TREE_PUBLIC(decl) = 1;
+ else
{
+ gcc_assert(type_descriptor_location == TYPE_DESCRIPTOR_COMMON);
make_decl_one_only(decl, DECL_ASSEMBLER_NAME(decl));
resolve_unique_section(decl, 1, 0);
}
- else
- {
-#ifdef OBJECT_FORMAT_ELF
- // Give the decl protected visibility. This avoids out-of-range
- // references with shared libraries with the x86_64 small model
- // when the type descriptor gets a COPY reloc into the main
- // executable. There is no need to have unique pointers to type
- // descriptors, as the runtime code compares reflection strings
- // if necessary.
- DECL_VISIBILITY(decl) = VISIBILITY_PROTECTED;
- DECL_VISIBILITY_SPECIFIED(decl) = 1;
-#endif
-
- TREE_PUBLIC(decl) = 1;
- }
rest_of_decl_compilation(decl, 1, 0);
}
@@ -2764,17 +2753,7 @@ Gogo::interface_method_table_for_type(const Interface_type* interface,
// definition of the table. Otherwise it is a comdat table which
// may be defined in multiple packages.
if (has_hidden_methods)
- {
-#ifdef OBJECT_FORMAT_ELF
- // Give the decl protected visibility. This avoids out-of-range
- // references with shared libraries with the x86_64 small model
- // when the table gets a COPY reloc into the main executable.
- DECL_VISIBILITY(decl) = VISIBILITY_PROTECTED;
- DECL_VISIBILITY_SPECIFIED(decl) = 1;
-#endif
-
- TREE_PUBLIC(decl) = 1;
- }
+ TREE_PUBLIC(decl) = 1;
else
{
make_decl_one_only(decl, DECL_ASSEMBLER_NAME(decl));
diff --git a/gcc/go/gofrontend/gogo.cc b/gcc/go/gofrontend/gogo.cc
index 8e67074941c..a63abfefde3 100644
--- a/gcc/go/gofrontend/gogo.cc
+++ b/gcc/go/gofrontend/gogo.cc
@@ -19,7 +19,7 @@
// Class Gogo.
-Gogo::Gogo(int int_type_size, int float_type_size, int pointer_size)
+Gogo::Gogo(int int_type_size, int pointer_size)
: package_(NULL),
functions_(),
globals_(new Bindings(NULL)),
@@ -33,6 +33,7 @@ Gogo::Gogo(int int_type_size, int float_type_size, int pointer_size)
init_fn_name_(),
imported_init_fns_(),
unique_prefix_(),
+ unique_prefix_specified_(false),
interface_types_()
{
const source_location loc = BUILTINS_LOCATION;
@@ -86,12 +87,6 @@ Gogo::Gogo(int int_type_size, int float_type_size, int pointer_size)
pointer_size,
RUNTIME_TYPE_KIND_UINTPTR));
- this->add_named_type(Type::make_float_type("float", float_type_size,
- RUNTIME_TYPE_KIND_FLOAT));
-
- this->add_named_type(Type::make_complex_type("complex", float_type_size * 2,
- RUNTIME_TYPE_KIND_COMPLEX));
-
this->add_named_type(Type::make_named_bool_type());
this->add_named_type(Type::make_named_string_type());
@@ -199,10 +194,10 @@ Gogo::Gogo(int int_type_size, int float_type_size, int pointer_size)
append_type->set_is_builtin();
this->globals_->add_function_declaration("append", NULL, append_type, loc);
- Function_type* cmplx_type = Type::make_function_type(NULL, NULL, NULL, loc);
- cmplx_type->set_is_varargs();
- cmplx_type->set_is_builtin();
- this->globals_->add_function_declaration("cmplx", NULL, cmplx_type, loc);
+ Function_type* complex_type = Type::make_function_type(NULL, NULL, NULL, loc);
+ complex_type->set_is_varargs();
+ complex_type->set_is_builtin();
+ this->globals_->add_function_declaration("complex", NULL, complex_type, loc);
Function_type* real_type = Type::make_function_type(NULL, NULL, NULL, loc);
real_type->set_is_varargs();
@@ -212,7 +207,7 @@ Gogo::Gogo(int int_type_size, int float_type_size, int pointer_size)
Function_type* imag_type = Type::make_function_type(NULL, NULL, NULL, loc);
imag_type->set_is_varargs();
imag_type->set_is_builtin();
- this->globals_->add_function_declaration("imag", NULL, cmplx_type, loc);
+ this->globals_->add_function_declaration("imag", NULL, imag_type, loc);
this->define_builtin_function_trees();
@@ -265,7 +260,7 @@ Gogo::set_package_name(const std::string& package_name,
// package name (e.g., P.x), but we no longer do.
// this->globals_->add_package(package_name, this->package_);
- if (package_name == "main")
+ if (this->is_main_package())
{
// Declare "main" as a function which takes no parameters and
// returns no value.
@@ -276,6 +271,15 @@ Gogo::set_package_name(const std::string& package_name,
}
}
+// Return whether this is the "main" package. This is not true if
+// -fgo-prefix was used.
+
+bool
+Gogo::is_main_package() const
+{
+ return this->package_name() == "main" && !this->unique_prefix_specified_;
+}
+
// Import a package.
void
@@ -678,10 +682,15 @@ Gogo::start_function(const std::string& name, Function_type* type,
else if (!type->is_method())
{
ret = this->package_->bindings()->add_function(*pname, NULL, function);
- if (!ret->is_function())
+ if (!ret->is_function() || ret->func_value() != function)
{
- // Redefinition error.
- ret = Named_object::make_function(name, NULL, function);
+ // Redefinition error. Invent a name to avoid knockon
+ // errors.
+ static int redefinition_count;
+ char buf[30];
+ snprintf(buf, sizeof buf, ".$redefined%d", redefinition_count);
+ ++redefinition_count;
+ ret = this->package_->bindings()->add_function(buf, NULL, function);
}
}
else
@@ -1135,7 +1144,8 @@ class Lower_parse_tree : public Traverse
{
public:
Lower_parse_tree(Gogo* gogo, Named_object* function)
- : Traverse(traverse_constants
+ : Traverse(traverse_variables
+ | traverse_constants
| traverse_functions
| traverse_statements
| traverse_expressions),
@@ -1143,6 +1153,9 @@ class Lower_parse_tree : public Traverse
{ }
int
+ variable(Named_object*);
+
+ int
constant(Named_object*, bool);
int
@@ -1163,6 +1176,18 @@ class Lower_parse_tree : public Traverse
int iota_value_;
};
+// Lower variables. We handle variables specially to break loops in
+// which a variable initialization expression refers to itself. The
+// loop breaking is in lower_init_expression.
+
+int
+Lower_parse_tree::variable(Named_object* no)
+{
+ if (no->is_variable())
+ no->var_value()->lower_init_expression(this->gogo_, this->function_);
+ return TRAVERSE_CONTINUE;
+}
+
// Lower constants. We handle constants specially so that we can set
// the right value for the predeclared constant iota. This works in
// conjunction with the way we lower Const_expression objects.
@@ -2180,10 +2205,14 @@ Build_recover_thunks::function(Named_object* orig_no)
const std::string& new_receiver_name(orig_fntype->receiver()->name());
Named_object* new_rec_no = new_bindings->lookup_local(new_receiver_name);
- gcc_assert(new_rec_no != NULL
- && new_rec_no->is_variable()
- && new_rec_no->var_value()->is_receiver());
- new_rec_no->var_value()->set_is_not_receiver();
+ if (new_rec_no == NULL)
+ gcc_assert(saw_errors());
+ else
+ {
+ gcc_assert(new_rec_no->is_variable()
+ && new_rec_no->var_value()->is_receiver());
+ new_rec_no->var_value()->set_is_not_receiver();
+ }
}
// Because we flipped blocks but not types, the can_recover
@@ -2452,6 +2481,7 @@ Gogo::set_unique_prefix(const std::string& arg)
{
gcc_assert(this->unique_prefix_.empty());
this->unique_prefix_ = arg;
+ this->unique_prefix_specified_ = true;
}
// Work out the package priority. It is one more than the maximum
@@ -2483,7 +2513,7 @@ Gogo::do_exports()
exp.export_globals(this->package_name(),
this->unique_prefix(),
this->package_priority(),
- (this->need_init_fn_ && this->package_name() != "main"
+ (this->need_init_fn_ && !this->is_main_package()
? this->get_init_fn_name()
: ""),
this->imported_init_fns_,
@@ -2532,7 +2562,8 @@ Function::create_named_result_variables(Gogo* gogo)
}
Result_variable* result = new Result_variable(p->type(), this, index);
Named_object* no = block->bindings()->add_result_variable(name, result);
- this->named_results_->push_back(no);
+ if (no->is_result_variable())
+ this->named_results_->push_back(no);
}
}
@@ -3352,6 +3383,9 @@ Variable::type() const
void
Variable::determine_type()
{
+ if (this->preinit_ != NULL)
+ this->preinit_->determine_types();
+
// A variable in a type switch with a nil case will have the wrong
// type here. It will have an initializer which is a type guard.
// We want to initialize it to the value without the type guard, and
diff --git a/gcc/go/gofrontend/gogo.h b/gcc/go/gofrontend/gogo.h
index 0a822c58cd0..57928d6600b 100644
--- a/gcc/go/gofrontend/gogo.h
+++ b/gcc/go/gofrontend/gogo.h
@@ -100,9 +100,9 @@ operator<(const Import_init& i1, const Import_init& i2)
class Gogo
{
public:
- // Create the IR, passing in the sizes of the types "int", "float",
- // and "uintptr" in bits.
- Gogo(int int_type_size, int float_type_size, int pointer_size);
+ // Create the IR, passing in the sizes of the types "int" and
+ // "uintptr" in bits.
+ Gogo(int int_type_size, int pointer_size);
// Get the package name.
const std::string&
@@ -112,6 +112,10 @@ class Gogo
void
set_package_name(const std::string&, source_location);
+ // Return whether this is the "main" package.
+ bool
+ is_main_package() const;
+
// If necessary, adjust the name to use for a hidden symbol. We add
// a prefix of the package name, so that hidden symbols in different
// packages do not collide.
@@ -653,6 +657,8 @@ class Gogo
std::set<Import_init> imported_init_fns_;
// The unique prefix used for all global symbols.
std::string unique_prefix_;
+ // Whether an explicit unique prefix was set by -fgo-prefix.
+ bool unique_prefix_specified_;
// A list of interface types defined while parsing.
std::vector<Interface_type*> interface_types_;
};
diff --git a/gcc/go/gofrontend/import.cc b/gcc/go/gofrontend/import.cc
index ec27aba4d66..d926edf4480 100644
--- a/gcc/go/gofrontend/import.cc
+++ b/gcc/go/gofrontend/import.cc
@@ -704,8 +704,6 @@ Import::register_builtin_types(Gogo* gogo)
this->register_builtin_type(gogo, "int", BUILTIN_INT);
this->register_builtin_type(gogo, "uint", BUILTIN_UINT);
this->register_builtin_type(gogo, "uintptr", BUILTIN_UINTPTR);
- this->register_builtin_type(gogo, "float", BUILTIN_FLOAT);
- this->register_builtin_type(gogo, "complex", BUILTIN_COMPLEX);
this->register_builtin_type(gogo, "bool", BUILTIN_BOOL);
this->register_builtin_type(gogo, "string", BUILTIN_STRING);
}
diff --git a/gcc/go/gofrontend/parse.cc b/gcc/go/gofrontend/parse.cc
index 53414ebcb09..ab6021d0b2c 100644
--- a/gcc/go/gofrontend/parse.cc
+++ b/gcc/go/gofrontend/parse.cc
@@ -1848,7 +1848,13 @@ Parse::init_var(const Typed_identifier& tid, Type* type, Expression* init,
*is_new = true;
Variable* var = new Variable(type, init, this->gogo_->in_global_scope(),
false, false, location);
- return this->gogo_->add_variable(tid.name(), var);
+ Named_object* no = this->gogo_->add_variable(tid.name(), var);
+ if (!no->is_variable())
+ {
+ // The name is already defined, so we just gave an error.
+ return this->gogo_->add_sink();
+ }
+ return no;
}
// Create a dummy global variable to force an initializer to be run in
@@ -1859,6 +1865,8 @@ Named_object*
Parse::create_dummy_global(Type* type, Expression* init,
source_location location)
{
+ if (type == NULL && init == NULL)
+ type = Type::lookup_bool_type();
Variable* var = new Variable(type, init, true, false, false, location);
static int count;
char buf[30];
@@ -3791,11 +3799,14 @@ Parse::switch_stat(const Label* label)
// This must be a TypeSwitchGuard.
switch_val = this->simple_stat(false, true, NULL,
&type_switch);
- if (!type_switch.found
- && !switch_val->is_error_expression())
+ if (!type_switch.found)
{
- error_at(id_loc, "expected type switch assignment");
- switch_val = Expression::make_error(id_loc);
+ if (switch_val == NULL
+ || !switch_val->is_error_expression())
+ {
+ error_at(id_loc, "expected type switch assignment");
+ switch_val = Expression::make_error(id_loc);
+ }
}
}
}
@@ -4192,6 +4203,12 @@ Parse::comm_clause(Select_clauses* clauses, bool* saw_default)
if (got_case)
clauses->add(is_send, channel, val, var, is_default, statements, location);
+ else if (statements != NULL)
+ {
+ // Add the statements to make sure that any names they define
+ // are traversed.
+ this->gogo_->add_block(statements, location);
+ }
}
// CommCase = ( "default" | ( "case" ( SendExpr | RecvExpr) ) ) ":" .
diff --git a/gcc/go/gofrontend/statements.cc b/gcc/go/gofrontend/statements.cc
index c0efc2dca4f..c87574dff1c 100644
--- a/gcc/go/gofrontend/statements.cc
+++ b/gcc/go/gofrontend/statements.cc
@@ -318,6 +318,9 @@ Temporary_statement::get_decl() const
int
Temporary_statement::do_traverse(Traverse* traverse)
{
+ if (this->type_ != NULL
+ && this->traverse_type(traverse, this->type_) == TRAVERSE_EXIT)
+ return TRAVERSE_EXIT;
if (this->init_ == NULL)
return TRAVERSE_CONTINUE;
else
@@ -1776,8 +1779,10 @@ Thunk_statement::do_determine_types()
// Now that we know the types of the call, build the struct used to
// pass parameters.
- Function_type* fntype =
- this->call_->call_expression()->get_function_type();
+ Call_expression* ce = this->call_->call_expression();
+ if (ce == NULL)
+ return;
+ Function_type* fntype = ce->get_function_type();
if (fntype != NULL && !this->is_simple(fntype))
this->struct_type_ = this->build_struct(fntype);
}
@@ -1788,6 +1793,12 @@ void
Thunk_statement::do_check_types(Gogo*)
{
Call_expression* ce = this->call_->call_expression();
+ if (ce == NULL)
+ {
+ if (!this->call_->is_error_expression())
+ this->report_error("expected call expression");
+ return;
+ }
Function_type* fntype = ce->get_function_type();
if (fntype != NULL && fntype->is_method())
{
@@ -2207,6 +2218,8 @@ Thunk_statement::build_thunk(Gogo* gogo, const std::string& thunk_name,
Struct_field_list::const_iterator p = fields->begin();
for (unsigned int i = 0; i < next_index; ++i)
++p;
+ bool is_recover_call = ce->is_recover_call();
+ Expression* recover_arg = NULL;
for (; p != fields->end(); ++p, ++next_index)
{
Expression* thunk_param = Expression::make_var_reference(named_parameter,
@@ -2216,19 +2229,28 @@ Thunk_statement::build_thunk(Gogo* gogo, const std::string& thunk_name,
Expression* param = Expression::make_field_reference(thunk_param,
next_index,
location);
- call_params->push_back(param);
+ if (!is_recover_call)
+ call_params->push_back(param);
+ else
+ {
+ gcc_assert(call_params->empty());
+ recover_arg = param;
+ }
+ }
+
+ if (call_params->empty())
+ {
+ delete call_params;
+ call_params = NULL;
}
Expression* call = Expression::make_call(func_to_call, call_params, false,
location);
// We need to lower in case this is a builtin function.
call = call->lower(gogo, function, -1);
- if (may_call_recover)
- {
- Call_expression* ce = call->call_expression();
- if (ce != NULL)
- ce->set_is_deferred();
- }
+ Call_expression* call_ce = call->call_expression();
+ if (call_ce != NULL && may_call_recover)
+ call_ce->set_is_deferred();
Statement* call_statement = Statement::make_statement(call);
@@ -2236,6 +2258,12 @@ Thunk_statement::build_thunk(Gogo* gogo, const std::string& thunk_name,
// just for this statement now.
call_statement->determine_types();
+ // Sanity check.
+ call->check_types(gogo);
+
+ if (call_ce != NULL && recover_arg != NULL)
+ call_ce->set_recover_arg(recover_arg);
+
gogo->add_statement(call_statement);
// If this is a defer statement, the label comes immediately after
@@ -2984,7 +3012,9 @@ If_statement::do_may_fall_through() const
tree
If_statement::do_get_tree(Translate_context* context)
{
- gcc_assert(this->cond_ == NULL || this->cond_->type()->is_boolean_type());
+ gcc_assert(this->cond_ == NULL
+ || this->cond_->type()->is_boolean_type()
+ || this->cond_->type()->is_error_type());
tree cond_tree = (this->cond_ == NULL
? boolean_true_node
: this->cond_->get_tree(context));
@@ -3185,7 +3215,12 @@ Case_clauses::Case_clause::get_constant_tree(Translate_context* context,
mpz_t ival;
mpz_init(ival);
if (!(*p)->integer_constant_value(true, ival, &itype))
- gcc_unreachable();
+ {
+ // Something went wrong. This can happen with a
+ // negative constant and an unsigned switch value.
+ gcc_assert(saw_errors());
+ continue;
+ }
gcc_assert(itype != NULL);
tree type_tree = itype->get_tree(context->gogo());
tree val = Expression::integer_constant_tree(ival, type_tree);
@@ -3870,10 +3905,17 @@ Type_switch_statement::do_lower(Gogo*, Block* enclosing)
{
// Doing a type switch on a non-interface type. Should we issue
// a warning for this case?
- // descriptor_temp = DESCRIPTOR
Expression* lhs = Expression::make_temporary_reference(descriptor_temp,
loc);
- Expression* rhs = Expression::make_type_descriptor(val_type, loc);
+ Expression* rhs;
+ if (val_type->is_nil_type())
+ rhs = Expression::make_nil(loc);
+ else
+ {
+ if (val_type->is_abstract())
+ val_type = val_type->make_non_abstract_type();
+ rhs = Expression::make_type_descriptor(val_type, loc);
+ }
Statement* s = Statement::make_assignment(lhs, rhs, loc);
b->add_statement(s);
}
diff --git a/gcc/go/gofrontend/types.cc b/gcc/go/gofrontend/types.cc
index 418e8a84d9f..3e149b93734 100644
--- a/gcc/go/gofrontend/types.cc
+++ b/gcc/go/gofrontend/types.cc
@@ -194,9 +194,9 @@ Type::make_non_abstract_type()
case TYPE_INTEGER:
return Type::lookup_integer_type("int");
case TYPE_FLOAT:
- return Type::lookup_float_type("float");
+ return Type::lookup_float_type("float64");
case TYPE_COMPLEX:
- return Type::lookup_complex_type("complex");
+ return Type::lookup_complex_type("complex128");
case TYPE_STRING:
return Type::lookup_string_type();
case TYPE_BOOLEAN:
@@ -1872,8 +1872,7 @@ Float_type::create_abstract_float_type()
{
static Float_type* abstract_type;
if (abstract_type == NULL)
- abstract_type = new Float_type(true, FLOAT_TYPE_SIZE,
- RUNTIME_TYPE_KIND_FLOAT);
+ abstract_type = new Float_type(true, 64, RUNTIME_TYPE_KIND_FLOAT64);
return abstract_type;
}
@@ -2029,8 +2028,7 @@ Complex_type::create_abstract_complex_type()
{
static Complex_type* abstract_type;
if (abstract_type == NULL)
- abstract_type = new Complex_type(true, FLOAT_TYPE_SIZE * 2,
- RUNTIME_TYPE_KIND_FLOAT);
+ abstract_type = new Complex_type(true, 128, RUNTIME_TYPE_KIND_COMPLEX128);
return abstract_type;
}
@@ -3585,7 +3583,8 @@ Struct_type::field_reference(Expression* struct_expr, const std::string& name,
source_location location) const
{
unsigned int depth;
- return this->field_reference_depth(struct_expr, name, location, &depth);
+ return this->field_reference_depth(struct_expr, name, location, NULL,
+ &depth);
}
// Return an expression for a field, along with the depth at which it
@@ -3595,6 +3594,7 @@ Field_reference_expression*
Struct_type::field_reference_depth(Expression* struct_expr,
const std::string& name,
source_location location,
+ Saw_named_type* saw,
unsigned int* depth) const
{
const Struct_field_list* fields = this->fields_;
@@ -3630,13 +3630,41 @@ Struct_type::field_reference_depth(Expression* struct_expr,
if (st == NULL)
continue;
+ Saw_named_type* hold_saw = saw;
+ Saw_named_type saw_here;
+ Named_type* nt = pf->type()->named_type();
+ if (nt == NULL)
+ nt = pf->type()->deref()->named_type();
+ if (nt != NULL)
+ {
+ Saw_named_type* q;
+ for (q = saw; q != NULL; q = q->next)
+ {
+ if (q->nt == nt)
+ {
+ // If this is an error, it will be reported
+ // elsewhere.
+ break;
+ }
+ }
+ if (q != NULL)
+ continue;
+ saw_here.next = saw;
+ saw_here.nt = nt;
+ saw = &saw_here;
+ }
+
// Look for a reference using a NULL struct expression. If we
// find one, fill in the struct expression with a reference to
// this field.
unsigned int subdepth;
Field_reference_expression* sub = st->field_reference_depth(NULL, name,
location,
+ saw,
&subdepth);
+
+ saw = hold_saw;
+
if (sub == NULL)
continue;
@@ -3765,7 +3793,7 @@ Struct_type::fill_in_tree(Gogo* gogo, tree type)
// Don't follow pointers yet, so that we don't get confused by a
// pointer to an array of this struct type.
tree field_type_tree;
- if (p->type()->points_to() != NULL)
+ if (p->type()->points_to() != NULL || p->type()->function_type() != NULL)
{
field_type_tree = ptr_type_node;
has_pointer = true;
@@ -3795,7 +3823,8 @@ Struct_type::fill_in_tree(Gogo* gogo, tree type)
p != this->fields_->end();
++p, field = DECL_CHAIN(field))
{
- if (p->type()->points_to() != NULL)
+ if (p->type()->points_to() != NULL
+ || p->type()->function_type() != NULL)
TREE_TYPE(field) = p->type()->get_tree(gogo);
}
}
@@ -4258,6 +4287,10 @@ Array_type::verify_length()
{
if (this->length_ == NULL)
return true;
+
+ Type_context context(Type::lookup_integer_type("int"), false);
+ this->length_->determine_type(&context);
+
if (!this->length_->is_constant())
{
error_at(this->length_->location(), "array bound is not constant");
@@ -4265,30 +4298,23 @@ Array_type::verify_length()
}
mpz_t val;
-
- Type* t = this->length_->type();
- if (t->integer_type() != NULL)
- {
- Type* vt;
- mpz_init(val);
- if (!this->length_->integer_constant_value(true, val, &vt))
- {
- error_at(this->length_->location(),
- "array bound is not constant");
- mpz_clear(val);
- return false;
- }
- }
- else if (t->float_type() != NULL)
+ mpz_init(val);
+ Type* vt;
+ if (!this->length_->integer_constant_value(true, val, &vt))
{
- Type* vt;
mpfr_t fval;
mpfr_init(fval);
if (!this->length_->float_constant_value(fval, &vt))
{
- error_at(this->length_->location(),
- "array bound is not constant");
+ if (this->length_->type()->integer_type() != NULL
+ || this->length_->type()->float_type() != NULL)
+ error_at(this->length_->location(),
+ "array bound is not constant");
+ else
+ error_at(this->length_->location(),
+ "array bound is not numeric");
mpfr_clear(fval);
+ mpz_clear(val);
return false;
}
if (!mpfr_integer_p(fval))
@@ -4296,18 +4322,13 @@ Array_type::verify_length()
error_at(this->length_->location(),
"array bound truncated to integer");
mpfr_clear(fval);
+ mpz_clear(val);
return false;
}
mpz_init(val);
mpfr_get_z(val, fval, GMP_RNDN);
mpfr_clear(fval);
}
- else
- {
- if (!t->is_error_type())
- error_at(this->length_->location(), "array bound is not numeric");
- return false;
- }
if (mpz_sgn(val) < 0)
{
@@ -4443,37 +4464,65 @@ Array_type::do_get_tree(Gogo* gogo)
if (this->length_ == NULL)
{
tree struct_type = gogo->slice_type_tree(void_type_node);
- return this->fill_in_tree(gogo, struct_type);
+ return this->fill_in_slice_tree(gogo, struct_type);
}
else
{
- tree element_type_tree = this->element_type_->get_tree(gogo);
- tree length_tree = this->get_length_tree(gogo);
- if (element_type_tree == error_mark_node
- || length_tree == error_mark_node)
- return error_mark_node;
+ tree array_type = make_node(ARRAY_TYPE);
+ return this->fill_in_array_tree(gogo, array_type);
+ }
+}
- length_tree = fold_convert(sizetype, length_tree);
+// Fill in the fields for an array type. This is used for named array
+// types.
+
+tree
+Array_type::fill_in_array_tree(Gogo* gogo, tree array_type)
+{
+ gcc_assert(this->length_ != NULL);
- // build_index_type takes the maximum index, which is one less
- // than the length.
- tree index_type = build_index_type(fold_build2(MINUS_EXPR, sizetype,
- length_tree,
- size_one_node));
+ tree element_type_tree = this->element_type_->get_tree(gogo);
+ tree length_tree = this->get_length_tree(gogo);
+ if (element_type_tree == error_mark_node
+ || length_tree == error_mark_node)
+ return error_mark_node;
- return build_array_type(element_type_tree, index_type);
- }
+ length_tree = fold_convert(sizetype, length_tree);
+
+ // build_index_type takes the maximum index, which is one less than
+ // the length.
+ tree index_type = build_index_type(fold_build2(MINUS_EXPR, sizetype,
+ length_tree,
+ size_one_node));
+
+ TREE_TYPE(array_type) = element_type_tree;
+ TYPE_DOMAIN(array_type) = index_type;
+ TYPE_ADDR_SPACE(array_type) = TYPE_ADDR_SPACE(element_type_tree);
+ layout_type(array_type);
+
+ if (TYPE_STRUCTURAL_EQUALITY_P(element_type_tree)
+ || TYPE_STRUCTURAL_EQUALITY_P(index_type))
+ SET_TYPE_STRUCTURAL_EQUALITY(array_type);
+ else if (TYPE_CANONICAL(element_type_tree) != element_type_tree
+ || TYPE_CANONICAL(index_type) != index_type)
+ TYPE_CANONICAL(array_type) =
+ build_array_type(TYPE_CANONICAL(element_type_tree),
+ TYPE_CANONICAL(index_type));
+
+ return array_type;
}
// Fill in the fields for a slice type. This is used for named slice
// types.
tree
-Array_type::fill_in_tree(Gogo* gogo, tree struct_type)
+Array_type::fill_in_slice_tree(Gogo* gogo, tree struct_type)
{
gcc_assert(this->length_ == NULL);
tree element_type_tree = this->element_type_->get_tree(gogo);
+ if (element_type_tree == error_mark_node)
+ return error_mark_node;
tree field = TYPE_FIELDS(struct_type);
gcc_assert(strcmp(IDENTIFIER_POINTER(DECL_NAME(field)), "__values") == 0);
gcc_assert(POINTER_TYPE_P(TREE_TYPE(field))
@@ -4566,6 +4615,8 @@ Array_type::do_make_expression_tree(Translate_context* context,
tree element_size_tree = TYPE_SIZE_UNIT(element_type_tree);
tree value = this->element_type_->get_init_tree(gogo, true);
+ if (value == error_mark_node)
+ return error_mark_node;
// The first argument is the number of elements, the optional second
// argument is the capacity.
@@ -4689,7 +4740,7 @@ Array_type::do_make_expression_tree(Translate_context* context,
tree range = build2(RANGE_EXPR, sizetype, size_zero_node, max);
tree space_init = build_constructor_single(array_type, range, value);
- return build2(COMPOUND_EXPR, TREE_TYPE(space),
+ return build2(COMPOUND_EXPR, TREE_TYPE(constructor),
build2(MODIFY_EXPR, void_type_node,
build_fold_indirect_ref(value_pointer),
space_init),
@@ -5602,6 +5653,7 @@ Interface_type::finalize_methods()
{
if (this->methods_ == NULL)
return;
+ std::vector<Named_type*> seen;
bool is_recursive = false;
size_t from = 0;
size_t to = 0;
@@ -5629,6 +5681,7 @@ Interface_type::finalize_methods()
++from;
continue;
}
+
Interface_type* it = p->type()->interface_type();
if (it == NULL)
{
@@ -5646,6 +5699,27 @@ Interface_type::finalize_methods()
++from;
continue;
}
+
+ Named_type* nt = p->type()->named_type();
+ if (nt != NULL)
+ {
+ std::vector<Named_type*>::const_iterator q;
+ for (q = seen.begin(); q != seen.end(); ++q)
+ {
+ if (*q == nt)
+ {
+ error_at(p->location(), "inherited interface loop");
+ break;
+ }
+ }
+ if (q != seen.end())
+ {
+ ++from;
+ continue;
+ }
+ seen.push_back(nt);
+ }
+
const Typed_identifier_list* methods = it->methods();
if (methods == NULL)
{
@@ -5658,7 +5732,7 @@ Interface_type::finalize_methods()
{
if (q->name().empty())
{
- if (q->type() == p->type())
+ if (q->type()->forwarded() == p->type()->forwarded())
error_at(p->location(), "interface inheritance loop");
else
{
@@ -5666,7 +5740,8 @@ Interface_type::finalize_methods()
for (i = from + 1; i < this->methods_->size(); ++i)
{
const Typed_identifier* r = &this->methods_->at(i);
- if (r->name().empty() && r->type() == q->type())
+ if (r->name().empty()
+ && r->type()->forwarded() == q->type()->forwarded())
{
error_at(p->location(),
"inherited interface listed twice");
@@ -6921,12 +6996,12 @@ Named_type::do_verify()
}
// If this is a struct, then if any of the fields of the struct
- // themselves have struct type, then this struct must be converted
- // to the backend representation before the field's type is
- // converted. That may seem backward, but it works because if the
- // field's type refers to this one, e.g., via a pointer, then the
- // conversion process will pick up the half-built struct and do the
- // right thing.
+ // themselves have struct type, or array of struct type, then this
+ // struct must be converted to the backend representation before the
+ // field's type is converted. That may seem backward, but it works
+ // because if the field's type refers to this one, e.g., via a
+ // pointer, then the conversion process will pick up the half-built
+ // struct and do the right thing.
if (this->struct_type() != NULL)
{
const Struct_field_list* fields = this->struct_type()->fields();
@@ -6937,6 +7012,16 @@ Named_type::do_verify()
Struct_type* st = p->type()->struct_type();
if (st != NULL)
st->add_prerequisite(this);
+ else
+ {
+ Array_type* at = p->type()->array_type();
+ if (at != NULL && !at->is_open_array_type())
+ {
+ st = at->element_type()->struct_type();
+ if (st != NULL)
+ st->add_prerequisite(this);
+ }
+ }
}
}
@@ -7092,15 +7177,19 @@ Named_type::do_get_tree(Gogo* gogo)
break;
case TYPE_ARRAY:
+ if (this->named_tree_ != NULL_TREE)
+ return this->named_tree_;
if (!this->is_open_array_type())
- t = Type::get_named_type_tree(gogo, this->type_);
+ {
+ t = make_node(ARRAY_TYPE);
+ this->named_tree_ = t;
+ t = this->type_->array_type()->fill_in_array_tree(gogo, t);
+ }
else
{
- if (this->named_tree_ != NULL_TREE)
- return this->named_tree_;
t = gogo->slice_type_tree(void_type_node);
this->named_tree_ = t;
- t = this->type_->array_type()->fill_in_tree(gogo, t);
+ t = this->type_->array_type()->fill_in_slice_tree(gogo, t);
}
if (t == error_mark_node)
return error_mark_node;
@@ -7486,7 +7575,13 @@ Type::add_interface_methods_for_type(const Type* type,
++pm)
{
Function_type* fntype = pm->type()->function_type();
- gcc_assert(fntype != NULL && !fntype->is_method());
+ if (fntype == NULL)
+ {
+ // This is an error, but it should be reported elsewhere
+ // when we look at the methods for IT.
+ continue;
+ }
+ gcc_assert(!fntype->is_method());
fntype = fntype->copy_with_receiver(const_cast<Type*>(type));
Method* m = new Interface_method(pm->name(), pm->location(), fntype,
field_indexes, depth);
@@ -7756,6 +7851,8 @@ Type::bind_field_or_method(Gogo* gogo, const Type* type, Expression* expr,
{
expr = Expression::make_unary(OPERATOR_MULT, expr, location);
type = type->points_to();
+ if (type->deref()->is_error_type())
+ return Expression::make_error(location);
nt = type->points_to()->named_type();
st = type->points_to()->struct_type();
it = type->points_to()->interface_type();
@@ -8053,9 +8150,9 @@ Type::is_unexported_field_or_method(Gogo* gogo, const Type* type,
const std::string& name,
std::vector<const Named_type*>* seen)
{
- type = type->deref();
-
const Named_type* nt = type->named_type();
+ if (nt == NULL)
+ nt = type->deref()->named_type();
if (nt != NULL)
{
if (nt->is_unexported_local_method(gogo, name))
@@ -8073,6 +8170,8 @@ Type::is_unexported_field_or_method(Gogo* gogo, const Type* type,
}
}
+ type = type->deref();
+
const Interface_type* it = type->interface_type();
if (it != NULL && it->is_unexported_method(gogo, name))
return true;
@@ -8096,11 +8195,17 @@ Type::is_unexported_field_or_method(Gogo* gogo, const Type* type,
++pf)
{
if (pf->is_anonymous()
- && (!pf->type()->deref()->is_error_type()
- && !pf->type()->deref()->is_undefined()))
+ && !pf->type()->deref()->is_error_type()
+ && !pf->type()->deref()->is_undefined())
{
- Named_type* subtype = pf->type()->deref()->named_type();
- gcc_assert(subtype != NULL);
+ Named_type* subtype = pf->type()->named_type();
+ if (subtype == NULL)
+ subtype = pf->type()->deref()->named_type();
+ if (subtype == NULL)
+ {
+ // This is an error, but it will be diagnosed elsewhere.
+ continue;
+ }
if (Type::is_unexported_field_or_method(gogo, subtype, name, seen))
{
if (nt != NULL)
diff --git a/gcc/go/gofrontend/types.h b/gcc/go/gofrontend/types.h
index a8d8a0b9ed4..b0dbefed455 100644
--- a/gcc/go/gofrontend/types.h
+++ b/gcc/go/gofrontend/types.h
@@ -60,22 +60,20 @@ static const int RUNTIME_TYPE_KIND_UINT16 = 9;
static const int RUNTIME_TYPE_KIND_UINT32 = 10;
static const int RUNTIME_TYPE_KIND_UINT64 = 11;
static const int RUNTIME_TYPE_KIND_UINTPTR = 12;
-static const int RUNTIME_TYPE_KIND_FLOAT = 13;
-static const int RUNTIME_TYPE_KIND_FLOAT32 = 14;
-static const int RUNTIME_TYPE_KIND_FLOAT64 = 15;
-static const int RUNTIME_TYPE_KIND_COMPLEX = 16;
-static const int RUNTIME_TYPE_KIND_COMPLEX64 = 17;
-static const int RUNTIME_TYPE_KIND_COMPLEX128 = 18;
-static const int RUNTIME_TYPE_KIND_ARRAY = 19;
-static const int RUNTIME_TYPE_KIND_CHAN = 20;
-static const int RUNTIME_TYPE_KIND_FUNC = 21;
-static const int RUNTIME_TYPE_KIND_INTERFACE = 22;
-static const int RUNTIME_TYPE_KIND_MAP = 23;
-static const int RUNTIME_TYPE_KIND_PTR = 24;
-static const int RUNTIME_TYPE_KIND_SLICE = 25;
-static const int RUNTIME_TYPE_KIND_STRING = 26;
-static const int RUNTIME_TYPE_KIND_STRUCT = 27;
-static const int RUNTIME_TYPE_KIND_UNSAFE_POINTER = 28;
+static const int RUNTIME_TYPE_KIND_FLOAT32 = 13;
+static const int RUNTIME_TYPE_KIND_FLOAT64 = 14;
+static const int RUNTIME_TYPE_KIND_COMPLEX64 = 15;
+static const int RUNTIME_TYPE_KIND_COMPLEX128 = 16;
+static const int RUNTIME_TYPE_KIND_ARRAY = 17;
+static const int RUNTIME_TYPE_KIND_CHAN = 18;
+static const int RUNTIME_TYPE_KIND_FUNC = 19;
+static const int RUNTIME_TYPE_KIND_INTERFACE = 20;
+static const int RUNTIME_TYPE_KIND_MAP = 21;
+static const int RUNTIME_TYPE_KIND_PTR = 22;
+static const int RUNTIME_TYPE_KIND_SLICE = 23;
+static const int RUNTIME_TYPE_KIND_STRING = 24;
+static const int RUNTIME_TYPE_KIND_STRUCT = 25;
+static const int RUNTIME_TYPE_KIND_UNSAFE_POINTER = 26;
// To build the complete list of methods for a named type we need to
// gather all methods from anonymous fields. Those methods may
@@ -1982,9 +1980,17 @@ class Struct_type : public Type
do_export(Export*) const;
private:
+ // Used to avoid infinite loops in field_reference_depth.
+ struct Saw_named_type
+ {
+ Saw_named_type* next;
+ Named_type* nt;
+ };
+
Field_reference_expression*
field_reference_depth(Expression* struct_expr, const std::string& name,
- source_location, unsigned int* depth) const;
+ source_location, Saw_named_type*,
+ unsigned int* depth) const;
static Type*
make_struct_type_descriptor_type();
@@ -2052,9 +2058,13 @@ class Array_type : public Type
static Array_type*
do_import(Import*);
+ // Fill in the fields for a named array type.
+ tree
+ fill_in_array_tree(Gogo*, tree);
+
// Fill in the fields for a named slice type.
tree
- fill_in_tree(Gogo*, tree);
+ fill_in_slice_tree(Gogo*, tree);
protected:
int
diff --git a/gcc/go/gofrontend/unsafe.cc b/gcc/go/gofrontend/unsafe.cc
index e219f61edae..9d51b4d9424 100644
--- a/gcc/go/gofrontend/unsafe.cc
+++ b/gcc/go/gofrontend/unsafe.cc
@@ -24,6 +24,13 @@ Gogo::import_unsafe(const std::string& local_name, bool is_local_name_exported,
is_local_name_exported,
"libgo_unsafe",
location, &add_to_globals);
+
+ if (package == NULL)
+ {
+ gcc_assert(saw_errors());
+ return;
+ }
+
package->set_is_imported();
Bindings* bindings = package->bindings();
diff --git a/gcc/go/gospec.c b/gcc/go/gospec.c
index 7d21ace46be..55a3bcd5bb7 100644
--- a/gcc/go/gospec.c
+++ b/gcc/go/gospec.c
@@ -1,5 +1,5 @@
/* gospec.c -- Specific flags and argument handling of the gcc Go front end.
- Copyright (C) 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 2009, 2010, 2011 Free Software Foundation, Inc.
This file is part of GCC.
@@ -301,7 +301,7 @@ lang_specific_driver (struct cl_decoded_option **in_decoded_options,
#ifdef HAVE_LD_STATIC_DYNAMIC
if (library > 1 && !static_link)
{
- generate_option (OPT_Wl_, "-Bstatic", 1, CL_DRIVER,
+ generate_option (OPT_Wl_, LD_STATIC_OPTION, 1, CL_DRIVER,
&new_decoded_options[j]);
j++;
}
@@ -315,7 +315,7 @@ lang_specific_driver (struct cl_decoded_option **in_decoded_options,
#ifdef HAVE_LD_STATIC_DYNAMIC
if (library > 1 && !static_link)
{
- generate_option (OPT_Wl_, "-Bdynamic", 1, CL_DRIVER,
+ generate_option (OPT_Wl_, LD_DYNAMIC_OPTION, 1, CL_DRIVER,
&new_decoded_options[j]);
j++;
}
diff --git a/gcc/godump.c b/gcc/godump.c
index 4ec41f04156..7ee7af0e861 100644
--- a/gcc/godump.c
+++ b/gcc/godump.c
@@ -79,6 +79,8 @@ go_define (unsigned int lineno, const char *buffer)
const char *name_end;
char *out_buffer;
char *q;
+ bool saw_operand;
+ bool need_operand;
char *copy;
hashval_t hashval;
void **slot;
@@ -115,77 +117,255 @@ go_define (unsigned int lineno, const char *buffer)
initial underscore, and let the user undo this as needed. */
out_buffer = XNEWVEC (char, strlen (p) * 2 + 1);
q = out_buffer;
+ saw_operand = false;
+ need_operand = false;
while (*p != '\0')
{
- if (ISALPHA (*p) || *p == '_')
+ switch (*p)
{
- const char *start;
- char *n;
-
- start = p;
- while (ISALNUM (*p) || *p == '_')
- ++p;
- n = XALLOCAVEC (char, p - start + 1);
- memcpy (n, start, p - start);
- n[p - start] = '\0';
- slot = htab_find_slot (macro_hash, n, NO_INSERT);
- if (slot == NULL || *slot == NULL)
- {
- /* This is a reference to a name which was not defined
- as a macro. */
- fprintf (go_dump_file, "// unknowndefine %s\n", buffer);
- return;
- }
+ case 'A': case 'B': case 'C': case 'D': case 'E': case 'F':
+ case 'G': case 'H': case 'I': case 'J': case 'K': case 'L':
+ case 'M': case 'N': case 'O': case 'P': case 'Q': case 'R':
+ case 'S': case 'T': case 'U': case 'V': case 'W': case 'X':
+ case 'Y': case 'Z':
+ case 'a': case 'b': case 'c': case 'd': case 'e': case 'f':
+ case 'g': case 'h': case 'i': case 'j': case 'k': case 'l':
+ case 'm': case 'n': case 'o': case 'p': case 'q': case 'r':
+ case 's': case 't': case 'u': case 'v': case 'w': case 'x':
+ case 'y': case 'z':
+ case '_':
+ {
+ /* The start of an identifier. Technically we should also
+ worry about UTF-8 identifiers, but they are not a
+ problem for practical uses of -fdump-go-spec so we
+ don't worry about them. */
+ const char *start;
+ char *n;
+
+ if (saw_operand)
+ goto unknown;
+
+ start = p;
+ while (ISALNUM (*p) || *p == '_')
+ ++p;
+ n = XALLOCAVEC (char, p - start + 1);
+ memcpy (n, start, p - start);
+ n[p - start] = '\0';
+ slot = htab_find_slot (macro_hash, n, NO_INSERT);
+ if (slot == NULL || *slot == NULL)
+ {
+ /* This is a reference to a name which was not defined
+ as a macro. */
+ goto unknown;
+ }
- *q++ = '_';
- memcpy (q, start, p - start);
- q += p - start;
- }
- else if (ISDIGIT (*p)
- || (*p == '.' && ISDIGIT (p[1])))
- {
- const char *start;
- bool is_hex;
+ *q++ = '_';
+ memcpy (q, start, p - start);
+ q += p - start;
+
+ saw_operand = true;
+ need_operand = false;
+ }
+ break;
+
+ case '.':
+ if (!ISDIGIT (p[1]))
+ goto unknown;
+ /* Fall through. */
+ case '0': case '1': case '2': case '3': case '4':
+ case '5': case '6': case '7': case '8': case '9':
+ {
+ const char *start;
+ bool is_hex;
+
+ start = p;
+ is_hex = false;
+ if (*p == '0' && (p[1] == 'x' || p[1] == 'X'))
+ {
+ p += 2;
+ is_hex = true;
+ }
+ while (ISDIGIT (*p) || *p == '.' || *p == 'e' || *p == 'E'
+ || (is_hex
+ && ((*p >= 'a' && *p <= 'f')
+ || (*p >= 'A' && *p <= 'F'))))
+ ++p;
+ memcpy (q, start, p - start);
+ q += p - start;
+ while (*p == 'u' || *p == 'U' || *p == 'l' || *p == 'L'
+ || *p == 'f' || *p == 'F'
+ || *p == 'd' || *p == 'D')
+ {
+ /* Go doesn't use any of these trailing type
+ modifiers. */
+ ++p;
+ }
+
+ /* We'll pick up the exponent, if any, as an
+ expression. */
- start = p;
- is_hex = false;
- if (*p == '0' && (p[1] == 'x' || p[1] == 'X'))
+ saw_operand = true;
+ need_operand = false;
+ }
+ break;
+
+ case ' ': case '\t':
+ *q++ = *p++;
+ break;
+
+ case '(':
+ /* Always OK, not part of an operand, presumed to start an
+ operand. */
+ *q++ = *p++;
+ saw_operand = false;
+ need_operand = false;
+ break;
+
+ case ')':
+ /* OK if we don't need an operand, and presumed to indicate
+ an operand. */
+ if (need_operand)
+ goto unknown;
+ *q++ = *p++;
+ saw_operand = true;
+ break;
+
+ case '+': case '-':
+ /* Always OK, but not part of an operand. */
+ *q++ = *p++;
+ saw_operand = false;
+ break;
+
+ case '*': case '/': case '%': case '|': case '&': case '^':
+ /* Must be a binary operator. */
+ if (!saw_operand)
+ goto unknown;
+ *q++ = *p++;
+ saw_operand = false;
+ need_operand = true;
+ break;
+
+ case '=':
+ *q++ = *p++;
+ if (*p != '=')
+ goto unknown;
+ /* Must be a binary operator. */
+ if (!saw_operand)
+ goto unknown;
+ *q++ = *p++;
+ saw_operand = false;
+ need_operand = true;
+ break;
+
+ case '!':
+ *q++ = *p++;
+ if (*p == '=')
{
- p += 2;
- is_hex = true;
+ /* Must be a binary operator. */
+ if (!saw_operand)
+ goto unknown;
+ *q++ = *p++;
+ saw_operand = false;
+ need_operand = true;
}
- while (ISDIGIT (*p) || *p == '.' || *p == 'e' || *p == 'E'
- || (is_hex
- && ((*p >= 'a' && *p <= 'f')
- || (*p >= 'A' && *p <= 'F'))))
- ++p;
- memcpy (q, start, p - start);
- q += p - start;
- while (*p == 'u' || *p == 'U' || *p == 'l' || *p == 'L'
- || *p == 'f' || *p == 'F'
- || *p == 'd' || *p == 'D')
+ else
{
- /* Go doesn't use any of these trailing type
- modifiers. */
- ++p;
+ /* Must be a unary operator. */
+ if (saw_operand)
+ goto unknown;
+ need_operand = true;
}
- }
- else if (ISSPACE (*p)
- || *p == '+' || *p == '-'
- || *p == '*' || *p == '/' || *p == '%'
- || *p == '|' || *p == '&'
- || *p == '>' || *p == '<'
- || *p == '!'
- || *p == '(' || *p == ')'
- || *p == '"' || *p == '\'')
- *q++ = *p++;
- else
- {
- /* Something we don't recognize. */
- fprintf (go_dump_file, "// unknowndefine %s\n", buffer);
- return;
+ break;
+
+ case '<': case '>':
+ /* Must be a binary operand, may be << or >> or <= or >=. */
+ if (!saw_operand)
+ goto unknown;
+ *q++ = *p++;
+ if (*p == *(p - 1) || *p == '=')
+ *q++ = *p++;
+ saw_operand = false;
+ need_operand = true;
+ break;
+
+ case '~':
+ /* Must be a unary operand, must be translated for Go. */
+ if (saw_operand)
+ goto unknown;
+ *q++ = '^';
+ p++;
+ need_operand = true;
+ break;
+
+ case '"':
+ case '\'':
+ {
+ char quote = *p;
+ *q++ = *p++;
+ while (*p != quote)
+ {
+ int c;
+
+ if (*p == '\0')
+ goto unknown;
+
+ if (*p != '\\')
+ {
+ *q++ = *p++;
+ continue;
+ }
+
+ *q++ = *p++;
+ switch (*p)
+ {
+ case '0': case '1': case '2': case '3':
+ case '4': case '5': case '6': case '7':
+ c = 0;
+ while (*p >= '0' && *p <= '7')
+ {
+ *q++ = *p++;
+ ++c;
+ }
+ /* Go octal characters are always 3
+ digits. */
+ if (c != 3)
+ goto unknown;
+ break;
+
+ case 'x':
+ *q++ = *p++;
+ c = 0;
+ while (ISXDIGIT (*p))
+ {
+ *q++ = *p++;
+ ++c;
+ }
+ /* Go hex characters are always 2 digits. */
+ if (c != 2)
+ goto unknown;
+ break;
+
+ case 'a': case 'b': case 'f': case 'n': case 'r':
+ case 't': case 'v': case '\\': case '\'': case '"':
+ *q++ = *p++;
+ break;
+
+ default:
+ goto unknown;
+ }
+ }
+ *q++ = *p++;
+ break;
+ }
+
+ default:
+ goto unknown;
}
}
+
+ if (need_operand)
+ goto unknown;
+
*q = '\0';
slot = htab_find_slot_with_hash (macro_hash, copy, hashval, INSERT);
@@ -194,6 +374,12 @@ go_define (unsigned int lineno, const char *buffer)
fprintf (go_dump_file, "const _%s = %s\n", copy, out_buffer);
XDELETEVEC (out_buffer);
+ return;
+
+ unknown:
+ fprintf (go_dump_file, "// unknowndefine %s\n", buffer);
+ XDELETEVEC (out_buffer);
+ XDELETEVEC (copy);
}
/* A macro undef. */
diff --git a/gcc/graphite-dependences.c b/gcc/graphite-dependences.c
index a6a5254ed17..b9b1d1b5880 100644
--- a/gcc/graphite-dependences.c
+++ b/gcc/graphite-dependences.c
@@ -35,41 +35,7 @@ along with GCC; see the file COPYING3. If not see
#include "graphite-ppl.h"
#include "graphite-poly.h"
#include "graphite-dependences.h"
-
-/* Returns a new polyhedral Data Dependence Relation (DDR). SOURCE is
- the source data reference, SINK is the sink data reference. When
- the Data Dependence Polyhedron DDP is not NULL or not empty, SOURCE
- and SINK are in dependence as described by DDP. */
-
-static poly_ddr_p
-new_poly_ddr (poly_dr_p source, poly_dr_p sink,
- ppl_Pointset_Powerset_C_Polyhedron_t ddp,
- bool original_scattering_p)
-{
- poly_ddr_p pddr = XNEW (struct poly_ddr);
-
- PDDR_SOURCE (pddr) = source;
- PDDR_SINK (pddr) = sink;
- PDDR_DDP (pddr) = ddp;
- PDDR_ORIGINAL_SCATTERING_P (pddr) = original_scattering_p;
-
- if (!ddp || ppl_Pointset_Powerset_C_Polyhedron_is_empty (ddp))
- PDDR_KIND (pddr) = no_dependence;
- else
- PDDR_KIND (pddr) = has_dependence;
-
- return pddr;
-}
-
-/* Free the poly_ddr_p P. */
-
-void
-free_poly_ddr (void *p)
-{
- poly_ddr_p pddr = (poly_ddr_p) p;
- ppl_delete_Pointset_Powerset_C_Polyhedron (PDDR_DDP (pddr));
- free (pddr);
-}
+#include "graphite-cloog-util.h"
/* Comparison function for poly_ddr hash table. */
@@ -180,6 +146,7 @@ print_pddr (FILE *file, poly_ddr_p pddr)
fprintf (file, "\n dependence polyhedron (\n");
print_dependence_polyhedron_layout (file, pddr);
ppl_print_powerset_matrix (file, PDDR_DDP (pddr));
+ ppl_io_fprint_Pointset_Powerset_C_Polyhedron (file, PDDR_DDP (pddr));
fprintf (file, ")\n");
}
@@ -333,7 +300,9 @@ dr_equality_constraints (graphite_dim_t dim,
/* Builds scheduling inequality constraints: when DIRECTION is
1 builds a GE constraint,
0 builds an EQ constraint,
- -1 builds a LE constraint. */
+ -1 builds a LE constraint.
+ DIM is the dimension of the scheduling space.
+ POS and POS + OFFSET are the dimensions that are related. */
static ppl_Pointset_Powerset_C_Polyhedron_t
build_pairwise_scheduling (graphite_dim_t dim,
@@ -344,23 +313,28 @@ build_pairwise_scheduling (graphite_dim_t dim,
ppl_Pointset_Powerset_C_Polyhedron_t res;
ppl_Polyhedron_t equalities;
ppl_Constraint_t cstr;
+ graphite_dim_t a = pos;
+ graphite_dim_t b = pos + offset;
ppl_new_C_Polyhedron_from_space_dimension (&equalities, dim, 0);
switch (direction)
{
- case -1:
- cstr = ppl_build_relation (dim, pos, pos + offset, 1,
+ case 1:
+ /* Builds "a + 1 <= b. */
+ cstr = ppl_build_relation (dim, a, b, 1,
PPL_CONSTRAINT_TYPE_LESS_OR_EQUAL);
break;
case 0:
- cstr = ppl_build_relation (dim, pos, pos + offset, 0,
+ /* Builds "a = b. */
+ cstr = ppl_build_relation (dim, a, b, 0,
PPL_CONSTRAINT_TYPE_EQUAL);
break;
- case 1:
- cstr = ppl_build_relation (dim, pos, pos + offset, -1,
+ case -1:
+ /* Builds "a >= b + 1. */
+ cstr = ppl_build_relation (dim, a, b, -1,
PPL_CONSTRAINT_TYPE_GREATER_OR_EQUAL);
break;
@@ -403,7 +377,7 @@ build_lexicographical_constraint (ppl_Pointset_Powerset_C_Polyhedron_t bag,
lex = build_pairwise_scheduling (dim, 0, offset, direction);
ppl_Pointset_Powerset_C_Polyhedron_intersection_assign (lex, bag);
- if (!ppl_Pointset_Powerset_C_Polyhedron_is_empty (lex))
+ if (!ppl_powerset_is_empty (lex))
ppl_Pointset_Powerset_C_Polyhedron_upper_bound_assign (res, lex);
ppl_delete_Pointset_Powerset_C_Polyhedron (lex);
@@ -416,10 +390,13 @@ build_lexicographical_constraint (ppl_Pointset_Powerset_C_Polyhedron_t bag,
ppl_Pointset_Powerset_C_Polyhedron_intersection_assign (bag, sceq);
ppl_delete_Pointset_Powerset_C_Polyhedron (sceq);
+ if (ppl_powerset_is_empty (bag))
+ break;
+
lex = build_pairwise_scheduling (dim, i + 1, offset, direction);
ppl_Pointset_Powerset_C_Polyhedron_intersection_assign (lex, bag);
- if (!ppl_Pointset_Powerset_C_Polyhedron_is_empty (lex))
+ if (!ppl_powerset_is_empty (lex))
ppl_Pointset_Powerset_C_Polyhedron_upper_bound_assign (res, lex);
ppl_delete_Pointset_Powerset_C_Polyhedron (lex);
@@ -444,8 +421,8 @@ build_lexicographical_constraint (ppl_Pointset_Powerset_C_Polyhedron_t bag,
relation, from PDR2 to PDR1. */
static ppl_Pointset_Powerset_C_Polyhedron_t
-dependence_polyhedron_1 (poly_dr_p pdr1, poly_dr_p pdr2,
- int direction, bool original_scattering_p)
+dependence_polyhedron (poly_dr_p pdr1, poly_dr_p pdr2,
+ int direction, bool original_scattering_p)
{
poly_bb_p pbb1 = PDR_PBB (pdr1);
poly_bb_p pbb2 = PDR_PBB (pdr2);
@@ -465,6 +442,7 @@ dependence_polyhedron_1 (poly_dr_p pdr1, poly_dr_p pdr2,
ppl_Pointset_Powerset_C_Polyhedron_t res;
ppl_Pointset_Powerset_C_Polyhedron_t idr1, idr2;
ppl_Pointset_Powerset_C_Polyhedron_t sc1, sc2, dreq;
+ ppl_Pointset_Powerset_C_Polyhedron_t lex;
gcc_assert (PBB_SCOP (pbb1) == PBB_SCOP (pbb2));
@@ -498,16 +476,14 @@ dependence_polyhedron_1 (poly_dr_p pdr1, poly_dr_p pdr2,
ppl_delete_Pointset_Powerset_C_Polyhedron (idr2);
ppl_delete_Pointset_Powerset_C_Polyhedron (dreq);
- if (!ppl_Pointset_Powerset_C_Polyhedron_is_empty (res))
- {
- ppl_Pointset_Powerset_C_Polyhedron_t lex =
- build_lexicographical_constraint (res, dim, MIN (tdim1, tdim2),
+ if (ppl_powerset_is_empty (res))
+ return NULL;
+
+ lex = build_lexicographical_constraint (res, dim, MIN (tdim1, tdim2),
tdim1 + ddim1, direction);
- ppl_delete_Pointset_Powerset_C_Polyhedron (res);
- res = lex;
- }
+ ppl_delete_Pointset_Powerset_C_Polyhedron (res);
- return res;
+ return lex;
}
/* Build the dependence polyhedron for data references PDR1 and PDR2.
@@ -518,12 +494,12 @@ dependence_polyhedron_1 (poly_dr_p pdr1, poly_dr_p pdr2,
relation, from PDR2 to PDR1. */
static poly_ddr_p
-dependence_polyhedron (poly_dr_p pdr1, poly_dr_p pdr2,
- int direction, bool original_scattering_p)
+new_poly_ddr (poly_dr_p pdr1, poly_dr_p pdr2,
+ int direction, bool original_scattering_p)
{
PTR *x = NULL;
poly_ddr_p res;
- ppl_Pointset_Powerset_C_Polyhedron_t ddp;
+ bool may_alias;
/* Return the PDDR from the cache if it already has been computed. */
if (original_scattering_p)
@@ -540,28 +516,50 @@ dependence_polyhedron (poly_dr_p pdr1, poly_dr_p pdr2,
return (poly_ddr_p) *x;
}
- if ((pdr_read_p (pdr1) && pdr_read_p (pdr2))
- || PDR_BASE_OBJECT_SET (pdr1) != PDR_BASE_OBJECT_SET (pdr2)
- || PDR_NB_SUBSCRIPTS (pdr1) != PDR_NB_SUBSCRIPTS (pdr2)
- || !poly_drs_may_alias_p (pdr1, pdr2))
- ddp = NULL;
- else
- ddp = dependence_polyhedron_1 (pdr1, pdr2, direction,
- original_scattering_p);
+ res = XNEW (struct poly_ddr);
+ PDDR_SOURCE (res) = pdr1;
+ PDDR_SINK (res) = pdr2;
+ PDDR_DDP (res) = NULL;
+ PDDR_ORIGINAL_SCATTERING_P (res) = original_scattering_p;
+ PDDR_KIND (res) = unknown_dependence;
- res = new_poly_ddr (pdr1, pdr2, ddp, original_scattering_p);
+ may_alias = poly_drs_may_alias_p (pdr1, pdr2);
if (!(pdr_read_p (pdr1) && pdr_read_p (pdr2))
&& PDR_BASE_OBJECT_SET (pdr1) != PDR_BASE_OBJECT_SET (pdr2)
- && poly_drs_may_alias_p (pdr1, pdr2))
+ && may_alias)
PDDR_KIND (res) = unknown_dependence;
+ else if (!(pdr_read_p (pdr1) && pdr_read_p (pdr2))
+ && same_pdr_p (pdr1, pdr2)
+ && may_alias)
+ {
+ PDDR_DDP (res) = dependence_polyhedron (pdr1, pdr2, direction,
+ original_scattering_p);
+ if (PDDR_DDP (res))
+ PDDR_KIND (res) = has_dependence;
+ else
+ PDDR_KIND (res) = no_dependence;
+ }
+ else
+ PDDR_KIND (res) = no_dependence;
+
if (original_scattering_p)
*x = res;
return res;
}
+/* Free the data dependence relation poly_ddr_p P. */
+
+void
+free_poly_ddr (void *p)
+{
+ poly_ddr_p pddr = (poly_ddr_p) p;
+ ppl_delete_Pointset_Powerset_C_Polyhedron (PDDR_DDP (pddr));
+ free (pddr);
+}
+
/* Return true when the data dependence relation between the data
references PDR1 belonging to PBB1 and PDR2 is part of a
reduction. */
@@ -573,10 +571,11 @@ reduction_dr_1 (poly_bb_p pbb1, poly_dr_p pdr1, poly_dr_p pdr2)
poly_dr_p pdr;
FOR_EACH_VEC_ELT (poly_dr_p, PBB_DRS (pbb1), i, pdr)
- if (PDR_TYPE (pdr) == PDR_WRITE)
- break;
+ if (PDR_TYPE (pdr) == PDR_WRITE
+ && same_pdr_p (pdr, pdr1) && same_pdr_p (pdr, pdr2))
+ return true;
- return same_pdr_p (pdr, pdr1) && same_pdr_p (pdr, pdr2);
+ return false;
}
/* Return true when the data dependence relation between the data
@@ -621,7 +620,7 @@ graphite_legal_transform_dr (poly_dr_p pdr1, poly_dr_p pdr2)
we get an empty intersection when the transform is legal:
i.e. the transform should reverse no dependences, and so PT, the
reversed transformed PDDR, should have no constraint from PO. */
- opddr = dependence_polyhedron (pdr1, pdr2, 1, true);
+ opddr = new_poly_ddr (pdr1, pdr2, 1, true);
if (PDDR_KIND (opddr) == unknown_dependence)
return false;
@@ -632,7 +631,7 @@ graphite_legal_transform_dr (poly_dr_p pdr1, poly_dr_p pdr2)
if (pddr_is_empty (opddr))
return true;
- tpddr = dependence_polyhedron (pdr1, pdr2, -1, false);
+ tpddr = new_poly_ddr (pdr1, pdr2, -1, false);
if (PDDR_KIND (tpddr) == unknown_dependence)
{
@@ -671,7 +670,7 @@ graphite_legal_transform_dr (poly_dr_p pdr1, poly_dr_p pdr2)
ppl_insert_dimensions_pointset (pt, otdim1 + ttdim1 + ddim1, otdim2);
ppl_Pointset_Powerset_C_Polyhedron_intersection_assign (po_temp, pt);
- is_empty_p = ppl_Pointset_Powerset_C_Polyhedron_is_empty (po_temp);
+ is_empty_p = ppl_powerset_is_empty (po_temp);
ppl_delete_Pointset_Powerset_C_Polyhedron (po_temp);
free_poly_ddr (tpddr);
@@ -753,7 +752,7 @@ graphite_carried_dependence_level_k (poly_dr_p pdr1, poly_dr_p pdr2,
graphite_dim_t ddim1 = pbb_dim_iter_domain (PDR_PBB (pdr1));
ppl_dimension_type dim;
bool empty_p;
- poly_ddr_p pddr = dependence_polyhedron (pdr1, pdr2, 1, false);
+ poly_ddr_p pddr = new_poly_ddr (pdr1, pdr2, 1, false);
if (PDDR_KIND (pddr) == unknown_dependence)
{
@@ -772,7 +771,7 @@ graphite_carried_dependence_level_k (poly_dr_p pdr1, poly_dr_p pdr2,
eqpp = build_pairwise_scheduling (dim, level, tdim1 + ddim1, 1);
ppl_Pointset_Powerset_C_Polyhedron_intersection_assign (eqpp, po);
- empty_p = ppl_Pointset_Powerset_C_Polyhedron_is_empty (eqpp);
+ empty_p = ppl_powerset_is_empty (eqpp);
ppl_delete_Pointset_Powerset_C_Polyhedron (eqpp);
free_poly_ddr (pddr);
@@ -802,36 +801,12 @@ dependency_between_pbbs_p (poly_bb_p pbb1, poly_bb_p pbb2, int level)
return false;
}
-/* Pretty print to FILE all the original data dependences of SCoP in
- DOT format. */
+/* When ORIG is true, pretty print to FILE all the original data
+ dependences of SCoP in DOT format, otherwise print the transformed
+ data deps. */
static void
-dot_original_deps_stmt_1 (FILE *file, scop_p scop)
-{
- int i, j, k, l;
- poly_bb_p pbb1, pbb2;
- poly_dr_p pdr1, pdr2;
-
- FOR_EACH_VEC_ELT (poly_bb_p, SCOP_BBS (scop), i, pbb1)
- FOR_EACH_VEC_ELT (poly_bb_p, SCOP_BBS (scop), j, pbb2)
- {
- FOR_EACH_VEC_ELT (poly_dr_p, PBB_DRS (pbb1), k, pdr1)
- FOR_EACH_VEC_ELT (poly_dr_p, PBB_DRS (pbb2), l, pdr2)
- if (!pddr_is_empty (dependence_polyhedron (pdr1, pdr2, 1, true)))
- {
- fprintf (file, "OS%d -> OS%d\n",
- pbb_index (pbb1), pbb_index (pbb2));
- goto done;
- }
- done:;
- }
-}
-
-/* Pretty print to FILE all the transformed data dependences of SCoP in
- DOT format. */
-
-static void
-dot_transformed_deps_stmt_1 (FILE *file, scop_p scop)
+dot_deps_stmt_2 (FILE *file, scop_p scop, bool orig)
{
int i, j, k, l;
poly_bb_p pbb1, pbb2;
@@ -843,11 +818,11 @@ dot_transformed_deps_stmt_1 (FILE *file, scop_p scop)
FOR_EACH_VEC_ELT (poly_dr_p, PBB_DRS (pbb1), k, pdr1)
FOR_EACH_VEC_ELT (poly_dr_p, PBB_DRS (pbb2), l, pdr2)
{
- poly_ddr_p pddr = dependence_polyhedron (pdr1, pdr2, 1, false);
+ poly_ddr_p pddr = new_poly_ddr (pdr1, pdr2, 1, orig);
if (!pddr_is_empty (pddr))
{
- fprintf (file, "TS%d -> TS%d\n",
+ fprintf (file, orig ? "OS%d -> OS%d\n" : "TS%d -> TS%d\n",
pbb_index (pbb1), pbb_index (pbb2));
free_poly_ddr (pddr);
@@ -860,7 +835,6 @@ dot_transformed_deps_stmt_1 (FILE *file, scop_p scop)
}
}
-
/* Pretty print to FILE all the data dependences of SCoP in DOT
format. */
@@ -869,37 +843,18 @@ dot_deps_stmt_1 (FILE *file, scop_p scop)
{
fputs ("digraph all {\n", file);
- dot_original_deps_stmt_1 (file, scop);
- dot_transformed_deps_stmt_1 (file, scop);
+ dot_deps_stmt_2 (file, scop, true);
+ dot_deps_stmt_2 (file, scop, false);
fputs ("}\n\n", file);
}
-/* Pretty print to FILE all the original data dependences of SCoP in
- DOT format. */
-
-static void
-dot_original_deps (FILE *file, scop_p scop)
-{
- int i, j, k, l;
- poly_bb_p pbb1, pbb2;
- poly_dr_p pdr1, pdr2;
-
- FOR_EACH_VEC_ELT (poly_bb_p, SCOP_BBS (scop), i, pbb1)
- FOR_EACH_VEC_ELT (poly_bb_p, SCOP_BBS (scop), j, pbb2)
- FOR_EACH_VEC_ELT (poly_dr_p, PBB_DRS (pbb1), k, pdr1)
- FOR_EACH_VEC_ELT (poly_dr_p, PBB_DRS (pbb2), l, pdr2)
- if (!pddr_is_empty (dependence_polyhedron (pdr1, pdr2, 1, true)))
- fprintf (file, "OS%d_D%d -> OS%d_D%d\n",
- pbb_index (pbb1), PDR_ID (pdr1),
- pbb_index (pbb2), PDR_ID (pdr2));
-}
-
-/* Pretty print to FILE all the transformed data dependences of SCoP in
- DOT format. */
+/* When ORIG is true, pretty print to FILE all the original data
+ dependences of SCoP in DOT format, otherwise print the transformed
+ data deps. */
static void
-dot_transformed_deps (FILE *file, scop_p scop)
+dot_deps_2 (FILE *file, scop_p scop, bool orig)
{
int i, j, k, l;
poly_bb_p pbb1, pbb2;
@@ -909,11 +864,12 @@ dot_transformed_deps (FILE *file, scop_p scop)
FOR_EACH_VEC_ELT (poly_bb_p, SCOP_BBS (scop), j, pbb2)
FOR_EACH_VEC_ELT (poly_dr_p, PBB_DRS (pbb1), k, pdr1)
FOR_EACH_VEC_ELT (poly_dr_p, PBB_DRS (pbb2), l, pdr2)
- {
- poly_ddr_p pddr = dependence_polyhedron (pdr1, pdr2, 1, false);
+ {
+ poly_ddr_p pddr = new_poly_ddr (pdr1, pdr2, 1, orig);
if (!pddr_is_empty (pddr))
- fprintf (file, "TS%d_D%d -> TS%d_D%d\n",
+ fprintf (file, orig
+ ? "OS%d_D%d -> OS%d_D%d\n" : "TS%d_D%d -> TS%d_D%d\n",
pbb_index (pbb1), PDR_ID (pdr1),
pbb_index (pbb2), PDR_ID (pdr2));
@@ -929,8 +885,8 @@ dot_deps_1 (FILE *file, scop_p scop)
{
fputs ("digraph all {\n", file);
- dot_original_deps (file, scop);
- dot_transformed_deps (file, scop);
+ dot_deps_2 (file, scop, true);
+ dot_deps_2 (file, scop, false);
fputs ("}\n\n", file);
}
diff --git a/gcc/graphite-interchange.c b/gcc/graphite-interchange.c
index b90c4e77c22..934839aace0 100644
--- a/gcc/graphite-interchange.c
+++ b/gcc/graphite-interchange.c
@@ -446,20 +446,18 @@ memory_strides_in_loop (lst_p loop, graphite_dim_t depth, mpz_t strides)
profitable to interchange the loops at DEPTH1 and DEPTH2. */
static bool
-lst_interchange_profitable_p (lst_p loop1, lst_p loop2)
+lst_interchange_profitable_p (lst_p nest, int depth1, int depth2)
{
mpz_t d1, d2;
bool res;
- gcc_assert (loop1 && loop2
- && LST_LOOP_P (loop1) && LST_LOOP_P (loop2)
- && lst_depth (loop1) < lst_depth (loop2));
+ gcc_assert (depth1 < depth2);
mpz_init (d1);
mpz_init (d2);
- memory_strides_in_loop (loop1, lst_depth (loop1), d1);
- memory_strides_in_loop (loop2, lst_depth (loop2), d2);
+ memory_strides_in_loop (nest, depth1, d1);
+ memory_strides_in_loop (nest, depth2, d2);
res = mpz_cmp (d1, d2) < 0;
@@ -592,12 +590,12 @@ lst_try_interchange_loops (scop_p scop, lst_p loop1, lst_p loop2)
lst_p before = NULL, nest = NULL, after = NULL;
- if (!lst_interchange_profitable_p (loop1, loop2))
- return false;
-
if (!lst_perfectly_nested_p (loop1, loop2))
lst_perfect_nestify (loop1, loop2, &before, &nest, &after);
+ if (!lst_interchange_profitable_p (loop2, depth1, depth2))
+ return false;
+
lst_apply_interchange (loop2, depth1, depth2);
/* Sync the transformed LST information and the PBB scatterings
diff --git a/gcc/graphite-poly.c b/gcc/graphite-poly.c
index f88788b8113..bfdbc9f3af4 100644
--- a/gcc/graphite-poly.c
+++ b/gcc/graphite-poly.c
@@ -813,15 +813,16 @@ pbb_remove_duplicate_pdrs (poly_bb_p pbb)
{
int i, j;
poly_dr_p pdr1, pdr2;
- unsigned n = VEC_length (poly_dr_p, PBB_DRS (pbb));
- VEC (poly_dr_p, heap) *collapsed = VEC_alloc (poly_dr_p, heap, n);
FOR_EACH_VEC_ELT (poly_dr_p, PBB_DRS (pbb), i, pdr1)
- FOR_EACH_VEC_ELT (poly_dr_p, collapsed, j, pdr2)
- if (!can_collapse_pdrs (pdr1, pdr2))
- VEC_quick_push (poly_dr_p, collapsed, pdr1);
+ for (j = i + 1; VEC_iterate (poly_dr_p, PBB_DRS (pbb), j, pdr2); j++)
+ if (can_collapse_pdrs (pdr1, pdr2))
+ {
+ PDR_NB_REFS (pdr1) += PDR_NB_REFS (pdr2);
+ free_poly_dr (pdr2);
+ VEC_ordered_remove (poly_dr_p, PBB_DRS (pbb), j);
+ }
- VEC_free (poly_dr_p, heap, collapsed);
PBB_PDR_DUPLICATES_REMOVED (pbb) = true;
}
diff --git a/gcc/graphite-poly.h b/gcc/graphite-poly.h
index 8be905ef921..3bf87b088c9 100644
--- a/gcc/graphite-poly.h
+++ b/gcc/graphite-poly.h
@@ -301,8 +301,7 @@ pdr_may_write_p (poly_dr_p pdr)
static inline bool
same_pdr_p (poly_dr_p pdr1, poly_dr_p pdr2)
{
- return PDR_TYPE (pdr1) == PDR_TYPE (pdr2)
- && PDR_NB_SUBSCRIPTS (pdr1) == PDR_NB_SUBSCRIPTS (pdr2)
+ return PDR_NB_SUBSCRIPTS (pdr1) == PDR_NB_SUBSCRIPTS (pdr2)
&& PDR_BASE_OBJECT_SET (pdr1) == PDR_BASE_OBJECT_SET (pdr2);
}
diff --git a/gcc/graphite-ppl.c b/gcc/graphite-ppl.c
index fffa3ee051f..9762ca46770 100644
--- a/gcc/graphite-ppl.c
+++ b/gcc/graphite-ppl.c
@@ -502,4 +502,65 @@ ppl_build_relation (int dim, int pos1, int pos2, int c,
return cstr;
}
+/* Print to STDERR the GMP value VAL. */
+
+DEBUG_FUNCTION void
+debug_gmp_value (mpz_t val)
+{
+ char *str = mpz_get_str (0, 10, val);
+ void (*gmp_free) (void *, size_t);
+
+ fprintf (stderr, "%s", str);
+ mp_get_memory_functions (NULL, NULL, &gmp_free);
+ (*gmp_free) (str, strlen (str) + 1);
+}
+
+/* Checks for integer feasibility: returns true when the powerset
+ polyhedron PS has no integer solutions. */
+
+bool
+ppl_powerset_is_empty (ppl_Pointset_Powerset_C_Polyhedron_t ps)
+{
+ ppl_PIP_Problem_t pip;
+ ppl_dimension_type d;
+ ppl_const_Constraint_System_t pcs;
+ ppl_Constraint_System_const_iterator_t first, last;
+ ppl_Pointset_Powerset_C_Polyhedron_iterator_t it, end;
+ bool has_integer_solutions = false;
+
+ if (ppl_Pointset_Powerset_C_Polyhedron_is_empty (ps))
+ return true;
+
+ ppl_Pointset_Powerset_C_Polyhedron_space_dimension (ps, &d);
+ ppl_new_Constraint_System_const_iterator (&first);
+ ppl_new_Constraint_System_const_iterator (&last);
+ ppl_new_Pointset_Powerset_C_Polyhedron_iterator (&it);
+ ppl_new_Pointset_Powerset_C_Polyhedron_iterator (&end);
+
+ for (ppl_Pointset_Powerset_C_Polyhedron_iterator_begin (ps, it),
+ ppl_Pointset_Powerset_C_Polyhedron_iterator_end (ps, end);
+ !ppl_Pointset_Powerset_C_Polyhedron_iterator_equal_test (it, end);
+ ppl_Pointset_Powerset_C_Polyhedron_iterator_increment (it))
+ {
+ ppl_const_Polyhedron_t ph;
+ ppl_Pointset_Powerset_C_Polyhedron_iterator_dereference (it, &ph);
+
+ ppl_Polyhedron_get_constraints (ph, &pcs);
+ ppl_Constraint_System_begin (pcs, first);
+ ppl_Constraint_System_end (pcs, last);
+
+ ppl_new_PIP_Problem_from_constraints (&pip, d, first, last, 0, NULL);
+ has_integer_solutions |= ppl_PIP_Problem_is_satisfiable (pip);
+
+ ppl_delete_PIP_Problem (pip);
+ }
+
+ ppl_delete_Constraint_System_const_iterator (first);
+ ppl_delete_Constraint_System_const_iterator (last);
+ ppl_delete_Pointset_Powerset_C_Polyhedron_iterator (it);
+ ppl_delete_Pointset_Powerset_C_Polyhedron_iterator (end);
+
+ return !has_integer_solutions;
+}
+
#endif
diff --git a/gcc/graphite-ppl.h b/gcc/graphite-ppl.h
index ec5d3c5682f..695d01f3425 100644
--- a/gcc/graphite-ppl.h
+++ b/gcc/graphite-ppl.h
@@ -46,6 +46,9 @@ void ppl_min_for_le_pointset (ppl_Pointset_Powerset_C_Polyhedron_t,
ppl_Linear_Expression_t, mpz_t);
ppl_Constraint_t ppl_build_relation (int, int, int, int,
enum ppl_enum_Constraint_Type);
+void debug_gmp_value (mpz_t);
+bool ppl_powerset_is_empty (ppl_Pointset_Powerset_C_Polyhedron_t);
+
/* Assigns to RES the value of the INTEGER_CST T. */
diff --git a/gcc/graphite-scop-detection.c b/gcc/graphite-scop-detection.c
index aff0b03f839..45c6c75ccea 100644
--- a/gcc/graphite-scop-detection.c
+++ b/gcc/graphite-scop-detection.c
@@ -263,7 +263,9 @@ stmt_has_simple_data_refs_p (loop_p outermost_loop, gimple stmt)
bool res = true;
VEC (data_reference_p, heap) *drs = VEC_alloc (data_reference_p, heap, 5);
- graphite_find_data_references_in_stmt (outermost_loop, stmt, &drs);
+ graphite_find_data_references_in_stmt (outermost_loop,
+ loop_containing_stmt (stmt),
+ stmt, &drs);
FOR_EACH_VEC_ELT (data_reference_p, drs, j, dr)
for (i = 0; i < DR_NUM_DIMENSIONS (dr); i++)
@@ -1199,6 +1201,66 @@ limit_scops (VEC (scop_p, heap) **scops)
VEC_free (sd_region, heap, regions);
}
+/* Returns true when P1 and P2 are close phis with the same
+ argument. */
+
+static inline bool
+same_close_phi_node (gimple p1, gimple p2)
+{
+ return operand_equal_p (gimple_phi_arg_def (p1, 0),
+ gimple_phi_arg_def (p2, 0), 0);
+}
+
+/* Remove the close phi node at GSI and replace its rhs with the rhs
+ of PHI. */
+
+static void
+remove_duplicate_close_phi (gimple phi, gimple_stmt_iterator *gsi)
+{
+ gimple use_stmt;
+ use_operand_p use_p;
+ imm_use_iterator imm_iter;
+ tree res = gimple_phi_result (phi);
+ tree def = gimple_phi_result (gsi_stmt (*gsi));
+
+ gcc_assert (same_close_phi_node (phi, gsi_stmt (*gsi)));
+
+ FOR_EACH_IMM_USE_STMT (use_stmt, imm_iter, def)
+ {
+ FOR_EACH_IMM_USE_ON_STMT (use_p, imm_iter)
+ SET_USE (use_p, res);
+
+ update_stmt (use_stmt);
+ }
+
+ remove_phi_node (gsi, true);
+}
+
+/* Removes all the close phi duplicates from BB. */
+
+static void
+make_close_phi_nodes_unique (basic_block bb)
+{
+ gimple_stmt_iterator psi;
+
+ for (psi = gsi_start_phis (bb); !gsi_end_p (psi); gsi_next (&psi))
+ {
+ gimple_stmt_iterator gsi = psi;
+ gimple phi = gsi_stmt (psi);
+
+ /* At this point, PHI should be a close phi in normal form. */
+ gcc_assert (gimple_phi_num_args (phi) == 1);
+
+ /* Iterate over the next phis and remove duplicates. */
+ gsi_next (&gsi);
+ while (!gsi_end_p (gsi))
+ if (same_close_phi_node (phi, gsi_stmt (gsi)))
+ remove_duplicate_close_phi (phi, &gsi);
+ else
+ gsi_next (&gsi);
+ }
+}
+
/* Transforms LOOP to the canonical loop closed SSA form. */
static void
@@ -1213,7 +1275,10 @@ canonicalize_loop_closed_ssa (loop_p loop)
bb = e->dest;
if (VEC_length (edge, bb->preds) == 1)
- split_block_after_labels (bb);
+ {
+ e = split_block_after_labels (bb);
+ make_close_phi_nodes_unique (e->src);
+ }
else
{
gimple_stmt_iterator psi;
@@ -1248,7 +1313,13 @@ canonicalize_loop_closed_ssa (loop_p loop)
update_stmt (phi);
}
}
+
+ make_close_phi_nodes_unique (close);
}
+
+ /* The code above does not properly handle changes in the post dominance
+ information (yet). */
+ free_dominance_info (CDI_POST_DOMINATORS);
}
/* Converts the current loop closed SSA form to a canonical form
@@ -1268,6 +1339,8 @@ canonicalize_loop_closed_ssa (loop_p loop)
- the basic block containing the close phi nodes does not contain
other statements.
+
+ - there exist only one phi node per definition in the loop.
*/
static void
diff --git a/gcc/graphite-sese-to-poly.c b/gcc/graphite-sese-to-poly.c
index 1bf2047d3c2..064ded3e2f0 100644
--- a/gcc/graphite-sese-to-poly.c
+++ b/gcc/graphite-sese-to-poly.c
@@ -241,6 +241,32 @@ free_scops (VEC (scop_p, heap) *scops)
VEC_free (scop_p, heap, scops);
}
+/* Same as outermost_loop_in_sese, returns the outermost loop
+ containing BB in REGION, but makes sure that the returned loop
+ belongs to the REGION, and so this returns the first loop in the
+ REGION when the loop containing BB does not belong to REGION. */
+
+static loop_p
+outermost_loop_in_sese_1 (sese region, basic_block bb)
+{
+ loop_p nest = outermost_loop_in_sese (region, bb);
+
+ if (loop_in_sese_p (nest, region))
+ return nest;
+
+ /* When the basic block BB does not belong to a loop in the region,
+ return the first loop in the region. */
+ nest = nest->inner;
+ while (nest)
+ if (loop_in_sese_p (nest, region))
+ break;
+ else
+ nest = nest->next;
+
+ gcc_assert (nest);
+ return nest;
+}
+
/* Generates a polyhedral black box only if the bb contains interesting
information. */
@@ -248,14 +274,23 @@ static gimple_bb_p
try_generate_gimple_bb (scop_p scop, basic_block bb)
{
VEC (data_reference_p, heap) *drs = VEC_alloc (data_reference_p, heap, 5);
- loop_p nest = outermost_loop_in_sese (SCOP_REGION (scop), bb);
+ sese region = SCOP_REGION (scop);
+ loop_p nest = outermost_loop_in_sese_1 (region, bb);
gimple_stmt_iterator gsi;
for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi))
{
gimple stmt = gsi_stmt (gsi);
- if (!is_gimple_debug (stmt))
- graphite_find_data_references_in_stmt (nest, stmt, &drs);
+ loop_p loop;
+
+ if (is_gimple_debug (stmt))
+ continue;
+
+ loop = loop_containing_stmt (stmt);
+ if (!loop_in_sese_p (loop, region))
+ loop = nest;
+
+ graphite_find_data_references_in_stmt (nest, loop, stmt, &drs);
}
return new_gimple_bb (bb, drs);
@@ -2019,17 +2054,28 @@ analyze_drs_in_stmts (scop_p scop, basic_block bb, VEC (gimple, heap) *stmts)
gimple_bb_p gbb;
gimple stmt;
int i;
+ sese region = SCOP_REGION (scop);
- if (!bb_in_sese_p (bb, SCOP_REGION (scop)))
+ if (!bb_in_sese_p (bb, region))
return;
- nest = outermost_loop_in_sese (SCOP_REGION (scop), bb);
+ nest = outermost_loop_in_sese_1 (region, bb);
gbb = gbb_from_bb (bb);
FOR_EACH_VEC_ELT (gimple, stmts, i, stmt)
- if (!is_gimple_debug (stmt))
- graphite_find_data_references_in_stmt (nest, stmt,
+ {
+ loop_p loop;
+
+ if (is_gimple_debug (stmt))
+ continue;
+
+ loop = loop_containing_stmt (stmt);
+ if (!loop_in_sese_p (loop, region))
+ loop = nest;
+
+ graphite_find_data_references_in_stmt (nest, loop, stmt,
&GBB_DATA_REFS (gbb));
+ }
}
/* Insert STMT at the end of the STMTS sequence and then insert the
@@ -2106,9 +2152,11 @@ new_pbb_from_pbb (scop_p scop, poly_bb_p pbb, basic_block bb)
if (VEC_index (poly_bb_p, SCOP_BBS (scop), index) == pbb)
break;
+ if (PBB_DOMAIN (pbb))
+ ppl_new_Pointset_Powerset_C_Polyhedron_from_Pointset_Powerset_C_Polyhedron
+ (&PBB_DOMAIN (pbb1), PBB_DOMAIN (pbb));
+
GBB_PBB (gbb1) = pbb1;
- ppl_new_Pointset_Powerset_C_Polyhedron_from_Pointset_Powerset_C_Polyhedron
- (&PBB_DOMAIN (pbb1), PBB_DOMAIN (pbb));
GBB_CONDITIONS (gbb1) = VEC_copy (gimple, heap, GBB_CONDITIONS (gbb));
GBB_CONDITION_CASES (gbb1) = VEC_copy (gimple, heap, GBB_CONDITION_CASES (gbb));
VEC_safe_insert (poly_bb_p, heap, SCOP_BBS (scop), index + 1, pbb1);
@@ -2640,7 +2688,9 @@ split_reduction_stmt (scop_p scop, gimple stmt)
/* Do not split basic blocks with no writes to memory: the reduction
will be the only write to memory. */
- if (nb_data_writes_in_bb (bb) == 0)
+ if (nb_data_writes_in_bb (bb) == 0
+ /* Or if we have already marked BB as a reduction. */
+ || PBB_IS_REDUCTION (pbb_from_bb (bb)))
return bb;
e1 = split_pbb (scop, pbb, bb, stmt);
@@ -2848,6 +2898,30 @@ initial_value_for_loop_phi (gimple phi)
return NULL_TREE;
}
+/* Returns true when DEF is used outside the reduction cycle of
+ LOOP_PHI. */
+
+static bool
+used_outside_reduction (tree def, gimple loop_phi)
+{
+ use_operand_p use_p;
+ imm_use_iterator imm_iter;
+ loop_p loop = loop_containing_stmt (loop_phi);
+
+ /* In LOOP, DEF should be used only in LOOP_PHI. */
+ FOR_EACH_IMM_USE_FAST (use_p, imm_iter, def)
+ {
+ gimple stmt = USE_STMT (use_p);
+
+ if (stmt != loop_phi
+ && !is_gimple_debug (stmt)
+ && flow_bb_inside_loop_p (loop, gimple_bb (stmt)))
+ return true;
+ }
+
+ return false;
+}
+
/* Detect commutative and associative scalar reductions belonging to
the SCOP starting at the loop closed phi node STMT. Return the phi
node of the reduction cycle, or NULL. */
@@ -2858,8 +2932,8 @@ detect_commutative_reduction (scop_p scop, gimple stmt, VEC (gimple, heap) **in,
{
if (scalar_close_phi_node_p (stmt))
{
- tree arg = gimple_phi_arg_def (stmt, 0);
- gimple def, loop_phi;
+ gimple def, loop_phi, phi, close_phi = stmt;
+ tree init, lhs, arg = gimple_phi_arg_def (close_phi, 0);
if (TREE_CODE (arg) != SSA_NAME)
return NULL;
@@ -2867,26 +2941,24 @@ detect_commutative_reduction (scop_p scop, gimple stmt, VEC (gimple, heap) **in,
/* Note that loop close phi nodes should have a single argument
because we translated the representation into a canonical form
before Graphite: see canonicalize_loop_closed_ssa_form. */
- gcc_assert (gimple_phi_num_args (stmt) == 1);
+ gcc_assert (gimple_phi_num_args (close_phi) == 1);
def = SSA_NAME_DEF_STMT (arg);
- if (!stmt_in_sese_p (def, SCOP_REGION (scop)))
+ if (!stmt_in_sese_p (def, SCOP_REGION (scop))
+ || !(loop_phi = detect_commutative_reduction (scop, def, in, out)))
return NULL;
- loop_phi = detect_commutative_reduction (scop, def, in, out);
-
- if (loop_phi)
- {
- tree lhs = gimple_phi_result (stmt);
- tree init = initial_value_for_loop_phi (loop_phi);
- gimple phi = follow_inital_value_to_phi (init, lhs);
+ lhs = gimple_phi_result (close_phi);
+ init = initial_value_for_loop_phi (loop_phi);
+ phi = follow_inital_value_to_phi (init, lhs);
- VEC_safe_push (gimple, heap, *in, loop_phi);
- VEC_safe_push (gimple, heap, *out, stmt);
- return phi;
- }
- else
+ if (phi && (used_outside_reduction (lhs, phi)
+ || !has_single_use (gimple_phi_result (phi))))
return NULL;
+
+ VEC_safe_push (gimple, heap, *in, loop_phi);
+ VEC_safe_push (gimple, heap, *out, close_phi);
+ return phi;
}
if (gimple_code (stmt) == GIMPLE_ASSIGN)
@@ -2903,12 +2975,12 @@ translate_scalar_reduction_to_array_for_stmt (scop_p scop, tree red,
gimple stmt, gimple loop_phi)
{
tree res = gimple_phi_result (loop_phi);
- gimple assign = gimple_build_assign (res, red);
+ gimple assign = gimple_build_assign (res, unshare_expr (red));
gimple_stmt_iterator gsi;
insert_stmts (scop, assign, NULL, gsi_after_labels (gimple_bb (loop_phi)));
- assign = gimple_build_assign (red, gimple_assign_lhs (stmt));
+ assign = gimple_build_assign (unshare_expr (red), gimple_assign_lhs (stmt));
gsi = gsi_for_stmt (stmt);
gsi_next (&gsi);
insert_stmts (scop, assign, NULL, gsi);
@@ -2949,6 +3021,80 @@ remove_phi (gimple phi)
remove_phi_node (&gsi, false);
}
+/* Helper function for for_each_index. For each INDEX of the data
+ reference REF, returns true when its indices are valid in the loop
+ nest LOOP passed in as DATA. */
+
+static bool
+dr_indices_valid_in_loop (tree ref ATTRIBUTE_UNUSED, tree *index, void *data)
+{
+ loop_p loop;
+ basic_block header, def_bb;
+ gimple stmt;
+
+ if (TREE_CODE (*index) != SSA_NAME)
+ return true;
+
+ loop = *((loop_p *) data);
+ header = loop->header;
+ stmt = SSA_NAME_DEF_STMT (*index);
+
+ if (!stmt)
+ return true;
+
+ def_bb = gimple_bb (stmt);
+
+ if (!def_bb)
+ return true;
+
+ return dominated_by_p (CDI_DOMINATORS, header, def_bb);
+}
+
+/* When the result of a CLOSE_PHI is written to a memory location,
+ return a pointer to that memory reference, otherwise return
+ NULL_TREE. */
+
+static tree
+close_phi_written_to_memory (gimple close_phi)
+{
+ imm_use_iterator imm_iter;
+ use_operand_p use_p;
+ gimple stmt;
+ tree res, def = gimple_phi_result (close_phi);
+
+ FOR_EACH_IMM_USE_FAST (use_p, imm_iter, def)
+ if ((stmt = USE_STMT (use_p))
+ && gimple_code (stmt) == GIMPLE_ASSIGN
+ && (res = gimple_assign_lhs (stmt)))
+ {
+ switch (TREE_CODE (res))
+ {
+ case VAR_DECL:
+ case PARM_DECL:
+ case RESULT_DECL:
+ return res;
+
+ case ARRAY_REF:
+ case MEM_REF:
+ {
+ tree arg = gimple_phi_arg_def (close_phi, 0);
+ loop_p nest = loop_containing_stmt (SSA_NAME_DEF_STMT (arg));
+
+ /* FIXME: this restriction is for id-{24,25}.f and
+ could be handled by duplicating the computation of
+ array indices before the loop of the close_phi. */
+ if (for_each_index (&res, dr_indices_valid_in_loop, &nest))
+ return res;
+ }
+ /* Fallthru. */
+
+ default:
+ continue;
+ }
+ }
+ return NULL_TREE;
+}
+
/* Rewrite out of SSA the reduction described by the loop phi nodes
IN, and the close phi nodes OUT. IN and OUT are structured by loop
levels like this:
@@ -2964,9 +3110,9 @@ translate_scalar_reduction_to_array (scop_p scop,
VEC (gimple, heap) *in,
VEC (gimple, heap) *out)
{
- unsigned int i;
gimple loop_phi;
- tree red = NULL_TREE;
+ unsigned int i = VEC_length (gimple, out) - 1;
+ tree red = close_phi_written_to_memory (VEC_index (gimple, out, i));
FOR_EACH_VEC_ELT (gimple, in, i, loop_phi)
{
@@ -2980,8 +3126,10 @@ translate_scalar_reduction_to_array (scop_p scop,
PBB_IS_REDUCTION (pbb) = true;
gcc_assert (close_phi == loop_phi);
- red = create_zero_dim_array
- (gimple_assign_lhs (stmt), "Commutative_Associative_Reduction");
+ if (!red)
+ red = create_zero_dim_array
+ (gimple_assign_lhs (stmt), "Commutative_Associative_Reduction");
+
translate_scalar_reduction_to_array_for_stmt
(scop, red, stmt, VEC_index (gimple, in, 1));
continue;
@@ -2989,11 +3137,11 @@ translate_scalar_reduction_to_array (scop_p scop,
if (i == VEC_length (gimple, in) - 1)
{
- insert_out_of_ssa_copy (scop, gimple_phi_result (close_phi), red,
- close_phi);
+ insert_out_of_ssa_copy (scop, gimple_phi_result (close_phi),
+ unshare_expr (red), close_phi);
insert_out_of_ssa_copy_on_edge
(scop, edge_initial_value_for_loop_phi (loop_phi),
- red, initial_value_for_loop_phi (loop_phi));
+ unshare_expr (red), initial_value_for_loop_phi (loop_phi));
}
remove_phi (loop_phi);
@@ -3013,7 +3161,7 @@ rewrite_commutative_reductions_out_of_ssa_close_phi (scop_p scop,
VEC (gimple, heap) *out = VEC_alloc (gimple, heap, 10);
detect_commutative_reduction (scop, close_phi, &in, &out);
- res = VEC_length (gimple, in) > 0;
+ res = VEC_length (gimple, in) > 1;
if (res)
translate_scalar_reduction_to_array (scop, in, out);
@@ -3129,6 +3277,9 @@ build_poly_scop (scop_p scop)
if (!scop_ivs_can_be_represented (scop))
return;
+ if (flag_associative_math)
+ rewrite_commutative_reductions_out_of_ssa (scop);
+
build_sese_loop_nests (region);
build_sese_conditions (region);
find_scop_parameters (scop);
@@ -3145,8 +3296,6 @@ build_poly_scop (scop_p scop)
representation to the polyhedral representation to avoid scev
analysis failures. That means that these functions will insert
new data references that they create in the right place. */
- if (flag_associative_math)
- rewrite_commutative_reductions_out_of_ssa (scop);
rewrite_reductions_out_of_ssa (scop);
rewrite_cross_bb_scalar_deps_out_of_ssa (scop);
diff --git a/gcc/gthr-dce.h b/gcc/gthr-dce.h
index 4226359f0a0..d32155a9352 100644
--- a/gcc/gthr-dce.h
+++ b/gcc/gthr-dce.h
@@ -483,7 +483,7 @@ __gthread_mutex_init_function (__gthread_mutex_t *__mutex)
}
static inline int
-__gthread_mutx_destroy (__gthread_mutex_t *__mutex)
+__gthread_mutex_destroy (__gthread_mutex_t *__mutex)
{
if (__gthread_active_p ())
return __gthrw_(pthread_mutex_destroy) (__mutex);
diff --git a/gcc/haifa-sched.c b/gcc/haifa-sched.c
index bd3b84c5c23..e16561f4cb9 100644
--- a/gcc/haifa-sched.c
+++ b/gcc/haifa-sched.c
@@ -1900,8 +1900,33 @@ get_ebb_head_tail (basic_block beg, basic_block end, rtx *headp, rtx *tailp)
beg_head = NEXT_INSN (beg_head);
while (beg_head != beg_tail)
- if (NOTE_P (beg_head) || BOUNDARY_DEBUG_INSN_P (beg_head))
+ if (NOTE_P (beg_head))
beg_head = NEXT_INSN (beg_head);
+ else if (DEBUG_INSN_P (beg_head))
+ {
+ rtx note, next;
+
+ for (note = NEXT_INSN (beg_head);
+ note != beg_tail;
+ note = next)
+ {
+ next = NEXT_INSN (note);
+ if (NOTE_P (note))
+ {
+ if (sched_verbose >= 9)
+ fprintf (sched_dump, "reorder %i\n", INSN_UID (note));
+
+ reorder_insns_nobb (note, note, PREV_INSN (beg_head));
+
+ if (BLOCK_FOR_INSN (note) != beg)
+ df_insn_change_bb (note, beg);
+ }
+ else if (!DEBUG_INSN_P (note))
+ break;
+ }
+
+ break;
+ }
else
break;
@@ -1913,8 +1938,36 @@ get_ebb_head_tail (basic_block beg, basic_block end, rtx *headp, rtx *tailp)
end_head = NEXT_INSN (end_head);
while (end_head != end_tail)
- if (NOTE_P (end_tail) || BOUNDARY_DEBUG_INSN_P (end_tail))
+ if (NOTE_P (end_tail))
end_tail = PREV_INSN (end_tail);
+ else if (DEBUG_INSN_P (end_tail))
+ {
+ rtx note, prev;
+
+ for (note = PREV_INSN (end_tail);
+ note != end_head;
+ note = prev)
+ {
+ prev = PREV_INSN (note);
+ if (NOTE_P (note))
+ {
+ if (sched_verbose >= 9)
+ fprintf (sched_dump, "reorder %i\n", INSN_UID (note));
+
+ reorder_insns_nobb (note, note, end_tail);
+
+ if (end_tail == BB_END (end))
+ BB_END (end) = note;
+
+ if (BLOCK_FOR_INSN (note) != end)
+ df_insn_change_bb (note, end);
+ }
+ else if (!DEBUG_INSN_P (note))
+ break;
+ }
+
+ break;
+ }
else
break;
@@ -1928,8 +1981,7 @@ no_real_insns_p (const_rtx head, const_rtx tail)
{
while (head != NEXT_INSN (tail))
{
- if (!NOTE_P (head) && !LABEL_P (head)
- && !BOUNDARY_DEBUG_INSN_P (head))
+ if (!NOTE_P (head) && !LABEL_P (head))
return 0;
head = NEXT_INSN (head);
}
@@ -2812,7 +2864,7 @@ schedule_block (basic_block *target_bb)
last_scheduled_insn = prev_head;
gcc_assert ((NOTE_P (last_scheduled_insn)
- || BOUNDARY_DEBUG_INSN_P (last_scheduled_insn))
+ || DEBUG_INSN_P (last_scheduled_insn))
&& BLOCK_FOR_INSN (last_scheduled_insn) == *target_bb);
/* Initialize INSN_QUEUE. Q_SIZE is the total number of insns in the
@@ -3319,7 +3371,7 @@ set_priorities (rtx head, rtx tail)
current_sched_info->sched_max_insns_priority;
rtx prev_head;
- if (head == tail && (! INSN_P (head) || BOUNDARY_DEBUG_INSN_P (head)))
+ if (head == tail && ! INSN_P (head))
gcc_unreachable ();
n_insn = 0;
@@ -3851,7 +3903,7 @@ fix_tick_ready (rtx next)
{
int tick, delay;
- if (!sd_lists_empty_p (next, SD_LIST_RES_BACK))
+ if (!DEBUG_INSN_P (next) && !sd_lists_empty_p (next, SD_LIST_RES_BACK))
{
int full_p;
sd_iterator_def sd_it;
diff --git a/gcc/hwint.h b/gcc/hwint.h
index 8bd7c5e7bdc..1eadd45da73 100644
--- a/gcc/hwint.h
+++ b/gcc/hwint.h
@@ -228,4 +228,33 @@ exact_log2 (unsigned HOST_WIDE_INT x)
#endif /* GCC_VERSION >= 3004 */
+/* Compute the greatest common divisor of two numbers using
+ Euclid's algorithm. */
+
+static inline int
+gcd (int a, int b)
+{
+ int x, y, z;
+
+ x = abs (a);
+ y = abs (b);
+
+ while (x > 0)
+ {
+ z = y % x;
+ y = x;
+ x = z;
+ }
+
+ return y;
+}
+
+/* Compute the least common multiple of two numbers A and B . */
+
+static inline int
+least_common_multiple (int a, int b)
+{
+ return (abs (a) * abs (b) / gcd (a, b));
+}
+
#endif /* ! GCC_HWINT_H */
diff --git a/gcc/ipa-cp.c b/gcc/ipa-cp.c
index ce6fd598715..0ef640bcde9 100644
--- a/gcc/ipa-cp.c
+++ b/gcc/ipa-cp.c
@@ -50,7 +50,7 @@ along with GCC; see the file COPYING3. If not see
with the value 3.
The algorithm used is based on "Interprocedural Constant Propagation", by
- Challahan David, Keith D Cooper, Ken Kennedy, Linda Torczon, Comp86, pg
+ David Callahan, Keith D Cooper, Ken Kennedy, Linda Torczon, Comp86, pg
152-161
The optimization is divided into three stages:
@@ -469,7 +469,7 @@ ipcp_cloning_candidate_p (struct cgraph_node *node)
if (cgraph_function_body_availability (node) <= AVAIL_OVERWRITABLE)
{
if (dump_file)
- fprintf (dump_file, "Not considering %s for cloning; body is overwrittable.\n",
+ fprintf (dump_file, "Not considering %s for cloning; body is overwritable.\n",
cgraph_node_name (node));
return false;
}
@@ -521,7 +521,7 @@ ipcp_cloning_candidate_p (struct cgraph_node *node)
/* When profile is available and function is hot, propagate into it even if
calls seems cold; constant propagation can improve function's speed
- significandly. */
+ significantly. */
if (max_count)
{
if (direct_call_sum > node->count * 90 / 100)
@@ -614,8 +614,8 @@ build_const_val (struct ipcp_lattice *lat, tree tree_type)
FIXME: This code is wrong. Since the callers can be also clones and
the clones are not scaled yet, the sums gets unrealistically high.
To properly compute the counts, we would need to do propagation across
- callgraph (as external call to A might imply call to non-clonned B
- if A's clone calls clonned B). */
+ callgraph (as external call to A might imply call to non-cloned B
+ if A's clone calls cloned B). */
static void
ipcp_compute_node_scale (struct cgraph_node *node)
{
@@ -1040,25 +1040,29 @@ ipcp_update_callgraph (void)
for (node = cgraph_nodes; node; node = node->next)
if (node->analyzed && ipcp_node_is_clone (node))
{
- bitmap args_to_skip = BITMAP_ALLOC (NULL);
+ bitmap args_to_skip = NULL;
struct cgraph_node *orig_node = ipcp_get_orig_node (node);
struct ipa_node_params *info = IPA_NODE_REF (orig_node);
int i, count = ipa_get_param_count (info);
struct cgraph_edge *cs, *next;
- for (i = 0; i < count; i++)
+ if (node->local.can_change_signature)
{
- struct ipcp_lattice *lat = ipcp_get_lattice (info, i);
-
- /* We can proactively remove obviously unused arguments. */
- if (!ipa_is_param_used (info, i))
+ args_to_skip = BITMAP_ALLOC (NULL);
+ for (i = 0; i < count; i++)
{
- bitmap_set_bit (args_to_skip, i);
- continue;
- }
+ struct ipcp_lattice *lat = ipcp_get_lattice (info, i);
+
+ /* We can proactively remove obviously unused arguments. */
+ if (!ipa_is_param_used (info, i))
+ {
+ bitmap_set_bit (args_to_skip, i);
+ continue;
+ }
- if (lat->type == IPA_CONST_VALUE)
- bitmap_set_bit (args_to_skip, i);
+ if (lat->type == IPA_CONST_VALUE)
+ bitmap_set_bit (args_to_skip, i);
+ }
}
for (cs = node->callers; cs; cs = next)
{
@@ -1123,27 +1127,28 @@ ipcp_estimate_growth (struct cgraph_node *node)
else
need_original = true;
- /* If we will be able to fully replace orignal node, we never increase
+ /* If we will be able to fully replace original node, we never increase
program size. */
if (!need_original)
return 0;
info = IPA_NODE_REF (node);
count = ipa_get_param_count (info);
- for (i = 0; i < count; i++)
- {
- struct ipcp_lattice *lat = ipcp_get_lattice (info, i);
+ if (node->local.can_change_signature)
+ for (i = 0; i < count; i++)
+ {
+ struct ipcp_lattice *lat = ipcp_get_lattice (info, i);
- /* We can proactively remove obviously unused arguments. */
- if (!ipa_is_param_used (info, i))
- removable_args++;
+ /* We can proactively remove obviously unused arguments. */
+ if (!ipa_is_param_used (info, i))
+ removable_args++;
- if (lat->type == IPA_CONST_VALUE)
- removable_args++;
- }
+ if (lat->type == IPA_CONST_VALUE)
+ removable_args++;
+ }
/* We make just very simple estimate of savings for removal of operand from
- call site. Precise cost is dificult to get, as our size metric counts
+ call site. Precise cost is difficult to get, as our size metric counts
constants and moves as free. Generally we are looking for cases that
small function is called very many times. */
growth = node->local.inline_summary.self_size
@@ -1375,7 +1380,7 @@ ipcp_insert_stage (void)
new_size += growth;
- /* Look if original function becomes dead after clonning. */
+ /* Look if original function becomes dead after cloning. */
for (cs = node->callers; cs != NULL; cs = cs->next_caller)
if (cs->caller == node || ipcp_need_redirect_p (cs))
break;
@@ -1386,16 +1391,21 @@ ipcp_insert_stage (void)
count = ipa_get_param_count (info);
replace_trees = VEC_alloc (ipa_replace_map_p, gc, 1);
- args_to_skip = BITMAP_GGC_ALLOC ();
+
+ if (node->local.can_change_signature)
+ args_to_skip = BITMAP_GGC_ALLOC ();
+ else
+ args_to_skip = NULL;
for (i = 0; i < count; i++)
{
struct ipcp_lattice *lat = ipcp_get_lattice (info, i);
parm_tree = ipa_get_param (info, i);
/* We can proactively remove obviously unused arguments. */
- if (!ipa_is_param_used (info, i))
+ if (!ipa_is_param_used (info, i))
{
- bitmap_set_bit (args_to_skip, i);
+ if (args_to_skip)
+ bitmap_set_bit (args_to_skip, i);
continue;
}
@@ -1404,7 +1414,8 @@ ipcp_insert_stage (void)
replace_param =
ipcp_create_replace_map (parm_tree, lat);
VEC_safe_push (ipa_replace_map_p, gc, replace_trees, replace_param);
- bitmap_set_bit (args_to_skip, i);
+ if (args_to_skip)
+ bitmap_set_bit (args_to_skip, i);
}
}
@@ -1544,7 +1555,7 @@ static bool
cgraph_gate_cp (void)
{
/* FIXME: We should remove the optimize check after we ensure we never run
- IPA passes when not optimizng. */
+ IPA passes when not optimizing. */
return flag_ipa_cp && optimize;
}
diff --git a/gcc/ipa-inline.c b/gcc/ipa-inline.c
index 116abd6619a..10e57a8750e 100644
--- a/gcc/ipa-inline.c
+++ b/gcc/ipa-inline.c
@@ -333,7 +333,7 @@ cgraph_mark_inline_edge (struct cgraph_edge *e, bool update_original,
ncalls_inlined++;
/* FIXME: We should remove the optimize check after we ensure we never run
- IPA passes when not optimizng. */
+ IPA passes when not optimizing. */
if (flag_indirect_inlining && optimize)
return ipa_propagate_indirect_call_infos (curr, new_edges);
else
@@ -528,7 +528,7 @@ cgraph_edge_badness (struct cgraph_edge *edge, bool dump)
if (dump)
{
- fprintf (dump_file, " Badness calculcation for %s -> %s\n",
+ fprintf (dump_file, " Badness calculation for %s -> %s\n",
cgraph_node_name (edge->caller),
cgraph_node_name (edge->callee));
fprintf (dump_file, " growth %i, time %i-%i, size %i-%i\n",
@@ -653,7 +653,7 @@ update_edge_key (fibheap_t heap, struct cgraph_edge *edge)
/* fibheap_replace_key only decrease the keys.
When we increase the key we do not update heap
and instead re-insert the element once it becomes
- a minium of heap. */
+ a minimum of heap. */
if (badness < n->key)
{
fibheap_replace_key (heap, n, badness);
@@ -1006,7 +1006,7 @@ add_new_edges_to_heap (fibheap_t heap, VEC (cgraph_edge_p, heap) *new_edges)
All inline candidates are put into prioritized heap based on estimated
growth of the overall number of instructions and then update the estimates.
- INLINED and INLINED_CALEES are just pointers to arrays large enough
+ INLINED and INLINED_CALLEES are just pointers to arrays large enough
to be passed to cgraph_inlined_into and cgraph_inlined_callees. */
static void
@@ -1118,7 +1118,7 @@ cgraph_decide_inlining_of_small_functions (void)
??? When the frequencies are taken into account we might not need this
restriction.
- We need to be cureful here, in some testcases, e.g. directivec.c in
+ We need to be careful here, in some testcases, e.g. directives.c in
libcpp, we can estimate self recursive function to have negative growth
for inlining completely.
*/
@@ -1643,7 +1643,6 @@ cgraph_decide_inlining_incrementally (struct cgraph_node *node,
during incremental inlining. */
&& !node->local.disregard_inline_limits)
{
- bitmap visited = BITMAP_ALLOC (NULL);
for (e = node->callees; e; e = e->next_callee)
{
int allowed_growth = 0;
@@ -1651,10 +1650,6 @@ cgraph_decide_inlining_incrementally (struct cgraph_node *node,
|| !e->inline_failed
|| e->callee->local.disregard_inline_limits)
continue;
- /* We are inlining a function to all call-sites in node
- or to none. So visit each candidate only once. */
- if (!bitmap_set_bit (visited, e->callee->uid))
- continue;
if (dump_file)
fprintf (dump_file, "Considering inline candidate %s.\n",
cgraph_node_name (e->callee));
@@ -1727,7 +1722,6 @@ cgraph_decide_inlining_incrementally (struct cgraph_node *node,
inlined = true;
}
}
- BITMAP_FREE (visited);
}
return inlined;
}
@@ -1821,7 +1815,7 @@ struct gimple_opt_pass pass_early_inline =
0 - means not eliminated
1 - half of statements goes away
2 - for sure it is eliminated.
- We are not terribly sophisficated, basically looking for simple abstraction
+ We are not terribly sophisticated, basically looking for simple abstraction
penalty wrappers. */
static int
@@ -1981,30 +1975,43 @@ estimate_function_body_sizes (struct cgraph_node *node)
}
/* Compute parameters of functions used by inliner. */
-unsigned int
+void
compute_inline_parameters (struct cgraph_node *node)
{
HOST_WIDE_INT self_stack_size;
gcc_assert (!node->global.inlined_to);
- /* Estimate the stack size for the function. But not at -O0
- because estimated_stack_frame_size is a quadratic problem. */
- self_stack_size = optimize ? estimated_stack_frame_size (node->decl) : 0;
+ /* Estimate the stack size for the function if we're optimizing. */
+ self_stack_size = optimize ? estimated_stack_frame_size (node) : 0;
inline_summary (node)->estimated_self_stack_size = self_stack_size;
node->global.estimated_stack_size = self_stack_size;
node->global.stack_frame_offset = 0;
/* Can this function be inlined at all? */
node->local.inlinable = tree_inlinable_function_p (node->decl);
- if (node->local.inlinable && !node->local.disregard_inline_limits)
- node->local.disregard_inline_limits
- = DECL_DISREGARD_INLINE_LIMITS (node->decl);
+ if (!node->local.inlinable)
+ node->local.disregard_inline_limits = 0;
+
+ /* Inlinable functions always can change signature. */
+ if (node->local.inlinable)
+ node->local.can_change_signature = true;
+ else
+ {
+ struct cgraph_edge *e;
+
+ /* Functions calling builtin_apply can not change signature. */
+ for (e = node->callees; e; e = e->next_callee)
+ if (DECL_BUILT_IN (e->callee->decl)
+ && DECL_BUILT_IN_CLASS (e->callee->decl) == BUILT_IN_NORMAL
+ && DECL_FUNCTION_CODE (e->callee->decl) == BUILT_IN_APPLY_ARGS)
+ break;
+ node->local.can_change_signature = !e;
+ }
estimate_function_body_sizes (node);
/* Inlining characteristics are maintained by the cgraph_mark_inline. */
node->global.time = inline_summary (node)->self_time;
node->global.size = inline_summary (node)->self_size;
- return 0;
}
@@ -2036,7 +2043,7 @@ struct gimple_opt_pass pass_inline_parameters =
}
};
-/* This function performs intraprocedural analyzis in NODE that is required to
+/* This function performs intraprocedural analysis in NODE that is required to
inline indirect calls. */
static void
inline_indirect_intraprocedural_analysis (struct cgraph_node *node)
@@ -2058,7 +2065,7 @@ analyze_function (struct cgraph_node *node)
compute_inline_parameters (node);
/* FIXME: We should remove the optimize check after we ensure we never run
- IPA passes when not optimizng. */
+ IPA passes when not optimizing. */
if (flag_indirect_inlining && optimize)
inline_indirect_intraprocedural_analysis (node);
@@ -2104,7 +2111,7 @@ inline_transform (struct cgraph_node *node)
struct cgraph_edge *e;
bool inline_p = false;
- /* FIXME: Currently the passmanager is adding inline transform more than once to some
+ /* FIXME: Currently the pass manager is adding inline transform more than once to some
clones. This needs revisiting after WPA cleanups. */
if (cfun->after_inlining)
return 0;
diff --git a/gcc/ipa-prop.c b/gcc/ipa-prop.c
index 1970881c686..82599f1d10c 100644
--- a/gcc/ipa-prop.c
+++ b/gcc/ipa-prop.c
@@ -416,7 +416,7 @@ stmt_may_be_vtbl_ptr_store (gimple stmt)
return true;
}
-/* Callbeck of walk_aliased_vdefs and a helper function for
+/* Callback of walk_aliased_vdefs and a helper function for
detect_type_change to check whether a particular statement may modify
the virtual table pointer, and if possible also determine the new type of
the (sub-)object. It stores its result into DATA, which points to a
@@ -679,7 +679,7 @@ compute_complex_ancestor_jump_func (struct ipa_node_params *info,
}
}
-/* Given OP whch is passed as an actual argument to a called function,
+/* Given OP which is passed as an actual argument to a called function,
determine if it is possible to construct a KNOWN_TYPE jump function for it
and if so, create one and store it to JFUNC. */
@@ -899,7 +899,7 @@ fill_member_ptr_cst_jump_function (struct ipa_jump_func *jfunc,
jfunc->value.member_cst.delta = delta;
}
-/* If RHS is an SSA_NAMe and it is defined by a simple copy assign statement,
+/* If RHS is an SSA_NAME and it is defined by a simple copy assign statement,
return the rhs of its defining statement. */
static inline tree
@@ -1516,7 +1516,7 @@ ipa_analyze_params_uses (struct cgraph_node *node,
}
/* Initialize the array describing properties of of formal parameters of NODE,
- analyze their uses and and compute jump functions associated witu actual
+ analyze their uses and and compute jump functions associated with actual
arguments of calls from within NODE. */
void
@@ -1546,7 +1546,7 @@ ipa_analyze_node (struct cgraph_node *node)
}
-/* Update the jump function DST when the call graph edge correspondng to SRC is
+/* Update the jump function DST when the call graph edge corresponding to SRC is
is being inlined, knowing that DST is of type ancestor and src of known
type. */
@@ -1704,7 +1704,7 @@ try_make_edge_direct_simple_call (struct cgraph_edge *ie,
}
/* Try to find a destination for indirect edge IE that corresponds to a
- virtuall call based on a formal parameter which is described by jump
+ virtual call based on a formal parameter which is described by jump
function JFUNC and if it can be determined, make it direct and return the
direct edge. Otherwise, return NULL. */
@@ -2054,7 +2054,7 @@ ipa_unregister_cgraph_hooks (void)
node_duplication_hook_holder = NULL;
}
-/* Allocate all necessary data strucutures necessary for indirect inlining. */
+/* Allocate all necessary data structures necessary for indirect inlining. */
void
ipa_create_all_structures_for_iinln (void)
@@ -2783,7 +2783,7 @@ ipa_write_node_info (struct output_block *ob, struct cgraph_node *node)
ipa_write_indirect_edge_info (ob, e);
}
-/* Srtream in NODE info from IB. */
+/* Stream in NODE info from IB. */
static void
ipa_read_node_info (struct lto_input_block *ib, struct cgraph_node *node,
@@ -2919,7 +2919,7 @@ ipa_prop_read_jump_functions (void)
}
/* After merging units, we can get mismatch in argument counts.
- Also decl merging might've rendered parameter lists obsolette.
+ Also decl merging might've rendered parameter lists obsolete.
Also compute called_with_variable_arg info. */
void
diff --git a/gcc/ipa-pure-const.c b/gcc/ipa-pure-const.c
index 101e8c90b12..3b4cc02f12c 100644
--- a/gcc/ipa-pure-const.c
+++ b/gcc/ipa-pure-const.c
@@ -423,7 +423,7 @@ worse_state (enum pure_const_state_e *state, bool *looping,
*looping = MAX (*looping, looping2);
}
-/* Recognize special cases of builtins that are by themself not pure or const
+/* Recognize special cases of builtins that are by themselves not pure or const
but function using them is. */
static bool
special_builtin_state (enum pure_const_state_e *state, bool *looping,
@@ -547,7 +547,7 @@ check_call (funct_state local, gimple call, bool ipa)
fprintf (dump_file, " Recursive call can loop.\n");
local->looping = true;
}
- /* Either calle is unknown or we are doing local analysis.
+ /* Either callee is unknown or we are doing local analysis.
Look to see if there are any bits available for the callee (such as by
declaration or because it is builtin) and process solely on the basis of
those bits. */
@@ -771,7 +771,7 @@ end:
if (mark_dfs_back_edges ())
{
/* Preheaders are needed for SCEV to work.
- Simple lateches and recorded exits improve chances that loop will
+ Simple latches and recorded exits improve chances that loop will
proved to be finite in testcases such as in loop-15.c and loop-24.c */
loop_optimizer_init (LOOPS_NORMAL
| LOOPS_HAVE_RECORDED_EXITS);
@@ -916,7 +916,7 @@ generate_summary (void)
We process AVAIL_OVERWRITABLE functions. We can not use the results
by default, but the info can be used at LTO with -fwhole-program or
- when function got clonned and the clone is AVAILABLE. */
+ when function got cloned and the clone is AVAILABLE. */
for (node = cgraph_nodes; node; node = node->next)
if (cgraph_function_body_availability (node) >= AVAIL_OVERWRITABLE)
@@ -1545,7 +1545,7 @@ skip_function_for_local_pure_const (struct cgraph_node *node)
if (cgraph_function_body_availability (node) <= AVAIL_OVERWRITABLE)
{
if (dump_file)
- fprintf (dump_file, "Function is not available or overwrittable; not analyzing.\n");
+ fprintf (dump_file, "Function is not available or overwritable; not analyzing.\n");
return true;
}
return false;
diff --git a/gcc/ipa-ref.c b/gcc/ipa-ref.c
index 27c32dcd3d6..db70e6e96af 100644
--- a/gcc/ipa-ref.c
+++ b/gcc/ipa-ref.c
@@ -197,7 +197,7 @@ ipa_dump_refering (FILE * file, struct ipa_ref_list *list)
fprintf (file, "\n");
}
-/* Clone all references from SRC to DEST_NODE or DEST_VARPOL_NODE. */
+/* Clone all references from SRC to DEST_NODE or DEST_VARPOOL_NODE. */
void
ipa_clone_references (struct cgraph_node *dest_node,
@@ -215,7 +215,7 @@ ipa_clone_references (struct cgraph_node *dest_node,
ref->use, ref->stmt);
}
-/* Clone all refering from SRC to DEST_NODE or DEST_VARPOL_NODE. */
+/* Clone all refering from SRC to DEST_NODE or DEST_VARPOOL_NODE. */
void
ipa_clone_refering (struct cgraph_node *dest_node,
diff --git a/gcc/ipa-reference.c b/gcc/ipa-reference.c
index a2a8517c78a..f874a2e80ef 100644
--- a/gcc/ipa-reference.c
+++ b/gcc/ipa-reference.c
@@ -86,7 +86,7 @@ struct ipa_reference_global_vars_info_d
bitmap statics_written;
};
-/* Information we save about every function after ipa-reference is completted. */
+/* Information we save about every function after ipa-reference is completed. */
struct ipa_reference_optimization_summary_d
{
@@ -658,7 +658,7 @@ propagate (void)
read_all = false;
write_all = false;
- /* When function is overwrittable, we can not assume anything. */
+ /* When function is overwritable, we can not assume anything. */
if (cgraph_function_body_availability (node) <= AVAIL_OVERWRITABLE)
read_write_all_from_decl (node, &read_all, &write_all);
@@ -691,7 +691,7 @@ propagate (void)
if (dump_file && (dump_flags & TDF_DETAILS))
fprintf (dump_file, " Visiting %s/%i\n",
cgraph_node_name (w), w->uid);
- /* When function is overwrittable, we can not assume anything. */
+ /* When function is overwritable, we can not assume anything. */
if (cgraph_function_body_availability (w) <= AVAIL_OVERWRITABLE)
read_write_all_from_decl (w, &read_all, &write_all);
diff --git a/gcc/ipa-split.c b/gcc/ipa-split.c
index c72a36d67ee..3b26f61b1fb 100644
--- a/gcc/ipa-split.c
+++ b/gcc/ipa-split.c
@@ -411,9 +411,6 @@ consider_split (struct split_point *current, bitmap non_ssa_vars,
" Refused: split part has non-ssa uses\n");
return;
}
- if (dump_file && (dump_flags & TDF_DETAILS))
- fprintf (dump_file, " Accepted!\n");
-
/* See if retval used by return bb is computed by header or split part.
When it is computed by split part, we need to produce return statement
in the split part and add code to header to pass it around.
@@ -451,6 +448,30 @@ consider_split (struct split_point *current, bitmap non_ssa_vars,
else
current->split_part_set_retval = true;
+ /* split_function fixes up at most one PHI non-virtual PHI node in return_bb,
+ for the return value. If there are other PHIs, give up. */
+ if (return_bb != EXIT_BLOCK_PTR)
+ {
+ gimple_stmt_iterator psi;
+
+ for (psi = gsi_start_phis (return_bb); !gsi_end_p (psi); gsi_next (&psi))
+ if (is_gimple_reg (gimple_phi_result (gsi_stmt (psi)))
+ && !(retval
+ && current->split_part_set_retval
+ && TREE_CODE (retval) == SSA_NAME
+ && !DECL_BY_REFERENCE (DECL_RESULT (current_function_decl))
+ && SSA_NAME_DEF_STMT (retval) == gsi_stmt (psi)))
+ {
+ if (dump_file && (dump_flags & TDF_DETAILS))
+ fprintf (dump_file,
+ " Refused: return bb has extra PHIs\n");
+ return;
+ }
+ }
+
+ if (dump_file && (dump_flags & TDF_DETAILS))
+ fprintf (dump_file, " Accepted!\n");
+
/* At the moment chose split point with lowest frequency and that leaves
out smallest size of header.
In future we might re-consider this heuristics. */
@@ -622,11 +643,10 @@ visit_bb (basic_block bb, basic_block return_bb,
into different partitions. This would require tracking of
EH regions and checking in consider_split_point if they
are not used elsewhere. */
- if (gimple_code (stmt) == GIMPLE_RESX
- && stmt_can_throw_external (stmt))
+ if (gimple_code (stmt) == GIMPLE_RESX)
{
if (dump_file && (dump_flags & TDF_DETAILS))
- fprintf (dump_file, "Cannot split: external resx.\n");
+ fprintf (dump_file, "Cannot split: resx.\n");
can_split = false;
}
if (gimple_code (stmt) == GIMPLE_EH_DISPATCH)
@@ -649,6 +669,7 @@ visit_bb (basic_block bb, basic_block return_bb,
way to store builtin_stack_save result in non-SSA variable
since all calls to those are compiler generated. */
case BUILT_IN_APPLY:
+ case BUILT_IN_APPLY_ARGS:
case BUILT_IN_VA_START:
if (dump_file && (dump_flags & TDF_DETAILS))
fprintf (dump_file,
diff --git a/gcc/ipa-struct-reorg.c b/gcc/ipa-struct-reorg.c
index ae18da2cda2..7ab321eee47 100644
--- a/gcc/ipa-struct-reorg.c
+++ b/gcc/ipa-struct-reorg.c
@@ -2712,7 +2712,7 @@ create_new_local_vars (void)
new_local_vars = htab_create (num_referenced_vars,
new_var_hash, new_var_eq, NULL);
- FOR_EACH_REFERENCED_VAR (var, rvi)
+ FOR_EACH_REFERENCED_VAR (cfun, var, rvi)
{
if (!is_global_var (var))
create_new_var (var, new_local_vars);
diff --git a/gcc/ira-color.c b/gcc/ira-color.c
index acfaf6386e3..923a8eea621 100644
--- a/gcc/ira-color.c
+++ b/gcc/ira-color.c
@@ -292,7 +292,8 @@ update_copy_costs (ira_allocno_t allocno, bool decr_p)
gcc_unreachable ();
cover_class = ALLOCNO_COVER_CLASS (another_allocno);
- if (! ira_reg_classes_intersect_p[rclass][cover_class]
+ if (! TEST_HARD_REG_BIT (reg_class_contents[cover_class],
+ hard_regno)
|| ALLOCNO_ASSIGNED_P (another_allocno))
continue;
diff --git a/gcc/ira.c b/gcc/ira.c
index 3e01b01fb83..0d934b921bf 100644
--- a/gcc/ira.c
+++ b/gcc/ira.c
@@ -1033,22 +1033,14 @@ find_reg_class_closure (void)
static void
setup_hard_regno_cover_class (void)
{
- int i, j;
- enum reg_class cl;
+ int i;
for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
{
- ira_hard_regno_cover_class[i] = NO_REGS;
- for (j = 0; j < ira_reg_class_cover_size; j++)
- {
- cl = ira_reg_class_cover[j];
- if (ira_class_hard_reg_index[cl][i] >= 0)
- {
- ira_hard_regno_cover_class[i] = cl;
- break;
- }
- }
-
+ ira_hard_regno_cover_class[i]
+ = (TEST_HARD_REG_BIT (no_unit_alloc_regs, i)
+ ? NO_REGS
+ : ira_class_translate[REGNO_REG_CLASS (i)]);
}
}
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog
index 77281e98804..5b95565b308 100644
--- a/gcc/java/ChangeLog
+++ b/gcc/java/ChangeLog
@@ -1,3 +1,13 @@
+2011-02-13 Joseph Myers <joseph@codesourcery.com>
+
+ * jvspec.c (jvgenmain_spec): Remove %{a*}.
+
+2011-01-21 Kai Tietz <kai.tietz@onevision.com>
+
+ PR bootstrap/47215
+ * decl.c (java_init_decl_processing): Remove
+ va_list_type_node related type initializations.
+
2011-01-11 Kai Tietz <kai.tietz@onevision.com>
PR bootstrap/47215
diff --git a/gcc/java/decl.c b/gcc/java/decl.c
index d575a422334..a17b826696b 100644
--- a/gcc/java/decl.c
+++ b/gcc/java/decl.c
@@ -1153,21 +1153,6 @@ java_init_decl_processing (void)
soft_lrem_node
= add_builtin_function ("_Jv_remJ", t,
0, NOT_BUILT_IN, NULL, NULL_TREE);
- /* Initialize va_list_type_node. */
- unsigned_type_node = make_unsigned_type (INT_TYPE_SIZE);
- long_integer_type_node = make_signed_type (LONG_TYPE_SIZE);
-
- t = targetm.build_builtin_va_list ();
-
- /* Many back-ends define record types without setting TYPE_NAME.
- If we copied the record type here, we'd keep the original
- record type without a name. This breaks name mangling. So,
- don't copy record types and let c_common_nodes_and_builtins()
- declare the type to be __builtin_va_list. */
- if (TREE_CODE (t) != RECORD_TYPE)
- t = build_variant_type_copy (t);
-
- va_list_type_node = t;
initialize_builtins ();
diff --git a/gcc/java/jvspec.c b/gcc/java/jvspec.c
index 4240db1230d..c7762422f7b 100644
--- a/gcc/java/jvspec.c
+++ b/gcc/java/jvspec.c
@@ -1,7 +1,7 @@
/* Specific flags and argument handling of the front-end of the
GNU compiler for the Java(TM) language.
Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
- 2005, 2006, 2007, 2009, 2010 Free Software Foundation, Inc.
+ 2005, 2006, 2007, 2009, 2010, 2011 Free Software Foundation, Inc.
This file is part of GCC.
@@ -59,7 +59,7 @@ int shared_libgcc = 1;
static const char jvgenmain_spec[] =
"jvgenmain %{findirect-dispatch} %{D*} %b %m.i |\n\
cc1 %m.i %1 \
- %{!Q:-quiet} -dumpbase %b.c %{d*} %{m*} %{a*}\
+ %{!Q:-quiet} -dumpbase %b.c %{d*} %{m*}\
%{g*} %{O*} \
%{v:-version} %{pg:-p} %{p}\
%<fbounds-check %<fno-bounds-check\
diff --git a/gcc/lambda-code.c b/gcc/lambda-code.c
deleted file mode 100644
index f46207145c8..00000000000
--- a/gcc/lambda-code.c
+++ /dev/null
@@ -1,2855 +0,0 @@
-/* Loop transformation code generation
- Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
- Free Software Foundation, Inc.
- Contributed by Daniel Berlin <dberlin@dberlin.org>
-
- This file is part of GCC.
-
- GCC is free software; you can redistribute it and/or modify it under
- the terms of the GNU General Public License as published by the Free
- Software Foundation; either version 3, or (at your option) any later
- version.
-
- GCC is distributed in the hope that it will be useful, but WITHOUT ANY
- WARRANTY; without even the implied warranty of MERCHANTABILITY or
- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- for more details.
-
- You should have received a copy of the GNU General Public License
- along with GCC; see the file COPYING3. If not see
- <http://www.gnu.org/licenses/>. */
-
-#include "config.h"
-#include "system.h"
-#include "coretypes.h"
-#include "tree-flow.h"
-#include "cfgloop.h"
-#include "tree-chrec.h"
-#include "tree-data-ref.h"
-#include "tree-scalar-evolution.h"
-#include "lambda.h"
-#include "tree-pass.h"
-
-/* This loop nest code generation is based on non-singular matrix
- math.
-
- A little terminology and a general sketch of the algorithm. See "A singular
- loop transformation framework based on non-singular matrices" by Wei Li and
- Keshav Pingali for formal proofs that the various statements below are
- correct.
-
- A loop iteration space represents the points traversed by the loop. A point in the
- iteration space can be represented by a vector of size <loop depth>. You can
- therefore represent the iteration space as an integral combinations of a set
- of basis vectors.
-
- A loop iteration space is dense if every integer point between the loop
- bounds is a point in the iteration space. Every loop with a step of 1
- therefore has a dense iteration space.
-
- for i = 1 to 3, step 1 is a dense iteration space.
-
- A loop iteration space is sparse if it is not dense. That is, the iteration
- space skips integer points that are within the loop bounds.
-
- for i = 1 to 3, step 2 is a sparse iteration space, because the integer point
- 2 is skipped.
-
- Dense source spaces are easy to transform, because they don't skip any
- points to begin with. Thus we can compute the exact bounds of the target
- space using min/max and floor/ceil.
-
- For a dense source space, we take the transformation matrix, decompose it
- into a lower triangular part (H) and a unimodular part (U).
- We then compute the auxiliary space from the unimodular part (source loop
- nest . U = auxiliary space) , which has two important properties:
- 1. It traverses the iterations in the same lexicographic order as the source
- space.
- 2. It is a dense space when the source is a dense space (even if the target
- space is going to be sparse).
-
- Given the auxiliary space, we use the lower triangular part to compute the
- bounds in the target space by simple matrix multiplication.
- The gaps in the target space (IE the new loop step sizes) will be the
- diagonals of the H matrix.
-
- Sparse source spaces require another step, because you can't directly compute
- the exact bounds of the auxiliary and target space from the sparse space.
- Rather than try to come up with a separate algorithm to handle sparse source
- spaces directly, we just find a legal transformation matrix that gives you
- the sparse source space, from a dense space, and then transform the dense
- space.
-
- For a regular sparse space, you can represent the source space as an integer
- lattice, and the base space of that lattice will always be dense. Thus, we
- effectively use the lattice to figure out the transformation from the lattice
- base space, to the sparse iteration space (IE what transform was applied to
- the dense space to make it sparse). We then compose this transform with the
- transformation matrix specified by the user (since our matrix transformations
- are closed under composition, this is okay). We can then use the base space
- (which is dense) plus the composed transformation matrix, to compute the rest
- of the transform using the dense space algorithm above.
-
- In other words, our sparse source space (B) is decomposed into a dense base
- space (A), and a matrix (L) that transforms A into B, such that A.L = B.
- We then compute the composition of L and the user transformation matrix (T),
- so that T is now a transform from A to the result, instead of from B to the
- result.
- IE A.(LT) = result instead of B.T = result
- Since A is now a dense source space, we can use the dense source space
- algorithm above to compute the result of applying transform (LT) to A.
-
- Fourier-Motzkin elimination is used to compute the bounds of the base space
- of the lattice. */
-
-static bool perfect_nestify (struct loop *, VEC(tree,heap) *,
- VEC(tree,heap) *, VEC(int,heap) *,
- VEC(tree,heap) *);
-/* Lattice stuff that is internal to the code generation algorithm. */
-
-typedef struct lambda_lattice_s
-{
- /* Lattice base matrix. */
- lambda_matrix base;
- /* Lattice dimension. */
- int dimension;
- /* Origin vector for the coefficients. */
- lambda_vector origin;
- /* Origin matrix for the invariants. */
- lambda_matrix origin_invariants;
- /* Number of invariants. */
- int invariants;
-} *lambda_lattice;
-
-#define LATTICE_BASE(T) ((T)->base)
-#define LATTICE_DIMENSION(T) ((T)->dimension)
-#define LATTICE_ORIGIN(T) ((T)->origin)
-#define LATTICE_ORIGIN_INVARIANTS(T) ((T)->origin_invariants)
-#define LATTICE_INVARIANTS(T) ((T)->invariants)
-
-static bool lle_equal (lambda_linear_expression, lambda_linear_expression,
- int, int);
-static lambda_lattice lambda_lattice_new (int, int, struct obstack *);
-static lambda_lattice lambda_lattice_compute_base (lambda_loopnest,
- struct obstack *);
-
-static bool can_convert_to_perfect_nest (struct loop *);
-
-/* Create a new lambda loop in LAMBDA_OBSTACK. */
-
-static lambda_loop
-lambda_loop_new (struct obstack * lambda_obstack)
-{
- lambda_loop result = (lambda_loop)
- obstack_alloc (lambda_obstack, sizeof (struct lambda_loop_s));
- memset (result, 0, sizeof (struct lambda_loop_s));
- return result;
-}
-
-/* Create a new lambda body vector. */
-
-lambda_body_vector
-lambda_body_vector_new (int size, struct obstack * lambda_obstack)
-{
- lambda_body_vector ret;
-
- ret = (lambda_body_vector) obstack_alloc (lambda_obstack,
- sizeof (*ret));
- LBV_COEFFICIENTS (ret) = lambda_vector_new (size);
- LBV_SIZE (ret) = size;
- LBV_DENOMINATOR (ret) = 1;
- return ret;
-}
-
-/* Compute the new coefficients for the vector based on the
- *inverse* of the transformation matrix. */
-
-lambda_body_vector
-lambda_body_vector_compute_new (lambda_trans_matrix transform,
- lambda_body_vector vect,
- struct obstack * lambda_obstack)
-{
- lambda_body_vector temp;
- int depth;
-
- /* Make sure the matrix is square. */
- gcc_assert (LTM_ROWSIZE (transform) == LTM_COLSIZE (transform));
-
- depth = LTM_ROWSIZE (transform);
-
- temp = lambda_body_vector_new (depth, lambda_obstack);
- LBV_DENOMINATOR (temp) =
- LBV_DENOMINATOR (vect) * LTM_DENOMINATOR (transform);
- lambda_vector_matrix_mult (LBV_COEFFICIENTS (vect), depth,
- LTM_MATRIX (transform), depth,
- LBV_COEFFICIENTS (temp));
- LBV_SIZE (temp) = LBV_SIZE (vect);
- return temp;
-}
-
-/* Print out a lambda body vector. */
-
-void
-print_lambda_body_vector (FILE * outfile, lambda_body_vector body)
-{
- print_lambda_vector (outfile, LBV_COEFFICIENTS (body), LBV_SIZE (body));
-}
-
-/* Return TRUE if two linear expressions are equal. */
-
-static bool
-lle_equal (lambda_linear_expression lle1, lambda_linear_expression lle2,
- int depth, int invariants)
-{
- int i;
-
- if (lle1 == NULL || lle2 == NULL)
- return false;
- if (LLE_CONSTANT (lle1) != LLE_CONSTANT (lle2))
- return false;
- if (LLE_DENOMINATOR (lle1) != LLE_DENOMINATOR (lle2))
- return false;
- for (i = 0; i < depth; i++)
- if (LLE_COEFFICIENTS (lle1)[i] != LLE_COEFFICIENTS (lle2)[i])
- return false;
- for (i = 0; i < invariants; i++)
- if (LLE_INVARIANT_COEFFICIENTS (lle1)[i] !=
- LLE_INVARIANT_COEFFICIENTS (lle2)[i])
- return false;
- return true;
-}
-
-/* Create a new linear expression with dimension DIM, and total number
- of invariants INVARIANTS. */
-
-lambda_linear_expression
-lambda_linear_expression_new (int dim, int invariants,
- struct obstack * lambda_obstack)
-{
- lambda_linear_expression ret;
-
- ret = (lambda_linear_expression)obstack_alloc (lambda_obstack,
- sizeof (*ret));
- LLE_COEFFICIENTS (ret) = lambda_vector_new (dim);
- LLE_CONSTANT (ret) = 0;
- LLE_INVARIANT_COEFFICIENTS (ret) = lambda_vector_new (invariants);
- LLE_DENOMINATOR (ret) = 1;
- LLE_NEXT (ret) = NULL;
-
- return ret;
-}
-
-/* Print out a linear expression EXPR, with SIZE coefficients, to OUTFILE.
- The starting letter used for variable names is START. */
-
-static void
-print_linear_expression (FILE * outfile, lambda_vector expr, int size,
- char start)
-{
- int i;
- bool first = true;
- for (i = 0; i < size; i++)
- {
- if (expr[i] != 0)
- {
- if (first)
- {
- if (expr[i] < 0)
- fprintf (outfile, "-");
- first = false;
- }
- else if (expr[i] > 0)
- fprintf (outfile, " + ");
- else
- fprintf (outfile, " - ");
- if (abs (expr[i]) == 1)
- fprintf (outfile, "%c", start + i);
- else
- fprintf (outfile, "%d%c", abs (expr[i]), start + i);
- }
- }
-}
-
-/* Print out a lambda linear expression structure, EXPR, to OUTFILE. The
- depth/number of coefficients is given by DEPTH, the number of invariants is
- given by INVARIANTS, and the character to start variable names with is given
- by START. */
-
-void
-print_lambda_linear_expression (FILE * outfile,
- lambda_linear_expression expr,
- int depth, int invariants, char start)
-{
- fprintf (outfile, "\tLinear expression: ");
- print_linear_expression (outfile, LLE_COEFFICIENTS (expr), depth, start);
- fprintf (outfile, " constant: %d ", LLE_CONSTANT (expr));
- fprintf (outfile, " invariants: ");
- print_linear_expression (outfile, LLE_INVARIANT_COEFFICIENTS (expr),
- invariants, 'A');
- fprintf (outfile, " denominator: %d\n", LLE_DENOMINATOR (expr));
-}
-
-/* Print a lambda loop structure LOOP to OUTFILE. The depth/number of
- coefficients is given by DEPTH, the number of invariants is
- given by INVARIANTS, and the character to start variable names with is given
- by START. */
-
-void
-print_lambda_loop (FILE * outfile, lambda_loop loop, int depth,
- int invariants, char start)
-{
- int step;
- lambda_linear_expression expr;
-
- gcc_assert (loop);
-
- expr = LL_LINEAR_OFFSET (loop);
- step = LL_STEP (loop);
- fprintf (outfile, " step size = %d \n", step);
-
- if (expr)
- {
- fprintf (outfile, " linear offset: \n");
- print_lambda_linear_expression (outfile, expr, depth, invariants,
- start);
- }
-
- fprintf (outfile, " lower bound: \n");
- for (expr = LL_LOWER_BOUND (loop); expr != NULL; expr = LLE_NEXT (expr))
- print_lambda_linear_expression (outfile, expr, depth, invariants, start);
- fprintf (outfile, " upper bound: \n");
- for (expr = LL_UPPER_BOUND (loop); expr != NULL; expr = LLE_NEXT (expr))
- print_lambda_linear_expression (outfile, expr, depth, invariants, start);
-}
-
-/* Create a new loop nest structure with DEPTH loops, and INVARIANTS as the
- number of invariants. */
-
-lambda_loopnest
-lambda_loopnest_new (int depth, int invariants,
- struct obstack * lambda_obstack)
-{
- lambda_loopnest ret;
- ret = (lambda_loopnest)obstack_alloc (lambda_obstack, sizeof (*ret));
-
- LN_LOOPS (ret) = (lambda_loop *)
- obstack_alloc (lambda_obstack, depth * sizeof(LN_LOOPS(ret)));
- LN_DEPTH (ret) = depth;
- LN_INVARIANTS (ret) = invariants;
-
- return ret;
-}
-
-/* Print a lambda loopnest structure, NEST, to OUTFILE. The starting
- character to use for loop names is given by START. */
-
-void
-print_lambda_loopnest (FILE * outfile, lambda_loopnest nest, char start)
-{
- int i;
- for (i = 0; i < LN_DEPTH (nest); i++)
- {
- fprintf (outfile, "Loop %c\n", start + i);
- print_lambda_loop (outfile, LN_LOOPS (nest)[i], LN_DEPTH (nest),
- LN_INVARIANTS (nest), 'i');
- fprintf (outfile, "\n");
- }
-}
-
-/* Allocate a new lattice structure of DEPTH x DEPTH, with INVARIANTS number
- of invariants. */
-
-static lambda_lattice
-lambda_lattice_new (int depth, int invariants, struct obstack * lambda_obstack)
-{
- lambda_lattice ret
- = (lambda_lattice)obstack_alloc (lambda_obstack, sizeof (*ret));
- LATTICE_BASE (ret) = lambda_matrix_new (depth, depth, lambda_obstack);
- LATTICE_ORIGIN (ret) = lambda_vector_new (depth);
- LATTICE_ORIGIN_INVARIANTS (ret) = lambda_matrix_new (depth, invariants,
- lambda_obstack);
- LATTICE_DIMENSION (ret) = depth;
- LATTICE_INVARIANTS (ret) = invariants;
- return ret;
-}
-
-/* Compute the lattice base for NEST. The lattice base is essentially a
- non-singular transform from a dense base space to a sparse iteration space.
- We use it so that we don't have to specially handle the case of a sparse
- iteration space in other parts of the algorithm. As a result, this routine
- only does something interesting (IE produce a matrix that isn't the
- identity matrix) if NEST is a sparse space. */
-
-static lambda_lattice
-lambda_lattice_compute_base (lambda_loopnest nest,
- struct obstack * lambda_obstack)
-{
- lambda_lattice ret;
- int depth, invariants;
- lambda_matrix base;
-
- int i, j, step;
- lambda_loop loop;
- lambda_linear_expression expression;
-
- depth = LN_DEPTH (nest);
- invariants = LN_INVARIANTS (nest);
-
- ret = lambda_lattice_new (depth, invariants, lambda_obstack);
- base = LATTICE_BASE (ret);
- for (i = 0; i < depth; i++)
- {
- loop = LN_LOOPS (nest)[i];
- gcc_assert (loop);
- step = LL_STEP (loop);
- /* If we have a step of 1, then the base is one, and the
- origin and invariant coefficients are 0. */
- if (step == 1)
- {
- for (j = 0; j < depth; j++)
- base[i][j] = 0;
- base[i][i] = 1;
- LATTICE_ORIGIN (ret)[i] = 0;
- for (j = 0; j < invariants; j++)
- LATTICE_ORIGIN_INVARIANTS (ret)[i][j] = 0;
- }
- else
- {
- /* Otherwise, we need the lower bound expression (which must
- be an affine function) to determine the base. */
- expression = LL_LOWER_BOUND (loop);
- gcc_assert (expression && !LLE_NEXT (expression)
- && LLE_DENOMINATOR (expression) == 1);
-
- /* The lower triangular portion of the base is going to be the
- coefficient times the step */
- for (j = 0; j < i; j++)
- base[i][j] = LLE_COEFFICIENTS (expression)[j]
- * LL_STEP (LN_LOOPS (nest)[j]);
- base[i][i] = step;
- for (j = i + 1; j < depth; j++)
- base[i][j] = 0;
-
- /* Origin for this loop is the constant of the lower bound
- expression. */
- LATTICE_ORIGIN (ret)[i] = LLE_CONSTANT (expression);
-
- /* Coefficient for the invariants are equal to the invariant
- coefficients in the expression. */
- for (j = 0; j < invariants; j++)
- LATTICE_ORIGIN_INVARIANTS (ret)[i][j] =
- LLE_INVARIANT_COEFFICIENTS (expression)[j];
- }
- }
- return ret;
-}
-
-/* Compute the least common multiple of two numbers A and B . */
-
-int
-least_common_multiple (int a, int b)
-{
- return (abs (a) * abs (b) / gcd (a, b));
-}
-
-/* Perform Fourier-Motzkin elimination to calculate the bounds of the
- auxiliary nest.
- Fourier-Motzkin is a way of reducing systems of linear inequalities so that
- it is easy to calculate the answer and bounds.
- A sketch of how it works:
- Given a system of linear inequalities, ai * xj >= bk, you can always
- rewrite the constraints so they are all of the form
- a <= x, or x <= b, or x >= constant for some x in x1 ... xj (and some b
- in b1 ... bk, and some a in a1...ai)
- You can then eliminate this x from the non-constant inequalities by
- rewriting these as a <= b, x >= constant, and delete the x variable.
- You can then repeat this for any remaining x variables, and then we have
- an easy to use variable <= constant (or no variables at all) form that we
- can construct our bounds from.
-
- In our case, each time we eliminate, we construct part of the bound from
- the ith variable, then delete the ith variable.
-
- Remember the constant are in our vector a, our coefficient matrix is A,
- and our invariant coefficient matrix is B.
-
- SIZE is the size of the matrices being passed.
- DEPTH is the loop nest depth.
- INVARIANTS is the number of loop invariants.
- A, B, and a are the coefficient matrix, invariant coefficient, and a
- vector of constants, respectively. */
-
-static lambda_loopnest
-compute_nest_using_fourier_motzkin (int size,
- int depth,
- int invariants,
- lambda_matrix A,
- lambda_matrix B,
- lambda_vector a,
- struct obstack * lambda_obstack)
-{
-
- int multiple, f1, f2;
- int i, j, k;
- lambda_linear_expression expression;
- lambda_loop loop;
- lambda_loopnest auxillary_nest;
- lambda_matrix swapmatrix, A1, B1;
- lambda_vector swapvector, a1;
- int newsize;
-
- A1 = lambda_matrix_new (128, depth, lambda_obstack);
- B1 = lambda_matrix_new (128, invariants, lambda_obstack);
- a1 = lambda_vector_new (128);
-
- auxillary_nest = lambda_loopnest_new (depth, invariants, lambda_obstack);
-
- for (i = depth - 1; i >= 0; i--)
- {
- loop = lambda_loop_new (lambda_obstack);
- LN_LOOPS (auxillary_nest)[i] = loop;
- LL_STEP (loop) = 1;
-
- for (j = 0; j < size; j++)
- {
- if (A[j][i] < 0)
- {
- /* Any linear expression in the matrix with a coefficient less
- than 0 becomes part of the new lower bound. */
- expression = lambda_linear_expression_new (depth, invariants,
- lambda_obstack);
-
- for (k = 0; k < i; k++)
- LLE_COEFFICIENTS (expression)[k] = A[j][k];
-
- for (k = 0; k < invariants; k++)
- LLE_INVARIANT_COEFFICIENTS (expression)[k] = -1 * B[j][k];
-
- LLE_DENOMINATOR (expression) = -1 * A[j][i];
- LLE_CONSTANT (expression) = -1 * a[j];
-
- /* Ignore if identical to the existing lower bound. */
- if (!lle_equal (LL_LOWER_BOUND (loop),
- expression, depth, invariants))
- {
- LLE_NEXT (expression) = LL_LOWER_BOUND (loop);
- LL_LOWER_BOUND (loop) = expression;
- }
-
- }
- else if (A[j][i] > 0)
- {
- /* Any linear expression with a coefficient greater than 0
- becomes part of the new upper bound. */
- expression = lambda_linear_expression_new (depth, invariants,
- lambda_obstack);
- for (k = 0; k < i; k++)
- LLE_COEFFICIENTS (expression)[k] = -1 * A[j][k];
-
- for (k = 0; k < invariants; k++)
- LLE_INVARIANT_COEFFICIENTS (expression)[k] = B[j][k];
-
- LLE_DENOMINATOR (expression) = A[j][i];
- LLE_CONSTANT (expression) = a[j];
-
- /* Ignore if identical to the existing upper bound. */
- if (!lle_equal (LL_UPPER_BOUND (loop),
- expression, depth, invariants))
- {
- LLE_NEXT (expression) = LL_UPPER_BOUND (loop);
- LL_UPPER_BOUND (loop) = expression;
- }
-
- }
- }
-
- /* This portion creates a new system of linear inequalities by deleting
- the i'th variable, reducing the system by one variable. */
- newsize = 0;
- for (j = 0; j < size; j++)
- {
- /* If the coefficient for the i'th variable is 0, then we can just
- eliminate the variable straightaway. Otherwise, we have to
- multiply through by the coefficients we are eliminating. */
- if (A[j][i] == 0)
- {
- lambda_vector_copy (A[j], A1[newsize], depth);
- lambda_vector_copy (B[j], B1[newsize], invariants);
- a1[newsize] = a[j];
- newsize++;
- }
- else if (A[j][i] > 0)
- {
- for (k = 0; k < size; k++)
- {
- if (A[k][i] < 0)
- {
- multiple = least_common_multiple (A[j][i], A[k][i]);
- f1 = multiple / A[j][i];
- f2 = -1 * multiple / A[k][i];
-
- lambda_vector_add_mc (A[j], f1, A[k], f2,
- A1[newsize], depth);
- lambda_vector_add_mc (B[j], f1, B[k], f2,
- B1[newsize], invariants);
- a1[newsize] = f1 * a[j] + f2 * a[k];
- newsize++;
- }
- }
- }
- }
-
- swapmatrix = A;
- A = A1;
- A1 = swapmatrix;
-
- swapmatrix = B;
- B = B1;
- B1 = swapmatrix;
-
- swapvector = a;
- a = a1;
- a1 = swapvector;
-
- size = newsize;
- }
-
- return auxillary_nest;
-}
-
-/* Compute the loop bounds for the auxiliary space NEST.
- Input system used is Ax <= b. TRANS is the unimodular transformation.
- Given the original nest, this function will
- 1. Convert the nest into matrix form, which consists of a matrix for the
- coefficients, a matrix for the
- invariant coefficients, and a vector for the constants.
- 2. Use the matrix form to calculate the lattice base for the nest (which is
- a dense space)
- 3. Compose the dense space transform with the user specified transform, to
- get a transform we can easily calculate transformed bounds for.
- 4. Multiply the composed transformation matrix times the matrix form of the
- loop.
- 5. Transform the newly created matrix (from step 4) back into a loop nest
- using Fourier-Motzkin elimination to figure out the bounds. */
-
-static lambda_loopnest
-lambda_compute_auxillary_space (lambda_loopnest nest,
- lambda_trans_matrix trans,
- struct obstack * lambda_obstack)
-{
- lambda_matrix A, B, A1, B1;
- lambda_vector a, a1;
- lambda_matrix invertedtrans;
- int depth, invariants, size;
- int i, j;
- lambda_loop loop;
- lambda_linear_expression expression;
- lambda_lattice lattice;
-
- depth = LN_DEPTH (nest);
- invariants = LN_INVARIANTS (nest);
-
- /* Unfortunately, we can't know the number of constraints we'll have
- ahead of time, but this should be enough even in ridiculous loop nest
- cases. We must not go over this limit. */
- A = lambda_matrix_new (128, depth, lambda_obstack);
- B = lambda_matrix_new (128, invariants, lambda_obstack);
- a = lambda_vector_new (128);
-
- A1 = lambda_matrix_new (128, depth, lambda_obstack);
- B1 = lambda_matrix_new (128, invariants, lambda_obstack);
- a1 = lambda_vector_new (128);
-
- /* Store the bounds in the equation matrix A, constant vector a, and
- invariant matrix B, so that we have Ax <= a + B.
- This requires a little equation rearranging so that everything is on the
- correct side of the inequality. */
- size = 0;
- for (i = 0; i < depth; i++)
- {
- loop = LN_LOOPS (nest)[i];
-
- /* First we do the lower bound. */
- if (LL_STEP (loop) > 0)
- expression = LL_LOWER_BOUND (loop);
- else
- expression = LL_UPPER_BOUND (loop);
-
- for (; expression != NULL; expression = LLE_NEXT (expression))
- {
- /* Fill in the coefficient. */
- for (j = 0; j < i; j++)
- A[size][j] = LLE_COEFFICIENTS (expression)[j];
-
- /* And the invariant coefficient. */
- for (j = 0; j < invariants; j++)
- B[size][j] = LLE_INVARIANT_COEFFICIENTS (expression)[j];
-
- /* And the constant. */
- a[size] = LLE_CONSTANT (expression);
-
- /* Convert (2x+3y+2+b)/4 <= z to 2x+3y-4z <= -2-b. IE put all
- constants and single variables on */
- A[size][i] = -1 * LLE_DENOMINATOR (expression);
- a[size] *= -1;
- for (j = 0; j < invariants; j++)
- B[size][j] *= -1;
-
- size++;
- /* Need to increase matrix sizes above. */
- gcc_assert (size <= 127);
-
- }
-
- /* Then do the exact same thing for the upper bounds. */
- if (LL_STEP (loop) > 0)
- expression = LL_UPPER_BOUND (loop);
- else
- expression = LL_LOWER_BOUND (loop);
-
- for (; expression != NULL; expression = LLE_NEXT (expression))
- {
- /* Fill in the coefficient. */
- for (j = 0; j < i; j++)
- A[size][j] = LLE_COEFFICIENTS (expression)[j];
-
- /* And the invariant coefficient. */
- for (j = 0; j < invariants; j++)
- B[size][j] = LLE_INVARIANT_COEFFICIENTS (expression)[j];
-
- /* And the constant. */
- a[size] = LLE_CONSTANT (expression);
-
- /* Convert z <= (2x+3y+2+b)/4 to -2x-3y+4z <= 2+b. */
- for (j = 0; j < i; j++)
- A[size][j] *= -1;
- A[size][i] = LLE_DENOMINATOR (expression);
- size++;
- /* Need to increase matrix sizes above. */
- gcc_assert (size <= 127);
-
- }
- }
-
- /* Compute the lattice base x = base * y + origin, where y is the
- base space. */
- lattice = lambda_lattice_compute_base (nest, lambda_obstack);
-
- /* Ax <= a + B then becomes ALy <= a+B - A*origin. L is the lattice base */
-
- /* A1 = A * L */
- lambda_matrix_mult (A, LATTICE_BASE (lattice), A1, size, depth, depth);
-
- /* a1 = a - A * origin constant. */
- lambda_matrix_vector_mult (A, size, depth, LATTICE_ORIGIN (lattice), a1);
- lambda_vector_add_mc (a, 1, a1, -1, a1, size);
-
- /* B1 = B - A * origin invariant. */
- lambda_matrix_mult (A, LATTICE_ORIGIN_INVARIANTS (lattice), B1, size, depth,
- invariants);
- lambda_matrix_add_mc (B, 1, B1, -1, B1, size, invariants);
-
- /* Now compute the auxiliary space bounds by first inverting U, multiplying
- it by A1, then performing Fourier-Motzkin. */
-
- invertedtrans = lambda_matrix_new (depth, depth, lambda_obstack);
-
- /* Compute the inverse of U. */
- lambda_matrix_inverse (LTM_MATRIX (trans),
- invertedtrans, depth, lambda_obstack);
-
- /* A = A1 inv(U). */
- lambda_matrix_mult (A1, invertedtrans, A, size, depth, depth);
-
- return compute_nest_using_fourier_motzkin (size, depth, invariants,
- A, B1, a1, lambda_obstack);
-}
-
-/* Compute the loop bounds for the target space, using the bounds of
- the auxiliary nest AUXILLARY_NEST, and the triangular matrix H.
- The target space loop bounds are computed by multiplying the triangular
- matrix H by the auxiliary nest, to get the new loop bounds. The sign of
- the loop steps (positive or negative) is then used to swap the bounds if
- the loop counts downwards.
- Return the target loopnest. */
-
-static lambda_loopnest
-lambda_compute_target_space (lambda_loopnest auxillary_nest,
- lambda_trans_matrix H, lambda_vector stepsigns,
- struct obstack * lambda_obstack)
-{
- lambda_matrix inverse, H1;
- int determinant, i, j;
- int gcd1, gcd2;
- int factor;
-
- lambda_loopnest target_nest;
- int depth, invariants;
- lambda_matrix target;
-
- lambda_loop auxillary_loop, target_loop;
- lambda_linear_expression expression, auxillary_expr, target_expr, tmp_expr;
-
- depth = LN_DEPTH (auxillary_nest);
- invariants = LN_INVARIANTS (auxillary_nest);
-
- inverse = lambda_matrix_new (depth, depth, lambda_obstack);
- determinant = lambda_matrix_inverse (LTM_MATRIX (H), inverse, depth,
- lambda_obstack);
-
- /* H1 is H excluding its diagonal. */
- H1 = lambda_matrix_new (depth, depth, lambda_obstack);
- lambda_matrix_copy (LTM_MATRIX (H), H1, depth, depth);
-
- for (i = 0; i < depth; i++)
- H1[i][i] = 0;
-
- /* Computes the linear offsets of the loop bounds. */
- target = lambda_matrix_new (depth, depth, lambda_obstack);
- lambda_matrix_mult (H1, inverse, target, depth, depth, depth);
-
- target_nest = lambda_loopnest_new (depth, invariants, lambda_obstack);
-
- for (i = 0; i < depth; i++)
- {
-
- /* Get a new loop structure. */
- target_loop = lambda_loop_new (lambda_obstack);
- LN_LOOPS (target_nest)[i] = target_loop;
-
- /* Computes the gcd of the coefficients of the linear part. */
- gcd1 = lambda_vector_gcd (target[i], i);
-
- /* Include the denominator in the GCD. */
- gcd1 = gcd (gcd1, determinant);
-
- /* Now divide through by the gcd. */
- for (j = 0; j < i; j++)
- target[i][j] = target[i][j] / gcd1;
-
- expression = lambda_linear_expression_new (depth, invariants,
- lambda_obstack);
- lambda_vector_copy (target[i], LLE_COEFFICIENTS (expression), depth);
- LLE_DENOMINATOR (expression) = determinant / gcd1;
- LLE_CONSTANT (expression) = 0;
- lambda_vector_clear (LLE_INVARIANT_COEFFICIENTS (expression),
- invariants);
- LL_LINEAR_OFFSET (target_loop) = expression;
- }
-
- /* For each loop, compute the new bounds from H. */
- for (i = 0; i < depth; i++)
- {
- auxillary_loop = LN_LOOPS (auxillary_nest)[i];
- target_loop = LN_LOOPS (target_nest)[i];
- LL_STEP (target_loop) = LTM_MATRIX (H)[i][i];
- factor = LTM_MATRIX (H)[i][i];
-
- /* First we do the lower bound. */
- auxillary_expr = LL_LOWER_BOUND (auxillary_loop);
-
- for (; auxillary_expr != NULL;
- auxillary_expr = LLE_NEXT (auxillary_expr))
- {
- target_expr = lambda_linear_expression_new (depth, invariants,
- lambda_obstack);
- lambda_vector_matrix_mult (LLE_COEFFICIENTS (auxillary_expr),
- depth, inverse, depth,
- LLE_COEFFICIENTS (target_expr));
- lambda_vector_mult_const (LLE_COEFFICIENTS (target_expr),
- LLE_COEFFICIENTS (target_expr), depth,
- factor);
-
- LLE_CONSTANT (target_expr) = LLE_CONSTANT (auxillary_expr) * factor;
- lambda_vector_copy (LLE_INVARIANT_COEFFICIENTS (auxillary_expr),
- LLE_INVARIANT_COEFFICIENTS (target_expr),
- invariants);
- lambda_vector_mult_const (LLE_INVARIANT_COEFFICIENTS (target_expr),
- LLE_INVARIANT_COEFFICIENTS (target_expr),
- invariants, factor);
- LLE_DENOMINATOR (target_expr) = LLE_DENOMINATOR (auxillary_expr);
-
- if (!lambda_vector_zerop (LLE_COEFFICIENTS (target_expr), depth))
- {
- LLE_CONSTANT (target_expr) = LLE_CONSTANT (target_expr)
- * determinant;
- lambda_vector_mult_const (LLE_INVARIANT_COEFFICIENTS
- (target_expr),
- LLE_INVARIANT_COEFFICIENTS
- (target_expr), invariants,
- determinant);
- LLE_DENOMINATOR (target_expr) =
- LLE_DENOMINATOR (target_expr) * determinant;
- }
- /* Find the gcd and divide by it here, rather than doing it
- at the tree level. */
- gcd1 = lambda_vector_gcd (LLE_COEFFICIENTS (target_expr), depth);
- gcd2 = lambda_vector_gcd (LLE_INVARIANT_COEFFICIENTS (target_expr),
- invariants);
- gcd1 = gcd (gcd1, gcd2);
- gcd1 = gcd (gcd1, LLE_CONSTANT (target_expr));
- gcd1 = gcd (gcd1, LLE_DENOMINATOR (target_expr));
- for (j = 0; j < depth; j++)
- LLE_COEFFICIENTS (target_expr)[j] /= gcd1;
- for (j = 0; j < invariants; j++)
- LLE_INVARIANT_COEFFICIENTS (target_expr)[j] /= gcd1;
- LLE_CONSTANT (target_expr) /= gcd1;
- LLE_DENOMINATOR (target_expr) /= gcd1;
- /* Ignore if identical to existing bound. */
- if (!lle_equal (LL_LOWER_BOUND (target_loop), target_expr, depth,
- invariants))
- {
- LLE_NEXT (target_expr) = LL_LOWER_BOUND (target_loop);
- LL_LOWER_BOUND (target_loop) = target_expr;
- }
- }
- /* Now do the upper bound. */
- auxillary_expr = LL_UPPER_BOUND (auxillary_loop);
-
- for (; auxillary_expr != NULL;
- auxillary_expr = LLE_NEXT (auxillary_expr))
- {
- target_expr = lambda_linear_expression_new (depth, invariants,
- lambda_obstack);
- lambda_vector_matrix_mult (LLE_COEFFICIENTS (auxillary_expr),
- depth, inverse, depth,
- LLE_COEFFICIENTS (target_expr));
- lambda_vector_mult_const (LLE_COEFFICIENTS (target_expr),
- LLE_COEFFICIENTS (target_expr), depth,
- factor);
- LLE_CONSTANT (target_expr) = LLE_CONSTANT (auxillary_expr) * factor;
- lambda_vector_copy (LLE_INVARIANT_COEFFICIENTS (auxillary_expr),
- LLE_INVARIANT_COEFFICIENTS (target_expr),
- invariants);
- lambda_vector_mult_const (LLE_INVARIANT_COEFFICIENTS (target_expr),
- LLE_INVARIANT_COEFFICIENTS (target_expr),
- invariants, factor);
- LLE_DENOMINATOR (target_expr) = LLE_DENOMINATOR (auxillary_expr);
-
- if (!lambda_vector_zerop (LLE_COEFFICIENTS (target_expr), depth))
- {
- LLE_CONSTANT (target_expr) = LLE_CONSTANT (target_expr)
- * determinant;
- lambda_vector_mult_const (LLE_INVARIANT_COEFFICIENTS
- (target_expr),
- LLE_INVARIANT_COEFFICIENTS
- (target_expr), invariants,
- determinant);
- LLE_DENOMINATOR (target_expr) =
- LLE_DENOMINATOR (target_expr) * determinant;
- }
- /* Find the gcd and divide by it here, instead of at the
- tree level. */
- gcd1 = lambda_vector_gcd (LLE_COEFFICIENTS (target_expr), depth);
- gcd2 = lambda_vector_gcd (LLE_INVARIANT_COEFFICIENTS (target_expr),
- invariants);
- gcd1 = gcd (gcd1, gcd2);
- gcd1 = gcd (gcd1, LLE_CONSTANT (target_expr));
- gcd1 = gcd (gcd1, LLE_DENOMINATOR (target_expr));
- for (j = 0; j < depth; j++)
- LLE_COEFFICIENTS (target_expr)[j] /= gcd1;
- for (j = 0; j < invariants; j++)
- LLE_INVARIANT_COEFFICIENTS (target_expr)[j] /= gcd1;
- LLE_CONSTANT (target_expr) /= gcd1;
- LLE_DENOMINATOR (target_expr) /= gcd1;
- /* Ignore if equal to existing bound. */
- if (!lle_equal (LL_UPPER_BOUND (target_loop), target_expr, depth,
- invariants))
- {
- LLE_NEXT (target_expr) = LL_UPPER_BOUND (target_loop);
- LL_UPPER_BOUND (target_loop) = target_expr;
- }
- }
- }
- for (i = 0; i < depth; i++)
- {
- target_loop = LN_LOOPS (target_nest)[i];
- /* If necessary, exchange the upper and lower bounds and negate
- the step size. */
- if (stepsigns[i] < 0)
- {
- LL_STEP (target_loop) *= -1;
- tmp_expr = LL_LOWER_BOUND (target_loop);
- LL_LOWER_BOUND (target_loop) = LL_UPPER_BOUND (target_loop);
- LL_UPPER_BOUND (target_loop) = tmp_expr;
- }
- }
- return target_nest;
-}
-
-/* Compute the step signs of TRANS, using TRANS and stepsigns. Return the new
- result. */
-
-static lambda_vector
-lambda_compute_step_signs (lambda_trans_matrix trans,
- lambda_vector stepsigns,
- struct obstack * lambda_obstack)
-{
- lambda_matrix matrix, H;
- int size;
- lambda_vector newsteps;
- int i, j, factor, minimum_column;
- int temp;
-
- matrix = LTM_MATRIX (trans);
- size = LTM_ROWSIZE (trans);
- H = lambda_matrix_new (size, size, lambda_obstack);
-
- newsteps = lambda_vector_new (size);
- lambda_vector_copy (stepsigns, newsteps, size);
-
- lambda_matrix_copy (matrix, H, size, size);
-
- for (j = 0; j < size; j++)
- {
- lambda_vector row;
- row = H[j];
- for (i = j; i < size; i++)
- if (row[i] < 0)
- lambda_matrix_col_negate (H, size, i);
- while (lambda_vector_first_nz (row, size, j + 1) < size)
- {
- minimum_column = lambda_vector_min_nz (row, size, j);
- lambda_matrix_col_exchange (H, size, j, minimum_column);
-
- temp = newsteps[j];
- newsteps[j] = newsteps[minimum_column];
- newsteps[minimum_column] = temp;
-
- for (i = j + 1; i < size; i++)
- {
- factor = row[i] / row[j];
- lambda_matrix_col_add (H, size, j, i, -1 * factor);
- }
- }
- }
- return newsteps;
-}
-
-/* Transform NEST according to TRANS, and return the new loopnest.
- This involves
- 1. Computing a lattice base for the transformation
- 2. Composing the dense base with the specified transformation (TRANS)
- 3. Decomposing the combined transformation into a lower triangular portion,
- and a unimodular portion.
- 4. Computing the auxiliary nest using the unimodular portion.
- 5. Computing the target nest using the auxiliary nest and the lower
- triangular portion. */
-
-lambda_loopnest
-lambda_loopnest_transform (lambda_loopnest nest, lambda_trans_matrix trans,
- struct obstack * lambda_obstack)
-{
- lambda_loopnest auxillary_nest, target_nest;
-
- int depth, invariants;
- int i, j;
- lambda_lattice lattice;
- lambda_trans_matrix trans1, H, U;
- lambda_loop loop;
- lambda_linear_expression expression;
- lambda_vector origin;
- lambda_matrix origin_invariants;
- lambda_vector stepsigns;
- int f;
-
- depth = LN_DEPTH (nest);
- invariants = LN_INVARIANTS (nest);
-
- /* Keep track of the signs of the loop steps. */
- stepsigns = lambda_vector_new (depth);
- for (i = 0; i < depth; i++)
- {
- if (LL_STEP (LN_LOOPS (nest)[i]) > 0)
- stepsigns[i] = 1;
- else
- stepsigns[i] = -1;
- }
-
- /* Compute the lattice base. */
- lattice = lambda_lattice_compute_base (nest, lambda_obstack);
- trans1 = lambda_trans_matrix_new (depth, depth, lambda_obstack);
-
- /* Multiply the transformation matrix by the lattice base. */
-
- lambda_matrix_mult (LTM_MATRIX (trans), LATTICE_BASE (lattice),
- LTM_MATRIX (trans1), depth, depth, depth);
-
- /* Compute the Hermite normal form for the new transformation matrix. */
- H = lambda_trans_matrix_new (depth, depth, lambda_obstack);
- U = lambda_trans_matrix_new (depth, depth, lambda_obstack);
- lambda_matrix_hermite (LTM_MATRIX (trans1), depth, LTM_MATRIX (H),
- LTM_MATRIX (U));
-
- /* Compute the auxiliary loop nest's space from the unimodular
- portion. */
- auxillary_nest = lambda_compute_auxillary_space (nest, U,
- lambda_obstack);
-
- /* Compute the loop step signs from the old step signs and the
- transformation matrix. */
- stepsigns = lambda_compute_step_signs (trans1, stepsigns,
- lambda_obstack);
-
- /* Compute the target loop nest space from the auxiliary nest and
- the lower triangular matrix H. */
- target_nest = lambda_compute_target_space (auxillary_nest, H, stepsigns,
- lambda_obstack);
- origin = lambda_vector_new (depth);
- origin_invariants = lambda_matrix_new (depth, invariants, lambda_obstack);
- lambda_matrix_vector_mult (LTM_MATRIX (trans), depth, depth,
- LATTICE_ORIGIN (lattice), origin);
- lambda_matrix_mult (LTM_MATRIX (trans), LATTICE_ORIGIN_INVARIANTS (lattice),
- origin_invariants, depth, depth, invariants);
-
- for (i = 0; i < depth; i++)
- {
- loop = LN_LOOPS (target_nest)[i];
- expression = LL_LINEAR_OFFSET (loop);
- if (lambda_vector_zerop (LLE_COEFFICIENTS (expression), depth))
- f = 1;
- else
- f = LLE_DENOMINATOR (expression);
-
- LLE_CONSTANT (expression) += f * origin[i];
-
- for (j = 0; j < invariants; j++)
- LLE_INVARIANT_COEFFICIENTS (expression)[j] +=
- f * origin_invariants[i][j];
- }
-
- return target_nest;
-
-}
-
-/* Convert a gcc tree expression EXPR to a lambda linear expression, and
- return the new expression. DEPTH is the depth of the loopnest.
- OUTERINDUCTIONVARS is an array of the induction variables for outer loops
- in this nest. INVARIANTS is the array of invariants for the loop. EXTRA
- is the amount we have to add/subtract from the expression because of the
- type of comparison it is used in. */
-
-static lambda_linear_expression
-gcc_tree_to_linear_expression (int depth, tree expr,
- VEC(tree,heap) *outerinductionvars,
- VEC(tree,heap) *invariants, int extra,
- struct obstack * lambda_obstack)
-{
- lambda_linear_expression lle = NULL;
- switch (TREE_CODE (expr))
- {
- case INTEGER_CST:
- {
- lle = lambda_linear_expression_new (depth, 2 * depth, lambda_obstack);
- LLE_CONSTANT (lle) = TREE_INT_CST_LOW (expr);
- if (extra != 0)
- LLE_CONSTANT (lle) += extra;
-
- LLE_DENOMINATOR (lle) = 1;
- }
- break;
- case SSA_NAME:
- {
- tree iv, invar;
- size_t i;
- FOR_EACH_VEC_ELT (tree, outerinductionvars, i, iv)
- if (iv != NULL)
- {
- if (SSA_NAME_VAR (iv) == SSA_NAME_VAR (expr))
- {
- lle = lambda_linear_expression_new (depth, 2 * depth,
- lambda_obstack);
- LLE_COEFFICIENTS (lle)[i] = 1;
- if (extra != 0)
- LLE_CONSTANT (lle) = extra;
-
- LLE_DENOMINATOR (lle) = 1;
- }
- }
- FOR_EACH_VEC_ELT (tree, invariants, i, invar)
- if (invar != NULL)
- {
- if (SSA_NAME_VAR (invar) == SSA_NAME_VAR (expr))
- {
- lle = lambda_linear_expression_new (depth, 2 * depth,
- lambda_obstack);
- LLE_INVARIANT_COEFFICIENTS (lle)[i] = 1;
- if (extra != 0)
- LLE_CONSTANT (lle) = extra;
- LLE_DENOMINATOR (lle) = 1;
- }
- }
- }
- break;
- default:
- return NULL;
- }
-
- return lle;
-}
-
-/* Return the depth of the loopnest NEST */
-
-static int
-depth_of_nest (struct loop *nest)
-{
- size_t depth = 0;
- while (nest)
- {
- depth++;
- nest = nest->inner;
- }
- return depth;
-}
-
-
-/* Return true if OP is invariant in LOOP and all outer loops. */
-
-static bool
-invariant_in_loop_and_outer_loops (struct loop *loop, tree op)
-{
- if (is_gimple_min_invariant (op))
- return true;
- if (loop_depth (loop) == 0)
- return true;
- if (!expr_invariant_in_loop_p (loop, op))
- return false;
- if (!invariant_in_loop_and_outer_loops (loop_outer (loop), op))
- return false;
- return true;
-}
-
-/* Generate a lambda loop from a gcc loop LOOP. Return the new lambda loop,
- or NULL if it could not be converted.
- DEPTH is the depth of the loop.
- INVARIANTS is a pointer to the array of loop invariants.
- The induction variable for this loop should be stored in the parameter
- OURINDUCTIONVAR.
- OUTERINDUCTIONVARS is an array of induction variables for outer loops. */
-
-static lambda_loop
-gcc_loop_to_lambda_loop (struct loop *loop, int depth,
- VEC(tree,heap) ** invariants,
- tree * ourinductionvar,
- VEC(tree,heap) * outerinductionvars,
- VEC(tree,heap) ** lboundvars,
- VEC(tree,heap) ** uboundvars,
- VEC(int,heap) ** steps,
- struct obstack * lambda_obstack)
-{
- gimple phi;
- gimple exit_cond;
- tree access_fn, inductionvar;
- tree step;
- lambda_loop lloop = NULL;
- lambda_linear_expression lbound, ubound;
- tree test_lhs, test_rhs;
- int stepint;
- int extra = 0;
- tree lboundvar, uboundvar, uboundresult;
-
- /* Find out induction var and exit condition. */
- inductionvar = find_induction_var_from_exit_cond (loop);
- exit_cond = get_loop_exit_condition (loop);
-
- if (inductionvar == NULL || exit_cond == NULL)
- {
- if (dump_file && (dump_flags & TDF_DETAILS))
- fprintf (dump_file,
- "Unable to convert loop: Cannot determine exit condition or induction variable for loop.\n");
- return NULL;
- }
-
- if (SSA_NAME_DEF_STMT (inductionvar) == NULL)
- {
-
- if (dump_file && (dump_flags & TDF_DETAILS))
- fprintf (dump_file,
- "Unable to convert loop: Cannot find PHI node for induction variable\n");
-
- return NULL;
- }
-
- phi = SSA_NAME_DEF_STMT (inductionvar);
- if (gimple_code (phi) != GIMPLE_PHI)
- {
- tree op = SINGLE_SSA_TREE_OPERAND (phi, SSA_OP_USE);
- if (!op)
- {
-
- if (dump_file && (dump_flags & TDF_DETAILS))
- fprintf (dump_file,
- "Unable to convert loop: Cannot find PHI node for induction variable\n");
-
- return NULL;
- }
-
- phi = SSA_NAME_DEF_STMT (op);
- if (gimple_code (phi) != GIMPLE_PHI)
- {
- if (dump_file && (dump_flags & TDF_DETAILS))
- fprintf (dump_file,
- "Unable to convert loop: Cannot find PHI node for induction variable\n");
- return NULL;
- }
- }
-
- /* The induction variable name/version we want to put in the array is the
- result of the induction variable phi node. */
- *ourinductionvar = PHI_RESULT (phi);
- access_fn = instantiate_parameters
- (loop, analyze_scalar_evolution (loop, PHI_RESULT (phi)));
- if (access_fn == chrec_dont_know)
- {
- if (dump_file && (dump_flags & TDF_DETAILS))
- fprintf (dump_file,
- "Unable to convert loop: Access function for induction variable phi is unknown\n");
-
- return NULL;
- }
-
- step = evolution_part_in_loop_num (access_fn, loop->num);
- if (!step || step == chrec_dont_know)
- {
- if (dump_file && (dump_flags & TDF_DETAILS))
- fprintf (dump_file,
- "Unable to convert loop: Cannot determine step of loop.\n");
-
- return NULL;
- }
- if (TREE_CODE (step) != INTEGER_CST)
- {
-
- if (dump_file && (dump_flags & TDF_DETAILS))
- fprintf (dump_file,
- "Unable to convert loop: Step of loop is not integer.\n");
- return NULL;
- }
-
- stepint = TREE_INT_CST_LOW (step);
-
- /* Only want phis for induction vars, which will have two
- arguments. */
- if (gimple_phi_num_args (phi) != 2)
- {
- if (dump_file && (dump_flags & TDF_DETAILS))
- fprintf (dump_file,
- "Unable to convert loop: PHI node for induction variable has >2 arguments\n");
- return NULL;
- }
-
- /* Another induction variable check. One argument's source should be
- in the loop, one outside the loop. */
- if (flow_bb_inside_loop_p (loop, gimple_phi_arg_edge (phi, 0)->src)
- && flow_bb_inside_loop_p (loop, gimple_phi_arg_edge (phi, 1)->src))
- {
-
- if (dump_file && (dump_flags & TDF_DETAILS))
- fprintf (dump_file,
- "Unable to convert loop: PHI edges both inside loop, or both outside loop.\n");
-
- return NULL;
- }
-
- if (flow_bb_inside_loop_p (loop, gimple_phi_arg_edge (phi, 0)->src))
- {
- lboundvar = PHI_ARG_DEF (phi, 1);
- lbound = gcc_tree_to_linear_expression (depth, lboundvar,
- outerinductionvars, *invariants,
- 0, lambda_obstack);
- }
- else
- {
- lboundvar = PHI_ARG_DEF (phi, 0);
- lbound = gcc_tree_to_linear_expression (depth, lboundvar,
- outerinductionvars, *invariants,
- 0, lambda_obstack);
- }
-
- if (!lbound)
- {
-
- if (dump_file && (dump_flags & TDF_DETAILS))
- fprintf (dump_file,
- "Unable to convert loop: Cannot convert lower bound to linear expression\n");
-
- return NULL;
- }
- /* One part of the test may be a loop invariant tree. */
- VEC_reserve (tree, heap, *invariants, 1);
- test_lhs = gimple_cond_lhs (exit_cond);
- test_rhs = gimple_cond_rhs (exit_cond);
-
- if (TREE_CODE (test_rhs) == SSA_NAME
- && invariant_in_loop_and_outer_loops (loop, test_rhs))
- VEC_quick_push (tree, *invariants, test_rhs);
- else if (TREE_CODE (test_lhs) == SSA_NAME
- && invariant_in_loop_and_outer_loops (loop, test_lhs))
- VEC_quick_push (tree, *invariants, test_lhs);
-
- /* The non-induction variable part of the test is the upper bound variable.
- */
- if (test_lhs == inductionvar)
- uboundvar = test_rhs;
- else
- uboundvar = test_lhs;
-
- /* We only size the vectors assuming we have, at max, 2 times as many
- invariants as we do loops (one for each bound).
- This is just an arbitrary number, but it has to be matched against the
- code below. */
- gcc_assert (VEC_length (tree, *invariants) <= (unsigned int) (2 * depth));
-
-
- /* We might have some leftover. */
- if (gimple_cond_code (exit_cond) == LT_EXPR)
- extra = -1 * stepint;
- else if (gimple_cond_code (exit_cond) == NE_EXPR)
- extra = -1 * stepint;
- else if (gimple_cond_code (exit_cond) == GT_EXPR)
- extra = -1 * stepint;
- else if (gimple_cond_code (exit_cond) == EQ_EXPR)
- extra = 1 * stepint;
-
- ubound = gcc_tree_to_linear_expression (depth, uboundvar,
- outerinductionvars,
- *invariants, extra, lambda_obstack);
- uboundresult = build2 (PLUS_EXPR, TREE_TYPE (uboundvar), uboundvar,
- build_int_cst (TREE_TYPE (uboundvar), extra));
- VEC_safe_push (tree, heap, *uboundvars, uboundresult);
- VEC_safe_push (tree, heap, *lboundvars, lboundvar);
- VEC_safe_push (int, heap, *steps, stepint);
- if (!ubound)
- {
- if (dump_file && (dump_flags & TDF_DETAILS))
- fprintf (dump_file,
- "Unable to convert loop: Cannot convert upper bound to linear expression\n");
- return NULL;
- }
-
- lloop = lambda_loop_new (lambda_obstack);
- LL_STEP (lloop) = stepint;
- LL_LOWER_BOUND (lloop) = lbound;
- LL_UPPER_BOUND (lloop) = ubound;
- return lloop;
-}
-
-/* Given a LOOP, find the induction variable it is testing against in the exit
- condition. Return the induction variable if found, NULL otherwise. */
-
-tree
-find_induction_var_from_exit_cond (struct loop *loop)
-{
- gimple expr = get_loop_exit_condition (loop);
- tree ivarop;
- tree test_lhs, test_rhs;
- if (expr == NULL)
- return NULL_TREE;
- if (gimple_code (expr) != GIMPLE_COND)
- return NULL_TREE;
- test_lhs = gimple_cond_lhs (expr);
- test_rhs = gimple_cond_rhs (expr);
-
- /* Find the side that is invariant in this loop. The ivar must be the other
- side. */
-
- if (expr_invariant_in_loop_p (loop, test_lhs))
- ivarop = test_rhs;
- else if (expr_invariant_in_loop_p (loop, test_rhs))
- ivarop = test_lhs;
- else
- return NULL_TREE;
-
- if (TREE_CODE (ivarop) != SSA_NAME)
- return NULL_TREE;
- return ivarop;
-}
-
-DEF_VEC_P(lambda_loop);
-DEF_VEC_ALLOC_P(lambda_loop,heap);
-
-/* Generate a lambda loopnest from a gcc loopnest LOOP_NEST.
- Return the new loop nest.
- INDUCTIONVARS is a pointer to an array of induction variables for the
- loopnest that will be filled in during this process.
- INVARIANTS is a pointer to an array of invariants that will be filled in
- during this process. */
-
-lambda_loopnest
-gcc_loopnest_to_lambda_loopnest (struct loop *loop_nest,
- VEC(tree,heap) **inductionvars,
- VEC(tree,heap) **invariants,
- struct obstack * lambda_obstack)
-{
- lambda_loopnest ret = NULL;
- struct loop *temp = loop_nest;
- int depth = depth_of_nest (loop_nest);
- size_t i;
- VEC(lambda_loop,heap) *loops = NULL;
- VEC(tree,heap) *uboundvars = NULL;
- VEC(tree,heap) *lboundvars = NULL;
- VEC(int,heap) *steps = NULL;
- lambda_loop newloop;
- tree inductionvar = NULL;
- bool perfect_nest = perfect_nest_p (loop_nest);
-
- if (!perfect_nest && !can_convert_to_perfect_nest (loop_nest))
- goto fail;
-
- while (temp)
- {
- newloop = gcc_loop_to_lambda_loop (temp, depth, invariants,
- &inductionvar, *inductionvars,
- &lboundvars, &uboundvars,
- &steps, lambda_obstack);
- if (!newloop)
- goto fail;
-
- VEC_safe_push (tree, heap, *inductionvars, inductionvar);
- VEC_safe_push (lambda_loop, heap, loops, newloop);
- temp = temp->inner;
- }
-
- if (!perfect_nest)
- {
- if (!perfect_nestify (loop_nest, lboundvars, uboundvars, steps,
- *inductionvars))
- {
- if (dump_file)
- fprintf (dump_file,
- "Not a perfect loop nest and couldn't convert to one.\n");
- goto fail;
- }
- else if (dump_file)
- fprintf (dump_file,
- "Successfully converted loop nest to perfect loop nest.\n");
- }
-
- ret = lambda_loopnest_new (depth, 2 * depth, lambda_obstack);
-
- FOR_EACH_VEC_ELT (lambda_loop, loops, i, newloop)
- LN_LOOPS (ret)[i] = newloop;
-
- fail:
- VEC_free (lambda_loop, heap, loops);
- VEC_free (tree, heap, uboundvars);
- VEC_free (tree, heap, lboundvars);
- VEC_free (int, heap, steps);
-
- return ret;
-}
-
-/* Convert a lambda body vector LBV to a gcc tree, and return the new tree.
- STMTS_TO_INSERT is a pointer to a tree where the statements we need to be
- inserted for us are stored. INDUCTION_VARS is the array of induction
- variables for the loop this LBV is from. TYPE is the tree type to use for
- the variables and trees involved. */
-
-static tree
-lbv_to_gcc_expression (lambda_body_vector lbv,
- tree type, VEC(tree,heap) *induction_vars,
- gimple_seq *stmts_to_insert)
-{
- int k;
- tree resvar;
- tree expr = build_linear_expr (type, LBV_COEFFICIENTS (lbv), induction_vars);
-
- k = LBV_DENOMINATOR (lbv);
- gcc_assert (k != 0);
- if (k != 1)
- expr = fold_build2 (CEIL_DIV_EXPR, type, expr, build_int_cst (type, k));
-
- resvar = create_tmp_var (type, "lbvtmp");
- add_referenced_var (resvar);
- return force_gimple_operand (fold (expr), stmts_to_insert, true, resvar);
-}
-
-/* Convert a linear expression from coefficient and constant form to a
- gcc tree.
- Return the tree that represents the final value of the expression.
- LLE is the linear expression to convert.
- OFFSET is the linear offset to apply to the expression.
- TYPE is the tree type to use for the variables and math.
- INDUCTION_VARS is a vector of induction variables for the loops.
- INVARIANTS is a vector of the loop nest invariants.
- WRAP specifies what tree code to wrap the results in, if there is more than
- one (it is either MAX_EXPR, or MIN_EXPR).
- STMTS_TO_INSERT Is a pointer to the statement list we fill in with
- statements that need to be inserted for the linear expression. */
-
-static tree
-lle_to_gcc_expression (lambda_linear_expression lle,
- lambda_linear_expression offset,
- tree type,
- VEC(tree,heap) *induction_vars,
- VEC(tree,heap) *invariants,
- enum tree_code wrap, gimple_seq *stmts_to_insert)
-{
- int k;
- tree resvar;
- tree expr = NULL_TREE;
- VEC(tree,heap) *results = NULL;
-
- gcc_assert (wrap == MAX_EXPR || wrap == MIN_EXPR);
-
- /* Build up the linear expressions. */
- for (; lle != NULL; lle = LLE_NEXT (lle))
- {
- expr = build_linear_expr (type, LLE_COEFFICIENTS (lle), induction_vars);
- expr = fold_build2 (PLUS_EXPR, type, expr,
- build_linear_expr (type,
- LLE_INVARIANT_COEFFICIENTS (lle),
- invariants));
-
- k = LLE_CONSTANT (lle);
- if (k)
- expr = fold_build2 (PLUS_EXPR, type, expr, build_int_cst (type, k));
-
- k = LLE_CONSTANT (offset);
- if (k)
- expr = fold_build2 (PLUS_EXPR, type, expr, build_int_cst (type, k));
-
- k = LLE_DENOMINATOR (lle);
- if (k != 1)
- expr = fold_build2 (wrap == MAX_EXPR ? CEIL_DIV_EXPR : FLOOR_DIV_EXPR,
- type, expr, build_int_cst (type, k));
-
- expr = fold (expr);
- VEC_safe_push (tree, heap, results, expr);
- }
-
- gcc_assert (expr);
-
- /* We may need to wrap the results in a MAX_EXPR or MIN_EXPR. */
- if (VEC_length (tree, results) > 1)
- {
- size_t i;
- tree op;
-
- expr = VEC_index (tree, results, 0);
- for (i = 1; VEC_iterate (tree, results, i, op); i++)
- expr = fold_build2 (wrap, type, expr, op);
- }
-
- VEC_free (tree, heap, results);
-
- resvar = create_tmp_var (type, "lletmp");
- add_referenced_var (resvar);
- return force_gimple_operand (fold (expr), stmts_to_insert, true, resvar);
-}
-
-/* Remove the induction variable defined at IV_STMT. */
-
-void
-remove_iv (gimple iv_stmt)
-{
- gimple_stmt_iterator si = gsi_for_stmt (iv_stmt);
-
- if (gimple_code (iv_stmt) == GIMPLE_PHI)
- {
- unsigned i;
-
- for (i = 0; i < gimple_phi_num_args (iv_stmt); i++)
- {
- gimple stmt;
- imm_use_iterator imm_iter;
- tree arg = gimple_phi_arg_def (iv_stmt, i);
- bool used = false;
-
- if (TREE_CODE (arg) != SSA_NAME)
- continue;
-
- FOR_EACH_IMM_USE_STMT (stmt, imm_iter, arg)
- if (stmt != iv_stmt && !is_gimple_debug (stmt))
- used = true;
-
- if (!used)
- remove_iv (SSA_NAME_DEF_STMT (arg));
- }
-
- remove_phi_node (&si, true);
- }
- else
- {
- gsi_remove (&si, true);
- release_defs (iv_stmt);
- }
-}
-
-/* Transform a lambda loopnest NEW_LOOPNEST, which had TRANSFORM applied to
- it, back into gcc code. This changes the
- loops, their induction variables, and their bodies, so that they
- match the transformed loopnest.
- OLD_LOOPNEST is the loopnest before we've replaced it with the new
- loopnest.
- OLD_IVS is a vector of induction variables from the old loopnest.
- INVARIANTS is a vector of loop invariants from the old loopnest.
- NEW_LOOPNEST is the new lambda loopnest to replace OLD_LOOPNEST with.
- TRANSFORM is the matrix transform that was applied to OLD_LOOPNEST to get
- NEW_LOOPNEST. */
-
-void
-lambda_loopnest_to_gcc_loopnest (struct loop *old_loopnest,
- VEC(tree,heap) *old_ivs,
- VEC(tree,heap) *invariants,
- VEC(gimple,heap) **remove_ivs,
- lambda_loopnest new_loopnest,
- lambda_trans_matrix transform,
- struct obstack * lambda_obstack)
-{
- struct loop *temp;
- size_t i = 0;
- unsigned j;
- size_t depth = 0;
- VEC(tree,heap) *new_ivs = NULL;
- tree oldiv;
- gimple_stmt_iterator bsi;
-
- transform = lambda_trans_matrix_inverse (transform, lambda_obstack);
-
- if (dump_file)
- {
- fprintf (dump_file, "Inverse of transformation matrix:\n");
- print_lambda_trans_matrix (dump_file, transform);
- }
- depth = depth_of_nest (old_loopnest);
- temp = old_loopnest;
-
- while (temp)
- {
- lambda_loop newloop;
- basic_block bb;
- edge exit;
- tree ivvar, ivvarinced;
- gimple exitcond;
- gimple_seq stmts;
- enum tree_code testtype;
- tree newupperbound, newlowerbound;
- lambda_linear_expression offset;
- tree type;
- bool insert_after;
- gimple inc_stmt;
-
- oldiv = VEC_index (tree, old_ivs, i);
- type = TREE_TYPE (oldiv);
-
- /* First, build the new induction variable temporary */
-
- ivvar = create_tmp_var (type, "lnivtmp");
- add_referenced_var (ivvar);
-
- VEC_safe_push (tree, heap, new_ivs, ivvar);
-
- newloop = LN_LOOPS (new_loopnest)[i];
-
- /* Linear offset is a bit tricky to handle. Punt on the unhandled
- cases for now. */
- offset = LL_LINEAR_OFFSET (newloop);
-
- gcc_assert (LLE_DENOMINATOR (offset) == 1 &&
- lambda_vector_zerop (LLE_COEFFICIENTS (offset), depth));
-
- /* Now build the new lower bounds, and insert the statements
- necessary to generate it on the loop preheader. */
- stmts = NULL;
- newlowerbound = lle_to_gcc_expression (LL_LOWER_BOUND (newloop),
- LL_LINEAR_OFFSET (newloop),
- type,
- new_ivs,
- invariants, MAX_EXPR, &stmts);
-
- if (stmts)
- {
- gsi_insert_seq_on_edge (loop_preheader_edge (temp), stmts);
- gsi_commit_edge_inserts ();
- }
- /* Build the new upper bound and insert its statements in the
- basic block of the exit condition */
- stmts = NULL;
- newupperbound = lle_to_gcc_expression (LL_UPPER_BOUND (newloop),
- LL_LINEAR_OFFSET (newloop),
- type,
- new_ivs,
- invariants, MIN_EXPR, &stmts);
- exit = single_exit (temp);
- exitcond = get_loop_exit_condition (temp);
- bb = gimple_bb (exitcond);
- bsi = gsi_after_labels (bb);
- if (stmts)
- gsi_insert_seq_before (&bsi, stmts, GSI_NEW_STMT);
-
- /* Create the new iv. */
-
- standard_iv_increment_position (temp, &bsi, &insert_after);
- create_iv (newlowerbound,
- build_int_cst (type, LL_STEP (newloop)),
- ivvar, temp, &bsi, insert_after, &ivvar,
- NULL);
-
- /* Unfortunately, the incremented ivvar that create_iv inserted may not
- dominate the block containing the exit condition.
- So we simply create our own incremented iv to use in the new exit
- test, and let redundancy elimination sort it out. */
- inc_stmt = gimple_build_assign_with_ops (PLUS_EXPR, SSA_NAME_VAR (ivvar),
- ivvar,
- build_int_cst (type, LL_STEP (newloop)));
-
- ivvarinced = make_ssa_name (SSA_NAME_VAR (ivvar), inc_stmt);
- gimple_assign_set_lhs (inc_stmt, ivvarinced);
- bsi = gsi_for_stmt (exitcond);
- gsi_insert_before (&bsi, inc_stmt, GSI_SAME_STMT);
-
- /* Replace the exit condition with the new upper bound
- comparison. */
-
- testtype = LL_STEP (newloop) >= 0 ? LE_EXPR : GE_EXPR;
-
- /* We want to build a conditional where true means exit the loop, and
- false means continue the loop.
- So swap the testtype if this isn't the way things are.*/
-
- if (exit->flags & EDGE_FALSE_VALUE)
- testtype = swap_tree_comparison (testtype);
-
- gimple_cond_set_condition (exitcond, testtype, newupperbound, ivvarinced);
- update_stmt (exitcond);
- VEC_replace (tree, new_ivs, i, ivvar);
-
- i++;
- temp = temp->inner;
- }
-
- /* Rewrite uses of the old ivs so that they are now specified in terms of
- the new ivs. */
-
- FOR_EACH_VEC_ELT (tree, old_ivs, i, oldiv)
- {
- imm_use_iterator imm_iter;
- use_operand_p use_p;
- tree oldiv_def;
- gimple oldiv_stmt = SSA_NAME_DEF_STMT (oldiv);
- gimple stmt;
-
- if (gimple_code (oldiv_stmt) == GIMPLE_PHI)
- oldiv_def = PHI_RESULT (oldiv_stmt);
- else
- oldiv_def = SINGLE_SSA_TREE_OPERAND (oldiv_stmt, SSA_OP_DEF);
- gcc_assert (oldiv_def != NULL_TREE);
-
- FOR_EACH_IMM_USE_STMT (stmt, imm_iter, oldiv_def)
- {
- tree newiv;
- gimple_seq stmts;
- lambda_body_vector lbv, newlbv;
-
- if (is_gimple_debug (stmt))
- continue;
-
- /* Compute the new expression for the induction
- variable. */
- depth = VEC_length (tree, new_ivs);
- lbv = lambda_body_vector_new (depth, lambda_obstack);
- LBV_COEFFICIENTS (lbv)[i] = 1;
-
- newlbv = lambda_body_vector_compute_new (transform, lbv,
- lambda_obstack);
-
- stmts = NULL;
- newiv = lbv_to_gcc_expression (newlbv, TREE_TYPE (oldiv),
- new_ivs, &stmts);
-
- if (stmts && gimple_code (stmt) != GIMPLE_PHI)
- {
- bsi = gsi_for_stmt (stmt);
- gsi_insert_seq_before (&bsi, stmts, GSI_SAME_STMT);
- }
-
- FOR_EACH_IMM_USE_ON_STMT (use_p, imm_iter)
- propagate_value (use_p, newiv);
-
- if (stmts && gimple_code (stmt) == GIMPLE_PHI)
- for (j = 0; j < gimple_phi_num_args (stmt); j++)
- if (gimple_phi_arg_def (stmt, j) == newiv)
- gsi_insert_seq_on_edge (gimple_phi_arg_edge (stmt, j), stmts);
-
- update_stmt (stmt);
- }
-
- /* Remove the now unused induction variable. */
- VEC_safe_push (gimple, heap, *remove_ivs, oldiv_stmt);
- }
- VEC_free (tree, heap, new_ivs);
-}
-
-/* Return TRUE if this is not interesting statement from the perspective of
- determining if we have a perfect loop nest. */
-
-static bool
-not_interesting_stmt (gimple stmt)
-{
- /* Note that COND_EXPR's aren't interesting because if they were exiting the
- loop, we would have already failed the number of exits tests. */
- if (gimple_code (stmt) == GIMPLE_LABEL
- || gimple_code (stmt) == GIMPLE_GOTO
- || gimple_code (stmt) == GIMPLE_COND
- || is_gimple_debug (stmt))
- return true;
- return false;
-}
-
-/* Return TRUE if PHI uses DEF for it's in-the-loop edge for LOOP. */
-
-static bool
-phi_loop_edge_uses_def (struct loop *loop, gimple phi, tree def)
-{
- unsigned i;
- for (i = 0; i < gimple_phi_num_args (phi); i++)
- if (flow_bb_inside_loop_p (loop, gimple_phi_arg_edge (phi, i)->src))
- if (PHI_ARG_DEF (phi, i) == def)
- return true;
- return false;
-}
-
-/* Return TRUE if STMT is a use of PHI_RESULT. */
-
-static bool
-stmt_uses_phi_result (gimple stmt, tree phi_result)
-{
- tree use = SINGLE_SSA_TREE_OPERAND (stmt, SSA_OP_USE);
-
- /* This is conservatively true, because we only want SIMPLE bumpers
- of the form x +- constant for our pass. */
- return (use == phi_result);
-}
-
-/* STMT is a bumper stmt for LOOP if the version it defines is used in the
- in-loop-edge in a phi node, and the operand it uses is the result of that
- phi node.
- I.E. i_29 = i_3 + 1
- i_3 = PHI (0, i_29); */
-
-static bool
-stmt_is_bumper_for_loop (struct loop *loop, gimple stmt)
-{
- gimple use;
- tree def;
- imm_use_iterator iter;
- use_operand_p use_p;
-
- def = SINGLE_SSA_TREE_OPERAND (stmt, SSA_OP_DEF);
- if (!def)
- return false;
-
- FOR_EACH_IMM_USE_FAST (use_p, iter, def)
- {
- use = USE_STMT (use_p);
- if (gimple_code (use) == GIMPLE_PHI)
- {
- if (phi_loop_edge_uses_def (loop, use, def))
- if (stmt_uses_phi_result (stmt, PHI_RESULT (use)))
- return true;
- }
- }
- return false;
-}
-
-
-/* Return true if LOOP is a perfect loop nest.
- Perfect loop nests are those loop nests where all code occurs in the
- innermost loop body.
- If S is a program statement, then
-
- i.e.
- DO I = 1, 20
- S1
- DO J = 1, 20
- ...
- END DO
- END DO
- is not a perfect loop nest because of S1.
-
- DO I = 1, 20
- DO J = 1, 20
- S1
- ...
- END DO
- END DO
- is a perfect loop nest.
-
- Since we don't have high level loops anymore, we basically have to walk our
- statements and ignore those that are there because the loop needs them (IE
- the induction variable increment, and jump back to the top of the loop). */
-
-bool
-perfect_nest_p (struct loop *loop)
-{
- basic_block *bbs;
- size_t i;
- gimple exit_cond;
-
- /* Loops at depth 0 are perfect nests. */
- if (!loop->inner)
- return true;
-
- bbs = get_loop_body (loop);
- exit_cond = get_loop_exit_condition (loop);
-
- for (i = 0; i < loop->num_nodes; i++)
- {
- if (bbs[i]->loop_father == loop)
- {
- gimple_stmt_iterator bsi;
-
- for (bsi = gsi_start_bb (bbs[i]); !gsi_end_p (bsi); gsi_next (&bsi))
- {
- gimple stmt = gsi_stmt (bsi);
-
- if (gimple_code (stmt) == GIMPLE_COND
- && exit_cond != stmt)
- goto non_perfectly_nested;
-
- if (stmt == exit_cond
- || not_interesting_stmt (stmt)
- || stmt_is_bumper_for_loop (loop, stmt))
- continue;
-
- non_perfectly_nested:
- free (bbs);
- return false;
- }
- }
- }
-
- free (bbs);
-
- return perfect_nest_p (loop->inner);
-}
-
-/* Replace the USES of X in STMT, or uses with the same step as X with Y.
- YINIT is the initial value of Y, REPLACEMENTS is a hash table to
- avoid creating duplicate temporaries and FIRSTBSI is statement
- iterator where new temporaries should be inserted at the beginning
- of body basic block. */
-
-static void
-replace_uses_equiv_to_x_with_y (struct loop *loop, gimple stmt, tree x,
- int xstep, tree y, tree yinit,
- htab_t replacements,
- gimple_stmt_iterator *firstbsi)
-{
- ssa_op_iter iter;
- use_operand_p use_p;
-
- FOR_EACH_SSA_USE_OPERAND (use_p, stmt, iter, SSA_OP_USE)
- {
- tree use = USE_FROM_PTR (use_p);
- tree step = NULL_TREE;
- tree scev, init, val, var;
- gimple setstmt;
- struct tree_map *h, in;
- void **loc;
-
- /* Replace uses of X with Y right away. */
- if (use == x)
- {
- SET_USE (use_p, y);
- continue;
- }
-
- scev = instantiate_parameters (loop,
- analyze_scalar_evolution (loop, use));
-
- if (scev == NULL || scev == chrec_dont_know)
- continue;
-
- step = evolution_part_in_loop_num (scev, loop->num);
- if (step == NULL
- || step == chrec_dont_know
- || TREE_CODE (step) != INTEGER_CST
- || int_cst_value (step) != xstep)
- continue;
-
- /* Use REPLACEMENTS hash table to cache already created
- temporaries. */
- in.hash = htab_hash_pointer (use);
- in.base.from = use;
- h = (struct tree_map *) htab_find_with_hash (replacements, &in, in.hash);
- if (h != NULL)
- {
- SET_USE (use_p, h->to);
- continue;
- }
-
- /* USE which has the same step as X should be replaced
- with a temporary set to Y + YINIT - INIT. */
- init = initial_condition_in_loop_num (scev, loop->num);
- gcc_assert (init != NULL && init != chrec_dont_know);
- if (TREE_TYPE (use) == TREE_TYPE (y))
- {
- val = fold_build2 (MINUS_EXPR, TREE_TYPE (y), init, yinit);
- val = fold_build2 (PLUS_EXPR, TREE_TYPE (y), y, val);
- if (val == y)
- {
- /* If X has the same type as USE, the same step
- and same initial value, it can be replaced by Y. */
- SET_USE (use_p, y);
- continue;
- }
- }
- else
- {
- val = fold_build2 (MINUS_EXPR, TREE_TYPE (y), y, yinit);
- val = fold_convert (TREE_TYPE (use), val);
- val = fold_build2 (PLUS_EXPR, TREE_TYPE (use), val, init);
- }
-
- /* Create a temporary variable and insert it at the beginning
- of the loop body basic block, right after the PHI node
- which sets Y. */
- var = create_tmp_var (TREE_TYPE (use), "perfecttmp");
- add_referenced_var (var);
- val = force_gimple_operand_gsi (firstbsi, val, false, NULL,
- true, GSI_SAME_STMT);
- setstmt = gimple_build_assign (var, val);
- var = make_ssa_name (var, setstmt);
- gimple_assign_set_lhs (setstmt, var);
- gsi_insert_before (firstbsi, setstmt, GSI_SAME_STMT);
- update_stmt (setstmt);
- SET_USE (use_p, var);
- h = ggc_alloc_tree_map ();
- h->hash = in.hash;
- h->base.from = use;
- h->to = var;
- loc = htab_find_slot_with_hash (replacements, h, in.hash, INSERT);
- gcc_assert ((*(struct tree_map **)loc) == NULL);
- *(struct tree_map **) loc = h;
- }
-}
-
-/* Return true if STMT is an exit PHI for LOOP */
-
-static bool
-exit_phi_for_loop_p (struct loop *loop, gimple stmt)
-{
- if (gimple_code (stmt) != GIMPLE_PHI
- || gimple_phi_num_args (stmt) != 1
- || gimple_bb (stmt) != single_exit (loop)->dest)
- return false;
-
- return true;
-}
-
-/* Return true if STMT can be put back into the loop INNER, by
- copying it to the beginning of that loop and changing the uses. */
-
-static bool
-can_put_in_inner_loop (struct loop *inner, gimple stmt)
-{
- imm_use_iterator imm_iter;
- use_operand_p use_p;
-
- gcc_assert (is_gimple_assign (stmt));
- if (gimple_vuse (stmt)
- || !stmt_invariant_in_loop_p (inner, stmt))
- return false;
-
- FOR_EACH_IMM_USE_FAST (use_p, imm_iter, gimple_assign_lhs (stmt))
- {
- if (!exit_phi_for_loop_p (inner, USE_STMT (use_p)))
- {
- basic_block immbb = gimple_bb (USE_STMT (use_p));
-
- if (!flow_bb_inside_loop_p (inner, immbb))
- return false;
- }
- }
- return true;
-}
-
-/* Return true if STMT can be put *after* the inner loop of LOOP. */
-
-static bool
-can_put_after_inner_loop (struct loop *loop, gimple stmt)
-{
- imm_use_iterator imm_iter;
- use_operand_p use_p;
-
- if (gimple_vuse (stmt))
- return false;
-
- FOR_EACH_IMM_USE_FAST (use_p, imm_iter, gimple_assign_lhs (stmt))
- {
- if (!exit_phi_for_loop_p (loop, USE_STMT (use_p)))
- {
- basic_block immbb = gimple_bb (USE_STMT (use_p));
-
- if (!dominated_by_p (CDI_DOMINATORS,
- immbb,
- loop->inner->header)
- && !can_put_in_inner_loop (loop->inner, stmt))
- return false;
- }
- }
- return true;
-}
-
-/* Return true when the induction variable IV is simple enough to be
- re-synthesized. */
-
-static bool
-can_duplicate_iv (tree iv, struct loop *loop)
-{
- tree scev = instantiate_parameters
- (loop, analyze_scalar_evolution (loop, iv));
-
- if (!automatically_generated_chrec_p (scev))
- {
- tree step = evolution_part_in_loop_num (scev, loop->num);
-
- if (step && step != chrec_dont_know && TREE_CODE (step) == INTEGER_CST)
- return true;
- }
-
- return false;
-}
-
-/* If this is a scalar operation that can be put back into the inner
- loop, or after the inner loop, through copying, then do so. This
- works on the theory that any amount of scalar code we have to
- reduplicate into or after the loops is less expensive that the win
- we get from rearranging the memory walk the loop is doing so that
- it has better cache behavior. */
-
-static bool
-cannot_convert_modify_to_perfect_nest (gimple stmt, struct loop *loop)
-{
- use_operand_p use_a, use_b;
- imm_use_iterator imm_iter;
- ssa_op_iter op_iter, op_iter1;
- tree op0 = gimple_assign_lhs (stmt);
-
- /* The statement should not define a variable used in the inner
- loop. */
- if (TREE_CODE (op0) == SSA_NAME
- && !can_duplicate_iv (op0, loop))
- FOR_EACH_IMM_USE_FAST (use_a, imm_iter, op0)
- if (gimple_bb (USE_STMT (use_a))->loop_father == loop->inner)
- return true;
-
- FOR_EACH_SSA_USE_OPERAND (use_a, stmt, op_iter, SSA_OP_USE)
- {
- gimple node;
- tree op = USE_FROM_PTR (use_a);
-
- /* The variables should not be used in both loops. */
- if (!can_duplicate_iv (op, loop))
- FOR_EACH_IMM_USE_FAST (use_b, imm_iter, op)
- if (gimple_bb (USE_STMT (use_b))->loop_father == loop->inner)
- return true;
-
- /* The statement should not use the value of a scalar that was
- modified in the loop. */
- node = SSA_NAME_DEF_STMT (op);
- if (gimple_code (node) == GIMPLE_PHI)
- FOR_EACH_PHI_ARG (use_b, node, op_iter1, SSA_OP_USE)
- {
- tree arg = USE_FROM_PTR (use_b);
-
- if (TREE_CODE (arg) == SSA_NAME)
- {
- gimple arg_stmt = SSA_NAME_DEF_STMT (arg);
-
- if (gimple_bb (arg_stmt)
- && (gimple_bb (arg_stmt)->loop_father == loop->inner))
- return true;
- }
- }
- }
-
- return false;
-}
-/* Return true when BB contains statements that can harm the transform
- to a perfect loop nest. */
-
-static bool
-cannot_convert_bb_to_perfect_nest (basic_block bb, struct loop *loop)
-{
- gimple_stmt_iterator bsi;
- gimple exit_condition = get_loop_exit_condition (loop);
-
- for (bsi = gsi_start_bb (bb); !gsi_end_p (bsi); gsi_next (&bsi))
- {
- gimple stmt = gsi_stmt (bsi);
-
- if (stmt == exit_condition
- || not_interesting_stmt (stmt)
- || stmt_is_bumper_for_loop (loop, stmt))
- continue;
-
- if (is_gimple_assign (stmt))
- {
- if (cannot_convert_modify_to_perfect_nest (stmt, loop))
- return true;
-
- if (can_duplicate_iv (gimple_assign_lhs (stmt), loop))
- continue;
-
- if (can_put_in_inner_loop (loop->inner, stmt)
- || can_put_after_inner_loop (loop, stmt))
- continue;
- }
-
- /* If the bb of a statement we care about isn't dominated by the
- header of the inner loop, then we can't handle this case
- right now. This test ensures that the statement comes
- completely *after* the inner loop. */
- if (!dominated_by_p (CDI_DOMINATORS,
- gimple_bb (stmt),
- loop->inner->header))
- return true;
- }
-
- return false;
-}
-
-
-/* Return TRUE if LOOP is an imperfect nest that we can convert to a
- perfect one. At the moment, we only handle imperfect nests of
- depth 2, where all of the statements occur after the inner loop. */
-
-static bool
-can_convert_to_perfect_nest (struct loop *loop)
-{
- basic_block *bbs;
- size_t i;
- gimple_stmt_iterator si;
-
- /* Can't handle triply nested+ loops yet. */
- if (!loop->inner || loop->inner->inner)
- return false;
-
- bbs = get_loop_body (loop);
- for (i = 0; i < loop->num_nodes; i++)
- if (bbs[i]->loop_father == loop
- && cannot_convert_bb_to_perfect_nest (bbs[i], loop))
- goto fail;
-
- /* We also need to make sure the loop exit only has simple copy phis in it,
- otherwise we don't know how to transform it into a perfect nest. */
- for (si = gsi_start_phis (single_exit (loop)->dest);
- !gsi_end_p (si);
- gsi_next (&si))
- if (gimple_phi_num_args (gsi_stmt (si)) != 1)
- goto fail;
-
- free (bbs);
- return true;
-
- fail:
- free (bbs);
- return false;
-}
-
-
-DEF_VEC_I(source_location);
-DEF_VEC_ALLOC_I(source_location,heap);
-
-/* Transform the loop nest into a perfect nest, if possible.
- LOOP is the loop nest to transform into a perfect nest
- LBOUNDS are the lower bounds for the loops to transform
- UBOUNDS are the upper bounds for the loops to transform
- STEPS is the STEPS for the loops to transform.
- LOOPIVS is the induction variables for the loops to transform.
-
- Basically, for the case of
-
- FOR (i = 0; i < 50; i++)
- {
- FOR (j =0; j < 50; j++)
- {
- <whatever>
- }
- <some code>
- }
-
- This function will transform it into a perfect loop nest by splitting the
- outer loop into two loops, like so:
-
- FOR (i = 0; i < 50; i++)
- {
- FOR (j = 0; j < 50; j++)
- {
- <whatever>
- }
- }
-
- FOR (i = 0; i < 50; i ++)
- {
- <some code>
- }
-
- Return FALSE if we can't make this loop into a perfect nest. */
-
-static bool
-perfect_nestify (struct loop *loop,
- VEC(tree,heap) *lbounds,
- VEC(tree,heap) *ubounds,
- VEC(int,heap) *steps,
- VEC(tree,heap) *loopivs)
-{
- basic_block *bbs;
- gimple exit_condition;
- gimple cond_stmt;
- basic_block preheaderbb, headerbb, bodybb, latchbb, olddest;
- int i;
- gimple_stmt_iterator bsi, firstbsi;
- bool insert_after;
- edge e;
- struct loop *newloop;
- gimple phi;
- tree uboundvar;
- gimple stmt;
- tree oldivvar, ivvar, ivvarinced;
- VEC(tree,heap) *phis = NULL;
- VEC(source_location,heap) *locations = NULL;
- htab_t replacements = NULL;
-
- /* Create the new loop. */
- olddest = single_exit (loop)->dest;
- preheaderbb = split_edge (single_exit (loop));
- headerbb = create_empty_bb (EXIT_BLOCK_PTR->prev_bb);
-
- /* Push the exit phi nodes that we are moving. */
- for (bsi = gsi_start_phis (olddest); !gsi_end_p (bsi); gsi_next (&bsi))
- {
- phi = gsi_stmt (bsi);
- VEC_reserve (tree, heap, phis, 2);
- VEC_reserve (source_location, heap, locations, 1);
- VEC_quick_push (tree, phis, PHI_RESULT (phi));
- VEC_quick_push (tree, phis, PHI_ARG_DEF (phi, 0));
- VEC_quick_push (source_location, locations,
- gimple_phi_arg_location (phi, 0));
- }
- e = redirect_edge_and_branch (single_succ_edge (preheaderbb), headerbb);
-
- /* Remove the exit phis from the old basic block. */
- for (bsi = gsi_start_phis (olddest); !gsi_end_p (bsi); )
- remove_phi_node (&bsi, false);
-
- /* and add them back to the new basic block. */
- while (VEC_length (tree, phis) != 0)
- {
- tree def;
- tree phiname;
- source_location locus;
- def = VEC_pop (tree, phis);
- phiname = VEC_pop (tree, phis);
- locus = VEC_pop (source_location, locations);
- phi = create_phi_node (phiname, preheaderbb);
- add_phi_arg (phi, def, single_pred_edge (preheaderbb), locus);
- }
- flush_pending_stmts (e);
- VEC_free (tree, heap, phis);
-
- bodybb = create_empty_bb (EXIT_BLOCK_PTR->prev_bb);
- latchbb = create_empty_bb (EXIT_BLOCK_PTR->prev_bb);
- make_edge (headerbb, bodybb, EDGE_FALLTHRU);
- cond_stmt = gimple_build_cond (NE_EXPR, integer_one_node, integer_zero_node,
- NULL_TREE, NULL_TREE);
- bsi = gsi_start_bb (bodybb);
- gsi_insert_after (&bsi, cond_stmt, GSI_NEW_STMT);
- e = make_edge (bodybb, olddest, EDGE_FALSE_VALUE);
- make_edge (bodybb, latchbb, EDGE_TRUE_VALUE);
- make_edge (latchbb, headerbb, EDGE_FALLTHRU);
-
- /* Update the loop structures. */
- newloop = duplicate_loop (loop, olddest->loop_father);
- newloop->header = headerbb;
- newloop->latch = latchbb;
- add_bb_to_loop (latchbb, newloop);
- add_bb_to_loop (bodybb, newloop);
- add_bb_to_loop (headerbb, newloop);
- set_immediate_dominator (CDI_DOMINATORS, bodybb, headerbb);
- set_immediate_dominator (CDI_DOMINATORS, headerbb, preheaderbb);
- set_immediate_dominator (CDI_DOMINATORS, preheaderbb,
- single_exit (loop)->src);
- set_immediate_dominator (CDI_DOMINATORS, latchbb, bodybb);
- set_immediate_dominator (CDI_DOMINATORS, olddest,
- recompute_dominator (CDI_DOMINATORS, olddest));
- /* Create the new iv. */
- oldivvar = VEC_index (tree, loopivs, 0);
- ivvar = create_tmp_var (TREE_TYPE (oldivvar), "perfectiv");
- add_referenced_var (ivvar);
- standard_iv_increment_position (newloop, &bsi, &insert_after);
- create_iv (VEC_index (tree, lbounds, 0),
- build_int_cst (TREE_TYPE (oldivvar), VEC_index (int, steps, 0)),
- ivvar, newloop, &bsi, insert_after, &ivvar, &ivvarinced);
-
- /* Create the new upper bound. This may be not just a variable, so we copy
- it to one just in case. */
-
- exit_condition = get_loop_exit_condition (newloop);
- uboundvar = create_tmp_var (TREE_TYPE (VEC_index (tree, ubounds, 0)),
- "uboundvar");
- add_referenced_var (uboundvar);
- stmt = gimple_build_assign (uboundvar, VEC_index (tree, ubounds, 0));
- uboundvar = make_ssa_name (uboundvar, stmt);
- gimple_assign_set_lhs (stmt, uboundvar);
-
- if (insert_after)
- gsi_insert_after (&bsi, stmt, GSI_SAME_STMT);
- else
- gsi_insert_before (&bsi, stmt, GSI_SAME_STMT);
- update_stmt (stmt);
- gimple_cond_set_condition (exit_condition, GE_EXPR, uboundvar, ivvarinced);
- update_stmt (exit_condition);
- replacements = htab_create_ggc (20, tree_map_hash,
- tree_map_eq, NULL);
- bbs = get_loop_body_in_dom_order (loop);
- /* Now move the statements, and replace the induction variable in the moved
- statements with the correct loop induction variable. */
- oldivvar = VEC_index (tree, loopivs, 0);
- firstbsi = gsi_start_bb (bodybb);
- for (i = loop->num_nodes - 1; i >= 0 ; i--)
- {
- gimple_stmt_iterator tobsi = gsi_last_bb (bodybb);
- if (bbs[i]->loop_father == loop)
- {
- /* If this is true, we are *before* the inner loop.
- If this isn't true, we are *after* it.
-
- The only time can_convert_to_perfect_nest returns true when we
- have statements before the inner loop is if they can be moved
- into the inner loop.
-
- The only time can_convert_to_perfect_nest returns true when we
- have statements after the inner loop is if they can be moved into
- the new split loop. */
-
- if (dominated_by_p (CDI_DOMINATORS, loop->inner->header, bbs[i]))
- {
- gimple_stmt_iterator header_bsi
- = gsi_after_labels (loop->inner->header);
-
- for (bsi = gsi_start_bb (bbs[i]); !gsi_end_p (bsi);)
- {
- gimple stmt = gsi_stmt (bsi);
-
- if (stmt == exit_condition
- || not_interesting_stmt (stmt)
- || stmt_is_bumper_for_loop (loop, stmt))
- {
- gsi_next (&bsi);
- continue;
- }
-
- gsi_move_before (&bsi, &header_bsi);
- }
- }
- else
- {
- /* Note that the bsi only needs to be explicitly incremented
- when we don't move something, since it is automatically
- incremented when we do. */
- for (bsi = gsi_start_bb (bbs[i]); !gsi_end_p (bsi);)
- {
- gimple stmt = gsi_stmt (bsi);
-
- if (stmt == exit_condition
- || not_interesting_stmt (stmt)
- || stmt_is_bumper_for_loop (loop, stmt))
- {
- gsi_next (&bsi);
- continue;
- }
-
- replace_uses_equiv_to_x_with_y
- (loop, stmt, oldivvar, VEC_index (int, steps, 0), ivvar,
- VEC_index (tree, lbounds, 0), replacements, &firstbsi);
-
- gsi_move_before (&bsi, &tobsi);
-
- /* If the statement has any virtual operands, they may
- need to be rewired because the original loop may
- still reference them. */
- if (gimple_vuse (stmt))
- mark_sym_for_renaming (gimple_vop (cfun));
- }
- }
-
- }
- }
-
- free (bbs);
- htab_delete (replacements);
- return perfect_nest_p (loop);
-}
-
-/* Return true if TRANS is a legal transformation matrix that respects
- the dependence vectors in DISTS and DIRS. The conservative answer
- is false.
-
- "Wolfe proves that a unimodular transformation represented by the
- matrix T is legal when applied to a loop nest with a set of
- lexicographically non-negative distance vectors RDG if and only if
- for each vector d in RDG, (T.d >= 0) is lexicographically positive.
- i.e.: if and only if it transforms the lexicographically positive
- distance vectors to lexicographically positive vectors. Note that
- a unimodular matrix must transform the zero vector (and only it) to
- the zero vector." S.Muchnick. */
-
-bool
-lambda_transform_legal_p (lambda_trans_matrix trans,
- int nb_loops,
- VEC (ddr_p, heap) *dependence_relations)
-{
- unsigned int i, j;
- lambda_vector distres;
- struct data_dependence_relation *ddr;
-
- gcc_assert (LTM_COLSIZE (trans) == nb_loops
- && LTM_ROWSIZE (trans) == nb_loops);
-
- /* When there are no dependences, the transformation is correct. */
- if (VEC_length (ddr_p, dependence_relations) == 0)
- return true;
-
- ddr = VEC_index (ddr_p, dependence_relations, 0);
- if (ddr == NULL)
- return true;
-
- /* When there is an unknown relation in the dependence_relations, we
- know that it is no worth looking at this loop nest: give up. */
- if (DDR_ARE_DEPENDENT (ddr) == chrec_dont_know)
- return false;
-
- distres = lambda_vector_new (nb_loops);
-
- /* For each distance vector in the dependence graph. */
- FOR_EACH_VEC_ELT (ddr_p, dependence_relations, i, ddr)
- {
- /* Don't care about relations for which we know that there is no
- dependence, nor about read-read (aka. output-dependences):
- these data accesses can happen in any order. */
- if (DDR_ARE_DEPENDENT (ddr) == chrec_known
- || (DR_IS_READ (DDR_A (ddr)) && DR_IS_READ (DDR_B (ddr))))
- continue;
-
- /* Conservatively answer: "this transformation is not valid". */
- if (DDR_ARE_DEPENDENT (ddr) == chrec_dont_know)
- return false;
-
- /* If the dependence could not be captured by a distance vector,
- conservatively answer that the transform is not valid. */
- if (DDR_NUM_DIST_VECTS (ddr) == 0)
- return false;
-
- /* Compute trans.dist_vect */
- for (j = 0; j < DDR_NUM_DIST_VECTS (ddr); j++)
- {
- lambda_matrix_vector_mult (LTM_MATRIX (trans), nb_loops, nb_loops,
- DDR_DIST_VECT (ddr, j), distres);
-
- if (!lambda_vector_lexico_pos (distres, nb_loops))
- return false;
- }
- }
- return true;
-}
-
-
-/* Collects parameters from affine function ACCESS_FUNCTION, and push
- them in PARAMETERS. */
-
-static void
-lambda_collect_parameters_from_af (tree access_function,
- struct pointer_set_t *param_set,
- VEC (tree, heap) **parameters)
-{
- if (access_function == NULL)
- return;
-
- if (TREE_CODE (access_function) == SSA_NAME
- && pointer_set_contains (param_set, access_function) == 0)
- {
- pointer_set_insert (param_set, access_function);
- VEC_safe_push (tree, heap, *parameters, access_function);
- }
- else
- {
- int i, num_operands = tree_operand_length (access_function);
-
- for (i = 0; i < num_operands; i++)
- lambda_collect_parameters_from_af (TREE_OPERAND (access_function, i),
- param_set, parameters);
- }
-}
-
-/* Collects parameters from DATAREFS, and push them in PARAMETERS. */
-
-void
-lambda_collect_parameters (VEC (data_reference_p, heap) *datarefs,
- VEC (tree, heap) **parameters)
-{
- unsigned i, j;
- struct pointer_set_t *parameter_set = pointer_set_create ();
- data_reference_p data_reference;
-
- FOR_EACH_VEC_ELT (data_reference_p, datarefs, i, data_reference)
- for (j = 0; j < DR_NUM_DIMENSIONS (data_reference); j++)
- lambda_collect_parameters_from_af (DR_ACCESS_FN (data_reference, j),
- parameter_set, parameters);
- pointer_set_destroy (parameter_set);
-}
-
-/* Translates BASE_EXPR to vector CY. AM is needed for inferring
- indexing positions in the data access vector. CST is the analyzed
- integer constant. */
-
-static bool
-av_for_af_base (tree base_expr, lambda_vector cy, struct access_matrix *am,
- int cst)
-{
- bool result = true;
-
- switch (TREE_CODE (base_expr))
- {
- case INTEGER_CST:
- /* Constant part. */
- cy[AM_CONST_COLUMN_INDEX (am)] += int_cst_value (base_expr) * cst;
- return true;
-
- case SSA_NAME:
- {
- int param_index =
- access_matrix_get_index_for_parameter (base_expr, am);
-
- if (param_index >= 0)
- {
- cy[param_index] = cst + cy[param_index];
- return true;
- }
-
- return false;
- }
-
- case PLUS_EXPR:
- return av_for_af_base (TREE_OPERAND (base_expr, 0), cy, am, cst)
- && av_for_af_base (TREE_OPERAND (base_expr, 1), cy, am, cst);
-
- case MINUS_EXPR:
- return av_for_af_base (TREE_OPERAND (base_expr, 0), cy, am, cst)
- && av_for_af_base (TREE_OPERAND (base_expr, 1), cy, am, -1 * cst);
-
- case MULT_EXPR:
- if (TREE_CODE (TREE_OPERAND (base_expr, 0)) == INTEGER_CST)
- result = av_for_af_base (TREE_OPERAND (base_expr, 1),
- cy, am, cst *
- int_cst_value (TREE_OPERAND (base_expr, 0)));
- else if (TREE_CODE (TREE_OPERAND (base_expr, 1)) == INTEGER_CST)
- result = av_for_af_base (TREE_OPERAND (base_expr, 0),
- cy, am, cst *
- int_cst_value (TREE_OPERAND (base_expr, 1)));
- else
- result = false;
-
- return result;
-
- case NEGATE_EXPR:
- return av_for_af_base (TREE_OPERAND (base_expr, 0), cy, am, -1 * cst);
-
- default:
- return false;
- }
-
- return result;
-}
-
-/* Translates ACCESS_FUN to vector CY. AM is needed for inferring
- indexing positions in the data access vector. */
-
-static bool
-av_for_af (tree access_fun, lambda_vector cy, struct access_matrix *am)
-{
- switch (TREE_CODE (access_fun))
- {
- case POLYNOMIAL_CHREC:
- {
- tree left = CHREC_LEFT (access_fun);
- tree right = CHREC_RIGHT (access_fun);
- unsigned var;
-
- if (TREE_CODE (right) != INTEGER_CST)
- return false;
-
- var = am_vector_index_for_loop (am, CHREC_VARIABLE (access_fun));
- cy[var] = int_cst_value (right);
-
- if (TREE_CODE (left) == POLYNOMIAL_CHREC)
- return av_for_af (left, cy, am);
- else
- return av_for_af_base (left, cy, am, 1);
- }
-
- case INTEGER_CST:
- /* Constant part. */
- return av_for_af_base (access_fun, cy, am, 1);
-
- default:
- return false;
- }
-}
-
-/* Initializes the access matrix for DATA_REFERENCE. */
-
-static bool
-build_access_matrix (data_reference_p data_reference,
- VEC (tree, heap) *parameters,
- VEC (loop_p, heap) *nest,
- struct obstack * lambda_obstack)
-{
- struct access_matrix *am = (struct access_matrix *)
- obstack_alloc(lambda_obstack, sizeof (struct access_matrix));
- unsigned i, ndim = DR_NUM_DIMENSIONS (data_reference);
- unsigned nivs = VEC_length (loop_p, nest);
- unsigned lambda_nb_columns;
-
- AM_LOOP_NEST (am) = nest;
- AM_NB_INDUCTION_VARS (am) = nivs;
- AM_PARAMETERS (am) = parameters;
-
- lambda_nb_columns = AM_NB_COLUMNS (am);
- AM_MATRIX (am) = VEC_alloc (lambda_vector, gc, ndim);
-
- for (i = 0; i < ndim; i++)
- {
- lambda_vector access_vector = lambda_vector_new (lambda_nb_columns);
- tree access_function = DR_ACCESS_FN (data_reference, i);
-
- if (!av_for_af (access_function, access_vector, am))
- return false;
-
- VEC_quick_push (lambda_vector, AM_MATRIX (am), access_vector);
- }
-
- DR_ACCESS_MATRIX (data_reference) = am;
- return true;
-}
-
-/* Returns false when one of the access matrices cannot be built. */
-
-bool
-lambda_compute_access_matrices (VEC (data_reference_p, heap) *datarefs,
- VEC (tree, heap) *parameters,
- VEC (loop_p, heap) *nest,
- struct obstack * lambda_obstack)
-{
- data_reference_p dataref;
- unsigned ix;
-
- FOR_EACH_VEC_ELT (data_reference_p, datarefs, ix, dataref)
- if (!build_access_matrix (dataref, parameters, nest, lambda_obstack))
- return false;
-
- return true;
-}
diff --git a/gcc/lambda-mat.c b/gcc/lambda-mat.c
deleted file mode 100644
index c57fb58c99b..00000000000
--- a/gcc/lambda-mat.c
+++ /dev/null
@@ -1,608 +0,0 @@
-/* Integer matrix math routines
- Copyright (C) 2003, 2004, 2005, 2007, 2008, 2010
- Free Software Foundation, Inc.
- Contributed by Daniel Berlin <dberlin@dberlin.org>.
-
-This file is part of GCC.
-
-GCC is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free
-Software Foundation; either version 3, or (at your option) any later
-version.
-
-GCC is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-for more details.
-
-You should have received a copy of the GNU General Public License
-along with GCC; see the file COPYING3. If not see
-<http://www.gnu.org/licenses/>. */
-
-#include "config.h"
-#include "system.h"
-#include "coretypes.h"
-#include "tree-flow.h"
-#include "lambda.h"
-
-/* Allocate a matrix of M rows x N cols. */
-
-lambda_matrix
-lambda_matrix_new (int m, int n, struct obstack * lambda_obstack)
-{
- lambda_matrix mat;
- int i;
-
- mat = (lambda_matrix) obstack_alloc (lambda_obstack,
- sizeof (lambda_vector *) * m);
-
- for (i = 0; i < m; i++)
- mat[i] = lambda_vector_new (n);
-
- return mat;
-}
-
-/* Copy the elements of M x N matrix MAT1 to MAT2. */
-
-void
-lambda_matrix_copy (lambda_matrix mat1, lambda_matrix mat2,
- int m, int n)
-{
- int i;
-
- for (i = 0; i < m; i++)
- lambda_vector_copy (mat1[i], mat2[i], n);
-}
-
-/* Store the N x N identity matrix in MAT. */
-
-void
-lambda_matrix_id (lambda_matrix mat, int size)
-{
- int i, j;
-
- for (i = 0; i < size; i++)
- for (j = 0; j < size; j++)
- mat[i][j] = (i == j) ? 1 : 0;
-}
-
-/* Return true if MAT is the identity matrix of SIZE */
-
-bool
-lambda_matrix_id_p (lambda_matrix mat, int size)
-{
- int i, j;
- for (i = 0; i < size; i++)
- for (j = 0; j < size; j++)
- {
- if (i == j)
- {
- if (mat[i][j] != 1)
- return false;
- }
- else
- {
- if (mat[i][j] != 0)
- return false;
- }
- }
- return true;
-}
-
-/* Negate the elements of the M x N matrix MAT1 and store it in MAT2. */
-
-void
-lambda_matrix_negate (lambda_matrix mat1, lambda_matrix mat2, int m, int n)
-{
- int i;
-
- for (i = 0; i < m; i++)
- lambda_vector_negate (mat1[i], mat2[i], n);
-}
-
-/* Take the transpose of matrix MAT1 and store it in MAT2.
- MAT1 is an M x N matrix, so MAT2 must be N x M. */
-
-void
-lambda_matrix_transpose (lambda_matrix mat1, lambda_matrix mat2, int m, int n)
-{
- int i, j;
-
- for (i = 0; i < n; i++)
- for (j = 0; j < m; j++)
- mat2[i][j] = mat1[j][i];
-}
-
-
-/* Add two M x N matrices together: MAT3 = MAT1+MAT2. */
-
-void
-lambda_matrix_add (lambda_matrix mat1, lambda_matrix mat2,
- lambda_matrix mat3, int m, int n)
-{
- int i;
-
- for (i = 0; i < m; i++)
- lambda_vector_add (mat1[i], mat2[i], mat3[i], n);
-}
-
-/* MAT3 = CONST1 * MAT1 + CONST2 * MAT2. All matrices are M x N. */
-
-void
-lambda_matrix_add_mc (lambda_matrix mat1, int const1,
- lambda_matrix mat2, int const2,
- lambda_matrix mat3, int m, int n)
-{
- int i;
-
- for (i = 0; i < m; i++)
- lambda_vector_add_mc (mat1[i], const1, mat2[i], const2, mat3[i], n);
-}
-
-/* Multiply two matrices: MAT3 = MAT1 * MAT2.
- MAT1 is an M x R matrix, and MAT2 is R x N. The resulting MAT2
- must therefore be M x N. */
-
-void
-lambda_matrix_mult (lambda_matrix mat1, lambda_matrix mat2,
- lambda_matrix mat3, int m, int r, int n)
-{
-
- int i, j, k;
-
- for (i = 0; i < m; i++)
- {
- for (j = 0; j < n; j++)
- {
- mat3[i][j] = 0;
- for (k = 0; k < r; k++)
- mat3[i][j] += mat1[i][k] * mat2[k][j];
- }
- }
-}
-
-/* Delete rows r1 to r2 (not including r2). */
-
-void
-lambda_matrix_delete_rows (lambda_matrix mat, int rows, int from, int to)
-{
- int i;
- int dist;
- dist = to - from;
-
- for (i = to; i < rows; i++)
- mat[i - dist] = mat[i];
-
- for (i = rows - dist; i < rows; i++)
- mat[i] = NULL;
-}
-
-/* Swap rows R1 and R2 in matrix MAT. */
-
-void
-lambda_matrix_row_exchange (lambda_matrix mat, int r1, int r2)
-{
- lambda_vector row;
-
- row = mat[r1];
- mat[r1] = mat[r2];
- mat[r2] = row;
-}
-
-/* Add a multiple of row R1 of matrix MAT with N columns to row R2:
- R2 = R2 + CONST1 * R1. */
-
-void
-lambda_matrix_row_add (lambda_matrix mat, int n, int r1, int r2, int const1)
-{
- int i;
-
- if (const1 == 0)
- return;
-
- for (i = 0; i < n; i++)
- mat[r2][i] += const1 * mat[r1][i];
-}
-
-/* Negate row R1 of matrix MAT which has N columns. */
-
-void
-lambda_matrix_row_negate (lambda_matrix mat, int n, int r1)
-{
- lambda_vector_negate (mat[r1], mat[r1], n);
-}
-
-/* Multiply row R1 of matrix MAT with N columns by CONST1. */
-
-void
-lambda_matrix_row_mc (lambda_matrix mat, int n, int r1, int const1)
-{
- int i;
-
- for (i = 0; i < n; i++)
- mat[r1][i] *= const1;
-}
-
-/* Exchange COL1 and COL2 in matrix MAT. M is the number of rows. */
-
-void
-lambda_matrix_col_exchange (lambda_matrix mat, int m, int col1, int col2)
-{
- int i;
- int tmp;
- for (i = 0; i < m; i++)
- {
- tmp = mat[i][col1];
- mat[i][col1] = mat[i][col2];
- mat[i][col2] = tmp;
- }
-}
-
-/* Add a multiple of column C1 of matrix MAT with M rows to column C2:
- C2 = C2 + CONST1 * C1. */
-
-void
-lambda_matrix_col_add (lambda_matrix mat, int m, int c1, int c2, int const1)
-{
- int i;
-
- if (const1 == 0)
- return;
-
- for (i = 0; i < m; i++)
- mat[i][c2] += const1 * mat[i][c1];
-}
-
-/* Negate column C1 of matrix MAT which has M rows. */
-
-void
-lambda_matrix_col_negate (lambda_matrix mat, int m, int c1)
-{
- int i;
-
- for (i = 0; i < m; i++)
- mat[i][c1] *= -1;
-}
-
-/* Multiply column C1 of matrix MAT with M rows by CONST1. */
-
-void
-lambda_matrix_col_mc (lambda_matrix mat, int m, int c1, int const1)
-{
- int i;
-
- for (i = 0; i < m; i++)
- mat[i][c1] *= const1;
-}
-
-/* Compute the inverse of the N x N matrix MAT and store it in INV.
-
- We don't _really_ compute the inverse of MAT. Instead we compute
- det(MAT)*inv(MAT), and we return det(MAT) to the caller as the function
- result. This is necessary to preserve accuracy, because we are dealing
- with integer matrices here.
-
- The algorithm used here is a column based Gauss-Jordan elimination on MAT
- and the identity matrix in parallel. The inverse is the result of applying
- the same operations on the identity matrix that reduce MAT to the identity
- matrix.
-
- When MAT is a 2 x 2 matrix, we don't go through the whole process, because
- it is easily inverted by inspection and it is a very common case. */
-
-static int lambda_matrix_inverse_hard (lambda_matrix, lambda_matrix, int,
- struct obstack *);
-
-int
-lambda_matrix_inverse (lambda_matrix mat, lambda_matrix inv, int n,
- struct obstack * lambda_obstack)
-{
- if (n == 2)
- {
- int a, b, c, d, det;
- a = mat[0][0];
- b = mat[1][0];
- c = mat[0][1];
- d = mat[1][1];
- inv[0][0] = d;
- inv[0][1] = -c;
- inv[1][0] = -b;
- inv[1][1] = a;
- det = (a * d - b * c);
- if (det < 0)
- {
- det *= -1;
- inv[0][0] *= -1;
- inv[1][0] *= -1;
- inv[0][1] *= -1;
- inv[1][1] *= -1;
- }
- return det;
- }
- else
- return lambda_matrix_inverse_hard (mat, inv, n, lambda_obstack);
-}
-
-/* If MAT is not a special case, invert it the hard way. */
-
-static int
-lambda_matrix_inverse_hard (lambda_matrix mat, lambda_matrix inv, int n,
- struct obstack * lambda_obstack)
-{
- lambda_vector row;
- lambda_matrix temp;
- int i, j;
- int determinant;
-
- temp = lambda_matrix_new (n, n, lambda_obstack);
- lambda_matrix_copy (mat, temp, n, n);
- lambda_matrix_id (inv, n);
-
- /* Reduce TEMP to a lower triangular form, applying the same operations on
- INV which starts as the identity matrix. N is the number of rows and
- columns. */
- for (j = 0; j < n; j++)
- {
- row = temp[j];
-
- /* Make every element in the current row positive. */
- for (i = j; i < n; i++)
- if (row[i] < 0)
- {
- lambda_matrix_col_negate (temp, n, i);
- lambda_matrix_col_negate (inv, n, i);
- }
-
- /* Sweep the upper triangle. Stop when only the diagonal element in the
- current row is nonzero. */
- while (lambda_vector_first_nz (row, n, j + 1) < n)
- {
- int min_col = lambda_vector_min_nz (row, n, j);
- lambda_matrix_col_exchange (temp, n, j, min_col);
- lambda_matrix_col_exchange (inv, n, j, min_col);
-
- for (i = j + 1; i < n; i++)
- {
- int factor;
-
- factor = -1 * row[i];
- if (row[j] != 1)
- factor /= row[j];
-
- lambda_matrix_col_add (temp, n, j, i, factor);
- lambda_matrix_col_add (inv, n, j, i, factor);
- }
- }
- }
-
- /* Reduce TEMP from a lower triangular to the identity matrix. Also compute
- the determinant, which now is simply the product of the elements on the
- diagonal of TEMP. If one of these elements is 0, the matrix has 0 as an
- eigenvalue so it is singular and hence not invertible. */
- determinant = 1;
- for (j = n - 1; j >= 0; j--)
- {
- int diagonal;
-
- row = temp[j];
- diagonal = row[j];
-
- /* The matrix must not be singular. */
- gcc_assert (diagonal);
-
- determinant = determinant * diagonal;
-
- /* If the diagonal is not 1, then multiply the each row by the
- diagonal so that the middle number is now 1, rather than a
- rational. */
- if (diagonal != 1)
- {
- for (i = 0; i < j; i++)
- lambda_matrix_col_mc (inv, n, i, diagonal);
- for (i = j + 1; i < n; i++)
- lambda_matrix_col_mc (inv, n, i, diagonal);
-
- row[j] = diagonal = 1;
- }
-
- /* Sweep the lower triangle column wise. */
- for (i = j - 1; i >= 0; i--)
- {
- if (row[i])
- {
- int factor = -row[i];
- lambda_matrix_col_add (temp, n, j, i, factor);
- lambda_matrix_col_add (inv, n, j, i, factor);
- }
-
- }
- }
-
- return determinant;
-}
-
-/* Decompose a N x N matrix MAT to a product of a lower triangular H
- and a unimodular U matrix such that MAT = H.U. N is the size of
- the rows of MAT. */
-
-void
-lambda_matrix_hermite (lambda_matrix mat, int n,
- lambda_matrix H, lambda_matrix U)
-{
- lambda_vector row;
- int i, j, factor, minimum_col;
-
- lambda_matrix_copy (mat, H, n, n);
- lambda_matrix_id (U, n);
-
- for (j = 0; j < n; j++)
- {
- row = H[j];
-
- /* Make every element of H[j][j..n] positive. */
- for (i = j; i < n; i++)
- {
- if (row[i] < 0)
- {
- lambda_matrix_col_negate (H, n, i);
- lambda_vector_negate (U[i], U[i], n);
- }
- }
-
- /* Stop when only the diagonal element is nonzero. */
- while (lambda_vector_first_nz (row, n, j + 1) < n)
- {
- minimum_col = lambda_vector_min_nz (row, n, j);
- lambda_matrix_col_exchange (H, n, j, minimum_col);
- lambda_matrix_row_exchange (U, j, minimum_col);
-
- for (i = j + 1; i < n; i++)
- {
- factor = row[i] / row[j];
- lambda_matrix_col_add (H, n, j, i, -1 * factor);
- lambda_matrix_row_add (U, n, i, j, factor);
- }
- }
- }
-}
-
-/* Given an M x N integer matrix A, this function determines an M x
- M unimodular matrix U, and an M x N echelon matrix S such that
- "U.A = S". This decomposition is also known as "right Hermite".
-
- Ref: Algorithm 2.1 page 33 in "Loop Transformations for
- Restructuring Compilers" Utpal Banerjee. */
-
-void
-lambda_matrix_right_hermite (lambda_matrix A, int m, int n,
- lambda_matrix S, lambda_matrix U)
-{
- int i, j, i0 = 0;
-
- lambda_matrix_copy (A, S, m, n);
- lambda_matrix_id (U, m);
-
- for (j = 0; j < n; j++)
- {
- if (lambda_vector_first_nz (S[j], m, i0) < m)
- {
- ++i0;
- for (i = m - 1; i >= i0; i--)
- {
- while (S[i][j] != 0)
- {
- int sigma, factor, a, b;
-
- a = S[i-1][j];
- b = S[i][j];
- sigma = (a * b < 0) ? -1: 1;
- a = abs (a);
- b = abs (b);
- factor = sigma * (a / b);
-
- lambda_matrix_row_add (S, n, i, i-1, -factor);
- lambda_matrix_row_exchange (S, i, i-1);
-
- lambda_matrix_row_add (U, m, i, i-1, -factor);
- lambda_matrix_row_exchange (U, i, i-1);
- }
- }
- }
- }
-}
-
-/* Given an M x N integer matrix A, this function determines an M x M
- unimodular matrix V, and an M x N echelon matrix S such that "A =
- V.S". This decomposition is also known as "left Hermite".
-
- Ref: Algorithm 2.2 page 36 in "Loop Transformations for
- Restructuring Compilers" Utpal Banerjee. */
-
-void
-lambda_matrix_left_hermite (lambda_matrix A, int m, int n,
- lambda_matrix S, lambda_matrix V)
-{
- int i, j, i0 = 0;
-
- lambda_matrix_copy (A, S, m, n);
- lambda_matrix_id (V, m);
-
- for (j = 0; j < n; j++)
- {
- if (lambda_vector_first_nz (S[j], m, i0) < m)
- {
- ++i0;
- for (i = m - 1; i >= i0; i--)
- {
- while (S[i][j] != 0)
- {
- int sigma, factor, a, b;
-
- a = S[i-1][j];
- b = S[i][j];
- sigma = (a * b < 0) ? -1: 1;
- a = abs (a);
- b = abs (b);
- factor = sigma * (a / b);
-
- lambda_matrix_row_add (S, n, i, i-1, -factor);
- lambda_matrix_row_exchange (S, i, i-1);
-
- lambda_matrix_col_add (V, m, i-1, i, factor);
- lambda_matrix_col_exchange (V, m, i, i-1);
- }
- }
- }
- }
-}
-
-/* When it exists, return the first nonzero row in MAT after row
- STARTROW. Otherwise return rowsize. */
-
-int
-lambda_matrix_first_nz_vec (lambda_matrix mat, int rowsize, int colsize,
- int startrow)
-{
- int j;
- bool found = false;
-
- for (j = startrow; (j < rowsize) && !found; j++)
- {
- if ((mat[j] != NULL)
- && (lambda_vector_first_nz (mat[j], colsize, startrow) < colsize))
- found = true;
- }
-
- if (found)
- return j - 1;
- return rowsize;
-}
-
-/* Multiply a vector VEC by a matrix MAT.
- MAT is an M*N matrix, and VEC is a vector with length N. The result
- is stored in DEST which must be a vector of length M. */
-
-void
-lambda_matrix_vector_mult (lambda_matrix matrix, int m, int n,
- lambda_vector vec, lambda_vector dest)
-{
- int i, j;
-
- lambda_vector_clear (dest, m);
- for (i = 0; i < m; i++)
- for (j = 0; j < n; j++)
- dest[i] += matrix[i][j] * vec[j];
-}
-
-/* Print out an M x N matrix MAT to OUTFILE. */
-
-void
-print_lambda_matrix (FILE * outfile, lambda_matrix matrix, int m, int n)
-{
- int i;
-
- for (i = 0; i < m; i++)
- print_lambda_vector (outfile, matrix[i], n);
- fprintf (outfile, "\n");
-}
-
diff --git a/gcc/lambda-trans.c b/gcc/lambda-trans.c
deleted file mode 100644
index ba1449977ea..00000000000
--- a/gcc/lambda-trans.c
+++ /dev/null
@@ -1,80 +0,0 @@
-/* Lambda matrix transformations.
- Copyright (C) 2003, 2004, 2007, 2008, 2010 Free Software Foundation, Inc.
- Contributed by Daniel Berlin <dberlin@dberlin.org>.
-
-This file is part of GCC.
-
-GCC is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free
-Software Foundation; either version 3, or (at your option) any later
-version.
-
-GCC is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-for more details.
-
-You should have received a copy of the GNU General Public License
-along with GCC; see the file COPYING3. If not see
-<http://www.gnu.org/licenses/>. */
-
-#include "config.h"
-#include "system.h"
-#include "coretypes.h"
-#include "tree-flow.h"
-#include "lambda.h"
-
-/* Allocate a new transformation matrix. */
-
-lambda_trans_matrix
-lambda_trans_matrix_new (int colsize, int rowsize,
- struct obstack * lambda_obstack)
-{
- lambda_trans_matrix ret;
-
- ret = (lambda_trans_matrix)
- obstack_alloc (lambda_obstack, sizeof (struct lambda_trans_matrix_s));
- LTM_MATRIX (ret) = lambda_matrix_new (rowsize, colsize, lambda_obstack);
- LTM_ROWSIZE (ret) = rowsize;
- LTM_COLSIZE (ret) = colsize;
- LTM_DENOMINATOR (ret) = 1;
- return ret;
-}
-
-/* Return true if MAT is an identity matrix. */
-
-bool
-lambda_trans_matrix_id_p (lambda_trans_matrix mat)
-{
- if (LTM_ROWSIZE (mat) != LTM_COLSIZE (mat))
- return false;
- return lambda_matrix_id_p (LTM_MATRIX (mat), LTM_ROWSIZE (mat));
-}
-
-
-/* Compute the inverse of the transformation matrix MAT. */
-
-lambda_trans_matrix
-lambda_trans_matrix_inverse (lambda_trans_matrix mat,
- struct obstack * lambda_obstack)
-{
- lambda_trans_matrix inverse;
- int determinant;
-
- inverse = lambda_trans_matrix_new (LTM_ROWSIZE (mat), LTM_COLSIZE (mat),
- lambda_obstack);
- determinant = lambda_matrix_inverse (LTM_MATRIX (mat), LTM_MATRIX (inverse),
- LTM_ROWSIZE (mat), lambda_obstack);
- LTM_DENOMINATOR (inverse) = determinant;
- return inverse;
-}
-
-
-/* Print out a transformation matrix. */
-
-void
-print_lambda_trans_matrix (FILE *outfile, lambda_trans_matrix mat)
-{
- print_lambda_matrix (outfile, LTM_MATRIX (mat), LTM_ROWSIZE (mat),
- LTM_COLSIZE (mat));
-}
diff --git a/gcc/lambda.h b/gcc/lambda.h
deleted file mode 100644
index 382b71f7e0d..00000000000
--- a/gcc/lambda.h
+++ /dev/null
@@ -1,524 +0,0 @@
-/* Lambda matrix and vector interface.
- Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
- Free Software Foundation, Inc.
- Contributed by Daniel Berlin <dberlin@dberlin.org>
-
-This file is part of GCC.
-
-GCC is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free
-Software Foundation; either version 3, or (at your option) any later
-version.
-
-GCC is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-for more details.
-
-You should have received a copy of the GNU General Public License
-along with GCC; see the file COPYING3. If not see
-<http://www.gnu.org/licenses/>. */
-
-#ifndef LAMBDA_H
-#define LAMBDA_H
-
-#include "vec.h"
-
-/* An integer vector. A vector formally consists of an element of a vector
- space. A vector space is a set that is closed under vector addition
- and scalar multiplication. In this vector space, an element is a list of
- integers. */
-typedef int *lambda_vector;
-DEF_VEC_P(lambda_vector);
-DEF_VEC_ALLOC_P(lambda_vector,heap);
-DEF_VEC_ALLOC_P(lambda_vector,gc);
-
-typedef VEC(lambda_vector, heap) *lambda_vector_vec_p;
-DEF_VEC_P (lambda_vector_vec_p);
-DEF_VEC_ALLOC_P (lambda_vector_vec_p, heap);
-
-/* An integer matrix. A matrix consists of m vectors of length n (IE
- all vectors are the same length). */
-typedef lambda_vector *lambda_matrix;
-
-DEF_VEC_P (lambda_matrix);
-DEF_VEC_ALLOC_P (lambda_matrix, heap);
-
-/* A transformation matrix, which is a self-contained ROWSIZE x COLSIZE
- matrix. Rather than use floats, we simply keep a single DENOMINATOR that
- represents the denominator for every element in the matrix. */
-typedef struct lambda_trans_matrix_s
-{
- lambda_matrix matrix;
- int rowsize;
- int colsize;
- int denominator;
-} *lambda_trans_matrix;
-#define LTM_MATRIX(T) ((T)->matrix)
-#define LTM_ROWSIZE(T) ((T)->rowsize)
-#define LTM_COLSIZE(T) ((T)->colsize)
-#define LTM_DENOMINATOR(T) ((T)->denominator)
-
-/* A vector representing a statement in the body of a loop.
- The COEFFICIENTS vector contains a coefficient for each induction variable
- in the loop nest containing the statement.
- The DENOMINATOR represents the denominator for each coefficient in the
- COEFFICIENT vector.
-
- This structure is used during code generation in order to rewrite the old
- induction variable uses in a statement in terms of the newly created
- induction variables. */
-typedef struct lambda_body_vector_s
-{
- lambda_vector coefficients;
- int size;
- int denominator;
-} *lambda_body_vector;
-#define LBV_COEFFICIENTS(T) ((T)->coefficients)
-#define LBV_SIZE(T) ((T)->size)
-#define LBV_DENOMINATOR(T) ((T)->denominator)
-
-/* Piecewise linear expression.
- This structure represents a linear expression with terms for the invariants
- and induction variables of a loop.
- COEFFICIENTS is a vector of coefficients for the induction variables, one
- per loop in the loop nest.
- CONSTANT is the constant portion of the linear expression
- INVARIANT_COEFFICIENTS is a vector of coefficients for the loop invariants,
- one per invariant.
- DENOMINATOR is the denominator for all of the coefficients and constants in
- the expression.
- The linear expressions can be linked together using the NEXT field, in
- order to represent MAX or MIN of a group of linear expressions. */
-typedef struct lambda_linear_expression_s
-{
- lambda_vector coefficients;
- int constant;
- lambda_vector invariant_coefficients;
- int denominator;
- struct lambda_linear_expression_s *next;
-} *lambda_linear_expression;
-
-#define LLE_COEFFICIENTS(T) ((T)->coefficients)
-#define LLE_CONSTANT(T) ((T)->constant)
-#define LLE_INVARIANT_COEFFICIENTS(T) ((T)->invariant_coefficients)
-#define LLE_DENOMINATOR(T) ((T)->denominator)
-#define LLE_NEXT(T) ((T)->next)
-
-struct obstack;
-
-lambda_linear_expression lambda_linear_expression_new (int, int,
- struct obstack *);
-void print_lambda_linear_expression (FILE *, lambda_linear_expression, int,
- int, char);
-
-/* Loop structure. Our loop structure consists of a constant representing the
- STEP of the loop, a set of linear expressions representing the LOWER_BOUND
- of the loop, a set of linear expressions representing the UPPER_BOUND of
- the loop, and a set of linear expressions representing the LINEAR_OFFSET of
- the loop. The linear offset is a set of linear expressions that are
- applied to *both* the lower bound, and the upper bound. */
-typedef struct lambda_loop_s
-{
- lambda_linear_expression lower_bound;
- lambda_linear_expression upper_bound;
- lambda_linear_expression linear_offset;
- int step;
-} *lambda_loop;
-
-#define LL_LOWER_BOUND(T) ((T)->lower_bound)
-#define LL_UPPER_BOUND(T) ((T)->upper_bound)
-#define LL_LINEAR_OFFSET(T) ((T)->linear_offset)
-#define LL_STEP(T) ((T)->step)
-
-/* Loop nest structure.
- The loop nest structure consists of a set of loop structures (defined
- above) in LOOPS, along with an integer representing the DEPTH of the loop,
- and an integer representing the number of INVARIANTS in the loop. Both of
- these integers are used to size the associated coefficient vectors in the
- linear expression structures. */
-typedef struct lambda_loopnest_s
-{
- lambda_loop *loops;
- int depth;
- int invariants;
-} *lambda_loopnest;
-
-#define LN_LOOPS(T) ((T)->loops)
-#define LN_DEPTH(T) ((T)->depth)
-#define LN_INVARIANTS(T) ((T)->invariants)
-
-lambda_loopnest lambda_loopnest_new (int, int, struct obstack *);
-lambda_loopnest lambda_loopnest_transform (lambda_loopnest,
- lambda_trans_matrix,
- struct obstack *);
-struct loop;
-bool perfect_nest_p (struct loop *);
-void print_lambda_loopnest (FILE *, lambda_loopnest, char);
-
-void print_lambda_loop (FILE *, lambda_loop, int, int, char);
-
-lambda_matrix lambda_matrix_new (int, int, struct obstack *);
-
-void lambda_matrix_id (lambda_matrix, int);
-bool lambda_matrix_id_p (lambda_matrix, int);
-void lambda_matrix_copy (lambda_matrix, lambda_matrix, int, int);
-void lambda_matrix_negate (lambda_matrix, lambda_matrix, int, int);
-void lambda_matrix_transpose (lambda_matrix, lambda_matrix, int, int);
-void lambda_matrix_add (lambda_matrix, lambda_matrix, lambda_matrix, int,
- int);
-void lambda_matrix_add_mc (lambda_matrix, int, lambda_matrix, int,
- lambda_matrix, int, int);
-void lambda_matrix_mult (lambda_matrix, lambda_matrix, lambda_matrix,
- int, int, int);
-void lambda_matrix_delete_rows (lambda_matrix, int, int, int);
-void lambda_matrix_row_exchange (lambda_matrix, int, int);
-void lambda_matrix_row_add (lambda_matrix, int, int, int, int);
-void lambda_matrix_row_negate (lambda_matrix mat, int, int);
-void lambda_matrix_row_mc (lambda_matrix, int, int, int);
-void lambda_matrix_col_exchange (lambda_matrix, int, int, int);
-void lambda_matrix_col_add (lambda_matrix, int, int, int, int);
-void lambda_matrix_col_negate (lambda_matrix, int, int);
-void lambda_matrix_col_mc (lambda_matrix, int, int, int);
-int lambda_matrix_inverse (lambda_matrix, lambda_matrix, int, struct obstack *);
-void lambda_matrix_hermite (lambda_matrix, int, lambda_matrix, lambda_matrix);
-void lambda_matrix_left_hermite (lambda_matrix, int, int, lambda_matrix, lambda_matrix);
-void lambda_matrix_right_hermite (lambda_matrix, int, int, lambda_matrix, lambda_matrix);
-int lambda_matrix_first_nz_vec (lambda_matrix, int, int, int);
-void lambda_matrix_project_to_null (lambda_matrix, int, int, int,
- lambda_vector);
-void print_lambda_matrix (FILE *, lambda_matrix, int, int);
-
-lambda_trans_matrix lambda_trans_matrix_new (int, int, struct obstack *);
-bool lambda_trans_matrix_nonsingular_p (lambda_trans_matrix);
-bool lambda_trans_matrix_fullrank_p (lambda_trans_matrix);
-int lambda_trans_matrix_rank (lambda_trans_matrix);
-lambda_trans_matrix lambda_trans_matrix_basis (lambda_trans_matrix);
-lambda_trans_matrix lambda_trans_matrix_padding (lambda_trans_matrix);
-lambda_trans_matrix lambda_trans_matrix_inverse (lambda_trans_matrix,
- struct obstack *);
-void print_lambda_trans_matrix (FILE *, lambda_trans_matrix);
-void lambda_matrix_vector_mult (lambda_matrix, int, int, lambda_vector,
- lambda_vector);
-bool lambda_trans_matrix_id_p (lambda_trans_matrix);
-
-lambda_body_vector lambda_body_vector_new (int, struct obstack *);
-lambda_body_vector lambda_body_vector_compute_new (lambda_trans_matrix,
- lambda_body_vector,
- struct obstack *);
-void print_lambda_body_vector (FILE *, lambda_body_vector);
-lambda_loopnest gcc_loopnest_to_lambda_loopnest (struct loop *,
- VEC(tree,heap) **,
- VEC(tree,heap) **,
- struct obstack *);
-void lambda_loopnest_to_gcc_loopnest (struct loop *,
- VEC(tree,heap) *, VEC(tree,heap) *,
- VEC(gimple,heap) **,
- lambda_loopnest, lambda_trans_matrix,
- struct obstack *);
-void remove_iv (gimple);
-tree find_induction_var_from_exit_cond (struct loop *);
-
-static inline void lambda_vector_negate (lambda_vector, lambda_vector, int);
-static inline void lambda_vector_mult_const (lambda_vector, lambda_vector, int, int);
-static inline void lambda_vector_add (lambda_vector, lambda_vector,
- lambda_vector, int);
-static inline void lambda_vector_add_mc (lambda_vector, int, lambda_vector, int,
- lambda_vector, int);
-static inline void lambda_vector_copy (lambda_vector, lambda_vector, int);
-static inline bool lambda_vector_zerop (lambda_vector, int);
-static inline void lambda_vector_clear (lambda_vector, int);
-static inline bool lambda_vector_equal (lambda_vector, lambda_vector, int);
-static inline int lambda_vector_min_nz (lambda_vector, int, int);
-static inline int lambda_vector_first_nz (lambda_vector, int, int);
-static inline void print_lambda_vector (FILE *, lambda_vector, int);
-
-/* Allocate a new vector of given SIZE. */
-
-static inline lambda_vector
-lambda_vector_new (int size)
-{
- return (lambda_vector) ggc_alloc_cleared_atomic (sizeof (int) * size);
-}
-
-
-
-/* Multiply vector VEC1 of length SIZE by a constant CONST1,
- and store the result in VEC2. */
-
-static inline void
-lambda_vector_mult_const (lambda_vector vec1, lambda_vector vec2,
- int size, int const1)
-{
- int i;
-
- if (const1 == 0)
- lambda_vector_clear (vec2, size);
- else
- for (i = 0; i < size; i++)
- vec2[i] = const1 * vec1[i];
-}
-
-/* Negate vector VEC1 with length SIZE and store it in VEC2. */
-
-static inline void
-lambda_vector_negate (lambda_vector vec1, lambda_vector vec2,
- int size)
-{
- lambda_vector_mult_const (vec1, vec2, size, -1);
-}
-
-/* VEC3 = VEC1+VEC2, where all three the vectors are of length SIZE. */
-
-static inline void
-lambda_vector_add (lambda_vector vec1, lambda_vector vec2,
- lambda_vector vec3, int size)
-{
- int i;
- for (i = 0; i < size; i++)
- vec3[i] = vec1[i] + vec2[i];
-}
-
-/* VEC3 = CONSTANT1*VEC1 + CONSTANT2*VEC2. All vectors have length SIZE. */
-
-static inline void
-lambda_vector_add_mc (lambda_vector vec1, int const1,
- lambda_vector vec2, int const2,
- lambda_vector vec3, int size)
-{
- int i;
- for (i = 0; i < size; i++)
- vec3[i] = const1 * vec1[i] + const2 * vec2[i];
-}
-
-/* Copy the elements of vector VEC1 with length SIZE to VEC2. */
-
-static inline void
-lambda_vector_copy (lambda_vector vec1, lambda_vector vec2,
- int size)
-{
- memcpy (vec2, vec1, size * sizeof (*vec1));
-}
-
-/* Return true if vector VEC1 of length SIZE is the zero vector. */
-
-static inline bool
-lambda_vector_zerop (lambda_vector vec1, int size)
-{
- int i;
- for (i = 0; i < size; i++)
- if (vec1[i] != 0)
- return false;
- return true;
-}
-
-/* Clear out vector VEC1 of length SIZE. */
-
-static inline void
-lambda_vector_clear (lambda_vector vec1, int size)
-{
- memset (vec1, 0, size * sizeof (*vec1));
-}
-
-/* Return true if two vectors are equal. */
-
-static inline bool
-lambda_vector_equal (lambda_vector vec1, lambda_vector vec2, int size)
-{
- int i;
- for (i = 0; i < size; i++)
- if (vec1[i] != vec2[i])
- return false;
- return true;
-}
-
-/* Return the minimum nonzero element in vector VEC1 between START and N.
- We must have START <= N. */
-
-static inline int
-lambda_vector_min_nz (lambda_vector vec1, int n, int start)
-{
- int j;
- int min = -1;
-
- gcc_assert (start <= n);
- for (j = start; j < n; j++)
- {
- if (vec1[j])
- if (min < 0 || vec1[j] < vec1[min])
- min = j;
- }
- gcc_assert (min >= 0);
-
- return min;
-}
-
-/* Return the first nonzero element of vector VEC1 between START and N.
- We must have START <= N. Returns N if VEC1 is the zero vector. */
-
-static inline int
-lambda_vector_first_nz (lambda_vector vec1, int n, int start)
-{
- int j = start;
- while (j < n && vec1[j] == 0)
- j++;
- return j;
-}
-
-
-/* Multiply a vector by a matrix. */
-
-static inline void
-lambda_vector_matrix_mult (lambda_vector vect, int m, lambda_matrix mat,
- int n, lambda_vector dest)
-{
- int i, j;
- lambda_vector_clear (dest, n);
- for (i = 0; i < n; i++)
- for (j = 0; j < m; j++)
- dest[i] += mat[j][i] * vect[j];
-}
-
-/* Compare two vectors returning an integer less than, equal to, or
- greater than zero if the first argument is considered to be respectively
- less than, equal to, or greater than the second.
- We use the lexicographic order. */
-
-static inline int
-lambda_vector_compare (lambda_vector vec1, int length1, lambda_vector vec2,
- int length2)
-{
- int min_length;
- int i;
-
- if (length1 < length2)
- min_length = length1;
- else
- min_length = length2;
-
- for (i = 0; i < min_length; i++)
- if (vec1[i] < vec2[i])
- return -1;
- else if (vec1[i] > vec2[i])
- return 1;
- else
- continue;
-
- return length1 - length2;
-}
-
-/* Print out a vector VEC of length N to OUTFILE. */
-
-static inline void
-print_lambda_vector (FILE * outfile, lambda_vector vector, int n)
-{
- int i;
-
- for (i = 0; i < n; i++)
- fprintf (outfile, "%3d ", vector[i]);
- fprintf (outfile, "\n");
-}
-
-/* Compute the greatest common divisor of two numbers using
- Euclid's algorithm. */
-
-static inline int
-gcd (int a, int b)
-{
- int x, y, z;
-
- x = abs (a);
- y = abs (b);
-
- while (x > 0)
- {
- z = y % x;
- y = x;
- x = z;
- }
-
- return y;
-}
-
-/* Compute the greatest common divisor of a VECTOR of SIZE numbers. */
-
-static inline int
-lambda_vector_gcd (lambda_vector vector, int size)
-{
- int i;
- int gcd1 = 0;
-
- if (size > 0)
- {
- gcd1 = vector[0];
- for (i = 1; i < size; i++)
- gcd1 = gcd (gcd1, vector[i]);
- }
- return gcd1;
-}
-
-/* Returns true when the vector V is lexicographically positive, in
- other words, when the first nonzero element is positive. */
-
-static inline bool
-lambda_vector_lexico_pos (lambda_vector v,
- unsigned n)
-{
- unsigned i;
- for (i = 0; i < n; i++)
- {
- if (v[i] == 0)
- continue;
- if (v[i] < 0)
- return false;
- if (v[i] > 0)
- return true;
- }
- return true;
-}
-
-/* Given a vector of induction variables IVS, and a vector of
- coefficients COEFS, build a tree that is a linear combination of
- the induction variables. */
-
-static inline tree
-build_linear_expr (tree type, lambda_vector coefs, VEC (tree, heap) *ivs)
-{
- unsigned i;
- tree iv;
- tree expr = build_zero_cst (type);
-
- for (i = 0; VEC_iterate (tree, ivs, i, iv); i++)
- {
- int k = coefs[i];
-
- if (k == 1)
- expr = fold_build2 (PLUS_EXPR, type, expr, iv);
-
- else if (k != 0)
- expr = fold_build2 (PLUS_EXPR, type, expr,
- fold_build2 (MULT_EXPR, type, iv,
- build_int_cst (type, k)));
- }
-
- return expr;
-}
-
-/* Returns the dependence level for a vector DIST of size LENGTH.
- LEVEL = 0 means a lexicographic dependence, i.e. a dependence due
- to the sequence of statements, not carried by any loop. */
-
-
-static inline unsigned
-dependence_level (lambda_vector dist_vect, int length)
-{
- int i;
-
- for (i = 0; i < length; i++)
- if (dist_vect[i] != 0)
- return i + 1;
-
- return 0;
-}
-
-#endif /* LAMBDA_H */
diff --git a/gcc/loop-init.c b/gcc/loop-init.c
index ce388b60136..bd4af30c5c5 100644
--- a/gcc/loop-init.c
+++ b/gcc/loop-init.c
@@ -123,14 +123,6 @@ loop_optimizer_finalize (void)
{
bb->loop_father = NULL;
}
-
- /* Checking. */
-#ifdef ENABLE_CHECKING
- /* FIXME: no point to verify flow info after bundling on ia64. Use this
- hack for achieving this. */
- if (!reload_completed)
- verify_flow_info ();
-#endif
}
@@ -235,7 +227,9 @@ struct rtl_opt_pass pass_rtl_loop_done =
0, /* properties_provided */
0, /* properties_destroyed */
0, /* todo_flags_start */
- TODO_dump_func | TODO_verify_rtl_sharing /* todo_flags_finish */
+ TODO_verify_flow
+ | TODO_verify_rtl_sharing
+ | TODO_dump_func /* todo_flags_finish */
}
};
diff --git a/gcc/loop-unroll.c b/gcc/loop-unroll.c
index 67d6ea0cf64..6deff4141a3 100644
--- a/gcc/loop-unroll.c
+++ b/gcc/loop-unroll.c
@@ -900,7 +900,7 @@ split_edge_and_insert (edge e, rtx insns)
CFG. For this purpose we used to set the BB_SUPERBLOCK flag on BB
and call break_superblocks when going out of cfglayout mode. But it
turns out that this never happens; and that if it does ever happen,
- the verify_flow_info call in loop_optimizer_finalize would fail.
+ the TODO_verify_flow at the end of the RTL loop passes would fail.
There are two reasons why we expected we could have control flow insns
in INSNS. The first is when a comparison has to be done in parts, and
diff --git a/gcc/lto-cgraph.c b/gcc/lto-cgraph.c
index 387e2b03e47..fb05a1d05cb 100644
--- a/gcc/lto-cgraph.c
+++ b/gcc/lto-cgraph.c
@@ -383,10 +383,6 @@ bool
reachable_from_this_partition_p (struct cgraph_node *node, cgraph_node_set set)
{
struct cgraph_edge *e;
- if (!node->analyzed)
- return false;
- if (node->global.inlined_to)
- return false;
for (e = node->callers; e; e = e->next_caller)
if (cgraph_node_in_set_p (e->caller, set))
return true;
@@ -503,6 +499,7 @@ lto_output_node (struct lto_simple_output_block *ob, struct cgraph_node *node,
bp_pack_value (&bp, node->local.finalized, 1);
bp_pack_value (&bp, node->local.inlinable, 1);
bp_pack_value (&bp, node->local.versionable, 1);
+ bp_pack_value (&bp, node->local.can_change_signature, 1);
bp_pack_value (&bp, node->local.disregard_inline_limits, 1);
bp_pack_value (&bp, node->local.redefined_extern_inline, 1);
bp_pack_value (&bp, node->local.vtable_method, 1);
@@ -954,6 +951,7 @@ input_overwrite_node (struct lto_file_decl_data *file_data,
node->local.finalized = bp_unpack_value (bp, 1);
node->local.inlinable = bp_unpack_value (bp, 1);
node->local.versionable = bp_unpack_value (bp, 1);
+ node->local.can_change_signature = bp_unpack_value (bp, 1);
node->local.disregard_inline_limits = bp_unpack_value (bp, 1);
node->local.redefined_extern_inline = bp_unpack_value (bp, 1);
node->local.vtable_method = bp_unpack_value (bp, 1);
diff --git a/gcc/lto-streamer-in.c b/gcc/lto-streamer-in.c
index ba48cbb3f60..058885d2252 100644
--- a/gcc/lto-streamer-in.c
+++ b/gcc/lto-streamer-in.c
@@ -1097,8 +1097,8 @@ input_bb (struct lto_input_block *ib, enum LTO_tags tag,
while (tag)
{
gimple stmt = input_gimple_stmt (ib, data_in, fn, tag);
-
- find_referenced_vars_in (stmt);
+ if (!is_gimple_debug (stmt))
+ find_referenced_vars_in (stmt);
gsi_insert_after (&bsi, stmt, GSI_NEW_STMT);
/* After the statement, expect a 0 delimiter or the EH region
@@ -1960,13 +1960,6 @@ lto_input_ts_decl_minimal_tree_pointers (struct lto_input_block *ib,
{
DECL_NAME (expr) = lto_input_tree (ib, data_in);
DECL_CONTEXT (expr) = lto_input_tree (ib, data_in);
- /* We do not stream BLOCK_VARS but lazily construct it here. */
- if (DECL_CONTEXT (expr)
- && TREE_CODE (DECL_CONTEXT (expr)) == BLOCK)
- {
- TREE_CHAIN (expr) = BLOCK_VARS (DECL_CONTEXT (expr));
- BLOCK_VARS (DECL_CONTEXT (expr)) = expr;
- }
DECL_SOURCE_LOCATION (expr) = lto_input_location (ib, data_in);
}
@@ -1982,7 +1975,8 @@ lto_input_ts_decl_common_tree_pointers (struct lto_input_block *ib,
DECL_SIZE (expr) = lto_input_tree (ib, data_in);
DECL_SIZE_UNIT (expr) = lto_input_tree (ib, data_in);
- if (TREE_CODE (expr) != FUNCTION_DECL)
+ if (TREE_CODE (expr) != FUNCTION_DECL
+ && TREE_CODE (expr) != TRANSLATION_UNIT_DECL)
DECL_INITIAL (expr) = lto_input_tree (ib, data_in);
DECL_ATTRIBUTES (expr) = lto_input_tree (ib, data_in);
@@ -2188,8 +2182,7 @@ lto_input_ts_block_tree_pointers (struct lto_input_block *ib,
unsigned i, len;
BLOCK_SOURCE_LOCATION (expr) = lto_input_location (ib, data_in);
- /* We do not stream BLOCK_VARS but lazily construct it when reading
- in decls. */
+ BLOCK_VARS (expr) = lto_input_chain (ib, data_in);
len = lto_input_uleb128 (ib);
if (len > 0)
@@ -2215,6 +2208,13 @@ lto_input_ts_block_tree_pointers (struct lto_input_block *ib,
BLOCK_CHAIN (expr) = BLOCK_SUBBLOCKS (BLOCK_SUPERCONTEXT (expr));
BLOCK_SUBBLOCKS (BLOCK_SUPERCONTEXT (expr)) = expr;
}
+ /* The global block is rooted at the TU decl. Hook it here to
+ avoid the need to stream in this block during WPA time. */
+ else if (BLOCK_SUPERCONTEXT (expr)
+ && TREE_CODE (BLOCK_SUPERCONTEXT (expr)) == TRANSLATION_UNIT_DECL)
+ DECL_INITIAL (BLOCK_SUPERCONTEXT (expr)) = expr;
+ /* The function-level block is connected at the time we read in
+ function bodies for the same reason. */
}
@@ -2432,6 +2432,8 @@ lto_register_var_decl_in_symtab (struct data_in *data_in, tree decl)
ASM_FORMAT_PRIVATE_NAME (label, name, DECL_UID (decl));
SET_DECL_ASSEMBLER_NAME (decl, get_identifier (label));
rest_of_decl_compilation (decl, 1, 0);
+
+ VEC_safe_push (tree, gc, lto_global_var_decls, decl);
}
/* If this variable has already been declared, queue the
diff --git a/gcc/lto-streamer-out.c b/gcc/lto-streamer-out.c
index e471d70bbcd..29d171bd7f4 100644
--- a/gcc/lto-streamer-out.c
+++ b/gcc/lto-streamer-out.c
@@ -849,7 +849,8 @@ lto_output_ts_decl_common_tree_pointers (struct output_block *ob, tree expr,
lto_output_tree_or_ref (ob, DECL_SIZE (expr), ref_p);
lto_output_tree_or_ref (ob, DECL_SIZE_UNIT (expr), ref_p);
- if (TREE_CODE (expr) != FUNCTION_DECL)
+ if (TREE_CODE (expr) != FUNCTION_DECL
+ && TREE_CODE (expr) != TRANSLATION_UNIT_DECL)
{
tree initial = DECL_INITIAL (expr);
if (TREE_CODE (expr) == VAR_DECL
@@ -1057,8 +1058,7 @@ lto_output_ts_block_tree_pointers (struct output_block *ob, tree expr,
tree t;
lto_output_location (ob, BLOCK_SOURCE_LOCATION (expr));
- /* We do not stream BLOCK_VARS but lazily construct it when reading
- in decls. */
+ lto_output_chain (ob, BLOCK_VARS (expr), ref_p);
output_uleb128 (ob, VEC_length (tree, BLOCK_NONLOCALIZED_VARS (expr)));
FOR_EACH_VEC_ELT (tree, BLOCK_NONLOCALIZED_VARS (expr), i, t)
@@ -2410,6 +2410,7 @@ write_symbol (struct lto_streamer_cache_d *cache,
int slot_num;
uint64_t size;
const char *comdat;
+ unsigned char c;
/* None of the following kinds of symbols are needed in the
symbol table. */
@@ -2505,8 +2506,10 @@ write_symbol (struct lto_streamer_cache_d *cache,
lto_output_data_stream (stream, name, strlen (name) + 1);
lto_output_data_stream (stream, comdat, strlen (comdat) + 1);
- lto_output_data_stream (stream, &kind, 1);
- lto_output_data_stream (stream, &visibility, 1);
+ c = (unsigned char) kind;
+ lto_output_data_stream (stream, &c, 1);
+ c = (unsigned char) visibility;
+ lto_output_data_stream (stream, &c, 1);
lto_output_data_stream (stream, &size, 8);
lto_output_data_stream (stream, &slot_num, 4);
}
diff --git a/gcc/lto-streamer.h b/gcc/lto-streamer.h
index b82c54ede1c..d8669a21529 100644
--- a/gcc/lto-streamer.h
+++ b/gcc/lto-streamer.h
@@ -914,6 +914,7 @@ extern void lto_symtab_merge_cgraph_nodes (void);
extern tree lto_symtab_prevailing_decl (tree decl);
extern enum ld_plugin_symbol_resolution lto_symtab_get_resolution (tree decl);
extern void lto_symtab_free (void);
+extern GTY(()) VEC(tree,gc) *lto_global_var_decls;
/* In lto-opts.c. */
diff --git a/gcc/lto-symtab.c b/gcc/lto-symtab.c
index b331d5cee61..75732768653 100644
--- a/gcc/lto-symtab.c
+++ b/gcc/lto-symtab.c
@@ -25,7 +25,6 @@ along with GCC; see the file COPYING3. If not see
#include "tree.h"
#include "gimple.h"
#include "ggc.h"
-#include "lambda.h" /* gcd */
#include "hashtab.h"
#include "plugin-api.h"
#include "lto-streamer.h"
diff --git a/gcc/lto-wrapper.c b/gcc/lto-wrapper.c
index 6f106a31f45..613c7b054df 100644
--- a/gcc/lto-wrapper.c
+++ b/gcc/lto-wrapper.c
@@ -392,6 +392,7 @@ run_gcc (unsigned argc, char *argv[])
if (linker_output)
{
char *output_dir, *base, *name;
+ bool bit_bucket = strcmp (linker_output, HOST_BIT_BUCKET) == 0;
output_dir = xstrdup (linker_output);
base = output_dir;
@@ -406,8 +407,11 @@ run_gcc (unsigned argc, char *argv[])
static char current_dir[] = { '.', DIR_SEPARATOR, '\0' };
output_dir = current_dir;
}
- *argv_ptr++ = "-dumpdir";
- *argv_ptr++ = output_dir;
+ if (!bit_bucket)
+ {
+ *argv_ptr++ = "-dumpdir";
+ *argv_ptr++ = output_dir;
+ }
*argv_ptr++ = "-dumpbase";
}
diff --git a/gcc/lto/ChangeLog b/gcc/lto/ChangeLog
index 4cb66feedad..b97da6f9a09 100644
--- a/gcc/lto/ChangeLog
+++ b/gcc/lto/ChangeLog
@@ -1,3 +1,25 @@
+2011-02-18 Jakub Jelinek <jakub@redhat.com>
+
+ PR bootstrap/47807
+ * Make-lang.in (lto/lto-lang.o): Depend on $(LTO_STREAMER_H) instead
+ of lto-streamer.h.
+
+2011-02-18 Richard Guenther <rguenther@suse.de>
+
+ PR lto/47798
+ * lto-tree.h (lto_global_var_decls): Do not declare here.
+ * lto-lang.c: Include lto-streamer.h.
+ * Make-lang.in (lto-lang.o): Adjust dependencies.
+
+2011-02-10 Kai Tietz <kai.tietz@onevision.com>
+
+ PR lto/47241
+ * lto.c (lto_read_section_data): Free
+ fd_name in failure case.
+ For mingw targets don't hash file-descriptor.
+ (read_cgraph_and_symbols): Close current_lto_file
+ in failure case.
+
2011-01-11 Jan Hubicka <jh@suse.cz>
PR lto/45721
diff --git a/gcc/lto/Make-lang.in b/gcc/lto/Make-lang.in
index 16b0f35e2ad..1c8618ded27 100644
--- a/gcc/lto/Make-lang.in
+++ b/gcc/lto/Make-lang.in
@@ -79,7 +79,7 @@ $(LTO_EXE): $(LTO_OBJS) $(BACKEND) $(LIBDEPS)
lto/lto-lang.o: lto/lto-lang.c $(CONFIG_H) coretypes.h debug.h \
flags.h $(GGC_H) langhooks.h $(LANGHOOKS_DEF_H) $(SYSTEM_H) \
$(TARGET_H) $(LTO_H) $(GIMPLE_H) gtype-lto.h gt-lto-lto-lang.h \
- $(EXPR_H)
+ $(EXPR_H) $(LTO_STREAMER_H)
lto/lto.o: lto/lto.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(OPTS_H) \
toplev.h $(TREE_H) $(DIAGNOSTIC_CORE_H) $(TM_H) \
$(CGRAPH_H) $(GGC_H) tree-ssa-operands.h $(TREE_PASS_H) \
diff --git a/gcc/lto/lto-lang.c b/gcc/lto/lto-lang.c
index 968073ba4ef..5f157d6de06 100644
--- a/gcc/lto/lto-lang.c
+++ b/gcc/lto/lto-lang.c
@@ -34,6 +34,7 @@ along with GCC; see the file COPYING3. If not see
#include "gimple.h"
#include "diagnostic-core.h"
#include "toplev.h"
+#include "lto-streamer.h"
static tree handle_noreturn_attribute (tree *, tree, tree, int, bool *);
static tree handle_leaf_attribute (tree *, tree, tree, int, bool *);
diff --git a/gcc/lto/lto-tree.h b/gcc/lto/lto-tree.h
index bc77750352d..d187fe20dd3 100644
--- a/gcc/lto/lto-tree.h
+++ b/gcc/lto/lto-tree.h
@@ -55,7 +55,4 @@ union GTY((desc ("lto_tree_node_structure (&%h)"),
desc ("tree_node_structure (&%h)"))) generic;
};
-/* Vector to keep track of external variables we've seen so far. */
-extern GTY(()) VEC(tree,gc) *lto_global_var_decls;
-
#endif /* GCC_LTO_TREE_H */
diff --git a/gcc/lto/lto.c b/gcc/lto/lto.c
index cbc192a6644..71c8cdb9658 100644
--- a/gcc/lto/lto.c
+++ b/gcc/lto/lto.c
@@ -590,10 +590,10 @@ lto_read_section_data (struct lto_file_decl_data *file_data,
}
if (fd == -1)
{
- fd_name = xstrdup (file_data->file_name);
fd = open (file_data->file_name, O_RDONLY|O_BINARY);
if (fd == -1)
return NULL;
+ fd_name = xstrdup (file_data->file_name);
}
#if LTO_MMAP_IO
@@ -619,9 +619,17 @@ lto_read_section_data (struct lto_file_decl_data *file_data,
|| read (fd, result, len) != (ssize_t) len)
{
free (result);
- return NULL;
+ result = NULL;
}
-
+#ifdef __MINGW32__
+ /* Native windows doesn't supports delayed unlink on opened file. So
+ we close file here again. This produces higher I/O load, but at least
+ it prevents to have dangling file handles preventing unlink. */
+ free (fd_name);
+ fd_name = NULL;
+ close (fd);
+ fd = -1;
+#endif
return result;
#endif
}
@@ -2147,7 +2155,11 @@ read_cgraph_and_symbols (unsigned nfiles, const char **fnames)
file_data = lto_file_read (current_lto_file, resolution, &count);
if (!file_data)
- break;
+ {
+ lto_obj_file_close (current_lto_file);
+ current_lto_file = NULL;
+ break;
+ }
decl_data[last_file_ix++] = file_data;
diff --git a/gcc/machmode.def b/gcc/machmode.def
index bb7ea99eadb..631015f7345 100644
--- a/gcc/machmode.def
+++ b/gcc/machmode.def
@@ -86,15 +86,19 @@ along with GCC; see the file COPYING3. If not see
using floating point format FORMAT.
All of the bits of its representation are significant.
- DECIMAL FLOAT_MODE (MODE, BYTESIZE);
- declares MODE to be of class DECIMAL_FLOAT and BYTESIZE bytes
- wide. All of the bits of its representation are significant.
-
FRACTIONAL_FLOAT_MODE (MODE, PRECISION, BYTESIZE, FORMAT);
declares MODE to be of class FLOAT, BYTESIZE bytes wide in
storage, but with only PRECISION significant bits, using
floating point format FORMAT.
+ DECIMAL_FLOAT_MODE (MODE, BYTESIZE, FORMAT);
+ declares MODE to be of class DECIMAL_FLOAT and BYTESIZE bytes
+ wide. All of the bits of its representation are significant.
+
+ FRACTIONAL_DECIMAL_FLOAT_MODE (MODE, BYTESIZE, FORMAT);
+ declares MODE to be of class DECIMAL_FLOAT and BYTESIZE bytes
+ wide. All of the bits of its representation are significant.
+
FRACT_MODE (MODE, BYTESIZE, FBIT);
declares MODE to be of class FRACT and BYTESIZE bytes wide
with FBIT fractional bits. There may be padding bits.
@@ -108,7 +112,7 @@ along with GCC; see the file COPYING3. If not see
with IBIT integral bits and FBIT fractional bits.
There may be padding bits.
- UACCUM_MODE (MODE, BYTESIZE, FBIT);
+ UACCUM_MODE (MODE, BYTESIZE, IBIT, FBIT);
declares MODE to be of class UACCUM and BYTESIZE bytes wide
with IBIT integral bits and FBIT fractional bits.
There may be padding bits.
diff --git a/gcc/modulo-sched.c b/gcc/modulo-sched.c
index 9179de504aa..2ae267c81a3 100644
--- a/gcc/modulo-sched.c
+++ b/gcc/modulo-sched.c
@@ -2897,9 +2897,11 @@ struct rtl_opt_pass pass_sms =
0, /* properties_provided */
0, /* properties_destroyed */
TODO_dump_func, /* todo_flags_start */
- TODO_df_finish | TODO_verify_rtl_sharing |
- TODO_dump_func |
- TODO_ggc_collect /* todo_flags_finish */
+ TODO_df_finish
+ | TODO_verify_flow
+ | TODO_verify_rtl_sharing
+ | TODO_dump_func
+ | TODO_ggc_collect /* todo_flags_finish */
}
};
diff --git a/gcc/objc/ChangeLog b/gcc/objc/ChangeLog
index 7b424391dd0..e5cff3f58ab 100644
--- a/gcc/objc/ChangeLog
+++ b/gcc/objc/ChangeLog
@@ -1,3 +1,163 @@
+2011-02-23 Nicola Pero <nicola.pero@meta-innovation.com>
+
+ * objc-act.c (build_private_template): Do not copy the
+ CLASS_HAS_EXCEPTION_ATTR from the class to the struct.
+ * objc-act.h (CLASS_HAS_EXCEPTION_ATTR): Define using
+ TYPE_LANG_SLOT_0.
+
+2011-02-22 Nicola Pero <nicola.pero@meta-innovation.com>
+
+ PR objc/47832
+ * objc-act.c (flexible_array_type_p): New.
+ (add_instance_variable): Produce an error if an instance variable
+ uses flexible array members.
+ (encode_array): Do not emit an error if encoding a flexible array
+ type while generating instance variables.
+
+2011-02-21 Mike Stump <mikestump@comcast.net>
+
+ * Make-lang.in (check_objc_parallelize): Refine for 4 processor machines.
+
+2011-02-20 Nicola Pero <nicola.pero@meta-innovation.com>
+
+ * objc-gnu-runtime-abi-01.c (TARGET_64BIT): Removed. Removed
+ usage of padding fields. Do not include tm.h.
+ * objc-act.c (objc_write_global_declaration): Set input_location
+ to BUILTINS_LOCATION while generating runtime metadata.
+
+2011-01-20 Nicola Pero <nicola.pero@meta-innovation.com>
+
+ PR objc/47784
+ * objc-act.c (objc_maybe_build_modify_expr): If 'rhs' has side
+ effects, do not use a temporary variable.
+
+2011-01-19 Nicola Pero <nicola.pero@meta-innovation.com>
+
+ * objc-next-runtime-abi-01.c: Updated comments.
+ * objc-next-runtime-abi-02.c: Same.
+
+2011-01-19 Nicola Pero <nicola.pero@meta-innovation.com>
+
+ * objc-act.c (objc_init, generate_struct_by_value_array): Updated
+ comments.
+
+2011-01-19 Nicola Pero <nicola.pero@meta-innovation.com>
+
+ * objc-act.c: Updated comments.
+ * objc-next-runtime-abi-02.c: Same.
+ * objc-runtime-shared-support.c: Same.
+ * objc-runtime-hooks.h: Same.
+ * objc-act.h: Same.
+ * objc-gnu-runtime-abi-01.c: Same.
+
+2011-01-19 Nicola Pero <nicola.pero@meta-innovation.com>
+
+ * objc-gnu-runtime-abi-01.c (objc_generate_v1_gnu_metadata): Do
+ not generate metadata if there is nothing to put into it.
+
+2011-02-17 Iain Sandoe <iains@gcc.gnu.org>
+
+ * config-lang.in (gtfiles): Updated.
+ * Make-lang.in (START_HDRS): New.
+ (OBJC_OBJS): Added new object files.
+ (objc/objc-act.o): Updated prerequisites.
+ (objc/objc-lang.o): Updated prerequisites.
+ (objc/objc-runtime-shared-support.o): New.
+ (objc/objc-gnu-runtime-abi-01.o): New.
+ (objc/objc-next-runtime-abi-01.o): New.
+ (objc/objc-next-runtime-abi-02.o): New.
+ * objc-runtime-hooks.h: New.
+ * objc-runtime-shared-support.h: New.
+ * objc-runtime-shared-support.c: New.
+ * objc-gnu-runtime-abi-01.c: New.
+ * objc-next-metadata-tags.h: New.
+ * objc-next-runtime-abi-01.c: New.
+ * objc-next-runtime-abi-02.c: New.
+ * objc-lang.c: Include c-lang.h.
+ (LANG_HOOKS_EH_PERSONALITY): Removed.
+ * objc-act.h: Moved many declarations and code from objc-act.c
+ into objc-act.h to make them available outside objc-act.c.
+ (objc_eh_runtime_type): Removed.
+ (objc_eh_personality): Removed.
+ (CLASS_HAS_EXCEPTION_ATTR): New.
+ (OCTI_SUPER_SUPERFIELD_ID): New.
+ (OCTI_V1_PROP_LIST_TEMPL): New.
+ (OCTI_V1_PROP_NAME_ATTR_CHAIN): New.
+ (super_superclassfield_id): New.
+ (objc_prop_list_ptr): New.
+ (prop_names_attr_chain): New.
+ * objc-act.c: Include new runtime headers. Moved many #defines
+ and declarations into objc-act.h and
+ objc-runtime-shared-support.h. Made some corresponding functions
+ non-static, and moved some others into
+ objc-runtime-shared-support.c. Moved metadata generation code
+ into the new runtime hook files.
+ (ivar_offset_hash_list): New.
+ (objc_init): Call generate_struct_value_by_array() before doing
+ any runtime initialization. Create the appropriate runtime hook
+ structures.
+ (init_objc): Removed. Code moved directly into objc_init.
+ (finish_objc): Removed. Code moved directly into
+ objc_write_global_declarations.
+ (objc_write_global_declarations): Do the warn_selector checks
+ before emitting metadata. Use a runtime hook to emit the
+ metadata. Do not emit the metadata or do -gen-decls processing if
+ -fsyntax-only or we are producing a PCH.
+ (build_objc_exception_stuff): Renamed to
+ build_common_objc_exception_stuff. Remove TREE_NOTHROW flag from
+ objc_exception_throw_decl.
+ (synth_module_prologue): Call runtime initialize hook instead of
+ building runtime declarations here. Use the
+ default_constant_string_class_name runtime hook to set the
+ constant string class name.
+ (objc_build_string_object): Call the setup_const_string_class_decl
+ runtime hook instead of setup_string_decl. Call the
+ build_const_string_constructor runtime hook instead of building
+ the string object here.
+ (get_objc_string_decl): Added prop_names_attr case. Removed
+ gcc_unreachable() at the end.
+ (objc_begin_catch_clause): Distinguish between @catch (...) and
+ @catch (id x). Call the begin_catch runtime hook instead of
+ building the CATCH_EXPR here.
+ (objc_finish_catch_clause): Call the finish_catch runtime hook
+ instead of adding the catch here.
+ (objc_finish_try_stmt): Call the finish_try_stmt runtime hook
+ instead of doing it here.
+ (objc_build_throw_stmt): Bail out early for error_mark_node. Call
+ the build_exc_ptr runtime hook instead of objc_build_exc_ptr.
+ Call the build_throw_stmt runtime hook instead of building the
+ throw call here.
+ (objc_generate_cxx_cdtors): Set has_cxx_cdtors for the GNU runtime
+ as well.
+ (get_arg_type_list): Call the get_arg_type_list_base runtime hook
+ instead of building the list of arguments here.
+ (receiver_is_class_object): Call the receiver_is_class_object
+ runtime hook instead of doing the check here. Call the
+ tag_getclass runtime hook instead of using TAG_GETCLASS.
+ (objc_finish_message_expr): Call the build_objc_method_call
+ runtime hook.
+ (objc_build_protocol_expr): Call the get_protocol_reference
+ runtime hook.
+ (objc_build_selector_expr): Call the build_selector_reference
+ runtime hook.
+ (build_ivar_reference): Call the build_ivar_reference runtime
+ hook.
+ (hash_init): Set up ivar_offset_hash_list.
+ (start_class): Recognize the objc_exception attribute and store
+ it.
+ (continue_class): Use the class_decl and metaclass_decl runtime
+ hooks.
+ (build_objc_property_accessor_helpers): Renamed to
+ build_common_objc_property_accessor_helpers. Do not build
+ objc_copyStruct_decl, objc_getPropertyStruct_decl and
+ objc_setPropertyStruct_decl.
+ (objc_synthesize_getter): Check what struct setter/getter helper
+ is available instead of checking the type of runtime.
+ (get_super_receiver): Use the super_superclassfield_ident runtime
+ hook. Added assert. Use the get_class_super_ref and
+ get_category_super_ref runtime hooks.
+ (objc_v2_encode_prop_attr): New.
+
2011-01-17 Nicola Pero <nicola.pero@meta-innovation.com>
PR objc/47314
diff --git a/gcc/objc/Make-lang.in b/gcc/objc/Make-lang.in
index c4797690e24..6544bcc3e5b 100644
--- a/gcc/objc/Make-lang.in
+++ b/gcc/objc/Make-lang.in
@@ -1,6 +1,6 @@
# Top level -*- makefile -*- fragment for GNU Objective-C
# Copyright (C) 1997, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2007,
-# 2008, 2009, 2010 Free Software Foundation, Inc.
+# 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
#This file is part of GCC.
@@ -43,11 +43,18 @@ objc: cc1obj$(exeext)
# Tell GNU make to ignore these if they exist.
.PHONY: objc
+START_HDRS = $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) $(C_TREE_H) \
+ c-lang.h langhooks.h c-family/c-objc.h objc/objc-act.h
+
# Use maximal warnings for this front end.
objc-warn = $(STRICT_WARN)
# Language-specific object files for Objective C.
-OBJC_OBJS = objc/objc-lang.o objc/objc-act.o
+OBJC_OBJS = objc/objc-lang.o objc/objc-act.o \
+ objc/objc-runtime-shared-support.o \
+ objc/objc-gnu-runtime-abi-01.o \
+ objc/objc-next-runtime-abi-01.o \
+ objc/objc-next-runtime-abi-02.o \
objc_OBJS = $(OBJC_OBJS) cc1obj-checksum.o
@@ -66,17 +73,32 @@ cc1obj$(exeext): $(OBJC_OBJS) $(C_AND_OBJC_OBJS) cc1obj-checksum.o $(BACKEND) $(
# Objective C language specific files.
-objc/objc-lang.o : objc/objc-lang.c \
- $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) $(C_TREE_H) \
- $(GGC_H) langhooks.h $(LANGHOOKS_DEF_H) $(C_COMMON_H) gtype-objc.h \
- c-objc-common.h c-family/c-objc.h objc/objc-act.h
+objc/objc-lang.o : objc/objc-lang.c $(START_HDRS) \
+ $(GGC_H) $(LANGHOOKS_DEF_H) $(C_COMMON_H) gtype-objc.h \
+ c-objc-common.h
+
+objc/objc-runtime-shared-support.o : objc/objc-runtime-shared-support.c \
+ $(START_HDRS) objc/objc-runtime-shared-support.h $(OBSTACK_H) \
+ objc/objc-next-metadata-tags.h gt-objc-objc-runtime-shared-support.h
+
+objc/objc-gnu-runtime-abi-01.o: objc/objc-gnu-runtime-abi-01.c $(START_HDRS) \
+ objc/objc-runtime-hooks.h $(GGC_H) \
+ objc/objc-runtime-shared-support.h gt-objc-objc-gnu-runtime-abi-01.h toplev.h
+
+objc/objc-next-runtime-abi-01.o: objc/objc-next-runtime-abi-01.c $(START_HDRS) \
+ $(GGC_H) objc/objc-runtime-hooks.h \
+ objc/objc-next-metadata-tags.h gt-objc-objc-next-runtime-abi-01.h output.h \
+ objc/objc-runtime-shared-support.h $(TARGET_H)
+
+objc/objc-next-runtime-abi-02.o: objc/objc-next-runtime-abi-02.c $(START_HDRS) \
+ $(GGC_H) objc/objc-runtime-hooks.h \
+ objc/objc-next-metadata-tags.h gt-objc-objc-next-runtime-abi-02.h $(TARGET_H) \
+ objc/objc-runtime-shared-support.h $(OBSTACK_H)
-objc/objc-act.o : objc/objc-act.c \
- $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
- $(TARGET_H) $(C_TREE_H) $(DIAGNOSTIC_CORE_H) toplev.h $(FLAGS_H) \
- objc/objc-act.h input.h $(FUNCTION_H) output.h debug.h langhooks.h \
- $(LANGHOOKS_DEF_H) $(HASHTAB_H) $(C_PRAGMA_H) gt-objc-objc-act.h \
- $(GIMPLE_H) c-lang.h c-family/c-objc.h
+objc/objc-act.o : objc/objc-act.c $(START_HDRS) $(GGC_H) \
+ $(DIAGNOSTIC_CORE_H) toplev.h $(FLAGS_H) input.h $(FUNCTION_H) output.h debug.h \
+ $(LANGHOOKS_DEF_H) $(HASHTAB_H) $(C_PRAGMA_H) gt-objc-objc-act.h $(OBSTACK_H) \
+ $(GIMPLE_H) objc/objc-runtime-shared-support.h objc/objc-runtime-hooks.h
objc.srcextra:
@@ -106,9 +128,8 @@ lang_checks += check-objc
# The following allows you to do 'make check-objc -j2'. The
# execute.exp tests will be run in parallel with all the other ones.
-# This is tuned for '-j2'.
lang_checks_parallelized += check-objc
-check_objc_parallelize = execute.exp
+check_objc_parallelize = gnu-encoding.exp execute.exp exceptions.exp
#
# Install hooks:
diff --git a/gcc/objc/config-lang.in b/gcc/objc/config-lang.in
index 9ae6d6c518b..db5c5a59ec5 100644
--- a/gcc/objc/config-lang.in
+++ b/gcc/objc/config-lang.in
@@ -1,6 +1,6 @@
# Top level configure fragment for GNU Objective-C
-# Copyright (C) 1997, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2010
-# Free Software Foundation, Inc.
+# Copyright (C) 1997, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2010,
+# 2011 Free Software Foundation, Inc.
#This file is part of GCC.
@@ -33,4 +33,4 @@ target_libs=target-libobjc
# Most of the object files for cc1obj actually come from C.
lang_requires="c"
-gtfiles="\$(srcdir)/objc/objc-act.h \$(srcdir)/c-parser.c \$(srcdir)/c-tree.h \$(srcdir)/c-decl.c \$(srcdir)/c-objc-common.c \$(srcdir)/c-family/c-common.c \$(srcdir)/c-family/c-common.h \$(srcdir)/c-family/c-objc.h \$(srcdir)/c-family/c-cppbuiltin.c \$(srcdir)/c-family/c-pragma.h \$(srcdir)/c-family/c-pragma.c \$(srcdir)/objc/objc-act.c"
+gtfiles="\$(srcdir)/objc/objc-act.h \$(srcdir)/objc/objc-act.c \$(srcdir)/objc/objc-runtime-shared-support.c \$(srcdir)/objc/objc-gnu-runtime-abi-01.c \$(srcdir)/objc/objc-next-runtime-abi-01.c \$(srcdir)/objc/objc-next-runtime-abi-02.c \$(srcdir)/c-parser.c \$(srcdir)/c-tree.h \$(srcdir)/c-decl.c \$(srcdir)/c-lang.h \$(srcdir)/c-objc-common.c \$(srcdir)/c-family/c-common.c \$(srcdir)/c-family/c-common.h \$(srcdir)/c-family/c-objc.h \$(srcdir)/c-family/c-cppbuiltin.c \$(srcdir)/c-family/c-pragma.h \$(srcdir)/c-family/c-pragma.c"
diff --git a/gcc/objc/objc-act.c b/gcc/objc/objc-act.c
index 33d39b222f4..049dc00dba1 100644
--- a/gcc/objc/objc-act.c
+++ b/gcc/objc/objc-act.c
@@ -1,6 +1,6 @@
/* Implement classes and message passing for Objective C.
Copyright (C) 1992, 1993, 1994, 1995, 1997, 1998, 1999, 2000, 2001,
- 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010
+ 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010, 2011
Free Software Foundation, Inc.
Contributed by Steve Naroff.
@@ -53,15 +53,17 @@ along with GCC; see the file COPYING3. If not see
#include "tree-iterator.h"
#include "hashtab.h"
#include "langhooks-def.h"
-
+/* Different initialization, code gen and meta data generation for each
+ runtime. */
+#include "objc-runtime-hooks.h"
+/* Routines used mainly by the runtimes. */
+#include "objc-runtime-shared-support.h"
/* For default_tree_printer (). */
#include "tree-pretty-print.h"
/* For enum gimplify_status */
#include "gimple.h"
-#define OBJC_VOID_AT_END void_list_node
-
static unsigned int should_call_super_dealloc = 0;
/* When building Objective-C++, we are not linking against the C front-end
@@ -102,53 +104,30 @@ static unsigned int should_call_super_dealloc = 0;
#ifndef OBJC_FORWARDING_MIN_OFFSET
#define OBJC_FORWARDING_MIN_OFFSET 0
#endif
-
+
/* Set up for use of obstacks. */
#include "obstack.h"
/* This obstack is used to accumulate the encoding of a data type. */
-static struct obstack util_obstack;
+struct obstack util_obstack;
/* This points to the beginning of obstack contents, so we can free
the whole contents. */
char *util_firstobj;
-/* The version identifies which language generation and runtime
- the module (file) was compiled for, and is recorded in the
- module descriptor. */
-
-#define OBJC_VERSION (flag_next_runtime ? 6 : 8)
-#define PROTOCOL_VERSION 2
-
-/* (Decide if these can ever be validly changed.) */
-#define OBJC_ENCODE_INLINE_DEFS 0
-#define OBJC_ENCODE_DONT_INLINE_DEFS 1
-
/*** Private Interface (procedures) ***/
-/* Used by compile_file. */
-
-static void init_objc (void);
-static void finish_objc (void);
+/* Init stuff. */
+static void synth_module_prologue (void);
/* Code generation. */
-static tree objc_build_constructor (tree, VEC(constructor_elt,gc) *);
-static tree build_objc_method_call (location_t, int, tree, tree, tree, tree);
-static tree get_proto_encoding (tree);
-static tree lookup_interface (tree);
-static tree objc_add_static_instance (tree, tree);
-
static tree start_class (enum tree_code, tree, tree, tree, tree);
static tree continue_class (tree);
static void finish_class (tree);
static void start_method_def (tree);
-#ifdef OBJCPLUS
-static void objc_start_function (tree, tree, tree, tree);
-#else
-static void objc_start_function (tree, tree, tree, struct c_arg_info *);
-#endif
+
static tree start_protocol (enum tree_code, tree, tree, tree);
static tree build_method_decl (enum tree_code, tree, tree, tree, bool);
static tree objc_add_method (tree, tree, int, bool);
@@ -156,9 +135,6 @@ static tree add_instance_variable (tree, objc_ivar_visibility_kind, tree);
static tree build_ivar_reference (tree);
static tree is_ivar (tree, tree);
-static void build_objc_exception_stuff (void);
-static void build_next_objc_exception_stuff (void);
-
/* We only need the following for ObjC; ObjC++ will use C++'s definition
of DERIVED_FROM_P. */
#ifndef OBJCPLUS
@@ -175,18 +151,11 @@ static int match_proto_with_proto (tree, tree, int);
static tree lookup_property (tree, tree);
static tree lookup_property_in_list (tree, tree);
static tree lookup_property_in_protocol_list (tree, tree);
-static void build_objc_property_accessor_helpers (void);
+static void build_common_objc_property_accessor_helpers (void);
static void objc_xref_basetypes (tree, tree);
-static void build_class_template (void);
-static void build_selector_template (void);
-static void build_category_template (void);
-static void build_super_template (void);
-static tree build_protocol_initializer (tree, tree, tree, tree, tree);
static tree get_class_ivars (tree, bool);
-static tree generate_protocol_list (tree);
-static void build_protocol_reference (tree);
static void build_fast_enumeration_state_template (void);
@@ -197,9 +166,9 @@ static void objc_generate_cxx_cdtors (void);
/* objc attribute */
static void objc_decl_method_attributes (tree*, tree, int);
static tree build_keyword_selector (tree);
-static const char *synth_id_with_class_suffix (const char *, tree);
/* Hash tables to manage the global pool of method prototypes. */
+static void hash_init (void);
hash *nst_method_hash_list = 0;
hash *cls_method_hash_list = 0;
@@ -209,6 +178,8 @@ hash *cls_method_hash_list = 0;
hash *cls_name_hash_list = 0;
hash *als_name_hash_list = 0;
+hash *ivar_offset_hash_list = 0;
+
static void hash_class_name_enter (hash *, tree, tree);
static hash hash_class_name_lookup (hash *, tree);
@@ -220,16 +191,6 @@ static tree add_class (tree, tree);
static void add_category (tree, tree);
static inline tree lookup_category (tree, tree);
-enum string_section
-{
- class_names, /* class, category, protocol, module names */
- meth_var_names, /* method and variable names */
- meth_var_types /* method and variable type descriptors */
-};
-
-static tree add_objc_string (tree, enum string_section);
-static void build_selector_table_decl (void);
-
/* Protocols. */
static tree lookup_protocol (tree, bool, bool);
@@ -239,7 +200,6 @@ static tree lookup_and_install_protocols (tree, bool);
static void encode_type_qualifiers (tree);
static void encode_type (tree, int, int);
-static void encode_field_decl (tree, int, int);
#ifdef OBJCPLUS
static void really_start_method (tree, tree);
@@ -247,14 +207,7 @@ static void really_start_method (tree, tree);
static void really_start_method (tree, struct c_arg_info *);
#endif
static int comp_proto_with_proto (tree, tree, int);
-static tree get_arg_type_list (tree, int, int);
static tree objc_decay_parm_type (tree);
-static void objc_push_parm (tree);
-#ifdef OBJCPLUS
-static tree objc_get_parm_info (int);
-#else
-static struct c_arg_info *objc_get_parm_info (int);
-#endif
/* Utilities for debugging and error diagnostics. */
@@ -265,113 +218,13 @@ static char *gen_declaration (tree);
/* Everything else. */
-static tree create_field_decl (tree, const char *);
-static void add_class_reference (tree);
-static void build_protocol_template (void);
-static tree encode_method_prototype (tree);
-static void generate_classref_translation_entry (tree);
-static void handle_class_ref (tree);
-static void generate_struct_by_value_array (void)
- ATTRIBUTE_NORETURN;
+static void generate_struct_by_value_array (void) ATTRIBUTE_NORETURN;
+
static void mark_referenced_methods (void);
-static void generate_objc_image_info (void);
static bool objc_type_valid_for_messaging (tree type, bool allow_classes);
+static tree check_duplicates (hash, int, int);
/*** Private Interface (data) ***/
-
-/* Reserved tag definitions. */
-
-#define OBJECT_TYPEDEF_NAME "id"
-#define CLASS_TYPEDEF_NAME "Class"
-
-#define TAG_OBJECT "objc_object"
-#define TAG_CLASS "objc_class"
-#define TAG_SUPER "objc_super"
-#define TAG_SELECTOR "objc_selector"
-
-#define UTAG_CLASS "_objc_class"
-#define UTAG_IVAR "_objc_ivar"
-#define UTAG_IVAR_LIST "_objc_ivar_list"
-#define UTAG_METHOD "_objc_method"
-#define UTAG_METHOD_LIST "_objc_method_list"
-#define UTAG_CATEGORY "_objc_category"
-#define UTAG_MODULE "_objc_module"
-#define UTAG_SYMTAB "_objc_symtab"
-#define UTAG_SUPER "_objc_super"
-#define UTAG_SELECTOR "_objc_selector"
-
-#define UTAG_PROTOCOL "_objc_protocol"
-#define UTAG_METHOD_PROTOTYPE "_objc_method_prototype"
-#define UTAG_METHOD_PROTOTYPE_LIST "_objc__method_prototype_list"
-
-/* Note that the string object global name is only needed for the
- NeXT runtime. */
-#define STRING_OBJECT_GLOBAL_FORMAT "_%sClassReference"
-
-#define PROTOCOL_OBJECT_CLASS_NAME "Protocol"
-
-#define TAG_ENUMERATION_MUTATION "objc_enumerationMutation"
-#define TAG_FAST_ENUMERATION_STATE "__objcFastEnumerationState"
-
-static const char *TAG_GETCLASS;
-static const char *TAG_GETMETACLASS;
-static const char *TAG_MSGSEND;
-static const char *TAG_MSGSENDSUPER;
-/* The NeXT Objective-C messenger may have two extra entry points, for use
- when returning a structure. */
-static const char *TAG_MSGSEND_STRET;
-static const char *TAG_MSGSENDSUPER_STRET;
-static const char *default_constant_string_class_name;
-
-/* Runtime metadata flags. */
-#define CLS_FACTORY 0x0001L
-#define CLS_META 0x0002L
-#define CLS_HAS_CXX_STRUCTORS 0x2000L
-
-#define OBJC_MODIFIER_STATIC 0x00000001
-#define OBJC_MODIFIER_FINAL 0x00000002
-#define OBJC_MODIFIER_PUBLIC 0x00000004
-#define OBJC_MODIFIER_PRIVATE 0x00000008
-#define OBJC_MODIFIER_PROTECTED 0x00000010
-#define OBJC_MODIFIER_NATIVE 0x00000020
-#define OBJC_MODIFIER_SYNCHRONIZED 0x00000040
-#define OBJC_MODIFIER_ABSTRACT 0x00000080
-#define OBJC_MODIFIER_VOLATILE 0x00000100
-#define OBJC_MODIFIER_TRANSIENT 0x00000200
-#define OBJC_MODIFIER_NONE_SPECIFIED 0x80000000
-
-/* NeXT-specific tags. */
-
-#define TAG_MSGSEND_NONNIL "objc_msgSendNonNil"
-#define TAG_MSGSEND_NONNIL_STRET "objc_msgSendNonNil_stret"
-#define TAG_EXCEPTIONEXTRACT "objc_exception_extract"
-#define TAG_EXCEPTIONTRYENTER "objc_exception_try_enter"
-#define TAG_EXCEPTIONTRYEXIT "objc_exception_try_exit"
-#define TAG_EXCEPTIONMATCH "objc_exception_match"
-#define TAG_EXCEPTIONTHROW "objc_exception_throw"
-#define TAG_SYNCENTER "objc_sync_enter"
-#define TAG_SYNCEXIT "objc_sync_exit"
-#define TAG_SETJMP "_setjmp"
-#define UTAG_EXCDATA "_objc_exception_data"
-
-#define TAG_ASSIGNIVAR "objc_assign_ivar"
-#define TAG_ASSIGNGLOBAL "objc_assign_global"
-#define TAG_ASSIGNSTRONGCAST "objc_assign_strongCast"
-
-/* Branch entry points. All that matters here are the addresses;
- functions with these names do not really exist in libobjc. */
-
-#define TAG_MSGSEND_FAST "objc_msgSend_Fast"
-#define TAG_ASSIGNIVAR_FAST "objc_assign_ivar_Fast"
-
-#define TAG_CXX_CONSTRUCT ".cxx_construct"
-#define TAG_CXX_DESTRUCT ".cxx_destruct"
-
-/* GNU-specific tags. */
-
-#define TAG_EXECCLASS "__objc_exec_class"
-#define TAG_GNUINIT "__objc_gnu_init"
-
/* Flags for lookup_method_static(). */
/* Look for class methods. */
@@ -385,8 +238,6 @@ static const char *default_constant_string_class_name;
/* The OCTI_... enumeration itself is in objc/objc-act.h. */
tree objc_global_trees[OCTI_MAX];
-static void handle_impent (struct imp_entry *);
-
struct imp_entry *imp_list = 0;
int imp_count = 0; /* `@implementation' */
int cat_count = 0; /* `@category' */
@@ -408,17 +259,12 @@ static int objc_collecting_ivars = 0;
@interface, or in a class extension. */
static bool objc_in_class_extension = false;
-#define BUFSIZE 1024
-
static char *errbuf; /* Buffer for error diagnostics */
/* An array of all the local variables in the current function that
need to be marked as volatile. */
VEC(tree,gc) *local_variables_to_volatilize = NULL;
-
-static int flag_typed_selectors;
-
/* Store all constructed constant strings in a hash table so that
they get uniqued properly. */
@@ -439,59 +285,16 @@ FILE *gen_declaration_file;
Type descriptors for instance variables contain more information
than methods (for static typing and embedded structures). */
-static int generating_instance_variables = 0;
-
-/* For building an objc struct. These may not be used when this file
- is compiled as part of obj-c++. */
-
-static bool objc_building_struct;
-static struct c_struct_parse_info *objc_struct_info ATTRIBUTE_UNUSED;
-
-/* Start building a struct for objc. */
-
-static tree
-objc_start_struct (tree name)
-{
- gcc_assert (!objc_building_struct);
- objc_building_struct = true;
- return start_struct (input_location, RECORD_TYPE, name, &objc_struct_info);
-}
+int generating_instance_variables = 0;
-/* Finish building a struct for objc. */
-
-static tree
-objc_finish_struct (tree type, tree fieldlist)
-{
- gcc_assert (objc_building_struct);
- objc_building_struct = false;
- return finish_struct (input_location, type, fieldlist, NULL_TREE,
- objc_struct_info);
-}
-
-static tree
-build_sized_array_type (tree base_type, int size)
-{
- tree index_type = build_index_type (build_int_cst (NULL_TREE, size - 1));
- return build_array_type (base_type, index_type);
-}
-
-static tree
-add_field_decl (tree type, const char *name, tree **chain)
-{
- tree field = create_field_decl (type, name);
-
- if (*chain != NULL)
- **chain = field;
- *chain = &DECL_CHAIN (field);
-
- return field;
-}
+/* Hooks for stuff that differs between runtimes. */
+objc_runtime_hooks runtime;
/* Create a temporary variable of type 'type'. If 'name' is set, uses
the specified name, else use no name. Returns the declaration of
the type. The 'name' is mostly useful for debugging.
*/
-static tree
+tree
objc_create_temporary_var (tree type, const char *name)
{
tree decl;
@@ -528,6 +331,8 @@ generate_struct_by_value_array (void)
int found = 0;
/* Presumably no platform passes 32 byte structures in a register. */
+ /* ??? As an example, m64/ppc/Darwin can pass up to 8*long+13*double
+ in registers. */
for (i = 1; i < 32; i++)
{
char buffer[5];
@@ -567,6 +372,7 @@ generate_struct_by_value_array (void)
bool
objc_init (void)
{
+ bool ok;
#ifdef OBJCPLUS
if (cxx_init () == false)
#else
@@ -574,54 +380,46 @@ objc_init (void)
#endif
return false;
- /* If gen_declaration desired, open the output file. */
- if (flag_gen_declaration)
- {
- register char * const dumpname = concat (dump_base_name, ".decl", NULL);
- gen_declaration_file = fopen (dumpname, "w");
- if (gen_declaration_file == 0)
- fatal_error ("can%'t open %s: %m", dumpname);
- free (dumpname);
- }
+ /* print_struct_values is triggered by -print-runtime-info (used
+ when building libobjc, with an empty file as input). It does not
+ require any ObjC setup, and it never returns.
+
+ -fcompare-debug is used to check the compiler output; we are
+ executed twice, once with flag_compare_debug set, and once with
+ it not set. If the flag is used together with
+ -print-runtime-info, we want to print the runtime info only once,
+ else it would be output in duplicate. So we check
+ flag_compare_debug to output it in only one of the invocations.
+
+ As a side effect, this also that means -fcompare-debug
+ -print-runtime-info will run the compiler twice, and compare the
+ generated assembler file; the first time the compiler exits
+ immediately (producing no file), and the second time it compiles
+ an empty file. This checks, as a side effect, that compiling an
+ empty file produces no assembler output. */
+ if (print_struct_values && !flag_compare_debug)
+ generate_struct_by_value_array ();
- if (flag_next_runtime)
- {
- TAG_GETCLASS = "objc_getClass";
- TAG_GETMETACLASS = "objc_getMetaClass";
- TAG_MSGSEND = "objc_msgSend";
- TAG_MSGSENDSUPER = "objc_msgSendSuper";
- TAG_MSGSEND_STRET = "objc_msgSend_stret";
- TAG_MSGSENDSUPER_STRET = "objc_msgSendSuper_stret";
- default_constant_string_class_name = "NSConstantString";
- }
- else
- {
- TAG_GETCLASS = "objc_get_class";
- TAG_GETMETACLASS = "objc_get_meta_class";
- TAG_MSGSEND = "objc_msg_lookup";
- TAG_MSGSENDSUPER = "objc_msg_lookup_super";
- /* GNU runtime does not provide special functions to support
- structure-returning methods. */
- default_constant_string_class_name = "NXConstantString";
- flag_typed_selectors = 1;
- /* GNU runtime does not need the compiler to change code
- in order to do GC. */
- if (flag_objc_gc)
- {
- warning_at (0, 0, "%<-fobjc-gc%> is ignored for %<-fgnu-runtime%>");
- flag_objc_gc=0;
- }
- }
+ /* Set up stuff used by FE parser and all runtimes. */
+ errbuf = XNEWVEC (char, 1024 * 10);
+ hash_init ();
+ gcc_obstack_init (&util_obstack);
+ util_firstobj = (char *) obstack_finish (&util_obstack);
- init_objc ();
+ /* ... and then check flags and set-up for the selected runtime ... */
+ if (flag_next_runtime && flag_objc_abi >= 2)
+ ok = objc_next_runtime_abi_02_init (&runtime);
+ else if (flag_next_runtime)
+ ok = objc_next_runtime_abi_01_init (&runtime);
+ else
+ ok = objc_gnu_runtime_abi_01_init (&runtime);
- if (print_struct_values && !flag_compare_debug)
- generate_struct_by_value_array ();
+ /* If that part of the setup failed - bail out immediately. */
+ if (!ok)
+ return false;
-#ifndef OBJCPLUS
- if (flag_objc_exceptions && !flag_objc_sjlj_exceptions)
- using_eh_for_cleanups ();
-#endif
+ /* Generate general types and push runtime-specific decls to file scope. */
+ synth_module_prologue ();
return true;
}
@@ -633,13 +431,76 @@ objc_write_global_declarations (void)
{
mark_referenced_methods ();
- /* Finalize Objective-C runtime data. */
- finish_objc ();
+ /* A missing @end might not be detected by the parser. */
+ if (objc_implementation_context)
+ {
+ warning (0, "%<@end%> missing in implementation context");
+ finish_class (objc_implementation_context);
+ objc_ivar_chain = NULL_TREE;
+ objc_implementation_context = NULL_TREE;
+ }
- if (gen_declaration_file)
- fclose (gen_declaration_file);
+ if (warn_selector)
+ {
+ int slot;
+ hash hsh;
+
+ /* Run through the selector hash tables and print a warning for any
+ selector which has multiple methods. */
+
+ for (slot = 0; slot < SIZEHASHTABLE; slot++)
+ {
+ for (hsh = cls_method_hash_list[slot]; hsh; hsh = hsh->next)
+ check_duplicates (hsh, 0, 1);
+ for (hsh = nst_method_hash_list[slot]; hsh; hsh = hsh->next)
+ check_duplicates (hsh, 0, 0);
+ }
+ }
+
+ /* TODO: consider an early exit here if either errorcount or sorrycount
+ is non-zero. Not only is it wasting time to generate the metadata,
+ it needlessly imposes need to re-check for things that are already
+ determined to be errors. */
+
+ /* Finalize Objective-C runtime data. No need to generate tables
+ and code if only checking syntax, or if generating a PCH file. */
+ if (!flag_syntax_only && !pch_file)
+ {
+ location_t saved_location;
+
+ /* If gen_declaration desired, open the output file. */
+ if (flag_gen_declaration)
+ {
+ char * const dumpname = concat (dump_base_name, ".decl", NULL);
+ gen_declaration_file = fopen (dumpname, "w");
+ if (gen_declaration_file == 0)
+ fatal_error ("can%'t open %s: %m", dumpname);
+ free (dumpname);
+ }
+
+ /* Set the input location to BUILTINS_LOCATION. This is good
+ for error messages, in case any is generated while producing
+ the metadata, but it also silences warnings that would be
+ produced when compiling with -Wpadded in case when padding is
+ automatically added to the built-in runtime data structure
+ declarations. We know about this padding, and it is fine; we
+ don't want users to see any warnings about it if they use
+ -Wpadded. */
+ saved_location = input_location;
+ input_location = BUILTINS_LOCATION;
+
+ /* Compute and emit the meta-data tables for this runtime. */
+ (*runtime.generate_metadata) ();
+
+ /* Restore the original location, just in case it mattered. */
+ input_location = saved_location;
+
+ /* ... and then close any declaration file we opened. */
+ if (gen_declaration_file)
+ fclose (gen_declaration_file);
+ }
}
-
+
/* Return the first occurrence of a method declaration corresponding
to sel_name in rproto_list. Search rproto_list recursively.
If is_class is 0, search for instance methods, otherwise for class
@@ -1947,49 +1808,71 @@ objc_maybe_build_modify_expr (tree lhs, tree rhs)
to get these to work with very little effort, we build a
compound statement which does the setter call (to set the
property to 'rhs'), but which can also be evaluated returning
- the 'rhs'. So, we want to create the following:
+ the 'rhs'. If the 'rhs' has no side effects, we can simply
+ evaluate it twice, building
+
+ ([object setProperty: rhs]; rhs)
+
+ If it has side effects, we put it in a temporary variable first,
+ so we create the following:
(temp = rhs; [object setProperty: temp]; temp)
+
+ setter_argument is rhs in the first case, and temp in the second
+ case.
*/
- tree temp_variable_decl, bind;
+ tree setter_argument;
+
/* s1, s2 and s3 are the tree statements that we need in the
compound expression. */
tree s1, s2, s3, compound_expr;
+
+ if (TREE_SIDE_EFFECTS (rhs))
+ {
+ tree bind;
- /* TODO: If 'rhs' is a constant, we could maybe do without the
- 'temp' variable ? */
-
- /* Declare __objc_property_temp in a local bind. */
- temp_variable_decl = objc_create_temporary_var (TREE_TYPE (rhs), "__objc_property_temp");
- DECL_SOURCE_LOCATION (temp_variable_decl) = input_location;
- bind = build3 (BIND_EXPR, void_type_node, temp_variable_decl, NULL, NULL);
- SET_EXPR_LOCATION (bind, input_location);
- TREE_SIDE_EFFECTS (bind) = 1;
- add_stmt (bind);
+ /* Declare __objc_property_temp in a local bind. */
+ setter_argument = objc_create_temporary_var (TREE_TYPE (rhs), "__objc_property_temp");
+ DECL_SOURCE_LOCATION (setter_argument) = input_location;
+ bind = build3 (BIND_EXPR, void_type_node, setter_argument, NULL, NULL);
+ SET_EXPR_LOCATION (bind, input_location);
+ TREE_SIDE_EFFECTS (bind) = 1;
+ add_stmt (bind);
+
+ /* s1: x = rhs */
+ s1 = build_modify_expr (input_location, setter_argument, NULL_TREE,
+ NOP_EXPR,
+ input_location, rhs, NULL_TREE);
+ SET_EXPR_LOCATION (s1, input_location);
+ }
+ else
+ {
+ /* No s1. */
+ setter_argument = rhs;
+ s1 = NULL_TREE;
+ }
/* Now build the compound statement. */
-
- /* s1: __objc_property_temp = rhs */
- s1 = build_modify_expr (input_location, temp_variable_decl, NULL_TREE,
- NOP_EXPR,
- input_location, rhs, NULL_TREE);
- SET_EXPR_LOCATION (s1, input_location);
- /* s2: [object setProperty: __objc_property_temp] */
- s2 = objc_build_setter_call (lhs, temp_variable_decl);
-
- /* This happens if building the setter failed because the property
- is readonly. */
+ /* s2: [object setProperty: x] */
+ s2 = objc_build_setter_call (lhs, setter_argument);
+
+ /* This happens if building the setter failed because the
+ property is readonly. */
if (s2 == error_mark_node)
return error_mark_node;
SET_EXPR_LOCATION (s2, input_location);
- /* s3: __objc_property_temp */
- s3 = convert (TREE_TYPE (lhs), temp_variable_decl);
+ /* s3: x */
+ s3 = convert (TREE_TYPE (lhs), setter_argument);
- /* Now build the compound statement (s1, s2, s3) */
- compound_expr = build_compound_expr (input_location, build_compound_expr (input_location, s1, s2), s3);
+ /* Now build the compound statement (s1, s2, s3) or (s2, s3) as
+ appropriate. */
+ if (s1)
+ compound_expr = build_compound_expr (input_location, build_compound_expr (input_location, s1, s2), s3);
+ else
+ compound_expr = build_compound_expr (input_location, s2, s3);
/* Without this, with -Wall you get a 'valued computed is not
used' every time there is a "object.property = x" where the
@@ -2200,20 +2083,6 @@ objc_add_instance_variable (tree decl)
decl);
}
-/* Return true if TYPE is 'id'. */
-
-static bool
-objc_is_object_id (tree type)
-{
- return OBJC_TYPE_NAME (type) == objc_object_id;
-}
-
-static bool
-objc_is_class_id (tree type)
-{
- return OBJC_TYPE_NAME (type) == objc_class_id;
-}
-
/* Construct a C struct with same name as KLASS, a base struct with tag
SUPER_NAME (if any), and FIELDS indicated. */
@@ -2761,7 +2630,7 @@ objc_derived_from_p (tree parent, tree child)
}
#endif
-static tree
+tree
objc_build_component_ref (tree datum, tree component)
{
/* If COMPONENT is NULL, the caller is referring to the anonymous
@@ -2999,63 +2868,34 @@ lookup_and_install_protocols (tree protocols, bool definition_required)
return return_value;
}
-/* Create a declaration for field NAME of a given TYPE. */
-
-static tree
-create_field_decl (tree type, const char *name)
-{
- return build_decl (input_location,
- FIELD_DECL, get_identifier (name), type);
-}
-
-/* Create a global, static declaration for variable NAME of a given TYPE. The
- finish_var_decl() routine will need to be called on it afterwards. */
-
-static tree
-start_var_decl (tree type, const char *name)
-{
- tree var = build_decl (input_location,
- VAR_DECL, get_identifier (name), type);
-
- TREE_STATIC (var) = 1;
- DECL_INITIAL (var) = error_mark_node; /* A real initializer is coming... */
- DECL_IGNORED_P (var) = 1;
- DECL_ARTIFICIAL (var) = 1;
- DECL_CONTEXT (var) = NULL_TREE;
-#ifdef OBJCPLUS
- DECL_THIS_STATIC (var) = 1; /* squash redeclaration errors */
-#endif
-
- return var;
-}
-
-/* Finish off the variable declaration created by start_var_decl(). */
-
static void
-finish_var_decl (tree var, tree initializer)
+build_common_objc_exception_stuff (void)
{
- finish_decl (var, input_location, initializer, NULL_TREE, NULL_TREE);
-}
+ tree noreturn_list, nothrow_list, temp_type;
-/* Find the decl for the constant string class reference. This is only
- used for the NeXT runtime. */
+ noreturn_list = tree_cons (get_identifier ("noreturn"), NULL, NULL);
+ nothrow_list = tree_cons (get_identifier ("nothrow"), NULL, NULL);
-static tree
-setup_string_decl (void)
-{
- char *name;
- size_t length;
+ /* void objc_exception_throw(id) __attribute__((noreturn)); */
+ /* void objc_sync_enter(id); */
+ /* void objc_sync_exit(id); */
+ temp_type = build_function_type_list (void_type_node,
+ objc_object_type,
+ NULL_TREE);
+ objc_exception_throw_decl
+ = add_builtin_function (TAG_EXCEPTIONTHROW, temp_type, 0, NOT_BUILT_IN, NULL,
+ noreturn_list);
+ /* Make sure that objc_exception_throw (id) claims that it may throw an
+ exception. */
+ TREE_NOTHROW (objc_exception_throw_decl) = 0;
- /* %s in format will provide room for terminating null */
- length = strlen (STRING_OBJECT_GLOBAL_FORMAT)
- + strlen (constant_string_class_name);
- name = XNEWVEC (char, length);
- sprintf (name, STRING_OBJECT_GLOBAL_FORMAT,
- constant_string_class_name);
- constant_string_global_id = get_identifier (name);
- string_class_decl = lookup_name (constant_string_global_id);
+ objc_sync_enter_decl
+ = add_builtin_function (TAG_SYNCENTER, temp_type, 0, NOT_BUILT_IN,
+ NULL, nothrow_list);
- return string_class_decl;
+ objc_sync_exit_decl
+ = add_builtin_function (TAG_SYNCEXIT, temp_type, 0, NOT_BUILT_IN,
+ NULL, nothrow_list);
}
/* Purpose: "play" parser, creating/installing representations
@@ -3100,12 +2940,12 @@ synth_module_prologue (void)
objc_class_name = get_identifier (CLASS_TYPEDEF_NAME);
/* Declare the 'id' and 'Class' typedefs. */
-
type = lang_hooks.decls.pushdecl (build_decl (input_location,
TYPE_DECL,
objc_object_name,
objc_object_type));
TREE_NO_WARNING (type) = 1;
+
type = lang_hooks.decls.pushdecl (build_decl (input_location,
TYPE_DECL,
objc_class_name,
@@ -3113,29 +2953,11 @@ synth_module_prologue (void)
TREE_NO_WARNING (type) = 1;
/* Forward-declare '@interface Protocol'. */
-
type = get_identifier (PROTOCOL_OBJECT_CLASS_NAME);
objc_declare_class (tree_cons (NULL_TREE, type, NULL_TREE));
- objc_protocol_type = build_pointer_type (xref_tag (RECORD_TYPE,
- type));
-
- /* Declare type of selector-objects that represent an operation name. */
-
- if (flag_next_runtime)
- /* `struct objc_selector *' */
- objc_selector_type
- = build_pointer_type (xref_tag (RECORD_TYPE,
- get_identifier (TAG_SELECTOR)));
- else
- /* `const struct objc_selector *' */
- objc_selector_type
- = build_pointer_type
- (build_qualified_type (xref_tag (RECORD_TYPE,
- get_identifier (TAG_SELECTOR)),
- TYPE_QUAL_CONST));
+ objc_protocol_type = build_pointer_type (xref_tag (RECORD_TYPE, type));
/* Declare receiver type used for dispatching messages to 'super'. */
-
/* `struct objc_super *' */
objc_super_type = build_pointer_type (xref_tag (RECORD_TYPE,
get_identifier (TAG_SUPER)));
@@ -3151,162 +2973,18 @@ synth_module_prologue (void)
(xref_tag (RECORD_TYPE,
get_identifier (UTAG_IVAR_LIST)));
- /* TREE_NOTHROW is cleared for the message-sending functions,
- because the function that gets called can throw in Obj-C++, or
- could itself call something that can throw even in Obj-C. */
+ build_common_objc_exception_stuff ();
- if (flag_next_runtime)
- {
- /* NB: In order to call one of the ..._stret (struct-returning)
- functions, the function *MUST* first be cast to a signature that
- corresponds to the actual ObjC method being invoked. This is
- what is done by the build_objc_method_call() routine below. */
-
- /* id objc_msgSend (id, SEL, ...); */
- /* id objc_msgSendNonNil (id, SEL, ...); */
- /* id objc_msgSend_stret (id, SEL, ...); */
- /* id objc_msgSendNonNil_stret (id, SEL, ...); */
- type
- = build_varargs_function_type_list (objc_object_type,
- objc_object_type,
- objc_selector_type,
- NULL_TREE);
- umsg_decl = add_builtin_function (TAG_MSGSEND,
- type, 0, NOT_BUILT_IN,
- NULL, NULL_TREE);
- umsg_nonnil_decl = add_builtin_function (TAG_MSGSEND_NONNIL,
- type, 0, NOT_BUILT_IN,
- NULL, NULL_TREE);
- umsg_stret_decl = add_builtin_function (TAG_MSGSEND_STRET,
- type, 0, NOT_BUILT_IN,
- NULL, NULL_TREE);
- umsg_nonnil_stret_decl = add_builtin_function (TAG_MSGSEND_NONNIL_STRET,
- type, 0, NOT_BUILT_IN,
- NULL, NULL_TREE);
-
- /* These can throw, because the function that gets called can throw
- in Obj-C++, or could itself call something that can throw even
- in Obj-C. */
- TREE_NOTHROW (umsg_decl) = 0;
- TREE_NOTHROW (umsg_nonnil_decl) = 0;
- TREE_NOTHROW (umsg_stret_decl) = 0;
- TREE_NOTHROW (umsg_nonnil_stret_decl) = 0;
-
- /* id objc_msgSend_Fast (id, SEL, ...)
- __attribute__ ((hard_coded_address (OFFS_MSGSEND_FAST))); */
-#ifdef OFFS_MSGSEND_FAST
- umsg_fast_decl = add_builtin_function (TAG_MSGSEND_FAST,
- type, 0, NOT_BUILT_IN,
- NULL, NULL_TREE);
- TREE_NOTHROW (umsg_fast_decl) = 0;
- DECL_ATTRIBUTES (umsg_fast_decl)
- = tree_cons (get_identifier ("hard_coded_address"),
- build_int_cst (NULL_TREE, OFFS_MSGSEND_FAST),
- NULL_TREE);
-#else
- /* No direct dispatch available. */
- umsg_fast_decl = umsg_decl;
-#endif
-
- /* id objc_msgSendSuper (struct objc_super *, SEL, ...); */
- /* id objc_msgSendSuper_stret (struct objc_super *, SEL, ...); */
- type
- = build_varargs_function_type_list (objc_object_type,
- objc_super_type,
- objc_selector_type,
- NULL_TREE);
- umsg_super_decl = add_builtin_function (TAG_MSGSENDSUPER,
- type, 0, NOT_BUILT_IN,
- NULL, NULL_TREE);
- umsg_super_stret_decl = add_builtin_function (TAG_MSGSENDSUPER_STRET,
- type, 0, NOT_BUILT_IN, 0,
- NULL_TREE);
- TREE_NOTHROW (umsg_super_decl) = 0;
- TREE_NOTHROW (umsg_super_stret_decl) = 0;
- }
- else
- {
- /* GNU runtime messenger entry points. */
-
- /* typedef id (*IMP)(id, SEL, ...); */
- tree ftype =
- build_varargs_function_type_list (objc_object_type,
- objc_object_type,
- objc_selector_type,
- NULL_TREE);
- tree IMP_type = build_pointer_type (ftype);
-
- /* IMP objc_msg_lookup (id, SEL); */
- type = build_function_type_list (IMP_type,
- objc_object_type,
- objc_selector_type,
- NULL_TREE);
- umsg_decl = add_builtin_function (TAG_MSGSEND,
- type, 0, NOT_BUILT_IN,
- NULL, NULL_TREE);
- TREE_NOTHROW (umsg_decl) = 0;
-
- /* IMP objc_msg_lookup_super (struct objc_super *, SEL); */
- type
- = build_function_type_list (IMP_type,
- objc_super_type,
- objc_selector_type,
- NULL_TREE);
- umsg_super_decl = add_builtin_function (TAG_MSGSENDSUPER,
- type, 0, NOT_BUILT_IN,
- NULL, NULL_TREE);
- TREE_NOTHROW (umsg_super_decl) = 0;
-
- /* The following GNU runtime entry point is called to initialize
- each module:
-
- __objc_exec_class (void *); */
- type
- = build_function_type_list (void_type_node,
- ptr_type_node,
- NULL_TREE);
- execclass_decl = add_builtin_function (TAG_EXECCLASS,
- type, 0, NOT_BUILT_IN,
- NULL, NULL_TREE);
- }
-
- /* id objc_getClass (const char *); */
-
- type = build_function_type_list (objc_object_type,
- const_string_type_node,
- NULL_TREE);
-
- objc_get_class_decl
- = add_builtin_function (TAG_GETCLASS, type, 0, NOT_BUILT_IN,
- NULL, NULL_TREE);
-
- /* id objc_getMetaClass (const char *); */
-
- objc_get_meta_class_decl
- = add_builtin_function (TAG_GETMETACLASS, type, 0, NOT_BUILT_IN, NULL, NULL_TREE);
-
- build_class_template ();
- build_super_template ();
- build_protocol_template ();
- build_category_template ();
- build_objc_exception_stuff ();
+ /* Set-up runtime-specific templates, message and exception stuff. */
+ (*runtime.initialize) ();
/* Declare objc_getProperty, object_setProperty and other property
accessor helpers. */
- build_objc_property_accessor_helpers ();
-
- if (flag_next_runtime)
- build_next_objc_exception_stuff ();
-
- /* static SEL _OBJC_SELECTOR_TABLE[]; */
-
- if (! flag_next_runtime)
- build_selector_table_decl ();
+ build_common_objc_property_accessor_helpers ();
/* Forward declare constant_string_id and constant_string_type. */
if (!constant_string_class_name)
- constant_string_class_name = default_constant_string_class_name;
-
+ constant_string_class_name = runtime.default_constant_string_class_name;
constant_string_id = get_identifier (constant_string_class_name);
objc_declare_class (tree_cons (NULL_TREE, constant_string_id, NULL_TREE));
@@ -3333,6 +3011,8 @@ synth_module_prologue (void)
debug_hooks = save_hooks;
}
+/* --- const strings --- */
+
/* Ensure that the ivar list for NSConstantString/NXConstantString
(or whatever was specified via `-fconstant-string-class')
contains fields at least as large as the following three, so that
@@ -3397,7 +3077,7 @@ objc_build_internal_const_str_type (void)
/* Custom build_string which sets TREE_TYPE! */
-static tree
+tree
my_build_string (int len, const char *str)
{
return fix_string_type (build_string (len, str));
@@ -3406,7 +3086,7 @@ my_build_string (int len, const char *str)
/* Build a string with contents STR and length LEN and convert it to a
pointer. */
-static tree
+tree
my_build_string_pointer (int len, const char *str)
{
tree string = my_build_string (len, str);
@@ -3452,7 +3132,7 @@ objc_build_string_object (tree string)
{
tree constant_string_class;
int length;
- tree fields, addr;
+ tree addr;
struct string_descriptor *desc, key;
void **loc;
@@ -3465,7 +3145,8 @@ objc_build_string_object (tree string)
literal. On Darwin (Mac OS X), for example, we may wish to obtain a
constant CFString reference instead.
At present, this is only supported for the NeXT runtime. */
- if (flag_next_runtime && targetcm.objc_construct_string_object)
+ if (flag_next_runtime
+ && targetcm.objc_construct_string_object)
{
tree constructor = (*targetcm.objc_construct_string_object) (string);
if (constructor)
@@ -3489,11 +3170,10 @@ objc_build_string_object (tree string)
else if (!check_string_class_template ())
error ("interface %qE does not have valid constant string layout",
constant_string_id);
- /* For the NeXT runtime, we can generate a literal reference
- to the string class, don't need to run a constructor. */
- else if (flag_next_runtime && !setup_string_decl ())
- error ("cannot find reference tag for class %qE",
- constant_string_id);
+ /* If the runtime can generate a literal reference to the string class,
+ don't need to run a constructor. */
+ else if (!(*runtime.setup_const_string_class_decl)())
+ error ("cannot find reference tag for class %qE", constant_string_id);
else
{
string_layout_checked = 1; /* Success! */
@@ -3511,40 +3191,10 @@ objc_build_string_object (tree string)
if (!desc)
{
- tree var, constructor;
- VEC(constructor_elt,gc) *v = NULL;
*loc = desc = ggc_alloc_string_descriptor ();
desc->literal = string;
-
- /* GNU: (NXConstantString *) & ((__builtin_ObjCString) { NULL, string, length }) */
- /* NeXT: (NSConstantString *) & ((__builtin_ObjCString) { isa, string, length }) */
- fields = TYPE_FIELDS (internal_const_str_type);
- CONSTRUCTOR_APPEND_ELT (v, fields,
- flag_next_runtime
- ? build_unary_op (input_location,
- ADDR_EXPR, string_class_decl, 0)
- : build_int_cst (NULL_TREE, 0));
- fields = DECL_CHAIN (fields);
- CONSTRUCTOR_APPEND_ELT (v, fields,
- build_unary_op (input_location,
- ADDR_EXPR, string, 1));
- fields = DECL_CHAIN (fields);
- CONSTRUCTOR_APPEND_ELT (v, fields, build_int_cst (NULL_TREE, length));
- constructor = objc_build_constructor (internal_const_str_type, v);
-
- if (!flag_next_runtime)
- constructor
- = objc_add_static_instance (constructor, constant_string_type);
- else
- {
- var = build_decl (input_location,
- CONST_DECL, NULL, TREE_TYPE (constructor));
- DECL_INITIAL (var) = constructor;
- TREE_STATIC (var) = 1;
- pushdecl_top_level (var);
- constructor = var;
- }
- desc->constructor = constructor;
+ desc->constructor =
+ (*runtime.build_const_string_constructor) (input_location, string, length);
}
addr = convert (build_pointer_type (constant_string_type),
@@ -3554,51 +3204,10 @@ objc_build_string_object (tree string)
return addr;
}
-/* Declare a static instance of CLASS_DECL initialized by CONSTRUCTOR. */
-
-static GTY(()) int num_static_inst;
-
-static tree
-objc_add_static_instance (tree constructor, tree class_decl)
-{
- tree *chain, decl;
- char buf[256];
-
- /* Find the list of static instances for the CLASS_DECL. Create one if
- not found. */
- for (chain = &objc_static_instances;
- *chain && TREE_VALUE (*chain) != class_decl;
- chain = &TREE_CHAIN (*chain));
- if (!*chain)
- {
- *chain = tree_cons (NULL_TREE, class_decl, NULL_TREE);
- add_objc_string (OBJC_TYPE_NAME (class_decl), class_names);
- }
-
- sprintf (buf, "_OBJC_INSTANCE_%d", num_static_inst++);
- decl = build_decl (input_location,
- VAR_DECL, get_identifier (buf), class_decl);
- TREE_STATIC (decl) = 1;
- DECL_ARTIFICIAL (decl) = 1;
- TREE_USED (decl) = 1;
- DECL_INITIAL (decl) = constructor;
-
- /* We may be writing something else just now.
- Postpone till end of input. */
- DECL_DEFER_OUTPUT (decl) = 1;
- pushdecl_top_level (decl);
- rest_of_decl_compilation (decl, 1, 0);
-
- /* Add the DECL to the head of this CLASS' list. */
- TREE_PURPOSE (*chain) = tree_cons (NULL_TREE, decl, TREE_PURPOSE (*chain));
-
- return decl;
-}
-
/* Build a static constant CONSTRUCTOR
with type TYPE and elements ELTS. */
-static tree
+tree
objc_build_constructor (tree type, VEC(constructor_elt,gc) *elts)
{
tree constructor = build_constructor (type, elts);
@@ -3616,360 +3225,10 @@ objc_build_constructor (tree type, VEC(constructor_elt,gc) *elts)
return constructor;
}
-
-/* Take care of defining and initializing _OBJC_SYMBOLS. */
-
-/* Predefine the following data type:
-
- struct _objc_symtab
- {
- long sel_ref_cnt;
- SEL *refs;
- short cls_def_cnt;
- short cat_def_cnt;
- void *defs[cls_def_cnt + cat_def_cnt];
- }; */
-
-static void
-build_objc_symtab_template (void)
-{
- tree fields, *chain = NULL;
-
- objc_symtab_template = objc_start_struct (get_identifier (UTAG_SYMTAB));
-
- /* long sel_ref_cnt; */
- fields = add_field_decl (long_integer_type_node, "sel_ref_cnt", &chain);
-
- /* SEL *refs; */
- add_field_decl (build_pointer_type (objc_selector_type), "refs", &chain);
-
- /* short cls_def_cnt; */
- add_field_decl (short_integer_type_node, "cls_def_cnt", &chain);
-
- /* short cat_def_cnt; */
- add_field_decl (short_integer_type_node, "cat_def_cnt", &chain);
-
- if (imp_count || cat_count || !flag_next_runtime)
- {
- /* void *defs[imp_count + cat_count (+ 1)]; */
- /* NB: The index is one less than the size of the array. */
- int index = imp_count + cat_count + (flag_next_runtime ? -1: 0);
- tree array_type = build_sized_array_type (ptr_type_node, index + 1);
- add_field_decl (array_type, "defs", &chain);
- }
-
- objc_finish_struct (objc_symtab_template, fields);
-}
-
-/* Create the initial value for the `defs' field of _objc_symtab.
- This is a CONSTRUCTOR. */
-
-static tree
-init_def_list (tree type)
-{
- tree expr;
- struct imp_entry *impent;
- VEC(constructor_elt,gc) *v = NULL;
-
- if (imp_count)
- for (impent = imp_list; impent; impent = impent->next)
- {
- if (TREE_CODE (impent->imp_context) == CLASS_IMPLEMENTATION_TYPE)
- {
- expr = build_unary_op (input_location,
- ADDR_EXPR, impent->class_decl, 0);
- CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, expr);
- }
- }
-
- if (cat_count)
- for (impent = imp_list; impent; impent = impent->next)
- {
- if (TREE_CODE (impent->imp_context) == CATEGORY_IMPLEMENTATION_TYPE)
- {
- expr = build_unary_op (input_location,
- ADDR_EXPR, impent->class_decl, 0);
- CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, expr);
- }
- }
-
- if (!flag_next_runtime)
- {
- /* statics = { ..., _OBJC_STATIC_INSTANCES, ... } */
- if (static_instances_decl)
- expr = build_unary_op (input_location,
- ADDR_EXPR, static_instances_decl, 0);
- else
- expr = integer_zero_node;
-
- CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, expr);
- }
-
- return objc_build_constructor (type, v);
-}
-
-/* Construct the initial value for all of _objc_symtab. */
-
-static tree
-init_objc_symtab (tree type)
-{
- VEC(constructor_elt,gc) *v = NULL;
-
- /* sel_ref_cnt = { ..., 5, ... } */
-
- CONSTRUCTOR_APPEND_ELT (v, NULL_TREE,
- build_int_cst (long_integer_type_node, 0));
-
- /* refs = { ..., _OBJC_SELECTOR_TABLE, ... } */
-
- if (flag_next_runtime || ! sel_ref_chain)
- CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, convert (
- build_pointer_type (objc_selector_type),
- integer_zero_node));
- else
- {
- tree expr = build_unary_op (input_location, ADDR_EXPR,
- UOBJC_SELECTOR_TABLE_decl, 1);
-
- CONSTRUCTOR_APPEND_ELT (v, NULL_TREE,
- convert (build_pointer_type (objc_selector_type),
- expr));
- }
-
- /* cls_def_cnt = { ..., 5, ... } */
-
- CONSTRUCTOR_APPEND_ELT (v, NULL_TREE,
- build_int_cst (short_integer_type_node, imp_count));
-
- /* cat_def_cnt = { ..., 5, ... } */
-
- CONSTRUCTOR_APPEND_ELT (v, NULL_TREE,
- build_int_cst (short_integer_type_node, cat_count));
-
- /* cls_def = { ..., { &Foo, &Bar, ...}, ... } */
-
- if (imp_count || cat_count || !flag_next_runtime)
- {
-
- tree field = TYPE_FIELDS (type);
- field = DECL_CHAIN (DECL_CHAIN (DECL_CHAIN (DECL_CHAIN (field))));
-
- CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, init_def_list (TREE_TYPE (field)));
- }
-
- return objc_build_constructor (type, v);
-}
-
-/* Generate forward declarations for metadata such as
- 'OBJC_CLASS_...'. */
-
-static tree
-build_metadata_decl (const char *name, tree type)
-{
- tree decl;
-
- /* struct TYPE NAME_<name>; */
- decl = start_var_decl (type, synth_id_with_class_suffix
- (name,
- objc_implementation_context));
-
- return decl;
-}
-
-/* Push forward-declarations of all the categories so that
- init_def_list can use them in a CONSTRUCTOR. */
-
-static void
-forward_declare_categories (void)
-{
- struct imp_entry *impent;
- tree sav = objc_implementation_context;
-
- for (impent = imp_list; impent; impent = impent->next)
- {
- if (TREE_CODE (impent->imp_context) == CATEGORY_IMPLEMENTATION_TYPE)
- {
- /* Set an invisible arg to synth_id_with_class_suffix. */
- objc_implementation_context = impent->imp_context;
- /* extern struct objc_category _OBJC_CATEGORY_<name>; */
- impent->class_decl = build_metadata_decl ("_OBJC_CATEGORY",
- objc_category_template);
- }
- }
- objc_implementation_context = sav;
-}
-
-/* Create the declaration of _OBJC_SYMBOLS, with type `struct _objc_symtab'
- and initialized appropriately. */
-
-static void
-generate_objc_symtab_decl (void)
-{
-
- build_objc_symtab_template ();
- UOBJC_SYMBOLS_decl = start_var_decl (objc_symtab_template, "_OBJC_SYMBOLS");
- finish_var_decl (UOBJC_SYMBOLS_decl,
- init_objc_symtab (TREE_TYPE (UOBJC_SYMBOLS_decl)));
-}
-
-static tree
-init_module_descriptor (tree type)
-{
- tree expr;
- VEC(constructor_elt,gc) *v = NULL;
-
- /* version = { 1, ... } */
-
- expr = build_int_cst (long_integer_type_node, OBJC_VERSION);
- CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, expr);
-
- /* size = { ..., sizeof (struct _objc_module), ... } */
-
- expr = convert (long_integer_type_node,
- size_in_bytes (objc_module_template));
- CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, expr);
-
- /* Don't provide any file name for security reasons. */
- /* name = { ..., "", ... } */
-
- expr = add_objc_string (get_identifier (""), class_names);
- CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, expr);
-
- /* symtab = { ..., _OBJC_SYMBOLS, ... } */
-
- if (UOBJC_SYMBOLS_decl)
- expr = build_unary_op (input_location,
- ADDR_EXPR, UOBJC_SYMBOLS_decl, 0);
- else
- expr = null_pointer_node;
- CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, expr);
-
- return objc_build_constructor (type, v);
-}
-
-/* Write out the data structures to describe Objective C classes defined.
-
- struct _objc_module { ... } _OBJC_MODULE = { ... }; */
-
-static void
-build_module_descriptor (void)
-{
- tree decls, *chain = NULL;
-
-#ifdef OBJCPLUS
- push_lang_context (lang_name_c); /* extern "C" */
-#endif
-
- objc_module_template = objc_start_struct (get_identifier (UTAG_MODULE));
-
- /* long version; */
- decls = add_field_decl (long_integer_type_node, "version", &chain);
-
- /* long size; */
- add_field_decl (long_integer_type_node, "size", &chain);
-
- /* char *name; */
- add_field_decl (string_type_node, "name", &chain);
-
- /* struct _objc_symtab *symtab; */
- add_field_decl (build_pointer_type (xref_tag (RECORD_TYPE,
- get_identifier (UTAG_SYMTAB))),
- "symtab", &chain);
-
- objc_finish_struct (objc_module_template, decls);
-
- /* Create an instance of "_objc_module". */
- UOBJC_MODULES_decl = start_var_decl (objc_module_template, "_OBJC_MODULES");
- /* This is the root of the metadata for defined classes and categories, it
- is referenced by the runtime and, therefore, needed. */
- DECL_PRESERVE_P (UOBJC_MODULES_decl) = 1;
- finish_var_decl (UOBJC_MODULES_decl,
- init_module_descriptor (TREE_TYPE (UOBJC_MODULES_decl)));
-
-#ifdef OBJCPLUS
- pop_lang_context ();
-#endif
-}
-
-/* The GNU runtime requires us to provide a static initializer function
- for each module:
-
- static void __objc_gnu_init (void) {
- __objc_exec_class (&L_OBJC_MODULES);
- } */
-
-static void
-build_module_initializer_routine (void)
-{
- tree body;
-
-#ifdef OBJCPLUS
- push_lang_context (lang_name_c); /* extern "C" */
-#endif
-
- objc_push_parm (build_decl (input_location,
- PARM_DECL, NULL_TREE, void_type_node));
-#ifdef OBJCPLUS
- objc_start_function (get_identifier (TAG_GNUINIT),
- build_function_type_list (void_type_node, NULL_TREE),
- NULL_TREE, NULL_TREE);
-#else
- objc_start_function (get_identifier (TAG_GNUINIT),
- build_function_type_list (void_type_node, NULL_TREE),
- NULL_TREE, objc_get_parm_info (0));
-#endif
- body = c_begin_compound_stmt (true);
- add_stmt (build_function_call
- (input_location,
- execclass_decl,
- build_tree_list
- (NULL_TREE,
- build_unary_op (input_location, ADDR_EXPR,
- UOBJC_MODULES_decl, 0))));
- add_stmt (c_end_compound_stmt (input_location, body, true));
-
- TREE_PUBLIC (current_function_decl) = 0;
-
-#ifndef OBJCPLUS
- /* For Objective-C++, we will need to call __objc_gnu_init
- from objc_generate_static_init_call() below. */
- DECL_STATIC_CONSTRUCTOR (current_function_decl) = 1;
-#endif
-
- GNU_INIT_decl = current_function_decl;
- finish_function ();
-
-#ifdef OBJCPLUS
- pop_lang_context ();
-#endif
-}
-
-#ifdef OBJCPLUS
-/* Return 1 if the __objc_gnu_init function has been synthesized and needs
- to be called by the module initializer routine. */
-
-int
-objc_static_init_needed_p (void)
-{
- return (GNU_INIT_decl != NULL_TREE);
-}
-
-/* Generate a call to the __objc_gnu_init initializer function. */
-
-tree
-objc_generate_static_init_call (tree ctors ATTRIBUTE_UNUSED)
-{
- add_stmt (build_stmt (input_location, EXPR_STMT,
- build_function_call (input_location,
- GNU_INIT_decl, NULL_TREE)));
-
- return ctors;
-}
-#endif /* OBJCPLUS */
/* Return the DECL of the string IDENT in the SECTION. */
-static tree
+tree
get_objc_string_decl (tree ident, enum string_section section)
{
tree chain;
@@ -3985,6 +3244,9 @@ get_objc_string_decl (tree ident, enum string_section section)
case meth_var_types:
chain = meth_var_types_chain;
break;
+ case prop_names_attr:
+ chain = prop_names_attr_chain;
+ break;
default:
gcc_unreachable ();
}
@@ -3993,314 +3255,14 @@ get_objc_string_decl (tree ident, enum string_section section)
if (TREE_VALUE (chain) == ident)
return (TREE_PURPOSE (chain));
- gcc_unreachable ();
+ /* We didn't find the entry. */
return NULL_TREE;
}
-/* Output references to all statically allocated objects. Return the DECL
- for the array built. */
-
-static void
-generate_static_references (void)
-{
- tree expr = NULL_TREE;
- tree class_name, klass, decl;
- tree cl_chain, in_chain, type
- = build_array_type (build_pointer_type (void_type_node), NULL_TREE);
- int num_inst, num_class;
- char buf[256];
- VEC(constructor_elt,gc) *decls = NULL;
-
- if (flag_next_runtime)
- gcc_unreachable ();
-
- for (cl_chain = objc_static_instances, num_class = 0;
- cl_chain; cl_chain = TREE_CHAIN (cl_chain), num_class++)
- {
- VEC(constructor_elt,gc) *v = NULL;
-
- for (num_inst = 0, in_chain = TREE_PURPOSE (cl_chain);
- in_chain; num_inst++, in_chain = TREE_CHAIN (in_chain));
-
- sprintf (buf, "_OBJC_STATIC_INSTANCES_%d", num_class);
- decl = start_var_decl (type, buf);
-
- /* Output {class_name, ...}. */
- klass = TREE_VALUE (cl_chain);
- class_name = get_objc_string_decl (OBJC_TYPE_NAME (klass), class_names);
- CONSTRUCTOR_APPEND_ELT (v, NULL_TREE,
- build_unary_op (input_location,
- ADDR_EXPR, class_name, 1));
-
- /* Output {..., instance, ...}. */
- for (in_chain = TREE_PURPOSE (cl_chain);
- in_chain; in_chain = TREE_CHAIN (in_chain))
- {
- expr = build_unary_op (input_location,
- ADDR_EXPR, TREE_VALUE (in_chain), 1);
- CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, expr);
- }
-
- /* Output {..., NULL}. */
- CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, build_int_cst (NULL_TREE, 0));
-
- expr = objc_build_constructor (TREE_TYPE (decl), v);
- finish_var_decl (decl, expr);
- CONSTRUCTOR_APPEND_ELT (decls, NULL_TREE,
- build_unary_op (input_location,
- ADDR_EXPR, decl, 1));
- }
-
- CONSTRUCTOR_APPEND_ELT (decls, NULL_TREE, build_int_cst (NULL_TREE, 0));
- expr = objc_build_constructor (type, decls);
- static_instances_decl = start_var_decl (type, "_OBJC_STATIC_INSTANCES");
- finish_var_decl (static_instances_decl, expr);
-}
-
-static GTY(()) int selector_reference_idx;
-
-static tree
-build_selector_reference_decl (void)
-{
- tree decl;
- char buf[256];
-
- sprintf (buf, "_OBJC_SELECTOR_REFERENCES_%d", selector_reference_idx++);
- decl = start_var_decl (objc_selector_type, buf);
-
- return decl;
-}
-
-static void
-build_selector_table_decl (void)
-{
- tree temp;
-
- if (flag_typed_selectors)
- {
- build_selector_template ();
- temp = build_array_type (objc_selector_template, NULL_TREE);
- }
- else
- temp = build_array_type (objc_selector_type, NULL_TREE);
-
- UOBJC_SELECTOR_TABLE_decl = start_var_decl (temp, "_OBJC_SELECTOR_TABLE");
-}
-
-/* Just a handy wrapper for add_objc_string. */
-
-static tree
-build_selector (tree ident)
-{
- return convert (objc_selector_type,
- add_objc_string (ident, meth_var_names));
-}
-
-/* Used only by build_*_selector_translation_table (). */
-static void
-diagnose_missing_method (tree meth, location_t here)
-{
- tree method_chain;
- bool found = false;
- for (method_chain = meth_var_names_chain;
- method_chain;
- method_chain = TREE_CHAIN (method_chain))
- {
- if (TREE_VALUE (method_chain) == meth)
- {
- found = true;
- break;
- }
- }
-
- if (!found)
- warning_at (here, 0, "creating selector for nonexistent method %qE",
- meth);
-}
-
-static void
-build_next_selector_translation_table (void)
-{
- tree chain;
- for (chain = sel_ref_chain; chain; chain = TREE_CHAIN (chain))
- {
- tree expr;
- tree decl = TREE_PURPOSE (chain);
- if (warn_selector && objc_implementation_context)
- {
- location_t loc;
- if (decl)
- loc = DECL_SOURCE_LOCATION (decl);
- else
- loc = input_location;
- diagnose_missing_method (TREE_VALUE (chain), loc);
- }
-
- expr = build_selector (TREE_VALUE (chain));
-
- if (decl)
- {
- /* Entries of this form are used for references to methods.
- The runtime re-writes these on start-up, but the compiler can't see
- that and optimizes it away unless we force it. */
- DECL_PRESERVE_P (decl) = 1;
- finish_var_decl (decl, expr);
- }
- }
-}
-
-static void
-build_gnu_selector_translation_table (void)
-{
- tree chain;
-/* int offset = 0;
- tree decl = NULL_TREE;*/
- VEC(constructor_elt,gc) *inits = NULL;
-
- for (chain = sel_ref_chain; chain; chain = TREE_CHAIN (chain))
- {
- tree expr;
-
- if (warn_selector && objc_implementation_context)
- diagnose_missing_method (TREE_VALUE (chain), input_location);
-
- expr = build_selector (TREE_VALUE (chain));
- /* add one for the '\0' character
- offset += IDENTIFIER_LENGTH (TREE_VALUE (chain)) + 1;*/
-
- {
- if (flag_typed_selectors)
- {
- VEC(constructor_elt,gc) *v = NULL;
- tree encoding = get_proto_encoding (TREE_PURPOSE (chain));
- CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, expr);
- CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, encoding);
- expr = objc_build_constructor (objc_selector_template, v);
- }
-
- CONSTRUCTOR_APPEND_ELT (inits, NULL_TREE, expr);
- }
- } /* each element in the chain */
-
- {
- /* Cause the selector table (previously forward-declared)
- to be actually output. */
- tree expr;
-
- if (flag_typed_selectors)
- {
- VEC(constructor_elt,gc) *v = NULL;
- CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, integer_zero_node);
- CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, integer_zero_node);
- expr = objc_build_constructor (objc_selector_template, v);
- }
- else
- expr = integer_zero_node;
-
- CONSTRUCTOR_APPEND_ELT (inits, NULL_TREE, expr);
- expr = objc_build_constructor (TREE_TYPE (UOBJC_SELECTOR_TABLE_decl),
- inits);
- finish_var_decl (UOBJC_SELECTOR_TABLE_decl, expr);
- }
-}
-
-static tree
-get_proto_encoding (tree proto)
-{
- tree encoding;
- if (proto)
- {
- if (! METHOD_ENCODING (proto))
- {
- encoding = encode_method_prototype (proto);
- METHOD_ENCODING (proto) = encoding;
- }
- else
- encoding = METHOD_ENCODING (proto);
-
- return add_objc_string (encoding, meth_var_types);
- }
- else
- return build_int_cst (NULL_TREE, 0);
-}
-
-/* sel_ref_chain is a list whose "value" fields will be instances of
- identifier_node that represent the selector. LOC is the location of
- the @selector. */
-
-static tree
-build_typed_selector_reference (location_t loc, tree ident, tree prototype)
-{
- tree *chain = &sel_ref_chain;
- tree expr;
- int index = 0;
-
- while (*chain)
- {
- if (TREE_PURPOSE (*chain) == prototype && TREE_VALUE (*chain) == ident)
- goto return_at_index;
-
- index++;
- chain = &TREE_CHAIN (*chain);
- }
-
- *chain = tree_cons (prototype, ident, NULL_TREE);
-
- return_at_index:
- expr = build_unary_op (loc, ADDR_EXPR,
- build_array_ref (loc, UOBJC_SELECTOR_TABLE_decl,
- build_int_cst (NULL_TREE, index)),
- 1);
- return convert (objc_selector_type, expr);
-}
-
-static tree
-build_selector_reference (location_t loc, tree ident)
-{
- tree *chain = &sel_ref_chain;
- tree expr;
- int index = 0;
-
- while (*chain)
- {
- if (TREE_VALUE (*chain) == ident)
- return (flag_next_runtime
- ? TREE_PURPOSE (*chain)
- : build_array_ref (loc, UOBJC_SELECTOR_TABLE_decl,
- build_int_cst (NULL_TREE, index)));
-
- index++;
- chain = &TREE_CHAIN (*chain);
- }
-
- expr = (flag_next_runtime ? build_selector_reference_decl (): NULL_TREE);
-
- *chain = tree_cons (expr, ident, NULL_TREE);
-
- return (flag_next_runtime
- ? expr
- : build_array_ref (loc, UOBJC_SELECTOR_TABLE_decl,
- build_int_cst (NULL_TREE, index)));
-}
-
-static GTY(()) int class_reference_idx;
-
-static tree
-build_class_reference_decl (void)
-{
- tree decl;
- char buf[256];
-
- sprintf (buf, "_OBJC_CLASS_REFERENCES_%d", class_reference_idx++);
- decl = start_var_decl (objc_class_type, buf);
-
- return decl;
-}
-
/* Create a class reference, but don't create a variable to reference
it. */
-static void
+void
add_class_reference (tree ident)
{
tree chain;
@@ -4361,93 +3323,7 @@ objc_get_class_reference (tree ident)
return error_mark_node;
}
- if (flag_next_runtime && !flag_zero_link)
- {
- tree *chain;
- tree decl;
-
- for (chain = &cls_ref_chain; *chain; chain = &TREE_CHAIN (*chain))
- if (TREE_VALUE (*chain) == ident)
- {
- if (! TREE_PURPOSE (*chain))
- TREE_PURPOSE (*chain) = build_class_reference_decl ();
-
- return TREE_PURPOSE (*chain);
- }
-
- decl = build_class_reference_decl ();
- *chain = tree_cons (decl, ident, NULL_TREE);
- return decl;
- }
- else
- {
- tree params;
-
- add_class_reference (ident);
-
- params = build_tree_list (NULL_TREE,
- my_build_string_pointer
- (IDENTIFIER_LENGTH (ident) + 1,
- IDENTIFIER_POINTER (ident)));
-
- assemble_external (objc_get_class_decl);
- return build_function_call (input_location, objc_get_class_decl, params);
- }
-}
-
-/* For each string section we have a chain which maps identifier nodes
- to decls for the strings. */
-
-static GTY(()) int class_names_idx;
-static GTY(()) int meth_var_names_idx;
-static GTY(()) int meth_var_types_idx;
-
-static tree
-add_objc_string (tree ident, enum string_section section)
-{
- tree *chain, decl, type, string_expr;
- char buf[256];
-
- buf[0] = 0;
- switch (section)
- {
- case class_names:
- chain = &class_names_chain;
- sprintf (buf, "_OBJC_CLASS_NAME_%d", class_names_idx++);
- break;
- case meth_var_names:
- chain = &meth_var_names_chain;
- sprintf (buf, "_OBJC_METH_VAR_NAME_%d", meth_var_names_idx++);
- break;
- case meth_var_types:
- chain = &meth_var_types_chain;
- sprintf (buf, "_OBJC_METH_VAR_TYPE_%d", meth_var_types_idx++);
- break;
- default:
- gcc_unreachable ();
- }
-
- while (*chain)
- {
- if (TREE_VALUE (*chain) == ident)
- return convert (string_type_node,
- build_unary_op (input_location,
- ADDR_EXPR, TREE_PURPOSE (*chain), 1));
-
- chain = &TREE_CHAIN (*chain);
- }
-
- type = build_sized_array_type (char_type_node, IDENTIFIER_LENGTH (ident) + 1);
- decl = start_var_decl (type, buf);
- string_expr = my_build_string (IDENTIFIER_LENGTH (ident) + 1,
- IDENTIFIER_POINTER (ident));
- TREE_CONSTANT (decl) = 1;
- finish_var_decl (decl, string_expr);
-
- *chain = tree_cons (decl, ident, NULL_TREE);
-
- return convert (string_type_node, build_unary_op (input_location,
- ADDR_EXPR, decl, 1));
+ return (*runtime.get_class_reference) (ident);
}
void
@@ -4505,9 +3381,9 @@ objc_declare_class (tree ident_list)
if (record)
{
if (TREE_CODE (record) == TYPE_DECL)
- type = DECL_ORIGINAL_TYPE (record) ?
- DECL_ORIGINAL_TYPE (record) :
- TREE_TYPE (record);
+ type = DECL_ORIGINAL_TYPE (record)
+ ? DECL_ORIGINAL_TYPE (record)
+ : TREE_TYPE (record);
if (!TYPE_HAS_OBJC_INFO (type)
|| !TYPE_OBJC_INTERFACE (type))
@@ -4909,7 +3785,7 @@ eq_interface (const void *p1, const void *p2)
return d->id == p2;
}
-static tree
+tree
lookup_interface (tree ident)
{
#ifdef OBJCPLUS
@@ -4997,76 +3873,6 @@ get_class_ivars (tree interface, bool inherited)
return ivar_chain;
}
-
-/* Exception handling constructs. We begin by having the parser do most
- of the work and passing us blocks. What we do next depends on whether
- we're doing "native" exception handling or legacy Darwin setjmp exceptions.
- We abstract all of this in a handful of appropriately named routines. */
-
-/* Stack of open try blocks. */
-
-struct objc_try_context
-{
- struct objc_try_context *outer;
-
- /* Statements (or statement lists) as processed by the parser. */
- tree try_body;
- tree finally_body;
-
- /* Some file position locations. */
- location_t try_locus;
- location_t end_try_locus;
- location_t end_catch_locus;
- location_t finally_locus;
- location_t end_finally_locus;
-
- /* A STATEMENT_LIST of CATCH_EXPRs, appropriate for sticking into op1
- of a TRY_CATCH_EXPR. Even when doing Darwin setjmp. */
- tree catch_list;
-
- /* The CATCH_EXPR of an open @catch clause. */
- tree current_catch;
-
- /* The VAR_DECL holding the Darwin equivalent of __builtin_eh_pointer. */
- tree caught_decl;
- tree stack_decl;
- tree rethrow_decl;
-};
-
-static struct objc_try_context *cur_try_context;
-
-static GTY(()) tree objc_eh_personality_decl;
-
-/* This hook, called via lang_eh_runtime_type, generates a runtime object
- that represents TYPE. For Objective-C, this is just the class name. */
-/* ??? Isn't there a class object or some such? Is it easy to get? */
-
-#ifndef OBJCPLUS
-tree
-objc_eh_runtime_type (tree type)
-{
- /* Use 'ErrorMarkNode' as class name when error_mark_node is found
- to prevent an ICE. Note that we know that the compiler will
- terminate with an error and this 'ErrorMarkNode' class name will
- never be actually used. */
- if (type == error_mark_node)
- return add_objc_string (get_identifier ("ErrorMarkNode"), class_names);
- else
- return add_objc_string (OBJC_TYPE_NAME (TREE_TYPE (type)), class_names);
-}
-
-tree
-objc_eh_personality (void)
-{
- if (!flag_objc_sjlj_exceptions && !objc_eh_personality_decl)
- objc_eh_personality_decl = build_personality_function
- (flag_next_runtime
- ? "objc"
- : "gnu_objc");
- return objc_eh_personality_decl;
-}
-#endif
-
void
objc_maybe_warn_exceptions (location_t loc)
{
@@ -5089,293 +3895,7 @@ objc_maybe_warn_exceptions (location_t loc)
}
}
-/* Build __builtin_eh_pointer, or the moral equivalent. In the case
- of Darwin, we'll arrange for it to be initialized (and associated
- with a binding) later. */
-
-static tree
-objc_build_exc_ptr (void)
-{
- if (flag_objc_sjlj_exceptions)
- {
- tree var = cur_try_context->caught_decl;
- if (!var)
- {
- var = objc_create_temporary_var (objc_object_type, NULL);
- cur_try_context->caught_decl = var;
- }
- return var;
- }
- else
- {
- tree t;
- t = built_in_decls[BUILT_IN_EH_POINTER];
- t = build_call_expr (t, 1, integer_zero_node);
- return fold_convert (objc_object_type, t);
- }
-}
-
-/* Build "objc_exception_try_exit(&_stack)". */
-
-static tree
-next_sjlj_build_try_exit (void)
-{
- tree t;
- t = build_fold_addr_expr_loc (input_location, cur_try_context->stack_decl);
- t = tree_cons (NULL, t, NULL);
- t = build_function_call (input_location,
- objc_exception_try_exit_decl, t);
- return t;
-}
-
-/* Build
- objc_exception_try_enter (&_stack);
- if (_setjmp(&_stack.buf))
- ;
- else
- ;
- Return the COND_EXPR. Note that the THEN and ELSE fields are left
- empty, ready for the caller to fill them in. */
-
-static tree
-next_sjlj_build_enter_and_setjmp (void)
-{
- tree t, enter, sj, cond;
-
- t = build_fold_addr_expr_loc (input_location, cur_try_context->stack_decl);
- t = tree_cons (NULL, t, NULL);
- enter = build_function_call (input_location,
- objc_exception_try_enter_decl, t);
-
- t = objc_build_component_ref (cur_try_context->stack_decl,
- get_identifier ("buf"));
- t = build_fold_addr_expr_loc (input_location, t);
-#ifdef OBJCPLUS
- /* Convert _setjmp argument to type that is expected. */
- if (prototype_p (TREE_TYPE (objc_setjmp_decl)))
- t = convert (TREE_VALUE (TYPE_ARG_TYPES (TREE_TYPE (objc_setjmp_decl))), t);
- else
- t = convert (ptr_type_node, t);
-#else
- t = convert (ptr_type_node, t);
-#endif
- t = tree_cons (NULL, t, NULL);
- sj = build_function_call (input_location,
- objc_setjmp_decl, t);
-
- cond = build2 (COMPOUND_EXPR, TREE_TYPE (sj), enter, sj);
- cond = c_common_truthvalue_conversion (input_location, cond);
-
- return build3 (COND_EXPR, void_type_node, cond, NULL, NULL);
-}
-
-/* Build:
-
- DECL = objc_exception_extract(&_stack); */
-
-static tree
-next_sjlj_build_exc_extract (tree decl)
-{
- tree t;
-
- t = build_fold_addr_expr_loc (input_location, cur_try_context->stack_decl);
- t = tree_cons (NULL, t, NULL);
- t = build_function_call (input_location,
- objc_exception_extract_decl, t);
- t = convert (TREE_TYPE (decl), t);
- t = build2 (MODIFY_EXPR, void_type_node, decl, t);
-
- return t;
-}
-
-/* Build
- if (objc_exception_match(obj_get_class(TYPE), _caught)
- BODY
- else if (...)
- ...
- else
- {
- _rethrow = _caught;
- objc_exception_try_exit(&_stack);
- }
- from the sequence of CATCH_EXPRs in the current try context. */
-
-static tree
-next_sjlj_build_catch_list (void)
-{
- tree_stmt_iterator i = tsi_start (cur_try_context->catch_list);
- tree catch_seq, t;
- tree *last = &catch_seq;
- bool saw_id = false;
-
- for (; !tsi_end_p (i); tsi_next (&i))
- {
- tree stmt = tsi_stmt (i);
- tree type = CATCH_TYPES (stmt);
- tree body = CATCH_BODY (stmt);
-
- if (type == NULL)
- {
- *last = body;
- saw_id = true;
- break;
- }
- else
- {
- tree args, cond;
-
- if (type == error_mark_node)
- cond = error_mark_node;
- else
- {
- args = tree_cons (NULL, cur_try_context->caught_decl, NULL);
- t = objc_get_class_reference (OBJC_TYPE_NAME (TREE_TYPE (type)));
- args = tree_cons (NULL, t, args);
- t = build_function_call (input_location,
- objc_exception_match_decl, args);
- cond = c_common_truthvalue_conversion (input_location, t);
- }
- t = build3 (COND_EXPR, void_type_node, cond, body, NULL);
- SET_EXPR_LOCATION (t, EXPR_LOCATION (stmt));
-
- *last = t;
- last = &COND_EXPR_ELSE (t);
- }
- }
-
- if (!saw_id)
- {
- t = build2 (MODIFY_EXPR, void_type_node, cur_try_context->rethrow_decl,
- cur_try_context->caught_decl);
- SET_EXPR_LOCATION (t, cur_try_context->end_catch_locus);
- append_to_statement_list (t, last);
-
- t = next_sjlj_build_try_exit ();
- SET_EXPR_LOCATION (t, cur_try_context->end_catch_locus);
- append_to_statement_list (t, last);
- }
-
- return catch_seq;
-}
-
-/* Build a complete @try-@catch-@finally block for legacy Darwin setjmp
- exception handling. We aim to build:
-
- {
- struct _objc_exception_data _stack;
- id _rethrow = 0;
- try
- {
- objc_exception_try_enter (&_stack);
- if (_setjmp(&_stack.buf))
- {
- id _caught = objc_exception_extract(&_stack);
- objc_exception_try_enter (&_stack);
- if (_setjmp(&_stack.buf))
- _rethrow = objc_exception_extract(&_stack);
- else
- CATCH-LIST
- }
- else
- TRY-BLOCK
- }
- finally
- {
- if (!_rethrow)
- objc_exception_try_exit(&_stack);
- FINALLY-BLOCK
- if (_rethrow)
- objc_exception_throw(_rethrow);
- }
- }
-
- If CATCH-LIST is empty, we can omit all of the block containing
- "_caught" except for the setting of _rethrow. Note the use of
- a real TRY_FINALLY_EXPR here, which is not involved in EH per-se,
- but handles goto and other exits from the block. */
-
-static tree
-next_sjlj_build_try_catch_finally (void)
-{
- tree rethrow_decl, stack_decl, t;
- tree catch_seq, try_fin, bind;
-
- /* Create the declarations involved. */
- t = xref_tag (RECORD_TYPE, get_identifier (UTAG_EXCDATA));
- stack_decl = objc_create_temporary_var (t, NULL);
- cur_try_context->stack_decl = stack_decl;
-
- rethrow_decl = objc_create_temporary_var (objc_object_type, NULL);
- cur_try_context->rethrow_decl = rethrow_decl;
- TREE_CHAIN (rethrow_decl) = stack_decl;
-
- /* Build the outermost variable binding level. */
- bind = build3 (BIND_EXPR, void_type_node, rethrow_decl, NULL, NULL);
- SET_EXPR_LOCATION (bind, cur_try_context->try_locus);
- TREE_SIDE_EFFECTS (bind) = 1;
-
- /* Initialize rethrow_decl. */
- t = build2 (MODIFY_EXPR, void_type_node, rethrow_decl,
- convert (objc_object_type, null_pointer_node));
- SET_EXPR_LOCATION (t, cur_try_context->try_locus);
- append_to_statement_list (t, &BIND_EXPR_BODY (bind));
-
- /* Build the outermost TRY_FINALLY_EXPR. */
- try_fin = build2 (TRY_FINALLY_EXPR, void_type_node, NULL, NULL);
- SET_EXPR_LOCATION (try_fin, cur_try_context->try_locus);
- TREE_SIDE_EFFECTS (try_fin) = 1;
- append_to_statement_list (try_fin, &BIND_EXPR_BODY (bind));
-
- /* Create the complete catch sequence. */
- if (cur_try_context->catch_list)
- {
- tree caught_decl = objc_build_exc_ptr ();
- catch_seq = build_stmt (input_location, BIND_EXPR, caught_decl, NULL, NULL);
- TREE_SIDE_EFFECTS (catch_seq) = 1;
-
- t = next_sjlj_build_exc_extract (caught_decl);
- append_to_statement_list (t, &BIND_EXPR_BODY (catch_seq));
-
- t = next_sjlj_build_enter_and_setjmp ();
- COND_EXPR_THEN (t) = next_sjlj_build_exc_extract (rethrow_decl);
- COND_EXPR_ELSE (t) = next_sjlj_build_catch_list ();
- append_to_statement_list (t, &BIND_EXPR_BODY (catch_seq));
- }
- else
- catch_seq = next_sjlj_build_exc_extract (rethrow_decl);
- SET_EXPR_LOCATION (catch_seq, cur_try_context->end_try_locus);
-
- /* Build the main register-and-try if statement. */
- t = next_sjlj_build_enter_and_setjmp ();
- SET_EXPR_LOCATION (t, cur_try_context->try_locus);
- COND_EXPR_THEN (t) = catch_seq;
- COND_EXPR_ELSE (t) = cur_try_context->try_body;
- TREE_OPERAND (try_fin, 0) = t;
-
- /* Build the complete FINALLY statement list. */
- t = next_sjlj_build_try_exit ();
- t = build_stmt (input_location, COND_EXPR,
- c_common_truthvalue_conversion
- (input_location, rethrow_decl),
- NULL, t);
- SET_EXPR_LOCATION (t, cur_try_context->finally_locus);
- append_to_statement_list (t, &TREE_OPERAND (try_fin, 1));
-
- append_to_statement_list (cur_try_context->finally_body,
- &TREE_OPERAND (try_fin, 1));
-
- t = tree_cons (NULL, rethrow_decl, NULL);
- t = build_function_call (input_location,
- objc_exception_throw_decl, t);
- t = build_stmt (input_location, COND_EXPR,
- c_common_truthvalue_conversion (input_location,
- rethrow_decl),
- t, NULL);
- SET_EXPR_LOCATION (t, cur_try_context->end_finally_locus);
- append_to_statement_list (t, &TREE_OPERAND (try_fin, 1));
-
- return bind;
-}
+static struct objc_try_context *cur_try_context;
/* Called just after parsing the @try and its associated BODY. We now
must prepare for the tricky bits -- handling the catches and finally. */
@@ -5407,6 +3927,7 @@ void
objc_begin_catch_clause (tree decl)
{
tree compound, type, t;
+ bool ellipsis = false;
/* Begin a new scope that the entire catch clause will live in. */
compound = c_begin_compound_stmt (true);
@@ -5422,6 +3943,9 @@ objc_begin_catch_clause (tree decl)
type 'id' and use it. */
decl = objc_create_temporary_var (objc_object_type, "__objc_generic_catch_var");
DECL_SOURCE_LOCATION (decl) = input_location;
+ /* ... but allow the runtime to differentiate between ellipsis and the
+ case of @catch (id xyz). */
+ ellipsis = true;
}
else
{
@@ -5441,13 +3965,13 @@ objc_begin_catch_clause (tree decl)
type = TREE_TYPE (decl);
}
- /* Verify that the type of the catch is valid. It must be a pointer
- to an Objective-C class, or "id" (which is catch-all). */
- if (type == error_mark_node)
- {
- ;/* Just keep going. */
- }
- else if (!objc_type_valid_for_messaging (type, false))
+ /* Verify that the type of the catch is valid. It must be a pointer
+ to an Objective-C class, or "id" (which is catch-all). */
+ if (type == error_mark_node)
+ {
+ ;/* Just keep going. */
+ }
+ else if (!objc_type_valid_for_messaging (type, false))
{
error ("@catch parameter is not a known Objective-C class type");
type = error_mark_node;
@@ -5458,8 +3982,10 @@ objc_begin_catch_clause (tree decl)
error ("@catch parameter can not be protocol-qualified");
type = error_mark_node;
}
- else if (objc_is_object_id (TREE_TYPE (type)))
- type = NULL;
+ else if (POINTER_TYPE_P (type) && objc_is_object_id (TREE_TYPE (type)))
+ /* @catch (id xyz) or @catch (...) but we note this for runtimes that
+ identify 'id'. */
+ ;
else
{
/* If 'type' was built using typedefs, we need to get rid of
@@ -5508,15 +4034,7 @@ objc_begin_catch_clause (tree decl)
}
}
- /* Record the data for the catch in the try context so that we can
- finalize it later. */
- t = build_stmt (input_location, CATCH_EXPR, type, compound);
- cur_try_context->current_catch = t;
-
- /* Initialize the decl from the EXC_PTR_EXPR we get from the runtime. */
- t = objc_build_exc_ptr ();
- t = convert (TREE_TYPE (decl), t);
- t = build2 (MODIFY_EXPR, void_type_node, decl, t);
+ t = (*runtime.begin_catch) (&cur_try_context, type, decl, compound, ellipsis);
add_stmt (t);
}
@@ -5531,7 +4049,8 @@ objc_finish_catch_clause (void)
cur_try_context->end_catch_locus = input_location;
CATCH_BODY (c) = c_end_compound_stmt (input_location, CATCH_BODY (c), 1);
- append_to_statement_list (c, &cur_try_context->catch_list);
+
+ (*runtime.finish_catch) (&cur_try_context, c);
}
/* Called after parsing a @finally clause and its associated BODY.
@@ -5556,34 +4075,7 @@ objc_finish_try_stmt (void)
if (c->catch_list == NULL && c->finally_body == NULL)
error ("%<@try%> without %<@catch%> or %<@finally%>");
- /* If we're doing Darwin setjmp exceptions, build the big nasty. */
- if (flag_objc_sjlj_exceptions)
- {
- bool save = in_late_binary_op;
- in_late_binary_op = true;
- if (!cur_try_context->finally_body)
- {
- cur_try_context->finally_locus = input_location;
- cur_try_context->end_finally_locus = input_location;
- }
- stmt = next_sjlj_build_try_catch_finally ();
- in_late_binary_op = save;
- }
- else
- {
- /* Otherwise, nest the CATCH inside a FINALLY. */
- stmt = c->try_body;
- if (c->catch_list)
- {
- stmt = build_stmt (input_location, TRY_CATCH_EXPR, stmt, c->catch_list);
- SET_EXPR_LOCATION (stmt, cur_try_context->try_locus);
- }
- if (c->finally_body)
- {
- stmt = build_stmt (input_location, TRY_FINALLY_EXPR, stmt, c->finally_body);
- SET_EXPR_LOCATION (stmt, cur_try_context->try_locus);
- }
- }
+ stmt = (*runtime.finish_try_stmt) (&cur_try_context);
add_stmt (stmt);
cur_try_context = c->outer;
@@ -5594,10 +4086,14 @@ objc_finish_try_stmt (void)
tree
objc_build_throw_stmt (location_t loc, tree throw_expr)
{
- tree args;
+ bool rethrown = false;
objc_maybe_warn_exceptions (loc);
+ /* Don't waste time trying to build something if we're already dead. */
+ if (throw_expr == error_mark_node)
+ return error_mark_node;
+
if (throw_expr == NULL)
{
/* If we're not inside a @catch block, there is no "current
@@ -5611,9 +4107,10 @@ objc_build_throw_stmt (location_t loc, tree throw_expr)
/* Otherwise the object is still sitting in the EXC_PTR_EXPR
value that we get from the runtime. */
- throw_expr = objc_build_exc_ptr ();
+ throw_expr = (*runtime.build_exc_ptr) (&cur_try_context);
+ rethrown = true;
}
- else if (throw_expr != error_mark_node)
+ else
{
if (!objc_type_valid_for_messaging (TREE_TYPE (throw_expr), true))
{
@@ -5622,11 +4119,7 @@ objc_build_throw_stmt (location_t loc, tree throw_expr)
}
}
- /* A throw is just a call to the runtime throw function with the
- object as a parameter. */
- args = tree_cons (NULL, throw_expr, NULL);
- return add_stmt (build_function_call (loc,
- objc_exception_throw_decl, args));
+ return (*runtime.build_throw_stmt) (loc, throw_expr, rethrown);
}
tree
@@ -5685,143 +4178,6 @@ objc_build_synchronized (location_t start_locus, tree object_expr, tree body)
}
}
-
-/* Predefine the following data type:
-
- struct _objc_exception_data
- {
- int buf[OBJC_JBLEN];
- void *pointers[4];
- }; */
-
-/* The following yuckiness should prevent users from having to #include
- <setjmp.h> in their code... */
-
-/* Define to a harmless positive value so the below code doesn't die. */
-#ifndef OBJC_JBLEN
-#define OBJC_JBLEN 18
-#endif
-
-static void
-build_next_objc_exception_stuff (void)
-{
- tree decls, temp_type, *chain = NULL;
-
- objc_exception_data_template
- = objc_start_struct (get_identifier (UTAG_EXCDATA));
-
- /* int buf[OBJC_JBLEN]; */
-
- temp_type = build_sized_array_type (integer_type_node, OBJC_JBLEN);
- decls = add_field_decl (temp_type, "buf", &chain);
-
- /* void *pointers[4]; */
-
- temp_type = build_sized_array_type (ptr_type_node, 4);
- add_field_decl (temp_type, "pointers", &chain);
-
- objc_finish_struct (objc_exception_data_template, decls);
-
- /* int _setjmp(...); */
- /* If the user includes <setjmp.h>, this shall be superseded by
- 'int _setjmp(jmp_buf);' */
- temp_type = build_varargs_function_type_list (integer_type_node, NULL_TREE);
- objc_setjmp_decl
- = add_builtin_function (TAG_SETJMP, temp_type, 0, NOT_BUILT_IN, NULL, NULL_TREE);
-
- /* id objc_exception_extract(struct _objc_exception_data *); */
- temp_type
- = build_function_type_list (objc_object_type,
- build_pointer_type (objc_exception_data_template),
- NULL_TREE);
- objc_exception_extract_decl
- = add_builtin_function (TAG_EXCEPTIONEXTRACT, temp_type, 0, NOT_BUILT_IN, NULL,
- NULL_TREE);
- /* void objc_exception_try_enter(struct _objc_exception_data *); */
- /* void objc_exception_try_exit(struct _objc_exception_data *); */
- temp_type
- = build_function_type_list (void_type_node,
- build_pointer_type (objc_exception_data_template),
- NULL_TREE);
- objc_exception_try_enter_decl
- = add_builtin_function (TAG_EXCEPTIONTRYENTER, temp_type, 0, NOT_BUILT_IN, NULL,
- NULL_TREE);
- objc_exception_try_exit_decl
- = add_builtin_function (TAG_EXCEPTIONTRYEXIT, temp_type, 0, NOT_BUILT_IN, NULL,
- NULL_TREE);
-
- /* int objc_exception_match(id, id); */
- temp_type
- = build_function_type_list (integer_type_node,
- objc_object_type, objc_object_type, NULL_TREE);
- objc_exception_match_decl
- = add_builtin_function (TAG_EXCEPTIONMATCH, temp_type, 0, NOT_BUILT_IN, NULL,
- NULL_TREE);
-
- /* id objc_assign_ivar (id, id, unsigned int); */
- /* id objc_assign_ivar_Fast (id, id, unsigned int)
- __attribute__ ((hard_coded_address (OFFS_ASSIGNIVAR_FAST))); */
- temp_type
- = build_function_type_list (objc_object_type,
- objc_object_type,
- objc_object_type,
- unsigned_type_node,
- NULL_TREE);
- objc_assign_ivar_decl
- = add_builtin_function (TAG_ASSIGNIVAR, temp_type, 0, NOT_BUILT_IN,
- NULL, NULL_TREE);
-#ifdef OFFS_ASSIGNIVAR_FAST
- objc_assign_ivar_fast_decl
- = add_builtin_function (TAG_ASSIGNIVAR_FAST, temp_type, 0,
- NOT_BUILT_IN, NULL, NULL_TREE);
- DECL_ATTRIBUTES (objc_assign_ivar_fast_decl)
- = tree_cons (get_identifier ("hard_coded_address"),
- build_int_cst (NULL_TREE, OFFS_ASSIGNIVAR_FAST),
- NULL_TREE);
-#else
- /* Default to slower ivar method. */
- objc_assign_ivar_fast_decl = objc_assign_ivar_decl;
-#endif
-
- /* id objc_assign_global (id, id *); */
- /* id objc_assign_strongCast (id, id *); */
- temp_type = build_function_type_list (objc_object_type,
- objc_object_type,
- build_pointer_type (objc_object_type),
- NULL_TREE);
- objc_assign_global_decl
- = add_builtin_function (TAG_ASSIGNGLOBAL, temp_type, 0, NOT_BUILT_IN, NULL,
- NULL_TREE);
- objc_assign_strong_cast_decl
- = add_builtin_function (TAG_ASSIGNSTRONGCAST, temp_type, 0, NOT_BUILT_IN, NULL,
- NULL_TREE);
-}
-
-static void
-build_objc_exception_stuff (void)
-{
- tree noreturn_list, nothrow_list, temp_type;
-
- noreturn_list = tree_cons (get_identifier ("noreturn"), NULL, NULL);
- nothrow_list = tree_cons (get_identifier ("nothrow"), NULL, NULL);
-
- /* void objc_exception_throw(id) __attribute__((noreturn)); */
- /* void objc_sync_enter(id); */
- /* void objc_sync_exit(id); */
- temp_type = build_function_type_list (void_type_node,
- objc_object_type,
- NULL_TREE);
- objc_exception_throw_decl
- = add_builtin_function (TAG_EXCEPTIONTHROW, temp_type, 0, NOT_BUILT_IN, NULL,
- noreturn_list);
- objc_sync_enter_decl
- = add_builtin_function (TAG_SYNCENTER, temp_type, 0, NOT_BUILT_IN,
- NULL, nothrow_list);
- objc_sync_exit_decl
- = add_builtin_function (TAG_SYNCEXIT, temp_type, 0, NOT_BUILT_IN,
- NULL, nothrow_list);
-}
-
/* Construct a C struct corresponding to ObjC class CLASS, with the same
name as the class:
@@ -5849,118 +4205,8 @@ build_private_template (tree klass)
TREE_DEPRECATED (record) = 1;
}
}
-
-/* Begin code generation for protocols... */
-
-/* struct _objc_protocol {
- struct _objc_class *isa;
- char *protocol_name;
- struct _objc_protocol **protocol_list;
- struct _objc__method_prototype_list *instance_methods;
- struct _objc__method_prototype_list *class_methods;
- }; */
-
-static void
-build_protocol_template (void)
-{
- tree ptype, decls, *chain = NULL;
-
- objc_protocol_template = objc_start_struct (get_identifier (UTAG_PROTOCOL));
-
- /* struct _objc_class *isa; */
- ptype = build_pointer_type (xref_tag (RECORD_TYPE,
- get_identifier (UTAG_CLASS)));
- decls = add_field_decl (ptype, "isa", &chain);
- /* char *protocol_name; */
- add_field_decl (string_type_node, "protocol_name", &chain);
-
- /* struct _objc_protocol **protocol_list; */
- ptype = build_pointer_type (build_pointer_type (objc_protocol_template));
- add_field_decl (ptype, "protocol_list", &chain);
-
- /* struct _objc__method_prototype_list *instance_methods; */
- add_field_decl (objc_method_proto_list_ptr, "instance_methods", &chain);
-
- /* struct _objc__method_prototype_list *class_methods; */
- add_field_decl (objc_method_proto_list_ptr, "class_methods", &chain);
-
- objc_finish_struct (objc_protocol_template, decls);
-}
-
-static tree
-build_descriptor_table_initializer (tree type, tree entries)
-{
- VEC(constructor_elt,gc) *inits = NULL;
-
- do
- {
- VEC(constructor_elt,gc) *elts = NULL;
-
- CONSTRUCTOR_APPEND_ELT (elts, NULL_TREE,
- build_selector (METHOD_SEL_NAME (entries)));
- CONSTRUCTOR_APPEND_ELT (elts, NULL_TREE,
- add_objc_string (METHOD_ENCODING (entries),
- meth_var_types));
-
- CONSTRUCTOR_APPEND_ELT (inits, NULL_TREE,
- objc_build_constructor (type, elts));
-
- entries = DECL_CHAIN (entries);
- }
- while (entries);
-
- return objc_build_constructor (build_array_type (type, 0), inits);
-}
-
-/* struct objc_method_prototype_list {
- int count;
- struct objc_method_prototype {
- SEL name;
- char *types;
- } list[1];
- }; */
-
-static tree
-build_method_prototype_list_template (tree list_type, int size)
-{
- tree objc_ivar_list_record;
- tree array_type, decls, *chain = NULL;
-
- /* Generate an unnamed struct definition. */
-
- objc_ivar_list_record = objc_start_struct (NULL_TREE);
-
- /* int method_count; */
- decls = add_field_decl (integer_type_node, "method_count", &chain);
-
- /* struct objc_method method_list[]; */
- array_type = build_sized_array_type (list_type, size);
- add_field_decl (array_type, "method_list", &chain);
-
- objc_finish_struct (objc_ivar_list_record, decls);
-
- return objc_ivar_list_record;
-}
-
-static tree
-build_method_prototype_template (void)
-{
- tree proto_record;
- tree decls, *chain = NULL;
-
- proto_record = objc_start_struct (get_identifier (UTAG_METHOD_PROTOTYPE));
-
- /* SEL _cmd; */
- decls = add_field_decl (objc_selector_type, "_cmd", &chain);
-
- /* char *method_types; */
- add_field_decl (string_type_node, "method_types", &chain);
-
- objc_finish_struct (proto_record, decls);
-
- return proto_record;
-}
+/* Begin code generation for protocols... */
static tree
objc_method_parm_type (tree type)
@@ -5992,7 +4238,8 @@ objc_encoded_type_size (tree type)
The format is described in gcc/doc/objc.texi, section 'Method
signatures'.
*/
-static tree
+
+tree
encode_method_prototype (tree method_decl)
{
tree parms;
@@ -6063,96 +4310,6 @@ encode_method_prototype (tree method_decl)
return result;
}
-static tree
-generate_descriptor_table (tree type, const char *name, int size, tree list,
- tree proto)
-{
- tree decl;
- VEC(constructor_elt,gc) *v = NULL;
-
- decl = start_var_decl (type, synth_id_with_class_suffix (name, proto));
-
- CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, build_int_cst (NULL_TREE, size));
- CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, list);
-
- finish_var_decl (decl, objc_build_constructor (type, v));
-
- return decl;
-}
-
-static void
-generate_method_descriptors (tree protocol)
-{
- tree initlist, chain, method_list_template;
- int size;
-
- if (!objc_method_prototype_template)
- objc_method_prototype_template = build_method_prototype_template ();
-
- chain = PROTOCOL_CLS_METHODS (protocol);
- if (chain)
- {
- size = list_length (chain);
-
- method_list_template
- = build_method_prototype_list_template (objc_method_prototype_template,
- size);
-
- initlist
- = build_descriptor_table_initializer (objc_method_prototype_template,
- chain);
-
- UOBJC_CLASS_METHODS_decl
- = generate_descriptor_table (method_list_template,
- "_OBJC_PROTOCOL_CLASS_METHODS",
- size, initlist, protocol);
- }
- else
- UOBJC_CLASS_METHODS_decl = 0;
-
- chain = PROTOCOL_NST_METHODS (protocol);
- if (chain)
- {
- size = list_length (chain);
-
- method_list_template
- = build_method_prototype_list_template (objc_method_prototype_template,
- size);
- initlist
- = build_descriptor_table_initializer (objc_method_prototype_template,
- chain);
-
- UOBJC_INSTANCE_METHODS_decl
- = generate_descriptor_table (method_list_template,
- "_OBJC_PROTOCOL_INSTANCE_METHODS",
- size, initlist, protocol);
- }
- else
- UOBJC_INSTANCE_METHODS_decl = 0;
-}
-
-static void
-generate_protocol_references (tree plist)
-{
- tree lproto;
-
- /* Forward declare protocols referenced. */
- for (lproto = plist; lproto; lproto = TREE_CHAIN (lproto))
- {
- tree proto = TREE_VALUE (lproto);
-
- if (TREE_CODE (proto) == PROTOCOL_INTERFACE_TYPE
- && PROTOCOL_NAME (proto))
- {
- if (! PROTOCOL_FORWARD_DECL (proto))
- build_protocol_reference (proto);
-
- if (PROTOCOL_LIST (proto))
- generate_protocol_references (PROTOCOL_LIST (proto));
- }
- }
-}
-
/* Generate either '- .cxx_construct' or '- .cxx_destruct' for the
current class. */
#ifdef OBJCPLUS
@@ -6282,346 +4439,11 @@ objc_generate_cxx_cdtors (void)
/* The 'imp_list' variable points at an imp_entry record for the current
@implementation. Record the existence of '- .cxx_construct' and/or
'- .cxx_destruct' methods therein; it will be included in the
- metadata for the class. */
- if (flag_next_runtime)
- imp_list->has_cxx_cdtors = (need_ctor || need_dtor);
+ metadata for the class if the runtime needs it. */
+ imp_list->has_cxx_cdtors = (need_ctor || need_dtor);
}
#endif
-/* For each protocol which was referenced either from a @protocol()
- expression, or because a class/category implements it (then a
- pointer to the protocol is stored in the struct describing the
- class/category), we create a statically allocated instance of the
- Protocol class. The code is written in such a way as to generate
- as few Protocol objects as possible; we generate a unique Protocol
- instance for each protocol, and we don't generate a Protocol
- instance if the protocol is never referenced (either from a
- @protocol() or from a class/category implementation). These
- statically allocated objects can be referred to via the static
- (that is, private to this module) symbols _OBJC_PROTOCOL_n.
-
- The statically allocated Protocol objects that we generate here
- need to be fixed up at runtime in order to be used: the 'isa'
- pointer of the objects need to be set up to point to the 'Protocol'
- class, as known at runtime.
-
- The NeXT runtime fixes up all protocols at program startup time,
- before main() is entered. It uses a low-level trick to look up all
- those symbols, then loops on them and fixes them up.
-
- The GNU runtime as well fixes up all protocols before user code
- from the module is executed; it requires pointers to those symbols
- to be put in the objc_symtab (which is then passed as argument to
- the function __objc_exec_class() which the compiler sets up to be
- executed automatically when the module is loaded); setup of those
- Protocol objects happen in two ways in the GNU runtime: all
- Protocol objects referred to by a class or category implementation
- are fixed up when the class/category is loaded; all Protocol
- objects referred to by a @protocol() expression are added by the
- compiler to the list of statically allocated instances to fixup
- (the same list holding the statically allocated constant string
- objects). Because, as explained above, the compiler generates as
- few Protocol objects as possible, some Protocol object might end up
- being referenced multiple times when compiled with the GNU runtime,
- and end up being fixed up multiple times at runtime initialization.
- But that doesn't hurt, it's just a little inefficient. */
-
-static void
-generate_protocols (void)
-{
- tree p, encoding;
- tree decl;
- tree initlist, protocol_name_expr, refs_decl, refs_expr;
-
- /* If a protocol was directly referenced, pull in indirect references. */
- for (p = protocol_chain; p; p = TREE_CHAIN (p))
- if (PROTOCOL_FORWARD_DECL (p) && PROTOCOL_LIST (p))
- generate_protocol_references (PROTOCOL_LIST (p));
-
- for (p = protocol_chain; p; p = TREE_CHAIN (p))
- {
- tree nst_methods = PROTOCOL_NST_METHODS (p);
- tree cls_methods = PROTOCOL_CLS_METHODS (p);
-
- /* If protocol wasn't referenced, don't generate any code. */
- decl = PROTOCOL_FORWARD_DECL (p);
-
- if (!decl)
- continue;
-
- /* Make sure we link in the Protocol class. */
- add_class_reference (get_identifier (PROTOCOL_OBJECT_CLASS_NAME));
-
- while (nst_methods)
- {
- if (! METHOD_ENCODING (nst_methods))
- {
- encoding = encode_method_prototype (nst_methods);
- METHOD_ENCODING (nst_methods) = encoding;
- }
- nst_methods = DECL_CHAIN (nst_methods);
- }
-
- while (cls_methods)
- {
- if (! METHOD_ENCODING (cls_methods))
- {
- encoding = encode_method_prototype (cls_methods);
- METHOD_ENCODING (cls_methods) = encoding;
- }
-
- cls_methods = DECL_CHAIN (cls_methods);
- }
- generate_method_descriptors (p);
-
- if (PROTOCOL_LIST (p))
- refs_decl = generate_protocol_list (p);
- else
- refs_decl = 0;
-
- /* static struct objc_protocol _OBJC_PROTOCOL_<mumble>; */
- protocol_name_expr = add_objc_string (PROTOCOL_NAME (p), class_names);
-
- if (refs_decl)
- refs_expr = convert (build_pointer_type (build_pointer_type
- (objc_protocol_template)),
- build_unary_op (input_location,
- ADDR_EXPR, refs_decl, 0));
- else
- refs_expr = build_int_cst (NULL_TREE, 0);
-
- /* UOBJC_INSTANCE_METHODS_decl/UOBJC_CLASS_METHODS_decl are set
- by generate_method_descriptors, which is called above. */
- initlist = build_protocol_initializer (TREE_TYPE (decl),
- protocol_name_expr, refs_expr,
- UOBJC_INSTANCE_METHODS_decl,
- UOBJC_CLASS_METHODS_decl);
- finish_var_decl (decl, initlist);
- }
-}
-
-static tree
-build_protocol_initializer (tree type, tree protocol_name,
- tree protocol_list, tree instance_methods,
- tree class_methods)
-{
- tree expr;
- tree cast_type = build_pointer_type
- (xref_tag (RECORD_TYPE,
- get_identifier (UTAG_CLASS)));
- VEC(constructor_elt,gc) *inits = NULL;
-
- /* Filling the "isa" in with one allows the runtime system to
- detect that the version change...should remove before final release. */
-
- expr = build_int_cst (cast_type, PROTOCOL_VERSION);
- CONSTRUCTOR_APPEND_ELT (inits, NULL_TREE, expr);
- CONSTRUCTOR_APPEND_ELT (inits, NULL_TREE, protocol_name);
- CONSTRUCTOR_APPEND_ELT (inits, NULL_TREE, protocol_list);
-
- if (!instance_methods)
- CONSTRUCTOR_APPEND_ELT (inits, NULL_TREE, build_int_cst (NULL_TREE, 0));
- else
- {
- expr = convert (objc_method_proto_list_ptr,
- build_unary_op (input_location,
- ADDR_EXPR, instance_methods, 0));
- CONSTRUCTOR_APPEND_ELT (inits, NULL_TREE, expr);
- }
-
- if (!class_methods)
- CONSTRUCTOR_APPEND_ELT (inits, NULL_TREE, build_int_cst (NULL_TREE, 0));
- else
- {
- expr = convert (objc_method_proto_list_ptr,
- build_unary_op (input_location,
- ADDR_EXPR, class_methods, 0));
- CONSTRUCTOR_APPEND_ELT (inits, NULL_TREE, expr);
- }
-
- return objc_build_constructor (type, inits);
-}
-
-/* struct _objc_category {
- char *category_name;
- char *class_name;
- struct _objc_method_list *instance_methods;
- struct _objc_method_list *class_methods;
- struct _objc_protocol_list *protocols;
- }; */
-
-static void
-build_category_template (void)
-{
- tree ptype, decls, *chain = NULL;
-
- objc_category_template = objc_start_struct (get_identifier (UTAG_CATEGORY));
-
- /* char *category_name; */
- decls = add_field_decl (string_type_node, "category_name", &chain);
-
- /* char *class_name; */
- add_field_decl (string_type_node, "class_name", &chain);
-
- /* struct _objc_method_list *instance_methods; */
- add_field_decl (objc_method_list_ptr, "instance_methods", &chain);
-
- /* struct _objc_method_list *class_methods; */
- add_field_decl (objc_method_list_ptr, "class_methods", &chain);
-
- /* struct _objc_protocol **protocol_list; */
- ptype = build_pointer_type (build_pointer_type (objc_protocol_template));
- add_field_decl (ptype, "protocol_list", &chain);
-
- objc_finish_struct (objc_category_template, decls);
-}
-
-/* struct _objc_selector {
- SEL sel_id;
- char *sel_type;
- }; */
-
-static void
-build_selector_template (void)
-{
- tree decls, *chain = NULL;
-
- objc_selector_template = objc_start_struct (get_identifier (UTAG_SELECTOR));
-
- /* SEL sel_id; */
- decls = add_field_decl (objc_selector_type, "sel_id", &chain);
-
- /* char *sel_type; */
- add_field_decl (string_type_node, "sel_type", &chain);
-
- objc_finish_struct (objc_selector_template, decls);
-}
-
-/* struct _objc_class {
- struct _objc_class *isa;
- struct _objc_class *super_class;
- char *name;
- long version;
- long info;
- long instance_size;
- struct _objc_ivar_list *ivars;
- struct _objc_method_list *methods;
- #ifdef __NEXT_RUNTIME__
- struct objc_cache *cache;
- #else
- struct sarray *dtable;
- struct _objc_class *subclass_list;
- struct _objc_class *sibling_class;
- #endif
- struct _objc_protocol_list *protocols;
- #ifdef __NEXT_RUNTIME__
- void *sel_id;
- #endif
- void *gc_object_type;
- }; */
-
-/* NB: The 'sel_id' and 'gc_object_type' fields are not being used by
- the NeXT/Apple runtime; still, the compiler must generate them to
- maintain backward binary compatibility (and to allow for future
- expansion). */
-
-static void
-build_class_template (void)
-{
- tree ptype, decls, *chain = NULL;
-
- objc_class_template = objc_start_struct (get_identifier (UTAG_CLASS));
-
- /* struct _objc_class *isa; */
- decls = add_field_decl (build_pointer_type (objc_class_template),
- "isa", &chain);
-
- /* struct _objc_class *super_class; */
- add_field_decl (build_pointer_type (objc_class_template),
- "super_class", &chain);
-
- /* char *name; */
- add_field_decl (string_type_node, "name", &chain);
-
- /* long version; */
- add_field_decl (long_integer_type_node, "version", &chain);
-
- /* long info; */
- add_field_decl (long_integer_type_node, "info", &chain);
-
- /* long instance_size; */
- add_field_decl (long_integer_type_node, "instance_size", &chain);
-
- /* struct _objc_ivar_list *ivars; */
- add_field_decl (objc_ivar_list_ptr,"ivars", &chain);
-
- /* struct _objc_method_list *methods; */
- add_field_decl (objc_method_list_ptr, "methods", &chain);
-
- if (flag_next_runtime)
- {
- /* struct objc_cache *cache; */
- ptype = build_pointer_type (xref_tag (RECORD_TYPE,
- get_identifier ("objc_cache")));
- add_field_decl (ptype, "cache", &chain);
- }
- else
- {
- /* struct sarray *dtable; */
- ptype = build_pointer_type(xref_tag (RECORD_TYPE,
- get_identifier ("sarray")));
- add_field_decl (ptype, "dtable", &chain);
-
- /* struct objc_class *subclass_list; */
- ptype = build_pointer_type (objc_class_template);
- add_field_decl (ptype, "subclass_list", &chain);
-
- /* struct objc_class *sibling_class; */
- ptype = build_pointer_type (objc_class_template);
- add_field_decl (ptype, "sibling_class", &chain);
- }
-
- /* struct _objc_protocol **protocol_list; */
- ptype = build_pointer_type (build_pointer_type
- (xref_tag (RECORD_TYPE,
- get_identifier (UTAG_PROTOCOL))));
- add_field_decl (ptype, "protocol_list", &chain);
-
- if (flag_next_runtime)
- {
- /* void *sel_id; */
- add_field_decl (build_pointer_type (void_type_node), "sel_id", &chain);
- }
-
- /* void *gc_object_type; */
- add_field_decl (build_pointer_type (void_type_node),
- "gc_object_type", &chain);
-
- objc_finish_struct (objc_class_template, decls);
-}
-
-/* Generate appropriate forward declarations for an implementation. */
-
-static void
-synth_forward_declarations (void)
-{
- tree an_id;
-
- /* static struct objc_class _OBJC_CLASS_<my_name>; */
- UOBJC_CLASS_decl = build_metadata_decl ("_OBJC_CLASS",
- objc_class_template);
-
- /* static struct objc_class _OBJC_METACLASS_<my_name>; */
- UOBJC_METACLASS_decl = build_metadata_decl ("_OBJC_METACLASS",
- objc_class_template);
-
- /* Pre-build the following entities - for speed/convenience. */
-
- an_id = get_identifier ("super_class");
- ucls_super_ref = objc_build_component_ref (UOBJC_CLASS_decl, an_id);
- uucls_super_ref = objc_build_component_ref (UOBJC_METACLASS_decl, an_id);
-}
-
static void
error_with_ivar (const char *message, tree decl)
{
@@ -6685,322 +4507,6 @@ check_ivars (tree inter, tree imp)
}
}
-/* Set 'objc_super_template' to the data type node for 'struct _objc_super'.
- This needs to be done just once per compilation. */
-
-/* struct _objc_super {
- struct _objc_object *self;
- struct _objc_class *super_class;
- }; */
-
-static void
-build_super_template (void)
-{
- tree decls, *chain = NULL;
-
- objc_super_template = objc_start_struct (get_identifier (UTAG_SUPER));
-
- /* struct _objc_object *self; */
- decls = add_field_decl (objc_object_type, "self", &chain);
-
- /* struct _objc_class *super_class; */
- add_field_decl (build_pointer_type (objc_class_template),
- "super_class", &chain);
-
- objc_finish_struct (objc_super_template, decls);
-}
-
-/* struct _objc_ivar {
- char *ivar_name;
- char *ivar_type;
- int ivar_offset;
- }; */
-
-static tree
-build_ivar_template (void)
-{
- tree objc_ivar_id, objc_ivar_record;
- tree decls, *chain = NULL;
-
- objc_ivar_id = get_identifier (UTAG_IVAR);
- objc_ivar_record = objc_start_struct (objc_ivar_id);
-
- /* char *ivar_name; */
- decls = add_field_decl (string_type_node, "ivar_name", &chain);
-
- /* char *ivar_type; */
- add_field_decl (string_type_node, "ivar_type", &chain);
-
- /* int ivar_offset; */
- add_field_decl (integer_type_node, "ivar_offset", &chain);
-
- objc_finish_struct (objc_ivar_record, decls);
-
- return objc_ivar_record;
-}
-
-/* struct {
- int ivar_count;
- struct objc_ivar ivar_list[ivar_count];
- }; */
-
-static tree
-build_ivar_list_template (tree list_type, int size)
-{
- tree objc_ivar_list_record;
- tree array_type, decls, *chain = NULL;
-
- objc_ivar_list_record = objc_start_struct (NULL_TREE);
-
- /* int ivar_count; */
- decls = add_field_decl (integer_type_node, "ivar_count", &chain);
-
- /* struct objc_ivar ivar_list[]; */
- array_type = build_sized_array_type (list_type, size);
- add_field_decl (array_type, "ivar_list", &chain);
-
- objc_finish_struct (objc_ivar_list_record, decls);
-
- return objc_ivar_list_record;
-}
-
-/* struct {
- struct _objc__method_prototype_list *method_next;
- int method_count;
- struct objc_method method_list[method_count];
- }; */
-
-static tree
-build_method_list_template (tree list_type, int size)
-{
- tree objc_ivar_list_record;
- tree array_type, decls, *chain = NULL;
-
- objc_ivar_list_record = objc_start_struct (NULL_TREE);
-
- /* struct _objc__method_prototype_list *method_next; */
- decls = add_field_decl (objc_method_proto_list_ptr, "method_next", &chain);
-
- /* int method_count; */
- add_field_decl (integer_type_node, "method_count", &chain);
-
- /* struct objc_method method_list[]; */
- array_type = build_sized_array_type (list_type, size);
- add_field_decl (array_type, "method_list", &chain);
-
- objc_finish_struct (objc_ivar_list_record, decls);
-
- return objc_ivar_list_record;
-}
-
-static tree
-build_ivar_list_initializer (tree type, tree field_decl)
-{
- VEC(constructor_elt,gc) *inits = NULL;
-
- do
- {
- VEC(constructor_elt,gc) *ivar = NULL;
- tree id;
-
- /* Set name. */
- if (DECL_NAME (field_decl))
- CONSTRUCTOR_APPEND_ELT (ivar, NULL_TREE,
- add_objc_string (DECL_NAME (field_decl),
- meth_var_names));
- else
- /* Unnamed bit-field ivar (yuck). */
- CONSTRUCTOR_APPEND_ELT (ivar, NULL_TREE, build_int_cst (NULL_TREE, 0));
-
- /* Set type. */
- encode_field_decl (field_decl,
- obstack_object_size (&util_obstack),
- OBJC_ENCODE_DONT_INLINE_DEFS);
-
- /* Null terminate string. */
- obstack_1grow (&util_obstack, 0);
- id = add_objc_string (get_identifier (XOBFINISH (&util_obstack, char *)),
- meth_var_types);
- CONSTRUCTOR_APPEND_ELT (ivar, NULL_TREE, id);
- obstack_free (&util_obstack, util_firstobj);
-
- /* Set offset. */
- CONSTRUCTOR_APPEND_ELT (ivar, NULL_TREE, byte_position (field_decl));
- CONSTRUCTOR_APPEND_ELT (inits, NULL_TREE,
- objc_build_constructor (type, ivar));
- do
- field_decl = DECL_CHAIN (field_decl);
- while (field_decl && TREE_CODE (field_decl) != FIELD_DECL);
- }
- while (field_decl);
-
- return objc_build_constructor (build_array_type (type, 0), inits);
-}
-
-static tree
-generate_ivars_list (tree type, const char *name, int size, tree list)
-{
- tree decl;
- VEC(constructor_elt,gc) *inits = NULL;
-
- decl = start_var_decl (type, synth_id_with_class_suffix
- (name, objc_implementation_context));
-
- CONSTRUCTOR_APPEND_ELT (inits, NULL_TREE, build_int_cst (NULL_TREE, size));
- CONSTRUCTOR_APPEND_ELT (inits, NULL_TREE, list);
-
- finish_var_decl (decl,
- objc_build_constructor (TREE_TYPE (decl), inits));
-
- return decl;
-}
-
-/* Count only the fields occurring in T. */
-
-static int
-ivar_list_length (tree t)
-{
- int count = 0;
-
- for (; t; t = DECL_CHAIN (t))
- if (TREE_CODE (t) == FIELD_DECL)
- ++count;
-
- return count;
-}
-
-static void
-generate_ivar_lists (void)
-{
- tree initlist, ivar_list_template, chain;
- int size;
-
- generating_instance_variables = 1;
-
- if (!objc_ivar_template)
- objc_ivar_template = build_ivar_template ();
-
- /* Only generate class variables for the root of the inheritance
- hierarchy since these will be the same for every class. */
-
- if (CLASS_SUPER_NAME (implementation_template) == NULL_TREE
- && (chain = TYPE_FIELDS (objc_class_template)))
- {
- size = ivar_list_length (chain);
-
- ivar_list_template = build_ivar_list_template (objc_ivar_template, size);
- initlist = build_ivar_list_initializer (objc_ivar_template, chain);
-
- UOBJC_CLASS_VARIABLES_decl
- = generate_ivars_list (ivar_list_template, "_OBJC_CLASS_VARIABLES",
- size, initlist);
- }
- else
- UOBJC_CLASS_VARIABLES_decl = 0;
-
- chain = CLASS_IVARS (implementation_template);
- if (chain)
- {
- size = ivar_list_length (chain);
- ivar_list_template = build_ivar_list_template (objc_ivar_template, size);
- initlist = build_ivar_list_initializer (objc_ivar_template, chain);
-
- UOBJC_INSTANCE_VARIABLES_decl
- = generate_ivars_list (ivar_list_template, "_OBJC_INSTANCE_VARIABLES",
- size, initlist);
- }
- else
- UOBJC_INSTANCE_VARIABLES_decl = 0;
-
- generating_instance_variables = 0;
-}
-
-static tree
-build_dispatch_table_initializer (tree type, tree entries)
-{
- VEC(constructor_elt,gc) *inits = NULL;
-
- do
- {
- VEC(constructor_elt,gc) *elems = NULL;
- tree expr;
-
- CONSTRUCTOR_APPEND_ELT (elems, NULL_TREE,
- build_selector (METHOD_SEL_NAME (entries)));
-
- /* Generate the method encoding if we don't have one already. */
- if (! METHOD_ENCODING (entries))
- METHOD_ENCODING (entries) =
- encode_method_prototype (entries);
-
- CONSTRUCTOR_APPEND_ELT (elems, NULL_TREE,
- add_objc_string (METHOD_ENCODING (entries),
- meth_var_types));
-
- expr = convert (ptr_type_node,
- build_unary_op (input_location, ADDR_EXPR,
- METHOD_DEFINITION (entries), 1));
- CONSTRUCTOR_APPEND_ELT (elems, NULL_TREE, expr);
-
- CONSTRUCTOR_APPEND_ELT (inits, NULL_TREE,
- objc_build_constructor (type, elems));
-
- entries = DECL_CHAIN (entries);
- }
- while (entries);
-
- return objc_build_constructor (build_array_type (type, 0), inits);
-}
-
-/* To accomplish method prototyping without generating all kinds of
- inane warnings, the definition of the dispatch table entries were
- changed from:
-
- struct objc_method { SEL _cmd; ...; id (*_imp)(); };
- to:
- struct objc_method { SEL _cmd; ...; void *_imp; }; */
-
-static tree
-build_method_template (void)
-{
- tree _SLT_record;
- tree decls, *chain = NULL;
-
- _SLT_record = objc_start_struct (get_identifier (UTAG_METHOD));
-
- /* SEL _cmd; */
- decls = add_field_decl (objc_selector_type, "_cmd", &chain);
-
- /* char *method_types; */
- add_field_decl (string_type_node, "method_types", &chain);
-
- /* void *_imp; */
- add_field_decl (build_pointer_type (void_type_node), "_imp", &chain);
-
- objc_finish_struct (_SLT_record, decls);
-
- return _SLT_record;
-}
-
-
-static tree
-generate_dispatch_table (tree type, const char *name, int size, tree list)
-{
- tree decl;
- VEC(constructor_elt,gc) *v = NULL;
-
- decl = start_var_decl (type, synth_id_with_class_suffix
- (name, objc_implementation_context));
-
- CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, integer_zero_node);
- CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, build_int_cst (integer_type_node, size));
- CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, list);
-
- finish_var_decl (decl,
- objc_build_constructor (TREE_TYPE (decl), v));
-
- return decl;
-}
static void
mark_referenced_methods (void)
@@ -7026,477 +4532,6 @@ mark_referenced_methods (void)
}
}
-static void
-generate_dispatch_tables (void)
-{
- tree initlist, chain, method_list_template;
- int size;
-
- if (!objc_method_template)
- objc_method_template = build_method_template ();
-
- chain = CLASS_CLS_METHODS (objc_implementation_context);
- if (chain)
- {
- size = list_length (chain);
-
- method_list_template
- = build_method_list_template (objc_method_template, size);
- initlist
- = build_dispatch_table_initializer (objc_method_template, chain);
-
- UOBJC_CLASS_METHODS_decl
- = generate_dispatch_table (method_list_template,
- ((TREE_CODE (objc_implementation_context)
- == CLASS_IMPLEMENTATION_TYPE)
- ? "_OBJC_CLASS_METHODS"
- : "_OBJC_CATEGORY_CLASS_METHODS"),
- size, initlist);
- }
- else
- UOBJC_CLASS_METHODS_decl = 0;
-
- chain = CLASS_NST_METHODS (objc_implementation_context);
- if (chain)
- {
- size = list_length (chain);
-
- method_list_template
- = build_method_list_template (objc_method_template, size);
- initlist
- = build_dispatch_table_initializer (objc_method_template, chain);
-
- if (TREE_CODE (objc_implementation_context) == CLASS_IMPLEMENTATION_TYPE)
- UOBJC_INSTANCE_METHODS_decl
- = generate_dispatch_table (method_list_template,
- "_OBJC_INSTANCE_METHODS",
- size, initlist);
- else
- /* We have a category. */
- UOBJC_INSTANCE_METHODS_decl
- = generate_dispatch_table (method_list_template,
- "_OBJC_CATEGORY_INSTANCE_METHODS",
- size, initlist);
- }
- else
- UOBJC_INSTANCE_METHODS_decl = 0;
-}
-
-static tree
-generate_protocol_list (tree i_or_p)
-{
- tree array_type, ptype, refs_decl, lproto, e, plist;
- int size = 0;
- const char *ref_name;
- VEC(constructor_elt,gc) *v = NULL;
-
- switch (TREE_CODE (i_or_p))
- {
- case CLASS_INTERFACE_TYPE:
- case CATEGORY_INTERFACE_TYPE:
- plist = CLASS_PROTOCOL_LIST (i_or_p);
- break;
- case PROTOCOL_INTERFACE_TYPE:
- plist = PROTOCOL_LIST (i_or_p);
- break;
- default:
- gcc_unreachable ();
- }
-
- /* Compute size. */
- for (lproto = plist; lproto; lproto = TREE_CHAIN (lproto))
- if (TREE_CODE (TREE_VALUE (lproto)) == PROTOCOL_INTERFACE_TYPE
- && PROTOCOL_FORWARD_DECL (TREE_VALUE (lproto)))
- size++;
-
- /* Build initializer. */
- CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, build_int_cst (NULL_TREE, 0));
- e = build_int_cst (build_pointer_type (objc_protocol_template), size);
- CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, e);
-
- for (lproto = plist; lproto; lproto = TREE_CHAIN (lproto))
- {
- tree pval = TREE_VALUE (lproto);
-
- if (TREE_CODE (pval) == PROTOCOL_INTERFACE_TYPE
- && PROTOCOL_FORWARD_DECL (pval))
- {
- e = build_unary_op (input_location, ADDR_EXPR,
- PROTOCOL_FORWARD_DECL (pval), 0);
- CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, e);
- }
- }
-
- /* static struct objc_protocol *refs[n]; */
-
- switch (TREE_CODE (i_or_p))
- {
- case PROTOCOL_INTERFACE_TYPE:
- ref_name = synth_id_with_class_suffix ("_OBJC_PROTOCOL_REFS", i_or_p);
- break;
- case CLASS_INTERFACE_TYPE:
- ref_name = synth_id_with_class_suffix ("_OBJC_CLASS_PROTOCOLS", i_or_p);
- break;
- case CATEGORY_INTERFACE_TYPE:
- ref_name = synth_id_with_class_suffix ("_OBJC_CATEGORY_PROTOCOLS", i_or_p);
- break;
- default:
- gcc_unreachable ();
- }
-
- ptype = build_pointer_type (objc_protocol_template);
- array_type = build_sized_array_type (ptype, size + 3);
- refs_decl = start_var_decl (array_type, ref_name);
-
- finish_var_decl (refs_decl,
- objc_build_constructor (TREE_TYPE (refs_decl), v));
-
- return refs_decl;
-}
-
-static tree
-build_category_initializer (tree type, tree cat_name, tree class_name,
- tree instance_methods, tree class_methods,
- tree protocol_list)
-{
- tree expr;
- VEC(constructor_elt,gc) *v = NULL;
-
- CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, cat_name);
- CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, class_name);
-
- if (!instance_methods)
- CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, build_int_cst (NULL_TREE, 0));
- else
- {
- expr = convert (objc_method_list_ptr,
- build_unary_op (input_location, ADDR_EXPR,
- instance_methods, 0));
- CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, expr);
- }
- if (!class_methods)
- CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, build_int_cst (NULL_TREE, 0));
- else
- {
- expr = convert (objc_method_list_ptr,
- build_unary_op (input_location, ADDR_EXPR,
- class_methods, 0));
- CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, expr);
- }
-
- /* protocol_list = */
- if (!protocol_list)
- CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, build_int_cst (NULL_TREE, 0));
- else
- {
- expr = convert (build_pointer_type
- (build_pointer_type
- (objc_protocol_template)),
- build_unary_op (input_location, ADDR_EXPR,
- protocol_list, 0));
- CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, expr);
- }
-
- return objc_build_constructor (type, v);
-}
-
-/* struct _objc_class {
- struct objc_class *isa;
- struct objc_class *super_class;
- char *name;
- long version;
- long info;
- long instance_size;
- struct objc_ivar_list *ivars;
- struct objc_method_list *methods;
- if (flag_next_runtime)
- struct objc_cache *cache;
- else {
- struct sarray *dtable;
- struct objc_class *subclass_list;
- struct objc_class *sibling_class;
- }
- struct objc_protocol_list *protocols;
- if (flag_next_runtime)
- void *sel_id;
- void *gc_object_type;
- }; */
-
-static tree
-build_shared_structure_initializer (tree type, tree isa, tree super,
- tree name, tree size, int status,
- tree dispatch_table, tree ivar_list,
- tree protocol_list)
-{
- tree expr;
- VEC(constructor_elt,gc) *v = NULL;
-
- /* isa = */
- CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, isa);
-
- /* super_class = */
- CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, super);
-
- /* name = */
- CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, default_conversion (name));
-
- /* version = */
- CONSTRUCTOR_APPEND_ELT (v, NULL_TREE,
- build_int_cst (long_integer_type_node, 0));
-
- /* info = */
- CONSTRUCTOR_APPEND_ELT (v, NULL_TREE,
- build_int_cst (long_integer_type_node, status));
-
- /* instance_size = */
- CONSTRUCTOR_APPEND_ELT (v, NULL_TREE,
- convert (long_integer_type_node, size));
-
- /* objc_ivar_list = */
- if (!ivar_list)
- CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, build_int_cst (NULL_TREE, 0));
- else
- {
- expr = convert (objc_ivar_list_ptr,
- build_unary_op (input_location, ADDR_EXPR,
- ivar_list, 0));
- CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, expr);
- }
-
- /* objc_method_list = */
- if (!dispatch_table)
- CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, build_int_cst (NULL_TREE, 0));
- else
- {
- expr = convert (objc_method_list_ptr,
- build_unary_op (input_location, ADDR_EXPR,
- dispatch_table, 0));
- CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, expr);
- }
-
- if (flag_next_runtime)
- /* method_cache = */
- CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, build_int_cst (NULL_TREE, 0));
- else
- {
- /* dtable = */
- CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, build_int_cst (NULL_TREE, 0));
-
- /* subclass_list = */
- CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, build_int_cst (NULL_TREE, 0));
-
- /* sibling_class = */
- CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, build_int_cst (NULL_TREE, 0));
- }
-
- /* protocol_list = */
- if (! protocol_list)
- CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, build_int_cst (NULL_TREE, 0));
- else
- {
- expr = convert (build_pointer_type
- (build_pointer_type
- (objc_protocol_template)),
- build_unary_op (input_location, ADDR_EXPR,
- protocol_list, 0));
- CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, expr);
- }
-
- if (flag_next_runtime)
- /* sel_id = NULL */
- CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, build_int_cst (NULL_TREE, 0));
-
- /* gc_object_type = NULL */
- CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, build_int_cst (NULL_TREE, 0));
-
- return objc_build_constructor (type, v);
-}
-
-/* Retrieve category interface CAT_NAME (if any) associated with CLASS. */
-
-static inline tree
-lookup_category (tree klass, tree cat_name)
-{
- tree category = CLASS_CATEGORY_LIST (klass);
-
- while (category && CLASS_SUPER_NAME (category) != cat_name)
- category = CLASS_CATEGORY_LIST (category);
- return category;
-}
-
-/* static struct objc_category _OBJC_CATEGORY_<name> = { ... }; */
-
-static void
-generate_category (struct imp_entry *impent)
-{
- tree initlist, cat_name_expr, class_name_expr;
- tree protocol_decl, category;
- tree cat = impent->imp_context;
-
- implementation_template = impent->imp_template;
- UOBJC_CLASS_decl = impent->class_decl;
- UOBJC_METACLASS_decl = impent->meta_decl;
-
- add_class_reference (CLASS_NAME (cat));
- cat_name_expr = add_objc_string (CLASS_SUPER_NAME (cat), class_names);
-
- class_name_expr = add_objc_string (CLASS_NAME (cat), class_names);
-
- category = lookup_category (implementation_template,
- CLASS_SUPER_NAME (cat));
-
- if (category && CLASS_PROTOCOL_LIST (category))
- {
- generate_protocol_references (CLASS_PROTOCOL_LIST (category));
- protocol_decl = generate_protocol_list (category);
- }
- else
- protocol_decl = 0;
-
- initlist = build_category_initializer (TREE_TYPE (UOBJC_CLASS_decl),
- cat_name_expr, class_name_expr,
- UOBJC_INSTANCE_METHODS_decl,
- UOBJC_CLASS_METHODS_decl,
- protocol_decl);
- /* Finish and initialize the forward decl. */
- finish_var_decl (UOBJC_CLASS_decl, initlist);
-}
-
-/* static struct objc_class _OBJC_METACLASS_Foo={ ... };
- static struct objc_class _OBJC_CLASS_Foo={ ... }; */
-
-static void
-generate_shared_structures (struct imp_entry *impent)
-{
- tree name_expr, super_expr, root_expr;
- tree my_root_id, my_super_id;
- tree cast_type, initlist, protocol_decl;
- int cls_flags;
-
- objc_implementation_context = impent->imp_context;
- implementation_template = impent->imp_template;
- UOBJC_CLASS_decl = impent->class_decl;
- UOBJC_METACLASS_decl = impent->meta_decl;
- cls_flags = impent->has_cxx_cdtors ? CLS_HAS_CXX_STRUCTORS : 0 ;
-
- my_super_id = CLASS_SUPER_NAME (implementation_template);
- if (my_super_id)
- {
- add_class_reference (my_super_id);
-
- /* Compute "my_root_id" - this is required for code generation.
- the "isa" for all meta class structures points to the root of
- the inheritance hierarchy (e.g. "__Object")... */
- my_root_id = my_super_id;
- do
- {
- tree my_root_int = lookup_interface (my_root_id);
-
- if (my_root_int && CLASS_SUPER_NAME (my_root_int))
- my_root_id = CLASS_SUPER_NAME (my_root_int);
- else
- break;
- }
- while (1);
- }
- else
- /* No super class. */
- my_root_id = CLASS_NAME (implementation_template);
-
- cast_type = build_pointer_type (objc_class_template);
- name_expr = add_objc_string (CLASS_NAME (implementation_template),
- class_names);
-
- /* Install class `isa' and `super' pointers at runtime. */
- if (my_super_id)
- super_expr = add_objc_string (my_super_id, class_names);
- else
- super_expr = integer_zero_node;
-
- super_expr = build_c_cast (input_location,
- cast_type, super_expr); /* cast! */
-
- root_expr = add_objc_string (my_root_id, class_names);
- root_expr = build_c_cast (input_location, cast_type, root_expr); /* cast! */
-
- if (CLASS_PROTOCOL_LIST (implementation_template))
- {
- generate_protocol_references
- (CLASS_PROTOCOL_LIST (implementation_template));
- protocol_decl = generate_protocol_list (implementation_template);
- }
- else
- protocol_decl = 0;
-
- /* static struct objc_class _OBJC_METACLASS_Foo = { ... }; */
-
- initlist
- = build_shared_structure_initializer
- (TREE_TYPE (UOBJC_METACLASS_decl),
- root_expr, super_expr, name_expr,
- convert (integer_type_node, TYPE_SIZE_UNIT (objc_class_template)),
- 2 /*CLS_META*/,
- UOBJC_CLASS_METHODS_decl,
- UOBJC_CLASS_VARIABLES_decl,
- protocol_decl);
-
- finish_var_decl (UOBJC_METACLASS_decl, initlist);
-
- /* static struct objc_class _OBJC_CLASS_Foo={ ... }; */
-
- initlist
- = build_shared_structure_initializer
- (TREE_TYPE (UOBJC_CLASS_decl),
- build_unary_op (input_location, ADDR_EXPR, UOBJC_METACLASS_decl, 0),
- super_expr, name_expr,
- convert (integer_type_node,
- TYPE_SIZE_UNIT (CLASS_STATIC_TEMPLATE
- (implementation_template))),
- 1 /*CLS_FACTORY*/ | cls_flags,
- UOBJC_INSTANCE_METHODS_decl,
- UOBJC_INSTANCE_VARIABLES_decl,
- protocol_decl);
-
- finish_var_decl (UOBJC_CLASS_decl, initlist);
-}
-
-
-static const char *
-synth_id_with_class_suffix (const char *preamble, tree ctxt)
-{
- static char string[BUFSIZE];
-
- switch (TREE_CODE (ctxt))
- {
- case CLASS_IMPLEMENTATION_TYPE:
- case CLASS_INTERFACE_TYPE:
- sprintf (string, "%s_%s", preamble,
- IDENTIFIER_POINTER (CLASS_NAME (ctxt)));
- break;
- case CATEGORY_IMPLEMENTATION_TYPE:
- case CATEGORY_INTERFACE_TYPE:
- {
- /* We have a category. */
- const char *const class_name
- = IDENTIFIER_POINTER (CLASS_NAME (objc_implementation_context));
- const char *const class_super_name
- = IDENTIFIER_POINTER (CLASS_SUPER_NAME (objc_implementation_context));
- sprintf (string, "%s_%s_%s", preamble, class_name, class_super_name);
- break;
- }
- case PROTOCOL_INTERFACE_TYPE:
- {
- const char *protocol_name = IDENTIFIER_POINTER (PROTOCOL_NAME (ctxt));
- sprintf (string, "%s_%s", preamble, protocol_name);
- break;
- }
- default:
- gcc_unreachable ();
- }
-
- return string;
-}
-
/* If type is empty or only type qualifiers are present, add default
type of id (otherwise grokdeclarator will default to int). */
static inline tree
@@ -7666,9 +4701,6 @@ build_method_decl (enum tree_code code, tree ret_type, tree selector,
return method_decl;
}
-#define METHOD_DEF 0
-#define METHOD_REF 1
-
/* This routine processes objective-c method attributes. */
static void
@@ -7803,21 +4835,13 @@ objc_method_decl (enum tree_code opcode)
the method call are done together. If METH is null, user-defined
arguments (i.e., beyond self and _cmd) shall be represented by `...'. */
-static tree
+tree
get_arg_type_list (tree meth, int context, int superflag)
{
tree arglist, akey;
- /* Receiver type. */
- if (flag_next_runtime && superflag)
- arglist = build_tree_list (NULL_TREE, objc_super_type);
- else if (context == METHOD_DEF && TREE_CODE (meth) == INSTANCE_METHOD_DECL)
- arglist = build_tree_list (NULL_TREE, objc_instance_type);
- else
- arglist = build_tree_list (NULL_TREE, objc_object_type);
-
- /* Selector type - will eventually change to `int'. */
- chainon (arglist, build_tree_list (NULL_TREE, objc_selector_type));
+ /* Receiver & _cmd types are runtime-dependent. */
+ arglist = (*runtime.get_arg_type_list_base) (meth, context, superflag);
/* No actual method prototype given -- assume that remaining arguments
are `...'. */
@@ -7934,7 +4958,7 @@ check_duplicates (hash hsh, int methods, int is_class)
static tree
receiver_is_class_object (tree receiver, int self, int super)
{
- tree chain, exp, arg;
+ tree exp, arg;
/* The receiver is 'self' or 'super' in the context of a class method. */
if (objc_method_context
@@ -7944,16 +4968,10 @@ receiver_is_class_object (tree receiver, int self, int super)
? CLASS_SUPER_NAME (implementation_template)
: CLASS_NAME (implementation_template));
- if (flag_next_runtime)
- {
- /* The receiver is a variable created by
- build_class_reference_decl. */
- if (TREE_CODE (receiver) == VAR_DECL && IS_CLASS (TREE_TYPE (receiver)))
- /* Look up the identifier. */
- for (chain = cls_ref_chain; chain; chain = TREE_CHAIN (chain))
- if (TREE_PURPOSE (chain) == receiver)
- return TREE_VALUE (chain);
- }
+ /* The runtime might encapsulate things its own way. */
+ exp = (*runtime.receiver_is_class_object) (receiver);
+ if (exp)
+ return exp;
/* The receiver is a function call that returns an id. Check if
it is a call to objc_getClass, if so, pick up the class name. */
@@ -7966,7 +4984,7 @@ receiver_is_class_object (tree receiver, int self, int super)
prototypes for objc_get_class(). Thankfully, they seem to share the
same function type. */
&& TREE_TYPE (exp) == TREE_TYPE (objc_get_class_decl)
- && !strcmp (IDENTIFIER_POINTER (DECL_NAME (exp)), TAG_GETCLASS)
+ && !strcmp (IDENTIFIER_POINTER (DECL_NAME (exp)), runtime.tag_getclass)
/* We have a call to objc_get_class/objc_getClass! */
&& (arg = CALL_EXPR_ARG (receiver, 0)))
{
@@ -7979,7 +4997,7 @@ receiver_is_class_object (tree receiver, int self, int super)
}
return 0;
}
-
+
/* If we are currently building a message expr, this holds
the identifier of the selector of the message. This is
used when printing warnings about argument mismatches. */
@@ -8108,7 +5126,7 @@ objc_finish_message_expr (tree receiver, tree sel_name, tree method_params,
tree *deprecated_method_prototype)
{
tree method_prototype = NULL_TREE, rprotos = NULL_TREE, rtype;
- tree selector, retval, class_tree;
+ tree retval, class_tree;
int self, super, have_cast;
/* We have used the receiver, so mark it as read. */
@@ -8321,7 +5339,7 @@ objc_finish_message_expr (tree receiver, tree sel_name, tree method_params,
In practice this makes sense since casting an object to 'id'
is often used precisely to turn off warnings associated with
the object being of a particular class. */
- if (TREE_DEPRECATED (method_prototype) && rtype != NULL_TREE)
+ if (TREE_DEPRECATED (method_prototype) && rtype != NULL_TREE)
{
if (deprecated_method_prototype)
*deprecated_method_prototype = method_prototype;
@@ -8330,213 +5348,42 @@ objc_finish_message_expr (tree receiver, tree sel_name, tree method_params,
}
}
-
/* Save the selector name for printing error messages. */
current_objc_message_selector = sel_name;
- /* Build the parameters list for looking up the method.
- These are the object itself and the selector. */
-
- if (flag_typed_selectors)
- selector = build_typed_selector_reference (input_location,
- sel_name, method_prototype);
- else
- selector = build_selector_reference (input_location, sel_name);
-
- retval = build_objc_method_call (input_location, super, method_prototype,
- receiver,
- selector, method_params);
+ /* Build the method call.
+ TODO: Get the location from somewhere that will work for delayed
+ expansion. */
+
+ retval = (*runtime.build_objc_method_call) (input_location, method_prototype,
+ receiver, rtype, sel_name,
+ method_params, super);
current_objc_message_selector = 0;
return retval;
}
-/* Build a tree expression to send OBJECT the operation SELECTOR,
- looking up the method on object LOOKUP_OBJECT (often same as OBJECT),
- assuming the method has prototype METHOD_PROTOTYPE.
- (That is an INSTANCE_METHOD_DECL or CLASS_METHOD_DECL.)
- LOC is the location of the expression to build.
- Use METHOD_PARAMS as list of args to pass to the method.
- If SUPER_FLAG is nonzero, we look up the superclass's method. */
-
-static tree
-build_objc_method_call (location_t loc, int super_flag, tree method_prototype,
- tree lookup_object, tree selector,
- tree method_params)
-{
- tree sender = (super_flag ? umsg_super_decl :
- (!flag_next_runtime || flag_nil_receivers
- ? (flag_objc_direct_dispatch
- ? umsg_fast_decl
- : umsg_decl)
- : umsg_nonnil_decl));
- tree rcv_p = (super_flag ? objc_super_type : objc_object_type);
- VEC(tree, gc) *parms = NULL;
- unsigned nparm = (method_params ? list_length (method_params) : 0);
-
- /* If a prototype for the method to be called exists, then cast
- the sender's return type and arguments to match that of the method.
- Otherwise, leave sender as is. */
- tree ret_type
- = (method_prototype
- ? TREE_VALUE (TREE_TYPE (method_prototype))
- : objc_object_type);
-
- tree method_param_types =
- get_arg_type_list (method_prototype, METHOD_REF, super_flag);
- tree ftype = build_function_type (ret_type, method_param_types);
- tree sender_cast;
- tree method, t;
-
- if (method_prototype && METHOD_TYPE_ATTRIBUTES (method_prototype))
- ftype = build_type_attribute_variant (ftype,
- METHOD_TYPE_ATTRIBUTES
- (method_prototype));
-
- sender_cast = build_pointer_type (ftype);
-
- lookup_object = build_c_cast (loc, rcv_p, lookup_object);
-
- /* Use SAVE_EXPR to avoid evaluating the receiver twice. */
- lookup_object = save_expr (lookup_object);
-
- /* Param list + 2 slots for object and selector. */
- parms = VEC_alloc (tree, gc, nparm + 2);
-
- if (flag_next_runtime)
- {
- /* If we are returning a struct in memory, and the address
- of that memory location is passed as a hidden first
- argument, then change which messenger entry point this
- expr will call. NB: Note that sender_cast remains
- unchanged (it already has a struct return type). */
- if (!targetm.calls.struct_value_rtx (0, 0)
- && (TREE_CODE (ret_type) == RECORD_TYPE
- || TREE_CODE (ret_type) == UNION_TYPE)
- && targetm.calls.return_in_memory (ret_type, 0))
- sender = (super_flag ? umsg_super_stret_decl :
- flag_nil_receivers ? umsg_stret_decl : umsg_nonnil_stret_decl);
-
- method = build_fold_addr_expr_loc (input_location, sender);
- /* Pass the object to the method. */
- VEC_quick_push (tree, parms, lookup_object);
- }
- else
- {
- /* This is the portable (GNU) way. */
- /* First, call the lookup function to get a pointer to the method,
- then cast the pointer, then call it with the method arguments. */
- VEC(tree, gc) *tv = VEC_alloc (tree, gc, 2);
- VEC_quick_push (tree, tv, lookup_object);
- VEC_quick_push (tree, tv, selector);
- method = build_function_call_vec (loc, sender, tv, NULL);
- VEC_free (tree, gc, tv);
-
- /* Pass the appropriate object to the method. */
- VEC_quick_push (tree, parms, (super_flag ? self_decl : lookup_object));
- }
-
- /* Pass the selector to the method. */
- VEC_quick_push (tree, parms, selector);
- /* Now append the remainder of the parms. */
- if (nparm)
- for (; method_params; method_params = TREE_CHAIN (method_params))
- VEC_quick_push (tree, parms, TREE_VALUE (method_params));
-
- /* Build an obj_type_ref, with the correct cast for the method call. */
- t = build3 (OBJ_TYPE_REF, sender_cast, method,
- lookup_object, size_zero_node);
- t = build_function_call_vec (loc, t, parms, NULL);\
- VEC_free (tree, gc, parms);
- return t;
-}
-
-static void
-build_protocol_reference (tree p)
-{
- tree decl;
- const char *proto_name;
-
- /* static struct _objc_protocol _OBJC_PROTOCOL_<mumble>; */
- proto_name = synth_id_with_class_suffix ("_OBJC_PROTOCOL", p);
- decl = start_var_decl (objc_protocol_template, proto_name);
-
- PROTOCOL_FORWARD_DECL (p) = decl;
-}
+/* This routine creates a static variable used to implement @protocol(MyProtocol)
+ expression. This variable will be initialized to global protocol_t meta-data
+ pointer. */
/* This function is called by the parser when (and only when) a
@protocol() expression is found, in order to compile it. */
tree
objc_build_protocol_expr (tree protoname)
{
- tree expr;
tree p = lookup_protocol (protoname, /* warn if deprecated */ true,
/* definition_required */ false);
if (!p)
{
- error ("cannot find protocol declaration for %qE",
- protoname);
+ error ("cannot find protocol declaration for %qE", protoname);
return error_mark_node;
}
- if (!PROTOCOL_FORWARD_DECL (p))
- build_protocol_reference (p);
-
- expr = build_unary_op (input_location,
- ADDR_EXPR, PROTOCOL_FORWARD_DECL (p), 0);
-
- /* ??? Ideally we'd build the reference with objc_protocol_type directly,
- if we have it, rather than converting it here. */
- expr = convert (objc_protocol_type, expr);
-
- /* The @protocol() expression is being compiled into a pointer to a
- statically allocated instance of the Protocol class. To become
- usable at runtime, the 'isa' pointer of the instance need to be
- fixed up at runtime by the runtime library, to point to the
- actual 'Protocol' class. */
-
- /* For the GNU runtime, put the static Protocol instance in the list
- of statically allocated instances, so that we make sure that its
- 'isa' pointer is fixed up at runtime by the GNU runtime library
- to point to the Protocol class (at runtime, when loading the
- module, the GNU runtime library loops on the statically allocated
- instances (as found in the defs field in objc_symtab) and fixups
- all the 'isa' pointers of those objects). */
- if (! flag_next_runtime)
- {
- /* This type is a struct containing the fields of a Protocol
- object. (Cfr. objc_protocol_type instead is the type of a pointer
- to such a struct). */
- tree protocol_struct_type = xref_tag
- (RECORD_TYPE, get_identifier (PROTOCOL_OBJECT_CLASS_NAME));
- tree *chain;
-
- /* Look for the list of Protocol statically allocated instances
- to fixup at runtime. Create a new list to hold Protocol
- statically allocated instances, if the list is not found. At
- present there is only another list, holding NSConstantString
- static instances to be fixed up at runtime. */
- for (chain = &objc_static_instances;
- *chain && TREE_VALUE (*chain) != protocol_struct_type;
- chain = &TREE_CHAIN (*chain));
- if (!*chain)
- {
- *chain = tree_cons (NULL_TREE, protocol_struct_type, NULL_TREE);
- add_objc_string (OBJC_TYPE_NAME (protocol_struct_type),
- class_names);
- }
-
- /* Add this statically allocated instance to the Protocol list. */
- TREE_PURPOSE (*chain) = tree_cons (NULL_TREE,
- PROTOCOL_FORWARD_DECL (p),
- TREE_PURPOSE (*chain));
- }
-
-
- return expr;
+ return (*runtime.get_protocol_reference) (input_location, p);
}
/* This function is called by the parser when a @selector() expression
@@ -8587,11 +5434,9 @@ objc_build_selector_expr (location_t loc, tree selnamelist)
}
}
-
- if (flag_typed_selectors)
- return build_typed_selector_reference (loc, selname, 0);
- else
- return build_selector_reference (loc, selname);
+ /* The runtimes do this differently, most particularly, GNU has typed
+ selectors, whilst NeXT does not. */
+ return (*runtime.build_selector_reference) (loc, selname, NULL_TREE);
}
/* This is used to implement @encode(). See gcc/doc/objc.texi,
@@ -8616,6 +5461,7 @@ objc_build_encode_expr (tree type)
static tree
build_ivar_reference (tree id)
{
+ tree base;
if (TREE_CODE (objc_method_context) == CLASS_METHOD_DECL)
{
/* Historically, a class method that produced objects (factory
@@ -8632,11 +5478,10 @@ build_ivar_reference (tree id)
self_decl = convert (objc_instance_type, self_decl); /* cast */
}
- return objc_build_component_ref (build_indirect_ref (input_location,
- self_decl, RO_ARROW),
- id);
+ base = build_indirect_ref (input_location, self_decl, RO_ARROW);
+ return (*runtime.build_ivar_reference) (input_location, base, id);
}
-
+
/* Compute a hash value for a given method SEL_NAME. */
static size_t
@@ -8660,6 +5505,8 @@ hash_init (void)
cls_name_hash_list = ggc_alloc_cleared_vec_hash (SIZEHASHTABLE);
als_name_hash_list = ggc_alloc_cleared_vec_hash (SIZEHASHTABLE);
+ ivar_offset_hash_list = ggc_alloc_cleared_vec_hash (SIZEHASHTABLE);
+
/* Initialize the hash table used to hold the constant string objects. */
string_htab = htab_create_ggc (31, string_hash,
string_eq, NULL);
@@ -9075,6 +5922,58 @@ add_category (tree klass, tree category)
}
}
+#ifndef OBJCPLUS
+/* A flexible array member is a C99 extension where you can use
+ "type[]" at the end of a struct to mean a variable-length array.
+
+ In Objective-C, instance variables are fundamentally members of a
+ struct, but the struct can always be extended by subclassing; hence
+ we need to detect and forbid all instance variables declared using
+ flexible array members.
+
+ No check for this is needed in Objective-C++, since C++ does not
+ have flexible array members. */
+
+/* Determine whether TYPE is a structure with a flexible array member,
+ a union containing such a structure (possibly recursively) or an
+ array of such structures or unions. These are all invalid as
+ instance variable. */
+static bool
+flexible_array_type_p (tree type)
+{
+ tree x;
+ switch (TREE_CODE (type))
+ {
+ case RECORD_TYPE:
+ x = TYPE_FIELDS (type);
+ if (x == NULL_TREE)
+ return false;
+ while (DECL_CHAIN (x) != NULL_TREE)
+ x = DECL_CHAIN (x);
+ if (TREE_CODE (TREE_TYPE (x)) == ARRAY_TYPE
+ && TYPE_SIZE (TREE_TYPE (x)) == NULL_TREE
+ && TYPE_DOMAIN (TREE_TYPE (x)) != NULL_TREE
+ && TYPE_MAX_VALUE (TYPE_DOMAIN (TREE_TYPE (x))) == NULL_TREE)
+ return true;
+ return false;
+ case UNION_TYPE:
+ for (x = TYPE_FIELDS (type); x != NULL_TREE; x = DECL_CHAIN (x))
+ {
+ if (flexible_array_type_p (TREE_TYPE (x)))
+ return true;
+ }
+ return false;
+ /* Note that we also check for arrays of something that uses a flexible array member. */
+ case ARRAY_TYPE:
+ if (flexible_array_type_p (TREE_TYPE (type)))
+ return true;
+ return false;
+ default:
+ return false;
+ }
+}
+#endif
+
/* Called after parsing each instance variable declaration. Necessary to
preserve typedefs and implement public/private...
@@ -9108,6 +6007,27 @@ add_instance_variable (tree klass, objc_ivar_visibility_kind visibility,
return klass;
}
+#ifndef OBJCPLUS
+ /* Also, in C reject a struct with a flexible array member. Ie,
+
+ struct A { int x; int[] y; };
+
+ @interface X
+ {
+ struct A instance_variable;
+ }
+ @end
+
+ is not valid because if the class is subclassed, we wouldn't be able
+ to calculate the offset of the next instance variable. */
+ if (flexible_array_type_p (field_type))
+ {
+ error ("instance variable %qs uses flexible array member", ivar_name);
+ /* Return class as is without adding this ivar. */
+ return klass;
+ }
+#endif
+
#ifdef OBJCPLUS
/* Check if the ivar being added has a non-POD C++ type. If so, we will
need to either (1) warn the user about it or (2) generate suitable
@@ -9200,16 +6120,6 @@ add_instance_variable (tree klass, objc_ivar_visibility_kind visibility,
return klass;
}
-
-
-static tree
-is_ivar (tree decl_chain, tree ident)
-{
- for ( ; decl_chain; decl_chain = DECL_CHAIN (decl_chain))
- if (DECL_NAME (decl_chain) == ident)
- return decl_chain;
- return NULL_TREE;
-}
/* True if the ivar is private and we are not in its implementation. */
@@ -9763,9 +6673,6 @@ start_class (enum tree_code code, tree class_name, tree super_name,
CLASS_PROTOCOL_LIST (klass)
= lookup_and_install_protocols (protocol_list, /* definition_required */ true);
- /* Determine if 'deprecated', the only attribute we recognize
- for classes, was used. Ignore all other attributes for now,
- but store them in the klass. */
if (attributes)
{
tree attribute;
@@ -9773,9 +6680,15 @@ start_class (enum tree_code code, tree class_name, tree super_name,
{
tree name = TREE_PURPOSE (attribute);
+ /* TODO: Document what the objc_exception attribute is/does. */
+ /* We handle the 'deprecated' and (undocumented) 'objc_exception'
+ attributes. */
if (is_attribute_p ("deprecated", name))
TREE_DEPRECATED (klass) = 1;
+ else if (is_attribute_p ("objc_exception", name))
+ CLASS_HAS_EXCEPTION_ATTR (klass) = 1;
else
+ /* Warn about and ignore all others for now, but store them. */
warning (OPT_Wattributes, "%qE attribute directive ignored", name);
}
TYPE_ATTRIBUTES (klass) = attributes;
@@ -9874,25 +6787,32 @@ continue_class (tree klass)
#ifdef OBJCPLUS
push_lang_context (lang_name_c);
#endif
- build_private_template (implementation_template);
- uprivate_record = CLASS_STATIC_TEMPLATE (implementation_template);
- objc_instance_type = build_pointer_type (uprivate_record);
-
- imp_entry = ggc_alloc_imp_entry ();
+ build_private_template (implementation_template);
+ uprivate_record = CLASS_STATIC_TEMPLATE (implementation_template);
+ objc_instance_type = build_pointer_type (uprivate_record);
- imp_entry->next = imp_list;
- imp_entry->imp_context = klass;
- imp_entry->imp_template = implementation_template;
+ imp_entry = ggc_alloc_imp_entry ();
- synth_forward_declarations ();
- imp_entry->class_decl = UOBJC_CLASS_decl;
- imp_entry->meta_decl = UOBJC_METACLASS_decl;
+ imp_entry->next = imp_list;
+ imp_entry->imp_context = klass;
+ imp_entry->imp_template = implementation_template;
+ ucls_super_ref = uucls_super_ref = NULL;
+ if (TREE_CODE (klass) == CLASS_IMPLEMENTATION_TYPE)
+ {
+ imp_entry->class_decl = (*runtime.class_decl) (klass);
+ imp_entry->meta_decl = (*runtime.metaclass_decl) (klass);
+ }
+ else
+ {
+ imp_entry->class_decl = (*runtime.category_decl) (klass);
+ imp_entry->meta_decl = NULL;
+ }
imp_entry->has_cxx_cdtors = 0;
- /* Append to front and increment count. */
- imp_list = imp_entry;
- if (TREE_CODE (klass) == CLASS_IMPLEMENTATION_TYPE)
- imp_count++;
+ /* Append to front and increment count. */
+ imp_list = imp_entry;
+ if (TREE_CODE (klass) == CLASS_IMPLEMENTATION_TYPE)
+ imp_count++;
else
cat_count++;
#ifdef OBJCPLUS
@@ -9936,9 +6856,12 @@ objc_build_property_setter_name (tree ident)
/* This routine prepares the declarations of the property accessor
helper functions (objc_getProperty(), etc) that are used when
- @synthesize is used. */
+ @synthesize is used.
+
+ runtime-specific routines are built in the respective runtime
+ initialize functions. */
static void
-build_objc_property_accessor_helpers (void)
+build_common_objc_property_accessor_helpers (void)
{
tree type;
@@ -9974,52 +6897,6 @@ build_objc_property_accessor_helpers (void)
type, 0, NOT_BUILT_IN,
NULL, NULL_TREE);
TREE_NOTHROW (objc_setProperty_decl) = 0;
-
- /* This is the type of all of the following functions
- (objc_copyStruct(), objc_getPropertyStruct() and
- objc_setPropertyStruct()). */
- type = build_function_type_list (void_type_node,
- ptr_type_node,
- const_ptr_type_node,
- ptrdiff_type_node,
- boolean_type_node,
- boolean_type_node,
- NULL_TREE);
-
- if (flag_next_runtime)
- {
- /* Declare the following function:
- void
- objc_copyStruct (void *destination, const void *source,
- ptrdiff_t size, BOOL is_atomic, BOOL has_strong); */
- objc_copyStruct_decl = add_builtin_function ("objc_copyStruct",
- type, 0, NOT_BUILT_IN,
- NULL, NULL_TREE);
- TREE_NOTHROW (objc_copyStruct_decl) = 0;
- objc_getPropertyStruct_decl = NULL_TREE;
- objc_setPropertyStruct_decl = NULL_TREE;
- }
- else
- {
- objc_copyStruct_decl = NULL_TREE;
-
- /* Declare the following function:
- void
- objc_getPropertyStruct (void *destination, const void *source,
- ptrdiff_t size, BOOL is_atomic, BOOL has_strong); */
- objc_getPropertyStruct_decl = add_builtin_function ("objc_getPropertyStruct",
- type, 0, NOT_BUILT_IN,
- NULL, NULL_TREE);
- TREE_NOTHROW (objc_getPropertyStruct_decl) = 0;
- /* Declare the following function:
- void
- objc_setPropertyStruct (void *destination, const void *source,
- ptrdiff_t size, BOOL is_atomic, BOOL has_strong); */
- objc_setPropertyStruct_decl = add_builtin_function ("objc_setPropertyStruct",
- type, 0, NOT_BUILT_IN,
- NULL, NULL_TREE);
- TREE_NOTHROW (objc_setPropertyStruct_decl) = 0;
- }
}
/* This looks up an ivar in a class (including superclasses). */
@@ -10169,7 +7046,7 @@ objc_synthesize_getter (tree klass, tree class_methods ATTRIBUTE_UNUSED, tree pr
else
is_atomic = boolean_true_node;
- if (flag_next_runtime)
+ if (objc_copyStruct_decl)
function_decl = objc_copyStruct_decl;
else
function_decl = objc_getPropertyStruct_decl;
@@ -10369,7 +7246,7 @@ objc_synthesize_setter (tree klass, tree class_methods ATTRIBUTE_UNUSED, tree pr
else
is_atomic = boolean_true_node;
- if (flag_next_runtime)
+ if (objc_copyStruct_decl)
function_decl = objc_copyStruct_decl;
else
function_decl = objc_setPropertyStruct_decl;
@@ -10781,7 +7658,7 @@ finish_class (tree klass)
{
case CLASS_IMPLEMENTATION_TYPE:
{
- /* All code generation is done in finish_objc. */
+ /* All metadata generation is done in runtime.generate_metadata(). */
/* Generate what needed for property; setters, getters, etc. */
objc_gen_property_data (implementation_template, implementation_template);
@@ -11096,666 +7973,6 @@ start_protocol (enum tree_code code, tree name, tree list, tree attributes)
return protocol;
}
-
-/* "Encode" a data type into a string, which grows in util_obstack.
-
- The format is described in gcc/doc/objc.texi, section 'Type
- encoding'.
-
- Most of the encode_xxx functions have a 'type' argument, which is
- the type to encode, and an integer 'curtype' argument, which is the
- index in the encoding string of the beginning of the encoding of
- the current type, and allows you to find what characters have
- already been written for the current type (they are the ones in the
- current encoding string starting from 'curtype').
-
- For example, if we are encoding a method which returns 'int' and
- takes a 'char **' argument, then when we get to the point of
- encoding the 'char **' argument, the encoded string already
- contains 'i12@0:4' (assuming a pointer size of 4 bytes). So,
- 'curtype' will be set to 7 when starting to encode 'char **'.
- During the whole of the encoding of 'char **', 'curtype' will be
- fixed at 7, so the routine encoding the second pointer can find out
- that it's actually encoding a pointer to a pointer by looking
- backwards at what has already been encoded for the current type,
- and seeing there is a "^" (meaning a pointer) in there.
-*/
-
-
-/* Encode type qualifiers encodes one of the "PQ" Objective-C
- keywords, ie 'in', 'out', 'inout', 'bycopy', 'byref', 'oneway'.
- 'const', instead, is encoded directly as part of the type.
- */
-
-static void
-encode_type_qualifiers (tree declspecs)
-{
- tree spec;
-
- for (spec = declspecs; spec; spec = TREE_CHAIN (spec))
- {
- /* FIXME: Shouldn't we use token->keyword here ? */
- if (ridpointers[(int) RID_IN] == TREE_VALUE (spec))
- obstack_1grow (&util_obstack, 'n');
- else if (ridpointers[(int) RID_INOUT] == TREE_VALUE (spec))
- obstack_1grow (&util_obstack, 'N');
- else if (ridpointers[(int) RID_OUT] == TREE_VALUE (spec))
- obstack_1grow (&util_obstack, 'o');
- else if (ridpointers[(int) RID_BYCOPY] == TREE_VALUE (spec))
- obstack_1grow (&util_obstack, 'O');
- else if (ridpointers[(int) RID_BYREF] == TREE_VALUE (spec))
- obstack_1grow (&util_obstack, 'R');
- else if (ridpointers[(int) RID_ONEWAY] == TREE_VALUE (spec))
- obstack_1grow (&util_obstack, 'V');
- else
- gcc_unreachable ();
- }
-}
-
-/* Determine if a pointee is marked read-only. Only used by the NeXT
- runtime to be compatible with gcc-3.3. */
-
-static bool
-pointee_is_readonly (tree pointee)
-{
- while (POINTER_TYPE_P (pointee))
- pointee = TREE_TYPE (pointee);
-
- return TYPE_READONLY (pointee);
-}
-
-/* Encode a pointer type. */
-
-static void
-encode_pointer (tree type, int curtype, int format)
-{
- tree pointer_to = TREE_TYPE (type);
-
- if (flag_next_runtime)
- {
- /* This code is used to be compatible with gcc-3.3. */
- /* For historical/compatibility reasons, the read-only qualifier
- of the pointee gets emitted _before_ the '^'. The read-only
- qualifier of the pointer itself gets ignored, _unless_ we are
- looking at a typedef! Also, do not emit the 'r' for anything
- but the outermost type! */
- if (!generating_instance_variables
- && (obstack_object_size (&util_obstack) - curtype <= 1)
- && (TYPE_NAME (type) && TREE_CODE (TYPE_NAME (type)) == TYPE_DECL
- ? TYPE_READONLY (type)
- : pointee_is_readonly (pointer_to)))
- obstack_1grow (&util_obstack, 'r');
- }
-
- if (TREE_CODE (pointer_to) == RECORD_TYPE)
- {
- if (OBJC_TYPE_NAME (pointer_to)
- && TREE_CODE (OBJC_TYPE_NAME (pointer_to)) == IDENTIFIER_NODE)
- {
- const char *name = IDENTIFIER_POINTER (OBJC_TYPE_NAME (pointer_to));
-
- if (strcmp (name, TAG_OBJECT) == 0) /* '@' */
- {
- obstack_1grow (&util_obstack, '@');
- return;
- }
- else if (TYPE_HAS_OBJC_INFO (pointer_to)
- && TYPE_OBJC_INTERFACE (pointer_to))
- {
- if (generating_instance_variables)
- {
- obstack_1grow (&util_obstack, '@');
- obstack_1grow (&util_obstack, '"');
- obstack_grow (&util_obstack, name, strlen (name));
- obstack_1grow (&util_obstack, '"');
- return;
- }
- else
- {
- obstack_1grow (&util_obstack, '@');
- return;
- }
- }
- else if (strcmp (name, TAG_CLASS) == 0) /* '#' */
- {
- obstack_1grow (&util_obstack, '#');
- return;
- }
- else if (strcmp (name, TAG_SELECTOR) == 0) /* ':' */
- {
- obstack_1grow (&util_obstack, ':');
- return;
- }
- }
- }
- else if (TREE_CODE (pointer_to) == INTEGER_TYPE
- && TYPE_MODE (pointer_to) == QImode)
- {
- tree pname = TREE_CODE (OBJC_TYPE_NAME (pointer_to)) == IDENTIFIER_NODE
- ? OBJC_TYPE_NAME (pointer_to)
- : DECL_NAME (OBJC_TYPE_NAME (pointer_to));
-
- /* (BOOL *) are an exception and are encoded as ^c, while all
- other pointers to char are encoded as *. */
- if (strcmp (IDENTIFIER_POINTER (pname), "BOOL"))
- {
- if (!flag_next_runtime)
- {
- /* The NeXT runtime adds the 'r' before getting here. */
-
- /* It appears that "r*" means "const char *" rather than
- "char *const". "char *const" is encoded as "*",
- which is identical to "char *", so the "const" is
- unfortunately lost. */
- if (TYPE_READONLY (pointer_to))
- obstack_1grow (&util_obstack, 'r');
- }
-
- obstack_1grow (&util_obstack, '*');
- return;
- }
- }
-
- /* We have a normal pointer type that does not get special treatment. */
- obstack_1grow (&util_obstack, '^');
- encode_type (pointer_to, curtype, format);
-}
-
-static void
-encode_array (tree type, int curtype, int format)
-{
- tree an_int_cst = TYPE_SIZE (type);
- tree array_of = TREE_TYPE (type);
- char buffer[40];
-
- if (an_int_cst == NULL)
- {
- /* We are trying to encode an incomplete array. An incomplete
- array is forbidden as part of an instance variable. */
- if (generating_instance_variables)
- {
- /* TODO: Detect this error earlier. */
- error ("instance variable has unknown size");
- return;
- }
-
- /* So the only case in which an incomplete array could occur is
- if we are encoding the arguments or return value of a method.
- In that case, an incomplete array argument or return value
- (eg, -(void)display: (char[])string) is treated like a
- pointer because that is how the compiler does the function
- call. A special, more complicated case, is when the
- incomplete array is the last member of a struct (eg, if we
- are encoding "struct { unsigned long int a;double b[];}"),
- which is again part of a method argument/return value. In
- that case, we really need to communicate to the runtime that
- there is an incomplete array (not a pointer!) there. So, we
- detect that special case and encode it as a zero-length
- array.
-
- Try to detect that we are part of a struct. We do this by
- searching for '=' in the type encoding for the current type.
- NB: This hack assumes that you can't use '=' as part of a C
- identifier.
- */
- {
- char *enc = obstack_base (&util_obstack) + curtype;
- if (memchr (enc, '=',
- obstack_object_size (&util_obstack) - curtype) == NULL)
- {
- /* We are not inside a struct. Encode the array as a
- pointer. */
- encode_pointer (type, curtype, format);
- return;
- }
- }
-
- /* Else, we are in a struct, and we encode it as a zero-length
- array. */
- sprintf (buffer, "[" HOST_WIDE_INT_PRINT_DEC, (HOST_WIDE_INT)0);
- }
- else if (TREE_INT_CST_LOW (TYPE_SIZE (array_of)) == 0)
- sprintf (buffer, "[" HOST_WIDE_INT_PRINT_DEC, (HOST_WIDE_INT)0);
- else
- sprintf (buffer, "[" HOST_WIDE_INT_PRINT_DEC,
- TREE_INT_CST_LOW (an_int_cst)
- / TREE_INT_CST_LOW (TYPE_SIZE (array_of)));
-
- obstack_grow (&util_obstack, buffer, strlen (buffer));
- encode_type (array_of, curtype, format);
- obstack_1grow (&util_obstack, ']');
- return;
-}
-
-/* Encode a vector. The vector type is a GCC extension to C. */
-static void
-encode_vector (tree type, int curtype, int format)
-{
- tree vector_of = TREE_TYPE (type);
- char buffer[40];
-
- /* Vectors are like simple fixed-size arrays. */
-
- /* Output ![xx,yy,<code>] where xx is the vector_size, yy is the
- alignment of the vector, and <code> is the base type. Eg, int
- __attribute__ ((vector_size (16))) gets encoded as ![16,32,i]
- assuming that the alignment is 32 bytes. We include size and
- alignment in bytes so that the runtime does not have to have any
- knowledge of the actual types.
- */
- sprintf (buffer, "![" HOST_WIDE_INT_PRINT_DEC ",%d",
- /* We want to compute the equivalent of sizeof (<vector>).
- Code inspired by c_sizeof_or_alignof_type. */
- ((TREE_INT_CST_LOW (TYPE_SIZE_UNIT (type))
- / (TYPE_PRECISION (char_type_node) / BITS_PER_UNIT))),
- /* We want to compute the equivalent of __alignof__
- (<vector>). Code inspired by
- c_sizeof_or_alignof_type. */
- TYPE_ALIGN_UNIT (type));
- obstack_grow (&util_obstack, buffer, strlen (buffer));
- encode_type (vector_of, curtype, format);
- obstack_1grow (&util_obstack, ']');
- return;
-}
-
-static void
-encode_aggregate_fields (tree type, bool pointed_to, int curtype, int format)
-{
- tree field = TYPE_FIELDS (type);
-
- for (; field; field = DECL_CHAIN (field))
- {
-#ifdef OBJCPLUS
- /* C++ static members, and things that are not field at all,
- should not appear in the encoding. */
- if (TREE_CODE (field) != FIELD_DECL || TREE_STATIC (field))
- continue;
-#endif
-
- /* Recursively encode fields of embedded base classes. */
- if (DECL_ARTIFICIAL (field) && !DECL_NAME (field)
- && TREE_CODE (TREE_TYPE (field)) == RECORD_TYPE)
- {
- encode_aggregate_fields (TREE_TYPE (field),
- pointed_to, curtype, format);
- continue;
- }
-
- if (generating_instance_variables && !pointed_to)
- {
- tree fname = DECL_NAME (field);
-
- obstack_1grow (&util_obstack, '"');
-
- if (fname && TREE_CODE (fname) == IDENTIFIER_NODE)
- obstack_grow (&util_obstack,
- IDENTIFIER_POINTER (fname),
- strlen (IDENTIFIER_POINTER (fname)));
-
- obstack_1grow (&util_obstack, '"');
- }
-
- encode_field_decl (field, curtype, format);
- }
-}
-
-static void
-encode_aggregate_within (tree type, int curtype, int format, int left,
- int right)
-{
- tree name;
- /* NB: aggregates that are pointed to have slightly different encoding
- rules in that you never encode the names of instance variables. */
- int ob_size = obstack_object_size (&util_obstack);
- bool inline_contents = false;
- bool pointed_to = false;
-
- if (flag_next_runtime)
- {
- if (ob_size > 0 && *(obstack_next_free (&util_obstack) - 1) == '^')
- pointed_to = true;
-
- if ((format == OBJC_ENCODE_INLINE_DEFS || generating_instance_variables)
- && (!pointed_to || ob_size - curtype == 1
- || (ob_size - curtype == 2
- && *(obstack_next_free (&util_obstack) - 2) == 'r')))
- inline_contents = true;
- }
- else
- {
- /* c0 and c1 are the last two characters in the encoding of the
- current type; if the last two characters were '^' or '^r',
- then we are encoding an aggregate that is "pointed to". The
- comment above applies: in that case we should avoid encoding
- the names of instance variables.
- */
- char c1 = ob_size > 1 ? *(obstack_next_free (&util_obstack) - 2) : 0;
- char c0 = ob_size > 0 ? *(obstack_next_free (&util_obstack) - 1) : 0;
-
- if (c0 == '^' || (c1 == '^' && c0 == 'r'))
- pointed_to = true;
-
- if (format == OBJC_ENCODE_INLINE_DEFS || generating_instance_variables)
- {
- if (!pointed_to)
- inline_contents = true;
- else
- {
- /* Note that the check (ob_size - curtype < 2) prevents
- infinite recursion when encoding a structure which is
- a linked list (eg, struct node { struct node *next;
- }). Each time we follow a pointer, we add one
- character to ob_size, and curtype is fixed, so after
- at most two pointers we stop inlining contents and
- break the loop.
-
- The other case where we don't inline is "^r", which
- is a pointer to a constant struct.
- */
- if ((ob_size - curtype <= 2) && !(c0 == 'r'))
- inline_contents = true;
- }
- }
- }
-
- /* Traverse struct aliases; it is important to get the
- original struct and its tag name (if any). */
- type = TYPE_MAIN_VARIANT (type);
- name = OBJC_TYPE_NAME (type);
- /* Open parenth/bracket. */
- obstack_1grow (&util_obstack, left);
-
- /* Encode the struct/union tag name, or '?' if a tag was
- not provided. Typedef aliases do not qualify. */
-#ifdef OBJCPLUS
- /* For compatibility with the NeXT runtime, ObjC++ encodes template
- args as a composite struct tag name. */
- if (name && TREE_CODE (name) == IDENTIFIER_NODE
- /* Did this struct have a tag? */
- && !TYPE_WAS_ANONYMOUS (type))
- obstack_grow (&util_obstack,
- decl_as_string (type, TFF_DECL_SPECIFIERS | TFF_UNQUALIFIED_NAME),
- strlen (decl_as_string (type, TFF_DECL_SPECIFIERS | TFF_UNQUALIFIED_NAME)));
-#else
- if (name && TREE_CODE (name) == IDENTIFIER_NODE)
- obstack_grow (&util_obstack,
- IDENTIFIER_POINTER (name),
- strlen (IDENTIFIER_POINTER (name)));
-#endif
- else
- obstack_1grow (&util_obstack, '?');
-
- /* Encode the types (and possibly names) of the inner fields,
- if required. */
- if (inline_contents)
- {
- obstack_1grow (&util_obstack, '=');
- encode_aggregate_fields (type, pointed_to, curtype, format);
- }
- /* Close parenth/bracket. */
- obstack_1grow (&util_obstack, right);
-}
-
-/* Encode a bitfield NeXT-style (i.e., without a bit offset or the underlying
- field type. */
-
-static void
-encode_next_bitfield (int width)
-{
- char buffer[40];
- sprintf (buffer, "b%d", width);
- obstack_grow (&util_obstack, buffer, strlen (buffer));
-}
-
-
-/* Encodes 'type', ignoring type qualifiers (which you should encode
- beforehand if needed) with the exception of 'const', which is
- encoded by encode_type. See above for the explanation of
- 'curtype'. 'format' can be OBJC_ENCODE_INLINE_DEFS or
- OBJC_ENCODE_DONT_INLINE_DEFS.
-*/
-static void
-encode_type (tree type, int curtype, int format)
-{
- enum tree_code code = TREE_CODE (type);
-
- /* Ignore type qualifiers other than 'const' when encoding a
- type. */
-
- if (type == error_mark_node)
- return;
-
- if (!flag_next_runtime)
- {
- if (TYPE_READONLY (type))
- obstack_1grow (&util_obstack, 'r');
- }
-
- switch (code)
- {
- case ENUMERAL_TYPE:
- if (flag_next_runtime)
- {
- /* Kludge for backwards-compatibility with gcc-3.3: enums
- are always encoded as 'i' no matter what type they
- actually are (!). */
- obstack_1grow (&util_obstack, 'i');
- break;
- }
- /* Else, they are encoded exactly like the integer type that is
- used by the compiler to store them. */
- case INTEGER_TYPE:
- {
- char c;
- switch (GET_MODE_BITSIZE (TYPE_MODE (type)))
- {
- case 8: c = TYPE_UNSIGNED (type) ? 'C' : 'c'; break;
- case 16: c = TYPE_UNSIGNED (type) ? 'S' : 's'; break;
- case 32:
- {
- tree int_type = type;
- if (flag_next_runtime)
- {
- /* Another legacy kludge for compatiblity with
- gcc-3.3: 32-bit longs are encoded as 'l' or 'L',
- but not always. For typedefs, we need to use 'i'
- or 'I' instead if encoding a struct field, or a
- pointer! */
- int_type = ((!generating_instance_variables
- && (obstack_object_size (&util_obstack)
- == (unsigned) curtype))
- ? TYPE_MAIN_VARIANT (type)
- : type);
- }
- if (int_type == long_unsigned_type_node
- || int_type == long_integer_type_node)
- c = TYPE_UNSIGNED (type) ? 'L' : 'l';
- else
- c = TYPE_UNSIGNED (type) ? 'I' : 'i';
- }
- break;
- case 64: c = TYPE_UNSIGNED (type) ? 'Q' : 'q'; break;
- case 128: c = TYPE_UNSIGNED (type) ? 'T' : 't'; break;
- default: gcc_unreachable ();
- }
- obstack_1grow (&util_obstack, c);
- break;
- }
- case REAL_TYPE:
- {
- char c;
- /* Floating point types. */
- switch (GET_MODE_BITSIZE (TYPE_MODE (type)))
- {
- case 32: c = 'f'; break;
- case 64: c = 'd'; break;
- case 96:
- case 128: c = 'D'; break;
- default: gcc_unreachable ();
- }
- obstack_1grow (&util_obstack, c);
- break;
- }
- case VOID_TYPE:
- obstack_1grow (&util_obstack, 'v');
- break;
-
- case BOOLEAN_TYPE:
- obstack_1grow (&util_obstack, 'B');
- break;
-
- case ARRAY_TYPE:
- encode_array (type, curtype, format);
- break;
-
- case POINTER_TYPE:
-#ifdef OBJCPLUS
- case REFERENCE_TYPE:
-#endif
- encode_pointer (type, curtype, format);
- break;
-
- case RECORD_TYPE:
- encode_aggregate_within (type, curtype, format, '{', '}');
- break;
-
- case UNION_TYPE:
- encode_aggregate_within (type, curtype, format, '(', ')');
- break;
-
- case FUNCTION_TYPE: /* '?' means an unknown type. */
- obstack_1grow (&util_obstack, '?');
- break;
-
- case COMPLEX_TYPE:
- /* A complex is encoded as 'j' followed by the inner type (eg,
- "_Complex int" is encoded as 'ji'). */
- obstack_1grow (&util_obstack, 'j');
- encode_type (TREE_TYPE (type), curtype, format);
- break;
-
- case VECTOR_TYPE:
- encode_vector (type, curtype, format);
- break;
-
- default:
- warning (0, "unknown type %s found during Objective-C encoding",
- gen_type_name (type));
- obstack_1grow (&util_obstack, '?');
- break;
- }
-
- if (flag_next_runtime)
- {
- /* Super-kludge. Some ObjC qualifier and type combinations need
- to be rearranged for compatibility with gcc-3.3. */
- if (code == POINTER_TYPE && obstack_object_size (&util_obstack) >= 3)
- {
- char *enc = obstack_base (&util_obstack) + curtype;
-
- /* Rewrite "in const" from "nr" to "rn". */
- if (curtype >= 1 && !strncmp (enc - 1, "nr", 2))
- strncpy (enc - 1, "rn", 2);
- }
- }
-}
-
-static void
-encode_gnu_bitfield (int position, tree type, int size)
-{
- enum tree_code code = TREE_CODE (type);
- char buffer[40];
- char charType = '?';
-
- /* This code is only executed for the GNU runtime, so we can ignore
- the NeXT runtime kludge of always encoding enums as 'i' no matter
- what integers they actually are. */
- if (code == INTEGER_TYPE || code == ENUMERAL_TYPE)
- {
- if (integer_zerop (TYPE_MIN_VALUE (type)))
- /* Unsigned integer types. */
- {
- switch (TYPE_MODE (type))
- {
- case QImode:
- charType = 'C'; break;
- case HImode:
- charType = 'S'; break;
- case SImode:
- {
- if (type == long_unsigned_type_node)
- charType = 'L';
- else
- charType = 'I';
- break;
- }
- case DImode:
- charType = 'Q'; break;
- default:
- gcc_unreachable ();
- }
- }
- else
- /* Signed integer types. */
- {
- switch (TYPE_MODE (type))
- {
- case QImode:
- charType = 'c'; break;
- case HImode:
- charType = 's'; break;
- case SImode:
- {
- if (type == long_integer_type_node)
- charType = 'l';
- else
- charType = 'i';
- break;
- }
- case DImode:
- charType = 'q'; break;
- default:
- gcc_unreachable ();
- }
- }
- }
- else
- {
- /* Do not do any encoding, produce an error and keep going. */
- error ("trying to encode non-integer type as a bitfield");
- return;
- }
-
- sprintf (buffer, "b%d%c%d", position, charType, size);
- obstack_grow (&util_obstack, buffer, strlen (buffer));
-}
-
-static void
-encode_field_decl (tree field_decl, int curtype, int format)
-{
-#ifdef OBJCPLUS
- /* C++ static members, and things that are not fields at all,
- should not appear in the encoding. */
- if (TREE_CODE (field_decl) != FIELD_DECL || TREE_STATIC (field_decl))
- return;
-#endif
-
- /* Generate the bitfield typing information, if needed. Note the difference
- between GNU and NeXT runtimes. */
- if (DECL_BIT_FIELD_TYPE (field_decl))
- {
- int size = tree_low_cst (DECL_SIZE (field_decl), 1);
-
- if (flag_next_runtime)
- encode_next_bitfield (size);
- else
- encode_gnu_bitfield (int_bit_position (field_decl),
- DECL_BIT_FIELD_TYPE (field_decl), size);
- }
- else
- encode_type (TREE_TYPE (field_decl), curtype, format);
-}
-
/* Decay array and function parameters into pointers. */
static tree
@@ -11774,7 +7991,7 @@ static GTY(()) tree objc_parmlist = NULL_TREE;
/* Append PARM to a list of formal parameters of a method, making a necessary
array-to-pointer adjustment along the way. */
-static void
+void
objc_push_parm (tree parm)
{
tree type;
@@ -11809,19 +8026,18 @@ objc_push_parm (tree parm)
objc_push_parm(). */
#ifdef OBJCPLUS
-static tree
+tree
objc_get_parm_info (int have_ellipsis ATTRIBUTE_UNUSED)
-#else
-static struct c_arg_info *
-objc_get_parm_info (int have_ellipsis)
-#endif
{
-#ifdef OBJCPLUS
tree parm_info = objc_parmlist;
objc_parmlist = NULL_TREE;
return parm_info;
+}
#else
+struct c_arg_info *
+objc_get_parm_info (int have_ellipsis)
+{
tree parm_info = objc_parmlist;
struct c_arg_info *arg_info;
/* The C front-end requires an elaborate song and dance at
@@ -11841,8 +8057,8 @@ objc_get_parm_info (int have_ellipsis)
pop_scope ();
objc_parmlist = NULL_TREE;
return arg_info;
-#endif
}
+#endif
/* Synthesize the formal parameters 'id self' and 'SEL _cmd' needed for ObjC
method definitions. In the case of instance methods, we can be more
@@ -12043,6 +8259,39 @@ match_proto_with_proto (tree proto1, tree proto2, int strict)
return (!type1 && !type2);
}
+/* This routine returns true if TYPE is a valid objc object type,
+ suitable for messaging; false otherwise. If 'accept_class' is
+ 'true', then a Class object is considered valid for messaging and
+ 'true' is returned if 'type' refers to a Class. If 'accept_class'
+ is 'false', then a Class object is not considered valid for
+ messaging and 'false' is returned in that case. */
+
+static bool
+objc_type_valid_for_messaging (tree type, bool accept_classes)
+{
+ if (!POINTER_TYPE_P (type))
+ return false;
+
+ /* Remove the pointer indirection; don't remove more than one
+ otherwise we'd consider "NSObject **" a valid type for messaging,
+ which it isn't. */
+ type = TREE_TYPE (type);
+
+ if (TREE_CODE (type) != RECORD_TYPE)
+ return false;
+
+ if (objc_is_object_id (type))
+ return true;
+
+ if (objc_is_class_id (type))
+ return accept_classes;
+
+ if (TYPE_HAS_OBJC_INFO (type))
+ return true;
+
+ return false;
+}
+
/* Fold an OBJ_TYPE_REF expression for ObjC method dispatches, where
this occurs. ObjC method dispatches are _not_ like C++ virtual
member function dispatches, and we account for the difference here. */
@@ -12070,7 +8319,7 @@ objc_fold_obj_type_ref (tree ref ATTRIBUTE_UNUSED,
#endif
}
-static void
+void
objc_start_function (tree name, tree type, tree attrs,
#ifdef OBJCPLUS
tree params
@@ -12255,8 +8504,8 @@ get_super_receiver (void)
{
if (objc_method_context)
{
- tree super_expr, super_expr_list;
-
+ tree super_expr, super_expr_list, class_expr;
+ bool inst_meth;
if (!UOBJC_SUPER_decl)
{
UOBJC_SUPER_decl = build_decl (input_location,
@@ -12279,80 +8528,42 @@ get_super_receiver (void)
super_expr_list = super_expr;
/* Set class to begin searching. */
- super_expr = objc_build_component_ref (UOBJC_SUPER_decl,
- get_identifier ("super_class"));
+ /* Get the ident for the superclass class field & build a ref to it.
+ ??? maybe we should just name the field the same for all runtimes. */
+ super_expr = (*runtime.super_superclassfield_ident) ();
+ super_expr = objc_build_component_ref (UOBJC_SUPER_decl, super_expr);
- if (TREE_CODE (objc_implementation_context) == CLASS_IMPLEMENTATION_TYPE)
- {
- /* [_cls, __cls]Super are "pre-built" in
- synth_forward_declarations. */
-
- super_expr = build_modify_expr (input_location, super_expr,
- NULL_TREE, NOP_EXPR,
- input_location,
- ((TREE_CODE (objc_method_context)
- == INSTANCE_METHOD_DECL)
- ? ucls_super_ref
- : uucls_super_ref),
- NULL_TREE);
- }
+ gcc_assert (imp_list->imp_context == objc_implementation_context
+ && imp_list->imp_template == implementation_template);
+ inst_meth = (TREE_CODE (objc_method_context) == INSTANCE_METHOD_DECL);
+ if (TREE_CODE (objc_implementation_context) == CLASS_IMPLEMENTATION_TYPE)
+ class_expr = (*runtime.get_class_super_ref) (input_location,
+ imp_list, inst_meth);
else
/* We have a category. */
{
- tree super_name = CLASS_SUPER_NAME (implementation_template);
+ tree super_name = CLASS_SUPER_NAME (imp_list->imp_template);
tree super_class;
- /* Barf if super used in a category of Object. */
+ /* Barf if super used in a category of a root object. */
if (!super_name)
{
error ("no super class declared in interface for %qE",
- CLASS_NAME (implementation_template));
+ CLASS_NAME (imp_list->imp_template));
return error_mark_node;
}
- if (flag_next_runtime && !flag_zero_link)
- {
- super_class = objc_get_class_reference (super_name);
- if (TREE_CODE (objc_method_context) == CLASS_METHOD_DECL)
- /* If we are in a class method, we must retrieve the
- _metaclass_ for the current class, pointed at by
- the class's "isa" pointer. The following assumes that
- "isa" is the first ivar in a class (which it must be). */
- super_class
- = build_indirect_ref
- (input_location,
- build_c_cast (input_location,
- build_pointer_type (objc_class_type),
- super_class), RO_UNARY_STAR);
- }
- else
- {
- add_class_reference (super_name);
- super_class = (TREE_CODE (objc_method_context) == INSTANCE_METHOD_DECL
- ? objc_get_class_decl : objc_get_meta_class_decl);
- assemble_external (super_class);
- super_class
- = build_function_call
- (input_location,
- super_class,
- build_tree_list
- (NULL_TREE,
- my_build_string_pointer
- (IDENTIFIER_LENGTH (super_name) + 1,
- IDENTIFIER_POINTER (super_name))));
- }
-
- super_expr
- = build_modify_expr (input_location, super_expr, NULL_TREE,
- NOP_EXPR,
- input_location,
- build_c_cast (input_location,
- TREE_TYPE (super_expr),
- super_class),
- NULL_TREE);
+ super_class = (*runtime.get_category_super_ref) (input_location,
+ imp_list, inst_meth);
+ class_expr = build_c_cast (input_location,
+ TREE_TYPE (super_expr), super_class);
}
+ super_expr = build_modify_expr (input_location, super_expr, NULL_TREE,
+ NOP_EXPR,
+ input_location, class_expr, NULL_TREE);
+
super_expr_list = build_compound_expr (input_location,
super_expr_list, super_expr);
@@ -12377,10 +8588,11 @@ void
objc_clear_super_receiver (void)
{
if (objc_method_context
- && UOBJC_SUPER_scope == objc_get_current_scope ()) {
- UOBJC_SUPER_decl = 0;
- UOBJC_SUPER_scope = 0;
- }
+ && UOBJC_SUPER_scope == objc_get_current_scope ())
+ {
+ UOBJC_SUPER_decl = 0;
+ UOBJC_SUPER_scope = 0;
+ }
}
void
@@ -12581,7 +8793,7 @@ gen_method_decl (tree method)
supplied file FP. Used to implement the -gen-decls option (which
prints out an @interface declaration of all classes compiled in
this run); potentially useful for debugging the compiler too. */
-static void
+void
dump_interface (FILE *fp, tree chain)
{
/* FIXME: A heap overflow here whenever a method (or ivar)
@@ -12856,313 +9068,6 @@ objc_printable_name (tree decl, int v)
return IDENTIFIER_POINTER (DECL_NAME (decl));
}
-static void
-init_objc (void)
-{
- gcc_obstack_init (&util_obstack);
- util_firstobj = (char *) obstack_finish (&util_obstack);
-
- errbuf = XNEWVEC (char, 1024 * 10);
- hash_init ();
- synth_module_prologue ();
-}
-
-static void
-finish_objc (void)
-{
- struct imp_entry *impent;
- tree chain;
- /* The internally generated initializers appear to have missing braces.
- Don't warn about this. */
- int save_warn_missing_braces = warn_missing_braces;
- warn_missing_braces = 0;
-
- /* A missing @end may not be detected by the parser. */
- if (objc_implementation_context)
- {
- warning (0, "%<@end%> missing in implementation context");
- finish_class (objc_implementation_context);
- objc_ivar_chain = NULL_TREE;
- objc_implementation_context = NULL_TREE;
- }
-
- /* Process the static instances here because initialization of objc_symtab
- depends on them. */
- if (objc_static_instances)
- generate_static_references ();
-
- /* forward declare categories */
- if (cat_count)
- forward_declare_categories ();
-
- for (impent = imp_list; impent; impent = impent->next)
- {
- objc_implementation_context = impent->imp_context;
- implementation_template = impent->imp_template;
-
- /* FIXME: This needs reworking to be more obvious. */
-
- UOBJC_CLASS_decl = impent->class_decl;
- UOBJC_METACLASS_decl = impent->meta_decl;
-
- /* Dump the @interface of each class as we compile it, if the
- -gen-decls option is in use. TODO: Dump the classes in the
- order they were found, rather than in reverse order as we
- are doing now. */
- if (flag_gen_declaration)
- {
- dump_interface (gen_declaration_file, objc_implementation_context);
- }
-
- if (TREE_CODE (objc_implementation_context) == CLASS_IMPLEMENTATION_TYPE)
- {
- /* all of the following reference the string pool... */
- generate_ivar_lists ();
- generate_dispatch_tables ();
- generate_shared_structures (impent);
- }
- else
- {
- generate_dispatch_tables ();
- generate_category (impent);
- }
-
- impent->class_decl = UOBJC_CLASS_decl;
- impent->meta_decl = UOBJC_METACLASS_decl;
- }
-
- /* If we are using an array of selectors, we must always
- finish up the array decl even if no selectors were used. */
- if (flag_next_runtime)
- build_next_selector_translation_table ();
- else
- build_gnu_selector_translation_table ();
-
- if (protocol_chain)
- generate_protocols ();
-
- if (flag_next_runtime)
- generate_objc_image_info ();
-
- if (imp_list || class_names_chain
- || meth_var_names_chain || meth_var_types_chain || sel_ref_chain)
- generate_objc_symtab_decl ();
-
- /* Arrange for ObjC data structures to be initialized at run time. */
- if (objc_implementation_context || class_names_chain || objc_static_instances
- || meth_var_names_chain || meth_var_types_chain || sel_ref_chain)
- {
- build_module_descriptor ();
-
- if (!flag_next_runtime)
- build_module_initializer_routine ();
- }
-
- /* Dump the class references. This forces the appropriate classes
- to be linked into the executable image, preserving unix archive
- semantics. This can be removed when we move to a more dynamically
- linked environment. */
-
- for (chain = cls_ref_chain; chain; chain = TREE_CHAIN (chain))
- {
- handle_class_ref (chain);
- if (TREE_PURPOSE (chain))
- generate_classref_translation_entry (chain);
- }
-
- for (impent = imp_list; impent; impent = impent->next)
- handle_impent (impent);
-
- if (warn_selector)
- {
- int slot;
- hash hsh;
-
- /* Run through the selector hash tables and print a warning for any
- selector which has multiple methods. */
-
- for (slot = 0; slot < SIZEHASHTABLE; slot++)
- {
- for (hsh = cls_method_hash_list[slot]; hsh; hsh = hsh->next)
- check_duplicates (hsh, 0, 1);
- for (hsh = nst_method_hash_list[slot]; hsh; hsh = hsh->next)
- check_duplicates (hsh, 0, 0);
- }
- }
-
- warn_missing_braces = save_warn_missing_braces;
-}
-
-/* Subroutines of finish_objc. */
-
-static void
-generate_classref_translation_entry (tree chain)
-{
- tree expr, decl, type;
-
- decl = TREE_PURPOSE (chain);
- type = TREE_TYPE (decl);
-
- expr = add_objc_string (TREE_VALUE (chain), class_names);
- expr = convert (type, expr); /* cast! */
-
- /* This is a class reference. It is re-written by the runtime,
- but will be optimized away unless we force it. */
- DECL_PRESERVE_P (decl) = 1;
- finish_var_decl (decl, expr);
- return;
-}
-
-static void
-handle_class_ref (tree chain)
-{
- const char *name = IDENTIFIER_POINTER (TREE_VALUE (chain));
- char *string = (char *) alloca (strlen (name) + 30);
- tree decl;
- tree exp;
-
- sprintf (string, "%sobjc_class_name_%s",
- (flag_next_runtime ? "." : "__"), name);
-
-#ifdef ASM_DECLARE_UNRESOLVED_REFERENCE
- if (flag_next_runtime)
- {
- ASM_DECLARE_UNRESOLVED_REFERENCE (asm_out_file, string);
- return;
- }
-#endif
-
- /* Make a decl for this name, so we can use its address in a tree. */
- decl = build_decl (input_location,
- VAR_DECL, get_identifier (string), TREE_TYPE (integer_zero_node));
- DECL_EXTERNAL (decl) = 1;
- TREE_PUBLIC (decl) = 1;
- pushdecl (decl);
- finish_var_decl (decl, 0);
-
- /* Make a decl for the address. */
- sprintf (string, "%sobjc_class_ref_%s",
- (flag_next_runtime ? "." : "__"), name);
- exp = build1 (ADDR_EXPR, string_type_node, decl);
- decl = build_decl (input_location,
- VAR_DECL, get_identifier (string), string_type_node);
- TREE_STATIC (decl) = 1;
- TREE_USED (decl) = 1;
- DECL_READ_P (decl) = 1;
- DECL_ARTIFICIAL (decl) = 1;
- DECL_INITIAL (decl) = error_mark_node;
-
- /* We must force the reference. */
- DECL_PRESERVE_P (decl) = 1;
-
- pushdecl (decl);
- finish_var_decl (decl, exp);
-}
-
-static void
-handle_impent (struct imp_entry *impent)
-{
- char *string;
-
- objc_implementation_context = impent->imp_context;
- implementation_template = impent->imp_template;
-
- switch (TREE_CODE (impent->imp_context))
- {
- case CLASS_IMPLEMENTATION_TYPE:
- {
- const char *const class_name =
- IDENTIFIER_POINTER (CLASS_NAME (impent->imp_context));
-
- string = (char *) alloca (strlen (class_name) + 30);
-
- sprintf (string, "%sobjc_class_name_%s",
- (flag_next_runtime ? "." : "__"), class_name);
- break;
- }
- case CATEGORY_IMPLEMENTATION_TYPE:
- {
- const char *const class_name =
- IDENTIFIER_POINTER (CLASS_NAME (impent->imp_context));
- const char *const class_super_name =
- IDENTIFIER_POINTER (CLASS_SUPER_NAME (impent->imp_context));
-
- string = (char *) alloca (strlen (class_name)
- + strlen (class_super_name) + 30);
-
- /* Do the same for categories. Even though no references to
- these symbols are generated automatically by the compiler,
- it gives you a handle to pull them into an archive by
- hand. */
- sprintf (string, "*%sobjc_category_name_%s_%s",
- (flag_next_runtime ? "." : "__"), class_name, class_super_name);
- break;
- }
- default:
- return;
- }
-
-#ifdef ASM_DECLARE_CLASS_REFERENCE
- if (flag_next_runtime)
- {
- ASM_DECLARE_CLASS_REFERENCE (asm_out_file, string);
- return;
- }
- else
-#endif
- {
- tree decl, init;
-
- init = integer_zero_node;
- decl = build_decl (input_location,
- VAR_DECL, get_identifier (string), TREE_TYPE (init));
- TREE_PUBLIC (decl) = 1;
- TREE_READONLY (decl) = 1;
- TREE_USED (decl) = 1;
- TREE_CONSTANT (decl) = 1;
- DECL_CONTEXT (decl) = NULL_TREE;
- DECL_ARTIFICIAL (decl) = 1;
- TREE_STATIC (decl) = 1;
- DECL_INITIAL (decl) = error_mark_node; /* A real initializer is coming... */
- /* We must force the reference. */
- DECL_PRESERVE_P (decl) = 1;
-
- finish_var_decl(decl, init) ;
- }
-}
-
-/* The Fix-and-Continue functionality available in Mac OS X 10.3 and
- later requires that ObjC translation units participating in F&C be
- specially marked. The following routine accomplishes this. */
-
-/* static int _OBJC_IMAGE_INFO[2] = { 0, 1 }; */
-
-static void
-generate_objc_image_info (void)
-{
- tree decl;
- int flags
- = ((flag_replace_objc_classes && imp_count ? 1 : 0)
- | (flag_objc_gc ? 2 : 0));
- VEC(constructor_elt,gc) *v = NULL;
- tree array_type;
-
- if (!flags)
- return; /* No need for an image_info entry. */
-
- array_type = build_sized_array_type (integer_type_node, 2);
-
- decl = start_var_decl (array_type, "_OBJC_IMAGE_INFO");
-
- CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, integer_zero_node);
- CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, build_int_cst (integer_type_node, flags));
- /* If we need this (determined above) it is because the runtime wants to
- refer to it in a manner hidden from the compiler. So we must force the
- output. */
- DECL_PRESERVE_P (decl) = 1;
- finish_var_decl (decl, objc_build_constructor (TREE_TYPE (decl), v));
-}
-
/* Routine is called to issue diagnostic when reference to a private
ivar is made and no other variable with same name is found in
current scope. */
@@ -13347,39 +9252,7 @@ objc_gimplify_expr (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p)
#endif
}
-/* This routine returns true if TYPE is a valid objc object type,
- suitable for messaging; false otherwise. If 'accept_class' is
- 'true', then a Class object is considered valid for messaging and
- 'true' is returned if 'type' refers to a Class. If 'accept_class'
- is 'false', then a Class object is not considered valid for
- messaging and 'false' is returned in that case. */
-
-static bool
-objc_type_valid_for_messaging (tree type, bool accept_classes)
-{
- if (!POINTER_TYPE_P (type))
- return false;
-
- /* Remove the pointer indirection; don't remove more than one
- otherwise we'd consider "NSObject **" a valid type for messaging,
- which it isn't. */
- type = TREE_TYPE (type);
-
- if (TREE_CODE (type) != RECORD_TYPE)
- return false;
-
- if (objc_is_object_id (type))
- return true;
-
- if (objc_is_class_id (type))
- return accept_classes;
-
- if (TYPE_HAS_OBJC_INFO (type))
- return true;
-
- return false;
-}
-
+/* --- FAST ENUMERATION --- */
/* Begin code generation for fast enumeration (foreach) ... */
/* Defines
@@ -13923,6 +9796,7 @@ objc_finish_foreach_loop (location_t location, tree object_expression, tree coll
/* Done by c-parser.c */
}
+/* --- SUPPORT FOR FORMAT ARG CHECKING --- */
/* Return true if we have an NxString object pointer. */
bool
@@ -13947,4 +9821,724 @@ objc_check_format_arg (tree ARG_UNUSED (format_arg),
{
}
+/* --- Encode --- */
+/* "Encode" a data type into a string, which grows in util_obstack.
+
+ The format is described in gcc/doc/objc.texi, section 'Type
+ encoding'.
+
+ Most of the encode_xxx functions have a 'type' argument, which is
+ the type to encode, and an integer 'curtype' argument, which is the
+ index in the encoding string of the beginning of the encoding of
+ the current type, and allows you to find what characters have
+ already been written for the current type (they are the ones in the
+ current encoding string starting from 'curtype').
+
+ For example, if we are encoding a method which returns 'int' and
+ takes a 'char **' argument, then when we get to the point of
+ encoding the 'char **' argument, the encoded string already
+ contains 'i12@0:4' (assuming a pointer size of 4 bytes). So,
+ 'curtype' will be set to 7 when starting to encode 'char **'.
+ During the whole of the encoding of 'char **', 'curtype' will be
+ fixed at 7, so the routine encoding the second pointer can find out
+ that it's actually encoding a pointer to a pointer by looking
+ backwards at what has already been encoded for the current type,
+ and seeing there is a "^" (meaning a pointer) in there.
+*/
+
+
+/* Encode type qualifiers encodes one of the "PQ" Objective-C
+ keywords, ie 'in', 'out', 'inout', 'bycopy', 'byref', 'oneway'.
+ 'const', instead, is encoded directly as part of the type.
+ */
+
+static void
+encode_type_qualifiers (tree declspecs)
+{
+ tree spec;
+
+ for (spec = declspecs; spec; spec = TREE_CHAIN (spec))
+ {
+ /* FIXME: Shouldn't we use token->keyword here ? */
+ if (ridpointers[(int) RID_IN] == TREE_VALUE (spec))
+ obstack_1grow (&util_obstack, 'n');
+ else if (ridpointers[(int) RID_INOUT] == TREE_VALUE (spec))
+ obstack_1grow (&util_obstack, 'N');
+ else if (ridpointers[(int) RID_OUT] == TREE_VALUE (spec))
+ obstack_1grow (&util_obstack, 'o');
+ else if (ridpointers[(int) RID_BYCOPY] == TREE_VALUE (spec))
+ obstack_1grow (&util_obstack, 'O');
+ else if (ridpointers[(int) RID_BYREF] == TREE_VALUE (spec))
+ obstack_1grow (&util_obstack, 'R');
+ else if (ridpointers[(int) RID_ONEWAY] == TREE_VALUE (spec))
+ obstack_1grow (&util_obstack, 'V');
+ else
+ gcc_unreachable ();
+ }
+}
+
+/* Determine if a pointee is marked read-only. Only used by the NeXT
+ runtime to be compatible with gcc-3.3. */
+
+static bool
+pointee_is_readonly (tree pointee)
+{
+ while (POINTER_TYPE_P (pointee))
+ pointee = TREE_TYPE (pointee);
+
+ return TYPE_READONLY (pointee);
+}
+
+/* Encode a pointer type. */
+
+static void
+encode_pointer (tree type, int curtype, int format)
+{
+ tree pointer_to = TREE_TYPE (type);
+
+ if (flag_next_runtime)
+ {
+ /* This code is used to be compatible with gcc-3.3. */
+ /* For historical/compatibility reasons, the read-only qualifier
+ of the pointee gets emitted _before_ the '^'. The read-only
+ qualifier of the pointer itself gets ignored, _unless_ we are
+ looking at a typedef! Also, do not emit the 'r' for anything
+ but the outermost type! */
+ if (!generating_instance_variables
+ && (obstack_object_size (&util_obstack) - curtype <= 1)
+ && (TYPE_NAME (type) && TREE_CODE (TYPE_NAME (type)) == TYPE_DECL
+ ? TYPE_READONLY (type)
+ : pointee_is_readonly (pointer_to)))
+ obstack_1grow (&util_obstack, 'r');
+ }
+
+ if (TREE_CODE (pointer_to) == RECORD_TYPE)
+ {
+ if (OBJC_TYPE_NAME (pointer_to)
+ && TREE_CODE (OBJC_TYPE_NAME (pointer_to)) == IDENTIFIER_NODE)
+ {
+ const char *name = IDENTIFIER_POINTER (OBJC_TYPE_NAME (pointer_to));
+
+ if (strcmp (name, TAG_OBJECT) == 0) /* '@' */
+ {
+ obstack_1grow (&util_obstack, '@');
+ return;
+ }
+ else if (TYPE_HAS_OBJC_INFO (pointer_to)
+ && TYPE_OBJC_INTERFACE (pointer_to))
+ {
+ if (generating_instance_variables)
+ {
+ obstack_1grow (&util_obstack, '@');
+ obstack_1grow (&util_obstack, '"');
+ obstack_grow (&util_obstack, name, strlen (name));
+ obstack_1grow (&util_obstack, '"');
+ return;
+ }
+ else
+ {
+ obstack_1grow (&util_obstack, '@');
+ return;
+ }
+ }
+ else if (strcmp (name, TAG_CLASS) == 0) /* '#' */
+ {
+ obstack_1grow (&util_obstack, '#');
+ return;
+ }
+ else if (strcmp (name, TAG_SELECTOR) == 0) /* ':' */
+ {
+ obstack_1grow (&util_obstack, ':');
+ return;
+ }
+ }
+ }
+ else if (TREE_CODE (pointer_to) == INTEGER_TYPE
+ && TYPE_MODE (pointer_to) == QImode)
+ {
+ tree pname = TREE_CODE (OBJC_TYPE_NAME (pointer_to)) == IDENTIFIER_NODE
+ ? OBJC_TYPE_NAME (pointer_to)
+ : DECL_NAME (OBJC_TYPE_NAME (pointer_to));
+
+ /* (BOOL *) are an exception and are encoded as ^c, while all
+ other pointers to char are encoded as *. */
+ if (strcmp (IDENTIFIER_POINTER (pname), "BOOL"))
+ {
+ if (!flag_next_runtime)
+ {
+ /* The NeXT runtime adds the 'r' before getting here. */
+
+ /* It appears that "r*" means "const char *" rather than
+ "char *const". "char *const" is encoded as "*",
+ which is identical to "char *", so the "const" is
+ unfortunately lost. */
+ if (TYPE_READONLY (pointer_to))
+ obstack_1grow (&util_obstack, 'r');
+ }
+
+ obstack_1grow (&util_obstack, '*');
+ return;
+ }
+ }
+
+ /* We have a normal pointer type that does not get special treatment. */
+ obstack_1grow (&util_obstack, '^');
+ encode_type (pointer_to, curtype, format);
+}
+
+static void
+encode_array (tree type, int curtype, int format)
+{
+ tree an_int_cst = TYPE_SIZE (type);
+ tree array_of = TREE_TYPE (type);
+ char buffer[40];
+
+ if (an_int_cst == NULL)
+ {
+ /* We are trying to encode an incomplete array. An incomplete
+ array is forbidden as part of an instance variable; but it
+ may occur if the instance variable is a pointer to such an
+ array. */
+
+ /* So the only case in which an incomplete array could occur
+ (without being pointed to) is if we are encoding the
+ arguments or return value of a method. In that case, an
+ incomplete array argument or return value (eg,
+ -(void)display: (char[])string) is treated like a pointer
+ because that is how the compiler does the function call. A
+ special, more complicated case, is when the incomplete array
+ is the last member of a struct (eg, if we are encoding
+ "struct { unsigned long int a;double b[];}"), which is again
+ part of a method argument/return value. In that case, we
+ really need to communicate to the runtime that there is an
+ incomplete array (not a pointer!) there. So, we detect that
+ special case and encode it as a zero-length array.
+
+ Try to detect that we are part of a struct. We do this by
+ searching for '=' in the type encoding for the current type.
+ NB: This hack assumes that you can't use '=' as part of a C
+ identifier.
+ */
+ {
+ char *enc = obstack_base (&util_obstack) + curtype;
+ if (memchr (enc, '=',
+ obstack_object_size (&util_obstack) - curtype) == NULL)
+ {
+ /* We are not inside a struct. Encode the array as a
+ pointer. */
+ encode_pointer (type, curtype, format);
+ return;
+ }
+ }
+
+ /* Else, we are in a struct, and we encode it as a zero-length
+ array. */
+ sprintf (buffer, "[" HOST_WIDE_INT_PRINT_DEC, (HOST_WIDE_INT)0);
+ }
+ else if (TREE_INT_CST_LOW (TYPE_SIZE (array_of)) == 0)
+ sprintf (buffer, "[" HOST_WIDE_INT_PRINT_DEC, (HOST_WIDE_INT)0);
+ else
+ sprintf (buffer, "[" HOST_WIDE_INT_PRINT_DEC,
+ TREE_INT_CST_LOW (an_int_cst)
+ / TREE_INT_CST_LOW (TYPE_SIZE (array_of)));
+
+ obstack_grow (&util_obstack, buffer, strlen (buffer));
+ encode_type (array_of, curtype, format);
+ obstack_1grow (&util_obstack, ']');
+ return;
+}
+
+/* Encode a vector. The vector type is a GCC extension to C. */
+static void
+encode_vector (tree type, int curtype, int format)
+{
+ tree vector_of = TREE_TYPE (type);
+ char buffer[40];
+
+ /* Vectors are like simple fixed-size arrays. */
+
+ /* Output ![xx,yy,<code>] where xx is the vector_size, yy is the
+ alignment of the vector, and <code> is the base type. Eg, int
+ __attribute__ ((vector_size (16))) gets encoded as ![16,32,i]
+ assuming that the alignment is 32 bytes. We include size and
+ alignment in bytes so that the runtime does not have to have any
+ knowledge of the actual types.
+ */
+ sprintf (buffer, "![" HOST_WIDE_INT_PRINT_DEC ",%d",
+ /* We want to compute the equivalent of sizeof (<vector>).
+ Code inspired by c_sizeof_or_alignof_type. */
+ ((TREE_INT_CST_LOW (TYPE_SIZE_UNIT (type))
+ / (TYPE_PRECISION (char_type_node) / BITS_PER_UNIT))),
+ /* We want to compute the equivalent of __alignof__
+ (<vector>). Code inspired by
+ c_sizeof_or_alignof_type. */
+ TYPE_ALIGN_UNIT (type));
+ obstack_grow (&util_obstack, buffer, strlen (buffer));
+ encode_type (vector_of, curtype, format);
+ obstack_1grow (&util_obstack, ']');
+ return;
+}
+
+static void
+encode_aggregate_fields (tree type, bool pointed_to, int curtype, int format)
+{
+ tree field = TYPE_FIELDS (type);
+
+ for (; field; field = DECL_CHAIN (field))
+ {
+#ifdef OBJCPLUS
+ /* C++ static members, and things that are not field at all,
+ should not appear in the encoding. */
+ if (TREE_CODE (field) != FIELD_DECL || TREE_STATIC (field))
+ continue;
+#endif
+
+ /* Recursively encode fields of embedded base classes. */
+ if (DECL_ARTIFICIAL (field) && !DECL_NAME (field)
+ && TREE_CODE (TREE_TYPE (field)) == RECORD_TYPE)
+ {
+ encode_aggregate_fields (TREE_TYPE (field),
+ pointed_to, curtype, format);
+ continue;
+ }
+
+ if (generating_instance_variables && !pointed_to)
+ {
+ tree fname = DECL_NAME (field);
+
+ obstack_1grow (&util_obstack, '"');
+
+ if (fname && TREE_CODE (fname) == IDENTIFIER_NODE)
+ obstack_grow (&util_obstack,
+ IDENTIFIER_POINTER (fname),
+ strlen (IDENTIFIER_POINTER (fname)));
+
+ obstack_1grow (&util_obstack, '"');
+ }
+
+ encode_field_decl (field, curtype, format);
+ }
+}
+
+static void
+encode_aggregate_within (tree type, int curtype, int format, int left,
+ int right)
+{
+ tree name;
+ /* NB: aggregates that are pointed to have slightly different encoding
+ rules in that you never encode the names of instance variables. */
+ int ob_size = obstack_object_size (&util_obstack);
+ bool inline_contents = false;
+ bool pointed_to = false;
+
+ if (flag_next_runtime)
+ {
+ if (ob_size > 0 && *(obstack_next_free (&util_obstack) - 1) == '^')
+ pointed_to = true;
+
+ if ((format == OBJC_ENCODE_INLINE_DEFS || generating_instance_variables)
+ && (!pointed_to || ob_size - curtype == 1
+ || (ob_size - curtype == 2
+ && *(obstack_next_free (&util_obstack) - 2) == 'r')))
+ inline_contents = true;
+ }
+ else
+ {
+ /* c0 and c1 are the last two characters in the encoding of the
+ current type; if the last two characters were '^' or '^r',
+ then we are encoding an aggregate that is "pointed to". The
+ comment above applies: in that case we should avoid encoding
+ the names of instance variables.
+ */
+ char c1 = ob_size > 1 ? *(obstack_next_free (&util_obstack) - 2) : 0;
+ char c0 = ob_size > 0 ? *(obstack_next_free (&util_obstack) - 1) : 0;
+
+ if (c0 == '^' || (c1 == '^' && c0 == 'r'))
+ pointed_to = true;
+
+ if (format == OBJC_ENCODE_INLINE_DEFS || generating_instance_variables)
+ {
+ if (!pointed_to)
+ inline_contents = true;
+ else
+ {
+ /* Note that the check (ob_size - curtype < 2) prevents
+ infinite recursion when encoding a structure which is
+ a linked list (eg, struct node { struct node *next;
+ }). Each time we follow a pointer, we add one
+ character to ob_size, and curtype is fixed, so after
+ at most two pointers we stop inlining contents and
+ break the loop.
+
+ The other case where we don't inline is "^r", which
+ is a pointer to a constant struct.
+ */
+ if ((ob_size - curtype <= 2) && !(c0 == 'r'))
+ inline_contents = true;
+ }
+ }
+ }
+
+ /* Traverse struct aliases; it is important to get the
+ original struct and its tag name (if any). */
+ type = TYPE_MAIN_VARIANT (type);
+ name = OBJC_TYPE_NAME (type);
+ /* Open parenth/bracket. */
+ obstack_1grow (&util_obstack, left);
+
+ /* Encode the struct/union tag name, or '?' if a tag was
+ not provided. Typedef aliases do not qualify. */
+#ifdef OBJCPLUS
+ /* For compatibility with the NeXT runtime, ObjC++ encodes template
+ args as a composite struct tag name. */
+ if (name && TREE_CODE (name) == IDENTIFIER_NODE
+ /* Did this struct have a tag? */
+ && !TYPE_WAS_ANONYMOUS (type))
+ obstack_grow (&util_obstack,
+ decl_as_string (type, TFF_DECL_SPECIFIERS | TFF_UNQUALIFIED_NAME),
+ strlen (decl_as_string (type, TFF_DECL_SPECIFIERS | TFF_UNQUALIFIED_NAME)));
+#else
+ if (name && TREE_CODE (name) == IDENTIFIER_NODE)
+ obstack_grow (&util_obstack,
+ IDENTIFIER_POINTER (name),
+ strlen (IDENTIFIER_POINTER (name)));
+#endif
+ else
+ obstack_1grow (&util_obstack, '?');
+
+ /* Encode the types (and possibly names) of the inner fields,
+ if required. */
+ if (inline_contents)
+ {
+ obstack_1grow (&util_obstack, '=');
+ encode_aggregate_fields (type, pointed_to, curtype, format);
+ }
+ /* Close parenth/bracket. */
+ obstack_1grow (&util_obstack, right);
+}
+
+/* Encode a bitfield NeXT-style (i.e., without a bit offset or the underlying
+ field type. */
+
+static void
+encode_next_bitfield (int width)
+{
+ char buffer[40];
+ sprintf (buffer, "b%d", width);
+ obstack_grow (&util_obstack, buffer, strlen (buffer));
+}
+
+/* Encodes 'type', ignoring type qualifiers (which you should encode
+ beforehand if needed) with the exception of 'const', which is
+ encoded by encode_type. See above for the explanation of
+ 'curtype'. 'format' can be OBJC_ENCODE_INLINE_DEFS or
+ OBJC_ENCODE_DONT_INLINE_DEFS.
+*/
+static void
+encode_type (tree type, int curtype, int format)
+{
+ enum tree_code code = TREE_CODE (type);
+
+ /* Ignore type qualifiers other than 'const' when encoding a
+ type. */
+
+ if (type == error_mark_node)
+ return;
+
+ if (!flag_next_runtime)
+ {
+ if (TYPE_READONLY (type))
+ obstack_1grow (&util_obstack, 'r');
+ }
+
+ switch (code)
+ {
+ case ENUMERAL_TYPE:
+ if (flag_next_runtime)
+ {
+ /* Kludge for backwards-compatibility with gcc-3.3: enums
+ are always encoded as 'i' no matter what type they
+ actually are (!). */
+ obstack_1grow (&util_obstack, 'i');
+ break;
+ }
+ /* Else, they are encoded exactly like the integer type that is
+ used by the compiler to store them. */
+ case INTEGER_TYPE:
+ {
+ char c;
+ switch (GET_MODE_BITSIZE (TYPE_MODE (type)))
+ {
+ case 8: c = TYPE_UNSIGNED (type) ? 'C' : 'c'; break;
+ case 16: c = TYPE_UNSIGNED (type) ? 'S' : 's'; break;
+ case 32:
+ {
+ tree int_type = type;
+ if (flag_next_runtime)
+ {
+ /* Another legacy kludge for compatiblity with
+ gcc-3.3: 32-bit longs are encoded as 'l' or 'L',
+ but not always. For typedefs, we need to use 'i'
+ or 'I' instead if encoding a struct field, or a
+ pointer! */
+ int_type = ((!generating_instance_variables
+ && (obstack_object_size (&util_obstack)
+ == (unsigned) curtype))
+ ? TYPE_MAIN_VARIANT (type)
+ : type);
+ }
+ if (int_type == long_unsigned_type_node
+ || int_type == long_integer_type_node)
+ c = TYPE_UNSIGNED (type) ? 'L' : 'l';
+ else
+ c = TYPE_UNSIGNED (type) ? 'I' : 'i';
+ }
+ break;
+ case 64: c = TYPE_UNSIGNED (type) ? 'Q' : 'q'; break;
+ case 128: c = TYPE_UNSIGNED (type) ? 'T' : 't'; break;
+ default: gcc_unreachable ();
+ }
+ obstack_1grow (&util_obstack, c);
+ break;
+ }
+ case REAL_TYPE:
+ {
+ char c;
+ /* Floating point types. */
+ switch (GET_MODE_BITSIZE (TYPE_MODE (type)))
+ {
+ case 32: c = 'f'; break;
+ case 64: c = 'd'; break;
+ case 96:
+ case 128: c = 'D'; break;
+ default: gcc_unreachable ();
+ }
+ obstack_1grow (&util_obstack, c);
+ break;
+ }
+ case VOID_TYPE:
+ obstack_1grow (&util_obstack, 'v');
+ break;
+
+ case BOOLEAN_TYPE:
+ obstack_1grow (&util_obstack, 'B');
+ break;
+
+ case ARRAY_TYPE:
+ encode_array (type, curtype, format);
+ break;
+
+ case POINTER_TYPE:
+#ifdef OBJCPLUS
+ case REFERENCE_TYPE:
+#endif
+ encode_pointer (type, curtype, format);
+ break;
+
+ case RECORD_TYPE:
+ encode_aggregate_within (type, curtype, format, '{', '}');
+ break;
+
+ case UNION_TYPE:
+ encode_aggregate_within (type, curtype, format, '(', ')');
+ break;
+
+ case FUNCTION_TYPE: /* '?' means an unknown type. */
+ obstack_1grow (&util_obstack, '?');
+ break;
+
+ case COMPLEX_TYPE:
+ /* A complex is encoded as 'j' followed by the inner type (eg,
+ "_Complex int" is encoded as 'ji'). */
+ obstack_1grow (&util_obstack, 'j');
+ encode_type (TREE_TYPE (type), curtype, format);
+ break;
+
+ case VECTOR_TYPE:
+ encode_vector (type, curtype, format);
+ break;
+
+ default:
+ warning (0, "unknown type %s found during Objective-C encoding",
+ gen_type_name (type));
+ obstack_1grow (&util_obstack, '?');
+ break;
+ }
+
+ if (flag_next_runtime)
+ {
+ /* Super-kludge. Some ObjC qualifier and type combinations need
+ to be rearranged for compatibility with gcc-3.3. */
+ if (code == POINTER_TYPE && obstack_object_size (&util_obstack) >= 3)
+ {
+ char *enc = obstack_base (&util_obstack) + curtype;
+
+ /* Rewrite "in const" from "nr" to "rn". */
+ if (curtype >= 1 && !strncmp (enc - 1, "nr", 2))
+ strncpy (enc - 1, "rn", 2);
+ }
+ }
+}
+
+static void
+encode_gnu_bitfield (int position, tree type, int size)
+{
+ enum tree_code code = TREE_CODE (type);
+ char buffer[40];
+ char charType = '?';
+
+ /* This code is only executed for the GNU runtime, so we can ignore
+ the NeXT runtime kludge of always encoding enums as 'i' no matter
+ what integers they actually are. */
+ if (code == INTEGER_TYPE || code == ENUMERAL_TYPE)
+ {
+ if (integer_zerop (TYPE_MIN_VALUE (type)))
+ /* Unsigned integer types. */
+ {
+ switch (TYPE_MODE (type))
+ {
+ case QImode:
+ charType = 'C'; break;
+ case HImode:
+ charType = 'S'; break;
+ case SImode:
+ {
+ if (type == long_unsigned_type_node)
+ charType = 'L';
+ else
+ charType = 'I';
+ break;
+ }
+ case DImode:
+ charType = 'Q'; break;
+ default:
+ gcc_unreachable ();
+ }
+ }
+ else
+ /* Signed integer types. */
+ {
+ switch (TYPE_MODE (type))
+ {
+ case QImode:
+ charType = 'c'; break;
+ case HImode:
+ charType = 's'; break;
+ case SImode:
+ {
+ if (type == long_integer_type_node)
+ charType = 'l';
+ else
+ charType = 'i';
+ break;
+ }
+ case DImode:
+ charType = 'q'; break;
+ default:
+ gcc_unreachable ();
+ }
+ }
+ }
+ else
+ {
+ /* Do not do any encoding, produce an error and keep going. */
+ error ("trying to encode non-integer type as a bitfield");
+ return;
+ }
+
+ sprintf (buffer, "b%d%c%d", position, charType, size);
+ obstack_grow (&util_obstack, buffer, strlen (buffer));
+}
+
+void
+encode_field_decl (tree field_decl, int curtype, int format)
+{
+#ifdef OBJCPLUS
+ /* C++ static members, and things that are not fields at all,
+ should not appear in the encoding. */
+ if (TREE_CODE (field_decl) != FIELD_DECL || TREE_STATIC (field_decl))
+ return;
+#endif
+
+ /* Generate the bitfield typing information, if needed. Note the difference
+ between GNU and NeXT runtimes. */
+ if (DECL_BIT_FIELD_TYPE (field_decl))
+ {
+ int size = tree_low_cst (DECL_SIZE (field_decl), 1);
+
+ if (flag_next_runtime)
+ encode_next_bitfield (size);
+ else
+ encode_gnu_bitfield (int_bit_position (field_decl),
+ DECL_BIT_FIELD_TYPE (field_decl), size);
+ }
+ else
+ encode_type (TREE_TYPE (field_decl), curtype, format);
+}
+
+/* This routine encodes the attribute of the input PROPERTY according
+ to following formula:
+
+ Property attributes are stored as a comma-delimited C string.
+ Simple attributes such as readonly are encoded as single
+ character. The parametrized attributes, getter=name and
+ setter=name, are encoded as a single character followed by an
+ identifier. Property types are also encoded as a parametrized
+ attribute. The characters used to encode these attributes are
+ defined by the following enumeration:
+
+ enum PropertyAttributes {
+ kPropertyReadOnly = 'R',
+ kPropertyBycopy = 'C',
+ kPropertyByref = '&',
+ kPropertyDynamic = 'D',
+ kPropertyGetter = 'G',
+ kPropertySetter = 'S',
+ kPropertyInstanceVariable = 'V',
+ kPropertyType = 't',
+ kPropertyWeak = 'W',
+ kPropertyStrong = 'S',
+ kPropertyNonAtomic = 'N'
+ };
+
+ FIXME: Update the implementation to match. */
+tree
+objc_v2_encode_prop_attr (tree property)
+{
+ const char *string;
+ tree type = TREE_TYPE (property);
+ obstack_1grow (&util_obstack, 't');
+ encode_type (type, obstack_object_size (&util_obstack),
+ OBJC_ENCODE_INLINE_DEFS);
+ if (PROPERTY_READONLY (property))
+ obstack_grow (&util_obstack, ",r", 2);
+
+ if (PROPERTY_ASSIGN_SEMANTICS (property) == OBJC_PROPERTY_COPY)
+ obstack_grow (&util_obstack, ",c", 2);
+
+ if (PROPERTY_GETTER_NAME (property))
+ {
+ obstack_grow (&util_obstack, ",g", 2);
+ string = IDENTIFIER_POINTER (PROPERTY_GETTER_NAME (property));
+ obstack_grow (&util_obstack, string, strlen (string));
+ }
+ if (PROPERTY_SETTER_NAME (property))
+ {
+ obstack_grow (&util_obstack, ",s", 2);
+ string = IDENTIFIER_POINTER (PROPERTY_SETTER_NAME (property));
+ obstack_grow (&util_obstack, string, strlen (string));
+ }
+ if (PROPERTY_IVAR_NAME (property))
+ {
+ obstack_grow (&util_obstack, ",i", 2);
+ string = IDENTIFIER_POINTER (PROPERTY_IVAR_NAME (property));
+ obstack_grow (&util_obstack, string, strlen (string));
+ }
+
+ obstack_1grow (&util_obstack, 0); /* null terminate string */
+ string = XOBFINISH (&util_obstack, char *);
+ obstack_free (&util_obstack, util_firstobj);
+ return get_identifier (string);
+}
+
#include "gt-objc-objc-act.h"
diff --git a/gcc/objc/objc-act.h b/gcc/objc/objc-act.h
index b7d840372df..3983d4b1adc 100644
--- a/gcc/objc/objc-act.h
+++ b/gcc/objc/objc-act.h
@@ -1,6 +1,6 @@
/* Declarations for objc-act.c.
Copyright (C) 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009,
- 2010 Free Software Foundation, Inc.
+ 2010, 2011 Free Software Foundation, Inc.
This file is part of GCC.
@@ -28,8 +28,6 @@ bool objc_init (void);
const char *objc_printable_name (tree, int);
tree objc_fold_obj_type_ref (tree, tree);
int objc_gimplify_expr (tree *, gimple_seq *, gimple_seq *);
-tree objc_eh_runtime_type (tree);
-tree objc_eh_personality (void);
/* NB: The remaining public functions are prototyped in c-common.h, for the
benefit of stub-objc.c and objc-act.c. */
@@ -166,6 +164,7 @@ typedef enum objc_property_assign_semantics {
#define CLASS_CATEGORY_LIST(CLASS) TREE_VEC_ELT (TYPE_LANG_SLOT_1 (CLASS), 3)
#define CLASS_PROTOCOL_LIST(CLASS) TREE_VEC_ELT (TYPE_LANG_SLOT_1 (CLASS), 4)
#define TOTAL_CLASS_RAW_IVARS(CLASS) TREE_VEC_ELT (TYPE_LANG_SLOT_1 (CLASS), 5)
+#define CLASS_HAS_EXCEPTION_ATTR(CLASS) (TYPE_LANG_FLAG_0 (CLASS))
#define PROTOCOL_NAME(CLASS) ((CLASS)->type.name)
#define PROTOCOL_LIST(CLASS) TREE_VEC_ELT (TYPE_LANG_SLOT_1 (CLASS), 0)
@@ -176,7 +175,6 @@ typedef enum objc_property_assign_semantics {
#define PROTOCOL_OPTIONAL_CLS_METHODS(CLASS) TREE_VEC_ELT (TYPE_LANG_SLOT_1 (CLASS), 2)
#define PROTOCOL_OPTIONAL_NST_METHODS(CLASS) TREE_VEC_ELT (TYPE_LANG_SLOT_1 (CLASS), 3)
-
/* For CATEGORY_INTERFACE_TYPE, CLASS_INTERFACE_TYPE or PROTOCOL_INTERFACE_TYPE */
#define CLASS_PROPERTY_DECL(CLASS) TREE_VEC_ELT (TYPE_LANG_SLOT_1 (CLASS), 6)
/* For CLASS_IMPLEMENTATION_TYPE or CATEGORY_IMPLEMENTATION_TYPE. */
@@ -215,6 +213,7 @@ typedef enum objc_property_assign_semantics {
= make_tree_vec (OBJC_INFO_SLOT_ELTS); \
} \
while (0)
+
#define DUP_TYPE_OBJC_INFO(DST, SRC) \
do \
{ \
@@ -244,20 +243,21 @@ struct GTY(()) hashed_attribute {
attr next;
tree value;
};
+
struct GTY(()) hashed_entry {
attr list;
hash next;
tree key;
};
+#define SIZEHASHTABLE 257
+
extern GTY ((length ("SIZEHASHTABLE"))) hash *nst_method_hash_list;
extern GTY ((length ("SIZEHASHTABLE"))) hash *cls_method_hash_list;
extern GTY ((length ("SIZEHASHTABLE"))) hash *cls_name_hash_list;
extern GTY ((length ("SIZEHASHTABLE"))) hash *als_name_hash_list;
-#define SIZEHASHTABLE 257
-
/* An array of all the local variables in the current function that
need to be marked as volatile. */
extern GTY(()) VEC(tree,gc) *local_variables_to_volatilize;
@@ -268,8 +268,8 @@ struct GTY(()) imp_entry {
struct imp_entry *next;
tree imp_context;
tree imp_template;
- tree class_decl; /* _OBJC_CLASS_<my_name>; */
- tree meta_decl; /* _OBJC_METACLASS_<my_name>; */
+ tree class_decl; /* _OBJC[_v2]_CLASS/CATEGORY_<my_name>; */
+ tree meta_decl; /* _OBJC[_v2]_METACLASS_<my_name>; */
BOOL_BITFIELD has_cxx_cdtors : 1;
};
@@ -361,6 +361,7 @@ enum objc_tree_index
OCTI_STRING_CLASS_DECL,
OCTI_INTERNAL_CNST_STR_TYPE,
OCTI_SUPER_DECL,
+ OCTI_SUPER_SUPERFIELD_ID,
OCTI_UMSG_NONNIL_DECL,
OCTI_UMSG_NONNIL_STRET_DECL,
OCTI_STORAGE_CLS,
@@ -394,6 +395,11 @@ enum objc_tree_index
OCTI_GET_PROPERTY_STRUCT_DECL,
OCTI_SET_PROPERTY_STRUCT_DECL,
+ /* TODO: Add comment. */
+ /* "V1" stuff. */
+ OCTI_V1_PROP_LIST_TEMPL,
+ OCTI_V1_PROP_NAME_ATTR_CHAIN,
+
OCTI_MAX
};
@@ -433,14 +439,17 @@ extern GTY(()) tree objc_global_trees[OCTI_MAX];
(TREE_CODE (TYPE) == POINTER_TYPE \
&& (TYPE_MAIN_VARIANT (TREE_TYPE (TYPE)) \
== TREE_TYPE (objc_object_type)))
+
#define IS_CLASS(TYPE) \
(TREE_CODE (TYPE) == POINTER_TYPE \
&& (TYPE_MAIN_VARIANT (TREE_TYPE (TYPE)) \
== TREE_TYPE (objc_class_type)))
+
#define IS_PROTOCOL_QUALIFIED_UNTYPED(TYPE) \
((IS_ID (TYPE) || IS_CLASS (TYPE)) \
&& TYPE_HAS_OBJC_INFO (TREE_TYPE (TYPE)) \
&& TYPE_OBJC_PROTOCOL_LIST (TREE_TYPE (TYPE)))
+
#define IS_SUPER(TYPE) \
(TREE_CODE (TYPE) == POINTER_TYPE \
&& TREE_TYPE (TYPE) == objc_super_template)
@@ -549,13 +558,19 @@ extern GTY(()) tree objc_global_trees[OCTI_MAX];
#define objc_class_id objc_global_trees[OCTI_CLS_ID]
#define objc_object_name objc_global_trees[OCTI_ID_NAME]
#define objc_class_name objc_global_trees[OCTI_CLASS_NAME]
+
+/* Constant string classes. */
#define constant_string_id objc_global_trees[OCTI_CNST_STR_ID]
#define constant_string_type objc_global_trees[OCTI_CNST_STR_TYPE]
#define constant_string_global_id \
objc_global_trees[OCTI_CNST_STR_GLOB_ID]
#define string_class_decl objc_global_trees[OCTI_STRING_CLASS_DECL]
#define internal_const_str_type objc_global_trees[OCTI_INTERNAL_CNST_STR_TYPE]
+
#define UOBJC_SUPER_decl objc_global_trees[OCTI_SUPER_DECL]
+#define super_superclassfield_id \
+ objc_global_trees[OCTI_SUPER_SUPERFIELD_ID]
+
#define objc_fast_enumeration_state_template \
objc_global_trees[OCTI_FAST_ENUM_STATE_TEMP]
#define objc_enumeration_mutation_decl \
@@ -563,11 +578,169 @@ extern GTY(()) tree objc_global_trees[OCTI_MAX];
/* Declarations of functions used when synthesizing property
accessors. */
-#define objc_getProperty_decl objc_global_trees[OCTI_GET_PROPERTY_DECL]
-#define objc_setProperty_decl objc_global_trees[OCTI_SET_PROPERTY_DECL]
-#define objc_copyStruct_decl objc_global_trees[OCTI_COPY_STRUCT_DECL]
-#define objc_getPropertyStruct_decl objc_global_trees[OCTI_GET_PROPERTY_STRUCT_DECL]
-#define objc_setPropertyStruct_decl objc_global_trees[OCTI_SET_PROPERTY_STRUCT_DECL]
+#define objc_getProperty_decl objc_global_trees[OCTI_GET_PROPERTY_DECL]
+#define objc_setProperty_decl objc_global_trees[OCTI_SET_PROPERTY_DECL]
+#define objc_copyStruct_decl objc_global_trees[OCTI_COPY_STRUCT_DECL]
+#define objc_getPropertyStruct_decl \
+ objc_global_trees[OCTI_GET_PROPERTY_STRUCT_DECL]
+#define objc_setPropertyStruct_decl \
+ objc_global_trees[OCTI_SET_PROPERTY_STRUCT_DECL]
+
+/* TODO: Add comment. */
+/* V1 stuff. */
+#define objc_prop_list_ptr objc_global_trees[OCTI_V1_PROP_LIST_TEMPL]
+#define prop_names_attr_chain objc_global_trees[OCTI_V1_PROP_NAME_ATTR_CHAIN]
+
+/* Reserved tag definitions. */
+
+#define OBJECT_TYPEDEF_NAME "id"
+#define CLASS_TYPEDEF_NAME "Class"
+
+#define TAG_OBJECT "objc_object"
+#define TAG_CLASS "objc_class"
+#define TAG_SUPER "objc_super"
+#define TAG_SELECTOR "objc_selector"
+
+#define UTAG_CLASS "_objc_class"
+#define UTAG_IVAR "_objc_ivar"
+#define UTAG_IVAR_LIST "_objc_ivar_list"
+#define UTAG_METHOD "_objc_method"
+#define UTAG_METHOD_LIST "_objc_method_list"
+#define UTAG_CATEGORY "_objc_category"
+#define UTAG_MODULE "_objc_module"
+#define UTAG_SYMTAB "_objc_symtab"
+#define UTAG_SUPER "_objc_super"
+#define UTAG_SELECTOR "_objc_selector"
+
+#define UTAG_PROTOCOL "_objc_protocol"
+#define UTAG_METHOD_PROTOTYPE "_objc_method_prototype"
+#define UTAG_METHOD_PROTOTYPE_LIST "_objc__method_prototype_list"
+
+#define PROTOCOL_OBJECT_CLASS_NAME "Protocol"
+
+#define TAG_EXCEPTIONTHROW "objc_exception_throw"
+#define TAG_SYNCENTER "objc_sync_enter"
+#define TAG_SYNCEXIT "objc_sync_exit"
+
+/* Really should be NeXT private. */
+#define UTAG_EXCDATA "_objc_exception_data"
+
+#define TAG_CXX_CONSTRUCT ".cxx_construct"
+#define TAG_CXX_DESTRUCT ".cxx_destruct"
+
+#define TAG_ENUMERATION_MUTATION "objc_enumerationMutation"
+#define TAG_FAST_ENUMERATION_STATE "__objcFastEnumerationState"
+
+typedef enum string_section
+{
+ class_names, /* class, category, protocol, module names */
+ meth_var_names, /* method and variable names */
+ meth_var_types, /* method and variable type descriptors */
+ prop_names_attr /* property names and their attributes. */
+} string_section;
+
+#define METHOD_DEF 0
+#define METHOD_REF 1
+
+/* (Decide if these can ever be validly changed.) */
+#define OBJC_ENCODE_INLINE_DEFS 0
+#define OBJC_ENCODE_DONT_INLINE_DEFS 1
+
+#define BUFSIZE 1024
+
+#define CLS_FACTORY 0x0001L
+#define CLS_META 0x0002L
+/* Runtime metadata flags - ??? apparently unused. */
+
+#define OBJC_MODIFIER_STATIC 0x00000001
+#define OBJC_MODIFIER_FINAL 0x00000002
+#define OBJC_MODIFIER_PUBLIC 0x00000004
+#define OBJC_MODIFIER_PRIVATE 0x00000008
+#define OBJC_MODIFIER_PROTECTED 0x00000010
+#define OBJC_MODIFIER_NATIVE 0x00000020
+#define OBJC_MODIFIER_SYNCHRONIZED 0x00000040
+#define OBJC_MODIFIER_ABSTRACT 0x00000080
+#define OBJC_MODIFIER_VOLATILE 0x00000100
+#define OBJC_MODIFIER_TRANSIENT 0x00000200
+#define OBJC_MODIFIER_NONE_SPECIFIED 0x80000000
+
+#define OBJC_VOID_AT_END void_list_node
+
+/* Exception handling constructs. We begin by having the parser do most
+ of the work and passing us blocks.
+ This allows us to handle different exceptions implementations. */
+
+/* Stack of open try blocks. */
+
+struct objc_try_context
+{
+ struct objc_try_context *outer;
+
+ /* Statements (or statement lists) as processed by the parser. */
+ tree try_body;
+ tree finally_body;
+
+ /* Some file position locations. */
+ location_t try_locus;
+ location_t end_try_locus;
+ location_t end_catch_locus;
+ location_t finally_locus;
+ location_t end_finally_locus;
+
+ /* A STATEMENT_LIST of CATCH_EXPRs, appropriate for sticking into op1
+ of a TRY_CATCH_EXPR. Even when doing Darwin setjmp. */
+ tree catch_list;
+
+ /* The CATCH_EXPR of an open @catch clause. */
+ tree current_catch;
+
+ /* The VAR_DECL holding __builtin_eh_pointer (or equivalent). */
+ tree caught_decl;
+ tree stack_decl;
+ tree rethrow_decl;
+};
+
+/* A small number of routines used by the FE parser and the runtime code
+ generators. Put here as inlines for efficiency in non-lto builds rather
+ than making them externs. */
+
+extern tree objc_create_temporary_var (tree, const char *);
+
+#define objc_is_object_id(TYPE) (OBJC_TYPE_NAME (TYPE) == objc_object_id)
+#define objc_is_class_id(TYPE) (OBJC_TYPE_NAME (TYPE) == objc_class_id)
+
+/* Retrieve category interface CAT_NAME (if any) associated with CLASS. */
+static inline tree
+lookup_category (tree klass, tree cat_name)
+{
+ tree category = CLASS_CATEGORY_LIST (klass);
+
+ while (category && CLASS_SUPER_NAME (category) != cat_name)
+ category = CLASS_CATEGORY_LIST (category);
+ return category;
+}
+
+/* Count only the fields occurring in T. */
+static inline int
+ivar_list_length (tree t)
+{
+ int count = 0;
+
+ for (; t; t = DECL_CHAIN (t))
+ if (TREE_CODE (t) == FIELD_DECL)
+ ++count;
+
+ return count;
+}
+
+static inline tree
+is_ivar (tree decl_chain, tree ident)
+{
+ for ( ; decl_chain; decl_chain = DECL_CHAIN (decl_chain))
+ if (DECL_NAME (decl_chain) == ident)
+ return decl_chain;
+ return NULL_TREE;
+}
#endif /* GCC_OBJC_ACT_H */
diff --git a/gcc/objc/objc-gnu-runtime-abi-01.c b/gcc/objc/objc-gnu-runtime-abi-01.c
new file mode 100644
index 00000000000..7fb87611d69
--- /dev/null
+++ b/gcc/objc/objc-gnu-runtime-abi-01.c
@@ -0,0 +1,2269 @@
+/* GNU Runtime ABI version 8
+ Copyright (C) 2011 Free Software Foundation, Inc.
+ Contributed by Iain Sandoe (split from objc-act.c)
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3, or (at your option)
+any later version.
+
+GCC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING3. If not see
+<http://www.gnu.org/licenses/>. */
+
+#include "config.h"
+#include "system.h"
+#include "coretypes.h"
+#include "tree.h"
+
+#ifdef OBJCPLUS
+#include "cp-tree.h"
+#else
+#include "c-tree.h"
+#include "c-lang.h"
+#endif
+
+#include "langhooks.h"
+#include "c-family/c-objc.h"
+#include "objc-act.h"
+
+/* When building Objective-C++, we are not linking against the C front-end
+ and so need to replicate the C tree-construction functions in some way. */
+#ifdef OBJCPLUS
+#define OBJCP_REMAP_FUNCTIONS
+#include "objcp-decl.h"
+#endif /* OBJCPLUS */
+
+#include "toplev.h"
+#include "ggc.h"
+#include "tree-iterator.h"
+
+#include "objc-runtime-hooks.h"
+#include "objc-runtime-shared-support.h"
+
+/* GNU runtime private definitions. */
+#define DEF_CONSTANT_STRING_CLASS_NAME "NXConstantString"
+
+#define TAG_GETCLASS "objc_get_class"
+#define TAG_GETMETACLASS "objc_get_meta_class"
+
+#define TAG_MSGSEND "objc_msg_lookup"
+#define TAG_MSGSENDSUPER "objc_msg_lookup_super"
+
+/* GNU-specific tags. */
+
+#define TAG_EXECCLASS "__objc_exec_class"
+#define TAG_GNUINIT "__objc_gnu_init"
+
+/* The version identifies which language generation and runtime
+ the module (file) was compiled for, and is recorded in the
+ module descriptor. */
+#define OBJC_VERSION 8
+
+#define PROTOCOL_VERSION 2
+
+/* This macro provides a method of removing ambiguity between runtimes
+ when LTO is in use on targets supporting multiple runtimes.
+
+ For example, at present, any target that includes an implementation of
+ the NeXT runtime needs to place Objective-C meta-data into specific
+ named sections. This should _not_ be done for the GNU runtime, and the
+ folowing macro is used to attach Objective-C private attributes that may
+ be used to identify the runtime for which the meta-data are intended. */
+
+#define OBJCMETA(DECL,VERS,KIND) \
+ if (VERS) \
+ DECL_ATTRIBUTES (DECL) = build_tree_list ((VERS), (KIND));
+
+static void gnu_runtime_01_initialize (void);
+
+static void build_selector_template (void);
+
+static tree gnu_runtime_abi_01_super_superclassfield_id (void);
+
+static tree gnu_runtime_abi_01_class_decl (tree);
+static tree gnu_runtime_abi_01_metaclass_decl (tree);
+static tree gnu_runtime_abi_01_category_decl (tree);
+static tree gnu_runtime_abi_01_protocol_decl (tree);
+static tree gnu_runtime_abi_01_string_decl (tree, const char *, string_section);
+
+static tree gnu_runtime_abi_01_get_class_reference (tree);
+static tree gnu_runtime_abi_01_build_typed_selector_reference (location_t, tree,
+ tree);
+static tree gnu_runtime_abi_01_get_protocol_reference (location_t, tree);
+static tree gnu_runtime_abi_01_build_ivar_ref (location_t, tree, tree);
+static tree gnu_runtime_abi_01_get_class_super_ref (location_t, struct imp_entry *, bool);
+static tree gnu_runtime_abi_01_get_category_super_ref (location_t, struct imp_entry *, bool);
+
+static tree gnu_runtime_abi_01_receiver_is_class_object (tree);
+static tree gnu_runtime_abi_01_get_arg_type_list_base (tree, int, int);
+static tree gnu_runtime_abi_01_build_objc_method_call (location_t, tree, tree,
+ tree, tree, tree, int);
+
+static bool gnu_runtime_abi_01_setup_const_string_class_decl (void);
+static tree gnu_runtime_abi_01_build_const_string_constructor (location_t, tree,int);
+
+static void objc_generate_v1_gnu_metadata (void);
+
+static tree objc_eh_runtime_type (tree type);
+static tree objc_eh_personality (void);
+static tree objc_build_exc_ptr (struct objc_try_context **);
+static tree build_throw_stmt (location_t, tree, bool);
+static tree begin_catch (struct objc_try_context **, tree, tree, tree, bool);
+static void finish_catch (struct objc_try_context **, tree);
+static tree finish_try_stmt (struct objc_try_context **);
+
+bool
+objc_gnu_runtime_abi_01_init (objc_runtime_hooks *rthooks)
+{
+ /* GNU runtime does not need the compiler to change code in order to do GC. */
+ if (flag_objc_gc)
+ {
+ warning_at (0, 0, "%<-fobjc-gc%> is ignored for %<-fgnu-runtime%>");
+ flag_objc_gc = 0;
+ }
+
+ /* Although I guess we could, we don't currently support SJLJ exceptions for the
+ GNU runtime. */
+ if (flag_objc_sjlj_exceptions)
+ {
+ inform (UNKNOWN_LOCATION, "%<-fobjc-sjlj-exceptions%> is ignored for %<-fgnu-runtime%>");
+ flag_objc_sjlj_exceptions = 0;
+ }
+
+ /* TODO: Complain if -fobjc-abi-version=N was used. */
+
+ /* TODO: Complain if -fobj-nilcheck was used. */
+
+ rthooks->initialize = gnu_runtime_01_initialize;
+ rthooks->default_constant_string_class_name = DEF_CONSTANT_STRING_CLASS_NAME;
+ rthooks->tag_getclass = TAG_GETCLASS;
+ rthooks->super_superclassfield_ident = gnu_runtime_abi_01_super_superclassfield_id;
+
+ rthooks->class_decl = gnu_runtime_abi_01_class_decl;
+ rthooks->metaclass_decl = gnu_runtime_abi_01_metaclass_decl;
+ rthooks->category_decl = gnu_runtime_abi_01_category_decl;
+ rthooks->protocol_decl = gnu_runtime_abi_01_protocol_decl;
+ rthooks->string_decl = gnu_runtime_abi_01_string_decl;
+
+ rthooks->get_class_reference = gnu_runtime_abi_01_get_class_reference;
+ rthooks->build_selector_reference = gnu_runtime_abi_01_build_typed_selector_reference;
+ rthooks->get_protocol_reference = gnu_runtime_abi_01_get_protocol_reference;
+ rthooks->build_ivar_reference = gnu_runtime_abi_01_build_ivar_ref;
+ rthooks->get_class_super_ref = gnu_runtime_abi_01_get_class_super_ref;
+ rthooks->get_category_super_ref = gnu_runtime_abi_01_get_category_super_ref;
+
+ rthooks->receiver_is_class_object = gnu_runtime_abi_01_receiver_is_class_object;
+ rthooks->get_arg_type_list_base = gnu_runtime_abi_01_get_arg_type_list_base;
+ rthooks->build_objc_method_call = gnu_runtime_abi_01_build_objc_method_call;
+
+ rthooks->setup_const_string_class_decl =
+ gnu_runtime_abi_01_setup_const_string_class_decl;
+ rthooks->build_const_string_constructor =
+ gnu_runtime_abi_01_build_const_string_constructor;
+
+ rthooks->build_throw_stmt = build_throw_stmt;
+ rthooks->build_exc_ptr = objc_build_exc_ptr;
+ rthooks->begin_catch = begin_catch;
+ rthooks->finish_catch = finish_catch;
+ rthooks->finish_try_stmt = finish_try_stmt;
+
+ rthooks->generate_metadata = objc_generate_v1_gnu_metadata;
+ return true;
+}
+
+static void build_selector_table_decl (void);
+static void build_class_template (void);
+static void build_category_template (void);
+static void build_protocol_template (void);
+
+static GTY(()) tree objc_meta;
+static GTY(()) tree meta_base;
+
+static void gnu_runtime_01_initialize (void)
+{
+ tree type, ftype, IMP_type;
+
+ /* We do not need to mark GNU ObjC metadata for different sections,
+ however, we do need to make sure that it is not mistaken for NeXT
+ metadata. */
+ objc_meta = get_identifier ("OBJC1METG");
+ meta_base = get_identifier ("NONE");
+
+ /* Declare type of selector-objects that represent an operation name. */
+ /* `const struct objc_selector *' */
+ type = xref_tag (RECORD_TYPE, get_identifier (TAG_SELECTOR));
+ type = build_qualified_type (type, TYPE_QUAL_CONST);
+ objc_selector_type = build_pointer_type (type);
+
+ /* typedef id (*IMP)(id, SEL, ...); */
+ ftype = build_varargs_function_type_list (objc_object_type,
+ objc_object_type,
+ objc_selector_type,
+ NULL_TREE);
+
+ IMP_type = build_pointer_type (ftype);
+
+ build_class_template ();
+ build_super_template ();
+ build_protocol_template ();
+ build_category_template ();
+
+ /* GNU runtime messenger entry points. */
+ /* TREE_NOTHROW is cleared for the message-sending functions,
+ because the function that gets called can throw in Obj-C++, or
+ could itself call something that can throw even in Obj-C. */
+
+ /* IMP objc_msg_lookup (id, SEL); */
+ type = build_function_type_list (IMP_type,
+ objc_object_type,
+ objc_selector_type,
+ NULL_TREE);
+
+ umsg_decl = add_builtin_function (TAG_MSGSEND,
+ type, 0, NOT_BUILT_IN,
+ NULL, NULL_TREE);
+ TREE_NOTHROW (umsg_decl) = 0;
+
+ /* IMP objc_msg_lookup_super (struct objc_super *, SEL); */
+ type = build_function_type_list (IMP_type,
+ objc_super_type,
+ objc_selector_type,
+ NULL_TREE);
+
+ umsg_super_decl = add_builtin_function (TAG_MSGSENDSUPER,
+ type, 0, NOT_BUILT_IN,
+ NULL, NULL_TREE);
+ TREE_NOTHROW (umsg_super_decl) = 0;
+
+ /* The following GNU runtime entry point is called to initialize
+ each module:
+
+ __objc_exec_class (void *); */
+ type = build_function_type_list (void_type_node,
+ ptr_type_node,
+ NULL_TREE);
+
+ execclass_decl = add_builtin_function (TAG_EXECCLASS,
+ type, 0, NOT_BUILT_IN,
+ NULL, NULL_TREE);
+
+ type = build_function_type_list (objc_object_type,
+ const_string_type_node,
+ NULL_TREE);
+
+ /* id objc_getClass (const char *); */
+ objc_get_class_decl
+ = add_builtin_function (TAG_GETCLASS, type, 0, NOT_BUILT_IN,
+ NULL, NULL_TREE);
+
+ /* id objc_getMetaClass (const char *); */
+ objc_get_meta_class_decl = add_builtin_function (TAG_GETMETACLASS, type,
+ 0, NOT_BUILT_IN, NULL,
+ NULL_TREE);
+
+ /* static SEL _OBJC_SELECTOR_TABLE[]; */
+ build_selector_table_decl ();
+
+ /* Stuff for properties.
+ The codegen relies on this being NULL for GNU. */
+ objc_copyStruct_decl = NULL_TREE;
+
+ /* This is the type of all of the following functions
+ bjc_getPropertyStruct() and objc_setPropertyStruct(). */
+ type = build_function_type_list (void_type_node,
+ ptr_type_node,
+ const_ptr_type_node,
+ ptrdiff_type_node,
+ boolean_type_node,
+ boolean_type_node,
+ NULL_TREE);
+
+ /* Declare the following function:
+ void
+ objc_getPropertyStruct (void *destination, const void *source,
+ ptrdiff_t size, BOOL is_atomic, BOOL has_strong); */
+ objc_getPropertyStruct_decl = add_builtin_function ("objc_getPropertyStruct",
+ type, 0, NOT_BUILT_IN,
+ NULL, NULL_TREE);
+ TREE_NOTHROW (objc_getPropertyStruct_decl) = 0;
+ /* Declare the following function:
+ void
+ objc_setPropertyStruct (void *destination, const void *source,
+ ptrdiff_t size, BOOL is_atomic, BOOL has_strong); */
+ objc_setPropertyStruct_decl = add_builtin_function ("objc_setPropertyStruct",
+ type, 0, NOT_BUILT_IN,
+ NULL, NULL_TREE);
+ TREE_NOTHROW (objc_setPropertyStruct_decl) = 0;
+
+ using_eh_for_cleanups ();
+ lang_hooks.eh_runtime_type = objc_eh_runtime_type;
+ lang_hooks.eh_personality = objc_eh_personality;
+}
+
+/* --- templates --- */
+/* struct _objc_selector {
+ SEL sel_id;
+ char *sel_type;
+ }; */
+
+static void
+build_selector_template (void)
+{
+ tree decls, *chain = NULL;
+
+ objc_selector_template = objc_start_struct (get_identifier (UTAG_SELECTOR));
+
+ /* SEL sel_id; */
+ decls = add_field_decl (objc_selector_type, "sel_id", &chain);
+
+ /* char *sel_type; */
+ add_field_decl (string_type_node, "sel_type", &chain);
+
+ objc_finish_struct (objc_selector_template, decls);
+}
+
+/* struct _objc_class {
+ struct _objc_class *isa;
+ struct _objc_class *super_class;
+ char *name;
+ long version;
+ long info;
+ long instance_size;
+ struct _objc_ivar_list *ivars;
+ struct _objc_method_list *methods;
+ struct sarray *dtable;
+ struct _objc_class *subclass_list;
+ struct _objc_class *sibling_class;
+ struct _objc_protocol_list *protocols;
+ void *gc_object_type;
+ }; */
+
+static void
+build_class_template (void)
+{
+ tree ptype, decls, *chain = NULL;
+
+ objc_class_template = objc_start_struct (get_identifier (UTAG_CLASS));
+
+ /* struct _objc_class *isa; */
+ decls = add_field_decl (build_pointer_type (objc_class_template),
+ "isa", &chain);
+
+ /* struct _objc_class *super_class; */
+ add_field_decl (build_pointer_type (objc_class_template),
+ "super_class", &chain);
+
+ /* char *name; */
+ add_field_decl (string_type_node, "name", &chain);
+
+ /* long version; */
+ add_field_decl (long_integer_type_node, "version", &chain);
+
+ /* long info; */
+ add_field_decl (long_integer_type_node, "info", &chain);
+
+ /* long instance_size; */
+ add_field_decl (long_integer_type_node, "instance_size", &chain);
+
+ /* struct _objc_ivar_list *ivars; */
+ add_field_decl (objc_ivar_list_ptr,"ivars", &chain);
+
+ /* struct _objc_method_list *methods; */
+ add_field_decl (objc_method_list_ptr, "methods", &chain);
+
+ /* struct sarray *dtable; */
+ ptype = build_pointer_type(xref_tag (RECORD_TYPE,
+ get_identifier ("sarray")));
+ add_field_decl (ptype, "dtable", &chain);
+
+ /* struct objc_class *subclass_list; */
+ ptype = build_pointer_type (objc_class_template);
+ add_field_decl (ptype, "subclass_list", &chain);
+
+ /* struct objc_class *sibling_class; */
+ ptype = build_pointer_type (objc_class_template);
+ add_field_decl (ptype, "sibling_class", &chain);
+
+ /* struct _objc_protocol **protocol_list; */
+ ptype = build_pointer_type (build_pointer_type
+ (xref_tag (RECORD_TYPE,
+ get_identifier (UTAG_PROTOCOL))));
+ add_field_decl (ptype, "protocol_list", &chain);
+
+ /* void *gc_object_type; */
+ add_field_decl (build_pointer_type (void_type_node),
+ "gc_object_type", &chain);
+
+ objc_finish_struct (objc_class_template, decls);
+}
+
+/* struct _objc_category {
+ char *category_name;
+ char *class_name;
+ struct _objc_method_list *instance_methods;
+ struct _objc_method_list *class_methods;
+ struct _objc_protocol_list *protocols;
+ }; */
+
+static void
+build_category_template (void)
+{
+ tree ptype, decls, *chain = NULL;
+
+ objc_category_template = objc_start_struct (get_identifier (UTAG_CATEGORY));
+
+ /* char *category_name; */
+ decls = add_field_decl (string_type_node, "category_name", &chain);
+
+ /* char *class_name; */
+ add_field_decl (string_type_node, "class_name", &chain);
+
+ /* struct _objc_method_list *instance_methods; */
+ add_field_decl (objc_method_list_ptr, "instance_methods", &chain);
+
+ /* struct _objc_method_list *class_methods; */
+ add_field_decl (objc_method_list_ptr, "class_methods", &chain);
+
+ /* struct _objc_protocol **protocol_list; */
+ ptype = build_pointer_type (build_pointer_type (objc_protocol_template));
+ add_field_decl (ptype, "protocol_list", &chain);
+
+ objc_finish_struct (objc_category_template, decls);
+}
+
+/* struct _objc_protocol {
+ struct _objc_class *isa;
+ char *protocol_name;
+ struct _objc_protocol **protocol_list;
+ struct _objc__method_prototype_list *instance_methods;
+ struct _objc__method_prototype_list *class_methods;
+ }; */
+
+static void
+build_protocol_template (void)
+{
+ tree ptype, decls, *chain = NULL;
+
+ objc_protocol_template = objc_start_struct (get_identifier (UTAG_PROTOCOL));
+
+ /* struct _objc_class *isa; */
+ ptype = build_pointer_type (xref_tag (RECORD_TYPE,
+ get_identifier (UTAG_CLASS)));
+ decls = add_field_decl (ptype, "isa", &chain);
+
+ /* char *protocol_name; */
+ add_field_decl (string_type_node, "protocol_name", &chain);
+
+ /* struct _objc_protocol **protocol_list; */
+ ptype = build_pointer_type (build_pointer_type (objc_protocol_template));
+ add_field_decl (ptype, "protocol_list", &chain);
+
+ /* struct _objc__method_prototype_list *instance_methods; */
+ add_field_decl (objc_method_proto_list_ptr, "instance_methods", &chain);
+
+ /* struct _objc__method_prototype_list *class_methods; */
+ add_field_decl (objc_method_proto_list_ptr, "class_methods", &chain);
+
+ objc_finish_struct (objc_protocol_template, decls);
+}
+
+/* --- names, decls + identifers --- */
+
+static void
+build_selector_table_decl (void)
+{
+ tree temp;
+
+ build_selector_template ();
+ temp = build_array_type (objc_selector_template, NULL_TREE);
+
+ UOBJC_SELECTOR_TABLE_decl = start_var_decl (temp, "_OBJC_SELECTOR_TABLE");
+ OBJCMETA (UOBJC_SELECTOR_TABLE_decl, objc_meta, meta_base);
+}
+
+
+static tree
+gnu_runtime_abi_01_super_superclassfield_id (void)
+{
+ if (!super_superclassfield_id)
+ super_superclassfield_id = get_identifier ("super_class");
+ return super_superclassfield_id;
+}
+
+
+static tree
+gnu_runtime_abi_01_class_decl (tree klass)
+{
+ tree decl;
+ char buf[BUFSIZE];
+ snprintf (buf, BUFSIZE, "_OBJC_Class_%s",
+ IDENTIFIER_POINTER (CLASS_NAME (klass)));
+ decl = start_var_decl (objc_class_template, buf);
+ OBJCMETA (decl, objc_meta, meta_base);
+ return decl;
+}
+
+static tree
+gnu_runtime_abi_01_metaclass_decl (tree klass)
+{
+ tree decl;
+ char buf[BUFSIZE];
+ snprintf (buf, BUFSIZE, "_OBJC_MetaClass_%s",
+ IDENTIFIER_POINTER (CLASS_NAME (klass)));
+ decl = start_var_decl (objc_class_template, buf);
+ OBJCMETA (decl, objc_meta, meta_base);
+ return decl;
+}
+
+static tree
+gnu_runtime_abi_01_category_decl (tree klass)
+{
+ tree decl;
+ char buf[BUFSIZE];
+ snprintf (buf, BUFSIZE, "_OBJC_Category_%s_on_%s",
+ IDENTIFIER_POINTER (CLASS_SUPER_NAME (klass)),
+ IDENTIFIER_POINTER (CLASS_NAME (klass)));
+ decl = start_var_decl (objc_category_template, buf);
+ OBJCMETA (decl, objc_meta, meta_base);
+ return decl;
+}
+
+static tree
+gnu_runtime_abi_01_protocol_decl (tree p)
+{
+ tree decl;
+ char buf[BUFSIZE];
+
+ /* static struct _objc_protocol _OBJC_Protocol_<mumble>; */
+ snprintf (buf, BUFSIZE, "_OBJC_Protocol_%s",
+ IDENTIFIER_POINTER (PROTOCOL_NAME (p)));
+ decl = start_var_decl (objc_protocol_template, buf);
+ OBJCMETA (decl, objc_meta, meta_base);
+ return decl;
+}
+
+static tree
+gnu_runtime_abi_01_string_decl (tree type, const char *name,
+ string_section where ATTRIBUTE_UNUSED)
+{
+ tree decl = start_var_decl (type, name);
+ OBJCMETA (decl, objc_meta, meta_base);
+ return decl;
+}
+
+/* --- entry --- */
+
+static tree
+gnu_runtime_abi_01_get_class_reference (tree ident)
+{
+ tree params;
+
+ add_class_reference (ident);
+
+ params = build_tree_list (NULL_TREE, my_build_string_pointer
+ (IDENTIFIER_LENGTH (ident) + 1,
+ IDENTIFIER_POINTER (ident)));
+
+ /* FIXME: Do we need this assemble_external() ? */
+ /* assemble_external (objc_get_class_decl);*/
+ return build_function_call (input_location, objc_get_class_decl, params);
+}
+
+/* Used by get_arg_type_list.
+ Return the types for receiver & _cmd at the start of a method argument list.
+ context is either METHOD_DEF or METHOD_REF, saying whether we are trying
+ to define a method or call one. superflag says this is for a send to super.
+ meth may be NULL, in the case that there is no prototype. */
+
+static tree
+gnu_runtime_abi_01_get_arg_type_list_base (tree meth, int context,
+ int superflag ATTRIBUTE_UNUSED)
+{
+ tree arglist;
+
+ /* Receiver type. */
+ if (context == METHOD_DEF && TREE_CODE (meth) == INSTANCE_METHOD_DECL)
+ arglist = build_tree_list (NULL_TREE, objc_instance_type);
+ else
+ arglist = build_tree_list (NULL_TREE, objc_object_type);
+
+ /* Selector type - will eventually change to `int'. */
+ chainon (arglist, build_tree_list (NULL_TREE, objc_selector_type));
+ return arglist;
+}
+
+/* Unused for GNU runtime. */
+static tree
+gnu_runtime_abi_01_receiver_is_class_object (tree a ATTRIBUTE_UNUSED)
+{
+ return NULL_TREE;
+}
+
+/* sel_ref_chain is a list whose "value" fields will be instances of
+ identifier_node that represent the selector. LOC is the location of
+ the @selector. */
+
+static tree
+gnu_runtime_abi_01_build_typed_selector_reference (location_t loc, tree ident,
+ tree prototype)
+{
+ tree *chain = &sel_ref_chain;
+ tree expr;
+ int index = 0;
+
+ while (*chain)
+ {
+ /* When we do a lookup for @selector () we have no idea of the
+ prototype - so match the first we find. */
+ if (TREE_VALUE (*chain) == ident
+ && (!prototype || TREE_PURPOSE (*chain) == prototype))
+ goto return_at_index;
+
+ index++;
+ chain = &TREE_CHAIN (*chain);
+ }
+
+ *chain = tree_cons (prototype, ident, NULL_TREE);
+
+ /* TODO: Use a vec and keep this in it to (a) avoid re-creating and
+ (b) provide better diagnostics for the first time an undefined
+ selector is used. */
+ return_at_index:
+ expr = build_unary_op (loc, ADDR_EXPR,
+ build_array_ref (loc, UOBJC_SELECTOR_TABLE_decl,
+ build_int_cst (NULL_TREE, index)),
+ 1);
+ return convert (objc_selector_type, expr);
+}
+
+/* Build a tree expression to send OBJECT the operation SELECTOR,
+ looking up the method on object LOOKUP_OBJECT (often same as OBJECT),
+ assuming the method has prototype METHOD_PROTOTYPE.
+ (That is an INSTANCE_METHOD_DECL or CLASS_METHOD_DECL.)
+ LOC is the location of the expression to build.
+ Use METHOD_PARAMS as list of args to pass to the method.
+ If SUPER_FLAG is nonzero, we look up the superclass's method. */
+
+static tree
+build_objc_method_call (location_t loc, int super_flag, tree method_prototype,
+ tree lookup_object, tree selector,
+ tree method_params)
+{
+ tree sender = (super_flag ? umsg_super_decl
+ : (flag_objc_direct_dispatch ? umsg_fast_decl
+ : umsg_decl));
+ tree rcv_p = (super_flag ? objc_super_type : objc_object_type);
+ VEC(tree, gc) *parms;
+ VEC(tree, gc) *tv;
+ unsigned nparm = (method_params ? list_length (method_params) : 0);
+
+ /* If a prototype for the method to be called exists, then cast
+ the sender's return type and arguments to match that of the method.
+ Otherwise, leave sender as is. */
+ tree ret_type
+ = (method_prototype
+ ? TREE_VALUE (TREE_TYPE (method_prototype))
+ : objc_object_type);
+
+ tree method_param_types =
+ get_arg_type_list (method_prototype, METHOD_REF, super_flag);
+ tree ftype = build_function_type (ret_type, method_param_types);
+ tree sender_cast;
+ tree method, t;
+
+ if (method_prototype && METHOD_TYPE_ATTRIBUTES (method_prototype))
+ ftype = build_type_attribute_variant (ftype,
+ METHOD_TYPE_ATTRIBUTES
+ (method_prototype));
+
+ sender_cast = build_pointer_type (ftype);
+
+ lookup_object = build_c_cast (loc, rcv_p, lookup_object);
+
+ /* Use SAVE_EXPR to avoid evaluating the receiver twice. */
+ lookup_object = save_expr (lookup_object);
+
+ /* Param list + 2 slots for object and selector. */
+ parms = VEC_alloc (tree, gc, nparm + 2);
+ tv = VEC_alloc (tree, gc, 2);
+
+ /* First, call the lookup function to get a pointer to the method,
+ then cast the pointer, then call it with the method arguments. */
+ VEC_quick_push (tree, tv, lookup_object);
+ VEC_quick_push (tree, tv, selector);
+ method = build_function_call_vec (loc, sender, tv, NULL);
+ VEC_free (tree, gc, tv);
+
+ /* Pass the appropriate object to the method. */
+ VEC_quick_push (tree, parms, (super_flag ? self_decl : lookup_object));
+
+ /* Pass the selector to the method. */
+ VEC_quick_push (tree, parms, selector);
+ /* Now append the remainder of the parms. */
+ if (nparm)
+ for (; method_params; method_params = TREE_CHAIN (method_params))
+ VEC_quick_push (tree, parms, TREE_VALUE (method_params));
+
+ /* Build an obj_type_ref, with the correct cast for the method call. */
+ t = build3 (OBJ_TYPE_REF, sender_cast, method, lookup_object, size_zero_node);
+ t = build_function_call_vec (loc, t, parms, NULL);
+ VEC_free (tree, gc, parms);
+ return t;
+}
+
+static tree
+gnu_runtime_abi_01_build_objc_method_call (location_t loc,
+ tree method_prototype,
+ tree receiver,
+ tree rtype ATTRIBUTE_UNUSED,
+ tree sel_name,
+ tree method_params,
+ int super ATTRIBUTE_UNUSED)
+{
+ tree selector =
+ gnu_runtime_abi_01_build_typed_selector_reference (loc,
+ sel_name,
+ method_prototype);
+
+ return build_objc_method_call (loc, super, method_prototype, receiver,
+ selector, method_params);
+}
+
+static tree
+gnu_runtime_abi_01_get_protocol_reference (location_t loc, tree p)
+{
+ tree expr, protocol_struct_type, *chain;
+ if (!PROTOCOL_FORWARD_DECL (p))
+ PROTOCOL_FORWARD_DECL (p) = gnu_runtime_abi_01_protocol_decl (p);
+
+ expr = build_unary_op (loc, ADDR_EXPR, PROTOCOL_FORWARD_DECL (p), 0);
+
+ /* ??? Ideally we'd build the reference with objc_protocol_type directly,
+ if we have it, rather than converting it here. */
+ expr = convert (objc_protocol_type, expr);
+
+ /* The @protocol() expression is being compiled into a pointer to a
+ statically allocated instance of the Protocol class. To become
+ usable at runtime, the 'isa' pointer of the instance need to be
+ fixed up at runtime by the runtime library, to point to the
+ actual 'Protocol' class. */
+
+ /* For the GNU runtime, put the static Protocol instance in the list
+ of statically allocated instances, so that we make sure that its
+ 'isa' pointer is fixed up at runtime by the GNU runtime library
+ to point to the Protocol class (at runtime, when loading the
+ module, the GNU runtime library loops on the statically allocated
+ instances (as found in the defs field in objc_symtab) and fixups
+ all the 'isa' pointers of those objects). */
+
+ /* This type is a struct containing the fields of a Protocol
+ object. (Cfr. objc_protocol_type instead is the type of a pointer
+ to such a struct). */
+ protocol_struct_type = xref_tag (RECORD_TYPE,
+ get_identifier (PROTOCOL_OBJECT_CLASS_NAME));
+
+ /* Look for the list of Protocol statically allocated instances
+ to fixup at runtime. Create a new list to hold Protocol
+ statically allocated instances, if the list is not found. At
+ present there is only another list, holding NSConstantString
+ static instances to be fixed up at runtime. */
+
+ for (chain = &objc_static_instances;
+ *chain && TREE_VALUE (*chain) != protocol_struct_type;
+ chain = &TREE_CHAIN (*chain));
+
+ if (!*chain)
+ {
+ *chain = tree_cons (NULL_TREE, protocol_struct_type, NULL_TREE);
+ add_objc_string (OBJC_TYPE_NAME (protocol_struct_type),
+ class_names);
+ }
+
+ /* Add this statically allocated instance to the Protocol list. */
+ TREE_PURPOSE (*chain) = tree_cons (NULL_TREE,
+ PROTOCOL_FORWARD_DECL (p),
+ TREE_PURPOSE (*chain));
+ return expr;
+}
+
+/* For ABI 8 an IVAR is just a fixed offset in the class struct. */
+
+static tree
+gnu_runtime_abi_01_build_ivar_ref (location_t loc ATTRIBUTE_UNUSED,
+ tree base, tree id)
+{
+ return objc_build_component_ref (base, id);
+}
+
+/* We build super class references as we need them (but keep them once
+ built for the sake of efficiency). */
+
+static tree
+gnu_runtime_abi_01_get_class_super_ref (location_t loc ATTRIBUTE_UNUSED,
+ struct imp_entry *imp, bool inst_meth)
+{
+ if (inst_meth)
+ {
+ if (!ucls_super_ref)
+ ucls_super_ref =
+ objc_build_component_ref (imp->class_decl,
+ get_identifier ("super_class"));
+ return ucls_super_ref;
+ }
+ else
+ {
+ if (!uucls_super_ref)
+ uucls_super_ref =
+ objc_build_component_ref (imp->meta_decl,
+ get_identifier ("super_class"));
+ return uucls_super_ref;
+ }
+}
+
+static tree
+gnu_runtime_abi_01_get_category_super_ref (location_t loc ATTRIBUTE_UNUSED,
+ struct imp_entry *imp, bool inst_meth)
+{
+ tree super_name = CLASS_SUPER_NAME (imp->imp_template);
+ tree super_class;
+
+ add_class_reference (super_name);
+ super_class = (inst_meth ? objc_get_class_decl : objc_get_meta_class_decl);
+ /* FIXME: Do we need this assemble_external() ? */
+ /* assemble_external (super_class);*/
+ super_name = my_build_string_pointer (IDENTIFIER_LENGTH (super_name) + 1,
+ IDENTIFIER_POINTER (super_name));
+ /* super_class = get_{meta_}class("CLASS_SUPER_NAME"); */
+ return build_function_call (input_location,
+ super_class,
+ build_tree_list (NULL_TREE, super_name));
+}
+
+static bool
+gnu_runtime_abi_01_setup_const_string_class_decl (void)
+{
+ /* Do nothing, and create no error. */
+ return true;
+}
+
+/* Declare a static instance of CLASS_DECL initialized by CONSTRUCTOR. */
+
+static GTY(()) int num_static_inst;
+
+static tree
+objc_add_static_instance (tree constructor, tree class_decl)
+{
+ tree *chain, decl;
+ char buf[BUFSIZE];
+
+ /* Find the list of static instances for the CLASS_DECL. Create one if
+ not found. */
+ for (chain = &objc_static_instances;
+ *chain && TREE_VALUE (*chain) != class_decl;
+ chain = &TREE_CHAIN (*chain));
+ if (!*chain)
+ {
+ *chain = tree_cons (NULL_TREE, class_decl, NULL_TREE);
+ add_objc_string (OBJC_TYPE_NAME (class_decl), class_names);
+ }
+
+ snprintf (buf, BUFSIZE, "_OBJC_INSTANCE_%d", num_static_inst++);
+ decl = build_decl (input_location,
+ VAR_DECL, get_identifier (buf), class_decl);
+ TREE_STATIC (decl) = 1;
+ DECL_ARTIFICIAL (decl) = 1;
+ TREE_USED (decl) = 1;
+ DECL_INITIAL (decl) = constructor;
+ DECL_CONTEXT (decl) = NULL;
+ OBJCMETA (decl, objc_meta, meta_base);
+
+ /* We may be writing something else just now.
+ Postpone till end of input. */
+ DECL_DEFER_OUTPUT (decl) = 1;
+ pushdecl_top_level (decl);
+ rest_of_decl_compilation (decl, 1, 0);
+
+ /* Add the DECL to the head of this CLASS' list. */
+ TREE_PURPOSE (*chain) = tree_cons (NULL_TREE, decl, TREE_PURPOSE (*chain));
+
+ return decl;
+}
+
+static tree
+gnu_runtime_abi_01_build_const_string_constructor (location_t loc, tree string,
+ int length)
+{
+ tree constructor, fields;
+ VEC(constructor_elt,gc) *v = NULL;
+
+ /* GNU: (NXConstantString *) & ((__builtin_ObjCString) { NULL, string, length }) */
+ fields = TYPE_FIELDS (internal_const_str_type);
+ CONSTRUCTOR_APPEND_ELT (v, fields, build_int_cst (NULL_TREE, 0));
+
+ fields = DECL_CHAIN (fields);
+ CONSTRUCTOR_APPEND_ELT (v, fields, build_unary_op (loc,
+ ADDR_EXPR, string, 1));
+
+ fields = DECL_CHAIN (fields);
+ CONSTRUCTOR_APPEND_ELT (v, fields, build_int_cst (NULL_TREE, length));
+ constructor = objc_build_constructor (internal_const_str_type, v);
+
+ constructor = objc_add_static_instance (constructor, constant_string_type);
+ return constructor;
+}
+
+/* --- metadata - module initializer --- */
+
+/* The GNU runtime requires us to provide a static initializer function
+ for each module:
+
+ static void __objc_gnu_init (void) {
+ __objc_exec_class (&L_OBJC_MODULES);
+ } */
+
+
+static void
+build_module_initializer_routine (void)
+{
+ tree body;
+
+#ifdef OBJCPLUS
+ push_lang_context (lang_name_c); /* extern "C" */
+#endif
+
+ objc_push_parm (build_decl (input_location,
+ PARM_DECL, NULL_TREE, void_type_node));
+#ifdef OBJCPLUS
+ objc_start_function (get_identifier (TAG_GNUINIT),
+ build_function_type_list (void_type_node, NULL_TREE),
+ NULL_TREE, NULL_TREE);
+#else
+ objc_start_function (get_identifier (TAG_GNUINIT),
+ build_function_type_list (void_type_node, NULL_TREE),
+ NULL_TREE, objc_get_parm_info (0));
+#endif
+ body = c_begin_compound_stmt (true);
+ add_stmt (build_function_call
+ (input_location,
+ execclass_decl,
+ build_tree_list
+ (NULL_TREE,
+ build_unary_op (input_location, ADDR_EXPR,
+ UOBJC_MODULES_decl, 0))));
+ add_stmt (c_end_compound_stmt (input_location, body, true));
+
+ TREE_PUBLIC (current_function_decl) = 0;
+
+#ifndef OBJCPLUS
+ /* For Objective-C++, we will need to call __objc_gnu_init
+ from objc_generate_static_init_call() below. */
+ DECL_STATIC_CONSTRUCTOR (current_function_decl) = 1;
+#endif
+
+ GNU_INIT_decl = current_function_decl;
+ finish_function ();
+
+#ifdef OBJCPLUS
+ pop_lang_context ();
+#endif
+}
+
+#ifdef OBJCPLUS
+/* Return 1 if the __objc_gnu_init function has been synthesized and needs
+ to be called by the module initializer routine. */
+
+int
+objc_static_init_needed_p (void)
+{
+ return (GNU_INIT_decl != NULL_TREE);
+}
+
+/* Generate a call to the __objc_gnu_init initializer function. */
+
+tree
+objc_generate_static_init_call (tree ctors ATTRIBUTE_UNUSED)
+{
+ add_stmt (build_stmt (input_location, EXPR_STMT,
+ build_function_call (input_location,
+ GNU_INIT_decl, NULL_TREE)));
+
+ return ctors;
+}
+#endif /* OBJCPLUS */
+
+/* --- Output GNU Meta-data --- */
+
+static void
+generate_classref_translation_entry (tree chain)
+{
+ tree expr, decl, type;
+
+ decl = TREE_PURPOSE (chain);
+ type = TREE_TYPE (decl);
+
+ expr = add_objc_string (TREE_VALUE (chain), class_names);
+ expr = convert (type, expr); /* cast! */
+
+ /* This is a class reference. It is re-written by the runtime,
+ but will be optimized away unless we force it. */
+ DECL_PRESERVE_P (decl) = 1;
+ OBJCMETA (decl, objc_meta, meta_base);
+ finish_var_decl (decl, expr);
+ return;
+}
+
+
+static void
+handle_impent (struct imp_entry *impent)
+{
+ char *string;
+
+/* objc_implementation_context = impent->imp_context;
+ implementation_template = impent->imp_template;*/
+
+ switch (TREE_CODE (impent->imp_context))
+ {
+ case CLASS_IMPLEMENTATION_TYPE:
+ {
+ const char *const class_name =
+ IDENTIFIER_POINTER (CLASS_NAME (impent->imp_context));
+
+ string = (char *) alloca (strlen (class_name) + 30);
+
+ sprintf (string, "__objc_class_name_%s", class_name);
+ break;
+ }
+ case CATEGORY_IMPLEMENTATION_TYPE:
+ {
+ const char *const class_name =
+ IDENTIFIER_POINTER (CLASS_NAME (impent->imp_context));
+ const char *const class_super_name =
+ IDENTIFIER_POINTER (CLASS_SUPER_NAME (impent->imp_context));
+
+ string = (char *) alloca (strlen (class_name)
+ + strlen (class_super_name) + 30);
+
+ /* Do the same for categories. Even though no references to
+ these symbols are generated automatically by the compiler,
+ it gives you a handle to pull them into an archive by
+ hand. */
+ sprintf (string, "*__objc_category_name_%s_%s", class_name, class_super_name);
+ break;
+ }
+ default:
+ return;
+ }
+
+ {
+ tree decl, init;
+
+ init = integer_zero_node;
+ decl = build_decl (input_location,
+ VAR_DECL, get_identifier (string), TREE_TYPE (init));
+ TREE_PUBLIC (decl) = 1;
+ TREE_READONLY (decl) = 1;
+ TREE_USED (decl) = 1;
+ TREE_CONSTANT (decl) = 1;
+ DECL_CONTEXT (decl) = NULL_TREE;
+ DECL_ARTIFICIAL (decl) = 1;
+ TREE_STATIC (decl) = 1;
+ DECL_INITIAL (decl) = error_mark_node; /* A real initializer is coming... */
+ /* We must force the reference. */
+ DECL_PRESERVE_P (decl) = 1;
+
+ finish_var_decl(decl, init) ;
+ }
+}
+
+tree
+build_protocol_initializer (tree type, tree protocol_name, tree protocol_list,
+ tree inst_methods, tree class_methods)
+{
+ tree expr, ttyp;
+ location_t loc;
+ VEC(constructor_elt,gc) *inits = NULL;
+
+ /* TODO: pass the loc in or find it from args. */
+ loc = input_location;
+ ttyp = build_pointer_type (xref_tag (RECORD_TYPE,
+ get_identifier (UTAG_CLASS)));
+ /* Filling the "isa" in with a version allows the runtime system to
+ detect this ... */
+ expr = build_int_cst (ttyp, PROTOCOL_VERSION);
+
+ CONSTRUCTOR_APPEND_ELT (inits, NULL_TREE, expr);
+
+ CONSTRUCTOR_APPEND_ELT (inits, NULL_TREE, protocol_name);
+ CONSTRUCTOR_APPEND_ELT (inits, NULL_TREE, protocol_list);
+
+ ttyp = objc_method_proto_list_ptr;
+ if (inst_methods)
+ expr = convert (ttyp, build_unary_op (loc, ADDR_EXPR, inst_methods, 0));
+ else
+ expr = convert (ttyp, null_pointer_node);
+ CONSTRUCTOR_APPEND_ELT (inits, NULL_TREE, expr);
+
+ if (class_methods)
+ expr = convert (ttyp, build_unary_op (loc, ADDR_EXPR, class_methods, 0));
+ else
+ expr = convert (ttyp, null_pointer_node);
+ CONSTRUCTOR_APPEND_ELT (inits, NULL_TREE, expr);
+
+ return objc_build_constructor (type, inits);
+}
+
+static tree
+generate_protocol_list (tree i_or_p, tree klass_ctxt)
+{
+ tree array_type, ptype, refs_decl, lproto, e, plist;
+ VEC(constructor_elt,gc) *v = NULL;
+ char buf[BUFSIZE];
+ int size = 0;
+
+ switch (TREE_CODE (i_or_p))
+ {
+ case CLASS_INTERFACE_TYPE:
+ case CATEGORY_INTERFACE_TYPE:
+ plist = CLASS_PROTOCOL_LIST (i_or_p);
+ break;
+ case PROTOCOL_INTERFACE_TYPE:
+ plist = PROTOCOL_LIST (i_or_p);
+ break;
+ default:
+ gcc_unreachable ();
+ }
+
+ /* Compute size. */
+ for (lproto = plist; lproto; lproto = TREE_CHAIN (lproto))
+ if (TREE_CODE (TREE_VALUE (lproto)) == PROTOCOL_INTERFACE_TYPE
+ && PROTOCOL_FORWARD_DECL (TREE_VALUE (lproto)))
+ size++;
+
+ /* Build initializer. */
+ CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, build_int_cst (NULL_TREE, 0));
+ e = build_int_cst (build_pointer_type (objc_protocol_template), size);
+ CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, e);
+
+ for (lproto = plist; lproto; lproto = TREE_CHAIN (lproto))
+ {
+ tree pval = TREE_VALUE (lproto);
+
+ if (TREE_CODE (pval) == PROTOCOL_INTERFACE_TYPE
+ && PROTOCOL_FORWARD_DECL (pval))
+ {
+ tree fwref = PROTOCOL_FORWARD_DECL (pval);
+ location_t loc = DECL_SOURCE_LOCATION (fwref) ;
+ e = build_unary_op (loc, ADDR_EXPR, fwref, 0);
+ CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, e);
+ }
+ }
+
+ /* static struct objc_protocol *refs[n]; */
+
+ switch (TREE_CODE (i_or_p))
+ {
+ case PROTOCOL_INTERFACE_TYPE:
+ snprintf (buf, BUFSIZE, "_OBJC_ProtocolRefs_%s",
+ IDENTIFIER_POINTER (PROTOCOL_NAME (i_or_p)));
+ break;
+ case CLASS_INTERFACE_TYPE:
+ snprintf (buf, BUFSIZE, "_OBJC_ClassProtocols_%s",
+ IDENTIFIER_POINTER (CLASS_NAME (i_or_p)));
+ break;
+ case CATEGORY_INTERFACE_TYPE:
+ snprintf (buf, BUFSIZE, "_OBJC_CategoryProtocols_%s_%s",
+ IDENTIFIER_POINTER (CLASS_NAME (klass_ctxt)),
+ IDENTIFIER_POINTER (CLASS_SUPER_NAME (klass_ctxt)));
+ break;
+ default:
+ gcc_unreachable ();
+ }
+
+ ptype = build_pointer_type (objc_protocol_template);
+ array_type = build_sized_array_type (ptype, size + 3);
+ refs_decl = start_var_decl (array_type, buf);
+ OBJCMETA (refs_decl, objc_meta, meta_base);
+ finish_var_decl (refs_decl,
+ objc_build_constructor (TREE_TYPE (refs_decl), v));
+
+ return refs_decl;
+}
+
+static tree
+generate_v1_meth_descriptor_table (tree chain, tree protocol, const char *prefix)
+{
+ tree method_list_template, initlist, decl;
+ int size;
+ VEC(constructor_elt,gc) *v = NULL;
+ char buf[BUFSIZE];
+
+ if (!chain || !prefix)
+ return NULL_TREE;
+
+ if (!objc_method_prototype_template)
+ objc_method_prototype_template = build_method_prototype_template ();
+
+ size = list_length (chain);
+ method_list_template =
+ build_method_prototype_list_template (objc_method_prototype_template,
+ size);
+ snprintf (buf, BUFSIZE, "%s_%s", prefix,
+ IDENTIFIER_POINTER (PROTOCOL_NAME (protocol)));
+
+ decl = start_var_decl (method_list_template, buf);
+
+ CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, build_int_cst (NULL_TREE, size));
+ initlist =
+ build_descriptor_table_initializer (objc_method_prototype_template,
+ chain);
+ CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, initlist);
+ OBJCMETA (decl, objc_meta, meta_base);
+ finish_var_decl (decl, objc_build_constructor (method_list_template, v));
+ return decl;
+}
+
+/* For each protocol which was referenced either from a @protocol()
+ expression, or because a class/category implements it (then a
+ pointer to the protocol is stored in the struct describing the
+ class/category), we create a statically allocated instance of the
+ Protocol class. The code is written in such a way as to generate
+ as few Protocol objects as possible; we generate a unique Protocol
+ instance for each protocol, and we don't generate a Protocol
+ instance if the protocol is never referenced (either from a
+ @protocol() or from a class/category implementation). These
+ statically allocated objects can be referred to via the static
+ (that is, private to this module) symbols _OBJC_PROTOCOL_n.
+
+ The statically allocated Protocol objects that we generate here
+ need to be fixed up at runtime in order to be used: the 'isa'
+ pointer of the objects need to be set up to point to the 'Protocol'
+ class, as known at runtime.
+
+ The GNU runtime fixes up all protocols before user code from the module
+ is executed; it requires pointers to those symbols
+ to be put in the objc_symtab (which is then passed as argument to
+ the function __objc_exec_class() which the compiler sets up to be
+ executed automatically when the module is loaded); setup of those
+ Protocol objects happen in two ways in the GNU runtime: all
+ Protocol objects referred to by a class or category implementation
+ are fixed up when the class/category is loaded; all Protocol
+ objects referred to by a @protocol() expression are added by the
+ compiler to the list of statically allocated instances to fixup
+ (the same list holding the statically allocated constant string
+ objects). Because, as explained above, the compiler generates as
+ few Protocol objects as possible, some Protocol object might end up
+ being referenced multiple times when compiled with the GNU runtime,
+ and end up being fixed up multiple times at runtime initialization.
+ But that doesn't hurt, it's just a little inefficient. */
+
+static void
+generate_protocols (void)
+{
+ tree p, encoding;
+ tree decl;
+ tree initlist, protocol_name_expr, refs_decl, refs_expr;
+
+ /* If a protocol was directly referenced, pull in indirect references. */
+ for (p = protocol_chain; p; p = TREE_CHAIN (p))
+ if (PROTOCOL_FORWARD_DECL (p) && PROTOCOL_LIST (p))
+ generate_protocol_references (PROTOCOL_LIST (p));
+
+ for (p = protocol_chain; p; p = TREE_CHAIN (p))
+ {
+ tree nst_methods = PROTOCOL_NST_METHODS (p);
+ tree cls_methods = PROTOCOL_CLS_METHODS (p);
+
+ /* If protocol wasn't referenced, don't generate any code. */
+ decl = PROTOCOL_FORWARD_DECL (p);
+
+ if (!decl)
+ continue;
+
+ /* Make sure we link in the Protocol class. */
+ add_class_reference (get_identifier (PROTOCOL_OBJECT_CLASS_NAME));
+
+ while (nst_methods)
+ {
+ if (! METHOD_ENCODING (nst_methods))
+ {
+ encoding = encode_method_prototype (nst_methods);
+ METHOD_ENCODING (nst_methods) = encoding;
+ }
+ nst_methods = DECL_CHAIN (nst_methods);
+ }
+
+ UOBJC_INSTANCE_METHODS_decl =
+ generate_v1_meth_descriptor_table (PROTOCOL_NST_METHODS (p), p,
+ "_OBJC_PROTOCOL_INSTANCE_METHODS");
+
+ while (cls_methods)
+ {
+ if (! METHOD_ENCODING (cls_methods))
+ {
+ encoding = encode_method_prototype (cls_methods);
+ METHOD_ENCODING (cls_methods) = encoding;
+ }
+
+ cls_methods = DECL_CHAIN (cls_methods);
+ }
+
+ UOBJC_CLASS_METHODS_decl =
+ generate_v1_meth_descriptor_table (PROTOCOL_CLS_METHODS (p), p,
+ "_OBJC_PROTOCOL_CLASS_METHODS");
+/* generate_method_descriptors (p);*/
+
+ if (PROTOCOL_LIST (p))
+ refs_decl = generate_protocol_list (p, NULL_TREE);
+ else
+ refs_decl = 0;
+
+ /* static struct objc_protocol _OBJC_PROTOCOL_<mumble>; */
+ protocol_name_expr = add_objc_string (PROTOCOL_NAME (p), class_names);
+
+ if (refs_decl)
+ refs_expr = convert (build_pointer_type (build_pointer_type
+ (objc_protocol_template)),
+ build_unary_op (input_location,
+ ADDR_EXPR, refs_decl, 0));
+ else
+ refs_expr = build_int_cst (NULL_TREE, 0);
+
+ /* UOBJC_INSTANCE_METHODS_decl/UOBJC_CLASS_METHODS_decl are set
+ by generate_method_descriptors, which is called above. */
+ initlist = build_protocol_initializer (TREE_TYPE (decl),
+ protocol_name_expr, refs_expr,
+ UOBJC_INSTANCE_METHODS_decl,
+ UOBJC_CLASS_METHODS_decl);
+ finish_var_decl (decl, initlist);
+ }
+}
+
+static tree
+generate_dispatch_table (tree chain, const char *name)
+{
+ tree decl, method_list_template, initlist;
+ VEC(constructor_elt,gc) *v = NULL;
+ int size = list_length (chain);
+
+ if (!objc_method_template)
+ objc_method_template = build_method_template ();
+
+ method_list_template = build_method_list_template (objc_method_template,
+ size);
+ initlist = build_dispatch_table_initializer (objc_method_template, chain);
+
+ decl = start_var_decl (method_list_template, name);
+
+ CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, integer_zero_node);
+ CONSTRUCTOR_APPEND_ELT (v, NULL_TREE,
+ build_int_cst (integer_type_node, size));
+ CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, initlist);
+
+ OBJCMETA (decl, objc_meta, meta_base);
+ finish_var_decl (decl,
+ objc_build_constructor (TREE_TYPE (decl), v));
+
+ return decl;
+}
+
+/* Init a category. */
+static tree
+build_category_initializer (tree type, tree cat_name, tree class_name,
+ tree inst_methods, tree class_methods,
+ tree protocol_list)
+{
+ tree expr, ltyp;
+ location_t loc;
+ VEC(constructor_elt,gc) *v = NULL;
+
+ /* TODO: pass the loc in or find it from args. */
+ /* TODO: pass the loc in or find it from args. */
+ loc = UNKNOWN_LOCATION;
+ CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, cat_name);
+ CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, class_name);
+
+ ltyp = objc_method_list_ptr;
+ if (inst_methods)
+ expr = convert (ltyp, build_unary_op (loc, ADDR_EXPR, inst_methods, 0));
+ else
+ expr = convert (ltyp, null_pointer_node);
+ CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, expr);
+
+ if (class_methods)
+ expr = convert (ltyp, build_unary_op (loc, ADDR_EXPR, class_methods, 0));
+ else
+ expr = convert (ltyp, null_pointer_node);
+ CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, expr);
+
+ /* protocol_list = */
+ ltyp = build_pointer_type (build_pointer_type (objc_protocol_template));
+ if (protocol_list)
+ expr = convert (ltyp, build_unary_op (loc, ADDR_EXPR, protocol_list, 0));
+ else
+ expr = convert (ltyp, null_pointer_node);
+ CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, expr);
+
+ return objc_build_constructor (type, v);
+}
+
+/* static struct objc_category _OBJC_CATEGORY_<name> = { ... }; */
+
+static void
+generate_category (struct imp_entry *impent)
+{
+ tree initlist, cat_name_expr, class_name_expr;
+ tree protocol_decl, category, cat_decl;
+ tree inst_methods = NULL_TREE, class_methods = NULL_TREE;
+ tree cat = impent->imp_context;
+ char buf[BUFSIZE];
+
+ cat_decl = impent->class_decl;
+
+ add_class_reference (CLASS_NAME (cat));
+ cat_name_expr = add_objc_string (CLASS_SUPER_NAME (cat), class_names);
+
+ class_name_expr = add_objc_string (CLASS_NAME (cat), class_names);
+
+ category = lookup_category (impent->imp_template, CLASS_SUPER_NAME (cat));
+
+ if (category && CLASS_PROTOCOL_LIST (category))
+ {
+ generate_protocol_references (CLASS_PROTOCOL_LIST (category));
+ protocol_decl = generate_protocol_list (category, cat);
+ }
+ else
+ protocol_decl = 0;
+
+ if (CLASS_NST_METHODS (cat))
+ {
+ snprintf (buf, BUFSIZE, "_OBJC_CategoryInstanceMethods_%s_%s",
+ IDENTIFIER_POINTER (CLASS_NAME (cat)),
+ IDENTIFIER_POINTER (CLASS_SUPER_NAME (cat)));
+ inst_methods = generate_dispatch_table (CLASS_NST_METHODS (cat), buf);
+ }
+
+ if (CLASS_CLS_METHODS (cat))
+ {
+ snprintf (buf, BUFSIZE, "_OBJC_CategoryClassMethods_%s_%s",
+ IDENTIFIER_POINTER (CLASS_NAME (cat)),
+ IDENTIFIER_POINTER (CLASS_SUPER_NAME (cat)));
+ class_methods = generate_dispatch_table (CLASS_CLS_METHODS (cat), buf);
+ }
+
+ initlist = build_category_initializer (TREE_TYPE (cat_decl),
+ cat_name_expr, class_name_expr,
+ inst_methods, class_methods,
+ protocol_decl);
+ /* Finish and initialize the forward decl. */
+ finish_var_decl (cat_decl, initlist);
+ impent->class_decl = cat_decl;
+}
+
+/* struct _objc_class {
+ struct objc_class *isa;
+ struct objc_class *super_class;
+ char *name;
+ long version;
+ long info;
+ long instance_size;
+ struct objc_ivar_list *ivars;
+ struct objc_method_list *methods;
+ struct sarray *dtable;
+ struct objc_class *subclass_list;
+ struct objc_class *sibling_class;
+ struct objc_protocol_list *protocols;
+ void *gc_object_type;
+ }; */
+
+static tree
+build_shared_structure_initializer (tree type, tree isa, tree super,
+ tree name, tree size, int status,
+ tree dispatch_table, tree ivar_list,
+ tree protocol_list)
+{
+ tree expr, ltyp;
+ VEC(constructor_elt,gc) *v = NULL;
+
+ /* isa = */
+ CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, isa);
+
+ /* super_class = */
+ CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, super);
+
+ /* name = */
+ CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, default_conversion (name));
+
+ /* version = */
+ CONSTRUCTOR_APPEND_ELT (v, NULL_TREE,
+ build_int_cst (long_integer_type_node, 0));
+
+ /* info = */
+ CONSTRUCTOR_APPEND_ELT (v, NULL_TREE,
+ build_int_cst (long_integer_type_node, status));
+
+ /* instance_size = */
+ CONSTRUCTOR_APPEND_ELT (v, NULL_TREE,
+ convert (long_integer_type_node, size));
+
+ /* objc_ivar_list = */
+ if (!ivar_list)
+ CONSTRUCTOR_APPEND_ELT (v, NULL_TREE,
+ build_int_cst (objc_ivar_list_ptr, 0));
+ else
+ {
+ expr = convert (objc_ivar_list_ptr,
+ build_unary_op (input_location, ADDR_EXPR,
+ ivar_list, 0));
+ CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, expr);
+ }
+
+ /* objc_method_list = */
+ if (!dispatch_table)
+ CONSTRUCTOR_APPEND_ELT (v, NULL_TREE,
+ convert (objc_method_list_ptr, null_pointer_node));
+ else
+ {
+ expr = convert (objc_method_list_ptr,
+ build_unary_op (input_location, ADDR_EXPR,
+ dispatch_table, 0));
+ CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, expr);
+ }
+
+ /* FIXME: Remove NeXT runtime code. */
+ if (flag_next_runtime)
+ {
+ ltyp = build_pointer_type (xref_tag (RECORD_TYPE,
+ get_identifier ("objc_cache")));
+ /* method_cache = */
+ CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, convert (ltyp, null_pointer_node));
+ }
+ else
+ {
+ /* dtable = */
+ CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, build_int_cst (NULL_TREE, 0));
+
+ /* subclass_list = */
+ CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, build_int_cst (NULL_TREE, 0));
+
+ /* sibling_class = */
+ CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, build_int_cst (NULL_TREE, 0));
+ }
+
+ /* protocol_list = */
+ ltyp = build_pointer_type (build_pointer_type (objc_protocol_template));
+ if (! protocol_list)
+ CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, build_int_cst (ltyp, 0));
+ else
+ {
+ expr = convert (ltyp,
+ build_unary_op (input_location, ADDR_EXPR,
+ protocol_list, 0));
+ CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, expr);
+ }
+
+ /* FIXME: Remove NeXT runtime code. */
+ if (flag_next_runtime)
+ /* sel_id = NULL */
+ CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, build_int_cst (NULL_TREE, 0));
+
+ /* gc_object_type = NULL */
+ CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, build_int_cst (NULL_TREE, 0));
+
+ return objc_build_constructor (type, v);
+}
+
+
+static tree
+generate_ivars_list (tree chain, const char *name)
+{
+ tree initlist, ivar_list_template, decl;
+ int size;
+ VEC(constructor_elt,gc) *inits = NULL;
+
+ if (!chain)
+ return NULL_TREE;
+
+ if (!objc_ivar_template)
+ objc_ivar_template = build_ivar_template ();
+
+ size = ivar_list_length (chain);
+
+ generating_instance_variables = 1;
+ ivar_list_template = build_ivar_list_template (objc_ivar_template, size);
+ initlist = build_ivar_list_initializer (objc_ivar_template, chain);
+ generating_instance_variables = 0;
+
+ decl = start_var_decl (ivar_list_template, name);
+
+ CONSTRUCTOR_APPEND_ELT (inits, NULL_TREE, build_int_cst (NULL_TREE, size));
+ CONSTRUCTOR_APPEND_ELT (inits, NULL_TREE, initlist);
+
+ OBJCMETA (decl, objc_meta, meta_base);
+ finish_var_decl (decl,
+ objc_build_constructor (TREE_TYPE (decl), inits));
+
+ return decl;
+}
+
+/* static struct objc_class _OBJC_METACLASS_Foo={ ... };
+ static struct objc_class _OBJC_CLASS_Foo={ ... }; */
+
+static void
+generate_class_structures (struct imp_entry *impent)
+{
+ tree name_expr, super_expr, root_expr, class_decl, meta_decl;
+ tree my_root_id, my_super_id;
+ tree cast_type, initlist, protocol_decl;
+ tree inst_methods = NULL_TREE, class_methods = NULL_TREE;
+ tree chain, inst_ivars = NULL_TREE, class_ivars = NULL_TREE;
+ location_t loc;
+ char buf[BUFSIZE];
+ int cls_flags = 0 ;
+
+/* objc_implementation_context = impent->imp_context;
+ implementation_template = impent->imp_template;*/
+ class_decl = impent->class_decl;
+ meta_decl = impent->meta_decl;
+/* UOBJC_CLASS_decl = impent->class_decl;
+ UOBJC_METACLASS_decl = impent->meta_decl;*/
+
+ loc = DECL_SOURCE_LOCATION (impent->class_decl);
+
+ my_super_id = CLASS_SUPER_NAME (impent->imp_template);
+ if (my_super_id)
+ {
+ add_class_reference (my_super_id);
+
+ /* Compute "my_root_id" - this is required for code generation.
+ the "isa" for all meta class structures points to the root of
+ the inheritance hierarchy (e.g. "__Object")... */
+ my_root_id = my_super_id;
+ do
+ {
+ tree my_root_int = lookup_interface (my_root_id);
+
+ if (my_root_int && CLASS_SUPER_NAME (my_root_int))
+ my_root_id = CLASS_SUPER_NAME (my_root_int);
+ else
+ break;
+ }
+ while (1);
+ }
+ else
+ /* No super class. */
+ my_root_id = CLASS_NAME (impent->imp_template);
+
+ cast_type = build_pointer_type (objc_class_template);
+ name_expr = add_objc_string (CLASS_NAME (impent->imp_template),
+ class_names);
+
+ /* Install class `isa' and `super' pointers at runtime. */
+ if (my_super_id)
+ super_expr = add_objc_string (my_super_id, class_names);
+ else
+ super_expr = null_pointer_node;
+
+ super_expr = build_c_cast (loc, cast_type, super_expr);
+
+ root_expr = add_objc_string (my_root_id, class_names);
+ root_expr = build_c_cast (loc, cast_type, root_expr);
+
+ if (CLASS_PROTOCOL_LIST (impent->imp_template))
+ {
+ generate_protocol_references (CLASS_PROTOCOL_LIST (impent->imp_template));
+ protocol_decl = generate_protocol_list (impent->imp_template,
+ impent->imp_context);
+ }
+ else
+ protocol_decl = NULL_TREE;
+
+ if (CLASS_CLS_METHODS (impent->imp_context))
+ {
+ snprintf (buf, BUFSIZE, "_OBJC_ClassMethods_%s",
+ IDENTIFIER_POINTER (CLASS_NAME (impent->imp_context)));
+ class_methods = generate_dispatch_table (CLASS_CLS_METHODS (impent->imp_context),
+ buf);
+ }
+
+ if (CLASS_SUPER_NAME (impent->imp_template) == NULL_TREE
+ && (chain = TYPE_FIELDS (objc_class_template)))
+ {
+ snprintf (buf, BUFSIZE, "_OBJC_ClassIvars_%s",
+ IDENTIFIER_POINTER (CLASS_NAME (impent->imp_context)));
+ class_ivars = generate_ivars_list (chain, buf);
+ }
+
+ /* static struct objc_class _OBJC_METACLASS_Foo = { ... }; */
+
+ initlist =
+ build_shared_structure_initializer
+ (TREE_TYPE (meta_decl),
+ root_expr, super_expr, name_expr,
+ convert (integer_type_node,
+ TYPE_SIZE_UNIT (objc_class_template)),
+ CLS_META, class_methods, class_ivars,
+ protocol_decl);
+
+ finish_var_decl (meta_decl, initlist);
+ impent->meta_decl = meta_decl;
+
+ /* static struct objc_class _OBJC_CLASS_Foo={ ... }; */
+ if (CLASS_NST_METHODS (impent->imp_context))
+ {
+ snprintf (buf, BUFSIZE, "_OBJC_InstanceMethods_%s",
+ IDENTIFIER_POINTER (CLASS_NAME (impent->imp_context)));
+ inst_methods = generate_dispatch_table (CLASS_NST_METHODS (impent->imp_context),
+ buf);
+ }
+
+ if ((chain = CLASS_IVARS (impent->imp_template)))
+ {
+ snprintf (buf, BUFSIZE, "_OBJC_InstanceIvars_%s",
+ IDENTIFIER_POINTER (CLASS_NAME (impent->imp_context)));
+ inst_ivars = generate_ivars_list (chain, buf);
+ }
+
+ initlist =
+ build_shared_structure_initializer
+ (TREE_TYPE (class_decl),
+ build_unary_op (loc, ADDR_EXPR, meta_decl, 0),
+ super_expr, name_expr,
+ convert (integer_type_node,
+ TYPE_SIZE_UNIT (CLASS_STATIC_TEMPLATE
+ (impent->imp_template))),
+ CLS_FACTORY | cls_flags, inst_methods, inst_ivars,
+ protocol_decl);
+
+ finish_var_decl (class_decl, initlist);
+ impent->class_decl = class_decl;
+}
+
+/* --- Output GNU Metadata --- */
+
+/* TODO: Make this into an array of refs. */
+static void
+handle_class_ref (tree chain)
+{
+ const char *name = IDENTIFIER_POINTER (TREE_VALUE (chain));
+ char *string = (char *) alloca (strlen (name) + 30);
+ tree decl;
+ tree exp;
+
+ sprintf (string, "__objc_class_name_%s", name);
+
+ /* Make a decl for this name, so we can use its address in a tree. */
+ decl = build_decl (input_location,
+ VAR_DECL, get_identifier (string), TREE_TYPE (integer_zero_node));
+ DECL_EXTERNAL (decl) = 1;
+ TREE_PUBLIC (decl) = 1;
+ DECL_CONTEXT (decl) = NULL_TREE;
+ finish_var_decl (decl, 0);
+
+ /* Make a decl for the address. */
+ sprintf (string, "__objc_class_ref_%s", name);
+ exp = build1 (ADDR_EXPR, string_type_node, decl);
+ decl = build_decl (input_location,
+ VAR_DECL, get_identifier (string), string_type_node);
+ TREE_STATIC (decl) = 1;
+ TREE_USED (decl) = 1;
+ DECL_READ_P (decl) = 1;
+ DECL_ARTIFICIAL (decl) = 1;
+ DECL_INITIAL (decl) = error_mark_node;
+
+ /* We must force the reference. */
+ DECL_PRESERVE_P (decl) = 1;
+
+ DECL_CONTEXT (decl) = NULL_TREE;
+ finish_var_decl (decl, exp);
+}
+
+static tree
+get_proto_encoding (tree proto)
+{
+ tree encoding;
+ if (proto)
+ {
+ if (! METHOD_ENCODING (proto))
+ {
+ encoding = encode_method_prototype (proto);
+ METHOD_ENCODING (proto) = encoding;
+ }
+ else
+ encoding = METHOD_ENCODING (proto);
+
+ return add_objc_string (encoding, meth_var_types);
+ }
+ else
+ return build_int_cst (NULL_TREE, 0);
+}
+
+static void
+build_gnu_selector_translation_table (void)
+{
+ tree chain, expr;
+ VEC(constructor_elt,gc) *inits = NULL;
+ VEC(constructor_elt,gc) *v ;
+
+ /* Cause the selector table (previously forward-declared)
+ to be actually output. */
+
+ for (chain = sel_ref_chain; chain; chain = TREE_CHAIN (chain))
+ {
+ tree encoding;
+ if (warn_selector)
+ {
+ /* TODO: improve on the location for the diagnostic. */
+ location_t loc = input_location;
+ diagnose_missing_method (TREE_VALUE (chain), loc);
+ }
+
+ v = NULL;
+ expr = build_selector (TREE_VALUE (chain));
+ encoding = get_proto_encoding (TREE_PURPOSE (chain));
+ CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, expr);
+ CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, encoding);
+ expr = objc_build_constructor (objc_selector_template, v);
+
+ CONSTRUCTOR_APPEND_ELT (inits, NULL_TREE, expr);
+ } /* each element in the chain */
+
+ /* List terminator. */
+ v = NULL;
+ CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, integer_zero_node);
+ CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, integer_zero_node);
+ expr = objc_build_constructor (objc_selector_template, v);
+
+ CONSTRUCTOR_APPEND_ELT (inits, NULL_TREE, expr);
+ expr = objc_build_constructor (TREE_TYPE (UOBJC_SELECTOR_TABLE_decl),
+ inits);
+ finish_var_decl (UOBJC_SELECTOR_TABLE_decl, expr);
+}
+
+/* Output references to all statically allocated objects. Return the DECL
+ for the array built. */
+
+static void
+generate_static_references (void)
+{
+ tree expr = NULL_TREE;
+ tree class_name, klass, decl;
+ tree cl_chain, in_chain, type
+ = build_array_type (build_pointer_type (void_type_node), NULL_TREE);
+ int num_inst, num_class;
+ char buf[BUFSIZE];
+ VEC(constructor_elt,gc) *decls = NULL;
+
+ /* FIXME: Remove NeXT runtime code. */
+ if (flag_next_runtime)
+ gcc_unreachable ();
+
+ for (cl_chain = objc_static_instances, num_class = 0;
+ cl_chain; cl_chain = TREE_CHAIN (cl_chain), num_class++)
+ {
+ VEC(constructor_elt,gc) *v = NULL;
+
+ for (num_inst = 0, in_chain = TREE_PURPOSE (cl_chain);
+ in_chain; num_inst++, in_chain = TREE_CHAIN (in_chain));
+
+ snprintf (buf, BUFSIZE, "_OBJC_STATIC_INSTANCES_%d", num_class);
+ decl = start_var_decl (type, buf);
+
+ /* Output {class_name, ...}. */
+ klass = TREE_VALUE (cl_chain);
+ class_name = get_objc_string_decl (OBJC_TYPE_NAME (klass), class_names);
+ CONSTRUCTOR_APPEND_ELT (v, NULL_TREE,
+ build_unary_op (input_location,
+ ADDR_EXPR, class_name, 1));
+
+ /* Output {..., instance, ...}. */
+ for (in_chain = TREE_PURPOSE (cl_chain);
+ in_chain; in_chain = TREE_CHAIN (in_chain))
+ {
+ expr = build_unary_op (input_location,
+ ADDR_EXPR, TREE_VALUE (in_chain), 1);
+ CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, expr);
+ }
+
+ /* Output {..., NULL}. */
+ CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, build_int_cst (NULL_TREE, 0));
+
+ expr = objc_build_constructor (TREE_TYPE (decl), v);
+ OBJCMETA (decl, objc_meta, meta_base);
+ finish_var_decl (decl, expr);
+ CONSTRUCTOR_APPEND_ELT (decls, NULL_TREE,
+ build_unary_op (input_location,
+ ADDR_EXPR, decl, 1));
+ }
+
+ CONSTRUCTOR_APPEND_ELT (decls, NULL_TREE, build_int_cst (NULL_TREE, 0));
+ expr = objc_build_constructor (type, decls);
+ static_instances_decl = start_var_decl (type, "_OBJC_STATIC_INSTANCES");
+ OBJCMETA (static_instances_decl, objc_meta, meta_base);
+ finish_var_decl (static_instances_decl, expr);
+}
+
+/* Create the initial value for the `defs' field of _objc_symtab.
+ This is a CONSTRUCTOR. */
+
+static tree
+init_def_list (tree type)
+{
+ tree expr;
+ struct imp_entry *impent;
+ location_t loc;
+ VEC(constructor_elt,gc) *v = NULL;
+
+ if (imp_count)
+ for (impent = imp_list; impent; impent = impent->next)
+ {
+ if (TREE_CODE (impent->imp_context) == CLASS_IMPLEMENTATION_TYPE)
+ {
+ loc = DECL_SOURCE_LOCATION (impent->class_decl);
+ expr = build_unary_op (loc,
+ ADDR_EXPR, impent->class_decl, 0);
+ CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, expr);
+ }
+ }
+
+ if (cat_count)
+ for (impent = imp_list; impent; impent = impent->next)
+ {
+ if (TREE_CODE (impent->imp_context) == CATEGORY_IMPLEMENTATION_TYPE)
+ {
+ loc = DECL_SOURCE_LOCATION (impent->class_decl);
+ expr = build_unary_op (loc,
+ ADDR_EXPR, impent->class_decl, 0);
+ CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, expr);
+ }
+ }
+
+ loc = UNKNOWN_LOCATION;
+ /* statics = { ..., _OBJC_STATIC_INSTANCES, ... } */
+ if (static_instances_decl)
+ expr = build_unary_op (loc, ADDR_EXPR, static_instances_decl, 0);
+ else
+ expr = integer_zero_node;
+ CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, expr);
+
+ return objc_build_constructor (type, v);
+}
+
+/* Take care of defining and initializing _OBJC_SYMBOLS. */
+
+/* Predefine the following data type:
+
+ struct _objc_symtab
+ {
+ long sel_ref_cnt;
+ SEL *refs;
+ short cls_def_cnt;
+ short cat_def_cnt;
+ void *defs[cls_def_cnt + cat_def_cnt];
+ }; */
+
+static void
+build_objc_symtab_template (void)
+{
+ tree fields, array_type, *chain = NULL;
+ int index;
+
+ objc_symtab_template = objc_start_struct (get_identifier (UTAG_SYMTAB));
+
+ /* long sel_ref_cnt; */
+ fields = add_field_decl (long_integer_type_node, "sel_ref_cnt", &chain);
+
+ /* SEL *refs; */
+ add_field_decl (build_pointer_type (objc_selector_type), "refs", &chain);
+
+ /* short cls_def_cnt; */
+ add_field_decl (short_integer_type_node, "cls_def_cnt", &chain);
+
+ /* short cat_def_cnt; */
+ add_field_decl (short_integer_type_node, "cat_def_cnt", &chain);
+
+ /* Note that padding will be added here on LP64. */
+
+ /* void *defs[imp_count + cat_count (+ 1)]; */
+ /* NB: The index is one less than the size of the array. */
+ index = imp_count + cat_count;
+ array_type = build_sized_array_type (ptr_type_node, index + 1);
+ add_field_decl (array_type, "defs", &chain);
+
+ objc_finish_struct (objc_symtab_template, fields);
+}
+/* Construct the initial value for all of _objc_symtab. */
+
+static tree
+init_objc_symtab (tree type)
+{
+ tree field, expr, ltyp;
+ location_t loc;
+ VEC(constructor_elt,gc) *v = NULL;
+
+ loc = UNKNOWN_LOCATION;
+
+ /* sel_ref_cnt = { ..., 5, ... } */
+
+ CONSTRUCTOR_APPEND_ELT (v, NULL_TREE,
+ build_int_cst (long_integer_type_node, 0));
+
+ /* refs = { ..., _OBJC_SELECTOR_TABLE, ... } */
+
+ ltyp = build_pointer_type (objc_selector_type);
+ if (sel_ref_chain)
+ expr = convert (ltyp, build_unary_op (loc, ADDR_EXPR,
+ UOBJC_SELECTOR_TABLE_decl, 1));
+ else
+ expr = convert (ltyp, null_pointer_node);
+ CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, expr);
+
+ /* cls_def_cnt = { ..., 5, ... } */
+
+ CONSTRUCTOR_APPEND_ELT (v, NULL_TREE,
+ build_int_cst (short_integer_type_node, imp_count));
+
+ /* cat_def_cnt = { ..., 5, ... } */
+
+ CONSTRUCTOR_APPEND_ELT (v, NULL_TREE,
+ build_int_cst (short_integer_type_node, cat_count));
+
+ /* cls_def = { ..., { &Foo, &Bar, ...}, ... } */
+
+ field = TYPE_FIELDS (type);
+ field = DECL_CHAIN (DECL_CHAIN (DECL_CHAIN (DECL_CHAIN (field))));
+
+ CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, init_def_list (TREE_TYPE (field)));
+
+ return objc_build_constructor (type, v);
+}
+
+/* Create the declaration of _OBJC_SYMBOLS, with type `struct _objc_symtab'
+ and initialized appropriately. */
+
+static void
+generate_objc_symtab_decl (void)
+{
+ build_objc_symtab_template ();
+ UOBJC_SYMBOLS_decl = start_var_decl (objc_symtab_template, "_OBJC_SYMBOLS");
+ OBJCMETA (UOBJC_SYMBOLS_decl, objc_meta, meta_base);
+ finish_var_decl (UOBJC_SYMBOLS_decl,
+ init_objc_symtab (TREE_TYPE (UOBJC_SYMBOLS_decl)));
+}
+
+static void
+objc_generate_v1_gnu_metadata (void)
+{
+ struct imp_entry *impent;
+ tree chain;
+
+ /* Process the static instances here because initialization of objc_symtab
+ depends on them. */
+ if (objc_static_instances)
+ generate_static_references ();
+
+ objc_implementation_context =
+ implementation_template =
+ UOBJC_CLASS_decl =
+ UOBJC_METACLASS_decl = NULL_TREE;
+
+ for (impent = imp_list; impent; impent = impent->next)
+ {
+ /* If -gen-decls is present, Dump the @interface of each class.
+ TODO: Dump the classes in the order they were found, rather than in
+ reverse order as we are doing now. */
+ if (flag_gen_declaration)
+ dump_interface (gen_declaration_file, impent->imp_context);
+
+ /* all of the following reference the string pool... */
+ if (TREE_CODE (impent->imp_context) == CLASS_IMPLEMENTATION_TYPE)
+ generate_class_structures (impent);
+ else
+ generate_category (impent);
+ }
+
+ /* If we are using an array of selectors, we must always
+ finish up the array decl even if no selectors were used. */
+ build_gnu_selector_translation_table ();
+
+ if (protocol_chain)
+ generate_protocols ();
+
+ /* Arrange for ObjC data structures to be initialized at run time. */
+ /* FIXME: Have some more elegant way to determine if we need to
+ generate objc_symtab_decl or not, instead of checking these
+ global symbols. */
+ if (imp_list || class_names_chain
+ || meth_var_names_chain || meth_var_types_chain || sel_ref_chain
+ || prop_names_attr_chain)
+ generate_objc_symtab_decl ();
+
+ if (imp_list || class_names_chain || objc_static_instances
+ || meth_var_names_chain || meth_var_types_chain || sel_ref_chain)
+ {
+ /* Make sure that the meta-data are identified as being
+ GNU-runtime. */
+ build_module_descriptor (OBJC_VERSION,
+ build_tree_list (objc_meta, meta_base));
+ build_module_initializer_routine ();
+ }
+
+ /* Dump the class references. This forces the appropriate classes
+ to be linked into the executable image, preserving unix archive
+ semantics. This can be removed when we move to a more dynamically
+ linked environment. */
+
+ for (chain = cls_ref_chain; chain; chain = TREE_CHAIN (chain))
+ {
+ handle_class_ref (chain);
+ if (TREE_PURPOSE (chain))
+ generate_classref_translation_entry (chain);
+ }
+
+ for (impent = imp_list; impent; impent = impent->next)
+ handle_impent (impent);
+
+ generate_strings ();
+}
+
+/* --- exceptions --- */
+
+static GTY(()) tree objc_eh_personality_decl;
+
+static tree
+objc_eh_runtime_type (tree type)
+{
+ tree ident, eh_id, decl, str;
+
+ if (type == error_mark_node
+ || errorcount || sorrycount)
+ {
+ /* Use 'ErrorMarkNode' as class name when error_mark_node is found
+ to prevent an ICE. Note that we know that the compiler will
+ terminate with an error and this 'ErrorMarkNode' class name will
+ never be actually used. */
+ ident = get_identifier ("ErrorMarkNode");
+ goto make_err_class;
+ }
+
+ if (POINTER_TYPE_P (type) && objc_is_object_id (TREE_TYPE (type)))
+ /* We don't want to identify 'id' for GNU. Instead, build a 0
+ entry in the exceptions table. */
+ return null_pointer_node;
+
+ if (!POINTER_TYPE_P (type) || !TYPED_OBJECT (TREE_TYPE (type)))
+ {
+#ifdef OBJCPLUS
+ /* This routine is also called for c++ catch clauses; in which case,
+ we use the c++ typeinfo decl. */
+ return build_eh_type_type (type);
+#else
+ error ("non-objective-c type '%T' cannot be caught", type);
+ ident = get_identifier ("ErrorMarkNode");
+ goto make_err_class;
+#endif
+ }
+ else
+ ident = OBJC_TYPE_NAME (TREE_TYPE (type));
+
+make_err_class:
+ /* If this class was already referenced, then it will be output during
+ meta-data emission, so we don't need to do it here. */
+ decl = get_objc_string_decl (ident, class_names);
+ eh_id = add_objc_string (ident, class_names);
+ if (!decl)
+ {
+ /* Not found ... so we need to build it - from the freshly-entered id. */
+ decl = get_objc_string_decl (ident, class_names);
+ str = my_build_string (IDENTIFIER_LENGTH (ident) + 1,
+ IDENTIFIER_POINTER (ident));
+ /* We have to finalize this var here, because this might be called after
+ all the other metadata strings have been emitted. */
+ finish_var_decl (decl, str);
+ }
+ return eh_id;
+}
+
+static tree
+objc_eh_personality (void)
+{
+ if (!objc_eh_personality_decl)
+#ifndef OBJCPLUS
+ objc_eh_personality_decl = build_personality_function ("gnu_objc");
+#else
+ objc_eh_personality_decl = build_personality_function ("gxx");
+#endif
+ return objc_eh_personality_decl;
+}
+
+/* -- interfaces --- */
+
+static tree
+build_throw_stmt (location_t loc, tree throw_expr, bool rethrown ATTRIBUTE_UNUSED)
+{
+ tree t;
+ VEC(tree, gc) *parms = VEC_alloc (tree, gc, 1);
+ /* A throw is just a call to the runtime throw function with the
+ object as a parameter. */
+ VEC_quick_push (tree, parms, throw_expr);
+ t = build_function_call_vec (loc, objc_exception_throw_decl, parms, NULL);
+ VEC_free (tree, gc, parms);
+ return add_stmt (t);
+}
+
+/* Build __builtin_eh_pointer. */
+
+static tree
+objc_build_exc_ptr (struct objc_try_context **x ATTRIBUTE_UNUSED)
+{
+ tree t;
+ t = built_in_decls[BUILT_IN_EH_POINTER];
+ t = build_call_expr (t, 1, integer_zero_node);
+ return fold_convert (objc_object_type, t);
+}
+
+static tree
+begin_catch (struct objc_try_context **cur_try_context, tree type,
+ tree decl, tree compound, bool ellipsis ATTRIBUTE_UNUSED)
+{
+ tree t;
+ /* Record the data for the catch in the try context so that we can
+ finalize it later. */
+ if (ellipsis)
+ t = build_stmt (input_location, CATCH_EXPR, NULL, compound);
+ else
+ t = build_stmt (input_location, CATCH_EXPR, type, compound);
+ (*cur_try_context)->current_catch = t;
+
+ /* Initialize the decl from the EXC_PTR_EXPR we get from the runtime. */
+ t = objc_build_exc_ptr (cur_try_context);
+ t = convert (TREE_TYPE (decl), t);
+ return build2 (MODIFY_EXPR, void_type_node, decl, t);
+}
+
+static void
+finish_catch (struct objc_try_context **cur_try_context, tree current_catch)
+{
+ append_to_statement_list (current_catch, &((*cur_try_context)->catch_list));
+}
+
+static tree
+finish_try_stmt (struct objc_try_context **cur_try_context)
+{
+ struct objc_try_context *c = *cur_try_context;
+ tree stmt = c->try_body;
+ if (c->catch_list)
+ stmt = build_stmt (c->try_locus, TRY_CATCH_EXPR, stmt, c->catch_list);
+ if (c->finally_body)
+ stmt = build_stmt (c->try_locus, TRY_FINALLY_EXPR, stmt, c->finally_body);
+ return stmt;
+}
+
+#include "gt-objc-objc-gnu-runtime-abi-01.h"
diff --git a/gcc/objc/objc-lang.c b/gcc/objc/objc-lang.c
index e4ae2923bb6..fd65776598d 100644
--- a/gcc/objc/objc-lang.c
+++ b/gcc/objc/objc-lang.c
@@ -1,5 +1,5 @@
/* Language-dependent hooks for Objective-C.
- Copyright 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2010
+ Copyright 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2010, 2011
Free Software Foundation, Inc.
Contributed by Ziemowit Laski <zlaski@apple.com>
@@ -33,6 +33,7 @@ along with GCC; see the file COPYING3. If not see
#include "langhooks.h"
#include "langhooks-def.h"
#include "c-objc-common.h"
+#include "c-lang.h"
enum c_language_kind c_language = clk_objc;
static void objc_init_ts (void);
@@ -51,13 +52,6 @@ static void objc_init_ts (void);
#undef LANG_HOOKS_INIT_TS
#define LANG_HOOKS_INIT_TS objc_init_ts
-#ifndef OBJCPLUS
-#undef LANG_HOOKS_EH_PERSONALITY
-#define LANG_HOOKS_EH_PERSONALITY objc_eh_personality
-#undef LANG_HOOKS_EH_RUNTIME_TYPE
-#define LANG_HOOKS_EH_RUNTIME_TYPE objc_eh_runtime_type
-#endif
-
/* Each front end provides its own lang hook initializer. */
struct lang_hooks lang_hooks = LANG_HOOKS_INITIALIZER;
diff --git a/gcc/objc/objc-next-metadata-tags.h b/gcc/objc/objc-next-metadata-tags.h
new file mode 100644
index 00000000000..db0026ec609
--- /dev/null
+++ b/gcc/objc/objc-next-metadata-tags.h
@@ -0,0 +1,172 @@
+/* Declarations for meta-data attribute tags.
+ Copyright (C) 2011 Free Software Foundation, Inc.
+ Contributed by Iain Sandoe
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3, or (at your option)
+any later version.
+
+GCC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING3. If not see
+<http://www.gnu.org/licenses/>. */
+
+/* These are identifiers used to flag meta-data attributes such that they
+ survive LTO and might be placed in correct sections for the target. */
+
+enum objc_runtime_tree_index
+{
+ OCTI_RT_OBJC_META,
+ OCTI_RT_META_BASE,
+
+ OCTI_RT_META_CLASS,
+ OCTI_RT_META_METACLASS,
+ OCTI_RT_META_CATEGORY,
+ OCTI_RT_META_PROTOCOL,
+
+ OCTI_RT_META_CLASS_CLS_VARS,
+ OCTI_RT_META_CLASS_NST_VARS,
+
+ OCTI_RT_META_CLASS_CLS_METH,
+ OCTI_RT_META_CLASS_NST_METH,
+ OCTI_RT_META_CATEG_CLS_METH,
+ OCTI_RT_META_CATEG_NST_METH,
+ OCTI_RT_META_PROTO_CLS_METH,
+ OCTI_RT_META_PROTO_NST_METH,
+
+ OCTI_RT_META_CLASS_PROT,
+ OCTI_RT_META_CATEG_PROT,
+ OCTI_RT_META_PROT_REFS,
+
+ OCTI_RT_META_MSG_REFS,
+ OCTI_RT_META_SEL_REFS,
+
+ OCTI_RT_META_CLSLST_REFS,
+ OCTI_RT_META_CLASS_REF,
+ OCTI_RT_META_SUPER_REF,
+ OCTI_RT_META_CLSLST_NLZY_LAB,
+ OCTI_RT_META_CLSLST_LAB,
+ OCTI_RT_META_LAB_PROTOLIST,
+ OCTI_RT_META_LAB_NLZY_CAT,
+ OCTI_RT_META_LAB_CAT,
+
+ OCTI_RT_META_PROPERTY_LIST,
+ OCTI_RT_META_PROTOCOL_EXT,
+ OCTI_RT_META_CLASS_EXT,
+
+ OCTI_RT_META_CLASS_NAME,
+ OCTI_RT_META_METHD_NAME,
+ OCTI_RT_META_METHD_TYPE,
+ OCTI_RT_META_PROPN_ATTR,
+
+ OCTI_RT_META_MODULES,
+ OCTI_RT_META_SYMTAB,
+ OCTI_RT_META_INFO,
+
+ OCTI_RT_META_EHTYPE,
+
+ OCTI_RT_META_CONST_STR,
+
+ OCTI_RT_META_MAX
+};
+
+/* Tags for the META data so that the backend can put them in the correct
+ sections for targets/runtimes (Darwin/NeXT) that require this.
+ This information also survives LTO - which might produce mixed language
+ output. */
+
+/* Objective-C meta data attribute tag */
+#define objc_meta objc_rt_trees[OCTI_RT_OBJC_META]
+/* Attribute values, base = default section. */
+#define meta_base objc_rt_trees[OCTI_RT_META_BASE]
+
+ /* CLASS. */
+#define meta_class objc_rt_trees[OCTI_RT_META_CLASS]
+ /* METACLASS. */
+#define meta_metaclass objc_rt_trees[OCTI_RT_META_METACLASS]
+ /* CLASS. */
+#define meta_category objc_rt_trees[OCTI_RT_META_CATEGORY]
+ /* PROTOCOL. */
+#define meta_protocol objc_rt_trees[OCTI_RT_META_PROTOCOL]
+
+ /* Class class vars section. */
+#define meta_clac_vars objc_rt_trees[OCTI_RT_META_CLASS_CLS_VARS]
+ /* Class instance vars section. */
+#define meta_clai_vars objc_rt_trees[OCTI_RT_META_CLASS_NST_VARS]
+ /* Class class methods section. */
+#define meta_clac_meth objc_rt_trees[OCTI_RT_META_CLASS_CLS_METH]
+ /* Class instance methods section. */
+#define meta_clai_meth objc_rt_trees[OCTI_RT_META_CLASS_NST_METH]
+ /* Category class methods section. */
+#define meta_catc_meth objc_rt_trees[OCTI_RT_META_CATEG_CLS_METH]
+ /* Category instance methods section. */
+#define meta_cati_meth objc_rt_trees[OCTI_RT_META_CATEG_NST_METH]
+#define meta_proto_cls_meth \
+ objc_rt_trees[OCTI_RT_META_PROTO_CLS_METH]
+#define meta_proto_nst_meth \
+ objc_rt_trees[OCTI_RT_META_PROTO_NST_METH]
+
+ /* Class protocols. */
+#define meta_clas_prot objc_rt_trees[OCTI_RT_META_CLASS_PROT]
+ /* Category protocols. */
+#define meta_catg_prot objc_rt_trees[OCTI_RT_META_CATEG_PROT]
+ /* Protocol references. */
+#define meta_proto_ref objc_rt_trees[OCTI_RT_META_PROT_REFS]
+
+ /* Message refs. */
+#define meta_mref objc_rt_trees[OCTI_RT_META_MSG_REFS]
+ /* Selector refs. */
+#define meta_sel_refs objc_rt_trees[OCTI_RT_META_SEL_REFS]
+
+ /* Class list refs. */
+#define meta_class_ref objc_rt_trees[OCTI_RT_META_CLSLST_REFS]
+#define meta_class_reference \
+ objc_rt_trees[OCTI_RT_META_CLASS_REF]
+#define meta_superclass_ref \
+ objc_rt_trees[OCTI_RT_META_SUPER_REF]
+ /* Class list Label. */
+#define meta_label_classlist \
+ objc_rt_trees[OCTI_RT_META_CLSLST_LAB]
+ /* Class list Label (non lazy). */
+#define meta_label_nonlazy_classlist \
+ objc_rt_trees[OCTI_RT_META_CLSLST_NLZY_LAB]
+#define meta_label_categorylist \
+ objc_rt_trees[OCTI_RT_META_LAB_CAT]
+#define meta_label_nonlazy_categorylist \
+ objc_rt_trees[OCTI_RT_META_LAB_NLZY_CAT]
+
+#define meta_label_protocollist \
+ objc_rt_trees[OCTI_RT_META_LAB_PROTOLIST]
+
+
+/* V1 - property list. */
+#define meta_proplist objc_rt_trees[OCTI_RT_META_PROPERTY_LIST]
+#define meta_protocol_extension \
+ objc_rt_trees[OCTI_RT_META_PROTOCOL_EXT]
+#define meta_class_extension \
+ objc_rt_trees[OCTI_RT_META_CLASS_EXT]
+ /* String sections. */
+#define meta_class_name objc_rt_trees[OCTI_RT_META_CLASS_NAME]
+#define meta_meth_name objc_rt_trees[OCTI_RT_META_METHD_NAME]
+#define meta_meth_type objc_rt_trees[OCTI_RT_META_METHD_TYPE]
+#define meta_prop_name_attr \
+ objc_rt_trees[OCTI_RT_META_PROPN_ATTR]
+
+#define meta_modules objc_rt_trees[OCTI_RT_META_MODULES]
+#define meta_symtab objc_rt_trees[OCTI_RT_META_SYMTAB]
+#define meta_info objc_rt_trees[OCTI_RT_META_INFO]
+
+#define meta_ehtype objc_rt_trees[OCTI_RT_META_EHTYPE]
+
+#define meta_const_str objc_rt_trees[OCTI_RT_META_CONST_STR]
+
+#define OBJCMETA(DECL,VERS,KIND) \
+ if (VERS) \
+ DECL_ATTRIBUTES (DECL) = build_tree_list ((VERS), (KIND));
diff --git a/gcc/objc/objc-next-runtime-abi-01.c b/gcc/objc/objc-next-runtime-abi-01.c
new file mode 100644
index 00000000000..3bab0a92d5e
--- /dev/null
+++ b/gcc/objc/objc-next-runtime-abi-01.c
@@ -0,0 +1,2981 @@
+/* Next Runtime (ABI-0/1) private.
+ Copyright (C) 2011 Free Software Foundation, Inc.
+ Contributed by Iain Sandoe (split from objc-act.c)
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3, or (at your option)
+any later version.
+
+GCC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING3. If not see
+<http://www.gnu.org/licenses/>. */
+
+/* This implements the original NeXT ABI (0) used for m32 code and
+ indicated by module version 6. It also implements the small number
+ of additions made for properties and optional protocol methods as
+ ABI=1 (module version 7). */
+
+#include "config.h"
+#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
+#include "tree.h"
+
+#ifdef OBJCPLUS
+#include "cp-tree.h"
+#else
+#include "c-tree.h"
+#include "c-lang.h"
+#endif
+#include "langhooks.h"
+#include "c-family/c-objc.h"
+#include "objc-act.h"
+
+/* When building Objective-C++, we are not linking against the C
+ front-end and so need to replicate the C tree-construction
+ functions in some way. */
+#ifdef OBJCPLUS
+#define OBJCP_REMAP_FUNCTIONS
+#include "objcp-decl.h"
+#endif /* OBJCPLUS */
+
+#include "ggc.h"
+#include "target.h"
+#include "output.h"
+#include "tree-iterator.h"
+
+#include "objc-runtime-hooks.h"
+#include "objc-runtime-shared-support.h"
+
+/* NeXT ABI 0 and 1 private definitions. */
+#define DEF_CONSTANT_STRING_CLASS_NAME "NSConstantString"
+
+#define TAG_GETCLASS "objc_getClass"
+#define TAG_GETMETACLASS "objc_getMetaClass"
+
+#define TAG_MSGSEND "objc_msgSend"
+#define TAG_MSGSENDSUPER "objc_msgSendSuper"
+#define TAG_MSGSEND_STRET "objc_msgSend_stret"
+#define TAG_MSGSENDSUPER_STRET "objc_msgSendSuper_stret"
+
+/* NeXT-specific tags. */
+
+#define TAG_MSGSEND_NONNIL "objc_msgSendNonNil"
+#define TAG_MSGSEND_NONNIL_STRET "objc_msgSendNonNil_stret"
+#define TAG_EXCEPTIONEXTRACT "objc_exception_extract"
+#define TAG_EXCEPTIONTRYENTER "objc_exception_try_enter"
+#define TAG_EXCEPTIONTRYEXIT "objc_exception_try_exit"
+#define TAG_EXCEPTIONMATCH "objc_exception_match"
+#define TAG_SETJMP "_setjmp"
+
+#define TAG_ASSIGNIVAR "objc_assign_ivar"
+#define TAG_ASSIGNGLOBAL "objc_assign_global"
+#define TAG_ASSIGNSTRONGCAST "objc_assign_strongCast"
+
+/* Branch entry points. All that matters here are the addresses;
+ functions with these names do not really exist in libobjc. */
+
+#define TAG_MSGSEND_FAST "objc_msgSend_Fast"
+#define TAG_ASSIGNIVAR_FAST "objc_assign_ivar_Fast"
+
+/* The version identifies which language generation and runtime the
+ module (file) was compiled for, and is recorded in the module
+ descriptor. */
+#define OBJC_VERSION (flag_objc_abi >= 1 ? 7 : 6)
+
+#define UTAG_CLASS_EXT "_objc_class_ext"
+#define UTAG_PROPERTY_LIST "_prop_list_t"
+#define UTAG_PROTOCOL_EXT "_objc_protocol_extension"
+
+#define CLS_HAS_CXX_STRUCTORS 0x2000L
+
+/* rt_trees identifiers - shared between NeXT implementations. These
+ allow the FE to tag meta-data in a manner that survives LTO and can
+ be used when the runtime requires that certain meta-data items
+ appear in particular named sections. */
+
+#include "objc-next-metadata-tags.h"
+extern GTY(()) tree objc_rt_trees[OCTI_RT_META_MAX];
+
+static void next_runtime_01_initialize (void);
+
+static tree next_runtime_abi_01_super_superclassfield_id (void);
+
+static tree next_runtime_abi_01_class_decl (tree);
+static tree next_runtime_abi_01_metaclass_decl (tree);
+static tree next_runtime_abi_01_category_decl (tree);
+static tree next_runtime_abi_01_protocol_decl (tree);
+static tree next_runtime_abi_01_string_decl (tree, const char *, string_section);
+
+static tree next_runtime_abi_01_get_class_reference (tree);
+static tree next_runtime_abi_01_build_selector_reference (location_t, tree, tree);
+static tree next_runtime_abi_01_get_protocol_reference (location_t, tree);
+static tree next_runtime_abi_01_build_ivar_ref (location_t, tree, tree);
+static tree next_runtime_abi_01_get_class_super_ref (location_t, struct imp_entry *, bool);
+static tree next_runtime_abi_01_get_category_super_ref (location_t, struct imp_entry *, bool);
+
+static tree next_runtime_abi_01_receiver_is_class_object (tree);
+static tree next_runtime_abi_01_get_arg_type_list_base (tree, int, int);
+static tree next_runtime_abi_01_build_objc_method_call (location_t, tree, tree,
+ tree, tree, tree, int);
+static bool next_runtime_abi_01_setup_const_string_class_decl (void);
+static tree next_runtime_abi_01_build_const_string_constructor (location_t, tree, int);
+
+static void objc_generate_v1_next_metadata (void);
+
+static void build_next_objc_exception_stuff (void);
+static tree objc_eh_runtime_type (tree type);
+static tree objc_eh_personality (void);
+static tree build_throw_stmt (location_t, tree, bool);
+static tree objc_build_exc_ptr (struct objc_try_context **);
+static tree begin_catch (struct objc_try_context **, tree, tree, tree, bool);
+static void finish_catch (struct objc_try_context **, tree);
+static tree finish_try_stmt (struct objc_try_context **);
+
+bool
+objc_next_runtime_abi_01_init (objc_runtime_hooks *rthooks)
+{
+ if (flag_objc_exceptions
+ && !flag_objc_sjlj_exceptions)
+ {
+ warning_at (UNKNOWN_LOCATION, OPT_Wall,
+ "%<-fobjc-sjlj-exceptions%> is the only supported exceptions "
+ "system for %<-fnext-runtime%> with %<-fobjc-abi-version%> < 2");
+ }
+
+ rthooks->initialize = next_runtime_01_initialize;
+ rthooks->default_constant_string_class_name = DEF_CONSTANT_STRING_CLASS_NAME;
+ rthooks->tag_getclass = TAG_GETCLASS;
+ rthooks->super_superclassfield_ident = next_runtime_abi_01_super_superclassfield_id;
+
+ rthooks->class_decl = next_runtime_abi_01_class_decl;
+ rthooks->metaclass_decl = next_runtime_abi_01_metaclass_decl;
+ rthooks->category_decl = next_runtime_abi_01_category_decl;
+ rthooks->protocol_decl = next_runtime_abi_01_protocol_decl;
+ rthooks->string_decl = next_runtime_abi_01_string_decl;
+
+ rthooks->get_class_reference = next_runtime_abi_01_get_class_reference;
+ rthooks->build_selector_reference = next_runtime_abi_01_build_selector_reference;
+ rthooks->get_protocol_reference = next_runtime_abi_01_get_protocol_reference;
+ rthooks->build_ivar_reference = next_runtime_abi_01_build_ivar_ref;
+ rthooks->get_class_super_ref = next_runtime_abi_01_get_class_super_ref;
+ rthooks->get_category_super_ref = next_runtime_abi_01_get_category_super_ref;
+
+ rthooks->receiver_is_class_object = next_runtime_abi_01_receiver_is_class_object;
+ rthooks->get_arg_type_list_base = next_runtime_abi_01_get_arg_type_list_base;
+ rthooks->build_objc_method_call = next_runtime_abi_01_build_objc_method_call;
+
+ rthooks->setup_const_string_class_decl =
+ next_runtime_abi_01_setup_const_string_class_decl;
+ rthooks->build_const_string_constructor =
+ next_runtime_abi_01_build_const_string_constructor;
+
+ rthooks->build_throw_stmt = build_throw_stmt;
+ rthooks->build_exc_ptr = objc_build_exc_ptr;
+ rthooks->begin_catch = begin_catch;
+ rthooks->finish_catch = finish_catch;
+ rthooks->finish_try_stmt = finish_try_stmt;
+
+ rthooks->generate_metadata = objc_generate_v1_next_metadata;
+ return true;
+}
+
+/* We need a way to convey what kind of meta-data are represented by a
+ given variable, since each type is expected (by the runtime) to be
+ found in a specific named section. The solution must be usable
+ with LTO.
+
+ The scheme used for NeXT ABI 0/1 (partial matching of variable
+ names) is not satisfactory for LTO & ABI-2. We now tag ObjC
+ meta-data with identification attributes in the front end. The
+ back-end may choose to act on these as it requires. */
+
+static void
+next_runtime_abi_01_init_metadata_attributes (void)
+{
+ if (!objc_meta)
+ objc_meta = get_identifier ("OBJC1META");
+
+ if (!meta_base)
+ meta_base = get_identifier ("V1_BASE");
+
+ meta_class = get_identifier ("V1_CLAS");
+ meta_metaclass = get_identifier ("V1_META");
+ meta_category = get_identifier ("V1_CATG");
+ meta_protocol = get_identifier ("V1_PROT");
+
+ meta_clac_vars = get_identifier ("V1_CLCV");
+ meta_clai_vars = get_identifier ("V1_CLIV");
+
+ meta_clac_meth = get_identifier ("V1_CLCM");
+ meta_clai_meth = get_identifier ("V1_CLIM");
+ meta_catc_meth = get_identifier ("V1_CACM");
+ meta_cati_meth = get_identifier ("V1_CAIM");
+ meta_proto_cls_meth = get_identifier ("V1_PCLM");
+ meta_proto_nst_meth = get_identifier ("V1_PNSM");
+
+ meta_clas_prot = get_identifier ("V1_CLPR");
+ meta_catg_prot = get_identifier ("V1_CAPR");
+
+ meta_class_reference = get_identifier ("V1_CLRF");
+ meta_proto_ref = get_identifier ("V1_PRFS");
+ meta_sel_refs = get_identifier ("V1_SRFS");
+
+ meta_class_name = get_identifier ("V1_CLSN");
+ meta_meth_name = get_identifier ("V1_METN");
+ meta_meth_type = get_identifier ("V1_METT");
+ meta_prop_name_attr = get_identifier ("V1_STRG");
+
+ meta_modules = get_identifier ("V1_MODU");
+ meta_symtab = get_identifier ("V1_SYMT");
+ meta_info = get_identifier ("V1_INFO");
+
+ meta_proplist = get_identifier ("V1_PLST");
+ meta_protocol_extension = get_identifier ("V1_PEXT");
+ meta_class_extension = get_identifier ("V1_CEXT");
+
+ meta_const_str = get_identifier ("V1_CSTR");
+}
+
+static void build_v1_class_template (void);
+static void build_v1_category_template (void);
+static void build_v1_protocol_template (void);
+
+static void next_runtime_01_initialize (void)
+{
+ tree type;
+
+#ifdef OBJCPLUS
+ /* For all NeXT objc ABIs -fobjc-call-cxx-cdtors is on by
+ default. */
+ if (!global_options_set.x_flag_objc_call_cxx_cdtors)
+ global_options.x_flag_objc_call_cxx_cdtors = 1;
+#endif
+
+ /* Set up attributes to be attached to the meta-data so that they
+ will be placed in the correct sections. */
+ next_runtime_abi_01_init_metadata_attributes ();
+
+ if (flag_objc_abi >= 1)
+ objc_prop_list_ptr = build_pointer_type (xref_tag (RECORD_TYPE,
+ get_identifier ("_prop_list_t")));
+
+ /* Declare type of selector-objects that represent an operation
+ name. */
+ /* `struct objc_selector *' */
+ objc_selector_type = build_pointer_type (xref_tag (RECORD_TYPE,
+ get_identifier (TAG_SELECTOR)));
+
+ build_v1_class_template ();
+ build_super_template ();
+ build_v1_protocol_template ();
+ build_v1_category_template ();
+
+ /* NB: In order to call one of the ..._stret (struct-returning)
+ functions, the function *MUST* first be cast to a signature that
+ corresponds to the actual ObjC method being invoked. This is
+ what is done by the build_objc_method_call() routine below. */
+
+ /* id objc_msgSend (id, SEL, ...); */
+ /* id objc_msgSendNonNil (id, SEL, ...); */
+ /* id objc_msgSend_stret (id, SEL, ...); */
+ /* id objc_msgSendNonNil_stret (id, SEL, ...); */
+ type = build_varargs_function_type_list (objc_object_type,
+ objc_object_type,
+ objc_selector_type,
+ NULL_TREE);
+
+ umsg_decl = add_builtin_function (TAG_MSGSEND,
+ type, 0, NOT_BUILT_IN,
+ NULL, NULL_TREE);
+
+ umsg_nonnil_decl = add_builtin_function (TAG_MSGSEND_NONNIL,
+ type, 0, NOT_BUILT_IN,
+ NULL, NULL_TREE);
+
+ umsg_stret_decl = add_builtin_function (TAG_MSGSEND_STRET,
+ type, 0, NOT_BUILT_IN,
+ NULL, NULL_TREE);
+
+ umsg_nonnil_stret_decl = add_builtin_function (TAG_MSGSEND_NONNIL_STRET,
+ type, 0, NOT_BUILT_IN,
+ NULL, NULL_TREE);
+
+ /* These can throw, because the function that gets called can throw
+ in Obj-C++, or could itself call something that can throw even in
+ Obj-C. */
+ TREE_NOTHROW (umsg_decl) = 0;
+ TREE_NOTHROW (umsg_nonnil_decl) = 0;
+ TREE_NOTHROW (umsg_stret_decl) = 0;
+ TREE_NOTHROW (umsg_nonnil_stret_decl) = 0;
+
+ /* id objc_msgSend_Fast (id, SEL, ...)
+ __attribute__ ((hard_coded_address (OFFS_MSGSEND_FAST))); */
+#ifdef OFFS_MSGSEND_FAST
+ umsg_fast_decl = add_builtin_function (TAG_MSGSEND_FAST,
+ type, 0, NOT_BUILT_IN,
+ NULL, NULL_TREE);
+ TREE_NOTHROW (umsg_fast_decl) = 0;
+ DECL_ATTRIBUTES (umsg_fast_decl)
+ = tree_cons (get_identifier ("hard_coded_address"),
+ build_int_cst (NULL_TREE, OFFS_MSGSEND_FAST),
+ NULL_TREE);
+#else
+ /* No direct dispatch available. */
+ umsg_fast_decl = umsg_decl;
+#endif
+
+ /* id objc_msgSendSuper (struct objc_super *, SEL, ...); */
+ /* id objc_msgSendSuper_stret (struct objc_super *, SEL, ...); */
+ type = build_varargs_function_type_list (objc_object_type,
+ objc_super_type,
+ objc_selector_type,
+ NULL_TREE);
+ umsg_super_decl = add_builtin_function (TAG_MSGSENDSUPER,
+ type, 0, NOT_BUILT_IN,
+ NULL, NULL_TREE);
+ umsg_super_stret_decl = add_builtin_function (TAG_MSGSENDSUPER_STRET,
+ type, 0, NOT_BUILT_IN, 0,
+ NULL_TREE);
+ TREE_NOTHROW (umsg_super_decl) = 0;
+ TREE_NOTHROW (umsg_super_stret_decl) = 0;
+
+ type = build_function_type_list (objc_object_type,
+ const_string_type_node,
+ NULL_TREE);
+
+ /* id objc_getClass (const char *); */
+ objc_get_class_decl
+ = add_builtin_function (TAG_GETCLASS, type, 0, NOT_BUILT_IN,
+ NULL, NULL_TREE);
+
+ /* id objc_getMetaClass (const char *); */
+ objc_get_meta_class_decl
+ = add_builtin_function (TAG_GETMETACLASS, type, 0, NOT_BUILT_IN, NULL, NULL_TREE);
+
+ /* This is the type of all of the following functions
+ objc_copyStruct(). */
+ type = build_function_type_list (void_type_node,
+ ptr_type_node,
+ const_ptr_type_node,
+ ptrdiff_type_node,
+ boolean_type_node,
+ boolean_type_node,
+ NULL_TREE);
+ /* Declare the following function:
+ void
+ objc_copyStruct (void *destination, const void *source,
+ ptrdiff_t size, BOOL is_atomic, BOOL has_strong); */
+ objc_copyStruct_decl = add_builtin_function ("objc_copyStruct",
+ type, 0, NOT_BUILT_IN,
+ NULL, NULL_TREE);
+ TREE_NOTHROW (objc_copyStruct_decl) = 0;
+ objc_getPropertyStruct_decl = NULL_TREE;
+ objc_setPropertyStruct_decl = NULL_TREE;
+
+ build_next_objc_exception_stuff ();
+ if (flag_objc_exceptions && !flag_objc_sjlj_exceptions)
+ using_eh_for_cleanups ();
+ lang_hooks.eh_runtime_type = objc_eh_runtime_type;
+ lang_hooks.eh_personality = objc_eh_personality;
+}
+
+/* --- templates --- */
+
+/* struct _objc_class
+ {
+ struct _objc_class *isa;
+ struct _objc_class *super_class;
+ char *name;
+ long version;
+ long info;
+ long instance_size;
+ struct _objc_ivar_list *ivars;
+ struct _objc_method_list *methods;
+ struct objc_cache *cache;
+ struct _objc_protocol_list *protocols;
+ #if ABI=1
+ const char *ivar_layout;
+ struct _objc_class_ext *ext;
+ #else
+ void *sel_id;
+ void *gc_object_type;
+ #endif
+ }; */
+
+/* The 'sel_id' & 'gc_object_type' fields are not used by the NeXT
+ runtime. We generate them for ABI==0 to maintain backward binary
+ compatibility. */
+
+static void
+build_v1_class_template (void)
+{
+ tree ptype, decls, *chain = NULL;
+
+ objc_class_template = objc_start_struct (get_identifier (UTAG_CLASS));
+
+ /* struct _objc_class *isa; */
+ decls = add_field_decl (build_pointer_type (objc_class_template),
+ "isa", &chain);
+
+ /* struct _objc_class *super_class; */
+ add_field_decl (build_pointer_type (objc_class_template),
+ "super_class", &chain);
+
+ /* char *name; */
+ add_field_decl (string_type_node, "name", &chain);
+
+ /* long version; */
+ add_field_decl (long_integer_type_node, "version", &chain);
+
+ /* long info; */
+ add_field_decl (long_integer_type_node, "info", &chain);
+
+ /* long instance_size; */
+ add_field_decl (long_integer_type_node, "instance_size", &chain);
+
+ /* struct _objc_ivar_list *ivars; */
+ add_field_decl (objc_ivar_list_ptr,"ivars", &chain);
+
+ /* struct _objc_method_list *methods; */
+ add_field_decl (objc_method_list_ptr, "methods", &chain);
+
+ /* struct objc_cache *cache; */
+ ptype = build_pointer_type (xref_tag (RECORD_TYPE,
+ get_identifier ("objc_cache")));
+ add_field_decl (ptype, "cache", &chain);
+
+ /* struct _objc_protocol **protocol_list; */
+ ptype = build_pointer_type (build_pointer_type
+ (xref_tag (RECORD_TYPE,
+ get_identifier (UTAG_PROTOCOL))));
+ add_field_decl (ptype, "protocol_list", &chain);
+
+ if (flag_objc_abi >= 1)
+ {
+ /* const char *ivar_layout; */
+ add_field_decl (const_string_type_node, "ivar_layout", &chain);
+
+ /* struct _objc_class_ext *ext; */
+ ptype = build_pointer_type (xref_tag (RECORD_TYPE,
+ get_identifier (UTAG_CLASS_EXT)));
+ add_field_decl (ptype, "ext", &chain);
+ }
+ else
+ {
+ /* void *sel_id; */
+ add_field_decl (build_pointer_type (void_type_node), "sel_id", &chain);
+ /* void *gc_object_type; */
+ add_field_decl (build_pointer_type (void_type_node), "gc_object_type",
+ &chain);
+ }
+
+ objc_finish_struct (objc_class_template, decls);
+}
+
+/* struct _objc_category
+ {
+ char *category_name;
+ char *class_name;
+ struct _objc_method_list *instance_methods;
+ struct _objc_method_list *class_methods;
+ struct _objc_protocol_list *protocols;
+ #if ABI=1
+ uint32_t size; // sizeof (struct _objc_category)
+ struct _objc_property_list *instance_properties; // category's own @property decl.
+ #endif
+ }; */
+
+static void
+build_v1_category_template (void)
+{
+ tree ptype, decls, *chain = NULL;
+
+ objc_category_template = objc_start_struct (get_identifier (UTAG_CATEGORY));
+
+ /* char *category_name; */
+ decls = add_field_decl (string_type_node, "category_name", &chain);
+
+ /* char *class_name; */
+ add_field_decl (string_type_node, "class_name", &chain);
+
+ /* struct _objc_method_list *instance_methods; */
+ add_field_decl (objc_method_list_ptr, "instance_methods", &chain);
+
+ /* struct _objc_method_list *class_methods; */
+ add_field_decl (objc_method_list_ptr, "class_methods", &chain);
+
+ /* struct _objc_protocol **protocol_list; */
+ ptype = build_pointer_type (build_pointer_type (objc_protocol_template));
+ add_field_decl (ptype, "protocol_list", &chain);
+
+ if (flag_objc_abi >= 1)
+ {
+ add_field_decl (integer_type_node, "size", &chain);
+
+ /* struct _objc_property_list *instance_properties;
+ This field describes a category's @property declarations.
+ Properties from inherited protocols are not included. */
+ ptype = build_pointer_type (xref_tag (RECORD_TYPE,
+ get_identifier (UTAG_PROPERTY_LIST)));
+ add_field_decl (ptype, "instance_properties", &chain);
+ }
+ objc_finish_struct (objc_category_template, decls);
+}
+
+/* Begin code generation for protocols...
+ Modified for ObjC #1 extensions. */
+
+/* struct _objc_protocol
+ {
+ #if ABI=1
+ struct _objc_protocol_extension *isa;
+ #else
+ struct _objc_class *isa;
+ #endif
+
+ char *protocol_name;
+ struct _objc_protocol **protocol_list;
+ struct _objc__method_prototype_list *instance_methods;
+ struct _objc__method_prototype_list *class_methods;
+ }; */
+
+static void
+build_v1_protocol_template (void)
+{
+ tree ptype, decls, *chain = NULL;
+
+ objc_protocol_template = objc_start_struct (get_identifier (UTAG_PROTOCOL));
+
+ if (flag_objc_abi >= 1)
+ /* struct _objc_protocol_extension *isa; */
+ ptype = build_pointer_type (xref_tag (RECORD_TYPE,
+ get_identifier (UTAG_PROTOCOL_EXT)));
+ else
+ /* struct _objc_class *isa; */
+ ptype = build_pointer_type (xref_tag (RECORD_TYPE,
+ get_identifier (UTAG_CLASS)));
+
+ decls = add_field_decl (ptype, "isa", &chain);
+
+ /* char *protocol_name; */
+ add_field_decl (string_type_node, "protocol_name", &chain);
+
+ /* struct _objc_protocol **protocol_list; */
+ ptype = build_pointer_type (build_pointer_type (objc_protocol_template));
+ add_field_decl (ptype, "protocol_list", &chain);
+
+ /* struct _objc__method_prototype_list *instance_methods; */
+ add_field_decl (objc_method_proto_list_ptr, "instance_methods", &chain);
+
+ /* struct _objc__method_prototype_list *class_methods; */
+ add_field_decl (objc_method_proto_list_ptr, "class_methods", &chain);
+
+ objc_finish_struct (objc_protocol_template, decls);
+}
+
+/* --- names, decls identifers --- */
+
+static tree
+next_runtime_abi_01_super_superclassfield_id (void)
+{
+ if (!super_superclassfield_id)
+ super_superclassfield_id = get_identifier ("super_class");
+ return super_superclassfield_id;
+}
+
+static tree
+next_runtime_abi_01_class_decl (tree klass)
+{
+ tree decl;
+ char buf[BUFSIZE];
+ snprintf (buf, BUFSIZE, "_OBJC_Class_%s",
+ IDENTIFIER_POINTER (CLASS_NAME (klass)));
+ decl = start_var_decl (objc_class_template, buf);
+ OBJCMETA (decl, objc_meta, meta_class);
+ return decl;
+}
+
+static tree
+next_runtime_abi_01_metaclass_decl (tree klass)
+{
+ tree decl;
+ char buf[BUFSIZE];
+ snprintf (buf, BUFSIZE, "_OBJC_MetaClass_%s",
+ IDENTIFIER_POINTER (CLASS_NAME (klass)));
+ decl = start_var_decl (objc_class_template, buf);
+ OBJCMETA (decl, objc_meta, meta_metaclass);
+ return decl;
+}
+
+static tree
+next_runtime_abi_01_category_decl (tree klass)
+{
+ tree decl;
+ char buf[BUFSIZE];
+ snprintf (buf, BUFSIZE, "_OBJC_Category_%s_on_%s",
+ IDENTIFIER_POINTER (CLASS_SUPER_NAME (klass)),
+ IDENTIFIER_POINTER (CLASS_NAME (klass)));
+ decl = start_var_decl (objc_category_template, buf);
+ OBJCMETA (decl, objc_meta, meta_category);
+ return decl;
+}
+
+static tree
+next_runtime_abi_01_protocol_decl (tree p)
+{
+ tree decl;
+ char buf[BUFSIZE];
+
+ /* static struct _objc_protocol _OBJC_Protocol_<mumble>; */
+
+ snprintf (buf, BUFSIZE, "_OBJC_Protocol_%s",
+ IDENTIFIER_POINTER (PROTOCOL_NAME (p)));
+ decl = start_var_decl (objc_protocol_template, buf);
+ OBJCMETA (decl, objc_meta, meta_protocol);
+ return decl;
+}
+
+static tree
+next_runtime_abi_01_string_decl (tree type, const char *name, string_section where)
+{
+ tree var = start_var_decl (type, name);
+ switch (where)
+ {
+ case class_names:
+ OBJCMETA (var, objc_meta, meta_class_name);
+ break;
+ case meth_var_names:
+ OBJCMETA (var, objc_meta, meta_meth_name);
+ break;
+ case meth_var_types:
+ OBJCMETA (var, objc_meta, meta_meth_type);
+ break;
+ case prop_names_attr:
+ OBJCMETA (var, objc_meta, meta_prop_name_attr);
+ break;
+ default:
+ OBJCMETA (var, objc_meta, meta_base);
+ break;
+ }
+ return var;
+}
+
+/* --- entry --- */
+
+static GTY(()) int class_reference_idx;
+
+static tree
+build_class_reference_decl (void)
+{
+ tree decl;
+ char buf[BUFSIZE];
+
+ sprintf (buf, "_OBJC_ClassRefs_%d", class_reference_idx++);
+ decl = start_var_decl (objc_class_type, buf);
+
+ return decl;
+}
+
+static tree
+next_runtime_abi_01_get_class_reference (tree ident)
+{
+ if (!flag_zero_link)
+ {
+ tree *chain;
+ tree decl;
+
+ for (chain = &cls_ref_chain; *chain; chain = &TREE_CHAIN (*chain))
+ if (TREE_VALUE (*chain) == ident)
+ {
+ if (! TREE_PURPOSE (*chain))
+ TREE_PURPOSE (*chain) = build_class_reference_decl ();
+
+ return TREE_PURPOSE (*chain);
+ }
+
+ decl = build_class_reference_decl ();
+ *chain = tree_cons (decl, ident, NULL_TREE);
+ return decl;
+ }
+ else
+ {
+ tree params;
+
+ add_class_reference (ident);
+
+ params = build_tree_list (NULL_TREE,
+ my_build_string_pointer
+ (IDENTIFIER_LENGTH (ident) + 1,
+ IDENTIFIER_POINTER (ident)));
+
+ return build_function_call (input_location, objc_get_class_decl, params);
+ }
+}
+
+/* Used by get_arg_type_list.
+ Return the types for receiver & _cmd at the start of a method argument list.
+ context is either METHOD_DEF or METHOD_REF, saying whether we are trying
+ to define a method or call one. superflag says this is for a send to super.
+ meth may be NULL, in the case that there is no prototype. */
+
+static tree
+next_runtime_abi_01_get_arg_type_list_base (tree meth, int context, int superflag)
+{
+ tree arglist;
+
+ /* Receiver type. */
+ if (superflag)
+ arglist = build_tree_list (NULL_TREE, objc_super_type);
+ else if (context == METHOD_DEF && TREE_CODE (meth) == INSTANCE_METHOD_DECL)
+ arglist = build_tree_list (NULL_TREE, objc_instance_type);
+ else
+ arglist = build_tree_list (NULL_TREE, objc_object_type);
+
+ /* Selector type - will eventually change to `int'. */
+ chainon (arglist, build_tree_list (NULL_TREE, objc_selector_type));
+ return arglist;
+}
+
+static tree
+next_runtime_abi_01_receiver_is_class_object (tree receiver)
+{
+ if (TREE_CODE (receiver) == VAR_DECL
+ && IS_CLASS (TREE_TYPE (receiver)))
+ {
+ /* The receiver is a variable created by build_class_reference_decl. */
+ tree chain = cls_ref_chain ;
+ /* Look up the identifier in the relevant chain. */
+ for (; chain; chain = TREE_CHAIN (chain))
+ if (TREE_PURPOSE (chain) == receiver)
+ return TREE_VALUE (chain);
+ }
+ return NULL_TREE;
+}
+
+static tree
+build_selector_reference_decl (tree ident)
+{
+ tree decl;
+ char *t, buf[BUFSIZE];
+
+ snprintf (buf, BUFSIZE, "_OBJC_SelRef_%s", IDENTIFIER_POINTER (ident));
+ t = buf;
+ while (*t)
+ {
+ if (*t==':')
+ *t = '$'; /* Underscore would clash between foo:bar and foo_bar. */
+ t++;
+ }
+ decl = start_var_decl (objc_selector_type, buf);
+ OBJCMETA (decl, objc_meta, meta_sel_refs);
+ return decl;
+}
+
+static tree
+next_runtime_abi_01_build_selector_reference (location_t loc ATTRIBUTE_UNUSED,
+ tree ident,
+ tree proto ATTRIBUTE_UNUSED)
+{
+ tree *chain = &sel_ref_chain;
+ tree expr;
+
+ while (*chain)
+ {
+ if (TREE_VALUE (*chain) == ident)
+ return TREE_PURPOSE (*chain);
+
+ chain = &TREE_CHAIN (*chain);
+ }
+
+ expr = build_selector_reference_decl (ident);
+
+ *chain = tree_cons (expr, ident, NULL_TREE);
+
+ return expr;
+}
+
+/* Build a tree expression to send OBJECT the operation SELECTOR,
+ looking up the method on object LOOKUP_OBJECT (often same as OBJECT),
+ assuming the method has prototype METHOD_PROTOTYPE.
+ (That is an INSTANCE_METHOD_DECL or CLASS_METHOD_DECL.)
+ LOC is the location of the expression to build.
+ Use METHOD_PARAMS as list of args to pass to the method.
+ If SUPER_FLAG is nonzero, we look up the superclass's method. */
+
+static tree
+build_objc_method_call (location_t loc, int super_flag, tree method_prototype,
+ tree lookup_object, tree selector,
+ tree method_params)
+{
+ tree sender, sender_cast, method, t;
+ tree rcv_p = (super_flag ? objc_super_type : objc_object_type);
+ VEC(tree, gc) *parms;
+ unsigned nparm = (method_params ? list_length (method_params) : 0);
+
+ /* If a prototype for the method to be called exists, then cast
+ the sender's return type and arguments to match that of the method.
+ Otherwise, leave sender as is. */
+ tree ret_type
+ = (method_prototype
+ ? TREE_VALUE (TREE_TYPE (method_prototype))
+ : objc_object_type);
+
+ tree method_param_types =
+ get_arg_type_list (method_prototype, METHOD_REF, super_flag);
+ tree ftype = build_function_type (ret_type, method_param_types);
+
+ if (method_prototype && METHOD_TYPE_ATTRIBUTES (method_prototype))
+ ftype = build_type_attribute_variant (ftype,
+ METHOD_TYPE_ATTRIBUTES
+ (method_prototype));
+
+ sender_cast = build_pointer_type (ftype);
+
+ lookup_object = build_c_cast (loc, rcv_p, lookup_object);
+
+ /* Use SAVE_EXPR to avoid evaluating the receiver twice. */
+ lookup_object = save_expr (lookup_object);
+
+ /* Param list + 2 slots for object and selector. */
+ parms = VEC_alloc (tree, gc, nparm + 2);
+
+ /* If we are returning a struct in memory, and the address
+ of that memory location is passed as a hidden first
+ argument, then change which messenger entry point this
+ expr will call. NB: Note that sender_cast remains
+ unchanged (it already has a struct return type). */
+ if (!targetm.calls.struct_value_rtx (0, 0)
+ && (TREE_CODE (ret_type) == RECORD_TYPE
+ || TREE_CODE (ret_type) == UNION_TYPE)
+ && targetm.calls.return_in_memory (ret_type, 0))
+ sender = (super_flag ? umsg_super_stret_decl
+ : flag_nil_receivers ? umsg_stret_decl
+ : umsg_nonnil_stret_decl);
+ else
+ sender = (super_flag ? umsg_super_decl
+ : (flag_nil_receivers ? (flag_objc_direct_dispatch
+ ? umsg_fast_decl
+ : umsg_decl)
+ : umsg_nonnil_decl));
+ method = build_fold_addr_expr_loc (loc, sender);
+
+ /* Pass the object to the method. */
+ VEC_quick_push (tree, parms, lookup_object);
+ /* Pass the selector to the method. */
+ VEC_quick_push (tree, parms, selector);
+ /* Now append the remainder of the parms. */
+ if (nparm)
+ for (; method_params; method_params = TREE_CHAIN (method_params))
+ VEC_quick_push (tree, parms, TREE_VALUE (method_params));
+
+ /* Build an obj_type_ref, with the correct cast for the method call. */
+ t = build3 (OBJ_TYPE_REF, sender_cast, method,
+ lookup_object, size_zero_node);
+ t = build_function_call_vec (loc, t, parms, NULL);
+ VEC_free (tree, gc, parms);
+ return t;
+}
+
+static tree
+next_runtime_abi_01_build_objc_method_call (location_t loc,
+ tree method_prototype,
+ tree receiver,
+ tree rtype ATTRIBUTE_UNUSED,
+ tree sel_name,
+ tree method_params,
+ int super)
+{
+ tree selector = next_runtime_abi_01_build_selector_reference (loc, sel_name,
+ NULL_TREE);
+
+ return build_objc_method_call (loc, super, method_prototype,
+ receiver, selector, method_params);
+}
+
+static tree
+next_runtime_abi_01_get_protocol_reference (location_t loc, tree p)
+{
+ tree expr;
+
+ if (!PROTOCOL_FORWARD_DECL (p))
+ PROTOCOL_FORWARD_DECL (p) = next_runtime_abi_01_protocol_decl (p);
+
+ expr = build_unary_op (loc, ADDR_EXPR, PROTOCOL_FORWARD_DECL (p), 0);
+ return convert (objc_protocol_type, expr);
+}
+
+/* For ABI 0/1 and IVAR is just a fixed offset in the class struct. */
+
+static tree
+next_runtime_abi_01_build_ivar_ref (location_t loc ATTRIBUTE_UNUSED,
+ tree base, tree id)
+{
+ return objc_build_component_ref (base, id);
+}
+
+/* We build super class references as we need them (but keep them once
+ built for the sake of efficiency). */
+
+static tree
+next_runtime_abi_01_get_class_super_ref (location_t loc ATTRIBUTE_UNUSED,
+ struct imp_entry *imp, bool inst_meth)
+{
+ if (inst_meth)
+ {
+ if (!ucls_super_ref)
+ ucls_super_ref =
+ objc_build_component_ref (imp->class_decl,
+ get_identifier ("super_class"));
+ return ucls_super_ref;
+ }
+ else
+ {
+ if (!uucls_super_ref)
+ uucls_super_ref =
+ objc_build_component_ref (imp->meta_decl,
+ get_identifier ("super_class"));
+ return uucls_super_ref;
+ }
+}
+
+static tree
+next_runtime_abi_01_get_category_super_ref (location_t loc ATTRIBUTE_UNUSED,
+ struct imp_entry *imp, bool inst_meth)
+{
+ tree super_name = CLASS_SUPER_NAME (imp->imp_template);
+ tree super_class;
+
+ if (!flag_zero_link)
+ {
+ super_class = objc_get_class_reference (super_name);
+
+ if (!inst_meth)
+
+ /* If we are in a class method, we must retrieve the
+ _metaclass_ for the current class, pointed at by
+ the class's "isa" pointer. The following assumes that
+ "isa" is the first ivar in a class (which it must be). */
+ super_class =
+ build_indirect_ref (input_location,
+ build_c_cast (input_location,
+ build_pointer_type (objc_class_type),
+ super_class),
+ RO_UNARY_STAR);
+ return super_class;
+ }
+
+ /* else do it the slow way. */
+ add_class_reference (super_name);
+ super_class = (inst_meth ? objc_get_class_decl : objc_get_meta_class_decl);
+/* assemble_external (super_class);*/
+ super_name = my_build_string_pointer (IDENTIFIER_LENGTH (super_name) + 1,
+ IDENTIFIER_POINTER (super_name));
+ /* super_class = objc_get{Meta}Class("CLASS_SUPER_NAME"); */
+ return build_function_call (input_location,
+ super_class,
+ build_tree_list (NULL_TREE, super_name));
+}
+
+static bool
+next_runtime_abi_01_setup_const_string_class_decl (void)
+{
+ if (!constant_string_global_id)
+ {
+ /* Hopefully, this should not represent a serious limitation. */
+ char buf[BUFSIZE];
+ snprintf (buf, BUFSIZE, "_%sClassReference", constant_string_class_name);
+ constant_string_global_id = get_identifier (buf);
+ }
+
+ string_class_decl = lookup_name (constant_string_global_id);
+
+ return (string_class_decl != NULL_TREE);
+}
+
+static tree
+next_runtime_abi_01_build_const_string_constructor (location_t loc, tree string,
+ int length)
+{
+ tree constructor, fields, var;
+ VEC(constructor_elt,gc) *v = NULL;
+
+ /* NeXT: (NSConstantString *) & ((__builtin_ObjCString) { isa, string, length }) */
+ fields = TYPE_FIELDS (internal_const_str_type);
+ CONSTRUCTOR_APPEND_ELT (v, fields,
+ build_unary_op (loc, ADDR_EXPR, string_class_decl, 0));
+
+ fields = DECL_CHAIN (fields);
+ CONSTRUCTOR_APPEND_ELT (v, fields,
+ build_unary_op (loc, ADDR_EXPR, string, 1));
+
+ /* ??? check if this should be long. */
+ fields = DECL_CHAIN (fields);
+ CONSTRUCTOR_APPEND_ELT (v, fields, build_int_cst (NULL_TREE, length));
+ constructor = objc_build_constructor (internal_const_str_type, v);
+
+ var = build_decl (input_location, CONST_DECL, NULL, TREE_TYPE (constructor));
+ DECL_INITIAL (var) = constructor;
+ TREE_STATIC (var) = 1;
+ DECL_CONTEXT (var) = NULL;
+ OBJCMETA (var, objc_meta, meta_const_str);
+ return var;
+}
+
+/* --- metadata templates --- */
+
+/* This routine builds the following type:
+ struct _prop_t {
+ const char * const name; // property name
+ const char * const attributes; // comma-delimited, encoded,
+ // property attributes
+ };
+*/
+
+static GTY(()) tree objc_v1_property_template;
+
+static tree
+build_v1_property_template (void)
+{
+ tree prop_record;
+ tree decls, *chain = NULL;
+
+ prop_record = objc_start_struct (get_identifier ("_prop_t"));
+ /* const char * name */
+ decls = add_field_decl (string_type_node, "name", &chain);
+
+ /* const char * attribute */
+ add_field_decl (string_type_node, "attribute", &chain);
+
+ objc_finish_struct (prop_record, decls);
+ return prop_record;
+}
+
+/* Build the following type:
+
+ struct _objc_protocol_extension
+ {
+ uint32_t size; // sizeof (struct _objc_protocol_extension)
+ struct objc_method_list *optional_instance_methods;
+ struct objc_method_list *optional_class_methods;
+ struct objc_prop_list *instance_properties;
+ }
+*/
+
+static GTY(()) tree objc_protocol_extension_template;
+
+static void
+build_v1_objc_protocol_extension_template (void)
+{
+ tree decls, *chain = NULL;
+
+ objc_protocol_extension_template =
+ objc_start_struct (get_identifier (UTAG_PROTOCOL_EXT));
+
+ /* uint32_t size; */
+ decls = add_field_decl (integer_type_node, "size", &chain);
+
+ /* struct objc_method_list *optional_instance_methods; */
+ add_field_decl (objc_method_list_ptr, "optional_instance_methods", &chain);
+
+ /* struct objc_method_list *optional_class_methods; */
+ add_field_decl (objc_method_list_ptr, "optional_class_methods", &chain);
+
+ /* struct objc_prop_list *instance_properties; */
+ add_field_decl (objc_prop_list_ptr, "instance_properties", &chain);
+
+ objc_finish_struct (objc_protocol_extension_template, decls);
+}
+
+/* This routine build following struct type:
+ struct _objc_class_ext
+ {
+ uint32_t size; // sizeof(struct _objc_class_ext)
+ const char *weak_ivar_layout;
+ struct _prop_list_t *properties;
+ }
+*/
+
+static GTY(()) tree objc_class_ext_template;
+
+static void
+build_objc_class_ext_template (void)
+{
+ tree ptrt, decls, *chain = NULL;
+
+ objc_class_ext_template = objc_start_struct (get_identifier (UTAG_CLASS_EXT));
+
+ /* uint32_t size; */
+ decls = add_field_decl (integer_type_node, "size", &chain);
+
+ /* const char *weak_ivar_layout; */
+ add_field_decl (const_string_type_node, "weak_ivar_layout", &chain);
+
+ /* struct _prop_list_t *properties; */
+ ptrt = build_pointer_type (xref_tag (RECORD_TYPE,
+ get_identifier(UTAG_PROPERTY_LIST)));
+ add_field_decl (ptrt, "properties", &chain);
+
+ objc_finish_struct (objc_class_ext_template, decls);
+}
+
+static void
+build_metadata_templates (void)
+{
+
+ if (!objc_method_template)
+ objc_method_template = build_method_template ();
+
+
+
+}
+
+/* --- emit metadata --- */
+
+static tree
+generate_v1_meth_descriptor_table (tree chain, tree protocol,
+ const char *prefix, tree attr)
+{
+ tree method_list_template, initlist, decl;
+ int size;
+ VEC(constructor_elt,gc) *v = NULL;
+ char buf[BUFSIZE];
+
+ if (!chain || !prefix)
+ return NULL_TREE;
+
+ if (!objc_method_prototype_template)
+ objc_method_prototype_template = build_method_prototype_template ();
+
+ size = list_length (chain);
+ method_list_template =
+ build_method_prototype_list_template (objc_method_prototype_template,
+ size);
+ snprintf (buf, BUFSIZE, "%s_%s", prefix,
+ IDENTIFIER_POINTER (PROTOCOL_NAME (protocol)));
+
+ decl = start_var_decl (method_list_template, buf);
+
+ CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, build_int_cst (NULL_TREE, size));
+ initlist =
+ build_descriptor_table_initializer (objc_method_prototype_template,
+ chain);
+ CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, initlist);
+ /* Get into the right section. */
+ OBJCMETA (decl, objc_meta, attr);
+ finish_var_decl (decl, objc_build_constructor (method_list_template, v));
+ return decl;
+}
+
+/* Build protocol ext =
+ {size, opt_instance_meth, opt_class_meth, instance_props};
+ or NULL_TREE if none are present. */
+
+static tree
+generate_v1_objc_protocol_extension (tree proto_interface,
+ tree opt_instance_meth,
+ tree opt_class_meth,
+ tree instance_props)
+{
+ int size;
+ location_t loc;
+ VEC(constructor_elt,gc) *v = NULL;
+ tree decl, expr;
+ char buf[BUFSIZE];
+
+ /* If there are no extensions, then don't bother... */
+ if (!opt_instance_meth && !opt_class_meth && !instance_props)
+ return NULL_TREE;
+
+ if (!objc_protocol_extension_template)
+ build_v1_objc_protocol_extension_template ();
+
+ /* uint32_t size */
+ size = TREE_INT_CST_LOW (TYPE_SIZE_UNIT (objc_protocol_extension_template));
+ CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, build_int_cst (NULL_TREE, size));
+
+ /* Try for meaningful diagnostics. */
+ loc = DECL_SOURCE_LOCATION (PROTOCOL_FORWARD_DECL (proto_interface));
+
+ /* struct objc_method_list *optional_instance_methods; */
+ if (opt_instance_meth)
+ expr = convert (objc_method_list_ptr,
+ build_unary_op (loc, ADDR_EXPR, opt_instance_meth, 0));
+ else
+ expr = convert (objc_method_list_ptr, null_pointer_node);
+
+ CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, expr);
+
+ /* struct objc_method_list *optional_class_methods; */
+ if (opt_class_meth)
+ expr = convert (objc_method_list_ptr,
+ build_unary_op (loc, ADDR_EXPR, opt_class_meth, 0));
+ else
+ expr = convert (objc_method_list_ptr, null_pointer_node);
+
+ CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, expr);
+ /* struct objc_prop_list *instance_properties; */
+ if (instance_props)
+ expr = convert (objc_prop_list_ptr,
+ build_unary_op (loc, ADDR_EXPR, instance_props, 0));
+ else
+ expr = convert (objc_prop_list_ptr, null_pointer_node);
+
+ CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, expr);
+ snprintf (buf, BUFSIZE, "_OBJC_ProtocolExt_%s",
+ IDENTIFIER_POINTER (PROTOCOL_NAME (proto_interface)));
+
+ decl = start_var_decl (objc_protocol_extension_template, buf);
+ expr = objc_build_constructor (TREE_TYPE (decl), v);
+ OBJCMETA (decl, objc_meta, meta_protocol_extension);
+ finish_var_decl (decl, expr);
+ return decl;
+}
+
+/* This routine builds the following type:
+ struct _prop_list_t {
+ uint32_t entsize; // sizeof (struct _prop_t)
+ uint32_t prop_count;
+ struct _prop_t prop_list [prop_count];
+ }
+*/
+
+static tree
+build_v1_property_list_template (tree list_type, int size)
+{
+ tree property_list_t_record;
+ tree array_type, decls, *chain = NULL;
+
+ /* anonymous. */
+ property_list_t_record = objc_start_struct (NULL_TREE);
+
+ /* uint32_t const entsize */
+ decls = add_field_decl (integer_type_node, "entsize", &chain);
+
+ /* int prop_count */
+ add_field_decl (integer_type_node, "prop_count", &chain);
+
+ /* struct _prop_t prop_list[]; */
+ array_type = build_sized_array_type (list_type, size);
+ add_field_decl (array_type, "prop_list", &chain);
+
+ objc_finish_struct (property_list_t_record, decls);
+ return property_list_t_record;
+}
+
+/* This routine builds the initializer list to initialize the
+ 'struct _prop_t prop_list[]' field of 'struct _prop_list_t' meta-data. */
+
+static tree
+build_v1_property_table_initializer (tree type, tree context)
+{
+ tree x;
+ VEC(constructor_elt,gc) *inits = NULL;
+
+ if (TREE_CODE (context) == PROTOCOL_INTERFACE_TYPE)
+ x = CLASS_PROPERTY_DECL (context);
+ else
+ x = IMPL_PROPERTY_DECL (context);
+
+ for (; x; x = TREE_CHAIN (x))
+ {
+ VEC(constructor_elt,gc) *elemlist = NULL;
+ tree attribute, name_ident = PROPERTY_NAME (x);
+
+ CONSTRUCTOR_APPEND_ELT (elemlist, NULL_TREE,
+ add_objc_string (name_ident, prop_names_attr));
+
+ attribute = objc_v2_encode_prop_attr (x);
+ CONSTRUCTOR_APPEND_ELT (elemlist, NULL_TREE,
+ add_objc_string (attribute, prop_names_attr));
+
+ CONSTRUCTOR_APPEND_ELT (inits, NULL_TREE,
+ objc_build_constructor (type, elemlist));
+ }
+
+ return objc_build_constructor (build_array_type (type, 0),inits);
+}
+
+/* This routine builds the 'struct _prop_list_t' variable declaration and
+ initializes it with its initializer list. TYPE is 'struct _prop_list_t',
+ NAME is the internal name of this variable, SIZE is number of properties
+ for this class and LIST is the initializer list for its 'prop_list' field. */
+
+static tree
+generate_v1_property_table (tree context, tree klass_ctxt)
+{
+ tree x, decl, initlist, property_list_template;
+ bool is_proto = false;
+ VEC(constructor_elt,gc) *inits = NULL;
+ int init_val, size = 0;
+ char buf[BUFSIZE];
+
+ if (context)
+ {
+ gcc_assert (TREE_CODE (context) == PROTOCOL_INTERFACE_TYPE);
+ x = CLASS_PROPERTY_DECL (context);
+ is_proto = true;
+ }
+ else
+ x = IMPL_PROPERTY_DECL (klass_ctxt);
+
+ for (; x; x = TREE_CHAIN (x))
+ size++;
+
+ if (size == 0)
+ return NULL_TREE;
+
+ if (!objc_v1_property_template)
+ objc_v1_property_template = build_v1_property_template ();
+
+ property_list_template =
+ build_v1_property_list_template (objc_v1_property_template,
+ size);
+ initlist = build_v1_property_table_initializer (objc_v1_property_template,
+ is_proto ? context
+ : klass_ctxt);
+
+ init_val = TREE_INT_CST_LOW (TYPE_SIZE_UNIT (objc_v1_property_template));
+ if (is_proto)
+ snprintf (buf, BUFSIZE, "_OBJC_ProtocolPropList_%s",
+ IDENTIFIER_POINTER (PROTOCOL_NAME (context)));
+ else
+ snprintf (buf, BUFSIZE, "_OBJC_ClassPropList_%s",
+ IDENTIFIER_POINTER (CLASS_NAME (klass_ctxt)));
+
+ decl = start_var_decl (property_list_template, buf);
+ CONSTRUCTOR_APPEND_ELT (inits, NULL_TREE, build_int_cst (NULL_TREE, init_val));
+ CONSTRUCTOR_APPEND_ELT (inits, NULL_TREE, build_int_cst (NULL_TREE, size));
+ CONSTRUCTOR_APPEND_ELT (inits, NULL_TREE, initlist);
+ x = objc_build_constructor (TREE_TYPE (decl), inits);
+ OBJCMETA (decl, objc_meta, meta_proplist);
+ finish_var_decl (decl, x);
+ return decl;
+}
+
+static tree
+generate_v1_protocol_list (tree i_or_p, tree klass_ctxt)
+{
+ tree array_type, ptype, refs_decl, lproto, e, plist, attr;
+ int size = 0;
+ VEC(constructor_elt,gc) *v = NULL;
+ char buf[BUFSIZE];
+
+ switch (TREE_CODE (i_or_p))
+ {
+ case CLASS_INTERFACE_TYPE:
+ case CATEGORY_INTERFACE_TYPE:
+ plist = CLASS_PROTOCOL_LIST (i_or_p);
+ break;
+ case PROTOCOL_INTERFACE_TYPE:
+ plist = PROTOCOL_LIST (i_or_p);
+ break;
+ default:
+ gcc_unreachable ();
+ }
+
+ /* Compute size. */
+ for (lproto = plist; lproto; lproto = TREE_CHAIN (lproto))
+ if (TREE_CODE (TREE_VALUE (lproto)) == PROTOCOL_INTERFACE_TYPE
+ && PROTOCOL_FORWARD_DECL (TREE_VALUE (lproto)))
+ size++;
+
+ /* Build initializer. */
+ CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, build_int_cst (NULL_TREE, 0));
+ e = build_int_cst (build_pointer_type (objc_protocol_template), size);
+ CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, e);
+
+ for (lproto = plist; lproto; lproto = TREE_CHAIN (lproto))
+ {
+ tree pval = TREE_VALUE (lproto);
+
+ if (TREE_CODE (pval) == PROTOCOL_INTERFACE_TYPE
+ && PROTOCOL_FORWARD_DECL (pval))
+ {
+ tree fwref = PROTOCOL_FORWARD_DECL (pval);
+ location_t loc = DECL_SOURCE_LOCATION (fwref) ;
+ e = build_unary_op (loc, ADDR_EXPR, fwref, 0);
+ CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, e);
+ }
+ }
+
+ /* static struct objc_protocol *refs[n]; */
+ switch (TREE_CODE (i_or_p))
+ {
+ case PROTOCOL_INTERFACE_TYPE:
+ snprintf (buf, BUFSIZE, "_OBJC_ProtocolRefs_%s",
+ IDENTIFIER_POINTER (PROTOCOL_NAME (i_or_p)));
+ attr = meta_proto_ref;
+ break;
+ case CLASS_INTERFACE_TYPE:
+ snprintf (buf, BUFSIZE, "_OBJC_ClassProtocols_%s",
+ IDENTIFIER_POINTER (CLASS_NAME (i_or_p)));
+ attr = meta_clas_prot;
+ break;
+ case CATEGORY_INTERFACE_TYPE:
+ snprintf (buf, BUFSIZE, "_OBJC_CategoryProtocols_%s_%s",
+ IDENTIFIER_POINTER (CLASS_NAME (klass_ctxt)),
+ IDENTIFIER_POINTER (CLASS_SUPER_NAME (klass_ctxt)));
+ attr = meta_catg_prot;
+ break;
+ default:
+ gcc_unreachable ();
+ }
+
+ ptype = build_pointer_type (objc_protocol_template);
+ array_type = build_sized_array_type (ptype, size + 3);
+ refs_decl = start_var_decl (array_type, buf);
+
+ OBJCMETA (refs_decl, objc_meta, attr);
+ finish_var_decl (refs_decl,
+ objc_build_constructor (TREE_TYPE (refs_decl), v));
+
+ return refs_decl;
+}
+
+static tree
+build_v1_protocol_initializer (tree type, tree protocol_name, tree protocol_list,
+ tree inst_methods, tree class_methods,
+ tree protocol_ext)
+{
+ tree expr, ttyp;
+ location_t loc;
+ VEC(constructor_elt,gc) *inits = NULL;
+
+ if (!objc_protocol_extension_template)
+ build_v1_objc_protocol_extension_template ();
+
+ /* TODO: find a better representation of location from the inputs. */
+ loc = UNKNOWN_LOCATION;
+ ttyp = build_pointer_type (objc_protocol_extension_template);
+ /* Instead of jamming the protocol version number into the isa, we pass
+ either a pointer to the protocol extension - or NULL. */
+ if (protocol_ext)
+ expr = convert (ttyp, build_unary_op (loc, ADDR_EXPR, protocol_ext, 0));
+ else
+ expr = convert (ttyp, null_pointer_node);
+
+ CONSTRUCTOR_APPEND_ELT (inits, NULL_TREE, expr);
+ CONSTRUCTOR_APPEND_ELT (inits, NULL_TREE, protocol_name);
+ CONSTRUCTOR_APPEND_ELT (inits, NULL_TREE, protocol_list);
+
+ ttyp = objc_method_proto_list_ptr;
+ if (inst_methods)
+ expr = convert (ttyp, build_unary_op (loc, ADDR_EXPR, inst_methods, 0));
+ else
+ expr = convert (ttyp, null_pointer_node);
+ CONSTRUCTOR_APPEND_ELT (inits, NULL_TREE, expr);
+
+ if (class_methods)
+ expr = convert (ttyp, build_unary_op (loc, ADDR_EXPR, class_methods, 0));
+ else
+ expr = convert (ttyp, null_pointer_node);
+ CONSTRUCTOR_APPEND_ELT (inits, NULL_TREE, expr);
+
+ return objc_build_constructor (type, inits);
+}
+
+/* An updated version of generate_protocols () that emit the protocol
+ extension for ABI=1. */
+
+/* For each protocol which was referenced either from a @protocol()
+ expression, or because a class/category implements it (then a
+ pointer to the protocol is stored in the struct describing the
+ class/category), we create a statically allocated instance of the
+ Protocol class. The code is written in such a way as to generate
+ as few Protocol objects as possible; we generate a unique Protocol
+ instance for each protocol, and we don't generate a Protocol
+ instance if the protocol is never referenced (either from a
+ @protocol() or from a class/category implementation). These
+ statically allocated objects can be referred to via the static
+ (that is, private to this module) symbols _OBJC_PROTOCOL_n.
+
+ The statically allocated Protocol objects that we generate here
+ need to be fixed up at runtime in order to be used: the 'isa'
+ pointer of the objects need to be set up to point to the 'Protocol'
+ class, as known at runtime.
+
+ The NeXT runtime fixes up all protocols at program startup time,
+ before main() is entered. It uses a low-level trick to look up all
+ those symbols, then loops on them and fixes them up. */
+
+/* TODO: finish getting rid of passing stuff around in globals. */
+
+static GTY(()) tree V1_Protocol_OPT_NST_METHODS_decl;
+static GTY(()) tree V1_Protocol_OPT_CLS_METHODS_decl;
+static GTY(()) tree V1_ProtocolExt_decl;
+static GTY(()) tree V1_Property_decl;
+
+static void
+generate_v1_protocols (void)
+{
+ tree p;
+
+ /* If a protocol was directly referenced, pull in indirect references. */
+ for (p = protocol_chain; p; p = TREE_CHAIN (p))
+ if (PROTOCOL_FORWARD_DECL (p) && PROTOCOL_LIST (p))
+ generate_protocol_references (PROTOCOL_LIST (p));
+
+ for (p = protocol_chain; p; p = TREE_CHAIN (p))
+ {
+ tree decl, encoding, initlist, protocol_name_expr;
+ tree refs_type, refs_decl, refs_expr;
+ location_t loc;
+ tree nst_methods = PROTOCOL_NST_METHODS (p);
+ tree cls_methods = PROTOCOL_CLS_METHODS (p);
+
+ /* If protocol wasn't referenced, don't generate any code. */
+ decl = PROTOCOL_FORWARD_DECL (p);
+
+ if (!decl)
+ continue;
+
+ /* Make sure we link in the Protocol class. */
+ add_class_reference (get_identifier (PROTOCOL_OBJECT_CLASS_NAME));
+
+ while (nst_methods)
+ {
+ if (! METHOD_ENCODING (nst_methods))
+ {
+ encoding = encode_method_prototype (nst_methods);
+ METHOD_ENCODING (nst_methods) = encoding;
+ }
+ nst_methods = TREE_CHAIN (nst_methods);
+ }
+
+ UOBJC_INSTANCE_METHODS_decl =
+ generate_v1_meth_descriptor_table (PROTOCOL_NST_METHODS (p), p,
+ "_OBJC_ProtocolInstanceMethods",
+ meta_proto_nst_meth);
+
+ while (cls_methods)
+ {
+ if (! METHOD_ENCODING (cls_methods))
+ {
+ encoding = encode_method_prototype (cls_methods);
+ METHOD_ENCODING (cls_methods) = encoding;
+ }
+
+ cls_methods = TREE_CHAIN (cls_methods);
+ }
+
+ UOBJC_CLASS_METHODS_decl =
+ generate_v1_meth_descriptor_table (PROTOCOL_CLS_METHODS (p), p,
+ "_OBJC_ProtocolClassMethods",
+ meta_proto_cls_meth);
+
+ /* There should be no optional methods for ABI-0 - but we need to
+ check all this here before the lists are made. */
+ nst_methods = PROTOCOL_OPTIONAL_NST_METHODS (p);
+ while (nst_methods)
+ {
+ if (! METHOD_ENCODING (nst_methods))
+ {
+ encoding = encode_method_prototype (nst_methods);
+ METHOD_ENCODING (nst_methods) = encoding;
+ }
+ nst_methods = TREE_CHAIN (nst_methods);
+ }
+
+ V1_Protocol_OPT_NST_METHODS_decl =
+ generate_v1_meth_descriptor_table (PROTOCOL_OPTIONAL_NST_METHODS (p), p,
+ "_OBJC_OptionalProtocolInstanceMethods",
+ meta_proto_nst_meth);
+
+ cls_methods = PROTOCOL_OPTIONAL_CLS_METHODS (p);
+ while (cls_methods)
+ {
+ if (! METHOD_ENCODING (cls_methods))
+ {
+ encoding = encode_method_prototype (cls_methods);
+ METHOD_ENCODING (cls_methods) = encoding;
+ }
+
+ cls_methods = TREE_CHAIN (cls_methods);
+ }
+
+ V1_Protocol_OPT_CLS_METHODS_decl =
+ generate_v1_meth_descriptor_table (PROTOCOL_OPTIONAL_CLS_METHODS (p), p,
+ "_OBJC_OptionalProtocolClassMethods",
+ meta_proto_cls_meth);
+
+ if (PROTOCOL_LIST (p))
+ refs_decl = generate_v1_protocol_list (p, objc_implementation_context);
+ else
+ refs_decl = 0;
+
+ /* static struct objc_protocol _OBJC_PROTOCOL_<mumble>; */
+ protocol_name_expr = add_objc_string (PROTOCOL_NAME (p), class_names);
+ /* TODO: more locations to be fixed up... */
+ loc = UNKNOWN_LOCATION;
+ refs_type =
+ build_pointer_type (build_pointer_type (objc_protocol_template));
+ if (refs_decl)
+ refs_expr = convert (refs_type,
+ build_unary_op (loc, ADDR_EXPR, refs_decl, 0));
+ else
+ refs_expr = convert (refs_type, null_pointer_node);
+
+ if (flag_objc_abi < 1)
+ {
+ /* Original ABI. */
+ initlist =
+ build_protocol_initializer (TREE_TYPE (decl),
+ protocol_name_expr, refs_expr,
+ UOBJC_INSTANCE_METHODS_decl,
+ UOBJC_CLASS_METHODS_decl);
+ finish_var_decl (decl, initlist);
+ continue;
+ }
+
+ /* else - V1 extensions. */
+
+ V1_Property_decl =
+ generate_v1_property_table (p, NULL_TREE);
+
+ V1_ProtocolExt_decl =
+ generate_v1_objc_protocol_extension (p,
+ V1_Protocol_OPT_NST_METHODS_decl,
+ V1_Protocol_OPT_CLS_METHODS_decl,
+ V1_Property_decl);
+
+ initlist = build_v1_protocol_initializer (TREE_TYPE (decl),
+ protocol_name_expr, refs_expr,
+ UOBJC_INSTANCE_METHODS_decl,
+ UOBJC_CLASS_METHODS_decl,
+ V1_ProtocolExt_decl);
+ finish_var_decl (decl, initlist);
+ }
+}
+
+static tree
+generate_dispatch_table (tree chain, const char *name, tree attr)
+{
+ tree decl, method_list_template, initlist;
+ VEC(constructor_elt,gc) *v = NULL;
+ int size;;
+
+ if (!chain || !name || !(size = list_length (chain)))
+ return NULL_TREE;
+
+ if (!objc_method_template)
+ objc_method_template = build_method_template ();
+
+ method_list_template = build_method_list_template (objc_method_template,
+ size);
+ initlist = build_dispatch_table_initializer (objc_method_template, chain);
+
+ decl = start_var_decl (method_list_template, name);
+
+ CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, integer_zero_node);
+ CONSTRUCTOR_APPEND_ELT (v, NULL_TREE,
+ build_int_cst (integer_type_node, size));
+ CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, initlist);
+
+ OBJCMETA (decl, objc_meta, attr);
+ finish_var_decl (decl,
+ objc_build_constructor (TREE_TYPE (decl), v));
+
+ return decl;
+}
+
+/* Init a category. */
+static tree
+build_v1_category_initializer (tree type, tree cat_name, tree class_name,
+ tree inst_methods, tree class_methods,
+ tree protocol_list, tree property_list,
+ location_t loc)
+{
+ tree expr, ltyp;
+ VEC(constructor_elt,gc) *v = NULL;
+
+ CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, cat_name);
+ CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, class_name);
+
+ ltyp = objc_method_list_ptr;
+ if (inst_methods)
+ expr = convert (ltyp, build_unary_op (loc, ADDR_EXPR, inst_methods, 0));
+ else
+ expr = convert (ltyp, null_pointer_node);
+ CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, expr);
+
+ if (class_methods)
+ expr = convert (ltyp, build_unary_op (loc, ADDR_EXPR, class_methods, 0));
+ else
+ expr = convert (ltyp, null_pointer_node);
+ CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, expr);
+
+ /* protocol_list = */
+ ltyp = build_pointer_type (build_pointer_type (objc_protocol_template));
+ if (protocol_list)
+ expr = convert (ltyp, build_unary_op (loc, ADDR_EXPR, protocol_list, 0));
+ else
+ expr = convert (ltyp, null_pointer_node);
+ CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, expr);
+
+ if (flag_objc_abi >= 1)
+ {
+ int val = TREE_INT_CST_LOW (TYPE_SIZE_UNIT (objc_category_template));
+ expr = build_int_cst (NULL_TREE, val);
+ CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, expr);
+ ltyp = objc_prop_list_ptr;
+ if (property_list)
+ expr = convert (ltyp, build_unary_op (loc, ADDR_EXPR, property_list, 0));
+ else
+ expr = convert (ltyp, null_pointer_node);
+ CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, expr);
+ }
+
+ return objc_build_constructor (type, v);
+}
+
+/* static struct objc_category _OBJC_CATEGORY_<name> = { ... }; */
+/* TODO: get rid of passing stuff around in globals. */
+static void
+generate_v1_category (struct imp_entry *impent)
+{
+ tree initlist, cat_name_expr, class_name_expr;
+ tree protocol_decl, category, cat_decl;
+ tree inst_methods = NULL_TREE, class_methods = NULL_TREE;
+ tree cat = impent->imp_context;
+ location_t loc;
+ char buf[BUFSIZE];
+
+ cat_decl = impent->class_decl;
+ loc = DECL_SOURCE_LOCATION (cat_decl);
+
+ add_class_reference (CLASS_NAME (cat));
+ cat_name_expr = add_objc_string (CLASS_SUPER_NAME (cat), class_names);
+ class_name_expr = add_objc_string (CLASS_NAME (cat), class_names);
+
+ category = lookup_category (impent->imp_template, CLASS_SUPER_NAME (cat));
+
+ if (category && CLASS_PROTOCOL_LIST (category))
+ {
+ generate_protocol_references (CLASS_PROTOCOL_LIST (category));
+ protocol_decl = generate_v1_protocol_list (category, cat);
+ }
+ else
+ protocol_decl = 0;
+
+ if (flag_objc_abi >= 1)
+ V1_Property_decl = generate_v1_property_table (NULL_TREE, cat);
+ else
+ V1_Property_decl = NULL_TREE;
+
+ if (CLASS_NST_METHODS (cat))
+ {
+ snprintf (buf, BUFSIZE, "_OBJC_CategoryInstanceMethods_%s_%s",
+ IDENTIFIER_POINTER (CLASS_NAME (cat)),
+ IDENTIFIER_POINTER (CLASS_SUPER_NAME (cat)));
+ inst_methods = generate_dispatch_table (CLASS_NST_METHODS (cat), buf,
+ meta_cati_meth);
+ }
+
+ if (CLASS_CLS_METHODS (cat))
+ {
+ snprintf (buf, BUFSIZE, "_OBJC_CategoryClassMethods_%s_%s",
+ IDENTIFIER_POINTER (CLASS_NAME (cat)),
+ IDENTIFIER_POINTER (CLASS_SUPER_NAME (cat)));
+ class_methods = generate_dispatch_table (CLASS_CLS_METHODS (cat), buf,
+ meta_catc_meth);
+ }
+
+ initlist = build_v1_category_initializer (TREE_TYPE (cat_decl),
+ cat_name_expr, class_name_expr,
+ inst_methods, class_methods,
+ protocol_decl, V1_Property_decl,
+ loc);
+
+ finish_var_decl (cat_decl, initlist);
+ impent->class_decl = cat_decl;
+}
+
+/* This routine builds the class extension used by v1 NeXT. */
+
+static tree
+generate_objc_class_ext (tree property_list, tree context)
+{
+ tree decl, expr, ltyp;
+ tree weak_ivar_layout_tree;
+ int size;
+ location_t loc;
+ VEC(constructor_elt,gc) *v = NULL;
+ char buf[BUFSIZE];
+
+ /* TODO: pass the loc in or find it from args. */
+ loc = UNKNOWN_LOCATION;
+
+ /* const char *weak_ivar_layout
+ TODO: Figure the ivar layouts out... */
+ weak_ivar_layout_tree = NULL_TREE;
+
+ if (!property_list && !weak_ivar_layout_tree)
+ return NULL_TREE;
+
+ if (!objc_class_ext_template)
+ build_objc_class_ext_template ();
+
+ /* uint32_t size */
+ size = TREE_INT_CST_LOW (TYPE_SIZE_UNIT (objc_class_ext_template));
+ CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, build_int_cst (NULL_TREE, size));
+
+ ltyp = const_string_type_node;
+ if (weak_ivar_layout_tree)
+ expr = convert (ltyp, weak_ivar_layout_tree);
+ else
+ expr = convert (ltyp, null_pointer_node);
+ CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, expr);
+
+ /* struct _prop_list_t *properties; */
+ ltyp = objc_prop_list_ptr;
+ if (property_list)
+ expr = convert (ltyp, build_unary_op (loc, ADDR_EXPR, property_list, 0));
+ else
+ expr = convert (ltyp, null_pointer_node);
+ CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, expr);
+
+ snprintf (buf, BUFSIZE, "_OBJC_ClassExt_%s",
+ IDENTIFIER_POINTER (CLASS_NAME (context)));
+ decl = start_var_decl (objc_class_ext_template, buf);
+ expr = objc_build_constructor (TREE_TYPE (decl), v);
+ OBJCMETA (decl, objc_meta, meta_class_extension);
+ finish_var_decl (decl, expr);
+ return decl;
+}
+
+/* struct _objc_class {
+ struct objc_class *isa;
+ struct objc_class *super_class;
+ char *name;
+ long version;
+ long info;
+ long instance_size;
+ struct objc_ivar_list *ivars;
+ struct objc_method_list *methods;
+ struct objc_cache *cache;
+ struct objc_protocol_list *protocols;
+ #if ABI >= 1
+ const char *ivar_layout;
+ struct _objc_class_ext *ext;
+ #else
+ void *sel_id;
+ void *gc_object_type;
+ #endif
+ }; */
+
+static tree
+build_v1_shared_structure_initializer (tree type, tree isa, tree super,
+ tree name, tree size, int status,
+ tree dispatch_table, tree ivar_list,
+ tree protocol_list, tree class_ext)
+{
+ tree expr, ltyp;
+ location_t loc;
+ VEC(constructor_elt,gc) *v = NULL;
+
+ /* TODO: fish the location out of the input data. */
+ loc = UNKNOWN_LOCATION;
+
+ /* isa = */
+ CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, isa);
+
+ /* super_class = */
+ CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, super);
+
+ /* name = */
+ CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, default_conversion (name));
+
+ /* version = */
+ CONSTRUCTOR_APPEND_ELT (v, NULL_TREE,
+ build_int_cst (long_integer_type_node, 0));
+
+ /* info = */
+ CONSTRUCTOR_APPEND_ELT (v, NULL_TREE,
+ build_int_cst (long_integer_type_node, status));
+
+ /* instance_size = */
+ CONSTRUCTOR_APPEND_ELT (v, NULL_TREE,
+ convert (long_integer_type_node, size));
+
+ /* objc_ivar_list = */
+ ltyp = objc_ivar_list_ptr;
+ if (ivar_list)
+ expr = convert (ltyp, build_unary_op (loc, ADDR_EXPR, ivar_list, 0));
+ else
+ expr = convert (ltyp, null_pointer_node);
+ CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, expr);
+
+ /* objc_method_list = */
+ ltyp = objc_method_list_ptr;
+ if (dispatch_table)
+ expr = convert (ltyp, build_unary_op (loc, ADDR_EXPR, dispatch_table, 0));
+ else
+ expr = convert (ltyp, null_pointer_node);
+ CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, expr);
+
+ ltyp = build_pointer_type (xref_tag (RECORD_TYPE,
+ get_identifier ("objc_cache")));
+ /* method_cache = */
+ CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, convert (ltyp, null_pointer_node));
+
+ /* protocol_list = */
+ ltyp = build_pointer_type (build_pointer_type (objc_protocol_template));
+ if (protocol_list)
+ expr = convert (ltyp, build_unary_op (loc, ADDR_EXPR, protocol_list, 0));
+ else
+ expr = convert (ltyp, null_pointer_node);
+ CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, expr);
+
+ if (flag_objc_abi >= 1)
+ {
+ /* TODO: figure out the ivar_layout stuff. */
+ expr = convert (const_string_type_node, null_pointer_node);
+ CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, expr);
+ if (!objc_class_ext_template)
+ build_objc_class_ext_template ();
+ ltyp = build_pointer_type (objc_class_ext_template);
+ if (class_ext)
+ expr = convert (ltyp, build_unary_op (loc, ADDR_EXPR, class_ext, 0));
+ else
+ expr = convert (ltyp, null_pointer_node);
+ CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, expr);
+ }
+ else
+ {
+ /* sel_id = NULL */
+ CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, null_pointer_node);
+
+ /* gc_object_type = NULL */
+ CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, null_pointer_node);
+ }
+ return objc_build_constructor (type, v);
+}
+
+static tree
+generate_ivars_list (tree chain, const char *name, tree attr)
+{
+ tree initlist, ivar_list_template, decl;
+ int size;
+ VEC(constructor_elt,gc) *inits = NULL;
+
+ if (!chain)
+ return NULL_TREE;
+
+ if (!objc_ivar_template)
+ objc_ivar_template = build_ivar_template ();
+
+ size = ivar_list_length (chain);
+
+ generating_instance_variables = 1;
+ ivar_list_template = build_ivar_list_template (objc_ivar_template, size);
+ initlist = build_ivar_list_initializer (objc_ivar_template, chain);
+ generating_instance_variables = 0;
+
+ decl = start_var_decl (ivar_list_template, name);
+
+ CONSTRUCTOR_APPEND_ELT (inits, NULL_TREE, build_int_cst (NULL_TREE, size));
+ CONSTRUCTOR_APPEND_ELT (inits, NULL_TREE, initlist);
+
+ OBJCMETA (decl, objc_meta, attr);
+ finish_var_decl (decl,
+ objc_build_constructor (TREE_TYPE (decl), inits));
+
+ return decl;
+}
+
+/* static struct objc_class _OBJC_METACLASS_Foo={ ... };
+ static struct objc_class _OBJC_CLASS_Foo={ ... }; */
+
+static void
+generate_v1_class_structs (struct imp_entry *impent)
+{
+ tree name_expr, super_expr, root_expr, class_decl, meta_decl;
+ tree my_root_id, my_super_id;
+ tree cast_type, initlist, protocol_decl;
+ tree class_ext_decl = NULL_TREE, props = NULL_TREE;
+ tree inst_methods = NULL_TREE, class_methods = NULL_TREE;
+ tree chain, inst_ivars = NULL_TREE, class_ivars = NULL_TREE;
+ int cls_flags;
+ location_t loc;
+ char buf[BUFSIZE];
+
+/* objc_implementation_context = impent->imp_context;
+ implementation_template = impent->imp_template;*/
+ class_decl = impent->class_decl;
+ meta_decl = impent->meta_decl;
+ cls_flags = impent->has_cxx_cdtors ? CLS_HAS_CXX_STRUCTORS : 0 ;
+
+ loc = DECL_SOURCE_LOCATION (impent->class_decl);
+
+ if (flag_objc_abi >= 1)
+ {
+ /* ABI=1 additions. */
+ props = generate_v1_property_table (NULL_TREE, impent->imp_context);
+ class_ext_decl = generate_objc_class_ext (props, impent->imp_context);
+ }
+
+ my_super_id = CLASS_SUPER_NAME (impent->imp_template);
+ if (my_super_id)
+ {
+ add_class_reference (my_super_id);
+
+ /* Compute "my_root_id" - this is required for code generation.
+ the "isa" for all meta class structures points to the root of
+ the inheritance hierarchy (e.g. "__Object")... */
+ my_root_id = my_super_id;
+ do
+ {
+ tree my_root_int = lookup_interface (my_root_id);
+
+ if (my_root_int && CLASS_SUPER_NAME (my_root_int))
+ my_root_id = CLASS_SUPER_NAME (my_root_int);
+ else
+ break;
+ }
+ while (1);
+ super_expr = add_objc_string (my_super_id, class_names);
+ }
+ else
+ {
+ /* No super class. */
+ my_root_id = CLASS_NAME (impent->imp_template);
+ super_expr = null_pointer_node;
+ }
+
+ /* Install class `isa' and `super' pointers at runtime. */
+ cast_type = build_pointer_type (objc_class_template);
+ super_expr = build_c_cast (loc, cast_type, super_expr);
+
+ root_expr = add_objc_string (my_root_id, class_names);
+ root_expr = build_c_cast (loc, cast_type, root_expr);
+
+ if (CLASS_PROTOCOL_LIST (impent->imp_template))
+ {
+ generate_protocol_references (CLASS_PROTOCOL_LIST (impent->imp_template));
+ protocol_decl = generate_v1_protocol_list (impent->imp_template,
+ impent->imp_context);
+ }
+ else
+ protocol_decl = NULL_TREE;
+
+ if (CLASS_CLS_METHODS (impent->imp_context))
+ {
+ snprintf (buf, BUFSIZE, "_OBJC_ClassMethods_%s",
+ IDENTIFIER_POINTER (CLASS_NAME (impent->imp_context)));
+ class_methods = generate_dispatch_table (CLASS_CLS_METHODS (impent->imp_context),
+ buf, meta_clac_meth);
+ }
+
+ if (CLASS_SUPER_NAME (impent->imp_template) == NULL_TREE
+ && (chain = TYPE_FIELDS (objc_class_template)))
+ {
+ snprintf (buf, BUFSIZE, "_OBJC_ClassIvars_%s",
+ IDENTIFIER_POINTER (CLASS_NAME (impent->imp_context)));
+ class_ivars = generate_ivars_list (chain, buf, meta_clac_vars);
+ }
+ /* TODO: get rid of hidden passing of stuff in globals. */
+ /* UOBJC_INSTANCE/CLASS_Variables_decl made in generate_ivarlists(). */
+
+ name_expr = add_objc_string (CLASS_NAME (impent->imp_template), class_names);
+
+ /* static struct objc_class _OBJC_METACLASS_Foo = { ... }; */
+
+ initlist = build_v1_shared_structure_initializer
+ (TREE_TYPE (meta_decl),
+ root_expr, super_expr, name_expr,
+ convert (integer_type_node, TYPE_SIZE_UNIT (objc_class_template)),
+ CLS_META, class_methods, class_ivars,
+ protocol_decl, NULL_TREE);
+
+ finish_var_decl (meta_decl, initlist);
+ impent->meta_decl = meta_decl;
+
+ /* static struct objc_class _OBJC_CLASS_Foo={ ... }; */
+ if (CLASS_NST_METHODS (impent->imp_context))
+ {
+ snprintf (buf, BUFSIZE, "_OBJC_InstanceMethods_%s",
+ IDENTIFIER_POINTER (CLASS_NAME (impent->imp_context)));
+ inst_methods = generate_dispatch_table (CLASS_NST_METHODS (impent->imp_context),
+ buf, meta_clai_meth);
+ }
+
+ if ((chain = CLASS_IVARS (impent->imp_template)))
+ {
+ snprintf (buf, BUFSIZE, "_OBJC_InstanceIvars_%s",
+ IDENTIFIER_POINTER (CLASS_NAME (impent->imp_context)));
+ inst_ivars = generate_ivars_list (chain, buf, meta_clai_vars);
+ }
+
+ initlist = build_v1_shared_structure_initializer
+ (TREE_TYPE (class_decl),
+ build_unary_op (loc, ADDR_EXPR, meta_decl, 0),
+ super_expr, name_expr,
+ convert (integer_type_node,
+ TYPE_SIZE_UNIT (CLASS_STATIC_TEMPLATE (impent->imp_template))),
+ CLS_FACTORY | cls_flags, inst_methods, inst_ivars,
+ protocol_decl, class_ext_decl);
+
+ finish_var_decl (class_decl, initlist);
+ impent->class_decl = class_decl;
+}
+
+/* --- Output NeXT V1 Metadata --- */
+
+/* Create the initial value for the `defs' field of _objc_symtab.
+ This is a CONSTRUCTOR. */
+
+static tree
+init_def_list (tree type)
+{
+ tree expr;
+ location_t loc;
+ struct imp_entry *impent;
+ VEC(constructor_elt,gc) *v = NULL;
+
+ if (imp_count)
+ for (impent = imp_list; impent; impent = impent->next)
+ {
+ if (TREE_CODE (impent->imp_context) == CLASS_IMPLEMENTATION_TYPE)
+ {
+ loc = DECL_SOURCE_LOCATION (impent->class_decl);
+ expr = build_unary_op (loc,
+ ADDR_EXPR, impent->class_decl, 0);
+ CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, expr);
+ }
+ }
+
+ if (cat_count)
+ for (impent = imp_list; impent; impent = impent->next)
+ {
+ if (TREE_CODE (impent->imp_context) == CATEGORY_IMPLEMENTATION_TYPE)
+ {
+ loc = DECL_SOURCE_LOCATION (impent->class_decl);
+ expr = build_unary_op (loc,
+ ADDR_EXPR, impent->class_decl, 0);
+ CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, expr);
+ }
+ }
+
+ return objc_build_constructor (type, v);
+}
+
+/* Take care of defining and initializing _OBJC_SYMBOLS. */
+
+/* Predefine the following data type:
+
+ struct _objc_symtab
+ {
+ long sel_ref_cnt;
+ SEL *refs;
+ short cls_def_cnt;
+ short cat_def_cnt;
+ void *defs[cls_def_cnt + cat_def_cnt];
+ }; */
+
+static void
+build_objc_symtab_template (void)
+{
+ tree fields, *chain = NULL;
+
+ objc_symtab_template = objc_start_struct (get_identifier (UTAG_SYMTAB));
+
+ /* long sel_ref_cnt; */
+ fields = add_field_decl (long_integer_type_node, "sel_ref_cnt", &chain);
+
+ /* SEL *refs; */
+ add_field_decl (build_pointer_type (objc_selector_type), "refs", &chain);
+
+ /* short cls_def_cnt; */
+ add_field_decl (short_integer_type_node, "cls_def_cnt", &chain);
+
+ /* short cat_def_cnt; */
+ add_field_decl (short_integer_type_node, "cat_def_cnt", &chain);
+
+ if (imp_count || cat_count)
+ {
+ /* void *defs[imp_count + cat_count (+ 1)]; */
+ /* NB: The index is one less than the size of the array. */
+ int index = imp_count + cat_count;
+ tree array_type = build_sized_array_type (ptr_type_node, index);
+ add_field_decl (array_type, "defs", &chain);
+ }
+
+ objc_finish_struct (objc_symtab_template, fields);
+}
+/* Construct the initial value for all of _objc_symtab. */
+
+static tree
+init_objc_symtab (tree type)
+{
+ VEC(constructor_elt,gc) *v = NULL;
+
+ /* sel_ref_cnt = { ..., 5, ... } */
+
+ CONSTRUCTOR_APPEND_ELT (v, NULL_TREE,
+ build_int_cst (long_integer_type_node, 0));
+
+ /* refs = { ..., _OBJC_SELECTOR_TABLE, ... } */
+
+ CONSTRUCTOR_APPEND_ELT (v, NULL_TREE,
+ convert (build_pointer_type (objc_selector_type),
+ integer_zero_node));
+
+ /* cls_def_cnt = { ..., 5, ... } */
+
+ CONSTRUCTOR_APPEND_ELT (v, NULL_TREE,
+ build_int_cst (short_integer_type_node, imp_count));
+
+ /* cat_def_cnt = { ..., 5, ... } */
+
+ CONSTRUCTOR_APPEND_ELT (v, NULL_TREE,
+ build_int_cst (short_integer_type_node, cat_count));
+
+ /* cls_def = { ..., { &Foo, &Bar, ...}, ... } */
+
+ if (imp_count || cat_count)
+ {
+ tree field = TYPE_FIELDS (type);
+ field = DECL_CHAIN (DECL_CHAIN (DECL_CHAIN (DECL_CHAIN (field))));
+
+ CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, init_def_list (TREE_TYPE (field)));
+ }
+
+ return objc_build_constructor (type, v);
+}
+
+/* Create the declaration of _OBJC_SYMBOLS, with type `struct _objc_symtab'
+ and initialized appropriately. */
+
+static void
+generate_objc_symtab_decl (void)
+{
+ build_objc_symtab_template ();
+ UOBJC_SYMBOLS_decl = start_var_decl (objc_symtab_template, "_OBJC_Symbols");
+ /* Allow the runtime to mark meta-data such that it can be assigned to target
+ specific sections by the back-end. */
+ OBJCMETA (UOBJC_SYMBOLS_decl, objc_meta, meta_symtab);
+ finish_var_decl (UOBJC_SYMBOLS_decl,
+ init_objc_symtab (TREE_TYPE (UOBJC_SYMBOLS_decl)));
+}
+
+
+static void
+handle_next_class_ref (tree chain)
+{
+ const char *name = IDENTIFIER_POINTER (TREE_VALUE (chain));
+ char *string = (char *) alloca (strlen (name) + 30);
+
+ sprintf (string, ".objc_class_name_%s", name);
+
+#ifdef ASM_DECLARE_UNRESOLVED_REFERENCE
+ ASM_DECLARE_UNRESOLVED_REFERENCE (asm_out_file, string);
+#else
+ return ; /* NULL build for targets other than Darwin. */
+#endif
+}
+
+static void
+handle_next_impent (struct imp_entry *impent)
+{
+ char buf[BUFSIZE];
+
+ switch (TREE_CODE (impent->imp_context))
+ {
+ case CLASS_IMPLEMENTATION_TYPE:
+ snprintf (buf, BUFSIZE, ".objc_class_name_%s",
+ IDENTIFIER_POINTER (CLASS_NAME (impent->imp_context)));
+ break;
+ case CATEGORY_IMPLEMENTATION_TYPE:
+ snprintf (buf, BUFSIZE, "*.objc_category_name_%s_%s",
+ IDENTIFIER_POINTER (CLASS_NAME (impent->imp_context)),
+ IDENTIFIER_POINTER (CLASS_SUPER_NAME (impent->imp_context)));
+ break;
+ default:
+ return;
+ }
+
+#ifdef ASM_DECLARE_CLASS_REFERENCE
+ ASM_DECLARE_CLASS_REFERENCE (asm_out_file, buf);
+#else
+ return ; /* NULL build for targets other than Darwin. */
+#endif
+}
+
+static void
+generate_classref_translation_entry (tree chain)
+{
+ tree expr, decl, type;
+
+ decl = TREE_PURPOSE (chain);
+ type = TREE_TYPE (decl);
+
+ expr = add_objc_string (TREE_VALUE (chain), class_names);
+ expr = convert (type, expr); /* cast! */
+
+ /* This is a class reference. It is re-written by the runtime,
+ but will be optimized away unless we force it. */
+ DECL_PRESERVE_P (decl) = 1;
+ OBJCMETA (decl, objc_meta, meta_class_reference);
+ finish_var_decl (decl, expr);
+ return;
+}
+
+
+/* The Fix-and-Continue functionality available in Mac OS X 10.3 and
+ later requires that ObjC translation units participating in F&C be
+ specially marked. The following routine accomplishes this. */
+
+/* static int _OBJC_IMAGE_INFO[2] = { 0, 1 }; */
+
+static void
+generate_objc_image_info (void)
+{
+ tree decl;
+ int flags
+ = ((flag_replace_objc_classes && imp_count ? 1 : 0)
+ | (flag_objc_gc ? 2 : 0));
+ VEC(constructor_elt,gc) *v = NULL;
+ tree array_type;
+
+ array_type = build_sized_array_type (integer_type_node, 2);
+
+ decl = start_var_decl (array_type, "_OBJC_ImageInfo");
+
+ CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, integer_zero_node);
+ CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, build_int_cst (integer_type_node, flags));
+ /* The runtime wants this and refers to it in a manner hidden from the compiler.
+ So we must force the output. */
+ DECL_PRESERVE_P (decl) = 1;
+ OBJCMETA (decl, objc_meta, meta_info);
+ finish_var_decl (decl, objc_build_constructor (TREE_TYPE (decl), v));
+}
+
+static void
+objc_generate_v1_next_metadata (void)
+{
+ struct imp_entry *impent;
+ tree chain, attr;
+ long vers;
+
+ /* FIXME: Make sure that we generate no metadata if there is nothing
+ to put into it. */
+
+ if (objc_static_instances)
+ gcc_unreachable (); /* Not for NeXT */
+
+ build_metadata_templates ();
+ objc_implementation_context =
+ implementation_template =
+ UOBJC_CLASS_decl =
+ UOBJC_METACLASS_decl = NULL_TREE;
+
+ for (impent = imp_list; impent; impent = impent->next)
+ {
+
+ /* If -gen-decls is present, Dump the @interface of each class.
+ TODO: Dump the classes in the order they were found, rather than in
+ reverse order as we are doing now. */
+ if (flag_gen_declaration)
+ dump_interface (gen_declaration_file, impent->imp_context);
+
+ /* all of the following reference the string pool... */
+ if (TREE_CODE (impent->imp_context) == CLASS_IMPLEMENTATION_TYPE)
+ generate_v1_class_structs (impent);
+ else
+ generate_v1_category (impent);
+ }
+
+ /* If we are using an array of selectors, we must always
+ finish up the array decl even if no selectors were used. */
+ build_next_selector_translation_table ();
+
+ if (protocol_chain)
+ generate_v1_protocols ();
+
+ /* Pass summary information to the runtime. */
+ if (imp_count || cat_count)
+ generate_objc_symtab_decl ();
+
+ vers = OBJC_VERSION;
+ attr = build_tree_list (objc_meta, meta_modules);
+ build_module_descriptor (vers, attr);
+
+ /* This conveys information on GC usage and zero-link. */
+ generate_objc_image_info ();
+
+ /* Dump the class references. This forces the appropriate classes
+ to be linked into the executable image, preserving unix archive
+ semantics. This can be removed when we move to a more dynamically
+ linked environment. */
+
+ for (chain = cls_ref_chain; chain; chain = TREE_CHAIN (chain))
+ {
+ handle_next_class_ref (chain);
+ if (TREE_PURPOSE (chain))
+ generate_classref_translation_entry (chain);
+ }
+
+ for (impent = imp_list; impent; impent = impent->next)
+ handle_next_impent (impent);
+
+ /* Emit the strings tables. */
+ generate_strings ();
+}
+
+/* --- exceptions stuff --- */
+
+/* Predefine the following data type:
+
+ struct _objc_exception_data
+ {
+ int buf[OBJC_JBLEN];
+ void *pointers[4];
+ }; */
+
+/* The following yuckiness should prevent users from having to #include
+ <setjmp.h> in their code... */
+
+/* Define to a harmless positive value so the below code doesn't die. */
+#ifndef OBJC_JBLEN
+#define OBJC_JBLEN 18
+#endif
+
+static void
+build_next_objc_exception_stuff (void)
+{
+ tree decls, temp_type, *chain = NULL;
+
+ objc_exception_data_template
+ = objc_start_struct (get_identifier (UTAG_EXCDATA));
+
+ /* int buf[OBJC_JBLEN]; */
+
+ temp_type = build_sized_array_type (integer_type_node, OBJC_JBLEN);
+ decls = add_field_decl (temp_type, "buf", &chain);
+
+ /* void *pointers[4]; */
+
+ temp_type = build_sized_array_type (ptr_type_node, 4);
+ add_field_decl (temp_type, "pointers", &chain);
+
+ objc_finish_struct (objc_exception_data_template, decls);
+
+ /* int _setjmp(...); */
+ /* If the user includes <setjmp.h>, this shall be superseded by
+ 'int _setjmp(jmp_buf);' */
+ temp_type = build_varargs_function_type_list (integer_type_node, NULL_TREE);
+ objc_setjmp_decl
+ = add_builtin_function (TAG_SETJMP, temp_type, 0, NOT_BUILT_IN, NULL, NULL_TREE);
+
+ /* id objc_exception_extract(struct _objc_exception_data *); */
+ temp_type
+ = build_function_type_list (objc_object_type,
+ build_pointer_type (objc_exception_data_template),
+ NULL_TREE);
+ objc_exception_extract_decl
+ = add_builtin_function (TAG_EXCEPTIONEXTRACT, temp_type, 0, NOT_BUILT_IN, NULL,
+ NULL_TREE);
+ /* void objc_exception_try_enter(struct _objc_exception_data *); */
+ /* void objc_exception_try_exit(struct _objc_exception_data *); */
+ temp_type
+ = build_function_type_list (void_type_node,
+ build_pointer_type (objc_exception_data_template),
+ NULL_TREE);
+ objc_exception_try_enter_decl
+ = add_builtin_function (TAG_EXCEPTIONTRYENTER, temp_type, 0, NOT_BUILT_IN, NULL,
+ NULL_TREE);
+ objc_exception_try_exit_decl
+ = add_builtin_function (TAG_EXCEPTIONTRYEXIT, temp_type, 0, NOT_BUILT_IN, NULL,
+ NULL_TREE);
+
+ /* int objc_exception_match(id, id); */
+ temp_type
+ = build_function_type_list (integer_type_node,
+ objc_object_type, objc_object_type, NULL_TREE);
+ objc_exception_match_decl
+ = add_builtin_function (TAG_EXCEPTIONMATCH, temp_type, 0, NOT_BUILT_IN, NULL,
+ NULL_TREE);
+
+ /* id objc_assign_ivar (id, id, unsigned int); */
+ /* id objc_assign_ivar_Fast (id, id, unsigned int)
+ __attribute__ ((hard_coded_address (OFFS_ASSIGNIVAR_FAST))); */
+ temp_type
+ = build_function_type_list (objc_object_type,
+ objc_object_type,
+ objc_object_type,
+ unsigned_type_node,
+ NULL_TREE);
+ objc_assign_ivar_decl
+ = add_builtin_function (TAG_ASSIGNIVAR, temp_type, 0, NOT_BUILT_IN,
+ NULL, NULL_TREE);
+#ifdef OFFS_ASSIGNIVAR_FAST
+ objc_assign_ivar_fast_decl
+ = add_builtin_function (TAG_ASSIGNIVAR_FAST, temp_type, 0,
+ NOT_BUILT_IN, NULL, NULL_TREE);
+ DECL_ATTRIBUTES (objc_assign_ivar_fast_decl)
+ = tree_cons (get_identifier ("hard_coded_address"),
+ build_int_cst (NULL_TREE, OFFS_ASSIGNIVAR_FAST),
+ NULL_TREE);
+#else
+ /* Default to slower ivar method. */
+ objc_assign_ivar_fast_decl = objc_assign_ivar_decl;
+#endif
+
+ /* id objc_assign_global (id, id *); */
+ /* id objc_assign_strongCast (id, id *); */
+ temp_type = build_function_type_list (objc_object_type,
+ objc_object_type,
+ build_pointer_type (objc_object_type),
+ NULL_TREE);
+ objc_assign_global_decl
+ = add_builtin_function (TAG_ASSIGNGLOBAL, temp_type, 0, NOT_BUILT_IN, NULL,
+ NULL_TREE);
+ objc_assign_strong_cast_decl
+ = add_builtin_function (TAG_ASSIGNSTRONGCAST, temp_type, 0, NOT_BUILT_IN, NULL,
+ NULL_TREE);
+}
+
+/* --- NeXT V1 SJLJ Exceptions --- */
+
+/* Build "objc_exception_try_exit(&_stack)". */
+
+static tree
+next_sjlj_build_try_exit (struct objc_try_context **ctcp)
+{
+ tree t;
+ t = build_fold_addr_expr_loc (input_location, (*ctcp)->stack_decl);
+ t = tree_cons (NULL, t, NULL);
+ t = build_function_call (input_location,
+ objc_exception_try_exit_decl, t);
+ return t;
+}
+
+/* Build
+ objc_exception_try_enter (&_stack);
+ if (_setjmp(&_stack.buf))
+ ;
+ else
+ ;
+ Return the COND_EXPR. Note that the THEN and ELSE fields are left
+ empty, ready for the caller to fill them in. */
+
+static tree
+next_sjlj_build_enter_and_setjmp (struct objc_try_context **ctcp)
+{
+ tree t, enter, sj, cond;
+
+ t = build_fold_addr_expr_loc (input_location, (*ctcp)->stack_decl);
+ t = tree_cons (NULL, t, NULL);
+ enter = build_function_call (input_location,
+ objc_exception_try_enter_decl, t);
+
+ t = objc_build_component_ref ((*ctcp)->stack_decl,
+ get_identifier ("buf"));
+ t = build_fold_addr_expr_loc (input_location, t);
+#ifdef OBJCPLUS
+ /* Convert _setjmp argument to type that is expected. */
+ if (prototype_p (TREE_TYPE (objc_setjmp_decl)))
+ t = convert (TREE_VALUE (TYPE_ARG_TYPES (TREE_TYPE (objc_setjmp_decl))), t);
+ else
+ t = convert (ptr_type_node, t);
+#else
+ t = convert (ptr_type_node, t);
+#endif
+ t = tree_cons (NULL, t, NULL);
+ sj = build_function_call (input_location,
+ objc_setjmp_decl, t);
+
+ cond = build2 (COMPOUND_EXPR, TREE_TYPE (sj), enter, sj);
+ cond = c_common_truthvalue_conversion (input_location, cond);
+
+ return build3 (COND_EXPR, void_type_node, cond, NULL, NULL);
+}
+
+/* Build:
+
+ DECL = objc_exception_extract(&_stack); */
+
+static tree
+next_sjlj_build_exc_extract (struct objc_try_context **ctcp, tree decl)
+{
+ tree t;
+
+ t = build_fold_addr_expr_loc (input_location, (*ctcp)->stack_decl);
+ t = tree_cons (NULL, t, NULL);
+ t = build_function_call (input_location,
+ objc_exception_extract_decl, t);
+ t = convert (TREE_TYPE (decl), t);
+ t = build2 (MODIFY_EXPR, void_type_node, decl, t);
+
+ return t;
+}
+
+/* Build
+ if (objc_exception_match(obj_get_class(TYPE), _caught)
+ BODY
+ else if (...)
+ ...
+ else
+ {
+ _rethrow = _caught;
+ objc_exception_try_exit(&_stack);
+ }
+ from the sequence of CATCH_EXPRs in the current try context. */
+
+static tree
+next_sjlj_build_catch_list (struct objc_try_context **ctcp)
+{
+ tree_stmt_iterator i = tsi_start ((*ctcp)->catch_list);
+ tree catch_seq, t;
+ tree *last = &catch_seq;
+ bool saw_id = false;
+
+ for (; !tsi_end_p (i); tsi_next (&i))
+ {
+ tree stmt = tsi_stmt (i);
+ tree type = CATCH_TYPES (stmt);
+ tree body = CATCH_BODY (stmt);
+
+ if (type != error_mark_node
+ && objc_is_object_id (TREE_TYPE (type)))
+ {
+ *last = body;
+ saw_id = true;
+ break;
+ }
+ else
+ {
+ tree args, cond;
+
+ if (type == error_mark_node)
+ cond = error_mark_node;
+ else
+ {
+ args = tree_cons (NULL, (*ctcp)->caught_decl, NULL);
+ t = objc_get_class_reference (OBJC_TYPE_NAME (TREE_TYPE (type)));
+ args = tree_cons (NULL, t, args);
+ t = build_function_call (input_location,
+ objc_exception_match_decl, args);
+ cond = c_common_truthvalue_conversion (input_location, t);
+ }
+ t = build3 (COND_EXPR, void_type_node, cond, body, NULL);
+ SET_EXPR_LOCATION (t, EXPR_LOCATION (stmt));
+
+ *last = t;
+ last = &COND_EXPR_ELSE (t);
+ }
+ }
+
+ if (!saw_id)
+ {
+ t = build2 (MODIFY_EXPR, void_type_node, (*ctcp)->rethrow_decl,
+ (*ctcp)->caught_decl);
+ SET_EXPR_LOCATION (t, (*ctcp)->end_catch_locus);
+ append_to_statement_list (t, last);
+
+ t = next_sjlj_build_try_exit (ctcp);
+ SET_EXPR_LOCATION (t, (*ctcp)->end_catch_locus);
+ append_to_statement_list (t, last);
+ }
+
+ return catch_seq;
+}
+
+/* Build a complete @try-@catch-@finally block for legacy Darwin setjmp
+ exception handling. We aim to build:
+
+ {
+ struct _objc_exception_data _stack;
+ id _rethrow = 0;
+ try
+ {
+ objc_exception_try_enter (&_stack);
+ if (_setjmp(&_stack.buf))
+ {
+ id _caught = objc_exception_extract(&_stack);
+ objc_exception_try_enter (&_stack);
+ if (_setjmp(&_stack.buf))
+ _rethrow = objc_exception_extract(&_stack);
+ else
+ CATCH-LIST
+ }
+ else
+ TRY-BLOCK
+ }
+ finally
+ {
+ if (!_rethrow)
+ objc_exception_try_exit(&_stack);
+ FINALLY-BLOCK
+ if (_rethrow)
+ objc_exception_throw(_rethrow);
+ }
+ }
+
+ If CATCH-LIST is empty, we can omit all of the block containing
+ "_caught" except for the setting of _rethrow. Note the use of
+ a real TRY_FINALLY_EXPR here, which is not involved in EH per-se,
+ but handles goto and other exits from the block. */
+
+static tree
+next_sjlj_build_try_catch_finally (struct objc_try_context **ctcp)
+{
+ tree rethrow_decl, stack_decl, t;
+ tree catch_seq, try_fin, bind;
+ struct objc_try_context *cur_try_context = *ctcp;
+
+ /* Create the declarations involved. */
+ t = xref_tag (RECORD_TYPE, get_identifier (UTAG_EXCDATA));
+ stack_decl = objc_create_temporary_var (t, NULL);
+ cur_try_context->stack_decl = stack_decl;
+
+ rethrow_decl = objc_create_temporary_var (objc_object_type, NULL);
+ cur_try_context->rethrow_decl = rethrow_decl;
+ TREE_CHAIN (rethrow_decl) = stack_decl;
+
+ /* Build the outermost variable binding level. */
+ bind = build3 (BIND_EXPR, void_type_node, rethrow_decl, NULL, NULL);
+ SET_EXPR_LOCATION (bind, cur_try_context->try_locus);
+ TREE_SIDE_EFFECTS (bind) = 1;
+
+ /* Initialize rethrow_decl. */
+ t = build2 (MODIFY_EXPR, void_type_node, rethrow_decl,
+ convert (objc_object_type, null_pointer_node));
+ SET_EXPR_LOCATION (t, cur_try_context->try_locus);
+ append_to_statement_list (t, &BIND_EXPR_BODY (bind));
+
+ /* Build the outermost TRY_FINALLY_EXPR. */
+ try_fin = build2 (TRY_FINALLY_EXPR, void_type_node, NULL, NULL);
+ SET_EXPR_LOCATION (try_fin, cur_try_context->try_locus);
+ TREE_SIDE_EFFECTS (try_fin) = 1;
+ append_to_statement_list (try_fin, &BIND_EXPR_BODY (bind));
+
+ /* Create the complete catch sequence. */
+ if (cur_try_context->catch_list)
+ {
+ tree caught_decl = objc_build_exc_ptr (ctcp);
+ catch_seq = build_stmt (input_location, BIND_EXPR, caught_decl, NULL, NULL);
+ TREE_SIDE_EFFECTS (catch_seq) = 1;
+
+ t = next_sjlj_build_exc_extract (ctcp, caught_decl);
+ append_to_statement_list (t, &BIND_EXPR_BODY (catch_seq));
+
+ t = next_sjlj_build_enter_and_setjmp (ctcp);
+ COND_EXPR_THEN (t) = next_sjlj_build_exc_extract (ctcp, rethrow_decl);
+ COND_EXPR_ELSE (t) = next_sjlj_build_catch_list (ctcp);
+ append_to_statement_list (t, &BIND_EXPR_BODY (catch_seq));
+ }
+ else
+ catch_seq = next_sjlj_build_exc_extract (ctcp, rethrow_decl);
+ SET_EXPR_LOCATION (catch_seq, cur_try_context->end_try_locus);
+
+ /* Build the main register-and-try if statement. */
+ t = next_sjlj_build_enter_and_setjmp (ctcp);
+ SET_EXPR_LOCATION (t, cur_try_context->try_locus);
+ COND_EXPR_THEN (t) = catch_seq;
+ COND_EXPR_ELSE (t) = cur_try_context->try_body;
+ TREE_OPERAND (try_fin, 0) = t;
+
+ /* Build the complete FINALLY statement list. */
+ t = next_sjlj_build_try_exit (ctcp);
+ t = build_stmt (input_location, COND_EXPR,
+ c_common_truthvalue_conversion
+ (input_location, rethrow_decl),
+ NULL, t);
+ SET_EXPR_LOCATION (t, cur_try_context->finally_locus);
+ append_to_statement_list (t, &TREE_OPERAND (try_fin, 1));
+
+ append_to_statement_list (cur_try_context->finally_body,
+ &TREE_OPERAND (try_fin, 1));
+
+ t = tree_cons (NULL, rethrow_decl, NULL);
+ t = build_function_call (input_location,
+ objc_exception_throw_decl, t);
+ t = build_stmt (input_location, COND_EXPR,
+ c_common_truthvalue_conversion (input_location,
+ rethrow_decl),
+ t, NULL);
+ SET_EXPR_LOCATION (t, cur_try_context->end_finally_locus);
+ append_to_statement_list (t, &TREE_OPERAND (try_fin, 1));
+
+ return bind;
+}
+
+/* We do not expect this to be used at the moment.
+ If (a) it is possible to implement unwinder exceptions.
+ (b) we do it... then it might be possibly useful.
+*/
+static GTY(()) tree objc_eh_personality_decl;
+
+static tree
+objc_eh_runtime_type (tree type)
+{
+ tree ident, eh_id, decl, str;
+
+ gcc_unreachable ();
+ if (type == error_mark_node)
+ {
+ /* Use 'ErrorMarkNode' as class name when error_mark_node is found
+ to prevent an ICE. Note that we know that the compiler will
+ terminate with an error and this 'ErrorMarkNode' class name will
+ never be actually used. */
+ ident = get_identifier ("ErrorMarkNode");
+ goto make_err_class;
+ }
+
+ if (POINTER_TYPE_P (type) && objc_is_object_id (TREE_TYPE (type)))
+ {
+ ident = get_identifier ("id");
+ goto make_err_class;
+ }
+
+ if (!POINTER_TYPE_P (type) || !TYPED_OBJECT (TREE_TYPE (type)))
+ {
+#ifdef OBJCPLUS
+ /* This routine is also called for c++'s catch clause; in which case,
+ we use c++'s typeinfo decl. */
+ return build_eh_type_type (type);
+#else
+ error ("non-objective-c type '%T' cannot be caught", type);
+ ident = get_identifier ("ErrorMarkNode");
+ goto make_err_class;
+#endif
+ }
+ else
+ ident = OBJC_TYPE_NAME (TREE_TYPE (type));
+
+make_err_class:
+ /* If this class was already referenced, then it will be output during
+ meta-data emission, so we don't need to do it here. */
+ decl = get_objc_string_decl (ident, class_names);
+ eh_id = add_objc_string (ident, class_names);
+ if (!decl)
+ {
+ /* Not found ... so we need to build it - from the freshly-entered id. */
+ decl = get_objc_string_decl (ident, class_names);
+ str = my_build_string (IDENTIFIER_LENGTH (ident) + 1,
+ IDENTIFIER_POINTER (ident));
+ /* We have to finalize this var here, because this might be called after
+ all the other metadata strings have been emitted. */
+ finish_var_decl (decl, str);
+ }
+ return eh_id;
+}
+
+static tree
+objc_eh_personality (void)
+{
+ if (!objc_eh_personality_decl)
+#ifndef OBJCPLUS
+ objc_eh_personality_decl = build_personality_function ("objc");
+#else
+ objc_eh_personality_decl = build_personality_function ("gxx");
+#endif
+ return objc_eh_personality_decl;
+}
+
+/* --- interfaces --- */
+
+static tree
+build_throw_stmt (location_t loc, tree throw_expr, bool rethrown ATTRIBUTE_UNUSED)
+{
+ tree t;
+ VEC(tree, gc) *parms = VEC_alloc (tree, gc, 1);
+ /* A throw is just a call to the runtime throw function with the
+ object as a parameter. */
+ VEC_quick_push (tree, parms, throw_expr);
+ t = build_function_call_vec (loc, objc_exception_throw_decl, parms, NULL);
+ VEC_free (tree, gc, parms);
+ return add_stmt (t);
+}
+
+/* Build __builtin_eh_pointer, or the moral equivalent. In the case
+ of Darwin, we'll arrange for it to be initialized (and associated
+ with a binding) later. */
+
+static tree
+objc_build_exc_ptr (struct objc_try_context **cur_try_context)
+{
+ if (flag_objc_sjlj_exceptions)
+ {
+ tree var = (*cur_try_context)->caught_decl;
+ if (!var)
+ {
+ var = objc_create_temporary_var (objc_object_type, NULL);
+ (*cur_try_context)->caught_decl = var;
+ }
+ return var;
+ }
+ else
+ {
+ tree t;
+ t = built_in_decls[BUILT_IN_EH_POINTER];
+ t = build_call_expr (t, 1, integer_zero_node);
+ return fold_convert (objc_object_type, t);
+ }
+}
+
+static tree
+begin_catch (struct objc_try_context **cur_try_context, tree type,
+ tree decl, tree compound, bool ellipsis ATTRIBUTE_UNUSED)
+{
+ tree t;
+ /* Record the data for the catch in the try context so that we can
+ finalize it later. We treat ellipsis the same way as catching
+ with 'id xyz'. */
+ t = build_stmt (input_location, CATCH_EXPR, type, compound);
+ (*cur_try_context)->current_catch = t;
+
+ /* Initialize the decl from the EXC_PTR_EXPR we get from the runtime. */
+ t = objc_build_exc_ptr (cur_try_context);
+ t = convert (TREE_TYPE (decl), t);
+ return build2 (MODIFY_EXPR, void_type_node, decl, t);
+}
+
+static void
+finish_catch (struct objc_try_context **cur_try_context, tree current_catch)
+{
+ append_to_statement_list (current_catch, &((*cur_try_context)->catch_list));
+}
+
+static tree
+finish_try_stmt (struct objc_try_context **cur_try_context)
+{
+ tree stmt;
+ struct objc_try_context *c = *cur_try_context;
+ /* If we're doing Darwin setjmp exceptions, build the big nasty. */
+ if (flag_objc_sjlj_exceptions)
+ {
+ bool save = in_late_binary_op;
+ in_late_binary_op = true;
+ if (!c->finally_body)
+ {
+ c->finally_locus = input_location;
+ c->end_finally_locus = input_location;
+ }
+ stmt = next_sjlj_build_try_catch_finally (cur_try_context);
+ in_late_binary_op = save;
+ }
+ else
+ /* This doesn't happen at the moment... but maybe one day... */
+ {
+ /* Otherwise, nest the CATCH inside a FINALLY. */
+ stmt = c->try_body;
+ if (c->catch_list)
+ stmt = build_stmt (c->try_locus, TRY_CATCH_EXPR, stmt, c->catch_list);
+ if (c->finally_body)
+ stmt = build_stmt (c->try_locus, TRY_FINALLY_EXPR, stmt, c->finally_body);
+ }
+ return stmt;
+}
+
+#include "gt-objc-objc-next-runtime-abi-01.h"
diff --git a/gcc/objc/objc-next-runtime-abi-02.c b/gcc/objc/objc-next-runtime-abi-02.c
new file mode 100644
index 00000000000..3de0d05bf70
--- /dev/null
+++ b/gcc/objc/objc-next-runtime-abi-02.c
@@ -0,0 +1,3778 @@
+/* Next Runtime (ABI-2) private.
+ Copyright (C) 2011 Free Software Foundation, Inc.
+
+ Contributed by Iain Sandoe and based, in part, on an implementation in
+ 'branches/apple/trunk' contributed by Apple Computer Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3, or (at your option)
+any later version.
+
+GCC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING3. If not see
+<http://www.gnu.org/licenses/>. */
+
+/* The NeXT ABI2 is used for m64 implementations on Darwin/OSX machines.
+
+ This version is intended to match (logically) the output of Apple's
+ 4.2.1 compiler. */
+
+#include "config.h"
+#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
+#include "tree.h"
+
+#ifdef OBJCPLUS
+#include "cp-tree.h"
+#else
+#include "c-tree.h"
+#include "c-lang.h"
+#endif
+#include "langhooks.h"
+#include "c-family/c-objc.h"
+#include "objc-act.h"
+
+/* When building Objective-C++, we are not linking against the C front-end
+ and so need to replicate the C tree-construction functions in some way. */
+#ifdef OBJCPLUS
+#define OBJCP_REMAP_FUNCTIONS
+#include "objcp-decl.h"
+#endif /* OBJCPLUS */
+
+#include "ggc.h"
+#include "target.h"
+#include "obstack.h"
+#include "tree-iterator.h"
+
+/* These are only used for encoding ivars. */
+extern struct obstack util_obstack;
+extern char *util_firstobj;
+
+#include "objc-runtime-hooks.h"
+
+#include "objc-runtime-shared-support.h"
+
+/* ABI 2 Private definitions. */
+#define DEF_CONSTANT_STRING_CLASS_NAME "NSConstantString"
+
+#define TAG_GETCLASS "objc_getClass"
+#define TAG_GETMETACLASS "objc_getMetaClass"
+
+#define TAG_MSGSEND "objc_msgSend"
+#define TAG_MSGSENDSUPER "objc_msgSendSuper"
+#define TAG_MSGSEND_STRET "objc_msgSend_stret"
+#define TAG_MSGSENDSUPER_STRET "objc_msgSendSuper_stret"
+
+#define TAG_NEXT_EHVTABLE_NAME "objc_ehtype_vtable"
+#define TAG_V2_EH_TYPE "objc_ehtype_t"
+
+#define UTAG_V2_CLASS "_class_t"
+#define UTAG_V2_CLASS_RO "_class_ro_t"
+#define UTAG_V2_PROTOCOL "_protocol_t"
+#define UTAG_V2_PROTOCOL_LIST "_protocol_list_t"
+
+#define UTAG_V2_EH_TYPE "_objc_ehtype_t"
+
+#define OBJC2_CLS_HAS_CXX_STRUCTORS 0x0004L
+
+enum objc_v2_tree_index
+{
+ /* Templates. */
+ OCTI_V2_CLS_TEMPL,
+ OCTI_V2_CAT_TEMPL,
+ OCTI_V2_CLS_RO_TEMPL,
+ OCTI_V2_PROTO_TEMPL,
+ OCTI_V2_IVAR_TEMPL,
+ OCTI_V2_IVAR_LIST_TEMPL,
+ OCTI_V2_MESSAGE_REF_TEMPL,
+ OCTI_V2_SUPER_MESSAGE_REF_TEMPL,
+
+ OCTI_V2_MESSAGE_SELECTOR_TYPE,
+ OCTI_V2_SUPER_MESSAGE_SELECTOR_TYPE,
+ OCTI_V2_IMP_TYPE,
+ OCTI_V2_SUPER_IMP_TYPE,
+
+ OCTI_V2_CACHE_DECL,
+ OCTI_V2_VTABLE_DECL,
+
+ OCTI_V2_PROPERTY_TEMPL,
+
+ /* V2 messaging. */
+ OCTI_V2_UMSG_FIXUP_DECL,
+ OCTI_V2_UMSG_STRET_FIXUP_DECL,
+ OCTI_V2_UMSG_ID_FIXUP_DECL,
+ OCTI_V2_UMSG_ID_STRET_FIXUP_DECL,
+ OCTI_V2_UMSG_SUPER2_FIXUP_DECL,
+ OCTI_V2_UMSG_SUPER2_STRET_FIXUP_DECL,
+
+ /* Exceptions - related. */
+ OCTI_V2_BEGIN_CATCH_DECL,
+ OCTI_V2_END_CATCH_DECL,
+ OCTI_V2_RETHROW_DECL,
+
+ OCTI_V2_MAX
+};
+
+#define objc_v2_class_template objc_v2_global_trees[OCTI_V2_CLS_TEMPL]
+#define objc_v2_class_ro_template \
+ objc_v2_global_trees[OCTI_V2_CLS_RO_TEMPL]
+#define objc_v2_category_template \
+ objc_v2_global_trees[OCTI_V2_CAT_TEMPL]
+#define objc_v2_protocol_template \
+ objc_v2_global_trees[OCTI_V2_PROTO_TEMPL]
+
+/* struct message_ref_t */
+#define objc_v2_message_ref_template \
+ objc_v2_global_trees[OCTI_V2_MESSAGE_REF_TEMPL]
+
+#define objc_v2_ivar_list_ptr objc_v2_global_trees[OCTI_V2_IVAR_LIST_TEMPL]
+
+/* struct super_message_ref_t */
+#define objc_v2_super_message_ref_template \
+ objc_v2_global_trees[OCTI_V2_SUPER_MESSAGE_REF_TEMPL]
+
+/* struct message_ref_t* */
+#define objc_v2_selector_type objc_v2_global_trees[OCTI_V2_MESSAGE_SELECTOR_TYPE]
+/* struct super_super_message_ref_t */
+#define objc_v2_super_selector_type \
+ objc_v2_global_trees[OCTI_V2_SUPER_MESSAGE_SELECTOR_TYPE]
+#define objc_v2_imp_type objc_v2_global_trees[OCTI_V2_IMP_TYPE]
+#define objc_v2_super_imp_type objc_v2_global_trees[OCTI_V2_SUPER_IMP_TYPE]
+
+#define UOBJC_V2_CACHE_decl objc_v2_global_trees[OCTI_V2_CACHE_DECL]
+#define UOBJC_V2_VTABLE_decl objc_v2_global_trees[OCTI_V2_VTABLE_DECL]
+
+#define objc_v2_ivar_template objc_v2_global_trees[OCTI_V2_IVAR_TEMPL]
+#define objc_v2_property_template \
+ objc_v2_global_trees[OCTI_V2_PROPERTY_TEMPL]
+
+/* V2 Messaging */
+
+/* objc_msgSend_fixup_rtp */
+#define umsg_fixup_decl objc_v2_global_trees[OCTI_V2_UMSG_FIXUP_DECL]
+/* objc_msgSend_stret_fixup_rtp */
+#define umsg_stret_fixup_decl objc_v2_global_trees[OCTI_V2_UMSG_STRET_FIXUP_DECL]
+/* objc_msgSendId_fixup_rtp */
+#define umsg_id_fixup_decl objc_v2_global_trees[OCTI_V2_UMSG_ID_FIXUP_DECL]
+/* objc_msgSendId_stret_fixup_rtp */
+#define umsg_id_stret_fixup_decl \
+ objc_v2_global_trees[OCTI_V2_UMSG_ID_STRET_FIXUP_DECL]
+/* objc_msgSendSuper2_fixup_rtp */
+#define umsg_id_super2_fixup_decl \
+ objc_v2_global_trees[OCTI_V2_UMSG_SUPER2_FIXUP_DECL]
+/* objc_msgSendSuper2_stret_fixup_rtp */
+#define umsg_id_super2_stret_fixup_decl \
+ objc_v2_global_trees[OCTI_V2_UMSG_SUPER2_STRET_FIXUP_DECL]
+
+#define objc2_begin_catch_decl objc_v2_global_trees[OCTI_V2_BEGIN_CATCH_DECL]
+#define objc2_end_catch_decl objc_v2_global_trees[OCTI_V2_END_CATCH_DECL]
+#define objc_rethrow_exception_decl \
+ objc_v2_global_trees[OCTI_V2_RETHROW_DECL]
+
+/* rt_trees identifiers - shared between NeXT implementations. These allow
+ the FE to tag meta-data in a manner that survives LTO and can be used when
+ the runtime requires that certain meta-data items appear in particular
+ named sections. */
+
+#include "objc-next-metadata-tags.h"
+extern GTY(()) tree objc_rt_trees[OCTI_RT_META_MAX];
+
+/* The OCTI_V2_... enumeration itself is in above. */
+static GTY(()) tree objc_v2_global_trees[OCTI_V2_MAX];
+
+static void next_runtime_02_initialize (void);
+
+static void build_v2_message_ref_templates (void);
+static void build_v2_class_templates (void);
+static void build_v2_super_template (void);
+static void build_v2_category_template (void);
+static void build_v2_protocol_template (void);
+
+static tree next_runtime_abi_02_super_superclassfield_id (void);
+
+static tree next_runtime_abi_02_class_decl (tree);
+static tree next_runtime_abi_02_metaclass_decl (tree);
+static tree next_runtime_abi_02_category_decl (tree);
+static tree next_runtime_abi_02_protocol_decl (tree);
+static tree next_runtime_abi_02_string_decl (tree, const char *, string_section);
+
+static tree next_runtime_abi_02_get_class_reference (tree);
+static tree next_runtime_abi_02_build_selector_reference (location_t, tree, tree);
+static tree next_runtime_abi_02_get_protocol_reference (location_t, tree);
+static tree next_runtime_abi_02_build_ivar_ref (location_t, tree, tree);
+static tree next_runtime_abi_02_get_class_super_ref (location_t, struct imp_entry *, bool);
+static tree next_runtime_abi_02_get_category_super_ref (location_t, struct imp_entry *, bool);
+
+static tree next_runtime_abi_02_receiver_is_class_object (tree);
+static tree next_runtime_abi_02_get_arg_type_list_base (tree, int, int);
+static tree next_runtime_abi_02_build_objc_method_call (location_t, tree, tree,
+ tree, tree, tree, int);
+static bool next_runtime_abi_02_setup_const_string_class_decl (void);
+static tree next_runtime_abi_02_build_const_string_constructor (location_t, tree, int);
+
+static tree create_extern_decl (tree, const char *);
+
+static void objc_generate_v2_next_metadata (void);
+static bool objc2_objc_exception_attr (tree);
+
+/* void build_v2_protocol_reference (tree);*/
+static void build_v2_ehtype_template (void);
+static void build_v2_eh_catch_objects (void);
+static tree next_runtime_02_eh_type (tree);
+static tree objc_eh_personality (void);
+static tree build_throw_stmt (location_t, tree, bool);
+static tree objc_build_exc_ptr (struct objc_try_context **);
+static tree begin_catch (struct objc_try_context **, tree, tree, tree, bool);
+static void finish_catch (struct objc_try_context **, tree);
+static tree finish_try_stmt (struct objc_try_context **);
+
+static GTY ((length ("SIZEHASHTABLE"))) hash *extern_names;
+
+bool
+objc_next_runtime_abi_02_init (objc_runtime_hooks *rthooks)
+{
+ extern_names = ggc_alloc_cleared_vec_hash (SIZEHASHTABLE);
+
+ if (flag_objc_exceptions && flag_objc_sjlj_exceptions)
+ {
+ inform (UNKNOWN_LOCATION, "%<-fobjc-sjlj-exceptions%> is ignored for "
+ "%<-fnext-runtime%> when %<-fobjc-abi-version%> >= 2");
+ flag_objc_sjlj_exceptions = 0;
+ }
+
+ rthooks->initialize = next_runtime_02_initialize;
+ rthooks->default_constant_string_class_name = DEF_CONSTANT_STRING_CLASS_NAME;
+ rthooks->tag_getclass = TAG_GETCLASS;
+ rthooks->super_superclassfield_ident = next_runtime_abi_02_super_superclassfield_id;
+
+ rthooks->class_decl = next_runtime_abi_02_class_decl;
+ rthooks->metaclass_decl = next_runtime_abi_02_metaclass_decl;
+ rthooks->category_decl = next_runtime_abi_02_category_decl;
+ rthooks->protocol_decl = next_runtime_abi_02_protocol_decl;
+ rthooks->string_decl = next_runtime_abi_02_string_decl;
+
+ rthooks->get_class_reference = next_runtime_abi_02_get_class_reference;
+ rthooks->build_selector_reference = next_runtime_abi_02_build_selector_reference;
+ rthooks->get_protocol_reference = next_runtime_abi_02_get_protocol_reference;
+ rthooks->build_ivar_reference = next_runtime_abi_02_build_ivar_ref;
+ rthooks->get_class_super_ref = next_runtime_abi_02_get_class_super_ref;
+ rthooks->get_category_super_ref = next_runtime_abi_02_get_category_super_ref;
+
+ rthooks->receiver_is_class_object = next_runtime_abi_02_receiver_is_class_object;
+ rthooks->get_arg_type_list_base = next_runtime_abi_02_get_arg_type_list_base;
+ rthooks->build_objc_method_call = next_runtime_abi_02_build_objc_method_call;
+
+ rthooks->setup_const_string_class_decl =
+ next_runtime_abi_02_setup_const_string_class_decl;
+ rthooks->build_const_string_constructor =
+ next_runtime_abi_02_build_const_string_constructor;
+
+ rthooks->build_throw_stmt = build_throw_stmt;
+ rthooks->build_exc_ptr = objc_build_exc_ptr;
+ rthooks->begin_catch = begin_catch;
+ rthooks->finish_catch = finish_catch;
+ rthooks->finish_try_stmt = finish_try_stmt;
+
+ rthooks->generate_metadata = objc_generate_v2_next_metadata;
+ return true;
+}
+
+/* We need a way to convey what kind of meta-data are represented by a given
+ variable, since each type is expected (by the runtime) to be found in a
+ specific named section. The solution must be usable with LTO.
+
+ The scheme used for NeXT ABI 0/1 (partial matching of variable names) is not
+ satisfactory when LTO is used with ABI-2. We now tag ObjC meta-data with
+ identification attributes in the front end. The back-end may choose to act
+ on these as it requires. */
+
+static void
+next_runtime_abi_02_init_metadata_attributes (void)
+{
+ if (!objc_meta)
+ objc_meta = get_identifier ("OBJC2META");
+
+ if (!meta_base)
+ meta_base = get_identifier ("V2_BASE");
+
+ meta_class = get_identifier ("G2_CLAS");
+ meta_metaclass = get_identifier ("G2_META");
+ meta_category =
+ meta_protocol = meta_base;
+
+ meta_clac_vars =
+ meta_clai_vars = meta_base;
+
+ meta_clac_meth =
+ meta_clai_meth =
+ meta_catc_meth =
+ meta_cati_meth =
+ meta_proto_cls_meth =
+ meta_proto_nst_meth = meta_base;
+
+ meta_clas_prot =
+ meta_catg_prot = meta_base;
+
+ meta_sel_refs = get_identifier ("V2_SRFS");
+
+ meta_class_name =
+ meta_meth_name =
+ meta_meth_type =
+ meta_prop_name_attr = get_identifier ("V2_STRG");
+
+ meta_mref = get_identifier ("V2_MREF");
+ meta_class_ref = get_identifier ("V2_CLRF");
+ meta_superclass_ref = get_identifier ("V2_SURF");
+
+ meta_label_classlist = get_identifier ("V2_CLAB");
+ meta_label_nonlazy_classlist = get_identifier ("V2_NLCL");
+ meta_label_categorylist = get_identifier ("V2_CALA");
+ meta_label_nonlazy_categorylist = get_identifier ("V2_NLCA");
+
+ meta_label_protocollist = get_identifier ("V2_PLST");
+ meta_proto_ref = get_identifier ("V2_PRFS");
+
+ meta_info = get_identifier ("V2_INFO");
+
+ meta_ehtype = get_identifier ("V2_EHTY");
+
+ meta_const_str = get_identifier ("V2_CSTR");
+}
+
+static void next_runtime_02_initialize (void)
+{
+ tree type;
+#ifdef OBJCPLUS
+ /* For all NeXT objc ABIs -fobjc-call-cxx-cdtors is on by
+ default. */
+ if (!global_options_set.x_flag_objc_call_cxx_cdtors)
+ global_options.x_flag_objc_call_cxx_cdtors = 1;
+#endif
+
+ /* Set up attributes to be attached to the meta-data so that they
+ will be placed in the correct sections. */
+ next_runtime_abi_02_init_metadata_attributes ();
+
+ /* `struct objc_selector *' */
+ objc_selector_type = build_pointer_type (xref_tag (RECORD_TYPE,
+ get_identifier (TAG_SELECTOR)));
+
+ /* IMP : id (*) (id, _message_ref_t*, ...)
+ SUPER_IMP : id (*) ( super_t*, _super_message_ref_t*, ...)
+ objc_v2_selector_type. */
+ build_v2_message_ref_templates ();
+
+ objc_v2_ivar_list_ptr =
+ build_pointer_type (xref_tag (RECORD_TYPE,
+ get_identifier ("_ivar_list_t")));
+
+ objc_prop_list_ptr =
+ build_pointer_type (xref_tag (RECORD_TYPE,
+ get_identifier ("_prop_list_t")));
+
+ build_v2_class_templates ();
+ build_v2_super_template ();
+ build_v2_protocol_template ();
+ build_v2_category_template ();
+
+ /* id objc_msgSend_fixup_rtp (id, struct message_ref_t*, ...); */
+ type = build_varargs_function_type_list (objc_object_type,
+ objc_object_type,
+ objc_v2_selector_type,
+ NULL_TREE);
+ umsg_fixup_decl = add_builtin_function ("objc_msgSend_fixup",
+ type, 0, NOT_BUILT_IN,
+ NULL, NULL_TREE);
+ TREE_NOTHROW (umsg_fixup_decl) = 0;
+
+ /* id objc_msgSend_stret_fixup_rtp (id, struct message_ref_t*, ...); */
+ umsg_stret_fixup_decl = add_builtin_function ("objc_msgSend_stret_fixup",
+ type, 0, NOT_BUILT_IN,
+ NULL, NULL_TREE);
+ TREE_NOTHROW (umsg_stret_fixup_decl) = 0;
+
+ /* id objc_msgSendId_fixup_rtp (id, struct message_ref_t*, ...); */
+ umsg_id_fixup_decl = add_builtin_function ("objc_msgSendId_fixup",
+ type, 0, NOT_BUILT_IN,
+ NULL, NULL_TREE);
+ TREE_NOTHROW (umsg_id_fixup_decl) = 0;
+
+ /* id objc_msgSendId_stret_fixup_rtp
+ (id, struct message_ref_t*, ...); */
+ umsg_id_stret_fixup_decl = add_builtin_function ("objc_msgSendId_stret_fixup",
+ type, 0, NOT_BUILT_IN,
+ NULL, NULL_TREE);
+ TREE_NOTHROW (umsg_id_stret_fixup_decl) = 0;
+
+ /* id objc_msgSendSuper2_fixup_rtp
+ (struct objc_super *, struct message_ref_t*, ...); */
+ type = build_varargs_function_type_list (objc_object_type,
+ objc_super_type,
+ objc_v2_super_selector_type,
+ NULL_TREE);
+ umsg_id_super2_fixup_decl = add_builtin_function ("objc_msgSendSuper2_fixup",
+ type, 0, NOT_BUILT_IN,
+ NULL, NULL_TREE);
+ TREE_NOTHROW (umsg_id_super2_fixup_decl) = 0;
+
+ /* id objc_msgSendSuper2_stret_fixup_rtp
+ (struct objc_super *, struct message_ref_t*, ...); */
+ umsg_id_super2_stret_fixup_decl =
+ add_builtin_function ("objc_msgSendSuper2_stret_fixup",
+ type, 0, NOT_BUILT_IN,
+ NULL, NULL_TREE);
+ TREE_NOTHROW (umsg_id_super2_stret_fixup_decl) = 0;
+
+ /* Present in the library, but unused by the FE. */
+ /* Protocol *objc_getProtocol (const char *)
+ type = build_function_type_list (objc_protocol_type,
+ const_string_type_node,
+ NULL_TREE);
+ objc_v2_getprotocol_decl = add_builtin_function ("objc_getProtocol",
+ type, 0, NOT_BUILT_IN,
+ NULL, NULL_TREE);
+ TREE_NOTHROW (objc_v2_getprotocol_decl) = 0;*/
+
+ UOBJC_V2_CACHE_decl = create_extern_decl (ptr_type_node,
+ "_objc_empty_cache");
+
+ UOBJC_V2_VTABLE_decl = create_extern_decl (objc_v2_imp_type,
+ "_objc_empty_vtable");
+
+ /* id objc_getClass (const char *); */
+ type = build_function_type_list (objc_object_type,
+ const_string_type_node,
+ NULL_TREE);
+ objc_get_class_decl = add_builtin_function (TAG_GETCLASS,
+ type, 0, NOT_BUILT_IN,
+ NULL, NULL_TREE);
+
+ /* id objc_getMetaClass (const char *); */
+ objc_get_meta_class_decl = add_builtin_function (TAG_GETMETACLASS,
+ type, 0, NOT_BUILT_IN,
+ NULL, NULL_TREE);
+
+ /* This is the type of all of the following functions
+ objc_copyStruct(). */
+ type = build_function_type_list (void_type_node,
+ ptr_type_node,
+ const_ptr_type_node,
+ ptrdiff_type_node,
+ boolean_type_node,
+ boolean_type_node,
+ NULL_TREE);
+ /* Declare the following function:
+ void
+ objc_copyStruct (void *destination, const void *source,
+ ptrdiff_t size, BOOL is_atomic, BOOL has_strong); */
+ objc_copyStruct_decl = add_builtin_function ("objc_copyStruct",
+ type, 0, NOT_BUILT_IN,
+ NULL, NULL_TREE);
+ TREE_NOTHROW (objc_copyStruct_decl) = 0;
+ objc_getPropertyStruct_decl = NULL_TREE;
+ objc_setPropertyStruct_decl = NULL_TREE;
+
+ gcc_assert (!flag_objc_sjlj_exceptions);
+
+ /* Although we warn that fobjc-exceptions is required for exceptions
+ code, we carry on and create it anyway. */
+
+ /* This can be required, even when exceptions code is not present,
+ when an __attribute__((objc_exception)) is applied to a
+ class. */
+ build_v2_ehtype_template ();
+
+ /* void * objc_begin_catch (void *) */
+ type = build_function_type (ptr_type_node,
+ tree_cons (NULL_TREE, ptr_type_node,
+ OBJC_VOID_AT_END));
+
+ objc2_begin_catch_decl = add_builtin_function ("objc_begin_catch",
+ type, 0, NOT_BUILT_IN,
+ NULL, NULL_TREE);
+ TREE_NOTHROW (objc2_begin_catch_decl) = 0;
+
+ /* void objc_end_catch () */
+ type = build_function_type (void_type_node, OBJC_VOID_AT_END);
+ objc2_end_catch_decl = add_builtin_function ("objc_end_catch",
+ type, 0, NOT_BUILT_IN,
+ NULL, NULL_TREE);
+ TREE_NOTHROW (objc2_end_catch_decl) = 0;
+
+ /* void objc_exception_rethrow (void) */
+ type = build_function_type (void_type_node, OBJC_VOID_AT_END);
+ objc_rethrow_exception_decl =
+ add_builtin_function ("objc_exception_rethrow",
+ type, 0, NOT_BUILT_IN,
+ NULL, NULL_TREE);
+ TREE_NOTHROW (objc_rethrow_exception_decl) = 0;
+ using_eh_for_cleanups ();
+ lang_hooks.eh_runtime_type = next_runtime_02_eh_type;
+ lang_hooks.eh_personality = objc_eh_personality;
+}
+
+/* NOTE --- templates --- */
+
+/* Set 'objc_v2_message_ref_template' to the data type node for
+ 'struct _message_ref_t'. This needs to be done just once per
+ compilation. Also Set 'objc_v2_super_message_ref_template' to data
+ type node for 'struct _super_message_ref_t'. */
+
+/* struct _message_ref_t
+ {
+ IMP messenger;
+ SEL name;
+ };
+ where IMP is: id (*) (id, _message_ref_t*, ...)
+*/
+
+/* struct _super_message_ref_t
+ {
+ SUPER_IMP messenger;
+ SEL name;
+ };
+ where SUPER_IMP is: id (*) ( super_t*, _super_message_ref_t*, ...)
+*/
+
+static void
+build_v2_message_ref_templates (void)
+{
+ tree ptr_message_ref_t;
+ tree decls, *chain = NULL;
+
+ /* struct _message_ref_t {...} */
+ objc_v2_message_ref_template =
+ objc_start_struct (get_identifier ("_message_ref_t"));
+
+ /* IMP messenger; */
+ ptr_message_ref_t =
+ build_pointer_type (xref_tag (RECORD_TYPE,
+ get_identifier ("_message_ref_t")));
+
+ objc_v2_imp_type =
+ build_pointer_type (build_function_type_list
+ (objc_object_type,
+ objc_object_type,
+ ptr_message_ref_t,
+ NULL_TREE));
+
+ decls = add_field_decl (objc_v2_imp_type, "messenger", &chain);
+
+ /* SEL name; */
+ add_field_decl (objc_selector_type, "name", &chain);
+
+ objc_finish_struct (objc_v2_message_ref_template, decls);
+
+ objc_v2_selector_type = build_pointer_type (objc_v2_message_ref_template);
+
+ chain = NULL;
+ /* struct _super_message_ref_t {...} */
+ objc_v2_super_message_ref_template =
+ objc_start_struct (get_identifier ("_super_message_ref_t"));
+
+ /* SUPER_IMP messenger; */
+ ptr_message_ref_t = build_pointer_type
+ (xref_tag (RECORD_TYPE,
+ get_identifier ("_super_message_ref_t")));
+
+ objc_v2_super_imp_type =
+ build_pointer_type (build_function_type_list
+ (objc_object_type,
+ objc_super_type,
+ ptr_message_ref_t,
+ NULL_TREE));
+
+ add_field_decl (objc_v2_super_imp_type, "messenger", &chain);
+
+ /* SEL name; */
+ add_field_decl (objc_selector_type, "name", &chain);
+
+ objc_finish_struct (objc_v2_super_message_ref_template, decls);
+ objc_v2_super_selector_type =
+ build_pointer_type (objc_v2_super_message_ref_template);
+}
+
+/* Build following types which represent each class implementation.
+
+struct class_ro_t
+{
+ uint32_t const flags;
+ uint32_t const instanceStart;
+ uint32_t const instanceSize;
+#ifdef __LP64__
+ uint32_t const reserved;
+#endif
+ const uint8_t * const ivarLayout;
+ const char *const name;
+ const struct method_list_t * const baseMethods;
+ const struct objc_protocol_list *const baseProtocols;
+ const struct ivar_list_t *const ivars;
+ const uint8_t * const weakIvarLayout;
+ const struct _prop_list_t * const properties;
+};
+
+struct class_t
+{
+ struct class_t *isa;
+ struct class_t *superclass;
+ void *cache;
+ IMP *vtable;
+
+ ...When this is active - it will point to a rw version, but
+ when we build the meta-data we point it to the ro...
+ struct class_ro_t *data;
+};
+
+*/
+
+static void
+build_v2_class_templates (void)
+{
+ tree cnst_strg_type;
+ tree decls, *chain = NULL;
+
+ /* struct class_ro_t {...} */
+ objc_v2_class_ro_template =
+ objc_start_struct (get_identifier (UTAG_V2_CLASS_RO));
+
+ /* uint32_t const flags; */
+ decls = add_field_decl (integer_type_node, "flags", &chain);
+
+ /* uint32_t const instanceStart; */
+ add_field_decl (integer_type_node, "instanceStart", &chain);
+
+ /* uint32_t const instanceSize; */
+ add_field_decl (integer_type_node, "instanceSize", &chain);
+
+ /* This ABI is currently only used on m64 NeXT. We always
+ explicitly declare the alignment padding. */
+ /* uint32_t const reserved; */
+ add_field_decl (integer_type_node, "reserved", &chain);
+
+ /* const uint8_t * const ivarLayout; */
+ cnst_strg_type = build_pointer_type (unsigned_char_type_node);
+ add_field_decl (cnst_strg_type, "ivarLayout", &chain);
+
+ /* const char *const name; */
+ add_field_decl (string_type_node, "name", &chain);
+
+ /* const struct method_list_t * const baseMethods; */
+ add_field_decl (objc_method_list_ptr, "baseMethods", &chain);
+
+ /* const struct objc_protocol_list *const baseProtocols; */
+ add_field_decl (build_pointer_type
+ (xref_tag (RECORD_TYPE,
+ get_identifier (UTAG_V2_PROTOCOL_LIST))),
+ "baseProtocols", &chain);
+
+ /* const struct ivar_list_t *const ivars; */
+ add_field_decl (objc_v2_ivar_list_ptr, "ivars", &chain);
+
+ /* const uint8_t * const weakIvarLayout; */
+ add_field_decl (cnst_strg_type, "weakIvarLayout", &chain);
+
+ /* struct _prop_list_t * baseProperties; */
+ add_field_decl (objc_prop_list_ptr, "baseProperties", &chain);
+
+ objc_finish_struct (objc_v2_class_ro_template, decls);
+
+ chain = NULL;
+ /* struct class_t {...} */
+ objc_v2_class_template =
+ objc_start_struct (get_identifier (UTAG_V2_CLASS));
+
+ /* struct class_t *isa; */
+ decls = add_field_decl (build_pointer_type (objc_v2_class_template),
+ "isa", &chain);
+
+ /* struct class_t * const superclass; */
+ add_field_decl (build_pointer_type (objc_v2_class_template),
+ "superclass", &chain);
+
+ /* void *cache; */
+ add_field_decl (build_pointer_type (void_type_node), "cache", &chain);
+
+ /* IMP *vtable; */
+ add_field_decl (build_pointer_type (objc_v2_imp_type), "vtable", &chain);
+
+ /* struct class_ro_t *ro; */
+ add_field_decl (build_pointer_type (objc_v2_class_ro_template), "ro", &chain);
+
+ objc_finish_struct (objc_v2_class_template, decls);
+}
+
+/* struct _objc_super
+ {
+ struct _objc_object *self;
+ Class cls;
+ }; */
+void
+build_v2_super_template (void)
+{
+ tree decls, *chain = NULL;
+
+ objc_super_template = objc_start_struct (get_identifier (UTAG_SUPER));
+
+ /* struct _objc_object *self; */
+ decls = add_field_decl (objc_object_type, "self", &chain);
+
+ /* Class cls; */
+ add_field_decl (objc_class_type, "cls", &chain);
+
+ objc_finish_struct (objc_super_template, decls);
+}
+
+/* struct protocol_t
+ {
+ Class isa;
+ const char * const protocol_name;
+ const struct protocol_list_t * const protocol_list;
+ const struct method_list_t * const instance_methods;
+ const struct method_list_t * const class_methods;
+ const struct method_list_t * optionalInstanceMethods;
+ const struct method_list_t * optionalClassMethod
+ const struct _prop_list_t * const properties;
+ const uint32_t size;
+ const uint32_t flags;
+ }
+*/
+static void
+build_v2_protocol_template (void)
+{
+ tree decls, *chain = NULL;
+
+ objc_v2_protocol_template =
+ objc_start_struct (get_identifier (UTAG_V2_PROTOCOL));
+
+ /* Class isa; */
+ decls = add_field_decl (objc_object_type, "isa", &chain);
+
+ /* char *protocol_name; */
+ add_field_decl (string_type_node, "protocol_name", &chain);
+
+ /* const struct protocol_list_t * const protocol_list; */
+ add_field_decl (build_pointer_type (objc_v2_protocol_template),
+ "protocol_list", &chain);
+
+ /* const struct method_list_t * const instance_methods; */
+ add_field_decl (objc_method_proto_list_ptr, "instance_methods", &chain);
+
+ /* const struct method_list_t * const class_methods; */
+ add_field_decl (objc_method_proto_list_ptr, "class_methods", &chain);
+
+ /* const struct method_list_t * optionalInstanceMethods; */
+ add_field_decl (objc_method_proto_list_ptr, "optionalInstanceMethods", &chain);
+
+ /* const struct method_list_t * optionalClassMethods; */
+ add_field_decl (objc_method_proto_list_ptr, "optionalClassMethods", &chain);
+
+ /* struct _prop_list_t * properties; */
+ add_field_decl (objc_prop_list_ptr, "properties", &chain);
+
+ /* const uint32_t size; */
+ add_field_decl (integer_type_node, "size", &chain);
+
+ /* const uint32_t flags; */
+ add_field_decl (integer_type_node, "flags", &chain);
+
+ objc_finish_struct (objc_v2_protocol_template, decls);
+}
+
+/* Build type for a category:
+ struct category_t
+ {
+ const char * const name;
+ struct class_t *const cls;
+ const struct method_list_t * const instance_methods;
+ const struct method_list_t * const class_methods;
+ const struct protocol_list_t * const protocols;
+ const struct _prop_list_t * const properties;
+ }
+*/
+
+static void
+build_v2_category_template (void)
+{
+ tree decls, *chain = NULL;
+
+ objc_v2_category_template =
+ objc_start_struct (get_identifier ("_category_t"));
+
+ /* char *name; */
+ decls = add_field_decl (string_type_node, "name", &chain);
+
+ /* struct class_t *const cls; */
+ add_field_decl (build_pointer_type (objc_v2_class_template), "cls", &chain);
+
+ /* struct method_list_t *instance_methods; */
+ add_field_decl (objc_method_list_ptr, "instance_methods", &chain);
+
+ /* struct method_list_t *class_methods; */
+ add_field_decl (objc_method_list_ptr, "class_methods", &chain);
+
+ /* struct protocol_list_t *protocol_list; */
+ add_field_decl (build_pointer_type (objc_v2_protocol_template),
+ "protocol_list", &chain );
+
+ /* struct _prop_list_t * properties; */
+ add_field_decl (objc_prop_list_ptr, "properties", &chain);
+
+ objc_finish_struct (objc_v2_category_template, decls);
+}
+
+/* NOTE --- Decls, Identifiers, Names etc. --- */
+
+/* This routine is given a name and returns a matching extern variable
+ if one is found. */
+
+static tree
+hash_name_lookup (hash *hashlist, tree name)
+{
+ hash target;
+
+ target = hashlist[IDENTIFIER_HASH_VALUE (name) % SIZEHASHTABLE];
+
+ while (target)
+ {
+ if (name == DECL_NAME (target->key))
+ return target->key;
+
+ target = target->next;
+ }
+ return 0;
+}
+
+/* This routine is given an extern variable and enters it in its hash
+ table. Note that hashing is done on its inner IDENTIFIER_NODE
+ node. */
+
+static void
+hash_name_enter (hash *hashlist, tree id)
+{
+ hash obj;
+ int slot = IDENTIFIER_HASH_VALUE (DECL_NAME (id)) % SIZEHASHTABLE;
+
+ obj = ggc_alloc_hashed_entry ();
+ obj->list = 0;
+ obj->next = hashlist[slot];
+ obj->key = id;
+
+ hashlist[slot] = obj; /* append to front */
+}
+
+/* Create a declaration "extern <type> <name>;"
+ The var will need to be finalized (e.g. by calling finish_var_decl()). */
+
+static tree
+create_extern_decl (tree type, const char *name)
+{
+ tree id = get_identifier (name);
+ tree var = hash_name_lookup (extern_names, id);
+ if (var)
+ return var;
+ /* New name. */
+ var = start_var_decl (type, name);
+ TREE_STATIC (var) = 0;
+ DECL_EXTERNAL (var) = 1;
+ TREE_PUBLIC (var) = 1;
+ hash_name_enter (extern_names, var);
+ return var;
+}
+
+/* Create a globally visible definition for variable NAME of a given TYPE. The
+ finish_var_decl() routine will need to be called on it afterwards. */
+
+static tree
+create_global_decl (tree type, const char *name)
+{
+ tree id = get_identifier (name);
+ tree var = hash_name_lookup (extern_names, id);
+ if (var)
+ {
+ DECL_EXTERNAL (var) = 0;
+ TREE_STATIC (var) = 1;
+ }
+ else
+ {
+ var = start_var_decl (type, name);
+ hash_name_enter (extern_names, var);
+ }
+ TREE_PUBLIC (var) = 1;
+ return var;
+}
+
+/* Create a symbol with __attribute__ ((visibility ("hidden")))
+ attribute (private extern). */
+
+static tree
+create_hidden_decl (tree type, const char *name)
+{
+ tree decl = create_global_decl (type, name);
+ DECL_VISIBILITY (decl) = VISIBILITY_HIDDEN;
+ DECL_VISIBILITY_SPECIFIED (decl) = 1;
+ return decl;
+}
+
+/* Irritatingly, we have a different superclass field name for ABI=2. */
+/* PS/TODO: The field name does not matter, it is only used internally
+ by the compiler. We can rename it to whatever we want. ;-) */
+
+static tree
+next_runtime_abi_02_super_superclassfield_id (void)
+{
+ /* TODO: Simplify. Just always return get_identifier ("cls"), or at
+ most look it once at startup then always return it. */
+ if (!super_superclassfield_id)
+ super_superclassfield_id = get_identifier ("cls");
+ return super_superclassfield_id;
+}
+
+static tree
+next_runtime_abi_02_class_decl (tree klass)
+{
+ tree decl;
+ char buf[BUFSIZE];
+ snprintf (buf, BUFSIZE, "OBJC_CLASS_$_%s",
+ IDENTIFIER_POINTER (CLASS_NAME (klass)));
+ /* ObjC2 classes are extern visible. */
+ decl = create_global_decl (objc_v2_class_template, buf);
+ OBJCMETA (decl, objc_meta, meta_class);
+ return decl;
+}
+
+static tree
+next_runtime_abi_02_metaclass_decl (tree klass)
+{
+ tree decl;
+ char buf[BUFSIZE];
+ snprintf (buf, BUFSIZE, "OBJC_METACLASS_$_%s",
+ IDENTIFIER_POINTER (CLASS_NAME (klass)));
+ /* ObjC2 classes are extern visible. */
+ decl = create_global_decl (objc_v2_class_template, buf);
+ OBJCMETA (decl, objc_meta, meta_metaclass);
+ return decl;
+}
+
+static tree
+next_runtime_abi_02_category_decl (tree klass)
+{
+ tree decl;
+ char buf[BUFSIZE];
+ snprintf (buf, BUFSIZE, "_OBJC_Category_%s_on_%s",
+ IDENTIFIER_POINTER (CLASS_SUPER_NAME (klass)),
+ IDENTIFIER_POINTER (CLASS_NAME (klass)));
+ decl = start_var_decl (objc_v2_category_template, buf);
+ OBJCMETA (decl, objc_meta, meta_category);
+ return decl;
+}
+
+static tree
+next_runtime_abi_02_protocol_decl (tree p)
+{
+ tree decl;
+ char buf[BUFSIZE];
+
+ /* static struct _objc_protocol _OBJC_Protocol_<mumble>; */
+ snprintf (buf, BUFSIZE, "_OBJC_Protocol_%s",
+ IDENTIFIER_POINTER (PROTOCOL_NAME (p)));
+ decl = start_var_decl (objc_v2_protocol_template, buf);
+ OBJCMETA (decl, objc_meta, meta_protocol);
+ return decl;
+}
+
+static tree
+next_runtime_abi_02_string_decl (tree type, const char *name, string_section where)
+{
+ tree var = start_var_decl (type, name);
+ switch (where)
+ {
+ case class_names:
+ OBJCMETA (var, objc_meta, meta_class_name);
+ break;
+ case meth_var_names:
+ OBJCMETA (var, objc_meta, meta_meth_name);
+ break;
+ case meth_var_types:
+ OBJCMETA (var, objc_meta, meta_meth_type);
+ break;
+ case prop_names_attr:
+ OBJCMETA (var, objc_meta, meta_prop_name_attr);
+ break;
+ default:
+ OBJCMETA (var, objc_meta, meta_base);
+ break;
+ }
+ return var;
+}
+
+/* NOTE --- entry --- */
+
+typedef struct GTY(()) ident_data_tuple {
+ tree ident;
+ tree data;
+} ident_data_tuple ;
+DEF_VEC_O(ident_data_tuple);
+DEF_VEC_ALLOC_O(ident_data_tuple, gc);
+
+/* This routine creates a file scope static variable of type 'Class'
+ to hold the address of a class. */
+
+static tree
+build_v2_class_reference_decl (tree ident)
+{
+ tree decl;
+ char buf[BUFSIZE];
+
+ snprintf (buf, BUFSIZE, "_OBJC_ClassRef_%s", IDENTIFIER_POINTER (ident));
+ decl = start_var_decl (objc_class_type, buf);
+ OBJCMETA (decl, objc_meta, meta_class_ref);
+ return decl;
+}
+
+/* This routine builds a class refs entry for each class name used.
+ Initially, a (static-ref, IDENT) tuple is added to the list. The
+ ident is replaced with address of the class metadata (of type
+ 'Class') in the output routine. */
+
+static GTY (()) VEC (ident_data_tuple, gc) * classrefs;
+
+static tree
+objc_v2_get_class_reference (tree ident)
+{
+ tree decl;
+ ident_data_tuple e;
+ if (classrefs)
+ {
+ int count;
+ ident_data_tuple *ref;
+ FOR_EACH_VEC_ELT (ident_data_tuple, classrefs, count, ref)
+ {
+ if (ref->ident == ident)
+ {
+ if (!ref->data)
+ ref->data = build_v2_class_reference_decl (ident);
+ return ref->data;
+ }
+ }
+ }
+ else
+ /* Somewhat arbitrary initial provision. */
+ classrefs = VEC_alloc (ident_data_tuple, gc, 16);
+
+ /* We come here if we don't find the entry - or if the table was yet
+ to be created. */
+ decl = build_v2_class_reference_decl (ident);
+ e.ident = ident;
+ e.data = decl;
+ VEC_safe_push (ident_data_tuple, gc, classrefs, &e);
+ return decl;
+}
+
+static tree
+next_runtime_abi_02_get_class_reference (tree ident)
+{
+ if (!flag_zero_link)
+ return objc_v2_get_class_reference (ident);
+ else
+ {
+ /* We fall back to using objc_getClass (). */
+ VEC(tree,gc) *vec = VEC_alloc (tree, gc, 1);
+ tree t;
+ /* ??? add_class_reference (ident); - is pointless, since the
+ system lib does not export the equivalent symbols. Maybe we
+ need to build a class ref anyway. */
+ t = my_build_string_pointer (IDENTIFIER_LENGTH (ident) + 1,
+ IDENTIFIER_POINTER (ident));
+ VEC_quick_push (tree, vec, t);
+ t = build_function_call_vec (input_location, objc_get_class_decl,
+ vec, NULL);
+ VEC_free (tree, gc, vec);
+ return t;
+ }
+}
+
+/* Used by get_arg_type_list.
+ Return the types for receiver & _cmd at the start of a method
+ argument list. context is either METHOD_DEF or METHOD_REF, saying
+ whether we are trying to define a method or call one. superflag
+ says this is for a send to super. meth may be NULL, in the case
+ that there is no prototype. */
+
+static tree
+next_runtime_abi_02_get_arg_type_list_base (tree meth, int context, int superflag)
+{
+ tree arglist;
+
+ /* Receiver type. */
+ if (superflag)
+ arglist = build_tree_list (NULL_TREE, objc_super_type);
+ else if (context == METHOD_DEF && TREE_CODE (meth) == INSTANCE_METHOD_DECL)
+ arglist = build_tree_list (NULL_TREE, objc_instance_type);
+ else
+ arglist = build_tree_list (NULL_TREE, objc_object_type);
+
+ /* Selector type - will eventually change to `int'. */
+ chainon (arglist, build_tree_list (NULL_TREE,
+ (superflag ? objc_v2_super_selector_type
+ : objc_v2_selector_type)));
+ return arglist;
+}
+
+/* TODO: Merge this with the message refs. */
+static tree
+build_selector_reference_decl (tree ident)
+{
+ tree decl;
+ char *t, buf[BUFSIZE];
+
+ snprintf (buf, BUFSIZE, "_OBJC_SelRef_%s", IDENTIFIER_POINTER (ident));
+ t = buf;
+ while (*t)
+ {
+ if (*t==':')
+ *t = '$'; /* Underscore would clash between foo:bar and foo_bar. */
+ t++;
+ }
+ decl = start_var_decl (objc_selector_type, buf);
+ OBJCMETA (decl, objc_meta, meta_sel_refs);
+ return decl;
+}
+
+static tree
+next_runtime_abi_02_build_selector_reference (location_t loc ATTRIBUTE_UNUSED,
+ tree ident,
+ tree proto ATTRIBUTE_UNUSED)
+{
+ tree *chain = &sel_ref_chain;
+ tree expr;
+
+ while (*chain)
+ {
+ if (TREE_VALUE (*chain) == ident)
+ return TREE_PURPOSE (*chain);
+
+ chain = &TREE_CHAIN (*chain);
+ }
+
+ expr = build_selector_reference_decl (ident);
+ *chain = tree_cons (expr, ident, NULL_TREE);
+
+ return expr;
+}
+
+/* Declare a variable of type 'struct message_ref_t'. */
+/* This will be finished in build_v2_message_ref_translation_table ().
+ We take an idea from LLVM in making the names a bit more connected
+ and thus the asm more readable. */
+
+static tree
+build_v2_message_reference_decl (tree sel_name, tree message_func_ident)
+{
+ tree decl;
+ char buf[BUFSIZE], *t;
+ int offset = 12;
+
+ /* Skip past the objc_msgSend it's the same for all... */
+ if (IDENTIFIER_POINTER (message_func_ident)[offset] == '_')
+ offset++;
+
+ snprintf (buf, BUFSIZE, "_OBJC_MsgRef_%s_%s",
+ &(IDENTIFIER_POINTER (message_func_ident)[offset]),
+ IDENTIFIER_POINTER (sel_name));
+ t = buf;
+ while (*t)
+ {
+ if (*t==':')
+ *t = '$'; /* Underscore would clash between foo:bar and foo_bar. */
+ t++;
+ }
+ decl = start_var_decl (objc_v2_message_ref_template, buf);
+ OBJCMETA (decl, objc_meta, meta_mref);
+ return decl;
+}
+
+typedef struct GTY(()) msgref_entry {
+ tree func;
+ tree selname;
+ tree refdecl;
+} msgref_entry;
+DEF_VEC_O(msgref_entry);
+DEF_VEC_ALLOC_O(msgref_entry, gc);
+
+static GTY (()) VEC (msgref_entry, gc) * msgrefs;
+
+/* Build the list of (objc_msgSend_fixup_xxx, selector name), used
+ later on to initialize the table of 'struct message_ref_t'
+ elements. */
+
+static tree
+build_v2_selector_messenger_reference (tree sel_name, tree message_func_decl)
+{
+ tree decl;
+ msgref_entry e;
+ if (msgrefs)
+ {
+ int count;
+ msgref_entry *ref;
+ FOR_EACH_VEC_ELT (msgref_entry, msgrefs, count, ref)
+ if (ref->func == message_func_decl && ref->selname == sel_name)
+ return ref->refdecl;
+ }
+ else
+ /* Somewhat arbitrary initial provision. */
+ msgrefs = VEC_alloc (msgref_entry, gc, 32);
+
+ /* We come here if we don't find a match or at the start. */
+ decl = build_v2_message_reference_decl (sel_name,
+ DECL_NAME (message_func_decl));
+ e.func = message_func_decl;
+ e.selname = sel_name;
+ e.refdecl = decl;
+ VEC_safe_push (msgref_entry, gc, msgrefs, &e);
+ return decl;
+}
+
+static tree
+build_v2_protocollist_ref_decl (tree protocol)
+{
+ tree decl;
+ tree protocol_ident = PROTOCOL_NAME (protocol);
+ char buf[BUFSIZE];
+
+ snprintf (buf, BUFSIZE, "_OBJC_ProtocolRef_%s",
+ IDENTIFIER_POINTER (protocol_ident));
+ /* TODO: other compiler versions make these hidden & weak. */
+ decl = create_global_decl (objc_protocol_type, buf);
+ /* Let optimizer know that this decl is not removable. */
+ DECL_PRESERVE_P (decl) = 1;
+ OBJCMETA (decl, objc_meta, meta_proto_ref);
+ return decl;
+}
+
+typedef struct GTY(()) prot_list_entry {
+ tree id;
+ tree refdecl;
+} prot_list_entry;
+DEF_VEC_O(prot_list_entry);
+DEF_VEC_ALLOC_O(prot_list_entry, gc);
+static GTY (()) VEC (prot_list_entry, gc) * protrefs;
+
+static tree
+objc_v2_get_protocol_reference (tree ident)
+{
+ tree decl;
+ prot_list_entry e;
+ if (protrefs)
+ {
+ int count;
+ prot_list_entry *ref;
+ FOR_EACH_VEC_ELT (prot_list_entry, protrefs, count, ref)
+ {
+ if (ref->id == ident)
+ {
+ if (!ref->refdecl)
+ ref->refdecl = build_v2_protocollist_ref_decl (ident);
+ return ref->refdecl;
+ }
+ }
+ }
+ else
+ /* Somewhat arbitrary initial provision. */
+ protrefs = VEC_alloc (prot_list_entry, gc, 32);
+
+ /* We come here if we don't find the entry - or if the table was yet
+ to be created. */
+ decl = build_v2_protocollist_ref_decl (ident);
+ e.id = ident;
+ e.refdecl = decl;
+ VEC_safe_push (prot_list_entry, gc, protrefs, &e);
+ return decl;
+}
+
+static tree
+next_runtime_abi_02_get_protocol_reference (location_t loc ATTRIBUTE_UNUSED,
+ tree p)
+{
+ if (!PROTOCOL_FORWARD_DECL (p))
+ PROTOCOL_FORWARD_DECL (p) = next_runtime_abi_02_protocol_decl (p);
+
+ return objc_v2_get_protocol_reference (p);
+}
+
+/* This routine returns the ivar declaration, if component is a valid
+ ivar field; NULL_TREE otherwise. On finding an ivar, it also
+ returns the class name in CLASS. */
+
+static tree
+objc_is_ivar (tree expr, tree component, tree *klass)
+{
+ tree field = NULL_TREE;
+ tree basetype = TYPE_MAIN_VARIANT (TREE_TYPE (expr));
+
+ if (TREE_CODE (basetype) == RECORD_TYPE
+ && TYPE_HAS_OBJC_INFO (basetype) && TYPE_OBJC_INTERFACE (basetype))
+ {
+ *klass = lookup_interface (OBJC_TYPE_NAME (basetype));
+ if (*klass)
+ {
+ do
+ {
+ tree ivar_chain = CLASS_RAW_IVARS (*klass);
+ if (ivar_chain)
+ {
+ field = is_ivar (ivar_chain, component);
+ if (field != NULL_TREE)
+ break;
+ }
+ *klass = lookup_interface (CLASS_SUPER_NAME (*klass));
+ }
+ while (*klass);
+ }
+ }
+ return field;
+}
+
+static void
+create_ivar_offset_name (char *buf, tree class_name, tree field_decl)
+{
+ tree fname = DECL_NAME (field_decl);
+
+ sprintf (buf, "OBJC_IVAR_$_%s.%s", IDENTIFIER_POINTER (class_name),
+ IDENTIFIER_POINTER (fname));
+ return;
+}
+
+/* This routine generates new abi's ivar reference tree. It amounts
+ to generating *(TYPE*)((char*)pObj + OFFSET_IVAR) when we normally
+ generate pObj->IVAR. OFFSET_IVAR is an 'extern' variable holding
+ the offset for 'IVAR' field. TYPE is type of IVAR field. */
+
+static tree
+objc_v2_build_ivar_ref (tree datum, tree component)
+{
+ tree field, ref, class_name, offset, ftype, expr;
+ char var_offset_name[512];
+
+ field = objc_is_ivar (datum, component, &class_name);
+ if (!field)
+ return NULL_TREE;
+
+ /* This routine only handles non-bitfield fields */
+ /* DECL_INITIAL macro is set to width of bitfield and can be relied
+ on to check for bitfield ivars. Note that I cannot rely on
+ DECL_BIT_FIELD macro because it is only set when the whole struct
+ is seen (at finish_struct) and not when the ivar chain is
+ built. */
+ if (DECL_INITIAL (field))
+ return NULL_TREE;
+
+ create_ivar_offset_name (var_offset_name, CLASS_NAME (class_name), field);
+
+ offset = create_extern_decl (TREE_TYPE (size_zero_node), var_offset_name);
+
+ ftype = TREE_TYPE (field);
+
+ /* (char*)datum */
+ expr = build_c_cast (input_location,
+ string_type_node, build_fold_addr_expr (datum));
+
+ /* (char*)datum + offset */
+ expr = fold_build2_loc (input_location,
+ POINTER_PLUS_EXPR, string_type_node, expr, offset);
+
+ /* (ftype*)((char*)datum + offset) */
+ expr = build_c_cast (input_location, build_pointer_type (ftype), expr);
+
+ /* Finally: *(ftype*)((char*)datum + offset) */
+ ref = build_indirect_ref (input_location, expr, RO_UNARY_STAR);
+
+ /* We must set type of the resulting expression to be the same as
+ the field type. This is because, build_indirect_ref (...)
+ rebuilds the type which may result in lost information; as in the
+ case of protocol-qualified types (id <protocol> ). */
+ TREE_TYPE (ref) = ftype;
+
+ if (TREE_READONLY (datum) || TREE_READONLY (field))
+ TREE_READONLY (ref) = 1;
+
+ if (TREE_THIS_VOLATILE (datum) || TREE_THIS_VOLATILE (field))
+ TREE_THIS_VOLATILE (ref) = 1;
+
+ if (TREE_DEPRECATED (field))
+ warn_deprecated_use (field, NULL_TREE);
+
+ return ref;
+}
+
+/* IVAR refs are made via an externally referenceable offset and built
+ on the fly. That is, unless they refer to (private) fields in the
+ class stucture. */
+static tree
+next_runtime_abi_02_build_ivar_ref (location_t loc ATTRIBUTE_UNUSED,
+ tree base, tree id)
+{
+ tree ivar;
+ if ((ivar = objc_v2_build_ivar_ref (base, id)))
+ return ivar;
+ return objc_build_component_ref (base, id);
+}
+
+/* [super ...] references are listed here (and built into a table at
+ meta -data emit time). */
+static tree
+build_v2_superclass_ref_decl (tree ident, bool inst)
+{
+ tree decl;
+ char buf[BUFSIZE];
+
+ snprintf (buf, BUFSIZE, "_OBJC_%sSuperRef_%s", (inst?"":"Meta"),
+ IDENTIFIER_POINTER (ident));
+ decl = start_var_decl (objc_class_type, buf);
+ OBJCMETA (decl, objc_meta, meta_superclass_ref);
+ return decl;
+}
+
+static GTY (()) VEC (ident_data_tuple, gc) * class_super_refs;
+static GTY (()) VEC (ident_data_tuple, gc) * metaclass_super_refs;
+
+static tree
+next_runtime_abi_02_get_class_super_ref (location_t loc ATTRIBUTE_UNUSED,
+ struct imp_entry *imp, bool inst_meth)
+{
+ tree decl;
+ ident_data_tuple e;
+ tree id = CLASS_NAME (imp->imp_context);
+ VEC (ident_data_tuple, gc) *list = inst_meth ? class_super_refs
+ : metaclass_super_refs;
+
+ if (list)
+ {
+ int count;
+ ident_data_tuple *ref;
+ FOR_EACH_VEC_ELT (ident_data_tuple, list, count, ref)
+ {
+ if (ref->ident == id)
+ {
+ if (!ref->data)
+ ref->data = build_v2_superclass_ref_decl (id, inst_meth);
+ return ref->data;
+ }
+ }
+ }
+ else
+ {
+ /* Somewhat arbitrary initial provision. */
+ if (inst_meth)
+ list = class_super_refs = VEC_alloc (ident_data_tuple, gc, 16);
+ else
+ list = metaclass_super_refs = VEC_alloc (ident_data_tuple, gc, 16);
+ }
+ /* We come here if we don't find the entry - or if the table was yet
+ to be created. */
+ decl = build_v2_superclass_ref_decl (id, inst_meth);
+ e.ident = id;
+ e.data = decl;
+ VEC_safe_push (ident_data_tuple, gc, list, &e);
+ return decl;
+}
+
+static tree
+next_runtime_abi_02_get_category_super_ref (location_t loc ATTRIBUTE_UNUSED,
+ struct imp_entry *imp, bool inst_meth)
+{
+ /* ??? is this OK when zero-link = true? */
+ tree super_name = CLASS_SUPER_NAME (imp->imp_template);
+ tree super_class;
+
+ if (!flag_zero_link)
+ {
+ super_class = objc_get_class_reference (CLASS_NAME (imp->imp_template));
+
+ if (!inst_meth)
+
+ /* If we are in a class method, we must retrieve the
+ _metaclass_ for the current class, pointed at by the
+ class's "isa" pointer. The following assumes that "isa" is
+ the first ivar in a class (which it must be). */
+ super_class =
+ build_indirect_ref (input_location,
+ build_c_cast (input_location,
+ build_pointer_type (objc_class_type),
+ super_class),
+ RO_UNARY_STAR);
+ return super_class;
+ }
+ /* ??? Do we need to add the class ref anway for zero-link? */
+ /* else do it the slow way. */
+ super_class = (inst_meth ? objc_get_class_decl : objc_get_meta_class_decl);
+ /* assemble_external (super_class); */
+ super_name = my_build_string_pointer (IDENTIFIER_LENGTH (super_name) + 1,
+ IDENTIFIER_POINTER (super_name));
+ /* super_class = objc_get{Meta}Class("CLASS_SUPER_NAME"); */
+ return build_function_call (input_location,
+ super_class,
+ build_tree_list (NULL_TREE, super_name));
+}
+
+static tree
+next_runtime_abi_02_receiver_is_class_object (tree receiver)
+{
+ if (TREE_CODE (receiver) == VAR_DECL
+ && IS_CLASS (TREE_TYPE (receiver))
+ && classrefs
+ && VEC_length (ident_data_tuple, classrefs))
+ {
+ int count;
+ ident_data_tuple *ref;
+ /* The receiver is a variable created by build_class_reference_decl. */
+ FOR_EACH_VEC_ELT (ident_data_tuple, classrefs, count, ref)
+ if (ref->data == receiver)
+ return ref->ident;
+ }
+ return NULL_TREE;
+}
+
+/* Assign all arguments in VALUES which have side-effect to a
+ temporary and replaced that argument in VALUES list with the
+ temporary. TYPELIST is the list of argument types. */
+
+static tree
+objc_copy_to_temp_side_effect_params (tree typelist, tree values)
+{
+ tree valtail, typetail;
+ /* Skip over receiver and the &_msf_ref types. */
+ gcc_assert (TREE_CHAIN (typelist));
+ typetail = TREE_CHAIN (TREE_CHAIN (typelist));
+
+ for (valtail = values; valtail;
+ valtail = TREE_CHAIN (valtail), typetail = TREE_CHAIN (typetail))
+ {
+ tree value = TREE_VALUE (valtail);
+ tree type = typetail ? TREE_VALUE (typetail) : NULL_TREE;
+ if (type == NULL_TREE)
+ break;
+ if (!TREE_SIDE_EFFECTS (value))
+ continue;
+ /* To prevent re-evaluation. */
+ value = save_expr (value);
+ add_stmt (value);
+ TREE_VALUE (valtail) = value;
+ }
+ return values;
+}
+
+/* Build the new abi's messaging library call. It looks like:
+ (*_msg.messenger) (receiver, &_msg, ...) */
+
+static tree
+build_v2_build_objc_method_call (int super_flag, tree method_prototype,
+ tree lookup_object, tree selector,
+ tree method_params,
+ bool check_for_nil)
+{
+ tree ret_val;
+ tree sender, rcv_p, t;
+ tree ret_type
+ = (method_prototype
+ ? TREE_VALUE (TREE_TYPE (method_prototype))
+ : objc_object_type);
+ tree method_param_types = get_arg_type_list (method_prototype,
+ METHOD_REF, super_flag);
+
+ tree ftype = build_function_type (ret_type, method_param_types);
+ tree sender_cast;
+
+ if (method_prototype && METHOD_TYPE_ATTRIBUTES (method_prototype))
+ ftype = build_type_attribute_variant (
+ ftype, METHOD_TYPE_ATTRIBUTES (method_prototype));
+
+ sender_cast = build_pointer_type (ftype);
+
+ if (check_for_nil)
+ method_params = objc_copy_to_temp_side_effect_params (method_param_types,
+ method_params);
+
+ /* Get &message_ref_t.messenger. */
+ sender = build_c_cast (input_location,
+ build_pointer_type (super_flag
+ ? objc_v2_super_imp_type
+ : objc_v2_imp_type),
+ selector);
+
+ sender = build_indirect_ref (input_location, sender, RO_UNARY_STAR);
+
+ rcv_p = (super_flag ? objc_super_type : objc_object_type);
+
+ lookup_object = build_c_cast (input_location, rcv_p, lookup_object);
+
+ /* Use SAVE_EXPR to avoid evaluating the receiver twice. */
+ lookup_object = save_expr (lookup_object);
+
+ method_params = tree_cons (NULL_TREE, lookup_object,
+ tree_cons (NULL_TREE, selector,
+ method_params));
+ t = build3 (OBJ_TYPE_REF, sender_cast, sender, lookup_object, size_zero_node);
+ ret_val = build_function_call (input_location, t, method_params);
+ if (check_for_nil)
+ {
+ /* receiver != nil ? ret_val : 0 */
+ tree ftree;
+ tree ifexp;
+
+ if (TREE_CODE (ret_type) == RECORD_TYPE
+ || TREE_CODE (ret_type) == UNION_TYPE)
+ {
+ VEC(constructor_elt,gc) *rtt = NULL;
+ /* ??? CHECKME. hmmm..... think we need something more
+ here. */
+ CONSTRUCTOR_APPEND_ELT (rtt, NULL_TREE, NULL_TREE);
+ ftree = objc_build_constructor (ret_type, rtt);
+ }
+ else
+ ftree = fold_convert (ret_type, integer_zero_node);
+
+ ifexp = build_binary_op (input_location, NE_EXPR,
+ lookup_object,
+ fold_convert (rcv_p, integer_zero_node), 1);
+
+#ifdef OBJCPLUS
+ ret_val = build_conditional_expr (ifexp, ret_val, ftree, tf_warning_or_error);
+#else
+ /* ??? CHECKME. */
+ ret_val = build_conditional_expr (input_location,
+ ifexp, 1,
+ ret_val, NULL_TREE,
+ ftree, NULL_TREE);
+#endif
+ }
+ return ret_val;
+}
+
+static tree
+next_runtime_abi_02_build_objc_method_call (location_t loc,
+ tree method_prototype,
+ tree receiver,
+ tree rtype,
+ tree sel_name,
+ tree method_params,
+ int super)
+{
+ tree ret_type, selector;
+ tree message_func_decl;
+ bool check_for_nil = flag_objc_nilcheck;
+
+ ret_type = (method_prototype ?
+ TREE_VALUE (TREE_TYPE (method_prototype)) :
+ objc_object_type);
+
+ /* Do we need to check for nil receivers ? */
+ /* For now, message sent to classes need no nil check. In the
+ future, class declaration marked as weak_import must be nil
+ checked. */
+ if (super
+ || (TREE_CODE (receiver) == VAR_DECL
+ && TREE_TYPE (receiver) == objc_class_type))
+ check_for_nil = false;
+
+ if (!targetm.calls.struct_value_rtx (0, 0)
+ && (TREE_CODE (ret_type) == RECORD_TYPE
+ || TREE_CODE (ret_type) == UNION_TYPE)
+ && targetm.calls.return_in_memory (ret_type, 0))
+ {
+ if (super)
+ message_func_decl = umsg_id_super2_stret_fixup_decl;
+ else
+ message_func_decl = objc_is_id (rtype)
+ ? umsg_id_stret_fixup_decl
+ : umsg_stret_fixup_decl;
+ }
+ else
+ {
+ if (super)
+ message_func_decl = umsg_id_super2_fixup_decl;
+ else
+ message_func_decl = objc_is_id (rtype)
+ ? umsg_id_fixup_decl
+ : umsg_fixup_decl;
+ }
+
+ selector = build_v2_selector_messenger_reference (sel_name,
+ message_func_decl);
+
+ /* selector = &_msg; */
+ selector = build_unary_op (loc, ADDR_EXPR, selector, 0);
+
+ selector = build_c_cast (loc, (super ? objc_v2_super_selector_type
+ : objc_v2_selector_type),
+ selector);
+
+ /* (*_msg.messenger) (receiver, &_msg, ...); */
+ return build_v2_build_objc_method_call (super, method_prototype,
+ receiver, selector,
+ method_params, check_for_nil);
+}
+
+/* NOTE --- Constant String Class Stuff --- */
+
+static bool
+next_runtime_abi_02_setup_const_string_class_decl (void)
+{
+ if (!constant_string_global_id)
+ {
+ /* Hopefully, this should not represent a serious limitation. */
+ char buf[BUFSIZE];
+ snprintf (buf, BUFSIZE, "OBJC_CLASS_$_%s", constant_string_class_name);
+ constant_string_global_id = get_identifier (buf);
+ }
+
+ string_class_decl = lookup_name (constant_string_global_id);
+
+ /* In OBJC2 abi, constant string class reference refers to class
+ name for NSConstantString class. This declaration may not be
+ available yet (in fact it is not in most cases). So, declare an
+ extern OBJC_CLASS_$_NSConstantString in its place. */
+ if (!string_class_decl)
+ string_class_decl =
+ create_extern_decl (objc_v2_class_template,
+ IDENTIFIER_POINTER (constant_string_global_id));
+
+ return (string_class_decl != NULL_TREE);
+}
+
+static tree
+next_runtime_abi_02_build_const_string_constructor (location_t loc, tree string,
+ int length)
+{
+ tree constructor, fields, var;
+ VEC(constructor_elt,gc) *v = NULL;
+
+ /* NeXT: (NSConstantString *) & ((__builtin_ObjCString) { isa, string, length }) */
+ fields = TYPE_FIELDS (internal_const_str_type);
+ CONSTRUCTOR_APPEND_ELT (v, fields,
+ build_unary_op (loc, ADDR_EXPR, string_class_decl, 0));
+
+ fields = DECL_CHAIN (fields);
+ CONSTRUCTOR_APPEND_ELT (v, fields,
+ build_unary_op (loc, ADDR_EXPR, string, 1));
+
+ /* ??? check if this should be long. */
+ fields = DECL_CHAIN (fields);
+ CONSTRUCTOR_APPEND_ELT (v, fields, build_int_cst (NULL_TREE, length));
+ constructor = objc_build_constructor (internal_const_str_type, v);
+
+ var = build_decl (input_location, CONST_DECL, NULL, TREE_TYPE (constructor));
+ DECL_INITIAL (var) = constructor;
+ TREE_STATIC (var) = 1;
+ DECL_CONTEXT (var) = NULL;
+ OBJCMETA (var, objc_meta, meta_const_str);
+ return var;
+}
+
+/* NOTE --- NeXT V2 Metadata templates --- */
+
+/* This routine builds the following type:
+ struct _prop_t
+ {
+ const char * const name; // property name
+ const char * const attributes; // comma-delimited, encoded,
+ // property attributes
+ };
+*/
+
+static tree
+build_v2_property_template (void)
+{
+ tree prop_record;
+ tree decls, *chain = NULL;
+
+ prop_record = objc_start_struct (get_identifier ("_prop_t"));
+ /* const char * name */
+ decls = add_field_decl (string_type_node, "name", &chain);
+
+ /* const char * attribute */
+ add_field_decl (string_type_node, "attribute", &chain);
+
+ objc_finish_struct (prop_record, decls);
+ return prop_record;
+}
+
+/* struct ivar_t
+ {
+ unsigned long int *offset;
+ char *name;
+ char *type;
+ uint32_t alignment;
+ uint32_t size;
+ };
+*/
+
+static tree
+build_v2_ivar_t_template (void)
+{
+ tree objc_ivar_id, objc_ivar_record;
+ tree decls, *chain = NULL;
+
+ objc_ivar_id = get_identifier ("_ivar_t");
+ objc_ivar_record = objc_start_struct (objc_ivar_id);
+
+ /* unsigned long int *offset; */
+ decls = add_field_decl (build_pointer_type
+ (TREE_TYPE (size_zero_node)), "offset", &chain);
+
+ /* char *name; */
+ add_field_decl (string_type_node, "name", &chain);
+
+ /* char *type; */
+ add_field_decl (string_type_node, "type", &chain);
+
+ /* uint32_t alignment; */
+ add_field_decl (integer_type_node, "alignment", &chain);
+
+ /* uint32_t size; */
+ add_field_decl (integer_type_node, "size", &chain);
+
+ objc_finish_struct (objc_ivar_record, decls);
+ return objc_ivar_record;
+}
+
+static void
+build_metadata_templates (void)
+{
+
+ if (!objc_method_template)
+ objc_method_template = build_method_template ();
+
+ if (!objc_v2_property_template)
+ objc_v2_property_template = build_v2_property_template ();
+
+ if (!objc_v2_ivar_template)
+ objc_v2_ivar_template = build_v2_ivar_t_template ();
+
+}
+
+/* NOTE --- Output NeXT V2 Metadata --- */
+
+/* Routine builds name of Interface's main meta-data of type class_t. */
+
+static char *
+objc_build_internal_classname (tree ident, bool metaclass)
+{
+ static char string[512];
+ snprintf (string, 512, "%s_%s", metaclass ? "OBJC_METACLASS_$"
+ : "OBJC_CLASS_$",
+ IDENTIFIER_POINTER (ident));
+ return string;
+}
+
+/* Build the name for object of type struct class_ro_t */
+
+static const char *
+newabi_append_ro (const char *name)
+{
+ char *dollar;
+ char *p;
+ static char string[BUFSIZE];
+ dollar = strchr (name, '$');
+ gcc_assert (dollar);
+ p = string;
+ *p = '_'; p++;
+ strncpy (p, name, (int)(dollar - name));
+ p += (int)(dollar - name);
+ sprintf (p, "RO_%s", dollar);
+ return string;
+}
+
+/* Build the struct message_ref_t msg =
+ {objc_msgSend_fixup_xxx, @selector(func)}
+ table. */
+
+static
+void build_v2_message_ref_translation_table (void)
+{
+ int count;
+ msgref_entry *ref;
+
+ if (!msgrefs || !VEC_length (msgref_entry,msgrefs))
+ return;
+
+ FOR_EACH_VEC_ELT (msgref_entry, msgrefs, count, ref)
+ {
+ VEC(constructor_elt,gc) *initializer;
+ tree expr, constructor;
+ tree struct_type = TREE_TYPE (ref->refdecl);
+ location_t loc = DECL_SOURCE_LOCATION (ref->refdecl);
+
+ initializer = NULL;
+ /* First 'IMP messenger' field... */
+ expr = build_unary_op (loc, ADDR_EXPR, ref->func, 0);
+ expr = convert (objc_v2_imp_type, expr);
+ CONSTRUCTOR_APPEND_ELT (initializer, NULL_TREE, expr);
+
+ /* ... then 'SEL name' field. */
+ expr = build_selector (ref->selname);
+ CONSTRUCTOR_APPEND_ELT (initializer, NULL_TREE, expr);
+ constructor = objc_build_constructor (struct_type, initializer);
+ finish_var_decl (ref->refdecl, constructor);
+ }
+}
+
+/* Build decl = initializer; for each externally visible class
+ reference. */
+
+static void
+build_v2_classrefs_table (void)
+{
+ int count;
+ ident_data_tuple *ref;
+
+ if (!classrefs || !VEC_length (ident_data_tuple, classrefs))
+ return;
+
+ FOR_EACH_VEC_ELT (ident_data_tuple, classrefs, count, ref)
+ {
+ tree expr = ref->ident;
+ tree decl = ref->data;
+ /* Interface with no implementation and yet one of its messages
+ has been used. Need to generate a full address-of tree for it
+ here. */
+ if (TREE_CODE (expr) == IDENTIFIER_NODE)
+ {
+ const char *name = objc_build_internal_classname (expr, false);
+ expr = create_extern_decl (objc_v2_class_template, name);
+ expr = convert (objc_class_type, build_fold_addr_expr (expr));
+ }
+ /* The runtime wants this, even if it appears unused, so we must force the
+ output.
+ DECL_PRESERVE_P (decl) = 1; */
+ finish_var_decl (decl, expr);
+ }
+}
+
+/* Build decl = initializer; for each externally visible super class
+ reference. */
+
+static void
+build_v2_super_classrefs_table (bool metaclass)
+{
+ int count;
+ ident_data_tuple *ref;
+ VEC (ident_data_tuple, gc) *list = metaclass ? metaclass_super_refs
+ : class_super_refs;
+
+ if (!list || !VEC_length (ident_data_tuple, list))
+ return;
+
+ FOR_EACH_VEC_ELT (ident_data_tuple, list, count, ref)
+ {
+ tree expr = ref->ident;
+ tree decl = ref->data;
+ /* Interface with no implementation and yet one of its messages
+ has been used. Need to generate a full address-of tree for it
+ here. */
+ if (TREE_CODE (expr) == IDENTIFIER_NODE)
+ {
+ const char * name = objc_build_internal_classname (expr, metaclass);
+ expr = create_extern_decl (objc_v2_class_template, name);
+ expr = convert (objc_class_type, build_fold_addr_expr (expr));
+ }
+ finish_var_decl (decl, expr);
+ }
+}
+
+/* Add the global class meta-data declaration to the list which later
+ on ends up in the __class_list section. */
+
+static GTY(()) VEC(tree,gc) *class_list;
+
+static void
+objc_v2_add_to_class_list (tree global_class_decl)
+{
+ if (!class_list)
+ class_list = VEC_alloc (tree, gc, imp_count?imp_count:1);
+ VEC_safe_push (tree, gc, class_list, global_class_decl);
+}
+
+static GTY(()) VEC(tree,gc) *nonlazy_class_list;
+
+/* Add the global class meta-data declaration to the list which later
+ on ends up in the __nonlazy_class section. */
+
+static void
+objc_v2_add_to_nonlazy_class_list (tree global_class_decl)
+{
+ if (!nonlazy_class_list)
+ nonlazy_class_list = VEC_alloc (tree, gc, imp_count?imp_count:1);
+ VEC_safe_push (tree, gc, nonlazy_class_list, global_class_decl);
+}
+
+static GTY(()) VEC(tree,gc) *category_list;
+
+/* Add the category meta-data declaration to the list which later on
+ ends up in the __nonlazy_category section. */
+
+static void
+objc_v2_add_to_category_list (tree decl)
+{
+ if (!category_list)
+ category_list = VEC_alloc (tree, gc, cat_count?cat_count:1);
+ VEC_safe_push (tree, gc, category_list, decl);
+}
+
+static GTY(()) VEC(tree,gc) *nonlazy_category_list;
+
+/* Add the category meta-data declaration to the list which later on
+ ends up in the __category_list section. */
+
+static void
+objc_v2_add_to_nonlazy_category_list (tree decl)
+{
+ if (!nonlazy_category_list)
+ nonlazy_category_list = VEC_alloc (tree, gc, cat_count?cat_count:1);
+ VEC_safe_push (tree, gc, nonlazy_category_list, decl);
+}
+
+static bool
+has_load_impl (tree clsmeth)
+{
+ while (clsmeth)
+ {
+ tree id = METHOD_SEL_NAME (clsmeth);
+ if (IDENTIFIER_LENGTH (id) == 4
+ && strncmp (IDENTIFIER_POINTER (id), "load", 4) == 0)
+ return true;
+ clsmeth = DECL_CHAIN (clsmeth);
+ }
+
+ return false;
+}
+
+/* Build a __{class,category}_list section table containing address of
+ all @implemented {class,category} meta-data. */
+
+static void
+build_v2_address_table (VEC(tree,gc) *src, const char *nam, tree attr)
+{
+ int count=0;
+ tree type, decl, expr;
+ VEC(constructor_elt,gc) *initlist = NULL;
+
+ if (!src || !VEC_length(tree,src))
+ return;
+
+ FOR_EACH_VEC_ELT (tree, src, count, decl)
+ {
+#ifndef OBJCPLUS
+ tree purpose = build_int_cst (NULL_TREE, count);
+#else
+ tree purpose = NULL_TREE;
+#endif
+ expr = convert (objc_class_type, build_fold_addr_expr (decl));
+ CONSTRUCTOR_APPEND_ELT (initlist, purpose, expr);
+ }
+ gcc_assert (count > 0);
+ type = build_array_type (objc_class_type,
+ build_index_type (build_int_cst (NULL_TREE, count - 1)));
+ decl = start_var_decl (type, nam);
+ /* The runtime wants this, even if it appears unused, so we must
+ force the output. */
+ DECL_PRESERVE_P (decl) = 1;
+ expr = objc_build_constructor (type, initlist);
+ OBJCMETA (decl, objc_meta, attr);
+ finish_var_decl (decl, expr);
+}
+
+/* Build decl = initializer; for each protocol referenced in
+ @protocol(MyProt) expression. Refs as built in the entry section
+ above. */
+
+static void
+build_v2_protocol_list_translation_table (void)
+{
+ int count;
+ prot_list_entry *ref;
+
+ if (!protrefs)
+ return;
+
+ FOR_EACH_VEC_ELT (prot_list_entry, protrefs, count, ref)
+ {
+ char buf[BUFSIZE];
+ tree expr;
+ gcc_assert (TREE_CODE (ref->id) == PROTOCOL_INTERFACE_TYPE);
+ snprintf (buf, BUFSIZE, "_OBJC_Protocol_%s",
+ IDENTIFIER_POINTER (PROTOCOL_NAME (ref->id)));
+ expr = start_var_decl (objc_v2_protocol_template, buf);
+ expr = convert (objc_protocol_type, build_fold_addr_expr (expr));
+ finish_var_decl (ref->refdecl, expr);
+ }
+ /* TODO: Maybe we could explicitly delete the vec. now? */
+}
+
+static GTY (()) VEC (prot_list_entry, gc) * protlist;
+
+/* Add the local protocol meta-data declaration to the list which
+ later on ends up in the __protocol_list section. */
+
+static void
+objc_add_to_protocol_list (tree protocol_interface_decl, tree protocol_decl)
+{
+ prot_list_entry e;
+ if (!protlist)
+ /* Arbitrary init count. */
+ protlist = VEC_alloc (prot_list_entry, gc, 32);
+ e.id = protocol_interface_decl;
+ e.refdecl = protocol_decl;
+ VEC_safe_push (prot_list_entry, gc, protlist, &e);
+}
+
+/* Build the __protocol_list section table containing address of all
+ generate protocol_t meta-data. */
+
+static void
+build_v2_protocol_list_address_table (void)
+{
+ int count;
+ prot_list_entry *ref;
+ if (!protlist || !VEC_length (prot_list_entry, protlist))
+ return;
+
+ FOR_EACH_VEC_ELT (prot_list_entry, protlist, count, ref)
+ {
+ tree decl, expr;
+ char buf[BUFSIZE];
+ gcc_assert (ref->id && TREE_CODE (ref->id) == PROTOCOL_INTERFACE_TYPE);
+ snprintf (buf, BUFSIZE, "_OBJC_LabelProtocol_%s",
+ IDENTIFIER_POINTER (PROTOCOL_NAME (ref->id)));
+ decl = create_global_decl (objc_protocol_type, buf);
+ expr = convert (objc_protocol_type, build_fold_addr_expr (ref->refdecl));
+ OBJCMETA (decl, objc_meta, meta_label_protocollist);
+ finish_var_decl (decl, expr);
+ }
+
+ /* TODO: delete the vec. */
+ /* TODO: upgrade to the the clang/llvm hidden version. */
+}
+
+/* This routine declares a variable to hold meta data for 'struct
+ protocol_list_t'. */
+
+static tree
+generate_v2_protocol_list (tree i_or_p, tree klass_ctxt)
+{
+ tree refs_decl, lproto, e, plist, ptempl_p_t;
+ int size = 0;
+ VEC(constructor_elt,gc) *initlist = NULL;
+ char buf[BUFSIZE];
+
+ if (TREE_CODE (i_or_p) == CLASS_INTERFACE_TYPE
+ || TREE_CODE (i_or_p) == CATEGORY_INTERFACE_TYPE)
+ plist = CLASS_PROTOCOL_LIST (i_or_p);
+ else if (TREE_CODE (i_or_p) == PROTOCOL_INTERFACE_TYPE)
+ plist = PROTOCOL_LIST (i_or_p);
+ else
+ gcc_unreachable ();
+
+ /* Compute size. */
+ for (lproto = plist; lproto; lproto = TREE_CHAIN (lproto))
+ if (TREE_CODE (TREE_VALUE (lproto)) == PROTOCOL_INTERFACE_TYPE
+ && PROTOCOL_FORWARD_DECL (TREE_VALUE (lproto)))
+ size++;
+
+ /* Build initializer. */
+
+ ptempl_p_t = build_pointer_type (objc_v2_protocol_template);
+ e = build_int_cst (ptempl_p_t, size);
+ CONSTRUCTOR_APPEND_ELT (initlist, NULL_TREE, e);
+
+ for (lproto = plist; lproto; lproto = TREE_CHAIN (lproto))
+ {
+ tree pval = TREE_VALUE (lproto);
+
+ if (TREE_CODE (pval) == PROTOCOL_INTERFACE_TYPE
+ && PROTOCOL_FORWARD_DECL (pval))
+ {
+ tree fwref = PROTOCOL_FORWARD_DECL (pval);
+ location_t loc = DECL_SOURCE_LOCATION (fwref) ;
+ e = build_unary_op (loc, ADDR_EXPR, fwref, 0);
+ CONSTRUCTOR_APPEND_ELT (initlist, NULL_TREE, e);
+ }
+ }
+
+ /* static struct protocol_list_t *list[size]; */
+
+ switch (TREE_CODE (i_or_p))
+ {
+ case PROTOCOL_INTERFACE_TYPE:
+ snprintf (buf, BUFSIZE, "_OBJC_ProtocolRefs_%s",
+ IDENTIFIER_POINTER (PROTOCOL_NAME (i_or_p)));
+ break;
+ case CLASS_INTERFACE_TYPE:
+ snprintf (buf, BUFSIZE, "_OBJC_ClassProtocols_%s",
+ IDENTIFIER_POINTER (CLASS_NAME (i_or_p)));
+ break;
+ case CATEGORY_INTERFACE_TYPE:
+ snprintf (buf, BUFSIZE, "_OBJC_CategoryProtocols_%s_%s",
+ IDENTIFIER_POINTER (CLASS_NAME (klass_ctxt)),
+ IDENTIFIER_POINTER (CLASS_SUPER_NAME (klass_ctxt)));
+ break;
+ default:
+ gcc_unreachable ();
+ }
+
+ refs_decl = start_var_decl (build_sized_array_type (ptempl_p_t, size+1),
+ buf);
+ /* ObjC2 puts all these in the base section. */
+ OBJCMETA (refs_decl, objc_meta, meta_base);
+ DECL_PRESERVE_P (refs_decl) = 1;
+ finish_var_decl (refs_decl,
+ objc_build_constructor (TREE_TYPE (refs_decl),initlist));
+ return refs_decl;
+}
+
+/* This routine builds one 'struct method_t' initializer list. Note
+ that the old ABI is supposed to build 'struct objc_method' which
+ has 3 fields, but it does not build the initialization expression
+ for 'method_imp' which for protocols is NULL any way. To be
+ consistant with declaration of 'struct method_t', in the new ABI we
+ set the method_t.imp to NULL. */
+
+static tree
+build_v2_descriptor_table_initializer (tree type, tree entries)
+{
+ VEC(constructor_elt,gc) *initlist = NULL;
+ do
+ {
+ VEC(constructor_elt,gc) *eltlist = NULL;
+ CONSTRUCTOR_APPEND_ELT (eltlist, NULL_TREE,
+ build_selector (METHOD_SEL_NAME (entries)));
+ CONSTRUCTOR_APPEND_ELT (eltlist, NULL_TREE,
+ add_objc_string (METHOD_ENCODING (entries),
+ meth_var_types));
+ CONSTRUCTOR_APPEND_ELT (eltlist, NULL_TREE, null_pointer_node);
+
+ CONSTRUCTOR_APPEND_ELT (initlist, NULL_TREE,
+ objc_build_constructor (type, eltlist));
+ entries = TREE_CHAIN (entries);
+ }
+ while (entries);
+
+ return objc_build_constructor (build_array_type (type, 0), initlist);
+}
+
+/* struct method_list_t
+ {
+ uint32_t entsize;
+ uint32_t method_count;
+ struct objc_method method_list[method_count];
+ }; */
+
+static tree
+build_v2_method_list_template (tree list_type, int size)
+{
+ tree method_list_t_record;
+ tree array_type, decls, *chain = NULL;
+
+ method_list_t_record = objc_start_struct (NULL_TREE);
+
+ /* uint32_t const entsize; */
+ decls = add_field_decl (integer_type_node, "entsize", &chain);
+
+ /* int method_count; */
+ add_field_decl (integer_type_node, "method_count", &chain);
+
+ /* struct objc_method method_list[]; */
+ array_type = build_sized_array_type (list_type, size);
+ add_field_decl (array_type, "method_list", &chain);
+
+ objc_finish_struct (method_list_t_record, decls);
+ return method_list_t_record;
+}
+
+/* Note, as above that we are building to the objc_method_template
+ which has the *imp field. ABI0/1 build with
+ objc_method_prototype_template which is missing this field. */
+static tree
+generate_v2_meth_descriptor_table (tree chain, tree protocol,
+ const char *prefix, tree attr)
+{
+ tree method_list_template, initlist, decl, methods;
+ int size, entsize;
+ VEC(constructor_elt,gc) *v = NULL;
+ char buf[BUFSIZE];
+
+ if (!chain || !prefix)
+ return NULL_TREE;
+
+ methods = chain;
+ size = 0;
+ while (methods)
+ {
+ if (! METHOD_ENCODING (methods))
+ METHOD_ENCODING (methods) = encode_method_prototype (methods);
+ methods = TREE_CHAIN (methods);
+ size++;
+ }
+
+ gcc_assert (size);
+ method_list_template = build_v2_method_list_template (objc_method_template,
+ size);
+ snprintf (buf, BUFSIZE, "%s_%s", prefix,
+ IDENTIFIER_POINTER (PROTOCOL_NAME (protocol)));
+
+ decl = start_var_decl (method_list_template, buf);
+
+ entsize = TREE_INT_CST_LOW (TYPE_SIZE_UNIT (objc_method_template));
+ CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, build_int_cst (NULL_TREE, entsize));
+ CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, build_int_cst (NULL_TREE, size));
+ initlist =
+ build_v2_descriptor_table_initializer (objc_method_template,
+ chain);
+ CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, initlist);
+ /* Get into the right section. */
+ OBJCMETA (decl, objc_meta, attr);
+ finish_var_decl (decl, objc_build_constructor (method_list_template, v));
+ return decl;
+}
+
+/* This routine builds the initializer list to initialize the 'struct
+ _prop_t prop_list[]' field of 'struct _prop_list_t' meta-data. */
+
+static tree
+build_v2_property_table_initializer (tree type, tree context)
+{
+ tree x;
+ VEC(constructor_elt,gc) *inits = NULL;
+ if (TREE_CODE (context) == PROTOCOL_INTERFACE_TYPE)
+ x = CLASS_PROPERTY_DECL (context);
+ else
+ x = IMPL_PROPERTY_DECL (context);
+
+ for (; x; x = TREE_CHAIN (x))
+ {
+ VEC(constructor_elt,gc) *elemlist = NULL;
+ /* NOTE! sections where property name/attribute go MUST change
+ later. */
+ tree attribute, name_ident = PROPERTY_NAME (x);
+
+ CONSTRUCTOR_APPEND_ELT (elemlist, NULL_TREE,
+ add_objc_string (name_ident, prop_names_attr));
+
+ attribute = objc_v2_encode_prop_attr (x);
+ CONSTRUCTOR_APPEND_ELT (elemlist, NULL_TREE,
+ add_objc_string (attribute, prop_names_attr));
+
+ CONSTRUCTOR_APPEND_ELT (inits, NULL_TREE,
+ objc_build_constructor (type, elemlist));
+ }
+
+ return objc_build_constructor (build_array_type (type, 0),inits);
+}
+
+/* This routine builds the following type:
+ struct _prop_list_t
+ {
+ uint32_t entsize; // sizeof (struct _prop_t)
+ uint32_t prop_count;
+ struct _prop_t prop_list [prop_count];
+ }
+*/
+
+static tree
+build_v2_property_list_template (tree list_type, int size)
+{
+ tree property_list_t_record;
+ tree array_type, decls, *chain = NULL;
+
+ /* anonymous. */
+ property_list_t_record = objc_start_struct (NULL_TREE);
+
+ /* uint32_t const entsize; */
+ decls = add_field_decl (integer_type_node, "entsize", &chain);
+
+ /* int prop_count; */
+ add_field_decl (integer_type_node, "prop_count", &chain);
+
+ /* struct _prop_t prop_list[]; */
+ array_type = build_sized_array_type (list_type, size);
+ add_field_decl (array_type, "prop_list", &chain);
+
+ objc_finish_struct (property_list_t_record, decls);
+ return property_list_t_record;
+}
+
+/* Top-level routine to generate property tables for each
+ implementation. */
+
+static tree
+generate_v2_property_table (tree context, tree klass_ctxt)
+{
+ tree x, decl, initlist, property_list_template;
+ bool is_proto = false;
+ VEC(constructor_elt,gc) *inits = NULL;
+ int init_val, size = 0;
+ char buf[BUFSIZE];
+
+ if (context)
+ {
+ gcc_assert (TREE_CODE (context) == PROTOCOL_INTERFACE_TYPE);
+ x = CLASS_PROPERTY_DECL (context);
+ is_proto = true;
+ }
+ else
+ x = IMPL_PROPERTY_DECL (klass_ctxt);
+
+ for (; x; x = TREE_CHAIN (x))
+ size++;
+
+ if (size == 0)
+ return NULL_TREE;
+
+ property_list_template =
+ build_v2_property_list_template (objc_v2_property_template,
+ size);
+
+ initlist = build_v2_property_table_initializer (objc_v2_property_template,
+ is_proto ? context
+ : klass_ctxt);
+
+ init_val = TREE_INT_CST_LOW (TYPE_SIZE_UNIT (objc_v2_property_template));
+ if (is_proto)
+ snprintf (buf, BUFSIZE, "_OBJC_ProtocolPropList_%s",
+ IDENTIFIER_POINTER (PROTOCOL_NAME (context)));
+ else
+ snprintf (buf, BUFSIZE, "_OBJC_ClassPropList_%s",
+ IDENTIFIER_POINTER (CLASS_NAME (klass_ctxt)));
+
+ decl = start_var_decl (property_list_template, buf);
+
+ CONSTRUCTOR_APPEND_ELT (inits, NULL_TREE,
+ build_int_cst (NULL_TREE, init_val));
+ CONSTRUCTOR_APPEND_ELT (inits, NULL_TREE,
+ build_int_cst (NULL_TREE, size));
+ CONSTRUCTOR_APPEND_ELT (inits, NULL_TREE, initlist);
+
+ OBJCMETA (decl, objc_meta, meta_base);
+ finish_var_decl (decl, objc_build_constructor (TREE_TYPE (decl), inits));
+ return decl;
+}
+
+static tree
+build_v2_protocol_initializer (tree type, tree protocol_name, tree protocol_list,
+ tree inst_methods, tree class_methods,
+ tree opt_ins_meth, tree opt_cls_meth,
+ tree property_list)
+{
+ tree expr, ttyp;
+ location_t loc;
+ VEC(constructor_elt,gc) *inits = NULL;
+
+ /* TODO: find a better representation of location from the inputs. */
+ loc = UNKNOWN_LOCATION;
+
+ /* This is NULL for the new ABI. */
+ CONSTRUCTOR_APPEND_ELT (inits, NULL_TREE,
+ convert (objc_object_type, null_pointer_node));
+
+ CONSTRUCTOR_APPEND_ELT (inits, NULL_TREE, protocol_name);
+ CONSTRUCTOR_APPEND_ELT (inits, NULL_TREE, protocol_list);
+
+ ttyp = objc_method_proto_list_ptr;
+ if (inst_methods)
+ expr = convert (ttyp, build_unary_op (loc, ADDR_EXPR, inst_methods, 0));
+ else
+ expr = convert (ttyp, null_pointer_node);
+ CONSTRUCTOR_APPEND_ELT (inits, NULL_TREE, expr);
+
+ if (class_methods)
+ expr = convert (ttyp, build_unary_op (loc, ADDR_EXPR, class_methods, 0));
+ else
+ expr = convert (ttyp, null_pointer_node);
+ CONSTRUCTOR_APPEND_ELT (inits, NULL_TREE, expr);
+
+ if (opt_ins_meth)
+ expr = convert (ttyp, build_unary_op (loc, ADDR_EXPR, opt_ins_meth, 0));
+ else
+ expr = convert (ttyp, null_pointer_node);
+ CONSTRUCTOR_APPEND_ELT (inits, NULL_TREE, expr);
+
+ if (opt_cls_meth)
+ expr = convert (ttyp, build_unary_op (loc, ADDR_EXPR, opt_cls_meth, 0));
+ else
+ expr = convert (ttyp, null_pointer_node);
+ CONSTRUCTOR_APPEND_ELT (inits, NULL_TREE, expr);
+
+ ttyp = objc_prop_list_ptr;
+ if (property_list)
+ expr = convert (ttyp, build_unary_op (loc, ADDR_EXPR, property_list, 0));
+ else
+ expr = convert (ttyp, null_pointer_node);
+ CONSTRUCTOR_APPEND_ELT (inits, NULL_TREE, expr);
+
+ /* const uint32_t size; = sizeof(struct protocol_t) */
+ expr = build_int_cst (integer_type_node,
+ TREE_INT_CST_LOW (TYPE_SIZE_UNIT (objc_v2_protocol_template)));
+ CONSTRUCTOR_APPEND_ELT (inits, NULL_TREE, expr);
+ /* const uint32_t flags; = 0 */
+ CONSTRUCTOR_APPEND_ELT (inits, NULL_TREE, integer_zero_node);
+
+ return objc_build_constructor (type, inits);
+}
+
+/* Main routine to build all meta data for all protocols used in a
+ translation unit. */
+
+static void
+generate_v2_protocols (void)
+{
+ tree p ;
+ bool some = false;
+
+ if (!protocol_chain)
+ return ;
+
+ /* If a protocol was directly referenced, pull in indirect
+ references. */
+ for (p = protocol_chain; p; p = TREE_CHAIN (p))
+ if (PROTOCOL_FORWARD_DECL (p) && PROTOCOL_LIST (p))
+ generate_protocol_references (PROTOCOL_LIST (p));
+
+ for (p = protocol_chain; p; p = TREE_CHAIN (p))
+ {
+ location_t loc;
+ tree inst_meth, class_meth, opt_inst_meth, opt_class_meth, props;
+ tree decl, initlist, protocol_name_expr, refs_decl, refs_expr;
+
+ /* If protocol wasn't referenced, don't generate any code. */
+ decl = PROTOCOL_FORWARD_DECL (p);
+
+ if (!decl)
+ continue;
+
+ loc = DECL_SOURCE_LOCATION (decl);
+ some = true;
+
+ inst_meth =
+ generate_v2_meth_descriptor_table (PROTOCOL_NST_METHODS (p), p,
+ "_OBJC_ProtocolInstanceMethods",
+ meta_proto_nst_meth);
+
+ class_meth =
+ generate_v2_meth_descriptor_table (PROTOCOL_CLS_METHODS (p), p,
+ "_OBJC_ProtocolClassMethods",
+ meta_proto_cls_meth);
+
+ opt_inst_meth =
+ generate_v2_meth_descriptor_table (PROTOCOL_OPTIONAL_NST_METHODS (p), p,
+ "_OBJC_OptProtocolInstMethods",
+ meta_proto_nst_meth);
+
+ opt_class_meth =
+ generate_v2_meth_descriptor_table (PROTOCOL_OPTIONAL_CLS_METHODS (p), p,
+ "_OBJC_OptProtocolClassMethods",
+ meta_proto_cls_meth);
+
+ if (PROTOCOL_LIST (p))
+ refs_decl = generate_v2_protocol_list (p, NULL_TREE);
+ else
+ refs_decl = 0;
+
+ /* static struct objc_protocol _OBJC_Protocol_<mumble>; */
+ protocol_name_expr = add_objc_string (PROTOCOL_NAME (p), class_names);
+
+ if (refs_decl)
+ refs_expr = convert (build_pointer_type (objc_v2_protocol_template),
+ build_unary_op (loc, ADDR_EXPR, refs_decl, 0));
+ else
+ refs_expr = build_int_cst (NULL_TREE, 0);
+
+ props = generate_v2_property_table (p, NULL_TREE);
+
+ initlist = build_v2_protocol_initializer (TREE_TYPE (decl),
+ protocol_name_expr, refs_expr,
+ inst_meth, class_meth,
+ opt_inst_meth, opt_class_meth,
+ props);
+ finish_var_decl (decl, initlist);
+ objc_add_to_protocol_list (p, decl);
+ }
+
+ if (some)
+ {
+ /* Make sure we get the Protocol class linked in - reference
+ it... */
+ p = objc_v2_get_class_reference (get_identifier (PROTOCOL_OBJECT_CLASS_NAME));
+ /* ... but since we don't specifically use the reference... we
+ need to force it. */
+ DECL_PRESERVE_P (p) = 1;
+ }
+}
+
+static tree
+generate_v2_dispatch_table (tree chain, const char *name, tree attr)
+{
+ tree decl, method_list_template, initlist;
+ VEC(constructor_elt,gc) *v = NULL;
+ int size, init_val;
+
+ if (!chain || !name || !(size = list_length (chain)))
+ return NULL_TREE;
+
+ method_list_template
+ = build_v2_method_list_template (objc_method_template, size);
+ initlist
+ = build_dispatch_table_initializer (objc_method_template, chain);
+
+ decl = start_var_decl (method_list_template, name);
+
+ init_val = TREE_INT_CST_LOW (TYPE_SIZE_UNIT (objc_method_template));
+ CONSTRUCTOR_APPEND_ELT (v, NULL_TREE,
+ build_int_cst (integer_type_node, init_val));
+ CONSTRUCTOR_APPEND_ELT (v, NULL_TREE,
+ build_int_cst (integer_type_node, size));
+ CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, initlist);
+
+ OBJCMETA (decl, objc_meta, attr);
+ finish_var_decl (decl,
+ objc_build_constructor (TREE_TYPE (decl), v));
+ return decl;
+}
+
+/* Init a category. */
+static tree
+build_v2_category_initializer (tree type, tree cat_name, tree class_name,
+ tree inst_methods, tree class_methods,
+ tree protocol_list, tree property_list,
+ location_t loc)
+{
+ tree expr, ltyp;
+ VEC(constructor_elt,gc) *v = NULL;
+
+ CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, cat_name);
+ CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, class_name);
+
+ ltyp = objc_method_list_ptr;
+ if (inst_methods)
+ expr = convert (ltyp, build_unary_op (loc, ADDR_EXPR, inst_methods, 0));
+ else
+ expr = convert (ltyp, null_pointer_node);
+ CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, expr);
+
+ if (class_methods)
+ expr = convert (ltyp, build_unary_op (loc, ADDR_EXPR, class_methods, 0));
+ else
+ expr = convert (ltyp, null_pointer_node);
+ CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, expr);
+
+ /* protocol_list = */
+ ltyp = build_pointer_type (objc_v2_protocol_template);
+ if (protocol_list)
+ expr = convert (ltyp, build_unary_op (loc, ADDR_EXPR, protocol_list, 0));
+ else
+ expr = convert (ltyp, null_pointer_node);
+ CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, expr);
+
+ ltyp = objc_prop_list_ptr;
+ if (property_list)
+ expr = convert (ltyp, build_unary_op (loc, ADDR_EXPR, property_list, 0));
+ else
+ expr = convert (ltyp, null_pointer_node);
+ CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, expr);
+
+ return objc_build_constructor (type, v);
+}
+
+/* static struct category_t _OBJC_CATEGORY_$_<name> = { ... }; */
+
+static void
+generate_v2_category (struct imp_entry *impent)
+{
+ tree initlist, cat_name_expr, class_name_expr;
+ tree protocol_decl, category, props, t;
+ tree inst_methods = NULL_TREE, class_methods = NULL_TREE;
+ tree cat = impent->imp_context;
+ tree cat_decl = impent->class_decl;
+ location_t loc;
+ char buf[BUFSIZE];
+
+ loc = DECL_SOURCE_LOCATION (cat_decl);
+
+ /* ??? not sure this is really necessary, the following references should
+ force appropriate linkage linkage...
+ -- but ... ensure a reference to the class... */
+ t = objc_v2_get_class_reference (CLASS_NAME (cat));
+ /* ... which we ignore so force it out.. */
+ DECL_PRESERVE_P (t) = 1;
+
+ snprintf (buf, BUFSIZE, "OBJC_CLASS_$_%s", IDENTIFIER_POINTER (CLASS_NAME (cat)));
+ class_name_expr = create_extern_decl (objc_v2_class_template, buf);
+ class_name_expr = build_fold_addr_expr (class_name_expr);
+
+ cat_name_expr = add_objc_string (CLASS_SUPER_NAME (cat), class_names);
+ category = lookup_category (impent->imp_template, CLASS_SUPER_NAME (cat));
+
+ if (category && CLASS_PROTOCOL_LIST (category))
+ {
+ generate_protocol_references (CLASS_PROTOCOL_LIST (category));
+ protocol_decl = generate_v2_protocol_list (category, cat);
+ }
+ else
+ protocol_decl = NULL_TREE;
+
+/* decl = update_var_decl(impent->class_decl); */
+
+ props = generate_v2_property_table (NULL_TREE, cat);
+
+ if (CLASS_NST_METHODS (cat))
+ {
+ snprintf (buf, BUFSIZE, "_OBJC_CategoryInstanceMethods_%s_%s",
+ IDENTIFIER_POINTER (CLASS_NAME (cat)),
+ IDENTIFIER_POINTER (CLASS_SUPER_NAME (cat)));
+ inst_methods = generate_v2_dispatch_table (CLASS_NST_METHODS (cat), buf,
+ meta_cati_meth);
+ }
+
+ if (CLASS_CLS_METHODS (cat))
+ {
+ snprintf (buf, BUFSIZE, "_OBJC_CategoryClassMethods_%s_%s",
+ IDENTIFIER_POINTER (CLASS_NAME (cat)),
+ IDENTIFIER_POINTER (CLASS_SUPER_NAME (cat)));
+ class_methods = generate_v2_dispatch_table (CLASS_CLS_METHODS (cat), buf,
+ meta_catc_meth);
+ }
+
+ initlist = build_v2_category_initializer (TREE_TYPE (cat_decl),
+ cat_name_expr, class_name_expr,
+ inst_methods, class_methods,
+ protocol_decl, props, loc);
+
+ finish_var_decl (cat_decl, initlist);
+ impent->class_decl = cat_decl;
+
+ /* Add to list of pointers in __category_list section. */
+ objc_v2_add_to_category_list (cat_decl);
+ if (has_load_impl (CLASS_CLS_METHODS (impent->imp_context)))
+ objc_v2_add_to_nonlazy_category_list (cat_decl);
+}
+
+/* This routine declares a variable to hold the offset for ivar
+ FIELD_DECL. Variable name is .objc_ivar.ClassName.IvarName. */
+
+typedef struct GTY(()) ivarref_entry
+{
+ tree decl;
+ tree offset;
+} ivarref_entry;
+DEF_VEC_O(ivarref_entry);
+DEF_VEC_ALLOC_O(ivarref_entry, gc);
+
+static GTY (()) VEC (ivarref_entry, gc) * ivar_offset_refs;
+
+static tree
+ivar_offset_ref (tree class_name, tree field_decl)
+{
+ tree decl, field_decl_id;
+ ivarref_entry e;
+ bool global_var;
+ char buf[512];
+
+ create_ivar_offset_name (buf, class_name, field_decl);
+ field_decl_id = get_identifier (buf);
+
+ if (ivar_offset_refs)
+ {
+ int count;
+ ivarref_entry *ref;
+ FOR_EACH_VEC_ELT (ivarref_entry, ivar_offset_refs, count, ref)
+ if (DECL_NAME (ref->decl) == field_decl_id)
+ return ref->decl;
+ }
+ else
+ /* Somewhat arbitrary initial provision. */
+ ivar_offset_refs = VEC_alloc (ivarref_entry, gc, 32);
+
+ /* We come here if we don't find a match or at the start. */
+ global_var = (TREE_PUBLIC (field_decl) || TREE_PROTECTED (field_decl));
+ if (global_var)
+ decl = create_global_decl (TREE_TYPE (size_zero_node), buf);
+ else
+ decl = create_hidden_decl (TREE_TYPE (size_zero_node), buf);
+
+ /* Make sure it ends up in an ObjC section. */
+ OBJCMETA (decl, objc_meta, meta_base);
+
+ e.decl = decl;
+ e.offset = byte_position (field_decl);
+ VEC_safe_push (ivarref_entry, gc, ivar_offset_refs, &e);
+ return decl;
+}
+
+/* This routine builds initializer-list needed to initialize 'struct
+ ivar_t list[count] of 'struct ivar_list_t' meta data. TYPE is
+ 'struct ivar_t' and FIELD_DECL is list of ivars for the target
+ class. */
+
+static tree
+build_v2_ivar_list_initializer (tree class_name, tree type, tree field_decl)
+{
+ VEC(constructor_elt,gc) *inits = NULL;
+
+ do
+ {
+ VEC(constructor_elt,gc) *ivar = NULL;
+ int val;
+ tree id;
+
+ /* Unnamed bitfields are ignored. */
+ if (!DECL_NAME (field_decl))
+ {
+ field_decl = DECL_CHAIN (field_decl);
+ continue;
+ }
+
+ /* Set offset. */
+ CONSTRUCTOR_APPEND_ELT (ivar, NULL_TREE,
+ build_unary_op (input_location,
+ ADDR_EXPR,
+ ivar_offset_ref (class_name,
+ field_decl), 0));
+
+ /* Set name. */
+ CONSTRUCTOR_APPEND_ELT (ivar, NULL_TREE,
+ add_objc_string (DECL_NAME (field_decl),
+ meth_var_names));
+
+ /* Set type. */
+ encode_field_decl (field_decl,
+ obstack_object_size (&util_obstack),
+ OBJC_ENCODE_DONT_INLINE_DEFS);
+ /* Null terminate string. */
+ obstack_1grow (&util_obstack, 0);
+ id = add_objc_string (get_identifier (XOBFINISH (&util_obstack, char *)),
+ meth_var_types);
+ CONSTRUCTOR_APPEND_ELT (ivar, NULL_TREE, id);
+ obstack_free (&util_obstack, util_firstobj);
+
+ /* Set alignment. */
+ val = DECL_ALIGN_UNIT (field_decl);
+ val = exact_log2 (val);
+ CONSTRUCTOR_APPEND_ELT (ivar, NULL_TREE,
+ build_int_cst (integer_type_node, val));
+
+ /* Set size. */
+ val = TREE_INT_CST_LOW (DECL_SIZE_UNIT (field_decl));
+ CONSTRUCTOR_APPEND_ELT (ivar, NULL_TREE,
+ build_int_cst (integer_type_node, val));
+
+ CONSTRUCTOR_APPEND_ELT (inits, NULL_TREE,
+ objc_build_constructor (type, ivar));
+
+ do
+ field_decl = DECL_CHAIN (field_decl);
+ while (field_decl && TREE_CODE (field_decl) != FIELD_DECL);
+ }
+ while (field_decl);
+
+ return objc_build_constructor (build_array_type (type, 0), inits);
+}
+
+/*
+ struct ivar_list_t
+ {
+ uint32 entsize;
+ uint32 count;
+ struct iver_t list[count];
+ };
+*/
+
+static tree
+build_v2_ivar_list_t_template (tree list_type, int size)
+{
+ tree objc_ivar_list_record;
+ tree decls, *chain = NULL;
+
+ /* Anonymous. */
+ objc_ivar_list_record = objc_start_struct (NULL_TREE);
+
+ /* uint32 entsize; */
+ decls = add_field_decl (integer_type_node, "entsize", &chain);
+
+ /* uint32 count; */
+ add_field_decl (integer_type_node, "count", &chain);
+
+ /* struct objc_ivar ivar_list[]; */
+ add_field_decl (build_sized_array_type (list_type, size),
+ "list", &chain);
+
+ objc_finish_struct (objc_ivar_list_record, decls);
+ return objc_ivar_list_record;
+}
+
+/* This routine declares a static variable of type 'struct
+ ivar_list_t' and initializes it. chain is the source of the data,
+ name is the name for the var. attr is the meta-data section tag
+ attribute. templ is the implementation template for the class. */
+
+static tree
+generate_v2_ivars_list (tree chain, const char *name, tree attr, tree templ)
+{
+ tree decl, initlist, ivar_list_template;
+ VEC(constructor_elt,gc) *inits = NULL;
+ int size, ivar_t_size;
+
+ if (!chain || !name || !(size = ivar_list_length (chain)))
+ return NULL_TREE;
+
+ generating_instance_variables = 1;
+ ivar_list_template = build_v2_ivar_list_t_template (objc_v2_ivar_template,
+ size);
+
+ initlist = build_v2_ivar_list_initializer (CLASS_NAME (templ),
+ objc_v2_ivar_template, chain);
+ ivar_t_size = TREE_INT_CST_LOW (TYPE_SIZE_UNIT (objc_v2_ivar_template));
+
+ decl = start_var_decl (ivar_list_template, name);
+ CONSTRUCTOR_APPEND_ELT (inits, NULL_TREE,
+ build_int_cst (integer_type_node, ivar_t_size));
+ CONSTRUCTOR_APPEND_ELT (inits, NULL_TREE,
+ build_int_cst (integer_type_node, size));
+ CONSTRUCTOR_APPEND_ELT (inits, NULL_TREE, initlist);
+ OBJCMETA (decl, objc_meta, attr);
+ finish_var_decl (decl, objc_build_constructor (TREE_TYPE (decl), inits));
+ generating_instance_variables = 0;
+ return decl;
+}
+
+/* Routine to build initializer list to initialize objects of type
+ struct class_t; */
+
+static tree
+build_v2_class_t_initializer (tree type, tree isa, tree superclass,
+ tree ro, tree cache, tree vtable)
+{
+ VEC(constructor_elt,gc) *initlist = NULL;
+
+ /* isa */
+ CONSTRUCTOR_APPEND_ELT (initlist, NULL_TREE, isa);
+
+ /* superclass */
+ CONSTRUCTOR_APPEND_ELT (initlist, NULL_TREE, superclass);
+
+ /* cache */
+ if (cache)
+ CONSTRUCTOR_APPEND_ELT (initlist, NULL_TREE, cache);
+ else
+ CONSTRUCTOR_APPEND_ELT (initlist, NULL_TREE, null_pointer_node);
+
+ /* vtable */
+ if (vtable)
+ CONSTRUCTOR_APPEND_ELT (initlist, NULL_TREE, vtable);
+ else
+ CONSTRUCTOR_APPEND_ELT (initlist, NULL_TREE, null_pointer_node);
+
+ /* ro */
+ CONSTRUCTOR_APPEND_ELT (initlist, NULL_TREE, ro);
+
+ return objc_build_constructor (type, initlist);
+}
+
+/* Routine to build object of struct class_ro_t { ... }; */
+
+static tree
+build_v2_class_ro_t_initializer (tree type, tree name,
+ unsigned int flags, unsigned int instanceStart,
+ unsigned int instanceSize,
+ tree ivarLayout,
+ tree baseMethods, tree baseProtocols,
+ tree ivars, tree property_list)
+{
+ tree expr, unsigned_char_star, ltyp;
+ location_t loc;
+ VEC(constructor_elt,gc) *initlist = NULL;
+
+ /* TODO: fish out the real location from somewhere. */
+ loc = UNKNOWN_LOCATION;
+
+ /* flags */
+ CONSTRUCTOR_APPEND_ELT (initlist, NULL_TREE,
+ build_int_cst (integer_type_node, flags));
+
+ /* instanceStart */
+ CONSTRUCTOR_APPEND_ELT (initlist, NULL_TREE,
+ build_int_cst (integer_type_node, instanceStart));
+
+ /* instanceSize */
+ CONSTRUCTOR_APPEND_ELT (initlist, NULL_TREE,
+ build_int_cst (integer_type_node, instanceSize));
+
+ /* This ABI is currently only used on m64 NeXT. We always
+ explicitly declare the alignment padding. */
+ /* reserved, pads alignment. */
+ CONSTRUCTOR_APPEND_ELT (initlist, NULL_TREE,
+ build_int_cst (integer_type_node, 0));
+
+ /* ivarLayout */
+ unsigned_char_star = build_pointer_type (unsigned_char_type_node);
+ if (ivarLayout)
+ expr = ivarLayout;
+ else
+ expr = convert (unsigned_char_star, null_pointer_node);
+ CONSTRUCTOR_APPEND_ELT (initlist, NULL_TREE, expr);
+
+ /* name */
+ CONSTRUCTOR_APPEND_ELT (initlist, NULL_TREE, default_conversion (name));
+
+ /* baseMethods */
+ ltyp = objc_method_list_ptr;
+ if (baseMethods)
+ expr = convert (ltyp, build_unary_op (loc, ADDR_EXPR, baseMethods, 0));
+ else
+ expr = convert (ltyp, null_pointer_node);
+ CONSTRUCTOR_APPEND_ELT (initlist, NULL_TREE, expr);
+
+ /* baseProtocols */
+ ltyp = build_pointer_type (xref_tag (RECORD_TYPE,
+ get_identifier (UTAG_V2_PROTOCOL_LIST)));
+ if (baseProtocols)
+ expr = convert (ltyp, build_unary_op (loc, ADDR_EXPR, baseProtocols, 0));
+ else
+ expr = convert (ltyp, null_pointer_node);
+ CONSTRUCTOR_APPEND_ELT (initlist, NULL_TREE, expr);
+
+ /* ivars */
+ ltyp = objc_v2_ivar_list_ptr;
+ if (ivars)
+ expr = convert (ltyp, build_unary_op (loc, ADDR_EXPR, ivars, 0));
+ else
+ expr = convert (ltyp, null_pointer_node);
+ CONSTRUCTOR_APPEND_ELT (initlist, NULL_TREE, expr);
+
+ /* TODO: We don't yet have the weak/strong stuff... */
+ /* weakIvarLayout */
+ CONSTRUCTOR_APPEND_ELT (initlist, NULL_TREE,
+ convert (unsigned_char_star, null_pointer_node));
+
+ /* property list */
+ ltyp = objc_prop_list_ptr;
+ if (property_list)
+ expr = convert (ltyp, build_unary_op (loc, ADDR_EXPR, property_list, 0));
+ else
+ expr = convert (ltyp, null_pointer_node);
+ CONSTRUCTOR_APPEND_ELT (initlist, NULL_TREE, expr);
+ return objc_build_constructor (type, initlist);
+}
+
+static GTY (()) VEC (ident_data_tuple, gc) * ehtype_list;
+
+/* Record a name as needing a catcher. */
+static void
+objc_v2_add_to_ehtype_list (tree name)
+{
+ ident_data_tuple e;
+ if (ehtype_list)
+ {
+ int count = 0;
+ ident_data_tuple *ref;
+
+ FOR_EACH_VEC_ELT (ident_data_tuple, ehtype_list, count, ref)
+ if (ref->ident == name)
+ return; /* Already entered. */
+ }
+ else
+ /* Arbitrary initial count. */
+ ehtype_list = VEC_alloc (ident_data_tuple, gc, 8);
+
+ /* Not found, or new list. */
+ e.ident = name;
+ e.data = NULL_TREE;
+ VEC_safe_push (ident_data_tuple, gc, ehtype_list, &e);
+}
+
+static void
+generate_v2_class_structs (struct imp_entry *impent)
+{
+ tree decl, name_expr, initlist, protocol_decl, metaclass_decl, class_decl;
+ tree field, firstIvar, chain;
+ tree class_superclass_expr, metaclass_superclass_expr, props;
+ /* TODO: figure out how to compute this. */
+ tree ivarLayout = NULL_TREE;
+ tree my_super_id = NULL_TREE, root_expr = NULL_TREE;
+ tree inst_methods = NULL_TREE, class_methods = NULL_TREE;
+ tree inst_ivars = NULL_TREE, class_ivars = NULL_TREE;
+ location_t loc;
+ char buf[BUFSIZE];
+ unsigned int instanceStart, instanceSize;
+ unsigned int flags = 0x01; /* RO_META */
+ int cls_flags = impent->has_cxx_cdtors ? OBJC2_CLS_HAS_CXX_STRUCTORS
+ : 0 ;
+
+ class_decl = impent->class_decl;
+ metaclass_decl = impent->meta_decl;
+ loc = DECL_SOURCE_LOCATION (class_decl);
+
+ DECL_EXTERNAL (class_decl) = DECL_EXTERNAL (metaclass_decl) = 0;
+ TREE_PUBLIC (class_decl) = TREE_PUBLIC (metaclass_decl) = 1;
+#ifdef OBJCPLUS
+ gcc_assert (!CP_DECL_CONTEXT (class_decl) || CP_DECL_CONTEXT (class_decl) == global_namespace);
+ gcc_assert (!CP_DECL_CONTEXT (metaclass_decl) || CP_DECL_CONTEXT (metaclass_decl) == global_namespace);
+#endif
+
+ /* Generation of data for meta class. */
+ my_super_id = CLASS_SUPER_NAME (impent->imp_template);
+ if (my_super_id)
+ {
+ /* Compute reference to root's name. For a meta class, "isa" is
+ a reference to the root class name. */
+ tree my_root_id = my_super_id;
+ tree my_root_int, interface;
+ do
+ {
+ my_root_int = lookup_interface (my_root_id);
+
+ if (my_root_int && CLASS_SUPER_NAME (my_root_int))
+ my_root_id = CLASS_SUPER_NAME (my_root_int);
+ else
+ break;
+ }
+ while (1);
+
+ /* {extern} struct class_t OBJC_METACLASS_$_<my_root_int>
+ create extern if not already declared. */
+ snprintf (buf, BUFSIZE, "OBJC_METACLASS_$_%s",
+ IDENTIFIER_POINTER (CLASS_NAME (my_root_int)));
+ root_expr = create_extern_decl (objc_v2_class_template, buf);
+ root_expr = build_fold_addr_expr (root_expr);
+
+ /* Install class `isa' and `super' pointers at runtime. */
+ interface = lookup_interface (my_super_id);
+ gcc_assert (interface);
+ /* Similarly, for OBJC_CLASS_$_<interface>... */
+ snprintf (buf, BUFSIZE, "OBJC_CLASS_$_%s",
+ IDENTIFIER_POINTER (CLASS_NAME (interface)));
+ class_superclass_expr = create_extern_decl (objc_v2_class_template, buf);
+ class_superclass_expr = build_fold_addr_expr (class_superclass_expr);
+ /* ... and for OBJC_METACLASS_$_<interface>. */
+ snprintf (buf, BUFSIZE, "OBJC_METACLASS_$_%s",
+ IDENTIFIER_POINTER (CLASS_NAME (interface)));
+ metaclass_superclass_expr = create_extern_decl (objc_v2_class_template, buf);
+ metaclass_superclass_expr = build_fold_addr_expr (metaclass_superclass_expr);
+ }
+ else
+ {
+ /* Root class. */
+ root_expr = build_unary_op (loc, ADDR_EXPR, metaclass_decl, 0);
+ metaclass_superclass_expr = build_unary_op (loc, ADDR_EXPR, class_decl, 0);
+ class_superclass_expr = build_int_cst (NULL_TREE, 0);
+ flags |= 0x02; /* RO_ROOT: it is also a root meta class. */
+ }
+
+ if (CLASS_PROTOCOL_LIST (impent->imp_template))
+ {
+ generate_protocol_references (CLASS_PROTOCOL_LIST (impent->imp_template));
+ protocol_decl = generate_v2_protocol_list (impent->imp_template,
+ impent->imp_context);
+ }
+ else
+ protocol_decl = 0;
+
+ name_expr = add_objc_string (CLASS_NAME (impent->imp_template),
+ class_names);
+
+ if (CLASS_CLS_METHODS (impent->imp_context))
+ {
+ snprintf (buf, BUFSIZE, "_OBJC_ClassMethods_%s",
+ IDENTIFIER_POINTER (CLASS_NAME (impent->imp_context)));
+ class_methods =
+ generate_v2_dispatch_table (CLASS_CLS_METHODS (impent->imp_context),
+ buf, meta_clac_meth);
+ }
+
+ instanceStart = TREE_INT_CST_LOW (TYPE_SIZE_UNIT (objc_v2_class_template));
+
+ /* Currently there are no class ivars and generation of class
+ variables for the root of the inheritance has been removed. It
+ causes multiple defines if there are two root classes in the
+ link, because each will define its own identically-named offset
+ variable. */
+
+ class_ivars = NULL_TREE;
+ /* TODO: Add total size of class variables when implemented. */
+ instanceSize = TREE_INT_CST_LOW (TYPE_SIZE_UNIT (objc_v2_class_template));
+
+ /* So now build the META CLASS structs. */
+ /* static struct class_ro_t _OBJC_METACLASS_Foo = { ... }; */
+
+ decl = start_var_decl (objc_v2_class_ro_template,
+ newabi_append_ro (IDENTIFIER_POINTER
+ (DECL_NAME (metaclass_decl))));
+
+ /* TODO: ivarLayout needs t be built. */
+ initlist =
+ build_v2_class_ro_t_initializer (TREE_TYPE (decl), name_expr,
+ (flags | cls_flags), instanceStart,
+ instanceSize, ivarLayout,
+ class_methods, protocol_decl,
+ class_ivars, NULL_TREE);
+ /* The ROs sit in the default const section. */
+ OBJCMETA (decl, objc_meta, meta_base);
+ finish_var_decl (decl, initlist);
+
+ /* static struct class_t _OBJC_METACLASS_Foo = { ... }; */
+ initlist =
+ build_v2_class_t_initializer (TREE_TYPE (metaclass_decl),
+ root_expr,
+ metaclass_superclass_expr,
+ build_fold_addr_expr (decl),
+ build_fold_addr_expr (UOBJC_V2_CACHE_decl),
+ build_fold_addr_expr (UOBJC_V2_VTABLE_decl));
+ /* The class section attributes are set when they are created. */
+ finish_var_decl (metaclass_decl, initlist);
+ impent->meta_decl = metaclass_decl;
+
+ /* So now build the CLASS structs. */
+
+ flags = 0x0; /* ... */
+ if (!my_super_id)
+ flags |= 0x02; /* RO_ROOT: this is a root class */
+
+ if (DECL_VISIBILITY (class_decl) == VISIBILITY_HIDDEN)
+ flags |= 0x10; /* RO_HIDDEN, OBJC2_CLS_HIDDEN; */
+
+ if (objc2_objc_exception_attr (impent->imp_template))
+ flags |= 0x20; /* RO_EXCEPTION */
+
+ if (CLASS_NST_METHODS (impent->imp_context))
+ {
+ snprintf (buf, BUFSIZE, "_OBJC_InstanceMethods_%s",
+ IDENTIFIER_POINTER (CLASS_NAME (impent->imp_context)));
+ inst_methods =
+ generate_v2_dispatch_table (CLASS_NST_METHODS (impent->imp_context),
+ buf, meta_clai_meth);
+ }
+
+ /* Sort out the ivars before we try to compute the class sizes. */
+ if ((chain = CLASS_IVARS (impent->imp_template)))
+ {
+ snprintf (buf, BUFSIZE, "_OBJC_InstanceIvars_%s",
+ IDENTIFIER_POINTER (CLASS_NAME (impent->imp_context)));
+ inst_ivars = generate_v2_ivars_list (chain, buf, meta_clai_vars,
+ impent->imp_template);
+ }
+
+ /* Compute instanceStart. */
+ gcc_assert (CLASS_STATIC_TEMPLATE (impent->imp_template));
+ field = TYPE_FIELDS (CLASS_STATIC_TEMPLATE (impent->imp_template));
+ if (my_super_id && field && TREE_CHAIN (field))
+ field = TREE_CHAIN (field);
+
+ firstIvar = field;
+
+ while (firstIvar && TREE_CODE (firstIvar) != FIELD_DECL)
+ firstIvar = TREE_CHAIN (firstIvar);
+
+ gcc_assert (inst_ivars? (firstIvar != NULL_TREE): true);
+
+ /* Compute instanceSize. */
+ while (field && TREE_CHAIN (field)
+ && TREE_CODE (TREE_CHAIN (field)) == FIELD_DECL)
+ field = TREE_CHAIN (field);
+
+ if (field && TREE_CODE (field) == FIELD_DECL)
+ instanceSize = int_byte_position (field) * BITS_PER_UNIT
+ + tree_low_cst (DECL_SIZE (field), 0);
+ else
+ instanceSize = 0;
+ instanceSize /= BITS_PER_UNIT;
+
+ props = generate_v2_property_table (NULL_TREE, impent->imp_context);
+
+ /* If the class has no ivars, instanceStart should be set to the
+ superclass's instanceSize. */
+ instanceStart =
+ (inst_ivars != NULL_TREE) ? (unsigned) int_byte_position (firstIvar)
+ : instanceSize;
+
+ /* static struct class_ro_t _OBJC_CLASS_Foo = { ... }; */
+ decl = start_var_decl (objc_v2_class_ro_template,
+ newabi_append_ro (IDENTIFIER_POINTER
+ (DECL_NAME (class_decl))));
+
+ initlist =
+ build_v2_class_ro_t_initializer (TREE_TYPE (decl), name_expr,
+ (flags | cls_flags), instanceStart,
+ instanceSize, ivarLayout,
+ inst_methods, protocol_decl,
+ inst_ivars, props);
+ /* The ROs sit in the default const section. */
+ OBJCMETA (decl, objc_meta, meta_base);
+ finish_var_decl (decl, initlist);
+
+ /* static struct class_t _OBJC_CLASS_Foo = { ... }; */
+ initlist = build_v2_class_t_initializer (TREE_TYPE (class_decl),
+ build_fold_addr_expr (metaclass_decl),
+ class_superclass_expr,
+ build_fold_addr_expr (decl),
+ build_fold_addr_expr (UOBJC_V2_CACHE_decl),
+ build_fold_addr_expr (UOBJC_V2_VTABLE_decl));
+
+ /* The class section attributes are set when they are created. */
+ finish_var_decl (class_decl, initlist);
+ impent->class_decl = class_decl;
+
+ objc_v2_add_to_class_list (class_decl);
+ if (has_load_impl (CLASS_CLS_METHODS (impent->imp_context)))
+ objc_v2_add_to_nonlazy_class_list (class_decl);
+
+ if (flags & 0x20) /* RO_EXCEPTION */
+ objc_v2_add_to_ehtype_list (CLASS_NAME (impent->imp_template));
+}
+
+/* This routine outputs the (ivar_reference_offset, offset)
+ tuples. */
+
+static void
+build_v2_ivar_offset_ref_table (void)
+{
+ int count;
+ ivarref_entry *ref;
+
+ if (!ivar_offset_refs || !VEC_length (ivarref_entry, ivar_offset_refs))
+ return;
+
+ FOR_EACH_VEC_ELT (ivarref_entry, ivar_offset_refs, count, ref)
+ finish_var_decl (ref->decl, ref->offset);
+}
+
+/* static int _OBJC_IMAGE_INFO[2] = { 0, 16 | flags }; */
+
+static void
+generate_v2_objc_image_info (void)
+{
+ tree decl, array_type;
+ VEC(constructor_elt,gc) *v = NULL;
+ int flags =
+ ((flag_replace_objc_classes && imp_count ? 1 : 0)
+ | (flag_objc_gc ? 2 : 0));
+
+ flags |= 16;
+
+ array_type = build_sized_array_type (integer_type_node, 2);
+
+ decl = start_var_decl (array_type, "_OBJC_ImageInfo");
+
+ CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, integer_zero_node);
+ CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, build_int_cst (integer_type_node, flags));
+ /* The Runtime wants this. */
+ DECL_PRESERVE_P (decl) = 1;
+ OBJCMETA (decl, objc_meta, meta_info);
+ finish_var_decl (decl, objc_build_constructor (TREE_TYPE (decl), v));
+}
+
+static void
+objc_generate_v2_next_metadata (void)
+{
+ struct imp_entry *impent;
+
+ /* FIXME: Make sure that we generate no metadata if there is nothing
+ to put into it. */
+
+ gcc_assert (!objc_static_instances); /* Not for NeXT */
+
+ build_metadata_templates ();
+
+ for (impent = imp_list; impent; impent = impent->next)
+ {
+ /* If -gen-decls is present, Dump the @interface of each class.
+ TODO: Dump the classes in the order they were found, rather
+ than in reverse order as we are doing now. */
+ if (flag_gen_declaration)
+ dump_interface (gen_declaration_file, impent->imp_context);
+
+ /* all of the following reference the string pool... */
+ if (TREE_CODE (impent->imp_context) == CLASS_IMPLEMENTATION_TYPE)
+ generate_v2_class_structs (impent);
+ else
+ generate_v2_category (impent);
+ }
+
+ build_next_selector_translation_table ();
+ build_v2_message_ref_translation_table ();
+
+ /* This will add "Protocol" to the class refs. */
+ generate_v2_protocols ();
+
+ build_v2_classrefs_table ();
+ build_v2_super_classrefs_table (/*metaclass= */false);
+ build_v2_super_classrefs_table (/*metaclass= */true);
+
+ build_v2_ivar_offset_ref_table ();
+
+ build_v2_protocol_list_translation_table ();
+ build_v2_protocol_list_address_table ();
+
+ build_v2_address_table (class_list, "_OBJC_ClassList$",
+ meta_label_classlist);
+ build_v2_address_table (category_list, "_OBJC_CategoryList$",
+ meta_label_categorylist);
+ build_v2_address_table (nonlazy_class_list, "_OBJC_NonLazyClassList$",
+ meta_label_nonlazy_classlist);
+ build_v2_address_table (nonlazy_category_list, "_OBJC_NonLazyCategoryList$",
+ meta_label_nonlazy_categorylist);
+
+ /* This conveys information on GC usage and zero-link. */
+ generate_v2_objc_image_info ();
+
+ /* Generate catch objects for eh, if any are needed. */
+ build_v2_eh_catch_objects ();
+
+ /* Emit the string table last. */
+ generate_strings ();
+}
+
+/* NOTE --- Output NeXT V2 Exceptions --- */
+
+static GTY(()) tree objc_v2_ehtype_template;
+static GTY(()) tree next_v2_ehvtable_decl;
+static GTY(()) tree next_v2_EHTYPE_id_decl;
+
+static void
+build_v2_ehtype_template (void)
+{
+ tree decls, *chain = NULL;
+ objc_v2_ehtype_template = objc_start_struct (get_identifier (UTAG_V2_EH_TYPE));
+
+ /* void *_objc_ehtype_vtable; */
+ decls = add_field_decl (ptr_type_node, "_objc_ehtype_vtable_ptr", &chain);
+
+ /* const char *className; */
+ add_field_decl (string_type_node, "className", &chain);
+
+ /* struct class_t *const cls; */
+ add_field_decl (build_pointer_type (objc_v2_class_template), "cls", &chain);
+
+ objc_finish_struct (objc_v2_ehtype_template, decls);
+}
+
+/* Template for the Objective-C family typeinfo type for ABI=2. This
+ starts off the same as the gxx/cxx eh typeinfo.
+
+ struct _objc_ehtype_t
+ {
+ void *_objc_ehtype_vtable_ptr; - as per c++
+ const char *className; - as per c++
+ struct class_t *const cls;
+ }
+*/
+
+/* This routine builds initializer list for object of type struct _objc_ehtype_t.
+*/
+
+static tree
+objc2_build_ehtype_initializer (tree name, tree cls)
+{
+ VEC(constructor_elt,gc) *initlist = NULL;
+ tree addr, offs;
+
+ /* This is done the same way as c++, missing the two first entries
+ in the parent vtable. NOTE: there is a fix-me in the Apple/NeXT
+ runtime source about this so, perhaps, this will change at some
+ point. */
+ /* _objc_ehtype_vtable + 2*sizeof(void*) */
+ if (!next_v2_ehvtable_decl)
+ {
+ next_v2_ehvtable_decl =
+ start_var_decl (ptr_type_node, TAG_NEXT_EHVTABLE_NAME);
+ TREE_STATIC (next_v2_ehvtable_decl) = 0;
+ DECL_EXTERNAL (next_v2_ehvtable_decl) = 1;
+ TREE_PUBLIC (next_v2_ehvtable_decl) = 1;
+ }
+ addr = build_fold_addr_expr_with_type (next_v2_ehvtable_decl, ptr_type_node);
+ offs = size_int (2 * int_cst_value (TYPE_SIZE_UNIT (ptr_type_node)));
+ addr = fold_build2 (POINTER_PLUS_EXPR, ptr_type_node, addr, offs);
+
+ CONSTRUCTOR_APPEND_ELT (initlist, NULL_TREE, addr);
+
+ /* className */
+ CONSTRUCTOR_APPEND_ELT (initlist, NULL_TREE, name);
+
+ /* cls */
+ CONSTRUCTOR_APPEND_ELT (initlist, NULL_TREE, cls);
+
+ return objc_build_constructor (objc_v2_ehtype_template, initlist);
+}
+
+static tree
+build_ehtype (tree name, const char *eh_name, bool weak)
+{
+ tree name_expr, class_name_expr, ehtype_decl, inits;
+
+ name_expr = add_objc_string (name, class_names);
+ /* Extern ref. for the class. ??? Maybe we can look this up
+ somewhere. */
+ class_name_expr =
+ create_extern_decl (objc_v2_class_template,
+ objc_build_internal_classname (name, false));
+ class_name_expr = build_fold_addr_expr (class_name_expr);
+ ehtype_decl = create_global_decl (objc_v2_ehtype_template, eh_name);
+ if (weak)
+ DECL_WEAK (ehtype_decl) = 1;
+ inits = objc2_build_ehtype_initializer (name_expr, class_name_expr);
+ OBJCMETA (ehtype_decl, objc_meta, meta_ehtype);
+ finish_var_decl (ehtype_decl, inits);
+ return ehtype_decl;
+}
+
+/* This routine returns TRUE if CLS or any of its super classes has
+ __attribute__ ((objc_exception)). */
+
+static bool
+objc2_objc_exception_attr (tree cls)
+{
+ while (cls)
+ {
+ if (CLASS_HAS_EXCEPTION_ATTR (cls))
+ return true;
+ cls = lookup_interface (CLASS_SUPER_NAME (cls));
+ }
+
+ return false;
+}
+
+static bool
+is_implemented (tree name)
+{
+ struct imp_entry *t;
+ for (t = imp_list; t; t = t->next)
+ if (TREE_CODE (t->imp_context) == CLASS_IMPLEMENTATION_TYPE
+ && CLASS_NAME (t->imp_template) == name)
+ return true;
+
+ return false;
+}
+
+/* We will build catch objects:
+ for any type implemented here.
+ for any type used in a catch that has no exception attribute. */
+static void build_v2_eh_catch_objects (void)
+{
+ int count=0;
+ ident_data_tuple *ref;
+
+ if (!ehtype_list || !VEC_length (ident_data_tuple, ehtype_list))
+ return;
+
+ FOR_EACH_VEC_ELT (ident_data_tuple, ehtype_list, count, ref)
+ {
+ char buf[BUFSIZE];
+ bool impl = is_implemented (ref->ident);
+ bool excpt = objc2_objc_exception_attr (lookup_interface (ref->ident));
+ snprintf (buf, BUFSIZE, "OBJC_EHTYPE_$_%s", IDENTIFIER_POINTER (ref->ident));
+ if (!impl && excpt)
+ /* The User says this class has a catcher already. */
+ ref->data = create_extern_decl (objc_v2_ehtype_template, buf);
+ else
+ /* Create a catcher, weak if it wasn't marked. */
+ ref->data = build_ehtype (ref->ident, buf, !excpt);
+ }
+}
+
+static tree
+lookup_ehtype_ref (tree id)
+{
+ int count=0;
+ ident_data_tuple *ref;
+
+ if (!ehtype_list || !VEC_length (ident_data_tuple, ehtype_list))
+ return NULL_TREE;
+
+ FOR_EACH_VEC_ELT (ident_data_tuple, ehtype_list, count, ref)
+ if (ref->ident == id)
+ return ref->data;
+ return NULL_TREE;
+}
+
+/* This hook, called via lang_eh_runtime_type, generates a runtime
+ object which is either the address of the 'OBJC_EHTYPE_$_class'
+ object or address of external OBJC_EHTYPE_id object. */
+static tree
+next_runtime_02_eh_type (tree type)
+{
+ tree t;
+
+ if (type == error_mark_node
+ /*|| errorcount || sorrycount*/)
+ goto err_mark_in;
+
+ if (POINTER_TYPE_P (type) && objc_is_object_id (TREE_TYPE (type)))
+ {
+ if (!next_v2_EHTYPE_id_decl)
+ {
+ /* This is provided by the Apple/NeXT libobjc.dylib so we
+ need only to reference it. */
+ next_v2_EHTYPE_id_decl =
+ start_var_decl (objc_v2_ehtype_template, "OBJC_EHTYPE_id");
+ DECL_EXTERNAL (next_v2_EHTYPE_id_decl) = 1;
+ TREE_PUBLIC (next_v2_EHTYPE_id_decl) = 1;
+ TREE_STATIC (next_v2_EHTYPE_id_decl) = 0;
+ }
+ return build_fold_addr_expr (next_v2_EHTYPE_id_decl);
+ }
+
+ if (!POINTER_TYPE_P (type) || !TYPED_OBJECT (TREE_TYPE (type)))
+ {
+#ifdef OBJCPLUS
+ /* This routine is also called for c++'s catch clause; in which
+ case, we use c++'s typeinfo decl. */
+ return build_eh_type_type (type);
+#else
+ error ("non-objective-c type '%T' cannot be caught", type);
+ goto err_mark_in;
+#endif
+ }
+ else
+ t = OBJC_TYPE_NAME (TREE_TYPE (type));
+
+ /* We have to build a reference to the OBJC_EHTYPE_<Class>. */
+ t = lookup_ehtype_ref (t);
+ if (!t)
+ goto err_mark_in;
+
+ return build_fold_addr_expr (t);
+
+err_mark_in:
+ return error_mark_node;
+}
+
+static GTY(()) tree objc_eh_personality_decl;
+
+static tree
+objc_eh_personality (void)
+{
+ if (!objc_eh_personality_decl)
+ objc_eh_personality_decl = build_personality_function ("objc");
+ return objc_eh_personality_decl;
+}
+
+/* NOTE --- interfaces --- */
+
+static tree
+build_throw_stmt (location_t loc, tree throw_expr, bool rethrown)
+{
+ tree t;
+ if (rethrown)
+ /* We have a separate re-throw entry. */
+ t = build_function_call_vec (loc, objc_rethrow_exception_decl, NULL, NULL);
+ else
+ {
+ /* Throw like the others... */
+ VEC(tree, gc) *parms = VEC_alloc (tree, gc, 1);
+ VEC_quick_push (tree, parms, throw_expr);
+ t = build_function_call_vec (loc, objc_exception_throw_decl, parms, NULL);
+ VEC_free (tree, gc, parms);
+ }
+ return add_stmt (t);
+}
+
+/* Build __builtin_eh_pointer. */
+
+static tree
+objc_build_exc_ptr (struct objc_try_context **x ATTRIBUTE_UNUSED)
+{
+ tree t;
+ t = built_in_decls[BUILT_IN_EH_POINTER];
+ t = build_call_expr (t, 1, integer_zero_node);
+ return fold_convert (objc_object_type, t);
+}
+
+static tree begin_catch (struct objc_try_context **cur_try_context, tree type,
+ tree decl, tree compound, bool ellipsis ATTRIBUTE_UNUSED)
+{
+ tree t;
+
+ /* Record the data for the catch in the try context so that we can
+ finalize it later. Ellipsis is signalled by a NULL entry. */
+ if (ellipsis)
+ t = build_stmt (input_location, CATCH_EXPR, NULL_TREE, compound);
+ else
+ t = build_stmt (input_location, CATCH_EXPR, type, compound);
+ (*cur_try_context)->current_catch = t;
+
+ /* Initialize the decl from the EXC_PTR_EXPR we get from the runtime. */
+ t = objc_build_exc_ptr (cur_try_context);
+ t = convert (TREE_TYPE (decl), t);
+ /* FIXME: location. */
+ if (type && type != error_mark_node)
+ {
+ t = build1(NOP_EXPR, ptr_type_node, t);
+ t = build_function_call (input_location, objc2_begin_catch_decl,
+ tree_cons (NULL_TREE, t, NULL_TREE));
+
+ /* We might want to build a catch object for this (if it's not
+ id). */
+ if (POINTER_TYPE_P (type)
+ && !objc_is_object_id (TREE_TYPE (type))
+ && TYPED_OBJECT (TREE_TYPE (type)))
+ objc_v2_add_to_ehtype_list (OBJC_TYPE_NAME (TREE_TYPE (type)));
+ }
+ return build2 (MODIFY_EXPR, void_type_node, decl, t);
+}
+
+/* try { catch-body } finally { objc_end_catch (); } */
+static void
+finish_catch (struct objc_try_context **cur_try_context, tree curr_catch)
+{
+ struct objc_try_context *ct;
+ tree try_exp, func, *l, t ;
+ location_t loc = (*cur_try_context)->try_locus;
+
+ if (!curr_catch || curr_catch == error_mark_node)
+ return;
+
+ t = CATCH_BODY (curr_catch);
+ if (TREE_CODE (t) == BIND_EXPR)
+ {
+ /* Usual case of @catch (objc-expr). */
+ objc_begin_try_stmt (loc, BIND_EXPR_BODY (t));
+ BIND_EXPR_BODY (t) = NULL_TREE;
+ l = &BIND_EXPR_BODY (t);
+ }
+ else
+ {
+ /* NULL entry, meaning @catch (...). */
+ objc_begin_try_stmt (loc, t);
+ CATCH_BODY (curr_catch) = NULL_TREE;
+ l = &CATCH_BODY (curr_catch);
+ }
+
+ /* Pick up the new context we made in begin_try above... */
+ ct = *cur_try_context;
+ func = build_function_call_vec (loc, objc2_end_catch_decl, NULL, NULL);
+ append_to_statement_list (func, &ct->finally_body);
+ try_exp = build_stmt (loc, TRY_FINALLY_EXPR, ct->try_body, ct->finally_body);
+ *cur_try_context = ct->outer;
+ free (ct);
+ append_to_statement_list (try_exp, l);
+ append_to_statement_list (curr_catch, &((*cur_try_context)->catch_list));
+}
+
+static tree
+finish_try_stmt (struct objc_try_context **cur_try_context)
+{
+ struct objc_try_context *c = *cur_try_context;
+ tree stmt = c->try_body;
+ if (c->catch_list)
+ stmt = build_stmt (c->try_locus, TRY_CATCH_EXPR, stmt, c->catch_list);
+ if (c->finally_body)
+ stmt = build_stmt (c->try_locus, TRY_FINALLY_EXPR, stmt, c->finally_body);
+ return stmt;
+}
+
+#include "gt-objc-objc-next-runtime-abi-02.h"
diff --git a/gcc/objc/objc-runtime-hooks.h b/gcc/objc/objc-runtime-hooks.h
new file mode 100644
index 00000000000..b325e75f9bc
--- /dev/null
+++ b/gcc/objc/objc-runtime-hooks.h
@@ -0,0 +1,111 @@
+/* Hooks to abstract the runtime meta-data generation for Objective C.
+ Copyright (C) 2011 Free Software Foundation, Inc.
+ Contributed by Iain Sandoe
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3, or (at your option)
+any later version.
+
+GCC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING3. If not see
+<http://www.gnu.org/licenses/>. */
+
+#ifndef _OBJC_RUNTIME_HOOKS_H_
+#define _OBJC_RUNTIME_HOOKS_H_
+
+/* A set of hooks for the front end to obtain runtime-specific actions. */
+
+/* Objective-C supports several runtime library variants:
+
+ "GNU" runtime selected by -fgnu-runtime (currently at ABI version 8).
+ "NeXT" runtime (selected by -fnext-runtime) and installed on OSX/Darwin
+ systems at API version 1 (for m32 code) and version 2 (for m64 code).
+
+ The runtimes require different data types/layouts, method call mechanisms
+ and so on, and the purpose of this interface is to abstract such
+ differences from the parser's perspective. */
+
+/* TODO: Do we want the initial underscore ? */
+typedef struct _objc_runtime_hooks_r
+{
+ /* TODO: Expand comments in this file. */
+
+ /* Initialize for this runtime. */
+ void (*initialize) (void);
+ const char *default_constant_string_class_name;
+
+ /* FIXME: Having to check this name should not be necessary. */
+ const char *tag_getclass;
+ /* id for superclass class field - named differently in the existing
+ runtimes. */
+ tree (*super_superclassfield_ident) (void);
+
+ /* Obtain a class decl for the identifier. */
+ tree (*class_decl) (tree);
+ /* Obtain a metaclass decl for the identifier. */
+ tree (*metaclass_decl) (tree);
+ /* Obtain a category decl for the identifier. */
+ tree (*category_decl) (tree);
+ /* Obtain a protocol decl for the identifier. */
+ tree (*protocol_decl) (tree);
+ /* Obtain a string decl, to be placed in the nominated string-section. */
+ tree (*string_decl) (tree, const char *, string_section);
+
+ /* Obtain a class reference, generating the fwd def. if necessary. */
+ tree (*get_class_reference) (tree);
+ /* build/get selector reference. */
+ tree (*build_selector_reference) (location_t, tree, tree);
+ /* Get a protocol reference, generating the forward def. if necessary. */
+ tree (*get_protocol_reference) (location_t, tree);
+ /* Get an ivar ref. re the base. */
+ tree (*build_ivar_reference) (location_t, tree, tree);
+ /* Get a reference to {meta}class' super. */
+ tree (*get_class_super_ref) (location_t, struct imp_entry *, bool);
+ /* Get a reference to Category {meta}class' super. */
+ tree (*get_category_super_ref) (location_t, struct imp_entry *, bool);
+
+ /* Receiver is class Object, check runtime-specific. */
+ tree (*receiver_is_class_object) (tree);
+ /* Get the start of a method argument type list (receiver, _cmd). */
+ tree (*get_arg_type_list_base) (tree, int, int);
+ /* Build method call. */
+ tree (*build_objc_method_call) (location_t, tree, tree, tree, tree, tree, int);
+
+ /* Check for or otherwise handle a request to check that the constant
+ string class reference is set-up & OK. */
+ bool (*setup_const_string_class_decl) (void);
+ /* Return the tree reprenting a const string constructor for the arg.
+ Most of the data are in global trees. */
+ tree (*build_const_string_constructor) (location_t, tree, int);
+
+ /* Exceptions. */
+ tree (*build_throw_stmt) (location_t, tree, bool);
+ tree (*build_exc_ptr) (struct objc_try_context **);
+ tree (*begin_catch) (struct objc_try_context **, tree, tree, tree, bool);
+ void (*finish_catch) (struct objc_try_context **, tree);
+ tree (*finish_try_stmt) (struct objc_try_context **);
+
+ /* Emit all the metadata required by the runtime - based on the tables built
+ during parsing. */
+ void (*generate_metadata) (void);
+
+} objc_runtime_hooks;
+
+/* For shared support that needs to access these. */
+extern objc_runtime_hooks runtime;
+
+/* One per runtime at present.
+ TODO: Make into some kind of configury-generated table. */
+extern bool objc_gnu_runtime_abi_01_init (objc_runtime_hooks *);
+extern bool objc_next_runtime_abi_01_init (objc_runtime_hooks *);
+extern bool objc_next_runtime_abi_02_init (objc_runtime_hooks *);
+
+#endif /* _OBJC_RUNTIME_HOOKS_H_ */
diff --git a/gcc/objc/objc-runtime-shared-support.c b/gcc/objc/objc-runtime-shared-support.c
new file mode 100644
index 00000000000..8dca6ccae9f
--- /dev/null
+++ b/gcc/objc/objc-runtime-shared-support.c
@@ -0,0 +1,736 @@
+/* Support routines shared by all runtimes.
+ Copyright (C) 2011 Free Software Foundation, Inc.
+ Contributed by Iain Sandoe (partially split from objc-act.c)
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3, or (at your option)
+any later version.
+
+GCC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING3. If not see
+<http://www.gnu.org/licenses/>. */
+
+#include "config.h"
+#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
+#include "tree.h"
+
+#ifdef OBJCPLUS
+#include "cp-tree.h"
+#else
+#include "c-tree.h"
+#include "c-lang.h"
+#endif
+#include "langhooks.h"
+#include "c-family/c-objc.h"
+#include "objc-act.h"
+
+/* When building Objective-C++, we are not linking against the C front-end
+ and so need to replicate the C tree-construction functions in some way. */
+#ifdef OBJCPLUS
+#define OBJCP_REMAP_FUNCTIONS
+#include "objcp-decl.h"
+#endif /* OBJCPLUS */
+
+#include "obstack.h"
+
+/* These are only used for encoding ivars. */
+extern struct obstack util_obstack;
+extern char *util_firstobj;
+
+/* Hooks for string decls etc. */
+#include "objc-runtime-hooks.h"
+
+#include "objc-runtime-shared-support.h"
+
+/* rt_trees identifiers - shared between NeXT implementations. These allow
+ the FE to tag meta-data in a manner that survives LTO and can be used when
+ the runtime requires that certain meta-data items appear in particular
+ named sections. */
+#include "objc-next-metadata-tags.h"
+extern GTY(()) tree objc_rt_trees[OCTI_RT_META_MAX];
+
+/* Rather than repeatedly looking up the identifiers, we save them here. */
+tree objc_rt_trees[OCTI_RT_META_MAX];
+
+/* For building an objc struct. These might not be used when this file
+ is compiled as part of obj-c++. */
+
+static bool objc_building_struct;
+static struct c_struct_parse_info *objc_struct_info ATTRIBUTE_UNUSED;
+
+/* Start building a struct for objc. */
+
+tree
+objc_start_struct (tree name)
+{
+ gcc_assert (!objc_building_struct);
+ objc_building_struct = true;
+ return start_struct (input_location, RECORD_TYPE, name, &objc_struct_info);
+}
+
+/* Finish building a struct for objc. */
+
+tree
+objc_finish_struct (tree type, tree fieldlist)
+{
+ gcc_assert (objc_building_struct);
+ objc_building_struct = false;
+ return finish_struct (input_location, type, fieldlist, NULL_TREE,
+ objc_struct_info);
+}
+
+tree
+build_sized_array_type (tree base_type, int size)
+{
+ tree index_type = build_index_type (build_int_cst (NULL_TREE, size - 1));
+ return build_array_type (base_type, index_type);
+}
+
+/* Create a declaration for field NAME of a given TYPE. */
+
+static tree
+create_field_decl (tree type, const char *name)
+{
+ return build_decl (input_location,
+ FIELD_DECL, get_identifier (name), type);
+}
+
+tree
+add_field_decl (tree type, const char *name, tree **chain)
+{
+ tree field = create_field_decl (type, name);
+
+ if (*chain != NULL)
+ **chain = field;
+ *chain = &DECL_CHAIN (field);
+
+ return field;
+}
+
+/* Create a global, static declaration for variable NAME of a given TYPE. The
+ finish_var_decl() routine will need to be called on it afterwards. */
+
+tree
+start_var_decl (tree type, const char *name)
+{
+ tree var = build_decl (input_location,
+ VAR_DECL, get_identifier (name), type);
+ TREE_STATIC (var) = 1;
+ DECL_INITIAL (var) = error_mark_node; /* A real initializer is coming... */
+ DECL_IGNORED_P (var) = 1;
+ DECL_ARTIFICIAL (var) = 1;
+ DECL_CONTEXT (var) = NULL_TREE;
+#ifdef OBJCPLUS
+ DECL_THIS_STATIC (var) = 1; /* squash redeclaration errors */
+#endif
+ return var;
+}
+
+/* Finish off the variable declaration created by start_var_decl(). */
+
+void
+finish_var_decl (tree var, tree initializer)
+{
+ finish_decl (var, input_location, initializer, NULL_TREE, NULL_TREE);
+}
+
+/* Just a handy wrapper for add_objc_string. */
+
+tree
+build_selector (tree ident)
+{
+ return convert (objc_selector_type, add_objc_string (ident, meth_var_names));
+}
+
+/* --- templates --- */
+
+/* Set 'objc_super_template' to the data type node for 'struct _objc_super'.
+ This needs to be done just once per compilation. */
+
+/* struct _objc_super {
+ struct _objc_object *self;
+ struct _objc_class *super_class;
+ [or Class cls; for the abi v2]
+ }; */
+
+void
+build_super_template (void)
+{
+ tree decls, *chain = NULL;
+
+ objc_super_template = objc_start_struct (get_identifier (UTAG_SUPER));
+
+ /* struct _objc_object *self; */
+ decls = add_field_decl (objc_object_type, "self", &chain);
+
+ /* struct _objc_class *super_class; */
+ add_field_decl (build_pointer_type (objc_class_template),
+ "super_class", &chain);
+
+ objc_finish_struct (objc_super_template, decls);
+}
+
+/* To accomplish method prototyping without generating all kinds of
+ inane warnings, the definition of the dispatch table entries were
+ changed from:
+
+ struct objc_method { SEL _cmd; ...; id (*_imp)(); };
+ to:
+ struct objc_method { SEL _cmd; ...; void *_imp; }; */
+
+tree
+build_method_template (void)
+{
+ tree _SLT_record;
+ tree decls, *chain = NULL;
+
+ _SLT_record = objc_start_struct (get_identifier (UTAG_METHOD));
+
+ /* SEL _cmd; */
+ decls = add_field_decl (objc_selector_type, "_cmd", &chain);
+
+ /* char *method_types; */
+ add_field_decl (string_type_node, "method_types", &chain);
+
+ /* void *_imp; */
+ add_field_decl (build_pointer_type (void_type_node), "_imp", &chain);
+
+ objc_finish_struct (_SLT_record, decls);
+
+ return _SLT_record;
+}
+
+tree
+build_method_prototype_template (void)
+{
+ tree proto_record;
+ tree decls, *chain = NULL;
+
+ proto_record = objc_start_struct (get_identifier (UTAG_METHOD_PROTOTYPE));
+
+ /* SEL _cmd; */
+ decls = add_field_decl (objc_selector_type, "_cmd", &chain);
+
+ /* char *method_types; */
+ add_field_decl (string_type_node, "method_types", &chain);
+
+ objc_finish_struct (proto_record, decls);
+
+ return proto_record;
+}
+
+/* struct {
+ struct _objc__method_prototype_list *method_next;
+ int method_count;
+ struct objc_method method_list[method_count];
+ }; */
+
+tree
+build_method_list_template (tree list_type, int size)
+{
+ tree objc_ivar_list_record;
+ tree array_type, decls, *chain = NULL;
+
+ objc_ivar_list_record = objc_start_struct (NULL_TREE);
+
+ /* struct _objc__method_prototype_list *method_next; */
+ decls = add_field_decl (objc_method_proto_list_ptr, "method_next", &chain);
+
+ /* int method_count; */
+ add_field_decl (integer_type_node, "method_count", &chain);
+
+ /* struct objc_method method_list[]; */
+ array_type = build_sized_array_type (list_type, size);
+ add_field_decl (array_type, "method_list", &chain);
+
+ objc_finish_struct (objc_ivar_list_record, decls);
+
+ return objc_ivar_list_record;
+}
+
+/* struct objc_method_prototype_list {
+ int count;
+ struct objc_method_prototype {
+ SEL name;
+ char *types;
+ } list[1];
+ }; */
+
+tree
+build_method_prototype_list_template (tree list_type, int size)
+{
+ tree objc_ivar_list_record;
+ tree array_type, decls, *chain = NULL;
+
+ /* Generate an unnamed struct definition. */
+
+ objc_ivar_list_record = objc_start_struct (NULL_TREE);
+
+ /* int method_count; */
+ decls = add_field_decl (integer_type_node, "method_count", &chain);
+
+ /* struct objc_method method_list[]; */
+ array_type = build_sized_array_type (list_type, size);
+ add_field_decl (array_type, "method_list", &chain);
+
+ objc_finish_struct (objc_ivar_list_record, decls);
+
+ return objc_ivar_list_record;
+}
+
+/* --- names, decls entry --- */
+
+/* For each string section we have a chain which maps identifier nodes
+ to decls for the strings. */
+
+static GTY(()) int meth_var_names_idx;
+static GTY(()) int meth_var_types_idx;
+static GTY(()) int property_name_attr_idx;
+
+tree
+add_objc_string (tree ident, string_section section)
+{
+ tree *chain, decl, type;
+ char buf[BUFSIZE];
+
+ switch (section)
+ {
+ case class_names:
+ chain = &class_names_chain;
+ snprintf (buf, BUFSIZE, "_OBJC_ClassName_%s", IDENTIFIER_POINTER (ident));
+ break;
+ case meth_var_names:
+ chain = &meth_var_names_chain;
+ snprintf (buf, BUFSIZE, "_OBJC_METH_VAR_NAME_%d", meth_var_names_idx++);
+ break;
+ case meth_var_types:
+ chain = &meth_var_types_chain;
+ snprintf (buf, BUFSIZE, "_OBJC_METH_VAR_TYPE_%d", meth_var_types_idx++);
+ break;
+ case prop_names_attr:
+ chain = &prop_names_attr_chain;
+ snprintf (buf, BUFSIZE, "_OBJC_PropertyAttributeOrName_%d", property_name_attr_idx++);
+ break;
+ default:
+ gcc_unreachable ();
+ }
+
+ while (*chain)
+ {
+ if (TREE_VALUE (*chain) == ident)
+ return convert (string_type_node,
+ build_unary_op (input_location,
+ ADDR_EXPR, TREE_PURPOSE (*chain), 1));
+
+ chain = &TREE_CHAIN (*chain);
+ }
+
+ type = build_sized_array_type (char_type_node, IDENTIFIER_LENGTH (ident) + 1);
+ /* Get a runtime-specific string decl which will be finish_var()'ed in
+ generate_strings (). */
+ decl = (*runtime.string_decl) (type, buf, section);
+ TREE_CONSTANT (decl) = 1;
+ *chain = tree_cons (decl, ident, NULL_TREE);
+
+ return convert (string_type_node,
+ build_unary_op (input_location, ADDR_EXPR, decl, 1));
+}
+
+/* --- shared metadata routines --- */
+
+tree
+build_descriptor_table_initializer (tree type, tree entries)
+{
+ VEC(constructor_elt,gc) *inits = NULL;
+
+ do
+ {
+ VEC(constructor_elt,gc) *elts = NULL;
+
+ CONSTRUCTOR_APPEND_ELT (elts, NULL_TREE,
+ build_selector (METHOD_SEL_NAME (entries)));
+ CONSTRUCTOR_APPEND_ELT (elts, NULL_TREE,
+ add_objc_string (METHOD_ENCODING (entries),
+ meth_var_types));
+
+ CONSTRUCTOR_APPEND_ELT (inits, NULL_TREE,
+ objc_build_constructor (type, elts));
+
+ entries = DECL_CHAIN (entries);
+ }
+ while (entries);
+
+ return objc_build_constructor (build_array_type (type, 0), inits);
+}
+
+tree
+build_dispatch_table_initializer (tree type, tree entries)
+{
+ VEC(constructor_elt,gc) *inits = NULL;
+
+ do
+ {
+ VEC(constructor_elt,gc) *elems = NULL;
+ tree expr;
+
+ CONSTRUCTOR_APPEND_ELT (elems, NULL_TREE,
+ build_selector (METHOD_SEL_NAME (entries)));
+
+ /* Generate the method encoding if we don't have one already. */
+ if (! METHOD_ENCODING (entries))
+ METHOD_ENCODING (entries) =
+ encode_method_prototype (entries);
+
+ CONSTRUCTOR_APPEND_ELT (elems, NULL_TREE,
+ add_objc_string (METHOD_ENCODING (entries),
+ meth_var_types));
+
+ expr = convert (ptr_type_node,
+ build_unary_op (input_location, ADDR_EXPR,
+ METHOD_DEFINITION (entries), 1));
+ CONSTRUCTOR_APPEND_ELT (elems, NULL_TREE, expr);
+
+ CONSTRUCTOR_APPEND_ELT (inits, NULL_TREE,
+ objc_build_constructor (type, elems));
+
+ entries = DECL_CHAIN (entries);
+ }
+ while (entries);
+
+ return objc_build_constructor (build_array_type (type, 0), inits);
+}
+
+/* Used only by build_*_selector_translation_table (). */
+void
+diagnose_missing_method (tree meth, location_t here)
+{
+ tree method_chain;
+ bool found = false;
+ for (method_chain = meth_var_names_chain;
+ method_chain;
+ method_chain = TREE_CHAIN (method_chain))
+ {
+ if (TREE_VALUE (method_chain) == meth)
+ {
+ found = true;
+ break;
+ }
+ }
+
+ if (!found)
+ warning_at (here, 0, "creating selector for nonexistent method %qE",
+ meth);
+}
+
+
+static tree
+init_module_descriptor (tree type, long vers)
+{
+ tree expr, ltyp;
+ location_t loc;
+ VEC(constructor_elt,gc) *v = NULL;
+
+ /* No really useful place to point to. */
+ loc = UNKNOWN_LOCATION;
+
+ /* version = { 1, ... } */
+
+ expr = build_int_cst (long_integer_type_node, vers);
+ CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, expr);
+
+ /* size = { ..., sizeof (struct _objc_module), ... } */
+
+ expr = convert (long_integer_type_node,
+ size_in_bytes (objc_module_template));
+ CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, expr);
+
+ /* Don't provide any file name for security reasons. */
+ /* name = { ..., "", ... } */
+
+ expr = add_objc_string (get_identifier (""), class_names);
+ CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, expr);
+
+ /* symtab = { ..., _OBJC_SYMBOLS, ... } */
+
+ ltyp = build_pointer_type (xref_tag (RECORD_TYPE,
+ get_identifier (UTAG_SYMTAB)));
+ if (UOBJC_SYMBOLS_decl)
+ expr = convert (ltyp, build_unary_op (loc,
+ ADDR_EXPR, UOBJC_SYMBOLS_decl, 0));
+ else
+ expr = convert (ltyp, null_pointer_node);
+ CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, expr);
+
+ return objc_build_constructor (type, v);
+}
+
+/* Write out the data structures to describe Objective C classes defined.
+
+ struct _objc_module { ... } _OBJC_MODULE = { ... }; */
+
+void
+build_module_descriptor (long vers, tree attr)
+{
+ tree decls, *chain = NULL;
+
+#ifdef OBJCPLUS
+ push_lang_context (lang_name_c); /* extern "C" */
+#endif
+
+ objc_module_template = objc_start_struct (get_identifier (UTAG_MODULE));
+
+ /* long version; */
+ decls = add_field_decl (long_integer_type_node, "version", &chain);
+
+ /* long size; */
+ add_field_decl (long_integer_type_node, "size", &chain);
+
+ /* char *name; */
+ add_field_decl (string_type_node, "name", &chain);
+
+ /* struct _objc_symtab *symtab; */
+ add_field_decl (build_pointer_type (xref_tag (RECORD_TYPE,
+ get_identifier (UTAG_SYMTAB))),
+ "symtab", &chain);
+
+ objc_finish_struct (objc_module_template, decls);
+
+ /* Create an instance of "_objc_module". */
+ UOBJC_MODULES_decl = start_var_decl (objc_module_template,
+ /* FIXME - why the conditional
+ if the symbol is the
+ same. */
+ flag_next_runtime ? "_OBJC_Module" : "_OBJC_Module");
+
+ /* This is the root of the metadata for defined classes and categories, it
+ is referenced by the runtime and, therefore, needed. */
+ DECL_PRESERVE_P (UOBJC_MODULES_decl) = 1;
+
+ /* Allow the runtime to mark meta-data such that it can be assigned to target
+ specific sections by the back-end. */
+ if (attr)
+ DECL_ATTRIBUTES (UOBJC_MODULES_decl) = attr;
+
+ finish_var_decl (UOBJC_MODULES_decl,
+ init_module_descriptor (TREE_TYPE (UOBJC_MODULES_decl),
+ vers));
+
+#ifdef OBJCPLUS
+ pop_lang_context ();
+#endif
+}
+
+tree
+build_ivar_list_initializer (tree type, tree field_decl)
+{
+ VEC(constructor_elt,gc) *inits = NULL;
+
+ do
+ {
+ VEC(constructor_elt,gc) *ivar = NULL;
+ tree id;
+
+ /* Set name. */
+ if (DECL_NAME (field_decl))
+ CONSTRUCTOR_APPEND_ELT (ivar, NULL_TREE,
+ add_objc_string (DECL_NAME (field_decl),
+ meth_var_names));
+ else
+ /* Unnamed bit-field ivar (yuck). */
+ CONSTRUCTOR_APPEND_ELT (ivar, NULL_TREE, build_int_cst (NULL_TREE, 0));
+
+ /* Set type. */
+ encode_field_decl (field_decl,
+ obstack_object_size (&util_obstack),
+ OBJC_ENCODE_DONT_INLINE_DEFS);
+
+ /* Null terminate string. */
+ obstack_1grow (&util_obstack, 0);
+ id = add_objc_string (get_identifier (XOBFINISH (&util_obstack, char *)),
+ meth_var_types);
+ CONSTRUCTOR_APPEND_ELT (ivar, NULL_TREE, id);
+ obstack_free (&util_obstack, util_firstobj);
+
+ /* Set offset. */
+ CONSTRUCTOR_APPEND_ELT (ivar, NULL_TREE, byte_position (field_decl));
+ CONSTRUCTOR_APPEND_ELT (inits, NULL_TREE,
+ objc_build_constructor (type, ivar));
+ do
+ field_decl = DECL_CHAIN (field_decl);
+ while (field_decl && TREE_CODE (field_decl) != FIELD_DECL);
+ }
+ while (field_decl);
+
+ return objc_build_constructor (build_array_type (type, 0), inits);
+}
+
+/* struct {
+ int ivar_count;
+ struct objc_ivar ivar_list[ivar_count];
+ }; */
+
+tree
+build_ivar_list_template (tree list_type, int size)
+{
+ tree objc_ivar_list_record;
+ tree array_type, decls, *chain = NULL;
+
+ objc_ivar_list_record = objc_start_struct (NULL_TREE);
+
+ /* int ivar_count; */
+ decls = add_field_decl (integer_type_node, "ivar_count", &chain);
+
+ /* struct objc_ivar ivar_list[]; */
+ array_type = build_sized_array_type (list_type, size);
+ add_field_decl (array_type, "ivar_list", &chain);
+
+ objc_finish_struct (objc_ivar_list_record, decls);
+
+ return objc_ivar_list_record;
+}
+
+/* struct _objc_ivar {
+ char *ivar_name;
+ char *ivar_type;
+ int ivar_offset;
+ }; */
+
+tree
+build_ivar_template (void)
+{
+ tree objc_ivar_id, objc_ivar_record;
+ tree decls, *chain = NULL;
+
+ objc_ivar_id = get_identifier (UTAG_IVAR);
+ objc_ivar_record = objc_start_struct (objc_ivar_id);
+
+ /* char *ivar_name; */
+ decls = add_field_decl (string_type_node, "ivar_name", &chain);
+
+ /* char *ivar_type; */
+ add_field_decl (string_type_node, "ivar_type", &chain);
+
+ /* int ivar_offset; */
+ add_field_decl (integer_type_node, "ivar_offset", &chain);
+
+ objc_finish_struct (objc_ivar_record, decls);
+
+ return objc_ivar_record;
+}
+
+/* Used by NeXT ABI=0..2 */
+void
+build_next_selector_translation_table (void)
+{
+ tree chain;
+ for (chain = sel_ref_chain; chain; chain = TREE_CHAIN (chain))
+ {
+ tree expr;
+ tree decl = TREE_PURPOSE (chain);
+ if (warn_selector)
+ {
+ location_t loc;
+ if (decl)
+ loc = DECL_SOURCE_LOCATION (decl);
+ else
+ loc = UNKNOWN_LOCATION;
+ diagnose_missing_method (TREE_VALUE (chain), loc);
+ }
+
+ expr = build_selector (TREE_VALUE (chain));
+
+ if (decl)
+ {
+ /* Entries of this form are used for references to methods.
+ The runtime re-writes these on start-up, but the compiler can't see
+ that and optimizes it away unless we force it. */
+ DECL_PRESERVE_P (decl) = 1;
+ finish_var_decl (decl, expr);
+ }
+ }
+}
+
+void
+generate_protocol_references (tree plist)
+{
+ tree lproto;
+
+ /* Forward declare protocols referenced. */
+ for (lproto = plist; lproto; lproto = TREE_CHAIN (lproto))
+ {
+ tree proto = TREE_VALUE (lproto);
+
+ if (TREE_CODE (proto) == PROTOCOL_INTERFACE_TYPE
+ && PROTOCOL_NAME (proto))
+ {
+ if (! PROTOCOL_FORWARD_DECL (proto))
+ PROTOCOL_FORWARD_DECL (proto) = (*runtime.protocol_decl) (proto);
+
+ if (PROTOCOL_LIST (proto))
+ generate_protocol_references (PROTOCOL_LIST (proto));
+ }
+ }
+}
+
+/* --- new routines --- */
+
+/* Output all strings. */
+
+/* FIXME: don't use global vars for all this... */
+
+/* This emits all the meta-data string tables (and finalizes each var
+ as it goes). */
+void
+generate_strings (void)
+{
+ tree chain, string_expr;
+ tree string, decl; /* , type;*/
+
+ for (chain = class_names_chain; chain; chain = TREE_CHAIN (chain))
+ {
+ string = TREE_VALUE (chain);
+ decl = TREE_PURPOSE (chain);
+ string_expr = my_build_string (IDENTIFIER_LENGTH (string) + 1,
+ IDENTIFIER_POINTER (string));
+ finish_var_decl (decl, string_expr);
+ }
+
+ for (chain = meth_var_names_chain; chain; chain = TREE_CHAIN (chain))
+ {
+ string = TREE_VALUE (chain);
+ decl = TREE_PURPOSE (chain);
+ string_expr = my_build_string (IDENTIFIER_LENGTH (string) + 1,
+ IDENTIFIER_POINTER (string));
+ finish_var_decl (decl, string_expr);
+ }
+
+ for (chain = meth_var_types_chain; chain; chain = TREE_CHAIN (chain))
+ {
+ string = TREE_VALUE (chain);
+ decl = TREE_PURPOSE (chain);
+ string_expr = my_build_string (IDENTIFIER_LENGTH (string) + 1,
+ IDENTIFIER_POINTER (string));
+ finish_var_decl (decl, string_expr);
+ }
+
+ for (chain = prop_names_attr_chain; chain; chain = TREE_CHAIN (chain))
+ {
+ string = TREE_VALUE (chain);
+ decl = TREE_PURPOSE (chain);
+ string_expr = my_build_string (IDENTIFIER_LENGTH (string) + 1,
+ IDENTIFIER_POINTER (string));
+ finish_var_decl (decl, string_expr);
+ }
+}
+
+#include "gt-objc-objc-runtime-shared-support.h"
diff --git a/gcc/objc/objc-runtime-shared-support.h b/gcc/objc/objc-runtime-shared-support.h
new file mode 100644
index 00000000000..8e4693d6f09
--- /dev/null
+++ b/gcc/objc/objc-runtime-shared-support.h
@@ -0,0 +1,90 @@
+/* Support routines shared by all runtimes.
+ Copyright (C) 2011 Free Software Foundation, Inc.
+ Contributed by Iain Sandoe
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3, or (at your option)
+any later version.
+
+GCC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING3. If not see
+<http://www.gnu.org/licenses/>. */
+
+#ifndef _OBJC_RUNTIME_SHARED_SUPPORT_H_
+#define _OBJC_RUNTIME_SHARED_SUPPORT_H_
+
+/* Left in obj-act.c for now... */
+
+extern tree objc_start_struct (tree);
+extern tree objc_finish_struct (tree, tree);
+extern tree add_field_decl (tree, const char *, tree **);
+extern tree build_sized_array_type (tree, int);
+
+extern tree lookup_interface (tree);
+extern tree objc_build_constructor (tree, VEC(constructor_elt,gc) *);
+
+extern tree start_var_decl (tree, const char *);
+extern void finish_var_decl (tree, tree);
+
+extern tree my_build_string (int, const char *);
+extern tree my_build_string_pointer (int, const char *);
+extern tree add_objc_string (tree ident, string_section);
+extern tree get_objc_string_decl (tree, string_section);
+
+extern void add_class_reference (tree);
+
+#ifdef OBJCPLUS
+extern void objc_start_function (tree, tree, tree, tree);
+extern tree objc_get_parm_info (int);
+#else
+extern void objc_start_function (tree, tree, tree, struct c_arg_info *);
+extern struct c_arg_info *objc_get_parm_info (int);
+#endif
+extern void objc_push_parm (tree);
+extern tree get_arg_type_list (tree, int, int);
+
+/* Stuff that should be migrated to shared support (or some v1-only file). */
+extern void build_super_template (void);
+
+extern tree objc_build_component_ref (tree, tree);
+
+extern tree objc_v2_encode_prop_attr (tree);
+extern tree build_descriptor_table_initializer (tree, tree);
+extern tree build_method_prototype_list_template (tree, int);
+extern tree build_protocol_initializer (tree, tree, tree, tree, tree);
+
+/* Stuff that should be migrated to shared encode. */
+extern tree encode_method_prototype (tree);
+extern void encode_field_decl (tree, int, int);
+
+/* Moved or new routines in objc-runtime-shared-support.c */
+
+extern tree build_selector (tree);
+extern tree build_method_template (void);
+extern tree build_method_prototype_template (void);
+extern tree build_method_list_template (tree, int);
+
+extern tree build_dispatch_table_initializer (tree, tree);
+extern void diagnose_missing_method (tree, location_t);
+extern void build_next_selector_translation_table (void);
+extern void generate_protocol_references (tree);
+extern void build_module_descriptor (long, tree);
+extern tree build_ivar_list_initializer (tree, tree);
+extern tree build_ivar_list_template (tree, int);
+extern tree build_ivar_template (void);
+
+extern void generate_strings (void);
+
+extern void dump_interface (FILE *, tree);
+extern int generating_instance_variables;
+extern FILE *gen_declaration_file;
+
+#endif /* _OBJC_RUNTIME_SHARED_SUPPORT_H_ */
diff --git a/gcc/objcp/ChangeLog b/gcc/objcp/ChangeLog
index 70c71e9686d..97d28f85440 100644
--- a/gcc/objcp/ChangeLog
+++ b/gcc/objcp/ChangeLog
@@ -1,3 +1,28 @@
+2011-02-20 Nicola Pero <nicola.pero@meta-innovation.com>
+
+ PR objc++/47711
+ * config-lang.in (gtfiles): Updated list.
+
+2011-02-17 Iain Sandoe <iains@gcc.gnu.org>
+
+ * Make-lang.in (START_HDRS): New.
+ (OBJCXX_OBJS): Added new object files from objc/.
+ (objcp/objcp-act.o): Updated prerequisites.
+ (objcp/objcp-lang.o): Updated prerequisites.
+ (objcp/objc-runtime-shared-support.o): New.
+ (objcp/objc-gnu-runtime-abi-01.o): New.
+ (objcp/objc-next-runtime-abi-01.o): New.
+ (objcp/objc-next-runtime-abi-02.o): New.
+ * config-lang.in (gtfiles): Updated.
+ * objcp-lang.c (objcxx_eh_personality): Removed.
+ (LANG_HOOKS_EH_PERSONALITY): Removed.
+ (LANG_HOOKS_EH_RUNTIME_TYPE): Removed.
+ (objcp_eh_personality_decl): Removed.
+
+2011-02-07 Mike Stump <mikestump@comcast.net>
+
+ * Make-lang.in (obj-c++.tags): Don't include *.y.
+
2010-12-29 Nicola Pero <nicola.pero@meta-innovation.com>
* objcp-lang.c (objcp_tsubst_copy_and_build): Update call to
diff --git a/gcc/objcp/Make-lang.in b/gcc/objcp/Make-lang.in
index 9fbef056228..5bbd27eec35 100644
--- a/gcc/objcp/Make-lang.in
+++ b/gcc/objcp/Make-lang.in
@@ -1,5 +1,5 @@
# Top level -*- makefile -*- fragment for GNU Objective-C++
-# Copyright (C) 2005, 2007, 2008, 2009, 2010
+# Copyright (C) 2005, 2007, 2008, 2009, 2010, 2011
# Free Software Foundation, Inc.
# Contributed by Ziemowit Laski <zlaski@apple.com>
@@ -44,12 +44,19 @@ obj-c++: cc1objplus$(exeext)
# Tell GNU make to ignore these if they exist.
.PHONY: obj-c++
+START_HDRS = $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) $(CXX_TREE_H) \
+ langhooks.h c-family/c-objc.h objc/objc-act.h
+
# Use maximal warnings for this front end. Also, make ObjC and C++
# headers accessible.
objcp-warn = $(STRICT_WARN) -DOBJCPLUS -I$(srcdir)/objc -I$(srcdir)/cp
# Language-specific object files for Objective C++.
OBJCXX_OBJS = objcp/objcp-act.o objcp/objcp-lang.o objcp/objcp-decl.o \
+ objcp/objc-runtime-shared-support.o \
+ objcp/objc-gnu-runtime-abi-01.o \
+ objcp/objc-next-runtime-abi-01.o \
+ objcp/objc-next-runtime-abi-02.o \
$(CXX_AND_OBJCXX_OBJS)
obj-c++_OBJS = $(OBJCXX_OBJS) cc1objplus-checksum.o
@@ -69,23 +76,48 @@ cc1objplus$(exeext): $(OBJCXX_OBJS) cc1objplus-checksum.o $(BACKEND) $(LIBDEPS)
# Objective C++ language specific files.
-objcp/objcp-lang.o : objcp/objcp-lang.c \
- $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) $(CXX_TREE_H) \
- $(C_COMMON_H) $(LANGHOOKS_DEF_H) objc/objc-act.h cp/cp-objcp-common.h \
- $(TARGET_H) gtype-objcp.h c-family/c-objc.h
+objcp/objcp-lang.o : objcp/objcp-lang.c $(START_HDRS) \
+ $(C_COMMON_H) $(LANGHOOKS_DEF_H) cp/cp-objcp-common.h \
+ $(TARGET_H) gtype-objcp.h
objcp/objcp-decl.o : objcp/objcp-decl.c \
$(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) $(CXX_TREE_H) \
objc/objc-act.h objcp/objcp-decl.h c-family/c-objc.h
+objcp/objc-runtime-shared-support.o : objc/objc-runtime-shared-support.c \
+ $(START_HDRS) objc/objc-runtime-shared-support.h $(OBSTACK_H) \
+ objc/objc-next-metadata-tags.h gt-objc-objc-runtime-shared-support.h
+ $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $< \
+ $(OUTPUT_OPTION)
+
+objcp/objc-gnu-runtime-abi-01.o: objc/objc-gnu-runtime-abi-01.c $(START_HDRS) \
+ objc/objc-runtime-hooks.h $(GGC_H) \
+ gt-objc-objc-gnu-runtime-abi-01.h toplev.h
+ $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $< \
+ $(OUTPUT_OPTION)
+
+objcp/objc-next-runtime-abi-01.o: objc/objc-next-runtime-abi-01.c $(START_HDRS) \
+ $(GGC_H) objc/objc-runtime-hooks.h \
+ objc/objc-next-metadata-tags.h gt-objc-objc-next-runtime-abi-01.h output.h \
+ objc/objc-runtime-shared-support.h $(TARGET_H)
+ $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $< \
+ $(OUTPUT_OPTION)
+
+objcp/objc-next-runtime-abi-02.o: objc/objc-next-runtime-abi-02.c $(START_HDRS) \
+ $(GGC_H) objc/objc-runtime-hooks.h \
+ objc/objc-next-metadata-tags.h gt-objc-objc-next-runtime-abi-02.h $(TARGET_H) \
+ objc/objc-runtime-shared-support.h $(OBSTACK_H)
+ $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $< \
+ $(OUTPUT_OPTION)
+
+
# The following must be an explicit rule; please keep in sync with the implicit
# one in Makefile.in.
-objcp/objcp-act.o : objc/objc-act.c \
- $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) $(RTL_H) $(TM_P_H) \
- $(EXPR_H) $(TARGET_H) $(CXX_TREE_H) $(DIAGNOSTIC_H) toplev.h $(FLAGS_H) \
- objc/objc-act.h input.h $(FUNCTION_H) output.h debug.h langhooks.h \
+objcp/objcp-act.o : objc/objc-act.c $(START_HDRS) $(GGC_H) \
+ $(RTL_H) $(EXPR_H) $(TARGET_H) $(DIAGNOSTIC_H) toplev.h $(FLAGS_H) \
+ input.h $(FUNCTION_H) output.h debug.h $(OBSTACK_H) \
objcp/objcp-decl.h $(LANGHOOKS_DEF_H) $(HASHTAB_H) gt-objc-objc-act.h \
- $(GIMPLE_H) c-family/c-objc.h
+ $(GIMPLE_H) objc/objc-runtime-hooks.h objc/objc-runtime-shared-support.h
$(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $< \
$(OUTPUT_OPTION)
@@ -110,7 +142,7 @@ obj-c++.man:
obj-c++.install-plugin:
obj-c++.tags: force
- cd $(srcdir)/objcp; etags -o TAGS.sub *.y *.c *.h; \
+ cd $(srcdir)/objcp; etags -o TAGS.sub *.c *.h; \
etags --include TAGS.sub --include ../TAGS.sub
lang_checks += check-obj-c++
diff --git a/gcc/objcp/config-lang.in b/gcc/objcp/config-lang.in
index 962b9a8fccf..8c3d9c54452 100644
--- a/gcc/objcp/config-lang.in
+++ b/gcc/objcp/config-lang.in
@@ -1,5 +1,5 @@
# Top level configure fragment for GNU Objective-C++.
-# Copyright (C) 2005, 2007, 2010 Free Software Foundation, Inc.
+# Copyright (C) 2005, 2007, 2010, 2011 Free Software Foundation, Inc.
# Contributed by Ziemowit Laski <zlaski@apple.com>
#This file is part of GCC.
@@ -37,4 +37,5 @@ build_by_default="no"
lang_requires="objc c++"
subdir_requires="objc cp"
-gtfiles="\$(srcdir)/objcp/objcp-decl.c \$(srcdir)/objc/objc-act.c \$(srcdir)/objc/objc-act.h \$(srcdir)/cp/rtti.c \$(srcdir)/cp/mangle.c \$(srcdir)/cp/name-lookup.h \$(srcdir)/cp/name-lookup.c \$(srcdir)/cp/cp-tree.h \$(srcdir)/cp/decl.h \$(srcdir)/cp/call.c \$(srcdir)/cp/decl.c \$(srcdir)/cp/decl2.c \$(srcdir)/cp/pt.c \$(srcdir)/cp/repo.c \$(srcdir)/cp/semantics.c \$(srcdir)/cp/tree.c \$(srcdir)/cp/parser.c \$(srcdir)/cp/method.c \$(srcdir)/cp/typeck2.c \$(srcdir)/c-family/c-common.c \$(srcdir)/c-family/c-common.h \$(srcdir)/c-family/c-objc.h \$(srcdir)/c-family/c-lex.c \$(srcdir)/c-family/c-cppbuiltin.c \$(srcdir)/c-family/c-pragma.h \$(srcdir)/c-family/c-pragma.c \$(srcdir)/cp/cp-objcp-common.c"
+gtfiles="\$(srcdir)/objc/objc-act.h \$(srcdir)/objc/objc-act.c \$(srcdir)/objc/objc-runtime-shared-support.c \$(srcdir)/objc/objc-gnu-runtime-abi-01.c \$(srcdir)/objc/objc-next-runtime-abi-01.c \$(srcdir)/objc/objc-next-runtime-abi-02.c \$(srcdir)/cp/call.c \$(srcdir)/cp/class.c \$(srcdir)/cp/cp-tree.h \$(srcdir)/cp/decl.c \$(srcdir)/cp/decl2.c \$(srcdir)/cp/mangle.c \$(srcdir)/cp/method.c \$(srcdir)/cp/name-lookup.h \$(srcdir)/cp/name-lookup.c \$(srcdir)/cp/cp-objcp-common.c \$(srcdir)/cp/parser.c \$(srcdir)/cp/pt.c \$(srcdir)/cp/repo.c \$(srcdir)/cp/rtti.c \$(srcdir)/cp/semantics.c \$(srcdir)/cp/tree.c \$(srcdir)/cp/typeck2.c \$(srcdir)/c-family/c-common.c \$(srcdir)/c-family/c-common.h \$(srcdir)/c-family/c-objc.h \$(srcdir)/c-family/c-lex.c \$(srcdir)/c-family/c-cppbuiltin.c \$(srcdir)/c-family/c-pragma.h \$(srcdir)/c-family/c-pragma.c "
+
diff --git a/gcc/objcp/objcp-lang.c b/gcc/objcp/objcp-lang.c
index fa674aafc11..fe2be66fff6 100644
--- a/gcc/objcp/objcp-lang.c
+++ b/gcc/objcp/objcp-lang.c
@@ -1,5 +1,5 @@
/* Language-dependent hooks for Objective-C++.
- Copyright 2005, 2007, 2008, 2010 Free Software Foundation, Inc.
+ Copyright 2005, 2007, 2008, 2010, 2011 Free Software Foundation, Inc.
Contributed by Ziemowit Laski <zlaski@apple.com>
This file is part of GCC.
@@ -18,7 +18,6 @@ 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/>. */
-
#include "config.h"
#include "system.h"
#include "coretypes.h"
@@ -35,7 +34,6 @@ along with GCC; see the file COPYING3. If not see
enum c_language_kind c_language = clk_objcxx;
static void objcxx_init_ts (void);
-static tree objcxx_eh_personality (void);
/* Lang hooks common to C++ and ObjC++ are declared in cp/cp-objcp-common.h;
consequently, there should be very few hooks below. */
@@ -48,10 +46,6 @@ static tree objcxx_eh_personality (void);
#define LANG_HOOKS_GIMPLIFY_EXPR objc_gimplify_expr
#undef LANG_HOOKS_INIT_TS
#define LANG_HOOKS_INIT_TS objcxx_init_ts
-#undef LANG_HOOKS_EH_PERSONALITY
-#define LANG_HOOKS_EH_PERSONALITY objcxx_eh_personality
-#undef LANG_HOOKS_EH_RUNTIME_TYPE
-#define LANG_HOOKS_EH_RUNTIME_TYPE build_eh_type_type
/* Each front end provides its own lang hook initializer. */
struct lang_hooks lang_hooks = LANG_HOOKS_INITIALIZER;
@@ -145,14 +139,4 @@ objcxx_init_ts (void)
init_shadowed_var_for_decl ();
}
-static GTY(()) tree objcp_eh_personality_decl;
-
-static tree
-objcxx_eh_personality (void)
-{
- if (!objcp_eh_personality_decl)
- objcp_eh_personality_decl = build_personality_function ("gxx");
- return objcp_eh_personality_decl;
-}
-
#include "gtype-objcp.h"
diff --git a/gcc/omega.c b/gcc/omega.c
index aee99e72a84..1717f8e4524 100644
--- a/gcc/omega.c
+++ b/gcc/omega.c
@@ -181,24 +181,6 @@ omega_no_procedure (omega_pb pb ATTRIBUTE_UNUSED)
void (*omega_when_reduced) (omega_pb) = omega_no_procedure;
-/* Compute the greatest common divisor of A and B. */
-
-static inline int
-gcd (int b, int a)
-{
- if (b == 1)
- return 1;
-
- while (b != 0)
- {
- int t = b;
- b = a % b;
- a = t;
- }
-
- return a;
-}
-
/* Print to FILE from PB equation E with all its coefficients
multiplied by C. */
diff --git a/gcc/optc-gen.awk b/gcc/optc-gen.awk
index 4aaa2a6041a..502b23bf6e0 100644
--- a/gcc/optc-gen.awk
+++ b/gcc/optc-gen.awk
@@ -1,4 +1,4 @@
-# Copyright (C) 2003, 2004, 2007, 2008, 2009, 2010
+# Copyright (C) 2003, 2004, 2007, 2008, 2009, 2010, 2011
# Free Software Foundation, Inc.
# Contributed by Kelley Cook, June 2004.
# Original code from Neil Booth, May 2003.
@@ -250,6 +250,10 @@ for (i = 0; i < n_opts; i++) {
print "#undef x_" name
}
}
+for (i = 0; i < n_opts; i++) {
+ if (flag_set_p("SetByCombined", flags[i]))
+ print " false, /* frontend_set_" var_name(flags[i]) " */"
+}
print "};"
print ""
print "struct gcc_options global_options;"
diff --git a/gcc/opth-gen.awk b/gcc/opth-gen.awk
index db32121f914..c3f6c04ebfb 100644
--- a/gcc/opth-gen.awk
+++ b/gcc/opth-gen.awk
@@ -1,4 +1,4 @@
-# Copyright (C) 2003,2004,2005,2006,2007,2008, 2010
+# Copyright (C) 2003,2004,2005,2006,2007,2008, 2010, 2011
# Free Software Foundation, Inc.
# Contributed by Kelley Cook, June 2004.
# Original code from Neil Booth, May 2003.
@@ -193,6 +193,13 @@ for (i = 0; i < n_opts; i++) {
print "#endif"
}
}
+for (i = 0; i < n_opts; i++) {
+ if (flag_set_p("SetByCombined", flags[i])) {
+ print "#ifndef GENERATOR_FILE"
+ print " bool frontend_set_" var_name(flags[i]) ";"
+ print "#endif"
+ }
+}
print "#ifndef GENERATOR_FILE"
print "};"
print "extern struct gcc_options global_options;"
diff --git a/gcc/opts-common.c b/gcc/opts-common.c
index e6cb552df13..f958b7ed953 100644
--- a/gcc/opts-common.c
+++ b/gcc/opts-common.c
@@ -607,11 +607,15 @@ decode_cmdline_option (const char **argv, unsigned int lang_mask,
{
if (i < result)
{
+ size_t len;
if (opt_index == OPT_SPECIAL_unknown)
decoded->canonical_option[i] = argv[i];
else
decoded->canonical_option[i] = NULL;
- total_len += strlen (argv[i]) + 1;
+ len = strlen (argv[i]);
+ /* If the argument is an empty string, we will print it as "" in
+ orig_option_with_args_text. */
+ total_len += (len != 0 ? len : 2) + 1;
}
else
decoded->canonical_option[i] = NULL;
@@ -637,7 +641,14 @@ decode_cmdline_option (const char **argv, unsigned int lang_mask,
{
size_t len = strlen (argv[i]);
- memcpy (p, argv[i], len);
+ /* Print the empty string verbally. */
+ if (len == 0)
+ {
+ *p++ = '"';
+ *p++ = '"';
+ }
+ else
+ memcpy (p, argv[i], len);
p += len;
if (i == result - 1)
*p++ = 0;
@@ -960,12 +971,6 @@ read_cmdline_option (struct gcc_options *opts,
return;
}
- if (decoded->errors & CL_ERR_WRONG_LANG)
- {
- handlers->wrong_lang_callback (decoded, lang_mask);
- return;
- }
-
if (decoded->errors & CL_ERR_MISSING_ARG)
{
if (option->missing_argument_error)
@@ -1012,6 +1017,12 @@ read_cmdline_option (struct gcc_options *opts,
return;
}
+ if (decoded->errors & CL_ERR_WRONG_LANG)
+ {
+ handlers->wrong_lang_callback (decoded, lang_mask);
+ return;
+ }
+
gcc_assert (!decoded->errors);
if (!handle_option (opts, opts_set, decoded, lang_mask, DK_UNSPECIFIED,
diff --git a/gcc/opts.c b/gcc/opts.c
index 67fb6dac2da..9f93356539f 100644
--- a/gcc/opts.c
+++ b/gcc/opts.c
@@ -1,5 +1,5 @@
/* Command line option handling.
- Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
+ Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
Free Software Foundation, Inc.
Contributed by Neil Booth.
@@ -456,6 +456,7 @@ static const struct default_options default_options_table[] =
{ OPT_LEVELS_1_PLUS, OPT_ftree_sink, NULL, 1 },
{ OPT_LEVELS_1_PLUS, OPT_ftree_ch, NULL, 1 },
{ OPT_LEVELS_1_PLUS, OPT_fcombine_stack_adjustments, NULL, 1 },
+ { OPT_LEVELS_1_PLUS, OPT_fcompare_elim, NULL, 1 },
/* -O2 optimizations. */
{ OPT_LEVELS_2_PLUS, OPT_finline_small_functions, NULL, 1 },
@@ -523,7 +524,6 @@ default_options_optimization (struct gcc_options *opts,
{
unsigned int i;
int opt2;
- int ofast = 0;
/* Scan to see what optimization level has been specified. That will
determine the default value of many flags. */
@@ -537,7 +537,7 @@ default_options_optimization (struct gcc_options *opts,
{
opts->x_optimize = 1;
opts->x_optimize_size = 0;
- ofast = 0;
+ opts->x_optimize_fast = 0;
}
else
{
@@ -552,7 +552,7 @@ default_options_optimization (struct gcc_options *opts,
if ((unsigned int) opts->x_optimize > 255)
opts->x_optimize = 255;
opts->x_optimize_size = 0;
- ofast = 0;
+ opts->x_optimize_fast = 0;
}
}
break;
@@ -562,14 +562,14 @@ default_options_optimization (struct gcc_options *opts,
/* Optimizing for size forces optimize to be 2. */
opts->x_optimize = 2;
- ofast = 0;
+ opts->x_optimize_fast = 0;
break;
case OPT_Ofast:
/* -Ofast only adds flags to -O3. */
opts->x_optimize_size = 0;
opts->x_optimize = 3;
- ofast = 1;
+ opts->x_optimize_fast = 1;
break;
default:
@@ -580,7 +580,7 @@ default_options_optimization (struct gcc_options *opts,
maybe_default_options (opts, opts_set, default_options_table,
opts->x_optimize, opts->x_optimize_size,
- ofast, lang_mask, handlers, loc, dc);
+ opts->x_optimize_fast, lang_mask, handlers, loc, dc);
/* -O2 param settings. */
opt2 = (opts->x_optimize >= 2);
@@ -610,7 +610,7 @@ default_options_optimization (struct gcc_options *opts,
maybe_default_options (opts, opts_set,
targetm.target_option.optimization_table,
opts->x_optimize, opts->x_optimize_size,
- ofast, lang_mask, handlers, loc, dc);
+ opts->x_optimize_fast, lang_mask, handlers, loc, dc);
}
/* After all options at LOC have been read into OPTS and OPTS_SET,
@@ -632,7 +632,8 @@ finish_options (struct gcc_options *opts, struct gcc_options *opts_set,
if (opts->x_dump_dir_name)
opts->x_dump_base_name = concat (opts->x_dump_dir_name,
opts->x_dump_base_name, NULL);
- else if (opts->x_aux_base_name)
+ else if (opts->x_aux_base_name
+ && strcmp (opts->x_aux_base_name, HOST_BIT_BUCKET) != 0)
{
const char *aux_base;
@@ -1755,15 +1756,23 @@ set_Wstrict_aliasing (struct gcc_options *opts, int onoff)
static void
set_fast_math_flags (struct gcc_options *opts, int set)
{
- opts->x_flag_unsafe_math_optimizations = set;
- set_unsafe_math_optimizations_flags (opts, set);
- opts->x_flag_finite_math_only = set;
- opts->x_flag_errno_math = !set;
+ if (!opts->frontend_set_flag_unsafe_math_optimizations)
+ {
+ opts->x_flag_unsafe_math_optimizations = set;
+ set_unsafe_math_optimizations_flags (opts, set);
+ }
+ if (!opts->frontend_set_flag_finite_math_only)
+ opts->x_flag_finite_math_only = set;
+ if (!opts->frontend_set_flag_errno_math)
+ opts->x_flag_errno_math = !set;
if (set)
{
- opts->x_flag_signaling_nans = 0;
- opts->x_flag_rounding_math = 0;
- opts->x_flag_cx_limited_range = 1;
+ if (!opts->frontend_set_flag_signaling_nans)
+ opts->x_flag_signaling_nans = 0;
+ if (!opts->frontend_set_flag_rounding_math)
+ opts->x_flag_rounding_math = 0;
+ if (!opts->frontend_set_flag_cx_limited_range)
+ opts->x_flag_cx_limited_range = 1;
}
}
@@ -1772,10 +1781,14 @@ set_fast_math_flags (struct gcc_options *opts, int set)
static void
set_unsafe_math_optimizations_flags (struct gcc_options *opts, int set)
{
- opts->x_flag_trapping_math = !set;
- opts->x_flag_signed_zeros = !set;
- opts->x_flag_associative_math = set;
- opts->x_flag_reciprocal_math = set;
+ if (!opts->frontend_set_flag_trapping_math)
+ opts->x_flag_trapping_math = !set;
+ if (!opts->frontend_set_flag_signed_zeros)
+ opts->x_flag_signed_zeros = !set;
+ if (!opts->frontend_set_flag_associative_math)
+ opts->x_flag_associative_math = set;
+ if (!opts->frontend_set_flag_reciprocal_math)
+ opts->x_flag_reciprocal_math = set;
}
/* Return true iff flags in OPTS are set as if -ffast-math. */
diff --git a/gcc/output.h b/gcc/output.h
index 39225a3a6cc..c668d352112 100644
--- a/gcc/output.h
+++ b/gcc/output.h
@@ -1,7 +1,7 @@
/* Declarations for insn-output.c. These functions are defined in recog.c,
final.c, and varasm.c.
Copyright (C) 1987, 1991, 1994, 1997, 1998, 1999, 2000, 2001, 2002,
- 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
+ 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
Free Software Foundation, Inc.
This file is part of GCC.
@@ -441,7 +441,8 @@ extern void no_asm_to_stream (FILE *);
#define SECTION_DECLARED 0x100000 /* section has been used */
#define SECTION_STYLE_MASK 0x600000 /* bits used for SECTION_STYLE */
#define SECTION_COMMON 0x800000 /* contains common data */
-#define SECTION_MACH_DEP 0x1000000 /* subsequent bits reserved for target */
+#define SECTION_RELRO 0x1000000 /* data is readonly after relocation processing */
+#define SECTION_MACH_DEP 0x2000000 /* subsequent bits reserved for target */
/* This SECTION_STYLE is used for unnamed sections that we can switch
to using a special assembler directive. */
@@ -585,6 +586,7 @@ extern section *get_unnamed_section (unsigned int, void (*) (const void *),
const void *);
extern section *get_section (const char *, unsigned int, tree);
extern section *get_named_section (tree, const char *, int);
+extern section *get_variable_section (tree, bool);
extern void place_block_symbol (rtx);
extern rtx get_section_anchor (struct object_block *, HOST_WIDE_INT,
enum tls_model);
diff --git a/gcc/params.def b/gcc/params.def
index 96dc858cf82..5749eb2e5f3 100644
--- a/gcc/params.def
+++ b/gcc/params.def
@@ -483,6 +483,11 @@ DEFPARAM(PARAM_SCEV_MAX_EXPR_SIZE,
"Bound on size of expressions used in the scalar evolutions analyzer",
100, 0, 0)
+DEFPARAM(PARAM_SCEV_MAX_EXPR_COMPLEXITY,
+ "scev-max-expr-complexity",
+ "Bound on the complexity of the expressions in the scalar evolutions analyzer",
+ 10, 0, 0)
+
DEFPARAM(PARAM_OMEGA_MAX_VARS,
"omega-max-vars",
"Bound on the number of variables in Omega constraint systems",
diff --git a/gcc/passes.c b/gcc/passes.c
index 090110e2590..a33a6afa643 100644
--- a/gcc/passes.c
+++ b/gcc/passes.c
@@ -729,7 +729,6 @@ init_optimization_passes (void)
NEXT_PASS (pass_build_cfg);
NEXT_PASS (pass_warn_function_return);
NEXT_PASS (pass_build_cgraph_edges);
- NEXT_PASS (pass_inline_parameters);
*p = NULL;
/* Interprocedural optimization passes. */
@@ -747,12 +746,8 @@ init_optimization_passes (void)
NEXT_PASS (pass_build_ssa);
NEXT_PASS (pass_lower_vector);
NEXT_PASS (pass_early_warn_uninitialized);
- /* Note that it is not strictly necessary to schedule an early
- inline pass here. However, some test cases (e.g.,
- g++.dg/other/p334435.C g++.dg/other/i386-1.C) expect extern
- inline functions to be inlined even at -O0. This does not
- happen during the first early inline pass. */
NEXT_PASS (pass_rebuild_cgraph_edges);
+ NEXT_PASS (pass_inline_parameters);
NEXT_PASS (pass_early_inline);
NEXT_PASS (pass_all_early_optimizations);
{
@@ -887,15 +882,14 @@ init_optimization_passes (void)
NEXT_PASS (pass_record_bounds);
NEXT_PASS (pass_check_data_deps);
NEXT_PASS (pass_loop_distribution);
- NEXT_PASS (pass_linear_transform);
NEXT_PASS (pass_copy_prop);
NEXT_PASS (pass_graphite);
{
struct opt_pass **p = &pass_graphite.pass.sub;
NEXT_PASS (pass_graphite_transforms);
+ NEXT_PASS (pass_lim);
NEXT_PASS (pass_copy_prop);
NEXT_PASS (pass_dce_loop);
- NEXT_PASS (pass_lim);
}
NEXT_PASS (pass_iv_canon);
NEXT_PASS (pass_if_conversion);
@@ -1022,6 +1016,7 @@ init_optimization_passes (void)
NEXT_PASS (pass_gcse2);
NEXT_PASS (pass_split_after_reload);
NEXT_PASS (pass_implicit_zee);
+ NEXT_PASS (pass_compare_elim_after_reload);
NEXT_PASS (pass_branch_target_load_optimize1);
NEXT_PASS (pass_thread_prologue_and_epilogue);
NEXT_PASS (pass_rtl_dse2);
diff --git a/gcc/po/ChangeLog b/gcc/po/ChangeLog
index 452e2648c21..9e313329ff3 100644
--- a/gcc/po/ChangeLog
+++ b/gcc/po/ChangeLog
@@ -1,3 +1,15 @@
+2011-01-28 Joseph Myers <joseph@codesourcery.com>
+
+ * ja.po: Update.
+
+2011-01-27 Joseph Myers <joseph@codesourcery.com>
+
+ * ja.po: Update.
+
+2011-01-26 Joseph Myers <joseph@codesourcery.com>
+
+ * ja.po, sv.po: Update.
+
2011-01-13 Joseph Myers <joseph@codesourcery.com>
* ja.po: Update.
diff --git a/gcc/po/ja.po b/gcc/po/ja.po
index e2607d025a2..2d3c821b3ea 100644
--- a/gcc/po/ja.po
+++ b/gcc/po/ja.po
@@ -20,7 +20,7 @@ msgstr ""
"Project-Id-Version: gcc 4.6-b20101218\n"
"Report-Msgid-Bugs-To: http://gcc.gnu.org/bugs.html\n"
"POT-Creation-Date: 2010-12-18 20:02+0000\n"
-"PO-Revision-Date: 2011-01-13 10:32+0900\n"
+"PO-Revision-Date: 2011-01-28 23:06+0900\n"
"Last-Translator: Yasuaki Taniguchi <yasuakit@gmail.com>\n"
"Language-Team: Japanese <translation-team-ja@lists.sourceforge.net>\n"
"MIME-Version: 1.0\n"
@@ -4005,9 +4005,8 @@ msgid "Unexpected end of format string"
msgstr "予期ã—ãªã„書å¼æ–‡å­—列終了ã§ã™"
#: fortran/io.c:554
-#, fuzzy
msgid "Zero width in format descriptor"
-msgstr "%s ã§å¹… 0 ã®ãƒ•ã‚©ãƒ¼ãƒžãƒƒãƒˆã§ã™"
+msgstr ""
#: fortran/io.c:574
msgid "Missing leading left parenthesis"
@@ -6091,15 +6090,15 @@ msgstr "double ã‚’ dword 境界ã«æ•´åˆ—ã™ã‚‹"
#: config/i386/i386.opt:86
msgid "Function starts are aligned to this power of 2"
-msgstr "関数ã®é–‹å§‹ä½ç½®ã‚’ã“ã®å€¤ã®äºŒä¹—ã«æ•´åˆ—ã™ã‚‹"
+msgstr "関数ã®é–‹å§‹ä½ç½®ã‚’ã“ã®äºŒã®ç´¯ä¹—ã«æ•´åˆ—ã™ã‚‹"
#: config/i386/i386.opt:90
msgid "Jump targets are aligned to this power of 2"
-msgstr "ジャンプ先をã“ã®å€¤ã®äºŒä¹—ã«æ•´åˆ—ã™ã‚‹"
+msgstr "ジャンプ先をã“ã®äºŒã®ç´¯ä¹—ã«æ•´åˆ—ã™ã‚‹"
#: config/i386/i386.opt:94
msgid "Loop code aligned to this power of 2"
-msgstr "ループコードをã“ã®å€¤ã®äºŒä¹—ã«æ•´åˆ—ã™ã‚‹"
+msgstr "ループコードをã“ã®äºŒã®ç´¯ä¹—ã«æ•´åˆ—ã™ã‚‹"
#: config/i386/i386.opt:98
msgid "Align destination of the string operations"
@@ -6168,11 +6167,11 @@ msgstr "80387 浮動å°æ•°ç‚¹ç²¾åº¦ã‚’設定ã™ã‚‹ (-mpc32, -mpc64, -mpc80)"
#: config/i386/i386.opt:185
msgid "Attempt to keep stack aligned to this power of 2"
-msgstr "ã§ãã‚‹ã ã‘スタックをã“ã®å€¤ã®äºŒä¹—ã«æ•´åˆ—ã™ã‚‹"
+msgstr "ã§ãã‚‹ã ã‘スタックをã“ã®äºŒã®ç´¯ä¹—ã«æ•´åˆ—ã™ã‚‹"
#: config/i386/i386.opt:189
msgid "Assume incoming stack aligned to this power of 2"
-msgstr ""
+msgstr "å…¥ã£ã¦ãるスタックãŒã“ã®äºŒã®ç´¯ä¹—ã«æ•´åˆ—ã•ã‚Œã¦ã„ã‚‹ã¨è¦‹ãªã™"
#: config/i386/i386.opt:193
msgid "Use push instructions to save outgoing arguments"
@@ -6604,7 +6603,6 @@ msgid "Specify how many bytes should be moved inline before calling out to memcp
msgstr ""
#: config/rs6000/rs6000.opt:366
-#, fuzzy
msgid "Generate isel instructions"
msgstr "isel 命令を生æˆã™ã‚‹"
@@ -7766,9 +7764,8 @@ msgid "Don't optimize block moves"
msgstr "ブロック移動を最é©åŒ–ã—ãªã„"
#: config/mips/mips.opt:221
-#, fuzzy
msgid "Use the mips-tfile postpass"
-msgstr "asm 後éŽç¨‹ã§ mips-tfile を利用ã™ã‚‹"
+msgstr ""
#: config/mips/mips.opt:225
msgid "Allow the use of MT instructions"
@@ -8143,9 +8140,8 @@ msgid "Use call-clobbered registers for parameters and return value"
msgstr "引数ã¨æˆ»ã‚Šå€¤ç”¨ã«å‘¼ã³å‡ºã—ã§ç ´å£Šã•ã‚Œã‚‹ãƒ¬ã‚¸ã‚¹ã‚¿ã‚’使用ã™ã‚‹"
#: config/mmix/mmix.opt:37
-#, fuzzy
msgid "Use epsilon-respecting floating point compare instructions"
-msgstr "ãƒãƒ¼ãƒ‰ã‚¦ã‚§ã‚¢æµ®å‹•å°æ•°ç‚¹å‘½ä»¤ã‚’使用ã™ã‚‹"
+msgstr ""
#: config/mmix/mmix.opt:41
msgid "Use zero-extending memory loads, not sign-extending ones"
@@ -14453,7 +14449,7 @@ msgstr "%d 番目㮠%qE ã®å¼•æ•°ç”¨ã®äº’æ›æ€§ãŒãªã„åž‹ã§ã™"
#: c-typeck.c:5671
#, gcc-internal-format
msgid "incompatible types when assigning to type %qT from type %qT"
-msgstr "incompatible types when assigning to åž‹ %qT ã¸ã®åž‹ %qT ã‹ã‚‰ã®ä»£å…¥æ™‚ã«äº’æ›æ€§ã®ãªã„åž‹ã§ã™"
+msgstr "åž‹ %qT ã¸ã®åž‹ %qT ã‹ã‚‰ã®ä»£å…¥æ™‚ã«äº’æ›æ€§ã®ãªã„åž‹ã§ã™"
#: c-typeck.c:5676
#, gcc-internal-format
@@ -14554,7 +14550,7 @@ msgstr "スカラーåˆæœŸåŒ–å­ãŒä¸­æ‹¬å¼§ã§å›²ã¾ã‚Œã¦ã„ã¾ã™"
#: c-typeck.c:6914
#, gcc-internal-format
msgid "initialization of flexible array member in a nested context"
-msgstr "入れå­ã«ãªã£ãŸæ–‡è„ˆå†…ã§å¯å¤‰é…列メンãƒã‚’åˆæœŸåŒ–ã—ã¦ã„ã¾ã™"
+msgstr "入れå­ã«ãªã£ãŸã‚³ãƒ³ãƒ†ã‚­ã‚¹ãƒˆå†…ã§å¯å¤‰é…列メンãƒã‚’åˆæœŸåŒ–ã—ã¦ã„ã¾ã™"
#: c-typeck.c:6945
#, gcc-internal-format
@@ -16856,7 +16852,7 @@ msgstr "--help= オプションã¸ã®èªè­˜ã§ããªã„引数ã§ã™: %q.*s"
#: opts.c:1503
#, gcc-internal-format
msgid "structure alignment must be a small power of two, not %d"
-msgstr "構造体ã®æ•´åˆ—㯠%d ã§ã¯ãªãã€å°ã•ãªäºŒã®ä¹—æ•°ã§ãªã‘ã‚Œã°ã„ã‘ã¾ã›ã‚“"
+msgstr "構造体ã®æ•´åˆ—㯠%d ã§ã¯ãªãã€å°ã•ãªäºŒã®ç´¯ä¹—ã§ãªã‘ã‚Œã°ã„ã‘ã¾ã›ã‚“"
#: opts.c:1611
#, gcc-internal-format
@@ -17203,9 +17199,9 @@ msgid "unable to find a register to spill in class %qs"
msgstr ""
#: reload1.c:4625
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "%<asm%> operand requires impossible reload"
-msgstr "`asm' オペランドã¯å†ãƒ­ãƒ¼ãƒ‰ã§ããªã„事ãŒè¦æ±‚ã•ã‚Œã¾ã™"
+msgstr "%<asm%> 被演算å­ã¯å†ãƒ­ãƒ¼ãƒ‰å‡ºæ¥ãªã„ã“ã¨ãŒå¿…è¦ã§ã™"
#: reload1.c:6014
#, gcc-internal-format
@@ -17398,14 +17394,14 @@ msgid "size of %q+D is larger than %wd bytes"
msgstr "%q+D ã®ã‚µã‚¤ã‚ºã¯ %wd ãƒã‚¤ãƒˆã‚ˆã‚Šå¤§ãã„ã§ã™"
#: stor-layout.c:1167
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "packed attribute causes inefficient alignment for %q+D"
-msgstr "packed 属性㯠`%s' ã«å¯¾ã—ã¦ä¸åŠ¹çŽ‡ãªã‚¢ãƒ©ã‚¤ãƒ³ãƒ¡ãƒ³ãƒˆã‚’引ãèµ·ã“ã—ã¾ã™"
+msgstr "%q+D ã® packed 属性㯠éžåŠ¹çŽ‡ãªæ•´åˆ—ã®åŽŸå› ã¨ãªã‚Šã¾"
#: stor-layout.c:1171
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "packed attribute is unnecessary for %q+D"
-msgstr "packed 属性㯠`%s' ã«ã¯å¿…è¦ã‚ã‚Šã¾ã›ã‚“"
+msgstr "packed 属性㯠%q+D ã«ã¯å¿…è¦ã‚ã‚Šã¾ã›ã‚“"
#: stor-layout.c:1189
#, gcc-internal-format
@@ -17415,27 +17411,27 @@ msgstr ""
#: stor-layout.c:1250
#, gcc-internal-format
msgid "offset of packed bit-field %qD has changed in GCC 4.4"
-msgstr ""
+msgstr "packed ビットフィールド %qD ã®ã‚ªãƒ•ã‚»ãƒƒãƒˆã¯ GCC 4.4 ã§å¤‰æ›´ã•ã‚Œã¦ã„ã¾ã™"
#: stor-layout.c:1556
#, gcc-internal-format
msgid "padding struct size to alignment boundary"
-msgstr "アラインメント境界ã®ã‚µã‚¤ã‚ºã«æ§‹é€ ä½“をパディングã—ã¾ã™"
+msgstr ""
#: stor-layout.c:1584
#, gcc-internal-format
msgid "packed attribute causes inefficient alignment for %qE"
-msgstr ""
+msgstr "packed 属性㯠%qE ã®éžåŠ¹çŽ‡ãªæ•´åˆ—ã®åŽŸå› ã¨ãªã‚Šã¾ã™"
#: stor-layout.c:1588
#, gcc-internal-format
msgid "packed attribute is unnecessary for %qE"
-msgstr ""
+msgstr "packed 属性㯠%qE ã«ã¯å¿…è¦ã‚ã‚Šã¾ã›ã‚“"
#: stor-layout.c:1594
#, gcc-internal-format
msgid "packed attribute causes inefficient alignment"
-msgstr ""
+msgstr "packed 属性ã¯éžåŠ¹çŽ‡ãªæ•´åˆ—ã®åŽŸå› ã¨ãªã‚Šã¾ã™"
#: stor-layout.c:1596
#, gcc-internal-format
@@ -17595,7 +17591,7 @@ msgstr "-fstack-protector ã¯ã“ã®ã‚¿ãƒ¼ã‚²ãƒƒãƒˆã§ã¯ã‚µãƒãƒ¼ãƒˆã•ã‚Œã¦ã„
#: toplev.c:1594
#, gcc-internal-format
msgid "unwind tables currently require a frame pointer for correctness"
-msgstr ""
+msgstr "å·»ã戻㗠(unwind) 表ã¯ç¾åœ¨ã®ã¨ã“ã‚訂正用ã®ãƒ•ãƒ¬ãƒ¼ãƒ ãƒã‚¤ãƒ³ã‚¿ã‚’å¿…è¦ã¨ã—ã¾ã™"
#: toplev.c:1822
#, gcc-internal-format
@@ -17630,7 +17626,7 @@ msgstr ""
#: tree-cfg.c:2605 tree-cfg.c:3734
#, gcc-internal-format
msgid "INDIRECT_REF in gimple IL"
-msgstr ""
+msgstr "INDIRECT_REF ㌠gimple IL 内ã«ã‚ã‚Šã¾ã™"
#: tree-cfg.c:2613
#, gcc-internal-format
@@ -17675,12 +17671,12 @@ msgstr "BIT_FIELD_REF ã¸ã®ç„¡åŠ¹ãªä½ç½®ã¾ãŸã¯ã‚µã‚¤ã‚ºè¢«æ¼”ç®—å­ã§ã™"
#: tree-cfg.c:2735
#, gcc-internal-format
msgid "integral result type precision does not match field size of BIT_FIELD_REF"
-msgstr ""
+msgstr "æ•´æ•°çµæžœã®åž‹ç²¾åº¦ãŒ BIT_FIELD_REF ã®ãƒ•ã‚£ãƒ¼ãƒ«ãƒ‰ã‚µã‚¤ã‚ºã«é©åˆã—ã¾ã›ã‚“"
#: tree-cfg.c:2743
#, gcc-internal-format
msgid "mode precision of non-integral result does not match field size of BIT_FIELD_REF"
-msgstr ""
+msgstr "éžæ•´æ•°çµæžœã®ãƒ¢ãƒ¼ãƒ‰ç²¾åº¦ãŒ BIT_FIELD_REF ã®ãƒ•ã‚£ãƒ¼ãƒ«ãƒ‰ã‚µã‚¤ã‚ºã«é©åˆã—ã¾ã›ã‚“"
#: tree-cfg.c:2754
#, gcc-internal-format
@@ -17835,7 +17831,7 @@ msgstr "å˜é …演算å­å†…ã§ç„¡åŠ¹ãªè¢«æ¼”ç®—å­ã§ã™"
#: tree-cfg.c:3240
#, gcc-internal-format
msgid "invalid types in nop conversion"
-msgstr ""
+msgstr "nop 変æ›å†…ã§ç„¡åŠ¹ãªåž‹ã§ã™"
#: tree-cfg.c:3255
#, gcc-internal-format
@@ -17895,7 +17891,7 @@ msgstr ""
#: tree-cfg.c:3463
#, gcc-internal-format
msgid "invalid non-vector operands to vector valued plus"
-msgstr ""
+msgstr "ベクトル値加算ã¸ã®ç„¡åŠ¹ãªéžãƒ™ã‚¯ãƒˆãƒ«è¢«æ¼”ç®—å­ã§ã™"
#: tree-cfg.c:3483
#, gcc-internal-format
@@ -17960,7 +17956,7 @@ msgstr ""
#: tree-cfg.c:3791
#, gcc-internal-format
msgid "invalid COND_EXPR in gimple assignment"
-msgstr ""
+msgstr "gimple 代入内ã§ç„¡åŠ¹ãª COND_EXPR ã§ã™"
#: tree-cfg.c:3856
#, gcc-internal-format
@@ -18030,7 +18026,7 @@ msgstr "å¼å†…"
#: tree-cfg.c:4175
#, gcc-internal-format
msgid "statement marked for throw, but doesn%'t"
-msgstr ""
+msgstr "文㌠throw ã¨ãƒžãƒ¼ã‚¯ã•ã‚Œã¦ã„ã¾ã™ãŒã€ throw ã—ã¾ã›ã‚“"
#: tree-cfg.c:4180
#, gcc-internal-format
@@ -18040,12 +18036,12 @@ msgstr ""
#: tree-cfg.c:4252
#, gcc-internal-format
msgid "dead STMT in EH table"
-msgstr ""
+msgstr "EH 表内ã«ä¸è¦ãª (dead) STMT ãŒã‚ã‚Šã¾ã™"
#: tree-cfg.c:4290
#, gcc-internal-format
msgid "gimple_bb (phi) is set to a wrong basic block"
-msgstr ""
+msgstr "gimple_bb (phi) ãŒé–“é•ã£ãŸåŸºæœ¬ãƒ–ロックã«è¨­å®šã•ã‚Œã¦ã„ã¾ã™"
#: tree-cfg.c:4301
#, gcc-internal-format
@@ -18065,17 +18061,17 @@ msgstr ""
#: tree-cfg.c:4344
#, gcc-internal-format
msgid "invalid GIMPLE statement"
-msgstr "無効㪠GIMPLE å¼ã§ã™"
+msgstr "無効㪠GIMPLE æ–‡ã§ã™"
#: tree-cfg.c:4353
#, gcc-internal-format
msgid "gimple_bb (stmt) is set to a wrong basic block"
-msgstr ""
+msgstr "gimple_bb (stmt) ãŒé–“é•ã£ãŸåŸºæœ¬ãƒ–ロックã«è¨­å®šã•ã‚Œã¦ã„ã¾ã™"
#: tree-cfg.c:4366
#, gcc-internal-format
msgid "incorrect entry in label_to_block_map"
-msgstr ""
+msgstr "label_to_block_map 内ã«é–“é•ã£ãŸã‚¨ãƒ³ãƒˆãƒªãŒã‚ã‚Šã¾ã™"
#: tree-cfg.c:4376
#, gcc-internal-format
@@ -18140,7 +18136,7 @@ msgstr ""
#: tree-cfg.c:4591
#, gcc-internal-format
msgid "explicit goto at end of bb %d"
-msgstr ""
+msgstr "明示的㪠goto ãŒåŸºæœ¬ãƒ–ロック %d ã®æœ«å°¾ã«ã‚ã‚Šã¾ã™"
#: tree-cfg.c:4625
#, gcc-internal-format
@@ -18170,7 +18166,7 @@ msgstr ""
#: tree-cfg.c:7343
#, gcc-internal-format
msgid "%<noreturn%> function does return"
-msgstr ""
+msgstr "%<noreturn%> 関数ãŒæˆ»ã‚Š (return) ã¾ã™"
#: tree-cfg.c:7363
#, gcc-internal-format
@@ -18180,12 +18176,12 @@ msgstr "制御ãŒéž void 関数ã®çµ‚ã‚Šã«åˆ°é”ã—ã¾ã—ãŸ"
#: tree-cfg.c:7499
#, gcc-internal-format
msgid "ignoring return value of %qD, declared with attribute warn_unused_result"
-msgstr ""
+msgstr "warn_unused_result 属性付ãã§å®£è¨€ã•ã‚Œã¦ã„ã‚‹ %qD ã®æˆ»ã‚Šå€¤ã‚’無視ã—ã¦ã„ã¾ã™"
#: tree-cfg.c:7504
#, gcc-internal-format
msgid "ignoring return value of function declared with attribute warn_unused_result"
-msgstr ""
+msgstr "warn_unused_result 属性付ãã§å®£è¨€ã•ã‚Œã¦ã„る関数ã®æˆ»ã‚Šå€¤ã‚’無視ã—ã¦ã„ã¾ã™"
#: tree-dump.c:934
#, gcc-internal-format
@@ -18245,17 +18241,17 @@ msgstr ""
#: tree-inline.c:2971
#, gcc-internal-format
msgid "function %q+F can never be copied because it receives a non-local goto"
-msgstr ""
+msgstr "関数 %q+F ã¯éžå±€æ‰€ goto ã‚’å—ã‘å–ã‚‹ãŸã‚決ã—ã¦è¤‡è£½ã•ã‚Œã¾ã›ã‚“"
#: tree-inline.c:2985
#, gcc-internal-format
msgid "function %q+F can never be copied because it saves address of local label in a static variable"
-msgstr ""
+msgstr "関数 %q+F ã¯é™çš„変数内ã®å±€æ‰€ãƒ©ãƒ™ãƒ«ã®ã‚¢ãƒ‰ãƒ¬ã‚¹ã‚’ä¿å­˜ã™ã‚‹ãŸã‚ã€æ±ºã—ã¦è¤‡å†™ã•ã‚Œã¾ã›ã‚“"
#: tree-inline.c:3022
#, gcc-internal-format
msgid "function %q+F can never be inlined because it uses alloca (override using the always_inline attribute)"
-msgstr ""
+msgstr "関数 %q+F 㯠alloca を使用ã—ã¦ã„ã‚‹ãŸã‚決ã—ã¦ã‚¤ãƒ³ãƒ©ã‚¤ãƒ³åŒ–ã•ã‚Œã¾ã›ã‚“ (always_inline 属性を上書ãã—ã¾ã™)"
#: tree-inline.c:3036
#, gcc-internal-format
@@ -18315,12 +18311,12 @@ msgstr "mudflap 検査㯠ARRAY_RANGE_REF 用ã«ã¯ã¾ã å®Ÿè£…ã•ã‚Œã¦ã„ã¾ã
#: tree-mudflap.c:1102
#, gcc-internal-format
msgid "mudflap cannot track %qE in stub function"
-msgstr ""
+msgstr "mudflap ã¯ã‚¹ã‚¿ãƒ–関数内㮠%qE を追跡ã§ãã¾ã›ã‚“"
#: tree-mudflap.c:1346
#, gcc-internal-format
msgid "mudflap cannot track unknown size extern %qE"
-msgstr ""
+msgstr "mudflap ã¯ä¸æ˜Žãªã‚µã‚¤ã‚ºã®å¤–部 (extern) %qE を追跡ã§ãã¾ã›ã‚“"
#: tree-nomudflap.c:47
#, gcc-internal-format
@@ -18333,9 +18329,9 @@ msgid "size of return value of %q+D is %u bytes"
msgstr "%q+D ã®æˆ»ã‚Šå€¤ã®ã‚µã‚¤ã‚ºãŒ %u ãƒã‚¤ãƒˆã§ã™"
#: tree-optimize.c:453
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "size of return value of %q+D is larger than %wd bytes"
-msgstr "`%s' ã®æˆ»ã‚Šå€¤ã®ã‚µã‚¤ã‚ºãŒ %d ãƒã‚¤ãƒˆã‚ˆã‚Šã‚‚大ãããªã‚Šã¾ã™"
+msgstr "%q+D ã®æˆ»ã‚Šå€¤ã®ã‚µã‚¤ã‚ºãŒ %wd ãƒã‚¤ãƒˆã‚ˆã‚Šå¤§ãã„ã§ã™"
#: tree-outof-ssa.c:783 tree-outof-ssa.c:840 tree-ssa-coalesce.c:952
#: tree-ssa-coalesce.c:967 tree-ssa-coalesce.c:1189 tree-ssa-live.c:1296
@@ -18980,7 +18976,7 @@ msgstr ""
#: c-family/c-common.c:1572
#, gcc-internal-format
msgid "logical %<and%> of mutually exclusive tests is always false"
-msgstr ""
+msgstr "相互ã«æŽ’ä»–çš„ãªå€¤ã®è«–ç† %<and%> 演算ã¯å¸¸ã«å½ (false) ã¨ãªã‚Šã¾ã™"
#: c-family/c-common.c:1607
#, gcc-internal-format
@@ -19371,7 +19367,7 @@ msgstr "è¦æ±‚ã•ã‚ŒãŸæ•´åˆ—ãŒå®šæ•°ã§ã¯ã‚ã‚Šã¾ã›ã‚“"
#: c-family/c-common.c:6590
#, gcc-internal-format
msgid "requested alignment is not a power of 2"
-msgstr "è¦æ±‚ã•ã‚ŒãŸæ•´åˆ—㌠2 ã®ä¹—æ•°ã§ã¯ã‚ã‚Šã¾ã›ã‚“"
+msgstr "è¦æ±‚ã•ã‚ŒãŸæ•´åˆ—㌠2 ã®ç´¯ä¹—ã§ã¯ã‚ã‚Šã¾ã›ã‚“"
#: c-family/c-common.c:6595
#, gcc-internal-format
@@ -19520,7 +19516,7 @@ msgstr "ベクトルã®ã‚µã‚¤ã‚ºãŒ 0 ã§ã™"
#: ada/gcc-interface/utils.c:5447
#, gcc-internal-format
msgid "number of components of the vector not a power of two"
-msgstr "ベクトルã®è¦ç´ ã®æ•°ãŒ 2 ã®ä¹—æ•°ã§ã¯ã‚ã‚Šã¾ã›ã‚“"
+msgstr "ベクトルã®è¦ç´ ã®æ•°ãŒ 2 ã®ç´¯ä¹—ã§ã¯ã‚ã‚Šã¾ã›ã‚“"
#: c-family/c-common.c:7353 ada/gcc-interface/utils.c:5070
#, gcc-internal-format
@@ -19573,14 +19569,14 @@ msgid "%qE attribute requires prototypes with named arguments"
msgstr "%qE 属性ã¯åå‰ä»˜ã引数ãŒã‚るプロトタイプãŒå¿…è¦ã§ã™"
#: c-family/c-common.c:7648
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "%qE attribute only applies to variadic functions"
-msgstr "`%s' 属性ã¯é–¢æ•°ã«å¯¾ã—ã¦ã®ã¿é©ç”¨ã•ã‚Œã¾ã™"
+msgstr ""
#: c-family/c-common.c:7660 ada/gcc-interface/utils.c:5160
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "requested position is not an integer constant"
-msgstr "è¦æ±‚ã•ã‚ŒãŸ init_priority ã¯æ•´æ•°åž‹ã®å®šæ•°ã§ã¯ã‚ã‚Šã¾ã›ã‚“"
+msgstr ""
#: c-family/c-common.c:7668 ada/gcc-interface/utils.c:5167
#, gcc-internal-format
@@ -19770,177 +19766,177 @@ msgstr "関数 %qD ㌠%<asm%> ã®å‡ºåŠ›ã¨ã—ã¦ä½¿ç”¨ã•ã‚Œã¦ã„ã¾ã™"
#: c-family/c-common.c:8629
#, gcc-internal-format
msgid "read-only location %qE used as %<asm%> output"
-msgstr ""
+msgstr "読ã¿å–り専用ä½ç½® %qE ㌠%<asm%> ã®å‡ºåŠ›ã¨ã—ã¦ä½¿ç”¨ã•ã‚Œã¦ã„ã¾ã™"
#: c-family/c-common.c:8642
#, gcc-internal-format
msgid "lvalue required as left operand of assignment"
-msgstr ""
+msgstr "代入ã®å·¦å´ã®è¢«æ¼”ç®—å­ã¨ã—ã¦å·¦è¾ºå€¤ãŒå¿…è¦ã§ã™"
#: c-family/c-common.c:8645
#, gcc-internal-format
msgid "lvalue required as increment operand"
-msgstr ""
+msgstr "インクリメントã®è¢«æ¼”ç®—å­ã¨ã—ã¦å·¦è¾ºå€¤ãŒå¿…è¦ã§ã™"
#: c-family/c-common.c:8648
#, gcc-internal-format
msgid "lvalue required as decrement operand"
-msgstr ""
+msgstr "デクリメントã®è¢«æ¼”ç®—å­ã¨ã—ã¦å·¦è¾ºå€¤ãŒå¿…è¦ã§ã™"
#: c-family/c-common.c:8651
#, gcc-internal-format
msgid "lvalue required as unary %<&%> operand"
-msgstr ""
+msgstr "å˜é … %<&%> ã®è¢«æ¼”ç®—å­ã¨ã—ã¦å·¦è¾ºå€¤ãŒå¿…è¦ã§ã™"
#: c-family/c-common.c:8654
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "lvalue required in asm statement"
-msgstr "asm æ–‡ã®ä¸­ã«ç„¡åŠ¹ãªå·¦è¾ºå€¤"
+msgstr "アセンブラ文内ã«å·¦è¾ºå€¤ãŒå¿…è¦ã§ã™"
#: c-family/c-common.c:8671
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "invalid type argument (have %qT)"
-msgstr "`%s' ã®å¼•æ•°ã¨ã—ã¦ç„¡åŠ¹ãªåž‹"
+msgstr "無効ãªåž‹ã®å¼•æ•°ã§ã™ (%qT åž‹ã§ã™)"
#: c-family/c-common.c:8675
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "invalid type argument of array indexing (have %qT)"
-msgstr "`%s' ã®å¼•æ•°ã¨ã—ã¦ç„¡åŠ¹ãªåž‹"
+msgstr ""
#: c-family/c-common.c:8680
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "invalid type argument of unary %<*%> (have %qT)"
-msgstr "`%s' ã®å¼•æ•°ã¨ã—ã¦ç„¡åŠ¹ãªåž‹"
+msgstr "å˜é …æ¼”ç®—å­ %<*%> ã®ç„¡åŠ¹ãªåž‹ã®å¼•æ•°ã§ã™ (%qT åž‹ã§ã™)"
#: c-family/c-common.c:8685
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "invalid type argument of %<->%> (have %qT)"
-msgstr "`%s' ã®å¼•æ•°ã¨ã—ã¦ç„¡åŠ¹ãªåž‹"
+msgstr "%<->%> ã®ç„¡åŠ¹ãªåž‹ã®å¼•æ•°ã§ã™ (%qT åž‹ã§ã™)"
#: c-family/c-common.c:8690
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "invalid type argument of implicit conversion (have %qT)"
-msgstr "`%s' ã®å¼•æ•°ã¨ã—ã¦ç„¡åŠ¹ãªåž‹"
+msgstr "暗黙的ãªå¤‰æ›ã®ç„¡åŠ¹ãªåž‹ã®å¼•æ•°ã§ã™ (%qT åž‹ã§ã™)"
#: c-family/c-common.c:8821
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "size of array is too large"
-msgstr "é…列 `%s' ã®å¤§ãã•ãŒå¤§ãã™ãŽã¾ã™"
+msgstr "é…列ã®ã‚µã‚¤ã‚ºãŒå¤§ãã™ãŽã¾ã™"
#: c-family/c-common.c:9080
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "array subscript has type %<char%>"
-msgstr "é…列ã®æ·»å­—㌠`char' åž‹ã§ã™"
+msgstr "é…列ã®æ·»å­—㌠%<char%> åž‹ã§ã™"
#: c-family/c-common.c:9115
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "suggest parentheses around %<+%> inside %<<<%>"
-msgstr "シフト中㮠+ ã‚„ - ã®å‘¨ã‚Šã§ã¯æ‹¬å¼§ã‚’ã¤ã‘ã‚‹ã“ã¨ã‚’ãŠå‹§ã‚ã—ã¾ã™"
+msgstr "%<<<%> 内ã«ã‚ã‚‹ %<+%> ã®å‘¨ã‚Šã«å°æ‹¬å¼§ã‚’付ã‘ã‚‹ã“ã¨ã‚’推奨ã—ã¾ã™"
#: c-family/c-common.c:9118
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "suggest parentheses around %<-%> inside %<<<%>"
-msgstr "シフト中㮠+ ã‚„ - ã®å‘¨ã‚Šã§ã¯æ‹¬å¼§ã‚’ã¤ã‘ã‚‹ã“ã¨ã‚’ãŠå‹§ã‚ã—ã¾ã™"
+msgstr "%<<<%> 内ã«ã‚ã‚‹ %<-%> ã®å‘¨ã‚Šã«å°æ‹¬å¼§ã‚’付ã‘ã‚‹ã“ã¨ã‚’推奨ã—ã¾ã™"
#: c-family/c-common.c:9124
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "suggest parentheses around %<+%> inside %<>>%>"
-msgstr "シフト中㮠+ ã‚„ - ã®å‘¨ã‚Šã§ã¯æ‹¬å¼§ã‚’ã¤ã‘ã‚‹ã“ã¨ã‚’ãŠå‹§ã‚ã—ã¾ã™"
+msgstr "%<>>%> 内ã«ã‚ã‚‹ %<+%> ã®å‘¨ã‚Šã«å°æ‹¬å¼§ã‚’付ã‘ã‚‹ã“ã¨ã‚’推奨ã—ã¾ã™"
#: c-family/c-common.c:9127
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "suggest parentheses around %<-%> inside %<>>%>"
-msgstr "シフト中㮠+ ã‚„ - ã®å‘¨ã‚Šã§ã¯æ‹¬å¼§ã‚’ã¤ã‘ã‚‹ã“ã¨ã‚’ãŠå‹§ã‚ã—ã¾ã™"
+msgstr "%<>>%> 内ã«ã‚ã‚‹ %<-%> ã®å‘¨ã‚Šã«å°æ‹¬å¼§ã‚’付ã‘ã‚‹ã“ã¨ã‚’推奨ã—ã¾ã™"
#: c-family/c-common.c:9133
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "suggest parentheses around %<&&%> within %<||%>"
-msgstr "|| ã¨å…±ã«ä½¿ã‚れる && ã®å‘¨ã‚Šã§ã¯æ‹¬å¼§ã‚’ã¤ã‘ã‚‹ã“ã¨ã‚’ãŠå‹§ã‚ã—ã¾ã™"
+msgstr "%<||%> 内ã«ã‚ã‚‹ %<&&%> ã®å‘¨ã‚Šã«å°æ‹¬å¼§ã‚’付ã‘ã‚‹ã“ã¨ã‚’推奨ã—ã¾ã™"
#: c-family/c-common.c:9142
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "suggest parentheses around arithmetic in operand of %<|%>"
-msgstr "計算㌠| 演算å­ã®é …ã¨ãªã‚‹å ´åˆã«ã¯æ‹¬å¼§ã‚’ã¤ã‘ã‚‹ã“ã¨ã‚’ãŠå‹§ã‚ã—ã¾ã™"
+msgstr "%<|%> ã®è¢«æ¼”ç®—å­å†…ã«ã‚る計算ã®å‘¨ã‚Šã«å°æ‹¬å¼§ã‚’付ã‘ã‚‹ã“ã¨ã‚’推奨ã—ã¾ã™"
#: c-family/c-common.c:9147
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "suggest parentheses around comparison in operand of %<|%>"
-msgstr "比較㌠| 演算å­ã®é …ã¨ãªã‚‹å ´åˆã«ã¯æ‹¬å¼§ã‚’ã¤ã‘ã‚‹ã“ã¨ã‚’ãŠå‹§ã‚ã—ã¾ã™"
+msgstr "%<|%> ã®è¢«æ¼”ç®—å­å†…ã«ã‚る比較ã®å‘¨ã‚Šã«å°æ‹¬å¼§ã‚’付ã‘ã‚‹ã“ã¨ã‚’推奨ã—ã¾ã™"
#: c-family/c-common.c:9151
#, gcc-internal-format
msgid "suggest parentheses around operand of %<!%> or change %<|%> to %<||%> or %<!%> to %<~%>"
-msgstr ""
+msgstr "%<!%> ã®è¢«æ¼”ç®—å­ã®å‘¨ã‚Šã«å°æ‹¬å¼§ã‚’付ã‘ã‚‹ã€ã¾ãŸã¯ %<|%> ã‹ã‚‰ %<||%> ã¸å¤‰æ›´ã™ã‚‹ã€ã¾ãŸã¯ %<!%> ã‹ã‚‰ %<~%> ã¸å¤‰æ›´ã™ã‚‹ã“ã¨ã‚’推奨ã—ã¾ã™"
#: c-family/c-common.c:9161
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "suggest parentheses around arithmetic in operand of %<^%>"
-msgstr "計算㌠^ 演算å­ã®é …ã¨ãªã‚‹å ´åˆã«ã¯æ‹¬å¼§ã‚’ã¤ã‘ã‚‹ã“ã¨ã‚’ãŠå‹§ã‚ã—ã¾ã™"
+msgstr "%<^%> ã®è¢«æ¼”ç®—å­å†…ã«ã‚る計算ã®å‘¨ã‚Šã«å°æ‹¬å¼§ã‚’付ã‘ã‚‹ã“ã¨ã‚’推奨ã—ã¾ã™"
#: c-family/c-common.c:9166
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "suggest parentheses around comparison in operand of %<^%>"
-msgstr "計算㌠^ 演算å­ã®é …ã¨ãªã‚‹å ´åˆã«ã¯æ‹¬å¼§ã‚’ã¤ã‘ã‚‹ã“ã¨ã‚’ãŠå‹§ã‚ã—ã¾ã™"
+msgstr "%<^%> ã®è¢«æ¼”ç®—å­å†…ã«ã‚る比較ã®å‘¨ã‚Šã«å°æ‹¬å¼§ã‚’付ã‘ã‚‹ã“ã¨ã‚’推奨ã—ã¾ã™"
#: c-family/c-common.c:9172
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "suggest parentheses around %<+%> in operand of %<&%>"
-msgstr "& 演算å­ã®å‘¨ã‚Šã® + ã‚„ - ã®å‘¨ã‚Šã«ã¯æ‹¬å¼§ã‚’ã¤ã‘ã‚‹ã“ã¨ã‚’ãŠå‹§ã‚ã—ã¾ã™"
+msgstr "%<&%> ã®è¢«æ¼”ç®—å­å†…ã«ã‚ã‚‹ %<+%> ã®å‘¨ã‚Šã«å°æ‹¬å¼§ã‚’付ã‘ã‚‹ã“ã¨ã‚’推奨ã—ã¾ã™"
#: c-family/c-common.c:9175
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "suggest parentheses around %<-%> in operand of %<&%>"
-msgstr "& 演算å­ã®å‘¨ã‚Šã® + ã‚„ - ã®å‘¨ã‚Šã«ã¯æ‹¬å¼§ã‚’ã¤ã‘ã‚‹ã“ã¨ã‚’ãŠå‹§ã‚ã—ã¾ã™"
+msgstr "%<&%> ã®è¢«æ¼”ç®—å­å†…ã«ã‚ã‚‹ %<-%> ã®å‘¨ã‚Šã«å°æ‹¬å¼§ã‚’付ã‘ã‚‹ã“ã¨ã‚’推奨ã—ã¾ã™"
#: c-family/c-common.c:9180
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "suggest parentheses around comparison in operand of %<&%>"
-msgstr "比較㌠& 演算å­ã®é …ã¨ãªã‚‹å ´åˆã«ã¯æ‹¬å¼§ã‚’ã¤ã‘ã‚‹ã“ã¨ã‚’ãŠå‹§ã‚ã—ã¾ã™"
+msgstr "%<&%> ã®è¢«æ¼”ç®—å­å†…ã«ã‚る比較ã®å‘¨ã‚Šã«å°æ‹¬å¼§ã‚’付ã‘ã‚‹ã“ã¨ã‚’推奨ã—ã¾ã™"
#: c-family/c-common.c:9184
#, gcc-internal-format
msgid "suggest parentheses around operand of %<!%> or change %<&%> to %<&&%> or %<!%> to %<~%>"
-msgstr ""
+msgstr "%<!%> ã®è¢«æ¼”ç®—å­ã®å‘¨ã‚Šã«å°æ‹¬å¼§ã‚’付ã‘ã‚‹ã€ã¾ãŸã¯ %<&%> ã‹ã‚‰ %<&&%> ã¸å¤‰æ›´ã™ã‚‹ã€ã¾ãŸã¯ %<!%> ã‹ã‚‰ %<~%> ã¸å¤‰æ›´ã™ã‚‹ã“ã¨ã‚’推奨ã—ã¾ã™"
#: c-family/c-common.c:9192
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "suggest parentheses around comparison in operand of %<==%>"
-msgstr "比較㌠| 演算å­ã®é …ã¨ãªã‚‹å ´åˆã«ã¯æ‹¬å¼§ã‚’ã¤ã‘ã‚‹ã“ã¨ã‚’ãŠå‹§ã‚ã—ã¾ã™"
+msgstr "%<==%> ã®è¢«æ¼”ç®—å­å†…ã«ã‚る比較ã®å‘¨ã‚Šã«å°æ‹¬å¼§ã‚’付ã‘ã‚‹ã“ã¨ã‚’推奨ã—ã¾ã™"
#: c-family/c-common.c:9198
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "suggest parentheses around comparison in operand of %<!=%>"
-msgstr "比較㌠| 演算å­ã®é …ã¨ãªã‚‹å ´åˆã«ã¯æ‹¬å¼§ã‚’ã¤ã‘ã‚‹ã“ã¨ã‚’ãŠå‹§ã‚ã—ã¾ã™"
+msgstr "%<!=%> ã®è¢«æ¼”ç®—å­å†…ã«ã‚る比較ã®å‘¨ã‚Šã«å°æ‹¬å¼§ã‚’付ã‘ã‚‹ã“ã¨ã‚’推奨ã—ã¾ã™"
#: c-family/c-common.c:9209
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "comparisons like %<X<=Y<=Z%> do not have their mathematical meaning"
-msgstr "X<=Y<=Z ã®æ§˜ãªæ¯”較ã¯æ•°å­¦çš„ãªæ„味ã§ã®çµæžœã‚’ã‚‚ãŸã‚‰ã—ã¾ã›ã‚“"
+msgstr "%<X<=Y<=Z%> ã®ã‚ˆã†ãªæ¯”較ã¯æ•°å­¦ã¨åŒã˜ã‚ˆã†ãªæ„味ã«ã¯ãªã‚Šã¾ã›ã‚“"
#: c-family/c-common.c:9224
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "label %q+D defined but not used"
-msgstr "ラベル `%s' ãŒå®šç¾©ã•ã‚Œã¾ã—ãŸãŒä½¿ã‚ã‚Œã¦ã„ã¾ã›ã‚“"
+msgstr "ラベル %q+D ãŒå®šç¾©ã•ã‚Œã¦ã„ã¾ã™ãŒä½¿ç”¨ã•ã‚Œã¦ã„ã¾ã›ã‚“"
#: c-family/c-common.c:9226
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "label %q+D declared but not defined"
-msgstr "ラベル `%s' ãŒä½¿ã‚ã‚Œã¾ã—ãŸãŒå®šç¾©ã•ã‚Œã¦ã„ã¾ã›ã‚“"
+msgstr "ラベル %q+D ãŒå®£è¨€ã•ã‚Œã¾ã—ãŸãŒå®šç¾©ã•ã‚Œã¦ã„ã¾ã›ã‚“"
#: c-family/c-common.c:9246
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "division by zero"
-msgstr "#if ã§ã‚¼ãƒ­é™¤ç®—ãŒç™ºç”Ÿã—ã¾ã—ãŸ"
+msgstr "ゼロ除算ãŒç™ºç”Ÿã—ã¾ã—ãŸ"
#: c-family/c-common.c:9278
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "comparison between types %qT and %qT"
-msgstr "ãƒã‚¤ãƒ³ã‚¿ã¨æ•´æ•°ã¨ã®æ¯”較を行ãªã£ã¦ã„ã¾ã™"
+msgstr "åž‹ %qT 㨠%qT ã®é–“ã§ã®æ¯”較ã§ã™"
#: c-family/c-common.c:9329
#, gcc-internal-format
msgid "comparison between signed and unsigned integer expressions"
-msgstr "符åˆä»˜ãã¨ç¬¦åˆç„¡ã—ã®æ•´æ•°å¼åŒå£«ã®æ¯”較ã§ã™"
+msgstr "符åˆä»˜ãã¨ç¬¦åˆç„¡ã—ã®æ•´æ•°å¼ã®é–“ã§ã®æ¯”較ã§ã™"
#: c-family/c-common.c:9380
#, gcc-internal-format
@@ -19960,7 +19956,7 @@ msgstr "~ã§å転ã•ã‚ŒãŸç¬¦åˆç„¡ã—åž‹ã¨ç¬¦åˆç„¡ã—åž‹ã¨ã®æ¯”較ã§ã™"
#: c-family/c-format.c:127 c-family/c-format.c:314
#, gcc-internal-format
msgid "format string has invalid operand number"
-msgstr "フォーマット文字列ã«ä¸é©åˆ‡ãªã‚ªãƒšãƒ©ãƒ³ãƒ‰æ•°ãŒã‚ã‚Šã¾ã™"
+msgstr "書å¼æ–‡å­—列ãŒç„¡åŠ¹ãªè¢«æ¼”ç®—å­æ•°ã‚’æŒã£ã¦ã„ã¾ã™"
#: c-family/c-format.c:144
#, gcc-internal-format
@@ -19970,32 +19966,32 @@ msgstr "関数ãŒæ–‡å­—列型を返ã—ã¾ã›ã‚“"
#: c-family/c-format.c:177
#, gcc-internal-format
msgid "format string argument is not a string type"
-msgstr ""
+msgstr "書å¼æ–‡å­—列引数ãŒæ–‡å­—列型ã§ã¯ã‚ã‚Šã¾ã›ã‚“"
#: c-family/c-format.c:203
#, gcc-internal-format
msgid "found a %<%s%> reference but the format argument should be a string"
-msgstr ""
+msgstr "%<%s%> å‚ç…§ãŒè¦‹ã¤ã‹ã‚Šã¾ã—ãŸãŒã€æ›¸å¼å¼•æ•°ã¯æ–‡å­—列ã§ã‚ã‚‹ã¹ãã§ã™"
#: c-family/c-format.c:206
#, gcc-internal-format
msgid "found a %qT but the format argument should be a string"
-msgstr ""
+msgstr "%qT åž‹ãŒè¦‹ã¤ã‹ã‚Šã¾ã—ãŸãŒæ›¸å¼å¼•æ•°ã¯æ–‡å­—列ã§ã‚ã‚‹ã¹ãã§ã™"
#: c-family/c-format.c:216
#, gcc-internal-format
msgid "format argument should be a %<%s%> reference but a string was found"
-msgstr ""
+msgstr "書å¼å¼•æ•°ã¯ %<%s%> ã¸ã®å‚ç…§ã§ã‚ã‚‹ã¹ãã§ã™ãŒã€æ–‡å­—列ãŒè¦‹ã¤ã‹ã‚Šã¾ã—ãŸ"
#: c-family/c-format.c:238
#, gcc-internal-format
msgid "format argument should be a %<%s%> reference"
-msgstr ""
+msgstr "書å¼å¼•æ•°ã¯ %<%s%> ã¸ã®å‚ç…§ã§ã‚ã‚‹ã¹ãã§ã™"
#: c-family/c-format.c:282
#, gcc-internal-format
msgid "unrecognized format specifier"
-msgstr "èªè­˜ã§ããªã„フォーマット指定å­"
+msgstr "èªè­˜ã§ããªã„書å¼æŒ‡å®šã§ã™"
#: c-family/c-format.c:297
#, gcc-internal-format
@@ -20003,310 +19999,312 @@ msgid "%qE is only allowed in Objective-C dialects"
msgstr ""
#: c-family/c-format.c:306
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "%qE is an unrecognized format function type"
-msgstr "`%s' ã¯èªè­˜ã§ããªã„フォーマット関数型ã§ã™"
+msgstr "%qE ã¯èªè­˜ã§ããªã„書å¼é–¢æ•°åž‹ã§ã™"
#: c-family/c-format.c:320
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "%<...%> has invalid operand number"
-msgstr "フォーマット文字列ã«ä¸é©åˆ‡ãªã‚ªãƒšãƒ©ãƒ³ãƒ‰æ•°ãŒã‚ã‚Šã¾ã™"
+msgstr "%<...%> ã«ç„¡åŠ¹ãªè¢«æ¼”ç®—å­æ•°ãŒã‚ã‚Šã¾ã™"
#: c-family/c-format.c:327
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "format string argument follows the args to be formatted"
-msgstr "フォーマット文字列引数ãŒãƒ•ã‚©ãƒ¼ãƒžãƒƒãƒˆã•ã‚Œã‚‹å¼•æ•°ã®å¾Œã«ç¶šã„ã¦ã„ã¾ã™"
+msgstr ""
#: c-family/c-format.c:1066
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "function might be possible candidate for %qs format attribute"
-msgstr "関数ã¯æらã `%s' format 属性ã®å€™è£œã¨æ€ã‚ã‚Œã¾ã™"
+msgstr "関数㌠%qs 書å¼å±žæ€§ã®å€™è£œã§ã‚ã‚‹å¯èƒ½æ€§ãŒã‚ã‚Šã¾ã™"
#: c-family/c-format.c:1158 c-family/c-format.c:1179 c-family/c-format.c:2224
#, gcc-internal-format
msgid "missing $ operand number in format"
-msgstr "フォーマット内㧠$ 演算å­ç•ªå·ã‚’欠ã„ã¦ã„ã¾ã™"
+msgstr "書å¼å†…ã« $ ã®è¢«æ¼”ç®—å­ç•ªå·ãŒã‚ã‚Šã¾ã›ã‚“"
#: c-family/c-format.c:1188
#, gcc-internal-format
msgid "%s does not support %%n$ operand number formats"
-msgstr "%s 㯠%%n$ 演算å­ç•ªå·ãƒ•ã‚©ãƒ¼ãƒžãƒƒãƒˆã‚’å—ã‘付ã‘ã¾ã›ã‚“"
+msgstr "%s 㯠%%n$ 被演算å­ç•ªå·æ›¸å¼ã‚’サãƒãƒ¼ãƒˆã—ã¾ã›ã‚“"
#: c-family/c-format.c:1195
#, gcc-internal-format
msgid "operand number out of range in format"
-msgstr "演算å­ç•ªå·ãŒãƒ•ã‚©ãƒ¼ãƒžãƒƒãƒˆã®ç¯„囲外ã§ã™"
+msgstr "被演算å­ç•ªå·ãŒæ›¸å¼ã®ç¯„囲外ã§ã™"
#: c-family/c-format.c:1218
#, gcc-internal-format
msgid "format argument %d used more than once in %s format"
-msgstr "フォーマット引数 %d ㌠%s フォーマット中ã§äºŒå›žä»¥ä¸Šä½¿ã‚ã‚Œã¾ã—ãŸ"
+msgstr "%d 番目ã®æ›¸å¼å¼•æ•°ãŒ %s 書å¼å†…ã§äºŒå›žä»¥ä¸Šä½¿ç”¨ã•ã‚Œã¦ã„ã¾ã™"
#: c-family/c-format.c:1250
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "$ operand number used after format without operand number"
-msgstr "演算å­ç•ªå·ãŒå¼•æ•°ã‚’å–らãªã„フォーマットã§æŒ‡å®šã•ã‚Œã¾ã—ãŸ"
+msgstr "$ 被演算å­ç•ªå·ãŒè¢«æ¼”ç®—å­ç•ªå·ãŒç„¡ã„書å¼ã®å¾Œã«ä½¿ç”¨ã•ã‚Œã¦ã„ã¾ã™"
+# %d ã®ä½ç½®ã®éƒ½åˆä¸Š before ã‚’å‰ã¨è¨³ã›ãªã„ãŸã‚æ„訳ã—ã¦ã„ã¾ã™
+# 苦ã—ã„訳ã§ã™
#: c-family/c-format.c:1281
#, gcc-internal-format
msgid "format argument %d unused before used argument %d in $-style format"
-msgstr "$-å¼ãƒ•ã‚©ãƒ¼ãƒžãƒƒãƒˆå†…ã®ãƒ•ã‚©ãƒ¼ãƒžãƒƒãƒˆå¼•æ•° %d ãŒå¼•æ•° %d ãŒä½¿ã‚れるå‰ã§æœªä½¿ç”¨ã§ã™"
+msgstr "$-スタイル書å¼å†…ã® %d 番目ã®å¼•æ•°ãŒã€å¾Œã«ã‚ã‚‹ %d 番目ã®å¼•æ•°ãŒä½¿ç”¨ã•ã‚ŒãŸã«ã‚‚é–¢ã‚らãšä½¿ç”¨ã•ã‚Œã¦ã„ã¾ã›ã‚“"
#: c-family/c-format.c:1376
#, gcc-internal-format
msgid "format not a string literal, format string not checked"
-msgstr "フォーマットãŒæ–‡å­—列リテラルã§ã¯ã‚ã‚Šã¾ã›ã‚“ã®ã§ã€ãƒ•ã‚©ãƒ¼ãƒžãƒƒãƒˆã¯æ¤œæŸ»ã•ã‚Œã¾ã›ã‚“"
+msgstr "書å¼ãŒæ–‡å­—列リテラルã§ã¯ã‚ã‚Šã¾ã›ã‚“。書å¼æ–‡å­—列ã¯æ¤œæŸ»ã•ã‚Œã¾ã›ã‚“"
#: c-family/c-format.c:1391 c-family/c-format.c:1394
#, gcc-internal-format
msgid "format not a string literal and no format arguments"
-msgstr "フォーマットã¯éžæ–‡å­—列リテラルã§ã€ä¸”ã¤ãƒ•ã‚©ãƒ¼ãƒžãƒƒãƒˆå¼•æ•°ã‚’æŒã¡ã¾ã›ã‚“"
+msgstr "書å¼ãŒæ–‡å­—列リテラルã§ã¯ç„¡ãã€ã‹ã¤æ›¸å¼å¼•æ•°ã§ã¯ã‚ã‚Šã¾ã›ã‚“"
#: c-family/c-format.c:1397
#, gcc-internal-format
msgid "format not a string literal, argument types not checked"
-msgstr "フォーマットã¯æ–‡å­—列リテラルã§ã¯ã‚ã‚Šã¾ã›ã‚“ã®ã§ã€å¼•æ•°ã®åž‹ã¯æ¤œæŸ»ã•ã‚Œã¾ã›ã‚“"
+msgstr "書å¼ãŒæ–‡å­—列リテラルã§ã¯ã‚ã‚Šã¾ã›ã‚“。引数ã®åž‹ã¯æ¤œæŸ»ã•ã‚Œã¾ã›ã‚“"
#: c-family/c-format.c:1410
#, gcc-internal-format
msgid "too many arguments for format"
-msgstr "フォーマットã¸ã®å¼•æ•°ãŒå¤šã™ãŽã¾ã™"
+msgstr "書å¼ã¸ã®å¼•æ•°ãŒå¤šã™ãŽã¾ã™"
#: c-family/c-format.c:1413
#, gcc-internal-format
msgid "unused arguments in $-style format"
-msgstr "$-å¼ã®ãƒ•ã‚©ãƒ¼ãƒžãƒƒãƒˆã§æœªä½¿ç”¨ã®å¼•æ•°ãŒã‚ã‚Šã¾ã™"
+msgstr "$-スタイルã®æ›¸å¼ã§æœªä½¿ç”¨ã®å¼•æ•°ãŒã‚ã‚Šã¾ã™"
#: c-family/c-format.c:1416
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "zero-length %s format string"
-msgstr "é•·ã• 0 ã®ãƒ•ã‚©ãƒ¼ãƒžãƒƒãƒˆæ–‡å­—列"
+msgstr "é•·ã•ãŒ 0 ã® %s 書å¼æ–‡å­—列ã§ã™"
#: c-family/c-format.c:1420
#, gcc-internal-format
msgid "format is a wide character string"
-msgstr "フォーマットãŒãƒ¯ã‚¤ãƒ‰æ–‡å­—列ã§ã™"
+msgstr "書å¼ãŒãƒ¯ã‚¤ãƒ‰æ–‡å­—列ã§ã™"
#: c-family/c-format.c:1423
#, gcc-internal-format
msgid "unterminated format string"
-msgstr "終端ã•ã‚Œã¦ã„ãªã„フォーマット文字列"
+msgstr "終端ã•ã‚Œã¦ã„ãªã„書å¼æ–‡å­—列ã§ã™"
#: c-family/c-format.c:1667
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "spurious trailing %<%%%> in format"
-msgstr "フォーマット㫠`%%' ã®ç—•è·¡ã‚‰ã—ãã‚‚ã®ãŒã‚ã‚Šã¾ã™"
+msgstr "書å¼å†…ã«èª¤ã£ãŸ %<%%%> ãŒæœ€å¾Œã«ã‚ã‚Šã¾ã™"
#: c-family/c-format.c:1711 c-family/c-format.c:1991
#, gcc-internal-format
msgid "repeated %s in format"
-msgstr "フォーマット中㧠%s ã‚’ç¹°ã‚Šè¿”ã—ã¦ã„ã¾ã™"
+msgstr "書å¼å†…ã« %s ã®ç¹°ã‚Šè¿”ã—ãŒã‚ã‚Šã¾ã™"
#: c-family/c-format.c:1724
#, gcc-internal-format
msgid "missing fill character at end of strfmon format"
-msgstr "strfmon フォーマットã®çµ‚ã‚Šã§è©°ã‚文字を欠ã„ã¦ã„ã¾ã™"
+msgstr "strfmon 書å¼ã®æœ€å¾Œã«è©°ã‚文字ãŒã‚ã‚Šã¾ã›ã‚“"
#: c-family/c-format.c:1812
#, gcc-internal-format
msgid "zero width in %s format"
-msgstr "%s ã§å¹… 0 ã®ãƒ•ã‚©ãƒ¼ãƒžãƒƒãƒˆã§ã™"
+msgstr "%s 書å¼ã®å¹…㌠0 ã§ã™"
#: c-family/c-format.c:1830
#, gcc-internal-format
msgid "empty left precision in %s format"
-msgstr "%s ã§ç©ºã®å·¦ç²¾åº¦ãƒ•ã‚©ãƒ¼ãƒžãƒƒãƒˆã§ã™"
+msgstr "%s 書å¼ã®å·¦ç²¾åº¦ãŒç©ºã§ã™"
#: c-family/c-format.c:1906
#, gcc-internal-format
msgid "empty precision in %s format"
-msgstr "%s ã§ç©ºã®ç²¾åº¦ãƒ•ã‚©ãƒ¼ãƒžãƒƒãƒˆã§ã™"
+msgstr "%s 書å¼ã®ç²¾åº¦ãŒç©ºã§ã™"
#: c-family/c-format.c:1975
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "%s does not support the %qs %s length modifier"
-msgstr "%s 㯠`%s' %s é•·ã•ä¿®é£¾å­ã‚’å—ã‘付ã‘ã¾ã›ã‚“"
+msgstr "%s 㯠%qs %s é•·ã•ä¿®é£¾å­ã‚’サãƒãƒ¼ãƒˆã—ã¾ã›ã‚“"
#: c-family/c-format.c:2008
#, gcc-internal-format
msgid "conversion lacks type at end of format"
-msgstr "フォーマットã®çµ‚ã‚Šã§åž‹å¤‰æ›æ–‡å­—ãŒæ¬ ã‘ã¦ã„ã¾ã™"
+msgstr "書å¼ã®æœ€å¾Œã«åž‹å¤‰æ›ãŒã‚ã‚Šã¾ã›ã‚“"
#: c-family/c-format.c:2019
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "unknown conversion type character %qc in format"
-msgstr "フォーマット内ã«ä¸æ˜Žãªåž‹å¤‰æ›æ–‡å­— `%c' ãŒã‚ã‚Šã¾ã™"
+msgstr "書å¼å†…ã«ä¸æ˜Žãªåž‹å¤‰æ›æ–‡å­— %qc ãŒã‚ã‚Šã¾ã™"
#: c-family/c-format.c:2022
#, gcc-internal-format
msgid "unknown conversion type character 0x%x in format"
-msgstr "フォーマット内ã«ä¸æ˜Žãªåž‹å¤‰æ›æ–‡å­— 0x%x ãŒã‚ã‚Šã¾ã™"
+msgstr "書å¼å†…ã«ä¸æ˜Žãªåž‹å¤‰æ›æ–‡å­— 0x%x ãŒã‚ã‚Šã¾ã™"
#: c-family/c-format.c:2029
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "%s does not support the %<%%%c%> %s format"
-msgstr "%s 㯠`%%%s%c' %s フォーマットをå—ã‘付ã‘ã¾ã›ã‚“"
+msgstr "%s 㯠%<%%%c%> %s 書å¼ã‚’サãƒãƒ¼ãƒˆã—ã¾ã›ã‚“"
#: c-family/c-format.c:2045
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "%s used with %<%%%c%> %s format"
-msgstr "%s ㌠`%%%c' %s フォーマットã¨ä¸€ç·’ã«ä½¿ã‚ã‚Œã¾ã—ãŸ"
+msgstr "%s ㌠%<%%%c%> %s 書å¼ã¨ä½µã›ã¦ä½¿ç”¨ã•ã‚Œã¦ã„ã¾ã™"
#: c-family/c-format.c:2054
#, gcc-internal-format
msgid "%s does not support %s"
-msgstr "%s 㯠%s ã‚’å—ã‘付ã‘ã¾ã›ã‚“"
+msgstr "%s 㯠%s をサãƒãƒ¼ãƒˆã—ã¾ã›ã‚“"
#: c-family/c-format.c:2064
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "%s does not support %s with the %<%%%c%> %s format"
-msgstr "%s 㯠%s ã‚’ `%%%c' %s フォーマットã¨ä¸€ç·’ã«ä½¿ã†äº‹ã‚’å—ã‘付ã‘ã¾ã›ã‚“"
+msgstr "%s 㯠%s 㨠%<%%%c%> %s 書å¼ã‚’ä½µã›ã¦ä½¿ç”¨ã™ã‚‹ã“ã¨ã‚’サãƒãƒ¼ãƒˆã—ã¾ã›ã‚“"
#: c-family/c-format.c:2100
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "%s ignored with %s and %<%%%c%> %s format"
-msgstr "%s 㯠%s åŠã³ `%%%c' %s フォーマットã¨ä¸€ç·’ã«ä½¿ã†ã¨ç„¡è¦–ã•ã‚Œã¾ã™"
+msgstr "%s 㯠%s 㨠%<%%%c%> %s 書å¼ã‚’ä½µã›ã¦ä½¿ç”¨ã—ã¦ã„ã‚‹ãŸã‚無視ã•ã‚Œã¾ã™"
#: c-family/c-format.c:2104
#, gcc-internal-format
msgid "%s ignored with %s in %s format"
-msgstr "%s 㯠%s ã‚’ %s フォーマットã§ä¸€ç·’ã«ä½¿ã†ã¨ç„¡è¦–ã•ã‚Œã¾ã™"
+msgstr "%s 㯠%s ã‚’ %s 書å¼ã§ä½¿ç”¨ã—ã¦ã„ã‚‹ãŸã‚無視ã•ã‚Œã¾ã™"
#: c-family/c-format.c:2111
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "use of %s and %s together with %<%%%c%> %s format"
-msgstr "%s 㨠%s ã¨ã‚’ `%%%c' %s フォーマットã¨ä¸€ç·’ã«ä½¿ã£ã¦ã„ã¾ã™"
+msgstr "%s 㨠%s ã‚’ %<%%%c%> %s 書å¼ã§ä¸€ç·’ã«ä½¿ç”¨ã—ã¦ã„ã¾ã™"
#: c-family/c-format.c:2115
#, gcc-internal-format
msgid "use of %s and %s together in %s format"
-msgstr "%s 㨠%s ã¨ã‚’ %s フォーマットã®ä¸­ã§ä½¿ã£ã¦ã„ã¾ã™"
+msgstr "%s 㨠%s ã‚’ %s 書å¼ã§ä¸€ç·’ã«ä½¿ç”¨ã—ã¦ã„ã¾ã™"
#: c-family/c-format.c:2134
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "%<%%%c%> yields only last 2 digits of year in some locales"
-msgstr "`%%%c' ã¯ãƒ­ã‚±ãƒ¼ãƒ«ã«ã‚ˆã£ã¦ã¯ã€å¹´ã®ä¸‹äºŒæ¡ã ã‘ã‚’ã‚‚ãŸã‚‰ã—ã¾ã™"
+msgstr "%<%%%c%> ã¯ã„ãã¤ã‹ã®ãƒ­ã‚±ãƒ¼ãƒ«ã§ã¯å¹´ã®ä¸‹äºŒæ¡ã®ã¿ã‚’表ã—ã¾ã™"
#: c-family/c-format.c:2137
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "%<%%%c%> yields only last 2 digits of year"
-msgstr "`%%%c' ã¯å¹´ã®ä¸‹äºŒæ¡ã ã‘ã‚’ã‚‚ãŸã‚‰ã—ã¾ã™"
+msgstr "%<%%%c%> ã¯å¹´ã®ä¸‹äºŒæ¡ã®ã¿ã‚’表ã—ã¾ã™"
#. The end of the format string was reached.
#: c-family/c-format.c:2154
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "no closing %<]%> for %<%%[%> format"
-msgstr "`%%[' フォーマットを閉ã˜ã‚‹ `]' ãŒã‚ã‚Šã¾ã›ã‚“"
+msgstr "%<%%[%> 書å¼ç”¨ã®é–‰ã˜ã‚‹ %<]%> ãŒã‚ã‚Šã¾ã›ã‚“"
#: c-family/c-format.c:2168
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "use of %qs length modifier with %qc type character"
-msgstr "`%s' é•·ã•ä¿®é£¾å­ã‚’ `%c' 型変æ›æ–‡å­—ã¨ä¸€ç·’ã«ä½¿ã£ã¦ã„ã¾ã™"
+msgstr "%qs é•·ã•ä¿®é£¾å­ã‚’ %qc 型変æ›æ–‡å­—ã§ä½¿ç”¨ã—ã¦ã„ã¾ã™"
#: c-family/c-format.c:2186
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "%s does not support the %<%%%s%c%> %s format"
-msgstr "%s 㯠`%%%s%c' %s フォーマットをå—ã‘付ã‘ã¾ã›ã‚“"
+msgstr "%s 㯠%<%%%s%c%> %s 書å¼ã‚’サãƒãƒ¼ãƒˆã—ã¾ã›ã‚“"
#: c-family/c-format.c:2203
#, gcc-internal-format
msgid "operand number specified with suppressed assignment"
-msgstr "演算å­ç•ªå·ãŒä»£å…¥ã®æŠ‘制ã¨å…±ã«ä½¿ã‚ã‚Œã¦ã„ã¾ã™"
+msgstr "被演算å­ç•ªå·ãŒä»£å…¥ã®æŠ‘制ã¨å…±ã«ä½¿ã‚ã‚Œã¦ã„ã¾ã™"
#: c-family/c-format.c:2206
#, gcc-internal-format
msgid "operand number specified for format taking no argument"
-msgstr "演算å­ç•ªå·ãŒå¼•æ•°ã‚’å–らãªã„フォーマットã§æŒ‡å®šã•ã‚Œã¾ã—ãŸ"
+msgstr "被演算å­ç•ªå·ãŒå¼•æ•°ã‚’å–らãªã„書å¼ã§æŒ‡å®šã•ã¦ã„ã¾ã™"
#: c-family/c-format.c:2291
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "embedded %<\\0%> in format"
-msgstr "フォーマット㫠`\\0' ãŒåŸ‹ã‚è¾¼ã¾ã‚Œã¦ã„ã¾ã™"
+msgstr "書å¼å†…ã« %<\\0%> ãŒçµ„ã¿è¾¼ã¾ã‚Œã¦ã„ã¾ã™"
#: c-family/c-format.c:2360
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "writing through null pointer (argument %d)"
-msgstr "null ãƒã‚¤ãƒ³ã‚¿ã‚’書ã込んã§ã„ã¾ã™ (引数 %d)"
+msgstr "NULL ãƒã‚¤ãƒ³ã‚¿ã‚’通ã—ã¦æ›¸ã込んã§ã„ã¾ã™ (第 %d 引数)"
#: c-family/c-format.c:2368
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "reading through null pointer (argument %d)"
-msgstr "null ãƒã‚¤ãƒ³ã‚¿ã‚’読込んã§ã„ã¾ã™ (引数 %d)"
+msgstr "NULL ãƒã‚¤ãƒ³ã‚¿ã‚’通ã—ã¦èª­ã¿è¾¼ã‚“ã§ã„ã¾ã™ (第 %d 引数)"
#: c-family/c-format.c:2388
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "writing into constant object (argument %d)"
-msgstr "定数オブジェクトã«æ›¸ã込んã§ã„ã¾ã™ (引数 %d)"
+msgstr "定数オブジェクトã«æ›¸ã込んã§ã„ã¾ã™ (第 %d 引数)"
#: c-family/c-format.c:2399
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "extra type qualifiers in format argument (argument %d)"
-msgstr "フォーマット引数ã«ä½™åˆ†ãªåž‹ä¿®é£¾å­ãŒã‚ã‚Šã¾ã™ (引数 %d)"
+msgstr "書å¼å¼•æ•°å†…ã«ä½™åˆ†ãªåž‹ä¿®é£¾å­ãŒã‚ã‚Šã¾ã™ (第 %d 引数)"
#: c-family/c-format.c:2515
#, gcc-internal-format
msgid "%s %<%s%.*s%> expects argument of type %<%s%s%>, but argument %d has type %qT"
-msgstr ""
+msgstr "%s %<%s%.*s%> ã¯å¼•æ•°ã®åž‹ãŒ %<%s%s%> ã§ã‚ã‚‹ã¨äºˆæœŸã•ã‚Œã¾ã™ãŒã€ç¬¬ %d 引数ã®åž‹ã¯ %qT ã§ã™"
#: c-family/c-format.c:2522
#, gcc-internal-format
msgid "%s %<%s%.*s%> expects a matching %<%s%s%> argument"
-msgstr ""
+msgstr "%s %<%s%.*s%> ã¯å¯¾å¿œã—㟠%<%s%s%> 引数ãŒäºˆæœŸã•ã‚Œã¾ã™"
#: c-family/c-format.c:2530
#, gcc-internal-format
msgid "%s %<%s%.*s%> expects argument of type %<%T%s%>, but argument %d has type %qT"
-msgstr ""
+msgstr "%s %<%s%.*s%> ã¯å¼•æ•°ã®åž‹ãŒ %<%T%s%> ã§ã‚ã‚‹ã¨äºˆæœŸã•ã‚Œã¾ã™ãŒã€ç¬¬ %d 引数ã®åž‹ã¯ %qT ã§ã™"
#: c-family/c-format.c:2537
#, gcc-internal-format
msgid "%s %<%s%.*s%> expects a matching %<%T%s%> argument"
-msgstr ""
+msgstr "%s %<%s%.*s%> ã¯å¯¾å¿œã—㟠%<%T%s%> 引数ãŒäºˆæœŸã•ã‚Œã¾ã™"
#: c-family/c-format.c:2597 c-family/c-format.c:2603 c-family/c-format.c:2754
#, gcc-internal-format
msgid "%<__gcc_host_wide_int__%> is not defined as a type"
-msgstr ""
+msgstr "%<__gcc_host_wide_int__%> ãŒåž‹ã¨ã—ã¦å®šç¾©ã•ã‚Œã¦ã„ã¾ã›ã‚“"
#: c-family/c-format.c:2610 c-family/c-format.c:2764
#, gcc-internal-format
msgid "%<__gcc_host_wide_int__%> is not defined as %<long%> or %<long long%>"
-msgstr ""
+msgstr "%<__gcc_host_wide_int__%> ㌠%<long%> ã¾ãŸã¯ %<long long%> ã¨ã—ã¦å®šç¾©ã•ã‚Œã¦ã„ã¾ã›ã‚“"
#: c-family/c-format.c:2660
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "%<locus%> is not defined as a type"
-msgstr "\"%s\" ã¯å®šç¾©ã•ã‚Œã¦ã„ã¾ã›ã‚“"
+msgstr "%<locus%> ãŒåž‹ã¨ã—ã¦å®šç¾©ã•ã‚Œã¦ã„ã¾ã›ã‚“"
#: c-family/c-format.c:2713
#, gcc-internal-format
msgid "%<location_t%> is not defined as a type"
-msgstr ""
+msgstr "%<location_t%> ãŒåž‹ã¨ã—ã¦å®šç¾©ã•ã‚Œã¦ã„ã¾ã›ã‚“"
#: c-family/c-format.c:2730
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "%<tree%> is not defined as a type"
-msgstr "\"%s\" ã¯å®šç¾©ã•ã‚Œã¦ã„ã¾ã›ã‚“"
+msgstr "%<tree%> ãŒåž‹ã¨ã—ã¦å®šç¾©ã•ã‚Œã¦ã„ã¾ã›ã‚“"
#: c-family/c-format.c:2735
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "%<tree%> is not defined as a pointer type"
-msgstr "ãƒã‚¤ãƒ³ã‚¿åž‹ã«å¤‰æ›ã§ãã¾ã›ã‚“"
+msgstr "%<tree%> ãŒãƒã‚¤ãƒ³ã‚¿åž‹ã¨ã—ã¦å®šç¾©ã•ã‚Œã¦ã„ã¾ã›ã‚“"
#: c-family/c-format.c:3008
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "args to be formatted is not %<...%>"
-msgstr "フォーマットã•ã‚Œã‚‹å¼•æ•°ãŒã€'...' ã«ãªã£ã¦ã„ã¾ã›ã‚“"
+msgstr "書å¼è§£é‡ˆã•ã‚Œã‚‹å¼•æ•°ãŒ %<...%> ã§ã¯ã‚ã‚Šã¾ã›ã‚“"
#: c-family/c-format.c:3020
#, gcc-internal-format
msgid "strftime formats cannot format arguments"
-msgstr "strftime フォーマットã¯å¼•æ•°ã‚’フォーマットã§ãã¾ã›ã‚“"
+msgstr "strftime 書å¼ã¯å¼•æ•°ã‚’書å¼è§£é‡ˆã§ãã¾ã›ã‚“"
#: c-family/c-lex.c:228
#, gcc-internal-format
msgid "badly nested C headers from preprocessor"
-msgstr "プリプロセッサã‹ã‚‰ç•°å¸¸ã«ãƒã‚¹ãƒˆã•ã‚ŒãŸ C ヘッダã§ã™"
+msgstr "å‰å‡¦ç†ã‹ã‚‰é–“é•ã£ã¦å…¥ã‚Œå­ã«ãªã£ã¦ã„ã‚‹ C ヘッダã§ã™"
#: c-family/c-lex.c:263
#, gcc-internal-format
@@ -20315,119 +20313,119 @@ msgstr "#pragma %s %s を無視ã—ã¾ã™"
#. ... or not.
#: c-family/c-lex.c:385 c-family/c-lex.c:976
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "stray %<@%> in program"
-msgstr "プログラムã¨ã—ã¦é€¸è„±ã—ãŸæ–‡å­— '%c'"
+msgstr "プログラム内ã«é€¸è„±ã—㟠%<@%> ãŒã‚ã‚Šã¾ã™"
#: c-family/c-lex.c:400
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "stray %qs in program"
-msgstr "プログラムã¨ã—ã¦é€¸è„±ã—ãŸæ–‡å­— '%c'"
+msgstr "プログラム内ã«é€¸è„±ã—㟠%qs ãŒã‚ã‚Šã¾ã™"
#: c-family/c-lex.c:410
#, gcc-internal-format
msgid "missing terminating %c character"
-msgstr "%c 文字ã§ã®çµ‚端を欠ã„ã¦ã„ã¾ã™"
+msgstr "終端㮠%c 文字ãŒã‚ã‚Šã¾ã›ã‚“"
#: c-family/c-lex.c:412
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "stray %qc in program"
-msgstr "プログラムã¨ã—ã¦é€¸è„±ã—ãŸæ–‡å­— '%c'"
+msgstr "プログラム内ã«é€¸è„±ã—㟠%qc ãŒã‚ã‚Šã¾ã™"
#: c-family/c-lex.c:414
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "stray %<\\%o%> in program"
-msgstr "プログラムã¨ã—ã¦é€¸è„±ã—ãŸæ–‡å­— '\\%o'"
+msgstr "プログラム内ã«é€¸è„±ã—㟠%<\\%o%> ãŒã‚ã‚Šã¾ã™"
#: c-family/c-lex.c:586
#, gcc-internal-format
msgid "this decimal constant is unsigned only in ISO C90"
-msgstr ""
+msgstr "ã“ã®å進定数㯠ISO C90 内ã§ã®ã¿ç¬¦å·ç„¡ã—ã§ã™"
#: c-family/c-lex.c:590
#, gcc-internal-format
msgid "this decimal constant would be unsigned in ISO C90"
-msgstr ""
+msgstr "ã“ã®å進定数㯠ISO C90 ã§ã¯ãŠãらã符å·ç„¡ã—ã§ã™"
#: c-family/c-lex.c:610
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "integer constant is too large for %<unsigned long%> type"
-msgstr "整数定数ãŒå¤§ãã™ãŽã‚‹ã®ã§ unsigned ã«ãªã‚Šã¾ã—ãŸ"
+msgstr "整数定数㌠%<unsigned long%> åž‹ã«å¯¾ã—ã¦å¤§ãã™ãŽã¾ã™"
#: c-family/c-lex.c:647
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "unsuffixed float constant"
-msgstr "2 ã¤ã® 'u' 接尾辞ãŒæ•´æ•°å®šæ•°ã«ã¤ã„ã¦ã„ã¾ã™"
+msgstr "接尾辞ãŒãªã„浮動å°æ•°å®šæ•°ã§ã™"
#: c-family/c-lex.c:679
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "unsupported non-standard suffix on floating constant"
-msgstr "浮動å°æ•°å®šæ•°ã« 'f' 㨠'l' 接尾辞ã®ä¸¡æ–¹ãŒã‚ã‚Šã¾ã™"
+msgstr "浮動å°æ•°å®šæ•°ã«é–¢ã™ã‚‹ã‚µãƒãƒ¼ãƒˆã•ã‚Œã¦ã„ãªã„éžæ¨™æº–ã®æŽ¥å°¾è¾žã§ã™"
#: c-family/c-lex.c:684
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "non-standard suffix on floating constant"
-msgstr "浮動å°æ•°å®šæ•°ã« 'f' 㨠'l' 接尾辞ã®ä¸¡æ–¹ãŒã‚ã‚Šã¾ã™"
+msgstr "浮動å°æ•°å®šæ•°ã«é–¢ã™ã‚‹éžæ¨™æº–ã®æŽ¥å°¾è¾žã§ã™"
#: c-family/c-lex.c:738 c-family/c-lex.c:740
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "floating constant exceeds range of %qT"
-msgstr "浮動å°æ•°ç‚¹æ•°ãŒ '%s' ã®ç¯„囲を超ãˆã¾ã—ãŸ"
+msgstr "浮動å°æ•°å®šæ•°ãŒ %qT ã®ç¯„囲を超ãˆã¦ã„ã¾ã™"
#: c-family/c-lex.c:749
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "floating constant truncated to zero"
-msgstr "浮動å°æ•°å®šæ•°ã‚’使ã„æã­ã¾ã—ãŸ"
+msgstr "浮動å°æ•°å®šæ•°ãŒ 0 ã«åˆ‡ã‚Šè©°ã‚られã¾ã—ãŸ"
#: c-family/c-lex.c:938
#, gcc-internal-format
msgid "repeated %<@%> before Objective-C string"
-msgstr ""
+msgstr "Objective-C 文字列ã®å‰ã«é€£ç¶šã—㟠%<@%> ãŒã‚ã‚Šã¾ã™"
#: c-family/c-lex.c:957 cp/parser.c:3375
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "unsupported non-standard concatenation of string literals"
-msgstr "終端ã®ãªã„文字列リテラルã®æŽ¨å®šé–‹å§‹ä½ç½®"
+msgstr "サãƒãƒ¼ãƒˆã•ã‚Œã¦ã„ãªã„éžæ¨™æº–ã®æ–‡å­—列リテラルã®é€£çµã§ã™"
#: c-family/c-lex.c:985
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "traditional C rejects string constant concatenation"
-msgstr "å¤ã„ C ã§ã¯æ–‡å­—列çµåˆã‚’æ‹’å¦ã—ã¾ã™"
+msgstr "ä¼çµ±çš„㪠C ã§ã¯æ–‡å­—列定数ã®é€£çµã‚’æ‹’å¦ã—ã¾ã™"
#: c-family/c-omp.c:122
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "invalid expression type for %<#pragma omp atomic%>"
-msgstr "オペランドã¨ã—ã¦ç„¡åŠ¹ãªå¼"
+msgstr ""
#: c-family/c-omp.c:256 cp/semantics.c:4419
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "invalid type for iteration variable %qE"
-msgstr "`%s' ã¯ãƒ¬ã‚¸ã‚¹ã‚¿å¤‰æ•°ã¨ã—ã¦ã¯ç„¡åŠ¹ãªãƒ¬ã‚¸ã‚¹ã‚¿åã§ã™"
+msgstr ""
#: c-family/c-omp.c:269
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "%qE is not initialized"
-msgstr "åˆæœŸåŒ–å­ã‚’欠ã„ã¦ã„ã¾ã™"
+msgstr "%qE ã¯åˆæœŸåŒ–ã•ã‚Œã¦ã„ã¾ã›ã‚“"
#: c-family/c-omp.c:286 cp/semantics.c:4334
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "missing controlling predicate"
-msgstr "述語ã®å¾Œã‚ã® '(' を欠ã„ã¦ã„ã¾ã™"
+msgstr ""
#: c-family/c-omp.c:368 cp/semantics.c:4091
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "invalid controlling predicate"
-msgstr "無効ãªåˆ¶å¾¡å¼ã§ã™"
+msgstr ""
#: c-family/c-omp.c:375 cp/semantics.c:4340
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "missing increment expression"
-msgstr "代入ã®æŠ‘制"
+msgstr "インクリメントå¼ãŒã‚ã‚Šã¾ã›ã‚“"
#: c-family/c-omp.c:444 cp/semantics.c:4196
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "invalid increment expression"
-msgstr "無効ãªåˆ¶å¾¡å¼ã§ã™"
+msgstr "無効ãªã‚¤ãƒ³ã‚¯ãƒªãƒ¡ãƒ³ãƒˆå¼ã§ã™"
#: c-family/c-opts.c:303
#, gcc-internal-format
@@ -20437,22 +20435,22 @@ msgstr "-I- ãŒäºŒå›žæŒ‡å®šã•ã‚Œã¾ã—ãŸ"
#: c-family/c-opts.c:306
#, gcc-internal-format
msgid "obsolete option -I- used, please use -iquote instead"
-msgstr ""
+msgstr "廃止ã‚ã‚ŒãŸã‚ªãƒ—ション -I- ãŒä½¿ç”¨ã•ã‚Œã¦ã„ã¾ã™ã€‚代ã‚ã‚Šã« -iquote を使用ã—ã¦ãã ã•ã„"
#: c-family/c-opts.c:486
#, gcc-internal-format
msgid "-Werror=normalized=: set -Wnormalized=nfc"
-msgstr ""
+msgstr "-Werror=normalized=: -Wnormalized=nfc を設定ã—ã¾ã™"
#: c-family/c-opts.c:500
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "argument %qs to %<-Wnormalized%> not recognized"
-msgstr "言語 %s ã¯èªè­˜ã§ãã¾ã›ã‚“"
+msgstr "%<-Wnormalized%> ã¸ã®å¼•æ•° %qs ãŒèªè­˜ã§ãã¾ã›ã‚“"
#: c-family/c-opts.c:723 fortran/cpp.c:347
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "output filename specified twice"
-msgstr "出力ファイルåãŒäºŒå›žæŒ‡å®šã•ã‚Œã¾ã—ãŸ"
+msgstr "出力ファイルåãŒäºŒå›žæŒ‡å®šã•ã‚Œã¦ã„ã¾ã™"
#: c-family/c-opts.c:852
#, gcc-internal-format
@@ -20462,198 +20460,198 @@ msgstr ""
#: c-family/c-opts.c:865
#, gcc-internal-format
msgid "-fno-gnu89-inline is only supported in GNU99 or C99 mode"
-msgstr ""
+msgstr "-fno-gnu89-inline 㯠GNU99 ã¾ãŸã¯ C99 モードã§ã®ã¿ã‚µãƒãƒ¼ãƒˆã•ã‚Œã¾ã™"
#: c-family/c-opts.c:944
#, gcc-internal-format
msgid "-Wformat-y2k ignored without -Wformat"
-msgstr "-Wformat-y2k ã¯ç„¡è¦–ã•ã‚Œã¾ã—ãŸï¼ˆ-Wformat ãŒã‚ã‚Šã¾ã›ã‚“)"
+msgstr "-Wformat-y2k ã¯ç„¡è¦–ã•ã‚Œã¾ã—㟠(-Wformat ãŒã‚ã‚Šã¾ã›ã‚“)"
#: c-family/c-opts.c:946
#, gcc-internal-format
msgid "-Wformat-extra-args ignored without -Wformat"
-msgstr "-Wformat-extra-args ã¯ç„¡è¦–ã•ã‚Œã¾ã—ãŸï¼ˆ-Wformat ãŒã‚ã‚Šã¾ã›ã‚“)"
+msgstr "-Wformat-extra-args ã¯ç„¡è¦–ã•ã‚Œã¾ã—㟠(-Wformat ãŒã‚ã‚Šã¾ã›ã‚“)"
#: c-family/c-opts.c:948
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "-Wformat-zero-length ignored without -Wformat"
-msgstr "-Wformat-extra-args ã¯ç„¡è¦–ã•ã‚Œã¾ã—ãŸï¼ˆ-Wformat ãŒã‚ã‚Šã¾ã›ã‚“)"
+msgstr "-Wformat-zero-length ã¯ç„¡è¦–ã•ã‚Œã¾ã—㟠(-Wformat ãŒã‚ã‚Šã¾ã›ã‚“)"
#: c-family/c-opts.c:950
#, gcc-internal-format
msgid "-Wformat-nonliteral ignored without -Wformat"
-msgstr "-Wformat-nonliteral ã¯ç„¡è¦–ã•ã‚Œã¾ã—ãŸï¼ˆ-Wformat ãŒã‚ã‚Šã¾ã›ã‚“)"
+msgstr "-Wformat-nonliteral ã¯ç„¡è¦–ã•ã‚Œã¾ã—㟠(-Wformat ãŒã‚ã‚Šã¾ã›ã‚“)"
#: c-family/c-opts.c:952
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "-Wformat-contains-nul ignored without -Wformat"
-msgstr "-Wformat-nonliteral ã¯ç„¡è¦–ã•ã‚Œã¾ã—ãŸï¼ˆ-Wformat ãŒã‚ã‚Šã¾ã›ã‚“)"
+msgstr "-Wformat-contains-nul ã¯ç„¡è¦–ã•ã‚Œã¾ã—㟠(-Wformat ãŒã‚ã‚Šã¾ã›ã‚“)"
#: c-family/c-opts.c:954
#, gcc-internal-format
msgid "-Wformat-security ignored without -Wformat"
-msgstr "-Wformat-security ã¯ç„¡è¦–ã•ã‚Œã¾ã—ãŸï¼ˆ-Wformat ãŒã‚ã‚Šã¾ã›ã‚“)"
+msgstr "-Wformat-security ã¯ç„¡è¦–ã•ã‚Œã¾ã—㟠(-Wformat ãŒã‚ã‚Šã¾ã›ã‚“)"
#: c-family/c-opts.c:984
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "opening output file %s: %m"
-msgstr "出力ファイル `%s' ã‚’ open ã§ãã¾ã›ã‚“"
+msgstr "出力ファイル %s ã‚’é–‹ã„ã¦ã„ã¾ã™: %m"
#: c-family/c-opts.c:989
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "too many filenames given. Type %s --help for usage"
-msgstr "ファイルåãŒå¤šã™ãŽã¾ã™ã€‚%s --help ã¨ã‚¿ã‚¤ãƒ—ã—ã¦ä½¿ã„方を見ã¾ã—ょã†"
+msgstr "与ãˆã‚‰ã‚ŒãŸãƒ•ã‚¡ã‚¤ãƒ«åãŒå¤šã™ãŽã¾ã™ã€‚使用法ã«é–¢ã—ã¦ã¯ %s --help ã‚’å‚ç…§ã—ã¦ãã ã•ã„"
#: c-family/c-opts.c:1106
#, gcc-internal-format
msgid "opening dependency file %s: %m"
-msgstr ""
+msgstr "ä¾å­˜é–¢ä¿‚ファイル %s ã‚’é–‹ã„ã¦ã„ã¾ã™: %m"
#: c-family/c-opts.c:1116
#, gcc-internal-format
msgid "closing dependency file %s: %m"
-msgstr ""
+msgstr "ä¾å­˜é–¢ä¿‚ファイル %s ã‚’é–‹ã„ã¦ã„ã¾ã™: %m"
#: c-family/c-opts.c:1119
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "when writing output to %s: %m"
-msgstr "%s ã¸ã®æ›¸ãè¾¼ã¿ã‚¨ãƒ©ãƒ¼ã§ã™"
+msgstr "出力を %s ã¸æ›¸ãè¾¼ã¿ä¸­ã§ã™: %m"
#: c-family/c-opts.c:1199
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "to generate dependencies you must specify either -M or -MM"
-msgstr "-M ã‹ -MM ã®ã„ãšã‚Œã‹ã‚’追加的ã«æŒ‡å®šã—ãªã‘ã‚Œã°ãªã‚Šã¾ã›ã‚“"
+msgstr "ä¾å­˜é–¢ä¿‚を生æˆã™ã‚‹ãŸã‚ã«ã¯ -M ã¾ãŸã¯ -MM ã®ã„ãšã‚Œã‹ã‚’指定ã—ãªã‘ã‚Œã°ã„ã‘ã¾ã›ã‚“"
#: c-family/c-opts.c:1222
#, gcc-internal-format
msgid "-MG may only be used with -M or -MM"
-msgstr ""
+msgstr "-MG 㯠-M ã¾ãŸã¯ -MM ã¨ä½µã›ã¦ã®ã¿ä½¿ç”¨ã§ãã¾ã™"
#: c-family/c-opts.c:1252
#, gcc-internal-format
msgid "-fdirectives-only is incompatible with -Wunused_macros"
-msgstr ""
+msgstr "-fdirectives-only 㯠-Wunused_macros ã¨ä½µç”¨ã§ãã¾ã›ã‚“"
#: c-family/c-opts.c:1254
#, gcc-internal-format
msgid "-fdirectives-only is incompatible with -traditional"
-msgstr ""
+msgstr "-fdirectives-only 㯠-traditional ã¨ä½µç”¨ã§ãã¾ã›ã‚“"
#: c-family/c-opts.c:1405
#, gcc-internal-format
msgid "too late for # directive to set debug directory"
-msgstr ""
+msgstr "デãƒãƒƒã‚°ãƒ‡ã‚£ãƒ¬ã‚¯ãƒˆãƒªã‚’設定ã™ã‚‹ # 指示ãŒé…ã™ãŽã¾ã™"
#: c-family/c-pch.c:132
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "can%'t create precompiled header %s: %m"
-msgstr "ディレクトリ %s を作æˆã§ãã¾ã›ã‚“"
+msgstr "å‰å‡¦ç†æ¸ˆãƒ˜ãƒƒãƒ€ %s を作æˆã§ãã¾ã›ã‚“: %m"
#: c-family/c-pch.c:154
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "can%'t write to %s: %m"
-msgstr "%s ã¸æ›¸ãè¾¼ã‚ã¾ã›ã‚“"
+msgstr "%s ã¸æ›¸ãè¾¼ã‚ã¾ã›ã‚“: %m"
#: c-family/c-pch.c:160
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "%qs is not a valid output file"
-msgstr "\"%s\" ã¯æ­£å¸¸ãªãƒ•ã‚¡ã‚¤ãƒ«åã§ã¯ã‚ã‚Šã¾ã›ã‚“"
+msgstr "%qs ã¯æœ‰åŠ¹ãªå‡ºåŠ›ãƒ•ã‚¡ã‚¤ãƒ«ã§ã¯ã‚ã‚Šã¾ã›ã‚“"
#: c-family/c-pch.c:191 c-family/c-pch.c:206 c-family/c-pch.c:223
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "can%'t write %s: %m"
-msgstr "%s ã¸æ›¸ãè¾¼ã‚ã¾ã›ã‚“"
+msgstr "%s ã¸æ›¸ãè¾¼ã‚ã¾ã›ã‚“: %m"
#: c-family/c-pch.c:196 c-family/c-pch.c:213
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "can%'t seek in %s: %m"
-msgstr "%s ã‚’ rewind ã§ãã¾ã›ã‚“"
+msgstr "%s 内ã§æŽ¢æŸ» (seek) ã§ãã¾ã›ã‚“: %m"
#: c-family/c-pch.c:204 c-family/c-pch.c:251 c-family/c-pch.c:292
#: c-family/c-pch.c:343
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "can%'t read %s: %m"
-msgstr "%s ã‚’ rewind ã§ãã¾ã›ã‚“"
+msgstr "%s を読ã¿è¾¼ã‚ã¾ã›ã‚“: %m"
#: c-family/c-pch.c:481
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "pch_preprocess pragma should only be used with -fpreprocessed"
-msgstr "-include ã‚„ -imacros 㯠-fpreprocessed ã¨ä¸€ç·’ã«ä½¿ã†ã“ã¨ã¯ã§ãã¾ã›ã‚“"
+msgstr "pch_preprocess pragma 㯠-fpreprocessed ã¨ä½µã›ã¦ã®ã¿ä½¿ç”¨ã™ã‚‹ã¹ãã§ã™"
#: c-family/c-pch.c:482
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "use #include instead"
-msgstr "#include ã®ãƒã‚¹ãƒˆãŒæ·±ã™ãŽã¾ã™"
+msgstr "代ã‚ã‚Šã« #include を使用ã—ã¦ãã ã•ã„"
#: c-family/c-pch.c:488
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "%s: couldn%'t open PCH file: %m"
-msgstr "ダンプファイル %s ã‚’é–‹ã‘ã¾ã›ã‚“ã§ã—ãŸ"
+msgstr "%s: PCH ファイルを開ã‘ã¾ã›ã‚“ã§ã—ãŸ: %m"
#: c-family/c-pch.c:493
#, gcc-internal-format
msgid "use -Winvalid-pch for more information"
-msgstr ""
+msgstr "詳細ã«ã¤ã„ã¦ã¯ -Winvalid-pch を使用ã—ã¦ãã ã•ã„"
#: c-family/c-pch.c:494
#, gcc-internal-format
msgid "%s: PCH file was invalid"
-msgstr ""
+msgstr "%s: PCH ファイルãŒç„¡åŠ¹ã§ã™"
#: c-family/c-pragma.c:101
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "#pragma pack (pop) encountered without matching #pragma pack (push)"
-msgstr "#pragma pack (pop) ãŒã€å¯¾å¿œã™ã‚‹ #pragma pack (push, <n>) ãªã—ã«å‡ºç¾ã—ã¾ã—ãŸ"
+msgstr "#pragma pack (pop) ã§å¯¾å¿œã™ã‚‹ #pragma pack (push) ãŒç„¡ã„ã‚‚ã®ã«é­é‡ã—ã¾ã—ãŸ"
#: c-family/c-pragma.c:114
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "#pragma pack(pop, %E) encountered without matching #pragma pack(push, %E)"
-msgstr "#pragma pack(pop, %s) ãŒã€å¯¾å¿œã™ã‚‹ #pragma pack(push, %s) ãªã—ã«å‡ºç¾ã—ã¾ã—ãŸ"
+msgstr "#pragma pack(pop, %E) ã§å¯¾å¿œã™ã‚‹ #pragma pack(push, %E) ãŒç„¡ã„ã‚‚ã®ã«é­é‡ã—ã¾ã—ãŸ"
#: c-family/c-pragma.c:144
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "missing %<(%> after %<#pragma pack%> - ignored"
-msgstr "ãŠã‹ã—㪠#pragma align - 無視ã•ã‚Œã¾ã—ãŸ"
+msgstr "%<#pragma pack%> ã®å¾Œã« %<(%> ãŒã‚ã‚Šã¾ã›ã‚“ - 無視ã•ã‚Œã¾ã—ãŸ"
#: c-family/c-pragma.c:155 c-family/c-pragma.c:187
#, gcc-internal-format
msgid "invalid constant in %<#pragma pack%> - ignored"
-msgstr ""
+msgstr "%<#pragma pack%> 内ã§ç„¡åŠ¹ãªå®šæ•°ã§ã™ - 無視ã•ã‚Œã¾ã—ãŸ"
#: c-family/c-pragma.c:159 c-family/c-pragma.c:201
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "malformed %<#pragma pack%> - ignored"
-msgstr "ãŠã‹ã—㪠#pragma align - 無視ã•ã‚Œã¾ã—ãŸ"
+msgstr "é–“é•ã£ãŸå½¢å¼ã® %<#pragma pack%> ã§ã™ - 無視ã•ã‚Œã¾ã—ãŸ"
#: c-family/c-pragma.c:164
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "malformed %<#pragma pack(push[, id][, <n>])%> - ignored"
-msgstr "ãŠã‹ã—㪠#pragma align - 無視ã•ã‚Œã¾ã—ãŸ"
+msgstr "é–“é•ã£ãŸå½¢å¼ã® %<#pragma pack(push[, id][, <n>])%> ã§ã™ - 無視ã•ã‚Œã¾ã—ãŸ"
#: c-family/c-pragma.c:166
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "malformed %<#pragma pack(pop[, id])%> - ignored"
-msgstr "ãŠã‹ã—㪠#pragma mapã€ç„¡è¦–ã•ã‚Œã¾ã—ãŸ"
+msgstr "é–“é•ã£ãŸå½¢å¼ã® %<#pragma pack(pop[, id])%> ã§ã™ - 無視ã•ã‚Œã¾ã—ãŸ"
#: c-family/c-pragma.c:175
#, gcc-internal-format
msgid "unknown action %qE for %<#pragma pack%> - ignored"
-msgstr ""
+msgstr "ä¸æ˜Žãªã‚¢ã‚¯ã‚·ãƒ§ãƒ³ %qE (%<#pragma pack%> 用) ã§ã™ - 無視ã•ã‚Œã¾ã—ãŸ"
#: c-family/c-pragma.c:204
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "junk at end of %<#pragma pack%>"
-msgstr "'#pragma pack' ã®æœ«å°¾ã«ã‚´ãƒŸãŒã‚ã‚Šã¾ã™"
+msgstr "%<#pragma pack%> ã®æœ«å°¾ã«ã‚´ãƒŸãŒã‚ã‚Šã¾ã™"
#: c-family/c-pragma.c:207
#, gcc-internal-format
msgid "#pragma pack has no effect with -fpack-struct - ignored"
-msgstr ""
+msgstr "#pragma pack 㯠-fpack-struct ã¨ä½µã›ã¦ä½¿ç”¨ã—ã¦ã‚‚効果ãŒã‚ã‚Šã¾ã›ã‚“ - 無視ã•ã‚Œã¾ã—ãŸ"
#: c-family/c-pragma.c:227
#, gcc-internal-format
msgid "alignment must be a small power of two, not %d"
-msgstr ""
+msgstr "整列㯠%d ã§ã¯ãªãã€å°ã•ãªäºŒã®ç´¯ä¹—ã®æ•°ã§ãªã‘ã‚Œã°ã„ã‘ã¾ã›ã‚“"
#: c-family/c-pragma.c:267
#, gcc-internal-format
@@ -20661,275 +20659,275 @@ msgid "applying #pragma weak %q+D after first use results in unspecified behavio
msgstr ""
#: c-family/c-pragma.c:345 c-family/c-pragma.c:350
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "malformed #pragma weak, ignored"
-msgstr "ãŠã‹ã—㪠#pragma mapã€ç„¡è¦–ã•ã‚Œã¾ã—ãŸ"
+msgstr "é–“é•ã£ãŸå½¢å¼ã® #pragma weak ã§ã™ã€‚無視ã•ã‚Œã¾ã—ãŸ"
#: c-family/c-pragma.c:354
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "junk at end of %<#pragma weak%>"
-msgstr "#pragma weak ã®æœ«å°¾ã«ã‚´ãƒŸãŒã‚ã‚Šã¾ã™"
+msgstr "%<#pragma weak%> ã®æœ«å°¾ã«ã‚´ãƒŸãŒã‚ã‚Šã¾ã™"
#: c-family/c-pragma.c:424 c-family/c-pragma.c:426
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "malformed #pragma redefine_extname, ignored"
-msgstr "ãŠã‹ã—㪠#pragma mapã€ç„¡è¦–ã•ã‚Œã¾ã—ãŸ"
+msgstr "é–“é•ã£ãŸå½¢å¼ã® #pragma redefine_extname ã§ã™ã€‚無視ã•ã‚Œã¾ã—ãŸ"
#: c-family/c-pragma.c:429
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "junk at end of %<#pragma redefine_extname%>"
-msgstr "#pragma weak ã®æœ«å°¾ã«ã‚´ãƒŸãŒã‚ã‚Šã¾ã™"
+msgstr "%<#pragma redefine_extname%> ã®æœ«å°¾ã«ã‚´ãƒŸãŒã‚ã‚Šã¾ã™"
#: c-family/c-pragma.c:444 c-family/c-pragma.c:536
#, gcc-internal-format
msgid "#pragma redefine_extname ignored due to conflict with previous rename"
-msgstr ""
+msgstr "#pragma redefine_extname ã¯å‰ã®åå‰å¤‰æ›´ã¨ç«¶åˆã™ã‚‹ãŸã‚無視ã•ã‚Œã¾ã—ãŸ"
#: c-family/c-pragma.c:470
#, gcc-internal-format
msgid "#pragma redefine_extname ignored due to conflict with previous #pragma redefine_extname"
-msgstr ""
+msgstr "#pragma redefine_extname ã¯å‰ã® #pragma redefine_extname ã¨ç«¶åˆã™ã‚‹ãŸã‚無視ã•ã‚Œã¾ã—ãŸ"
#: c-family/c-pragma.c:490
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "malformed #pragma extern_prefix, ignored"
-msgstr "ãŠã‹ã—㪠#pragma mapã€ç„¡è¦–ã•ã‚Œã¾ã—ãŸ"
+msgstr "é–“é•ã£ãŸå½¢å¼ã® #pragma extern_prefix ã§ã™ã€‚無視ã•ã‚Œã¾ã—ãŸ"
#: c-family/c-pragma.c:493
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "junk at end of %<#pragma extern_prefix%>"
-msgstr "#pragma %s ã®æœ«å°¾ã«ã‚´ãƒŸ"
+msgstr "%<#pragma extern_prefix%> ã®æœ«å°¾ã«ã‚´ãƒŸãŒã‚ã‚Šã¾ã™"
#: c-family/c-pragma.c:500
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "#pragma extern_prefix not supported on this target"
-msgstr "スタック制é™ã¯ã“ã®ã‚¿ãƒ¼ã‚²ãƒƒãƒˆã§ã¯å®Ÿè£…ã•ã‚Œã¦ã„ã¾ã›ã‚“"
+msgstr "#pragma extern_prefix ã¯ã“ã®ã‚¿ãƒ¼ã‚²ãƒƒãƒˆã§ã¯ã‚µãƒãƒ¼ãƒˆã•ã‚Œã¦ã„ã¾ã›ã‚“"
#: c-family/c-pragma.c:527
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "asm declaration ignored due to conflict with previous rename"
-msgstr "`%s' ã®ã‚»ã‚¯ã‚·ãƒ§ãƒ³ã¯å‰æ–¹ã§ã«å®£è¨€ã•ã‚ŒãŸã‚‚ã®ã¨è¡çªã—ã¾ã™"
+msgstr "アセンブラ宣言ã¯å‰ã®åå‰å¤‰æ›´ã¨ç«¶åˆã™ã‚‹ãŸã‚無視ã•ã‚Œã¾ã—ãŸ"
#: c-family/c-pragma.c:560
#, gcc-internal-format
msgid "#pragma redefine_extname ignored due to conflict with __asm__ declaration"
-msgstr ""
+msgstr "#pragma redefine_extname 㯠__asm__ 宣言ã¨ç«¶åˆã™ã‚‹ãŸã‚無視ã•ã‚Œã¾ã—ãŸ"
#: c-family/c-pragma.c:622
#, gcc-internal-format
msgid "#pragma GCC visibility push() must specify default, internal, hidden or protected"
-msgstr ""
+msgstr "#pragma GCC visibility push() 㯠defaultã€internalã€hidden ã¾ãŸã¯ protected を指定ã—ãªã‘ã‚Œã°ã„ã‘ã¾ã›ã‚“"
#: c-family/c-pragma.c:664
#, gcc-internal-format
msgid "#pragma GCC visibility must be followed by push or pop"
-msgstr ""
+msgstr "#pragma GCC visibility ã«ã¯ push ã¾ãŸã¯ pop を続ã‘ãªã‘ã‚Œã°ã„ã‘ã¾ã›ã‚“"
#: c-family/c-pragma.c:670
#, gcc-internal-format
msgid "no matching push for %<#pragma GCC visibility pop%>"
-msgstr ""
+msgstr "%<#pragma GCC visibility pop%> ã«å¯¾å¿œã™ã‚‹ push ãŒã‚ã‚Šã¾ã›ã‚“"
#: c-family/c-pragma.c:675 c-family/c-pragma.c:682
#, gcc-internal-format
msgid "missing %<(%> after %<#pragma GCC visibility push%> - ignored"
-msgstr ""
+msgstr "%<#pragma GCC visibility push%> ã®å¾Œã« %<(%> ãŒã‚ã‚Šã¾ã›ã‚“ - 無視ã•ã‚Œã¾ã—ãŸ"
#: c-family/c-pragma.c:678
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "malformed #pragma GCC visibility push"
-msgstr "ãŠã‹ã—㪠#pragma ghs section"
+msgstr "誤ã£ãŸå½¢å¼ã® #pragma GCC visibility push ã§ã™"
#: c-family/c-pragma.c:686
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "junk at end of %<#pragma GCC visibility%>"
-msgstr "#pragma %s ã®æœ«å°¾ã«ã‚´ãƒŸ"
+msgstr "%<#pragma GCC visibility%> ã®æœ«å°¾ã«ã‚´ãƒŸãŒã‚ã‚Šã¾ã™"
#: c-family/c-pragma.c:701
#, gcc-internal-format
msgid "missing [error|warning|ignored] after %<#pragma GCC diagnostic%>"
-msgstr ""
+msgstr "%<#pragma GCC diagnostic%> ã®å¾Œã« [error|warning|ignored] ãŒã‚ã‚Šã¾ã›ã‚“"
#: c-family/c-pragma.c:720
#, gcc-internal-format
msgid "expected [error|warning|ignored|push|pop] after %<#pragma GCC diagnostic%>"
-msgstr ""
+msgstr "%<#pragma GCC diagnostic%> ã®å¾Œã« [error|warning|ignored|push|pop] ãŒäºˆæœŸã•ã‚Œã¾ã™"
#: c-family/c-pragma.c:724
#, gcc-internal-format
msgid "missing option after %<#pragma GCC diagnostic%> kind"
-msgstr ""
+msgstr "%<#pragma GCC diagnostic%> é¡žã®å¾Œã«ã‚ªãƒ—ションãŒã‚ã‚Šã¾ã›ã‚“"
#: c-family/c-pragma.c:736
#, gcc-internal-format
msgid "unknown option after %<#pragma GCC diagnostic%> kind"
-msgstr ""
+msgstr "%<#pragma GCC diagnostic%> ã®å¾Œã«ä¸æ˜Žãªã‚ªãƒ—ションã§ã™"
#: c-family/c-pragma.c:749
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "#pragma GCC option is not allowed inside functions"
-msgstr "ブレースã§ã¾ã¨ã‚られãŸå¼ã¯é–¢æ•°ã®å†…å´ã§ã®ã¿è¨±ã•ã‚Œã¾ã™"
+msgstr "#pragma GCC option ã¯é–¢æ•°å†…ã§ã¯è¨±å¯ã•ã‚Œã¦ã„ã¾ã›ã‚“"
#: c-family/c-pragma.c:762
#, gcc-internal-format
msgid "%<#pragma GCC option%> is not a string"
-msgstr ""
+msgstr "%<#pragma GCC option%> ãŒæ–‡å­—列ã§ã¯ã‚ã‚Šã¾ã›ã‚“"
#: c-family/c-pragma.c:789
#, gcc-internal-format
msgid "%<#pragma GCC target (string [,string]...)%> does not have a final %<)%>"
-msgstr ""
+msgstr "%<#pragma GCC target (string [,string]...)%> ã«æœ€å¾Œã® %<)%> ãŒã‚ã‚Šã¾ã›ã‚“"
#: c-family/c-pragma.c:795
#, gcc-internal-format
msgid "#pragma GCC target string... is badly formed"
-msgstr ""
+msgstr "#pragma GCC target string... ã®å½¢å¼ã«é–“é•ã„ãŒã‚ã‚Šã¾ã™"
#: c-family/c-pragma.c:818
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "#pragma GCC optimize is not allowed inside functions"
-msgstr "åˆæœŸåŒ–å­ãƒªã‚¹ãƒˆã¯éžãƒ¡ãƒ³ãƒé–¢æ•°ã§ã¯ä½¿ãˆã¾ã›ã‚“"
+msgstr "#pragma GCC optimize ã¯é–¢æ•°å†…ã§ã¯è¨±å¯ã•ã‚Œã¦ã„ã¾ã›ã‚“"
#: c-family/c-pragma.c:831
#, gcc-internal-format
msgid "%<#pragma GCC optimize%> is not a string or number"
-msgstr ""
+msgstr "%<#pragma GCC optimize%> ãŒæ–‡å­—列ã¾ãŸã¯ç•ªå·ã§ã¯ã‚ã‚Šã¾ã›ã‚“"
#: c-family/c-pragma.c:857
#, gcc-internal-format
msgid "%<#pragma GCC optimize (string [,string]...)%> does not have a final %<)%>"
-msgstr ""
+msgstr "%<#pragma GCC optimize (string [,string]...)%> ã«æœ€å¾Œã® %<)%> ãŒã‚ã‚Šã¾ã›ã‚“"
#: c-family/c-pragma.c:863
#, gcc-internal-format
msgid "#pragma GCC optimize string... is badly formed"
-msgstr ""
+msgstr "#pragma GCC optimize string... ã®å½¢å¼ã«é–“é•ã„ãŒã‚ã‚Šã¾ã™"
#: c-family/c-pragma.c:905
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "junk at end of %<#pragma push_options%>"
-msgstr "#pragma ghs section ã®çµ‚ã‚Šã«ã‚´ãƒŸãŒã‚ã‚Šã¾ã™"
+msgstr "%<#pragma push_options%> ã®æœ«å°¾ã«ã‚´ãƒŸãŒã‚ã‚Šã¾ã™"
#: c-family/c-pragma.c:935
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "junk at end of %<#pragma pop_options%>"
-msgstr "#pragma %s ã®æœ«å°¾ã«ã‚´ãƒŸ"
+msgstr "%<#pragma pop_options%> ã®æœ«å°¾ã«ã‚´ãƒŸãŒã‚ã‚Šã¾ã™"
#: c-family/c-pragma.c:942
#, gcc-internal-format
msgid "%<#pragma GCC pop_options%> without a corresponding %<#pragma GCC push_options%>"
-msgstr ""
+msgstr "%<#pragma GCC pop_options%> ã«å¯¾å¿œã—㟠%<#pragma GCC push_options%> ãŒã‚ã‚Šã¾ã›ã‚“"
#: c-family/c-pragma.c:984
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "junk at end of %<#pragma reset_options%>"
-msgstr "#pragma ghs section ã®çµ‚ã‚Šã«ã‚´ãƒŸãŒã‚ã‚Šã¾ã™"
+msgstr "%<#pragma reset_options%> ã®æœ«å°¾ã«ã‚´ãƒŸãŒã‚ã‚Šã¾ã™"
#: c-family/c-pragma.c:1022 c-family/c-pragma.c:1029
#, gcc-internal-format
msgid "expected a string after %<#pragma message%>"
-msgstr ""
+msgstr "%<#pragma message%> ã®å¾Œã«æ–‡å­—列ãŒäºˆæœŸã•ã‚Œã¾ã™"
#: c-family/c-pragma.c:1024
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "malformed %<#pragma message%>, ignored"
-msgstr "ãŠã‹ã—㪠#pragma mapã€ç„¡è¦–ã•ã‚Œã¾ã—ãŸ"
+msgstr "é–“é•ã£ãŸå½¢å¼ã® %<#pragma message%> ã§ã™ã€‚無視ã•ã‚Œã¾ã—ãŸ"
#: c-family/c-pragma.c:1034
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "junk at end of %<#pragma message%>"
-msgstr "#pragma map ã®çµ‚ã‚Šã«ã‚´ãƒŸãŒã‚ã‚Šã¾ã™"
+msgstr "%<#pragma message%> ã®æœ«å°¾ã«ã‚´ãƒŸãŒã‚ã‚Šã¾ã™"
#: c-family/c-pragma.c:1037
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "#pragma message: %s"
-msgstr "ä¸æ˜Žãª #pragma namespace %s ã§ã™"
+msgstr "#pragma message: %s"
#: c-family/c-pragma.c:1074
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "invalid location for %<pragma %s%>, ignored"
-msgstr "ãŠã‹ã—㪠#pragma mapã€ç„¡è¦–ã•ã‚Œã¾ã—ãŸ"
+msgstr ""
#: c-family/c-pragma.c:1081 c-family/c-pragma.c:1095
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "malformed %<#pragma %s%>, ignored"
-msgstr "ãŠã‹ã—㪠#pragma mapã€ç„¡è¦–ã•ã‚Œã¾ã—ãŸ"
+msgstr "é–“é•ã£ãŸå½¢å¼ã® %<#pragma %s%> ã§ã™ã€‚無視ã•ã‚Œã¾ã—ãŸ"
#: c-family/c-pragma.c:1101
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "junk at end of %<#pragma %s%>"
-msgstr "#pragma %s ã®æœ«å°¾ã«ã‚´ãƒŸ"
+msgstr "%<#pragma %s%> ã®æœ«å°¾ã«ã‚´ãƒŸãŒã‚ã‚Šã¾ã™"
#: c-family/c-pragma.c:1119
#, gcc-internal-format
msgid "%<#pragma STDC FLOAT_CONST_DECIMAL64%> is not supported for C++"
-msgstr ""
+msgstr "%<#pragma STDC FLOAT_CONST_DECIMAL64%> 㯠C++ 用ã«ã¯ã‚µãƒãƒ¼ãƒˆã•ã‚Œã¦ã„ã¾ã›ã‚“"
#: c-family/c-pragma.c:1128
#, gcc-internal-format
msgid "%<#pragma STDC FLOAT_CONST_DECIMAL64%> is not supported on this target"
-msgstr ""
+msgstr "%<#pragma STDC FLOAT_CONST_DECIMAL64%> ã¯ã“ã®ã‚¿ãƒ¼ã‚²ãƒƒãƒˆã§ã¯ã‚µãƒãƒ¼ãƒˆã•ã‚Œã¦ã„ã¾ã›ã‚“"
#: c-family/c-pragma.c:1134
#, gcc-internal-format
msgid "ISO C does not support %<#pragma STDC FLOAT_CONST_DECIMAL64%>"
-msgstr ""
+msgstr "ISO C 㯠%<#pragma STDC FLOAT_CONST_DECIMAL64%> をサãƒãƒ¼ãƒˆã—ã¾ã›ã‚“"
#: c-family/c-semantics.c:167
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "wrong type argument to %s"
-msgstr "abs ã¸ã®å¼•æ•°ã®åž‹ãŒé–“é•ã£ã¦ã„ã¾ã™"
+msgstr "%s ã¸ã®é–“é•ã£ãŸåž‹ã®å¼•æ•°ã§ã™"
#: config/darwin-c.c:85
#, gcc-internal-format
msgid "too many #pragma options align=reset"
-msgstr ""
+msgstr "#pragma options align=reset ãŒå¤šã™ãŽã¾ã™"
#: config/darwin-c.c:105 config/darwin-c.c:108 config/darwin-c.c:110
#: config/darwin-c.c:112
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "malformed '#pragma options', ignoring"
-msgstr "ãŠã‹ã—㪠#pragma mapã€ç„¡è¦–ã•ã‚Œã¾ã—ãŸ"
+msgstr "é–“é•ã£ãŸå½¢å¼ã® '#pragma options' ã§ã™ã€‚無視ã•ã‚Œã¾ã—ãŸ"
#: config/darwin-c.c:115
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "junk at end of '#pragma options'"
-msgstr "'#pragma %s' ã®æœ€å¾Œã«ã‚´ãƒŸãŒã‚ã‚Šã¾ã™"
+msgstr "'#pragma options' ã®æœ«å°¾ã«ã‚´ãƒŸãŒã‚ã‚Šã¾ã™"
#: config/darwin-c.c:125
#, gcc-internal-format
msgid "malformed '#pragma options align={mac68k|power|reset}', ignoring"
-msgstr ""
+msgstr "é–“é•ã£ãŸå½¢å¼ã® '#pragma options align={mac68k|power|reset}' ã§ã™ã€‚無視ã•ã‚Œã¾ã—ãŸ"
#: config/darwin-c.c:137
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "missing '(' after '#pragma unused', ignoring"
-msgstr "述語ã®å¾Œã‚ã® '(' を欠ã„ã¦ã„ã¾ã™"
+msgstr "'#pragma unused' ã®å¾Œã« '(' ãŒã‚ã‚Šã¾ã›ã‚“。無視ã•ã‚Œã¾ã—ãŸ"
#: config/darwin-c.c:158
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "missing ')' after '#pragma unused', ignoring"
-msgstr "述語ã®å¾Œã‚ã® '(' を欠ã„ã¦ã„ã¾ã™"
+msgstr "'#pragma unused' ã®å¾Œã« ')' ãŒã‚ã‚Šã¾ã›ã‚“。無視ã•ã‚Œã¾ã—ãŸ"
#: config/darwin-c.c:161
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "junk at end of '#pragma unused'"
-msgstr "'#pragma %s' ã®æœ€å¾Œã«ã‚´ãƒŸãŒã‚ã‚Šã¾ã™"
+msgstr "'#pragma unused' ã®æœ«å°¾ã«ã‚´ãƒŸãŒã‚ã‚Šã¾ã™"
#: config/darwin-c.c:172
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "malformed '#pragma ms_struct', ignoring"
-msgstr "ãŠã‹ã—㪠#pragma mapã€ç„¡è¦–ã•ã‚Œã¾ã—ãŸ"
+msgstr "é–“é•ã£ãŸå½¢å¼ã® '#pragma ms_struct' ã§ã™ã€‚無視ã•ã‚Œã¾ã—ãŸ"
#: config/darwin-c.c:180
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "malformed '#pragma ms_struct {on|off|reset}', ignoring"
-msgstr "ãŠã‹ã—㪠#pragma ghs section"
+msgstr "é–“é•ã£ãŸå½¢å¼ã® '#pragma ms_struct {on|off|reset}' ã§ã™ã€‚無視ã•ã‚Œã¾ã—ãŸ"
#: config/darwin-c.c:183
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "junk at end of '#pragma ms_struct'"
-msgstr "'#pragma %s' ã®æœ€å¾Œã«ã‚´ãƒŸãŒã‚ã‚Šã¾ã™"
+msgstr "'#pragma ms_struct' ã®æœ«å°¾ã«ã‚´ãƒŸãŒã‚ã‚Šã¾ã™"
#: config/darwin-c.c:409
#, gcc-internal-format
@@ -20939,72 +20937,72 @@ msgstr ""
#: config/darwin-c.c:592
#, gcc-internal-format
msgid "unknown value %qs of -mmacosx-version-min"
-msgstr ""
+msgstr "-mmacosx-version-min ã®ä¸æ˜Žãªå€¤ %qs ã§ã™"
#: config/darwin-driver.c:90
#, gcc-internal-format
msgid "sysctl for kern.osversion failed: %m"
-msgstr ""
+msgstr "kern.osversion ã® sysctl ã«å¤±æ•—ã—ã¾ã—ãŸ: %m"
#: config/darwin-driver.c:136
#, gcc-internal-format
msgid "couldn%'t understand kern.osversion %q.*s"
-msgstr ""
+msgstr "kern.osversion %q.*s を解釈ã§ãã¾ã›ã‚“"
#: config/darwin.c:1554
#, gcc-internal-format
msgid "failed to open temporary file %s for LTO output"
-msgstr ""
+msgstr "LTO 出力用一時ファイル %s ã‚’é–‹ãã®ã«å¤±æ•—ã—ã¾ã—ãŸ"
#: config/darwin.c:1642
#, gcc-internal-format
msgid "%qE 2.95 vtable-compatibility attribute applies only when compiling a kext"
-msgstr ""
+msgstr "%qE 2.95 vtable-compatibility 属性㯠kext をコンパイルã™ã‚‹ã¨ãã®ã¿é©ç”¨ã•ã‚Œã¾ã™"
#: config/darwin.c:1649
#, gcc-internal-format
msgid "%qE 2.95 vtable-compatibility attribute applies only to C++ classes"
-msgstr ""
+msgstr "%qE 2.95 vtable-compatibility 属性㯠C++ クラスã¸ã®ã¿é©ç”¨ã•ã‚Œã¾ã™"
#: config/darwin.c:2284
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "internal and protected visibility attributes not supported in this configuration; ignored"
-msgstr "ç¾åœ¨ã®è¨­å®šã§ã¯ alias 定義ã¯ã‚µãƒãƒ¼ãƒˆã•ã‚Œã¾ã›ã‚“ -- 無視ã•ã‚Œã¾ã—ãŸ"
+msgstr "ç¾åœ¨ã®è¨­å®šã§ã¯ internal ãŠã‚ˆã³ protected visibility 属性ã¯ã‚µãƒãƒ¼ãƒˆã•ã‚Œã¾ã›ã‚“。無視ã•ã‚Œã¾ã—ãŸ"
#: config/darwin.c:2446
#, gcc-internal-format
msgid "failed to open temporary file %s with LTO output"
-msgstr ""
+msgstr "LTO 出力ã®ä¸€æ™‚ファイル %s ã‚’é–‹ãã®ã«å¤±æ•—ã—ã¾ã—ãŸ"
#: config/darwin.c:2601
#, gcc-internal-format
msgid "-mdynamic-no-pic overrides -fpic or -fPIC"
-msgstr ""
+msgstr "-mdynamic-no-pic 㯠-fpic ã¾ãŸã¯ -fPIC を上書ãã—ã¾ã™"
#: config/darwin.c:2781
#, gcc-internal-format
msgid "built-in function %qD requires the %<-mconstant-cfstrings%> flag"
-msgstr ""
+msgstr "組ã¿è¾¼ã¿é–¢æ•° %qD 㯠%<-mconstant-cfstrings%> フラグをè¦æ±‚ã—ã¾ã™"
#: config/darwin.c:2788
#, gcc-internal-format
msgid "built-in function %qD takes one argument only"
-msgstr ""
+msgstr "組ã¿è¾¼ã¿é–¢æ•° %qD ã¯å˜ä¸€ã®å¼•æ•°ã‚’ã¨ã‚Šã¾ã™"
#: config/darwin.c:2833
#, gcc-internal-format
msgid "CFString literal is missing"
-msgstr ""
+msgstr "CFString リテラルãŒã‚ã‚Šã¾ã›ã‚“"
#: config/darwin.c:2844
#, gcc-internal-format
msgid "CFString literal expression is not a string constant"
-msgstr ""
+msgstr "CFString リテラルå¼ãŒæ–‡å­—列定数ã§ã¯ã‚ã‚Šã¾ã›ã‚“"
#: config/darwin.c:2867
#, gcc-internal-format
msgid "%s in CFString literal"
-msgstr ""
+msgstr "CFString リテラル内㫠%s ãŒã‚ã‚Šã¾ã™"
#: config/host-darwin.c:61
#, gcc-internal-format
@@ -21012,69 +21010,69 @@ msgid "couldn%'t unmap pch_address_space: %m"
msgstr ""
#: config/sol2-c.c:92 config/sol2-c.c:108
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "malformed %<#pragma align%>, ignoring"
-msgstr "ãŠã‹ã—㪠#pragma align - 無視ã•ã‚Œã¾ã—ãŸ"
+msgstr "é–“é•ã£ãŸå½¢å¼ã® %<#pragma align%> ã§ã™ã€‚無視ã—ã¦ã„ã¾ã™"
#: config/sol2-c.c:101
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "invalid alignment for %<#pragma align%>, ignoring"
-msgstr "ãŠã‹ã—㪠#pragma align - 無視ã•ã‚Œã¾ã—ãŸ"
+msgstr "%<#pragma align%> ã¸ã®ç„¡åŠ¹ãªå¼•æ•°ã§ã™ã€‚無視ã—ã¦ã„ã¾ã™"
#: config/sol2-c.c:116
#, gcc-internal-format
msgid "%<#pragma align%> must appear before the declaration of %D, ignoring"
-msgstr ""
+msgstr "%<#pragma align%> 㯠%D ã®å‰ã«ç¾ã‚Œãªã‘ã‚Œã°ã„ã‘ã¾ã›ã‚“。無視ã—ã¦ã„ã¾ã™"
#: config/sol2-c.c:128 config/sol2-c.c:140
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "malformed %<#pragma align%>"
-msgstr "ãŠã‹ã—㪠#pragma mapã€ç„¡è¦–ã•ã‚Œã¾ã—ãŸ"
+msgstr "é–“é•ã£ãŸå½¢å¼ã® %<#pragma align%> ã§ã™"
#: config/sol2-c.c:135
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "junk at end of %<#pragma align%>"
-msgstr "#pragma %s ã®æœ«å°¾ã«ã‚´ãƒŸ"
+msgstr "%<#pragma align%> ã®æœ«å°¾ã«ã‚´ãƒŸãŒã‚ã‚Šã¾ã™"
#: config/sol2-c.c:156 config/sol2-c.c:163
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "malformed %<#pragma init%>, ignoring"
-msgstr "ãŠã‹ã—㪠#pragma mapã€ç„¡è¦–ã•ã‚Œã¾ã—ãŸ"
+msgstr "é–“é•ã£ãŸå½¢å¼ã® %<#pragma init%> ã§ã™ã€‚無視ã—ã¦ã„ã¾ã™"
#: config/sol2-c.c:187 config/sol2-c.c:199
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "malformed %<#pragma init%>"
-msgstr "ãŠã‹ã—㪠#pragma ghs section"
+msgstr "é–“é•ã£ãŸå½¢å¼ã® %<#pragma init%> ã§ã™"
#: config/sol2-c.c:194
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "junk at end of %<#pragma init%>"
-msgstr "#pragma %s ã®æœ«å°¾ã«ã‚´ãƒŸ"
+msgstr "%<#pragma init%> ã®æœ«å°¾ã«ã‚´ãƒŸãŒã‚ã‚Šã¾ã™"
#: config/sol2-c.c:215 config/sol2-c.c:222
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "malformed %<#pragma fini%>, ignoring"
-msgstr "ãŠã‹ã—㪠#pragma mapã€ç„¡è¦–ã•ã‚Œã¾ã—ãŸ"
+msgstr "é–“é•ã£ãŸå½¢å¼ã® %<#pragma fini%> ã§ã™ã€‚無視ã—ã¦ã„ã¾ã™"
#: config/sol2-c.c:246 config/sol2-c.c:258
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "malformed %<#pragma fini%>"
-msgstr "ãŠã‹ã—㪠#pragma ghs section"
+msgstr "é–“é•ã£ãŸå½¢å¼ã® %<#pragma fini%> ã§ã™"
#: config/sol2-c.c:253
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "junk at end of %<#pragma fini%>"
-msgstr "#pragma %s ã®æœ«å°¾ã«ã‚´ãƒŸ"
+msgstr "%<#pragma fini%> ã®æœ«å°¾ã«ã‚´ãƒŸãŒã‚ã‚Šã¾ã™"
#: config/sol2.c:54
#, gcc-internal-format
msgid "ignoring %<#pragma align%> for explicitly aligned %q+D"
-msgstr ""
+msgstr "明示的ã«æ•´åˆ—ã•ã‚Œã¦ã„ã‚‹ %q+D 用㮠%<#pragma align%> を無視ã—ã¦ã„ã¾ã™"
#: config/vxworks.c:146
#, gcc-internal-format
msgid "PIC is only supported for RTPs"
-msgstr ""
+msgstr "PIC 㯠RTP 用ã«ã®ã¿ã‚µãƒãƒ¼ãƒˆã•ã‚Œã¦ã„ã¾ã™"
#. Mach-O supports 'weak imports', and 'weak definitions' in coalesced
#. sections. machopic_select_section ensures that weak variables go in
@@ -21082,85 +21080,85 @@ msgstr ""
#. not supported. Weak symbols that aren't visible outside the .s file
#. are not supported.
#: config/darwin.h:430
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "alias definitions not supported in Mach-O; ignored"
-msgstr "ç¾åœ¨ã®è¨­å®šã§ã¯ alias 定義ã¯ã‚µãƒãƒ¼ãƒˆã•ã‚Œã¾ã›ã‚“ -- 無視ã•ã‚Œã¾ã—ãŸ"
+msgstr "別å定義㯠Mach-O ã§ã¯ã‚µãƒãƒ¼ãƒˆã•ã‚Œã¦ã„ã¾ã›ã‚“。無視ã•ã‚Œã¾ã—ãŸ"
#. No profiling.
#: config/vx-common.h:89
#, gcc-internal-format
msgid "profiler support for VxWorks"
-msgstr ""
+msgstr "VxWorks 用ã®ãƒ—ロファイルサãƒãƒ¼ãƒˆ"
#: config/alpha/alpha.c:236 config/rs6000/rs6000.c:4401
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "bad value %qs for -mtls-size switch"
-msgstr "-mips スイッãƒã«å¯¾ã™ã‚‹ä¸æ­£ãªå€¤ (%s)"
+msgstr "-mtls-size スイッãƒç”¨ã®é–“é•ã£ãŸå€¤ %qs ã§ã™"
#: config/alpha/alpha.c:294
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "-f%s ignored for Unicos/Mk (not supported)"
-msgstr "-f%s 㯠68HC11/68HC12 用ã¨ã—ã¦ã¯ç„¡è¦–ã•ã‚Œã¾ã—㟠(サãƒãƒ¼ãƒˆã•ã‚Œã¾ã›ã‚“)"
+msgstr "Unicos/Mk 用ã¨ã—ã¦ã¯ -f%s ã¯ç„¡è¦–ã•ã‚Œã¾ã—㟠(サãƒãƒ¼ãƒˆã•ã‚Œã¦ã„ã¾ã›ã‚“)"
#: config/alpha/alpha.c:318
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "-mieee not supported on Unicos/Mk"
-msgstr "-pipe ã¯å®Ÿè£…ã•ã‚Œã¦ã„ã¾ã›ã‚“"
+msgstr "-mieee 㯠Unicos/Mk 上ã§ã¯ã‚µãƒãƒ¼ãƒˆã•ã‚Œã¦ã„ã¾ã›ã‚“"
#: config/alpha/alpha.c:329
#, gcc-internal-format
msgid "-mieee-with-inexact not supported on Unicos/Mk"
-msgstr ""
+msgstr "-mieee-with-inexact 㯠Unicos/Mk 上ã§ã¯ã‚µãƒãƒ¼ãƒˆã•ã‚Œã¦ã„ã¾ã›ã‚“"
#: config/alpha/alpha.c:346
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "bad value %qs for -mtrap-precision switch"
-msgstr "-mtrap-precision スイッãƒã«ã¨ã£ã¦ã®ä¸æ­£ãªå€¤ `%s'"
+msgstr "-mtrap-precision スイッãƒç”¨ã®é–“é•ã£ãŸå€¤ %qs ã§ã™"
#: config/alpha/alpha.c:360
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "bad value %qs for -mfp-rounding-mode switch"
-msgstr "-mfp-rounding-mode スイッãƒã«ã¨ã£ã¦ã®ä¸æ­£ãªå€¤ `%s'"
+msgstr "-mfp-rounding-mode スイッãƒç”¨ã®é–“é•ã£ãŸå€¤ %qs ã§ã™"
#: config/alpha/alpha.c:375
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "bad value %qs for -mfp-trap-mode switch"
-msgstr "-mfp-trap-mode スイッãƒã«ã¨ã£ã¦ã®ä¸æ­£ãªå€¤ `%s'"
+msgstr "-mfp-trap-mode スイッãƒç”¨ã®é–“é•ã£ãŸå€¤ %qs ã§ã™"
#: config/alpha/alpha.c:389
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "bad value %qs for -mcpu switch"
-msgstr "-mcpu スイッãƒã«ã¨ã£ã¦ã®ä¸æ­£ãªå€¤ `%s'"
+msgstr "-mcpu スイッãƒç”¨ã®é–“é•ã£ãŸå€¤ %qs ã§ã™"
#: config/alpha/alpha.c:401
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "bad value %qs for -mtune switch"
-msgstr "-mcpu スイッãƒã«ã¨ã£ã¦ã®ä¸æ­£ãªå€¤ `%s'"
+msgstr "-mtune スイッãƒç”¨ã®é–“é•ã£ãŸå€¤ %qs ã§ã™"
#: config/alpha/alpha.c:408
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "trap mode not supported on Unicos/Mk"
-msgstr "VAX 浮動å°æ•°ã§ã¯ãƒˆãƒ©ãƒƒãƒ—モードを利用ã§ãã¾ã›ã‚“"
+msgstr "Unicos/Mk 上ã§ã¯ãƒˆãƒ©ãƒƒãƒ—モードã¯ã‚µãƒãƒ¼ãƒˆã•ã‚Œã¦ã„ã¾ã›ã‚“"
#: config/alpha/alpha.c:415
#, gcc-internal-format
msgid "fp software completion requires -mtrap-precision=i"
-msgstr "浮動å°æ•°ç‚¹è£œå®Œã¯ -mtrap-precision=i ã‚’å¿…è¦ã¨ã—ã¾ã™"
+msgstr "浮動å°æ•°ç‚¹ã‚½ãƒ•ãƒˆã‚¦ã‚§ã‚¢è£œå®Œã«ã¯ -mtrap-precision=i ãŒå¿…è¦ã§ã™"
#: config/alpha/alpha.c:431
#, gcc-internal-format
msgid "rounding mode not supported for VAX floats"
-msgstr "VAX 浮動å°æ•°ã§ã¯ä¸¸ã‚モードを利用ã§ãã¾ã›ã‚“"
+msgstr "VAX 浮動å°æ•°ã§ã¯ä¸¸ã‚モードã¯ã‚µãƒãƒ¼ãƒˆã•ã‚Œã¦ã„ã¾ã›ã‚“"
#: config/alpha/alpha.c:436
#, gcc-internal-format
msgid "trap mode not supported for VAX floats"
-msgstr "VAX 浮動å°æ•°ã§ã¯ãƒˆãƒ©ãƒƒãƒ—モードを利用ã§ãã¾ã›ã‚“"
+msgstr "VAX 浮動å°æ•°ã§ã¯ãƒˆãƒ©ãƒƒãƒ—モードã¯ã‚µãƒãƒ¼ãƒˆã•ã‚Œã¦ã„ã¾ã›ã‚“"
#: config/alpha/alpha.c:440
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "128-bit long double not supported for VAX floats"
-msgstr "VAX 浮動å°æ•°ã§ã¯ãƒˆãƒ©ãƒƒãƒ—モードを利用ã§ãã¾ã›ã‚“"
+msgstr "128 ビット long double 㯠VAX 浮動å°æ•°ç”¨ã«ã¯ã‚µãƒãƒ¼ãƒˆã•ã‚Œã¦ã„ã¾ã›ã‚“"
#: config/alpha/alpha.c:468
#, gcc-internal-format
@@ -21168,85 +21166,86 @@ msgid "L%d cache latency unknown for %s"
msgstr "L%d キャッシュレイテンシ㯠%s ã«ã¨ã£ã¦ä¸æ˜Žã§ã™"
#: config/alpha/alpha.c:483
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "bad value %qs for -mmemory-latency"
-msgstr "`%s' 㯠-mmemory-latency ã«ã¨ã£ã¦ä¸æ­£ãªå€¤ã§ã™"
+msgstr "-mmemory-latency 用ã®é–“é•ã£ãŸå€¤ %qs ã§ã™"
#: config/alpha/alpha.c:6720 config/alpha/alpha.c:6723 config/s390/s390.c:9082
#: config/s390/s390.c:9085
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "bad builtin fcode"
-msgstr "組ã¿è¾¼ã¿ãƒžã‚¯ãƒ­ \"%s\" ã¯ç„¡åŠ¹ã§ã™"
+msgstr "é–“é•ã£ãŸçµ„ã¿è¾¼ã¿ fcode ã§ã™"
#: config/arc/arc.c:412
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "argument of %qE attribute is not a string constant"
-msgstr "asm テンプレートãŒæ–‡å­—列定数ã§ã¯ã‚ã‚Šã¾ã›ã‚“"
+msgstr "%qE 属性ã®å¼•æ•°ãŒæ–‡å­—列定数ã§ã¯ã‚ã‚Šã¾ã›ã‚“"
#: config/arc/arc.c:420
#, gcc-internal-format
msgid "argument of %qE attribute is not \"ilink1\" or \"ilink2\""
-msgstr ""
+msgstr "%qE 属性ã®å¼•æ•°ãŒ \"ilink1\" ã¾ãŸã¯ \"ilink2\" ã§ã¯ã‚ã‚Šã¾ã›ã‚“"
#: config/arm/arm.c:1320 config/sparc/sparc.c:862
#, gcc-internal-format
msgid "bad value (%s) for %s switch"
-msgstr "値 (%s) 㯠%s switch ã«ã¨ã£ã¦æ­£ã—ãã‚ã‚Šã¾ã›ã‚“"
+msgstr "é–“é•ã£ãŸå€¤ (%s) ㌠%s スイッãƒç”¨ã«æŒ‡å®šã•ã‚Œã¦ã„ã¾ã™"
#: config/arm/arm.c:1459
#, gcc-internal-format
msgid "switch -mcpu=%s conflicts with -march=%s switch"
-msgstr ""
+msgstr "-mcpu=%s スイッãƒãŒ -march=%s スイッãƒã¨ç«¶åˆã—ã¦ã„ã¾ã™"
#: config/arm/arm.c:1584
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "invalid __fp16 format option: -mfp16-format=%s"
-msgstr "無効㪠--param オプション: %s"
+msgstr "無効㪠__fp16 書å¼ã‚ªãƒ—ションã§ã™: -mfp16-format=%s"
#: config/arm/arm.c:1601
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "invalid ABI option: -mabi=%s"
-msgstr "無効ãªã‚ªãƒ—ション %s"
+msgstr "無効㪠ABI オプションã§ã™: -mabi=%s"
#: config/arm/arm.c:1609
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "target CPU does not support ARM mode"
-msgstr "ターゲット CPU 㯠APCS-32 をサãƒãƒ¼ãƒˆã—ã¾ã›ã‚“"
+msgstr "ターゲット CPU 㯠ARM モードをサãƒãƒ¼ãƒˆã—ã¦ã„ã¾ã›ã‚“"
#: config/arm/arm.c:1615
#, gcc-internal-format
msgid "target CPU does not support interworking"
-msgstr "ターゲット CPU 㯠interworking をサãƒãƒ¼ãƒˆã—ã¾ã›ã‚“"
+msgstr "ターゲット CPU 㯠ARM/Thumb 相互利用をサãƒãƒ¼ãƒˆã—ã¦ã„ã¾ã›ã‚“"
+# å…¬å¼ãªåå‰ã¯ Thumb ã§ã‚ã‚Š THUMB ã§ã¯ãªã„
#: config/arm/arm.c:1621
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "target CPU does not support THUMB instructions"
-msgstr "ターゲット CPU 㯠THUMB 命令をサãƒãƒ¼ãƒˆã—ã¾ã›ã‚“"
+msgstr "ターゲット CPU 㯠Thumb 命令をサãƒãƒ¼ãƒˆã—ã¦ã„ã¾ã›ã‚“"
#: config/arm/arm.c:1639
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "enabling backtrace support is only meaningful when compiling for the Thumb"
-msgstr "Thumb 用ã«ã‚³ãƒ³ãƒ‘イルã—ãŸã¨ãã®ã¿ã€æ„味ã®ã‚ã‚‹ãƒãƒƒã‚¯ãƒˆãƒ¬ãƒ¼ã‚¹ã‚’有効ã«ã—ã¾ã™"
+msgstr "ãƒãƒƒã‚¯ãƒˆãƒ¬ãƒ¼ã‚¹ã‚µãƒãƒ¼ãƒˆã®æœ‰åŠ¹åŒ–㯠Thumb 用ã«ã‚³ãƒ³ãƒ‘イルã—ãŸã¨ãã®ã¿æ„味ãŒã‚ã‚Šã¾ã™"
#: config/arm/arm.c:1642
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "enabling callee interworking support is only meaningful when compiling for the Thumb"
-msgstr "Thumb 用ã«ã‚³ãƒ³ãƒ‘イルã—ãŸã¨ãã®ã¿ã€è¢«å‘¼ã³å‡ºã—å´ interworking を有効ã«ã—ã¾ã™"
+msgstr "呼ã³å‡ºã—å…ˆ ARM/Thumb 相互利用有効化㯠Thumb 用ã«ã‚³ãƒ³ãƒ‘イルã—ãŸã¨ãã®ã¿æ„味ãŒã‚ã‚Šã¾ã™"
#: config/arm/arm.c:1646
#, gcc-internal-format
msgid "-mapcs-stack-check incompatible with -mno-apcs-frame"
-msgstr "-mapcs-stack-check 㯠-mno-apcs-frame ã¨å…±å­˜ã§ãã¾ã›ã‚“"
+msgstr "-mapcs-stack-check 㨠-mno-apcs-frame ã¯ä½µç”¨ã§ãã¾ã›ã‚“"
#: config/arm/arm.c:1654
#, gcc-internal-format
msgid "-fpic and -mapcs-reent are incompatible"
-msgstr "-fpic 㨠-mapcs-reent ã¯å…±å­˜ã§ãã¾ã›ã‚“"
+msgstr "-fpic 㨠-mapcs-reent ã¯ä½µç”¨ã§ãã¾ã›ã‚“"
#: config/arm/arm.c:1657
#, gcc-internal-format
msgid "APCS reentrant code not supported. Ignored"
-msgstr "APCS å†å…¥å¯èƒ½ã‚³ãƒ¼ãƒ‰ã¯ã‚µãƒãƒ¼ãƒˆã•ã‚Œã¾ã›ã‚“。無視ã•ã‚Œã¾ã—ãŸ"
+msgstr "APCS å†å…¥å¯èƒ½ã‚³ãƒ¼ãƒ‰ã¯ã‚µãƒãƒ¼ãƒˆã•ã‚Œã¦ã„ã¾ã›ã‚“。無視ã•ã‚Œã¾ã—ãŸ"
#: config/arm/arm.c:1665
#, gcc-internal-format
@@ -21254,94 +21253,94 @@ msgid "-g with -mno-apcs-frame may not give sensible debugging"
msgstr "-g ã« -mno-apcs-frame ã‚’ã¤ã‘ã‚‹ã¨ã€ãã‚ç´°ã‹ãªãƒ‡ãƒãƒƒã‚°ã¯ã§ããªã„ã§ã—ょã†"
#: config/arm/arm.c:1668
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "passing floating point arguments in fp regs not yet supported"
-msgstr "浮動å°æ•°ç‚¹å¼•æ•°ã‚’浮動å°æ•°ç‚¹ãƒ¬ã‚¸ã‚¹ã‚¿ã§æ¸¡ã™ã“ã¨ã¯ã€ã¾ã ã‚µãƒãƒ¼ãƒˆã•ã‚Œã¾ã›ã‚“"
+msgstr ""
#: config/arm/arm.c:1728
#, gcc-internal-format
msgid "iwmmxt requires an AAPCS compatible ABI for proper operation"
-msgstr ""
+msgstr "iwmmxt ã¯é©åˆ‡ãªæ“作用㫠AAPCS äº’æ› ABI ã‚’å¿…è¦ã¨ã—ã¾ã™"
#: config/arm/arm.c:1731
#, gcc-internal-format
msgid "iwmmxt abi requires an iwmmxt capable cpu"
-msgstr ""
+msgstr "iwmmxt ABI 㯠iwmmxt 機能ãŒã‚ã‚‹ CPU ã‚’å¿…è¦ã¨ã—ã¾ã™"
#: config/arm/arm.c:1740
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "invalid floating point emulation option: -mfpe=%s"
-msgstr "無効ãªæµ®å‹•å°æ•°ç‚¹ã‚¨ãƒŸãƒ¥ãƒ¬ãƒ¼ãƒˆã‚ªãƒ—ション: -mfpe-%s"
+msgstr "無効ãªæµ®å‹•å°æ•°ç‚¹ã‚¨ãƒŸãƒ¥ãƒ¬ãƒ¼ã‚·ãƒ§ãƒ³ã‚ªãƒ—ションã§ã™: -mfpe=%s"
#: config/arm/arm.c:1768
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "invalid floating point option: -mfpu=%s"
-msgstr "無効ãªæµ®å‹•å°æ•°ç‚¹ã‚¨ãƒŸãƒ¥ãƒ¬ãƒ¼ãƒˆã‚ªãƒ—ション: -mfpe-%s"
+msgstr "無効ãªæµ®å‹•å°æ•°ç‚¹ã‚ªãƒ—ションã§ã™: -mfpu=%s"
#: config/arm/arm.c:1807
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "invalid floating point abi: -mfloat-abi=%s"
-msgstr "無効ãªæµ®å‹•å°æ•°ç‚¹ã‚¨ãƒŸãƒ¥ãƒ¬ãƒ¼ãƒˆã‚ªãƒ—ション: -mfpe-%s"
+msgstr "無効ãªæµ®å‹•å°æ•°ç‚¹ ABI ã§ã™: -mfloat-abi=%s"
#: config/arm/arm.c:1815
#, gcc-internal-format
msgid "FPA is unsupported in the AAPCS"
-msgstr ""
+msgstr "FPA 㯠AAPCS 内ã§ã¯ã‚µãƒãƒ¼ãƒˆã•ã‚Œã¦ã„ã¾ã›ã‚“"
#: config/arm/arm.c:1820
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "AAPCS does not support -mcaller-super-interworking"
-msgstr "ターゲット CPU 㯠interworking をサãƒãƒ¼ãƒˆã—ã¾ã›ã‚“"
+msgstr "AAPCS 㯠-mcaller-super-interworking をサãƒãƒ¼ãƒˆã—ã¾ã›ã‚“"
#: config/arm/arm.c:1823
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "AAPCS does not support -mcallee-super-interworking"
-msgstr "ターゲット CPU 㯠interworking をサãƒãƒ¼ãƒˆã—ã¾ã›ã‚“"
+msgstr "AAPCS 㯠-mcallee-super-interworking をサãƒãƒ¼ãƒˆã—ã¾ã›ã‚“"
#: config/arm/arm.c:1830
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "iWMMXt and hardware floating point"
-msgstr "ãƒãƒ¼ãƒ‰ã‚¦ã‚§ã‚¢æµ®å‹•å°æ•°ç‚¹ã‚’利用ã™ã‚‹"
+msgstr "iWMMXt ãŠã‚ˆã³ãƒãƒ¼ãƒ‰ã‚¦ã‚§ã‚¢æµ®å‹•å°æ•°ç‚¹"
#: config/arm/arm.c:1834
#, gcc-internal-format
msgid "Thumb-2 iWMMXt"
-msgstr ""
+msgstr "Thumb-2 iWMMXt"
#: config/arm/arm.c:1838
#, gcc-internal-format
msgid "__fp16 and no ldrh"
-msgstr ""
+msgstr "__fp16 ã‹ã¤ ldrh ç„¡ã—"
#: config/arm/arm.c:1858
#, gcc-internal-format
msgid "-mfloat-abi=hard and VFP"
-msgstr ""
+msgstr "-mfloat-abi=hard ãŠã‚ˆã³ VFP"
#: config/arm/arm.c:1882
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "invalid thread pointer option: -mtp=%s"
-msgstr "無効ãªæµ®å‹•å°æ•°ç‚¹ã‚¨ãƒŸãƒ¥ãƒ¬ãƒ¼ãƒˆã‚ªãƒ—ション: -mfpe-%s"
+msgstr "無効ãªã‚¹ãƒ¬ãƒƒãƒ‰ãƒã‚¤ãƒ³ã‚¿ã‚ªãƒ—ションã§ã™: -mtp=%s"
#: config/arm/arm.c:1895
#, gcc-internal-format
msgid "can not use -mtp=cp15 with 16-bit Thumb"
-msgstr ""
+msgstr "-mtp=cp15 ã‚’ 16 ビット Thumb ã§ä½¿ç”¨ã§ãã¾ã›ã‚“"
#: config/arm/arm.c:1909
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "structure size boundary can only be set to %s"
-msgstr "構造体ã®ã‚µã‚¤ã‚ºå¢ƒç•Œã¯ 8 åˆã¯ 32 ã«ã—ã‹è¨­å®šã§ãã¾ã›ã‚“"
+msgstr "構造体サイズ境界㯠%s ã«ã®ã¿è¨­å®šã§ãã¾ã™"
#: config/arm/arm.c:1915
#, gcc-internal-format
msgid "RTP PIC is incompatible with Thumb"
-msgstr ""
+msgstr "RTP PIC 㯠Thumb ã§ã¯ä½¿ç”¨ã§ãã¾ã›ã‚“"
#: config/arm/arm.c:1924
#, gcc-internal-format
msgid "RTP PIC is incompatible with -msingle-pic-base"
-msgstr ""
+msgstr "RTP PIC 㯠-msingle-pic-base ã¨ä½µç”¨ã§ãã¾ã›ã‚“"
#: config/arm/arm.c:1936
#, gcc-internal-format
@@ -21349,14 +21348,14 @@ msgid "-mpic-register= is useless without -fpic"
msgstr "-mpic-register= 㯠-fpic ã‚’ã¤ã‘ãªã„ã¨å½¹ã«ç«‹ã¡ã¾ã›ã‚“"
#: config/arm/arm.c:1945
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "unable to use '%s' for PIC register"
-msgstr "'%s' ã‚’ PIC ã®ãƒ¬ã‚¸ã‚¹ã‚¿ã¨ã—ã¦ä½¿ã†ã“ã¨ãŒã§ãã¾ã›ã‚“"
+msgstr "PIC レジスタ用㫠'%s' を使用ã§ãã¾ã›ã‚“"
#: config/arm/arm.c:1984
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "-freorder-blocks-and-partition not supported on this architecture"
-msgstr "-fdata-sections ã¯ã“ã®ã‚¿ãƒ¼ã‚²ãƒƒãƒˆã§å—ã‘入れられã¾ã›ã‚“"
+msgstr "-freorder-blocks-and-partition ã¯ã“ã®ã‚¢ãƒ¼ã‚­ãƒ†ã‚¯ãƒãƒ£ä¸Šã§ã¯ã‚µãƒãƒ¼ãƒˆã•ã‚Œã¦ã„ã¾ã›ã‚“"
#: config/arm/arm.c:3851
#, gcc-internal-format
@@ -21376,7 +21375,7 @@ msgstr ""
#: config/arm/arm.c:4067
#, gcc-internal-format
msgid "Thumb-1 hard-float VFP ABI"
-msgstr ""
+msgstr "Thumb-1 ãƒãƒ¼ãƒ‰ã‚¦ã‚§ã‚¢æµ®å‹•å°æ•° VFP ABI"
#: config/arm/arm.c:4775 config/arm/arm.c:4793 config/avr/avr.c:4867
#: config/avr/avr.c:4883 config/bfin/bfin.c:5562 config/bfin/bfin.c:5623
@@ -21388,19 +21387,19 @@ msgstr ""
#: config/sh/sh.c:9002 config/sh/sh.c:9020 config/sh/sh.c:9049
#: config/sh/sh.c:9131 config/sh/sh.c:9154 config/spu/spu.c:3875
#: config/stormy16/stormy16.c:2222 config/v850/v850.c:2134
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "%qE attribute only applies to functions"
-msgstr "`%s' 属性ã¯é–¢æ•°ã«å¯¾ã—ã¦ã®ã¿é©ç”¨ã•ã‚Œã¾ã™"
+msgstr "%qE 属性ã¯é–¢æ•°ã¸ã®ã¿é©ç”¨ã•ã‚Œã¾ã™"
#: config/arm/arm.c:17651
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "unable to compute real location of stacked parameter"
-msgstr "スタックã«ç©ã¾ã‚ŒãŸä»®å¼•æ•°ã®å®Ÿéš›ã®é ˜åŸŸã‚’計算ã§ãã¾ã›ã‚“"
+msgstr "スタックã«ç©ã¾ã‚ŒãŸä»®å¼•æ•°ã®å®Ÿéš›ã®ä½ç½®ã‚’計算ã§ãã¾ã›ã‚“"
#: config/arm/arm.c:19233
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "argument must be a constant"
-msgstr "`asm' ã®å¼•æ•°ãŒå®šæ•°æ–‡å­—列ã§ã¯ã‚ã‚Šã¾ã›ã‚“ "
+msgstr "引数ã¯å®šæ•°ã§ãªã‘ã‚Œã°ã„ã‘ã¾ã›ã‚“"
#. @@@ better error message
#: config/arm/arm.c:19541 config/arm/arm.c:19578
@@ -21420,79 +21419,79 @@ msgid "no low registers available for popping high registers"
msgstr "高ä½ãƒ¬ã‚¸ã‚¹ã‚¿ã‚’ pop ã™ã‚‹ç‚ºã«ä½¿ç”¨ã§ãる低ä½ãƒ¬ã‚¸ã‚¹ã‚¿ãŒã‚ã‚Šã¾ã›ã‚“"
#: config/arm/arm.c:20622
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "interrupt Service Routines cannot be coded in Thumb mode"
-msgstr "Thumb モードã§ã¯å‰²ã‚Šè¾¼ã¿ã‚µãƒ¼ãƒ“スルーãƒãƒ³ã‚’コード化ã§ãã¾ã›ã‚“"
+msgstr "割り込ã¿ã‚µãƒ¼ãƒ“スルーãƒãƒ³ã‚’ Thumb モードã§ã‚³ãƒ¼ãƒ‰åŒ–ã™ã‚‹ã“ã¨ã¯ã§ãã¾ã›ã‚“"
#: config/arm/arm.c:22902
#, gcc-internal-format
msgid "the mangling of %<va_list%> has changed in GCC 4.4"
-msgstr ""
+msgstr "%<va_list%> ã®åå‰ç¬¦å·åŒ– (mangle) 方法㯠GCC 4.4 ã§å¤‰æ›´ã•ã‚Œã¾ã—ãŸ"
#: config/arm/pe.c:158 config/mcore/mcore.c:2978
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "initialized variable %q+D is marked dllimport"
-msgstr "åˆæœŸåŒ–ã•ã‚ŒãŸå¤‰æ•° `%s' 㯠dllimport マークã•ã‚Œã¦ã„ã¾ã™"
+msgstr "åˆæœŸåŒ–ã•ã‚ŒãŸå¤‰æ•° %q+D 㯠dllimport ã¨ãƒžãƒ¼ã‚¯ã•ã‚Œã¦ã„ã¾ã™"
#: config/arm/pe.c:167
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "static variable %q+D is marked dllimport"
-msgstr "é™çš„変数 `%s' 㯠dllimport ã¨ãƒžãƒ¼ã‚¯ã•ã‚Œã¦ã„ã¾ã™"
+msgstr "é™çš„変数 %q+D ㌠dllimport ã¨ãƒžãƒ¼ã‚¯ã•ã‚Œã¦ã„ã¾ã™"
#: config/avr/avr.c:449
#, gcc-internal-format
msgid "'builtin_return_address' contains only 2 bytes of address"
-msgstr ""
+msgstr "'builtin_return_address' ãŒã‚¢ãƒ‰ãƒ¬ã‚¹ã® 2 ãƒã‚¤ãƒˆã®ã¿å«ã‚“ã§ã„ã¾ã™"
#: config/avr/avr.c:1168
#, gcc-internal-format
msgid "pointer offset from symbol maybe incorrect"
-msgstr ""
+msgstr "シンボルã‹ã‚‰ã®ãƒã‚¤ãƒ³ã‚¿ã‚ªãƒ•ã‚»ãƒƒãƒˆãŒé–“é•ã£ã¦ã„るよã†ã§ã™"
#: config/avr/avr.c:1225
#, gcc-internal-format
msgid "accessing data memory with program memory address"
-msgstr ""
+msgstr "プログラムメモリアドレスã¨ã—ã¦ãƒ‡ãƒ¼ã‚¿ãƒ¡ãƒ¢ãƒªã‚’アクセスã—ã¦ã„ã¾ã™"
#: config/avr/avr.c:1265
#, gcc-internal-format
msgid "accessing program memory with data memory address"
-msgstr ""
+msgstr "データメモリアドレスã¨ã—ã¦ãƒ—ログラムメモリをアクセスã—ã¦ã„ã¾ã™"
#: config/avr/avr.c:4681
#, gcc-internal-format
msgid "%qs appears to be a misspelled interrupt handler"
-msgstr ""
+msgstr "%qs ã¯ç¶´ã‚ŠãŒé–“é•ã£ãŸå‰²ã‚Šè¾¼ã¿ãƒãƒ³ãƒ‰ãƒ©ã®ã‚ˆã†ã«è¦‹ãˆã¾ã™"
#: config/avr/avr.c:4690
#, gcc-internal-format
msgid "%qs appears to be a misspelled signal handler"
-msgstr ""
+msgstr "%qs ã¯ç¶´ã‚ŠãŒé–“é•ã£ãŸã‚·ã‚°ãƒŠãƒ«ãƒãƒ³ãƒ‰ãƒ©ã®ã‚ˆã†ã«è¦‹ãˆã¾ã™"
#: config/avr/avr.c:4840
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "only initialized variables can be placed into program memory area"
-msgstr "プログラムメモリ領域内ã«é…ç½®ã§ãる変数ã ã‘ã‚’åˆæœŸåŒ–ã—ã¾ã—ãŸ"
+msgstr "åˆæœŸåŒ–ã•ã‚ŒãŸå¤‰æ•°ã®ã¿ãƒ—ログラムメモリ領域内ã«é…ç½®ã§ãã¾ã™"
#: config/avr/avr.c:4974
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "only uninitialized variables can be placed in the .noinit section"
-msgstr "8 ビット領域内ã«é…ç½®ã§ãる変数ã ã‘ãŒåˆæœŸåŒ–ã•ã‚Œã¾ã—ãŸ"
+msgstr "åˆæœŸåŒ–ã•ã‚Œã¦ã„ãªã„変数ã®ã¿ .noinit セクション内ã«é…ç½®ã§ãã¾ã™"
#: config/avr/avr.c:4988
#, gcc-internal-format
msgid "MCU %qs supported for assembler only"
-msgstr ""
+msgstr "MCU %qs ã¯ã‚¢ã‚»ãƒ³ãƒ–ラã®ã¿ç”¨ã«ã‚µãƒãƒ¼ãƒˆã•ã‚Œã¦ã„ã¾ã™"
#: config/bfin/bfin.c:2567 config/m68k/m68k.c:544
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "-mshared-library-id=%s is not between 0 and %d"
-msgstr "-mregparm=%d ㌠0 ã‹ã‚‰ %d ã®é–“ã§ã¯ã‚ã‚Šã¾ã›ã‚“"
+msgstr "-mshared-library-id=%s ㌠0 ã‹ã‚‰ %d ã®é–“ã§ã¯ã‚ã‚Šã¾ã›ã‚“"
#: config/bfin/bfin.c:2587
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "-mcpu=%s is not valid"
-msgstr "-mcpu=%s 㯠-mips%d をサãƒãƒ¼ãƒˆã—ã¾ã›ã‚“"
+msgstr "-mcpu=%s ãŒç„¡åŠ¹ã§ã™"
#: config/bfin/bfin.c:2623
#, gcc-internal-format
@@ -21502,12 +21501,12 @@ msgstr ""
#: config/bfin/bfin.c:2684
#, gcc-internal-format
msgid "-mshared-library-id= specified without -mid-shared-library"
-msgstr ""
+msgstr "-mshared-library-id= ㌠-mid-shared-library ç„¡ã—ã§æŒ‡å®šã•ã‚Œã¾ã—ãŸ"
#: config/bfin/bfin.c:2687
#, gcc-internal-format
msgid "can%'t use multiple stack checking methods together"
-msgstr ""
+msgstr "複数ã®ã‚¹ã‚¿ãƒƒã‚¯æ¤œæŸ»æ–¹æ³•ã¯ä½µç”¨ã§ãã¾ã›ã‚“"
#: config/bfin/bfin.c:2690
#, gcc-internal-format
@@ -21515,50 +21514,50 @@ msgid "ID shared libraries and FD-PIC mode can%'t be used together"
msgstr ""
#: config/bfin/bfin.c:2695 config/m68k/m68k.c:645
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "cannot specify both -msep-data and -mid-shared-library"
-msgstr "-C 㨠-o ã¯ä¸¡æ–¹ã‚’一緒ã«æŒ‡å®šã§ãã¾ã›ã‚“"
+msgstr "-msep-data 㨠-mid-shared-library ã¯ä½µç”¨ã§ãã¾ã›ã‚“"
#: config/bfin/bfin.c:2715
#, gcc-internal-format
msgid "-mmulticore can only be used with BF561"
-msgstr ""
+msgstr "-mmulticore 㯠BF561 ã§ã®ã¿ä½¿ç”¨ã§ãã¾ã™"
#: config/bfin/bfin.c:2718
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "-mcorea should be used with -mmulticore"
-msgstr "-frepo 㯠-c 付ãã§ãªã‘ã‚Œã°ãªã‚Šã¾ã›ã‚“"
+msgstr "-mcorea 㯠-mmulticore ã¨ä½µã›ã¦ä½¿ç”¨ã™ã‚‹ã¹ãã§ã™"
#: config/bfin/bfin.c:2721
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "-mcoreb should be used with -mmulticore"
-msgstr "-frepo 㯠-c 付ãã§ãªã‘ã‚Œã°ãªã‚Šã¾ã›ã‚“"
+msgstr "-mcoreb 㯠-mmulticore ã¨ä½µã›ã¦ä½¿ç”¨ã™ã‚‹ã¹ãã§ã™"
#: config/bfin/bfin.c:2724
#, gcc-internal-format
msgid "-mcorea and -mcoreb can%'t be used together"
-msgstr ""
+msgstr "-mcorea 㨠-mcoreb ã¯ä½µç”¨ã§ãã¾ã›ã‚“"
#: config/bfin/bfin.c:5567
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "multiple function type attributes specified"
-msgstr "é‡è¤‡ã™ã‚‹ã‚¢ã‚¯ã‚»ã‚¹æŒ‡å®šå­"
+msgstr "複数ã®é–¢æ•°åž‹å±žæ€§ãŒæŒ‡å®šã•ã‚Œã¦ã„ã¾ã™"
#: config/bfin/bfin.c:5634
#, gcc-internal-format
msgid "can%'t apply both longcall and shortcall attributes to the same function"
-msgstr ""
+msgstr "åŒä¸€ã®é–¢æ•°ã« longcall 㨠shortcall 属性を両方é©ç”¨ã™ã‚‹ã“ã¨ã¯å‡ºæ¥ã¾ã›ã‚“"
#: config/bfin/bfin.c:5684 config/i386/winnt.c:61 config/mep/mep.c:3880
#: config/mep/mep.c:4018
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "%qE attribute only applies to variables"
-msgstr "`%s' 属性ã¯åž‹ã«ã¯é©ç”¨ã•ã‚Œã¾ã›ã‚“"
+msgstr "%qE ã¯å¤‰æ•°ã«ã®ã¿é©ç”¨ã§ãã¾ã™"
#: config/bfin/bfin.c:5691
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "%qE attribute cannot be specified for local variables"
-msgstr "section 属性ã¯ãƒ­ãƒ¼ã‚«ãƒ«å¤‰æ•°ã«å¯¾ã—ã¦ã¯æŒ‡å®šã§ãã¾ã›ã‚“"
+msgstr "%qE 属性ã¯å±€æ‰€å¤‰æ•°ç”¨ã«ã¯æŒ‡å®šã§ãã¾ã›ã‚“"
#. This function is for retrieving a part of an instruction name for
#. an operator, for immediate output. If that ever happens for
@@ -21570,14 +21569,14 @@ msgid "MULT case in cris_op_str"
msgstr ""
#: config/cris/cris.c:857
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "invalid use of ':' modifier"
-msgstr "void å¼ã®ä¸é©åˆ‡ãªä½¿ç”¨"
+msgstr "':' 修飾å­ã®ç„¡åŠ¹ãªä½¿ç”¨æ–¹æ³•ã§ã™"
#: config/cris/cris.c:1044 config/moxie/moxie.c:189
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "internal error: bad register: %d"
-msgstr "内部エラー: "
+msgstr "内部エラー: é–“é•ã£ãŸãƒ¬ã‚¸ã‚¹ã‚¿ã§ã™: %d"
#: config/cris/cris.c:1632
#, gcc-internal-format
@@ -21587,33 +21586,33 @@ msgstr ""
#: config/cris/cris.c:1729
#, gcc-internal-format
msgid "unknown cc_attr value"
-msgstr ""
+msgstr "ä¸æ˜Žãª cc_attr 値ã§ã™"
#. If we get here, the caller got its initial tests wrong.
#: config/cris/cris.c:2114
#, gcc-internal-format
msgid "internal error: cris_side_effect_mode_ok with bad operands"
-msgstr ""
+msgstr "内部エラー: é–“é•ã£ãŸè¢«æ¼”ç®—å­ã‚’æŒã¤ cris_side_effect_mode_ok ã§ã™"
#: config/cris/cris.c:2406
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "-max-stackframe=%d is not usable, not between 0 and %d"
-msgstr "-mregparm=%d ㌠0 ã‹ã‚‰ %d ã®é–“ã§ã¯ã‚ã‚Šã¾ã›ã‚“"
+msgstr "-max-stackframe=%d ãŒä½¿ç”¨ã§ãã¾ã›ã‚“。 0 㨠%d ã®é–“ã§ã¯ã‚ã‚Šã¾ã›ã‚“"
#: config/cris/cris.c:2434
#, gcc-internal-format
msgid "unknown CRIS version specification in -march= or -mcpu= : %s"
-msgstr ""
+msgstr "-march= ã¾ãŸã¯ -mcpu= 内ã§ä¸æ˜Žãª CRIS ãƒãƒ¼ã‚¸ãƒ§ãƒ³æŒ‡å®šãŒã‚ã‚Šã¾ã™: %s"
#: config/cris/cris.c:2470
#, gcc-internal-format
msgid "unknown CRIS cpu version specification in -mtune= : %s"
-msgstr ""
+msgstr "-mtune= 内ã«ä¸æ˜Žãª CRIS CPU ãƒãƒ¼ã‚¸ãƒ§ãƒ³æŒ‡å®šãŒã‚ã‚Šã¾ã™: %s"
#: config/cris/cris.c:2491
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "-fPIC and -fpic are not supported in this configuration"
-msgstr "%s ã¯ã“ã®ã‚³ãƒ³ãƒ•ã‚£ã‚®ãƒ¥ãƒ¬ãƒ¼ã‚·ãƒ§ãƒ³ã§ã¯ã‚µãƒãƒ¼ãƒˆã•ã‚Œã¾ã›ã‚“"
+msgstr "-fPIC ãŠã‚ˆã³ -fpic ã¯ã“ã®è¨­å®šã§ã¯ã‚µãƒãƒ¼ãƒˆã•ã‚Œã¦ã„ã¾ã›ã‚“"
#: config/cris/cris.c:2506
#, gcc-internal-format
@@ -21633,17 +21632,17 @@ msgstr ""
#: config/cris/cris.c:3078
#, gcc-internal-format
msgid "stackframe too big: %d bytes"
-msgstr ""
+msgstr "スタックフレームãŒå¤§ãã™ãŽã¾ã™: %d ãƒã‚¤ãƒˆ"
#: config/cris/cris.c:3570 config/cris/cris.c:3598
#, gcc-internal-format
msgid "expand_binop failed in movsi got"
-msgstr ""
+msgstr "movsi got 内㧠expand_binop ã«å¤±æ•—ã—ã¾ã—ãŸ"
#: config/cris/cris.c:3680
#, gcc-internal-format
msgid "emitting PIC operand, but PIC register isn%'t set up"
-msgstr ""
+msgstr "PIC 被演算å­ã‚’発行ã—ã¦ã„ã¾ã™ãŒã€ PIC レジスタãŒè¨­å®šã•ã‚Œã¦ã„ã¾ã›ã‚“"
#. Definitions for GCC. Part of the machine description for CRIS.
#. Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008,
@@ -21697,17 +21696,17 @@ msgstr ""
#: config/cris/cris.h:881
#, gcc-internal-format
msgid "no FUNCTION_PROFILER for CRIS"
-msgstr ""
+msgstr "CRIS 用㮠FUNCTION_PROFILER ãŒã‚ã‚Šã¾ã›ã‚“"
#: config/crx/crx.h:342
#, gcc-internal-format
msgid "profiler support for CRX"
-msgstr ""
+msgstr "CRX 用ã®ãƒ—ロファイルサãƒãƒ¼ãƒˆ"
#: config/frv/frv.c:8753
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "accumulator is not a constant integer"
-msgstr "`asm' ã®å¼•æ•°ãŒå®šæ•°æ–‡å­—列ã§ã¯ã‚ã‚Šã¾ã›ã‚“ "
+msgstr ""
#: config/frv/frv.c:8758
#, gcc-internal-format
@@ -21720,84 +21719,84 @@ msgid "inappropriate accumulator for %qs"
msgstr ""
#: config/frv/frv.c:8845
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "invalid IACC argument"
-msgstr "無効ãªåž‹å¼•æ•°ã§ã™"
+msgstr "無効㪠IACC 引数ã§ã™"
#: config/frv/frv.c:8868
#, gcc-internal-format
msgid "%qs expects a constant argument"
-msgstr ""
+msgstr "%qs ã«ã¯å®šæ•°å¼•æ•°ãŒäºˆæœŸã•ã‚Œã¾ã™"
#: config/frv/frv.c:8873
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "constant argument out of range for %qs"
-msgstr "演算å­ç•ªå·ãŒãƒ•ã‚©ãƒ¼ãƒžãƒƒãƒˆã®ç¯„囲外ã§ã™"
+msgstr "%qs 用ã®å®šæ•°å¼•æ•°ãŒç¯„囲外ã§ã™"
#: config/frv/frv.c:9354
#, gcc-internal-format
msgid "media functions are not available unless -mmedia is used"
-msgstr ""
+msgstr "メディア関数㯠-mmedia ãŒä½¿ç”¨ã•ã‚Œãªã„é™ã‚Šåˆ©ç”¨ã§ãã¾ã›ã‚“"
#: config/frv/frv.c:9366
#, gcc-internal-format
msgid "this media function is only available on the fr500"
-msgstr ""
+msgstr "ã“ã®ãƒ¡ãƒ‡ã‚£ã‚¢é–¢æ•°ã¯ fr500 上ã§ã®ã¿åˆ©ç”¨ã§ãã¾ã™"
#: config/frv/frv.c:9394
#, gcc-internal-format
msgid "this media function is only available on the fr400 and fr550"
-msgstr ""
+msgstr "ã“ã®ãƒ¡ãƒ‡ã‚£ã‚¢é–¢æ•°ã¯ fr400 㨠fr550 上ã§ã®ã¿åˆ©ç”¨ã§ãã¾ã™"
#: config/frv/frv.c:9413
#, gcc-internal-format
msgid "this builtin function is only available on the fr405 and fr450"
-msgstr ""
+msgstr "ã“ã®çµ„ã¿è¾¼ã¿é–¢æ•°ã¯ fr405 㨠fr450 上ã§ã®ã¿åˆ©ç”¨ã§ãã¾ã™"
#: config/frv/frv.c:9422
#, gcc-internal-format
msgid "this builtin function is only available on the fr500 and fr550"
-msgstr ""
+msgstr "ã“ã®çµ„ã¿è¾¼ã¿é–¢æ•°ã¯ fr500 㨠fr550 上ã§ã®ã¿åˆ©ç”¨ã§ãã¾ã™"
#: config/frv/frv.c:9434
#, gcc-internal-format
msgid "this builtin function is only available on the fr450"
-msgstr ""
+msgstr "ã“ã®çµ„ã¿è¾¼ã¿é–¢æ•°ã¯ fr450 上ã§ã®ã¿åˆ©ç”¨ã§ãã¾ã™"
#: config/h8300/h8300.c:343
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "-ms2600 is used without -ms"
-msgstr "-ms2600 ㌠-ms ãªã—ã§ä½¿ã‚ã‚Œã¾ã—ãŸ"
+msgstr "-ms2600 ㌠-ms ç„¡ã—ã§ä½¿ç”¨ã•ã‚Œã¦ã„ã¾ã™"
#: config/h8300/h8300.c:349
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "-mn is used without -mh or -ms"
-msgstr "-ms2600 ㌠-ms ãªã—ã§ä½¿ã‚ã‚Œã¾ã—ãŸ"
+msgstr "-mn ㌠-mh ã¾ãŸã¯ -ms ç„¡ã—ã§ä½¿ç”¨ã•ã‚Œã¦ã„ã¾ã™"
#: config/i386/host-cygwin.c:62
#, gcc-internal-format
msgid "can%'t extend PCH file: %m"
-msgstr ""
+msgstr "PCH ファイルを拡張ã§ãã¾ã›ã‚“: %m"
#: config/i386/host-cygwin.c:73
#, gcc-internal-format
msgid "can%'t set position in PCH file: %m"
-msgstr ""
+msgstr "PCH ファイル内ã§ä½ç½®ã‚’設定ã§ãã¾ã›ã‚“: %m"
#: config/i386/i386.c:3357 config/i386/i386.c:3646
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "bad value (%s) for %stune=%s %s"
-msgstr "値 (%s) 㯠%s switch ã«ã¨ã£ã¦æ­£ã—ãã‚ã‚Šã¾ã›ã‚“"
+msgstr ""
#: config/i386/i386.c:3360
#, gcc-internal-format
msgid "%stune=x86-64%s is deprecated; use %stune=k8%s or %stune=generic%s instead as appropriate"
-msgstr ""
+msgstr "%stune=x86-64%s ã¯å»ƒæ­¢ã•ã‚Œã¾ã—ãŸã€‚代ã‚ã‚Šã« %stune=k8%s ã¾ãŸã¯ %stune=generic%s ã®é©åˆ‡ãªæ–¹ã‚’使用ã—ã¦ãã ã•ã„"
#: config/i386/i386.c:3406
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "bad value (%s) for %sstringop-strategy=%s %s"
-msgstr "値 (%s) 㯠%s switch ã«ã¨ã£ã¦æ­£ã—ãã‚ã‚Šã¾ã›ã‚“"
+msgstr ""
#: config/i386/i386.c:3423
#, gcc-internal-format
@@ -21805,34 +21804,34 @@ msgid "unknown ABI (%s) for %sabi=%s %s"
msgstr ""
#: config/i386/i386.c:3438
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "code model %s does not support PIC mode"
-msgstr "%s 㯠%s ã‚’å—ã‘付ã‘ã¾ã›ã‚“"
+msgstr "コードモデル %s 㯠PIC モードをサãƒãƒ¼ãƒˆã—ã¾ã›ã‚“"
#: config/i386/i386.c:3444
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "bad value (%s) for %scmodel=%s %s"
-msgstr "-mcmodel= スイッãƒã«ã¨ã£ã¦ä¸æ­£ãªå€¤ (%s)"
+msgstr ""
#: config/i386/i386.c:3468
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "bad value (%s) for %sasm=%s %s"
-msgstr "値 (%s) 㯠%s switch ã«ã¨ã£ã¦æ­£ã—ãã‚ã‚Šã¾ã›ã‚“"
+msgstr ""
#: config/i386/i386.c:3472
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "code model %qs not supported in the %s bit mode"
-msgstr "-mcmodel= 㯠32 bit システム上ã§ã¯ã‚µãƒãƒ¼ãƒˆã•ã‚Œã¾ã›ã‚“"
+msgstr "コードモデル %qs 㯠%s ビットモード内ã§ã¯ã‚µãƒãƒ¼ãƒˆã•ã‚Œã¾ã›ã‚“"
#: config/i386/i386.c:3475
#, gcc-internal-format
msgid "%i-bit mode not compiled in"
-msgstr ""
+msgstr "%i ビットモードãŒä½¿ç”¨ã§ãるよã†ã«ã‚³ãƒ³ãƒ‘イルã•ã‚Œã¦ã„ã¾ã›ã‚“"
#: config/i386/i386.c:3487 config/i386/i386.c:3608
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "CPU you selected does not support x86-64 instruction set"
-msgstr "ターゲット CPU 㯠THUMB 命令をサãƒãƒ¼ãƒˆã—ã¾ã›ã‚“"
+msgstr "é¸æŠžã—㟠CPU 㯠x86-64 命令セットをサãƒãƒ¼ãƒˆã—ã¦ã„ã¾ã›ã‚“"
#: config/i386/i386.c:3578
#, gcc-internal-format
@@ -21840,99 +21839,99 @@ msgid "generic CPU can be used only for %stune=%s %s"
msgstr ""
#: config/i386/i386.c:3581
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "bad value (%s) for %sarch=%s %s"
-msgstr "-march= スイッãƒã«å¯¾ã™ã‚‹ä¸æ­£ãªå€¤ (%s)"
+msgstr ""
#: config/i386/i386.c:3696
#, gcc-internal-format
msgid "%sregparm%s is ignored in 64-bit mode"
-msgstr ""
+msgstr "%sregparm%s 㯠64 ビットモードã§ã¯ç„¡è¦–ã•ã‚Œã¾ã™"
#: config/i386/i386.c:3699
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "%sregparm=%d%s is not between 0 and %d"
-msgstr "-mregparm=%d ㌠0 ã‹ã‚‰ %d ã®é–“ã§ã¯ã‚ã‚Šã¾ã›ã‚“"
+msgstr "%sregparm=%d%s ㌠0 㨠%d ã®é–“ã§ã¯ã‚ã‚Šã¾ã›ã‚“"
#: config/i386/i386.c:3712
#, gcc-internal-format
msgid "%salign-loops%s is obsolete, use -falign-loops%s"
-msgstr ""
+msgstr "%salign-loops%s ã¯å»ƒæ­¢äºˆå®šã§ã™ã€‚-falign-loops%s を使用ã—ã¦ãã ã•ã„"
#: config/i386/i386.c:3718 config/i386/i386.c:3733 config/i386/i386.c:3748
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "%salign-loops=%d%s is not between 0 and %d"
-msgstr "-malign-loops=%d ㌠0 ã‹ã‚‰ %d ã®é–“ã§ã¯ã‚ã‚Šã¾ã›ã‚“"
+msgstr "%salign-loops=%d%s ㌠0 㨠%d ã®é–“ã§ã¯ã‚ã‚Šã¾ã›ã‚“"
#: config/i386/i386.c:3727
#, gcc-internal-format
msgid "%salign-jumps%s is obsolete, use -falign-jumps%s"
-msgstr ""
+msgstr "%salign-jumps%s ã¯å»ƒæ­¢äºˆå®šã§ã™ã€‚-falign-jumps%s を使用ã—ã¦ãã ã•ã„"
#: config/i386/i386.c:3742
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "%salign-functions%s is obsolete, use -falign-functions%s"
-msgstr "-malign-functions=%d ㌠0 ã‹ã‚‰ %d ã®é–“ã§ã¯ã‚ã‚Šã¾ã›ã‚“"
+msgstr "%salign-functions%s ã¯å»ƒæ­¢äºˆå®šã§ã™ã€‚-falign-functions%s を使用ã—ã¦ãã ã•ã„"
#: config/i386/i386.c:3777
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "%sbranch-cost=%d%s is not between 0 and 5"
-msgstr "-mbranch-cost=%d ㌠0 ã‹ã‚‰ 5 ã®é–“ã§ã¯ã‚ã‚Šã¾ã›ã‚“"
+msgstr "%sbranch-cost=%d%s ㌠0 㨠5 ã®é–“ã§ã¯ã‚ã‚Šã¾ã›ã‚“"
#: config/i386/i386.c:3785
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "%slarge-data-threshold=%d%s is negative"
-msgstr "%s ローテート回数ãŒè² ã®å€¤ã§ã™"
+msgstr "%slarge-data-threshold=%d%s ãŒè² ã§ã™"
#: config/i386/i386.c:3797
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "bad value (%s) for %stls-dialect=%s %s"
-msgstr "値 (%s) 㯠%s switch ã«ã¨ã£ã¦æ­£ã—ãã‚ã‚Šã¾ã›ã‚“"
+msgstr ""
#: config/i386/i386.c:3805
#, gcc-internal-format
msgid "pc%d is not valid precision setting (32, 64 or 80)"
-msgstr ""
+msgstr "pc%d ã¯æœ‰åŠ¹ãªç²¾åº¦è¨­å®š (32ã€64 ã¾ãŸã¯ 80) ã§ã¯ã‚ã‚Šã¾ã›ã‚“"
#: config/i386/i386.c:3821
#, gcc-internal-format
msgid "%srtd%s is ignored in 64bit mode"
-msgstr ""
+msgstr "%srtd%s 㯠64 ビットモードã§ã¯ç„¡è¦–ã•ã‚Œã¾ã™"
#: config/i386/i386.c:3881
#, gcc-internal-format
msgid "%spreferred-stack-boundary%s is not supported for this target"
-msgstr ""
+msgstr "%spreferred-stack-boundary%s ã¯ã“ã®ã‚¿ãƒ¼ã‚²ãƒƒãƒˆã§ã¯ã‚µãƒãƒ¼ãƒˆã•ã‚Œã¦ã„ã¾ã›ã‚“"
#: config/i386/i386.c:3884
#, gcc-internal-format
msgid "%spreferred-stack-boundary=%d%s is not between %d and %d"
-msgstr ""
+msgstr "%spreferred-stack-boundary=%d%s ㌠%d 㨠%d ã®é–“ã§ã¯ã‚ã‚Šã¾ã›ã‚“"
#: config/i386/i386.c:3904
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "-mincoming-stack-boundary=%d is not between %d and 12"
-msgstr "-mpreferred-stack-boundary=%d ㌠2 ã‹ã‚‰ 31 ã®é–“ã§ã¯ã‚ã‚Šã¾ã›ã‚“"
+msgstr "-mincoming-stack-boundary=%d ㌠%d 㨠12 ã®é–“ã§ã¯ã‚ã‚Šã¾ã›ã‚“"
#: config/i386/i386.c:3917
#, gcc-internal-format
msgid "%ssseregparm%s used without SSE enabled"
-msgstr ""
+msgstr "%ssseregparm%s ㌠SSE ãŒæœ‰åŠ¹ã§ã¯ãªã„状態ã§ä½¿ç”¨ã•ã‚Œã¦ã„ã¾ã™"
#: config/i386/i386.c:3928 config/i386/i386.c:3942
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "SSE instruction set disabled, using 387 arithmetics"
-msgstr "関数ãƒã‚¤ãƒ³ã‚¿ãŒè¨ˆç®—ã§ä½¿ã‚ã‚Œã¾ã—ãŸ"
+msgstr "SSE 命令セットãŒç„¡åŠ¹ã«ãªã£ã¦ã„ã¾ã™ã€‚ 387 数値演算を使用ã—ã¾ã™"
#: config/i386/i386.c:3947
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "387 instruction set disabled, using SSE arithmetics"
-msgstr "関数ãƒã‚¤ãƒ³ã‚¿ãŒè¨ˆç®—ã§ä½¿ã‚ã‚Œã¾ã—ãŸ"
+msgstr "387 命令セットãŒç„¡åŠ¹ã«ãªã£ã¦ã„ã¾ã™ã€‚SSE 数値演算を使用ã—ã¾ã™"
#: config/i386/i386.c:3954
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "bad value (%s) for %sfpmath=%s %s"
-msgstr "-march= スイッãƒã«å¯¾ã™ã‚‹ä¸æ­£ãªå€¤ (%s)"
+msgstr ""
#: config/i386/i386.c:3970
#, gcc-internal-format
@@ -21957,92 +21956,92 @@ msgstr ""
#: config/i386/i386.c:4097
#, gcc-internal-format
msgid "-mno-fentry isn%'t compatible with SEH"
-msgstr ""
+msgstr "-mno-fentry 㯠SEH ã¨äº’æ›æ€§ãŒã‚ã‚Šã¾ã›ã‚“"
#: config/i386/i386.c:4511
#, gcc-internal-format
msgid "attribute(target(\"%s\")) is unknown"
-msgstr ""
+msgstr "attribute(target(\"%s\")) ãŒä¸æ˜Žã§ã™"
#: config/i386/i386.c:4533
#, gcc-internal-format
msgid "option(\"%s\") was already specified"
-msgstr ""
+msgstr "option(\"%s\") ã¯æ—¢ã«æŒ‡å®šã•ã‚Œã¦ã„ã¾ã™"
#: config/i386/i386.c:5147 config/i386/i386.c:5198
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "fastcall and regparm attributes are not compatible"
-msgstr "shared 㨠mdll ã¨ã¯å…±å­˜ã§ãã¾ã›ã‚“"
+msgstr "fastcall 㨠regparm 属性ã¯ä½µç”¨ã§ãã¾ã›ã‚“"
#: config/i386/i386.c:5152
#, gcc-internal-format
msgid "regparam and thiscall attributes are not compatible"
-msgstr ""
+msgstr "regparam 㨠thiscall 属性ã¯ä½µç”¨ã§ãã¾ã›ã‚“"
#: config/i386/i386.c:5159 config/i386/i386.c:29109
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "%qE attribute requires an integer constant argument"
-msgstr "3 ã¤ã® 'l' 接尾辞ãŒæ•´æ•°å®šæ•°ã«ã¤ã„ã¦ã„ã¾ã™"
+msgstr "%qE 属性ã«ã¯æ•´æ•°å®šæ•°å¼•æ•°ãŒå¿…è¦ã§ã™"
#: config/i386/i386.c:5165
#, gcc-internal-format
msgid "argument to %qE attribute larger than %d"
-msgstr ""
+msgstr "%qE 属性ã¸ã®å¼•æ•°ãŒ %d より大ãã„ã§ã™"
#: config/i386/i386.c:5190 config/i386/i386.c:5233
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "fastcall and cdecl attributes are not compatible"
-msgstr "shared 㨠mdll ã¨ã¯å…±å­˜ã§ãã¾ã›ã‚“"
+msgstr "fastcall 㨠cdecl 属性ã¯ä½µç”¨ã§ãã¾ã›ã‚“"
#: config/i386/i386.c:5194
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "fastcall and stdcall attributes are not compatible"
-msgstr "shared 㨠mdll ã¨ã¯å…±å­˜ã§ãã¾ã›ã‚“"
+msgstr "fastcall 㨠stdcall 属性ã¯ä½µç”¨ã§ãã¾ã›ã‚“"
#: config/i386/i386.c:5202 config/i386/i386.c:5251
#, gcc-internal-format
msgid "fastcall and thiscall attributes are not compatible"
-msgstr ""
+msgstr "fastcall 㨠thiscall 属性ã¯ä½µç”¨ã§ãã¾ã›ã‚“"
#: config/i386/i386.c:5212 config/i386/i386.c:5229
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "stdcall and cdecl attributes are not compatible"
-msgstr "shared 㨠mdll ã¨ã¯å…±å­˜ã§ãã¾ã›ã‚“"
+msgstr "stdcall 㨠cdecl 属性ã¯ä½µç”¨ã§ãã¾ã›ã‚“"
#: config/i386/i386.c:5216
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "stdcall and fastcall attributes are not compatible"
-msgstr "shared 㨠mdll ã¨ã¯å…±å­˜ã§ãã¾ã›ã‚“"
+msgstr "stdcall 㨠fastcall 属性ã¯ä½µç”¨ã§ãã¾ã›ã‚“"
#: config/i386/i386.c:5220 config/i386/i386.c:5247
#, gcc-internal-format
msgid "stdcall and thiscall attributes are not compatible"
-msgstr ""
+msgstr "stdcall 㨠thiscall 属性ã¯ä½µç”¨ã§ãã¾ã›ã‚“"
#: config/i386/i386.c:5237 config/i386/i386.c:5255
#, gcc-internal-format
msgid "cdecl and thiscall attributes are not compatible"
-msgstr ""
+msgstr "cdecl 㨠thiscall 属性ã¯ä½µç”¨ã§ãã¾ã›ã‚“"
#: config/i386/i386.c:5243
#, gcc-internal-format
msgid "%qE attribute is used for none class-method"
-msgstr ""
+msgstr "%qE 属性ãŒéžã‚¯ãƒ©ã‚¹ãƒ¡ã‚½ãƒƒãƒ‰ç”¨ã«ä½¿ç”¨ã•ã‚Œã¦ã„ã¾ã™"
#: config/i386/i386.c:5397
#, gcc-internal-format
msgid "calling %qD with attribute sseregparm without SSE/SSE2 enabled"
-msgstr ""
+msgstr "SSE/SSE2 ãŒæœ‰åŠ¹ã§ãªã„状態㧠sseregparm 属性付ãã® %qD を呼ã³å‡ºã—ã¦ã„ã¾ã™"
#: config/i386/i386.c:5400
#, gcc-internal-format
msgid "calling %qT with attribute sseregparm without SSE/SSE2 enabled"
-msgstr ""
+msgstr "SSE/SSE2 ãŒæœ‰åŠ¹ã§ãªã„状態㧠sseregparm 属性付ãã® %qT を呼ã³å‡ºã—ã¦ã„ã¾ã™<"
#: config/i386/i386.c:5617
#, gcc-internal-format
msgid "ms_hook_prologue is not compatible with nested function"
-msgstr ""
+msgstr "ms_hook_prologue ã¯å…¥ã‚Œå­ã«ãªã£ãŸé–¢æ•°ã¨ä¸¡ç«‹ã§ãã¾ã›ã‚“"
#: config/i386/i386.c:5769
#, gcc-internal-format
@@ -22057,72 +22056,72 @@ msgstr ""
#: config/i386/i386.c:6074
#, gcc-internal-format
msgid "the ABI of passing struct with a flexible array member has changed in GCC 4.4"
-msgstr ""
+msgstr "å¯å¤‰é•·é…列メンãƒã‚’æŒã¤æ§‹é€ ä½“を渡㙠ABI 㯠GCC 4.4 ã§å¤‰æ›´ã«ãªã£ã¦ã„ã¾ã™"
#: config/i386/i386.c:6190
#, gcc-internal-format
msgid "the ABI of passing union with long double has changed in GCC 4.4"
-msgstr ""
+msgstr "long double ã‚’æŒã¤å…±ç”¨ä½“を渡㙠ABI 㯠GCC 4.4 ã§å¤‰æ›´ã«ãªã£ã¦ã„ã¾ã™"
#: config/i386/i386.c:6305
#, gcc-internal-format
msgid "the ABI of passing structure with complex float member has changed in GCC 4.4"
-msgstr ""
+msgstr "複素浮動å°æ•°ãƒ¡ãƒ³ãƒã‚’æŒã¤æ§‹é€ ä½“を渡㙠ABI 㯠GCC 4.4 ã§å¤‰æ›´ã«ãªã£ã¦ã„ã¾ã™"
#: config/i386/i386.c:6451
#, gcc-internal-format
msgid "SSE register return with SSE disabled"
-msgstr ""
+msgstr "SSE ãŒç„¡åŠ¹ã®çŠ¶æ…‹ã§ SSE レジスタを戻ã—㦠(return) ã„ã¾ã™"
#: config/i386/i386.c:6457
#, gcc-internal-format
msgid "SSE register argument with SSE disabled"
-msgstr ""
+msgstr "SSE ãŒç„¡åŠ¹ã®çŠ¶æ…‹ã§ SSE レジスタ引数ãŒã‚ã‚Šã¾ã™"
#: config/i386/i386.c:6473
#, gcc-internal-format
msgid "x87 register return with x87 disabled"
-msgstr ""
+msgstr "x87 ãŒç„¡åŠ¹ãªçŠ¶æ…‹ã§ x87 レジスタを戻ã—㦠(return) ã„ã¾ã™"
#: config/i386/i386.c:6851
#, gcc-internal-format
msgid "SSE vector argument without SSE enabled changes the ABI"
-msgstr ""
+msgstr "SSE ãŒæœ‰åŠ¹ã§ãªã„状態ã§ã® SSE ベクトル引数㯠ABI を変更ã—ã¾ã™"
#: config/i386/i386.c:6889
#, gcc-internal-format
msgid "MMX vector argument without MMX enabled changes the ABI"
-msgstr ""
+msgstr "MMX ãŒæœ‰åŠ¹ã§ãªã„状態ã§ã® MMX ベクトル引数㯠ABI を変更ã—ã¾ã™"
#: config/i386/i386.c:7261
#, gcc-internal-format
msgid "The ABI for passing parameters with %d-byte alignment has changed in GCC 4.6"
-msgstr ""
+msgstr "%d ãƒã‚¤ãƒˆæ•´åˆ—ã®ä»®å¼•æ•°ã‚’渡㙠ABI 㯠GCC 4.6 ã§å¤‰æ›´ã«ãªã£ã¦ã„ã¾ã™"
#: config/i386/i386.c:7570
#, gcc-internal-format
msgid "SSE vector return without SSE enabled changes the ABI"
-msgstr ""
+msgstr "SSE ãŒæœ‰åŠ¹ã§ãªã„状態ã§ã® SSE ベクトル戻㗠(return) 㯠ABI を変更ã—ã¾ã™"
#: config/i386/i386.c:7580
#, gcc-internal-format
msgid "MMX vector return without MMX enabled changes the ABI"
-msgstr ""
+msgstr "MMX ãŒæœ‰åŠ¹ã§ãªã„状態ã§ã® MMX ベクトル戻㗠(return) 㯠ABI を変更ã—ã¾ã™"
#: config/i386/i386.c:9006
#, gcc-internal-format
msgid "%<-fsplit-stack%> currently only supported on GNU/Linux"
-msgstr ""
+msgstr "%<-fsplit-stack%> ã¯ç¾åœ¨ã®ã¨ã“ã‚ GNU/Linux 上ã§ã®ã¿ã‚µãƒãƒ¼ãƒˆã•ã‚Œã¦ã„ã¾ã™"
#: config/i386/i386.c:9012
#, gcc-internal-format
msgid "%<-fsplit-stack%> requires assembler support for CFI directives"
-msgstr ""
+msgstr "%<-fsplit-stack%> ã¯ã‚¢ã‚»ãƒ³ãƒ–ラ㌠CFI 指示をサãƒãƒ¼ãƒˆã—ã¦ã„ã‚‹å¿…è¦ãŒã‚ã‚Šã¾ã™"
#: config/i386/i386.c:10167
#, gcc-internal-format
msgid "ms_hook_prologue attribute isn%'t compatible with -mfentry for 32-bit"
-msgstr ""
+msgstr "ms_hook_prologue 属性㯠32 ビット用㮠-mfentry ã¨ä½µç”¨ã§ãã¾ã›ã‚“"
#: config/i386/i386.c:11135
#, gcc-internal-format
@@ -22157,54 +22156,54 @@ msgid "non-integer operand used with operand code '%c'"
msgstr ""
#: config/i386/i386.c:25819 config/i386/i386.c:27203
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "last argument must be an immediate"
-msgstr "マスクã¯å³å€¤ã§ãªã‘ã‚Œã°ãªã‚Šã¾ã›ã‚“"
+msgstr "最後ã®å¼•æ•°ã¯å³å€¤ã§ãªã‘ã‚Œã°ã„ã‘ã¾ã›ã‚“"
#: config/i386/i386.c:26116
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "the fifth argument must be a 8-bit immediate"
-msgstr "セレクタã¯å³å€¤ã§ãªã‘ã‚Œã°ãªã‚Šã¾ã›ã‚“"
+msgstr "第五引数㯠8 ビットå³å€¤ã§ãªã‘ã‚Œã°ã„ã‘ã¾ã›ã‚“"
#: config/i386/i386.c:26211
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "the third argument must be a 8-bit immediate"
-msgstr "セレクタã¯å³å€¤ã§ãªã‘ã‚Œã°ãªã‚Šã¾ã›ã‚“"
+msgstr "第三引数㯠8 ビットå³å€¤ã§ãªã‘ã‚Œã°ã„ã‘ã¾ã›ã‚“"
#: config/i386/i386.c:26568
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "the last argument must be a 4-bit immediate"
-msgstr "セレクタã¯å³å€¤ã§ãªã‘ã‚Œã°ãªã‚Šã¾ã›ã‚“"
+msgstr "最後ã®å¼•æ•°ã¯ 4 ビットå³å€¤ã§ãªã‘ã‚Œã°ã„ã‘ã¾ã›ã‚“"
#: config/i386/i386.c:26577
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "the last argument must be a 2-bit immediate"
-msgstr "セレクタã¯å³å€¤ã§ãªã‘ã‚Œã°ãªã‚Šã¾ã›ã‚“"
+msgstr "最後ã®å¼•æ•°ã¯ 2 ビットå³å€¤ã§ãªã‘ã‚Œã°ã„ã‘ã¾ã›ã‚“"
#: config/i386/i386.c:26586
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "the last argument must be a 1-bit immediate"
-msgstr "セレクタã¯å³å€¤ã§ãªã‘ã‚Œã°ãªã‚Šã¾ã›ã‚“"
+msgstr "最後ã®å¼•æ•°ã¯ 1 ビットå³å€¤ã§ãªã‘ã‚Œã°ã„ã‘ã¾ã›ã‚“"
#: config/i386/i386.c:26595
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "the last argument must be a 5-bit immediate"
-msgstr "セレクタã¯å³å€¤ã§ãªã‘ã‚Œã°ãªã‚Šã¾ã›ã‚“"
+msgstr "最後ã®å¼•æ•°ã¯ 5 ビットå³å€¤ã§ãªã‘ã‚Œã°ã„ã‘ã¾ã›ã‚“"
#: config/i386/i386.c:26604
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "the next to last argument must be an 8-bit immediate"
-msgstr "セレクタã¯å³å€¤ã§ãªã‘ã‚Œã°ãªã‚Šã¾ã›ã‚“"
+msgstr "最後ã®å¼•æ•°ã®å‰ã®å¼•æ•°ã¯ 8 ビットå³å€¤ã§ãªã‘ã‚Œã°ã„ã‘ã¾ã›ã‚“"
#: config/i386/i386.c:26608 config/i386/i386.c:26820
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "the last argument must be an 8-bit immediate"
-msgstr "セレクタã¯å³å€¤ã§ãªã‘ã‚Œã°ãªã‚Šã¾ã›ã‚“"
+msgstr "最後ã®å¼•æ•°ã¯ 8 ビットå³å€¤ã§ãªã‘ã‚Œã°ã„ã‘ã¾ã›ã‚“"
#: config/i386/i386.c:26818
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "the last argument must be a 32-bit immediate"
-msgstr "セレクタã¯å³å€¤ã§ãªã‘ã‚Œã°ãªã‚Šã¾ã›ã‚“"
+msgstr "最後ã®å¼•æ•°ã¯ 32 ビットå³å€¤ã§ãªã‘ã‚Œã°ã„ã‘ã¾ã›ã‚“"
#: config/i386/i386.c:26884 config/rs6000/rs6000.c:11450
#, gcc-internal-format
@@ -22217,69 +22216,69 @@ msgid "%qE needs unknown isa option"
msgstr ""
#: config/i386/i386.c:27031
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "%qE needs isa option %s"
-msgstr "無効ãªã‚ªãƒ—ション %s"
+msgstr "%qE 㯠isa オプション %s ãŒå¿…è¦ã§ã™"
#: config/i386/i386.c:29096
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "%qE attribute only available for 32-bit"
-msgstr "`%s' 属性ã¯åž‹ã«ã¯é©ç”¨ã•ã‚Œã¾ã›ã‚“"
+msgstr "%qE 属性㯠32 ビットã§ã®ã¿ä½¿ç”¨ã§ãã¾ã™"
#: config/i386/i386.c:29117
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "argument to %qE attribute is neither zero, nor one"
-msgstr "asm テンプレートãŒæ–‡å­—列定数ã§ã¯ã‚ã‚Šã¾ã›ã‚“"
+msgstr "%qE 属性ã¸ã®å¼•æ•°ãŒ 0 ã§ã‚‚ 1 ã§ã‚‚ã‚ã‚Šã¾ã›ã‚“"
#: config/i386/i386.c:29147
#, gcc-internal-format
msgid "%qE attribute only available for 64-bit"
-msgstr ""
+msgstr "%qE 属性㯠64 ビットã§ã®ã¿ä½¿ç”¨ã§ãã¾ã™"
#: config/i386/i386.c:29158 config/i386/i386.c:29167
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "ms_abi and sysv_abi attributes are not compatible"
-msgstr "shared 㨠mdll ã¨ã¯å…±å­˜ã§ãã¾ã›ã‚“"
+msgstr "ms_abi 㨠sysv_abi 属性ã¯äº’æ›æ€§ãŒã‚ã‚Šã¾ã›ã‚“"
#: config/i386/i386.c:29205 config/rs6000/rs6000.c:24997
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "%qE incompatible attribute ignored"
-msgstr "`%s' 属性ã¯ç„¡è¦–ã•ã‚Œã¾ã—ãŸ"
+msgstr "互æ›æ€§ãŒãªã„ %qE 属性ã¯ç„¡è¦–ã•ã‚Œã¾ã—ãŸ"
#: config/i386/i386.c:33370
#, gcc-internal-format
msgid "vector permutation requires vector constant"
-msgstr ""
+msgstr "ベクトル順列ã¯ãƒ™ã‚¯ãƒˆãƒ«å®šæ•°ã§ã‚ã‚‹å¿…è¦ãŒã‚ã‚Šã¾ã™"
#: config/i386/i386.c:33380
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "invalid vector permutation constant"
-msgstr "無効ãªå¥èª­ç‚¹ `%c' ãŒåˆ¶ç´„内ã«ã‚ã‚Šã¾ã™"
+msgstr "無効ãªãƒ™ã‚¯ãƒˆãƒ«é †åˆ—定数ã§ã™"
#: config/i386/i386.c:33428
#, gcc-internal-format
msgid "vector permutation (%d %d)"
-msgstr ""
+msgstr "ベクトル順列 (%d %d)"
#: config/i386/i386.c:33431
#, gcc-internal-format
msgid "vector permutation (%d %d %d %d)"
-msgstr ""
+msgstr "ベクトル順列 (%d %d %d %d)"
#: config/i386/i386.c:33435
#, gcc-internal-format
msgid "vector permutation (%d %d %d %d %d %d %d %d)"
-msgstr ""
+msgstr "ベクトル順列 (%d %d %d %d %d %d %d %d)"
#: config/i386/i386.c:33440
#, gcc-internal-format
msgid "vector permutation (%d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d)"
-msgstr ""
+msgstr "ベクトル順列 (%d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d)"
#: config/i386/winnt.c:83
#, gcc-internal-format
msgid "%qE attribute applies only to initialized variables with external linkage"
-msgstr ""
+msgstr "%qE 属性ã¯å¤–部リンクã•ã‚Œã¦ã„ã‚‹åˆæœŸåŒ–ã•ã‚ŒãŸå¤‰æ•°ã«ã®ã¿é©ç”¨ã§ãã¾ã™"
#: config/i386/winnt.c:145 config/sh/symbian-c.c:96
#: config/sh/symbian-cxx.c:120
@@ -22288,77 +22287,77 @@ msgid "definition of static data member %q+D of dllimport%'d class"
msgstr ""
#: config/i386/winnt.c:308
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "%q+D:'selectany' attribute applies only to initialized objects"
-msgstr "`%s' 属性ã¯é–¢æ•°ã«å¯¾ã—ã¦ã®ã¿é©ç”¨ã•ã‚Œã¾ã™"
+msgstr "%q+D:'selectany' 属性ã¯åˆæœŸåŒ–ã•ã‚ŒãŸã‚ªãƒ–ジェクトã«ã®ã¿é©ç”¨ã§ãã¾ã™"
#: config/i386/winnt.c:452
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "%q+D causes a section type conflict"
-msgstr "%s ã¯ã‚»ã‚¯ã‚·ãƒ§ãƒ³ã‚¿ã‚¤ãƒ—ã®ç«¶åˆã‚’引ãèµ·ã“ã—ã¾ã™"
+msgstr "%q+D ã¯ã‚»ã‚¯ã‚·ãƒ§ãƒ³åž‹ã®ç«¶åˆã®åŽŸå› ã¨ãªã‚Šã¾ã™"
#: config/i386/cygming.h:200
#, gcc-internal-format
msgid "-fPIC ignored for target (all code is position independent)"
-msgstr ""
+msgstr "-fPIC ã¯ã‚¿ãƒ¼ã‚²ãƒƒãƒˆã§ã¯ç„¡è¦–ã•ã‚Œã¾ã™ (å…¨ã¦ã®ã‚³ãƒ¼ãƒ‰é…ç½®éžä¾å­˜ã§ã™)"
#: config/i386/cygming.h:206
#, gcc-internal-format
msgid "-f%s ignored for target (all code is position independent)"
-msgstr "-f%s ã¯ã‚¿ãƒ¼ã‚²ãƒƒãƒˆã§ç„¡è¦–ã•ã‚Œã¾ã™ (å…¨ã¦ã®ã‚³ãƒ¼ãƒ‰ã¯ä½ç½®éžä¾å­˜ã§ã™)"
+msgstr "-f%s ã¯ã‚¿ãƒ¼ã‚²ãƒƒãƒˆã§ã¯ç„¡è¦–ã•ã‚Œã¾ã™ (å…¨ã¦ã®ã‚³ãƒ¼ãƒ‰ã¯ä½ç½®éžä¾å­˜ã§ã™)"
#: config/i386/djgpp.h:175
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "-mbnu210 is ignored (option is obsolete)"
-msgstr "-mbnu210 ã¯ç„¡è¦–ã•ã‚Œã¾ã—ãŸ(廃れãŸã‚ªãƒ—ションã§ã™)"
+msgstr "-mbnu210 ã¯ç„¡è¦–ã•ã‚Œã¾ã™ (オプションã¯å»ƒæ­¢ã•ã‚Œã¦ã„ã¾ã™)"
#: config/i386/i386-interix.h:253
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "ms-bitfields not supported for objc"
-msgstr "-pipe ã¯å®Ÿè£…ã•ã‚Œã¦ã„ã¾ã›ã‚“"
+msgstr "ms-bitfields 㯠objc 用ã«ã¯ã‚µãƒãƒ¼ãƒˆã•ã‚Œã¦ã„ã¾ã›ã‚“"
#. Don't allow flag_pic to propagate since invalid relocations will
#. result otherwise.
#: config/i386/netware.h:84
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "-fPIC and -fpic are not supported for this target"
-msgstr "-fdata-sections ã¯ã“ã®ã‚¿ãƒ¼ã‚²ãƒƒãƒˆã§å—ã‘入れられã¾ã›ã‚“"
+msgstr "-fPIC and -fpic ã¯ã“ã®ã‚¿ãƒ¼ã‚²ãƒƒãƒˆã§ã¯ã‚µãƒãƒ¼ãƒˆã•ã‚Œã¦ã„ã¾ã›ã‚“"
#: config/ia64/ia64-c.c:52
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "malformed #pragma builtin"
-msgstr "ãŠã‹ã—㪠#pragma implementation"
+msgstr "é–“é•ã£ãŸå½¢å¼ã® #pragma builtin ã§ã™"
#: config/ia64/ia64.c:694
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "invalid argument of %qE attribute"
-msgstr "`%s' ã®å¼•æ•°ã¨ã—ã¦ç„¡åŠ¹ãªåž‹"
+msgstr "%qE 属性ã®ç„¡åŠ¹ãªå¼•æ•°ã§ã™"
#: config/ia64/ia64.c:707
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "an address area attribute cannot be specified for local variables"
-msgstr "データ領域属性をローカル変数ã«ã¯æŒ‡å®šã§ãã¾ã›ã‚“"
+msgstr "アドレス領域属性ã¯å±€æ‰€å¤‰æ•°ç”¨ã«ã¯æŒ‡å®šã§ãã¾ã›ã‚“"
#: config/ia64/ia64.c:714
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "address area of %q+D conflicts with previous declaration"
-msgstr "データ領域 '%s' ã¯å‰ã®å®£è¨€ã¨çŸ›ç›¾ã—ã¾ã™"
+msgstr "%q+D ã®ã‚¢ãƒ‰ãƒ¬ã‚¹é ˜åŸŸã¯å‰ã®å®£è¨€ã¨ç«¶åˆã—ã¦ã„ã¾ã™"
#: config/ia64/ia64.c:722
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "address area attribute cannot be specified for functions"
-msgstr "データ領域属性をローカル変数ã«ã¯æŒ‡å®šã§ãã¾ã›ã‚“"
+msgstr "アドレス領域属性ã¯é–¢æ•°ç”¨ã«ã¯æŒ‡å®šã§ãã¾ã›ã‚“"
#: config/ia64/ia64.c:763
#, gcc-internal-format
msgid "%qE attribute requires a string constant argument"
-msgstr ""
+msgstr "%qE 属性ã¯æ–‡å­—列定数引数を必è¦ã¨ã—ã¾ã™"
#: config/ia64/ia64.c:5655 config/pa/pa.c:420 config/sh/sh.c:8850
#: config/spu/spu.c:5079
#, gcc-internal-format
msgid "value of -mfixed-range must have form REG1-REG2"
-msgstr "-mfixed-range ã®å€¤ã¯ REG1-REG2 å½¢å¼ã‚’æŒãŸã­ã°ãªã‚Šã¾ã›ã‚“"
+msgstr "-mfixed-range ã®å€¤ã¯ REG1-REG2 å½¢å¼ã§ãªã‘ã‚Œã°ã„ã‘ã¾ã›ã‚“"
#: config/ia64/ia64.c:5682 config/pa/pa.c:447 config/sh/sh.c:8876
#: config/spu/spu.c:5105
@@ -22367,29 +22366,29 @@ msgid "%s-%s is an empty range"
msgstr "%s-%s ãŒç©ºã®ç¯„囲ã§ã™"
#: config/ia64/ia64.c:5710
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "bad value %<%s%> for -mtls-size= switch"
-msgstr "-mabi= スイッãƒã«å¯¾ã™ã‚‹ä¸æ­£ãªå€¤ (%s)"
+msgstr "-mtls-size= スイッãƒç”¨ã®é–“é•ã£ãŸå€¤ %<%s%> ã§ã™"
#: config/ia64/ia64.c:5735
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "bad value %<%s%> for -mtune= switch"
-msgstr "-mcpu= スイッãƒã«å¯¾ã™ã‚‹ä¸æ­£ãªå€¤ (%s)"
+msgstr "-mtune= スイッãƒç”¨ã®é–“é•ã£ãŸå€¤ %<%s%> ã§ã™"
#: config/ia64/ia64.c:11007
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "version attribute is not a string"
-msgstr "#line ã®å¾Œã®äºŒã¤ç›®ã®ãƒˆãƒ¼ã‚¯ãƒ³ãŒæ–‡å­—列ã§ã¯ã‚ã‚Šã¾ã›ã‚“"
+msgstr "version 属性ãŒæ–‡å­—列ã§ã¯ã‚ã‚Šã¾ã›ã‚“"
#: config/iq2000/iq2000.c:1870
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "gp_offset (%ld) or end_offset (%ld) is less than zero"
-msgstr "gp_offset (%ld) åˆã¯ end_offset (%ld) ãŒã‚¼ãƒ­ã‚ˆã‚Šã‚‚å°ã•ããªã£ã¦ã„ã¾ã™"
+msgstr "gp_offset (%ld) ã¾ãŸã¯ end_offset (%ld) ㌠0 よりå°ã•ã„ã§ã™"
#: config/iq2000/iq2000.c:2649
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "argument %qd is not a constant"
-msgstr "`asm' ã®å¼•æ•°ãŒå®šæ•°æ–‡å­—列ã§ã¯ã‚ã‚Šã¾ã›ã‚“ "
+msgstr "引数 %qd ãŒå®šæ•°ã§ã¯ã‚ã‚Šã¾ã›ã‚“"
#: config/iq2000/iq2000.c:2951 config/xtensa/xtensa.c:2389
#, gcc-internal-format
@@ -22407,24 +22406,24 @@ msgid "PRINT_OPERAND null pointer"
msgstr "PRINT_OPERAND NULL ãƒã‚¤ãƒ³ã‚¿"
#: config/m32c/m32c-pragma.c:61
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "junk at end of #pragma GCC memregs [0..16]"
-msgstr "#pragma %s ã®æœ«å°¾ã«ã‚´ãƒŸ"
+msgstr "#pragma GCC memregs [0..16] ã®æœ«å°¾ã«ã‚´ãƒŸãŒã‚ã‚Šã¾ã™"
#: config/m32c/m32c-pragma.c:68
#, gcc-internal-format
msgid "#pragma GCC memregs must precede any function decls"
-msgstr ""
+msgstr "#pragma GCC memregs ã¯å…¨ã¦ã®é–¢æ•°å®£è¨€ã®å‰ã«ãªã‘ã‚Œã°ã„ã‘ã¾ã›ã‚“"
#: config/m32c/m32c-pragma.c:76 config/m32c/m32c-pragma.c:83
#, gcc-internal-format
msgid "#pragma GCC memregs takes a number [0..16]"
-msgstr ""
+msgstr "#pragma GCC memregs ã¯æ•°å€¤ [0..16] ã‚’ã¨ã‚Šã¾ã™"
#: config/m32c/m32c-pragma.c:111
#, gcc-internal-format
msgid "junk at end of #pragma ADDRESS"
-msgstr ""
+msgstr "#pragma ADDRESS ã®æœ«å°¾ã«ã‚´ãƒŸãŒã‚ã‚Šã¾ã™"
#: config/m32c/m32c-pragma.c:116
#, gcc-internal-format
@@ -22432,40 +22431,40 @@ msgid "malformed #pragma ADDRESS variable address"
msgstr ""
#: config/m32c/m32c.c:441
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "invalid target memregs value '%d'"
-msgstr "無効ãªãƒ‘ラメタ値 `%s'"
+msgstr ""
#: config/m32c/m32c.c:3160
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "%qE attribute is not supported for R8C target"
-msgstr "セクション属性ã¯ã“ã®ã‚¿ãƒ¼ã‚²ãƒƒãƒˆã§ã¯å®Ÿè£…ã•ã‚Œã¦ã„ã¾ã›ã‚“"
+msgstr "%qE 属性㯠R8C ターゲット用ã«ã¯ã‚µãƒãƒ¼ãƒˆã•ã‚Œã¦ã„ã¾ã›ã‚“"
#. The argument must be a constant integer.
#: config/m32c/m32c.c:3176 config/sh/sh.c:9057 config/sh/sh.c:9163
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "%qE attribute argument not an integer constant"
-msgstr "è¦æ±‚ã•ã‚ŒãŸ init_priority ã¯æ•´æ•°åž‹ã®å®šæ•°ã§ã¯ã‚ã‚Šã¾ã›ã‚“"
+msgstr "%qE 属性ã®å¼•æ•°ãŒæ•´æ•°å®šæ•°ã§ã¯ã‚ã‚Šã¾ã›ã‚“"
#: config/m32c/m32c.c:3185
#, gcc-internal-format
msgid "%qE attribute argument should be between 18 to 255"
-msgstr ""
+msgstr "%qE 属性ã®å¼•æ•°ã¯ 18 ã‹ã‚‰ 255 ã®é–“ã§ã‚ã‚‹ã¹ãã§ã™"
#: config/m32c/m32c.c:4443
#, gcc-internal-format
msgid "%<bank_switch%> has no effect on non-interrupt functions"
-msgstr ""
+msgstr "%<bank_switch%> ã¯éžå‰²ã‚Šè¾¼ã¿é–¢æ•°ã§ã¯åŠ¹æžœãŒã‚ã‚Šã¾ã›ã‚“"
#: config/m32c/m32c.c:4544
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "%<fast_interrupt%> attribute directive ignored"
-msgstr "`%s' 属性ã®ç–‘似命令ãŒç„¡è¦–ã•ã‚Œã¾ã—ãŸ"
+msgstr "%<fast_interrupt%> 属性指示ã¯ç„¡è¦–ã•ã‚Œã¾ã—ãŸ"
#: config/m32r/m32r.c:442
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "invalid argument of %qs attribute"
-msgstr "`%s' ã®å¼•æ•°ã¨ã—ã¦ç„¡åŠ¹ãªåž‹"
+msgstr "%qs 属性ã®å¼•æ•°ãŒç„¡åŠ¹ã§ã™"
#: config/m68hc11/m68hc11.c:328
#, gcc-internal-format
@@ -22475,272 +22474,272 @@ msgstr "-f%s 㯠68HC11/68HC12 用ã¨ã—ã¦ã¯ç„¡è¦–ã•ã‚Œã¾ã—㟠(サãƒãƒ¼ãƒ
#: config/m68hc11/m68hc11.c:1308
#, gcc-internal-format
msgid "%<trap%> and %<far%> attributes are not compatible, ignoring %<far%>"
-msgstr ""
+msgstr "%<trap%> 㨠%<far%> 属性ã¯ä½µç”¨ã§ãã¾ã›ã‚“。%<far%> を無視ã—ã¦ã„ã¾ã™"
#: config/m68hc11/m68hc11.c:1315
#, gcc-internal-format
msgid "%<trap%> attribute is already used"
-msgstr ""
+msgstr "%<trap%> ã¯æ—¢ã«ä½¿ç”¨ã•ã‚Œã¦ã„ã¾ã™"
#: config/m68k/m68k.c:586
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "-mcpu=%s conflicts with -march=%s"
-msgstr "-mcpu=%s スイッãƒã¯ -march= スイッãƒã¨ç«¶åˆã—ã¾ã™"
+msgstr "-mcpu=%s ㌠-march=%s ã¨ç«¶åˆã—ã¦ã„ã¾ã™"
#: config/m68k/m68k.c:657
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "-mpcrel -fPIC is not currently supported on selected cpu"
-msgstr "今ã®ã¨ã“ã‚ 68000 ã‚„ 68010 ã§ã¯ -fPIC ãŒã‚µãƒãƒ¼ãƒˆã•ã‚Œã¦ã„ã¾ã›ã‚“\n"
+msgstr "-mpcrel -fPIC ã¯é¸æŠžã—㟠CPU 上ã§ã¯ç¾åœ¨ã®ã¨ã“ã‚サãƒãƒ¼ãƒˆã•ã‚Œã¦ã„ã¾ã›ã‚“"
#: config/m68k/m68k.c:719
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "-falign-labels=%d is not supported"
-msgstr "-pipe ã¯å®Ÿè£…ã•ã‚Œã¦ã„ã¾ã›ã‚“"
+msgstr "-falign-labels=%d ã¯ã‚µãƒãƒ¼ãƒˆã•ã‚Œã¦ã„ã¾ã›ã‚“"
#: config/m68k/m68k.c:724
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "-falign-loops=%d is not supported"
-msgstr "-mips%d ã¯ã‚µãƒãƒ¼ãƒˆã•ã‚Œã¾ã›ã‚“"
+msgstr "-falign-loops=%d ã¯ã‚µãƒãƒ¼ãƒˆã•ã‚Œã¦ã„ã¾ã›ã‚“"
#: config/m68k/m68k.c:827
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "multiple interrupt attributes not allowed"
-msgstr "セクション属性㯠`%s' ã«ã¯ä½¿ãˆã¾ã›ã‚“"
+msgstr "複数ã®å‰²ã‚Šè¾¼ã¿å±žæ€§ã¯è¨±å¯ã•ã‚Œã¦ã„ã¾ã›ã‚“"
#: config/m68k/m68k.c:834
#, gcc-internal-format
msgid "interrupt_thread is available only on fido"
-msgstr ""
+msgstr "interrupt_thread 㯠fido 上ã§ã®ã¿ä½¿ç”¨å‡ºæ¥ã¾ã™"
#: config/m68k/m68k.c:1163 config/rs6000/rs6000.c:19380
#, gcc-internal-format
msgid "stack limit expression is not supported"
-msgstr "スタック制é™å¼ã‚’å—ã‘付ã‘ã¾ã›ã‚“"
+msgstr "スタック制é™å¼ã¯ã‚µãƒãƒ¼ãƒˆã•ã‚Œã¦ã„ã¾ã›ã‚“"
#: config/mep/mep-pragma.c:71
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "junk at end of #pragma io_volatile"
-msgstr "#pragma map ã®çµ‚ã‚Šã«ã‚´ãƒŸãŒã‚ã‚Šã¾ã™"
+msgstr "#pragma io_volatile ã®æœ«å°¾ã«ã‚´ãƒŸãŒã‚ã‚Šã¾ã™"
#: config/mep/mep-pragma.c:85
#, gcc-internal-format
msgid "#pragma io_volatile takes only on or off"
-msgstr ""
+msgstr "#pragma io_volatile 㯠on ã¾ãŸã¯ off ã®ã„ãšã‚Œã‹ã®ã¿ã‚’ã¨ã‚Šã¾ã™"
#: config/mep/mep-pragma.c:124
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "invalid coprocessor register range"
-msgstr "`%s' ã¯ãƒ¬ã‚¸ã‚¹ã‚¿å¤‰æ•°ã¨ã—ã¦ã¯ç„¡åŠ¹ãªãƒ¬ã‚¸ã‚¹ã‚¿åã§ã™"
+msgstr "無効ãªã‚³ãƒ—ロセッサレジスタ範囲ã§ã™"
#: config/mep/mep-pragma.c:144
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "invalid coprocessor register %qE"
-msgstr "無効ãªãƒ—リプロセスディレクティヴ #%s"
+msgstr "無効ãªã‚³ãƒ—ロセッサレジスタ %qE ã§ã™"
#: config/mep/mep-pragma.c:167
#, gcc-internal-format
msgid "malformed coprocessor register"
-msgstr ""
+msgstr "é–“é•ã£ãŸå½¢å¼ã®ã‚³ãƒ—ロセッサレジスタã§ã™"
#: config/mep/mep-pragma.c:254
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "junk at end of #pragma GCC coprocessor width"
-msgstr "#pragma GCC java_exceptions ã®æœ«å°¾ã«ã‚´ãƒŸ"
+msgstr "#pragma GCC coprocessor width ã®æœ«å°¾ã«ã‚´ãƒŸãŒã‚ã‚Šã¾ã™"
#: config/mep/mep-pragma.c:261
#, gcc-internal-format
msgid "#pragma GCC coprocessor width takes only 32 or 64"
-msgstr ""
+msgstr "#pragma GCC coprocessor width 㯠32 ã¾ãŸã¯ 64 ã®ã¿ã‚’ã¨ã‚Šã¾ã™"
#: config/mep/mep-pragma.c:295
#, gcc-internal-format
msgid "#pragma GCC coprocessor subclass letter must be in [ABCD]"
-msgstr ""
+msgstr "#pragma GCC coprocessor subclass ã®æ–‡å­—㯠[ABCD] ã®ã©ã‚Œã‹ã§ãªã‘ã‚Œã°ã„ã‘ã¾ã›ã‚“"
#: config/mep/mep-pragma.c:300
#, gcc-internal-format
msgid "#pragma GCC coprocessor subclass '%c' already defined"
-msgstr ""
+msgstr "#pragma GCC coprocessor subclass '%c' ã¯æ—¢ã«å®šç¾©ã•ã‚Œã¦ã„ã¾ã™"
#: config/mep/mep-pragma.c:318
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "malformed #pragma GCC coprocessor subclass"
-msgstr "ãŠã‹ã—㪠#pragma ghs section"
+msgstr "é–“é•ã£ãŸå½¢å¼ã® #pragma GCC coprocessor subclass ã§ã™"
#: config/mep/mep-pragma.c:340
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "malformed #pragma disinterrupt"
-msgstr "ãŠã‹ã—㪠#pragma ghs section"
+msgstr "é–“é•ã£ãŸå½¢å¼ã® #pragma disinterrupt ã§ã™"
#: config/mep/mep-pragma.c:354
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "malformed #pragma GCC coprocessor"
-msgstr "ãŠã‹ã—㪠#pragma mapã€ç„¡è¦–ã•ã‚Œã¾ã—ãŸ"
+msgstr "é–“é•ã£ãŸå½¢å¼ã® #pragma GCC coprocessor ã§ã™"
#: config/mep/mep-pragma.c:359
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "coprocessor not enabled"
-msgstr "有効オプション: "
+msgstr "コプロセッサãŒæœ‰åŠ¹ã§ã¯ã‚ã‚Šã¾ã›ã‚“"
#: config/mep/mep-pragma.c:370
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "unknown #pragma GCC coprocessor %E"
-msgstr "ä¸æ˜Žãª #pragma namespace %s ã§ã™"
+msgstr "ä¸æ˜Žãª #pragma GCC coprocessor %E ã§ã™"
#: config/mep/mep-pragma.c:392
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "malformed #pragma call"
-msgstr "ãŠã‹ã—㪠#pragma ghs section"
+msgstr "é–“é•ã£ãŸå½¢å¼ã® #pragma call ã§ã™"
#: config/mep/mep.c:317
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "-fpic is not supported"
-msgstr "-pipe ã¯å®Ÿè£…ã•ã‚Œã¦ã„ã¾ã›ã‚“"
+msgstr "-fpic ã¯ã‚µãƒãƒ¼ãƒˆã•ã‚Œã¦ã„ã¾ã›ã‚“"
#: config/mep/mep.c:319
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "-fPIC is not supported"
-msgstr "-pipe ã¯å®Ÿè£…ã•ã‚Œã¦ã„ã¾ã›ã‚“"
+msgstr "-fPIC ã¯ã‚µãƒãƒ¼ãƒˆã•ã‚Œã¦ã„ã¾ã›ã‚“"
#: config/mep/mep.c:321
#, gcc-internal-format
msgid "only one of -ms and -mm may be given"
-msgstr ""
+msgstr "-ms 㨠-mm ã®ã†ã¡ä¸€ã¤ã ã‘指定ã§ãã¾ã™"
#: config/mep/mep.c:323
#, gcc-internal-format
msgid "only one of -ms and -ml may be given"
-msgstr ""
+msgstr "-ms 㨠-ml ã®ã†ã¡ä¸€ã¤ã ã‘指定ã§ãã¾ã™"
#: config/mep/mep.c:325
#, gcc-internal-format
msgid "only one of -mm and -ml may be given"
-msgstr ""
+msgstr "-mm 㨠-ml ã®ã†ã¡ä¸€ã¤ã ã‘指定ã§ãã¾ã™"
#: config/mep/mep.c:327
#, gcc-internal-format
msgid "only one of -ms and -mtiny= may be given"
-msgstr ""
+msgstr "-ms 㨠-mtiny= ã®ã†ã¡ä¸€ã¤ã ã‘指定ã§ãã¾ã™"
#: config/mep/mep.c:329
#, gcc-internal-format
msgid "only one of -mm and -mtiny= may be given"
-msgstr ""
+msgstr "-mm 㨠-mtiny= ã®ã†ã¡ä¸€ã¤ã ã‘指定ã§ãã¾ã™"
#: config/mep/mep.c:331
#, gcc-internal-format
msgid "-mclip currently has no effect without -mminmax"
-msgstr ""
+msgstr "-mclip ã¯ç¾åœ¨ã®ã¨ã“ã‚ -mminmax ãŒç„¡ã„å ´åˆã«ã¯åŠ¹æžœãŒã‚ã‚Šã¾ã›ã‚“"
#: config/mep/mep.c:338
#, gcc-internal-format
msgid "-mc= must be -mc=tiny, -mc=near, or -mc=far"
-msgstr ""
+msgstr "-mc= 㯠-mc=tinyã€-mc=near ã¾ãŸã¯ -mc=far ã§ãªã‘ã‚Œã°ã„ã‘ã¾ã›ã‚“"
#: config/mep/mep.c:1465
#, gcc-internal-format
msgid "unusual TP-relative address"
-msgstr ""
+msgstr "通常ã§ã¯ãªã„ TP 関連アドレスã§ã™"
#: config/mep/mep.c:3437
#, gcc-internal-format
msgid "unconvertible operand %c %qs"
-msgstr ""
+msgstr "変æ›ã§ããªã„è¢«æ¼”ç®—å­ %c %qs ã§ã™"
#: config/mep/mep.c:3887 config/mep/mep.c:3950
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "address region attributes not allowed with auto storage class"
-msgstr "セクション属性㯠`%s' ã«ã¯ä½¿ãˆã¾ã›ã‚“"
+msgstr "アドレス範囲 (address region) 属性ã¯è‡ªå‹•è¨˜æ†¶åŸŸã‚¯ãƒ©ã‚¹ã§ã¯è¨±å¯ã•ã‚Œã¦ã„ã¾ã›ã‚“"
#: config/mep/mep.c:3893 config/mep/mep.c:3956
#, gcc-internal-format
msgid "address region attributes on pointed-to types ignored"
-msgstr ""
+msgstr "型を指ã—ã¦ã„るアドレス範囲 (address region) 属性ã¯ç„¡è¦–ã•ã‚Œã¾ã—ãŸ"
#: config/mep/mep.c:3942
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "%qE attribute only applies to variables and functions"
-msgstr "`%s' 属性ã¯é–¢æ•°ã«å¯¾ã—ã¦ã®ã¿é©ç”¨ã•ã‚Œã¾ã™"
+msgstr "%qE 属性ã¯å¤‰æ•°ãŠã‚ˆã³é–¢æ•°ã¸ã®ã¿é©ç”¨ã§ãã¾ã™"
#: config/mep/mep.c:3962 config/mep/mep.c:4274
#, gcc-internal-format
msgid "duplicate address region attribute %qE in declaration of %qE on line %d"
-msgstr ""
+msgstr "é‡è¤‡ã—ãŸã‚¢ãƒ‰ãƒ¬ã‚¹ç¯„囲 (address region) 属性 %qE ãŒå®£è¨€ %qE (%d è¡Œ) 内ã«ã‚ã‚Šã¾ã™"
#: config/mep/mep.c:3996
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "cannot inline interrupt function %qE"
-msgstr "`main' ã‚’ inline 関数ã«ã¯ã§ãã¾ã›ã‚“"
+msgstr "割り込ã¿é–¢æ•° %qE をインライン化ã§ãã¾ã›ã‚“"
#: config/mep/mep.c:4002
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "interrupt function must have return type of void"
-msgstr "`operator delete' ã®æˆ»ã‚Šåž‹ã¯ `void' ã§ãªã‘ã‚Œã°ãªã‚Šã¾ã›ã‚“"
+msgstr "割り込ã¿é–¢æ•°ã®æˆ»ã‚Šåž‹ã¯ void ã§ãªã‘ã‚Œã°ã„ã‘ã¾ã›ã‚“"
#: config/mep/mep.c:4007
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "interrupt function must have no arguments"
-msgstr "関数ãƒã‚¤ãƒ³ã‚¿ãŒè¨ˆç®—ã§ä½¿ã‚ã‚Œã¾ã—ãŸ"
+msgstr "割り込ã¿é–¢æ•°ã¯å¼•æ•°ç„¡ã—ã§ãªã‘ã‚Œã°ã„ã‘ã¾ã›ã‚“"
#: config/mep/mep.c:4028
#, gcc-internal-format
msgid "%qE attribute allows only an integer constant argument"
-msgstr ""
+msgstr "%qE 属性ã¯æ•´æ•°å®šæ•°å¼•æ•°ã®ã¿è¨±å¯ã•ã‚Œã¦ã„ã¾ã™"
#: config/mep/mep.c:4061
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "%qE attribute only applies to functions, not %s"
-msgstr "`%s' 属性ã¯é–¢æ•°ã«å¯¾ã—ã¦ã®ã¿é©ç”¨ã•ã‚Œã¾ã™"
+msgstr "%qE 属性ã¯é–¢æ•°ã¸ã®ã¿é©ç”¨å‡ºæ¥ã¾ã™ã€‚%s ã¸ã¯é©ç”¨ã§ãã¾ã›ã‚“"
#: config/mep/mep.c:4071
#, gcc-internal-format
msgid "to describe a pointer to a VLIW function, use syntax like this:"
-msgstr ""
+msgstr "VLIW 関数ã¸ã®ãƒã‚¤ãƒ³ã‚¿ã‚’記述ã™ã‚‹ãŸã‚ã«ã¯æ¬¡ã®ã‚ˆã†ãªæ§‹æ–‡ã‚’使用ã—ã¦ãã ã•ã„:"
#: config/mep/mep.c:4072
#, gcc-internal-format
msgid " typedef int (__vliw *vfuncptr) ();"
-msgstr ""
+msgstr " typedef int (__vliw *vfuncptr) ();"
#: config/mep/mep.c:4079
#, gcc-internal-format
msgid "to describe an array of VLIW function pointers, use syntax like this:"
-msgstr ""
+msgstr "VLIW 関数ãƒã‚¤ãƒ³ã‚¿ã®é…列を記述ã™ã‚‹ãŸã‚ã«ã¯æ¬¡ã®ã‚ˆã†ãªæ§‹æ–‡ã‚’使用ã—ã¦ãã ã•ã„:"
#: config/mep/mep.c:4080
#, gcc-internal-format
msgid " typedef int (__vliw *vfuncptr[]) ();"
-msgstr ""
+msgstr " typedef int (__vliw *vfuncptr[]) ();"
#: config/mep/mep.c:4085
#, gcc-internal-format
msgid "VLIW functions are not allowed without a VLIW configuration"
-msgstr ""
+msgstr "VLIW 関数㯠VLIW 設定外ã§ã¯è¨±å¯ã•ã‚Œã¦ã„ã¾ã›ã‚“"
#: config/mep/mep.c:4233
#, gcc-internal-format
msgid "\"#pragma disinterrupt %s\" not used"
-msgstr ""
+msgstr "\"#pragma disinterrupt %s\" ãŒä½¿ç”¨ã•ã‚Œã¦ã„ã¾ã›ã‚“"
#: config/mep/mep.c:4399
#, gcc-internal-format
msgid "__io address 0x%x is the same for %qE and %qE"
-msgstr ""
+msgstr "__io address 0x%x ㌠%qE 㨠%qE 用ã§åŒä¸€ã§ã™"
#: config/mep/mep.c:4547
#, gcc-internal-format
msgid "variable %s (%ld bytes) is too large for the %s section (%d bytes)"
-msgstr ""
+msgstr "変数 %s (%ld ãƒã‚¤ãƒˆ) 㯠%s セクション (%d ãƒã‚¤ãƒˆ) 用ã«ã¯å¤§ãã™ãŽã¾ã™"
#: config/mep/mep.c:4645
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "variable %D of type %<io%> must be uninitialized"
-msgstr "å¯å¤‰é•·ã‚ªãƒ–ジェクトã¯åˆæœŸåŒ–ã•ã‚Œãªã„ã“ã¨ã«ãªã‚‹ã§ã—ょã†"
+msgstr "%<io%> åž‹ã®å¤‰æ•° %D ã‚’åˆæœŸåŒ–ã—ã¦ã¯ã„ã‘ã¾ã›ã‚“"
#: config/mep/mep.c:4650
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "variable %D of type %<cb%> must be uninitialized"
-msgstr "å¯å¤‰é•·ã‚ªãƒ–ジェクトã¯åˆæœŸåŒ–ã•ã‚Œãªã„ã“ã¨ã«ãªã‚‹ã§ã—ょã†"
+msgstr "%<cb%> åž‹ã®å¤‰æ•° %D ã‚’åˆæœŸåŒ–ã—ã¦ã¯ã„ã‘ã¾ã›ã‚“"
#: config/mep/mep.c:6100
#, gcc-internal-format
@@ -22748,129 +22747,129 @@ msgid "coprocessor intrinsic %qs is not available in this configuration"
msgstr ""
#: config/mep/mep.c:6103
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "%qs is not available in VLIW functions"
-msgstr "`this' ã¯é™çš„メンãƒé–¢æ•°ã‹ã‚‰ä½¿ç”¨ã§ãã¾ã›ã‚“"
+msgstr "%qs 㯠VLIW 関数内ã§ã¯ä½¿ç”¨å‡ºæ¥ã¾ã›ã‚“"
#: config/mep/mep.c:6106
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "%qs is not available in non-VLIW functions"
-msgstr "`%s' ã¯é€šå¸¸ã€éž static ãªé–¢æ•°ã§ã™"
+msgstr "%qs ã¯éž VLIW 関数内ã§ã¯ä½¿ç”¨å‡ºæ¥ã¾ã›ã‚“"
#: config/mep/mep.c:6268 config/mep/mep.c:6385
#, gcc-internal-format
msgid "argument %d of %qE must be in the range %d...%d"
-msgstr ""
+msgstr "%d 番目㮠%qE ã®å¼•æ•°ã¯ %d...%d ã®ç¯„囲ã§ãªã‘ã‚Œã°ã„ã‘ã¾ã›ã‚“"
#: config/mep/mep.c:6271
#, gcc-internal-format
msgid "argument %d of %qE must be a multiple of %d"
-msgstr ""
+msgstr "%d 番目㮠%qE ã®å¼•æ•°ã¯ %d ã®å€æ•°ã§ãªã‘ã‚Œã°ã„ã‘ã¾ã›ã‚“"
#: config/mep/mep.c:6324
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "too few arguments to %qE"
-msgstr "関数ã¸ã®å¼•æ•°ãŒå°‘ãªã™ãŽã¾ã™"
+msgstr "%qE ã¸ã®å¼•æ•°ãŒå°‘ãªã™ãŽã¾ã™"
#: config/mep/mep.c:6329
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "too many arguments to %qE"
-msgstr "関数ã«å¯¾ã™ã‚‹å¼•æ•°ãŒå¤šã™ãŽã¾ã™"
+msgstr "%qE ã¸ã®å¼•æ•°ãŒå¤šã™ãŽã¾ã™"
#: config/mep/mep.c:6347
#, gcc-internal-format
msgid "argument %d of %qE must be an address"
-msgstr ""
+msgstr "%d 番目㮠%qE ã®å¼•æ•°ã¯ã‚¢ãƒ‰ãƒ¬ã‚¹ã§ãªã‘ã‚Œã°ã„ã‘ã¾ã›ã‚“"
#: config/mep/mep.c:7143
#, gcc-internal-format
msgid "2 byte cop instructions are not allowed in 64-bit VLIW mode"
-msgstr ""
+msgstr "2 ãƒã‚¤ãƒˆ cop 命令㯠64 ビット VLIW モードã§ã¯è¨±å¯ã•ã‚Œã¦ã„ã¾ã›ã‚“"
#: config/mep/mep.c:7149
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "unexpected %d byte cop instruction"
-msgstr "èªè­˜ã§ããªã„ wide sub 命令ã§ã™"
+msgstr "予期ã—ãªã„ %d ãƒã‚¤ãƒˆ cop 命令ã§ã™"
#: config/microblaze/microblaze.c:1283
#, gcc-internal-format
msgid "-mno-clearbss is deprecated; use -fno-zero-initialized-in-bss"
-msgstr ""
+msgstr "-mno-clearbss ã¯å»ƒæ­¢ã•ã‚Œã¾ã—ãŸã€‚-fno-zero-initialized-in-bss を使用ã—ã¦ãã ã•ã„"
#: config/microblaze/microblaze.c:1286
#, gcc-internal-format
msgid "-mxl_stack_check is deprecated; use -fstack-check"
-msgstr ""
+msgstr "-mxl_stack_check ã¯å»ƒæ­¢ã•ã‚Œã¾ã—ãŸã€‚-fstack-check を使用ã—ã¦ãã ã•ã„"
#: config/microblaze/microblaze.c:1311
#, gcc-internal-format
msgid "%qs is an invalid argument to -mcpu="
-msgstr ""
+msgstr "%qs 㯠-mcpu= ã¸ã®å¼•æ•°ã¨ã—ã¦ã¯ç„¡åŠ¹ã§ã™"
#: config/microblaze/microblaze.c:1360
#, gcc-internal-format
msgid "-mxl-multiply-high can be used only with -mcpu=v6.00.a or greater"
-msgstr ""
+msgstr "-mxl-multiply-high 㯠-mcpu=v6.00.a ã¾ãŸã¯ãれ以上ã§ã®ã¿ä½¿ç”¨å‡ºæ¥ã¾ã™"
#: config/microblaze/microblaze.c:1364
#, gcc-internal-format
msgid "-mxl-multiply-high requires -mno-xl-soft-mul"
-msgstr ""
+msgstr "-mxl-multiply-high 㯠-mno-xl-soft-mul ãŒå¿…è¦ã§ã™"
#: config/mips/mips.c:1369 config/mips/mips.c:1371
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "%qs attribute only applies to functions"
-msgstr "`%s' 属性ã¯é–¢æ•°ã«å¯¾ã—ã¦ã®ã¿é©ç”¨ã•ã‚Œã¾ã™"
+msgstr "%qs 属性ã¯é–¢æ•°ã¸ã®ã¿é©ç”¨å‡ºæ¥ã¾ã™"
#: config/mips/mips.c:1381
#, gcc-internal-format
msgid "%qE cannot have both %<mips16%> and %<nomips16%> attributes"
-msgstr ""
+msgstr "%qE 㯠%<mips16%> 㨠%<nomips16%> 属性ã®ä¸¡æ–¹ã‚’æŒã¤ã“ã¨ã¯å‡ºæ¥ã¾ã›ã‚“"
#: config/mips/mips.c:1403 config/mips/mips.c:1406
#, gcc-internal-format
msgid "%qE redeclared with conflicting %qs attributes"
-msgstr ""
+msgstr "%qE ãŒç«¶åˆã™ã‚‹ %qs 属性付ãã§å†å®£è¨€ã•ã‚Œã¾ã—ãŸ"
#: config/mips/mips.c:2917
#, gcc-internal-format
msgid "MIPS16 TLS"
-msgstr ""
+msgstr "MIPS16 TLS"
#: config/mips/mips.c:6408
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "cannot handle inconsistent calls to %qs"
-msgstr "`%s' ã¸ã®çŸ›ç›¾ã—ãŸå‘¼ã³å‡ºã—ã‚’æ•æ‰ã§ãã¾ã›ã‚“"
+msgstr "一貫ã—ã¦ã„ãªã„ %qs ã¸ã®å‘¼ã³å‡ºã—ã‚’å–り扱ãˆã¾ã›ã‚“"
#: config/mips/mips.c:9223
#, gcc-internal-format
msgid "the %<interrupt%> attribute requires a MIPS32r2 processor"
-msgstr ""
+msgstr "%<interrupt%> 属性㯠MIPS32r2 プロセッサãŒå¿…è¦ã§ã™"
#: config/mips/mips.c:9225
#, gcc-internal-format
msgid "the %<interrupt%> attribute requires %<-msoft-float%>"
-msgstr ""
+msgstr "%<interrupt%> 属性㯠%<-msoft-float%> ãŒå¿…è¦ã§ã™"
#: config/mips/mips.c:9227
#, gcc-internal-format
msgid "interrupt handlers cannot be MIPS16 functions"
-msgstr ""
+msgstr "割り込ã¿ãƒãƒ³ãƒ‰ãƒ©ãŒ MIPS16 関数ã§ã¯ã„ã‘ã¾ã›ã‚“"
#: config/mips/mips.c:13210
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "invalid argument to built-in function"
-msgstr "関数ã«å¯¾ã™ã‚‹å¼•æ•°ãŒå¤šã™ãŽã¾ã™"
+msgstr "組ã¿è¾¼ã¿é–¢æ•°ã¸ã®ç„¡åŠ¹ãªå¼•æ•°ã§ã™"
#: config/mips/mips.c:13451
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "built-in function %qE not supported for MIPS16"
-msgstr "組ã¿è¾¼ã¿é–¢æ•° `%s' ã¯ç¾åœ¨ã‚µãƒãƒ¼ãƒˆã•ã‚Œã¦ã„ã¾ã›ã‚“"
+msgstr "組ã¿è¾¼ã¿é–¢æ•° %qE 㯠MIPS16 用ã«ã¯ã‚µãƒãƒ¼ãƒˆã•ã‚Œã¦ã„ã¾ã›ã‚“"
#: config/mips/mips.c:14041
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "%qs does not support MIPS16 code"
-msgstr "%s 㯠%s ã‚’å—ã‘付ã‘ã¾ã›ã‚“"
+msgstr "%qs 㯠MIPS16 コードをサãƒãƒ¼ãƒˆã—ã¾ã›ã‚“"
#: config/mips/mips.c:15262
#, gcc-internal-format
@@ -22888,9 +22887,9 @@ msgid "hard-float MIPS16 code for ABIs other than o32 and o64"
msgstr ""
#: config/mips/mips.c:15404
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "CPU names must be lower case"
-msgstr "シンボルåã‚’å°æ–‡å­—ã¨ã™ã‚‹"
+msgstr "CPU åã¯å°æ–‡å­—ã§ãªã‘ã‚Œã°ã„ã‘ã¾ã›ã‚“"
#: config/mips/mips.c:15557
#, gcc-internal-format
@@ -22900,47 +22899,47 @@ msgstr ""
#: config/mips/mips.c:15573
#, gcc-internal-format
msgid "%<-march=%s%> is not compatible with the selected ABI"
-msgstr ""
+msgstr "%<-march=%s%> ã¯é¸æŠžã—㟠ABI ã¨ã¯äº’æ›æ€§ãŒã‚ã‚Šã¾ã›ã‚“"
#: config/mips/mips.c:15588
#, gcc-internal-format
msgid "%<-mgp64%> used with a 32-bit processor"
-msgstr ""
+msgstr "%<-mgp64%> ㌠32 ビットプロセッサã§ä½¿ç”¨ã•ã‚Œã¦ã„ã¾ã™"
#: config/mips/mips.c:15590
#, gcc-internal-format
msgid "%<-mgp32%> used with a 64-bit ABI"
-msgstr ""
+msgstr "%<-mgp32%> ㌠64 ビット ABI ã§ä½¿ç”¨ã•ã‚Œã¦ã„ã¾ã™"
#: config/mips/mips.c:15592
#, gcc-internal-format
msgid "%<-mgp64%> used with a 32-bit ABI"
-msgstr ""
+msgstr "%<-mgp64%> ㌠32 ビット ABI ã§ä½¿ç”¨ã•ã‚Œã¦ã„ã¾ã™"
#: config/mips/mips.c:15608 config/mips/mips.c:15610 config/mips/mips.c:15677
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "unsupported combination: %s"
-msgstr "サãƒãƒ¼ãƒˆã•ã‚Œã¦ã„ãªã„ãƒãƒ¼ã‚¸ãƒ§ãƒ³ã§ã™"
+msgstr "サãƒãƒ¼ãƒˆã•ã‚Œã¦ã„ãªã„組ã¿åˆã‚ã›ã§ã™: %s"
#: config/mips/mips.c:15614
#, gcc-internal-format
msgid "%<-mgp32%> and %<-mfp64%> can only be combined if the target supports the mfhc1 and mthc1 instructions"
-msgstr ""
+msgstr "%<-mgp32%> 㨠%<-mfp64%> ã¯ã‚¿ãƒ¼ã‚²ãƒƒãƒˆãŒ mfhc1 㨠mthc1 命令をサãƒãƒ¼ãƒˆã—ã¦ã„る時ã®ã¿çµ„ã¿åˆã‚ã›ã‚‹ã“ã¨ãŒã§ãã¾ã™"
#: config/mips/mips.c:15617
#, gcc-internal-format
msgid "%<-mgp32%> and %<-mfp64%> can only be combined when using the o32 ABI"
-msgstr ""
+msgstr "%<-mgp32%> 㨠%<-mfp64%> 㯠o32 ABI を使用ã—ã¦ã„る時ã®ã¿çµ„ã¿åˆã‚ã›ã‚‹ã“ã¨ãŒã§ãã¾ã™"
#: config/mips/mips.c:15671
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "the %qs architecture does not support branch-likely instructions"
-msgstr "ターゲット CPU 㯠THUMB 命令をサãƒãƒ¼ãƒˆã—ã¾ã›ã‚“"
+msgstr "%qs アーキテクãƒãƒ£ã¯ branch-likely 命令をサãƒãƒ¼ãƒˆã—ã¦ã„ã¾ã›ã‚“"
#: config/mips/mips.c:15711
#, gcc-internal-format
msgid "%<-mno-gpopt%> needs %<-mexplicit-relocs%>"
-msgstr ""
+msgstr "%<-mno-gpopt%> 㯠%<-mexplicit-relocs%> ãŒå¿…è¦ã§ã™"
#: config/mips/mips.c:15719 config/mips/mips.c:15722
#, gcc-internal-format
@@ -22950,32 +22949,32 @@ msgstr ""
#: config/mips/mips.c:15736
#, gcc-internal-format
msgid "%<-mips3d%> requires %<-mpaired-single%>"
-msgstr ""
+msgstr "%<-mips3d%> 㯠%<-mpaired-single%> ãŒå¿…è¦ã§ã™"
#: config/mips/mips.c:15745
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "%qs must be used with %qs"
-msgstr "-frepo 㯠-c 付ãã§ãªã‘ã‚Œã°ãªã‚Šã¾ã›ã‚“"
+msgstr "%qs 㯠%qs ã¨ä½µç”¨ã—ãªã‘ã‚Œã°ã„ã‘ã¾ã›ã‚“"
#: config/mips/mips.c:15752
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "the %qs architecture does not support paired-single instructions"
-msgstr "ターゲット CPU 㯠THUMB 命令をサãƒãƒ¼ãƒˆã—ã¾ã›ã‚“"
+msgstr "%qs アーキテクãƒãƒ£ã¯ paired-single 命令をサãƒãƒ¼ãƒˆã—ã¦ã„ã¾ã›ã‚“"
#: config/mips/mips.c:15758
#, gcc-internal-format
msgid "%qs requires a target that provides the %qs instruction"
-msgstr ""
+msgstr "%qs ã¯ã‚¿ãƒ¼ã‚²ãƒƒãƒˆãŒ %qs 命令をæä¾›ã—ã¦ã„ã‚‹ã“ã¨ãŒå¿…è¦ã¨ãªã‚Šã¾ã™"
#: config/mips/mips.c:15863
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "%qs requires branch-likely instructions"
-msgstr "ビットフィールド命令を使用ã™ã‚‹"
+msgstr "%qs 㯠branch-likely 命令ãŒå¿…è¦ã¨ãªã‚Šã¾ã™"
#: config/mips/mips.c:15867
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "the %qs architecture does not support the synci instruction"
-msgstr "ターゲット CPU 㯠THUMB 命令をサãƒãƒ¼ãƒˆã—ã¾ã›ã‚“"
+msgstr "%qs アーキテクãƒãƒ£ã¯ synci 命令をサãƒãƒ¼ãƒˆã—ã¦ã„ã¾ã›ã‚“"
#: config/mips/mips.c:16339
#, gcc-internal-format
@@ -22983,14 +22982,14 @@ msgid "mips16 function profiling"
msgstr "mips16 関数プロファイル"
#: config/mmix/mmix.c:286
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "-f%s not supported: ignored"
-msgstr "-mips%d ã¯ã‚µãƒãƒ¼ãƒˆã•ã‚Œã¾ã›ã‚“"
+msgstr "-f%s ã¯ã‚µãƒãƒ¼ãƒˆã•ã‚Œã¦ã„ã¾ã›ã‚“: 無視ã•ã‚Œã¾ã—ãŸ"
#: config/mmix/mmix.c:773
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "support for mode %qs"
-msgstr "モード `%s' ã«å¯¾ã™ã‚‹ãƒ‡ãƒ¼ã‚¿åž‹ãŒã‚ã‚Šã¾ã›ã‚“"
+msgstr ""
#: config/mmix/mmix.c:787
#, gcc-internal-format
@@ -23005,58 +23004,58 @@ msgstr ""
#: config/mmix/mmix.c:988
#, gcc-internal-format
msgid "MMIX Internal: Last named vararg would not fit in a register"
-msgstr ""
+msgstr "MMIX 内部: 最後ã®åå‰ä»˜ã vararg ãŒãƒ¬ã‚¸ã‚¹ã‚¿ã«é©åˆã—ã¾ã›ã‚“"
#: config/mmix/mmix.c:1597 config/mmix/mmix.c:1621 config/mmix/mmix.c:1737
#, gcc-internal-format
msgid "MMIX Internal: Bad register: %d"
-msgstr ""
+msgstr "MMIX 内部: é–“é•ã£ãŸãƒ¬ã‚¸ã‚¹ã‚¿ã§ã™: %d"
#. Presumably there's a missing case above if we get here.
#: config/mmix/mmix.c:1729
#, gcc-internal-format
msgid "MMIX Internal: Missing %qc case in mmix_print_operand"
-msgstr ""
+msgstr "MMIX 内部: mmix_print_operand 内㫠%qc case ãŒã‚ã‚Šã¾ã›ã‚“"
#: config/mmix/mmix.c:2015
#, gcc-internal-format
msgid "stack frame not a multiple of 8 bytes: %wd"
-msgstr ""
+msgstr "スタックフレーム㌠8 ãƒã‚¤ãƒˆã®å€æ•°ã§ã¯ã‚ã‚Šã¾ã›ã‚“: %wd"
#: config/mmix/mmix.c:2249
#, gcc-internal-format
msgid "stack frame not a multiple of octabyte: %wd"
-msgstr ""
+msgstr "スタックフレーム㌠8 ãƒã‚¤ãƒˆã®å€æ•°ã§ã¯ã‚ã‚Šã¾ã›ã‚“: %wd"
#: config/mmix/mmix.c:2533 config/mmix/mmix.c:2597
#, gcc-internal-format
msgid "MMIX Internal: %s is not a shiftable int"
-msgstr ""
+msgstr "MMIX 内部: %s ã¯ã‚·ãƒ•ãƒˆæ¼”ç®—å¯èƒ½ãª int ã§ã¯ã‚ã‚Šã¾ã›ã‚“"
#: config/mn10300/mn10300.c:145
#, gcc-internal-format
msgid "-mtune= expects mn10300, am33, am33-2, or am34"
-msgstr ""
+msgstr "-mtune= 㯠mn10300ã€am33ã€am33-2 ã¾ãŸã¯ am34 ãŒäºˆæœŸã•ã‚Œã¾ã™"
#: config/pa/pa.c:555
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "PIC code generation is not supported in the portable runtime model"
-msgstr "PIC コード生æˆã¯å¯æ¬å®Ÿè¡Œæ™‚モデルã§ã¯ã‚µãƒãƒ¼ãƒˆã•ã‚Œã¾ã›ã‚“\n"
+msgstr "PIC コード生æˆã¯ç§»æ¤æ€§ãŒã‚るランタイムモデル内ã§ã¯ã‚µãƒãƒ¼ãƒˆã•ã‚Œã¦ã„ã¾ã›ã‚“"
#: config/pa/pa.c:560
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "PIC code generation is not compatible with fast indirect calls"
-msgstr "PIC コード生æˆã¯é«˜é€Ÿé–“接呼ã³å‡ºã—ã¨ç›¸å®¹ã‚Œã¾ã›ã‚“\n"
+msgstr "PIC コード生æˆã¯é«˜é€Ÿé–“接呼ã³å‡ºã—ã¨ä½µç”¨ã§ãã¾ã›ã‚“"
#: config/pa/pa.c:565
#, gcc-internal-format
msgid "-g is only supported when using GAS on this processor,"
-msgstr "-g ã¯ã“ã®ãƒ—ロセッサã§ã¯ GAS を使用ã™ã‚‹æ™‚ã ã‘サãƒãƒ¼ãƒˆã•ã‚Œã¾ã™"
+msgstr "-g ã¯ã“ã®ãƒ—ロセッサã§ã¯ GAS を使用ã™ã‚‹æ™‚ã ã‘サãƒãƒ¼ãƒˆã•ã‚Œã¾ã™ã€‚"
#: config/pa/pa.c:566
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "-g option disabled"
-msgstr "-g オプションを無効化ã—ã¾ã—ãŸã€‚"
+msgstr "-g オプションãŒç„¡åŠ¹ã«ãªã‚Šã¾ã—ãŸ"
#: config/pa/pa.c:8579
#, gcc-internal-format
@@ -23071,7 +23070,7 @@ msgstr ""
#: config/picochip/picochip.c:438
#, gcc-internal-format
msgid "invalid AE type specified (%s)"
-msgstr ""
+msgstr "無効㪠AE åž‹ãŒæŒ‡å®šã•ã‚Œã¦ã„ã¾ã™ (%s)"
#: config/picochip/picochip.c:461
#, gcc-internal-format
@@ -23116,17 +23115,17 @@ msgstr ""
#: config/picochip/picochip.c:2316 config/picochip/picochip.c:2376
#, gcc-internal-format
msgid "%s: at least one operand can%'t be handled"
-msgstr ""
+msgstr "%s: 一ã¤ä»¥ä¸Šã®è¢«æ¼”ç®—å­ã‚’å–り扱ãˆã¾ã›ã‚“"
#: config/picochip/picochip.c:2457
#, gcc-internal-format
msgid "unknown short branch in %s (type %d)"
-msgstr ""
+msgstr "%s 内ã«ä¸æ˜ŽãªçŸ­ã„分å²ãŒã‚ã‚Šã¾ã™ (åž‹ %d)"
#: config/picochip/picochip.c:2494
#, gcc-internal-format
msgid "unknown long branch in %s (type %d)"
-msgstr ""
+msgstr "%s 内ã«ä¸æ˜Žãªé•·ã„分å²ãŒã‚ã‚Šã¾ã™ (åž‹ %d)"
#: config/picochip/picochip.c:2534 config/picochip/picochip.c:2602
#, gcc-internal-format
@@ -23141,23 +23140,23 @@ msgstr ""
#: config/picochip/picochip.c:3439
#, gcc-internal-format
msgid "too many ALU instructions emitted (%d)"
-msgstr ""
+msgstr "多ã™ãŽã‚‹ ALU 命令ãŒç™ºè¡Œã•ã‚Œã¾ã—㟠(%d)"
#: config/picochip/picochip.c:4071 config/picochip/picochip.c:4164
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "%s: Second source operand is not a constant"
-msgstr "#line ã®å¾Œã®äºŒã¤ç›®ã®ãƒˆãƒ¼ã‚¯ãƒ³ãŒæ–‡å­—列ã§ã¯ã‚ã‚Šã¾ã›ã‚“"
+msgstr ""
#: config/picochip/picochip.c:4074 config/picochip/picochip.c:4125
#: config/picochip/picochip.c:4167
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "%s: Third source operand is not a constant"
-msgstr "è¦æ±‚ã•ã‚ŒãŸã‚¢ãƒ©ã‚¤ãƒ³ãƒ¡ãƒ³ãƒˆãŒå®šæ•°ã§ã¯ã‚ã‚Šã¾ã›ã‚“"
+msgstr ""
#: config/picochip/picochip.c:4128
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "%s: Fourth source operand is not a constant"
-msgstr "出力オペランド㌠`asm' 内ã§å®šæ•°ã§ã™"
+msgstr ""
#: config/picochip/picochip.c:4423
#, gcc-internal-format
@@ -23167,22 +23166,22 @@ msgstr ""
#: config/rs6000/host-darwin.c:60
#, gcc-internal-format
msgid "Segmentation Fault (code)"
-msgstr ""
+msgstr "セグメンテーションé•å (コード)"
#: config/rs6000/host-darwin.c:130
#, gcc-internal-format
msgid "Segmentation Fault"
-msgstr ""
+msgstr "セグメンテーションé•å"
#: config/rs6000/host-darwin.c:144
#, gcc-internal-format
msgid "While setting up signal stack: %m"
-msgstr ""
+msgstr "シグナルスタックをセットアップ中: %m"
#: config/rs6000/host-darwin.c:150
#, gcc-internal-format
msgid "While setting up signal handler: %m"
-msgstr ""
+msgstr "シグナルãƒãƒ³ãƒ‰ãƒ©ã‚’セットアップ中: %m"
#. Handle the machine specific pragma longcall. Its syntax is
#.
@@ -23194,64 +23193,64 @@ msgstr ""
#. whether or not new function declarations receive a longcall
#. attribute by default.
#: config/rs6000/rs6000-c.c:51
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "ignoring malformed #pragma longcall"
-msgstr "#pragma %s を無視ã—ã¾ã™"
+msgstr "é–“é•ã£ãŸå½¢å¼ã® #pragma longcall を無視ã—ã¦ã„ã¾ã™"
#: config/rs6000/rs6000-c.c:64
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "missing open paren"
-msgstr "Code 属性を欠ã„ã¦ã„ã¾ã™"
+msgstr "é–‹ãå°æ‹¬å¼§ãŒã‚ã‚Šã¾ã›ã‚“"
#: config/rs6000/rs6000-c.c:66
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "missing number"
-msgstr "åå‰ã‚’欠ã„ã¦ã„ã¾ã™"
+msgstr "数値ãŒã‚ã‚Šã¾ã›ã‚“"
#: config/rs6000/rs6000-c.c:68
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "missing close paren"
-msgstr "クラスåを欠ã„ã¦ã„ã¾ã™"
+msgstr "é–‰ã˜ã‚‹å°æ‹¬å¼§ãŒã‚ã‚Šã¾ã›ã‚“"
#: config/rs6000/rs6000-c.c:71
#, gcc-internal-format
msgid "number must be 0 or 1"
-msgstr ""
+msgstr "数値㯠0 ã¾ãŸã¯ 1 ã§ãªã‘ã‚Œã°ã„ã‘ã¾ã›ã‚“"
#: config/rs6000/rs6000-c.c:74
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "junk at end of #pragma longcall"
-msgstr "#pragma map ã®çµ‚ã‚Šã«ã‚´ãƒŸãŒã‚ã‚Šã¾ã™"
+msgstr "#pragma longcall ã®æœ«å°¾ã«ã‚´ãƒŸãŒã‚ã‚Šã¾ã™"
#: config/rs6000/rs6000-c.c:3267
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "%s only accepts %d arguments"
-msgstr "`%s' 㯠0 ã‹ 2 個ã®å¼•æ•°ã—ã‹ã¨ã‚Šã¾ã›ã‚“"
+msgstr "%s 㯠%d 個ã®å¼•æ•°ã®ã¿å—ã‘付ã‘ã¾ã™"
#: config/rs6000/rs6000-c.c:3272
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "%s only accepts 1 argument"
-msgstr "#%s ã«å¼•æ•°ãŒã‚ã‚Šã¾ã›ã‚“"
+msgstr "%s 㯠1 個ã®å¼•æ•°ã®ã¿å—ã‘付ã‘ã¾ã™"
#: config/rs6000/rs6000-c.c:3277
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "%s only accepts 2 arguments"
-msgstr "`%s' 㯠0 ã‹ 2 個ã®å¼•æ•°ã—ã‹ã¨ã‚Šã¾ã›ã‚“"
+msgstr "%s 㯠2 ã“ã®å¼•æ•°ã®ã¿å—ã‘付ã‘ã¾ã™"
#: config/rs6000/rs6000-c.c:3342
#, gcc-internal-format
msgid "vec_extract only accepts 2 arguments"
-msgstr ""
+msgstr "vec_extract 㯠2 個ã®å¼•æ•°ã®ã¿å—ã‘付ã‘ã¾ã™"
#: config/rs6000/rs6000-c.c:3418
#, gcc-internal-format
msgid "vec_insert only accepts 3 arguments"
-msgstr ""
+msgstr "vec_insert 㯠3 個ã®å¼•æ•°ã®ã¿å—ã‘付ã‘ã¾ã™"
#: config/rs6000/rs6000-c.c:3521
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "passing arg %d of %qE discards qualifiers frompointer target type"
-msgstr "キャストã«ã‚ˆã£ã¦ãƒã‚¤ãƒ³ã‚¿ãŒç¤ºã™åž‹ã‹ã‚‰ä¿®é£¾å­ãŒåˆ‡ã‚Šæ¨ã¦ã‚‰ã‚Œã¾ã™"
+msgstr ""
#: config/rs6000/rs6000-c.c:3564
#, gcc-internal-format
@@ -23261,27 +23260,27 @@ msgstr ""
#: config/rs6000/rs6000.c:2516
#, gcc-internal-format
msgid "-mrecip requires -ffinite-math or -ffast-math"
-msgstr ""
+msgstr "-mrecip 㯠-ffinite-math ã¾ãŸã¯ -ffast-math ãŒå¿…è¦ã¨ãªã‚Šã¾ã™"
#: config/rs6000/rs6000.c:2518
#, gcc-internal-format
msgid "-mrecip requires -fno-trapping-math or -ffast-math"
-msgstr ""
+msgstr "-mrecip 㯠-fno-trapping-math ã¾ãŸã¯ -ffast-math ãŒå¿…è¦ã¨ãªã‚Šã¾ã™"
#: config/rs6000/rs6000.c:2520
#, gcc-internal-format
msgid "-mrecip requires -freciprocal-math or -ffast-math"
-msgstr ""
+msgstr "-mrecip 㯠-freciprocal-math ã¾ãŸã¯ -ffast-math ãŒå¿…è¦ã¨ãªã‚Šã¾ã™"
#: config/rs6000/rs6000.c:2614
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "-m64 requires PowerPC64 architecture, enabling"
-msgstr "PowerPC64 アーキテクãƒãƒ£ã§ãªã„㨠-maix64 を有効ã«ã¯ã§ãã¾ã›ã‚“"
+msgstr ""
#: config/rs6000/rs6000.c:2739
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "AltiVec not supported in this target"
-msgstr "スタック制é™ã¯ã“ã®ã‚¿ãƒ¼ã‚²ãƒƒãƒˆã§ã¯å®Ÿè£…ã•ã‚Œã¦ã„ã¾ã›ã‚“"
+msgstr ""
#: config/rs6000/rs6000.c:2741
#, gcc-internal-format
@@ -23291,70 +23290,70 @@ msgstr ""
#: config/rs6000/rs6000.c:2768
#, gcc-internal-format
msgid "-mmultiple is not supported on little endian systems"
-msgstr "-mmultiple ã¯ãƒªãƒˆãƒ«ã‚¨ãƒ³ãƒ‡ã‚£ã‚¢ãƒ³ã‚·ã‚¹ãƒ†ãƒ ä¸Šã§ã¯å—ã‘入れられã¾ã›ã‚“"
+msgstr "-mmultiple ã¯ãƒªãƒˆãƒ«ã‚¨ãƒ³ãƒ‡ã‚£ã‚¢ãƒ³ã‚·ã‚¹ãƒ†ãƒ ä¸Šã§ã¯ã‚µãƒãƒ¼ãƒˆã•ã‚Œã¦ã„ã¾ã›ã‚“"
#: config/rs6000/rs6000.c:2775
#, gcc-internal-format
msgid "-mstring is not supported on little endian systems"
-msgstr "-mstring ã¯ãƒªãƒˆãƒ«ã‚¨ãƒ³ãƒ‡ã‚£ã‚¢ãƒ³ã‚·ã‚¹ãƒ†ãƒ ä¸Šã§ã¯å—ã‘入れられã¾ã›ã‚“"
+msgstr "-mstring ã¯ãƒªãƒˆãƒ«ã‚¨ãƒ³ãƒ‡ã‚£ã‚¢ãƒ³ã‚·ã‚¹ãƒ†ãƒ ä¸Šã§ã¯ã‚µãƒãƒ¼ãƒˆã•ã‚Œã¦ã„ã¾ã›ã‚“"
#: config/rs6000/rs6000.c:2881
#, gcc-internal-format
msgid "unknown vectorization library ABI type (%s) for -mveclibabi= switch"
-msgstr ""
+msgstr "-mveclibabi= スイッãƒç”¨ã®ä¸æ˜Žãªãƒ™ã‚¯ãƒˆãƒ«ãƒ©ã‚¤ãƒ–ラリ ABI åž‹ (%s) ã§ã™"
#: config/rs6000/rs6000.c:2893
#, gcc-internal-format
msgid "target attribute or pragma changes long double size"
-msgstr ""
+msgstr "target 属性ã¾ãŸã¯ pragma ㌠long double ã®ã‚µã‚¤ã‚ºã‚’変更ã—ã¾ã™"
#: config/rs6000/rs6000.c:2914 config/rs6000/rs6000.c:2929
#, gcc-internal-format
msgid "target attribute or pragma changes AltiVec ABI"
-msgstr ""
+msgstr "target 属性ã¾ãŸã¯ pragma ㌠AltiVec ABI を変更ã—ã¾ã™"
#: config/rs6000/rs6000.c:2946
#, gcc-internal-format
msgid "target attribute or pragma changes darwin64 ABI"
-msgstr ""
+msgstr "target 属性ã¾ãŸã¯ pragma ㌠darwin64 ABI を変更ã—ã¾ã™"
#: config/rs6000/rs6000.c:2987
#, gcc-internal-format
msgid "target attribute or pragma changes SPE ABI"
-msgstr ""
+msgstr "target 属性ã¾ãŸã¯ pragma ㌠SPE ABI を変更ã—ã¾ã™"
#: config/rs6000/rs6000.c:3309
#, gcc-internal-format
msgid "target attribute or pragma changes single precision floating point"
-msgstr ""
+msgstr "target 属性ã¾ãŸã¯ pragma ãŒå˜ç²¾åº¦æµ®å‹•å°æ•°ç‚¹ã‚’変更ã—ã¾ã™"
#: config/rs6000/rs6000.c:3312
#, gcc-internal-format
msgid "target attribute or pragma changes double precision floating point"
-msgstr ""
+msgstr "target 属性ã¾ãŸã¯ pragma ãŒå€ç²¾åº¦æµ®å‹•å°æ•°ç‚¹ã‚’変更ã—ã¾ã™"
#: config/rs6000/rs6000.c:3356
#, gcc-internal-format
msgid "unknown option for -mrecip=%s"
-msgstr ""
+msgstr "-mrecip=%s 用ã®ä¸æ˜Žãªã‚ªãƒ—ションã§ã™"
#: config/rs6000/rs6000.c:3823
#, gcc-internal-format
msgid "unknown -m%s= option specified: '%s'"
-msgstr ""
+msgstr "ä¸æ˜Žãª -m%s= オプションãŒæŒ‡å®šã•ã‚Œã¾ã—ãŸ: '%s'"
#: config/rs6000/rs6000.c:3858
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "unknown value %s for -mfpu"
-msgstr "-mcpu スイッãƒã«ã¨ã£ã¦ã®ä¸æ­£ãªå€¤ `%s'"
+msgstr "-mfpu 用ã®ä¸æ˜Žãªå€¤ %s ã§ã™"
#: config/rs6000/rs6000.c:4245
#, gcc-internal-format
msgid "invalid option for -mcmodel: '%s'"
-msgstr ""
+msgstr "-mcmodel 用ã®ç„¡åŠ¹ãªã‚ªãƒ—ションã§ã™: '%s'"
#: config/rs6000/rs6000.c:4375
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "unknown -mdebug-%s switch"
msgstr "ä¸æ˜Žãª -mdebug-%s スイッãƒã§ã™"
@@ -23366,72 +23365,72 @@ msgstr ""
#: config/rs6000/rs6000.c:4461
#, gcc-internal-format
msgid "using darwin64 ABI"
-msgstr ""
+msgstr "darwin64 ABI を使用ã—ã¦ã„ã¾ã™"
#: config/rs6000/rs6000.c:4466
#, gcc-internal-format
msgid "using old darwin ABI"
-msgstr ""
+msgstr "å¤ã„ darwin ABI を使用ã—ã¦ã„ã¾ã™"
#: config/rs6000/rs6000.c:4473
#, gcc-internal-format
msgid "using IBM extended precision long double"
-msgstr ""
+msgstr "IBM 拡張精度 long double を使用ã—ã¦ã„ã¾ã™"
#: config/rs6000/rs6000.c:4479
#, gcc-internal-format
msgid "using IEEE extended precision long double"
-msgstr ""
+msgstr "IEEE 拡張精度 long double を使用ã—ã¦ã„ã¾ã™"
#: config/rs6000/rs6000.c:4484
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "unknown ABI specified: '%s'"
-msgstr "ä¸æ˜Žãªãƒžã‚·ãƒ³ãƒ¢ãƒ¼ãƒ‰ `%s'"
+msgstr "ä¸æ˜Žãª ABI ãŒæŒ‡å®šã•ã‚Œã¾ã—ãŸ: '%s'"
#: config/rs6000/rs6000.c:4493
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "bad value (%s) for -mcpu"
-msgstr "-mcpu スイッãƒã«ã¨ã£ã¦ã®ä¸æ­£ãªå€¤ `%s'"
+msgstr "-mcpu 用ã®é–“é•ã£ãŸå€¤ %s ã§ã™"
#: config/rs6000/rs6000.c:4500
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "bad value (%s) for -mtune"
-msgstr "-mcpu スイッãƒã«ã¨ã£ã¦ã®ä¸æ­£ãªå€¤ `%s'"
+msgstr "-mtune 用ã®é–“é•ã£ãŸå€¤ %s ã§ã™"
#: config/rs6000/rs6000.c:4511
#, gcc-internal-format
msgid "unknown -mtraceback arg %qs; expecting %<full%>, %<partial%> or %<none%>"
-msgstr ""
+msgstr "ä¸æ˜Žãª -mtraceback 引数 %qs ã§ã™ã€‚%<full%>ã€%<partial%> ã¾ãŸã¯ %<none%> ãŒäºˆæœŸã•ã‚Œã¾ã™"
#: config/rs6000/rs6000.c:4525
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "invalid option for -mfloat-gprs: '%s'"
-msgstr "無効ãªã‚ªãƒ—ション `-mshort-data-%s'"
+msgstr "-mfloat-gprs 用ã®ç„¡åŠ¹ãªã‚ªãƒ—ションã§ã™: '%s'"
#: config/rs6000/rs6000.c:4535
#, gcc-internal-format
msgid "unknown switch -mlong-double-%s"
-msgstr ""
+msgstr "ä¸æ˜Žãªã‚¹ã‚¤ãƒƒãƒ -mlong-double-%s ã§ã™"
#: config/rs6000/rs6000.c:4556
#, gcc-internal-format
msgid "-malign-power is not supported for 64-bit Darwin; it is incompatible with the installed C and C++ libraries"
-msgstr ""
+msgstr "-malign-power 㯠64 ビット Darwin ã§ã¯ã‚µãƒãƒ¼ãƒˆã•ã‚Œã¦ã„ã¾ã›ã‚“。インストールã•ã‚Œã¦ã„ã‚‹ C ãŠã‚ˆã³ C++ ライブラリã¨äº’æ›æ€§ãŒã‚ã‚Šã¾ã›ã‚“"
#: config/rs6000/rs6000.c:4564
#, gcc-internal-format
msgid "unknown -malign-XXXXX option specified: '%s'"
-msgstr ""
+msgstr "ä¸æ˜Žãª -malign-XXXXX オプションãŒæŒ‡å®šã•ã‚Œã¾ã—ãŸ: '%s'"
#: config/rs6000/rs6000.c:4571
#, gcc-internal-format
msgid "-msingle-float option equivalent to -mhard-float"
-msgstr ""
+msgstr "-msingle-float オプション㯠-mhard-float ã¨ç­‰ä¾¡ã§ã™"
#: config/rs6000/rs6000.c:4587
#, gcc-internal-format
msgid "-msimple-fpu option ignored"
-msgstr ""
+msgstr "-msimple-fpu オプションã¯ç„¡è¦–ã•ã‚Œã¾ã—ãŸ"
#: config/rs6000/rs6000.c:7846
#, gcc-internal-format
@@ -23456,47 +23455,47 @@ msgstr ""
#: config/rs6000/rs6000.c:9796
#, gcc-internal-format
msgid "internal error: builtin function to %s already processed"
-msgstr ""
+msgstr "内部エラー: %s ã¸ã®çµ„ã¿è¾¼ã¿é–¢æ•°ã¯æ—¢ã«å‡¦ç†ã•ã‚Œã¦ã„ã¾ã™"
#: config/rs6000/rs6000.c:10743
#, gcc-internal-format
msgid "argument 1 must be a 5-bit signed literal"
-msgstr ""
+msgstr "第一引数㯠5 ビット符å·ä»˜ãリテラルã§ãªã‘ã‚Œã°ã„ã‘ã¾ã›ã‚“"
#: config/rs6000/rs6000.c:10846 config/rs6000/rs6000.c:11820
#, gcc-internal-format
msgid "argument 2 must be a 5-bit unsigned literal"
-msgstr ""
+msgstr "第二引数㯠5 ビット符å·ç„¡ã—リテラルã§ãªã‘ã‚Œã°ã„ã‘ã¾ã›ã‚“"
#: config/rs6000/rs6000.c:10885
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "argument 1 of __builtin_altivec_predicate must be a constant"
-msgstr "`__builtin_eh_return_regno' ã®å¼•æ•°ã¯å®šæ•°ã§ãªã‘ã‚Œã°ãªã‚Šã¾ã›ã‚“"
+msgstr "__builtin_altivec_predicate ã®ç¬¬ä¸€å¼•æ•°ã¯å®šæ•°ã§ãªã‘ã‚Œã°ã„ã‘ã¾ã›ã‚“"
#: config/rs6000/rs6000.c:10937
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "argument 1 of __builtin_altivec_predicate is out of range"
-msgstr "`__builtin_args_info' ã®å¼•æ•°ãŒç¯„囲外ã§ã™"
+msgstr "__builtin_altivec_predicate ã®ç¬¬ä¸€å¼•æ•°ãŒç¯„囲外ã§ã™"
#: config/rs6000/rs6000.c:11194
#, gcc-internal-format
msgid "argument 3 must be a 4-bit unsigned literal"
-msgstr ""
+msgstr "第三引数㯠4 ビット符å·ç„¡ã—リテラルã§ãªã‘ã‚Œã°ã„ã‘ã¾ã›ã‚“"
#: config/rs6000/rs6000.c:11212
#, gcc-internal-format
msgid "argument 3 must be a 2-bit unsigned literal"
-msgstr ""
+msgstr "第三引数㯠2 ビット符å·ç„¡ã—リテラルã§ãªã‘ã‚Œã°ã„ã‘ã¾ã›ã‚“"
#: config/rs6000/rs6000.c:11224
#, gcc-internal-format
msgid "argument 3 must be a 1-bit unsigned literal"
-msgstr ""
+msgstr "第三引数㯠1 ビット符å·ç„¡ã—リテラルã§ãªã‘ã‚Œã°ã„ã‘ã¾ã›ã‚“"
#: config/rs6000/rs6000.c:11395
#, gcc-internal-format
msgid "argument to %qs must be a 2-bit unsigned literal"
-msgstr ""
+msgstr "%qs ã¸ã®å¼•æ•°ã¯ 2 ビット符å·ç„¡ã—リテラルã§ãªã‘ã‚Œã°ã„ã‘ã¾ã›ã‚“"
#: config/rs6000/rs6000.c:11539
#, gcc-internal-format
@@ -23506,47 +23505,47 @@ msgstr ""
#: config/rs6000/rs6000.c:11630
#, gcc-internal-format
msgid "argument to dss must be a 2-bit unsigned literal"
-msgstr ""
+msgstr "dss ã¸ã®å¼•æ•°ã¯ 2 ビット符å·ç„¡ã—リテラルã§ãªã‘ã‚Œã°ã„ã‘ã¾ã›ã‚“"
#: config/rs6000/rs6000.c:11940
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "argument 1 of __builtin_paired_predicate must be a constant"
-msgstr "`__builtin_args_info' ã®å¼•æ•°ã¯å®šæ•°ã§ãªã‘ã‚Œã°ãªã‚Šã¾ã›ã‚“"
+msgstr "__builtin_paired_predicate ã®ç¬¬ä¸€å¼•æ•°ã¯å®šæ•°ã§ãªã‘ã‚Œã°ã„ã‘ã¾ã›ã‚“"
#: config/rs6000/rs6000.c:11987
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "argument 1 of __builtin_paired_predicate is out of range"
-msgstr "`__builtin_args_info' ã®å¼•æ•°ãŒç¯„囲外ã§ã™"
+msgstr "__builtin_paired_predicate ã®ç¬¬ä¸€å¼•æ•°ãŒç¯„囲外ã§ã™"
#: config/rs6000/rs6000.c:12012
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "argument 1 of __builtin_spe_predicate must be a constant"
-msgstr "`__builtin_eh_return_regno' ã®å¼•æ•°ã¯å®šæ•°ã§ãªã‘ã‚Œã°ãªã‚Šã¾ã›ã‚“"
+msgstr "__builtin_spe_predicate ã®ç¬¬ä¸€å¼•æ•°ã¯å®šæ•°ã§ãªã‘ã‚Œã°ã„ã‘ã¾ã›ã‚“"
#: config/rs6000/rs6000.c:12084
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "argument 1 of __builtin_spe_predicate is out of range"
-msgstr "`__builtin_args_info' ã®å¼•æ•°ãŒç¯„囲外ã§ã™"
+msgstr "__builtin_spe_predicate ã®ç¬¬ä¸€å¼•æ•°ãŒç¯„囲外ã§ã™"
#: config/rs6000/rs6000.c:13450
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "internal error: builtin function %s had no type"
-msgstr "内部エラー - 未定義型ã®ä½¿ç”¨ã§ã™"
+msgstr "内部エラー: 組ã¿è¾¼ã¿é–¢æ•° %s ã«åž‹ãŒã‚ã‚Šã¾ã›ã‚“"
#: config/rs6000/rs6000.c:13457
#, gcc-internal-format
msgid "internal error: builtin function %s had an unexpected return type %s"
-msgstr ""
+msgstr "内部エラー: 組ã¿è¾¼ã¿é–¢æ•° %s ãŒäºˆæœŸã—ãªã„戻り型 %s ã‚’æŒã£ã¦ã„ã¾ã™"
#: config/rs6000/rs6000.c:13470
#, gcc-internal-format
msgid "internal error: builtin function %s, argument %d had unexpected argument type %s"
-msgstr ""
+msgstr "内部エラー: 組ã¿è¾¼ã¿é–¢æ•° %s ã®ç¬¬ %d 引数ãŒäºˆæœŸã—ãªã„引数型 %s ã‚’æŒã£ã¦ã„ã¾ã™"
#: config/rs6000/rs6000.c:19350
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "stack frame too large"
-msgstr "%s ã¯å¤§ãã™ãŽã¾ã™"
+msgstr "スタックフレームãŒå¤§ãã™ãŽã¾ã™"
#: config/rs6000/rs6000.c:19874
#, gcc-internal-format
@@ -23561,126 +23560,126 @@ msgstr ""
#: config/rs6000/rs6000.c:24784
#, gcc-internal-format
msgid "use of %<long double%> in AltiVec types is invalid"
-msgstr ""
+msgstr "AltiVec 型内ã§ã® %<long double%> ã®ä½¿ç”¨ã¯ç„¡åŠ¹ã§ã™"
#: config/rs6000/rs6000.c:24786
#, gcc-internal-format
msgid "use of boolean types in AltiVec types is invalid"
-msgstr ""
+msgstr "AltiVec 型内ã§ã®çœŸå½åž‹ (boolean) ã®ä½¿ç”¨ã¯ç„¡åŠ¹ã§ã™"
#: config/rs6000/rs6000.c:24788
#, gcc-internal-format
msgid "use of %<complex%> in AltiVec types is invalid"
-msgstr ""
+msgstr "AltiVec 型内ã§ã® %<complex%> ã®ä½¿ç”¨ã¯ç„¡åŠ¹ã§ã™"
#: config/rs6000/rs6000.c:24790
#, gcc-internal-format
msgid "use of decimal floating point types in AltiVec types is invalid"
-msgstr ""
+msgstr "AltiVec 型内ã§ã®å進浮動å°æ•°ç‚¹ã®ä½¿ç”¨ã¯ç„¡åŠ¹ã§ã™"
#: config/rs6000/rs6000.c:24796
#, gcc-internal-format
msgid "use of %<long%> in AltiVec types is invalid for 64-bit code without -mvsx"
-msgstr ""
+msgstr "-mvsx ç„¡ã—㧠64 ビットコード用㮠AltiVec 型内ã§ã® %<long%> ã®ä½¿ç”¨ã¯ç„¡åŠ¹ã§ã™"
#: config/rs6000/rs6000.c:24799
#, gcc-internal-format
msgid "use of %<long%> in AltiVec types is deprecated; use %<int%>"
-msgstr ""
+msgstr "AltiVec 型内ã§ã® %<long%> ã®ä½¿ç”¨ã¯å»ƒæ­¢ã•ã‚Œã¾ã—ãŸã€‚%<int%> を使用ã—ã¦ãã ã•ã„"
#: config/rs6000/rs6000.c:24804
#, gcc-internal-format
msgid "use of %<long long%> in AltiVec types is invalid without -mvsx"
-msgstr ""
+msgstr "-mvsx ç„¡ã—㧠AltiVec 型内ã§ã® %<long long%> ã®ä½¿ç”¨ã¯ç„¡åŠ¹ã§ã™"
#: config/rs6000/rs6000.c:24807
#, gcc-internal-format
msgid "use of %<double%> in AltiVec types is invalid without -mvsx"
-msgstr ""
+msgstr "-mvsx ç„¡ã—㧠AltiVec 型内ã§ã® %<double%> ã®ä½¿ç”¨ã¯ç„¡åŠ¹ã§ã™"
#: config/rs6000/rs6000.c:27263
#, gcc-internal-format
msgid "emitting microcode insn %s\t[%s] #%d"
-msgstr ""
+msgstr "マイクロコード命令 %s\t[%s] #%d を発行ã—ã¦ã„ã¾ã™"
#: config/rs6000/rs6000.c:27267
#, gcc-internal-format
msgid "emitting conditional microcode insn %s\t[%s] #%d"
-msgstr ""
+msgstr "æ¡ä»¶ä»˜ãマイクロコード命令 %s\t[%s] #%d を発行ã—ã¦ã„ã¾ã™"
#: config/rs6000/rs6000.c:27470
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "invalid cpu \"%s\" for %s\"%s\"%s"
-msgstr "%2$s ã«å¯¾ã™ã‚‹å¼•æ•° %1$s ãŒé–“é•ã£ã¦ã„ã¾ã™"
+msgstr "CPU \"%s\" 㯠%s\"%s\"%s 用ã«ã¯ç„¡åŠ¹ã§ã™"
#: config/rs6000/rs6000.c:27473
#, gcc-internal-format
msgid "%s\"%s\"%s is not allowed"
-msgstr ""
+msgstr "%s\"%s\"%s ã¯è¨±å¯ã•ã‚Œã¦ã„ã¾ã›ã‚“"
#: config/rs6000/rs6000.c:27475
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "%s\"%s\"%s is invalid"
-msgstr "-mcpu=%s 㯠-mips%d をサãƒãƒ¼ãƒˆã—ã¾ã›ã‚“"
+msgstr "%s\"%s\"%s ã¯ç„¡åŠ¹ã§ã™"
#: config/rs6000/aix43.h:32 config/rs6000/aix51.h:32 config/rs6000/aix52.h:32
#: config/rs6000/aix53.h:32 config/rs6000/aix61.h:32
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "-maix64 and POWER architecture are incompatible"
-msgstr "-maix64 㨠POWER アーキテクãƒãƒ£ã¨ã§ã¯äº’æ›æ€§ãŒã‚ã‚Šã¾ã›ã‚“"
+msgstr "-maix64 㨠POWER アーキテクãƒãƒ£ã¯äº’æ›æ€§ãŒã‚ã‚Šã¾ã›ã‚“"
#: config/rs6000/aix43.h:37 config/rs6000/aix51.h:37 config/rs6000/aix52.h:37
#: config/rs6000/aix53.h:37 config/rs6000/aix61.h:37
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "-maix64 requires PowerPC64 architecture remain enabled"
-msgstr "PowerPC64 アーキテクãƒãƒ£ã§ãªã„㨠-maix64 を有効ã«ã¯ã§ãã¾ã›ã‚“"
+msgstr "-maix64 㯠PowerPC64 アーキテクãƒãƒ£ãŒæœ‰åŠ¹ã®ã¾ã¾æ®‹ã•ã‚Œã¦ã„ã‚‹ã“ã¨ãŒå¿…è¦ã§ã™"
#: config/rs6000/aix43.h:43 config/rs6000/aix52.h:43 config/rs6000/aix53.h:43
#: config/rs6000/aix61.h:43
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "soft-float and long-double-128 are incompatible"
-msgstr "-mrelocatable 㨠-mcall-%s ã¨ã¯å…±å­˜ã§ãã¾ã›ã‚“"
+msgstr "soft-float 㨠long-double-128 ã¯äº’æ›æ€§ãŒã‚ã‚Šã¾ã›ã‚“"
#: config/rs6000/aix43.h:47 config/rs6000/aix51.h:41 config/rs6000/aix52.h:47
#: config/rs6000/aix53.h:47 config/rs6000/aix61.h:47
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "-maix64 required: 64-bit computation with 32-bit addressing not yet supported"
-msgstr "-maix64 è¦æ±‚: 32 bit アドレシング下㮠64 bit 計算ã¯ã¾ã åˆ©ç”¨ã§ãã¾ã›ã‚“"
+msgstr "-maix64 ãŒå¿…è¦ã§ã™: 32 ビットアドレスã§ã® 64 ビット計算ã¯ã¾ã ã‚µãƒãƒ¼ãƒˆã•ã‚Œã¦ã„ã¾ã›ã‚“"
#: config/rs6000/e500.h:40
#, gcc-internal-format
msgid "AltiVec and E500 instructions cannot coexist"
-msgstr ""
+msgstr "AltiVec 㨠E500 命令ã¯åŒæ™‚ã«å­˜åœ¨ã§ãã¾ã›ã‚“"
#: config/rs6000/e500.h:42
#, gcc-internal-format
msgid "VSX and E500 instructions cannot coexist"
-msgstr ""
+msgstr "VSX 㨠E500 命令ã¯åŒæ™‚ã«å­˜åœ¨ã§ãã¾ã›ã‚“"
#: config/rs6000/e500.h:44
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "64-bit E500 not supported"
-msgstr "-pipe ã¯å®Ÿè£…ã•ã‚Œã¦ã„ã¾ã›ã‚“"
+msgstr "64 ビット E500 ã¯ã‚µãƒãƒ¼ãƒˆã•ã‚Œã¦ã„ã¾ã›ã‚“"
#: config/rs6000/e500.h:46
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "E500 and FPRs not supported"
-msgstr "MCU `%s' ã¯ã‚µãƒãƒ¼ãƒˆã•ã‚Œã¾ã›ã‚“"
+msgstr "E500 㨠FPR ã¯ã‚µãƒãƒ¼ãƒˆã•ã‚Œã¦ã„ã¾ã›ã‚“"
#: config/rs6000/eabispe.h:41 config/rs6000/linuxspe.h:41
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "-m64 not supported in this configuration"
-msgstr "%s ã¯ã“ã®ã‚³ãƒ³ãƒ•ã‚£ã‚®ãƒ¥ãƒ¬ãƒ¼ã‚·ãƒ§ãƒ³ã§ã¯ã‚µãƒãƒ¼ãƒˆã•ã‚Œã¾ã›ã‚“"
+msgstr "-m64 ã¯ã“ã®è¨­å®šã§ã¯ã‚µãƒãƒ¼ãƒˆã•ã‚Œã¦ã„ã¾ã›ã‚“"
#: config/rs6000/linux64.h:124
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "-m64 requires a PowerPC64 cpu"
-msgstr "PowerPC64 アーキテクãƒãƒ£ã§ãªã„㨠-maix64 を有効ã«ã¯ã§ãã¾ã›ã‚“"
+msgstr "-m64 㯠PowerPC64 CPU ãŒå¿…è¦ã§ã™"
#: config/rs6000/linux64.h:130
#, gcc-internal-format
msgid "-mcmodel incompatible with other toc options"
-msgstr ""
+msgstr "-mcmodel ã¯ä»–ã® toc オプションã¨äº’æ›æ€§ãŒã‚ã‚Šã¾ã›ã‚“"
#. Definitions for __builtin_return_address and __builtin_frame_address.
#. __builtin_return_address (0) should give link register (65), enable
@@ -23702,69 +23701,69 @@ msgstr "RETURN_ADDRESS_OFFSET ã¯ã‚µãƒãƒ¼ãƒˆã•ã‚Œã¦ã„ã¾ã›ã‚“"
#. The macro SUBTARGET_OVERRIDE_OPTIONS is provided for subtargets, to
#. get control in TARGET_OPTION_OVERRIDE.
#: config/rs6000/sysv4.h:116
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "bad value for -mcall-%s"
-msgstr "-mcall-%s スイッãƒã«ã¨ã£ã¦ã®ä¸æ­£ãªå€¤"
+msgstr "-mcall-%s 用ã®é–“é•ã£ãŸå€¤ã§ã™"
#: config/rs6000/sysv4.h:132
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "bad value for -msdata=%s"
-msgstr "-msdata=%s スイッãƒã«å¯¾ã™ã‚‹ä¸æ­£ãªå€¤"
+msgstr "-msdata=%s 用ã®é–“é•ã£ãŸå€¤ã§ã™"
#: config/rs6000/sysv4.h:149
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "-mrelocatable and -msdata=%s are incompatible"
-msgstr "-mrelocatable 㨠-msdata=%s ã¨ã¯å…±å­˜ã§ãã¾ã›ã‚“"
+msgstr "-mrelocatable 㨠-msdata=%s ã¯ä½µç”¨ã§ãã¾ã›ã‚“"
#: config/rs6000/sysv4.h:158
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "-f%s and -msdata=%s are incompatible"
-msgstr "-f%s 㨠-msdata=%s ã¯å…±å­˜ã§ãã¾ã›ã‚“"
+msgstr "-f%s 㨠-msdata=%s ã¯ä½µç”¨ã§ãã¾ã›ã‚“"
#: config/rs6000/sysv4.h:167
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "-msdata=%s and -mcall-%s are incompatible"
-msgstr "-msdata=%s 㨠-mcall-%s ã¨ã¯å…±å­˜ã§ãã¾ã›ã‚“"
+msgstr "-msdata=%s 㨠-mcall-%s ã¯ä½µç”¨ã§ãã¾ã›ã‚“"
#: config/rs6000/sysv4.h:176
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "-mrelocatable and -mno-minimal-toc are incompatible"
-msgstr "-mrelocatable 㨠-mno-minimal-toc ã¨ã¯å…±å­˜ã§ãã¾ã›ã‚“"
+msgstr "-mrelocatable 㨠-mno-minimal-toc ã¯ä½µç”¨ã§ãã¾ã›ã‚“"
#: config/rs6000/sysv4.h:182
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "-mrelocatable and -mcall-%s are incompatible"
-msgstr "-mrelocatable 㨠-mcall-%s ã¨ã¯å…±å­˜ã§ãã¾ã›ã‚“"
+msgstr "-mrelocatable 㨠-mcall-%s ã¯ä½µç”¨ã§ãã¾ã›ã‚“"
#: config/rs6000/sysv4.h:189
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "-fPIC and -mcall-%s are incompatible"
-msgstr "-fPIC 㨠-mcall-%s ã¯å…±å­˜ã§ãã¾ã›ã‚“"
+msgstr "-fPIC 㨠-mcall-%s ã¯ä½µç”¨ã§ãã¾ã›ã‚“"
#: config/rs6000/sysv4.h:196
#, gcc-internal-format
msgid "-mcall-aixdesc must be big endian"
-msgstr "-mcall-aixdesc ã¯ãƒ“ッグエンディアンã§ãªã‘ã‚Œã°ãªã‚Šã¾ã›ã‚“"
+msgstr "-mcall-aixdesc ã¯ãƒ“ッグエンディアンã§ãªã‘ã‚Œã°ã„ã‘ã¾ã›ã‚“"
#: config/rs6000/sysv4.h:201
#, gcc-internal-format
msgid "-msecure-plt not supported by your assembler"
-msgstr ""
+msgstr "-msecure-plt ã¯ä½¿ç”¨ã™ã‚‹ã‚¢ã‚»ãƒ³ãƒ–ラã§ã‚µãƒãƒ¼ãƒˆã•ã‚Œã¦ã„ã¾ã›ã‚“"
#: config/rs6000/sysv4.h:220
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "-m%s not supported in this configuration"
-msgstr "%s ã¯ã“ã®ã‚³ãƒ³ãƒ•ã‚£ã‚®ãƒ¥ãƒ¬ãƒ¼ã‚·ãƒ§ãƒ³ã§ã¯ã‚µãƒãƒ¼ãƒˆã•ã‚Œã¾ã›ã‚“"
+msgstr "-m%s ã¯ã“ã®è¨­å®šã§ã¯ã‚µãƒãƒ¼ãƒˆã•ã‚Œã¦ã„ã¾ã›ã‚“"
#: config/rx/rx.c:428
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "unreocgnized control register number: %d - using 'psw'"
-msgstr "èªè­˜ã§ããªã„レジスタå `%s'"
+msgstr "èªè­˜å‡ºæ¥ãªã„制御レジスタ番å·ã§ã™: %d - 'psw' を使用ã—ã¾ã™"
#: config/rx/rx.c:2026
#, gcc-internal-format
msgid "__builtin_rx_%s takes 'C', 'Z', 'S', 'O', 'I', or 'U'"
-msgstr ""
+msgstr "__builtin_rx_%s 㯠'C'ã€'Z'ã€'S'ã€'O'ã€'I' ã¾ãŸã¯ 'U' ã‚’ã¨ã‚Šã¾ã™"
#: config/rx/rx.c:2028
#, gcc-internal-format
@@ -23772,24 +23771,24 @@ msgid "use __builtin_rx_mvtc (0, ... ) to write arbitrary values to PSW"
msgstr ""
#: config/rx/rx.c:2085 config/xtensa/xtensa.c:3079 config/xtensa/xtensa.c:3119
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "bad builtin code"
-msgstr "組ã¿è¾¼ã¿ãƒžã‚¯ãƒ­ \"%s\" ã¯ç„¡åŠ¹ã§ã™"
+msgstr "é–“é•ã£ãŸçµ„ã¿è¾¼ã¿ã‚³ãƒ¼ãƒ‰ã§ã™"
#: config/rx/rx.c:2211
#, gcc-internal-format
msgid "unrecognized argument '%s' to -mcpu= option"
-msgstr ""
+msgstr "-mcpu= オプションã¸ã®èªè­˜å‡ºæ¥ãªã„引数 '%s' ã§ã™"
#: config/rx/rx.c:2216
#, gcc-internal-format
msgid "the RX200 cpu does not have FPU hardware"
-msgstr ""
+msgstr "RX200 CPU 㯠FPU ãƒãƒ¼ãƒ‰ã‚¦ã‚§ã‚¢ã‚’æŒã£ã¦ã„ã¾ã›ã‚“"
#: config/rx/rx.c:2249
#, gcc-internal-format
msgid "RX FPU instructions do not support NaNs and infinities"
-msgstr ""
+msgstr "RX FPU 命令㯠NaNs ã¨ç„¡é™å¤§ã‚’サãƒãƒ¼ãƒˆã—ã¾ã›ã‚“"
#: config/s390/s390.c:1576
#, gcc-internal-format
@@ -23799,37 +23798,37 @@ msgstr ""
#: config/s390/s390.c:1583
#, gcc-internal-format
msgid "stack size must be an exact power of 2"
-msgstr ""
+msgstr "スタックサイズ㯠2 ã®ç´¯ä¹—ã§ãªã‘ã‚Œã°ã„ã‘ã¾ã›ã‚“"
#: config/s390/s390.c:1634
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "z/Architecture mode not supported on %s"
-msgstr "VAX 浮動å°æ•°ã§ã¯ãƒˆãƒ©ãƒƒãƒ—モードを利用ã§ãã¾ã›ã‚“"
+msgstr "z/Architecture モード㯠%s 上ã§ã¯ã‚µãƒãƒ¼ãƒˆã•ã‚Œã¦ã„ã¾ã›ã‚“"
#: config/s390/s390.c:1636
#, gcc-internal-format
msgid "64-bit ABI not supported in ESA/390 mode"
-msgstr ""
+msgstr "64 ビット ABI 㯠ESA/390 モード内ã§ã¯ã‚µãƒãƒ¼ãƒˆã•ã‚Œã¦ã„ã¾ã›ã‚“"
#: config/s390/s390.c:1643
#, gcc-internal-format
msgid "hardware decimal floating point instructions not available on %s"
-msgstr ""
+msgstr "ãƒãƒ¼ãƒ‰ã‚¦ã‚§ã‚¢å進浮動å°æ•°ç‚¹å‘½ä»¤ã¯ %s 上ã§ã¯ä½¿ç”¨å‡ºæ¥ã¾ã›ã‚“"
#: config/s390/s390.c:1646
#, gcc-internal-format
msgid "hardware decimal floating point instructions not available in ESA/390 mode"
-msgstr ""
+msgstr "ãƒãƒ¼ãƒ‰ã‚¦ã‚§ã‚¢å進浮動å°æ•°ç‚¹å‘½ä»¤ã¯ ESA/390 モードã§ã¯ä½¿ç”¨å‡ºæ¥ã¾ã›ã‚“"
#: config/s390/s390.c:1656
#, gcc-internal-format
msgid "-mhard-dfp can%'t be used in conjunction with -msoft-float"
-msgstr ""
+msgstr "-mhard-dfp 㯠-msoft-float ã¨ä½µç”¨ã§ãã¾ã›ã‚“"
#: config/s390/s390.c:1680
#, gcc-internal-format
msgid "-mbackchain -mpacked-stack -mhard-float are not supported in combination"
-msgstr ""
+msgstr "-mbackchain -mpacked-stack -mhard-float ã®çµ„ã¿åˆã‚ã›ã¯ã‚µãƒãƒ¼ãƒˆã•ã‚Œã¦ã„ã¾ã›ã‚“"
#: config/s390/s390.c:1686
#, gcc-internal-format
@@ -23839,112 +23838,112 @@ msgstr ""
#: config/s390/s390.c:1688
#, gcc-internal-format
msgid "stack size must not be greater than 64k"
-msgstr ""
+msgstr "スタックサイズ㯠64k より大ããã¦ã¯ã„ã‘ã¾ã›ã‚“"
#: config/s390/s390.c:1691
#, gcc-internal-format
msgid "-mstack-guard implies use of -mstack-size"
-msgstr ""
+msgstr "-mstack-guard 㯠-mstack-size を暗黙的ã«ä½¿ç”¨ã—ã¾ã™"
#: config/s390/s390.c:5134
#, gcc-internal-format
msgid "symbolic memory references are only supported on z10 or later"
-msgstr ""
+msgstr "シンボルã«ã‚ˆã‚‹ãƒ¡ãƒ¢ãƒªå‚照㯠z10 ã¾ãŸã¯ãれ以é™ã§ã®ã¿ã‚µãƒãƒ¼ãƒˆã•ã‚Œã¾ã™"
#: config/s390/s390.c:5203
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "invalid comparison operator for 'E' output modifier"
-msgstr "'b' 修飾å­ã«å¯¾ã™ã‚‹ç„¡åŠ¹ãªè¢«æ¼”ç®—å­"
+msgstr "'E' 出力修飾å­ç”¨ã®ç„¡åŠ¹ãªæ¯”較演算å­ã§ã™"
#: config/s390/s390.c:5223
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "invalid reference for 'J' output modifier"
-msgstr "'b' 修飾å­ã«å¯¾ã™ã‚‹ç„¡åŠ¹ãªè¢«æ¼”ç®—å­"
+msgstr "'J' 出力修飾å­ç”¨ã®ç„¡åŠ¹ãªå‚ç…§ã§ã™"
#: config/s390/s390.c:5237
#, gcc-internal-format
msgid "memory reference expected for 'O' output modifier"
-msgstr ""
+msgstr "'O' 出力修飾å­ç”¨ã«ã¯ãƒ¡ãƒ¢ãƒªå‚ç…§ãŒäºˆæœŸã•ã‚Œã¾ã™"
#: config/s390/s390.c:5247
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "invalid address for 'O' output modifier"
-msgstr "'O' 修飾å­ã«å¯¾ã™ã‚‹ç„¡åŠ¹ãªè¢«æ¼”ç®—å­"
+msgstr "'O' 出力修飾å­ç”¨ã®ç„¡åŠ¹ãªã‚¢ãƒ‰ãƒ¬ã‚¹ã§ã™"
#: config/s390/s390.c:5265
#, gcc-internal-format
msgid "memory reference expected for 'R' output modifier"
-msgstr ""
+msgstr "'R' 出力修飾å­ç”¨ã«ã¯ãƒ¡ãƒ¢ãƒªå‚ç…§ãŒäºˆæœŸã•ã‚Œã¾ã™"
#: config/s390/s390.c:5275
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "invalid address for 'R' output modifier"
-msgstr "'b' 修飾å­ã«å¯¾ã™ã‚‹ç„¡åŠ¹ãªè¢«æ¼”ç®—å­"
+msgstr "'R' 出力修飾å­ç”¨ã®ç„¡åŠ¹ãªã‚¢ãƒ‰ãƒ¬ã‚¹ã§ã™"
#: config/s390/s390.c:5293
#, gcc-internal-format
msgid "memory reference expected for 'S' output modifier"
-msgstr ""
+msgstr "'S' 出力修飾å­ç”¨ã«ã¯ãƒ¡ãƒ¢ãƒªå‚ç…§ãŒäºˆæœŸã•ã‚Œã¾ã™"
#: config/s390/s390.c:5302
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "invalid address for 'S' output modifier"
-msgstr "'b' 修飾å­ã«å¯¾ã™ã‚‹ç„¡åŠ¹ãªè¢«æ¼”ç®—å­"
+msgstr "'S' 出力修飾å­ç”¨ã®ç„¡åŠ¹ãªã‚¢ãƒ‰ãƒ¬ã‚¹ã§ã™"
#: config/s390/s390.c:5322
#, gcc-internal-format
msgid "register or memory expression expected for 'N' output modifier"
-msgstr ""
+msgstr "'N' 出力修飾å­ç”¨ã«ã¯ãƒ¬ã‚¸ã‚¹ã‚¿ã¾ãŸã¯ãƒ¡ãƒ¢ãƒªå¼ãŒäºˆæœŸã•ã‚Œã¾ã™"
#: config/s390/s390.c:5331
#, gcc-internal-format
msgid "register or memory expression expected for 'M' output modifier"
-msgstr ""
+msgstr "'M' 出力修飾å­ç”¨ã«ã¯ãƒ¬ã‚¸ã‚¹ã‚¿ã¾ãŸã¯ãƒ¡ãƒ¢ãƒªå¼ãŒäºˆæœŸã•ã‚Œã¾ã™"
#: config/s390/s390.c:5394
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "invalid constant - try using an output modifier"
-msgstr "無効ãªè¢«æ¼”ç®—å­å‡ºåŠ›ã‚³ãƒ¼ãƒ‰"
+msgstr "無効ãªå®šæ•°ã§ã™ - 出力修飾å­ã®ä½¿ç”¨ã‚’試ã¿ã¦ãã ã•ã„"
#: config/s390/s390.c:5396
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "invalid constant for output modifier '%c'"
-msgstr "'o' 修飾å­ã«å¯¾ã™ã‚‹ç„¡åŠ¹ãªè¢«æ¼”ç®—å­"
+msgstr "å‡ºåŠ›ä¿®é£¾å­ '%c' 用ã®ç„¡åŠ¹ãªå®šæ•°ã§ã™"
#: config/s390/s390.c:5402
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "invalid expression - try using an output modifier"
-msgstr "オペランドã¨ã—ã¦ç„¡åŠ¹ãªå¼"
+msgstr "無効ãªå¼ã§ã™ - 出力修飾å­ã®ä½¿ç”¨ã‚’試ã¿ã¦ãã ã•ã„"
#: config/s390/s390.c:5404
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "invalid expression for output modifier '%c'"
-msgstr "'o' 修飾å­ã«å¯¾ã™ã‚‹ç„¡åŠ¹ãªè¢«æ¼”ç®—å­"
+msgstr "å‡ºåŠ›ä¿®é£¾å­ '%c' 用ã®ç„¡åŠ¹ãªå¼ã§ã™"
#: config/s390/s390.c:7324
#, gcc-internal-format
msgid "total size of local variables exceeds architecture limit"
-msgstr ""
+msgstr "局所変数ã®åˆè¨ˆã‚µã‚¤ã‚ºãŒã‚¢ãƒ¼ã‚­ãƒ†ã‚¯ãƒãƒ£ã®åˆ¶é™ã‚’超éŽã—ã¦ã„ã¾ã™"
#: config/s390/s390.c:8025 config/s390/s390.c:8041
#, gcc-internal-format
msgid "frame size of function %qs is "
-msgstr ""
+msgstr "関数 %qs ã®ãƒ•ãƒ¬ãƒ¼ãƒ ã‚µã‚¤ã‚º: "
#: config/s390/s390.c:8070
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "frame size of %qs is "
-msgstr "`%s' ã®é ˜åŸŸã‚µã‚¤ã‚ºãŒã‚ã‹ã‚Šã¾ã›ã‚“"
+msgstr "%qs ã®ãƒ•ãƒ¬ãƒ¼ãƒ ã‚µã‚¤ã‚º: "
#: config/s390/s390.c:8074
#, gcc-internal-format
msgid "%qs uses dynamic stack allocation"
-msgstr ""
+msgstr "%qs ã¯å‹•çš„スタック割り当ã¦ã‚’使用ã—ã¾ã™"
#: config/score/score3.c:650 config/score/score7.c:649
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "-fPIC and -G are incompatible"
-msgstr "-fPIC 㨠-mcall-%s ã¯å…±å­˜ã§ãã¾ã›ã‚“"
+msgstr "-fPIC 㨠-G ã¯ä½µç”¨ã§ãã¾ã›ã‚“"
#: config/sh/sh.c:932
#, gcc-internal-format
@@ -23957,45 +23956,45 @@ msgid "unwind tables currently require either a frame pointer or -maccumulate-ou
msgstr ""
#: config/sh/sh.c:7781
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "__builtin_saveregs not supported by this subtarget"
-msgstr "__builtin_saveregs ã¯ã“ã®ã‚¿ãƒ¼ã‚²ãƒƒãƒˆã§ã¯å®Ÿè£…ã•ã‚Œã¦ã„ã¾ã›ã‚“"
+msgstr ""
#: config/sh/sh.c:8938
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "%qE attribute only applies to interrupt functions"
-msgstr "`%s' 属性ã¯é–¢æ•°ã«å¯¾ã—ã¦ã®ã¿é©ç”¨ã•ã‚Œã¾ã™"
+msgstr "%qE 属性ã¯å‰²ã‚Šè¾¼ã¿é–¢æ•°ã¸ã®ã¿é©ç”¨ã•ã‚Œã¾ã™"
#: config/sh/sh.c:8996
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "%qE attribute is supported only for SH2A"
-msgstr "init_priority 属性ã¯ã“ã®ãƒ—ラットフォームã§ã¯ã‚µãƒãƒ¼ãƒˆã•ã‚Œã¦ã„ã¾ã›ã‚“"
+msgstr "%qE 属性㯠SH2A 用ã«ã®ã¿ã‚µãƒãƒ¼ãƒˆã•ã‚Œã¦ã„ã¾ã™"
#: config/sh/sh.c:9026
#, gcc-internal-format
msgid "attribute interrupt_handler is not compatible with -m5-compact"
-msgstr ""
+msgstr "interrupt_handler 属性㯠-m5-compact ã¨ä½µç”¨ã§ãã¾ã›ã‚“"
#: config/sh/sh.c:9043
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "%qE attribute only applies to SH2A"
-msgstr "`%s' 属性ã¯åž‹ã«ã¯é©ç”¨ã•ã‚Œã¾ã›ã‚“"
+msgstr "%qE 属性㯠SH2A ã¸ã®ã¿é©ç”¨ã•ã‚Œã¾ã™"
#: config/sh/sh.c:9065
#, gcc-internal-format
msgid "%qE attribute argument should be between 0 to 255"
-msgstr ""
+msgstr "%qE 属性引数㯠0 㨠255 ã®é–“ã§ã‚ã‚‹ã¹ãã§ã™"
#. The argument must be a constant string.
#: config/sh/sh.c:9138
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "%qE attribute argument not a string constant"
-msgstr "asm テンプレートãŒæ–‡å­—列定数ã§ã¯ã‚ã‚Šã¾ã›ã‚“"
+msgstr "%qE 属性ã®å¼•æ•°ãŒæ–‡å­—列定数ã§ã¯ã‚ã‚Šã¾ã›ã‚“"
#: config/sh/sh.c:11702
#, gcc-internal-format
msgid "r0 needs to be available as a call-clobbered register"
-msgstr ""
+msgstr "r0 ã¯å‘¼ã³å‡ºã—ã«ã‚ˆã£ã¦ä¸Šæ›¸ãã•ã‚Œã‚‹ãƒ¬ã‚¸ã‚¹ã‚¿ã¨ã—ã¦åˆ©ç”¨ã§ãã‚‹å¿…è¦ãŒã‚ã‚Šã¾ã™"
#: config/sh/sh.c:11723
#, gcc-internal-format
@@ -24008,9 +24007,9 @@ msgid "need a call-clobbered target register"
msgstr ""
#: config/sh/symbian-base.c:112
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "%qE declared as both exported to and imported from a DLL"
-msgstr "`%s' ㌠DLL ã‹ã‚‰ importã€DLL ã« export ã®ä¸¡æ–¹ã¨ã—ã¦å®£è¨€ã•ã‚Œã¾ã—ãŸ"
+msgstr ""
#: config/sh/symbian-base.c:119
#, gcc-internal-format
@@ -24031,14 +24030,14 @@ msgstr ""
#: config/sh/symbian-cxx.c:554 config/sh/symbian-cxx.c:561
#: ada/gcc-interface/utils.c:5018 ada/gcc-interface/utils.c:5196
#: ada/gcc-interface/utils.c:5238 ada/gcc-interface/utils.c:5298
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "%qs attribute ignored"
-msgstr "`%s' 属性ã¯ç„¡è¦–ã•ã‚Œã¾ã—ãŸ"
+msgstr "%qs 属性ãŒç„¡è¦–ã•ã‚Œã¾ã—ãŸ"
#: config/sh/symbian-cxx.c:106
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "inline function %q+D is declared as dllimport: attribute ignored"
-msgstr "組ã¿è¾¼ã¿é–¢æ•° `%s' ã¯éžé–¢æ•°ã¨ã—ã¦å®£è¨€ã•ã‚Œã¾ã—ãŸ"
+msgstr ""
#. FIXME
#: config/sh/netbsd-elf.h:94
@@ -24050,37 +24049,37 @@ msgstr ""
#: config/sh/vxworks.h:43
#, gcc-internal-format
msgid "-mrelax is only supported for RTP PIC"
-msgstr ""
+msgstr "-mrelax 㯠RTP PIC 用ã«ã®ã¿ã‚µãƒãƒ¼ãƒˆã•ã‚Œã¦ã„ã¾ã™"
#: config/sparc/sparc.c:799
#, gcc-internal-format
msgid "%s is not supported by this configuration"
-msgstr "%s ã¯ã“ã®ã‚³ãƒ³ãƒ•ã‚£ã‚®ãƒ¥ãƒ¬ãƒ¼ã‚·ãƒ§ãƒ³ã§ã¯ã‚µãƒãƒ¼ãƒˆã•ã‚Œã¾ã›ã‚“"
+msgstr "%s ã¯ã“ã®è¨­å®šã§ã¯ã‚µãƒãƒ¼ãƒˆã•ã‚Œã¦ã„ã¾ã›ã‚“"
#: config/sparc/sparc.c:806
#, gcc-internal-format
msgid "-mlong-double-64 not allowed with -m64"
-msgstr "-m64 指定モードã§ã¯ -mlong-double-64 ã¯è¨±å¯ã•ã‚Œã¾ã›ã‚“"
+msgstr "-mlong-double-64 㯠-m64 ã¨ä½µç”¨ã™ã‚‹ã“ã¨ã¯è¨±å¯ã•ã‚Œã¦ã„ã¾ã›ã‚“"
#: config/sparc/sparc.c:826
#, gcc-internal-format
msgid "bad value (%s) for -mcmodel= switch"
-msgstr "-mcmodel= スイッãƒã«ã¨ã£ã¦ä¸æ­£ãªå€¤ (%s)"
+msgstr "-mcmodel= スイッãƒç”¨ã®èª¤ã£ãŸå€¤ %s ã§ã™"
#: config/sparc/sparc.c:831
#, gcc-internal-format
msgid "-mcmodel= is not supported on 32 bit systems"
-msgstr "-mcmodel= 㯠32 bit システム上ã§ã¯ã‚µãƒãƒ¼ãƒˆã•ã‚Œã¾ã›ã‚“"
+msgstr "-mcmodel= 㯠32 ビットシステム上ã§ã¯ã‚µãƒãƒ¼ãƒˆã•ã‚Œã¦ã„ã¾ã›ã‚“"
#: config/spu/spu-c.c:135
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "insufficient arguments to overloaded function %s"
-msgstr "関数 `%s' ã¸ã®å¼•æ•°ãŒå°‘ãªã™ãŽã¾ã™"
+msgstr "オーãƒãƒ¼ãƒ­ãƒ¼ãƒ‰ã•ã‚ŒãŸé–¢æ•° %s ã¸ã®ä¸å分ãªå¼•æ•°ã§ã™"
#: config/spu/spu-c.c:166
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "too many arguments to overloaded function %s"
-msgstr "関数 `%s' ã«å¯¾ã™ã‚‹å¼•æ•°ãŒå¤šã™ãŽã¾ã™"
+msgstr "オーãƒãƒ¼ãƒ­ãƒ¼ãƒ‰ã•ã‚ŒãŸé–¢æ•° %s ã¸ã®å¼•æ•°ãŒå¤šã™ãŽã¾ã™"
#: config/spu/spu-c.c:178
#, gcc-internal-format
@@ -24090,22 +24089,22 @@ msgstr ""
#: config/spu/spu.c:544 config/spu/spu.c:555
#, gcc-internal-format
msgid "unknown architecture %qs"
-msgstr ""
+msgstr "ä¸æ˜Žãªã‚¢ãƒ¼ã‚­ãƒ†ã‚¯ãƒãƒ£ %qs ã§ã™"
#: config/spu/spu.c:5359 config/spu/spu.c:5362
#, gcc-internal-format
msgid "creating run-time relocation for %qD"
-msgstr ""
+msgstr "%qD 用ã®å®Ÿè¡Œæ™‚å†é…置を作æˆã—ã¦ã„ã¾ã™"
#: config/spu/spu.c:5367 config/spu/spu.c:5369
#, gcc-internal-format
msgid "creating run-time relocation"
-msgstr ""
+msgstr "実行時å†é…置を作æˆã—ã¦ã„ã¾ã™"
#: config/spu/spu.c:6428
#, gcc-internal-format
msgid "%s expects an integer literal in the range [%d, %d]"
-msgstr ""
+msgstr "%s 㯠[%d, %d] ã®ç¯„囲内ã®æ•´æ•°ãƒªãƒ†ãƒ©ãƒ«ãŒäºˆæœŸã•ã‚Œã¾ã™"
#: config/spu/spu.c:6448
#, gcc-internal-format
@@ -24120,7 +24119,7 @@ msgstr ""
#: config/stormy16/stormy16.c:1089
#, gcc-internal-format
msgid "local variable memory requirements exceed capacity"
-msgstr ""
+msgstr "局所変数ã®ãƒ¡ãƒ¢ãƒªè¦æ±‚ãŒå®¹é‡ã‚’超ãˆã¦ã„ã¾ã™"
#: config/stormy16/stormy16.c:1243
#, gcc-internal-format
@@ -24128,24 +24127,24 @@ msgid "function_profiler support"
msgstr ""
#: config/stormy16/stormy16.c:1333
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "cannot use va_start in interrupt function"
-msgstr "ä»–ã®é–¢æ•°å†…㧠static 関数を宣言ã§ãã¾ã›ã‚“"
+msgstr "割り込ã¿é–¢æ•°å†…㧠va_start を使用ã™ã‚‹ã“ã¨ã¯å‡ºæ¥ã¾ã›ã‚“"
#: config/stormy16/stormy16.c:1877
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "switch statement of size %lu entries too large"
-msgstr "変数 `%s' ã®ã‚µã‚¤ã‚ºãŒå¤§ãã™ãŽã¾ã™"
+msgstr ""
#: config/stormy16/stormy16.c:2245
#, gcc-internal-format
msgid "%<__BELOW100__%> attribute only applies to variables"
-msgstr ""
+msgstr "%<__BELOW100__%> 属性ã¯å¤‰æ•°ã¸ã®ã¿é©ç”¨ã§ãã¾ã™"
#: config/stormy16/stormy16.c:2252
#, gcc-internal-format
msgid "__BELOW100__ attribute not allowed with auto storage class"
-msgstr ""
+msgstr "__BELOW100__ 属性ã¯è‡ªå‹•è¨˜æ†¶åŸŸã‚¯ãƒ©ã‚¹ã§ã®ã¿è¨±å¯ã•ã‚Œã¦ã„ã¾ã™"
#: config/v850/v850-c.c:67
#, gcc-internal-format
@@ -24158,89 +24157,89 @@ msgid "#pragma GHS endXXX does not match previous startXXX"
msgstr "#pragma GHS endXXX ãŒå‰ã® startXXX ã¨é©åˆã—ã¾ã›ã‚“"
#: config/v850/v850-c.c:96
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "cannot set interrupt attribute: no current function"
msgstr "interrupt 属性を設定ã§ãã¾ã›ã‚“: ç¾åœ¨ã®é–¢æ•°ãŒã‚ã‚Šã¾ã›ã‚“"
#: config/v850/v850-c.c:104
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "cannot set interrupt attribute: no such identifier"
-msgstr "interrupt 属性を設定ã§ãã¾ã›ã‚“: ãã®æ§˜ãªè­˜åˆ¥å­ãŒã‚ã‚Šã¾ã›ã‚“"
+msgstr "interrupt 属性を設定ã§ãã¾ã›ã‚“: ãã®ã‚ˆã†ãªè­˜åˆ¥å­ã¯ã‚ã‚Šã¾ã›ã‚“"
#: config/v850/v850-c.c:153
#, gcc-internal-format
msgid "junk at end of #pragma ghs section"
-msgstr "#pragma ghs section ã®çµ‚ã‚Šã«ã‚´ãƒŸãŒã‚ã‚Šã¾ã™"
+msgstr "#pragma ghs section ã®æœ«å°¾ã«ã‚´ãƒŸãŒã‚ã‚Šã¾ã™"
#: config/v850/v850-c.c:170
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "unrecognized section name %qE"
-msgstr "èªè­˜ã§ããªã„セクションå \"%s\""
+msgstr "èªè­˜å‡ºæ¥ãªã„セクションå %qE ã§ã™"
#: config/v850/v850-c.c:185
#, gcc-internal-format
msgid "malformed #pragma ghs section"
-msgstr "ãŠã‹ã—㪠#pragma ghs section"
+msgstr "é–“é•ã£ãŸå½¢å¼ã® #pragma ghs section ã§ã™"
#: config/v850/v850-c.c:204
#, gcc-internal-format
msgid "junk at end of #pragma ghs interrupt"
-msgstr "#pragma ghs interrupt ã®çµ‚ã‚Šã«ã‚´ãƒŸãŒã‚ã‚Šã¾ã™"
+msgstr "#pragma ghs interrupt ã®æœ«å°¾ã«ã‚´ãƒŸãŒã‚ã‚Šã¾ã™"
#: config/v850/v850-c.c:215
#, gcc-internal-format
msgid "junk at end of #pragma ghs starttda"
-msgstr "#pragma ghs starttda ã®çµ‚ã‚Šã«ã‚´ãƒŸãŒã‚ã‚Šã¾ã™"
+msgstr "#pragma ghs starttda ã®æœ«å°¾ã«ã‚´ãƒŸãŒã‚ã‚Šã¾ã™"
#: config/v850/v850-c.c:226
#, gcc-internal-format
msgid "junk at end of #pragma ghs startsda"
-msgstr "#pragma ghs startsda ã®çµ‚ã‚Šã«ã‚´ãƒŸãŒã‚ã‚Šã¾ã™"
+msgstr "#pragma ghs startsda 属性ã®æœ«å°¾ã«ã‚´ãƒŸãŒã‚ã‚Šã¾ã™"
#: config/v850/v850-c.c:237
#, gcc-internal-format
msgid "junk at end of #pragma ghs startzda"
-msgstr "#pragma ghs startzda ã®çµ‚ã‚Šã«ã‚´ãƒŸãŒã‚ã‚Šã¾ã™"
+msgstr "#pragma ghs startzda ã®æœ«å°¾ã«ã‚´ãƒŸãŒã‚ã‚Šã¾ã™"
#: config/v850/v850-c.c:248
#, gcc-internal-format
msgid "junk at end of #pragma ghs endtda"
-msgstr "#pragma ghs endtda ã®çµ‚ã‚Šã«ã‚´ãƒŸãŒã‚ã‚Šã¾ã™"
+msgstr "#pragma ghs endtda ã®æœ«å°¾ã«ã‚´ãƒŸãŒã‚ã‚Šã¾ã™"
#: config/v850/v850-c.c:259
#, gcc-internal-format
msgid "junk at end of #pragma ghs endsda"
-msgstr "#pragma ghs endsda ã®çµ‚ã‚Šã«ã‚´ãƒŸãŒã‚ã‚Šã¾ã™"
+msgstr "#pragma ghs endsda ã®æœ«å°¾ã«ã‚´ãƒŸãŒã‚ã‚Šã¾ã™"
#: config/v850/v850-c.c:270
#, gcc-internal-format
msgid "junk at end of #pragma ghs endzda"
-msgstr "#pragma ghs ã®çµ‚ã‚Šã«ã‚´ãƒŸãŒã‚ã‚Šã¾ã™"
+msgstr "#pragma ghs endzda ã®æœ«å°¾ã«ã‚´ãƒŸãŒã‚ã‚Šã¾ã™"
#: config/v850/v850.c:103
#, gcc-internal-format
msgid "value passed to %<-m%s%> is too large"
-msgstr ""
+msgstr "%<-m%s%> ã¸æ¸¡ã•ã‚ŒãŸå€¤ãŒå¤§ãã™ãŽã¾ã™"
#: config/v850/v850.c:2171
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "data area attributes cannot be specified for local variables"
-msgstr "データ領域属性をローカル変数ã«ã¯æŒ‡å®šã§ãã¾ã›ã‚“"
+msgstr "データ領域属性を局所変数用ã«æŒ‡å®šã§ãã¾ã›ã‚“"
#: config/v850/v850.c:2182
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "data area of %q+D conflicts with previous declaration"
-msgstr "データ領域 '%s' ã¯å‰ã®å®£è¨€ã¨çŸ›ç›¾ã—ã¾ã™"
+msgstr "%q+D ã®ãƒ‡ãƒ¼ã‚¿é ˜åŸŸãŒå‰ã®å®£è¨€ã¨ç«¶åˆã—ã¦ã„ã¾ã™"
#: config/v850/v850.c:2313
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "bogus JR construction: %d"
-msgstr "誤魔化ã•ã‚ŒãŸ JR 構造: %d\n"
+msgstr ""
#: config/v850/v850.c:2331 config/v850/v850.c:2438
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "bad amount of stack space removal: %d"
-msgstr "スタック空間削除é‡ãŒä¸æ­£ã§ã™: %d"
+msgstr "é–“é•ã£ãŸã‚¹ã‚¿ãƒƒã‚¯ç©ºé–“削除é‡ã§ã™: %d"
#: config/v850/v850.c:2418
#, gcc-internal-format
@@ -24248,24 +24247,24 @@ msgid "bogus JARL construction: %d"
msgstr ""
#: config/v850/v850.c:2715
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "bogus DISPOSE construction: %d"
-msgstr "誤魔化ã•ã‚ŒãŸ JR 構造: %d\n"
+msgstr ""
#: config/v850/v850.c:2734
#, gcc-internal-format
msgid "too much stack space to dispose of: %d"
-msgstr ""
+msgstr "破棄ã™ã‚‹ã‚¹ã‚¿ãƒƒã‚¯ç©ºé–“ãŒå¤§ãã™ãŽã¾ã™: %d"
#: config/v850/v850.c:2836
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "bogus PREPEARE construction: %d"
-msgstr "誤魔化ã•ã‚ŒãŸ JARL 構造: %d\n"
+msgstr ""
#: config/v850/v850.c:2853
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "too much stack space to prepare: %d"
-msgstr "スタック空間削除é‡ãŒä¸æ­£ã§ã™: %d"
+msgstr "準備ã™ã‚‹ã‚¹ã‚¿ãƒƒã‚¯ç©ºé–“ãŒå¤šã™ãŽã¾ã™: %d"
#: config/xtensa/xtensa.c:2129
#, gcc-internal-format
@@ -24273,24 +24272,24 @@ msgid "boolean registers required for the floating-point option"
msgstr ""
#: config/xtensa/xtensa.c:2164
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "-f%s is not supported with CONST16 instructions"
-msgstr "%s ã¯ã“ã®ã‚³ãƒ³ãƒ•ã‚£ã‚®ãƒ¥ãƒ¬ãƒ¼ã‚·ãƒ§ãƒ³ã§ã¯ã‚µãƒãƒ¼ãƒˆã•ã‚Œã¾ã›ã‚“"
+msgstr "-f%s 㯠CONST16 命令ã§ã¯ã‚µãƒãƒ¼ãƒˆã•ã‚Œã¦ã„ã¾ã›ã‚“"
#: config/xtensa/xtensa.c:2171
#, gcc-internal-format
msgid "PIC is required but not supported with CONST16 instructions"
-msgstr ""
+msgstr "PIC ãŒå¿…è¦ã§ã™ãŒ CONST16 命令ã§ã¯ã‚µãƒãƒ¼ãƒˆã•ã‚Œã¦ã„ã¾ã›ã‚“"
#: config/xtensa/xtensa.c:3229
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "only uninitialized variables can be placed in a .bss section"
-msgstr "8 ビット領域内ã«é…ç½®ã§ãる変数ã ã‘ãŒåˆæœŸåŒ–ã•ã‚Œã¾ã—ãŸ"
+msgstr ".bss セクションã«ã¯æœªåˆæœŸåŒ–変数ã®ã¿é…置出æ¥ã¾ã™"
#: ada/gcc-interface/misc.c:137
#, gcc-internal-format
msgid "%<-gnat%> misspelled as %<-gant%>"
-msgstr ""
+msgstr "%<-gnat%> ㌠%<-gant%> ã¨é–“é•ã£ã¦ç¶´ã‚‰ã‚Œã¦ã„ã¾ã™"
#: ada/gcc-interface/misc.c:240
#, gcc-internal-format
@@ -24300,63 +24299,63 @@ msgstr ""
#: ada/gcc-interface/utils.c:5136
#, gcc-internal-format
msgid "%qs attribute requires prototypes with named arguments"
-msgstr ""
+msgstr "%qs 属性ã¯åå‰ä»˜ã引数をæŒã¤ãƒ—ロトタイプãŒå¿…è¦ã§ã™"
#: ada/gcc-interface/utils.c:5148
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "%qs attribute only applies to variadic functions"
-msgstr "`%s' 属性ã¯é–¢æ•°ã«å¯¾ã—ã¦ã®ã¿é©ç”¨ã•ã‚Œã¾ã™"
+msgstr ""
#: ada/gcc-interface/utils.c:5219
#, gcc-internal-format
msgid "%qE attribute has no effect"
-msgstr ""
+msgstr "%qE 属性ã¯åŠ¹æžœãŒã‚ã‚Šã¾ã›ã‚“"
#: ada/gcc-interface/utils.c:5333
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "invalid vector type for attribute %qs"
-msgstr "`%s' ã®å¼•æ•°ã¨ã—ã¦ç„¡åŠ¹ãªåž‹"
+msgstr "%qs 属性用ã®ç„¡åŠ¹ãªãƒ™ã‚¯ãƒˆãƒ«åž‹ã§ã™"
#: ada/gcc-interface/utils.c:5396
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "attribute %qs applies to array types only"
-msgstr "`%s' 属性ã¯åž‹ã«ã¯é©ç”¨ã•ã‚Œã¾ã›ã‚“"
+msgstr "%qs 属性ã¯é…列型ã®ã¿ã«é©ç”¨ã§ãã¾ã™"
#: ada/gcc-interface/utils.c:5423
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "invalid element type for attribute %qs"
-msgstr "無効ãªãƒ‘ラメタ値 `%s'"
+msgstr "%qs 属性用ã®ç„¡åŠ¹ãªã‚¨ãƒ¬ãƒ¡ãƒ³ãƒˆåž‹ã§ã™"
#. Conversion of implicit `this' argument failed.
#: cp/call.c:2948
#, gcc-internal-format
msgid " no known conversion for implicit %<this%> parameter from %qT to %qT"
-msgstr ""
+msgstr " %qT ã‹ã‚‰ %qT 㸠%<this%> パラメータを暗黙的ã«å¤‰æ›ã™ã‚‹æ–¹æ³•ãŒä¸æ˜Žã§ã™"
#: cp/call.c:2952
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid " no known conversion for argument %d from %qT to %qT"
-msgstr "NaN ã‹ã‚‰æ•´æ•°ã¸ã®å¤‰æ›ã§ã™"
+msgstr "第 %d 引数を %qT ã‹ã‚‰ %qT ã¸å¤‰æ›ã™ã‚‹æ–¹æ³•ãŒä¸æ˜Žã§ã™"
#: cp/call.c:2974
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "%s%D(%T, %T, %T) <built-in>"
-msgstr "<組ã¿è¾¼ã¿>"
+msgstr "%s%D(%T, %T, %T) <組ã¿è¾¼ã¿>"
#: cp/call.c:2979
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "%s%D(%T, %T) <built-in>"
-msgstr "<組ã¿è¾¼ã¿>"
+msgstr "%s%D(%T, %T) <組ã¿è¾¼ã¿>"
#: cp/call.c:2983
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "%s%D(%T) <built-in>"
-msgstr "<組ã¿è¾¼ã¿>"
+msgstr "%s%D(%T) <組ã¿è¾¼ã¿>"
#: cp/call.c:2987
#, gcc-internal-format
msgid "%s%T <conversion>"
-msgstr ""
+msgstr "%s%T <変æ›>"
#: cp/call.c:2989
#, gcc-internal-format
@@ -24366,7 +24365,7 @@ msgstr ""
#: cp/call.c:2991
#, gcc-internal-format
msgid "%s%#D <deleted>"
-msgstr ""
+msgstr "%s%#D <削除済ã¿>"
#: cp/call.c:2993
#, fuzzy, gcc-internal-format
@@ -24377,12 +24376,12 @@ msgstr "%s: %s"
#, gcc-internal-format
msgid " candidate expects %d argument, %d provided"
msgid_plural " candidate expects %d arguments, %d provided"
-msgstr[0] ""
+msgstr[0] " 候補ã§ã¯ %d 個ã®å¼•æ•°ãŒäºˆæœŸã•ã‚Œã¾ã™ãŒã€%d 個ã®å¼•æ•°ãŒä¸Žãˆã‚‰ã‚Œã¦ã„ã¾ã™"
#: cp/call.c:3337
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "conversion from %qT to %qT is ambiguous"
-msgstr "NaN ã‹ã‚‰æ•´æ•°ã¸ã®å¤‰æ›ã§ã™"
+msgstr "%qT ã‹ã‚‰ %qT ã¸ã®å¤‰æ›ãŒæ›–昧ã§ã™"
#: cp/call.c:3442
#, gcc-internal-format
@@ -24392,12 +24391,12 @@ msgstr ""
#: cp/call.c:3552
#, gcc-internal-format
msgid "no matching function for call to %<%D(%A)%>"
-msgstr ""
+msgstr "%<%D(%A)%> ã®å‘¼ã³å‡ºã—ã«é©åˆã™ã‚‹é–¢æ•°ãŒã‚ã‚Šã¾ã›ã‚“"
#: cp/call.c:3555
#, gcc-internal-format
msgid "call of overloaded %<%D(%A)%> is ambiguous"
-msgstr ""
+msgstr "オーãƒãƒ¼ãƒ­ãƒ¼ãƒ‰ã•ã‚Œã¦ã„ã‚‹ %<%D(%A)%> ã®å‘¼ã³å‡ºã—ãŒæ›–昧ã§ã™"
#. It's no good looking for an overloaded operator() on a
#. pointer-to-member-function.
@@ -24409,77 +24408,77 @@ msgstr ""
#: cp/call.c:3817
#, gcc-internal-format
msgid "no match for call to %<(%T) (%A)%>"
-msgstr ""
+msgstr "%<(%T) (%A)%> ã¸ã®å‘¼ã³å‡ºã—ãŒé©åˆã—ã¾ã›ã‚“"
#: cp/call.c:3830
#, gcc-internal-format
msgid "call of %<(%T) (%A)%> is ambiguous"
-msgstr ""
+msgstr "%<(%T) (%A)%> ã®å‘¼ã³å‡ºã—ãŒæ›–昧ã§ã™"
#: cp/call.c:3872
#, gcc-internal-format
msgid "ambiguous overload for ternary %<operator?:%> in %<%E ? %E : %E%>"
-msgstr ""
+msgstr "ä¸‰é …æ¼”ç®—å­ %<operator?:%> 用㮠%<%E ? %E : %E%> 内ã«ã‚るオーãƒãƒ¼ãƒ­ãƒ¼ãƒ‰ãŒæ›–昧ã§ã™"
#: cp/call.c:3875
#, gcc-internal-format
msgid "no match for ternary %<operator?:%> in %<%E ? %E : %E%>"
-msgstr ""
+msgstr "%<%E ? %E : %E%> 内ã«ã‚ã‚‹ä¸‰é …æ¼”ç®—å­ %<operator?:%> ãŒé©åˆã—ã¾ã›ã‚“ "
#: cp/call.c:3882
#, gcc-internal-format
msgid "ambiguous overload for %<operator%s%> in %<%E%s%>"
-msgstr ""
+msgstr "%<operator%s%> 用㮠%<%E%s%> 内ã«ã‚るオーãƒãƒ¼ãƒ­ãƒ¼ãƒ‰ãŒæ›–昧ã§ã™"
#: cp/call.c:3885
#, gcc-internal-format
msgid "no match for %<operator%s%> in %<%E%s%>"
-msgstr ""
+msgstr "%<operator%s%> 㧠%<%E%s%> 内ã«ã‚ã‚‹ã‚‚ã®ãŒé©åˆã—ã¾ã›ã‚“"
#: cp/call.c:3891
#, gcc-internal-format
msgid "ambiguous overload for %<operator[]%> in %<%E[%E]%>"
-msgstr ""
+msgstr "%<%E[%E]%> 内ã«ã‚ã‚‹ %<operator[]%> 用ã®ã‚ªãƒ¼ãƒãƒ¼ãƒ­ãƒ¼ãƒ‰ãŒæ›–昧ã§ã™"
#: cp/call.c:3894
#, gcc-internal-format
msgid "no match for %<operator[]%> in %<%E[%E]%>"
-msgstr ""
+msgstr "%<%E[%E]%> 内㮠%<operator[]%> ãŒé©åˆã—ã¾ã›ã‚“"
#: cp/call.c:3901
#, gcc-internal-format
msgid "ambiguous overload for %qs in %<%s %E%>"
-msgstr ""
+msgstr "%qs 用㮠%<%s %E%> 内ã«ã‚るオーãƒãƒ¼ãƒ­ãƒ¼ãƒ‰ãŒæ›–昧ã§ã™"
#: cp/call.c:3904
#, gcc-internal-format
msgid "no match for %qs in %<%s %E%>"
-msgstr ""
+msgstr "%qs 㧠%<%s %E%> 内ã«ã‚ã‚‹ã‚‚ã®ãŒé©åˆã—ã¾ã›ã‚“"
#: cp/call.c:3911
#, gcc-internal-format
msgid "ambiguous overload for %<operator%s%> in %<%E %s %E%>"
-msgstr ""
+msgstr "%<operator%s%> 用㮠%<%E %s %E%> 内ã«ã‚るオーãƒãƒ¼ãƒ­ãƒ¼ãƒ‰ãŒæ›–昧ã§ã™"
#: cp/call.c:3914
#, gcc-internal-format
msgid "no match for %<operator%s%> in %<%E %s %E%>"
-msgstr ""
+msgstr "%<operator%s%> 㧠%<%E %s %E%> 内ã«ã‚ã‚‹ã‚‚ã®ãŒé©åˆã—ã¾ã›ã‚“"
#: cp/call.c:3918
#, gcc-internal-format
msgid "ambiguous overload for %<operator%s%> in %<%s%E%>"
-msgstr ""
+msgstr "%<operator%s%> 用㮠%<%s%E%> 内ã«ã‚るオーãƒãƒ¼ãƒ­ãƒ¼ãƒ‰ãŒæ›–昧ã§ã™"
#: cp/call.c:3921
#, gcc-internal-format
msgid "no match for %<operator%s%> in %<%s%E%>"
-msgstr ""
+msgstr "%<operator%s%> 㧠%<%s%E%> 内ã«ã‚ã‚‹ã‚‚ã®ãŒé©åˆã—ã¾ã›ã‚“"
#: cp/call.c:4015
#, gcc-internal-format
msgid "ISO C++ forbids omitting the middle term of a ?: expression"
-msgstr "ISO C++ ã¯ä¸­é–“é …ãŒçœç•¥ã•ã‚ŒãŸ ?: å¼ã‚’ç¦ã˜ã¾ã™"
+msgstr "ISO C++ ã¯ä¸­é–“é …ãŒçœç•¥ã•ã‚ŒãŸ ?: å¼ã‚’ç¦æ­¢ã—ã¦ã„ã¾ã™"
#: cp/call.c:4096
#, gcc-internal-format
@@ -24494,17 +24493,17 @@ msgstr ""
#: cp/call.c:4143 cp/call.c:4387
#, gcc-internal-format
msgid "operands to ?: have different types %qT and %qT"
-msgstr ""
+msgstr "?: ã¸ã®è¢«æ¼”ç®—å­ãŒç•°ãªã‚‹åž‹ %qT 㨠%qT ã‚’æŒã£ã¦ã„ã¾ã™"
#: cp/call.c:4334
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "enumeral mismatch in conditional expression: %qT vs %qT"
-msgstr "æ¡ä»¶å¼ã§ã®åž‹ã®çµ„åˆã‚ã›ãŒé©åˆã—ã¾ã›ã‚“"
+msgstr ""
#: cp/call.c:4345
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "enumeral and non-enumeral type in conditional expression"
-msgstr "æ¡ä»¶å¼ã«ç¬¦åˆä»˜ãåž‹ã¨ç¬¦åˆç„¡ã—åž‹ã¨ãŒã‚ã‚Šã¾ã™"
+msgstr ""
#: cp/call.c:4739
#, gcc-internal-format
@@ -24517,14 +24516,14 @@ msgid "no %<%D(int)%> declared for postfix %qs"
msgstr ""
#: cp/call.c:4835
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "comparison between %q#T and %q#T"
-msgstr "ãƒã‚¤ãƒ³ã‚¿ã¨æ•´æ•°ã¨ã®æ¯”較を行ãªã£ã¦ã„ã¾ã™"
+msgstr "%q#T 㨠%q#T ã®é–“ã§ã®æ¯”較ã§ã™"
#: cp/call.c:5079
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "non-placement deallocation function %q+D"
-msgstr "関数 `%s' ã®æš—é»™ã®å®£è¨€"
+msgstr ""
#: cp/call.c:5080
#, gcc-internal-format
@@ -24537,24 +24536,24 @@ msgid "no corresponding deallocation function for %qD"
msgstr ""
#: cp/call.c:5164
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "no suitable %<operator %s%> for %qT"
-msgstr "ã‚ã‚Šãˆãªã„æ¼”ç®—å­ '%s'"
+msgstr "%<operator %s%> 㯠%qT 用ã¨ã—ã¦ã¯é©åˆ‡ã§ã¯ã‚ã‚Šã¾ã›ã‚“"
#: cp/call.c:5182
#, gcc-internal-format
msgid "%q+#D is private"
-msgstr ""
+msgstr "%q+#D ã¯éžå…¬é–‹ã§ã™"
#: cp/call.c:5184
#, gcc-internal-format
msgid "%q+#D is protected"
-msgstr ""
+msgstr "%q+#D ã¯ä¿è­·ã•ã‚Œã¦ã„ã¾ã™"
#: cp/call.c:5186
#, gcc-internal-format
msgid "%q+#D is inaccessible"
-msgstr ""
+msgstr "%q+#D ã¯ã‚¢ã‚¯ã‚»ã‚¹å‡ºæ¥ã¾ã›ã‚“"
#: cp/call.c:5187
#, gcc-internal-format
@@ -24567,29 +24566,29 @@ msgid "passing NULL to non-pointer argument %P of %qD"
msgstr ""
#: cp/call.c:5239
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "converting to non-pointer type %qT from NULL"
-msgstr "ãƒã‚¤ãƒ³ã‚¿åž‹ã«å¤‰æ›ã§ãã¾ã›ã‚“"
+msgstr "NULL ã‹ã‚‰éžãƒã‚¤ãƒ³ã‚¿åž‹ %qT ã¸å¤‰æ›ã—ã¦ã„ã¾ã™"
#: cp/call.c:5245
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "converting %<false%> to pointer type for argument %P of %qD"
-msgstr "%d 番目ã®å¼•æ•°ãŒ `%s' ã®åž‹ã¨äº’æ›æ€§ãŒã‚ã‚Šã¾ã›ã‚“"
+msgstr ""
#: cp/call.c:5283
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "too many braces around initializer for %qT"
-msgstr "åˆæœŸåŒ–å­ã®ã¾ã‚ã‚Šã®ãƒ–レースを欠ã„ã¦ã„ã¾ã™"
+msgstr "%qT 用ã®åˆæœŸåŒ–å­ã®å‘¨ã‚Šã«ä¸­æ‹¬å¼§ãŒå¤šã™ãŽã¾ã™"
#: cp/call.c:5305 cp/cvt.c:217
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "invalid conversion from %qT to %qT"
-msgstr "NaN ã‹ã‚‰æ•´æ•°ã¸ã®å¤‰æ›ã§ã™"
+msgstr "%qT ã‹ã‚‰ %qT ã¸ã®ç„¡åŠ¹ãªå¤‰æ›ã§ã™"
#: cp/call.c:5308 cp/call.c:5493
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid " initializing argument %P of %qD"
-msgstr "`%s' ã®å¼•æ•°ã¨ã—ã¦ç„¡åŠ¹ãªåž‹"
+msgstr ""
#: cp/call.c:5337
#, gcc-internal-format
@@ -24597,14 +24596,14 @@ msgid "converting to %qT from initializer list would use explicit constructor %q
msgstr ""
#: cp/call.c:5397 cp/call.c:5511
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid " initializing argument %P of %q+D"
-msgstr "`%s' ã®å¼•æ•°ã¨ã—ã¦ç„¡åŠ¹ãªåž‹"
+msgstr ""
#: cp/call.c:5508
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "cannot bind %qT lvalue to %qT"
-msgstr "ソース %s ãŒè¦‹ã¤ã‹ã‚Šã¾ã›ã‚“"
+msgstr ""
#: cp/call.c:5543
#, gcc-internal-format
@@ -24617,9 +24616,9 @@ msgid "cannot bind packed field %qE to %qT"
msgstr ""
#: cp/call.c:5549
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "cannot bind rvalue %qE to %qT"
-msgstr "ソース %s ãŒè¦‹ã¤ã‹ã‚Šã¾ã›ã‚“"
+msgstr ""
#: cp/call.c:5681
#, gcc-internal-format
@@ -24643,9 +24642,9 @@ msgid "recursive evaluation of default argument for %q#D"
msgstr ""
#: cp/call.c:5883
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "argument of function call might be a candidate for a format attribute"
-msgstr "format 属性をã®å€™è£œã¨ãªã‚Šãã†ãªé–¢æ•°ã«ã¤ã„ã¦è­¦å‘Šã™ã‚‹"
+msgstr "関数呼ã³å‡ºã—ã®å¼•æ•°ãŒ format 属性ã®å€™è£œã§ã‚るよã†ã§ã™"
#: cp/call.c:6093
#, gcc-internal-format
@@ -24663,14 +24662,14 @@ msgid "deducing %qT as %qT"
msgstr ""
#: cp/call.c:6175
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid " in call to %q+D"
-msgstr "`%s' ã¸ã®å‘¼ã³å‡ºã—ã¯ã‚¤ãƒ³ãƒ©ã‚¤ãƒ³åŒ–ã§ãã¾ã›ã‚“"
+msgstr ""
#: cp/call.c:6177
#, gcc-internal-format
msgid " (you can disable this with -fno-deduce-init-list)"
-msgstr ""
+msgstr " (-fno-deduce-init-list ã§ã“れを無効ã«å‡ºæ¥ã¾ã™)"
#: cp/call.c:6447
#, gcc-internal-format
@@ -24678,14 +24677,14 @@ msgid "could not find class$ field in java interface type %qT"
msgstr ""
#: cp/call.c:6705
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "call to non-function %qD"
-msgstr "関数 %s ã«å‘¼ã³å‡ºã—ãŒã‚ã‚Šã¾ã›ã‚“\n"
+msgstr "éžé–¢æ•° %qD ã®å‘¼ã³å‡ºã—ã§ã™"
#: cp/call.c:6750 cp/typeck.c:2543
#, gcc-internal-format
msgid "cannot call constructor %<%T::%D%> directly"
-msgstr ""
+msgstr "コンストラクタ %<%T::%D%> を直接呼ã³å‡ºã™ã“ã¨ã¯å‡ºæ¥ã¾ã›ã‚“"
#: cp/call.c:6752
#, gcc-internal-format
@@ -24705,12 +24704,12 @@ msgstr ""
#: cp/call.c:6874
#, gcc-internal-format
msgid "call of overloaded %<%s(%A)%> is ambiguous"
-msgstr ""
+msgstr "オーãƒãƒ¼ãƒ­ãƒ¼ãƒ‰ã•ã‚ŒãŸ %<%s(%A)%> ã®å‘¼ã³å‡ºã—ã¯æ›–昧ã§ã™"
#: cp/call.c:6903
#, gcc-internal-format
msgid "cannot call member function %qD without object"
-msgstr ""
+msgstr "オブジェクト以外ãŒãƒ¡ãƒ³ãƒé–¢æ•° %qD を呼ã³å‡ºã™ã“ã¨ã¯å‡ºæ¥ã¾ã›ã‚“"
#: cp/call.c:7611
#, gcc-internal-format
@@ -24718,9 +24717,9 @@ msgid "passing %qT chooses %qT over %qT"
msgstr ""
#: cp/call.c:7613 cp/name-lookup.c:5162
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid " in call to %qD"
-msgstr "`%s' ã¸ã®å‘¼ã³å‡ºã—ã¯ã‚¤ãƒ³ãƒ©ã‚¤ãƒ³åŒ–ã§ãã¾ã›ã‚“"
+msgstr ""
#: cp/call.c:7670
#, gcc-internal-format
@@ -24728,9 +24727,9 @@ msgid "choosing %qD over %qD"
msgstr ""
#: cp/call.c:7671
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid " for conversion from %qT to %qT"
-msgstr "NaN ã‹ã‚‰æ•´æ•°ã¸ã®å¤‰æ›ã§ã™"
+msgstr ""
#: cp/call.c:7674
#, gcc-internal-format
@@ -24745,12 +24744,12 @@ msgstr ""
#: cp/call.c:7795
#, gcc-internal-format
msgid " candidate 1: %q+#F"
-msgstr ""
+msgstr " 候補 1: %q+#F"
#: cp/call.c:7797
#, gcc-internal-format
msgid " candidate 2: %q+#F"
-msgstr ""
+msgstr " 候補 2: %q+#F"
#: cp/call.c:7838
#, gcc-internal-format
@@ -24758,9 +24757,9 @@ msgid "ISO C++ says that these are ambiguous, even though the worst conversion f
msgstr ""
#: cp/call.c:7991
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "could not convert %qE to %qT"
-msgstr "0x%l.8x を領域ã«å¤‰æ›ã§ãã¾ã›ã‚“"
+msgstr "%qE ã‹ã‚‰ %qT ã¸å¤‰æ›ã§ãã¾ã›ã‚“"
#: cp/call.c:8232
#, gcc-internal-format
@@ -24780,7 +24779,7 @@ msgstr ""
#: cp/class.c:976
#, gcc-internal-format
msgid "Java class %qT cannot have a destructor"
-msgstr ""
+msgstr "Java クラス %qT ã¯ãƒ‡ã‚¹ãƒˆãƒ©ã‚¯ã‚¿ã‚’æŒã¤ã“ã¨ã¯å‡ºæ¥ã¾ã›ã‚“"
#: cp/class.c:978
#, gcc-internal-format
@@ -24788,19 +24787,19 @@ msgid "Java class %qT cannot have an implicit non-trivial destructor"
msgstr ""
#: cp/class.c:1079
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "repeated using declaration %q+D"
-msgstr "`%s' ã® extern 宣言ãŒãƒã‚¹ãƒˆã—ã¦ã„ã¾ã™"
+msgstr "宣言 %q+D ã®ä½¿ç”¨ãŒç¹°ã‚Šè¿”ã•ã‚Œã¦ã„ã¾ã™"
#: cp/class.c:1081
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "using declaration %q+D conflicts with a previous using declaration"
-msgstr "`%s' ã®ã‚»ã‚¯ã‚·ãƒ§ãƒ³ã¯å‰æ–¹ã§ã«å®£è¨€ã•ã‚ŒãŸã‚‚ã®ã¨è¡çªã—ã¾ã™"
+msgstr "使用ã—ã¦ã„る宣言 %q+D ã¯å‰ã«ä½¿ç”¨ã—ã¦ã„る宣言ã¨ç«¶åˆã—ã¦ã„ã¾ã™"
#: cp/class.c:1086
#, gcc-internal-format
msgid "%q+#D cannot be overloaded"
-msgstr ""
+msgstr "%q+#D ã¯ã‚ªãƒ¼ãƒãƒ¼ãƒ­ãƒ¼ãƒ‰ã™ã‚‹ã“ã¨ãŒå‡ºæ¥ã¾ã›ã‚“"
#: cp/class.c:1087
#, gcc-internal-format
@@ -24808,19 +24807,19 @@ msgid "with %q+#D"
msgstr ""
#: cp/class.c:1154
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "conflicting access specifications for method %q+D, ignored"
-msgstr "フィールド `%s' ã«å¯¾ã™ã‚‹ã‚¢ã‚¯ã‚»ã‚¹æŒ‡å®šå­ãŒç«¶åˆã—ãŸãŸã‚ã€ç„¡è¦–ã•ã‚Œã¾ã—ãŸ"
+msgstr "メソッド %q+D 用ã®ã‚¢ã‚¯ã‚»ã‚¹æŒ‡å®šãŒç«¶åˆã—ã¦ã„ã¾ã™ã€‚無視ã•ã‚Œã¾ã—ãŸ"
#: cp/class.c:1157
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "conflicting access specifications for field %qE, ignored"
-msgstr "フィールド `%s' ã«å¯¾ã™ã‚‹ã‚¢ã‚¯ã‚»ã‚¹æŒ‡å®šå­ãŒç«¶åˆã—ãŸãŸã‚ã€ç„¡è¦–ã•ã‚Œã¾ã—ãŸ"
+msgstr "フィールド %qE 用ã®ã‚¢ã‚¯ã‚»ã‚¹æŒ‡å®šãŒç«¶åˆã—ã¦ã„ã¾ã™ã€‚無視ã•ã‚Œã¾ã—ãŸ"
#: cp/class.c:1218 cp/class.c:1226
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "%q+D invalid in %q#T"
-msgstr "%s: 無効ãªã‚ªãƒ—ション -- %c\n"
+msgstr "%q+D 㯠%q#T 内ã§ã¯ç„¡åŠ¹ã§ã™"
#: cp/class.c:1219
#, gcc-internal-format
@@ -24833,24 +24832,24 @@ msgid " because of local member %q+#D with same name"
msgstr ""
#: cp/class.c:1280
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "base class %q#T has a non-virtual destructor"
-msgstr "éžä»®æƒ³ãƒ‡ã‚¹ãƒˆãƒ©ã‚¯ã‚¿ã«ã¤ã„ã¦è­¦å‘Šã™ã‚‹"
+msgstr "基底クラス %q#T ãŒéžä»®æƒ³ãƒ‡ã‚¹ãƒˆãƒ©ã‚¯ã‚¿ã‚’æŒã£ã¦ã„ã¾ã™"
#: cp/class.c:1667
#, gcc-internal-format
msgid "all member functions in class %qT are private"
-msgstr ""
+msgstr "クラス %qT 内ã®å…¨ã¦ã®ãƒ¡ãƒ³ãƒé–¢æ•°ãŒéžå…¬é–‹ã§ã™"
#: cp/class.c:1679
#, gcc-internal-format
msgid "%q#T only defines a private destructor and has no friends"
-msgstr ""
+msgstr "%q#T ã¯ãƒ•ãƒ¬ãƒ³ãƒ‰ãŒç„¡ã„éžå…¬é–‹ãƒ‡ã‚¹ãƒˆãƒ©ã‚¯ã‚¿ã®ã¿å®šç¾©ã—ã¦ã„ã¾ã™"
#: cp/class.c:1724
#, gcc-internal-format
msgid "%q#T only defines private constructors and has no friends"
-msgstr ""
+msgstr "%q#T ã¯ãƒ•ãƒ¬ãƒ³ãƒ‰ãŒç„¡ã„éžå…¬é–‹ã‚³ãƒ³ã‚¹ãƒˆãƒ©ã‚¯ã‚¿ã®ã¿å®šç¾©ã—ã¦ã„ã¾ã™"
#: cp/class.c:2117
#, gcc-internal-format
@@ -24861,7 +24860,7 @@ msgstr ""
#: cp/class.c:2546
#, gcc-internal-format
msgid "%q+D was hidden"
-msgstr ""
+msgstr "%q+D ã¯éš ã•ã‚Œã¦ã„ã¾ã™"
#: cp/class.c:2547
#, gcc-internal-format
@@ -24871,92 +24870,92 @@ msgstr ""
#: cp/class.c:2590 cp/decl2.c:1321
#, gcc-internal-format
msgid "%q+#D invalid; an anonymous union can only have non-static data members"
-msgstr ""
+msgstr "%q+#D ã¯ç„¡åŠ¹ã§ã™ã€‚ç„¡å共用体ã¯éžé™çš„データメンãƒã®ã¿æŒã¤ã“ã¨ãŒå‡ºæ¥ã¾ã™"
#: cp/class.c:2593
#, gcc-internal-format
msgid "%q+#D invalid; an anonymous struct can only have non-static data members"
-msgstr ""
+msgstr "%q+#D ã¯ç„¡åŠ¹ã§ã™ã€‚ç„¡å構造体ã¯éžé™çš„データメンãƒã®ã¿æŒã¤ã“ã¨ãŒå‡ºæ¥ã¾ã™"
#: cp/class.c:2601 cp/decl2.c:1327
#, gcc-internal-format
msgid "private member %q+#D in anonymous union"
-msgstr ""
+msgstr "ç„¡å共用体内ã«éžå…¬é–‹ãƒ¡ãƒ³ãƒ %q+#D ãŒã‚ã‚Šã¾ã™"
#: cp/class.c:2603
#, gcc-internal-format
msgid "private member %q+#D in anonymous struct"
-msgstr ""
+msgstr "ç„¡å構造体内ã«éžå…¬é–‹ãƒ¡ãƒ³ãƒ %q+#D ãŒã‚ã‚Šã¾ã™"
#: cp/class.c:2608 cp/decl2.c:1329
#, gcc-internal-format
msgid "protected member %q+#D in anonymous union"
-msgstr ""
+msgstr "ç„¡å共用体内ã«ä¿è­·ã•ã‚ŒãŸãƒ¡ãƒ³ãƒ %q+#D ãŒã‚ã‚Šã¾ã™"
#: cp/class.c:2610
#, gcc-internal-format
msgid "protected member %q+#D in anonymous struct"
-msgstr ""
+msgstr "ç„¡å構造体内内ã«ä¿è­·ã•ã‚ŒãŸãƒ¡ãƒ³ãƒ %q+#D ãŒã‚ã‚Šã¾ã™"
#: cp/class.c:2795
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "bit-field %q+#D with non-integral type"
-msgstr "ビットフィールド `%s' ã®å¹…ãŒæ•´æ•°å®šæ•°ã§ã¯ã‚ã‚Šã¾ã›ã‚“"
+msgstr "ビットフィールド %q+#D ãŒéžæ•´æ•°åž‹ã§ã™"
#: cp/class.c:2811
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "bit-field %q+D width not an integer constant"
-msgstr "ビットフィールド `%s' ã®å¹…ãŒæ•´æ•°å®šæ•°ã§ã¯ã‚ã‚Šã¾ã›ã‚“"
+msgstr "ビットフィールド %q+D ã®å¹…ãŒæ•´æ•°å®šæ•°ã§ã¯ã‚ã‚Šã¾ã›ã‚“"
#: cp/class.c:2816
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "negative width in bit-field %q+D"
-msgstr "ビットフィールド `%s' ã®å¹…ãŒè² ã®æ•°ã§ã™"
+msgstr "ビットフィールド %q+D ã®å¹…ãŒè² ã§ã™"
#: cp/class.c:2821
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "zero width for bit-field %q+D"
-msgstr "ビットフィールド `%s' ã®å¹…㌠0 ã§ã™"
+msgstr "ビットフィールド %q+D ã®å¹…㌠0 ã§ã™"
#: cp/class.c:2827
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "width of %q+D exceeds its type"
-msgstr "`%s' ã®å¹…ã¯ãã®åž‹ã®ã‚µã‚¤ã‚ºã‚’超ãˆã¦ã„ã¾ã™"
+msgstr "%q+D ã®å¹…ãŒåž‹ã®å¤§ãã•ã‚’超ãˆã¦ã„ã¾ã™"
#: cp/class.c:2831
#, gcc-internal-format
msgid "%q+D is too small to hold all values of %q#T"
-msgstr ""
+msgstr "%q+D 㯠%q#T ã®å…¨ã¦ã®å€¤ã‚’æŒã¤ã«ã¯å°ã•ã™ãŽã¾ã™"
#: cp/class.c:2890
#, gcc-internal-format
msgid "member %q+#D with constructor not allowed in union"
-msgstr ""
+msgstr "コンストラクタをæŒã¤ãƒ¡ãƒ³ãƒ %q+#D ã¯å…±ç”¨ä½“内ã§ã¯è¨±å¯ã•ã‚Œã¦ã„ã¾ã›ã‚“"
#: cp/class.c:2893
#, gcc-internal-format
msgid "member %q+#D with destructor not allowed in union"
-msgstr ""
+msgstr "デストラクタをæŒã¤ãƒ¡ãƒ³ãƒ %q+#D ã¯å…±ç”¨ä½“内ã§ã¯è¨±å¯ã•ã‚Œã¦ã„ã¾ã›ã‚“"
#: cp/class.c:2895
#, gcc-internal-format
msgid "member %q+#D with copy assignment operator not allowed in union"
-msgstr ""
+msgstr "コピー代入演算å­ã‚’æŒã¤ãƒ¡ãƒ³ãƒ %q+#D ã¯å…±ç”¨ä½“内ã§ã¯è¨±å¯ã•ã‚Œã¦ã„ã¾ã›ã‚“"
#: cp/class.c:2899
#, gcc-internal-format
msgid "unrestricted unions only available with -std=c++0x or -std=gnu++0x"
-msgstr ""
+msgstr "制é™ã®ãªã„共用体㯠-std=c++0x ã¾ãŸã¯ -std=gnu++0x を指定ã—ãŸæ™‚ã®ã¿ä½¿ç”¨ã§ãã¾ã™"
#: cp/class.c:2933
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "multiple fields in union %qT initialized"
-msgstr "共用体åˆæœŸåŒ–å­å†…ã®è¦ç´ ãŒå¤šã™ãŽã¾ã™"
+msgstr "共用体 %qT 内ã®è¤‡æ•°ã®ãƒ•ã‚£ãƒ¼ãƒ«ãƒ‰ãŒåˆæœŸåŒ–ã•ã‚Œã¾ã—ãŸ"
#: cp/class.c:3024
#, gcc-internal-format
msgid "%q+D may not be static because it is a member of a union"
-msgstr ""
+msgstr "%q+D ã¯å…±ç”¨ä½“ã®ãƒ¡ãƒ³ãƒã®ãŸã‚é™çš„ã§ã¯ã‚ã‚Šã¾ã›ã‚“"
#: cp/class.c:3029
#, gcc-internal-format
@@ -24964,14 +24963,14 @@ msgid "%q+D may not have reference type %qT because it is a member of a union"
msgstr ""
#: cp/class.c:3040
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "field %q+D invalidly declared function type"
-msgstr "パラメタã¯ãƒ¡ã‚½ãƒƒãƒ‰ã®åž‹ã‚’ä¸æ­£ã«å®£è¨€ã—ã¾ã—ãŸ"
+msgstr "フィールド %q+D ã¯ãŒé–¢æ•°åž‹ã¨ã—ã¦ç„¡åŠ¹ãªå®£è¨€ã‚’ã•ã‚Œã¾ã—ãŸ"
#: cp/class.c:3046
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "field %q+D invalidly declared method type"
-msgstr "パラメタã¯ãƒ¡ã‚½ãƒƒãƒ‰ã®åž‹ã‚’ä¸æ­£ã«å®£è¨€ã—ã¾ã—ãŸ"
+msgstr "フィールド %q+D ã¯ãƒ¡ã‚½ãƒƒãƒ‰åž‹ã¨ã—ã¦ç„¡åŠ¹ãªå®£è¨€ã‚’ã•ã‚Œã¾ã—ãŸ"
#: cp/class.c:3101
#, gcc-internal-format
@@ -24981,12 +24980,12 @@ msgstr ""
#: cp/class.c:3193
#, gcc-internal-format
msgid "field %q+#D with same name as class"
-msgstr ""
+msgstr "フィールド %q+#D ãŒã‚¯ãƒ©ã‚¹åã¨åŒã˜ã§ã™"
#: cp/class.c:3216
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "%q#T has pointer data members"
-msgstr " ãƒã‚¤ãƒ³ã‚¿ã‹ã‚‰ãƒ¡ãƒ³ãƒã¸ã®å¤‰æ›ã§"
+msgstr "%q#T ãŒãƒã‚¤ãƒ³ã‚¿ãƒ‡ãƒ¼ã‚¿ãƒ¡ãƒ³ãƒã‚’æŒã£ã¦ã„ã¾ã™"
#: cp/class.c:3221
#, gcc-internal-format
@@ -25014,9 +25013,9 @@ msgid "class %qT will be considered nearly empty in a future version of GCC"
msgstr ""
#: cp/class.c:3899
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "initializer specified for non-virtual method %q+D"
-msgstr "仮想関数を使用ã™ã‚‹ã‚ªãƒ–ジェクト用ã®åˆæœŸåŒ–å­ãƒªã‚¹ãƒˆã§ã™"
+msgstr "éžä»®æƒ³é–¢æ•° %q+D 用ã®åˆæœŸåŒ–å­ãŒæŒ‡å®šã•ã‚Œã¦ã„ã¾ã™"
#: cp/class.c:4527
#, gcc-internal-format
@@ -25026,19 +25025,19 @@ msgstr ""
#: cp/class.c:4636
#, gcc-internal-format
msgid "non-static reference %q+#D in class without a constructor"
-msgstr ""
+msgstr "コンストラクタãŒç„¡ã„クラス内ã«éžé™çš„å‚ç…§ %q+#D ãŒã‚ã‚Šã¾ã™"
#: cp/class.c:4641
#, gcc-internal-format
msgid "non-static const member %q+#D in class without a constructor"
-msgstr ""
+msgstr "コンストラクタãŒç„¡ã„クラス内ã«éžé™çš„定数メンム%q+#D ãŒã‚ã‚Šã¾ã™"
#. If the function is defaulted outside the class, we just
#. give the synthesis error.
#: cp/class.c:4667
#, gcc-internal-format
msgid "%q+D declared to take const reference, but implicit declaration would take non-const"
-msgstr ""
+msgstr "%q+D ã¯å®šæ•°å‚照をå–るよã†ã«å®£è¨€ã•ã‚Œã¦ã„ã¾ã™ãŒã€æš—黙的ãªå®£è¨€ã§ã¯éžå®šæ•°å‚照をå–ã‚Šã¾ã™"
#: cp/class.c:4670
#, gcc-internal-format
@@ -25048,62 +25047,62 @@ msgstr ""
#: cp/class.c:4894
#, gcc-internal-format
msgid "offset of virtual base %qT is not ABI-compliant and may change in a future version of GCC"
-msgstr ""
+msgstr "仮想基底 %qT ã®ã‚ªãƒ•ã‚»ãƒƒãƒˆã¯ ABI ã«é©åˆã—ã¦ã„ãªã„ãŸã‚å°†æ¥ã®ãƒãƒ¼ã‚¸ãƒ§ãƒ³ã® GCC ã§ã¯å¤‰æ›´ã«ãªã‚‹ã‹ã‚‚ã—ã‚Œã¾ã›ã‚“"
#: cp/class.c:4995
#, gcc-internal-format
msgid "direct base %qT inaccessible in %qT due to ambiguity"
-msgstr ""
+msgstr "直接ã®åŸºåº• %qT ã¯æ›–昧ãªãŸã‚ %qT 内ã§ã‚¢ã‚¯ã‚»ã‚¹ã§ãã¾ã›ã‚“"
#: cp/class.c:5007
#, gcc-internal-format
msgid "virtual base %qT inaccessible in %qT due to ambiguity"
-msgstr ""
+msgstr "仮想基底 %qT ã¯æ›–昧ãªãŸã‚ %qT 内ã§ã¯ã‚¢ã‚¯ã‚»ã‚¹ã§ãã¾ã›ã‚“"
#: cp/class.c:5193
#, gcc-internal-format
msgid "size assigned to %qT may not be ABI-compliant and may change in a future version of GCC"
-msgstr ""
+msgstr "%qT ã¸ä»£å…¥ã•ã‚ŒãŸã‚µã‚¤ã‚ºã¯ ABI ã«é©åˆã—ã¦ã„ãªã„ã‹ã‚‚ã—ã‚Œãªã„ãŸã‚å°†æ¥ã®ãƒãƒ¼ã‚¸ãƒ§ãƒ³ã® GCC ã§ã¯å¤‰æ›´ã«ãªã‚‹ã‹ã‚‚ã—ã‚Œã¾ã›ã‚“"
#: cp/class.c:5233
#, gcc-internal-format
msgid "the offset of %qD may not be ABI-compliant and may change in a future version of GCC"
-msgstr ""
+msgstr "%qD ã®ã‚ªãƒ•ã‚»ãƒƒãƒˆã¯ ABI ã«é©åˆã—ã¦ã„ãªã„ã‹ã‚‚ã—ã‚Œãªã„ãŸã‚å°†æ¥ã®ãƒãƒ¼ã‚¸ãƒ§ãƒ³ã® GCC ã§ã¯å¤‰æ›´ã«ãªã‚‹ã‹ã‚‚ã—ã‚Œã¾ã›ã‚“"
#: cp/class.c:5261
#, gcc-internal-format
msgid "offset of %q+D is not ABI-compliant and may change in a future version of GCC"
-msgstr ""
+msgstr "%q+D ã®ã‚ªãƒ•ã‚»ãƒƒãƒˆã¯ ABI ã«é©åˆã—ã¦ã„ãªã„ãŸã‚å°†æ¥ã®ãƒãƒ¼ã‚¸ãƒ§ãƒ³ã® GCC ã§ã¯å¤‰æ›´ã«ãªã‚‹ã‹ã‚‚ã—ã‚Œã¾ã›ã‚“"
#: cp/class.c:5271
#, gcc-internal-format
msgid "%q+D contains empty classes which may cause base classes to be placed at different locations in a future version of GCC"
-msgstr ""
+msgstr "%q+D ã¯ç©ºã®ã‚¯ãƒ©ã‚¹ã‚’å«ã‚“ã§ã„ã‚‹ãŸã‚å°†æ¥ã®ãƒãƒ¼ã‚¸ãƒ§ãƒ³ã® GCC ã§ã¯åŸºåº•ã‚¯ãƒ©ã‚¹ãŒåˆ¥ã®å ´æ‰€ã«é…ç½®ã•ã‚Œã‚‹ã‹ã‚‚ã—ã‚Œã¾ã›ã‚“"
#: cp/class.c:5359
#, gcc-internal-format
msgid "layout of classes derived from empty class %qT may change in a future version of GCC"
-msgstr ""
+msgstr "空ã®ã‚¯ãƒ©ã‚¹ %qT ã‹ã‚‰å¾—られãŸã‚¯ãƒ©ã‚¹ã®é…ç½®ã¯å°†æ¥ã®ãƒãƒ¼ã‚¸ãƒ§ãƒ³ã® GCC ã§ã¯å¤‰æ›´ã«ãªã‚‹ã‹ã‚‚ã—ã‚Œã¾ã›ã‚“"
#: cp/class.c:5512 cp/decl.c:11309 cp/parser.c:17464
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "redefinition of %q#T"
-msgstr "`%s' ãŒå†å®šç¾©ã•ã‚Œã¾ã—ãŸ"
+msgstr "%q#T ãŒå†å®šç¾©ã•ã‚Œã¦ã„ã¾ã™"
#: cp/class.c:5664
#, gcc-internal-format
msgid "%q#T has virtual functions and accessible non-virtual destructor"
-msgstr ""
+msgstr "%q#T ã¯ä»®æƒ³é–¢æ•°ã‚’æŒã£ã¦ãŠã‚Šéžä»®æƒ³ãƒ‡ã‚¹ãƒˆãƒ©ã‚¯ã‚¿ã‹ã‚‰ã‚¢ã‚¯ã‚»ã‚¹å¯èƒ½ã§ã™"
#: cp/class.c:5769
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "trying to finish struct, but kicked out due to previous parse errors"
-msgstr "構文解æžãŒæ§‹é€ ä½“ã®çµ‚ã‚Šã«å·®ã—掛ã‹ã‚Šã¾ã—ãŸãŒã€å‰ã®ã‚¨ãƒ©ãƒ¼ã®ã›ã„ã§æ–‡è„ˆã‚’見失ã„ã¾ã—ãŸ"
+msgstr ""
#: cp/class.c:6261
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "language string %<\"%E\"%> not recognized"
-msgstr "言語文字列 `\"%s\"' ã¯èªè­˜ã•ã‚Œã¾ã›ã‚“"
+msgstr "言語文字列 %<\"%E\"%> ã¯èªè­˜ã§ãã¾ã›ã‚“"
#: cp/class.c:6351
#, gcc-internal-format
@@ -25113,17 +25112,17 @@ msgstr ""
#: cp/class.c:6475
#, gcc-internal-format
msgid "no matches converting function %qD to type %q#T"
-msgstr ""
+msgstr "関数 %qD ã‹ã‚‰åž‹ %q#T ã¸ã®å¤‰æ›ãŒé©åˆã—ã¾ã›ã‚“"
#: cp/class.c:6505
#, gcc-internal-format
msgid "converting overloaded function %qD to type %q#T is ambiguous"
-msgstr ""
+msgstr "オーãƒãƒ¼ãƒ­ãƒ¼ãƒ‰ã•ã‚ŒãŸé–¢æ•° %qD ã‹ã‚‰åž‹ %q#T ã¸ã®å¤‰æ›ã¯æ›–昧ã§ã™"
#: cp/class.c:6532
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "assuming pointer to member %qD"
-msgstr " ãƒã‚¤ãƒ³ã‚¿ã‹ã‚‰ãƒ¡ãƒ³ãƒã¸ã®å¤‰æ›ã§"
+msgstr "メンム%qD ã¸ã®ãƒã‚¤ãƒ³ã‚¿ã¨è¦‹ãªã—ã¦ã„ã¾ã™"
#: cp/class.c:6535
#, gcc-internal-format
@@ -25133,12 +25132,12 @@ msgstr ""
#: cp/class.c:6597 cp/class.c:6631
#, gcc-internal-format
msgid "not enough type information"
-msgstr "ä¸å分ãªåž‹æƒ…å ±"
+msgstr "型情報ãŒä¸å分ã§ã™"
#: cp/class.c:6614
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "argument of type %qT does not match %qT"
-msgstr "仮引数 `%s' ã¯ãƒ—ロトタイプã«ä¸€è‡´ã—ã¾ã›ã‚“"
+msgstr "åž‹ %qT ã®å¼•æ•°ãŒ %qT ã¨ä¸€è‡´ã—ã¾ã›ã‚“"
#. [basic.scope.class]
#.
@@ -25146,19 +25145,19 @@ msgstr "仮引数 `%s' ã¯ãƒ—ロトタイプã«ä¸€è‡´ã—ã¾ã›ã‚“"
#. in its context and when re-evaluated in the completed scope of
#. S.
#: cp/class.c:6925 cp/decl.c:1261 cp/name-lookup.c:524
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "declaration of %q#D"
-msgstr "`%s' ãŒå†å®£è¨€ã•ã‚Œã¾ã—ãŸ"
+msgstr "%q#D ãŒå®£è¨€ã•ã‚Œã¦ã„ã¾ã™"
#: cp/class.c:6926
#, gcc-internal-format
msgid "changes meaning of %qD from %q+#D"
-msgstr ""
+msgstr "%qD ã®æ„味㮠%q+#D ã‹ã‚‰ã®å¤‰æ›´ã§ã™"
#: cp/cp-gimplify.c:93
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "continue statement not within loop or switch"
-msgstr "break 文㌠loop ã¾ãŸã¯ switch ã®ä¸­ã«ã‚ã‚Šã¾ã›ã‚“"
+msgstr "ループã¾ãŸã¯ switch 内ã«ç„¡ã„ continue ã§ã™"
#: cp/cp-gimplify.c:1257
#, gcc-internal-format
@@ -25168,17 +25167,17 @@ msgstr ""
#: cp/cvt.c:90
#, gcc-internal-format
msgid "can%'t convert from incomplete type %qT to %qT"
-msgstr ""
+msgstr "ä¸å®Œå…¨åž‹ %qT ã‹ã‚‰ %qT ã¸å¤‰æ›ã§ãã¾ã›ã‚“"
#: cp/cvt.c:99
#, gcc-internal-format
msgid "conversion of %qE from %qT to %qT is ambiguous"
-msgstr ""
+msgstr "%qE ã® %qT ã‹ã‚‰ %qT ã¸ã®å¤‰æ›ã¯æ›–昧ã§ã™"
#: cp/cvt.c:168 cp/cvt.c:193 cp/cvt.c:238
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "cannot convert %qE from type %qT to type %qT"
-msgstr "ãƒã‚¤ãƒ³ã‚¿åž‹ã«å¤‰æ›ã§ãã¾ã›ã‚“"
+msgstr "%qE ã‚’åž‹ %qT ã‹ã‚‰åž‹ %qT ã¸å¤‰æ›ã§ãã¾ã›ã‚“"
#: cp/cvt.c:370
#, gcc-internal-format
@@ -25211,39 +25210,39 @@ msgid "casting %qT to %qT does not dereference pointer"
msgstr ""
#: cp/cvt.c:498
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "cannot convert type %qT to type %qT"
-msgstr "ãƒã‚¤ãƒ³ã‚¿åž‹ã«å¤‰æ›ã§ãã¾ã›ã‚“"
+msgstr "åž‹ %qT ã‹ã‚‰åž‹ %qT ã¸å¤‰æ›ã§ãã¾ã›ã‚“"
#: cp/cvt.c:698
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "conversion from %q#T to %q#T"
-msgstr "NaN ã‹ã‚‰æ•´æ•°ã¸ã®å¤‰æ›ã§ã™"
+msgstr "%q#T ã‹ã‚‰ %q#T ã¸ã®å¤‰æ›ã§ã™"
#: cp/cvt.c:714
#, gcc-internal-format
msgid "the result of the conversion is unspecified because %qE is outside the range of type %qT"
-msgstr ""
+msgstr "%qE ãŒåž‹ %qT ã®ç¯„囲外ã«ã‚ã‚‹ã®ã§å¤‰æ›çµæžœã¯ä¸å®šã§ã™"
#: cp/cvt.c:725 cp/cvt.c:750
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "%q#T used where a %qT was expected"
-msgstr "浮動å°æ•°ç‚¹åž‹ãŒã‚ã‚‹ã¹ã箇所ã§ã€é›†åˆä½“ã®å€¤ãŒä½¿ã‚ã‚Œã¾ã—ãŸ"
+msgstr "%q#T ㌠%qT ãŒäºˆæœŸã•ã‚Œã‚‹å ´æ‰€ã§ä½¿ç”¨ã•ã‚Œã¾ã—ãŸ"
#: cp/cvt.c:765
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "%q#T used where a floating point value was expected"
-msgstr "浮動å°æ•°ç‚¹æ•°ãŒã‚ã‚‹ã¹ã箇所ã§ã€ãƒã‚¤ãƒ³ã‚¿å€¤ãŒä½¿ã‚ã‚Œã¾ã—ãŸ"
+msgstr "%q#T ãŒæµ®å‹•å°æ•°ç‚¹å€¤ãŒäºˆæœŸã•ã‚Œã‚‹å ´æ‰€ã§ä½¿ç”¨ã•ã‚Œã¾ã—ãŸ"
#: cp/cvt.c:825
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "conversion from %qT to non-scalar type %qT requested"
-msgstr "éžã‚¹ã‚«ãƒ©ãƒ¼åž‹ã¸ã®å¤‰æ›ãŒè¦æ±‚ã•ã‚Œã¾ã™"
+msgstr "%qT ã‹ã‚‰éžã‚¹ã‚«ãƒ©åž‹ %qT ã¸ã®å¤‰æ›ãŒè¦æ±‚ã•ã‚Œã¾ã—ãŸ"
#: cp/cvt.c:883
#, gcc-internal-format
msgid "pseudo-destructor is not called"
-msgstr ""
+msgstr "疑似デストラクタãŒå‘¼ã³å‡ºã•ã‚Œã¾ã›ã‚“"
#: cp/cvt.c:956
#, gcc-internal-format
@@ -25473,7 +25472,7 @@ msgstr ""
#: cp/cvt.c:1295
#, gcc-internal-format
msgid "statement has no effect"
-msgstr ""
+msgstr "æ–‡ã¯åŠ¹æžœãŒã‚ã‚Šã¾ã›ã‚“"
#: cp/cvt.c:1299
#, gcc-internal-format
@@ -25481,14 +25480,14 @@ msgid "for increment expression has no effect"
msgstr ""
#: cp/cvt.c:1448
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "converting NULL to non-pointer type"
-msgstr "ä¸å®Œå…¨åž‹ã¸ã®å¤‰æ›ã§ã™"
+msgstr "NULL ã‹ã‚‰éžãƒã‚¤ãƒ³ã‚¿åž‹ã¸å¤‰æ›ã—ã¦ã„ã¾ã™"
#: cp/cvt.c:1560
#, gcc-internal-format
msgid "ambiguous default type conversion from %qT"
-msgstr ""
+msgstr "%qT ã‹ã‚‰ã®ãƒ‡ãƒ•ã‚©ãƒ«ãƒˆã®åž‹å¤‰æ›ãŒæ›–昧ã§ã™"
#: cp/cvt.c:1562
#, gcc-internal-format
@@ -25498,17 +25497,19 @@ msgstr ""
#: cp/decl.c:636
#, gcc-internal-format
msgid "variable %q+D set but not used"
-msgstr ""
+msgstr "変数 %q+D ãŒè¨­å®šã•ã‚Œã¾ã—ãŸãŒä½¿ç”¨ã•ã‚Œã¦ã„ã¾ã›ã‚“"
+# ã“ã“より下ã®æ•°æ–‡ã¯ä¸€ã¤ã®æ–‡ãŒ2個以上㮠msgid ã«åˆ†å‰²ã•ã‚Œã¦ã„ã¾ã™
+# 訳ã™ã®ã¯éžå¸¸ã«å›°é›£ã§ã™
#: cp/decl.c:1097
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "%qD was declared %<extern%> and later %<static%>"
-msgstr "`%s' 㯠`extern' ã¨å®£è¨€ã•ã‚Œã€å¾Œã§ `static' ã¨å®£è¨€ã•ã‚Œã¾ã—ãŸ"
+msgstr ""
#: cp/decl.c:1098 cp/decl.c:1677 objc/objc-act.c:4486 objc/objc-act.c:9559
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "previous declaration of %q+D"
-msgstr "å‰æ–¹ã§ã® `%s' ã®å®£è¨€"
+msgstr ""
#: cp/decl.c:1130
#, gcc-internal-format
@@ -25516,9 +25517,9 @@ msgid "declaration of %qF has a different exception specifier"
msgstr ""
#: cp/decl.c:1132
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "from previous declaration %q+F"
-msgstr "`%s' ã®å‰æ–¹å®£è¨€ãŒã‚ã‚Šã¾ã›ã‚“"
+msgstr ""
#: cp/decl.c:1157
#, gcc-internal-format
@@ -25531,100 +25532,100 @@ msgid "from previous declaration %q+D"
msgstr ""
#: cp/decl.c:1214
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "function %q+D redeclared as inline"
-msgstr "関数ãŒå¤§ãã™ãŽã¦ inline ã«ã§ãã¾ã›ã‚“"
+msgstr ""
#: cp/decl.c:1216
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "previous declaration of %q+D with attribute noinline"
-msgstr "å‰æ–¹ã§ã® `%s' ã®å®£è¨€"
+msgstr ""
#: cp/decl.c:1223
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "function %q+D redeclared with attribute noinline"
-msgstr "関数ãŒå¤§ãã™ãŽã¦ inline ã«ã§ãã¾ã›ã‚“"
+msgstr ""
#: cp/decl.c:1225
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "previous declaration of %q+D was inline"
-msgstr "å‰æ–¹ã§ã® `%s' ã®å®£è¨€"
+msgstr ""
#: cp/decl.c:1249 cp/decl.c:1323
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "shadowing built-in function %q#D"
-msgstr "組ã¿è¾¼ã¿é–¢æ•° `%s' を覆ã„éš ã—ã¾ã™"
+msgstr "組ã¿è¾¼ã¿é–¢æ•° %q#D を覆ã„éš ã—ã¦ã„ã¾ã™"
#: cp/decl.c:1250 cp/decl.c:1324
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "shadowing library function %q#D"
-msgstr "ライブラリ関数 `%s' を覆ã„éš ã—ã¾ã™"
+msgstr "ライブラリ関数 %q#D を覆ã„éš ã—ã¦ã„ã¾ã™"
#: cp/decl.c:1257
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "library function %q#D redeclared as non-function %q#D"
-msgstr "ライブラリ関数 `%s' ã¯éžé–¢æ•°ã¨ã—ã¦å®£è¨€ã•ã‚Œã¾ã—ãŸ"
+msgstr "ライブラリ関数 %q#D ã¯éžé–¢æ•° %q#D ã¨ã—ã¦å†å®£è¨€ã•ã‚Œã¦ã„ã¾ã™"
#: cp/decl.c:1262
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "conflicts with built-in declaration %q#D"
-msgstr "`%s' ã®å®£è¨€ãŒçŸ›ç›¾ã—ã¦ã„ã¾ã™"
+msgstr ""
#: cp/decl.c:1316 cp/decl.c:1443 cp/decl.c:1459
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "new declaration %q#D"
-msgstr "空ã®å®£è¨€ã§ã™"
+msgstr ""
#: cp/decl.c:1317
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "ambiguates built-in declaration %q#D"
-msgstr "ラベルã®å®£è¨€ `%s' ãŒé‡è¤‡ã—ã¦ã„ã¾ã™"
+msgstr ""
#: cp/decl.c:1407
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "%q#D redeclared as different kind of symbol"
-msgstr "`%s' ãŒåˆ¥ã®ã‚·ãƒ³ãƒœãƒ«ç¨®ã¨ã—ã¦å†å®£è¨€ã•ã‚Œã¾ã—ãŸ"
+msgstr ""
#: cp/decl.c:1410
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "previous declaration of %q+#D"
-msgstr "å‰æ–¹ã§ã® `%s' ã®å®£è¨€"
+msgstr ""
#: cp/decl.c:1429
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "declaration of template %q#D"
-msgstr "`enum %s' ã®å†å®£è¨€"
+msgstr ""
#: cp/decl.c:1430 cp/name-lookup.c:525 cp/name-lookup.c:811
#: cp/name-lookup.c:822
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "conflicts with previous declaration %q+#D"
-msgstr "`%s' ã®ã‚»ã‚¯ã‚·ãƒ§ãƒ³ã¯å‰æ–¹ã§ã«å®£è¨€ã•ã‚ŒãŸã‚‚ã®ã¨è¡çªã—ã¾ã™"
+msgstr ""
#: cp/decl.c:1444 cp/decl.c:1460
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "ambiguates old declaration %q+#D"
-msgstr "ラベルã®å®£è¨€ `%s' ãŒé‡è¤‡ã—ã¦ã„ã¾ã™"
+msgstr ""
#: cp/decl.c:1452
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "declaration of C function %q#D conflicts with"
-msgstr "%s: 関数 `%s' ã®å®£è¨€ãŒå¤‰æ›ã•ã‚Œã¦ã„ã¾ã›ã‚“\n"
+msgstr ""
#: cp/decl.c:1454
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "previous declaration %q+#D here"
-msgstr "å‰æ–¹ã§ã® `%s' ã®å®£è¨€"
+msgstr ""
#: cp/decl.c:1468
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "conflicting declaration %q#D"
-msgstr "`%s' ã®å®£è¨€ãŒçŸ›ç›¾ã—ã¦ã„ã¾ã™"
+msgstr ""
#: cp/decl.c:1469
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "%q+D has a previous declaration as %q#D"
-msgstr "å‰æ–¹ã§ã® `%s' ã®å®£è¨€"
+msgstr ""
#. [namespace.alias]
#.
@@ -25639,35 +25640,35 @@ msgid "declaration of namespace %qD conflicts with"
msgstr ""
#: cp/decl.c:1522
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "previous declaration of namespace %q+D here"
-msgstr "å‰æ–¹ã§ã® `%s' ã®å®£è¨€"
+msgstr ""
#: cp/decl.c:1533
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "%q+#D previously defined here"
-msgstr "`%s' ã¯å‰ã«ã“ã“ã§å®šç¾©ã•ã‚Œã¾ã—ãŸ"
+msgstr ""
#. Prototype decl follows defn w/o prototype.
#: cp/decl.c:1543
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "prototype for %q+#D"
-msgstr "`%s' ã®ãƒ—ロトタイプãŒå¾Œã‚ã«ã‚ã‚Šã¾ã™"
+msgstr ""
#: cp/decl.c:1545
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "follows non-prototype definition here"
-msgstr "éžãƒ—ロトタイプ定義ãŒã“ã“ã«ã‚ã‚Šã¾ã™"
+msgstr ""
#: cp/decl.c:1585
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "previous declaration of %q+#D with %qL linkage"
-msgstr "å‰æ–¹ã§ã® `%s' ã®å®£è¨€"
+msgstr ""
#: cp/decl.c:1587
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "conflicts with new declaration with %qL linkage"
-msgstr "`%s' ã®å®£è¨€ãŒçŸ›ç›¾ã—ã¦ã„ã¾ã™"
+msgstr ""
#: cp/decl.c:1610 cp/decl.c:1616
#, gcc-internal-format
@@ -25680,19 +25681,19 @@ msgid "after previous specification in %q+#D"
msgstr ""
#: cp/decl.c:1676
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "redundant redeclaration of %qD in same scope"
-msgstr "`%s' ã®å†—é•·ãªå†å®£è¨€ãŒåŒä¸€ã‚¹ã‚³ãƒ¼ãƒ—内ã«ã‚ã‚Šã¾ã™"
+msgstr ""
#: cp/decl.c:1682
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "deleted definition of %qD"
-msgstr "`%s' ã®ãƒã‚¹ãƒˆã—ãŸå†å®šç¾©"
+msgstr ""
#: cp/decl.c:1683
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "after previous declaration %q+D"
-msgstr "å‰æ–¹ã§ã® `%s' ã®å®£è¨€"
+msgstr ""
#. From [temp.expl.spec]:
#.
@@ -25713,20 +25714,20 @@ msgid "%q+D: visibility attribute ignored because it"
msgstr ""
#: cp/decl.c:2137
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "conflicts with previous declaration here"
-msgstr "`%s' ã®ã‚»ã‚¯ã‚·ãƒ§ãƒ³ã¯å‰æ–¹ã§ã«å®£è¨€ã•ã‚ŒãŸã‚‚ã®ã¨è¡çªã—ã¾ã™"
+msgstr ""
#. Reject two definitions.
#: cp/decl.c:2299 cp/decl.c:2328 cp/decl.c:2357 cp/decl.c:2374 cp/decl.c:2446
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "redefinition of %q#D"
-msgstr "`%s' ãŒå†å®šç¾©ã•ã‚Œã¾ã—ãŸ"
+msgstr ""
#: cp/decl.c:2315
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "%qD conflicts with used function"
-msgstr "`%s' ã®ã‚»ã‚¯ã‚·ãƒ§ãƒ³ã¯å‰æ–¹ã§ã«å®£è¨€ã•ã‚ŒãŸã‚‚ã®ã¨è¡çªã—ã¾ã™"
+msgstr ""
#: cp/decl.c:2325
#, gcc-internal-format
@@ -25752,24 +25753,24 @@ msgid "redeclaration of friend %q#D may not have default template arguments"
msgstr ""
#: cp/decl.c:2417
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "thread-local declaration of %q#D follows non-thread-local declaration"
-msgstr "`%s' ã®å®£è¨€ã¯ã‚°ãƒ­ãƒ¼ãƒãƒ«å®£è¨€ã‚’覆ã„éš ã—ã¾ã™"
+msgstr ""
#: cp/decl.c:2420
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "non-thread-local declaration of %q#D follows thread-local declaration"
-msgstr "`%s' ã®å®£è¨€ã¯ã‚°ãƒ­ãƒ¼ãƒãƒ«å®£è¨€ã‚’覆ã„éš ã—ã¾ã™"
+msgstr ""
#: cp/decl.c:2435 cp/decl.c:2454
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "redeclaration of %q#D"
-msgstr "`%s' ãŒå†å®£è¨€ã•ã‚Œã¾ã—ãŸ"
+msgstr ""
#: cp/decl.c:2598
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "jump to label %qD"
-msgstr "case ラベルã«ã‚¸ãƒ£ãƒ³ãƒ—ã—ã¦ã„ã¾ã™"
+msgstr ""
#: cp/decl.c:2600
#, gcc-internal-format
@@ -25787,9 +25788,9 @@ msgid " exits OpenMP structured block"
msgstr ""
#: cp/decl.c:2642
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid " crosses initialization of %q+#D"
-msgstr "(`%s' ã®åˆæœŸåŒ–ã¯ä¸å®Œå…¨ã§ã™)"
+msgstr ""
#: cp/decl.c:2644 cp/decl.c:2760
#, gcc-internal-format
@@ -27583,12 +27584,12 @@ msgstr ""
#: cp/decl2.c:319
#, gcc-internal-format
msgid "name missing for member function"
-msgstr "メンãƒé–¢æ•°ã®åå‰ã‚’欠ã„ã¦ã„ã¾ã™"
+msgstr "メンãƒé–¢æ•°ã®åå‰ãŒã‚ã‚Šã¾ã›ã‚“"
#: cp/decl2.c:390 cp/decl2.c:404
#, gcc-internal-format
msgid "ambiguous conversion for array subscript"
-msgstr "é…列ã®æ·»å­—ã«å¯¾ã™ã‚‹æ›–昧ãªå¤‰æ›"
+msgstr "é…列ã®æ·»å­—用ã®æ›–昧ãªå¤‰æ›ã§ã™"
#: cp/decl2.c:398
#, gcc-internal-format
@@ -27598,37 +27599,37 @@ msgstr ""
#: cp/decl2.c:441
#, gcc-internal-format
msgid "deleting array %q#D"
-msgstr ""
+msgstr "é…列 %q#D を削除ã—ã¦ã„ã¾ã™"
#: cp/decl2.c:447
#, gcc-internal-format
msgid "type %q#T argument given to %<delete%>, expected pointer"
-msgstr ""
+msgstr "%<delete%> ã«ä¸Žãˆã‚‰ã‚Œã‚‹åž‹ %q#T ã®å¼•æ•°ã¯ãƒã‚¤ãƒ³ã‚¿ãŒäºˆæœŸã•ã‚Œã¾ã™"
#: cp/decl2.c:459
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "cannot delete a function. Only pointer-to-objects are valid arguments to %<delete%>"
-msgstr "関数㯠delete ã§ãã¾ã›ã‚“。 オブジェクトã¸ã®ãƒã‚¤ãƒ³ã‚¿ã ã‘㌠`delete' 引数ã¨ã—ã¦æœ‰åŠ¹ã§ã™"
+msgstr "関数を削除 (delete) ã§ãã¾ã›ã‚“。%<delete%> ã®æœ‰åŠ¹ãªå¼•æ•°ã¯ã‚ªãƒ–ジェクトã¸ã®ãƒã‚¤ãƒ³ã‚¿ã®ã¿ã§ã™"
#: cp/decl2.c:467
#, gcc-internal-format
msgid "deleting %qT is undefined"
-msgstr ""
+msgstr "%qT ã®å‰Šé™¤ã¯å®šç¾©ã•ã‚Œã¦ã„ã¾ã›ã‚“"
#: cp/decl2.c:510 cp/pt.c:4760
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "template declaration of %q#D"
-msgstr "空ã®å®£è¨€ã§ã™"
+msgstr "%q#D ã®ãƒ†ãƒ³ãƒ—レート宣言ã§ã™"
#: cp/decl2.c:562
#, gcc-internal-format
msgid "Java method %qD has non-Java return type %qT"
-msgstr ""
+msgstr "Java メソッド %qD ãŒéž Java 戻り型 %qT ã‚’æŒã¡ã¾ã™"
#: cp/decl2.c:579
#, gcc-internal-format
msgid "Java method %qD has non-Java parameter type %qT"
-msgstr ""
+msgstr "Java メソッド %qD ãŒéž Java 仮引数型 %qT ã‚’æŒã¡ã¾ã™"
#: cp/decl2.c:628
#, gcc-internal-format
@@ -27638,17 +27639,17 @@ msgstr ""
#: cp/decl2.c:696
#, gcc-internal-format
msgid "prototype for %q#D does not match any in class %qT"
-msgstr ""
+msgstr "%q#D 用ã®ãƒ—ロトタイプãŒã‚¯ãƒ©ã‚¹ %qT 内ã®ã©ã‚Œã¨ã‚‚一致ã—ã¾ã›ã‚“"
#: cp/decl2.c:772
#, gcc-internal-format
msgid "local class %q#T shall not have static data member %q#D"
-msgstr ""
+msgstr "局所クラス %q#T ã¯é™çš„データメンム%q#D ã‚’æŒã£ã¦ã„ã¦ã¯ã„ã‘ã¾ã›ã‚“"
#: cp/decl2.c:833
#, gcc-internal-format
msgid "explicit template argument list not allowed"
-msgstr ""
+msgstr "明示的ãªãƒ†ãƒ³ãƒ—レート引数リストã¯è¨±å¯ã•ã‚Œã¦ã„ã¾ã›ã‚“"
#: cp/decl2.c:839
#, gcc-internal-format
@@ -27658,57 +27659,57 @@ msgstr ""
#: cp/decl2.c:875
#, gcc-internal-format
msgid "%qD is already defined in %qT"
-msgstr ""
+msgstr "%qD ã¯æ—¢ã« %qT 内ã§å®šç¾©ã•ã‚Œã¦ã„ã¾ã™"
#: cp/decl2.c:910
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "invalid initializer for member function %qD"
-msgstr "無効ãªãƒ“ット列åˆæœŸåŒ–å­ã§ã™"
+msgstr "メンãƒé–¢æ•° %qD 用ã®ç„¡åŠ¹ãªåˆæœŸåŒ–å­ã§ã™"
#: cp/decl2.c:916
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "initializer specified for static member function %qD"
-msgstr "コンストラクタã®é™çš„メンãƒåˆæœŸåŒ–å­ã¯ç„¡åŠ¹ã§ã™"
+msgstr "é™çš„メンãƒé–¢æ•° %qD 用ã®åˆæœŸåŒ–å­ãŒæŒ‡å®šã•ã‚Œã¦ã„ã¾ã™"
#: cp/decl2.c:938
#, gcc-internal-format
msgid "field initializer is not constant"
-msgstr "フィールドåˆæœŸè¨­å®šå­ãŒå®šæ•°ã§ã¯ã‚ã‚Šã¾ã›ã‚“"
+msgstr "フィールドåˆæœŸåŒ–å­ãŒå®šæ•°ã§ã¯ã‚ã‚Šã¾ã›ã‚“"
#: cp/decl2.c:965
#, gcc-internal-format
msgid "%<asm%> specifiers are not permitted on non-static data members"
-msgstr ""
+msgstr "%<asm%> 指定ã¯éžé™çš„データメンãƒã«é–¢ã—ã¦ã¯è¨±å¯ã•ã‚Œã¦ã„ã¾ã›ã‚“"
#: cp/decl2.c:1017
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "bit-field %qD with non-integral type"
-msgstr "ビットフィールド `%s' ã®å¹…ãŒæ•´æ•°å®šæ•°ã§ã¯ã‚ã‚Šã¾ã›ã‚“"
+msgstr "éžæ•´æ•°åž‹ã®ãƒ“ットフィールド %qD ã§ã™"
#: cp/decl2.c:1023
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "cannot declare %qD to be a bit-field type"
-msgstr "`::main' ã‚’ template ã¨ã—ã¦ã¯å®£è¨€ã§ãã¾ã›ã‚“"
+msgstr "%qD をビットフィールド型ã¨ã—ã¦å®£è¨€ã§ãã¾ã›ã‚“"
#: cp/decl2.c:1033
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "cannot declare bit-field %qD with function type"
-msgstr "関数型ã«å¯¾ã—㦠new ã‚’é©ç”¨ã§ãã¾ã›ã‚“"
+msgstr "ビットフィールド %qD を関数型ã¨ã—ã¦å®£è¨€ã§ãã¾ã›ã‚“"
#: cp/decl2.c:1040
#, gcc-internal-format
msgid "%qD is already defined in the class %qT"
-msgstr ""
+msgstr "%qD ã¯æ—¢ã«ã‚¯ãƒ©ã‚¹ %qT 内ã§å®šç¾©ã•ã‚Œã¦ã„ã¾ã™"
#: cp/decl2.c:1047
#, gcc-internal-format
msgid "static member %qD cannot be a bit-field"
-msgstr ""
+msgstr "é™çš„メンム%qD ã¯ãƒ“ットフィールドã«å‡ºæ¥ã¾ã›ã‚“"
#: cp/decl2.c:1056
#, gcc-internal-format
msgid "width of bit-field %qD has non-integral type %qT"
-msgstr ""
+msgstr "ビットフィールドã®å¹…㌠%qD éžæ•´æ•°åž‹ %qT ã§ã™"
#: cp/decl2.c:1308
#, gcc-internal-format
@@ -27721,14 +27722,14 @@ msgid "namespace-scope anonymous aggregates must be static"
msgstr "anonumous åå‰ç©ºé–“ã®é›†åˆä½“㯠static ã§ãªã‘ã‚Œã°ãªã‚Šã¾ã›ã‚“"
#: cp/decl2.c:1403
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "anonymous union with no members"
-msgstr "ç„¡å共用体ã«ãƒ¡ãƒ³ãƒãŒã‚ã‚Šã¾ã›ã‚“"
+msgstr "メンãƒãŒãªã„ç„¡å共用体ã§ã™"
#: cp/decl2.c:1440
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "%<operator new%> must return type %qT"
-msgstr "`operator delete' ã®æˆ»ã‚Šåž‹ã¯ `void' ã§ãªã‘ã‚Œã°ãªã‚Šã¾ã›ã‚“"
+msgstr "%<operator new%> ã®æˆ»ã‚Šåž‹ã¯ %qT ã§ãªã‘ã‚Œã°ã„ã‘ã¾ã›ã‚“"
#. [basic.stc.dynamic.allocation]
#.
@@ -27737,12 +27738,12 @@ msgstr "`operator delete' ã®æˆ»ã‚Šåž‹ã¯ `void' ã§ãªã‘ã‚Œã°ãªã‚Šã¾ã›ã‚“"
#: cp/decl2.c:1451
#, gcc-internal-format
msgid "the first parameter of %<operator new%> cannot have a default argument"
-msgstr ""
+msgstr "%<operator new%> ã®ç¬¬ä¸€å¼•æ•°ã¯ãƒ‡ãƒ•ã‚©ãƒ«ãƒˆå¼•æ•°ã‚’æŒã£ã¦ã„ã¦ã¯ã„ã‘ã¾ã›ã‚“"
#: cp/decl2.c:1467
-#, fuzzy, gcc-internal-format
+#, gcc-internal-format
msgid "%<operator new%> takes type %<size_t%> (%qT) as first parameter"
-msgstr "`operator new' ã¯ç¬¬ä¸€å¼•æ•°ã¨ã—㦠`size_t' ã‚’ã¨ã‚Šã¾ã™"
+msgstr "%<operator new%> ã¯ç¬¬ä¸€å¼•æ•°ã¨ã—ã¦åž‹ %<size_t%> (%qT) ã‚’ã¨ã‚Šã¾ã™"
#: cp/decl2.c:1496
#, fuzzy, gcc-internal-format
diff --git a/gcc/po/sv.po b/gcc/po/sv.po
index 9825e17cfe6..60f7354b874 100644
--- a/gcc/po/sv.po
+++ b/gcc/po/sv.po
@@ -11,7 +11,7 @@ msgstr ""
"Project-Id-Version: gcc 4.6-b20101218\n"
"Report-Msgid-Bugs-To: http://gcc.gnu.org/bugs.html\n"
"POT-Creation-Date: 2010-12-18 20:02+0000\n"
-"PO-Revision-Date: 2011-01-09 10:58+0100\n"
+"PO-Revision-Date: 2011-01-15 23:21+0100\n"
"Last-Translator: Göran Uddeborg <goeran@uddeborg.se>\n"
"Language-Team: Swedish <tp-sv@listor.tp-sv.se>\n"
"MIME-Version: 1.0\n"
@@ -358,7 +358,7 @@ msgstr "kompilering avslutad.\n"
#: diagnostic.c:508
#, c-format
msgid "%s:%d: confused by earlier errors, bailing out\n"
-msgstr "%s:%d: förvirrar av tidigare fel, hoppar ut\n"
+msgstr "%s:%d: förvirrad av tidigare fel, hoppar ut\n"
#: diagnostic.c:874
#, c-format
@@ -543,7 +543,7 @@ msgstr " -print-file-name=<bib> Visa hela sökvägen till länkbibliotek <bib>\n
#: gcc.c:2906
msgid " -print-prog-name=<prog> Display the full path to compiler component <prog>\n"
-msgstr " -print-prog-name=<prog> Visa fulla sökvägen till kompilatorkomponenten <prog>\n"
+msgstr " -print-prog-name=<prog> Visa hela sökvägen till kompilatorkomponenten <prog>\n"
#: gcc.c:2907
msgid " -print-multi-directory Display the root directory for versions of libgcc\n"
@@ -3743,37 +3743,37 @@ msgstr "%s: I instansiering av %qs:\n"
#: cp/error.c:2874
#, c-format
msgid "%s:%d:%d: recursively instantiated from %qs\n"
-msgstr "%s:%d:%d: rekursivt instantierad från %qs\n"
+msgstr "%s:%d:%d: rekursivt instansierad från %qs\n"
#: cp/error.c:2875
#, c-format
msgid "%s:%d:%d: instantiated from %qs\n"
-msgstr "%s:%d:%d: instantierad från %qs\n"
+msgstr "%s:%d:%d: instansierad från %qs\n"
#: cp/error.c:2880 cp/error.c:2881
#, c-format
msgid "%s:%d: recursively instantiated from %qs\n"
-msgstr "%s:%d: rekursivt instantierad från %qs\n"
+msgstr "%s:%d: rekursivt instansierad från %qs\n"
#: cp/error.c:2889
#, c-format
msgid "%s:%d:%d: recursively instantiated from here"
-msgstr "%s:%d:%d: rekursivt instantierad härifrån"
+msgstr "%s:%d:%d: rekursivt instansierad härifrån"
#: cp/error.c:2890
#, c-format
msgid "%s:%d:%d: instantiated from here"
-msgstr "%s:%d:%d: instantierad härifrån"
+msgstr "%s:%d:%d: instansierad härifrån"
#: cp/error.c:2895
#, c-format
msgid "%s:%d: recursively instantiated from here"
-msgstr "%s:%d: rekursivt instantierad härifrån"
+msgstr "%s:%d: rekursivt instansierad härifrån"
#: cp/error.c:2896
#, c-format
msgid "%s:%d: instantiated from here"
-msgstr "%s:%d: instantierad härifrån"
+msgstr "%s:%d: instansierad härifrån"
#: cp/error.c:2939
#, c-format
@@ -26856,7 +26856,7 @@ msgstr "det går inte att deklarera pekare medlem av %q#T"
#: cp/decl.c:8902
#, gcc-internal-format
msgid "cannot declare reference to qualified function type %qT"
-msgstr "det går inte att deklarera en referen till en kvalificerad funktionstyp %qT"
+msgstr "det går inte att deklarera en referens till en kvalificerad funktionstyp %qT"
#: cp/decl.c:8903
#, gcc-internal-format
diff --git a/gcc/postreload.c b/gcc/postreload.c
index 15c22e28e07..a4234102301 100644
--- a/gcc/postreload.c
+++ b/gcc/postreload.c
@@ -1,7 +1,7 @@
/* Perform simple optimizations to clean up the result of reload.
Copyright (C) 1987, 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997,
1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
- 2010 Free Software Foundation, Inc.
+ 2010, 2011 Free Software Foundation, Inc.
This file is part of GCC.
@@ -112,6 +112,7 @@ reload_cse_simplify (rtx insn, rtx testreg)
if (REG_P (value)
&& ! REG_FUNCTION_VALUE_P (value))
value = 0;
+ check_for_inc_dec (insn);
delete_insn_and_edges (insn);
return;
}
@@ -163,6 +164,7 @@ reload_cse_simplify (rtx insn, rtx testreg)
if (i < 0)
{
+ check_for_inc_dec (insn);
delete_insn_and_edges (insn);
/* We're done with this insn. */
return;
@@ -262,7 +264,7 @@ reload_cse_simplify_set (rtx set, rtx insn)
return 0;
#endif
- val = cselib_lookup (src, GET_MODE (SET_DEST (set)), 0);
+ val = cselib_lookup (src, GET_MODE (SET_DEST (set)), 0, VOIDmode);
if (! val)
return 0;
@@ -476,7 +478,9 @@ reload_cse_simplify_operands (rtx insn, rtx testreg)
continue;
}
#endif /* LOAD_EXTEND_OP */
- v = cselib_lookup (op, recog_data.operand_mode[i], 0);
+ if (side_effects_p (op))
+ continue;
+ v = cselib_lookup (op, recog_data.operand_mode[i], 0, VOIDmode);
if (! v)
continue;
@@ -1009,6 +1013,12 @@ reload_combine_recognize_const_pattern (rtx insn)
&& reg_state[clobbered_regno].real_store_ruid >= use_ruid)
break;
+#ifdef HAVE_cc0
+ /* Do not separate cc0 setter and cc0 user on HAVE_cc0 targets. */
+ if (must_move_add && sets_cc0_p (PATTERN (use_insn)))
+ break;
+#endif
+
gcc_assert (reg_state[regno].store_ruid <= use_ruid);
/* Avoid moving a use of ADDREG past a point where it is stored. */
if (reg_state[REGNO (addreg)].store_ruid > use_ruid)
diff --git a/gcc/predict.c b/gcc/predict.c
index a86708a5935..dc1104f850e 100644
--- a/gcc/predict.c
+++ b/gcc/predict.c
@@ -126,7 +126,7 @@ maybe_hot_frequency_p (int freq)
if (node->frequency == NODE_FREQUENCY_EXECUTED_ONCE
&& freq <= (ENTRY_BLOCK_PTR->frequency * 2 / 3))
return false;
- if (freq < BB_FREQ_MAX / PARAM_VALUE (HOT_BB_FREQUENCY_FRACTION))
+ if (freq < ENTRY_BLOCK_PTR->frequency / PARAM_VALUE (HOT_BB_FREQUENCY_FRACTION))
return false;
return true;
}
diff --git a/gcc/recog.h b/gcc/recog.h
index 217c6e56c86..534d2c99b18 100644
--- a/gcc/recog.h
+++ b/gcc/recog.h
@@ -18,6 +18,9 @@ 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/>. */
+#ifndef GCC_RECOG_H
+#define GCC_RECOG_H
+
/* Random number that should be large enough for all purposes. */
#define MAX_RECOG_ALTERNATIVES 30
@@ -305,3 +308,5 @@ struct insn_data_d
extern const struct insn_data_d insn_data[];
extern int peep2_current_count;
+
+#endif /* GCC_RECOG_H */
diff --git a/gcc/reg-notes.def b/gcc/reg-notes.def
index f82e7b741a0..329cd6799d5 100644
--- a/gcc/reg-notes.def
+++ b/gcc/reg-notes.def
@@ -99,11 +99,6 @@ REG_NOTE (DEP_ANTI)
won't return. */
REG_NOTE (BR_PROB)
-/* REG_VALUE_PROFILE is attached when the profile is read in to an
- insn before that the code to profile the value is inserted. It
- contains the results of profiling. */
-REG_NOTE (VALUE_PROFILE)
-
/* Attached to a call insn; indicates that the call is malloc-like and
that the pointer returned cannot alias anything else. */
REG_NOTE (NOALIAS)
diff --git a/gcc/reload.c b/gcc/reload.c
index aa9e68e59b6..714355c3201 100644
--- a/gcc/reload.c
+++ b/gcc/reload.c
@@ -5066,8 +5066,13 @@ find_reloads_address (enum machine_mode mode, rtx *memrefloc, rtx ad,
&& REG_P (XEXP (ad, 0))
&& REGNO (XEXP (ad, 0)) < FIRST_PSEUDO_REGISTER
&& CONST_INT_P (XEXP (ad, 1))
- && regno_ok_for_base_p (REGNO (XEXP (ad, 0)), mode, PLUS,
- CONST_INT))
+ && (regno_ok_for_base_p (REGNO (XEXP (ad, 0)), mode, PLUS,
+ CONST_INT)
+ /* Similarly, if we were to reload the base register and the
+ mem+offset address is still invalid, then we want to reload
+ the whole address, not just the base register. */
+ || ! maybe_memory_address_addr_space_p
+ (mode, ad, as, &(XEXP (ad, 0)))))
{
/* Unshare the MEM rtx so we can safely alter it. */
@@ -5079,7 +5084,9 @@ find_reloads_address (enum machine_mode mode, rtx *memrefloc, rtx ad,
loc = &XEXP (*loc, 0);
}
- if (double_reg_address_ok)
+ if (double_reg_address_ok
+ && regno_ok_for_base_p (REGNO (XEXP (ad, 0)), mode,
+ PLUS, CONST_INT))
{
/* Unshare the sum as well. */
*loc = ad = copy_rtx (ad);
diff --git a/gcc/reload1.c b/gcc/reload1.c
index ae9055eb278..0701990e5f0 100644
--- a/gcc/reload1.c
+++ b/gcc/reload1.c
@@ -1,7 +1,7 @@
/* Reload pseudo regs into hard regs for insns that require hard regs.
Copyright (C) 1987, 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
- 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
- Free Software Foundation, Inc.
+ 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
+ 2011 Free Software Foundation, Inc.
This file is part of GCC.
@@ -8087,10 +8087,22 @@ emit_reload_insns (struct insn_chain *chain)
/* Maybe the spill reg contains a copy of reload_out. */
if (rld[r].out != 0
&& (REG_P (rld[r].out)
-#ifdef AUTO_INC_DEC
- || ! rld[r].out_reg
-#endif
- || REG_P (rld[r].out_reg)))
+ || (rld[r].out_reg
+ ? REG_P (rld[r].out_reg)
+ /* The reload value is an auto-modification of
+ some kind. For PRE_INC, POST_INC, PRE_DEC
+ and POST_DEC, we record an equivalence
+ between the reload register and the operand
+ on the optimistic assumption that we can make
+ the equivalence hold. reload_as_needed must
+ then either make it hold or invalidate the
+ equivalence.
+
+ PRE_MODIFY and POST_MODIFY addresses are reloaded
+ somewhat differently, and allowing them here leads
+ to problems. */
+ : (GET_CODE (rld[r].out) != POST_MODIFY
+ && GET_CODE (rld[r].out) != PRE_MODIFY))))
{
rtx reg;
enum machine_mode mode;
@@ -9034,7 +9046,7 @@ inc_for_reload (rtx reloadreg, rtx in, rtx value, int inc_amount)
be used as an address. */
if (! post)
- emit_insn (gen_move_insn (reloadreg, incloc));
+ add_insn = emit_insn (gen_move_insn (reloadreg, incloc));
return add_insn;
}
diff --git a/gcc/rtl.h b/gcc/rtl.h
index bf56ea67f44..eaf2f324211 100644
--- a/gcc/rtl.h
+++ b/gcc/rtl.h
@@ -1925,6 +1925,17 @@ extern int computed_jump_p (const_rtx);
typedef int (*rtx_function) (rtx *, void *);
extern int for_each_rtx (rtx *, rtx_function, void *);
+/* Callback for for_each_inc_dec, to process the autoinc operation OP
+ within MEM that sets DEST to SRC + SRCOFF, or SRC if SRCOFF is
+ NULL. The callback is passed the same opaque ARG passed to
+ for_each_inc_dec. Return zero to continue looking for other
+ autoinc operations, -1 to skip OP's operands, and any other value
+ to interrupt the traversal and return that value to the caller of
+ for_each_inc_dec. */
+typedef int (*for_each_inc_dec_fn) (rtx mem, rtx op, rtx dest, rtx src,
+ rtx srcoff, void *arg);
+extern int for_each_inc_dec (rtx *, for_each_inc_dec_fn, void *arg);
+
typedef int (*rtx_equal_p_callback_function) (const_rtx *, const_rtx *,
rtx *, rtx *);
extern int rtx_equal_p_cb (const_rtx, const_rtx,
@@ -2300,6 +2311,9 @@ extern int cse_main (rtx, int);
extern int exp_equiv_p (const_rtx, const_rtx, int, bool);
extern unsigned hash_rtx (const_rtx x, enum machine_mode, int *, int *, bool);
+/* In dse.c */
+extern void check_for_inc_dec (rtx insn);
+
/* In jump.c */
extern int comparison_dominates_p (enum rtx_code, enum rtx_code);
extern int condjump_p (const_rtx);
diff --git a/gcc/rtlanal.c b/gcc/rtlanal.c
index 3c0167ec6ef..d9710bdac13 100644
--- a/gcc/rtlanal.c
+++ b/gcc/rtlanal.c
@@ -2886,7 +2886,124 @@ for_each_rtx (rtx *x, rtx_function f, void *data)
return for_each_rtx_1 (*x, i, f, data);
}
+
+
+/* Data structure that holds the internal state communicated between
+ for_each_inc_dec, for_each_inc_dec_find_mem and
+ for_each_inc_dec_find_inc_dec. */
+
+struct for_each_inc_dec_ops {
+ /* The function to be called for each autoinc operation found. */
+ for_each_inc_dec_fn fn;
+ /* The opaque argument to be passed to it. */
+ void *arg;
+ /* The MEM we're visiting, if any. */
+ rtx mem;
+};
+
+static int for_each_inc_dec_find_mem (rtx *r, void *d);
+
+/* Find PRE/POST-INC/DEC/MODIFY operations within *R, extract the
+ operands of the equivalent add insn and pass the result to the
+ operator specified by *D. */
+
+static int
+for_each_inc_dec_find_inc_dec (rtx *r, void *d)
+{
+ rtx x = *r;
+ struct for_each_inc_dec_ops *data = (struct for_each_inc_dec_ops *)d;
+ switch (GET_CODE (x))
+ {
+ case PRE_INC:
+ case POST_INC:
+ {
+ int size = GET_MODE_SIZE (GET_MODE (data->mem));
+ rtx r1 = XEXP (x, 0);
+ rtx c = gen_int_mode (size, GET_MODE (r1));
+ return data->fn (data->mem, x, r1, r1, c, data->arg);
+ }
+
+ case PRE_DEC:
+ case POST_DEC:
+ {
+ int size = GET_MODE_SIZE (GET_MODE (data->mem));
+ rtx r1 = XEXP (x, 0);
+ rtx c = gen_int_mode (-size, GET_MODE (r1));
+ return data->fn (data->mem, x, r1, r1, c, data->arg);
+ }
+
+ case PRE_MODIFY:
+ case POST_MODIFY:
+ {
+ rtx r1 = XEXP (x, 0);
+ rtx add = XEXP (x, 1);
+ return data->fn (data->mem, x, r1, add, NULL, data->arg);
+ }
+
+ case MEM:
+ {
+ rtx save = data->mem;
+ int ret = for_each_inc_dec_find_mem (r, d);
+ data->mem = save;
+ return ret;
+ }
+
+ default:
+ return 0;
+ }
+}
+
+/* If *R is a MEM, find PRE/POST-INC/DEC/MODIFY operations within its
+ address, extract the operands of the equivalent add insn and pass
+ the result to the operator specified by *D. */
+
+static int
+for_each_inc_dec_find_mem (rtx *r, void *d)
+{
+ rtx x = *r;
+ if (x != NULL_RTX && MEM_P (x))
+ {
+ struct for_each_inc_dec_ops *data = (struct for_each_inc_dec_ops *) d;
+ int result;
+
+ data->mem = x;
+
+ result = for_each_rtx (&XEXP (x, 0), for_each_inc_dec_find_inc_dec,
+ data);
+ if (result)
+ return result;
+
+ return -1;
+ }
+ return 0;
+}
+
+/* Traverse *X looking for MEMs, and for autoinc operations within
+ them. For each such autoinc operation found, call FN, passing it
+ the innermost enclosing MEM, the operation itself, the RTX modified
+ by the operation, two RTXs (the second may be NULL) that, once
+ added, represent the value to be held by the modified RTX
+ afterwards, and ARG. FN is to return -1 to skip looking for other
+ autoinc operations within the visited operation, 0 to continue the
+ traversal, or any other value to have it returned to the caller of
+ for_each_inc_dec. */
+
+int
+for_each_inc_dec (rtx *x,
+ for_each_inc_dec_fn fn,
+ void *arg)
+{
+ struct for_each_inc_dec_ops data;
+
+ data.fn = fn;
+ data.arg = arg;
+ data.mem = NULL;
+
+ return for_each_rtx (x, for_each_inc_dec_find_mem, &data);
+}
+
+
/* Searches X for any reference to REGNO, returning the rtx of the
reference found if any. Otherwise, returns NULL_RTX. */
diff --git a/gcc/sched-deps.c b/gcc/sched-deps.c
index 817d8f966f9..7293fc3c972 100644
--- a/gcc/sched-deps.c
+++ b/gcc/sched-deps.c
@@ -715,9 +715,6 @@ sd_init_insn (rtx insn)
INSN_FORW_DEPS (insn) = create_deps_list ();
INSN_RESOLVED_FORW_DEPS (insn) = create_deps_list ();
- if (DEBUG_INSN_P (insn))
- DEBUG_INSN_SCHED_P (insn) = TRUE;
-
/* ??? It would be nice to allocate dependency caches here. */
}
@@ -727,12 +724,6 @@ sd_finish_insn (rtx insn)
{
/* ??? It would be nice to deallocate dependency caches here. */
- if (DEBUG_INSN_P (insn))
- {
- gcc_assert (DEBUG_INSN_SCHED_P (insn));
- DEBUG_INSN_SCHED_P (insn) = FALSE;
- }
-
free_deps_list (INSN_HARD_BACK_DEPS (insn));
INSN_HARD_BACK_DEPS (insn) = NULL;
@@ -1575,7 +1566,7 @@ add_insn_mem_dependence (struct deps_desc *deps, bool read_p,
if (sched_deps_info->use_cselib)
{
mem = shallow_copy_rtx (mem);
- XEXP (mem, 0) = cselib_subst_to_values (XEXP (mem, 0));
+ XEXP (mem, 0) = cselib_subst_to_values (XEXP (mem, 0), GET_MODE (mem));
}
link = alloc_EXPR_LIST (VOIDmode, canon_rtx (mem), *mem_list);
*mem_list = link;
@@ -2292,8 +2283,9 @@ sched_analyze_1 (struct deps_desc *deps, rtx x, rtx insn)
= targetm.addr_space.address_mode (MEM_ADDR_SPACE (dest));
t = shallow_copy_rtx (dest);
- cselib_lookup_from_insn (XEXP (t, 0), address_mode, 1, insn);
- XEXP (t, 0) = cselib_subst_to_values (XEXP (t, 0));
+ cselib_lookup_from_insn (XEXP (t, 0), address_mode, 1,
+ GET_MODE (t), insn);
+ XEXP (t, 0) = cselib_subst_to_values (XEXP (t, 0), GET_MODE (t));
}
t = canon_rtx (t);
@@ -2449,8 +2441,9 @@ sched_analyze_2 (struct deps_desc *deps, rtx x, rtx insn)
= targetm.addr_space.address_mode (MEM_ADDR_SPACE (t));
t = shallow_copy_rtx (t);
- cselib_lookup_from_insn (XEXP (t, 0), address_mode, 1, insn);
- XEXP (t, 0) = cselib_subst_to_values (XEXP (t, 0));
+ cselib_lookup_from_insn (XEXP (t, 0), address_mode, 1,
+ GET_MODE (t), insn);
+ XEXP (t, 0) = cselib_subst_to_values (XEXP (t, 0), GET_MODE (t));
}
if (!DEBUG_INSN_P (insn))
diff --git a/gcc/sched-ebb.c b/gcc/sched-ebb.c
index 59b804249d9..9fbb9b96f63 100644
--- a/gcc/sched-ebb.c
+++ b/gcc/sched-ebb.c
@@ -598,9 +598,9 @@ schedule_ebbs (void)
a note or two. */
while (head != tail)
{
- if (NOTE_P (head) || BOUNDARY_DEBUG_INSN_P (head))
+ if (NOTE_P (head) || DEBUG_INSN_P (head))
head = NEXT_INSN (head);
- else if (NOTE_P (tail) || BOUNDARY_DEBUG_INSN_P (tail))
+ else if (NOTE_P (tail) || DEBUG_INSN_P (tail))
tail = PREV_INSN (tail);
else if (LABEL_P (head))
head = NEXT_INSN (head);
diff --git a/gcc/sched-int.h b/gcc/sched-int.h
index 68cfa23ee06..9077c881ce6 100644
--- a/gcc/sched-int.h
+++ b/gcc/sched-int.h
@@ -887,23 +887,6 @@ extern VEC(haifa_deps_insn_data_def, heap) *h_d_i_d;
#define IS_SPECULATION_BRANCHY_CHECK_P(INSN) \
(RECOVERY_BLOCK (INSN) != NULL && RECOVERY_BLOCK (INSN) != EXIT_BLOCK_PTR)
-/* The unchanging bit tracks whether a debug insn is to be handled
- like an insn (i.e., schedule it) or like a note (e.g., it is next
- to a basic block boundary. */
-#define DEBUG_INSN_SCHED_P(insn) \
- (RTL_FLAG_CHECK1("DEBUG_INSN_SCHED_P", (insn), DEBUG_INSN)->unchanging)
-
-/* True if INSN is a debug insn that is next to a basic block
- boundary, i.e., it is to be handled by the scheduler like a
- note. */
-#define BOUNDARY_DEBUG_INSN_P(insn) \
- (DEBUG_INSN_P (insn) && !DEBUG_INSN_SCHED_P (insn))
-/* True if INSN is a debug insn that is not next to a basic block
- boundary, i.e., it is to be handled by the scheduler like an
- insn. */
-#define SCHEDULE_DEBUG_INSN_P(insn) \
- (DEBUG_INSN_P (insn) && DEBUG_INSN_SCHED_P (insn))
-
/* Dep status (aka ds_t) of the link encapsulates information, that is needed
for speculative scheduling. Namely, it is 4 integers in the range
[0, MAX_DEP_WEAK] and 3 bits.
diff --git a/gcc/sched-rgn.c b/gcc/sched-rgn.c
index 6ed4675e550..6c4fd46a50f 100644
--- a/gcc/sched-rgn.c
+++ b/gcc/sched-rgn.c
@@ -2138,7 +2138,7 @@ init_ready_list (void)
src_head = head;
for (insn = src_head; insn != src_next_tail; insn = NEXT_INSN (insn))
- if (INSN_P (insn) && !BOUNDARY_DEBUG_INSN_P (insn))
+ if (INSN_P (insn))
try_ready (insn);
}
}
diff --git a/gcc/sel-sched-dump.c b/gcc/sel-sched-dump.c
index 782dcaac3c2..27b06ad1695 100644
--- a/gcc/sel-sched-dump.c
+++ b/gcc/sel-sched-dump.c
@@ -960,8 +960,8 @@ debug_mem_addr_value (rtx x)
address_mode = targetm.addr_space.address_mode (MEM_ADDR_SPACE (x));
t = shallow_copy_rtx (x);
- if (cselib_lookup (XEXP (t, 0), address_mode, 0))
- XEXP (t, 0) = cselib_subst_to_values (XEXP (t, 0));
+ if (cselib_lookup (XEXP (t, 0), address_mode, 0, GET_MODE (t)))
+ XEXP (t, 0) = cselib_subst_to_values (XEXP (t, 0), GET_MODE (t));
t = canon_rtx (t);
addr = get_addr (XEXP (t, 0));
diff --git a/gcc/sel-sched.c b/gcc/sel-sched.c
index d1558676225..fa4ddf355cf 100644
--- a/gcc/sel-sched.c
+++ b/gcc/sel-sched.c
@@ -2142,6 +2142,15 @@ moveup_expr (expr_t expr, insn_t through_insn, bool inside_insn_group,
ds_t *has_dep_p;
ds_t full_ds;
+ /* ??? We use dependencies of non-debug insns on debug insns to
+ indicate that the debug insns need to be reset if the non-debug
+ insn is pulled ahead of it. It's hard to figure out how to
+ introduce such a notion in sel-sched, but it already fails to
+ support debug insns in other ways, so we just go ahead and
+ let the deug insns go corrupt for now. */
+ if (DEBUG_INSN_P (through_insn) && !DEBUG_INSN_P (insn))
+ return MOVEUP_EXPR_SAME;
+
/* When inside_insn_group, delegate to the helper. */
if (inside_insn_group)
return moveup_expr_inside_insn_group (expr, through_insn);
diff --git a/gcc/target.def b/gcc/target.def
index bdd76621a6b..57134cbc611 100644
--- a/gcc/target.def
+++ b/gcc/target.def
@@ -1638,6 +1638,15 @@ DEFHOOK
bool, (enum machine_mode mode),
hook_bool_mode_false)
+/* Register number for a flags register. Only needs to be defined if the
+ target is constrainted to use post-reload comparison elimination. */
+DEFHOOKPOD
+(flags_regnum,
+ "If the target has a dedicated flags register, and it needs to use the\
+ post-reload comparison elimination pass, then this value should be set\
+ appropriately.",
+ unsigned int, INVALID_REGNUM)
+
/* Compute a (partial) cost for rtx X. Return true if the complete
cost has been computed, and false if subexpressions should be
scanned. In either case, *TOTAL contains the cost result. */
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 07b41c8299e..5bdfd04544a 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,7 +1,1682 @@
+2011-02-25 Jie Zhang <jie@codesourcery.com>
+
+ * gcc.target/arm/neon-thumb2-move.c: Add
+ dg-require-effective-target arm_thumb2_ok.
+
+2011-02-24 Jason Merrill <jason@redhat.com>
+
+ * g++.dg/parse/constant1.C: Specify C++98 mode.
+ * g++.dg/parse/constant5.C: Likewise.
+ * g++.dg/parse/error2.C: Likewise.
+ * g++.dg/parse/semicolon3.C: Likewise.
+ * g++.dg/template/crash14.C: Likewise.
+ * g++.dg/template/local4.C: Likewise.
+ * g++.dg/template/nontype3.C: Likewise.
+ * g++.dg/parse/crash31.C: Adjust expected errors.
+ * g++.dg/template/function1.C: Likewise.
+ * g++.dg/template/ref3.C: Likewise.
+ * g++.dg/template/static9.C: Likewise.
+ * g++.old-deja/g++.pt/crash41.C: Instantiate template.
+
+ * g++.dg/cpp0x/constexpr-array-tparm.C: New.
+ * g++.dg/cpp0x/regress/parse-ambig5.C: Copy from parse/ambig5.C.
+ * g++.dg/cpp0x/regress/debug-debug7.C: Copy from debug/debug7.C.
+ * g++.dg/cpp0x/variadic20.C: Adjust expected errors.
+ * g++.dg/cpp0x/regress/template-function1.C: Likewise.
+
+2011-02-24 Jakub Jelinek <jakub@redhat.com>
+
+ PR fortran/47878
+ * gfortran.dg/pr47878.f90: New test.
+
+2011-02-24 Richard Guenther <rguenther@suse.de>
+
+ PR testsuite/47801
+ * gcc.dg/guality/pr41353-1.c (vari): Mark as used.
+ * gcc.dg/guality/pr41353-2.c (vari): Likewise.
+
+2011-02-24 Richard Guenther <rguenther@suse.de>
+
+ PR fortran/47839
+ * gfortran.dg/lto/pr47839_0.f90: New testcase.
+ * gfortran.dg/lto/pr47839_1.f90: Likewise.
+
+2011-02-23 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
+ PR libgfortran/47567
+ * gfortran.dg/fmt_f0_1.f90: Update test.
+
+2011-02-23 Jason Merrill <jason@redhat.com>
+
+ * g++.dg/abi/mangle39.C: Adjust parm mangling.
+ * g++.dg/abi/mangle45.C: New.
+
+ * g++.dg/cpp0x/trailing1.C: Mangle decltype.
+ * g++.dg/template/canon-type-9.C: Match use of decltype
+ between declaration and definition.
+ * g++.dg/template/canon-type-12.C: Likewise.
+
+2011-02-23 Mikael Morin <mikael@gcc.gnu.org>
+
+ PR fortran/40850
+ * gfortran.dg/nested_allocatables_1.f90: New.
+
+2011-02-23 Nathan Froyd <froydnj@codesourcery.com>
+
+ PR c++/46868
+ * g++.dg/pr46868.C: New test.
+ * g++.dg/parse/parameter-declaration-1.C: Adjust.
+ * g++.dg/parse/error14.C: Adjust.
+
+2011-02-23 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/47838
+ * gcc.dg/tree-ssa/foldconst-2.c: Scan tree-ch dump.
+
+2011-02-23 Uros Bizjak <ubizjak@gmail.com>
+
+ * g++.dg/other/pr47218.C: Fix dg-options. Cleanup saved temps.
+
+2011-02-23 Uros Bizjak <ubizjak@gmail.com>
+
+ * gfortran.dg/allocate_deferred_char_scalar_1.f03: Fix dg-do syntax.
+ * gfortran.dg/count_init_expr.f03: Ditto.
+ * gfortran.dg/gomp/pr43711.f90: Ditto.
+ * gcc.dg/struct-parse-2.c: Ditto.
+ * gcc.dg/parse-error-3.c: Ditto.
+ * gcc.dg/Wlogical-op-1.c: Ditto.
+ * gcc.dg/Walways-true-1.c: Ditto.
+ * gcc.dg/pr24225.c: Ditto.
+ * gcc.dg/Walways-true-2.c: Ditto.
+ * gcc.dg/tree-ssa/foldcast-1.c: Ditto.
+ * gcc.dg/tree-ssa/struct-aliasing-1.c: Ditto.
+ * gcc.dg/tree-ssa/struct-aliasing-2.c: Ditto.
+ * g++.dg/overload/defarg4.C: Ditto.
+ * g++.dg/inherit/covariant16.C: Ditto.
+ * g++.dg/inherit/virtual7.C: Ditto.
+ * g++.dg/template/canon-type-9.C: Ditto.
+ * g++.dg/template/access19.C: Ditto.
+ * g++.dg/template/call7.C: Ditto.
+ * g++.dg/template/canon-type-2.C: Ditto.
+ * g++.dg/template/init7.C: Ditto.
+ * g++.dg/template/sizeof-template-argument.C: Ditto.
+ * g++.dg/template/const3.C: Ditto.
+ * g++.dg/template/sfinae26.C: Ditto.
+ * g++.dg/template/sfinae26.C: Ditto.
+ * g++.dg/template/canon-type-11.C: Ditto.
+ * g++.dg/template/union2.C: Ditto.
+ * g++.dg/template/canon-type-3.C: Ditto.
+ * g++.dg/template/canon-type-1.C: Ditto.
+ * g++.dg/template/canon-type-5.C: Ditto.
+ * g++.dg/template/canon-type-7.C: Ditto.
+ * g++.dg/template/canon-type-10.C: Ditto.
+ * g++.dg/template/spec36.C: Ditto.
+ * g++.dg/template/typedef38.C: Ditto.
+ * g++.dg/template/canon-type-4.C: Ditto.
+ * g++.dg/template/canon-type-6.C: Ditto.
+ * g++.dg/template/canon-type-13.C: Ditto.
+ * g++.dg/template/instantiate9.C: Ditto.
+ * g++.dg/template/ttp22.C: Ditto.
+ * g++.dg/warn/Wreturn-type-6.C: Ditto.
+ * g++.dg/warn/Walways-true-1.C: Ditto.
+ * g++.dg/warn/Wlogical-op-1.C: Ditto.
+ * g++.dg/warn/Walways-true-2.C: Ditto.
+ * g++.dg/conversion/op4.C: Ditto.
+ * g++.dg/opt/pr19650.C: Ditto.
+ * g++.dg/lookup/friend11.C: Ditto.
+ * g++.dg/other/default2.C: Ditto.
+ * g++.dg/other/default3.C: Ditto.
+ * g++.dg/other/dtor2.C: Ditto.
+ * g++.dg/other/friend5.C: Ditto.
+ * g++.dg/other/default5.C: Ditto.
+ * g++.dg/init/brace6.C: Ditto.
+ * g++.dg/init/aggr5.C: Ditto.
+ * g++.dg/init/error2.C: Ditto.
+ * g++.dg/expr/bound-mem-fun.C: Ditto.
+ * g++.dg/expr/cond6.C: Ditto.
+ * g++.dg/expr/stmt-expr-1.C: Ditto.
+ * g++.dg/cpp0x/constexpr-object2.C: Ditto.
+ * g++.dg/cpp0x/constexpr-data1.C: Ditto.
+ * g++.dg/cpp0x/constexpr-function2.C: Ditto.
+ * g++.dg/cpp0x/bracket1.C: Ditto.
+ * g++.dg/cpp0x/variadic-mem-fn.C: Ditto.
+ * g++.dg/cpp0x/pr38646.C: Ditto.
+ * g++.dg/cpp0x/variadic73.C: Ditto.
+ * g++.dg/cpp0x/constexpr-function1.C: Ditto.
+ * g++.dg/cpp0x/bracket4.C: Ditto.
+ * g++.dg/cpp0x/decltype4.C: Ditto.
+ * g++.dg/cpp0x/constexpr-data2.C: Ditto.
+ * g++.dg/cpp0x/constexpr-object1.C: Ditto.
+ * g++.dg/cpp0x/variadic-crash2.C: Ditto.
+ * g++.dg/cpp0x/variadic-new2.C: Ditto.
+ * g++.dg/cpp0x/decltype2.C: Ditto.
+ * g++.dg/cpp0x/decltype1.C: Ditto.
+ * g++.dg/cpp0x/bracket2.C: Ditto.
+ * g++.dg/cpp0x/decltype5.C: Ditto.
+ * g++.dg/cpp0x/constexpr-function3.C: Ditto.
+ * g++.dg/cpp0x/variadic70.C: Ditto.
+ * g++.dg/cpp0x/decltype6.C: Ditto.
+ * g++.dg/cpp0x/rvo.C: Ditto.
+ * g++.dg/cpp0x/vt-40092.C: Ditto.
+ * g++.dg/cpp0x/variadic-new.C: Ditto.
+ * g++.dg/cpp0x/lambda/lambda-pass.C: Ditto.
+ * g++.dg/cpp0x/lambda/lambda-mixed.C: Ditto.
+ * g++.dg/cpp0x/lambda/lambda-nested.C: Ditto.
+ * g++.dg/cpp0x/lambda/lambda-recursive.C: Ditto.
+ * g++.dg/cpp0x/lambda/lambda-copy.C: Ditto.
+ * g++.dg/cpp0x/lambda/lambda-non-const.C: Ditto.
+ * g++.dg/cpp0x/lambda/lambda-ref-default.C: Ditto.
+ * g++.dg/cpp0x/lambda/lambda-deduce.C: Ditto.
+ * g++.dg/cpp0x/lambda/lambda-copy-default.C: Ditto.
+ * g++.dg/cpp0x/lambda/lambda-nop.C: Ditto.
+ * g++.dg/cpp0x/lambda/lambda-capture-const-ref.C: Ditto.
+ * g++.dg/cpp0x/lambda/lambda-ref.C: Ditto.
+ * g++.dg/cpp0x/lambda/lambda-const.C: Ditto.
+ * g++.dg/cpp0x/lambda/lambda-mutable.C: Ditto.
+ * g++.dg/cpp0x/lambda/lambda-in-class.C: Ditto.
+ * g++.dg/cpp0x/pr39639.C: Ditto.
+ * g++.dg/cpp0x/decltype3.C: Ditto.
+ * g++.dg/cpp0x/variadic68.C: Ditto.
+ * g++.dg/cpp0x/variadic-function.C: Ditto.
+ * g++.dg/cpp0x/constexpr-ex1.C: Ditto.
+ * g++.dg/cpp0x/variadic-bind.C: Ditto.
+ * g++.dg/cpp0x/variadic-tuple.C: Ditto.
+ * g++.dg/cpp0x/constexpr-ex2.C: Ditto.
+ * g++.dg/parse/crash35.C: Ditto.
+ * g++.dg/parse/crash40.C: Ditto.
+ * g++.dg/parse/defarg12.C: Ditto.
+ * g++.dg/parse/crash34.C: Ditto.
+ * g++.dg/parse/constructor3.C: Ditto.
+ * g++.dg/parse/template23.C: Ditto.
+ * g++.dg/parse/crash56.C: Ditto.
+ * g++.dg/parse/dtor13.C: Ditto.
+ * g++.dg/parse/error33.C: Ditto.
+ * g++.dg/parse/ctor9.C: Ditto.
+ * g++.dg/parse/error32.C: Ditto.
+ * g++.dg/parse/error37.C: Ditto.
+ * g++.dg/parse/bitfield3.C: Ditto.
+ * g++.dg/parse/struct-4.C: Ditto.
+ * g++.dg/ext/has_trivial_copy.C: Ditto.
+ * g++.dg/ext/is_polymorphic.C: Ditto.
+ * g++.dg/ext/has_nothrow_copy_odr.C: Ditto.
+ * g++.dg/ext/has_nothrow_copy-4.C: Ditto.
+ * g++.dg/ext/has_nothrow_assign.C: Ditto.
+ * g++.dg/ext/is_union.C: Ditto.
+ * g++.dg/ext/has_nothrow_copy-1.C: Ditto.
+ * g++.dg/ext/is_pod.C: Ditto.
+ * g++.dg/ext/has_virtual_destructor.C: Ditto.
+ * g++.dg/ext/has_trivial_constructor.C: Ditto.
+ * g++.dg/ext/has_nothrow_copy-3.C: Ditto.
+ * g++.dg/ext/has_nothrow_copy-5.C: Ditto.
+ * g++.dg/ext/has_trivial_destructor-1.C: Ditto.
+ * g++.dg/ext/has_nothrow_copy-6.C: Ditto.
+ * g++.dg/ext/is_abstract.C: Ditto.
+ * g++.dg/ext/has_trivial_assign.C: Ditto.
+ * g++.dg/ext/is_class.C: Ditto.
+ * g++.dg/ext/has_nothrow_assign_odr.C: Ditto.
+ * g++.dg/ext/has_nothrow_copy-7.C: Ditto.
+ * g++.dg/ext/is_base_of.C: Ditto.
+ * g++.dg/ext/has_nothrow_copy-2.C: Ditto.
+ * g++.dg/ext/has_nothrow_constructor.C: Ditto.
+ * g++.dg/ext/is_empty.C: Ditto.
+ * g++.dg/ext/is_enum.C: Ditto.
+ * g++.dg/ext/has_nothrow_constructor_odr.C: Ditto.
+ * g++.dg/ext/.C: Ditto.
+ * g++.dg/ext/.C: Ditto.
+ * gnat.dg/opt11.adb: Ditto.
+ * obj-c++.dg/pr45735.mm: Ditto.
+ * obj-c++.dg/pr24393.mm: Ditto.
+ * obj-c++.dg/exceptions-2.cc: Ditto.
+ * objc.dg/pr45735.m: Ditto.
+ * objc.dg/pr24393.m: Ditto.
+
+2011-02-23 Nicola Pero <nicola.pero@meta-innovation.com>
+
+ * objc.dg/attributes/objc-exception-1.m: New.
+
+2011-02-23 Jie Zhang <jie@codesourcery.com>
+
+ * gcc.dg/cpp/include7.c: New test.
+
+2011-02-22 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/47242
+ * g++.dg/cpp0x/lambda/lambda-ice4.C: New.
+
+2011-02-23 Jie Zhang <jie@codesourcery.com>
+
+ PR rtl-optimization/47763
+ * gcc.dg/pr47763.c: New test.
+
+2011-02-22 Paul Thomas <pault@gcc.gnu.org>
+
+ PR fortran/45743
+ * gfortran.dg/whole_file_32.f90 : New test.
+
+2011-02-22 Dodji Seketeli <dodji@redhat.com>
+
+ PR c++/47666
+ * g++.dg/inherit/virtual7.C: New test.
+
+2011-02-22 Nicola Pero <nicola.pero@meta-innovation.com>
+
+ PR objc/47832
+ * objc.dg/type-size-3.m: Updated error message.
+ * objc.dg/type-size-4.m: New test.
+ * objc.dg/type-size-5.m: New test.
+
+2011-02-22 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * lib/gnat.exp: Fix comments.
+ Don't load libgloss.exp.
+ (default_gnat_version): Call $compiler with --version.
+ Adapt regexp for gnatmake output, insert version.
+ (gnat_version): New proc.
+ (gnat_init): Remove gnat_libgcc_s_path.
+ (gnat_target_compile): Likewise.
+ Remove ld_library_path.
+ Log ADA_INCLUDE_PATH, ADA_OBJECTS_PATH.
+ (gnat_pass): Remove.
+ (gnat_pass): Remove.
+ (gnat_finish): Remove.
+ (gnat_exit): Remove.
+ (local_find_gnatmake): Reindent.
+ (runtest_file_p): Remove.
+ (prune_warnings): Remove.
+ (find_gnatclean): New proc.
+ * lib/gnat-dg.exp (lremove): New proc.
+ (gnat-dg-test): Reindent.
+ Remove additional output files.
+ (gnat-dg-runtest): Remove.
+
+ * gnat.dg/array7.adb: Use cleanup-tree-dump "optimized".
+ * gnat.dg/loop_optimization6.adb: Likewise.
+ * gnat.dg/atomic1.adb: Use cleanup-tree-dump "gimple".
+
+2011-02-22 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/47835
+ * gcc.dg/pr46909.c: Check optimized dump instead of ifcombine.
+
+2011-02-22 Tobias Burnus <burnus@net-b.de>
+
+ * gfortran.dg/abstract_type_1.f90: Fix dg-do syntax.
+ * gfortran.dg/abstract_type_2.f03: Ditto.
+ * gfortran.dg/abstract_type_3.f03: Ditto.
+ * gfortran.dg/abstract_type_4.f03: Ditto.
+ * gfortran.dg/abstract_type_5.f03: Ditto.
+ * gfortran.dg/abstract_type_6.f03: Ditto.
+ * gfortran.dg/alloc_comp_constraint_6.f90: Ditto.
+ * gfortran.dg/alloc_comp_init_expr.f03: Ditto.
+ * gfortran.dg/allocatable_scalar_11.f90: Ditto.
+ * gfortran.dg/allocate_scalar_with_shape.f90: Ditto.
+ * gfortran.dg/array_function_5.f90: Ditto.
+ * gfortran.dg/asynchronous_3.f03: Ditto.
+ * gfortran.dg/char_expr_1.f90: Ditto.
+ * gfortran.dg/class_14.f03: Ditto.
+ * gfortran.dg/data_array_6.f: Ditto.
+ * gfortran.dg/data_invalid.f90: Ditto.
+ * gfortran.dg/dot_product_1.f03: Ditto.
+ * gfortran.dg/func_derived_5.f90: Ditto.
+ * gfortran.dg/func_result_4.f90: Ditto.
+ * gfortran.dg/implied_do_1.f90: Ditto.
+ * gfortran.dg/initialization_25.f90: Ditto.
+ * gfortran.dg/initialization_26.f90: Ditto.
+ * gfortran.dg/interface_34.f90: Ditto.
+ * gfortran.dg/iso_c_binding_init_expr.f03: Ditto.
+ * gfortran.dg/keyword_symbol_1.f90: Ditto.
+ * gfortran.dg/matmul_8.f03: Ditto.
+ * gfortran.dg/merge_init_expr.f90: Ditto.
+ * gfortran.dg/pack_assign_1.f90: Ditto.
+ * gfortran.dg/pack_vector_1.f90: Ditto.
+ * gfortran.dg/pointer_check_8.f90: Ditto.
+ * gfortran.dg/product_init_expr.f03: Ditto.
+ * gfortran.dg/reshape_order_5.f90: Ditto.
+ * gfortran.dg/reshape_shape_1.f90: Ditto.
+ * gfortran.dg/reshape_zerosize_2.f90: Ditto.
+ * gfortran.dg/same_name_2.f90: Ditto.
+ * gfortran.dg/selected_real_kind_1.f90: Ditto.
+ * gfortran.dg/spread_init_expr.f03: Ditto.
+ * gfortran.dg/stmt_func_1.f90: Ditto.
+ * gfortran.dg/sum_init_expr.f03: Ditto.
+ * gfortran.dg/transpose_3.f03: Ditto.
+ * gfortran.dg/unpack_init_expr.f03: Ditto.
+ * gfortran.dg/warn_conversion.f90: Ditto.
+ * gfortran.dg/warn_conversion_2.f90: Ditto.
+ * gfortran.dg/warn_intent_out_not_set.f90: Ditto.
+ * gfortran.dg/warn_unused_dummy_argument_1.f90: Ditto.
+ * gfortran.dg/warn_unused_dummy_argument_2.f90: Ditto.
+ * gfortran.dg/whole_file_16.f90: Ditto.
+ * gfortran.dg/whole_file_17.f90: Ditto.
+ * gfortran.dg/whole_file_18.f90: Ditto.
+ * gfortran.dg/whole_file_20.f03: Ditto.
+ * gfortran.dg/whole_file_5.f90: Ditto.
+ * gfortran.dg/whole_file_6.f90: Ditto.
+ * gfortran.dg/write_invalid_format.f90: Ditto.
+ * gfortran.dg/zero_sized_6.f90: Ditto.
+
+2011-02-21 Jeff Law <law@redhat.com>
+
+ PR rtl-optimization/46178
+ * gcc.target/i386/pr46178.c: New test.
+
+ PR rtl-optimization/46002
+ * gcc.c-torture/compile/pr46002.c: New test.
+
+2011-02-21 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
+
+ * g++.dg/cpp0x/lambda/lambda-conv.C: Skip scan-assembler check on
+ *-*-hpux10*.
+
+2011-02-21 Jakub Jelinek <jakub@redhat.com>
+
+ PR debug/47106
+ * g++.dg/debug/pr47106.C: Require effective target lto.
+
+2011-02-21 Jason Merrill <jason@redhat.com>
+
+ * g++.dg/cpp0x/constexpr-diag2.C: New.
+
+2011-02-20 Jason Merrill <jason@redhat.com>
+
+ * g++.dg/cpp0x/constexpr-ctor7.C: New.
+
+ * g++.dg/cpp0x/fntmpdefarg2.C: New.
+
+ * g++.dg/overload/conv-op1.C: New.
+
+ * g++.dg/cpp0x/constexpr-synth1.C: New.
+
+2011-02-20 Nicola Pero <nicola.pero@meta-innovation.com>
+
+ * objc.dg/layout-2.m: New.
+ * objc.dg/selector-3.m: Adjusted location of error message.
+ * objc.dg/type-size-3.m: Same.
+ * obj-c++.dg/selector-3.mm: Same.
+
+2011-02-20 Nicola Pero <nicola.pero@meta-innovation.com>
+
+ PR objc/47784
+ * objc.dg/property/dotsyntax-22.m: New.
+ * obj-c++.dg/property/dotsyntax-22.mm: New.
+
+2011-02-20 Dodji Seketeli <dodji@redhat.com>
+
+ PR c++/46394
+ * g++.dg/template/typedef38.C: New test.
+
+2011-02-20 Paul Thomas <pault@gcc.gnu.org>
+
+ PR fortran/46818
+ * gfortran.dg/whole_file_30.f90 : New test.
+ * gfortran.dg/whole_file_31.f90 : New test.
+
+2011-02-20 Paul Thomas <pault@gcc.gnu.org>
+
+ PR fortran/45077
+ PR fortran/44945
+ * gfortran.dg/whole_file_28.f90 : New test.
+ * gfortran.dg/whole_file_29.f90 : New test.
+
+2011-02-20 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/44118
+ * g++.dg/template/crash105.C: New.
+
+2011-02-19 Jason Merrill <jason@redhat.com>
+
+ * g++.dg/cpp0x/regress/no-elide1.C: New.
+
+2011-02-19 Alexandre Oliva <aoliva@redhat.com>
+
+ PR tree-optimization/46620
+ * gcc.dg/pr46620.c: New.
+
+2011-02-19 Jakub Jelinek <jakub@redhat.com>
+
+ PR c/47809
+ * gcc.target/i386/pr47809.c: New test.
+
+2011-02-19 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+ Tobias Burnus <burnus@net-b.de>
+
+ * lib/target-supports.exp
+ (check_effective_target_fortran_large_real): New check for large reals.
+ * gfortran.dg/nan_7.f90: New test.
+
+2011-02-19 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
+ PR libgfortran/47567
+ * gfortran.dg/fmt_f0_1.f90: Update test.
+
+2011-02-19 Paul Thomas <pault@gcc.gnu.org>
+
+ PR fortran/47348
+ * gfortran.dg/array_constructor_36.f90 : New test.
+ * gfortran.dg/bounds_check_10.f90 : Change dg-output message to
+ allow for comparison between different elements of the array
+ constructor at different levels of optimization.
+
+2011-02-19 H.J. Lu <hongjiu.lu@intel.com>
+
+ * gcc.target/i386/pr31167.c: Require int128 instead of lp64.
+ * gcc.target/i386/pr32280-1.c: Likewise.
+
+2011-02-19 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/47800
+ * gcc.target/i386/pr47800.c: New test.
+
+2011-02-18 Iain Sandoe <iains@gcc.gnu.org>
+
+ * objc/execute/exceptions/foward-1.x: New.
+
+2011-02-18 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/47789
+ * gfortran.dg/derived_constructor_comps_4.f90: New.
+
+2011-02-18 Tobias Burnus
+
+ PR fortran/47775
+ * gfortran.dg/func_result_6.f90: New.
+
+2011-02-18 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/47795
+ * g++.dg/cpp0x/lambda/lambda-ice3.C: New.
+
+2011-02-18 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/47750
+ * lib/gfortran.exp (gfortran_init): Set gcc_error_prefix and
+ gcc_warning_prefix.
+ * lib/gfortran-dg.exp (gfortran-dg-test): Update regexp for
+ normalizing the error/warning output.
+ * gfortran.dg/Wall.f90: Update dg-error/warning.
+ * gfortran.dg/argument_checking_15.f90: Update dg-error/warning.
+ * gfortran.dg/argument_checking_3.f90: Update dg-error/warning.
+ * gfortran.dg/argument_checking_6.f90: Update dg-error/warning.
+ * gfortran.dg/bounds_temporaries_1.f90: Update dg-error/warning.
+ * gfortran.dg/class_30.f90: Update dg-error/warning.
+ * gfortran.dg/continuation_1.f90: Update dg-error/warning.
+ * gfortran.dg/continuation_9.f90: Update dg-error/warning.
+ * gfortran.dg/do_check_5.f90: Update dg-error/warning.
+ * gfortran.dg/entry_17.f90: Update dg-error/warning.
+ * gfortran.dg/entry_19.f90: Update dg-error/warning.
+ * gfortran.dg/fmt_error.f90: Update dg-error/warning.
+ * gfortran.dg/fmt_read_2.f90: Update dg-error/warning.
+ * gfortran.dg/g77/12632.f: Update dg-error/warning.
+ * gfortran.dg/g77/970625-2.f: Update dg-error/warning.
+ * gfortran.dg/g77/980615-0.f: Update dg-error/warning.
+ * gfortran.dg/generic_actual_arg.f90: Update dg-error/warning.
+ * gfortran.dg/global_references_1.f90: Update dg-error/warning.
+ * gfortran.dg/goto_8.f90: Update dg-error/warning.
+ * gfortran.dg/initialization_1.f90: Update dg-error/warning.
+ * gfortran.dg/io_constraints_1.f90: Update dg-error/warning.
+ * gfortran.dg/io_constraints_2.f90: Update dg-error/warning.
+ * gfortran.dg/io_constraints_3.f90: Update dg-error/warning.
+ * gfortran.dg/iostat_3.f90: Update dg-error/warning.
+ * gfortran.dg/public_private_module.f90: Update dg-error/warning.
+ * gfortran.dg/volatile3.f90: Update dg-error/warning.
+ * gfortran.dg/warning-directive-2.F90: Update dg-error/warning.
+ * gfortran.dg/warnings_are_errors_1.f: Update dg-error/warning.
+ * gfortran.dg/whole_file_1.f90: Update dg-error/warning.
+ * gfortran.dg/whole_file_2.f90: Update dg-error/warning.
+ * gfortran.dg/whole_file_3.f90: Update dg-error/warning.
+
+2011-02-18 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/47768
+ * gfortran.dg/proc_ptr_comp_30.f90: New.
+
+2011-02-18 Jakub Jelinek <jakub@redhat.com>
+
+ PR debug/47780
+ * gcc.target/i386/pr47780.c: New test.
+
+2011-02-18 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/47767
+ * gfortran.dg/class_40.f03: New.
+
+2011-02-18 Dodji Seketeli <dodji@redhat.com>
+
+ PR c++/47208
+ * g++.dg/cpp0x/auto21.C: New test.
+
+2011-02-17 Iain Sandoe <iains@gcc.gnu.org>
+
+ * objc.dg/special/unclaimed-category-1.h: Updated for
+ new ABI support.
+ * objc.dg/special/unclaimed-category-1.m: Same.
+ * objc.dg/zero-link-1.m: Same.
+ * objc.dg/lookup-1.m: Same.
+ * objc.dg/torture/strings/const-str-9.m
+ * objc.dg/torture/strings/const-str-10.m: Same.
+ * objc.dg/torture/strings/const-str-11.m: Same.
+ * objc.dg/torture/forward-1.m: Same.
+ * objc.dg/zero-link-2.m: Same.
+ * objc.dg/encode-7-next-64bit.m: Same.
+ * objc.dg/method-4.m: Same.
+ * objc.dg/next-runtime-1.m: Same.
+ * objc.dg/image-info.m: Same.
+ * objc.dg/pr23214.m: Same.
+ * objc.dg/symtab-1.m: Same.
+ * obj-c++.dg/basic.m: Same.
+ * obj-c++.dg/proto-lossage-3.m: Same.
+ * obj-c++.dg/torture/strings/const-str-10.m: Same.
+ * obj-c++.dg/torture/strings/const-str-11.m: Same.
+ * obj-c++.dg/torture/strings/const-str-9.m: Same.
+ * obj-c++.dg/method-11.m: Same.
+ * objc/execute/enumeration-1.m: Same.
+ * objc/execute/object_is_class.m: Same.
+ * objc/execute/formal_protocol-2.m: Same.
+ * objc/execute/formal_protocol-4.m: Same.
+ * objc/execute/formal_protocol-6.m: Same.
+ * objc/execute/bycopy-3.m: Same.
+ * objc/execute/exceptions/catchall-1.m: Same.
+ * objc/execute/exceptions/finally-1.m: Same.
+ * objc/execute/exceptions/local-variables-1.m: Same.
+ * objc/execute/exceptions/foward-1.m: Same.
+ * objc/execute/bf-common.h
+ * objc/execute/enumeration-2.m: Same.
+ * objc/execute/formal_protocol-1.m: Same.
+ * objc/execute/formal_protocol-3.m: Same.
+ * objc/execute/formal_protocol-5.m: Same.
+ * objc/execute/accessing_ivars.m: Same.
+ * objc/execute/bycopy-2.m: Same.
+ * objc/execute/formal_protocol-7.m: Same.
+ * objc/execute/compatibility_alias.m: Same.
+ * objc/execute/no_clash.m: Same.
+ * objc/execute/object_is_meta_class.m: Same.
+ * objc/execute/exceptions/exceptions.exp: Load target-supports.exp
+ * objc/execute/class-tests-1.h: Include stdio.h.
+ * objc/execute/class-tests-2.h: Same.
+ * obj-c++.dg/try-catch-9.mm: xfail-run the test with both
+ runtimes.
+ * obj-c++.dg/try-catch-2.mm: Same.
+
+2011-02-17 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/47783
+ * g++.dg/warn/Wunused-parm-4.C: New test.
+
+2011-02-17 Alexandre Oliva <aoliva@redhat.com>
+ Jan Hubicka <jh@suse.cz>
+
+ PR debug/47106
+ PR debug/47402
+ * g++.dg/debug/pr47106.C: New.
+
+2011-02-17 Uros Bizjak <ubizjak@gmail.com>
+
+ PR target/43653
+ * gcc.target/i386/pr43653.c: New test.
+
+2011-02-11 Dodji Seketeli <dodji@redhat.com>
+
+ PR c++/47172
+ * g++.dg/template/inherit6.C: New test.
+
+2011-02-16 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/47745
+ * gfortran.dg/class_39.f03: New.
+
+2011-02-16 Dodji Seketeli <dodji@redhat.com>
+
+ PR c++/47326
+ * g++.dg/cpp0x/variadic106.C: New test.
+
+2011-02-16 Jakub Jelinek <jakub@redhat.com>
+
+ PR libfortran/47757
+ * gfortran.dg/pr47757-1.f90: New test.
+ * gfortran.dg/pr47757-2.f90: New test.
+ * gfortran.dg/pr47757-3.f90: New test.
+
+ PR c++/47704
+ * g++.dg/cpp0x/enum8.C: New test.
+
+2011-02-15 Jason Merrill <jason@redhat.com>
+
+ * g++.dg/inherit/implicit-trivial1.C: New.
+ * g++.dg/cpp0x/implicit-trivial1.C: New.
+
+2011-02-15 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR middle-end/47725
+ * gcc.dg/torture/pr47725.c: Removed.
+
+2011-02-15 Michael Meissner <meissner@linux.vnet.ibm.com>
+
+ PR target/47755
+ * gcc.target/powerpc/pr47755.c: New file, test all 0 vector
+ constant does not generate a load from memory.
+
+2011-02-15 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR middle-end/47725
+ * gcc.dg/torture/pr47725.c: New.
+
+2011-02-15 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/47743
+ * gcc.dg/torture/pr47743.c: New testcase.
+
+2011-02-15 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/47581
+ * gcc.target/i386/pr47581.c: New test.
+
+2011-02-14 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/47730
+ * gfortran.dg/select_type_22.f03: New.
+
+2011-02-14 Jason Merrill <jason@redhat.com>
+
+ * g++.dg/cpp0x/regress/enum1.C: New.
+
+2011-02-14 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gnat.dg/include.adb: New test.
+
+2011-02-14 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/47728
+ * gfortran.dg/class_38.f03: New.
+
+2011-02-14 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gcc.dg/pr46494.c: New test.
+
+2011-02-14 Richard Guenther <rguenther@suse.de>
+
+ * gcc.dg/attr-weak-hidden-1.c: Make definition of foo strong.
+
+2011-02-14 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ PR ada/41929
+ * gnat.dg/null_pointer_deref1.exp: Don't skip on
+ sparc*-sun-solaris2.11.
+
+2011-02-14 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/47349
+ * gfortran.dg/argument_checking_18.f90: New.
+
+2011-02-13 Tobias Burnus <burnus@net-b.de>
+
+ * gfortran.dg/argument_checking_13.f90: Update dg-error.
+ * gfortran.dg/argument_checking_17.f90: New.
+
+2011-02-12 Janus Weil <janus@gcc.gnu.org>
+
+ * gfortran.dg/allocate_derived_1.f90: Modified as polymorphic arrays
+ are temporarily disabled.
+ * gfortran.dg/class_7.f03: Ditto.
+ * gfortran.dg/coarray_14.f90: Ditto.
+ * gfortran.dg/typebound_proc_13.f03: Ditto.
+
+2011-02-12 Mikael Morin <mikael.morin@sfr.fr>
+
+ PR fortran/45586
+ * gfortran.dg/extends_11.f03: New.
+
+2011-02-11 Xinliang David Li <davidxl@google.com>
+
+ PR tree-optimization/47707
+ * g++.dg/tree-ssa/pr47707.C: New test.
+
+2011-02-11 Eric Botcazou <ebotcazou@adacore.com>
+
+ * g++.dg/opt/inline17.C: New test.
+
+2011-02-11 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/47550
+ * gfortran.dg/pure_formal_2.f90: New.
+
+2011-02-11 Pat Haugen <pthaugen@us.ibm.com>
+
+ PR rtl-optimization/47614
+ * gfortran.dg/pr47614.f: New.
+
+2011-02-11 Joseph Myers <joseph@codesourcery.com>
+
+ PR driver/47678
+ * gcc.dg/opts-6.c: New test.
+
+2011-02-11 Jakub Jelinek <jakub@redhat.com>
+
+ PR debug/47684
+ * gcc.dg/pr47684.c: New test.
+
+2011-02-11 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ PR target/47629
+ * gcc.target/i386/pr47312.c: Use dg-require-effective-target
+ c99_runtime, dg-add-options c99_runtime.
+ (main): Use __asm__.
+
+2011-02-11 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ PR testsuite/47400
+ * lib/target-supports.exp (check_ascii_locale_available): New proc.
+ * lib/target-supports-dg.exp (dg-require-ascii-locale): New proc.
+ * gcc.dg/attr-alias-5.c: Use dg-require-ascii-locale.
+ * gcc.dg/ucnid-10.c: Likewise.
+ * gcc.dg/ucnid-13.c: Likewise.
+ * gcc.dg/ucnid-7.c: Likewise.
+ * gcc.dg/ucnid-8.c: Likewise.
+ Adapt dg-warning line number.
+
+2011-02-10 Uros Bizjak <ubizjak@gmail.com>
+
+ * gcc.target/i386/parity-1.c: Use -march=k8.
+ * gcc.target/i386/parity-2.c: Ditto.
+ * gcc.target/i386/vecinit-1.c: Ditto.
+ * gcc.target/i386/vecinit-2.c: Ditto.
+
+2011-02-10 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ PR target/46610
+ * gcc.target/mips/save-restore-1.c: Skip on mips-sgi-irix6*.
+ * gcc.target/mips/save-restore-3.c: Likewise.
+ * gcc.target/mips/save-restore-4.c: Likewise.
+ * gcc.target/mips/save-restore-5.c: Likewise.
+
+ PR target/47683
+ * g++.dg/tree-prof/partition1.C: Skip on mips-sgi-irix*.
+ * g++.dg/tree-prof/partition2.C: Likewise.
+
+2011-02-09 Jason Merrill <jason@redhat.com>
+
+ * g++.dg/tree-ssa/inline-3.C: Use a normal function
+ rather than misdeclare std::puts.
+
+ * g++.dg/ext/vla1.C: Adjust for C++0x mode.
+ * g++.dg/other/warning1.C: Likewise.
+ * g++.old-deja/g++.bugs/900119_01.C: Likewise.
+ * g++.old-deja/g++.gb/scope06.C: Likewise.
+ * g++.old-deja/g++.law/cvt11.C: Likewise.
+ * g++.old-deja/g++.law/init1.C: Likewise.
+ * g++.dg/abi/mangle26.C: Likewise.
+
+ * g++.dg/template/function1.C: Adjust for C++0x mode.
+ * g++.dg/cpp0x/regress/template-function1.C: Copy it.
+
+ * g++.dg/ext/label10.C: Adjust for C++0x mode.
+ * g++.dg/cpp0x/regress/ext-label10.C: Copy it.
+
+ * g++.dg/cpp0x/regress/ext-cond1.C: Copy from ext/cond1.C.
+
+ * g++.dg/cpp0x/regress/abi-empty7.C: New.
+
+ * g++.dg/cpp0x/regress: New directory.
+ * g++.dg/cpp0x/constexpr-regress1.C: Move to regress/regress1.C.
+ * g++.dg/cpp0x/constexpr-regress2.C: Move to regress/regress2.C.
+ * g++.dg/cpp0x/regress/regress3.C: New.
+
+2011-02-10 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/47677
+ * gcc.dg/torture/pr47677.c: New testcase.
+
+2011-02-10 Iain Sandoe <iains@gcc.gnu.org>
+
+ * objc.dg/special/load-category-1.m: Remove unused header.
+ * objc.dg/special/load-category-1a.m: Likewise.
+ * objc.dg/special/load-category-2.m: Likewise.
+ * objc.dg/special/load-category-2a.m: Likewise.
+ * objc.dg/special/load-category-3.m: Likewise.
+ * objc.dg/special/load-category-3a.m: Likewise.
+ * objc.dg/attributes/proto-attribute-2.m: Likewise.
+ * objc.dg/attributes/proto-attribute-3.m: Likewise.
+ * objc.dg/attributes/class-attribute-1.m: Likewise.
+ * objc.dg/property/property.exp: Don't run for Darwin < 9.
+ * obj-c++.dg/property/property.exp: Likewise.
+ * objc.dg/attributes/method-sentinel-1.m: Update type header.
+ * obj-c++.dg/attributes/method-sentinel-1.mm: Likewise.
+ * obj-c++.dg/attributes/proto-attribute-2.mm: Skip for Darwin < 9.
+ * obj-c++.dg/attributes/class-attribute-1.mm: Likewise.
+ * obj-c++.dg/attributes/proto-attribute-3.mm: Likewise.
+ * obj-c++.dg/template-8.mm: Likewise.
+
+2011-02-10 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/47665
+ * gcc.target/i386/pr47665.c: New test.
+
+2011-02-10 Jie Zhang <jie@codesourcery.com>
+
+ PR testsuite/47622
+ Revert
+ 2011-02-05 Jie Zhang <jie@codesourcery.com>
+ PR debug/42631
+ * gcc.dg/pr42631.c: Update test.
+ * gcc.dg/pr42631-2.c: New test.
+
+2011-02-09 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/47352
+ * gfortran.dg/proc_decl_25.f90: New.
+
+2011-02-09 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/47463
+ * gfortran.dg/typebound_assignment_2.f03: New.
+
+2011-02-09 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/47664
+ * gcc.dg/tree-ssa/inline-7.c: New testcase.
+
+2011-02-09 Eric Botcazou <ebotcazou@adacore.com>
+
+ PR middle-end/47646
+ * gnat.dg/uninit_func.adb: Adjust dg directive.
+
+2011-02-09 Dominique Dhumieres <dominiq@lps.ens.fr>
+
+ PR middle-end/47646
+ * obj-c++.dg/attributes/method-noreturn-1.mm: Adjust dg directives.
+
+2011-02-09 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/47637
+ * gfortran.dg/auto_dealloc_2.f90: New.
+
+2011-02-09 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * gcc.dg/builtins-config.h: Remove __sgi handling.
+ * lib/target-supports.exp (add_options_for_c99_runtime): Add
+ -std=c99 for mips-sgi-irix6.5*.
+
+2011-02-09 Martin Jambor <mjambor@suse.cz>
+
+ PR middle-end/45505
+ * gfortran.dg/pr25923.f90: Remove xfails.
+
+2011-02-08 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
+ PR fortran/47583
+ * gfortran.dg/inquire_14.f90: New test.
+
+2011-02-08 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/45290
+ * gfortran.dg/pointer_init_6.f90: New.
+
+2011-02-08 Jeff Law <law@redhat.com>
+
+ PR tree-optimization/42893
+ * gcc.tree-ssa/pr42893.c: New test.
+
+2011-02-08 Sebastian Pop <sebastian.pop@amd.com>
+
+ PR tree-optimization/46834
+ PR tree-optimization/46994
+ PR tree-optimization/46995
+ * gcc.dg/graphite/id-pr46834.c: New.
+ * gfortran.dg/graphite/id-pr46994.f90: New.
+ * gfortran.dg/graphite/id-pr46995.f90: New.
+
+2011-02-08 Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
+
+ PR middle-end/47646
+ * gcc.dg/pr39666-2.c (foo2): If the location of the statement
+ using the variable is known the warning is emitted there.
+ * gcc.dg/uninit-pr19430.c (foo): Likewise.
+ * g++.dg/warn/Wuninitialized-5.C (foo): Likewise.
+
+ * c-c++-common/pr20000.c (g): Both warnings occur at the return
+ statement.
+ (vg): Likewise.
+ * gcc.dg/noreturn-1.c (foo5): Likewise.
+ * objc.dg/attributes/method-noreturn-1.m (method1): Likewise.
+ (method2): Likewise.
+
+ * gfortran.dg/pr25923.f90 (baz): The warning will now be issued for
+ the return statement using the uninitialized variable.
+ * gfortran.dg/pr39666-2.f90 (f): Likewise.
+
+2011-02-08 Richard Guenther <rguenther@suse.de>
+
+ PR middle-end/47639
+ * g++.dg/opt/pr47639.c: New testcase.
+
+2011-02-08 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/47632
+ * g++.dg/opt/pr47632.C: New testcase.
+
+2011-02-07 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
+
+ * g++.dg/abi/packed1.C: Expect warning on spu-*-* as well.
+
+2011-02-07 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/47615
+ * g++.dg/opt/pr47615.C: New testcase.
+
+2011-02-07 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/47621
+ * gcc.dg/torture/pr47621.c: New testcase.
+
+2011-02-07 Uros Bizjak <ubizjak@gmail.com>
+
+ * gfortran.dg/transpose_optimization_2.f90: Cleanup original dump.
+
+2011-02-06 Paul Thomas <pault@gcc.gnu.org>
+
+ PR fortran/47592
+ * gfortran.dg/allocate_with_source_1 : New test.
+
+2011-02-05 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/47610
+ * gcc.dg/pr47610.c: New test.
+
+2011-02-05 Jie Zhang <jie@codesourcery.com>
+
+ PR debug/42631
+ * gcc.dg/pr42631.c: Update test.
+ * gcc.dg/pr42631-2.c: New test.
+
+2001-02-05 Thomas Koenig <tkoenig@gcc.gnu.org>
+
+ PR fortran/47574
+ * gfortran.dg/pr47574.f90: New test.
+
+2011-02-04 Sebastian Pop <sebastian.pop@amd.com>
+
+ PR tree-optimization/46194
+ * gcc.dg/autopar/pr46194.c: New.
+
+2011-02-04 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR tree-optimization/43695
+ * g++.dg/ipa/pr43695.C: New.
+
+2011-02-04 Jakub Jelinek <jakub@redhat.com>
+
+ PR inline-asm/23200
+ * gcc.dg/pr23200.c: New test.
+
+2011-02-03 Jonathan Wakely <jwakely.gcc@gmail.com>
+
+ PR c++/47589
+ * g++.dg/pr47589.C: New test.
+
+2011-02-03 Dodji Seketeli <dodji@redhat.com>
+
+ PR c++/47398
+ * g++.dg/template/typedef37.C: New test.
+ * g++.dg/template/param1.C: Adjust expected error message.
+
+2011-02-03 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/31490
+ * gcc.dg/pr31490-2.c: New test.
+ * gcc.dg/pr31490-3.c: New test.
+ * gcc.dg/pr31490-4.c: New test.
+
+2011-02-03 Nathan Froyd <froydnj@codesourcery.com>
+ Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/46890
+ * g++.dg/parser/semicolon3.C: Adjust.
+ * g++.dg/parser/semicolon4.C: New testcase.
+ * g++.dg/pr46890.C: New testcase.
+
+2011-02-03 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/29571
+ * g++.dg/init/pr29571.C: New.
+
+2011-02-03 H.J. Lu <hongjiu.lu@intel.com>
+
+ * gfortran.dg/graphite/vect-pr40979.f90: Require vect_double
+ instead of vect_int.
+
+2011-02-03 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/47312
+ * gcc.target/i386/pr47312.c: New test.
+
+ PR target/47564
+ * gcc.target/i386/pr47564.c: New test.
+
+2011-02-03 Alexandre Oliva <aoliva@redhat.com>
+
+ PR tree-optimization/45122
+ * gcc.dg/tree-ssa/pr45122.c: New.
+
+2011-02-02 Michael Meissner <meissner@linux.vnet.ibm.com>
+
+ PR target/47272
+ * gcc.target/powerpc/vsx-builtin-8.c: New file, test vec_vsx_ld
+ and vec_vsx_st.
+
+ * gcc.target/powerpc/avoid-indexed-addresses.c: Disable altivec
+ and vsx so a default --with-cpu=power7 doesn't give an error
+ when -mavoid-indexed-addresses is used.
+
+ * gcc.target/powerpc/ppc32-abi-dfp-1.c: Rewrite to use an asm
+ wrapper function to save the arguments and then jump to the real
+ function, rather than depending on the compiler not to move stuff
+ before an asm.
+ * gcc.target/powerpc/ppc64-abi-dfp-2.c: Ditto.
+
+2011-02-02 Janus Weil <janus@gcc.gnu.org>
+ Paul Thomas <pault@gcc.gnu.org>
+
+ PR fortran/47082
+ * gfortran.dg/class_37.f03 : New test.
+
+2011-02-02 Sebastian Pop <sebastian.pop@amd.com>
+ Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/40979
+ PR bootstrap/47044
+ * gcc.dg/graphite/graphite.exp (DEFAULT_VECTCFLAGS): Add -ffast-math.
+ * gcc.dg/graphite/pr35356-2.c: Adjust pattern.
+ * gfortran.dg/graphite/graphite.exp: Run vect_files conditionally to
+ check_vect_support_and_set_flags.
+ * gfortran.dg/graphite/vect-pr40979.f90: New.
+
+2011-02-02 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/47572
+ * gfortran.dg/class_36.f03: New.
+
+2011-02-02 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/47566
+ * gcc.dg/lto/20110201-1_0.c: New testcase.
+
+2011-02-02 Alexandre Oliva <aoliva@redhat.com>
+
+ PR debug/47498
+ PR debug/47501
+ PR debug/45136
+ PR debug/45130
+ * debug/pr47498.c: New.
+ * debug/pr47501.c: New.
+
+2011-02-01 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/47559
+ * g++.dg/torture/pr47559.C: New testcase.
+
+2011-02-01 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/47565
+ * gfortran.dg/typebound_call_20.f03: New.
+
+2011-02-01 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/47555
+ * gcc.dg/pr47555.c: New testcase.
+
+2011-02-01 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/47541
+ * g++.dg/torture/pr47541.C: New testcase.
+
+2011-01-31 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/47455
+ * gfortran.dg/typebound_call_19.f03: New.
+
+2011-01-31 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/47416
+ * g++.dg/cpp0x/pr47416.C: New test.
+
+2011-01-31 Paul Thomas <pault@gcc.gnu.org>
+
+ PR fortran/47519
+ * gfortran.dg/allocate_deferred_char_scalar_2.f03: New test.
+
+2011-01-31 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/47463
+ * gfortran.dg/typebound_assignment_1.f03: New.
+
+2011-01-31 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/47538
+ * gcc.c-torture/execute/pr47538.c: New test.
+
+2011-01-31 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ PR target/45325
+ * gcc.target/i386/pr38240.c: Add dg-options "-msse".
+
+2011-01-31 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * g++.dg/abi/mangle40.C: Pass "" to dg-require-weak.
+
+2011-01-31 Eric Botcazou <ebotcazou@adacore.com>
+
+ PR rtl-optimization/44031
+ * gcc.c-torture/compile/20110131-1.c: New test.
+
+2011-01-31 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/47042
+ * gfortran.dg/stmt_func_1.f90: New.
+
+2011-01-31 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/47042
+ * gfortran.dg/interface_34.f90: New.
+
+2011-01-30 Paul Thomas <pault@gcc.gnu.org>
+
+ PR fortran/47523
+ * gfortran.dg/realloc_on_assign_5.f03: New test.
+ * gfortran.dg/realloc_on_assign_5.f03: New test.
+
+2011-01-29 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
+
+ * gfortran.dg/bessel_6.f90: XFAIL on spu-*-*.
+ * gfortran.dg/bessel_7.f90: Likewise.
+ * gfortran.dg/erf_2.F90: Likewise. Always run with -O0.
+
+ * gfortran.dg/complex_intrinsics_5.f90: Increase "epsilon".
+ * gfortran.dg/sum_init_expr.f03: Likewise.
+
+ * gfortran.dg/realloc_on_assign_2.f03: Skip on spu-*-*.
+
+ * gfortran.dg/lto/20091016-1_0.f90: Replace -shared with
+ -r -nostdlib.
+
+ * gfortran.dg/vect/fast-math-vect-8.f90: Check for vectorized
+ loop only on "vect_intfloat_cvt" targets.
+
+2011-01-29 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/47531
+ * gfortran.dg/shape_6.f90: New.
+
+2011-01-29 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
+ PR libgfortran/47434
+ * gfortran.dg/read_infnan_1.f90: Update test.
+ * gfortran.dg/module_nan.f90: Update test.
+ * gfortran.dg/char4_iunit_1.f03: Update test.
+ * gfortran.dg/large_real_kind_1.f90: Update test.
+ * gfortran.dg/real_const_3.f90: Update test.
+ * gfortran.fortran-torture/execute/nan_inf_fmt.f90: Update test.
+
+2011-01-29 Dodji Seketeli <dodji@redhat.com>
+
+ PR c++/47311
+ * g++.dg/template/param2.C: New test.
+
+2011-01-28 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
+ PR libgfortran/47285
+ * gfortran.dg/fmt_g.f: New test.
+
+2011-01-28 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/47507
+ * gfortran.dg/pure_formal_1.f90: New.
+
+2011-01-28 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/42894
+ * gcc.dg/tls/pr42894.c: New test.
+
+2011-01-28 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * gcc.dg/pr47276.c: Add dg-require-visibility.
+
+2011-01-28 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * gcc.target/i386/asm-6.c: XFAIL on i?86-pc-solaris2.1[0-9] && ilp32.
+
+2011-01-28 Paul Thomas <pault@gcc.gnu.org>
+ Tobias Burnus <burnus@gcc.gnu.org>
+
+ PR fortran/45170
+ PR fortran/35810
+ PR fortran/47350
+ * gfortran.dg/realloc_on_assign_3.f03: New test.
+ * gfortran.dg/realloc_on_assign_4.f03: New test.
+ * gfortran.dg/allocatable_function_5.f90: New test.
+ * gfortran.dg/allocate_deferred_char_scalar_1.f03: New test.
+ * gfortran.dg/deferred_type_param_2.f90: Remove two "not yet
+ implemented" dg-errors.
+
+2011-01-27 Jan Hubicka <jh@suse.cz>
+
+ PR middle-end/46949
+ * gcc.dg/attr-weakref-4.c: New testcase
+
+2011-01-27 Martin Jambor <mjambor@suse.cz>
+
+ PR tree-optimization/47228
+ * gcc.dg/torture/pr47228.c: New test.
+
+2011-01-27 Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
+
+ * gcc.dg/tree-ssa/pr42585.c: Disable on s390 and s390x.
+
+2011-01-27 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
+
+ * lib/compat.exp (compat-execute): Pass -Wl,--extra-stack-space=8192
+ when using auto-overlay support on the SPU.
+
+2011-01-27 Eric Botcazou <ebotcazou@adacore.com>
+
+ PR rtl-optimization/44174
+ * gcc.target/i386/asm-6.c: New test.
+
+2011-01-26 Mikael Pettersson <mikpe@it.uu.se>
+
+ PR rtl-optimization/46856
+ * gcc.c-torture/compile/pr46856.c: New test.
+
+2011-01-26 Nicola Pero <nicola.pero@meta-innovation.com>
+ Andrew Pinski <pinskia@gmail.com>
+
+ PR c/43082
+ * gcc.dg/pr43082.c: New.
+
+2011-01-26 DJ Delorie <dj@redhat.com>
+
+ PR rtl-optimization/46878
+ * gcc.dg/pr46878-1.c: New test.
+
+2011-01-26 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/47476
+ * g++.dg/cpp0x/pr47476.C: New test.
+
+2011-01-26 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gcc.c-torture/compile/20110126-1.c: New test.
+
+2011-01-26 Jakub Jelinek <jakub@redhat.com>
+
+ PR c/47473
+ * gcc.dg/torture/pr47473.c: New test.
+
+2011-01-26 Jan Hubicka <jh@suse.cz>
+
+ PR target/47237
+ * gcc.c-torture/execute/pr47237.c: New testcase.
+
+2011-01-26 Jan Hubicka <jh@suse.cz>
+
+ PR tree-optimization/47190
+ * gcc.dg/attr-weakref-3.c: New testcase.
+
+2011-01-26 Dave Korn <dave.korn.cygwin@gmail.com>
+
+ PR c++/43601
+ * gcc.dg/dll-9a.c: New test file.
+ * gcc.dg/dll-11.c: Likewise.
+ * gcc.dg/dll-12.c: Likewise.
+ * gcc.dg/dll-12a.c: Likewise.
+ * gcc.dg/dll-11a.c: Likewise.
+ * gcc.dg/dll-9.c: Likewise.
+ * gcc.dg/dll-10.c: Likewise.
+ * gcc.dg/dll-10a.c: Likewise.
+ * g++.dg/ext/dllexport4a.cc: Likewise.
+ * g++.dg/ext/dllexport4.C: Likewise.
+ * g++.dg/ext/dllexport5.C: Likewise.
+ * g++.dg/ext/dllexport5a.cc: Likewise.
+
+2011-01-25 Sebastian Pop <sebastian.pop@amd.com>
+
+ PR tree-optimization/46970
+ * gcc.dg/graphite/pr46970.c: New.
+
+2011-01-25 Sebastian Pop <sebastian.pop@amd.com>
+
+ PR tree-optimization/46215
+ * gcc.dg/graphite/pr46215.c: New.
+
+2011-01-25 Sebastian Pop <sebastian.pop@amd.com>
+
+ PR tree-optimization/46168
+ * gcc.dg/graphite/pr46168.c: New.
+
+2011-01-25 Sebastian Pop <sebastian.pop@amd.com>
+
+ PR tree-optimization/43657
+ * gcc.dg/graphite/pr43657.c: New.
+
+2011-01-25 Sebastian Pop <sebastian.pop@amd.com>
+
+ PR tree-optimization/29832
+ * gfortran.dg/graphite/pr29832.f90: New.
+
+2011-01-25 Sebastian Pop <sebastian.pop@amd.com>
+
+ PR tree-optimization/43567
+ * gcc.dg/graphite/pr43567.c: New.
+
+2011-01-25 Sebastian Pop <sebastian.pop@amd.com>
+
+ * gfortran.dg/graphite/interchange-4.f: New.
+ * gfortran.dg/graphite/interchange-5.f: New.
+
+ * gcc.dg/tree-ssa/ltrans-1.c: Removed.
+ * gcc.dg/tree-ssa/ltrans-2.c: Removed.
+ * gcc.dg/tree-ssa/ltrans-3.c: Removed.
+ * gcc.dg/tree-ssa/ltrans-4.c: Removed.
+ * gcc.dg/tree-ssa/ltrans-5.c: Removed.
+ * gcc.dg/tree-ssa/ltrans-6.c: Removed.
+ * gcc.dg/tree-ssa/ltrans-8.c: Removed.
+ * gfortran.dg/ltrans-7.f90: Removed.
+ * gcc.dg/tree-ssa/data-dep-1.c: Removed.
+
+ * gcc.dg/pr18792.c: -> gcc.dg/graphite/pr18792.c
+ * gcc.dg/pr19910.c: -> gcc.dg/graphite/pr19910.c
+ * gcc.dg/tree-ssa/20041110-1.c: -> gcc.dg/graphite/pr20041110-1.c
+ * gcc.dg/tree-ssa/pr20256.c: -> gcc.dg/graphite/pr20256.c
+ * gcc.dg/pr23625.c: -> gcc.dg/graphite/pr23625.c
+ * gcc.dg/tree-ssa/pr23820.c: -> gcc.dg/graphite/pr23820.c
+ * gcc.dg/tree-ssa/pr24309.c: -> gcc.dg/graphite/pr24309.c
+ * gcc.dg/tree-ssa/pr26435.c: -> gcc.dg/graphite/pr26435.c
+ * gcc.dg/pr29330.c: -> gcc.dg/graphite/pr29330.c
+ * gcc.dg/pr29581-1.c: -> gcc.dg/graphite/pr29581-1.c
+ * gcc.dg/pr29581-2.c: -> gcc.dg/graphite/pr29581-2.c
+ * gcc.dg/pr29581-3.c: -> gcc.dg/graphite/pr29581-3.c
+ * gcc.dg/pr29581-4.c: -> gcc.dg/graphite/pr29581-4.c
+ * gcc.dg/tree-ssa/loop-27.c: -> gcc.dg/graphite/pr30565.c
+ * gcc.dg/tree-ssa/pr31183.c: -> gcc.dg/graphite/pr31183.c
+ * gcc.dg/tree-ssa/pr33576.c: -> gcc.dg/graphite/pr33576.c
+ * gcc.dg/tree-ssa/pr33766.c: -> gcc.dg/graphite/pr33766.c
+ * gcc.dg/pr34016.c: -> gcc.dg/graphite/pr34016.c
+ * gcc.dg/tree-ssa/pr34017.c: -> gcc.dg/graphite/pr34017.c
+ * gcc.dg/tree-ssa/pr34123.c: -> gcc.dg/graphite/pr34123.c
+ * gcc.dg/tree-ssa/pr36287.c: -> gcc.dg/graphite/pr36287.c
+ * gcc.dg/tree-ssa/pr37686.c: -> gcc.dg/graphite/pr37686.c
+ * gcc.dg/pr42917.c: -> gcc.dg/graphite/pr42917.c
+ * gcc.dg/tree-ssa/data-dep-1.c
+ * gfortran.dg/loop_nest_1.f90: -> gfortran.dg/graphite/pr29290.f90
+ * gfortran.dg/pr29581.f90: -> gfortran.dg/graphite/pr29581.f90
+ * gfortran.dg/pr36286.f90: -> gfortran.dg/graphite/pr36286.f90
+ * gfortran.dg/pr36922.f: -> gfortran.dg/graphite/pr36922.f
+ * gfortran.dg/pr39516.f: -> gfortran.dg/graphite/pr39516.f
+
+2011-01-25 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/47265
+ PR tree-optimization/47443
+ * gcc.c-torture/compile/pr47265.c: New test.
+ * gcc.dg/pr47443.c: New test.
+
+2011-01-25 Martin Jambor <mjambor@suse.cz>
+
+ PR tree-optimization/47382
+ * g++.dg/torture/pr47382.C: New test.
+ * g++.dg/opt/devirt1.C: Xfail.
+
+2011-01-25 Yao Qi <yao@codesourcery.com>
+
+ PR target/45701
+ * gcc.target/arm/pr45701-1.c: New test.
+ * gcc.target/arm/pr45701-2.c: New test.
+ * gcc.target/arm/pr45701-3.c: New test.
+
+2011-01-25 Sebastian Pop <sebastian.pop@amd.com>
+ Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/47271
+ * gcc.dg/tree-ssa/ifc-pr47271.c: New.
+
+2011-01-25 Nick Clifton <nickc@redhat.com>
+
+ * gcc.target/rx/builtins.c: Allow -fipa-cp-clone.
+ (saturate_add): Delete.
+ (exchange): Delete.
+ (main): Do not run saturate_add.
+ (set_interrupts): Delete.
+
+2011-01-25 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/47448
+ * gfortran.dg/redefined_intrinsic_assignment_2.f90: New.
+
+2011-01-25 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/47427
+ PR tree-optimization/47428
+ * gcc.c-torture/compile/pr47427.c: New test.
+ * gcc.c-torture/compile/pr47428.c: New test.
+
+2011-01-25 Richard Guenther <rguenther@suse.de>
+
+ PR middle-end/47411
+ * gcc.dg/torture/pr47411.c: New testcase.
+
+2011-01-25 Sebastian Pop <sebastian.pop@amd.com>
+
+ * gfortran.dg/graphite/id-24.f: New.
+ * gfortran.dg/graphite/id-25.f: New.
+
+2011-01-25 Sebastian Pop <sebastian.pop@amd.com>
+
+ * gfortran.dg/graphite/id-23.f: New.
+
+2011-01-25 Sebastian Pop <sebastian.pop@amd.com>
+
+ * gfortran.dg/graphite/interchange-3.f90: Un-XFAILed.
+
+2011-01-25 Sebastian Pop <sebastian.pop@amd.com>
+
+ * gcc.dg/graphite/block-0.c: Un-XFAILed.
+ * gcc.dg/graphite/block-1.c: Un-XFAILed.
+ * gcc.dg/graphite/block-7.c: Un-XFAILed.
+ * gcc.dg/graphite/block-8.c: Un-XFAILed.
+ * gcc.dg/graphite/interchange-12.c: Un-XFAILed.
+ * gcc.dg/graphite/interchange-14.c: Un-XFAILed.
+ * gcc.dg/graphite/interchange-15.c: Un-XFAILed.
+ * gcc.dg/graphite/interchange-8.c: Un-XFAILed.
+ * gcc.dg/graphite/interchange-mvt.c: Un-XFAILed.
+
+2011-01-25 Sebastian Pop <sebastian.pop@amd.com>
+
+ * gcc.dg/graphite/block-0.c: Add documentation.
+ * gcc.dg/graphite/block-4.c: Same.
+ * gcc.dg/graphite/block-7.c: Same.
+ * gcc.dg/graphite/block-8.c: New.
+ * gcc.dg/graphite/interchange-1.c: Un-XFAILed.
+ * gcc.dg/graphite/interchange-11.c: Un-XFAILed.
+ * gcc.dg/graphite/interchange-12.c: Add documentation.
+ * gcc.dg/graphite/interchange-13.c: New.
+ * gcc.dg/graphite/interchange-14.c: New.
+ * gcc.dg/graphite/interchange-15.c: New.
+ * gcc.dg/graphite/interchange-8.c: Add documentation.
+ * gcc.dg/graphite/interchange-mvt.c: Same.
+
+2011-01-24 Michael Meissner <meissner@linux.vnet.ibm.com>
+
+ PR target/47408
+ * gcc.target/powerpc/altivec-11.c: Add explicit -mno-vsx.
+ * gcc.target/powerpc/altivec-14.c: Ditto.
+ * gcc.target/powerpc/altivec-33.c: Ditto.
+ * gcc.target/powerpc/altivec-types-1.c: Ditto.
+ * gcc.target/powerpc/altivec-types-2.c: Ditto.
+ * gcc.target/powerpc/altivec-types-3.c: Ditto.
+ * gcc.target/powerpc/altivec-types-4.c: Ditto.
+ * gcc.target/powerpc/ppc-vector-memcpy.c: Ditto.
+ * gcc.target/powerpc/ppc-vector-memset.c: Ditto.
+ * g++.dg/ext/altivec-15.C: Ditto.
+ * g++.dg/ext/altivec-types-1.C: Ditto.
+ * g++.dg/ext/altivec-types-2.C: Ditto.
+ * g++.dg/ext/altivec-types-3.C: Ditto.
+ * g++.dg/ext/altivec-types-4.C: Ditto.
+
+2011-01-24 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * lib/scanasm.exp (dg-function-on-line): Handle mips-sgi-irix*.
+
+2011-01-24 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * gfortran.dg/cray_pointers_2.f90: Avoid cycling through
+ optimization options.
+
+2011-01-24 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * gfortran.dg/array_constructor_33.f90: Use dg-timeout-factor 4.
+
+ PR testsuite/45988
+ * gfortran.dg/vect/fast-math-pr38968.f90: Use dg-timeout-factor 2.
+
+2011-01-23 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/47421
+ * gfortran.dg/allocatable_scalar_12.f90: New.
+
+2011-01-23 Ira Rosen <irar@il.ibm.com>
+
+ * gcc.dg/vect/costmodel/spu/costmodel-vect-33.c: Expect
+ vectorization to be not profitable if peeling is used to
+ realign the memory access.
+ * gcc.dg/vect/costmodel/spu/costmodel-vect-76a.c: Increase
+ loop bound to avoid loop unrolling.
+ * gcc.dg/vect/costmodel/spu/costmodel-vect-76c.c: Likewise.
+
+2011-01-22 Jan Hubicka <jh@suse.cz>
+
+ PR lto/47333
+ * g++.dg/lto/pr47333.C: New file.
+
+2011-01-22 Jan Hubicka <jh@suse.cz>
+
+ PR tree-optimization/43884
+ PR lto/44334
+ * gcc.dg/autopar/outer-2.c: Increase array size.
+ * gcc.dg/tree-ssa/ldist-pr45948.c: Update test.
+
+2011-01-22 Thomas Koenig <tkoenig@gcc.gnu.org>
+
+ PR fortran/38536
+ * gfortran.dg/c_loc_tests_16.f90: New test.
+
+2011-01-22 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/47399
+ * gfortran.dg/typebound_proc_19.f90: New.
+
+2011-01-21 Jeff Law <law@redhat.com>
+
+ PR tree-optimization/47053
+ * g++.dg/pr47053.C: New test.
+
+2011-01-21 Jason Merrill <jason@redhat.com>
+
+ PR c++/47041
+ * g++.dg/cpp0x/constexpr-ctor6.C: New.
+
+2011-01-21 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/47388
+ * g++.dg/cpp0x/range-for10.C: New test.
+ * g++.dg/template/for1.C: New test.
+
+ PR middle-end/45566
+ * g++.dg/tree-prof/partition3.C: New test.
+
+ * g++.dg/tree-prof/tree-prof.exp: Fix a comment.
+
+ PR rtl-optimization/47366
+ * g++.dg/opt/pr47366.C: New test.
+
+2011-01-21 Jason Merrill <jason@redhat.com>
+
+ PR c++/46552
+ * g++.dg/cpp0x/constexpr-regress2.C: New.
+
+ * g++.dg/cpp0x/constexpr-stmtexpr.C: New.
+
+2011-01-21 Jeff Law <law@redhat.com>
+
+ PR rtl-optimization/41619
+ * gcc.dg/pr41619.c: New.
+
+2011-01-21 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/47355
+ * g++.dg/opt/pr47355.C: New test.
+
+2011-01-21 Richard Guenther <rguenther@suse.de>
+
+ * gcc.dg/tree-ssa/pr47392.c: Make test non-static instead of
+ making main hot.
+
+2011-01-21 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/47365
+ * gcc.dg/torture/pr47365.c: New testcase.
+ * gcc.dg/tree-ssa/pr47392.c: Likewise.
+
+2011-01-21 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * g++.dg/other/anon5.C: Skip on mips-sgi-irix*.
+
+2011-01-21 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/47391
+ * gcc.dg/pr47391.c: New test.
+
+2011-01-21 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * g++.dg/template/char1.C: Use signed char.
+
+2011-01-21 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/47377
+ * gfortran.dg/pointer_target_4.f90: New.
+
+2011-01-20 Michael Meissner <meissner@linux.vnet.ibm.com>
+
+ PR target/47251
+ * gcc.target/powerpc/pr47251.c: Fixup test so that it runs on
+ ILP32 system and not IP32.
+
+2011-01-20 Alexandre Oliva <aoliva@redhat.com>
+
+ PR debug/46583
+ * g++.dg/debug/pr46583.C: New.
+
+2011-01-20 Jakub Jelinek <jakub@redhat.com>
+
+ PR debug/47283
+ * g++.dg/debug/pr47283.C: New test.
+
+ PR testsuite/47371
+ * gcc.target/i386/headmerge-1.c: Tighten up scan-assembler regex.
+ * gcc.target/i386/headmerge-2.c: Likewise.
+
+2011-01-20 Richard Guenther <rguenther@suse.de>
+
+ PR middle-end/47370
+ * gcc.dg/torture/pr47370.c: New testcase.
+
+2011-01-20 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/46130
+ * gcc.dg/pr46130-1.c: New test.
+ * gcc.dg/pr46130-2.c: New test.
+
2011-01-19 Dodji Seketeli <dodji@redhat.com>
PR c++/47291
- * g++.dg/debug/dwarf2/template-params-10.C: New test.
+ * g++.dg/debug/dwarf2/template-params-10.C: New test.
2011-01-19 Alexandre Oliva <aoliva@redhat.com>
@@ -105,7 +1780,7 @@
2011-01-16 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
PR testsuite/47325
- g++.dg/ext/pr47213.C: Require visibility.
+ * g++.dg/ext/pr47213.C: Require visibility.
2011-01-16 Richard Sandiford <rdsandiford@googlemail.com>
@@ -152,9 +1827,9 @@
PR objc/45989
* objc.dg/gnu-encoding/struct-layout-encoding-1_generate.c
- (switchfiles): XFAIL
- objc.dg-struct-layout-encoding-1/t02[57-9]_main.m execution tests
- on i?86-*-*, x86_64-*-*, and powerpc*-apple-darwin* && ilp32.
+ (switchfiles): XFAIL objc.dg-struct-layout-encoding-1/t02[57-9]_main.m
+ execution tests on i?86-*-*, x86_64-*-* and
+ powerpc*-apple-darwin* && ilp32.
XFAIL objc.dg-struct-layout-encoding-1/t03[01]_main.m execution
tests on i?86-*-* and x86_64-*-*.
@@ -204,8 +1879,7 @@
2011-01-13 Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
- * gcc.dg/guality/pr36728-1.c: Disable arg1/2 checks for s390 and
- s390x.
+ * gcc.dg/guality/pr36728-1.c: Disable arg1/2 checks for s390 and s390x.
* gcc.dg/guality/pr36728-2.c: Likewise.
2011-01-13 Dodji Seketeli <dodji@redhat.com>
@@ -243,8 +1917,8 @@
Amend NeXT version to declare a TEST_SUITE_ADDITIONS carrying the
methods missing from the OBJC2 Object.
* objc-obj-c++-shared/Object1-implementation.h: Add copyright header.
- Amend implementation to use a TEST_SUITE_ADDITIONS category for both GNU
- and NeXT runtimes.
+ Amend implementation to use a TEST_SUITE_ADDITIONS category for both
+ GNU and NeXT runtimes.
* objc-obj-c++-shared/Object1.mm: Remove redundant header, update
comments.
* objc-obj-c++-shared/Object1.m: Likewise.
@@ -262,14 +1936,14 @@
Fixed the Objective-C++ testsuite and updated all tests.
* lib/obj-c++.exp (obj-c++_init): Declare and set
- gcc_warning_prefix and gcc_error_prefix.
+ gcc_warning_prefix and gcc_error_prefix.
* obj-c++.dg/attributes/categ-attribute-2.mm: Fixed usage of
'dg-warning', 'dg-message' and 'dg-error'.
* obj-c++.dg/class-extension-3.mm: Likewise.
* obj-c++.dg/class-protocol-1.mm: Likewise.
* obj-c++.dg/encode-7.mm: Likewise.
* obj-c++.dg/exceptions-3.mm: Likewise.
- * obj-c++.dg/exceptions-5.mm: Likewise.
+ * obj-c++.dg/exceptions-5.mm: Likewise.
* obj-c++.dg/method-12.mm: Likewise.
* obj-c++.dg/method-13.mm: Likewise.
* obj-c++.dg/method-15.mm: Likewise.
@@ -284,13 +1958,13 @@
* obj-c++.dg/method-conflict-4.mm: Likewise. Also, removed FIXME
and uncommented second part of the testcase now that the testsuite
works correctly.
- * obj-c++.dg/private-1.mm: Likewise.
+ * obj-c++.dg/private-1.mm: Likewise.
* obj-c++.dg/proto-lossage-4.mm: Likewise.
* obj-c++.dg/syntax-error-7.mm: Likewise.
* obj-c++.dg/warn5.mm: Likewise.
* obj-c++.dg/property/at-property-14.mm: Likewise.
* obj-c++.dg/property/at-property-16.mm: Likewise, and removed
- FIXME.
+ FIXME.
* obj-c++.dg/property/at-property-18.mm: Likewise.
* obj-c++.dg/property/at-property-20.mm: Likewise, and removed
FIXME.
@@ -306,12 +1980,12 @@
* obj-c++.dg/tls/diag-5.mm: Likewise.
* obj-c++.dg/ivar-invalid-type-1.mm: Removed FIXME and uncommented
dg-error, now matched correctly.
-
+
2011-01-12 Nicola Pero <nicola.pero@meta-innovation.com>
* objc.dg/property/at-property-29.m: New.
- * obj-c++.dg/property/at-property-29.mm: New.
-
+ * obj-c++.dg/property/at-property-29.mm: New.
+
2011-01-11 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
* go.test/go-test.exp (go-set-goarch): New proc.
@@ -453,7 +2127,7 @@
PR objc/47232
* objc.dg/attributes/invalid-attribute-1.m: New.
- * obj-c++.dg/attributes/invalid-attribute-1.mm: New.
+ * obj-c++.dg/attributes/invalid-attribute-1.mm: New.
2011-01-09 Janus Weil <janus@gcc.gnu.org>
@@ -559,11 +2233,13 @@
Get builtins tests ready for linker plugin.
* gcc.c-torture/execute/builtins/memcpy-chk.c (s2,s3,l1): Mark volatile.
- * gcc.c-torture/execute/builtins/memops-asm-lib.c (my_memcpy, my_bcopy, my_memset,
- my_bzero): Mark used.
+ * gcc.c-torture/execute/builtins/memops-asm-lib.c (my_memcpy, my_bcopy,
+ my_memset, my_bzero): Mark used.
* gcc.c-torture/execute/builtins/memset-chk.c (l1, l3): Mark volatile.
- * gcc.c-torture/execute/builtins/memmove-chk.c (s1,s2,s3,l1): Mark volatile.
- * gcc.c-torture/execute/builtins/mempcpy-chk.c (s2,s3,l1): Mark volatile
+ * gcc.c-torture/execute/builtins/memmove-chk.c (s1,s2,s3,l1): Mark
+ volatile.
+ * gcc.c-torture/execute/builtins/mempcpy-chk.c (s2,s3,l1): Mark
+ volatile.
2011-01-07 Jan Hubicka <jh@suse.cz>
diff --git a/gcc/testsuite/ChangeLog-2010 b/gcc/testsuite/ChangeLog-2010
index 86b582ad9be..b8d94644a47 100644
--- a/gcc/testsuite/ChangeLog-2010
+++ b/gcc/testsuite/ChangeLog-2010
@@ -3,14 +3,13 @@
* gcc.c-torture/compile/pr46534.c: Skip if pdp11.
* gcc.c-torture/compile/920520-1.c: Ditto.
* gcc.c-torture/compile/pr35318.c: Ditto.
-
+
2010-12-31 Paul Koning <ni1d@arrl.net>
* gcc.c-torture/execute/ieee/ieee.exp: Skip if pdp11.
* gcc.c-torture/compile/20000804-1.c: Skip if pdp11 -O0.
* gcc.c-torture/compile/20020312-1.c: Ditto.
- * gcc.c-torture/compile/20040101-1.c: Skip if pdp11 -O1, -O2, or
- -Os.
+ * gcc.c-torture/compile/20040101-1.c: Skip if pdp11 -O1, -O2, or -Os.
2010-12-31 Thomas Koenig <tkoenig@gcc.gnu.org>
@@ -44,8 +43,8 @@
* obj-c++.dg/class-extension-3.mm: Updated.
* obj-c++.dg/method-8.mm: Updated.
* obj-c++.dg/method-conflict-1.mm: New.
- * obj-c++.dg/method-conflict-2.mm: New.
-
+ * obj-c++.dg/method-conflict-2.mm: New.
+
2010-12-30 Joseph Myers <joseph@codesourcery.com>
PR c/46889
@@ -53,8 +52,8 @@
2010-12-30 Nathan Froyd <froydnj@codesourcery.com>
- PR target/44606
- * gcc.dg/pr44606.c: New test.
+ PR target/44606
+ * gcc.dg/pr44606.c: New test.
2010-12-30 H.J. Lu <hongjiu.lu@intel.com>
@@ -77,8 +76,8 @@
* objc.dg/attributes/class-attribute-3.m: New.
* objc.dg/attributes/proto-attribute-4.m: New.
* obj-c++.dg/attributes/class-attribute-3.mm: New.
- * obj-c++.dg/attributes/proto-attribute-4.mm: New.
-
+ * obj-c++.dg/attributes/proto-attribute-4.mm: New.
+
2010-12-30 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/47060
@@ -128,7 +127,7 @@
* objc.dg/class-protocol-1.m: Updated.
* obj-c++.dg/attributes/proto-attribute-2.mm: Updated.
* obj-c++.dg/class-protocol-1.mm: Updated.
-
+
2010-12-28 Janus Weil <janus@gcc.gnu.org>
PR fortran/45827
@@ -169,7 +168,7 @@
* obj-c++.dg/gnu-api-2-objc.mm: Same.
* obj-c++.dg/gnu-api-2-object.mm: Same.
* obj-c++.dg/gnu-api-2-protocol.mm: Same.
-
+
2010-12-26 Nicola Pero <nicola.pero@meta-innovation.com>
* objc.dg/pr44509.m: New.
@@ -197,7 +196,7 @@
name as an existing class, and to test that the class pair is
created correctly.
* obj-c++.dg/gnu-api-2-objc.mm: Same change.
-
+
2010-12-26 Nicola Pero <nicola.pero@meta-innovation.com>
* objc.dg/special/special.exp: Added load-category-2 and
diff --git a/gcc/testsuite/c-c++-common/pr20000.c b/gcc/testsuite/c-c++-common/pr20000.c
index 1fcd17877e8..3c0fb884105 100644
--- a/gcc/testsuite/c-c++-common/pr20000.c
+++ b/gcc/testsuite/c-c++-common/pr20000.c
@@ -10,7 +10,7 @@ void h(void) __attribute__((noreturn));
int g(void) {
return 1; /* { dg-warning "function declared 'noreturn' has a 'return' statement" } */
-} /* { dg-warning "'noreturn' function does return" } */
+} /* { dg-warning "'noreturn' function does return" "" { target *-*-* } 12 } */
int g2(void) {
h();
@@ -25,7 +25,7 @@ int vg2(void); /* { dg-bogus ".noreturn. function returns non-void value" } */
int vg(void) {
return 1; /* { dg-warning "function declared 'noreturn' has a 'return' statement" "" { target c } 27 } */
-} /* { dg-warning "'noreturn' function does return" "" { target c } 28 } */
+} /* { dg-warning "'noreturn' function does return" "" { target c } 27 } */
int vg2(void) {
h();
diff --git a/gcc/testsuite/g++.dg/abi/mangle26.C b/gcc/testsuite/g++.dg/abi/mangle26.C
index 77b0eabdaa5..5d1609596b9 100644
--- a/gcc/testsuite/g++.dg/abi/mangle26.C
+++ b/gcc/testsuite/g++.dg/abi/mangle26.C
@@ -5,7 +5,7 @@
namespace std {
struct A {
- virtual void f () { }
+ A() { }
};
}
diff --git a/gcc/testsuite/g++.dg/abi/mangle39.C b/gcc/testsuite/g++.dg/abi/mangle39.C
index 30a08b0c32f..272385b6de0 100644
--- a/gcc/testsuite/g++.dg/abi/mangle39.C
+++ b/gcc/testsuite/g++.dg/abi/mangle39.C
@@ -1,7 +1,7 @@
// PR c++/42338
// { dg-options "-std=c++0x" }
// { dg-final { scan-assembler "_Z1fIPiEDTcmppfp_Li0EET_" } }
-// { dg-final { scan-assembler "_Z1gIiEvRK1AIT_EDTixfp_Li0EE" } }
+// { dg-final { scan-assembler "_Z1gIiEvRK1AIT_EDTixfL0p_Li0EE" } }
template<typename T>
auto f(T t) -> decltype(++t, 0)
diff --git a/gcc/testsuite/g++.dg/abi/mangle40.C b/gcc/testsuite/g++.dg/abi/mangle40.C
index 22e323f0d38..2b8300bff6f 100644
--- a/gcc/testsuite/g++.dg/abi/mangle40.C
+++ b/gcc/testsuite/g++.dg/abi/mangle40.C
@@ -1,6 +1,6 @@
// PR c++/12909
// { dg-do compile { target i?86-*-* x86_64-*-* } }
-// { dg-require-weak }
+// { dg-require-weak "" }
// { dg-require-alias "" }
// { dg-options "-mavx -Wabi -fabi-version=2" }
// { dg-final { scan-assembler "(weak|glob)\[^\n\]*_Z1fIDv4_fEvT_" } }
diff --git a/gcc/testsuite/g++.dg/abi/mangle45.C b/gcc/testsuite/g++.dg/abi/mangle45.C
new file mode 100644
index 00000000000..8e20831f116
--- /dev/null
+++ b/gcc/testsuite/g++.dg/abi/mangle45.C
@@ -0,0 +1,25 @@
+// Testcase for mangling of parameters used other than in a trailing return type
+// { dg-options -std=c++0x }
+
+template<class T> void f(T p, decltype(p)) { } // L = 1
+template<class T> void g(T p, decltype(p) (*)()) { } // L = 1
+// G++ incorrectly rejects these currently.
+// template<class T> void h(T p, auto (*)()->decltype(p)); // L = 1
+// template<class T> void i(T p, auto (*)(T q)->decltype(q)); // L = 0
+// template<class T> void j(T p, auto (*)(decltype(p))->T); // L = 2
+template<class T> void k(T p, int (*(*)(T* p))[sizeof(p)]) {} // L = 1
+
+int garg();
+int (*karg (int*))[sizeof(int)];
+int main()
+{
+ // { dg-final { scan-assembler "_Z1fIiEvT_DtfL0p_E" } }
+ f (1,0);
+ // { dg-final { scan-assembler "_Z1gIiEvT_PFDtfL0p_EvE" } }
+ g (1,garg);
+ // h (1,0);
+ // i (1,0);
+ // j (1,0);
+ // { dg-final { scan-assembler "_Z1kIiEvT_PFPAszfL0p__iPS0_E" } }
+ k (1,karg);
+}
diff --git a/gcc/testsuite/g++.dg/abi/packed1.C b/gcc/testsuite/g++.dg/abi/packed1.C
index 5bec67aff65..c903709d179 100644
--- a/gcc/testsuite/g++.dg/abi/packed1.C
+++ b/gcc/testsuite/g++.dg/abi/packed1.C
@@ -4,7 +4,7 @@
extern "C" void abort ();
-struct INNER { // { dg-warning "inefficient.*vptr" "" { target alpha*-*-* ia64-*-* hppa*-*-* mips-sgi-irix* sparc*-*-* sh*-*-* } }
+struct INNER { // { dg-warning "inefficient.*vptr" "" { target alpha*-*-* ia64-*-* hppa*-*-* mips-sgi-irix* sparc*-*-* spu-*-* sh*-*-* } }
virtual int foo() const { return 1; }
} __attribute__ ((packed));
diff --git a/gcc/testsuite/g++.dg/conversion/op4.C b/gcc/testsuite/g++.dg/conversion/op4.C
index 164bbcdc413..5f8214bc0c8 100644
--- a/gcc/testsuite/g++.dg/conversion/op4.C
+++ b/gcc/testsuite/g++.dg/conversion/op4.C
@@ -1,5 +1,5 @@
/* PR c++/26698 */
-/* { dg-do "compile" } */
+/* { dg-do compile } */
struct X {
int x;
diff --git a/gcc/testsuite/g++.dg/cpp0x/auto21.C b/gcc/testsuite/g++.dg/cpp0x/auto21.C
new file mode 100644
index 00000000000..1cbcac58d6a
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/auto21.C
@@ -0,0 +1,5 @@
+// Origin PR c++/47208
+// { dg-options "-std=c++0x" }
+
+constexpr auto list = { }; // { dg-error "deducing from brace-enclosed initializer list requires #include <initializer_list>" }
+static const int l = list.size();
diff --git a/gcc/testsuite/g++.dg/cpp0x/bracket1.C b/gcc/testsuite/g++.dg/cpp0x/bracket1.C
index cffb921edcf..dfb5bf4ea40 100644
--- a/gcc/testsuite/g++.dg/cpp0x/bracket1.C
+++ b/gcc/testsuite/g++.dg/cpp0x/bracket1.C
@@ -1,4 +1,4 @@
-// { dg-do "compile" }
+// { dg-do compile }
// { dg-options "-std=gnu++0x" }
template<typename T>
diff --git a/gcc/testsuite/g++.dg/cpp0x/bracket2.C b/gcc/testsuite/g++.dg/cpp0x/bracket2.C
index ccd466da26f..300015d01e6 100644
--- a/gcc/testsuite/g++.dg/cpp0x/bracket2.C
+++ b/gcc/testsuite/g++.dg/cpp0x/bracket2.C
@@ -1,4 +1,4 @@
-// { dg-do "compile" }
+// { dg-do compile }
// { dg-options "-std=gnu++0x" }
template<int i> class X { /* ... */ };
diff --git a/gcc/testsuite/g++.dg/cpp0x/bracket4.C b/gcc/testsuite/g++.dg/cpp0x/bracket4.C
index c0743fb7ff5..0e1985ceff9 100644
--- a/gcc/testsuite/g++.dg/cpp0x/bracket4.C
+++ b/gcc/testsuite/g++.dg/cpp0x/bracket4.C
@@ -1,4 +1,4 @@
-// { dg-do "compile" }
+// { dg-do compile }
// { dg-options "-std=c++0x" }
template<typename T>
struct vector {
diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-array-tparm.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-array-tparm.C
new file mode 100644
index 00000000000..c17090cc3b4
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-array-tparm.C
@@ -0,0 +1,5 @@
+// { dg-options -std=c++0x }
+
+template <const int I[2]> struct A { int ir[I[0]]; };
+extern constexpr int ar[2] = { 1, 2 };
+A<ar> a;
diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-ctor6.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-ctor6.C
new file mode 100644
index 00000000000..4f86f73a458
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-ctor6.C
@@ -0,0 +1,9 @@
+// PR c++/47041
+// { dg-options "-std=c++0x -fno-elide-constructors" }
+
+struct S
+{
+ int i;
+};
+
+S s = S ();
diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-ctor7.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-ctor7.C
new file mode 100644
index 00000000000..8338bf1f7ec
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-ctor7.C
@@ -0,0 +1,17 @@
+// PR c++/47199
+// { dg-options "-std=c++0x -fno-elide-constructors" }
+
+template < int > struct S
+{
+ constexpr S (int r):rr (r)
+ {
+ }
+ S (const S &) = default;
+ static constexpr S s ()
+ {
+ return -1;
+ }
+ int rr;
+};
+
+static const int d = S < 0 >::s ().rr;
diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-data1.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-data1.C
index 7d7a33d4296..0943fa4225d 100644
--- a/gcc/testsuite/g++.dg/cpp0x/constexpr-data1.C
+++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-data1.C
@@ -1,4 +1,4 @@
-// { dg-do "compile" }
+// { dg-do compile }
// { dg-options "-std=gnu++0x" }
// From N2235
diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-data2.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-data2.C
index 4d4ce780f36..598cae6a44f 100644
--- a/gcc/testsuite/g++.dg/cpp0x/constexpr-data2.C
+++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-data2.C
@@ -1,4 +1,4 @@
-// { dg-do "compile" }
+// { dg-do compile }
// { dg-options "-std=gnu++0x" }
template<typename _Tp, _Tp v>
diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-diag2.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-diag2.C
new file mode 100644
index 00000000000..c78416ec1a3
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-diag2.C
@@ -0,0 +1,5 @@
+// PR c++/47207
+// { dg-options -std=c++0x }
+
+constexpr int X (X); // { dg-error "not usable" }
+// { dg-message "own initializer" "" { target *-*-* } 4 }
diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-ex1.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-ex1.C
index 6b090a03f0f..4ab4677805f 100644
--- a/gcc/testsuite/g++.dg/cpp0x/constexpr-ex1.C
+++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-ex1.C
@@ -1,4 +1,4 @@
-// { dg-do "compile" }
+// { dg-do compile }
// { dg-options "-std=gnu++0x" }
// From N2235
diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-ex2.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-ex2.C
index 5896c20f80f..29e835c4bbb 100644
--- a/gcc/testsuite/g++.dg/cpp0x/constexpr-ex2.C
+++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-ex2.C
@@ -1,4 +1,4 @@
-// { dg-do "compile" }
+// { dg-do compile }
// { dg-options "-std=gnu++0x" }
// From N2235
diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-function1.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-function1.C
index afe964b420f..c708b040f80 100644
--- a/gcc/testsuite/g++.dg/cpp0x/constexpr-function1.C
+++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-function1.C
@@ -1,4 +1,4 @@
-// { dg-do "compile" }
+// { dg-do compile }
// { dg-options "-std=gnu++0x" }
// From N2235
diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-function2.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-function2.C
index a902e0e226c..5a2ec76e3a7 100644
--- a/gcc/testsuite/g++.dg/cpp0x/constexpr-function2.C
+++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-function2.C
@@ -1,4 +1,4 @@
-// { dg-do "compile" }
+// { dg-do compile }
// { dg-options "-std=gnu++0x" }
// From N2235
diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-function3.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-function3.C
index 07981fbf5df..e8ca7bc68c9 100644
--- a/gcc/testsuite/g++.dg/cpp0x/constexpr-function3.C
+++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-function3.C
@@ -1,4 +1,4 @@
-// { dg-do "compile" }
+// { dg-do compile }
// { dg-options "-std=gnu++0x" }
// From N2235
diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-object1.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-object1.C
index c635fd0d2a6..3af85095fa5 100644
--- a/gcc/testsuite/g++.dg/cpp0x/constexpr-object1.C
+++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-object1.C
@@ -1,4 +1,4 @@
-// { dg-do "compile" }
+// { dg-do compile }
// { dg-options "-std=gnu++0x" }
// From N2235
diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-object2.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-object2.C
index 3590bb8d744..a038970f6a4 100644
--- a/gcc/testsuite/g++.dg/cpp0x/constexpr-object2.C
+++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-object2.C
@@ -1,4 +1,4 @@
-// { dg-do "compile" }
+// { dg-do compile }
// { dg-options "-std=gnu++0x" }
constexpr int verysquare(int x) { return x * x; }
diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-stmtexpr.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-stmtexpr.C
new file mode 100644
index 00000000000..40e0c2d65d0
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-stmtexpr.C
@@ -0,0 +1,8 @@
+// PR c++/46977
+// { dg-options "-std=c++0x" }
+
+template < typename > void
+foo ()
+{
+ ({int i;}), 0;
+}
diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-synth1.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-synth1.C
new file mode 100644
index 00000000000..9830939806b
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-synth1.C
@@ -0,0 +1,14 @@
+// PR c++/46472
+// { dg-options -std=c++0x }
+
+template<class T> struct A {
+ T t;
+ constexpr A(){}
+};
+
+struct B
+{
+ A<int> a;
+};
+
+B b;
diff --git a/gcc/testsuite/g++.dg/cpp0x/decltype1.C b/gcc/testsuite/g++.dg/cpp0x/decltype1.C
index 447af540dc2..d1288e07d93 100644
--- a/gcc/testsuite/g++.dg/cpp0x/decltype1.C
+++ b/gcc/testsuite/g++.dg/cpp0x/decltype1.C
@@ -1,4 +1,4 @@
-// { dg-do "compile" }
+// { dg-do compile }
// { dg-options "-std=gnu++0x" }
template<typename T, typename U>
diff --git a/gcc/testsuite/g++.dg/cpp0x/decltype2.C b/gcc/testsuite/g++.dg/cpp0x/decltype2.C
index 65549b4e9b3..186d75b7250 100644
--- a/gcc/testsuite/g++.dg/cpp0x/decltype2.C
+++ b/gcc/testsuite/g++.dg/cpp0x/decltype2.C
@@ -1,4 +1,4 @@
-// { dg-do "compile" }
+// { dg-do compile }
// { dg-options "-std=gnu++0x" }
template<typename T, typename U>
diff --git a/gcc/testsuite/g++.dg/cpp0x/decltype3.C b/gcc/testsuite/g++.dg/cpp0x/decltype3.C
index 6958afd0071..aeacfae091c 100644
--- a/gcc/testsuite/g++.dg/cpp0x/decltype3.C
+++ b/gcc/testsuite/g++.dg/cpp0x/decltype3.C
@@ -1,4 +1,4 @@
-// { dg-do "compile" }
+// { dg-do compile }
// { dg-options "-std=gnu++0x" }
template<typename T, typename U>
diff --git a/gcc/testsuite/g++.dg/cpp0x/decltype4.C b/gcc/testsuite/g++.dg/cpp0x/decltype4.C
index 32fbc2b2ec2..cd715cb2892 100644
--- a/gcc/testsuite/g++.dg/cpp0x/decltype4.C
+++ b/gcc/testsuite/g++.dg/cpp0x/decltype4.C
@@ -1,4 +1,4 @@
-// { dg-do "compile" }
+// { dg-do compile }
// { dg-options "-std=gnu++0x" }
template<typename T, typename U>
diff --git a/gcc/testsuite/g++.dg/cpp0x/decltype5.C b/gcc/testsuite/g++.dg/cpp0x/decltype5.C
index 4e8e64b130a..1391539873f 100644
--- a/gcc/testsuite/g++.dg/cpp0x/decltype5.C
+++ b/gcc/testsuite/g++.dg/cpp0x/decltype5.C
@@ -1,4 +1,4 @@
-// { dg-do "compile" }
+// { dg-do compile }
// { dg-options "-std=gnu++0x" }
template<typename T, typename U>
diff --git a/gcc/testsuite/g++.dg/cpp0x/decltype6.C b/gcc/testsuite/g++.dg/cpp0x/decltype6.C
index c407c182c86..7aa8e1505ef 100644
--- a/gcc/testsuite/g++.dg/cpp0x/decltype6.C
+++ b/gcc/testsuite/g++.dg/cpp0x/decltype6.C
@@ -1,4 +1,4 @@
-// { dg-do "compile" }
+// { dg-do compile }
// { dg-options "-std=gnu++0x" }
template<typename T, typename U>
diff --git a/gcc/testsuite/g++.dg/cpp0x/enum8.C b/gcc/testsuite/g++.dg/cpp0x/enum8.C
new file mode 100644
index 00000000000..0075e2daa8b
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/enum8.C
@@ -0,0 +1,10 @@
+// PR c++/47704
+// { dg-do compile }
+// { dg-options "-std=c++0x" }
+
+void
+foo ()
+{
+ enum class E { A, B };
+ new E;
+}
diff --git a/gcc/testsuite/g++.dg/cpp0x/fntmpdefarg2.C b/gcc/testsuite/g++.dg/cpp0x/fntmpdefarg2.C
new file mode 100644
index 00000000000..12cc83659c5
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/fntmpdefarg2.C
@@ -0,0 +1,14 @@
+// PR c++/46831
+// { dg-options -std=c++0x }
+
+struct B { };
+struct D : B { };
+struct A {
+ template<typename T = void> operator D&();
+ operator long();
+};
+
+void f(long);
+void f(B&);
+
+int main() { f(A()); }
diff --git a/gcc/testsuite/g++.dg/cpp0x/implicit-trivial1.C b/gcc/testsuite/g++.dg/cpp0x/implicit-trivial1.C
new file mode 100644
index 00000000000..64084c14855
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/implicit-trivial1.C
@@ -0,0 +1,23 @@
+// PR c++/46807
+// { dg-options -std=c++0x }
+// In C++98/03, B::B(const B&) is trivial because A::A(const A&) is trivial,
+// even though doing overload resolution would mean calling the template
+// constructor. In C++0x, we do overload resolution to determine triviality.
+
+struct A
+{
+ A() {}
+private:
+ template <class T> A(T&); // { dg-error "private" }
+};
+
+struct B // { dg-error "implicitly deleted|this context" }
+{
+ mutable A a;
+};
+
+int main()
+{
+ B b;
+ B b2(b); // { dg-error "deleted" }
+}
diff --git a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-capture-const-ref.C b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-capture-const-ref.C
index f9cb2d53de2..704c24085d0 100644
--- a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-capture-const-ref.C
+++ b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-capture-const-ref.C
@@ -1,4 +1,4 @@
-// { dg-do "run" }
+// { dg-do run }
// { dg-options "-std=c++0x" }
#include <cassert>
diff --git a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-const.C b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-const.C
index 5bceb9227e0..5f6f0b3dcb8 100644
--- a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-const.C
+++ b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-const.C
@@ -1,4 +1,4 @@
-// { dg-do "run" }
+// { dg-do run }
// { dg-options "-std=c++0x" }
#include <cassert>
diff --git a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-conv.C b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-conv.C
index acd7da0b6d8..5409d5ca388 100644
--- a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-conv.C
+++ b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-conv.C
@@ -1,7 +1,7 @@
// Test for conversion from stateless lambda to function pointer.
// { dg-options -std=c++0x }
-// { dg-final { scan-assembler "weak\[^\n\r\]*_?_ZZ1fvENKUlvE_cvPFvvEEv" { target { ! { *-*-darwin* *-*-mingw* *-*-cygwin } } } } }
+// { dg-final { scan-assembler "weak\[^\n\r\]*_?_ZZ1fvENKUlvE_cvPFvvEEv" { target { ! { *-*-darwin* *-*-mingw* *-*-cygwin *-*-hpux10* } } } } }
inline void f()
{
diff --git a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-copy-default.C b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-copy-default.C
index 4d4faea470b..239a99cbf96 100644
--- a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-copy-default.C
+++ b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-copy-default.C
@@ -1,4 +1,4 @@
-// { dg-do "run" }
+// { dg-do run }
// { dg-options "-std=c++0x" }
int main() {
diff --git a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-copy.C b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-copy.C
index d57a01d43e3..7356872e1ab 100644
--- a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-copy.C
+++ b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-copy.C
@@ -1,4 +1,4 @@
-// { dg-do "run" }
+// { dg-do run }
// { dg-options "-std=c++0x" }
int main() {
diff --git a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-deduce.C b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-deduce.C
index 0b4f92ec7e8..cc5cc540217 100644
--- a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-deduce.C
+++ b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-deduce.C
@@ -1,4 +1,4 @@
-// { dg-do "run" }
+// { dg-do run }
// { dg-options "-std=c++0x" }
#include <cassert>
diff --git a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-ice3.C b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-ice3.C
new file mode 100644
index 00000000000..8ff36478d53
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-ice3.C
@@ -0,0 +1,23 @@
+// PR c++/47795
+// { dg-options "-std=c++0x" }
+
+class Klass
+{
+ unsigned int local;
+public:
+ bool dostuff();
+};
+
+bool Klass::dostuff()
+{
+ auto f = []() -> bool {
+ if (local & 1) { return true; } // { dg-error "not captured" }
+ return false;
+ };
+}
+
+int main()
+{
+ Klass c;
+ return 0;
+}
diff --git a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-ice4.C b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-ice4.C
new file mode 100644
index 00000000000..77c773bbdb3
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-ice4.C
@@ -0,0 +1,14 @@
+// PR c++/47242
+// { dg-options "-std=c++0x" }
+
+template < typename > void
+bar ()
+{
+ [i]{}; // { dg-error "declared|invalid" }
+}
+
+void
+foo ()
+{
+ bar<int>();
+}
diff --git a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-in-class.C b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-in-class.C
index 54015fd72f7..33f4301e44f 100644
--- a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-in-class.C
+++ b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-in-class.C
@@ -1,4 +1,4 @@
-// { dg-do "run" }
+// { dg-do run }
// { dg-options "-std=c++0x" }
#include <cassert>
diff --git a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-mixed.C b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-mixed.C
index 14c4de9f912..ed0565fa9ce 100644
--- a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-mixed.C
+++ b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-mixed.C
@@ -1,4 +1,4 @@
-// { dg-do "run" }
+// { dg-do run }
// { dg-options "-std=c++0x" }
#include <cassert>
diff --git a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-mutable.C b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-mutable.C
index 7065dfb3f21..73a4d1bac74 100644
--- a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-mutable.C
+++ b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-mutable.C
@@ -1,4 +1,4 @@
-// { dg-do "run" }
+// { dg-do run }
// { dg-options "-std=c++0x" }
#include <cassert>
diff --git a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-nested.C b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-nested.C
index 538775a0888..feb0cde597d 100644
--- a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-nested.C
+++ b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-nested.C
@@ -1,4 +1,4 @@
-// { dg-do "run" }
+// { dg-do run }
// { dg-options "-std=c++0x" }
#include <cassert>
diff --git a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-non-const.C b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-non-const.C
index 9c2b1195af3..b6489de4b44 100644
--- a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-non-const.C
+++ b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-non-const.C
@@ -1,4 +1,4 @@
-// { dg-do "run" }
+// { dg-do run }
// { dg-options "-std=c++0x" }
#include <cassert>
diff --git a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-nop.C b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-nop.C
index b366ba1b8fa..74149b23122 100644
--- a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-nop.C
+++ b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-nop.C
@@ -1,4 +1,4 @@
-// { dg-do "run" }
+// { dg-do run }
// { dg-options "-std=c++0x" }
#include <cassert>
diff --git a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-pass.C b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-pass.C
index a42de294b6e..9dd64484a45 100644
--- a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-pass.C
+++ b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-pass.C
@@ -1,4 +1,4 @@
-// { dg-do "run" }
+// { dg-do run }
// { dg-options "-std=c++0x" }
#include <cassert>
diff --git a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-recursive.C b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-recursive.C
index c3c8008d926..1a12eab312f 100644
--- a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-recursive.C
+++ b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-recursive.C
@@ -1,4 +1,4 @@
-// { dg-do "run" }
+// { dg-do run }
// { dg-options "-std=c++0x" }
//#include <iostream>
diff --git a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-ref-default.C b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-ref-default.C
index 342e0aeb2cf..40376f43db3 100644
--- a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-ref-default.C
+++ b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-ref-default.C
@@ -1,4 +1,4 @@
-// { dg-do "run" }
+// { dg-do run }
// { dg-options "-std=c++0x" }
#include <cassert>
diff --git a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-ref.C b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-ref.C
index 34ba263b2e5..a5ee7b4c3c8 100644
--- a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-ref.C
+++ b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-ref.C
@@ -1,4 +1,4 @@
-// { dg-do "run" }
+// { dg-do run }
// { dg-options "-std=c++0x" }
#include <cassert>
diff --git a/gcc/testsuite/g++.dg/cpp0x/pr38646.C b/gcc/testsuite/g++.dg/cpp0x/pr38646.C
index 3ef74cd4866..f15fc8c29bb 100644
--- a/gcc/testsuite/g++.dg/cpp0x/pr38646.C
+++ b/gcc/testsuite/g++.dg/cpp0x/pr38646.C
@@ -1,5 +1,5 @@
/* PR c++/38646 */
-/* { dg-do "compile" } */
+/* { dg-do compile } */
/* { dg-options "-std=c++0x" } */
template<int...> struct A;
diff --git a/gcc/testsuite/g++.dg/cpp0x/pr39639.C b/gcc/testsuite/g++.dg/cpp0x/pr39639.C
index abd3bcf086a..4fd8b56fd30 100644
--- a/gcc/testsuite/g++.dg/cpp0x/pr39639.C
+++ b/gcc/testsuite/g++.dg/cpp0x/pr39639.C
@@ -1,7 +1,7 @@
// Contributed by Dodji Seketeli <dodji@redhat.com>
// Origin: PR c++/39639
+// { dg-do compile }
// { dg-options "-std=c++0x" }
-// { dg-do "compile" }
template <class... Types>
struct S
diff --git a/gcc/testsuite/g++.dg/cpp0x/pr47416.C b/gcc/testsuite/g++.dg/cpp0x/pr47416.C
new file mode 100644
index 00000000000..a11368a50f0
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/pr47416.C
@@ -0,0 +1,225 @@
+// PR c++/47416
+// { dg-do compile }
+// { dg-options "-std=c++0x" }
+
+namespace std
+{
+ template < typename _Tp, _Tp __v > struct integral_constant
+ {
+ static const _Tp value = __v;
+ };
+ typedef integral_constant < bool, false > false_type;
+ template < typename > struct is_array:false_type
+ {
+ };
+ template < typename > struct is_function:false_type
+ {
+ };
+ template < typename _Tp > struct remove_const
+ {
+ typedef _Tp type;
+ };
+ template < typename _Tp > struct remove_volatile
+ {
+ typedef _Tp type;
+ };
+ template < typename _Tp > struct remove_cv
+ {
+ typedef typename remove_const < typename remove_volatile <
+ _Tp >::type >::type type;
+ };
+ template < typename > struct remove_reference
+ {
+ };
+ template < typename _Tp > struct remove_reference <_Tp & >
+ {
+ typedef _Tp type;
+ };
+ template < typename _Up, bool = is_array < _Up >::value, bool =
+ is_function < _Up >::value > struct __decay_selector;
+ template < typename _Up > struct __decay_selector <_Up, false, false >
+ {
+ typedef typename remove_cv < _Up >::type __type;
+ };
+ template < typename _Tp > class decay
+ {
+ typedef typename remove_reference < _Tp >::type __remove_type;
+ public:typedef typename __decay_selector <
+ __remove_type >::__type type;
+ };
+ template < typename _Tp > struct __strip_reference_wrapper
+ {
+ typedef _Tp __type;
+ };
+ template < typename _Tp > struct __decay_and_strip
+ {
+ typedef typename __strip_reference_wrapper < typename decay <
+ _Tp >::type >::__type __type;
+ };
+ template < typename _Tp > _Tp forward (typename remove_reference <
+ _Tp >::type &)
+ {
+ }
+ template < class _T1, class _T2 > struct pair
+ {
+ _T1 first;
+ _T2 second;
+ constexpr pair (_T1, _T2 &):first (), second (__b) // { dg-error "was not declared in this scope" }
+ {
+ }
+ };
+ template < class _T1,
+ class _T2 > pair < typename __decay_and_strip < _T1 >::__type,
+ typename __decay_and_strip < _T2 >::__type > make_pair (_T1 && __x, _T2
+ && __y)
+ {
+ typedef typename __decay_and_strip < _T1 >::__type __ds_type1;
+ typedef typename __decay_and_strip < _T2 >::__type __ds_type2;
+ typedef pair < __ds_type1, __ds_type2 > __pair_type;
+ __pair_type (forward < _T1 > (__x), std::forward < _T2 > (__y));
+ }
+}
+
+typedef long size_t;
+namespace std
+{
+ template < typename > class allocator;
+ template < class > struct char_traits;
+ template < typename _CharT, typename = char_traits < _CharT >, typename =
+ allocator < _CharT > >class basic_string;
+ typedef basic_string < char >string;
+}
+namespace __gnu_cxx
+{
+ template < bool > class __pool;
+ template < template < bool > class, bool > struct __common_pool
+ {
+ };
+ template < template < bool > class, bool > struct __common_pool_base;
+ template < template < bool > class _PoolTp >
+ struct __common_pool_base <_PoolTp, true >:__common_pool < _PoolTp, true >
+ {
+ };
+ template < template < bool > class _PoolTp,
+ bool _Thread > struct __common_pool_policy:__common_pool_base < _PoolTp,
+ _Thread >
+ {
+ template < typename, template < bool > class _PoolTp1 =
+ _PoolTp, bool _Thread1 = _Thread > struct _M_rebind
+ {
+ typedef __common_pool_policy < _PoolTp1, _Thread1 > other;
+ };
+ };
+ template < typename _Tp > class __mt_alloc_base
+ {
+ };
+template < typename _Tp, typename _Poolp = __common_pool_policy < __pool, true > >class __mt_alloc:public __mt_alloc_base <
+ _Tp
+ >
+ {
+ public:size_t size_type;
+ typedef _Tp value_type;
+ template < typename _Tp1, typename _Poolp1 = _Poolp > struct rebind
+ {
+ typedef typename _Poolp1::template _M_rebind < _Tp1 >::other pol_type;
+ typedef __mt_alloc < _Tp1, pol_type > other;
+ };
+ };
+}
+
+namespace std
+{
+ template < typename _Tp > class allocator:public __gnu_cxx::__mt_alloc <
+ _Tp >
+ {
+ };
+ template < typename, typename > struct unary_function
+ {
+ };
+ template < typename, typename, typename > struct binary_function
+ {
+ };
+ template < typename _Tp > struct equal_to:binary_function < _Tp, _Tp, bool >
+ {
+ };
+}
+
+namespace boost
+{
+ template < class > struct hash;
+ template < class K, class T, class = hash < K >, class =
+ std::equal_to < K >, class =
+ std::allocator < std::pair < const K, T > >>class unordered_map;
+ template < >struct hash <std::string >:std::unary_function < std::string,
+ size_t >
+ {
+ };
+ namespace unordered_detail
+ {
+ template < class Alloc, class T > struct rebind_wrap
+ {
+ typedef typename Alloc::template rebind < T >::other type;
+ };
+ }
+ namespace unordered_detail
+ {
+ size_t default_bucket_count;
+ template < class, class > struct map_extractor;
+ struct ungrouped
+ {
+ };
+ template < class T > class hash_table:T::buckets, T::buffered_functions
+ {
+ };
+ template < class, class, class H, class P, class A, class, class G > struct types
+ {
+ typedef H hasher;
+ typedef P key_equal;
+ typedef A value_allocator;
+ };
+ template < class T > class hash_unique_table:T
+ {
+ public:typedef typename T::hasher hasher;
+ typedef typename T::key_equal key_equal;
+ typedef typename T::value_allocator value_allocator;
+ typedef typename T::table table;
+ hash_unique_table (size_t n, hasher, key_equal,
+ value_allocator & a):table (n, a) // { dg-error "is not a direct base" }
+ {
+ }
+ };
+ template < class K, class H, class P, class A > struct map:types < K,
+ typename A::value_type, H, P, A, map_extractor < K,
+ typename A::value_type >, ungrouped >
+ {
+ typedef hash_unique_table < map < K, H, P, A > >impl;
+ typedef hash_table < map < K, H, P, A > >table;
+ };
+ }
+ template < class K, class T, class H, class P, class A > class unordered_map
+ {
+ typedef std::pair < const K, T > value_type;
+ typedef H hasher;
+ typedef P key_equal;
+ typedef A allocator_type;
+ typedef typename unordered_detail::rebind_wrap < allocator_type,
+ value_type >::type value_allocator;
+ typedef boost::unordered_detail::map < K, H, P, value_allocator > types;
+ typedef typename types::impl table;
+ typedef size_t size_type;
+ private:table table_;
+ public: unordered_map (size_type n = boost::unordered_detail::default_bucket_count,
+ hasher hf = hasher (), key_equal eql = key_equal (),
+ allocator_type a = allocator_type ()):table_ (n, hf, eql, a) // { dg-message "instantiated" }
+ {
+ }
+ };
+};
+
+void
+foo (const int &a)
+{
+ typedef boost::unordered_map < std::string, int >Name2Port;
+ Name2Port b; // { dg-message "instantiated" }
+ std::make_pair (a, b);
+}
diff --git a/gcc/testsuite/g++.dg/cpp0x/pr47476.C b/gcc/testsuite/g++.dg/cpp0x/pr47476.C
new file mode 100644
index 00000000000..1f6f09cccc6
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/pr47476.C
@@ -0,0 +1,10 @@
+// PR c++/47476
+// { dg-do compile }
+// { dg-options "-std=c++0x" }
+
+int
+foo (int a, int b)
+{
+ const bool c ((a != 0) == (b != 26));
+ return c;
+}
diff --git a/gcc/testsuite/g++.dg/cpp0x/range-for10.C b/gcc/testsuite/g++.dg/cpp0x/range-for10.C
new file mode 100644
index 00000000000..662074890d9
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/range-for10.C
@@ -0,0 +1,18 @@
+// PR c++/47388
+// { dg-do compile }
+// { dg-options "-fno-for-scope -std=c++0x" }
+
+template <int>
+void
+foo ()
+{
+ int a[] = { 1, 2, 3, 4 };
+ for (int i : a)
+ ;
+}
+
+void
+bar ()
+{
+ foo <0> ();
+}
diff --git a/gcc/testsuite/g++.dg/cpp0x/regress/README b/gcc/testsuite/g++.dg/cpp0x/regress/README
new file mode 100644
index 00000000000..5c3402e7485
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/regress/README
@@ -0,0 +1,3 @@
+This directory contains tests that were passing in C++98 mode but failing
+in C++0x mode; it should be replaced by an improvement to the test harness
+to run all tests in both modes.
diff --git a/gcc/testsuite/g++.dg/cpp0x/regress/abi-empty7.C b/gcc/testsuite/g++.dg/cpp0x/regress/abi-empty7.C
new file mode 100644
index 00000000000..adc71278d9d
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/regress/abi-empty7.C
@@ -0,0 +1,20 @@
+// Copy of abi/empty7.C.
+// { dg-do run { target i?86-*-* x86_64-*-* } }
+// { dg-require-effective-target ilp32 }
+// { dg-options "-fabi-version=0 -std=c++0x" }
+
+struct S1 {};
+struct S2 { virtual void f () {} S1 s1[4]; };
+struct S3 : virtual public S2 {};
+struct S4 : virtual public S2 { int i; };
+struct S5 : public S3, virtual public S4 {};
+struct S6 { S5 s5; };
+struct S7 { S1 s1[5]; };
+struct S8 : public S1, public S6, virtual public S7 { };
+
+S8 s8;
+
+int main () {
+ if ((char *)(S7 *)&s8 - (char *)&s8 != 24)
+ return 1;
+}
diff --git a/gcc/testsuite/g++.dg/cpp0x/regress/debug-debug7.C b/gcc/testsuite/g++.dg/cpp0x/regress/debug-debug7.C
new file mode 100644
index 00000000000..8ee8824719d
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/regress/debug-debug7.C
@@ -0,0 +1,19 @@
+// { dg-do compile }
+// { dg-options -std=c++0x }
+
+void f (int);
+
+int
+main() {
+
+ int a = 4;
+ int b = 5;
+ int (*x)[b] = new int[a][b]; // { dg-error "" }
+
+ x[2][1] = 7;
+
+ for (int i = 0; i < a; ++i)
+ for (int j = 0; j < b; ++j)
+ f (x[i][j]);
+ delete [] x;
+}
diff --git a/gcc/testsuite/g++.dg/cpp0x/regress/enum1.C b/gcc/testsuite/g++.dg/cpp0x/regress/enum1.C
new file mode 100644
index 00000000000..6e29f9ea923
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/regress/enum1.C
@@ -0,0 +1,8 @@
+// PR c++/47482
+// { dg-options -std=c++0x }
+
+template<class>
+struct K
+{
+ enum { A = sizeof"A", B = +A };
+};
diff --git a/gcc/testsuite/g++.dg/cpp0x/regress/ext-cond1.C b/gcc/testsuite/g++.dg/cpp0x/regress/ext-cond1.C
new file mode 100644
index 00000000000..dc9814ebd36
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/regress/ext-cond1.C
@@ -0,0 +1,4 @@
+// PR c++/12515
+// { dg-do compile }
+// { dg-options "-std=gnu++0x" }
+template<int> void foo() { 0 ?: 0; }
diff --git a/gcc/testsuite/g++.dg/cpp0x/regress/ext-label10.C b/gcc/testsuite/g++.dg/cpp0x/regress/ext-label10.C
new file mode 100644
index 00000000000..652d94af036
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/regress/ext-label10.C
@@ -0,0 +1,17 @@
+// PR c++/33836
+// { dg-do compile }
+// { dg-options "-std=gnu++0x" }
+
+template<int N> struct A
+{
+ enum { M = && N }; // { dg-error "referenced outside|cannot appear in|not an integer constant" }
+};
+
+A<0> a;
+
+void foo ()
+{
+ __label__ P;
+ enum { O = && P }; // { dg-error "cannot appear in|not an integer constant" }
+ P:;
+}
diff --git a/gcc/testsuite/g++.dg/cpp0x/regress/no-elide1.C b/gcc/testsuite/g++.dg/cpp0x/regress/no-elide1.C
new file mode 100644
index 00000000000..50df9501635
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/regress/no-elide1.C
@@ -0,0 +1,14 @@
+// PR c++/47503
+// { dg-options "-std=c++0x -fno-elide-constructors" }
+
+struct A
+{
+ int i;
+ A ();
+};
+
+struct B
+{
+ A a;
+ B (A &aa) : a (aa) { }
+};
diff --git a/gcc/testsuite/g++.dg/cpp0x/regress/parse-ambig5.C b/gcc/testsuite/g++.dg/cpp0x/regress/parse-ambig5.C
new file mode 100644
index 00000000000..9be2f9258fa
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/regress/parse-ambig5.C
@@ -0,0 +1,8 @@
+// PR c++/41786
+// { dg-options -std=c++0x }
+
+struct A { A(int, char const*); };
+int main() {
+ int i = 0, *b = &i;
+ A a(int(b[i]), "hello");
+}
diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-regress1.C b/gcc/testsuite/g++.dg/cpp0x/regress/regress1.C
index a6fe3999c98..a6fe3999c98 100644
--- a/gcc/testsuite/g++.dg/cpp0x/constexpr-regress1.C
+++ b/gcc/testsuite/g++.dg/cpp0x/regress/regress1.C
diff --git a/gcc/testsuite/g++.dg/cpp0x/regress/regress2.C b/gcc/testsuite/g++.dg/cpp0x/regress/regress2.C
new file mode 100644
index 00000000000..470ee1c4c80
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/regress/regress2.C
@@ -0,0 +1,13 @@
+// PR c++/46552
+// { dg-options -std=c++0x }
+
+struct S
+{
+ int x;
+};
+
+template < typename >
+void f( void )
+{
+ &S::x;
+}
diff --git a/gcc/testsuite/g++.dg/cpp0x/regress/regress3.C b/gcc/testsuite/g++.dg/cpp0x/regress/regress3.C
new file mode 100644
index 00000000000..ffbb97f6b85
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/regress/regress3.C
@@ -0,0 +1,13 @@
+// PR c++/47511
+// { dg-options -std=c++0x }
+
+namespace N {
+ template <typename T> bool g( T ) {
+ return true;
+ }
+ struct A { };
+}
+template <class T> void f(const T&) {
+ N::A x;
+ g(x) ;
+}
diff --git a/gcc/testsuite/g++.dg/cpp0x/regress/template-function1.C b/gcc/testsuite/g++.dg/cpp0x/regress/template-function1.C
new file mode 100644
index 00000000000..028669e511e
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/regress/template-function1.C
@@ -0,0 +1,28 @@
+// PR c++/38647
+// { dg-do compile }
+// { dg-options "-std=c++0x" }
+
+template<const char *, int> struct A {};
+const char func[] = "abc";
+template<int N> struct A<func, N> {}; // { dg-error "cannot appear|is invalid|not a valid|not declared constexpr" }
+
+char a1[1];
+A<a1, 0> a;
+
+template<const char *, int> struct B {};
+template<int N> struct B<__FUNCTION__, N> {}; // { dg-error "cannot appear|is invalid|is not a valid|not declared constexpr" }
+
+char b1[1];
+B<b1, 0> b;
+
+template<const char *, int> struct C {};
+template<int N> struct C<__PRETTY_FUNCTION__, N> {}; // { dg-error "cannot appear|is invalid|is not a valid|not declared constexpr" }
+
+char c1[1];
+C<c1, 0> c;
+
+template<const char *, int> struct D {};
+template<int N> struct D<__func__, N> {}; // { dg-error "cannot appear|is invalid|is not a valid|function scope|not declared constexpr" }
+
+char d1[1];
+D<d1, 0> d;
diff --git a/gcc/testsuite/g++.dg/cpp0x/rvo.C b/gcc/testsuite/g++.dg/cpp0x/rvo.C
index b52ce7495db..d4459af64d3 100644
--- a/gcc/testsuite/g++.dg/cpp0x/rvo.C
+++ b/gcc/testsuite/g++.dg/cpp0x/rvo.C
@@ -1,4 +1,4 @@
-// { dg-do "run" }
+// { dg-do run }
// { dg-options "-std=c++0x" }
// Contributed by Sylvain Pion
static int rvalue_constructions = 0;
diff --git a/gcc/testsuite/g++.dg/cpp0x/trailing1.C b/gcc/testsuite/g++.dg/cpp0x/trailing1.C
index 11e73d2e716..fcf65e3b01c 100644
--- a/gcc/testsuite/g++.dg/cpp0x/trailing1.C
+++ b/gcc/testsuite/g++.dg/cpp0x/trailing1.C
@@ -78,7 +78,6 @@ auto k(T t, U u, V v) -> decltype (t.U::template B<V>::MEM)
return t.U::template B<V>::MEM;
}
-// For these two examples we can elide the 'decltype' and just mangle the type.
template <class T>
auto l(T t) -> decltype (t)
{
@@ -111,8 +110,8 @@ int main()
h(a,1.0);
// { dg-final { scan-assembler "_Z1kI1C1AIiE1DEDtdtfp_srNT0_1BIT1_EE3MEMET_S4_S6_" } }
k( C(), A<int>(), D() );
- // { dg-final { scan-assembler "_Z1lIiET_S0_" } }
+ // { dg-final { scan-assembler "_Z1lIiEDtfp_ET_" } }
l(1);
- // { dg-final { scan-assembler "_Z1mIiLi1EET_S0_" } }
+ // { dg-final { scan-assembler "_Z1mIiLi1EEDtT0_ET_" } }
m<int,1>(1);
}
diff --git a/gcc/testsuite/g++.dg/cpp0x/variadic-bind.C b/gcc/testsuite/g++.dg/cpp0x/variadic-bind.C
index b9f9f678c57..abe445d4341 100644
--- a/gcc/testsuite/g++.dg/cpp0x/variadic-bind.C
+++ b/gcc/testsuite/g++.dg/cpp0x/variadic-bind.C
@@ -1,5 +1,5 @@
+// { dg-do run }
// { dg-options "-std=gnu++0x" }
-// { dg-do "run" }
// A basic implementation of TR1's bind using variadic teplates
// Contributed by Douglas Gregor <doug.gregor@gmail.com>
#include <cassert>
diff --git a/gcc/testsuite/g++.dg/cpp0x/variadic-crash2.C b/gcc/testsuite/g++.dg/cpp0x/variadic-crash2.C
index d1913b92d45..f46b8e534e4 100644
--- a/gcc/testsuite/g++.dg/cpp0x/variadic-crash2.C
+++ b/gcc/testsuite/g++.dg/cpp0x/variadic-crash2.C
@@ -1,7 +1,7 @@
// Contributed by Dodji Seketeli <dodji@redhat.com>
// Origin: PR c++/39637
+// { dg-do compile }
// { dg-options "-std=gnu++0x" }
-// { dg-do "compile" }
template<class... Types>
void
diff --git a/gcc/testsuite/g++.dg/cpp0x/variadic-function.C b/gcc/testsuite/g++.dg/cpp0x/variadic-function.C
index 0373efde7c0..eeb137705f2 100644
--- a/gcc/testsuite/g++.dg/cpp0x/variadic-function.C
+++ b/gcc/testsuite/g++.dg/cpp0x/variadic-function.C
@@ -1,5 +1,5 @@
+// { dg-do run }
// { dg-options "-std=gnu++0x" }
-// { dg-do "run" }
// A basic implementation of TR1's function using variadic teplates
// Contributed by Douglas Gregor <doug.gregor@gmail.com>
#include <cassert>
diff --git a/gcc/testsuite/g++.dg/cpp0x/variadic-mem_fn.C b/gcc/testsuite/g++.dg/cpp0x/variadic-mem_fn.C
index 6e29d3b3d95..51c5c79ef9f 100644
--- a/gcc/testsuite/g++.dg/cpp0x/variadic-mem_fn.C
+++ b/gcc/testsuite/g++.dg/cpp0x/variadic-mem_fn.C
@@ -1,5 +1,5 @@
// { dg-options "-std=gnu++0x" }
-// { dg-do "run" }
+// { dg-do run }
// A basic implementation of TR1's mem_fn using variadic teplates
// Contributed by Douglas Gregor <doug.gregor@gmail.com>
#include <cassert>
diff --git a/gcc/testsuite/g++.dg/cpp0x/variadic-new.C b/gcc/testsuite/g++.dg/cpp0x/variadic-new.C
index 869052774cf..5bbb9c81b0e 100644
--- a/gcc/testsuite/g++.dg/cpp0x/variadic-new.C
+++ b/gcc/testsuite/g++.dg/cpp0x/variadic-new.C
@@ -1,4 +1,4 @@
-// { dg-do "run" }
+// { dg-do run }
// { dg-options "-std=c++0x" }
// Contributed by Peter Dimov
// PR c++/32597
diff --git a/gcc/testsuite/g++.dg/cpp0x/variadic-new2.C b/gcc/testsuite/g++.dg/cpp0x/variadic-new2.C
index a40f96e110b..81d333398bd 100644
--- a/gcc/testsuite/g++.dg/cpp0x/variadic-new2.C
+++ b/gcc/testsuite/g++.dg/cpp0x/variadic-new2.C
@@ -1,4 +1,4 @@
-// { dg-do "run" }
+// { dg-do run }
// { dg-options "-std=c++0x" }
// PR c++/32597
#include <assert.h>
diff --git a/gcc/testsuite/g++.dg/cpp0x/variadic-tuple.C b/gcc/testsuite/g++.dg/cpp0x/variadic-tuple.C
index 2c298a132b4..11ce14af28c 100644
--- a/gcc/testsuite/g++.dg/cpp0x/variadic-tuple.C
+++ b/gcc/testsuite/g++.dg/cpp0x/variadic-tuple.C
@@ -1,5 +1,5 @@
+// { dg-do run }
// { dg-options "-std=gnu++0x" }
-// { dg-do "run" }
// An implementation of TR1's <tuple> using variadic teplates
// Contributed by Douglas Gregor <doug.gregor@gmail.com>
diff --git a/gcc/testsuite/g++.dg/cpp0x/variadic106.C b/gcc/testsuite/g++.dg/cpp0x/variadic106.C
new file mode 100644
index 00000000000..80ec0844fbf
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/variadic106.C
@@ -0,0 +1,22 @@
+// Origin: PR c++/47326
+// { dg-options "-std=c++0x" }
+// { dg-do compile }
+
+template <int _N>
+struct A
+{
+ typedef int value_type;
+};
+
+template <typename... _ARGS>
+auto
+f (_ARGS... args) -> typename A<sizeof...(args)>::value_type
+{
+ return 12;
+}
+
+int
+main()
+{
+ f(1,2);
+}
diff --git a/gcc/testsuite/g++.dg/cpp0x/variadic20.C b/gcc/testsuite/g++.dg/cpp0x/variadic20.C
index 06204c75dd5..7f2446e5585 100644
--- a/gcc/testsuite/g++.dg/cpp0x/variadic20.C
+++ b/gcc/testsuite/g++.dg/cpp0x/variadic20.C
@@ -37,9 +37,9 @@ struct metatuple<First, Second, Metafunctions...> { // { dg-error "struct" }
int a0[metatuple<>::value == 0? 1 : -1];
int a1[metatuple<add_pointer>::value == 1? 1 : -1];
-int a2a[metatuple<add_pointer, add_pointer>::value == 2? 1 : -1]; // { dg-error "ambiguous" }
+int a2a[metatuple<add_pointer, add_pointer>::value == 2? 1 : -1]; // { dg-error "ambiguous|array bound" }
int a2b[metatuple<add_reference, add_reference>::value == 2? 1 : -1];
-int a3[metatuple<add_pointer, add_reference>::value == 3? 1 : -1]; // { dg-error "ambiguous" }
+int a3[metatuple<add_pointer, add_reference>::value == 3? 1 : -1]; // { dg-error "ambiguous|array bound" }
int a4[metatuple<add_reference>::value == 4? 1 : -1];
int a5[metatuple<add_reference, add_pointer>::value == 5? 1 : -1];
diff --git a/gcc/testsuite/g++.dg/cpp0x/variadic68.C b/gcc/testsuite/g++.dg/cpp0x/variadic68.C
index 53d8f2d6d0c..07cf8e3896a 100644
--- a/gcc/testsuite/g++.dg/cpp0x/variadic68.C
+++ b/gcc/testsuite/g++.dg/cpp0x/variadic68.C
@@ -1,4 +1,4 @@
-// { dg-do "run" }
+// { dg-do run }
// { dg-options "-std=gnu++0x" }
extern "C" void abort();
diff --git a/gcc/testsuite/g++.dg/cpp0x/variadic70.C b/gcc/testsuite/g++.dg/cpp0x/variadic70.C
index 0bc8e824cd4..15bed461dc7 100644
--- a/gcc/testsuite/g++.dg/cpp0x/variadic70.C
+++ b/gcc/testsuite/g++.dg/cpp0x/variadic70.C
@@ -1,4 +1,4 @@
-// { dg-do "run" }
+// { dg-do run }
// { dg-options "-std=gnu++0x" }
template <typename T, T... Args> struct bomb;
diff --git a/gcc/testsuite/g++.dg/cpp0x/variadic73.C b/gcc/testsuite/g++.dg/cpp0x/variadic73.C
index 7bff85b5037..05925e7aa57 100644
--- a/gcc/testsuite/g++.dg/cpp0x/variadic73.C
+++ b/gcc/testsuite/g++.dg/cpp0x/variadic73.C
@@ -1,4 +1,4 @@
-// { dg-do "run" }
+// { dg-do run }
// { dg-options "-std=gnu++0x" }
struct A {};
struct B {};
diff --git a/gcc/testsuite/g++.dg/cpp0x/vt-40092.C b/gcc/testsuite/g++.dg/cpp0x/vt-40092.C
index 063ed7e16eb..ecb69806130 100644
--- a/gcc/testsuite/g++.dg/cpp0x/vt-40092.C
+++ b/gcc/testsuite/g++.dg/cpp0x/vt-40092.C
@@ -1,4 +1,4 @@
-// { dg-do "compile" }
+// { dg-do compile }
// { dg-options "-std=c++0x" }
template <typename... Types> struct package {};
diff --git a/gcc/testsuite/g++.dg/debug/pr46583.C b/gcc/testsuite/g++.dg/debug/pr46583.C
new file mode 100644
index 00000000000..a4e94238ece
--- /dev/null
+++ b/gcc/testsuite/g++.dg/debug/pr46583.C
@@ -0,0 +1,40 @@
+// PR debug/46583
+// { dg-do compile }
+// { dg-options "-O -fno-inline -fipa-cp -fipa-cp-clone -fcompare-debug" }
+
+template < typename = unsigned long >struct A
+{
+ unsigned long elems[3];
+ unsigned long *begin ()
+ {
+ return 0;
+ }
+};
+
+void
+bar (unsigned long *a1, unsigned long, unsigned long *a3, unsigned const &)
+{
+ *a3 = *a1;
+}
+
+A < >operatorM (A < >a1, unsigned long a2)
+{
+ typedef A < >G;
+ G a3;
+ bar (a1.begin (), a2, a3.begin (), 0);
+ return a3;
+}
+
+struct B
+{
+ B (A < >m):n (operatorM (m, 1))
+ {
+ }
+ A < >n;
+};
+
+void
+foo ()
+{
+ B (A < >());
+}
diff --git a/gcc/testsuite/g++.dg/debug/pr47106.C b/gcc/testsuite/g++.dg/debug/pr47106.C
new file mode 100644
index 00000000000..3a8100f8c2c
--- /dev/null
+++ b/gcc/testsuite/g++.dg/debug/pr47106.C
@@ -0,0 +1,38 @@
+// { dg-do compile }
+// { dg-options "-O -fpartial-inlining -flto -fconserve-stack -fcompare-debug" }
+// { dg-require-effective-target lto }
+
+void end (int, int) __attribute__ ((__noreturn__));
+
+struct S
+{
+ int i;
+ S *s;
+};
+
+inline bool f (S *s)
+{
+ if (!s->s)
+ end (0, 0);
+ return s->s == s;
+}
+
+inline bool
+baz (S s1, S)
+{
+ while (f (&s1));
+}
+
+inline bool
+bar (S s1, S s2, S)
+{
+ baz (s1, s2);
+}
+
+S getS ();
+
+bool
+foo ()
+{
+ bar (getS (), getS (), getS ());
+}
diff --git a/gcc/testsuite/g++.dg/debug/pr47283.C b/gcc/testsuite/g++.dg/debug/pr47283.C
new file mode 100644
index 00000000000..dadbeff3deb
--- /dev/null
+++ b/gcc/testsuite/g++.dg/debug/pr47283.C
@@ -0,0 +1,58 @@
+// PR debug/47283
+// { dg-do compile }
+
+template <typename T> inline const T &
+f1 (const T &a, const T &b)
+{
+ if (a < b)
+ return b;
+ return a;
+};
+
+struct A
+{
+ A (int w, int h) { a1 = w; }
+ A f2 (const A &) const;
+ int a1, a2;
+};
+
+inline A
+A::f2 (const A &x) const
+{
+ return A (f1 (a1, x.a1), f1 (a2, x.a2));
+};
+
+struct B
+{
+ A f3 () const;
+ void f4 (const A &) { b2 = 5 + b1; }
+ int b1, b2;
+};
+
+struct C
+{
+};
+
+struct D
+{
+ virtual C f5 (const C &) const;
+};
+
+struct E
+{
+ C f6 () const;
+ int f7 () const;
+ virtual B f8 (const C &) const;
+ A f9 () const;
+ virtual void f10 ();
+ struct F { D *h; } *d;
+};
+
+void
+E::f10 ()
+{
+ const C c = d->h->f5 (f6 ());
+ B b = f8 (c);
+ b.f4 (b.f3 ().f2 (f9 ()));
+ f7 ();
+}
diff --git a/gcc/testsuite/g++.dg/expr/bound-mem-fun.C b/gcc/testsuite/g++.dg/expr/bound-mem-fun.C
index 9e699b638e3..b31bba13cf3 100644
--- a/gcc/testsuite/g++.dg/expr/bound-mem-fun.C
+++ b/gcc/testsuite/g++.dg/expr/bound-mem-fun.C
@@ -1,6 +1,6 @@
// Contributed by Dodji Seketeli <dodji@redhat.com>
// Origin PR c++/38228
-// { dg-do "compile" }
+// { dg-do compile }
struct A
{
diff --git a/gcc/testsuite/g++.dg/expr/cond6.C b/gcc/testsuite/g++.dg/expr/cond6.C
index 9308c179541..943aa85a963 100644
--- a/gcc/testsuite/g++.dg/expr/cond6.C
+++ b/gcc/testsuite/g++.dg/expr/cond6.C
@@ -1,4 +1,4 @@
-// { dg-do "run" }
+// { dg-do run }
extern "C" void abort ();
diff --git a/gcc/testsuite/g++.dg/expr/stmt-expr-1.C b/gcc/testsuite/g++.dg/expr/stmt-expr-1.C
index 2c50e35dca8..c4db5157f5a 100644
--- a/gcc/testsuite/g++.dg/expr/stmt-expr-1.C
+++ b/gcc/testsuite/g++.dg/expr/stmt-expr-1.C
@@ -1,7 +1,7 @@
// Contributed by Dodji Seketeli <dodji@redhat.com>
// Origin PR c++/40866
// { dg-options "-std=gnu++98" }
-// { dg-do "compile" }
+// { dg-do compile }
template <typename T> class QForeachContainer {
public:
diff --git a/gcc/testsuite/g++.dg/ext/altivec-15.C b/gcc/testsuite/g++.dg/ext/altivec-15.C
index ed1c088ccaa..d8e982db4ff 100644
--- a/gcc/testsuite/g++.dg/ext/altivec-15.C
+++ b/gcc/testsuite/g++.dg/ext/altivec-15.C
@@ -1,6 +1,6 @@
/* { dg-do compile { target powerpc*-*-* } } */
/* { dg-require-effective-target powerpc_altivec_ok } */
-/* { dg-options "-maltivec" } */
+/* { dg-options "-maltivec -mno-vsx" } */
/* This test was added for an internal compiler error. The number and
content of error messages is irrelevant. */
diff --git a/gcc/testsuite/g++.dg/ext/altivec-types-1.C b/gcc/testsuite/g++.dg/ext/altivec-types-1.C
index 710ce4bff4d..f54aeec46af 100644
--- a/gcc/testsuite/g++.dg/ext/altivec-types-1.C
+++ b/gcc/testsuite/g++.dg/ext/altivec-types-1.C
@@ -1,6 +1,6 @@
/* { dg-do compile { target powerpc*-*-linux* } } */
/* { dg-require-effective-target powerpc_altivec_ok } */
-/* { dg-options "-maltivec -std=c++98" } */
+/* { dg-options "-maltivec -mno-vsx -std=c++98" } */
/* Valid AltiVec vector types should be accepted with no warnings. */
diff --git a/gcc/testsuite/g++.dg/ext/altivec-types-2.C b/gcc/testsuite/g++.dg/ext/altivec-types-2.C
index f64c0c5aa21..cee6c8f263f 100644
--- a/gcc/testsuite/g++.dg/ext/altivec-types-2.C
+++ b/gcc/testsuite/g++.dg/ext/altivec-types-2.C
@@ -1,7 +1,7 @@
/* { dg-do compile { target powerpc*-*-linux* } } */
/* { dg-require-effective-target ilp32 } */
/* { dg-require-effective-target powerpc_altivec_ok } */
-/* { dg-options "-maltivec" } */
+/* { dg-options "-maltivec -mno-vsx" } */
/* These should get warnings for 32-bit code. */
diff --git a/gcc/testsuite/g++.dg/ext/altivec-types-3.C b/gcc/testsuite/g++.dg/ext/altivec-types-3.C
index 2fe965986b3..6bea9a145c6 100644
--- a/gcc/testsuite/g++.dg/ext/altivec-types-3.C
+++ b/gcc/testsuite/g++.dg/ext/altivec-types-3.C
@@ -1,7 +1,7 @@
/* { dg-do compile { target powerpc*-*-linux* } } */
/* { dg-require-effective-target powerpc_altivec_ok } */
/* { dg-require-effective-target lp64 } */
-/* { dg-options "-maltivec" } */
+/* { dg-options "-maltivec -mno-vsx" } */
/* These should be rejected for 64-bit code. */
diff --git a/gcc/testsuite/g++.dg/ext/altivec-types-4.C b/gcc/testsuite/g++.dg/ext/altivec-types-4.C
index 212f6733939..b937f3cf1b1 100644
--- a/gcc/testsuite/g++.dg/ext/altivec-types-4.C
+++ b/gcc/testsuite/g++.dg/ext/altivec-types-4.C
@@ -1,7 +1,7 @@
/* { dg-do compile { target powerpc*-*-linux* } } */
/* { dg-require-effective-target ilp32 } */
/* { dg-require-effective-target powerpc_altivec_ok } */
-/* { dg-options "-maltivec -mno-warn-altivec-long" } */
+/* { dg-options "-maltivec -mno-vsx -mno-warn-altivec-long" } */
/* These should not get warnings for 32-bit code when the warning is
disabled. */
diff --git a/gcc/testsuite/g++.dg/ext/dllexport4.C b/gcc/testsuite/g++.dg/ext/dllexport4.C
new file mode 100644
index 00000000000..81c57c3fbca
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ext/dllexport4.C
@@ -0,0 +1,54 @@
+// { dg-do link }
+// { dg-require-dll "" }
+// { dg-additional-sources "dllexport4a.cc" }
+// { dg-options "-O2 -fno-keep-inline-dllexport" }
+// { dg-prune-output .*undefined.* }
+// { dg-xfail-if "link failure expected" { *-*-* } }
+
+/* Test that inline functions declared "dllexport" appear in object files,
+ even if they are not called - except when -fno-keep-inline-dllexport.
+
+ This behavior is required by the ARM C++ ABI:
+
+ Exporting a function that can be inlined should force the
+ creation and export of an out-of-line copy of it.
+
+ and should presumably also apply.
+
+ Visual Studio 2005 also honors that rule. */
+
+__declspec(dllexport) inline void i1() {}
+
+__declspec(dllexport) extern inline void e1() {}
+
+/* It is invalid to declare the function inline after its definition. */
+#if 0
+__declspec(dllexport) void i2() {}
+inline void i2();
+
+__declspec(dllexport) extern void e2() {}
+inline void e2();
+#endif
+
+__declspec(dllexport) inline void i3() {}
+void i3();
+
+__declspec(dllexport) inline void e3() {}
+extern void e3();
+
+__declspec(dllexport) void i4();
+inline void i4() {};
+
+__declspec(dllexport) extern void e4();
+inline void e4() {};
+
+__declspec(dllexport) inline void i5();
+void i5() {};
+
+__declspec(dllexport) inline void e5();
+extern void e5() {};
+
+/* Make sure that just declaring the function -- without defining it
+ -- does not cause errors. */
+__declspec(dllexport) inline void i6();
+__declspec(dllexport) extern inline void e6();
diff --git a/gcc/testsuite/g++.dg/ext/dllexport4a.cc b/gcc/testsuite/g++.dg/ext/dllexport4a.cc
new file mode 100644
index 00000000000..80caf321742
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ext/dllexport4a.cc
@@ -0,0 +1,21 @@
+extern void i1();
+extern void i3();
+extern void i4();
+extern void i5();
+
+extern void e1();
+extern void e3();
+extern void e4();
+extern void e5();
+
+int main () {
+ i1();
+ i3();
+ i4();
+ i5();
+
+ e1();
+ e3();
+ e4();
+ e5();
+}
diff --git a/gcc/testsuite/g++.dg/ext/dllexport5.C b/gcc/testsuite/g++.dg/ext/dllexport5.C
new file mode 100755
index 00000000000..8b27807315e
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ext/dllexport5.C
@@ -0,0 +1,52 @@
+// { dg-do link }
+// { dg-require-dll "" }
+// { dg-additional-sources "dllexport5a.cc" }
+// { dg-options "-O2 -fkeep-inline-dllexport" }
+
+/* Test that inline functions declared "dllexport" appear in object files,
+ even if they are not called, when -fkeep-inline-dllexport is supplied.
+
+ This behavior is required by the ARM C++ ABI:
+
+ Exporting a function that can be inlined should force the
+ creation and export of an out-of-line copy of it.
+
+ and should presumably also apply.
+
+ Visual Studio 2005 also honors that rule. */
+
+__declspec(dllexport) inline void i1() {}
+
+__declspec(dllexport) extern inline void e1() {}
+
+/* It is invalid to declare the function inline after its definition. */
+#if 0
+__declspec(dllexport) void i2() {}
+inline void i2();
+
+__declspec(dllexport) extern void e2() {}
+inline void e2();
+#endif
+
+__declspec(dllexport) inline void i3() {}
+void i3();
+
+__declspec(dllexport) inline void e3() {}
+extern void e3();
+
+__declspec(dllexport) void i4();
+inline void i4() {};
+
+__declspec(dllexport) extern void e4();
+inline void e4() {};
+
+__declspec(dllexport) inline void i5();
+void i5() {};
+
+__declspec(dllexport) inline void e5();
+extern void e5() {};
+
+/* Make sure that just declaring the function -- without defining it
+ -- does not cause errors. */
+__declspec(dllexport) inline void i6();
+__declspec(dllexport) extern inline void e6();
diff --git a/gcc/testsuite/g++.dg/ext/dllexport5a.cc b/gcc/testsuite/g++.dg/ext/dllexport5a.cc
new file mode 100644
index 00000000000..80caf321742
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ext/dllexport5a.cc
@@ -0,0 +1,21 @@
+extern void i1();
+extern void i3();
+extern void i4();
+extern void i5();
+
+extern void e1();
+extern void e3();
+extern void e4();
+extern void e5();
+
+int main () {
+ i1();
+ i3();
+ i4();
+ i5();
+
+ e1();
+ e3();
+ e4();
+ e5();
+}
diff --git a/gcc/testsuite/g++.dg/ext/has_nothrow_assign.C b/gcc/testsuite/g++.dg/ext/has_nothrow_assign.C
index f3b4a8b2556..e6e9fc6eda9 100644
--- a/gcc/testsuite/g++.dg/ext/has_nothrow_assign.C
+++ b/gcc/testsuite/g++.dg/ext/has_nothrow_assign.C
@@ -1,4 +1,4 @@
-// { dg-do "run" }
+// { dg-do run }
#include <cassert>
struct A
diff --git a/gcc/testsuite/g++.dg/ext/has_nothrow_assign_odr.C b/gcc/testsuite/g++.dg/ext/has_nothrow_assign_odr.C
index c38d76d44a6..c2e99ef5444 100644
--- a/gcc/testsuite/g++.dg/ext/has_nothrow_assign_odr.C
+++ b/gcc/testsuite/g++.dg/ext/has_nothrow_assign_odr.C
@@ -1,5 +1,5 @@
// PR c++/36870
-// { dg-do "run" }
+// { dg-do run }
#include <cassert>
struct S { const S& operator= (const S&); };
diff --git a/gcc/testsuite/g++.dg/ext/has_nothrow_constructor.C b/gcc/testsuite/g++.dg/ext/has_nothrow_constructor.C
index 60e9be8d0be..1f1227c3011 100644
--- a/gcc/testsuite/g++.dg/ext/has_nothrow_constructor.C
+++ b/gcc/testsuite/g++.dg/ext/has_nothrow_constructor.C
@@ -1,4 +1,4 @@
-// { dg-do "run" }
+// { dg-do run }
#include <cassert>
struct A
diff --git a/gcc/testsuite/g++.dg/ext/has_nothrow_constructor_odr.C b/gcc/testsuite/g++.dg/ext/has_nothrow_constructor_odr.C
index 775e74a2631..68ca111b09d 100644
--- a/gcc/testsuite/g++.dg/ext/has_nothrow_constructor_odr.C
+++ b/gcc/testsuite/g++.dg/ext/has_nothrow_constructor_odr.C
@@ -1,5 +1,5 @@
// PR c++/36870
-// { dg-do "run" }
+// { dg-do run }
#include <cassert>
struct S { S (); };
diff --git a/gcc/testsuite/g++.dg/ext/has_nothrow_copy-1.C b/gcc/testsuite/g++.dg/ext/has_nothrow_copy-1.C
index 056c9be61f6..87785ae5aba 100644
--- a/gcc/testsuite/g++.dg/ext/has_nothrow_copy-1.C
+++ b/gcc/testsuite/g++.dg/ext/has_nothrow_copy-1.C
@@ -1,4 +1,4 @@
-// { dg-do "run" }
+// { dg-do run }
#include <cassert>
struct A
diff --git a/gcc/testsuite/g++.dg/ext/has_nothrow_copy-2.C b/gcc/testsuite/g++.dg/ext/has_nothrow_copy-2.C
index 276b11d574c..b2eb203f396 100644
--- a/gcc/testsuite/g++.dg/ext/has_nothrow_copy-2.C
+++ b/gcc/testsuite/g++.dg/ext/has_nothrow_copy-2.C
@@ -1,5 +1,5 @@
// PR c++/36871
-// { dg-do "run" }
+// { dg-do run }
#include <cassert>
struct A { template <class T> A (T) throw (int); };
diff --git a/gcc/testsuite/g++.dg/ext/has_nothrow_copy-3.C b/gcc/testsuite/g++.dg/ext/has_nothrow_copy-3.C
index 2fbcf8c8096..79700441093 100644
--- a/gcc/testsuite/g++.dg/ext/has_nothrow_copy-3.C
+++ b/gcc/testsuite/g++.dg/ext/has_nothrow_copy-3.C
@@ -1,5 +1,5 @@
// PR c++/36871
-// { dg-do "run" }
+// { dg-do run }
#include <cassert>
struct F {
diff --git a/gcc/testsuite/g++.dg/ext/has_nothrow_copy-4.C b/gcc/testsuite/g++.dg/ext/has_nothrow_copy-4.C
index 4bd7475ea7c..69e9a6bacdf 100644
--- a/gcc/testsuite/g++.dg/ext/has_nothrow_copy-4.C
+++ b/gcc/testsuite/g++.dg/ext/has_nothrow_copy-4.C
@@ -1,5 +1,5 @@
// PR c++/36872
-// { dg-do "run" }
+// { dg-do run }
#include <cassert>
struct S {
diff --git a/gcc/testsuite/g++.dg/ext/has_nothrow_copy-5.C b/gcc/testsuite/g++.dg/ext/has_nothrow_copy-5.C
index 051675c4d00..b94b338c386 100644
--- a/gcc/testsuite/g++.dg/ext/has_nothrow_copy-5.C
+++ b/gcc/testsuite/g++.dg/ext/has_nothrow_copy-5.C
@@ -1,5 +1,5 @@
// PR c++/36872
-// { dg-do "run" }
+// { dg-do run }
#include <cassert>
struct S {
diff --git a/gcc/testsuite/g++.dg/ext/has_nothrow_copy-6.C b/gcc/testsuite/g++.dg/ext/has_nothrow_copy-6.C
index 4330edd2941..6268ee29207 100644
--- a/gcc/testsuite/g++.dg/ext/has_nothrow_copy-6.C
+++ b/gcc/testsuite/g++.dg/ext/has_nothrow_copy-6.C
@@ -1,4 +1,4 @@
-// { dg-do "run" }
+// { dg-do run }
#include <cassert>
struct S {
diff --git a/gcc/testsuite/g++.dg/ext/has_nothrow_copy-7.C b/gcc/testsuite/g++.dg/ext/has_nothrow_copy-7.C
index a85224c3abc..e0ecef44a25 100644
--- a/gcc/testsuite/g++.dg/ext/has_nothrow_copy-7.C
+++ b/gcc/testsuite/g++.dg/ext/has_nothrow_copy-7.C
@@ -1,4 +1,4 @@
-// { dg-do "run" }
+// { dg-do run }
// { dg-options "-std=c++0x" }
#include <cassert>
diff --git a/gcc/testsuite/g++.dg/ext/has_nothrow_copy_odr.C b/gcc/testsuite/g++.dg/ext/has_nothrow_copy_odr.C
index 499a11e25be..573fd2f80c8 100644
--- a/gcc/testsuite/g++.dg/ext/has_nothrow_copy_odr.C
+++ b/gcc/testsuite/g++.dg/ext/has_nothrow_copy_odr.C
@@ -1,5 +1,5 @@
// PR c++/36870
-// { dg-do "run" }
+// { dg-do run }
#include <cassert>
struct S { S (const S&); };
diff --git a/gcc/testsuite/g++.dg/ext/has_trivial_assign.C b/gcc/testsuite/g++.dg/ext/has_trivial_assign.C
index 46d8c34bb3f..dce0f8b3a51 100644
--- a/gcc/testsuite/g++.dg/ext/has_trivial_assign.C
+++ b/gcc/testsuite/g++.dg/ext/has_trivial_assign.C
@@ -1,4 +1,4 @@
-// { dg-do "run" }
+// { dg-do run }
#include <cassert>
struct A
diff --git a/gcc/testsuite/g++.dg/ext/has_trivial_constructor.C b/gcc/testsuite/g++.dg/ext/has_trivial_constructor.C
index cc747391b32..f4addd82446 100644
--- a/gcc/testsuite/g++.dg/ext/has_trivial_constructor.C
+++ b/gcc/testsuite/g++.dg/ext/has_trivial_constructor.C
@@ -1,4 +1,4 @@
-// { dg-do "run" }
+// { dg-do run }
#include <cassert>
struct A
diff --git a/gcc/testsuite/g++.dg/ext/has_trivial_copy.C b/gcc/testsuite/g++.dg/ext/has_trivial_copy.C
index 4b8cc154147..4d2341b17e1 100644
--- a/gcc/testsuite/g++.dg/ext/has_trivial_copy.C
+++ b/gcc/testsuite/g++.dg/ext/has_trivial_copy.C
@@ -1,4 +1,4 @@
-// { dg-do "run" }
+// { dg-do run }
#include <cassert>
struct A
diff --git a/gcc/testsuite/g++.dg/ext/has_trivial_destructor-1.C b/gcc/testsuite/g++.dg/ext/has_trivial_destructor-1.C
index 719f05fd7a5..2834c238d6e 100644
--- a/gcc/testsuite/g++.dg/ext/has_trivial_destructor-1.C
+++ b/gcc/testsuite/g++.dg/ext/has_trivial_destructor-1.C
@@ -1,4 +1,4 @@
-// { dg-do "run" }
+// { dg-do run }
#include <cassert>
struct A
diff --git a/gcc/testsuite/g++.dg/ext/has_virtual_destructor.C b/gcc/testsuite/g++.dg/ext/has_virtual_destructor.C
index 093e7f5004d..62b60aebf59 100644
--- a/gcc/testsuite/g++.dg/ext/has_virtual_destructor.C
+++ b/gcc/testsuite/g++.dg/ext/has_virtual_destructor.C
@@ -1,4 +1,4 @@
-// { dg-do "run" }
+// { dg-do run }
#include <cassert>
#include <exception>
diff --git a/gcc/testsuite/g++.dg/ext/is_abstract.C b/gcc/testsuite/g++.dg/ext/is_abstract.C
index 919f928fd9a..2d7149452ff 100644
--- a/gcc/testsuite/g++.dg/ext/is_abstract.C
+++ b/gcc/testsuite/g++.dg/ext/is_abstract.C
@@ -1,4 +1,4 @@
-// { dg-do "run" }
+// { dg-do run }
#include <cassert>
struct A
diff --git a/gcc/testsuite/g++.dg/ext/is_base_of.C b/gcc/testsuite/g++.dg/ext/is_base_of.C
index 52ccff10009..8afa532e1cd 100644
--- a/gcc/testsuite/g++.dg/ext/is_base_of.C
+++ b/gcc/testsuite/g++.dg/ext/is_base_of.C
@@ -1,4 +1,4 @@
-// { dg-do "run" }
+// { dg-do run }
#include <cassert>
class A1
diff --git a/gcc/testsuite/g++.dg/ext/is_class.C b/gcc/testsuite/g++.dg/ext/is_class.C
index 6f0c8a5ba5b..6f398285580 100644
--- a/gcc/testsuite/g++.dg/ext/is_class.C
+++ b/gcc/testsuite/g++.dg/ext/is_class.C
@@ -1,4 +1,4 @@
-// { dg-do "run" }
+// { dg-do run }
#include <cassert>
struct A
diff --git a/gcc/testsuite/g++.dg/ext/is_empty.C b/gcc/testsuite/g++.dg/ext/is_empty.C
index 86a0312c258..4c58941b3bf 100644
--- a/gcc/testsuite/g++.dg/ext/is_empty.C
+++ b/gcc/testsuite/g++.dg/ext/is_empty.C
@@ -1,4 +1,4 @@
-// { dg-do "run" }
+// { dg-do run }
#include <cassert>
struct A
diff --git a/gcc/testsuite/g++.dg/ext/is_enum.C b/gcc/testsuite/g++.dg/ext/is_enum.C
index 7dc061cec76..4ac1723ed9a 100644
--- a/gcc/testsuite/g++.dg/ext/is_enum.C
+++ b/gcc/testsuite/g++.dg/ext/is_enum.C
@@ -1,4 +1,4 @@
-// { dg-do "run" }
+// { dg-do run }
#include <cassert>
struct A
diff --git a/gcc/testsuite/g++.dg/ext/is_pod.C b/gcc/testsuite/g++.dg/ext/is_pod.C
index 570d23565f1..939665d8d33 100644
--- a/gcc/testsuite/g++.dg/ext/is_pod.C
+++ b/gcc/testsuite/g++.dg/ext/is_pod.C
@@ -1,5 +1,5 @@
+// { dg-do run }
// { dg-options "-std=c++0x" }
-// { dg-do "run" }
#include <cassert>
struct A
diff --git a/gcc/testsuite/g++.dg/ext/is_polymorphic.C b/gcc/testsuite/g++.dg/ext/is_polymorphic.C
index ded071b1d02..462e4b705d8 100644
--- a/gcc/testsuite/g++.dg/ext/is_polymorphic.C
+++ b/gcc/testsuite/g++.dg/ext/is_polymorphic.C
@@ -1,4 +1,4 @@
-// { dg-do "run" }
+// { dg-do run }
#include <cassert>
#include <exception>
diff --git a/gcc/testsuite/g++.dg/ext/is_union.C b/gcc/testsuite/g++.dg/ext/is_union.C
index acba0bb60f2..c95f5a6e561 100644
--- a/gcc/testsuite/g++.dg/ext/is_union.C
+++ b/gcc/testsuite/g++.dg/ext/is_union.C
@@ -1,4 +1,4 @@
-// { dg-do "run" }
+// { dg-do run }
#include <cassert>
struct A
diff --git a/gcc/testsuite/g++.dg/ext/label10.C b/gcc/testsuite/g++.dg/ext/label10.C
index 735fe060bbc..632b2426ed5 100644
--- a/gcc/testsuite/g++.dg/ext/label10.C
+++ b/gcc/testsuite/g++.dg/ext/label10.C
@@ -1,10 +1,10 @@
// PR c++/33836
// { dg-do compile }
-// { dg-options "-std=gnu++98" }
+// { dg-options "" }
template<int N> struct A
{
- enum { M = && N }; // { dg-error "referenced outside|cannot appear in" }
+ enum { M = && N }; // { dg-error "referenced outside|cannot appear in|not an integer constant" }
};
A<0> a;
@@ -12,6 +12,6 @@ A<0> a;
void foo ()
{
__label__ P;
- enum { O = && P }; // { dg-error "cannot appear in" }
+ enum { O = && P }; // { dg-error "cannot appear in|not an integer constant" }
P:;
}
diff --git a/gcc/testsuite/g++.dg/ext/vla1.C b/gcc/testsuite/g++.dg/ext/vla1.C
index fad67ce956c..f3725354fc3 100644
--- a/gcc/testsuite/g++.dg/ext/vla1.C
+++ b/gcc/testsuite/g++.dg/ext/vla1.C
@@ -22,5 +22,5 @@ B::B (int i)
int ar[1][i]; // { dg-error "array" }
} s;
- s.ar[0][0] = 0; // { dg-error "no member" }
+ s.ar[0][0] = 0; // { dg-prune-output "no member" }
}
diff --git a/gcc/testsuite/g++.dg/inherit/covariant16.C b/gcc/testsuite/g++.dg/inherit/covariant16.C
index 828b5b8f1a6..de9307e8931 100644
--- a/gcc/testsuite/g++.dg/inherit/covariant16.C
+++ b/gcc/testsuite/g++.dg/inherit/covariant16.C
@@ -1,5 +1,5 @@
/* PR c++/28253 This used to ICE. */
-/* { dg-do "compile" } */
+/* { dg-do compile } */
struct A
{
diff --git a/gcc/testsuite/g++.dg/inherit/implicit-trivial1.C b/gcc/testsuite/g++.dg/inherit/implicit-trivial1.C
new file mode 100644
index 00000000000..e63bd3435a2
--- /dev/null
+++ b/gcc/testsuite/g++.dg/inherit/implicit-trivial1.C
@@ -0,0 +1,23 @@
+// PR c++/46807
+// { dg-options -std=c++98 }
+// In C++98/03, B::B(const B&) is trivial because A::A(const A&) is trivial,
+// even though doing overload resolution would mean calling the template
+// constructor. In C++0x, we do overload resolution to determine triviality.
+
+struct A
+{
+ A() {}
+private:
+ template <class T> A(T&);
+};
+
+struct B
+{
+ mutable A a;
+};
+
+int main()
+{
+ B b;
+ B b2(b);
+}
diff --git a/gcc/testsuite/g++.dg/inherit/virtual7.C b/gcc/testsuite/g++.dg/inherit/virtual7.C
new file mode 100644
index 00000000000..61f17fe6395
--- /dev/null
+++ b/gcc/testsuite/g++.dg/inherit/virtual7.C
@@ -0,0 +1,27 @@
+// Origin: PR c++/47666
+// { dg-do compile }
+
+template <typename T>
+struct A
+{
+ int a;
+};
+
+template <typename T>
+struct B : public A <T>
+{
+};
+
+class D : public B <D *>
+{
+ virtual D & operator= (const D &);
+};
+
+class E : virtual public D
+{
+};
+
+class F : public E
+{
+ virtual void foo ();
+};
diff --git a/gcc/testsuite/g++.dg/init/aggr5.C b/gcc/testsuite/g++.dg/init/aggr5.C
index 228459536f2..c1844f8ff88 100644
--- a/gcc/testsuite/g++.dg/init/aggr5.C
+++ b/gcc/testsuite/g++.dg/init/aggr5.C
@@ -1,5 +1,5 @@
// Origin PR c++/40239
-// { dg-do "compile" }
+// { dg-do compile }
struct B { B() { } private: B(B const&); };
struct A { int a; B b; };
diff --git a/gcc/testsuite/g++.dg/init/brace6.C b/gcc/testsuite/g++.dg/init/brace6.C
index 96b35b0d711..e01b947429f 100644
--- a/gcc/testsuite/g++.dg/init/brace6.C
+++ b/gcc/testsuite/g++.dg/init/brace6.C
@@ -1,5 +1,5 @@
/* PR c++/30759 */
-/* { dg-do "compile" } */
+/* { dg-do compile } */
struct A {
A(int) { }
diff --git a/gcc/testsuite/g++.dg/init/error2.C b/gcc/testsuite/g++.dg/init/error2.C
index 8cf59b368b6..43d24f13b73 100644
--- a/gcc/testsuite/g++.dg/init/error2.C
+++ b/gcc/testsuite/g++.dg/init/error2.C
@@ -1,5 +1,5 @@
/* PR c++/29727 */
-/* { dg-do "compile" } */
+/* { dg-do compile } */
template<int> struct A
{
diff --git a/gcc/testsuite/g++.dg/init/pr29571.C b/gcc/testsuite/g++.dg/init/pr29571.C
new file mode 100644
index 00000000000..9e8e6093ef2
--- /dev/null
+++ b/gcc/testsuite/g++.dg/init/pr29571.C
@@ -0,0 +1,8 @@
+// PR c++/29571
+
+struct A
+{
+ static const int i = 0/0 + ""; // { dg-warning "division by zero" }
+ // { dg-error "field initializer is not constant" "" { target *-*-* } 5 }
+ static const int j = int(i);
+};
diff --git a/gcc/testsuite/g++.dg/ipa/pr43695.C b/gcc/testsuite/g++.dg/ipa/pr43695.C
new file mode 100644
index 00000000000..a01478324b0
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ipa/pr43695.C
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+/* { dg-options "-fipa-cp -fipa-cp-clone" } */
+
+extern void baz(int) __attribute__ ((noreturn));
+
+struct S {
+ ~S();
+};
+
+__attribute__ ((noreturn, noinline))
+void bar(int i)
+{
+ baz(i);
+}
+
+void foo()
+{
+ S s;
+ bar(0);
+}
diff --git a/gcc/testsuite/g++.dg/lookup/friend11.C b/gcc/testsuite/g++.dg/lookup/friend11.C
index cd112ca8a4b..2b4ffda83cb 100644
--- a/gcc/testsuite/g++.dg/lookup/friend11.C
+++ b/gcc/testsuite/g++.dg/lookup/friend11.C
@@ -1,6 +1,6 @@
/* PR c++/30917 */
/* This used to ICE */
-/* { dg-do "compile" } */
+/* { dg-do compile } */
class QGList;
diff --git a/gcc/testsuite/g++.dg/lto/pr47333.C b/gcc/testsuite/g++.dg/lto/pr47333.C
new file mode 100644
index 00000000000..60873ca07c7
--- /dev/null
+++ b/gcc/testsuite/g++.dg/lto/pr47333.C
@@ -0,0 +1,944 @@
+namespace std
+{
+ typedef unsigned int size_t;
+ typedef int ptrdiff_t;
+
+}
+
+namespace std __attribute__ ((__visibility__ ("default"))) {
+
+ template<typename _Alloc>
+ class allocator;
+
+ template<class _CharT>
+ struct char_traits;
+
+ template<typename _CharT, typename _Traits = char_traits<_CharT>,
+ typename _Alloc = allocator<_CharT> >
+ class basic_string;
+
+ template<> struct char_traits<char>;
+
+ typedef basic_string<char> string;
+
+ template<> struct char_traits<wchar_t>;
+
+ typedef basic_string<wchar_t> wstring;
+}
+
+namespace std __attribute__ ((__visibility__ ("default"))) {
+ void
+ __throw_bad_alloc(void) __attribute__((__noreturn__));
+}
+
+namespace __gnu_cxx __attribute__ ((__visibility__ ("default"))) {
+ template<typename _Iterator, typename _Container>
+ class __normal_iterator;
+}
+
+namespace std __attribute__ ((__visibility__ ("default"))) {
+
+ template<typename _Tp>
+ inline _Tp*
+ __addressof(_Tp& __r)
+ {
+ return reinterpret_cast<_Tp*>
+ (&const_cast<char&>(reinterpret_cast<const volatile char&>(__r)));
+ }
+}
+
+namespace std __attribute__ ((__visibility__ ("default"))) {
+ template<class _T1, class _T2>
+ struct pair
+ {
+ typedef _T1 first_type;
+ typedef _T2 second_type;
+
+ _T1 first;
+ _T2 second;
+
+ pair()
+ : first(), second() { }
+
+ pair(const _T1& __a, const _T2& __b)
+ : first(__a), second(__b) { }
+ };
+}
+
+namespace std __attribute__ ((__visibility__ ("default"))) {
+ struct input_iterator_tag { };
+
+ struct output_iterator_tag { };
+
+ struct forward_iterator_tag : public input_iterator_tag { };
+
+ struct bidirectional_iterator_tag : public forward_iterator_tag { };
+
+ struct random_access_iterator_tag : public bidirectional_iterator_tag { };
+ template<typename _Category, typename _Tp, typename _Distance = ptrdiff_t,
+ typename _Pointer = _Tp*, typename _Reference = _Tp&>
+ struct iterator
+ {
+ typedef _Category iterator_category;
+ typedef _Tp value_type;
+ typedef _Distance difference_type;
+ typedef _Pointer pointer;
+ typedef _Reference reference;
+ };
+
+ template<typename _Iterator>
+ struct iterator_traits
+ {
+ typedef typename _Iterator::iterator_category iterator_category;
+ typedef typename _Iterator::value_type value_type;
+ typedef typename _Iterator::difference_type difference_type;
+ typedef typename _Iterator::pointer pointer;
+ typedef typename _Iterator::reference reference;
+ };
+}
+
+namespace std __attribute__ ((__visibility__ ("default"))) {
+ template<typename _Iterator>
+ class reverse_iterator
+ : public iterator<typename iterator_traits<_Iterator>::iterator_category,
+ typename iterator_traits<_Iterator>::value_type,
+ typename iterator_traits<_Iterator>::difference_type,
+ typename iterator_traits<_Iterator>::pointer,
+ typename iterator_traits<_Iterator>::reference>
+ {
+ protected:
+ _Iterator current;
+ typedef iterator_traits<_Iterator> __traits_type;
+ };
+}
+
+struct _IO_FILE;
+
+typedef struct _IO_FILE FILE;
+
+typedef struct _IO_FILE __FILE;
+
+typedef __builtin_va_list __gnuc_va_list;
+
+typedef unsigned int size_t;
+typedef unsigned int wint_t;
+
+typedef struct
+{
+ int __count;
+ union
+ {
+ unsigned int __wch;
+ char __wchb[4];
+ } __value;
+} __mbstate_t;
+
+
+typedef __mbstate_t mbstate_t;
+
+namespace std __attribute__ ((__visibility__ ("default"))) {
+ using ::mbstate_t;
+}
+
+namespace std __attribute__ ((__visibility__ ("default"))) {
+ typedef long long streamoff;
+
+ typedef ptrdiff_t streamsize;
+ template<typename _StateT>
+ class fpos
+ {
+ private:
+ streamoff _M_off;
+ _StateT _M_state;
+
+ public:
+
+ fpos()
+ : _M_off(0), _M_state() { }
+ fpos(streamoff __off)
+ : _M_off(__off), _M_state() { }
+
+ operator streamoff() const { return _M_off; }
+
+ };
+
+ typedef fpos<mbstate_t> streampos;
+
+ typedef fpos<mbstate_t> wstreampos;
+}
+
+namespace __gnu_cxx __attribute__ ((__visibility__ ("default"))) {
+ template<typename _CharT>
+ struct _Char_types
+ {
+ typedef unsigned long int_type;
+ typedef std::streampos pos_type;
+ typedef std::streamoff off_type;
+ typedef std::mbstate_t state_type;
+ };
+ template<typename _CharT>
+ struct char_traits
+ {
+ typedef _CharT char_type;
+ typedef typename _Char_types<_CharT>::int_type int_type;
+ typedef typename _Char_types<_CharT>::pos_type pos_type;
+ typedef typename _Char_types<_CharT>::off_type off_type;
+ typedef typename _Char_types<_CharT>::state_type state_type;
+
+ static const char_type*
+ find(const char_type* __s, std::size_t __n, const char_type& __a);
+ };
+}
+
+namespace std __attribute__ ((__visibility__ ("default"))) {
+ template<class _CharT>
+ struct char_traits : public __gnu_cxx::char_traits<_CharT>
+ { };
+
+ template<>
+ struct char_traits<char>
+ {
+ typedef char char_type;
+ typedef int int_type;
+ typedef streampos pos_type;
+ typedef streamoff off_type;
+ typedef mbstate_t state_type;
+
+ static const char_type*
+ find(const char_type* __s, size_t __n, const char_type& __a)
+ { return static_cast<const char_type*>(__builtin_memchr(__s, __a, __n)); }
+ };
+}
+
+namespace __gnu_cxx __attribute__ ((__visibility__ ("default"))) {
+
+ using std::size_t;
+ using std::ptrdiff_t;
+ template<typename _Tp>
+ class new_allocator
+ {
+ public:
+ typedef size_t size_type;
+ typedef ptrdiff_t difference_type;
+ typedef _Tp* pointer;
+ typedef const _Tp* const_pointer;
+ typedef _Tp& reference;
+ typedef const _Tp& const_reference;
+ typedef _Tp value_type;
+
+ new_allocator() throw() { }
+
+ new_allocator(const new_allocator&) throw() { }
+
+ template<typename _Tp1>
+ new_allocator(const new_allocator<_Tp1>&) throw() { }
+
+ ~new_allocator() throw() { }
+
+ pointer
+ allocate(size_type __n, const void* = 0)
+ {
+ if (__n > this->max_size())
+ std::__throw_bad_alloc();
+
+ return static_cast<_Tp*>(::operator new(__n * sizeof(_Tp)));
+ }
+ void
+ deallocate(pointer __p, size_type)
+ { ::operator delete(__p); }
+
+ void
+ destroy(pointer __p) { __p->~_Tp(); }
+ };
+}
+
+namespace std __attribute__ ((__visibility__ ("default"))) {
+ template<typename _Tp>
+ class allocator;
+
+ template<typename _Tp>
+ class allocator: public __gnu_cxx::new_allocator<_Tp>
+ {
+ public:
+ typedef size_t size_type;
+ typedef ptrdiff_t difference_type;
+ typedef _Tp* pointer;
+ typedef const _Tp* const_pointer;
+ typedef _Tp& reference;
+ typedef const _Tp& const_reference;
+ typedef _Tp value_type;
+
+ template<typename _Tp1>
+ struct rebind
+ { typedef allocator<_Tp1> other; };
+
+ allocator() throw() { }
+
+ allocator(const allocator& __a) throw()
+ : __gnu_cxx::new_allocator<_Tp>(__a) { }
+
+ template<typename _Tp1>
+ allocator(const allocator<_Tp1>&) throw() { }
+
+ ~allocator() throw() { }
+ };
+}
+
+namespace std __attribute__ ((__visibility__ ("default"))) {
+ template<typename _Arg, typename _Result>
+ struct unary_function
+ {
+ typedef _Arg argument_type;
+ typedef _Result result_type;
+ };
+
+ template<typename _Arg1, typename _Arg2, typename _Result>
+ struct binary_function
+ {
+ typedef _Arg1 first_argument_type;
+ typedef _Arg2 second_argument_type;
+ typedef _Result result_type;
+ };
+
+ template<typename _Tp>
+ struct less : public binary_function<_Tp, _Tp, bool>
+ {
+ bool
+ operator()(const _Tp& __x, const _Tp& __y) const
+ { return __x < __y; }
+ };
+
+ template<typename _Pair>
+ struct _Select1st : public unary_function<_Pair,
+ typename _Pair::first_type>
+ {
+ typename _Pair::first_type&
+ operator()(_Pair& __x) const
+ { return __x.first; }
+
+ const typename _Pair::first_type&
+ operator()(const _Pair& __x) const
+ { return __x.first; }
+ };
+}
+
+extern "C" {
+
+typedef int __sig_atomic_t;
+
+typedef struct
+ {
+ unsigned long int __val[(1024 / (8 * sizeof (unsigned long int)))];
+ } __sigset_t;
+typedef __sigset_t sigset_t;
+}
+typedef unsigned long int pthread_t;
+
+typedef struct __pthread_internal_slist
+{
+ struct __pthread_internal_slist *__next;
+} __pthread_slist_t;
+
+typedef union
+{
+ struct __pthread_mutex_s
+ {
+ int __lock;
+ unsigned int __count;
+ int __owner;
+ int __kind;
+
+ unsigned int __nusers;
+ __extension__ union
+ {
+ int __spins;
+ __pthread_slist_t __list;
+ };
+
+ } __data;
+ char __size[24];
+ long int __align;
+} pthread_mutex_t;
+
+typedef unsigned int pthread_key_t;
+
+typedef int pthread_once_t;
+
+extern int pthread_once (pthread_once_t *__once_control,
+ void (*__init_routine) (void)) __attribute__ ((__nonnull__ (1, 2)));
+
+extern int pthread_mutex_lock (pthread_mutex_t *__mutex)
+ throw () __attribute__ ((__nonnull__ (1)));
+
+extern int pthread_mutex_unlock (pthread_mutex_t *__mutex)
+ throw () __attribute__ ((__nonnull__ (1)));
+
+typedef pthread_t __gthread_t;
+typedef pthread_key_t __gthread_key_t;
+typedef pthread_once_t __gthread_once_t;
+typedef pthread_mutex_t __gthread_mutex_t;
+
+static __typeof(pthread_once) __gthrw_pthread_once __attribute__ ((__weakref__("pthread_once")));
+
+static __typeof(pthread_mutex_lock) __gthrw_pthread_mutex_lock __attribute__ ((__weakref__("pthread_mutex_lock")));
+
+static __typeof(pthread_mutex_unlock) __gthrw_pthread_mutex_unlock __attribute__ ((__weakref__("pthread_mutex_unlock")));
+
+static volatile int __gthread_active = -1;
+
+static void
+__gthread_trigger (void)
+{
+ __gthread_active = 1;
+}
+
+static inline int
+__gthread_active_p (void)
+{
+ static pthread_mutex_t __gthread_active_mutex = { { 0, 0, 0, 0, 0, { 0 } } };
+ static pthread_once_t __gthread_active_once = 0;
+
+ int __gthread_active_latest_value = __gthread_active;
+
+ if (__builtin_expect (__gthread_active_latest_value < 0, 0))
+ {
+ if (__gthrw_pthread_once)
+ {
+ __gthrw_pthread_mutex_lock (&__gthread_active_mutex);
+ __gthrw_pthread_once (&__gthread_active_once, __gthread_trigger);
+ __gthrw_pthread_mutex_unlock (&__gthread_active_mutex);
+ }
+
+ if (__gthread_active < 0)
+ __gthread_active = 0;
+ __gthread_active_latest_value = __gthread_active;
+ }
+
+ return __gthread_active_latest_value != 0;
+}
+
+typedef int _Atomic_word;
+
+namespace __gnu_cxx __attribute__ ((__visibility__ ("default"))) {
+
+ static inline _Atomic_word
+ __exchange_and_add(volatile _Atomic_word* __mem, int __val)
+ { return __sync_fetch_and_add(__mem, __val); }
+
+ static inline void
+ __atomic_add(volatile _Atomic_word* __mem, int __val)
+ { __sync_fetch_and_add(__mem, __val); }
+ static inline _Atomic_word
+ __exchange_and_add_single(_Atomic_word* __mem, int __val)
+ {
+ _Atomic_word __result = *__mem;
+ *__mem += __val;
+ return __result;
+ }
+
+ static inline void
+ __atomic_add_single(_Atomic_word* __mem, int __val)
+ { *__mem += __val; }
+
+ static inline _Atomic_word
+ __attribute__ ((__unused__))
+ __exchange_and_add_dispatch(_Atomic_word* __mem, int __val)
+ {
+ if (__gthread_active_p())
+ return __exchange_and_add(__mem, __val);
+ else
+ return __exchange_and_add_single(__mem, __val);
+ }
+
+ static inline void
+ __attribute__ ((__unused__))
+ __atomic_add_dispatch(_Atomic_word* __mem, int __val)
+ {
+ if (__gthread_active_p())
+ __atomic_add(__mem, __val);
+ else
+ __atomic_add_single(__mem, __val);
+ }
+}
+
+namespace std __attribute__ ((__visibility__ ("default"))) {
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ class basic_string
+ {
+ typedef typename _Alloc::template rebind<_CharT>::other _CharT_alloc_type;
+
+ public:
+ typedef _Traits traits_type;
+ typedef typename _Traits::char_type value_type;
+ typedef _Alloc allocator_type;
+ typedef typename _CharT_alloc_type::size_type size_type;
+ typedef typename _CharT_alloc_type::difference_type difference_type;
+ typedef typename _CharT_alloc_type::reference reference;
+ typedef typename _CharT_alloc_type::const_reference const_reference;
+ typedef typename _CharT_alloc_type::pointer pointer;
+ typedef typename _CharT_alloc_type::const_pointer const_pointer;
+ typedef __gnu_cxx::__normal_iterator<pointer, basic_string> iterator;
+ typedef __gnu_cxx::__normal_iterator<const_pointer, basic_string>
+ const_iterator;
+ typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
+ typedef std::reverse_iterator<iterator> reverse_iterator;
+
+ private:
+ struct _Rep_base
+ {
+ size_type _M_length;
+ size_type _M_capacity;
+ _Atomic_word _M_refcount;
+ };
+
+ struct _Rep : _Rep_base
+ {
+
+ typedef typename _Alloc::template rebind<char>::other _Raw_bytes_alloc;
+ static const size_type _S_max_size;
+ static const _CharT _S_terminal;
+
+ static size_type _S_empty_rep_storage[];
+
+ static _Rep&
+ _S_empty_rep()
+ {
+ void* __p = reinterpret_cast<void*>(&_S_empty_rep_storage);
+ return *reinterpret_cast<_Rep*>(__p);
+ }
+
+ _CharT*
+ _M_refdata() throw()
+ { return reinterpret_cast<_CharT*>(this + 1); }
+
+ void
+ _M_dispose(const _Alloc& __a)
+ {
+ if (__builtin_expect(this != &_S_empty_rep(), false))
+ {
+ ;
+ if (__gnu_cxx::__exchange_and_add_dispatch(&this->_M_refcount,
+ -1) <= 0)
+ {
+ ;
+ _M_destroy(__a);
+ }
+ }
+ }
+
+ void
+ _M_destroy(const _Alloc&) throw();
+
+ _CharT*
+ _M_refcopy() throw()
+ {
+ if (__builtin_expect(this != &_S_empty_rep(), false))
+ __gnu_cxx::__atomic_add_dispatch(&this->_M_refcount, 1);
+ return _M_refdata();
+ }
+ };
+
+ struct _Alloc_hider : _Alloc
+ {
+ _Alloc_hider(_CharT* __dat, const _Alloc& __a)
+ : _Alloc(__a), _M_p(__dat) { }
+
+ _CharT* _M_p;
+ };
+
+ private:
+
+ mutable _Alloc_hider _M_dataplus;
+
+ _CharT*
+ _M_data() const
+ { return _M_dataplus._M_p; }
+
+ _Rep*
+ _M_rep() const
+ { return &((reinterpret_cast<_Rep*> (_M_data()))[-1]); }
+
+ void
+ _M_leak_hard();
+
+ public:
+
+ ~basic_string()
+ { _M_rep()->_M_dispose(this->get_allocator()); }
+
+ public:
+
+ allocator_type
+ get_allocator() const
+ { return _M_dataplus; }
+ };
+}
+
+namespace std __attribute__ ((__visibility__ ("default"))) {
+ enum _Rb_tree_color { _S_red = false, _S_black = true };
+
+ struct _Rb_tree_node_base
+ {
+ typedef _Rb_tree_node_base* _Base_ptr;
+ typedef const _Rb_tree_node_base* _Const_Base_ptr;
+
+ _Rb_tree_color _M_color;
+ _Base_ptr _M_parent;
+ _Base_ptr _M_left;
+ _Base_ptr _M_right;
+
+ static _Base_ptr
+ _S_minimum(_Base_ptr __x)
+ {
+ while (__x->_M_left != 0) __x = __x->_M_left;
+ return __x;
+ }
+
+ static _Const_Base_ptr
+ _S_minimum(_Const_Base_ptr __x)
+ {
+ while (__x->_M_left != 0) __x = __x->_M_left;
+ return __x;
+ }
+
+ static _Base_ptr
+ _S_maximum(_Base_ptr __x)
+ {
+ while (__x->_M_right != 0) __x = __x->_M_right;
+ return __x;
+ }
+
+ static _Const_Base_ptr
+ _S_maximum(_Const_Base_ptr __x)
+ {
+ while (__x->_M_right != 0) __x = __x->_M_right;
+ return __x;
+ }
+ };
+
+ template<typename _Val>
+ struct _Rb_tree_node : public _Rb_tree_node_base
+ {
+ typedef _Rb_tree_node<_Val>* _Link_type;
+ _Val _M_value_field;
+ };
+
+ __attribute__ ((__pure__)) _Rb_tree_node_base*
+ _Rb_tree_increment(_Rb_tree_node_base* __x) throw ();
+
+ __attribute__ ((__pure__)) const _Rb_tree_node_base*
+ _Rb_tree_increment(const _Rb_tree_node_base* __x) throw ();
+
+ __attribute__ ((__pure__)) _Rb_tree_node_base*
+ _Rb_tree_decrement(_Rb_tree_node_base* __x) throw ();
+
+ __attribute__ ((__pure__)) const _Rb_tree_node_base*
+ _Rb_tree_decrement(const _Rb_tree_node_base* __x) throw ();
+
+ template<typename _Tp>
+ struct _Rb_tree_iterator
+ {
+ typedef _Tp value_type;
+ typedef _Tp& reference;
+ typedef _Tp* pointer;
+
+ typedef bidirectional_iterator_tag iterator_category;
+ typedef ptrdiff_t difference_type;
+
+ typedef _Rb_tree_iterator<_Tp> _Self;
+ typedef _Rb_tree_node_base::_Base_ptr _Base_ptr;
+ typedef _Rb_tree_node<_Tp>* _Link_type;
+
+ _Rb_tree_iterator()
+ : _M_node() { }
+
+ explicit
+ _Rb_tree_iterator(_Link_type __x)
+ : _M_node(__x) { }
+
+ bool
+ operator==(const _Self& __x) const
+ { return _M_node == __x._M_node; }
+
+ bool
+ operator!=(const _Self& __x) const
+ { return _M_node != __x._M_node; }
+
+ _Base_ptr _M_node;
+ };
+
+ template<typename _Tp>
+ struct _Rb_tree_const_iterator
+ {
+ typedef _Tp value_type;
+ typedef const _Tp& reference;
+ typedef const _Tp* pointer;
+
+ typedef _Rb_tree_iterator<_Tp> iterator;
+
+ typedef bidirectional_iterator_tag iterator_category;
+ typedef ptrdiff_t difference_type;
+
+ typedef _Rb_tree_const_iterator<_Tp> _Self;
+ typedef _Rb_tree_node_base::_Const_Base_ptr _Base_ptr;
+ typedef const _Rb_tree_node<_Tp>* _Link_type;
+
+ _Rb_tree_const_iterator()
+ : _M_node() { }
+
+ explicit
+ _Rb_tree_const_iterator(_Link_type __x)
+ : _M_node(__x) { }
+
+ _Rb_tree_const_iterator(const iterator& __it)
+ : _M_node(__it._M_node) { }
+
+ pointer
+ operator->() const
+ { return std::__addressof(static_cast<_Link_type>
+ (_M_node)->_M_value_field); }
+
+ bool
+ operator==(const _Self& __x) const
+ { return _M_node == __x._M_node; }
+
+ bool
+ operator!=(const _Self& __x) const
+ { return _M_node != __x._M_node; }
+
+ _Base_ptr _M_node;
+ };
+
+ template<typename _Key, typename _Val, typename _KeyOfValue,
+ typename _Compare, typename _Alloc = allocator<_Val> >
+ class _Rb_tree
+ {
+ typedef typename _Alloc::template rebind<_Rb_tree_node<_Val> >::other
+ _Node_allocator;
+
+ protected:
+ typedef _Rb_tree_node_base* _Base_ptr;
+ typedef const _Rb_tree_node_base* _Const_Base_ptr;
+
+ public:
+ typedef _Key key_type;
+ typedef _Val value_type;
+ typedef value_type* pointer;
+ typedef const value_type* const_pointer;
+ typedef value_type& reference;
+ typedef const value_type& const_reference;
+ typedef _Rb_tree_node<_Val>* _Link_type;
+ typedef const _Rb_tree_node<_Val>* _Const_Link_type;
+ typedef size_t size_type;
+ typedef ptrdiff_t difference_type;
+ typedef _Alloc allocator_type;
+
+ const _Node_allocator&
+ _M_get_Node_allocator() const
+ { return *static_cast<const _Node_allocator*>(&this->_M_impl); }
+
+ allocator_type
+ get_allocator() const
+ { return allocator_type(_M_get_Node_allocator()); }
+
+ protected:
+ void
+ _M_put_node(_Link_type __p)
+ { _M_impl._Node_allocator::deallocate(__p, 1); }
+
+ void
+ _M_destroy_node(_Link_type __p)
+ {
+ get_allocator().destroy(std::__addressof(__p->_M_value_field));
+ _M_put_node(__p);
+ }
+
+ protected:
+ template<typename _Key_compare,
+ bool _Is_pod_comparator = __is_pod(_Key_compare)>
+ struct _Rb_tree_impl : public _Node_allocator
+ {
+ _Key_compare _M_key_compare;
+ _Rb_tree_node_base _M_header;
+ size_type _M_node_count;
+
+ private:
+ void
+ _M_initialize()
+ {
+ this->_M_header._M_color = _S_red;
+ this->_M_header._M_parent = 0;
+ this->_M_header._M_left = &this->_M_header;
+ this->_M_header._M_right = &this->_M_header;
+ }
+ };
+
+ _Rb_tree_impl<_Compare> _M_impl;
+
+ protected:
+
+ _Link_type
+ _M_begin()
+ { return static_cast<_Link_type>(this->_M_impl._M_header._M_parent); }
+
+ _Link_type
+ _M_end()
+ { return static_cast<_Link_type>(&this->_M_impl._M_header); }
+
+ static _Link_type
+ _S_left(_Base_ptr __x)
+ { return static_cast<_Link_type>(__x->_M_left); }
+
+ static _Link_type
+ _S_right(_Base_ptr __x)
+ { return static_cast<_Link_type>(__x->_M_right); }
+
+ static const_reference
+ _S_value(_Const_Base_ptr __x)
+ { return static_cast<_Const_Link_type>(__x)->_M_value_field; }
+
+ static const _Key&
+ _S_key(_Const_Base_ptr __x)
+ { return _KeyOfValue()(_S_value(__x)); }
+
+ public:
+ typedef _Rb_tree_iterator<value_type> iterator;
+ typedef _Rb_tree_const_iterator<value_type> const_iterator;
+
+ private:
+
+ void
+ _M_erase(_Link_type __x);
+
+ iterator
+ _M_lower_bound(_Link_type __x, _Link_type __y,
+ const _Key& __k);
+
+ const_iterator
+ _M_lower_bound(_Const_Link_type __x, _Const_Link_type __y,
+ const _Key& __k) const;
+
+ public:
+
+ ~_Rb_tree()
+ { _M_erase(_M_begin()); }
+
+ iterator
+ end()
+ { return iterator(static_cast<_Link_type>(&this->_M_impl._M_header)); }
+
+ const_iterator
+ end() const
+ {
+ return const_iterator(static_cast<_Const_Link_type>
+ (&this->_M_impl._M_header));
+ }
+
+ public:
+ iterator
+ find(const key_type& __k);
+ };
+
+ template<typename _Key, typename _Val, typename _KeyOfValue,
+ typename _Compare, typename _Alloc>
+ void
+ _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
+ _M_erase(_Link_type __x)
+ {
+
+ while (__x != 0)
+ {
+ _M_erase(_S_right(__x));
+ _Link_type __y = _S_left(__x);
+ _M_destroy_node(__x);
+ __x = __y;
+ }
+ }
+
+ template<typename _Key, typename _Val, typename _KeyOfValue,
+ typename _Compare, typename _Alloc>
+ typename _Rb_tree<_Key, _Val, _KeyOfValue,
+ _Compare, _Alloc>::iterator
+ _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
+ _M_lower_bound(_Link_type __x, _Link_type __y,
+ const _Key& __k)
+ {
+ while (__x != 0)
+ if (!_M_impl._M_key_compare(_S_key(__x), __k))
+ __y = __x, __x = _S_left(__x);
+ else
+ __x = _S_right(__x);
+ return iterator(__y);
+ }
+
+ template<typename _Key, typename _Val, typename _KeyOfValue,
+ typename _Compare, typename _Alloc>
+ typename _Rb_tree<_Key, _Val, _KeyOfValue,
+ _Compare, _Alloc>::iterator
+ _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
+ find(const _Key& __k)
+ {
+ iterator __j = _M_lower_bound(_M_begin(), _M_end(), __k);
+ return (__j == end()
+ || _M_impl._M_key_compare(__k,
+ _S_key(__j._M_node))) ? end() : __j;
+ }
+
+}
+
+namespace std {
+ template <typename _Key, typename _Tp, typename _Compare = std::less<_Key>,
+ typename _Alloc = std::allocator<std::pair<const _Key, _Tp> > >
+ class map
+ {
+ public:
+ typedef _Key key_type;
+ typedef _Tp mapped_type;
+ typedef std::pair<const _Key, _Tp> value_type;
+ typedef _Compare key_compare;
+ typedef _Alloc allocator_type;
+
+ private:
+
+ typedef typename _Alloc::template rebind<value_type>::other
+ _Pair_alloc_type;
+
+ typedef _Rb_tree<key_type, value_type, _Select1st<value_type>,
+ key_compare, _Pair_alloc_type> _Rep_type;
+
+ _Rep_type _M_t;
+
+ public:
+
+ typedef typename _Rep_type::iterator iterator;
+ typedef typename _Rep_type::const_iterator const_iterator;
+
+ map()
+ : _M_t() { }
+
+ const_iterator
+ end() const
+ { return _M_t.end(); }
+
+ key_compare
+ key_comp() const
+ { return _M_t.key_comp(); }
+
+ iterator
+ find(const key_type& __x)
+ { return _M_t.find(__x); }
+ };
+}
+
+int main ()
+{
+ typedef std::map<int, std::string> Map;
+ static Map m;
+
+ Map::const_iterator it = m.find(0);
+ if (it != m.end())
+ std::string s = it->second;
+
+ return 0;
+}
+
diff --git a/gcc/testsuite/g++.dg/opt/devirt1.C b/gcc/testsuite/g++.dg/opt/devirt1.C
index 617db050434..0a825c2a590 100644
--- a/gcc/testsuite/g++.dg/opt/devirt1.C
+++ b/gcc/testsuite/g++.dg/opt/devirt1.C
@@ -1,6 +1,6 @@
// { dg-do compile }
// { dg-options "-O" }
-// { dg-final { scan-assembler "xyzzy" } }
+// { dg-final { scan-assembler "xyzzy" { xfail *-*-* } } }
struct S { S(); virtual void xyzzy(); };
inline void foo(S *s) { s->xyzzy(); }
diff --git a/gcc/testsuite/g++.dg/opt/inline17.C b/gcc/testsuite/g++.dg/opt/inline17.C
new file mode 100644
index 00000000000..a42233d57b6
--- /dev/null
+++ b/gcc/testsuite/g++.dg/opt/inline17.C
@@ -0,0 +1,80 @@
+// PR tree-optimization/47420
+// Testcase by Yu Simin <silver24k@gmail.com>
+
+// { dg-do compile }
+// { dg-options "-O2" }
+
+class fooControlBase
+{
+public:
+ fooControlBase() { }
+
+ virtual ~fooControlBase();
+};
+
+class fooControl : public fooControlBase
+{
+public:
+ fooControl() { }
+};
+
+class sfTextEntryBase
+{
+public:
+ sfTextEntryBase() { }
+ virtual ~sfTextEntryBase();
+};
+
+class sfTextEntry : public sfTextEntryBase
+{
+public:
+ sfTextEntry()
+ {
+ }
+};
+
+class sfTextAreaBase
+{
+public:
+ sfTextAreaBase() { }
+ virtual ~sfTextAreaBase() { }
+
+protected:
+};
+
+
+class sfTextCtrlBase : public fooControl,
+ public sfTextAreaBase,
+ public sfTextEntry
+{
+public:
+
+
+
+ sfTextCtrlBase() { }
+ virtual ~sfTextCtrlBase() { }
+};
+
+class sfTextCtrl : public sfTextCtrlBase
+{
+public:
+ sfTextCtrl(void* parent)
+ {
+ Create(parent);
+ }
+ virtual ~sfTextCtrl();
+
+ bool Create(void *parent);
+
+
+};
+
+sfTextCtrl* CreateTextCtrl()
+{
+ return new sfTextCtrl(0);
+}
+
+void foo ()
+{
+ new sfTextCtrl(0);
+}
diff --git a/gcc/testsuite/g++.dg/opt/pr19650.C b/gcc/testsuite/g++.dg/opt/pr19650.C
index 96cbd8ad80d..1f495cb7d3c 100644
--- a/gcc/testsuite/g++.dg/opt/pr19650.C
+++ b/gcc/testsuite/g++.dg/opt/pr19650.C
@@ -1,5 +1,5 @@
// { dg-options "-O1 -w -fpermissive" }
-// { dg-do "run" }
+// { dg-do run }
// Tests the fold bug described in PR 19650.
#include <stdio.h>
#include <stdlib.h>
diff --git a/gcc/testsuite/g++.dg/opt/pr47355.C b/gcc/testsuite/g++.dg/opt/pr47355.C
new file mode 100644
index 00000000000..4fdbd9f5926
--- /dev/null
+++ b/gcc/testsuite/g++.dg/opt/pr47355.C
@@ -0,0 +1,39 @@
+// PR tree-optimization/47355
+// { dg-do compile }
+// { dg-options "-O -fipa-cp -fipa-cp-clone" }
+
+struct T
+{
+ T ();
+ void *p;
+ ~T ();
+};
+
+void foo (T *i);
+
+T *bar ();
+void baz (T *);
+
+struct V
+{
+ long q;
+ T *r;
+ ~V ()
+ {
+ while (q)
+ {
+ foo (r);
+ ++r;
+ --q;
+ }
+ baz (r);
+ }
+};
+
+void
+foo ()
+{
+ V v;
+ T t;
+ v.r = bar ();
+}
diff --git a/gcc/testsuite/g++.dg/opt/pr47366.C b/gcc/testsuite/g++.dg/opt/pr47366.C
new file mode 100644
index 00000000000..e133edfbf1b
--- /dev/null
+++ b/gcc/testsuite/g++.dg/opt/pr47366.C
@@ -0,0 +1,22 @@
+// PR rtl-optimization/47366
+// { dg-do compile }
+// { dg-options "-O -fnon-call-exceptions -fno-tree-ccp -fno-tree-forwprop" }
+
+struct A
+{
+ int i;
+ virtual ~A ();
+};
+
+struct B : virtual A
+{};
+
+struct C : B
+{
+ void bar () {}
+};
+
+void foo ()
+{
+ C ().bar ();
+}
diff --git a/gcc/testsuite/g++.dg/opt/pr47615.C b/gcc/testsuite/g++.dg/opt/pr47615.C
new file mode 100644
index 00000000000..bbbcbe1e47f
--- /dev/null
+++ b/gcc/testsuite/g++.dg/opt/pr47615.C
@@ -0,0 +1,711 @@
+// { dg-do compile }
+// { dg-options "-O -fstrict-aliasing -ftree-pre -fno-tree-fre -fno-tree-sra" }
+
+typedef __SIZE_TYPE__ size_t;
+namespace std
+{
+ template < class _T1, class > struct pair
+ {
+ _T1 first;
+ };
+}
+namespace __gnu_cxx
+{
+ template < typename _Tp > class new_allocator
+ {
+ public:
+ typedef size_t size_type;
+ typedef _Tp * pointer;
+ typedef _Tp const_pointer;
+ typedef _Tp & reference;
+ typedef const _Tp & const_reference;
+ template < typename _Tp1 > struct rebind
+ {
+ typedef new_allocator < _Tp1 > other;
+ };
+ };
+}
+namespace std
+{
+template < typename _Tp > class allocator:
+ public __gnu_cxx::new_allocator < _Tp >
+ {};
+ template < typename, typename, typename > struct binary_function;
+ template < typename _Tp > struct less:binary_function < _Tp, _Tp, bool >
+ {};
+}
+namespace __gnu_cxx
+{
+ namespace typelist
+ {
+ struct null_type;
+ template < typename Root > struct node
+ {
+ typedef Root root;
+ };
+ template < typename, typename > struct chain;
+ namespace detail
+ {
+ template < typename, int >struct chain_at_index_;
+ template
+ <
+ typename
+ Hd, typename Tl > struct chain_at_index_ <chain < Hd, Tl >, 0 >
+ {
+ typedef Hd type;
+ };
+ template
+ <
+ typename
+ Hd, typename Tl, int i > struct chain_at_index_ <chain < Hd, Tl >, i >
+ {
+ typedef typename chain_at_index_ < Tl, i - 1 >::type type;
+ };
+ }
+ template < typename Typelist, int i > struct at_index
+ {
+ typedef typename Typelist::root root_type;
+ typedef detail::chain_at_index_ < root_type, i > index_type;
+ typedef typename index_type::type type;
+ };
+ template < typename T1, typename T2 > struct create2
+ {
+ typedef node < chain < T1, chain < T2, null_type > > >type;
+ };
+ }
+}
+namespace std
+{
+ namespace tr1
+ {
+ template < typename _Tp, _Tp __v > struct integral_constant
+ {
+ static const _Tp value = __v;
+ };
+ typedef integral_constant < bool, false > false_type;
+ template < typename, typename > struct is_same:false_type
+ {};
+ }
+}
+using std::tr1::is_same;
+namespace __gnu_pbds
+{
+ struct null_mapped_type;
+ struct rb_tree_tag;
+ namespace detail
+ {
+ template < typename, typename, typename > struct basic_tree_policy_base;
+ template
+ <
+ typename
+ Const_Node_Iterator,
+ typename
+ Allocator
+ >
+ struct
+ basic_tree_policy_base
+ <Const_Node_Iterator, Const_Node_Iterator, Allocator >
+ {};
+ }
+ template
+ < typename, typename, typename, typename > struct null_tree_node_update;
+template < typename Const_Node_Iterator, typename Node_Iterator, typename, typename Allocator > class tree_order_statistics_node_update:
+ detail::basic_tree_policy_base
+ < Const_Node_Iterator, Node_Iterator, Allocator >
+ {
+ public:
+ typedef Allocator allocator_type;
+ typedef typename allocator_type::size_type size_type;
+ typedef size_type metadata_type;
+ typedef Const_Node_Iterator const_node_iterator;
+ typedef Node_Iterator node_iterator;
+ typedef
+ typename
+ allocator_type::template
+ rebind < metadata_type >::other::reference metadata_reference;
+ void operator () (node_iterator, const_node_iterator) const;
+ };
+ template
+ <
+ typename
+ Const_Node_Iterator,
+ class
+ Node_Iterator,
+ class
+ Cmp_Fn,
+ class
+ Allocator
+ >
+ inline
+ void
+ tree_order_statistics_node_update
+ <
+ Const_Node_Iterator,
+ Node_Iterator,
+ Cmp_Fn,
+ Allocator
+ >::operator
+ () (node_iterator node_it, const_node_iterator end_nd_it) const
+ {
+ node_iterator l_child_it;
+ size_type
+ l_rank = (l_child_it == end_nd_it) ? : l_child_it.get_metadata ();
+ node_iterator r_child_it = node_it.get_r_child ();
+ size_type
+ r_rank = (r_child_it == end_nd_it) ? : r_child_it.get_metadata ();
+ const_cast
+ < metadata_reference > (node_it.get_metadata ()) = l_rank + r_rank;
+ }
+ namespace
+ {
+ template < typename, typename, typename, bool > struct value_type_base;
+ template
+ <
+ typename
+ Key,
+ typename
+ Allocator
+ > struct value_type_base <Key, null_mapped_type, Allocator, false >
+ {
+ typedef Key value_type;
+ typedef
+ typename
+ Allocator::template rebind < value_type >::other value_type_allocator;
+ typedef typename value_type_allocator::pointer pointer;
+ typedef typename value_type_allocator::const_pointer const_pointer;
+ typedef typename value_type_allocator::reference reference;
+ typedef typename value_type_allocator::const_reference const_reference;
+ };
+ template
+ <
+ typename
+ Key,
+ typename
+ Mapped, typename Alloc, bool Store_Extra > struct vt_base_selector
+ {
+ typedef value_type_base < Key, Mapped, Alloc, Store_Extra > type;
+ };
+ template
+ <
+ typename
+ Key,
+ typename
+ Mapped,
+ typename
+ Alloc,
+ bool
+ Store_Extra
+ >
+ struct
+ types_traits:vt_base_selector < Key, Mapped, Alloc, Store_Extra >::type
+ {};
+ template < typename, class, class > struct dumconst_node_iterator;
+ template
+ <
+ typename
+ Key,
+ typename
+ Mapped,
+ class,
+ class
+ Node_And_It_Traits, class Allocator > class bin_search_tree_no_data_
+ {
+ protected:
+ typedef
+ typename
+ Allocator::template
+ rebind
+ < typename Node_And_It_Traits::node >::other::pointer node_pointer;
+ typedef
+ typename
+ types_traits
+ < Key, Mapped, Allocator, false >::const_reference const_reference;
+ typedef typename Node_And_It_Traits::point_iterator point_iterator;
+ typedef typename Node_And_It_Traits::node_update node_update;
+ void rotate_right (node_pointer);
+ template
+ <
+ typename
+ Node_Update_ > void apply_update (node_pointer, Node_Update_ *);
+ };
+ template
+ <
+ typename
+ Key,
+ typename
+ Mapped,
+ class
+ Cmp_Fn,
+ class
+ Node_And_It_Traits,
+ class
+ Allocator
+ >
+ void
+ bin_search_tree_no_data_
+ <
+ Key,
+ Mapped,
+ Cmp_Fn, Node_And_It_Traits, Allocator >::rotate_right (node_pointer p_x)
+ {
+ node_pointer p_y = p_x->m_p_parent;
+ p_y->m_p_right = p_x;
+ apply_update (p_x, this);
+ apply_update (p_x->m_p_parent, (node_update *) this);
+ }
+ template
+ <
+ typename
+ Key,
+ typename
+ Mapped,
+ class
+ Cmp_Fn,
+ class
+ Node_And_It_Traits,
+ class
+ Allocator
+ >
+ template
+ <
+ typename
+ Node_Update_
+ >
+ void
+ bin_search_tree_no_data_
+ <
+ Key,
+ Mapped,
+ Cmp_Fn,
+ Node_And_It_Traits,
+ Allocator >::apply_update (node_pointer p_nd, Node_Update_ *)
+ {
+ node_update ()((p_nd), ((0)));
+ }
+ }
+ namespace detail
+ {
+ template < typename Key, typename Mapped, typename Cmp_Fn, typename Node_And_It_Traits, typename Allocator > class rb_tree_no_data_:
+ bin_search_tree_no_data_
+ < Key, Mapped, Cmp_Fn, Node_And_It_Traits, Allocator >
+ {
+ typedef
+ bin_search_tree_no_data_
+ < Key, Mapped, Cmp_Fn, Node_And_It_Traits, Allocator > base_type;
+ typedef typename base_type::node_pointer node_pointer;
+ public:
+ typedef typename base_type::const_reference const_reference;
+ typedef typename base_type::point_iterator point_iterator;
+ std::pair < point_iterator, bool > insert (const_reference);
+ void insert_fixup (node_pointer);
+ };
+ template
+ <
+ typename
+ Key,
+ typename
+ Mapped,
+ typename
+ Cmp_Fn,
+ typename
+ Node_And_It_Traits,
+ typename
+ Allocator
+ >
+ std::pair
+ <
+ typename
+ rb_tree_no_data_
+ <
+ Key,
+ Mapped,
+ Cmp_Fn,
+ Node_And_It_Traits,
+ Allocator
+ >::point_iterator,
+ bool
+ >
+ rb_tree_no_data_
+ <
+ Key,
+ Mapped,
+ Cmp_Fn, Node_And_It_Traits, Allocator >::insert (const_reference)
+ {
+ std::pair < point_iterator, bool > ins_pair;
+{
+ insert_fixup (ins_pair.first.m_p_nd);
+ }
+ }
+ template
+ <
+ typename
+ Key,
+ typename
+ Mapped,
+ typename
+ Cmp_Fn,
+ typename
+ Node_And_It_Traits,
+ typename
+ Allocator
+ >
+ void
+ rb_tree_no_data_
+ <
+ Key,
+ Mapped,
+ Cmp_Fn,
+ Node_And_It_Traits, Allocator >::insert_fixup (node_pointer p_nd)
+ {
+{
+{
+{
+ rotate_right (p_nd);
+ }
+ }
+ }
+ }
+ template
+ <
+ typename,
+ typename, typename, typename, typename > struct container_base_dispatch;
+ template
+ <
+ typename
+ Key,
+ typename
+ Policy_Tl,
+ typename
+ Alloc
+ >
+ struct
+ container_base_dispatch
+ <Key, null_mapped_type, rb_tree_tag, Policy_Tl, Alloc >
+ {
+ typedef __gnu_cxx::typelist::at_index < Policy_Tl, 0 > at0;
+ typedef typename at0::type at0t;
+ typedef __gnu_cxx::typelist::at_index < Policy_Tl, 1 > at1;
+ typedef typename at1::type at1t;
+ typedef
+ rb_tree_no_data_ < Key, null_mapped_type, at0t, at1t, Alloc > type;
+ };
+ template
+ <
+ typename
+ Node_Pointer,
+ typename,
+ typename,
+ typename,
+ typename, typename, bool, class > class bin_search_tree_const_it_
+ {
+ public:
+ Node_Pointer m_p_nd;
+ };
+ template
+ <
+ typename
+ Node,
+ class
+ Const_Iterator,
+ class Iterator, class Allocator > class bin_search_tree_const_node_it_
+ {
+ typedef
+ typename
+ Allocator::template rebind < Node >::other::pointer node_pointer;
+ public:
+ typedef typename Node::metadata_type metadata_type;
+ typedef
+ typename
+ Allocator::template
+ rebind
+ < metadata_type >::other::const_reference const_metadata_reference;
+ bin_search_tree_const_node_it_ (node_pointer p_nd):
+ m_p_nd ((p_nd))
+ {}
+ const_metadata_reference get_metadata ()
+ {
+ return (m_p_nd->get_metadata ());
+ }
+ bin_search_tree_const_node_it_ ()
+ {}
+ bin_search_tree_const_node_it_
+ < Node, Const_Iterator, Iterator, Allocator > get_r_child ()
+ {
+ return ((m_p_nd->m_p_right));
+ }
+ bool operator == (bin_search_tree_const_node_it_)
+ {}
+ node_pointer m_p_nd;
+ };
+ template
+ <
+ typename,
+ typename,
+ class,
+ template
+ <
+ typename,
+ class,
+ class, class > class, class, class > struct bin_search_tree_traits;
+ template
+ <
+ typename
+ Key,
+ class
+ Cmp_Fn,
+ template
+ <
+ typename,
+ class,
+ class,
+ class
+ >
+ class
+ Node_Update,
+ class
+ Node,
+ class
+ Allocator
+ >
+ struct
+ bin_search_tree_traits
+ <Key, null_mapped_type, Cmp_Fn, Node_Update, Node, Allocator >
+ {
+ typedef
+ types_traits < Key, null_mapped_type, Allocator, false > type_traits;
+ typedef Node node;
+ typedef
+ bin_search_tree_const_it_
+ <
+ typename
+ Allocator::template
+ rebind
+ <
+ node
+ >::other::pointer,
+ typename
+ type_traits::value_type,
+ typename
+ type_traits::pointer,
+ typename
+ type_traits::const_pointer,
+ typename
+ type_traits::reference,
+ typename
+ type_traits::const_reference, true, Allocator > const_point_iterator;
+ typedef const_point_iterator point_iterator;
+ typedef
+ bin_search_tree_const_node_it_
+ <
+ Node,
+ const_point_iterator, point_iterator, Allocator > const_node_iterator;
+ typedef const_node_iterator node_iterator;
+ typedef
+ Node_Update
+ < const_node_iterator, node_iterator, Cmp_Fn, Allocator > node_update;
+ };
+ template < typename Node_Update, bool > struct tree_metadata_helper
+ {
+ typedef typename Node_Update::metadata_type type;
+ };
+ template
+ <
+ typename
+ Key,
+ typename
+ Data,
+ class
+ Cmp_Fn,
+ template
+ <
+ typename,
+ class,
+ class,
+ class
+ >
+ class Node_Update, class Allocator > struct tree_node_metadata_selector
+ {
+ typedef
+ dumconst_node_iterator < Key, Data, Allocator > dumconst_node_it;
+ enum
+ {
+ null_update = is_same < Node_Update < dumconst_node_it,
+ dumconst_node_it,
+ Cmp_Fn,
+ Allocator >,
+ null_tree_node_update < dumconst_node_it,
+ dumconst_node_it,
+ Cmp_Fn,
+ Allocator > >::value
+ };
+ typedef
+ typename
+ tree_metadata_helper
+ <
+ Node_Update
+ <
+ dumconst_node_it,
+ dumconst_node_it, Cmp_Fn, Allocator >, null_update >::type type;
+ };
+ template
+ <
+ typename,
+ typename,
+ class,
+ template
+ <
+ typename,
+ class, class, class > class, class, class > struct tree_traits;
+ template < typename Value_Type, class Metadata, class Allocator > struct rb_tree_node_
+ {
+ typedef Metadata metadata_type;
+ typedef
+ typename
+ Allocator::template
+ rebind
+ <
+ rb_tree_node_
+ < Value_Type, Metadata, Allocator > >::other::pointer node_pointer;
+ typedef
+ typename
+ Allocator::template
+ rebind < metadata_type >::other::reference metadata_reference;
+ metadata_reference get_metadata ()
+ {
+ return m_metadata;
+ }
+ node_pointer m_p_right;
+ node_pointer m_p_parent;
+ metadata_type m_metadata;
+ };
+ template
+ <
+ typename
+ Key,
+ typename
+ Mapped,
+ typename
+ Cmp_Fn,
+ template
+ <
+ typename,
+ class,
+ class,
+ class
+ >
+ class
+ Node_Update,
+ typename
+ Allocator
+ >
+ struct
+ tree_traits
+ <Key,
+ Mapped,
+ Cmp_Fn,
+ Node_Update,
+ rb_tree_tag,
+ Allocator
+ >:bin_search_tree_traits
+ <
+ Key,
+ Mapped,
+ Cmp_Fn,
+ Node_Update,
+ rb_tree_node_
+ <
+ typename
+ types_traits
+ <
+ Key,
+ Mapped,
+ Allocator,
+ false
+ >::value_type,
+ typename
+ tree_node_metadata_selector
+ <
+ Key,
+ Mapped, Cmp_Fn, Node_Update, Allocator >::type, Allocator >, Allocator >
+ {};
+ }
+template < typename Key, typename Mapped, typename Tag, typename Policy_Tl, typename Allocator > class container_base:
+ public
+ detail::container_base_dispatch
+ < Key, Mapped, Tag, Policy_Tl, Allocator >::type
+ {};
+template < typename Key, typename Mapped, typename Tag, typename, typename Policy_Tl, typename Allocator > class basic_tree:
+ public
+ container_base < Key, Mapped, Tag, Policy_Tl, Allocator >
+ {};
+ template
+ <
+ typename
+ Key,
+ typename
+ Mapped,
+ typename
+ Cmp_Fn
+ =
+ std::less
+ <
+ Key
+ >,
+ typename
+ Tag
+ =
+ rb_tree_tag,
+ template
+ <
+ typename,
+ typename,
+ typename,
+ typename
+ >
+ class
+ Node_Update
+ =
+ null_tree_node_update,
+ typename
+ Allocator
+ =
+ std::allocator
+ <
+ char
+ > >class
+ tree:public
+ basic_tree
+ <
+ Key,
+ Mapped,
+ Tag,
+ detail::tree_traits
+ <
+ Key,
+ Mapped,
+ Cmp_Fn,
+ Node_Update,
+ Tag,
+ Allocator
+ >,
+ typename
+ __gnu_cxx::typelist::create2
+ <
+ Cmp_Fn,
+ detail::tree_traits
+ < Key, Mapped, Cmp_Fn, Node_Update, Tag, Allocator > >::type, Allocator >
+ {};
+}
+using namespace std;
+using namespace __gnu_pbds;
+typedef
+ tree
+ <
+ int,
+ null_mapped_type,
+ less < int >, rb_tree_tag, tree_order_statistics_node_update > set_t;
+main ()
+{
+ set_t s;
+ s.insert (12);
+}
diff --git a/gcc/testsuite/g++.dg/opt/pr47632.C b/gcc/testsuite/g++.dg/opt/pr47632.C
new file mode 100644
index 00000000000..4b0572a6171
--- /dev/null
+++ b/gcc/testsuite/g++.dg/opt/pr47632.C
@@ -0,0 +1,18 @@
+// { dg-do compile }
+// { dg-options "-O -fnon-call-exceptions -ftrapv" }
+
+template < typename > struct S
+{
+ int n;
+ void bar ()
+ {
+ int *i = new int[n];
+ }
+};
+
+void
+foo (S < char >*s)
+{
+ s->bar ();
+}
+
diff --git a/gcc/testsuite/g++.dg/opt/pr47639.c b/gcc/testsuite/g++.dg/opt/pr47639.c
new file mode 100644
index 00000000000..6ee8bb7dee4
--- /dev/null
+++ b/gcc/testsuite/g++.dg/opt/pr47639.c
@@ -0,0 +1,17 @@
+// { dg-do compile }
+// { dg-options "-fnon-call-exceptions" }
+
+typedef int __attribute__ ((vector_size (8))) vec;
+
+vec foo (vec v1, vec v2)
+{
+ try
+ {
+ return v1 / v2;
+ }
+ catch (...)
+ {
+ throw;
+ }
+}
+
diff --git a/gcc/testsuite/g++.dg/other/anon5.C b/gcc/testsuite/g++.dg/other/anon5.C
index 3f50db14036..e8ebe0cc2b4 100644
--- a/gcc/testsuite/g++.dg/other/anon5.C
+++ b/gcc/testsuite/g++.dg/other/anon5.C
@@ -1,5 +1,5 @@
// PR c++/34094
-// { dg-do link { target { ! { *-*-darwin* *-*-hpux* *-*-solaris2.* alpha*-dec-osf* } } } }
+// { dg-do link { target { ! { *-*-darwin* *-*-hpux* *-*-solaris2.* alpha*-dec-osf* mips-sgi-irix* } } } }
// { dg-options "-g" }
namespace {
diff --git a/gcc/testsuite/g++.dg/other/default2.C b/gcc/testsuite/g++.dg/other/default2.C
index be0e5c32413..51534b8876d 100644
--- a/gcc/testsuite/g++.dg/other/default2.C
+++ b/gcc/testsuite/g++.dg/other/default2.C
@@ -1,5 +1,5 @@
// PR c++/16829
-// { dg-do "compile" }
+// { dg-do compile }
template<typename T> void foo(T, int = 0, int) {} // { dg-error "default" }
diff --git a/gcc/testsuite/g++.dg/other/default3.C b/gcc/testsuite/g++.dg/other/default3.C
index 559cb11265d..42c1fe48922 100644
--- a/gcc/testsuite/g++.dg/other/default3.C
+++ b/gcc/testsuite/g++.dg/other/default3.C
@@ -1,5 +1,5 @@
// PR c++/16829
-// { dg-do "compile" }
+// { dg-do compile }
void f1(int = 0, int); // { dg-error "default" }
diff --git a/gcc/testsuite/g++.dg/other/default5.C b/gcc/testsuite/g++.dg/other/default5.C
index ad7eb01298c..d5bae344c44 100644
--- a/gcc/testsuite/g++.dg/other/default5.C
+++ b/gcc/testsuite/g++.dg/other/default5.C
@@ -1,5 +1,5 @@
// PR c++/28274
-// { dg-do "compile" }
+// { dg-do compile }
void f1(int, int, int, int, int = 0);
void f1(int, int, int, int = 0, int);
diff --git a/gcc/testsuite/g++.dg/other/dtor2.C b/gcc/testsuite/g++.dg/other/dtor2.C
index 459339126eb..fb673d808a1 100644
--- a/gcc/testsuite/g++.dg/other/dtor2.C
+++ b/gcc/testsuite/g++.dg/other/dtor2.C
@@ -1,5 +1,5 @@
/* PR c++/35317 */
-/* { dg-do "compile" } */
+/* { dg-do compile } */
struct A
{
diff --git a/gcc/testsuite/g++.dg/other/friend5.C b/gcc/testsuite/g++.dg/other/friend5.C
index 45bbf272ecd..b0ec201fb38 100644
--- a/gcc/testsuite/g++.dg/other/friend5.C
+++ b/gcc/testsuite/g++.dg/other/friend5.C
@@ -1,7 +1,7 @@
/* PR c++/32111 */
/* This used to ICE. */
-/* { dg-do "compile" } */
+/* { dg-do compile } */
struct A
{
diff --git a/gcc/testsuite/g++.dg/other/pr47218.C b/gcc/testsuite/g++.dg/other/pr47218.C
index 3056795a5fb..f94e15742eb 100644
--- a/gcc/testsuite/g++.dg/other/pr47218.C
+++ b/gcc/testsuite/g++.dg/other/pr47218.C
@@ -1,5 +1,5 @@
/* { dg-do link } */
-/* { dg-options "--save-temps" } */
+/* { dg-options "-save-temps" } */
/* { dg-additional-sources "pr47218-1.C" } */
#include "pr47218.h"
@@ -17,3 +17,5 @@ int main ()
{
return 0;
}
+
+// { dg-final cleanup-saved-temps }
diff --git a/gcc/testsuite/g++.dg/other/warning1.C b/gcc/testsuite/g++.dg/other/warning1.C
index a5cce6ce041..77653a1df13 100644
--- a/gcc/testsuite/g++.dg/other/warning1.C
+++ b/gcc/testsuite/g++.dg/other/warning1.C
@@ -13,6 +13,7 @@ struct S
int main()
{
+ // { dg-prune-output "not a member" }
printf("%f\n%f\n", S::inf, S::nan);
return 0;
}
diff --git a/gcc/testsuite/g++.dg/overload/conv-op1.C b/gcc/testsuite/g++.dg/overload/conv-op1.C
new file mode 100644
index 00000000000..6a63cbaeb87
--- /dev/null
+++ b/gcc/testsuite/g++.dg/overload/conv-op1.C
@@ -0,0 +1,17 @@
+// PR c++/47703
+
+typedef void (*pfn)(int &);
+
+struct A
+{
+ operator pfn() { return 0; }
+};
+
+void f()
+{
+ const int i = 42;
+ A()(i); // { dg-message "<conversion>" }
+}
+
+// { dg-prune-output "no match" }
+// { dg-prune-output "candidate" }
diff --git a/gcc/testsuite/g++.dg/overload/defarg4.C b/gcc/testsuite/g++.dg/overload/defarg4.C
index 198f9b28f32..3fa0751b7c0 100644
--- a/gcc/testsuite/g++.dg/overload/defarg4.C
+++ b/gcc/testsuite/g++.dg/overload/defarg4.C
@@ -1,6 +1,6 @@
// Contributed by Dodji Seketeli <dodji@redhat.com>
// Origin PR c++/39987
-// { dg-do "compile" }
+// { dg-do compile }
class foo
{
diff --git a/gcc/testsuite/g++.dg/parse/bitfield3.C b/gcc/testsuite/g++.dg/parse/bitfield3.C
index d907dcdd19b..387548a6827 100644
--- a/gcc/testsuite/g++.dg/parse/bitfield3.C
+++ b/gcc/testsuite/g++.dg/parse/bitfield3.C
@@ -1,5 +1,5 @@
/* PR c++/35320 */
-/* { dg-do "compile" } */
+/* { dg-do compile } */
typedef void (func_type)();
diff --git a/gcc/testsuite/g++.dg/parse/constant1.C b/gcc/testsuite/g++.dg/parse/constant1.C
index 0a889289b72..c8a948a5760 100644
--- a/gcc/testsuite/g++.dg/parse/constant1.C
+++ b/gcc/testsuite/g++.dg/parse/constant1.C
@@ -1,3 +1,5 @@
+// { dg-options -std=c++98 }
+
void f () {
switch (0) {
case (3, 0): // { dg-error "" }
diff --git a/gcc/testsuite/g++.dg/parse/constant5.C b/gcc/testsuite/g++.dg/parse/constant5.C
index db11afb51b2..f868108a644 100644
--- a/gcc/testsuite/g++.dg/parse/constant5.C
+++ b/gcc/testsuite/g++.dg/parse/constant5.C
@@ -1,3 +1,5 @@
+// { dg-options "-std=c++98 -pedantic-errors" }
+
enum E {
a = 24.2, // { dg-error "constant" }
b = (int)3.7,
diff --git a/gcc/testsuite/g++.dg/parse/constructor3.C b/gcc/testsuite/g++.dg/parse/constructor3.C
index 9a2e9783e3d..fe741c833b2 100644
--- a/gcc/testsuite/g++.dg/parse/constructor3.C
+++ b/gcc/testsuite/g++.dg/parse/constructor3.C
@@ -1,5 +1,5 @@
/* PR c++/29077 */
-/* { dg-do "compile" } */
+/* { dg-do compile } */
class c {
c();
diff --git a/gcc/testsuite/g++.dg/parse/crash31.C b/gcc/testsuite/g++.dg/parse/crash31.C
index 0068846755b..b0a7e1877ce 100644
--- a/gcc/testsuite/g++.dg/parse/crash31.C
+++ b/gcc/testsuite/g++.dg/parse/crash31.C
@@ -3,7 +3,7 @@ struct A // { dg-error "forward declaration" }
A : A; // { dg-error "expected|incomplete" }
A : B; // { dg-error "not declared|incomplete" }
A : A(); // { dg-error "undefined type|incomplete" }
- A : B(); // { dg-error "function call|incomplete" }
+ A : B(); // { dg-error "function call|incomplete|not declared" }
A : A[]; // { dg-error "expected|array reference|incomplete" }
A : B[]; // { dg-error "not declared|expected|array reference|incomplete" }
};
diff --git a/gcc/testsuite/g++.dg/parse/crash34.C b/gcc/testsuite/g++.dg/parse/crash34.C
index e2517a5e20c..181e5841747 100644
--- a/gcc/testsuite/g++.dg/parse/crash34.C
+++ b/gcc/testsuite/g++.dg/parse/crash34.C
@@ -1,5 +1,5 @@
/* PR c++/31745 */
-/* { dg-do "compile" } */
+/* { dg-do compile } */
void foo()
{
diff --git a/gcc/testsuite/g++.dg/parse/crash35.C b/gcc/testsuite/g++.dg/parse/crash35.C
index a0448af5ed6..4937cdc66e7 100644
--- a/gcc/testsuite/g++.dg/parse/crash35.C
+++ b/gcc/testsuite/g++.dg/parse/crash35.C
@@ -1,5 +1,5 @@
/* This used to ICE. */
-/* { dg-do "compile" } */
+/* { dg-do compile } */
struct a {};
diff --git a/gcc/testsuite/g++.dg/parse/crash40.C b/gcc/testsuite/g++.dg/parse/crash40.C
index 6a15228c063..410c2111eaa 100644
--- a/gcc/testsuite/g++.dg/parse/crash40.C
+++ b/gcc/testsuite/g++.dg/parse/crash40.C
@@ -1,5 +1,5 @@
/* PR c++/34059 */
-/* { dg-do "compile" } */
+/* { dg-do compile } */
struct A
{
diff --git a/gcc/testsuite/g++.dg/parse/crash56.C b/gcc/testsuite/g++.dg/parse/crash56.C
index a554babe99f..9a370cb5fcd 100644
--- a/gcc/testsuite/g++.dg/parse/crash56.C
+++ b/gcc/testsuite/g++.dg/parse/crash56.C
@@ -1,5 +1,5 @@
/* PR c++/43081 */
-/* { dg-do "compile" } */
+/* { dg-do compile } */
/* { dg-options "-std=c++0x" } */
struct A
diff --git a/gcc/testsuite/g++.dg/parse/ctor9.C b/gcc/testsuite/g++.dg/parse/ctor9.C
index b80f7289253..8b2cbf7a643 100644
--- a/gcc/testsuite/g++.dg/parse/ctor9.C
+++ b/gcc/testsuite/g++.dg/parse/ctor9.C
@@ -1,5 +1,5 @@
/* PR c++/37647 */
-/* { dg-do "compile" } */
+/* { dg-do compile } */
struct A
{
diff --git a/gcc/testsuite/g++.dg/parse/defarg12.C b/gcc/testsuite/g++.dg/parse/defarg12.C
index 80ef5c38e1f..2d2d7e7a06a 100644
--- a/gcc/testsuite/g++.dg/parse/defarg12.C
+++ b/gcc/testsuite/g++.dg/parse/defarg12.C
@@ -1,5 +1,5 @@
/* PR28266 This used to ICE in gimple_add_tmp_var */
-/* { dg-do "compile" } */
+/* { dg-do compile } */
struct A
{
diff --git a/gcc/testsuite/g++.dg/parse/dtor13.C b/gcc/testsuite/g++.dg/parse/dtor13.C
index 66cd5f7f34c..96c0d227b04 100644
--- a/gcc/testsuite/g++.dg/parse/dtor13.C
+++ b/gcc/testsuite/g++.dg/parse/dtor13.C
@@ -1,5 +1,5 @@
/* PR c++/34963 This used to ICE */
-/* { dg-do "compile" } */
+/* { dg-do compile } */
struct A
{
diff --git a/gcc/testsuite/g++.dg/parse/error14.C b/gcc/testsuite/g++.dg/parse/error14.C
index 37abe37562a..04f2f56b6dc 100644
--- a/gcc/testsuite/g++.dg/parse/error14.C
+++ b/gcc/testsuite/g++.dg/parse/error14.C
@@ -21,6 +21,6 @@ struct X
}; // { dg-error "2:expected '.' at end of input" "at end of input" }
// { dg-error "1:expected primary-expression before '.' token" "primary" { target *-*-* } 22 }
- // { dg-error "2:expected ';' after struct definition" "semicolon" { target *-*-* } 22 }
+ // { dg-error "1:expected unqualified-id" "unqualified-id" { target *-*-* } 22 }
// { dg-error "1:expected ';' before '.' token" "function" { target *-*-* } 22 }
diff --git a/gcc/testsuite/g++.dg/parse/error2.C b/gcc/testsuite/g++.dg/parse/error2.C
index 619f89421d9..7b08df45466 100644
--- a/gcc/testsuite/g++.dg/parse/error2.C
+++ b/gcc/testsuite/g++.dg/parse/error2.C
@@ -1,5 +1,5 @@
// { dg-do compile }
-// { dg-options "-fshow-column" }
+// { dg-options "-fshow-column -std=c++98" }
// Properly print CALL_EXPRs while dumping expressions
double g;
diff --git a/gcc/testsuite/g++.dg/parse/error32.C b/gcc/testsuite/g++.dg/parse/error32.C
index aad961bcbe3..da27afdda2b 100644
--- a/gcc/testsuite/g++.dg/parse/error32.C
+++ b/gcc/testsuite/g++.dg/parse/error32.C
@@ -1,5 +1,5 @@
/* PR c++/37555 */
-/* { dg-do "compile" } */
+/* { dg-do compile } */
struct A {};
diff --git a/gcc/testsuite/g++.dg/parse/error33.C b/gcc/testsuite/g++.dg/parse/error33.C
index ac18c209812..e3a7166edda 100644
--- a/gcc/testsuite/g++.dg/parse/error33.C
+++ b/gcc/testsuite/g++.dg/parse/error33.C
@@ -1,5 +1,5 @@
/* PR c++/37556 */
-/* { dg-do "compile" } */
+/* { dg-do compile } */
struct A
{
diff --git a/gcc/testsuite/g++.dg/parse/error37.C b/gcc/testsuite/g++.dg/parse/error37.C
index 78617da2b2b..30991264702 100644
--- a/gcc/testsuite/g++.dg/parse/error37.C
+++ b/gcc/testsuite/g++.dg/parse/error37.C
@@ -1,5 +1,5 @@
/* PR c++/42054 */
-/* { dg-do "compile" } */
+/* { dg-do compile } */
template<int int> struct A; /* { dg-error "two or more" } */
template<int int> struct A; /* { dg-error "two or more" } */
diff --git a/gcc/testsuite/g++.dg/parse/parameter-declaration-1.C b/gcc/testsuite/g++.dg/parse/parameter-declaration-1.C
index 58f679944e2..22d6f214d7d 100644
--- a/gcc/testsuite/g++.dg/parse/parameter-declaration-1.C
+++ b/gcc/testsuite/g++.dg/parse/parameter-declaration-1.C
@@ -2,5 +2,5 @@
// Origin: Robert Schiele; PR C++/8799
// { dg-do compile }
-struct { // { dg-error "" }
+struct {
a(void = 0; a(0), a(0) // { dg-error "" "" { target *-*-* } }
diff --git a/gcc/testsuite/g++.dg/parse/semicolon3.C b/gcc/testsuite/g++.dg/parse/semicolon3.C
index a119ef4e0b3..8a2b1ac4630 100644
--- a/gcc/testsuite/g++.dg/parse/semicolon3.C
+++ b/gcc/testsuite/g++.dg/parse/semicolon3.C
@@ -1,5 +1,6 @@
// PR c++/45331
// { dg-do compile }
+// { dg-options -std=c++98 }
struct OK1
{
@@ -62,6 +63,48 @@ autotest (void)
return ok10.a;
}
+struct OK11
+{
+ int a;
+} // no complaints
+ const *ok11_var;
+
+struct OK12
+{
+ int a;
+} // no complaints
+ const &ok12_var = *(new OK12());
+
+struct OK13
+{
+ int a;
+} // no complaints
+ static *ok13_var;
+
+class OK14
+{
+ struct OK14sub
+ {
+ int a;
+ } // no complaints
+ static &ok14_var;
+};
+
+class OK15
+{
+ int a;
+} typedef tOK15;
+
+class OK16
+{
+ int a;
+} typedef *pOK16;
+
+class OK17
+{
+ int a;
+} typedef &rOK16;
+
struct E1
{
int a;
@@ -196,6 +239,13 @@ class E17
mutable int i;
} // { dg-error "after class definition" }
+class E18
+{
+ int a;
+} // { dg-error "after class definition" }
+
+typedef int E18int;
+
/* This was the original test from the PR. */
class C0
diff --git a/gcc/testsuite/g++.dg/parse/semicolon4.C b/gcc/testsuite/g++.dg/parse/semicolon4.C
new file mode 100644
index 00000000000..adba7a873c0
--- /dev/null
+++ b/gcc/testsuite/g++.dg/parse/semicolon4.C
@@ -0,0 +1,37 @@
+// PR c++/46890
+// { dg-do compile }
+
+struct OK1
+{
+ int i;
+} const *ok1_var; // No complains
+
+struct OK2;
+extern OK2 ok2a_var;
+
+struct OK2
+{
+ int i;
+} const &ok2_var = ok2a_var; // No complains
+
+struct OK3
+{
+ int i;
+} volatile (ok3_var); // No complains
+
+struct E1
+{
+ int i;
+} const; // { dg-error "qualifiers can only be specified for objects and functions" }
+
+void foo (
+struct E2
+{ // { dg-error "types may not be defined in parameter types" }
+ int i;
+} volatile);
+
+void bar (
+struct E3
+{ // { dg-error "types may not be defined in parameter types" }
+ int i;
+} const, int);
diff --git a/gcc/testsuite/g++.dg/parse/struct-4.C b/gcc/testsuite/g++.dg/parse/struct-4.C
index 559411a19cf..6d01f3e88aa 100644
--- a/gcc/testsuite/g++.dg/parse/struct-4.C
+++ b/gcc/testsuite/g++.dg/parse/struct-4.C
@@ -1,5 +1,5 @@
/* PR c/35437 */
-/* { dg-do "compile" } */
+/* { dg-do compile } */
struct A
{
diff --git a/gcc/testsuite/g++.dg/parse/template23.C b/gcc/testsuite/g++.dg/parse/template23.C
index 795457b68da..893d78d15da 100644
--- a/gcc/testsuite/g++.dg/parse/template23.C
+++ b/gcc/testsuite/g++.dg/parse/template23.C
@@ -1,5 +1,5 @@
/* PR c++/30895 This used to ICE. */
-/* { dg-do "compile" } */
+/* { dg-do compile } */
template<int> struct A {};
diff --git a/gcc/testsuite/g++.dg/pr46868.C b/gcc/testsuite/g++.dg/pr46868.C
new file mode 100644
index 00000000000..544c7b219df
--- /dev/null
+++ b/gcc/testsuite/g++.dg/pr46868.C
@@ -0,0 +1,4 @@
+// PR c++/46868
+// { dg-do compile }
+
+template < int > struct S { S < // { dg-error "" }
diff --git a/gcc/testsuite/g++.dg/pr46890.C b/gcc/testsuite/g++.dg/pr46890.C
new file mode 100644
index 00000000000..3ecef5a52a3
--- /dev/null
+++ b/gcc/testsuite/g++.dg/pr46890.C
@@ -0,0 +1,6 @@
+// PR c++/46890
+// { dg-do compile }
+
+struct MdatResource {
+const char *mdatAlloc;
+} const *_resource;
diff --git a/gcc/testsuite/g++.dg/pr47053.C b/gcc/testsuite/g++.dg/pr47053.C
new file mode 100644
index 00000000000..186e3a7ad10
--- /dev/null
+++ b/gcc/testsuite/g++.dg/pr47053.C
@@ -0,0 +1,22 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fnon-call-exceptions" } */
+struct A
+{
+ int i;
+ virtual ~A ()
+ {}
+};
+
+struct B : virtual A
+{};
+
+struct C : public B
+{
+ C ();
+ ~C (){}
+};
+
+void foo ()
+{
+ C c;
+}
diff --git a/gcc/testsuite/g++.dg/pr47589.C b/gcc/testsuite/g++.dg/pr47589.C
new file mode 100644
index 00000000000..6bc3c80347d
--- /dev/null
+++ b/gcc/testsuite/g++.dg/pr47589.C
@@ -0,0 +1,26 @@
+// PR c++/47589
+// { dg-do compile }
+
+struct F
+{
+ typedef void(*Cb)();
+
+ F(Cb);
+};
+
+struct C
+{
+ template<class D> static void f();
+};
+
+template<class D>
+struct TF : F
+{
+ TF() : F(C::f<D>) { }
+};
+
+struct DTC : TF<DTC>
+{
+ DTC() { }
+};
+
diff --git a/gcc/testsuite/g++.dg/template/access19.C b/gcc/testsuite/g++.dg/template/access19.C
index e717a72d4f2..6420b1cbed1 100644
--- a/gcc/testsuite/g++.dg/template/access19.C
+++ b/gcc/testsuite/g++.dg/template/access19.C
@@ -1,5 +1,5 @@
/* PR c++/29475 The error diagnostic contained "U = U" instead of "U = char" */
-/* { dg-do "compile" } */
+/* { dg-do compile } */
template< class T >
class explicit_t
diff --git a/gcc/testsuite/g++.dg/template/call7.C b/gcc/testsuite/g++.dg/template/call7.C
index 00a912b3682..0e9a4b7ae4f 100644
--- a/gcc/testsuite/g++.dg/template/call7.C
+++ b/gcc/testsuite/g++.dg/template/call7.C
@@ -1,6 +1,6 @@
// Contributed by Dodji Seketeli <dodji@redhat.com>
// Origin: PR c++/17395
-// { dg-do "compile" }
+// { dg-do compile }
template<int> struct X { };
diff --git a/gcc/testsuite/g++.dg/template/canon-type-1.C b/gcc/testsuite/g++.dg/template/canon-type-1.C
index 2a36dc09951..b467dffef78 100644
--- a/gcc/testsuite/g++.dg/template/canon-type-1.C
+++ b/gcc/testsuite/g++.dg/template/canon-type-1.C
@@ -1,6 +1,6 @@
// Contributed by Dodji Seketeli <dodji@redhat.com>
// Origin PR c++/39754
-// { dg-do "compile" }
+// { dg-do compile }
template < typename > struct A ;
template < typename T , typename = A < T > > struct B { } ;
diff --git a/gcc/testsuite/g++.dg/template/canon-type-10.C b/gcc/testsuite/g++.dg/template/canon-type-10.C
index 0c38946ec0a..0ff45e7afac 100644
--- a/gcc/testsuite/g++.dg/template/canon-type-10.C
+++ b/gcc/testsuite/g++.dg/template/canon-type-10.C
@@ -1,5 +1,5 @@
// Contributed by Dodji Seketeli <dodji@redhat.com>
-// { dg-do "compile" }
+// { dg-do compile }
template<class T>
struct C
diff --git a/gcc/testsuite/g++.dg/template/canon-type-11.C b/gcc/testsuite/g++.dg/template/canon-type-11.C
index 698fe318827..0fe99511e4c 100644
--- a/gcc/testsuite/g++.dg/template/canon-type-11.C
+++ b/gcc/testsuite/g++.dg/template/canon-type-11.C
@@ -1,5 +1,5 @@
// Contributed by Dodji Seketeli <dodji@redhat.com>
-// { dg-do "compile" }
+// { dg-do compile }
template<class T>
struct C
diff --git a/gcc/testsuite/g++.dg/template/canon-type-12.C b/gcc/testsuite/g++.dg/template/canon-type-12.C
index 694cc5e1379..08c86f0a981 100644
--- a/gcc/testsuite/g++.dg/template/canon-type-12.C
+++ b/gcc/testsuite/g++.dg/template/canon-type-12.C
@@ -9,7 +9,7 @@ struct S
template<class T, T t>
void
-S<T, t>::foo(T)
+S<T, t>::foo(decltype(t))
{
}
diff --git a/gcc/testsuite/g++.dg/template/canon-type-13.C b/gcc/testsuite/g++.dg/template/canon-type-13.C
index ca39cea9124..4f3702b842d 100644
--- a/gcc/testsuite/g++.dg/template/canon-type-13.C
+++ b/gcc/testsuite/g++.dg/template/canon-type-13.C
@@ -1,5 +1,5 @@
// Contributed by Dodji Seketeli <dodji@redhat.com>
-// { dg-do "compile" }
+// { dg-do compile }
template<class T>
struct S0
diff --git a/gcc/testsuite/g++.dg/template/canon-type-2.C b/gcc/testsuite/g++.dg/template/canon-type-2.C
index dd23ec5ea6d..a3f3f1b8399 100644
--- a/gcc/testsuite/g++.dg/template/canon-type-2.C
+++ b/gcc/testsuite/g++.dg/template/canon-type-2.C
@@ -1,6 +1,6 @@
// Contributed by Dodji Seketeli <dodji@redhat.com>
// Origin PR c++/39754
-// { dg-do "compile" }
+// { dg-do compile }
template < typename > struct A ;
template < typename T , typename = A < T > > struct B { } ;
diff --git a/gcc/testsuite/g++.dg/template/canon-type-3.C b/gcc/testsuite/g++.dg/template/canon-type-3.C
index a43169addc5..e47c7d350fb 100644
--- a/gcc/testsuite/g++.dg/template/canon-type-3.C
+++ b/gcc/testsuite/g++.dg/template/canon-type-3.C
@@ -1,6 +1,6 @@
// Contributed by Dodji Seketeli <dodji@redhat.com>
// Origin PR c++/39754
-// { dg-do "compile" }
+// { dg-do compile }
template<typename> struct A ;
template<typename T , typename = A<T> > struct B { } ;
diff --git a/gcc/testsuite/g++.dg/template/canon-type-4.C b/gcc/testsuite/g++.dg/template/canon-type-4.C
index ec5e1e6a200..673121bd247 100644
--- a/gcc/testsuite/g++.dg/template/canon-type-4.C
+++ b/gcc/testsuite/g++.dg/template/canon-type-4.C
@@ -1,6 +1,6 @@
// Contributed by Dodji Seketeli <dodji@redhat.com>
// Origin PR c++/39754
-// { dg-do "compile" }
+// { dg-do compile }
template<typename> struct A ;
template<typename T ,typename = A<T> > struct B { } ;
diff --git a/gcc/testsuite/g++.dg/template/canon-type-5.C b/gcc/testsuite/g++.dg/template/canon-type-5.C
index 7331c3086fb..5f783df9bac 100644
--- a/gcc/testsuite/g++.dg/template/canon-type-5.C
+++ b/gcc/testsuite/g++.dg/template/canon-type-5.C
@@ -1,6 +1,6 @@
// Contributed by Dodji Seketeli <dodji@redhat.com>
// Origin PR c++/39754
-// { dg-do "compile" }
+// { dg-do compile }
struct Foo {};
template<typename> struct A ;
diff --git a/gcc/testsuite/g++.dg/template/canon-type-6.C b/gcc/testsuite/g++.dg/template/canon-type-6.C
index 5065c395dc4..951708747a2 100644
--- a/gcc/testsuite/g++.dg/template/canon-type-6.C
+++ b/gcc/testsuite/g++.dg/template/canon-type-6.C
@@ -1,6 +1,6 @@
// Contributed by Dodji Seketeli <dodji@redhat.com>
// Origin PR c++/39754
-// { dg-do "compile" }
+// { dg-do compile }
struct Foo {};
template<typename> struct A ;
diff --git a/gcc/testsuite/g++.dg/template/canon-type-7.C b/gcc/testsuite/g++.dg/template/canon-type-7.C
index 80e8f87e834..51c15342c6b 100644
--- a/gcc/testsuite/g++.dg/template/canon-type-7.C
+++ b/gcc/testsuite/g++.dg/template/canon-type-7.C
@@ -1,6 +1,6 @@
// Contributed by Dodji Seketeli <dodji@redhat.com>
// Origin PR c++/39754
-// { dg-do "compile" }
+// { dg-do compile }
struct Foo {};
template<typename> struct A ;
diff --git a/gcc/testsuite/g++.dg/template/canon-type-9.C b/gcc/testsuite/g++.dg/template/canon-type-9.C
index de6170e9852..4fcd5243534 100644
--- a/gcc/testsuite/g++.dg/template/canon-type-9.C
+++ b/gcc/testsuite/g++.dg/template/canon-type-9.C
@@ -1,6 +1,6 @@
// Contributed by Dodji Seketeli <dodji@redhat.com>
// { dg-options "-std=c++0x" }
-// { dg-do "compile" }
+// { dg-do compile }
struct F { F(int) {}};
@@ -11,7 +11,7 @@ struct S
};
template<class T, T *u>
-T* S<T, u>::foo(T)
+decltype(u) S<T, u>::foo(T)
{
T t;
return t;
diff --git a/gcc/testsuite/g++.dg/template/char1.C b/gcc/testsuite/g++.dg/template/char1.C
index c440577e808..51e72e7ad06 100644
--- a/gcc/testsuite/g++.dg/template/char1.C
+++ b/gcc/testsuite/g++.dg/template/char1.C
@@ -1,4 +1,4 @@
template <class CharType, CharType line_terminator = 0>
class String {};
-String<char, 255> s; // { dg-warning "overflow" }
+String<signed char, 255> s; // { dg-warning "overflow" }
diff --git a/gcc/testsuite/g++.dg/template/const3.C b/gcc/testsuite/g++.dg/template/const3.C
index 5ef27315a51..998b6976e42 100644
--- a/gcc/testsuite/g++.dg/template/const3.C
+++ b/gcc/testsuite/g++.dg/template/const3.C
@@ -1,6 +1,6 @@
// Contributed by Dodji Seketeli <dodji@redhat.com>
// Origin PR c++/42251
-// { dg-do "compile" }
+// { dg-do compile }
struct foo
{
diff --git a/gcc/testsuite/g++.dg/template/crash105.C b/gcc/testsuite/g++.dg/template/crash105.C
new file mode 100644
index 00000000000..649bf8b77e1
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/crash105.C
@@ -0,0 +1,14 @@
+// PR c++/44118
+
+template < typename > struct S;
+template < typename > struct S < int >; // { dg-error "template" }
+template < typename > struct S < int >
+{
+ void f ();
+};
+
+void
+f ()
+{
+ S < int >::f (); // { dg-error "cannot call" }
+}
diff --git a/gcc/testsuite/g++.dg/template/crash14.C b/gcc/testsuite/g++.dg/template/crash14.C
index 7b3af045fa9..cf6fffa1a6b 100644
--- a/gcc/testsuite/g++.dg/template/crash14.C
+++ b/gcc/testsuite/g++.dg/template/crash14.C
@@ -1,3 +1,5 @@
+// { dg-options -std=c++98 }
+
template <int T> class foo { public: foo() { } class Z { };};
template <int I[2]> void dep7(foo<I[0]> *) { } // { dg-error "" }
diff --git a/gcc/testsuite/g++.dg/template/for1.C b/gcc/testsuite/g++.dg/template/for1.C
new file mode 100644
index 00000000000..dc33afcdaec
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/for1.C
@@ -0,0 +1,23 @@
+// PR c++/47388
+// { dg-do compile }
+// { dg-options "-fno-for-scope" }
+
+template <int>
+void
+foo ()
+{
+ int i;
+ for (i = 0; i < 16; i++)
+ ;
+ for (int j = 0; j < 16; j++)
+ ;
+ if (j != 16)
+ for (;;)
+ ;
+}
+
+void
+bar ()
+{
+ foo <0> ();
+}
diff --git a/gcc/testsuite/g++.dg/template/function1.C b/gcc/testsuite/g++.dg/template/function1.C
index 1097c5bf9c2..8a112c1459f 100644
--- a/gcc/testsuite/g++.dg/template/function1.C
+++ b/gcc/testsuite/g++.dg/template/function1.C
@@ -3,25 +3,25 @@
template<const char *, int> struct A {};
const char func[] = "abc";
-template<int N> struct A<func, N> {}; // { dg-error "cannot appear|is invalid" }
+template<int N> struct A<func, N> {}; // { dg-error "cannot appear|is invalid|not a valid|not declared constexpr" }
char a1[1];
A<a1, 0> a;
template<const char *, int> struct B {};
-template<int N> struct B<__FUNCTION__, N> {}; // { dg-error "cannot appear|is invalid" }
+template<int N> struct B<__FUNCTION__, N> {}; // { dg-error "cannot appear|is invalid|is not a valid|not declared constexpr" }
char b1[1];
B<b1, 0> b;
template<const char *, int> struct C {};
-template<int N> struct C<__PRETTY_FUNCTION__, N> {}; // { dg-error "cannot appear|is invalid" }
+template<int N> struct C<__PRETTY_FUNCTION__, N> {}; // { dg-error "cannot appear|is invalid|is not a valid|not declared constexpr" }
char c1[1];
C<c1, 0> c;
template<const char *, int> struct D {};
-template<int N> struct D<__func__, N> {}; // { dg-error "cannot appear|is invalid" }
+template<int N> struct D<__func__, N> {}; // { dg-error "cannot appear|is invalid|is not a valid|function scope|not declared constexpr" }
char d1[1];
D<d1, 0> d;
diff --git a/gcc/testsuite/g++.dg/template/inherit6.C b/gcc/testsuite/g++.dg/template/inherit6.C
new file mode 100644
index 00000000000..241a68e5e4a
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/inherit6.C
@@ -0,0 +1,23 @@
+// Origin PR c++/47172
+// { dg-options "-std=c++0x" }
+// { dg-do compile }
+
+struct A
+{
+ int f() const;
+};
+
+template <class T>
+struct B : A { };
+
+template <class T>
+struct C : B<T>
+{
+ void g();
+};
+
+template <class T>
+void C<T>::g()
+{
+ A::f();
+}
diff --git a/gcc/testsuite/g++.dg/template/init7.C b/gcc/testsuite/g++.dg/template/init7.C
index e2267767b89..bb26c8f92b5 100644
--- a/gcc/testsuite/g++.dg/template/init7.C
+++ b/gcc/testsuite/g++.dg/template/init7.C
@@ -1,5 +1,5 @@
/* PR c++/31517. This used to ICE. */
-/* { dg-do "compile" } */
+/* { dg-do compile } */
template<typename> struct A
{
diff --git a/gcc/testsuite/g++.dg/template/instantiate9.C b/gcc/testsuite/g++.dg/template/instantiate9.C
index 20fefaf270b..33f1d6018a1 100644
--- a/gcc/testsuite/g++.dg/template/instantiate9.C
+++ b/gcc/testsuite/g++.dg/template/instantiate9.C
@@ -1,5 +1,5 @@
/* PR c++/14622. The invalid explicit instantiation was not reported. */
-/* { dg-do "compile" } */
+/* { dg-do compile } */
template<class T>
class A
{
diff --git a/gcc/testsuite/g++.dg/template/local4.C b/gcc/testsuite/g++.dg/template/local4.C
index 7ee922ba6d3..9a03c9a7b98 100644
--- a/gcc/testsuite/g++.dg/template/local4.C
+++ b/gcc/testsuite/g++.dg/template/local4.C
@@ -1,9 +1,10 @@
// PR c++/17413
+// { dg-options -std=c++98 }
template <typename T> void foo() {} // { dg-message "note" }
int main () {
struct S {};
foo<S> (); // { dg-error "match" }
- // { dg-message "candidate" "candidate note" { target *-*-* } 7 }
+ // { dg-message "candidate" "candidate note" { target *-*-* } 8 }
}
diff --git a/gcc/testsuite/g++.dg/template/nontype3.C b/gcc/testsuite/g++.dg/template/nontype3.C
index 5f245620a83..d0c6b72a1d3 100644
--- a/gcc/testsuite/g++.dg/template/nontype3.C
+++ b/gcc/testsuite/g++.dg/template/nontype3.C
@@ -1,4 +1,5 @@
// { dg-do compile }
+// { dg-options -std=c++98 }
// Origin: <drow at gcc dot gnu dot org>,
// <giovannibajo at gcc dot gnu dot org>
// c++/13243: Template parameters of non integral or enumeration type can't be
diff --git a/gcc/testsuite/g++.dg/template/param1.C b/gcc/testsuite/g++.dg/template/param1.C
index ad7fc8cde0e..a8c3791254f 100644
--- a/gcc/testsuite/g++.dg/template/param1.C
+++ b/gcc/testsuite/g++.dg/template/param1.C
@@ -2,11 +2,11 @@
// Origin: Volker Reichelt <reichelt@igpm.rwth-aachen.de>
// { dg-do compile }
-template<int> struct A
+template<int> struct A // { dg-error "declaration" }
{
A();
};
-template<int N, char> A<N>::A() {} // { dg-error "got 2|but 1 required" }
+template<int N, char> A<N>::A() {} // { dg-error "invalid use of incomplete type" }
A<0> a;
diff --git a/gcc/testsuite/g++.dg/template/param2.C b/gcc/testsuite/g++.dg/template/param2.C
new file mode 100644
index 00000000000..d25b85565dd
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/param2.C
@@ -0,0 +1,8 @@
+// Origin PR c++/47311
+// { dg-do compile }
+
+template < typename > class A0;
+template <class Key, class T, template < typename TF = T> class TC = A0> class B0;
+
+template <int> class A1;
+template <class Key, class T, template <T p> class TC = A1> class B1;
diff --git a/gcc/testsuite/g++.dg/template/ref3.C b/gcc/testsuite/g++.dg/template/ref3.C
index 4390f71b407..976c093a15b 100644
--- a/gcc/testsuite/g++.dg/template/ref3.C
+++ b/gcc/testsuite/g++.dg/template/ref3.C
@@ -4,8 +4,8 @@ template<const int&> struct A {};
template<typename T> struct B
{
- A<(T)0> b; // { dg-error "constant" }
- A<T(0)> a; // { dg-error "constant" }
+ A<(T)0> b; // { dg-error "constant|not a valid" }
+ A<T(0)> a; // { dg-error "constant|not a valid" }
};
B<const int&> b;
diff --git a/gcc/testsuite/g++.dg/template/sfinae26.C b/gcc/testsuite/g++.dg/template/sfinae26.C
index 41673fb48d9..dcb018f800f 100644
--- a/gcc/testsuite/g++.dg/template/sfinae26.C
+++ b/gcc/testsuite/g++.dg/template/sfinae26.C
@@ -1,5 +1,5 @@
// Origin: PR c++/46170
-// { dg-do "compile" }
+// { dg-do compile }
namespace util {
struct option_value {
diff --git a/gcc/testsuite/g++.dg/template/sizeof-template-argument.C b/gcc/testsuite/g++.dg/template/sizeof-template-argument.C
index f7472c3c1a1..2cdc328598e 100644
--- a/gcc/testsuite/g++.dg/template/sizeof-template-argument.C
+++ b/gcc/testsuite/g++.dg/template/sizeof-template-argument.C
@@ -1,5 +1,5 @@
/* This used to ICE (PR c++/29573) */
-/* { dg-do "compile" } */
+/* { dg-do compile } */
template<int> struct A {};
diff --git a/gcc/testsuite/g++.dg/template/spec36.C b/gcc/testsuite/g++.dg/template/spec36.C
index 71ff3a5c545..7e8dc5241d9 100644
--- a/gcc/testsuite/g++.dg/template/spec36.C
+++ b/gcc/testsuite/g++.dg/template/spec36.C
@@ -1,5 +1,5 @@
/* PR c++/38089 */
-/* { dg-do "compile" } */
+/* { dg-do compile } */
struct basic_string
{
diff --git a/gcc/testsuite/g++.dg/template/static9.C b/gcc/testsuite/g++.dg/template/static9.C
index a98144185bb..8845647601b 100644
--- a/gcc/testsuite/g++.dg/template/static9.C
+++ b/gcc/testsuite/g++.dg/template/static9.C
@@ -3,7 +3,7 @@
template<typename T> struct A
{
static const T i = 0; // { dg-error "declared void" "void" }
- // { dg-error "invalid" "invalid" { target *-*-* } 5 }
+ // { dg-error "invalid|non-literal" "invalid" { target *-*-* } 5 }
};
A<void> a; // { dg-message "instantiated" }
diff --git a/gcc/testsuite/g++.dg/template/ttp22.C b/gcc/testsuite/g++.dg/template/ttp22.C
index f3449435f4b..08eaa304246 100644
--- a/gcc/testsuite/g++.dg/template/ttp22.C
+++ b/gcc/testsuite/g++.dg/template/ttp22.C
@@ -1,5 +1,5 @@
// PR c++/28860
-// { dg-do compile}
+// { dg-do compile }
template<template<int> class A>
class A<0>; // { dg-error "shadows template template parameter" }
diff --git a/gcc/testsuite/g++.dg/template/typedef37.C b/gcc/testsuite/g++.dg/template/typedef37.C
new file mode 100644
index 00000000000..eefa38316ca
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/typedef37.C
@@ -0,0 +1,58 @@
+// Origin: PR c++/47398
+// { dg-do compile }
+
+template<int>
+struct A
+{
+ typedef int INT;
+};
+
+template<int I>
+struct transform
+{
+ static int bar();
+};
+
+template<class T, int a, class U, int b>
+struct B
+{
+ typedef typename A<a>::INT TINT;
+ void baz();
+};
+
+template<class T, int a, class U>
+struct B<T, a, U, 1>
+{
+ typedef typename A<a>::INT TINT;
+ void foo();
+};
+
+template<class T, int a, class U, int b>
+void
+B<T, a, U, b>::baz()
+{
+ int c = transform<sizeof(TINT)>::bar();//#0
+}
+
+template<class T, int a, class U>
+void
+B<T, a, U, 1>::foo()
+{
+ int c = transform<sizeof(TINT)>::bar();//#1
+}
+
+int
+main()
+{
+ B<int, 2, char, 1> i;
+ i.foo();
+ // While instantiating
+ //
+ // template<class T, int a, class U> void B<T, a, U, 1>::foo()
+ //
+ // lookup_template_class resolves transform<sizeof(TINT)> in #1 to
+ // the wrong one; it picks up the one in #0 instead. This is because
+ // to compare the two A<a> comp_template_args uses cp_tree_equal
+ // that fails to consider the number of siblings of parm 'a'.
+return 0;
+}
diff --git a/gcc/testsuite/g++.dg/template/typedef38.C b/gcc/testsuite/g++.dg/template/typedef38.C
new file mode 100644
index 00000000000..445db17bd08
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/typedef38.C
@@ -0,0 +1,27 @@
+// Origin: PR c++/46394
+// { dg-options "-std=c++0x" }
+// { dg-do compile }
+
+template<class T>
+struct S0
+{
+ typedef T type;
+};
+
+template<class... X>
+struct S1
+{
+ typedef int I;
+};
+
+struct A
+{
+ template<class...U, class V=typename S1<typename S0<U>::type...>::I>
+ A(U...u);
+};
+
+int
+main()
+{
+ A a(1, 2);
+}
diff --git a/gcc/testsuite/g++.dg/template/union2.C b/gcc/testsuite/g++.dg/template/union2.C
index 9e0666eae57..25f1e086f26 100644
--- a/gcc/testsuite/g++.dg/template/union2.C
+++ b/gcc/testsuite/g++.dg/template/union2.C
@@ -1,5 +1,5 @@
/* PR c++/40557 */
-/* { dg-do "compile" } */
+/* { dg-do compile } */
struct A
{
diff --git a/gcc/testsuite/g++.dg/torture/pr47382.C b/gcc/testsuite/g++.dg/torture/pr47382.C
new file mode 100644
index 00000000000..a12dbe3fd09
--- /dev/null
+++ b/gcc/testsuite/g++.dg/torture/pr47382.C
@@ -0,0 +1,30 @@
+// { dg-do run }
+
+extern "C" void abort ();
+
+struct A
+{
+ inline ~A ();
+ virtual void foo () {}
+};
+
+struct B : A
+{
+ virtual void foo () { abort(); }
+};
+
+static inline void middleman (A *a)
+{
+ a->foo ();
+}
+
+inline A::~A ()
+{
+ middleman (this);
+}
+
+int main ()
+{
+ B b;
+ return 0;
+}
diff --git a/gcc/testsuite/g++.dg/torture/pr47541.C b/gcc/testsuite/g++.dg/torture/pr47541.C
new file mode 100644
index 00000000000..350a0519297
--- /dev/null
+++ b/gcc/testsuite/g++.dg/torture/pr47541.C
@@ -0,0 +1,27 @@
+/* { dg-do run } */
+
+struct Dummy {};
+struct RefCount : public Dummy {
+ ~RefCount(); /* Has to be non-pod. */
+ int *a;
+ int *b;
+};
+RefCount::~RefCount(){}
+struct Wrapper : public Dummy { RefCount ref; };
+void __attribute__((noinline,noclone))
+Push(Wrapper ptr)
+{
+ *ptr.ref.b = 0;
+}
+extern "C" void abort (void);
+int main()
+{
+ int a = 1, b = 1;
+ Wrapper x;
+ x.ref.a = &a;
+ x.ref.b = &b;
+ Push(x);
+ if (b != 0)
+ abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/g++.dg/torture/pr47559.C b/gcc/testsuite/g++.dg/torture/pr47559.C
new file mode 100644
index 00000000000..42dedee291c
--- /dev/null
+++ b/gcc/testsuite/g++.dg/torture/pr47559.C
@@ -0,0 +1,8 @@
+// { dg-do compile }
+// { dg-options "-std=c++0x -fnon-call-exceptions" }
+
+void foo (int *k) noexcept
+{
+ for (;;)
+ *k = 0;
+}
diff --git a/gcc/testsuite/g++.dg/tree-prof/partition1.C b/gcc/testsuite/g++.dg/tree-prof/partition1.C
index d0dcbc4524b..108803997d4 100644
--- a/gcc/testsuite/g++.dg/tree-prof/partition1.C
+++ b/gcc/testsuite/g++.dg/tree-prof/partition1.C
@@ -1,5 +1,6 @@
/* { dg-require-effective-target freorder } */
/* { dg-options "-O2 -freorder-blocks-and-partition" } */
+/* { dg-skip-if "PR target/47683" { mips-sgi-irix* } } */
struct A { A () __attribute__((noinline)); ~A () __attribute__((noinline)); };
A::A () { asm volatile ("" : : : "memory"); }
diff --git a/gcc/testsuite/g++.dg/tree-prof/partition2.C b/gcc/testsuite/g++.dg/tree-prof/partition2.C
index ca5671f3ffa..6715da57ecf 100644
--- a/gcc/testsuite/g++.dg/tree-prof/partition2.C
+++ b/gcc/testsuite/g++.dg/tree-prof/partition2.C
@@ -1,6 +1,7 @@
// PR middle-end/45458
// { dg-require-effective-target freorder }
// { dg-options "-fnon-call-exceptions -freorder-blocks-and-partition" }
+// { dg-skip-if "PR target/47683" { mips-sgi-irix* } }
int
main ()
diff --git a/gcc/testsuite/g++.dg/tree-prof/partition3.C b/gcc/testsuite/g++.dg/tree-prof/partition3.C
new file mode 100644
index 00000000000..78469836921
--- /dev/null
+++ b/gcc/testsuite/g++.dg/tree-prof/partition3.C
@@ -0,0 +1,18 @@
+// PR middle-end/45566
+// { dg-require-effective-target freorder }
+// { dg-options "-O -fnon-call-exceptions -freorder-blocks-and-partition" }
+
+int k;
+
+int
+main ()
+{
+ try
+ {
+ if (k)
+ throw 6;
+ }
+ catch (...)
+ {
+ }
+}
diff --git a/gcc/testsuite/g++.dg/tree-prof/tree-prof.exp b/gcc/testsuite/g++.dg/tree-prof/tree-prof.exp
index b5a2f65b850..92de03210ff 100644
--- a/gcc/testsuite/g++.dg/tree-prof/tree-prof.exp
+++ b/gcc/testsuite/g++.dg/tree-prof/tree-prof.exp
@@ -16,7 +16,7 @@
# <http://www.gnu.org/licenses/>.
# Test the functionality of programs compiled with profile-directed block
-# ordering using -fprofile-generate followed by -fbranch-use.
+# ordering using -fprofile-generate followed by -fprofile-use.
load_lib target-supports.exp
diff --git a/gcc/testsuite/g++.dg/tree-ssa/inline-3.C b/gcc/testsuite/g++.dg/tree-ssa/inline-3.C
index 57d175c4416..f01f26cafa7 100644
--- a/gcc/testsuite/g++.dg/tree-ssa/inline-3.C
+++ b/gcc/testsuite/g++.dg/tree-ssa/inline-3.C
@@ -4,20 +4,18 @@
#include <algorithm>
-namespace std {
- extern "C" void puts(const char *s);
-}
+void foo(const char *s);
void
inline_me (char *x)
{
- std::puts(x);
+ foo(x);
}
static void
inline_me_too (char *x)
{
- std::puts(x);
+ foo(x);
}
int main(int argc, char **argv)
diff --git a/gcc/testsuite/g++.dg/tree-ssa/pr47707.C b/gcc/testsuite/g++.dg/tree-ssa/pr47707.C
new file mode 100644
index 00000000000..98852de17b8
--- /dev/null
+++ b/gcc/testsuite/g++.dg/tree-ssa/pr47707.C
@@ -0,0 +1,29 @@
+/* { dg-do run } */
+/* { dg-options "-O2 -fno-tree-vrp" } */
+#include <assert.h>
+
+struct CH
+{
+ unsigned char ch : 3;
+} ch;
+
+__attribute__((noinline)) void MakeCheckOp (unsigned int *v1, unsigned int *v2)
+{
+ assert (*v1 == *v2);
+
+}
+
+int main (void)
+{
+
+ int len;
+
+ for (len = 4; len >= 1; len--)
+ {
+ unsigned v1, v2;
+ ch.ch = len;
+ v1 = ch.ch;
+ v2 = len;
+ MakeCheckOp (&v1, &v2);
+ }
+}
diff --git a/gcc/testsuite/g++.dg/warn/Walways-true-1.C b/gcc/testsuite/g++.dg/warn/Walways-true-1.C
index 6d22cce993b..ae6f9dc831d 100644
--- a/gcc/testsuite/g++.dg/warn/Walways-true-1.C
+++ b/gcc/testsuite/g++.dg/warn/Walways-true-1.C
@@ -1,7 +1,7 @@
// Test -Waddress for testing an address against NULL.
// Origin: Ian Lance Taylor <iant@google.com>
-// { dg-do compile}
+// { dg-do compile }
// { dg-options "-Waddress" }
extern int foo (int);
diff --git a/gcc/testsuite/g++.dg/warn/Walways-true-2.C b/gcc/testsuite/g++.dg/warn/Walways-true-2.C
index 51bc6862761..f1573470ef2 100644
--- a/gcc/testsuite/g++.dg/warn/Walways-true-2.C
+++ b/gcc/testsuite/g++.dg/warn/Walways-true-2.C
@@ -3,7 +3,7 @@
// symbol.
// Origin: Ian Lance Taylor <iant@google.com>
-// { dg-do compile}
+// { dg-do compile }
// { dg-options "-Waddress" }
// { dg-require-weak "" }
diff --git a/gcc/testsuite/g++.dg/warn/Wlogical-op-1.C b/gcc/testsuite/g++.dg/warn/Wlogical-op-1.C
index 61d4a9dae23..e5b19afbe6a 100644
--- a/gcc/testsuite/g++.dg/warn/Wlogical-op-1.C
+++ b/gcc/testsuite/g++.dg/warn/Wlogical-op-1.C
@@ -1,4 +1,4 @@
-// { dg-do compile}
+// { dg-do compile }
// { dg-options "-Wlogical-op" }
enum { a, b1, b2 };
diff --git a/gcc/testsuite/g++.dg/warn/Wreturn-type-6.C b/gcc/testsuite/g++.dg/warn/Wreturn-type-6.C
index 497e3b9ebad..45ec95236b6 100644
--- a/gcc/testsuite/g++.dg/warn/Wreturn-type-6.C
+++ b/gcc/testsuite/g++.dg/warn/Wreturn-type-6.C
@@ -1,5 +1,5 @@
/* PR c++/40749 */
-/* { dg-do "compile" } */
+/* { dg-do compile } */
/* { dg-options "-Wreturn-type" } */
struct A {};
diff --git a/gcc/testsuite/g++.dg/warn/Wuninitialized-5.C b/gcc/testsuite/g++.dg/warn/Wuninitialized-5.C
index 26add34945f..787d3c78f63 100644
--- a/gcc/testsuite/g++.dg/warn/Wuninitialized-5.C
+++ b/gcc/testsuite/g++.dg/warn/Wuninitialized-5.C
@@ -5,7 +5,7 @@
int
foo (int i)
{
- int j; // { dg-warning "may be used uninitialized" }
+ int j;
switch (i)
{
case -__INT_MAX__ - 1 ... -1:
@@ -18,5 +18,5 @@ foo (int i)
j = 4;
break;
}
- return j;
+ return j; // { dg-warning "may be used uninitialized" }
}
diff --git a/gcc/testsuite/g++.dg/warn/Wunused-parm-4.C b/gcc/testsuite/g++.dg/warn/Wunused-parm-4.C
new file mode 100644
index 00000000000..fbad380f66c
--- /dev/null
+++ b/gcc/testsuite/g++.dg/warn/Wunused-parm-4.C
@@ -0,0 +1,24 @@
+// PR c++/47783
+// { dg-do compile }
+// { dg-options "-Wunused -W" }
+
+struct R
+{
+ int &i;
+};
+
+void
+foo (R r, int &s)
+{
+ r.i = 7;
+ s = 8;
+}
+
+int
+bar ()
+{
+ int x = 1, y = 1;
+ R r = { x };
+ foo (r, y);
+ return x + y;
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.bugs/900119_01.C b/gcc/testsuite/g++.old-deja/g++.bugs/900119_01.C
index 01d570f95e7..ace4e4b7ac1 100644
--- a/gcc/testsuite/g++.old-deja/g++.bugs/900119_01.C
+++ b/gcc/testsuite/g++.old-deja/g++.bugs/900119_01.C
@@ -8,6 +8,8 @@
// keywords: member declaration, member initialization
+// { dg-prune-output "non-static data member initializers" }
+
int global_int;
class class0 {
diff --git a/gcc/testsuite/g++.old-deja/g++.gb/scope06.C b/gcc/testsuite/g++.old-deja/g++.gb/scope06.C
index 39ab0896791..cbcc4fde125 100644
--- a/gcc/testsuite/g++.old-deja/g++.gb/scope06.C
+++ b/gcc/testsuite/g++.old-deja/g++.gb/scope06.C
@@ -1,4 +1,5 @@
// { dg-do assemble }
+// { dg-prune-output "non-static data member initializers" }
// GROUPS passed gb scope
struct C {
struct D {
@@ -10,5 +11,6 @@ struct C {
void C::D::foo ()
{
+ // { dg-prune-output "from this location" }
x = Ok;
}
diff --git a/gcc/testsuite/g++.old-deja/g++.law/cvt11.C b/gcc/testsuite/g++.old-deja/g++.law/cvt11.C
index 50f719acc96..53dd1e9076d 100644
--- a/gcc/testsuite/g++.old-deja/g++.law/cvt11.C
+++ b/gcc/testsuite/g++.old-deja/g++.law/cvt11.C
@@ -6,6 +6,10 @@
// Message-Id: <9211101908.AA13557@tera.com>
// Subject: type cast of qualified const member breaks g++2.3.1
+// Ignore extra errors in C++0x mode.
+// { dg-prune-output "non-static data member initializers" }
+// { dg-prune-output "from this location" }
+// { dg-prune-output "uninitialized" }
#include <stdio.h>
class Thing{
diff --git a/gcc/testsuite/g++.old-deja/g++.law/init1.C b/gcc/testsuite/g++.old-deja/g++.law/init1.C
index 82f49ae2450..1727e387b2d 100644
--- a/gcc/testsuite/g++.old-deja/g++.law/init1.C
+++ b/gcc/testsuite/g++.old-deja/g++.law/init1.C
@@ -1,4 +1,5 @@
// { dg-do assemble }
+// { dg-prune-output "non-static data member initializers" }
// GROUPS passed initialization
class foo {
public:
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/crash41.C b/gcc/testsuite/g++.old-deja/g++.pt/crash41.C
index fc7f7b51497..452ba91dc84 100644
--- a/gcc/testsuite/g++.old-deja/g++.pt/crash41.C
+++ b/gcc/testsuite/g++.old-deja/g++.pt/crash41.C
@@ -9,3 +9,5 @@ template <class T>
void f(S2 s2) {
S1<s2.i> s1; // { dg-error "" }
}
+
+template void f<int>(S2);
diff --git a/gcc/testsuite/gcc.c-torture/compile/20110126-1.c b/gcc/testsuite/gcc.c-torture/compile/20110126-1.c
new file mode 100644
index 00000000000..c55e0c2055d
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/20110126-1.c
@@ -0,0 +1,18 @@
+/* PR rtl-optimization/44469 */
+/* Testcase by Siarhei Siamashka <siarhei.siamashka@gmail.com> */
+
+int a (int *t, const char *p)
+{
+ if (*t == 0)
+ {
+ }
+ else if (*t == 1)
+ {
+ p = (const char *)t;
+ }
+ else
+ __builtin_unreachable();
+ if (p[0])
+ return 0;
+ return 1;
+}
diff --git a/gcc/testsuite/gcc.c-torture/compile/20110131-1.c b/gcc/testsuite/gcc.c-torture/compile/20110131-1.c
new file mode 100644
index 00000000000..8ce68de4b5b
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/20110131-1.c
@@ -0,0 +1,38 @@
+/* PR rtl-optimization/44031 */
+/* Testcase by John Regehr <regehr@cs.utah.edu> */
+
+typedef unsigned char uint8_t;
+typedef unsigned int uint32_t;
+typedef unsigned long int uint64_t;
+
+static uint32_t
+safe_add_func_uint32_t_u_u (uint32_t ui1, uint32_t ui2)
+{
+ return ui1 + ui2;
+}
+
+static uint64_t
+safe_div_func_uint64_t_u_u (uint64_t ui1, uint32_t ui2)
+{
+ return ui2 ? : (ui1 / ui2);
+}
+
+uint8_t g_55;
+uint8_t *g_73 = &g_55;
+uint8_t **g_332 = &g_73;
+
+int func_38(uint8_t *,int);
+int func_8(int);
+
+int int321 (void)
+{
+ uint8_t l_26[4];
+ uint8_t *l_238 = &l_26[2];
+ uint8_t l_400;
+ l_400 &=
+ func_38 (&l_26[3],
+ safe_add_func_uint32_t_u_u (safe_div_func_uint64_t_u_u
+ (1, **g_332),
+ *l_238) >= *l_238 < func_8 (0)), 1;
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr46002.c b/gcc/testsuite/gcc.c-torture/compile/pr46002.c
new file mode 100644
index 00000000000..27a3a3a284c
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/pr46002.c
@@ -0,0 +1,10 @@
+/* { dg-options "-fira-algorithm=priority" } */
+char **
+foo (char **p, char *cmp, unsigned i)
+{
+ for (; *p; p++)
+ if (__builtin_strncmp (*p, cmp, i))
+ if (i == __builtin_strlen (*p))
+ break;
+ return p;
+}
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr46856.c b/gcc/testsuite/gcc.c-torture/compile/pr46856.c
new file mode 100644
index 00000000000..2ec5e8baf9e
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/pr46856.c
@@ -0,0 +1,26 @@
+struct data {
+ int prio;
+ signed char status;
+};
+
+struct base {
+ unsigned _num;
+ struct data vec[10];
+};
+
+static struct data *ix(struct base *base, unsigned i)
+{
+ return &base->vec[i];
+}
+
+struct heap {
+ struct base base;
+};
+
+struct heap *heap;
+
+void increase_insn_priority (int *fld, int amount)
+{
+ if (ix(heap ? &heap->base : 0, *fld)->status > 0)
+ ix(heap ? &heap->base : 0, *fld)->prio += amount;
+}
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr47265.c b/gcc/testsuite/gcc.c-torture/compile/pr47265.c
new file mode 100644
index 00000000000..183c3f98621
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/pr47265.c
@@ -0,0 +1,20 @@
+/* PR tree-optimization/47265 */
+
+struct S
+{
+ char a[3];
+ char b[3];
+};
+
+void
+bar (char *dst, const char *src, unsigned n)
+{
+ while (n--)
+ *dst++ = *src ? *src++ : ' ';
+}
+
+void
+foo (struct S *s)
+{
+ bar (s->a, s->b, 3);
+}
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr47427.c b/gcc/testsuite/gcc.c-torture/compile/pr47427.c
new file mode 100644
index 00000000000..4f0b98e20c6
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/pr47427.c
@@ -0,0 +1,28 @@
+/* PR tree-optimization/47427 */
+
+char *g, *h;
+
+int
+bar (unsigned char x, const int y)
+{
+lab:
+ for (; h; g = h)
+ for (g = 0; h; h++)
+ {
+ int a = 1;
+ if (h)
+ {
+ if (a)
+ goto lab;
+ return y;
+ }
+ }
+ return x;
+}
+
+void
+foo (void)
+{
+ if (bar (0, 1))
+ bar (1, 0);
+}
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr47428.c b/gcc/testsuite/gcc.c-torture/compile/pr47428.c
new file mode 100644
index 00000000000..0c4ccc9127d
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/pr47428.c
@@ -0,0 +1,42 @@
+/* PR tree-optimization/47428 */
+
+struct S
+{
+ int s;
+} a;
+int b;
+
+void bar (struct S);
+
+int
+baz (int x __attribute__((unused)), int y)
+{
+ int i;
+ for (i = 0; i < 1; i = 1)
+ for (y = 0; y < 1; y = 1);
+ return y;
+}
+
+void
+foo (void)
+{
+ fn (0);
+}
+
+int
+fn (const int x, int y __attribute__((unused)))
+{
+ if (baz (baz (0, x), 0))
+ return 0;
+ else
+ bar (a);
+ return 0;
+}
+
+void
+bar (struct S x)
+{
+ for (;;)
+ for (; x.s;)
+ b = 0 ? : baz (0, 0);
+}
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr47237.c b/gcc/testsuite/gcc.c-torture/execute/pr47237.c
new file mode 100644
index 00000000000..2100e154099
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/pr47237.c
@@ -0,0 +1,22 @@
+#define INTEGER_ARG 5
+
+extern void abort(void);
+
+static void foo(int arg)
+{
+ if (arg != INTEGER_ARG)
+ abort();
+}
+
+static void bar(int arg)
+{
+ foo(arg);
+ __builtin_apply(foo, __builtin_apply_args(), 16);
+}
+
+int main(void)
+{
+ bar(INTEGER_ARG);
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr47538.c b/gcc/testsuite/gcc.c-torture/execute/pr47538.c
new file mode 100644
index 00000000000..99dea084310
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/pr47538.c
@@ -0,0 +1,73 @@
+/* PR tree-optimization/47538 */
+
+struct S
+{
+ double a, b, *c;
+ unsigned long d;
+};
+
+__attribute__((noinline, noclone)) void
+foo (struct S *x, const struct S *y)
+{
+ const unsigned long n = y->d + 1;
+ const double m = 0.25 * (y->b - y->a);
+ x->a = y->a;
+ x->b = y->b;
+ if (n == 1)
+ {
+ x->c[0] = 0.;
+ }
+ else if (n == 2)
+ {
+ x->c[1] = m * y->c[0];
+ x->c[0] = 2.0 * x->c[1];
+ }
+ else
+ {
+ double o = 0.0, p = 1.0;
+ unsigned long i;
+
+ for (i = 1; i <= n - 2; i++)
+ {
+ x->c[i] = m * (y->c[i - 1] - y->c[i + 1]) / (double) i;
+ o += p * x->c[i];
+ p = -p;
+ }
+ x->c[n - 1] = m * y->c[n - 2] / (n - 1.0);
+ o += p * x->c[n - 1];
+ x->c[0] = 2.0 * o;
+ }
+}
+
+int
+main (void)
+{
+ struct S x, y;
+ double c[4] = { 10, 20, 30, 40 }, d[4], e[4] = { 118, 118, 118, 118 };
+
+ y.a = 10;
+ y.b = 6;
+ y.c = c;
+ x.c = d;
+ y.d = 3;
+ __builtin_memcpy (d, e, sizeof d);
+ foo (&x, &y);
+ if (d[0] != 0 || d[1] != 20 || d[2] != 10 || d[3] != -10)
+ __builtin_abort ();
+ y.d = 2;
+ __builtin_memcpy (d, e, sizeof d);
+ foo (&x, &y);
+ if (d[0] != 60 || d[1] != 20 || d[2] != -10 || d[3] != 118)
+ __builtin_abort ();
+ y.d = 1;
+ __builtin_memcpy (d, e, sizeof d);
+ foo (&x, &y);
+ if (d[0] != -20 || d[1] != -10 || d[2] != 118 || d[3] != 118)
+ __builtin_abort ();
+ y.d = 0;
+ __builtin_memcpy (d, e, sizeof d);
+ foo (&x, &y);
+ if (d[0] != 0 || d[1] != 118 || d[2] != 118 || d[3] != 118)
+ __builtin_abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/Walways-true-1.c b/gcc/testsuite/gcc.dg/Walways-true-1.c
index e4e4596cb44..4aa5d39abbd 100644
--- a/gcc/testsuite/gcc.dg/Walways-true-1.c
+++ b/gcc/testsuite/gcc.dg/Walways-true-1.c
@@ -1,7 +1,7 @@
/* Test -Waddress for testing an address against NULL.
Origin: Ian Lance Taylor <iant@google.com>. */
-/* { dg-do compile} */
+/* { dg-do compile } */
/* { dg-options "-Waddress -fshow-column" } */
extern int foo (int);
diff --git a/gcc/testsuite/gcc.dg/Walways-true-2.c b/gcc/testsuite/gcc.dg/Walways-true-2.c
index af40ba65a5a..7f0bb7b10b9 100644
--- a/gcc/testsuite/gcc.dg/Walways-true-2.c
+++ b/gcc/testsuite/gcc.dg/Walways-true-2.c
@@ -3,7 +3,7 @@
symbol.
Origin: Ian Lance Taylor <iant@google.com>. */
-/* { dg-do compile} */
+/* { dg-do compile } */
/* { dg-options "-Waddress" } */
/* { dg-require-weak "" } */
diff --git a/gcc/testsuite/gcc.dg/Wlogical-op-1.c b/gcc/testsuite/gcc.dg/Wlogical-op-1.c
index 2cbb9806e03..462b90beaf3 100644
--- a/gcc/testsuite/gcc.dg/Wlogical-op-1.c
+++ b/gcc/testsuite/gcc.dg/Wlogical-op-1.c
@@ -1,5 +1,5 @@
/*
- { dg-do compile}
+ { dg-do compile }
{ dg-options "-Wlogical-op" }
*/
diff --git a/gcc/testsuite/gcc.dg/attr-alias-5.c b/gcc/testsuite/gcc.dg/attr-alias-5.c
index 554668d212f..d22c286fc65 100644
--- a/gcc/testsuite/gcc.dg/attr-alias-5.c
+++ b/gcc/testsuite/gcc.dg/attr-alias-5.c
@@ -3,6 +3,7 @@
/* { dg-do compile } */
/* { dg-options "-std=gnu99" } */
/* { dg-require-alias "" } */
+/* { dg-require-ascii-locale "" } */
void f0 (void) __attribute__((alias("\xa1"))); /* { dg-error "undefined symbol '\\\\241'" } */
void f1 (void) __attribute__((alias("\u00e9"))); /* { dg-error "undefined symbol '\\\\U000000e9'" } */
diff --git a/gcc/testsuite/gcc.dg/attr-weak-hidden-1.c b/gcc/testsuite/gcc.dg/attr-weak-hidden-1.c
index 968bab7ad34..b8d75d9c7ca 100644
--- a/gcc/testsuite/gcc.dg/attr-weak-hidden-1.c
+++ b/gcc/testsuite/gcc.dg/attr-weak-hidden-1.c
@@ -3,4 +3,4 @@
/* { dg-require-visibility "" } */
/* { dg-options "-O2" } */
/* { dg-additional-sources "attr-weak-hidden-1a.c" } */
-int __attribute__((weak, visibility("hidden"))) foo (void) { return 0; }
+int __attribute__((visibility("hidden"))) foo (void) { return 0; }
diff --git a/gcc/testsuite/gcc.dg/attr-weakref-3.c b/gcc/testsuite/gcc.dg/attr-weakref-3.c
new file mode 100644
index 00000000000..fe4462a8a3a
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/attr-weakref-3.c
@@ -0,0 +1,3 @@
+/* { dg-do compile } */
+/* { dg-require-weak "" } */
+static int i __attribute__ ((weakref)); /* { dg-warning "attribute should be accompanied" } */
diff --git a/gcc/testsuite/gcc.dg/attr-weakref-4.c b/gcc/testsuite/gcc.dg/attr-weakref-4.c
new file mode 100644
index 00000000000..df5fdebdc40
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/attr-weakref-4.c
@@ -0,0 +1,4 @@
+/* { dg-do compile } */
+/* { dg-require-weak "" } */
+static void __attribute__((weakref("bar"))) foo(void) { } /* { dg-warning "attribute ignored because function is defined" } */
+static int __attribute__((weakref)) a=0; /* { dg-warning "attribute ignored because variable is initialized" } */
diff --git a/gcc/testsuite/gcc.dg/autopar/outer-2.c b/gcc/testsuite/gcc.dg/autopar/outer-2.c
index 351b3499e89..b2e51598203 100644
--- a/gcc/testsuite/gcc.dg/autopar/outer-2.c
+++ b/gcc/testsuite/gcc.dg/autopar/outer-2.c
@@ -6,7 +6,7 @@ void abort (void);
void parloop (int N)
{
int i, j,ii;
- int x[400][10][400];
+ int x[401][10][401];
for (ii = 0; ii < N; ii++)
for (i = 0; i < N; i++)
diff --git a/gcc/testsuite/gcc.dg/autopar/pr46194.c b/gcc/testsuite/gcc.dg/autopar/pr46194.c
new file mode 100644
index 00000000000..574d6e6722c
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/autopar/pr46194.c
@@ -0,0 +1,24 @@
+/* PR tree-optimization/46194 */
+/* { dg-do compile } */
+/* { dg-options "-O -ftree-parallelize-loops=2 -fdump-tree-parloops-details" } */
+
+#define N 1000
+int a[N];
+
+int foo (void)
+{
+ int j;
+ int i;
+
+ /* This is not blocked as it is not profitable. */
+ for (i = 0; i < N; i++)
+ for (j = 0; j < N; j++)
+ a[j] = a[i] + 1;
+
+ return a[0];
+}
+
+/* This loop cannot be parallelized due to a dependence. */
+
+/* { dg-final { scan-tree-dump-times "SUCCESS: may be parallelized" 0 "parloops" } } */
+/* { dg-final { cleanup-tree-dump "parloops" } } */
diff --git a/gcc/testsuite/gcc.dg/builtins-config.h b/gcc/testsuite/gcc.dg/builtins-config.h
index 487da415c76..49ec0dcc8e4 100644
--- a/gcc/testsuite/gcc.dg/builtins-config.h
+++ b/gcc/testsuite/gcc.dg/builtins-config.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003, 2004, 2005, 2006, 2009 Free Software Foundation.
+/* Copyright (C) 2003, 2004, 2005, 2006, 2009, 2011 Free Software Foundation.
Define macros useful in tests for bulitin functions. */
@@ -11,8 +11,6 @@
#if defined(__hppa) && defined(__hpux)
/* PA HP-UX doesn't have the entire C99 runtime. */
-#elif defined(__sgi)
-/* Irix6 doesn't have the entire C99 runtime. */
#elif defined(__AVR__)
/* AVR doesn't have the entire C99 runtime. */
#elif defined(__FreeBSD__) && (__FreeBSD__ < 9)
diff --git a/gcc/testsuite/gcc.dg/cpp/include7.c b/gcc/testsuite/gcc.dg/cpp/include7.c
new file mode 100644
index 00000000000..0e95601f777
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/cpp/include7.c
@@ -0,0 +1,3 @@
+/* { dg-do compile } */
+/* { dg-options "-I \"\"" } */
+
diff --git a/gcc/testsuite/gcc.dg/debug/pr47498.c b/gcc/testsuite/gcc.dg/debug/pr47498.c
new file mode 100644
index 00000000000..6bf1484cfaf
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/debug/pr47498.c
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fsched2-use-superblocks -fcompare-debug" } */
+
+int bar(void *);
+
+void foo (void *p)
+{
+ int i = 1;
+ while (i)
+ i = bar (p);
+}
diff --git a/gcc/testsuite/gcc.dg/debug/pr47501.c b/gcc/testsuite/gcc.dg/debug/pr47501.c
new file mode 100644
index 00000000000..3bfb5acc7e2
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/debug/pr47501.c
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+/* { dg-options "-Os -fmodulo-sched -fcompare-debug" } */
+
+void
+foo (void)
+{
+ unsigned numlen;
+ unsigned foldlen;
+ for (; foldlen; foldlen -= numlen)
+ foo ();
+}
diff --git a/gcc/testsuite/gcc.dg/dll-10.c b/gcc/testsuite/gcc.dg/dll-10.c
new file mode 100644
index 00000000000..2f0c6ce31a5
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/dll-10.c
@@ -0,0 +1,54 @@
+/* { dg-do link } */
+/* { dg-require-dll "" } */
+/* { dg-additional-sources "dll-10a.c" } */
+/* { dg-options "-w -O2 -std=gnu99 -fno-keep-inline-dllexport" } */
+/* { dg-prune-output .*undefined.* } */
+/* { dg-xfail-if "link failure expected" { *-*-* } } */
+
+/* Test that inline functions declared "dllexport" appear in object files,
+ even if they are not called - except when -fno-keep-inline-dllexport.
+
+ This behavior is required by the ARM C++ ABI:
+
+ Exporting a function that can be inlined should force the
+ creation and export of an out-of-line copy of it.
+
+ and should presumably also apply.
+
+ Visual Studio 2005 also honors that rule. */
+
+__declspec(dllexport) inline void i1() {}
+
+__declspec(dllexport) extern inline void e1() {}
+
+/* It is invalid to declare the function inline after its definition. */
+#if 0
+__declspec(dllexport) void i2() {}
+inline void i2();
+
+__declspec(dllexport) extern void e2() {}
+inline void e2();
+#endif
+
+__declspec(dllexport) inline void i3() {}
+void i3();
+
+__declspec(dllexport) inline void e3() {}
+extern void e3();
+
+__declspec(dllexport) void i4();
+inline void i4() {};
+
+__declspec(dllexport) extern void e4();
+inline void e4() {};
+
+__declspec(dllexport) inline void i5();
+void i5() {};
+
+__declspec(dllexport) inline void e5();
+extern void e5() {};
+
+/* Make sure that just declaring the function -- without defining it
+ -- does not cause errors. */
+__declspec(dllexport) inline void i6();
+__declspec(dllexport) extern inline void e6();
diff --git a/gcc/testsuite/gcc.dg/dll-10a.c b/gcc/testsuite/gcc.dg/dll-10a.c
new file mode 100644
index 00000000000..80caf321742
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/dll-10a.c
@@ -0,0 +1,21 @@
+extern void i1();
+extern void i3();
+extern void i4();
+extern void i5();
+
+extern void e1();
+extern void e3();
+extern void e4();
+extern void e5();
+
+int main () {
+ i1();
+ i3();
+ i4();
+ i5();
+
+ e1();
+ e3();
+ e4();
+ e5();
+}
diff --git a/gcc/testsuite/gcc.dg/dll-11.c b/gcc/testsuite/gcc.dg/dll-11.c
new file mode 100644
index 00000000000..5fa2e6f19f5
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/dll-11.c
@@ -0,0 +1,52 @@
+/* { dg-do link } */
+/* { dg-require-dll "" } */
+/* { dg-additional-sources "dll-11a.c" } */
+/* { dg-options "-w -O2 -std=gnu89 -fkeep-inline-dllexport" } */
+
+/* Test that inline functions declared "dllexport" appear in object files,
+ even if they are not called, when -fkeep-inline-dllexport is supplied.
+
+ This behavior is required by the ARM C++ ABI:
+
+ Exporting a function that can be inlined should force the
+ creation and export of an out-of-line copy of it.
+
+ and should presumably also apply.
+
+ Visual Studio 2005 also honors that rule. */
+
+__declspec(dllexport) inline void i1() {}
+
+__declspec(dllexport) extern inline void e1() {}
+
+/* It is invalid to declare the function inline after its definition. */
+#if 0
+__declspec(dllexport) void i2() {}
+inline void i2();
+
+__declspec(dllexport) extern void e2() {}
+inline void e2();
+#endif
+
+__declspec(dllexport) inline void i3() {}
+void i3();
+
+__declspec(dllexport) inline void e3() {}
+extern void e3();
+
+__declspec(dllexport) void i4();
+inline void i4() {};
+
+__declspec(dllexport) extern void e4();
+inline void e4() {};
+
+__declspec(dllexport) inline void i5();
+void i5() {};
+
+__declspec(dllexport) inline void e5();
+extern void e5() {};
+
+/* Make sure that just declaring the function -- without defining it
+ -- does not cause errors. */
+__declspec(dllexport) inline void i6();
+__declspec(dllexport) extern inline void e6();
diff --git a/gcc/testsuite/gcc.dg/dll-11a.c b/gcc/testsuite/gcc.dg/dll-11a.c
new file mode 100644
index 00000000000..80caf321742
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/dll-11a.c
@@ -0,0 +1,21 @@
+extern void i1();
+extern void i3();
+extern void i4();
+extern void i5();
+
+extern void e1();
+extern void e3();
+extern void e4();
+extern void e5();
+
+int main () {
+ i1();
+ i3();
+ i4();
+ i5();
+
+ e1();
+ e3();
+ e4();
+ e5();
+}
diff --git a/gcc/testsuite/gcc.dg/dll-12.c b/gcc/testsuite/gcc.dg/dll-12.c
new file mode 100644
index 00000000000..4f8829964a7
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/dll-12.c
@@ -0,0 +1,52 @@
+/* { dg-do link } */
+/* { dg-require-dll "" } */
+/* { dg-additional-sources "dll-12a.c" } */
+/* { dg-options "-w -O2 -std=gnu99 -fkeep-inline-dllexport" } */
+
+/* Test that inline functions declared "dllexport" appear in object files,
+ even if they are not called, when -fkeep-inline-dllexport is supplied.
+
+ This behavior is required by the ARM C++ ABI:
+
+ Exporting a function that can be inlined should force the
+ creation and export of an out-of-line copy of it.
+
+ and should presumably also apply.
+
+ Visual Studio 2005 also honors that rule. */
+
+__declspec(dllexport) inline void i1() {}
+
+__declspec(dllexport) extern inline void e1() {}
+
+/* It is invalid to declare the function inline after its definition. */
+#if 0
+__declspec(dllexport) void i2() {}
+inline void i2();
+
+__declspec(dllexport) extern void e2() {}
+inline void e2();
+#endif
+
+__declspec(dllexport) inline void i3() {}
+void i3();
+
+__declspec(dllexport) inline void e3() {}
+extern void e3();
+
+__declspec(dllexport) void i4();
+inline void i4() {};
+
+__declspec(dllexport) extern void e4();
+inline void e4() {};
+
+__declspec(dllexport) inline void i5();
+void i5() {};
+
+__declspec(dllexport) inline void e5();
+extern void e5() {};
+
+/* Make sure that just declaring the function -- without defining it
+ -- does not cause errors. */
+__declspec(dllexport) inline void i6();
+__declspec(dllexport) extern inline void e6();
diff --git a/gcc/testsuite/gcc.dg/dll-12a.c b/gcc/testsuite/gcc.dg/dll-12a.c
new file mode 100644
index 00000000000..80caf321742
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/dll-12a.c
@@ -0,0 +1,21 @@
+extern void i1();
+extern void i3();
+extern void i4();
+extern void i5();
+
+extern void e1();
+extern void e3();
+extern void e4();
+extern void e5();
+
+int main () {
+ i1();
+ i3();
+ i4();
+ i5();
+
+ e1();
+ e3();
+ e4();
+ e5();
+}
diff --git a/gcc/testsuite/gcc.dg/dll-9.c b/gcc/testsuite/gcc.dg/dll-9.c
new file mode 100644
index 00000000000..ae641d29d6c
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/dll-9.c
@@ -0,0 +1,54 @@
+/* { dg-do link } */
+/* { dg-require-dll "" } */
+/* { dg-additional-sources "dll-9a.c" } */
+/* { dg-options "-w -O2 -std=gnu89 -fno-keep-inline-dllexport" } */
+/* { dg-prune-output .*undefined.* } */
+/* { dg-xfail-if "link failure expected" { *-*-* } } */
+
+/* Test that inline functions declared "dllexport" appear in object files,
+ even if they are not called - except when -fno-keep-inline-dllexport.
+
+ This behavior is required by the ARM C++ ABI:
+
+ Exporting a function that can be inlined should force the
+ creation and export of an out-of-line copy of it.
+
+ and should presumably also apply.
+
+ Visual Studio 2005 also honors that rule. */
+
+__declspec(dllexport) inline void i1() {}
+
+__declspec(dllexport) extern inline void e1() {}
+
+/* It is invalid to declare the function inline after its definition. */
+#if 0
+__declspec(dllexport) void i2() {}
+inline void i2();
+
+__declspec(dllexport) extern void e2() {}
+inline void e2();
+#endif
+
+__declspec(dllexport) inline void i3() {}
+void i3();
+
+__declspec(dllexport) inline void e3() {}
+extern void e3();
+
+__declspec(dllexport) void i4();
+inline void i4() {};
+
+__declspec(dllexport) extern void e4();
+inline void e4() {};
+
+__declspec(dllexport) inline void i5();
+void i5() {};
+
+__declspec(dllexport) inline void e5();
+extern void e5() {};
+
+/* Make sure that just declaring the function -- without defining it
+ -- does not cause errors. */
+__declspec(dllexport) inline void i6();
+__declspec(dllexport) extern inline void e6();
diff --git a/gcc/testsuite/gcc.dg/dll-9a.c b/gcc/testsuite/gcc.dg/dll-9a.c
new file mode 100644
index 00000000000..80caf321742
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/dll-9a.c
@@ -0,0 +1,21 @@
+extern void i1();
+extern void i3();
+extern void i4();
+extern void i5();
+
+extern void e1();
+extern void e3();
+extern void e4();
+extern void e5();
+
+int main () {
+ i1();
+ i3();
+ i4();
+ i5();
+
+ e1();
+ e3();
+ e4();
+ e5();
+}
diff --git a/gcc/testsuite/gcc.dg/graphite/block-0.c b/gcc/testsuite/gcc.dg/graphite/block-0.c
index af023634226..9bf97126df8 100644
--- a/gcc/testsuite/gcc.dg/graphite/block-0.c
+++ b/gcc/testsuite/gcc.dg/graphite/block-0.c
@@ -12,6 +12,7 @@ foo (void)
int j;
int i;
+ /* This is not blocked as it is not profitable. */
for (i = 0; i < N; i++)
for (j = 0; j < N; j++)
a[j] = a[i] + 1;
@@ -41,5 +42,5 @@ main (void)
return 0;
}
-/* { dg-final { scan-tree-dump-times "will be loop blocked" 1 "graphite" { xfail *-*-* } } } */
+/* { dg-final { scan-tree-dump-not "will be loop blocked" "graphite" } } */
/* { dg-final { cleanup-tree-dump "graphite" } } */
diff --git a/gcc/testsuite/gcc.dg/graphite/block-1.c b/gcc/testsuite/gcc.dg/graphite/block-1.c
index 876d6f08360..d335345a699 100644
--- a/gcc/testsuite/gcc.dg/graphite/block-1.c
+++ b/gcc/testsuite/gcc.dg/graphite/block-1.c
@@ -17,6 +17,7 @@ main (void)
int A[MAX * MAX];
int B[MAX * MAX];
+ /* These loops should be loop blocked. */
for (i = 0; i < MAX; i++)
for (j = 0; j < MAX; j++)
{
@@ -24,10 +25,12 @@ main (void)
B[i*MAX + j] = j;
}
+ /* These loops should be loop blocked. */
for (i = 0; i < MAX; i++)
for (j = 0; j < MAX; j++)
A[i*MAX + j] += B[j*MAX + i];
+ /* These loops should be loop blocked. */
for(i = 0; i < MAX; i++)
for(j = 0; j < MAX; j++)
sum += A[i*MAX + j];
@@ -42,5 +45,5 @@ main (void)
return 0;
}
-/* { dg-final { scan-tree-dump-times "will be loop blocked" 2 "graphite" { xfail *-*-* } } } */
+/* { dg-final { scan-tree-dump-times "will be loop blocked" 3 "graphite" } } */
/* { dg-final { cleanup-tree-dump "graphite" } } */
diff --git a/gcc/testsuite/gcc.dg/graphite/block-4.c b/gcc/testsuite/gcc.dg/graphite/block-4.c
index ac22ec3aff2..eb98f0447aa 100644
--- a/gcc/testsuite/gcc.dg/graphite/block-4.c
+++ b/gcc/testsuite/gcc.dg/graphite/block-4.c
@@ -15,11 +15,13 @@ foo (void)
{
int i, j, k;
+ /* This should NOT be blocked: each loop iterates only 24 times. */
for (i = 0; i < 24; i++)
for (j = 0; j < 24; j++)
for (k = 0; k < 24; k++)
A[i][j] = B[i][k] * C[k][j];
+ /* This should be blocked. */
for (i = 0; i < M; i++)
for (j = 0; j < M; j++)
for (k = 0; k < M; k++)
diff --git a/gcc/testsuite/gcc.dg/graphite/block-7.c b/gcc/testsuite/gcc.dg/graphite/block-7.c
index 07c626ccd1d..fbbe1f3ad51 100644
--- a/gcc/testsuite/gcc.dg/graphite/block-7.c
+++ b/gcc/testsuite/gcc.dg/graphite/block-7.c
@@ -14,6 +14,7 @@ matmult (void)
{
int i, j, k;
+ /* This should be blocked. */
for (i = 0; i < N; i++)
for (j = 0; j < N; j++)
{
@@ -52,5 +53,5 @@ main (void)
return 0;
}
-/* { dg-final { scan-tree-dump-times "will be loop blocked" 1 "graphite" { xfail *-*-* } } } */
+/* { dg-final { scan-tree-dump-times "will be loop blocked" 1 "graphite" } } */
/* { dg-final { cleanup-tree-dump "graphite" } } */
diff --git a/gcc/testsuite/gcc.dg/graphite/block-8.c b/gcc/testsuite/gcc.dg/graphite/block-8.c
new file mode 100644
index 00000000000..9c1c9cebe83
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/graphite/block-8.c
@@ -0,0 +1,58 @@
+/* { dg-require-effective-target size32plus } */
+
+#define DEBUG 0
+#if DEBUG
+#include <stdio.h>
+#endif
+
+#define N 200
+
+int A[N][N], B[N][N], C[N][N];
+
+static void __attribute__((noinline))
+matmult (void)
+{
+ int i, j, k;
+
+ for (i = 0; i < N; i++)
+ for (j = 0; j < N; j++)
+ A[i][j] = 0;
+
+ /* This should be blocked. */
+ for (i = 0; i < N; i++)
+ for (j = 0; j < N; j++)
+ for (k = 0; k < N; k++)
+ A[i][j] += B[i][k] * C[k][j];
+}
+
+extern void abort ();
+
+int
+main (void)
+{
+ int i, j, res = 0;
+
+ for (i = 0; i < N; i++)
+ for (j = 0; j < N; j++)
+ {
+ B[i][j] = j;
+ C[i][j] = i;
+ }
+
+ matmult ();
+
+ for (i = 0; i < N; i++)
+ res += A[i][i];
+
+#if DEBUG
+ fprintf (stderr, "res = %d \n", res);
+#endif
+
+ if (res != 529340000)
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "will be loop blocked" 1 "graphite" } } */
+/* { dg-final { cleanup-tree-dump "graphite" } } */
diff --git a/gcc/testsuite/gcc.dg/graphite/graphite.exp b/gcc/testsuite/gcc.dg/graphite/graphite.exp
index 74e1ed8172d..cdf35ebab8a 100644
--- a/gcc/testsuite/gcc.dg/graphite/graphite.exp
+++ b/gcc/testsuite/gcc.dg/graphite/graphite.exp
@@ -58,7 +58,7 @@ dg-runtest $block_files "" "-O2 -floop-block -fno-loop-strip-mine -fno-loo
# Vectorizer tests, to be run or compiled, depending on target capabilities.
global DEFAULT_VECTCFLAGS
-set DEFAULT_VECTCFLAGS "-O2 -fgraphite-identity -ftree-vectorize -fno-vect-cost-model -fdump-tree-vect-details"
+set DEFAULT_VECTCFLAGS "-O2 -fgraphite-identity -ftree-vectorize -fno-vect-cost-model -fdump-tree-vect-details -ffast-math"
if [check_vect_support_and_set_flags] {
dg-runtest $vect_files "" $DEFAULT_VECTCFLAGS
diff --git a/gcc/testsuite/gcc.dg/graphite/id-pr46834.c b/gcc/testsuite/gcc.dg/graphite/id-pr46834.c
new file mode 100644
index 00000000000..8d89b8e3ca8
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/graphite/id-pr46834.c
@@ -0,0 +1,12 @@
+/* { dg-options "-O -fgraphite-identity -ffast-math -fno-tree-dce" } */
+
+void foo ()
+{
+ int M0[4][4], M3[4] = {};
+ int i=-1;
+ int ii, jj;
+ for (; i; i++)
+ for (jj = 0; jj < 4; jj++)
+ for (ii = 0; ii < 4; ii++)
+ M3[1] += __builtin_abs (M0[ii][0]);
+}
diff --git a/gcc/testsuite/gcc.dg/graphite/interchange-1.c b/gcc/testsuite/gcc.dg/graphite/interchange-1.c
index 787124f56a4..b4559d13214 100644
--- a/gcc/testsuite/gcc.dg/graphite/interchange-1.c
+++ b/gcc/testsuite/gcc.dg/graphite/interchange-1.c
@@ -15,6 +15,7 @@ foo (int N)
int i, j;
double sum = 0.0;
+ /* These two loops should be interchanged. */
for (i = 0; i < N; i++)
{
for (j = 0; j < N; j++)
@@ -48,6 +49,5 @@ main (void)
return 0;
}
-
-/* { dg-final { scan-tree-dump-times "will be interchanged" 1 "graphite" { xfail *-*-* } } } */
+/* { dg-final { scan-tree-dump-times "will be interchanged" 1 "graphite" } } */
/* { dg-final { cleanup-tree-dump "graphite" } } */
diff --git a/gcc/testsuite/gcc.dg/graphite/interchange-11.c b/gcc/testsuite/gcc.dg/graphite/interchange-11.c
index 95b60b86584..491fda15c5f 100644
--- a/gcc/testsuite/gcc.dg/graphite/interchange-11.c
+++ b/gcc/testsuite/gcc.dg/graphite/interchange-11.c
@@ -13,6 +13,7 @@ foo (int N, int *res)
int i, j;
double sum = 0.0;
+ /* These two loops should be interchanged. */
for (i = 0; i < 1335; i++)
{
for (j = 0; j < 1335; j++)
@@ -45,5 +46,5 @@ main (void)
return 0;
}
-/* { dg-final { scan-tree-dump-times "will be interchanged" 1 "graphite" { xfail *-*-* } } } */
+/* { dg-final { scan-tree-dump-times "will be interchanged" 1 "graphite" } } */
/* { dg-final { cleanup-tree-dump "graphite" } } */
diff --git a/gcc/testsuite/gcc.dg/graphite/interchange-12.c b/gcc/testsuite/gcc.dg/graphite/interchange-12.c
index 16c0ddbd6c7..fc27b4c5358 100644
--- a/gcc/testsuite/gcc.dg/graphite/interchange-12.c
+++ b/gcc/testsuite/gcc.dg/graphite/interchange-12.c
@@ -14,6 +14,7 @@ matmult (void)
{
int i, j, k;
+ /* Loops J and K should be interchanged. */
for (i = 0; i < N; i++)
for (j = 0; j < N; j++)
{
@@ -52,5 +53,5 @@ main (void)
return 0;
}
-/* { dg-final { scan-tree-dump-times "will be interchanged" 1 "graphite" { xfail *-*-* } } } */
+/* { dg-final { scan-tree-dump-times "will be interchanged" 1 "graphite" } } */
/* { dg-final { cleanup-tree-dump "graphite" } } */
diff --git a/gcc/testsuite/gcc.dg/graphite/interchange-13.c b/gcc/testsuite/gcc.dg/graphite/interchange-13.c
new file mode 100644
index 00000000000..a8bf23be5a1
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/graphite/interchange-13.c
@@ -0,0 +1,54 @@
+/* { dg-require-effective-target size32plus } */
+
+/* Formerly known as ltrans-1.c */
+
+#define DEBUG 0
+#if DEBUG
+#include <stdio.h>
+#endif
+
+double u[25];
+
+static int __attribute__((noinline))
+foo (int N)
+{
+ int i, j;
+ double sum = 0.0;
+
+ /* These two loops should be interchanged. */
+ for (i = 0; i < N; i++)
+ {
+ for (j = 0; j < N; j++)
+ sum = sum + u[i + 5 * j];
+
+ u[6 * i] *= 2;
+ }
+
+ return sum + N + u[6];
+}
+
+extern void abort ();
+
+int
+main (void)
+{
+ int i, j, res;
+
+ for (i = 0; i < 25; i++)
+ u[i] = 2;
+
+ res = foo (5);
+
+#if DEBUG
+ fprintf (stderr, "res = %d \n", res);
+#endif
+
+ if (res != 59)
+ abort ();
+
+ return 0;
+}
+
+
+/* { dg-final { scan-tree-dump-times "will be interchanged" 1 "graphite" } } */
+/* { dg-final { cleanup-tree-dump "graphite" } } */
diff --git a/gcc/testsuite/gcc.dg/graphite/interchange-14.c b/gcc/testsuite/gcc.dg/graphite/interchange-14.c
new file mode 100644
index 00000000000..53809b54d7d
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/graphite/interchange-14.c
@@ -0,0 +1,58 @@
+/* { dg-require-effective-target size32plus } */
+
+#define DEBUG 0
+#if DEBUG
+#include <stdio.h>
+#endif
+
+#define N 200
+
+int A[N][N], B[N][N], C[N][N];
+
+static void __attribute__((noinline))
+matmult (void)
+{
+ int i, j, k;
+
+ for (i = 0; i < N; i++)
+ for (j = 0; j < N; j++)
+ A[i][j] = 0;
+
+ /* Loops J and K should be interchanged. */
+ for (i = 0; i < N; i++)
+ for (j = 0; j < N; j++)
+ for (k = 0; k < N; k++)
+ A[i][j] += B[i][k] * C[k][j];
+}
+
+extern void abort ();
+
+int
+main (void)
+{
+ int i, j, res = 0;
+
+ for (i = 0; i < N; i++)
+ for (j = 0; j < N; j++)
+ {
+ B[i][j] = j;
+ C[i][j] = i;
+ }
+
+ matmult ();
+
+ for (i = 0; i < N; i++)
+ res += A[i][i];
+
+#if DEBUG
+ fprintf (stderr, "res = %d \n", res);
+#endif
+
+ if (res != 529340000)
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "will be interchanged" 1 "graphite" } } */
+/* { dg-final { cleanup-tree-dump "graphite" } } */
diff --git a/gcc/testsuite/gcc.dg/graphite/interchange-15.c b/gcc/testsuite/gcc.dg/graphite/interchange-15.c
new file mode 100644
index 00000000000..9eeef661731
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/graphite/interchange-15.c
@@ -0,0 +1,53 @@
+/* { dg-require-effective-target size32plus } */
+
+#define DEBUG 0
+#if DEBUG
+#include <stdio.h>
+#endif
+
+#define NMAX 2000
+
+static int x[NMAX], a[NMAX][NMAX];
+
+static int __attribute__((noinline))
+mvt (long N)
+{
+ int i,j;
+
+ /* These two loops should be interchanged. */
+ for (i = 0; i < N; i++)
+ for (j = 0; j < N; j++)
+ x[i] += a[j][i];
+
+ return x[1];
+}
+
+extern void abort ();
+
+int
+main (void)
+{
+ int i, j, res;
+
+ for (i = 0; i < NMAX; i++)
+ for (j = 0; j < NMAX; j++)
+ a[i][j] = j;
+
+ for (i = 0; i < NMAX; i++)
+ x[i] = i;
+
+ res = mvt (NMAX);
+
+#if DEBUG
+ fprintf (stderr, "res = %d \n", res);
+#endif
+
+ if (res != 2001)
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "will be interchanged" 1 "graphite" } } */
+/* { dg-final { cleanup-tree-dump "graphite" } } */
+
diff --git a/gcc/testsuite/gcc.dg/graphite/interchange-8.c b/gcc/testsuite/gcc.dg/graphite/interchange-8.c
index 8c07b6f7ff1..ca99dbc13a1 100644
--- a/gcc/testsuite/gcc.dg/graphite/interchange-8.c
+++ b/gcc/testsuite/gcc.dg/graphite/interchange-8.c
@@ -11,6 +11,8 @@ foo (void)
{
int i, j, k, l;
+ /* Loops (L, J) are interchanged, and then loops (J and K) are
+ interchanged. The result is a nest starting with (K, J, L). */
for (l = 0; l < 4; l++)
{
for (k = 0; k < 4; k++)
@@ -80,6 +82,5 @@ main (void)
return 0;
}
-/* Loops K and L should be interchanged. */
-/* { dg-final { scan-tree-dump-times "will be interchanged" 1 "graphite" { xfail *-*-* } } } */
+/* { dg-final { scan-tree-dump-times "will be interchanged" 2 "graphite" } } */
/* { dg-final { cleanup-tree-dump "graphite" } } */
diff --git a/gcc/testsuite/gcc.dg/graphite/interchange-mvt.c b/gcc/testsuite/gcc.dg/graphite/interchange-mvt.c
index 62a9c462eb0..ee262e9f765 100644
--- a/gcc/testsuite/gcc.dg/graphite/interchange-mvt.c
+++ b/gcc/testsuite/gcc.dg/graphite/interchange-mvt.c
@@ -19,6 +19,7 @@ mvt (long N)
for (j = 0; j < N; j++)
x1[i] = x1[i] + a[i][j] * y1[j];
+ /* These two loops should be interchanged. */
for (i = 0; i < N; i++)
for (j = 0; j < N; j++)
x2[i] = x2[i] + a[j][i] * y2[j];
@@ -57,6 +58,6 @@ main (void)
return 0;
}
-/* { dg-final { scan-tree-dump-times "will be interchanged" 1 "graphite" { xfail *-*-* } } } */
+/* { dg-final { scan-tree-dump-times "will be interchanged" 1 "graphite" } } */
/* { dg-final { cleanup-tree-dump "graphite" } } */
diff --git a/gcc/testsuite/gcc.dg/pr18792.c b/gcc/testsuite/gcc.dg/graphite/pr18792.c
index 4e93fe145f3..4e93fe145f3 100644
--- a/gcc/testsuite/gcc.dg/pr18792.c
+++ b/gcc/testsuite/gcc.dg/graphite/pr18792.c
diff --git a/gcc/testsuite/gcc.dg/pr19910.c b/gcc/testsuite/gcc.dg/graphite/pr19910.c
index 1ee0d213b8a..1ee0d213b8a 100644
--- a/gcc/testsuite/gcc.dg/pr19910.c
+++ b/gcc/testsuite/gcc.dg/graphite/pr19910.c
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20041110-1.c b/gcc/testsuite/gcc.dg/graphite/pr20041110-1.c
index 825b2b41fa9..825b2b41fa9 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/20041110-1.c
+++ b/gcc/testsuite/gcc.dg/graphite/pr20041110-1.c
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr20256.c b/gcc/testsuite/gcc.dg/graphite/pr20256.c
index aa482edab63..29c8ebd14e2 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/pr20256.c
+++ b/gcc/testsuite/gcc.dg/graphite/pr20256.c
@@ -1,5 +1,5 @@
-/* { dg-do compile } */
-/* { dg-options "-O2 -ftree-loop-linear -fdump-tree-ltrans-all" } */
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-loop-linear" } */
/* { dg-require-effective-target size32plus } */
int foo()
@@ -20,6 +20,3 @@ int foo()
return s;
}
-
-/* { dg-final { scan-tree-dump-times "converted loop nest to perfect loop nest" 0 "ltrans"} } */
-/* { dg-final { cleanup-tree-dump "ltrans" } } */
diff --git a/gcc/testsuite/gcc.dg/pr23625.c b/gcc/testsuite/gcc.dg/graphite/pr23625.c
index aaeddb2886d..aaeddb2886d 100644
--- a/gcc/testsuite/gcc.dg/pr23625.c
+++ b/gcc/testsuite/gcc.dg/graphite/pr23625.c
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr23820.c b/gcc/testsuite/gcc.dg/graphite/pr23820.c
index ee855e13941..ee855e13941 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/pr23820.c
+++ b/gcc/testsuite/gcc.dg/graphite/pr23820.c
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr24309.c b/gcc/testsuite/gcc.dg/graphite/pr24309.c
index b50e7a8ca7a..b50e7a8ca7a 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/pr24309.c
+++ b/gcc/testsuite/gcc.dg/graphite/pr24309.c
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr26435.c b/gcc/testsuite/gcc.dg/graphite/pr26435.c
index 907c5d28dc4..4e5e5f74d7a 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/pr26435.c
+++ b/gcc/testsuite/gcc.dg/graphite/pr26435.c
@@ -1,5 +1,5 @@
-/* { dg-do compile } */
-/* { dg-options "-O2 -ftree-loop-linear -fdump-tree-ltrans-all" } */
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-loop-linear" } */
/* { dg-require-effective-target size32plus } */
int foo(int *p, int n)
@@ -15,6 +15,3 @@ int foo(int *p, int n)
return k;
}
-
-/* { dg-final { scan-tree-dump-times "converted loop nest to perfect loop nest" 0 "ltrans"} } */
-/* { dg-final { cleanup-tree-dump "ltrans" } } */
diff --git a/gcc/testsuite/gcc.dg/pr29330.c b/gcc/testsuite/gcc.dg/graphite/pr29330.c
index dff42077946..dff42077946 100644
--- a/gcc/testsuite/gcc.dg/pr29330.c
+++ b/gcc/testsuite/gcc.dg/graphite/pr29330.c
diff --git a/gcc/testsuite/gcc.dg/pr29581-1.c b/gcc/testsuite/gcc.dg/graphite/pr29581-1.c
index e5400735525..e5400735525 100644
--- a/gcc/testsuite/gcc.dg/pr29581-1.c
+++ b/gcc/testsuite/gcc.dg/graphite/pr29581-1.c
diff --git a/gcc/testsuite/gcc.dg/pr29581-2.c b/gcc/testsuite/gcc.dg/graphite/pr29581-2.c
index c99d78ce2f1..c99d78ce2f1 100644
--- a/gcc/testsuite/gcc.dg/pr29581-2.c
+++ b/gcc/testsuite/gcc.dg/graphite/pr29581-2.c
diff --git a/gcc/testsuite/gcc.dg/pr29581-3.c b/gcc/testsuite/gcc.dg/graphite/pr29581-3.c
index c9d72ce281f..c9d72ce281f 100644
--- a/gcc/testsuite/gcc.dg/pr29581-3.c
+++ b/gcc/testsuite/gcc.dg/graphite/pr29581-3.c
diff --git a/gcc/testsuite/gcc.dg/pr29581-4.c b/gcc/testsuite/gcc.dg/graphite/pr29581-4.c
index c2d894c8d20..c2d894c8d20 100644
--- a/gcc/testsuite/gcc.dg/pr29581-4.c
+++ b/gcc/testsuite/gcc.dg/graphite/pr29581-4.c
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/loop-27.c b/gcc/testsuite/gcc.dg/graphite/pr30565.c
index 802b7c2aa2b..802b7c2aa2b 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/loop-27.c
+++ b/gcc/testsuite/gcc.dg/graphite/pr30565.c
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr31183.c b/gcc/testsuite/gcc.dg/graphite/pr31183.c
index 000d7b5bfc3..000d7b5bfc3 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/pr31183.c
+++ b/gcc/testsuite/gcc.dg/graphite/pr31183.c
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr33576.c b/gcc/testsuite/gcc.dg/graphite/pr33576.c
index 2470762f7a7..2470762f7a7 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/pr33576.c
+++ b/gcc/testsuite/gcc.dg/graphite/pr33576.c
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr33766.c b/gcc/testsuite/gcc.dg/graphite/pr33766.c
index f6bb50615a0..f6bb50615a0 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/pr33766.c
+++ b/gcc/testsuite/gcc.dg/graphite/pr33766.c
diff --git a/gcc/testsuite/gcc.dg/pr34016.c b/gcc/testsuite/gcc.dg/graphite/pr34016.c
index 5ca84bb6206..5ca84bb6206 100644
--- a/gcc/testsuite/gcc.dg/pr34016.c
+++ b/gcc/testsuite/gcc.dg/graphite/pr34016.c
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr34017.c b/gcc/testsuite/gcc.dg/graphite/pr34017.c
index ee279b7c8df..ee279b7c8df 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/pr34017.c
+++ b/gcc/testsuite/gcc.dg/graphite/pr34017.c
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr34123.c b/gcc/testsuite/gcc.dg/graphite/pr34123.c
index 81dbf3aacdc..81dbf3aacdc 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/pr34123.c
+++ b/gcc/testsuite/gcc.dg/graphite/pr34123.c
diff --git a/gcc/testsuite/gcc.dg/graphite/pr35356-2.c b/gcc/testsuite/gcc.dg/graphite/pr35356-2.c
index e5b0213768c..66cfdea5aef 100644
--- a/gcc/testsuite/gcc.dg/graphite/pr35356-2.c
+++ b/gcc/testsuite/gcc.dg/graphite/pr35356-2.c
@@ -39,6 +39,6 @@ foo (int bar, int n, int k)
*/
-/* { dg-final { scan-tree-dump-times "MIN_EXPR" 2 "graphite" } } */
-/* { dg-final { scan-tree-dump-times "MAX_EXPR" 2 "graphite" } } */
+/* { dg-final { scan-tree-dump-times "MIN_EXPR" 4 "graphite" } } */
+/* { dg-final { scan-tree-dump-times "MAX_EXPR" 4 "graphite" } } */
/* { dg-final { cleanup-tree-dump "graphite" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr36287.c b/gcc/testsuite/gcc.dg/graphite/pr36287.c
index 51b77c7157d..51b77c7157d 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/pr36287.c
+++ b/gcc/testsuite/gcc.dg/graphite/pr36287.c
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr37686.c b/gcc/testsuite/gcc.dg/graphite/pr37686.c
index a5094bf9754..a5094bf9754 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/pr37686.c
+++ b/gcc/testsuite/gcc.dg/graphite/pr37686.c
diff --git a/gcc/testsuite/gcc.dg/graphite/pr42917.c b/gcc/testsuite/gcc.dg/graphite/pr42917.c
new file mode 100644
index 00000000000..eddff3b5844
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/graphite/pr42917.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -ftree-loop-linear -fcompare-debug" } */
+
+extern int A[];
+
+void
+foo ()
+{
+ int i, j;
+ for (i = 0; i < 4; i++)
+ for (j = 255; j >= 0; j--)
+ A[j] = 0;
+}
diff --git a/gcc/testsuite/gcc.dg/graphite/pr43567.c b/gcc/testsuite/gcc.dg/graphite/pr43567.c
new file mode 100644
index 00000000000..1bb8042abbb
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/graphite/pr43567.c
@@ -0,0 +1,26 @@
+/* { dg-do run } */
+/* { dg-options "-O2 -fno-inline -fno-tree-ch -ftree-loop-linear" } */
+
+extern void abort ();
+
+int
+test (int n, int *a)
+{
+ int i, j;
+
+ for (i = 0; i < n; i++)
+ for (j = 0; j < n; j++)
+ a[j] = i + n;
+
+ if (a[0] != 31 || i + n - 1 != 31)
+ abort ();
+
+ return 0;
+}
+
+int main (void)
+{
+ int a[16];
+ test (16, a);
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/graphite/pr43657.c b/gcc/testsuite/gcc.dg/graphite/pr43657.c
new file mode 100644
index 00000000000..18afe1e1c8a
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/graphite/pr43657.c
@@ -0,0 +1,52 @@
+/* { dg-do run } */
+/* { dg-options "-O1 -ftree-loop-linear" } */
+
+extern void abort (void);
+
+#define K 32
+
+int cond_array[2*K][K];
+int a[K][K];
+int out[K];
+int check_result[K] = {2,2,2,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
+
+__attribute__ ((noinline)) void
+foo (int c)
+{
+ int res, i, j, k, next;
+
+ for (k = 0; k < K; k++)
+ {
+ res = 0;
+ for (j = 0; j < K; j++)
+ for (i = 0; i < K; i++)
+ {
+ next = a[i][j];
+ res = c > cond_array[i+k][j] ? next : res;
+ }
+
+ out[k] = res;
+ }
+}
+
+int main ()
+{
+ int i, j, k;
+
+ for (j = 0; j < K; j++)
+ {
+ for (i = 0; i < 2*K; i++)
+ cond_array[i][j] = i+j;
+
+ for (i = 0; i < K; i++)
+ a[i][j] = i+2;
+ }
+
+ foo(5);
+
+ for (k = 0; k < K; k++)
+ if (out[k] != check_result[k])
+ abort ();
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/graphite/pr46168.c b/gcc/testsuite/gcc.dg/graphite/pr46168.c
new file mode 100644
index 00000000000..28b48415d97
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/graphite/pr46168.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-O -ftree-loop-linear" } */
+
+int
+foo (int a[4096], int mi, int mj)
+{
+ int i, j, i16;
+ for (i = 0; i < mi; i++)
+ {
+ i16 = i + 16;
+ for (j = 0; j < mj; j++)
+ i16 = a[j] == i16;
+ }
+ return i16;
+}
diff --git a/gcc/testsuite/gcc.dg/graphite/pr46215.c b/gcc/testsuite/gcc.dg/graphite/pr46215.c
new file mode 100644
index 00000000000..cf7b07f2019
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/graphite/pr46215.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fstrict-overflow -fno-tree-ch -ftree-loop-linear" } */
+
+extern int y[], x1[], x2[];
+void
+foo (long n)
+{
+ int i, j;
+ for (i = 0; i < n; i++)
+ for (j = 0; j < n; j += 2)
+ y[i] = x1[i + j] * x2[i + j];
+}
diff --git a/gcc/testsuite/gcc.dg/graphite/pr46970.c b/gcc/testsuite/gcc.dg/graphite/pr46970.c
new file mode 100644
index 00000000000..b1ef7d62b62
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/graphite/pr46970.c
@@ -0,0 +1,28 @@
+/* { dg-do run } */
+/* { dg-options "-Os -ftree-loop-linear" } */
+
+#define N 16
+
+int
+main1 (int n, int *a)
+{
+ int i, j;
+
+ for (i = 0; i < n; i++)
+ for (j = 0; j < n; j++)
+ a[j] = i + n;
+
+ for (j = 0; j < n; j++)
+ if (a[j] != i + n - 1)
+ __builtin_abort ();
+
+ return 0;
+}
+
+int
+main ()
+{
+ int a[N];
+ main1 (N, a);
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/guality/pr41353-1.c b/gcc/testsuite/gcc.dg/guality/pr41353-1.c
index 29ba7351677..1d2cca78707 100644
--- a/gcc/testsuite/gcc.dg/guality/pr41353-1.c
+++ b/gcc/testsuite/gcc.dg/guality/pr41353-1.c
@@ -2,7 +2,7 @@
/* { dg-do run } */
/* { dg-options "-g" } */
-int vari = 17, varj;
+int vari __attribute__((used)) = 17, varj;
__attribute__((noinline)) int
f1 (void)
diff --git a/gcc/testsuite/gcc.dg/guality/pr41353-2.c b/gcc/testsuite/gcc.dg/guality/pr41353-2.c
index 3ff8d3691c8..0983bf4ab59 100644
--- a/gcc/testsuite/gcc.dg/guality/pr41353-2.c
+++ b/gcc/testsuite/gcc.dg/guality/pr41353-2.c
@@ -3,7 +3,7 @@
/* { dg-options "-g" } */
int varh;
-int vari = 17, varj;
+int vari __attribute__((used)) = 17, varj;
__attribute__((noinline)) int
f1 (void)
diff --git a/gcc/testsuite/gcc.dg/lto/20110201-1_0.c b/gcc/testsuite/gcc.dg/lto/20110201-1_0.c
new file mode 100644
index 00000000000..f5d335572ee
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/20110201-1_0.c
@@ -0,0 +1,19 @@
+/* { dg-lto-do run } */
+/* { dg-lto-options { { -O0 -flto } } } */
+/* { dg-extra-ld-options "-O2 -ffast-math -fuse-linker-plugin" } */
+/* { dg-require-linker-plugin "" } */
+
+/* We require a linker plugin because otherwise we'd need to link
+ against libm which we are not sure here has cabs on all targets.
+ This is because collect2 invokes ld on the -O0 object code
+ which does not have folded cabs. */
+
+double cabs(_Complex double);
+double __attribute__((used))
+foo (_Complex double x, int b)
+{
+ if (b)
+ x = 0;
+ return cabs(x);
+}
+int main() { return 0; }
diff --git a/gcc/testsuite/gcc.dg/noreturn-1.c b/gcc/testsuite/gcc.dg/noreturn-1.c
index 1e7a778103e..a3796783a3e 100644
--- a/gcc/testsuite/gcc.dg/noreturn-1.c
+++ b/gcc/testsuite/gcc.dg/noreturn-1.c
@@ -35,7 +35,7 @@ void
foo5(void)
{
return; /* { dg-warning "'noreturn' has a 'return' statement" "detect invalid return" } */
-} /* { dg-warning "function does return" "detect return from noreturn" } */
+} /* { dg-warning "function does return" "detect return from noreturn" { target c } 37 } */
extern void foo6(void);
void
diff --git a/gcc/testsuite/gcc.dg/opts-6.c b/gcc/testsuite/gcc.dg/opts-6.c
new file mode 100644
index 00000000000..b0441dc3939
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/opts-6.c
@@ -0,0 +1,6 @@
+/* Missing option arguments take precedence over wrong-language
+ warnings. */
+/* { dg-do compile } */
+/* { dg-options "-ftemplate-depth=" } */
+
+/* { dg-error "missing argument" "" { target *-*-* } 0 } */
diff --git a/gcc/testsuite/gcc.dg/parse-error-3.c b/gcc/testsuite/gcc.dg/parse-error-3.c
index 1a463b5dd6b..8e72b8170af 100644
--- a/gcc/testsuite/gcc.dg/parse-error-3.c
+++ b/gcc/testsuite/gcc.dg/parse-error-3.c
@@ -1,5 +1,5 @@
/* PR c/43384 */
-/* { dg-do "compile" } */
+/* { dg-do compile } */
void c_direct(par)
void *par = &&lab; /* { dg-error "is initialized|non-standard|outside of" } */
diff --git a/gcc/testsuite/gcc.dg/pr23200.c b/gcc/testsuite/gcc.dg/pr23200.c
new file mode 100644
index 00000000000..56bf59c861a
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr23200.c
@@ -0,0 +1,22 @@
+/* PR inline-asm/23200 */
+/* { dg-do compile { target nonpic } } */
+/* { dg-options "-O0" } */
+
+static char var;
+
+void
+foo (void)
+{
+ asm volatile ("" :: "i" (&var + 1));
+}
+
+typedef int T[];
+typedef T *P;
+
+int var2;
+
+void
+bar (void)
+{
+ asm volatile ("" :: "i"(&(*(P)&var2)[1]));
+}
diff --git a/gcc/testsuite/gcc.dg/pr24225.c b/gcc/testsuite/gcc.dg/pr24225.c
index b364f820d4b..4161c31bf73 100644
--- a/gcc/testsuite/gcc.dg/pr24225.c
+++ b/gcc/testsuite/gcc.dg/pr24225.c
@@ -1,6 +1,6 @@
/* This was an ICE caused by the compiler-generated stack save/restore
statements around s[b]. */
-/* { dg-do compile} */
+/* { dg-do compile } */
/* { dg-options "-O1 -fprofile-arcs" } */
int
diff --git a/gcc/testsuite/gcc.dg/pr31490-2.c b/gcc/testsuite/gcc.dg/pr31490-2.c
new file mode 100644
index 00000000000..2449ac468b5
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr31490-2.c
@@ -0,0 +1,7 @@
+/* PR middle-end/31490 */
+/* { dg-do compile } */
+/* { dg-options "-fpic" { target fpic } } */
+/* { dg-require-named-sections "" } */
+
+const char *const x __attribute__((section("foo"))) = "";
+const char *const g __attribute__((section("foo"))) = (const char *) 0;
diff --git a/gcc/testsuite/gcc.dg/pr31490-3.c b/gcc/testsuite/gcc.dg/pr31490-3.c
new file mode 100644
index 00000000000..e7ccc677de1
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr31490-3.c
@@ -0,0 +1,7 @@
+/* PR middle-end/31490 */
+/* { dg-do compile } */
+/* { dg-options "-fpic" { target fpic } } */
+/* { dg-require-named-sections "" } */
+
+const char *const x __attribute__((section("foo"))) = (const char *) 0;
+const char *const g __attribute__((section("foo"))) = "bar";
diff --git a/gcc/testsuite/gcc.dg/pr31490-4.c b/gcc/testsuite/gcc.dg/pr31490-4.c
new file mode 100644
index 00000000000..cbfc68730f6
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr31490-4.c
@@ -0,0 +1,10 @@
+/* PR middle-end/31490 */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+/* { dg-options "-O2 -fpic" { target fpic } } */
+/* { dg-require-named-sections "" } */
+
+const char *const x __attribute__((section("foo"))) = "";
+const char *const g __attribute__((section("foo"))) = (const char *) 0;
+const char *const y __attribute__((section("bar"))) = (const char *) 0;
+const char *const h __attribute__((section("bar"))) = "bar";
diff --git a/gcc/testsuite/gcc.dg/pr39666-2.c b/gcc/testsuite/gcc.dg/pr39666-2.c
index e4ef1d5d2b7..9ca119b6a07 100644
--- a/gcc/testsuite/gcc.dg/pr39666-2.c
+++ b/gcc/testsuite/gcc.dg/pr39666-2.c
@@ -5,7 +5,7 @@
int
foo (int i)
{
- int j; /* { dg-warning "may be used uninitialized" } */
+ int j;
switch (i)
{
case -__INT_MAX__ - 1 ... -1:
@@ -18,5 +18,5 @@ foo (int i)
j = 4;
break;
}
- return j;
+ return j; /* { dg-warning "may be used uninitialized" } */
}
diff --git a/gcc/testsuite/gcc.dg/pr41619.c b/gcc/testsuite/gcc.dg/pr41619.c
new file mode 100644
index 00000000000..9c164e3a60f
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr41619.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fno-ira-share-save-slots" } */
+
+struct A {};
+
+int foo();
+
+struct A bar(double x)
+{
+ double y;
+ if (foo())
+ y = 1 / x;
+ return bar(y);
+}
diff --git a/gcc/testsuite/gcc.dg/pr42917.c b/gcc/testsuite/gcc.dg/pr42917.c
deleted file mode 100644
index d8db32ea2da..00000000000
--- a/gcc/testsuite/gcc.dg/pr42917.c
+++ /dev/null
@@ -1,16 +0,0 @@
-/* { dg-do compile } */
-/* { dg-options "-O1 -ftree-loop-linear -fcompare-debug -fdump-tree-ltrans" } */
-
-extern int A[];
-
-void
-foo ()
-{
- int i, j;
- for (i = 0; i < 4; i++)
- for (j = 255; j >= 0; j--)
- A[j] = 0;
-}
-
-/* { dg-final { scan-tree-dump "Successfully transformed loop" "ltrans" } } */
-/* { dg-final { cleanup-tree-dump "ltrans" } } */
diff --git a/gcc/testsuite/gcc.dg/pr43082.c b/gcc/testsuite/gcc.dg/pr43082.c
new file mode 100644
index 00000000000..a6e00461673
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr43082.c
@@ -0,0 +1,10 @@
+/* Test that the compiler does not crash when void expressions are
+ found inside conditional expressions. PR c/43082. */
+/* { dg-do compile } */
+
+void
+foo (int x)
+{
+ if (x ? (void)(0) : (void)(1)) /* { dg-error "void value not ignored as it ought to be" } */
+ ;
+}
diff --git a/gcc/testsuite/gcc.dg/pr46130-1.c b/gcc/testsuite/gcc.dg/pr46130-1.c
new file mode 100644
index 00000000000..a0a582d2784
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr46130-1.c
@@ -0,0 +1,23 @@
+/* PR tree-optimization/46130 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fno-tree-dce" } */
+
+#include <stdarg.h>
+
+static void
+foo (va_list ap)
+{
+ va_arg (ap, char *)[0];
+}
+
+void
+bar (va_list ap)
+{
+ foo (ap);
+}
+
+void
+baz (va_list ap)
+{
+ foo (ap);
+}
diff --git a/gcc/testsuite/gcc.dg/pr46130-2.c b/gcc/testsuite/gcc.dg/pr46130-2.c
new file mode 100644
index 00000000000..991e5dd1835
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr46130-2.c
@@ -0,0 +1,32 @@
+/* PR tree-optimization/46130 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fno-tree-dce" } */
+
+extern int bar (int);
+
+static int foo (int x)
+{
+ int z, w;
+ if (x <= 1024)
+ {
+ z = 16;
+ w = 17;
+ }
+ else
+ {
+ bar (bar (bar (bar (bar (bar (bar (bar (bar (16)))))))));
+ if (x > 131072)
+ w = 19;
+ else
+ w = 21;
+ z = 32;
+ }
+ w = w + 121;
+ return z;
+}
+
+int
+baz (int x)
+{
+ return foo (x + 6) + foo (x + 15) + foo (x + 24);
+}
diff --git a/gcc/testsuite/gcc.dg/pr46494.c b/gcc/testsuite/gcc.dg/pr46494.c
new file mode 100644
index 00000000000..29f96856b1d
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr46494.c
@@ -0,0 +1,9 @@
+/* { dg-do compile }
+/* { dg-options "-O -fno-tree-ccp -fno-tree-fre -ftree-vrp" } */
+
+extern void foo (void) __attribute__((noreturn));
+void g (void)
+{
+ void (*f) (void) = foo;
+ f ();
+}
diff --git a/gcc/testsuite/gcc.dg/pr46620.c b/gcc/testsuite/gcc.dg/pr46620.c
new file mode 100644
index 00000000000..8cc71ebbb18
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr46620.c
@@ -0,0 +1,76 @@
+/* PR tree-optimization/46620 */
+/* SRA bitfield grouping used to lose track at padding bitfields in
+ the middle of a word. */
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+
+#include <stdlib.h>
+
+struct PCT
+{
+ unsigned char pi1 : 4;
+ unsigned char pi2 : 3;
+ unsigned char pif : 5;
+
+ unsigned char sl : 2;
+ unsigned char uc : 1;
+ unsigned char st : 1;
+
+ unsigned char p : 1;
+ unsigned char cs : 1;
+ unsigned char ss : 1;
+
+ unsigned char pc : 3;
+ unsigned char dmv : 4;
+ unsigned char cv : 4;
+};
+
+struct rt
+{
+ struct rt* d;
+ void (*edo)(void * const);
+ short lId;
+ char dac;
+};
+
+struct pedr
+{
+ struct rt re;
+ struct PCT pc;
+ unsigned char mid;
+} ;
+
+void __attribute__((__noinline__))
+rei(struct rt* const me, unsigned short anId, void *ad )
+{
+ asm volatile ("");
+}
+
+void __attribute__((__noinline__))
+pedrdo(void * const p)
+{
+ asm volatile ("");
+}
+
+void __attribute__((__noinline__))
+pedri (struct pedr* const me, struct PCT ppc, unsigned char pmid)
+{
+ rei(&(me->re), 0x7604, 0);
+ me->pc = ppc;
+ me->mid = pmid;
+ (me)->re.edo = pedrdo;
+}
+
+int main()
+{
+ struct PCT ps;
+ struct pedr pm;
+
+ pm.pc.dmv = 0;
+ ps.dmv = 1;
+ pedri(&pm, ps, 32);
+
+ if (pm.pc.dmv != 1)
+ abort ();
+ exit (0);
+}
diff --git a/gcc/testsuite/gcc.dg/pr46878-1.c b/gcc/testsuite/gcc.dg/pr46878-1.c
new file mode 100644
index 00000000000..f5b42de118b
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr46878-1.c
@@ -0,0 +1,30 @@
+/* PR rtl-optimization/46878 */
+/* Make sure this doesn't ICE. */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+struct baz
+{
+ int *newp;
+};
+
+int
+get_ice (int *op, struct baz *ret)
+{
+ int *tmpp;
+ int c;
+ c = (__foo () != 1);
+ if (__bar ())
+ {
+ return (1);
+ }
+ if (c)
+ tmpp = op;
+ if (tmpp)
+ {
+ }
+ else if (c)
+ {
+ ret->newp = tmpp;
+ }
+}
diff --git a/gcc/testsuite/gcc.dg/pr46909.c b/gcc/testsuite/gcc.dg/pr46909.c
index affedab8676..8bfaf05078c 100644
--- a/gcc/testsuite/gcc.dg/pr46909.c
+++ b/gcc/testsuite/gcc.dg/pr46909.c
@@ -1,6 +1,6 @@
/* PR tree-optimization/46909 */
/* { dg-do compile } */
-/* { dg-options "-O2 -fdump-tree-ifcombine" } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
extern void abort ();
@@ -13,5 +13,8 @@ foo (unsigned int x)
return -1;
}
-/* { dg-final { scan-tree-dump "optimizing two comparisons to x_\[0-9\]+\\(D\\) != 4" "ifcombine" } } */
-/* { dg-final { cleanup-tree-dump "ifcombine" } } */
+/* { dg-final { scan-tree-dump-times "x_\[0-9\]+\\(D\\) != 4" 1 "optimized" } } */
+/* { dg-final { scan-tree-dump-times "x_\[0-9\]+\\(D\\) != 6" 0 "optimized" } } */
+/* { dg-final { scan-tree-dump-times "x_\[0-9\]+\\(D\\) == 2" 0 "optimized" } } */
+/* { dg-final { scan-tree-dump-times "x_\[0-9\]+\\(D\\) == 6" 0 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc/testsuite/gcc.dg/pr47276.c b/gcc/testsuite/gcc.dg/pr47276.c
index ae1e81a0aa5..3fa1a0e49a8 100644
--- a/gcc/testsuite/gcc.dg/pr47276.c
+++ b/gcc/testsuite/gcc.dg/pr47276.c
@@ -1,5 +1,6 @@
/* { dg-do compile } */
/* { dg-require-alias "" } */
+/* { dg-require-visibility "" } */
extern void syslog (int __pri, __const char *__fmt, ...)
__attribute__ ((__format__ (__printf__, 2, 3)));
extern void vsyslog (int __pri, __const char *__fmt, int __ap)
diff --git a/gcc/testsuite/gcc.dg/pr47391.c b/gcc/testsuite/gcc.dg/pr47391.c
new file mode 100644
index 00000000000..5ec98f10850
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr47391.c
@@ -0,0 +1,22 @@
+/* PR tree-optimization/47391 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+const volatile int v = 1;
+int i = 0;
+
+void
+foo (void)
+{
+ i = v;
+}
+
+int
+main (void)
+{
+ foo ();
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-not "i = 1;" "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc/testsuite/gcc.dg/pr47443.c b/gcc/testsuite/gcc.dg/pr47443.c
new file mode 100644
index 00000000000..fa7d6b98ad3
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr47443.c
@@ -0,0 +1,14 @@
+/* PR tree-optimization/47443 */
+/* { dg-do compile } */
+/* { dg-options "-O -fstack-check=generic" } */
+
+static inline bar (char *c, int i)
+{
+ return c + i > c;
+}
+
+int foo ()
+{
+ char c[100];
+ return (bar (c, 1));
+}
diff --git a/gcc/testsuite/gcc.dg/pr47555.c b/gcc/testsuite/gcc.dg/pr47555.c
new file mode 100644
index 00000000000..d65265274f9
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr47555.c
@@ -0,0 +1,36 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+#define FILL_BACK *ptrRGB++=0; *ptrRGB++=0; *ptrRGB++=0;
+
+
+void uncompact(unsigned char* ptrRGB, const unsigned int* ptrSrc, const unsigned char* ptrRGBcompact, int line, int nbPixLeft)
+{
+
+#define BIT_2_RGB32 \
+ if ((v & 0x00000001)){ nbPixLeft--; *ptrRGB++ = *ptrRGBcompact++; *ptrRGB++ = *ptrRGBcompact++; *ptrRGB++ = *ptrRGBcompact++; } \
+ else{ FILL_BACK } \
+ v >>= 1;
+#define BIT_2_RGB16 \
+ if ((v16 & 0x0001)){ nbPixLeft--; *ptrRGB++ = *ptrRGBcompact++; *ptrRGB++ = *ptrRGBcompact++; *ptrRGB++ = *ptrRGBcompact++; } \
+ else{ FILL_BACK } \
+ v16 >>= 1;
+
+ int x;
+ unsigned int v, *ptrSrc32bits=(unsigned int*)ptrSrc;
+ unsigned short v16,*ptrSrc16bits;
+
+ for(x=0; x<line; x++) {
+ v = *ptrSrc32bits++;
+ BIT_2_RGB32 BIT_2_RGB32 BIT_2_RGB32 BIT_2_RGB32 BIT_2_RGB32 BIT_2_RGB32 BIT_2_RGB32 BIT_2_RGB32
+ BIT_2_RGB32 BIT_2_RGB32 BIT_2_RGB32 BIT_2_RGB32 BIT_2_RGB32 BIT_2_RGB32 BIT_2_RGB32 BIT_2_RGB32
+ BIT_2_RGB32 BIT_2_RGB32 BIT_2_RGB32 BIT_2_RGB32 BIT_2_RGB32 BIT_2_RGB32 BIT_2_RGB32 BIT_2_RGB32
+ BIT_2_RGB32 BIT_2_RGB32 BIT_2_RGB32 BIT_2_RGB32 BIT_2_RGB32 BIT_2_RGB32 BIT_2_RGB32 BIT_2_RGB32
+ }
+
+ ptrSrc16bits=(unsigned short *)ptrSrc32bits;
+ v16 = *ptrSrc16bits++;
+ BIT_2_RGB16 BIT_2_RGB16 BIT_2_RGB16 BIT_2_RGB16 BIT_2_RGB16 BIT_2_RGB16
+ BIT_2_RGB16 BIT_2_RGB16 BIT_2_RGB16 BIT_2_RGB16 BIT_2_RGB16 BIT_2_RGB16
+
+}
diff --git a/gcc/testsuite/gcc.dg/pr47610.c b/gcc/testsuite/gcc.dg/pr47610.c
new file mode 100644
index 00000000000..906af74f920
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr47610.c
@@ -0,0 +1,8 @@
+/* PR middle-end/47610 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fpic" { target fpic } } */
+struct S { const char *s; };
+const struct S s[] = { "s" };
+extern void foo (void (*) (void));
+static void bar (void) {}
+void baz () { foo (bar); }
diff --git a/gcc/testsuite/gcc.dg/pr47684.c b/gcc/testsuite/gcc.dg/pr47684.c
new file mode 100644
index 00000000000..475aa1549b8
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr47684.c
@@ -0,0 +1,20 @@
+/* PR debug/47684 */
+/* { dg-do compile } */
+/* { dg-options "-O3 -fcompare-debug" } */
+
+int in[8][4];
+int out[4];
+
+void
+foo (void)
+{
+ int sum = 1;
+ int i, j, k;
+ for (k = 0; k < 4; k++)
+ {
+ for (j = 0; j < 4; j++)
+ for (i = 0; i < 4; i++)
+ sum *= in[i + k][j];
+ out[k] = sum;
+ }
+}
diff --git a/gcc/testsuite/gcc.dg/pr47763.c b/gcc/testsuite/gcc.dg/pr47763.c
new file mode 100644
index 00000000000..a5da2de3f4b
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr47763.c
@@ -0,0 +1,9 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -funroll-loops -fdump-rtl-web" } */
+
+foo()
+{
+}
+
+/* { dg-final { scan-rtl-dump-not "Web oldreg" "web" } } */
+/* { dg-final { cleanup-rtl-dump "web" } } */
diff --git a/gcc/testsuite/gcc.dg/struct-parse-2.c b/gcc/testsuite/gcc.dg/struct-parse-2.c
index 559411a19cf..6d01f3e88aa 100644
--- a/gcc/testsuite/gcc.dg/struct-parse-2.c
+++ b/gcc/testsuite/gcc.dg/struct-parse-2.c
@@ -1,5 +1,5 @@
/* PR c/35437 */
-/* { dg-do "compile" } */
+/* { dg-do compile } */
struct A
{
diff --git a/gcc/testsuite/gcc.dg/tls/pr42894.c b/gcc/testsuite/gcc.dg/tls/pr42894.c
new file mode 100644
index 00000000000..c3bd76c91c4
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tls/pr42894.c
@@ -0,0 +1,12 @@
+/* PR target/42894 */
+/* { dg-do compile } */
+/* { dg-options "-march=armv5te -mthumb" { target arm*-*-* } } */
+/* { dg-require-effective-target tls } */
+
+extern __thread int t;
+
+void
+foo (int a)
+{
+ t = a;
+}
diff --git a/gcc/testsuite/gcc.dg/torture/pr47228.c b/gcc/testsuite/gcc.dg/torture/pr47228.c
new file mode 100644
index 00000000000..5bc9f0ad511
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr47228.c
@@ -0,0 +1,31 @@
+/* { dg-do run } */
+
+struct S4
+{
+ unsigned f0:24;
+} __attribute__((__packed__));
+
+struct S4 g_10 = {
+ 6210831
+};
+
+struct S4 func_2 (int x)
+{
+ struct S4 l_8[2] = {
+ {0}, {0}
+ };
+ g_10 = l_8[1];
+ for (; x<2; x++) {
+ struct S4 tmp = {
+ 11936567
+ };
+ l_8[x] = tmp;
+ }
+ return g_10;
+}
+
+int main (void)
+{
+ func_2 (0);
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/torture/pr47365.c b/gcc/testsuite/gcc.dg/torture/pr47365.c
new file mode 100644
index 00000000000..e3bc55011a5
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr47365.c
@@ -0,0 +1,39 @@
+/* { dg-do run } */
+
+struct A
+{
+ int i;
+};
+
+struct B
+{
+ struct A a[2];
+};
+
+int i = 1;
+struct B b = { 0, 3 };
+
+static void
+test ()
+{
+ if (b.a[0].i != i)
+ {
+ int t = b.a[0].i;
+ b.a[0] = b.a[1];
+ b.a[1].i = t;
+ }
+
+ if (b.a[1].i == i)
+ __builtin_abort ();
+
+ if (b.a[0].i == 0)
+ __builtin_abort ();
+}
+
+int
+main ()
+{
+ test ();
+ return 0;
+}
+
diff --git a/gcc/testsuite/gcc.dg/torture/pr47370.c b/gcc/testsuite/gcc.dg/torture/pr47370.c
new file mode 100644
index 00000000000..ff71f0964a1
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr47370.c
@@ -0,0 +1,27 @@
+/* { dg-do compile } */
+
+struct S { int s; };
+
+void
+foo (void)
+{
+ for (;;)
+ ;
+}
+
+struct S
+bar (void)
+{
+ struct S s = { 99 };
+ return s;
+}
+
+void
+baz (int i)
+{
+ struct S s[1];
+ s[0] = bar ();
+ bar ();
+ foo ();
+}
+
diff --git a/gcc/testsuite/gcc.dg/torture/pr47411.c b/gcc/testsuite/gcc.dg/torture/pr47411.c
new file mode 100644
index 00000000000..d3c10d331e7
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr47411.c
@@ -0,0 +1,42 @@
+/* { dg-do compile } */
+
+typedef long unsigned int size_t;
+
+static __inline void *
+__inline_memcpy_chk (void *__dest, const void *__src, size_t __len)
+{
+ return __builtin___memcpy_chk (__dest, __src, __len, __builtin_object_size (__dest, 0));
+}
+
+extern void *xmalloc (size_t) __attribute__ ((__malloc__));
+
+struct htab { void ** entries; };
+
+typedef struct htab *htab_t;
+
+extern void ** htab_find_slot (htab_t, const void *);
+
+enum mode_class { MODE_RANDOM, MODE_CC, MODE_INT, MAX_MODE_CLASS };
+
+struct mode_data
+{
+ struct mode_data *next;
+ enum mode_class cl;
+};
+
+static const struct mode_data blank_mode = { 0, MAX_MODE_CLASS };
+
+static htab_t modes_by_name;
+
+struct mode_data *
+new_mode (void)
+{
+ struct mode_data *m
+ = ((struct mode_data *) xmalloc (sizeof (struct mode_data)));
+
+ ((__builtin_object_size (m, 0) != (size_t) -1) ? __builtin___memcpy_chk (m, &blank_mode, sizeof (struct mode_data), __builtin_object_size (m, 0)) : __inline_memcpy_chk (m, &blank_mode, sizeof (struct mode_data)));
+
+ *htab_find_slot (modes_by_name, m) = m;
+
+ return m;
+}
diff --git a/gcc/testsuite/gcc.dg/torture/pr47426-1.c b/gcc/testsuite/gcc.dg/torture/pr47426-1.c
new file mode 100644
index 00000000000..47dcff91302
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr47426-1.c
@@ -0,0 +1,23 @@
+/* { dg-do run } */
+/* { dg-options "-fipa-pta" } */
+/* { dg-additional-sources "pr47426-2.c" } */
+
+void bar (int *i);
+
+static void
+foo (int *i)
+{
+ if (*i)
+ bar (i);
+ if (*i)
+ __builtin_abort();
+}
+
+typedef void tfoo (int *);
+
+tfoo *
+getfoo (void)
+{
+ return &foo;
+}
+
diff --git a/gcc/testsuite/gcc.dg/torture/pr47426-2.c b/gcc/testsuite/gcc.dg/torture/pr47426-2.c
new file mode 100644
index 00000000000..a22e902bce4
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr47426-2.c
@@ -0,0 +1,19 @@
+typedef void tfoo (int *);
+tfoo *getfoo (void);
+
+void
+bar (int *i)
+{
+ (*i)--;
+}
+
+int
+main ()
+{
+ int i = 1;
+ getfoo ()(&i);
+ if (i)
+ __builtin_abort ();
+ return 0;
+}
+
diff --git a/gcc/testsuite/gcc.dg/torture/pr47473.c b/gcc/testsuite/gcc.dg/torture/pr47473.c
new file mode 100644
index 00000000000..92f2b872e8c
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr47473.c
@@ -0,0 +1,14 @@
+/* PR c/47473 */
+/* { dg-do run } */
+/* { dg-options "-std=c99" } */
+
+int
+main (void)
+{
+ long double _Complex w = 0.2L - 0.3iL;
+ w = w * (0.3L - (0.0F + 1.0iF) * 0.9L);
+ if (__builtin_fabsl (__real__ w + 0.21L) > 0.001L
+ || __builtin_fabsl (__imag__ w + 0.27L) > 0.001L)
+ __builtin_abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/torture/pr47621.c b/gcc/testsuite/gcc.dg/torture/pr47621.c
new file mode 100644
index 00000000000..882e67f08e4
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr47621.c
@@ -0,0 +1,14 @@
+/* { dg-do run } */
+
+extern void abort (void);
+
+int
+main (void)
+{
+ int data = 1;
+ struct ptr { int val; } *ptr = (struct ptr *) &data;
+ ptr->val = 0;
+ if (data != 0)
+ abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/torture/pr47677.c b/gcc/testsuite/gcc.dg/torture/pr47677.c
new file mode 100644
index 00000000000..bd9077863c5
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr47677.c
@@ -0,0 +1,34 @@
+/* { dg-do compile } */
+
+struct S { int s; int u; };
+extern int bar (void);
+extern struct S *baz (void);
+
+void
+foo (int x, struct S *y, char z, int *v, struct S *s)
+{
+ int c, d;
+ if (x & 2)
+ d = 1;
+ else
+ {
+ d = (x & 1) ? 11 : 0;
+ while ((c = (s->s != (s->u & 1) ? s->s : bar ())) != '\0');
+ c = (s->s != '\\' && (s->u & 4) ? s->s : bar ());
+ if (c == '<')
+ goto lab;
+ }
+ while ((c = ((s->u & 1) ? s->s : bar ())) != 0
+ && ((d != 11 && d != 17) || (v[c] & 1) == 0))
+ {
+ lab:;
+ switch (d)
+ {
+ case 14:
+ if (c == '}')
+ y = baz ();
+ d = y->s = z == '<' ? 17 : 11;
+ }
+ }
+}
+
diff --git a/gcc/testsuite/gcc.dg/torture/pr47743.c b/gcc/testsuite/gcc.dg/torture/pr47743.c
new file mode 100644
index 00000000000..1930e94d2ca
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr47743.c
@@ -0,0 +1,22 @@
+/* { dg-do compile } */
+
+int
+foo (void *x, int y)
+{
+ long long a = 1, *b;
+ double *c;
+ if (y)
+ {
+ b = (long long *) x;
+ while (b)
+ a *= *b++;
+ }
+ else
+ {
+ c = (double *) x;
+ while (c)
+ a *= *c++;
+ }
+ return a;
+}
+
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/data-dep-1.c b/gcc/testsuite/gcc.dg/tree-ssa/data-dep-1.c
deleted file mode 100644
index 12e42b7491d..00000000000
--- a/gcc/testsuite/gcc.dg/tree-ssa/data-dep-1.c
+++ /dev/null
@@ -1,28 +0,0 @@
-/* { dg-do compile { target int32plus } } */
-/* { dg-options "-O2 -ftree-loop-linear -fdump-tree-ltrans-all" } */
-
-int foo (int n, int m)
-{
- int a[10000][10000];
- int i, j, k;
-
- for(k = 0; k < 1234; k++)
- for(j = 0; j < 5; j++)
- for(i = 0; i < 67; i++)
- {
- a[j+i-(-m+n+3)][i-k+4] = a[k+j][i];
- }
-
- return a[0][0];
-}
-
-
-/* For the data dependence analysis of the outermost loop, the
- evolution of "k+j" should be instantiated in the outermost loop "k"
- and the evolution should be taken in the innermost loop "i". The
- pattern below ensures that the evolution is not computed in the
- outermost "k" loop: the 4 comes from the instantiation of the
- number of iterations of loop "j". */
-
-/* { dg-final { scan-tree-dump-times "4, \\+, 1" 0 "ltrans" } } */
-/* { dg-final { cleanup-tree-dump "ltrans" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/foldcast-1.c b/gcc/testsuite/gcc.dg/tree-ssa/foldcast-1.c
index a0626ea10d9..08b827c1d3b 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/foldcast-1.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/foldcast-1.c
@@ -1,4 +1,4 @@
-/* { dg-do "compile" } */
+/* { dg-do compile } */
/* { dg-options "-fdump-tree-original" } */
typedef int ssize_t __attribute__((mode(pointer)));
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/foldconst-2.c b/gcc/testsuite/gcc.dg/tree-ssa/foldconst-2.c
index 8fdad906a80..0eff197bf4a 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/foldconst-2.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/foldconst-2.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O2 -fdump-tree-optimized" } */
+/* { dg-options "-O2 -fdump-tree-ch" } */
typedef union tree_node *tree;
enum tree_code
{
@@ -54,5 +54,5 @@ emit_support_tinfos (void)
}
/* We should copy loop header to fundamentals[0] and then fold it way into
known value. */
-/* { dg-final { scan-tree-dump-not "fundamentals.0" "optimized"} } */
-/* { dg-final { cleanup-tree-dump "optimized" } } */
+/* { dg-final { scan-tree-dump-not "fundamentals.0" "ch"} } */
+/* { dg-final { cleanup-tree-dump "ch" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ifc-pr47271.c b/gcc/testsuite/gcc.dg/tree-ssa/ifc-pr47271.c
new file mode 100644
index 00000000000..bf360794691
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/ifc-pr47271.c
@@ -0,0 +1,49 @@
+/* { dg-options "-O3" } */
+/* { dg-do run } */
+
+extern void abort (void);
+
+void func (void)
+{
+ int i;
+ int nops;
+ char *codestr =
+ "|\000\000Ee\000\000Z\001\000d\000\000Z\002\000d\025\000Z\003\000"
+ "\t\t\t\t\t\t\t\t\t\t\t\td\026\000Z\004\000d\005\000\204\000\000Z"
+ "\005\000e\006\000e\a\000j\005\000e\b\000d\006\000\204\002\000\203"
+ "\001\000Z\t\000d\a\000\204\000\000Z\n\000d\b\000\204\000\000Z\v\000d"
+ "\t\000\204\000\000Z\f\000d\n\000\204\000\000Z\r\000e\016\000e\017\000d"
+ "\v\000\203\001\000d\f\000d\r\000\203\001\001Z\020\000e\016\000e\017"
+ "\000d\016\000\203\001\000d\f\000d\017\000\203\001\001Z\021\000e\016"
+ "\000e\017\000d\020\000\203\001\000d\f\000d\021\000\203\001\001Z\022"
+ "\000e\016\000e\017\000d\022\000\203\001\000d\f\000d\023\000\203\001"
+ "\001Z\023\000d\024\000S";
+ int codelen = 209;
+ int addrmap[500];
+
+ for (i=0, nops=0 ; i<codelen ; i += ((codestr[i] >= 90) ? 3 : 1))
+ {
+ addrmap[i] = i - nops;
+ if (codestr[i] == 9)
+ nops++;
+ }
+
+ if (addrmap[0] != 0
+ || addrmap[3] != 3
+ || addrmap[4] != 4
+ || addrmap[7] != 7
+ || addrmap[10] != 10
+ || addrmap[13] != 13
+ || addrmap[16] != 16
+ || addrmap[19] != 19
+ || addrmap[22] != 22
+ || addrmap[23] != 22
+ || addrmap[24] != 22)
+ abort ();
+}
+
+int main ()
+{
+ func ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/inline-7.c b/gcc/testsuite/gcc.dg/tree-ssa/inline-7.c
new file mode 100644
index 00000000000..16c3c86bdeb
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/inline-7.c
@@ -0,0 +1,9 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-einline" } */
+
+void foo0();
+inline void bar0() { foo0(); }
+void foobar() { bar0(); bar0(); bar0(); }
+
+/* { dg-final { scan-tree-dump "Iterations: 1" "einline" } } */
+/* { dg-final { cleanup-tree-dump "einline" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ldist-pr45948.c b/gcc/testsuite/gcc.dg/tree-ssa/ldist-pr45948.c
index 3e467bdb05d..f0d07cc1781 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/ldist-pr45948.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/ldist-pr45948.c
@@ -18,6 +18,6 @@ foo (int i, int n)
/* We should apply loop distribution and generate 2 memset (0). */
-/* { dg-final { scan-tree-dump "distributed: split to 3" "ldist" } } */
+/* { dg-final { scan-tree-dump "distributed: split to 2" "ldist" } } */
/* { dg-final { scan-tree-dump-times "__builtin_memset" 4 "ldist" } } */
/* { dg-final { cleanup-tree-dump "ldist" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ltrans-1.c b/gcc/testsuite/gcc.dg/tree-ssa/ltrans-1.c
deleted file mode 100644
index bff58f6a41d..00000000000
--- a/gcc/testsuite/gcc.dg/tree-ssa/ltrans-1.c
+++ /dev/null
@@ -1,24 +0,0 @@
-/* { dg-do compile } */
-/* { dg-options "-O2 -ftree-loop-linear -fdump-tree-ltrans-all" } */
-/* { dg-options "-O2 -ftree-loop-linear -fdump-tree-ltrans-all -march=i486" { target { i?86-*-* && ilp32} } } */
-/* { dg-require-effective-target size32plus } */
-
-double u[1782225];
-int foo(int N, int *res)
-{
- int i, j;
- double sum = 0.0;
- /* This loop should be converted to a perfect nest and
- interchanged. */
- for (i = 0; i < N; i++)
- {
- for (j = 0; j < N; j++)
- sum = sum + u[i + 1335 * j];
-
- u[1336 * i] *= 2;
- }
- *res = sum + N;
-}
-/* { dg-final { scan-tree-dump-times "converted loop nest to perfect loop nest" 1 "ltrans"} } */
-/* { dg-final { scan-tree-dump-times "transformed loop" 1 "ltrans"} } */
-/* { dg-final { cleanup-tree-dump "ltrans" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ltrans-2.c b/gcc/testsuite/gcc.dg/tree-ssa/ltrans-2.c
deleted file mode 100644
index 9548bf21706..00000000000
--- a/gcc/testsuite/gcc.dg/tree-ssa/ltrans-2.c
+++ /dev/null
@@ -1,26 +0,0 @@
-/* { dg-do compile } */
-/* { dg-options "-O2 -ftree-loop-linear -fdump-tree-ltrans-all" } */
-/* { dg-require-effective-target size32plus } */
-
-double u[1782225];
-int foo(int N, int *res)
-{
- unsigned int i, j;
- double sum = 0;
-
- /* This loop should be converted to a perfect nest and
- interchanged. */
- for (i = 0; i < N; i++)
- {
- for (j = 0; j < N; j++)
- {
- sum = sum + u[i + 1335 * j];
- if (j == N - 1)
- u[1336 * i] *= 2;
- }
- }
- *res = sum + N;
-}
-/* { dg-final { scan-tree-dump-times "transformed loop" 1 "ltrans"} {
- xfail *-*-*} } */
-/* { dg-final { cleanup-tree-dump "ltrans" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ltrans-3.c b/gcc/testsuite/gcc.dg/tree-ssa/ltrans-3.c
deleted file mode 100644
index d7dd211e9bc..00000000000
--- a/gcc/testsuite/gcc.dg/tree-ssa/ltrans-3.c
+++ /dev/null
@@ -1,22 +0,0 @@
-/* { dg-do compile } */
-/* { dg-options "-O2 -ftree-loop-linear -fdump-tree-ltrans-all" } */
-/* { dg-options "-O2 -ftree-loop-linear -fdump-tree-ltrans-all -march=i486" { target { i?86-*-* && ilp32} } } */
-/* { dg-require-effective-target size32plus } */
-
-double u[1782225];
-int foo(int N, int *res)
-{
- unsigned int i, j;
- double sum = 0;
- for (i = 0; i < N; i++)
- {
- for (j = 0; j < N; j++)
- {
- sum = sum + u[i + 1335 * j];
- }
- }
- *res = sum + N;
-}
-
-/* { dg-final { scan-tree-dump-times "transformed loop" 1 "ltrans" } } */
-/* { dg-final { cleanup-tree-dump "ltrans" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ltrans-4.c b/gcc/testsuite/gcc.dg/tree-ssa/ltrans-4.c
deleted file mode 100644
index 6682538a2ed..00000000000
--- a/gcc/testsuite/gcc.dg/tree-ssa/ltrans-4.c
+++ /dev/null
@@ -1,21 +0,0 @@
-/* { dg-do compile } */
-/* { dg-options "-O2 -ftree-loop-linear -fdump-tree-ltrans-all" } */
-/* { dg-options "-O2 -ftree-loop-linear -fdump-tree-ltrans-all -march=i486" { target { i?86-*-* && ilp32} } } */
-/* { dg-require-effective-target size32plus } */
-
-double u[1782225];
-int foo(int N, int *res)
-{
- int i, j;
- double sum = 0;
- for (i = 0; i < N; i++)
- for (j = 0; j < N; j++)
- sum = sum + u[i + 1335 * j];
-
- for (i = 0; i < N; i++)
- u[1336 * i] *= 2;
- *res = sum + N;
-}
-
-/* { dg-final { scan-tree-dump-times "transformed loop" 1 "ltrans"} } */
-/* { dg-final { cleanup-tree-dump "ltrans" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ltrans-5.c b/gcc/testsuite/gcc.dg/tree-ssa/ltrans-5.c
deleted file mode 100644
index 3540723dc56..00000000000
--- a/gcc/testsuite/gcc.dg/tree-ssa/ltrans-5.c
+++ /dev/null
@@ -1,18 +0,0 @@
-/* { dg-do compile { target { size32plus } } } */
-/* { dg-options "-O2 -ftree-loop-linear -fdump-tree-ltrans-all" } */
-/* { dg-options "-O2 -ftree-loop-linear -fdump-tree-ltrans-all -march=i486" { target { i?86-*-* && ilp32} } } */
-
-int foo ()
-{
- int A[100][1111];
- int i, j;
-
- for( i = 0; i < 1111; i++)
- for( j = 0; j < 100; j++)
- A[j][i] = 5 * A[j][i];
-
- return A[10][10];
-}
-
-/* { dg-final { scan-tree-dump-times "transformed loop" 1 "ltrans"} } */
-/* { dg-final { cleanup-tree-dump "ltrans" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ltrans-6.c b/gcc/testsuite/gcc.dg/tree-ssa/ltrans-6.c
deleted file mode 100644
index e6a290a6a13..00000000000
--- a/gcc/testsuite/gcc.dg/tree-ssa/ltrans-6.c
+++ /dev/null
@@ -1,22 +0,0 @@
-/* { dg-do compile } */
-/* { dg-options "-O2 -ftree-loop-linear -fdump-tree-ltrans-all" } */
-/* { dg-options "-O2 -ftree-loop-linear -fdump-tree-ltrans-all -march=i486" { target { i?86-*-* && ilp32} } } */
-/* { dg-require-effective-target size32plus } */
-
-
-
-int medium_loop_interchange(int A[100][200])
-{
- int i,j;
-
- /* This loop should be interchanged. */
-
- for(j = 0; j < 200; j++)
- for(i = 0; i < 100; i++)
- A[i][j] = A[i][j] + A[i][j];
-
- return A[1][1];
-}
-
-/* { dg-final { scan-tree-dump-times "transformed loop" 1 "ltrans"} } */
-/* { dg-final { cleanup-tree-dump "ltrans" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ltrans-8.c b/gcc/testsuite/gcc.dg/tree-ssa/ltrans-8.c
deleted file mode 100644
index 67569d8a316..00000000000
--- a/gcc/testsuite/gcc.dg/tree-ssa/ltrans-8.c
+++ /dev/null
@@ -1,15 +0,0 @@
-/* { dg-do compile } */
-/* { dg-options "-O2 -ftree-loop-linear -fdump-tree-ltrans-all" } */
-/* { dg-options "-O2 -ftree-loop-linear -fdump-tree-ltrans-all -march=i486" { target { i?86-*-* && ilp32} } } */
-double foo(double *a)
-{
- int i,j;
- double r = 0.0;
- for (i=0; i<100; ++i)
- for (j=0; j<1000; ++j)
- r += a[j*100+i];
- return r;
-}
-
-/* { dg-final { scan-tree-dump-times "transformed loop" 1 "ltrans"} } */
-/* { dg-final { cleanup-tree-dump "ltrans" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr42585.c b/gcc/testsuite/gcc.dg/tree-ssa/pr42585.c
index 2e32ac53c80..52f21fe1b7e 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/pr42585.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr42585.c
@@ -32,6 +32,9 @@ Cyc_string_ungetc (int ignore, struct _fat_ptr *sptr)
}
/* The local aggregates . */
-/* { dg-final { scan-tree-dump-times "struct _fat_ptr _ans" 0 "optimized" { target { { { ! powerpc*-*-* } && { ! arm-*-* } } && { ! sh*-*-* } } } } } */
-/* { dg-final { scan-tree-dump-times "struct _fat_ptr _T2" 0 "optimized" { target { { { ! powerpc*-*-* } && { ! arm-*-* } } && { ! sh*-*-* } } } } } */
+/* Whether the structs are totally scalarized or not depends on the
+ MOVE_RATIO macro defintion in the back end. The scalarization will
+ not take place when using small values for MOVE_RATIO. */
+/* { dg-final { scan-tree-dump-times "struct _fat_ptr _ans" 0 "optimized" { target { ! "powerpc*-*-* arm-*-* sh*-*-* s390*-*-*" } } } } */
+/* { dg-final { scan-tree-dump-times "struct _fat_ptr _T2" 0 "optimized" { target { ! "powerpc*-*-* arm-*-* sh*-*-* s390*-*-*" } } } } */
/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr42893.c b/gcc/testsuite/gcc.dg/tree-ssa/pr42893.c
new file mode 100644
index 00000000000..b3fbd765403
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr42893.c
@@ -0,0 +1,30 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -fdump-tree-optimized" } */
+
+struct frame_info;
+void tui_registers_changed_hook (void);
+extern struct frame_info *deprecated_selected_frame;
+int tui_refreshing_registers = 0;
+void
+tui_registers_changed_hook (void)
+{
+ struct frame_info *fi;
+ fi = deprecated_selected_frame;
+ if (fi)
+
+ {
+ if (tui_refreshing_registers == 0)
+
+ {
+ tui_refreshing_registers = 1;
+ tui_refreshing_registers = 0;
+ }
+ }
+ return;
+}
+
+/* No references to tui_refreshing_registers should remain. */
+/* { dg-final { scan-tree-dump-not "tui_refreshing_registers" "optimized"} } */
+
+/* { dg-final { cleanup-tree-dump "optimized" } } */
+
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr45122.c b/gcc/testsuite/gcc.dg/tree-ssa/pr45122.c
new file mode 100644
index 00000000000..e979b766fea
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr45122.c
@@ -0,0 +1,50 @@
+/* PR tree-optimization/27285 */
+/* PR tree-optimization/45122 */
+
+/* { dg-do run } */
+/* { dg-options "-O2 -funsafe-loop-optimizations" } */
+
+extern void abort (void);
+
+struct S { unsigned char a, b, c, d[16]; };
+
+void __attribute__ ((noinline))
+foo (struct S *x, struct S *y)
+{
+ int a, b;
+ unsigned char c, *d, *e;
+
+ b = x->b;
+ d = x->d;
+ e = y->d;
+ a = 0;
+ while (b)
+ {
+ if (b >= 8)
+ {
+ c = 0xff;
+ b -= 8;
+ }
+ else
+ {
+ c = 0xff << (8 - b);
+ b = 0;
+ }
+
+ e[a] = d[a] & c;
+ a++;
+ }
+}
+
+int
+main (void)
+{
+ struct S x = { 0, 25, 0, { 0xaa, 0xbb, 0xcc, 0xdd }};
+ struct S y = { 0, 0, 0, { 0 }};
+
+ foo (&x, &y);
+ if (x.d[0] != y.d[0] || x.d[1] != y.d[1]
+ || x.d[2] != y.d[2] || (x.d[3] & 0x80) != y.d[3])
+ abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr47392.c b/gcc/testsuite/gcc.dg/tree-ssa/pr47392.c
new file mode 100644
index 00000000000..20161363fbd
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr47392.c
@@ -0,0 +1,42 @@
+/* { dg-do run } */
+/* { dg-options "-O2 -fdump-tree-pre-stats" } */
+
+struct A
+{
+ int i;
+};
+
+struct B
+{
+ struct A a[2];
+};
+
+int i = 1;
+struct B b = { 0, 3 };
+
+void
+test ()
+{
+ if (b.a[0].i != i)
+ {
+ int t = b.a[0].i;
+ b.a[0] = b.a[1];
+ b.a[1].i = t;
+ }
+
+ if (b.a[1].i == i)
+ __builtin_abort ();
+
+ if (b.a[0].i == 0)
+ __builtin_abort ();
+}
+
+int
+main ()
+{
+ test ();
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump "Eliminated: 1" "pre" } } */
+/* { dg-final { cleanup-tree-dump "pre" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/struct-aliasing-1.c b/gcc/testsuite/gcc.dg/tree-ssa/struct-aliasing-1.c
index 7dc7833647b..87b44b530ec 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/struct-aliasing-1.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/struct-aliasing-1.c
@@ -1,4 +1,4 @@
-/* { dg-do "compile" } */
+/* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-fre-details" } */
struct S { float f; };
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/struct-aliasing-2.c b/gcc/testsuite/gcc.dg/tree-ssa/struct-aliasing-2.c
index 812dac928da..5acf083c71e 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/struct-aliasing-2.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/struct-aliasing-2.c
@@ -1,4 +1,4 @@
-/* { dg-do "compile" } */
+/* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-fre" } */
struct S { unsigned f; };
diff --git a/gcc/testsuite/gcc.dg/ucnid-10.c b/gcc/testsuite/gcc.dg/ucnid-10.c
index bbcde1ff605..317cbb113ac 100644
--- a/gcc/testsuite/gcc.dg/ucnid-10.c
+++ b/gcc/testsuite/gcc.dg/ucnid-10.c
@@ -2,6 +2,7 @@
locale). Test #pragma pack diagnostics. */
/* { dg-do compile } */
/* { dg-options "-std=gnu99 -fextended-identifiers" } */
+/* { dg-require-ascii-locale "" } */
#pragma pack(push)
#pragma pack(pop, \u00f3) /* { dg-warning "pop, \\\\U000000f3.*push, \\\\U000000f3" } */
diff --git a/gcc/testsuite/gcc.dg/ucnid-13.c b/gcc/testsuite/gcc.dg/ucnid-13.c
index 8ec69fa3b93..94217899422 100644
--- a/gcc/testsuite/gcc.dg/ucnid-13.c
+++ b/gcc/testsuite/gcc.dg/ucnid-13.c
@@ -2,6 +2,7 @@
locale). Miscellaneous diagnostics. */
/* { dg-do compile } */
/* { dg-options "-std=gnu99 -fextended-identifiers -Wpacked" } */
+/* { dg-require-ascii-locale "" } */
int a __attribute__((\u00c0)); /* { dg-warning "'\\\\U000000c0' attribute directive ignored" } */
diff --git a/gcc/testsuite/gcc.dg/ucnid-7.c b/gcc/testsuite/gcc.dg/ucnid-7.c
index fe53a497ffa..1dbcb9ac77b 100644
--- a/gcc/testsuite/gcc.dg/ucnid-7.c
+++ b/gcc/testsuite/gcc.dg/ucnid-7.c
@@ -2,6 +2,7 @@
locale). */
/* { dg-do compile } */
/* { dg-options "-std=c99 -fextended-identifiers" } */
+/* { dg-require-ascii-locale "" } */
void *p = &\u00e9; /* { dg-error "'\\\\U000000e9' undeclared" } */
void *q = &\u1e00; /* { dg-error "'\\\\U00001e00' undeclared" } */
diff --git a/gcc/testsuite/gcc.dg/ucnid-8.c b/gcc/testsuite/gcc.dg/ucnid-8.c
index 4ec3eeba29f..ea2e051f04a 100644
--- a/gcc/testsuite/gcc.dg/ucnid-8.c
+++ b/gcc/testsuite/gcc.dg/ucnid-8.c
@@ -2,6 +2,7 @@
locale). Further tests of C front-end diagnostics. */
/* { dg-do compile } */
/* { dg-options "-std=gnu99 -fextended-identifiers -Wvla" } */
+/* { dg-require-ascii-locale "" } */
int a __attribute__((__mode__(\u00e9))); /* { dg-error "unknown machine mode '\\\\U000000e9'" } */
struct s1 { int \u00e9 : 0; }; /* { dg-error "zero width for bit-field '\\\\U000000e9'" } */
@@ -11,4 +12,4 @@ void f (int b) { int \u00e9[b]; } /* { dg-warning "variable length array '\\\\U0
void g (static int \u00e9); /* { dg-error "storage class specified for parameter '\\\\U000000e9'" } */
struct s2 { int \u00e1; } \u00e9 = { { 0 } }; /* { dg-warning "braces around scalar initializer" } */
-/* { dg-warning "near initialization for '\\\\U000000e9\\.\\\\U000000e1'" "UCN diag" { target *-*-* } 13 } */
+/* { dg-warning "near initialization for '\\\\U000000e9\\.\\\\U000000e1'" "UCN diag" { target *-*-* } 14 } */
diff --git a/gcc/testsuite/gcc.dg/uninit-pr19430.c b/gcc/testsuite/gcc.dg/uninit-pr19430.c
index 53810c553e1..4d2b4f62cef 100644
--- a/gcc/testsuite/gcc.dg/uninit-pr19430.c
+++ b/gcc/testsuite/gcc.dg/uninit-pr19430.c
@@ -18,8 +18,8 @@ foo (int i)
int foo2( void ) {
- int rc; /* { dg-warning "'rc' is used uninitialized in this function" } */
- return rc;
+ int rc;
+ return rc; /* { dg-warning "'rc' is used uninitialized in this function" } */
*&rc = 0;
}
diff --git a/gcc/testsuite/gcc.dg/vect/costmodel/spu/costmodel-vect-33.c b/gcc/testsuite/gcc.dg/vect/costmodel/spu/costmodel-vect-33.c
index 3e0db3d84d7..11036b0bced 100644
--- a/gcc/testsuite/gcc.dg/vect/costmodel/spu/costmodel-vect-33.c
+++ b/gcc/testsuite/gcc.dg/vect/costmodel/spu/costmodel-vect-33.c
@@ -4,7 +4,7 @@
#include <stdarg.h>
#include "../../tree-vect.h"
-#define N 17
+#define N 16
struct test {
char ca[N];
};
@@ -35,6 +35,9 @@ int main (void)
return main1 ();
}
-/* { dg-final { scan-tree-dump-times "vectorization not profitable" 0 "vect" } } */
-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* Peeling to align the store is used. Overhead of peeling is too high. */
+/* { dg-final { scan-tree-dump-times "vectorization not profitable" 1 "vect" { target vector_alignment_reachable } } } */
+
+/* Versioning to align the store is used. Overhead of versioning is not too high. */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target {! vector_alignment_reachable} } } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/costmodel/spu/costmodel-vect-76a.c b/gcc/testsuite/gcc.dg/vect/costmodel/spu/costmodel-vect-76a.c
index 41fe3aebf90..124493b0321 100644
--- a/gcc/testsuite/gcc.dg/vect/costmodel/spu/costmodel-vect-76a.c
+++ b/gcc/testsuite/gcc.dg/vect/costmodel/spu/costmodel-vect-76a.c
@@ -3,7 +3,7 @@
#include <stdarg.h>
#include "../../tree-vect.h"
-#define N 8
+#define N 16
#define OFF 4
/* Check handling of accesses for which the "initial condition" -
diff --git a/gcc/testsuite/gcc.dg/vect/costmodel/spu/costmodel-vect-76c.c b/gcc/testsuite/gcc.dg/vect/costmodel/spu/costmodel-vect-76c.c
index 573d8aacdd4..b42934c68f5 100644
--- a/gcc/testsuite/gcc.dg/vect/costmodel/spu/costmodel-vect-76c.c
+++ b/gcc/testsuite/gcc.dg/vect/costmodel/spu/costmodel-vect-76c.c
@@ -3,7 +3,7 @@
#include <stdarg.h>
#include "../../tree-vect.h"
-#define N 8
+#define N 32
#define OFF 4
/* Check handling of accesses for which the "initial condition" -
diff --git a/gcc/testsuite/gcc.target/arm/neon-thumb2-move.c b/gcc/testsuite/gcc.target/arm/neon-thumb2-move.c
index 98d95f0d8d4..430a4d5717f 100644
--- a/gcc/testsuite/gcc.target/arm/neon-thumb2-move.c
+++ b/gcc/testsuite/gcc.target/arm/neon-thumb2-move.c
@@ -1,5 +1,6 @@
/* { dg-do compile } */
/* { dg-require-effective-target arm_neon_ok } */
+/* { dg-require-effective-target arm_thumb2_ok } */
/* { dg-options "-O2 -mthumb -march=armv7-a" } */
/* { dg-add-options arm_neon } */
diff --git a/gcc/testsuite/gcc.target/arm/pr45701-1.c b/gcc/testsuite/gcc.target/arm/pr45701-1.c
new file mode 100644
index 00000000000..f94f5784b3e
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/pr45701-1.c
@@ -0,0 +1,24 @@
+/* { dg-do compile } */
+/* { dg-options "-march=armv7-a -mthumb -Os" } */
+/* { dg-final { scan-assembler "push\t\{r3" } } */
+/* { dg-final { scan-assembler-not "r8" } } */
+
+extern int hist_verify;
+extern char *pre_process_line (char*);
+extern char* str_cpy (char*, char*);
+extern int str_len (char*);
+extern char* x_malloc (int);
+#define savestring(x) (char *)str_cpy (x_malloc (1 + str_len (x)), (x))
+
+char *
+history_expand_line_internal (char* line)
+{
+ char *new_line;
+ int old_verify;
+
+ old_verify = hist_verify;
+ hist_verify = 0;
+ new_line = pre_process_line (line);
+ hist_verify = old_verify;
+ return (new_line == line) ? savestring (line) : new_line;
+}
diff --git a/gcc/testsuite/gcc.target/arm/pr45701-2.c b/gcc/testsuite/gcc.target/arm/pr45701-2.c
new file mode 100644
index 00000000000..68d51781a94
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/pr45701-2.c
@@ -0,0 +1,26 @@
+/* { dg-do compile } */
+/* { dg-options "-march=armv7-a -mthumb -Os" } */
+/* { dg-final { scan-assembler "push\t\{r3" } } */
+/* { dg-final { scan-assembler-not "r8" } } */
+
+extern int hist_verify;
+extern char *pre_process_line (char*);
+extern char* savestring1 (char*, char*);
+extern char* str_cpy (char*, char*);
+extern int str_len (char*);
+extern char* x_malloc (int);
+#define savestring(x) (char *)str_cpy (x_malloc (1 + str_len (x)), (x))
+
+char *
+history_expand_line_internal (char* line)
+{
+ char *new_line;
+ int old_verify;
+
+ old_verify = hist_verify;
+ hist_verify = 0;
+ new_line = pre_process_line (line);
+ hist_verify = old_verify;
+ /* Two tail calls here, but r3 is not used to pass values. */
+ return (new_line == line) ? savestring (line) : savestring1 (new_line, line);
+}
diff --git a/gcc/testsuite/gcc.target/arm/pr45701-3.c b/gcc/testsuite/gcc.target/arm/pr45701-3.c
new file mode 100644
index 00000000000..8255bae1143
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/pr45701-3.c
@@ -0,0 +1,27 @@
+/* { dg-do compile } */
+/* { dg-options "-march=armv7-a -mthumb -Os" } */
+/* { dg-final { scan-assembler "push\t.*r8" } } */
+/* { dg-final { scan-assembler-not "push\t*r3" } } */
+
+extern int hist_verify;
+extern char *pre_process_line (char*);
+extern char* savestring1 (char*, char*, int, int);
+extern char* str_cpy (char*, char*);
+extern int str_len (char*);
+extern char* x_malloc (int);
+#define savestring(x) (char *)str_cpy (x_malloc (1 + str_len (x)), (x))
+
+char *
+history_expand_line_internal (char* line)
+{
+ char *new_line;
+ int old_verify;
+
+ old_verify = hist_verify;
+ hist_verify = 0;
+ new_line = pre_process_line (line);
+ hist_verify = old_verify;
+ /* Two tail calls here, but r3 is used to pass values. */
+ return (new_line == line) ? savestring (line) :
+ savestring1 (new_line, line, 0, old_verify+1);
+}
diff --git a/gcc/testsuite/gcc.target/i386/asm-6.c b/gcc/testsuite/gcc.target/i386/asm-6.c
new file mode 100644
index 00000000000..d69cf5d3df0
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/asm-6.c
@@ -0,0 +1,17 @@
+/* PR rtl-optimization/44174 */
+/* Testcase by Jakub Jelinek <jakub@gcc.gnu.org> */
+
+/* { dg-do compile } */
+/* { dg-options "-O2 -fpic" { target fpic } } */
+/* { dg-xfail-if "" { i?86-pc-solaris2.1[0-9] && ilp32 } } */
+
+int f0 (int, int, int, int, int);
+int f1 (void);
+
+void
+f2 (void)
+{
+ unsigned v1, v2, v3, v4;
+ __asm__ ("" : "=a" (v1), "=d" (v2), "=c" (v3), "=r" (v4));
+ f0 (f1 (), f1 (), f1 (), f1 (), (v4 >> 8) & 0xff);
+}
diff --git a/gcc/testsuite/gcc.target/i386/headmerge-1.c b/gcc/testsuite/gcc.target/i386/headmerge-1.c
index 941028c31db..0c1914340ba 100644
--- a/gcc/testsuite/gcc.target/i386/headmerge-1.c
+++ b/gcc/testsuite/gcc.target/i386/headmerge-1.c
@@ -1,6 +1,6 @@
/* { dg-do compile } */
/* { dg-options "-O2" } */
-/* { dg-final { scan-assembler-times "120" 1 } } */
+/* { dg-final { scan-assembler-times "\\\$120|, 120" 1 } } */
extern void foo1 (int);
extern void foo2 (int);
diff --git a/gcc/testsuite/gcc.target/i386/headmerge-2.c b/gcc/testsuite/gcc.target/i386/headmerge-2.c
index 36637a64eb3..aa2e562556b 100644
--- a/gcc/testsuite/gcc.target/i386/headmerge-2.c
+++ b/gcc/testsuite/gcc.target/i386/headmerge-2.c
@@ -1,6 +1,6 @@
/* { dg-do compile } */
/* { dg-options "-O2" } */
-/* { dg-final { scan-assembler-times "120" 1 } } */
+/* { dg-final { scan-assembler-times "\\\$120|, 120" 1 } } */
extern void foo1 (int);
extern void foo2 (int);
diff --git a/gcc/testsuite/gcc.target/i386/parity-1.c b/gcc/testsuite/gcc.target/i386/parity-1.c
index 0094b5bced8..eaf41cf082d 100644
--- a/gcc/testsuite/gcc.target/i386/parity-1.c
+++ b/gcc/testsuite/gcc.target/i386/parity-1.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O2" } */
+/* { dg-options "-O2 -march=k8" } */
/* { dg-final { scan-assembler "setnp" } } */
int foo(unsigned int x)
diff --git a/gcc/testsuite/gcc.target/i386/parity-2.c b/gcc/testsuite/gcc.target/i386/parity-2.c
index a4c238e0bf1..03a80616528 100644
--- a/gcc/testsuite/gcc.target/i386/parity-2.c
+++ b/gcc/testsuite/gcc.target/i386/parity-2.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O2" } */
+/* { dg-options "-O2 -march=k8" } */
/* { dg-final { scan-assembler "setnp" } } */
int foo(unsigned long long int x)
diff --git a/gcc/testsuite/gcc.target/i386/pr31167.c b/gcc/testsuite/gcc.target/i386/pr31167.c
index aca12130c9f..43d9f848bdf 100644
--- a/gcc/testsuite/gcc.target/i386/pr31167.c
+++ b/gcc/testsuite/gcc.target/i386/pr31167.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-require-effective-target lp64 } */
+/* { dg-require-effective-target int128 } */
/* { dg-options "-O" } */
typedef int int32_t;
diff --git a/gcc/testsuite/gcc.target/i386/pr32280-1.c b/gcc/testsuite/gcc.target/i386/pr32280-1.c
index 1dbe2ccbb4f..e8619fa7eb7 100644
--- a/gcc/testsuite/gcc.target/i386/pr32280-1.c
+++ b/gcc/testsuite/gcc.target/i386/pr32280-1.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-require-effective-target lp64 } */
+/* { dg-require-effective-target int128 } */
/* { dg-options "-O2" } */
__uint128_t
diff --git a/gcc/testsuite/gcc.target/i386/pr38240.c b/gcc/testsuite/gcc.target/i386/pr38240.c
index 6a3568754b3..99e875894d2 100644
--- a/gcc/testsuite/gcc.target/i386/pr38240.c
+++ b/gcc/testsuite/gcc.target/i386/pr38240.c
@@ -1,4 +1,5 @@
/* { dg-do compile } */
+/* { dg-options "-msse" } */
typedef float V
__attribute__ ((__vector_size__ (16), __may_alias__));
diff --git a/gcc/testsuite/gcc.target/i386/pr43653.c b/gcc/testsuite/gcc.target/i386/pr43653.c
new file mode 100644
index 00000000000..22928edacfe
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr43653.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -ftree-vectorize -msse" } */
+
+typedef struct {} S;
+
+void *foo()
+{
+ S a[64], *p[64];
+ int i;
+
+ for (i = 0; i < 64; i++)
+ p[i] = &a[i];
+ return p[0];
+}
diff --git a/gcc/testsuite/gcc.target/i386/pr46178.c b/gcc/testsuite/gcc.target/i386/pr46178.c
new file mode 100644
index 00000000000..661e3fd9eac
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr46178.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-O -m8bit-idiv -fira-algorithm=priority" } */
+/* This is the same as divmod-5.c, just with different options which
+ trigger an ICE. We don't look at the output. */
+
+extern void foo (int, int, int, int, int, int);
+
+void
+bar (int x, int y)
+{
+ foo (0, 0, 0, 0, x / y, x % y);
+}
+
diff --git a/gcc/testsuite/gcc.target/i386/pr47312.c b/gcc/testsuite/gcc.target/i386/pr47312.c
new file mode 100644
index 00000000000..03769a1cf81
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr47312.c
@@ -0,0 +1,25 @@
+/* PR target/47312 */
+/* { dg-do link } */
+/* { dg-require-effective-target lto } */
+/* { dg-require-effective-target xop } */
+/* { dg-require-effective-target c99_runtime } */
+/* { dg-options "-O -flto -mno-sse3 -mxop" } */
+/* { dg-add-options c99_runtime } */
+
+extern double fma (double, double, double);
+extern float fmaf (float, float, float);
+extern long double fmal (long double, long double, long double);
+
+volatile float f;
+volatile double d;
+volatile long double ld;
+
+int
+main ()
+{
+ f = fmaf (f, f, f);
+ d = fma (d, d, d);
+ ld = fmal (ld, ld, ld);
+ __asm__ volatile ("" : : "r" (&f), "r" (&d), "r" (&ld) : "memory");
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/i386/pr47564.c b/gcc/testsuite/gcc.target/i386/pr47564.c
new file mode 100644
index 00000000000..5d3f25d1089
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr47564.c
@@ -0,0 +1,42 @@
+/* PR target/47564 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -msse2" } */
+
+static inline unsigned long long
+foo (const unsigned char *p)
+{
+ return 1;
+}
+
+__attribute__ ((__target__ ("sse4"))) void
+bar (unsigned long long *x, const void *b, long long m)
+{
+ const unsigned char *p = (const unsigned char *) b;
+ const unsigned char *e = p + m;
+ unsigned int l = *x;
+ unsigned long long n = l;
+
+ if ((e - p) >= 8192)
+ {
+ while ((e - p) >= 128)
+ {
+ n = __builtin_ia32_crc32di (n, foo (p));
+ n = __builtin_ia32_crc32di (n, foo (p));
+ n = __builtin_ia32_crc32di (n, foo (p));
+ n = __builtin_ia32_crc32di (n, foo (p));
+ n = __builtin_ia32_crc32di (n, foo (p));
+ n = __builtin_ia32_crc32di (n, foo (p));
+ n = __builtin_ia32_crc32di (n, foo (p));
+ n = __builtin_ia32_crc32di (n, foo (p));
+ n = __builtin_ia32_crc32di (n, foo (p));
+ }
+ }
+
+ while ((e - p) >= 16)
+ {
+ n = __builtin_ia32_crc32di (n, foo (p));
+ n = __builtin_ia32_crc32di (n, foo (p));
+ }
+ l = n;
+ *x = l;
+}
diff --git a/gcc/testsuite/gcc.target/i386/pr47581.c b/gcc/testsuite/gcc.target/i386/pr47581.c
new file mode 100644
index 00000000000..dfc02a14478
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr47581.c
@@ -0,0 +1,10 @@
+/* PR middle-end/47581 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fomit-frame-pointer -mpreferred-stack-boundary=4 -mincoming-stack-boundary=4" } */
+/* { dg-final { scan-assembler-not "(sub|add)l\[\\t \]*\\$\[0-9\]*,\[\\t \]*%\[re\]?sp" } } */
+
+unsigned
+foo (unsigned a, unsigned b)
+{
+ return ((unsigned long long) a * (unsigned long long) b) >> 32;
+}
diff --git a/gcc/testsuite/gcc.target/i386/pr47665.c b/gcc/testsuite/gcc.target/i386/pr47665.c
new file mode 100644
index 00000000000..10fabb5179c
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr47665.c
@@ -0,0 +1,11 @@
+/* PR target/47665 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -msse2" } */
+
+#include <emmintrin.h>
+
+__m128d
+foo (double *x, __m128i y)
+{
+ return _mm_load_pd (x + _mm_cvtsi128_si32 (_mm_srli_si128 (_mm_slli_epi32 (y, 2), 0)));
+}
diff --git a/gcc/testsuite/gcc.target/i386/pr47780.c b/gcc/testsuite/gcc.target/i386/pr47780.c
new file mode 100644
index 00000000000..89fe4093dfc
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr47780.c
@@ -0,0 +1,14 @@
+/* PR debug/47780 */
+/* { dg-do compile } */
+/* { dg-options "-O -fgcse -fgcse-las -fstack-protector-all -fno-tree-ccp -fno-tree-dominator-opts -fcompare-debug -Wno-psabi" } */
+
+typedef int V2SF __attribute__ ((vector_size (128)));
+
+V2SF
+foo (int x, V2SF a)
+{
+ V2SF b = a + (V2SF) {};
+ while (x--)
+ a += b;
+ return a;
+}
diff --git a/gcc/testsuite/gcc.target/i386/pr47800.c b/gcc/testsuite/gcc.target/i386/pr47800.c
new file mode 100644
index 00000000000..45c817bc640
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr47800.c
@@ -0,0 +1,15 @@
+/* PR target/47800 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -march=nocona" } */
+
+int
+foo (unsigned char *x, unsigned char *y)
+{
+ unsigned char a;
+ for (a = 0; x < y; x++)
+ if (a & 0x80)
+ a = (unsigned char) (a << 1) + 1 + *x;
+ else
+ a = (unsigned char) (a << 1) + *x;
+ return a;
+}
diff --git a/gcc/testsuite/gcc.target/i386/pr47809.c b/gcc/testsuite/gcc.target/i386/pr47809.c
new file mode 100644
index 00000000000..5832a65d8d8
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr47809.c
@@ -0,0 +1,13 @@
+/* PR c/47809 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -msse2" } */
+
+#include <emmintrin.h>
+double bar (double, double);
+
+__m128d
+foo (__m128d x)
+{
+ x *= (__m128d) { bar (1.0, 1.0), 0.0 };
+ return (__m128d) ((__m128i) x ^ (__m128i) { 0, 0});
+}
diff --git a/gcc/testsuite/gcc.target/i386/vecinit-1.c b/gcc/testsuite/gcc.target/i386/vecinit-1.c
index fad0c07e100..a5091cd85f0 100644
--- a/gcc/testsuite/gcc.target/i386/vecinit-1.c
+++ b/gcc/testsuite/gcc.target/i386/vecinit-1.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O2 -msse2" } */
+/* { dg-options "-O2 -march=k8 -msse2" } */
#define vector __attribute__((vector_size(16)))
diff --git a/gcc/testsuite/gcc.target/i386/vecinit-2.c b/gcc/testsuite/gcc.target/i386/vecinit-2.c
index a3a7abc5340..52998a6bfc0 100644
--- a/gcc/testsuite/gcc.target/i386/vecinit-2.c
+++ b/gcc/testsuite/gcc.target/i386/vecinit-2.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O2 -msse2" } */
+/* { dg-options "-O2 -march=k8 -msse2" } */
#define vector __attribute__((vector_size(16)))
diff --git a/gcc/testsuite/gcc.target/mips/save-restore-1.c b/gcc/testsuite/gcc.target/mips/save-restore-1.c
index f6a854ee9f3..ad92e5d75de 100644
--- a/gcc/testsuite/gcc.target/mips/save-restore-1.c
+++ b/gcc/testsuite/gcc.target/mips/save-restore-1.c
@@ -1,5 +1,6 @@
/* Check that we can use the save instruction to save varargs. */
/* { dg-options "(-mips16) isa_rev>=1 -mabi=32 -O2" } */
+/* { dg-skip-if "PR target/46610" { mips-sgi-irix6* } } */
#include <stdarg.h>
diff --git a/gcc/testsuite/gcc.target/mips/save-restore-3.c b/gcc/testsuite/gcc.target/mips/save-restore-3.c
index d45fe50ea6b..191362a284d 100644
--- a/gcc/testsuite/gcc.target/mips/save-restore-3.c
+++ b/gcc/testsuite/gcc.target/mips/save-restore-3.c
@@ -1,6 +1,7 @@
/* Check that we can use the save instruction to save spilled arguments
when the argument save area is out of range of a direct load or store. */
/* { dg-options "(-mips16) isa_rev>=1 -mabi=32 -O2" } */
+/* { dg-skip-if "PR target/46610" { mips-sgi-irix6* } } */
void bar (int *);
diff --git a/gcc/testsuite/gcc.target/mips/save-restore-4.c b/gcc/testsuite/gcc.target/mips/save-restore-4.c
index ef7722bce09..5bc5bcc3d50 100644
--- a/gcc/testsuite/gcc.target/mips/save-restore-4.c
+++ b/gcc/testsuite/gcc.target/mips/save-restore-4.c
@@ -1,5 +1,6 @@
/* Check that we can use the save instruction to save $16, $17 and $31. */
/* { dg-options "(-mips16) isa_rev>=1 -mabi=32 -O2" } */
+/* { dg-skip-if "PR target/46610" { mips-sgi-irix6* } } */
void bar (void);
diff --git a/gcc/testsuite/gcc.target/mips/save-restore-5.c b/gcc/testsuite/gcc.target/mips/save-restore-5.c
index 0dd823a6813..52524b3b4f2 100644
--- a/gcc/testsuite/gcc.target/mips/save-restore-5.c
+++ b/gcc/testsuite/gcc.target/mips/save-restore-5.c
@@ -1,5 +1,6 @@
/* Check that we don't try to save the same register twice. */
/* { dg-options "(-mips16) isa_rev>=1 -mgp32 -O2" } */
+/* { dg-skip-if "PR target/46610" { mips-sgi-irix6* } } */
int bar (int, int, int, int);
void frob (void);
diff --git a/gcc/testsuite/gcc.target/powerpc/altivec-11.c b/gcc/testsuite/gcc.target/powerpc/altivec-11.c
index 648993ab86c..7e3510c3160 100644
--- a/gcc/testsuite/gcc.target/powerpc/altivec-11.c
+++ b/gcc/testsuite/gcc.target/powerpc/altivec-11.c
@@ -1,6 +1,6 @@
/* { dg-do compile { target powerpc*-*-* } } */
/* { dg-require-effective-target powerpc_altivec_ok } */
-/* { dg-options "-O2 -maltivec -mabi=altivec" } */
+/* { dg-options "-O2 -maltivec -mno-vsx -mabi=altivec" } */
/* { dg-final { scan-assembler-not "lvx" } } */
#include <altivec.h>
diff --git a/gcc/testsuite/gcc.target/powerpc/altivec-14.c b/gcc/testsuite/gcc.target/powerpc/altivec-14.c
index 4d3cf4f8cf9..55acb0b35ce 100644
--- a/gcc/testsuite/gcc.target/powerpc/altivec-14.c
+++ b/gcc/testsuite/gcc.target/powerpc/altivec-14.c
@@ -1,6 +1,6 @@
/* { dg-do compile { target { powerpc*-*-* && ilp32 } } } */
/* { dg-require-effective-target powerpc_altivec_ok } */
-/* { dg-options "-maltivec" } */
+/* { dg-options "-maltivec -mno-vsx" } */
#include <altivec.h>
diff --git a/gcc/testsuite/gcc.target/powerpc/altivec-33.c b/gcc/testsuite/gcc.target/powerpc/altivec-33.c
index c1c935a1c59..8e912679d2f 100644
--- a/gcc/testsuite/gcc.target/powerpc/altivec-33.c
+++ b/gcc/testsuite/gcc.target/powerpc/altivec-33.c
@@ -1,6 +1,6 @@
/* { dg-do compile } */
/* { dg-require-effective-target powerpc_altivec_ok } */
-/* { dg-options "-O2 -maltivec" } */
+/* { dg-options "-O2 -maltivec -mno-vsx" } */
/* We should only produce one vspltw as we already splatted the value. */
/* { dg-final { scan-assembler-times "vspltw" 1 } } */
diff --git a/gcc/testsuite/gcc.target/powerpc/altivec-types-1.c b/gcc/testsuite/gcc.target/powerpc/altivec-types-1.c
index 41de95225b3..9096892ee6a 100644
--- a/gcc/testsuite/gcc.target/powerpc/altivec-types-1.c
+++ b/gcc/testsuite/gcc.target/powerpc/altivec-types-1.c
@@ -1,6 +1,6 @@
/* { dg-do compile { target powerpc*-*-linux* } } */
/* { dg-require-effective-target powerpc_altivec_ok } */
-/* { dg-options "-maltivec" } */
+/* { dg-options "-maltivec -mno-vsx" } */
/* Valid AltiVec vector types should be accepted with no warnings. */
diff --git a/gcc/testsuite/gcc.target/powerpc/altivec-types-2.c b/gcc/testsuite/gcc.target/powerpc/altivec-types-2.c
index f64c0c5aa21..cee6c8f263f 100644
--- a/gcc/testsuite/gcc.target/powerpc/altivec-types-2.c
+++ b/gcc/testsuite/gcc.target/powerpc/altivec-types-2.c
@@ -1,7 +1,7 @@
/* { dg-do compile { target powerpc*-*-linux* } } */
/* { dg-require-effective-target ilp32 } */
/* { dg-require-effective-target powerpc_altivec_ok } */
-/* { dg-options "-maltivec" } */
+/* { dg-options "-maltivec -mno-vsx" } */
/* These should get warnings for 32-bit code. */
diff --git a/gcc/testsuite/gcc.target/powerpc/altivec-types-3.c b/gcc/testsuite/gcc.target/powerpc/altivec-types-3.c
index 38c4d6c1642..ea371ce7730 100644
--- a/gcc/testsuite/gcc.target/powerpc/altivec-types-3.c
+++ b/gcc/testsuite/gcc.target/powerpc/altivec-types-3.c
@@ -1,7 +1,7 @@
/* { dg-do compile { target powerpc*-*-linux* } } */
/* { dg-require-effective-target lp64 } */
/* { dg-require-effective-target powerpc_altivec_ok } */
-/* { dg-options "-maltivec" } */
+/* { dg-options "-maltivec -mno-vsx" } */
/* These should be rejected for 64-bit code. */
diff --git a/gcc/testsuite/gcc.target/powerpc/altivec-types-4.c b/gcc/testsuite/gcc.target/powerpc/altivec-types-4.c
index 212f6733939..52fa91453d5 100644
--- a/gcc/testsuite/gcc.target/powerpc/altivec-types-4.c
+++ b/gcc/testsuite/gcc.target/powerpc/altivec-types-4.c
@@ -1,7 +1,7 @@
/* { dg-do compile { target powerpc*-*-linux* } } */
/* { dg-require-effective-target ilp32 } */
/* { dg-require-effective-target powerpc_altivec_ok } */
-/* { dg-options "-maltivec -mno-warn-altivec-long" } */
+/* { dg-options "-maltivec -mno-warn-altivec-long -mno-vsx" } */
/* These should not get warnings for 32-bit code when the warning is
disabled. */
diff --git a/gcc/testsuite/gcc.target/powerpc/avoid-indexed-addresses.c b/gcc/testsuite/gcc.target/powerpc/avoid-indexed-addresses.c
index b1b067283f7..e86aa8a5d2f 100644
--- a/gcc/testsuite/gcc.target/powerpc/avoid-indexed-addresses.c
+++ b/gcc/testsuite/gcc.target/powerpc/avoid-indexed-addresses.c
@@ -1,5 +1,5 @@
/* { dg-do compile { target { powerpc*-*-* } } } */
-/* { dg-options "-O2 -mavoid-indexed-addresses" } */
+/* { dg-options "-O2 -mavoid-indexed-addresses -mno-altivec -mno-vsx" } */
/* { dg-final { scan-assembler-not "lbzx" } }
diff --git a/gcc/testsuite/gcc.target/powerpc/ppc-vector-memcpy.c b/gcc/testsuite/gcc.target/powerpc/ppc-vector-memcpy.c
index a9a16ab2f5c..797c4074dad 100644
--- a/gcc/testsuite/gcc.target/powerpc/ppc-vector-memcpy.c
+++ b/gcc/testsuite/gcc.target/powerpc/ppc-vector-memcpy.c
@@ -1,6 +1,6 @@
/* { dg-do compile { target powerpc*-*-* } } */
/* { dg-require-effective-target powerpc_altivec_ok } */
-/* { dg-options "-O -maltivec" } */
+/* { dg-options "-O -maltivec -mno-vsx" } */
/* { dg-final { scan-assembler "lvx" } } */
void foo(void)
diff --git a/gcc/testsuite/gcc.target/powerpc/ppc-vector-memset.c b/gcc/testsuite/gcc.target/powerpc/ppc-vector-memset.c
index 1a290719c32..ad7aadea938 100644
--- a/gcc/testsuite/gcc.target/powerpc/ppc-vector-memset.c
+++ b/gcc/testsuite/gcc.target/powerpc/ppc-vector-memset.c
@@ -1,6 +1,6 @@
/* { dg-do compile { target powerpc*-*-* } } */
/* { dg-require-effective-target powerpc_altivec_ok } */
-/* { dg-options "-O -maltivec" } */
+/* { dg-options "-O -maltivec -mno-vsx" } */
/* { dg-final { scan-assembler "stvx" } } */
#include <string.h>
diff --git a/gcc/testsuite/gcc.target/powerpc/ppc32-abi-dfp-1.c b/gcc/testsuite/gcc.target/powerpc/ppc32-abi-dfp-1.c
index 1b836d72795..14908dba690 100644
--- a/gcc/testsuite/gcc.target/powerpc/ppc32-abi-dfp-1.c
+++ b/gcc/testsuite/gcc.target/powerpc/ppc32-abi-dfp-1.c
@@ -30,31 +30,6 @@ typedef struct
reg_parms_t gparms;
-
-/* Testcase could break on future gcc's, if parameter regs
- are changed before this asm. */
-
-#define save_parms(lparms) \
- asm volatile ("lis 11,gparms@ha\n\t" \
- "la 11,gparms@l(11)\n\t" \
- "st 3,0(11)\n\t" \
- "st 4,4(11)\n\t" \
- "st 5,8(11)\n\t" \
- "st 6,12(11)\n\t" \
- "st 7,16(11)\n\t" \
- "st 8,20(11)\n\t" \
- "st 9,24(11)\n\t" \
- "st 10,28(11)\n\t" \
- "stfd 1,32(11)\n\t" \
- "stfd 2,40(11)\n\t" \
- "stfd 3,48(11)\n\t" \
- "stfd 4,56(11)\n\t" \
- "stfd 5,64(11)\n\t" \
- "stfd 6,72(11)\n\t" \
- "stfd 7,80(11)\n\t" \
- "stfd 8,88(11)\n\t":::"11", "memory"); \
- lparms = gparms;
-
typedef struct sf
{
struct sf *backchain;
@@ -62,115 +37,159 @@ typedef struct sf
unsigned int slot[200];
} stack_frame_t;
+/* Wrapper to save the GPRs and FPRs and then jump to the real function. */
+#define WRAPPER(NAME) \
+__asm__ ("\t.globl\t" #NAME "_asm\n\t" \
+ ".text\n\t" \
+ ".type " #NAME "_asm, @function\n" \
+ #NAME "_asm:\n\t" \
+ "lis 11,gparms@ha\n\t" \
+ "la 11,gparms@l(11)\n\t" \
+ "st 3,0(11)\n\t" \
+ "st 4,4(11)\n\t" \
+ "st 5,8(11)\n\t" \
+ "st 6,12(11)\n\t" \
+ "st 7,16(11)\n\t" \
+ "st 8,20(11)\n\t" \
+ "st 9,24(11)\n\t" \
+ "st 10,28(11)\n\t" \
+ "stfd 1,32(11)\n\t" \
+ "stfd 2,40(11)\n\t" \
+ "stfd 3,48(11)\n\t" \
+ "stfd 4,56(11)\n\t" \
+ "stfd 5,64(11)\n\t" \
+ "stfd 6,72(11)\n\t" \
+ "stfd 7,80(11)\n\t" \
+ "stfd 8,88(11)\n\t" \
+ "b " #NAME "\n\t" \
+ ".size " #NAME ",.-" #NAME "\n")
+
/* Fill up floating point registers with double arguments, forcing
decimal float arguments into the parameter save area. */
+extern void func0_asm (double, double, double, double, double,
+ double, double, double, _Decimal64, _Decimal128);
+
+WRAPPER(func0);
+
void __attribute__ ((noinline))
func0 (double a1, double a2, double a3, double a4, double a5,
double a6, double a7, double a8, _Decimal64 a9, _Decimal128 a10)
{
- reg_parms_t lparms;
stack_frame_t *sp;
- save_parms (lparms);
sp = __builtin_frame_address (0);
sp = sp->backchain;
- if (a1 != lparms.fprs[0]) FAILURE
- if (a2 != lparms.fprs[1]) FAILURE
- if (a3 != lparms.fprs[2]) FAILURE
- if (a4 != lparms.fprs[3]) FAILURE
- if (a5 != lparms.fprs[4]) FAILURE
- if (a6 != lparms.fprs[5]) FAILURE
- if (a7 != lparms.fprs[6]) FAILURE
- if (a8 != lparms.fprs[7]) FAILURE
+ if (a1 != gparms.fprs[0]) FAILURE
+ if (a2 != gparms.fprs[1]) FAILURE
+ if (a3 != gparms.fprs[2]) FAILURE
+ if (a4 != gparms.fprs[3]) FAILURE
+ if (a5 != gparms.fprs[4]) FAILURE
+ if (a6 != gparms.fprs[5]) FAILURE
+ if (a7 != gparms.fprs[6]) FAILURE
+ if (a8 != gparms.fprs[7]) FAILURE
if (a9 != *(_Decimal64 *)&sp->slot[0]) FAILURE
if (a10 != *(_Decimal128 *)&sp->slot[2]) FAILURE
}
/* Alternate 64-bit and 128-bit decimal float arguments, checking that
_Decimal128 is always passed in even/odd register pairs. */
+extern void func1_asm (_Decimal64, _Decimal128, _Decimal64, _Decimal128,
+ _Decimal64, _Decimal128, _Decimal64, _Decimal128);
+
+WRAPPER(func1);
+
void __attribute__ ((noinline))
func1 (_Decimal64 a1, _Decimal128 a2, _Decimal64 a3, _Decimal128 a4,
_Decimal64 a5, _Decimal128 a6, _Decimal64 a7, _Decimal128 a8)
{
- reg_parms_t lparms;
stack_frame_t *sp;
- save_parms (lparms);
sp = __builtin_frame_address (0);
sp = sp->backchain;
- if (a1 != *(_Decimal64 *)&lparms.fprs[0]) FAILURE /* f1 */
- if (a2 != *(_Decimal128 *)&lparms.fprs[1]) FAILURE /* f2 & f3 */
- if (a3 != *(_Decimal64 *)&lparms.fprs[3]) FAILURE /* f4 */
- if (a4 != *(_Decimal128 *)&lparms.fprs[5]) FAILURE /* f6 & f7 */
- if (a5 != *(_Decimal64 *)&lparms.fprs[7]) FAILURE /* f8 */
+ if (a1 != *(_Decimal64 *)&gparms.fprs[0]) FAILURE /* f1 */
+ if (a2 != *(_Decimal128 *)&gparms.fprs[1]) FAILURE /* f2 & f3 */
+ if (a3 != *(_Decimal64 *)&gparms.fprs[3]) FAILURE /* f4 */
+ if (a4 != *(_Decimal128 *)&gparms.fprs[5]) FAILURE /* f6 & f7 */
+ if (a5 != *(_Decimal64 *)&gparms.fprs[7]) FAILURE /* f8 */
if (a6 != *(_Decimal128 *)&sp->slot[0]) FAILURE
if (a7 != *(_Decimal64 *)&sp->slot[4]) FAILURE
if (a8 != *(_Decimal128 *)&sp->slot[6]) FAILURE
}
+extern void func2_asm (_Decimal128, _Decimal64, _Decimal128, _Decimal64,
+ _Decimal128, _Decimal64, _Decimal128, _Decimal64);
+
+WRAPPER(func2);
+
void __attribute__ ((noinline))
func2 (_Decimal128 a1, _Decimal64 a2, _Decimal128 a3, _Decimal64 a4,
_Decimal128 a5, _Decimal64 a6, _Decimal128 a7, _Decimal64 a8)
{
- reg_parms_t lparms;
stack_frame_t *sp;
- save_parms (lparms);
sp = __builtin_frame_address (0);
sp = sp->backchain;
- if (a1 != *(_Decimal128 *)&lparms.fprs[1]) FAILURE /* f2 & f3 */
- if (a2 != *(_Decimal64 *)&lparms.fprs[3]) FAILURE /* f4 */
- if (a3 != *(_Decimal128 *)&lparms.fprs[5]) FAILURE /* f6 & f7 */
- if (a4 != *(_Decimal64 *)&lparms.fprs[7]) FAILURE /* f8 */
+ if (a1 != *(_Decimal128 *)&gparms.fprs[1]) FAILURE /* f2 & f3 */
+ if (a2 != *(_Decimal64 *)&gparms.fprs[3]) FAILURE /* f4 */
+ if (a3 != *(_Decimal128 *)&gparms.fprs[5]) FAILURE /* f6 & f7 */
+ if (a4 != *(_Decimal64 *)&gparms.fprs[7]) FAILURE /* f8 */
if (a5 != *(_Decimal128 *)&sp->slot[0]) FAILURE
if (a6 != *(_Decimal64 *)&sp->slot[4]) FAILURE
if (a7 != *(_Decimal128 *)&sp->slot[6]) FAILURE
if (a8 != *(_Decimal64 *)&sp->slot[10]) FAILURE
}
+extern void func3_asm (_Decimal64, _Decimal128, _Decimal64, _Decimal128,
+ _Decimal64);
+
+WRAPPER(func3);
+
void __attribute__ ((noinline))
func3 (_Decimal64 a1, _Decimal128 a2, _Decimal64 a3, _Decimal128 a4,
_Decimal64 a5)
{
- reg_parms_t lparms;
stack_frame_t *sp;
- save_parms (lparms);
sp = __builtin_frame_address (0);
sp = sp->backchain;
- if (a1 != *(_Decimal64 *)&lparms.fprs[0]) FAILURE /* f1 */
- if (a2 != *(_Decimal128 *)&lparms.fprs[1]) FAILURE /* f2 & f3 */
- if (a3 != *(_Decimal64 *)&lparms.fprs[3]) FAILURE /* f4 */
- if (a4 != *(_Decimal128 *)&lparms.fprs[5]) FAILURE /* f6 & f7 */
+ if (a1 != *(_Decimal64 *)&gparms.fprs[0]) FAILURE /* f1 */
+ if (a2 != *(_Decimal128 *)&gparms.fprs[1]) FAILURE /* f2 & f3 */
+ if (a3 != *(_Decimal64 *)&gparms.fprs[3]) FAILURE /* f4 */
+ if (a4 != *(_Decimal128 *)&gparms.fprs[5]) FAILURE /* f6 & f7 */
if (a5 != *(_Decimal128 *)&sp->slot[0]) FAILURE
}
+extern void func4_asm (_Decimal32, _Decimal32, _Decimal32, _Decimal32,
+ _Decimal32, _Decimal32, _Decimal32, _Decimal32,
+ _Decimal32, _Decimal32, _Decimal32, _Decimal32,
+ _Decimal32, _Decimal32, _Decimal32, _Decimal32);
+
+WRAPPER(func4);
+
void __attribute__ ((noinline))
func4 (_Decimal32 a1, _Decimal32 a2, _Decimal32 a3, _Decimal32 a4,
_Decimal32 a5, _Decimal32 a6, _Decimal32 a7, _Decimal32 a8,
_Decimal32 a9, _Decimal32 a10, _Decimal32 a11, _Decimal32 a12,
_Decimal32 a13, _Decimal32 a14, _Decimal32 a15, _Decimal32 a16)
{
- reg_parms_t lparms;
stack_frame_t *sp;
- save_parms (lparms);
sp = __builtin_frame_address (0);
sp = sp->backchain;
/* _Decimal32 is passed in the lower half of an FPR, or in parameter slot. */
- if (a1 != ((d32parm_t *)&lparms.fprs[0])->d) FAILURE /* f1 */
- if (a2 != ((d32parm_t *)&lparms.fprs[1])->d) FAILURE /* f2 */
- if (a3 != ((d32parm_t *)&lparms.fprs[2])->d) FAILURE /* f3 */
- if (a4 != ((d32parm_t *)&lparms.fprs[3])->d) FAILURE /* f4 */
- if (a5 != ((d32parm_t *)&lparms.fprs[4])->d) FAILURE /* f5 */
- if (a6 != ((d32parm_t *)&lparms.fprs[5])->d) FAILURE /* f6 */
- if (a7 != ((d32parm_t *)&lparms.fprs[6])->d) FAILURE /* f7 */
- if (a8 != ((d32parm_t *)&lparms.fprs[7])->d) FAILURE /* f8 */
+ if (a1 != ((d32parm_t *)&gparms.fprs[0])->d) FAILURE /* f1 */
+ if (a2 != ((d32parm_t *)&gparms.fprs[1])->d) FAILURE /* f2 */
+ if (a3 != ((d32parm_t *)&gparms.fprs[2])->d) FAILURE /* f3 */
+ if (a4 != ((d32parm_t *)&gparms.fprs[3])->d) FAILURE /* f4 */
+ if (a5 != ((d32parm_t *)&gparms.fprs[4])->d) FAILURE /* f5 */
+ if (a6 != ((d32parm_t *)&gparms.fprs[5])->d) FAILURE /* f6 */
+ if (a7 != ((d32parm_t *)&gparms.fprs[6])->d) FAILURE /* f7 */
+ if (a8 != ((d32parm_t *)&gparms.fprs[7])->d) FAILURE /* f8 */
if (a9 != *(_Decimal32 *)&sp->slot[0]) FAILURE
if (a10 != *(_Decimal32 *)&sp->slot[1]) FAILURE
if (a11 != *(_Decimal32 *)&sp->slot[2]) FAILURE
@@ -181,24 +200,29 @@ func4 (_Decimal32 a1, _Decimal32 a2, _Decimal32 a3, _Decimal32 a4,
if (a16 != *(_Decimal32 *)&sp->slot[7]) FAILURE
}
+extern void func5_asm (_Decimal32, _Decimal64, _Decimal128,
+ _Decimal32, _Decimal64, _Decimal128,
+ _Decimal32, _Decimal64, _Decimal128,
+ _Decimal32, _Decimal64, _Decimal128);
+
+WRAPPER(func5);
+
void __attribute__ ((noinline))
func5 (_Decimal32 a1, _Decimal64 a2, _Decimal128 a3,
_Decimal32 a4, _Decimal64 a5, _Decimal128 a6,
_Decimal32 a7, _Decimal64 a8, _Decimal128 a9,
_Decimal32 a10, _Decimal64 a11, _Decimal128 a12)
{
- reg_parms_t lparms;
stack_frame_t *sp;
- save_parms (lparms);
sp = __builtin_frame_address (0);
sp = sp->backchain;
- if (a1 != ((d32parm_t *)&lparms.fprs[0])->d) FAILURE /* f1 */
- if (a2 != *(_Decimal64 *)&lparms.fprs[1]) FAILURE /* f2 */
- if (a3 != *(_Decimal128 *)&lparms.fprs[3]) FAILURE /* f4 & f5 */
- if (a4 != ((d32parm_t *)&lparms.fprs[5])->d) FAILURE /* f6 */
- if (a5 != *(_Decimal64 *)&lparms.fprs[6]) FAILURE /* f7 */
+ if (a1 != ((d32parm_t *)&gparms.fprs[0])->d) FAILURE /* f1 */
+ if (a2 != *(_Decimal64 *)&gparms.fprs[1]) FAILURE /* f2 */
+ if (a3 != *(_Decimal128 *)&gparms.fprs[3]) FAILURE /* f4 & f5 */
+ if (a4 != ((d32parm_t *)&gparms.fprs[5])->d) FAILURE /* f6 */
+ if (a5 != *(_Decimal64 *)&gparms.fprs[6]) FAILURE /* f7 */
if (a6 != *(_Decimal128 *)&sp->slot[0]) FAILURE
if (a7 != *(_Decimal32 *)&sp->slot[4]) FAILURE
@@ -212,15 +236,15 @@ func5 (_Decimal32 a1, _Decimal64 a2, _Decimal128 a3,
int
main ()
{
- func0 (1., 2., 3., 4., 5., 6., 7., 8., 9.dd, 10.dl);
- func1 (1.dd, 2.dl, 3.dd, 4.dl, 5.dd, 6.dl, 7.dd, 8.dl);
- func2 (1.dl, 2.dd, 3.dl, 4.dd, 5.dl, 6.dd, 7.dl, 8.dd);
- func3 (1.dd, 2.dl, 3.dd, 4.dl, 5.dl);
- func4 (501.2df, 502.2df, 503.2df, 504.2df, 505.2df, 506.2df, 507.2df,
- 508.2df, 509.2df, 510.2df, 511.2df, 512.2df, 513.2df, 514.2df,
- 515.2df, 516.2df);
- func5 (601.2df, 602.2dd, 603.2dl, 604.2df, 605.2dd, 606.2dl,
- 607.2df, 608.2dd, 609.2dl, 610.2df, 611.2dd, 612.2dl);
+ func0_asm (1., 2., 3., 4., 5., 6., 7., 8., 9.dd, 10.dl);
+ func1_asm (1.dd, 2.dl, 3.dd, 4.dl, 5.dd, 6.dl, 7.dd, 8.dl);
+ func2_asm (1.dl, 2.dd, 3.dl, 4.dd, 5.dl, 6.dd, 7.dl, 8.dd);
+ func3_asm (1.dd, 2.dl, 3.dd, 4.dl, 5.dl);
+ func4_asm (501.2df, 502.2df, 503.2df, 504.2df, 505.2df, 506.2df, 507.2df,
+ 508.2df, 509.2df, 510.2df, 511.2df, 512.2df, 513.2df, 514.2df,
+ 515.2df, 516.2df);
+ func5_asm (601.2df, 602.2dd, 603.2dl, 604.2df, 605.2dd, 606.2dl,
+ 607.2df, 608.2dd, 609.2dl, 610.2df, 611.2dd, 612.2dl);
if (failcnt != 0)
abort ();
diff --git a/gcc/testsuite/gcc.target/powerpc/ppc64-abi-dfp-1.c b/gcc/testsuite/gcc.target/powerpc/ppc64-abi-dfp-1.c
index 3badf7f9848..eb54a653bf7 100644
--- a/gcc/testsuite/gcc.target/powerpc/ppc64-abi-dfp-1.c
+++ b/gcc/testsuite/gcc.target/powerpc/ppc64-abi-dfp-1.c
@@ -1,4 +1,5 @@
/* { dg-do run { target { powerpc64-*-* && { lp64 && dfprt } } } } */
+/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */
/* { dg-options "-std=gnu99 -O2 -fno-strict-aliasing" } */
/* Testcase to check for ABI compliance of parameter passing
@@ -31,60 +32,42 @@ typedef struct
reg_parms_t gparms;
-/* Testcase could break on future gcc's, if parameter regs
- are changed before this asm. */
-
-#ifndef __MACH__
-#define save_parms(lparms) \
- asm volatile ("ld 11,gparms@got(2)\n\t" \
- "std 3,0(11)\n\t" \
- "std 4,8(11)\n\t" \
- "std 5,16(11)\n\t" \
- "std 6,24(11)\n\t" \
- "std 7,32(11)\n\t" \
- "std 8,40(11)\n\t" \
- "std 9,48(11)\n\t" \
- "std 10,56(11)\n\t" \
- "stfd 1,64(11)\n\t" \
- "stfd 2,72(11)\n\t" \
- "stfd 3,80(11)\n\t" \
- "stfd 4,88(11)\n\t" \
- "stfd 5,96(11)\n\t" \
- "stfd 6,104(11)\n\t" \
- "stfd 7,112(11)\n\t" \
- "stfd 8,120(11)\n\t" \
- "stfd 9,128(11)\n\t" \
- "stfd 10,136(11)\n\t" \
- "stfd 11,144(11)\n\t" \
- "stfd 12,152(11)\n\t" \
- "stfd 13,160(11)\n\t":::"11", "memory"); \
- lparms = gparms;
-#else
-#define save_parms(lparms) \
- asm volatile ("ld r11,gparms@got(r2)\n\t" \
- "std r3,0(r11)\n\t" \
- "std r4,8(r11)\n\t" \
- "std r5,16(r11)\n\t" \
- "std r6,24(r11)\n\t" \
- "std r7,32(r11)\n\t" \
- "std r8,40(r11)\n\t" \
- "std r9,48(r11)\n\t" \
- "std r10,56(r11)\n\t" \
- "stfd f1,64(r11)\n\t" \
- "stfd f2,72(r11)\n\t" \
- "stfd f3,80(r11)\n\t" \
- "stfd f4,88(r11)\n\t" \
- "stfd f5,96(r11)\n\t" \
- "stfd f6,104(r11)\n\t" \
- "stfd f7,112(r11)\n\t" \
- "stfd f8,120(r11)\n\t" \
- "stfd f9,128(r11)\n\t" \
- "stfd f10,136(r11)\n\t" \
- "stfd f11,144(r11)\n\t" \
- "stfd f12,152(r11)\n\t" \
- "stfd f13,160(r11)\n\t":::"r11", "memory"); \
- lparms = gparms;
-#endif
+/* Wrapper to save the GPRs and FPRs and then jump to the real function. */
+#define WRAPPER(NAME) \
+__asm__ ("\t.globl\t" #NAME "_asm\n\t" \
+ ".section \".opd\",\"aw\"\n\t" \
+ ".align 3\n" \
+ #NAME "_asm:\n\t" \
+ ".quad .L." #NAME "_asm,.TOC.@tocbase,0\n\t" \
+ ".text\n\t" \
+ ".type " #NAME "_asm, @function\n" \
+ ".L." #NAME "_asm:\n\t" \
+ "ld 11,gparms@got(2)\n\t" \
+ "std 3,0(11)\n\t" \
+ "std 4,8(11)\n\t" \
+ "std 5,16(11)\n\t" \
+ "std 6,24(11)\n\t" \
+ "std 7,32(11)\n\t" \
+ "std 8,40(11)\n\t" \
+ "std 9,48(11)\n\t" \
+ "std 10,56(11)\n\t" \
+ "stfd 1,64(11)\n\t" \
+ "stfd 2,72(11)\n\t" \
+ "stfd 3,80(11)\n\t" \
+ "stfd 4,88(11)\n\t" \
+ "stfd 5,96(11)\n\t" \
+ "stfd 6,104(11)\n\t" \
+ "stfd 7,112(11)\n\t" \
+ "stfd 8,120(11)\n\t" \
+ "stfd 9,128(11)\n\t" \
+ "stfd 10,136(11)\n\t" \
+ "stfd 11,144(11)\n\t" \
+ "stfd 12,152(11)\n\t" \
+ "stfd 13,160(11)\n\t" \
+ "b " #NAME "\n\t" \
+ ".long 0\n\t" \
+ ".byte 0,0,0,0,0,0,0,0\n\t" \
+ ".size " #NAME ",.-" #NAME "\n")
typedef struct sf
{
@@ -97,6 +80,13 @@ typedef struct sf
unsigned long slot[100];
} stack_frame_t;
+extern void func0_asm (double, double, double, double, double, double,
+ double, double, double, double, double, double,
+ double, double,
+ _Decimal64, _Decimal128, _Decimal64);
+
+WRAPPER(func0);
+
/* Fill up floating point registers with double arguments, forcing
decimal float arguments into the parameter save area. */
void __attribute__ ((noinline))
@@ -105,186 +95,209 @@ func0 (double a1, double a2, double a3, double a4, double a5, double a6,
double a13, double a14,
_Decimal64 a15, _Decimal128 a16, _Decimal64 a17)
{
- reg_parms_t lparms;
stack_frame_t *sp;
- save_parms (lparms);
sp = __builtin_frame_address (0);
sp = sp->backchain;
- if (a1 != lparms.fprs[0]) FAILURE
- if (a2 != lparms.fprs[1]) FAILURE
- if (a3 != lparms.fprs[2]) FAILURE
- if (a4 != lparms.fprs[3]) FAILURE
- if (a5 != lparms.fprs[4]) FAILURE
- if (a6 != lparms.fprs[5]) FAILURE
- if (a7 != lparms.fprs[6]) FAILURE
- if (a8 != lparms.fprs[7]) FAILURE
- if (a9 != lparms.fprs[8]) FAILURE
- if (a10 != lparms.fprs[9]) FAILURE
- if (a11 != lparms.fprs[10]) FAILURE
- if (a12 != lparms.fprs[11]) FAILURE
- if (a13 != lparms.fprs[12]) FAILURE
+ if (a1 != gparms.fprs[0]) FAILURE
+ if (a2 != gparms.fprs[1]) FAILURE
+ if (a3 != gparms.fprs[2]) FAILURE
+ if (a4 != gparms.fprs[3]) FAILURE
+ if (a5 != gparms.fprs[4]) FAILURE
+ if (a6 != gparms.fprs[5]) FAILURE
+ if (a7 != gparms.fprs[6]) FAILURE
+ if (a8 != gparms.fprs[7]) FAILURE
+ if (a9 != gparms.fprs[8]) FAILURE
+ if (a10 != gparms.fprs[9]) FAILURE
+ if (a11 != gparms.fprs[10]) FAILURE
+ if (a12 != gparms.fprs[11]) FAILURE
+ if (a13 != gparms.fprs[12]) FAILURE
if (a14 != *(double *)&sp->slot[13]) FAILURE
if (a15 != *(_Decimal64 *)&sp->slot[14]) FAILURE
if (a16 != *(_Decimal128 *)&sp->slot[15]) FAILURE
if (a17 != *(_Decimal64 *)&sp->slot[17]) FAILURE
}
+extern void func1_asm (double, double, double, double, double, double,
+ double, double, double, double, double, double,
+ double, _Decimal128 );
+
+WRAPPER(func1);
+
void __attribute__ ((noinline))
func1 (double a1, double a2, double a3, double a4, double a5, double a6,
double a7, double a8, double a9, double a10, double a11, double a12,
double a13, _Decimal128 a14)
{
- reg_parms_t lparms;
stack_frame_t *sp;
- save_parms (lparms);
sp = __builtin_frame_address (0);
sp = sp->backchain;
- if (a1 != lparms.fprs[0]) FAILURE
- if (a2 != lparms.fprs[1]) FAILURE
- if (a3 != lparms.fprs[2]) FAILURE
- if (a4 != lparms.fprs[3]) FAILURE
- if (a5 != lparms.fprs[4]) FAILURE
- if (a6 != lparms.fprs[5]) FAILURE
- if (a7 != lparms.fprs[6]) FAILURE
- if (a8 != lparms.fprs[7]) FAILURE
- if (a9 != lparms.fprs[8]) FAILURE
- if (a10 != lparms.fprs[9]) FAILURE
- if (a11 != lparms.fprs[10]) FAILURE
- if (a12 != lparms.fprs[11]) FAILURE
- if (a13 != lparms.fprs[12]) FAILURE
+ if (a1 != gparms.fprs[0]) FAILURE
+ if (a2 != gparms.fprs[1]) FAILURE
+ if (a3 != gparms.fprs[2]) FAILURE
+ if (a4 != gparms.fprs[3]) FAILURE
+ if (a5 != gparms.fprs[4]) FAILURE
+ if (a6 != gparms.fprs[5]) FAILURE
+ if (a7 != gparms.fprs[6]) FAILURE
+ if (a8 != gparms.fprs[7]) FAILURE
+ if (a9 != gparms.fprs[8]) FAILURE
+ if (a10 != gparms.fprs[9]) FAILURE
+ if (a11 != gparms.fprs[10]) FAILURE
+ if (a12 != gparms.fprs[11]) FAILURE
+ if (a13 != gparms.fprs[12]) FAILURE
if (a14 != *(_Decimal128 *)&sp->slot[13]) FAILURE
}
+extern void func2_asm (double, double, double, double, double, double,
+ double, double, double, double, double, double,
+ _Decimal128);
+
+WRAPPER(func2);
+
void __attribute__ ((noinline))
func2 (double a1, double a2, double a3, double a4, double a5, double a6,
double a7, double a8, double a9, double a10, double a11, double a12,
_Decimal128 a13)
{
- reg_parms_t lparms;
stack_frame_t *sp;
- save_parms (lparms);
sp = __builtin_frame_address (0);
sp = sp->backchain;
- if (a1 != lparms.fprs[0]) FAILURE
- if (a2 != lparms.fprs[1]) FAILURE
- if (a3 != lparms.fprs[2]) FAILURE
- if (a4 != lparms.fprs[3]) FAILURE
- if (a5 != lparms.fprs[4]) FAILURE
- if (a6 != lparms.fprs[5]) FAILURE
- if (a7 != lparms.fprs[6]) FAILURE
- if (a8 != lparms.fprs[7]) FAILURE
- if (a9 != lparms.fprs[8]) FAILURE
- if (a10 != lparms.fprs[9]) FAILURE
- if (a11 != lparms.fprs[10]) FAILURE
- if (a12 != lparms.fprs[11]) FAILURE
+ if (a1 != gparms.fprs[0]) FAILURE
+ if (a2 != gparms.fprs[1]) FAILURE
+ if (a3 != gparms.fprs[2]) FAILURE
+ if (a4 != gparms.fprs[3]) FAILURE
+ if (a5 != gparms.fprs[4]) FAILURE
+ if (a6 != gparms.fprs[5]) FAILURE
+ if (a7 != gparms.fprs[6]) FAILURE
+ if (a8 != gparms.fprs[7]) FAILURE
+ if (a9 != gparms.fprs[8]) FAILURE
+ if (a10 != gparms.fprs[9]) FAILURE
+ if (a11 != gparms.fprs[10]) FAILURE
+ if (a12 != gparms.fprs[11]) FAILURE
if (a13 != *(_Decimal128 *)&sp->slot[12]) FAILURE
}
+extern void func3_asm (_Decimal64, _Decimal128, _Decimal64, _Decimal128,
+ _Decimal64, _Decimal128, _Decimal64, _Decimal128,
+ _Decimal64, _Decimal128);
+
+WRAPPER(func3);
+
void __attribute__ ((noinline))
func3 (_Decimal64 a1, _Decimal128 a2, _Decimal64 a3, _Decimal128 a4,
_Decimal64 a5, _Decimal128 a6, _Decimal64 a7, _Decimal128 a8,
_Decimal64 a9, _Decimal128 a10)
{
- reg_parms_t lparms;
stack_frame_t *sp;
- save_parms (lparms);
sp = __builtin_frame_address (0);
sp = sp->backchain;
- if (a1 != *(_Decimal64 *)&lparms.fprs[0]) FAILURE /* f1 */
- if (a2 != *(_Decimal128 *)&lparms.fprs[1]) FAILURE /* f2 & f3 */
- if (a3 != *(_Decimal64 *)&lparms.fprs[3]) FAILURE /* f4 */
- if (a4 != *(_Decimal128 *)&lparms.fprs[5]) FAILURE /* f6 & f7 */
- if (a5 != *(_Decimal64 *)&lparms.fprs[7]) FAILURE /* f8 */
- if (a6 != *(_Decimal128 *)&lparms.fprs[9]) FAILURE /* f10 & f11 */
- if (a7 != *(_Decimal64 *)&lparms.fprs[11]) FAILURE /* f12 */
+ if (a1 != *(_Decimal64 *)&gparms.fprs[0]) FAILURE /* f1 */
+ if (a2 != *(_Decimal128 *)&gparms.fprs[1]) FAILURE /* f2 & f3 */
+ if (a3 != *(_Decimal64 *)&gparms.fprs[3]) FAILURE /* f4 */
+ if (a4 != *(_Decimal128 *)&gparms.fprs[5]) FAILURE /* f6 & f7 */
+ if (a5 != *(_Decimal64 *)&gparms.fprs[7]) FAILURE /* f8 */
+ if (a6 != *(_Decimal128 *)&gparms.fprs[9]) FAILURE /* f10 & f11 */
+ if (a7 != *(_Decimal64 *)&gparms.fprs[11]) FAILURE /* f12 */
if (a8 != *(_Decimal128 *)&sp->slot[10]) FAILURE
if (a9 != *(_Decimal64 *)&sp->slot[12]) FAILURE
if (a10 != *(_Decimal128 *)&sp->slot[13]) FAILURE
}
+extern void func4_asm (_Decimal128, _Decimal64, _Decimal128, _Decimal64,
+ _Decimal128, _Decimal64, _Decimal128, _Decimal64);
+
+WRAPPER(func4);
+
void __attribute__ ((noinline))
func4 (_Decimal128 a1, _Decimal64 a2, _Decimal128 a3, _Decimal64 a4,
_Decimal128 a5, _Decimal64 a6, _Decimal128 a7, _Decimal64 a8)
{
- reg_parms_t lparms;
stack_frame_t *sp;
- save_parms (lparms);
sp = __builtin_frame_address (0);
sp = sp->backchain;
- if (a1 != *(_Decimal128 *)&lparms.fprs[1]) FAILURE /* f2 & f3 */
- if (a2 != *(_Decimal64 *)&lparms.fprs[3]) FAILURE /* f4 */
- if (a3 != *(_Decimal128 *)&lparms.fprs[5]) FAILURE /* f6 & f7 */
- if (a4 != *(_Decimal64 *)&lparms.fprs[7]) FAILURE /* f8 */
- if (a5 != *(_Decimal128 *)&lparms.fprs[9]) FAILURE /* f10 & f11 */
- if (a6 != *(_Decimal64 *)&lparms.fprs[11]) FAILURE /* f12 */
+ if (a1 != *(_Decimal128 *)&gparms.fprs[1]) FAILURE /* f2 & f3 */
+ if (a2 != *(_Decimal64 *)&gparms.fprs[3]) FAILURE /* f4 */
+ if (a3 != *(_Decimal128 *)&gparms.fprs[5]) FAILURE /* f6 & f7 */
+ if (a4 != *(_Decimal64 *)&gparms.fprs[7]) FAILURE /* f8 */
+ if (a5 != *(_Decimal128 *)&gparms.fprs[9]) FAILURE /* f10 & f11 */
+ if (a6 != *(_Decimal64 *)&gparms.fprs[11]) FAILURE /* f12 */
if (a7 != *(_Decimal128 *)&sp->slot[9]) FAILURE
if (a8 != *(_Decimal64 *)&sp->slot[11]) FAILURE
}
+extern void func5_asm (_Decimal32, _Decimal32, _Decimal32, _Decimal32,
+ _Decimal32, _Decimal32, _Decimal32, _Decimal32,
+ _Decimal32, _Decimal32, _Decimal32, _Decimal32,
+ _Decimal32, _Decimal32, _Decimal32, _Decimal32);
+
+WRAPPER(func5);
+
void __attribute__ ((noinline))
func5 (_Decimal32 a1, _Decimal32 a2, _Decimal32 a3, _Decimal32 a4,
_Decimal32 a5, _Decimal32 a6, _Decimal32 a7, _Decimal32 a8,
_Decimal32 a9, _Decimal32 a10, _Decimal32 a11, _Decimal32 a12,
_Decimal32 a13, _Decimal32 a14, _Decimal32 a15, _Decimal32 a16)
{
- reg_parms_t lparms;
stack_frame_t *sp;
- save_parms (lparms);
sp = __builtin_frame_address (0);
sp = sp->backchain;
/* _Decimal32 is passed in the lower half of an FPR or parameter slot. */
- if (a1 != ((d32parm_t *)&lparms.fprs[0])->d) FAILURE /* f1 */
- if (a2 != ((d32parm_t *)&lparms.fprs[1])->d) FAILURE /* f2 */
- if (a3 != ((d32parm_t *)&lparms.fprs[2])->d) FAILURE /* f3 */
- if (a4 != ((d32parm_t *)&lparms.fprs[3])->d) FAILURE /* f4 */
- if (a5 != ((d32parm_t *)&lparms.fprs[4])->d) FAILURE /* f5 */
- if (a6 != ((d32parm_t *)&lparms.fprs[5])->d) FAILURE /* f6 */
- if (a7 != ((d32parm_t *)&lparms.fprs[6])->d) FAILURE /* f7 */
- if (a8 != ((d32parm_t *)&lparms.fprs[7])->d) FAILURE /* f8 */
- if (a9 != ((d32parm_t *)&lparms.fprs[8])->d) FAILURE /* f9 */
- if (a10 != ((d32parm_t *)&lparms.fprs[9])->d) FAILURE /* f10 */
- if (a11 != ((d32parm_t *)&lparms.fprs[10])->d) FAILURE /* f11 */
- if (a12 != ((d32parm_t *)&lparms.fprs[11])->d) FAILURE /* f12 */
- if (a13 != ((d32parm_t *)&lparms.fprs[12])->d) FAILURE /* f13 */
+ if (a1 != ((d32parm_t *)&gparms.fprs[0])->d) FAILURE /* f1 */
+ if (a2 != ((d32parm_t *)&gparms.fprs[1])->d) FAILURE /* f2 */
+ if (a3 != ((d32parm_t *)&gparms.fprs[2])->d) FAILURE /* f3 */
+ if (a4 != ((d32parm_t *)&gparms.fprs[3])->d) FAILURE /* f4 */
+ if (a5 != ((d32parm_t *)&gparms.fprs[4])->d) FAILURE /* f5 */
+ if (a6 != ((d32parm_t *)&gparms.fprs[5])->d) FAILURE /* f6 */
+ if (a7 != ((d32parm_t *)&gparms.fprs[6])->d) FAILURE /* f7 */
+ if (a8 != ((d32parm_t *)&gparms.fprs[7])->d) FAILURE /* f8 */
+ if (a9 != ((d32parm_t *)&gparms.fprs[8])->d) FAILURE /* f9 */
+ if (a10 != ((d32parm_t *)&gparms.fprs[9])->d) FAILURE /* f10 */
+ if (a11 != ((d32parm_t *)&gparms.fprs[10])->d) FAILURE /* f11 */
+ if (a12 != ((d32parm_t *)&gparms.fprs[11])->d) FAILURE /* f12 */
+ if (a13 != ((d32parm_t *)&gparms.fprs[12])->d) FAILURE /* f13 */
if (a14 != ((d32parm_t *)&sp->slot[13])->d) FAILURE
if (a15 != ((d32parm_t *)&sp->slot[14])->d) FAILURE
if (a16 != ((d32parm_t *)&sp->slot[15])->d) FAILURE
}
+extern void func6_asm (_Decimal32, _Decimal64, _Decimal128,
+ _Decimal32, _Decimal64, _Decimal128,
+ _Decimal32, _Decimal64, _Decimal128,
+ _Decimal32, _Decimal64, _Decimal128);
+
+WRAPPER(func6);
+
void __attribute__ ((noinline))
func6 (_Decimal32 a1, _Decimal64 a2, _Decimal128 a3,
_Decimal32 a4, _Decimal64 a5, _Decimal128 a6,
_Decimal32 a7, _Decimal64 a8, _Decimal128 a9,
_Decimal32 a10, _Decimal64 a11, _Decimal128 a12)
{
- reg_parms_t lparms;
stack_frame_t *sp;
- save_parms (lparms);
sp = __builtin_frame_address (0);
sp = sp->backchain;
- if (a1 != ((d32parm_t *)&lparms.fprs[0])->d) FAILURE /* f1 */
- if (a2 != *(_Decimal64 *)&lparms.fprs[1]) FAILURE /* f2 */
- if (a3 != *(_Decimal128 *)&lparms.fprs[3]) FAILURE /* f4 & f5 */
- if (a4 != ((d32parm_t *)&lparms.fprs[5])->d) FAILURE /* f6 */
- if (a5 != *(_Decimal64 *)&lparms.fprs[6]) FAILURE /* f7 */
- if (a6 != *(_Decimal128 *)&lparms.fprs[7]) FAILURE /* f8 & f9 */
- if (a7 != ((d32parm_t *)&lparms.fprs[9])->d) FAILURE /* f10 */
- if (a8 != *(_Decimal64 *)&lparms.fprs[10]) FAILURE /* f11 */
- if (a9 != *(_Decimal128 *)&lparms.fprs[11]) FAILURE /* f12 & f13 */
+ if (a1 != ((d32parm_t *)&gparms.fprs[0])->d) FAILURE /* f1 */
+ if (a2 != *(_Decimal64 *)&gparms.fprs[1]) FAILURE /* f2 */
+ if (a3 != *(_Decimal128 *)&gparms.fprs[3]) FAILURE /* f4 & f5 */
+ if (a4 != ((d32parm_t *)&gparms.fprs[5])->d) FAILURE /* f6 */
+ if (a5 != *(_Decimal64 *)&gparms.fprs[6]) FAILURE /* f7 */
+ if (a6 != *(_Decimal128 *)&gparms.fprs[7]) FAILURE /* f8 & f9 */
+ if (a7 != ((d32parm_t *)&gparms.fprs[9])->d) FAILURE /* f10 */
+ if (a8 != *(_Decimal64 *)&gparms.fprs[10]) FAILURE /* f11 */
+ if (a9 != *(_Decimal128 *)&gparms.fprs[11]) FAILURE /* f12 & f13 */
if (a10 != ((d32parm_t *)&sp->slot[12])->d) FAILURE
if (a11 != *(_Decimal64 *)&sp->slot[13]) FAILURE
}
@@ -292,23 +305,23 @@ func6 (_Decimal32 a1, _Decimal64 a2, _Decimal128 a3,
int
main (void)
{
- func0 (1.5, 2.5, 3.5, 4.5, 5.5, 6.5, 7.5, 8.5, 9.5, 10.5, 11.5, 12.5, 13.5,
- 14.5, 15.2dd, 16.2dl, 17.2dd);
- func1 (101.5, 102.5, 103.5, 104.5, 105.5, 106.5, 107.5, 108.5, 109.5,
- 110.5, 111.5, 112.5, 113.5, 114.2dd);
- func2 (201.5, 202.5, 203.5, 204.5, 205.5, 206.5, 207.5, 208.5, 209.5,
- 210.5, 211.5, 212.5, 213.2dd);
- func3 (301.2dd, 302.2dl, 303.2dd, 304.2dl, 305.2dd, 306.2dl, 307.2dd,
- 308.2dl, 309.2dd, 310.2dl);
- func4 (401.2dl, 402.2dd, 403.2dl, 404.2dd, 405.2dl, 406.2dd, 407.2dl,
- 408.2dd);
+ func0_asm (1.5, 2.5, 3.5, 4.5, 5.5, 6.5, 7.5, 8.5, 9.5, 10.5, 11.5, 12.5, 13.5,
+ 14.5, 15.2dd, 16.2dl, 17.2dd);
+ func1_asm (101.5, 102.5, 103.5, 104.5, 105.5, 106.5, 107.5, 108.5, 109.5,
+ 110.5, 111.5, 112.5, 113.5, 114.2dd);
+ func2_asm (201.5, 202.5, 203.5, 204.5, 205.5, 206.5, 207.5, 208.5, 209.5,
+ 210.5, 211.5, 212.5, 213.2dd);
+ func3_asm (301.2dd, 302.2dl, 303.2dd, 304.2dl, 305.2dd, 306.2dl, 307.2dd,
+ 308.2dl, 309.2dd, 310.2dl);
+ func4_asm (401.2dl, 402.2dd, 403.2dl, 404.2dd, 405.2dl, 406.2dd, 407.2dl,
+ 408.2dd);
#if 0
/* _Decimal32 doesn't yet follow the ABI; enable this when it does. */
- func5 (501.2df, 502.2df, 503.2df, 504.2df, 505.2df, 506.2df, 507.2df,
- 508.2df, 509.2df, 510.2df, 511.2df, 512.2df, 513.2df, 514.2df,
- 515.2df, 516.2df);
- func6 (601.2df, 602.2dd, 603.2dl, 604.2df, 605.2dd, 606.2dl,
- 607.2df, 608.2dd, 609.2dl, 610.2df, 611.2dd, 612.2dl);
+ func5_asm (501.2df, 502.2df, 503.2df, 504.2df, 505.2df, 506.2df, 507.2df,
+ 508.2df, 509.2df, 510.2df, 511.2df, 512.2df, 513.2df, 514.2df,
+ 515.2df, 516.2df);
+ func6_asm (601.2df, 602.2dd, 603.2dl, 604.2df, 605.2dd, 606.2dl,
+ 607.2df, 608.2dd, 609.2dl, 610.2df, 611.2dd, 612.2dl);
#endif
if (failcnt != 0)
diff --git a/gcc/testsuite/gcc.target/powerpc/pr47251.c b/gcc/testsuite/gcc.target/powerpc/pr47251.c
index 3089c493378..6cb9f492e9c 100644
--- a/gcc/testsuite/gcc.target/powerpc/pr47251.c
+++ b/gcc/testsuite/gcc.target/powerpc/pr47251.c
@@ -1,15 +1,15 @@
-/* { dg-do compile { target { powerpc*-*-* && ip32 } } } */
+/* { dg-do compile { target { powerpc*-*-* && ilp32 } } } */
/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */
/* { dg-require-effective-target powerpc_vsx_ok } */
/* { dg-options "-O2 -msoft-float -mcpu=power7" } */
/* PR 47151: libgcc fails to build when using --with-cpu=power7 due to a missed
TARGET_HARD_FLOAT test. */
-unsigned int
-__fixunssfdi (float a)
+unsigned long long
+func (float a)
{
const float dfa = a;
const unsigned int hi = dfa / 0x1p32f;
const unsigned int lo = dfa - (float) hi * 0x1p32f;
- return ((unsigned int) hi << (4 * 8)) | lo;
+ return ((unsigned long long) hi << (4 * 8)) | lo;
}
diff --git a/gcc/testsuite/gcc.target/powerpc/pr47755.c b/gcc/testsuite/gcc.target/powerpc/pr47755.c
new file mode 100644
index 00000000000..6dbd1fe02f3
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/pr47755.c
@@ -0,0 +1,16 @@
+/* { dg-do compile { target { powerpc*-*-* } } } */
+/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */
+/* { dg-require-effective-target powerpc_vsx_ok } */
+/* { dg-options "-O3 -mcpu=power7" } */
+/* { dg-final { scan-assembler "xxlxor" } } */
+/* { dg-final { scan-assembler-not "lxvd2x" } } */
+/* { dg-final { scan-assembler-not "lxvw4x" } } */
+/* { dg-final { scan-assembler-not "lvx" } } */
+
+/* PR 47755: Compiler loads vector constant of 0 from TOC instead of using
+ xxlxor. */
+void
+func (vector long long *p)
+{
+ *p = (vector long long) { 0LL, 0LL };
+}
diff --git a/gcc/testsuite/gcc.target/powerpc/vsx-builtin-8.c b/gcc/testsuite/gcc.target/powerpc/vsx-builtin-8.c
new file mode 100644
index 00000000000..836b3851cad
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vsx-builtin-8.c
@@ -0,0 +1,97 @@
+/* { dg-do compile { target { powerpc*-*-* } } } */
+/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */
+/* { dg-require-effective-target powerpc_vsx_ok } */
+/* { dg-options "-O3 -mcpu=power7" } */
+
+/* Test the various load/store varients. */
+
+#include <altivec.h>
+
+#define TEST_COPY(NAME, TYPE) \
+void NAME ## _copy_native (vector TYPE *a, vector TYPE *b) \
+{ \
+ *a = *b; \
+} \
+ \
+void NAME ## _copy_vec (vector TYPE *a, vector TYPE *b) \
+{ \
+ vector TYPE x = vec_ld (0, b); \
+ vec_st (x, 0, a); \
+} \
+
+#define TEST_COPYL(NAME, TYPE) \
+void NAME ## _lvxl (vector TYPE *a, vector TYPE *b) \
+{ \
+ vector TYPE x = vec_ldl (0, b); \
+ vec_stl (x, 0, a); \
+} \
+
+#define TEST_VSX_COPY(NAME, TYPE) \
+void NAME ## _copy_vsx (vector TYPE *a, vector TYPE *b) \
+{ \
+ vector TYPE x = vec_vsx_ld (0, b); \
+ vec_vsx_st (x, 0, a); \
+} \
+
+#define TEST_ALIGN(NAME, TYPE) \
+void NAME ## _align (vector unsigned char *a, TYPE *b) \
+{ \
+ vector unsigned char x = vec_lvsl (0, b); \
+ vector unsigned char y = vec_lvsr (0, b); \
+ vec_st (x, 0, a); \
+ vec_st (y, 8, a); \
+}
+
+#ifndef NO_COPY
+TEST_COPY(uchar, unsigned char)
+TEST_COPY(schar, signed char)
+TEST_COPY(bchar, bool char)
+TEST_COPY(ushort, unsigned short)
+TEST_COPY(sshort, signed short)
+TEST_COPY(bshort, bool short)
+TEST_COPY(uint, unsigned int)
+TEST_COPY(sint, signed int)
+TEST_COPY(bint, bool int)
+TEST_COPY(float, float)
+TEST_COPY(double, double)
+#endif /* NO_COPY */
+
+#ifndef NO_COPYL
+TEST_COPYL(uchar, unsigned char)
+TEST_COPYL(schar, signed char)
+TEST_COPYL(bchar, bool char)
+TEST_COPYL(ushort, unsigned short)
+TEST_COPYL(sshort, signed short)
+TEST_COPYL(bshort, bool short)
+TEST_COPYL(uint, unsigned int)
+TEST_COPYL(sint, signed int)
+TEST_COPYL(bint, bool int)
+TEST_COPYL(float, float)
+TEST_COPYL(double, double)
+#endif /* NO_COPYL */
+
+#ifndef NO_ALIGN
+TEST_ALIGN(uchar, unsigned char)
+TEST_ALIGN(schar, signed char)
+TEST_ALIGN(ushort, unsigned short)
+TEST_ALIGN(sshort, signed short)
+TEST_ALIGN(uint, unsigned int)
+TEST_ALIGN(sint, signed int)
+TEST_ALIGN(float, float)
+TEST_ALIGN(double, double)
+#endif /* NO_ALIGN */
+
+
+#ifndef NO_VSX_COPY
+TEST_VSX_COPY(uchar, unsigned char)
+TEST_VSX_COPY(schar, signed char)
+TEST_VSX_COPY(bchar, bool char)
+TEST_VSX_COPY(ushort, unsigned short)
+TEST_VSX_COPY(sshort, signed short)
+TEST_VSX_COPY(bshort, bool short)
+TEST_VSX_COPY(uint, unsigned int)
+TEST_VSX_COPY(sint, signed int)
+TEST_VSX_COPY(bint, bool int)
+TEST_VSX_COPY(float, float)
+TEST_VSX_COPY(double, double)
+#endif /* NO_VSX_COPY */
diff --git a/gcc/testsuite/gcc.target/rx/builtins.c b/gcc/testsuite/gcc.target/rx/builtins.c
index 2a6241d7cce..d503ed3ef94 100644
--- a/gcc/testsuite/gcc.target/rx/builtins.c
+++ b/gcc/testsuite/gcc.target/rx/builtins.c
@@ -1,12 +1,6 @@
/* { dg-do run } */
-/* { dg-options "-fno-ipa-cp-clone" } */
/* Verify that the RX specific builtin functions work. */
-
-/* IPA CP cloning is disabled because the constant propagation
- has no understanding of the saturation behaviour of the
- __builtin_rx_sat function and so it will optimize away the
- saturation addition test. */
#include <stdlib.h>
#include <stdio.h>
@@ -25,20 +19,6 @@ half_word_swap (int arg)
return __builtin_rx_revw (arg);
}
-int
-saturate_add (int arg1, int arg2)
-{
- arg1 += arg2;
- return __builtin_rx_sat (arg1);
-}
-
-int
-exchange (int arg1, int arg2)
-{
- arg1 = __builtin_rx_xchg (arg2);
- return arg1;
-}
-
long
multiply_and_accumulate (long arg1, long arg2, long arg3)
{
@@ -118,7 +98,6 @@ int
main (void)
{
CHECK_1ARG (half_word_swap, 0x12345678, 0x34127856);
- CHECK_2ARG (saturate_add, 0x80000000, 0x80000000, 0x80000000);
CHECK_3ARG (multiply_and_accumulate, 0x111, 0x222, 0x333, 0x70007);
CHECK_1ARG (rxround, 0.5, 1);
return 0;
@@ -163,9 +142,3 @@ rmpa (int * multiplicand, int * multiplier, int num)
{
__builtin_rx_rmpa ();
}
-
-void
-set_interrupts (void)
-{
- __builtin_mvtipl (3);
-}
diff --git a/gcc/testsuite/gfortran.dg/Wall.f90 b/gcc/testsuite/gfortran.dg/Wall.f90
index a11c4b7fd15..64c95a9c094 100644
--- a/gcc/testsuite/gfortran.dg/Wall.f90
+++ b/gcc/testsuite/gfortran.dg/Wall.f90
@@ -5,7 +5,7 @@ program main
character (len=40) &
c
c = "Hello, &
- world!" ! { dg-warning "Warning: Missing '&' in continued character constant" }
+ world!" ! { dg-warning "Missing '&' in continued character constant" }
if (c.ne.&
"Hello, world!")&
call abort();end program main
diff --git a/gcc/testsuite/gfortran.dg/abstract_type_1.f90 b/gcc/testsuite/gfortran.dg/abstract_type_1.f90
index 7a91e11a89c..d0cd4320a7c 100644
--- a/gcc/testsuite/gfortran.dg/abstract_type_1.f90
+++ b/gcc/testsuite/gfortran.dg/abstract_type_1.f90
@@ -1,4 +1,4 @@
-! { dg-do "compile" }
+! { dg-do compile }
! { dg-options "-std=f95" }
! Abstract Types.
diff --git a/gcc/testsuite/gfortran.dg/abstract_type_2.f03 b/gcc/testsuite/gfortran.dg/abstract_type_2.f03
index 9b4ddebe40a..2583f1f4f80 100644
--- a/gcc/testsuite/gfortran.dg/abstract_type_2.f03
+++ b/gcc/testsuite/gfortran.dg/abstract_type_2.f03
@@ -1,4 +1,4 @@
-! { dg-do "compile" }
+! { dg-do compile }
! Abstract Types.
! Check for parser errors.
diff --git a/gcc/testsuite/gfortran.dg/abstract_type_3.f03 b/gcc/testsuite/gfortran.dg/abstract_type_3.f03
index a6f06235d24..79bc131e0c6 100644
--- a/gcc/testsuite/gfortran.dg/abstract_type_3.f03
+++ b/gcc/testsuite/gfortran.dg/abstract_type_3.f03
@@ -1,4 +1,4 @@
-! { dg-do "compile" }
+! { dg-do compile }
! Abstract Types.
! Check for errors when using abstract types in an inappropriate way.
diff --git a/gcc/testsuite/gfortran.dg/abstract_type_4.f03 b/gcc/testsuite/gfortran.dg/abstract_type_4.f03
index bc34d4e541f..a6e5de20882 100644
--- a/gcc/testsuite/gfortran.dg/abstract_type_4.f03
+++ b/gcc/testsuite/gfortran.dg/abstract_type_4.f03
@@ -1,4 +1,4 @@
-! { dg-do "compile" }
+! { dg-do compile }
! Abstract Types.
! Check for module file IO.
diff --git a/gcc/testsuite/gfortran.dg/abstract_type_5.f03 b/gcc/testsuite/gfortran.dg/abstract_type_5.f03
index 7da38e8fed7..42ac963face 100644
--- a/gcc/testsuite/gfortran.dg/abstract_type_5.f03
+++ b/gcc/testsuite/gfortran.dg/abstract_type_5.f03
@@ -1,4 +1,4 @@
-! { dg-do "compile" }
+! { dg-do compile }
! Abstract Types.
! Check for correct handling of abstract-typed base object references.
diff --git a/gcc/testsuite/gfortran.dg/abstract_type_6.f03 b/gcc/testsuite/gfortran.dg/abstract_type_6.f03
index bc8e5437ad5..53116dfb360 100644
--- a/gcc/testsuite/gfortran.dg/abstract_type_6.f03
+++ b/gcc/testsuite/gfortran.dg/abstract_type_6.f03
@@ -1,4 +1,4 @@
-! { dg-do "compile" }
+! { dg-do compile }
! Test the fix for PR43266, in which an ICE followed correct error messages.
!
! Contributed by Tobias Burnus <burnus@gcc.gnu.org>
diff --git a/gcc/testsuite/gfortran.dg/alloc_comp_constraint_1.f90 b/gcc/testsuite/gfortran.dg/alloc_comp_constraint_1.f90
index cb5ac0611d6..eb1b1058713 100644
--- a/gcc/testsuite/gfortran.dg/alloc_comp_constraint_1.f90
+++ b/gcc/testsuite/gfortran.dg/alloc_comp_constraint_1.f90
@@ -13,7 +13,7 @@ program main
type(foo) :: a
type(bar) :: b
- namelist /blah/ a ! { dg-error "cannot have ALLOCATABLE components" }
+ namelist /blah/ a ! { dg-error "has ALLOCATABLE or POINTER components and thus requires a defined input/output" }
write (*, *) a ! { dg-error "cannot have ALLOCATABLE components" }
diff --git a/gcc/testsuite/gfortran.dg/alloc_comp_constraint_6.f90 b/gcc/testsuite/gfortran.dg/alloc_comp_constraint_6.f90
index 657b7246dc4..e2b609aee5a 100644
--- a/gcc/testsuite/gfortran.dg/alloc_comp_constraint_6.f90
+++ b/gcc/testsuite/gfortran.dg/alloc_comp_constraint_6.f90
@@ -1,4 +1,4 @@
-! { dg-do compile )
+! { dg-do compile }
! PR45889 Regression with I/O of element of allocatable array in derived type
module cell
implicit none
diff --git a/gcc/testsuite/gfortran.dg/alloc_comp_init_expr.f03 b/gcc/testsuite/gfortran.dg/alloc_comp_init_expr.f03
index 5e399ac7114..02ca7fc4e92 100644
--- a/gcc/testsuite/gfortran.dg/alloc_comp_init_expr.f03
+++ b/gcc/testsuite/gfortran.dg/alloc_comp_init_expr.f03
@@ -1,4 +1,4 @@
-! { dg-do "compile" }
+! { dg-do compile }
! PR fortran/34402 - allocatable components shall not be
! data-initialized in init expr
diff --git a/gcc/testsuite/gfortran.dg/allocatable_function_5.f90 b/gcc/testsuite/gfortran.dg/allocatable_function_5.f90
new file mode 100644
index 00000000000..8e7d49b0fa8
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/allocatable_function_5.f90
@@ -0,0 +1,48 @@
+! { dg-do run }
+! Tests function return of deferred length scalars.
+!
+! Contributed by Paul Thomas <pault@gcc.gnu.org>
+!
+module m
+contains
+ function mfoo (carg) result(res)
+ character (:), allocatable :: res
+ character (*) :: carg
+ res = carg(2:4)
+ end function
+ function mbar (carg)
+ character (:), allocatable :: mbar
+ character (*) :: carg
+ mbar = carg(2:13)
+ end function
+end module
+
+ use m
+ character (:), allocatable :: lhs
+ lhs = foo ("foo calling ")
+ if (lhs .ne. "foo") call abort
+ if (len (lhs) .ne. 3) call abort
+ deallocate (lhs)
+ lhs = bar ("bar calling - baaaa!")
+ if (lhs .ne. "bar calling") call abort
+ if (len (lhs) .ne. 12) call abort
+ deallocate (lhs)
+ lhs = mfoo ("mfoo calling ")
+ if (lhs .ne. "foo") call abort
+ if (len (lhs) .ne. 3) call abort
+ deallocate (lhs)
+ lhs = mbar ("mbar calling - baaaa!")
+ if (lhs .ne. "bar calling") call abort
+ if (len (lhs) .ne. 12) call abort
+contains
+ function foo (carg) result(res)
+ character (:), allocatable :: res
+ character (*) :: carg
+ res = carg(1:3)
+ end function
+ function bar (carg)
+ character (:), allocatable :: bar
+ character (*) :: carg
+ bar = carg(1:12)
+ end function
+end
diff --git a/gcc/testsuite/gfortran.dg/allocatable_scalar_11.f90 b/gcc/testsuite/gfortran.dg/allocatable_scalar_11.f90
index 7f4d64d1205..b9fb1085760 100644
--- a/gcc/testsuite/gfortran.dg/allocatable_scalar_11.f90
+++ b/gcc/testsuite/gfortran.dg/allocatable_scalar_11.f90
@@ -1,4 +1,4 @@
-! { dg-compile }
+! { dg-do compile }
!
! PR fortran/46484
!
diff --git a/gcc/testsuite/gfortran.dg/allocatable_scalar_12.f90 b/gcc/testsuite/gfortran.dg/allocatable_scalar_12.f90
new file mode 100644
index 00000000000..eade363ea95
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/allocatable_scalar_12.f90
@@ -0,0 +1,30 @@
+! { dg-do run }
+!
+! PR fortran/47421
+!
+! Don't auto-deallocatable scalar character allocatables.
+!
+implicit none
+character(len=5), allocatable :: str
+allocate(str)
+str = '1bcde'
+if(str /= '1bcde') call abort()
+call sub(str,len(str))
+if(str /= '1bcde') call abort()
+call subOUT(str,len(str))
+if (len(str) /= 5) call abort()
+if(allocated(str)) call abort()
+contains
+ subroutine sub(x,n)
+ integer :: n
+ character(len=n), allocatable :: x
+ if(len(x) /= 5) call abort()
+ if(x /= '1bcde') call abort()
+ end subroutine sub
+ subroutine subOUT(x,n)
+ integer :: n
+ character(len=n), allocatable,intent(out) :: x
+ if(allocated(x)) call abort()
+ if(len(x) /= 5) call abort()
+ end subroutine subOUT
+end
diff --git a/gcc/testsuite/gfortran.dg/allocate_deferred_char_scalar_1.f03 b/gcc/testsuite/gfortran.dg/allocate_deferred_char_scalar_1.f03
new file mode 100644
index 00000000000..b9b70401412
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/allocate_deferred_char_scalar_1.f03
@@ -0,0 +1,267 @@
+! { dg-do run }
+!
+! Automatic reallocate on assignment, deferred length parameter for char
+!
+! PR fortran/45170
+! PR fortran/35810
+! PR fortran/47350
+!
+! Contributed by Tobias Burnus <burnus@gcc.gnu.org>
+!
+program test
+ implicit none
+ call mold_check()
+ call mold_check4()
+ call source_check()
+ call source_check4()
+ call ftn_test()
+ call ftn_test4()
+ call source3()
+contains
+ subroutine source_check()
+ character(len=:), allocatable :: str, str2
+ target :: str
+ character(len=8) :: str3
+ character(len=:), pointer :: str4, str5
+ nullify(str4)
+ str3 = 'AbCdEfGhIj'
+ if(allocated(str)) call abort()
+ allocate(str, source=str3)
+ if(.not.allocated(str)) call abort()
+ if(len(str) /= 8) call abort()
+ if(str /= 'AbCdEfGh') call abort()
+ if(associated(str4)) call abort()
+ str4 => str
+ if(str4 /= str .or. len(str4)/=8) call abort()
+ if(.not.associated(str4, str)) call abort()
+ str4 => null()
+ str = '12a56b78'
+ if(str4 == '12a56b78') call abort()
+ str4 = 'ABCDEFGH'
+ if(str == 'ABCDEFGH') call abort()
+ allocate(str5, source=str)
+ if(associated(str5, str)) call abort()
+ if(str5 /= '12a56b78' .or. len(str5)/=8) call abort()
+ str = 'abcdef'
+ if(str5 == 'abcdef') call abort()
+ str5 = 'ABCDEF'
+ if(str == 'ABCDEF') call abort()
+ end subroutine source_check
+ subroutine source_check4()
+ character(kind=4,len=:), allocatable :: str, str2
+ target :: str
+ character(kind=4,len=8) :: str3
+ character(kind=4,len=:), pointer :: str4, str5
+ nullify(str4)
+ str3 = 4_'AbCdEfGhIj'
+ if(allocated(str)) call abort()
+ allocate(str, source=str3)
+ if(.not.allocated(str)) call abort()
+ if(len(str) /= 8) call abort()
+ if(str /= 4_'AbCdEfGh') call abort()
+ if(associated(str4)) call abort()
+ str4 => str
+ if(str4 /= str .or. len(str4)/=8) call abort()
+ if(.not.associated(str4, str)) call abort()
+ str4 => null()
+ str = 4_'12a56b78'
+ if(str4 == 4_'12a56b78') call abort()
+ str4 = 4_'ABCDEFGH'
+ if(str == 4_'ABCDEFGH') call abort()
+ allocate(str5, source=str)
+ if(associated(str5, str)) call abort()
+ if(str5 /= 4_'12a56b78' .or. len(str5)/=8) call abort()
+ str = 4_'abcdef'
+ if(str5 == 4_'abcdef') call abort()
+ str5 = 4_'ABCDEF'
+ if(str == 4_'ABCDEF') call abort()
+ end subroutine source_check4
+ subroutine mold_check()
+ character(len=:), allocatable :: str, str2
+ character(len=8) :: str3
+ character(len=:), pointer :: str4, str5
+ nullify(str4)
+ str2 = "ABCE"
+ ALLOCATE( str, MOLD=str3)
+ if (len(str) /= 8) call abort()
+ DEALLOCATE(str)
+ ALLOCATE( str, MOLD=str2)
+ if (len(str) /= 4) call abort()
+
+ IF (associated(str4)) call abort()
+ ALLOCATE( str4, MOLD=str3)
+ IF (.not.associated(str4)) call abort()
+ str4 = '12345678'
+ if (len(str4) /= 8) call abort()
+ if(str4 /= '12345678') call abort()
+ DEALLOCATE(str4)
+ ALLOCATE( str4, MOLD=str2)
+ str4 = 'ABCD'
+ if (len(str4) /= 4) call abort()
+ if (str4 /= 'ABCD') call abort()
+ str5 => str4
+ if(.not.associated(str4,str5)) call abort()
+ if(len(str5) /= 4 .or. len(str4) /= len(str5)) call abort()
+ if(str5 /= str4) call abort()
+ deallocate(str4)
+ end subroutine mold_check
+ subroutine mold_check4()
+ character(len=:,kind=4), allocatable :: str, str2
+ character(len=8,kind=4) :: str3
+ character(len=:,kind=4), pointer :: str4, str5
+ nullify(str4)
+ str2 = 4_"ABCE"
+ ALLOCATE( str, MOLD=str3)
+ if (len(str) /= 8) call abort()
+ DEALLOCATE(str)
+ ALLOCATE( str, MOLD=str2)
+ if (len(str) /= 4) call abort()
+
+ IF (associated(str4)) call abort()
+ ALLOCATE( str4, MOLD=str3)
+ IF (.not.associated(str4)) call abort()
+ str4 = 4_'12345678'
+ if (len(str4) /= 8) call abort()
+ if(str4 /= 4_'12345678') call abort()
+ DEALLOCATE(str4)
+ ALLOCATE( str4, MOLD=str2)
+ str4 = 4_'ABCD'
+ if (len(str4) /= 4) call abort()
+ if (str4 /= 4_'ABCD') call abort()
+ str5 => str4
+ if(.not.associated(str4,str5)) call abort()
+ if(len(str5) /= 4 .or. len(str4) /= len(str5)) call abort()
+ if(str5 /= str4) call abort()
+ deallocate(str4)
+ end subroutine mold_check4
+ subroutine ftn_test()
+ character(len=:), allocatable :: str_a
+ character(len=:), pointer :: str_p
+ nullify(str_p)
+ call proc_test(str_a, str_p, .false.)
+ if (str_p /= '123457890abcdef') call abort()
+ if (len(str_p) /= 50) call abort()
+ if (str_a(1:5) /= 'ABCDE ') call abort()
+ if (len(str_a) /= 50) call abort()
+ deallocate(str_p)
+ str_a = '1245'
+ if(len(str_a) /= 4) call abort()
+ if(str_a /= '1245') call abort()
+ allocate(character(len=6) :: str_p)
+ if(len(str_p) /= 6) call abort()
+ str_p = 'AbCdEf'
+ call proc_test(str_a, str_p, .true.)
+ if (str_p /= '123457890abcdef') call abort()
+ if (len(str_p) /= 50) call abort()
+ if (str_a(1:5) /= 'ABCDE ') call abort()
+ if (len(str_a) /= 50) call abort()
+ deallocate(str_p)
+ end subroutine ftn_test
+ subroutine proc_test(a, p, alloc)
+ character(len=:), allocatable :: a
+ character(len=:), pointer :: p
+ character(len=5), target :: loc
+ logical :: alloc
+ if (.not. alloc) then
+ if(associated(p)) call abort()
+ if(allocated(a)) call abort()
+ else
+ if(len(a) /= 4) call abort()
+ if(a /= '1245') call abort()
+ if(len(p) /= 6) call abort()
+ if(p /= 'AbCdEf') call abort()
+ deallocate(a)
+ nullify(p)
+ end if
+ allocate(character(len=50) :: a)
+ a(1:5) = 'ABCDE'
+ if(len(a) /= 50) call abort()
+ if(a(1:5) /= "ABCDE") call abort()
+ loc = '12345'
+ p => loc
+ if (len(p) /= 5) call abort()
+ if (p /= '12345') call abort()
+ p = '12345679'
+ if (len(p) /= 5) call abort()
+ if (p /= '12345') call abort()
+ p = 'ABC'
+ if (loc /= 'ABC ') call abort()
+ allocate(p, mold=a)
+ if (.not.associated(p)) call abort()
+ p = '123457890abcdef'
+ if (p /= '123457890abcdef') call abort()
+ if (len(p) /= 50) call abort()
+ end subroutine proc_test
+ subroutine ftn_test4()
+ character(len=:,kind=4), allocatable :: str_a
+ character(len=:,kind=4), pointer :: str_p
+ nullify(str_p)
+ call proc_test4(str_a, str_p, .false.)
+ if (str_p /= 4_'123457890abcdef') call abort()
+ if (len(str_p) /= 50) call abort()
+ if (str_a(1:5) /= 4_'ABCDE ') call abort()
+ if (len(str_a) /= 50) call abort()
+ deallocate(str_p)
+ str_a = 4_'1245'
+ if(len(str_a) /= 4) call abort()
+ if(str_a /= 4_'1245') call abort()
+ allocate(character(len=6, kind = 4) :: str_p)
+ if(len(str_p) /= 6) call abort()
+ str_p = 4_'AbCdEf'
+ call proc_test4(str_a, str_p, .true.)
+ if (str_p /= 4_'123457890abcdef') call abort()
+ if (len(str_p) /= 50) call abort()
+ if (str_a(1:5) /= 4_'ABCDE ') call abort()
+ if (len(str_a) /= 50) call abort()
+ deallocate(str_p)
+ end subroutine ftn_test4
+ subroutine proc_test4(a, p, alloc)
+ character(len=:,kind=4), allocatable :: a
+ character(len=:,kind=4), pointer :: p
+ character(len=5,kind=4), target :: loc
+ logical :: alloc
+ if (.not. alloc) then
+ if(associated(p)) call abort()
+ if(allocated(a)) call abort()
+ else
+ if(len(a) /= 4) call abort()
+ if(a /= 4_'1245') call abort()
+ if(len(p) /= 6) call abort()
+ if(p /= 4_'AbCdEf') call abort()
+ deallocate(a)
+ nullify(p)
+ end if
+ allocate(character(len=50,kind=4) :: a)
+ a(1:5) = 4_'ABCDE'
+ if(len(a) /= 50) call abort()
+ if(a(1:5) /= 4_"ABCDE") call abort()
+ loc = '12345'
+ p => loc
+ if (len(p) /= 5) call abort()
+ if (p /= 4_'12345') call abort()
+ p = 4_'12345679'
+ if (len(p) /= 5) call abort()
+ if (p /= 4_'12345') call abort()
+ p = 4_'ABC'
+ if (loc /= 4_'ABC ') call abort()
+ allocate(p, mold=a)
+ if (.not.associated(p)) call abort()
+ p = 4_'123457890abcdef'
+ if (p /= 4_'123457890abcdef') call abort()
+ if (len(p) /= 50) call abort()
+ end subroutine proc_test4
+ subroutine source3()
+ character(len=:, kind=1), allocatable :: a1
+ character(len=:, kind=4), allocatable :: a4
+ character(len=:, kind=1), pointer :: p1
+ character(len=:, kind=4), pointer :: p4
+ allocate(a1, source='ABC') ! << ICE
+ if(len(a1) /= 3 .or. a1 /= 'ABC') call abort()
+ allocate(a4, source=4_'12345') ! << ICE
+ if(len(a4) /= 5 .or. a4 /= 4_'12345') call abort()
+ allocate(p1, mold='AB') ! << ICE
+ if(len(p1) /= 2) call abort()
+ allocate(p4, mold=4_'145') ! << ICE
+ if(len(p4) /= 3) call abort()
+ end subroutine source3
+end program test
diff --git a/gcc/testsuite/gfortran.dg/allocate_deferred_char_scalar_2.f03 b/gcc/testsuite/gfortran.dg/allocate_deferred_char_scalar_2.f03
new file mode 100644
index 00000000000..1f0f4330105
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/allocate_deferred_char_scalar_2.f03
@@ -0,0 +1,21 @@
+! { dg-do run }
+! Test the fix for PR47519, in which the character length was not
+! calculated for the SOURCE expressions below and an ICE resulted.
+!
+! Contributed by Tobias Burnus <burnus@gcc.gnu.org>
+!
+program note7_35
+ implicit none
+ character(:), allocatable :: name
+ character(:), allocatable :: src
+ integer n
+ n = 10
+ allocate(name, SOURCE=repeat('x',n))
+ if (name .ne. 'xxxxxxxxxx') call abort
+ if (len (name) .ne. 10 ) call abort
+ deallocate(name)
+ src = 'xyxy'
+ allocate(name, SOURCE=repeat(src,n))
+ if (name(37:40) .ne. 'xyxy') call abort
+ if (len (name) .ne. 40 ) call abort
+end program note7_35
diff --git a/gcc/testsuite/gfortran.dg/allocate_derived_1.f90 b/gcc/testsuite/gfortran.dg/allocate_derived_1.f90
index d2c65ffa38b..648012431ac 100644
--- a/gcc/testsuite/gfortran.dg/allocate_derived_1.f90
+++ b/gcc/testsuite/gfortran.dg/allocate_derived_1.f90
@@ -24,27 +24,28 @@
real :: r
end type
- class(t1),dimension(:),allocatable :: x
+! FIXME: uncomment and dejagnuify the lines below once class arrays are enabled
+! class(t1),dimension(:),allocatable :: x
type(t2),dimension(:),allocatable :: y
- class(t3),dimension(:),allocatable :: z
+! class(t3),dimension(:),allocatable :: z
- allocate( x(1))
- allocate(t1 :: x(2))
- allocate(t2 :: x(3))
- allocate(t3 :: x(4))
- allocate(tx :: x(5)) ! { dg-error "Error in type-spec at" }
- allocate(u0 :: x(6)) ! { dg-error "may not be ABSTRACT" }
- allocate(v1 :: x(7)) ! { dg-error "is type incompatible with typespec" }
+! allocate( x(1))
+! allocate(t1 :: x(2))
+! allocate(t2 :: x(3))
+! allocate(t3 :: x(4))
+! allocate(tx :: x(5)) ! { "Error in type-spec at" }
+! allocate(u0 :: x(6)) ! { "may not be ABSTRACT" }
+! allocate(v1 :: x(7)) ! { "is type incompatible with typespec" }
allocate( y(1))
allocate(t1 :: y(2)) ! { dg-error "is type incompatible with typespec" }
allocate(t2 :: y(3))
allocate(t3 :: y(3)) ! { dg-error "is type incompatible with typespec" }
- allocate( z(1))
- allocate(t1 :: z(2)) ! { dg-error "is type incompatible with typespec" }
- allocate(t2 :: z(3)) ! { dg-error "is type incompatible with typespec" }
- allocate(t3 :: z(4))
+! allocate( z(1))
+! allocate(t1 :: z(2)) ! { "is type incompatible with typespec" }
+! allocate(t2 :: z(3)) ! { "is type incompatible with typespec" }
+! allocate(t3 :: z(4))
end
diff --git a/gcc/testsuite/gfortran.dg/allocate_scalar_with_shape.f90 b/gcc/testsuite/gfortran.dg/allocate_scalar_with_shape.f90
index 1f4f9d52a2e..0fa9ce1fce9 100644
--- a/gcc/testsuite/gfortran.dg/allocate_scalar_with_shape.f90
+++ b/gcc/testsuite/gfortran.dg/allocate_scalar_with_shape.f90
@@ -1,4 +1,4 @@
-! { dg-do "compile" }
+! { dg-do compile }
! PR fortran/41940
integer, allocatable :: a
diff --git a/gcc/testsuite/gfortran.dg/allocate_with_source_1.f90 b/gcc/testsuite/gfortran.dg/allocate_with_source_1.f90
new file mode 100644
index 00000000000..d386bb33b7c
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/allocate_with_source_1.f90
@@ -0,0 +1,29 @@
+! { dg-do run }
+! Test the fix for PR47592, in which the SOURCE expression was
+! being called twice.
+!
+! Contributed by Thomas Koenig <tkoenig@gcc.gnu.org>
+!
+module foo
+ implicit none
+contains
+ function bar()
+ integer bar
+ integer :: i=9
+ i = i + 1
+ bar = i
+ end function bar
+end module foo
+
+program note7_35
+ use foo
+ implicit none
+ character(:), allocatable :: name
+ character(:), allocatable :: src
+ integer n
+ n = 10
+ allocate(name, SOURCE=repeat('x',bar()))
+ if (name .ne. 'xxxxxxxxxx') call abort
+ if (len (name) .ne. 10 ) call abort
+end program note7_35
+! { dg-final { cleanup-modules "foo" } }
diff --git a/gcc/testsuite/gfortran.dg/argument_checking_13.f90 b/gcc/testsuite/gfortran.dg/argument_checking_13.f90
index ae3fd22b443..b94bbc7ec75 100644
--- a/gcc/testsuite/gfortran.dg/argument_checking_13.f90
+++ b/gcc/testsuite/gfortran.dg/argument_checking_13.f90
@@ -26,9 +26,9 @@ real, pointer :: pointer_dummy(:,:,:)
real, allocatable :: deferred(:,:,:)
real, pointer :: ptr(:,:,:)
call rlv1(deferred(1,1,1)) ! valid since contiguous
-call rlv1(ptr(1,1,1)) ! { dg-error "Element of assumed-shaped array" }
-call rlv1(assumed_sh_dummy(1,1,1)) ! { dg-error "Element of assumed-shaped array" }
-call rlv1(pointer_dummy(1,1,1)) ! { dg-error "Element of assumed-shaped array" }
+call rlv1(ptr(1,1,1)) ! { dg-error "Element of assumed-shaped or pointer array" }
+call rlv1(assumed_sh_dummy(1,1,1)) ! { dg-error "Element of assumed-shaped or pointer array" }
+call rlv1(pointer_dummy(1,1,1)) ! { dg-error "Element of assumed-shaped or pointer array" }
end
subroutine test2(assumed_sh_dummy, pointer_dummy)
diff --git a/gcc/testsuite/gfortran.dg/argument_checking_15.f90 b/gcc/testsuite/gfortran.dg/argument_checking_15.f90
index 90046bb9dac..5d3c9f65488 100644
--- a/gcc/testsuite/gfortran.dg/argument_checking_15.f90
+++ b/gcc/testsuite/gfortran.dg/argument_checking_15.f90
@@ -45,8 +45,8 @@ subroutine test()
implicit none
character(len=5), pointer :: c
character(len=5) :: str(5)
-call foo(c) ! { dg-error "Character length mismatch" }
-call bar(str) ! { dg-error "Character length mismatch" }
+call foo(c) ! { dg-warning "Character length mismatch" }
+call bar(str) ! { dg-warning "Character length mismatch" }
contains
subroutine foo(a)
character(len=3), pointer :: a
diff --git a/gcc/testsuite/gfortran.dg/argument_checking_17.f90 b/gcc/testsuite/gfortran.dg/argument_checking_17.f90
new file mode 100644
index 00000000000..df8296ba511
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/argument_checking_17.f90
@@ -0,0 +1,26 @@
+! { dg-do compile }
+!
+! PR fortran/47569
+!
+! Contributed by Jos de Kloe
+!
+module teststr
+ implicit none
+ integer, parameter :: GRH_SIZE = 20, NMAX = 41624
+ type strtype
+ integer :: size
+ character :: mdr(NMAX)
+ end type strtype
+contains
+ subroutine sub2(string,str_size)
+ integer,intent(in) :: str_size
+ character,intent(out) :: string(str_size)
+ string(:) = 'a'
+ end subroutine sub2
+ subroutine sub1(a)
+ type(strtype),intent(inout) :: a
+ call sub2(a%mdr(GRH_SIZE+1),a%size-GRH_SIZE)
+ end subroutine sub1
+end module teststr
+
+! { dg-final { cleanup-modules "teststr" } }
diff --git a/gcc/testsuite/gfortran.dg/argument_checking_18.f90 b/gcc/testsuite/gfortran.dg/argument_checking_18.f90
new file mode 100644
index 00000000000..dd95b6197b0
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/argument_checking_18.f90
@@ -0,0 +1,34 @@
+! { dg-do compile }
+!
+! PR 47349: missing warning: Actual argument contains too few elements
+!
+! Contributed by Janus Weil <janus@gcc.gnu.org>
+
+ implicit none
+ type t
+ integer :: j(3)
+ end type t
+
+ type(t) :: tt
+ integer :: i(3) = (/ 1,2,3 /)
+
+ tt%j = i
+
+ call sub1 (i) ! { dg-warning "Actual argument contains too few elements" }
+ call sub1 (tt%j) ! { dg-warning "Actual argument contains too few elements" }
+ call sub2 (i) ! { dg-error "Rank mismatch in argument" }
+ call sub2 (tt%j) ! { dg-error "Rank mismatch in argument" }
+
+contains
+
+ subroutine sub1(i)
+ integer, dimension(1:3,1:3) :: i
+ print *,"sub1:",i
+ end subroutine
+
+ subroutine sub2(i)
+ integer, dimension(:,:) :: i
+ print *,"sub2:",i
+ end subroutine
+
+end
diff --git a/gcc/testsuite/gfortran.dg/argument_checking_3.f90 b/gcc/testsuite/gfortran.dg/argument_checking_3.f90
index 1e01c1f3326..5f451bf6dc1 100644
--- a/gcc/testsuite/gfortran.dg/argument_checking_3.f90
+++ b/gcc/testsuite/gfortran.dg/argument_checking_3.f90
@@ -22,9 +22,9 @@ end interface
len2 = '12'
len4 = '1234'
- call foo(len2) ! { dg-warning "Rank mismatch in argument" }
- call foo("ca") ! { dg-warning "Rank mismatch in argument" }
- call bar("ca") ! { dg-warning "Rank mismatch in argument" }
+ call foo(len2) ! { dg-error "Rank mismatch in argument" }
+ call foo("ca") ! { dg-error "Rank mismatch in argument" }
+ call bar("ca") ! { dg-error "Rank mismatch in argument" }
call foobar(len2) ! { dg-warning "contains too few elements" }
call foobar(len4)
call foobar("bar") ! { dg-warning "contains too few elements" }
diff --git a/gcc/testsuite/gfortran.dg/argument_checking_6.f90 b/gcc/testsuite/gfortran.dg/argument_checking_6.f90
index 3742ab6e1e9..e2d26923d77 100644
--- a/gcc/testsuite/gfortran.dg/argument_checking_6.f90
+++ b/gcc/testsuite/gfortran.dg/argument_checking_6.f90
@@ -14,7 +14,7 @@ real,dimension(-1:2) :: z
call sub(x(:))
call sub(y(:))
call sub(z(:))
-call sub(w(:)) ! { dg-error "too few elements" }
+call sub(w(:)) ! { dg-warning "too few elements" }
contains
subroutine sub(a)
diff --git a/gcc/testsuite/gfortran.dg/array_constructor_33.f90 b/gcc/testsuite/gfortran.dg/array_constructor_33.f90
index 7a7c6fa2e2f..79118af3f7b 100644
--- a/gcc/testsuite/gfortran.dg/array_constructor_33.f90
+++ b/gcc/testsuite/gfortran.dg/array_constructor_33.f90
@@ -1,4 +1,5 @@
! { dg-do compile }
+! { dg-timeout-factor 4 }
! PR20923 gfortran slow for large array constructors.
! Test case prepared from PR by Jerry DeLisle <jvdelisle@gcc.gnu.org>
program sel
diff --git a/gcc/testsuite/gfortran.dg/array_constructor_36.f90 b/gcc/testsuite/gfortran.dg/array_constructor_36.f90
new file mode 100644
index 00000000000..a74d256d95e
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/array_constructor_36.f90
@@ -0,0 +1,21 @@
+! { dg-do run }
+! Test the fix for PR47348, in which the substring length
+! in the array constructor at line 19 would be missed and
+! the length of q used instead.
+!
+! Contributed by Thomas Koenig <tkoenig@netcologne.de>
+!
+program main
+ implicit none
+ character(len = *), parameter :: fmt='(2(A,"|"))'
+ character(len = *), parameter :: test='xyc|aec|'
+ integer :: i
+ character(len = 4) :: q
+ character(len = 8) :: buffer
+ q = 'xy'
+ i = 2
+ write (buffer, fmt) (/ trim(q), 'ae' /)//'c'
+ if (buffer .ne. test) Call abort
+ write (buffer, FMT) (/ q(1:i), 'ae' /)//'c'
+ if (buffer .ne. test) Call abort
+end program main
diff --git a/gcc/testsuite/gfortran.dg/array_function_5.f90 b/gcc/testsuite/gfortran.dg/array_function_5.f90
index 05f3c92d02b..9c95f800517 100644
--- a/gcc/testsuite/gfortran.dg/array_function_5.f90
+++ b/gcc/testsuite/gfortran.dg/array_function_5.f90
@@ -1,4 +1,4 @@
-! { dg-do run )
+! { dg-do run }
! PR41278 internal compiler error related to matmul and transpose
! Test case prepared by Jerry DeLisle <jvdelisle@gcc.gnu.org>
! Original test case by Chris <cmklaij@hetnet.nl>
diff --git a/gcc/testsuite/gfortran.dg/asynchronous_3.f03 b/gcc/testsuite/gfortran.dg/asynchronous_3.f03
index 7b83374a6e5..dfc5e6ea904 100644
--- a/gcc/testsuite/gfortran.dg/asynchronous_3.f03
+++ b/gcc/testsuite/gfortran.dg/asynchronous_3.f03
@@ -1,4 +1,4 @@
-! { dg-do "compile" }
+! { dg-do compile }
!
! PR fortran/44457 - no array-subscript actual argument
! for an asynchronous dummy
diff --git a/gcc/testsuite/gfortran.dg/auto_dealloc_2.f90 b/gcc/testsuite/gfortran.dg/auto_dealloc_2.f90
new file mode 100644
index 00000000000..4cbda828895
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/auto_dealloc_2.f90
@@ -0,0 +1,29 @@
+! { dg-do compile }
+! { dg-options "-fdump-tree-original" }
+!
+! PR 47637: [OOP] Memory leak involving INTENT(OUT) CLASS argument w/ allocatable components
+!
+! Contributed by Rich Townsend <townsend@astro.wisc.edu>
+
+program test
+
+type :: t
+ integer, allocatable :: i(:)
+end type
+
+type(t) :: a
+
+call init(a)
+call init(a)
+
+contains
+
+ subroutine init(x)
+ class(t), intent(out) :: x
+ allocate(x%i(1000))
+ end subroutine
+
+end program
+
+! { dg-final { scan-tree-dump-times "__builtin_free" 2 "original" } }
+! { dg-final { cleanup-tree-dump "original" } }
diff --git a/gcc/testsuite/gfortran.dg/bessel_6.f90 b/gcc/testsuite/gfortran.dg/bessel_6.f90
index 857d557fe30..e760d4cdb74 100644
--- a/gcc/testsuite/gfortran.dg/bessel_6.f90
+++ b/gcc/testsuite/gfortran.dg/bessel_6.f90
@@ -1,8 +1,11 @@
-! { dg-do run }
+! { dg-do run { xfail spu-*-* } }
!
! PR fortran/36158
! PR fortran/33197
!
+! XFAILed for SPU targets since we don't have an accurate library
+! implementation of the single-precision Bessel functions.
+!
! Run-time tests for transformations BESSEL_JN
!
implicit none
diff --git a/gcc/testsuite/gfortran.dg/bessel_7.f90 b/gcc/testsuite/gfortran.dg/bessel_7.f90
index 8c4f0d915a3..10a6e966dfa 100644
--- a/gcc/testsuite/gfortran.dg/bessel_7.f90
+++ b/gcc/testsuite/gfortran.dg/bessel_7.f90
@@ -1,4 +1,4 @@
-! { dg-do run { xfail *-*-mingw* } }
+! { dg-do run { xfail *-*-mingw* spu-*-* } }
!
! PR fortran/36158
! PR fortran/33197
@@ -7,6 +7,9 @@
! of BESSEL_YN(n,x) has different results. It returns NAN rather than
! -INF for "x=0.0" and all "n".
!
+! XFAILed for SPU targets since we don't have an accurate library
+! implementation of the single-precision Bessel functions.
+!
! Run-time tests for transformations BESSEL_YN
!
implicit none
diff --git a/gcc/testsuite/gfortran.dg/bounds_check_10.f90 b/gcc/testsuite/gfortran.dg/bounds_check_10.f90
index 3aba1cb6ab6..66bc308f060 100644
--- a/gcc/testsuite/gfortran.dg/bounds_check_10.f90
+++ b/gcc/testsuite/gfortran.dg/bounds_check_10.f90
@@ -12,4 +12,4 @@ z = [y(1:1), y(1:1), x(1:len(trim(x)))] ! should work
z = [trim(x), trim(y), "aaaa"] ! [ "a", "cd", "aaaa" ] should catch first error
end program array_char
-! { dg-output "Different CHARACTER lengths .1/2. in array constructor" }
+! { dg-output "Different CHARACTER lengths .1/.. in array constructor" }
diff --git a/gcc/testsuite/gfortran.dg/bounds_temporaries_1.f90 b/gcc/testsuite/gfortran.dg/bounds_temporaries_1.f90
index 32bb265c130..44b5a7dbaff 100644
--- a/gcc/testsuite/gfortran.dg/bounds_temporaries_1.f90
+++ b/gcc/testsuite/gfortran.dg/bounds_temporaries_1.f90
@@ -22,7 +22,7 @@ end subroutine gfcbug34
! This is PR25669
subroutine foo (a)
real a(*)
- call bar (a, LBOUND(a),2) ! { dg-warning "Rank mismatch in argument" }
+ call bar (a, LBOUND(a),2) ! { dg-error "Rank mismatch in argument" }
end subroutine foo
subroutine bar (b, i, j)
real b(i:j)
diff --git a/gcc/testsuite/gfortran.dg/c_loc_tests_16.f90 b/gcc/testsuite/gfortran.dg/c_loc_tests_16.f90
new file mode 100644
index 00000000000..1c86a1f9c40
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/c_loc_tests_16.f90
@@ -0,0 +1,25 @@
+! { dg-do compile }
+! { dg-options "-fcoarray=single" }
+! PR 38536 - array sections as arguments to c_loc are illegal.
+ use iso_c_binding
+ type, bind(c) :: t1
+ integer(c_int) :: i(5)
+ end type t1
+ type, bind(c):: t2
+ type(t1) :: t(5)
+ end type t2
+ type, bind(c) :: t3
+ type(t1) :: t(5,5)
+ end type t3
+
+ type(t2), target :: tt
+ type(t3), target :: ttt
+ integer(c_int), target :: n(3)
+ integer(c_int), target :: x[*]
+ type(C_PTR) :: p
+
+ p = c_loc(tt%t%i(1)) ! { dg-error "Array section not permitted" }
+ p = c_loc(n(1:2)) ! { dg-warning "Array section" }
+ p = c_loc(ttt%t(5,1:2)%i(1)) ! { dg-error "Array section not permitted" }
+ p = c_loc(x[1]) ! { dg-error "Coindexed argument not permitted" }
+ end
diff --git a/gcc/testsuite/gfortran.dg/char4_iunit_1.f03 b/gcc/testsuite/gfortran.dg/char4_iunit_1.f03
index 57b3f78702f..5b1b285adf2 100644
--- a/gcc/testsuite/gfortran.dg/char4_iunit_1.f03
+++ b/gcc/testsuite/gfortran.dg/char4_iunit_1.f03
@@ -26,9 +26,9 @@ program char4_iunit_1
write(string, *) 1.2345e-06, 4.2846e+10_8
if (string .ne. 4_" 1.23450002E-06 42846000000.000000 ") call abort
write(string, *) nan, inf
- if (string .ne. 4_" NaN +Infinity ") call abort
+ if (string .ne. 4_" NaN Infinity ") call abort
write(string, '(10x,f3.1,3x,f9.1)') nan, inf
- if (string .ne. 4_" NaN +Infinity ") call abort
+ if (string .ne. 4_" NaN Infinity ") call abort
write(string, *) (1.2, 3.4 )
if (string .ne. 4_" ( 1.2000000 , 3.4000001 ) ") call abort
end program char4_iunit_1
diff --git a/gcc/testsuite/gfortran.dg/char_expr_1.f90 b/gcc/testsuite/gfortran.dg/char_expr_1.f90
index ba0e1f23350..35bfe347702 100644
--- a/gcc/testsuite/gfortran.dg/char_expr_1.f90
+++ b/gcc/testsuite/gfortran.dg/char_expr_1.f90
@@ -1,4 +1,4 @@
-! { dg-do "run" }
+! { dg-do run }
! PR fortran/36795
! "(str)" (= an expression) was regarded as "str" (= a variable)
! and thus when yy was deallocated so was xx. Result: An invalid
diff --git a/gcc/testsuite/gfortran.dg/class_14.f03 b/gcc/testsuite/gfortran.dg/class_14.f03
index 9b06b01f1ff..4e6db17c960 100644
--- a/gcc/testsuite/gfortran.dg/class_14.f03
+++ b/gcc/testsuite/gfortran.dg/class_14.f03
@@ -1,4 +1,4 @@
-! { dg-do "compile" }
+! { dg-do compile }
! Test the final fix for PR42353, in which a compilation error was
! occurring because the derived type of the initializer of the vtab
! component '$extends' was not the same as that of the component.
diff --git a/gcc/testsuite/gfortran.dg/class_30.f90 b/gcc/testsuite/gfortran.dg/class_30.f90
index f81e6140a43..f2cedcb9763 100644
--- a/gcc/testsuite/gfortran.dg/class_30.f90
+++ b/gcc/testsuite/gfortran.dg/class_30.f90
@@ -14,6 +14,8 @@ type t2
end type t2
type, bind(C):: t3
- class(t), pointer :: y ! { dg-error "may not be C interoperable|Polymorphic component y at .1. in SEQUENCE or BIND" }
+ class(t), pointer :: y
+ ! { dg-warning "may not be C interoperable" "" { target *-*-* } 17 }
+ ! { dg-error "Polymorphic component y at .1. in SEQUENCE or BIND" "" { target *-*-* } 17 }
end type t3
end
diff --git a/gcc/testsuite/gfortran.dg/class_36.f03 b/gcc/testsuite/gfortran.dg/class_36.f03
new file mode 100644
index 00000000000..6911f3f04b6
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/class_36.f03
@@ -0,0 +1,14 @@
+! { dg-do compile }
+!
+! PR 47572: [OOP] Invalid: Allocatable polymorphic with init expression.
+!
+! Contributed by Edmondo Giovannozzi <edmondo.giovannozzi@gmail.com>
+! cf. http://groups.google.com/group/comp.lang.fortran/browse_thread/thread/763785b16883ed68
+
+program scalar_allocation
+ type test
+ real :: a
+ end type
+ class (test), allocatable :: b = test(3.4) ! { dg-error "cannot have an initializer" }
+ print *,allocated(b)
+end program
diff --git a/gcc/testsuite/gfortran.dg/class_37.f03 b/gcc/testsuite/gfortran.dg/class_37.f03
new file mode 100644
index 00000000000..f951ea1f8e0
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/class_37.f03
@@ -0,0 +1,263 @@
+! { dg-do compile }
+! Test fix for PR47082, in which an ICE in the ALLOCATE at line 248.
+!
+! Contributed by Salvatore Filippone <salvatore.filippone@uniroma2.it>
+!
+module psb_penv_mod
+
+ interface psb_init
+ module procedure psb_init
+ end interface
+
+ interface psb_exit
+ module procedure psb_exit
+ end interface
+
+ interface psb_info
+ module procedure psb_info
+ end interface
+
+ integer, private, save :: nctxt=0
+
+
+
+contains
+
+
+ subroutine psb_init(ictxt,np,basectxt,ids)
+ implicit none
+ integer, intent(out) :: ictxt
+ integer, intent(in), optional :: np, basectxt, ids(:)
+
+
+ ictxt = nctxt
+ nctxt = nctxt + 1
+
+ end subroutine psb_init
+
+ subroutine psb_exit(ictxt,close)
+ implicit none
+ integer, intent(inout) :: ictxt
+ logical, intent(in), optional :: close
+
+ nctxt = max(0, nctxt - 1)
+
+ end subroutine psb_exit
+
+
+ subroutine psb_info(ictxt,iam,np)
+
+ implicit none
+
+ integer, intent(in) :: ictxt
+ integer, intent(out) :: iam, np
+
+ iam = 0
+ np = 1
+
+ end subroutine psb_info
+
+
+end module psb_penv_mod
+
+
+module psb_indx_map_mod
+
+ type :: psb_indx_map
+
+ integer :: state = -1
+ integer :: ictxt = -1
+ integer :: mpic = -1
+ integer :: global_rows = -1
+ integer :: global_cols = -1
+ integer :: local_rows = -1
+ integer :: local_cols = -1
+
+
+ end type psb_indx_map
+
+end module psb_indx_map_mod
+
+
+
+module psb_gen_block_map_mod
+ use psb_indx_map_mod
+
+ type, extends(psb_indx_map) :: psb_gen_block_map
+ integer :: min_glob_row = -1
+ integer :: max_glob_row = -1
+ integer, allocatable :: loc_to_glob(:), srt_l2g(:,:), vnl(:)
+ contains
+
+ procedure, pass(idxmap) :: gen_block_map_init => block_init
+
+ end type psb_gen_block_map
+
+ private :: block_init
+
+contains
+
+ subroutine block_init(idxmap,ictxt,nl,info)
+ use psb_penv_mod
+ implicit none
+ class(psb_gen_block_map), intent(inout) :: idxmap
+ integer, intent(in) :: ictxt, nl
+ integer, intent(out) :: info
+ ! To be implemented
+ integer :: iam, np, i, j, ntot
+ integer, allocatable :: vnl(:)
+
+ info = 0
+ call psb_info(ictxt,iam,np)
+ if (np < 0) then
+ info = -1
+ return
+ end if
+
+ allocate(vnl(0:np),stat=info)
+ if (info /= 0) then
+ info = -2
+ return
+ end if
+
+ vnl(:) = 0
+ vnl(iam) = nl
+ ntot = sum(vnl)
+ vnl(1:np) = vnl(0:np-1)
+ vnl(0) = 0
+ do i=1,np
+ vnl(i) = vnl(i) + vnl(i-1)
+ end do
+ if (ntot /= vnl(np)) then
+! !$ write(0,*) ' Mismatch in block_init ',ntot,vnl(np)
+ end if
+
+ idxmap%global_rows = ntot
+ idxmap%global_cols = ntot
+ idxmap%local_rows = nl
+ idxmap%local_cols = nl
+ idxmap%ictxt = ictxt
+ idxmap%state = 1
+
+ idxmap%min_glob_row = vnl(iam)+1
+ idxmap%max_glob_row = vnl(iam+1)
+ call move_alloc(vnl,idxmap%vnl)
+ allocate(idxmap%loc_to_glob(nl),stat=info)
+ if (info /= 0) then
+ info = -2
+ return
+ end if
+
+ end subroutine block_init
+
+end module psb_gen_block_map_mod
+
+
+module psb_descriptor_type
+ use psb_indx_map_mod
+
+ implicit none
+
+
+ type psb_desc_type
+ integer, allocatable :: matrix_data(:)
+ integer, allocatable :: halo_index(:)
+ integer, allocatable :: ext_index(:)
+ integer, allocatable :: ovrlap_index(:)
+ integer, allocatable :: ovrlap_elem(:,:)
+ integer, allocatable :: ovr_mst_idx(:)
+ integer, allocatable :: bnd_elem(:)
+ class(psb_indx_map), allocatable :: indxmap
+ integer, allocatable :: lprm(:)
+ type(psb_desc_type), pointer :: base_desc => null()
+ integer, allocatable :: idx_space(:)
+ end type psb_desc_type
+
+
+end module psb_descriptor_type
+
+module psb_cd_if_tools_mod
+
+ use psb_descriptor_type
+ use psb_gen_block_map_mod
+
+ interface psb_cdcpy
+ subroutine psb_cdcpy(desc_in, desc_out, info)
+ use psb_descriptor_type
+
+ implicit none
+ !....parameters...
+
+ type(psb_desc_type), intent(in) :: desc_in
+ type(psb_desc_type), intent(out) :: desc_out
+ integer, intent(out) :: info
+ end subroutine psb_cdcpy
+ end interface
+
+
+end module psb_cd_if_tools_mod
+
+module psb_cd_tools_mod
+
+ use psb_cd_if_tools_mod
+
+ interface psb_cdall
+
+ subroutine psb_cdall(ictxt, desc, info,mg,ng,vg,vl,flag,nl,repl, globalcheck)
+ use psb_descriptor_type
+ implicit None
+ Integer, intent(in) :: mg,ng,ictxt, vg(:), vl(:),nl
+ integer, intent(in) :: flag
+ logical, intent(in) :: repl, globalcheck
+ integer, intent(out) :: info
+ type(psb_desc_type), intent(out) :: desc
+
+ optional :: mg,ng,vg,vl,flag,nl,repl, globalcheck
+ end subroutine psb_cdall
+
+ end interface
+
+end module psb_cd_tools_mod
+module psb_base_tools_mod
+ use psb_cd_tools_mod
+end module psb_base_tools_mod
+
+subroutine psb_cdall(ictxt, desc, info,mg,ng,vg,vl,flag,nl,repl, globalcheck)
+ use psb_descriptor_type
+ use psb_gen_block_map_mod
+ use psb_base_tools_mod, psb_protect_name => psb_cdall
+ implicit None
+ Integer, intent(in) :: mg,ng,ictxt, vg(:), vl(:),nl
+ integer, intent(in) :: flag
+ logical, intent(in) :: repl, globalcheck
+ integer, intent(out) :: info
+ type(psb_desc_type), intent(out) :: desc
+
+ optional :: mg,ng,vg,vl,flag,nl,repl, globalcheck
+ integer :: err_act, n_, flag_, i, me, np, nlp, nnv, lr
+ integer, allocatable :: itmpsz(:)
+
+
+
+ info = 0
+ desc%base_desc => null()
+ if (allocated(desc%indxmap)) then
+ write(0,*) 'Allocated on an intent(OUT) var?'
+ end if
+
+ allocate(psb_gen_block_map :: desc%indxmap, stat=info)
+ if (info == 0) then
+ select type(aa => desc%indxmap)
+ type is (psb_gen_block_map)
+ call aa%gen_block_map_init(ictxt,nl,info)
+ class default
+ ! This cannot happen
+ info = -1
+ end select
+ end if
+
+ return
+
+end subroutine psb_cdall
+
+
diff --git a/gcc/testsuite/gfortran.dg/class_38.f03 b/gcc/testsuite/gfortran.dg/class_38.f03
new file mode 100644
index 00000000000..2793627924e
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/class_38.f03
@@ -0,0 +1,22 @@
+! { dg-do compile }
+!
+! PR 47728: [OOP] ICE on invalid CLASS declaration
+!
+! Contributed by Arjen Markus <arjen.markus@deltares.nl>
+
+program test_objects
+
+ implicit none
+
+ type, abstract :: shape
+ end type
+
+ type, extends(shape) :: rectangle
+ real :: width, height
+ end type
+
+ class(shape), dimension(2) :: object ! { dg-error "must be dummy, allocatable or pointer" }
+
+ object(1) = rectangle( 1.0, 2.0 ) ! { dg-error "Unclassifiable statement" }
+
+end program test_objects
diff --git a/gcc/testsuite/gfortran.dg/class_39.f03 b/gcc/testsuite/gfortran.dg/class_39.f03
new file mode 100644
index 00000000000..bc8039fc0c5
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/class_39.f03
@@ -0,0 +1,13 @@
+! { dg-do compile }
+!
+! PR 47745: [OOP] Segfault with CLASS(*) and derived type dummy arguments
+!
+! Contributed by Rodney Polkinghorne <thisrod@gmail.com>
+
+ type, abstract :: T
+ end type T
+contains
+ class(T) function add() ! { dg-error "must be dummy, allocatable or pointer" }
+ add = 1 ! { dg-error "Variable must not be polymorphic in assignment" }
+ end function
+end
diff --git a/gcc/testsuite/gfortran.dg/class_40.f03 b/gcc/testsuite/gfortran.dg/class_40.f03
new file mode 100644
index 00000000000..bd367dfe5b5
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/class_40.f03
@@ -0,0 +1,36 @@
+! { dg-do run }
+!
+! PR 47767: [OOP] SELECT TYPE fails to execute correct TYPE IS block
+!
+! Contributed by Andrew Benson <abenson@caltech.edu>
+
+module Tree_Nodes
+ type treeNode
+ contains
+ procedure :: walk
+ end type
+contains
+ subroutine walk (thisNode)
+ class (treeNode) :: thisNode
+ print *, SAME_TYPE_AS (thisNode, treeNode())
+ end subroutine
+end module
+
+module Merger_Trees
+ use Tree_Nodes
+ private
+ type(treeNode), public :: baseNode
+end module
+
+module Merger_Tree_Build
+ use Merger_Trees
+end module
+
+program test
+ use Merger_Tree_Build
+ use Tree_Nodes
+ type(treeNode) :: node
+ call walk (node)
+end program
+
+! { dg-final { cleanup-modules "Tree_Nodes Merger_Trees Merger_Tree_Build" } }
diff --git a/gcc/testsuite/gfortran.dg/class_7.f03 b/gcc/testsuite/gfortran.dg/class_7.f03
index 99fbf6fc69b..d7f1c835ef4 100644
--- a/gcc/testsuite/gfortran.dg/class_7.f03
+++ b/gcc/testsuite/gfortran.dg/class_7.f03
@@ -9,7 +9,8 @@
end type t0
type t
integer :: i
- class(t0), allocatable :: foo(3) ! { dg-error "deferred shape" }
+! FIXME: uncomment and dejagnuify once class arrays are enabled
+! class(t0), allocatable :: foo(3) ! { "deferred shape" }
end type t
! PR41608: Would ICE on missing type decl
diff --git a/gcc/testsuite/gfortran.dg/coarray_14.f90 b/gcc/testsuite/gfortran.dg/coarray_14.f90
index 9230ad4f32b..3e3f0462b30 100644
--- a/gcc/testsuite/gfortran.dg/coarray_14.f90
+++ b/gcc/testsuite/gfortran.dg/coarray_14.f90
@@ -47,7 +47,7 @@ end subroutine test
program myTest
type t
end type t
-class(t), allocatable :: a[:]
+type(t), allocatable :: a[:]
allocate (t :: a) ! { dg-error "Coarray specification required in ALLOCATE statement" }
allocate (t :: a[*]) ! { dg-error "allocatable scalar coarrays are not yet supported" }
end program myTest
diff --git a/gcc/testsuite/gfortran.dg/complex_intrinsic_5.f90 b/gcc/testsuite/gfortran.dg/complex_intrinsic_5.f90
index 15706b9b397..49b8eaaa68e 100644
--- a/gcc/testsuite/gfortran.dg/complex_intrinsic_5.f90
+++ b/gcc/testsuite/gfortran.dg/complex_intrinsic_5.f90
@@ -9,7 +9,7 @@
!
module test
implicit none
- real(4), parameter :: eps4 = epsilon(0.0_4)*2.0_4
+ real(4), parameter :: eps4 = epsilon(0.0_4)*4.0_4
real(8), parameter :: eps8 = epsilon(0.0_8)*2.0_8
interface check
procedure check4, check8
diff --git a/gcc/testsuite/gfortran.dg/continuation_1.f90 b/gcc/testsuite/gfortran.dg/continuation_1.f90
index 64a98ade9aa..1036db9cb1e 100644
--- a/gcc/testsuite/gfortran.dg/continuation_1.f90
+++ b/gcc/testsuite/gfortran.dg/continuation_1.f90
@@ -8,7 +8,7 @@ program main
character (len=40) &
c
c = "Hello, &
- world!" ! { dg-warning "Warning: Missing '&' in continued character constant" }
+ world!" ! { dg-warning "Missing '&' in continued character constant" }
if (c.ne.&
"Hello, world!")&
call abort();end program main
diff --git a/gcc/testsuite/gfortran.dg/continuation_9.f90 b/gcc/testsuite/gfortran.dg/continuation_9.f90
index 7cd9c9d42df..04a7c331e2e 100644
--- a/gcc/testsuite/gfortran.dg/continuation_9.f90
+++ b/gcc/testsuite/gfortran.dg/continuation_9.f90
@@ -4,6 +4,6 @@
&
&
end
-! { dg-error "not allowed by itself in line 3" "" {target "*-*-*"} 0 }
-! { dg-error "not allowed by itself in line 4" "" {target "*-*-*"} 0 }
-! { dg-error "not allowed by itself in line 5" "" {target "*-*-*"} 0 }
+! { dg-warning "not allowed by itself in line 3" "" {target "*-*-*"} 0 }
+! { dg-warning "not allowed by itself in line 4" "" {target "*-*-*"} 0 }
+! { dg-warning "not allowed by itself in line 5" "" {target "*-*-*"} 0 }
diff --git a/gcc/testsuite/gfortran.dg/count_init_expr.f03 b/gcc/testsuite/gfortran.dg/count_init_expr.f03
index 73a8efa9565..ad7b74b96a9 100644
--- a/gcc/testsuite/gfortran.dg/count_init_expr.f03
+++ b/gcc/testsuite/gfortran.dg/count_init_expr.f03
@@ -1,4 +1,4 @@
-! { dg-do "run" }
+! { dg-do run }
INTEGER :: i
INTEGER, PARAMETER :: m(4,4) = RESHAPE([ (i, i=1, 16) ], [4, 4] )
diff --git a/gcc/testsuite/gfortran.dg/cray_pointers_2.f90 b/gcc/testsuite/gfortran.dg/cray_pointers_2.f90
index bbbfda27a0e..82ce2915982 100644
--- a/gcc/testsuite/gfortran.dg/cray_pointers_2.f90
+++ b/gcc/testsuite/gfortran.dg/cray_pointers_2.f90
@@ -1,5 +1,7 @@
-! { dg-do run }
-! { dg-options "-fcray-pointer -fbounds-check -fno-inline" }
+! Using two spaces between dg-do and run is a hack to keep gfortran-dg-runtest
+! from cycling through optimization options for this expensive test.
+! { dg-do run }
+! { dg-options "-O3 -fcray-pointer -fbounds-check -fno-inline" }
! { dg-timeout-factor 4 }
!
! Series of routines for testing a Cray pointer implementation
diff --git a/gcc/testsuite/gfortran.dg/data_array_6.f b/gcc/testsuite/gfortran.dg/data_array_6.f
index 6564402f1e9..64b492bc2da 100644
--- a/gcc/testsuite/gfortran.dg/data_array_6.f
+++ b/gcc/testsuite/gfortran.dg/data_array_6.f
@@ -1,4 +1,4 @@
-! { dg-do "compile" }
+! { dg-do compile }
!
! PR fortran/38404 - location marker in wrong line
! Testcase contributed by Steve Chapel <steve DOT chapel AT a2pg DOT com>
diff --git a/gcc/testsuite/gfortran.dg/data_invalid.f90 b/gcc/testsuite/gfortran.dg/data_invalid.f90
index 10ea7e57c08..960a8f3d3ec 100644
--- a/gcc/testsuite/gfortran.dg/data_invalid.f90
+++ b/gcc/testsuite/gfortran.dg/data_invalid.f90
@@ -1,4 +1,4 @@
-! { dg-do "compile" }
+! { dg-do compile }
! { dg-options "-std=f95 -fmax-errors=0" }
!
! Testcases from PR fortran/24978
diff --git a/gcc/testsuite/gfortran.dg/deferred_type_param_2.f90 b/gcc/testsuite/gfortran.dg/deferred_type_param_2.f90
index 7bfd2a6ece0..8ac48c3f153 100644
--- a/gcc/testsuite/gfortran.dg/deferred_type_param_2.f90
+++ b/gcc/testsuite/gfortran.dg/deferred_type_param_2.f90
@@ -34,9 +34,9 @@ subroutine three()
str1 = ["abc"]
pstr2 => str1
- allocate (character(len=77) :: str1(1)) ! OK ! { dg-error "not yet implemented" }
- allocate (pstr, source=str2) ! OK ! { dg-error "not yet implemented" }
- allocate (pstr, mold=str2) ! { dg-error "requires either a type-spec or SOURCE tag" }
+ allocate (character(len=77) :: str1(1))
+ allocate (pstr, source=str2)
+ allocate (pstr, mold=str2)
allocate (pstr) ! { dg-error "requires either a type-spec or SOURCE tag" }
allocate (character(len=:) :: str1(1)) ! { dg-error "cannot contain a deferred type parameter" }
diff --git a/gcc/testsuite/gfortran.dg/derived_constructor_comps_4.f90 b/gcc/testsuite/gfortran.dg/derived_constructor_comps_4.f90
new file mode 100644
index 00000000000..e70551838ae
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/derived_constructor_comps_4.f90
@@ -0,0 +1,18 @@
+! { dg-do run }
+!
+! PR 47789: [F03] Structure constructor of type extending DT with no components
+!
+! Contributed by eddyg_61-bugzilla@yahoo.it
+
+type:: one
+end type
+
+type, extends(one) :: two
+ integer :: a
+end type
+
+type(two) :: wo = two(6)
+
+if (wo%a /= 6) call abort()
+
+end
diff --git a/gcc/testsuite/gfortran.dg/do_check_5.f90 b/gcc/testsuite/gfortran.dg/do_check_5.f90
index 081a228cfc7..3df7b14f0eb 100644
--- a/gcc/testsuite/gfortran.dg/do_check_5.f90
+++ b/gcc/testsuite/gfortran.dg/do_check_5.f90
@@ -27,6 +27,8 @@ end do
do r = 1, 2, -1 ! { dg-warning "must be integer|executed zero times" }
end do
-do r = 1, 2, 0 ! { dg-error "must be integer|cannot be zero" }
+do r = 1, 2, 0
end do
+! { dg-warning "must be integer" "loop var" { target *-*-* } 30 }
+! { dg-error "cannot be zero" "loop step" { target *-*-* } 30 }
end
diff --git a/gcc/testsuite/gfortran.dg/dot_product_1.f03 b/gcc/testsuite/gfortran.dg/dot_product_1.f03
index 5ba663348b1..45d658526d5 100644
--- a/gcc/testsuite/gfortran.dg/dot_product_1.f03
+++ b/gcc/testsuite/gfortran.dg/dot_product_1.f03
@@ -1,4 +1,4 @@
-! { dg-do "run" }
+! { dg-do run }
! Transformational intrinsic DOT_PRODUCT as initialization expression.
INTEGER, PARAMETER :: n = 10
diff --git a/gcc/testsuite/gfortran.dg/entry_17.f90 b/gcc/testsuite/gfortran.dg/entry_17.f90
index b4e91c2a8ee..5671cfe5029 100644
--- a/gcc/testsuite/gfortran.dg/entry_17.f90
+++ b/gcc/testsuite/gfortran.dg/entry_17.f90
@@ -26,7 +26,7 @@ entry bar3()
bar3 = ""
end function test3
-function test4(n) ! { dg-error "returning variables of different string lengths" }
+function test4(n) ! { dg-warning "returning variables of different string lengths" }
integer :: n
character(n) :: test4
character(*) :: bar4 ! { dg-warning "Obsolescent feature" }
@@ -36,7 +36,7 @@ entry bar4()
bar4 = ""
end function test4
-function test5() ! { dg-error "returning variables of different string lengths" }
+function test5() ! { dg-warning "returning variables of different string lengths" }
character(1) :: test5
character(2) :: bar5
test5 = ""
diff --git a/gcc/testsuite/gfortran.dg/entry_19.f90 b/gcc/testsuite/gfortran.dg/entry_19.f90
index b7b8bfa2f2e..87b52ad67c1 100644
--- a/gcc/testsuite/gfortran.dg/entry_19.f90
+++ b/gcc/testsuite/gfortran.dg/entry_19.f90
@@ -5,5 +5,5 @@
! Entry is obsolete in Fortran 2008
!
subroutine foo()
-entry bar() ! { dg-error "Fortran 2008 obsolescent feature: ENTRY" }
+entry bar() ! { dg-warning "Fortran 2008 obsolescent feature: ENTRY" }
end
diff --git a/gcc/testsuite/gfortran.dg/erf_2.F90 b/gcc/testsuite/gfortran.dg/erf_2.F90
index 087dfd38e19..c92f45b0476 100644
--- a/gcc/testsuite/gfortran.dg/erf_2.F90
+++ b/gcc/testsuite/gfortran.dg/erf_2.F90
@@ -1,7 +1,10 @@
-! { dg-do run }
-! { dg-options "-fno-range-check -ffree-line-length-none " }
+! { dg-do run { xfail spu-*-* } }
+! { dg-options "-fno-range-check -ffree-line-length-none -O0" }
! { dg-add-options ieee }
!
+! XFAILed for SPU targets because our library implementation of
+! the double-precision erf/erfc functions is not accurate enough.
+!
! Check that simplification functions and runtime library agree on ERF,
! ERFC and ERFC_SCALED.
diff --git a/gcc/testsuite/gfortran.dg/extends_11.f03 b/gcc/testsuite/gfortran.dg/extends_11.f03
new file mode 100644
index 00000000000..58bde73acb1
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/extends_11.f03
@@ -0,0 +1,41 @@
+! { dg-do compile }
+! { dg-options "-fdump-tree-original" }
+!
+! PR fortran/45586
+! Test that access to inherited components are properly generated
+!
+! Stripped down from extends_1.f03
+!
+ type :: person
+ integer :: ss = 1
+ end type person
+
+ type, extends(person) :: education
+ integer :: attainment = 0
+ end type education
+
+ type, extends(education) :: service
+ integer :: personnel_number = 0
+ end type service
+
+ type, extends(service) :: person_record
+ type (person_record), pointer :: supervisor => NULL ()
+ end type person_record
+
+ type(person_record) :: recruit
+
+
+ ! Check that references by ultimate component and by parent type work
+ ! All the following component access are equivalent
+ recruit%ss = 2
+ recruit%person%ss = 3
+ recruit%education%ss = 4
+ recruit%education%person%ss = 5
+ recruit%service%ss = 6
+ recruit%service%person%ss = 7
+ recruit%service%education%ss = 8
+ recruit%service%education%person%ss = 9
+end
+
+! { dg-final { scan-tree-dump-times " +recruit\\.service\\.education\\.person\\.ss =" 8 "original"} }
+! { dg-final { cleanup-tree-dump "original" } }
diff --git a/gcc/testsuite/gfortran.dg/fmt_error.f90 b/gcc/testsuite/gfortran.dg/fmt_error.f90
index 45d58553539..7dc2ab6a537 100644
--- a/gcc/testsuite/gfortran.dg/fmt_error.f90
+++ b/gcc/testsuite/gfortran.dg/fmt_error.f90
@@ -1,4 +1,4 @@
! { dg-do compile }
! PR32545 Give compile error not warning for wrong edit format statements.
-read (5,'(i0)') i ! { dg-error "Error: Positive width required in format" }
+read (5,'(i0)') i ! { dg-error "Positive width required in format" }
end
diff --git a/gcc/testsuite/gfortran.dg/fmt_f0_1.f90 b/gcc/testsuite/gfortran.dg/fmt_f0_1.f90
index 166846b87fe..dd66f6557e9 100644
--- a/gcc/testsuite/gfortran.dg/fmt_f0_1.f90
+++ b/gcc/testsuite/gfortran.dg/fmt_f0_1.f90
@@ -1,5 +1,6 @@
-! { dg-do run )
+! { dg-do run }
! PR39304 write of 0.0 with F0.3 gives **
+! PR47567 Small absolute values.
! Test case developed from case provided by reporter.
REAL :: x
CHARACTER(80) :: str
@@ -7,11 +8,57 @@
write (str,'(f0.0)') x
if (str.ne."0.") call abort
write (str,'(f0.1)') x
- if (str.ne."0.0") call abort
+ if (str.ne.".0") call abort
write (str,'(f0.2)') x
- if (str.ne."0.00") call abort
+ if (str.ne.".00") call abort
write (str,'(f0.3)') x
- if (str.ne."0.000") call abort
+ if (str.ne.".000") call abort
write (str,'(f0.4)') x
- if (str.ne."0.0000") call abort
+ if (str.ne.".0000") call abort
+ write (str,'(F0.0)') 0.0
+ if (str.ne."0.") call abort
+ write (str,'(F0.0)') 0.001
+ if (str.ne."0.") call abort
+ write (str,'(F0.0)') 0.01
+ if (str.ne."0.") call abort
+ write (str,'(F0.0)') 0.1
+ if (str.ne."0.") call abort
+ write (str,'(F1.0)') -0.0
+ if (str.ne."*") call abort
+ write (str,'(F1.0)') 0.001
+ if (str.ne."*") call abort
+ write (str,'(F1.0)') 0.01
+ if (str.ne."*") call abort
+ write (str,'(F1.0)') 0.1
+ if (str.ne."*") call abort
+ write (str,'(F2.0)') -0.001
+ if (str.ne."**") call abort
+ write (str,'(F2.0)') -0.01
+ if (str.ne."**") call abort
+ write (str,'(F2.0)') -0.1
+ if (str.ne."**") call abort
+ write (str,'(F0.2)') 0.0
+ if (str.ne.".00") call abort
+ write (str,'(F0.0)') -0.0
+ if (str.ne."-0.") call abort
+ write (str,'(F0.1)') -0.0
+ if (str.ne."-.0") call abort
+ write (str,'(F0.2)') -0.0
+ if (str.ne."-.00") call abort
+ write (str,'(F0.3)') -0.0
+ if (str.ne."-.000") call abort
+ write (str,'(F3.0)') -0.0
+ if (str.ne."-0.") call abort
+ write (str,'(F2.0)') -0.0
+ if (str.ne."**") call abort
+ write (str,'(F1.0)') -0.0
+ if (str.ne."*") call abort
+ write (str,'(F0.1)') -0.0
+ if (str.ne."-.0") call abort
+ write (str,'(F3.1)') -0.0
+ if (str.ne."-.0") call abort
+ write (str,'(F2.1)') -0.0
+ if (str.ne."**") call abort
+ write (str,'(F1.1)') -0.0
+ if (str.ne."*") call abort
END
diff --git a/gcc/testsuite/gfortran.dg/fmt_g.f b/gcc/testsuite/gfortran.dg/fmt_g.f
new file mode 100644
index 00000000000..55b094ae07e
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/fmt_g.f
@@ -0,0 +1,43 @@
+! { dg-do run }
+! PR47285 G format outputs wrong number of characters.
+! Test case prepared by Jerry DeLisle <jvdelisle@gcc.gnu.org>
+ PROGRAM FOO
+ character(len=50) :: buffer
+
+ WRITE(buffer,"(G0.5,'<')") -10000.
+ if (buffer.ne."-10000.<") call abort
+ WRITE(buffer,"(G1.5E5,'<')") -10000.
+ if (buffer.ne."*<") call abort
+ WRITE(buffer,"(G2.5E5,'<')") -10000.
+ if (buffer.ne."**<") call abort
+ WRITE(buffer,"(G3.5E5,'<')") -10000.
+ if (buffer.ne."***<") call abort
+ WRITE(buffer,"(G4.5E5,'<')") -10000.
+ if (buffer.ne."****<") call abort
+ WRITE(buffer,"(G5.5E5,'<')") -10000.
+ if (buffer.ne."*****<") call abort
+ WRITE(buffer,"(G6.5E5,'<')") -10000.
+ if (buffer.ne."******<") call abort
+ WRITE(buffer,"(G7.5E5,'<')") -10000.
+ if (buffer.ne."*******<") call abort
+ WRITE(buffer,"(G8.5E5,'<')") -10000.
+ if (buffer.ne."********<") call abort
+ WRITE(buffer,"(G9.5E5,'<')") -10000.
+ if (buffer.ne."*********<") call abort
+ WRITE(buffer,"(G10.5E5,'<')") -10000.
+ if (buffer.ne."**********<") call abort
+ WRITE(buffer,"(G11.5E5,'<')") -10000.
+ if (buffer.ne."***********<") call abort
+ WRITE(buffer,"(G12.5E5,'<')") -10000.
+ if (buffer.ne."************<") call abort
+ WRITE(buffer,"(G13.5E5,'<')") -10000.
+ if (buffer.ne."-10000. <") call abort
+ WRITE(buffer,"(G14.5E5,'<')") -10000.
+ if (buffer.ne." -10000. <") call abort
+ WRITE(buffer,"(G15.5E5,'<')") -10000.
+ if (buffer.ne." -10000. <") call abort
+ WRITE(buffer,"(G16.5E5,'<')") -10000.
+ if (buffer.ne." -10000. <") call abort
+
+ STOP
+ END
diff --git a/gcc/testsuite/gfortran.dg/fmt_read_2.f90 b/gcc/testsuite/gfortran.dg/fmt_read_2.f90
index 0f7f4d7ccff..316f737b621 100644
--- a/gcc/testsuite/gfortran.dg/fmt_read_2.f90
+++ b/gcc/testsuite/gfortran.dg/fmt_read_2.f90
@@ -4,7 +4,7 @@
integer :: r
real :: a
write (*,'(i0)') r
- read (*,'(i0)') r ! { dg-warning "Positive width required" }
- read (*,'(f0.2)') a ! { dg-warning "Positive width required" }
+ read (*,'(i0)') r ! { dg-error "Positive width required" }
+ read (*,'(f0.2)') a ! { dg-error "Positive width required" }
print *, r,a
END
diff --git a/gcc/testsuite/gfortran.dg/func_derived_5.f90 b/gcc/testsuite/gfortran.dg/func_derived_5.f90
index afe5ec0ace0..76d45a883d8 100644
--- a/gcc/testsuite/gfortran.dg/func_derived_5.f90
+++ b/gcc/testsuite/gfortran.dg/func_derived_5.f90
@@ -1,4 +1,4 @@
-! { dg-do "compile" }
+! { dg-do compile }
! PR fortran/41369 - rejected empty type in function return values
module m
diff --git a/gcc/testsuite/gfortran.dg/func_result_4.f90 b/gcc/testsuite/gfortran.dg/func_result_4.f90
index 81f02a57ca2..c3da2d60fc3 100644
--- a/gcc/testsuite/gfortran.dg/func_result_4.f90
+++ b/gcc/testsuite/gfortran.dg/func_result_4.f90
@@ -1,4 +1,4 @@
-! { dg-do "compile" }
+! { dg-do compile }
! { dg-options "-c" }
!
! Do not apply the SAVE attribute to function results.
diff --git a/gcc/testsuite/gfortran.dg/func_result_6.f90 b/gcc/testsuite/gfortran.dg/func_result_6.f90
new file mode 100644
index 00000000000..e64a2ef7abc
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/func_result_6.f90
@@ -0,0 +1,73 @@
+! { dg-do run }
+!
+! PR fortran/47775
+!
+! Contributed by Fran Martinez Fadrique
+!
+! Before, a temporary was missing for generic procedured (cf. test())
+! as the allocatable attribute was ignored for the check whether a
+! temporary is required
+!
+module m
+type t
+contains
+ procedure, NOPASS :: foo => foo
+ generic :: gen => foo
+end type t
+contains
+ function foo(i)
+ integer, allocatable :: foo(:)
+ integer :: i
+ allocate(foo(2))
+ foo(1) = i
+ foo(2) = i + 10
+ end function foo
+end module m
+
+use m
+type(t) :: x
+integer, pointer :: ptr1, ptr2
+integer, target :: bar1(2)
+integer, target, allocatable :: bar2(:)
+
+allocate(bar2(2))
+ptr1 => bar1(2)
+ptr2 => bar2(2)
+
+bar1 = x%gen(1)
+if (ptr1 /= 11) call abort()
+bar1 = x%foo(2)
+if (ptr1 /= 12) call abort()
+bar2 = x%gen(3)
+if (ptr2 /= 13) call abort()
+bar2 = x%foo(4)
+if (ptr2 /= 14) call abort()
+bar2(:) = x%gen(5)
+if (ptr2 /= 15) call abort()
+bar2(:) = x%foo(6)
+if (ptr2 /= 16) call abort()
+
+call test()
+end
+
+subroutine test
+interface gen
+ procedure foo
+end interface gen
+
+integer, target :: bar(2)
+integer, pointer :: ptr
+bar = [1,2]
+ptr => bar(2)
+if (ptr /= 2) call abort()
+bar = gen()
+if (ptr /= 77) call abort()
+contains
+ function foo()
+ integer, allocatable :: foo(:)
+ allocate(foo(2))
+ foo = [33, 77]
+ end function foo
+end subroutine test
+
+! { dg-final { cleanup-modules "m" } }
diff --git a/gcc/testsuite/gfortran.dg/g77/12632.f b/gcc/testsuite/gfortran.dg/g77/12632.f
index 91121c8a406..398333926ed 100644
--- a/gcc/testsuite/gfortran.dg/g77/12632.f
+++ b/gcc/testsuite/gfortran.dg/g77/12632.f
@@ -1,6 +1,6 @@
C { dg-do compile }
C { dg-options "-fbounds-check" }
INTEGER I(1)
- I(2) = 0 ! { dg-error "out of bounds" "out of bounds" }
+ I(2) = 0 ! { dg-warning "out of bounds" "out of bounds" }
END
diff --git a/gcc/testsuite/gfortran.dg/g77/970625-2.f b/gcc/testsuite/gfortran.dg/g77/970625-2.f
index 19bd096815a..7f8a4644808 100644
--- a/gcc/testsuite/gfortran.dg/g77/970625-2.f
+++ b/gcc/testsuite/gfortran.dg/g77/970625-2.f
@@ -40,7 +40,7 @@
PROGRAM = THEN - IF
ELSE IF = THEN .GT. IF
IF (THEN.GT.REAL) THEN
- CALL FUNCTION PROGRAM (ELSE IF, GO TO PROGRAM, THEN) ! { dg-warning "Type mismatch in argument" }
+ CALL FUNCTION PROGRAM (ELSE IF, GO TO PROGRAM, THEN) ! { dg-error "Type mismatch in argument" }
ELSE IF (ELSE IF) THEN
REAL = THEN + END DO
END IF
diff --git a/gcc/testsuite/gfortran.dg/g77/980615-0.f b/gcc/testsuite/gfortran.dg/g77/980615-0.f
index 7e1f14fac38..5107f4f796d 100644
--- a/gcc/testsuite/gfortran.dg/g77/980615-0.f
+++ b/gcc/testsuite/gfortran.dg/g77/980615-0.f
@@ -8,5 +8,5 @@ c { dg-do compile }
CaLL foo(W)
END
SUBROUTINE foo(W)
- yy(I)=A(I)Q(X) ! { dg-error "Error: Unclassifiable statement" "" }
+ yy(I)=A(I)Q(X) ! { dg-error "Unclassifiable statement" "" }
c { dg-error "end of file" "end of file" { target *-*-* } 0 }
diff --git a/gcc/testsuite/gfortran.dg/generic_actual_arg.f90 b/gcc/testsuite/gfortran.dg/generic_actual_arg.f90
index e0b36a01036..17c50627f98 100644
--- a/gcc/testsuite/gfortran.dg/generic_actual_arg.f90
+++ b/gcc/testsuite/gfortran.dg/generic_actual_arg.f90
@@ -37,7 +37,7 @@ USE TEST
USE TEST2
CALL F(CALCULATION) ! { dg-error "GENERIC procedure" }
-CALL F(CALCULATION2) ! OK because there is a same name specific, but: ! { dg-warning "More actual than formal arguments" }
+CALL F(CALCULATION2) ! OK because there is a same name specific, but: ! { dg-error "More actual than formal arguments" }
END
SUBROUTINE F()
diff --git a/gcc/testsuite/gfortran.dg/global_references_1.f90 b/gcc/testsuite/gfortran.dg/global_references_1.f90
index d241aca1b53..7e0a5bd0a34 100644
--- a/gcc/testsuite/gfortran.dg/global_references_1.f90
+++ b/gcc/testsuite/gfortran.dg/global_references_1.f90
@@ -32,7 +32,7 @@ function h(x) ! { dg-error "is already being used as a FUNCTION" }
end function h
SUBROUTINE TT()
- CHARACTER(LEN=10), EXTERNAL :: j ! { dg-warning "Return type mismatch" }
+ CHARACTER(LEN=10), EXTERNAL :: j ! { dg-error "Return type mismatch" }
CHARACTER(LEN=10) :: T
! PR20881===========================================================
! Error only appears once but testsuite associates with both lines.
diff --git a/gcc/testsuite/gfortran.dg/gomp/pr43711.f90 b/gcc/testsuite/gfortran.dg/gomp/pr43711.f90
index 9d7806c3ef7..e47e586ea65 100644
--- a/gcc/testsuite/gfortran.dg/gomp/pr43711.f90
+++ b/gcc/testsuite/gfortran.dg/gomp/pr43711.f90
@@ -1,4 +1,4 @@
-! { dg-do "compile" }
+! { dg-do compile }
! { dg-options "-fopenmp" }
!
! PR fortran/43711 uninformative error message for two 'nowait' in omp statement
@@ -15,4 +15,4 @@ program NF03_2_5_2_1a
!$omp end parallel
end program NF03_2_5_2_1a
-! { dg-excess-errors "Unexpected" } \ No newline at end of file
+! { dg-excess-errors "Unexpected" }
diff --git a/gcc/testsuite/gfortran.dg/goto_8.f90 b/gcc/testsuite/gfortran.dg/goto_8.f90
index a5f1f7f07b9..744b5f3c877 100644
--- a/gcc/testsuite/gfortran.dg/goto_8.f90
+++ b/gcc/testsuite/gfortran.dg/goto_8.f90
@@ -23,9 +23,9 @@ end block
88 continue
! 3rd example: jumping into BLOCK (invalid)
-goto 99 ! { dg-error "is not in the same block" }
+goto 99 ! { dg-warning "is not in the same block" }
block
- 99 continue ! { dg-error "is not in the same block" }
+ 99 continue ! { dg-warning "is not in the same block" }
end block
end
diff --git a/gcc/testsuite/gfortran.dg/graphite/graphite.exp b/gcc/testsuite/gfortran.dg/graphite/graphite.exp
index 3d43b55d0c3..73c2aeed42f 100644
--- a/gcc/testsuite/gfortran.dg/graphite/graphite.exp
+++ b/gcc/testsuite/gfortran.dg/graphite/graphite.exp
@@ -51,7 +51,11 @@ gfortran-dg-runtest $scop_files "-O2 -fgraphite -fdump-tree-graphite-all"
gfortran-dg-runtest $id_files "-O2 -fgraphite-identity -ffast-math"
gfortran-dg-runtest $interchange_files "-O2 -floop-interchange -fno-loop-block -fno-loop-strip-mine -ffast-math -fdump-tree-graphite-all"
gfortran-dg-runtest $block_files "-O2 -floop-block -fno-loop-strip-mine -fno-loop-interchange -ffast-math -fdump-tree-graphite-all"
-gfortran-dg-runtest $vect_files "-O2 -fgraphite-identity -ftree-vectorize -fno-vect-cost-model -fdump-tree-vect-details"
+
+# Vectorizer tests, to be run or compiled, depending on target capabilities.
+if [check_vect_support_and_set_flags] {
+ gfortran-dg-runtest $vect_files "-O2 -fgraphite-identity -ftree-vectorize -fno-vect-cost-model -fdump-tree-vect-details -ffast-math"
+}
# Tests to be run.
set dg-do-what-default run
diff --git a/gcc/testsuite/gfortran.dg/graphite/id-23.f b/gcc/testsuite/gfortran.dg/graphite/id-23.f
new file mode 100644
index 00000000000..74c29283ddc
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/graphite/id-23.f
@@ -0,0 +1,13 @@
+ SUBROUTINE CAMB(RX2,RTX,NUM)
+ DIMENSION RX2(NUM,NUM),RTX(NUM,NUM)
+ DO I=1,NUM
+ DO J=1,I
+ DO M=1,NUM
+ RX2(I,J)=RX2(I,J)+RTX(M,I)
+ END DO
+ END DO
+ END DO
+ IF (RX2(I,1).LE.EIGCT2) THEN
+ RTX(I,1)=4.0D+00
+ END IF
+ END
diff --git a/gcc/testsuite/gfortran.dg/graphite/id-24.f b/gcc/testsuite/gfortran.dg/graphite/id-24.f
new file mode 100644
index 00000000000..20c40ee06e2
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/graphite/id-24.f
@@ -0,0 +1,9 @@
+ SUBROUTINE TFTRAB(A,NA)
+ DIMENSION A(NA,NA)
+ DO 160 K=1,NA
+ DUM = DUM + A(K,I)
+ 160 CONTINUE
+ DO 180 I=1,NA
+ A(I,J) = DUM
+ 180 CONTINUE
+ END
diff --git a/gcc/testsuite/gfortran.dg/graphite/id-25.f b/gcc/testsuite/gfortran.dg/graphite/id-25.f
new file mode 100644
index 00000000000..642ed6de7f5
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/graphite/id-25.f
@@ -0,0 +1,10 @@
+ SUBROUTINE TFTRAB(NA,NC,D,WRK)
+ DIMENSION D(NA,NC), WRK(NA)
+ DO 160 K=1,NA
+ DUM = DUM + D(K,J)
+ 160 CONTINUE
+ WRK(I) = DUM
+ DO 180 I=1,NA
+ D(I,J) = WRK(I)
+ 180 CONTINUE
+ END
diff --git a/gcc/testsuite/gfortran.dg/graphite/id-pr46994.f90 b/gcc/testsuite/gfortran.dg/graphite/id-pr46994.f90
new file mode 100644
index 00000000000..93eff45fb77
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/graphite/id-pr46994.f90
@@ -0,0 +1,14 @@
+! { dg-options "-O -ffast-math -fgraphite-identity -fno-tree-dce" }
+
+subroutine foo (m)
+ integer :: m, i, j, k
+ real :: s
+ s = 0
+ do i = 1, 9
+ do j = 1, 2*m
+ do k = 1, 2*m
+ s = s + 1
+ end do
+ end do
+ end do
+end subroutine foo
diff --git a/gcc/testsuite/gfortran.dg/graphite/id-pr46995.f90 b/gcc/testsuite/gfortran.dg/graphite/id-pr46995.f90
new file mode 100644
index 00000000000..06cbfd364e8
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/graphite/id-pr46995.f90
@@ -0,0 +1,16 @@
+! { dg-options "-O -ffast-math -fgraphite-identity -fno-tree-dce" }
+
+subroutine foo (m, l, zw)
+ integer :: m, i, j, k
+ real, dimension(1:9) :: zw
+ real :: l, s
+ s = 0
+ do i = 1, 9
+ do j = 1, 2*m
+ do k = 1, 2*m
+ s = s + 1
+ end do
+ end do
+ l = l + zw(i)*s
+ end do
+end subroutine foo
diff --git a/gcc/testsuite/gfortran.dg/graphite/interchange-3.f90 b/gcc/testsuite/gfortran.dg/graphite/interchange-3.f90
index 04f4a139361..06da2b3aa53 100644
--- a/gcc/testsuite/gfortran.dg/graphite/interchange-3.f90
+++ b/gcc/testsuite/gfortran.dg/graphite/interchange-3.f90
@@ -24,5 +24,5 @@ Program FOO
end Program FOO
-! { dg-final { scan-tree-dump-times "will be interchanged" 1 "graphite" { xfail *-*-* } } }
+! { dg-final { scan-tree-dump-times "will be interchanged" 1 "graphite" } }
! { dg-final { cleanup-tree-dump "graphite" } }
diff --git a/gcc/testsuite/gfortran.dg/graphite/interchange-4.f b/gcc/testsuite/gfortran.dg/graphite/interchange-4.f
new file mode 100644
index 00000000000..3d42811bc56
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/graphite/interchange-4.f
@@ -0,0 +1,29 @@
+ subroutine s231 (ntimes,ld,n,ctime,dtime,a,b,c,d,e,aa,bb,cc)
+c
+c loop interchange
+c loop with multiple dimension recursion
+c
+ integer ntimes, ld, n, i, nl, j
+ double precision a(n), b(n), c(n), d(n), e(n), aa(ld,n),
+ + bb(ld,n), cc(ld,n)
+ double precision chksum, cs2d
+ real t1, t2, second, ctime, dtime
+
+ call init(ld,n,a,b,c,d,e,aa,bb,cc,'s231 ')
+ t1 = second()
+ do 1 nl = 1,ntimes/n
+ do 10 i=1,n
+ do 20 j=2,n
+ aa(i,j) = aa(i,j-1) + bb(i,j)
+ 20 continue
+ 10 continue
+ call dummy(ld,n,a,b,c,d,e,aa,bb,cc,1.d0)
+ 1 continue
+ t2 = second() - t1 - ctime - ( dtime * float(ntimes/n) )
+ chksum = cs2d(n,aa)
+ call check (chksum,(ntimes/n)*n*(n-1),n,t2,'s231 ')
+ return
+ end
+
+! { dg-final { scan-tree-dump-times "will be interchanged" 1 "graphite" { xfail *-*-* } } }
+! { dg-final { cleanup-tree-dump "graphite" } }
diff --git a/gcc/testsuite/gfortran.dg/graphite/interchange-5.f b/gcc/testsuite/gfortran.dg/graphite/interchange-5.f
new file mode 100644
index 00000000000..658f10a74d7
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/graphite/interchange-5.f
@@ -0,0 +1,30 @@
+ subroutine s235 (ntimes,ld,n,ctime,dtime,a,b,c,d,e,aa,bb,cc)
+c
+c loop interchanging
+c imperfectly nested loops
+c
+ integer ntimes, ld, n, i, nl, j
+ double precision a(n), b(n), c(n), d(n), e(n), aa(ld,n),
+ + bb(ld,n), cc(ld,n)
+ double precision chksum, cs1d, cs2d
+ real t1, t2, second, ctime, dtime
+
+ call init(ld,n,a,b,c,d,e,aa,bb,cc,'s235 ')
+ t1 = second()
+ do 1 nl = 1,ntimes/n
+ do 10 i = 1,n
+ a(i) = a(i) + b(i) * c(i)
+ do 20 j = 2,n
+ aa(i,j) = aa(i,j-1) + bb(i,j) * a(i)
+ 20 continue
+ 10 continue
+ call dummy(ld,n,a,b,c,d,e,aa,bb,cc,1.d0)
+ 1 continue
+ t2 = second() - t1 - ctime - ( dtime * float(ntimes/n) )
+ chksum = cs2d(n,aa) + cs1d(n,a)
+ call check (chksum,(ntimes/n)*n*(n-1),n,t2,'s235 ')
+ return
+ end
+
+! { dg-final { scan-tree-dump-times "will be interchanged" 1 "graphite" { xfail *-*-* } } }
+! { dg-final { cleanup-tree-dump "graphite" } }
diff --git a/gcc/testsuite/gfortran.dg/loop_nest_1.f90 b/gcc/testsuite/gfortran.dg/graphite/pr29290.f90
index 8968d88c470..8968d88c470 100644
--- a/gcc/testsuite/gfortran.dg/loop_nest_1.f90
+++ b/gcc/testsuite/gfortran.dg/graphite/pr29290.f90
diff --git a/gcc/testsuite/gfortran.dg/pr29581.f90 b/gcc/testsuite/gfortran.dg/graphite/pr29581.f90
index 3e4a39efb63..3e4a39efb63 100644
--- a/gcc/testsuite/gfortran.dg/pr29581.f90
+++ b/gcc/testsuite/gfortran.dg/graphite/pr29581.f90
diff --git a/gcc/testsuite/gfortran.dg/graphite/pr29832.f90 b/gcc/testsuite/gfortran.dg/graphite/pr29832.f90
new file mode 100644
index 00000000000..ab222ab03a6
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/graphite/pr29832.f90
@@ -0,0 +1,26 @@
+! { dg-do run }
+! { dg-options "-O2 -ftree-loop-linear" }
+
+! Program to test the scalarizer
+program testarray
+ implicit none
+ integer, dimension (6, 5) :: a, b
+ integer n
+
+ a = 0
+ do n = 1, 5
+ a(4, n) = n
+ end do
+
+ b(:, 5:1:-1) = a
+ a(1:5, 2) = a(4, :) + 1
+
+ ! The following expression should cause loop reordering
+ a(:, 2:4) = a(:, 1:3)
+
+ do n = 1, 5
+ if (a(n, 3) .ne. (n + 1)) call abort
+ if (b(4, n) .ne. (6 - n)) call abort
+ end do
+end program
+
diff --git a/gcc/testsuite/gfortran.dg/pr36286.f90 b/gcc/testsuite/gfortran.dg/graphite/pr36286.f90
index bcdef085073..bcdef085073 100644
--- a/gcc/testsuite/gfortran.dg/pr36286.f90
+++ b/gcc/testsuite/gfortran.dg/graphite/pr36286.f90
diff --git a/gcc/testsuite/gfortran.dg/pr36922.f b/gcc/testsuite/gfortran.dg/graphite/pr36922.f
index 6aa95beb696..6aa95beb696 100644
--- a/gcc/testsuite/gfortran.dg/pr36922.f
+++ b/gcc/testsuite/gfortran.dg/graphite/pr36922.f
diff --git a/gcc/testsuite/gfortran.dg/pr39516.f b/gcc/testsuite/gfortran.dg/graphite/pr39516.f
index 3d6104a8ebf..3d6104a8ebf 100644
--- a/gcc/testsuite/gfortran.dg/pr39516.f
+++ b/gcc/testsuite/gfortran.dg/graphite/pr39516.f
diff --git a/gcc/testsuite/gfortran.dg/graphite/vect-pr40979.f90 b/gcc/testsuite/gfortran.dg/graphite/vect-pr40979.f90
new file mode 100644
index 00000000000..662b82a12a0
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/graphite/vect-pr40979.f90
@@ -0,0 +1,26 @@
+! { dg-do compile }
+! { dg-require-effective-target vect_double }
+
+module mqc_m
+integer, parameter, private :: longreal = selected_real_kind(15,90)
+contains
+ subroutine mutual_ind_quad_cir_coil (m, l12)
+ real (kind = longreal), dimension(9), save :: w2gauss, w1gauss
+ real (kind = longreal) :: l12_lower, num, l12
+ real (kind = longreal), dimension(3) :: current, coil
+ w2gauss(1) = 16.0_longreal/81.0_longreal
+ w1gauss(5) = 0.3302393550_longreal
+ do i = 1, 2*m
+ do j = 1, 9
+ do k = 1, 9
+ num = w1gauss(j) * w2gauss(k) * dot_product(coil,current)
+ l12_lower = l12_lower + num
+ end do
+ end do
+ end do
+ l12 = l12_lower
+ end subroutine mutual_ind_quad_cir_coil
+end module mqc_m
+
+! { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } }
+! { dg-final { cleanup-tree-dump "vect" } }
diff --git a/gcc/testsuite/gfortran.dg/implied_do_1.f90 b/gcc/testsuite/gfortran.dg/implied_do_1.f90
index 7f1266c5dc2..d837e8f9f03 100644
--- a/gcc/testsuite/gfortran.dg/implied_do_1.f90
+++ b/gcc/testsuite/gfortran.dg/implied_do_1.f90
@@ -1,4 +1,4 @@
-! { dg-do "run" }
+! { dg-do run }
! PR fortran/29458 - spurious warning for implied do-loop counter
integer :: n, i
diff --git a/gcc/testsuite/gfortran.dg/initialization_1.f90 b/gcc/testsuite/gfortran.dg/initialization_1.f90
index 3ca20ac715c..2fb014ecedd 100644
--- a/gcc/testsuite/gfortran.dg/initialization_1.f90
+++ b/gcc/testsuite/gfortran.dg/initialization_1.f90
@@ -24,7 +24,7 @@ contains
real :: z(2, 2)
! However, this gives a warning because it is an initialization expression.
- integer :: l1 = len (ch1) ! { dg-warning "Assumed or deferred character length variable" }
+ integer :: l1 = len (ch1) ! { dg-error "Assumed or deferred character length variable" }
! These are warnings because they are gfortran extensions.
integer :: m3 = size (x, 1) ! { dg-error "Assumed size array" }
diff --git a/gcc/testsuite/gfortran.dg/initialization_25.f90 b/gcc/testsuite/gfortran.dg/initialization_25.f90
index fc667f4485a..66c447e2f1c 100644
--- a/gcc/testsuite/gfortran.dg/initialization_25.f90
+++ b/gcc/testsuite/gfortran.dg/initialization_25.f90
@@ -1,4 +1,4 @@
-! { dg-do "compile" }
+! { dg-do compile }
!
! PR fortran/35779 - unrelated error message
! Tescase contributed by
diff --git a/gcc/testsuite/gfortran.dg/initialization_26.f90 b/gcc/testsuite/gfortran.dg/initialization_26.f90
index d5bc93b4686..4532216e12e 100644
--- a/gcc/testsuite/gfortran.dg/initialization_26.f90
+++ b/gcc/testsuite/gfortran.dg/initialization_26.f90
@@ -1,4 +1,4 @@
-! { dg-do "compile" }
+! { dg-do compile }
!
! Verify that the outer do-loop counter 'j' is accepted as
! as end-expression of the inner loop.
diff --git a/gcc/testsuite/gfortran.dg/inquire_14.f90 b/gcc/testsuite/gfortran.dg/inquire_14.f90
new file mode 100644
index 00000000000..edc9bf388a4
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/inquire_14.f90
@@ -0,0 +1,13 @@
+! { dg-do compile }
+! PR47583 Inquire affected by previous read.
+subroutine input(indat)
+ real indat(:)
+ read(*,*) indat
+end subroutine input
+
+subroutine abc(sizedat)
+ real, intent(in) :: sizedat(:)
+ integer :: rl
+ inquire(iolength=rl) sizedat
+ write(*,*) rl
+end subroutine abc
diff --git a/gcc/testsuite/gfortran.dg/interface_34.f90 b/gcc/testsuite/gfortran.dg/interface_34.f90
new file mode 100644
index 00000000000..880f179e6f0
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/interface_34.f90
@@ -0,0 +1,33 @@
+! { dg-do compile }
+!
+! PR fortran/47042
+!
+! Contribued by Jerry DeLisle
+!
+
+program bug
+
+contains
+function get_cstring ()
+ character :: get_cstring
+ character, pointer :: ptmp
+ character, allocatable :: atmp
+
+ get_cstring = ptmp(i) ! { dg-error "must have an explicit function interface" }
+ get_cstring = atmp(i) ! { dg-error "must have an explicit function interface" }
+end function
+
+function get_cstring2 ()
+ EXTERNAL :: ptmp, atmp
+ character :: get_cstring2
+ character, pointer :: ptmp
+ character, allocatable :: atmp
+
+ get_cstring2 = atmp(i) ! { dg-error "must have an explicit function interface" }
+
+ ! The following is regarded as call to a procedure pointer,
+ ! which is in principle valid:
+ get_cstring2 = ptmp(i)
+end function
+
+end program
diff --git a/gcc/testsuite/gfortran.dg/io_constraints_1.f90 b/gcc/testsuite/gfortran.dg/io_constraints_1.f90
index db1e949e7a5..eb8ab8d5349 100644
--- a/gcc/testsuite/gfortran.dg/io_constraints_1.f90
+++ b/gcc/testsuite/gfortran.dg/io_constraints_1.f90
@@ -33,7 +33,7 @@ end module global
! Appending to a USE associated namelist is an extension.
- NAMELIST /NL/ a,b ! { dg-warning "already is USE associated" }
+ NAMELIST /NL/ a,b ! { dg-error "already is USE associated" }
a=1 ; b=2
@@ -54,7 +54,7 @@ end module global
! R912
!Was correctly picked up before patch.
- write(6, NML=NL, iostat = ierr) ! { dg-warning "requires default INTEGER" }
+ write(6, NML=NL, iostat = ierr) ! { dg-error "requires default INTEGER" }
! Constraints
!Was correctly picked up before patch.
diff --git a/gcc/testsuite/gfortran.dg/io_constraints_2.f90 b/gcc/testsuite/gfortran.dg/io_constraints_2.f90
index 8d3ae6b45f4..42aba66a8d5 100644
--- a/gcc/testsuite/gfortran.dg/io_constraints_2.f90
+++ b/gcc/testsuite/gfortran.dg/io_constraints_2.f90
@@ -30,7 +30,7 @@ end module global
! Appending to a USE associated namelist is an extension.
- NAMELIST /NL/ a,b ! { dg-warning "already is USE associated" }
+ NAMELIST /NL/ a,b ! { dg-error "already is USE associated" }
a=1 ; b=2
diff --git a/gcc/testsuite/gfortran.dg/io_constraints_3.f90 b/gcc/testsuite/gfortran.dg/io_constraints_3.f90
index ae9acce6784..7622a248616 100644
--- a/gcc/testsuite/gfortran.dg/io_constraints_3.f90
+++ b/gcc/testsuite/gfortran.dg/io_constraints_3.f90
@@ -44,8 +44,8 @@
open(10, iostat=u,position="append")
open(10, iostat=u,position=foo) ! { dg-warning "POSITION specifier in OPEN statement" }
- open(10, iostat=u,recl="ee") ! { dg-warning "must be of type INTEGER" }
- open(10, iostat=u,recl=0.4) ! { dg-warning "must be of type INTEGER" }
+ open(10, iostat=u,recl="ee") ! { dg-error "must be of type INTEGER" }
+ open(10, iostat=u,recl=0.4) ! { dg-error "must be of type INTEGER" }
open(10, iostat=u,recl=zero) ! { dg-warning "must be positive" }
open(10, iostat=u,recl=mone) ! { dg-warning "must be positive" }
@@ -105,8 +105,8 @@
open(10, err=99,position="append")
open(10, err=99,position=foo) ! { dg-warning "POSITION specifier in OPEN statement" }
- open(10, err=99,recl="ee") ! { dg-warning "must be of type INTEGER" }
- open(10, err=99,recl=0.4) ! { dg-warning "must be of type INTEGER" }
+ open(10, err=99,recl="ee") ! { dg-error "must be of type INTEGER" }
+ open(10, err=99,recl=0.4) ! { dg-error "must be of type INTEGER" }
open(10, err=99,recl=zero) ! { dg-warning "must be positive" }
open(10, err=99,recl=mone) ! { dg-warning "must be positive" }
diff --git a/gcc/testsuite/gfortran.dg/iostat_3.f90 b/gcc/testsuite/gfortran.dg/iostat_3.f90
index 0f6aacaf004..23492f2af65 100644
--- a/gcc/testsuite/gfortran.dg/iostat_3.f90
+++ b/gcc/testsuite/gfortran.dg/iostat_3.f90
@@ -4,6 +4,6 @@
real :: u
integer(kind=8) :: i
open (10,status="scratch")
- read (10,*,iostat=i) u ! { dg-warning "Fortran 95 requires default INTEGER in IOSTAT tag" }
- close (10,iostat=i) ! { dg-warning "Fortran 95 requires default INTEGER in IOSTAT tag" }
+ read (10,*,iostat=i) u ! { dg-error "Fortran 95 requires default INTEGER in IOSTAT tag" }
+ close (10,iostat=i) ! { dg-error "Fortran 95 requires default INTEGER in IOSTAT tag" }
end
diff --git a/gcc/testsuite/gfortran.dg/iso_c_binding_init_expr.f03 b/gcc/testsuite/gfortran.dg/iso_c_binding_init_expr.f03
index 840b60e4eb2..0a0099628b3 100644
--- a/gcc/testsuite/gfortran.dg/iso_c_binding_init_expr.f03
+++ b/gcc/testsuite/gfortran.dg/iso_c_binding_init_expr.f03
@@ -1,4 +1,4 @@
-! { dg-do "compile" }
+! { dg-do compile }
! PR fortran/42354
use iso_c_binding
diff --git a/gcc/testsuite/gfortran.dg/keyword_symbol_1.f90 b/gcc/testsuite/gfortran.dg/keyword_symbol_1.f90
index 7195f250837..2661897fff5 100644
--- a/gcc/testsuite/gfortran.dg/keyword_symbol_1.f90
+++ b/gcc/testsuite/gfortran.dg/keyword_symbol_1.f90
@@ -1,4 +1,4 @@
-! ' dg-do compile }
+! { dg-do compile }
! This tests the fix for PR28526, in which a public interface named
! 'end' would be treated as a variable because the matcher tried
! 'END INTERFACE' as an assignment and left the symbol modified in
diff --git a/gcc/testsuite/gfortran.dg/large_real_kind_1.f90 b/gcc/testsuite/gfortran.dg/large_real_kind_1.f90
index 5c741ad6cb5..28e406730fa 100644
--- a/gcc/testsuite/gfortran.dg/large_real_kind_1.f90
+++ b/gcc/testsuite/gfortran.dg/large_real_kind_1.f90
@@ -56,7 +56,7 @@ program test
call testoutput (-7.51e-100_k,-7.51e-100_8,15,'(F15.10)')
x = huge(x)
- call outputstring (2*x,'(F20.15)',' +Infinity')
+ call outputstring (2*x,'(F20.15)',' Infinity')
call outputstring (-2*x,'(F20.15)',' -Infinity')
write (c1,'(G20.10E5)') x
diff --git a/gcc/testsuite/gfortran.dg/lto/20091016-1_0.f90 b/gcc/testsuite/gfortran.dg/lto/20091016-1_0.f90
index c26ad90fbe2..a882da042cd 100644
--- a/gcc/testsuite/gfortran.dg/lto/20091016-1_0.f90
+++ b/gcc/testsuite/gfortran.dg/lto/20091016-1_0.f90
@@ -1,5 +1,5 @@
! { dg-lto-do link }
-! { dg-lto-options {{-flto -g -fPIC -shared} {-O -flto -g -fPIC -shared}} }
+! { dg-lto-options {{-flto -g -fPIC -r -nostdlib} {-O -flto -g -fPIC -r -nostdlib}} }
FUNCTION makenumberstring(x)
IMPLICIT NONE
diff --git a/gcc/testsuite/gfortran.dg/lto/pr45586_0.f90 b/gcc/testsuite/gfortran.dg/lto/pr45586_0.f90
new file mode 100644
index 00000000000..84f3633df74
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/lto/pr45586_0.f90
@@ -0,0 +1,29 @@
+! { dg-lto-do link }
+ MODULE M1
+ INTEGER, PARAMETER :: dp=8
+ TYPE realspace_grid_type
+
+ REAL(KIND=dp), DIMENSION ( :, :, : ), ALLOCATABLE :: r
+
+ END TYPE realspace_grid_type
+ END MODULE
+
+ MODULE M2
+ USE m1
+ CONTAINS
+ SUBROUTINE S1(x)
+ TYPE(realspace_grid_type), POINTER :: x
+ REAL(dp), DIMENSION(:, :, :), POINTER :: y
+ y=>x%r
+ y=0
+
+ END SUBROUTINE
+ END MODULE
+
+ USE M2
+ TYPE(realspace_grid_type), POINTER :: x
+ ALLOCATE(x)
+ ALLOCATE(x%r(10,10,10))
+ CALL S1(x)
+ write(6,*) x%r
+ END
diff --git a/gcc/testsuite/gfortran.dg/lto/pr47839_0.f90 b/gcc/testsuite/gfortran.dg/lto/pr47839_0.f90
new file mode 100644
index 00000000000..9ea9315284a
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/lto/pr47839_0.f90
@@ -0,0 +1,8 @@
+! { dg-lto-do link }
+! { dg-lto-options {{ -g -flto }} }
+! { dg-extra-ld-options "-r -nostdlib" }
+
+MODULE globalvar_mod
+integer :: xstop
+CONTAINS
+END MODULE globalvar_mod
diff --git a/gcc/testsuite/gfortran.dg/lto/pr47839_1.f90 b/gcc/testsuite/gfortran.dg/lto/pr47839_1.f90
new file mode 100644
index 00000000000..5c94ff17b5c
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/lto/pr47839_1.f90
@@ -0,0 +1,7 @@
+MODULE PEC_mod
+CONTAINS
+SUBROUTINE PECapply(Ex)
+USE globalvar_mod, ONLY : xstop
+real(kind=8), dimension(1:xstop), intent(inout) :: Ex
+END SUBROUTINE PECapply
+END MODULE PEC_mod
diff --git a/gcc/testsuite/gfortran.dg/ltrans-7.f90 b/gcc/testsuite/gfortran.dg/ltrans-7.f90
deleted file mode 100644
index 583edf216ba..00000000000
--- a/gcc/testsuite/gfortran.dg/ltrans-7.f90
+++ /dev/null
@@ -1,31 +0,0 @@
-! { dg-do compile }
-! { dg-options "-O2 -ftree-loop-linear -fdump-tree-ltrans-all" }
-! { dg-options "-O2 -ftree-loop-linear -fdump-tree-ltrans-all -march=i486" { target { i?86-*-* && ilp32 } } }
-
-Program FOO
- IMPLICIT INTEGER (I-N)
- IMPLICIT REAL*8 (A-H, O-Z)
- PARAMETER (N1=1335, N2=1335)
- COMMON U(N1,N2), V(N1,N2), P(N1,N2)
-
- PC = 0.0D0
- UC = 0.0D0
- VC = 0.0D0
-
- do I = 1, M
- do J = 1, M
- PC = PC + abs(P(I,J))
- UC = UC + abs(U(I,J))
- VC = VC + abs(V(I,J))
- end do
- U(I,I) = U(I,I) * ( mod (I, 100) /100.)
- end do
-
- write(6,366) PC, UC, VC
-366 format(/, ' PC = ',E12.4,/,' UC = ',E12.4,/,' VC = ',E12.4,/)
-
-end Program FOO
-
-! Please do not XFAIL.
-! { dg-final { scan-tree-dump-times "transformed loop" 1 "ltrans" } }
-! { dg-final { cleanup-tree-dump "ltrans" } }
diff --git a/gcc/testsuite/gfortran.dg/matmul_8.f03 b/gcc/testsuite/gfortran.dg/matmul_8.f03
index d73fdcd07bd..fcd4b0d56b6 100644
--- a/gcc/testsuite/gfortran.dg/matmul_8.f03
+++ b/gcc/testsuite/gfortran.dg/matmul_8.f03
@@ -1,4 +1,4 @@
-! { dg-do "run" }
+! { dg-do run }
! Transformational intrinsic MATMUL as initialization expression.
REAL, PARAMETER :: PI = 3.141592654, theta = PI/6.0
diff --git a/gcc/testsuite/gfortran.dg/merge_init_expr.f90 b/gcc/testsuite/gfortran.dg/merge_init_expr.f90
index f40f49026cc..c691aa0e325 100644
--- a/gcc/testsuite/gfortran.dg/merge_init_expr.f90
+++ b/gcc/testsuite/gfortran.dg/merge_init_expr.f90
@@ -1,4 +1,4 @@
-! { dg-do "run" }
+! { dg-do run }
!
! Check simplification of MERGE.
!
diff --git a/gcc/testsuite/gfortran.dg/module_nan.f90 b/gcc/testsuite/gfortran.dg/module_nan.f90
index ed841a891ab..202781f07c2 100644
--- a/gcc/testsuite/gfortran.dg/module_nan.f90
+++ b/gcc/testsuite/gfortran.dg/module_nan.f90
@@ -19,7 +19,7 @@ program a
if (log(abs(inf)) < huge(inf)) call abort()
if (log(abs(minf)) < huge(inf)) call abort()
if (.not. isnan(nan)) call abort()
- write(str,*) inf
+ write(str,"(sp,f10.2)") inf
if (adjustl(str) /= "+Infinity") call abort()
write(str,*) minf
if (adjustl(str) /= "-Infinity") call abort()
diff --git a/gcc/testsuite/gfortran.dg/namelist_3.f90 b/gcc/testsuite/gfortran.dg/namelist_3.f90
index 68cc7d558ff..722b94027ce 100644
--- a/gcc/testsuite/gfortran.dg/namelist_3.f90
+++ b/gcc/testsuite/gfortran.dg/namelist_3.f90
@@ -1,7 +1,8 @@
! { dg-do compile }
+! { dg-options "-std=f95" }
! Check that a pointer cannot be a member of a namelist
program namelist_3
integer,pointer :: x
allocate (x)
- namelist /n/ x ! { dg-error "NAMELIST attribute conflicts with POINTER attribute" "" }
+ namelist /n/ x ! { dg-error "NAMELIST attribute with POINTER attribute" "" }
end program namelist_3
diff --git a/gcc/testsuite/gfortran.dg/namelist_34.f90 b/gcc/testsuite/gfortran.dg/namelist_34.f90
index be050d954c0..f7c5e1cf6f1 100644
--- a/gcc/testsuite/gfortran.dg/namelist_34.f90
+++ b/gcc/testsuite/gfortran.dg/namelist_34.f90
@@ -23,8 +23,8 @@ USE types
type(tp1) :: t1
type(tp3) :: t3
- namelist /a/ t1 ! { dg-error "cannot have POINTER components" }
- namelist /b/ t3 ! { dg-error "cannot have POINTER components" }
+ namelist /a/ t1 ! { dg-error "has ALLOCATABLE or POINTER components and thus requires a defined input/output" }
+ namelist /b/ t3 ! { dg-error "has ALLOCATABLE or POINTER components and thus requires a defined input/output" }
END MODULE
! { dg-final { cleanup-modules "types nml" } }
diff --git a/gcc/testsuite/gfortran.dg/namelist_35.f90 b/gcc/testsuite/gfortran.dg/namelist_35.f90
index 531f636d578..9a2972de8c6 100644
--- a/gcc/testsuite/gfortran.dg/namelist_35.f90
+++ b/gcc/testsuite/gfortran.dg/namelist_35.f90
@@ -7,5 +7,5 @@
subroutine test(cha)
implicit none
character(len=10) :: cha(:)
- namelist /z/ cha ! { dg-error "must not have assumed shape" }
+ namelist /z/ cha ! { dg-error "with assumed shape in namelist" }
end subroutine test
diff --git a/gcc/testsuite/gfortran.dg/namelist_5.f90 b/gcc/testsuite/gfortran.dg/namelist_5.f90
index d7ccfd106ca..4fcf9ae6688 100644
--- a/gcc/testsuite/gfortran.dg/namelist_5.f90
+++ b/gcc/testsuite/gfortran.dg/namelist_5.f90
@@ -1,4 +1,6 @@
! { dg-do compile }
+! { dg-options "-std=f95" }
+!
! Tests the fix for PR25054 in which namelist objects with non-constant
! shape were allowed.
!
@@ -6,8 +8,8 @@
!
SUBROUTINE S1(I)
integer :: a,b(I)
- NAMELIST /NLIST/ a,b ! { dg-error "must have constant shape" }
+ NAMELIST /NLIST/ a,b ! { dg-error "with nonconstant shape" }
a=1 ; b=2
write(6,NML=NLIST)
END SUBROUTINE S1
-END \ No newline at end of file
+END
diff --git a/gcc/testsuite/gfortran.dg/namelist_63.f90 b/gcc/testsuite/gfortran.dg/namelist_63.f90
index 1d02789fa54..0210174031f 100644
--- a/gcc/testsuite/gfortran.dg/namelist_63.f90
+++ b/gcc/testsuite/gfortran.dg/namelist_63.f90
@@ -24,5 +24,5 @@ type region_struct
end type
type (c_struct) curve(10)
-namelist / params / curve ! { dg-error "NAMELIST object .curve. in namelist .params. at .1. cannot have POINTER components" }
+namelist / params / curve ! { dg-error "ALLOCATABLE or POINTER components and thus requires a defined input/output" }
end program
diff --git a/gcc/testsuite/gfortran.dg/namelist_69.f90 b/gcc/testsuite/gfortran.dg/namelist_69.f90
new file mode 100644
index 00000000000..6261aabcf1d
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/namelist_69.f90
@@ -0,0 +1,233 @@
+! { dg-do run }
+!
+! PR fortran/47339
+! PR fortran/43062
+!
+! Run-time test for Fortran 2003 NAMELISTS
+! Version for non-strings
+!
+program nml_test
+ implicit none
+
+ character(len=1000) :: str
+
+ integer, allocatable :: a(:)
+ integer, allocatable :: b
+ integer, pointer :: ap(:)
+ integer, pointer :: bp
+ integer :: c
+ integer :: d(3)
+
+ type t
+ integer :: c1
+ integer :: c2(3)
+ end type t
+ type(t) :: e,f(2)
+ type(t),allocatable :: g,h(:)
+ type(t),pointer :: i,j(:)
+
+ namelist /nml/ a, b, c, d, ap, bp,e,f,g,h,i,j
+
+ a = [1,2]
+ allocate(b,ap(2),bp)
+ ap = [98, 99]
+ b = 7
+ bp = 101
+ c = 8
+ d = [-1, -2, -3]
+
+ e%c1 = -701
+ e%c2 = [-702,-703,-704]
+ f(1)%c1 = 33001
+ f(2)%c1 = 33002
+ f(1)%c2 = [44001,44002,44003]
+ f(2)%c2 = [44011,44012,44013]
+
+ allocate(g,h(2),i,j(2))
+
+ g%c1 = -601
+ g%c2 = [-602,6703,-604]
+ h(1)%c1 = 35001
+ h(2)%c1 = 35002
+ h(1)%c2 = [45001,45002,45003]
+ h(2)%c2 = [45011,45012,45013]
+
+ i%c1 = -501
+ i%c2 = [-502,-503,-504]
+ j(1)%c1 = 36001
+ j(2)%c1 = 36002
+ j(1)%c2 = [46001,46002,46003]
+ j(2)%c2 = [46011,46012,46013]
+
+ ! SAVE NAMELIST
+ str = repeat('X', len(str))
+ write(str,nml=nml)
+
+ ! RESET NAMELIST
+ a = [-1,-1]
+ ap = [-1, -1]
+ b = -1
+ bp = -1
+ c = -1
+ d = [-1, -1, -1]
+
+ e%c1 = -1
+ e%c2 = [-1,-1,-1]
+ f(1)%c1 = -1
+ f(2)%c1 = -1
+ f(1)%c2 = [-1,-1,-1]
+ f(2)%c2 = [-1,-1,-1]
+
+ g%c1 = -1
+ g%c2 = [-1,-1,-1]
+ h(1)%c1 = -1
+ h(2)%c1 = -1
+ h(1)%c2 = [-1,-1,-1]
+ h(2)%c2 = [-1,-1,-1]
+
+ i%c1 = -1
+ i%c2 = [-1,-1,-1]
+ j(1)%c1 = -1
+ j(2)%c1 = -1
+ j(1)%c2 = [-1,-1,-1]
+ j(2)%c2 = [-1,-1,-1]
+
+ ! Read back
+ read(str,nml=nml)
+
+ ! Check result
+ if (any (a /= [1,2])) call abort()
+ if (any (ap /= [98, 99])) call abort()
+ if (b /= 7) call abort()
+ if (bp /= 101) call abort()
+ if (c /= 8) call abort()
+ if (any (d /= [-1, -2, -3])) call abort()
+
+ if (e%c1 /= -701) call abort()
+ if (any (e%c2 /= [-702,-703,-704])) call abort()
+ if (f(1)%c1 /= 33001) call abort()
+ if (f(2)%c1 /= 33002) call abort()
+ if (any (f(1)%c2 /= [44001,44002,44003])) call abort()
+ if (any (f(2)%c2 /= [44011,44012,44013])) call abort()
+
+ if (g%c1 /= -601) call abort()
+ if (any(g%c2 /= [-602,6703,-604])) call abort()
+ if (h(1)%c1 /= 35001) call abort()
+ if (h(2)%c1 /= 35002) call abort()
+ if (any (h(1)%c2 /= [45001,45002,45003])) call abort()
+ if (any (h(2)%c2 /= [45011,45012,45013])) call abort()
+
+ if (i%c1 /= -501) call abort()
+ if (any (i%c2 /= [-502,-503,-504])) call abort()
+ if (j(1)%c1 /= 36001) call abort()
+ if (j(2)%c1 /= 36002) call abort()
+ if (any (j(1)%c2 /= [46001,46002,46003])) call abort()
+ if (any (j(2)%c2 /= [46011,46012,46013])) call abort()
+
+ ! Check argument passing (dummy processing)
+ call test2(a,b,c,d,ap,bp,e,f,g,h,i,j,2)
+
+contains
+ subroutine test2(x1,x2,x3,x4,x1p,x2p,x6,x7,x8,x9,x10,x11,n)
+ integer, allocatable :: x1(:)
+ integer, allocatable :: x2
+ integer, pointer :: x1p(:)
+ integer, pointer :: x2p
+ integer :: x3
+ integer :: x4(3)
+ integer :: n
+ integer :: x5(n)
+ type(t) :: x6,x7(2)
+ type(t),allocatable :: x8,x9(:)
+ type(t),pointer :: x10,x11(:)
+ type(t) :: x12(n)
+
+ namelist /nml2/ x1, x2, x3, x4,x5,x1p,x2p,x6,x7,x8,x9,x10,x11,x12
+
+ x5 = [ 42, 53 ]
+
+ x12(1)%c1 = 37001
+ x12(2)%c1 = 37002
+ x12(1)%c2 = [47001,47002,47003]
+ x12(2)%c2 = [47011,47012,47013]
+
+ ! SAVE NAMELIST
+ str = repeat('X', len(str))
+ write(str,nml=nml2)
+
+ ! RESET NAMELIST
+ x1 = [-1,-1]
+ x1p = [-1, -1]
+ x2 = -1
+ x2p = -1
+ x3 = -1
+ x4 = [-1, -1, -1]
+
+ x6%c1 = -1
+ x6%c2 = [-1,-1,-1]
+ x7(1)%c1 = -1
+ x7(2)%c1 = -1
+ x7(1)%c2 = [-1,-1,-1]
+ x7(2)%c2 = [-1,-1,-1]
+
+ x8%c1 = -1
+ x8%c2 = [-1,-1,-1]
+ x9(1)%c1 = -1
+ x9(2)%c1 = -1
+ x9(1)%c2 = [-1,-1,-1]
+ x9(2)%c2 = [-1,-1,-1]
+
+ x10%c1 = -1
+ x10%c2 = [-1,-1,-1]
+ x11(1)%c1 = -1
+ x11(2)%c1 = -1
+ x11(1)%c2 = [-1,-1,-1]
+ x11(2)%c2 = [-1,-1,-1]
+
+ x5 = [ -1, -1 ]
+
+ x12(1)%c1 = -1
+ x12(2)%c1 = -1
+ x12(1)%c2 = [-1,-1,-1]
+ x12(2)%c2 = [-1,-1,-1]
+
+ ! Read back
+ read(str,nml=nml2)
+
+ ! Check result
+ if (any (x1 /= [1,2])) call abort()
+ if (any (x1p /= [98, 99])) call abort()
+ if (x2 /= 7) call abort()
+ if (x2p /= 101) call abort()
+ if (x3 /= 8) call abort()
+ if (any (x4 /= [-1, -2, -3])) call abort()
+
+ if (x6%c1 /= -701) call abort()
+ if (any (x6%c2 /= [-702,-703,-704])) call abort()
+ if (x7(1)%c1 /= 33001) call abort()
+ if (x7(2)%c1 /= 33002) call abort()
+ if (any (x7(1)%c2 /= [44001,44002,44003])) call abort()
+ if (any (x7(2)%c2 /= [44011,44012,44013])) call abort()
+
+ if (x8%c1 /= -601) call abort()
+ if (any(x8%c2 /= [-602,6703,-604])) call abort()
+ if (x9(1)%c1 /= 35001) call abort()
+ if (x9(2)%c1 /= 35002) call abort()
+ if (any (x9(1)%c2 /= [45001,45002,45003])) call abort()
+ if (any (x9(2)%c2 /= [45011,45012,45013])) call abort()
+
+ if (x10%c1 /= -501) call abort()
+ if (any (x10%c2 /= [-502,-503,-504])) call abort()
+ if (x11(1)%c1 /= 36001) call abort()
+ if (x11(2)%c1 /= 36002) call abort()
+ if (any (x11(1)%c2 /= [46001,46002,46003])) call abort()
+ if (any (x11(2)%c2 /= [46011,46012,46013])) call abort()
+
+ if (any (x5 /= [ 42, 53 ])) call abort()
+
+ if (x12(1)%c1 /= 37001) call abort()
+ if (x12(2)%c1 /= 37002) call abort()
+ if (any (x12(1)%c2 /= [47001,47002,47003])) call abort()
+ if (any (x12(2)%c2 /= [47011,47012,47013])) call abort()
+ end subroutine test2
+end program nml_test
diff --git a/gcc/testsuite/gfortran.dg/namelist_70.f90 b/gcc/testsuite/gfortran.dg/namelist_70.f90
new file mode 100644
index 00000000000..f3edfc50cc1
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/namelist_70.f90
@@ -0,0 +1,442 @@
+! { dg-do run }
+!
+! PR fortran/47339
+! PR fortran/43062
+!
+! Run-time test for Fortran 2003 NAMELISTS
+! Version for non-strings
+!
+program nml_test
+ implicit none
+
+ character(len=1000) :: str
+
+ character(len=5), allocatable :: a(:)
+ character(len=5), allocatable :: b
+ character(len=5), pointer :: ap(:)
+ character(len=5), pointer :: bp
+ character(len=5) :: c
+ character(len=5) :: d(3)
+
+ type t
+ character(len=5) :: c1
+ character(len=5) :: c2(3)
+ end type t
+ type(t) :: e,f(2)
+ type(t),allocatable :: g,h(:)
+ type(t),pointer :: i,j(:)
+
+ namelist /nml/ a, b, c, d, ap, bp,e,f,g,h,i,j
+
+ a = ["aa01", "aa02"]
+ allocate(b,ap(2),bp)
+ ap = ['98', '99']
+ b = '7'
+ bp = '101'
+ c = '8'
+ d = ['-1', '-2', '-3']
+
+ e%c1 = '-701'
+ e%c2 = ['-702','-703','-704']
+ f(1)%c1 = '33001'
+ f(2)%c1 = '33002'
+ f(1)%c2 = ['44001','44002','44003']
+ f(2)%c2 = ['44011','44012','44013']
+
+ allocate(g,h(2),i,j(2))
+
+ g%c1 = '-601'
+ g%c2 = ['-602','6703','-604']
+ h(1)%c1 = '35001'
+ h(2)%c1 = '35002'
+ h(1)%c2 = ['45001','45002','45003']
+ h(2)%c2 = ['45011','45012','45013']
+
+ i%c1 = '-501'
+ i%c2 = ['-502','-503','-504']
+ j(1)%c1 = '36001'
+ j(2)%c1 = '36002'
+ j(1)%c2 = ['46001','46002','46003']
+ j(2)%c2 = ['46011','46012','46013']
+
+ ! SAVE NAMELIST
+ str = repeat('X', len(str))
+ write(str,nml=nml)
+
+ ! RESET NAMELIST
+ a = repeat('X', len(a))
+ ap = repeat('X', len(ap))
+ b = repeat('X', len(b))
+ bp = repeat('X', len(bp))
+ c = repeat('X', len(c))
+ d = repeat('X', len(d))
+
+ e%c1 = repeat('X', len(e%c1))
+ e%c2 = repeat('X', len(e%c2))
+ f(1)%c1 = repeat('X', len(f(1)%c1))
+ f(2)%c1 = repeat('X', len(f(2)%c1))
+ f(1)%c2 = repeat('X', len(f(1)%c2))
+ f(2)%c2 = repeat('X', len(f(2)%c2))
+
+ g%c1 = repeat('X', len(g%c1))
+ g%c2 = repeat('X', len(g%c1))
+ h(1)%c1 = repeat('X', len(h(1)%c1))
+ h(2)%c1 = repeat('X', len(h(1)%c1))
+ h(1)%c2 = repeat('X', len(h(1)%c1))
+ h(2)%c2 = repeat('X', len(h(1)%c1))
+
+ i%c1 = repeat('X', len(i%c1))
+ i%c2 = repeat('X', len(i%c1))
+ j(1)%c1 = repeat('X', len(j(1)%c1))
+ j(2)%c1 = repeat('X', len(j(2)%c1))
+ j(1)%c2 = repeat('X', len(j(1)%c2))
+ j(2)%c2 = repeat('X', len(j(2)%c2))
+
+ ! Read back
+ read(str,nml=nml)
+
+ ! Check result
+ if (any (a /= ['aa01','aa02'])) call abort()
+ if (any (ap /= ['98', '99'])) call abort()
+ if (b /= '7') call abort()
+ if (bp /= '101') call abort()
+ if (c /= '8') call abort()
+ if (any (d /= ['-1', '-2', '-3'])) call abort()
+
+ if (e%c1 /= '-701') call abort()
+ if (any (e%c2 /= ['-702','-703','-704'])) call abort()
+ if (f(1)%c1 /= '33001') call abort()
+ if (f(2)%c1 /= '33002') call abort()
+ if (any (f(1)%c2 /= ['44001','44002','44003'])) call abort()
+ if (any (f(2)%c2 /= ['44011','44012','44013'])) call abort()
+
+ if (g%c1 /= '-601') call abort()
+ if (any(g%c2 /= ['-602','6703','-604'])) call abort()
+ if (h(1)%c1 /= '35001') call abort()
+ if (h(2)%c1 /= '35002') call abort()
+ if (any (h(1)%c2 /= ['45001','45002','45003'])) call abort()
+ if (any (h(2)%c2 /= ['45011','45012','45013'])) call abort()
+
+ if (i%c1 /= '-501') call abort()
+ if (any (i%c2 /= ['-502','-503','-504'])) call abort()
+ if (j(1)%c1 /= '36001') call abort()
+ if (j(2)%c1 /= '36002') call abort()
+ if (any (j(1)%c2 /= ['46001','46002','46003'])) call abort()
+ if (any (j(2)%c2 /= ['46011','46012','46013'])) call abort()
+
+ ! Check argument passing (dummy processing)
+ call test2(a,b,c,d,ap,bp,e,f,g,h,i,j,2)
+ call test3(a,b,c,d,ap,bp,e,f,g,h,i,j,2,len(a))
+ call test4(a,b,c,d,ap,bp,e,f,g,h,i,j,2)
+
+contains
+ subroutine test2(x1,x2,x3,x4,x1p,x2p,x6,x7,x8,x9,x10,x11,n)
+ character(len=5), allocatable :: x1(:)
+ character(len=5), allocatable :: x2
+ character(len=5), pointer :: x1p(:)
+ character(len=5), pointer :: x2p
+ character(len=5) :: x3
+ character(len=5) :: x4(3)
+ integer :: n
+ character(len=5) :: x5(n)
+ type(t) :: x6,x7(2)
+ type(t),allocatable :: x8,x9(:)
+ type(t),pointer :: x10,x11(:)
+ type(t) :: x12(n)
+
+ namelist /nml2/ x1, x2, x3, x4,x5,x1p,x2p,x6,x7,x8,x9,x10,x11,x12
+
+ x5 = [ 'x5-42', 'x5-53' ]
+
+ x12(1)%c1 = '37001'
+ x12(2)%c1 = '37002'
+ x12(1)%c2 = ['47001','47002','47003']
+ x12(2)%c2 = ['47011','47012','47013']
+
+ ! SAVE NAMELIST
+ str = repeat('X', len(str))
+ write(str,nml=nml2)
+
+ ! RESET NAMELIST
+ x1 = repeat('X', len(x1))
+ x1p = repeat('X', len(x1p))
+ x2 = repeat('X', len(x2))
+ x2p = repeat('X', len(x2p))
+ x3 = repeat('X', len(x3))
+ x4 = repeat('X', len(x4))
+
+ x6%c1 = repeat('X', len(x6%c1))
+ x6%c2 = repeat('X', len(x6%c2))
+ x7(1)%c1 = repeat('X', len(x7(1)%c1))
+ x7(2)%c1 = repeat('X', len(x7(2)%c1))
+ x7(1)%c2 = repeat('X', len(x7(1)%c2))
+ x7(2)%c2 = repeat('X', len(x7(2)%c2))
+
+ x8%c1 = repeat('X', len(x8%c1))
+ x8%c2 = repeat('X', len(x8%c1))
+ x9(1)%c1 = repeat('X', len(x9(1)%c1))
+ x9(2)%c1 = repeat('X', len(x9(1)%c1))
+ x9(1)%c2 = repeat('X', len(x9(1)%c1))
+ x9(2)%c2 = repeat('X', len(x9(1)%c1))
+
+ x10%c1 = repeat('X', len(x10%c1))
+ x10%c2 = repeat('X', len(x10%c1))
+ x11(1)%c1 = repeat('X', len(x11(1)%c1))
+ x11(2)%c1 = repeat('X', len(x11(2)%c1))
+ x11(1)%c2 = repeat('X', len(x11(1)%c2))
+ x11(2)%c2 = repeat('X', len(x11(2)%c2))
+
+ x5 = repeat('X', len(x5))
+
+ x12(1)%c1 = repeat('X', len(x12(2)%c2))
+ x12(2)%c1 = repeat('X', len(x12(2)%c2))
+ x12(1)%c2 = repeat('X', len(x12(2)%c2))
+ x12(2)%c2 = repeat('X', len(x12(2)%c2))
+
+ ! Read back
+ read(str,nml=nml2)
+
+ ! Check result
+ if (any (x1 /= ['aa01','aa02'])) call abort()
+ if (any (x1p /= ['98', '99'])) call abort()
+ if (x2 /= '7') call abort()
+ if (x2p /= '101') call abort()
+ if (x3 /= '8') call abort()
+ if (any (x4 /= ['-1', '-2', '-3'])) call abort()
+
+ if (x6%c1 /= '-701') call abort()
+ if (any (x6%c2 /= ['-702','-703','-704'])) call abort()
+ if (x7(1)%c1 /= '33001') call abort()
+ if (x7(2)%c1 /= '33002') call abort()
+ if (any (x7(1)%c2 /= ['44001','44002','44003'])) call abort()
+ if (any (x7(2)%c2 /= ['44011','44012','44013'])) call abort()
+
+ if (x8%c1 /= '-601') call abort()
+ if (any(x8%c2 /= ['-602','6703','-604'])) call abort()
+ if (x9(1)%c1 /= '35001') call abort()
+ if (x9(2)%c1 /= '35002') call abort()
+ if (any (x9(1)%c2 /= ['45001','45002','45003'])) call abort()
+ if (any (x9(2)%c2 /= ['45011','45012','45013'])) call abort()
+
+ if (x10%c1 /= '-501') call abort()
+ if (any (x10%c2 /= ['-502','-503','-504'])) call abort()
+ if (x11(1)%c1 /= '36001') call abort()
+ if (x11(2)%c1 /= '36002') call abort()
+ if (any (x11(1)%c2 /= ['46001','46002','46003'])) call abort()
+ if (any (x11(2)%c2 /= ['46011','46012','46013'])) call abort()
+
+ if (any (x5 /= [ 'x5-42', 'x5-53' ])) call abort()
+
+ if (x12(1)%c1 /= '37001') call abort()
+ if (x12(2)%c1 /= '37002') call abort()
+ if (any (x12(1)%c2 /= ['47001','47002','47003'])) call abort()
+ if (any (x12(2)%c2 /= ['47011','47012','47013'])) call abort()
+ end subroutine test2
+
+ subroutine test3(x1,x2,x3,x4,x1p,x2p,x6,x7,x8,x9,x10,x11,n,ll)
+ integer :: n, ll
+ character(len=ll), allocatable :: x1(:)
+ character(len=ll), allocatable :: x2
+ character(len=ll), pointer :: x1p(:)
+ character(len=ll), pointer :: x2p
+ character(len=ll) :: x3
+ character(len=ll) :: x4(3)
+ character(len=ll) :: x5(n)
+ type(t) :: x6,x7(2)
+ type(t),allocatable :: x8,x9(:)
+ type(t),pointer :: x10,x11(:)
+ type(t) :: x12(n)
+
+ namelist /nml2/ x1, x2, x3, x4,x5,x1p,x2p,x6,x7,x8,x9,x10,x11,x12
+
+ x5 = [ 'x5-42', 'x5-53' ]
+
+ x12(1)%c1 = '37001'
+ x12(2)%c1 = '37002'
+ x12(1)%c2 = ['47001','47002','47003']
+ x12(2)%c2 = ['47011','47012','47013']
+
+ ! SAVE NAMELIST
+ str = repeat('X', len(str))
+ write(str,nml=nml2)
+
+ ! RESET NAMELIST
+ x1 = repeat('X', len(x1))
+ x1p = repeat('X', len(x1p))
+
+ x2 = repeat('X', len(x2))
+ x2p = repeat('X', len(x2p))
+ x3 = repeat('X', len(x3))
+ x4 = repeat('X', len(x4))
+
+ x6%c1 = repeat('X', len(x6%c1))
+ x6%c2 = repeat('X', len(x6%c2))
+ x7(1)%c1 = repeat('X', len(x7(1)%c1))
+ x7(2)%c1 = repeat('X', len(x7(2)%c1))
+ x7(1)%c2 = repeat('X', len(x7(1)%c2))
+ x7(2)%c2 = repeat('X', len(x7(2)%c2))
+
+ x8%c1 = repeat('X', len(x8%c1))
+ x8%c2 = repeat('X', len(x8%c1))
+ x9(1)%c1 = repeat('X', len(x9(1)%c1))
+ x9(2)%c1 = repeat('X', len(x9(1)%c1))
+ x9(1)%c2 = repeat('X', len(x9(1)%c1))
+ x9(2)%c2 = repeat('X', len(x9(1)%c1))
+
+ x10%c1 = repeat('X', len(x10%c1))
+ x10%c2 = repeat('X', len(x10%c1))
+ x11(1)%c1 = repeat('X', len(x11(1)%c1))
+ x11(2)%c1 = repeat('X', len(x11(2)%c1))
+ x11(1)%c2 = repeat('X', len(x11(1)%c2))
+ x11(2)%c2 = repeat('X', len(x11(2)%c2))
+
+ x5 = repeat('X', len(x5))
+
+ x12(1)%c1 = repeat('X', len(x12(2)%c2))
+ x12(2)%c1 = repeat('X', len(x12(2)%c2))
+ x12(1)%c2 = repeat('X', len(x12(2)%c2))
+ x12(2)%c2 = repeat('X', len(x12(2)%c2))
+
+ ! Read back
+ read(str,nml=nml2)
+
+ ! Check result
+ if (any (x1 /= ['aa01','aa02'])) call abort()
+ if (any (x1p /= ['98', '99'])) call abort()
+ if (x2 /= '7') call abort()
+ if (x2p /= '101') call abort()
+ if (x3 /= '8') call abort()
+ if (any (x4 /= ['-1', '-2', '-3'])) call abort()
+
+ if (x6%c1 /= '-701') call abort()
+ if (any (x6%c2 /= ['-702','-703','-704'])) call abort()
+ if (x7(1)%c1 /= '33001') call abort()
+ if (x7(2)%c1 /= '33002') call abort()
+ if (any (x7(1)%c2 /= ['44001','44002','44003'])) call abort()
+ if (any (x7(2)%c2 /= ['44011','44012','44013'])) call abort()
+
+ if (x8%c1 /= '-601') call abort()
+ if (any(x8%c2 /= ['-602','6703','-604'])) call abort()
+ if (x9(1)%c1 /= '35001') call abort()
+ if (x9(2)%c1 /= '35002') call abort()
+ if (any (x9(1)%c2 /= ['45001','45002','45003'])) call abort()
+ if (any (x9(2)%c2 /= ['45011','45012','45013'])) call abort()
+
+ if (x10%c1 /= '-501') call abort()
+ if (any (x10%c2 /= ['-502','-503','-504'])) call abort()
+ if (x11(1)%c1 /= '36001') call abort()
+ if (x11(2)%c1 /= '36002') call abort()
+ if (any (x11(1)%c2 /= ['46001','46002','46003'])) call abort()
+ if (any (x11(2)%c2 /= ['46011','46012','46013'])) call abort()
+
+ if (any (x5 /= [ 'x5-42', 'x5-53' ])) call abort()
+
+ if (x12(1)%c1 /= '37001') call abort()
+ if (x12(2)%c1 /= '37002') call abort()
+ if (any (x12(1)%c2 /= ['47001','47002','47003'])) call abort()
+ if (any (x12(2)%c2 /= ['47011','47012','47013'])) call abort()
+ end subroutine test3
+
+ subroutine test4(x1,x2,x3,x4,x1p,x2p,x6,x7,x8,x9,x10,x11,n)
+ character(len=*), allocatable :: x1(:)
+ character(len=*), allocatable :: x2
+ character(len=*), pointer :: x1p(:)
+ character(len=*), pointer :: x2p
+ character(len=*) :: x3
+ character(len=*) :: x4(3)
+ integer :: n
+ character(len=5) :: x5(n)
+ type(t) :: x6,x7(2)
+ type(t),allocatable :: x8,x9(:)
+ type(t),pointer :: x10,x11(:)
+ type(t) :: x12(n)
+
+ namelist /nml2/ x1, x2, x3, x4,x5,x1p,x2p,x6,x7,x8,x9,x10,x11,x12
+
+ x5 = [ 'x5-42', 'x5-53' ]
+
+ x12(1)%c1 = '37001'
+ x12(2)%c1 = '37002'
+ x12(1)%c2 = ['47001','47002','47003']
+ x12(2)%c2 = ['47011','47012','47013']
+
+ ! SAVE NAMELIST
+ str = repeat('X', len(str))
+ write(str,nml=nml2)
+
+ ! RESET NAMELIST
+ x1 = repeat('X', len(x1))
+ x1p = repeat('X', len(x1p))
+ x2 = repeat('X', len(x2))
+ x2p = repeat('X', len(x2p))
+ x3 = repeat('X', len(x3))
+ x4 = repeat('X', len(x4))
+
+ x6%c1 = repeat('X', len(x6%c1))
+ x6%c2 = repeat('X', len(x6%c2))
+ x7(1)%c1 = repeat('X', len(x7(1)%c1))
+ x7(2)%c1 = repeat('X', len(x7(2)%c1))
+ x7(1)%c2 = repeat('X', len(x7(1)%c2))
+ x7(2)%c2 = repeat('X', len(x7(2)%c2))
+
+ x8%c1 = repeat('X', len(x8%c1))
+ x8%c2 = repeat('X', len(x8%c1))
+ x9(1)%c1 = repeat('X', len(x9(1)%c1))
+ x9(2)%c1 = repeat('X', len(x9(1)%c1))
+ x9(1)%c2 = repeat('X', len(x9(1)%c1))
+ x9(2)%c2 = repeat('X', len(x9(1)%c1))
+
+ x10%c1 = repeat('X', len(x10%c1))
+ x10%c2 = repeat('X', len(x10%c1))
+ x11(1)%c1 = repeat('X', len(x11(1)%c1))
+ x11(2)%c1 = repeat('X', len(x11(2)%c1))
+ x11(1)%c2 = repeat('X', len(x11(1)%c2))
+ x11(2)%c2 = repeat('X', len(x11(2)%c2))
+
+ x5 = repeat('X', len(x5))
+
+ x12(1)%c1 = repeat('X', len(x12(2)%c2))
+ x12(2)%c1 = repeat('X', len(x12(2)%c2))
+ x12(1)%c2 = repeat('X', len(x12(2)%c2))
+ x12(2)%c2 = repeat('X', len(x12(2)%c2))
+
+ ! Read back
+ read(str,nml=nml2)
+
+ ! Check result
+ if (any (x1 /= ['aa01','aa02'])) call abort()
+ if (any (x1p /= ['98', '99'])) call abort()
+ if (x2 /= '7') call abort()
+ if (x2p /= '101') call abort()
+ if (x3 /= '8') call abort()
+ if (any (x4 /= ['-1', '-2', '-3'])) call abort()
+
+ if (x6%c1 /= '-701') call abort()
+ if (any (x6%c2 /= ['-702','-703','-704'])) call abort()
+ if (x7(1)%c1 /= '33001') call abort()
+ if (x7(2)%c1 /= '33002') call abort()
+ if (any (x7(1)%c2 /= ['44001','44002','44003'])) call abort()
+ if (any (x7(2)%c2 /= ['44011','44012','44013'])) call abort()
+
+ if (x8%c1 /= '-601') call abort()
+ if (any(x8%c2 /= ['-602','6703','-604'])) call abort()
+ if (x9(1)%c1 /= '35001') call abort()
+ if (x9(2)%c1 /= '35002') call abort()
+ if (any (x9(1)%c2 /= ['45001','45002','45003'])) call abort()
+ if (any (x9(2)%c2 /= ['45011','45012','45013'])) call abort()
+
+ if (x10%c1 /= '-501') call abort()
+ if (any (x10%c2 /= ['-502','-503','-504'])) call abort()
+ if (x11(1)%c1 /= '36001') call abort()
+ if (x11(2)%c1 /= '36002') call abort()
+ if (any (x11(1)%c2 /= ['46001','46002','46003'])) call abort()
+ if (any (x11(2)%c2 /= ['46011','46012','46013'])) call abort()
+
+ if (any (x5 /= [ 'x5-42', 'x5-53' ])) call abort()
+
+ if (x12(1)%c1 /= '37001') call abort()
+ if (x12(2)%c1 /= '37002') call abort()
+ if (any (x12(1)%c2 /= ['47001','47002','47003'])) call abort()
+ if (any (x12(2)%c2 /= ['47011','47012','47013'])) call abort()
+ end subroutine test4
+end program nml_test
diff --git a/gcc/testsuite/gfortran.dg/namelist_assumed_char.f90 b/gcc/testsuite/gfortran.dg/namelist_assumed_char.f90
index 82f423fe353..b7d063c78b0 100644
--- a/gcc/testsuite/gfortran.dg/namelist_assumed_char.f90
+++ b/gcc/testsuite/gfortran.dg/namelist_assumed_char.f90
@@ -1,7 +1,20 @@
! { dg-do compile }
+! { dg-options "-std=f95" }
+
! PR30481 Assumed size character is not allowed in namelist.
! Test case from PR, submitted by Jerry DeLisle <jvdelisle@gcc.gnu.org>
+!
+! Modifications for PR fortran/47339 / PR fortran/43062:
+! Add -std=f95, add bar()
+!
subroutine foo(c)
character*(*) c
- namelist /abc/ c ! { dg-error "Assumed character length" }
+ namelist /abc/ c ! { dg-error "nonconstant character length in namelist" }
end subroutine
+
+subroutine bar(d,n)
+ integer :: n
+ character(len=n) d
+ namelist /abcd/ d ! { dg-error "nonconstant character length in namelist" }
+end subroutine bar
+
diff --git a/gcc/testsuite/gfortran.dg/nan_7.f90 b/gcc/testsuite/gfortran.dg/nan_7.f90
new file mode 100644
index 00000000000..12c7b3ce40f
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/nan_7.f90
@@ -0,0 +1,15 @@
+! { dg-do run }
+! { dg-options "-fno-range-check" }
+! { dg-require-effective-target fortran_real_16 }
+! { dg-require-effective-target fortran_integer_16 }
+! PR47293 NAN not correctly read
+character(len=200) :: str
+real(16) :: r
+integer(16) :: k2
+integer(16), parameter :: quietnan = 170099645085600953110659059745250344960
+r = 1.0
+str = 'NAN' ; read(str,*) r
+k2 = transfer(r,k2)
+k2 = iand(k2, z'fff80000000000000000000000000000')
+if (k2.ne.quietnan) call abort
+end
diff --git a/gcc/testsuite/gfortran.dg/nested_allocatables_1.f90 b/gcc/testsuite/gfortran.dg/nested_allocatables_1.f90
new file mode 100644
index 00000000000..607a883b707
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/nested_allocatables_1.f90
@@ -0,0 +1,28 @@
+! { dg-do run }
+!
+! PR fortran/40850
+! The code freeing allocatable components used to be put after the code
+! freeing the containing entity.
+!
+! Original test case by Marco Restelli <mrestelli@gmail.com>
+! Reduced by Daniel Franke <franke.daniel@gmail.com>
+! and Janus Weil <janus@gcc.gnu.org>
+
+
+ type t
+ integer, allocatable :: d(:)
+ end type
+ type(t), allocatable :: a(:)
+
+ ! Big enough to make it fail
+ allocate(a(2 * 1024))
+ call sub( (/ a /) )
+
+contains
+
+ subroutine sub(b)
+ type(t) :: b(:)
+ end subroutine
+
+end
+
diff --git a/gcc/testsuite/gfortran.dg/pack_assign_1.f90 b/gcc/testsuite/gfortran.dg/pack_assign_1.f90
index 4bab0da940e..7c480fc36c7 100644
--- a/gcc/testsuite/gfortran.dg/pack_assign_1.f90
+++ b/gcc/testsuite/gfortran.dg/pack_assign_1.f90
@@ -1,4 +1,4 @@
-! { dg-do "compile" }
+! { dg-do compile }
! PR32890 - compile-time checks for assigments
INTEGER :: it, neighbrs(42) ! anything but 30
diff --git a/gcc/testsuite/gfortran.dg/pack_vector_1.f90 b/gcc/testsuite/gfortran.dg/pack_vector_1.f90
index ba3624e7ef5..956bb1636d9 100644
--- a/gcc/testsuite/gfortran.dg/pack_vector_1.f90
+++ b/gcc/testsuite/gfortran.dg/pack_vector_1.f90
@@ -1,4 +1,4 @@
-! { dg-do "compile" }
+! { dg-do compile }
!
! Check that the VECTOR argument of the PACK intrinsic has at least
! as many elements as the MASK has .TRUE. values.
diff --git a/gcc/testsuite/gfortran.dg/pointer_check_8.f90 b/gcc/testsuite/gfortran.dg/pointer_check_8.f90
index b47aa972677..99c6652f211 100644
--- a/gcc/testsuite/gfortran.dg/pointer_check_8.f90
+++ b/gcc/testsuite/gfortran.dg/pointer_check_8.f90
@@ -1,4 +1,4 @@
-! { dg-do compile}
+! { dg-do compile }
! { dg-options "-fcheck=pointer" }
!
! PR 46809: [OOP] ICE with -fcheck=pointer for CLASS IS
diff --git a/gcc/testsuite/gfortran.dg/pointer_init_6.f90 b/gcc/testsuite/gfortran.dg/pointer_init_6.f90
new file mode 100644
index 00000000000..92cece3a8ed
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pointer_init_6.f90
@@ -0,0 +1,39 @@
+! { dg-do compile }
+!
+! PR 45290: [F08] pointer initialization
+!
+! Contributed by Janus Weil <janus@gcc.gnu.org>
+
+module m1
+ implicit none
+ type :: t
+ integer, pointer :: p
+ integer :: i
+ end type
+ integer, target :: i
+ type(t), target :: x
+ integer, pointer :: p1 => i
+ integer, pointer :: p2 => p1 ! { dg-error "must have the TARGET attribute" }
+ integer, pointer :: p3 => x%p ! { dg-error "must have the TARGET attribute" }
+ integer, pointer :: p4 => x%i
+end module m1
+
+
+module m2
+
+ type :: t
+ procedure(s), pointer, nopass :: ppc
+ end type
+ type(t) :: x
+ procedure(s), pointer :: pp1 => s
+ procedure(s), pointer :: pp2 => pp1 ! { dg-error "may not be a procedure pointer" }
+ procedure(s), pointer :: pp3 => t%ppc ! { dg-error "Syntax error" }
+
+contains
+
+ subroutine s
+ end subroutine
+
+end module m2
+
+! { dg-final { cleanup-modules "m1 m2" } }
diff --git a/gcc/testsuite/gfortran.dg/pointer_target_4.f90 b/gcc/testsuite/gfortran.dg/pointer_target_4.f90
new file mode 100644
index 00000000000..cda3453d9d8
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pointer_target_4.f90
@@ -0,0 +1,15 @@
+! { dg-do compile }
+!
+! PR fortran/47377
+!
+! Contributed by <thenlich@users.sourceforge.net>
+!
+program testgferr
+ real, pointer :: y
+ y => f() ! { dg-error "must deliver a pointer result" }
+contains
+ function f()
+ real :: f
+ f = 5
+ end function f
+end program testgferr
diff --git a/gcc/testsuite/gfortran.dg/pr25923.f90 b/gcc/testsuite/gfortran.dg/pr25923.f90
index e7f6f6e7004..e0df5b0c81e 100644
--- a/gcc/testsuite/gfortran.dg/pr25923.f90
+++ b/gcc/testsuite/gfortran.dg/pr25923.f90
@@ -10,7 +10,7 @@ implicit none
contains
- function baz(arg) result(res) ! { dg-warning "res.yr' may be" "PR45505" { xfail ilp32 } }
+ function baz(arg) result(res) ! { dg-bogus "res.yr' may be" }
type(bar), intent(in) :: arg
type(bar) :: res
logical, external:: some_func
@@ -19,7 +19,7 @@ contains
else
res = arg
end if
- end function baz ! { dg-bogus "res.yr' may be" "PR45505" { xfail ilp32 } }
+ end function baz ! { dg-warning "res.yr' may be" }
end module foo
diff --git a/gcc/testsuite/gfortran.dg/pr39666-2.f90 b/gcc/testsuite/gfortran.dg/pr39666-2.f90
index 720a716ae31..633d0ba79c5 100644
--- a/gcc/testsuite/gfortran.dg/pr39666-2.f90
+++ b/gcc/testsuite/gfortran.dg/pr39666-2.f90
@@ -2,7 +2,7 @@
! { dg-do compile }
! { dg-options "-O2 -Wuninitialized" }
-FUNCTION f(n) ! { dg-warning "may be used uninitialized" }
+FUNCTION f(n)
INTEGER, INTENT(in) :: n
REAL :: f
@@ -11,4 +11,4 @@ FUNCTION f(n) ! { dg-warning "may be used uninitialized" }
CASE (0); f = 0.0
CASE (2:); f = 1.0
END SELECT
-END FUNCTION
+END FUNCTION ! { dg-warning "may be used uninitialized" }
diff --git a/gcc/testsuite/gfortran.dg/pr47574.f90 b/gcc/testsuite/gfortran.dg/pr47574.f90
new file mode 100644
index 00000000000..65d16863034
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr47574.f90
@@ -0,0 +1,36 @@
+! { dg-do compile }
+! PR 47574 - this used to ICE.
+ SUBROUTINE EXCH2_UV_AGRID_3D_RL( uPhi, vPhi, myNz )
+
+ IMPLICIT NONE
+
+ INTEGER, parameter :: sNx=32, sNy=32, OLx=4, OLy=4
+
+ INTEGER myNz
+ Real(8) uPhi(1-OLx:sNx+OLx,1-OLy:sNy+OLy,myNz,3,1)
+ REAL(8) vPhi(1-OLx:sNx+OLx,1-OLy:sNy+OLy,myNz,3,1)
+
+ INTEGER i,j,k,bi,bj
+ REAL(8) uLoc(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
+ REAL(8) vLoc(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
+ REAL(8) negOne
+
+ negOne = 1.
+ DO k = 1,myNz
+ DO j = 1-OLy,sNy+OLy
+ DO i = 1-OLx,sNx+OLx
+ uLoc(i,j) = uPhi(i,j,k,bi,bj)
+ vLoc(i,j) = vPhi(i,j,k,bi,bj)
+ ENDDO
+ ENDDO
+ DO j = 1-OLy,sNy+OLy
+ DO i = 1,OLx
+ uPhi(1-i,j,k,bi,bj) = vLoc(1-i,j)
+ vPhi(1-i,j,k,bi,bj) = uLoc(1-i,j)*negOne
+ ENDDO
+ ENDDO
+
+ ENDDO
+
+ END
+
diff --git a/gcc/testsuite/gfortran.dg/pr47614.f b/gcc/testsuite/gfortran.dg/pr47614.f
new file mode 100644
index 00000000000..52f14c0c17b
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr47614.f
@@ -0,0 +1,37 @@
+! { dg-do run { target { powerpc*-*-* } } }
+! { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } }
+! { dg-options "-O3 -funroll-loops -ffast-math -mcpu=power4" }
+
+
+ SUBROUTINE SFCPAR(ZET,NZ,ZMH,TSL,TMES)
+ IMPLICIT REAL*8 (A-H, O-Z)
+ REAL*8 ZET(*)
+
+ ZS=MAX(TSL*ZMH,ZET(2))
+
+ DO 10 K=2,NZ
+ KLEV=K-1
+ IF(ZS.LE.ZET(K)) GO TO 20
+ 10 CONTINUE
+
+ 20 CONTINUE
+ TMES=ZET(KLEV+1)
+
+ RETURN
+ END
+
+ program pr47614
+ real*8 ar1(10),d1,d2,d3
+ integer i
+
+ d1 = 2.0
+ d2 = 3.0
+ d3 = 3.0
+ do 50 i=1,10
+ ar1(i) = d1
+ d1 = d1 + 2.0
+ 50 continue
+
+ call sfcpar(ar1,10,d2,d3,d1)
+ if (d1.ne.10.0) call abort()
+ end
diff --git a/gcc/testsuite/gfortran.dg/pr47757-1.f90 b/gcc/testsuite/gfortran.dg/pr47757-1.f90
new file mode 100644
index 00000000000..1c40f987400
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr47757-1.f90
@@ -0,0 +1,40 @@
+! PR libfortran/47757
+! { dg-do run }
+
+ integer(1) :: a1(2,2)
+ integer(2) :: a2(2,2)
+ integer(4) :: a4(2,2)
+ integer(8) :: a8(2,2)
+ logical :: mask(2,2)
+ logical :: mask2
+ a1 = 0
+ a2 = 0
+ a3 = 0
+ a4 = 0
+ mask2 = .true.
+ mask = reshape([.true.,.true.,.false.,.true.],[2,2])
+ print *, iany(a1, dim=1, mask=mask)
+ print *, iany(a2, dim=1, mask=mask)
+ print *, iany(a4, dim=1, mask=mask)
+ print *, iany(a8, dim=1, mask=mask)
+ print *, iall(a1, dim=1, mask=mask)
+ print *, iall(a2, dim=1, mask=mask)
+ print *, iall(a4, dim=1, mask=mask)
+ print *, iall(a8, dim=1, mask=mask)
+ print *, iparity(a1, dim=1, mask=mask)
+ print *, iparity(a2, dim=1, mask=mask)
+ print *, iparity(a4, dim=1, mask=mask)
+ print *, iparity(a8, dim=1, mask=mask)
+ print *, iany(a1, dim=1, mask=mask2)
+ print *, iany(a2, dim=1, mask=mask2)
+ print *, iany(a4, dim=1, mask=mask2)
+ print *, iany(a8, dim=1, mask=mask2)
+ print *, iall(a1, dim=1, mask=mask2)
+ print *, iall(a2, dim=1, mask=mask2)
+ print *, iall(a4, dim=1, mask=mask2)
+ print *, iall(a8, dim=1, mask=mask2)
+ print *, iparity(a1, dim=1, mask=mask2)
+ print *, iparity(a2, dim=1, mask=mask2)
+ print *, iparity(a4, dim=1, mask=mask2)
+ print *, iparity(a8, dim=1, mask=mask2)
+end
diff --git a/gcc/testsuite/gfortran.dg/pr47757-2.f90 b/gcc/testsuite/gfortran.dg/pr47757-2.f90
new file mode 100644
index 00000000000..1f8a08f0b94
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr47757-2.f90
@@ -0,0 +1,16 @@
+! PR libfortran/47757
+! { dg-do run { target fortran_large_int } }
+
+ integer(16) :: a16(2,2)
+ logical :: mask(2,2)
+ logical :: mask2
+ a16 = 0
+ mask2 = .true.
+ mask = reshape([.true.,.true.,.false.,.true.],[2,2])
+ print *, iany(a16, dim=1, mask=mask)
+ print *, iall(a16, dim=1, mask=mask)
+ print *, iparity(a16, dim=1, mask=mask)
+ print *, iany(a16, dim=1, mask=mask2)
+ print *, iall(a16, dim=1, mask=mask2)
+ print *, iparity(a16, dim=1, mask=mask2)
+end
diff --git a/gcc/testsuite/gfortran.dg/pr47757-3.f90 b/gcc/testsuite/gfortran.dg/pr47757-3.f90
new file mode 100644
index 00000000000..9bfad82571d
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr47757-3.f90
@@ -0,0 +1,12 @@
+! PR libfortran/47757
+! { dg-do run { target fortran_large_int } }
+
+ character(kind=4):: str(3,3), s(3)
+ str(1,:) = [4_'A', 4_'b', 4_'C']
+ str(2,:) = [4_'A', 4_'b', 4_'C']
+ str(3,:) = [4_'A', 4_'b', 4_'C']
+ s = 4_'A'
+ print *, cshift(str, shift=2_16, dim=1_16)
+ print *, eoshift(str, shift=2_16, dim=1_16)
+ print *, eoshift(str, shift=2_16, boundary=s, dim=1_16)
+end
diff --git a/gcc/testsuite/gfortran.dg/pr47878.f90 b/gcc/testsuite/gfortran.dg/pr47878.f90
new file mode 100644
index 00000000000..9cc4a086031
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr47878.f90
@@ -0,0 +1,10 @@
+! PR fortran/47878
+! { dg-do run }
+ integer :: a(5)
+ open (99, recl = 40)
+ write (99, '(5i3)') 1, 2, 3
+ rewind (99)
+ read (99, '(5i3)') a
+ if (any (a.ne.(/1, 2, 3, 0, 0/))) call abort
+ close (99, status = 'delete')
+end
diff --git a/gcc/testsuite/gfortran.dg/proc_decl_25.f90 b/gcc/testsuite/gfortran.dg/proc_decl_25.f90
new file mode 100644
index 00000000000..b4559118094
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/proc_decl_25.f90
@@ -0,0 +1,22 @@
+! { dg-do compile }
+!
+! PR 47352: [F03] ICE with proc-pointers in generic procedures
+!
+! Contributed by James van Buskirk
+! cf. http://groups.google.com/group/comp.lang.fortran/browse_thread/thread/bbaf59ffd7c372e9
+
+ implicit none
+
+ abstract interface
+ real function f()
+ end function f
+ end interface
+
+ procedure(f) :: f1
+
+ interface gen
+ procedure f1
+ end interface gen
+
+ write(*,*) gen()
+end
diff --git a/gcc/testsuite/gfortran.dg/proc_ptr_comp_30.f90 b/gcc/testsuite/gfortran.dg/proc_ptr_comp_30.f90
new file mode 100644
index 00000000000..afcc4c73f28
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/proc_ptr_comp_30.f90
@@ -0,0 +1,15 @@
+! { dg-do compile }
+!
+! PR 47768: ICE: printing a derived-type variable with proc-pointer components
+!
+! Contributed by Janus Weil <janus@gcc.gnu.org>
+
+type :: t
+ integer :: i = 3
+ procedure(type(t)), pointer, nopass :: ppc
+end type
+
+type(t) :: x
+
+print *,x ! { dg-error "cannot have procedure pointer components" }
+end
diff --git a/gcc/testsuite/gfortran.dg/product_init_expr.f03 b/gcc/testsuite/gfortran.dg/product_init_expr.f03
index 6724eb719f6..c6ff7e8caf6 100644
--- a/gcc/testsuite/gfortran.dg/product_init_expr.f03
+++ b/gcc/testsuite/gfortran.dg/product_init_expr.f03
@@ -1,4 +1,4 @@
-! { dg-do "run" }
+! { dg-do run }
! { dg-options "-fno-inline" }
!
! PRODUCT as initialization expression.
diff --git a/gcc/testsuite/gfortran.dg/public_private_module.f90 b/gcc/testsuite/gfortran.dg/public_private_module.f90
index ca1ab4891f4..48e78b60cfa 100644
--- a/gcc/testsuite/gfortran.dg/public_private_module.f90
+++ b/gcc/testsuite/gfortran.dg/public_private_module.f90
@@ -8,12 +8,12 @@ end module a
module b
use a
implicit none
- public a ! { dg-warning "attribute applied to" }
+ public a ! { dg-error "attribute applied to" }
end module b
module d
use a
implicit none
- private a ! { dg-warning "attribute applied to" }
+ private a ! { dg-error "attribute applied to" }
end module d
! { dg-final { cleanup-modules "a" } }
diff --git a/gcc/testsuite/gfortran.dg/pure_formal_1.f90 b/gcc/testsuite/gfortran.dg/pure_formal_1.f90
new file mode 100644
index 00000000000..4e62cf9dee6
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pure_formal_1.f90
@@ -0,0 +1,16 @@
+! { dg-do compile }
+!
+! PR fortran/47507
+!
+! PURE procedures: Allow arguments w/o INTENT if they are VALUE
+!
+
+pure function f(x)
+ real, VALUE :: x
+ real :: f
+ f = sin(x)
+end function f
+
+pure subroutine sub(x)
+ real, VALUE :: x
+end subroutine sub
diff --git a/gcc/testsuite/gfortran.dg/pure_formal_2.f90 b/gcc/testsuite/gfortran.dg/pure_formal_2.f90
new file mode 100644
index 00000000000..b3c8a0e0e2c
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pure_formal_2.f90
@@ -0,0 +1,18 @@
+! { dg-do compile }
+! { dg-options "-std=f2003" }
+!
+! PR fortran/47550
+! Follow up to: PR fortran/47507
+!
+! PURE procedures: Allow arguments w/o INTENT if they are VALUE
+!
+
+pure function f(x) ! { dg-error "Fortran 2008: Argument 'x' of pure function" }
+ real, VALUE :: x
+ real :: f
+ f = sin(x)
+end function f
+
+pure subroutine sub(x) ! { dg-error "Fortran 2008: Argument 'x' of pure subroutine" }
+ real, VALUE :: x
+end subroutine sub
diff --git a/gcc/testsuite/gfortran.dg/read_infnan_1.f90 b/gcc/testsuite/gfortran.dg/read_infnan_1.f90
index 515a6900270..c5023e8fe22 100644
--- a/gcc/testsuite/gfortran.dg/read_infnan_1.f90
+++ b/gcc/testsuite/gfortran.dg/read_infnan_1.f90
@@ -22,9 +22,9 @@ read(10,'(7f10.3)') x4
rewind(10)
read(10,'(7f10.3)') x8
write (output, '("x4 =",7G6.0)') x4
-if (output.ne."x4 = +Inf NaN +Inf NaN -Inf NaN +Inf") call abort
+if (output.ne."x4 = Inf NaN Inf NaN -Inf NaN Inf") call abort
write (output, '("x8 =",7G6.0)') x8
-if (output.ne."x8 = +Inf NaN +Inf NaN -Inf NaN +Inf") call abort
+if (output.ne."x8 = Inf NaN Inf NaN -Inf NaN Inf") call abort
!print '("x4 =",7G6.0)', x4
!print '("x8 =",7G6.0)', x8
end program pr43298
diff --git a/gcc/testsuite/gfortran.dg/real_const_3.f90 b/gcc/testsuite/gfortran.dg/real_const_3.f90
index f428750ed0d..9f3f5d837d7 100644
--- a/gcc/testsuite/gfortran.dg/real_const_3.f90
+++ b/gcc/testsuite/gfortran.dg/real_const_3.f90
@@ -16,7 +16,7 @@ program main
b = 1/exp(1000.0)
write(str,*) a
- if (trim(adjustl(str)) .ne. '+Infinity') call abort
+ if (trim(adjustl(str)) .ne. 'Infinity') call abort
if (b .ne. 0.) call abort
@@ -36,7 +36,7 @@ program main
if (trim(adjustl(str)) .ne. '-Infinity') call abort
write(str,*) 3.0/0.
- if (trim(adjustl(str)) .ne. '+Infinity') call abort
+ if (trim(adjustl(str)) .ne. 'Infinity') call abort
write(str,*) nan
if (trim(adjustl(str)) .ne. 'NaN') call abort
@@ -48,7 +48,7 @@ program main
if (trim(adjustl(str)) .ne. '( NaN, NaN)') call abort
write(str,*) z3
- if (trim(adjustl(str)) .ne. '( +Infinity, -Infinity)') call abort
+ if (trim(adjustl(str)) .ne. '( Infinity, -Infinity)') call abort
write(str,*) z4
if (trim(adjustl(str)) .ne. '( 0.0000000 , -0.0000000 )') call abort
diff --git a/gcc/testsuite/gfortran.dg/realloc_on_assign_2.f03 b/gcc/testsuite/gfortran.dg/realloc_on_assign_2.f03
index e3091102697..0564d0d5064 100644
--- a/gcc/testsuite/gfortran.dg/realloc_on_assign_2.f03
+++ b/gcc/testsuite/gfortran.dg/realloc_on_assign_2.f03
@@ -1,4 +1,5 @@
! { dg-do run }
+! { dg-skip-if "Too big for local store" { spu-*-* } { "*" } { "" } }
! Tests the patch that implements F2003 automatic allocation and
! reallocation of allocatable arrays on assignment. The tests
! below were generated in the final stages of the development of
diff --git a/gcc/testsuite/gfortran.dg/realloc_on_assign_3.f03 b/gcc/testsuite/gfortran.dg/realloc_on_assign_3.f03
new file mode 100644
index 00000000000..d975f472705
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/realloc_on_assign_3.f03
@@ -0,0 +1,88 @@
+! { dg-do run }
+! Test (re)allocation on assignment of scalars
+!
+! Contributed by Paul Thomas <pault@gcc.gnu.org>
+!
+ call test_real
+ call test_derived
+ call test_char1
+ call test_char4
+ call test_deferred_char1
+ call test_deferred_char4
+contains
+ subroutine test_real
+ real, allocatable :: x
+ real :: y = 42
+ x = 42.0
+ if (x .ne. y) call abort
+ deallocate (x)
+ x = y
+ if (x .ne. y) call abort
+ end subroutine
+ subroutine test_derived
+ type :: mytype
+ real :: x
+ character(4) :: c
+ end type
+ type (mytype), allocatable :: t
+ t = mytype (99.0, "abcd")
+ if (t%c .ne. "abcd") call abort
+ end subroutine
+ subroutine test_char1
+ character(len = 8), allocatable :: c1
+ character(len = 8) :: c2 = "abcd1234"
+ c1 = "abcd1234"
+ if (c1 .ne. c2) call abort
+ deallocate (c1)
+ c1 = c2
+ if (c1 .ne. c2) call abort
+ end subroutine
+ subroutine test_char4
+ character(len = 8, kind = 4), allocatable :: c1
+ character(len = 8, kind = 4) :: c2 = 4_"abcd1234"
+ c1 = 4_"abcd1234"
+ if (c1 .ne. c2) call abort
+ deallocate (c1)
+ c1 = c2
+ if (c1 .ne. c2) call abort
+ end subroutine
+ subroutine test_deferred_char1
+ character(:), allocatable :: c
+ c = "Hello"
+ if (c .ne. "Hello") call abort
+ if (len(c) .ne. 5) call abort
+ c = "Goodbye"
+ if (c .ne. "Goodbye") call abort
+ if (len(c) .ne. 7) call abort
+! Check that the hidden LEN dummy is passed by reference
+ call test_pass_c1 (c)
+ if (c .ne. "Made in test!") print *, c
+ if (len(c) .ne. 13) call abort
+ end subroutine
+ subroutine test_pass_c1 (carg)
+ character(:), allocatable :: carg
+ if (carg .ne. "Goodbye") call abort
+ if (len(carg) .ne. 7) call abort
+ carg = "Made in test!"
+ end subroutine
+ subroutine test_deferred_char4
+ character(:, kind = 4), allocatable :: c
+ c = 4_"Hello"
+ if (c .ne. 4_"Hello") call abort
+ if (len(c) .ne. 5) call abort
+ c = 4_"Goodbye"
+ if (c .ne. 4_"Goodbye") call abort
+ if (len(c) .ne. 7) call abort
+! Check that the hidden LEN dummy is passed by reference
+ call test_pass_c4 (c)
+ if (c .ne. 4_"Made in test!") print *, c
+ if (len(c) .ne. 13) call abort
+ end subroutine
+ subroutine test_pass_c4 (carg)
+ character(:, kind = 4), allocatable :: carg
+ if (carg .ne. 4_"Goodbye") call abort
+ if (len(carg) .ne. 7) call abort
+ carg = 4_"Made in test!"
+ end subroutine
+end
+
diff --git a/gcc/testsuite/gfortran.dg/realloc_on_assign_4.f03 b/gcc/testsuite/gfortran.dg/realloc_on_assign_4.f03
new file mode 100644
index 00000000000..a71f5d59bd1
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/realloc_on_assign_4.f03
@@ -0,0 +1,50 @@
+! { dg-do run }
+! Tests function return of deferred length scalars.
+!
+! Contributed by Paul Thomas <pault@gcc.gnu.org>
+!
+module m
+contains
+ function mfoo (carg) result(res)
+ character (:), allocatable :: res
+ character (*) :: carg
+ res = carg(2:4)
+ end function
+ function mbar (carg)
+ character (:), allocatable :: mbar
+ character (*) :: carg
+ mbar = carg(2:13)
+ end function
+end module
+
+ use m
+ character (:), allocatable :: lhs
+ lhs = foo ("foo calling ")
+ if (lhs .ne. "foo") call abort
+ if (len (lhs) .ne. 3) call abort
+ deallocate (lhs)
+ lhs = bar ("bar calling - baaaa!")
+ if (lhs .ne. "bar calling") call abort
+ if (len (lhs) .ne. 12) call abort
+ deallocate (lhs)
+ lhs = mfoo ("mfoo calling ")
+ if (lhs .ne. "foo") call abort
+ if (len (lhs) .ne. 3) call abort
+ deallocate (lhs)
+ lhs = mbar ("mbar calling - baaaa!")
+ if (lhs .ne. "bar calling") call abort
+ if (len (lhs) .ne. 12) call abort
+contains
+ function foo (carg) result(res)
+ character (:), allocatable :: res
+ character (*) :: carg
+ res = carg(1:3)
+ end function
+ function bar (carg)
+ character (:), allocatable :: bar
+ character (*) :: carg
+ bar = carg(1:12)
+ end function
+end
+
+
diff --git a/gcc/testsuite/gfortran.dg/realloc_on_assign_5.f03 b/gcc/testsuite/gfortran.dg/realloc_on_assign_5.f03
new file mode 100644
index 00000000000..db4233d5f77
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/realloc_on_assign_5.f03
@@ -0,0 +1,18 @@
+! { dg-do run }
+! Test the fix for PR47523 in which concatenations did not work
+! correctly with assignments to deferred character length scalars.
+!
+! Contributed by Thomas Koenig <tkoenig@gcc.gnu.org>
+!
+program main
+ implicit none
+ character(:), allocatable :: a, b
+ a = 'a'
+ if (a .ne. 'a') call abort
+ a = a // 'x'
+ if (a .ne. 'ax') call abort
+ if (len (a) .ne. 2) call abort
+ a = (a(2:2))
+ if (a .ne. 'x') call abort
+ if (len (a) .ne. 1) call abort
+end program main
diff --git a/gcc/testsuite/gfortran.dg/redefined_intrinsic_assignment_2.f90 b/gcc/testsuite/gfortran.dg/redefined_intrinsic_assignment_2.f90
new file mode 100644
index 00000000000..ba70902091e
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/redefined_intrinsic_assignment_2.f90
@@ -0,0 +1,68 @@
+! { dg-do compile }
+!
+! PR fortran/47448
+!
+! ASSIGNMENT(=) checks. Defined assignment is allowed if and only if
+! it does not override an intrinsic assignment.
+!
+
+module test1
+ interface assignment(=)
+ module procedure valid, valid2
+ end interface
+contains
+ ! Valid: scalar = array
+ subroutine valid (lhs,rhs)
+ integer, intent(out) :: lhs
+ integer, intent(in) :: rhs(:)
+ lhs = rhs(1)
+ end subroutine valid
+
+ ! Valid: array of different ranks
+ subroutine valid2 (lhs,rhs)
+ integer, intent(out) :: lhs(:)
+ integer, intent(in) :: rhs(:,:)
+ lhs(:) = rhs(:,1)
+ end subroutine valid2
+end module test1
+
+module test2
+ interface assignment(=)
+ module procedure invalid
+ end interface
+contains
+ ! Invalid: scalar = scalar
+ subroutine invalid (lhs,rhs) ! { dg-error "must not redefine an INTRINSIC type assignment" }
+ integer, intent(out) :: lhs
+ integer, intent(in) :: rhs
+ lhs = rhs
+ end subroutine invalid
+end module test2
+
+module test3
+ interface assignment(=)
+ module procedure invalid2
+ end interface
+contains
+ ! Invalid: array = scalar
+ subroutine invalid2 (lhs,rhs) ! { dg-error "must not redefine an INTRINSIC type assignment" }
+ integer, intent(out) :: lhs(:)
+ integer, intent(in) :: rhs
+ lhs(:) = rhs
+ end subroutine invalid2
+end module test3
+
+module test4
+ interface assignment(=)
+ module procedure invalid3
+ end interface
+contains
+ ! Invalid: array = array for same rank
+ subroutine invalid3 (lhs,rhs) ! { dg-error "must not redefine an INTRINSIC type assignment" }
+ integer, intent(out) :: lhs(:)
+ integer, intent(in) :: rhs(:)
+ lhs(:) = rhs(:)
+ end subroutine invalid3
+end module test4
+
+! { dg-final { cleanup-modules "test1" } }
diff --git a/gcc/testsuite/gfortran.dg/reshape_order_5.f90 b/gcc/testsuite/gfortran.dg/reshape_order_5.f90
index 9c76b88839f..2ef5fce6db8 100644
--- a/gcc/testsuite/gfortran.dg/reshape_order_5.f90
+++ b/gcc/testsuite/gfortran.dg/reshape_order_5.f90
@@ -1,4 +1,4 @@
-! { dg-do "compile" }
+! { dg-do compile }
!
! PR fortran/37203 - check RESHAPE arguments
!
diff --git a/gcc/testsuite/gfortran.dg/reshape_shape_1.f90 b/gcc/testsuite/gfortran.dg/reshape_shape_1.f90
index 008c9a8e5c1..bd5e3cb405c 100644
--- a/gcc/testsuite/gfortran.dg/reshape_shape_1.f90
+++ b/gcc/testsuite/gfortran.dg/reshape_shape_1.f90
@@ -1,4 +1,4 @@
-! { dg-do "compile" }
+! { dg-do compile }
!
! PR fortran/37203 - check RESHAPE arguments
!
diff --git a/gcc/testsuite/gfortran.dg/reshape_zerosize_2.f90 b/gcc/testsuite/gfortran.dg/reshape_zerosize_2.f90
index cdbee42aa6c..474ea300d1c 100644
--- a/gcc/testsuite/gfortran.dg/reshape_zerosize_2.f90
+++ b/gcc/testsuite/gfortran.dg/reshape_zerosize_2.f90
@@ -1,4 +1,4 @@
-! { dg-do "run" }
+! { dg-do run }
! Simplifier of RESHAPE was broken when reshaping an empty array.
INTEGER, PARAMETER :: empty(0,0) = RESHAPE(SHAPE(1), (/0, 0/))
diff --git a/gcc/testsuite/gfortran.dg/same_name_2.f90 b/gcc/testsuite/gfortran.dg/same_name_2.f90
index 948ff757bae..c8da3e1dbbf 100644
--- a/gcc/testsuite/gfortran.dg/same_name_2.f90
+++ b/gcc/testsuite/gfortran.dg/same_name_2.f90
@@ -1,4 +1,4 @@
-! ( dg-do compile }
+! { dg-do compile }
! Tests the fix for PR27701, in which two same name procedures
! were not diagnosed if they had no arguments.
!
diff --git a/gcc/testsuite/gfortran.dg/select_type_22.f03 b/gcc/testsuite/gfortran.dg/select_type_22.f03
new file mode 100644
index 00000000000..68d2ff6a169
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/select_type_22.f03
@@ -0,0 +1,17 @@
+! { dg-do compile }
+!
+! PR 47330: [OOP] ICE on invalid source in connection with SELECT TYPE
+!
+! Contributed by Andrew Benson <abenson@its.caltech.edu>
+
+ type treeNode
+ end type
+contains
+ subroutine proc1 (thisNode)
+ class (treeNode), target :: thisNode
+ select type (thisNode)
+ type is (treeNode)
+ workNode => thisNode ! { dg-error "Non-POINTER in pointer association context" }
+ end select
+ end subroutine
+end
diff --git a/gcc/testsuite/gfortran.dg/selected_real_kind_1.f90 b/gcc/testsuite/gfortran.dg/selected_real_kind_1.f90
index 0f40a595d2f..f771f9a2ea6 100644
--- a/gcc/testsuite/gfortran.dg/selected_real_kind_1.f90
+++ b/gcc/testsuite/gfortran.dg/selected_real_kind_1.f90
@@ -1,4 +1,4 @@
-! { dg-do "compile" }
+! { dg-do compile }
!
! PR fortran/44347 - arguments of SELECTED_REAL_KIND shall be scalar
! Testcase contributed by Vittorio Zecca <zeccav AT gmail DOT com>
diff --git a/gcc/testsuite/gfortran.dg/shape_6.f90 b/gcc/testsuite/gfortran.dg/shape_6.f90
new file mode 100644
index 00000000000..d68f7bef58a
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/shape_6.f90
@@ -0,0 +1,29 @@
+! { dg-do compile }
+!
+! PR fortran/47531
+!
+! Contributed by James Van Buskirk
+!
+! Check for the presence of the optional kind= argument
+! of F2003.
+!
+
+program bug1
+ use ISO_C_BINDING
+ implicit none
+ real,allocatable :: weevil(:,:)
+
+ write(*,*) achar(64,C_CHAR)
+ write(*,*) char(64,C_CHAR)
+ write(*,*) iachar('A',C_INTPTR_T)
+ write(*,*) ichar('A',C_INTPTR_T)
+ write(*,*) len('A',C_INTPTR_T)
+ write(*,*) len_trim('A',C_INTPTR_T)
+ allocate(weevil(2,2))
+ weevil = 42
+ write(*,*) ceiling(weevil,C_INTPTR_T)
+ write(*,*) floor(weevil,C_INTPTR_T)
+ write(*,*) shape(weevil,C_INTPTR_T)
+ write(*,*) storage_size(weevil,C_INTPTR_T)
+end program bug1
+
diff --git a/gcc/testsuite/gfortran.dg/spread_init_expr.f03 b/gcc/testsuite/gfortran.dg/spread_init_expr.f03
index a8bdc5e19ee..05714f623ed 100644
--- a/gcc/testsuite/gfortran.dg/spread_init_expr.f03
+++ b/gcc/testsuite/gfortran.dg/spread_init_expr.f03
@@ -1,4 +1,4 @@
-! { dg-do "run" }
+! { dg-do run }
INTEGER, PARAMETER :: n = 5
INTEGER, PARAMETER :: a1(n) = SPREAD(1, 1, n)
diff --git a/gcc/testsuite/gfortran.dg/stmt_func_1.f90 b/gcc/testsuite/gfortran.dg/stmt_func_1.f90
new file mode 100644
index 00000000000..472d7d78c6a
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/stmt_func_1.f90
@@ -0,0 +1,12 @@
+! { dg-do compile }
+! { dg-options "" }
+!
+! PR fortran/47542
+!
+integer, target, save :: tgt = 77
+integer, pointer ::ptr_stmt ! { dg-error "Statement function .ptr_stmt. at .1. may not have pointer or allocatable attribute" }
+integer, allocatable :: alloc_stmt ! { dg-error "Statement function .alloc_stmt. at .1. may not have pointer or allocatable attribute" }
+
+ptr_stmt() = tgt
+alloc_stmt() = 78
+end
diff --git a/gcc/testsuite/gfortran.dg/sum_init_expr.f03 b/gcc/testsuite/gfortran.dg/sum_init_expr.f03
index fc9701ce86d..f0cfe958b51 100644
--- a/gcc/testsuite/gfortran.dg/sum_init_expr.f03
+++ b/gcc/testsuite/gfortran.dg/sum_init_expr.f03
@@ -1,4 +1,4 @@
-! { dg-do "run" }
+! { dg-do run }
! { dg-options "-fno-inline" }
!
! SUM as initialization expression.
@@ -52,14 +52,14 @@ CONTAINS
SUBROUTINE rlib (array, result)
REAL, DIMENSION(:,:), INTENT(in) :: array
REAL, INTENT(in) :: result
- IF (ABS(SUM(array) - result) > 2e-6) CALL abort()
+ IF (ABS(SUM(array) - result) > 4e-6) CALL abort()
END SUBROUTINE
SUBROUTINE rlib_with_dim (array, dim, result)
REAL, DIMENSION(:,:), INTENT(in) :: array
INTEGER, INTENT(iN) :: dim
REAL, DIMENSION(:), INTENT(in) :: result
- IF (ANY (ABS(SUM (array, dim=dim) - result) > 2e-6)) CALL abort()
+ IF (ANY (ABS(SUM (array, dim=dim) - result) > 4e-6)) CALL abort()
END SUBROUTINE
END
diff --git a/gcc/testsuite/gfortran.dg/transpose_3.f03 b/gcc/testsuite/gfortran.dg/transpose_3.f03
index b24516604c9..269db491d86 100644
--- a/gcc/testsuite/gfortran.dg/transpose_3.f03
+++ b/gcc/testsuite/gfortran.dg/transpose_3.f03
@@ -1,4 +1,4 @@
-! { dg-do "run" }
+! { dg-do run }
! Transformational intrinsic TRANSPOSE as initialization expression.
INTEGER, PARAMETER :: n = 10
diff --git a/gcc/testsuite/gfortran.dg/transpose_optimization_2.f90 b/gcc/testsuite/gfortran.dg/transpose_optimization_2.f90
index 08923329ff4..ba03374078b 100644
--- a/gcc/testsuite/gfortran.dg/transpose_optimization_2.f90
+++ b/gcc/testsuite/gfortran.dg/transpose_optimization_2.f90
@@ -62,4 +62,5 @@ end
!
! { dg-final { scan-tree-dump-times "parm" 66 "original" } }
! { dg-final { scan-tree-dump-times "atmp" 12 "original" } }
+! { dg-final { cleanup-tree-dump "original" } }
! { dg-final { cleanup-modules "mod" } }
diff --git a/gcc/testsuite/gfortran.dg/typebound_assignment_1.f03 b/gcc/testsuite/gfortran.dg/typebound_assignment_1.f03
new file mode 100644
index 00000000000..359572b0a51
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/typebound_assignment_1.f03
@@ -0,0 +1,35 @@
+! { dg-do compile }
+!
+! PR 47463: [OOP] ICE in gfc_add_component_ref
+!
+! Contributed by Rich Townsend <townsend@astro.wisc.edu>
+
+module hydro_state
+ type :: state_t
+ contains
+ procedure :: assign
+ generic :: assignment(=) => assign
+ end type state_t
+contains
+ subroutine assign (this, that)
+ class(state_t), intent(inout) :: this
+ class(state_t), intent(in) :: that
+ end subroutine assign
+end module hydro_state
+
+module hydro_flow
+ use hydro_state
+ type :: flow_t
+ class(state_t), allocatable :: st
+ end type flow_t
+contains
+ subroutine init_comps (this, st)
+ class(flow_t), intent(out) :: this
+ class(state_t), intent(in) :: st
+
+ allocate(state_t :: this%st)
+ this%st = st
+ end subroutine init_comps
+end module hydro_flow
+
+! { dg-final { cleanup-modules "hydro_state hydro_flow" } }
diff --git a/gcc/testsuite/gfortran.dg/typebound_assignment_2.f03 b/gcc/testsuite/gfortran.dg/typebound_assignment_2.f03
new file mode 100644
index 00000000000..862535a8652
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/typebound_assignment_2.f03
@@ -0,0 +1,39 @@
+! { dg-do compile }
+!
+! PR 47463: [OOP] ICE in gfc_add_component_ref
+!
+! Contributed by Rich Townsend <townsend@astro.wisc.edu>
+
+module hydro_grid
+ type :: grid_t
+ contains
+ procedure :: assign
+ generic :: assignment(=) => assign
+ end type grid_t
+ public :: grid_t
+contains
+ subroutine assign (this, that)
+ class(grid_t), intent(inout) :: this
+ class(grid_t), intent(in) :: that
+ end subroutine assign
+end module hydro_grid
+
+module hydro_flow
+ use hydro_grid
+ type :: flow_t
+ class(grid_t), allocatable :: gr
+ end type flow_t
+contains
+ subroutine init_params (this)
+ class(flow_t), intent(out) :: this
+ type(grid_t) :: gr
+ call init_comps(this, gr)
+ end subroutine init_params
+ subroutine init_comps (this, gr)
+ class(flow_t), intent(out) :: this
+ class(grid_t), intent(in) :: gr
+ this%gr = gr
+ end subroutine init_comps
+end module hydro_flow
+
+! { dg-final { cleanup-modules "hydro_grid hydro_flow" } }
diff --git a/gcc/testsuite/gfortran.dg/typebound_call_19.f03 b/gcc/testsuite/gfortran.dg/typebound_call_19.f03
new file mode 100644
index 00000000000..95b272a80ab
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/typebound_call_19.f03
@@ -0,0 +1,51 @@
+! { dg-do run }
+!
+! PR 47455: [4.6 Regression][OOP] internal compiler error: in fold_convert_loc, at fold-const.c:2028
+!
+! Contributed by Thomas Henlich <thenlich@users.sourceforge.net>
+
+module class_t
+ type :: tx
+ integer :: i
+ end type
+ type :: t
+ type(tx) :: x
+ procedure(find_x), pointer :: ppc
+ contains
+ procedure :: find_x
+ end type
+ type(tx), target :: zero = tx(0)
+contains
+ function find_x(this)
+ class(t), intent(in) :: this
+ type(tx), pointer :: find_x
+ find_x => zero
+ end function find_x
+end module
+
+program test
+ use class_t
+ class(t),allocatable :: this
+ procedure(find_x), pointer :: pp
+ allocate(this)
+ ! (1) ordinary function call
+ zero = tx(1)
+ this%x = find_x(this)
+ if (this%x%i /= 1) call abort()
+ ! (2) procedure pointer
+ zero = tx(2)
+ pp => find_x
+ this%x = pp(this)
+ if (this%x%i /= 2) call abort()
+ ! (3) PPC
+ zero = tx(3)
+ this%ppc => find_x
+ this%x = this%ppc()
+ if (this%x%i /= 3) call abort()
+ ! (4) TBP
+ zero = tx(4)
+ this%x = this%find_x()
+ if (this%x%i /= 4) call abort()
+end
+
+! { dg-final { cleanup-modules "class_t" } }
diff --git a/gcc/testsuite/gfortran.dg/typebound_call_20.f03 b/gcc/testsuite/gfortran.dg/typebound_call_20.f03
new file mode 100644
index 00000000000..61eee5ba004
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/typebound_call_20.f03
@@ -0,0 +1,41 @@
+! { dg-do run }
+!
+! PR 47565: [4.6 Regression][OOP] Segfault with TBP
+!
+! Contributed by Tobias Burnus <burnus@gcc.gnu.org>
+
+module class_t
+ type :: t
+ procedure(find_y), pointer, nopass :: ppc
+ contains
+ procedure, nopass :: find_y
+ end type
+ integer, private :: count = 0
+contains
+ function find_y() result(res)
+ integer, allocatable :: res
+ allocate(res)
+ count = count + 1
+ res = count
+ end function
+end module
+
+program p
+ use class_t
+ class(t), allocatable :: this
+ integer :: y
+
+ allocate(this)
+ this%ppc => find_y
+ ! (1) ordinary procedure
+ y = find_y()
+ if (y/=1) call abort()
+ ! (2) procedure pointer component
+ y = this%ppc()
+ if (y/=2) call abort()
+ ! (3) type-bound procedure
+ y = this%find_y()
+ if (y/=3) call abort()
+end
+
+! { dg-final { cleanup-modules "class_t" } }
diff --git a/gcc/testsuite/gfortran.dg/typebound_proc_13.f03 b/gcc/testsuite/gfortran.dg/typebound_proc_13.f03
index 3f978f28b45..62054b6fa3f 100644
--- a/gcc/testsuite/gfortran.dg/typebound_proc_13.f03
+++ b/gcc/testsuite/gfortran.dg/typebound_proc_13.f03
@@ -16,7 +16,8 @@ MODULE m
TYPE t2
CONTAINS
- PROCEDURE, PASS :: nonscalar ! { dg-error "must be scalar" }
+! FIXME: uncomment and dejagnuify once class arrays are enabled
+! PROCEDURE, PASS :: nonscalar ! { "must be scalar" }
PROCEDURE, PASS :: is_pointer ! { dg-error "must not be POINTER" }
PROCEDURE, PASS :: is_allocatable ! { dg-error "must not be ALLOCATABLE" }
END TYPE t2
@@ -26,9 +27,9 @@ CONTAINS
SUBROUTINE myproc ()
END SUBROUTINE myproc
- SUBROUTINE nonscalar (me)
- CLASS(t2), INTENT(IN) :: me(:)
- END SUBROUTINE nonscalar
+! SUBROUTINE nonscalar (me)
+! CLASS(t2), INTENT(IN) :: me(:)
+! END SUBROUTINE nonscalar
SUBROUTINE is_pointer (me)
CLASS(t2), POINTER, INTENT(IN) :: me
diff --git a/gcc/testsuite/gfortran.dg/typebound_proc_19.f90 b/gcc/testsuite/gfortran.dg/typebound_proc_19.f90
new file mode 100644
index 00000000000..be15bf09fc3
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/typebound_proc_19.f90
@@ -0,0 +1,43 @@
+! { dg-do compile }
+!
+! PR fortran/47399
+!
+! Contributed by Wolfgang Kilian.
+!
+
+module mytypes
+ implicit none
+ private
+ public :: mytype, get_i
+
+ integer, save :: i_priv = 13
+ type :: mytype
+ integer :: dummy
+ contains
+ procedure, nopass :: i => get_i
+ end type mytype
+ contains
+ pure function get_i () result (i)
+ integer :: i
+ i = i_priv
+ end function get_i
+end module mytypes
+
+subroutine test()
+ use mytypes
+ implicit none
+
+ type(mytype) :: a
+ type(mytype), parameter :: a_const = mytype (0)
+ integer, dimension (get_i()) :: x ! #1
+ integer, dimension (a%i()) :: y ! #2
+ integer, dimension (a_const%i()) :: z ! #3
+
+ if (size (x) /= 13 .or. size(y) /= 13 .or. size(z) /= 13) call abort()
+! print *, size (x), size(y), size(z)
+end subroutine test
+
+call test()
+end
+
+! { dg-final { cleanup-modules "mytypes" } }
diff --git a/gcc/testsuite/gfortran.dg/typebound_proc_20.f90 b/gcc/testsuite/gfortran.dg/typebound_proc_20.f90
new file mode 100644
index 00000000000..4fee2f3bab2
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/typebound_proc_20.f90
@@ -0,0 +1,68 @@
+! { dg-do compile }
+! TODO: make runtime testcase once bug is fixed
+!
+! PR fortran/47455
+!
+! Based on an example by Thomas Henlich
+!
+
+module class_t
+ type :: tx
+ integer, dimension(:), allocatable :: i
+ end type tx
+ type :: t
+ type(tx), pointer :: x
+ type(tx) :: y
+ contains
+ procedure :: calc
+ procedure :: find_x
+ procedure :: find_y
+ end type t
+contains
+ subroutine calc(this)
+ class(t), target :: this
+ type(tx), target :: that
+ that%i = [1,2]
+ this%x => this%find_x(that, .true.)
+ if (associated (this%x)) call abort()
+ this%x => this%find_x(that, .false.)
+ if(any (this%x%i /= [5, 7])) call abort()
+ if (.not.associated (this%x,that)) call abort()
+ allocate(this%x)
+ if (associated (this%x,that)) call abort()
+ if (allocated(this%x%i)) call abort()
+ this%x = this%find_x(that, .false.)
+ that%i = [3,4]
+ if(any (this%x%i /= [5, 7])) call abort() ! FAILS
+
+ if (allocated (this%y%i)) call abort()
+ this%y = this%find_y() ! FAILS
+ if (.not.allocated (this%y%i)) call abort()
+ if(any (this%y%i /= [6, 8])) call abort()
+ end subroutine calc
+ function find_x(this, that, l_null)
+ class(t), intent(in) :: this
+ type(tx), target :: that
+ type(tx), pointer :: find_x
+ logical :: l_null
+ if (l_null) then
+ find_x => null()
+ else
+ find_x => that
+ that%i = [5, 7]
+ end if
+ end function find_x
+ function find_y(this) result(res)
+ class(t), intent(in) :: this
+ type(tx), allocatable :: res
+ allocate(res)
+ res%i = [6, 8]
+ end function find_y
+end module class_t
+
+use class_t
+type(t) :: x
+call x%calc()
+end
+
+! { dg-final { cleanup-modules "class_t" } }
diff --git a/gcc/testsuite/gfortran.dg/typebound_proc_21.f90 b/gcc/testsuite/gfortran.dg/typebound_proc_21.f90
new file mode 100644
index 00000000000..6c16d46ff2c
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/typebound_proc_21.f90
@@ -0,0 +1,27 @@
+! { dg-do compile }
+!
+! PR fortran/47455
+!
+module class_t
+ type :: tx
+ integer, dimension(:), allocatable :: i
+ end type tx
+ type :: t
+ type(tx), pointer :: x
+ contains
+ procedure :: calc
+ procedure :: find_x
+ end type t
+contains
+ subroutine calc(this)
+ class(t), target :: this
+ this%x = this%find_x()
+ end subroutine calc
+ function find_x(this)
+ class(t), intent(in) :: this
+ type(tx), pointer :: find_x
+ find_x => null()
+ end function find_x
+end module class_t
+
+! { dg-final { cleanup-modules "class_t" } }
diff --git a/gcc/testsuite/gfortran.dg/unpack_init_expr.f03 b/gcc/testsuite/gfortran.dg/unpack_init_expr.f03
index 78460d19a63..924694cadaf 100644
--- a/gcc/testsuite/gfortran.dg/unpack_init_expr.f03
+++ b/gcc/testsuite/gfortran.dg/unpack_init_expr.f03
@@ -1,4 +1,4 @@
-! { dg-do "run" }
+! { dg-do run }
!
! Example from F2003, sec 13.7.125
!
diff --git a/gcc/testsuite/gfortran.dg/vect/fast-math-pr38968.f90 b/gcc/testsuite/gfortran.dg/vect/fast-math-pr38968.f90
index e009f7105e1..bfad470f1a7 100644
--- a/gcc/testsuite/gfortran.dg/vect/fast-math-pr38968.f90
+++ b/gcc/testsuite/gfortran.dg/vect/fast-math-pr38968.f90
@@ -2,6 +2,8 @@
! to handle complex types. This test is very slow on these platforms so
! skipping is better then running it unvectorized.
! { dg-skip-if "" { ia64-*-* sparc*-*-* } { "*" } { "" } }
+! It can be slow on some x86 CPUs.
+! { dg-timeout-factor 2 }
program mymatmul
implicit none
integer, parameter :: kp = 4
diff --git a/gcc/testsuite/gfortran.dg/vect/fast-math-vect-8.f90 b/gcc/testsuite/gfortran.dg/vect/fast-math-vect-8.f90
index 918943f93a9..26d850de961 100644
--- a/gcc/testsuite/gfortran.dg/vect/fast-math-vect-8.f90
+++ b/gcc/testsuite/gfortran.dg/vect/fast-math-vect-8.f90
@@ -89,5 +89,6 @@ contains
end module solv_cap
-! { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } }
+
+! { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_intfloat_cvt } } }
! { dg-final { cleanup-tree-dump "vect" } }
diff --git a/gcc/testsuite/gfortran.dg/volatile3.f90 b/gcc/testsuite/gfortran.dg/volatile3.f90
index 966272eecd2..f9f720262fb 100644
--- a/gcc/testsuite/gfortran.dg/volatile3.f90
+++ b/gcc/testsuite/gfortran.dg/volatile3.f90
@@ -11,7 +11,7 @@ program volatile_test
real :: l,m
real,volatile :: n
real, volatile,volatile :: r = 3. ! { dg-error "Duplicate VOLATILE attribute" }
- volatile :: l,n ! { dg-error "Duplicate VOLATILE attribute" }
+ volatile :: l,n ! { dg-warning "Duplicate VOLATILE attribute" }
volatile ! { dg-error "Syntax error in VOLATILE statement" }
volatile :: volatile_test ! { dg-error "PROGRAM attribute conflicts with VOLATILE attribute" }
l = 4.0
diff --git a/gcc/testsuite/gfortran.dg/warn_conversion.f90 b/gcc/testsuite/gfortran.dg/warn_conversion.f90
index c8f0e23e2ff..e9b7e396e4f 100644
--- a/gcc/testsuite/gfortran.dg/warn_conversion.f90
+++ b/gcc/testsuite/gfortran.dg/warn_conversion.f90
@@ -1,4 +1,4 @@
-! { dg-do "compile" }
+! { dg-do compile }
! { dg-options "-Wconversion" }
!
diff --git a/gcc/testsuite/gfortran.dg/warn_conversion_2.f90 b/gcc/testsuite/gfortran.dg/warn_conversion_2.f90
index c0222983a0f..d2b4eec6049 100644
--- a/gcc/testsuite/gfortran.dg/warn_conversion_2.f90
+++ b/gcc/testsuite/gfortran.dg/warn_conversion_2.f90
@@ -1,4 +1,4 @@
-! { dg-do "compile" }
+! { dg-do compile }
! { dg-options "-Wconversion-extra" }
real(8) :: sqrt2
diff --git a/gcc/testsuite/gfortran.dg/warn_intent_out_not_set.f90 b/gcc/testsuite/gfortran.dg/warn_intent_out_not_set.f90
index 52b23154c3c..76c62eaec34 100644
--- a/gcc/testsuite/gfortran.dg/warn_intent_out_not_set.f90
+++ b/gcc/testsuite/gfortran.dg/warn_intent_out_not_set.f90
@@ -1,4 +1,4 @@
-! { dg-do "compile" }
+! { dg-do compile }
! { dg-options "-c -Wall" }
!
! PR fortran/42360
diff --git a/gcc/testsuite/gfortran.dg/warn_unused_dummy_argument_1.f90 b/gcc/testsuite/gfortran.dg/warn_unused_dummy_argument_1.f90
index 94e74c93628..66b0f1a5833 100644
--- a/gcc/testsuite/gfortran.dg/warn_unused_dummy_argument_1.f90
+++ b/gcc/testsuite/gfortran.dg/warn_unused_dummy_argument_1.f90
@@ -1,4 +1,4 @@
-! { dg-do "compile" }
+! { dg-do compile }
! { dg-options "-Wall" }
!
! PR fortran/38407
diff --git a/gcc/testsuite/gfortran.dg/warn_unused_dummy_argument_2.f90 b/gcc/testsuite/gfortran.dg/warn_unused_dummy_argument_2.f90
index 85472dddda2..6a2233ba084 100644
--- a/gcc/testsuite/gfortran.dg/warn_unused_dummy_argument_2.f90
+++ b/gcc/testsuite/gfortran.dg/warn_unused_dummy_argument_2.f90
@@ -1,4 +1,4 @@
-! { dg-do "compile" }
+! { dg-do compile }
! { dg-options "-Wall -Wno-unused-dummy-argument" }
!
! PR fortran/38407
diff --git a/gcc/testsuite/gfortran.dg/warning-directive-2.F90 b/gcc/testsuite/gfortran.dg/warning-directive-2.F90
index fa9460a787f..7e4418530ef 100644
--- a/gcc/testsuite/gfortran.dg/warning-directive-2.F90
+++ b/gcc/testsuite/gfortran.dg/warning-directive-2.F90
@@ -1,5 +1,5 @@
! { dg-do preprocess }
! { dg-options "-std=f95 -fdiagnostics-show-option -Werror=cpp" }
-! { dg-warning "some warnings being treated as errors" "" {target "*-*-*"} 0 }
+! { dg-message "some warnings being treated as errors" "" {target "*-*-*"} 0 }
#warning "Printed"
! { dg-error "\"Printed\" .-Werror=cpp." "" { target *-*-* } 4 }
diff --git a/gcc/testsuite/gfortran.dg/warnings_are_errors_1.f b/gcc/testsuite/gfortran.dg/warnings_are_errors_1.f
index 3d163bbbdfc..56465a9c065 100644
--- a/gcc/testsuite/gfortran.dg/warnings_are_errors_1.f
+++ b/gcc/testsuite/gfortran.dg/warnings_are_errors_1.f
@@ -12,7 +12,7 @@
!
34 5 i=0
! gfc_notify_std(GFC_STD_F95_DEL):
- do r1 = 1, 2 ! { dg-error "Deleted feature: Loop variable" }
+ do r1 = 1, 2 ! { dg-warning "Deleted feature: Loop variable" }
i = i+1
end do
call foo j bar
diff --git a/gcc/testsuite/gfortran.dg/whole_file_1.f90 b/gcc/testsuite/gfortran.dg/whole_file_1.f90
index d7137eed013..598c9d3193a 100644
--- a/gcc/testsuite/gfortran.dg/whole_file_1.f90
+++ b/gcc/testsuite/gfortran.dg/whole_file_1.f90
@@ -19,7 +19,7 @@ subroutine b
integer :: u1
end type
type (u) :: q
- call a(q) ! { dg-error "Type mismatch" }
+ call a(q) ! { dg-warning "Type mismatch" }
print *, q%u1
end subroutine
@@ -36,7 +36,7 @@ subroutine d
integer :: u1
end type
type (u) :: q
- call c(q) ! { dg-error "Type mismatch" }
+ call c(q) ! { dg-warning "Type mismatch" }
print *, q%u1
end subroutine
diff --git a/gcc/testsuite/gfortran.dg/whole_file_16.f90 b/gcc/testsuite/gfortran.dg/whole_file_16.f90
index 2a17d0b1dcb..048350f1d7e 100644
--- a/gcc/testsuite/gfortran.dg/whole_file_16.f90
+++ b/gcc/testsuite/gfortran.dg/whole_file_16.f90
@@ -1,4 +1,4 @@
-! { dg-do "compile" }
+! { dg-do compile }
! { dg-options "-fwhole-file" }
!
! PR fortran/31346
diff --git a/gcc/testsuite/gfortran.dg/whole_file_17.f90 b/gcc/testsuite/gfortran.dg/whole_file_17.f90
index deaddf95ae6..86272b848a8 100644
--- a/gcc/testsuite/gfortran.dg/whole_file_17.f90
+++ b/gcc/testsuite/gfortran.dg/whole_file_17.f90
@@ -1,4 +1,4 @@
-! { dg-do "compile" }
+! { dg-do compile }
! { dg-options "-fwhole-file" }
!
! PR fortran/30668
diff --git a/gcc/testsuite/gfortran.dg/whole_file_18.f90 b/gcc/testsuite/gfortran.dg/whole_file_18.f90
index fac15d6ca4f..f758408f81e 100644
--- a/gcc/testsuite/gfortran.dg/whole_file_18.f90
+++ b/gcc/testsuite/gfortran.dg/whole_file_18.f90
@@ -1,4 +1,4 @@
-! { dg-do "compile" }
+! { dg-do compile }
! { dg-options "-fwhole-file -Wno-unused-dummy-argument" }
!
! PR fortran/34260
diff --git a/gcc/testsuite/gfortran.dg/whole_file_2.f90 b/gcc/testsuite/gfortran.dg/whole_file_2.f90
index 7f403522618..4e33c06b668 100644
--- a/gcc/testsuite/gfortran.dg/whole_file_2.f90
+++ b/gcc/testsuite/gfortran.dg/whole_file_2.f90
@@ -14,8 +14,8 @@ end function
program gg
real :: h
character (5) :: chr = 'hello'
-h = a(); ! { dg-error "Missing actual argument" }
-call test ([chr]) ! { dg-error "Rank mismatch" }
+h = a(); ! { dg-warning "Missing actual argument" }
+call test ([chr]) ! { dg-warning "Rank mismatch" }
end program gg
subroutine test (a)
diff --git a/gcc/testsuite/gfortran.dg/whole_file_20.f03 b/gcc/testsuite/gfortran.dg/whole_file_20.f03
index 231a5aaf283..61e2a4df9d8 100644
--- a/gcc/testsuite/gfortran.dg/whole_file_20.f03
+++ b/gcc/testsuite/gfortran.dg/whole_file_20.f03
@@ -1,4 +1,4 @@
-! { dg-do "compile" }
+! { dg-do compile }
! { dg-options "-fwhole-file -fcoarray=single" }
!
! Procedures with dummy arguments that are coarrays or polymorphic
diff --git a/gcc/testsuite/gfortran.dg/whole_file_28.f90 b/gcc/testsuite/gfortran.dg/whole_file_28.f90
new file mode 100644
index 00000000000..78c848e40e6
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/whole_file_28.f90
@@ -0,0 +1,12 @@
+! { dg-do compile }
+! Test the fix for the problem described in PR45077 comments #4 and #5.
+! Note that the module file is kept for whole_file_29.f90
+!
+! Contributed by Tobias Burnus <burnus@gcc.gnu.org>
+!
+module iso_red
+ type, public :: varying_string
+ character(LEN=1), dimension(:), allocatable :: chars
+ end type varying_string
+end module iso_red
+! DO NOT CLEAN UP THE MODULE FILE - whole_file_29.f90 does it.
diff --git a/gcc/testsuite/gfortran.dg/whole_file_29.f90 b/gcc/testsuite/gfortran.dg/whole_file_29.f90
new file mode 100644
index 00000000000..2521dadac2a
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/whole_file_29.f90
@@ -0,0 +1,27 @@
+! { dg-do compile }
+! Test the fix for the problem described in PR45077 comments #4 and #5.
+! Note that the module file from whole_file_28.f90, 'iso_red', is
+! needed for this test.
+!
+! Contributed by Tobias Burnus <burnus@gcc.gnu.org>
+!
+module ifiles
+ use iso_red, string_t => varying_string
+contains
+ function line_get_string_advance (line) result (string)
+ type(string_t) :: string
+ character :: line
+ end function line_get_string_advance
+end module ifiles
+
+module syntax_rules
+ use iso_red, string_t => varying_string
+ use ifiles, only: line_get_string_advance
+contains
+ subroutine syntax_init_from_ifile ()
+ type(string_t) :: string
+ string = line_get_string_advance ("")
+ end subroutine syntax_init_from_ifile
+end module syntax_rules
+end
+! { dg-final { cleanup-modules "syntax_rules ifiles iso_red" } }
diff --git a/gcc/testsuite/gfortran.dg/whole_file_3.f90 b/gcc/testsuite/gfortran.dg/whole_file_3.f90
index 7ad762ccf97..242280ccf53 100644
--- a/gcc/testsuite/gfortran.dg/whole_file_3.f90
+++ b/gcc/testsuite/gfortran.dg/whole_file_3.f90
@@ -14,8 +14,8 @@
program test
EXTERNAL R
- call PHLOAD (R, 1) ! { dg-error "Missing alternate return spec" }
- CALL PHLOAD (R, 2) ! { dg-error "Missing alternate return spec" }
+ call PHLOAD (R, 1) ! { dg-warning "Missing alternate return spec" }
+ CALL PHLOAD (R, 2) ! { dg-warning "Missing alternate return spec" }
CALL PHLOAD (R, *999) ! This one is OK
999 continue
END program test
diff --git a/gcc/testsuite/gfortran.dg/whole_file_30.f90 b/gcc/testsuite/gfortran.dg/whole_file_30.f90
new file mode 100644
index 00000000000..813ca06868d
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/whole_file_30.f90
@@ -0,0 +1,15 @@
+! { dg-do compile }
+! Test the fix for the problem described in PR46818.
+! Note that the module file is kept for whole_file_31.f90
+!
+! Contributed by Martien Hulsen <m.a.hulsen@tue.nl>
+! and reduced by Tobias Burnus <burnus@gcc.gnu.org>
+!
+! ============== system_defs.f90 =============
+module system_defs_m
+ type sysvector_t
+ integer :: probnr = 0
+ real, allocatable, dimension(:) :: u
+ end type sysvector_t
+end module system_defs_m
+! DO NOT CLEAN UP THE MODULE FILE - whole_file_31.f90 does it.
diff --git a/gcc/testsuite/gfortran.dg/whole_file_31.f90 b/gcc/testsuite/gfortran.dg/whole_file_31.f90
new file mode 100644
index 00000000000..7ef0b9f6761
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/whole_file_31.f90
@@ -0,0 +1,21 @@
+! { dg-do compile }
+! Test the fix for the problem described in PR46818.
+! Note that the module file from whole_file_30.f90, 'system_defs_m',
+! is needed for this test.
+!
+! Contributed by Martien Hulsen <m.a.hulsen@tue.nl>
+! and reduced by Tobias Burnus <burnus@gcc.gnu.org>
+!
+! ========== t.f90 ===========================
+module convecreac_m
+ use system_defs_m
+ type(sysvector_t), pointer :: solution
+end module convecreac_m
+
+program t
+ use convecreac_m
+ implicit none
+ type(sysvector_t), target :: sol
+ solution => sol
+end program t
+! { dg-final { cleanup-modules "system_defs_m convecreac_m" } }
diff --git a/gcc/testsuite/gfortran.dg/whole_file_32.f90 b/gcc/testsuite/gfortran.dg/whole_file_32.f90
new file mode 100644
index 00000000000..6626fbd5a54
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/whole_file_32.f90
@@ -0,0 +1,20 @@
+! { dg-do compile }
+! { dg-options "-O -finline-small-functions" }
+! Tests the fix for PR45743 in which the compilation failed with an ICE
+! internal compiler error: verify_stmts failed. The source is the essential
+! part of whole_file_3.f90.
+!
+! Contributed by Zdenek Sojka <zsojka@seznam.cz>
+!
+ SUBROUTINE PHLOAD (READER,*)
+ IMPLICIT NONE
+ EXTERNAL READER
+ CALL READER (*1)
+ 1 RETURN 1
+ END SUBROUTINE
+
+ program test
+ EXTERNAL R
+ CALL PHLOAD (R, *999) ! This one is OK
+ 999 continue
+ END program test
diff --git a/gcc/testsuite/gfortran.dg/whole_file_5.f90 b/gcc/testsuite/gfortran.dg/whole_file_5.f90
index 0ba8ffe2140..34240c9f321 100644
--- a/gcc/testsuite/gfortran.dg/whole_file_5.f90
+++ b/gcc/testsuite/gfortran.dg/whole_file_5.f90
@@ -1,4 +1,4 @@
-! { dg-do "compile" }
+! { dg-do compile }
! { dg-options "-O3 -fwhole-file -fdump-tree-optimized" }
! { dg-add-options bind_pic_locally }
!
diff --git a/gcc/testsuite/gfortran.dg/whole_file_6.f90 b/gcc/testsuite/gfortran.dg/whole_file_6.f90
index 266c289f541..1d92bc36009 100644
--- a/gcc/testsuite/gfortran.dg/whole_file_6.f90
+++ b/gcc/testsuite/gfortran.dg/whole_file_6.f90
@@ -1,4 +1,4 @@
-! { dg-do "compile" }
+! { dg-do compile }
! { dg-options "-O3 -fwhole-file -fdump-tree-optimized" }
! { dg-add-options bind_pic_locally }
!
diff --git a/gcc/testsuite/gfortran.dg/write_invalid_format.f90 b/gcc/testsuite/gfortran.dg/write_invalid_format.f90
index fb60313ef07..8de7bc25ced 100644
--- a/gcc/testsuite/gfortran.dg/write_invalid_format.f90
+++ b/gcc/testsuite/gfortran.dg/write_invalid_format.f90
@@ -1,4 +1,4 @@
-! { dg-do "compile" }
+! { dg-do compile }
! PR fortran/35582 - ICE on invalid format
! Testcase contributed by
! Leandro Martinez <leandromartinez DOT spam AT gmail DOT com>
diff --git a/gcc/testsuite/gfortran.dg/zero_sized_6.f90 b/gcc/testsuite/gfortran.dg/zero_sized_6.f90
index 30ed8dfaaf5..f944fd91444 100644
--- a/gcc/testsuite/gfortran.dg/zero_sized_6.f90
+++ b/gcc/testsuite/gfortran.dg/zero_sized_6.f90
@@ -1,4 +1,4 @@
-! { dg-do "compile" }
+! { dg-do compile }
! PR38709 - ICE-on-invalid on zero-sized array in init-expr.
INTEGER, PARAMETER :: a(1) = (/ 1 /)
diff --git a/gcc/testsuite/gfortran.fortran-torture/execute/nan_inf_fmt.f90 b/gcc/testsuite/gfortran.fortran-torture/execute/nan_inf_fmt.f90
index 22e17d12eb2..2ded0cbbb62 100644
--- a/gcc/testsuite/gfortran.fortran-torture/execute/nan_inf_fmt.f90
+++ b/gcc/testsuite/gfortran.fortran-torture/execute/nan_inf_fmt.f90
@@ -1,4 +1,5 @@
!pr 12839- F2003 formatting of Inf /Nan
+! Modified for PR47434
implicit none
character*40 l
character*12 fmt
@@ -15,11 +16,11 @@
! check a field width = 0
fmt = '(F0.0)'
write(l,fmt=fmt)pos_inf
- if (l.ne.'+Inf') call abort
+ if (l.ne.'Inf') call abort
write(l,fmt=fmt)neg_inf
if (l.ne.'-Inf') call abort
write(l,fmt=fmt)nan
- if (l.ne.' NaN') call abort
+ if (l.ne.'NaN') call abort
! check a field width < 3
fmt = '(F2.0)'
@@ -42,7 +43,7 @@
! check a field width > 3
fmt = '(F4.0)'
write(l,fmt=fmt)pos_inf
- if (l.ne.'+Inf') call abort
+ if (l.ne.' Inf') call abort
write(l,fmt=fmt)neg_inf
if (l.ne.'-Inf') call abort
write(l,fmt=fmt)nan
@@ -51,7 +52,7 @@
! check a field width = 7
fmt = '(F7.0)'
write(l,fmt=fmt)pos_inf
- if (l.ne.' +Inf') call abort
+ if (l.ne.' Inf') call abort
write(l,fmt=fmt)neg_inf
if (l.ne.' -Inf') call abort
write(l,fmt=fmt)nan
@@ -60,7 +61,7 @@
! check a field width = 8
fmt = '(F8.0)'
write(l,fmt=fmt)pos_inf
- if (l.ne.' +Inf') call abort
+ if (l.ne.'Infinity') call abort
write(l,fmt=fmt)neg_inf
if (l.ne.' -Inf') call abort
write(l,fmt=fmt)nan
@@ -69,7 +70,7 @@
! check a field width = 9
fmt = '(F9.0)'
write(l,fmt=fmt)pos_inf
- if (l.ne.'+Infinity') call abort
+ if (l.ne.' Infinity') call abort
write(l,fmt=fmt)neg_inf
if (l.ne.'-Infinity') call abort
write(l,fmt=fmt)nan
@@ -78,7 +79,7 @@
! check a field width = 14
fmt = '(F14.0)'
write(l,fmt=fmt)pos_inf
- if (l.ne.' +Infinity') call abort
+ if (l.ne.' Infinity') call abort
write(l,fmt=fmt)neg_inf
if (l.ne.' -Infinity') call abort
write(l,fmt=fmt)nan
diff --git a/gcc/testsuite/gnat.dg/array7.adb b/gcc/testsuite/gnat.dg/array7.adb
index d9df597cb3a..d83a55a483a 100644
--- a/gcc/testsuite/gnat.dg/array7.adb
+++ b/gcc/testsuite/gnat.dg/array7.adb
@@ -20,3 +20,4 @@ package body Array7 is
end Array7;
-- { dg-final { scan-tree-dump-not "MAX_EXPR" "optimized" } }
+-- { dg-final { cleanup-tree-dump "optimized" } }
diff --git a/gcc/testsuite/gnat.dg/atomic1.adb b/gcc/testsuite/gnat.dg/atomic1.adb
index 1e5207bb93b..59e1be20154 100644
--- a/gcc/testsuite/gnat.dg/atomic1.adb
+++ b/gcc/testsuite/gnat.dg/atomic1.adb
@@ -15,3 +15,4 @@ end;
-- { dg-final { scan-tree-dump-times "v_16" 1 "gimple"} }
-- { dg-final { scan-tree-dump-times "v_32" 1 "gimple"} }
+-- { dg-final { cleanup-tree-dump "gimple" } }
diff --git a/gcc/testsuite/gnat.dg/include.adb b/gcc/testsuite/gnat.dg/include.adb
new file mode 100644
index 00000000000..ec183c723b7
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/include.adb
@@ -0,0 +1,4 @@
+-- { dg-do compile } */
+-- { dg-options "-cargs -I -gnatws" }
+
+-- { dg-error "search directory missing" "" { target *-*-* } 0 }
diff --git a/gcc/testsuite/gnat.dg/loop_optimization6.adb b/gcc/testsuite/gnat.dg/loop_optimization6.adb
index 7a0f6d38803..30f35f6ba9c 100644
--- a/gcc/testsuite/gnat.dg/loop_optimization6.adb
+++ b/gcc/testsuite/gnat.dg/loop_optimization6.adb
@@ -23,3 +23,4 @@ package body Loop_Optimization6 is
end Loop_Optimization6;
-- { dg-final { scan-tree-dump-not "goto" "optimized"} }
+-- { dg-final { cleanup-tree-dump "optimized" } }
diff --git a/gcc/testsuite/gnat.dg/null_pointer_deref1.adb b/gcc/testsuite/gnat.dg/null_pointer_deref1.adb
index f845064685f..6e7bf14e5df 100644
--- a/gcc/testsuite/gnat.dg/null_pointer_deref1.adb
+++ b/gcc/testsuite/gnat.dg/null_pointer_deref1.adb
@@ -1,4 +1,4 @@
--- { dg-do run { target { ! "sparc*-sun-solaris2.11" } } }
+-- { dg-do run }
-- { dg-options "-gnatp" }
-- This test requires architecture- and OS-specific support code for unwinding
diff --git a/gcc/testsuite/gnat.dg/opt11.adb b/gcc/testsuite/gnat.dg/opt11.adb
index dca4804ceee..918981410e9 100644
--- a/gcc/testsuite/gnat.dg/opt11.adb
+++ b/gcc/testsuite/gnat.dg/opt11.adb
@@ -1,4 +1,4 @@
--- { dg-compile }
+-- { dg-do compile }
-- { dg-options "-O" }
package body Opt11 is
diff --git a/gcc/testsuite/gnat.dg/uninit_func.adb b/gcc/testsuite/gnat.dg/uninit_func.adb
index 9c9ee341143..ff5427ad7c9 100644
--- a/gcc/testsuite/gnat.dg/uninit_func.adb
+++ b/gcc/testsuite/gnat.dg/uninit_func.adb
@@ -2,12 +2,12 @@
-- { dg-options "-O -Wall" }
function uninit_func (A, B : Boolean) return Boolean is
- C : Boolean; -- { dg-warning "may be used uninitialized" }
+ C : Boolean;
begin
if A then
C := False;
elsif B then
C := True;
end if;
- return C;
+ return C; -- { dg-warning "may be used uninitialized" }
end;
diff --git a/gcc/testsuite/go.test/test/blank.go b/gcc/testsuite/go.test/test/blank.go
index b9d3a32a817..681a5e77cb4 100644
--- a/gcc/testsuite/go.test/test/blank.go
+++ b/gcc/testsuite/go.test/test/blank.go
@@ -28,7 +28,7 @@ const (
c4
)
-var ints = []string {
+var ints = []string{
"1",
"2",
"3",
@@ -36,15 +36,15 @@ var ints = []string {
func f() (int, int) {
call += "f"
- return 1,2
+ return 1, 2
}
-func g() (float, float) {
+func g() (float64, float64) {
call += "g"
- return 3,4
+ return 3, 4
}
-func h(_ int, _ float) {
+func h(_ int, _ float64) {
}
func i() int {
@@ -55,43 +55,64 @@ func i() int {
var _ = i()
func main() {
- if call != "i" {panic("init did not run")}
+ if call != "i" {
+ panic("init did not run")
+ }
call = ""
_, _ = f()
a, _ := f()
- if a != 1 {panic(a)}
+ if a != 1 {
+ panic(a)
+ }
b, _ := g()
- if b != 3 {panic(b)}
+ if b != 3 {
+ panic(b)
+ }
_, a = f()
- if a != 2 {panic(a)}
+ if a != 2 {
+ panic(a)
+ }
_, b = g()
- if b != 4 {panic(b)}
+ if b != 4 {
+ panic(b)
+ }
_ = i()
- if call != "ffgfgi" {panic(call)}
- if c4 != 4 {panic(c4)}
+ if call != "ffgfgi" {
+ panic(call)
+ }
+ if c4 != 4 {
+ panic(c4)
+ }
out := ""
for _, s := range ints {
out += s
}
- if out != "123" {panic(out)}
+ if out != "123" {
+ panic(out)
+ }
sum := 0
- for s, _ := range ints {
+ for s := range ints {
sum += s
}
- if sum != 3 {panic(sum)}
+ if sum != 3 {
+ panic(sum)
+ }
- h(a,b)
+ h(a, b)
}
// useless but legal
var _ int = 1
var _ = 2
var _, _ = 3, 4
+
const _ = 3
const _, _ = 4, 5
+
type _ int
+
func _() {
panic("oops")
}
diff --git a/gcc/testsuite/go.test/test/cmplx.go b/gcc/testsuite/go.test/test/cmplx.go
index 6262c682d0b..d5a77d684a7 100644
--- a/gcc/testsuite/go.test/test/cmplx.go
+++ b/gcc/testsuite/go.test/test/cmplx.go
@@ -7,25 +7,19 @@
package main
var (
- f float
f32 float32
f64 float64
- c complex
- c64 complex64
+ c64 complex64
c128 complex128
)
-
+
func main() {
// ok
- c = cmplx(f, f)
- c64 = cmplx(f32, f32)
- c128 = cmplx(f64, f64)
+ c64 = complex(f32, f32)
+ c128 = complex(f64, f64)
- _ = cmplx(f, f32) // ERROR "cmplx"
- _ = cmplx(f, f64) // ERROR "cmplx"
- _ = cmplx(f32, f) // ERROR "cmplx"
- _ = cmplx(f32, f64) // ERROR "cmplx"
- _ = cmplx(f64, f) // ERROR "cmplx"
- _ = cmplx(f64, f32) // ERROR "cmplx"
+ _ = complex128(0) // ok
+ _ = complex(f32, f64) // ERROR "complex"
+ _ = complex(f64, f32) // ERROR "complex"
}
diff --git a/gcc/testsuite/go.test/test/cmplxdivide1.go b/gcc/testsuite/go.test/test/cmplxdivide1.go
index 96ea704a3e2..6a1dee9fe78 100644
--- a/gcc/testsuite/go.test/test/cmplxdivide1.go
+++ b/gcc/testsuite/go.test/test/cmplxdivide1.go
@@ -1,2407 +1,2406 @@
// # generated by cmplxdivide.c
package main
-
var tests = []Test{
- Test{cmplx(0, 0), cmplx(0, 0), cmplx(nan, nan)},
- Test{cmplx(0, 0), cmplx(0, 1), cmplx(0, 0)},
- Test{cmplx(0, 0), cmplx(0, -1), cmplx(negzero, 0)},
- Test{cmplx(0, 0), cmplx(0, 2), cmplx(0, 0)},
- Test{cmplx(0, 0), cmplx(0, nan), cmplx(nan, nan)},
- Test{cmplx(0, 0), cmplx(0, inf), cmplx(0, 0)},
- Test{cmplx(0, 0), cmplx(0, -inf), cmplx(negzero, 0)},
- Test{cmplx(0, 0), cmplx(1, 0), cmplx(0, 0)},
- Test{cmplx(0, 0), cmplx(1, 1), cmplx(0, 0)},
- Test{cmplx(0, 0), cmplx(1, -1), cmplx(0, 0)},
- Test{cmplx(0, 0), cmplx(1, 2), cmplx(0, 0)},
- Test{cmplx(0, 0), cmplx(1, nan), cmplx(nan, nan)},
- Test{cmplx(0, 0), cmplx(1, inf), cmplx(0, 0)},
- Test{cmplx(0, 0), cmplx(1, -inf), cmplx(negzero, 0)},
- Test{cmplx(0, 0), cmplx(-1, 0), cmplx(negzero, negzero)},
- Test{cmplx(0, 0), cmplx(-1, 1), cmplx(negzero, negzero)},
- Test{cmplx(0, 0), cmplx(-1, -1), cmplx(negzero, negzero)},
- Test{cmplx(0, 0), cmplx(-1, 2), cmplx(0, negzero)},
- Test{cmplx(0, 0), cmplx(-1, nan), cmplx(nan, nan)},
- Test{cmplx(0, 0), cmplx(-1, inf), cmplx(0, negzero)},
- Test{cmplx(0, 0), cmplx(-1, -inf), cmplx(negzero, negzero)},
- Test{cmplx(0, 0), cmplx(2, 0), cmplx(0, 0)},
- Test{cmplx(0, 0), cmplx(2, 1), cmplx(0, 0)},
- Test{cmplx(0, 0), cmplx(2, -1), cmplx(0, 0)},
- Test{cmplx(0, 0), cmplx(2, 2), cmplx(0, 0)},
- Test{cmplx(0, 0), cmplx(2, nan), cmplx(nan, nan)},
- Test{cmplx(0, 0), cmplx(2, inf), cmplx(0, 0)},
- Test{cmplx(0, 0), cmplx(2, -inf), cmplx(negzero, 0)},
- Test{cmplx(0, 0), cmplx(nan, 0), cmplx(nan, nan)},
- Test{cmplx(0, 0), cmplx(nan, 1), cmplx(nan, nan)},
- Test{cmplx(0, 0), cmplx(nan, -1), cmplx(nan, nan)},
- Test{cmplx(0, 0), cmplx(nan, 2), cmplx(nan, nan)},
- Test{cmplx(0, 0), cmplx(nan, nan), cmplx(nan, nan)},
- Test{cmplx(0, 0), cmplx(nan, inf), cmplx(0, 0)},
- Test{cmplx(0, 0), cmplx(nan, -inf), cmplx(0, 0)},
- Test{cmplx(0, 0), cmplx(inf, 0), cmplx(0, 0)},
- Test{cmplx(0, 0), cmplx(inf, 1), cmplx(0, 0)},
- Test{cmplx(0, 0), cmplx(inf, -1), cmplx(0, 0)},
- Test{cmplx(0, 0), cmplx(inf, 2), cmplx(0, 0)},
- Test{cmplx(0, 0), cmplx(inf, nan), cmplx(0, 0)},
- Test{cmplx(0, 0), cmplx(inf, inf), cmplx(0, 0)},
- Test{cmplx(0, 0), cmplx(inf, -inf), cmplx(0, 0)},
- Test{cmplx(0, 0), cmplx(-inf, 0), cmplx(negzero, negzero)},
- Test{cmplx(0, 0), cmplx(-inf, 1), cmplx(negzero, negzero)},
- Test{cmplx(0, 0), cmplx(-inf, -1), cmplx(negzero, negzero)},
- Test{cmplx(0, 0), cmplx(-inf, 2), cmplx(negzero, negzero)},
- Test{cmplx(0, 0), cmplx(-inf, nan), cmplx(0, negzero)},
- Test{cmplx(0, 0), cmplx(-inf, inf), cmplx(0, negzero)},
- Test{cmplx(0, 0), cmplx(-inf, -inf), cmplx(negzero, 0)},
- Test{cmplx(0, 1), cmplx(0, 0), cmplx(nan, inf)},
- Test{cmplx(0, 1), cmplx(0, 1), cmplx(1, 0)},
- Test{cmplx(0, 1), cmplx(0, -1), cmplx(-1, 0)},
- Test{cmplx(0, 1), cmplx(0, 2), cmplx(0.5, 0)},
- Test{cmplx(0, 1), cmplx(0, nan), cmplx(nan, nan)},
- Test{cmplx(0, 1), cmplx(0, inf), cmplx(0, 0)},
- Test{cmplx(0, 1), cmplx(0, -inf), cmplx(negzero, 0)},
- Test{cmplx(0, 1), cmplx(1, 0), cmplx(0, 1)},
- Test{cmplx(0, 1), cmplx(1, 1), cmplx(0.5, 0.5)},
- Test{cmplx(0, 1), cmplx(1, -1), cmplx(-0.5, 0.5)},
- Test{cmplx(0, 1), cmplx(1, 2), cmplx(0.4, 0.2)},
- Test{cmplx(0, 1), cmplx(1, nan), cmplx(nan, nan)},
- Test{cmplx(0, 1), cmplx(1, inf), cmplx(0, 0)},
- Test{cmplx(0, 1), cmplx(1, -inf), cmplx(negzero, 0)},
- Test{cmplx(0, 1), cmplx(-1, 0), cmplx(negzero, -1)},
- Test{cmplx(0, 1), cmplx(-1, 1), cmplx(0.5, -0.5)},
- Test{cmplx(0, 1), cmplx(-1, -1), cmplx(-0.5, -0.5)},
- Test{cmplx(0, 1), cmplx(-1, 2), cmplx(0.4, -0.2)},
- Test{cmplx(0, 1), cmplx(-1, nan), cmplx(nan, nan)},
- Test{cmplx(0, 1), cmplx(-1, inf), cmplx(0, negzero)},
- Test{cmplx(0, 1), cmplx(-1, -inf), cmplx(negzero, negzero)},
- Test{cmplx(0, 1), cmplx(2, 0), cmplx(0, 0.5)},
- Test{cmplx(0, 1), cmplx(2, 1), cmplx(0.2, 0.4)},
- Test{cmplx(0, 1), cmplx(2, -1), cmplx(-0.2, 0.4)},
- Test{cmplx(0, 1), cmplx(2, 2), cmplx(0.25, 0.25)},
- Test{cmplx(0, 1), cmplx(2, nan), cmplx(nan, nan)},
- Test{cmplx(0, 1), cmplx(2, inf), cmplx(0, 0)},
- Test{cmplx(0, 1), cmplx(2, -inf), cmplx(negzero, 0)},
- Test{cmplx(0, 1), cmplx(nan, 0), cmplx(nan, nan)},
- Test{cmplx(0, 1), cmplx(nan, 1), cmplx(nan, nan)},
- Test{cmplx(0, 1), cmplx(nan, -1), cmplx(nan, nan)},
- Test{cmplx(0, 1), cmplx(nan, 2), cmplx(nan, nan)},
- Test{cmplx(0, 1), cmplx(nan, nan), cmplx(nan, nan)},
- Test{cmplx(0, 1), cmplx(nan, inf), cmplx(0, 0)},
- Test{cmplx(0, 1), cmplx(nan, -inf), cmplx(negzero, 0)},
- Test{cmplx(0, 1), cmplx(inf, 0), cmplx(0, 0)},
- Test{cmplx(0, 1), cmplx(inf, 1), cmplx(0, 0)},
- Test{cmplx(0, 1), cmplx(inf, -1), cmplx(0, 0)},
- Test{cmplx(0, 1), cmplx(inf, 2), cmplx(0, 0)},
- Test{cmplx(0, 1), cmplx(inf, nan), cmplx(0, 0)},
- Test{cmplx(0, 1), cmplx(inf, inf), cmplx(0, 0)},
- Test{cmplx(0, 1), cmplx(inf, -inf), cmplx(negzero, 0)},
- Test{cmplx(0, 1), cmplx(-inf, 0), cmplx(negzero, negzero)},
- Test{cmplx(0, 1), cmplx(-inf, 1), cmplx(negzero, negzero)},
- Test{cmplx(0, 1), cmplx(-inf, -1), cmplx(negzero, negzero)},
- Test{cmplx(0, 1), cmplx(-inf, 2), cmplx(negzero, negzero)},
- Test{cmplx(0, 1), cmplx(-inf, nan), cmplx(0, negzero)},
- Test{cmplx(0, 1), cmplx(-inf, inf), cmplx(0, negzero)},
- Test{cmplx(0, 1), cmplx(-inf, -inf), cmplx(negzero, negzero)},
- Test{cmplx(0, -1), cmplx(0, 0), cmplx(nan, -inf)},
- Test{cmplx(0, -1), cmplx(0, 1), cmplx(-1, negzero)},
- Test{cmplx(0, -1), cmplx(0, -1), cmplx(1, negzero)},
- Test{cmplx(0, -1), cmplx(0, 2), cmplx(-0.5, negzero)},
- Test{cmplx(0, -1), cmplx(0, nan), cmplx(nan, nan)},
- Test{cmplx(0, -1), cmplx(0, inf), cmplx(negzero, negzero)},
- Test{cmplx(0, -1), cmplx(0, -inf), cmplx(0, negzero)},
- Test{cmplx(0, -1), cmplx(1, 0), cmplx(0, -1)},
- Test{cmplx(0, -1), cmplx(1, 1), cmplx(-0.5, -0.5)},
- Test{cmplx(0, -1), cmplx(1, -1), cmplx(0.5, -0.5)},
- Test{cmplx(0, -1), cmplx(1, 2), cmplx(-0.4, -0.2)},
- Test{cmplx(0, -1), cmplx(1, nan), cmplx(nan, nan)},
- Test{cmplx(0, -1), cmplx(1, inf), cmplx(negzero, negzero)},
- Test{cmplx(0, -1), cmplx(1, -inf), cmplx(0, negzero)},
- Test{cmplx(0, -1), cmplx(-1, 0), cmplx(negzero, 1)},
- Test{cmplx(0, -1), cmplx(-1, 1), cmplx(-0.5, 0.5)},
- Test{cmplx(0, -1), cmplx(-1, -1), cmplx(0.5, 0.5)},
- Test{cmplx(0, -1), cmplx(-1, 2), cmplx(-0.4, 0.2)},
- Test{cmplx(0, -1), cmplx(-1, nan), cmplx(nan, nan)},
- Test{cmplx(0, -1), cmplx(-1, inf), cmplx(negzero, 0)},
- Test{cmplx(0, -1), cmplx(-1, -inf), cmplx(0, 0)},
- Test{cmplx(0, -1), cmplx(2, 0), cmplx(0, -0.5)},
- Test{cmplx(0, -1), cmplx(2, 1), cmplx(-0.2, -0.4)},
- Test{cmplx(0, -1), cmplx(2, -1), cmplx(0.2, -0.4)},
- Test{cmplx(0, -1), cmplx(2, 2), cmplx(-0.25, -0.25)},
- Test{cmplx(0, -1), cmplx(2, nan), cmplx(nan, nan)},
- Test{cmplx(0, -1), cmplx(2, inf), cmplx(negzero, negzero)},
- Test{cmplx(0, -1), cmplx(2, -inf), cmplx(0, negzero)},
- Test{cmplx(0, -1), cmplx(nan, 0), cmplx(nan, nan)},
- Test{cmplx(0, -1), cmplx(nan, 1), cmplx(nan, nan)},
- Test{cmplx(0, -1), cmplx(nan, -1), cmplx(nan, nan)},
- Test{cmplx(0, -1), cmplx(nan, 2), cmplx(nan, nan)},
- Test{cmplx(0, -1), cmplx(nan, nan), cmplx(nan, nan)},
- Test{cmplx(0, -1), cmplx(nan, inf), cmplx(negzero, negzero)},
- Test{cmplx(0, -1), cmplx(nan, -inf), cmplx(0, 0)},
- Test{cmplx(0, -1), cmplx(inf, 0), cmplx(0, negzero)},
- Test{cmplx(0, -1), cmplx(inf, 1), cmplx(0, negzero)},
- Test{cmplx(0, -1), cmplx(inf, -1), cmplx(0, negzero)},
- Test{cmplx(0, -1), cmplx(inf, 2), cmplx(0, negzero)},
- Test{cmplx(0, -1), cmplx(inf, nan), cmplx(0, negzero)},
- Test{cmplx(0, -1), cmplx(inf, inf), cmplx(negzero, negzero)},
- Test{cmplx(0, -1), cmplx(inf, -inf), cmplx(0, negzero)},
- Test{cmplx(0, -1), cmplx(-inf, 0), cmplx(negzero, 0)},
- Test{cmplx(0, -1), cmplx(-inf, 1), cmplx(negzero, 0)},
- Test{cmplx(0, -1), cmplx(-inf, -1), cmplx(negzero, 0)},
- Test{cmplx(0, -1), cmplx(-inf, 2), cmplx(negzero, 0)},
- Test{cmplx(0, -1), cmplx(-inf, nan), cmplx(negzero, 0)},
- Test{cmplx(0, -1), cmplx(-inf, inf), cmplx(negzero, 0)},
- Test{cmplx(0, -1), cmplx(-inf, -inf), cmplx(0, 0)},
- Test{cmplx(0, 2), cmplx(0, 0), cmplx(nan, inf)},
- Test{cmplx(0, 2), cmplx(0, 1), cmplx(2, 0)},
- Test{cmplx(0, 2), cmplx(0, -1), cmplx(-2, 0)},
- Test{cmplx(0, 2), cmplx(0, 2), cmplx(1, 0)},
- Test{cmplx(0, 2), cmplx(0, nan), cmplx(nan, nan)},
- Test{cmplx(0, 2), cmplx(0, inf), cmplx(0, 0)},
- Test{cmplx(0, 2), cmplx(0, -inf), cmplx(negzero, 0)},
- Test{cmplx(0, 2), cmplx(1, 0), cmplx(0, 2)},
- Test{cmplx(0, 2), cmplx(1, 1), cmplx(1, 1)},
- Test{cmplx(0, 2), cmplx(1, -1), cmplx(-1, 1)},
- Test{cmplx(0, 2), cmplx(1, 2), cmplx(0.8, 0.4)},
- Test{cmplx(0, 2), cmplx(1, nan), cmplx(nan, nan)},
- Test{cmplx(0, 2), cmplx(1, inf), cmplx(0, 0)},
- Test{cmplx(0, 2), cmplx(1, -inf), cmplx(negzero, 0)},
- Test{cmplx(0, 2), cmplx(-1, 0), cmplx(negzero, -2)},
- Test{cmplx(0, 2), cmplx(-1, 1), cmplx(1, -1)},
- Test{cmplx(0, 2), cmplx(-1, -1), cmplx(-1, -1)},
- Test{cmplx(0, 2), cmplx(-1, 2), cmplx(0.8, -0.4)},
- Test{cmplx(0, 2), cmplx(-1, nan), cmplx(nan, nan)},
- Test{cmplx(0, 2), cmplx(-1, inf), cmplx(0, negzero)},
- Test{cmplx(0, 2), cmplx(-1, -inf), cmplx(negzero, negzero)},
- Test{cmplx(0, 2), cmplx(2, 0), cmplx(0, 1)},
- Test{cmplx(0, 2), cmplx(2, 1), cmplx(0.4, 0.8)},
- Test{cmplx(0, 2), cmplx(2, -1), cmplx(-0.4, 0.8)},
- Test{cmplx(0, 2), cmplx(2, 2), cmplx(0.5, 0.5)},
- Test{cmplx(0, 2), cmplx(2, nan), cmplx(nan, nan)},
- Test{cmplx(0, 2), cmplx(2, inf), cmplx(0, 0)},
- Test{cmplx(0, 2), cmplx(2, -inf), cmplx(negzero, 0)},
- Test{cmplx(0, 2), cmplx(nan, 0), cmplx(nan, nan)},
- Test{cmplx(0, 2), cmplx(nan, 1), cmplx(nan, nan)},
- Test{cmplx(0, 2), cmplx(nan, -1), cmplx(nan, nan)},
- Test{cmplx(0, 2), cmplx(nan, 2), cmplx(nan, nan)},
- Test{cmplx(0, 2), cmplx(nan, nan), cmplx(nan, nan)},
- Test{cmplx(0, 2), cmplx(nan, inf), cmplx(0, 0)},
- Test{cmplx(0, 2), cmplx(nan, -inf), cmplx(negzero, 0)},
- Test{cmplx(0, 2), cmplx(inf, 0), cmplx(0, 0)},
- Test{cmplx(0, 2), cmplx(inf, 1), cmplx(0, 0)},
- Test{cmplx(0, 2), cmplx(inf, -1), cmplx(0, 0)},
- Test{cmplx(0, 2), cmplx(inf, 2), cmplx(0, 0)},
- Test{cmplx(0, 2), cmplx(inf, nan), cmplx(0, 0)},
- Test{cmplx(0, 2), cmplx(inf, inf), cmplx(0, 0)},
- Test{cmplx(0, 2), cmplx(inf, -inf), cmplx(negzero, 0)},
- Test{cmplx(0, 2), cmplx(-inf, 0), cmplx(negzero, negzero)},
- Test{cmplx(0, 2), cmplx(-inf, 1), cmplx(negzero, negzero)},
- Test{cmplx(0, 2), cmplx(-inf, -1), cmplx(negzero, negzero)},
- Test{cmplx(0, 2), cmplx(-inf, 2), cmplx(negzero, negzero)},
- Test{cmplx(0, 2), cmplx(-inf, nan), cmplx(0, negzero)},
- Test{cmplx(0, 2), cmplx(-inf, inf), cmplx(0, negzero)},
- Test{cmplx(0, 2), cmplx(-inf, -inf), cmplx(negzero, negzero)},
- Test{cmplx(0, nan), cmplx(0, 0), cmplx(nan, nan)},
- Test{cmplx(0, nan), cmplx(0, 1), cmplx(nan, nan)},
- Test{cmplx(0, nan), cmplx(0, -1), cmplx(nan, nan)},
- Test{cmplx(0, nan), cmplx(0, 2), cmplx(nan, nan)},
- Test{cmplx(0, nan), cmplx(0, nan), cmplx(nan, nan)},
- Test{cmplx(0, nan), cmplx(0, inf), cmplx(nan, nan)},
- Test{cmplx(0, nan), cmplx(0, -inf), cmplx(nan, nan)},
- Test{cmplx(0, nan), cmplx(1, 0), cmplx(nan, nan)},
- Test{cmplx(0, nan), cmplx(1, 1), cmplx(nan, nan)},
- Test{cmplx(0, nan), cmplx(1, -1), cmplx(nan, nan)},
- Test{cmplx(0, nan), cmplx(1, 2), cmplx(nan, nan)},
- Test{cmplx(0, nan), cmplx(1, nan), cmplx(nan, nan)},
- Test{cmplx(0, nan), cmplx(1, inf), cmplx(nan, nan)},
- Test{cmplx(0, nan), cmplx(1, -inf), cmplx(nan, nan)},
- Test{cmplx(0, nan), cmplx(-1, 0), cmplx(nan, nan)},
- Test{cmplx(0, nan), cmplx(-1, 1), cmplx(nan, nan)},
- Test{cmplx(0, nan), cmplx(-1, -1), cmplx(nan, nan)},
- Test{cmplx(0, nan), cmplx(-1, 2), cmplx(nan, nan)},
- Test{cmplx(0, nan), cmplx(-1, nan), cmplx(nan, nan)},
- Test{cmplx(0, nan), cmplx(-1, inf), cmplx(nan, nan)},
- Test{cmplx(0, nan), cmplx(-1, -inf), cmplx(nan, nan)},
- Test{cmplx(0, nan), cmplx(2, 0), cmplx(nan, nan)},
- Test{cmplx(0, nan), cmplx(2, 1), cmplx(nan, nan)},
- Test{cmplx(0, nan), cmplx(2, -1), cmplx(nan, nan)},
- Test{cmplx(0, nan), cmplx(2, 2), cmplx(nan, nan)},
- Test{cmplx(0, nan), cmplx(2, nan), cmplx(nan, nan)},
- Test{cmplx(0, nan), cmplx(2, inf), cmplx(nan, nan)},
- Test{cmplx(0, nan), cmplx(2, -inf), cmplx(nan, nan)},
- Test{cmplx(0, nan), cmplx(nan, 0), cmplx(nan, nan)},
- Test{cmplx(0, nan), cmplx(nan, 1), cmplx(nan, nan)},
- Test{cmplx(0, nan), cmplx(nan, -1), cmplx(nan, nan)},
- Test{cmplx(0, nan), cmplx(nan, 2), cmplx(nan, nan)},
- Test{cmplx(0, nan), cmplx(nan, nan), cmplx(nan, nan)},
- Test{cmplx(0, nan), cmplx(nan, inf), cmplx(nan, nan)},
- Test{cmplx(0, nan), cmplx(nan, -inf), cmplx(nan, nan)},
- Test{cmplx(0, nan), cmplx(inf, 0), cmplx(nan, nan)},
- Test{cmplx(0, nan), cmplx(inf, 1), cmplx(nan, nan)},
- Test{cmplx(0, nan), cmplx(inf, -1), cmplx(nan, nan)},
- Test{cmplx(0, nan), cmplx(inf, 2), cmplx(nan, nan)},
- Test{cmplx(0, nan), cmplx(inf, nan), cmplx(nan, nan)},
- Test{cmplx(0, nan), cmplx(inf, inf), cmplx(nan, nan)},
- Test{cmplx(0, nan), cmplx(inf, -inf), cmplx(nan, nan)},
- Test{cmplx(0, nan), cmplx(-inf, 0), cmplx(nan, nan)},
- Test{cmplx(0, nan), cmplx(-inf, 1), cmplx(nan, nan)},
- Test{cmplx(0, nan), cmplx(-inf, -1), cmplx(nan, nan)},
- Test{cmplx(0, nan), cmplx(-inf, 2), cmplx(nan, nan)},
- Test{cmplx(0, nan), cmplx(-inf, nan), cmplx(nan, nan)},
- Test{cmplx(0, nan), cmplx(-inf, inf), cmplx(nan, nan)},
- Test{cmplx(0, nan), cmplx(-inf, -inf), cmplx(nan, nan)},
- Test{cmplx(0, inf), cmplx(0, 0), cmplx(nan, inf)},
- Test{cmplx(0, inf), cmplx(0, 1), cmplx(inf, nan)},
- Test{cmplx(0, inf), cmplx(0, -1), cmplx(-inf, nan)},
- Test{cmplx(0, inf), cmplx(0, 2), cmplx(inf, nan)},
- Test{cmplx(0, inf), cmplx(0, nan), cmplx(nan, nan)},
- Test{cmplx(0, inf), cmplx(0, inf), cmplx(nan, nan)},
- Test{cmplx(0, inf), cmplx(0, -inf), cmplx(nan, nan)},
- Test{cmplx(0, inf), cmplx(1, 0), cmplx(nan, inf)},
- Test{cmplx(0, inf), cmplx(1, 1), cmplx(inf, inf)},
- Test{cmplx(0, inf), cmplx(1, -1), cmplx(-inf, inf)},
- Test{cmplx(0, inf), cmplx(1, 2), cmplx(inf, inf)},
- Test{cmplx(0, inf), cmplx(1, nan), cmplx(nan, nan)},
- Test{cmplx(0, inf), cmplx(1, inf), cmplx(nan, nan)},
- Test{cmplx(0, inf), cmplx(1, -inf), cmplx(nan, nan)},
- Test{cmplx(0, inf), cmplx(-1, 0), cmplx(nan, -inf)},
- Test{cmplx(0, inf), cmplx(-1, 1), cmplx(inf, -inf)},
- Test{cmplx(0, inf), cmplx(-1, -1), cmplx(-inf, -inf)},
- Test{cmplx(0, inf), cmplx(-1, 2), cmplx(inf, -inf)},
- Test{cmplx(0, inf), cmplx(-1, nan), cmplx(nan, nan)},
- Test{cmplx(0, inf), cmplx(-1, inf), cmplx(nan, nan)},
- Test{cmplx(0, inf), cmplx(-1, -inf), cmplx(nan, nan)},
- Test{cmplx(0, inf), cmplx(2, 0), cmplx(nan, inf)},
- Test{cmplx(0, inf), cmplx(2, 1), cmplx(inf, inf)},
- Test{cmplx(0, inf), cmplx(2, -1), cmplx(-inf, inf)},
- Test{cmplx(0, inf), cmplx(2, 2), cmplx(inf, inf)},
- Test{cmplx(0, inf), cmplx(2, nan), cmplx(nan, nan)},
- Test{cmplx(0, inf), cmplx(2, inf), cmplx(nan, nan)},
- Test{cmplx(0, inf), cmplx(2, -inf), cmplx(nan, nan)},
- Test{cmplx(0, inf), cmplx(nan, 0), cmplx(nan, nan)},
- Test{cmplx(0, inf), cmplx(nan, 1), cmplx(nan, nan)},
- Test{cmplx(0, inf), cmplx(nan, -1), cmplx(nan, nan)},
- Test{cmplx(0, inf), cmplx(nan, 2), cmplx(nan, nan)},
- Test{cmplx(0, inf), cmplx(nan, nan), cmplx(nan, nan)},
- Test{cmplx(0, inf), cmplx(nan, inf), cmplx(nan, nan)},
- Test{cmplx(0, inf), cmplx(nan, -inf), cmplx(nan, nan)},
- Test{cmplx(0, inf), cmplx(inf, 0), cmplx(nan, nan)},
- Test{cmplx(0, inf), cmplx(inf, 1), cmplx(nan, nan)},
- Test{cmplx(0, inf), cmplx(inf, -1), cmplx(nan, nan)},
- Test{cmplx(0, inf), cmplx(inf, 2), cmplx(nan, nan)},
- Test{cmplx(0, inf), cmplx(inf, nan), cmplx(nan, nan)},
- Test{cmplx(0, inf), cmplx(inf, inf), cmplx(nan, nan)},
- Test{cmplx(0, inf), cmplx(inf, -inf), cmplx(nan, nan)},
- Test{cmplx(0, inf), cmplx(-inf, 0), cmplx(nan, nan)},
- Test{cmplx(0, inf), cmplx(-inf, 1), cmplx(nan, nan)},
- Test{cmplx(0, inf), cmplx(-inf, -1), cmplx(nan, nan)},
- Test{cmplx(0, inf), cmplx(-inf, 2), cmplx(nan, nan)},
- Test{cmplx(0, inf), cmplx(-inf, nan), cmplx(nan, nan)},
- Test{cmplx(0, inf), cmplx(-inf, inf), cmplx(nan, nan)},
- Test{cmplx(0, inf), cmplx(-inf, -inf), cmplx(nan, nan)},
- Test{cmplx(0, -inf), cmplx(0, 0), cmplx(nan, -inf)},
- Test{cmplx(0, -inf), cmplx(0, 1), cmplx(-inf, nan)},
- Test{cmplx(0, -inf), cmplx(0, -1), cmplx(inf, nan)},
- Test{cmplx(0, -inf), cmplx(0, 2), cmplx(-inf, nan)},
- Test{cmplx(0, -inf), cmplx(0, nan), cmplx(nan, nan)},
- Test{cmplx(0, -inf), cmplx(0, inf), cmplx(nan, nan)},
- Test{cmplx(0, -inf), cmplx(0, -inf), cmplx(nan, nan)},
- Test{cmplx(0, -inf), cmplx(1, 0), cmplx(nan, -inf)},
- Test{cmplx(0, -inf), cmplx(1, 1), cmplx(-inf, -inf)},
- Test{cmplx(0, -inf), cmplx(1, -1), cmplx(inf, -inf)},
- Test{cmplx(0, -inf), cmplx(1, 2), cmplx(-inf, -inf)},
- Test{cmplx(0, -inf), cmplx(1, nan), cmplx(nan, nan)},
- Test{cmplx(0, -inf), cmplx(1, inf), cmplx(nan, nan)},
- Test{cmplx(0, -inf), cmplx(1, -inf), cmplx(nan, nan)},
- Test{cmplx(0, -inf), cmplx(-1, 0), cmplx(nan, inf)},
- Test{cmplx(0, -inf), cmplx(-1, 1), cmplx(-inf, inf)},
- Test{cmplx(0, -inf), cmplx(-1, -1), cmplx(inf, inf)},
- Test{cmplx(0, -inf), cmplx(-1, 2), cmplx(-inf, inf)},
- Test{cmplx(0, -inf), cmplx(-1, nan), cmplx(nan, nan)},
- Test{cmplx(0, -inf), cmplx(-1, inf), cmplx(nan, nan)},
- Test{cmplx(0, -inf), cmplx(-1, -inf), cmplx(nan, nan)},
- Test{cmplx(0, -inf), cmplx(2, 0), cmplx(nan, -inf)},
- Test{cmplx(0, -inf), cmplx(2, 1), cmplx(-inf, -inf)},
- Test{cmplx(0, -inf), cmplx(2, -1), cmplx(inf, -inf)},
- Test{cmplx(0, -inf), cmplx(2, 2), cmplx(-inf, -inf)},
- Test{cmplx(0, -inf), cmplx(2, nan), cmplx(nan, nan)},
- Test{cmplx(0, -inf), cmplx(2, inf), cmplx(nan, nan)},
- Test{cmplx(0, -inf), cmplx(2, -inf), cmplx(nan, nan)},
- Test{cmplx(0, -inf), cmplx(nan, 0), cmplx(nan, nan)},
- Test{cmplx(0, -inf), cmplx(nan, 1), cmplx(nan, nan)},
- Test{cmplx(0, -inf), cmplx(nan, -1), cmplx(nan, nan)},
- Test{cmplx(0, -inf), cmplx(nan, 2), cmplx(nan, nan)},
- Test{cmplx(0, -inf), cmplx(nan, nan), cmplx(nan, nan)},
- Test{cmplx(0, -inf), cmplx(nan, inf), cmplx(nan, nan)},
- Test{cmplx(0, -inf), cmplx(nan, -inf), cmplx(nan, nan)},
- Test{cmplx(0, -inf), cmplx(inf, 0), cmplx(nan, nan)},
- Test{cmplx(0, -inf), cmplx(inf, 1), cmplx(nan, nan)},
- Test{cmplx(0, -inf), cmplx(inf, -1), cmplx(nan, nan)},
- Test{cmplx(0, -inf), cmplx(inf, 2), cmplx(nan, nan)},
- Test{cmplx(0, -inf), cmplx(inf, nan), cmplx(nan, nan)},
- Test{cmplx(0, -inf), cmplx(inf, inf), cmplx(nan, nan)},
- Test{cmplx(0, -inf), cmplx(inf, -inf), cmplx(nan, nan)},
- Test{cmplx(0, -inf), cmplx(-inf, 0), cmplx(nan, nan)},
- Test{cmplx(0, -inf), cmplx(-inf, 1), cmplx(nan, nan)},
- Test{cmplx(0, -inf), cmplx(-inf, -1), cmplx(nan, nan)},
- Test{cmplx(0, -inf), cmplx(-inf, 2), cmplx(nan, nan)},
- Test{cmplx(0, -inf), cmplx(-inf, nan), cmplx(nan, nan)},
- Test{cmplx(0, -inf), cmplx(-inf, inf), cmplx(nan, nan)},
- Test{cmplx(0, -inf), cmplx(-inf, -inf), cmplx(nan, nan)},
- Test{cmplx(1, 0), cmplx(0, 0), cmplx(inf, nan)},
- Test{cmplx(1, 0), cmplx(0, 1), cmplx(0, -1)},
- Test{cmplx(1, 0), cmplx(0, -1), cmplx(negzero, 1)},
- Test{cmplx(1, 0), cmplx(0, 2), cmplx(0, -0.5)},
- Test{cmplx(1, 0), cmplx(0, nan), cmplx(nan, nan)},
- Test{cmplx(1, 0), cmplx(0, inf), cmplx(0, negzero)},
- Test{cmplx(1, 0), cmplx(0, -inf), cmplx(negzero, 0)},
- Test{cmplx(1, 0), cmplx(1, 0), cmplx(1, 0)},
- Test{cmplx(1, 0), cmplx(1, 1), cmplx(0.5, -0.5)},
- Test{cmplx(1, 0), cmplx(1, -1), cmplx(0.5, 0.5)},
- Test{cmplx(1, 0), cmplx(1, 2), cmplx(0.2, -0.4)},
- Test{cmplx(1, 0), cmplx(1, nan), cmplx(nan, nan)},
- Test{cmplx(1, 0), cmplx(1, inf), cmplx(0, negzero)},
- Test{cmplx(1, 0), cmplx(1, -inf), cmplx(negzero, 0)},
- Test{cmplx(1, 0), cmplx(-1, 0), cmplx(-1, negzero)},
- Test{cmplx(1, 0), cmplx(-1, 1), cmplx(-0.5, -0.5)},
- Test{cmplx(1, 0), cmplx(-1, -1), cmplx(-0.5, 0.5)},
- Test{cmplx(1, 0), cmplx(-1, 2), cmplx(-0.2, -0.4)},
- Test{cmplx(1, 0), cmplx(-1, nan), cmplx(nan, nan)},
- Test{cmplx(1, 0), cmplx(-1, inf), cmplx(0, negzero)},
- Test{cmplx(1, 0), cmplx(-1, -inf), cmplx(negzero, 0)},
- Test{cmplx(1, 0), cmplx(2, 0), cmplx(0.5, 0)},
- Test{cmplx(1, 0), cmplx(2, 1), cmplx(0.4, -0.2)},
- Test{cmplx(1, 0), cmplx(2, -1), cmplx(0.4, 0.2)},
- Test{cmplx(1, 0), cmplx(2, 2), cmplx(0.25, -0.25)},
- Test{cmplx(1, 0), cmplx(2, nan), cmplx(nan, nan)},
- Test{cmplx(1, 0), cmplx(2, inf), cmplx(0, negzero)},
- Test{cmplx(1, 0), cmplx(2, -inf), cmplx(negzero, 0)},
- Test{cmplx(1, 0), cmplx(nan, 0), cmplx(nan, nan)},
- Test{cmplx(1, 0), cmplx(nan, 1), cmplx(nan, nan)},
- Test{cmplx(1, 0), cmplx(nan, -1), cmplx(nan, nan)},
- Test{cmplx(1, 0), cmplx(nan, 2), cmplx(nan, nan)},
- Test{cmplx(1, 0), cmplx(nan, nan), cmplx(nan, nan)},
- Test{cmplx(1, 0), cmplx(nan, inf), cmplx(0, negzero)},
- Test{cmplx(1, 0), cmplx(nan, -inf), cmplx(0, 0)},
- Test{cmplx(1, 0), cmplx(inf, 0), cmplx(0, 0)},
- Test{cmplx(1, 0), cmplx(inf, 1), cmplx(0, 0)},
- Test{cmplx(1, 0), cmplx(inf, -1), cmplx(0, 0)},
- Test{cmplx(1, 0), cmplx(inf, 2), cmplx(0, 0)},
- Test{cmplx(1, 0), cmplx(inf, nan), cmplx(0, 0)},
- Test{cmplx(1, 0), cmplx(inf, inf), cmplx(0, negzero)},
- Test{cmplx(1, 0), cmplx(inf, -inf), cmplx(0, 0)},
- Test{cmplx(1, 0), cmplx(-inf, 0), cmplx(negzero, negzero)},
- Test{cmplx(1, 0), cmplx(-inf, 1), cmplx(negzero, negzero)},
- Test{cmplx(1, 0), cmplx(-inf, -1), cmplx(negzero, negzero)},
- Test{cmplx(1, 0), cmplx(-inf, 2), cmplx(negzero, negzero)},
- Test{cmplx(1, 0), cmplx(-inf, nan), cmplx(negzero, negzero)},
- Test{cmplx(1, 0), cmplx(-inf, inf), cmplx(negzero, negzero)},
- Test{cmplx(1, 0), cmplx(-inf, -inf), cmplx(negzero, 0)},
- Test{cmplx(1, 1), cmplx(0, 0), cmplx(inf, inf)},
- Test{cmplx(1, 1), cmplx(0, 1), cmplx(1, -1)},
- Test{cmplx(1, 1), cmplx(0, -1), cmplx(-1, 1)},
- Test{cmplx(1, 1), cmplx(0, 2), cmplx(0.5, -0.5)},
- Test{cmplx(1, 1), cmplx(0, nan), cmplx(nan, nan)},
- Test{cmplx(1, 1), cmplx(0, inf), cmplx(0, negzero)},
- Test{cmplx(1, 1), cmplx(0, -inf), cmplx(negzero, 0)},
- Test{cmplx(1, 1), cmplx(1, 0), cmplx(1, 1)},
- Test{cmplx(1, 1), cmplx(1, 1), cmplx(1, 0)},
- Test{cmplx(1, 1), cmplx(1, -1), cmplx(0, 1)},
- Test{cmplx(1, 1), cmplx(1, 2), cmplx(0.6, -0.2)},
- Test{cmplx(1, 1), cmplx(1, nan), cmplx(nan, nan)},
- Test{cmplx(1, 1), cmplx(1, inf), cmplx(0, negzero)},
- Test{cmplx(1, 1), cmplx(1, -inf), cmplx(negzero, 0)},
- Test{cmplx(1, 1), cmplx(-1, 0), cmplx(-1, -1)},
- Test{cmplx(1, 1), cmplx(-1, 1), cmplx(negzero, -1)},
- Test{cmplx(1, 1), cmplx(-1, -1), cmplx(-1, negzero)},
- Test{cmplx(1, 1), cmplx(-1, 2), cmplx(0.2, -0.6)},
- Test{cmplx(1, 1), cmplx(-1, nan), cmplx(nan, nan)},
- Test{cmplx(1, 1), cmplx(-1, inf), cmplx(0, negzero)},
- Test{cmplx(1, 1), cmplx(-1, -inf), cmplx(negzero, 0)},
- Test{cmplx(1, 1), cmplx(2, 0), cmplx(0.5, 0.5)},
- Test{cmplx(1, 1), cmplx(2, 1), cmplx(0.6, 0.2)},
- Test{cmplx(1, 1), cmplx(2, -1), cmplx(0.2, 0.6)},
- Test{cmplx(1, 1), cmplx(2, 2), cmplx(0.5, 0)},
- Test{cmplx(1, 1), cmplx(2, nan), cmplx(nan, nan)},
- Test{cmplx(1, 1), cmplx(2, inf), cmplx(0, negzero)},
- Test{cmplx(1, 1), cmplx(2, -inf), cmplx(negzero, 0)},
- Test{cmplx(1, 1), cmplx(nan, 0), cmplx(nan, nan)},
- Test{cmplx(1, 1), cmplx(nan, 1), cmplx(nan, nan)},
- Test{cmplx(1, 1), cmplx(nan, -1), cmplx(nan, nan)},
- Test{cmplx(1, 1), cmplx(nan, 2), cmplx(nan, nan)},
- Test{cmplx(1, 1), cmplx(nan, nan), cmplx(nan, nan)},
- Test{cmplx(1, 1), cmplx(nan, inf), cmplx(0, negzero)},
- Test{cmplx(1, 1), cmplx(nan, -inf), cmplx(negzero, 0)},
- Test{cmplx(1, 1), cmplx(inf, 0), cmplx(0, 0)},
- Test{cmplx(1, 1), cmplx(inf, 1), cmplx(0, 0)},
- Test{cmplx(1, 1), cmplx(inf, -1), cmplx(0, 0)},
- Test{cmplx(1, 1), cmplx(inf, 2), cmplx(0, 0)},
- Test{cmplx(1, 1), cmplx(inf, nan), cmplx(0, 0)},
- Test{cmplx(1, 1), cmplx(inf, inf), cmplx(0, 0)},
- Test{cmplx(1, 1), cmplx(inf, -inf), cmplx(0, 0)},
- Test{cmplx(1, 1), cmplx(-inf, 0), cmplx(negzero, negzero)},
- Test{cmplx(1, 1), cmplx(-inf, 1), cmplx(negzero, negzero)},
- Test{cmplx(1, 1), cmplx(-inf, -1), cmplx(negzero, negzero)},
- Test{cmplx(1, 1), cmplx(-inf, 2), cmplx(negzero, negzero)},
- Test{cmplx(1, 1), cmplx(-inf, nan), cmplx(negzero, negzero)},
- Test{cmplx(1, 1), cmplx(-inf, inf), cmplx(0, negzero)},
- Test{cmplx(1, 1), cmplx(-inf, -inf), cmplx(negzero, 0)},
- Test{cmplx(1, -1), cmplx(0, 0), cmplx(inf, -inf)},
- Test{cmplx(1, -1), cmplx(0, 1), cmplx(-1, -1)},
- Test{cmplx(1, -1), cmplx(0, -1), cmplx(1, 1)},
- Test{cmplx(1, -1), cmplx(0, 2), cmplx(-0.5, -0.5)},
- Test{cmplx(1, -1), cmplx(0, nan), cmplx(nan, nan)},
- Test{cmplx(1, -1), cmplx(0, inf), cmplx(negzero, negzero)},
- Test{cmplx(1, -1), cmplx(0, -inf), cmplx(0, 0)},
- Test{cmplx(1, -1), cmplx(1, 0), cmplx(1, -1)},
- Test{cmplx(1, -1), cmplx(1, 1), cmplx(0, -1)},
- Test{cmplx(1, -1), cmplx(1, -1), cmplx(1, 0)},
- Test{cmplx(1, -1), cmplx(1, 2), cmplx(-0.2, -0.6)},
- Test{cmplx(1, -1), cmplx(1, nan), cmplx(nan, nan)},
- Test{cmplx(1, -1), cmplx(1, inf), cmplx(negzero, negzero)},
- Test{cmplx(1, -1), cmplx(1, -inf), cmplx(0, 0)},
- Test{cmplx(1, -1), cmplx(-1, 0), cmplx(-1, 1)},
- Test{cmplx(1, -1), cmplx(-1, 1), cmplx(-1, negzero)},
- Test{cmplx(1, -1), cmplx(-1, -1), cmplx(negzero, 1)},
- Test{cmplx(1, -1), cmplx(-1, 2), cmplx(-0.6, -0.2)},
- Test{cmplx(1, -1), cmplx(-1, nan), cmplx(nan, nan)},
- Test{cmplx(1, -1), cmplx(-1, inf), cmplx(negzero, negzero)},
- Test{cmplx(1, -1), cmplx(-1, -inf), cmplx(0, 0)},
- Test{cmplx(1, -1), cmplx(2, 0), cmplx(0.5, -0.5)},
- Test{cmplx(1, -1), cmplx(2, 1), cmplx(0.2, -0.6)},
- Test{cmplx(1, -1), cmplx(2, -1), cmplx(0.6, -0.2)},
- Test{cmplx(1, -1), cmplx(2, 2), cmplx(0, -0.5)},
- Test{cmplx(1, -1), cmplx(2, nan), cmplx(nan, nan)},
- Test{cmplx(1, -1), cmplx(2, inf), cmplx(negzero, negzero)},
- Test{cmplx(1, -1), cmplx(2, -inf), cmplx(0, 0)},
- Test{cmplx(1, -1), cmplx(nan, 0), cmplx(nan, nan)},
- Test{cmplx(1, -1), cmplx(nan, 1), cmplx(nan, nan)},
- Test{cmplx(1, -1), cmplx(nan, -1), cmplx(nan, nan)},
- Test{cmplx(1, -1), cmplx(nan, 2), cmplx(nan, nan)},
- Test{cmplx(1, -1), cmplx(nan, nan), cmplx(nan, nan)},
- Test{cmplx(1, -1), cmplx(nan, inf), cmplx(negzero, negzero)},
- Test{cmplx(1, -1), cmplx(nan, -inf), cmplx(0, 0)},
- Test{cmplx(1, -1), cmplx(inf, 0), cmplx(0, negzero)},
- Test{cmplx(1, -1), cmplx(inf, 1), cmplx(0, negzero)},
- Test{cmplx(1, -1), cmplx(inf, -1), cmplx(0, negzero)},
- Test{cmplx(1, -1), cmplx(inf, 2), cmplx(0, negzero)},
- Test{cmplx(1, -1), cmplx(inf, nan), cmplx(0, negzero)},
- Test{cmplx(1, -1), cmplx(inf, inf), cmplx(0, negzero)},
- Test{cmplx(1, -1), cmplx(inf, -inf), cmplx(0, 0)},
- Test{cmplx(1, -1), cmplx(-inf, 0), cmplx(negzero, 0)},
- Test{cmplx(1, -1), cmplx(-inf, 1), cmplx(negzero, 0)},
- Test{cmplx(1, -1), cmplx(-inf, -1), cmplx(negzero, 0)},
- Test{cmplx(1, -1), cmplx(-inf, 2), cmplx(negzero, 0)},
- Test{cmplx(1, -1), cmplx(-inf, nan), cmplx(negzero, 0)},
- Test{cmplx(1, -1), cmplx(-inf, inf), cmplx(negzero, 0)},
- Test{cmplx(1, -1), cmplx(-inf, -inf), cmplx(0, 0)},
- Test{cmplx(1, 2), cmplx(0, 0), cmplx(inf, inf)},
- Test{cmplx(1, 2), cmplx(0, 1), cmplx(2, -1)},
- Test{cmplx(1, 2), cmplx(0, -1), cmplx(-2, 1)},
- Test{cmplx(1, 2), cmplx(0, 2), cmplx(1, -0.5)},
- Test{cmplx(1, 2), cmplx(0, nan), cmplx(nan, nan)},
- Test{cmplx(1, 2), cmplx(0, inf), cmplx(0, negzero)},
- Test{cmplx(1, 2), cmplx(0, -inf), cmplx(negzero, 0)},
- Test{cmplx(1, 2), cmplx(1, 0), cmplx(1, 2)},
- Test{cmplx(1, 2), cmplx(1, 1), cmplx(1.5, 0.5)},
- Test{cmplx(1, 2), cmplx(1, -1), cmplx(-0.5, 1.5)},
- Test{cmplx(1, 2), cmplx(1, 2), cmplx(1, 0)},
- Test{cmplx(1, 2), cmplx(1, nan), cmplx(nan, nan)},
- Test{cmplx(1, 2), cmplx(1, inf), cmplx(0, negzero)},
- Test{cmplx(1, 2), cmplx(1, -inf), cmplx(negzero, 0)},
- Test{cmplx(1, 2), cmplx(-1, 0), cmplx(-1, -2)},
- Test{cmplx(1, 2), cmplx(-1, 1), cmplx(0.5, -1.5)},
- Test{cmplx(1, 2), cmplx(-1, -1), cmplx(-1.5, -0.5)},
- Test{cmplx(1, 2), cmplx(-1, 2), cmplx(0.6, -0.8)},
- Test{cmplx(1, 2), cmplx(-1, nan), cmplx(nan, nan)},
- Test{cmplx(1, 2), cmplx(-1, inf), cmplx(0, negzero)},
- Test{cmplx(1, 2), cmplx(-1, -inf), cmplx(negzero, 0)},
- Test{cmplx(1, 2), cmplx(2, 0), cmplx(0.5, 1)},
- Test{cmplx(1, 2), cmplx(2, 1), cmplx(0.8, 0.6)},
- Test{cmplx(1, 2), cmplx(2, -1), cmplx(0, 1)},
- Test{cmplx(1, 2), cmplx(2, 2), cmplx(0.75, 0.25)},
- Test{cmplx(1, 2), cmplx(2, nan), cmplx(nan, nan)},
- Test{cmplx(1, 2), cmplx(2, inf), cmplx(0, negzero)},
- Test{cmplx(1, 2), cmplx(2, -inf), cmplx(negzero, 0)},
- Test{cmplx(1, 2), cmplx(nan, 0), cmplx(nan, nan)},
- Test{cmplx(1, 2), cmplx(nan, 1), cmplx(nan, nan)},
- Test{cmplx(1, 2), cmplx(nan, -1), cmplx(nan, nan)},
- Test{cmplx(1, 2), cmplx(nan, 2), cmplx(nan, nan)},
- Test{cmplx(1, 2), cmplx(nan, nan), cmplx(nan, nan)},
- Test{cmplx(1, 2), cmplx(nan, inf), cmplx(0, negzero)},
- Test{cmplx(1, 2), cmplx(nan, -inf), cmplx(negzero, 0)},
- Test{cmplx(1, 2), cmplx(inf, 0), cmplx(0, 0)},
- Test{cmplx(1, 2), cmplx(inf, 1), cmplx(0, 0)},
- Test{cmplx(1, 2), cmplx(inf, -1), cmplx(0, 0)},
- Test{cmplx(1, 2), cmplx(inf, 2), cmplx(0, 0)},
- Test{cmplx(1, 2), cmplx(inf, nan), cmplx(0, 0)},
- Test{cmplx(1, 2), cmplx(inf, inf), cmplx(0, 0)},
- Test{cmplx(1, 2), cmplx(inf, -inf), cmplx(negzero, 0)},
- Test{cmplx(1, 2), cmplx(-inf, 0), cmplx(negzero, negzero)},
- Test{cmplx(1, 2), cmplx(-inf, 1), cmplx(negzero, negzero)},
- Test{cmplx(1, 2), cmplx(-inf, -1), cmplx(negzero, negzero)},
- Test{cmplx(1, 2), cmplx(-inf, 2), cmplx(negzero, negzero)},
- Test{cmplx(1, 2), cmplx(-inf, nan), cmplx(negzero, negzero)},
- Test{cmplx(1, 2), cmplx(-inf, inf), cmplx(0, negzero)},
- Test{cmplx(1, 2), cmplx(-inf, -inf), cmplx(negzero, negzero)},
- Test{cmplx(1, nan), cmplx(0, 0), cmplx(nan, nan)},
- Test{cmplx(1, nan), cmplx(0, 1), cmplx(nan, nan)},
- Test{cmplx(1, nan), cmplx(0, -1), cmplx(nan, nan)},
- Test{cmplx(1, nan), cmplx(0, 2), cmplx(nan, nan)},
- Test{cmplx(1, nan), cmplx(0, nan), cmplx(nan, nan)},
- Test{cmplx(1, nan), cmplx(0, inf), cmplx(nan, nan)},
- Test{cmplx(1, nan), cmplx(0, -inf), cmplx(nan, nan)},
- Test{cmplx(1, nan), cmplx(1, 0), cmplx(nan, nan)},
- Test{cmplx(1, nan), cmplx(1, 1), cmplx(nan, nan)},
- Test{cmplx(1, nan), cmplx(1, -1), cmplx(nan, nan)},
- Test{cmplx(1, nan), cmplx(1, 2), cmplx(nan, nan)},
- Test{cmplx(1, nan), cmplx(1, nan), cmplx(nan, nan)},
- Test{cmplx(1, nan), cmplx(1, inf), cmplx(nan, nan)},
- Test{cmplx(1, nan), cmplx(1, -inf), cmplx(nan, nan)},
- Test{cmplx(1, nan), cmplx(-1, 0), cmplx(nan, nan)},
- Test{cmplx(1, nan), cmplx(-1, 1), cmplx(nan, nan)},
- Test{cmplx(1, nan), cmplx(-1, -1), cmplx(nan, nan)},
- Test{cmplx(1, nan), cmplx(-1, 2), cmplx(nan, nan)},
- Test{cmplx(1, nan), cmplx(-1, nan), cmplx(nan, nan)},
- Test{cmplx(1, nan), cmplx(-1, inf), cmplx(nan, nan)},
- Test{cmplx(1, nan), cmplx(-1, -inf), cmplx(nan, nan)},
- Test{cmplx(1, nan), cmplx(2, 0), cmplx(nan, nan)},
- Test{cmplx(1, nan), cmplx(2, 1), cmplx(nan, nan)},
- Test{cmplx(1, nan), cmplx(2, -1), cmplx(nan, nan)},
- Test{cmplx(1, nan), cmplx(2, 2), cmplx(nan, nan)},
- Test{cmplx(1, nan), cmplx(2, nan), cmplx(nan, nan)},
- Test{cmplx(1, nan), cmplx(2, inf), cmplx(nan, nan)},
- Test{cmplx(1, nan), cmplx(2, -inf), cmplx(nan, nan)},
- Test{cmplx(1, nan), cmplx(nan, 0), cmplx(nan, nan)},
- Test{cmplx(1, nan), cmplx(nan, 1), cmplx(nan, nan)},
- Test{cmplx(1, nan), cmplx(nan, -1), cmplx(nan, nan)},
- Test{cmplx(1, nan), cmplx(nan, 2), cmplx(nan, nan)},
- Test{cmplx(1, nan), cmplx(nan, nan), cmplx(nan, nan)},
- Test{cmplx(1, nan), cmplx(nan, inf), cmplx(nan, nan)},
- Test{cmplx(1, nan), cmplx(nan, -inf), cmplx(nan, nan)},
- Test{cmplx(1, nan), cmplx(inf, 0), cmplx(nan, nan)},
- Test{cmplx(1, nan), cmplx(inf, 1), cmplx(nan, nan)},
- Test{cmplx(1, nan), cmplx(inf, -1), cmplx(nan, nan)},
- Test{cmplx(1, nan), cmplx(inf, 2), cmplx(nan, nan)},
- Test{cmplx(1, nan), cmplx(inf, nan), cmplx(nan, nan)},
- Test{cmplx(1, nan), cmplx(inf, inf), cmplx(nan, nan)},
- Test{cmplx(1, nan), cmplx(inf, -inf), cmplx(nan, nan)},
- Test{cmplx(1, nan), cmplx(-inf, 0), cmplx(nan, nan)},
- Test{cmplx(1, nan), cmplx(-inf, 1), cmplx(nan, nan)},
- Test{cmplx(1, nan), cmplx(-inf, -1), cmplx(nan, nan)},
- Test{cmplx(1, nan), cmplx(-inf, 2), cmplx(nan, nan)},
- Test{cmplx(1, nan), cmplx(-inf, nan), cmplx(nan, nan)},
- Test{cmplx(1, nan), cmplx(-inf, inf), cmplx(nan, nan)},
- Test{cmplx(1, nan), cmplx(-inf, -inf), cmplx(nan, nan)},
- Test{cmplx(1, inf), cmplx(0, 0), cmplx(inf, inf)},
- Test{cmplx(1, inf), cmplx(0, 1), cmplx(inf, nan)},
- Test{cmplx(1, inf), cmplx(0, -1), cmplx(-inf, nan)},
- Test{cmplx(1, inf), cmplx(0, 2), cmplx(inf, nan)},
- Test{cmplx(1, inf), cmplx(0, nan), cmplx(nan, nan)},
- Test{cmplx(1, inf), cmplx(0, inf), cmplx(nan, nan)},
- Test{cmplx(1, inf), cmplx(0, -inf), cmplx(nan, nan)},
- Test{cmplx(1, inf), cmplx(1, 0), cmplx(nan, inf)},
- Test{cmplx(1, inf), cmplx(1, 1), cmplx(inf, inf)},
- Test{cmplx(1, inf), cmplx(1, -1), cmplx(-inf, inf)},
- Test{cmplx(1, inf), cmplx(1, 2), cmplx(inf, inf)},
- Test{cmplx(1, inf), cmplx(1, nan), cmplx(nan, nan)},
- Test{cmplx(1, inf), cmplx(1, inf), cmplx(nan, nan)},
- Test{cmplx(1, inf), cmplx(1, -inf), cmplx(nan, nan)},
- Test{cmplx(1, inf), cmplx(-1, 0), cmplx(nan, -inf)},
- Test{cmplx(1, inf), cmplx(-1, 1), cmplx(inf, -inf)},
- Test{cmplx(1, inf), cmplx(-1, -1), cmplx(-inf, -inf)},
- Test{cmplx(1, inf), cmplx(-1, 2), cmplx(inf, -inf)},
- Test{cmplx(1, inf), cmplx(-1, nan), cmplx(nan, nan)},
- Test{cmplx(1, inf), cmplx(-1, inf), cmplx(nan, nan)},
- Test{cmplx(1, inf), cmplx(-1, -inf), cmplx(nan, nan)},
- Test{cmplx(1, inf), cmplx(2, 0), cmplx(nan, inf)},
- Test{cmplx(1, inf), cmplx(2, 1), cmplx(inf, inf)},
- Test{cmplx(1, inf), cmplx(2, -1), cmplx(-inf, inf)},
- Test{cmplx(1, inf), cmplx(2, 2), cmplx(inf, inf)},
- Test{cmplx(1, inf), cmplx(2, nan), cmplx(nan, nan)},
- Test{cmplx(1, inf), cmplx(2, inf), cmplx(nan, nan)},
- Test{cmplx(1, inf), cmplx(2, -inf), cmplx(nan, nan)},
- Test{cmplx(1, inf), cmplx(nan, 0), cmplx(nan, nan)},
- Test{cmplx(1, inf), cmplx(nan, 1), cmplx(nan, nan)},
- Test{cmplx(1, inf), cmplx(nan, -1), cmplx(nan, nan)},
- Test{cmplx(1, inf), cmplx(nan, 2), cmplx(nan, nan)},
- Test{cmplx(1, inf), cmplx(nan, nan), cmplx(nan, nan)},
- Test{cmplx(1, inf), cmplx(nan, inf), cmplx(nan, nan)},
- Test{cmplx(1, inf), cmplx(nan, -inf), cmplx(nan, nan)},
- Test{cmplx(1, inf), cmplx(inf, 0), cmplx(nan, nan)},
- Test{cmplx(1, inf), cmplx(inf, 1), cmplx(nan, nan)},
- Test{cmplx(1, inf), cmplx(inf, -1), cmplx(nan, nan)},
- Test{cmplx(1, inf), cmplx(inf, 2), cmplx(nan, nan)},
- Test{cmplx(1, inf), cmplx(inf, nan), cmplx(nan, nan)},
- Test{cmplx(1, inf), cmplx(inf, inf), cmplx(nan, nan)},
- Test{cmplx(1, inf), cmplx(inf, -inf), cmplx(nan, nan)},
- Test{cmplx(1, inf), cmplx(-inf, 0), cmplx(nan, nan)},
- Test{cmplx(1, inf), cmplx(-inf, 1), cmplx(nan, nan)},
- Test{cmplx(1, inf), cmplx(-inf, -1), cmplx(nan, nan)},
- Test{cmplx(1, inf), cmplx(-inf, 2), cmplx(nan, nan)},
- Test{cmplx(1, inf), cmplx(-inf, nan), cmplx(nan, nan)},
- Test{cmplx(1, inf), cmplx(-inf, inf), cmplx(nan, nan)},
- Test{cmplx(1, inf), cmplx(-inf, -inf), cmplx(nan, nan)},
- Test{cmplx(1, -inf), cmplx(0, 0), cmplx(inf, -inf)},
- Test{cmplx(1, -inf), cmplx(0, 1), cmplx(-inf, nan)},
- Test{cmplx(1, -inf), cmplx(0, -1), cmplx(inf, nan)},
- Test{cmplx(1, -inf), cmplx(0, 2), cmplx(-inf, nan)},
- Test{cmplx(1, -inf), cmplx(0, nan), cmplx(nan, nan)},
- Test{cmplx(1, -inf), cmplx(0, inf), cmplx(nan, nan)},
- Test{cmplx(1, -inf), cmplx(0, -inf), cmplx(nan, nan)},
- Test{cmplx(1, -inf), cmplx(1, 0), cmplx(nan, -inf)},
- Test{cmplx(1, -inf), cmplx(1, 1), cmplx(-inf, -inf)},
- Test{cmplx(1, -inf), cmplx(1, -1), cmplx(inf, -inf)},
- Test{cmplx(1, -inf), cmplx(1, 2), cmplx(-inf, -inf)},
- Test{cmplx(1, -inf), cmplx(1, nan), cmplx(nan, nan)},
- Test{cmplx(1, -inf), cmplx(1, inf), cmplx(nan, nan)},
- Test{cmplx(1, -inf), cmplx(1, -inf), cmplx(nan, nan)},
- Test{cmplx(1, -inf), cmplx(-1, 0), cmplx(nan, inf)},
- Test{cmplx(1, -inf), cmplx(-1, 1), cmplx(-inf, inf)},
- Test{cmplx(1, -inf), cmplx(-1, -1), cmplx(inf, inf)},
- Test{cmplx(1, -inf), cmplx(-1, 2), cmplx(-inf, inf)},
- Test{cmplx(1, -inf), cmplx(-1, nan), cmplx(nan, nan)},
- Test{cmplx(1, -inf), cmplx(-1, inf), cmplx(nan, nan)},
- Test{cmplx(1, -inf), cmplx(-1, -inf), cmplx(nan, nan)},
- Test{cmplx(1, -inf), cmplx(2, 0), cmplx(nan, -inf)},
- Test{cmplx(1, -inf), cmplx(2, 1), cmplx(-inf, -inf)},
- Test{cmplx(1, -inf), cmplx(2, -1), cmplx(inf, -inf)},
- Test{cmplx(1, -inf), cmplx(2, 2), cmplx(-inf, -inf)},
- Test{cmplx(1, -inf), cmplx(2, nan), cmplx(nan, nan)},
- Test{cmplx(1, -inf), cmplx(2, inf), cmplx(nan, nan)},
- Test{cmplx(1, -inf), cmplx(2, -inf), cmplx(nan, nan)},
- Test{cmplx(1, -inf), cmplx(nan, 0), cmplx(nan, nan)},
- Test{cmplx(1, -inf), cmplx(nan, 1), cmplx(nan, nan)},
- Test{cmplx(1, -inf), cmplx(nan, -1), cmplx(nan, nan)},
- Test{cmplx(1, -inf), cmplx(nan, 2), cmplx(nan, nan)},
- Test{cmplx(1, -inf), cmplx(nan, nan), cmplx(nan, nan)},
- Test{cmplx(1, -inf), cmplx(nan, inf), cmplx(nan, nan)},
- Test{cmplx(1, -inf), cmplx(nan, -inf), cmplx(nan, nan)},
- Test{cmplx(1, -inf), cmplx(inf, 0), cmplx(nan, nan)},
- Test{cmplx(1, -inf), cmplx(inf, 1), cmplx(nan, nan)},
- Test{cmplx(1, -inf), cmplx(inf, -1), cmplx(nan, nan)},
- Test{cmplx(1, -inf), cmplx(inf, 2), cmplx(nan, nan)},
- Test{cmplx(1, -inf), cmplx(inf, nan), cmplx(nan, nan)},
- Test{cmplx(1, -inf), cmplx(inf, inf), cmplx(nan, nan)},
- Test{cmplx(1, -inf), cmplx(inf, -inf), cmplx(nan, nan)},
- Test{cmplx(1, -inf), cmplx(-inf, 0), cmplx(nan, nan)},
- Test{cmplx(1, -inf), cmplx(-inf, 1), cmplx(nan, nan)},
- Test{cmplx(1, -inf), cmplx(-inf, -1), cmplx(nan, nan)},
- Test{cmplx(1, -inf), cmplx(-inf, 2), cmplx(nan, nan)},
- Test{cmplx(1, -inf), cmplx(-inf, nan), cmplx(nan, nan)},
- Test{cmplx(1, -inf), cmplx(-inf, inf), cmplx(nan, nan)},
- Test{cmplx(1, -inf), cmplx(-inf, -inf), cmplx(nan, nan)},
- Test{cmplx(-1, 0), cmplx(0, 0), cmplx(-inf, nan)},
- Test{cmplx(-1, 0), cmplx(0, 1), cmplx(0, 1)},
- Test{cmplx(-1, 0), cmplx(0, -1), cmplx(negzero, -1)},
- Test{cmplx(-1, 0), cmplx(0, 2), cmplx(0, 0.5)},
- Test{cmplx(-1, 0), cmplx(0, nan), cmplx(nan, nan)},
- Test{cmplx(-1, 0), cmplx(0, inf), cmplx(0, 0)},
- Test{cmplx(-1, 0), cmplx(0, -inf), cmplx(negzero, negzero)},
- Test{cmplx(-1, 0), cmplx(1, 0), cmplx(-1, 0)},
- Test{cmplx(-1, 0), cmplx(1, 1), cmplx(-0.5, 0.5)},
- Test{cmplx(-1, 0), cmplx(1, -1), cmplx(-0.5, -0.5)},
- Test{cmplx(-1, 0), cmplx(1, 2), cmplx(-0.2, 0.4)},
- Test{cmplx(-1, 0), cmplx(1, nan), cmplx(nan, nan)},
- Test{cmplx(-1, 0), cmplx(1, inf), cmplx(0, 0)},
- Test{cmplx(-1, 0), cmplx(1, -inf), cmplx(negzero, negzero)},
- Test{cmplx(-1, 0), cmplx(-1, 0), cmplx(1, negzero)},
- Test{cmplx(-1, 0), cmplx(-1, 1), cmplx(0.5, 0.5)},
- Test{cmplx(-1, 0), cmplx(-1, -1), cmplx(0.5, -0.5)},
- Test{cmplx(-1, 0), cmplx(-1, 2), cmplx(0.2, 0.4)},
- Test{cmplx(-1, 0), cmplx(-1, nan), cmplx(nan, nan)},
- Test{cmplx(-1, 0), cmplx(-1, inf), cmplx(0, 0)},
- Test{cmplx(-1, 0), cmplx(-1, -inf), cmplx(negzero, negzero)},
- Test{cmplx(-1, 0), cmplx(2, 0), cmplx(-0.5, 0)},
- Test{cmplx(-1, 0), cmplx(2, 1), cmplx(-0.4, 0.2)},
- Test{cmplx(-1, 0), cmplx(2, -1), cmplx(-0.4, -0.2)},
- Test{cmplx(-1, 0), cmplx(2, 2), cmplx(-0.25, 0.25)},
- Test{cmplx(-1, 0), cmplx(2, nan), cmplx(nan, nan)},
- Test{cmplx(-1, 0), cmplx(2, inf), cmplx(0, 0)},
- Test{cmplx(-1, 0), cmplx(2, -inf), cmplx(negzero, negzero)},
- Test{cmplx(-1, 0), cmplx(nan, 0), cmplx(nan, nan)},
- Test{cmplx(-1, 0), cmplx(nan, 1), cmplx(nan, nan)},
- Test{cmplx(-1, 0), cmplx(nan, -1), cmplx(nan, nan)},
- Test{cmplx(-1, 0), cmplx(nan, 2), cmplx(nan, nan)},
- Test{cmplx(-1, 0), cmplx(nan, nan), cmplx(nan, nan)},
- Test{cmplx(-1, 0), cmplx(nan, inf), cmplx(0, 0)},
- Test{cmplx(-1, 0), cmplx(nan, -inf), cmplx(negzero, negzero)},
- Test{cmplx(-1, 0), cmplx(inf, 0), cmplx(negzero, 0)},
- Test{cmplx(-1, 0), cmplx(inf, 1), cmplx(negzero, 0)},
- Test{cmplx(-1, 0), cmplx(inf, -1), cmplx(negzero, 0)},
- Test{cmplx(-1, 0), cmplx(inf, 2), cmplx(negzero, 0)},
- Test{cmplx(-1, 0), cmplx(inf, nan), cmplx(negzero, 0)},
- Test{cmplx(-1, 0), cmplx(inf, inf), cmplx(negzero, 0)},
- Test{cmplx(-1, 0), cmplx(inf, -inf), cmplx(negzero, negzero)},
- Test{cmplx(-1, 0), cmplx(-inf, 0), cmplx(0, negzero)},
- Test{cmplx(-1, 0), cmplx(-inf, 1), cmplx(0, negzero)},
- Test{cmplx(-1, 0), cmplx(-inf, -1), cmplx(0, negzero)},
- Test{cmplx(-1, 0), cmplx(-inf, 2), cmplx(0, negzero)},
- Test{cmplx(-1, 0), cmplx(-inf, nan), cmplx(0, 0)},
- Test{cmplx(-1, 0), cmplx(-inf, inf), cmplx(0, 0)},
- Test{cmplx(-1, 0), cmplx(-inf, -inf), cmplx(0, negzero)},
- Test{cmplx(-1, 1), cmplx(0, 0), cmplx(-inf, inf)},
- Test{cmplx(-1, 1), cmplx(0, 1), cmplx(1, 1)},
- Test{cmplx(-1, 1), cmplx(0, -1), cmplx(-1, -1)},
- Test{cmplx(-1, 1), cmplx(0, 2), cmplx(0.5, 0.5)},
- Test{cmplx(-1, 1), cmplx(0, nan), cmplx(nan, nan)},
- Test{cmplx(-1, 1), cmplx(0, inf), cmplx(0, 0)},
- Test{cmplx(-1, 1), cmplx(0, -inf), cmplx(negzero, negzero)},
- Test{cmplx(-1, 1), cmplx(1, 0), cmplx(-1, 1)},
- Test{cmplx(-1, 1), cmplx(1, 1), cmplx(0, 1)},
- Test{cmplx(-1, 1), cmplx(1, -1), cmplx(-1, 0)},
- Test{cmplx(-1, 1), cmplx(1, 2), cmplx(0.2, 0.6)},
- Test{cmplx(-1, 1), cmplx(1, nan), cmplx(nan, nan)},
- Test{cmplx(-1, 1), cmplx(1, inf), cmplx(0, 0)},
- Test{cmplx(-1, 1), cmplx(1, -inf), cmplx(negzero, negzero)},
- Test{cmplx(-1, 1), cmplx(-1, 0), cmplx(1, -1)},
- Test{cmplx(-1, 1), cmplx(-1, 1), cmplx(1, negzero)},
- Test{cmplx(-1, 1), cmplx(-1, -1), cmplx(negzero, -1)},
- Test{cmplx(-1, 1), cmplx(-1, 2), cmplx(0.6, 0.2)},
- Test{cmplx(-1, 1), cmplx(-1, nan), cmplx(nan, nan)},
- Test{cmplx(-1, 1), cmplx(-1, inf), cmplx(0, 0)},
- Test{cmplx(-1, 1), cmplx(-1, -inf), cmplx(negzero, negzero)},
- Test{cmplx(-1, 1), cmplx(2, 0), cmplx(-0.5, 0.5)},
- Test{cmplx(-1, 1), cmplx(2, 1), cmplx(-0.2, 0.6)},
- Test{cmplx(-1, 1), cmplx(2, -1), cmplx(-0.6, 0.2)},
- Test{cmplx(-1, 1), cmplx(2, 2), cmplx(0, 0.5)},
- Test{cmplx(-1, 1), cmplx(2, nan), cmplx(nan, nan)},
- Test{cmplx(-1, 1), cmplx(2, inf), cmplx(0, 0)},
- Test{cmplx(-1, 1), cmplx(2, -inf), cmplx(negzero, negzero)},
- Test{cmplx(-1, 1), cmplx(nan, 0), cmplx(nan, nan)},
- Test{cmplx(-1, 1), cmplx(nan, 1), cmplx(nan, nan)},
- Test{cmplx(-1, 1), cmplx(nan, -1), cmplx(nan, nan)},
- Test{cmplx(-1, 1), cmplx(nan, 2), cmplx(nan, nan)},
- Test{cmplx(-1, 1), cmplx(nan, nan), cmplx(nan, nan)},
- Test{cmplx(-1, 1), cmplx(nan, inf), cmplx(0, 0)},
- Test{cmplx(-1, 1), cmplx(nan, -inf), cmplx(negzero, negzero)},
- Test{cmplx(-1, 1), cmplx(inf, 0), cmplx(negzero, 0)},
- Test{cmplx(-1, 1), cmplx(inf, 1), cmplx(negzero, 0)},
- Test{cmplx(-1, 1), cmplx(inf, -1), cmplx(negzero, 0)},
- Test{cmplx(-1, 1), cmplx(inf, 2), cmplx(negzero, 0)},
- Test{cmplx(-1, 1), cmplx(inf, nan), cmplx(negzero, 0)},
- Test{cmplx(-1, 1), cmplx(inf, inf), cmplx(0, 0)},
- Test{cmplx(-1, 1), cmplx(inf, -inf), cmplx(negzero, 0)},
- Test{cmplx(-1, 1), cmplx(-inf, 0), cmplx(0, negzero)},
- Test{cmplx(-1, 1), cmplx(-inf, 1), cmplx(0, negzero)},
- Test{cmplx(-1, 1), cmplx(-inf, -1), cmplx(0, negzero)},
- Test{cmplx(-1, 1), cmplx(-inf, 2), cmplx(0, negzero)},
- Test{cmplx(-1, 1), cmplx(-inf, nan), cmplx(0, negzero)},
- Test{cmplx(-1, 1), cmplx(-inf, inf), cmplx(0, 0)},
- Test{cmplx(-1, 1), cmplx(-inf, -inf), cmplx(0, negzero)},
- Test{cmplx(-1, -1), cmplx(0, 0), cmplx(-inf, -inf)},
- Test{cmplx(-1, -1), cmplx(0, 1), cmplx(-1, 1)},
- Test{cmplx(-1, -1), cmplx(0, -1), cmplx(1, -1)},
- Test{cmplx(-1, -1), cmplx(0, 2), cmplx(-0.5, 0.5)},
- Test{cmplx(-1, -1), cmplx(0, nan), cmplx(nan, nan)},
- Test{cmplx(-1, -1), cmplx(0, inf), cmplx(negzero, 0)},
- Test{cmplx(-1, -1), cmplx(0, -inf), cmplx(0, negzero)},
- Test{cmplx(-1, -1), cmplx(1, 0), cmplx(-1, -1)},
- Test{cmplx(-1, -1), cmplx(1, 1), cmplx(-1, 0)},
- Test{cmplx(-1, -1), cmplx(1, -1), cmplx(0, -1)},
- Test{cmplx(-1, -1), cmplx(1, 2), cmplx(-0.6, 0.2)},
- Test{cmplx(-1, -1), cmplx(1, nan), cmplx(nan, nan)},
- Test{cmplx(-1, -1), cmplx(1, inf), cmplx(negzero, 0)},
- Test{cmplx(-1, -1), cmplx(1, -inf), cmplx(0, negzero)},
- Test{cmplx(-1, -1), cmplx(-1, 0), cmplx(1, 1)},
- Test{cmplx(-1, -1), cmplx(-1, 1), cmplx(negzero, 1)},
- Test{cmplx(-1, -1), cmplx(-1, -1), cmplx(1, negzero)},
- Test{cmplx(-1, -1), cmplx(-1, 2), cmplx(-0.2, 0.6)},
- Test{cmplx(-1, -1), cmplx(-1, nan), cmplx(nan, nan)},
- Test{cmplx(-1, -1), cmplx(-1, inf), cmplx(negzero, 0)},
- Test{cmplx(-1, -1), cmplx(-1, -inf), cmplx(0, negzero)},
- Test{cmplx(-1, -1), cmplx(2, 0), cmplx(-0.5, -0.5)},
- Test{cmplx(-1, -1), cmplx(2, 1), cmplx(-0.6, -0.2)},
- Test{cmplx(-1, -1), cmplx(2, -1), cmplx(-0.2, -0.6)},
- Test{cmplx(-1, -1), cmplx(2, 2), cmplx(-0.5, 0)},
- Test{cmplx(-1, -1), cmplx(2, nan), cmplx(nan, nan)},
- Test{cmplx(-1, -1), cmplx(2, inf), cmplx(negzero, 0)},
- Test{cmplx(-1, -1), cmplx(2, -inf), cmplx(0, negzero)},
- Test{cmplx(-1, -1), cmplx(nan, 0), cmplx(nan, nan)},
- Test{cmplx(-1, -1), cmplx(nan, 1), cmplx(nan, nan)},
- Test{cmplx(-1, -1), cmplx(nan, -1), cmplx(nan, nan)},
- Test{cmplx(-1, -1), cmplx(nan, 2), cmplx(nan, nan)},
- Test{cmplx(-1, -1), cmplx(nan, nan), cmplx(nan, nan)},
- Test{cmplx(-1, -1), cmplx(nan, inf), cmplx(negzero, 0)},
- Test{cmplx(-1, -1), cmplx(nan, -inf), cmplx(0, negzero)},
- Test{cmplx(-1, -1), cmplx(inf, 0), cmplx(negzero, negzero)},
- Test{cmplx(-1, -1), cmplx(inf, 1), cmplx(negzero, negzero)},
- Test{cmplx(-1, -1), cmplx(inf, -1), cmplx(negzero, negzero)},
- Test{cmplx(-1, -1), cmplx(inf, 2), cmplx(negzero, negzero)},
- Test{cmplx(-1, -1), cmplx(inf, nan), cmplx(negzero, negzero)},
- Test{cmplx(-1, -1), cmplx(inf, inf), cmplx(negzero, 0)},
- Test{cmplx(-1, -1), cmplx(inf, -inf), cmplx(0, negzero)},
- Test{cmplx(-1, -1), cmplx(-inf, 0), cmplx(0, 0)},
- Test{cmplx(-1, -1), cmplx(-inf, 1), cmplx(0, 0)},
- Test{cmplx(-1, -1), cmplx(-inf, -1), cmplx(0, 0)},
- Test{cmplx(-1, -1), cmplx(-inf, 2), cmplx(0, 0)},
- Test{cmplx(-1, -1), cmplx(-inf, nan), cmplx(0, 0)},
- Test{cmplx(-1, -1), cmplx(-inf, inf), cmplx(0, 0)},
- Test{cmplx(-1, -1), cmplx(-inf, -inf), cmplx(0, 0)},
- Test{cmplx(-1, 2), cmplx(0, 0), cmplx(-inf, inf)},
- Test{cmplx(-1, 2), cmplx(0, 1), cmplx(2, 1)},
- Test{cmplx(-1, 2), cmplx(0, -1), cmplx(-2, -1)},
- Test{cmplx(-1, 2), cmplx(0, 2), cmplx(1, 0.5)},
- Test{cmplx(-1, 2), cmplx(0, nan), cmplx(nan, nan)},
- Test{cmplx(-1, 2), cmplx(0, inf), cmplx(0, 0)},
- Test{cmplx(-1, 2), cmplx(0, -inf), cmplx(negzero, negzero)},
- Test{cmplx(-1, 2), cmplx(1, 0), cmplx(-1, 2)},
- Test{cmplx(-1, 2), cmplx(1, 1), cmplx(0.5, 1.5)},
- Test{cmplx(-1, 2), cmplx(1, -1), cmplx(-1.5, 0.5)},
- Test{cmplx(-1, 2), cmplx(1, 2), cmplx(0.6, 0.8)},
- Test{cmplx(-1, 2), cmplx(1, nan), cmplx(nan, nan)},
- Test{cmplx(-1, 2), cmplx(1, inf), cmplx(0, 0)},
- Test{cmplx(-1, 2), cmplx(1, -inf), cmplx(negzero, negzero)},
- Test{cmplx(-1, 2), cmplx(-1, 0), cmplx(1, -2)},
- Test{cmplx(-1, 2), cmplx(-1, 1), cmplx(1.5, -0.5)},
- Test{cmplx(-1, 2), cmplx(-1, -1), cmplx(-0.5, -1.5)},
- Test{cmplx(-1, 2), cmplx(-1, 2), cmplx(1, 0)},
- Test{cmplx(-1, 2), cmplx(-1, nan), cmplx(nan, nan)},
- Test{cmplx(-1, 2), cmplx(-1, inf), cmplx(0, 0)},
- Test{cmplx(-1, 2), cmplx(-1, -inf), cmplx(negzero, negzero)},
- Test{cmplx(-1, 2), cmplx(2, 0), cmplx(-0.5, 1)},
- Test{cmplx(-1, 2), cmplx(2, 1), cmplx(0, 1)},
- Test{cmplx(-1, 2), cmplx(2, -1), cmplx(-0.8, 0.6)},
- Test{cmplx(-1, 2), cmplx(2, 2), cmplx(0.25, 0.75)},
- Test{cmplx(-1, 2), cmplx(2, nan), cmplx(nan, nan)},
- Test{cmplx(-1, 2), cmplx(2, inf), cmplx(0, 0)},
- Test{cmplx(-1, 2), cmplx(2, -inf), cmplx(negzero, negzero)},
- Test{cmplx(-1, 2), cmplx(nan, 0), cmplx(nan, nan)},
- Test{cmplx(-1, 2), cmplx(nan, 1), cmplx(nan, nan)},
- Test{cmplx(-1, 2), cmplx(nan, -1), cmplx(nan, nan)},
- Test{cmplx(-1, 2), cmplx(nan, 2), cmplx(nan, nan)},
- Test{cmplx(-1, 2), cmplx(nan, nan), cmplx(nan, nan)},
- Test{cmplx(-1, 2), cmplx(nan, inf), cmplx(0, 0)},
- Test{cmplx(-1, 2), cmplx(nan, -inf), cmplx(negzero, negzero)},
- Test{cmplx(-1, 2), cmplx(inf, 0), cmplx(negzero, 0)},
- Test{cmplx(-1, 2), cmplx(inf, 1), cmplx(negzero, 0)},
- Test{cmplx(-1, 2), cmplx(inf, -1), cmplx(negzero, 0)},
- Test{cmplx(-1, 2), cmplx(inf, 2), cmplx(negzero, 0)},
- Test{cmplx(-1, 2), cmplx(inf, nan), cmplx(negzero, 0)},
- Test{cmplx(-1, 2), cmplx(inf, inf), cmplx(0, 0)},
- Test{cmplx(-1, 2), cmplx(inf, -inf), cmplx(negzero, 0)},
- Test{cmplx(-1, 2), cmplx(-inf, 0), cmplx(0, negzero)},
- Test{cmplx(-1, 2), cmplx(-inf, 1), cmplx(0, negzero)},
- Test{cmplx(-1, 2), cmplx(-inf, -1), cmplx(0, negzero)},
- Test{cmplx(-1, 2), cmplx(-inf, 2), cmplx(0, negzero)},
- Test{cmplx(-1, 2), cmplx(-inf, nan), cmplx(0, negzero)},
- Test{cmplx(-1, 2), cmplx(-inf, inf), cmplx(0, negzero)},
- Test{cmplx(-1, 2), cmplx(-inf, -inf), cmplx(negzero, negzero)},
- Test{cmplx(-1, nan), cmplx(0, 0), cmplx(nan, nan)},
- Test{cmplx(-1, nan), cmplx(0, 1), cmplx(nan, nan)},
- Test{cmplx(-1, nan), cmplx(0, -1), cmplx(nan, nan)},
- Test{cmplx(-1, nan), cmplx(0, 2), cmplx(nan, nan)},
- Test{cmplx(-1, nan), cmplx(0, nan), cmplx(nan, nan)},
- Test{cmplx(-1, nan), cmplx(0, inf), cmplx(nan, nan)},
- Test{cmplx(-1, nan), cmplx(0, -inf), cmplx(nan, nan)},
- Test{cmplx(-1, nan), cmplx(1, 0), cmplx(nan, nan)},
- Test{cmplx(-1, nan), cmplx(1, 1), cmplx(nan, nan)},
- Test{cmplx(-1, nan), cmplx(1, -1), cmplx(nan, nan)},
- Test{cmplx(-1, nan), cmplx(1, 2), cmplx(nan, nan)},
- Test{cmplx(-1, nan), cmplx(1, nan), cmplx(nan, nan)},
- Test{cmplx(-1, nan), cmplx(1, inf), cmplx(nan, nan)},
- Test{cmplx(-1, nan), cmplx(1, -inf), cmplx(nan, nan)},
- Test{cmplx(-1, nan), cmplx(-1, 0), cmplx(nan, nan)},
- Test{cmplx(-1, nan), cmplx(-1, 1), cmplx(nan, nan)},
- Test{cmplx(-1, nan), cmplx(-1, -1), cmplx(nan, nan)},
- Test{cmplx(-1, nan), cmplx(-1, 2), cmplx(nan, nan)},
- Test{cmplx(-1, nan), cmplx(-1, nan), cmplx(nan, nan)},
- Test{cmplx(-1, nan), cmplx(-1, inf), cmplx(nan, nan)},
- Test{cmplx(-1, nan), cmplx(-1, -inf), cmplx(nan, nan)},
- Test{cmplx(-1, nan), cmplx(2, 0), cmplx(nan, nan)},
- Test{cmplx(-1, nan), cmplx(2, 1), cmplx(nan, nan)},
- Test{cmplx(-1, nan), cmplx(2, -1), cmplx(nan, nan)},
- Test{cmplx(-1, nan), cmplx(2, 2), cmplx(nan, nan)},
- Test{cmplx(-1, nan), cmplx(2, nan), cmplx(nan, nan)},
- Test{cmplx(-1, nan), cmplx(2, inf), cmplx(nan, nan)},
- Test{cmplx(-1, nan), cmplx(2, -inf), cmplx(nan, nan)},
- Test{cmplx(-1, nan), cmplx(nan, 0), cmplx(nan, nan)},
- Test{cmplx(-1, nan), cmplx(nan, 1), cmplx(nan, nan)},
- Test{cmplx(-1, nan), cmplx(nan, -1), cmplx(nan, nan)},
- Test{cmplx(-1, nan), cmplx(nan, 2), cmplx(nan, nan)},
- Test{cmplx(-1, nan), cmplx(nan, nan), cmplx(nan, nan)},
- Test{cmplx(-1, nan), cmplx(nan, inf), cmplx(nan, nan)},
- Test{cmplx(-1, nan), cmplx(nan, -inf), cmplx(nan, nan)},
- Test{cmplx(-1, nan), cmplx(inf, 0), cmplx(nan, nan)},
- Test{cmplx(-1, nan), cmplx(inf, 1), cmplx(nan, nan)},
- Test{cmplx(-1, nan), cmplx(inf, -1), cmplx(nan, nan)},
- Test{cmplx(-1, nan), cmplx(inf, 2), cmplx(nan, nan)},
- Test{cmplx(-1, nan), cmplx(inf, nan), cmplx(nan, nan)},
- Test{cmplx(-1, nan), cmplx(inf, inf), cmplx(nan, nan)},
- Test{cmplx(-1, nan), cmplx(inf, -inf), cmplx(nan, nan)},
- Test{cmplx(-1, nan), cmplx(-inf, 0), cmplx(nan, nan)},
- Test{cmplx(-1, nan), cmplx(-inf, 1), cmplx(nan, nan)},
- Test{cmplx(-1, nan), cmplx(-inf, -1), cmplx(nan, nan)},
- Test{cmplx(-1, nan), cmplx(-inf, 2), cmplx(nan, nan)},
- Test{cmplx(-1, nan), cmplx(-inf, nan), cmplx(nan, nan)},
- Test{cmplx(-1, nan), cmplx(-inf, inf), cmplx(nan, nan)},
- Test{cmplx(-1, nan), cmplx(-inf, -inf), cmplx(nan, nan)},
- Test{cmplx(-1, inf), cmplx(0, 0), cmplx(-inf, inf)},
- Test{cmplx(-1, inf), cmplx(0, 1), cmplx(inf, nan)},
- Test{cmplx(-1, inf), cmplx(0, -1), cmplx(-inf, nan)},
- Test{cmplx(-1, inf), cmplx(0, 2), cmplx(inf, nan)},
- Test{cmplx(-1, inf), cmplx(0, nan), cmplx(nan, nan)},
- Test{cmplx(-1, inf), cmplx(0, inf), cmplx(nan, nan)},
- Test{cmplx(-1, inf), cmplx(0, -inf), cmplx(nan, nan)},
- Test{cmplx(-1, inf), cmplx(1, 0), cmplx(nan, inf)},
- Test{cmplx(-1, inf), cmplx(1, 1), cmplx(inf, inf)},
- Test{cmplx(-1, inf), cmplx(1, -1), cmplx(-inf, inf)},
- Test{cmplx(-1, inf), cmplx(1, 2), cmplx(inf, inf)},
- Test{cmplx(-1, inf), cmplx(1, nan), cmplx(nan, nan)},
- Test{cmplx(-1, inf), cmplx(1, inf), cmplx(nan, nan)},
- Test{cmplx(-1, inf), cmplx(1, -inf), cmplx(nan, nan)},
- Test{cmplx(-1, inf), cmplx(-1, 0), cmplx(nan, -inf)},
- Test{cmplx(-1, inf), cmplx(-1, 1), cmplx(inf, -inf)},
- Test{cmplx(-1, inf), cmplx(-1, -1), cmplx(-inf, -inf)},
- Test{cmplx(-1, inf), cmplx(-1, 2), cmplx(inf, -inf)},
- Test{cmplx(-1, inf), cmplx(-1, nan), cmplx(nan, nan)},
- Test{cmplx(-1, inf), cmplx(-1, inf), cmplx(nan, nan)},
- Test{cmplx(-1, inf), cmplx(-1, -inf), cmplx(nan, nan)},
- Test{cmplx(-1, inf), cmplx(2, 0), cmplx(nan, inf)},
- Test{cmplx(-1, inf), cmplx(2, 1), cmplx(inf, inf)},
- Test{cmplx(-1, inf), cmplx(2, -1), cmplx(-inf, inf)},
- Test{cmplx(-1, inf), cmplx(2, 2), cmplx(inf, inf)},
- Test{cmplx(-1, inf), cmplx(2, nan), cmplx(nan, nan)},
- Test{cmplx(-1, inf), cmplx(2, inf), cmplx(nan, nan)},
- Test{cmplx(-1, inf), cmplx(2, -inf), cmplx(nan, nan)},
- Test{cmplx(-1, inf), cmplx(nan, 0), cmplx(nan, nan)},
- Test{cmplx(-1, inf), cmplx(nan, 1), cmplx(nan, nan)},
- Test{cmplx(-1, inf), cmplx(nan, -1), cmplx(nan, nan)},
- Test{cmplx(-1, inf), cmplx(nan, 2), cmplx(nan, nan)},
- Test{cmplx(-1, inf), cmplx(nan, nan), cmplx(nan, nan)},
- Test{cmplx(-1, inf), cmplx(nan, inf), cmplx(nan, nan)},
- Test{cmplx(-1, inf), cmplx(nan, -inf), cmplx(nan, nan)},
- Test{cmplx(-1, inf), cmplx(inf, 0), cmplx(nan, nan)},
- Test{cmplx(-1, inf), cmplx(inf, 1), cmplx(nan, nan)},
- Test{cmplx(-1, inf), cmplx(inf, -1), cmplx(nan, nan)},
- Test{cmplx(-1, inf), cmplx(inf, 2), cmplx(nan, nan)},
- Test{cmplx(-1, inf), cmplx(inf, nan), cmplx(nan, nan)},
- Test{cmplx(-1, inf), cmplx(inf, inf), cmplx(nan, nan)},
- Test{cmplx(-1, inf), cmplx(inf, -inf), cmplx(nan, nan)},
- Test{cmplx(-1, inf), cmplx(-inf, 0), cmplx(nan, nan)},
- Test{cmplx(-1, inf), cmplx(-inf, 1), cmplx(nan, nan)},
- Test{cmplx(-1, inf), cmplx(-inf, -1), cmplx(nan, nan)},
- Test{cmplx(-1, inf), cmplx(-inf, 2), cmplx(nan, nan)},
- Test{cmplx(-1, inf), cmplx(-inf, nan), cmplx(nan, nan)},
- Test{cmplx(-1, inf), cmplx(-inf, inf), cmplx(nan, nan)},
- Test{cmplx(-1, inf), cmplx(-inf, -inf), cmplx(nan, nan)},
- Test{cmplx(-1, -inf), cmplx(0, 0), cmplx(-inf, -inf)},
- Test{cmplx(-1, -inf), cmplx(0, 1), cmplx(-inf, nan)},
- Test{cmplx(-1, -inf), cmplx(0, -1), cmplx(inf, nan)},
- Test{cmplx(-1, -inf), cmplx(0, 2), cmplx(-inf, nan)},
- Test{cmplx(-1, -inf), cmplx(0, nan), cmplx(nan, nan)},
- Test{cmplx(-1, -inf), cmplx(0, inf), cmplx(nan, nan)},
- Test{cmplx(-1, -inf), cmplx(0, -inf), cmplx(nan, nan)},
- Test{cmplx(-1, -inf), cmplx(1, 0), cmplx(nan, -inf)},
- Test{cmplx(-1, -inf), cmplx(1, 1), cmplx(-inf, -inf)},
- Test{cmplx(-1, -inf), cmplx(1, -1), cmplx(inf, -inf)},
- Test{cmplx(-1, -inf), cmplx(1, 2), cmplx(-inf, -inf)},
- Test{cmplx(-1, -inf), cmplx(1, nan), cmplx(nan, nan)},
- Test{cmplx(-1, -inf), cmplx(1, inf), cmplx(nan, nan)},
- Test{cmplx(-1, -inf), cmplx(1, -inf), cmplx(nan, nan)},
- Test{cmplx(-1, -inf), cmplx(-1, 0), cmplx(nan, inf)},
- Test{cmplx(-1, -inf), cmplx(-1, 1), cmplx(-inf, inf)},
- Test{cmplx(-1, -inf), cmplx(-1, -1), cmplx(inf, inf)},
- Test{cmplx(-1, -inf), cmplx(-1, 2), cmplx(-inf, inf)},
- Test{cmplx(-1, -inf), cmplx(-1, nan), cmplx(nan, nan)},
- Test{cmplx(-1, -inf), cmplx(-1, inf), cmplx(nan, nan)},
- Test{cmplx(-1, -inf), cmplx(-1, -inf), cmplx(nan, nan)},
- Test{cmplx(-1, -inf), cmplx(2, 0), cmplx(nan, -inf)},
- Test{cmplx(-1, -inf), cmplx(2, 1), cmplx(-inf, -inf)},
- Test{cmplx(-1, -inf), cmplx(2, -1), cmplx(inf, -inf)},
- Test{cmplx(-1, -inf), cmplx(2, 2), cmplx(-inf, -inf)},
- Test{cmplx(-1, -inf), cmplx(2, nan), cmplx(nan, nan)},
- Test{cmplx(-1, -inf), cmplx(2, inf), cmplx(nan, nan)},
- Test{cmplx(-1, -inf), cmplx(2, -inf), cmplx(nan, nan)},
- Test{cmplx(-1, -inf), cmplx(nan, 0), cmplx(nan, nan)},
- Test{cmplx(-1, -inf), cmplx(nan, 1), cmplx(nan, nan)},
- Test{cmplx(-1, -inf), cmplx(nan, -1), cmplx(nan, nan)},
- Test{cmplx(-1, -inf), cmplx(nan, 2), cmplx(nan, nan)},
- Test{cmplx(-1, -inf), cmplx(nan, nan), cmplx(nan, nan)},
- Test{cmplx(-1, -inf), cmplx(nan, inf), cmplx(nan, nan)},
- Test{cmplx(-1, -inf), cmplx(nan, -inf), cmplx(nan, nan)},
- Test{cmplx(-1, -inf), cmplx(inf, 0), cmplx(nan, nan)},
- Test{cmplx(-1, -inf), cmplx(inf, 1), cmplx(nan, nan)},
- Test{cmplx(-1, -inf), cmplx(inf, -1), cmplx(nan, nan)},
- Test{cmplx(-1, -inf), cmplx(inf, 2), cmplx(nan, nan)},
- Test{cmplx(-1, -inf), cmplx(inf, nan), cmplx(nan, nan)},
- Test{cmplx(-1, -inf), cmplx(inf, inf), cmplx(nan, nan)},
- Test{cmplx(-1, -inf), cmplx(inf, -inf), cmplx(nan, nan)},
- Test{cmplx(-1, -inf), cmplx(-inf, 0), cmplx(nan, nan)},
- Test{cmplx(-1, -inf), cmplx(-inf, 1), cmplx(nan, nan)},
- Test{cmplx(-1, -inf), cmplx(-inf, -1), cmplx(nan, nan)},
- Test{cmplx(-1, -inf), cmplx(-inf, 2), cmplx(nan, nan)},
- Test{cmplx(-1, -inf), cmplx(-inf, nan), cmplx(nan, nan)},
- Test{cmplx(-1, -inf), cmplx(-inf, inf), cmplx(nan, nan)},
- Test{cmplx(-1, -inf), cmplx(-inf, -inf), cmplx(nan, nan)},
- Test{cmplx(2, 0), cmplx(0, 0), cmplx(inf, nan)},
- Test{cmplx(2, 0), cmplx(0, 1), cmplx(0, -2)},
- Test{cmplx(2, 0), cmplx(0, -1), cmplx(negzero, 2)},
- Test{cmplx(2, 0), cmplx(0, 2), cmplx(0, -1)},
- Test{cmplx(2, 0), cmplx(0, nan), cmplx(nan, nan)},
- Test{cmplx(2, 0), cmplx(0, inf), cmplx(0, negzero)},
- Test{cmplx(2, 0), cmplx(0, -inf), cmplx(negzero, 0)},
- Test{cmplx(2, 0), cmplx(1, 0), cmplx(2, 0)},
- Test{cmplx(2, 0), cmplx(1, 1), cmplx(1, -1)},
- Test{cmplx(2, 0), cmplx(1, -1), cmplx(1, 1)},
- Test{cmplx(2, 0), cmplx(1, 2), cmplx(0.4, -0.8)},
- Test{cmplx(2, 0), cmplx(1, nan), cmplx(nan, nan)},
- Test{cmplx(2, 0), cmplx(1, inf), cmplx(0, negzero)},
- Test{cmplx(2, 0), cmplx(1, -inf), cmplx(negzero, 0)},
- Test{cmplx(2, 0), cmplx(-1, 0), cmplx(-2, negzero)},
- Test{cmplx(2, 0), cmplx(-1, 1), cmplx(-1, -1)},
- Test{cmplx(2, 0), cmplx(-1, -1), cmplx(-1, 1)},
- Test{cmplx(2, 0), cmplx(-1, 2), cmplx(-0.4, -0.8)},
- Test{cmplx(2, 0), cmplx(-1, nan), cmplx(nan, nan)},
- Test{cmplx(2, 0), cmplx(-1, inf), cmplx(0, negzero)},
- Test{cmplx(2, 0), cmplx(-1, -inf), cmplx(negzero, 0)},
- Test{cmplx(2, 0), cmplx(2, 0), cmplx(1, 0)},
- Test{cmplx(2, 0), cmplx(2, 1), cmplx(0.8, -0.4)},
- Test{cmplx(2, 0), cmplx(2, -1), cmplx(0.8, 0.4)},
- Test{cmplx(2, 0), cmplx(2, 2), cmplx(0.5, -0.5)},
- Test{cmplx(2, 0), cmplx(2, nan), cmplx(nan, nan)},
- Test{cmplx(2, 0), cmplx(2, inf), cmplx(0, negzero)},
- Test{cmplx(2, 0), cmplx(2, -inf), cmplx(negzero, 0)},
- Test{cmplx(2, 0), cmplx(nan, 0), cmplx(nan, nan)},
- Test{cmplx(2, 0), cmplx(nan, 1), cmplx(nan, nan)},
- Test{cmplx(2, 0), cmplx(nan, -1), cmplx(nan, nan)},
- Test{cmplx(2, 0), cmplx(nan, 2), cmplx(nan, nan)},
- Test{cmplx(2, 0), cmplx(nan, nan), cmplx(nan, nan)},
- Test{cmplx(2, 0), cmplx(nan, inf), cmplx(0, negzero)},
- Test{cmplx(2, 0), cmplx(nan, -inf), cmplx(0, 0)},
- Test{cmplx(2, 0), cmplx(inf, 0), cmplx(0, 0)},
- Test{cmplx(2, 0), cmplx(inf, 1), cmplx(0, 0)},
- Test{cmplx(2, 0), cmplx(inf, -1), cmplx(0, 0)},
- Test{cmplx(2, 0), cmplx(inf, 2), cmplx(0, 0)},
- Test{cmplx(2, 0), cmplx(inf, nan), cmplx(0, 0)},
- Test{cmplx(2, 0), cmplx(inf, inf), cmplx(0, negzero)},
- Test{cmplx(2, 0), cmplx(inf, -inf), cmplx(0, 0)},
- Test{cmplx(2, 0), cmplx(-inf, 0), cmplx(negzero, negzero)},
- Test{cmplx(2, 0), cmplx(-inf, 1), cmplx(negzero, negzero)},
- Test{cmplx(2, 0), cmplx(-inf, -1), cmplx(negzero, negzero)},
- Test{cmplx(2, 0), cmplx(-inf, 2), cmplx(negzero, negzero)},
- Test{cmplx(2, 0), cmplx(-inf, nan), cmplx(negzero, negzero)},
- Test{cmplx(2, 0), cmplx(-inf, inf), cmplx(negzero, negzero)},
- Test{cmplx(2, 0), cmplx(-inf, -inf), cmplx(negzero, 0)},
- Test{cmplx(2, 1), cmplx(0, 0), cmplx(inf, inf)},
- Test{cmplx(2, 1), cmplx(0, 1), cmplx(1, -2)},
- Test{cmplx(2, 1), cmplx(0, -1), cmplx(-1, 2)},
- Test{cmplx(2, 1), cmplx(0, 2), cmplx(0.5, -1)},
- Test{cmplx(2, 1), cmplx(0, nan), cmplx(nan, nan)},
- Test{cmplx(2, 1), cmplx(0, inf), cmplx(0, negzero)},
- Test{cmplx(2, 1), cmplx(0, -inf), cmplx(negzero, 0)},
- Test{cmplx(2, 1), cmplx(1, 0), cmplx(2, 1)},
- Test{cmplx(2, 1), cmplx(1, 1), cmplx(1.5, -0.5)},
- Test{cmplx(2, 1), cmplx(1, -1), cmplx(0.5, 1.5)},
- Test{cmplx(2, 1), cmplx(1, 2), cmplx(0.8, -0.6)},
- Test{cmplx(2, 1), cmplx(1, nan), cmplx(nan, nan)},
- Test{cmplx(2, 1), cmplx(1, inf), cmplx(0, negzero)},
- Test{cmplx(2, 1), cmplx(1, -inf), cmplx(negzero, 0)},
- Test{cmplx(2, 1), cmplx(-1, 0), cmplx(-2, -1)},
- Test{cmplx(2, 1), cmplx(-1, 1), cmplx(-0.5, -1.5)},
- Test{cmplx(2, 1), cmplx(-1, -1), cmplx(-1.5, 0.5)},
- Test{cmplx(2, 1), cmplx(-1, 2), cmplx(0, -1)},
- Test{cmplx(2, 1), cmplx(-1, nan), cmplx(nan, nan)},
- Test{cmplx(2, 1), cmplx(-1, inf), cmplx(0, negzero)},
- Test{cmplx(2, 1), cmplx(-1, -inf), cmplx(negzero, 0)},
- Test{cmplx(2, 1), cmplx(2, 0), cmplx(1, 0.5)},
- Test{cmplx(2, 1), cmplx(2, 1), cmplx(1, 0)},
- Test{cmplx(2, 1), cmplx(2, -1), cmplx(0.6, 0.8)},
- Test{cmplx(2, 1), cmplx(2, 2), cmplx(0.75, -0.25)},
- Test{cmplx(2, 1), cmplx(2, nan), cmplx(nan, nan)},
- Test{cmplx(2, 1), cmplx(2, inf), cmplx(0, negzero)},
- Test{cmplx(2, 1), cmplx(2, -inf), cmplx(negzero, 0)},
- Test{cmplx(2, 1), cmplx(nan, 0), cmplx(nan, nan)},
- Test{cmplx(2, 1), cmplx(nan, 1), cmplx(nan, nan)},
- Test{cmplx(2, 1), cmplx(nan, -1), cmplx(nan, nan)},
- Test{cmplx(2, 1), cmplx(nan, 2), cmplx(nan, nan)},
- Test{cmplx(2, 1), cmplx(nan, nan), cmplx(nan, nan)},
- Test{cmplx(2, 1), cmplx(nan, inf), cmplx(0, negzero)},
- Test{cmplx(2, 1), cmplx(nan, -inf), cmplx(negzero, 0)},
- Test{cmplx(2, 1), cmplx(inf, 0), cmplx(0, 0)},
- Test{cmplx(2, 1), cmplx(inf, 1), cmplx(0, 0)},
- Test{cmplx(2, 1), cmplx(inf, -1), cmplx(0, 0)},
- Test{cmplx(2, 1), cmplx(inf, 2), cmplx(0, 0)},
- Test{cmplx(2, 1), cmplx(inf, nan), cmplx(0, 0)},
- Test{cmplx(2, 1), cmplx(inf, inf), cmplx(0, negzero)},
- Test{cmplx(2, 1), cmplx(inf, -inf), cmplx(0, 0)},
- Test{cmplx(2, 1), cmplx(-inf, 0), cmplx(negzero, negzero)},
- Test{cmplx(2, 1), cmplx(-inf, 1), cmplx(negzero, negzero)},
- Test{cmplx(2, 1), cmplx(-inf, -1), cmplx(negzero, negzero)},
- Test{cmplx(2, 1), cmplx(-inf, 2), cmplx(negzero, negzero)},
- Test{cmplx(2, 1), cmplx(-inf, nan), cmplx(negzero, negzero)},
- Test{cmplx(2, 1), cmplx(-inf, inf), cmplx(negzero, negzero)},
- Test{cmplx(2, 1), cmplx(-inf, -inf), cmplx(negzero, 0)},
- Test{cmplx(2, -1), cmplx(0, 0), cmplx(inf, -inf)},
- Test{cmplx(2, -1), cmplx(0, 1), cmplx(-1, -2)},
- Test{cmplx(2, -1), cmplx(0, -1), cmplx(1, 2)},
- Test{cmplx(2, -1), cmplx(0, 2), cmplx(-0.5, -1)},
- Test{cmplx(2, -1), cmplx(0, nan), cmplx(nan, nan)},
- Test{cmplx(2, -1), cmplx(0, inf), cmplx(negzero, negzero)},
- Test{cmplx(2, -1), cmplx(0, -inf), cmplx(0, 0)},
- Test{cmplx(2, -1), cmplx(1, 0), cmplx(2, -1)},
- Test{cmplx(2, -1), cmplx(1, 1), cmplx(0.5, -1.5)},
- Test{cmplx(2, -1), cmplx(1, -1), cmplx(1.5, 0.5)},
- Test{cmplx(2, -1), cmplx(1, 2), cmplx(0, -1)},
- Test{cmplx(2, -1), cmplx(1, nan), cmplx(nan, nan)},
- Test{cmplx(2, -1), cmplx(1, inf), cmplx(negzero, negzero)},
- Test{cmplx(2, -1), cmplx(1, -inf), cmplx(0, 0)},
- Test{cmplx(2, -1), cmplx(-1, 0), cmplx(-2, 1)},
- Test{cmplx(2, -1), cmplx(-1, 1), cmplx(-1.5, -0.5)},
- Test{cmplx(2, -1), cmplx(-1, -1), cmplx(-0.5, 1.5)},
- Test{cmplx(2, -1), cmplx(-1, 2), cmplx(-0.8, -0.6)},
- Test{cmplx(2, -1), cmplx(-1, nan), cmplx(nan, nan)},
- Test{cmplx(2, -1), cmplx(-1, inf), cmplx(negzero, negzero)},
- Test{cmplx(2, -1), cmplx(-1, -inf), cmplx(0, 0)},
- Test{cmplx(2, -1), cmplx(2, 0), cmplx(1, -0.5)},
- Test{cmplx(2, -1), cmplx(2, 1), cmplx(0.6, -0.8)},
- Test{cmplx(2, -1), cmplx(2, -1), cmplx(1, 0)},
- Test{cmplx(2, -1), cmplx(2, 2), cmplx(0.25, -0.75)},
- Test{cmplx(2, -1), cmplx(2, nan), cmplx(nan, nan)},
- Test{cmplx(2, -1), cmplx(2, inf), cmplx(negzero, negzero)},
- Test{cmplx(2, -1), cmplx(2, -inf), cmplx(0, 0)},
- Test{cmplx(2, -1), cmplx(nan, 0), cmplx(nan, nan)},
- Test{cmplx(2, -1), cmplx(nan, 1), cmplx(nan, nan)},
- Test{cmplx(2, -1), cmplx(nan, -1), cmplx(nan, nan)},
- Test{cmplx(2, -1), cmplx(nan, 2), cmplx(nan, nan)},
- Test{cmplx(2, -1), cmplx(nan, nan), cmplx(nan, nan)},
- Test{cmplx(2, -1), cmplx(nan, inf), cmplx(negzero, negzero)},
- Test{cmplx(2, -1), cmplx(nan, -inf), cmplx(0, 0)},
- Test{cmplx(2, -1), cmplx(inf, 0), cmplx(0, negzero)},
- Test{cmplx(2, -1), cmplx(inf, 1), cmplx(0, negzero)},
- Test{cmplx(2, -1), cmplx(inf, -1), cmplx(0, negzero)},
- Test{cmplx(2, -1), cmplx(inf, 2), cmplx(0, negzero)},
- Test{cmplx(2, -1), cmplx(inf, nan), cmplx(0, negzero)},
- Test{cmplx(2, -1), cmplx(inf, inf), cmplx(0, negzero)},
- Test{cmplx(2, -1), cmplx(inf, -inf), cmplx(0, 0)},
- Test{cmplx(2, -1), cmplx(-inf, 0), cmplx(negzero, 0)},
- Test{cmplx(2, -1), cmplx(-inf, 1), cmplx(negzero, 0)},
- Test{cmplx(2, -1), cmplx(-inf, -1), cmplx(negzero, 0)},
- Test{cmplx(2, -1), cmplx(-inf, 2), cmplx(negzero, 0)},
- Test{cmplx(2, -1), cmplx(-inf, nan), cmplx(negzero, 0)},
- Test{cmplx(2, -1), cmplx(-inf, inf), cmplx(negzero, negzero)},
- Test{cmplx(2, -1), cmplx(-inf, -inf), cmplx(negzero, 0)},
- Test{cmplx(2, 2), cmplx(0, 0), cmplx(inf, inf)},
- Test{cmplx(2, 2), cmplx(0, 1), cmplx(2, -2)},
- Test{cmplx(2, 2), cmplx(0, -1), cmplx(-2, 2)},
- Test{cmplx(2, 2), cmplx(0, 2), cmplx(1, -1)},
- Test{cmplx(2, 2), cmplx(0, nan), cmplx(nan, nan)},
- Test{cmplx(2, 2), cmplx(0, inf), cmplx(0, negzero)},
- Test{cmplx(2, 2), cmplx(0, -inf), cmplx(negzero, 0)},
- Test{cmplx(2, 2), cmplx(1, 0), cmplx(2, 2)},
- Test{cmplx(2, 2), cmplx(1, 1), cmplx(2, 0)},
- Test{cmplx(2, 2), cmplx(1, -1), cmplx(0, 2)},
- Test{cmplx(2, 2), cmplx(1, 2), cmplx(1.2, -0.4)},
- Test{cmplx(2, 2), cmplx(1, nan), cmplx(nan, nan)},
- Test{cmplx(2, 2), cmplx(1, inf), cmplx(0, negzero)},
- Test{cmplx(2, 2), cmplx(1, -inf), cmplx(negzero, 0)},
- Test{cmplx(2, 2), cmplx(-1, 0), cmplx(-2, -2)},
- Test{cmplx(2, 2), cmplx(-1, 1), cmplx(negzero, -2)},
- Test{cmplx(2, 2), cmplx(-1, -1), cmplx(-2, negzero)},
- Test{cmplx(2, 2), cmplx(-1, 2), cmplx(0.4, -1.2)},
- Test{cmplx(2, 2), cmplx(-1, nan), cmplx(nan, nan)},
- Test{cmplx(2, 2), cmplx(-1, inf), cmplx(0, negzero)},
- Test{cmplx(2, 2), cmplx(-1, -inf), cmplx(negzero, 0)},
- Test{cmplx(2, 2), cmplx(2, 0), cmplx(1, 1)},
- Test{cmplx(2, 2), cmplx(2, 1), cmplx(1.2, 0.4)},
- Test{cmplx(2, 2), cmplx(2, -1), cmplx(0.4, 1.2)},
- Test{cmplx(2, 2), cmplx(2, 2), cmplx(1, 0)},
- Test{cmplx(2, 2), cmplx(2, nan), cmplx(nan, nan)},
- Test{cmplx(2, 2), cmplx(2, inf), cmplx(0, negzero)},
- Test{cmplx(2, 2), cmplx(2, -inf), cmplx(negzero, 0)},
- Test{cmplx(2, 2), cmplx(nan, 0), cmplx(nan, nan)},
- Test{cmplx(2, 2), cmplx(nan, 1), cmplx(nan, nan)},
- Test{cmplx(2, 2), cmplx(nan, -1), cmplx(nan, nan)},
- Test{cmplx(2, 2), cmplx(nan, 2), cmplx(nan, nan)},
- Test{cmplx(2, 2), cmplx(nan, nan), cmplx(nan, nan)},
- Test{cmplx(2, 2), cmplx(nan, inf), cmplx(0, negzero)},
- Test{cmplx(2, 2), cmplx(nan, -inf), cmplx(negzero, 0)},
- Test{cmplx(2, 2), cmplx(inf, 0), cmplx(0, 0)},
- Test{cmplx(2, 2), cmplx(inf, 1), cmplx(0, 0)},
- Test{cmplx(2, 2), cmplx(inf, -1), cmplx(0, 0)},
- Test{cmplx(2, 2), cmplx(inf, 2), cmplx(0, 0)},
- Test{cmplx(2, 2), cmplx(inf, nan), cmplx(0, 0)},
- Test{cmplx(2, 2), cmplx(inf, inf), cmplx(0, 0)},
- Test{cmplx(2, 2), cmplx(inf, -inf), cmplx(0, 0)},
- Test{cmplx(2, 2), cmplx(-inf, 0), cmplx(negzero, negzero)},
- Test{cmplx(2, 2), cmplx(-inf, 1), cmplx(negzero, negzero)},
- Test{cmplx(2, 2), cmplx(-inf, -1), cmplx(negzero, negzero)},
- Test{cmplx(2, 2), cmplx(-inf, 2), cmplx(negzero, negzero)},
- Test{cmplx(2, 2), cmplx(-inf, nan), cmplx(negzero, negzero)},
- Test{cmplx(2, 2), cmplx(-inf, inf), cmplx(0, negzero)},
- Test{cmplx(2, 2), cmplx(-inf, -inf), cmplx(negzero, 0)},
- Test{cmplx(2, nan), cmplx(0, 0), cmplx(nan, nan)},
- Test{cmplx(2, nan), cmplx(0, 1), cmplx(nan, nan)},
- Test{cmplx(2, nan), cmplx(0, -1), cmplx(nan, nan)},
- Test{cmplx(2, nan), cmplx(0, 2), cmplx(nan, nan)},
- Test{cmplx(2, nan), cmplx(0, nan), cmplx(nan, nan)},
- Test{cmplx(2, nan), cmplx(0, inf), cmplx(nan, nan)},
- Test{cmplx(2, nan), cmplx(0, -inf), cmplx(nan, nan)},
- Test{cmplx(2, nan), cmplx(1, 0), cmplx(nan, nan)},
- Test{cmplx(2, nan), cmplx(1, 1), cmplx(nan, nan)},
- Test{cmplx(2, nan), cmplx(1, -1), cmplx(nan, nan)},
- Test{cmplx(2, nan), cmplx(1, 2), cmplx(nan, nan)},
- Test{cmplx(2, nan), cmplx(1, nan), cmplx(nan, nan)},
- Test{cmplx(2, nan), cmplx(1, inf), cmplx(nan, nan)},
- Test{cmplx(2, nan), cmplx(1, -inf), cmplx(nan, nan)},
- Test{cmplx(2, nan), cmplx(-1, 0), cmplx(nan, nan)},
- Test{cmplx(2, nan), cmplx(-1, 1), cmplx(nan, nan)},
- Test{cmplx(2, nan), cmplx(-1, -1), cmplx(nan, nan)},
- Test{cmplx(2, nan), cmplx(-1, 2), cmplx(nan, nan)},
- Test{cmplx(2, nan), cmplx(-1, nan), cmplx(nan, nan)},
- Test{cmplx(2, nan), cmplx(-1, inf), cmplx(nan, nan)},
- Test{cmplx(2, nan), cmplx(-1, -inf), cmplx(nan, nan)},
- Test{cmplx(2, nan), cmplx(2, 0), cmplx(nan, nan)},
- Test{cmplx(2, nan), cmplx(2, 1), cmplx(nan, nan)},
- Test{cmplx(2, nan), cmplx(2, -1), cmplx(nan, nan)},
- Test{cmplx(2, nan), cmplx(2, 2), cmplx(nan, nan)},
- Test{cmplx(2, nan), cmplx(2, nan), cmplx(nan, nan)},
- Test{cmplx(2, nan), cmplx(2, inf), cmplx(nan, nan)},
- Test{cmplx(2, nan), cmplx(2, -inf), cmplx(nan, nan)},
- Test{cmplx(2, nan), cmplx(nan, 0), cmplx(nan, nan)},
- Test{cmplx(2, nan), cmplx(nan, 1), cmplx(nan, nan)},
- Test{cmplx(2, nan), cmplx(nan, -1), cmplx(nan, nan)},
- Test{cmplx(2, nan), cmplx(nan, 2), cmplx(nan, nan)},
- Test{cmplx(2, nan), cmplx(nan, nan), cmplx(nan, nan)},
- Test{cmplx(2, nan), cmplx(nan, inf), cmplx(nan, nan)},
- Test{cmplx(2, nan), cmplx(nan, -inf), cmplx(nan, nan)},
- Test{cmplx(2, nan), cmplx(inf, 0), cmplx(nan, nan)},
- Test{cmplx(2, nan), cmplx(inf, 1), cmplx(nan, nan)},
- Test{cmplx(2, nan), cmplx(inf, -1), cmplx(nan, nan)},
- Test{cmplx(2, nan), cmplx(inf, 2), cmplx(nan, nan)},
- Test{cmplx(2, nan), cmplx(inf, nan), cmplx(nan, nan)},
- Test{cmplx(2, nan), cmplx(inf, inf), cmplx(nan, nan)},
- Test{cmplx(2, nan), cmplx(inf, -inf), cmplx(nan, nan)},
- Test{cmplx(2, nan), cmplx(-inf, 0), cmplx(nan, nan)},
- Test{cmplx(2, nan), cmplx(-inf, 1), cmplx(nan, nan)},
- Test{cmplx(2, nan), cmplx(-inf, -1), cmplx(nan, nan)},
- Test{cmplx(2, nan), cmplx(-inf, 2), cmplx(nan, nan)},
- Test{cmplx(2, nan), cmplx(-inf, nan), cmplx(nan, nan)},
- Test{cmplx(2, nan), cmplx(-inf, inf), cmplx(nan, nan)},
- Test{cmplx(2, nan), cmplx(-inf, -inf), cmplx(nan, nan)},
- Test{cmplx(2, inf), cmplx(0, 0), cmplx(inf, inf)},
- Test{cmplx(2, inf), cmplx(0, 1), cmplx(inf, nan)},
- Test{cmplx(2, inf), cmplx(0, -1), cmplx(-inf, nan)},
- Test{cmplx(2, inf), cmplx(0, 2), cmplx(inf, nan)},
- Test{cmplx(2, inf), cmplx(0, nan), cmplx(nan, nan)},
- Test{cmplx(2, inf), cmplx(0, inf), cmplx(nan, nan)},
- Test{cmplx(2, inf), cmplx(0, -inf), cmplx(nan, nan)},
- Test{cmplx(2, inf), cmplx(1, 0), cmplx(nan, inf)},
- Test{cmplx(2, inf), cmplx(1, 1), cmplx(inf, inf)},
- Test{cmplx(2, inf), cmplx(1, -1), cmplx(-inf, inf)},
- Test{cmplx(2, inf), cmplx(1, 2), cmplx(inf, inf)},
- Test{cmplx(2, inf), cmplx(1, nan), cmplx(nan, nan)},
- Test{cmplx(2, inf), cmplx(1, inf), cmplx(nan, nan)},
- Test{cmplx(2, inf), cmplx(1, -inf), cmplx(nan, nan)},
- Test{cmplx(2, inf), cmplx(-1, 0), cmplx(nan, -inf)},
- Test{cmplx(2, inf), cmplx(-1, 1), cmplx(inf, -inf)},
- Test{cmplx(2, inf), cmplx(-1, -1), cmplx(-inf, -inf)},
- Test{cmplx(2, inf), cmplx(-1, 2), cmplx(inf, -inf)},
- Test{cmplx(2, inf), cmplx(-1, nan), cmplx(nan, nan)},
- Test{cmplx(2, inf), cmplx(-1, inf), cmplx(nan, nan)},
- Test{cmplx(2, inf), cmplx(-1, -inf), cmplx(nan, nan)},
- Test{cmplx(2, inf), cmplx(2, 0), cmplx(nan, inf)},
- Test{cmplx(2, inf), cmplx(2, 1), cmplx(inf, inf)},
- Test{cmplx(2, inf), cmplx(2, -1), cmplx(-inf, inf)},
- Test{cmplx(2, inf), cmplx(2, 2), cmplx(inf, inf)},
- Test{cmplx(2, inf), cmplx(2, nan), cmplx(nan, nan)},
- Test{cmplx(2, inf), cmplx(2, inf), cmplx(nan, nan)},
- Test{cmplx(2, inf), cmplx(2, -inf), cmplx(nan, nan)},
- Test{cmplx(2, inf), cmplx(nan, 0), cmplx(nan, nan)},
- Test{cmplx(2, inf), cmplx(nan, 1), cmplx(nan, nan)},
- Test{cmplx(2, inf), cmplx(nan, -1), cmplx(nan, nan)},
- Test{cmplx(2, inf), cmplx(nan, 2), cmplx(nan, nan)},
- Test{cmplx(2, inf), cmplx(nan, nan), cmplx(nan, nan)},
- Test{cmplx(2, inf), cmplx(nan, inf), cmplx(nan, nan)},
- Test{cmplx(2, inf), cmplx(nan, -inf), cmplx(nan, nan)},
- Test{cmplx(2, inf), cmplx(inf, 0), cmplx(nan, nan)},
- Test{cmplx(2, inf), cmplx(inf, 1), cmplx(nan, nan)},
- Test{cmplx(2, inf), cmplx(inf, -1), cmplx(nan, nan)},
- Test{cmplx(2, inf), cmplx(inf, 2), cmplx(nan, nan)},
- Test{cmplx(2, inf), cmplx(inf, nan), cmplx(nan, nan)},
- Test{cmplx(2, inf), cmplx(inf, inf), cmplx(nan, nan)},
- Test{cmplx(2, inf), cmplx(inf, -inf), cmplx(nan, nan)},
- Test{cmplx(2, inf), cmplx(-inf, 0), cmplx(nan, nan)},
- Test{cmplx(2, inf), cmplx(-inf, 1), cmplx(nan, nan)},
- Test{cmplx(2, inf), cmplx(-inf, -1), cmplx(nan, nan)},
- Test{cmplx(2, inf), cmplx(-inf, 2), cmplx(nan, nan)},
- Test{cmplx(2, inf), cmplx(-inf, nan), cmplx(nan, nan)},
- Test{cmplx(2, inf), cmplx(-inf, inf), cmplx(nan, nan)},
- Test{cmplx(2, inf), cmplx(-inf, -inf), cmplx(nan, nan)},
- Test{cmplx(2, -inf), cmplx(0, 0), cmplx(inf, -inf)},
- Test{cmplx(2, -inf), cmplx(0, 1), cmplx(-inf, nan)},
- Test{cmplx(2, -inf), cmplx(0, -1), cmplx(inf, nan)},
- Test{cmplx(2, -inf), cmplx(0, 2), cmplx(-inf, nan)},
- Test{cmplx(2, -inf), cmplx(0, nan), cmplx(nan, nan)},
- Test{cmplx(2, -inf), cmplx(0, inf), cmplx(nan, nan)},
- Test{cmplx(2, -inf), cmplx(0, -inf), cmplx(nan, nan)},
- Test{cmplx(2, -inf), cmplx(1, 0), cmplx(nan, -inf)},
- Test{cmplx(2, -inf), cmplx(1, 1), cmplx(-inf, -inf)},
- Test{cmplx(2, -inf), cmplx(1, -1), cmplx(inf, -inf)},
- Test{cmplx(2, -inf), cmplx(1, 2), cmplx(-inf, -inf)},
- Test{cmplx(2, -inf), cmplx(1, nan), cmplx(nan, nan)},
- Test{cmplx(2, -inf), cmplx(1, inf), cmplx(nan, nan)},
- Test{cmplx(2, -inf), cmplx(1, -inf), cmplx(nan, nan)},
- Test{cmplx(2, -inf), cmplx(-1, 0), cmplx(nan, inf)},
- Test{cmplx(2, -inf), cmplx(-1, 1), cmplx(-inf, inf)},
- Test{cmplx(2, -inf), cmplx(-1, -1), cmplx(inf, inf)},
- Test{cmplx(2, -inf), cmplx(-1, 2), cmplx(-inf, inf)},
- Test{cmplx(2, -inf), cmplx(-1, nan), cmplx(nan, nan)},
- Test{cmplx(2, -inf), cmplx(-1, inf), cmplx(nan, nan)},
- Test{cmplx(2, -inf), cmplx(-1, -inf), cmplx(nan, nan)},
- Test{cmplx(2, -inf), cmplx(2, 0), cmplx(nan, -inf)},
- Test{cmplx(2, -inf), cmplx(2, 1), cmplx(-inf, -inf)},
- Test{cmplx(2, -inf), cmplx(2, -1), cmplx(inf, -inf)},
- Test{cmplx(2, -inf), cmplx(2, 2), cmplx(-inf, -inf)},
- Test{cmplx(2, -inf), cmplx(2, nan), cmplx(nan, nan)},
- Test{cmplx(2, -inf), cmplx(2, inf), cmplx(nan, nan)},
- Test{cmplx(2, -inf), cmplx(2, -inf), cmplx(nan, nan)},
- Test{cmplx(2, -inf), cmplx(nan, 0), cmplx(nan, nan)},
- Test{cmplx(2, -inf), cmplx(nan, 1), cmplx(nan, nan)},
- Test{cmplx(2, -inf), cmplx(nan, -1), cmplx(nan, nan)},
- Test{cmplx(2, -inf), cmplx(nan, 2), cmplx(nan, nan)},
- Test{cmplx(2, -inf), cmplx(nan, nan), cmplx(nan, nan)},
- Test{cmplx(2, -inf), cmplx(nan, inf), cmplx(nan, nan)},
- Test{cmplx(2, -inf), cmplx(nan, -inf), cmplx(nan, nan)},
- Test{cmplx(2, -inf), cmplx(inf, 0), cmplx(nan, nan)},
- Test{cmplx(2, -inf), cmplx(inf, 1), cmplx(nan, nan)},
- Test{cmplx(2, -inf), cmplx(inf, -1), cmplx(nan, nan)},
- Test{cmplx(2, -inf), cmplx(inf, 2), cmplx(nan, nan)},
- Test{cmplx(2, -inf), cmplx(inf, nan), cmplx(nan, nan)},
- Test{cmplx(2, -inf), cmplx(inf, inf), cmplx(nan, nan)},
- Test{cmplx(2, -inf), cmplx(inf, -inf), cmplx(nan, nan)},
- Test{cmplx(2, -inf), cmplx(-inf, 0), cmplx(nan, nan)},
- Test{cmplx(2, -inf), cmplx(-inf, 1), cmplx(nan, nan)},
- Test{cmplx(2, -inf), cmplx(-inf, -1), cmplx(nan, nan)},
- Test{cmplx(2, -inf), cmplx(-inf, 2), cmplx(nan, nan)},
- Test{cmplx(2, -inf), cmplx(-inf, nan), cmplx(nan, nan)},
- Test{cmplx(2, -inf), cmplx(-inf, inf), cmplx(nan, nan)},
- Test{cmplx(2, -inf), cmplx(-inf, -inf), cmplx(nan, nan)},
- Test{cmplx(nan, 0), cmplx(0, 0), cmplx(nan, nan)},
- Test{cmplx(nan, 0), cmplx(0, 1), cmplx(nan, nan)},
- Test{cmplx(nan, 0), cmplx(0, -1), cmplx(nan, nan)},
- Test{cmplx(nan, 0), cmplx(0, 2), cmplx(nan, nan)},
- Test{cmplx(nan, 0), cmplx(0, nan), cmplx(nan, nan)},
- Test{cmplx(nan, 0), cmplx(0, inf), cmplx(nan, nan)},
- Test{cmplx(nan, 0), cmplx(0, -inf), cmplx(nan, nan)},
- Test{cmplx(nan, 0), cmplx(1, 0), cmplx(nan, nan)},
- Test{cmplx(nan, 0), cmplx(1, 1), cmplx(nan, nan)},
- Test{cmplx(nan, 0), cmplx(1, -1), cmplx(nan, nan)},
- Test{cmplx(nan, 0), cmplx(1, 2), cmplx(nan, nan)},
- Test{cmplx(nan, 0), cmplx(1, nan), cmplx(nan, nan)},
- Test{cmplx(nan, 0), cmplx(1, inf), cmplx(nan, nan)},
- Test{cmplx(nan, 0), cmplx(1, -inf), cmplx(nan, nan)},
- Test{cmplx(nan, 0), cmplx(-1, 0), cmplx(nan, nan)},
- Test{cmplx(nan, 0), cmplx(-1, 1), cmplx(nan, nan)},
- Test{cmplx(nan, 0), cmplx(-1, -1), cmplx(nan, nan)},
- Test{cmplx(nan, 0), cmplx(-1, 2), cmplx(nan, nan)},
- Test{cmplx(nan, 0), cmplx(-1, nan), cmplx(nan, nan)},
- Test{cmplx(nan, 0), cmplx(-1, inf), cmplx(nan, nan)},
- Test{cmplx(nan, 0), cmplx(-1, -inf), cmplx(nan, nan)},
- Test{cmplx(nan, 0), cmplx(2, 0), cmplx(nan, nan)},
- Test{cmplx(nan, 0), cmplx(2, 1), cmplx(nan, nan)},
- Test{cmplx(nan, 0), cmplx(2, -1), cmplx(nan, nan)},
- Test{cmplx(nan, 0), cmplx(2, 2), cmplx(nan, nan)},
- Test{cmplx(nan, 0), cmplx(2, nan), cmplx(nan, nan)},
- Test{cmplx(nan, 0), cmplx(2, inf), cmplx(nan, nan)},
- Test{cmplx(nan, 0), cmplx(2, -inf), cmplx(nan, nan)},
- Test{cmplx(nan, 0), cmplx(nan, 0), cmplx(nan, nan)},
- Test{cmplx(nan, 0), cmplx(nan, 1), cmplx(nan, nan)},
- Test{cmplx(nan, 0), cmplx(nan, -1), cmplx(nan, nan)},
- Test{cmplx(nan, 0), cmplx(nan, 2), cmplx(nan, nan)},
- Test{cmplx(nan, 0), cmplx(nan, nan), cmplx(nan, nan)},
- Test{cmplx(nan, 0), cmplx(nan, inf), cmplx(nan, nan)},
- Test{cmplx(nan, 0), cmplx(nan, -inf), cmplx(nan, nan)},
- Test{cmplx(nan, 0), cmplx(inf, 0), cmplx(nan, nan)},
- Test{cmplx(nan, 0), cmplx(inf, 1), cmplx(nan, nan)},
- Test{cmplx(nan, 0), cmplx(inf, -1), cmplx(nan, nan)},
- Test{cmplx(nan, 0), cmplx(inf, 2), cmplx(nan, nan)},
- Test{cmplx(nan, 0), cmplx(inf, nan), cmplx(nan, nan)},
- Test{cmplx(nan, 0), cmplx(inf, inf), cmplx(nan, nan)},
- Test{cmplx(nan, 0), cmplx(inf, -inf), cmplx(nan, nan)},
- Test{cmplx(nan, 0), cmplx(-inf, 0), cmplx(nan, nan)},
- Test{cmplx(nan, 0), cmplx(-inf, 1), cmplx(nan, nan)},
- Test{cmplx(nan, 0), cmplx(-inf, -1), cmplx(nan, nan)},
- Test{cmplx(nan, 0), cmplx(-inf, 2), cmplx(nan, nan)},
- Test{cmplx(nan, 0), cmplx(-inf, nan), cmplx(nan, nan)},
- Test{cmplx(nan, 0), cmplx(-inf, inf), cmplx(nan, nan)},
- Test{cmplx(nan, 0), cmplx(-inf, -inf), cmplx(nan, nan)},
- Test{cmplx(nan, 1), cmplx(0, 0), cmplx(nan, nan)},
- Test{cmplx(nan, 1), cmplx(0, 1), cmplx(nan, nan)},
- Test{cmplx(nan, 1), cmplx(0, -1), cmplx(nan, nan)},
- Test{cmplx(nan, 1), cmplx(0, 2), cmplx(nan, nan)},
- Test{cmplx(nan, 1), cmplx(0, nan), cmplx(nan, nan)},
- Test{cmplx(nan, 1), cmplx(0, inf), cmplx(nan, nan)},
- Test{cmplx(nan, 1), cmplx(0, -inf), cmplx(nan, nan)},
- Test{cmplx(nan, 1), cmplx(1, 0), cmplx(nan, nan)},
- Test{cmplx(nan, 1), cmplx(1, 1), cmplx(nan, nan)},
- Test{cmplx(nan, 1), cmplx(1, -1), cmplx(nan, nan)},
- Test{cmplx(nan, 1), cmplx(1, 2), cmplx(nan, nan)},
- Test{cmplx(nan, 1), cmplx(1, nan), cmplx(nan, nan)},
- Test{cmplx(nan, 1), cmplx(1, inf), cmplx(nan, nan)},
- Test{cmplx(nan, 1), cmplx(1, -inf), cmplx(nan, nan)},
- Test{cmplx(nan, 1), cmplx(-1, 0), cmplx(nan, nan)},
- Test{cmplx(nan, 1), cmplx(-1, 1), cmplx(nan, nan)},
- Test{cmplx(nan, 1), cmplx(-1, -1), cmplx(nan, nan)},
- Test{cmplx(nan, 1), cmplx(-1, 2), cmplx(nan, nan)},
- Test{cmplx(nan, 1), cmplx(-1, nan), cmplx(nan, nan)},
- Test{cmplx(nan, 1), cmplx(-1, inf), cmplx(nan, nan)},
- Test{cmplx(nan, 1), cmplx(-1, -inf), cmplx(nan, nan)},
- Test{cmplx(nan, 1), cmplx(2, 0), cmplx(nan, nan)},
- Test{cmplx(nan, 1), cmplx(2, 1), cmplx(nan, nan)},
- Test{cmplx(nan, 1), cmplx(2, -1), cmplx(nan, nan)},
- Test{cmplx(nan, 1), cmplx(2, 2), cmplx(nan, nan)},
- Test{cmplx(nan, 1), cmplx(2, nan), cmplx(nan, nan)},
- Test{cmplx(nan, 1), cmplx(2, inf), cmplx(nan, nan)},
- Test{cmplx(nan, 1), cmplx(2, -inf), cmplx(nan, nan)},
- Test{cmplx(nan, 1), cmplx(nan, 0), cmplx(nan, nan)},
- Test{cmplx(nan, 1), cmplx(nan, 1), cmplx(nan, nan)},
- Test{cmplx(nan, 1), cmplx(nan, -1), cmplx(nan, nan)},
- Test{cmplx(nan, 1), cmplx(nan, 2), cmplx(nan, nan)},
- Test{cmplx(nan, 1), cmplx(nan, nan), cmplx(nan, nan)},
- Test{cmplx(nan, 1), cmplx(nan, inf), cmplx(nan, nan)},
- Test{cmplx(nan, 1), cmplx(nan, -inf), cmplx(nan, nan)},
- Test{cmplx(nan, 1), cmplx(inf, 0), cmplx(nan, nan)},
- Test{cmplx(nan, 1), cmplx(inf, 1), cmplx(nan, nan)},
- Test{cmplx(nan, 1), cmplx(inf, -1), cmplx(nan, nan)},
- Test{cmplx(nan, 1), cmplx(inf, 2), cmplx(nan, nan)},
- Test{cmplx(nan, 1), cmplx(inf, nan), cmplx(nan, nan)},
- Test{cmplx(nan, 1), cmplx(inf, inf), cmplx(nan, nan)},
- Test{cmplx(nan, 1), cmplx(inf, -inf), cmplx(nan, nan)},
- Test{cmplx(nan, 1), cmplx(-inf, 0), cmplx(nan, nan)},
- Test{cmplx(nan, 1), cmplx(-inf, 1), cmplx(nan, nan)},
- Test{cmplx(nan, 1), cmplx(-inf, -1), cmplx(nan, nan)},
- Test{cmplx(nan, 1), cmplx(-inf, 2), cmplx(nan, nan)},
- Test{cmplx(nan, 1), cmplx(-inf, nan), cmplx(nan, nan)},
- Test{cmplx(nan, 1), cmplx(-inf, inf), cmplx(nan, nan)},
- Test{cmplx(nan, 1), cmplx(-inf, -inf), cmplx(nan, nan)},
- Test{cmplx(nan, -1), cmplx(0, 0), cmplx(nan, nan)},
- Test{cmplx(nan, -1), cmplx(0, 1), cmplx(nan, nan)},
- Test{cmplx(nan, -1), cmplx(0, -1), cmplx(nan, nan)},
- Test{cmplx(nan, -1), cmplx(0, 2), cmplx(nan, nan)},
- Test{cmplx(nan, -1), cmplx(0, nan), cmplx(nan, nan)},
- Test{cmplx(nan, -1), cmplx(0, inf), cmplx(nan, nan)},
- Test{cmplx(nan, -1), cmplx(0, -inf), cmplx(nan, nan)},
- Test{cmplx(nan, -1), cmplx(1, 0), cmplx(nan, nan)},
- Test{cmplx(nan, -1), cmplx(1, 1), cmplx(nan, nan)},
- Test{cmplx(nan, -1), cmplx(1, -1), cmplx(nan, nan)},
- Test{cmplx(nan, -1), cmplx(1, 2), cmplx(nan, nan)},
- Test{cmplx(nan, -1), cmplx(1, nan), cmplx(nan, nan)},
- Test{cmplx(nan, -1), cmplx(1, inf), cmplx(nan, nan)},
- Test{cmplx(nan, -1), cmplx(1, -inf), cmplx(nan, nan)},
- Test{cmplx(nan, -1), cmplx(-1, 0), cmplx(nan, nan)},
- Test{cmplx(nan, -1), cmplx(-1, 1), cmplx(nan, nan)},
- Test{cmplx(nan, -1), cmplx(-1, -1), cmplx(nan, nan)},
- Test{cmplx(nan, -1), cmplx(-1, 2), cmplx(nan, nan)},
- Test{cmplx(nan, -1), cmplx(-1, nan), cmplx(nan, nan)},
- Test{cmplx(nan, -1), cmplx(-1, inf), cmplx(nan, nan)},
- Test{cmplx(nan, -1), cmplx(-1, -inf), cmplx(nan, nan)},
- Test{cmplx(nan, -1), cmplx(2, 0), cmplx(nan, nan)},
- Test{cmplx(nan, -1), cmplx(2, 1), cmplx(nan, nan)},
- Test{cmplx(nan, -1), cmplx(2, -1), cmplx(nan, nan)},
- Test{cmplx(nan, -1), cmplx(2, 2), cmplx(nan, nan)},
- Test{cmplx(nan, -1), cmplx(2, nan), cmplx(nan, nan)},
- Test{cmplx(nan, -1), cmplx(2, inf), cmplx(nan, nan)},
- Test{cmplx(nan, -1), cmplx(2, -inf), cmplx(nan, nan)},
- Test{cmplx(nan, -1), cmplx(nan, 0), cmplx(nan, nan)},
- Test{cmplx(nan, -1), cmplx(nan, 1), cmplx(nan, nan)},
- Test{cmplx(nan, -1), cmplx(nan, -1), cmplx(nan, nan)},
- Test{cmplx(nan, -1), cmplx(nan, 2), cmplx(nan, nan)},
- Test{cmplx(nan, -1), cmplx(nan, nan), cmplx(nan, nan)},
- Test{cmplx(nan, -1), cmplx(nan, inf), cmplx(nan, nan)},
- Test{cmplx(nan, -1), cmplx(nan, -inf), cmplx(nan, nan)},
- Test{cmplx(nan, -1), cmplx(inf, 0), cmplx(nan, nan)},
- Test{cmplx(nan, -1), cmplx(inf, 1), cmplx(nan, nan)},
- Test{cmplx(nan, -1), cmplx(inf, -1), cmplx(nan, nan)},
- Test{cmplx(nan, -1), cmplx(inf, 2), cmplx(nan, nan)},
- Test{cmplx(nan, -1), cmplx(inf, nan), cmplx(nan, nan)},
- Test{cmplx(nan, -1), cmplx(inf, inf), cmplx(nan, nan)},
- Test{cmplx(nan, -1), cmplx(inf, -inf), cmplx(nan, nan)},
- Test{cmplx(nan, -1), cmplx(-inf, 0), cmplx(nan, nan)},
- Test{cmplx(nan, -1), cmplx(-inf, 1), cmplx(nan, nan)},
- Test{cmplx(nan, -1), cmplx(-inf, -1), cmplx(nan, nan)},
- Test{cmplx(nan, -1), cmplx(-inf, 2), cmplx(nan, nan)},
- Test{cmplx(nan, -1), cmplx(-inf, nan), cmplx(nan, nan)},
- Test{cmplx(nan, -1), cmplx(-inf, inf), cmplx(nan, nan)},
- Test{cmplx(nan, -1), cmplx(-inf, -inf), cmplx(nan, nan)},
- Test{cmplx(nan, 2), cmplx(0, 0), cmplx(nan, nan)},
- Test{cmplx(nan, 2), cmplx(0, 1), cmplx(nan, nan)},
- Test{cmplx(nan, 2), cmplx(0, -1), cmplx(nan, nan)},
- Test{cmplx(nan, 2), cmplx(0, 2), cmplx(nan, nan)},
- Test{cmplx(nan, 2), cmplx(0, nan), cmplx(nan, nan)},
- Test{cmplx(nan, 2), cmplx(0, inf), cmplx(nan, nan)},
- Test{cmplx(nan, 2), cmplx(0, -inf), cmplx(nan, nan)},
- Test{cmplx(nan, 2), cmplx(1, 0), cmplx(nan, nan)},
- Test{cmplx(nan, 2), cmplx(1, 1), cmplx(nan, nan)},
- Test{cmplx(nan, 2), cmplx(1, -1), cmplx(nan, nan)},
- Test{cmplx(nan, 2), cmplx(1, 2), cmplx(nan, nan)},
- Test{cmplx(nan, 2), cmplx(1, nan), cmplx(nan, nan)},
- Test{cmplx(nan, 2), cmplx(1, inf), cmplx(nan, nan)},
- Test{cmplx(nan, 2), cmplx(1, -inf), cmplx(nan, nan)},
- Test{cmplx(nan, 2), cmplx(-1, 0), cmplx(nan, nan)},
- Test{cmplx(nan, 2), cmplx(-1, 1), cmplx(nan, nan)},
- Test{cmplx(nan, 2), cmplx(-1, -1), cmplx(nan, nan)},
- Test{cmplx(nan, 2), cmplx(-1, 2), cmplx(nan, nan)},
- Test{cmplx(nan, 2), cmplx(-1, nan), cmplx(nan, nan)},
- Test{cmplx(nan, 2), cmplx(-1, inf), cmplx(nan, nan)},
- Test{cmplx(nan, 2), cmplx(-1, -inf), cmplx(nan, nan)},
- Test{cmplx(nan, 2), cmplx(2, 0), cmplx(nan, nan)},
- Test{cmplx(nan, 2), cmplx(2, 1), cmplx(nan, nan)},
- Test{cmplx(nan, 2), cmplx(2, -1), cmplx(nan, nan)},
- Test{cmplx(nan, 2), cmplx(2, 2), cmplx(nan, nan)},
- Test{cmplx(nan, 2), cmplx(2, nan), cmplx(nan, nan)},
- Test{cmplx(nan, 2), cmplx(2, inf), cmplx(nan, nan)},
- Test{cmplx(nan, 2), cmplx(2, -inf), cmplx(nan, nan)},
- Test{cmplx(nan, 2), cmplx(nan, 0), cmplx(nan, nan)},
- Test{cmplx(nan, 2), cmplx(nan, 1), cmplx(nan, nan)},
- Test{cmplx(nan, 2), cmplx(nan, -1), cmplx(nan, nan)},
- Test{cmplx(nan, 2), cmplx(nan, 2), cmplx(nan, nan)},
- Test{cmplx(nan, 2), cmplx(nan, nan), cmplx(nan, nan)},
- Test{cmplx(nan, 2), cmplx(nan, inf), cmplx(nan, nan)},
- Test{cmplx(nan, 2), cmplx(nan, -inf), cmplx(nan, nan)},
- Test{cmplx(nan, 2), cmplx(inf, 0), cmplx(nan, nan)},
- Test{cmplx(nan, 2), cmplx(inf, 1), cmplx(nan, nan)},
- Test{cmplx(nan, 2), cmplx(inf, -1), cmplx(nan, nan)},
- Test{cmplx(nan, 2), cmplx(inf, 2), cmplx(nan, nan)},
- Test{cmplx(nan, 2), cmplx(inf, nan), cmplx(nan, nan)},
- Test{cmplx(nan, 2), cmplx(inf, inf), cmplx(nan, nan)},
- Test{cmplx(nan, 2), cmplx(inf, -inf), cmplx(nan, nan)},
- Test{cmplx(nan, 2), cmplx(-inf, 0), cmplx(nan, nan)},
- Test{cmplx(nan, 2), cmplx(-inf, 1), cmplx(nan, nan)},
- Test{cmplx(nan, 2), cmplx(-inf, -1), cmplx(nan, nan)},
- Test{cmplx(nan, 2), cmplx(-inf, 2), cmplx(nan, nan)},
- Test{cmplx(nan, 2), cmplx(-inf, nan), cmplx(nan, nan)},
- Test{cmplx(nan, 2), cmplx(-inf, inf), cmplx(nan, nan)},
- Test{cmplx(nan, 2), cmplx(-inf, -inf), cmplx(nan, nan)},
- Test{cmplx(nan, nan), cmplx(0, 0), cmplx(nan, nan)},
- Test{cmplx(nan, nan), cmplx(0, 1), cmplx(nan, nan)},
- Test{cmplx(nan, nan), cmplx(0, -1), cmplx(nan, nan)},
- Test{cmplx(nan, nan), cmplx(0, 2), cmplx(nan, nan)},
- Test{cmplx(nan, nan), cmplx(0, nan), cmplx(nan, nan)},
- Test{cmplx(nan, nan), cmplx(0, inf), cmplx(nan, nan)},
- Test{cmplx(nan, nan), cmplx(0, -inf), cmplx(nan, nan)},
- Test{cmplx(nan, nan), cmplx(1, 0), cmplx(nan, nan)},
- Test{cmplx(nan, nan), cmplx(1, 1), cmplx(nan, nan)},
- Test{cmplx(nan, nan), cmplx(1, -1), cmplx(nan, nan)},
- Test{cmplx(nan, nan), cmplx(1, 2), cmplx(nan, nan)},
- Test{cmplx(nan, nan), cmplx(1, nan), cmplx(nan, nan)},
- Test{cmplx(nan, nan), cmplx(1, inf), cmplx(nan, nan)},
- Test{cmplx(nan, nan), cmplx(1, -inf), cmplx(nan, nan)},
- Test{cmplx(nan, nan), cmplx(-1, 0), cmplx(nan, nan)},
- Test{cmplx(nan, nan), cmplx(-1, 1), cmplx(nan, nan)},
- Test{cmplx(nan, nan), cmplx(-1, -1), cmplx(nan, nan)},
- Test{cmplx(nan, nan), cmplx(-1, 2), cmplx(nan, nan)},
- Test{cmplx(nan, nan), cmplx(-1, nan), cmplx(nan, nan)},
- Test{cmplx(nan, nan), cmplx(-1, inf), cmplx(nan, nan)},
- Test{cmplx(nan, nan), cmplx(-1, -inf), cmplx(nan, nan)},
- Test{cmplx(nan, nan), cmplx(2, 0), cmplx(nan, nan)},
- Test{cmplx(nan, nan), cmplx(2, 1), cmplx(nan, nan)},
- Test{cmplx(nan, nan), cmplx(2, -1), cmplx(nan, nan)},
- Test{cmplx(nan, nan), cmplx(2, 2), cmplx(nan, nan)},
- Test{cmplx(nan, nan), cmplx(2, nan), cmplx(nan, nan)},
- Test{cmplx(nan, nan), cmplx(2, inf), cmplx(nan, nan)},
- Test{cmplx(nan, nan), cmplx(2, -inf), cmplx(nan, nan)},
- Test{cmplx(nan, nan), cmplx(nan, 0), cmplx(nan, nan)},
- Test{cmplx(nan, nan), cmplx(nan, 1), cmplx(nan, nan)},
- Test{cmplx(nan, nan), cmplx(nan, -1), cmplx(nan, nan)},
- Test{cmplx(nan, nan), cmplx(nan, 2), cmplx(nan, nan)},
- Test{cmplx(nan, nan), cmplx(nan, nan), cmplx(nan, nan)},
- Test{cmplx(nan, nan), cmplx(nan, inf), cmplx(nan, nan)},
- Test{cmplx(nan, nan), cmplx(nan, -inf), cmplx(nan, nan)},
- Test{cmplx(nan, nan), cmplx(inf, 0), cmplx(nan, nan)},
- Test{cmplx(nan, nan), cmplx(inf, 1), cmplx(nan, nan)},
- Test{cmplx(nan, nan), cmplx(inf, -1), cmplx(nan, nan)},
- Test{cmplx(nan, nan), cmplx(inf, 2), cmplx(nan, nan)},
- Test{cmplx(nan, nan), cmplx(inf, nan), cmplx(nan, nan)},
- Test{cmplx(nan, nan), cmplx(inf, inf), cmplx(nan, nan)},
- Test{cmplx(nan, nan), cmplx(inf, -inf), cmplx(nan, nan)},
- Test{cmplx(nan, nan), cmplx(-inf, 0), cmplx(nan, nan)},
- Test{cmplx(nan, nan), cmplx(-inf, 1), cmplx(nan, nan)},
- Test{cmplx(nan, nan), cmplx(-inf, -1), cmplx(nan, nan)},
- Test{cmplx(nan, nan), cmplx(-inf, 2), cmplx(nan, nan)},
- Test{cmplx(nan, nan), cmplx(-inf, nan), cmplx(nan, nan)},
- Test{cmplx(nan, nan), cmplx(-inf, inf), cmplx(nan, nan)},
- Test{cmplx(nan, nan), cmplx(-inf, -inf), cmplx(nan, nan)},
- Test{cmplx(nan, inf), cmplx(0, 0), cmplx(nan, inf)},
- Test{cmplx(nan, inf), cmplx(0, 1), cmplx(inf, nan)},
- Test{cmplx(nan, inf), cmplx(0, -1), cmplx(-inf, nan)},
- Test{cmplx(nan, inf), cmplx(0, 2), cmplx(inf, nan)},
- Test{cmplx(nan, inf), cmplx(0, nan), cmplx(nan, nan)},
- Test{cmplx(nan, inf), cmplx(0, inf), cmplx(nan, nan)},
- Test{cmplx(nan, inf), cmplx(0, -inf), cmplx(nan, nan)},
- Test{cmplx(nan, inf), cmplx(1, 0), cmplx(nan, inf)},
- Test{cmplx(nan, inf), cmplx(1, 1), cmplx(inf, inf)},
- Test{cmplx(nan, inf), cmplx(1, -1), cmplx(-inf, inf)},
- Test{cmplx(nan, inf), cmplx(1, 2), cmplx(inf, inf)},
- Test{cmplx(nan, inf), cmplx(1, nan), cmplx(nan, nan)},
- Test{cmplx(nan, inf), cmplx(1, inf), cmplx(nan, nan)},
- Test{cmplx(nan, inf), cmplx(1, -inf), cmplx(nan, nan)},
- Test{cmplx(nan, inf), cmplx(-1, 0), cmplx(nan, -inf)},
- Test{cmplx(nan, inf), cmplx(-1, 1), cmplx(inf, -inf)},
- Test{cmplx(nan, inf), cmplx(-1, -1), cmplx(-inf, -inf)},
- Test{cmplx(nan, inf), cmplx(-1, 2), cmplx(inf, -inf)},
- Test{cmplx(nan, inf), cmplx(-1, nan), cmplx(nan, nan)},
- Test{cmplx(nan, inf), cmplx(-1, inf), cmplx(nan, nan)},
- Test{cmplx(nan, inf), cmplx(-1, -inf), cmplx(nan, nan)},
- Test{cmplx(nan, inf), cmplx(2, 0), cmplx(nan, inf)},
- Test{cmplx(nan, inf), cmplx(2, 1), cmplx(inf, inf)},
- Test{cmplx(nan, inf), cmplx(2, -1), cmplx(-inf, inf)},
- Test{cmplx(nan, inf), cmplx(2, 2), cmplx(inf, inf)},
- Test{cmplx(nan, inf), cmplx(2, nan), cmplx(nan, nan)},
- Test{cmplx(nan, inf), cmplx(2, inf), cmplx(nan, nan)},
- Test{cmplx(nan, inf), cmplx(2, -inf), cmplx(nan, nan)},
- Test{cmplx(nan, inf), cmplx(nan, 0), cmplx(nan, nan)},
- Test{cmplx(nan, inf), cmplx(nan, 1), cmplx(nan, nan)},
- Test{cmplx(nan, inf), cmplx(nan, -1), cmplx(nan, nan)},
- Test{cmplx(nan, inf), cmplx(nan, 2), cmplx(nan, nan)},
- Test{cmplx(nan, inf), cmplx(nan, nan), cmplx(nan, nan)},
- Test{cmplx(nan, inf), cmplx(nan, inf), cmplx(nan, nan)},
- Test{cmplx(nan, inf), cmplx(nan, -inf), cmplx(nan, nan)},
- Test{cmplx(nan, inf), cmplx(inf, 0), cmplx(nan, nan)},
- Test{cmplx(nan, inf), cmplx(inf, 1), cmplx(nan, nan)},
- Test{cmplx(nan, inf), cmplx(inf, -1), cmplx(nan, nan)},
- Test{cmplx(nan, inf), cmplx(inf, 2), cmplx(nan, nan)},
- Test{cmplx(nan, inf), cmplx(inf, nan), cmplx(nan, nan)},
- Test{cmplx(nan, inf), cmplx(inf, inf), cmplx(nan, nan)},
- Test{cmplx(nan, inf), cmplx(inf, -inf), cmplx(nan, nan)},
- Test{cmplx(nan, inf), cmplx(-inf, 0), cmplx(nan, nan)},
- Test{cmplx(nan, inf), cmplx(-inf, 1), cmplx(nan, nan)},
- Test{cmplx(nan, inf), cmplx(-inf, -1), cmplx(nan, nan)},
- Test{cmplx(nan, inf), cmplx(-inf, 2), cmplx(nan, nan)},
- Test{cmplx(nan, inf), cmplx(-inf, nan), cmplx(nan, nan)},
- Test{cmplx(nan, inf), cmplx(-inf, inf), cmplx(nan, nan)},
- Test{cmplx(nan, inf), cmplx(-inf, -inf), cmplx(nan, nan)},
- Test{cmplx(nan, -inf), cmplx(0, 0), cmplx(nan, -inf)},
- Test{cmplx(nan, -inf), cmplx(0, 1), cmplx(-inf, nan)},
- Test{cmplx(nan, -inf), cmplx(0, -1), cmplx(inf, nan)},
- Test{cmplx(nan, -inf), cmplx(0, 2), cmplx(-inf, nan)},
- Test{cmplx(nan, -inf), cmplx(0, nan), cmplx(nan, nan)},
- Test{cmplx(nan, -inf), cmplx(0, inf), cmplx(nan, nan)},
- Test{cmplx(nan, -inf), cmplx(0, -inf), cmplx(nan, nan)},
- Test{cmplx(nan, -inf), cmplx(1, 0), cmplx(nan, -inf)},
- Test{cmplx(nan, -inf), cmplx(1, 1), cmplx(-inf, -inf)},
- Test{cmplx(nan, -inf), cmplx(1, -1), cmplx(inf, -inf)},
- Test{cmplx(nan, -inf), cmplx(1, 2), cmplx(-inf, -inf)},
- Test{cmplx(nan, -inf), cmplx(1, nan), cmplx(nan, nan)},
- Test{cmplx(nan, -inf), cmplx(1, inf), cmplx(nan, nan)},
- Test{cmplx(nan, -inf), cmplx(1, -inf), cmplx(nan, nan)},
- Test{cmplx(nan, -inf), cmplx(-1, 0), cmplx(nan, inf)},
- Test{cmplx(nan, -inf), cmplx(-1, 1), cmplx(-inf, inf)},
- Test{cmplx(nan, -inf), cmplx(-1, -1), cmplx(inf, inf)},
- Test{cmplx(nan, -inf), cmplx(-1, 2), cmplx(-inf, inf)},
- Test{cmplx(nan, -inf), cmplx(-1, nan), cmplx(nan, nan)},
- Test{cmplx(nan, -inf), cmplx(-1, inf), cmplx(nan, nan)},
- Test{cmplx(nan, -inf), cmplx(-1, -inf), cmplx(nan, nan)},
- Test{cmplx(nan, -inf), cmplx(2, 0), cmplx(nan, -inf)},
- Test{cmplx(nan, -inf), cmplx(2, 1), cmplx(-inf, -inf)},
- Test{cmplx(nan, -inf), cmplx(2, -1), cmplx(inf, -inf)},
- Test{cmplx(nan, -inf), cmplx(2, 2), cmplx(-inf, -inf)},
- Test{cmplx(nan, -inf), cmplx(2, nan), cmplx(nan, nan)},
- Test{cmplx(nan, -inf), cmplx(2, inf), cmplx(nan, nan)},
- Test{cmplx(nan, -inf), cmplx(2, -inf), cmplx(nan, nan)},
- Test{cmplx(nan, -inf), cmplx(nan, 0), cmplx(nan, nan)},
- Test{cmplx(nan, -inf), cmplx(nan, 1), cmplx(nan, nan)},
- Test{cmplx(nan, -inf), cmplx(nan, -1), cmplx(nan, nan)},
- Test{cmplx(nan, -inf), cmplx(nan, 2), cmplx(nan, nan)},
- Test{cmplx(nan, -inf), cmplx(nan, nan), cmplx(nan, nan)},
- Test{cmplx(nan, -inf), cmplx(nan, inf), cmplx(nan, nan)},
- Test{cmplx(nan, -inf), cmplx(nan, -inf), cmplx(nan, nan)},
- Test{cmplx(nan, -inf), cmplx(inf, 0), cmplx(nan, nan)},
- Test{cmplx(nan, -inf), cmplx(inf, 1), cmplx(nan, nan)},
- Test{cmplx(nan, -inf), cmplx(inf, -1), cmplx(nan, nan)},
- Test{cmplx(nan, -inf), cmplx(inf, 2), cmplx(nan, nan)},
- Test{cmplx(nan, -inf), cmplx(inf, nan), cmplx(nan, nan)},
- Test{cmplx(nan, -inf), cmplx(inf, inf), cmplx(nan, nan)},
- Test{cmplx(nan, -inf), cmplx(inf, -inf), cmplx(nan, nan)},
- Test{cmplx(nan, -inf), cmplx(-inf, 0), cmplx(nan, nan)},
- Test{cmplx(nan, -inf), cmplx(-inf, 1), cmplx(nan, nan)},
- Test{cmplx(nan, -inf), cmplx(-inf, -1), cmplx(nan, nan)},
- Test{cmplx(nan, -inf), cmplx(-inf, 2), cmplx(nan, nan)},
- Test{cmplx(nan, -inf), cmplx(-inf, nan), cmplx(nan, nan)},
- Test{cmplx(nan, -inf), cmplx(-inf, inf), cmplx(nan, nan)},
- Test{cmplx(nan, -inf), cmplx(-inf, -inf), cmplx(nan, nan)},
- Test{cmplx(inf, 0), cmplx(0, 0), cmplx(inf, nan)},
- Test{cmplx(inf, 0), cmplx(0, 1), cmplx(nan, -inf)},
- Test{cmplx(inf, 0), cmplx(0, -1), cmplx(nan, inf)},
- Test{cmplx(inf, 0), cmplx(0, 2), cmplx(nan, -inf)},
- Test{cmplx(inf, 0), cmplx(0, nan), cmplx(nan, nan)},
- Test{cmplx(inf, 0), cmplx(0, inf), cmplx(nan, nan)},
- Test{cmplx(inf, 0), cmplx(0, -inf), cmplx(nan, nan)},
- Test{cmplx(inf, 0), cmplx(1, 0), cmplx(inf, nan)},
- Test{cmplx(inf, 0), cmplx(1, 1), cmplx(inf, -inf)},
- Test{cmplx(inf, 0), cmplx(1, -1), cmplx(inf, inf)},
- Test{cmplx(inf, 0), cmplx(1, 2), cmplx(inf, -inf)},
- Test{cmplx(inf, 0), cmplx(1, nan), cmplx(nan, nan)},
- Test{cmplx(inf, 0), cmplx(1, inf), cmplx(nan, nan)},
- Test{cmplx(inf, 0), cmplx(1, -inf), cmplx(nan, nan)},
- Test{cmplx(inf, 0), cmplx(-1, 0), cmplx(-inf, nan)},
- Test{cmplx(inf, 0), cmplx(-1, 1), cmplx(-inf, -inf)},
- Test{cmplx(inf, 0), cmplx(-1, -1), cmplx(-inf, inf)},
- Test{cmplx(inf, 0), cmplx(-1, 2), cmplx(-inf, -inf)},
- Test{cmplx(inf, 0), cmplx(-1, nan), cmplx(nan, nan)},
- Test{cmplx(inf, 0), cmplx(-1, inf), cmplx(nan, nan)},
- Test{cmplx(inf, 0), cmplx(-1, -inf), cmplx(nan, nan)},
- Test{cmplx(inf, 0), cmplx(2, 0), cmplx(inf, nan)},
- Test{cmplx(inf, 0), cmplx(2, 1), cmplx(inf, -inf)},
- Test{cmplx(inf, 0), cmplx(2, -1), cmplx(inf, inf)},
- Test{cmplx(inf, 0), cmplx(2, 2), cmplx(inf, -inf)},
- Test{cmplx(inf, 0), cmplx(2, nan), cmplx(nan, nan)},
- Test{cmplx(inf, 0), cmplx(2, inf), cmplx(nan, nan)},
- Test{cmplx(inf, 0), cmplx(2, -inf), cmplx(nan, nan)},
- Test{cmplx(inf, 0), cmplx(nan, 0), cmplx(nan, nan)},
- Test{cmplx(inf, 0), cmplx(nan, 1), cmplx(nan, nan)},
- Test{cmplx(inf, 0), cmplx(nan, -1), cmplx(nan, nan)},
- Test{cmplx(inf, 0), cmplx(nan, 2), cmplx(nan, nan)},
- Test{cmplx(inf, 0), cmplx(nan, nan), cmplx(nan, nan)},
- Test{cmplx(inf, 0), cmplx(nan, inf), cmplx(nan, nan)},
- Test{cmplx(inf, 0), cmplx(nan, -inf), cmplx(nan, nan)},
- Test{cmplx(inf, 0), cmplx(inf, 0), cmplx(nan, nan)},
- Test{cmplx(inf, 0), cmplx(inf, 1), cmplx(nan, nan)},
- Test{cmplx(inf, 0), cmplx(inf, -1), cmplx(nan, nan)},
- Test{cmplx(inf, 0), cmplx(inf, 2), cmplx(nan, nan)},
- Test{cmplx(inf, 0), cmplx(inf, nan), cmplx(nan, nan)},
- Test{cmplx(inf, 0), cmplx(inf, inf), cmplx(nan, nan)},
- Test{cmplx(inf, 0), cmplx(inf, -inf), cmplx(nan, nan)},
- Test{cmplx(inf, 0), cmplx(-inf, 0), cmplx(nan, nan)},
- Test{cmplx(inf, 0), cmplx(-inf, 1), cmplx(nan, nan)},
- Test{cmplx(inf, 0), cmplx(-inf, -1), cmplx(nan, nan)},
- Test{cmplx(inf, 0), cmplx(-inf, 2), cmplx(nan, nan)},
- Test{cmplx(inf, 0), cmplx(-inf, nan), cmplx(nan, nan)},
- Test{cmplx(inf, 0), cmplx(-inf, inf), cmplx(nan, nan)},
- Test{cmplx(inf, 0), cmplx(-inf, -inf), cmplx(nan, nan)},
- Test{cmplx(inf, 1), cmplx(0, 0), cmplx(inf, inf)},
- Test{cmplx(inf, 1), cmplx(0, 1), cmplx(nan, -inf)},
- Test{cmplx(inf, 1), cmplx(0, -1), cmplx(nan, inf)},
- Test{cmplx(inf, 1), cmplx(0, 2), cmplx(nan, -inf)},
- Test{cmplx(inf, 1), cmplx(0, nan), cmplx(nan, nan)},
- Test{cmplx(inf, 1), cmplx(0, inf), cmplx(nan, nan)},
- Test{cmplx(inf, 1), cmplx(0, -inf), cmplx(nan, nan)},
- Test{cmplx(inf, 1), cmplx(1, 0), cmplx(inf, nan)},
- Test{cmplx(inf, 1), cmplx(1, 1), cmplx(inf, -inf)},
- Test{cmplx(inf, 1), cmplx(1, -1), cmplx(inf, inf)},
- Test{cmplx(inf, 1), cmplx(1, 2), cmplx(inf, -inf)},
- Test{cmplx(inf, 1), cmplx(1, nan), cmplx(nan, nan)},
- Test{cmplx(inf, 1), cmplx(1, inf), cmplx(nan, nan)},
- Test{cmplx(inf, 1), cmplx(1, -inf), cmplx(nan, nan)},
- Test{cmplx(inf, 1), cmplx(-1, 0), cmplx(-inf, nan)},
- Test{cmplx(inf, 1), cmplx(-1, 1), cmplx(-inf, -inf)},
- Test{cmplx(inf, 1), cmplx(-1, -1), cmplx(-inf, inf)},
- Test{cmplx(inf, 1), cmplx(-1, 2), cmplx(-inf, -inf)},
- Test{cmplx(inf, 1), cmplx(-1, nan), cmplx(nan, nan)},
- Test{cmplx(inf, 1), cmplx(-1, inf), cmplx(nan, nan)},
- Test{cmplx(inf, 1), cmplx(-1, -inf), cmplx(nan, nan)},
- Test{cmplx(inf, 1), cmplx(2, 0), cmplx(inf, nan)},
- Test{cmplx(inf, 1), cmplx(2, 1), cmplx(inf, -inf)},
- Test{cmplx(inf, 1), cmplx(2, -1), cmplx(inf, inf)},
- Test{cmplx(inf, 1), cmplx(2, 2), cmplx(inf, -inf)},
- Test{cmplx(inf, 1), cmplx(2, nan), cmplx(nan, nan)},
- Test{cmplx(inf, 1), cmplx(2, inf), cmplx(nan, nan)},
- Test{cmplx(inf, 1), cmplx(2, -inf), cmplx(nan, nan)},
- Test{cmplx(inf, 1), cmplx(nan, 0), cmplx(nan, nan)},
- Test{cmplx(inf, 1), cmplx(nan, 1), cmplx(nan, nan)},
- Test{cmplx(inf, 1), cmplx(nan, -1), cmplx(nan, nan)},
- Test{cmplx(inf, 1), cmplx(nan, 2), cmplx(nan, nan)},
- Test{cmplx(inf, 1), cmplx(nan, nan), cmplx(nan, nan)},
- Test{cmplx(inf, 1), cmplx(nan, inf), cmplx(nan, nan)},
- Test{cmplx(inf, 1), cmplx(nan, -inf), cmplx(nan, nan)},
- Test{cmplx(inf, 1), cmplx(inf, 0), cmplx(nan, nan)},
- Test{cmplx(inf, 1), cmplx(inf, 1), cmplx(nan, nan)},
- Test{cmplx(inf, 1), cmplx(inf, -1), cmplx(nan, nan)},
- Test{cmplx(inf, 1), cmplx(inf, 2), cmplx(nan, nan)},
- Test{cmplx(inf, 1), cmplx(inf, nan), cmplx(nan, nan)},
- Test{cmplx(inf, 1), cmplx(inf, inf), cmplx(nan, nan)},
- Test{cmplx(inf, 1), cmplx(inf, -inf), cmplx(nan, nan)},
- Test{cmplx(inf, 1), cmplx(-inf, 0), cmplx(nan, nan)},
- Test{cmplx(inf, 1), cmplx(-inf, 1), cmplx(nan, nan)},
- Test{cmplx(inf, 1), cmplx(-inf, -1), cmplx(nan, nan)},
- Test{cmplx(inf, 1), cmplx(-inf, 2), cmplx(nan, nan)},
- Test{cmplx(inf, 1), cmplx(-inf, nan), cmplx(nan, nan)},
- Test{cmplx(inf, 1), cmplx(-inf, inf), cmplx(nan, nan)},
- Test{cmplx(inf, 1), cmplx(-inf, -inf), cmplx(nan, nan)},
- Test{cmplx(inf, -1), cmplx(0, 0), cmplx(inf, -inf)},
- Test{cmplx(inf, -1), cmplx(0, 1), cmplx(nan, -inf)},
- Test{cmplx(inf, -1), cmplx(0, -1), cmplx(nan, inf)},
- Test{cmplx(inf, -1), cmplx(0, 2), cmplx(nan, -inf)},
- Test{cmplx(inf, -1), cmplx(0, nan), cmplx(nan, nan)},
- Test{cmplx(inf, -1), cmplx(0, inf), cmplx(nan, nan)},
- Test{cmplx(inf, -1), cmplx(0, -inf), cmplx(nan, nan)},
- Test{cmplx(inf, -1), cmplx(1, 0), cmplx(inf, nan)},
- Test{cmplx(inf, -1), cmplx(1, 1), cmplx(inf, -inf)},
- Test{cmplx(inf, -1), cmplx(1, -1), cmplx(inf, inf)},
- Test{cmplx(inf, -1), cmplx(1, 2), cmplx(inf, -inf)},
- Test{cmplx(inf, -1), cmplx(1, nan), cmplx(nan, nan)},
- Test{cmplx(inf, -1), cmplx(1, inf), cmplx(nan, nan)},
- Test{cmplx(inf, -1), cmplx(1, -inf), cmplx(nan, nan)},
- Test{cmplx(inf, -1), cmplx(-1, 0), cmplx(-inf, nan)},
- Test{cmplx(inf, -1), cmplx(-1, 1), cmplx(-inf, -inf)},
- Test{cmplx(inf, -1), cmplx(-1, -1), cmplx(-inf, inf)},
- Test{cmplx(inf, -1), cmplx(-1, 2), cmplx(-inf, -inf)},
- Test{cmplx(inf, -1), cmplx(-1, nan), cmplx(nan, nan)},
- Test{cmplx(inf, -1), cmplx(-1, inf), cmplx(nan, nan)},
- Test{cmplx(inf, -1), cmplx(-1, -inf), cmplx(nan, nan)},
- Test{cmplx(inf, -1), cmplx(2, 0), cmplx(inf, nan)},
- Test{cmplx(inf, -1), cmplx(2, 1), cmplx(inf, -inf)},
- Test{cmplx(inf, -1), cmplx(2, -1), cmplx(inf, inf)},
- Test{cmplx(inf, -1), cmplx(2, 2), cmplx(inf, -inf)},
- Test{cmplx(inf, -1), cmplx(2, nan), cmplx(nan, nan)},
- Test{cmplx(inf, -1), cmplx(2, inf), cmplx(nan, nan)},
- Test{cmplx(inf, -1), cmplx(2, -inf), cmplx(nan, nan)},
- Test{cmplx(inf, -1), cmplx(nan, 0), cmplx(nan, nan)},
- Test{cmplx(inf, -1), cmplx(nan, 1), cmplx(nan, nan)},
- Test{cmplx(inf, -1), cmplx(nan, -1), cmplx(nan, nan)},
- Test{cmplx(inf, -1), cmplx(nan, 2), cmplx(nan, nan)},
- Test{cmplx(inf, -1), cmplx(nan, nan), cmplx(nan, nan)},
- Test{cmplx(inf, -1), cmplx(nan, inf), cmplx(nan, nan)},
- Test{cmplx(inf, -1), cmplx(nan, -inf), cmplx(nan, nan)},
- Test{cmplx(inf, -1), cmplx(inf, 0), cmplx(nan, nan)},
- Test{cmplx(inf, -1), cmplx(inf, 1), cmplx(nan, nan)},
- Test{cmplx(inf, -1), cmplx(inf, -1), cmplx(nan, nan)},
- Test{cmplx(inf, -1), cmplx(inf, 2), cmplx(nan, nan)},
- Test{cmplx(inf, -1), cmplx(inf, nan), cmplx(nan, nan)},
- Test{cmplx(inf, -1), cmplx(inf, inf), cmplx(nan, nan)},
- Test{cmplx(inf, -1), cmplx(inf, -inf), cmplx(nan, nan)},
- Test{cmplx(inf, -1), cmplx(-inf, 0), cmplx(nan, nan)},
- Test{cmplx(inf, -1), cmplx(-inf, 1), cmplx(nan, nan)},
- Test{cmplx(inf, -1), cmplx(-inf, -1), cmplx(nan, nan)},
- Test{cmplx(inf, -1), cmplx(-inf, 2), cmplx(nan, nan)},
- Test{cmplx(inf, -1), cmplx(-inf, nan), cmplx(nan, nan)},
- Test{cmplx(inf, -1), cmplx(-inf, inf), cmplx(nan, nan)},
- Test{cmplx(inf, -1), cmplx(-inf, -inf), cmplx(nan, nan)},
- Test{cmplx(inf, 2), cmplx(0, 0), cmplx(inf, inf)},
- Test{cmplx(inf, 2), cmplx(0, 1), cmplx(nan, -inf)},
- Test{cmplx(inf, 2), cmplx(0, -1), cmplx(nan, inf)},
- Test{cmplx(inf, 2), cmplx(0, 2), cmplx(nan, -inf)},
- Test{cmplx(inf, 2), cmplx(0, nan), cmplx(nan, nan)},
- Test{cmplx(inf, 2), cmplx(0, inf), cmplx(nan, nan)},
- Test{cmplx(inf, 2), cmplx(0, -inf), cmplx(nan, nan)},
- Test{cmplx(inf, 2), cmplx(1, 0), cmplx(inf, nan)},
- Test{cmplx(inf, 2), cmplx(1, 1), cmplx(inf, -inf)},
- Test{cmplx(inf, 2), cmplx(1, -1), cmplx(inf, inf)},
- Test{cmplx(inf, 2), cmplx(1, 2), cmplx(inf, -inf)},
- Test{cmplx(inf, 2), cmplx(1, nan), cmplx(nan, nan)},
- Test{cmplx(inf, 2), cmplx(1, inf), cmplx(nan, nan)},
- Test{cmplx(inf, 2), cmplx(1, -inf), cmplx(nan, nan)},
- Test{cmplx(inf, 2), cmplx(-1, 0), cmplx(-inf, nan)},
- Test{cmplx(inf, 2), cmplx(-1, 1), cmplx(-inf, -inf)},
- Test{cmplx(inf, 2), cmplx(-1, -1), cmplx(-inf, inf)},
- Test{cmplx(inf, 2), cmplx(-1, 2), cmplx(-inf, -inf)},
- Test{cmplx(inf, 2), cmplx(-1, nan), cmplx(nan, nan)},
- Test{cmplx(inf, 2), cmplx(-1, inf), cmplx(nan, nan)},
- Test{cmplx(inf, 2), cmplx(-1, -inf), cmplx(nan, nan)},
- Test{cmplx(inf, 2), cmplx(2, 0), cmplx(inf, nan)},
- Test{cmplx(inf, 2), cmplx(2, 1), cmplx(inf, -inf)},
- Test{cmplx(inf, 2), cmplx(2, -1), cmplx(inf, inf)},
- Test{cmplx(inf, 2), cmplx(2, 2), cmplx(inf, -inf)},
- Test{cmplx(inf, 2), cmplx(2, nan), cmplx(nan, nan)},
- Test{cmplx(inf, 2), cmplx(2, inf), cmplx(nan, nan)},
- Test{cmplx(inf, 2), cmplx(2, -inf), cmplx(nan, nan)},
- Test{cmplx(inf, 2), cmplx(nan, 0), cmplx(nan, nan)},
- Test{cmplx(inf, 2), cmplx(nan, 1), cmplx(nan, nan)},
- Test{cmplx(inf, 2), cmplx(nan, -1), cmplx(nan, nan)},
- Test{cmplx(inf, 2), cmplx(nan, 2), cmplx(nan, nan)},
- Test{cmplx(inf, 2), cmplx(nan, nan), cmplx(nan, nan)},
- Test{cmplx(inf, 2), cmplx(nan, inf), cmplx(nan, nan)},
- Test{cmplx(inf, 2), cmplx(nan, -inf), cmplx(nan, nan)},
- Test{cmplx(inf, 2), cmplx(inf, 0), cmplx(nan, nan)},
- Test{cmplx(inf, 2), cmplx(inf, 1), cmplx(nan, nan)},
- Test{cmplx(inf, 2), cmplx(inf, -1), cmplx(nan, nan)},
- Test{cmplx(inf, 2), cmplx(inf, 2), cmplx(nan, nan)},
- Test{cmplx(inf, 2), cmplx(inf, nan), cmplx(nan, nan)},
- Test{cmplx(inf, 2), cmplx(inf, inf), cmplx(nan, nan)},
- Test{cmplx(inf, 2), cmplx(inf, -inf), cmplx(nan, nan)},
- Test{cmplx(inf, 2), cmplx(-inf, 0), cmplx(nan, nan)},
- Test{cmplx(inf, 2), cmplx(-inf, 1), cmplx(nan, nan)},
- Test{cmplx(inf, 2), cmplx(-inf, -1), cmplx(nan, nan)},
- Test{cmplx(inf, 2), cmplx(-inf, 2), cmplx(nan, nan)},
- Test{cmplx(inf, 2), cmplx(-inf, nan), cmplx(nan, nan)},
- Test{cmplx(inf, 2), cmplx(-inf, inf), cmplx(nan, nan)},
- Test{cmplx(inf, 2), cmplx(-inf, -inf), cmplx(nan, nan)},
- Test{cmplx(inf, nan), cmplx(0, 0), cmplx(inf, nan)},
- Test{cmplx(inf, nan), cmplx(0, 1), cmplx(nan, -inf)},
- Test{cmplx(inf, nan), cmplx(0, -1), cmplx(nan, inf)},
- Test{cmplx(inf, nan), cmplx(0, 2), cmplx(nan, -inf)},
- Test{cmplx(inf, nan), cmplx(0, nan), cmplx(nan, nan)},
- Test{cmplx(inf, nan), cmplx(0, inf), cmplx(nan, nan)},
- Test{cmplx(inf, nan), cmplx(0, -inf), cmplx(nan, nan)},
- Test{cmplx(inf, nan), cmplx(1, 0), cmplx(inf, nan)},
- Test{cmplx(inf, nan), cmplx(1, 1), cmplx(inf, -inf)},
- Test{cmplx(inf, nan), cmplx(1, -1), cmplx(inf, inf)},
- Test{cmplx(inf, nan), cmplx(1, 2), cmplx(inf, -inf)},
- Test{cmplx(inf, nan), cmplx(1, nan), cmplx(nan, nan)},
- Test{cmplx(inf, nan), cmplx(1, inf), cmplx(nan, nan)},
- Test{cmplx(inf, nan), cmplx(1, -inf), cmplx(nan, nan)},
- Test{cmplx(inf, nan), cmplx(-1, 0), cmplx(-inf, nan)},
- Test{cmplx(inf, nan), cmplx(-1, 1), cmplx(-inf, -inf)},
- Test{cmplx(inf, nan), cmplx(-1, -1), cmplx(-inf, inf)},
- Test{cmplx(inf, nan), cmplx(-1, 2), cmplx(-inf, -inf)},
- Test{cmplx(inf, nan), cmplx(-1, nan), cmplx(nan, nan)},
- Test{cmplx(inf, nan), cmplx(-1, inf), cmplx(nan, nan)},
- Test{cmplx(inf, nan), cmplx(-1, -inf), cmplx(nan, nan)},
- Test{cmplx(inf, nan), cmplx(2, 0), cmplx(inf, nan)},
- Test{cmplx(inf, nan), cmplx(2, 1), cmplx(inf, -inf)},
- Test{cmplx(inf, nan), cmplx(2, -1), cmplx(inf, inf)},
- Test{cmplx(inf, nan), cmplx(2, 2), cmplx(inf, -inf)},
- Test{cmplx(inf, nan), cmplx(2, nan), cmplx(nan, nan)},
- Test{cmplx(inf, nan), cmplx(2, inf), cmplx(nan, nan)},
- Test{cmplx(inf, nan), cmplx(2, -inf), cmplx(nan, nan)},
- Test{cmplx(inf, nan), cmplx(nan, 0), cmplx(nan, nan)},
- Test{cmplx(inf, nan), cmplx(nan, 1), cmplx(nan, nan)},
- Test{cmplx(inf, nan), cmplx(nan, -1), cmplx(nan, nan)},
- Test{cmplx(inf, nan), cmplx(nan, 2), cmplx(nan, nan)},
- Test{cmplx(inf, nan), cmplx(nan, nan), cmplx(nan, nan)},
- Test{cmplx(inf, nan), cmplx(nan, inf), cmplx(nan, nan)},
- Test{cmplx(inf, nan), cmplx(nan, -inf), cmplx(nan, nan)},
- Test{cmplx(inf, nan), cmplx(inf, 0), cmplx(nan, nan)},
- Test{cmplx(inf, nan), cmplx(inf, 1), cmplx(nan, nan)},
- Test{cmplx(inf, nan), cmplx(inf, -1), cmplx(nan, nan)},
- Test{cmplx(inf, nan), cmplx(inf, 2), cmplx(nan, nan)},
- Test{cmplx(inf, nan), cmplx(inf, nan), cmplx(nan, nan)},
- Test{cmplx(inf, nan), cmplx(inf, inf), cmplx(nan, nan)},
- Test{cmplx(inf, nan), cmplx(inf, -inf), cmplx(nan, nan)},
- Test{cmplx(inf, nan), cmplx(-inf, 0), cmplx(nan, nan)},
- Test{cmplx(inf, nan), cmplx(-inf, 1), cmplx(nan, nan)},
- Test{cmplx(inf, nan), cmplx(-inf, -1), cmplx(nan, nan)},
- Test{cmplx(inf, nan), cmplx(-inf, 2), cmplx(nan, nan)},
- Test{cmplx(inf, nan), cmplx(-inf, nan), cmplx(nan, nan)},
- Test{cmplx(inf, nan), cmplx(-inf, inf), cmplx(nan, nan)},
- Test{cmplx(inf, nan), cmplx(-inf, -inf), cmplx(nan, nan)},
- Test{cmplx(inf, inf), cmplx(0, 0), cmplx(inf, inf)},
- Test{cmplx(inf, inf), cmplx(0, 1), cmplx(inf, -inf)},
- Test{cmplx(inf, inf), cmplx(0, -1), cmplx(-inf, inf)},
- Test{cmplx(inf, inf), cmplx(0, 2), cmplx(inf, -inf)},
- Test{cmplx(inf, inf), cmplx(0, nan), cmplx(nan, nan)},
- Test{cmplx(inf, inf), cmplx(0, inf), cmplx(nan, nan)},
- Test{cmplx(inf, inf), cmplx(0, -inf), cmplx(nan, nan)},
- Test{cmplx(inf, inf), cmplx(1, 0), cmplx(inf, inf)},
- Test{cmplx(inf, inf), cmplx(1, 1), cmplx(inf, nan)},
- Test{cmplx(inf, inf), cmplx(1, -1), cmplx(nan, inf)},
- Test{cmplx(inf, inf), cmplx(1, 2), cmplx(inf, nan)},
- Test{cmplx(inf, inf), cmplx(1, nan), cmplx(nan, nan)},
- Test{cmplx(inf, inf), cmplx(1, inf), cmplx(nan, nan)},
- Test{cmplx(inf, inf), cmplx(1, -inf), cmplx(nan, nan)},
- Test{cmplx(inf, inf), cmplx(-1, 0), cmplx(-inf, -inf)},
- Test{cmplx(inf, inf), cmplx(-1, 1), cmplx(nan, -inf)},
- Test{cmplx(inf, inf), cmplx(-1, -1), cmplx(-inf, nan)},
- Test{cmplx(inf, inf), cmplx(-1, 2), cmplx(nan, -inf)},
- Test{cmplx(inf, inf), cmplx(-1, nan), cmplx(nan, nan)},
- Test{cmplx(inf, inf), cmplx(-1, inf), cmplx(nan, nan)},
- Test{cmplx(inf, inf), cmplx(-1, -inf), cmplx(nan, nan)},
- Test{cmplx(inf, inf), cmplx(2, 0), cmplx(inf, inf)},
- Test{cmplx(inf, inf), cmplx(2, 1), cmplx(inf, nan)},
- Test{cmplx(inf, inf), cmplx(2, -1), cmplx(nan, inf)},
- Test{cmplx(inf, inf), cmplx(2, 2), cmplx(inf, nan)},
- Test{cmplx(inf, inf), cmplx(2, nan), cmplx(nan, nan)},
- Test{cmplx(inf, inf), cmplx(2, inf), cmplx(nan, nan)},
- Test{cmplx(inf, inf), cmplx(2, -inf), cmplx(nan, nan)},
- Test{cmplx(inf, inf), cmplx(nan, 0), cmplx(nan, nan)},
- Test{cmplx(inf, inf), cmplx(nan, 1), cmplx(nan, nan)},
- Test{cmplx(inf, inf), cmplx(nan, -1), cmplx(nan, nan)},
- Test{cmplx(inf, inf), cmplx(nan, 2), cmplx(nan, nan)},
- Test{cmplx(inf, inf), cmplx(nan, nan), cmplx(nan, nan)},
- Test{cmplx(inf, inf), cmplx(nan, inf), cmplx(nan, nan)},
- Test{cmplx(inf, inf), cmplx(nan, -inf), cmplx(nan, nan)},
- Test{cmplx(inf, inf), cmplx(inf, 0), cmplx(nan, nan)},
- Test{cmplx(inf, inf), cmplx(inf, 1), cmplx(nan, nan)},
- Test{cmplx(inf, inf), cmplx(inf, -1), cmplx(nan, nan)},
- Test{cmplx(inf, inf), cmplx(inf, 2), cmplx(nan, nan)},
- Test{cmplx(inf, inf), cmplx(inf, nan), cmplx(nan, nan)},
- Test{cmplx(inf, inf), cmplx(inf, inf), cmplx(nan, nan)},
- Test{cmplx(inf, inf), cmplx(inf, -inf), cmplx(nan, nan)},
- Test{cmplx(inf, inf), cmplx(-inf, 0), cmplx(nan, nan)},
- Test{cmplx(inf, inf), cmplx(-inf, 1), cmplx(nan, nan)},
- Test{cmplx(inf, inf), cmplx(-inf, -1), cmplx(nan, nan)},
- Test{cmplx(inf, inf), cmplx(-inf, 2), cmplx(nan, nan)},
- Test{cmplx(inf, inf), cmplx(-inf, nan), cmplx(nan, nan)},
- Test{cmplx(inf, inf), cmplx(-inf, inf), cmplx(nan, nan)},
- Test{cmplx(inf, inf), cmplx(-inf, -inf), cmplx(nan, nan)},
- Test{cmplx(inf, -inf), cmplx(0, 0), cmplx(inf, -inf)},
- Test{cmplx(inf, -inf), cmplx(0, 1), cmplx(-inf, -inf)},
- Test{cmplx(inf, -inf), cmplx(0, -1), cmplx(inf, inf)},
- Test{cmplx(inf, -inf), cmplx(0, 2), cmplx(-inf, -inf)},
- Test{cmplx(inf, -inf), cmplx(0, nan), cmplx(nan, nan)},
- Test{cmplx(inf, -inf), cmplx(0, inf), cmplx(nan, nan)},
- Test{cmplx(inf, -inf), cmplx(0, -inf), cmplx(nan, nan)},
- Test{cmplx(inf, -inf), cmplx(1, 0), cmplx(inf, -inf)},
- Test{cmplx(inf, -inf), cmplx(1, 1), cmplx(nan, -inf)},
- Test{cmplx(inf, -inf), cmplx(1, -1), cmplx(inf, nan)},
- Test{cmplx(inf, -inf), cmplx(1, 2), cmplx(nan, -inf)},
- Test{cmplx(inf, -inf), cmplx(1, nan), cmplx(nan, nan)},
- Test{cmplx(inf, -inf), cmplx(1, inf), cmplx(nan, nan)},
- Test{cmplx(inf, -inf), cmplx(1, -inf), cmplx(nan, nan)},
- Test{cmplx(inf, -inf), cmplx(-1, 0), cmplx(-inf, inf)},
- Test{cmplx(inf, -inf), cmplx(-1, 1), cmplx(-inf, nan)},
- Test{cmplx(inf, -inf), cmplx(-1, -1), cmplx(nan, inf)},
- Test{cmplx(inf, -inf), cmplx(-1, 2), cmplx(-inf, nan)},
- Test{cmplx(inf, -inf), cmplx(-1, nan), cmplx(nan, nan)},
- Test{cmplx(inf, -inf), cmplx(-1, inf), cmplx(nan, nan)},
- Test{cmplx(inf, -inf), cmplx(-1, -inf), cmplx(nan, nan)},
- Test{cmplx(inf, -inf), cmplx(2, 0), cmplx(inf, -inf)},
- Test{cmplx(inf, -inf), cmplx(2, 1), cmplx(nan, -inf)},
- Test{cmplx(inf, -inf), cmplx(2, -1), cmplx(inf, nan)},
- Test{cmplx(inf, -inf), cmplx(2, 2), cmplx(nan, -inf)},
- Test{cmplx(inf, -inf), cmplx(2, nan), cmplx(nan, nan)},
- Test{cmplx(inf, -inf), cmplx(2, inf), cmplx(nan, nan)},
- Test{cmplx(inf, -inf), cmplx(2, -inf), cmplx(nan, nan)},
- Test{cmplx(inf, -inf), cmplx(nan, 0), cmplx(nan, nan)},
- Test{cmplx(inf, -inf), cmplx(nan, 1), cmplx(nan, nan)},
- Test{cmplx(inf, -inf), cmplx(nan, -1), cmplx(nan, nan)},
- Test{cmplx(inf, -inf), cmplx(nan, 2), cmplx(nan, nan)},
- Test{cmplx(inf, -inf), cmplx(nan, nan), cmplx(nan, nan)},
- Test{cmplx(inf, -inf), cmplx(nan, inf), cmplx(nan, nan)},
- Test{cmplx(inf, -inf), cmplx(nan, -inf), cmplx(nan, nan)},
- Test{cmplx(inf, -inf), cmplx(inf, 0), cmplx(nan, nan)},
- Test{cmplx(inf, -inf), cmplx(inf, 1), cmplx(nan, nan)},
- Test{cmplx(inf, -inf), cmplx(inf, -1), cmplx(nan, nan)},
- Test{cmplx(inf, -inf), cmplx(inf, 2), cmplx(nan, nan)},
- Test{cmplx(inf, -inf), cmplx(inf, nan), cmplx(nan, nan)},
- Test{cmplx(inf, -inf), cmplx(inf, inf), cmplx(nan, nan)},
- Test{cmplx(inf, -inf), cmplx(inf, -inf), cmplx(nan, nan)},
- Test{cmplx(inf, -inf), cmplx(-inf, 0), cmplx(nan, nan)},
- Test{cmplx(inf, -inf), cmplx(-inf, 1), cmplx(nan, nan)},
- Test{cmplx(inf, -inf), cmplx(-inf, -1), cmplx(nan, nan)},
- Test{cmplx(inf, -inf), cmplx(-inf, 2), cmplx(nan, nan)},
- Test{cmplx(inf, -inf), cmplx(-inf, nan), cmplx(nan, nan)},
- Test{cmplx(inf, -inf), cmplx(-inf, inf), cmplx(nan, nan)},
- Test{cmplx(inf, -inf), cmplx(-inf, -inf), cmplx(nan, nan)},
- Test{cmplx(-inf, 0), cmplx(0, 0), cmplx(-inf, nan)},
- Test{cmplx(-inf, 0), cmplx(0, 1), cmplx(nan, inf)},
- Test{cmplx(-inf, 0), cmplx(0, -1), cmplx(nan, -inf)},
- Test{cmplx(-inf, 0), cmplx(0, 2), cmplx(nan, inf)},
- Test{cmplx(-inf, 0), cmplx(0, nan), cmplx(nan, nan)},
- Test{cmplx(-inf, 0), cmplx(0, inf), cmplx(nan, nan)},
- Test{cmplx(-inf, 0), cmplx(0, -inf), cmplx(nan, nan)},
- Test{cmplx(-inf, 0), cmplx(1, 0), cmplx(-inf, nan)},
- Test{cmplx(-inf, 0), cmplx(1, 1), cmplx(-inf, inf)},
- Test{cmplx(-inf, 0), cmplx(1, -1), cmplx(-inf, -inf)},
- Test{cmplx(-inf, 0), cmplx(1, 2), cmplx(-inf, inf)},
- Test{cmplx(-inf, 0), cmplx(1, nan), cmplx(nan, nan)},
- Test{cmplx(-inf, 0), cmplx(1, inf), cmplx(nan, nan)},
- Test{cmplx(-inf, 0), cmplx(1, -inf), cmplx(nan, nan)},
- Test{cmplx(-inf, 0), cmplx(-1, 0), cmplx(inf, nan)},
- Test{cmplx(-inf, 0), cmplx(-1, 1), cmplx(inf, inf)},
- Test{cmplx(-inf, 0), cmplx(-1, -1), cmplx(inf, -inf)},
- Test{cmplx(-inf, 0), cmplx(-1, 2), cmplx(inf, inf)},
- Test{cmplx(-inf, 0), cmplx(-1, nan), cmplx(nan, nan)},
- Test{cmplx(-inf, 0), cmplx(-1, inf), cmplx(nan, nan)},
- Test{cmplx(-inf, 0), cmplx(-1, -inf), cmplx(nan, nan)},
- Test{cmplx(-inf, 0), cmplx(2, 0), cmplx(-inf, nan)},
- Test{cmplx(-inf, 0), cmplx(2, 1), cmplx(-inf, inf)},
- Test{cmplx(-inf, 0), cmplx(2, -1), cmplx(-inf, -inf)},
- Test{cmplx(-inf, 0), cmplx(2, 2), cmplx(-inf, inf)},
- Test{cmplx(-inf, 0), cmplx(2, nan), cmplx(nan, nan)},
- Test{cmplx(-inf, 0), cmplx(2, inf), cmplx(nan, nan)},
- Test{cmplx(-inf, 0), cmplx(2, -inf), cmplx(nan, nan)},
- Test{cmplx(-inf, 0), cmplx(nan, 0), cmplx(nan, nan)},
- Test{cmplx(-inf, 0), cmplx(nan, 1), cmplx(nan, nan)},
- Test{cmplx(-inf, 0), cmplx(nan, -1), cmplx(nan, nan)},
- Test{cmplx(-inf, 0), cmplx(nan, 2), cmplx(nan, nan)},
- Test{cmplx(-inf, 0), cmplx(nan, nan), cmplx(nan, nan)},
- Test{cmplx(-inf, 0), cmplx(nan, inf), cmplx(nan, nan)},
- Test{cmplx(-inf, 0), cmplx(nan, -inf), cmplx(nan, nan)},
- Test{cmplx(-inf, 0), cmplx(inf, 0), cmplx(nan, nan)},
- Test{cmplx(-inf, 0), cmplx(inf, 1), cmplx(nan, nan)},
- Test{cmplx(-inf, 0), cmplx(inf, -1), cmplx(nan, nan)},
- Test{cmplx(-inf, 0), cmplx(inf, 2), cmplx(nan, nan)},
- Test{cmplx(-inf, 0), cmplx(inf, nan), cmplx(nan, nan)},
- Test{cmplx(-inf, 0), cmplx(inf, inf), cmplx(nan, nan)},
- Test{cmplx(-inf, 0), cmplx(inf, -inf), cmplx(nan, nan)},
- Test{cmplx(-inf, 0), cmplx(-inf, 0), cmplx(nan, nan)},
- Test{cmplx(-inf, 0), cmplx(-inf, 1), cmplx(nan, nan)},
- Test{cmplx(-inf, 0), cmplx(-inf, -1), cmplx(nan, nan)},
- Test{cmplx(-inf, 0), cmplx(-inf, 2), cmplx(nan, nan)},
- Test{cmplx(-inf, 0), cmplx(-inf, nan), cmplx(nan, nan)},
- Test{cmplx(-inf, 0), cmplx(-inf, inf), cmplx(nan, nan)},
- Test{cmplx(-inf, 0), cmplx(-inf, -inf), cmplx(nan, nan)},
- Test{cmplx(-inf, 1), cmplx(0, 0), cmplx(-inf, inf)},
- Test{cmplx(-inf, 1), cmplx(0, 1), cmplx(nan, inf)},
- Test{cmplx(-inf, 1), cmplx(0, -1), cmplx(nan, -inf)},
- Test{cmplx(-inf, 1), cmplx(0, 2), cmplx(nan, inf)},
- Test{cmplx(-inf, 1), cmplx(0, nan), cmplx(nan, nan)},
- Test{cmplx(-inf, 1), cmplx(0, inf), cmplx(nan, nan)},
- Test{cmplx(-inf, 1), cmplx(0, -inf), cmplx(nan, nan)},
- Test{cmplx(-inf, 1), cmplx(1, 0), cmplx(-inf, nan)},
- Test{cmplx(-inf, 1), cmplx(1, 1), cmplx(-inf, inf)},
- Test{cmplx(-inf, 1), cmplx(1, -1), cmplx(-inf, -inf)},
- Test{cmplx(-inf, 1), cmplx(1, 2), cmplx(-inf, inf)},
- Test{cmplx(-inf, 1), cmplx(1, nan), cmplx(nan, nan)},
- Test{cmplx(-inf, 1), cmplx(1, inf), cmplx(nan, nan)},
- Test{cmplx(-inf, 1), cmplx(1, -inf), cmplx(nan, nan)},
- Test{cmplx(-inf, 1), cmplx(-1, 0), cmplx(inf, nan)},
- Test{cmplx(-inf, 1), cmplx(-1, 1), cmplx(inf, inf)},
- Test{cmplx(-inf, 1), cmplx(-1, -1), cmplx(inf, -inf)},
- Test{cmplx(-inf, 1), cmplx(-1, 2), cmplx(inf, inf)},
- Test{cmplx(-inf, 1), cmplx(-1, nan), cmplx(nan, nan)},
- Test{cmplx(-inf, 1), cmplx(-1, inf), cmplx(nan, nan)},
- Test{cmplx(-inf, 1), cmplx(-1, -inf), cmplx(nan, nan)},
- Test{cmplx(-inf, 1), cmplx(2, 0), cmplx(-inf, nan)},
- Test{cmplx(-inf, 1), cmplx(2, 1), cmplx(-inf, inf)},
- Test{cmplx(-inf, 1), cmplx(2, -1), cmplx(-inf, -inf)},
- Test{cmplx(-inf, 1), cmplx(2, 2), cmplx(-inf, inf)},
- Test{cmplx(-inf, 1), cmplx(2, nan), cmplx(nan, nan)},
- Test{cmplx(-inf, 1), cmplx(2, inf), cmplx(nan, nan)},
- Test{cmplx(-inf, 1), cmplx(2, -inf), cmplx(nan, nan)},
- Test{cmplx(-inf, 1), cmplx(nan, 0), cmplx(nan, nan)},
- Test{cmplx(-inf, 1), cmplx(nan, 1), cmplx(nan, nan)},
- Test{cmplx(-inf, 1), cmplx(nan, -1), cmplx(nan, nan)},
- Test{cmplx(-inf, 1), cmplx(nan, 2), cmplx(nan, nan)},
- Test{cmplx(-inf, 1), cmplx(nan, nan), cmplx(nan, nan)},
- Test{cmplx(-inf, 1), cmplx(nan, inf), cmplx(nan, nan)},
- Test{cmplx(-inf, 1), cmplx(nan, -inf), cmplx(nan, nan)},
- Test{cmplx(-inf, 1), cmplx(inf, 0), cmplx(nan, nan)},
- Test{cmplx(-inf, 1), cmplx(inf, 1), cmplx(nan, nan)},
- Test{cmplx(-inf, 1), cmplx(inf, -1), cmplx(nan, nan)},
- Test{cmplx(-inf, 1), cmplx(inf, 2), cmplx(nan, nan)},
- Test{cmplx(-inf, 1), cmplx(inf, nan), cmplx(nan, nan)},
- Test{cmplx(-inf, 1), cmplx(inf, inf), cmplx(nan, nan)},
- Test{cmplx(-inf, 1), cmplx(inf, -inf), cmplx(nan, nan)},
- Test{cmplx(-inf, 1), cmplx(-inf, 0), cmplx(nan, nan)},
- Test{cmplx(-inf, 1), cmplx(-inf, 1), cmplx(nan, nan)},
- Test{cmplx(-inf, 1), cmplx(-inf, -1), cmplx(nan, nan)},
- Test{cmplx(-inf, 1), cmplx(-inf, 2), cmplx(nan, nan)},
- Test{cmplx(-inf, 1), cmplx(-inf, nan), cmplx(nan, nan)},
- Test{cmplx(-inf, 1), cmplx(-inf, inf), cmplx(nan, nan)},
- Test{cmplx(-inf, 1), cmplx(-inf, -inf), cmplx(nan, nan)},
- Test{cmplx(-inf, -1), cmplx(0, 0), cmplx(-inf, -inf)},
- Test{cmplx(-inf, -1), cmplx(0, 1), cmplx(nan, inf)},
- Test{cmplx(-inf, -1), cmplx(0, -1), cmplx(nan, -inf)},
- Test{cmplx(-inf, -1), cmplx(0, 2), cmplx(nan, inf)},
- Test{cmplx(-inf, -1), cmplx(0, nan), cmplx(nan, nan)},
- Test{cmplx(-inf, -1), cmplx(0, inf), cmplx(nan, nan)},
- Test{cmplx(-inf, -1), cmplx(0, -inf), cmplx(nan, nan)},
- Test{cmplx(-inf, -1), cmplx(1, 0), cmplx(-inf, nan)},
- Test{cmplx(-inf, -1), cmplx(1, 1), cmplx(-inf, inf)},
- Test{cmplx(-inf, -1), cmplx(1, -1), cmplx(-inf, -inf)},
- Test{cmplx(-inf, -1), cmplx(1, 2), cmplx(-inf, inf)},
- Test{cmplx(-inf, -1), cmplx(1, nan), cmplx(nan, nan)},
- Test{cmplx(-inf, -1), cmplx(1, inf), cmplx(nan, nan)},
- Test{cmplx(-inf, -1), cmplx(1, -inf), cmplx(nan, nan)},
- Test{cmplx(-inf, -1), cmplx(-1, 0), cmplx(inf, nan)},
- Test{cmplx(-inf, -1), cmplx(-1, 1), cmplx(inf, inf)},
- Test{cmplx(-inf, -1), cmplx(-1, -1), cmplx(inf, -inf)},
- Test{cmplx(-inf, -1), cmplx(-1, 2), cmplx(inf, inf)},
- Test{cmplx(-inf, -1), cmplx(-1, nan), cmplx(nan, nan)},
- Test{cmplx(-inf, -1), cmplx(-1, inf), cmplx(nan, nan)},
- Test{cmplx(-inf, -1), cmplx(-1, -inf), cmplx(nan, nan)},
- Test{cmplx(-inf, -1), cmplx(2, 0), cmplx(-inf, nan)},
- Test{cmplx(-inf, -1), cmplx(2, 1), cmplx(-inf, inf)},
- Test{cmplx(-inf, -1), cmplx(2, -1), cmplx(-inf, -inf)},
- Test{cmplx(-inf, -1), cmplx(2, 2), cmplx(-inf, inf)},
- Test{cmplx(-inf, -1), cmplx(2, nan), cmplx(nan, nan)},
- Test{cmplx(-inf, -1), cmplx(2, inf), cmplx(nan, nan)},
- Test{cmplx(-inf, -1), cmplx(2, -inf), cmplx(nan, nan)},
- Test{cmplx(-inf, -1), cmplx(nan, 0), cmplx(nan, nan)},
- Test{cmplx(-inf, -1), cmplx(nan, 1), cmplx(nan, nan)},
- Test{cmplx(-inf, -1), cmplx(nan, -1), cmplx(nan, nan)},
- Test{cmplx(-inf, -1), cmplx(nan, 2), cmplx(nan, nan)},
- Test{cmplx(-inf, -1), cmplx(nan, nan), cmplx(nan, nan)},
- Test{cmplx(-inf, -1), cmplx(nan, inf), cmplx(nan, nan)},
- Test{cmplx(-inf, -1), cmplx(nan, -inf), cmplx(nan, nan)},
- Test{cmplx(-inf, -1), cmplx(inf, 0), cmplx(nan, nan)},
- Test{cmplx(-inf, -1), cmplx(inf, 1), cmplx(nan, nan)},
- Test{cmplx(-inf, -1), cmplx(inf, -1), cmplx(nan, nan)},
- Test{cmplx(-inf, -1), cmplx(inf, 2), cmplx(nan, nan)},
- Test{cmplx(-inf, -1), cmplx(inf, nan), cmplx(nan, nan)},
- Test{cmplx(-inf, -1), cmplx(inf, inf), cmplx(nan, nan)},
- Test{cmplx(-inf, -1), cmplx(inf, -inf), cmplx(nan, nan)},
- Test{cmplx(-inf, -1), cmplx(-inf, 0), cmplx(nan, nan)},
- Test{cmplx(-inf, -1), cmplx(-inf, 1), cmplx(nan, nan)},
- Test{cmplx(-inf, -1), cmplx(-inf, -1), cmplx(nan, nan)},
- Test{cmplx(-inf, -1), cmplx(-inf, 2), cmplx(nan, nan)},
- Test{cmplx(-inf, -1), cmplx(-inf, nan), cmplx(nan, nan)},
- Test{cmplx(-inf, -1), cmplx(-inf, inf), cmplx(nan, nan)},
- Test{cmplx(-inf, -1), cmplx(-inf, -inf), cmplx(nan, nan)},
- Test{cmplx(-inf, 2), cmplx(0, 0), cmplx(-inf, inf)},
- Test{cmplx(-inf, 2), cmplx(0, 1), cmplx(nan, inf)},
- Test{cmplx(-inf, 2), cmplx(0, -1), cmplx(nan, -inf)},
- Test{cmplx(-inf, 2), cmplx(0, 2), cmplx(nan, inf)},
- Test{cmplx(-inf, 2), cmplx(0, nan), cmplx(nan, nan)},
- Test{cmplx(-inf, 2), cmplx(0, inf), cmplx(nan, nan)},
- Test{cmplx(-inf, 2), cmplx(0, -inf), cmplx(nan, nan)},
- Test{cmplx(-inf, 2), cmplx(1, 0), cmplx(-inf, nan)},
- Test{cmplx(-inf, 2), cmplx(1, 1), cmplx(-inf, inf)},
- Test{cmplx(-inf, 2), cmplx(1, -1), cmplx(-inf, -inf)},
- Test{cmplx(-inf, 2), cmplx(1, 2), cmplx(-inf, inf)},
- Test{cmplx(-inf, 2), cmplx(1, nan), cmplx(nan, nan)},
- Test{cmplx(-inf, 2), cmplx(1, inf), cmplx(nan, nan)},
- Test{cmplx(-inf, 2), cmplx(1, -inf), cmplx(nan, nan)},
- Test{cmplx(-inf, 2), cmplx(-1, 0), cmplx(inf, nan)},
- Test{cmplx(-inf, 2), cmplx(-1, 1), cmplx(inf, inf)},
- Test{cmplx(-inf, 2), cmplx(-1, -1), cmplx(inf, -inf)},
- Test{cmplx(-inf, 2), cmplx(-1, 2), cmplx(inf, inf)},
- Test{cmplx(-inf, 2), cmplx(-1, nan), cmplx(nan, nan)},
- Test{cmplx(-inf, 2), cmplx(-1, inf), cmplx(nan, nan)},
- Test{cmplx(-inf, 2), cmplx(-1, -inf), cmplx(nan, nan)},
- Test{cmplx(-inf, 2), cmplx(2, 0), cmplx(-inf, nan)},
- Test{cmplx(-inf, 2), cmplx(2, 1), cmplx(-inf, inf)},
- Test{cmplx(-inf, 2), cmplx(2, -1), cmplx(-inf, -inf)},
- Test{cmplx(-inf, 2), cmplx(2, 2), cmplx(-inf, inf)},
- Test{cmplx(-inf, 2), cmplx(2, nan), cmplx(nan, nan)},
- Test{cmplx(-inf, 2), cmplx(2, inf), cmplx(nan, nan)},
- Test{cmplx(-inf, 2), cmplx(2, -inf), cmplx(nan, nan)},
- Test{cmplx(-inf, 2), cmplx(nan, 0), cmplx(nan, nan)},
- Test{cmplx(-inf, 2), cmplx(nan, 1), cmplx(nan, nan)},
- Test{cmplx(-inf, 2), cmplx(nan, -1), cmplx(nan, nan)},
- Test{cmplx(-inf, 2), cmplx(nan, 2), cmplx(nan, nan)},
- Test{cmplx(-inf, 2), cmplx(nan, nan), cmplx(nan, nan)},
- Test{cmplx(-inf, 2), cmplx(nan, inf), cmplx(nan, nan)},
- Test{cmplx(-inf, 2), cmplx(nan, -inf), cmplx(nan, nan)},
- Test{cmplx(-inf, 2), cmplx(inf, 0), cmplx(nan, nan)},
- Test{cmplx(-inf, 2), cmplx(inf, 1), cmplx(nan, nan)},
- Test{cmplx(-inf, 2), cmplx(inf, -1), cmplx(nan, nan)},
- Test{cmplx(-inf, 2), cmplx(inf, 2), cmplx(nan, nan)},
- Test{cmplx(-inf, 2), cmplx(inf, nan), cmplx(nan, nan)},
- Test{cmplx(-inf, 2), cmplx(inf, inf), cmplx(nan, nan)},
- Test{cmplx(-inf, 2), cmplx(inf, -inf), cmplx(nan, nan)},
- Test{cmplx(-inf, 2), cmplx(-inf, 0), cmplx(nan, nan)},
- Test{cmplx(-inf, 2), cmplx(-inf, 1), cmplx(nan, nan)},
- Test{cmplx(-inf, 2), cmplx(-inf, -1), cmplx(nan, nan)},
- Test{cmplx(-inf, 2), cmplx(-inf, 2), cmplx(nan, nan)},
- Test{cmplx(-inf, 2), cmplx(-inf, nan), cmplx(nan, nan)},
- Test{cmplx(-inf, 2), cmplx(-inf, inf), cmplx(nan, nan)},
- Test{cmplx(-inf, 2), cmplx(-inf, -inf), cmplx(nan, nan)},
- Test{cmplx(-inf, nan), cmplx(0, 0), cmplx(-inf, nan)},
- Test{cmplx(-inf, nan), cmplx(0, 1), cmplx(nan, inf)},
- Test{cmplx(-inf, nan), cmplx(0, -1), cmplx(nan, -inf)},
- Test{cmplx(-inf, nan), cmplx(0, 2), cmplx(nan, inf)},
- Test{cmplx(-inf, nan), cmplx(0, nan), cmplx(nan, nan)},
- Test{cmplx(-inf, nan), cmplx(0, inf), cmplx(nan, nan)},
- Test{cmplx(-inf, nan), cmplx(0, -inf), cmplx(nan, nan)},
- Test{cmplx(-inf, nan), cmplx(1, 0), cmplx(-inf, nan)},
- Test{cmplx(-inf, nan), cmplx(1, 1), cmplx(-inf, inf)},
- Test{cmplx(-inf, nan), cmplx(1, -1), cmplx(-inf, -inf)},
- Test{cmplx(-inf, nan), cmplx(1, 2), cmplx(-inf, inf)},
- Test{cmplx(-inf, nan), cmplx(1, nan), cmplx(nan, nan)},
- Test{cmplx(-inf, nan), cmplx(1, inf), cmplx(nan, nan)},
- Test{cmplx(-inf, nan), cmplx(1, -inf), cmplx(nan, nan)},
- Test{cmplx(-inf, nan), cmplx(-1, 0), cmplx(inf, nan)},
- Test{cmplx(-inf, nan), cmplx(-1, 1), cmplx(inf, inf)},
- Test{cmplx(-inf, nan), cmplx(-1, -1), cmplx(inf, -inf)},
- Test{cmplx(-inf, nan), cmplx(-1, 2), cmplx(inf, inf)},
- Test{cmplx(-inf, nan), cmplx(-1, nan), cmplx(nan, nan)},
- Test{cmplx(-inf, nan), cmplx(-1, inf), cmplx(nan, nan)},
- Test{cmplx(-inf, nan), cmplx(-1, -inf), cmplx(nan, nan)},
- Test{cmplx(-inf, nan), cmplx(2, 0), cmplx(-inf, nan)},
- Test{cmplx(-inf, nan), cmplx(2, 1), cmplx(-inf, inf)},
- Test{cmplx(-inf, nan), cmplx(2, -1), cmplx(-inf, -inf)},
- Test{cmplx(-inf, nan), cmplx(2, 2), cmplx(-inf, inf)},
- Test{cmplx(-inf, nan), cmplx(2, nan), cmplx(nan, nan)},
- Test{cmplx(-inf, nan), cmplx(2, inf), cmplx(nan, nan)},
- Test{cmplx(-inf, nan), cmplx(2, -inf), cmplx(nan, nan)},
- Test{cmplx(-inf, nan), cmplx(nan, 0), cmplx(nan, nan)},
- Test{cmplx(-inf, nan), cmplx(nan, 1), cmplx(nan, nan)},
- Test{cmplx(-inf, nan), cmplx(nan, -1), cmplx(nan, nan)},
- Test{cmplx(-inf, nan), cmplx(nan, 2), cmplx(nan, nan)},
- Test{cmplx(-inf, nan), cmplx(nan, nan), cmplx(nan, nan)},
- Test{cmplx(-inf, nan), cmplx(nan, inf), cmplx(nan, nan)},
- Test{cmplx(-inf, nan), cmplx(nan, -inf), cmplx(nan, nan)},
- Test{cmplx(-inf, nan), cmplx(inf, 0), cmplx(nan, nan)},
- Test{cmplx(-inf, nan), cmplx(inf, 1), cmplx(nan, nan)},
- Test{cmplx(-inf, nan), cmplx(inf, -1), cmplx(nan, nan)},
- Test{cmplx(-inf, nan), cmplx(inf, 2), cmplx(nan, nan)},
- Test{cmplx(-inf, nan), cmplx(inf, nan), cmplx(nan, nan)},
- Test{cmplx(-inf, nan), cmplx(inf, inf), cmplx(nan, nan)},
- Test{cmplx(-inf, nan), cmplx(inf, -inf), cmplx(nan, nan)},
- Test{cmplx(-inf, nan), cmplx(-inf, 0), cmplx(nan, nan)},
- Test{cmplx(-inf, nan), cmplx(-inf, 1), cmplx(nan, nan)},
- Test{cmplx(-inf, nan), cmplx(-inf, -1), cmplx(nan, nan)},
- Test{cmplx(-inf, nan), cmplx(-inf, 2), cmplx(nan, nan)},
- Test{cmplx(-inf, nan), cmplx(-inf, nan), cmplx(nan, nan)},
- Test{cmplx(-inf, nan), cmplx(-inf, inf), cmplx(nan, nan)},
- Test{cmplx(-inf, nan), cmplx(-inf, -inf), cmplx(nan, nan)},
- Test{cmplx(-inf, inf), cmplx(0, 0), cmplx(-inf, inf)},
- Test{cmplx(-inf, inf), cmplx(0, 1), cmplx(inf, inf)},
- Test{cmplx(-inf, inf), cmplx(0, -1), cmplx(-inf, -inf)},
- Test{cmplx(-inf, inf), cmplx(0, 2), cmplx(inf, inf)},
- Test{cmplx(-inf, inf), cmplx(0, nan), cmplx(nan, nan)},
- Test{cmplx(-inf, inf), cmplx(0, inf), cmplx(nan, nan)},
- Test{cmplx(-inf, inf), cmplx(0, -inf), cmplx(nan, nan)},
- Test{cmplx(-inf, inf), cmplx(1, 0), cmplx(-inf, inf)},
- Test{cmplx(-inf, inf), cmplx(1, 1), cmplx(nan, inf)},
- Test{cmplx(-inf, inf), cmplx(1, -1), cmplx(-inf, nan)},
- Test{cmplx(-inf, inf), cmplx(1, 2), cmplx(nan, inf)},
- Test{cmplx(-inf, inf), cmplx(1, nan), cmplx(nan, nan)},
- Test{cmplx(-inf, inf), cmplx(1, inf), cmplx(nan, nan)},
- Test{cmplx(-inf, inf), cmplx(1, -inf), cmplx(nan, nan)},
- Test{cmplx(-inf, inf), cmplx(-1, 0), cmplx(inf, -inf)},
- Test{cmplx(-inf, inf), cmplx(-1, 1), cmplx(inf, nan)},
- Test{cmplx(-inf, inf), cmplx(-1, -1), cmplx(nan, -inf)},
- Test{cmplx(-inf, inf), cmplx(-1, 2), cmplx(inf, nan)},
- Test{cmplx(-inf, inf), cmplx(-1, nan), cmplx(nan, nan)},
- Test{cmplx(-inf, inf), cmplx(-1, inf), cmplx(nan, nan)},
- Test{cmplx(-inf, inf), cmplx(-1, -inf), cmplx(nan, nan)},
- Test{cmplx(-inf, inf), cmplx(2, 0), cmplx(-inf, inf)},
- Test{cmplx(-inf, inf), cmplx(2, 1), cmplx(nan, inf)},
- Test{cmplx(-inf, inf), cmplx(2, -1), cmplx(-inf, nan)},
- Test{cmplx(-inf, inf), cmplx(2, 2), cmplx(nan, inf)},
- Test{cmplx(-inf, inf), cmplx(2, nan), cmplx(nan, nan)},
- Test{cmplx(-inf, inf), cmplx(2, inf), cmplx(nan, nan)},
- Test{cmplx(-inf, inf), cmplx(2, -inf), cmplx(nan, nan)},
- Test{cmplx(-inf, inf), cmplx(nan, 0), cmplx(nan, nan)},
- Test{cmplx(-inf, inf), cmplx(nan, 1), cmplx(nan, nan)},
- Test{cmplx(-inf, inf), cmplx(nan, -1), cmplx(nan, nan)},
- Test{cmplx(-inf, inf), cmplx(nan, 2), cmplx(nan, nan)},
- Test{cmplx(-inf, inf), cmplx(nan, nan), cmplx(nan, nan)},
- Test{cmplx(-inf, inf), cmplx(nan, inf), cmplx(nan, nan)},
- Test{cmplx(-inf, inf), cmplx(nan, -inf), cmplx(nan, nan)},
- Test{cmplx(-inf, inf), cmplx(inf, 0), cmplx(nan, nan)},
- Test{cmplx(-inf, inf), cmplx(inf, 1), cmplx(nan, nan)},
- Test{cmplx(-inf, inf), cmplx(inf, -1), cmplx(nan, nan)},
- Test{cmplx(-inf, inf), cmplx(inf, 2), cmplx(nan, nan)},
- Test{cmplx(-inf, inf), cmplx(inf, nan), cmplx(nan, nan)},
- Test{cmplx(-inf, inf), cmplx(inf, inf), cmplx(nan, nan)},
- Test{cmplx(-inf, inf), cmplx(inf, -inf), cmplx(nan, nan)},
- Test{cmplx(-inf, inf), cmplx(-inf, 0), cmplx(nan, nan)},
- Test{cmplx(-inf, inf), cmplx(-inf, 1), cmplx(nan, nan)},
- Test{cmplx(-inf, inf), cmplx(-inf, -1), cmplx(nan, nan)},
- Test{cmplx(-inf, inf), cmplx(-inf, 2), cmplx(nan, nan)},
- Test{cmplx(-inf, inf), cmplx(-inf, nan), cmplx(nan, nan)},
- Test{cmplx(-inf, inf), cmplx(-inf, inf), cmplx(nan, nan)},
- Test{cmplx(-inf, inf), cmplx(-inf, -inf), cmplx(nan, nan)},
- Test{cmplx(-inf, -inf), cmplx(0, 0), cmplx(-inf, -inf)},
- Test{cmplx(-inf, -inf), cmplx(0, 1), cmplx(-inf, inf)},
- Test{cmplx(-inf, -inf), cmplx(0, -1), cmplx(inf, -inf)},
- Test{cmplx(-inf, -inf), cmplx(0, 2), cmplx(-inf, inf)},
- Test{cmplx(-inf, -inf), cmplx(0, nan), cmplx(nan, nan)},
- Test{cmplx(-inf, -inf), cmplx(0, inf), cmplx(nan, nan)},
- Test{cmplx(-inf, -inf), cmplx(0, -inf), cmplx(nan, nan)},
- Test{cmplx(-inf, -inf), cmplx(1, 0), cmplx(-inf, -inf)},
- Test{cmplx(-inf, -inf), cmplx(1, 1), cmplx(-inf, nan)},
- Test{cmplx(-inf, -inf), cmplx(1, -1), cmplx(nan, -inf)},
- Test{cmplx(-inf, -inf), cmplx(1, 2), cmplx(-inf, nan)},
- Test{cmplx(-inf, -inf), cmplx(1, nan), cmplx(nan, nan)},
- Test{cmplx(-inf, -inf), cmplx(1, inf), cmplx(nan, nan)},
- Test{cmplx(-inf, -inf), cmplx(1, -inf), cmplx(nan, nan)},
- Test{cmplx(-inf, -inf), cmplx(-1, 0), cmplx(inf, inf)},
- Test{cmplx(-inf, -inf), cmplx(-1, 1), cmplx(nan, inf)},
- Test{cmplx(-inf, -inf), cmplx(-1, -1), cmplx(inf, nan)},
- Test{cmplx(-inf, -inf), cmplx(-1, 2), cmplx(nan, inf)},
- Test{cmplx(-inf, -inf), cmplx(-1, nan), cmplx(nan, nan)},
- Test{cmplx(-inf, -inf), cmplx(-1, inf), cmplx(nan, nan)},
- Test{cmplx(-inf, -inf), cmplx(-1, -inf), cmplx(nan, nan)},
- Test{cmplx(-inf, -inf), cmplx(2, 0), cmplx(-inf, -inf)},
- Test{cmplx(-inf, -inf), cmplx(2, 1), cmplx(-inf, nan)},
- Test{cmplx(-inf, -inf), cmplx(2, -1), cmplx(nan, -inf)},
- Test{cmplx(-inf, -inf), cmplx(2, 2), cmplx(-inf, nan)},
- Test{cmplx(-inf, -inf), cmplx(2, nan), cmplx(nan, nan)},
- Test{cmplx(-inf, -inf), cmplx(2, inf), cmplx(nan, nan)},
- Test{cmplx(-inf, -inf), cmplx(2, -inf), cmplx(nan, nan)},
- Test{cmplx(-inf, -inf), cmplx(nan, 0), cmplx(nan, nan)},
- Test{cmplx(-inf, -inf), cmplx(nan, 1), cmplx(nan, nan)},
- Test{cmplx(-inf, -inf), cmplx(nan, -1), cmplx(nan, nan)},
- Test{cmplx(-inf, -inf), cmplx(nan, 2), cmplx(nan, nan)},
- Test{cmplx(-inf, -inf), cmplx(nan, nan), cmplx(nan, nan)},
- Test{cmplx(-inf, -inf), cmplx(nan, inf), cmplx(nan, nan)},
- Test{cmplx(-inf, -inf), cmplx(nan, -inf), cmplx(nan, nan)},
- Test{cmplx(-inf, -inf), cmplx(inf, 0), cmplx(nan, nan)},
- Test{cmplx(-inf, -inf), cmplx(inf, 1), cmplx(nan, nan)},
- Test{cmplx(-inf, -inf), cmplx(inf, -1), cmplx(nan, nan)},
- Test{cmplx(-inf, -inf), cmplx(inf, 2), cmplx(nan, nan)},
- Test{cmplx(-inf, -inf), cmplx(inf, nan), cmplx(nan, nan)},
- Test{cmplx(-inf, -inf), cmplx(inf, inf), cmplx(nan, nan)},
- Test{cmplx(-inf, -inf), cmplx(inf, -inf), cmplx(nan, nan)},
- Test{cmplx(-inf, -inf), cmplx(-inf, 0), cmplx(nan, nan)},
- Test{cmplx(-inf, -inf), cmplx(-inf, 1), cmplx(nan, nan)},
- Test{cmplx(-inf, -inf), cmplx(-inf, -1), cmplx(nan, nan)},
- Test{cmplx(-inf, -inf), cmplx(-inf, 2), cmplx(nan, nan)},
- Test{cmplx(-inf, -inf), cmplx(-inf, nan), cmplx(nan, nan)},
- Test{cmplx(-inf, -inf), cmplx(-inf, inf), cmplx(nan, nan)},
- Test{cmplx(-inf, -inf), cmplx(-inf, -inf), cmplx(nan, nan)},
+ Test{complex(0, 0), complex(0, 0), complex(-nan, -nan)},
+ Test{complex(0, 0), complex(0, 1), complex(0, 0)},
+ Test{complex(0, 0), complex(0, -1), complex(negzero, 0)},
+ Test{complex(0, 0), complex(0, 2), complex(0, 0)},
+ Test{complex(0, 0), complex(nan, nan), complex(nan, nan)},
+ Test{complex(0, 0), complex(-nan, inf), complex(0, negzero)},
+ Test{complex(0, 0), complex(-nan, -inf), complex(negzero, 0)},
+ Test{complex(0, 0), complex(1, 0), complex(0, 0)},
+ Test{complex(0, 0), complex(1, 1), complex(0, 0)},
+ Test{complex(0, 0), complex(1, -1), complex(0, 0)},
+ Test{complex(0, 0), complex(1, 2), complex(0, 0)},
+ Test{complex(0, 0), complex(nan, nan), complex(nan, nan)},
+ Test{complex(0, 0), complex(-nan, inf), complex(0, negzero)},
+ Test{complex(0, 0), complex(-nan, -inf), complex(negzero, 0)},
+ Test{complex(0, 0), complex(-1, 0), complex(negzero, negzero)},
+ Test{complex(0, 0), complex(-1, 1), complex(negzero, negzero)},
+ Test{complex(0, 0), complex(-1, -1), complex(negzero, negzero)},
+ Test{complex(0, 0), complex(-1, 2), complex(0, negzero)},
+ Test{complex(0, 0), complex(nan, nan), complex(nan, nan)},
+ Test{complex(0, 0), complex(-nan, inf), complex(0, negzero)},
+ Test{complex(0, 0), complex(-nan, -inf), complex(negzero, 0)},
+ Test{complex(0, 0), complex(2, 0), complex(0, 0)},
+ Test{complex(0, 0), complex(2, 1), complex(0, 0)},
+ Test{complex(0, 0), complex(2, -1), complex(0, 0)},
+ Test{complex(0, 0), complex(2, 2), complex(0, 0)},
+ Test{complex(0, 0), complex(nan, nan), complex(nan, nan)},
+ Test{complex(0, 0), complex(-nan, inf), complex(0, negzero)},
+ Test{complex(0, 0), complex(-nan, -inf), complex(negzero, 0)},
+ Test{complex(0, 0), complex(nan, 0), complex(nan, nan)},
+ Test{complex(0, 0), complex(nan, 1), complex(nan, nan)},
+ Test{complex(0, 0), complex(nan, -1), complex(nan, nan)},
+ Test{complex(0, 0), complex(nan, 2), complex(nan, nan)},
+ Test{complex(0, 0), complex(nan, nan), complex(nan, nan)},
+ Test{complex(0, 0), complex(-nan, inf), complex(0, negzero)},
+ Test{complex(0, 0), complex(-nan, -inf), complex(negzero, 0)},
+ Test{complex(0, 0), complex(inf, 0), complex(0, 0)},
+ Test{complex(0, 0), complex(inf, 1), complex(0, 0)},
+ Test{complex(0, 0), complex(inf, -1), complex(0, 0)},
+ Test{complex(0, 0), complex(inf, 2), complex(0, 0)},
+ Test{complex(0, 0), complex(nan, nan), complex(nan, nan)},
+ Test{complex(0, 0), complex(-nan, inf), complex(0, negzero)},
+ Test{complex(0, 0), complex(-nan, -inf), complex(negzero, 0)},
+ Test{complex(0, 0), complex(-inf, 0), complex(negzero, negzero)},
+ Test{complex(0, 0), complex(-inf, 1), complex(negzero, negzero)},
+ Test{complex(0, 0), complex(-inf, -1), complex(negzero, negzero)},
+ Test{complex(0, 0), complex(-inf, 2), complex(negzero, negzero)},
+ Test{complex(0, 0), complex(nan, nan), complex(nan, nan)},
+ Test{complex(0, 0), complex(-nan, inf), complex(0, negzero)},
+ Test{complex(0, 0), complex(-nan, -inf), complex(negzero, 0)},
+ Test{complex(0, 1), complex(0, 0), complex(-nan, inf)},
+ Test{complex(0, 1), complex(0, 1), complex(1, 0)},
+ Test{complex(0, 1), complex(0, -1), complex(-1, 0)},
+ Test{complex(0, 1), complex(0, 2), complex(0.5, 0)},
+ Test{complex(0, 1), complex(nan, nan), complex(nan, nan)},
+ Test{complex(0, 1), complex(-nan, inf), complex(0, negzero)},
+ Test{complex(0, 1), complex(-nan, -inf), complex(negzero, 0)},
+ Test{complex(0, 1), complex(1, 0), complex(0, 1)},
+ Test{complex(0, 1), complex(1, 1), complex(0.5, 0.5)},
+ Test{complex(0, 1), complex(1, -1), complex(-0.5, 0.5)},
+ Test{complex(0, 1), complex(1, 2), complex(0.4, 0.2)},
+ Test{complex(0, 1), complex(nan, nan), complex(nan, nan)},
+ Test{complex(0, 1), complex(-nan, inf), complex(0, negzero)},
+ Test{complex(0, 1), complex(-nan, -inf), complex(negzero, 0)},
+ Test{complex(0, 1), complex(-1, 0), complex(negzero, -1)},
+ Test{complex(0, 1), complex(-1, 1), complex(0.5, -0.5)},
+ Test{complex(0, 1), complex(-1, -1), complex(-0.5, -0.5)},
+ Test{complex(0, 1), complex(-1, 2), complex(0.4, -0.2)},
+ Test{complex(0, 1), complex(nan, nan), complex(nan, nan)},
+ Test{complex(0, 1), complex(-nan, inf), complex(0, negzero)},
+ Test{complex(0, 1), complex(-nan, -inf), complex(negzero, 0)},
+ Test{complex(0, 1), complex(2, 0), complex(0, 0.5)},
+ Test{complex(0, 1), complex(2, 1), complex(0.2, 0.4)},
+ Test{complex(0, 1), complex(2, -1), complex(-0.2, 0.4)},
+ Test{complex(0, 1), complex(2, 2), complex(0.25, 0.25)},
+ Test{complex(0, 1), complex(nan, nan), complex(nan, nan)},
+ Test{complex(0, 1), complex(-nan, inf), complex(0, negzero)},
+ Test{complex(0, 1), complex(-nan, -inf), complex(negzero, 0)},
+ Test{complex(0, 1), complex(nan, 0), complex(nan, nan)},
+ Test{complex(0, 1), complex(nan, 1), complex(nan, nan)},
+ Test{complex(0, 1), complex(nan, -1), complex(nan, nan)},
+ Test{complex(0, 1), complex(nan, 2), complex(nan, nan)},
+ Test{complex(0, 1), complex(nan, nan), complex(nan, nan)},
+ Test{complex(0, 1), complex(-nan, inf), complex(0, negzero)},
+ Test{complex(0, 1), complex(-nan, -inf), complex(negzero, 0)},
+ Test{complex(0, 1), complex(inf, 0), complex(0, 0)},
+ Test{complex(0, 1), complex(inf, 1), complex(0, 0)},
+ Test{complex(0, 1), complex(inf, -1), complex(0, 0)},
+ Test{complex(0, 1), complex(inf, 2), complex(0, 0)},
+ Test{complex(0, 1), complex(nan, nan), complex(nan, nan)},
+ Test{complex(0, 1), complex(-nan, inf), complex(0, negzero)},
+ Test{complex(0, 1), complex(-nan, -inf), complex(negzero, 0)},
+ Test{complex(0, 1), complex(-inf, 0), complex(negzero, negzero)},
+ Test{complex(0, 1), complex(-inf, 1), complex(negzero, negzero)},
+ Test{complex(0, 1), complex(-inf, -1), complex(negzero, negzero)},
+ Test{complex(0, 1), complex(-inf, 2), complex(negzero, negzero)},
+ Test{complex(0, 1), complex(nan, nan), complex(nan, nan)},
+ Test{complex(0, 1), complex(-nan, inf), complex(0, negzero)},
+ Test{complex(0, 1), complex(-nan, -inf), complex(negzero, 0)},
+ Test{complex(0, -1), complex(0, 0), complex(-nan, -inf)},
+ Test{complex(0, -1), complex(0, 1), complex(-1, negzero)},
+ Test{complex(0, -1), complex(0, -1), complex(1, negzero)},
+ Test{complex(0, -1), complex(0, 2), complex(-0.5, negzero)},
+ Test{complex(0, -1), complex(nan, nan), complex(nan, nan)},
+ Test{complex(0, -1), complex(-nan, inf), complex(negzero, 0)},
+ Test{complex(0, -1), complex(-nan, -inf), complex(0, 0)},
+ Test{complex(0, -1), complex(1, 0), complex(0, -1)},
+ Test{complex(0, -1), complex(1, 1), complex(-0.5, -0.5)},
+ Test{complex(0, -1), complex(1, -1), complex(0.5, -0.5)},
+ Test{complex(0, -1), complex(1, 2), complex(-0.4, -0.2)},
+ Test{complex(0, -1), complex(nan, nan), complex(nan, nan)},
+ Test{complex(0, -1), complex(-nan, inf), complex(negzero, 0)},
+ Test{complex(0, -1), complex(-nan, -inf), complex(0, 0)},
+ Test{complex(0, -1), complex(-1, 0), complex(negzero, 1)},
+ Test{complex(0, -1), complex(-1, 1), complex(-0.5, 0.5)},
+ Test{complex(0, -1), complex(-1, -1), complex(0.5, 0.5)},
+ Test{complex(0, -1), complex(-1, 2), complex(-0.4, 0.2)},
+ Test{complex(0, -1), complex(nan, nan), complex(nan, nan)},
+ Test{complex(0, -1), complex(-nan, inf), complex(negzero, 0)},
+ Test{complex(0, -1), complex(-nan, -inf), complex(0, 0)},
+ Test{complex(0, -1), complex(2, 0), complex(0, -0.5)},
+ Test{complex(0, -1), complex(2, 1), complex(-0.2, -0.4)},
+ Test{complex(0, -1), complex(2, -1), complex(0.2, -0.4)},
+ Test{complex(0, -1), complex(2, 2), complex(-0.25, -0.25)},
+ Test{complex(0, -1), complex(nan, nan), complex(nan, nan)},
+ Test{complex(0, -1), complex(-nan, inf), complex(negzero, 0)},
+ Test{complex(0, -1), complex(-nan, -inf), complex(0, 0)},
+ Test{complex(0, -1), complex(nan, 0), complex(nan, nan)},
+ Test{complex(0, -1), complex(nan, 1), complex(nan, nan)},
+ Test{complex(0, -1), complex(nan, -1), complex(nan, nan)},
+ Test{complex(0, -1), complex(nan, 2), complex(nan, nan)},
+ Test{complex(0, -1), complex(nan, nan), complex(nan, nan)},
+ Test{complex(0, -1), complex(-nan, inf), complex(negzero, 0)},
+ Test{complex(0, -1), complex(-nan, -inf), complex(0, 0)},
+ Test{complex(0, -1), complex(inf, 0), complex(0, negzero)},
+ Test{complex(0, -1), complex(inf, 1), complex(0, negzero)},
+ Test{complex(0, -1), complex(inf, -1), complex(0, negzero)},
+ Test{complex(0, -1), complex(inf, 2), complex(0, negzero)},
+ Test{complex(0, -1), complex(nan, nan), complex(nan, nan)},
+ Test{complex(0, -1), complex(-nan, inf), complex(negzero, 0)},
+ Test{complex(0, -1), complex(-nan, -inf), complex(0, 0)},
+ Test{complex(0, -1), complex(-inf, 0), complex(negzero, 0)},
+ Test{complex(0, -1), complex(-inf, 1), complex(negzero, 0)},
+ Test{complex(0, -1), complex(-inf, -1), complex(negzero, 0)},
+ Test{complex(0, -1), complex(-inf, 2), complex(negzero, 0)},
+ Test{complex(0, -1), complex(nan, nan), complex(nan, nan)},
+ Test{complex(0, -1), complex(-nan, inf), complex(negzero, 0)},
+ Test{complex(0, -1), complex(-nan, -inf), complex(0, 0)},
+ Test{complex(0, 2), complex(0, 0), complex(-nan, inf)},
+ Test{complex(0, 2), complex(0, 1), complex(2, 0)},
+ Test{complex(0, 2), complex(0, -1), complex(-2, 0)},
+ Test{complex(0, 2), complex(0, 2), complex(1, 0)},
+ Test{complex(0, 2), complex(nan, nan), complex(nan, nan)},
+ Test{complex(0, 2), complex(-nan, inf), complex(0, negzero)},
+ Test{complex(0, 2), complex(-nan, -inf), complex(negzero, 0)},
+ Test{complex(0, 2), complex(1, 0), complex(0, 2)},
+ Test{complex(0, 2), complex(1, 1), complex(1, 1)},
+ Test{complex(0, 2), complex(1, -1), complex(-1, 1)},
+ Test{complex(0, 2), complex(1, 2), complex(0.8, 0.4)},
+ Test{complex(0, 2), complex(nan, nan), complex(nan, nan)},
+ Test{complex(0, 2), complex(-nan, inf), complex(0, negzero)},
+ Test{complex(0, 2), complex(-nan, -inf), complex(negzero, 0)},
+ Test{complex(0, 2), complex(-1, 0), complex(negzero, -2)},
+ Test{complex(0, 2), complex(-1, 1), complex(1, -1)},
+ Test{complex(0, 2), complex(-1, -1), complex(-1, -1)},
+ Test{complex(0, 2), complex(-1, 2), complex(0.8, -0.4)},
+ Test{complex(0, 2), complex(nan, nan), complex(nan, nan)},
+ Test{complex(0, 2), complex(-nan, inf), complex(0, negzero)},
+ Test{complex(0, 2), complex(-nan, -inf), complex(negzero, 0)},
+ Test{complex(0, 2), complex(2, 0), complex(0, 1)},
+ Test{complex(0, 2), complex(2, 1), complex(0.4, 0.8)},
+ Test{complex(0, 2), complex(2, -1), complex(-0.4, 0.8)},
+ Test{complex(0, 2), complex(2, 2), complex(0.5, 0.5)},
+ Test{complex(0, 2), complex(nan, nan), complex(nan, nan)},
+ Test{complex(0, 2), complex(-nan, inf), complex(0, negzero)},
+ Test{complex(0, 2), complex(-nan, -inf), complex(negzero, 0)},
+ Test{complex(0, 2), complex(nan, 0), complex(nan, nan)},
+ Test{complex(0, 2), complex(nan, 1), complex(nan, nan)},
+ Test{complex(0, 2), complex(nan, -1), complex(nan, nan)},
+ Test{complex(0, 2), complex(nan, 2), complex(nan, nan)},
+ Test{complex(0, 2), complex(nan, nan), complex(nan, nan)},
+ Test{complex(0, 2), complex(-nan, inf), complex(0, negzero)},
+ Test{complex(0, 2), complex(-nan, -inf), complex(negzero, 0)},
+ Test{complex(0, 2), complex(inf, 0), complex(0, 0)},
+ Test{complex(0, 2), complex(inf, 1), complex(0, 0)},
+ Test{complex(0, 2), complex(inf, -1), complex(0, 0)},
+ Test{complex(0, 2), complex(inf, 2), complex(0, 0)},
+ Test{complex(0, 2), complex(nan, nan), complex(nan, nan)},
+ Test{complex(0, 2), complex(-nan, inf), complex(0, negzero)},
+ Test{complex(0, 2), complex(-nan, -inf), complex(negzero, 0)},
+ Test{complex(0, 2), complex(-inf, 0), complex(negzero, negzero)},
+ Test{complex(0, 2), complex(-inf, 1), complex(negzero, negzero)},
+ Test{complex(0, 2), complex(-inf, -1), complex(negzero, negzero)},
+ Test{complex(0, 2), complex(-inf, 2), complex(negzero, negzero)},
+ Test{complex(0, 2), complex(nan, nan), complex(nan, nan)},
+ Test{complex(0, 2), complex(-nan, inf), complex(0, negzero)},
+ Test{complex(0, 2), complex(-nan, -inf), complex(negzero, 0)},
+ Test{complex(nan, nan), complex(0, 0), complex(nan, nan)},
+ Test{complex(nan, nan), complex(0, 1), complex(nan, nan)},
+ Test{complex(nan, nan), complex(0, -1), complex(nan, nan)},
+ Test{complex(nan, nan), complex(0, 2), complex(nan, nan)},
+ Test{complex(nan, nan), complex(nan, nan), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-nan, inf), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-nan, -inf), complex(nan, nan)},
+ Test{complex(nan, nan), complex(1, 0), complex(nan, nan)},
+ Test{complex(nan, nan), complex(1, 1), complex(nan, nan)},
+ Test{complex(nan, nan), complex(1, -1), complex(nan, nan)},
+ Test{complex(nan, nan), complex(1, 2), complex(nan, nan)},
+ Test{complex(nan, nan), complex(nan, nan), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-nan, inf), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-nan, -inf), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-1, 0), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-1, 1), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-1, -1), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-1, 2), complex(nan, nan)},
+ Test{complex(nan, nan), complex(nan, nan), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-nan, inf), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-nan, -inf), complex(nan, nan)},
+ Test{complex(nan, nan), complex(2, 0), complex(nan, nan)},
+ Test{complex(nan, nan), complex(2, 1), complex(nan, nan)},
+ Test{complex(nan, nan), complex(2, -1), complex(nan, nan)},
+ Test{complex(nan, nan), complex(2, 2), complex(nan, nan)},
+ Test{complex(nan, nan), complex(nan, nan), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-nan, inf), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-nan, -inf), complex(nan, nan)},
+ Test{complex(nan, nan), complex(nan, 0), complex(nan, nan)},
+ Test{complex(nan, nan), complex(nan, 1), complex(nan, nan)},
+ Test{complex(nan, nan), complex(nan, -1), complex(nan, nan)},
+ Test{complex(nan, nan), complex(nan, 2), complex(nan, nan)},
+ Test{complex(nan, nan), complex(nan, nan), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-nan, inf), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-nan, -inf), complex(nan, nan)},
+ Test{complex(nan, nan), complex(inf, 0), complex(nan, nan)},
+ Test{complex(nan, nan), complex(inf, 1), complex(nan, nan)},
+ Test{complex(nan, nan), complex(inf, -1), complex(nan, nan)},
+ Test{complex(nan, nan), complex(inf, 2), complex(nan, nan)},
+ Test{complex(nan, nan), complex(nan, nan), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-nan, inf), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-nan, -inf), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-inf, 0), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-inf, 1), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-inf, -1), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-inf, 2), complex(nan, nan)},
+ Test{complex(nan, nan), complex(nan, nan), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-nan, inf), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-nan, -inf), complex(nan, nan)},
+ Test{complex(-nan, inf), complex(0, 0), complex(-nan, inf)},
+ Test{complex(-nan, inf), complex(0, 1), complex(inf, -nan)},
+ Test{complex(-nan, inf), complex(0, -1), complex(-inf, -nan)},
+ Test{complex(-nan, inf), complex(0, 2), complex(inf, -nan)},
+ Test{complex(-nan, inf), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-nan, inf), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(1, 0), complex(-nan, inf)},
+ Test{complex(-nan, inf), complex(1, 1), complex(inf, inf)},
+ Test{complex(-nan, inf), complex(1, -1), complex(-inf, inf)},
+ Test{complex(-nan, inf), complex(1, 2), complex(inf, inf)},
+ Test{complex(-nan, inf), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-nan, inf), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(-1, 0), complex(-nan, -inf)},
+ Test{complex(-nan, inf), complex(-1, 1), complex(inf, -inf)},
+ Test{complex(-nan, inf), complex(-1, -1), complex(-inf, -inf)},
+ Test{complex(-nan, inf), complex(-1, 2), complex(inf, -inf)},
+ Test{complex(-nan, inf), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-nan, inf), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(2, 0), complex(-nan, inf)},
+ Test{complex(-nan, inf), complex(2, 1), complex(inf, inf)},
+ Test{complex(-nan, inf), complex(2, -1), complex(-inf, inf)},
+ Test{complex(-nan, inf), complex(2, 2), complex(inf, inf)},
+ Test{complex(-nan, inf), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-nan, inf), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(nan, 0), complex(nan, nan)},
+ Test{complex(-nan, inf), complex(nan, 1), complex(nan, nan)},
+ Test{complex(-nan, inf), complex(nan, -1), complex(nan, nan)},
+ Test{complex(-nan, inf), complex(nan, 2), complex(nan, nan)},
+ Test{complex(-nan, inf), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-nan, inf), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(inf, 0), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(inf, 1), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(inf, -1), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(inf, 2), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-nan, inf), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(-inf, 0), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(-inf, 1), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(-inf, -1), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(-inf, 2), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-nan, inf), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(0, 0), complex(-nan, -inf)},
+ Test{complex(-nan, -inf), complex(0, 1), complex(-inf, -nan)},
+ Test{complex(-nan, -inf), complex(0, -1), complex(inf, -nan)},
+ Test{complex(-nan, -inf), complex(0, 2), complex(-inf, -nan)},
+ Test{complex(-nan, -inf), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-nan, -inf), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(1, 0), complex(-nan, -inf)},
+ Test{complex(-nan, -inf), complex(1, 1), complex(-inf, -inf)},
+ Test{complex(-nan, -inf), complex(1, -1), complex(inf, -inf)},
+ Test{complex(-nan, -inf), complex(1, 2), complex(-inf, -inf)},
+ Test{complex(-nan, -inf), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-nan, -inf), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(-1, 0), complex(-nan, inf)},
+ Test{complex(-nan, -inf), complex(-1, 1), complex(-inf, inf)},
+ Test{complex(-nan, -inf), complex(-1, -1), complex(inf, inf)},
+ Test{complex(-nan, -inf), complex(-1, 2), complex(-inf, inf)},
+ Test{complex(-nan, -inf), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-nan, -inf), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(2, 0), complex(-nan, -inf)},
+ Test{complex(-nan, -inf), complex(2, 1), complex(-inf, -inf)},
+ Test{complex(-nan, -inf), complex(2, -1), complex(inf, -inf)},
+ Test{complex(-nan, -inf), complex(2, 2), complex(-inf, -inf)},
+ Test{complex(-nan, -inf), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-nan, -inf), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(nan, 0), complex(nan, nan)},
+ Test{complex(-nan, -inf), complex(nan, 1), complex(nan, nan)},
+ Test{complex(-nan, -inf), complex(nan, -1), complex(nan, nan)},
+ Test{complex(-nan, -inf), complex(nan, 2), complex(nan, nan)},
+ Test{complex(-nan, -inf), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-nan, -inf), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(inf, 0), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(inf, 1), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(inf, -1), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(inf, 2), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-nan, -inf), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(-inf, 0), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(-inf, 1), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(-inf, -1), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(-inf, 2), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-nan, -inf), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(1, 0), complex(0, 0), complex(inf, -nan)},
+ Test{complex(1, 0), complex(0, 1), complex(0, -1)},
+ Test{complex(1, 0), complex(0, -1), complex(negzero, 1)},
+ Test{complex(1, 0), complex(0, 2), complex(0, -0.5)},
+ Test{complex(1, 0), complex(nan, nan), complex(nan, nan)},
+ Test{complex(1, 0), complex(-nan, inf), complex(0, negzero)},
+ Test{complex(1, 0), complex(-nan, -inf), complex(negzero, 0)},
+ Test{complex(1, 0), complex(1, 0), complex(1, 0)},
+ Test{complex(1, 0), complex(1, 1), complex(0.5, -0.5)},
+ Test{complex(1, 0), complex(1, -1), complex(0.5, 0.5)},
+ Test{complex(1, 0), complex(1, 2), complex(0.2, -0.4)},
+ Test{complex(1, 0), complex(nan, nan), complex(nan, nan)},
+ Test{complex(1, 0), complex(-nan, inf), complex(0, negzero)},
+ Test{complex(1, 0), complex(-nan, -inf), complex(negzero, 0)},
+ Test{complex(1, 0), complex(-1, 0), complex(-1, negzero)},
+ Test{complex(1, 0), complex(-1, 1), complex(-0.5, -0.5)},
+ Test{complex(1, 0), complex(-1, -1), complex(-0.5, 0.5)},
+ Test{complex(1, 0), complex(-1, 2), complex(-0.2, -0.4)},
+ Test{complex(1, 0), complex(nan, nan), complex(nan, nan)},
+ Test{complex(1, 0), complex(-nan, inf), complex(0, negzero)},
+ Test{complex(1, 0), complex(-nan, -inf), complex(negzero, 0)},
+ Test{complex(1, 0), complex(2, 0), complex(0.5, 0)},
+ Test{complex(1, 0), complex(2, 1), complex(0.4, -0.2)},
+ Test{complex(1, 0), complex(2, -1), complex(0.4, 0.2)},
+ Test{complex(1, 0), complex(2, 2), complex(0.25, -0.25)},
+ Test{complex(1, 0), complex(nan, nan), complex(nan, nan)},
+ Test{complex(1, 0), complex(-nan, inf), complex(0, negzero)},
+ Test{complex(1, 0), complex(-nan, -inf), complex(negzero, 0)},
+ Test{complex(1, 0), complex(nan, 0), complex(nan, nan)},
+ Test{complex(1, 0), complex(nan, 1), complex(nan, nan)},
+ Test{complex(1, 0), complex(nan, -1), complex(nan, nan)},
+ Test{complex(1, 0), complex(nan, 2), complex(nan, nan)},
+ Test{complex(1, 0), complex(nan, nan), complex(nan, nan)},
+ Test{complex(1, 0), complex(-nan, inf), complex(0, negzero)},
+ Test{complex(1, 0), complex(-nan, -inf), complex(negzero, 0)},
+ Test{complex(1, 0), complex(inf, 0), complex(0, 0)},
+ Test{complex(1, 0), complex(inf, 1), complex(0, 0)},
+ Test{complex(1, 0), complex(inf, -1), complex(0, 0)},
+ Test{complex(1, 0), complex(inf, 2), complex(0, 0)},
+ Test{complex(1, 0), complex(nan, nan), complex(nan, nan)},
+ Test{complex(1, 0), complex(-nan, inf), complex(0, negzero)},
+ Test{complex(1, 0), complex(-nan, -inf), complex(negzero, 0)},
+ Test{complex(1, 0), complex(-inf, 0), complex(negzero, negzero)},
+ Test{complex(1, 0), complex(-inf, 1), complex(negzero, negzero)},
+ Test{complex(1, 0), complex(-inf, -1), complex(negzero, negzero)},
+ Test{complex(1, 0), complex(-inf, 2), complex(negzero, negzero)},
+ Test{complex(1, 0), complex(nan, nan), complex(nan, nan)},
+ Test{complex(1, 0), complex(-nan, inf), complex(0, negzero)},
+ Test{complex(1, 0), complex(-nan, -inf), complex(negzero, 0)},
+ Test{complex(1, 1), complex(0, 0), complex(inf, inf)},
+ Test{complex(1, 1), complex(0, 1), complex(1, -1)},
+ Test{complex(1, 1), complex(0, -1), complex(-1, 1)},
+ Test{complex(1, 1), complex(0, 2), complex(0.5, -0.5)},
+ Test{complex(1, 1), complex(nan, nan), complex(nan, nan)},
+ Test{complex(1, 1), complex(-nan, inf), complex(0, negzero)},
+ Test{complex(1, 1), complex(-nan, -inf), complex(negzero, 0)},
+ Test{complex(1, 1), complex(1, 0), complex(1, 1)},
+ Test{complex(1, 1), complex(1, 1), complex(1, 0)},
+ Test{complex(1, 1), complex(1, -1), complex(0, 1)},
+ Test{complex(1, 1), complex(1, 2), complex(0.6, -0.2)},
+ Test{complex(1, 1), complex(nan, nan), complex(nan, nan)},
+ Test{complex(1, 1), complex(-nan, inf), complex(0, negzero)},
+ Test{complex(1, 1), complex(-nan, -inf), complex(negzero, 0)},
+ Test{complex(1, 1), complex(-1, 0), complex(-1, -1)},
+ Test{complex(1, 1), complex(-1, 1), complex(negzero, -1)},
+ Test{complex(1, 1), complex(-1, -1), complex(-1, negzero)},
+ Test{complex(1, 1), complex(-1, 2), complex(0.2, -0.6)},
+ Test{complex(1, 1), complex(nan, nan), complex(nan, nan)},
+ Test{complex(1, 1), complex(-nan, inf), complex(0, negzero)},
+ Test{complex(1, 1), complex(-nan, -inf), complex(negzero, 0)},
+ Test{complex(1, 1), complex(2, 0), complex(0.5, 0.5)},
+ Test{complex(1, 1), complex(2, 1), complex(0.6, 0.2)},
+ Test{complex(1, 1), complex(2, -1), complex(0.2, 0.6)},
+ Test{complex(1, 1), complex(2, 2), complex(0.5, 0)},
+ Test{complex(1, 1), complex(nan, nan), complex(nan, nan)},
+ Test{complex(1, 1), complex(-nan, inf), complex(0, negzero)},
+ Test{complex(1, 1), complex(-nan, -inf), complex(negzero, 0)},
+ Test{complex(1, 1), complex(nan, 0), complex(nan, nan)},
+ Test{complex(1, 1), complex(nan, 1), complex(nan, nan)},
+ Test{complex(1, 1), complex(nan, -1), complex(nan, nan)},
+ Test{complex(1, 1), complex(nan, 2), complex(nan, nan)},
+ Test{complex(1, 1), complex(nan, nan), complex(nan, nan)},
+ Test{complex(1, 1), complex(-nan, inf), complex(0, negzero)},
+ Test{complex(1, 1), complex(-nan, -inf), complex(negzero, 0)},
+ Test{complex(1, 1), complex(inf, 0), complex(0, 0)},
+ Test{complex(1, 1), complex(inf, 1), complex(0, 0)},
+ Test{complex(1, 1), complex(inf, -1), complex(0, 0)},
+ Test{complex(1, 1), complex(inf, 2), complex(0, 0)},
+ Test{complex(1, 1), complex(nan, nan), complex(nan, nan)},
+ Test{complex(1, 1), complex(-nan, inf), complex(0, negzero)},
+ Test{complex(1, 1), complex(-nan, -inf), complex(negzero, 0)},
+ Test{complex(1, 1), complex(-inf, 0), complex(negzero, negzero)},
+ Test{complex(1, 1), complex(-inf, 1), complex(negzero, negzero)},
+ Test{complex(1, 1), complex(-inf, -1), complex(negzero, negzero)},
+ Test{complex(1, 1), complex(-inf, 2), complex(negzero, negzero)},
+ Test{complex(1, 1), complex(nan, nan), complex(nan, nan)},
+ Test{complex(1, 1), complex(-nan, inf), complex(0, negzero)},
+ Test{complex(1, 1), complex(-nan, -inf), complex(negzero, 0)},
+ Test{complex(1, -1), complex(0, 0), complex(inf, -inf)},
+ Test{complex(1, -1), complex(0, 1), complex(-1, -1)},
+ Test{complex(1, -1), complex(0, -1), complex(1, 1)},
+ Test{complex(1, -1), complex(0, 2), complex(-0.5, -0.5)},
+ Test{complex(1, -1), complex(nan, nan), complex(nan, nan)},
+ Test{complex(1, -1), complex(-nan, inf), complex(negzero, negzero)},
+ Test{complex(1, -1), complex(-nan, -inf), complex(0, 0)},
+ Test{complex(1, -1), complex(1, 0), complex(1, -1)},
+ Test{complex(1, -1), complex(1, 1), complex(0, -1)},
+ Test{complex(1, -1), complex(1, -1), complex(1, 0)},
+ Test{complex(1, -1), complex(1, 2), complex(-0.2, -0.6)},
+ Test{complex(1, -1), complex(nan, nan), complex(nan, nan)},
+ Test{complex(1, -1), complex(-nan, inf), complex(negzero, negzero)},
+ Test{complex(1, -1), complex(-nan, -inf), complex(0, 0)},
+ Test{complex(1, -1), complex(-1, 0), complex(-1, 1)},
+ Test{complex(1, -1), complex(-1, 1), complex(-1, negzero)},
+ Test{complex(1, -1), complex(-1, -1), complex(negzero, 1)},
+ Test{complex(1, -1), complex(-1, 2), complex(-0.6, -0.2)},
+ Test{complex(1, -1), complex(nan, nan), complex(nan, nan)},
+ Test{complex(1, -1), complex(-nan, inf), complex(negzero, negzero)},
+ Test{complex(1, -1), complex(-nan, -inf), complex(0, 0)},
+ Test{complex(1, -1), complex(2, 0), complex(0.5, -0.5)},
+ Test{complex(1, -1), complex(2, 1), complex(0.2, -0.6)},
+ Test{complex(1, -1), complex(2, -1), complex(0.6, -0.2)},
+ Test{complex(1, -1), complex(2, 2), complex(0, -0.5)},
+ Test{complex(1, -1), complex(nan, nan), complex(nan, nan)},
+ Test{complex(1, -1), complex(-nan, inf), complex(negzero, negzero)},
+ Test{complex(1, -1), complex(-nan, -inf), complex(0, 0)},
+ Test{complex(1, -1), complex(nan, 0), complex(nan, nan)},
+ Test{complex(1, -1), complex(nan, 1), complex(nan, nan)},
+ Test{complex(1, -1), complex(nan, -1), complex(nan, nan)},
+ Test{complex(1, -1), complex(nan, 2), complex(nan, nan)},
+ Test{complex(1, -1), complex(nan, nan), complex(nan, nan)},
+ Test{complex(1, -1), complex(-nan, inf), complex(negzero, negzero)},
+ Test{complex(1, -1), complex(-nan, -inf), complex(0, 0)},
+ Test{complex(1, -1), complex(inf, 0), complex(0, negzero)},
+ Test{complex(1, -1), complex(inf, 1), complex(0, negzero)},
+ Test{complex(1, -1), complex(inf, -1), complex(0, negzero)},
+ Test{complex(1, -1), complex(inf, 2), complex(0, negzero)},
+ Test{complex(1, -1), complex(nan, nan), complex(nan, nan)},
+ Test{complex(1, -1), complex(-nan, inf), complex(negzero, negzero)},
+ Test{complex(1, -1), complex(-nan, -inf), complex(0, 0)},
+ Test{complex(1, -1), complex(-inf, 0), complex(negzero, 0)},
+ Test{complex(1, -1), complex(-inf, 1), complex(negzero, 0)},
+ Test{complex(1, -1), complex(-inf, -1), complex(negzero, 0)},
+ Test{complex(1, -1), complex(-inf, 2), complex(negzero, 0)},
+ Test{complex(1, -1), complex(nan, nan), complex(nan, nan)},
+ Test{complex(1, -1), complex(-nan, inf), complex(negzero, negzero)},
+ Test{complex(1, -1), complex(-nan, -inf), complex(0, 0)},
+ Test{complex(1, 2), complex(0, 0), complex(inf, inf)},
+ Test{complex(1, 2), complex(0, 1), complex(2, -1)},
+ Test{complex(1, 2), complex(0, -1), complex(-2, 1)},
+ Test{complex(1, 2), complex(0, 2), complex(1, -0.5)},
+ Test{complex(1, 2), complex(nan, nan), complex(nan, nan)},
+ Test{complex(1, 2), complex(-nan, inf), complex(0, negzero)},
+ Test{complex(1, 2), complex(-nan, -inf), complex(negzero, 0)},
+ Test{complex(1, 2), complex(1, 0), complex(1, 2)},
+ Test{complex(1, 2), complex(1, 1), complex(1.5, 0.5)},
+ Test{complex(1, 2), complex(1, -1), complex(-0.5, 1.5)},
+ Test{complex(1, 2), complex(1, 2), complex(1, 0)},
+ Test{complex(1, 2), complex(nan, nan), complex(nan, nan)},
+ Test{complex(1, 2), complex(-nan, inf), complex(0, negzero)},
+ Test{complex(1, 2), complex(-nan, -inf), complex(negzero, 0)},
+ Test{complex(1, 2), complex(-1, 0), complex(-1, -2)},
+ Test{complex(1, 2), complex(-1, 1), complex(0.5, -1.5)},
+ Test{complex(1, 2), complex(-1, -1), complex(-1.5, -0.5)},
+ Test{complex(1, 2), complex(-1, 2), complex(0.6, -0.8)},
+ Test{complex(1, 2), complex(nan, nan), complex(nan, nan)},
+ Test{complex(1, 2), complex(-nan, inf), complex(0, negzero)},
+ Test{complex(1, 2), complex(-nan, -inf), complex(negzero, 0)},
+ Test{complex(1, 2), complex(2, 0), complex(0.5, 1)},
+ Test{complex(1, 2), complex(2, 1), complex(0.8, 0.6)},
+ Test{complex(1, 2), complex(2, -1), complex(0, 1)},
+ Test{complex(1, 2), complex(2, 2), complex(0.75, 0.25)},
+ Test{complex(1, 2), complex(nan, nan), complex(nan, nan)},
+ Test{complex(1, 2), complex(-nan, inf), complex(0, negzero)},
+ Test{complex(1, 2), complex(-nan, -inf), complex(negzero, 0)},
+ Test{complex(1, 2), complex(nan, 0), complex(nan, nan)},
+ Test{complex(1, 2), complex(nan, 1), complex(nan, nan)},
+ Test{complex(1, 2), complex(nan, -1), complex(nan, nan)},
+ Test{complex(1, 2), complex(nan, 2), complex(nan, nan)},
+ Test{complex(1, 2), complex(nan, nan), complex(nan, nan)},
+ Test{complex(1, 2), complex(-nan, inf), complex(0, negzero)},
+ Test{complex(1, 2), complex(-nan, -inf), complex(negzero, 0)},
+ Test{complex(1, 2), complex(inf, 0), complex(0, 0)},
+ Test{complex(1, 2), complex(inf, 1), complex(0, 0)},
+ Test{complex(1, 2), complex(inf, -1), complex(0, 0)},
+ Test{complex(1, 2), complex(inf, 2), complex(0, 0)},
+ Test{complex(1, 2), complex(nan, nan), complex(nan, nan)},
+ Test{complex(1, 2), complex(-nan, inf), complex(0, negzero)},
+ Test{complex(1, 2), complex(-nan, -inf), complex(negzero, 0)},
+ Test{complex(1, 2), complex(-inf, 0), complex(negzero, negzero)},
+ Test{complex(1, 2), complex(-inf, 1), complex(negzero, negzero)},
+ Test{complex(1, 2), complex(-inf, -1), complex(negzero, negzero)},
+ Test{complex(1, 2), complex(-inf, 2), complex(negzero, negzero)},
+ Test{complex(1, 2), complex(nan, nan), complex(nan, nan)},
+ Test{complex(1, 2), complex(-nan, inf), complex(0, negzero)},
+ Test{complex(1, 2), complex(-nan, -inf), complex(negzero, 0)},
+ Test{complex(nan, nan), complex(0, 0), complex(nan, nan)},
+ Test{complex(nan, nan), complex(0, 1), complex(nan, nan)},
+ Test{complex(nan, nan), complex(0, -1), complex(nan, nan)},
+ Test{complex(nan, nan), complex(0, 2), complex(nan, nan)},
+ Test{complex(nan, nan), complex(nan, nan), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-nan, inf), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-nan, -inf), complex(nan, nan)},
+ Test{complex(nan, nan), complex(1, 0), complex(nan, nan)},
+ Test{complex(nan, nan), complex(1, 1), complex(nan, nan)},
+ Test{complex(nan, nan), complex(1, -1), complex(nan, nan)},
+ Test{complex(nan, nan), complex(1, 2), complex(nan, nan)},
+ Test{complex(nan, nan), complex(nan, nan), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-nan, inf), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-nan, -inf), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-1, 0), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-1, 1), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-1, -1), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-1, 2), complex(nan, nan)},
+ Test{complex(nan, nan), complex(nan, nan), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-nan, inf), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-nan, -inf), complex(nan, nan)},
+ Test{complex(nan, nan), complex(2, 0), complex(nan, nan)},
+ Test{complex(nan, nan), complex(2, 1), complex(nan, nan)},
+ Test{complex(nan, nan), complex(2, -1), complex(nan, nan)},
+ Test{complex(nan, nan), complex(2, 2), complex(nan, nan)},
+ Test{complex(nan, nan), complex(nan, nan), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-nan, inf), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-nan, -inf), complex(nan, nan)},
+ Test{complex(nan, nan), complex(nan, 0), complex(nan, nan)},
+ Test{complex(nan, nan), complex(nan, 1), complex(nan, nan)},
+ Test{complex(nan, nan), complex(nan, -1), complex(nan, nan)},
+ Test{complex(nan, nan), complex(nan, 2), complex(nan, nan)},
+ Test{complex(nan, nan), complex(nan, nan), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-nan, inf), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-nan, -inf), complex(nan, nan)},
+ Test{complex(nan, nan), complex(inf, 0), complex(nan, nan)},
+ Test{complex(nan, nan), complex(inf, 1), complex(nan, nan)},
+ Test{complex(nan, nan), complex(inf, -1), complex(nan, nan)},
+ Test{complex(nan, nan), complex(inf, 2), complex(nan, nan)},
+ Test{complex(nan, nan), complex(nan, nan), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-nan, inf), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-nan, -inf), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-inf, 0), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-inf, 1), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-inf, -1), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-inf, 2), complex(nan, nan)},
+ Test{complex(nan, nan), complex(nan, nan), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-nan, inf), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-nan, -inf), complex(nan, nan)},
+ Test{complex(-nan, inf), complex(0, 0), complex(-nan, inf)},
+ Test{complex(-nan, inf), complex(0, 1), complex(inf, -nan)},
+ Test{complex(-nan, inf), complex(0, -1), complex(-inf, -nan)},
+ Test{complex(-nan, inf), complex(0, 2), complex(inf, -nan)},
+ Test{complex(-nan, inf), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-nan, inf), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(1, 0), complex(-nan, inf)},
+ Test{complex(-nan, inf), complex(1, 1), complex(inf, inf)},
+ Test{complex(-nan, inf), complex(1, -1), complex(-inf, inf)},
+ Test{complex(-nan, inf), complex(1, 2), complex(inf, inf)},
+ Test{complex(-nan, inf), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-nan, inf), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(-1, 0), complex(-nan, -inf)},
+ Test{complex(-nan, inf), complex(-1, 1), complex(inf, -inf)},
+ Test{complex(-nan, inf), complex(-1, -1), complex(-inf, -inf)},
+ Test{complex(-nan, inf), complex(-1, 2), complex(inf, -inf)},
+ Test{complex(-nan, inf), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-nan, inf), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(2, 0), complex(-nan, inf)},
+ Test{complex(-nan, inf), complex(2, 1), complex(inf, inf)},
+ Test{complex(-nan, inf), complex(2, -1), complex(-inf, inf)},
+ Test{complex(-nan, inf), complex(2, 2), complex(inf, inf)},
+ Test{complex(-nan, inf), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-nan, inf), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(nan, 0), complex(nan, nan)},
+ Test{complex(-nan, inf), complex(nan, 1), complex(nan, nan)},
+ Test{complex(-nan, inf), complex(nan, -1), complex(nan, nan)},
+ Test{complex(-nan, inf), complex(nan, 2), complex(nan, nan)},
+ Test{complex(-nan, inf), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-nan, inf), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(inf, 0), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(inf, 1), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(inf, -1), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(inf, 2), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-nan, inf), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(-inf, 0), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(-inf, 1), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(-inf, -1), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(-inf, 2), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-nan, inf), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(0, 0), complex(-nan, -inf)},
+ Test{complex(-nan, -inf), complex(0, 1), complex(-inf, -nan)},
+ Test{complex(-nan, -inf), complex(0, -1), complex(inf, -nan)},
+ Test{complex(-nan, -inf), complex(0, 2), complex(-inf, -nan)},
+ Test{complex(-nan, -inf), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-nan, -inf), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(1, 0), complex(-nan, -inf)},
+ Test{complex(-nan, -inf), complex(1, 1), complex(-inf, -inf)},
+ Test{complex(-nan, -inf), complex(1, -1), complex(inf, -inf)},
+ Test{complex(-nan, -inf), complex(1, 2), complex(-inf, -inf)},
+ Test{complex(-nan, -inf), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-nan, -inf), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(-1, 0), complex(-nan, inf)},
+ Test{complex(-nan, -inf), complex(-1, 1), complex(-inf, inf)},
+ Test{complex(-nan, -inf), complex(-1, -1), complex(inf, inf)},
+ Test{complex(-nan, -inf), complex(-1, 2), complex(-inf, inf)},
+ Test{complex(-nan, -inf), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-nan, -inf), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(2, 0), complex(-nan, -inf)},
+ Test{complex(-nan, -inf), complex(2, 1), complex(-inf, -inf)},
+ Test{complex(-nan, -inf), complex(2, -1), complex(inf, -inf)},
+ Test{complex(-nan, -inf), complex(2, 2), complex(-inf, -inf)},
+ Test{complex(-nan, -inf), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-nan, -inf), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(nan, 0), complex(nan, nan)},
+ Test{complex(-nan, -inf), complex(nan, 1), complex(nan, nan)},
+ Test{complex(-nan, -inf), complex(nan, -1), complex(nan, nan)},
+ Test{complex(-nan, -inf), complex(nan, 2), complex(nan, nan)},
+ Test{complex(-nan, -inf), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-nan, -inf), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(inf, 0), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(inf, 1), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(inf, -1), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(inf, 2), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-nan, -inf), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(-inf, 0), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(-inf, 1), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(-inf, -1), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(-inf, 2), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-nan, -inf), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(-1, 0), complex(0, 0), complex(-inf, -nan)},
+ Test{complex(-1, 0), complex(0, 1), complex(0, 1)},
+ Test{complex(-1, 0), complex(0, -1), complex(negzero, -1)},
+ Test{complex(-1, 0), complex(0, 2), complex(0, 0.5)},
+ Test{complex(-1, 0), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-1, 0), complex(-nan, inf), complex(0, 0)},
+ Test{complex(-1, 0), complex(-nan, -inf), complex(0, negzero)},
+ Test{complex(-1, 0), complex(1, 0), complex(-1, 0)},
+ Test{complex(-1, 0), complex(1, 1), complex(-0.5, 0.5)},
+ Test{complex(-1, 0), complex(1, -1), complex(-0.5, -0.5)},
+ Test{complex(-1, 0), complex(1, 2), complex(-0.2, 0.4)},
+ Test{complex(-1, 0), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-1, 0), complex(-nan, inf), complex(0, 0)},
+ Test{complex(-1, 0), complex(-nan, -inf), complex(0, negzero)},
+ Test{complex(-1, 0), complex(-1, 0), complex(1, negzero)},
+ Test{complex(-1, 0), complex(-1, 1), complex(0.5, 0.5)},
+ Test{complex(-1, 0), complex(-1, -1), complex(0.5, -0.5)},
+ Test{complex(-1, 0), complex(-1, 2), complex(0.2, 0.4)},
+ Test{complex(-1, 0), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-1, 0), complex(-nan, inf), complex(0, 0)},
+ Test{complex(-1, 0), complex(-nan, -inf), complex(0, negzero)},
+ Test{complex(-1, 0), complex(2, 0), complex(-0.5, 0)},
+ Test{complex(-1, 0), complex(2, 1), complex(-0.4, 0.2)},
+ Test{complex(-1, 0), complex(2, -1), complex(-0.4, -0.2)},
+ Test{complex(-1, 0), complex(2, 2), complex(-0.25, 0.25)},
+ Test{complex(-1, 0), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-1, 0), complex(-nan, inf), complex(0, 0)},
+ Test{complex(-1, 0), complex(-nan, -inf), complex(0, negzero)},
+ Test{complex(-1, 0), complex(nan, 0), complex(nan, nan)},
+ Test{complex(-1, 0), complex(nan, 1), complex(nan, nan)},
+ Test{complex(-1, 0), complex(nan, -1), complex(nan, nan)},
+ Test{complex(-1, 0), complex(nan, 2), complex(nan, nan)},
+ Test{complex(-1, 0), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-1, 0), complex(-nan, inf), complex(0, 0)},
+ Test{complex(-1, 0), complex(-nan, -inf), complex(0, negzero)},
+ Test{complex(-1, 0), complex(inf, 0), complex(negzero, 0)},
+ Test{complex(-1, 0), complex(inf, 1), complex(negzero, 0)},
+ Test{complex(-1, 0), complex(inf, -1), complex(negzero, 0)},
+ Test{complex(-1, 0), complex(inf, 2), complex(negzero, 0)},
+ Test{complex(-1, 0), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-1, 0), complex(-nan, inf), complex(0, 0)},
+ Test{complex(-1, 0), complex(-nan, -inf), complex(0, negzero)},
+ Test{complex(-1, 0), complex(-inf, 0), complex(0, negzero)},
+ Test{complex(-1, 0), complex(-inf, 1), complex(0, negzero)},
+ Test{complex(-1, 0), complex(-inf, -1), complex(0, negzero)},
+ Test{complex(-1, 0), complex(-inf, 2), complex(0, negzero)},
+ Test{complex(-1, 0), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-1, 0), complex(-nan, inf), complex(0, 0)},
+ Test{complex(-1, 0), complex(-nan, -inf), complex(0, negzero)},
+ Test{complex(-1, 1), complex(0, 0), complex(-inf, inf)},
+ Test{complex(-1, 1), complex(0, 1), complex(1, 1)},
+ Test{complex(-1, 1), complex(0, -1), complex(-1, -1)},
+ Test{complex(-1, 1), complex(0, 2), complex(0.5, 0.5)},
+ Test{complex(-1, 1), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-1, 1), complex(-nan, inf), complex(0, 0)},
+ Test{complex(-1, 1), complex(-nan, -inf), complex(negzero, negzero)},
+ Test{complex(-1, 1), complex(1, 0), complex(-1, 1)},
+ Test{complex(-1, 1), complex(1, 1), complex(0, 1)},
+ Test{complex(-1, 1), complex(1, -1), complex(-1, 0)},
+ Test{complex(-1, 1), complex(1, 2), complex(0.2, 0.6)},
+ Test{complex(-1, 1), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-1, 1), complex(-nan, inf), complex(0, 0)},
+ Test{complex(-1, 1), complex(-nan, -inf), complex(negzero, negzero)},
+ Test{complex(-1, 1), complex(-1, 0), complex(1, -1)},
+ Test{complex(-1, 1), complex(-1, 1), complex(1, negzero)},
+ Test{complex(-1, 1), complex(-1, -1), complex(negzero, -1)},
+ Test{complex(-1, 1), complex(-1, 2), complex(0.6, 0.2)},
+ Test{complex(-1, 1), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-1, 1), complex(-nan, inf), complex(0, 0)},
+ Test{complex(-1, 1), complex(-nan, -inf), complex(negzero, negzero)},
+ Test{complex(-1, 1), complex(2, 0), complex(-0.5, 0.5)},
+ Test{complex(-1, 1), complex(2, 1), complex(-0.2, 0.6)},
+ Test{complex(-1, 1), complex(2, -1), complex(-0.6, 0.2)},
+ Test{complex(-1, 1), complex(2, 2), complex(0, 0.5)},
+ Test{complex(-1, 1), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-1, 1), complex(-nan, inf), complex(0, 0)},
+ Test{complex(-1, 1), complex(-nan, -inf), complex(negzero, negzero)},
+ Test{complex(-1, 1), complex(nan, 0), complex(nan, nan)},
+ Test{complex(-1, 1), complex(nan, 1), complex(nan, nan)},
+ Test{complex(-1, 1), complex(nan, -1), complex(nan, nan)},
+ Test{complex(-1, 1), complex(nan, 2), complex(nan, nan)},
+ Test{complex(-1, 1), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-1, 1), complex(-nan, inf), complex(0, 0)},
+ Test{complex(-1, 1), complex(-nan, -inf), complex(negzero, negzero)},
+ Test{complex(-1, 1), complex(inf, 0), complex(negzero, 0)},
+ Test{complex(-1, 1), complex(inf, 1), complex(negzero, 0)},
+ Test{complex(-1, 1), complex(inf, -1), complex(negzero, 0)},
+ Test{complex(-1, 1), complex(inf, 2), complex(negzero, 0)},
+ Test{complex(-1, 1), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-1, 1), complex(-nan, inf), complex(0, 0)},
+ Test{complex(-1, 1), complex(-nan, -inf), complex(negzero, negzero)},
+ Test{complex(-1, 1), complex(-inf, 0), complex(0, negzero)},
+ Test{complex(-1, 1), complex(-inf, 1), complex(0, negzero)},
+ Test{complex(-1, 1), complex(-inf, -1), complex(0, negzero)},
+ Test{complex(-1, 1), complex(-inf, 2), complex(0, negzero)},
+ Test{complex(-1, 1), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-1, 1), complex(-nan, inf), complex(0, 0)},
+ Test{complex(-1, 1), complex(-nan, -inf), complex(negzero, negzero)},
+ Test{complex(-1, -1), complex(0, 0), complex(-inf, -inf)},
+ Test{complex(-1, -1), complex(0, 1), complex(-1, 1)},
+ Test{complex(-1, -1), complex(0, -1), complex(1, -1)},
+ Test{complex(-1, -1), complex(0, 2), complex(-0.5, 0.5)},
+ Test{complex(-1, -1), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-1, -1), complex(-nan, inf), complex(negzero, 0)},
+ Test{complex(-1, -1), complex(-nan, -inf), complex(0, negzero)},
+ Test{complex(-1, -1), complex(1, 0), complex(-1, -1)},
+ Test{complex(-1, -1), complex(1, 1), complex(-1, 0)},
+ Test{complex(-1, -1), complex(1, -1), complex(0, -1)},
+ Test{complex(-1, -1), complex(1, 2), complex(-0.6, 0.2)},
+ Test{complex(-1, -1), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-1, -1), complex(-nan, inf), complex(negzero, 0)},
+ Test{complex(-1, -1), complex(-nan, -inf), complex(0, negzero)},
+ Test{complex(-1, -1), complex(-1, 0), complex(1, 1)},
+ Test{complex(-1, -1), complex(-1, 1), complex(negzero, 1)},
+ Test{complex(-1, -1), complex(-1, -1), complex(1, negzero)},
+ Test{complex(-1, -1), complex(-1, 2), complex(-0.2, 0.6)},
+ Test{complex(-1, -1), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-1, -1), complex(-nan, inf), complex(negzero, 0)},
+ Test{complex(-1, -1), complex(-nan, -inf), complex(0, negzero)},
+ Test{complex(-1, -1), complex(2, 0), complex(-0.5, -0.5)},
+ Test{complex(-1, -1), complex(2, 1), complex(-0.6, -0.2)},
+ Test{complex(-1, -1), complex(2, -1), complex(-0.2, -0.6)},
+ Test{complex(-1, -1), complex(2, 2), complex(-0.5, 0)},
+ Test{complex(-1, -1), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-1, -1), complex(-nan, inf), complex(negzero, 0)},
+ Test{complex(-1, -1), complex(-nan, -inf), complex(0, negzero)},
+ Test{complex(-1, -1), complex(nan, 0), complex(nan, nan)},
+ Test{complex(-1, -1), complex(nan, 1), complex(nan, nan)},
+ Test{complex(-1, -1), complex(nan, -1), complex(nan, nan)},
+ Test{complex(-1, -1), complex(nan, 2), complex(nan, nan)},
+ Test{complex(-1, -1), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-1, -1), complex(-nan, inf), complex(negzero, 0)},
+ Test{complex(-1, -1), complex(-nan, -inf), complex(0, negzero)},
+ Test{complex(-1, -1), complex(inf, 0), complex(negzero, negzero)},
+ Test{complex(-1, -1), complex(inf, 1), complex(negzero, negzero)},
+ Test{complex(-1, -1), complex(inf, -1), complex(negzero, negzero)},
+ Test{complex(-1, -1), complex(inf, 2), complex(negzero, negzero)},
+ Test{complex(-1, -1), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-1, -1), complex(-nan, inf), complex(negzero, 0)},
+ Test{complex(-1, -1), complex(-nan, -inf), complex(0, negzero)},
+ Test{complex(-1, -1), complex(-inf, 0), complex(0, 0)},
+ Test{complex(-1, -1), complex(-inf, 1), complex(0, 0)},
+ Test{complex(-1, -1), complex(-inf, -1), complex(0, 0)},
+ Test{complex(-1, -1), complex(-inf, 2), complex(0, 0)},
+ Test{complex(-1, -1), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-1, -1), complex(-nan, inf), complex(negzero, 0)},
+ Test{complex(-1, -1), complex(-nan, -inf), complex(0, negzero)},
+ Test{complex(-1, 2), complex(0, 0), complex(-inf, inf)},
+ Test{complex(-1, 2), complex(0, 1), complex(2, 1)},
+ Test{complex(-1, 2), complex(0, -1), complex(-2, -1)},
+ Test{complex(-1, 2), complex(0, 2), complex(1, 0.5)},
+ Test{complex(-1, 2), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-1, 2), complex(-nan, inf), complex(0, 0)},
+ Test{complex(-1, 2), complex(-nan, -inf), complex(negzero, negzero)},
+ Test{complex(-1, 2), complex(1, 0), complex(-1, 2)},
+ Test{complex(-1, 2), complex(1, 1), complex(0.5, 1.5)},
+ Test{complex(-1, 2), complex(1, -1), complex(-1.5, 0.5)},
+ Test{complex(-1, 2), complex(1, 2), complex(0.6, 0.8)},
+ Test{complex(-1, 2), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-1, 2), complex(-nan, inf), complex(0, 0)},
+ Test{complex(-1, 2), complex(-nan, -inf), complex(negzero, negzero)},
+ Test{complex(-1, 2), complex(-1, 0), complex(1, -2)},
+ Test{complex(-1, 2), complex(-1, 1), complex(1.5, -0.5)},
+ Test{complex(-1, 2), complex(-1, -1), complex(-0.5, -1.5)},
+ Test{complex(-1, 2), complex(-1, 2), complex(1, 0)},
+ Test{complex(-1, 2), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-1, 2), complex(-nan, inf), complex(0, 0)},
+ Test{complex(-1, 2), complex(-nan, -inf), complex(negzero, negzero)},
+ Test{complex(-1, 2), complex(2, 0), complex(-0.5, 1)},
+ Test{complex(-1, 2), complex(2, 1), complex(0, 1)},
+ Test{complex(-1, 2), complex(2, -1), complex(-0.8, 0.6)},
+ Test{complex(-1, 2), complex(2, 2), complex(0.25, 0.75)},
+ Test{complex(-1, 2), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-1, 2), complex(-nan, inf), complex(0, 0)},
+ Test{complex(-1, 2), complex(-nan, -inf), complex(negzero, negzero)},
+ Test{complex(-1, 2), complex(nan, 0), complex(nan, nan)},
+ Test{complex(-1, 2), complex(nan, 1), complex(nan, nan)},
+ Test{complex(-1, 2), complex(nan, -1), complex(nan, nan)},
+ Test{complex(-1, 2), complex(nan, 2), complex(nan, nan)},
+ Test{complex(-1, 2), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-1, 2), complex(-nan, inf), complex(0, 0)},
+ Test{complex(-1, 2), complex(-nan, -inf), complex(negzero, negzero)},
+ Test{complex(-1, 2), complex(inf, 0), complex(negzero, 0)},
+ Test{complex(-1, 2), complex(inf, 1), complex(negzero, 0)},
+ Test{complex(-1, 2), complex(inf, -1), complex(negzero, 0)},
+ Test{complex(-1, 2), complex(inf, 2), complex(negzero, 0)},
+ Test{complex(-1, 2), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-1, 2), complex(-nan, inf), complex(0, 0)},
+ Test{complex(-1, 2), complex(-nan, -inf), complex(negzero, negzero)},
+ Test{complex(-1, 2), complex(-inf, 0), complex(0, negzero)},
+ Test{complex(-1, 2), complex(-inf, 1), complex(0, negzero)},
+ Test{complex(-1, 2), complex(-inf, -1), complex(0, negzero)},
+ Test{complex(-1, 2), complex(-inf, 2), complex(0, negzero)},
+ Test{complex(-1, 2), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-1, 2), complex(-nan, inf), complex(0, 0)},
+ Test{complex(-1, 2), complex(-nan, -inf), complex(negzero, negzero)},
+ Test{complex(nan, nan), complex(0, 0), complex(nan, nan)},
+ Test{complex(nan, nan), complex(0, 1), complex(nan, nan)},
+ Test{complex(nan, nan), complex(0, -1), complex(nan, nan)},
+ Test{complex(nan, nan), complex(0, 2), complex(nan, nan)},
+ Test{complex(nan, nan), complex(nan, nan), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-nan, inf), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-nan, -inf), complex(nan, nan)},
+ Test{complex(nan, nan), complex(1, 0), complex(nan, nan)},
+ Test{complex(nan, nan), complex(1, 1), complex(nan, nan)},
+ Test{complex(nan, nan), complex(1, -1), complex(nan, nan)},
+ Test{complex(nan, nan), complex(1, 2), complex(nan, nan)},
+ Test{complex(nan, nan), complex(nan, nan), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-nan, inf), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-nan, -inf), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-1, 0), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-1, 1), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-1, -1), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-1, 2), complex(nan, nan)},
+ Test{complex(nan, nan), complex(nan, nan), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-nan, inf), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-nan, -inf), complex(nan, nan)},
+ Test{complex(nan, nan), complex(2, 0), complex(nan, nan)},
+ Test{complex(nan, nan), complex(2, 1), complex(nan, nan)},
+ Test{complex(nan, nan), complex(2, -1), complex(nan, nan)},
+ Test{complex(nan, nan), complex(2, 2), complex(nan, nan)},
+ Test{complex(nan, nan), complex(nan, nan), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-nan, inf), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-nan, -inf), complex(nan, nan)},
+ Test{complex(nan, nan), complex(nan, 0), complex(nan, nan)},
+ Test{complex(nan, nan), complex(nan, 1), complex(nan, nan)},
+ Test{complex(nan, nan), complex(nan, -1), complex(nan, nan)},
+ Test{complex(nan, nan), complex(nan, 2), complex(nan, nan)},
+ Test{complex(nan, nan), complex(nan, nan), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-nan, inf), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-nan, -inf), complex(nan, nan)},
+ Test{complex(nan, nan), complex(inf, 0), complex(nan, nan)},
+ Test{complex(nan, nan), complex(inf, 1), complex(nan, nan)},
+ Test{complex(nan, nan), complex(inf, -1), complex(nan, nan)},
+ Test{complex(nan, nan), complex(inf, 2), complex(nan, nan)},
+ Test{complex(nan, nan), complex(nan, nan), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-nan, inf), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-nan, -inf), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-inf, 0), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-inf, 1), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-inf, -1), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-inf, 2), complex(nan, nan)},
+ Test{complex(nan, nan), complex(nan, nan), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-nan, inf), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-nan, -inf), complex(nan, nan)},
+ Test{complex(-nan, inf), complex(0, 0), complex(-nan, inf)},
+ Test{complex(-nan, inf), complex(0, 1), complex(inf, -nan)},
+ Test{complex(-nan, inf), complex(0, -1), complex(-inf, -nan)},
+ Test{complex(-nan, inf), complex(0, 2), complex(inf, -nan)},
+ Test{complex(-nan, inf), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-nan, inf), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(1, 0), complex(-nan, inf)},
+ Test{complex(-nan, inf), complex(1, 1), complex(inf, inf)},
+ Test{complex(-nan, inf), complex(1, -1), complex(-inf, inf)},
+ Test{complex(-nan, inf), complex(1, 2), complex(inf, inf)},
+ Test{complex(-nan, inf), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-nan, inf), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(-1, 0), complex(-nan, -inf)},
+ Test{complex(-nan, inf), complex(-1, 1), complex(inf, -inf)},
+ Test{complex(-nan, inf), complex(-1, -1), complex(-inf, -inf)},
+ Test{complex(-nan, inf), complex(-1, 2), complex(inf, -inf)},
+ Test{complex(-nan, inf), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-nan, inf), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(2, 0), complex(-nan, inf)},
+ Test{complex(-nan, inf), complex(2, 1), complex(inf, inf)},
+ Test{complex(-nan, inf), complex(2, -1), complex(-inf, inf)},
+ Test{complex(-nan, inf), complex(2, 2), complex(inf, inf)},
+ Test{complex(-nan, inf), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-nan, inf), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(nan, 0), complex(nan, nan)},
+ Test{complex(-nan, inf), complex(nan, 1), complex(nan, nan)},
+ Test{complex(-nan, inf), complex(nan, -1), complex(nan, nan)},
+ Test{complex(-nan, inf), complex(nan, 2), complex(nan, nan)},
+ Test{complex(-nan, inf), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-nan, inf), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(inf, 0), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(inf, 1), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(inf, -1), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(inf, 2), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-nan, inf), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(-inf, 0), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(-inf, 1), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(-inf, -1), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(-inf, 2), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-nan, inf), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(0, 0), complex(-nan, -inf)},
+ Test{complex(-nan, -inf), complex(0, 1), complex(-inf, -nan)},
+ Test{complex(-nan, -inf), complex(0, -1), complex(inf, -nan)},
+ Test{complex(-nan, -inf), complex(0, 2), complex(-inf, -nan)},
+ Test{complex(-nan, -inf), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-nan, -inf), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(1, 0), complex(-nan, -inf)},
+ Test{complex(-nan, -inf), complex(1, 1), complex(-inf, -inf)},
+ Test{complex(-nan, -inf), complex(1, -1), complex(inf, -inf)},
+ Test{complex(-nan, -inf), complex(1, 2), complex(-inf, -inf)},
+ Test{complex(-nan, -inf), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-nan, -inf), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(-1, 0), complex(-nan, inf)},
+ Test{complex(-nan, -inf), complex(-1, 1), complex(-inf, inf)},
+ Test{complex(-nan, -inf), complex(-1, -1), complex(inf, inf)},
+ Test{complex(-nan, -inf), complex(-1, 2), complex(-inf, inf)},
+ Test{complex(-nan, -inf), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-nan, -inf), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(2, 0), complex(-nan, -inf)},
+ Test{complex(-nan, -inf), complex(2, 1), complex(-inf, -inf)},
+ Test{complex(-nan, -inf), complex(2, -1), complex(inf, -inf)},
+ Test{complex(-nan, -inf), complex(2, 2), complex(-inf, -inf)},
+ Test{complex(-nan, -inf), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-nan, -inf), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(nan, 0), complex(nan, nan)},
+ Test{complex(-nan, -inf), complex(nan, 1), complex(nan, nan)},
+ Test{complex(-nan, -inf), complex(nan, -1), complex(nan, nan)},
+ Test{complex(-nan, -inf), complex(nan, 2), complex(nan, nan)},
+ Test{complex(-nan, -inf), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-nan, -inf), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(inf, 0), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(inf, 1), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(inf, -1), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(inf, 2), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-nan, -inf), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(-inf, 0), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(-inf, 1), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(-inf, -1), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(-inf, 2), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-nan, -inf), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(2, 0), complex(0, 0), complex(inf, -nan)},
+ Test{complex(2, 0), complex(0, 1), complex(0, -2)},
+ Test{complex(2, 0), complex(0, -1), complex(negzero, 2)},
+ Test{complex(2, 0), complex(0, 2), complex(0, -1)},
+ Test{complex(2, 0), complex(nan, nan), complex(nan, nan)},
+ Test{complex(2, 0), complex(-nan, inf), complex(0, negzero)},
+ Test{complex(2, 0), complex(-nan, -inf), complex(negzero, 0)},
+ Test{complex(2, 0), complex(1, 0), complex(2, 0)},
+ Test{complex(2, 0), complex(1, 1), complex(1, -1)},
+ Test{complex(2, 0), complex(1, -1), complex(1, 1)},
+ Test{complex(2, 0), complex(1, 2), complex(0.4, -0.8)},
+ Test{complex(2, 0), complex(nan, nan), complex(nan, nan)},
+ Test{complex(2, 0), complex(-nan, inf), complex(0, negzero)},
+ Test{complex(2, 0), complex(-nan, -inf), complex(negzero, 0)},
+ Test{complex(2, 0), complex(-1, 0), complex(-2, negzero)},
+ Test{complex(2, 0), complex(-1, 1), complex(-1, -1)},
+ Test{complex(2, 0), complex(-1, -1), complex(-1, 1)},
+ Test{complex(2, 0), complex(-1, 2), complex(-0.4, -0.8)},
+ Test{complex(2, 0), complex(nan, nan), complex(nan, nan)},
+ Test{complex(2, 0), complex(-nan, inf), complex(0, negzero)},
+ Test{complex(2, 0), complex(-nan, -inf), complex(negzero, 0)},
+ Test{complex(2, 0), complex(2, 0), complex(1, 0)},
+ Test{complex(2, 0), complex(2, 1), complex(0.8, -0.4)},
+ Test{complex(2, 0), complex(2, -1), complex(0.8, 0.4)},
+ Test{complex(2, 0), complex(2, 2), complex(0.5, -0.5)},
+ Test{complex(2, 0), complex(nan, nan), complex(nan, nan)},
+ Test{complex(2, 0), complex(-nan, inf), complex(0, negzero)},
+ Test{complex(2, 0), complex(-nan, -inf), complex(negzero, 0)},
+ Test{complex(2, 0), complex(nan, 0), complex(nan, nan)},
+ Test{complex(2, 0), complex(nan, 1), complex(nan, nan)},
+ Test{complex(2, 0), complex(nan, -1), complex(nan, nan)},
+ Test{complex(2, 0), complex(nan, 2), complex(nan, nan)},
+ Test{complex(2, 0), complex(nan, nan), complex(nan, nan)},
+ Test{complex(2, 0), complex(-nan, inf), complex(0, negzero)},
+ Test{complex(2, 0), complex(-nan, -inf), complex(negzero, 0)},
+ Test{complex(2, 0), complex(inf, 0), complex(0, 0)},
+ Test{complex(2, 0), complex(inf, 1), complex(0, 0)},
+ Test{complex(2, 0), complex(inf, -1), complex(0, 0)},
+ Test{complex(2, 0), complex(inf, 2), complex(0, 0)},
+ Test{complex(2, 0), complex(nan, nan), complex(nan, nan)},
+ Test{complex(2, 0), complex(-nan, inf), complex(0, negzero)},
+ Test{complex(2, 0), complex(-nan, -inf), complex(negzero, 0)},
+ Test{complex(2, 0), complex(-inf, 0), complex(negzero, negzero)},
+ Test{complex(2, 0), complex(-inf, 1), complex(negzero, negzero)},
+ Test{complex(2, 0), complex(-inf, -1), complex(negzero, negzero)},
+ Test{complex(2, 0), complex(-inf, 2), complex(negzero, negzero)},
+ Test{complex(2, 0), complex(nan, nan), complex(nan, nan)},
+ Test{complex(2, 0), complex(-nan, inf), complex(0, negzero)},
+ Test{complex(2, 0), complex(-nan, -inf), complex(negzero, 0)},
+ Test{complex(2, 1), complex(0, 0), complex(inf, inf)},
+ Test{complex(2, 1), complex(0, 1), complex(1, -2)},
+ Test{complex(2, 1), complex(0, -1), complex(-1, 2)},
+ Test{complex(2, 1), complex(0, 2), complex(0.5, -1)},
+ Test{complex(2, 1), complex(nan, nan), complex(nan, nan)},
+ Test{complex(2, 1), complex(-nan, inf), complex(0, negzero)},
+ Test{complex(2, 1), complex(-nan, -inf), complex(negzero, 0)},
+ Test{complex(2, 1), complex(1, 0), complex(2, 1)},
+ Test{complex(2, 1), complex(1, 1), complex(1.5, -0.5)},
+ Test{complex(2, 1), complex(1, -1), complex(0.5, 1.5)},
+ Test{complex(2, 1), complex(1, 2), complex(0.8, -0.6)},
+ Test{complex(2, 1), complex(nan, nan), complex(nan, nan)},
+ Test{complex(2, 1), complex(-nan, inf), complex(0, negzero)},
+ Test{complex(2, 1), complex(-nan, -inf), complex(negzero, 0)},
+ Test{complex(2, 1), complex(-1, 0), complex(-2, -1)},
+ Test{complex(2, 1), complex(-1, 1), complex(-0.5, -1.5)},
+ Test{complex(2, 1), complex(-1, -1), complex(-1.5, 0.5)},
+ Test{complex(2, 1), complex(-1, 2), complex(0, -1)},
+ Test{complex(2, 1), complex(nan, nan), complex(nan, nan)},
+ Test{complex(2, 1), complex(-nan, inf), complex(0, negzero)},
+ Test{complex(2, 1), complex(-nan, -inf), complex(negzero, 0)},
+ Test{complex(2, 1), complex(2, 0), complex(1, 0.5)},
+ Test{complex(2, 1), complex(2, 1), complex(1, 0)},
+ Test{complex(2, 1), complex(2, -1), complex(0.6, 0.8)},
+ Test{complex(2, 1), complex(2, 2), complex(0.75, -0.25)},
+ Test{complex(2, 1), complex(nan, nan), complex(nan, nan)},
+ Test{complex(2, 1), complex(-nan, inf), complex(0, negzero)},
+ Test{complex(2, 1), complex(-nan, -inf), complex(negzero, 0)},
+ Test{complex(2, 1), complex(nan, 0), complex(nan, nan)},
+ Test{complex(2, 1), complex(nan, 1), complex(nan, nan)},
+ Test{complex(2, 1), complex(nan, -1), complex(nan, nan)},
+ Test{complex(2, 1), complex(nan, 2), complex(nan, nan)},
+ Test{complex(2, 1), complex(nan, nan), complex(nan, nan)},
+ Test{complex(2, 1), complex(-nan, inf), complex(0, negzero)},
+ Test{complex(2, 1), complex(-nan, -inf), complex(negzero, 0)},
+ Test{complex(2, 1), complex(inf, 0), complex(0, 0)},
+ Test{complex(2, 1), complex(inf, 1), complex(0, 0)},
+ Test{complex(2, 1), complex(inf, -1), complex(0, 0)},
+ Test{complex(2, 1), complex(inf, 2), complex(0, 0)},
+ Test{complex(2, 1), complex(nan, nan), complex(nan, nan)},
+ Test{complex(2, 1), complex(-nan, inf), complex(0, negzero)},
+ Test{complex(2, 1), complex(-nan, -inf), complex(negzero, 0)},
+ Test{complex(2, 1), complex(-inf, 0), complex(negzero, negzero)},
+ Test{complex(2, 1), complex(-inf, 1), complex(negzero, negzero)},
+ Test{complex(2, 1), complex(-inf, -1), complex(negzero, negzero)},
+ Test{complex(2, 1), complex(-inf, 2), complex(negzero, negzero)},
+ Test{complex(2, 1), complex(nan, nan), complex(nan, nan)},
+ Test{complex(2, 1), complex(-nan, inf), complex(0, negzero)},
+ Test{complex(2, 1), complex(-nan, -inf), complex(negzero, 0)},
+ Test{complex(2, -1), complex(0, 0), complex(inf, -inf)},
+ Test{complex(2, -1), complex(0, 1), complex(-1, -2)},
+ Test{complex(2, -1), complex(0, -1), complex(1, 2)},
+ Test{complex(2, -1), complex(0, 2), complex(-0.5, -1)},
+ Test{complex(2, -1), complex(nan, nan), complex(nan, nan)},
+ Test{complex(2, -1), complex(-nan, inf), complex(negzero, negzero)},
+ Test{complex(2, -1), complex(-nan, -inf), complex(0, 0)},
+ Test{complex(2, -1), complex(1, 0), complex(2, -1)},
+ Test{complex(2, -1), complex(1, 1), complex(0.5, -1.5)},
+ Test{complex(2, -1), complex(1, -1), complex(1.5, 0.5)},
+ Test{complex(2, -1), complex(1, 2), complex(0, -1)},
+ Test{complex(2, -1), complex(nan, nan), complex(nan, nan)},
+ Test{complex(2, -1), complex(-nan, inf), complex(negzero, negzero)},
+ Test{complex(2, -1), complex(-nan, -inf), complex(0, 0)},
+ Test{complex(2, -1), complex(-1, 0), complex(-2, 1)},
+ Test{complex(2, -1), complex(-1, 1), complex(-1.5, -0.5)},
+ Test{complex(2, -1), complex(-1, -1), complex(-0.5, 1.5)},
+ Test{complex(2, -1), complex(-1, 2), complex(-0.8, -0.6)},
+ Test{complex(2, -1), complex(nan, nan), complex(nan, nan)},
+ Test{complex(2, -1), complex(-nan, inf), complex(negzero, negzero)},
+ Test{complex(2, -1), complex(-nan, -inf), complex(0, 0)},
+ Test{complex(2, -1), complex(2, 0), complex(1, -0.5)},
+ Test{complex(2, -1), complex(2, 1), complex(0.6, -0.8)},
+ Test{complex(2, -1), complex(2, -1), complex(1, 0)},
+ Test{complex(2, -1), complex(2, 2), complex(0.25, -0.75)},
+ Test{complex(2, -1), complex(nan, nan), complex(nan, nan)},
+ Test{complex(2, -1), complex(-nan, inf), complex(negzero, negzero)},
+ Test{complex(2, -1), complex(-nan, -inf), complex(0, 0)},
+ Test{complex(2, -1), complex(nan, 0), complex(nan, nan)},
+ Test{complex(2, -1), complex(nan, 1), complex(nan, nan)},
+ Test{complex(2, -1), complex(nan, -1), complex(nan, nan)},
+ Test{complex(2, -1), complex(nan, 2), complex(nan, nan)},
+ Test{complex(2, -1), complex(nan, nan), complex(nan, nan)},
+ Test{complex(2, -1), complex(-nan, inf), complex(negzero, negzero)},
+ Test{complex(2, -1), complex(-nan, -inf), complex(0, 0)},
+ Test{complex(2, -1), complex(inf, 0), complex(0, negzero)},
+ Test{complex(2, -1), complex(inf, 1), complex(0, negzero)},
+ Test{complex(2, -1), complex(inf, -1), complex(0, negzero)},
+ Test{complex(2, -1), complex(inf, 2), complex(0, negzero)},
+ Test{complex(2, -1), complex(nan, nan), complex(nan, nan)},
+ Test{complex(2, -1), complex(-nan, inf), complex(negzero, negzero)},
+ Test{complex(2, -1), complex(-nan, -inf), complex(0, 0)},
+ Test{complex(2, -1), complex(-inf, 0), complex(negzero, 0)},
+ Test{complex(2, -1), complex(-inf, 1), complex(negzero, 0)},
+ Test{complex(2, -1), complex(-inf, -1), complex(negzero, 0)},
+ Test{complex(2, -1), complex(-inf, 2), complex(negzero, 0)},
+ Test{complex(2, -1), complex(nan, nan), complex(nan, nan)},
+ Test{complex(2, -1), complex(-nan, inf), complex(negzero, negzero)},
+ Test{complex(2, -1), complex(-nan, -inf), complex(0, 0)},
+ Test{complex(2, 2), complex(0, 0), complex(inf, inf)},
+ Test{complex(2, 2), complex(0, 1), complex(2, -2)},
+ Test{complex(2, 2), complex(0, -1), complex(-2, 2)},
+ Test{complex(2, 2), complex(0, 2), complex(1, -1)},
+ Test{complex(2, 2), complex(nan, nan), complex(nan, nan)},
+ Test{complex(2, 2), complex(-nan, inf), complex(0, negzero)},
+ Test{complex(2, 2), complex(-nan, -inf), complex(negzero, 0)},
+ Test{complex(2, 2), complex(1, 0), complex(2, 2)},
+ Test{complex(2, 2), complex(1, 1), complex(2, 0)},
+ Test{complex(2, 2), complex(1, -1), complex(0, 2)},
+ Test{complex(2, 2), complex(1, 2), complex(1.2, -0.4)},
+ Test{complex(2, 2), complex(nan, nan), complex(nan, nan)},
+ Test{complex(2, 2), complex(-nan, inf), complex(0, negzero)},
+ Test{complex(2, 2), complex(-nan, -inf), complex(negzero, 0)},
+ Test{complex(2, 2), complex(-1, 0), complex(-2, -2)},
+ Test{complex(2, 2), complex(-1, 1), complex(negzero, -2)},
+ Test{complex(2, 2), complex(-1, -1), complex(-2, negzero)},
+ Test{complex(2, 2), complex(-1, 2), complex(0.4, -1.2)},
+ Test{complex(2, 2), complex(nan, nan), complex(nan, nan)},
+ Test{complex(2, 2), complex(-nan, inf), complex(0, negzero)},
+ Test{complex(2, 2), complex(-nan, -inf), complex(negzero, 0)},
+ Test{complex(2, 2), complex(2, 0), complex(1, 1)},
+ Test{complex(2, 2), complex(2, 1), complex(1.2, 0.4)},
+ Test{complex(2, 2), complex(2, -1), complex(0.4, 1.2)},
+ Test{complex(2, 2), complex(2, 2), complex(1, 0)},
+ Test{complex(2, 2), complex(nan, nan), complex(nan, nan)},
+ Test{complex(2, 2), complex(-nan, inf), complex(0, negzero)},
+ Test{complex(2, 2), complex(-nan, -inf), complex(negzero, 0)},
+ Test{complex(2, 2), complex(nan, 0), complex(nan, nan)},
+ Test{complex(2, 2), complex(nan, 1), complex(nan, nan)},
+ Test{complex(2, 2), complex(nan, -1), complex(nan, nan)},
+ Test{complex(2, 2), complex(nan, 2), complex(nan, nan)},
+ Test{complex(2, 2), complex(nan, nan), complex(nan, nan)},
+ Test{complex(2, 2), complex(-nan, inf), complex(0, negzero)},
+ Test{complex(2, 2), complex(-nan, -inf), complex(negzero, 0)},
+ Test{complex(2, 2), complex(inf, 0), complex(0, 0)},
+ Test{complex(2, 2), complex(inf, 1), complex(0, 0)},
+ Test{complex(2, 2), complex(inf, -1), complex(0, 0)},
+ Test{complex(2, 2), complex(inf, 2), complex(0, 0)},
+ Test{complex(2, 2), complex(nan, nan), complex(nan, nan)},
+ Test{complex(2, 2), complex(-nan, inf), complex(0, negzero)},
+ Test{complex(2, 2), complex(-nan, -inf), complex(negzero, 0)},
+ Test{complex(2, 2), complex(-inf, 0), complex(negzero, negzero)},
+ Test{complex(2, 2), complex(-inf, 1), complex(negzero, negzero)},
+ Test{complex(2, 2), complex(-inf, -1), complex(negzero, negzero)},
+ Test{complex(2, 2), complex(-inf, 2), complex(negzero, negzero)},
+ Test{complex(2, 2), complex(nan, nan), complex(nan, nan)},
+ Test{complex(2, 2), complex(-nan, inf), complex(0, negzero)},
+ Test{complex(2, 2), complex(-nan, -inf), complex(negzero, 0)},
+ Test{complex(nan, nan), complex(0, 0), complex(nan, nan)},
+ Test{complex(nan, nan), complex(0, 1), complex(nan, nan)},
+ Test{complex(nan, nan), complex(0, -1), complex(nan, nan)},
+ Test{complex(nan, nan), complex(0, 2), complex(nan, nan)},
+ Test{complex(nan, nan), complex(nan, nan), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-nan, inf), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-nan, -inf), complex(nan, nan)},
+ Test{complex(nan, nan), complex(1, 0), complex(nan, nan)},
+ Test{complex(nan, nan), complex(1, 1), complex(nan, nan)},
+ Test{complex(nan, nan), complex(1, -1), complex(nan, nan)},
+ Test{complex(nan, nan), complex(1, 2), complex(nan, nan)},
+ Test{complex(nan, nan), complex(nan, nan), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-nan, inf), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-nan, -inf), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-1, 0), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-1, 1), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-1, -1), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-1, 2), complex(nan, nan)},
+ Test{complex(nan, nan), complex(nan, nan), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-nan, inf), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-nan, -inf), complex(nan, nan)},
+ Test{complex(nan, nan), complex(2, 0), complex(nan, nan)},
+ Test{complex(nan, nan), complex(2, 1), complex(nan, nan)},
+ Test{complex(nan, nan), complex(2, -1), complex(nan, nan)},
+ Test{complex(nan, nan), complex(2, 2), complex(nan, nan)},
+ Test{complex(nan, nan), complex(nan, nan), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-nan, inf), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-nan, -inf), complex(nan, nan)},
+ Test{complex(nan, nan), complex(nan, 0), complex(nan, nan)},
+ Test{complex(nan, nan), complex(nan, 1), complex(nan, nan)},
+ Test{complex(nan, nan), complex(nan, -1), complex(nan, nan)},
+ Test{complex(nan, nan), complex(nan, 2), complex(nan, nan)},
+ Test{complex(nan, nan), complex(nan, nan), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-nan, inf), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-nan, -inf), complex(nan, nan)},
+ Test{complex(nan, nan), complex(inf, 0), complex(nan, nan)},
+ Test{complex(nan, nan), complex(inf, 1), complex(nan, nan)},
+ Test{complex(nan, nan), complex(inf, -1), complex(nan, nan)},
+ Test{complex(nan, nan), complex(inf, 2), complex(nan, nan)},
+ Test{complex(nan, nan), complex(nan, nan), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-nan, inf), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-nan, -inf), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-inf, 0), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-inf, 1), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-inf, -1), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-inf, 2), complex(nan, nan)},
+ Test{complex(nan, nan), complex(nan, nan), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-nan, inf), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-nan, -inf), complex(nan, nan)},
+ Test{complex(-nan, inf), complex(0, 0), complex(-nan, inf)},
+ Test{complex(-nan, inf), complex(0, 1), complex(inf, -nan)},
+ Test{complex(-nan, inf), complex(0, -1), complex(-inf, -nan)},
+ Test{complex(-nan, inf), complex(0, 2), complex(inf, -nan)},
+ Test{complex(-nan, inf), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-nan, inf), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(1, 0), complex(-nan, inf)},
+ Test{complex(-nan, inf), complex(1, 1), complex(inf, inf)},
+ Test{complex(-nan, inf), complex(1, -1), complex(-inf, inf)},
+ Test{complex(-nan, inf), complex(1, 2), complex(inf, inf)},
+ Test{complex(-nan, inf), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-nan, inf), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(-1, 0), complex(-nan, -inf)},
+ Test{complex(-nan, inf), complex(-1, 1), complex(inf, -inf)},
+ Test{complex(-nan, inf), complex(-1, -1), complex(-inf, -inf)},
+ Test{complex(-nan, inf), complex(-1, 2), complex(inf, -inf)},
+ Test{complex(-nan, inf), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-nan, inf), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(2, 0), complex(-nan, inf)},
+ Test{complex(-nan, inf), complex(2, 1), complex(inf, inf)},
+ Test{complex(-nan, inf), complex(2, -1), complex(-inf, inf)},
+ Test{complex(-nan, inf), complex(2, 2), complex(inf, inf)},
+ Test{complex(-nan, inf), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-nan, inf), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(nan, 0), complex(nan, nan)},
+ Test{complex(-nan, inf), complex(nan, 1), complex(nan, nan)},
+ Test{complex(-nan, inf), complex(nan, -1), complex(nan, nan)},
+ Test{complex(-nan, inf), complex(nan, 2), complex(nan, nan)},
+ Test{complex(-nan, inf), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-nan, inf), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(inf, 0), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(inf, 1), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(inf, -1), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(inf, 2), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-nan, inf), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(-inf, 0), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(-inf, 1), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(-inf, -1), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(-inf, 2), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-nan, inf), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(0, 0), complex(-nan, -inf)},
+ Test{complex(-nan, -inf), complex(0, 1), complex(-inf, -nan)},
+ Test{complex(-nan, -inf), complex(0, -1), complex(inf, -nan)},
+ Test{complex(-nan, -inf), complex(0, 2), complex(-inf, -nan)},
+ Test{complex(-nan, -inf), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-nan, -inf), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(1, 0), complex(-nan, -inf)},
+ Test{complex(-nan, -inf), complex(1, 1), complex(-inf, -inf)},
+ Test{complex(-nan, -inf), complex(1, -1), complex(inf, -inf)},
+ Test{complex(-nan, -inf), complex(1, 2), complex(-inf, -inf)},
+ Test{complex(-nan, -inf), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-nan, -inf), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(-1, 0), complex(-nan, inf)},
+ Test{complex(-nan, -inf), complex(-1, 1), complex(-inf, inf)},
+ Test{complex(-nan, -inf), complex(-1, -1), complex(inf, inf)},
+ Test{complex(-nan, -inf), complex(-1, 2), complex(-inf, inf)},
+ Test{complex(-nan, -inf), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-nan, -inf), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(2, 0), complex(-nan, -inf)},
+ Test{complex(-nan, -inf), complex(2, 1), complex(-inf, -inf)},
+ Test{complex(-nan, -inf), complex(2, -1), complex(inf, -inf)},
+ Test{complex(-nan, -inf), complex(2, 2), complex(-inf, -inf)},
+ Test{complex(-nan, -inf), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-nan, -inf), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(nan, 0), complex(nan, nan)},
+ Test{complex(-nan, -inf), complex(nan, 1), complex(nan, nan)},
+ Test{complex(-nan, -inf), complex(nan, -1), complex(nan, nan)},
+ Test{complex(-nan, -inf), complex(nan, 2), complex(nan, nan)},
+ Test{complex(-nan, -inf), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-nan, -inf), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(inf, 0), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(inf, 1), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(inf, -1), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(inf, 2), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-nan, -inf), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(-inf, 0), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(-inf, 1), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(-inf, -1), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(-inf, 2), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-nan, -inf), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(nan, 0), complex(0, 0), complex(nan, nan)},
+ Test{complex(nan, 0), complex(0, 1), complex(nan, nan)},
+ Test{complex(nan, 0), complex(0, -1), complex(nan, nan)},
+ Test{complex(nan, 0), complex(0, 2), complex(nan, nan)},
+ Test{complex(nan, 0), complex(nan, nan), complex(nan, nan)},
+ Test{complex(nan, 0), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(nan, 0), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(nan, 0), complex(1, 0), complex(nan, nan)},
+ Test{complex(nan, 0), complex(1, 1), complex(nan, nan)},
+ Test{complex(nan, 0), complex(1, -1), complex(nan, nan)},
+ Test{complex(nan, 0), complex(1, 2), complex(nan, nan)},
+ Test{complex(nan, 0), complex(nan, nan), complex(nan, nan)},
+ Test{complex(nan, 0), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(nan, 0), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(nan, 0), complex(-1, 0), complex(nan, nan)},
+ Test{complex(nan, 0), complex(-1, 1), complex(nan, nan)},
+ Test{complex(nan, 0), complex(-1, -1), complex(nan, nan)},
+ Test{complex(nan, 0), complex(-1, 2), complex(nan, nan)},
+ Test{complex(nan, 0), complex(nan, nan), complex(nan, nan)},
+ Test{complex(nan, 0), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(nan, 0), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(nan, 0), complex(2, 0), complex(nan, nan)},
+ Test{complex(nan, 0), complex(2, 1), complex(nan, nan)},
+ Test{complex(nan, 0), complex(2, -1), complex(nan, nan)},
+ Test{complex(nan, 0), complex(2, 2), complex(nan, nan)},
+ Test{complex(nan, 0), complex(nan, nan), complex(nan, nan)},
+ Test{complex(nan, 0), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(nan, 0), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(nan, 0), complex(nan, 0), complex(nan, nan)},
+ Test{complex(nan, 0), complex(nan, 1), complex(nan, nan)},
+ Test{complex(nan, 0), complex(nan, -1), complex(nan, nan)},
+ Test{complex(nan, 0), complex(nan, 2), complex(nan, nan)},
+ Test{complex(nan, 0), complex(nan, nan), complex(nan, nan)},
+ Test{complex(nan, 0), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(nan, 0), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(nan, 0), complex(inf, 0), complex(nan, nan)},
+ Test{complex(nan, 0), complex(inf, 1), complex(nan, nan)},
+ Test{complex(nan, 0), complex(inf, -1), complex(nan, nan)},
+ Test{complex(nan, 0), complex(inf, 2), complex(nan, nan)},
+ Test{complex(nan, 0), complex(nan, nan), complex(nan, nan)},
+ Test{complex(nan, 0), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(nan, 0), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(nan, 0), complex(-inf, 0), complex(nan, nan)},
+ Test{complex(nan, 0), complex(-inf, 1), complex(nan, nan)},
+ Test{complex(nan, 0), complex(-inf, -1), complex(nan, nan)},
+ Test{complex(nan, 0), complex(-inf, 2), complex(nan, nan)},
+ Test{complex(nan, 0), complex(nan, nan), complex(nan, nan)},
+ Test{complex(nan, 0), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(nan, 0), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(nan, 1), complex(0, 0), complex(nan, nan)},
+ Test{complex(nan, 1), complex(0, 1), complex(nan, nan)},
+ Test{complex(nan, 1), complex(0, -1), complex(nan, nan)},
+ Test{complex(nan, 1), complex(0, 2), complex(nan, nan)},
+ Test{complex(nan, 1), complex(nan, nan), complex(nan, nan)},
+ Test{complex(nan, 1), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(nan, 1), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(nan, 1), complex(1, 0), complex(nan, nan)},
+ Test{complex(nan, 1), complex(1, 1), complex(nan, nan)},
+ Test{complex(nan, 1), complex(1, -1), complex(nan, nan)},
+ Test{complex(nan, 1), complex(1, 2), complex(nan, nan)},
+ Test{complex(nan, 1), complex(nan, nan), complex(nan, nan)},
+ Test{complex(nan, 1), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(nan, 1), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(nan, 1), complex(-1, 0), complex(nan, nan)},
+ Test{complex(nan, 1), complex(-1, 1), complex(nan, nan)},
+ Test{complex(nan, 1), complex(-1, -1), complex(nan, nan)},
+ Test{complex(nan, 1), complex(-1, 2), complex(nan, nan)},
+ Test{complex(nan, 1), complex(nan, nan), complex(nan, nan)},
+ Test{complex(nan, 1), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(nan, 1), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(nan, 1), complex(2, 0), complex(nan, nan)},
+ Test{complex(nan, 1), complex(2, 1), complex(nan, nan)},
+ Test{complex(nan, 1), complex(2, -1), complex(nan, nan)},
+ Test{complex(nan, 1), complex(2, 2), complex(nan, nan)},
+ Test{complex(nan, 1), complex(nan, nan), complex(nan, nan)},
+ Test{complex(nan, 1), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(nan, 1), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(nan, 1), complex(nan, 0), complex(nan, nan)},
+ Test{complex(nan, 1), complex(nan, 1), complex(nan, nan)},
+ Test{complex(nan, 1), complex(nan, -1), complex(nan, nan)},
+ Test{complex(nan, 1), complex(nan, 2), complex(nan, nan)},
+ Test{complex(nan, 1), complex(nan, nan), complex(nan, nan)},
+ Test{complex(nan, 1), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(nan, 1), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(nan, 1), complex(inf, 0), complex(nan, nan)},
+ Test{complex(nan, 1), complex(inf, 1), complex(nan, nan)},
+ Test{complex(nan, 1), complex(inf, -1), complex(nan, nan)},
+ Test{complex(nan, 1), complex(inf, 2), complex(nan, nan)},
+ Test{complex(nan, 1), complex(nan, nan), complex(nan, nan)},
+ Test{complex(nan, 1), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(nan, 1), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(nan, 1), complex(-inf, 0), complex(nan, nan)},
+ Test{complex(nan, 1), complex(-inf, 1), complex(nan, nan)},
+ Test{complex(nan, 1), complex(-inf, -1), complex(nan, nan)},
+ Test{complex(nan, 1), complex(-inf, 2), complex(nan, nan)},
+ Test{complex(nan, 1), complex(nan, nan), complex(nan, nan)},
+ Test{complex(nan, 1), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(nan, 1), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(nan, -1), complex(0, 0), complex(nan, nan)},
+ Test{complex(nan, -1), complex(0, 1), complex(nan, nan)},
+ Test{complex(nan, -1), complex(0, -1), complex(nan, nan)},
+ Test{complex(nan, -1), complex(0, 2), complex(nan, nan)},
+ Test{complex(nan, -1), complex(nan, nan), complex(nan, nan)},
+ Test{complex(nan, -1), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(nan, -1), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(nan, -1), complex(1, 0), complex(nan, nan)},
+ Test{complex(nan, -1), complex(1, 1), complex(nan, nan)},
+ Test{complex(nan, -1), complex(1, -1), complex(nan, nan)},
+ Test{complex(nan, -1), complex(1, 2), complex(nan, nan)},
+ Test{complex(nan, -1), complex(nan, nan), complex(nan, nan)},
+ Test{complex(nan, -1), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(nan, -1), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(nan, -1), complex(-1, 0), complex(nan, nan)},
+ Test{complex(nan, -1), complex(-1, 1), complex(nan, nan)},
+ Test{complex(nan, -1), complex(-1, -1), complex(nan, nan)},
+ Test{complex(nan, -1), complex(-1, 2), complex(nan, nan)},
+ Test{complex(nan, -1), complex(nan, nan), complex(nan, nan)},
+ Test{complex(nan, -1), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(nan, -1), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(nan, -1), complex(2, 0), complex(nan, nan)},
+ Test{complex(nan, -1), complex(2, 1), complex(nan, nan)},
+ Test{complex(nan, -1), complex(2, -1), complex(nan, nan)},
+ Test{complex(nan, -1), complex(2, 2), complex(nan, nan)},
+ Test{complex(nan, -1), complex(nan, nan), complex(nan, nan)},
+ Test{complex(nan, -1), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(nan, -1), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(nan, -1), complex(nan, 0), complex(nan, nan)},
+ Test{complex(nan, -1), complex(nan, 1), complex(nan, nan)},
+ Test{complex(nan, -1), complex(nan, -1), complex(nan, nan)},
+ Test{complex(nan, -1), complex(nan, 2), complex(nan, nan)},
+ Test{complex(nan, -1), complex(nan, nan), complex(nan, nan)},
+ Test{complex(nan, -1), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(nan, -1), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(nan, -1), complex(inf, 0), complex(nan, nan)},
+ Test{complex(nan, -1), complex(inf, 1), complex(nan, nan)},
+ Test{complex(nan, -1), complex(inf, -1), complex(nan, nan)},
+ Test{complex(nan, -1), complex(inf, 2), complex(nan, nan)},
+ Test{complex(nan, -1), complex(nan, nan), complex(nan, nan)},
+ Test{complex(nan, -1), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(nan, -1), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(nan, -1), complex(-inf, 0), complex(nan, nan)},
+ Test{complex(nan, -1), complex(-inf, 1), complex(nan, nan)},
+ Test{complex(nan, -1), complex(-inf, -1), complex(nan, nan)},
+ Test{complex(nan, -1), complex(-inf, 2), complex(nan, nan)},
+ Test{complex(nan, -1), complex(nan, nan), complex(nan, nan)},
+ Test{complex(nan, -1), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(nan, -1), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(nan, 2), complex(0, 0), complex(nan, nan)},
+ Test{complex(nan, 2), complex(0, 1), complex(nan, nan)},
+ Test{complex(nan, 2), complex(0, -1), complex(nan, nan)},
+ Test{complex(nan, 2), complex(0, 2), complex(nan, nan)},
+ Test{complex(nan, 2), complex(nan, nan), complex(nan, nan)},
+ Test{complex(nan, 2), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(nan, 2), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(nan, 2), complex(1, 0), complex(nan, nan)},
+ Test{complex(nan, 2), complex(1, 1), complex(nan, nan)},
+ Test{complex(nan, 2), complex(1, -1), complex(nan, nan)},
+ Test{complex(nan, 2), complex(1, 2), complex(nan, nan)},
+ Test{complex(nan, 2), complex(nan, nan), complex(nan, nan)},
+ Test{complex(nan, 2), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(nan, 2), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(nan, 2), complex(-1, 0), complex(nan, nan)},
+ Test{complex(nan, 2), complex(-1, 1), complex(nan, nan)},
+ Test{complex(nan, 2), complex(-1, -1), complex(nan, nan)},
+ Test{complex(nan, 2), complex(-1, 2), complex(nan, nan)},
+ Test{complex(nan, 2), complex(nan, nan), complex(nan, nan)},
+ Test{complex(nan, 2), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(nan, 2), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(nan, 2), complex(2, 0), complex(nan, nan)},
+ Test{complex(nan, 2), complex(2, 1), complex(nan, nan)},
+ Test{complex(nan, 2), complex(2, -1), complex(nan, nan)},
+ Test{complex(nan, 2), complex(2, 2), complex(nan, nan)},
+ Test{complex(nan, 2), complex(nan, nan), complex(nan, nan)},
+ Test{complex(nan, 2), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(nan, 2), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(nan, 2), complex(nan, 0), complex(nan, nan)},
+ Test{complex(nan, 2), complex(nan, 1), complex(nan, nan)},
+ Test{complex(nan, 2), complex(nan, -1), complex(nan, nan)},
+ Test{complex(nan, 2), complex(nan, 2), complex(nan, nan)},
+ Test{complex(nan, 2), complex(nan, nan), complex(nan, nan)},
+ Test{complex(nan, 2), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(nan, 2), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(nan, 2), complex(inf, 0), complex(nan, nan)},
+ Test{complex(nan, 2), complex(inf, 1), complex(nan, nan)},
+ Test{complex(nan, 2), complex(inf, -1), complex(nan, nan)},
+ Test{complex(nan, 2), complex(inf, 2), complex(nan, nan)},
+ Test{complex(nan, 2), complex(nan, nan), complex(nan, nan)},
+ Test{complex(nan, 2), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(nan, 2), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(nan, 2), complex(-inf, 0), complex(nan, nan)},
+ Test{complex(nan, 2), complex(-inf, 1), complex(nan, nan)},
+ Test{complex(nan, 2), complex(-inf, -1), complex(nan, nan)},
+ Test{complex(nan, 2), complex(-inf, 2), complex(nan, nan)},
+ Test{complex(nan, 2), complex(nan, nan), complex(nan, nan)},
+ Test{complex(nan, 2), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(nan, 2), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(nan, nan), complex(0, 0), complex(nan, nan)},
+ Test{complex(nan, nan), complex(0, 1), complex(nan, nan)},
+ Test{complex(nan, nan), complex(0, -1), complex(nan, nan)},
+ Test{complex(nan, nan), complex(0, 2), complex(nan, nan)},
+ Test{complex(nan, nan), complex(nan, nan), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-nan, inf), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-nan, -inf), complex(nan, nan)},
+ Test{complex(nan, nan), complex(1, 0), complex(nan, nan)},
+ Test{complex(nan, nan), complex(1, 1), complex(nan, nan)},
+ Test{complex(nan, nan), complex(1, -1), complex(nan, nan)},
+ Test{complex(nan, nan), complex(1, 2), complex(nan, nan)},
+ Test{complex(nan, nan), complex(nan, nan), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-nan, inf), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-nan, -inf), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-1, 0), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-1, 1), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-1, -1), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-1, 2), complex(nan, nan)},
+ Test{complex(nan, nan), complex(nan, nan), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-nan, inf), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-nan, -inf), complex(nan, nan)},
+ Test{complex(nan, nan), complex(2, 0), complex(nan, nan)},
+ Test{complex(nan, nan), complex(2, 1), complex(nan, nan)},
+ Test{complex(nan, nan), complex(2, -1), complex(nan, nan)},
+ Test{complex(nan, nan), complex(2, 2), complex(nan, nan)},
+ Test{complex(nan, nan), complex(nan, nan), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-nan, inf), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-nan, -inf), complex(nan, nan)},
+ Test{complex(nan, nan), complex(nan, 0), complex(nan, nan)},
+ Test{complex(nan, nan), complex(nan, 1), complex(nan, nan)},
+ Test{complex(nan, nan), complex(nan, -1), complex(nan, nan)},
+ Test{complex(nan, nan), complex(nan, 2), complex(nan, nan)},
+ Test{complex(nan, nan), complex(nan, nan), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-nan, inf), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-nan, -inf), complex(nan, nan)},
+ Test{complex(nan, nan), complex(inf, 0), complex(nan, nan)},
+ Test{complex(nan, nan), complex(inf, 1), complex(nan, nan)},
+ Test{complex(nan, nan), complex(inf, -1), complex(nan, nan)},
+ Test{complex(nan, nan), complex(inf, 2), complex(nan, nan)},
+ Test{complex(nan, nan), complex(nan, nan), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-nan, inf), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-nan, -inf), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-inf, 0), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-inf, 1), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-inf, -1), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-inf, 2), complex(nan, nan)},
+ Test{complex(nan, nan), complex(nan, nan), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-nan, inf), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-nan, -inf), complex(nan, nan)},
+ Test{complex(-nan, inf), complex(0, 0), complex(-nan, inf)},
+ Test{complex(-nan, inf), complex(0, 1), complex(inf, -nan)},
+ Test{complex(-nan, inf), complex(0, -1), complex(-inf, -nan)},
+ Test{complex(-nan, inf), complex(0, 2), complex(inf, -nan)},
+ Test{complex(-nan, inf), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-nan, inf), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(1, 0), complex(-nan, inf)},
+ Test{complex(-nan, inf), complex(1, 1), complex(inf, inf)},
+ Test{complex(-nan, inf), complex(1, -1), complex(-inf, inf)},
+ Test{complex(-nan, inf), complex(1, 2), complex(inf, inf)},
+ Test{complex(-nan, inf), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-nan, inf), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(-1, 0), complex(-nan, -inf)},
+ Test{complex(-nan, inf), complex(-1, 1), complex(inf, -inf)},
+ Test{complex(-nan, inf), complex(-1, -1), complex(-inf, -inf)},
+ Test{complex(-nan, inf), complex(-1, 2), complex(inf, -inf)},
+ Test{complex(-nan, inf), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-nan, inf), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(2, 0), complex(-nan, inf)},
+ Test{complex(-nan, inf), complex(2, 1), complex(inf, inf)},
+ Test{complex(-nan, inf), complex(2, -1), complex(-inf, inf)},
+ Test{complex(-nan, inf), complex(2, 2), complex(inf, inf)},
+ Test{complex(-nan, inf), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-nan, inf), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(nan, 0), complex(nan, nan)},
+ Test{complex(-nan, inf), complex(nan, 1), complex(nan, nan)},
+ Test{complex(-nan, inf), complex(nan, -1), complex(nan, nan)},
+ Test{complex(-nan, inf), complex(nan, 2), complex(nan, nan)},
+ Test{complex(-nan, inf), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-nan, inf), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(inf, 0), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(inf, 1), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(inf, -1), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(inf, 2), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-nan, inf), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(-inf, 0), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(-inf, 1), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(-inf, -1), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(-inf, 2), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-nan, inf), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(0, 0), complex(-nan, -inf)},
+ Test{complex(-nan, -inf), complex(0, 1), complex(-inf, -nan)},
+ Test{complex(-nan, -inf), complex(0, -1), complex(inf, -nan)},
+ Test{complex(-nan, -inf), complex(0, 2), complex(-inf, -nan)},
+ Test{complex(-nan, -inf), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-nan, -inf), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(1, 0), complex(-nan, -inf)},
+ Test{complex(-nan, -inf), complex(1, 1), complex(-inf, -inf)},
+ Test{complex(-nan, -inf), complex(1, -1), complex(inf, -inf)},
+ Test{complex(-nan, -inf), complex(1, 2), complex(-inf, -inf)},
+ Test{complex(-nan, -inf), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-nan, -inf), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(-1, 0), complex(-nan, inf)},
+ Test{complex(-nan, -inf), complex(-1, 1), complex(-inf, inf)},
+ Test{complex(-nan, -inf), complex(-1, -1), complex(inf, inf)},
+ Test{complex(-nan, -inf), complex(-1, 2), complex(-inf, inf)},
+ Test{complex(-nan, -inf), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-nan, -inf), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(2, 0), complex(-nan, -inf)},
+ Test{complex(-nan, -inf), complex(2, 1), complex(-inf, -inf)},
+ Test{complex(-nan, -inf), complex(2, -1), complex(inf, -inf)},
+ Test{complex(-nan, -inf), complex(2, 2), complex(-inf, -inf)},
+ Test{complex(-nan, -inf), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-nan, -inf), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(nan, 0), complex(nan, nan)},
+ Test{complex(-nan, -inf), complex(nan, 1), complex(nan, nan)},
+ Test{complex(-nan, -inf), complex(nan, -1), complex(nan, nan)},
+ Test{complex(-nan, -inf), complex(nan, 2), complex(nan, nan)},
+ Test{complex(-nan, -inf), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-nan, -inf), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(inf, 0), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(inf, 1), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(inf, -1), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(inf, 2), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-nan, -inf), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(-inf, 0), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(-inf, 1), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(-inf, -1), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(-inf, 2), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-nan, -inf), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(inf, 0), complex(0, 0), complex(inf, -nan)},
+ Test{complex(inf, 0), complex(0, 1), complex(-nan, -inf)},
+ Test{complex(inf, 0), complex(0, -1), complex(-nan, inf)},
+ Test{complex(inf, 0), complex(0, 2), complex(-nan, -inf)},
+ Test{complex(inf, 0), complex(nan, nan), complex(nan, nan)},
+ Test{complex(inf, 0), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(inf, 0), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(inf, 0), complex(1, 0), complex(inf, -nan)},
+ Test{complex(inf, 0), complex(1, 1), complex(inf, -inf)},
+ Test{complex(inf, 0), complex(1, -1), complex(inf, inf)},
+ Test{complex(inf, 0), complex(1, 2), complex(inf, -inf)},
+ Test{complex(inf, 0), complex(nan, nan), complex(nan, nan)},
+ Test{complex(inf, 0), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(inf, 0), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(inf, 0), complex(-1, 0), complex(-inf, -nan)},
+ Test{complex(inf, 0), complex(-1, 1), complex(-inf, -inf)},
+ Test{complex(inf, 0), complex(-1, -1), complex(-inf, inf)},
+ Test{complex(inf, 0), complex(-1, 2), complex(-inf, -inf)},
+ Test{complex(inf, 0), complex(nan, nan), complex(nan, nan)},
+ Test{complex(inf, 0), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(inf, 0), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(inf, 0), complex(2, 0), complex(inf, -nan)},
+ Test{complex(inf, 0), complex(2, 1), complex(inf, -inf)},
+ Test{complex(inf, 0), complex(2, -1), complex(inf, inf)},
+ Test{complex(inf, 0), complex(2, 2), complex(inf, -inf)},
+ Test{complex(inf, 0), complex(nan, nan), complex(nan, nan)},
+ Test{complex(inf, 0), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(inf, 0), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(inf, 0), complex(nan, 0), complex(nan, nan)},
+ Test{complex(inf, 0), complex(nan, 1), complex(nan, nan)},
+ Test{complex(inf, 0), complex(nan, -1), complex(nan, nan)},
+ Test{complex(inf, 0), complex(nan, 2), complex(nan, nan)},
+ Test{complex(inf, 0), complex(nan, nan), complex(nan, nan)},
+ Test{complex(inf, 0), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(inf, 0), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(inf, 0), complex(inf, 0), complex(-nan, -nan)},
+ Test{complex(inf, 0), complex(inf, 1), complex(-nan, -nan)},
+ Test{complex(inf, 0), complex(inf, -1), complex(-nan, -nan)},
+ Test{complex(inf, 0), complex(inf, 2), complex(-nan, -nan)},
+ Test{complex(inf, 0), complex(nan, nan), complex(nan, nan)},
+ Test{complex(inf, 0), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(inf, 0), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(inf, 0), complex(-inf, 0), complex(-nan, -nan)},
+ Test{complex(inf, 0), complex(-inf, 1), complex(-nan, -nan)},
+ Test{complex(inf, 0), complex(-inf, -1), complex(-nan, -nan)},
+ Test{complex(inf, 0), complex(-inf, 2), complex(-nan, -nan)},
+ Test{complex(inf, 0), complex(nan, nan), complex(nan, nan)},
+ Test{complex(inf, 0), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(inf, 0), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(inf, 1), complex(0, 0), complex(inf, inf)},
+ Test{complex(inf, 1), complex(0, 1), complex(-nan, -inf)},
+ Test{complex(inf, 1), complex(0, -1), complex(-nan, inf)},
+ Test{complex(inf, 1), complex(0, 2), complex(-nan, -inf)},
+ Test{complex(inf, 1), complex(nan, nan), complex(nan, nan)},
+ Test{complex(inf, 1), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(inf, 1), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(inf, 1), complex(1, 0), complex(inf, -nan)},
+ Test{complex(inf, 1), complex(1, 1), complex(inf, -inf)},
+ Test{complex(inf, 1), complex(1, -1), complex(inf, inf)},
+ Test{complex(inf, 1), complex(1, 2), complex(inf, -inf)},
+ Test{complex(inf, 1), complex(nan, nan), complex(nan, nan)},
+ Test{complex(inf, 1), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(inf, 1), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(inf, 1), complex(-1, 0), complex(-inf, -nan)},
+ Test{complex(inf, 1), complex(-1, 1), complex(-inf, -inf)},
+ Test{complex(inf, 1), complex(-1, -1), complex(-inf, inf)},
+ Test{complex(inf, 1), complex(-1, 2), complex(-inf, -inf)},
+ Test{complex(inf, 1), complex(nan, nan), complex(nan, nan)},
+ Test{complex(inf, 1), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(inf, 1), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(inf, 1), complex(2, 0), complex(inf, -nan)},
+ Test{complex(inf, 1), complex(2, 1), complex(inf, -inf)},
+ Test{complex(inf, 1), complex(2, -1), complex(inf, inf)},
+ Test{complex(inf, 1), complex(2, 2), complex(inf, -inf)},
+ Test{complex(inf, 1), complex(nan, nan), complex(nan, nan)},
+ Test{complex(inf, 1), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(inf, 1), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(inf, 1), complex(nan, 0), complex(nan, nan)},
+ Test{complex(inf, 1), complex(nan, 1), complex(nan, nan)},
+ Test{complex(inf, 1), complex(nan, -1), complex(nan, nan)},
+ Test{complex(inf, 1), complex(nan, 2), complex(nan, nan)},
+ Test{complex(inf, 1), complex(nan, nan), complex(nan, nan)},
+ Test{complex(inf, 1), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(inf, 1), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(inf, 1), complex(inf, 0), complex(-nan, -nan)},
+ Test{complex(inf, 1), complex(inf, 1), complex(-nan, -nan)},
+ Test{complex(inf, 1), complex(inf, -1), complex(-nan, -nan)},
+ Test{complex(inf, 1), complex(inf, 2), complex(-nan, -nan)},
+ Test{complex(inf, 1), complex(nan, nan), complex(nan, nan)},
+ Test{complex(inf, 1), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(inf, 1), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(inf, 1), complex(-inf, 0), complex(-nan, -nan)},
+ Test{complex(inf, 1), complex(-inf, 1), complex(-nan, -nan)},
+ Test{complex(inf, 1), complex(-inf, -1), complex(-nan, -nan)},
+ Test{complex(inf, 1), complex(-inf, 2), complex(-nan, -nan)},
+ Test{complex(inf, 1), complex(nan, nan), complex(nan, nan)},
+ Test{complex(inf, 1), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(inf, 1), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(inf, -1), complex(0, 0), complex(inf, -inf)},
+ Test{complex(inf, -1), complex(0, 1), complex(-nan, -inf)},
+ Test{complex(inf, -1), complex(0, -1), complex(-nan, inf)},
+ Test{complex(inf, -1), complex(0, 2), complex(-nan, -inf)},
+ Test{complex(inf, -1), complex(nan, nan), complex(nan, nan)},
+ Test{complex(inf, -1), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(inf, -1), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(inf, -1), complex(1, 0), complex(inf, -nan)},
+ Test{complex(inf, -1), complex(1, 1), complex(inf, -inf)},
+ Test{complex(inf, -1), complex(1, -1), complex(inf, inf)},
+ Test{complex(inf, -1), complex(1, 2), complex(inf, -inf)},
+ Test{complex(inf, -1), complex(nan, nan), complex(nan, nan)},
+ Test{complex(inf, -1), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(inf, -1), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(inf, -1), complex(-1, 0), complex(-inf, -nan)},
+ Test{complex(inf, -1), complex(-1, 1), complex(-inf, -inf)},
+ Test{complex(inf, -1), complex(-1, -1), complex(-inf, inf)},
+ Test{complex(inf, -1), complex(-1, 2), complex(-inf, -inf)},
+ Test{complex(inf, -1), complex(nan, nan), complex(nan, nan)},
+ Test{complex(inf, -1), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(inf, -1), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(inf, -1), complex(2, 0), complex(inf, -nan)},
+ Test{complex(inf, -1), complex(2, 1), complex(inf, -inf)},
+ Test{complex(inf, -1), complex(2, -1), complex(inf, inf)},
+ Test{complex(inf, -1), complex(2, 2), complex(inf, -inf)},
+ Test{complex(inf, -1), complex(nan, nan), complex(nan, nan)},
+ Test{complex(inf, -1), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(inf, -1), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(inf, -1), complex(nan, 0), complex(nan, nan)},
+ Test{complex(inf, -1), complex(nan, 1), complex(nan, nan)},
+ Test{complex(inf, -1), complex(nan, -1), complex(nan, nan)},
+ Test{complex(inf, -1), complex(nan, 2), complex(nan, nan)},
+ Test{complex(inf, -1), complex(nan, nan), complex(nan, nan)},
+ Test{complex(inf, -1), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(inf, -1), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(inf, -1), complex(inf, 0), complex(-nan, -nan)},
+ Test{complex(inf, -1), complex(inf, 1), complex(-nan, -nan)},
+ Test{complex(inf, -1), complex(inf, -1), complex(-nan, -nan)},
+ Test{complex(inf, -1), complex(inf, 2), complex(-nan, -nan)},
+ Test{complex(inf, -1), complex(nan, nan), complex(nan, nan)},
+ Test{complex(inf, -1), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(inf, -1), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(inf, -1), complex(-inf, 0), complex(-nan, -nan)},
+ Test{complex(inf, -1), complex(-inf, 1), complex(-nan, -nan)},
+ Test{complex(inf, -1), complex(-inf, -1), complex(-nan, -nan)},
+ Test{complex(inf, -1), complex(-inf, 2), complex(-nan, -nan)},
+ Test{complex(inf, -1), complex(nan, nan), complex(nan, nan)},
+ Test{complex(inf, -1), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(inf, -1), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(inf, 2), complex(0, 0), complex(inf, inf)},
+ Test{complex(inf, 2), complex(0, 1), complex(-nan, -inf)},
+ Test{complex(inf, 2), complex(0, -1), complex(-nan, inf)},
+ Test{complex(inf, 2), complex(0, 2), complex(-nan, -inf)},
+ Test{complex(inf, 2), complex(nan, nan), complex(nan, nan)},
+ Test{complex(inf, 2), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(inf, 2), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(inf, 2), complex(1, 0), complex(inf, -nan)},
+ Test{complex(inf, 2), complex(1, 1), complex(inf, -inf)},
+ Test{complex(inf, 2), complex(1, -1), complex(inf, inf)},
+ Test{complex(inf, 2), complex(1, 2), complex(inf, -inf)},
+ Test{complex(inf, 2), complex(nan, nan), complex(nan, nan)},
+ Test{complex(inf, 2), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(inf, 2), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(inf, 2), complex(-1, 0), complex(-inf, -nan)},
+ Test{complex(inf, 2), complex(-1, 1), complex(-inf, -inf)},
+ Test{complex(inf, 2), complex(-1, -1), complex(-inf, inf)},
+ Test{complex(inf, 2), complex(-1, 2), complex(-inf, -inf)},
+ Test{complex(inf, 2), complex(nan, nan), complex(nan, nan)},
+ Test{complex(inf, 2), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(inf, 2), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(inf, 2), complex(2, 0), complex(inf, -nan)},
+ Test{complex(inf, 2), complex(2, 1), complex(inf, -inf)},
+ Test{complex(inf, 2), complex(2, -1), complex(inf, inf)},
+ Test{complex(inf, 2), complex(2, 2), complex(inf, -inf)},
+ Test{complex(inf, 2), complex(nan, nan), complex(nan, nan)},
+ Test{complex(inf, 2), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(inf, 2), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(inf, 2), complex(nan, 0), complex(nan, nan)},
+ Test{complex(inf, 2), complex(nan, 1), complex(nan, nan)},
+ Test{complex(inf, 2), complex(nan, -1), complex(nan, nan)},
+ Test{complex(inf, 2), complex(nan, 2), complex(nan, nan)},
+ Test{complex(inf, 2), complex(nan, nan), complex(nan, nan)},
+ Test{complex(inf, 2), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(inf, 2), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(inf, 2), complex(inf, 0), complex(-nan, -nan)},
+ Test{complex(inf, 2), complex(inf, 1), complex(-nan, -nan)},
+ Test{complex(inf, 2), complex(inf, -1), complex(-nan, -nan)},
+ Test{complex(inf, 2), complex(inf, 2), complex(-nan, -nan)},
+ Test{complex(inf, 2), complex(nan, nan), complex(nan, nan)},
+ Test{complex(inf, 2), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(inf, 2), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(inf, 2), complex(-inf, 0), complex(-nan, -nan)},
+ Test{complex(inf, 2), complex(-inf, 1), complex(-nan, -nan)},
+ Test{complex(inf, 2), complex(-inf, -1), complex(-nan, -nan)},
+ Test{complex(inf, 2), complex(-inf, 2), complex(-nan, -nan)},
+ Test{complex(inf, 2), complex(nan, nan), complex(nan, nan)},
+ Test{complex(inf, 2), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(inf, 2), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(nan, nan), complex(0, 0), complex(nan, nan)},
+ Test{complex(nan, nan), complex(0, 1), complex(nan, nan)},
+ Test{complex(nan, nan), complex(0, -1), complex(nan, nan)},
+ Test{complex(nan, nan), complex(0, 2), complex(nan, nan)},
+ Test{complex(nan, nan), complex(nan, nan), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-nan, inf), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-nan, -inf), complex(nan, nan)},
+ Test{complex(nan, nan), complex(1, 0), complex(nan, nan)},
+ Test{complex(nan, nan), complex(1, 1), complex(nan, nan)},
+ Test{complex(nan, nan), complex(1, -1), complex(nan, nan)},
+ Test{complex(nan, nan), complex(1, 2), complex(nan, nan)},
+ Test{complex(nan, nan), complex(nan, nan), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-nan, inf), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-nan, -inf), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-1, 0), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-1, 1), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-1, -1), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-1, 2), complex(nan, nan)},
+ Test{complex(nan, nan), complex(nan, nan), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-nan, inf), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-nan, -inf), complex(nan, nan)},
+ Test{complex(nan, nan), complex(2, 0), complex(nan, nan)},
+ Test{complex(nan, nan), complex(2, 1), complex(nan, nan)},
+ Test{complex(nan, nan), complex(2, -1), complex(nan, nan)},
+ Test{complex(nan, nan), complex(2, 2), complex(nan, nan)},
+ Test{complex(nan, nan), complex(nan, nan), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-nan, inf), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-nan, -inf), complex(nan, nan)},
+ Test{complex(nan, nan), complex(nan, 0), complex(nan, nan)},
+ Test{complex(nan, nan), complex(nan, 1), complex(nan, nan)},
+ Test{complex(nan, nan), complex(nan, -1), complex(nan, nan)},
+ Test{complex(nan, nan), complex(nan, 2), complex(nan, nan)},
+ Test{complex(nan, nan), complex(nan, nan), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-nan, inf), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-nan, -inf), complex(nan, nan)},
+ Test{complex(nan, nan), complex(inf, 0), complex(nan, nan)},
+ Test{complex(nan, nan), complex(inf, 1), complex(nan, nan)},
+ Test{complex(nan, nan), complex(inf, -1), complex(nan, nan)},
+ Test{complex(nan, nan), complex(inf, 2), complex(nan, nan)},
+ Test{complex(nan, nan), complex(nan, nan), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-nan, inf), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-nan, -inf), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-inf, 0), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-inf, 1), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-inf, -1), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-inf, 2), complex(nan, nan)},
+ Test{complex(nan, nan), complex(nan, nan), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-nan, inf), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-nan, -inf), complex(nan, nan)},
+ Test{complex(-nan, inf), complex(0, 0), complex(-nan, inf)},
+ Test{complex(-nan, inf), complex(0, 1), complex(inf, -nan)},
+ Test{complex(-nan, inf), complex(0, -1), complex(-inf, -nan)},
+ Test{complex(-nan, inf), complex(0, 2), complex(inf, -nan)},
+ Test{complex(-nan, inf), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-nan, inf), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(1, 0), complex(-nan, inf)},
+ Test{complex(-nan, inf), complex(1, 1), complex(inf, inf)},
+ Test{complex(-nan, inf), complex(1, -1), complex(-inf, inf)},
+ Test{complex(-nan, inf), complex(1, 2), complex(inf, inf)},
+ Test{complex(-nan, inf), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-nan, inf), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(-1, 0), complex(-nan, -inf)},
+ Test{complex(-nan, inf), complex(-1, 1), complex(inf, -inf)},
+ Test{complex(-nan, inf), complex(-1, -1), complex(-inf, -inf)},
+ Test{complex(-nan, inf), complex(-1, 2), complex(inf, -inf)},
+ Test{complex(-nan, inf), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-nan, inf), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(2, 0), complex(-nan, inf)},
+ Test{complex(-nan, inf), complex(2, 1), complex(inf, inf)},
+ Test{complex(-nan, inf), complex(2, -1), complex(-inf, inf)},
+ Test{complex(-nan, inf), complex(2, 2), complex(inf, inf)},
+ Test{complex(-nan, inf), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-nan, inf), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(nan, 0), complex(nan, nan)},
+ Test{complex(-nan, inf), complex(nan, 1), complex(nan, nan)},
+ Test{complex(-nan, inf), complex(nan, -1), complex(nan, nan)},
+ Test{complex(-nan, inf), complex(nan, 2), complex(nan, nan)},
+ Test{complex(-nan, inf), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-nan, inf), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(inf, 0), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(inf, 1), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(inf, -1), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(inf, 2), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-nan, inf), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(-inf, 0), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(-inf, 1), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(-inf, -1), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(-inf, 2), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-nan, inf), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(0, 0), complex(-nan, -inf)},
+ Test{complex(-nan, -inf), complex(0, 1), complex(-inf, -nan)},
+ Test{complex(-nan, -inf), complex(0, -1), complex(inf, -nan)},
+ Test{complex(-nan, -inf), complex(0, 2), complex(-inf, -nan)},
+ Test{complex(-nan, -inf), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-nan, -inf), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(1, 0), complex(-nan, -inf)},
+ Test{complex(-nan, -inf), complex(1, 1), complex(-inf, -inf)},
+ Test{complex(-nan, -inf), complex(1, -1), complex(inf, -inf)},
+ Test{complex(-nan, -inf), complex(1, 2), complex(-inf, -inf)},
+ Test{complex(-nan, -inf), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-nan, -inf), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(-1, 0), complex(-nan, inf)},
+ Test{complex(-nan, -inf), complex(-1, 1), complex(-inf, inf)},
+ Test{complex(-nan, -inf), complex(-1, -1), complex(inf, inf)},
+ Test{complex(-nan, -inf), complex(-1, 2), complex(-inf, inf)},
+ Test{complex(-nan, -inf), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-nan, -inf), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(2, 0), complex(-nan, -inf)},
+ Test{complex(-nan, -inf), complex(2, 1), complex(-inf, -inf)},
+ Test{complex(-nan, -inf), complex(2, -1), complex(inf, -inf)},
+ Test{complex(-nan, -inf), complex(2, 2), complex(-inf, -inf)},
+ Test{complex(-nan, -inf), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-nan, -inf), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(nan, 0), complex(nan, nan)},
+ Test{complex(-nan, -inf), complex(nan, 1), complex(nan, nan)},
+ Test{complex(-nan, -inf), complex(nan, -1), complex(nan, nan)},
+ Test{complex(-nan, -inf), complex(nan, 2), complex(nan, nan)},
+ Test{complex(-nan, -inf), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-nan, -inf), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(inf, 0), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(inf, 1), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(inf, -1), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(inf, 2), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-nan, -inf), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(-inf, 0), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(-inf, 1), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(-inf, -1), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(-inf, 2), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-nan, -inf), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(-inf, 0), complex(0, 0), complex(-inf, -nan)},
+ Test{complex(-inf, 0), complex(0, 1), complex(-nan, inf)},
+ Test{complex(-inf, 0), complex(0, -1), complex(-nan, -inf)},
+ Test{complex(-inf, 0), complex(0, 2), complex(-nan, inf)},
+ Test{complex(-inf, 0), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-inf, 0), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(-inf, 0), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(-inf, 0), complex(1, 0), complex(-inf, -nan)},
+ Test{complex(-inf, 0), complex(1, 1), complex(-inf, inf)},
+ Test{complex(-inf, 0), complex(1, -1), complex(-inf, -inf)},
+ Test{complex(-inf, 0), complex(1, 2), complex(-inf, inf)},
+ Test{complex(-inf, 0), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-inf, 0), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(-inf, 0), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(-inf, 0), complex(-1, 0), complex(inf, -nan)},
+ Test{complex(-inf, 0), complex(-1, 1), complex(inf, inf)},
+ Test{complex(-inf, 0), complex(-1, -1), complex(inf, -inf)},
+ Test{complex(-inf, 0), complex(-1, 2), complex(inf, inf)},
+ Test{complex(-inf, 0), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-inf, 0), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(-inf, 0), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(-inf, 0), complex(2, 0), complex(-inf, -nan)},
+ Test{complex(-inf, 0), complex(2, 1), complex(-inf, inf)},
+ Test{complex(-inf, 0), complex(2, -1), complex(-inf, -inf)},
+ Test{complex(-inf, 0), complex(2, 2), complex(-inf, inf)},
+ Test{complex(-inf, 0), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-inf, 0), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(-inf, 0), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(-inf, 0), complex(nan, 0), complex(nan, nan)},
+ Test{complex(-inf, 0), complex(nan, 1), complex(nan, nan)},
+ Test{complex(-inf, 0), complex(nan, -1), complex(nan, nan)},
+ Test{complex(-inf, 0), complex(nan, 2), complex(nan, nan)},
+ Test{complex(-inf, 0), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-inf, 0), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(-inf, 0), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(-inf, 0), complex(inf, 0), complex(-nan, -nan)},
+ Test{complex(-inf, 0), complex(inf, 1), complex(-nan, -nan)},
+ Test{complex(-inf, 0), complex(inf, -1), complex(-nan, -nan)},
+ Test{complex(-inf, 0), complex(inf, 2), complex(-nan, -nan)},
+ Test{complex(-inf, 0), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-inf, 0), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(-inf, 0), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(-inf, 0), complex(-inf, 0), complex(-nan, -nan)},
+ Test{complex(-inf, 0), complex(-inf, 1), complex(-nan, -nan)},
+ Test{complex(-inf, 0), complex(-inf, -1), complex(-nan, -nan)},
+ Test{complex(-inf, 0), complex(-inf, 2), complex(-nan, -nan)},
+ Test{complex(-inf, 0), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-inf, 0), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(-inf, 0), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(-inf, 1), complex(0, 0), complex(-inf, inf)},
+ Test{complex(-inf, 1), complex(0, 1), complex(-nan, inf)},
+ Test{complex(-inf, 1), complex(0, -1), complex(-nan, -inf)},
+ Test{complex(-inf, 1), complex(0, 2), complex(-nan, inf)},
+ Test{complex(-inf, 1), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-inf, 1), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(-inf, 1), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(-inf, 1), complex(1, 0), complex(-inf, -nan)},
+ Test{complex(-inf, 1), complex(1, 1), complex(-inf, inf)},
+ Test{complex(-inf, 1), complex(1, -1), complex(-inf, -inf)},
+ Test{complex(-inf, 1), complex(1, 2), complex(-inf, inf)},
+ Test{complex(-inf, 1), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-inf, 1), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(-inf, 1), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(-inf, 1), complex(-1, 0), complex(inf, -nan)},
+ Test{complex(-inf, 1), complex(-1, 1), complex(inf, inf)},
+ Test{complex(-inf, 1), complex(-1, -1), complex(inf, -inf)},
+ Test{complex(-inf, 1), complex(-1, 2), complex(inf, inf)},
+ Test{complex(-inf, 1), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-inf, 1), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(-inf, 1), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(-inf, 1), complex(2, 0), complex(-inf, -nan)},
+ Test{complex(-inf, 1), complex(2, 1), complex(-inf, inf)},
+ Test{complex(-inf, 1), complex(2, -1), complex(-inf, -inf)},
+ Test{complex(-inf, 1), complex(2, 2), complex(-inf, inf)},
+ Test{complex(-inf, 1), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-inf, 1), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(-inf, 1), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(-inf, 1), complex(nan, 0), complex(nan, nan)},
+ Test{complex(-inf, 1), complex(nan, 1), complex(nan, nan)},
+ Test{complex(-inf, 1), complex(nan, -1), complex(nan, nan)},
+ Test{complex(-inf, 1), complex(nan, 2), complex(nan, nan)},
+ Test{complex(-inf, 1), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-inf, 1), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(-inf, 1), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(-inf, 1), complex(inf, 0), complex(-nan, -nan)},
+ Test{complex(-inf, 1), complex(inf, 1), complex(-nan, -nan)},
+ Test{complex(-inf, 1), complex(inf, -1), complex(-nan, -nan)},
+ Test{complex(-inf, 1), complex(inf, 2), complex(-nan, -nan)},
+ Test{complex(-inf, 1), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-inf, 1), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(-inf, 1), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(-inf, 1), complex(-inf, 0), complex(-nan, -nan)},
+ Test{complex(-inf, 1), complex(-inf, 1), complex(-nan, -nan)},
+ Test{complex(-inf, 1), complex(-inf, -1), complex(-nan, -nan)},
+ Test{complex(-inf, 1), complex(-inf, 2), complex(-nan, -nan)},
+ Test{complex(-inf, 1), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-inf, 1), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(-inf, 1), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(-inf, -1), complex(0, 0), complex(-inf, -inf)},
+ Test{complex(-inf, -1), complex(0, 1), complex(-nan, inf)},
+ Test{complex(-inf, -1), complex(0, -1), complex(-nan, -inf)},
+ Test{complex(-inf, -1), complex(0, 2), complex(-nan, inf)},
+ Test{complex(-inf, -1), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-inf, -1), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(-inf, -1), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(-inf, -1), complex(1, 0), complex(-inf, -nan)},
+ Test{complex(-inf, -1), complex(1, 1), complex(-inf, inf)},
+ Test{complex(-inf, -1), complex(1, -1), complex(-inf, -inf)},
+ Test{complex(-inf, -1), complex(1, 2), complex(-inf, inf)},
+ Test{complex(-inf, -1), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-inf, -1), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(-inf, -1), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(-inf, -1), complex(-1, 0), complex(inf, -nan)},
+ Test{complex(-inf, -1), complex(-1, 1), complex(inf, inf)},
+ Test{complex(-inf, -1), complex(-1, -1), complex(inf, -inf)},
+ Test{complex(-inf, -1), complex(-1, 2), complex(inf, inf)},
+ Test{complex(-inf, -1), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-inf, -1), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(-inf, -1), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(-inf, -1), complex(2, 0), complex(-inf, -nan)},
+ Test{complex(-inf, -1), complex(2, 1), complex(-inf, inf)},
+ Test{complex(-inf, -1), complex(2, -1), complex(-inf, -inf)},
+ Test{complex(-inf, -1), complex(2, 2), complex(-inf, inf)},
+ Test{complex(-inf, -1), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-inf, -1), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(-inf, -1), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(-inf, -1), complex(nan, 0), complex(nan, nan)},
+ Test{complex(-inf, -1), complex(nan, 1), complex(nan, nan)},
+ Test{complex(-inf, -1), complex(nan, -1), complex(nan, nan)},
+ Test{complex(-inf, -1), complex(nan, 2), complex(nan, nan)},
+ Test{complex(-inf, -1), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-inf, -1), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(-inf, -1), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(-inf, -1), complex(inf, 0), complex(-nan, -nan)},
+ Test{complex(-inf, -1), complex(inf, 1), complex(-nan, -nan)},
+ Test{complex(-inf, -1), complex(inf, -1), complex(-nan, -nan)},
+ Test{complex(-inf, -1), complex(inf, 2), complex(-nan, -nan)},
+ Test{complex(-inf, -1), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-inf, -1), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(-inf, -1), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(-inf, -1), complex(-inf, 0), complex(-nan, -nan)},
+ Test{complex(-inf, -1), complex(-inf, 1), complex(-nan, -nan)},
+ Test{complex(-inf, -1), complex(-inf, -1), complex(-nan, -nan)},
+ Test{complex(-inf, -1), complex(-inf, 2), complex(-nan, -nan)},
+ Test{complex(-inf, -1), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-inf, -1), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(-inf, -1), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(-inf, 2), complex(0, 0), complex(-inf, inf)},
+ Test{complex(-inf, 2), complex(0, 1), complex(-nan, inf)},
+ Test{complex(-inf, 2), complex(0, -1), complex(-nan, -inf)},
+ Test{complex(-inf, 2), complex(0, 2), complex(-nan, inf)},
+ Test{complex(-inf, 2), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-inf, 2), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(-inf, 2), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(-inf, 2), complex(1, 0), complex(-inf, -nan)},
+ Test{complex(-inf, 2), complex(1, 1), complex(-inf, inf)},
+ Test{complex(-inf, 2), complex(1, -1), complex(-inf, -inf)},
+ Test{complex(-inf, 2), complex(1, 2), complex(-inf, inf)},
+ Test{complex(-inf, 2), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-inf, 2), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(-inf, 2), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(-inf, 2), complex(-1, 0), complex(inf, -nan)},
+ Test{complex(-inf, 2), complex(-1, 1), complex(inf, inf)},
+ Test{complex(-inf, 2), complex(-1, -1), complex(inf, -inf)},
+ Test{complex(-inf, 2), complex(-1, 2), complex(inf, inf)},
+ Test{complex(-inf, 2), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-inf, 2), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(-inf, 2), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(-inf, 2), complex(2, 0), complex(-inf, -nan)},
+ Test{complex(-inf, 2), complex(2, 1), complex(-inf, inf)},
+ Test{complex(-inf, 2), complex(2, -1), complex(-inf, -inf)},
+ Test{complex(-inf, 2), complex(2, 2), complex(-inf, inf)},
+ Test{complex(-inf, 2), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-inf, 2), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(-inf, 2), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(-inf, 2), complex(nan, 0), complex(nan, nan)},
+ Test{complex(-inf, 2), complex(nan, 1), complex(nan, nan)},
+ Test{complex(-inf, 2), complex(nan, -1), complex(nan, nan)},
+ Test{complex(-inf, 2), complex(nan, 2), complex(nan, nan)},
+ Test{complex(-inf, 2), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-inf, 2), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(-inf, 2), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(-inf, 2), complex(inf, 0), complex(-nan, -nan)},
+ Test{complex(-inf, 2), complex(inf, 1), complex(-nan, -nan)},
+ Test{complex(-inf, 2), complex(inf, -1), complex(-nan, -nan)},
+ Test{complex(-inf, 2), complex(inf, 2), complex(-nan, -nan)},
+ Test{complex(-inf, 2), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-inf, 2), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(-inf, 2), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(-inf, 2), complex(-inf, 0), complex(-nan, -nan)},
+ Test{complex(-inf, 2), complex(-inf, 1), complex(-nan, -nan)},
+ Test{complex(-inf, 2), complex(-inf, -1), complex(-nan, -nan)},
+ Test{complex(-inf, 2), complex(-inf, 2), complex(-nan, -nan)},
+ Test{complex(-inf, 2), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-inf, 2), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(-inf, 2), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(nan, nan), complex(0, 0), complex(nan, nan)},
+ Test{complex(nan, nan), complex(0, 1), complex(nan, nan)},
+ Test{complex(nan, nan), complex(0, -1), complex(nan, nan)},
+ Test{complex(nan, nan), complex(0, 2), complex(nan, nan)},
+ Test{complex(nan, nan), complex(nan, nan), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-nan, inf), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-nan, -inf), complex(nan, nan)},
+ Test{complex(nan, nan), complex(1, 0), complex(nan, nan)},
+ Test{complex(nan, nan), complex(1, 1), complex(nan, nan)},
+ Test{complex(nan, nan), complex(1, -1), complex(nan, nan)},
+ Test{complex(nan, nan), complex(1, 2), complex(nan, nan)},
+ Test{complex(nan, nan), complex(nan, nan), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-nan, inf), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-nan, -inf), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-1, 0), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-1, 1), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-1, -1), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-1, 2), complex(nan, nan)},
+ Test{complex(nan, nan), complex(nan, nan), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-nan, inf), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-nan, -inf), complex(nan, nan)},
+ Test{complex(nan, nan), complex(2, 0), complex(nan, nan)},
+ Test{complex(nan, nan), complex(2, 1), complex(nan, nan)},
+ Test{complex(nan, nan), complex(2, -1), complex(nan, nan)},
+ Test{complex(nan, nan), complex(2, 2), complex(nan, nan)},
+ Test{complex(nan, nan), complex(nan, nan), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-nan, inf), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-nan, -inf), complex(nan, nan)},
+ Test{complex(nan, nan), complex(nan, 0), complex(nan, nan)},
+ Test{complex(nan, nan), complex(nan, 1), complex(nan, nan)},
+ Test{complex(nan, nan), complex(nan, -1), complex(nan, nan)},
+ Test{complex(nan, nan), complex(nan, 2), complex(nan, nan)},
+ Test{complex(nan, nan), complex(nan, nan), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-nan, inf), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-nan, -inf), complex(nan, nan)},
+ Test{complex(nan, nan), complex(inf, 0), complex(nan, nan)},
+ Test{complex(nan, nan), complex(inf, 1), complex(nan, nan)},
+ Test{complex(nan, nan), complex(inf, -1), complex(nan, nan)},
+ Test{complex(nan, nan), complex(inf, 2), complex(nan, nan)},
+ Test{complex(nan, nan), complex(nan, nan), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-nan, inf), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-nan, -inf), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-inf, 0), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-inf, 1), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-inf, -1), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-inf, 2), complex(nan, nan)},
+ Test{complex(nan, nan), complex(nan, nan), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-nan, inf), complex(nan, nan)},
+ Test{complex(nan, nan), complex(-nan, -inf), complex(nan, nan)},
+ Test{complex(-nan, inf), complex(0, 0), complex(-nan, inf)},
+ Test{complex(-nan, inf), complex(0, 1), complex(inf, -nan)},
+ Test{complex(-nan, inf), complex(0, -1), complex(-inf, -nan)},
+ Test{complex(-nan, inf), complex(0, 2), complex(inf, -nan)},
+ Test{complex(-nan, inf), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-nan, inf), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(1, 0), complex(-nan, inf)},
+ Test{complex(-nan, inf), complex(1, 1), complex(inf, inf)},
+ Test{complex(-nan, inf), complex(1, -1), complex(-inf, inf)},
+ Test{complex(-nan, inf), complex(1, 2), complex(inf, inf)},
+ Test{complex(-nan, inf), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-nan, inf), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(-1, 0), complex(-nan, -inf)},
+ Test{complex(-nan, inf), complex(-1, 1), complex(inf, -inf)},
+ Test{complex(-nan, inf), complex(-1, -1), complex(-inf, -inf)},
+ Test{complex(-nan, inf), complex(-1, 2), complex(inf, -inf)},
+ Test{complex(-nan, inf), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-nan, inf), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(2, 0), complex(-nan, inf)},
+ Test{complex(-nan, inf), complex(2, 1), complex(inf, inf)},
+ Test{complex(-nan, inf), complex(2, -1), complex(-inf, inf)},
+ Test{complex(-nan, inf), complex(2, 2), complex(inf, inf)},
+ Test{complex(-nan, inf), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-nan, inf), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(nan, 0), complex(nan, nan)},
+ Test{complex(-nan, inf), complex(nan, 1), complex(nan, nan)},
+ Test{complex(-nan, inf), complex(nan, -1), complex(nan, nan)},
+ Test{complex(-nan, inf), complex(nan, 2), complex(nan, nan)},
+ Test{complex(-nan, inf), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-nan, inf), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(inf, 0), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(inf, 1), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(inf, -1), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(inf, 2), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-nan, inf), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(-inf, 0), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(-inf, 1), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(-inf, -1), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(-inf, 2), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-nan, inf), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(-nan, inf), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(0, 0), complex(-nan, -inf)},
+ Test{complex(-nan, -inf), complex(0, 1), complex(-inf, -nan)},
+ Test{complex(-nan, -inf), complex(0, -1), complex(inf, -nan)},
+ Test{complex(-nan, -inf), complex(0, 2), complex(-inf, -nan)},
+ Test{complex(-nan, -inf), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-nan, -inf), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(1, 0), complex(-nan, -inf)},
+ Test{complex(-nan, -inf), complex(1, 1), complex(-inf, -inf)},
+ Test{complex(-nan, -inf), complex(1, -1), complex(inf, -inf)},
+ Test{complex(-nan, -inf), complex(1, 2), complex(-inf, -inf)},
+ Test{complex(-nan, -inf), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-nan, -inf), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(-1, 0), complex(-nan, inf)},
+ Test{complex(-nan, -inf), complex(-1, 1), complex(-inf, inf)},
+ Test{complex(-nan, -inf), complex(-1, -1), complex(inf, inf)},
+ Test{complex(-nan, -inf), complex(-1, 2), complex(-inf, inf)},
+ Test{complex(-nan, -inf), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-nan, -inf), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(2, 0), complex(-nan, -inf)},
+ Test{complex(-nan, -inf), complex(2, 1), complex(-inf, -inf)},
+ Test{complex(-nan, -inf), complex(2, -1), complex(inf, -inf)},
+ Test{complex(-nan, -inf), complex(2, 2), complex(-inf, -inf)},
+ Test{complex(-nan, -inf), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-nan, -inf), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(nan, 0), complex(nan, nan)},
+ Test{complex(-nan, -inf), complex(nan, 1), complex(nan, nan)},
+ Test{complex(-nan, -inf), complex(nan, -1), complex(nan, nan)},
+ Test{complex(-nan, -inf), complex(nan, 2), complex(nan, nan)},
+ Test{complex(-nan, -inf), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-nan, -inf), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(inf, 0), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(inf, 1), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(inf, -1), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(inf, 2), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-nan, -inf), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(-nan, -inf), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(-inf, 0), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(-inf, 1), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(-inf, -1), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(-inf, 2), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(nan, nan), complex(nan, nan)},
+ Test{complex(-nan, -inf), complex(-nan, inf), complex(-nan, -nan)},
+ Test{complex(-nan, -inf), complex(-nan, -inf), complex(-nan, -nan)},
}
diff --git a/gcc/testsuite/go.test/test/complit.go b/gcc/testsuite/go.test/test/complit.go
index f3b7c9abe71..f5f7aca9d90 100644
--- a/gcc/testsuite/go.test/test/complit.go
+++ b/gcc/testsuite/go.test/test/complit.go
@@ -6,9 +6,16 @@
package main
-type T struct { i int; f float; s string; next *T }
+type T struct {
+ i int
+ f float64
+ s string
+ next *T
+}
-type R struct { num int }
+type R struct {
+ num int
+}
func itor(a int) *R {
r := new(R)
@@ -18,11 +25,16 @@ func itor(a int) *R {
func eq(a []*R) {
for i := 0; i < len(a); i++ {
- if a[i].num != i { panic("bad") }
+ if a[i].num != i {
+ panic("bad")
+ }
}
}
-type P struct { a, b int }
+type P struct {
+ a, b int
+}
+
func NewP(a, b int) *P {
return &P{a, b}
}
@@ -34,37 +46,57 @@ func main() {
var tp *T
tp = &T{0, 7.2, "hi", &t}
- a1 := []int{1,2,3}
- if len(a1) != 3 { panic("a1") }
- a2 := [10]int{1,2,3}
- if len(a2) != 10 || cap(a2) != 10 { panic("a2") }
+ a1 := []int{1, 2, 3}
+ if len(a1) != 3 {
+ panic("a1")
+ }
+ a2 := [10]int{1, 2, 3}
+ if len(a2) != 10 || cap(a2) != 10 {
+ panic("a2")
+ }
- a3 := [10]int{1,2,3,}
- if len(a3) != 10 || a2[3] != 0 { panic("a3") }
+ a3 := [10]int{1, 2, 3}
+ if len(a3) != 10 || a2[3] != 0 {
+ panic("a3")
+ }
var oai []int
- oai = []int{1,2,3}
- if len(oai) != 3 { panic("oai") }
+ oai = []int{1, 2, 3}
+ if len(oai) != 3 {
+ panic("oai")
+ }
at := [...]*T{&t, tp, &t}
- if len(at) != 3 { panic("at") }
+ if len(at) != 3 {
+ panic("at")
+ }
c := make(chan int)
ac := []chan int{c, c, c}
- if len(ac) != 3 { panic("ac") }
+ if len(ac) != 3 {
+ panic("ac")
+ }
aat := [][len(at)]*T{at, at}
- if len(aat) != 2 || len(aat[1]) != 3 { panic("aat") }
+ if len(aat) != 2 || len(aat[1]) != 3 {
+ panic("aat")
+ }
s := string([]byte{'h', 'e', 'l', 'l', 'o'})
- if s != "hello" { panic("s") }
+ if s != "hello" {
+ panic("s")
+ }
- m := map[string]float{"one":1.0, "two":2.0, "pi":22./7.}
- if len(m) != 3 { panic("m") }
+ m := map[string]float64{"one": 1.0, "two": 2.0, "pi": 22. / 7.}
+ if len(m) != 3 {
+ panic("m")
+ }
eq([]*R{itor(0), itor(1), itor(2), itor(3), itor(4), itor(5)})
p1 := NewP(1, 2)
p2 := NewP(1, 2)
- if p1 == p2 { panic("NewP") }
+ if p1 == p2 {
+ panic("NewP")
+ }
}
diff --git a/gcc/testsuite/go.test/test/const1.go b/gcc/testsuite/go.test/test/const1.go
index 427d61e59c3..6cfcb460b50 100644
--- a/gcc/testsuite/go.test/test/const1.go
+++ b/gcc/testsuite/go.test/test/const1.go
@@ -6,74 +6,75 @@
package main
-type I interface {}
+type I interface{}
+
const (
// assume all types behave similarly to int8/uint8
- Int8 int8 = 101
- Minus1 int8 = -1
- Uint8 uint8 = 102
- Const = 103
+ Int8 int8 = 101
+ Minus1 int8 = -1
+ Uint8 uint8 = 102
+ Const = 103
- Float32 float32 = 104.5
- Float float = 105.5
+ Float32 float32 = 104.5
+ Float64 float64 = 105.5
ConstFloat = 106.5
- Big float64 = 1e300
+ Big float64 = 1e300
String = "abc"
- Bool = true
+ Bool = true
)
var (
- a1 = Int8 * 100 // ERROR "overflow"
- a2 = Int8 * -1 // OK
- a3 = Int8 * 1000 // ERROR "overflow"
- a4 = Int8 * int8(1000) // ERROR "overflow"
- a5 = int8(Int8 * 1000) // ERROR "overflow"
- a6 = int8(Int8 * int8(1000)) // ERROR "overflow"
- a7 = Int8 - 2*Int8 - 2*Int8 // ERROR "overflow"
- a8 = Int8 * Const / 100 // ERROR "overflow"
- a9 = Int8 * (Const / 100) // OK
+ a1 = Int8 * 100 // ERROR "overflow"
+ a2 = Int8 * -1 // OK
+ a3 = Int8 * 1000 // ERROR "overflow"
+ a4 = Int8 * int8(1000) // ERROR "overflow"
+ a5 = int8(Int8 * 1000) // ERROR "overflow"
+ a6 = int8(Int8 * int8(1000)) // ERROR "overflow"
+ a7 = Int8 - 2*Int8 - 2*Int8 // ERROR "overflow"
+ a8 = Int8 * Const / 100 // ERROR "overflow"
+ a9 = Int8 * (Const / 100) // OK
- b1 = Uint8 * Uint8 // ERROR "overflow"
- b2 = Uint8 * -1 // ERROR "overflow"
- b3 = Uint8 - Uint8 // OK
- b4 = Uint8 - Uint8 - Uint8 // ERROR "overflow"
- b5 = uint8(^0) // ERROR "overflow"
- b6 = ^uint8(0) // OK
- b7 = uint8(Minus1) // ERROR "overflow"
- b8 = uint8(int8(-1)) // ERROR "overflow"
- b8a = uint8(-1) // ERROR "overflow"
- b9 byte = (1<<10) >> 8 // OK
- b10 byte = (1<<10) // ERROR "overflow"
- b11 byte = (byte(1)<<10) >> 8 // ERROR "overflow"
- b12 byte = 1000 // ERROR "overflow"
- b13 byte = byte(1000) // ERROR "overflow"
- b14 byte = byte(100) * byte(100) // ERROR "overflow"
- b15 byte = byte(100) * 100 // ERROR "overflow"
- b16 byte = byte(0) * 1000 // ERROR "overflow"
- b16a byte = 0 * 1000 // OK
- b17 byte = byte(0) * byte(1000) // ERROR "overflow"
- b18 byte = Uint8/0 // ERROR "division by zero"
+ b1 = Uint8 * Uint8 // ERROR "overflow"
+ b2 = Uint8 * -1 // ERROR "overflow"
+ b3 = Uint8 - Uint8 // OK
+ b4 = Uint8 - Uint8 - Uint8 // ERROR "overflow"
+ b5 = uint8(^0) // ERROR "overflow"
+ b6 = ^uint8(0) // OK
+ b7 = uint8(Minus1) // ERROR "overflow"
+ b8 = uint8(int8(-1)) // ERROR "overflow"
+ b8a = uint8(-1) // ERROR "overflow"
+ b9 byte = (1 << 10) >> 8 // OK
+ b10 byte = (1 << 10) // ERROR "overflow"
+ b11 byte = (byte(1) << 10) >> 8 // ERROR "overflow"
+ b12 byte = 1000 // ERROR "overflow"
+ b13 byte = byte(1000) // ERROR "overflow"
+ b14 byte = byte(100) * byte(100) // ERROR "overflow"
+ b15 byte = byte(100) * 100 // ERROR "overflow"
+ b16 byte = byte(0) * 1000 // ERROR "overflow"
+ b16a byte = 0 * 1000 // OK
+ b17 byte = byte(0) * byte(1000) // ERROR "overflow"
+ b18 byte = Uint8 / 0 // ERROR "division by zero"
- c1 float64 = Big
- c2 float64 = Big*Big // ERROR "overflow"
- c3 float64 = float64(Big)*Big // ERROR "overflow"
- c4 = Big*Big // ERROR "overflow"
- c5 = Big/0 // ERROR "division by zero"
+ c1 float64 = Big
+ c2 float64 = Big * Big // ERROR "overflow"
+ c3 float64 = float64(Big) * Big // ERROR "overflow"
+ c4 = Big * Big // ERROR "overflow"
+ c5 = Big / 0 // ERROR "division by zero"
)
func f(int)
func main() {
- f(Int8) // ERROR "convert|wrong type|cannot"
- f(Minus1) // ERROR "convert|wrong type|cannot"
- f(Uint8) // ERROR "convert|wrong type|cannot"
- f(Const) // OK
- f(Float32) // ERROR "convert|wrong type|cannot"
- f(Float) // ERROR "convert|wrong type|cannot"
- f(ConstFloat) // ERROR "truncate"
- f(ConstFloat - 0.5) // OK
- f(Big) // ERROR "convert|wrong type|cannot"
- f(String) // ERROR "convert|wrong type|cannot|incompatible"
- f(Bool) // ERROR "convert|wrong type|cannot|incompatible"
+ f(Int8) // ERROR "convert|wrong type|cannot"
+ f(Minus1) // ERROR "convert|wrong type|cannot"
+ f(Uint8) // ERROR "convert|wrong type|cannot"
+ f(Const) // OK
+ f(Float32) // ERROR "convert|wrong type|cannot"
+ f(Float64) // ERROR "convert|wrong type|cannot"
+ f(ConstFloat) // ERROR "truncate"
+ f(ConstFloat - 0.5) // OK
+ f(Big) // ERROR "convert|wrong type|cannot"
+ f(String) // ERROR "convert|wrong type|cannot|incompatible"
+ f(Bool) // ERROR "convert|wrong type|cannot|incompatible"
}
diff --git a/gcc/testsuite/go.test/test/convlit.go b/gcc/testsuite/go.test/test/convlit.go
index 94889d4a963..90ac5490c84 100644
--- a/gcc/testsuite/go.test/test/convlit.go
+++ b/gcc/testsuite/go.test/test/convlit.go
@@ -11,54 +11,56 @@ package main
// the language spec says for now.
var x1 = string(1)
var x2 string = string(1)
-var x3 = int(1.5) // ERROR "convert|truncate"
-var x4 int = int(1.5) // ERROR "convert|truncate"
+var x3 = int(1.5) // ERROR "convert|truncate"
+var x4 int = int(1.5) // ERROR "convert|truncate"
var x5 = "a" + string(1)
-var x6 = int(1e100) // ERROR "overflow"
-var x7 = float(1e1000) // ERROR "overflow"
+var x6 = int(1e100) // ERROR "overflow"
+var x7 = float32(1e1000) // ERROR "overflow"
// implicit conversions merit scrutiny
var s string
-var bad1 string = 1 // ERROR "conver|incompatible|invalid|cannot"
-var bad2 = s + 1 // ERROR "conver|incompatible|invalid"
-var bad3 = s + 'a' // ERROR "conver|incompatible|invalid"
-var bad4 = "a" + 1 // ERROR "literals|incompatible|convert|invalid"
-var bad5 = "a" + 'a' // ERROR "literals|incompatible|convert|invalid"
+var bad1 string = 1 // ERROR "conver|incompatible|invalid|cannot"
+var bad2 = s + 1 // ERROR "conver|incompatible|invalid"
+var bad3 = s + 'a' // ERROR "conver|incompatible|invalid"
+var bad4 = "a" + 1 // ERROR "literals|incompatible|convert|invalid"
+var bad5 = "a" + 'a' // ERROR "literals|incompatible|convert|invalid"
-var bad6 int = 1.5 // ERROR "convert|truncate"
-var bad7 int = 1e100 // ERROR "overflow"
-var bad8 float32 = 1e200 // ERROR "overflow"
+var bad6 int = 1.5 // ERROR "convert|truncate"
+var bad7 int = 1e100 // ERROR "overflow"
+var bad8 float32 = 1e200 // ERROR "overflow"
// but these implicit conversions are okay
var good1 string = "a"
var good2 int = 1.0
var good3 int = 1e9
-var good4 float = 1e20
+var good4 float64 = 1e20
// explicit conversion of string is okay
var _ = []int("abc")
var _ = []byte("abc")
// implicit is not
-var _ []int = "abc" // ERROR "cannot use|incompatible|invalid"
-var _ []byte = "abc" // ERROR "cannot use|incompatible|invalid"
+var _ []int = "abc" // ERROR "cannot use|incompatible|invalid"
+var _ []byte = "abc" // ERROR "cannot use|incompatible|invalid"
// named string is okay
type Tstring string
+
var ss Tstring = "abc"
var _ = []int(ss)
var _ = []byte(ss)
// implicit is still not
-var _ []int = ss // ERROR "cannot use|incompatible|invalid"
-var _ []byte = ss // ERROR "cannot use|incompatible|invalid"
+var _ []int = ss // ERROR "cannot use|incompatible|invalid"
+var _ []byte = ss // ERROR "cannot use|incompatible|invalid"
// named slice is not
type Tint []int
type Tbyte []byte
-var _ = Tint("abc") // ERROR "convert|incompatible|invalid"
-var _ = Tbyte("abc") // ERROR "convert|incompatible|invalid"
+
+var _ = Tint("abc") // ERROR "convert|incompatible|invalid"
+var _ = Tbyte("abc") // ERROR "convert|incompatible|invalid"
// implicit is still not
-var _ Tint = "abc" // ERROR "cannot use|incompatible|invalid"
-var _ Tbyte = "abc" // ERROR "cannot use|incompatible|invalid"
+var _ Tint = "abc" // ERROR "cannot use|incompatible|invalid"
+var _ Tbyte = "abc" // ERROR "cannot use|incompatible|invalid"
diff --git a/gcc/testsuite/go.test/test/ddd.go b/gcc/testsuite/go.test/test/ddd.go
index c9949c36e20..b95d6e883f9 100644
--- a/gcc/testsuite/go.test/test/ddd.go
+++ b/gcc/testsuite/go.test/test/ddd.go
@@ -14,13 +14,13 @@ func sum(args ...int) int {
return s
}
-func sumC(args ...int) int { return func() int { return sum(args) }() }
+func sumC(args ...int) int { return func() int { return sum(args...) }() }
-var sumD = func(args ...int) int { return sum(args) }
+var sumD = func(args ...int) int { return sum(args...) }
-var sumE = func() func(...int) int { return func(args ...int) int { return sum(args) } }()
+var sumE = func() func(...int) int { return func(args ...int) int { return sum(args...) } }()
-var sumF = func(args ...int) func() int { return func() int { return sum(args) } }
+var sumF = func(args ...int) func() int { return func() int { return sum(args...) } }
func sumA(args []int) int {
s := 0
@@ -30,10 +30,14 @@ func sumA(args []int) int {
return s
}
-func sum2(args ...int) int { return 2 * sum(args) }
+func sumB(args []int) int { return sum(args...) }
+
+func sum2(args ...int) int { return 2 * sum(args...) }
func sum3(args ...int) int { return 3 * sumA(args) }
+func sum4(args ...int) int { return 4 * sumB(args) }
+
func intersum(args ...interface{}) int {
s := 0
for _, v := range args {
@@ -46,9 +50,9 @@ type T []T
func ln(args ...T) int { return len(args) }
-func ln2(args ...T) int { return 2 * ln(args) }
+func ln2(args ...T) int { return 2 * ln(args...) }
-func (*T) Sum(args ...int) int { return sum(args) }
+func (*T) Sum(args ...int) int { return sum(args...) }
type U struct {
*T
@@ -119,6 +123,22 @@ func main() {
println("sum 9", x)
panic("fail")
}
+ if x := sum4(1, 2, 3); x != 4*6 {
+ println("sum 6", x)
+ panic("fail")
+ }
+ if x := sum4(); x != 4*0 {
+ println("sum 0", x)
+ panic("fail")
+ }
+ if x := sum4(10); x != 4*10 {
+ println("sum 10", x)
+ panic("fail")
+ }
+ if x := sum4(1, 8); x != 4*9 {
+ println("sum 9", x)
+ panic("fail")
+ }
if x := intersum(1, 2, 3); x != 6 {
println("intersum 6", x)
panic("fail")
diff --git a/gcc/testsuite/go.test/test/decl.go b/gcc/testsuite/go.test/test/decl.go
index c31082bcfdc..95b6346c3ed 100644
--- a/gcc/testsuite/go.test/test/decl.go
+++ b/gcc/testsuite/go.test/test/decl.go
@@ -8,26 +8,26 @@
package main
-func f1() int { return 1 }
-func f2() (float, int) { return 1, 2 }
-func f3() (float, int, string) { return 1, 2, "3" }
+func f1() int { return 1 }
+func f2() (float32, int) { return 1, 2 }
+func f3() (float32, int, string) { return 1, 2, "3" }
func x() (s string) {
a, b, s := f3()
_, _ = a, b
- return // tests that result var is in scope for redeclaration
+ return // tests that result var is in scope for redeclaration
}
func main() {
i, f, s := f3()
- j, f := f2() // redeclare f
+ j, f := f2() // redeclare f
k := f1()
m, g, s := f3()
m, h, s := f3()
{
// new block should be ok.
i, f, s := f3()
- j, f := f2() // redeclare f
+ j, f := f2() // redeclare f
k := f1()
m, g, s := f3()
m, h, s := f3()
diff --git a/gcc/testsuite/go.test/test/declbad.go b/gcc/testsuite/go.test/test/declbad.go
index 269ebdefb53..5e5e1450110 100644
--- a/gcc/testsuite/go.test/test/declbad.go
+++ b/gcc/testsuite/go.test/test/declbad.go
@@ -8,51 +8,51 @@
package main
-func f1() int { return 1 }
-func f2() (float, int) { return 1, 2 }
-func f3() (float, int, string) { return 1, 2, "3" }
+func f1() int { return 1 }
+func f2() (float32, int) { return 1, 2 }
+func f3() (float32, int, string) { return 1, 2, "3" }
func main() {
{
// simple redeclaration
i := f1()
- i := f1() // ERROR "redeclared|no new"
+ i := f1() // ERROR "redeclared|no new"
_ = i
}
{
// change of type for f
i, f, s := f3()
- f, g, t := f3() // ERROR "redeclared|cannot assign|incompatible"
+ f, g, t := f3() // ERROR "redeclared|cannot assign|incompatible"
_, _, _, _, _ = i, f, s, g, t
}
{
// change of type for i
i, f, s := f3()
- j, i, t := f3() // ERROR "redeclared|cannot assign|incompatible"
+ j, i, t := f3() // ERROR "redeclared|cannot assign|incompatible"
_, _, _, _, _ = i, f, s, j, t
}
{
// no new variables
i, f, s := f3()
- i, f := f2() // ERROR "redeclared|no new"
+ i, f := f2() // ERROR "redeclared|no new"
_, _, _ = i, f, s
}
{
// single redeclaration
i, f, s := f3()
- i := f1() // ERROR "redeclared|no new|incompatible"
+ i := f1() // ERROR "redeclared|no new|incompatible"
_, _, _ = i, f, s
}
- // double redeclaration
+ // double redeclaration
{
i, f, s := f3()
- i, f := f2() // ERROR "redeclared|no new"
+ i, f := f2() // ERROR "redeclared|no new"
_, _, _ = i, f, s
}
{
// triple redeclaration
i, f, s := f3()
- i, f, s := f3() // ERROR "redeclared|no new"
+ i, f, s := f3() // ERROR "redeclared|no new"
_, _, _ = i, f, s
}
}
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug006.go b/gcc/testsuite/go.test/test/fixedbugs/bug006.go
index e7694f95b56..43b5dfb1294 100644
--- a/gcc/testsuite/go.test/test/fixedbugs/bug006.go
+++ b/gcc/testsuite/go.test/test/fixedbugs/bug006.go
@@ -9,11 +9,16 @@ package main
import "os"
const (
- x float = iota;
- g float = 4.5 * iota;
-);
+ x float64 = iota
+ g float64 = 4.5 * iota
+)
func main() {
- if g == 0.0 { print("zero\n");}
- if g != 4.5 { print(" fail\n"); os.Exit(1); }
+ if g == 0.0 {
+ print("zero\n")
+ }
+ if g != 4.5 {
+ print(" fail\n")
+ os.Exit(1)
+ }
}
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug007.go b/gcc/testsuite/go.test/test/fixedbugs/bug007.go
index bd970de5f92..d65f6da4503 100644
--- a/gcc/testsuite/go.test/test/fixedbugs/bug007.go
+++ b/gcc/testsuite/go.test/test/fixedbugs/bug007.go
@@ -7,7 +7,9 @@
package main
type (
- Point struct { x, y float };
+ Point struct {
+ x, y float64
+ }
Polar Point
)
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug010.go b/gcc/testsuite/go.test/test/fixedbugs/bug010.go
index e71c4d7f0bc..7d96988d43b 100644
--- a/gcc/testsuite/go.test/test/fixedbugs/bug010.go
+++ b/gcc/testsuite/go.test/test/fixedbugs/bug010.go
@@ -7,14 +7,14 @@
package main
-func f(i int, f float) {
- i = 8;
- f = 8.0;
- return;
+func f(i int, f float64) {
+ i = 8
+ f = 8.0
+ return
}
func main() {
- f(3, float(5))
+ f(3, float64(5))
}
/*
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug011.go b/gcc/testsuite/go.test/test/fixedbugs/bug011.go
index 551adb77dfc..ce627472c47 100644
--- a/gcc/testsuite/go.test/test/fixedbugs/bug011.go
+++ b/gcc/testsuite/go.test/test/fixedbugs/bug011.go
@@ -8,19 +8,19 @@ package main
type T struct {
- x, y int;
+ x, y int
}
-func (t *T) m(a int, b float) int {
- return (t.x+a) * (t.y+int(b));
+func (t *T) m(a int, b float64) int {
+ return (t.x + a) * (t.y + int(b))
}
func main() {
- var t *T = new(T);
- t.x = 1;
- t.y = 2;
- r10 := t.m(1, 3.0);
- _ = r10;
+ var t *T = new(T)
+ t.x = 1
+ t.y = 2
+ r10 := t.m(1, 3.0)
+ _ = r10
}
/*
bug11.go:16: fatal error: walktype: switch 1 unknown op CALLMETH l(16) <int32>INT32
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug035.go b/gcc/testsuite/go.test/test/fixedbugs/bug035.go
index 461c0607ac9..bd2a633f298 100644
--- a/gcc/testsuite/go.test/test/fixedbugs/bug035.go
+++ b/gcc/testsuite/go.test/test/fixedbugs/bug035.go
@@ -6,8 +6,8 @@
package main
-func f9(a int) (i int, f float) {
- i := 9; // ERROR "redecl|no new"
- f := float(9); // ERROR "redecl|no new"
- return i, f;
+func f9(a int) (i int, f float64) {
+ i := 9 // ERROR "redecl|no new"
+ f := float64(9) // ERROR "redecl|no new"
+ return i, f
}
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug047.go b/gcc/testsuite/go.test/test/fixedbugs/bug047.go
index f3749e73972..5a776abce8d 100644
--- a/gcc/testsuite/go.test/test/fixedbugs/bug047.go
+++ b/gcc/testsuite/go.test/test/fixedbugs/bug047.go
@@ -9,15 +9,15 @@ package main
func main() {
type T struct {
- s string;
- f float;
- };
- var s string = "hello";
- var f float = 0.2;
- t := T{s, f};
+ s string
+ f float64
+ }
+ var s string = "hello"
+ var f float64 = 0.2
+ t := T{s, f}
- type M map[int] int;
- m0 := M{7:8};
+ type M map[int]int
+ m0 := M{7: 8}
- _, _ = t, m0;
+ _, _ = t, m0
}
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug080.go b/gcc/testsuite/go.test/test/fixedbugs/bug080.go
index a5003d29b1f..bae16cdb2e9 100644
--- a/gcc/testsuite/go.test/test/fixedbugs/bug080.go
+++ b/gcc/testsuite/go.test/test/fixedbugs/bug080.go
@@ -4,18 +4,18 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-package main
-
-func f1() (x int, y float) {
- return;
+package main
+
+func f1() (x int, y float64) {
+ return
}
-func f2 (x int, y float) {
- return;
+func f2(x int, y float64) {
+ return
}
func main() {
- f2(f1()); // this should be a legal call
+ f2(f1()) // this should be a legal call
}
/*
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug109.go b/gcc/testsuite/go.test/test/fixedbugs/bug109.go
index c679771f2ec..7666577230f 100644
--- a/gcc/testsuite/go.test/test/fixedbugs/bug109.go
+++ b/gcc/testsuite/go.test/test/fixedbugs/bug109.go
@@ -5,10 +5,11 @@
// license that can be found in the LICENSE file.
package main
-func f(a float) float {
- e := 1.0;
- e = e * a;
- return e;
+
+func f(a float64) float64 {
+ e := 1.0
+ e = e * a
+ return e
}
/*
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug167.go b/gcc/testsuite/go.test/test/fixedbugs/bug167.go
index 729299b6657..33eb3cb1a95 100644
--- a/gcc/testsuite/go.test/test/fixedbugs/bug167.go
+++ b/gcc/testsuite/go.test/test/fixedbugs/bug167.go
@@ -7,20 +7,24 @@
package main
func f1() {
- type T struct { x int }
+ type T struct {
+ x int
+ }
}
func f2() {
- type T struct { x float }
+ type T struct {
+ x float64
+ }
}
func main() {
- f1();
- f2();
+ f1()
+ f2()
}
/*
1606416576: conflicting definitions for main.T·bug167
bug167.6: type main.T·bug167 struct { x int }
-bug167.6: type main.T·bug167 struct { x float }
+bug167.6: type main.T·bug167 struct { x float64 }
*/
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug193.go b/gcc/testsuite/go.test/test/fixedbugs/bug193.go
index f6b03e13d2e..5ef02b1c1d7 100644
--- a/gcc/testsuite/go.test/test/fixedbugs/bug193.go
+++ b/gcc/testsuite/go.test/test/fixedbugs/bug193.go
@@ -7,10 +7,10 @@
package main
func main() {
- s := uint(10);
- ss := 1<<s;
- y1 := float(ss);
- y2 := float(1<<s); // ERROR "shift"
- y3 := string(1<<s); // ERROR "shift"
- _, _, _, _, _ = s, ss, y1, y2, y3;
+ s := uint(10)
+ ss := 1 << s
+ y1 := float64(ss)
+ y2 := float64(1 << s) // ERROR "shift"
+ y3 := string(1 << s) // ERROR "shift"
+ _, _, _, _, _ = s, ss, y1, y2, y3
}
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug206.go b/gcc/testsuite/go.test/test/fixedbugs/bug206.go
index 3879e8cbd57..7efc0b14afb 100644
--- a/gcc/testsuite/go.test/test/fixedbugs/bug206.go
+++ b/gcc/testsuite/go.test/test/fixedbugs/bug206.go
@@ -10,14 +10,14 @@ import "go/ast";
func g(list []ast.Expr) {
n := len(list)-1;
- println(list[n].Pos().Line);
+ println(list[n].Pos());
}
// f is the same as g except that the expression assigned to n is inlined.
func f(list []ast.Expr) {
// n := len(list)-1;
- println(list[len(list)-1 /* n */].Pos().Line);
+ println(list[len(list)-1 /* n */].Pos());
}
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug220.go b/gcc/testsuite/go.test/test/fixedbugs/bug220.go
index 3f8aaa4ece5..ff027ddc229 100644
--- a/gcc/testsuite/go.test/test/fixedbugs/bug220.go
+++ b/gcc/testsuite/go.test/test/fixedbugs/bug220.go
@@ -7,8 +7,8 @@
package main
func main() {
- m := make(map[int]map[uint]float);
-
- m[0] = make(map[uint]float), false; // 6g used to reject this
- m[1] = nil;
+ m := make(map[int]map[uint]float64)
+
+ m[0] = make(map[uint]float64), false // 6g used to reject this
+ m[1] = nil
}
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug230.go b/gcc/testsuite/go.test/test/fixedbugs/bug230.go
index 81b256e314a..c7ad1a3660c 100644
--- a/gcc/testsuite/go.test/test/fixedbugs/bug230.go
+++ b/gcc/testsuite/go.test/test/fixedbugs/bug230.go
@@ -8,14 +8,17 @@ package main
type S string
type I int
-type F float
+type F float64
func (S) m() {}
func (I) m() {}
func (F) m() {}
func main() {
- c := make(chan interface { m() }, 10)
+ c := make(chan interface {
+ m()
+ },
+ 10)
c <- I(0)
c <- F(1)
c <- S("hi")
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug238.go b/gcc/testsuite/go.test/test/fixedbugs/bug238.go
index 8b7c7ac3833..7e8660d37e4 100644
--- a/gcc/testsuite/go.test/test/fixedbugs/bug238.go
+++ b/gcc/testsuite/go.test/test/fixedbugs/bug238.go
@@ -17,6 +17,6 @@ const f struct{} = 6 // ERROR "convert|wrong|invalid"
const g interface{} = 7 // ERROR "constant|wrong|invalid"
const h bool = false
const i int = 2
-const j float = 5
+const j float64 = 5
func main() { println(a, b, c, d, e, f, g) }
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug248.dir/bug2.go b/gcc/testsuite/go.test/test/fixedbugs/bug248.dir/bug2.go
index 68c0ce0bc49..4ea187a4b12 100644
--- a/gcc/testsuite/go.test/test/fixedbugs/bug248.dir/bug2.go
+++ b/gcc/testsuite/go.test/test/fixedbugs/bug248.dir/bug2.go
@@ -23,7 +23,7 @@ type t0 int
func (t0) M(p0.T) {}
-type t1 float
+type t1 float64
func (t1) M(p1.T) {}
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug248.dir/bug3.go b/gcc/testsuite/go.test/test/fixedbugs/bug248.dir/bug3.go
index c96bf16768a..e5a24495577 100644
--- a/gcc/testsuite/go.test/test/fixedbugs/bug248.dir/bug3.go
+++ b/gcc/testsuite/go.test/test/fixedbugs/bug248.dir/bug3.go
@@ -26,7 +26,7 @@ type t0 int
func (t0) M(p0.T) {}
// t1 satisfies I1 and p1.I
-type t1 float
+type t1 float64
func (t1) M(p1.T) {}
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug252.go b/gcc/testsuite/go.test/test/fixedbugs/bug252.go
index bd11b86ebf6..6df94241a0c 100644
--- a/gcc/testsuite/go.test/test/fixedbugs/bug252.go
+++ b/gcc/testsuite/go.test/test/fixedbugs/bug252.go
@@ -7,9 +7,9 @@
package main
func f(args ...int) {
- g(args) // ERROR "[.][.][.] mismatch"
+ g(args)
}
func g(args ...interface{}) {
- f(args) // ERROR "[.][.][.] mismatch"
+ f(args) // ERROR "[.][.][.]|incompatible"
}
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug299.go b/gcc/testsuite/go.test/test/fixedbugs/bug299.go
index 4d731443227..1c7adb5f5b8 100644
--- a/gcc/testsuite/go.test/test/fixedbugs/bug299.go
+++ b/gcc/testsuite/go.test/test/fixedbugs/bug299.go
@@ -11,9 +11,9 @@ type T struct {
x int
y (int)
int
- *float
+ *float64
// not legal according to spec
- (complex) // ERROR "non-declaration|expected|parenthesize"
+ (complex128) // ERROR "non-declaration|expected|parenthesize"
(*string) // ERROR "non-declaration|expected|parenthesize"
*(bool) // ERROR "non-declaration|expected|parenthesize"
}
diff --git a/gcc/testsuite/go.test/test/func.go b/gcc/testsuite/go.test/test/func.go
index 0c1a07979df..e8ed928bcd3 100644
--- a/gcc/testsuite/go.test/test/func.go
+++ b/gcc/testsuite/go.test/test/func.go
@@ -21,10 +21,10 @@ func f2(a int) {
}
func f3(a, b int) int {
- return a+b
+ return a + b
}
-func f4(a, b int, c float) int {
+func f4(a, b int, c float32) int {
return (a+b)/2 + int(c)
}
@@ -36,12 +36,12 @@ func f6(a int) (r int) {
return 6
}
-func f7(a int) (x int, y float) {
+func f7(a int) (x int, y float32) {
return 7, 7.0
}
-func f8(a int) (x int, y float) {
+func f8(a int) (x int, y float32) {
return 8, 8.0
}
@@ -49,12 +49,12 @@ type T struct {
x, y int
}
-func (t *T) m10(a int, b float) int {
- return (t.x+a) * (t.y+int(b))
+func (t *T) m10(a int, b float32) int {
+ return (t.x + a) * (t.y + int(b))
}
-func f9(a int) (i int, f float) {
+func f9(a int) (i int, f float32) {
i = 9
f = 9.0
return
diff --git a/gcc/testsuite/go.test/test/func1.go b/gcc/testsuite/go.test/test/func1.go
index 56f4dfcba40..056ff9877d3 100644
--- a/gcc/testsuite/go.test/test/func1.go
+++ b/gcc/testsuite/go.test/test/func1.go
@@ -8,11 +8,11 @@
package main
-func f1(a int) (int, float) { // BUG (not caught by compiler): multiple return values must have names
+func f1(a int) (int, float32) { // BUG (not caught by compiler): multiple return values must have names
return 7, 7.0
}
-func f2(a int) (a int, b float) { // ERROR "redeclared|definition"
+func f2(a int) (a int, b float32) { // ERROR "redeclared|definition"
return 8, 8.0
}
diff --git a/gcc/testsuite/go.test/test/interface/explicit.go b/gcc/testsuite/go.test/test/interface/explicit.go
index b952f8fc8ad..b6a582fffba 100644
--- a/gcc/testsuite/go.test/test/interface/explicit.go
+++ b/gcc/testsuite/go.test/test/interface/explicit.go
@@ -51,21 +51,25 @@ func main() {
t = T(e) // ERROR "need explicit|need type assertion|incompatible"
}
-type M interface { M() }
+type M interface {
+ M()
+}
+
var m M
-var _ = m.(int) // ERROR "impossible type assertion"
+var _ = m.(int) // ERROR "impossible type assertion"
type Int int
-func (Int) M(float) {}
-var _ = m.(Int) // ERROR "impossible type assertion"
+func (Int) M(float64) {}
+
+var _ = m.(Int) // ERROR "impossible type assertion"
var ii int
var jj Int
-var m1 M = ii // ERROR "incompatible|missing"
-var m2 M = jj // ERROR "incompatible|wrong type for M method"
+var m1 M = ii // ERROR "incompatible|missing"
+var m2 M = jj // ERROR "incompatible|wrong type for M method"
-var m3 = M(ii) // ERROR "invalid|missing"
-var m4 = M(jj) // ERROR "invalid|wrong type for M method"
+var m3 = M(ii) // ERROR "invalid|missing"
+var m4 = M(jj) // ERROR "invalid|wrong type for M method"
diff --git a/gcc/testsuite/go.test/test/iota.go b/gcc/testsuite/go.test/test/iota.go
index 20b77c6cc05..c40ca1f3824 100644
--- a/gcc/testsuite/go.test/test/iota.go
+++ b/gcc/testsuite/go.test/test/iota.go
@@ -17,8 +17,8 @@ const (
x int = iota
y = iota
z = 1 << iota
- f float = 2 * iota
- g float = 4.5 * float(iota)
+ f float32 = 2 * iota
+ g float32 = 4.5 * float32(iota)
)
const (
@@ -57,7 +57,7 @@ const (
)
const (
- p = float(iota)
+ p = float32(iota)
q
r
)
@@ -68,9 +68,9 @@ const (
)
const (
- abit, amask = 1 << iota, 1 << iota - 1
- bbit, bmask = 1 << iota, 1 << iota - 1
- cbit, cmask = 1 << iota, 1 << iota - 1
+ abit, amask = 1 << iota, 1<<iota - 1
+ bbit, bmask = 1 << iota, 1<<iota - 1
+ cbit, cmask = 1 << iota, 1<<iota - 1
)
func main() {
diff --git a/gcc/testsuite/go.test/test/ken/cplx0.go b/gcc/testsuite/go.test/test/ken/cplx0.go
index 6e9bfd023d0..ba1fa196fd6 100644
--- a/gcc/testsuite/go.test/test/ken/cplx0.go
+++ b/gcc/testsuite/go.test/test/ken/cplx0.go
@@ -13,7 +13,7 @@ const (
C1 = R + I // ADD(5,6)
)
-func doprint(c complex) { println(c) }
+func doprint(c complex128) { println(c) }
func main() {
diff --git a/gcc/testsuite/go.test/test/ken/cplx1.go b/gcc/testsuite/go.test/test/ken/cplx1.go
index 26b1139928f..8ec7d40f5e5 100644
--- a/gcc/testsuite/go.test/test/ken/cplx1.go
+++ b/gcc/testsuite/go.test/test/ken/cplx1.go
@@ -48,7 +48,7 @@ func main() {
booltest(6+9i, false)
}
-func booltest(a complex, r bool) {
+func booltest(a complex64, r bool) {
var b bool
b = a == C1
diff --git a/gcc/testsuite/go.test/test/ken/cplx3.go b/gcc/testsuite/go.test/test/ken/cplx3.go
index 997894b4184..83acc15ff7c 100644
--- a/gcc/testsuite/go.test/test/ken/cplx3.go
+++ b/gcc/testsuite/go.test/test/ken/cplx3.go
@@ -16,24 +16,18 @@ const (
C1 = R + I // ADD(5,6)
)
-var complexBits = reflect.Typeof(complex(0i)).Size() * 8
-
func main() {
c0 := C1
c0 = (c0 + c0 + c0) / (c0 + c0 + 3i)
println(c0)
- c := *(*complex)(unsafe.Pointer(&c0))
+ c := *(*complex128)(unsafe.Pointer(&c0))
println(c)
- println(complexBits)
-
var a interface{}
switch c := reflect.NewValue(a).(type) {
case *reflect.ComplexValue:
- if complexBits == 64 {
- v := c.Get()
- _, _ = complex64(v), true
- }
+ v := c.Get()
+ _, _ = complex128(v), true
}
}
diff --git a/gcc/testsuite/go.test/test/ken/cplx4.go b/gcc/testsuite/go.test/test/ken/cplx4.go
index 3c6f1f68c96..8524e47aec3 100644
--- a/gcc/testsuite/go.test/test/ken/cplx4.go
+++ b/gcc/testsuite/go.test/test/ken/cplx4.go
@@ -15,7 +15,7 @@ const (
C1 = R + I // ADD(5,6)
)
-func doprint(c complex) { fmt.Printf("c = %f\n", c) }
+func doprint(c complex128) { fmt.Printf("c = %f\n", c) }
func main() {
@@ -32,12 +32,12 @@ func main() {
c2 := complex128(C1)
fmt.Printf("c = %G\n", c2)
- // real, imag, cmplx
- c3 := cmplx(real(c2)+3, imag(c2)-5) + c2
+ // real, imag, complex
+ c3 := complex(real(c2)+3, imag(c2)-5) + c2
fmt.Printf("c = %G\n", c3)
// compiler used to crash on nested divide
- c4 := cmplx(real(c3/2), imag(c3/2))
+ c4 := complex(real(c3/2), imag(c3/2))
if c4 != c3/2 {
fmt.Printf("BUG: c3 = %G != c4 = %G\n", c3, c4)
}
diff --git a/gcc/testsuite/go.test/test/ken/cplx5.go b/gcc/testsuite/go.test/test/ken/cplx5.go
index af2a1c57d12..d425a7c4c04 100644
--- a/gcc/testsuite/go.test/test/ken/cplx5.go
+++ b/gcc/testsuite/go.test/test/ken/cplx5.go
@@ -6,49 +6,49 @@
package main
-var a [12]complex
-var s []complex
-var c chan complex
+var a [12]complex128
+var s []complex128
+var c chan complex128
var f struct {
- c complex
+ c complex128
}
-var m map[complex]complex
+var m map[complex128]complex128
func main() {
- // array of complex
+ // array of complex128
for i := 0; i < len(a); i++ {
- a[i] = cmplx(float(i), float(-i))
+ a[i] = complex(float64(i), float64(-i))
}
println(a[5])
- // slice of complex
- s = make([]complex, len(a))
+ // slice of complex128
+ s = make([]complex128, len(a))
for i := 0; i < len(s); i++ {
s[i] = a[i]
}
println(s[5])
// chan
- c = make(chan complex)
+ c = make(chan complex128)
go chantest(c)
println(<-c)
- // pointer of complex
+ // pointer of complex128
v := a[5]
pv := &v
println(*pv)
- // field of complex
+ // field of complex128
f.c = a[5]
println(f.c)
- // map of complex
- m = make(map[complex]complex)
+ // map of complex128
+ m = make(map[complex128]complex128)
for i := 0; i < len(s); i++ {
m[-a[i]] = a[i]
}
println(m[5i-5])
- println(m[cmplx(-5, 5)])
+ println(m[complex(-5, 5)])
}
-func chantest(c chan complex) { c <- a[5] }
+func chantest(c chan complex128) { c <- a[5] }
diff --git a/gcc/testsuite/go.test/test/ken/robfunc.go b/gcc/testsuite/go.test/test/ken/robfunc.go
index 12b4b6d7b66..6b3d4b2e460 100644
--- a/gcc/testsuite/go.test/test/ken/robfunc.go
+++ b/gcc/testsuite/go.test/test/ken/robfunc.go
@@ -8,8 +8,8 @@ package main
func assertequal(is, shouldbe int, msg string) {
if is != shouldbe {
- print("assertion fail" + msg + "\n");
- panic(1);
+ print("assertion fail" + msg + "\n")
+ panic(1)
}
}
@@ -20,75 +20,75 @@ func f2(a int) {
}
func f3(a, b int) int {
- return a+b;
+ return a + b
}
-func f4(a, b int, c float) int {
- return (a+b)/2 + int(c);
+func f4(a, b int, c float64) int {
+ return (a+b)/2 + int(c)
}
func f5(a int) int {
- return 5;
+ return 5
}
func f6(a int) (r int) {
- return 6;
+ return 6
}
-func f7(a int) (x int, y float) {
- return 7, 7.0;
+func f7(a int) (x int, y float64) {
+ return 7, 7.0
}
-func f8(a int) (x int, y float) {
- return 8, 8.0;
+func f8(a int) (x int, y float64) {
+ return 8, 8.0
}
type T struct {
- x, y int;
+ x, y int
}
-func (t *T) m10(a int, b float) int {
- return (t.x+a) * (t.y+int(b));
+func (t *T) m10(a int, b float64) int {
+ return (t.x + a) * (t.y + int(b))
}
-func f9(a int) (in int, fl float) {
- i := 9;
- f := float(9);
- return i, f;
+func f9(a int) (in int, fl float64) {
+ i := 9
+ f := float64(9)
+ return i, f
}
func main() {
- f1();
- f2(1);
- r3 := f3(1, 2);
- assertequal(r3, 3, "3");
- r4 := f4(0, 2, 3.0);
- assertequal(r4, 4, "4");
- r5 := f5(1);
- assertequal(r5, 5, "5");
- r6 := f6(1);
- assertequal(r6, 6, "6");
- var r7 int;
- var s7 float;
- r7, s7 = f7(1);
- assertequal(r7, 7, "r7");
- assertequal(int(s7), 7, "s7");
- var r8 int;
- var s8 float;
- r8, s8 = f8(1);
- assertequal(r8, 8, "r8");
- assertequal(int(s8), 8, "s8");
- var r9 int;
- var s9 float;
- r9, s9 = f9(1);
- assertequal(r9, 9, "r9");
- assertequal(int(s9), 9, "s9");
- var t *T = new(T);
- t.x = 1;
- t.y = 2;
- r10 := t.m10(1, 3.0);
- assertequal(r10, 10, "10");
+ f1()
+ f2(1)
+ r3 := f3(1, 2)
+ assertequal(r3, 3, "3")
+ r4 := f4(0, 2, 3.0)
+ assertequal(r4, 4, "4")
+ r5 := f5(1)
+ assertequal(r5, 5, "5")
+ r6 := f6(1)
+ assertequal(r6, 6, "6")
+ var r7 int
+ var s7 float64
+ r7, s7 = f7(1)
+ assertequal(r7, 7, "r7")
+ assertequal(int(s7), 7, "s7")
+ var r8 int
+ var s8 float64
+ r8, s8 = f8(1)
+ assertequal(r8, 8, "r8")
+ assertequal(int(s8), 8, "s8")
+ var r9 int
+ var s9 float64
+ r9, s9 = f9(1)
+ assertequal(r9, 9, "r9")
+ assertequal(int(s9), 9, "s9")
+ var t *T = new(T)
+ t.x = 1
+ t.y = 2
+ r10 := t.m10(1, 3.0)
+ assertequal(r10, 10, "10")
}
diff --git a/gcc/testsuite/go.test/test/ken/simpconv.go b/gcc/testsuite/go.test/test/ken/simpconv.go
index cb443e3a19b..feb85d29997 100644
--- a/gcc/testsuite/go.test/test/ken/simpconv.go
+++ b/gcc/testsuite/go.test/test/ken/simpconv.go
@@ -6,20 +6,23 @@
package main
-type vlong int64;
-type short int16;
+type vlong int64
+type short int16
-func
-main() {
- s1 := vlong(0);
- for i:=short(0); i<10; i=i+1 {
- s1 = s1 + vlong(i);
+func main() {
+ s1 := vlong(0)
+ for i := short(0); i < 10; i = i + 1 {
+ s1 = s1 + vlong(i)
+ }
+ if s1 != 45 {
+ panic(s1)
}
- if s1 != 45 { panic(s1); }
- s2 := float(0);
- for i:=0; i<10; i=i+1 {
- s2 = s2 + float(i);
+ s2 := float64(0)
+ for i := 0; i < 10; i = i + 1 {
+ s2 = s2 + float64(i)
+ }
+ if s2 != 45 {
+ panic(s2)
}
- if s2 != 45 { panic(s2); }
}
diff --git a/gcc/testsuite/go.test/test/ken/slicearray.go b/gcc/testsuite/go.test/test/ken/slicearray.go
index 6e7088e19c0..5c31270fcd3 100644
--- a/gcc/testsuite/go.test/test/ken/slicearray.go
+++ b/gcc/testsuite/go.test/test/ken/slicearray.go
@@ -8,8 +8,8 @@ package main
var bx [10]byte
var by []byte
-var fx [10]float
-var fy []float
+var fx [10]float64
+var fy []float64
var lb, hb int
var t int
@@ -87,7 +87,7 @@ func main() {
by = bx[2:8]
tstb()
- // width 4 (float)
+ // width 4 (float64)
lb = 0
hb = 10
fy = fx[lb:hb]
@@ -204,7 +204,7 @@ func init() {
by = nil
for i := 0; i < len(fx); i++ {
- fx[i] = float(i + 20)
+ fx[i] = float64(i + 20)
}
fy = nil
}
diff --git a/gcc/testsuite/go.test/test/ken/sliceslice.go b/gcc/testsuite/go.test/test/ken/sliceslice.go
index 5a35acaf442..63904212877 100644
--- a/gcc/testsuite/go.test/test/ken/sliceslice.go
+++ b/gcc/testsuite/go.test/test/ken/sliceslice.go
@@ -8,8 +8,8 @@ package main
var bx []byte
var by []byte
-var fx []float
-var fy []float
+var fx []float64
+var fy []float64
var lb, hb int
var t int
@@ -78,7 +78,7 @@ func main() {
by = bx[2:8]
tstb()
- // width 4 (float)
+ // width 4 (float64)
lb = 0
hb = 10
fy = fx[lb:hb]
@@ -195,9 +195,9 @@ func init() {
}
by = nil
- fx = make([]float, 10)
+ fx = make([]float64, 10)
for i := 0; i < len(fx); i++ {
- fx[i] = float(i + 20)
+ fx[i] = float64(i + 20)
}
fy = nil
}
diff --git a/gcc/testsuite/go.test/test/literal.go b/gcc/testsuite/go.test/test/literal.go
index 10176bc387a..bf05388127c 100644
--- a/gcc/testsuite/go.test/test/literal.go
+++ b/gcc/testsuite/go.test/test/literal.go
@@ -6,8 +6,6 @@
package main
-import "os"
-
var nbad int
func assert(cond bool, msg string) {
@@ -20,16 +18,8 @@ func assert(cond bool, msg string) {
}
}
-func equal(a, b float) bool {
- if os.Getenv("GOARCH") != "arm" {
- return a == b
- }
- d := a-b
- if a > b {
- return d < a * 1.0e-7
- }
- d = -d
- return d < b * 1.0e-7
+func equal(a, b float32) bool {
+ return a == b
}
@@ -47,7 +37,7 @@ func main() {
var i04 int8 = -127
var i05 int8 = -128
var i06 int8 = +127
- assert(i01 == i00 + 1, "i01")
+ assert(i01 == i00+1, "i01")
assert(i02 == -i01, "i02")
assert(i03 == -i04, "i03")
assert(-(i05+1) == i06, "i05")
@@ -60,7 +50,7 @@ func main() {
var i14 int16 = -32767
var i15 int16 = -32768
var i16 int16 = +32767
- assert(i11 == i10 + 1, "i11")
+ assert(i11 == i10+1, "i11")
assert(i12 == -i11, "i12")
assert(i13 == -i14, "i13")
assert(-(i15+1) == i16, "i15")
@@ -73,11 +63,11 @@ func main() {
var i24 int32 = -2147483647
var i25 int32 = -2147483648
var i26 int32 = +2147483647
- assert(i21 == i20 + 1, "i21")
+ assert(i21 == i20+1, "i21")
assert(i22 == -i21, "i22")
assert(i23 == -i24, "i23")
assert(-(i25+1) == i26, "i25")
- assert(i23 == (1 << 31) - 1, "i23 size")
+ assert(i23 == (1<<31)-1, "i23 size")
// int64
var i30 int64 = 0
@@ -87,27 +77,27 @@ func main() {
var i34 int64 = -9223372036854775807
var i35 int64 = -9223372036854775808
var i36 int64 = +9223372036854775807
- assert(i31 == i30 + 1, "i31")
+ assert(i31 == i30+1, "i31")
assert(i32 == -i31, "i32")
assert(i33 == -i34, "i33")
assert(-(i35+1) == i36, "i35")
- assert(i33 == (1<<63) - 1, "i33 size")
+ assert(i33 == (1<<63)-1, "i33 size")
// uint8
var u00 uint8 = 0
var u01 uint8 = 1
var u02 uint8 = 255
var u03 uint8 = +255
- assert(u01 == u00 + 1, "u01")
+ assert(u01 == u00+1, "u01")
assert(u02 == u03, "u02")
- assert(u03 == (1<<8) - 1, "u03 size")
+ assert(u03 == (1<<8)-1, "u03 size")
// uint16
var u10 uint16 = 0
var u11 uint16 = 1
var u12 uint16 = 65535
var u13 uint16 = +65535
- assert(u11 == u10 + 1, "u11")
+ assert(u11 == u10+1, "u11")
assert(u12 == u13, "u12")
// uint32
@@ -115,7 +105,7 @@ func main() {
var u21 uint32 = 1
var u22 uint32 = 4294967295
var u23 uint32 = +4294967295
- assert(u21 == u20 + 1, "u21")
+ assert(u21 == u20+1, "u21")
assert(u22 == u23, "u22")
// uint64
@@ -126,23 +116,23 @@ func main() {
_, _, _, _ = u30, u31, u32, u33
// float
- var f00 float = 3.14159
- var f01 float = -3.14159
- var f02 float = +3.14159
- var f03 float = 0.0
- var f04 float = .0
- var f05 float = 0.
- var f06 float = -0.0
- var f07 float = 1e10
- var f08 float = -1e10
- var f09 float = 1e-10
- var f10 float = 1e+10
- var f11 float = 1.e-10
- var f12 float = 1.e+10
- var f13 float = .1e-10
- var f14 float = .1e+10
- var f15 float = 1.1e-10
- var f16 float = 1.1e+10
+ var f00 float32 = 3.14159
+ var f01 float32 = -3.14159
+ var f02 float32 = +3.14159
+ var f03 float32 = 0.0
+ var f04 float32 = .0
+ var f05 float32 = 0.
+ var f06 float32 = -0.0
+ var f07 float32 = 1e10
+ var f08 float32 = -1e10
+ var f09 float32 = 1e-10
+ var f10 float32 = 1e+10
+ var f11 float32 = 1.e-10
+ var f12 float32 = 1.e+10
+ var f13 float32 = .1e-10
+ var f14 float32 = .1e+10
+ var f15 float32 = 1.1e-10
+ var f16 float32 = 1.1e+10
assert(f01 == -f00, "f01")
assert(f02 == -f01, "f02")
assert(f03 == f04, "f03")
@@ -179,7 +169,6 @@ func main() {
assert(c8 == 0x0b, "c8")
assert(c9 == 0x672c, "c9")
-
var c00 uint8 = '\000'
var c01 uint8 = '\007'
var c02 uint8 = '\177'
diff --git a/gcc/testsuite/go.test/test/map.go b/gcc/testsuite/go.test/test/map.go
index ddff7c7a733..c3963499bce 100644
--- a/gcc/testsuite/go.test/test/map.go
+++ b/gcc/testsuite/go.test/test/map.go
@@ -21,73 +21,73 @@ func P(a []string) string {
}
s += `"` + a[i] + `"`
}
- s +="}"
+ s += "}"
return s
}
func main() {
// Test a map literal.
- mlit := map[string] int { "0":0, "1":1, "2":2, "3":3, "4":4 }
+ mlit := map[string]int{"0": 0, "1": 1, "2": 2, "3": 3, "4": 4}
for i := 0; i < len(mlit); i++ {
- s := string([]byte{byte(i)+'0'})
+ s := string([]byte{byte(i) + '0'})
if mlit[s] != i {
fmt.Printf("mlit[%s] = %d\n", s, mlit[s])
}
}
- mib := make(map[int] bool)
- mii := make(map[int] int)
- mfi := make(map[float] int)
- mif := make(map[int] float)
- msi := make(map[string] int)
- mis := make(map[int] string)
- mss := make(map[string] string)
- mspa := make(map[string] []string)
+ mib := make(map[int]bool)
+ mii := make(map[int]int)
+ mfi := make(map[float32]int)
+ mif := make(map[int]float32)
+ msi := make(map[string]int)
+ mis := make(map[int]string)
+ mss := make(map[string]string)
+ mspa := make(map[string][]string)
// BUG need an interface map both ways too
type T struct {
- i int64 // can't use string here; struct values are only compared at the top level
- f float
+ i int64 // can't use string here; struct values are only compared at the top level
+ f float32
}
- mipT := make(map[int] *T)
- mpTi := make(map[*T] int)
- mit := make(map[int] T)
-// mti := make(map[T] int)
+ mipT := make(map[int]*T)
+ mpTi := make(map[*T]int)
+ mit := make(map[int]T)
+ // mti := make(map[T] int)
- type M map[int] int
- mipM := make(map[int] M)
+ type M map[int]int
+ mipM := make(map[int]M)
- var apT [2*count]*T
+ var apT [2 * count]*T
for i := 0; i < count; i++ {
s := strconv.Itoa(i)
- s10 := strconv.Itoa(i*10)
- f := float(i)
- t := T{int64(i),f}
+ s10 := strconv.Itoa(i * 10)
+ f := float32(i)
+ t := T{int64(i), f}
apT[i] = new(T)
apT[i].i = int64(i)
apT[i].f = f
- apT[2*i] = new(T) // need twice as many entries as we use, for the nonexistence check
+ apT[2*i] = new(T) // need twice as many entries as we use, for the nonexistence check
apT[2*i].i = int64(i)
apT[2*i].f = f
- m := M{i: i+1}
+ m := M{i: i + 1}
mib[i] = (i != 0)
- mii[i] = 10*i
- mfi[float(i)] = 10*i
- mif[i] = 10.0*f
+ mii[i] = 10 * i
+ mfi[float32(i)] = 10 * i
+ mif[i] = 10.0 * f
mis[i] = s
msi[s] = i
mss[s] = s10
mss[s] = s10
as := make([]string, 2)
- as[0] = s10
- as[1] = s10
+ as[0] = s10
+ as[1] = s10
mspa[s] = as
mipT[i] = apT[i]
mpTi[apT[i]] = i
mipM[i] = m
mit[i] = t
- // mti[t] = i
+ // mti[t] = i
}
// test len
@@ -121,15 +121,15 @@ func main() {
if len(mpTi) != count {
fmt.Printf("len(mpTi) = %d\n", len(mpTi))
}
-// if len(mti) != count {
-// fmt.Printf("len(mti) = %d\n", len(mti))
-// }
+ // if len(mti) != count {
+ // fmt.Printf("len(mti) = %d\n", len(mti))
+ // }
if len(mipM) != count {
fmt.Printf("len(mipM) = %d\n", len(mipM))
}
-// if len(mti) != count {
-// fmt.Printf("len(mti) = %d\n", len(mti))
-// }
+ // if len(mti) != count {
+ // fmt.Printf("len(mti) = %d\n", len(mti))
+ // }
if len(mit) != count {
fmt.Printf("len(mit) = %d\n", len(mit))
}
@@ -137,25 +137,25 @@ func main() {
// test construction directly
for i := 0; i < count; i++ {
s := strconv.Itoa(i)
- s10 := strconv.Itoa(i*10)
- f := float(i)
+ s10 := strconv.Itoa(i * 10)
+ f := float32(i)
// BUG m := M(i, i+1)
if mib[i] != (i != 0) {
fmt.Printf("mib[%d] = %t\n", i, mib[i])
}
- if(mii[i] != 10*i) {
+ if mii[i] != 10*i {
fmt.Printf("mii[%d] = %d\n", i, mii[i])
}
- if(mfi[f] != 10*i) {
+ if mfi[f] != 10*i {
fmt.Printf("mfi[%d] = %d\n", i, mfi[f])
}
- if(mif[i] != 10.0*f) {
+ if mif[i] != 10.0*f {
fmt.Printf("mif[%d] = %g\n", i, mif[i])
}
- if(mis[i] != s) {
+ if mis[i] != s {
fmt.Printf("mis[%d] = %s\n", i, mis[i])
}
- if(msi[s] != i) {
+ if msi[s] != i {
fmt.Printf("msi[%s] = %d\n", s, msi[s])
}
if mss[s] != s10 {
@@ -166,22 +166,22 @@ func main() {
fmt.Printf("mspa[%s][%d] = %s\n", s, j, mspa[s][j])
}
}
- if(mipT[i].i != int64(i) || mipT[i].f != f) {
+ if mipT[i].i != int64(i) || mipT[i].f != f {
fmt.Printf("mipT[%d] = %v\n", i, mipT[i])
}
- if(mpTi[apT[i]] != i) {
+ if mpTi[apT[i]] != i {
fmt.Printf("mpTi[apT[%d]] = %d\n", i, mpTi[apT[i]])
}
- // if(mti[t] != i) {
- // fmt.Printf("mti[%s] = %s\n", s, mti[t])
- // }
- if (mipM[i][i] != i + 1) {
+ // if(mti[t] != i) {
+ // fmt.Printf("mti[%s] = %s\n", s, mti[t])
+ // }
+ if mipM[i][i] != i+1 {
fmt.Printf("mipM[%d][%d] = %d\n", i, i, mipM[i][i])
}
- // if(mti[t] != i) {
- // fmt.Printf("mti[%v] = %d\n", t, mti[t])
- // }
- if(mit[i].i != int64(i) || mit[i].f != f) {
+ // if(mti[t] != i) {
+ // fmt.Printf("mti[%v] = %d\n", t, mti[t])
+ // }
+ if mit[i].i != int64(i) || mit[i].f != f {
fmt.Printf("mit[%d] = {%d %g}\n", i, mit[i].i, mit[i].f)
}
}
@@ -190,7 +190,7 @@ func main() {
// failed lookups yield a false value for the boolean.
for i := 0; i < count; i++ {
s := strconv.Itoa(i)
- f := float(i)
+ f := float32(i)
{
_, b := mib[i]
if !b {
@@ -311,23 +311,23 @@ func main() {
fmt.Printf("tuple existence assign: mit[%d]\n", i)
}
}
-// {
-// _, b := mti[t]
-// if !b {
-// fmt.Printf("tuple existence decl: mti[%d]\n", i)
-// }
-// _, b = mti[t]
-// if !b {
-// fmt.Printf("tuple existence assign: mti[%d]\n", i)
-// }
-// }
+ // {
+ // _, b := mti[t]
+ // if !b {
+ // fmt.Printf("tuple existence decl: mti[%d]\n", i)
+ // }
+ // _, b = mti[t]
+ // if !b {
+ // fmt.Printf("tuple existence assign: mti[%d]\n", i)
+ // }
+ // }
}
// test nonexistence with tuple check
// failed lookups yield a false value for the boolean.
for i := count; i < 2*count; i++ {
s := strconv.Itoa(i)
- f := float(i)
+ f := float32(i)
{
_, b := mib[i]
if b {
@@ -438,16 +438,16 @@ func main() {
fmt.Printf("tuple nonexistence assign: mipM[%d]", i)
}
}
-// {
-// _, b := mti[t]
-// if b {
-// fmt.Printf("tuple nonexistence decl: mti[%d]", i)
-// }
-// _, b = mti[t]
-// if b {
-// fmt.Printf("tuple nonexistence assign: mti[%d]", i)
-// }
-// }
+ // {
+ // _, b := mti[t]
+ // if b {
+ // fmt.Printf("tuple nonexistence decl: mti[%d]", i)
+ // }
+ // _, b = mti[t]
+ // if b {
+ // fmt.Printf("tuple nonexistence assign: mti[%d]", i)
+ // }
+ // }
{
_, b := mit[i]
if b {
@@ -460,32 +460,31 @@ func main() {
}
}
-
// tests for structured map element updates
for i := 0; i < count; i++ {
s := strconv.Itoa(i)
- mspa[s][i % 2] = "deleted"
- if mspa[s][i % 2] != "deleted" {
- fmt.Printf("update mspa[%s][%d] = %s\n", s, i %2, mspa[s][i % 2])
+ mspa[s][i%2] = "deleted"
+ if mspa[s][i%2] != "deleted" {
+ fmt.Printf("update mspa[%s][%d] = %s\n", s, i%2, mspa[s][i%2])
}
mipT[i].i += 1
if mipT[i].i != int64(i)+1 {
fmt.Printf("update mipT[%d].i = %d\n", i, mipT[i].i)
}
- mipT[i].f = float(i + 1)
- if (mipT[i].f != float(i + 1)) {
+ mipT[i].f = float32(i + 1)
+ if mipT[i].f != float32(i+1) {
fmt.Printf("update mipT[%d].f = %g\n", i, mipT[i].f)
}
mipM[i][i]++
- if mipM[i][i] != (i + 1) + 1 {
+ if mipM[i][i] != (i+1)+1 {
fmt.Printf("update mipM[%d][%d] = %i\n", i, i, mipM[i][i])
}
}
// test range on nil map
- var mnil map[string] int
+ var mnil map[string]int
for _, _ = range mnil {
panic("range mnil")
}
diff --git a/gcc/testsuite/go.test/test/method1.go b/gcc/testsuite/go.test/test/method1.go
index 1a2f8cae538..ec14ef9e4f4 100644
--- a/gcc/testsuite/go.test/test/method1.go
+++ b/gcc/testsuite/go.test/test/method1.go
@@ -8,10 +8,10 @@ package main
type T struct { }
func (t *T) M(int, string) // GCCGO_ERROR "previous"
-func (t *T) M(int, float) { } // ERROR "redeclared|redefinition"
+func (t *T) M(int, float64) { } // ERROR "redeclared|redefinition"
func f(int, string) // GCCGO_ERROR "previous"
-func f(int, float) { } // ERROR "redeclared|redefinition"
+func f(int, float64) { } // ERROR "redeclared|redefinition"
func g(a int, b string) // GCCGO_ERROR "previous"
func g(a int, c string) // ERROR "redeclared|redefinition"
diff --git a/gcc/testsuite/go.test/test/named.go b/gcc/testsuite/go.test/test/named.go
index d2039bab4d4..5b6bb81fe34 100644
--- a/gcc/testsuite/go.test/test/named.go
+++ b/gcc/testsuite/go.test/test/named.go
@@ -12,7 +12,7 @@ package main
type Array [10]byte
type Bool bool
type Chan chan int
-type Float float
+type Float float32
type Int int
type Map map[int]byte
type Slice []byte
diff --git a/gcc/testsuite/go.test/test/nil.go b/gcc/testsuite/go.test/test/nil.go
index 6a72b72ebdd..4f4c7552760 100644
--- a/gcc/testsuite/go.test/test/nil.go
+++ b/gcc/testsuite/go.test/test/nil.go
@@ -10,14 +10,13 @@ type T struct {
i int
}
-type IN interface {
-}
+type IN interface{}
func main() {
var i *int
- var f *float
+ var f *float32
var s *string
- var m map[float] *int
+ var m map[float32]*int
var c chan int
var t *T
var in IN
diff --git a/gcc/testsuite/go.test/test/recover2.go b/gcc/testsuite/go.test/test/recover2.go
index c95af8f62f8..9affe25d47a 100644
--- a/gcc/testsuite/go.test/test/recover2.go
+++ b/gcc/testsuite/go.test/test/recover2.go
@@ -7,7 +7,6 @@
// Test of recover for run-time errors.
// TODO(rsc):
-// integer divide by zero?
// null pointer accesses
package main
@@ -15,7 +14,6 @@ package main
import (
"os"
"strings"
- "syscall"
)
var x = make([]byte, 10)
@@ -60,7 +58,7 @@ func test3() {
func test4() {
defer mustRecover("interface")
var x interface{} = 1
- println(x.(float))
+ println(x.(float32))
}
type T struct {
@@ -83,10 +81,6 @@ func test6() {
}
func test7() {
- if syscall.ARCH == "arm" || syscall.OS == "nacl" {
- // ARM doesn't have integer divide trap yet
- return
- }
defer mustRecover("divide by zero")
var x, y int
println(x / y)
diff --git a/gcc/testsuite/go.test/test/test0.go b/gcc/testsuite/go.test/test/test0.go
index dd2033a98fd..d8d86c42793 100644
--- a/gcc/testsuite/go.test/test/test0.go
+++ b/gcc/testsuite/go.test/test/test0.go
@@ -6,12 +6,11 @@
package main
-const
- a_const = 0
+const a_const = 0
const (
- pi = /* the usual */ 3.14159265358979323
- e = 2.718281828
+ pi = /* the usual */ 3.14159265358979323
+ e = 2.718281828
mask1 int = 1 << iota
mask2 = 1 << iota
mask3 = 1 << iota
@@ -19,7 +18,7 @@ const (
)
type (
- Empty interface {}
+ Empty interface{}
Point struct {
x, y int
}
@@ -32,19 +31,21 @@ func (p *Point) Initialize(x, y int) *Point {
}
func (p *Point) Distance() int {
- return p.x * p.x + p.y * p.y
+ return p.x*p.x + p.y*p.y
}
var (
- x1 int
- x2 int
- u, v, w float
+ x1 int
+ x2 int
+ u, v, w float32
)
func foo() {}
func min(x, y int) int {
- if x < y { return x; }
+ if x < y {
+ return x
+ }
return y
}
@@ -57,24 +58,29 @@ func swap(x, y int) (u, v int) {
func control_structs() {
var p *Point = new(Point).Initialize(2, 3)
i := p.Distance()
- var f float = 0.3
+ var f float32 = 0.3
_ = f
- for {}
- for {}
+ for {
+ }
+ for {
+ }
for j := 0; j < i; j++ {
if i == 0 {
- } else i = 0
- var x float
+ } else {
+ i = 0
+ }
+ var x float32
_ = x
}
- foo: // a label
+foo: // a label
var j int
switch y := 0; true {
case i < y:
fallthrough
case i < j:
case i == 0, i == 1, i == j:
- i++; i++
+ i++
+ i++
goto foo
default:
i = -+-+i
diff --git a/gcc/testsuite/go.test/test/typeswitch.go b/gcc/testsuite/go.test/test/typeswitch.go
index 9e6d10ea879..83fb0985a91 100644
--- a/gcc/testsuite/go.test/test/typeswitch.go
+++ b/gcc/testsuite/go.test/test/typeswitch.go
@@ -21,12 +21,15 @@ const (
Last
)
-type S struct { a int }
+type S struct {
+ a int
+}
+
var s S = S{1234}
var c = make(chan int)
-var a = []int{0,1,2,3}
+var a = []int{0, 1, 2, 3}
var m = make(map[string]int)
@@ -68,10 +71,10 @@ func main() {
assert(x == true && i == Bool, "bool")
case int:
assert(x == 7 && i == Int, "int")
- case float:
- assert(x == 7.4 && i == Float, "float")
+ case float64:
+ assert(x == 7.4 && i == Float, "float64")
case string:
- assert(x == "hello"&& i == String, "string")
+ assert(x == "hello" && i == String, "string")
case S:
assert(x.a == 1234 && i == Struct, "struct")
case chan int:
diff --git a/gcc/testsuite/go.test/test/zerodivide.go b/gcc/testsuite/go.test/test/zerodivide.go
index 5fe1eb00d38..1948528d245 100644
--- a/gcc/testsuite/go.test/test/zerodivide.go
+++ b/gcc/testsuite/go.test/test/zerodivide.go
@@ -10,7 +10,6 @@ import (
"fmt"
"math"
"strings"
- "syscall"
)
type Error interface {
@@ -18,56 +17,90 @@ type Error interface {
}
type ErrorTest struct {
- name string
- fn func()
- err string
+ name string
+ fn func()
+ err string
}
var (
- i, j, k int = 0, 0, 1
- i8, j8, k8 int8 = 0, 0, 1
+ i, j, k int = 0, 0, 1
+ i8, j8, k8 int8 = 0, 0, 1
i16, j16, k16 int16 = 0, 0, 1
i32, j32, k32 int32 = 0, 0, 1
i64, j64, k64 int64 = 0, 0, 1
- u, v, w uint = 0, 0, 1
- u8, v8, w8 uint8 = 0, 0, 1
- u16, v16, w16 uint16 = 0, 0, 1
- u32, v32, w32 uint32 = 0, 0, 1
- u64, v64, w64 uint64 = 0, 0, 1
- up, vp, wp uintptr = 0, 0, 1
+ u, v, w uint = 0, 0, 1
+ u8, v8, w8 uint8 = 0, 0, 1
+ u16, v16, w16 uint16 = 0, 0, 1
+ u32, v32, w32 uint32 = 0, 0, 1
+ u64, v64, w64 uint64 = 0, 0, 1
+ up, vp, wp uintptr = 0, 0, 1
- f, g, h float = 0, 0, 1
- f32, g32, h32 float32 = 0, 0, 1
+ f, g, h float64 = 0, 0, 1
+ f32, g32, h32 float32 = 0, 0, 1
f64, g64, h64, inf, negInf, nan float64 = 0, 0, 1, math.Inf(1), math.Inf(-1), math.NaN()
- c, d, e complex = 0+0i, 0+0i, 1+1i
- c64, d64, e64 complex64 = 0+0i, 0+0i, 1+1i
- c128, d128, e128 complex128 = 0+0i, 0+0i, 1+1i
+ c, d, e complex128 = 0 + 0i, 0 + 0i, 1 + 1i
+ c64, d64, e64 complex64 = 0 + 0i, 0 + 0i, 1 + 1i
+ c128, d128, e128 complex128 = 0 + 0i, 0 + 0i, 1 + 1i
)
// Fool gccgo into thinking that these variables can change.
func NotCalled() {
- i++; j++; k++
- i8++; j8++; k8++
- i16++; j16++; k16++
- i32++; j32++; k32++
- i64++; j64++; k64++
-
- u++; v++; w++
- u8++; v8++; w8++
- u16++; v16++; w16++
- u32++; v32++; w32++
- u64++; v64++; w64++
- up++; vp++; wp++
-
- f += 1; g += 1; h += 1
- f32 += 1; g32 += 1; h32 += 1
- f64 += 1; g64 += 1; h64 += 1
-
- c += 1+1i; d += 1+1i; e += 1+1i
- c64 += 1+1i; d64 += 1+1i; e64 += 1+1i
- c128 += 1+1i; d128 += 1+1i; e128 += 1+1i
+ i++
+ j++
+ k++
+ i8++
+ j8++
+ k8++
+ i16++
+ j16++
+ k16++
+ i32++
+ j32++
+ k32++
+ i64++
+ j64++
+ k64++
+
+ u++
+ v++
+ w++
+ u8++
+ v8++
+ w8++
+ u16++
+ v16++
+ w16++
+ u32++
+ v32++
+ w32++
+ u64++
+ v64++
+ w64++
+ up++
+ vp++
+ wp++
+
+ f += 1
+ g += 1
+ h += 1
+ f32 += 1
+ g32 += 1
+ h32 += 1
+ f64 += 1
+ g64 += 1
+ h64 += 1
+
+ c += 1 + 1i
+ d += 1 + 1i
+ e += 1 + 1i
+ c64 += 1 + 1i
+ d64 += 1 + 1i
+ e64 += 1 + 1i
+ c128 += 1 + 1i
+ d128 += 1 + 1i
+ e128 += 1 + 1i
}
var tmp interface{}
@@ -80,52 +113,52 @@ func use(v interface{}) {
// Verify error/no error for all types.
var errorTests = []ErrorTest{
// All integer divide by zero should error.
- ErrorTest{ "int 0/0", func() { use(i/j) }, "divide", },
- ErrorTest{ "int8 0/0", func() { use(i8/j8) }, "divide", },
- ErrorTest{ "int16 0/0", func() { use(i16/j16) }, "divide", },
- ErrorTest{ "int32 0/0", func() { use(i32/j32) }, "divide", },
- ErrorTest{ "int64 0/0", func() { use(i64/j64) }, "divide", },
-
- ErrorTest{ "int 1/0", func() { use(k/j) }, "divide", },
- ErrorTest{ "int8 1/0", func() { use(k8/j8) }, "divide", },
- ErrorTest{ "int16 1/0", func() { use(k16/j16) }, "divide", },
- ErrorTest{ "int32 1/0", func() { use(k32/j32) }, "divide", },
- ErrorTest{ "int64 1/0", func() { use(k64/j64) }, "divide", },
-
- ErrorTest{ "uint 0/0", func() { use(u/v) }, "divide", },
- ErrorTest{ "uint8 0/0", func() { use(u8/v8) }, "divide", },
- ErrorTest{ "uint16 0/0", func() { use(u16/v16) }, "divide", },
- ErrorTest{ "uint32 0/0", func() { use(u32/v32) }, "divide", },
- ErrorTest{ "uint64 0/0", func() { use(u64/v64) }, "divide", },
- ErrorTest{ "uintptr 0/0", func() { use(up/vp) }, "divide", },
-
- ErrorTest{ "uint 1/0", func() { use(w/v) }, "divide", },
- ErrorTest{ "uint8 1/0", func() { use(w8/v8) }, "divide", },
- ErrorTest{ "uint16 1/0", func() { use(w16/v16) }, "divide", },
- ErrorTest{ "uint32 1/0", func() { use(w32/v32) }, "divide", },
- ErrorTest{ "uint64 1/0", func() { use(w64/v64) }, "divide", },
- ErrorTest{ "uintptr 1/0", func() { use(wp/vp) }, "divide", },
-
- // All floating divide by zero should not error.
- ErrorTest{ "float 0/0", func() { use(f/g) }, "", },
- ErrorTest{ "float32 0/0", func() { use(f32/g32) }, "", },
- ErrorTest{ "float64 0/0", func() { use(f64/g64) }, "", },
-
- ErrorTest{ "float 1/0", func() { use(h/g) }, "", },
- ErrorTest{ "float32 1/0", func() { use(h32/g32) }, "", },
- ErrorTest{ "float64 1/0", func() { use(h64/g64) }, "", },
- ErrorTest{ "float64 inf/0", func() { use(inf/g64) }, "", },
- ErrorTest{ "float64 -inf/0", func() { use(negInf/g64) }, "", },
- ErrorTest{ "float64 nan/0", func() { use(nan/g64) }, "", },
+ ErrorTest{"int 0/0", func() { use(i / j) }, "divide"},
+ ErrorTest{"int8 0/0", func() { use(i8 / j8) }, "divide"},
+ ErrorTest{"int16 0/0", func() { use(i16 / j16) }, "divide"},
+ ErrorTest{"int32 0/0", func() { use(i32 / j32) }, "divide"},
+ ErrorTest{"int64 0/0", func() { use(i64 / j64) }, "divide"},
+
+ ErrorTest{"int 1/0", func() { use(k / j) }, "divide"},
+ ErrorTest{"int8 1/0", func() { use(k8 / j8) }, "divide"},
+ ErrorTest{"int16 1/0", func() { use(k16 / j16) }, "divide"},
+ ErrorTest{"int32 1/0", func() { use(k32 / j32) }, "divide"},
+ ErrorTest{"int64 1/0", func() { use(k64 / j64) }, "divide"},
+
+ ErrorTest{"uint 0/0", func() { use(u / v) }, "divide"},
+ ErrorTest{"uint8 0/0", func() { use(u8 / v8) }, "divide"},
+ ErrorTest{"uint16 0/0", func() { use(u16 / v16) }, "divide"},
+ ErrorTest{"uint32 0/0", func() { use(u32 / v32) }, "divide"},
+ ErrorTest{"uint64 0/0", func() { use(u64 / v64) }, "divide"},
+ ErrorTest{"uintptr 0/0", func() { use(up / vp) }, "divide"},
+
+ ErrorTest{"uint 1/0", func() { use(w / v) }, "divide"},
+ ErrorTest{"uint8 1/0", func() { use(w8 / v8) }, "divide"},
+ ErrorTest{"uint16 1/0", func() { use(w16 / v16) }, "divide"},
+ ErrorTest{"uint32 1/0", func() { use(w32 / v32) }, "divide"},
+ ErrorTest{"uint64 1/0", func() { use(w64 / v64) }, "divide"},
+ ErrorTest{"uintptr 1/0", func() { use(wp / vp) }, "divide"},
+
+ // All float64ing divide by zero should not error.
+ ErrorTest{"float64 0/0", func() { use(f / g) }, ""},
+ ErrorTest{"float32 0/0", func() { use(f32 / g32) }, ""},
+ ErrorTest{"float64 0/0", func() { use(f64 / g64) }, ""},
+
+ ErrorTest{"float64 1/0", func() { use(h / g) }, ""},
+ ErrorTest{"float32 1/0", func() { use(h32 / g32) }, ""},
+ ErrorTest{"float64 1/0", func() { use(h64 / g64) }, ""},
+ ErrorTest{"float64 inf/0", func() { use(inf / g64) }, ""},
+ ErrorTest{"float64 -inf/0", func() { use(negInf / g64) }, ""},
+ ErrorTest{"float64 nan/0", func() { use(nan / g64) }, ""},
// All complex divide by zero should not error.
- ErrorTest{ "complex 0/0", func() { use(c/d) }, "", },
- ErrorTest{ "complex64 0/0", func() { use(c64/d64) }, "", },
- ErrorTest{ "complex128 0/0", func() { use(c128/d128) }, "", },
+ ErrorTest{"complex 0/0", func() { use(c / d) }, ""},
+ ErrorTest{"complex64 0/0", func() { use(c64 / d64) }, ""},
+ ErrorTest{"complex128 0/0", func() { use(c128 / d128) }, ""},
- ErrorTest{ "complex 1/0", func() { use(e/d) }, "", },
- ErrorTest{ "complex64 1/0", func() { use(e64/d64) }, "", },
- ErrorTest{ "complex128 1/0", func() { use(e128/d128) }, "", },
+ ErrorTest{"complex 1/0", func() { use(e / d) }, ""},
+ ErrorTest{"complex64 1/0", func() { use(e64 / d64) }, ""},
+ ErrorTest{"complex128 1/0", func() { use(e128 / d128) }, ""},
}
func error(fn func()) (error string) {
@@ -138,12 +171,12 @@ func error(fn func()) (error string) {
return ""
}
-type FloatTest struct{
- f, g float64
- out float64
+type FloatTest struct {
+ f, g float64
+ out float64
}
-var floatTests = []FloatTest{
+var float64Tests = []FloatTest{
FloatTest{0, 0, nan},
FloatTest{nan, 0, nan},
FloatTest{inf, 0, inf},
@@ -163,7 +196,7 @@ func alike(a, b float64) bool {
func main() {
bad := false
for _, t := range errorTests {
- if t.err != "" && syscall.OS == "nacl" {
+ if t.err != "" {
continue
}
err := error(t.fn)
@@ -195,8 +228,8 @@ func main() {
}
// At this point we know we don't error on the values we're testing
- for _, t := range floatTests {
- x := t.f/t.g
+ for _, t := range float64Tests {
+ x := t.f / t.g
if !alike(x, t.out) {
if !bad {
bad = true
diff --git a/gcc/testsuite/lib/compat.exp b/gcc/testsuite/lib/compat.exp
index 84053f3ecbd..3ce3221d186 100644
--- a/gcc/testsuite/lib/compat.exp
+++ b/gcc/testsuite/lib/compat.exp
@@ -288,6 +288,7 @@ proc compat-execute { src1 sid use_alt } {
# Use automatic overlay support to make them fit.
if { [check_effective_target_spu_auto_overlay] } {
set extra_flags_1 "$extra_flags_1 -Wl,--auto-overlay"
+ set extra_flags_1 "$extra_flags_1 -Wl,--extra-stack-space=8192"
set extra_flags_1 "$extra_flags_1 -ffunction-sections"
set extra_flags_2 "$extra_flags_2 -ffunction-sections"
set extra_flags_3 "$extra_flags_3 -ffunction-sections"
diff --git a/gcc/testsuite/lib/gfortran-dg.exp b/gcc/testsuite/lib/gfortran-dg.exp
index 70a0888a0a4..0fd96b395ce 100644
--- a/gcc/testsuite/lib/gfortran-dg.exp
+++ b/gcc/testsuite/lib/gfortran-dg.exp
@@ -52,23 +52,30 @@ proc gfortran-dg-test { prog do_what extra_tool_flags } {
# Where [locus] is either [line] or [line].[columns] .
#
# We collapse these to look like:
- # [name]:[line]: Error: Some error at (1) and (2)
+ # [name]:[line]:[column]: Error: Some error at (1) and (2)
# or
- # [name]:[line]: Error: Some error at (1) and (2)
- # [name]:[line2]: Error: Some error at (1) and (2)
+ # [name]:[line]:[column]: Error: Some error at (1) and (2)
+ # [name]:[line2]:[column]: Error: Some error at (1) and (2)
# We proceed in two steps: first we deal with the form with two
# different locus lines, then with the form with only one locus line.
#
# Note that these regexps only make sense in the combinations used below.
# Note also that is imperative that we first deal with the form with
# two loci.
- set locus_regexp "(\[^\n\]*):(\[0-9\]*)\[^\n\]*:\n\n\[^\n\]*\n\[^\n\]*\n"
+ set locus_regexp "(\[^\n\]*):(\[0-9\]+)\[\.:\](\[0-9\]*)(-\[0-9\]*)?:\n\n\[^\n\]*\n\[^\n\]*\n"
set diag_regexp "(\[^\n\]*)\n"
+ # Add column number if none exists
+ set colnum_regexp "(Warning: |Error: )?(\[^\n\]*):(\[0-9\]+):(\[ \n\])"
+ regsub -all $colnum_regexp $comp_output "\\2:\\3:0:\\4\\1" comp_output
+
set two_loci "$locus_regexp$locus_regexp$diag_regexp"
set single_locus "$locus_regexp$diag_regexp"
- regsub -all $two_loci $comp_output "\\1:\\2: \\5\n\\3:\\4: \\5\n" comp_output
- regsub -all $single_locus $comp_output "\\1:\\2: \\3\n" comp_output
+ regsub -all $two_loci $comp_output "\\1:\\2:\\3: \\9\n\\5:\\6:\\7: \\9\n" comp_output
+ regsub -all $single_locus $comp_output "\\1:\\2:\\3: \\5\n" comp_output
+
+ # Add a line number if none exists
+ regsub -all "(^|\n)(Warning: |Error: )" $comp_output "\\1:0:0: \\2" comp_output
return [list $comp_output $output_file]
}
diff --git a/gcc/testsuite/lib/gfortran.exp b/gcc/testsuite/lib/gfortran.exp
index 8c88550ebe4..4a1a636bb93 100644
--- a/gcc/testsuite/lib/gfortran.exp
+++ b/gcc/testsuite/lib/gfortran.exp
@@ -142,11 +142,16 @@ proc gfortran_init { args } {
global TOOL_EXECUTABLE TOOL_OPTIONS
global GFORTRAN_UNDER_TEST
global TESTING_IN_BUILD_TREE
+ global gcc_warning_prefix
+ global gcc_error_prefix
# We set LC_ALL and LANG to C so that we get the same error messages as expected.
setenv LC_ALL C
setenv LANG C
+ set gcc_warning_prefix "\[Ww\]arning:"
+ set gcc_error_prefix "(Fatal )?\[Ee\]rror:"
+
# Many hosts now default to a non-ASCII C locale, however, so
# they can set a charset encoding here if they need.
if { [ishost "*-*-cygwin*"] } {
diff --git a/gcc/testsuite/lib/gnat-dg.exp b/gcc/testsuite/lib/gnat-dg.exp
index 217605e2e54..e394d3f0f3a 100644
--- a/gcc/testsuite/lib/gnat-dg.exp
+++ b/gcc/testsuite/lib/gnat-dg.exp
@@ -1,4 +1,4 @@
-# Copyright (C) 2006, 2007, 2010 Free Software Foundation, Inc.
+# Copyright (C) 2006, 2007, 2010, 2011 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -16,13 +16,37 @@
load_lib gcc-dg.exp
+# Remove VALUE from LIST_VARIABLE.
+proc lremove {list_variable value} {
+ upvar 1 $list_variable var
+ set idx [lsearch -exact $var $value]
+ set var [lreplace $var $idx $idx]
+}
+
# Define gcc callbacks for dg.exp.
proc gnat-dg-test { prog do_what extra_tool_flags } {
- if { $do_what == "compile" } {
- lappend extra_tool_flags "-c"
- }
- return [gcc-dg-test-1 gnat_target_compile $prog $do_what $extra_tool_flags]
+ if { $do_what == "compile" } {
+ lappend extra_tool_flags "-c"
+ }
+ set result [gcc-dg-test-1 gnat_target_compile $prog $do_what $extra_tool_flags]
+
+ # Remove additional output files apart from $output_file, which may be
+ # needed by dg-final.
+ set output_file [lindex $result 1]
+ set basename [file rootname $output_file]
+ set clean_result [remote_exec host [find_gnatclean] "-c -q -n $basename"]
+ if { [lindex $clean_result 0] != -1 } {
+ set clean_files [lindex $clean_result 1]
+ # Purge NL from clean_files.
+ regsub -all "\[\r\n\]+" $clean_files " " clean_files
+ # Remove ./ so lremove works.
+ regsub -all "\./" $clean_files "" clean_files
+ lremove clean_files $output_file
+ eval remote_file host delete $clean_files
+ }
+
+ return $result
}
proc gnat-dg-prune { system text } {
@@ -38,12 +62,6 @@ proc gnat-dg-prune { system text } {
# Utility routines.
-# Modified dg-runtest that can cycle through a list of optimization options
-# as c-torture does.
-proc gnat-dg-runtest { testcases default-extra-flags } {
- return [gcc-dg-runtest $testcases ${default-extra-flags}]
-}
-
#
# gnat_load -- wrapper around default gnat_load to declare tasking tests
# unsupported on platforms that lack such support
@@ -64,3 +82,7 @@ if { [info procs gnat_load] != [list] \
return $result
}
}
+
+# Local Variables:
+# tcl-indent-level:4
+# End:
diff --git a/gcc/testsuite/lib/gnat.exp b/gcc/testsuite/lib/gnat.exp
index 79fb3e6064d..ad330693342 100644
--- a/gcc/testsuite/lib/gnat.exp
+++ b/gcc/testsuite/lib/gnat.exp
@@ -1,4 +1,5 @@
-# Copyright (C) 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+# Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011
+# Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -20,11 +21,6 @@
# This file is loaded by the tool init file (eg: unix.exp). It provides
# default definitions for gnat_start, etc. and other supporting cast members.
-# These globals are used if no compiler arguments are provided.
-# They are also used by the various testsuites to define the environment:
-# where to find stdio.h, libc.a, etc.
-
-load_lib libgloss.exp
load_lib prune.exp
load_lib gcc-defs.exp
load_lib gcc.exp
@@ -54,12 +50,13 @@ proc default_gnat_version { } {
# verify that the compiler exists
if { $compiler_name != 0 } then {
- set tmp [remote_exec host "$compiler -v"]
+ set tmp [remote_exec host "$compiler --version"]
set status [lindex $tmp 0]
set output [lindex $tmp 1]
- regexp " version \[^\n\r\]*" $output version
+ regexp "^GNATMAKE (\[^\n\r\]*)" $output verline version
if { $status == 0 && [info exists version] } then {
- clone_output "$compiler_name $version\n"
+ # test_summary expects "version" as second field.
+ clone_output "$compiler_name version $version\n"
} else {
clone_output "Couldn't determine version of $compiler_name: $output\n"
}
@@ -69,10 +66,16 @@ proc default_gnat_version { } {
}
}
-# gnat_init -- called at the start of each .exp script.
#
-# There currently isn't much to do, but always using it allows us to
-# make some enhancements without having to go back and rewrite the scripts.
+# gnat_version -- Call default_gnat_version, so we can override it if needed.
+#
+
+proc gnat_version { } {
+ default_gnat_version
+}
+
+#
+# gnat_init -- called at the start of each .exp script.
#
set gnat_initialized 0
@@ -85,7 +88,6 @@ proc gnat_init { args } {
global gnat_initialized
global GNAT_UNDER_TEST
global TOOL_EXECUTABLE
- global gnat_libgcc_s_path
global gnat_target_current
set gnat_target_current ""
@@ -103,23 +105,6 @@ proc gnat_init { args } {
if ![info exists tmpdir] then {
set tmpdir /tmp
}
-
- set gnat_libgcc_s_path "${rootme}"
- # Leave this here since Ada should support multilibs at some point.
- set compiler [lindex $GNAT_UNDER_TEST 0]
-# if { [is_remote host] == 0 && [which $compiler] != 0 } {
-# foreach i "[exec $compiler --print-multi-lib]" {
-# set mldir ""
-# regexp -- "\[a-z0-9=/\.-\]*;" $i mldir
-# set mldir [string trimright $mldir "\;@"]
-# if { "$mldir" == "." } {
-# continue
-# }
-# if { [llength [glob -nocomplain ${rootme}/${mldir}/libgcc_s*.so.*]] >= 1 } {
-# append gnat_libgcc_s_path ":${rootme}/${mldir}"
-# }
-# }
-# }
}
proc gnat_target_compile { source dest type options } {
@@ -129,8 +114,6 @@ proc gnat_target_compile { source dest type options } {
global srcdir
global GNAT_UNDER_TEST
global TOOL_OPTIONS
- global ld_library_path
- global gnat_libgcc_s_path
global gnat_target_current
# dg-require-effective-target tests must be compiled as C.
@@ -158,9 +141,11 @@ proc gnat_target_compile { source dest type options } {
# specify via environment
setenv ADA_INCLUDE_PATH "$rtsdir/adainclude"
setenv ADA_OBJECTS_PATH "$rtsdir/adainclude"
+ # Always log so compilations can be repeated manually.
+ verbose -log "ADA_INCLUDE_PATH=$rtsdir/adainclude"
+ verbose -log "ADA_OBJECTS_PATH=$rtsdir/adainclude"
}
- set ld_library_path ".:${gnat_libgcc_s_path}"
lappend options "compiler=$GNAT_UNDER_TEST -q -f"
lappend options "timeout=[timeout_value]"
@@ -175,71 +160,9 @@ proc gnat_target_compile { source dest type options } {
set options [concat "additional_flags=$TOOL_OPTIONS" $options]
}
- # If we have built libada along with the compiler, point the test harness
- # at it (and associated headers).
-
-# set sourcename [string range $source 0 [expr [string length $source] - 5]]
-# set dest ""
-
return [target_compile $source $dest $type $options]
}
-#
-# gnat_pass -- utility to record a testcase passed
-#
-
-proc gnat_pass { testcase cflags } {
- if { "$cflags" == "" } {
- pass "$testcase"
- } else {
- pass "$testcase, $cflags"
- }
-}
-
-#
-# gnat_fail -- utility to record a testcase failed
-#
-
-proc gnat_fail { testcase cflags } {
- if { "$cflags" == "" } {
- fail "$testcase"
- } else {
- fail "$testcase, $cflags"
- }
-}
-
-#
-# gnat_finish -- called at the end of every .exp script that calls gnat_init
-#
-# The purpose of this proc is to hide all quirks of the testing environment
-# from the testsuites. It also exists to undo anything that gnat_init did
-# (that needs undoing).
-#
-
-proc gnat_finish { } {
- # The testing harness apparently requires this.
- global errorInfo
-
- if [info exists errorInfo] then {
- unset errorInfo
- }
-
- # Might as well reset these (keeps our caller from wondering whether
- # s/he has to or not).
- global prms_id bug_id
- set prms_id 0
- set bug_id 0
-}
-
-proc gnat_exit { } {
- global gluefile
-
- if [info exists gluefile] {
- file_on_build delete $gluefile
- unset gluefile
- }
-}
-
# Prune messages from GNAT that aren't useful.
proc prune_gnat_output { text } {
@@ -272,19 +195,19 @@ proc local_find_gnatmake {} {
if ![is_remote host] {
set file [lookfor_file $tool_root_dir gnatmake]
if { $file == "" } {
- set file [lookfor_file $tool_root_dir gcc/gnatmake]
+ set file [lookfor_file $tool_root_dir gcc/gnatmake]
}
if { $file != "" } {
- set root [file dirname $file]
- # Need to pass full --GCC, including multilib flags, to gnatlink,
- # otherwise gcc from PATH is invoked.
- set dest [target_info name]
- set gnatlink_gcc "--GCC=$root/xgcc -B$root [board_info $dest multilib_flags]"
- # Escape blanks to get them through DejaGnu's exec machinery.
- regsub -all {\s} "$gnatlink_gcc" {\\&} gnatlink_gcc
- set CC "$file --GCC=$root/xgcc --GNATBIND=$root/gnatbind --GNATLINK=$root/gnatlink -cargs -B$root -largs $gnatlink_gcc -margs";
+ set root [file dirname $file]
+ # Need to pass full --GCC, including multilib flags, to gnatlink,
+ # otherwise gcc from PATH is invoked.
+ set dest [target_info name]
+ set gnatlink_gcc "--GCC=$root/xgcc -B$root [board_info $dest multilib_flags]"
+ # Escape blanks to get them through DejaGnu's exec machinery.
+ regsub -all {\s} "$gnatlink_gcc" {\\&} gnatlink_gcc
+ set CC "$file --GCC=$root/xgcc --GNATBIND=$root/gnatbind --GNATLINK=$root/gnatlink -cargs -B$root -largs $gnatlink_gcc -margs";
} else {
- set CC [transform gnatmake]
+ set CC [transform gnatmake]
}
} else {
set CC [transform gnatmake]
@@ -292,27 +215,25 @@ proc local_find_gnatmake {} {
return $CC
}
-# If this is an older version of DejaGnu (without runtest_file_p),
-# provide one and assume the old syntax: foo1.exp bar1.c foo2.exp bar2.c.
-# This can be deleted after next DejaGnu release.
-
-if { [info procs runtest_file_p] == "" } then {
- proc runtest_file_p { runtests testcase } {
- if { $runtests != "" && [regexp "\[.\]\[cC\]" $runtests] } then {
- if { [lsearch $runtests [file tail $testcase]] >= 0 } then {
- return 1
- } else {
- return 0
- }
- }
- return 1
- }
-}
-
-# Provide a definition of this if missing (delete after next DejaGnu release).
+proc find_gnatclean {} {
+ global tool_root_dir
-if { [info procs prune_warnings] == "" } then {
- proc prune_warnings { text } {
- return $text
+ if ![is_remote host] {
+ set file [lookfor_file $tool_root_dir gnatclean]
+ if { $file == "" } {
+ set file [lookfor_file $tool_root_dir gcc/gnatclean]
+ }
+ if { $file != "" } {
+ set gnatclean $file;
+ } else {
+ set gnatclean [transform gnatclean]
+ }
+ } else {
+ set gnatclean [transform gnatclean]
}
+ return $gnatclean
}
+
+# Local Variables:
+# tcl-indent-level:4
+# End:
diff --git a/gcc/testsuite/lib/scanasm.exp b/gcc/testsuite/lib/scanasm.exp
index 66c522343f5..a49085410da 100644
--- a/gcc/testsuite/lib/scanasm.exp
+++ b/gcc/testsuite/lib/scanasm.exp
@@ -1,4 +1,4 @@
-# Copyright (C) 2000, 2002, 2003, 2007, 2008, 2010
+# Copyright (C) 2000, 2002, 2003, 2007, 2008, 2010, 2011
# Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
@@ -342,6 +342,9 @@ proc dg-function-on-line { args } {
if { [istarget "hppa*-*-*"] } {
set pattern [format {\t;[^:]+:%d\n(\t[^\t]+\n)+%s:\n\t.PROC} \
$line $symbol]
+ } elseif { [istarget "mips-sgi-irix*"] } {
+ set pattern [format {\t\.loc [0-9]+ %d 0( [^\n]*)?\n\t\.set\t(no)?mips16\n\t\.ent\t%s\n\t\.type\t%s, @function\n%s:\n} \
+ $line $symbol $symbol $symbol]
} else {
set pattern [format {%s:[^\t]*(\t.(fnstart|frame|mask|file)[^\t]*)*\t[^:]+:%d\n} \
$symbol $line]
diff --git a/gcc/testsuite/lib/target-supports-dg.exp b/gcc/testsuite/lib/target-supports-dg.exp
index 257c68e3bdb..3a2c0dc1141 100644
--- a/gcc/testsuite/lib/target-supports-dg.exp
+++ b/gcc/testsuite/lib/target-supports-dg.exp
@@ -1,5 +1,5 @@
-# Copyright (C) 1997, 1999, 2000, 2003, 2004, 2005, 2007, 2008, 2009, 2010
-# Free Software Foundation, Inc.
+# Copyright (C) 1997, 1999, 2000, 2003, 2004, 2005, 2007, 2008, 2009, 2010,
+# 2011 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -138,6 +138,15 @@ proc dg-require-dll { args } {
set dg-do-what [list [lindex ${dg-do-what} 0] "N" "P"]
}
+# If this host does not support an ASCII locale, skip this test.
+
+proc dg-require-ascii-locale { args } {
+ if { ![ check_ascii_locale_available] } {
+ upvar dg-do-what dg-do-what
+ set dg-do-what [list [lindex ${dg-do-what} 0] "N" "P"]
+ }
+}
+
proc dg-require-iconv { args } {
if { ![ check_iconv_available ${args} ] } {
upvar dg-do-what dg-do-what
diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
index ee7a8bfc04b..36cab543bdc 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -1,5 +1,5 @@
-# Copyright (C) 1999, 2001, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
-# Free Software Foundation, Inc.
+# Copyright (C) 1999, 2001, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
+# 2011 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -922,6 +922,17 @@ proc check_iconv_available { test_what } {
}] $libiconv]
}
+# Return 1 if an ASCII locale is supported on this host, 0 otherwise.
+
+proc check_ascii_locale_available { } {
+ if { ([ishost alpha*-dec-osf*] || [ishost mips-sgi-irix*]) } {
+ # Neither Tru64 UNIX nor IRIX support an ASCII locale.
+ return 0
+ } else {
+ return 1
+ }
+}
+
# Return true if named sections are supported on this target.
proc check_named_sections_available { } {
@@ -945,6 +956,22 @@ proc check_effective_target_fortran_large_real { } {
}]
}
+# Return 1 if the target supports Fortran real kind real(16),
+# 0 otherwise. Contrary to check_effective_target_fortran_large_real
+# this checks for Real(16) only; the other returned real(10) if
+# both real(10) and real(16) are available.
+#
+# When the target name changes, replace the cached result.
+
+proc check_effective_target_fortran_real_16 { } {
+ return [check_no_compiler_messages fortran_real_16 executable {
+ ! Fortran
+ real(kind=16) :: x
+ x = cos (x)
+ end
+ }]
+}
+
# Return 1 if the target supports Fortran integer kinds larger than
# integer(8), 0 otherwise.
#
@@ -3512,6 +3539,9 @@ proc add_options_for_c99_runtime { flags } {
if { [istarget *-*-solaris2*] } {
return "$flags -std=c99"
}
+ if { [istarget mips-sgi-irix6.5*] } {
+ return "$flags -std=c99"
+ }
if { [istarget powerpc-*-darwin*] } {
return "$flags -mmacosx-version-min=10.3"
}
diff --git a/gcc/testsuite/obj-c++.dg/attributes/class-attribute-1.mm b/gcc/testsuite/obj-c++.dg/attributes/class-attribute-1.mm
index 8c9181a9d80..f078339b867 100644
--- a/gcc/testsuite/obj-c++.dg/attributes/class-attribute-1.mm
+++ b/gcc/testsuite/obj-c++.dg/attributes/class-attribute-1.mm
@@ -1,4 +1,5 @@
/* { dg-do compile } */
+/* { dg-skip-if "No API#2 pre-Darwin9" { *-*-darwin[5-8]* } { "-fnext-runtime" } { "" } } */
/* Test deprecate attribute with an @interface declaration. */
diff --git a/gcc/testsuite/obj-c++.dg/attributes/method-noreturn-1.mm b/gcc/testsuite/obj-c++.dg/attributes/method-noreturn-1.mm
index af051a61d34..717d6e65e28 100644
--- a/gcc/testsuite/obj-c++.dg/attributes/method-noreturn-1.mm
+++ b/gcc/testsuite/obj-c++.dg/attributes/method-noreturn-1.mm
@@ -18,11 +18,11 @@
+ (id) method1
{
return self; /* { dg-warning "function declared .noreturn. has a .return. statement" } */
-} /* { dg-warning ".noreturn. function does return" } */
+} /* { dg-warning ".noreturn. function does return" "" { target *-*-* } 20 } */
- (id) method2
{
return self; /* { dg-warning "function declared .noreturn. has a .return. statement" } */
-} /* { dg-warning ".noreturn. function does return" } */
+} /* { dg-warning ".noreturn. function does return" "" { target *-*-* } 24 } */
+ (id) method3
{
abort ();
diff --git a/gcc/testsuite/obj-c++.dg/attributes/method-sentinel-1.mm b/gcc/testsuite/obj-c++.dg/attributes/method-sentinel-1.mm
index ecaa36c21f8..2b8e6fd259d 100644
--- a/gcc/testsuite/obj-c++.dg/attributes/method-sentinel-1.mm
+++ b/gcc/testsuite/obj-c++.dg/attributes/method-sentinel-1.mm
@@ -4,6 +4,8 @@
#include <objc/objc.h>
#include <stdlib.h>
+/* Ensure a compatible definition of nil. */
+#include "../../objc-obj-c++-shared/objc-test-suite-types.h"
@interface NSArray
{
diff --git a/gcc/testsuite/obj-c++.dg/attributes/proto-attribute-2.mm b/gcc/testsuite/obj-c++.dg/attributes/proto-attribute-2.mm
index 1e81c0b7b69..aba58ff3312 100644
--- a/gcc/testsuite/obj-c++.dg/attributes/proto-attribute-2.mm
+++ b/gcc/testsuite/obj-c++.dg/attributes/proto-attribute-2.mm
@@ -1,5 +1,6 @@
/* Contributed by Nicola Pero <nicola.pero@meta-innovation.com>, November 2010. */
/* { dg-do compile } */
+/* { dg-skip-if "No API#2 pre-Darwin9" { *-*-darwin[5-8]* } { "-fnext-runtime" } { "" } } */
/* Test deprecate attribute with a forward declarations of
@protocol. */
diff --git a/gcc/testsuite/obj-c++.dg/attributes/proto-attribute-3.mm b/gcc/testsuite/obj-c++.dg/attributes/proto-attribute-3.mm
index f509bb79198..fc5251eeea1 100644
--- a/gcc/testsuite/obj-c++.dg/attributes/proto-attribute-3.mm
+++ b/gcc/testsuite/obj-c++.dg/attributes/proto-attribute-3.mm
@@ -1,5 +1,7 @@
/* Contributed by Nicola Pero <nicola.pero@meta-innovation.com>, November 2010. */
/* { dg-do compile } */
+/* { dg-skip-if "No API#2 pre-Darwin9" { *-*-darwin[5-8]* } { "-fnext-runtime" } { "" } } */
+
/* Test deprecate attribute with normal @protocol declarations. */
diff --git a/gcc/testsuite/obj-c++.dg/basic.mm b/gcc/testsuite/obj-c++.dg/basic.mm
index 8fb0204eb12..bd593c13b5e 100644
--- a/gcc/testsuite/obj-c++.dg/basic.mm
+++ b/gcc/testsuite/obj-c++.dg/basic.mm
@@ -1,22 +1,41 @@
// A basic sanity check for Objective-C++.
// { dg-do run }
/* { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc2 } } } { "-fnext-runtime" } { "" } } */
-#include "../objc-obj-c++-shared/Object1.h"
+
+//#include "../objc-obj-c++-shared/Object1.h"
#include <iostream>
+#include <objc/Object.h>
+
+#ifdef __OBJC2__
+@interface Object (ADDITIONS)
++ initialize;
+- init;
++ alloc;
++ new;
+@end
+@implementation Object (ADDITIONS)
++ initialize { return self; }
+- init { return self; }
++ alloc { return class_createInstance (self, 0); }
++ new { return [[self alloc] init]; }
+@end
+#endif
+
@interface Greeter : Object
- (void) greet: (const char *)msg;
@end
@implementation Greeter
-- (void) greet: (const char *)msg { std::cout << msg; }
+- (void) greet: (const char *)msg
+{ std::cout << msg << __VERSION__ << std::endl;}
@end
int
main ()
{
- std::cout << "Hello from C++\n";
+ std::cout << "Hello from C++" << __VERSION__ << std::endl;
Greeter *obj = [Greeter new];
- [obj greet: "Hello from Objective-C\n"];
+ [obj greet: "Hello from Objective-C++"];
}
-#include "../objc-obj-c++-shared/Object1-implementation.h"
+//#include "../objc-obj-c++-shared/Object1-implementation.h"
diff --git a/gcc/testsuite/obj-c++.dg/exceptions-2.mm b/gcc/testsuite/obj-c++.dg/exceptions-2.mm
index ce85b731325..989831f8482 100644
--- a/gcc/testsuite/obj-c++.dg/exceptions-2.mm
+++ b/gcc/testsuite/obj-c++.dg/exceptions-2.mm
@@ -1,10 +1,10 @@
/* Contributed by Nicola Pero <nicola.pero@meta-innovation.com>, November 2010. */
-/* { dg-options "-fobjc-exceptions" } */
/* FIXME: This does not test running the code, because Objective-C exceptions at the moment
do not execute correctly in Objective-C++. See PR objc++/23616. Once that is fixed,
- this test should be changed to use 'dg-run' instead of just 'dg-compile'. */
-/* { dg-compile } */
+ this test should be changed to use 'dg-do run' instead of just 'dg-do compile'. */
+/* { dg-do compile } */
+/* { dg-options "-fobjc-exceptions" } */
/* This test checks the syntax @catch (...) which catches any
exceptions. Check that code using it runs correctly. */
diff --git a/gcc/testsuite/obj-c++.dg/method-11.mm b/gcc/testsuite/obj-c++.dg/method-11.mm
index 6c6b1a038a0..74192e80f79 100644
--- a/gcc/testsuite/obj-c++.dg/method-11.mm
+++ b/gcc/testsuite/obj-c++.dg/method-11.mm
@@ -22,5 +22,8 @@ void foo(void) {
obj = [ObjectAlias2 new];
}
-/* { dg-final { scan-assembler "_OBJC_CLASS_REFERENCES_0" } } */
-/* { dg-final { scan-assembler-not "_OBJC_CLASS_REFERENCES_1" } } */
+/* { dg-final { scan-assembler "_OBJC_ClassRefs_0" { target { *-*-darwin* && { ! lp64 } } } } } */
+/* { dg-final { scan-assembler "_OBJC_ClassRef_Object" { target { *-*-darwin* && { lp64 } } } } } */
+/* { dg-final { scan-assembler-not "_OBJC_ClassRefs_1" { target { *-*-darwin* && { ! lp64 } } } } } */
+/* { dg-final { scan-assembler-not "_OBJC_ClassRef_ObjectTypedef" { target { *-*-darwin* && { lp64 } } } } } */
+/* { dg-final { scan-assembler-not "_OBJC_ClassRef_ObjectAlias" { target { *-*-darwin* && { lp64 } } } } } */
diff --git a/gcc/testsuite/obj-c++.dg/pr24393.mm b/gcc/testsuite/obj-c++.dg/pr24393.mm
index 6dae2d317d5..269d84d9c2b 100644
--- a/gcc/testsuite/obj-c++.dg/pr24393.mm
+++ b/gcc/testsuite/obj-c++.dg/pr24393.mm
@@ -1,4 +1,4 @@
-/* { dg-compile } */
+/* { dg-do compile } */
#include <objc/objc.h>
@interface Foo
diff --git a/gcc/testsuite/obj-c++.dg/pr45735.mm b/gcc/testsuite/obj-c++.dg/pr45735.mm
index 852ee25daa4..395698bdb1d 100644
--- a/gcc/testsuite/obj-c++.dg/pr45735.mm
+++ b/gcc/testsuite/obj-c++.dg/pr45735.mm
@@ -1,4 +1,4 @@
-/* { dg-compile } */
+/* { dg-do compile } */
@interface Fraction
-(void) setNumerator: (int) :(int) ; /* { dg-error "expected identifier" } */
@end
diff --git a/gcc/testsuite/obj-c++.dg/property/dotsyntax-22.mm b/gcc/testsuite/obj-c++.dg/property/dotsyntax-22.mm
new file mode 100644
index 00000000000..cc583482263
--- /dev/null
+++ b/gcc/testsuite/obj-c++.dg/property/dotsyntax-22.mm
@@ -0,0 +1,19 @@
+/* PR objc/47784. This testcase used to crash the compiler. */
+
+typedef struct {
+ float x;
+} SomeType;
+
+@interface MyClass
+
+@property(assign,readwrite) SomeType position;
+
+@end
+
+void example (MyClass *x)
+{
+ const SomeType SomeTypeZero = {0.0f};
+
+ x.position= SomeTypeZero;
+}
+
diff --git a/gcc/testsuite/obj-c++.dg/property/property.exp b/gcc/testsuite/obj-c++.dg/property/property.exp
index fb809b48446..468e34b37dc 100644
--- a/gcc/testsuite/obj-c++.dg/property/property.exp
+++ b/gcc/testsuite/obj-c++.dg/property/property.exp
@@ -33,9 +33,10 @@ set tests [lsort [glob -nocomplain $srcdir/$subdir/*.mm]]
# Main loop.
dg-runtest $tests "-fgnu-runtime" $DEFAULT_OBJCXXFLAGS
-# darwin targets can also run code with the NeXT runtime.
-if [istarget "*-*-darwin*" ] {
-dg-runtest $tests "-fnext-runtime" $DEFAULT_OBJCXXFLAGS
+# Darwin targets can also run code with the NeXT runtime.
+# but Properties are not supported by the runtime lib before Darwin 9.
+if [istarget "*-*-darwin\[9123\]*" ] {
+ dg-runtest $tests "-fnext-runtime" $DEFAULT_OBJCXXFLAGS
}
# All done.
diff --git a/gcc/testsuite/obj-c++.dg/proto-lossage-3.mm b/gcc/testsuite/obj-c++.dg/proto-lossage-3.mm
index 8a6623ecda0..ac66ace5796 100644
--- a/gcc/testsuite/obj-c++.dg/proto-lossage-3.mm
+++ b/gcc/testsuite/obj-c++.dg/proto-lossage-3.mm
@@ -19,9 +19,16 @@
int
main()
{
+#ifdef __OBJC2__
+protocol_getMethodDescription(@protocol(NoInstanceMethods), @selector(name), NO, YES);
+protocol_getMethodDescription(@protocol(NoInstanceMethods), @selector(name), NO, NO);
+protocol_getMethodDescription(@protocol(NoClassMethods), @selector(name), NO, YES);
+protocol_getMethodDescription(@protocol(NoClassMethods), @selector(name), NO, NO);
+#else
[@protocol(NoInstanceMethods) descriptionForInstanceMethod: @selector(name)];
[@protocol(NoInstanceMethods) descriptionForClassMethod: @selector(name)];
[@protocol(NoClassMethods) descriptionForInstanceMethod: @selector(name)];
[@protocol(NoClassMethods) descriptionForClassMethod: @selector(name)];
+#endif
return 0;
}
diff --git a/gcc/testsuite/obj-c++.dg/selector-3.mm b/gcc/testsuite/obj-c++.dg/selector-3.mm
index 49f7e417208..a1321a7b741 100644
--- a/gcc/testsuite/obj-c++.dg/selector-3.mm
+++ b/gcc/testsuite/obj-c++.dg/selector-3.mm
@@ -22,5 +22,8 @@ typedef const struct objc_selector *SEL;
a = @selector(b1ar);
b = @selector(bar);
}
-@end /* { dg-warning "creating selector for nonexistent method .b1ar." } */
+@end
+
+/* FIXME: The error message should be on the correct line. */
+/* { dg-warning "creating selector for nonexistent method .b1ar." "" { target *-*-* } 0 } */
diff --git a/gcc/testsuite/obj-c++.dg/template-8.mm b/gcc/testsuite/obj-c++.dg/template-8.mm
index 97bdb7fb000..df215b8525d 100644
--- a/gcc/testsuite/obj-c++.dg/template-8.mm
+++ b/gcc/testsuite/obj-c++.dg/template-8.mm
@@ -3,6 +3,7 @@
/* Author: Fariborz Jahanian <fjahanian@apple.com> */
/* Adapted by Nicola Pero <nicola.pero@meta-innovation.com> */
/* { dg-do run } */
+/* { dg-skip-if "No API#2 pre-Darwin9" { *-*-darwin[5-8]* } { "-fnext-runtime" } { "" } } */
/* { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc2 } } } { "-fnext-runtime" } { "" } } */
#include <objc/objc.h>
diff --git a/gcc/testsuite/obj-c++.dg/torture/strings/const-str-10.mm b/gcc/testsuite/obj-c++.dg/torture/strings/const-str-10.mm
index f61a47481c6..3cb3acfae3b 100644
--- a/gcc/testsuite/obj-c++.dg/torture/strings/const-str-10.mm
+++ b/gcc/testsuite/obj-c++.dg/torture/strings/const-str-10.mm
@@ -29,6 +29,7 @@ extern struct objc_class _NSConstantStringClassReference;
const NSConstantString *appKey = @"MyApp";
-/* { dg-final { scan-assembler ".section __OBJC, __cstring_object" } } */
+/* { dg-final { scan-assembler ".section __OBJC, __cstring_object" { target { *-*-darwin* && { ! lp64 } } } } } */
+/* { dg-final { scan-assembler ".section __DATA, __objc_stringobj" { target { *-*-darwin* && { lp64 } } } } } */
/* { dg-final { scan-assembler ".long\t__NSConstantStringClassReference\n\t.long\t.*\n\t.long\t5\n\t.data" { target { *-*-darwin* && { ! lp64 } } } } } */
-/* { dg-final { scan-assembler ".quad\t__NSConstantStringClassReference\n\t.quad\t.*\n\t.long\t5\n\t.space 4\n\t.data" { target { *-*-darwin* && { lp64 } } } } } */
+/* { dg-final { scan-assembler ".quad\t_OBJC_CLASS_._NSConstantString\n\t.quad\t.*\n\t.long\t5\n\t.space" { target { *-*-darwin* && { lp64 } } } } } */
diff --git a/gcc/testsuite/obj-c++.dg/torture/strings/const-str-11.mm b/gcc/testsuite/obj-c++.dg/torture/strings/const-str-11.mm
index 4abab369a20..8674646d880 100644
--- a/gcc/testsuite/obj-c++.dg/torture/strings/const-str-11.mm
+++ b/gcc/testsuite/obj-c++.dg/torture/strings/const-str-11.mm
@@ -29,6 +29,7 @@ extern struct objc_class _XStrClassReference;
const XStr *appKey = @"MyApp";
-/* { dg-final { scan-assembler ".section __OBJC, __cstring_object" } } */
-/* { dg-final { scan-assembler ".long\t__XStrClassReference\n\t.long\t.*\n\t.long\t5\n\t.data" { target { *-*-darwin* && { ! lp64 } } } } } */
-/* { dg-final { scan-assembler ".quad\t__XStrClassReference\n\t.quad\t.*\n\t.long\t5\n\t.space 4\n\t.data" { target { *-*-darwin* && { lp64 } } } } } */
+/* { dg-final { scan-assembler ".section __OBJC, __cstring_object" { target { *-*-darwin* && { ! lp64 } } } } } */
+/* { dg-final { scan-assembler ".section __DATA, __objc_stringobj" { target { *-*-darwin* && { lp64 } } } } } */
+/* { dg-final { scan-assembler ".long\t__XStrClassReference\n\t.long\t.*\n\t.long\t5\n\t.data" { target { *-*-darwin* && { ! lp64 } } } } } */
+/* { dg-final { scan-assembler ".quad\t_OBJC_CLASS_._XStr\n\t.quad\t.*\n\t.long\t5\n\t.space" { target { *-*-darwin* && { lp64 } } } } } */
diff --git a/gcc/testsuite/obj-c++.dg/torture/strings/const-str-9.mm b/gcc/testsuite/obj-c++.dg/torture/strings/const-str-9.mm
index 7c99f6b5d36..e05c62b88a8 100644
--- a/gcc/testsuite/obj-c++.dg/torture/strings/const-str-9.mm
+++ b/gcc/testsuite/obj-c++.dg/torture/strings/const-str-9.mm
@@ -21,6 +21,7 @@ extern struct objc_class _NSConstantStringClassReference;
const NSConstantString *appKey = @"MyApp";
-/* { dg-final { scan-assembler ".section __OBJC, __cstring_object" } } */
-/* { dg-final { scan-assembler ".long\t__NSConstantStringClassReference\n\t.long\t.*\n\t.long\t5\n\t.data" { target { *-*-darwin* && { ! lp64 } } }} } */
-/* { dg-final { scan-assembler ".quad\t__NSConstantStringClassReference\n\t.quad\t.*\n\t.long\t5\n\t.space 4\n\t.data" { target { *-*-darwin* && { lp64 } } } } } */
+/* { dg-final { scan-assembler ".section __OBJC, __cstring_object" { target { *-*-darwin* && { ! lp64 } } } } } */
+/* { dg-final { scan-assembler ".section __DATA, __objc_stringobj" { target { *-*-darwin* && { lp64 } } } } } */
+/* { dg-final { scan-assembler ".long\t__NSConstantStringClassReference\n\t.long\t.*\n\t.long\t5\n\t.data" { target { *-*-darwin* && { ! lp64 } } } } } */
+/* { dg-final { scan-assembler ".quad\t_OBJC_CLASS_._NSConstantString\n\t.quad\t.*\n\t.long\t5\n\t.space" { target { *-*-darwin* && { lp64 } } } } } */
diff --git a/gcc/testsuite/obj-c++.dg/try-catch-2.mm b/gcc/testsuite/obj-c++.dg/try-catch-2.mm
index cf5189a03de..05aba36a46f 100644
--- a/gcc/testsuite/obj-c++.dg/try-catch-2.mm
+++ b/gcc/testsuite/obj-c++.dg/try-catch-2.mm
@@ -3,7 +3,7 @@
/* Developed by Ziemowit Laski <zlaski@apple.com>. */
/* { dg-do run } */
-/* { dg-xfail-if "PR23616" { *-*-* } { "-fgnu-runtime" } { "-fnext-runtime" } } */
+/* { dg-xfail-run-if "PR23616" { *-*-* } { "-fgnu-runtime" } { "-fnext-runtime" } } */
/* { dg-xfail-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc2 } } } { "-fnext-runtime" "-fgnu-runtime" } { "" } }
/* { dg-options "-fobjc-exceptions" } */
diff --git a/gcc/testsuite/obj-c++.dg/try-catch-9.mm b/gcc/testsuite/obj-c++.dg/try-catch-9.mm
index c4033c72092..a4331fc35e2 100644
--- a/gcc/testsuite/obj-c++.dg/try-catch-9.mm
+++ b/gcc/testsuite/obj-c++.dg/try-catch-9.mm
@@ -3,7 +3,7 @@
/* Developed by Ziemowit Laski <zlaski@apple.com>. */
/* { dg-do run } */
-/* { dg-xfail-if "PR23616" { *-*-* } { "-fgnu-runtime" } { "-fnext-runtime" } } */
+/* { dg-xfail-run-if "PR23616" { *-*-* } { "-fgnu-runtime" } { "-fnext-runtime" } } */
/* { dg-xfail-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc2 } } } { "-fnext-runtime" "-fgnu-runtime" } { "" } }
/* { dg-prune-output ".*internal compiler error.*" } */
/* { dg-options "-fobjc-exceptions -O2" } */
diff --git a/gcc/testsuite/objc.dg/attributes/class-attribute-1.m b/gcc/testsuite/objc.dg/attributes/class-attribute-1.m
index 25293236378..3444760bc3d 100644
--- a/gcc/testsuite/objc.dg/attributes/class-attribute-1.m
+++ b/gcc/testsuite/objc.dg/attributes/class-attribute-1.m
@@ -3,7 +3,6 @@
/* Test deprecate attribute with an @interface declaration. */
#include <objc/objc.h>
-#include <objc/runtime.h>
__attribute__ ((deprecated))
@interface DeprecatedClass
diff --git a/gcc/testsuite/objc.dg/attributes/method-noreturn-1.m b/gcc/testsuite/objc.dg/attributes/method-noreturn-1.m
index af051a61d34..717d6e65e28 100644
--- a/gcc/testsuite/objc.dg/attributes/method-noreturn-1.m
+++ b/gcc/testsuite/objc.dg/attributes/method-noreturn-1.m
@@ -18,11 +18,11 @@
+ (id) method1
{
return self; /* { dg-warning "function declared .noreturn. has a .return. statement" } */
-} /* { dg-warning ".noreturn. function does return" } */
+} /* { dg-warning ".noreturn. function does return" "" { target *-*-* } 20 } */
- (id) method2
{
return self; /* { dg-warning "function declared .noreturn. has a .return. statement" } */
-} /* { dg-warning ".noreturn. function does return" } */
+} /* { dg-warning ".noreturn. function does return" "" { target *-*-* } 24 } */
+ (id) method3
{
abort ();
diff --git a/gcc/testsuite/objc.dg/attributes/method-sentinel-1.m b/gcc/testsuite/objc.dg/attributes/method-sentinel-1.m
index ecaa36c21f8..e2abb1e8a1d 100644
--- a/gcc/testsuite/objc.dg/attributes/method-sentinel-1.m
+++ b/gcc/testsuite/objc.dg/attributes/method-sentinel-1.m
@@ -4,6 +4,7 @@
#include <objc/objc.h>
#include <stdlib.h>
+#include "../../objc-obj-c++-shared/objc-test-suite-types.h"
@interface NSArray
{
diff --git a/gcc/testsuite/objc.dg/attributes/objc-exception-1.m b/gcc/testsuite/objc.dg/attributes/objc-exception-1.m
new file mode 100644
index 00000000000..e7f6f856f8f
--- /dev/null
+++ b/gcc/testsuite/objc.dg/attributes/objc-exception-1.m
@@ -0,0 +1,32 @@
+/* Contributed by Nicola Pero <nicola.pero@meta-innovation.com>, February 2011. */
+/* { dg-do compile } */
+
+/* Test that the 'objc_exception' attribute is accepted for
+ @interfaces, but not for anything else. */
+
+#include <objc/objc.h>
+
+/* Fine. */
+__attribute__ ((objc_exception))
+@interface MyClass
+{
+ Class isa;
+}
+@end
+
+/* Fine. */
+__attribute__ ((__objc_exception__))
+@interface MyClass2
+{
+ Class isa;
+}
+@end
+
+__attribute__ ((objc_exception))
+@protocol MyProtocol; /* { dg-warning "ignored" } */
+
+__attribute__ ((objc_exception))
+int myVariable; /* { dg-warning "ignored" } */
+
+__attribute__ ((objc_exception))
+int myFunction (int argument); /* { dg-warning "ignored" } */
diff --git a/gcc/testsuite/objc.dg/attributes/proto-attribute-2.m b/gcc/testsuite/objc.dg/attributes/proto-attribute-2.m
index 1e81c0b7b69..b23b81de20c 100644
--- a/gcc/testsuite/objc.dg/attributes/proto-attribute-2.m
+++ b/gcc/testsuite/objc.dg/attributes/proto-attribute-2.m
@@ -6,7 +6,6 @@
#include <stdlib.h>
#include <objc/objc.h>
-#include <objc/runtime.h>
__attribute__ ((deprecated))
@protocol DeprecatedProtocol1;
diff --git a/gcc/testsuite/objc.dg/attributes/proto-attribute-3.m b/gcc/testsuite/objc.dg/attributes/proto-attribute-3.m
index f509bb79198..2be286ecfb7 100644
--- a/gcc/testsuite/objc.dg/attributes/proto-attribute-3.m
+++ b/gcc/testsuite/objc.dg/attributes/proto-attribute-3.m
@@ -6,7 +6,6 @@
#include <stdlib.h>
#include <objc/objc.h>
-#include <objc/runtime.h>
__attribute__ ((deprecated))
@protocol DeprecatedProtocol1
diff --git a/gcc/testsuite/objc.dg/encode-7-next-64bit.m b/gcc/testsuite/objc.dg/encode-7-next-64bit.m
index 3a5e61dafa5..60129f9d2c7 100644
--- a/gcc/testsuite/objc.dg/encode-7-next-64bit.m
+++ b/gcc/testsuite/objc.dg/encode-7-next-64bit.m
@@ -2,16 +2,15 @@
/* { dg-do run { target *-*-darwin* } } */
/* { dg-require-effective-target lp64 } */
-/* { dg-options "-Wno-deprecated-declarations" } */
/* { dg-skip-if "" { *-*-* } { "-fgnu-runtime" } { "" } } */
/* { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc2 } } } { "-fnext-runtime" } { "" } } */
-/* { dg-additional-sources "../objc-obj-c++-shared/Object1.m" } */
-#include "../objc-obj-c++-shared/Object1.h"
-#include "../objc-obj-c++-shared/next-mapping.h"
#include <stdbool.h>
#include <string.h>
#include <stdlib.h>
+#include <objc/Object.h>
+#include "../objc-obj-c++-shared/next-mapping.h"
+
#define CHECK_IF(E) if (!(E)) abort ()
@class NSDictionary, NSFont, NSError, _NSATSTypesetterGuts, NSString, NSMenu, NSArray;
@@ -195,69 +194,70 @@ NSRange globalRange;
int main(void) {
Class fooClass = objc_getClass ("Foo");
Method meth;
- struct objc_ivar_list *ivars;
- struct objc_ivar *ivar;
+ Ivar *ivars;
+ unsigned int ivar_count;
+ Ivar ivar;
meth = class_getInstanceMethod (fooClass, @selector(_errorWithOSStatus:ref1:ref2:reading:));
- CHECK_IF (!strcmp (meth->method_types, "@44@0:8q16r^{FSRef=[80C]}24r^{FSRef=[80C]}32c40"));
+ CHECK_IF (!strcmp (method_getTypeEncoding(meth), "@44@0:8q16r^{FSRef=[80C]}24r^{FSRef=[80C]}32c40"));
meth = class_getInstanceMethod (fooClass, @selector(_attributeRunForCharacterAtIndex:));
- CHECK_IF (!strcmp (meth->method_types, "r^{?=@@QQ^Qffff{_NSRect={_NSPoint=ff}{_NSSize=ff}}q^qQ^Q@@@:::****{?=b1b1b1b1b1b27}}24@0:8Q16"));
+ CHECK_IF (!strcmp (method_getTypeEncoding (meth), "r^{?=@@QQ^Qffff{_NSRect={_NSPoint=ff}{_NSSize=ff}}q^qQ^Q@@@:::****{?=b1b1b1b1b1b27}}24@0:8Q16"));
meth = class_getInstanceMethod (fooClass, @selector(_getATSTypesetterGuts:));
- CHECK_IF (!strcmp (meth->method_types, "r@24@0:8r:16"));
+ CHECK_IF (!strcmp (method_getTypeEncoding (meth), "r@24@0:8r:16"));
meth = class_getInstanceMethod (fooClass, @selector(resumeWithSuspensionID:and:));
- CHECK_IF (!strcmp (meth->method_types, "v32@0:8^{__NSAppleEventManagerSuspension=}16r^Q24"));
+ CHECK_IF (!strcmp (method_getTypeEncoding (meth), "v32@0:8^{__NSAppleEventManagerSuspension=}16r^Q24"));
meth = class_getInstanceMethod (fooClass, @selector(anotherMeth:and:and:));
- CHECK_IF (!strcmp (meth->method_types, "r@40@0:8r:16r@24r@32"));
+ CHECK_IF (!strcmp (method_getTypeEncoding (meth), "r@40@0:8r:16r@24r@32"));
meth = class_getInstanceMethod (fooClass, @selector(str1:str2:str3:str4:));
- CHECK_IF (!strcmp (meth->method_types, "@48@0:8r*16*24*32r*40"));
+ CHECK_IF (!strcmp (method_getTypeEncoding (meth), "@48@0:8r*16*24*32r*40"));
meth = class_getInstanceMethod (fooClass, @selector(foo1:foo2:foo3:foo4:));
- CHECK_IF (!strcmp (meth->method_types, "Vv48@0:8@16r@24@32r@40"));
+ CHECK_IF (!strcmp (method_getTypeEncoding (meth), "Vv48@0:8@16r@24@32r@40"));
meth = class_getInstanceMethod (fooClass, @selector(sel1:id1:));
- CHECK_IF (!strcmp (meth->method_types, "rn*32@0:8r:16r@24"));
+ CHECK_IF (!strcmp (method_getTypeEncoding (meth), "rn*32@0:8r:16r@24"));
meth = class_getInstanceMethod (fooClass, @selector(obj1:obj2:obj3:));
- CHECK_IF (!strcmp (meth->method_types, "N@40@0:8r@16@24^{Object=#}32"));
+ CHECK_IF (!strcmp (method_getTypeEncoding (meth), "N@40@0:8r@16@24^{Object=#}32"));
meth = class_getClassMethod (fooClass, @selector(_defaultScriptingComponent));
- CHECK_IF (!strcmp (meth->method_types, "^{ComponentInstanceRecord=[1q]}16@0:8"));
+ CHECK_IF (!strcmp (method_getTypeEncoding (meth), "^{ComponentInstanceRecord=[1q]}16@0:8"));
meth = class_getInstanceMethod (fooClass, @selector(_formatCocoaErrorString:parameters:applicableFormatters:count:));
- CHECK_IF (!strcmp (meth->method_types, "@44@0:8@16r*24^^{?}32i40"));
+ CHECK_IF (!strcmp (method_getTypeEncoding (meth), "@44@0:8@16r*24^^{?}32i40"));
meth = class_getInstanceMethod (fooClass, @selector(formatter_func:run:));
- CHECK_IF (!strcmp (meth->method_types, "^{?=^?@I}32@0:8@16r^^{?}24"));
+ CHECK_IF (!strcmp (method_getTypeEncoding (meth), "^{?=^?@I}32@0:8@16r^^{?}24"));
meth = class_getInstanceMethod (fooClass, @selector(_forgetWord:inDictionary:));
- CHECK_IF (!strcmp (meth->method_types, "c32@0:8nO@16nO@24"));
+ CHECK_IF (!strcmp (method_getTypeEncoding (meth), "c32@0:8nO@16nO@24"));
meth = class_getInstanceMethod (fooClass, @selector(_registerServicesMenu:withSendTypes:andReturnTypes:addToList:));
- CHECK_IF (!strcmp (meth->method_types, "v44@0:8@16r^*24r^*32c40"));
+ CHECK_IF (!strcmp (method_getTypeEncoding (meth), "v44@0:8@16r^*24r^*32c40"));
meth = class_getClassMethod (fooClass, @selector(_proxySharePointer));
- CHECK_IF (!strcmp (meth->method_types, "^^{__CFSet}16@0:8"));
+ CHECK_IF (!strcmp (method_getTypeEncoding (meth), "^^{__CFSet}16@0:8"));
meth = class_getInstanceMethod (fooClass, @selector(_checkGrammarInString:language:details:));
- CHECK_IF (!strcmp (meth->method_types, "{_NSRange=II}40@0:8n@16nO@24oO^@32"));
+ CHECK_IF (!strcmp (method_getTypeEncoding (meth), "{_NSRange=II}40@0:8n@16nO@24oO^@32"));
meth = class_getInstanceMethod (fooClass, @selector(_resolvePositionalStakeGlyphsForLineFragment:lineFragmentRect:minPosition:maxPosition:maxLineFragmentWidth:breakHint:));
- CHECK_IF (!strcmp (meth->method_types, "B60@0:8^{__CTLine=}16{_NSRect={_NSPoint=ff}{_NSSize=ff}}24f40f44f48^Q52"));
+ CHECK_IF (!strcmp (method_getTypeEncoding (meth), "B60@0:8^{__CTLine=}16{_NSRect={_NSPoint=ff}{_NSSize=ff}}24f40f44f48^Q52"));
meth = class_getClassMethod (fooClass, @selector(findVoiceByIdentifier:returningCreator:returningID:));
- CHECK_IF (!strcmp (meth->method_types, "c40@0:8@16^I24^I32"));
+ CHECK_IF (!strcmp (method_getTypeEncoding (meth), "c40@0:8@16^I24^I32"));
- ivars = fooClass->ivars;
- CHECK_IF (ivars->ivar_count == 1);
+ ivars = class_copyIvarList (fooClass, &ivar_count);
+ CHECK_IF (ivar_count == 1);
- ivar = ivars->ivar_list;
- CHECK_IF (!strcmp (ivar->ivar_name, "r"));
- CHECK_IF (!strcmp (ivar->ivar_type,
+ ivar = ivars[0];
+ CHECK_IF (!strcmp (ivar_getName(ivar), "r"));
+ CHECK_IF (!strcmp (ivar_getTypeEncoding(ivar),
"{?=\"_attributes\"@\"NSDictionary\"\"_font\"@\"NSFont\"\"_characterLength\""
"Q\"_nominalGlyphLocation\"Q\"p\"^Q\"_defaultLineHeight\"f\"_defaultBaselineOffset\""
"f\"_horizExpansion\"f\"_baselineDelta\"f\"_attachmentBBox\"{_NSRect=\"origin\""
diff --git a/gcc/testsuite/objc.dg/image-info.m b/gcc/testsuite/objc.dg/image-info.m
index e9e9de68906..194d3664f09 100644
--- a/gcc/testsuite/objc.dg/image-info.m
+++ b/gcc/testsuite/objc.dg/image-info.m
@@ -7,13 +7,19 @@
/* { dg-skip-if "NeXT-only" { *-*-* } { "-fgnu-runtime" } { "" } } */
/* { dg-options "-freplace-objc-classes" } */
-#include "../objc-obj-c++-shared/Object1.h"
#include <objc/objc.h>
+#include <objc/Object.h>
extern void abort(void);
-
#define CHECK_IF(expr) if(!(expr)) abort();
+@interface Object (TEST_SUITE_C1)
+- init;
+@end
+@implementation Object (TEST_SUITE_C1)
+- init {return self;}
+@end
+
@interface Base: Object {
@public
int a;
@@ -33,4 +39,5 @@ extern void abort(void);
}
@end
-/* { dg-final { scan-assembler "\t.section __OBJC, __image_info.*\n\t.align.*\nL_OBJC_IMAGE_INFO.*:\n\t.long\t0\n\t.long\t1" } } */
+/* { dg-final { scan-assembler "\t.section __OBJC, __image_info.*\n\t.align.*\nL_OBJC_ImageInfo.*:\n\t.long\t0\n\t.long\t1" { target { *-*-darwin* && { ! lp64 } } } } } */
+/* { dg-final { scan-assembler "\t.section __DATA, __objc_imageinfo.*\n\t.align.*\nL_OBJC_ImageInfo.*:\n\t.long\t0\n\t.long\t17" { target { *-*-darwin* && { lp64 } } } } } */
diff --git a/gcc/testsuite/objc.dg/layout-2.m b/gcc/testsuite/objc.dg/layout-2.m
new file mode 100644
index 00000000000..474fc046192
--- /dev/null
+++ b/gcc/testsuite/objc.dg/layout-2.m
@@ -0,0 +1,14 @@
+/* Contributed by Nicola Pero <nicola.pero@meta-innovation.com>, February 2011. */
+/* Ensure that -Wpadded generates no warnings during runtime structure metadata
+ generation. */
+/* { dg-do compile } */
+/* { dg-options "-Wpadded" } */
+
+#include "../objc-obj-c++-shared/Object1.h"
+
+/* Implement a class, so that the metadata generation happens. */
+@interface MyClass : Object
+@end
+
+@implementation MyClass
+@end
diff --git a/gcc/testsuite/objc.dg/lookup-1.m b/gcc/testsuite/objc.dg/lookup-1.m
index ff59b7efba9..737d58a6864 100644
--- a/gcc/testsuite/objc.dg/lookup-1.m
+++ b/gcc/testsuite/objc.dg/lookup-1.m
@@ -1,5 +1,6 @@
/* { dg-do run } */
/* { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc2 } } } { "-fnext-runtime" } { "" } } */
+/* { dg-additional-sources "../objc-obj-c++-shared/Object1.m" } */
#include <stdlib.h>
#include "../objc-obj-c++-shared/Object1.h"
@@ -53,5 +54,3 @@ int main(void) {
return 0;
}
-
-#include "../objc-obj-c++-shared/Object1-implementation.h"
diff --git a/gcc/testsuite/objc.dg/method-4.m b/gcc/testsuite/objc.dg/method-4.m
index c5fa1a0861b..df25bba21ee 100644
--- a/gcc/testsuite/objc.dg/method-4.m
+++ b/gcc/testsuite/objc.dg/method-4.m
@@ -22,5 +22,5 @@ void foo(void) {
obj = [ObjectAlias2 new];
}
-/* { dg-final { scan-assembler "_OBJC_CLASS_REFERENCES_0" } } */
-/* { dg-final { scan-assembler-not "_OBJC_CLASS_REFERENCES_1" } } */
+/* { dg-final { scan-assembler "_OBJC_ClassRefs_0" } } */
+/* { dg-final { scan-assembler-not "_OBJC_ClassRefs_1" } } */
diff --git a/gcc/testsuite/objc.dg/next-runtime-1.m b/gcc/testsuite/objc.dg/next-runtime-1.m
index 9a0951cabee..c76b6166d2e 100644
--- a/gcc/testsuite/objc.dg/next-runtime-1.m
+++ b/gcc/testsuite/objc.dg/next-runtime-1.m
@@ -1,13 +1,14 @@
/* Test that the correct version number (6) is set in the module descriptor
- when compiling for the NeXT runtime. */
-/* Author: Ziemowit Laski <zlaski@apple.com> */
+ when compiling for the NeXT runtime ABI=0 - and that the MODULE descriptor
+ is not emitted at all for ABI 2. */
+/* modified from a testcase added by: Ziemowit Laski <zlaski@apple.com> */
/* { dg-do compile { target *-*-darwin* } } */
/* { dg-skip-if "" { *-*-* } { "-fgnu-runtime" } { "" } } */
+/* { dg-skip-if "" { *-*-* } { "-fobjc-abi-version=1" } { "" } } */
+/* { dg-options "-fobjc-abi-version=0" { target { *-*-darwin* && { ! lp64 } } } } */
-#include "../objc-obj-c++-shared/Object1.h"
-
-@interface FooBar: Object
+@interface FooBar
- (void)boo;
@end
@@ -15,5 +16,5 @@
- (void)boo { }
@end
-/* { dg-final { scan-assembler "L_OBJC_MODULES:\n\[ \t\]*\.long\t6\n" { target { *-*-darwin* && { ! lp64 } } } } } */
-/* { dg-final { scan-assembler "L_OBJC_MODULES:\n\[ \t\]*\.quad\t6\n" { target { *-*-darwin* && { lp64 } } } } } */
+/* { dg-final { scan-assembler "L_OBJC_Module:\n\[ \t\]*\.long\t6\n" { target { *-*-darwin* && { ! lp64 } } } } } */
+/* { dg-final { scan-assembler-not "L_OBJC_Module" { target { *-*-darwin* && { lp64 } } } } } */
diff --git a/gcc/testsuite/objc.dg/pr23214.m b/gcc/testsuite/objc.dg/pr23214.m
index 8443c946ead..d8092a8067a 100644
--- a/gcc/testsuite/objc.dg/pr23214.m
+++ b/gcc/testsuite/objc.dg/pr23214.m
@@ -3,10 +3,19 @@
/* { dg-do run } */
/* { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc2 } } } { "-fnext-runtime" } { "" } } */
-/* { dg-additional-sources "../objc-obj-c++-shared/Object1.m" } */
-#import "../objc-obj-c++-shared/Object1.h"
-#import "../objc-obj-c++-shared/Protocol1.h"
+#include <objc/Protocol.h>
+
+#ifdef __OBJC2__
+/* The ObjC V2 "Object" does not provide -class. */
+@interface Object (TS_CAT)
+- class;
+@end
+
+@implementation Object (TS_CAT)
+- class { return isa; }
+@end
+#endif
@protocol A
@end
diff --git a/gcc/testsuite/objc.dg/pr24393.m b/gcc/testsuite/objc.dg/pr24393.m
index 6dae2d317d5..269d84d9c2b 100644
--- a/gcc/testsuite/objc.dg/pr24393.m
+++ b/gcc/testsuite/objc.dg/pr24393.m
@@ -1,4 +1,4 @@
-/* { dg-compile } */
+/* { dg-do compile } */
#include <objc/objc.h>
@interface Foo
diff --git a/gcc/testsuite/objc.dg/pr45735.m b/gcc/testsuite/objc.dg/pr45735.m
index 852ee25daa4..395698bdb1d 100644
--- a/gcc/testsuite/objc.dg/pr45735.m
+++ b/gcc/testsuite/objc.dg/pr45735.m
@@ -1,4 +1,4 @@
-/* { dg-compile } */
+/* { dg-do compile } */
@interface Fraction
-(void) setNumerator: (int) :(int) ; /* { dg-error "expected identifier" } */
@end
diff --git a/gcc/testsuite/objc.dg/property/dotsyntax-22.m b/gcc/testsuite/objc.dg/property/dotsyntax-22.m
new file mode 100644
index 00000000000..cc583482263
--- /dev/null
+++ b/gcc/testsuite/objc.dg/property/dotsyntax-22.m
@@ -0,0 +1,19 @@
+/* PR objc/47784. This testcase used to crash the compiler. */
+
+typedef struct {
+ float x;
+} SomeType;
+
+@interface MyClass
+
+@property(assign,readwrite) SomeType position;
+
+@end
+
+void example (MyClass *x)
+{
+ const SomeType SomeTypeZero = {0.0f};
+
+ x.position= SomeTypeZero;
+}
+
diff --git a/gcc/testsuite/objc.dg/property/property.exp b/gcc/testsuite/objc.dg/property/property.exp
index 350c4b8339f..e8773018841 100644
--- a/gcc/testsuite/objc.dg/property/property.exp
+++ b/gcc/testsuite/objc.dg/property/property.exp
@@ -33,8 +33,9 @@ set tests [lsort [glob -nocomplain $srcdir/$subdir/*.m]]
# Main loop.
dg-runtest $tests "-fgnu-runtime" $DEFAULT_CFLAGS
-# darwin targets can also run code with the NeXT runtime.
-if [istarget "*-*-darwin*" ] {
+# Darwin targets can also run code with the NeXT runtime.
+# but Properties are not supported by the runtime lib before Darwin 9.
+if [istarget "*-*-darwin\[9123\]*" ] {
dg-runtest $tests "-fnext-runtime" $DEFAULT_CFLAGS
}
diff --git a/gcc/testsuite/objc.dg/selector-3.m b/gcc/testsuite/objc.dg/selector-3.m
index b3ffccaca3a..c0c5f3d8fba 100644
--- a/gcc/testsuite/objc.dg/selector-3.m
+++ b/gcc/testsuite/objc.dg/selector-3.m
@@ -23,5 +23,8 @@ typedef const struct objc_selector *SEL;
a = @selector(b1ar);
b = @selector(bar);
}
-@end /* { dg-warning "creating selector for nonexistent method .b1ar." } */
+@end
+
+/* FIXME: The error message should be on the correct line. */
+/* { dg-warning "creating selector for nonexistent method .b1ar." "" { target *-*-* } 0 } */
diff --git a/gcc/testsuite/objc.dg/special/load-category-1.m b/gcc/testsuite/objc.dg/special/load-category-1.m
index bfd6373d2b8..cb221436f02 100644
--- a/gcc/testsuite/objc.dg/special/load-category-1.m
+++ b/gcc/testsuite/objc.dg/special/load-category-1.m
@@ -4,7 +4,6 @@
#include <stdlib.h>
#include <objc/objc.h>
-#include <objc/runtime.h>
#include "load-category-1.h"
diff --git a/gcc/testsuite/objc.dg/special/load-category-1a.m b/gcc/testsuite/objc.dg/special/load-category-1a.m
index f516e7dfa3d..cdcb7d82919 100644
--- a/gcc/testsuite/objc.dg/special/load-category-1a.m
+++ b/gcc/testsuite/objc.dg/special/load-category-1a.m
@@ -2,7 +2,6 @@
#include <stdlib.h>
#include <objc/objc.h>
-#include <objc/runtime.h>
#include "load-category-1.h"
diff --git a/gcc/testsuite/objc.dg/special/load-category-2.m b/gcc/testsuite/objc.dg/special/load-category-2.m
index 6fd99fd2335..7dc74595206 100644
--- a/gcc/testsuite/objc.dg/special/load-category-2.m
+++ b/gcc/testsuite/objc.dg/special/load-category-2.m
@@ -5,7 +5,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <objc/objc.h>
-#include <objc/runtime.h>
#include "load-category-2.h"
diff --git a/gcc/testsuite/objc.dg/special/load-category-2a.m b/gcc/testsuite/objc.dg/special/load-category-2a.m
index f4e0af11d74..6b81240dbe9 100644
--- a/gcc/testsuite/objc.dg/special/load-category-2a.m
+++ b/gcc/testsuite/objc.dg/special/load-category-2a.m
@@ -3,7 +3,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <objc/objc.h>
-#include <objc/runtime.h>
#include "load-category-2.h"
diff --git a/gcc/testsuite/objc.dg/special/load-category-3.m b/gcc/testsuite/objc.dg/special/load-category-3.m
index c32f3ef2304..b89d8f15286 100644
--- a/gcc/testsuite/objc.dg/special/load-category-3.m
+++ b/gcc/testsuite/objc.dg/special/load-category-3.m
@@ -10,7 +10,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <objc/objc.h>
-#include <objc/runtime.h>
#include "load-category-3.h"
diff --git a/gcc/testsuite/objc.dg/special/load-category-3a.m b/gcc/testsuite/objc.dg/special/load-category-3a.m
index a16fe6f73d2..5ce5fac652c 100644
--- a/gcc/testsuite/objc.dg/special/load-category-3a.m
+++ b/gcc/testsuite/objc.dg/special/load-category-3a.m
@@ -8,7 +8,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <objc/objc.h>
-#include <objc/runtime.h>
#include "load-category-3.h"
diff --git a/gcc/testsuite/objc.dg/special/unclaimed-category-1.h b/gcc/testsuite/objc.dg/special/unclaimed-category-1.h
index 0453033f3d2..bf507a78824 100644
--- a/gcc/testsuite/objc.dg/special/unclaimed-category-1.h
+++ b/gcc/testsuite/objc.dg/special/unclaimed-category-1.h
@@ -5,7 +5,11 @@
@interface TestClass
{
+#ifdef __OBJC2__
+ Class isa;
+#else
id isa;
+#endif
}
- (int)D;
@end
diff --git a/gcc/testsuite/objc.dg/special/unclaimed-category-1.m b/gcc/testsuite/objc.dg/special/unclaimed-category-1.m
index 472ad8bbf83..88e3d8ea7d1 100644
--- a/gcc/testsuite/objc.dg/special/unclaimed-category-1.m
+++ b/gcc/testsuite/objc.dg/special/unclaimed-category-1.m
@@ -2,11 +2,11 @@
/* { dg-do run } */
/* { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc2 } } } { "-fnext-runtime" } { "" } } */
-#import "../../objc-obj-c++-shared/next-mapping.h"
#include <objc/objc.h>
#ifndef __NEXT_RUNTIME__
#include <objc/objc-api.h>
#endif
+#include "../../objc-obj-c++-shared/next-mapping.h"
extern void abort (void);
@@ -73,5 +73,3 @@ int main (void)
return 0;
}
-
-#import "../../objc-obj-c++-shared/Object1-implementation.h"
diff --git a/gcc/testsuite/objc.dg/symtab-1.m b/gcc/testsuite/objc.dg/symtab-1.m
index 100b245325e..936f8d494c7 100644
--- a/gcc/testsuite/objc.dg/symtab-1.m
+++ b/gcc/testsuite/objc.dg/symtab-1.m
@@ -4,7 +4,7 @@
/* { dg-do compile { target { *-*-darwin* } } } */
/* { dg-skip-if "" { *-*-* } { "-fgnu-runtime" } { "" } } */
-#include "../objc-obj-c++-shared/Object1.h"
+#include <objc/Object.h>
@interface Base: Object
- (void)setValues;
@@ -22,7 +22,6 @@
-(void)checkValues { }
@end
-/* { dg-final { scan-assembler "L_OBJC_SYMBOLS.*:\n\t.long\t0\n\t.long\t0\n\t.word\t2\n\t.word\t0\n\t.long\tL_OBJC_CLASS_Derived.*\n\t.long\tL_OBJC_CLASS_Base.*\n" { target { *86*-*-darwin* && { ! lp64 } } } } } */
-/* { dg-final { scan-assembler "L_OBJC_SYMBOLS.*:\n\t.long\t0\n\t.long\t0\n\t.short\t2\n\t.short\t0\n\t.long\tL_OBJC_CLASS_Derived.*\n\t.long\tL_OBJC_CLASS_Base.*\n" { target { powerpc*-*-darwin* && { ! lp64 } } } } } */
-/* { dg-final { scan-assembler "L_OBJC_SYMBOLS.*:\n\t.quad\t0\n\t.quad\t0\n\t.word\t2\n\t.word\t0\n\t.space 4\n\t.quad\tL_OBJC_CLASS_Derived.*\n\t.quad\tL_OBJC_CLASS_Base.*\n" { target { *86*-*-darwin* && { lp64 } } } } } */
-/* { dg-final { scan-assembler "L_OBJC_SYMBOLS.*:\n\t.quad\t0\n\t.quad\t0\n\t.short\t2\n\t.short\t0\n\t.space 4\n\t.quad\tL_OBJC_CLASS_Derived.*\n\t.quad\tL_OBJC_CLASS_Base.*\n" { target { powerpc*-*-darwin* && { lp64 } } } } } */
+/* { dg-final { scan-assembler "L_OBJC_Symbols.*:\n\t.long\t0\n\t.long\t0\n\t.word\t2\n\t.word\t0\n\t.long\tL_OBJC_Class_Derived.*\n\t.long\tL_OBJC_Class_Base.*\n" { target { *86*-*-darwin* && { ! lp64 } } } } } */
+/* { dg-final { scan-assembler "L_OBJC_Symbols.*:\n\t.long\t0\n\t.long\t0\n\t.short\t2\n\t.short\t0\n\t.long\tL_OBJC_Class_Derived.*\n\t.long\tL_OBJC_Class_Base.*\n" { target { powerpc*-*-darwin* && { ! lp64 } } } } } */
+/* { dg-final { scan-assembler-not "L_OBJC_Symbols" { target { *-*-darwin* && { lp64 } } } } } */
diff --git a/gcc/testsuite/objc.dg/torture/forward-1.m b/gcc/testsuite/objc.dg/torture/forward-1.m
index 518bf274e6d..bccf4a11233 100644
--- a/gcc/testsuite/objc.dg/torture/forward-1.m
+++ b/gcc/testsuite/objc.dg/torture/forward-1.m
@@ -1,14 +1,18 @@
/* { dg-do run } */
/* See if -forward::/-performv:: is able to work. */
/* { dg-xfail-run-if "PR36610" { ! { { i?86-*-* x86_64-*-* } && ilp32 } } { "-fgnu-runtime" } { "" } } */
-/* { dg-skip-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc2 } } } { "-fnext-runtime" } { "" } } */
+/* { dg-skip-if "Needs OBJC2 Implementation" { *-*-darwin* && { lp64 } } { "-fnext-runtime" } { "" } } */
+/* There is no implementation of forward: in the NeXT m64 libobjc/Object
+ neither have we implemented this in our extensions - so we have to skip it
+ for now. */
#include <stdio.h>
#include <stdlib.h>
-#import "../../objc-obj-c++-shared/Object1.h"
-#import "../../objc-obj-c++-shared/next-mapping.h"
-#include <objc/objc-api.h>
+#ifndef __NEXT_RUNTIME__
+# include <objc/objc-api.h>
+#endif
+#include <objc/Object.h>
#define VALUETOUSE 1234567890
diff --git a/gcc/testsuite/objc.dg/torture/strings/const-str-10.m b/gcc/testsuite/objc.dg/torture/strings/const-str-10.m
index c170f389dfb..f0f28238d9b 100644
--- a/gcc/testsuite/objc.dg/torture/strings/const-str-10.m
+++ b/gcc/testsuite/objc.dg/torture/strings/const-str-10.m
@@ -29,6 +29,7 @@ extern Class _NSConstantStringClassReference;
const NSConstantString *appKey = @"MyApp";
-/* { dg-final { scan-assembler ".section __OBJC, __cstring_object" } } */
+/* { dg-final { scan-assembler ".section __OBJC, __cstring_object" { target { *-*-darwin* && { ! lp64 } } } } } */
+/* { dg-final { scan-assembler ".section __DATA, __objc_stringobj" { target { *-*-darwin* && { lp64 } } } } } */
/* { dg-final { scan-assembler ".long\t__NSConstantStringClassReference\n\t.long\t.*\n\t.long\t5\n\t.data" { target { *-*-darwin* && { ! lp64 } } } } } */
-/* { dg-final { scan-assembler ".quad\t__NSConstantStringClassReference\n\t.quad\t.*\n\t.long\t5\n\t.space" { target { *-*-darwin* && { lp64 } } } } } */
+/* { dg-final { scan-assembler ".quad\t_OBJC_CLASS_._NSConstantString\n\t.quad\t.*\n\t.long\t5\n\t.space" { target { *-*-darwin* && { lp64 } } } } } */
diff --git a/gcc/testsuite/objc.dg/torture/strings/const-str-11.m b/gcc/testsuite/objc.dg/torture/strings/const-str-11.m
index 9f3705ef211..fa9dbd985a3 100644
--- a/gcc/testsuite/objc.dg/torture/strings/const-str-11.m
+++ b/gcc/testsuite/objc.dg/torture/strings/const-str-11.m
@@ -29,6 +29,7 @@ extern Class _XStrClassReference;
const XStr *appKey = @"MyApp";
-/* { dg-final { scan-assembler ".section __OBJC, __cstring_object" } } */
+/* { dg-final { scan-assembler ".section __OBJC, __cstring_object" { target { *-*-darwin* && { ! lp64 } } } } } */
+/* { dg-final { scan-assembler ".section __DATA, __objc_stringobj" { target { *-*-darwin* && { lp64 } } } } } */
/* { dg-final { scan-assembler ".long\t__XStrClassReference\n\t.long\t.*\n\t.long\t5\n\t.data" { target { *-*-darwin* && { ! lp64 } } } } } */
-/* { dg-final { scan-assembler ".quad\t__XStrClassReference\n\t.quad\t.*\n\t.long\t5\n\t.space" { target { *-*-darwin* && { lp64 } } } } } */
+/* { dg-final { scan-assembler ".quad\t_OBJC_CLASS_._XStr\n\t.quad\t.*\n\t.long\t5\n\t.space" { target { *-*-darwin* && { lp64 } } } } } */
diff --git a/gcc/testsuite/objc.dg/torture/strings/const-str-9.m b/gcc/testsuite/objc.dg/torture/strings/const-str-9.m
index ddbe93dde09..39bd1027435 100644
--- a/gcc/testsuite/objc.dg/torture/strings/const-str-9.m
+++ b/gcc/testsuite/objc.dg/torture/strings/const-str-9.m
@@ -21,6 +21,7 @@ Class _NSConstantStringClassReference;
const NSConstantString *appKey = @"MyApp";
-/* { dg-final { scan-assembler ".section __OBJC, __cstring_object" } } */
+/* { dg-final { scan-assembler ".section __OBJC, __cstring_object" { target { *-*-darwin* && { ! lp64 } } } } } */
+/* { dg-final { scan-assembler ".section __DATA, __objc_stringobj" { target { *-*-darwin* && { lp64 } } } } } */
/* { dg-final { scan-assembler ".long\t__NSConstantStringClassReference\n\t.long\t.*\n\t.long\t5\n\t.data" { target { *-*-darwin* && { ! lp64 } } } } } */
-/* { dg-final { scan-assembler ".quad\t__NSConstantStringClassReference\n\t.quad\t.*\n\t.long\t5\n\t.space" { target { *-*-darwin* && { lp64 } } } } } */
+/* { dg-final { scan-assembler ".quad\t_OBJC_CLASS_._NSConstantString\n\t.quad\t.*\n\t.long\t5\n\t.space" { target { *-*-darwin* && { lp64 } } } } } */
diff --git a/gcc/testsuite/objc.dg/type-size-3.m b/gcc/testsuite/objc.dg/type-size-3.m
index 9486658853c..bc66b0be67a 100644
--- a/gcc/testsuite/objc.dg/type-size-3.m
+++ b/gcc/testsuite/objc.dg/type-size-3.m
@@ -1,4 +1,4 @@
-/* Reject ivars with an unknown size. */
+/* Reject ivars that use flexible array members. */
/* Contributed by Nicola Pero <nicola.pero@meta-innovation.com> */
/* { dg-do compile } */
@@ -10,9 +10,9 @@ typedef struct
@interface Test
{
- test_type c;
+ test_type c; /* { dg-error "instance variable .c. uses flexible array member" } */
}
@end
@implementation Test
-@end /* { dg-error "instance variable has unknown size" } */
+@end
diff --git a/gcc/testsuite/objc.dg/type-size-4.m b/gcc/testsuite/objc.dg/type-size-4.m
new file mode 100644
index 00000000000..7e26da34a43
--- /dev/null
+++ b/gcc/testsuite/objc.dg/type-size-4.m
@@ -0,0 +1,23 @@
+/* Allow ivars that are pointers to structs with an unknown size. */
+/* Contributed by Nicola Pero <nicola.pero@meta-innovation.com> */
+/* PR objc/47832 */
+/* { dg-do compile } */
+
+typedef struct
+{
+ unsigned long int a;
+ double b[];
+} test_type;
+
+@interface Test
+{
+ /* These are all fine. */
+ double *a;
+ struct { int x; double y[]; } *b;
+ test_type *c;
+ union union_type { int x; test_type y; } *d;
+}
+@end
+
+@implementation Test
+@end
diff --git a/gcc/testsuite/objc.dg/type-size-5.m b/gcc/testsuite/objc.dg/type-size-5.m
new file mode 100644
index 00000000000..d89af32b452
--- /dev/null
+++ b/gcc/testsuite/objc.dg/type-size-5.m
@@ -0,0 +1,22 @@
+/* Reject ivars that use flexible array members. */
+/* Contributed by Nicola Pero <nicola.pero@meta-innovation.com> */
+/* { dg-do compile } */
+
+typedef struct
+{
+ unsigned long int a;
+ double b[];
+} test_type;
+
+@interface Test
+{
+ double a[]; /* { dg-error "instance variable .a. has unknown size" } */
+ struct { int x; double y[]; } b; /* { dg-error "instance variable .b. uses flexible array member" } */
+ test_type c; /* { dg-error "instance variable .c. uses flexible array member" } */
+ test_type d[4]; /* { dg-error "instance variable .d. uses flexible array member" } */
+ union union_type { int x; test_type y; } e; /* { dg-error "instance variable .e. uses flexible array member" } */
+}
+@end
+
+@implementation Test
+@end
diff --git a/gcc/testsuite/objc.dg/zero-link-1.m b/gcc/testsuite/objc.dg/zero-link-1.m
index 35cabfaf5de..c0400311169 100644
--- a/gcc/testsuite/objc.dg/zero-link-1.m
+++ b/gcc/testsuite/objc.dg/zero-link-1.m
@@ -25,6 +25,7 @@ int main(void) {
return 0;
}
-/* { dg-final { scan-assembler-not "_OBJC_CLASS_REFERENCES_0" } } */
+/* { dg-final { scan-assembler-not "_OBJC_ClassRefs_0" { target { *-*-darwin* && { ! lp64 } } } } } */
+/* { dg-final { scan-assembler-not "_OBJC_ClassRef_Base" { target { *-*-darwin* && { lp64 } } } } } */
/* { dg-final { scan-assembler "objc_getClass" } } */
diff --git a/gcc/testsuite/objc.dg/zero-link-2.m b/gcc/testsuite/objc.dg/zero-link-2.m
index 443090aaee7..ff82e5ed6d7 100644
--- a/gcc/testsuite/objc.dg/zero-link-2.m
+++ b/gcc/testsuite/objc.dg/zero-link-2.m
@@ -5,8 +5,7 @@
/* { dg-skip-if "" { *-*-* } { "-fgnu-runtime" } { "" } } */
/* { dg-options "-fno-zero-link" } */
-#include "../objc-obj-c++-shared/Object1.h"
-#include <objc/objc.h>
+#include <objc/Object.h>
extern void abort(void);
#define CHECK_IF(expr) if(!(expr)) abort();
@@ -25,5 +24,6 @@ int main(void) {
return 0;
}
-/* { dg-final { scan-assembler "_OBJC_CLASS_REFERENCES_0" } } */
+/* { dg-final { scan-assembler "_OBJC_ClassRefs_0" { target { *-*-darwin* && { ! lp64 } } } } } */
+/* { dg-final { scan-assembler "_OBJC_ClassRef_Base" { target { *-*-darwin* && { lp64 } } } } } */
/* { dg-final { scan-assembler-not "objc_getClass" } } */
diff --git a/gcc/testsuite/objc/execute/accessing_ivars.m b/gcc/testsuite/objc/execute/accessing_ivars.m
index dbde8cd11dd..e4c9cf4cd42 100644
--- a/gcc/testsuite/objc/execute/accessing_ivars.m
+++ b/gcc/testsuite/objc/execute/accessing_ivars.m
@@ -1,7 +1,9 @@
/* Contributed by Nicola Pero - Thu Mar 8 16:27:46 CET 2001 */
#include <stdlib.h>
-#import "../../objc-obj-c++-shared/Object1.h"
+#ifndef __NEXT_RUNTIME__
#include <objc/objc-api.h>
+#endif
+#include "../../objc-obj-c++-shared/Object1.h"
/* Test that by using -> we can access ivars of other objects of the same
class */
@@ -53,3 +55,4 @@ int main (void)
return 0;
}
+#include "../../objc-obj-c++-shared/Object1-implementation.h"
diff --git a/gcc/testsuite/objc/execute/bf-common.h b/gcc/testsuite/objc/execute/bf-common.h
index c79c3efacb4..ca70c21a411 100644
--- a/gcc/testsuite/objc/execute/bf-common.h
+++ b/gcc/testsuite/objc/execute/bf-common.h
@@ -11,6 +11,7 @@
#define objc_get_class(C) objc_getClass(C)
#endif
+#ifndef __OBJC2__
void print_ivars (Class class)
{
struct objc_ivar_list* ivars = class->ivars;
@@ -61,9 +62,11 @@ void compare_structures (Class class, const char* type)
printf ("%d ivars checked\n", i);
}
+#endif
int main ()
{
+#ifndef __OBJC2__
struct class_vars
{
@defs (MyObject);
@@ -80,8 +83,10 @@ int main ()
printf ("sizes don't match (computed %d, exact %d)\n", size1, size2);
abort ();
}
+#endif
exit (0);
}
-
+#ifndef __OBJC2__
#include "../../objc-obj-c++-shared/objc-test-suite-next-encode-assist-impl.h"
+#endif
diff --git a/gcc/testsuite/objc/execute/bycopy-2.m b/gcc/testsuite/objc/execute/bycopy-2.m
index 8e7f169293f..840881f4a97 100644
--- a/gcc/testsuite/objc/execute/bycopy-2.m
+++ b/gcc/testsuite/objc/execute/bycopy-2.m
@@ -27,5 +27,4 @@ int main (void)
exit (0);
}
-
-
+#include "../../objc-obj-c++-shared/Object1-implementation.h"
diff --git a/gcc/testsuite/objc/execute/bycopy-3.m b/gcc/testsuite/objc/execute/bycopy-3.m
index 4c2bd27613d..15c49a5dd34 100644
--- a/gcc/testsuite/objc/execute/bycopy-3.m
+++ b/gcc/testsuite/objc/execute/bycopy-3.m
@@ -24,6 +24,12 @@ extern int printf (const char *, ...);
/* This no-op class to keep it compile under broken gcc 3.x */
@interface MyObject : Object <MyProtocol>
+#ifdef __OBJC2__
++ (id) initialize;
++ (id) alloc;
++ new;
+- init;
+#endif
@end
@implementation MyObject
@@ -31,6 +37,12 @@ extern int printf (const char *, ...);
{
return [MyObject alloc];
}
+#ifdef __OBJC2__
++ initialize {return self;}
++ alloc { return class_createInstance (self, 0);}
++ new { return [[self alloc] init]; }
+- init {return self;}
+#endif
@end
/* The following header, together with the implementation included below,
diff --git a/gcc/testsuite/objc/execute/class-tests-1.h b/gcc/testsuite/objc/execute/class-tests-1.h
index ebc49b66c22..54a77d247f7 100644
--- a/gcc/testsuite/objc/execute/class-tests-1.h
+++ b/gcc/testsuite/objc/execute/class-tests-1.h
@@ -1,5 +1,6 @@
/* Contributed by Nicola Pero on Tue Mar 6 23:05:53 CET 2001 */
+#include <stdio.h>
#include <stdlib.h>
#include "../../objc-obj-c++-shared/Object1.h"
#include <objc/objc.h>
diff --git a/gcc/testsuite/objc/execute/class-tests-2.h b/gcc/testsuite/objc/execute/class-tests-2.h
index cc14abb4343..1aa73947d63 100644
--- a/gcc/testsuite/objc/execute/class-tests-2.h
+++ b/gcc/testsuite/objc/execute/class-tests-2.h
@@ -1,6 +1,7 @@
/* Contributed by Nicola Pero on Tue Mar 6 23:05:53 CET 2001 */
#include <objc/objc.h>
#include <objc/objc-api.h>
+#include <stdio.h>
#include <stdlib.h>
/*
diff --git a/gcc/testsuite/objc/execute/compatibility_alias.m b/gcc/testsuite/objc/execute/compatibility_alias.m
index b134f0c85fa..61d7625122d 100644
--- a/gcc/testsuite/objc/execute/compatibility_alias.m
+++ b/gcc/testsuite/objc/execute/compatibility_alias.m
@@ -10,3 +10,4 @@ int main (void)
return 0;
}
+#include "../../objc-obj-c++-shared/Object1-implementation.h"
diff --git a/gcc/testsuite/objc/execute/enumeration-1.m b/gcc/testsuite/objc/execute/enumeration-1.m
index 1adcfd02e95..57d1a4bf69a 100644
--- a/gcc/testsuite/objc/execute/enumeration-1.m
+++ b/gcc/testsuite/objc/execute/enumeration-1.m
@@ -48,3 +48,4 @@ int main (void)
return 0;
}
+#include "../../objc-obj-c++-shared/Object1-implementation.h"
diff --git a/gcc/testsuite/objc/execute/enumeration-2.m b/gcc/testsuite/objc/execute/enumeration-2.m
index c47bb8a583d..3094963c682 100644
--- a/gcc/testsuite/objc/execute/enumeration-2.m
+++ b/gcc/testsuite/objc/execute/enumeration-2.m
@@ -50,3 +50,4 @@ int main (void)
return 0;
}
+#include "../../objc-obj-c++-shared/Object1-implementation.h"
diff --git a/gcc/testsuite/objc/execute/exceptions/catchall-1.m b/gcc/testsuite/objc/execute/exceptions/catchall-1.m
index 01eff9257a3..2db40a85486 100644
--- a/gcc/testsuite/objc/execute/exceptions/catchall-1.m
+++ b/gcc/testsuite/objc/execute/exceptions/catchall-1.m
@@ -74,3 +74,4 @@ int main (void) {
test((Object *)-1);
return 0;
}
+#import "../../../objc-obj-c++-shared/Object1-implementation.h"
diff --git a/gcc/testsuite/objc/execute/exceptions/exceptions.exp b/gcc/testsuite/objc/execute/exceptions/exceptions.exp
index 173f65694ca..0443ca130ee 100644
--- a/gcc/testsuite/objc/execute/exceptions/exceptions.exp
+++ b/gcc/testsuite/objc/execute/exceptions/exceptions.exp
@@ -28,6 +28,7 @@ lappend additional_flags "-fobjc-exceptions"
# load support procs
load_lib objc-torture.exp
load_lib torture-options.exp
+load_lib target-supports.exp
torture-init
objc-set-runtime-options "execute" "additional_flags=-fobjc-exceptions"
diff --git a/gcc/testsuite/objc/execute/exceptions/finally-1.m b/gcc/testsuite/objc/execute/exceptions/finally-1.m
index 5206c77cf37..370b19bb5ef 100644
--- a/gcc/testsuite/objc/execute/exceptions/finally-1.m
+++ b/gcc/testsuite/objc/execute/exceptions/finally-1.m
@@ -1,6 +1,22 @@
#include <stdio.h>
#include <stdlib.h>
+//#import "../../../objc-obj-c++-shared/Object1.h"
+#ifdef __OBJC2__
+#include <objc/runtime.h>
+@interface Object
++ initialize;
++ new;
+- free;
+@end
+@implementation Object
++ initialize { return self; }
++ new { return class_createInstance (self, 0); }
+- free { return object_dispose(self);}
+@end
+
+#else
#import "../../../objc-obj-c++-shared/Object1.h"
+#endif
static int made_try = 0;
@@ -57,3 +73,4 @@ main(int ac, char *av[])
abort ();
return 0;
}
+//#import "../../../objc-obj-c++-shared/Object1-implementation.h"
diff --git a/gcc/testsuite/objc/execute/exceptions/foward-1.m b/gcc/testsuite/objc/execute/exceptions/foward-1.m
index ae5d9273fdf..6b31d7cc86c 100644
--- a/gcc/testsuite/objc/execute/exceptions/foward-1.m
+++ b/gcc/testsuite/objc/execute/exceptions/foward-1.m
@@ -2,12 +2,33 @@
/* Developed by Marcin Koziej <creep@desk.pl>. */
#include <stdlib.h>
-#import "../../../objc-obj-c++-shared/Object1.h"
+#include <objc/Object.h>
+#ifndef __NEXT_RUNTIME__
#import <objc/objc-api.h>
+#endif
+
+#ifdef __OBJC2__
+@interface Object (TEST_SUITE_ADDITIONS)
++ initialize;
++ alloc;
++ new;
+- init;
+- free;
+@end
+
+@implementation Object (TEST_SUITE_ADDITIONS)
++ initialize { return self; }
++ alloc { return class_createInstance (self, 0); }
++ new { return [[self alloc] init]; }
+- init { return self; }
+- free { return object_dispose(self); }
+@end
+#endif
static int i;
-@interface Thrower : Object
+__attribute__((objc_exception))
+@interface Thrower : Object
- forward: (SEL) s : (void*) a;
@end
@@ -16,8 +37,10 @@ static int i;
{
i++;
@throw [Object new];
+ return nil;
}
@end
+
int
main()
{
diff --git a/gcc/testsuite/objc/execute/exceptions/foward-1.x b/gcc/testsuite/objc/execute/exceptions/foward-1.x
new file mode 100644
index 00000000000..9acd2737ab4
--- /dev/null
+++ b/gcc/testsuite/objc/execute/exceptions/foward-1.x
@@ -0,0 +1,11 @@
+# XFAIL the run for m64 Darwin NeXT (seems to be a system runtime lib problem).
+if { [istarget *-*-darwin*] && [check_effective_target_lp64] } {
+ set torture_eval_before_execute {
+ global compiler_conditional_xfail_data
+ set compiler_conditional_xfail_data {
+ "Target fails for fnext-runtime" "*-*-*" { "-fnext-runtime" } { "" }
+ }
+ }
+}
+# carry on...
+return false
diff --git a/gcc/testsuite/objc/execute/exceptions/local-variables-1.m b/gcc/testsuite/objc/execute/exceptions/local-variables-1.m
index fa419f9e1f8..0488d792dcd 100644
--- a/gcc/testsuite/objc/execute/exceptions/local-variables-1.m
+++ b/gcc/testsuite/objc/execute/exceptions/local-variables-1.m
@@ -60,3 +60,4 @@ int main(void) {
foo(15, &gf1);
return 0;
}
+#import "../../../objc-obj-c++-shared/Object1-implementation.h"
diff --git a/gcc/testsuite/objc/execute/formal_protocol-1.m b/gcc/testsuite/objc/execute/formal_protocol-1.m
index a62def3ba6f..651444963f8 100644
--- a/gcc/testsuite/objc/execute/formal_protocol-1.m
+++ b/gcc/testsuite/objc/execute/formal_protocol-1.m
@@ -42,4 +42,4 @@ int main (void)
return 0;
}
-
+#include "../../objc-obj-c++-shared/Object1-implementation.h"
diff --git a/gcc/testsuite/objc/execute/formal_protocol-2.m b/gcc/testsuite/objc/execute/formal_protocol-2.m
index a0f7eecc81a..b830cd96ee5 100644
--- a/gcc/testsuite/objc/execute/formal_protocol-2.m
+++ b/gcc/testsuite/objc/execute/formal_protocol-2.m
@@ -43,4 +43,4 @@ int main (void)
return 0;
}
-
+#include "../../objc-obj-c++-shared/Object1-implementation.h"
diff --git a/gcc/testsuite/objc/execute/formal_protocol-3.m b/gcc/testsuite/objc/execute/formal_protocol-3.m
index c55773a668a..f28c95fecbf 100644
--- a/gcc/testsuite/objc/execute/formal_protocol-3.m
+++ b/gcc/testsuite/objc/execute/formal_protocol-3.m
@@ -56,4 +56,4 @@ int main (void)
return 0;
}
-
+#include "../../objc-obj-c++-shared/Object1-implementation.h"
diff --git a/gcc/testsuite/objc/execute/formal_protocol-4.m b/gcc/testsuite/objc/execute/formal_protocol-4.m
index 92f05211702..10aba89360a 100644
--- a/gcc/testsuite/objc/execute/formal_protocol-4.m
+++ b/gcc/testsuite/objc/execute/formal_protocol-4.m
@@ -38,4 +38,4 @@ int main (void)
return 0;
}
-
+#include "../../objc-obj-c++-shared/Object1-implementation.h"
diff --git a/gcc/testsuite/objc/execute/formal_protocol-5.m b/gcc/testsuite/objc/execute/formal_protocol-5.m
index 8bb63ecfa66..c3bd53d3ace 100644
--- a/gcc/testsuite/objc/execute/formal_protocol-5.m
+++ b/gcc/testsuite/objc/execute/formal_protocol-5.m
@@ -1,7 +1,8 @@
/* Contributed by Nicola Pero - Fri Mar 9 21:35:47 CET 2001 */
#include <stdlib.h>
-#include "../../objc-obj-c++-shared/Protocol1.h"
+#include <objc/Protocol.h>
+#include "../../objc-obj-c++-shared/next-mapping.h"
/* Test defining a protocol, and accessing it using @protocol */
@@ -35,4 +36,3 @@ int main (void)
return 0;
}
-
diff --git a/gcc/testsuite/objc/execute/formal_protocol-6.m b/gcc/testsuite/objc/execute/formal_protocol-6.m
index dd42b370192..b02fc1ea42c 100644
--- a/gcc/testsuite/objc/execute/formal_protocol-6.m
+++ b/gcc/testsuite/objc/execute/formal_protocol-6.m
@@ -1,7 +1,8 @@
/* Contributed by Nicola Pero - Fri Mar 9 21:35:47 CET 2001 */
#include <stdlib.h>
-#include "../../objc-obj-c++-shared/Protocol1.h"
+#include <objc/Protocol.h>
+#include "../../objc-obj-c++-shared/next-mapping.h"
/* Test defining a protocol, and accessing it using @protocol */
diff --git a/gcc/testsuite/objc/execute/formal_protocol-7.m b/gcc/testsuite/objc/execute/formal_protocol-7.m
index c4e18500f50..d15013a29ef 100644
--- a/gcc/testsuite/objc/execute/formal_protocol-7.m
+++ b/gcc/testsuite/objc/execute/formal_protocol-7.m
@@ -41,4 +41,4 @@ int main (void)
return 0;
}
-
+#include "../../objc-obj-c++-shared/Object1-implementation.h"
diff --git a/gcc/testsuite/objc/execute/no_clash.m b/gcc/testsuite/objc/execute/no_clash.m
index 9cb004d2829..d4ab4cb1c87 100644
--- a/gcc/testsuite/objc/execute/no_clash.m
+++ b/gcc/testsuite/objc/execute/no_clash.m
@@ -39,3 +39,4 @@ int main (void)
return 0;
}
+#include "../../objc-obj-c++-shared/Object1-implementation.h"
diff --git a/gcc/testsuite/objc/execute/object_is_class.m b/gcc/testsuite/objc/execute/object_is_class.m
index 199517e43a2..14a7f5232e7 100644
--- a/gcc/testsuite/objc/execute/object_is_class.m
+++ b/gcc/testsuite/objc/execute/object_is_class.m
@@ -1,8 +1,10 @@
/* Contributed by Nicola Pero - Tue Jul 3 10:55:21 BST 2001 */
-#import "../../objc-obj-c++-shared/next-mapping.h"
-#import "../../objc-obj-c++-shared/Object1.h"
-#include <objc/objc.h>
-#include <objc/objc-api.h>
+#ifdef __NEXT_RUNTIME__
+# include "../../objc-obj-c++-shared/next-mapping.h"
+#else
+# include <objc/objc-api.h>
+#endif
+#include "../../objc-obj-c++-shared/Object1.h"
/* This test demonstrate a failure in object_is_class which was fixed */
@@ -41,3 +43,4 @@ int main (void)
return 0;
}
+#include "../../objc-obj-c++-shared/Object1-implementation.h"
diff --git a/gcc/testsuite/objc/execute/object_is_meta_class.m b/gcc/testsuite/objc/execute/object_is_meta_class.m
index d5aedca0899..91a628ebac1 100644
--- a/gcc/testsuite/objc/execute/object_is_meta_class.m
+++ b/gcc/testsuite/objc/execute/object_is_meta_class.m
@@ -1,7 +1,10 @@
/* Contributed by Nicola Pero - Tue Jul 3 10:55:21 BST 2001 */
-#import "../../objc-obj-c++-shared/Object1.h"
-#import "../../objc-obj-c++-shared/next-mapping.h"
-#include <objc/objc-api.h>
+#ifdef __NEXT_RUNTIME__
+# include "../../objc-obj-c++-shared/next-mapping.h"
+#else
+# include <objc/objc-api.h>
+#endif
+#include "../../objc-obj-c++-shared/Object1.h"
/* This test demonstrate a failure in object_is_meta_class which was fixed */
@@ -38,4 +41,4 @@ int main (void)
return 0;
}
-
+#include "../../objc-obj-c++-shared/Object1-implementation.h"
diff --git a/gcc/toplev.c b/gcc/toplev.c
index 7e587e9fc90..33ff980f6dc 100644
--- a/gcc/toplev.c
+++ b/gcc/toplev.c
@@ -1,7 +1,7 @@
/* Top level of GCC compilers (cc1, cc1plus, etc.)
Copyright (C) 1987, 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
- 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
- Free Software Foundation, Inc.
+ 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
+ 2011 Free Software Foundation, Inc.
This file is part of GCC.
@@ -1314,12 +1314,16 @@ process_options (void)
#ifndef HAVE_cloog
if (flag_graphite
+ || flag_graphite_identity
|| flag_loop_block
+ || flag_loop_flatten
|| flag_loop_interchange
|| flag_loop_strip_mine
- || flag_graphite_identity
|| flag_loop_parallelize_all)
- sorry ("Graphite loop optimizations cannot be used");
+ sorry ("Graphite loop optimizations cannot be used (-fgraphite, "
+ "-fgraphite-identity, -floop-block, -floop-flatten, "
+ "-floop-interchange, -floop-strip-mine, -floop-parallelize-all, "
+ "and -ftree-loop-linear)");
#endif
/* Unrolling all loops implies that standard loop unrolling must also
@@ -1777,11 +1781,32 @@ lang_dependent_init (const char *name)
void
target_reinit (void)
{
+ struct rtl_data saved_x_rtl;
+ rtx *saved_regno_reg_rtx;
+
+ /* Save *crtl and regno_reg_rtx around the reinitialization
+ to allow target_reinit being called even after prepare_function_start. */
+ saved_regno_reg_rtx = crtl->emit.regno_reg_rtx;
+ if (saved_regno_reg_rtx)
+ {
+ saved_x_rtl = *crtl;
+ memset (crtl, '\0', sizeof (*crtl));
+ }
+
/* Reinitialize RTL backend. */
backend_init_target ();
/* Reinitialize lang-dependent parts. */
lang_dependent_init_target ();
+
+ /* And restore it at the end, as free_after_compilation from
+ expand_dummy_function_end clears it. */
+ if (saved_regno_reg_rtx)
+ {
+ *crtl = saved_x_rtl;
+ crtl->emit.regno_reg_rtx = saved_regno_reg_rtx;
+ saved_regno_reg_rtx = NULL;
+ }
}
void
diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c
index ade2c88f7ef..1f533a33086 100644
--- a/gcc/tree-cfg.c
+++ b/gcc/tree-cfg.c
@@ -3135,6 +3135,7 @@ verify_gimple_call (gimple stmt)
{
error ("invalid argument to gimple call");
debug_generic_expr (arg);
+ return true;
}
}
diff --git a/gcc/tree-chrec.c b/gcc/tree-chrec.c
index c721d43e33e..1e49c1d5b21 100644
--- a/gcc/tree-chrec.c
+++ b/gcc/tree-chrec.c
@@ -1238,8 +1238,11 @@ convert_affine_scev (struct loop *loop, tree type,
performed by default when CT is signed. */
new_step = *step;
if (TYPE_PRECISION (step_type) > TYPE_PRECISION (ct) && TYPE_UNSIGNED (ct))
- new_step = chrec_convert_1 (signed_type_for (ct), new_step, at_stmt,
- use_overflow_semantics);
+ {
+ tree signed_ct = build_nonstandard_integer_type (TYPE_PRECISION (ct), 0);
+ new_step = chrec_convert_1 (signed_ct, new_step, at_stmt,
+ use_overflow_semantics);
+ }
new_step = chrec_convert_1 (step_type, new_step, at_stmt, use_overflow_semantics);
if (automatically_generated_chrec_p (new_base)
@@ -1579,4 +1582,3 @@ evolution_function_right_is_integer_cst (const_tree chrec)
return false;
}
}
-
diff --git a/gcc/tree-data-ref.c b/gcc/tree-data-ref.c
index 3de3234c22b..54cb46c9464 100644
--- a/gcc/tree-data-ref.c
+++ b/gcc/tree-data-ref.c
@@ -193,7 +193,9 @@ dump_data_reference (FILE *outf,
{
unsigned int i;
- fprintf (outf, "#(Data Ref: \n# stmt: ");
+ fprintf (outf, "#(Data Ref: \n");
+ fprintf (outf, "# bb: %d \n", gimple_bb (DR_STMT (dr))->index);
+ fprintf (outf, "# stmt: ");
print_gimple_stmt (outf, DR_STMT (dr), 0, 0);
fprintf (outf, "# ref: ");
print_generic_stmt (outf, DR_REF (dr), 0);
@@ -338,6 +340,18 @@ print_dir_vectors (FILE *outf, VEC (lambda_vector, heap) *dir_vects,
print_direction_vector (outf, v, length);
}
+/* Print out a vector VEC of length N to OUTFILE. */
+
+static inline void
+print_lambda_vector (FILE * outfile, lambda_vector vector, int n)
+{
+ int i;
+
+ for (i = 0; i < n; i++)
+ fprintf (outfile, "%3d ", vector[i]);
+ fprintf (outfile, "\n");
+}
+
/* Print a vector of distance vectors. */
void
@@ -818,13 +832,11 @@ dr_analyze_innermost (struct data_reference *dr)
}
/* Determines the base object and the list of indices of memory reference
- DR, analyzed in loop nest NEST. */
+ DR, analyzed in LOOP and instantiated in loop nest NEST. */
static void
-dr_analyze_indices (struct data_reference *dr, struct loop *nest)
+dr_analyze_indices (struct data_reference *dr, loop_p nest, loop_p loop)
{
- gimple stmt = DR_STMT (dr);
- struct loop *loop = loop_containing_stmt (stmt);
VEC (tree, heap) *access_fns = NULL;
tree ref = unshare_expr (DR_REF (dr)), aref = ref, op;
tree base, off, access_fn = NULL_TREE;
@@ -933,11 +945,13 @@ free_data_ref (data_reference_p dr)
/* Analyzes memory reference MEMREF accessed in STMT. The reference
is read if IS_READ is true, write otherwise. Returns the
- data_reference description of MEMREF. NEST is the outermost loop of the
- loop nest in that the reference should be analyzed. */
+ data_reference description of MEMREF. NEST is the outermost loop
+ in which the reference should be instantiated, LOOP is the loop in
+ which the data reference should be analyzed. */
struct data_reference *
-create_data_ref (struct loop *nest, tree memref, gimple stmt, bool is_read)
+create_data_ref (loop_p nest, loop_p loop, tree memref, gimple stmt,
+ bool is_read)
{
struct data_reference *dr;
@@ -954,7 +968,7 @@ create_data_ref (struct loop *nest, tree memref, gimple stmt, bool is_read)
DR_IS_READ (dr) = is_read;
dr_analyze_innermost (dr);
- dr_analyze_indices (dr, nest);
+ dr_analyze_indices (dr, nest, loop);
dr_analyze_alias (dr);
if (dump_file && (dump_flags & TDF_DETAILS))
@@ -2062,6 +2076,168 @@ compute_overlap_steps_for_affine_1_2 (tree chrec_a, tree chrec_b,
affine_fn_free (overlaps_b_xyz);
}
+/* Copy the elements of vector VEC1 with length SIZE to VEC2. */
+
+static void
+lambda_vector_copy (lambda_vector vec1, lambda_vector vec2,
+ int size)
+{
+ memcpy (vec2, vec1, size * sizeof (*vec1));
+}
+
+/* Copy the elements of M x N matrix MAT1 to MAT2. */
+
+static void
+lambda_matrix_copy (lambda_matrix mat1, lambda_matrix mat2,
+ int m, int n)
+{
+ int i;
+
+ for (i = 0; i < m; i++)
+ lambda_vector_copy (mat1[i], mat2[i], n);
+}
+
+/* Store the N x N identity matrix in MAT. */
+
+static void
+lambda_matrix_id (lambda_matrix mat, int size)
+{
+ int i, j;
+
+ for (i = 0; i < size; i++)
+ for (j = 0; j < size; j++)
+ mat[i][j] = (i == j) ? 1 : 0;
+}
+
+/* Return the first nonzero element of vector VEC1 between START and N.
+ We must have START <= N. Returns N if VEC1 is the zero vector. */
+
+static int
+lambda_vector_first_nz (lambda_vector vec1, int n, int start)
+{
+ int j = start;
+ while (j < n && vec1[j] == 0)
+ j++;
+ return j;
+}
+
+/* Add a multiple of row R1 of matrix MAT with N columns to row R2:
+ R2 = R2 + CONST1 * R1. */
+
+static void
+lambda_matrix_row_add (lambda_matrix mat, int n, int r1, int r2, int const1)
+{
+ int i;
+
+ if (const1 == 0)
+ return;
+
+ for (i = 0; i < n; i++)
+ mat[r2][i] += const1 * mat[r1][i];
+}
+
+/* Swap rows R1 and R2 in matrix MAT. */
+
+static void
+lambda_matrix_row_exchange (lambda_matrix mat, int r1, int r2)
+{
+ lambda_vector row;
+
+ row = mat[r1];
+ mat[r1] = mat[r2];
+ mat[r2] = row;
+}
+
+/* Multiply vector VEC1 of length SIZE by a constant CONST1,
+ and store the result in VEC2. */
+
+static void
+lambda_vector_mult_const (lambda_vector vec1, lambda_vector vec2,
+ int size, int const1)
+{
+ int i;
+
+ if (const1 == 0)
+ lambda_vector_clear (vec2, size);
+ else
+ for (i = 0; i < size; i++)
+ vec2[i] = const1 * vec1[i];
+}
+
+/* Negate vector VEC1 with length SIZE and store it in VEC2. */
+
+static void
+lambda_vector_negate (lambda_vector vec1, lambda_vector vec2,
+ int size)
+{
+ lambda_vector_mult_const (vec1, vec2, size, -1);
+}
+
+/* Negate row R1 of matrix MAT which has N columns. */
+
+static void
+lambda_matrix_row_negate (lambda_matrix mat, int n, int r1)
+{
+ lambda_vector_negate (mat[r1], mat[r1], n);
+}
+
+/* Return true if two vectors are equal. */
+
+static bool
+lambda_vector_equal (lambda_vector vec1, lambda_vector vec2, int size)
+{
+ int i;
+ for (i = 0; i < size; i++)
+ if (vec1[i] != vec2[i])
+ return false;
+ return true;
+}
+
+/* Given an M x N integer matrix A, this function determines an M x
+ M unimodular matrix U, and an M x N echelon matrix S such that
+ "U.A = S". This decomposition is also known as "right Hermite".
+
+ Ref: Algorithm 2.1 page 33 in "Loop Transformations for
+ Restructuring Compilers" Utpal Banerjee. */
+
+static void
+lambda_matrix_right_hermite (lambda_matrix A, int m, int n,
+ lambda_matrix S, lambda_matrix U)
+{
+ int i, j, i0 = 0;
+
+ lambda_matrix_copy (A, S, m, n);
+ lambda_matrix_id (U, m);
+
+ for (j = 0; j < n; j++)
+ {
+ if (lambda_vector_first_nz (S[j], m, i0) < m)
+ {
+ ++i0;
+ for (i = m - 1; i >= i0; i--)
+ {
+ while (S[i][j] != 0)
+ {
+ int sigma, factor, a, b;
+
+ a = S[i-1][j];
+ b = S[i][j];
+ sigma = (a * b < 0) ? -1: 1;
+ a = abs (a);
+ b = abs (b);
+ factor = sigma * (a / b);
+
+ lambda_matrix_row_add (S, n, i, i-1, -factor);
+ lambda_matrix_row_exchange (S, i, i-1);
+
+ lambda_matrix_row_add (U, m, i, i-1, -factor);
+ lambda_matrix_row_exchange (U, i, i-1);
+ }
+ }
+ }
+ }
+}
+
/* Determines the overlapping elements due to accesses CHREC_A and
CHREC_B, that are affine functions. This function cannot handle
symbolic evolution functions, ie. when initial conditions are
@@ -2505,14 +2681,6 @@ analyze_miv_subscript (tree chrec_a,
tree *last_conflicts,
struct loop *loop_nest)
{
- /* FIXME: This is a MIV subscript, not yet handled.
- Example: (A[{1, +, 1}_1] vs. A[{1, +, 1}_2]) that comes from
- (A[i] vs. A[j]).
-
- In the SIV test we had to solve a Diophantine equation with two
- variables. In the MIV case we have to solve a Diophantine
- equation with 2*n variables (if the subscript uses n IVs).
- */
tree type, difference;
dependence_stats.num_miv++;
@@ -2784,29 +2952,19 @@ build_classic_dist_vector_1 (struct data_dependence_relation *ddr,
&& TREE_CODE (access_fn_b) == POLYNOMIAL_CHREC)
{
int dist, index;
- int index_a = index_in_loop_nest (CHREC_VARIABLE (access_fn_a),
- DDR_LOOP_NEST (ddr));
- int index_b = index_in_loop_nest (CHREC_VARIABLE (access_fn_b),
- DDR_LOOP_NEST (ddr));
-
- /* The dependence is carried by the outermost loop. Example:
- | loop_1
- | A[{4, +, 1}_1]
- | loop_2
- | A[{5, +, 1}_2]
- | endloop_2
- | endloop_1
- In this case, the dependence is carried by loop_1. */
- index = index_a < index_b ? index_a : index_b;
- *index_carry = MIN (index, *index_carry);
+ int var_a = CHREC_VARIABLE (access_fn_a);
+ int var_b = CHREC_VARIABLE (access_fn_b);
- if (chrec_contains_undetermined (SUB_DISTANCE (subscript)))
+ if (var_a != var_b
+ || chrec_contains_undetermined (SUB_DISTANCE (subscript)))
{
non_affine_dependence_relation (ddr);
return false;
}
dist = int_cst_value (SUB_DISTANCE (subscript));
+ index = index_in_loop_nest (var_a, DDR_LOOP_NEST (ddr));
+ *index_carry = MIN (index, *index_carry);
/* This is the subscript coupling test. If we have already
recorded a distance for this loop (a distance coming from
@@ -4077,7 +4235,8 @@ find_data_references_in_stmt (struct loop *nest, gimple stmt,
FOR_EACH_VEC_ELT (data_ref_loc, references, i, ref)
{
- dr = create_data_ref (nest, *ref->pos, stmt, ref->is_read);
+ dr = create_data_ref (nest, loop_containing_stmt (stmt),
+ *ref->pos, stmt, ref->is_read);
gcc_assert (dr != NULL);
/* FIXME -- data dependence analysis does not work correctly for objects
@@ -4098,12 +4257,14 @@ find_data_references_in_stmt (struct loop *nest, gimple stmt,
return ret;
}
-/* Stores the data references in STMT to DATAREFS. If there is an unanalyzable
- reference, returns false, otherwise returns true. NEST is the outermost
- loop of the loop nest in which the references should be analyzed. */
+/* Stores the data references in STMT to DATAREFS. If there is an
+ unanalyzable reference, returns false, otherwise returns true.
+ NEST is the outermost loop of the loop nest in which the references
+ should be instantiated, LOOP is the loop in which the references
+ should be analyzed. */
bool
-graphite_find_data_references_in_stmt (struct loop *nest, gimple stmt,
+graphite_find_data_references_in_stmt (loop_p nest, loop_p loop, gimple stmt,
VEC (data_reference_p, heap) **datarefs)
{
unsigned i;
@@ -4120,7 +4281,7 @@ graphite_find_data_references_in_stmt (struct loop *nest, gimple stmt,
FOR_EACH_VEC_ELT (data_ref_loc, references, i, ref)
{
- dr = create_data_ref (nest, *ref->pos, stmt, ref->is_read);
+ dr = create_data_ref (nest, loop, *ref->pos, stmt, ref->is_read);
gcc_assert (dr != NULL);
VEC_safe_push (data_reference_p, heap, *datarefs, dr);
}
diff --git a/gcc/tree-data-ref.h b/gcc/tree-data-ref.h
index bcf8c02c4d0..85c2386e7d6 100644
--- a/gcc/tree-data-ref.h
+++ b/gcc/tree-data-ref.h
@@ -23,7 +23,6 @@ along with GCC; see the file COPYING3. If not see
#define GCC_TREE_DATA_REF_H
#include "graphds.h"
-#include "lambda.h"
#include "omega.h"
#include "tree-chrec.h"
@@ -96,6 +95,19 @@ struct dr_alias
bitmap vops;
};
+/* An integer vector. A vector formally consists of an element of a vector
+ space. A vector space is a set that is closed under vector addition
+ and scalar multiplication. In this vector space, an element is a list of
+ integers. */
+typedef int *lambda_vector;
+DEF_VEC_P(lambda_vector);
+DEF_VEC_ALLOC_P(lambda_vector,heap);
+DEF_VEC_ALLOC_P(lambda_vector,gc);
+
+/* An integer matrix. A matrix consists of m vectors of length n (IE
+ all vectors are the same length). */
+typedef lambda_vector *lambda_matrix;
+
/* Each vector of the access matrix represents a linear access
function for a subscript. First elements correspond to the
leftmost indices, ie. for a[i][j] the first vector corresponds to
@@ -407,9 +419,9 @@ extern void free_data_ref (data_reference_p);
extern void free_data_refs (VEC (data_reference_p, heap) *);
extern bool find_data_references_in_stmt (struct loop *, gimple,
VEC (data_reference_p, heap) **);
-extern bool graphite_find_data_references_in_stmt (struct loop *, gimple,
+extern bool graphite_find_data_references_in_stmt (loop_p, loop_p, gimple,
VEC (data_reference_p, heap) **);
-struct data_reference *create_data_ref (struct loop *, tree, gimple, bool);
+struct data_reference *create_data_ref (loop_p, loop_p, tree, gimple, bool);
extern bool find_loop_nest (struct loop *, VEC (loop_p, heap) **);
extern void compute_all_dependences (VEC (data_reference_p, heap) *,
VEC (ddr_p, heap) **, VEC (loop_p, heap) *,
@@ -494,6 +506,22 @@ ddrs_have_anti_deps (VEC (ddr_p, heap) *dependence_relations)
return false;
}
+/* Returns the dependence level for a vector DIST of size LENGTH.
+ LEVEL = 0 means a lexicographic dependence, i.e. a dependence due
+ to the sequence of statements, not carried by any loop. */
+
+static inline unsigned
+dependence_level (lambda_vector dist_vect, int length)
+{
+ int i;
+
+ for (i = 0; i < length; i++)
+ if (dist_vect[i] != 0)
+ return i + 1;
+
+ return 0;
+}
+
/* Return the dependence level for the DDR relation. */
static inline unsigned
@@ -629,16 +657,6 @@ rdg_has_similar_memory_accesses (struct graph *rdg, int v1, int v2)
RDG_STMT (rdg, v2));
}
-/* In lambda-code.c */
-bool lambda_transform_legal_p (lambda_trans_matrix, int,
- VEC (ddr_p, heap) *);
-void lambda_collect_parameters (VEC (data_reference_p, heap) *,
- VEC (tree, heap) **);
-bool lambda_compute_access_matrices (VEC (data_reference_p, heap) *,
- VEC (tree, heap) *,
- VEC (loop_p, heap) *,
- struct obstack *);
-
/* In tree-data-ref.c */
void split_constant_offset (tree , tree *, tree *);
@@ -656,4 +674,86 @@ DEF_VEC_ALLOC_P (rdgc, heap);
DEF_VEC_P (bitmap);
DEF_VEC_ALLOC_P (bitmap, heap);
+/* Compute the greatest common divisor of a VECTOR of SIZE numbers. */
+
+static inline int
+lambda_vector_gcd (lambda_vector vector, int size)
+{
+ int i;
+ int gcd1 = 0;
+
+ if (size > 0)
+ {
+ gcd1 = vector[0];
+ for (i = 1; i < size; i++)
+ gcd1 = gcd (gcd1, vector[i]);
+ }
+ return gcd1;
+}
+
+/* Allocate a new vector of given SIZE. */
+
+static inline lambda_vector
+lambda_vector_new (int size)
+{
+ return (lambda_vector) ggc_alloc_cleared_atomic (sizeof (int) * size);
+}
+
+/* Clear out vector VEC1 of length SIZE. */
+
+static inline void
+lambda_vector_clear (lambda_vector vec1, int size)
+{
+ memset (vec1, 0, size * sizeof (*vec1));
+}
+
+/* Returns true when the vector V is lexicographically positive, in
+ other words, when the first nonzero element is positive. */
+
+static inline bool
+lambda_vector_lexico_pos (lambda_vector v,
+ unsigned n)
+{
+ unsigned i;
+ for (i = 0; i < n; i++)
+ {
+ if (v[i] == 0)
+ continue;
+ if (v[i] < 0)
+ return false;
+ if (v[i] > 0)
+ return true;
+ }
+ return true;
+}
+
+/* Return true if vector VEC1 of length SIZE is the zero vector. */
+
+static inline bool
+lambda_vector_zerop (lambda_vector vec1, int size)
+{
+ int i;
+ for (i = 0; i < size; i++)
+ if (vec1[i] != 0)
+ return false;
+ return true;
+}
+
+/* Allocate a matrix of M rows x N cols. */
+
+static inline lambda_matrix
+lambda_matrix_new (int m, int n, struct obstack *lambda_obstack)
+{
+ lambda_matrix mat;
+ int i;
+
+ mat = (lambda_matrix) obstack_alloc (lambda_obstack,
+ sizeof (lambda_vector *) * m);
+
+ for (i = 0; i < m; i++)
+ mat[i] = lambda_vector_new (n);
+
+ return mat;
+}
+
#endif /* GCC_TREE_DATA_REF_H */
diff --git a/gcc/tree-dfa.c b/gcc/tree-dfa.c
index 05a682b0a4b..6490c5e8712 100644
--- a/gcc/tree-dfa.c
+++ b/gcc/tree-dfa.c
@@ -218,7 +218,7 @@ dump_referenced_vars (FILE *file)
fprintf (file, "\nReferenced variables in %s: %u\n\n",
get_name (current_function_decl), (unsigned) num_referenced_vars);
- FOR_EACH_REFERENCED_VAR (var, rvi)
+ FOR_EACH_REFERENCED_VAR (cfun, var, rvi)
{
fprintf (file, "Variable: ");
dump_variable (file, var);
@@ -400,7 +400,7 @@ collect_dfa_stats (struct dfa_stats_d *dfa_stats_p ATTRIBUTE_UNUSED)
memset ((void *)dfa_stats_p, 0, sizeof (struct dfa_stats_d));
/* Count all the variable annotations. */
- FOR_EACH_REFERENCED_VAR (var, vi)
+ FOR_EACH_REFERENCED_VAR (cfun, var, vi)
if (var_ann (var))
dfa_stats_p->num_var_anns++;
@@ -488,12 +488,12 @@ find_referenced_vars_in (gimple stmt)
variable. */
tree
-referenced_var_lookup (unsigned int uid)
+referenced_var_lookup (struct function *fn, unsigned int uid)
{
tree h;
struct tree_decl_minimal in;
in.uid = uid;
- h = (tree) htab_find_with_hash (gimple_referenced_vars (cfun), &in, uid);
+ h = (tree) htab_find_with_hash (gimple_referenced_vars (fn), &in, uid);
return h;
}
diff --git a/gcc/tree-dump.c b/gcc/tree-dump.c
index 7de09390561..e5fce0e1622 100644
--- a/gcc/tree-dump.c
+++ b/gcc/tree-dump.c
@@ -1,6 +1,6 @@
/* Tree-dumping functionality for intermediate representation.
Copyright (C) 1999, 2000, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
- 2010 Free Software Foundation, Inc.
+ 2010, 2011 Free Software Foundation, Inc.
Written by Mark Mitchell <mark@codesourcery.com>
This file is part of GCC.
@@ -814,6 +814,7 @@ static const struct dump_option_value_info dump_options[] =
{"raw", TDF_RAW},
{"graph", TDF_GRAPH},
{"details", TDF_DETAILS},
+ {"cselib", TDF_CSELIB},
{"stats", TDF_STATS},
{"blocks", TDF_BLOCKS},
{"vops", TDF_VOPS},
diff --git a/gcc/tree-eh.c b/gcc/tree-eh.c
index 65d0ff2f9fd..f189b9b6a96 100644
--- a/gcc/tree-eh.c
+++ b/gcc/tree-eh.c
@@ -3552,6 +3552,20 @@ cleanup_empty_eh_merge_phis (basic_block new_bb, basic_block old_bb,
/* If we did find the corresponding PHI, copy those inputs. */
if (ophi)
{
+ /* If NOP is used somewhere else beyond phis in new_bb, give up. */
+ if (!has_single_use (nop))
+ {
+ imm_use_iterator imm_iter;
+ use_operand_p use_p;
+
+ FOR_EACH_IMM_USE_FAST (use_p, imm_iter, nop)
+ {
+ if (!gimple_debug_bind_p (USE_STMT (use_p))
+ && (gimple_code (USE_STMT (use_p)) != GIMPLE_PHI
+ || gimple_bb (USE_STMT (use_p)) != new_bb))
+ goto fail;
+ }
+ }
bitmap_set_bit (ophi_handled, SSA_NAME_VERSION (nop));
FOR_EACH_EDGE (e, ei, old_bb->preds)
{
diff --git a/gcc/tree-flow-inline.h b/gcc/tree-flow-inline.h
index 1a62cdd1f44..86566101e39 100644
--- a/gcc/tree-flow-inline.h
+++ b/gcc/tree-flow-inline.h
@@ -103,7 +103,7 @@ next_htab_element (htab_iterator *hti)
static inline tree
referenced_var (unsigned int uid)
{
- tree var = referenced_var_lookup (uid);
+ tree var = referenced_var_lookup (cfun, uid);
gcc_assert (var || uid == 0);
return var;
}
@@ -112,10 +112,10 @@ referenced_var (unsigned int uid)
referenced_vars hashtable, and return that variable. */
static inline tree
-first_referenced_var (referenced_var_iterator *iter)
+first_referenced_var (struct function *fn, referenced_var_iterator *iter)
{
return (tree) first_htab_element (&iter->hti,
- gimple_referenced_vars (cfun));
+ gimple_referenced_vars (fn));
}
/* Return true if we have hit the end of the referenced variables ITER is
@@ -569,9 +569,26 @@ static inline void
set_is_used (tree var)
{
var_ann_t ann = get_var_ann (var);
- ann->used = 1;
+ ann->used = true;
}
+/* Clear VAR's used flag. */
+
+static inline void
+clear_is_used (tree var)
+{
+ var_ann_t ann = var_ann (var);
+ ann->used = false;
+}
+
+/* Return true if VAR is marked as used. */
+
+static inline bool
+is_used_p (tree var)
+{
+ var_ann_t ann = var_ann (var);
+ return ann->used;
+}
/* Return true if T (assumed to be a DECL) is a global variable.
A variable is considered global if its storage is not automatic. */
diff --git a/gcc/tree-flow.h b/gcc/tree-flow.h
index 682907c2f9d..14c8827d1c5 100644
--- a/gcc/tree-flow.h
+++ b/gcc/tree-flow.h
@@ -1,5 +1,5 @@
/* Data and Control Flow Analysis for Trees.
- Copyright (C) 2001, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
+ Copyright (C) 2001, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
Free Software Foundation, Inc.
Contributed by Diego Novillo <dnovillo@redhat.com>
@@ -314,12 +314,12 @@ typedef struct
to the hashtable while using this macro. Doing so may cause it to behave
erratically. */
-#define FOR_EACH_REFERENCED_VAR(VAR, ITER) \
- for ((VAR) = first_referenced_var (&(ITER)); \
- !end_referenced_vars_p (&(ITER)); \
+#define FOR_EACH_REFERENCED_VAR(FN, VAR, ITER) \
+ for ((VAR) = first_referenced_var ((FN), &(ITER)); \
+ !end_referenced_vars_p (&(ITER)); \
(VAR) = next_referenced_var (&(ITER)))
-extern tree referenced_var_lookup (unsigned int);
+extern tree referenced_var_lookup (struct function *, unsigned int);
extern bool referenced_var_check_and_insert (tree);
#define num_referenced_vars htab_elements (gimple_referenced_vars (cfun))
@@ -852,10 +852,11 @@ bool fixup_noreturn_call (gimple stmt);
/* In ipa-pure-const.c */
void warn_function_noreturn (tree);
+/* In tree-ssa-ter.c */
+bool stmt_is_replaceable_p (gimple);
+
#include "tree-flow-inline.h"
void swap_tree_operands (gimple, tree *, tree *);
-int least_common_multiple (int, int);
-
#endif /* _TREE_FLOW_H */
diff --git a/gcc/tree-if-conv.c b/gcc/tree-if-conv.c
index 46b20c26c19..d70e2321c15 100644
--- a/gcc/tree-if-conv.c
+++ b/gcc/tree-if-conv.c
@@ -716,6 +716,20 @@ if_convertible_stmt_p (gimple stmt, VEC (data_reference_p, heap) *refs)
return true;
}
+/* Return true when BB post-dominates all its predecessors. */
+
+static bool
+bb_postdominates_preds (basic_block bb)
+{
+ unsigned i;
+
+ for (i = 0; i < EDGE_COUNT (bb->preds); i++)
+ if (!dominated_by_p (CDI_POST_DOMINATORS, EDGE_PRED (bb, i)->src, bb))
+ return false;
+
+ return true;
+}
+
/* Return true when BB is if-convertible. This routine does not check
basic block's statements and phis.
@@ -774,6 +788,11 @@ if_convertible_bb_p (struct loop *loop, basic_block bb, basic_block exit_bb)
return false;
}
+ if (EDGE_COUNT (bb->preds) == 2
+ && bb != loop->header
+ && !bb_postdominates_preds (bb))
+ return false;
+
return true;
}
@@ -992,6 +1011,7 @@ if_convertible_loop_p_1 (struct loop *loop,
return false;
calculate_dominance_info (CDI_DOMINATORS);
+ calculate_dominance_info (CDI_POST_DOMINATORS);
/* Allow statements that can be handled during if-conversion. */
ifc_bbs = get_loop_body_in_if_conv_order (loop);
@@ -1262,6 +1282,9 @@ predicate_scalar_phi (gimple phi, tree cond,
arg_1 = gimple_phi_arg_def (phi, 1);
}
+ gcc_checking_assert (bb == bb->loop_father->header
+ || bb_postdominates_preds (bb));
+
/* Build new RHS using selected condition and arguments. */
rhs = build3 (COND_EXPR, TREE_TYPE (res),
unshare_expr (cond), arg_0, arg_1);
@@ -1718,6 +1741,8 @@ main_tree_if_conversion (void)
if (changed && flag_tree_loop_if_convert_stores)
todo |= TODO_update_ssa_only_virtuals;
+ free_dominance_info (CDI_POST_DOMINATORS);
+
return todo;
}
diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c
index c5ab4ca75ed..de30cfd67ef 100644
--- a/gcc/tree-inline.c
+++ b/gcc/tree-inline.c
@@ -312,13 +312,17 @@ remap_decl (tree decl, copy_body_data *id)
walk_tree (&DECL_QUALIFIER (t), copy_tree_body_r, id, NULL);
}
- if (cfun && gimple_in_ssa_p (cfun)
- && (TREE_CODE (t) == VAR_DECL
- || TREE_CODE (t) == RESULT_DECL || TREE_CODE (t) == PARM_DECL))
- {
- get_var_ann (t);
- add_referenced_var (t);
- }
+ if ((TREE_CODE (t) == VAR_DECL
+ || TREE_CODE (t) == RESULT_DECL
+ || TREE_CODE (t) == PARM_DECL)
+ && id->src_fn && DECL_STRUCT_FUNCTION (id->src_fn)
+ && gimple_referenced_vars (DECL_STRUCT_FUNCTION (id->src_fn))
+ /* We don't want to mark as referenced VAR_DECLs that were
+ not marked as such in the src function. */
+ && (TREE_CODE (decl) != VAR_DECL
+ || referenced_var_lookup (DECL_STRUCT_FUNCTION (id->src_fn),
+ DECL_UID (decl))))
+ add_referenced_var (t);
return t;
}
@@ -811,57 +815,47 @@ remap_gimple_op_r (tree *tp, int *walk_subtrees, void *data)
knows not to copy VAR_DECLs, etc., so this is safe. */
if (TREE_CODE (*tp) == MEM_REF)
{
- /* We need to re-canonicalize MEM_REFs from inline substitutions
- that can happen when a pointer argument is an ADDR_EXPR. */
- tree decl = TREE_OPERAND (*tp, 0);
- tree *n;
-
- /* See remap_ssa_name. */
- if (TREE_CODE (decl) == SSA_NAME
- && TREE_CODE (SSA_NAME_VAR (decl)) == RESULT_DECL
- && id->transform_return_to_modify)
- decl = SSA_NAME_VAR (decl);
+ tree ptr = TREE_OPERAND (*tp, 0);
+ tree old = *tp;
+ tree tem;
- n = (tree *) pointer_map_contains (id->decl_map, decl);
- if (n)
+ /* We need to re-canonicalize MEM_REFs from inline substitutions
+ that can happen when a pointer argument is an ADDR_EXPR.
+ Recurse here manually to allow that. */
+ walk_tree (&ptr, remap_gimple_op_r, data, NULL);
+ if ((tem = maybe_fold_offset_to_reference (EXPR_LOCATION (*tp),
+ ptr,
+ TREE_OPERAND (*tp, 1),
+ TREE_TYPE (*tp)))
+ && TREE_THIS_VOLATILE (tem) == TREE_THIS_VOLATILE (old))
{
- tree old = *tp;
- tree ptr = unshare_expr (*n);
- tree tem;
- if ((tem = maybe_fold_offset_to_reference (EXPR_LOCATION (*tp),
- ptr,
- TREE_OPERAND (*tp, 1),
- TREE_TYPE (*tp)))
- && TREE_THIS_VOLATILE (tem) == TREE_THIS_VOLATILE (old))
- {
- tree *tem_basep = &tem;
- while (handled_component_p (*tem_basep))
- tem_basep = &TREE_OPERAND (*tem_basep, 0);
- if (TREE_CODE (*tem_basep) == MEM_REF)
- *tem_basep
- = build2 (MEM_REF, TREE_TYPE (*tem_basep),
- TREE_OPERAND (*tem_basep, 0),
- fold_convert (TREE_TYPE (TREE_OPERAND (*tp, 1)),
- TREE_OPERAND (*tem_basep, 1)));
- else
- *tem_basep
- = build2 (MEM_REF, TREE_TYPE (*tem_basep),
- build_fold_addr_expr (*tem_basep),
- build_int_cst
- (TREE_TYPE (TREE_OPERAND (*tp, 1)), 0));
- *tp = tem;
- }
+ tree *tem_basep = &tem;
+ while (handled_component_p (*tem_basep))
+ tem_basep = &TREE_OPERAND (*tem_basep, 0);
+ if (TREE_CODE (*tem_basep) == MEM_REF)
+ *tem_basep
+ = build2 (MEM_REF, TREE_TYPE (*tem_basep),
+ TREE_OPERAND (*tem_basep, 0),
+ fold_convert (TREE_TYPE (TREE_OPERAND (*tp, 1)),
+ TREE_OPERAND (*tem_basep, 1)));
else
- {
- *tp = fold_build2 (MEM_REF, TREE_TYPE (*tp),
- ptr, TREE_OPERAND (*tp, 1));
- TREE_THIS_VOLATILE (*tp) = TREE_THIS_VOLATILE (old);
- TREE_THIS_NOTRAP (*tp) = TREE_THIS_NOTRAP (old);
- }
- TREE_NO_WARNING (*tp) = TREE_NO_WARNING (old);
- *walk_subtrees = 0;
- return NULL;
+ *tem_basep
+ = build2 (MEM_REF, TREE_TYPE (*tem_basep),
+ build_fold_addr_expr (*tem_basep),
+ build_int_cst
+ (TREE_TYPE (TREE_OPERAND (*tp, 1)), 0));
+ *tp = tem;
+ }
+ else
+ {
+ *tp = fold_build2 (MEM_REF, TREE_TYPE (*tp),
+ ptr, TREE_OPERAND (*tp, 1));
+ TREE_THIS_VOLATILE (*tp) = TREE_THIS_VOLATILE (old);
+ TREE_THIS_NOTRAP (*tp) = TREE_THIS_NOTRAP (old);
}
+ TREE_NO_WARNING (*tp) = TREE_NO_WARNING (old);
+ *walk_subtrees = 0;
+ return NULL;
}
/* Here is the "usual case". Copy this tree node, and then
@@ -2557,10 +2551,7 @@ setup_one_parameter (copy_body_data *id, tree p, tree value, tree fn,
/* We're actually using the newly-created var. */
if (gimple_in_ssa_p (cfun) && TREE_CODE (var) == VAR_DECL)
- {
- get_var_ann (var);
- add_referenced_var (var);
- }
+ add_referenced_var (var);
/* Declare this new variable. */
DECL_CHAIN (var) = *vars;
@@ -2759,7 +2750,6 @@ declare_return_variable (copy_body_data *id, tree return_slot, tree modify_dest,
basic_block entry_bb)
{
tree callee = id->src_fn;
- tree caller = id->dst_fn;
tree result = DECL_RESULT (callee);
tree callee_type = TREE_TYPE (result);
tree caller_type;
@@ -2868,13 +2858,9 @@ declare_return_variable (copy_body_data *id, tree return_slot, tree modify_dest,
var = copy_result_decl_to_var (result, id);
if (gimple_in_ssa_p (cfun))
- {
- get_var_ann (var);
- add_referenced_var (var);
- }
+ add_referenced_var (var);
DECL_SEEN_IN_BIND_EXPR_P (var) = 1;
- add_local_decl (DECL_STRUCT_FUNCTION (caller), var);
/* Do not have the rest of GCC warn about this variable as it should
not be visible to the user. */
@@ -2908,10 +2894,7 @@ declare_return_variable (copy_body_data *id, tree return_slot, tree modify_dest,
{
tree temp = create_tmp_var (TREE_TYPE (result), "retvalptr");
if (gimple_in_ssa_p (id->src_cfun))
- {
- get_var_ann (temp);
- add_referenced_var (temp);
- }
+ add_referenced_var (temp);
insert_decl_map (id, result, temp);
/* When RESULT_DECL is in SSA form, we need to use it's default_def
SSA_NAME. */
@@ -4765,6 +4748,14 @@ copy_decl_for_dup_finish (copy_body_data *id, tree decl, tree copy)
new function. */
DECL_CONTEXT (copy) = id->dst_fn;
+ if (TREE_CODE (decl) == VAR_DECL
+ /* C++ clones functions during parsing, before
+ referenced_vars. */
+ && gimple_referenced_vars (DECL_STRUCT_FUNCTION (id->src_fn))
+ && referenced_var_lookup (DECL_STRUCT_FUNCTION (id->src_fn),
+ DECL_UID (decl)))
+ add_referenced_var (copy);
+
return copy;
}
@@ -4876,7 +4867,6 @@ copy_arguments_for_versioning (tree orig_parm, copy_body_data * id,
as temporary variable later in function, the uses will be
replaced by local variable. */
tree var = copy_decl_to_var (arg, id);
- get_var_ann (var);
add_referenced_var (var);
insert_decl_map (id, arg, var);
/* Declare this new variable. */
diff --git a/gcc/tree-inline.h b/gcc/tree-inline.h
index 738a8667a35..66cc3348410 100644
--- a/gcc/tree-inline.h
+++ b/gcc/tree-inline.h
@@ -188,6 +188,6 @@ extern tree remap_decl (tree decl, copy_body_data *id);
extern tree remap_type (tree type, copy_body_data *id);
extern gimple_seq copy_gimple_seq_and_replace_locals (gimple_seq seq);
-extern HOST_WIDE_INT estimated_stack_frame_size (tree);
+extern HOST_WIDE_INT estimated_stack_frame_size (struct cgraph_node *);
#endif /* GCC_TREE_INLINE_H */
diff --git a/gcc/tree-into-ssa.c b/gcc/tree-into-ssa.c
index c425586a156..74386e44411 100644
--- a/gcc/tree-into-ssa.c
+++ b/gcc/tree-into-ssa.c
@@ -1156,7 +1156,7 @@ insert_phi_nodes (bitmap_head *dfs)
differences but no UID ordering differences. */
vars = BITMAP_ALLOC (NULL);
- FOR_EACH_REFERENCED_VAR (var, rvi)
+ FOR_EACH_REFERENCED_VAR (cfun, var, rvi)
{
struct def_blocks_d *def_map;
@@ -1469,7 +1469,7 @@ dump_decl_set (FILE *file, bitmap set)
EXECUTE_IF_SET_IN_BITMAP (set, 0, i, bi)
{
- tree var = referenced_var_lookup (i);
+ tree var = referenced_var_lookup (cfun, i);
if (var)
print_generic_expr (file, var, 0);
else
@@ -1573,7 +1573,7 @@ dump_currdefs (FILE *file)
tree var;
fprintf (file, "\n\nCurrent reaching definitions\n\n");
- FOR_EACH_REFERENCED_VAR (var, i)
+ FOR_EACH_REFERENCED_VAR (cfun, var, i)
if (SYMS_TO_RENAME (cfun) == NULL
|| bitmap_bit_p (SYMS_TO_RENAME (cfun), DECL_UID (var)))
{
@@ -2313,7 +2313,7 @@ init_ssa_renamer (void)
def_blocks = htab_create (num_referenced_vars, def_blocks_hash,
def_blocks_eq, def_blocks_free);
- FOR_EACH_REFERENCED_VAR(var, rvi)
+ FOR_EACH_REFERENCED_VAR (cfun, var, rvi)
set_current_def (var, NULL_TREE);
}
diff --git a/gcc/tree-loop-linear.c b/gcc/tree-loop-linear.c
deleted file mode 100644
index 5b19c17622c..00000000000
--- a/gcc/tree-loop-linear.c
+++ /dev/null
@@ -1,423 +0,0 @@
-/* Linear Loop transforms
- Copyright (C) 2003, 2004, 2005, 2007, 2008, 2009, 2010
- Free Software Foundation, Inc.
- Contributed by Daniel Berlin <dberlin@dberlin.org>.
-
-This file is part of GCC.
-
-GCC is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free
-Software Foundation; either version 3, or (at your option) any later
-version.
-
-GCC is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-for more details.
-
-You should have received a copy of the GNU General Public License
-along with GCC; see the file COPYING3. If not see
-<http://www.gnu.org/licenses/>. */
-
-#include "config.h"
-#include "system.h"
-#include "coretypes.h"
-#include "tree-flow.h"
-#include "cfgloop.h"
-#include "tree-chrec.h"
-#include "tree-data-ref.h"
-#include "tree-scalar-evolution.h"
-#include "tree-pass.h"
-#include "lambda.h"
-
-/* Linear loop transforms include any composition of interchange,
- scaling, skewing, and reversal. They are used to change the
- iteration order of loop nests in order to optimize data locality of
- traversals, or remove dependences that prevent
- parallelization/vectorization/etc.
-
- TODO: Determine reuse vectors/matrix and use it to determine optimal
- transform matrix for locality purposes.
- TODO: Completion of partial transforms. */
-
-/* Gather statistics for loop interchange. LOOP is the loop being
- considered. The first loop in the considered loop nest is
- FIRST_LOOP, and consequently, the index of the considered loop is
- obtained by LOOP->DEPTH - FIRST_LOOP->DEPTH
-
- Initializes:
- - DEPENDENCE_STEPS the sum of all the data dependence distances
- carried by loop LOOP,
-
- - NB_DEPS_NOT_CARRIED_BY_LOOP the number of dependence relations
- for which the loop LOOP is not carrying any dependence,
-
- - ACCESS_STRIDES the sum of all the strides in LOOP.
-
- Example: for the following loop,
-
- | loop_1 runs 1335 times
- | loop_2 runs 1335 times
- | A[{{0, +, 1}_1, +, 1335}_2]
- | B[{{0, +, 1}_1, +, 1335}_2]
- | endloop_2
- | A[{0, +, 1336}_1]
- | endloop_1
-
- gather_interchange_stats (in loop_1) will return
- DEPENDENCE_STEPS = 3002
- NB_DEPS_NOT_CARRIED_BY_LOOP = 5
- ACCESS_STRIDES = 10694
-
- gather_interchange_stats (in loop_2) will return
- DEPENDENCE_STEPS = 3000
- NB_DEPS_NOT_CARRIED_BY_LOOP = 7
- ACCESS_STRIDES = 8010
-*/
-
-static void
-gather_interchange_stats (VEC (ddr_p, heap) *dependence_relations ATTRIBUTE_UNUSED,
- VEC (data_reference_p, heap) *datarefs ATTRIBUTE_UNUSED,
- struct loop *loop ATTRIBUTE_UNUSED,
- struct loop *first_loop ATTRIBUTE_UNUSED,
- unsigned int *dependence_steps ATTRIBUTE_UNUSED,
- unsigned int *nb_deps_not_carried_by_loop ATTRIBUTE_UNUSED,
- double_int *access_strides ATTRIBUTE_UNUSED)
-{
- unsigned int i, j;
- struct data_dependence_relation *ddr;
- struct data_reference *dr;
-
- *dependence_steps = 0;
- *nb_deps_not_carried_by_loop = 0;
- *access_strides = double_int_zero;
-
- FOR_EACH_VEC_ELT (ddr_p, dependence_relations, i, ddr)
- {
- /* If we don't know anything about this dependence, or the distance
- vector is NULL, or there is no dependence, then there is no reuse of
- data. */
- if (DDR_ARE_DEPENDENT (ddr) == chrec_dont_know
- || DDR_ARE_DEPENDENT (ddr) == chrec_known
- || DDR_NUM_DIST_VECTS (ddr) == 0)
- continue;
-
- for (j = 0; j < DDR_NUM_DIST_VECTS (ddr); j++)
- {
- int dist = DDR_DIST_VECT (ddr, j)[loop_depth (loop) - loop_depth (first_loop)];
-
- if (dist == 0)
- (*nb_deps_not_carried_by_loop) += 1;
-
- else if (dist < 0)
- (*dependence_steps) += -dist;
-
- else
- (*dependence_steps) += dist;
- }
- }
-
- /* Compute the access strides. */
- FOR_EACH_VEC_ELT (data_reference_p, datarefs, i, dr)
- {
- unsigned int it;
- tree ref = DR_REF (dr);
- gimple stmt = DR_STMT (dr);
- struct loop *stmt_loop = loop_containing_stmt (stmt);
- struct loop *inner_loop = first_loop->inner;
-
- if (inner_loop != stmt_loop
- && !flow_loop_nested_p (inner_loop, stmt_loop))
- continue;
-
- for (it = 0; it < DR_NUM_DIMENSIONS (dr);
- it++, ref = TREE_OPERAND (ref, 0))
- {
- int num = am_vector_index_for_loop (DR_ACCESS_MATRIX (dr), loop->num);
- int istride = AM_GET_ACCESS_MATRIX_ELEMENT (DR_ACCESS_MATRIX (dr), it, num);
- tree array_size = TYPE_SIZE (TREE_TYPE (ref));
- double_int dstride;
-
- if (array_size == NULL_TREE
- || TREE_CODE (array_size) != INTEGER_CST)
- continue;
-
- dstride = double_int_mul (tree_to_double_int (array_size),
- shwi_to_double_int (istride));
- (*access_strides) = double_int_add (*access_strides, dstride);
- }
- }
-}
-
-/* Attempt to apply interchange transformations to TRANS to maximize the
- spatial and temporal locality of the loop.
- Returns the new transform matrix. The smaller the reuse vector
- distances in the inner loops, the fewer the cache misses.
- FIRST_LOOP is the loop->num of the first loop in the analyzed loop
- nest. */
-
-
-static lambda_trans_matrix
-try_interchange_loops (lambda_trans_matrix trans,
- unsigned int depth,
- VEC (ddr_p, heap) *dependence_relations,
- VEC (data_reference_p, heap) *datarefs,
- struct loop *first_loop)
-{
- bool res;
- struct loop *loop_i;
- struct loop *loop_j;
- unsigned int dependence_steps_i, dependence_steps_j;
- double_int access_strides_i, access_strides_j;
- double_int small, large, nb_iter;
- double_int l1_cache_size, l2_cache_size;
- int cmp;
- unsigned int nb_deps_not_carried_by_i, nb_deps_not_carried_by_j;
- struct data_dependence_relation *ddr;
-
- if (VEC_length (ddr_p, dependence_relations) == 0)
- return trans;
-
- /* When there is an unknown relation in the dependence_relations, we
- know that it is no worth looking at this loop nest: give up. */
- ddr = VEC_index (ddr_p, dependence_relations, 0);
- if (ddr == NULL || DDR_ARE_DEPENDENT (ddr) == chrec_dont_know)
- return trans;
-
- l1_cache_size = uhwi_to_double_int (L1_CACHE_SIZE * 1024);
- l2_cache_size = uhwi_to_double_int (L2_CACHE_SIZE * 1024);
-
- /* LOOP_I is always the outer loop. */
- for (loop_j = first_loop->inner;
- loop_j;
- loop_j = loop_j->inner)
- for (loop_i = first_loop;
- loop_depth (loop_i) < loop_depth (loop_j);
- loop_i = loop_i->inner)
- {
- gather_interchange_stats (dependence_relations, datarefs,
- loop_i, first_loop,
- &dependence_steps_i,
- &nb_deps_not_carried_by_i,
- &access_strides_i);
- gather_interchange_stats (dependence_relations, datarefs,
- loop_j, first_loop,
- &dependence_steps_j,
- &nb_deps_not_carried_by_j,
- &access_strides_j);
-
- /* Heuristics for loop interchange profitability:
-
- 0. Don't transform if the smallest stride is larger than
- the L2 cache, or if the largest stride multiplied by the
- number of iterations is smaller than the L1 cache.
-
- 1. (spatial locality) Inner loops should have smallest
- dependence steps.
-
- 2. (spatial locality) Inner loops should contain more
- dependence relations not carried by the loop.
-
- 3. (temporal locality) Inner loops should have smallest
- array access strides.
- */
-
- cmp = double_int_ucmp (access_strides_i, access_strides_j);
- small = cmp < 0 ? access_strides_i : access_strides_j;
- large = cmp < 0 ? access_strides_j : access_strides_i;
-
- if (double_int_ucmp (small, l2_cache_size) > 0)
- continue;
-
- res = cmp < 0 ?
- estimated_loop_iterations (loop_j, false, &nb_iter):
- estimated_loop_iterations (loop_i, false, &nb_iter);
-
- if (res
- && double_int_ucmp (double_int_mul (large, nb_iter),
- l1_cache_size) < 0)
- continue;
-
- if (dependence_steps_i < dependence_steps_j
- || nb_deps_not_carried_by_i > nb_deps_not_carried_by_j
- || cmp < 0)
- {
- lambda_matrix_row_exchange (LTM_MATRIX (trans),
- loop_depth (loop_i) - loop_depth (first_loop),
- loop_depth (loop_j) - loop_depth (first_loop));
- /* Validate the resulting matrix. When the transformation
- is not valid, reverse to the previous transformation. */
- if (!lambda_transform_legal_p (trans, depth, dependence_relations))
- lambda_matrix_row_exchange (LTM_MATRIX (trans),
- loop_depth (loop_i) - loop_depth (first_loop),
- loop_depth (loop_j) - loop_depth (first_loop));
- }
- }
-
- return trans;
-}
-
-/* Return the number of nested loops in LOOP_NEST, or 0 if the loops
- are not perfectly nested. */
-
-unsigned int
-perfect_loop_nest_depth (struct loop *loop_nest)
-{
- struct loop *temp;
- unsigned int depth = 1;
-
- /* If it's not a loop nest, we don't want it. We also don't handle
- sibling loops properly, which are loops of the following form:
-
- | for (i = 0; i < 50; i++)
- | {
- | for (j = 0; j < 50; j++)
- | {
- | ...
- | }
- | for (j = 0; j < 50; j++)
- | {
- | ...
- | }
- | }
- */
-
- if (!loop_nest->inner || !single_exit (loop_nest))
- return 0;
-
- for (temp = loop_nest->inner; temp; temp = temp->inner)
- {
- /* If we have a sibling loop or multiple exit edges, jump ship. */
- if (temp->next || !single_exit (temp))
- return 0;
-
- depth++;
- }
-
- return depth;
-}
-
-/* Perform a set of linear transforms on loops. */
-
-void
-linear_transform_loops (void)
-{
- bool modified = false;
- loop_iterator li;
- VEC(tree,heap) *oldivs = NULL;
- VEC(tree,heap) *invariants = NULL;
- VEC(tree,heap) *lambda_parameters = NULL;
- VEC(gimple,heap) *remove_ivs = VEC_alloc (gimple, heap, 3);
- struct loop *loop_nest;
- gimple oldiv_stmt;
- unsigned i;
-
- FOR_EACH_LOOP (li, loop_nest, 0)
- {
- unsigned int depth = 0;
- VEC (ddr_p, heap) *dependence_relations;
- VEC (data_reference_p, heap) *datarefs;
-
- lambda_loopnest before, after;
- lambda_trans_matrix trans;
- struct obstack lambda_obstack;
- struct loop *loop;
- VEC (loop_p, heap) *nest;
- VEC (loop_p, heap) *ln;
-
- depth = perfect_loop_nest_depth (loop_nest);
- if (depth == 0)
- continue;
-
- nest = VEC_alloc (loop_p, heap, 3);
- for (loop = loop_nest; loop; loop = loop->inner)
- VEC_safe_push (loop_p, heap, nest, loop);
-
- gcc_obstack_init (&lambda_obstack);
- VEC_truncate (tree, oldivs, 0);
- VEC_truncate (tree, invariants, 0);
- VEC_truncate (tree, lambda_parameters, 0);
-
- datarefs = VEC_alloc (data_reference_p, heap, 10);
- dependence_relations = VEC_alloc (ddr_p, heap, 10 * 10);
- ln = VEC_alloc (loop_p, heap, 3);
- if (!compute_data_dependences_for_loop (loop_nest, true, &ln, &datarefs,
- &dependence_relations))
- goto free_and_continue;
-
- lambda_collect_parameters (datarefs, &lambda_parameters);
- if (!lambda_compute_access_matrices (datarefs, lambda_parameters,
- nest, &lambda_obstack))
- goto free_and_continue;
-
- if (dump_file && (dump_flags & TDF_DETAILS))
- dump_ddrs (dump_file, dependence_relations);
-
- /* Build the transformation matrix. */
- trans = lambda_trans_matrix_new (depth, depth, &lambda_obstack);
- lambda_matrix_id (LTM_MATRIX (trans), depth);
- trans = try_interchange_loops (trans, depth, dependence_relations,
- datarefs, loop_nest);
-
- if (lambda_trans_matrix_id_p (trans))
- {
- if (dump_file)
- fprintf (dump_file, "Won't transform loop. Optimal transform is the identity transform\n");
- goto free_and_continue;
- }
-
- /* Check whether the transformation is legal. */
- if (!lambda_transform_legal_p (trans, depth, dependence_relations))
- {
- if (dump_file)
- fprintf (dump_file, "Can't transform loop, transform is illegal:\n");
- goto free_and_continue;
- }
-
- before = gcc_loopnest_to_lambda_loopnest (loop_nest, &oldivs,
- &invariants, &lambda_obstack);
-
- if (!before)
- goto free_and_continue;
-
- if (dump_file)
- {
- fprintf (dump_file, "Before:\n");
- print_lambda_loopnest (dump_file, before, 'i');
- }
-
- after = lambda_loopnest_transform (before, trans, &lambda_obstack);
-
- if (dump_file)
- {
- fprintf (dump_file, "After:\n");
- print_lambda_loopnest (dump_file, after, 'u');
- }
-
- lambda_loopnest_to_gcc_loopnest (loop_nest, oldivs, invariants,
- &remove_ivs,
- after, trans, &lambda_obstack);
- modified = true;
-
- if (dump_file)
- fprintf (dump_file, "Successfully transformed loop.\n");
-
- free_and_continue:
- obstack_free (&lambda_obstack, NULL);
- free_dependence_relations (dependence_relations);
- free_data_refs (datarefs);
- VEC_free (loop_p, heap, nest);
- VEC_free (loop_p, heap, ln);
- }
-
- FOR_EACH_VEC_ELT (gimple, remove_ivs, i, oldiv_stmt)
- remove_iv (oldiv_stmt);
-
- VEC_free (tree, heap, oldivs);
- VEC_free (tree, heap, invariants);
- VEC_free (gimple, heap, remove_ivs);
- scev_reset ();
-
- if (modified)
- rewrite_into_loop_closed_ssa (NULL, TODO_update_ssa_full_phi);
-}
diff --git a/gcc/tree-nrv.c b/gcc/tree-nrv.c
index 8ee3b8b0a4b..32e422e5e20 100644
--- a/gcc/tree-nrv.c
+++ b/gcc/tree-nrv.c
@@ -263,7 +263,7 @@ tree_nrv (void)
DECL_HAS_VALUE_EXPR_P (found) = 1;
/* FOUND is no longer used. Ensure it gets removed. */
- var_ann (found)->used = 0;
+ clear_is_used (found);
return 0;
}
diff --git a/gcc/tree-parloops.c b/gcc/tree-parloops.c
index 96759cbfe89..9a11f80d4b0 100644
--- a/gcc/tree-parloops.c
+++ b/gcc/tree-parloops.c
@@ -240,6 +240,125 @@ name_to_copy_elt_hash (const void *aa)
return (hashval_t) a->version;
}
+/* A transformation matrix, which is a self-contained ROWSIZE x COLSIZE
+ matrix. Rather than use floats, we simply keep a single DENOMINATOR that
+ represents the denominator for every element in the matrix. */
+typedef struct lambda_trans_matrix_s
+{
+ lambda_matrix matrix;
+ int rowsize;
+ int colsize;
+ int denominator;
+} *lambda_trans_matrix;
+#define LTM_MATRIX(T) ((T)->matrix)
+#define LTM_ROWSIZE(T) ((T)->rowsize)
+#define LTM_COLSIZE(T) ((T)->colsize)
+#define LTM_DENOMINATOR(T) ((T)->denominator)
+
+/* Allocate a new transformation matrix. */
+
+static lambda_trans_matrix
+lambda_trans_matrix_new (int colsize, int rowsize,
+ struct obstack * lambda_obstack)
+{
+ lambda_trans_matrix ret;
+
+ ret = (lambda_trans_matrix)
+ obstack_alloc (lambda_obstack, sizeof (struct lambda_trans_matrix_s));
+ LTM_MATRIX (ret) = lambda_matrix_new (rowsize, colsize, lambda_obstack);
+ LTM_ROWSIZE (ret) = rowsize;
+ LTM_COLSIZE (ret) = colsize;
+ LTM_DENOMINATOR (ret) = 1;
+ return ret;
+}
+
+/* Multiply a vector VEC by a matrix MAT.
+ MAT is an M*N matrix, and VEC is a vector with length N. The result
+ is stored in DEST which must be a vector of length M. */
+
+static void
+lambda_matrix_vector_mult (lambda_matrix matrix, int m, int n,
+ lambda_vector vec, lambda_vector dest)
+{
+ int i, j;
+
+ lambda_vector_clear (dest, m);
+ for (i = 0; i < m; i++)
+ for (j = 0; j < n; j++)
+ dest[i] += matrix[i][j] * vec[j];
+}
+
+/* Return true if TRANS is a legal transformation matrix that respects
+ the dependence vectors in DISTS and DIRS. The conservative answer
+ is false.
+
+ "Wolfe proves that a unimodular transformation represented by the
+ matrix T is legal when applied to a loop nest with a set of
+ lexicographically non-negative distance vectors RDG if and only if
+ for each vector d in RDG, (T.d >= 0) is lexicographically positive.
+ i.e.: if and only if it transforms the lexicographically positive
+ distance vectors to lexicographically positive vectors. Note that
+ a unimodular matrix must transform the zero vector (and only it) to
+ the zero vector." S.Muchnick. */
+
+static bool
+lambda_transform_legal_p (lambda_trans_matrix trans,
+ int nb_loops,
+ VEC (ddr_p, heap) *dependence_relations)
+{
+ unsigned int i, j;
+ lambda_vector distres;
+ struct data_dependence_relation *ddr;
+
+ gcc_assert (LTM_COLSIZE (trans) == nb_loops
+ && LTM_ROWSIZE (trans) == nb_loops);
+
+ /* When there are no dependences, the transformation is correct. */
+ if (VEC_length (ddr_p, dependence_relations) == 0)
+ return true;
+
+ ddr = VEC_index (ddr_p, dependence_relations, 0);
+ if (ddr == NULL)
+ return true;
+
+ /* When there is an unknown relation in the dependence_relations, we
+ know that it is no worth looking at this loop nest: give up. */
+ if (DDR_ARE_DEPENDENT (ddr) == chrec_dont_know)
+ return false;
+
+ distres = lambda_vector_new (nb_loops);
+
+ /* For each distance vector in the dependence graph. */
+ FOR_EACH_VEC_ELT (ddr_p, dependence_relations, i, ddr)
+ {
+ /* Don't care about relations for which we know that there is no
+ dependence, nor about read-read (aka. output-dependences):
+ these data accesses can happen in any order. */
+ if (DDR_ARE_DEPENDENT (ddr) == chrec_known
+ || (DR_IS_READ (DDR_A (ddr)) && DR_IS_READ (DDR_B (ddr))))
+ continue;
+
+ /* Conservatively answer: "this transformation is not valid". */
+ if (DDR_ARE_DEPENDENT (ddr) == chrec_dont_know)
+ return false;
+
+ /* If the dependence could not be captured by a distance vector,
+ conservatively answer that the transform is not valid. */
+ if (DDR_NUM_DIST_VECTS (ddr) == 0)
+ return false;
+
+ /* Compute trans.dist_vect */
+ for (j = 0; j < DDR_NUM_DIST_VECTS (ddr); j++)
+ {
+ lambda_matrix_vector_mult (LTM_MATRIX (trans), nb_loops, nb_loops,
+ DDR_DIST_VECT (ddr, j), distres);
+
+ if (!lambda_vector_lexico_pos (distres, nb_loops))
+ return false;
+ }
+ }
+ return true;
+}
/* Data dependency analysis. Returns true if the iterations of LOOP
are independent on each other (that is, if we can execute them
diff --git a/gcc/tree-pass.h b/gcc/tree-pass.h
index 32d8f40470c..d7b122bfd02 100644
--- a/gcc/tree-pass.h
+++ b/gcc/tree-pass.h
@@ -1,5 +1,5 @@
/* Definitions for describing one tree-ssa optimization pass.
- Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010
+ Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
Free Software Foundation, Inc.
Contributed by Richard Henderson <rth@redhat.com>
@@ -82,6 +82,7 @@ enum tree_dump_index
#define TDF_NOUID (1 << 20) /* omit UIDs from dumps. */
#define TDF_ALIAS (1 << 21) /* display alias information */
#define TDF_ENUMERATE_LOCALS (1 << 22) /* Enumerate locals by uid. */
+#define TDF_CSELIB (1 << 23) /* Dump cselib details. */
/* In tree-dump.c */
@@ -274,7 +275,7 @@ struct dump_file_info
/* Insert PHI nodes everywhere they are needed. No pruning of the
IDF is done. This is used by passes that need the PHI nodes for
O_j even if it means that some arguments will come from the default
- definition of O_j's symbol (e.g., pass_linear_transform).
+ definition of O_j's symbol.
WARNING: If you need to use this flag, chances are that your pass
may be doing something wrong. Inserting PHI nodes for an old name
@@ -431,7 +432,6 @@ extern struct gimple_opt_pass pass_rename_ssa_copies;
extern struct gimple_opt_pass pass_rest_of_compilation;
extern struct gimple_opt_pass pass_sink_code;
extern struct gimple_opt_pass pass_fre;
-extern struct gimple_opt_pass pass_linear_transform;
extern struct gimple_opt_pass pass_check_data_deps;
extern struct gimple_opt_pass pass_copy_prop;
extern struct gimple_opt_pass pass_vrp;
@@ -551,6 +551,7 @@ extern struct rtl_opt_pass pass_reorder_blocks;
extern struct rtl_opt_pass pass_branch_target_load_optimize2;
extern struct rtl_opt_pass pass_leaf_regs;
extern struct rtl_opt_pass pass_split_before_sched2;
+extern struct rtl_opt_pass pass_compare_elim_after_reload;
extern struct rtl_opt_pass pass_sched2;
extern struct rtl_opt_pass pass_stack_regs;
extern struct rtl_opt_pass pass_stack_regs_run;
diff --git a/gcc/tree-predcom.c b/gcc/tree-predcom.c
index f744d448780..2dbd07d135a 100644
--- a/gcc/tree-predcom.c
+++ b/gcc/tree-predcom.c
@@ -1,5 +1,5 @@
/* Predictive commoning.
- Copyright (C) 2005, 2007, 2008, 2009, 2010
+ Copyright (C) 2005, 2007, 2008, 2009, 2010, 2011
Free Software Foundation, Inc.
This file is part of GCC.
@@ -1668,6 +1668,8 @@ single_nonlooparound_use (tree name)
return NULL;
}
+ else if (is_gimple_debug (stmt))
+ continue;
else if (ret != NULL)
return NULL;
else
diff --git a/gcc/tree-scalar-evolution.c b/gcc/tree-scalar-evolution.c
index d60e56915c3..1b68b36b30b 100644
--- a/gcc/tree-scalar-evolution.c
+++ b/gcc/tree-scalar-evolution.c
@@ -1399,7 +1399,7 @@ follow_ssa_edge (struct loop *loop, gimple def, gimple halting_phi,
return t_false;
/* Give up if the path is longer than the MAX that we allow. */
- if (limit > PARAM_VALUE (PARAM_SCEV_MAX_EXPR_SIZE))
+ if (limit > PARAM_VALUE (PARAM_SCEV_MAX_EXPR_COMPLEXITY))
return t_dont_know;
def_loop = loop_containing_stmt (def);
diff --git a/gcc/tree-sra.c b/gcc/tree-sra.c
index c2ec2042932..f28719f5fe6 100644
--- a/gcc/tree-sra.c
+++ b/gcc/tree-sra.c
@@ -195,6 +195,14 @@ struct access
statement? This flag is propagated down the access tree. */
unsigned grp_assignment_write : 1;
+ /* Does this group contain a read access through a scalar type? This flag is
+ not propagated in the access tree in any direction. */
+ unsigned grp_scalar_read : 1;
+
+ /* Does this group contain a write access through a scalar type? This flag
+ is not propagated in the access tree in any direction. */
+ unsigned grp_scalar_write : 1;
+
/* Other passes of the analysis use this bit to make function
analyze_access_subtree create scalar replacements for this group if
possible. */
@@ -368,16 +376,18 @@ dump_access (FILE *f, struct access *access, bool grp)
fprintf (f, ", type = ");
print_generic_expr (f, access->type, 0);
if (grp)
- fprintf (f, ", grp_write = %d, total_scalarization = %d, "
- "grp_read = %d, grp_hint = %d, grp_assignment_read = %d,"
- "grp_assignment_write = %d, grp_covered = %d, "
+ fprintf (f, ", total_scalarization = %d, grp_read = %d, grp_write = %d, "
+ "grp_assignment_read = %d, grp_assignment_write = %d, "
+ "grp_scalar_read = %d, grp_scalar_write = %d, "
+ "grp_hint = %d, grp_covered = %d, "
"grp_unscalarizable_region = %d, grp_unscalarized_data = %d, "
"grp_partial_lhs = %d, grp_to_be_replaced = %d, "
"grp_maybe_modified = %d, "
"grp_not_necessarilly_dereferenced = %d\n",
- access->grp_write, access->total_scalarization,
- access->grp_read, access->grp_hint, access->grp_assignment_read,
- access->grp_assignment_write, access->grp_covered,
+ access->total_scalarization, access->grp_read, access->grp_write,
+ access->grp_assignment_read, access->grp_assignment_write,
+ access->grp_scalar_read, access->grp_scalar_write,
+ access->grp_hint, access->grp_covered,
access->grp_unscalarizable_region, access->grp_unscalarized_data,
access->grp_partial_lhs, access->grp_to_be_replaced,
access->grp_maybe_modified,
@@ -1530,7 +1540,7 @@ find_var_candidates (void)
referenced_var_iterator rvi;
bool ret = false;
- FOR_EACH_REFERENCED_VAR (var, rvi)
+ FOR_EACH_REFERENCED_VAR (cfun, var, rvi)
{
if (TREE_CODE (var) != VAR_DECL && TREE_CODE (var) != PARM_DECL)
continue;
@@ -1593,9 +1603,13 @@ sort_and_splice_var_accesses (tree var)
struct access *access = VEC_index (access_p, access_vec, i);
bool grp_write = access->write;
bool grp_read = !access->write;
+ bool grp_scalar_write = access->write
+ && is_gimple_reg_type (access->type);
+ bool grp_scalar_read = !access->write
+ && is_gimple_reg_type (access->type);
bool grp_assignment_read = access->grp_assignment_read;
bool grp_assignment_write = access->grp_assignment_write;
- bool multiple_reads = false;
+ bool multiple_scalar_reads = false;
bool total_scalarization = access->total_scalarization;
bool grp_partial_lhs = access->grp_partial_lhs;
bool first_scalar = is_gimple_reg_type (access->type);
@@ -1620,13 +1634,21 @@ sort_and_splice_var_accesses (tree var)
if (ac2->offset != access->offset || ac2->size != access->size)
break;
if (ac2->write)
- grp_write = true;
+ {
+ grp_write = true;
+ grp_scalar_write = (grp_scalar_write
+ || is_gimple_reg_type (ac2->type));
+ }
else
{
- if (grp_read)
- multiple_reads = true;
- else
- grp_read = true;
+ grp_read = true;
+ if (is_gimple_reg_type (ac2->type))
+ {
+ if (grp_scalar_read)
+ multiple_scalar_reads = true;
+ else
+ grp_scalar_read = true;
+ }
}
grp_assignment_read |= ac2->grp_assignment_read;
grp_assignment_write |= ac2->grp_assignment_write;
@@ -1648,9 +1670,11 @@ sort_and_splice_var_accesses (tree var)
access->group_representative = access;
access->grp_write = grp_write;
access->grp_read = grp_read;
+ access->grp_scalar_read = grp_scalar_read;
+ access->grp_scalar_write = grp_scalar_write;
access->grp_assignment_read = grp_assignment_read;
access->grp_assignment_write = grp_assignment_write;
- access->grp_hint = multiple_reads || total_scalarization;
+ access->grp_hint = multiple_scalar_reads || total_scalarization;
access->grp_partial_lhs = grp_partial_lhs;
access->grp_unscalarizable_region = unscalarizable_region;
if (access->first_link)
@@ -1851,13 +1875,13 @@ enum mark_rw_status { SRA_MRRW_NOTHING, SRA_MRRW_DIRECT, SRA_MRRW_ASSIGN};
there is more than one direct read access) or according to the following
table:
- Access written to individually (once or more times)
+ Access written to through a scalar type (once or more times)
|
- | Parent written to in an assignment statement
+ | Written to in an assignment statement
| |
- | | Access read individually _once_
+ | | Access read as scalar _once_
| | |
- | | | Parent read in an assignment statement
+ | | | Read in an assignment statement
| | | |
| | | | Scalarize Comment
-----------------------------------------------------------------------------
@@ -1888,8 +1912,6 @@ analyze_access_subtree (struct access *root, bool allow_replacements,
HOST_WIDE_INT covered_to = root->offset;
bool scalar = is_gimple_reg_type (root->type);
bool hole = false, sth_created = false;
- bool direct_read = root->grp_read;
- bool direct_write = root->grp_write;
if (root->grp_assignment_read)
mark_read = SRA_MRRW_ASSIGN;
@@ -1938,8 +1960,8 @@ analyze_access_subtree (struct access *root, bool allow_replacements,
if (allow_replacements && scalar && !root->first_child
&& (root->grp_hint
- || ((direct_write || root->grp_assignment_write)
- && (direct_read || root->grp_assignment_read))))
+ || ((root->grp_scalar_read || root->grp_assignment_read)
+ && (root->grp_scalar_write || root->grp_assignment_write))))
{
if (dump_file && (dump_flags & TDF_DETAILS))
{
@@ -2739,15 +2761,13 @@ sra_modify_assign (gimple *stmt, gimple_stmt_iterator *gsi)
&& !contains_bitfld_comp_ref_p (lhs)
&& !access_has_children_p (lacc))
{
- lhs = build_ref_for_offset (loc, lhs, 0, TREE_TYPE (rhs),
- gsi, false);
+ lhs = build_ref_for_model (loc, lhs, 0, racc, gsi, false);
gimple_assign_set_lhs (*stmt, lhs);
}
else if (AGGREGATE_TYPE_P (TREE_TYPE (rhs))
&& !contains_vce_or_bfcref_p (rhs)
&& !access_has_children_p (racc))
- rhs = build_ref_for_offset (loc, rhs, 0, TREE_TYPE (lhs),
- gsi, false);
+ rhs = build_ref_for_model (loc, rhs, 0, lacc, gsi, false);
if (!useless_type_conversion_p (TREE_TYPE (lhs), TREE_TYPE (rhs)))
{
@@ -4342,7 +4362,8 @@ convert_callers (struct cgraph_node *node, tree old_decl,
}
for (cs = node->callers; cs; cs = cs->next_caller)
- if (bitmap_set_bit (recomputed_callers, cs->caller->uid))
+ if (bitmap_set_bit (recomputed_callers, cs->caller->uid)
+ && gimple_in_ssa_p (DECL_STRUCT_FUNCTION (cs->caller->decl)))
compute_inline_parameters (cs->caller);
BITMAP_FREE (recomputed_callers);
@@ -4425,6 +4446,13 @@ ipa_sra_preliminary_function_checks (struct cgraph_node *node)
return false;
}
+ if (!node->local.can_change_signature)
+ {
+ if (dump_file)
+ fprintf (dump_file, "Function can not change signature.\n");
+ return false;
+ }
+
if (!tree_versionable_function_p (node->decl))
{
if (dump_file)
diff --git a/gcc/tree-ssa-alias.c b/gcc/tree-ssa-alias.c
index 3f6fec1574a..68321d29e24 100644
--- a/gcc/tree-ssa-alias.c
+++ b/gcc/tree-ssa-alias.c
@@ -364,7 +364,7 @@ dump_alias_info (FILE *file)
fprintf (file, "Aliased symbols\n\n");
- FOR_EACH_REFERENCED_VAR (var, rvi)
+ FOR_EACH_REFERENCED_VAR (cfun, var, rvi)
{
if (may_be_aliased (var))
dump_variable (file, var);
@@ -808,7 +808,8 @@ indirect_ref_may_alias_decl_p (tree ref1 ATTRIBUTE_UNUSED, tree base1,
return aliasing_component_refs_p (ref1, TREE_TYPE (ptrtype1),
ref1_alias_set, base1_alias_set,
offset1, max_size1,
- ref2, TREE_TYPE (base2),
+ ref2, TREE_TYPE
+ (reference_alias_ptr_type (ref2)),
ref2_alias_set, base2_alias_set,
offset2, max_size2, true);
diff --git a/gcc/tree-ssa-ccp.c b/gcc/tree-ssa-ccp.c
index 57fc56d8ba7..8b8d996f508 100644
--- a/gcc/tree-ssa-ccp.c
+++ b/gcc/tree-ssa-ccp.c
@@ -1768,8 +1768,8 @@ bit_value_binop_1 (enum tree_code code, tree type,
tree r1type, double_int r1val, double_int r1mask,
tree r2type, double_int r2val, double_int r2mask)
{
- bool uns = (TREE_CODE (r1type) == INTEGER_TYPE
- && TYPE_IS_SIZETYPE (r1type) ? 0 : TYPE_UNSIGNED (r1type));
+ bool uns = (TREE_CODE (type) == INTEGER_TYPE
+ && TYPE_IS_SIZETYPE (type) ? 0 : TYPE_UNSIGNED (type));
/* Assume we'll get a constant result. Use an initial varying value,
we fall back to varying in the end if necessary. */
*mask = double_int_minus_one;
@@ -1836,6 +1836,13 @@ bit_value_binop_1 (enum tree_code code, tree type,
}
else if (shift < 0)
{
+ /* ??? We can have sizetype related inconsistencies in
+ the IL. */
+ if ((TREE_CODE (r1type) == INTEGER_TYPE
+ && (TYPE_IS_SIZETYPE (r1type)
+ ? 0 : TYPE_UNSIGNED (r1type))) != uns)
+ break;
+
shift = -shift;
*mask = double_int_rshift (r1mask, shift,
TYPE_PRECISION (type), !uns);
@@ -1946,6 +1953,14 @@ bit_value_binop_1 (enum tree_code code, tree type,
if (double_int_negative_p (r1mask) || double_int_negative_p (r2mask))
break;
+ /* For comparisons the signedness is in the comparison operands. */
+ uns = (TREE_CODE (r1type) == INTEGER_TYPE
+ && TYPE_IS_SIZETYPE (r1type) ? 0 : TYPE_UNSIGNED (r1type));
+ /* ??? We can have sizetype related inconsistencies in the IL. */
+ if ((TREE_CODE (r2type) == INTEGER_TYPE
+ && TYPE_IS_SIZETYPE (r2type) ? 0 : TYPE_UNSIGNED (r2type)) != uns)
+ break;
+
/* If we know the most significant bits we know the values
value ranges by means of treating varying bits as zero
or one. Do a cross comparison of the max/min pairs. */
diff --git a/gcc/tree-ssa-copyrename.c b/gcc/tree-ssa-copyrename.c
index abee6b9407f..dfc0b4edbbe 100644
--- a/gcc/tree-ssa-copyrename.c
+++ b/gcc/tree-ssa-copyrename.c
@@ -1,5 +1,5 @@
/* Rename SSA copies.
- Copyright (C) 2004, 2006, 2007, 2008, 2009, 2010
+ Copyright (C) 2004, 2006, 2007, 2008, 2009, 2010, 2011
Free Software Foundation, Inc.
Contributed by Andrew MacLeod <amacleod@redhat.com>
@@ -170,7 +170,7 @@ copy_rename_partition_coalesce (var_map map, tree var1, tree var2, FILE *debug)
return false;
}
- /* Never attempt to coalesce 2 difference parameters. */
+ /* Never attempt to coalesce 2 different parameters. */
if (TREE_CODE (root1) == PARM_DECL && TREE_CODE (root2) == PARM_DECL)
{
if (debug)
@@ -226,11 +226,28 @@ copy_rename_partition_coalesce (var_map map, tree var1, tree var2, FILE *debug)
ign2 = false;
}
- /* Don't coalesce if the two variables are not of the same type. */
- if (TREE_TYPE (root1) != TREE_TYPE (root2))
+ /* Don't coalesce if the new chosen root variable would be read-only.
+ If both ign1 && ign2, then the root var of the larger partition
+ wins, so reject in that case if any of the root vars is TREE_READONLY.
+ Otherwise reject only if the root var, on which replace_ssa_name_symbol
+ will be called below, is readonly. */
+ if ((TREE_READONLY (root1) && ign2) || (TREE_READONLY (root2) && ign1))
{
if (debug)
- fprintf (debug, " : Different types. No coalesce.\n");
+ fprintf (debug, " : Readonly variable. No coalesce.\n");
+ return false;
+ }
+
+ /* Don't coalesce if the two variables aren't type compatible . */
+ if (!types_compatible_p (TREE_TYPE (root1), TREE_TYPE (root2))
+ /* There is a disconnect between the middle-end type-system and
+ VRP, avoid coalescing enum types with different bounds. */
+ || ((TREE_CODE (TREE_TYPE (root1)) == ENUMERAL_TYPE
+ || TREE_CODE (TREE_TYPE (root2)) == ENUMERAL_TYPE)
+ && TREE_TYPE (root1) != TREE_TYPE (root2)))
+ {
+ if (debug)
+ fprintf (debug, " : Incompatible types. No coalesce.\n");
return false;
}
diff --git a/gcc/tree-ssa-dom.c b/gcc/tree-ssa-dom.c
index bab6ced1c60..fc87c4604c7 100644
--- a/gcc/tree-ssa-dom.c
+++ b/gcc/tree-ssa-dom.c
@@ -799,10 +799,11 @@ struct gimple_opt_pass pass_dominator =
0, /* properties_provided */
0, /* properties_destroyed */
0, /* todo_flags_start */
- TODO_dump_func
+ TODO_cleanup_cfg
| TODO_update_ssa
- | TODO_cleanup_cfg
- | TODO_verify_ssa /* todo_flags_finish */
+ | TODO_verify_ssa
+ | TODO_verify_flow
+ | TODO_dump_func /* todo_flags_finish */
}
};
diff --git a/gcc/tree-ssa-dse.c b/gcc/tree-ssa-dse.c
index 80c2622c9dc..26a438d12b2 100644
--- a/gcc/tree-ssa-dse.c
+++ b/gcc/tree-ssa-dse.c
@@ -83,6 +83,10 @@ struct dse_block_local_data
bitmap stores;
};
+/* Bitmap of blocks that have had EH statements cleaned. We should
+ remove their dead edges eventually. */
+static bitmap need_eh_cleanup;
+
static bool gate_dse (void);
static unsigned int tree_ssa_dse (void);
static void dse_initialize_block_local_data (struct dom_walk_data *,
@@ -335,6 +339,8 @@ dse_optimize_stmt (struct dse_global_data *dse_gd,
/* Then we need to fix the operand of the consuming stmt. */
unlink_stmt_vdef (stmt);
+ bitmap_set_bit (need_eh_cleanup, gimple_bb (stmt)->index);
+
/* Remove the dead store. */
gsi_remove (&gsi, true);
@@ -401,6 +407,8 @@ tree_ssa_dse (void)
struct dom_walk_data walk_data;
struct dse_global_data dse_gd;
+ need_eh_cleanup = BITMAP_ALLOC (NULL);
+
renumber_gimple_stmt_uids ();
/* We might consider making this a property of each pass so that it
@@ -435,6 +443,16 @@ tree_ssa_dse (void)
/* Release the main bitmap. */
BITMAP_FREE (dse_gd.stores);
+ /* Removal of stores may make some EH edges dead. Purge such edges from
+ the CFG as needed. */
+ if (!bitmap_empty_p (need_eh_cleanup))
+ {
+ gimple_purge_all_dead_eh_edges (need_eh_cleanup);
+ cleanup_tree_cfg ();
+ }
+
+ BITMAP_FREE (need_eh_cleanup);
+
/* For now, just wipe the post-dominator information. */
free_dominance_info (CDI_POST_DOMINATORS);
return 0;
diff --git a/gcc/tree-ssa-forwprop.c b/gcc/tree-ssa-forwprop.c
index 64c8e88e26e..f183159604c 100644
--- a/gcc/tree-ssa-forwprop.c
+++ b/gcc/tree-ssa-forwprop.c
@@ -1,5 +1,5 @@
/* Forward propagation of expressions for single use variables.
- Copyright (C) 2004, 2005, 2007, 2008, 2009, 2010
+ Copyright (C) 2004, 2005, 2007, 2008, 2009, 2010, 2011
Free Software Foundation, Inc.
This file is part of GCC.
@@ -299,34 +299,34 @@ can_propagate_from (gimple def_stmt)
return true;
}
-/* Remove a copy chain ending in NAME along the defs but not
- further or including UP_TO_STMT. If NAME was replaced in
- its only use then this function can be used to clean up
- dead stmts. Returns true if UP_TO_STMT can be removed
- as well, otherwise false. */
+/* Remove a copy chain ending in NAME along the defs.
+ If NAME was replaced in its only use then this function can be used
+ to clean up dead stmts. Returns true if cleanup-cfg has to run. */
static bool
-remove_prop_source_from_use (tree name, gimple up_to_stmt)
+remove_prop_source_from_use (tree name)
{
gimple_stmt_iterator gsi;
gimple stmt;
+ bool cfg_changed = false;
do {
+ basic_block bb;
+
if (!has_zero_uses (name))
- return false;
+ return cfg_changed;
stmt = SSA_NAME_DEF_STMT (name);
- if (stmt == up_to_stmt)
- return true;
-
gsi = gsi_for_stmt (stmt);
+ bb = gimple_bb (stmt);
release_defs (stmt);
gsi_remove (&gsi, true);
+ cfg_changed |= gimple_purge_dead_eh_edges (bb);
name = (gimple_assign_copy_p (stmt)) ? gimple_assign_rhs1 (stmt) : NULL;
} while (name && TREE_CODE (name) == SSA_NAME);
- return false;
+ return cfg_changed;
}
/* Return the rhs of a gimple_assign STMT in a form of a single tree,
@@ -468,9 +468,8 @@ forward_propagate_into_gimple_cond (gimple stmt)
update_stmt (stmt);
/* Remove defining statements. */
- remove_prop_source_from_use (name, NULL);
-
- if (is_gimple_min_invariant (tmp))
+ if (remove_prop_source_from_use (name)
+ || is_gimple_min_invariant (tmp))
did_something = 2;
else if (did_something == 0)
did_something = 1;
@@ -579,9 +578,8 @@ forward_propagate_into_cond (gimple_stmt_iterator *gsi_p)
update_stmt (stmt);
/* Remove defining statements. */
- remove_prop_source_from_use (name, NULL);
-
- if (is_gimple_min_invariant (tmp))
+ if (remove_prop_source_from_use (name)
+ || is_gimple_min_invariant (tmp))
did_something = 2;
else if (did_something == 0)
did_something = 1;
@@ -1114,7 +1112,7 @@ forward_propagate_addr_expr (tree name, tree rhs)
}
}
- return all;
+ return all && has_zero_uses (name);
}
/* Forward propagate the comparison defined in STMT like
@@ -1207,9 +1205,6 @@ forward_propagate_comparison (gimple stmt)
update_stmt (use_stmt);
}
- /* Remove defining statements. */
- remove_prop_source_from_use (name, stmt);
-
if (dump_file && (dump_flags & TDF_DETAILS))
{
tree old_rhs = rhs_to_tree (TREE_TYPE (gimple_assign_lhs (stmt)),
@@ -1221,7 +1216,8 @@ forward_propagate_comparison (gimple stmt)
fprintf (dump_file, "'\n");
}
- return true;
+ /* Remove defining statements. */
+ return remove_prop_source_from_use (name);
}
return false;
@@ -2051,13 +2047,8 @@ tree_ssa_forward_propagate_single_use_vars (void)
== tcc_comparison)
{
if (forward_propagate_comparison (stmt))
- {
- release_defs (stmt);
- todoflags |= TODO_remove_unused_locals;
- gsi_remove (&gsi, true);
- }
- else
- gsi_next (&gsi);
+ cfg_changed = true;
+ gsi_next (&gsi);
}
else if (gimple_assign_rhs_code (stmt) == BIT_AND_EXPR)
{
diff --git a/gcc/tree-ssa-live.c b/gcc/tree-ssa-live.c
index 7a6cafa0d28..0441df67b64 100644
--- a/gcc/tree-ssa-live.c
+++ b/gcc/tree-ssa-live.c
@@ -453,8 +453,11 @@ remove_unused_scope_block_p (tree scope)
else if (TREE_CODE (*t) == VAR_DECL && DECL_HAS_VALUE_EXPR_P (*t))
unused = false;
- /* Remove everything we don't generate debug info for. */
- else if (DECL_IGNORED_P (*t))
+ /* Remove everything we don't generate debug info for.
+ Don't remove larger vars though, because BLOCK_VARS are
+ used also during expansion to determine which variables
+ might share stack space. */
+ else if (DECL_IGNORED_P (*t) && is_gimple_reg (*t))
{
*t = DECL_CHAIN (*t);
next = t;
@@ -465,7 +468,7 @@ remove_unused_scope_block_p (tree scope)
Exception are the scope blocks not containing any instructions
at all so user can't get into the scopes at first place. */
else if ((ann = var_ann (*t)) != NULL
- && ann->used)
+ && is_used_p (*t))
unused = false;
else if (TREE_CODE (*t) == LABEL_DECL && TREE_USED (*t))
/* For labels that are still used in the IL, the decision to
@@ -490,11 +493,16 @@ remove_unused_scope_block_p (tree scope)
can be considered dead. We only want to keep around blocks user can
breakpoint into and ask about value of optimized out variables.
- Similarly we need to keep around types at least until all variables of
- all nested blocks are gone. We track no information on whether given
- type is used or not. */
+ Similarly we need to keep around types at least until all
+ variables of all nested blocks are gone. We track no
+ information on whether given type is used or not, so we have
+ to keep them even when not emitting debug information,
+ otherwise we may end up remapping variables and their (local)
+ types in different orders depending on whether debug
+ information is being generated. */
- else if (debug_info_level == DINFO_LEVEL_NORMAL
+ else if (TREE_CODE (*t) == TYPE_DECL
+ || debug_info_level == DINFO_LEVEL_NORMAL
|| debug_info_level == DINFO_LEVEL_VERBOSE)
;
else
@@ -625,13 +633,11 @@ dump_scope_block (FILE *file, int indent, tree scope, int flags)
for (var = BLOCK_VARS (scope); var; var = DECL_CHAIN (var))
{
bool used = false;
- var_ann_t ann;
- if ((ann = var_ann (var))
- && ann->used)
- used = true;
+ if (var_ann (var))
+ used = is_used_p (var);
- fprintf (file, "%*s",indent, "");
+ fprintf (file, "%*s", indent, "");
print_generic_decl (file, var, flags);
fprintf (file, "%s\n", used ? "" : " (unused)");
}
@@ -699,8 +705,8 @@ remove_unused_locals (void)
mark_scope_block_unused (DECL_INITIAL (current_function_decl));
/* Assume all locals are unused. */
- FOR_EACH_REFERENCED_VAR (t, rvi)
- var_ann (t)->used = false;
+ FOR_EACH_REFERENCED_VAR (cfun, t, rvi)
+ clear_is_used (t);
/* Walk the CFG marking all referenced symbols. */
FOR_EACH_BB (bb)
@@ -761,7 +767,7 @@ remove_unused_locals (void)
var = VEC_index (tree, cfun->local_decls, srcidx);
if (TREE_CODE (var) != FUNCTION_DECL
&& (!(ann = var_ann (var))
- || !ann->used))
+ || !is_used_p (var)))
{
if (is_global_var (var))
{
@@ -793,7 +799,7 @@ remove_unused_locals (void)
if (TREE_CODE (var) == VAR_DECL
&& is_global_var (var)
&& (ann = var_ann (var)) != NULL
- && ann->used)
+ && is_used_p (var))
mark_all_vars_used (&DECL_INITIAL (var), global_unused_vars);
num = VEC_length (tree, cfun->local_decls);
@@ -815,12 +821,12 @@ remove_unused_locals (void)
}
/* Remove unused variables from REFERENCED_VARs. */
- FOR_EACH_REFERENCED_VAR (t, rvi)
+ FOR_EACH_REFERENCED_VAR (cfun, t, rvi)
if (!is_global_var (t)
&& TREE_CODE (t) != PARM_DECL
&& TREE_CODE (t) != RESULT_DECL
- && !(ann = var_ann (t))->used
- && !ann->is_heapvar)
+ && !is_used_p (t)
+ && !var_ann (t)->is_heapvar)
remove_referenced_var (t);
remove_unused_scope_block_p (DECL_INITIAL (current_function_decl));
if (dump_file && (dump_flags & TDF_DETAILS))
diff --git a/gcc/tree-ssa-loop-ch.c b/gcc/tree-ssa-loop-ch.c
index 85c6de8aa07..c58cb5f8bba 100644
--- a/gcc/tree-ssa-loop-ch.c
+++ b/gcc/tree-ssa-loop-ch.c
@@ -276,7 +276,9 @@ struct gimple_opt_pass pass_ch =
0, /* properties_provided */
0, /* properties_destroyed */
0, /* todo_flags_start */
- TODO_cleanup_cfg | TODO_dump_func
- | TODO_verify_ssa /* todo_flags_finish */
+ TODO_cleanup_cfg
+ | TODO_verify_ssa
+ | TODO_verify_flow
+ | TODO_dump_func /* todo_flags_finish */
}
};
diff --git a/gcc/tree-ssa-loop-im.c b/gcc/tree-ssa-loop-im.c
index 30faeb9319d..4ec67cf1138 100644
--- a/gcc/tree-ssa-loop-im.c
+++ b/gcc/tree-ssa-loop-im.c
@@ -676,31 +676,38 @@ extract_true_false_args_from_phi (basic_block dom, gimple phi,
by the true edge of the predicate block and the other edge
dominated by the false edge. This ensures that the PHI argument
we are going to take is completely determined by the path we
- take from the predicate block. */
+ take from the predicate block.
+ We can only use BB dominance checks below if the destination of
+ the true/false edges are dominated by their edge, thus only
+ have a single predecessor. */
extract_true_false_edges_from_block (dom, &true_edge, &false_edge);
tem = EDGE_PRED (bb, 0);
if (tem == true_edge
- || tem->src == true_edge->dest
- || dominated_by_p (CDI_DOMINATORS,
- tem->src, true_edge->dest))
+ || (single_pred_p (true_edge->dest)
+ && (tem->src == true_edge->dest
+ || dominated_by_p (CDI_DOMINATORS,
+ tem->src, true_edge->dest))))
arg0 = PHI_ARG_DEF (phi, tem->dest_idx);
else if (tem == false_edge
- || tem->src == false_edge->dest
- || dominated_by_p (CDI_DOMINATORS,
- tem->src, false_edge->dest))
+ || (single_pred_p (false_edge->dest)
+ && (tem->src == false_edge->dest
+ || dominated_by_p (CDI_DOMINATORS,
+ tem->src, false_edge->dest))))
arg1 = PHI_ARG_DEF (phi, tem->dest_idx);
else
return false;
tem = EDGE_PRED (bb, 1);
if (tem == true_edge
- || tem->src == true_edge->dest
- || dominated_by_p (CDI_DOMINATORS,
- tem->src, true_edge->dest))
+ || (single_pred_p (true_edge->dest)
+ && (tem->src == true_edge->dest
+ || dominated_by_p (CDI_DOMINATORS,
+ tem->src, true_edge->dest))))
arg0 = PHI_ARG_DEF (phi, tem->dest_idx);
else if (tem == false_edge
- || tem->src == false_edge->dest
- || dominated_by_p (CDI_DOMINATORS,
- tem->src, false_edge->dest))
+ || (single_pred_p (false_edge->dest)
+ && (tem->src == false_edge->dest
+ || dominated_by_p (CDI_DOMINATORS,
+ tem->src, false_edge->dest))))
arg1 = PHI_ARG_DEF (phi, tem->dest_idx);
else
return false;
@@ -2318,6 +2325,10 @@ can_sm_ref_p (struct loop *loop, mem_ref_p ref)
|| !for_each_index (&ref->mem, may_move_till, loop))
return false;
+ /* If it can throw fail, we do not properly update EH info. */
+ if (tree_could_throw_p (ref->mem))
+ return false;
+
/* If it can trap, it must be always executed in LOOP.
Readonly memory locations may trap when storing to them, but
tree_could_trap_p is a predicate for rvalues, so check that
diff --git a/gcc/tree-ssa-loop-niter.c b/gcc/tree-ssa-loop-niter.c
index ee85f6fe006..c14e13c7248 100644
--- a/gcc/tree-ssa-loop-niter.c
+++ b/gcc/tree-ssa-loop-niter.c
@@ -1890,7 +1890,7 @@ number_of_iterations_exit (struct loop *loop, edge exit,
/* With -funsafe-loop-optimizations we assume that nothing bad can happen.
But if we can prove that there is overflow or some other source of weird
behavior, ignore the loop even with -funsafe-loop-optimizations. */
- if (integer_zerop (niter->assumptions))
+ if (integer_zerop (niter->assumptions) || !single_exit (loop))
return false;
if (flag_unsafe_loop_optimizations)
diff --git a/gcc/tree-ssa-loop-prefetch.c b/gcc/tree-ssa-loop-prefetch.c
index 59c65d3aa2e..d920ec6eb07 100644
--- a/gcc/tree-ssa-loop-prefetch.c
+++ b/gcc/tree-ssa-loop-prefetch.c
@@ -1562,7 +1562,8 @@ determine_loop_nest_reuse (struct loop *loop, struct mem_ref_group *refs,
for (gr = refs; gr; gr = gr->next)
for (ref = gr->refs; ref; ref = ref->next)
{
- dr = create_data_ref (nest, ref->mem, ref->stmt, !ref->write_p);
+ dr = create_data_ref (nest, loop_containing_stmt (ref->stmt),
+ ref->mem, ref->stmt, !ref->write_p);
if (dr)
{
diff --git a/gcc/tree-ssa-loop.c b/gcc/tree-ssa-loop.c
index 4b51f403c49..c7efc7c0f6e 100644
--- a/gcc/tree-ssa-loop.c
+++ b/gcc/tree-ssa-loop.c
@@ -179,8 +179,7 @@ run_tree_predictive_commoning (void)
if (!current_loops)
return 0;
- tree_predictive_commoning ();
- return 0;
+ return tree_predictive_commoning ();
}
static bool
@@ -246,45 +245,6 @@ struct gimple_opt_pass pass_vectorize =
}
};
-/* Loop nest optimizations. */
-
-static unsigned int
-tree_linear_transform (void)
-{
- if (number_of_loops () <= 1)
- return 0;
-
- linear_transform_loops ();
- return 0;
-}
-
-static bool
-gate_tree_linear_transform (void)
-{
- return flag_tree_loop_linear != 0;
-}
-
-struct gimple_opt_pass pass_linear_transform =
-{
- {
- GIMPLE_PASS,
- "ltrans", /* name */
- gate_tree_linear_transform, /* gate */
- tree_linear_transform, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_TREE_LINEAR_TRANSFORM, /* tv_id */
- PROP_cfg | PROP_ssa, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- TODO_dump_func
- | TODO_update_ssa_only_virtuals
- | TODO_ggc_collect /* todo_flags_finish */
- }
-};
-
/* GRAPHITE optimizations. */
static unsigned int
@@ -348,7 +308,7 @@ struct gimple_opt_pass pass_graphite_transforms =
0, /* properties_provided */
0, /* properties_destroyed */
0, /* todo_flags_start */
- 0 /* todo_flags_finish */
+ TODO_dump_func /* todo_flags_finish */
}
};
@@ -567,7 +527,8 @@ struct gimple_opt_pass pass_complete_unrolli =
0, /* properties_provided */
0, /* properties_destroyed */
0, /* todo_flags_start */
- TODO_dump_func
+ TODO_verify_flow
+ | TODO_dump_func
| TODO_ggc_collect /* todo_flags_finish */
}
};
@@ -709,6 +670,8 @@ struct gimple_opt_pass pass_tree_loop_done =
0, /* properties_provided */
0, /* properties_destroyed */
0, /* todo_flags_start */
- TODO_cleanup_cfg | TODO_dump_func /* todo_flags_finish */
+ TODO_cleanup_cfg
+ | TODO_verify_flow
+ | TODO_dump_func /* todo_flags_finish */
}
};
diff --git a/gcc/tree-ssa-pre.c b/gcc/tree-ssa-pre.c
index fda94375b14..f2466432f89 100644
--- a/gcc/tree-ssa-pre.c
+++ b/gcc/tree-ssa-pre.c
@@ -1681,7 +1681,7 @@ phi_translate_1 (pre_expr expr, bitmap_set_t set1, bitmap_set_t set2,
tree result = vn_reference_lookup_pieces (newvuse, ref->set,
ref->type,
newoperands,
- &newref, true);
+ &newref, VN_WALK);
if (result)
VEC_free (vn_reference_op_s, heap, newoperands);
@@ -1691,6 +1691,12 @@ phi_translate_1 (pre_expr expr, bitmap_set_t set1, bitmap_set_t set2,
result = fold_build1 (VIEW_CONVERT_EXPR, ref->type, result);
converted = true;
}
+ else if (!result && newref
+ && !useless_type_conversion_p (ref->type, newref->type))
+ {
+ VEC_free (vn_reference_op_s, heap, newoperands);
+ return NULL;
+ }
if (result && is_gimple_min_invariant (result))
{
@@ -2594,6 +2600,10 @@ compute_antic (void)
{
if (dump_file && (dump_flags & TDF_DETAILS))
fprintf (dump_file, "Starting iteration %d\n", num_iterations);
+ /* ??? We need to clear our PHI translation cache here as the
+ ANTIC sets shrink and we restrict valid translations to
+ those having operands with leaders in ANTIC. Same below
+ for PA ANTIC computation. */
num_iterations++;
changed = false;
for (i = n_basic_blocks - NUM_FIXED_BLOCKS - 1; i >= 0; i--)
@@ -3607,11 +3617,23 @@ do_regular_insertion (basic_block block, basic_block dom)
already existing along every predecessor, and
it's defined by some predecessor, it is
partially redundant. */
- if (!cant_insert && !all_same && by_some && do_insertion
- && dbg_cnt (treepre_insert))
+ if (!cant_insert && !all_same && by_some)
{
- if (insert_into_preds_of_block (block, get_expression_id (expr),
- avail))
+ if (!do_insertion)
+ {
+ if (dump_file && (dump_flags & TDF_DETAILS))
+ {
+ fprintf (dump_file, "Skipping partial redundancy for "
+ "expression ");
+ print_pre_expr (dump_file, expr);
+ fprintf (dump_file, " (%04d), no redundancy on to be "
+ "optimized for speed edge\n", val);
+ }
+ }
+ else if (dbg_cnt (treepre_insert)
+ && insert_into_preds_of_block (block,
+ get_expression_id (expr),
+ avail))
new_stuff = true;
}
/* If all edges produce the same value and that value is
@@ -3999,7 +4021,7 @@ compute_avail (void)
copy_reference_ops_from_call (stmt, &ops);
vn_reference_lookup_pieces (gimple_vuse (stmt), 0,
gimple_expr_type (stmt),
- ops, &ref, false);
+ ops, &ref, VN_NOWALK);
VEC_free (vn_reference_op_s, heap, ops);
if (!ref)
continue;
@@ -4069,7 +4091,7 @@ compute_avail (void)
vn_reference_lookup (gimple_assign_rhs1 (stmt),
gimple_vuse (stmt),
- true, &ref);
+ VN_WALK, &ref);
if (!ref)
continue;
@@ -4313,7 +4335,7 @@ eliminate (void)
tree rhs = gimple_assign_rhs1 (stmt);
tree val;
val = vn_reference_lookup (gimple_assign_lhs (stmt),
- gimple_vuse (stmt), true, NULL);
+ gimple_vuse (stmt), VN_WALK, NULL);
if (TREE_CODE (rhs) == SSA_NAME)
rhs = VN_INFO (rhs)->valnum;
if (val
@@ -4837,7 +4859,7 @@ execute_pre (bool do_fre)
if (!do_fre)
loop_optimizer_init (LOOPS_NORMAL);
- if (!run_scc_vn ())
+ if (!run_scc_vn (do_fre ? VN_WALKREWRITE : VN_WALK))
{
if (!do_fre)
loop_optimizer_finalize ();
@@ -4893,7 +4915,10 @@ execute_pre (bool do_fre)
clear_expression_ids ();
free_scc_vn ();
if (!do_fre)
- remove_dead_inserted_code ();
+ {
+ remove_dead_inserted_code ();
+ todo |= TODO_verify_flow;
+ }
scev_finalize ();
fini_pre (do_fre);
diff --git a/gcc/tree-ssa-reassoc.c b/gcc/tree-ssa-reassoc.c
index 197591e330f..904fef80447 100644
--- a/gcc/tree-ssa-reassoc.c
+++ b/gcc/tree-ssa-reassoc.c
@@ -2282,7 +2282,10 @@ struct gimple_opt_pass pass_reassoc =
0, /* properties_provided */
0, /* properties_destroyed */
0, /* todo_flags_start */
- TODO_dump_func | TODO_ggc_collect | TODO_verify_ssa /* todo_flags_finish */
+ TODO_verify_ssa
+ | TODO_verify_flow
+ | TODO_dump_func
+ | TODO_ggc_collect /* todo_flags_finish */
}
};
diff --git a/gcc/tree-ssa-sccvn.c b/gcc/tree-ssa-sccvn.c
index 970f2c0276a..9222cb5f583 100644
--- a/gcc/tree-ssa-sccvn.c
+++ b/gcc/tree-ssa-sccvn.c
@@ -1243,6 +1243,8 @@ vn_reference_lookup_1 (vn_reference_t vr, vn_reference_t *vnresult)
}
static tree *last_vuse_ptr;
+static vn_lookup_kind vn_walk_kind;
+static vn_lookup_kind default_vn_walk_kind;
/* Callback for walk_non_aliased_vuses. Adjusts the vn_reference_t VR_
with the current VUSE and performs the expression lookup. */
@@ -1379,7 +1381,8 @@ vn_reference_lookup_3 (ao_ref *ref, tree vuse, void *vr_)
/* For aggregate copies translate the reference through them if
the copy kills ref. */
- else if (gimple_assign_single_p (def_stmt)
+ else if (vn_walk_kind == VN_WALKREWRITE
+ && gimple_assign_single_p (def_stmt)
&& (DECL_P (gimple_assign_rhs1 (def_stmt))
|| TREE_CODE (gimple_assign_rhs1 (def_stmt)) == MEM_REF
|| handled_component_p (gimple_assign_rhs1 (def_stmt))))
@@ -1473,7 +1476,7 @@ vn_reference_lookup_3 (ao_ref *ref, tree vuse, void *vr_)
tree
vn_reference_lookup_pieces (tree vuse, alias_set_type set, tree type,
VEC (vn_reference_op_s, heap) *operands,
- vn_reference_t *vnresult, bool maywalk)
+ vn_reference_t *vnresult, vn_lookup_kind kind)
{
struct vn_reference_s vr1;
vn_reference_t tmp;
@@ -1501,10 +1504,11 @@ vn_reference_lookup_pieces (tree vuse, alias_set_type set, tree type,
vn_reference_lookup_1 (&vr1, vnresult);
if (!*vnresult
- && maywalk
+ && kind != VN_NOWALK
&& vr1.vuse)
{
ao_ref r;
+ vn_walk_kind = kind;
if (ao_ref_init_from_vn_reference (&r, set, type, vr1.operands))
*vnresult =
(vn_reference_t)walk_non_aliased_vuses (&r, vr1.vuse,
@@ -1527,7 +1531,7 @@ vn_reference_lookup_pieces (tree vuse, alias_set_type set, tree type,
stored in the hashtable if one exists. */
tree
-vn_reference_lookup (tree op, tree vuse, bool maywalk,
+vn_reference_lookup (tree op, tree vuse, vn_lookup_kind kind,
vn_reference_t *vnresult)
{
VEC (vn_reference_op_s, heap) *operands;
@@ -1545,12 +1549,13 @@ vn_reference_lookup (tree op, tree vuse, bool maywalk,
if ((cst = fully_constant_vn_reference_p (&vr1)))
return cst;
- if (maywalk
+ if (kind != VN_NOWALK
&& vr1.vuse)
{
vn_reference_t wvnresult;
ao_ref r;
ao_ref_init (&r, op);
+ vn_walk_kind = kind;
wvnresult =
(vn_reference_t)walk_non_aliased_vuses (&r, vr1.vuse,
vn_reference_lookup_2,
@@ -2257,14 +2262,15 @@ visit_reference_op_load (tree lhs, tree op, gimple stmt)
last_vuse = gimple_vuse (stmt);
last_vuse_ptr = &last_vuse;
- result = vn_reference_lookup (op, gimple_vuse (stmt), true, NULL);
+ result = vn_reference_lookup (op, gimple_vuse (stmt),
+ default_vn_walk_kind, NULL);
last_vuse_ptr = NULL;
/* If we have a VCE, try looking up its operand as it might be stored in
a different type. */
if (!result && TREE_CODE (op) == VIEW_CONVERT_EXPR)
result = vn_reference_lookup (TREE_OPERAND (op, 0), gimple_vuse (stmt),
- true, NULL);
+ default_vn_walk_kind, NULL);
/* We handle type-punning through unions by value-numbering based
on offset and size of the access. Be prepared to handle a
@@ -2375,7 +2381,7 @@ visit_reference_op_store (tree lhs, tree op, gimple stmt)
Otherwise, the vdefs for the store are used when inserting into
the table, since the store generates a new memory state. */
- result = vn_reference_lookup (lhs, gimple_vuse (stmt), false, NULL);
+ result = vn_reference_lookup (lhs, gimple_vuse (stmt), VN_NOWALK, NULL);
if (result)
{
@@ -3459,15 +3465,18 @@ set_hashtable_value_ids (void)
}
/* Do SCCVN. Returns true if it finished, false if we bailed out
- due to resource constraints. */
+ due to resource constraints. DEFAULT_VN_WALK_KIND_ specifies
+ how we use the alias oracle walking during the VN process. */
bool
-run_scc_vn (void)
+run_scc_vn (vn_lookup_kind default_vn_walk_kind_)
{
size_t i;
tree param;
bool changed = true;
+ default_vn_walk_kind = default_vn_walk_kind_;
+
init_scc_vn ();
current_info = valid_info;
diff --git a/gcc/tree-ssa-sccvn.h b/gcc/tree-ssa-sccvn.h
index bd8b9bc80ba..bf99702e43a 100644
--- a/gcc/tree-ssa-sccvn.h
+++ b/gcc/tree-ssa-sccvn.h
@@ -165,11 +165,13 @@ typedef struct vn_ssa_aux
unsigned needs_insertion : 1;
} *vn_ssa_aux_t;
+typedef enum { VN_NOWALK, VN_WALK, VN_WALKREWRITE } vn_lookup_kind;
+
/* Return the value numbering info for an SSA_NAME. */
extern vn_ssa_aux_t VN_INFO (tree);
extern vn_ssa_aux_t VN_INFO_GET (tree);
tree vn_get_expr_for (tree);
-bool run_scc_vn (void);
+bool run_scc_vn (vn_lookup_kind);
void free_scc_vn (void);
tree vn_nary_op_lookup (tree, vn_nary_op_t *);
tree vn_nary_op_lookup_stmt (gimple, vn_nary_op_t *);
@@ -189,8 +191,8 @@ bool ao_ref_init_from_vn_reference (ao_ref *, alias_set_type, tree,
VEC (vn_reference_op_s, heap) *);
tree vn_reference_lookup_pieces (tree, alias_set_type, tree,
VEC (vn_reference_op_s, heap) *,
- vn_reference_t *, bool);
-tree vn_reference_lookup (tree, tree, bool, vn_reference_t *);
+ vn_reference_t *, vn_lookup_kind);
+tree vn_reference_lookup (tree, tree, vn_lookup_kind, vn_reference_t *);
vn_reference_t vn_reference_insert (tree, tree, tree);
vn_reference_t vn_reference_insert_pieces (tree, alias_set_type, tree,
VEC (vn_reference_op_s, heap) *,
diff --git a/gcc/tree-ssa-sink.c b/gcc/tree-ssa-sink.c
index bfa1a3108a7..962c2955e26 100644
--- a/gcc/tree-ssa-sink.c
+++ b/gcc/tree-ssa-sink.c
@@ -604,8 +604,9 @@ struct gimple_opt_pass pass_sink_code =
0, /* properties_destroyed */
0, /* todo_flags_start */
TODO_update_ssa
+ | TODO_verify_ssa
+ | TODO_verify_flow
| TODO_dump_func
- | TODO_ggc_collect
- | TODO_verify_ssa /* todo_flags_finish */
+ | TODO_ggc_collect /* todo_flags_finish */
}
};
diff --git a/gcc/tree-ssa-structalias.c b/gcc/tree-ssa-structalias.c
index a49f14bba13..de17312a716 100644
--- a/gcc/tree-ssa-structalias.c
+++ b/gcc/tree-ssa-structalias.c
@@ -2941,12 +2941,11 @@ process_constraint (constraint_t t)
static HOST_WIDE_INT
bitpos_of_field (const tree fdecl)
{
-
if (!host_integerp (DECL_FIELD_OFFSET (fdecl), 0)
|| !host_integerp (DECL_FIELD_BIT_OFFSET (fdecl), 0))
return -1;
- return (TREE_INT_CST_LOW (DECL_FIELD_OFFSET (fdecl)) * 8
+ return (TREE_INT_CST_LOW (DECL_FIELD_OFFSET (fdecl)) * BITS_PER_UNIT
+ TREE_INT_CST_LOW (DECL_FIELD_BIT_OFFSET (fdecl)));
}
@@ -4435,12 +4434,14 @@ find_func_aliases (gimple origt)
do_structure_copy (lhsop, rhsop);
else
{
+ enum tree_code code = gimple_assign_rhs_code (t);
+
get_constraint_for (lhsop, &lhsc);
- if (gimple_assign_rhs_code (t) == POINTER_PLUS_EXPR)
+ if (code == POINTER_PLUS_EXPR)
get_constraint_for_ptr_offset (gimple_assign_rhs1 (t),
gimple_assign_rhs2 (t), &rhsc);
- else if (gimple_assign_rhs_code (t) == BIT_AND_EXPR
+ else if (code == BIT_AND_EXPR
&& TREE_CODE (gimple_assign_rhs2 (t)) == INTEGER_CST)
{
/* Aligning a pointer via a BIT_AND_EXPR is offsetting
@@ -4448,11 +4449,15 @@ find_func_aliases (gimple origt)
get_constraint_for_ptr_offset (gimple_assign_rhs1 (t),
NULL_TREE, &rhsc);
}
- else if ((CONVERT_EXPR_CODE_P (gimple_assign_rhs_code (t))
+ else if ((CONVERT_EXPR_CODE_P (code)
&& !(POINTER_TYPE_P (gimple_expr_type (t))
&& !POINTER_TYPE_P (TREE_TYPE (rhsop))))
|| gimple_assign_single_p (t))
get_constraint_for_rhs (rhsop, &rhsc);
+ else if (truth_value_p (code))
+ /* Truth value results are not pointer (parts). Or at least
+ very very unreasonable obfuscation of a part. */
+ ;
else
{
/* All other operations are merges. */
@@ -5077,6 +5082,19 @@ push_fields_onto_fieldstack (tree type, VEC(fieldoff_s,heap) **fieldstack,
if (!VEC_empty (fieldoff_s, *fieldstack))
pair = VEC_last (fieldoff_s, *fieldstack);
+ /* If there isn't anything at offset zero, create sth. */
+ if (!pair
+ && offset + foff != 0)
+ {
+ pair = VEC_safe_push (fieldoff_s, heap, *fieldstack, NULL);
+ pair->offset = 0;
+ pair->size = offset + foff;
+ pair->has_unknown_size = false;
+ pair->must_have_pointers = false;
+ pair->may_have_pointers = false;
+ pair->only_restrict_pointers = false;
+ }
+
if (!DECL_SIZE (field)
|| !host_integerp (DECL_SIZE (field), 1))
has_unknown_size = true;
@@ -6827,11 +6845,34 @@ ipa_pta_execute (void)
push_cfun (func);
current_function_decl = node->decl;
- /* For externally visible functions use local constraints for
- their arguments. For local functions we see all callers
- and thus do not need initial constraints for parameters. */
if (node->local.externally_visible)
- intra_create_variable_infos ();
+ {
+ /* For externally visible functions use local constraints for
+ their arguments. For local functions we see all callers
+ and thus do not need initial constraints for parameters. */
+ intra_create_variable_infos ();
+
+ /* We also need to make function return values escape. Nothing
+ escapes by returning from main though. */
+ if (!MAIN_NAME_P (DECL_NAME (node->decl)))
+ {
+ varinfo_t fi, rvi;
+ fi = lookup_vi_for_tree (node->decl);
+ rvi = first_vi_for_offset (fi, fi_result);
+ if (rvi && rvi->offset == fi_result)
+ {
+ struct constraint_expr includes;
+ struct constraint_expr var;
+ includes.var = escaped_id;
+ includes.offset = 0;
+ includes.type = SCALAR;
+ var.var = rvi->id;
+ var.offset = 0;
+ var.type = SCALAR;
+ process_constraint (new_constraint (includes, var));
+ }
+ }
+ }
/* Build constriants for the function body. */
FOR_EACH_BB_FN (bb, func)
diff --git a/gcc/tree-ssa-ter.c b/gcc/tree-ssa-ter.c
index 47954cfa348..af8aae04a74 100644
--- a/gcc/tree-ssa-ter.c
+++ b/gcc/tree-ssa-ter.c
@@ -1,5 +1,5 @@
/* Routines for performing Temporary Expression Replacement (TER) in SSA trees.
- Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
+ Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
Free Software Foundation, Inc.
Contributed by Andrew MacLeod <amacleod@redhat.com>
@@ -357,10 +357,17 @@ add_dependence (temp_expr_table_p tab, int version, tree var)
}
-/* Return TRUE if expression STMT is suitable for replacement. */
+/* Return TRUE if expression STMT is suitable for replacement.
+ TER is true if is_replaceable_p is called from within TER, false
+ when used from within stmt_is_replaceable_p, i.e. EXPAND_INITIALIZER
+ expansion. The differences are that with !TER some tests are skipped
+ to make it more aggressive (doesn't require the same bb, or for -O0
+ same locus and same BLOCK), on the other side never considers memory
+ loads as replaceable, because those don't ever lead into constant
+ expressions. */
static inline bool
-is_replaceable_p (gimple stmt)
+is_replaceable_p (gimple stmt, bool ter)
{
use_operand_p use_p;
tree def;
@@ -386,7 +393,7 @@ is_replaceable_p (gimple stmt)
return false;
/* If the use isn't in this block, it wont be replaced either. */
- if (gimple_bb (use_stmt) != gimple_bb (stmt))
+ if (ter && gimple_bb (use_stmt) != gimple_bb (stmt))
return false;
locus1 = gimple_location (stmt);
@@ -404,6 +411,7 @@ is_replaceable_p (gimple stmt)
}
if (!optimize
+ && ter
&& ((locus1 && locus1 != locus2) || (block1 && block1 != block2)))
return false;
@@ -416,7 +424,7 @@ is_replaceable_p (gimple stmt)
return false;
/* Without alias info we can't move around loads. */
- if (!optimize
+ if ((!optimize || !ter)
&& gimple_assign_single_p (stmt)
&& !is_gimple_val (gimple_assign_rhs1 (stmt)))
return false;
@@ -444,6 +452,16 @@ is_replaceable_p (gimple stmt)
}
+/* Variant of is_replaceable_p test for use in EXPAND_INITIALIZER
+ expansion. */
+
+bool
+stmt_is_replaceable_p (gimple stmt)
+{
+ return is_replaceable_p (stmt, false);
+}
+
+
/* This function will remove the expression for VERSION from replacement
consideration in table TAB. If FREE_EXPR is true, then remove the
expression from consideration as well by freeing the decl uid bitmap. */
@@ -477,7 +495,7 @@ process_replaceable (temp_expr_table_p tab, gimple stmt, int call_cnt)
ssa_op_iter iter;
bitmap def_vars, use_vars;
- gcc_checking_assert (is_replaceable_p (stmt));
+ gcc_checking_assert (is_replaceable_p (stmt, true));
def = SINGLE_SSA_TREE_OPERAND (stmt, SSA_OP_DEF);
version = SSA_NAME_VERSION (def);
@@ -589,7 +607,7 @@ find_replaceable_in_bb (temp_expr_table_p tab, basic_block bb)
if (is_gimple_debug (stmt))
continue;
- stmt_replaceable = is_replaceable_p (stmt);
+ stmt_replaceable = is_replaceable_p (stmt, true);
/* Determine if this stmt finishes an existing expression. */
FOR_EACH_SSA_TREE_OPERAND (use, stmt, iter, SSA_OP_USE)
diff --git a/gcc/tree-ssa.c b/gcc/tree-ssa.c
index 7bd01f8d4db..5c9e0d88bf2 100644
--- a/gcc/tree-ssa.c
+++ b/gcc/tree-ssa.c
@@ -1157,7 +1157,7 @@ delete_tree_ssa (void)
tree var;
/* Remove annotations from every referenced local variable. */
- FOR_EACH_REFERENCED_VAR (var, rvi)
+ FOR_EACH_REFERENCED_VAR (cfun, var, rvi)
{
if (is_global_var (var))
continue;
@@ -1885,6 +1885,34 @@ non_rewritable_mem_ref_base (tree ref)
return NULL_TREE;
}
+/* For an lvalue tree LHS return true if it cannot be rewritten into SSA form.
+ Otherwise return true. */
+
+static bool
+non_rewritable_lvalue_p (tree lhs)
+{
+ /* A plain decl is always rewritable. */
+ if (DECL_P (lhs))
+ return false;
+
+ /* A decl that is wrapped inside a MEM-REF that covers
+ it full is also rewritable.
+ ??? The following could be relaxed allowing component
+ references that do not change the access size. */
+ if (TREE_CODE (lhs) == MEM_REF
+ && TREE_CODE (TREE_OPERAND (lhs, 0)) == ADDR_EXPR
+ && integer_zerop (TREE_OPERAND (lhs, 1)))
+ {
+ tree decl = TREE_OPERAND (TREE_OPERAND (lhs, 0), 0);
+ if (DECL_P (decl)
+ && DECL_SIZE (decl) == TYPE_SIZE (TREE_TYPE (lhs))
+ && (TREE_THIS_VOLATILE (decl) == TREE_THIS_VOLATILE (lhs)))
+ return false;
+ }
+
+ return true;
+}
+
/* When possible, clear TREE_ADDRESSABLE bit or set DECL_GIMPLE_REG_P bit and
mark the variable VAR for conversion into SSA. Return true when updating
stmts is required. */
@@ -1902,7 +1930,7 @@ maybe_optimize_var (tree var, bitmap addresses_taken, bitmap not_reg_needs)
/* If the variable is not in the list of referenced vars then we
do not need to touch it nor can we rename it. */
- if (!referenced_var_lookup (DECL_UID (var)))
+ if (!referenced_var_lookup (cfun, DECL_UID (var)))
return false;
if (TREE_ADDRESSABLE (var)
@@ -1978,29 +2006,13 @@ execute_update_addresses_taken (void)
if (code == GIMPLE_ASSIGN || code == GIMPLE_CALL)
{
tree lhs = gimple_get_lhs (stmt);
-
- /* A plain decl does not need it set. */
- if (lhs && !DECL_P (lhs))
+ if (lhs
+ && TREE_CODE (lhs) != SSA_NAME
+ && non_rewritable_lvalue_p (lhs))
{
- tree orig_lhs = lhs;
-
- while (handled_component_p (lhs))
- lhs = TREE_OPERAND (lhs, 0);
-
- if (DECL_P (lhs))
- bitmap_set_bit (not_reg_needs, DECL_UID (lhs));
- else if (TREE_CODE (lhs) == MEM_REF
- && TREE_CODE (TREE_OPERAND (lhs, 0)) == ADDR_EXPR)
- {
- decl = TREE_OPERAND (TREE_OPERAND (lhs, 0), 0);
- if (DECL_P (decl)
- && (!integer_zerop (TREE_OPERAND (lhs, 1))
- || (DECL_SIZE (decl)
- != TYPE_SIZE (TREE_TYPE (orig_lhs)))
- || (TREE_THIS_VOLATILE (lhs)
- != TREE_THIS_VOLATILE (decl))))
- bitmap_set_bit (not_reg_needs, DECL_UID (decl));
- }
+ decl = get_base_address (lhs);
+ if (DECL_P (decl))
+ bitmap_set_bit (not_reg_needs, DECL_UID (decl));
}
}
@@ -2027,29 +2039,17 @@ execute_update_addresses_taken (void)
{
tree link = gimple_asm_output_op (stmt, i);
tree lhs = TREE_VALUE (link);
-
- /* A plain decl does not need it set. */
- if (!DECL_P (lhs))
+ if (TREE_CODE (lhs) != SSA_NAME)
{
- tree orig_lhs = lhs;
-
- while (handled_component_p (lhs))
- lhs = TREE_OPERAND (lhs, 0);
-
- if (DECL_P (lhs))
- bitmap_set_bit (not_reg_needs, DECL_UID (lhs));
- else if (TREE_CODE (lhs) == MEM_REF
- && TREE_CODE (TREE_OPERAND (lhs, 0)) == ADDR_EXPR)
- {
- decl = TREE_OPERAND (TREE_OPERAND (lhs, 0), 0);
- if (DECL_P (decl)
- && (!integer_zerop (TREE_OPERAND (lhs, 1))
- || (TYPE_MAIN_VARIANT (TREE_TYPE (decl))
- != TYPE_MAIN_VARIANT (TREE_TYPE (orig_lhs)))
- || (TREE_THIS_VOLATILE (lhs)
- != TREE_THIS_VOLATILE (decl))))
- bitmap_set_bit (not_reg_needs, DECL_UID (decl));
- }
+ decl = get_base_address (lhs);
+ if (DECL_P (decl)
+ && (non_rewritable_lvalue_p (lhs)
+ /* We cannot move required conversions from
+ the lhs to the rhs in asm statements, so
+ require we do not need any. */
+ || !useless_type_conversion_p
+ (TREE_TYPE (lhs), TREE_TYPE (decl))))
+ bitmap_set_bit (not_reg_needs, DECL_UID (decl));
}
}
for (i = 0; i < gimple_asm_ninputs (stmt); ++i)
diff --git a/gcc/tree-ssanames.c b/gcc/tree-ssanames.c
index cf67f6ce7c8..c76dba5ea44 100644
--- a/gcc/tree-ssanames.c
+++ b/gcc/tree-ssanames.c
@@ -340,7 +340,7 @@ release_dead_ssa_names (void)
/* Current defs point to various dead SSA names that in turn point to
eventually dead variables so a bunch of memory is held live. */
- FOR_EACH_REFERENCED_VAR (t, rvi)
+ FOR_EACH_REFERENCED_VAR (cfun, t, rvi)
set_current_def (t, NULL);
/* Now release the freelist. */
for (t = FREE_SSANAMES (cfun); t; t = next)
diff --git a/gcc/tree-tailcall.c b/gcc/tree-tailcall.c
index a9bf62835c7..85aa82bc855 100644
--- a/gcc/tree-tailcall.c
+++ b/gcc/tree-tailcall.c
@@ -481,7 +481,7 @@ find_tail_calls (basic_block bb, struct tailcall **ret)
/* Make sure the tail invocation of this function does not refer
to local variables. */
- FOR_EACH_REFERENCED_VAR (var, rvi)
+ FOR_EACH_REFERENCED_VAR (cfun, var, rvi)
{
if (TREE_CODE (var) != PARM_DECL
&& auto_var_in_fn_p (var, cfun->decl)
@@ -889,7 +889,7 @@ add_virtual_phis (void)
this, we cannot do much better than to rebuild the ssa form for
possibly affected virtual ssa names from scratch. */
- FOR_EACH_REFERENCED_VAR (var, rvi)
+ FOR_EACH_REFERENCED_VAR (cfun, var, rvi)
{
if (!is_gimple_reg (var) && gimple_default_def (cfun, var) != NULL_TREE)
mark_sym_for_renaming (var);
diff --git a/gcc/tree-vect-data-refs.c b/gcc/tree-vect-data-refs.c
index 1ec59efaac6..2c9936cdbeb 100644
--- a/gcc/tree-vect-data-refs.c
+++ b/gcc/tree-vect-data-refs.c
@@ -2578,7 +2578,7 @@ vect_analyze_data_refs (loop_vec_info loop_vinfo,
offset = unshare_expr (DR_OFFSET (dr));
init = unshare_expr (DR_INIT (dr));
- if (stmt_could_throw_p (stmt))
+ if (stmt_can_throw_internal (stmt))
{
if (vect_print_dump_info (REPORT_UNVECTORIZED_LOCATIONS))
{
diff --git a/gcc/tree-vect-generic.c b/gcc/tree-vect-generic.c
index 54a6075a512..fce1fc7e1ae 100644
--- a/gcc/tree-vect-generic.c
+++ b/gcc/tree-vect-generic.c
@@ -606,8 +606,7 @@ expand_vector_operations_1 (gimple_stmt_iterator *gsi)
way to do it is change expand_vector_operation and its callees to
return a tree_code, RHS1 and RHS2 instead of a tree. */
gimple_assign_set_rhs_from_tree (gsi, new_rhs);
-
- gimple_set_modified (gsi_stmt (*gsi), true);
+ update_stmt (gsi_stmt (*gsi));
}
/* Use this to lower vector operations introduced by the vectorizer,
@@ -624,16 +623,24 @@ expand_vector_operations (void)
{
gimple_stmt_iterator gsi;
basic_block bb;
+ bool cfg_changed = false;
FOR_EACH_BB (bb)
{
for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi))
{
expand_vector_operations_1 (&gsi);
- update_stmt_if_modified (gsi_stmt (gsi));
+ /* ??? If we do not cleanup EH then we will ICE in
+ verification. But in reality we have created wrong-code
+ as we did not properly transition EH info and edges to
+ the piecewise computations. */
+ if (maybe_clean_eh_stmt (gsi_stmt (gsi))
+ && gimple_purge_dead_eh_edges (bb))
+ cfg_changed = true;
}
}
- return 0;
+
+ return cfg_changed ? TODO_cleanup_cfg : 0;
}
struct gimple_opt_pass pass_lower_vector =
diff --git a/gcc/tree-vect-stmts.c b/gcc/tree-vect-stmts.c
index e5bfcbe81ac..b3479252886 100644
--- a/gcc/tree-vect-stmts.c
+++ b/gcc/tree-vect-stmts.c
@@ -1345,7 +1345,7 @@ vectorizable_call (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt)
if (TREE_CODE (gimple_call_lhs (stmt)) != SSA_NAME)
return false;
- if (stmt_could_throw_p (stmt))
+ if (stmt_can_throw_internal (stmt))
return false;
vectype_out = STMT_VINFO_VECTYPE (stmt_info);
diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c
index b07f121f77d..65d249f9ae2 100644
--- a/gcc/tree-vrp.c
+++ b/gcc/tree-vrp.c
@@ -714,6 +714,8 @@ static inline bool
vrp_bitmap_equal_p (const_bitmap b1, const_bitmap b2)
{
return (b1 == b2
+ || ((!b1 || bitmap_empty_p (b1))
+ && (!b2 || bitmap_empty_p (b2)))
|| (b1 && b2
&& bitmap_equal_p (b1, b2)));
}
@@ -7764,9 +7766,10 @@ struct gimple_opt_pass pass_vrp =
0, /* properties_destroyed */
0, /* todo_flags_start */
TODO_cleanup_cfg
- | TODO_ggc_collect
+ | TODO_update_ssa
| TODO_verify_ssa
+ | TODO_verify_flow
| TODO_dump_func
- | TODO_update_ssa /* todo_flags_finish */
+ | TODO_ggc_collect /* todo_flags_finish */
}
};
diff --git a/gcc/tree.c b/gcc/tree.c
index be2cf98948e..c947072b215 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -1,7 +1,7 @@
/* Language-independent node constructors for parse phase of GNU compiler.
Copyright (C) 1987, 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
- 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
- Free Software Foundation, Inc.
+ 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
+ 2011 Free Software Foundation, Inc.
This file is part of GCC.
@@ -4577,6 +4577,25 @@ free_lang_data_in_decl (tree decl)
}
else if (TREE_CODE (decl) == TYPE_DECL)
DECL_INITIAL (decl) = NULL_TREE;
+ else if (TREE_CODE (decl) == TRANSLATION_UNIT_DECL
+ && DECL_INITIAL (decl)
+ && TREE_CODE (DECL_INITIAL (decl)) == BLOCK)
+ {
+ /* Strip builtins from the translation-unit BLOCK. We still have
+ targets without builtin_decl support and also builtins are
+ shared nodes and thus we can't use TREE_CHAIN in multiple
+ lists. */
+ tree *nextp = &BLOCK_VARS (DECL_INITIAL (decl));
+ while (*nextp)
+ {
+ tree var = *nextp;
+ if (TREE_CODE (var) == FUNCTION_DECL
+ && DECL_BUILT_IN (var))
+ *nextp = TREE_CHAIN (var);
+ else
+ nextp = &TREE_CHAIN (var);
+ }
+ }
}
@@ -5509,7 +5528,8 @@ handle_dll_attribute (tree * pnode, tree name, tree args, int flags,
DECL_DLLIMPORT_P (node) = 1;
}
else if (TREE_CODE (node) == FUNCTION_DECL
- && DECL_DECLARED_INLINE_P (node))
+ && DECL_DECLARED_INLINE_P (node)
+ && flag_keep_inline_dllexport)
/* An exported function, even if inline, must be emitted. */
DECL_EXTERNAL (node) = 0;
diff --git a/gcc/tree.def b/gcc/tree.def
index 791d699a0c5..eb94ad24593 100644
--- a/gcc/tree.def
+++ b/gcc/tree.def
@@ -1090,7 +1090,7 @@ DEFTREECODE (WIDEN_MULT_EXPR, "widen_mult_expr", tcc_binary, 2)
DEFTREECODE (WIDEN_MULT_PLUS_EXPR, "widen_mult_plus_expr", tcc_expression, 3)
/* This is like the above, except in the final expression the multiply result
is subtracted from t3. */
-DEFTREECODE (WIDEN_MULT_MINUS_EXPR, "widen_mult_plus_expr", tcc_expression, 3)
+DEFTREECODE (WIDEN_MULT_MINUS_EXPR, "widen_mult_minus_expr", tcc_expression, 3)
/* Fused multiply-add.
All operands and the result are of the same type. No intermediate
diff --git a/gcc/value-prof.c b/gcc/value-prof.c
index 0a36ed210c8..8491c776f7c 100644
--- a/gcc/value-prof.c
+++ b/gcc/value-prof.c
@@ -474,8 +474,12 @@ check_counter (gimple stmt, const char * name,
else
{
error_at (locus, "corrupted value profile: %s "
- "profiler overall count (%d) does not match BB count (%d)",
- name, (int)*all, (int)bb_count);
+ "profile counter (%d out of %d) inconsistent with "
+ "basic-block count (%d)",
+ name,
+ (int) *count,
+ (int) *all,
+ (int) bb_count);
return true;
}
}
diff --git a/gcc/var-tracking.c b/gcc/var-tracking.c
index e0477d40bcb..7543a5a0b86 100644
--- a/gcc/var-tracking.c
+++ b/gcc/var-tracking.c
@@ -737,7 +737,7 @@ use_narrower_mode_test (rtx *loc, void *data)
switch (GET_CODE (*loc))
{
case REG:
- if (cselib_lookup (*loc, GET_MODE (SUBREG_REG (subreg)), 0))
+ if (cselib_lookup (*loc, GET_MODE (SUBREG_REG (subreg)), 0, VOIDmode))
return 1;
return -1;
case PLUS:
@@ -3954,8 +3954,10 @@ variable_post_merge_new_vals (void **slot, void *info)
subsequent rounds. */
cselib_val *v;
gcc_assert (!cselib_lookup (node->loc,
- GET_MODE (node->loc), 0));
- v = cselib_lookup (node->loc, GET_MODE (node->loc), 1);
+ GET_MODE (node->loc), 0,
+ VOIDmode));
+ v = cselib_lookup (node->loc, GET_MODE (node->loc), 1,
+ VOIDmode);
cselib_preserve_value (v);
cselib_invalidate_rtx (node->loc);
cval = v->val_rtx;
@@ -4793,7 +4795,7 @@ find_use_val (rtx x, enum machine_mode mode, struct count_use_info *cui)
return cui->sets[i].src_elt;
}
else
- return cselib_lookup (x, mode, 0);
+ return cselib_lookup (x, mode, 0, VOIDmode);
}
return NULL;
@@ -4822,14 +4824,15 @@ replace_expr_with_values (rtx loc)
else if (MEM_P (loc))
{
cselib_val *addr = cselib_lookup (XEXP (loc, 0),
- get_address_mode (loc), 0);
+ get_address_mode (loc), 0,
+ GET_MODE (loc));
if (addr)
return replace_equiv_address_nv (loc, addr->val_rtx);
else
return NULL;
}
else
- return cselib_subst_to_values (loc);
+ return cselib_subst_to_values (loc, VOIDmode);
}
/* Determine what kind of micro operation to choose for a USE. Return
@@ -4849,7 +4852,8 @@ use_type (rtx loc, struct count_use_info *cui, enum machine_mode *modep)
rtx ploc = PAT_VAR_LOCATION_LOC (loc);
if (! VAR_LOC_UNKNOWN_P (ploc))
{
- cselib_val *val = cselib_lookup (ploc, GET_MODE (loc), 1);
+ cselib_val *val = cselib_lookup (ploc, GET_MODE (loc), 1,
+ VOIDmode);
/* ??? flag_float_store and volatile mems are never
given values, but we could in theory use them for
@@ -4871,7 +4875,8 @@ use_type (rtx loc, struct count_use_info *cui, enum machine_mode *modep)
if (REG_P (loc)
|| (find_use_val (loc, GET_MODE (loc), cui)
&& cselib_lookup (XEXP (loc, 0),
- get_address_mode (loc), 0)))
+ get_address_mode (loc), 0,
+ GET_MODE (loc))))
return MO_VAL_SET;
}
else
@@ -5033,13 +5038,15 @@ add_uses (rtx *ploc, void *data)
rtx mloc = vloc;
enum machine_mode address_mode = get_address_mode (mloc);
cselib_val *val
- = cselib_lookup (XEXP (mloc, 0), address_mode, 0);
+ = cselib_lookup (XEXP (mloc, 0), address_mode, 0,
+ GET_MODE (mloc));
if (val && !cselib_preserved_value_p (val))
{
micro_operation moa;
preserve_value (val);
- mloc = cselib_subst_to_values (XEXP (mloc, 0));
+ mloc = cselib_subst_to_values (XEXP (mloc, 0),
+ GET_MODE (mloc));
moa.type = MO_VAL_USE;
moa.insn = cui->insn;
moa.u.loc = gen_rtx_CONCAT (address_mode,
@@ -5109,13 +5116,15 @@ add_uses (rtx *ploc, void *data)
rtx mloc = oloc;
enum machine_mode address_mode = get_address_mode (mloc);
cselib_val *val
- = cselib_lookup (XEXP (mloc, 0), address_mode, 0);
+ = cselib_lookup (XEXP (mloc, 0), address_mode, 0,
+ GET_MODE (mloc));
if (val && !cselib_preserved_value_p (val))
{
micro_operation moa;
preserve_value (val);
- mloc = cselib_subst_to_values (XEXP (mloc, 0));
+ mloc = cselib_subst_to_values (XEXP (mloc, 0),
+ GET_MODE (mloc));
moa.type = MO_VAL_USE;
moa.insn = cui->insn;
moa.u.loc = gen_rtx_CONCAT (address_mode,
@@ -5225,7 +5234,7 @@ reverse_op (rtx val, const_rtx expr)
if (!SCALAR_INT_MODE_P (GET_MODE (src)) || XEXP (src, 0) == cfa_base_rtx)
return NULL_RTX;
- v = cselib_lookup (XEXP (src, 0), GET_MODE (XEXP (src, 0)), 0);
+ v = cselib_lookup (XEXP (src, 0), GET_MODE (XEXP (src, 0)), 0, VOIDmode);
if (!v || !cselib_preserved_value_p (v))
return NULL_RTX;
@@ -5346,13 +5355,15 @@ add_stores (rtx loc, const_rtx expr, void *cuip)
rtx mloc = loc;
enum machine_mode address_mode = get_address_mode (mloc);
cselib_val *val = cselib_lookup (XEXP (mloc, 0),
- address_mode, 0);
+ address_mode, 0,
+ GET_MODE (mloc));
if (val && !cselib_preserved_value_p (val))
{
preserve_value (val);
mo.type = MO_VAL_USE;
- mloc = cselib_subst_to_values (XEXP (mloc, 0));
+ mloc = cselib_subst_to_values (XEXP (mloc, 0),
+ GET_MODE (mloc));
mo.u.loc = gen_rtx_CONCAT (address_mode, val->val_rtx, mloc);
mo.insn = cui->insn;
if (dump_file && (dump_flags & TDF_DETAILS))
@@ -5411,7 +5422,7 @@ add_stores (rtx loc, const_rtx expr, void *cuip)
if (GET_CODE (PATTERN (cui->insn)) == COND_EXEC)
{
- cselib_val *oval = cselib_lookup (oloc, GET_MODE (oloc), 0);
+ cselib_val *oval = cselib_lookup (oloc, GET_MODE (oloc), 0, VOIDmode);
gcc_assert (oval != v);
gcc_assert (REG_P (oloc) || MEM_P (oloc));
@@ -8077,7 +8088,8 @@ vt_add_function_parameter (tree parm)
if (offset)
return;
- val = cselib_lookup (var_lowpart (mode, incoming), mode, true);
+ val = cselib_lookup (var_lowpart (mode, incoming), mode, true,
+ VOIDmode);
/* ??? Float-typed values in memory are not handled by
cselib. */
@@ -8197,7 +8209,7 @@ vt_init_cfa_base (void)
frame_pointer_needed
? hard_frame_pointer_rtx : stack_pointer_rtx);
val = cselib_lookup_from_insn (cfa_base_rtx, GET_MODE (cfa_base_rtx), 1,
- get_insns ());
+ VOIDmode, get_insns ());
preserve_value (val);
cselib_preserve_cfa_base_value (val, REGNO (cfa_base_rtx));
var_reg_decl_set (&VTI (ENTRY_BLOCK_PTR)->out, cfa_base_rtx,
diff --git a/gcc/varasm.c b/gcc/varasm.c
index 4361a21c2d4..16489c5d662 100644
--- a/gcc/varasm.c
+++ b/gcc/varasm.c
@@ -1,7 +1,7 @@
/* Output variables, constants and external declarations, for GNU compiler.
Copyright (C) 1987, 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997,
1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
- 2010 Free Software Foundation, Inc.
+ 2010, 2011 Free Software Foundation, Inc.
This file is part of GCC.
@@ -119,6 +119,7 @@ static void output_addressed_constants (tree);
static unsigned HOST_WIDE_INT array_size_for_constructor (tree);
static unsigned min_align (unsigned, unsigned);
static void globalize_decl (tree);
+static bool decl_readonly_section_1 (enum section_category);
#ifdef BSS_SECTION_ASM_OP
#ifdef ASM_OUTPUT_BSS
static void asm_output_bss (FILE *, tree, const char *,
@@ -294,11 +295,31 @@ get_section (const char *name, unsigned int flags, tree decl)
if ((sect->common.flags & ~SECTION_DECLARED) != flags
&& ((sect->common.flags | flags) & SECTION_OVERRIDE) == 0)
{
+ /* It is fine if one of the section flags is
+ SECTION_WRITE | SECTION_RELRO and the other has none of these
+ flags (i.e. read-only) in named sections and either the
+ section hasn't been declared yet or has been declared as writable.
+ In that case just make sure the resulting flags are
+ SECTION_WRITE | SECTION_RELRO, ie. writable only because of
+ relocations. */
+ if (((sect->common.flags ^ flags) & (SECTION_WRITE | SECTION_RELRO))
+ == (SECTION_WRITE | SECTION_RELRO)
+ && (sect->common.flags
+ & ~(SECTION_DECLARED | SECTION_WRITE | SECTION_RELRO))
+ == (flags & ~(SECTION_WRITE | SECTION_RELRO))
+ && ((sect->common.flags & SECTION_DECLARED) == 0
+ || (sect->common.flags & SECTION_WRITE)))
+ {
+ sect->common.flags |= (SECTION_WRITE | SECTION_RELRO);
+ return sect;
+ }
/* Sanity check user variables for flag changes. */
if (decl == 0)
decl = sect->named.decl;
gcc_assert (decl);
error ("%+D causes a section type conflict", decl);
+ /* Make sure we don't error about one section multiple times. */
+ sect->common.flags |= SECTION_OVERRIDE;
}
}
return sect;
@@ -985,7 +1006,7 @@ align_variable (tree decl, bool dont_output_data)
should be placed. PREFER_NOSWITCH_P is true if a noswitch
section should be used wherever possible. */
-static section *
+section *
get_variable_section (tree decl, bool prefer_noswitch_p)
{
addr_space_t as = ADDR_SPACE_GENERIC;
@@ -3527,7 +3548,7 @@ force_const_mem (enum machine_mode mode, rtx x)
pool->offset &= ~ ((align / BITS_PER_UNIT) - 1);
desc->next = NULL;
- desc->constant = tmp.constant;
+ desc->constant = copy_rtx (tmp.constant);
desc->offset = pool->offset;
desc->hash = hash;
desc->mode = mode;
@@ -5148,20 +5169,16 @@ merge_weak (tree newdecl, tree olddecl)
/* NEWDECL is weak, but OLDDECL is not. */
/* If we already output the OLDDECL, we're in trouble; we can't
- go back and make it weak. This error cannot be caught in
- declare_weak because the NEWDECL and OLDDECL was not yet
- been merged; therefore, TREE_ASM_WRITTEN was not set. */
- if (TREE_ASM_WRITTEN (olddecl))
- error ("weak declaration of %q+D must precede definition",
- newdecl);
+ go back and make it weak. This should never happen in
+ unit-at-a-time compilation. */
+ gcc_assert (!TREE_ASM_WRITTEN (olddecl));
/* If we've already generated rtl referencing OLDDECL, we may
have done so in a way that will not function properly with
- a weak symbol. */
- else if (TREE_USED (olddecl)
- && TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (olddecl)))
- warning (0, "weak declaration of %q+D after first use results "
- "in unspecified behavior", newdecl);
+ a weak symbol. Again in unit-at-a-time this should be
+ impossible. */
+ gcc_assert (!TREE_USED (olddecl)
+ || !TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (olddecl)));
if (TARGET_SUPPORTS_WEAK)
{
@@ -5193,10 +5210,9 @@ merge_weak (tree newdecl, tree olddecl)
void
declare_weak (tree decl)
{
+ gcc_assert (TREE_CODE (decl) != FUNCTION_DECL || !TREE_ASM_WRITTEN (decl));
if (! TREE_PUBLIC (decl))
error ("weak declaration of %q+D must be public", decl);
- else if (TREE_CODE (decl) == FUNCTION_DECL && TREE_ASM_WRITTEN (decl))
- error ("weak declaration of %q+D must precede definition", decl);
else if (!TARGET_SUPPORTS_WEAK)
warning (0, "weak declaration of %q+D not supported", decl);
@@ -6040,10 +6056,25 @@ default_section_type_flags (tree decl, const char *name, int reloc)
if (decl && TREE_CODE (decl) == FUNCTION_DECL)
flags = SECTION_CODE;
- else if (decl && decl_readonly_section (decl, reloc))
- flags = 0;
+ else if (decl)
+ {
+ enum section_category category
+ = categorize_decl_for_section (decl, reloc);
+ if (decl_readonly_section_1 (category))
+ flags = 0;
+ else if (category == SECCAT_DATA_REL_RO
+ || category == SECCAT_DATA_REL_RO_LOCAL)
+ flags = SECTION_WRITE | SECTION_RELRO;
+ else
+ flags = SECTION_WRITE;
+ }
else
- flags = SECTION_WRITE;
+ {
+ flags = SECTION_WRITE;
+ if (strcmp (name, ".data.rel.ro") == 0
+ || strcmp (name, ".data.rel.ro.local") == 0)
+ flags |= SECTION_RELRO;
+ }
if (decl && DECL_ONE_ONLY (decl))
flags |= SECTION_LINKONCE;
@@ -6264,17 +6295,13 @@ categorize_decl_for_section (const_tree decl, int reloc)
/* Here the reloc_rw_mask is not testing whether the section should
be read-only or not, but whether the dynamic link will have to
do something. If so, we wish to segregate the data in order to
- minimize cache misses inside the dynamic linker. If the data
- has a section attribute, ignore reloc_rw_mask() so that all data
- in a given named section is catagorized in the same way. */
- if (reloc & targetm.asm_out.reloc_rw_mask ()
- && !lookup_attribute ("section", DECL_ATTRIBUTES (decl)))
+ minimize cache misses inside the dynamic linker. */
+ if (reloc & targetm.asm_out.reloc_rw_mask ())
ret = reloc == 1 ? SECCAT_DATA_REL_LOCAL : SECCAT_DATA_REL;
else
ret = SECCAT_DATA;
}
- else if (reloc & targetm.asm_out.reloc_rw_mask ()
- && !lookup_attribute ("section", DECL_ATTRIBUTES (decl)))
+ else if (reloc & targetm.asm_out.reloc_rw_mask ())
ret = reloc == 1 ? SECCAT_DATA_REL_RO_LOCAL : SECCAT_DATA_REL_RO;
else if (reloc || flag_merge_constants < 2)
/* C and C++ don't allow different variables to share the same
@@ -6325,10 +6352,10 @@ categorize_decl_for_section (const_tree decl, int reloc)
return ret;
}
-bool
-decl_readonly_section (const_tree decl, int reloc)
+static bool
+decl_readonly_section_1 (enum section_category category)
{
- switch (categorize_decl_for_section (decl, reloc))
+ switch (category)
{
case SECCAT_RODATA:
case SECCAT_RODATA_MERGE_STR:
@@ -6336,13 +6363,17 @@ decl_readonly_section (const_tree decl, int reloc)
case SECCAT_RODATA_MERGE_CONST:
case SECCAT_SRODATA:
return true;
- break;
default:
return false;
- break;
}
}
+bool
+decl_readonly_section (const_tree decl, int reloc)
+{
+ return decl_readonly_section_1 (categorize_decl_for_section (decl, reloc));
+}
+
/* Select a section based on the above categorization. */
section *
diff --git a/gcc/varpool.c b/gcc/varpool.c
index 65a8a98d46b..f660dafd281 100644
--- a/gcc/varpool.c
+++ b/gcc/varpool.c
@@ -1,5 +1,5 @@
/* Callgraph handling code.
- Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2010
+ Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2010, 2011
Free Software Foundation, Inc.
Contributed by Jan Hubicka
@@ -370,7 +370,7 @@ const_value_known_p (tree decl)
gcc_assert (TREE_CODE (decl) == VAR_DECL);
- if (!TREE_READONLY (decl))
+ if (!TREE_READONLY (decl) || TREE_THIS_VOLATILE (decl))
return false;
/* Gimplifier takes away constructors of local vars */
@@ -565,11 +565,29 @@ varpool_remove_unreferenced_decls (void)
varpool_analyze_pending_decls ();
}
+/* For variables in named sections make sure get_variable_section
+ is called before we switch to those sections. Then section
+ conflicts between read-only and read-only requiring relocations
+ sections can be resolved. */
+void
+varpool_finalize_named_section_flags (struct varpool_node *node)
+{
+ if (!TREE_ASM_WRITTEN (node->decl)
+ && !node->alias
+ && !node->in_other_partition
+ && !DECL_EXTERNAL (node->decl)
+ && TREE_CODE (node->decl) == VAR_DECL
+ && !DECL_HAS_VALUE_EXPR_P (node->decl)
+ && DECL_SECTION_NAME (node->decl))
+ get_variable_section (node->decl, false);
+}
+
/* Output all variables enqueued to be assembled. */
bool
varpool_assemble_pending_decls (void)
{
bool changed = false;
+ struct varpool_node *node;
if (seen_error ())
return false;
@@ -580,6 +598,9 @@ varpool_assemble_pending_decls (void)
elsewhere. */
varpool_analyze_pending_decls ();
+ for (node = varpool_nodes_queue; node; node = node->next_needed)
+ varpool_finalize_named_section_flags (node);
+
while (varpool_nodes_queue)
{
struct varpool_node *node = varpool_nodes_queue;
diff --git a/gcc/web.c b/gcc/web.c
index 9b849249b0d..e57bb37570f 100644
--- a/gcc/web.c
+++ b/gcc/web.c
@@ -377,7 +377,17 @@ web_main (void)
FOR_BB_INSNS (bb, insn)
{
unsigned int uid = INSN_UID (insn);
- if (NONDEBUG_INSN_P (insn))
+
+ if (NONDEBUG_INSN_P (insn)
+ /* Ignore naked clobber. For example, reg 134 in the second insn
+ of the following sequence will not be replaced.
+
+ (insn (clobber (reg:SI 134)))
+
+ (insn (set (reg:SI 0 r0) (reg:SI 134)))
+
+ Thus the later passes can optimize them away. */
+ && GET_CODE (PATTERN (insn)) != CLOBBER)
{
df_ref *use_rec;
df_ref *def_rec;