summaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog1375
-rw-r--r--gcc/ChangeLog.melt5
-rw-r--r--gcc/DATESTAMP2
-rw-r--r--gcc/Makefile.in2
-rw-r--r--gcc/ada/ChangeLog76
-rw-r--r--gcc/ada/Make-lang.in18
-rw-r--r--gcc/ada/Makefile.in4
-rw-r--r--gcc/ada/decl.c105
-rw-r--r--gcc/ada/i-forbla.adb5
-rw-r--r--gcc/ada/s-osinte-rtems.adb9
-rw-r--r--gcc/ada/s-osinte-rtems.ads43
-rw-r--r--gcc/ada/sem_ch3.adb23
-rw-r--r--gcc/ada/trans.c76
-rw-r--r--gcc/ada/utils.c28
-rw-r--r--gcc/ada/utils2.c24
-rw-r--r--gcc/alias.c14
-rw-r--r--gcc/bt-load.c2
-rw-r--r--gcc/builtins.c97
-rw-r--r--gcc/builtins.def12
-rw-r--r--gcc/c-common.c96
-rw-r--r--gcc/c-common.h1
-rw-r--r--gcc/c-decl.c2
-rw-r--r--gcc/c-format.c20
-rw-r--r--gcc/c-tree.h2
-rw-r--r--gcc/c-typeck.c15
-rw-r--r--gcc/calls.c8
-rw-r--r--gcc/cfgcleanup.c2
-rw-r--r--gcc/cfgexpand.c8
-rw-r--r--gcc/common.opt2
-rw-r--r--gcc/config.gcc25
-rw-r--r--gcc/config/alpha/alpha.c24
-rw-r--r--gcc/config/alpha/predicates.md2
-rw-r--r--gcc/config/arc/arc.c2
-rw-r--r--gcc/config/arc/arc.h2
-rw-r--r--gcc/config/arm/arm.c68
-rw-r--r--gcc/config/arm/arm.h4
-rw-r--r--gcc/config/arm/arm.md2
-rw-r--r--gcc/config/arm/linux-elf.h2
-rw-r--r--gcc/config/avr/avr.c2
-rw-r--r--gcc/config/avr/avr.md18
-rw-r--r--gcc/config/bfin/bfin.c16
-rw-r--r--gcc/config/cris/cris.c30
-rw-r--r--gcc/config/cris/cris.md4
-rw-r--r--gcc/config/crx/crx.h2
-rw-r--r--gcc/config/darwin.c2
-rw-r--r--gcc/config/fr30/fr30.c4
-rw-r--r--gcc/config/frv/frv.c28
-rw-r--r--gcc/config/i386/cygming-crtend.c8
-rw-r--r--gcc/config/i386/i386.c3033
-rw-r--r--gcc/config/i386/i386.md133
-rw-r--r--gcc/config/i386/linux.h2
-rw-r--r--gcc/config/i386/mingw32.h1
-rw-r--r--gcc/config/i386/mm3dnow.h3
-rw-r--r--gcc/config/i386/mmintrin.h1
-rw-r--r--gcc/config/i386/msformat-c.c4
-rw-r--r--gcc/config/i386/sse.md203
-rw-r--r--gcc/config/i386/tmmintrin.h8
-rw-r--r--gcc/config/i386/xmmintrin.h32
-rw-r--r--gcc/config/ia64/ia64.c6
-rw-r--r--gcc/config/iq2000/iq2000.c12
-rw-r--r--gcc/config/m32c/m32c.c4
-rw-r--r--gcc/config/m32r/m32r.c20
-rw-r--r--gcc/config/m32r/m32r.h2
-rw-r--r--gcc/config/m32r/m32r.md6
-rw-r--r--gcc/config/m68k/cf.md1567
-rw-r--r--gcc/config/m68k/m68k-protos.h1
-rw-r--r--gcc/config/m68k/m68k.c226
-rw-r--r--gcc/config/m68k/m68k.h1
-rw-r--r--gcc/config/m68k/m68k.md7
-rw-r--r--gcc/config/mcore/mcore.c2
-rw-r--r--gcc/config/mips/mips-protos.h1
-rw-r--r--gcc/config/mips/mips.c112
-rw-r--r--gcc/config/mips/mips.h24
-rw-r--r--gcc/config/mips/mips.md41
-rw-r--r--gcc/config/mmix/mmix.c6
-rw-r--r--gcc/config/mmix/mmix.h2
-rw-r--r--gcc/config/mn10300/mn10300.c2
-rw-r--r--gcc/config/mt/mt.h2
-rw-r--r--gcc/config/pa/pa.c20
-rw-r--r--gcc/config/pa/pa.h6
-rw-r--r--gcc/config/pa/pa.md4
-rw-r--r--gcc/config/rs6000/crtresfpr.asm90
-rw-r--r--gcc/config/rs6000/crtresgpr.asm90
-rw-r--r--gcc/config/rs6000/crtresxfpr.asm95
-rw-r--r--gcc/config/rs6000/crtresxgpr.asm93
-rw-r--r--gcc/config/rs6000/crtsavfpr.asm90
-rw-r--r--gcc/config/rs6000/crtsavgpr.asm90
-rw-r--r--gcc/config/rs6000/e500crtres32gpr.asm84
-rw-r--r--gcc/config/rs6000/e500crtres64gpr.asm84
-rw-r--r--gcc/config/rs6000/e500crtres64gprctr.asm83
-rw-r--r--gcc/config/rs6000/e500crtrest32gpr.asm86
-rw-r--r--gcc/config/rs6000/e500crtrest64gpr.asm85
-rw-r--r--gcc/config/rs6000/e500crtresx32gpr.asm87
-rw-r--r--gcc/config/rs6000/e500crtresx64gpr.asm86
-rw-r--r--gcc/config/rs6000/e500crtsav32gpr.asm84
-rw-r--r--gcc/config/rs6000/e500crtsav64gpr.asm83
-rw-r--r--gcc/config/rs6000/e500crtsav64gprctr.asm102
-rw-r--r--gcc/config/rs6000/e500crtsavg32gpr.asm84
-rw-r--r--gcc/config/rs6000/e500crtsavg64gpr.asm84
-rw-r--r--gcc/config/rs6000/e500crtsavg64gprctr.asm101
-rw-r--r--gcc/config/rs6000/netbsd.h3
-rw-r--r--gcc/config/rs6000/rs6000.c171
-rw-r--r--gcc/config/rs6000/rs6000.h4
-rw-r--r--gcc/config/rs6000/rs6000.md2
-rw-r--r--gcc/config/rs6000/rs6000.opt4
-rw-r--r--gcc/config/rs6000/sysv4.h20
-rw-r--r--gcc/config/rs6000/t-netbsd46
-rw-r--r--gcc/config/rs6000/t-ppccomm139
-rw-r--r--gcc/config/s390/s390.c28
-rw-r--r--gcc/config/score/score.h2
-rw-r--r--gcc/config/score/score3.c10
-rw-r--r--gcc/config/score/score7.c10
-rw-r--r--gcc/config/sh/sh.c18
-rw-r--r--gcc/config/sh/sh.h2
-rw-r--r--gcc/config/sh/sh.md2
-rw-r--r--gcc/config/sparc/linux.h77
-rw-r--r--gcc/config/sparc/linux64.h105
-rw-r--r--gcc/config/sparc/sparc.c20
-rw-r--r--gcc/config/sparc/sparc.h6
-rw-r--r--gcc/config/sparc/sparc.md10
-rw-r--r--gcc/config/spu/spu.c16
-rw-r--r--gcc/config/stormy16/stormy16.c2
-rw-r--r--gcc/config/v850/v850.c2
-rw-r--r--gcc/config/vxworks.c77
-rw-r--r--gcc/config/xtensa/xtensa.h1
-rw-r--r--gcc/coretypes.h4
-rw-r--r--gcc/coverage.c4
-rw-r--r--gcc/cp/ChangeLog85
-rw-r--r--gcc/cp/class.c3
-rw-r--r--gcc/cp/cp-objcp-common.h2
-rw-r--r--gcc/cp/cp-tree.h1
-rw-r--r--gcc/cp/decl.c3
-rw-r--r--gcc/cp/decl2.c63
-rw-r--r--gcc/cp/init.c5
-rw-r--r--gcc/cp/method.c2
-rw-r--r--gcc/cp/parser.c57
-rw-r--r--gcc/cp/pt.c13
-rw-r--r--gcc/cp/rtti.c5
-rw-r--r--gcc/cp/semantics.c7
-rw-r--r--gcc/cp/typeck.c23
-rw-r--r--gcc/cp/typeck2.c1
-rw-r--r--gcc/df-scan.c6
-rw-r--r--gcc/doc/extend.texi28
-rw-r--r--gcc/doc/gty.texi5
-rw-r--r--gcc/doc/install.texi3
-rw-r--r--gcc/doc/invoke.texi19
-rw-r--r--gcc/doc/tm.texi81
-rw-r--r--gcc/dojump.c5
-rw-r--r--gcc/dse.c6
-rw-r--r--gcc/dwarf2out.c49
-rw-r--r--gcc/emit-rtl.c4
-rw-r--r--gcc/except.c22
-rw-r--r--gcc/explow.c6
-rw-r--r--gcc/expmed.c5
-rw-r--r--gcc/expr.c21
-rw-r--r--gcc/final.c10
-rw-r--r--gcc/fold-const.c64
-rw-r--r--gcc/fortran/ChangeLog100
-rw-r--r--gcc/fortran/arith.c35
-rw-r--r--gcc/fortran/arith.h2
-rw-r--r--gcc/fortran/check.c16
-rw-r--r--gcc/fortran/decl.c16
-rw-r--r--gcc/fortran/f95-lang.c4
-rw-r--r--gcc/fortran/gfortran.h16
-rw-r--r--gcc/fortran/gfortranspec.c21
-rw-r--r--gcc/fortran/interface.c6
-rw-r--r--gcc/fortran/intrinsic.c7
-rw-r--r--gcc/fortran/intrinsic.h2
-rw-r--r--gcc/fortran/intrinsic.texi43
-rw-r--r--gcc/fortran/invoke.texi7
-rw-r--r--gcc/fortran/io.c71
-rw-r--r--gcc/fortran/misc.c1
-rw-r--r--gcc/fortran/module.c15
-rw-r--r--gcc/fortran/options.c10
-rw-r--r--gcc/fortran/primary.c3
-rw-r--r--gcc/fortran/resolve.c31
-rw-r--r--gcc/fortran/simplify.c25
-rw-r--r--gcc/fortran/trans-array.c6
-rw-r--r--gcc/fortran/trans-common.c10
-rw-r--r--gcc/fortran/trans-decl.c22
-rw-r--r--gcc/fortran/trans-expr.c5
-rw-r--r--gcc/fortran/trans-intrinsic.c26
-rw-r--r--gcc/fortran/trans-stmt.c2
-rw-r--r--gcc/fortran/trans.h3
-rw-r--r--gcc/function.c38
-rw-r--r--gcc/function.h144
-rw-r--r--gcc/gcc.c83
-rw-r--r--gcc/gcse.c4
-rw-r--r--gcc/gengtype.c35
-rw-r--r--gcc/gimple-low.c2
-rw-r--r--gcc/gimplify.c19
-rw-r--r--gcc/global.c4
-rw-r--r--gcc/gthr-single.h76
-rw-r--r--gcc/ipa-cp.c294
-rw-r--r--gcc/ipa-inline.c106
-rw-r--r--gcc/ipa-prop.c479
-rw-r--r--gcc/ipa-prop.h255
-rw-r--r--gcc/java/ChangeLog13
-rw-r--r--gcc/java/class.c8
-rw-r--r--gcc/java/constants.c2
-rw-r--r--gcc/java/expr.c1
-rw-r--r--gcc/java/resource.c1
-rw-r--r--gcc/langhooks-def.h4
-rw-r--r--gcc/langhooks.c3
-rw-r--r--gcc/langhooks.h13
-rw-r--r--gcc/local-alloc.c4
-rw-r--r--gcc/objc/ChangeLog4
-rw-r--r--gcc/objc/objc-act.c1
-rw-r--r--gcc/optabs.c3
-rw-r--r--gcc/optc-gen.awk7
-rw-r--r--gcc/opts.c2
-rw-r--r--gcc/output.h5
-rw-r--r--gcc/params.def4
-rw-r--r--gcc/passes.c215
-rw-r--r--gcc/po/ChangeLog4
-rw-r--r--gcc/po/zh_CN.po26
-rw-r--r--gcc/print-tree.c2
-rw-r--r--gcc/ra-conflict.c2
-rw-r--r--gcc/reload1.c10
-rw-r--r--gcc/rtl-factoring.c46
-rw-r--r--gcc/stack-ptr-mod.c2
-rw-r--r--gcc/stmt.c2
-rw-r--r--gcc/stor-layout.c2
-rw-r--r--gcc/target-def.h56
-rw-r--r--gcc/target.h28
-rw-r--r--gcc/targhooks.h2
-rw-r--r--gcc/testsuite/ChangeLog433
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/decltype11.C12
-rw-r--r--gcc/testsuite/g++.dg/ext/fixed1.C1
-rw-r--r--gcc/testsuite/g++.dg/ext/stmtexpr13.C9
-rw-r--r--gcc/testsuite/g++.dg/ext/utf-cvt.C39
-rw-r--r--gcc/testsuite/g++.dg/ext/utf16-4.C4
-rw-r--r--gcc/testsuite/g++.dg/ext/utf32-4.C2
-rw-r--r--gcc/testsuite/g++.dg/ext/vector14.C18
-rw-r--r--gcc/testsuite/g++.dg/init/ref17.C23
-rw-r--r--gcc/testsuite/g++.dg/other/error28.C8
-rw-r--r--gcc/testsuite/g++.dg/overload/template4.C21
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/defarg8.C8
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/20010327-1.c1
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/20080419-1.c6
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/20080424-1.c31
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/pr36034-1.c32
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/pr36034-2.c32
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/pr36077.c13
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/pr36093.c28
-rw-r--r--gcc/testsuite/gcc.c-torture/pr36141.c17
-rw-r--r--gcc/testsuite/gcc.dg/20020919-1.c10
-rw-r--r--gcc/testsuite/gcc.dg/Wconversion-real.c4
-rw-r--r--gcc/testsuite/gcc.dg/Wunreachable-8.c2
-rw-r--r--gcc/testsuite/gcc.dg/array-init-1.c2
-rw-r--r--gcc/testsuite/gcc.dg/array-quals-1.c2
-rw-r--r--gcc/testsuite/gcc.dg/attr-alloc_size-2.c4
-rw-r--r--gcc/testsuite/gcc.dg/builtin-constant_p-1.c10
-rw-r--r--gcc/testsuite/gcc.dg/builtins-12.c1
-rw-r--r--gcc/testsuite/gcc.dg/builtins-13.c1
-rw-r--r--gcc/testsuite/gcc.dg/builtins-error.c2
-rw-r--r--gcc/testsuite/gcc.dg/c90-const-expr-2.c2
-rw-r--r--gcc/testsuite/gcc.dg/c99-const-expr-2.c2
-rw-r--r--gcc/testsuite/gcc.dg/fold-plusmult.c15
-rw-r--r--gcc/testsuite/gcc.dg/format/ms-warnI64-1.c28
-rw-r--r--gcc/testsuite/gcc.dg/ia64-sync-1.c4
-rw-r--r--gcc/testsuite/gcc.dg/ia64-sync-2.c4
-rw-r--r--gcc/testsuite/gcc.dg/ia64-sync-3.c4
-rw-r--r--gcc/testsuite/gcc.dg/large-size-array-2.c2
-rw-r--r--gcc/testsuite/gcc.dg/large-size-array-3.c2
-rw-r--r--gcc/testsuite/gcc.dg/large-size-array-4.c2
-rw-r--r--gcc/testsuite/gcc.dg/large-size-array.c2
-rw-r--r--gcc/testsuite/gcc.dg/lower-subreg-1.c2
-rw-r--r--gcc/testsuite/gcc.dg/max-1.c17
-rw-r--r--gcc/testsuite/gcc.dg/nested-func-5.c1
-rw-r--r--gcc/testsuite/gcc.dg/pr25682.c1
-rw-r--r--gcc/testsuite/gcc.dg/pr33694.c1
-rw-r--r--gcc/testsuite/gcc.dg/pr36015.c22
-rw-r--r--gcc/testsuite/gcc.dg/pr36017.c29
-rw-r--r--gcc/testsuite/gcc.dg/profile-dir-1.c5
-rw-r--r--gcc/testsuite/gcc.dg/profile-dir-2.c5
-rw-r--r--gcc/testsuite/gcc.dg/profile-dir-3.c5
-rw-r--r--gcc/testsuite/gcc.dg/struct/w_prof_global_var.c4
-rw-r--r--gcc/testsuite/gcc.dg/struct/w_prof_local_var.c4
-rw-r--r--gcc/testsuite/gcc.dg/struct/wo_prof_global_var.c4
-rw-r--r--gcc/testsuite/gcc.dg/struct/wo_prof_local_var.c4
-rw-r--r--gcc/testsuite/gcc.dg/struct/wo_prof_malloc_size_var.c3
-rw-r--r--gcc/testsuite/gcc.dg/sync-2.c1
-rw-r--r--gcc/testsuite/gcc.dg/tls/emutls-1.c21
-rw-r--r--gcc/testsuite/gcc.dg/tls/section-2.c8
-rw-r--r--gcc/testsuite/gcc.dg/torture/nested-fn-1.c1
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr36066.c54
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/20030807-7.c9
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/forwprop-5.c21
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/forwprop-6.c16
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/forwprop-7.c14
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/forwprop-8.c16
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/forwprop-9.c18
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/loop-36.c22
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/loop-37.c27
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/pr27799.c26
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-19.c16
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/ssa-ifcombine-6.c37
-rw-r--r--gcc/testsuite/gcc.dg/utf-cvt.c43
-rw-r--r--gcc/testsuite/gcc.dg/utf16-4.c3
-rw-r--r--gcc/testsuite/gcc.dg/utf32-4.c2
-rw-r--r--gcc/testsuite/gcc.dg/vect/O3-vect-pr34223.c33
-rw-r--r--gcc/testsuite/gcc.dg/vect/fast-math-pr35982.c25
-rw-r--r--gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-66.c19
-rw-r--r--gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-69.c2
-rw-r--r--gcc/testsuite/gcc.dg/vect/no-vfa-vect-depend-1.c2
-rw-r--r--gcc/testsuite/gcc.dg/vect/pr33804.c4
-rw-r--r--gcc/testsuite/gcc.dg/vect/pr33953.c4
-rw-r--r--gcc/testsuite/gcc.dg/vect/slp-15.c2
-rw-r--r--gcc/testsuite/gcc.dg/vect/slp-25.c2
-rw-r--r--gcc/testsuite/gcc.dg/vect/slp-3.c4
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-11a.c30
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-66.c45
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-76.c2
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-iv-6.c2
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-outer-1.c2
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-outer-1a.c2
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-outer-4c.c2
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-outer-5.c2
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-outer-6.c8
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-shift-1.c8
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-vfa-slp.c2
-rw-r--r--gcc/testsuite/gcc.target/i386/pr31486.c13
-rw-r--r--gcc/testsuite/gcc.target/i386/pr36064.c55
-rw-r--r--gcc/testsuite/gcc.target/i386/pr36073.c12
-rw-r--r--gcc/testsuite/gcc.target/i386/vectorize1.c4
-rw-r--r--gcc/testsuite/gcc.target/mips/gcc-have-sync-compare-and-swap-1.c4
-rw-r--r--gcc/testsuite/gcc.target/mips/gcc-have-sync-compare-and-swap-2.c4
-rw-r--r--gcc/testsuite/gfortran.dg/any_all_1.f902
-rw-r--r--gcc/testsuite/gfortran.dg/array_constructor_23.f3
-rw-r--r--gcc/testsuite/gfortran.dg/array_constructor_24.f47
-rw-r--r--gcc/testsuite/gfortran.dg/chmod_1.f902
-rw-r--r--gcc/testsuite/gfortran.dg/chmod_2.f902
-rw-r--r--gcc/testsuite/gfortran.dg/chmod_3.f902
-rw-r--r--gcc/testsuite/gfortran.dg/debug/pr35154-dwarf2.f37
-rw-r--r--gcc/testsuite/gfortran.dg/debug/pr35154-stabs.f35
-rw-r--r--gcc/testsuite/gfortran.dg/dev_null.F90 (renamed from gcc/testsuite/gfortran.dg/dev_null.f90)7
-rw-r--r--gcc/testsuite/gfortran.dg/index.f9022
-rw-r--r--gcc/testsuite/gfortran.dg/intrinsic_ifunction_1.f9043
-rw-r--r--gcc/testsuite/gfortran.dg/intrinsic_pack_4.f9072
-rw-r--r--gcc/testsuite/gfortran.dg/intrinsic_product_1.f9029
-rw-r--r--gcc/testsuite/gfortran.dg/io_constraints_4.f9010
-rw-r--r--gcc/testsuite/gfortran.dg/matmul_7.f9040
-rw-r--r--gcc/testsuite/gfortran.dg/maxloc_bounds_4.f902
-rw-r--r--gcc/testsuite/gfortran.dg/maxloc_bounds_5.f902
-rw-r--r--gcc/testsuite/gfortran.dg/maxloc_bounds_7.f902
-rw-r--r--gcc/testsuite/gfortran.dg/minmaxloc_5.f9018
-rw-r--r--gcc/testsuite/gfortran.dg/minmaxloc_6.f9011
-rw-r--r--gcc/testsuite/gfortran.dg/open_errors.f902
-rw-r--r--gcc/testsuite/gfortran.dg/pr36006-1.f9023
-rw-r--r--gcc/testsuite/gfortran.dg/pr36006-2.f9013
-rw-r--r--gcc/testsuite/gfortran.dg/selected_char_kind_1.f9065
-rw-r--r--gcc/testsuite/gfortran.dg/selected_char_kind_2.f9014
-rw-r--r--gcc/testsuite/gfortran.dg/selected_char_kind_3.f9010
-rw-r--r--gcc/testsuite/gfortran.dg/use_rename_3.f9035
-rw-r--r--gcc/testsuite/gfortran.dg/vect/pr36119.f29
-rw-r--r--gcc/testsuite/gfortran.fortran-torture/compile/pr36078.f9022
-rw-r--r--gcc/testsuite/gnat.dg/alignment4.adb2
-rw-r--r--gcc/testsuite/gnat.dg/alignment5.adb2
-rw-r--r--gcc/testsuite/gnat.dg/alignment6.adb2
-rw-r--r--gcc/testsuite/gnat.dg/concat_length.adb15
-rw-r--r--gcc/testsuite/gnat.dg/discr6.adb33
-rw-r--r--gcc/testsuite/gnat.dg/discr6_pkg.ads16
-rw-r--r--gcc/testsuite/gnat.dg/specs/tag2.ads17
-rw-r--r--gcc/testsuite/lib/target-supports.exp15
-rw-r--r--gcc/tree-cfg.c32
-rw-r--r--gcc/tree-flow.h6
-rw-r--r--gcc/tree-gimple.c74
-rw-r--r--gcc/tree-gimple.h2
-rw-r--r--gcc/tree-inline.c1
-rw-r--r--gcc/tree-mudflap.c1
-rw-r--r--gcc/tree-nested.c4
-rw-r--r--gcc/tree-optimize.c2
-rw-r--r--gcc/tree-parloops.c181
-rw-r--r--gcc/tree-pass.h44
-rw-r--r--gcc/tree-scalar-evolution.c1
-rw-r--r--gcc/tree-ssa-alias.c227
-rw-r--r--gcc/tree-ssa-ccp.c56
-rw-r--r--gcc/tree-ssa-forwprop.c42
-rw-r--r--gcc/tree-ssa-ifcombine.c30
-rw-r--r--gcc/tree-ssa-loop-im.c2
-rw-r--r--gcc/tree-ssa-loop-ivcanon.c75
-rw-r--r--gcc/tree-ssa-loop-ivopts.c1
-rw-r--r--gcc/tree-ssa-loop-manip.c10
-rw-r--r--gcc/tree-ssa-loop.c54
-rw-r--r--gcc/tree-ssa-propagate.c12
-rw-r--r--gcc/tree-ssa-structalias.c27
-rw-r--r--gcc/tree-ssa-structalias.h6
-rw-r--r--gcc/tree-ssa-threadedge.c38
-rw-r--r--gcc/tree-stdarg.c2
-rw-r--r--gcc/tree-tailcall.c6
-rw-r--r--gcc/tree-vect-analyze.c17
-rw-r--r--gcc/tree-vect-transform.c5
-rw-r--r--gcc/tree-vrp.c110
-rw-r--r--gcc/tree.c191
-rw-r--r--gcc/tree.h37
-rw-r--r--gcc/varasm.c298
397 files changed, 12395 insertions, 4902 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 8b6363a613f..aba462fbd8d 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,10 +1,1355 @@
-2008-04-24 Kenneth Zadeck <zadeck@naturalbridge.com>
+2008-05-05 Andrew Pinski <andrew_pinski@playstation.sony.com>
+
+ PR middle-end/36141
+ * tree-ssa-forwprop.c (forward_propagate_addr_expr_1): Don't create VCE
+ for function decls.
+
+2008-05-05 H.J. Lu <hongjiu.lu@intel.com>
+
+ * config/i386/sse.md (sse2_<plusminus_insn><mode>3): Fix a typo.
+
+2008-05-05 H.J. Lu <hongjiu.lu@intel.com>
+
+ * config/i386/i386.md (sat_plusminus): New.
+ (plusminus_insn): Likewise.
+ (plusminus_mnemonic): Likewise.
+ (addsub): Removed.
+ (comm): Add ss_plus, us_plus, ss_minus and us_minus.
+ (*<addsub><mode>3_cc_overflow): Renamed to ...
+ (*<plusminus_insn><mode>3_cc_overflow): This.
+ (*<addsub>si3_zext_cc_overflow): Renamed to ...
+ (*<plusminus_insn>si3_zext_cc_overflow): This.
+
+ * config/i386/sse.md (<addsub><mode>3): Renamed to ...
+ (<plusminus_insn><mode>3): This.
+ (*<addsub><mode>3): Renamed to ...
+ (*<plusminus_insn><mode>3): This.
+ (<sse>_vm<addsub><mode>3): Renamed to ...
+ (<sse>_vm<plusminus_insn><mode>3): This.
+ (sse3_h<addsub>v4sf3): Renamed to ...
+ (sse3_h<plusminus_insn>v4sf3): This.
+ (sse3_h<addsub>v2df3): Renamed to ...
+ (sse3_h<plusminus_insn>v2df3): This.
+ (<plusminus_insn><mode>3): New.
+ (*<plusminus_insn><mode>3): Likewise.
+ (sse2_<plusminus_insn><mode>3): Likewise.
+ (add<mode>): Removed.
+ (*add<mode>3): Likewise.
+ (sse2_ssadd<mode>3): Likewise.
+ (sse2_usadd<mode>3): Likewise.
+ (sub<mode>3): Likewise.
+ (*sub<mode>3): Likewise.
+ (sse2_sssub<mode>3): Likewise.
+ (sse2_ussub<mode>3): Likewise.
+
+2008-05-05 Benjamin Kosnik <bkoz@redhat.com>
+
+ * gthr-single.h: Add in required interface elements as per gthr.h.
+ Add stub types for __gthread_key_t, __gthread_once_t. Add defines
+ for __GTHREAD_ONCE_INIT, __GTHREAD_RECURSIVE_MUTEX_INIT.
+ Generalize UNUSED macro.
+ (__gthread_once): Add.
+ (__gthread_key_create): Add.
+ (__gthread_key_delete): Add.
+ (__gthread_getspecific): Add.
+ (__gthread_setspecific): Add.
+
+2008-05-05 Andrew Pinski <Andrew.Pinski@playstation.sony.com>
+
+ * tree-ssa-forwprop.c (forward_propagate_addr_expr_1): If we have
+ the same size types for the indirect reference on the rhs, then
+ create a VCE.
+
+2008-05-05 Uros Bizjak <ubizjak@gmail.com>
+
+ * config/i386/i386.md
+ (*float<SSEMODEI24:mode><MODEF:mode>2_sse_interunit): Use only
+ one insn template instead of template series.
+ (*xordi_1_rex64): Ditto.
+ (*xordi_2_rex64): Ditto.
+
+2008-05-05 Ira Rosen <irar@il.ibm.com>
+
+ PR tree-optimization/36119
+ * tree-vect-transform.c (vectorizable_assignment): Set NCOPIES to 1
+ in case of SLP.
+
+2008-06-04 Jan Hubicka <jh@suse.cz>
+
+ tree-optimization/36100
+ * tree-pass.h (pass_O0_always_inline): Declare.
+ * ipa-inline.c (inline_transform): Remove dead code.
+ (cgraph_gate_O0_always_inline, cgraph_O0_always_inline,
+ pass_O0_always_inline): New.
+ * passes.c (init_optimization_passes): Add pass_O0_always_inline.
+
+2008-05-04 Kai Tietz <kai.tietz@onevision.com>
+
+ * config/i386/i386.c (x86_output_mi_thunk): Use movq alternative
+ mnemonic in this_param move for TARGET_64BIT.
+
+2008-05-04 Uros Bizjak <ubizjak@gmail.com>
+
+ * config/i386/i386.md (*strmovsi_1): Simplify asm alternatives.
+ (*strmovsi_rex_1): Ditto.
+ (*strsetsi_1): Ditto.
+ (*strsetsi_rex_1): Ditto.
+
+ (add<mode>cc): Macroize expander from addqicc, addhicc, addsicc and
+ adddicc expanders using SWI mode iterator.
+
+2008-05-04 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR target/36121
+ * config/i386/i386.c (ix86_expand_special_args_builtin): Remove three
+ argument handling.
+
+2008-05-04 David S. Miller <davem@davemloft.net>
+
+ * config.gcc (sparc*-*-*): Always set need_64bit_hwint to yes.
+ (sparc*-*-linux*): Use linux.h in tm_file.
+ (sparc-*-linux*): If 'enabled_targets' is 'all', build a bi-arch
+ compiler defaulting to 32-bit.
+ (sparc*-*-*): Remove explicit target settings of need_64bit_hwint,
+ no longer needed.
+ * config/sparc/linux.h: Remove definitions now obtained
+ properly from linux.h
+ * config/sparc/linux64.h: Likewise.
+ (ASM_CPU_DEFAULT_SPEC): Change this to ASM_CPU64_DEFAULT_SPEC, we
+ don't want this setting for 32-bit builds in a biarch compiler.
+ * doc/install.texi: Add sparc-linux to list of targets
+ supporting --enable-targets=all.
+
+2008-05-03 Andrew Pinski <pinskia@gmail.com>
+
+ * Makefile.in (tree-ssa-phiprop.o): Fix dependencies.
+
+2008-05-03 H.J. Lu <hongjiu.lu@intel.com>
+
+ * config/i386/i386.c (ix86_builtin_type): Move V4SI_FTYPE_V4SF
+ after V4SI_FTYPE_V8HI.
+ (ix86_init_mmx_sse_builtins): Move case V4HI_FTYPE_V4HI after
+ case V4SI_FTYPE_V2DF.
+
+2008-05-03 Kenneth Zadeck <zadeck@naturalbridge.com>
+
+ * doc/invoke.texi (max-flow-memory-locations): Removed.
+ * params.def (PARAM_MAX_FLOW_MEMORY_LOCATIONS): Removed.
+
+2008-05-03 Richard Guenther <rguenther@suse.de>
+
+ PR middle-end/34973
+ * opts.c (set_Wstrict_aliasing): Handle the turn-off case.
+
+2008-05-02 David S. Miller <davem@davemloft.net>
+
+ * config.gcc (need_64bit_hwint): Document libcpp dependency.
+
+2008-05-02 Simon Baldwin <simonb@google.com>
+
+ PR bootstrap/36108
+ * c-common.h (warn_array_subscript_range): Removed.
+ * c-common.c (warn_array_subscript_range): Ditto.
+ * tree-vrp.c (check_array_ref): Revert to ignoring arrays with size 2.
+ * c-typeck.c (build_array_ref): Remove warn_array_subscript_range.
+
+2008-05-02 H.J. Lu <hongjiu.lu@intel.com>
+
+ * config/i386/i386.c (ix86_special_builtin_type): New.
+ (bdesc_special_args): Likewise.
+ (ix86_expand_special_args_builtin): Likewise.
+ (ix86_init_mmx_sse_builtins): Updated.
+ (ix86_expand_builtin): Updated.
+ (ix86_expand_store_builtin): Removed.
+ (ix86_expand_unop_builtin): Likewise.
+
+ * config/i386/mm3dnow.h (__v2sf): Moved to ...
+ * config/i386/mmintrin.h (__v2sf): Here.
+
+ * config/i386/xmmintrin.h (_mm_loadh_pi): Replace __v2si with
+ const __v2sf.
+ (_mm_loadl_pi): Likewise.
+ (_mm_storeh_pi): Replace __v2si with __v2sf.
+ (_mm_storel_pi): Likewise.
+
+ * doc/extend.texi: Correct __builtin_ia32_loadhps,
+ __builtin_ia32_loadlps, __builtin_ia32_storehps,
+ __builtin_ia32_storelps, __builtin_ia32_loadhpd and
+ __builtin_ia32_loadlpd.
+
+2008-05-02 H.J. Lu <hongjiu.lu@intel.com>
+
+ * config/i386/i386.c (ix86_builtin_type): Add FLOAT_FTYPE_FLOAT,
+ V4SF_FTYPE_V4SF_VEC_MERGE and V2DF_FTYPE_V2DF_VEC_MERGE.
+ (bdesc_args): Updated. Add scalar SSE builtins with vec_merge.
+ (ix86_init_mmx_sse_builtins): Updated.
+ (ix86_expand_args_builtin): Likewise.
+ (ix86_expand_builtin): Likewise.
+ (ix86_expand_unop1_builtin): Renamed to ...
+ (ix86_expand_unop_vec_merge_builtin): This.
+
+2008-05-01 Jan Hubicka <jh@suse.cz>
+
+ PR bootstrap/36100
+ * ipa-inline.c (inline_generate_summary): Make static.
+ (inline_transform): Do not call inlining at -O0; make static.
+ * passes.c (execute_todo): Add sanity check.
+ (execute_one_ipa_transform_pass): Execute proper flags.
+
+2008-05-01 Eric Botcazou <ebotcazou@adacore.com>
+
+ * tree.h (TYPE_NONALIASED_COMPONENT): Expand comment.
+ (DECL_NONADDRESSABLE_P): Likewise.
+ * alias.c (record_component_aliases): Fix comment.
+
+2008-05-01 Simon Baldwin <simonb@google.com>
+
+ * c-common.h (warn_array_subscript_range): New function.
+ * c-common.c (warn_array_subscript_range): Ditto.
+ * tree-vrp.c (check_array_ref): Corrected code to agree with
+ comment, ignoring only arrays of size 0 or size 1.
+ * c-typeck.c (build_array_ref): Call warn_array_subscript_range.
+
+2008-05-01 H.J. Lu <hongjiu.lu@intel.com>
+
+ * config/i386/i386.c (ix86_builtin_type): Replace
+ DI_FTYPE_DI_DI_INT with V1DI2DI_FTYPE_V1DI_V1DI_INT.
+ (bdesc_args): Updated.
+ (ix86_init_mmx_sse_builtins): Likewise.
+ (ix86_expand_args_builtin): Likewise.
+
+ * config/i386/tmmintrin.h (_mm_alignr_pi8): Replace long long
+ with __v1di.
+
+ * doc/extend.texi: Correct __builtin_ia32_palignr.
+
+2008-05-01 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR target/36095
+ * config/i386/i386.c (bdesc_crc32): Removed.
+ (ix86_expand_crc32): Likewise.
+ (ix86_builtin_type): Replace V2DI2TI_FTYPE_V2DI2TI_INT with
+ V2DI2TI_FTYPE_V2DI_INT, V2DI2TI_FTYPE_V2DI2TI_V2DI2TI_INT with
+ V2DI2TI_FTYPE_V2DI_V2DI_INT. Add UINT64_FTYPE_UINT64_UINT64,
+ UINT_FTYPE_UINT_UINT, UINT_FTYPE_UINT_USHORT and
+ UINT_FTYPE_UINT_UCHAR.
+ (bdesc_args): Updated. Add crc32 builtins.
+ (ix86_init_mmx_sse_builtins): Updated.
+ (ix86_expand_args_builtin): Updated to support subreg.
+
+ * doc/extend.texi: Correct __builtin_ia32_crc32di.
+
+2008-05-01 Jan Hubicka <jh@suse.cz>
+
+ * tree-pass.h (opt_pass): Add IPA_PASS.
+ (varpool_node, cgraph_node): Forward declare.
+ (ipa_opt_pass): Define.
+ (pass_ipa_inline): Turn into ipa_opt_pass.
+ (pass_apply_inline): Remove.
+ * ipa-inline.c (pass_ipa_inline): Turn into ipa_opt_pass.
+ (apply_inline): Turn into ....
+ (inline_transform): ... this one.
+ (inline_generate_summary): New function.
+ (pass_apply_inline): Remove.
+ * function.h (ipa_opt_pass): Forward declare structure; typedef;
+ vector.
+ (struct function): Add ipa_transforms_to_apply.
+ * passes.c (register_one_dump_file): Work on IPA_PASS.
+ (init_optimization_passes): Remove pass_inline_parameters and
+ pass_apply_inline.
+ (pass_init_dump_file, pass_fini_dump_file): Break out from ....
+ (execute_one_pass) ... here; apply transforms when possible.
+ (add_ipa_transform_pass, execute_ipa_summary_asses,
+ execute_one_ipa_transform_pass): New.
+ (execute_ipa_pass_list): Update for IPA_PASS type.
+
+2008-05-01 H.J. Lu <hongjiu.lu@intel.com>
+
+ * config/i386/i386.c (ix86_builtin_type): Add
+ V2DI_FTYPE_V2DI_V16QI, V2DI_FTYPE_V2DI_UINT_UINT and
+ V2DI_FTYPE_V2DI_V2DI_UINT_UINT.
+ (bdesc_args): Add SSE4a builtins.
+ (ix86_init_mmx_sse_builtins): Updated.
+ (ix86_expand_args_builtin): Likewise.
+ (ix86_expand_builtin): Likewise.
+
+2008-05-01 H.J. Lu <hongjiu.lu@intel.com>
+
+ * config/i386/i386.c (ix86_builtin_type): Add
+ V8HI_FTYPE_V8HI_V8HI_COUNT, V8HI_FTYPE_V8HI_SI_COUNT,
+ V4SI_FTYPE_V4SI_V4SI_COUNT, V4SI_FTYPE_V4SI_SI_COUNT,
+ V4HI_FTYPE_V4HI_V4HI_COUNT, V4HI_FTYPE_V4HI_SI_COUNT,
+ V2DI_FTYPE_V2DI_V2DI_COUNT, V2DI_FTYPE_V2DI_SI_COUNT,
+ V2SI_FTYPE_V2SI_V2SI_COUNT, V2SI_FTYPE_V2SI_SI_COUNT,
+ V1DI_FTYPE_V1DI_V1DI_COUNT, V1DI_FTYPE_V1DI_SI_COUNT,
+ V8HI_FTYPE_V8HI_INT, V4SI_FTYPE_V4SI_INT, V4HI_FTYPE_V4HI_INT,
+ V2DI2TI_FTYPE_V2DI2TI_INT, V2DI2TI_FTYPE_V2DI2TI_V2DI2TI_INT
+ and DI_FTYPE_DI_DI_INT.
+ (bdesc_args): Add MMX/SSE shift, shuffle and palignr builtins.
+ (ix86_init_mmx_sse_builtins): Updated.
+ (ix86_expand_args_builtin): Likewise.
+ (ix86_expand_builtin): Likewise.
+ (ix86_expand_binop_imm_builtin): Removed.
+
+ * doc/extend.texi: Correct __builtin_ia32_palignr128.
+
+2008-04-30 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/32921
+ * tree-ssa-loop-im.c (mem_refs_may_alias_p): Disambiguate with TBAA.
+
+2008-04-30 Richard Sandiford <rsandifo@nildram.co.uk>
+
+ * config/arm/arm.c (arm_unwind_emit): Use
+ crtl->all_throwers_are_sibcalls instead of
+ cfun->all_throwers_are_sibcalls.
+ (arm_output_fn_unwind): Likewise.
+ * config/frv/frv.c (frv_stack_info): Use crtl->uses_pic_offset_table
+ instead of cfun->uses_pic_offset_table.
+ (frv_expand_prologue): Likewise.
+ (frv_frame_pointer_required): Likewise.
+ (frv_expand_fdpic_call): Likewise.
+ (frv_emit_movsi): Likewise.
+ * config/iq2000/iq2000.c (iq2000_expand_prologue): Use
+ cfun->returns_pcc_struct instead of
+ current_function_returns_pcc_struct.
+ * config/m32c/m32c.c (need_to_save): Use crtl->calls_eh_return
+ instead of cfun->calls_eh_return.
+ (m32c_pushm_popm): Likewise.
+ * config/xtensa/xtensa.h (cfun->calls_alloca): Remove bogus
+ "extern" declaration.
+
+2008-04-30 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/21636
+ * tree-ssa-ccp.c (ccp_fold): Handle &p->x with p being a
+ constant address.
+ (evaluate_stmt): Print the likely value.
+ (ccp_visit_stmt): Avoid excessive vertical spacing.
+
+2008-04-30 Rafael Espindola <espindola@google.com>
+
+ * builtins.c (fold_call_expr): Return realret.
+ * tree-ssa-threadedge.c
+ (record_temporary_equivalences_from_stmts_at_dest): Ignore calls to
+ __builtin_object_size.
+
+2008-04-30 Seongbae Park <seongbae.park@gmail.com>
+
+ * gcc.c (wrapper_string): New variable.
+ (insert_wrapper): New function.
+ (execute): New option -wrapper.
+ * doc/invoke.texi (Overall Options): New driver option -wrapper.
+
+2008-04-30 Nathan Froyd <froydnj@codesourcery.com>
+
+ * config/rs6000/crtresgpr.asm, config/rs6000/crtresxgpr.asm,
+ config/rs6000/crtsavgpr.asm, config/rs6000/crtresfpr.asm,
+ config/rs6000/crtresxfpr.asm, config/rs6000/crtsavfpr.asm: Break out
+ from...
+ * config/rs6000/crtsavres.asm: ...here. Remove unneeded file.
+ * config/rs6000/e500crtres32gpr.asm, config/rs6000/e500crtres64gpr.asm,
+ config/rs6000/e500crtres64gprctr.asm,
+ config/rs6000/e500crtrest32gpr.asm, config/rs6000/e500crtrest64gpr.asm,
+ config/rs6000/e500crtresx32gpr.asm, config/rs6000/e500crtresx64gpr.asm,
+ config/rs6000/e500crtsav32gpr.asm, config/rs6000/e500crtsav64gpr.asm,
+ config/rs6000/e500crtsav64gprctr.asm,
+ config/rs6000/e500crtsavg32gpr.asm, config/rs6000/e500crtsavg64gpr.asm,
+ config/rs6000/e500crtsavg64gprctr.asm: New files.
+ * config/rs6000/t-ppccomm: Add build rules for new files.
+ (LIB2FUNCS_STATIC_EXTRA): Add new files.
+ * config/rs6000/t-netbsd: Add build rules for new files.
+ (LIB2FUNCS_STATIC_EXTRA): New variable.
+ * config/rs6000/sysv4.h (ENDFILE_SPEC): Don't include crtsavres.o
+ (CRTSAVRES_DEFAULT_SPEC): Likewise.
+ * config/rs6000/netbsd.h (ENDFILE_SPEC): Likewise.
+
+2008-04-30 H.J. Lu <hongjiu.lu@intel.com>
+
+ * config/i386/i386.c (ix86_builtin_type): Add
+ FLOAT128_FTYPE_FLOAT128_FLOAT128, V16QI_FTYPE_V16QI_V16QI,
+ V16QI_FTYPE_V8HI_V8HI, V8QI_FTYPE_V8QI_V8QI,
+ V8QI_FTYPE_V4HI_V4HI, V8HI_FTYPE_V8HI_V8HI,
+ V8HI_FTYPE_V16QI_V16QI, V8HI_FTYPE_V4SI_V4SI,
+ V4SI_FTYPE_V4SI_V4SI, V4SI_FTYPE_V8HI_V8HI,
+ V4SI_FTYPE_V4SF_V4SF, V4SI_FTYPE_V2DF_V2DF,
+ V4HI_FTYPE_V4HI_V4HI, V4HI_FTYPE_V8QI_V8QI,
+ V4HI_FTYPE_V2SI_V2SI, V4SF_FTYPE_V4SF_V4SF,
+ V4SF_FTYPE_V4SF_V4SF_SWAP, V4SF_FTYPE_V4SF_V2SI,
+ V4SF_FTYPE_V4SF_V2DF, V4SF_FTYPE_V4SF_DI,
+ V4SF_FTYPE_V4SF_SI, V2DI_FTYPE_V2DI_V2DI,
+ V2DI_FTYPE_V16QI_V16QI, V2DI_FTYPE_V4SI_V4SI,
+ V2DI_FTYPE_V2DF_V2DF, V2SI_FTYPE_V2SI_V2SI,
+ V2SI_FTYPE_V4HI_V4HI, V2SI_FTYPE_V2SF_V2SF,
+ V2DF_FTYPE_V2DF_V2DF, V2DF_FTYPE_V2DF_V2DF_SWAP,
+ V2DF_FTYPE_V2DF_V4SF, V2DF_FTYPE_V2DF_DI,
+ V2DF_FTYPE_V2DF_SI, V2SF_FTYPE_V2SF_V2SF,
+ V1DI_FTYPE_V1DI_V1DI, V1DI_FTYPE_V8QI_V8QI and
+ V1DI_FTYPE_V2SI_V2SI.
+ (bdesc_2arg): Moved to ...
+ (bdesc_args): Here.
+ (ix86_init_mmx_sse_builtins): Updated.
+ (ix86_expand_args_builtin): Updated. Take a pointer
+ to const struct builtin_description. Handle comparison
+ builtin functions.
+ (ix86_expand_sse_compare): Take a new argument for swapping operands.
+ (ix86_expand_builtin): Updated.
+
+ * config/i386/sse.md (ssse3_pmaddubswv8hi3): Renamed to ...
+ (ssse3_pmaddubsw128): This.
+ (ssse3_pmaddubswv4hi3): Renamed to ...
+ (ssse3_pmaddubsw): This.
+
+ * doc/extend.texi (__builtin_ia32_packsswb128): Correct prototype.
+ (__builtin_ia32_packssdw128): Likewise.
+ (__builtin_ia32_packuswb128): Likewise.
+ (__builtin_ia32_pmaddubsw): Likewise.
+ (__builtin_ia32_pmaddubsw128): Likewise.
+
+2008-04-30 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/14847
+ * tree-ssa-ifcombine.c (get_name_for_bit_test): New helper function.
+ (recognize_bits_test): Use it.
+ (recognize_single_bit_test): Likewise.
+
+2008-04-30 Martin Jambor <mjambor@suse.cz>
+
+ * ipa-cp.c (ipcp_init_stage): Calls ipa_set_called_with_variable_arg
+ instead of setting number of formal parameters to zero.
+ (ipcp_init_stage): Do not set the number of actual parameters to zero
+ either.
+ (ipcp_propagate_stage): Explicitly skipping all calls to nodes
+ which are called with variable number of arguments.
+ (ipcp_insert_stage): Explicitely skipping all nodes which are
+ called with variable number of arguments.
+ (ipcp_callsite_param_print): Skipps callsites to nodes with varaible
+ number of parameters.
+
+ * ipa-prop.h (struct ipa_node_params): Added flag
+ called_with_var_arguments
+ (ipa_set_param_count): Added. Changed sole setter to use it.
+ (ipa_get_param_count): Added. All readers of param_count
+ converted to use it instead.
+ (ipa_set_called_with_variable_arg): Added.
+ (ipa_is_called_with_var_arguments): Added.
+ (ipa_get_ith_param): Added. All readers of param_decls converted
+ to use it instead.
+ (ipa_set_cs_argument_count): Added, sole writer to argument_count
+ changed to use it.
+ (ipa_get_cs_argument_count): Added, all readers of argument_count
+ changed to cal it.
+ (ipa_get_ith_jump_func): Added. Accessors of jump values changed
+ to use it.
+
+ * ipa-prop.h (struct ipcp_formal): Renamed to ipcp_lattice
+ (struct ipcp_lattice): Renamed cval_type to type
+ (struct ipa_node_params): ipcp_cval renamed to ipcp_lattices
+
+ * ipa-cp.c (ipcp_cval_get_cvalue): Changed return value to tree
+ (ipcp_cval_set_cvalue): Changed type of parameter value to tree
+ (ipcp_insert_stage): Changed the type of variable cvalue to tree
+ (ipcp_replace_map_create): Changed the type of parameter cvalue to tree
+ (build_const_val): Changed the type of parameter cvalue to tree
+ (ipcp_propagate_const): Changed the type of parameter cvalue to tree
+ (ipcp_method_cval_set_cvalue_type): Renamed parameter cval_type1 to type
+
+ * ipa-prop.h (struct ipcp_formal): Replaced cvalue with tree called
+ constant
+
+ * ipa-prop.c (ipa_methodlist_init): Renamed to ipa_init_func_list
+ (ipa_methodlist_not_empty): Removed, the sole user now checks directly
+ (ipa_add_method): Renamed to ipa_push_func_to_list
+ (ipa_remove_method): Renamed to ipa_pop_func_from_list
+ (ipa_callsite_param_count): Removed.
+ (ipa_callsite_param_count_set): Removed.
+ (ipa_callsite_param): Removed.
+ (ipa_callsite_callee): Removed.
+ (ipa_callsite_compute_param): Renamed to ipa_compute_jump_functions
+ (ipa_callsite_compute_count): Renamed to ipa_count_arguments
+ (ipa_method_formal_count): Removed.
+ (ipa_method_formal_count_set): Removed.
+ (ipa_method_get_tree): Removed.
+ (ipa_method_tree_map_create): Removed.
+ (ipa_method_compute_tree_map): Renamed to ipa_create_param_decls_array
+ (ipa_create_param_decls_array): Creates the array itself
+ (ipa_create_param_decls_array): Temporary variable info instead of
+ a few dereferences.
+ (ipa_method_formal_compute_count): Renamed to ipa_count_formal_params
+ (ipa_method_compute_modify): Renamed to ipa_detect_param_modifications
+ (get_type): Removed.
+ (ipa_jf_get_info_type): Removed.
+ (ipa_node_create): Renamed to ipa_create_node_params
+ (ipa_free): Renamed to ipa_free_all_node_params
+ (ipa_nodes_create): Renamed to ipa_create_all_node_params
+ (ipa_edges_create): Renamed to ipa_create_all_edge_args
+ (ipa_edges_free): Renamed to ipa_free_all_edge_args
+ (ipa_nodes_free): Integrated into ipa_free_all_node_params and removed
+ (ipa_free_all_node_params): Deallocation to jump_functions moved to
+ ipa_free_all_edge_args
+ (ipa_method_tree_print): Renamed to ipa_print_all_tree_maps
+ (ipa_method_modify_print): Renamed to ipa_print_all_params_modified
+ (ipa_create_methodlist_node): Removed.
+ (ipa_methodlist_method): Removed.
+ (ipa_methodlist_method_set): Removed.
+ (ipa_methodlist_next_method): Removed.
+ (ipa_methodlist_next_method_set): Removed.
+ (ipa_method_is_modified): Removed.
+ (ipa_method_modify_create): Removed.
+ (ipa_method_modify_init): Temporary variable info instead of a few
+ dereferences.
+ (ipa_detect_param_modifications): Temporary variable info instead of
+ a few dereferences.
+ (ipa_compute_jump_functions): Temporary variable info instead of
+ a few dereferences.
+ (ipa_method_modify_set): Removed.
+ (ipa_method_tree_map): Renamed to ipa_get_param_decl_index
+ (ipa_get_param_decl_index): Now accepts struct ipa_node_params rather
+ than craph_node as the first parameter.
+ (ipa_method_modify_stmt): Renamed to ipa_check_stmt_modifications
+ (ipa_method_modify_init): Removed.
+ (ipa_compute_jump_functions): Added a temp variable instead of
+ repeatadly dereferencing the cgraph_edge.aux pointer
+ (ipa_callsite_param_set_type): Removed.
+ (ipa_compute_jump_functions): i renamed to index and moved to
+ an inner block
+ (ipa_callsite_param_set_info_type_formal): Removed.
+ (ipa_callsite_param_set_info_type): Removed.
+ (ipa_callsite_param_map_create): Removed.
+ (ipa_callsite_tree): Removed.
+ (ipa_callsite_caller): Removed.
+ (ipa_pop_func_from_list): return_method removed to return_func
+
+ * ipa-prop.h (enum cvalue_type): Renamed to ipa_lattice_type,
+ prefixed all values with IPA_. Changed all users.
+ (enum jump_func_type): Rnamed UNKNOWN_IPATYPE to IPA_UNKNOWN,
+ CONST_IPATYPE to IPA_CONST, CONST_IPATYPE_REF to IPA_CONST_REF
+ and FORMAL_IPATYPE IPA_PASS_THROUGH.
+ (union parameter_info): Renamed to jump_func_value.
+ (union jump_func_value): Renamed value to constant
+ (struct ipa_jump_func): Renamed info_type to value
+ (struct ipa_node): Renamed to ipa_node_params
+ (struct ipa_node_params): Renamed ipa_arg_num to param_count
+ (struct ipa_node_params): Renamed ipa_param_tree to param_decls
+ (struct ipa_node_params): Renamed ipa_mod to modified_flags
+ (struct ipa_edge): Renamed to ipa_edge_args
+ (struct ipa_edge_args): Renamed ipa_param_num to argument_count
+ (struct ipa_edge_args): Renamed ipa_param_map to jump_functions
+ (struct ipa_methodlist): Renamed to ipa_func_list
+ (struct ipa_func_list): method_p renamed to node, next_method
+ renamed to next
+ (ipa_methodlist_p): Removed, switched all users to struct pointer
+ (IS_VALID_TREE_MAP_INDEX): Renamed to IS_VALID_JUMP_FUNC_INDEX
+
+2008-04-30 Alan Modra <amodra@bigpond.net.au>
+
+ * config/rs6000/rs6000.c (ALWAYS_RESTORE_ALTIVEC_BEFORE_POP): Define.
+ (rs6000_emit_epilogue): Use backchain to restore only when we
+ have a large frame. Make use of frame pointer to restore if we
+ have one. Handle ALWAYS_RESTORE_ALTIVEC_BEFORE_POP.
+
+2008-04-29 Paolo Bonzini <bonzini@gnu.org>
+
+ * config/avr/avr.md (*sbrx_branch, *sbix_branch, *sbix_branch_tmp):
+ Add mode to zero_extract.
+ (sign bit tests peepholes): (Ditto.).
+
+2008-04-29 H.J. Lu <hongjiu.lu@intel.com>
+
+ * config/i386/i386.c (ix86_builtins): Replace Prescott New
+ Instructions in comments with SSE3.
+ (ix86_builtin_type): This. Add FLOAT128_FTYPE_FLOAT128,
+ INT64_FTYPE_V4SF, INT64_FTYPE_V2DF, INT_FTYPE_V16QI,
+ INT_FTYPE_V8QI, INT_FTYPE_V4SF, INT_FTYPE_V2DF,
+ V16QI_FTYPE_V16QI, V8HI_FTYPE_V8HI, V8HI_FTYPE_V16QI,
+ V8QI_FTYPE_V8QI, V4SI_FTYPE_V4SI, V4SI_FTYPE_V16QI,
+ V4SI_FTYPE_V4SF, V4SI_FTYPE_V8HI, V4SI_FTYPE_V2DF,
+ V4HI_FTYPE_V4HI, V4SF_FTYPE_V4SF, V4SF_FTYPE_V4SI,
+ V4SF_FTYPE_V2DF, V2DI_FTYPE_V2DI, V2DI_FTYPE_V16QI,
+ V2DI_FTYPE_V8HI, V2DI_FTYPE_V4SI, V2DF_FTYPE_V2DF,
+ V2DF_FTYPE_V4SI, V2DF_FTYPE_V4SF, V2DF_FTYPE_V2SI,
+ V2SI_FTYPE_V2SI, V2SI_FTYPE_V4SF, V2SI_FTYPE_V2SF,
+ V2SI_FTYPE_V2DF, V2SF_FTYPE_V2SF and V2SF_FTYPE_V2SI.
+ (bdesc_sse_args): Renamed to ...
+ (bdesc_args): This. Add IX86_BUILTIN_PF2ID, IX86_BUILTIN_PFRCP,
+ IX86_BUILTIN_PFRSQRT, IX86_BUILTIN_PI2FD, IX86_BUILTIN_PF2IW,
+ IX86_BUILTIN_PSWAPDSI, IX86_BUILTIN_PSWAPDSF and
+ IX86_BUILTIN_FABSQ.
+ (bdesc_1arg): Moved to ...
+ (bdesc_args): Here.
+ (ix86_init_mmx_sse_builtins): Updated. Replace Prescott New
+ Instructions in comments with SSE3.
+ (ix86_expand_sse_operands_builtin): Renamed to ...
+ (ix86_expand_args_builtin): This. Updated.
+ (ix86_expand_unop1_builtin): Update comments.
+ (ix86_expand_builtin): Updated.
+
+2008-04-29 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/36078
+ * tree-ssa-loop-ivcanon.c (tree_unroll_loops_completely):
+ Update virtual SSA form after cleaning up the CFG.
+
+2008-04-29 Richard Guenther <rguenther@suse.de>
+
+ PR middle-end/15255
+ * fold-const.c (fold_binary): Fold (A + A) * C to A * 2*C.
+
+2008-04-29 Richard Guenther <rguenther@suse.de>
+
+ * tree-ssa-alias.c (finalize_ref_all_pointers): Remove.
+ (compute_may_aliases): Do not call finalize_ref_all_pointers.
+ (compute_flow_insensitive_aliasing): Do not treat
+ PTR_IS_REF_ALL pointers special.
+ (get_smt_for): Likewise.
+ (may_alias_p): Re-structure.
+ (is_escape_site): A ref-all pointer conversion is not an escape site.
+ * tree-ssa-structalias.c (find_what_p_points_to): Do not treat
+ PTR_IS_REF_ALL pointers special.
+ * tree-ssa-structalias.h (struct alias_info): Remove
+ ref_all_symbol_mem_tag field.
+ (PTR_IS_REF_ALL): Remove.
+
+2008-04-29 Richard Guenther <rguenther@suse.de>
+
+ PR middle-end/36077
+ * fold-const.c (extract_muldiv_1): In combining division constants
+ make sure to never overflow.
+
+2008-04-29 Nick Clifton <nickc@redhat.com>
+
+ * doc/tm.texi (RETURN_ADDR_RTX): Fix typo.
+
+2008-04-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
+
+ PR bootstrap/35169
+ * optc-gen.awk: Work around HP-UX/IA awk bug.
+
+2008-04-28 Danny Smith <dannysmith@users.sourceforge.net>
+
+ * config/i386/cygming-crtend.c (register_frame_ctor): Revert my
+ 2008-04-25 commit.
+
+2008-04-28 Uros Bizjak <ubizjak@gmail.com>
+
+ PR target/36073
+ * config/i386/i386.md
+ (*float<SSEMODEI24:mode><MODEF:mode>2_mixed_interunit):
+ Change operand 1 predicate to nonimmediate_operand.
+
+2008-04-28 Jakub Jelinek <jakub@redhat.com>
+
+ PR debug/36060
+ * dwarf2out.c (struct die_struct): Mark as chain_circular through
+ die_sub field.
+ * gengtype.c (walk_type, write_func_for_structure): Handle
+ chain_circular.
+ * doc/gty.texi: Document chain_circular.
+
+2008-04-28 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/36066
+ * tree-vrp.c (execute_vrp): Cleanup the CFG only after finalizing
+ SCEV and loop.
+
+2008-04-28 Uros Bizjak <ubizjak@gmail.com>
+
+ PR target/36064
+ * config/i386/i386.md
+ (floatdi<X87MODEF:mode>2_i387_with_xmm splitters):
+ Use match_scratch instead of match_operand for operands 3 and 4.
+
+2008-04-27 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/18754
+ PR tree-optimization/34223
+ * tree-pass.h (pass_complete_unrolli): Declare.
+ * tree-ssa-loop-ivcanon.c (try_unroll_loop_completely): Print
+ loop size before and after unconditionally of UL_NO_GROWTH in effect.
+ Rewrite loop into loop closed SSA form if it is not already.
+ (tree_unroll_loops_completely): Re-structure to iterate over
+ innermost loops with intermediate CFG cleanups.
+ Unroll outermost loops only if requested or the code does not grow
+ doing so.
+ * tree-ssa-loop.c (gate_tree_vectorize): Don't shortcut if no
+ loops are available.
+ (tree_vectorize): Instead do so here.
+ (tree_complete_unroll): Also unroll outermost loops.
+ (tree_complete_unroll_inner): New function.
+ (gate_tree_complete_unroll_inner): Likewise.
+ (pass_complete_unrolli): New pass.
+ * tree-ssa-loop-manip.c (find_uses_to_rename_use): Only record
+ uses outside of the loop.
+ (tree_duplicate_loop_to_header_edge): Only verify loop-closed SSA
+ form if it is available.
+ * tree-flow.h (tree_unroll_loops_completely): Add extra parameter.
+ * passes.c (init_optimization_passes): Schedule complete inner
+ loop unrolling pass before the first CCP pass after final inlining.
+
+2008-04-27 Nathan Sidwell <nathan@codesourcery.com>
+
+ * targhooks.h (default_emutls_var_fields,
+ default_emutls_var_init): Declare.
+ * tree.h (DECL_THREAD_LOCAL): Compare against TLS_MODEL_REAL.
+ * target.h (struct gcc_target): Add struct emutls member.
+ * target-def.h (TARGET_EMUTLS_GET_ADDRESS,
+ TARGET_EMUTLS_REGISTER_COMMON, TARGET_EMUTLS_VAR_SECTION,
+ TARGET_EMUTLS_TMPL_SECTION, TARGET_EMUTLS_VAR_PREFIX,
+ TARGET_EMUTLS_TMPL_PREFIX, TARGET_EMUTLS_VAR_FIELDS,
+ TARGET_EMUTLS_VAR_INIT, TARGET_EMUTLS_DEBUG_FORM_TLS_ADDRESS,
+ TARGET_EMUTLS_VAR_ALIGN_FIXED, TARGET_EMUTLS): New.
+ (TARGET_INITIALIZER): Add TARGET_EMUTLS.
+ * builtins.def (BUILT_IN_EMUTLS_GET_ADDRESS,
+ BUILT_IN_EMUTLS_REGISTER_COMMON): Get name from targetm structure.
+ * dwarf2out.c (loc_descriptor_from_tree_1): Check if emutls can
+ emit debug information.
+ * coretypes.h (tls_model): Add TLS_MODEL_EMULATED, TLS_MODEL_REAL.
+ * varasm.c: Include targhooks.h.
+ (emutls_object_section, emutls_tmpl_section): New.
+ (EMUTLS_VAR_PREFIX, EMUTLS_TMPL_PREFIX): Remove.
+ (EMUTLS_SEPARATOR): New.
+ (prefix_name): New.
+ (get_emutls_object_name): New.
+ (default_emutls_var_fields): New, broken out of ...
+ (get_emutls_object_type): ... here. Adjust to use target hooks.
+ (get_emutls_init_templ_addr): Adjust to use target hooks.
+ (emutls_decl): Adjust to use target hooks.
+ (emutls_finish): Likewise.
+ (default_emutls_var_init): New, broken out of ...
+ (assemble_variable): ... here. Adjust to use target hooks.
+ * output.h (enum section_category): Add SECCAT_EMUTLS_VAR,
+ SECCAT_EMUTLS_TMPL.
+ * c-common.c (handle_section_attribute): Prevent overriding
+ sections for emulated tls with special sections.
+ * config/i386/i386.c (x86_64_elf_select_section): Add
+ SECCAT_EMUTLS_VAR and SECCAT_EMUTLS_TMPL.
+ (x86_64_elf_unique_section): Likewise.
+ * config/vxworks.c: Include tree.h.
+ (vxworks_emutls_var_fields, vxworks_emutls_var_init): New.
+ (vxworks_override_options): Set TLS scheme.
+ * doc/tm.texi (Emulated TLS): New node.
+
+2008-04-26 Simon Baldwin <simonb@google.com>
+
+ PR c/35652
+ * builtins.c (c_strlen): Suppressed multiple warnings that can occur
+ with propagated string constants.
+
+2008-04-26 Uros Bizjak <ubizjak@gmail.com>
+
+ * config/i386/i386.md (fix_trunc<mode>_i387_fisttp_with_temp): Use 'X'
+ constraint for operand 2 when operand 0 is memory operand.
+ (fix_truncdi_i387_with_temp): : Use 'X' constraint for operand 4 when
+ operand 0 is memory operand.
+ (fix_trunc<mode>_i387_with_temp): Ditto.
+ (*floatsi<mode>2_vector_mixed_with_temp): Use 'X' constraint for
+ operand 2 when operand 1 is memory operand.
+ (*float<SSEMODEI24:mode><MODEF:mode>2_mixed_with_temp): Ditto.
+ (*floatsi<mode>2_vector_sse_with_temp): Ditto.
+ (*float<SSEMODEI24:mode><MODEF:mode>2_sse_with_temp): Ditto.
+ (*float<SSEMODEI24:mode><X87MODEF:mode>2_i387_with_temp): Ditto.
+ (floatdi<X87MODEF:mode>2_i387_with_xmm): Use 'X' constraint for
+ operands 2,3 and 4 when operand 1 is memory operand.
+ (fistdi2_with_temp): Use 'X' constraint for operand 2 when operand 0
+ is memory operand.
+ (fistdi2_floor_with_temp): Ditto.
+ (fist<mode>2_floor_with_temp): Ditto.
+ (fistdi2_ceil_with_temp): Ditto.
+ (fist<mode>2_ceil_with_temp): Ditto.
+ (*truncdfsf_fast_mixed): Merge alternatives 0 and 1.
+
+2008-04-26 David Daney <ddaney@avtrex.com>
+
+ * config/mips/mips.md (UNSPEC_COMPARE_AND_SWAP_12): New
+ unspec_volitile.
+ (UNSPEC_SYNC_OLD_OP, UNSPEC_SYNC_NEW_OP, UNSPEC_SYNC_EXCHANGE,
+ UNSPEC_MEMORY_BARRIER, UNSPEC_SET_GOT_VERSION,
+ UNSPEC_UPDATE_GOT_VERSION): Renumber.
+ (sync_compare_and_swap<mode>): New expand for QI and HI modes.
+ (compare_and_swap_12): New insn.
+ * config/mips/mips-protos.h (mips_expand_compare_and_swap_12): Declare.
+ * config/mips/mips.c (mips_force_binary): New function.
+ (mips_emit_int_order_test, mips_expand_synci_loop): Use it.
+ (mips_expand_compare_and_swap_12): New function.
+ * config/mips/mips.h (MIPS_COMPARE_AND_SWAP_12): New macro.
+
+2008-04-25 Jan Hubicka <jh@suse.cz>
+
+ PR testsuite/35843
+ * cfgexpand.c (pass_expand): Turn into RTL pass.
+ * passes.c (execute_one_pass): Do pass typechecking after execution.
+ * tree-pass.h (pass_expand): Turn into RTL pass.
+
+ * function.h (struct rtl_data): Move here fields
+ accesses_prior_frames, calls_eh_return, saves_all_registers,
+ has_nonlocal_goto, has_asm_statement, is_thunk,
+ all_throwers_are_sibcalls, limit_stack, profile, uses_const_pool,
+ uses_pic_offset_table, uses_eh_lsda, tail_call_emit,
+ arg_pointer_save_area_init from struct function; turn into bool.
+ (struct function): Move
+ calls_eh_return, saves_all_registers, has_nonlocal_goto,
+ has_asm_statement, is_thunk, all_throwers_are_sibcalls, limit_stack,
+ profile, uses_const_pool, uses_pic_offset_table, uses_eh_lsda,
+ tail_call_emit, arg_pointer_save_area_init
+ into struct rtl_data. Remove recursive_call_emit and gimplified flags.
+ (current_function_returns_struct, current_function_returns_pcc_struct,
+ current_function_calls_setjmp, current_function_calls_alloca,
+ current_function_accesses_prior_frames,
+ current_function_calls_eh_return, current_function_is_thunk,
+ current_function_stdarg, current_function_profile,
+ current_function_limit_stack, current_function_uses_pic_offset_table,
+ current_function_uses_const_pool, current_function_has_nonlocal_label,
+ current_function_saves_all_registers,
+ current_function_has_nonlocal_goto,
+ current_function_has_asm_statement): Remove accesor macros.
+ * ra-conflict.c (global_conflicts): Update.
+ * tree-tailcall.c (suitable_for_tail_opt_p): Update.
+ (suitable_for_tail_call_opt_p): Update.
+ * builtins.c (expand_builtin_return_addr): Update.
+ (expand_builtin_setjmp_setup): Update.
+ (expand_builtin_nonlocal_goto): Update.
+ * final.c (final_start_function): Update.
+ (profile_function): Update.
+ (leaf_function_p): Update.
+ (only_leaf_regs_used): Update.
+ * df-scan.c (df_get_exit_block_use_set): Update.
+ * dojump.c (clear_pending_stack_adjust): Update.
+ * tree-stdarg.c (gate_optimize_stdarg): Update.
+ * gimple-low.c (lower_function_body): Update.
+ * global.c (compute_regsets): Update.
+ (global_alloc): Update.
+ * dwarf2out.c (dwarf2out_begin_prologue): Update.
+ * expr.c (expand_assignment): Update.
+ * dse.c (dse_step0): Update.
+ (dse_step1): Update.
+ * c-decl.c (store_parm_decls): Update.
+ * local-alloc.c (combine_regs): Update.
+ (find_free_reg): Update.
+ * function.c (assign_parms_augmented_arg_list): Update.
+ (assign_parm_find_data_types): Update.
+ (assign_parms): Update.
+ (allocate_struct_function): Update.
+ (expand_function_start): Update.
+ (expand_function_end): Update.
+ (get_arg_pointer_save_area): Update.
+ (thread_prologue_and_epilogue_insns): Update.
+ (rest_of_match_asm_constraints): Update.
+ * stor-layout.c (variable_size): Update.
+ * gcse.c (gcse_main): Update.
+ (bypass_jumps): Update.
+ * gimplify.c (gimplify_function_tree): Update.
+ * calls.c (emit_call_1): Update.
+ (expand_call): Update.
+ * bt-load.c (compute_defs_uses_and_gen): Update.
+ * except.c (sjlj_assign_call_site_values): Update.
+ (sjlj_emit_function_enter): Update.
+ (can_throw_external): Update.
+ (set_nothrow_function_flags): Update.
+ (expand_builtin_unwind_init): Update.
+ (expand_eh_return): Update.
+ (convert_to_eh_region_ranges): Update.
+ (output_function_exception_table): Update.
+ * emit-rtl.c (gen_tmp_stack_mem): Update.
+ * cfgexpand.c (expand_used_vars): Update.
+ (tree_expand_cfg): Update.
+ * cfgcleanup.c (rest_of_handle_jump): Update.
+ * explow.c (allocate_dynamic_stack_space): Update.
+ * varasm.c (assemble_start_function): Update.
+ (force_const_mem): Update.
+ (mark_constant_pool): Update.
+ * tree-optimize.c (tree_rest_of_compilation): Update.
+ * stack-ptr-mod.c (notice_stack_pointer_modification): Update.
+ * tree-cfg.c (notice_special_calls): Update.
+ (is_ctrl_altering_stmt): Update.
+ (tree_can_make_abnormal_goto): Update.
+ (tree_purge_dead_abnormal_call_edges): Update.
+ * config/alpha/predicates.md: Update.
+ * config/alpha/alpha.c (alpha_sa_mask): Update.
+ (alpha_sa_size): Update.
+ (alpha_does_function_need_gp): Update.
+ (alpha_expand_prologue): Update.
+ (alpha_start_function): Update.
+ (alpha_output_function_end_prologue): Update.
+ (alpha_expand_epilogue): Update.
+ * config/frv/frv.c (frv_stack_info): Update.
+ (frv_expand_epilogue): Update.
+ * config/s390/s390.c (s390_regs_ever_clobbered): Update.
+ (s390_register_info): Update.
+ (s390_frame_info): Update.
+ (s390_init_frame_layout): Update.
+ (s390_can_eliminate): Update.
+ (save_gprs): Update.
+ * config/spu/spu.c (spu_split_immediate): Update.
+ (need_to_save_reg): Update.
+ (spu_expand_prologue): Update.
+ (spu_expand_epilogue): Update.
+ * config/sparc/sparc.md: Update.
+ * config/sparc/sparc.c (eligible_for_return_delay): Update.
+ (sparc_tls_got): Update.
+ (legitimize_pic_address): Update.
+ (sparc_emit_call_insn): Update.
+ (sparc_expand_prologue): Update.
+ (output_return): Update.
+ (print_operand): Update.
+ (sparc_function_ok_for_sibcall): Update.
+ * config/sparc/sparc.h (EXIT_IGNORE_STACK): Update.
+ * config/m32r/m32r.md: Update.
+ * config/m32r/m32r.c (MUST_SAVE_RETURN_ADDR): Update.
+ (m32r_compute_frame_size): Update.
+ (m32r_expand_prologue): Update.
+ (m32r_expand_epilogue): Update.
+ (m32r_legitimize_pic_address): Update.
+ * config/m32r/m32r.h (FRAME_POINTER_REQUIRED): Update.
+ * config/i386/linux.h (SUBTARGET_FRAME_POINTER_REQUIRED): Update.
+ * config/i386/i386.c (ix86_frame_pointer_required): Update.
+ (gen_push): Update.
+ (ix86_save_reg): Update.
+ (ix86_compute_frame_layout): Update.
+ (ix86_expand_prologue): Update.
+ (ix86_expand_epilogue): Update.
+ * config/sh/sh.c (output_stack_adjust): Update.
+ (calc_live_regs): Update.
+ (sh5_schedule_saves): Update.
+ (sh_expand_prologue): Update.
+ (sh_expand_epilogue): Update.
+ (sh_setup_incoming_varargs): Update.
+ (sh_allocate_initial_value): Update.
+ (sh_get_pr_initial_val): Update.
+ * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): Update.
+ * config/sh/sh.md (label:): Update.
+ * config/avr/avr.c (out_movhi_mr_r): Update.
+ * config/crx/crx.h (enum): Update.
+ * config/xtensa/xtensa.h (along): Update.
+ * config/stormy16/stormy16.c Update.
+ (xstormy16_compute_stack_layout): Update.
+ * config/fr30/fr30.c (MUST_SAVE_RETURN_POINTER): Update.
+ (fr30_expand_prologue): Update.
+ * config/cris/cris.c (cris_conditional_register_usage): Update.
+ (cris_reg_saved_in_regsave_area): Update.
+ (cris_initial_frame_pointer_offset): Update.
+ (cris_simple_epilogue): Update.
+ (cris_expand_prologue): Update.
+ (cris_expand_epilogue): Update.
+ (cris_expand_pic_call_address): Update.
+ (cris_asm_output_symbol_ref): Update.
+ (cris_asm_output_label_ref): Update.
+ * config/cris/cris.md Update.
+ * config/iq2000/iq2000.c (compute_frame_size): Update.
+ (iq2000_expand_epilogue): Update.
+ * config/mt/mt.h (save_direction): Update.
+ * config/mn10300/mn10300.c (mn10300_function_value): Update.
+ * config/ia64/ia64.c (ia64_compute_frame_size): Update.
+ (ia64_secondary_reload_class): Update.
+ * config/m68k/m68k.c (m68k_save_reg): Update.
+ (m68k_expand_prologue): Update.
+ (m68k_expand_epilogue): Update.
+ (legitimize_pic_address): Update.
+ * config/rs6000/rs6000.c (rs6000_got_register): Update.
+ (first_reg_to_save): Update.
+ (first_altivec_reg_to_save): Update.
+ (compute_vrsave_mask): Update.
+ (compute_save_world_info): Update.
+ (rs6000_stack_info): Update.
+ (spe_func_has_64bit_regs_p): Update.
+ (rs6000_ra_ever_killed): Update.
+ (rs6000_emit_eh_reg_restore): Update.
+ (rs6000_emit_allocate_stack): Update.
+ (rs6000_emit_prologue): Update.
+ (rs6000_emit_epilogue): Update.
+ (rs6000_output_function_epilogue): Update.
+ (output_profile_hook): Update.
+ (rs6000_elf_declare_function_name): Update.
+ * config/rs6000/rs6000.h (rs6000_args): Update.
+ * config/rs6000/rs6000.md: Update.
+ * config/mcore/mcore.c (mcore_expand_prolog): Update.
+ * config/arc/arc.c (arc_output_function_epilogue): Update.
+ * config/arc/arc.h (FRAME_POINTER_REQUIRED): Update.
+ * config/darwin.c (machopic_function_base_name): Update.
+ * config/score/score3.c (score3_compute_frame_size): Update.
+ (rpush): Update.
+ (rpop): Update.
+ (score3_epilogue): Update.
+ * config/score/score7.c (score7_compute_frame_size): Update.
+ (score7_prologue): Update.
+ (score7_epilogue): Update.
+ * config/score/score.h (FRAME_POINTER_REQUIRED): Update.
+ * config/arm/linux-elf.h (SUBTARGET_FRAME_POINTER_REQUIRED): Update.
+ * config/arm/arm.c (use_return_insn): Update.
+ (require_pic_register): Update.
+ (arm_load_pic_register): Update.
+ (arm_compute_save_reg0_reg12_mask): Update.
+ (arm_compute_save_reg_mask): Update.
+ (thumb1_compute_save_reg_mask): Update.
+ (output_return_instruction): Update.
+ (arm_output_function_prologue): Update.
+ (arm_output_epilogue): Update.
+ (arm_get_frame_offsets): Update.
+ (arm_expand_prologue): Update.
+ (thumb_pushpop): Update.
+ (thumb_exit): Update.
+ (thumb1_expand_prologue): Update.
+ (thumb1_expand_epilogue): Update.
+ (arm_unwind_emit): Update.
+ (arm_output_fn_unwind): Update.
+ * config/arm/arm.h (FRAME_POINTER_REQUIRED): Update.
+ * config/arm/arm.md: Update.
+ * config/pa/pa.md: Update.
+ * config/pa/pa.c (legitimize_pic_address): Update.
+ (compute_frame_size): Update.
+ (hppa_expand_prologue): Update.
+ (hppa_expand_epilogue): Update.
+ (borx_reg_operand): Update.
+ * config/pa/pa.h (FRAME_POINTER_REQUIRED): Update.
+ (HARD_REGNO_RENAME_OK): Update.
+ * config/mips/mips.c (mips_global_pointer): Update.
+ (mips_save_reg_p): Update.
+ (mips_compute_frame_info): Update.
+ (mips_frame_pointer_required): Update.
+ (mips_expand_prologue): Update.
+ (mips_expand_epilogue): Update.
+ (mips_can_use_return_insn): Update.
+ (mips_reorg_process_insns): Update.
+ * config/v850/v850.c (compute_register_save_size): Update.
+ * config/mmix/mmix.h (FRAME_POINTER_REQUIRED): Update.
+ * config/mmix/mmix.c (along): Update.
+ (mmix_expand_epilogue): Update.
+ * config/bfin/bfin.c (legitimize_pic_address): Update.
+ (must_save_p): Update.
+ (stack_frame_needed_p): Update.
+ (add_to_reg): Update.
+ (bfin_expand_prologue): Update.
+ * stmt.c (expand_asm_operands): Update.
+ * reload1.c (reload): Update.
+ (init_elim_table): Update.
+
+2008-04-25 Bob Wilson <bob.wilson@acm.org>
+
+ * optabs.c (expand_float): Fix REG_EQUAL for UNSIGNED_FLOAT libcall.
+
+2008-04-25 H.J. Lu <hongjiu.lu@intel.com>
+
+ * config/i386/sse.md (mov<mode>): Replace SSEMODEI with SSEMODE.
+ (*mov<mode>_internal): Likewise. Support V4SF and V2DF.
+ (mov<mode>): Removed.
+ (*movv4sf_internal): Likewise.
+ (*movv2df_internal): Likewise.
+
+2008-04-25 Pompapathi V Gadad <Pompapathi.V.Gadad@nsc.com>
+
+ * config.gcc (crx-*-elf): Remove deprecation.
+
+2008-04-25 Danny Smith <dannysmith@users.sourceforge.net>
+
+ * config/i386/cygming-crtend.c (register_frame_ctor): Register
+ __gcc_deregister_frame with atexit.
+ (deregister_frame_dtor): Remove.
+
+2008-04-24 Nathan Froyd <froydnj@codesourcery.com>
+ Nathan Sidwell <nathan@codesourcery.com>
+
+ * config/rs6000/rs6000.opt (mspe): Remove Var property.
+ (misel): Likewise.
+ * config/rs6000/rs6000.h (rs6000_spe): Declare.
+ (rs6000_isel): Likewise.
+ * config/rs6000/rs6000.c (rs6000_spe): New variable.
+ (rs6000_isel): New variable.
+ (rs6000_handle_option): Handle OPT_mspe and OPT_misel.
+
+2008-04-24 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/35758
+ * c-common.c (handle_vector_size_attribute): Call
+ lang_hooks.types.reconstruct_complex_type instead of
+ reconstruct_complex_type.
+ * config/rs6000/rs6000.c (rs6000_handle_altivec_attribute): Likewise.
+ * config/spu/spu.c (spu_handle_vector_attribute): Likewise.
+ * langhooks.h (struct lang_hooks_for_types): Add
+ reconstruct_complex_type hook.
+ * langhooks-def.h (LANG_HOOKS_RECONSTRUCT_COMPLEX_TYPE): Define.
+ (LANG_HOOKS_FOR_TYPES_INITIALIZER): Add it.
+
+2008-04-24 Richard Guenther <rguenther@suse.de>
+
+ * c-common.h (check_builtin_function_arguments): Declare.
+ * c-common.c (validate_nargs): New function.
+ (check_builtin_function_arguments): Likewise.
+ * c-typeck.c (build_function_call): Call
+ check_builtin_function_arguments.
+ * builtins.c (fold_builtin_classify): Remove error reporting code.
+ (fold_builtin_unordered_cmp): Likewise.
+ (fold_builtin_1): Likewise.
+ (fold_builtin_n): Likewise.
+
+2008-04-24 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/36008
+ * fold-const.c (try_move_mult_to_index): If s == NULL, divide
+ the original op1, rather than delta by step.
+
+2008-04-22 Antoniu Pop <antoniu.pop@gmail.com>
+ Sebastian Pop <sebastian.pop@amd.com>
+
+ * tree-parloops.c (take_address_of, eliminate_local_variables_1,
+ eliminate_local_variables_stmt, eliminate_local_variables,
+ separate_decls_in_loop_name, separate_decls_in_loop_stmt,
+ separate_decls_in_loop, gen_parallel_loop): Make them work on a region
+ of code delimited by two edges in the CFG.
+ (separate_decls_in_loop_name): Renamed separate_decls_in_region_name.
+ (separate_decls_in_loop_stmt): Renamed separate_decls_in_region_stmt.
+ (separate_decls_in_loop): Renamed separate_decls_in_region. Isolate
+ the case of parallelisation of reductions.
+ (expr_invariant_in_region_p): New.
+
+ * tree-flow.h (gather_blocks_in_sese_region): Declared.
+ * tree-cfg.c (gather_blocks_in_sese_region): Extern.
+
+2008-04-24 Ira Rosen <irar@il.ibm.com>
+ Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/36034
+ * tree-vect-analyze.c (vect_analyze_group_access): SLP is
+ incapable of dealing with loads with gaps.
+
+2008-04-24 Rafael Espindola <espindola@google.com>
+
+ * tree-flow.h (vrp_evaluate_conditional): Change signature.
+ * tree-ssa-propagate.c (fold_predicate_in): Update call to
+ vrp_evaluate_conditional.
+ * tree-vrp.c (vrp_evaluate_conditional_warnv): Remove.
+ (vrp_evaluate_conditional): Split the cond argument.
+ (vrp_visit_cond_stmt): Use vrp_evaluate_conditional_warnv_with_ops.
+ (simplify_stmt_for_jump_threading): Update call to
+ vrp_evaluate_conditional.
+
+2008-04-24 Ira Rosen <irar@il.ibm.com>
+
+ PR tree-optimization/35982
+ * tree-vect-analyze.c (vect_check_interleaving): Check that the
+ interleaved data-refs are of the same type.
+
+2008-04-24 Danny Smith <dannysmith@users.net>
+
+ * c-format.c (check_format_info_main): Use strncmp rather than a
+ magic prefix to handle multichar length specs.
+ * config/i386/msformat-c.c (format_length_info ms_printf_length_specs):
+ Don't prefix "I64" and "I32" with '\0'.
+
+2008-04-24 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/36015
+ * config/i386/i386.c (init_cumulative_args): Don't pass anything
+ in registers for -m32 only if stdarg_p (fntype).
+
+2008-04-24 Uros Bizjak <ubizjak@gmail.com>
+
+ PR rtl-optimization/36006
+ * expmed.c (store_fixed_bit_field): Copy op0 rtx before moving
+ temp to op0 in order to avoid invalid rtx sharing.
+
+2008-04-23 Paolo Bonzini <bonzini@gnu.org>
+
+ * tree-cfg.c (verify_expr): Check with is_gimple_address. Don't
+ check TREE_INVARIANT.
+ * tree-gimple.c (is_gimple_address): New.
+ (is_gimple_invariant_address): Simplify using decl_address_invariant_p.
+ * tree-gimple.h (is_gimple_address): New.
+ * tree.h (decl_address_invariant_p): New.
+ * tree.c (make_node_stat): Don't set TREE_INVARIANT.
+ (build_string): Likewise.
+ (decl_address_invariant_p): New, from is_gimple_invariant_address.
+ (tree_invariant_p_1): Likewise.
+ (save_expr): Use it.
+ (tree_invariant_p): New.
+ (skip_simple_arithmetic): Use it.
+ (stabilize_reference_1): Use it.
+ (recompute_tree_invariant_for_addr_expr): Don't update TREE_INVARIANT,
+ simplify.
+ (build1_stat): Drop code to compute TREE_INVARIANT.
+ (build2_stat): Drop code to compute TREE_INVARIANT.
+ (build3_stat): Drop code to compute TREE_INVARIANT.
+ (build4_stat): Drop code to compute TREE_INVARIANT.
+ (build5_stat): Drop code to compute TREE_INVARIANT.
+ (build7_stat): Drop code to compute TREE_INVARIANT.
+ (merge_dllimport_decl_attributes): Don't mention TREE_INVARIANT.
+ * tree.h (struct tree_base): Remove invariant_flag.
+ (TREE_INVARIANT): Remove.
+ * builtins.c (build_string_literal): Don't set TREE_INVARIANT.
+ (fold_builtin_expect): Check TREE_CONSTANT.
+ * tree-ssa-ccp.c (fold_stmt_r): Adjust comment.
+ * c-tree.h (c_expr_to_decl): Drop third parameter.
+ * c-typeck.c (build_external_ref): Don't set TREE_INVARIANT.
+ (build_c_cast): Don't set TREE_INVARIANT.
+ (pop_init_level): Don't set TREE_INVARIANT.
+ (c_objc_common_truthvalue_conversion): Don't set TREE_INVARIANT.
+ * gimplify.c (gimplify_init_ctor_preeval): Add assertion, test
+ TREE_CONSTANT.
+ (gimplify_init_constructor): Don't set TREE_INVARIANT.
+ (gimplify_addr_expr): Adjust comment.
+ * tree-mudflap.c (mf_build_string):
+ * print-tree.c (print_node): Don't print TREE_INVARIANT.
+ * tree-nested.c (convert_nonlocal_reference): Adjust comment.
+ * c-common.c (fix_string_type): Don't set TREE_INVARIANT.
+ * langhooks-def.h (lhd_expr_to_decl): Drop third parameter.
+ * langhooks.c (lhd_expr_to_decl): Drop third parameter.
+ * langhooks.h (struct lang_hooks): Drop third parameter from
+ expr_to_decl.
+
+2008-04-23 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/27799
+ PR tree-optimization/32921
+ PR tree-optimization/32624
+ * tree-ssa-structalias.c (merge_smts_into): Only merge the
+ SMTs aliases and the tag itself into the solution.
+ * tree-ssa-alias.c (compute_flow_sensitive_aliasing): Do not
+ merge the points-to solution back into the SMT aliases.
+ (may_alias_p): Use alias_set_subset_of instead of
+ aliases_conflict_p. A pointer which points to
+ memory with alias set zero may access any variable.
+
+2008-04-23 Richard Guenther <rguenther@suse.de>
+
+ * alias.c (alias_set_subset_of): Correctly handle asking
+ if zero is a subset of an alias set with zero child.
+ * tree-ssa-alias.c (have_common_aliases_p): Simplify logic.
+ (compute_flow_insensitive_aliasing): Correctly walk all
+ pointers. Do not unnecessarily union sets.
+
+2008-04-23 Richard Guenther <rguenther@suse.de>
+
+ PR middle-end/36021
+ * c-common.c (handle_alloc_size_attribute): Use type_num_arguments.
+
+2008-04-22 Tomas Bily <tbily@suse.cz>
+
+ * tree-cfg.c (verify_expr): Check for NON_LVALUE_EXPR as
+ unreachable case.
+ * tree-vrp.c (extract_range_from_unary_expr): Removed unused
+ NON_LVALUE_EXPR.
+ * tree-ssa-threadedge.c (simplify_control_stmt_condition): Likewise.
+ * tree-ssa-structalias.c (get_constraint_for): Likewise.
+ * tree-inline.c (estimate_num_insns_1): Likewise.
+ * varasm.c (const_hash_1, compare_constant, copy_constant)
+ (compute_reloc_for_constant, output_addressed_constants): Likewise.
+ * emit-rtl.c (component_ref_for_mem_expr)
+ (set_mem_attributes_minus_bitpos): Likewise.
+ * expr.c (highest_pow2_factor, expand_expr_real_1, )
+ (is_aligning_offset): Likewise.
+ * dwarf2out.c (loc_descriptor_from_tree_1, add_bound_info): Likewise.
+ * tree-ssa-loop-ivopts.c (may_be_nonaddressable_p): Likewise.
+ * dojump.c (do_jump): Likewise.
+ * builtins.c (get_pointer_alignment, get_memory_rtx)
+ (integer_valued_real_p, fold_builtin_next_arg): Likewise.
+ * tree-scalar-evolution.c (instantiate_parameters_1): Likewise.
+
+2008-04-23 Jakub Jelinek <jakub@redhat.com>
+
+ PR rtl-optimization/36017
+ * builtins.c (expand_errno_check): Clear CALL_EXPR_TAILCALL before
+ expanding the library call.
+
+2008-04-22 Ian Lance Taylor <iant@google.com>
+
+ * fold-const.c (pointer_may_wrap_p): Call int_size_in_bytes rather
+ than size_in_bytes.
+
+2008-04-22 Pat Haugen <pthaugen@us.ibm.com>
+
+ * config/rs6000/rs6000.c (rs6000_register_move_cost): Increase cost
+ of LR/CTR moves for Power6.
+
+2008-04-22 Kenneth Zadeck <zadeck@naturalbridge.com>
+
+ PR middle-end/36003
+ * passes.c (init_optimization_passes): Remove
+ pass_fast_rtl_byte_dce.
+
+2008-04-22 Uros Bizjak <ubizjak@gmail.com>
+
+ PR target/29096
+ * config/i386/xmmintrin.h (_mm_cvtpi16_ps): Rearrange calls to
+ builtin functions to generate faster code.
+ (_mm_cvtpu16_ps): Ditto.
+ (_mm_cvtpi32x2_ps): Ditto.
+
+2008-04-22 Nick Clifton <nickc@redhat.com>
+
+ * common.opt (ftree-loop-distribution): Add Optimization
+ attribute.
+
+ * config/frv/frv.c (frv_stack_info): Use crtl instead of cfun.
+ (frv_expand_builtin_va_start): Likewise.
+
+ * config/arm/arm.c (thumb_find_work_register): Fix location of
+ argument register count.
+
+2008-04-22 Maxim Kuvyrkov <maxim@codesourcery.com>
+
+ Support scheduling for ColdFire V1 and V3 microarchitecture.
+ Improve scheduling of multiplication instructions.
+
+ * config/m68k/m68k.md (cpu): Add cfv1 and cfv3. Rename cf_v2 to cfv1.
+ (mac): New instruction attribute.
+ * config/m68k/m68k.c (override_options): Handle cfv1, cfv3 and mac.
+ (m68k_sched_mac): New variable.
+ (m68k_sched_attr_type2, m68k_sched_md_init_global): Update.
+ Handle cfv1 and cfv3.
+ (max_insn_size): New static variable.
+ (struct _sched_ib): New type.
+ (sched_ib): New static variable.
+ (sched_ib_size, sched_ib_filled, sched_ib_insn): Convert variables
+ to fields of 'struct _sched_ib sched_ib'. Update all uses.
+ (m68k_sched_variable_issue): Add modeling of cfv3 instruction buffer.
+ Update.
+ (m68k_sched_md_init_global, m68k_sched_md_finish_global,
+ m68k_sched_md_init, m68k_sched_md_finish): Handle cfv1 and cfv3. Init
+ new variables. Update.
+ (m68k_sched_dfa_pre_advance_cycle, m68k_sched_dfa_post_advance_cycle):
+ Add modeling of cfv3 instruction buffer. Update.
+ * config/m68k/m68k-protos.h (m68k_sched_mac): Declare.
+ * config/m68k/m68k.h (TUNE_CFV3): New macro.
+ * config/m68k/cf.md: Change substrings 'cf_v2' to 'cfv12' or 'cfv123'.
+ (cf_* reservations): Rename to cfv12 or cfv123 to indicate cores
+ a particular reservation applies to.
+ (type2): Reorganize attribute values. Rename alu to alu_reg,
+ alu_l to alu, move_l to omove. Join move to alu. Split mul
+ to mul_l and mul_w.
+ (cf_ib_*): Simplify description of instruction buffer.
+ (cf_ib_w0, cf_ib_w4, cf_ib_w5, cf_ib_w6): Remove.
+ (cf_mem): Split into cf_mem1 and cf_mem2.
+ (cf_v2_move_??): Rename to cfv12_alu_??.
+ (cf_v2_move_l_??): Rename to cfv12_omove_??.
+ (cf_v2_mul_??): Remove reservations.
+ (cfv12_mul_l_??, cfv12_mul_w_??, cfv12_mac_w_??, cfv12_mac_l_??,
+ cfv12_emac_??, cfv12_emac_w_i0): New reservations.
+ (cfv12_rts, cfv12_call, cfv12_bcc, cfv12_bra, cfv12_jmp): Move to
+ appropriate place.
+ (cfv3_alu_10, cfv3_omove_10, cfv3_alu_i0, cfv3_omove_i0, cfv3_alu_01,
+ cfv3_alu_0i, cfv3_alu_11, cfv3_omove_11, cfv3_alu_i1, cfv3_omove_i1,
+ cfv3_alu_1i, cfv3_omove_1i, cfv3_pea_11, cfv3_pea_i1, cfv3_mul_w_10,
+ cfv3_mul_l_10, cfv3_mul_w_i0, cfv3_mac_w_10, cfv3_mac_l_10,
+ cfv3_mac_w_i0, cfv3_emac_10, cfv3_emac_w_i0, cfv3_rts, cfv3_call,
+ cfv3_bcc, cfv3_bra, cfv3_jmp): New reservations.
+ (cfv3_*_1, cfv3_*_2, cfv3_*_3): New instruction reservations that are
+ expansions of the above reservations for instructions of sizes
+ 1, 2 and 3 words.
+
+2008-04-22 Maxim Kuvyrkov <maxim@codesourcery.com>
+
+ * rtl-factoring.c (collect_patterns_seqs): Handle CC0 targets.
+
+2008-04-21 Adam Nemet <anemet@caviumnetworks.com>
+
+ * coverage.c: Include tree-pass.h.
+ (coverage_counter_alloc): Print da_file_name to the dump file.
+
+2008-04-21 Kenneth Zadeck <zadeck@naturalbridge.com>
+
* sbitmap.c (sbitmap_range_empty_p): New function.
* sbitmap.h (sbitmap_range_empty_p): New function.
- * bitmap.h: Now includes obstack.h.
+ * bitmap.h: Now includes obstack.h.
-
-2008-04-24 Richard Sandiford <rsandifo@nildram.co.uk>
+2008-04-21 Richard Sandiford <rsandifo@nildram.co.uk>
Kenneth Zadeck <zadeck@naturalbridge.com>
* dbgcnt.def (ra_byte_scan): Added.
@@ -41,7 +1386,7 @@
df_entry_block_defs_collect, df_exit_block_uses_collect):
Added mode parameter to calls to df_ref_record, df_uses_record,
df_ref_create_structure.
- (df_ref_equal_p, df_ref_compare): Added test for modes.
+ (df_ref_equal_p, df_ref_compare): Added test for modes.
(df_ref_create_structure): Added code to set mode. Renamed
DF_REF_WIDTH and DF_REF_OFFSET to DF_REF_EXTRACT_WIDTH and
DF_REF_EXTRACT_OFFSET.
@@ -73,7 +1418,6 @@
(rtl_opt_pass pass_fast_rtl_byte_dce): New pass.
* Makefile.in (df-byte-scan.o, debugcnt.o): Added dependencies.
-
2008-04-21 Daniel Franke <franke.daniel@gmail.com>
PR fortran/35019
@@ -1494,10 +2838,7 @@
2008-04-01 George Helffrich <george@gcc.gnu.org>
- PR fortran/PR35154, fortran/PR23057
- * fortran/trans-common.c (create_common): Add decl to function
- chain to preserve identifier scope in debug output.
-
+ PR fortran/35154, fortran/23057
* dbxout.c: Emit .stabs debug info for Fortran COMMON block
variables as base symbol name + offset using N_BCOMM/N_ECOMM.
(is_fortran, dbxout_common_name, dbxout_common_check): New functions.
@@ -1515,18 +2856,6 @@
(common_check): New function to check whether symbol in Fortran COMMON.
(gen_variable_die): If COMMON, use DW_TAG_common_block.
- * testsuite/gcc.dg/debug/pr35154.c: New test to check that non-Fortran
- use of common is unchanged.
-
- * testsuite/lib/gfortran-dg.exp: New harness to compile Fortran progs
- with all combinations of debug options available on target.
- * testsuite/gfortran.dg/debug/debug.exp: Ditto.
- * testsuite/gfortran.dg/debug/trivial.f: Ditto.
- * testsuite/gfortran.dg/debug/pr35154-stabs.f: New test case for
- .stabs functionality.
- * testsuite/gfortran.dg/debug/pr35154-dwarf2.f: New test case for
- DWARF functionality.
-
2008-04-01 Volker Reichelt <v.reichelt@netcologne.de>
PR c/35436
@@ -1898,6 +3227,7 @@
2008-03-28 Nick Clifton <nickc@redhat.com>
+ PR target/31110
* config/mn10300/mn10300.c (mn10300_secondary_reload_class):
Return GENERAL_REGS for stack adjustment reloads.
@@ -5343,7 +6673,6 @@
* config/spu/spu-builtins.def: Fixed wrong parameter type in spu
intrinsics spu_convts, spu_convtu, spu_convtf.
- * testsuite/gcc.target/spu/intrinsics-3.c: New. Test error messages.
2008-02-08 Hans-Peter Nilsson <hp@axis.com>
diff --git a/gcc/ChangeLog.melt b/gcc/ChangeLog.melt
index 8650f2d9b58..2622ff574e8 100644
--- a/gcc/ChangeLog.melt
+++ b/gcc/ChangeLog.melt
@@ -1,3 +1,8 @@
+2008-05-06 Basile Starynkevitch <basile@starynkevitch.net>
+ * tree-passes.h: MERGED WITH TRUNK r134973
+
+ * passes.c: MERGED WITH TRUNK r134973
+
2008-05-05 Basile Starynkevitch <basile@starynkevitch.net>
* melt/warm-basilys.bysl: (create_normcontext) fill the initial
predefmap with symbols using (fill_initial_predefmap). Added the
diff --git a/gcc/DATESTAMP b/gcc/DATESTAMP
index ee0488b1f15..e3bdbf9ff0e 100644
--- a/gcc/DATESTAMP
+++ b/gcc/DATESTAMP
@@ -1 +1 @@
-20080421
+20080506
diff --git a/gcc/Makefile.in b/gcc/Makefile.in
index 9082b715f4a..4698a9c51f8 100644
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -2053,7 +2053,7 @@ tree-ssa-forwprop.o : tree-ssa-forwprop.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
$(TM_H) $(GGC_H) $(TREE_H) $(RTL_H) $(TM_P_H) $(BASIC_BLOCK_H) \
$(TREE_FLOW_H) tree-pass.h $(TREE_DUMP_H) $(DIAGNOSTIC_H) $(TIMEVAR_H) \
langhooks.h $(FLAGS_H)
-tree-ssa-phiprop.o : tree-ssa-forwprop.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
+tree-ssa-phiprop.o : tree-ssa-phiprop.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
$(TM_H) $(GGC_H) $(TREE_H) $(RTL_H) $(TM_P_H) $(BASIC_BLOCK_H) \
$(TREE_FLOW_H) tree-pass.h $(TREE_DUMP_H) $(DIAGNOSTIC_H) $(TIMEVAR_H) \
langhooks.h $(FLAGS_H)
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 79f8440982c..ae31fb49963 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,79 @@
+2008-05-05 Eric Botcazou <ebotcazou@adacore.com>
+
+ * decl.c (maybe_pad_type): Add ??? comment.
+
+2008-05-03 Eric Botcazou <ebotcazou@adacore.com>
+
+ * decl.c (components_to_record): Zero the alignment of the qualified
+ union built for the variant part upon creating it.
+
+2008-05-03 Eric Botcazou <ebotcazou@adacore.com>
+
+ * decl.c (maybe_pad_type): Try to get a form of the type with integral
+ mode even if the alignment is not a factor of the original size. But
+ make sure to create the inner field with the original size. Reorder.
+ * trans.c (addressable_p) <COMPONENT_REF>: Treat the field of a padding
+ record as always addressable.
+ * utils.c (convert): Deal specially with conversions between original
+ and packable versions of a record type.
+ * utils2.c (build_binary_op) <MODIFY_EXPR>: Be more restrictive when
+ recognizing an assignment between padded objects.
+
+2008-05-01 Eric Botcazou <ebotcazou@adacore.com>
+
+ * decl.c (make_packable_type): Resize the last component to its RM size
+ only if it is of an aggregate type.
+ * trans.c (call_to_gnu): Fix nit in comment.
+ (gnat_to_gnu): Likewise.
+
+2008-04-30 Samuel Tardieu <sam@rfc1149.net>
+
+ * Makefile.in: Adapt sh4-linux target.
+
+2008-04-29 Ed Schonberg <schonberg@adacore.com>
+
+ PR ada/35792
+ * sem_ch3.adb (Find_Type_Name): Refuse completion of an incomplete
+ tagged type by an untagged protected or task type.
+
+2008-04-28 Eric Botcazou <ebotcazou@adacore.com>
+ Tristan Gingold <gingold@adacore.com>
+
+ PR ada/36007
+ * decl.c (gnat_to_gnu_entity) <object>: Do not promote alignment
+ of aliased objects with an unconstrained nominal subtype.
+ Cap the promotion to the effective alignment of the word mode.
+
+2008-04-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
+
+ * Make-lang.in (ada.tags, check-acats, ada/treeprs.ads)
+ (ada/einfo.h, ada/sinfo.h, ada/nmake.adb, ada/nmake.ads):
+ Use '&&' instead of ';'.
+
+2008-04-24 Olivier Hainque <hainque@adacore.com>
+
+ * trans.c (Attribute_to_gnu) <case Attr_Length>: Length computation
+ doesn't require signed arithmetic anymore.
+
+2008-04-23 Paolo Bonzini <bonzini@gnu.org>
+
+ * trans.c (Attribute_to_gnu): Don't set TREE_INVARIANT.
+ (call_to_gnu): Don't set TREE_INVARIANT.
+ * utils2.c (gnat_build_constructor): Don't set TREE_INVARIANT.
+
+2008-04-22 Joel Sherrill <joel.sherrill@oarcorp.com>
+
+ * s-osinte-rtems.adb: Add sigalstack function.
+ * s-osinte-rtems.ads: Add SO_ONSTACK and sigalstack
+ function. Add Alternate_Stack and Alternate_Stack_Size.
+ Add missing process_shared field to pthread_condattr_t
+ and change ss_low_priority to int from timespec.
+
+2008-04-22 Samuel Tardieu <sam@rfc1149.net>
+
+ * i-forbla.adb: Link against -llapack and -lblas by default
+ instead of the private -lgnalasup.
+
2008-04-21 Olivier Hainque <hainque@adacore.com>
Access to most C builtins from Ada
diff --git a/gcc/ada/Make-lang.in b/gcc/ada/Make-lang.in
index 498904136cc..5f631b59ba9 100644
--- a/gcc/ada/Make-lang.in
+++ b/gcc/ada/Make-lang.in
@@ -1,6 +1,6 @@
# Top level -*- makefile -*- fragment for GNU Ada (GNAT).
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
+# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
#This file is part of GCC.
@@ -390,7 +390,7 @@ ada.srcextra:
ada.srcman:
ada.tags: force
- cd $(srcdir)/ada; etags -o TAGS.sub *.c *.h *.ads *.adb; \
+ cd $(srcdir)/ada && etags -o TAGS.sub *.c *.h *.ads *.adb && \
etags --include TAGS.sub --include ../TAGS.sub
@@ -852,8 +852,8 @@ ACATSDIR = $(TESTSUITEDIR)/ada/acats
check-acats:
test -d $(ACATSDIR) || mkdir -p $(ACATSDIR)
- testdir=`cd ${srcdir}/${ACATSDIR}; ${PWD_COMMAND}`; \
- export testdir; cd $(ACATSDIR); $(SHELL) $${testdir}/run_acats $(CHAPTERS)
+ testdir=`cd ${srcdir}/${ACATSDIR} && ${PWD_COMMAND}`; \
+ export testdir; cd $(ACATSDIR) && $(SHELL) $${testdir}/run_acats $(CHAPTERS)
.PHONY: check-acats
@@ -926,31 +926,31 @@ ada/treeprs.ads : ada/treeprs.adt ada/sinfo.ads ada/xtreeprs.adb
-$(MKDIR) ada/bldtools/treeprs
$(RM) $(addprefix ada/bldtools/treeprs/,$(notdir $^))
$(CP) $^ ada/bldtools/treeprs
- (cd ada/bldtools/treeprs; $(GNATMAKE) -q xtreeprs ; ./xtreeprs ../../treeprs.ads )
+ (cd ada/bldtools/treeprs && $(GNATMAKE) -q xtreeprs && ./xtreeprs ../../treeprs.ads )
ada/einfo.h : ada/einfo.ads ada/einfo.adb ada/xeinfo.adb
-$(MKDIR) ada/bldtools/einfo
$(RM) $(addprefix ada/bldtools/einfo/,$(notdir $^))
$(CP) $^ ada/bldtools/einfo
- (cd ada/bldtools/einfo; $(GNATMAKE) -q xeinfo ; ./xeinfo ../../einfo.h )
+ (cd ada/bldtools/einfo && $(GNATMAKE) -q xeinfo && ./xeinfo ../../einfo.h )
ada/sinfo.h : ada/sinfo.ads ada/xsinfo.adb
-$(MKDIR) ada/bldtools/sinfo
$(RM) $(addprefix ada/bldtools/sinfo/,$(notdir $^))
$(CP) $^ ada/bldtools/sinfo
- (cd ada/bldtools/sinfo; $(GNATMAKE) -q xsinfo ; ./xsinfo ../../sinfo.h )
+ (cd ada/bldtools/sinfo && $(GNATMAKE) -q xsinfo && ./xsinfo ../../sinfo.h )
ada/nmake.adb : ada/sinfo.ads ada/nmake.adt ada/xnmake.adb
-$(MKDIR) ada/bldtools/nmake_b
$(RM) $(addprefix ada/bldtools/nmake_b/,$(notdir $^))
$(CP) $^ ada/bldtools/nmake_b
- (cd ada/bldtools/nmake_b; $(GNATMAKE) -q xnmake ; ./xnmake -b ../../nmake.adb )
+ (cd ada/bldtools/nmake_b && $(GNATMAKE) -q xnmake && ./xnmake -b ../../nmake.adb )
ada/nmake.ads : ada/sinfo.ads ada/nmake.adt ada/xnmake.adb ada/nmake.adb
-$(MKDIR) ada/bldtools/nmake_s
$(RM) $(addprefix ada/bldtools/nmake_s/,$(notdir $^))
$(CP) $^ ada/bldtools/nmake_s
- (cd ada/bldtools/nmake_s; $(GNATMAKE) -q xnmake ; ./xnmake -s ../../nmake.ads )
+ (cd ada/bldtools/nmake_s && $(GNATMAKE) -q xnmake && ./xnmake -s ../../nmake.ads )
update-sources : ada/treeprs.ads ada/einfo.h ada/sinfo.h ada/nmake.adb \
ada/nmake.ads
diff --git a/gcc/ada/Makefile.in b/gcc/ada/Makefile.in
index f03776d5681..4ec544f757f 100644
--- a/gcc/ada/Makefile.in
+++ b/gcc/ada/Makefile.in
@@ -1530,13 +1530,14 @@ ifeq ($(strip $(filter-out sh4% linux%,$(arch) $(osys))),)
a-intnam.ads<a-intnam-linux.ads \
s-inmaop.adb<s-inmaop-posix.adb \
s-intman.adb<s-intman-posix.adb \
+ s-linux.ads<s-linux.ads \
s-osinte.adb<s-osinte-posix.adb \
s-osinte.ads<s-osinte-linux.ads \
s-osprim.adb<s-osprim-posix.adb \
s-taprop.adb<s-taprop-linux.adb \
s-tasinf.ads<s-tasinf-linux.ads \
s-tasinf.adb<s-tasinf-linux.adb \
- s-taspri.ads<s-taspri-posix.ads \
+ s-taspri.ads<s-taspri-posix-noaltstack.ads \
s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
system.ads<system-linux-sh4.ads
@@ -1544,6 +1545,7 @@ ifeq ($(strip $(filter-out sh4% linux%,$(arch) $(osys))),)
mlib-tgt-specific.adb<mlib-tgt-linux.adb \
indepsw.adb<indepsw-linux.adb
+ EXTRA_GNATRTL_TASKING_OBJS=s-linux.o
EH_MECHANISM=-gcc
MISCLIB=
THREADSLIB = -lpthread
diff --git a/gcc/ada/decl.c b/gcc/ada/decl.c
index e60b4434843..6e144927ef8 100644
--- a/gcc/ada/decl.c
+++ b/gcc/ada/decl.c
@@ -685,6 +685,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
&& kind != E_Exception
&& kind != E_Out_Parameter
&& Is_Composite_Type (Etype (gnat_entity))
+ && !Is_Constr_Subt_For_UN_Aliased (Etype (gnat_entity))
&& !imported_p
&& No (Renamed_Object (gnat_entity))
&& No (Address_Clause (gnat_entity))))
@@ -694,7 +695,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
to support BIGGEST_ALIGNMENT if we don't really have to. */
unsigned int align_cap = Is_Atomic (gnat_entity)
? BIGGEST_ALIGNMENT
- : MAX_FIXED_MODE_SIZE;
+ : get_mode_alignment (word_mode);
if (!host_integerp (TYPE_SIZE (gnu_type), 1)
|| compare_tree_int (TYPE_SIZE (gnu_type), align_cap) >= 0)
@@ -5447,9 +5448,9 @@ make_packable_type (tree type, bool in_record)
new_type = make_node (TREE_CODE (type));
- /* Copy the name and flags from the old type to that of the new. Note
- that we rely on the pointer equality created here for TYPE_NAME at
- the end of gnat_to_gnu. */
+ /* Copy the name and flags from the old type to that of the new.
+ Note that we rely on the pointer equality created here for
+ TYPE_NAME to look through conversions in various places. */
TYPE_NAME (new_type) = TYPE_NAME (type);
TYPE_JUSTIFIED_MODULAR_P (new_type) = TYPE_JUSTIFIED_MODULAR_P (type);
TYPE_CONTAINS_TEMPLATE_P (new_type) = TYPE_CONTAINS_TEMPLATE_P (type);
@@ -5486,9 +5487,8 @@ make_packable_type (tree type, bool in_record)
TYPE_USER_ALIGN (new_type) = 1;
- /* Now copy the fields, keeping the position and size as we don't
- want to propagate packedness downward. But make an exception
- for the last field in order to ditch the padding bits. */
+ /* Now copy the fields, keeping the position and size as we don't want
+ to change the layout by propagating the packedness downwards. */
for (old_field = TYPE_FIELDS (type); old_field;
old_field = TREE_CHAIN (old_field))
{
@@ -5502,8 +5502,18 @@ make_packable_type (tree type, bool in_record)
&& host_integerp (TYPE_SIZE (new_field_type), 1))
new_field_type = make_packable_type (new_field_type, true);
- if (!TREE_CHAIN (old_field) && !TYPE_PACKED (type))
- new_size = rm_size (new_field_type);
+ /* However, for the last field in a not already packed record type
+ that is of an aggregate type, we need to use the RM_Size in the
+ packable version of the record type, see finish_record_type. */
+ if (!TREE_CHAIN (old_field)
+ && !TYPE_PACKED (type)
+ && (TREE_CODE (new_field_type) == RECORD_TYPE
+ || TREE_CODE (new_field_type) == UNION_TYPE
+ || TREE_CODE (new_field_type) == QUAL_UNION_TYPE)
+ && !TYPE_IS_FAT_POINTER_P (new_field_type)
+ && !TYPE_CONTAINS_TEMPLATE_P (new_field_type)
+ && TYPE_ADA_SIZE (new_field_type))
+ new_size = TYPE_ADA_SIZE (new_field_type);
else
new_size = DECL_SIZE (old_field);
@@ -5566,7 +5576,7 @@ make_packable_type (tree type, bool in_record)
GNAT_ENTITY and NAME_TRAILER are used to name the resulting record and
to issue a warning.
- IS_USER_TYPE is true if we must be sure we complete the original type.
+ IS_USER_TYPE is true if we must complete the original type.
DEFINITION is true if this type is being defined.
@@ -5624,59 +5634,71 @@ maybe_pad_type (tree type, tree size, unsigned int align,
if (align == 0 && !size)
return type;
+ /* If requested, complete the original type and give it a name. */
+ if (is_user_type)
+ create_type_decl (get_entity_name (gnat_entity), type,
+ NULL, !Comes_From_Source (gnat_entity),
+ !(TYPE_NAME (type)
+ && TREE_CODE (TYPE_NAME (type)) == TYPE_DECL
+ && DECL_IGNORED_P (TYPE_NAME (type))),
+ gnat_entity);
+
/* We used to modify the record in place in some cases, but that could
generate incorrect debugging information. So make a new record
type and name. */
record = make_node (RECORD_TYPE);
+ TYPE_IS_PADDING_P (record) = 1;
if (Present (gnat_entity))
TYPE_NAME (record) = create_concat_name (gnat_entity, name_trailer);
- /* If we were making a type, complete the original type and give it a
- name. */
- if (is_user_type)
- create_type_decl (get_entity_name (gnat_entity), type,
- NULL, !Comes_From_Source (gnat_entity),
- !(TYPE_NAME (type)
- && TREE_CODE (TYPE_NAME (type)) == TYPE_DECL
- && DECL_IGNORED_P (TYPE_NAME (type))),
- gnat_entity);
+ TYPE_VOLATILE (record)
+ = Present (gnat_entity) && Treat_As_Volatile (gnat_entity);
+
+ TYPE_ALIGN (record) = align;
+ if (orig_align)
+ TYPE_USER_ALIGN (record) = align;
+
+ TYPE_SIZE (record) = size ? size : orig_size;
+ TYPE_SIZE_UNIT (record)
+ = convert (sizetype,
+ size_binop (CEIL_DIV_EXPR, TYPE_SIZE (record),
+ bitsize_unit_node));
/* If we are changing the alignment and the input type is a record with
BLKmode and a small constant size, try to make a form that has an
- integral mode. That might allow this record to have an integral mode,
- which will be much more efficient. There is no point in doing this if a
- size is specified unless it is also smaller than the maximum mode size
- and it is incorrect to do this if the size of the original type is not a
- multiple of the alignment. */
+ integral mode. This might allow the padding record to also have an
+ integral mode, which will be much more efficient. There is no point
+ in doing so if a size is specified unless it is also a small constant
+ size and it is incorrect to do so if we cannot guarantee that the mode
+ will be naturally aligned since the field must always be addressable.
+
+ ??? This might not always be a win when done for a stand-alone object:
+ since the nominal and the effective type of the object will now have
+ different modes, a VIEW_CONVERT_EXPR will be required for converting
+ between them and it might be hard to overcome afterwards, including
+ at the RTL level when the stand-alone object is accessed as a whole. */
if (align != 0
&& TREE_CODE (type) == RECORD_TYPE
&& TYPE_MODE (type) == BLKmode
&& TREE_CODE (orig_size) == INTEGER_CST
+ && !TREE_CONSTANT_OVERFLOW (orig_size)
&& compare_tree_int (orig_size, MAX_FIXED_MODE_SIZE) <= 0
&& (!size
|| (TREE_CODE (size) == INTEGER_CST
- && compare_tree_int (size, MAX_FIXED_MODE_SIZE) <= 0))
- && value_factor_p (orig_size, align))
- type = make_packable_type (type, true);
+ && compare_tree_int (size, MAX_FIXED_MODE_SIZE) <= 0)))
+ {
+ tree packable_type = make_packable_type (type, true);
+ if (TYPE_MODE (packable_type) != BLKmode
+ && align >= TYPE_ALIGN (packable_type))
+ type = packable_type;
+ }
+ /* Now create the field with the original size. */
field = create_field_decl (get_identifier ("F"), type, record, 0,
- NULL_TREE, bitsize_zero_node, 1);
-
+ orig_size, bitsize_zero_node, 1);
DECL_INTERNAL_P (field) = 1;
- TYPE_SIZE (record) = size ? size : orig_size;
- TYPE_SIZE_UNIT (record)
- = (size ? convert (sizetype,
- size_binop (CEIL_DIV_EXPR, size, bitsize_unit_node))
- : TYPE_SIZE_UNIT (type));
-
- TYPE_ALIGN (record) = align;
- if (orig_align)
- TYPE_USER_ALIGN (record) = align;
- TYPE_IS_PADDING_P (record) = 1;
- TYPE_VOLATILE (record)
- = Present (gnat_entity) && Treat_As_Volatile (gnat_entity);
/* Do not finalize it until after the auxiliary record is built. */
finish_record_type (record, field, 1, true);
@@ -6306,6 +6328,7 @@ components_to_record (tree gnu_record_type, Node_Id component_list,
= make_node (unchecked_union ? UNION_TYPE : QUAL_UNION_TYPE);
TYPE_NAME (gnu_union_type) = gnu_union_name;
+ TYPE_ALIGN (gnu_union_type) = 0;
TYPE_PACKED (gnu_union_type) = TYPE_PACKED (gnu_record_type);
}
diff --git a/gcc/ada/i-forbla.adb b/gcc/ada/i-forbla.adb
index f54497d9413..bda6084262f 100644
--- a/gcc/ada/i-forbla.adb
+++ b/gcc/ada/i-forbla.adb
@@ -32,12 +32,13 @@
------------------------------------------------------------------------------
-- This Interfaces.Fortran.Blas package body contains the required linker
--- pragmas for automatically linking with the gnalasup linear algebra support
+-- pragmas for automatically linking with the LAPACK linear algebra support
-- library, and the systems math library. Alternative bodies can be supplied
-- if different sets of libraries are needed.
package body Interfaces.Fortran.BLAS is
pragma Linker_Options ("-lgnala");
- pragma Linker_Options ("-lgnalasup");
+ pragma Linker_Options ("-llapack");
+ pragma Linker_Options ("-lblas");
pragma Linker_Options ("-lm");
end Interfaces.Fortran.BLAS;
diff --git a/gcc/ada/s-osinte-rtems.adb b/gcc/ada/s-osinte-rtems.adb
index 494947cbd7f..1e4efbc351d 100644
--- a/gcc/ada/s-osinte-rtems.adb
+++ b/gcc/ada/s-osinte-rtems.adb
@@ -135,4 +135,13 @@ package body System.OS_Interface is
return 0;
end Get_Page_Size;
+ function sigaltstack
+ (ss : not null access stack_t;
+ oss : access stack_t) return int is
+ pragma Unreferenced (ss);
+ pragma Unreferenced (oss);
+ begin
+ return 0;
+ end sigaltstack;
+
end System.OS_Interface;
diff --git a/gcc/ada/s-osinte-rtems.ads b/gcc/ada/s-osinte-rtems.ads
index f28e14d3083..8d5483b6c38 100644
--- a/gcc/ada/s-osinte-rtems.ads
+++ b/gcc/ada/s-osinte-rtems.ads
@@ -35,17 +35,21 @@
-- --
------------------------------------------------------------------------------
--- This is the RTEMS version of this package
-
--- These are guesses based on what I think the GNARL team will want to
--- call the rtems configurations. We use CPU-rtems for the rtems
--- configurations.
+-- This is the RTEMS version of this package.
+--
+-- RTEMS target names are of the form CPU-rtems.
+-- This implementation is designed to work on ALL RTEMS targets.
+-- The RTEMS implementation is primarily based upon the POSIX threads
+-- API but there are also bindings to GNAT/RTEMS support routines
+-- to insulate this code from C API specific details and, in some
+-- cases, obtain target architecture and BSP specific information
+-- that is unavailable at the time this package is built.
-- This package encapsulates all direct interfaces to OS services
-- that are needed by children of System.
-- PLEASE DO NOT add any with-clauses to this package
--- or remove the pragma Elaborate_Body.
+-- or remove the pragma Preelaborate.
-- It is designed to be a bottom-level (leaf) package.
with Interfaces.C;
@@ -141,6 +145,11 @@ package System.OS_Interface is
SA_SIGINFO : constant := 16#02#;
+ SA_ONSTACK : constant := 16#00#;
+ -- SA_ONSTACK is not defined on RTEMS, but it is refered to in the POSIX
+ -- implementation of System.Interrupt_Management. Therefore we define a
+ -- dummy value of zero here so that setting this flag is a nop.
+
SIG_BLOCK : constant := 1;
SIG_UNBLOCK : constant := 2;
SIG_SETMASK : constant := 3;
@@ -249,6 +258,23 @@ package System.OS_Interface is
-- Stack --
-----------
+ type stack_t is record
+ ss_sp : System.Address;
+ ss_flags : int;
+ ss_size : size_t;
+ end record;
+ pragma Convention (C, stack_t);
+
+ function sigaltstack
+ (ss : not null access stack_t;
+ oss : access stack_t) return int;
+
+ Alternate_Stack : aliased System.Address;
+ -- This is a dummy definition, never used (Alternate_Stack_Size is null)
+
+ Alternate_Stack_Size : constant := 0;
+ -- No alternate signal stack is used on this platform
+
Stack_Base_Available : constant Boolean := False;
-- Indicates whether the stack base is available on this target.
-- This allows us to share s-osinte.adb between all the FSU/RTEMS
@@ -386,7 +412,7 @@ package System.OS_Interface is
type struct_sched_param is record
sched_priority : int;
- ss_low_priority : timespec;
+ ss_low_priority : int;
ss_replenish_period : timespec;
ss_initial_budget : timespec;
end record;
@@ -512,7 +538,8 @@ private
pragma Convention (C, pthread_attr_t);
type pthread_condattr_t is record
- flags : int;
+ flags : int;
+ process_shared : int;
end record;
pragma Convention (C, pthread_condattr_t);
diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb
index 103eb75fbe5..d050d1b0505 100644
--- a/gcc/ada/sem_ch3.adb
+++ b/gcc/ada/sem_ch3.adb
@@ -13046,13 +13046,26 @@ package body Sem_Ch3 is
if Is_Type (Prev)
and then (Is_Tagged_Type (Prev)
or else Present (Class_Wide_Type (Prev)))
- and then not Nkind_In (N, N_Task_Type_Declaration,
- N_Protected_Type_Declaration)
then
- -- The full declaration is either a tagged record or an
- -- extension otherwise this is an error
+ -- The full declaration is either a tagged type (including
+ -- a synchronized type that implements interfaces) or a
+ -- type extension, otherwise this is an error.
+
+ if Nkind_In (N, N_Task_Type_Declaration,
+ N_Protected_Type_Declaration)
+ then
+ if No (Interface_List (N))
+ and then not Error_Posted (N)
+ then
+ Error_Msg_NE
+ ("full declaration of } must be a tagged type ", Id, Prev);
+ end if;
+
+ elsif Nkind (Type_Definition (N)) = N_Record_Definition then
+
+ -- Indicate that the previous declaration (tagged incomplete
+ -- or private declaration) requires the same on the full one.
- if Nkind (Type_Definition (N)) = N_Record_Definition then
if not Tagged_Present (Type_Definition (N)) then
Error_Msg_NE
("full declaration of } must be tagged", Prev, Id);
diff --git a/gcc/ada/trans.c b/gcc/ada/trans.c
index a6492c50269..5ec3ecdd013 100644
--- a/gcc/ada/trans.c
+++ b/gcc/ada/trans.c
@@ -202,7 +202,7 @@ static tree emit_range_check (tree, Node_Id);
static tree emit_index_check (tree, tree, tree, tree);
static tree emit_check (tree, tree, int);
static tree convert_with_check (Entity_Id, tree, bool, bool, bool);
-static bool larger_record_type_p (tree, tree);
+static bool smaller_packable_type_p (tree, tree);
static bool addressable_p (tree, tree);
static tree assoc_to_constructor (Entity_Id, Node_Id, tree);
static tree extract_values (tree, tree);
@@ -886,7 +886,6 @@ Attribute_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, int attribute)
t = build2 (FDESC_EXPR, TREE_TYPE (gnu_field), gnu_prefix,
build_int_cst (NULL_TREE, i));
TREE_CONSTANT (t) = 1;
- TREE_INVARIANT (t) = 1;
}
else
t = build3 (COMPONENT_REF, ptr_void_ftype, gnu_result,
@@ -1235,9 +1234,16 @@ Attribute_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, int attribute)
}
else
{
- tree gnu_compute_type
- = signed_or_unsigned_type_for
- (0, get_base_type (gnu_result_type));
+ /* We used to compute the length as max (hb - lb + 1, 0),
+ which could overflow for some cases of empty arrays, e.g.
+ when lb == index_type'first. We now compute the length as
+ (hb < lb) ? 0 : hb - lb + 1, which would only overflow in
+ much rarer cases, for extremely large arrays we expect
+ never to encounter in practice. In addition, the former
+ computation required the use of potentially constraining
+ signed arithmetic while the latter doesn't. */
+
+ tree gnu_compute_type = get_base_type (gnu_result_type);
tree index_type
= TYPE_INDEX_TYPE (TYPE_DOMAIN (gnu_type));
@@ -1246,14 +1252,6 @@ Attribute_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, int attribute)
tree hb
= convert (gnu_compute_type, TYPE_MAX_VALUE (index_type));
- /* We used to compute the length as max (hb - lb + 1, 0),
- which could overflow for some cases of empty arrays, e.g.
- when lb == index_type'first.
-
- We now compute it as (hb < lb) ? 0 : hb - lb + 1, which
- could overflow as well, but only for extremely large arrays
- which we expect never to encounter in practice. */
-
gnu_result
= build3
(COND_EXPR, gnu_compute_type,
@@ -1280,7 +1278,6 @@ Attribute_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, int attribute)
gnu_result
= build1 (SAVE_EXPR, TREE_TYPE (gnu_result), gnu_result);
TREE_SIDE_EFFECTS (gnu_result) = 1;
- TREE_INVARIANT (gnu_result) = 1;
if (attribute == Attr_First)
pa->first = gnu_result;
else if (attribute == Attr_Last)
@@ -2207,11 +2204,11 @@ call_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, tree gnu_target)
of the object if they are distinct, because the expectations
of the callee would otherwise not be met:
- if it's a justified modular type,
- - if the actual type is a packed version of it. */
+ - if the actual type is a smaller packable version of it. */
else if (TREE_CODE (gnu_name_type) == RECORD_TYPE
&& (TYPE_JUSTIFIED_MODULAR_P (gnu_name_type)
- || larger_record_type_p (gnu_name_type,
- TREE_TYPE (gnu_name))))
+ || smaller_packable_type_p (TREE_TYPE (gnu_name),
+ gnu_name_type)))
gnu_name = convert (gnu_name_type, gnu_name);
/* Make a SAVE_EXPR to both properly account for potential side
@@ -2220,7 +2217,6 @@ call_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, tree gnu_target)
used as the object and copied back after the call if needed. */
gnu_name = build1 (SAVE_EXPR, TREE_TYPE (gnu_name), gnu_name);
TREE_SIDE_EFFECTS (gnu_name) = 1;
- TREE_INVARIANT (gnu_name) = 1;
/* Set up to move the copy back to the original. */
if (Ekind (gnat_formal) != E_In_Parameter)
@@ -4906,7 +4902,7 @@ gnat_to_gnu (Node_Id gnat_node)
type wrong due to "instantiating" the unconstrained record with
discriminant values. Similarly, if the two types are record types
with the same name don't convert. This will be the case when we are
- converting from a packed version of a type to its original type and
+ converting from a packable version of a type to its original type and
we need those conversions to be NOPs in order for assignments into
these types to work properly.
@@ -6124,21 +6120,25 @@ convert_with_check (Entity_Id gnat_type, tree gnu_expr, bool overflowp,
return convert (gnu_type, gnu_result);
}
-/* Return true if RECORD_TYPE, a record type, is larger than TYPE. */
+/* Return true if TYPE is a smaller packable version of RECORD_TYPE. */
static bool
-larger_record_type_p (tree record_type, tree type)
+smaller_packable_type_p (tree type, tree record_type)
{
- tree rsize, size;
+ tree size, rsize;
- /* Padding types are not considered larger on their own. */
- if (TYPE_IS_PADDING_P (record_type))
+ /* We're not interested in variants here. */
+ if (TYPE_MAIN_VARIANT (type) == TYPE_MAIN_VARIANT (record_type))
+ return false;
+
+ /* Like a variant, a packable version keeps the original TYPE_NAME. */
+ if (TYPE_NAME (type) != TYPE_NAME (record_type))
return false;
- rsize = TYPE_SIZE (record_type);
size = TYPE_SIZE (type);
+ rsize = TYPE_SIZE (record_type);
- if (!(TREE_CODE (rsize) == INTEGER_CST && TREE_CODE (size) == INTEGER_CST))
+ if (!(TREE_CODE (size) == INTEGER_CST && TREE_CODE (rsize) == INTEGER_CST))
return false;
return tree_int_cst_lt (size, rsize) != 0;
@@ -6212,7 +6212,7 @@ addressable_p (tree gnu_expr, tree gnu_type)
to be considered in practice. */
if (gnu_type
&& TREE_CODE (gnu_type) == RECORD_TYPE
- && larger_record_type_p (gnu_type, TREE_TYPE (gnu_expr)))
+ && smaller_packable_type_p (TREE_TYPE (gnu_expr), gnu_type))
return false;
switch (TREE_CODE (gnu_expr))
@@ -6242,16 +6242,18 @@ addressable_p (tree gnu_expr, tree gnu_type)
&& addressable_p (TREE_OPERAND (gnu_expr, 2), NULL_TREE));
case COMPONENT_REF:
- return (!DECL_BIT_FIELD (TREE_OPERAND (gnu_expr, 1))
- && (!STRICT_ALIGNMENT
- /* Even with DECL_BIT_FIELD cleared, we have to ensure that
- the field is sufficiently aligned, in case it is subject
- to a pragma Component_Alignment. But we don't need to
- check the alignment of the containing record, as it is
- guaranteed to be not smaller than that of its most
- aligned field that is not a bit-field. */
- || DECL_ALIGN (TREE_OPERAND (gnu_expr, 1))
- >= TYPE_ALIGN (TREE_TYPE (gnu_expr)))
+ return (((!DECL_BIT_FIELD (TREE_OPERAND (gnu_expr, 1))
+ /* Even with DECL_BIT_FIELD cleared, we have to ensure that
+ the field is sufficiently aligned, in case it is subject
+ to a pragma Component_Alignment. But we don't need to
+ check the alignment of the containing record, as it is
+ guaranteed to be not smaller than that of its most
+ aligned field that is not a bit-field. */
+ && (!STRICT_ALIGNMENT
+ || DECL_ALIGN (TREE_OPERAND (gnu_expr, 1))
+ >= TYPE_ALIGN (TREE_TYPE (gnu_expr))))
+ /* The field of a padding record is always addressable. */
+ || TYPE_IS_PADDING_P (TREE_TYPE (TREE_OPERAND (gnu_expr, 0))))
&& addressable_p (TREE_OPERAND (gnu_expr, 0), NULL_TREE));
case ARRAY_REF: case ARRAY_RANGE_REF:
diff --git a/gcc/ada/utils.c b/gcc/ada/utils.c
index d6a2234e747..8d3df68fe40 100644
--- a/gcc/ada/utils.c
+++ b/gcc/ada/utils.c
@@ -3396,7 +3396,9 @@ convert (tree type, tree expr)
&& TYPE_IS_PADDING_P (type) && TYPE_IS_PADDING_P (etype)
&& (!TREE_CONSTANT (TYPE_SIZE (type))
|| !TREE_CONSTANT (TYPE_SIZE (etype))
- || gnat_types_compatible_p (type, etype)))
+ || gnat_types_compatible_p (type, etype)
+ || TYPE_NAME (TREE_TYPE (TYPE_FIELDS (type)))
+ == TYPE_NAME (TREE_TYPE (TYPE_FIELDS (etype)))))
;
/* If the output type has padding, convert to the inner type and
@@ -3405,9 +3407,13 @@ convert (tree type, tree expr)
{
/* If we previously converted from another type and our type is
of variable size, remove the conversion to avoid the need for
- variable-size temporaries. */
+ variable-size temporaries. Likewise for a conversion between
+ original and packable version. */
if (TREE_CODE (expr) == VIEW_CONVERT_EXPR
- && !TREE_CONSTANT (TYPE_SIZE (type)))
+ && (!TREE_CONSTANT (TYPE_SIZE (type))
+ || (ecode == RECORD_TYPE
+ && TYPE_NAME (etype)
+ == TYPE_NAME (TREE_TYPE (TREE_OPERAND (expr, 0))))))
expr = TREE_OPERAND (expr, 0);
/* If we are just removing the padding from expr, convert the original
@@ -3419,7 +3425,10 @@ convert (tree type, tree expr)
&& TYPE_IS_PADDING_P (TREE_TYPE (TREE_OPERAND (expr, 0)))
&& (!TREE_CONSTANT (TYPE_SIZE (type))
|| gnat_types_compatible_p (type,
- TREE_TYPE (TREE_OPERAND (expr, 0)))))
+ TREE_TYPE (TREE_OPERAND (expr, 0)))
+ || (ecode == RECORD_TYPE
+ && TYPE_NAME (etype)
+ == TYPE_NAME (TREE_TYPE (TYPE_FIELDS (type))))))
return convert (type, TREE_OPERAND (expr, 0));
/* If the result type is a padded type with a self-referentially-sized
@@ -3534,8 +3543,12 @@ convert (tree type, tree expr)
case CONSTRUCTOR:
/* If we are converting a CONSTRUCTOR to a mere variant type, just make
- a new one in the proper type. */
- if (gnat_types_compatible_p (type, etype))
+ a new one in the proper type. Likewise for a conversion between
+ original and packable version. */
+ if (code == ecode
+ && (gnat_types_compatible_p (type, etype)
+ || (code == RECORD_TYPE
+ && TYPE_NAME (type) == TYPE_NAME (etype))))
{
expr = copy_node (expr);
TREE_TYPE (expr) = type;
@@ -3617,7 +3630,8 @@ convert (tree type, tree expr)
/* If we're converting between two aggregate types that are mere
variants, just make a VIEW_CONVERT_EXPR. */
- else if (AGGREGATE_TYPE_P (type)
+ else if (code == ecode
+ && AGGREGATE_TYPE_P (type)
&& gnat_types_compatible_p (type, etype))
return build1 (VIEW_CONVERT_EXPR, type, expr);
diff --git a/gcc/ada/utils2.c b/gcc/ada/utils2.c
index 877959d946c..b45c7aca107 100644
--- a/gcc/ada/utils2.c
+++ b/gcc/ada/utils2.c
@@ -693,21 +693,24 @@ build_binary_op (enum tree_code op_code, tree result_type,
&& TYPE_ALIGN_OK (right_type))
operation_type = right_type;
- /* If we are copying between padded objects of the same underlying
- type with a non-zero size, use the padded view of the type, this
- is very likely more efficient; but gnat_to_gnu will have removed
- the padding on the RHS so we have to make sure that we can safely
- put it back. */
+ /* If we are copying between padded objects with compatible types, use
+ the padded view of the objects, this is very likely more efficient.
+ Likewise for a padded that is assigned a constructor, in order to
+ avoid putting a VIEW_CONVERT_EXPR on the LHS. But don't do this if
+ we wouldn't have actually copied anything. */
else if (TREE_CODE (left_type) == RECORD_TYPE
&& TYPE_IS_PADDING_P (left_type)
- && TREE_TYPE (TYPE_FIELDS (left_type)) == right_type
- && !integer_zerop (TYPE_SIZE (right_type))
+ && TREE_CONSTANT (TYPE_SIZE (left_type))
&& ((TREE_CODE (right_operand) == COMPONENT_REF
&& TREE_CODE (TREE_TYPE (TREE_OPERAND (right_operand, 0)))
== RECORD_TYPE
&& TYPE_IS_PADDING_P
- (TREE_TYPE (TREE_OPERAND (right_operand, 0))))
- || TREE_CODE (right_operand) == CONSTRUCTOR))
+ (TREE_TYPE (TREE_OPERAND (right_operand, 0)))
+ && gnat_types_compatible_p
+ (left_type,
+ TREE_TYPE (TREE_OPERAND (right_operand, 0))))
+ || TREE_CODE (right_operand) == CONSTRUCTOR)
+ && !integer_zerop (TYPE_SIZE (right_type)))
operation_type = left_type;
/* Find the best type to use for copying between aggregate types. */
@@ -1671,8 +1674,7 @@ gnat_build_constructor (tree type, tree list)
}
result = build_constructor_from_list (type, list);
- TREE_CONSTANT (result) = TREE_INVARIANT (result)
- = TREE_STATIC (result) = allconstant;
+ TREE_CONSTANT (result) = TREE_STATIC (result) = allconstant;
TREE_SIDE_EFFECTS (result) = side_effects;
TREE_READONLY (result) = TYPE_READONLY (type) || allconstant;
return result;
diff --git a/gcc/alias.c b/gcc/alias.c
index 2e4f5aebdb4..b29abf70324 100644
--- a/gcc/alias.c
+++ b/gcc/alias.c
@@ -305,8 +305,9 @@ alias_set_subset_of (alias_set_type set1, alias_set_type set2)
/* Otherwise, check if set1 is a subset of set2. */
ase = get_alias_set_entry (set2);
if (ase != 0
- && (splay_tree_lookup (ase->children,
- (splay_tree_key) set1)))
+ && ((ase->has_zero_child && set1 == 0)
+ || splay_tree_lookup (ase->children,
+ (splay_tree_key) set1)))
return true;
return false;
}
@@ -739,9 +740,8 @@ record_alias_subset (alias_set_type superset, alias_set_type subset)
/* Record that component types of TYPE, if any, are part of that type for
aliasing purposes. For record types, we only record component types
- for fields that are marked addressable. For array types, we always
- record the component types, so the front end should not call this
- function if the individual component aren't addressable. */
+ for fields that are not marked non-addressable. For array types, we
+ only record the component type if it is not marked non-aliased. */
void
record_component_aliases (tree type)
@@ -755,7 +755,7 @@ record_component_aliases (tree type)
switch (TREE_CODE (type))
{
case ARRAY_TYPE:
- if (! TYPE_NONALIASED_COMPONENT (type))
+ if (!TYPE_NONALIASED_COMPONENT (type))
record_alias_subset (superset, get_alias_set (TREE_TYPE (type)));
break;
@@ -774,7 +774,7 @@ record_component_aliases (tree type)
get_alias_set (BINFO_TYPE (base_binfo)));
}
for (field = TYPE_FIELDS (type); field != 0; field = TREE_CHAIN (field))
- if (TREE_CODE (field) == FIELD_DECL && ! DECL_NONADDRESSABLE_P (field))
+ if (TREE_CODE (field) == FIELD_DECL && !DECL_NONADDRESSABLE_P (field))
record_alias_subset (superset, get_alias_set (TREE_TYPE (field)));
break;
diff --git a/gcc/bt-load.c b/gcc/bt-load.c
index 188faeb4f74..6feefbbf7af 100644
--- a/gcc/bt-load.c
+++ b/gcc/bt-load.c
@@ -508,7 +508,7 @@ compute_defs_uses_and_gen (fibheap_t all_btr_defs, btr_def *def_array,
note_other_use_this_block (regno, info.users_this_bb);
}
/* Check for the blockage emitted by expand_nl_goto_receiver. */
- else if (current_function_has_nonlocal_label
+ else if (cfun->has_nonlocal_label
&& GET_CODE (PATTERN (insn)) == UNSPEC_VOLATILE)
{
btr_user user;
diff --git a/gcc/builtins.c b/gcc/builtins.c
index d5c4f9222c9..2cb8fa03f9e 100644
--- a/gcc/builtins.c
+++ b/gcc/builtins.c
@@ -281,7 +281,6 @@ get_pointer_alignment (tree exp, unsigned int max_align)
{
case NOP_EXPR:
case CONVERT_EXPR:
- case NON_LVALUE_EXPR:
exp = TREE_OPERAND (exp, 0);
if (! POINTER_TYPE_P (TREE_TYPE (exp)))
return align;
@@ -448,7 +447,12 @@ c_strlen (tree src, int only_value)
runtime. */
if (offset < 0 || offset > max)
{
- warning (0, "offset outside bounds of constant string");
+ /* Suppress multiple warnings for propagated constant strings. */
+ if (! TREE_NO_WARNING (src))
+ {
+ warning (0, "offset outside bounds of constant string");
+ TREE_NO_WARNING (src) = 1;
+ }
return NULL_TREE;
}
@@ -588,7 +592,7 @@ expand_builtin_return_addr (enum built_in_function fndecl_code, int count)
tem = hard_frame_pointer_rtx;
/* Tell reload not to eliminate the frame pointer. */
- current_function_accesses_prior_frames = 1;
+ crtl->accesses_prior_frames = 1;
}
#endif
@@ -691,10 +695,10 @@ expand_builtin_setjmp_setup (rtx buf_addr, rtx receiver_label)
/* Tell optimize_save_area_alloca that extra work is going to
need to go on during alloca. */
- current_function_calls_setjmp = 1;
+ cfun->calls_setjmp = 1;
/* We have a nonlocal label. */
- current_function_has_nonlocal_label = 1;
+ cfun->has_nonlocal_label = 1;
}
/* Construct the trailing part of a __builtin_setjmp call. This is
@@ -878,7 +882,7 @@ expand_builtin_nonlocal_goto (tree exp)
r_sp = gen_rtx_MEM (STACK_SAVEAREA_MODE (SAVE_NONLOCAL),
plus_constant (r_save_area, GET_MODE_SIZE (Pmode)));
- current_function_has_nonlocal_goto = 1;
+ crtl->has_nonlocal_goto = 1;
#ifdef HAVE_nonlocal_goto
/* ??? We no longer need to pass the static chain value, afaik. */
@@ -1073,8 +1077,7 @@ get_memory_rtx (tree exp, tree len)
/* Get an expression we can use to find the attributes to assign to MEM.
If it is an ADDR_EXPR, use the operand. Otherwise, dereference it if
we can. First remove any nops. */
- while ((TREE_CODE (exp) == NOP_EXPR || TREE_CODE (exp) == CONVERT_EXPR
- || TREE_CODE (exp) == NON_LVALUE_EXPR)
+ while ((TREE_CODE (exp) == NOP_EXPR || TREE_CODE (exp) == CONVERT_EXPR)
&& POINTER_TYPE_P (TREE_TYPE (TREE_OPERAND (exp, 0))))
exp = TREE_OPERAND (exp, 0);
@@ -1106,7 +1109,6 @@ get_memory_rtx (tree exp, tree len)
while (TREE_CODE (inner) == ARRAY_REF
|| TREE_CODE (inner) == NOP_EXPR
|| TREE_CODE (inner) == CONVERT_EXPR
- || TREE_CODE (inner) == NON_LVALUE_EXPR
|| TREE_CODE (inner) == VIEW_CONVERT_EXPR
|| TREE_CODE (inner) == SAVE_EXPR)
inner = TREE_OPERAND (inner, 0);
@@ -1804,6 +1806,9 @@ expand_errno_check (tree exp, rtx target)
}
#endif
+ /* Make sure the library call isn't expanded as a tail call. */
+ CALL_EXPR_TAILCALL (exp) = 0;
+
/* We can't set errno=EDOM directly; let the library call do it.
Pop the arguments right away in case the call gets deleted. */
NO_DEFER_POP;
@@ -5236,7 +5241,6 @@ build_string_literal (int len, const char *str)
type = build_array_type (elem, index);
TREE_TYPE (t) = type;
TREE_CONSTANT (t) = 1;
- TREE_INVARIANT (t) = 1;
TREE_READONLY (t) = 1;
TREE_STATIC (t) = 1;
@@ -7150,7 +7154,7 @@ fold_builtin_expect (tree arg0, tree arg1)
}
/* If the argument isn't invariant then there's nothing else we can do. */
- if (!TREE_INVARIANT (arg0))
+ if (!TREE_CONSTANT (arg0))
return NULL_TREE;
/* If we expect that a comparison against the argument will fold to
@@ -7262,7 +7266,6 @@ integer_valued_real_p (tree t)
case ABS_EXPR:
case SAVE_EXPR:
- case NON_LVALUE_EXPR:
return integer_valued_real_p (TREE_OPERAND (t, 0));
case COMPOUND_EXPR:
@@ -9647,11 +9650,7 @@ fold_builtin_classify (tree fndecl, tree arg, int builtin_index)
REAL_VALUE_TYPE r;
if (!validate_arg (arg, REAL_TYPE))
- {
- error ("non-floating-point argument to function %qs",
- IDENTIFIER_POINTER (DECL_NAME (fndecl)));
- return error_mark_node;
- }
+ return NULL_TREE;
switch (builtin_index)
{
@@ -9735,12 +9734,6 @@ fold_builtin_unordered_cmp (tree fndecl, tree arg0, tree arg1,
cmp_type = type0;
else if (code0 == INTEGER_TYPE && code1 == REAL_TYPE)
cmp_type = type1;
- else
- {
- error ("non-floating-point argument to function %qs",
- IDENTIFIER_POINTER (DECL_NAME (fndecl)));
- return error_mark_node;
- }
arg0 = fold_convert (cmp_type, arg0);
arg1 = fold_convert (cmp_type, arg1);
@@ -10089,15 +10082,6 @@ fold_builtin_1 (tree fndecl, tree arg0, bool ignore)
case BUILT_IN_ISNAND128:
return fold_builtin_classify (fndecl, arg0, BUILT_IN_ISNAN);
- case BUILT_IN_ISNORMAL:
- if (!validate_arg (arg0, REAL_TYPE))
- {
- error ("non-floating-point argument to function %qs",
- IDENTIFIER_POINTER (DECL_NAME (fndecl)));
- return error_mark_node;
- }
- break;
-
case BUILT_IN_PRINTF:
case BUILT_IN_PRINTF_UNLOCKED:
case BUILT_IN_VPRINTF:
@@ -10443,55 +10427,8 @@ fold_builtin_4 (tree fndecl, tree arg0, tree arg1, tree arg2, tree arg3,
static tree
fold_builtin_n (tree fndecl, tree *args, int nargs, bool ignore)
{
- enum built_in_function fcode = DECL_FUNCTION_CODE (fndecl);
tree ret = NULL_TREE;
- /* Verify the number of arguments for type-generic and thus variadic
- builtins. */
- switch (fcode)
- {
- case BUILT_IN_ISFINITE:
- case BUILT_IN_ISINF:
- case BUILT_IN_ISNAN:
- case BUILT_IN_ISNORMAL:
- if (nargs < 1)
- {
- error ("too few arguments to function %qs",
- IDENTIFIER_POINTER (DECL_NAME (fndecl)));
- return error_mark_node;
- }
- else if (nargs > 1)
- {
- error ("too many arguments to function %qs",
- IDENTIFIER_POINTER (DECL_NAME (fndecl)));
- return error_mark_node;
- }
- break;
-
- case BUILT_IN_ISGREATER:
- case BUILT_IN_ISGREATEREQUAL:
- case BUILT_IN_ISLESS:
- case BUILT_IN_ISLESSEQUAL:
- case BUILT_IN_ISLESSGREATER:
- case BUILT_IN_ISUNORDERED:
- if (nargs < 2)
- {
- error ("too few arguments to function %qs",
- IDENTIFIER_POINTER (DECL_NAME (fndecl)));
- return error_mark_node;
- }
- else if (nargs > 2)
- {
- error ("too many arguments to function %qs",
- IDENTIFIER_POINTER (DECL_NAME (fndecl)));
- return error_mark_node;
- }
- break;
-
- default:
- break;
- }
-
switch (nargs)
{
case 0:
@@ -10616,6 +10553,7 @@ fold_call_expr (tree exp, bool ignore)
if (CAN_HAVE_LOCATION_P (realret)
&& !EXPR_HAS_LOCATION (realret))
SET_EXPR_LOCATION (realret, EXPR_LOCATION (exp));
+ return realret;
}
return ret;
}
@@ -11432,7 +11370,6 @@ fold_builtin_next_arg (tree exp, bool va_start_p)
parameters. */
while (TREE_CODE (arg) == NOP_EXPR
|| TREE_CODE (arg) == CONVERT_EXPR
- || TREE_CODE (arg) == NON_LVALUE_EXPR
|| TREE_CODE (arg) == INDIRECT_REF)
arg = TREE_OPERAND (arg, 0);
if (arg != last_parm)
diff --git a/gcc/builtins.def b/gcc/builtins.def
index dd6741e29b3..722f81c7e3e 100644
--- a/gcc/builtins.def
+++ b/gcc/builtins.def
@@ -745,8 +745,16 @@ DEF_BUILTIN_STUB (BUILT_IN_PROFILE_FUNC_ENTER, "profile_func_enter")
DEF_BUILTIN_STUB (BUILT_IN_PROFILE_FUNC_EXIT, "profile_func_exit")
/* TLS emulation. */
-DEF_EXT_LIB_BUILTIN (BUILT_IN_EMUTLS_GET_ADDRESS, "__emutls_get_address", BT_FN_PTR_PTR, ATTR_CONST_NOTHROW_NONNULL)
-DEF_EXT_LIB_BUILTIN (BUILT_IN_EMUTLS_REGISTER_COMMON, "__emutls_register_common", BT_FN_VOID_PTR_WORD_WORD_PTR, ATTR_NOTHROW_LIST)
+DEF_BUILTIN (BUILT_IN_EMUTLS_GET_ADDRESS, targetm.emutls.get_address,
+ BUILT_IN_NORMAL,
+ BT_FN_PTR_PTR, BT_FN_PTR_PTR,
+ true, true, true, ATTR_CONST_NOTHROW_NONNULL, false,
+ !targetm.have_tls)
+DEF_BUILTIN (BUILT_IN_EMUTLS_REGISTER_COMMON,
+ targetm.emutls.register_common, BUILT_IN_NORMAL,
+ BT_FN_VOID_PTR_WORD_WORD_PTR, BT_FN_VOID_PTR_WORD_WORD_PTR,
+ true, true, true, ATTR_NOTHROW_LIST, false,
+ !targetm.have_tls)
/* Synchronization Primitives. */
#include "sync-builtins.def"
diff --git a/gcc/c-common.c b/gcc/c-common.c
index 351c62831d3..58585239680 100644
--- a/gcc/c-common.c
+++ b/gcc/c-common.c
@@ -944,7 +944,6 @@ fix_string_type (tree value)
TREE_TYPE (value) = a_type;
TREE_CONSTANT (value) = 1;
- TREE_INVARIANT (value) = 1;
TREE_READONLY (value) = 1;
TREE_STATIC (value) = 1;
return value;
@@ -5477,6 +5476,13 @@ handle_section_attribute (tree *node, tree ARG_UNUSED (name), tree args,
*node);
*no_add_attrs = true;
}
+ else if (TREE_CODE (decl) == VAR_DECL
+ && !targetm.have_tls && targetm.emutls.tmpl_section
+ && DECL_THREAD_LOCAL_P (decl))
+ {
+ error ("section of %q+D cannot be overridden", *node);
+ *no_add_attrs = true;
+ }
else
DECL_SECTION_NAME (decl) = TREE_VALUE (args);
}
@@ -5941,12 +5947,7 @@ static tree
handle_alloc_size_attribute (tree *node, tree ARG_UNUSED (name), tree args,
int ARG_UNUSED (flags), bool *no_add_attrs)
{
- tree params = TYPE_ARG_TYPES (*node);
- unsigned arg_count = 0;
-
- for (; TREE_CHAIN (params); params = TREE_CHAIN (params))
- arg_count ++;
-
+ unsigned arg_count = type_num_arguments (*node);
for (; args; args = TREE_CHAIN (args))
{
tree position = TREE_VALUE (args);
@@ -6176,7 +6177,7 @@ handle_vector_size_attribute (tree *node, tree name, tree args,
new_type = build_vector_type (type, nunits);
/* Build back pointers if needed. */
- *node = reconstruct_complex_type (*node, new_type);
+ *node = lang_hooks.types.reconstruct_complex_type (*node, new_type);
return NULL_TREE;
}
@@ -6637,6 +6638,85 @@ check_function_arguments_recurse (void (*callback)
(*callback) (ctx, param, param_num);
}
+/* Checks the number of arguments NARGS against the required number
+ REQUIRED and issues an error if there is a mismatch. Returns true
+ if the number of arguments is correct, otherwise false. */
+
+static bool
+validate_nargs (tree fndecl, int nargs, int required)
+{
+ if (nargs < required)
+ {
+ error ("not enough arguments to function %qE", fndecl);
+ return false;
+ }
+ else if (nargs > required)
+ {
+ error ("too many arguments to function %qE", fndecl);
+ return false;
+ }
+ return true;
+}
+
+/* Verifies the NARGS arguments ARGS to the builtin function FNDECL.
+ Returns false if there was an error, otherwise true. */
+
+bool
+check_builtin_function_arguments (tree fndecl, int nargs, tree *args)
+{
+ if (!DECL_BUILT_IN (fndecl)
+ || DECL_BUILT_IN_CLASS (fndecl) != BUILT_IN_NORMAL)
+ return true;
+
+ switch (DECL_FUNCTION_CODE (fndecl))
+ {
+ case BUILT_IN_CONSTANT_P:
+ return validate_nargs (fndecl, nargs, 1);
+
+ case BUILT_IN_ISFINITE:
+ case BUILT_IN_ISINF:
+ case BUILT_IN_ISNAN:
+ case BUILT_IN_ISNORMAL:
+ if (validate_nargs (fndecl, nargs, 1))
+ {
+ if (TREE_CODE (TREE_TYPE (args[0])) != REAL_TYPE)
+ {
+ error ("non-floating-point argument in call to "
+ "function %qE", fndecl);
+ return false;
+ }
+ return true;
+ }
+ return false;
+
+ case BUILT_IN_ISGREATER:
+ case BUILT_IN_ISGREATEREQUAL:
+ case BUILT_IN_ISLESS:
+ case BUILT_IN_ISLESSEQUAL:
+ case BUILT_IN_ISLESSGREATER:
+ case BUILT_IN_ISUNORDERED:
+ if (validate_nargs (fndecl, nargs, 2))
+ {
+ enum tree_code code0, code1;
+ code0 = TREE_CODE (TREE_TYPE (args[0]));
+ code1 = TREE_CODE (TREE_TYPE (args[1]));
+ if (!((code0 == REAL_TYPE && code1 == REAL_TYPE)
+ || (code0 == REAL_TYPE && code1 == INTEGER_TYPE)
+ || (code0 == INTEGER_TYPE && code1 == REAL_TYPE)))
+ {
+ error ("non-floating-point arguments in call to "
+ "function %qE", fndecl);
+ return false;
+ }
+ return true;
+ }
+ return false;
+
+ default:
+ return true;
+ }
+}
+
/* Function to help qsort sort FIELD_DECLs by name order. */
int
diff --git a/gcc/c-common.h b/gcc/c-common.h
index 3ca3c8bf0c4..c403bee6343 100644
--- a/gcc/c-common.h
+++ b/gcc/c-common.h
@@ -666,6 +666,7 @@ extern void check_function_arguments_recurse (void (*)
unsigned HOST_WIDE_INT),
void *, tree,
unsigned HOST_WIDE_INT);
+extern bool check_builtin_function_arguments (tree, int, tree *);
extern void check_function_format (tree, int, tree *);
extern void set_Wformat (int);
extern tree handle_format_attribute (tree *, tree, tree, int, bool *);
diff --git a/gcc/c-decl.c b/gcc/c-decl.c
index 872fb8af30b..979b03c36d2 100644
--- a/gcc/c-decl.c
+++ b/gcc/c-decl.c
@@ -6637,7 +6637,7 @@ store_parm_decls (void)
call expand_expr to calculate the size of a variable-sized array.
We haven't necessarily assigned RTL to all variables yet, so it's
not safe to try to expand expressions involving them. */
- cfun->x_dont_save_pending_sizes_p = 1;
+ cfun->dont_save_pending_sizes_p = 1;
}
/* Emit diagnostics that require gimple input for detection. Operate on
diff --git a/gcc/c-format.c b/gcc/c-format.c
index d1a136f87ec..82f5ff39bc9 100644
--- a/gcc/c-format.c
+++ b/gcc/c-format.c
@@ -1779,26 +1779,12 @@ check_format_info_main (format_check_results *res,
length_chars_std = STD_C89;
if (fli)
{
- while (fli->name != 0 && fli->name[0] != *format_chars)
- {
- if (fli->name[0] == '\0')
- {
- int si = strlen (fli->name + 1) + 1;
- int i = 1;
- while (fli->name[i] != 0 && fli->name[i] == format_chars [i - 1])
- ++i;
- if (si == i)
- {
- if (si > 2)
- format_chars += si - 2;
- break;
- }
- }
+ while (fli->name != 0
+ && strncmp (fli->name, format_chars, strlen (fli->name)))
fli++;
- }
if (fli->name != 0)
{
- format_chars++;
+ format_chars += strlen (fli->name);
if (fli->double_name != 0 && fli->name[0] == *format_chars)
{
format_chars++;
diff --git a/gcc/c-tree.h b/gcc/c-tree.h
index 92df36ad632..02dfc6122d1 100644
--- a/gcc/c-tree.h
+++ b/gcc/c-tree.h
@@ -593,7 +593,7 @@ extern tree c_finish_goto_label (tree);
extern tree c_finish_goto_ptr (tree);
extern void c_begin_vm_scope (unsigned int);
extern void c_end_vm_scope (unsigned int);
-extern tree c_expr_to_decl (tree, bool *, bool *, bool *);
+extern tree c_expr_to_decl (tree, bool *, bool *);
extern tree c_begin_omp_parallel (void);
extern tree c_finish_omp_parallel (tree, tree);
extern tree c_finish_omp_clauses (tree);
diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c
index a457f6a2283..2f8428210d7 100644
--- a/gcc/c-typeck.c
+++ b/gcc/c-typeck.c
@@ -2213,7 +2213,6 @@ build_external_ref (tree id, int fun, location_t loc)
used_types_insert (TREE_TYPE (ref));
ref = DECL_INITIAL (ref);
TREE_CONSTANT (ref) = 1;
- TREE_INVARIANT (ref) = 1;
}
else if (current_function_decl != 0
&& !DECL_FILE_SCOPE_P (current_function_decl)
@@ -2444,8 +2443,14 @@ build_function_call (tree function, tree params)
if (nargs < 0)
return error_mark_node;
- /* Check that the arguments to the function are valid. */
+ /* Check that arguments to builtin functions match the expectations. */
+ if (fundecl
+ && DECL_BUILT_IN (fundecl)
+ && DECL_BUILT_IN_CLASS (fundecl) == BUILT_IN_NORMAL
+ && !check_builtin_function_arguments (fundecl, nargs, argarray))
+ return error_mark_node;
+ /* Check that the arguments to the function are valid. */
check_function_arguments (TYPE_ATTRIBUTES (fntype), nargs, argarray,
TYPE_ARG_TYPES (fntype));
@@ -3643,7 +3648,6 @@ build_c_cast (tree type, tree expr)
build_constructor_single (type, field, value),
true, 0);
TREE_CONSTANT (t) = TREE_CONSTANT (value);
- TREE_INVARIANT (t) = TREE_INVARIANT (value);
return t;
}
error ("cast to union type from type not present in union");
@@ -5608,7 +5612,7 @@ pop_init_level (int implicit)
ret.value = build_constructor (constructor_type,
constructor_elements);
if (constructor_constant)
- TREE_CONSTANT (ret.value) = TREE_INVARIANT (ret.value) = 1;
+ TREE_CONSTANT (ret.value) = 1;
if (constructor_constant && constructor_simple)
TREE_STATIC (ret.value) = 1;
}
@@ -8655,8 +8659,7 @@ c_objc_common_truthvalue_conversion (tree expr)
required. */
tree
-c_expr_to_decl (tree expr, bool *tc ATTRIBUTE_UNUSED,
- bool *ti ATTRIBUTE_UNUSED, bool *se)
+c_expr_to_decl (tree expr, bool *tc ATTRIBUTE_UNUSED, bool *se)
{
if (TREE_CODE (expr) == COMPOUND_LITERAL_EXPR)
{
diff --git a/gcc/calls.c b/gcc/calls.c
index 7d42de9f13a..126037d4a42 100644
--- a/gcc/calls.c
+++ b/gcc/calls.c
@@ -399,7 +399,7 @@ emit_call_1 (rtx funexp, tree fntree, tree fndecl ATTRIBUTE_UNUSED,
{
REG_NOTES (call_insn) = gen_rtx_EXPR_LIST (REG_SETJMP, const0_rtx,
REG_NOTES (call_insn));
- current_function_calls_setjmp = 1;
+ cfun->calls_setjmp = 1;
}
SIBLING_CALL_P (call_insn) = ((ecf_flags & ECF_SIBCALL) != 0);
@@ -2122,7 +2122,7 @@ expand_call (tree exp, rtx target, int ignore)
type_arg_types = TYPE_ARG_TYPES (funtype);
if (flags & ECF_MAY_BE_ALLOCA)
- current_function_calls_alloca = 1;
+ cfun->calls_alloca = 1;
/* If struct_value_rtx is 0, it means pass the address
as if it were an extra parameter. Put the argument expression
@@ -2299,8 +2299,6 @@ expand_call (tree exp, rtx target, int ignore)
if (crtl->preferred_stack_boundary < preferred_stack_boundary
&& fndecl != current_function_decl)
crtl->preferred_stack_boundary = preferred_stack_boundary;
- if (fndecl == current_function_decl)
- cfun->recursive_call_emit = true;
preferred_unit_stack_boundary = preferred_stack_boundary / BITS_PER_UNIT;
@@ -3160,7 +3158,7 @@ expand_call (tree exp, rtx target, int ignore)
if (tail_call_insns)
{
emit_insn (tail_call_insns);
- cfun->tail_call_emit = true;
+ crtl->tail_call_emit = true;
}
else
emit_insn (normal_call_insns);
diff --git a/gcc/cfgcleanup.c b/gcc/cfgcleanup.c
index 203963e02cc..aae9ca0009d 100644
--- a/gcc/cfgcleanup.c
+++ b/gcc/cfgcleanup.c
@@ -2176,7 +2176,7 @@ rest_of_handle_jump (void)
{
delete_unreachable_blocks ();
- if (cfun->tail_call_emit)
+ if (crtl->tail_call_emit)
fixup_tail_calls ();
return 0;
}
diff --git a/gcc/cfgexpand.c b/gcc/cfgexpand.c
index 00abf1e7e53..273c6ac864a 100644
--- a/gcc/cfgexpand.c
+++ b/gcc/cfgexpand.c
@@ -1177,7 +1177,7 @@ expand_used_vars (void)
stack guard: protect-all, alloca used, protected decls present. */
if (flag_stack_protect == 2
|| (flag_stack_protect
- && (current_function_calls_alloca || has_protected_decls)))
+ && (cfun->calls_alloca || has_protected_decls)))
create_stack_guard ();
/* Assign rtl to each variable based on these partitions. */
@@ -1874,7 +1874,7 @@ tree_expand_cfg (void)
/* Honor stack protection warnings. */
if (warn_stack_protect)
{
- if (current_function_calls_alloca)
+ if (cfun->calls_alloca)
warning (OPT_Wstack_protector,
"not protecting local variables: variable length buffer");
if (has_short_buffer && !crtl->stack_protect_guard)
@@ -1982,10 +1982,10 @@ tree_expand_cfg (void)
return 0;
}
-struct gimple_opt_pass pass_expand =
+struct rtl_opt_pass pass_expand =
{
{
- GIMPLE_PASS,
+ RTL_PASS,
"expand", /* name */
NULL, /* gate */
tree_expand_cfg, /* execute */
diff --git a/gcc/common.opt b/gcc/common.opt
index 0bcbb81a09a..5866d249fb7 100644
--- a/gcc/common.opt
+++ b/gcc/common.opt
@@ -1178,7 +1178,7 @@ Common Report Var(flag_tree_fre) Optimization
Enable Full Redundancy Elimination (FRE) on trees
ftree-loop-distribution
-Common Report Var(flag_tree_loop_distribution)
+Common Report Var(flag_tree_loop_distribution) Optimization
Enable loop distribution on trees
ftree-loop-im
diff --git a/gcc/config.gcc b/gcc/config.gcc
index 7276be31019..04b46c38fe7 100644
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -141,6 +141,8 @@
# need_64bit_hwint Set to yes if HOST_WIDE_INT must be 64 bits wide
# for this target. This is true iff this target
# supports "long" or "wchar_t" wider than 32 bits.
+# The setting made here must match the one made in
+# other locations such as libcpp/configure.ac
#
# configure_default_options
# Set to an initializer for configure_default_options
@@ -195,8 +197,7 @@ md_file=
# Obsolete configurations.
case ${target} in
- crx-* \
- | mt-* \
+ mt-* \
| strongarm*-* \
| ep9312*-* \
| xscale*-* \
@@ -357,12 +358,9 @@ rs6000*-*-*)
score*-*-*)
cpu_type=score
;;
-sparc64*-*-*)
- cpu_type=sparc
- need_64bit_hwint=yes
- ;;
sparc*-*-*)
cpu_type=sparc
+ need_64bit_hwint=yes
;;
spu*-*-*)
cpu_type=spu
@@ -2356,9 +2354,15 @@ sparc-*-elf*)
use_fixproto=yes
;;
sparc-*-linux*) # SPARC's running GNU/Linux, libc6
- tm_file="${tm_file} dbxelf.h elfos.h svr4.h sparc/sysv4.h sparc/linux.h"
+ tm_file="${tm_file} dbxelf.h elfos.h svr4.h sparc/sysv4.h linux.h"
extra_options="${extra_options} sparc/long-double-switch.opt"
- tmake_file="${tmake_file} sparc/t-linux sparc/t-crtfm"
+ if test x$enable_targets = xall; then
+ tm_file="sparc/biarch64.h ${tm_file} sparc/linux64.h"
+ tmake_file="${tmake_file} sparc/t-linux64 sparc/t-crtfm"
+ else
+ tm_file="${tm_file} sparc/linux.h"
+ tmake_file="${tmake_file} sparc/t-linux sparc/t-crtfm"
+ fi
;;
sparc-*-rtems*)
tm_file="${tm_file} dbxelf.h elfos.h svr4.h sparc/sysv4.h sparc/sp-elf.h sparc/rtemself.h rtems.h"
@@ -2395,7 +2399,6 @@ sparc64-*-solaris2* | sparcv9-*-solaris2*)
"":yes:* | yes:yes:* ) thread_file=posix ;;
"":*:yes | yes:*:yes ) thread_file=solaris ;;
esac
- need_64bit_hwint=yes
;;
sparc-*-solaris2*)
tm_file="${tm_file} dbxelf.h elfos.h svr4.h sparc/sysv4.h sol2.h"
@@ -2436,7 +2439,6 @@ sparc-*-solaris2*)
fi
tm_file="${tm_file} tm-dwarf2.h"
tmake_file="$tmake_file sparc/t-sol2-64"
- need_64bit_hwint=yes
test x$with_cpu != x || with_cpu=v9
;;
esac
@@ -2487,10 +2489,9 @@ sparc64-*-freebsd*|ultrasparc-*-freebsd*)
x) with_cpu=ultrasparc ;;
*) echo "$with_cpu not supported for freebsd target"; exit 1 ;;
esac
- need_64bit_hwint=yes
;;
sparc64-*-linux*) # 64-bit SPARC's running GNU/Linux
- tm_file="sparc/biarch64.h ${tm_file} dbxelf.h elfos.h svr4.h sparc/sysv4.h sparc/linux64.h"
+ tm_file="sparc/biarch64.h ${tm_file} dbxelf.h elfos.h svr4.h sparc/sysv4.h linux.h sparc/linux64.h"
extra_options="${extra_options} sparc/long-double-switch.opt"
tmake_file="${tmake_file} sparc/t-linux sparc/t-linux64 sparc/t-crtfm"
;;
diff --git a/gcc/config/alpha/alpha.c b/gcc/config/alpha/alpha.c
index 867bb08dd5c..ed44a88d9ec 100644
--- a/gcc/config/alpha/alpha.c
+++ b/gcc/config/alpha/alpha.c
@@ -7072,7 +7072,7 @@ alpha_sa_mask (unsigned long *imaskP, unsigned long *fmaskP)
/* When outputting a thunk, we don't have valid register life info,
but assemble_start_function wants to output .frame and .mask
directives. */
- if (current_function_is_thunk)
+ if (crtl->is_thunk)
{
*imaskP = 0;
*fmaskP = 0;
@@ -7095,7 +7095,7 @@ alpha_sa_mask (unsigned long *imaskP, unsigned long *fmaskP)
}
/* We need to restore these for the handler. */
- if (current_function_calls_eh_return)
+ if (crtl->calls_eh_return)
{
for (i = 0; ; ++i)
{
@@ -7149,7 +7149,7 @@ alpha_sa_size (void)
alpha_procedure_type
= (sa_size || get_frame_size() != 0
|| crtl->outgoing_args_size
- || current_function_stdarg || current_function_calls_alloca
+ || cfun->stdarg || cfun->calls_alloca
|| frame_pointer_needed)
? PT_STACK : PT_REGISTER;
@@ -7182,7 +7182,7 @@ alpha_sa_size (void)
vms_base_regno
= (frame_pointer_needed
- || current_function_has_nonlocal_label
+ || cfun->has_nonlocal_label
|| alpha_procedure_type == PT_STACK
|| crtl->outgoing_args_size)
? REG_PV : HARD_FRAME_POINTER_REGNUM;
@@ -7298,18 +7298,18 @@ alpha_does_function_need_gp (void)
return 0;
/* We need the gp to load the address of __mcount. */
- if (TARGET_PROFILING_NEEDS_GP && current_function_profile)
+ if (TARGET_PROFILING_NEEDS_GP && crtl->profile)
return 1;
/* The code emitted by alpha_output_mi_thunk_osf uses the gp. */
- if (current_function_is_thunk)
+ if (crtl->is_thunk)
return 1;
/* The nonlocal receiver pattern assumes that the gp is valid for
the nested function. Reasonable because it's almost always set
correctly already. For the cases where that's wrong, make sure
the nested function loads its gp on entry. */
- if (current_function_has_nonlocal_goto)
+ if (crtl->has_nonlocal_goto)
return 1;
/* If we need a GP (we have a LDSYM insn or a CALL_INSN), load it first.
@@ -7479,7 +7479,7 @@ alpha_expand_prologue (void)
the call to mcount ourselves, rather than having the linker do it
magically in response to -pg. Since _mcount has special linkage,
don't represent the call as a call. */
- if (TARGET_PROFILING_NEEDS_GP && current_function_profile)
+ if (TARGET_PROFILING_NEEDS_GP && crtl->profile)
emit_insn (gen_prologue_mcount ());
if (TARGET_ABI_UNICOSMK)
@@ -7825,7 +7825,7 @@ alpha_start_function (FILE *file, const char *fnname,
Otherwise, do it here. */
if (TARGET_ABI_OSF
&& ! alpha_function_needs_gp
- && ! current_function_is_thunk)
+ && ! crtl->is_thunk)
{
putc ('$', file);
assemble_name (file, fnname);
@@ -7936,7 +7936,7 @@ alpha_output_function_end_prologue (FILE *file)
fputs ("\t.prologue 0\n", file);
else if (!flag_inhibit_size_directive)
fprintf (file, "\t.prologue %d\n",
- alpha_function_needs_gp || current_function_is_thunk);
+ alpha_function_needs_gp || crtl->is_thunk);
}
/* Write function epilogue. */
@@ -8002,7 +8002,7 @@ alpha_expand_epilogue (void)
fp_offset = 0;
sa_reg = stack_pointer_rtx;
- if (current_function_calls_eh_return)
+ if (crtl->calls_eh_return)
eh_ofs = EH_RETURN_STACKADJ_RTX;
else
eh_ofs = NULL_RTX;
@@ -8113,7 +8113,7 @@ alpha_expand_epilogue (void)
register so as not to interfere with a potential fp restore,
which must be consecutive with an SP restore. */
if (frame_size < 32768
- && ! (TARGET_ABI_UNICOSMK && current_function_calls_alloca))
+ && ! (TARGET_ABI_UNICOSMK && cfun->calls_alloca))
sp_adj2 = GEN_INT (frame_size);
else if (TARGET_ABI_UNICOSMK)
{
diff --git a/gcc/config/alpha/predicates.md b/gcc/config/alpha/predicates.md
index 8b00633a44a..bc6fc842980 100644
--- a/gcc/config/alpha/predicates.md
+++ b/gcc/config/alpha/predicates.md
@@ -268,7 +268,7 @@
tree op_decl, cfun_sec, op_sec;
/* If profiling is implemented via linker tricks, we can't jump
- to the nogp alternate entry point. Note that current_function_profile
+ to the nogp alternate entry point. Note that crtl->profile
would not be correct, since that doesn't indicate if the target
function uses profiling. */
/* ??? TARGET_PROFILING_NEEDS_GP isn't really the right test,
diff --git a/gcc/config/arc/arc.c b/gcc/config/arc/arc.c
index cf0f7b64dfa..b5e2cb96547 100644
--- a/gcc/config/arc/arc.c
+++ b/gcc/config/arc/arc.c
@@ -1283,7 +1283,7 @@ arc_output_function_epilogue (FILE *file, HOST_WIDE_INT size)
unsigned int pretend_size = current_frame_info.pretend_size;
unsigned int frame_size = size - pretend_size;
int restored, fp_restored_p;
- int can_trust_sp_p = !current_function_calls_alloca;
+ int can_trust_sp_p = !cfun->calls_alloca;
const char *sp_str = reg_names[STACK_POINTER_REGNUM];
const char *fp_str = reg_names[FRAME_POINTER_REGNUM];
diff --git a/gcc/config/arc/arc.h b/gcc/config/arc/arc.h
index 06aa4035d1b..ea40fb23ab7 100644
--- a/gcc/config/arc/arc.h
+++ b/gcc/config/arc/arc.h
@@ -520,7 +520,7 @@ extern enum reg_class arc_regno_reg_class[FIRST_PSEUDO_REGISTER];
frame pointer. This expression is evaluated in the reload pass.
If its value is nonzero the function will have a frame pointer. */
#define FRAME_POINTER_REQUIRED \
-(current_function_calls_alloca)
+(cfun->calls_alloca)
/* C statement to store the difference between the frame pointer
and the stack pointer values immediately after the function prologue. */
diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
index 78aac134daf..64f12a16001 100644
--- a/gcc/config/arm/arm.c
+++ b/gcc/config/arm/arm.c
@@ -1656,9 +1656,9 @@ use_return_insn (int iscond, rtx sibling)
if (crtl->args.pretend_args_size
|| cfun->machine->uses_anonymous_args
/* Or if the function calls __builtin_eh_return () */
- || current_function_calls_eh_return
+ || crtl->calls_eh_return
/* Or if the function calls alloca */
- || current_function_calls_alloca
+ || cfun->calls_alloca
/* Or if there is a stack adjustment. However, if the stack pointer
is saved on the stack, we can use a pre-incrementing stack load. */
|| !(stack_adjust == 0 || (TARGET_APCS_FRAME && frame_pointer_needed
@@ -3373,7 +3373,7 @@ require_pic_register (void)
We don't want those calls to affect any assumptions about the real
function; and further, we can't call entry_of_function() until we
start the real expansion process. */
- if (!current_function_uses_pic_offset_table)
+ if (!crtl->uses_pic_offset_table)
{
gcc_assert (can_create_pseudo_p ());
if (arm_pic_register != INVALID_REGNUM)
@@ -3384,7 +3384,7 @@ require_pic_register (void)
if we are being called as part of the cost-estimation
process. */
if (current_ir_type () != IR_GIMPLE)
- current_function_uses_pic_offset_table = 1;
+ crtl->uses_pic_offset_table = 1;
}
else
{
@@ -3397,7 +3397,7 @@ require_pic_register (void)
process. */
if (current_ir_type () != IR_GIMPLE)
{
- current_function_uses_pic_offset_table = 1;
+ crtl->uses_pic_offset_table = 1;
start_sequence ();
arm_load_pic_register (0UL);
@@ -3564,7 +3564,7 @@ thumb_find_work_register (unsigned long pushed_regs_mask)
if (! cfun->machine->uses_anonymous_args
&& crtl->args.size >= 0
&& crtl->args.size <= (LAST_ARG_REGNUM * UNITS_PER_WORD)
- && cfun->args_info.nregs < 4)
+ && crtl->args.info.nregs < 4)
return LAST_ARG_REGNUM;
/* Otherwise look for a call-saved register that is going to be pushed. */
@@ -3595,7 +3595,7 @@ arm_load_pic_register (unsigned long saved_regs ATTRIBUTE_UNUSED)
rtx l1, labelno, pic_tmp, pic_tmp2, pic_rtx, pic_reg;
rtx global_offset_table;
- if (current_function_uses_pic_offset_table == 0 || TARGET_SINGLE_PIC_BASE)
+ if (crtl->uses_pic_offset_table == 0 || TARGET_SINGLE_PIC_BASE)
return;
gcc_assert (flag_pic);
@@ -10734,7 +10734,7 @@ arm_compute_save_reg0_reg12_mask (void)
if (flag_pic
&& !TARGET_SINGLE_PIC_BASE
&& arm_pic_register != INVALID_REGNUM
- && current_function_uses_pic_offset_table)
+ && crtl->uses_pic_offset_table)
save_reg_mask |= 1 << PIC_OFFSET_TABLE_REGNUM;
}
else
@@ -10755,7 +10755,7 @@ arm_compute_save_reg0_reg12_mask (void)
&& !TARGET_SINGLE_PIC_BASE
&& arm_pic_register != INVALID_REGNUM
&& (df_regs_ever_live_p (PIC_OFFSET_TABLE_REGNUM)
- || current_function_uses_pic_offset_table))
+ || crtl->uses_pic_offset_table))
save_reg_mask |= 1 << PIC_OFFSET_TABLE_REGNUM;
/* The prologue will copy SP into R0, so save it. */
@@ -10764,7 +10764,7 @@ arm_compute_save_reg0_reg12_mask (void)
}
/* Save registers so the exception handler can modify them. */
- if (current_function_calls_eh_return)
+ if (crtl->calls_eh_return)
{
unsigned int i;
@@ -10825,7 +10825,7 @@ arm_compute_save_reg_mask (void)
|| (save_reg_mask
&& optimize_size
&& ARM_FUNC_TYPE (func_type) == ARM_FT_NORMAL
- && !current_function_calls_eh_return))
+ && !crtl->calls_eh_return))
save_reg_mask |= 1 << LR_REGNUM;
if (cfun->machine->lr_save_eliminated)
@@ -10887,7 +10887,7 @@ thumb1_compute_save_reg_mask (void)
if (flag_pic
&& !TARGET_SINGLE_PIC_BASE
&& arm_pic_register != INVALID_REGNUM
- && current_function_uses_pic_offset_table)
+ && crtl->uses_pic_offset_table)
mask |= 1 << PIC_OFFSET_TABLE_REGNUM;
/* See if we might need r11 for calls to _interwork_r11_call_via_rN(). */
@@ -11002,7 +11002,7 @@ output_return_instruction (rtx operand, int really_return, int reverse)
return "";
}
- gcc_assert (!current_function_calls_alloca || really_return);
+ gcc_assert (!cfun->calls_alloca || really_return);
sprintf (conditional, "%%?%%%c0", reverse ? 'D' : 'd');
@@ -11268,7 +11268,7 @@ arm_output_function_prologue (FILE *f, HOST_WIDE_INT frame_size)
if (cfun->machine->lr_save_eliminated)
asm_fprintf (f, "\t%@ link register save eliminated.\n");
- if (current_function_calls_eh_return)
+ if (crtl->calls_eh_return)
asm_fprintf (f, "\t@ Calls __builtin_eh_return.\n");
return_used_this_function = 0;
@@ -11315,7 +11315,7 @@ arm_output_epilogue (rtx sibling)
/* If we are throwing an exception, then we really must be doing a
return, so we can't tail-call. */
- gcc_assert (!current_function_calls_eh_return || really_return);
+ gcc_assert (!crtl->calls_eh_return || really_return);
offsets = arm_get_frame_offsets ();
saved_regs_mask = offsets->saved_regs_mask;
@@ -11446,7 +11446,7 @@ arm_output_epilogue (rtx sibling)
special function exit sequence, or we are not really returning. */
if (really_return
&& ARM_FUNC_TYPE (func_type) == ARM_FT_NORMAL
- && !current_function_calls_eh_return)
+ && !crtl->calls_eh_return)
/* Delete the LR from the register mask, so that the LR on
the stack is loaded into the PC in the register mask. */
saved_regs_mask &= ~ (1 << LR_REGNUM);
@@ -11463,7 +11463,7 @@ arm_output_epilogue (rtx sibling)
occur. If the stack pointer already points at the right
place, then omit the subtraction. */
if (offsets->outgoing_args != (1 + (int) bit_count (saved_regs_mask))
- || current_function_calls_alloca)
+ || cfun->calls_alloca)
asm_fprintf (f, "\tsub\t%r, %r, #%d\n", SP_REGNUM, FP_REGNUM,
4 * bit_count (saved_regs_mask));
print_multi_reg (f, "ldmfd\t%r, ", SP_REGNUM, saved_regs_mask, 0);
@@ -11523,10 +11523,10 @@ arm_output_epilogue (rtx sibling)
count = offsets->saved_regs - offsets->saved_args;
if (optimize_size
&& count != 0
- && !current_function_calls_eh_return
+ && !crtl->calls_eh_return
&& bit_count(saved_regs_mask) * 4 == count
&& !IS_INTERRUPT (func_type)
- && !cfun->tail_call_emit)
+ && !crtl->tail_call_emit)
{
unsigned long mask;
mask = (1 << (arm_size_return_regs() / 4)) - 1;
@@ -11628,7 +11628,7 @@ arm_output_epilogue (rtx sibling)
&& really_return
&& crtl->args.pretend_args_size == 0
&& saved_regs_mask & (1 << LR_REGNUM)
- && !current_function_calls_eh_return)
+ && !crtl->calls_eh_return)
{
saved_regs_mask &= ~ (1 << LR_REGNUM);
saved_regs_mask |= (1 << PC_REGNUM);
@@ -11675,7 +11675,7 @@ arm_output_epilogue (rtx sibling)
return "";
/* Stack adjustment for exception handler. */
- if (current_function_calls_eh_return)
+ if (crtl->calls_eh_return)
asm_fprintf (f, "\tadd\t%r, %r, %r\n", SP_REGNUM, SP_REGNUM,
ARM_EH_STACKADJ_REGNUM);
@@ -12133,7 +12133,7 @@ arm_get_frame_offsets (void)
}
if (reg == -1 && arm_size_return_regs () <= 12
- && !cfun->tail_call_emit)
+ && !crtl->tail_call_emit)
{
/* Push/pop an argument register (r3) if all callee saved
registers are already being pushed. */
@@ -12664,7 +12664,7 @@ arm_expand_prologue (void)
scheduling in the prolog. Similarly if we want non-call exceptions
using the EABI unwinder, to prevent faulting instructions from being
swapped with a stack adjustment. */
- if (current_function_profile || !TARGET_SCHED_PROLOG
+ if (crtl->profile || !TARGET_SCHED_PROLOG
|| (ARM_EABI_UNWIND_TABLES && flag_non_call_exceptions))
emit_insn (gen_blockage ());
@@ -16180,7 +16180,7 @@ thumb_pushpop (FILE *f, unsigned long mask, int push, int *cfa_offset,
{
/* Catch popping the PC. */
if (TARGET_INTERWORK || TARGET_BACKTRACE
- || current_function_calls_eh_return)
+ || crtl->calls_eh_return)
{
/* The PC is never poped directly, instead
it is popped into r3 and then BX is used. */
@@ -16255,7 +16255,7 @@ thumb_exit (FILE *f, int reg_containing_return_addr)
return. */
if (pops_needed == 0)
{
- if (current_function_calls_eh_return)
+ if (crtl->calls_eh_return)
asm_fprintf (f, "\tadd\t%r, %r\n", SP_REGNUM, ARM_EH_STACKADJ_REGNUM);
asm_fprintf (f, "\tbx\t%r\n", reg_containing_return_addr);
@@ -16267,7 +16267,7 @@ thumb_exit (FILE *f, int reg_containing_return_addr)
else if (!TARGET_INTERWORK
&& !TARGET_BACKTRACE
&& !is_called_in_ARM_mode (current_function_decl)
- && !current_function_calls_eh_return)
+ && !crtl->calls_eh_return)
{
asm_fprintf (f, "\tpop\t{%r}\n", PC_REGNUM);
return;
@@ -16278,7 +16278,7 @@ thumb_exit (FILE *f, int reg_containing_return_addr)
/* If returning via __builtin_eh_return, the bottom three registers
all contain information needed for the return. */
- if (current_function_calls_eh_return)
+ if (crtl->calls_eh_return)
size = 12;
else
{
@@ -16489,7 +16489,7 @@ thumb_exit (FILE *f, int reg_containing_return_addr)
asm_fprintf (f, "\tmov\t%r, %r\n", LAST_ARG_REGNUM, IP_REGNUM);
}
- if (current_function_calls_eh_return)
+ if (crtl->calls_eh_return)
asm_fprintf (f, "\tadd\t%r, %r\n", SP_REGNUM, ARM_EH_STACKADJ_REGNUM);
/* Return to caller. */
@@ -16995,7 +16995,7 @@ thumb1_expand_prologue (void)
scheduling in the prolog. Similarly if we want non-call exceptions
using the EABI unwinder, to prevent faulting instructions from being
swapped with a stack adjustment. */
- if (current_function_profile || !TARGET_SCHED_PROLOG
+ if (crtl->profile || !TARGET_SCHED_PROLOG
|| (ARM_EABI_UNWIND_TABLES && flag_non_call_exceptions))
emit_insn (gen_blockage ());
@@ -17045,7 +17045,7 @@ thumb1_expand_epilogue (void)
the stack adjustment will not be deleted. */
emit_insn (gen_prologue_use (stack_pointer_rtx));
- if (current_function_profile || !TARGET_SCHED_PROLOG)
+ if (crtl->profile || !TARGET_SCHED_PROLOG)
emit_insn (gen_blockage ());
/* Emit a clobber for each insn that will be restored in the epilogue,
@@ -18633,9 +18633,9 @@ arm_unwind_emit (FILE * asm_out_file, rtx insn)
if (!ARM_EABI_UNWIND_TABLES)
return;
- if (!(flag_unwind_tables || cfun->uses_eh_lsda)
+ if (!(flag_unwind_tables || crtl->uses_eh_lsda)
&& (TREE_NOTHROW (current_function_decl)
- || cfun->all_throwers_are_sibcalls))
+ || crtl->all_throwers_are_sibcalls))
return;
if (GET_CODE (insn) == NOTE || !RTX_FRAME_RELATED_P (insn))
@@ -18722,9 +18722,9 @@ arm_output_fn_unwind (FILE * f, bool prologue)
/* If this function will never be unwound, then mark it as such.
The came condition is used in arm_unwind_emit to suppress
the frame annotations. */
- if (!(flag_unwind_tables || cfun->uses_eh_lsda)
+ if (!(flag_unwind_tables || crtl->uses_eh_lsda)
&& (TREE_NOTHROW (current_function_decl)
- || cfun->all_throwers_are_sibcalls))
+ || crtl->all_throwers_are_sibcalls))
fputs("\t.cantunwind\n", f);
fputs ("\t.fnend\n", f);
diff --git a/gcc/config/arm/arm.h b/gcc/config/arm/arm.h
index a340441d386..b6e182c0d22 100644
--- a/gcc/config/arm/arm.h
+++ b/gcc/config/arm/arm.h
@@ -999,7 +999,7 @@ extern int arm_structure_size_boundary;
#endif
#define FRAME_POINTER_REQUIRED \
- (current_function_has_nonlocal_label \
+ (cfun->has_nonlocal_label \
|| SUBTARGET_FRAME_POINTER_REQUIRED \
|| (TARGET_ARM && TARGET_APCS_FRAME && ! leaf_function_p ()))
@@ -2402,7 +2402,7 @@ extern int making_const_table;
{ \
if (is_called_in_ARM_mode (DECL) \
|| (TARGET_THUMB1 && !TARGET_THUMB1_ONLY \
- && current_function_is_thunk)) \
+ && crtl->is_thunk)) \
fprintf (STREAM, "\t.code 32\n") ; \
else if (TARGET_THUMB1) \
fprintf (STREAM, "\t.code\t16\n\t.thumb_func\n") ; \
diff --git a/gcc/config/arm/arm.md b/gcc/config/arm/arm.md
index dcac1346281..c66ea74d2af 100644
--- a/gcc/config/arm/arm.md
+++ b/gcc/config/arm/arm.md
@@ -10397,7 +10397,7 @@
[(clobber (const_int 0))]
"TARGET_EITHER"
"
- if (current_function_calls_eh_return)
+ if (crtl->calls_eh_return)
emit_insn (gen_prologue_use (gen_rtx_REG (Pmode, 2)));
if (TARGET_THUMB1)
thumb1_expand_epilogue ();
diff --git a/gcc/config/arm/linux-elf.h b/gcc/config/arm/linux-elf.h
index 54eba14436f..ca56f7bb669 100644
--- a/gcc/config/arm/linux-elf.h
+++ b/gcc/config/arm/linux-elf.h
@@ -114,7 +114,7 @@
emit_insn (gen_rtx_CLOBBER (VOIDmode, gen_rtx_REG (SImode, LR_REGNUM)))
/* The GNU/Linux profiler needs a frame pointer. */
-#define SUBTARGET_FRAME_POINTER_REQUIRED current_function_profile
+#define SUBTARGET_FRAME_POINTER_REQUIRED crtl->profile
/* Add .note.GNU-stack. */
#undef NEED_INDICATE_EXEC_STACK
diff --git a/gcc/config/avr/avr.c b/gcc/config/avr/avr.c
index c440729b422..7248fd6a27c 100644
--- a/gcc/config/avr/avr.c
+++ b/gcc/config/avr/avr.c
@@ -2735,7 +2735,7 @@ out_movhi_mr_r (rtx insn, rtx op[], int *l)
int
frame_pointer_required_p (void)
{
- return (current_function_calls_alloca
+ return (cfun->calls_alloca
|| crtl->args.info.nregs == 0
|| get_frame_size () > 0);
}
diff --git a/gcc/config/avr/avr.md b/gcc/config/avr/avr.md
index 922c4af2136..adaeb0ecd15 100644
--- a/gcc/config/avr/avr.md
+++ b/gcc/config/avr/avr.md
@@ -2056,7 +2056,7 @@
[(set (pc)
(if_then_else
(match_operator 0 "eqne_operator"
- [(zero_extract
+ [(zero_extract:QI
(match_operand:QI 1 "register_operand" "r")
(const_int 1)
(match_operand 2 "const_int_operand" "n"))
@@ -2123,9 +2123,9 @@
(label_ref (match_operand 1 "" ""))
(pc)))]
""
- [(set (pc) (if_then_else (eq (zero_extract (match_dup 0)
- (const_int 1)
- (const_int 7))
+ [(set (pc) (if_then_else (eq (zero_extract:QI (match_dup 0)
+ (const_int 1)
+ (const_int 7))
(const_int 0))
(label_ref (match_dup 1))
(pc)))]
@@ -2137,9 +2137,9 @@
(label_ref (match_operand 1 "" ""))
(pc)))]
""
- [(set (pc) (if_then_else (ne (zero_extract (match_dup 0)
- (const_int 1)
- (const_int 7))
+ [(set (pc) (if_then_else (ne (zero_extract:QI (match_dup 0)
+ (const_int 1)
+ (const_int 7))
(const_int 0))
(label_ref (match_dup 1))
(pc)))]
@@ -2518,7 +2518,7 @@
[(set (pc)
(if_then_else
(match_operator 0 "eqne_operator"
- [(zero_extract
+ [(zero_extract:QI
(mem:QI (match_operand 1 "low_io_address_operand" "n"))
(const_int 1)
(match_operand 2 "const_int_operand" "n"))
@@ -2565,7 +2565,7 @@
[(set (pc)
(if_then_else
(match_operator 0 "eqne_operator"
- [(zero_extract
+ [(zero_extract:QI
(mem:QI (match_operand 1 "high_io_address_operand" "n"))
(const_int 1)
(match_operand 2 "const_int_operand" "n"))
diff --git a/gcc/config/bfin/bfin.c b/gcc/config/bfin/bfin.c
index d1a5c80d2a8..87a1d9360b4 100644
--- a/gcc/config/bfin/bfin.c
+++ b/gcc/config/bfin/bfin.c
@@ -307,7 +307,7 @@ legitimize_pic_address (rtx orig, rtx reg, rtx picreg)
emit_move_insn (reg, new);
if (picreg == pic_offset_table_rtx)
- current_function_uses_pic_offset_table = 1;
+ crtl->uses_pic_offset_table = 1;
return reg;
}
@@ -364,7 +364,7 @@ must_save_p (bool is_inthandler, unsigned regno)
if (D_REGNO_P (regno))
{
bool is_eh_return_reg = false;
- if (current_function_calls_eh_return)
+ if (crtl->calls_eh_return)
{
unsigned j;
for (j = 0; ; j++)
@@ -389,7 +389,7 @@ must_save_p (bool is_inthandler, unsigned regno)
&& (is_inthandler || !call_used_regs[regno]))
|| (!TARGET_FDPIC
&& regno == PIC_OFFSET_TABLE_REGNUM
- && (current_function_uses_pic_offset_table
+ && (crtl->uses_pic_offset_table
|| (TARGET_ID_SHARED_LIBRARY && !current_function_is_leaf))));
}
else
@@ -452,7 +452,7 @@ stack_frame_needed_p (void)
{
/* EH return puts a new return address into the frame using an
address relative to the frame pointer. */
- if (current_function_calls_eh_return)
+ if (crtl->calls_eh_return)
return true;
return frame_pointer_needed;
}
@@ -854,7 +854,7 @@ add_to_reg (rtx reg, HOST_WIDE_INT value, int frame, int epilogue_p)
if ((df_regs_ever_live_p (i) && ! call_used_regs[i])
|| (!TARGET_FDPIC
&& i == PIC_OFFSET_TABLE_REGNUM
- && (current_function_uses_pic_offset_table
+ && (crtl->uses_pic_offset_table
|| (TARGET_ID_SHARED_LIBRARY
&& ! current_function_is_leaf))))
break;
@@ -1167,13 +1167,13 @@ bfin_expand_prologue (void)
return;
}
- if (current_function_limit_stack
+ if (crtl->limit_stack
|| TARGET_STACK_CHECK_L1)
{
HOST_WIDE_INT offset
= bfin_initial_elimination_offset (ARG_POINTER_REGNUM,
STACK_POINTER_REGNUM);
- rtx lim = current_function_limit_stack ? stack_limit_rtx : NULL_RTX;
+ rtx lim = crtl->limit_stack ? stack_limit_rtx : NULL_RTX;
rtx p2reg = gen_rtx_REG (Pmode, REG_P2);
if (!lim)
@@ -1219,7 +1219,7 @@ bfin_expand_prologue (void)
if (TARGET_ID_SHARED_LIBRARY
&& !TARGET_SEP_DATA
- && (current_function_uses_pic_offset_table
+ && (crtl->uses_pic_offset_table
|| !current_function_is_leaf))
bfin_load_pic_reg (pic_offset_table_rtx);
}
diff --git a/gcc/config/cris/cris.c b/gcc/config/cris/cris.c
index 87fef5a2f90..b197956b774 100644
--- a/gcc/config/cris/cris.c
+++ b/gcc/config/cris/cris.c
@@ -412,13 +412,13 @@ cris_conditional_register_usage (void)
reg_names[CRIS_CC0_REGNUM] = "ccr";
}
-/* Return current_function_uses_pic_offset_table. For use in cris.md,
+/* Return crtl->uses_pic_offset_table. For use in cris.md,
since some generated files do not include function.h. */
int
cris_cfun_uses_pic_table (void)
{
- return current_function_uses_pic_offset_table;
+ return crtl->uses_pic_offset_table;
}
/* Given an rtx, return the text string corresponding to the CODE of X.
@@ -604,7 +604,7 @@ cris_reg_saved_in_regsave_area (unsigned int regno, bool got_really_used)
&& !call_used_regs[regno + 1]))))
&& (regno != FRAME_POINTER_REGNUM || !frame_pointer_needed)
&& regno != CRIS_SRP_REGNUM)
- || (current_function_calls_eh_return
+ || (crtl->calls_eh_return
&& (regno == EH_RETURN_DATA_REGNO (0)
|| regno == EH_RETURN_DATA_REGNO (1)
|| regno == EH_RETURN_DATA_REGNO (2)
@@ -1188,7 +1188,7 @@ cris_initial_frame_pointer_offset (void)
int offs = 0;
bool got_really_used = false;
- if (current_function_uses_pic_offset_table)
+ if (crtl->uses_pic_offset_table)
{
push_topmost_sequence ();
got_really_used
@@ -1703,7 +1703,7 @@ cris_simple_epilogue (void)
|| crtl->args.pretend_args_size
|| crtl->args.size
|| crtl->outgoing_args_size
- || current_function_calls_eh_return
+ || crtl->calls_eh_return
/* If we're not supposed to emit prologue and epilogue, we must
not emit return-type instructions. */
@@ -1714,7 +1714,7 @@ cris_simple_epilogue (void)
if (TARGET_V32 && cris_return_address_on_stack ())
return false;
- if (current_function_uses_pic_offset_table)
+ if (crtl->uses_pic_offset_table)
{
push_topmost_sequence ();
got_really_used
@@ -2751,7 +2751,7 @@ cris_expand_prologue (void)
CRIS_ASSERT (size >= 0);
- if (current_function_uses_pic_offset_table)
+ if (crtl->uses_pic_offset_table)
{
/* A reference may have been optimized out (like the abort () in
fde_split in unwind-dw2-fde.c, at least 3.2.1) so check that
@@ -3030,7 +3030,7 @@ cris_expand_epilogue (void)
if (!TARGET_PROLOGUE_EPILOGUE)
return;
- if (current_function_uses_pic_offset_table)
+ if (crtl->uses_pic_offset_table)
{
/* A reference may have been optimized out (like the abort () in
fde_split in unwind-dw2-fde.c, at least 3.2.1) so check that
@@ -3173,7 +3173,7 @@ cris_expand_epilogue (void)
the return address on the stack. */
if (return_address_on_stack && pretend == 0)
{
- if (TARGET_V32 || current_function_calls_eh_return)
+ if (TARGET_V32 || crtl->calls_eh_return)
{
rtx mem;
rtx insn;
@@ -3189,7 +3189,7 @@ cris_expand_epilogue (void)
REG_NOTES (insn)
= alloc_EXPR_LIST (REG_INC, stack_pointer_rtx, REG_NOTES (insn));
- if (current_function_calls_eh_return)
+ if (crtl->calls_eh_return)
emit_insn (gen_addsi3 (stack_pointer_rtx,
stack_pointer_rtx,
gen_rtx_raw_REG (SImode,
@@ -3231,7 +3231,7 @@ cris_expand_epilogue (void)
}
/* Perform the "physical" unwinding that the EH machinery calculated. */
- if (current_function_calls_eh_return)
+ if (crtl->calls_eh_return)
emit_insn (gen_addsi3 (stack_pointer_rtx,
stack_pointer_rtx,
gen_rtx_raw_REG (SImode,
@@ -3484,7 +3484,7 @@ cris_expand_pic_call_address (rtx *opp)
for v32. */
rtx tem, rm, ro;
gcc_assert (can_create_pseudo_p ());
- current_function_uses_pic_offset_table = 1;
+ crtl->uses_pic_offset_table = 1;
tem = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, op),
TARGET_V32
? CRIS_UNSPEC_PLT_PCREL
@@ -3519,7 +3519,7 @@ cris_expand_pic_call_address (rtx *opp)
rtx tem, mem, rm, ro;
gcc_assert (can_create_pseudo_p ());
- current_function_uses_pic_offset_table = 1;
+ crtl->uses_pic_offset_table = 1;
tem = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, op),
CRIS_UNSPEC_PLTGOTREAD);
rm = gen_reg_rtx (Pmode);
@@ -3591,7 +3591,7 @@ cris_asm_output_symbol_ref (FILE *file, rtx x)
assemble_name (file, str);
/* Sanity check. */
- if (!TARGET_V32 && !current_function_uses_pic_offset_table)
+ if (!TARGET_V32 && !crtl->uses_pic_offset_table)
output_operand_lossage ("PIC register isn't set up");
}
else
@@ -3608,7 +3608,7 @@ cris_asm_output_label_ref (FILE *file, char *buf)
assemble_name (file, buf);
/* Sanity check. */
- if (!TARGET_V32 && !current_function_uses_pic_offset_table)
+ if (!TARGET_V32 && !crtl->uses_pic_offset_table)
internal_error ("emitting PIC operand, but PIC register isn't set up");
}
else
diff --git a/gcc/config/cris/cris.md b/gcc/config/cris/cris.md
index 97353cd8df0..e466204786e 100644
--- a/gcc/config/cris/cris.md
+++ b/gcc/config/cris/cris.md
@@ -995,7 +995,7 @@
/* FIXME: add a REG_EQUAL (or is it REG_EQUIV) note to the
destination register for the symbol. It might not be
worth it. Measure. */
- current_function_uses_pic_offset_table = 1;
+ crtl->uses_pic_offset_table = 1;
if (t == cris_rel_symbol)
{
/* Change a "move.d sym(+offs),rN" into (allocate register rM)
@@ -1025,7 +1025,7 @@
{
/* We still uses GOT-relative addressing for
pre-v32. */
- current_function_uses_pic_offset_table = 1;
+ crtl->uses_pic_offset_table = 1;
tem = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, sym),
CRIS_UNSPEC_GOTREL);
if (offs != 0)
diff --git a/gcc/config/crx/crx.h b/gcc/config/crx/crx.h
index c636dec3fd4..c3e1e203113 100644
--- a/gcc/config/crx/crx.h
+++ b/gcc/config/crx/crx.h
@@ -277,7 +277,7 @@ enum reg_class
#define FIRST_PARM_OFFSET(FNDECL) 0
-#define FRAME_POINTER_REQUIRED (current_function_calls_alloca)
+#define FRAME_POINTER_REQUIRED (cfun->calls_alloca)
#define ELIMINABLE_REGS \
{ \
diff --git a/gcc/config/darwin.c b/gcc/config/darwin.c
index 6c2de252fe3..38899833341 100644
--- a/gcc/config/darwin.c
+++ b/gcc/config/darwin.c
@@ -278,7 +278,7 @@ machopic_function_base_name (void)
if (function_base == NULL)
function_base = ggc_alloc_string ("<pic base>", sizeof ("<pic base>"));
- current_function_uses_pic_offset_table = 1;
+ crtl->uses_pic_offset_table = 1;
return function_base;
}
diff --git a/gcc/config/fr30/fr30.c b/gcc/config/fr30/fr30.c
index 78f7775c658..1dd1a523ac0 100644
--- a/gcc/config/fr30/fr30.c
+++ b/gcc/config/fr30/fr30.c
@@ -140,7 +140,7 @@ static int fr30_arg_partial_bytes (CUMULATIVE_ARGS *, enum machine_mode,
&& ! call_used_regs [regno] )
#define MUST_SAVE_FRAME_POINTER (df_regs_ever_live_p (FRAME_POINTER_REGNUM) || frame_pointer_needed)
-#define MUST_SAVE_RETURN_POINTER (df_regs_ever_live_p (RETURN_POINTER_REGNUM) || current_function_profile)
+#define MUST_SAVE_RETURN_POINTER (df_regs_ever_live_p (RETURN_POINTER_REGNUM) || crtl->profile)
#if UNITS_PER_WORD == 4
#define WORD_ALIGN(SIZE) (((SIZE) + 3) & ~3)
@@ -349,7 +349,7 @@ fr30_expand_prologue (void)
RTX_FRAME_RELATED_P (insn) = 1;
}
- if (current_function_profile)
+ if (crtl->profile)
emit_insn (gen_blockage ());
}
diff --git a/gcc/config/frv/frv.c b/gcc/config/frv/frv.c
index 150e25d568b..ef9aa51b9c5 100644
--- a/gcc/config/frv/frv.c
+++ b/gcc/config/frv/frv.c
@@ -1172,10 +1172,10 @@ frv_stack_info (void)
for (regno = first; regno <= last; regno++)
{
if ((df_regs_ever_live_p (regno) && !call_used_regs[regno])
- || (current_function_calls_eh_return
+ || (crtl->calls_eh_return
&& (regno >= FIRST_EH_REGNUM && regno <= LAST_EH_REGNUM))
|| (!TARGET_FDPIC && flag_pic
- && cfun->uses_pic_offset_table && regno == PIC_REGNO))
+ && crtl->uses_pic_offset_table && regno == PIC_REGNO))
{
info_ptr->save_p[regno] = REG_SAVE_1WORD;
size_1word += UNITS_PER_WORD;
@@ -1195,7 +1195,7 @@ frv_stack_info (void)
|| cfun->machine->frame_needed
|| (TARGET_LINKED_FP && frame_pointer_needed)
|| (!TARGET_FDPIC && flag_pic
- && cfun->uses_pic_offset_table))
+ && crtl->uses_pic_offset_table))
{
info_ptr->save_p[LR_REGNO] = REG_SAVE_1WORD;
size_1word += UNITS_PER_WORD;
@@ -1208,7 +1208,7 @@ frv_stack_info (void)
/* If this is a stdarg function with a non varardic
argument split between registers and the stack,
adjust the saved registers downward. */
- last -= (ADDR_ALIGN (cfun->pretend_args_size, UNITS_PER_WORD)
+ last -= (ADDR_ALIGN (crtl->args.pretend_args_size, UNITS_PER_WORD)
/ UNITS_PER_WORD);
for (regno = first; regno <= last; regno++)
@@ -1268,13 +1268,13 @@ frv_stack_info (void)
be used, or the size of a word otherwise. */
alignment = (TARGET_DWORD? 2 * UNITS_PER_WORD : UNITS_PER_WORD);
- info_ptr->parameter_size = ADDR_ALIGN (cfun->outgoing_args_size, alignment);
+ info_ptr->parameter_size = ADDR_ALIGN (crtl->outgoing_args_size, alignment);
info_ptr->regs_size = ADDR_ALIGN (info_ptr->regs_size_2words
+ info_ptr->regs_size_1word,
alignment);
info_ptr->vars_size = ADDR_ALIGN (get_frame_size (), alignment);
- info_ptr->pretend_size = cfun->pretend_args_size;
+ info_ptr->pretend_size = crtl->args.pretend_args_size;
/* Work out the size of the frame, excluding the header. Both the frame
body and register parameter area will be dword-aligned. */
@@ -1864,7 +1864,7 @@ frv_expand_prologue (void)
emit_insn (gen_blockage ());
/* Set up pic register/small data register for this function. */
- if (!TARGET_FDPIC && flag_pic && cfun->uses_pic_offset_table)
+ if (!TARGET_FDPIC && flag_pic && crtl->uses_pic_offset_table)
emit_insn (gen_pic_prologue (gen_rtx_REG (Pmode, PIC_REGNO),
gen_rtx_REG (Pmode, LR_REGNO),
gen_rtx_REG (SImode, OFFSET_REGNO)));
@@ -1957,7 +1957,7 @@ frv_expand_epilogue (bool emit_return)
}
/* If this function uses eh_return, add the final stack adjustment now. */
- if (current_function_calls_eh_return)
+ if (crtl->calls_eh_return)
emit_insn (gen_stack_adjust (sp, sp, EH_RETURN_STACKADJ_RTX));
if (emit_return)
@@ -2110,7 +2110,7 @@ frv_frame_pointer_required (void)
if (!current_function_sp_is_unchanging)
return TRUE;
- if (!TARGET_FDPIC && flag_pic && cfun->uses_pic_offset_table)
+ if (!TARGET_FDPIC && flag_pic && crtl->uses_pic_offset_table)
return TRUE;
if (profile_flag)
@@ -2194,7 +2194,7 @@ static void
frv_expand_builtin_va_start (tree valist, rtx nextarg)
{
tree t;
- int num = cfun->args_info - FIRST_ARG_REGNUM - FRV_NUM_ARG_REGS;
+ int num = crtl->args.info - FIRST_ARG_REGNUM - FRV_NUM_ARG_REGS;
nextarg = gen_rtx_PLUS (Pmode, virtual_incoming_args_rtx,
GEN_INT (UNITS_PER_WORD * num));
@@ -2202,7 +2202,7 @@ frv_expand_builtin_va_start (tree valist, rtx nextarg)
if (TARGET_DEBUG_ARG)
{
fprintf (stderr, "va_start: args_info = %d, num = %d\n",
- cfun->args_info, num);
+ crtl->args.info, num);
debug_rtx (nextarg);
}
@@ -3799,7 +3799,7 @@ frv_expand_fdpic_call (rtx *operands, bool ret_value, bool sibcall)
x = gen_symGOTOFF2reg (dest, addr, OUR_FDPIC_REG,
GEN_INT (R_FRV_FUNCDESC_GOTOFF12));
emit_insn (x);
- cfun->uses_pic_offset_table = TRUE;
+ crtl->uses_pic_offset_table = TRUE;
addr = dest;
}
else if (GET_CODE (addr) == SYMBOL_REF)
@@ -4160,7 +4160,7 @@ frv_emit_movsi (rtx dest, rtx src)
gen_rtx_REG (Pmode, base_regno),
GEN_INT (R_FRV_GPREL12)));
if (base_regno == PIC_REGNO)
- cfun->uses_pic_offset_table = TRUE;
+ crtl->uses_pic_offset_table = TRUE;
return TRUE;
}
@@ -4204,7 +4204,7 @@ frv_emit_movsi (rtx dest, rtx src)
break;
}
emit_insn (x);
- cfun->uses_pic_offset_table = TRUE;
+ crtl->uses_pic_offset_table = TRUE;
return TRUE;
}
diff --git a/gcc/config/i386/cygming-crtend.c b/gcc/config/i386/cygming-crtend.c
index 92e133099e4..59fc9109c7e 100644
--- a/gcc/config/i386/cygming-crtend.c
+++ b/gcc/config/i386/cygming-crtend.c
@@ -65,13 +65,10 @@ static void *__JCR_END__[1]
= { 0 };
#endif
-
extern void __gcc_register_frame (void);
extern void __gcc_deregister_frame (void);
static void register_frame_ctor (void) __attribute__ ((constructor (0)));
-static void deregister_frame_dtor (void) __attribute__ ((destructor (0)));
-
static void
register_frame_ctor (void)
@@ -79,8 +76,11 @@ register_frame_ctor (void)
__gcc_register_frame ();
}
+static void deregister_frame_ctor (void) __attribute__ ((destructor (0)));
+
static void
-deregister_frame_dtor (void)
+deregister_frame_ctor (void)
{
__gcc_deregister_frame ();
}
+
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 9c12abcd959..6b9ad68511f 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -35,6 +35,7 @@ along with GCC; see the file COPYING3. If not see
#include "insn-codes.h"
#include "insn-attr.h"
#include "flags.h"
+#include "c-common.h"
#include "except.h"
#include "function.h"
#include "recog.h"
@@ -2853,6 +2854,9 @@ x86_64_elf_select_section (tree decl, int reloc,
/* We don't split these for medium model. Place them into
default sections and hope for best. */
break;
+ case SECCAT_EMUTLS_VAR:
+ case SECCAT_EMUTLS_TMPL:
+ gcc_unreachable ();
}
if (sname)
{
@@ -2889,16 +2893,16 @@ x86_64_elf_unique_section (tree decl, int reloc)
case SECCAT_DATA_REL_LOCAL:
case SECCAT_DATA_REL_RO:
case SECCAT_DATA_REL_RO_LOCAL:
- prefix = one_only ? ".gnu.linkonce.ld." : ".ldata.";
+ prefix = one_only ? ".ld" : ".ldata";
break;
case SECCAT_BSS:
- prefix = one_only ? ".gnu.linkonce.lb." : ".lbss.";
+ prefix = one_only ? ".lb" : ".lbss";
break;
case SECCAT_RODATA:
case SECCAT_RODATA_MERGE_STR:
case SECCAT_RODATA_MERGE_STR_INIT:
case SECCAT_RODATA_MERGE_CONST:
- prefix = one_only ? ".gnu.linkonce.lr." : ".lrodata.";
+ prefix = one_only ? ".lr" : ".lrodata";
break;
case SECCAT_SRODATA:
case SECCAT_SDATA:
@@ -2910,23 +2914,28 @@ x86_64_elf_unique_section (tree decl, int reloc)
/* We don't split these for medium model. Place them into
default sections and hope for best. */
break;
+ case SECCAT_EMUTLS_VAR:
+ prefix = targetm.emutls.var_section;
+ break;
+ case SECCAT_EMUTLS_TMPL:
+ prefix = targetm.emutls.tmpl_section;
+ break;
}
if (prefix)
{
- const char *name;
- size_t nlen, plen;
+ const char *name, *linkonce;
char *string;
- plen = strlen (prefix);
name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl));
name = targetm.strip_name_encoding (name);
- nlen = strlen (name);
-
- string = (char *) alloca (nlen + plen + 1);
- memcpy (string, prefix, plen);
- memcpy (string + plen, name, nlen + 1);
-
- DECL_SECTION_NAME (decl) = build_string (nlen + plen, string);
+
+ /* If we're using one_only, then there needs to be a .gnu.linkonce
+ prefix to the section name. */
+ linkonce = one_only ? ".gnu.linkonce" : "";
+
+ string = ACONCAT ((linkonce, prefix, ".", name, NULL));
+
+ DECL_SECTION_NAME (decl) = build_string (strlen (string), string);
return;
}
}
@@ -3552,7 +3561,7 @@ init_cumulative_args (CUMULATIVE_ARGS *cum, /* Argument info to initialize */
{
/* If there are variable arguments, then we won't pass anything
in registers in 32-bit mode. */
- if (cum->maybe_vaarg)
+ if (stdarg_p (fntype))
{
cum->nregs = 0;
cum->sse_nregs = 0;
@@ -5783,7 +5792,7 @@ ix86_frame_pointer_required (void)
|| ix86_current_function_calls_tls_descriptor))
return 1;
- if (current_function_profile)
+ if (crtl->profile)
return 1;
return 0;
@@ -5993,7 +6002,7 @@ gen_push (rtx arg)
static unsigned int
ix86_select_alt_pic_regnum (void)
{
- if (current_function_is_leaf && !current_function_profile
+ if (current_function_is_leaf && !crtl->profile
&& !ix86_current_function_calls_tls_descriptor)
{
int i;
@@ -6012,16 +6021,16 @@ ix86_save_reg (unsigned int regno, int maybe_eh_return)
if (pic_offset_table_rtx
&& regno == REAL_PIC_OFFSET_TABLE_REGNUM
&& (df_regs_ever_live_p (REAL_PIC_OFFSET_TABLE_REGNUM)
- || current_function_profile
- || current_function_calls_eh_return
- || current_function_uses_const_pool))
+ || crtl->profile
+ || crtl->calls_eh_return
+ || crtl->uses_const_pool))
{
if (ix86_select_alt_pic_regnum () != INVALID_REGNUM)
return 0;
return 1;
}
- if (current_function_calls_eh_return && maybe_eh_return)
+ if (crtl->calls_eh_return && maybe_eh_return)
{
unsigned i;
for (i = 0; ; i++)
@@ -6185,7 +6194,7 @@ ix86_compute_frame_layout (struct ix86_frame *frame)
expander assumes that last crtl->outgoing_args_size
of stack frame are unused. */
if (ACCUMULATE_OUTGOING_ARGS
- && (!current_function_is_leaf || current_function_calls_alloca
+ && (!current_function_is_leaf || cfun->calls_alloca
|| ix86_current_function_calls_tls_descriptor))
{
offset += crtl->outgoing_args_size;
@@ -6196,7 +6205,7 @@ ix86_compute_frame_layout (struct ix86_frame *frame)
/* Align stack boundary. Only needed if we're calling another function
or using alloca. */
- if (!current_function_is_leaf || current_function_calls_alloca
+ if (!current_function_is_leaf || cfun->calls_alloca
|| ix86_current_function_calls_tls_descriptor)
frame->padding2 = ((offset + preferred_alignment - 1)
& -preferred_alignment) - offset;
@@ -6246,7 +6255,7 @@ ix86_compute_frame_layout (struct ix86_frame *frame)
(long)frame->hard_frame_pointer_offset);
fprintf (stderr, "stack_pointer_offset: %ld\n", (long)frame->stack_pointer_offset);
fprintf (stderr, "current_function_is_leaf: %ld\n", (long)current_function_is_leaf);
- fprintf (stderr, "current_function_calls_alloca: %ld\n", (long)current_function_calls_alloca);
+ fprintf (stderr, "cfun->calls_alloca: %ld\n", (long)cfun->calls_alloca);
fprintf (stderr, "x86_current_function_calls_tls_descriptor: %ld\n", (long)ix86_current_function_calls_tls_descriptor);
#endif
}
@@ -6531,7 +6540,7 @@ ix86_expand_prologue (void)
pic_reg_used = false;
if (pic_offset_table_rtx
&& (df_regs_ever_live_p (REAL_PIC_OFFSET_TABLE_REGNUM)
- || current_function_profile))
+ || crtl->profile))
{
unsigned int alt_pic_reg_used = ix86_select_alt_pic_regnum ();
@@ -6566,7 +6575,7 @@ ix86_expand_prologue (void)
/* Prevent function calls from being scheduled before the call to mcount.
In the pic_reg_used case, make sure that the got load isn't deleted. */
- if (current_function_profile)
+ if (crtl->profile)
{
if (pic_reg_used)
emit_insn (gen_prologue_use (pic_offset_table_rtx));
@@ -6621,7 +6630,7 @@ ix86_expand_epilogue (int style)
eh_return: the eax and edx registers are marked as saved, but not
restored along this path. */
offset = frame.nregs;
- if (current_function_calls_eh_return && style != 2)
+ if (crtl->calls_eh_return && style != 2)
offset -= 2;
offset *= -UNITS_PER_WORD;
@@ -6643,7 +6652,7 @@ ix86_expand_epilogue (int style)
|| (frame_pointer_needed && TARGET_USE_LEAVE
&& cfun->machine->use_fast_prologue_epilogue
&& frame.nregs == 1)
- || current_function_calls_eh_return)
+ || crtl->calls_eh_return)
{
/* Restore registers. We can use ebp or esp to address the memory
locations. If both are available, default to ebp, since offsets
@@ -17479,7 +17488,7 @@ enum ix86_builtins
IX86_BUILTIN_MFENCE,
IX86_BUILTIN_LFENCE,
- /* Prescott New Instructions. */
+ /* SSE3. */
IX86_BUILTIN_ADDSUBPS,
IX86_BUILTIN_HADDPS,
IX86_BUILTIN_HSUBPS,
@@ -17975,21 +17984,127 @@ static const struct builtin_description bdesc_pcmpistr[] =
{ OPTION_MASK_ISA_SSE4_2, CODE_FOR_sse4_2_pcmpistr, "__builtin_ia32_pcmpistriz128", IX86_BUILTIN_PCMPISTRZ128, UNKNOWN, (int) CCZmode },
};
-static const struct builtin_description bdesc_crc32[] =
-{
- /* SSE4.2 */
- { OPTION_MASK_ISA_SSE4_2 | OPTION_MASK_ISA_64BIT, CODE_FOR_sse4_2_crc32qi, 0, IX86_BUILTIN_CRC32QI, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSE4_2, CODE_FOR_sse4_2_crc32hi, 0, IX86_BUILTIN_CRC32HI, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSE4_2, CODE_FOR_sse4_2_crc32si, 0, IX86_BUILTIN_CRC32SI, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSE4_2, CODE_FOR_sse4_2_crc32di, 0, IX86_BUILTIN_CRC32DI, UNKNOWN, 0 },
+/* Special builtin types */
+enum ix86_special_builtin_type
+{
+ SPECIAL_FTYPE_UNKNOWN,
+ VOID_FTYPE_VOID,
+ V16QI_FTYPE_PCCHAR,
+ V4SF_FTYPE_PCFLOAT,
+ V2DF_FTYPE_PCDOUBLE,
+ V4SF_FTYPE_V4SF_PCV2SF,
+ V2DF_FTYPE_V2DF_PCDOUBLE,
+ V2DI_FTYPE_PV2DI,
+ VOID_FTYPE_PV2SF_V4SF,
+ VOID_FTYPE_PV2DI_V2DI,
+ VOID_FTYPE_PCHAR_V16QI,
+ VOID_FTYPE_PFLOAT_V4SF,
+ VOID_FTYPE_PDOUBLE_V2DF,
+ VOID_FTYPE_PDI_DI,
+ VOID_FTYPE_PINT_INT
};
-/* SSE */
-enum sse_builtin_type
-{
- SSE_CTYPE_UNKNOWN,
+/* Builtin types */
+enum ix86_builtin_type
+{
+ FTYPE_UNKNOWN,
+ FLOAT128_FTYPE_FLOAT128,
+ FLOAT_FTYPE_FLOAT,
+ FLOAT128_FTYPE_FLOAT128_FLOAT128,
+ INT64_FTYPE_V4SF,
+ INT64_FTYPE_V2DF,
+ INT_FTYPE_V16QI,
+ INT_FTYPE_V8QI,
+ INT_FTYPE_V4SF,
+ INT_FTYPE_V2DF,
+ V16QI_FTYPE_V16QI,
+ V8HI_FTYPE_V8HI,
+ V8HI_FTYPE_V16QI,
+ V8QI_FTYPE_V8QI,
+ V4SI_FTYPE_V4SI,
+ V4SI_FTYPE_V16QI,
+ V4SI_FTYPE_V8HI,
+ V4SI_FTYPE_V4SF,
+ V4SI_FTYPE_V2DF,
+ V4HI_FTYPE_V4HI,
+ V4SF_FTYPE_V4SF,
+ V4SF_FTYPE_V4SF_VEC_MERGE,
+ V4SF_FTYPE_V4SI,
+ V4SF_FTYPE_V2DF,
+ V2DI_FTYPE_V2DI,
+ V2DI_FTYPE_V16QI,
+ V2DI_FTYPE_V8HI,
+ V2DI_FTYPE_V4SI,
+ V2DF_FTYPE_V2DF,
+ V2DF_FTYPE_V2DF_VEC_MERGE,
+ V2DF_FTYPE_V4SI,
+ V2DF_FTYPE_V4SF,
+ V2DF_FTYPE_V2SI,
+ V2SI_FTYPE_V2SI,
+ V2SI_FTYPE_V4SF,
+ V2SI_FTYPE_V2SF,
+ V2SI_FTYPE_V2DF,
+ V2SF_FTYPE_V2SF,
+ V2SF_FTYPE_V2SI,
+ V16QI_FTYPE_V16QI_V16QI,
+ V16QI_FTYPE_V8HI_V8HI,
+ V8QI_FTYPE_V8QI_V8QI,
+ V8QI_FTYPE_V4HI_V4HI,
+ V8HI_FTYPE_V8HI_V8HI,
+ V8HI_FTYPE_V8HI_V8HI_COUNT,
+ V8HI_FTYPE_V16QI_V16QI,
+ V8HI_FTYPE_V4SI_V4SI,
+ V8HI_FTYPE_V8HI_SI_COUNT,
+ V4SI_FTYPE_V4SI_V4SI,
+ V4SI_FTYPE_V4SI_V4SI_COUNT,
+ V4SI_FTYPE_V8HI_V8HI,
+ V4SI_FTYPE_V4SF_V4SF,
+ V4SI_FTYPE_V2DF_V2DF,
+ V4SI_FTYPE_V4SI_SI_COUNT,
+ V4HI_FTYPE_V4HI_V4HI,
+ V4HI_FTYPE_V4HI_V4HI_COUNT,
+ V4HI_FTYPE_V8QI_V8QI,
+ V4HI_FTYPE_V2SI_V2SI,
+ V4HI_FTYPE_V4HI_SI_COUNT,
+ V4SF_FTYPE_V4SF_V4SF,
+ V4SF_FTYPE_V4SF_V4SF_SWAP,
+ V4SF_FTYPE_V4SF_V2SI,
+ V4SF_FTYPE_V4SF_V2DF,
+ V4SF_FTYPE_V4SF_DI,
+ V4SF_FTYPE_V4SF_SI,
+ V2DI_FTYPE_V2DI_V2DI,
+ V2DI_FTYPE_V2DI_V2DI_COUNT,
+ V2DI_FTYPE_V16QI_V16QI,
+ V2DI_FTYPE_V4SI_V4SI,
+ V2DI_FTYPE_V2DI_V16QI,
+ V2DI_FTYPE_V2DF_V2DF,
+ V2DI_FTYPE_V2DI_SI_COUNT,
+ V2SI_FTYPE_V2SI_V2SI,
+ V2SI_FTYPE_V2SI_V2SI_COUNT,
+ V2SI_FTYPE_V4HI_V4HI,
+ V2SI_FTYPE_V2SF_V2SF,
+ V2SI_FTYPE_V2SI_SI_COUNT,
+ V2DF_FTYPE_V2DF_V2DF,
+ V2DF_FTYPE_V2DF_V2DF_SWAP,
+ V2DF_FTYPE_V2DF_V4SF,
+ V2DF_FTYPE_V2DF_DI,
+ V2DF_FTYPE_V2DF_SI,
+ V2SF_FTYPE_V2SF_V2SF,
+ V1DI_FTYPE_V1DI_V1DI,
+ V1DI_FTYPE_V1DI_V1DI_COUNT,
+ V1DI_FTYPE_V8QI_V8QI,
+ V1DI_FTYPE_V2SI_V2SI,
+ V1DI_FTYPE_V1DI_SI_COUNT,
+ UINT64_FTYPE_UINT64_UINT64,
+ UINT_FTYPE_UINT_UINT,
+ UINT_FTYPE_UINT_USHORT,
+ UINT_FTYPE_UINT_UCHAR,
+ V8HI_FTYPE_V8HI_INT,
+ V4SI_FTYPE_V4SI_INT,
+ V4HI_FTYPE_V4HI_INT,
V4SF_FTYPE_V4SF_INT,
V2DI_FTYPE_V2DI_INT,
+ V2DI2TI_FTYPE_V2DI_INT,
V2DF_FTYPE_V2DF_INT,
V16QI_FTYPE_V16QI_V16QI_V16QI,
V4SF_FTYPE_V4SF_V4SF_V4SF,
@@ -17999,18 +18114,465 @@ enum sse_builtin_type
V4SI_FTYPE_V4SI_V4SI_INT,
V4SF_FTYPE_V4SF_V4SF_INT,
V2DI_FTYPE_V2DI_V2DI_INT,
- V2DF_FTYPE_V2DF_V2DF_INT
+ V2DI2TI_FTYPE_V2DI_V2DI_INT,
+ V1DI2DI_FTYPE_V1DI_V1DI_INT,
+ V2DF_FTYPE_V2DF_V2DF_INT,
+ V2DI_FTYPE_V2DI_UINT_UINT,
+ V2DI_FTYPE_V2DI_V2DI_UINT_UINT
+};
+
+/* Special builtins with variable number of arguments. */
+static const struct builtin_description bdesc_special_args[] =
+{
+ /* MMX */
+ { OPTION_MASK_ISA_MMX, CODE_FOR_mmx_emms, "__builtin_ia32_emms", IX86_BUILTIN_EMMS, UNKNOWN, (int) VOID_FTYPE_VOID },
+
+ /* 3DNow! */
+ { OPTION_MASK_ISA_3DNOW, CODE_FOR_mmx_femms, "__builtin_ia32_femms", IX86_BUILTIN_FEMMS, UNKNOWN, (int) VOID_FTYPE_VOID },
+
+ /* SSE */
+ { OPTION_MASK_ISA_SSE, CODE_FOR_sse_movups, "__builtin_ia32_storeups", IX86_BUILTIN_STOREUPS, UNKNOWN, (int) VOID_FTYPE_PFLOAT_V4SF },
+ { OPTION_MASK_ISA_SSE, CODE_FOR_sse_movntv4sf, "__builtin_ia32_movntps", IX86_BUILTIN_MOVNTPS, UNKNOWN, (int) VOID_FTYPE_PFLOAT_V4SF },
+ { OPTION_MASK_ISA_SSE, CODE_FOR_sse_movups, "__builtin_ia32_loadups", IX86_BUILTIN_LOADUPS, UNKNOWN, (int) V4SF_FTYPE_PCFLOAT },
+
+ { OPTION_MASK_ISA_SSE, CODE_FOR_sse_loadhps, "__builtin_ia32_loadhps", IX86_BUILTIN_LOADHPS, UNKNOWN, (int) V4SF_FTYPE_V4SF_PCV2SF },
+ { OPTION_MASK_ISA_SSE, CODE_FOR_sse_loadlps, "__builtin_ia32_loadlps", IX86_BUILTIN_LOADLPS, UNKNOWN, (int) V4SF_FTYPE_V4SF_PCV2SF },
+ { OPTION_MASK_ISA_SSE, CODE_FOR_sse_storehps, "__builtin_ia32_storehps", IX86_BUILTIN_STOREHPS, UNKNOWN, (int) VOID_FTYPE_PV2SF_V4SF },
+ { OPTION_MASK_ISA_SSE, CODE_FOR_sse_storelps, "__builtin_ia32_storelps", IX86_BUILTIN_STORELPS, UNKNOWN, (int) VOID_FTYPE_PV2SF_V4SF },
+
+ /* SSE or 3DNow!A */
+ { OPTION_MASK_ISA_SSE | OPTION_MASK_ISA_3DNOW_A, CODE_FOR_sse_sfence, "__builtin_ia32_sfence", IX86_BUILTIN_SFENCE, UNKNOWN, (int) VOID_FTYPE_VOID },
+ { OPTION_MASK_ISA_SSE | OPTION_MASK_ISA_3DNOW_A, CODE_FOR_sse_movntdi, "__builtin_ia32_movntq", IX86_BUILTIN_MOVNTQ, UNKNOWN, (int) VOID_FTYPE_PDI_DI },
+
+ /* SSE2 */
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_lfence, "__builtin_ia32_lfence", IX86_BUILTIN_LFENCE, UNKNOWN, (int) VOID_FTYPE_VOID },
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_mfence, 0, IX86_BUILTIN_MFENCE, UNKNOWN, (int) VOID_FTYPE_VOID },
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_movupd, "__builtin_ia32_storeupd", IX86_BUILTIN_STOREUPD, UNKNOWN, (int) VOID_FTYPE_PDOUBLE_V2DF },
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_movdqu, "__builtin_ia32_storedqu", IX86_BUILTIN_STOREDQU, UNKNOWN, (int) VOID_FTYPE_PCHAR_V16QI },
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_movntv2df, "__builtin_ia32_movntpd", IX86_BUILTIN_MOVNTPD, UNKNOWN, (int) VOID_FTYPE_PDOUBLE_V2DF },
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_movntv2di, "__builtin_ia32_movntdq", IX86_BUILTIN_MOVNTDQ, UNKNOWN, (int) VOID_FTYPE_PV2DI_V2DI },
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_movntsi, "__builtin_ia32_movnti", IX86_BUILTIN_MOVNTI, UNKNOWN, (int) VOID_FTYPE_PINT_INT },
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_movupd, "__builtin_ia32_loadupd", IX86_BUILTIN_LOADUPD, UNKNOWN, (int) V2DF_FTYPE_PCDOUBLE },
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_movdqu, "__builtin_ia32_loaddqu", IX86_BUILTIN_LOADDQU, UNKNOWN, (int) V16QI_FTYPE_PCCHAR },
+
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_loadhpd, "__builtin_ia32_loadhpd", IX86_BUILTIN_LOADHPD, UNKNOWN, (int) V2DF_FTYPE_V2DF_PCDOUBLE },
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_loadlpd, "__builtin_ia32_loadlpd", IX86_BUILTIN_LOADLPD, UNKNOWN, (int) V2DF_FTYPE_V2DF_PCDOUBLE },
+
+ /* SSE3 */
+ { OPTION_MASK_ISA_SSE3, CODE_FOR_sse3_lddqu, "__builtin_ia32_lddqu", IX86_BUILTIN_LDDQU, UNKNOWN, (int) V16QI_FTYPE_PCCHAR },
+
+ /* SSE4.1 */
+ { OPTION_MASK_ISA_SSE4_1, CODE_FOR_sse4_1_movntdqa, "__builtin_ia32_movntdqa", IX86_BUILTIN_MOVNTDQA, UNKNOWN, (int) V2DI_FTYPE_PV2DI },
+
+ /* SSE4A */
+ { OPTION_MASK_ISA_SSE4A, CODE_FOR_sse4a_vmmovntv2df, "__builtin_ia32_movntsd", IX86_BUILTIN_MOVNTSD, UNKNOWN, (int) VOID_FTYPE_PDOUBLE_V2DF },
+ { OPTION_MASK_ISA_SSE4A, CODE_FOR_sse4a_vmmovntv4sf, "__builtin_ia32_movntss", IX86_BUILTIN_MOVNTSS, UNKNOWN, (int) VOID_FTYPE_PFLOAT_V4SF },
};
-/* SSE builtins with variable number of arguments. */
-static const struct builtin_description bdesc_sse_args[] =
+/* Builtins with variable number of arguments. */
+static const struct builtin_description bdesc_args[] =
{
+ /* MMX */
+ { OPTION_MASK_ISA_MMX, CODE_FOR_mmx_addv8qi3, "__builtin_ia32_paddb", IX86_BUILTIN_PADDB, UNKNOWN, (int) V8QI_FTYPE_V8QI_V8QI },
+ { OPTION_MASK_ISA_MMX, CODE_FOR_mmx_addv4hi3, "__builtin_ia32_paddw", IX86_BUILTIN_PADDW, UNKNOWN, (int) V4HI_FTYPE_V4HI_V4HI },
+ { OPTION_MASK_ISA_MMX, CODE_FOR_mmx_addv2si3, "__builtin_ia32_paddd", IX86_BUILTIN_PADDD, UNKNOWN, (int) V2SI_FTYPE_V2SI_V2SI },
+ { OPTION_MASK_ISA_MMX, CODE_FOR_mmx_subv8qi3, "__builtin_ia32_psubb", IX86_BUILTIN_PSUBB, UNKNOWN, (int) V8QI_FTYPE_V8QI_V8QI },
+ { OPTION_MASK_ISA_MMX, CODE_FOR_mmx_subv4hi3, "__builtin_ia32_psubw", IX86_BUILTIN_PSUBW, UNKNOWN, (int) V4HI_FTYPE_V4HI_V4HI },
+ { OPTION_MASK_ISA_MMX, CODE_FOR_mmx_subv2si3, "__builtin_ia32_psubd", IX86_BUILTIN_PSUBD, UNKNOWN, (int) V2SI_FTYPE_V2SI_V2SI },
+
+ { OPTION_MASK_ISA_MMX, CODE_FOR_mmx_ssaddv8qi3, "__builtin_ia32_paddsb", IX86_BUILTIN_PADDSB, UNKNOWN, (int) V8QI_FTYPE_V8QI_V8QI },
+ { OPTION_MASK_ISA_MMX, CODE_FOR_mmx_ssaddv4hi3, "__builtin_ia32_paddsw", IX86_BUILTIN_PADDSW, UNKNOWN, (int) V4HI_FTYPE_V4HI_V4HI },
+ { OPTION_MASK_ISA_MMX, CODE_FOR_mmx_sssubv8qi3, "__builtin_ia32_psubsb", IX86_BUILTIN_PSUBSB, UNKNOWN, (int) V8QI_FTYPE_V8QI_V8QI },
+ { OPTION_MASK_ISA_MMX, CODE_FOR_mmx_sssubv4hi3, "__builtin_ia32_psubsw", IX86_BUILTIN_PSUBSW, UNKNOWN, (int) V4HI_FTYPE_V4HI_V4HI },
+ { OPTION_MASK_ISA_MMX, CODE_FOR_mmx_usaddv8qi3, "__builtin_ia32_paddusb", IX86_BUILTIN_PADDUSB, UNKNOWN, (int) V8QI_FTYPE_V8QI_V8QI },
+ { OPTION_MASK_ISA_MMX, CODE_FOR_mmx_usaddv4hi3, "__builtin_ia32_paddusw", IX86_BUILTIN_PADDUSW, UNKNOWN, (int) V4HI_FTYPE_V4HI_V4HI },
+ { OPTION_MASK_ISA_MMX, CODE_FOR_mmx_ussubv8qi3, "__builtin_ia32_psubusb", IX86_BUILTIN_PSUBUSB, UNKNOWN, (int) V8QI_FTYPE_V8QI_V8QI },
+ { OPTION_MASK_ISA_MMX, CODE_FOR_mmx_ussubv4hi3, "__builtin_ia32_psubusw", IX86_BUILTIN_PSUBUSW, UNKNOWN, (int) V4HI_FTYPE_V4HI_V4HI },
+
+ { OPTION_MASK_ISA_MMX, CODE_FOR_mmx_mulv4hi3, "__builtin_ia32_pmullw", IX86_BUILTIN_PMULLW, UNKNOWN, (int) V4HI_FTYPE_V4HI_V4HI },
+ { OPTION_MASK_ISA_MMX, CODE_FOR_mmx_smulv4hi3_highpart, "__builtin_ia32_pmulhw", IX86_BUILTIN_PMULHW, UNKNOWN, (int) V4HI_FTYPE_V4HI_V4HI },
+
+ { OPTION_MASK_ISA_MMX, CODE_FOR_mmx_andv2si3, "__builtin_ia32_pand", IX86_BUILTIN_PAND, UNKNOWN, (int) V2SI_FTYPE_V2SI_V2SI },
+ { OPTION_MASK_ISA_MMX, CODE_FOR_mmx_nandv2si3, "__builtin_ia32_pandn", IX86_BUILTIN_PANDN, UNKNOWN, (int) V2SI_FTYPE_V2SI_V2SI },
+ { OPTION_MASK_ISA_MMX, CODE_FOR_mmx_iorv2si3, "__builtin_ia32_por", IX86_BUILTIN_POR, UNKNOWN, (int) V2SI_FTYPE_V2SI_V2SI },
+ { OPTION_MASK_ISA_MMX, CODE_FOR_mmx_xorv2si3, "__builtin_ia32_pxor", IX86_BUILTIN_PXOR, UNKNOWN, (int) V2SI_FTYPE_V2SI_V2SI },
+
+ { OPTION_MASK_ISA_MMX, CODE_FOR_mmx_eqv8qi3, "__builtin_ia32_pcmpeqb", IX86_BUILTIN_PCMPEQB, UNKNOWN, (int) V8QI_FTYPE_V8QI_V8QI },
+ { OPTION_MASK_ISA_MMX, CODE_FOR_mmx_eqv4hi3, "__builtin_ia32_pcmpeqw", IX86_BUILTIN_PCMPEQW, UNKNOWN, (int) V4HI_FTYPE_V4HI_V4HI },
+ { OPTION_MASK_ISA_MMX, CODE_FOR_mmx_eqv2si3, "__builtin_ia32_pcmpeqd", IX86_BUILTIN_PCMPEQD, UNKNOWN, (int) V2SI_FTYPE_V2SI_V2SI },
+ { OPTION_MASK_ISA_MMX, CODE_FOR_mmx_gtv8qi3, "__builtin_ia32_pcmpgtb", IX86_BUILTIN_PCMPGTB, UNKNOWN, (int) V8QI_FTYPE_V8QI_V8QI },
+ { OPTION_MASK_ISA_MMX, CODE_FOR_mmx_gtv4hi3, "__builtin_ia32_pcmpgtw", IX86_BUILTIN_PCMPGTW, UNKNOWN, (int) V4HI_FTYPE_V4HI_V4HI },
+ { OPTION_MASK_ISA_MMX, CODE_FOR_mmx_gtv2si3, "__builtin_ia32_pcmpgtd", IX86_BUILTIN_PCMPGTD, UNKNOWN, (int) V2SI_FTYPE_V2SI_V2SI },
+
+ { OPTION_MASK_ISA_MMX, CODE_FOR_mmx_punpckhbw, "__builtin_ia32_punpckhbw", IX86_BUILTIN_PUNPCKHBW, UNKNOWN, (int) V8QI_FTYPE_V8QI_V8QI },
+ { OPTION_MASK_ISA_MMX, CODE_FOR_mmx_punpckhwd, "__builtin_ia32_punpckhwd", IX86_BUILTIN_PUNPCKHWD, UNKNOWN, (int) V4HI_FTYPE_V4HI_V4HI },
+ { OPTION_MASK_ISA_MMX, CODE_FOR_mmx_punpckhdq, "__builtin_ia32_punpckhdq", IX86_BUILTIN_PUNPCKHDQ, UNKNOWN, (int) V2SI_FTYPE_V2SI_V2SI },
+ { OPTION_MASK_ISA_MMX, CODE_FOR_mmx_punpcklbw, "__builtin_ia32_punpcklbw", IX86_BUILTIN_PUNPCKLBW, UNKNOWN, (int) V8QI_FTYPE_V8QI_V8QI },
+ { OPTION_MASK_ISA_MMX, CODE_FOR_mmx_punpcklwd, "__builtin_ia32_punpcklwd", IX86_BUILTIN_PUNPCKLWD, UNKNOWN, (int) V4HI_FTYPE_V4HI_V4HI},
+ { OPTION_MASK_ISA_MMX, CODE_FOR_mmx_punpckldq, "__builtin_ia32_punpckldq", IX86_BUILTIN_PUNPCKLDQ, UNKNOWN, (int) V2SI_FTYPE_V2SI_V2SI},
+
+ { OPTION_MASK_ISA_MMX, CODE_FOR_mmx_packsswb, "__builtin_ia32_packsswb", IX86_BUILTIN_PACKSSWB, UNKNOWN, (int) V8QI_FTYPE_V4HI_V4HI },
+ { OPTION_MASK_ISA_MMX, CODE_FOR_mmx_packssdw, "__builtin_ia32_packssdw", IX86_BUILTIN_PACKSSDW, UNKNOWN, (int) V4HI_FTYPE_V2SI_V2SI },
+ { OPTION_MASK_ISA_MMX, CODE_FOR_mmx_packuswb, "__builtin_ia32_packuswb", IX86_BUILTIN_PACKUSWB, UNKNOWN, (int) V8QI_FTYPE_V4HI_V4HI },
+
+ { OPTION_MASK_ISA_MMX, CODE_FOR_mmx_pmaddwd, "__builtin_ia32_pmaddwd", IX86_BUILTIN_PMADDWD, UNKNOWN, (int) V2SI_FTYPE_V4HI_V4HI },
+
+ { OPTION_MASK_ISA_MMX, CODE_FOR_mmx_ashlv4hi3, "__builtin_ia32_psllwi", IX86_BUILTIN_PSLLWI, UNKNOWN, (int) V4HI_FTYPE_V4HI_SI_COUNT },
+ { OPTION_MASK_ISA_MMX, CODE_FOR_mmx_ashlv2si3, "__builtin_ia32_pslldi", IX86_BUILTIN_PSLLDI, UNKNOWN, (int) V2SI_FTYPE_V2SI_SI_COUNT },
+ { OPTION_MASK_ISA_MMX, CODE_FOR_mmx_ashlv1di3, "__builtin_ia32_psllqi", IX86_BUILTIN_PSLLQI, UNKNOWN, (int) V1DI_FTYPE_V1DI_SI_COUNT },
+ { OPTION_MASK_ISA_MMX, CODE_FOR_mmx_ashlv4hi3, "__builtin_ia32_psllw", IX86_BUILTIN_PSLLW, UNKNOWN, (int) V4HI_FTYPE_V4HI_V4HI_COUNT },
+ { OPTION_MASK_ISA_MMX, CODE_FOR_mmx_ashlv2si3, "__builtin_ia32_pslld", IX86_BUILTIN_PSLLD, UNKNOWN, (int) V2SI_FTYPE_V2SI_V2SI_COUNT },
+ { OPTION_MASK_ISA_MMX, CODE_FOR_mmx_ashlv1di3, "__builtin_ia32_psllq", IX86_BUILTIN_PSLLQ, UNKNOWN, (int) V1DI_FTYPE_V1DI_V1DI_COUNT },
+
+ { OPTION_MASK_ISA_MMX, CODE_FOR_mmx_lshrv4hi3, "__builtin_ia32_psrlwi", IX86_BUILTIN_PSRLWI, UNKNOWN, (int) V4HI_FTYPE_V4HI_SI_COUNT },
+ { OPTION_MASK_ISA_MMX, CODE_FOR_mmx_lshrv2si3, "__builtin_ia32_psrldi", IX86_BUILTIN_PSRLDI, UNKNOWN, (int) V2SI_FTYPE_V2SI_SI_COUNT },
+ { OPTION_MASK_ISA_MMX, CODE_FOR_mmx_lshrv1di3, "__builtin_ia32_psrlqi", IX86_BUILTIN_PSRLQI, UNKNOWN, (int) V1DI_FTYPE_V1DI_SI_COUNT },
+ { OPTION_MASK_ISA_MMX, CODE_FOR_mmx_lshrv4hi3, "__builtin_ia32_psrlw", IX86_BUILTIN_PSRLW, UNKNOWN, (int) V4HI_FTYPE_V4HI_V4HI_COUNT },
+ { OPTION_MASK_ISA_MMX, CODE_FOR_mmx_lshrv2si3, "__builtin_ia32_psrld", IX86_BUILTIN_PSRLD, UNKNOWN, (int) V2SI_FTYPE_V2SI_V2SI_COUNT },
+ { OPTION_MASK_ISA_MMX, CODE_FOR_mmx_lshrv1di3, "__builtin_ia32_psrlq", IX86_BUILTIN_PSRLQ, UNKNOWN, (int) V1DI_FTYPE_V1DI_V1DI_COUNT },
+
+ { OPTION_MASK_ISA_MMX, CODE_FOR_mmx_ashrv4hi3, "__builtin_ia32_psrawi", IX86_BUILTIN_PSRAWI, UNKNOWN, (int) V4HI_FTYPE_V4HI_SI_COUNT },
+ { OPTION_MASK_ISA_MMX, CODE_FOR_mmx_ashrv2si3, "__builtin_ia32_psradi", IX86_BUILTIN_PSRADI, UNKNOWN, (int) V2SI_FTYPE_V2SI_SI_COUNT },
+ { OPTION_MASK_ISA_MMX, CODE_FOR_mmx_ashrv4hi3, "__builtin_ia32_psraw", IX86_BUILTIN_PSRAW, UNKNOWN, (int) V4HI_FTYPE_V4HI_V4HI_COUNT },
+ { OPTION_MASK_ISA_MMX, CODE_FOR_mmx_ashrv2si3, "__builtin_ia32_psrad", IX86_BUILTIN_PSRAD, UNKNOWN, (int) V2SI_FTYPE_V2SI_V2SI_COUNT },
+
+ /* 3DNow! */
+ { OPTION_MASK_ISA_3DNOW, CODE_FOR_mmx_pf2id, "__builtin_ia32_pf2id", IX86_BUILTIN_PF2ID, UNKNOWN, (int) V2SI_FTYPE_V2SF },
+ { OPTION_MASK_ISA_3DNOW, CODE_FOR_mmx_floatv2si2, "__builtin_ia32_pi2fd", IX86_BUILTIN_PI2FD, UNKNOWN, (int) V2SF_FTYPE_V2SI },
+ { OPTION_MASK_ISA_3DNOW, CODE_FOR_mmx_rcpv2sf2, "__builtin_ia32_pfrcp", IX86_BUILTIN_PFRCP, UNKNOWN, (int) V2SF_FTYPE_V2SF },
+ { OPTION_MASK_ISA_3DNOW, CODE_FOR_mmx_rsqrtv2sf2, "__builtin_ia32_pfrsqrt", IX86_BUILTIN_PFRSQRT, UNKNOWN, (int) V2SF_FTYPE_V2SF },
+
+ { OPTION_MASK_ISA_3DNOW, CODE_FOR_mmx_uavgv8qi3, "__builtin_ia32_pavgusb", IX86_BUILTIN_PAVGUSB, UNKNOWN, (int) V8QI_FTYPE_V8QI_V8QI },
+ { OPTION_MASK_ISA_3DNOW, CODE_FOR_mmx_haddv2sf3, "__builtin_ia32_pfacc", IX86_BUILTIN_PFACC, UNKNOWN, (int) V2SF_FTYPE_V2SF_V2SF },
+ { OPTION_MASK_ISA_3DNOW, CODE_FOR_mmx_addv2sf3, "__builtin_ia32_pfadd", IX86_BUILTIN_PFADD, UNKNOWN, (int) V2SF_FTYPE_V2SF_V2SF },
+ { OPTION_MASK_ISA_3DNOW, CODE_FOR_mmx_eqv2sf3, "__builtin_ia32_pfcmpeq", IX86_BUILTIN_PFCMPEQ, UNKNOWN, (int) V2SI_FTYPE_V2SF_V2SF },
+ { OPTION_MASK_ISA_3DNOW, CODE_FOR_mmx_gev2sf3, "__builtin_ia32_pfcmpge", IX86_BUILTIN_PFCMPGE, UNKNOWN, (int) V2SI_FTYPE_V2SF_V2SF },
+ { OPTION_MASK_ISA_3DNOW, CODE_FOR_mmx_gtv2sf3, "__builtin_ia32_pfcmpgt", IX86_BUILTIN_PFCMPGT, UNKNOWN, (int) V2SI_FTYPE_V2SF_V2SF },
+ { OPTION_MASK_ISA_3DNOW, CODE_FOR_mmx_smaxv2sf3, "__builtin_ia32_pfmax", IX86_BUILTIN_PFMAX, UNKNOWN, (int) V2SF_FTYPE_V2SF_V2SF },
+ { OPTION_MASK_ISA_3DNOW, CODE_FOR_mmx_sminv2sf3, "__builtin_ia32_pfmin", IX86_BUILTIN_PFMIN, UNKNOWN, (int) V2SF_FTYPE_V2SF_V2SF },
+ { OPTION_MASK_ISA_3DNOW, CODE_FOR_mmx_mulv2sf3, "__builtin_ia32_pfmul", IX86_BUILTIN_PFMUL, UNKNOWN, (int) V2SF_FTYPE_V2SF_V2SF },
+ { OPTION_MASK_ISA_3DNOW, CODE_FOR_mmx_rcpit1v2sf3, "__builtin_ia32_pfrcpit1", IX86_BUILTIN_PFRCPIT1, UNKNOWN, (int) V2SF_FTYPE_V2SF_V2SF },
+ { OPTION_MASK_ISA_3DNOW, CODE_FOR_mmx_rcpit2v2sf3, "__builtin_ia32_pfrcpit2", IX86_BUILTIN_PFRCPIT2, UNKNOWN, (int) V2SF_FTYPE_V2SF_V2SF },
+ { OPTION_MASK_ISA_3DNOW, CODE_FOR_mmx_rsqit1v2sf3, "__builtin_ia32_pfrsqit1", IX86_BUILTIN_PFRSQIT1, UNKNOWN, (int) V2SF_FTYPE_V2SF_V2SF },
+ { OPTION_MASK_ISA_3DNOW, CODE_FOR_mmx_subv2sf3, "__builtin_ia32_pfsub", IX86_BUILTIN_PFSUB, UNKNOWN, (int) V2SF_FTYPE_V2SF_V2SF },
+ { OPTION_MASK_ISA_3DNOW, CODE_FOR_mmx_subrv2sf3, "__builtin_ia32_pfsubr", IX86_BUILTIN_PFSUBR, UNKNOWN, (int) V2SF_FTYPE_V2SF_V2SF },
+ { OPTION_MASK_ISA_3DNOW, CODE_FOR_mmx_pmulhrwv4hi3, "__builtin_ia32_pmulhrw", IX86_BUILTIN_PMULHRW, UNKNOWN, (int) V4HI_FTYPE_V4HI_V4HI },
+
+ /* 3DNow!A */
+ { OPTION_MASK_ISA_3DNOW_A, CODE_FOR_mmx_pf2iw, "__builtin_ia32_pf2iw", IX86_BUILTIN_PF2IW, UNKNOWN, (int) V2SI_FTYPE_V2SF },
+ { OPTION_MASK_ISA_3DNOW_A, CODE_FOR_mmx_pi2fw, "__builtin_ia32_pi2fw", IX86_BUILTIN_PI2FW, UNKNOWN, (int) V2SF_FTYPE_V2SI },
+ { OPTION_MASK_ISA_3DNOW_A, CODE_FOR_mmx_pswapdv2si2, "__builtin_ia32_pswapdsi", IX86_BUILTIN_PSWAPDSI, UNKNOWN, (int) V2SI_FTYPE_V2SI },
+ { OPTION_MASK_ISA_3DNOW_A, CODE_FOR_mmx_pswapdv2sf2, "__builtin_ia32_pswapdsf", IX86_BUILTIN_PSWAPDSF, UNKNOWN, (int) V2SF_FTYPE_V2SF },
+ { OPTION_MASK_ISA_3DNOW_A, CODE_FOR_mmx_hsubv2sf3, "__builtin_ia32_pfnacc", IX86_BUILTIN_PFNACC, UNKNOWN, (int) V2SF_FTYPE_V2SF_V2SF },
+ { OPTION_MASK_ISA_3DNOW_A, CODE_FOR_mmx_addsubv2sf3, "__builtin_ia32_pfpnacc", IX86_BUILTIN_PFPNACC, UNKNOWN, (int) V2SF_FTYPE_V2SF_V2SF },
+
/* SSE */
+ { OPTION_MASK_ISA_SSE, CODE_FOR_sse_movmskps, "__builtin_ia32_movmskps", IX86_BUILTIN_MOVMSKPS, UNKNOWN, (int) INT_FTYPE_V4SF },
+ { OPTION_MASK_ISA_SSE, CODE_FOR_sse_sqrtv4sf2, "__builtin_ia32_sqrtps", IX86_BUILTIN_SQRTPS, UNKNOWN, (int) V4SF_FTYPE_V4SF },
+ { OPTION_MASK_ISA_SSE, CODE_FOR_sqrtv4sf2, "__builtin_ia32_sqrtps_nr", IX86_BUILTIN_SQRTPS_NR, UNKNOWN, (int) V4SF_FTYPE_V4SF },
+ { OPTION_MASK_ISA_SSE, CODE_FOR_sse_rsqrtv4sf2, "__builtin_ia32_rsqrtps", IX86_BUILTIN_RSQRTPS, UNKNOWN, (int) V4SF_FTYPE_V4SF },
+ { OPTION_MASK_ISA_SSE, CODE_FOR_rsqrtv4sf2, "__builtin_ia32_rsqrtps_nr", IX86_BUILTIN_RSQRTPS_NR, UNKNOWN, (int) V4SF_FTYPE_V4SF },
+ { OPTION_MASK_ISA_SSE, CODE_FOR_sse_rcpv4sf2, "__builtin_ia32_rcpps", IX86_BUILTIN_RCPPS, UNKNOWN, (int) V4SF_FTYPE_V4SF },
+ { OPTION_MASK_ISA_SSE, CODE_FOR_sse_cvtps2pi, "__builtin_ia32_cvtps2pi", IX86_BUILTIN_CVTPS2PI, UNKNOWN, (int) V2SI_FTYPE_V4SF },
+ { OPTION_MASK_ISA_SSE, CODE_FOR_sse_cvtss2si, "__builtin_ia32_cvtss2si", IX86_BUILTIN_CVTSS2SI, UNKNOWN, (int) INT_FTYPE_V4SF },
+ { OPTION_MASK_ISA_SSE | OPTION_MASK_ISA_64BIT, CODE_FOR_sse_cvtss2siq, "__builtin_ia32_cvtss2si64", IX86_BUILTIN_CVTSS2SI64, UNKNOWN, (int) INT64_FTYPE_V4SF },
+ { OPTION_MASK_ISA_SSE, CODE_FOR_sse_cvttps2pi, "__builtin_ia32_cvttps2pi", IX86_BUILTIN_CVTTPS2PI, UNKNOWN, (int) V2SI_FTYPE_V4SF },
+ { OPTION_MASK_ISA_SSE, CODE_FOR_sse_cvttss2si, "__builtin_ia32_cvttss2si", IX86_BUILTIN_CVTTSS2SI, UNKNOWN, (int) INT_FTYPE_V4SF },
+ { OPTION_MASK_ISA_SSE | OPTION_MASK_ISA_64BIT, CODE_FOR_sse_cvttss2siq, "__builtin_ia32_cvttss2si64", IX86_BUILTIN_CVTTSS2SI64, UNKNOWN, (int) INT64_FTYPE_V4SF },
+
{ OPTION_MASK_ISA_SSE, CODE_FOR_sse_shufps, "__builtin_ia32_shufps", IX86_BUILTIN_SHUFPS, UNKNOWN, (int) V4SF_FTYPE_V4SF_V4SF_INT },
+ { OPTION_MASK_ISA_SSE, CODE_FOR_addv4sf3, "__builtin_ia32_addps", IX86_BUILTIN_ADDPS, UNKNOWN, (int) V4SF_FTYPE_V4SF_V4SF },
+ { OPTION_MASK_ISA_SSE, CODE_FOR_subv4sf3, "__builtin_ia32_subps", IX86_BUILTIN_SUBPS, UNKNOWN, (int) V4SF_FTYPE_V4SF_V4SF },
+ { OPTION_MASK_ISA_SSE, CODE_FOR_mulv4sf3, "__builtin_ia32_mulps", IX86_BUILTIN_MULPS, UNKNOWN, (int) V4SF_FTYPE_V4SF_V4SF },
+ { OPTION_MASK_ISA_SSE, CODE_FOR_sse_divv4sf3, "__builtin_ia32_divps", IX86_BUILTIN_DIVPS, UNKNOWN, (int) V4SF_FTYPE_V4SF_V4SF },
+ { OPTION_MASK_ISA_SSE, CODE_FOR_sse_vmaddv4sf3, "__builtin_ia32_addss", IX86_BUILTIN_ADDSS, UNKNOWN, (int) V4SF_FTYPE_V4SF_V4SF },
+ { OPTION_MASK_ISA_SSE, CODE_FOR_sse_vmsubv4sf3, "__builtin_ia32_subss", IX86_BUILTIN_SUBSS, UNKNOWN, (int) V4SF_FTYPE_V4SF_V4SF },
+ { OPTION_MASK_ISA_SSE, CODE_FOR_sse_vmmulv4sf3, "__builtin_ia32_mulss", IX86_BUILTIN_MULSS, UNKNOWN, (int) V4SF_FTYPE_V4SF_V4SF },
+ { OPTION_MASK_ISA_SSE, CODE_FOR_sse_vmdivv4sf3, "__builtin_ia32_divss", IX86_BUILTIN_DIVSS, UNKNOWN, (int) V4SF_FTYPE_V4SF_V4SF },
+
+ { OPTION_MASK_ISA_SSE, CODE_FOR_sse_maskcmpv4sf3, "__builtin_ia32_cmpeqps", IX86_BUILTIN_CMPEQPS, EQ, (int) V4SF_FTYPE_V4SF_V4SF },
+ { OPTION_MASK_ISA_SSE, CODE_FOR_sse_maskcmpv4sf3, "__builtin_ia32_cmpltps", IX86_BUILTIN_CMPLTPS, LT, (int) V4SF_FTYPE_V4SF_V4SF },
+ { OPTION_MASK_ISA_SSE, CODE_FOR_sse_maskcmpv4sf3, "__builtin_ia32_cmpleps", IX86_BUILTIN_CMPLEPS, LE, (int) V4SF_FTYPE_V4SF_V4SF },
+ { OPTION_MASK_ISA_SSE, CODE_FOR_sse_maskcmpv4sf3, "__builtin_ia32_cmpgtps", IX86_BUILTIN_CMPGTPS, LT, (int) V4SF_FTYPE_V4SF_V4SF_SWAP },
+ { OPTION_MASK_ISA_SSE, CODE_FOR_sse_maskcmpv4sf3, "__builtin_ia32_cmpgeps", IX86_BUILTIN_CMPGEPS, LE, (int) V4SF_FTYPE_V4SF_V4SF_SWAP },
+ { OPTION_MASK_ISA_SSE, CODE_FOR_sse_maskcmpv4sf3, "__builtin_ia32_cmpunordps", IX86_BUILTIN_CMPUNORDPS, UNORDERED, (int) V4SF_FTYPE_V4SF_V4SF },
+ { OPTION_MASK_ISA_SSE, CODE_FOR_sse_maskcmpv4sf3, "__builtin_ia32_cmpneqps", IX86_BUILTIN_CMPNEQPS, NE, (int) V4SF_FTYPE_V4SF_V4SF },
+ { OPTION_MASK_ISA_SSE, CODE_FOR_sse_maskcmpv4sf3, "__builtin_ia32_cmpnltps", IX86_BUILTIN_CMPNLTPS, UNGE, (int) V4SF_FTYPE_V4SF_V4SF },
+ { OPTION_MASK_ISA_SSE, CODE_FOR_sse_maskcmpv4sf3, "__builtin_ia32_cmpnleps", IX86_BUILTIN_CMPNLEPS, UNGT, (int) V4SF_FTYPE_V4SF_V4SF },
+ { OPTION_MASK_ISA_SSE, CODE_FOR_sse_maskcmpv4sf3, "__builtin_ia32_cmpngtps", IX86_BUILTIN_CMPNGTPS, UNGE, (int) V4SF_FTYPE_V4SF_V4SF_SWAP },
+ { OPTION_MASK_ISA_SSE, CODE_FOR_sse_maskcmpv4sf3, "__builtin_ia32_cmpngeps", IX86_BUILTIN_CMPNGEPS, UNGT, (int) V4SF_FTYPE_V4SF_V4SF_SWAP},
+ { OPTION_MASK_ISA_SSE, CODE_FOR_sse_maskcmpv4sf3, "__builtin_ia32_cmpordps", IX86_BUILTIN_CMPORDPS, ORDERED, (int) V4SF_FTYPE_V4SF_V4SF },
+ { OPTION_MASK_ISA_SSE, CODE_FOR_sse_vmmaskcmpv4sf3, "__builtin_ia32_cmpeqss", IX86_BUILTIN_CMPEQSS, EQ, (int) V4SF_FTYPE_V4SF_V4SF },
+ { OPTION_MASK_ISA_SSE, CODE_FOR_sse_vmmaskcmpv4sf3, "__builtin_ia32_cmpltss", IX86_BUILTIN_CMPLTSS, LT, (int) V4SF_FTYPE_V4SF_V4SF },
+ { OPTION_MASK_ISA_SSE, CODE_FOR_sse_vmmaskcmpv4sf3, "__builtin_ia32_cmpless", IX86_BUILTIN_CMPLESS, LE, (int) V4SF_FTYPE_V4SF_V4SF },
+ { OPTION_MASK_ISA_SSE, CODE_FOR_sse_vmmaskcmpv4sf3, "__builtin_ia32_cmpunordss", IX86_BUILTIN_CMPUNORDSS, UNORDERED, (int) V4SF_FTYPE_V4SF_V4SF },
+ { OPTION_MASK_ISA_SSE, CODE_FOR_sse_vmmaskcmpv4sf3, "__builtin_ia32_cmpneqss", IX86_BUILTIN_CMPNEQSS, NE, (int) V4SF_FTYPE_V4SF_V4SF },
+ { OPTION_MASK_ISA_SSE, CODE_FOR_sse_vmmaskcmpv4sf3, "__builtin_ia32_cmpnltss", IX86_BUILTIN_CMPNLTSS, UNGE, (int) V4SF_FTYPE_V4SF_V4SF },
+ { OPTION_MASK_ISA_SSE, CODE_FOR_sse_vmmaskcmpv4sf3, "__builtin_ia32_cmpnless", IX86_BUILTIN_CMPNLESS, UNGT, (int) V4SF_FTYPE_V4SF_V4SF },
+ { OPTION_MASK_ISA_SSE, CODE_FOR_sse_vmmaskcmpv4sf3, "__builtin_ia32_cmpngtss", IX86_BUILTIN_CMPNGTSS, UNGE, (int) V4SF_FTYPE_V4SF_V4SF_SWAP },
+ { OPTION_MASK_ISA_SSE, CODE_FOR_sse_vmmaskcmpv4sf3, "__builtin_ia32_cmpngess", IX86_BUILTIN_CMPNGESS, UNGT, (int) V4SF_FTYPE_V4SF_V4SF_SWAP },
+ { OPTION_MASK_ISA_SSE, CODE_FOR_sse_vmmaskcmpv4sf3, "__builtin_ia32_cmpordss", IX86_BUILTIN_CMPORDSS, ORDERED, (int) V4SF_FTYPE_V4SF_V4SF },
+
+ { OPTION_MASK_ISA_SSE, CODE_FOR_sminv4sf3, "__builtin_ia32_minps", IX86_BUILTIN_MINPS, UNKNOWN, (int) V4SF_FTYPE_V4SF_V4SF },
+ { OPTION_MASK_ISA_SSE, CODE_FOR_smaxv4sf3, "__builtin_ia32_maxps", IX86_BUILTIN_MAXPS, UNKNOWN, (int) V4SF_FTYPE_V4SF_V4SF },
+ { OPTION_MASK_ISA_SSE, CODE_FOR_sse_vmsminv4sf3, "__builtin_ia32_minss", IX86_BUILTIN_MINSS, UNKNOWN, (int) V4SF_FTYPE_V4SF_V4SF },
+ { OPTION_MASK_ISA_SSE, CODE_FOR_sse_vmsmaxv4sf3, "__builtin_ia32_maxss", IX86_BUILTIN_MAXSS, UNKNOWN, (int) V4SF_FTYPE_V4SF_V4SF },
+
+ { OPTION_MASK_ISA_SSE, CODE_FOR_andv4sf3, "__builtin_ia32_andps", IX86_BUILTIN_ANDPS, UNKNOWN, (int) V4SF_FTYPE_V4SF_V4SF },
+ { OPTION_MASK_ISA_SSE, CODE_FOR_sse_nandv4sf3, "__builtin_ia32_andnps", IX86_BUILTIN_ANDNPS, UNKNOWN, (int) V4SF_FTYPE_V4SF_V4SF },
+ { OPTION_MASK_ISA_SSE, CODE_FOR_iorv4sf3, "__builtin_ia32_orps", IX86_BUILTIN_ORPS, UNKNOWN, (int) V4SF_FTYPE_V4SF_V4SF },
+ { OPTION_MASK_ISA_SSE, CODE_FOR_xorv4sf3, "__builtin_ia32_xorps", IX86_BUILTIN_XORPS, UNKNOWN, (int) V4SF_FTYPE_V4SF_V4SF },
+
+ { OPTION_MASK_ISA_SSE, CODE_FOR_sse_movss, "__builtin_ia32_movss", IX86_BUILTIN_MOVSS, UNKNOWN, (int) V4SF_FTYPE_V4SF_V4SF },
+ { OPTION_MASK_ISA_SSE, CODE_FOR_sse_movhlps, "__builtin_ia32_movhlps", IX86_BUILTIN_MOVHLPS, UNKNOWN, (int) V4SF_FTYPE_V4SF_V4SF },
+ { OPTION_MASK_ISA_SSE, CODE_FOR_sse_movlhps, "__builtin_ia32_movlhps", IX86_BUILTIN_MOVLHPS, UNKNOWN, (int) V4SF_FTYPE_V4SF_V4SF },
+ { OPTION_MASK_ISA_SSE, CODE_FOR_sse_unpckhps, "__builtin_ia32_unpckhps", IX86_BUILTIN_UNPCKHPS, UNKNOWN, (int) V4SF_FTYPE_V4SF_V4SF },
+ { OPTION_MASK_ISA_SSE, CODE_FOR_sse_unpcklps, "__builtin_ia32_unpcklps", IX86_BUILTIN_UNPCKLPS, UNKNOWN, (int) V4SF_FTYPE_V4SF_V4SF },
+
+ { OPTION_MASK_ISA_SSE, CODE_FOR_sse_cvtpi2ps, "__builtin_ia32_cvtpi2ps", IX86_BUILTIN_CVTPI2PS, UNKNOWN, (int) V4SF_FTYPE_V4SF_V2SI },
+ { OPTION_MASK_ISA_SSE, CODE_FOR_sse_cvtsi2ss, "__builtin_ia32_cvtsi2ss", IX86_BUILTIN_CVTSI2SS, UNKNOWN, (int) V4SF_FTYPE_V4SF_SI },
+ { OPTION_MASK_ISA_SSE | OPTION_MASK_ISA_64BIT, CODE_FOR_sse_cvtsi2ssq, "__builtin_ia32_cvtsi642ss", IX86_BUILTIN_CVTSI642SS, UNKNOWN, V4SF_FTYPE_V4SF_DI },
+
+ { OPTION_MASK_ISA_SSE, CODE_FOR_rsqrtsf2, "__builtin_ia32_rsqrtf", IX86_BUILTIN_RSQRTF, UNKNOWN, (int) FLOAT_FTYPE_FLOAT },
+
+ { OPTION_MASK_ISA_SSE, CODE_FOR_sse_vmsqrtv4sf2, "__builtin_ia32_sqrtss", IX86_BUILTIN_SQRTSS, UNKNOWN, (int) V4SF_FTYPE_V4SF_VEC_MERGE },
+ { OPTION_MASK_ISA_SSE, CODE_FOR_sse_vmrsqrtv4sf2, "__builtin_ia32_rsqrtss", IX86_BUILTIN_RSQRTSS, UNKNOWN, (int) V4SF_FTYPE_V4SF_VEC_MERGE },
+ { OPTION_MASK_ISA_SSE, CODE_FOR_sse_vmrcpv4sf2, "__builtin_ia32_rcpss", IX86_BUILTIN_RCPSS, UNKNOWN, (int) V4SF_FTYPE_V4SF_VEC_MERGE },
+
+ /* SSE MMX or 3Dnow!A */
+ { OPTION_MASK_ISA_SSE | OPTION_MASK_ISA_3DNOW_A, CODE_FOR_mmx_uavgv8qi3, "__builtin_ia32_pavgb", IX86_BUILTIN_PAVGB, UNKNOWN, (int) V8QI_FTYPE_V8QI_V8QI },
+ { OPTION_MASK_ISA_SSE | OPTION_MASK_ISA_3DNOW_A, CODE_FOR_mmx_uavgv4hi3, "__builtin_ia32_pavgw", IX86_BUILTIN_PAVGW, UNKNOWN, (int) V4HI_FTYPE_V4HI_V4HI },
+ { OPTION_MASK_ISA_SSE | OPTION_MASK_ISA_3DNOW_A, CODE_FOR_mmx_umulv4hi3_highpart, "__builtin_ia32_pmulhuw", IX86_BUILTIN_PMULHUW, UNKNOWN, (int) V4HI_FTYPE_V4HI_V4HI },
+
+ { OPTION_MASK_ISA_SSE | OPTION_MASK_ISA_3DNOW_A, CODE_FOR_mmx_umaxv8qi3, "__builtin_ia32_pmaxub", IX86_BUILTIN_PMAXUB, UNKNOWN, (int) V8QI_FTYPE_V8QI_V8QI },
+ { OPTION_MASK_ISA_SSE | OPTION_MASK_ISA_3DNOW_A, CODE_FOR_mmx_smaxv4hi3, "__builtin_ia32_pmaxsw", IX86_BUILTIN_PMAXSW, UNKNOWN, (int) V4HI_FTYPE_V4HI_V4HI },
+ { OPTION_MASK_ISA_SSE | OPTION_MASK_ISA_3DNOW_A, CODE_FOR_mmx_uminv8qi3, "__builtin_ia32_pminub", IX86_BUILTIN_PMINUB, UNKNOWN, (int) V8QI_FTYPE_V8QI_V8QI },
+ { OPTION_MASK_ISA_SSE | OPTION_MASK_ISA_3DNOW_A, CODE_FOR_mmx_sminv4hi3, "__builtin_ia32_pminsw", IX86_BUILTIN_PMINSW, UNKNOWN, (int) V4HI_FTYPE_V4HI_V4HI },
+
+ { OPTION_MASK_ISA_SSE | OPTION_MASK_ISA_3DNOW_A, CODE_FOR_mmx_psadbw, "__builtin_ia32_psadbw", IX86_BUILTIN_PSADBW, UNKNOWN, (int) V1DI_FTYPE_V8QI_V8QI },
+ { OPTION_MASK_ISA_SSE | OPTION_MASK_ISA_3DNOW_A, CODE_FOR_mmx_pmovmskb, "__builtin_ia32_pmovmskb", IX86_BUILTIN_PMOVMSKB, UNKNOWN, (int) INT_FTYPE_V8QI },
+
+ { OPTION_MASK_ISA_SSE | OPTION_MASK_ISA_3DNOW_A, CODE_FOR_mmx_pshufw, "__builtin_ia32_pshufw", IX86_BUILTIN_PSHUFW, UNKNOWN, (int) V4HI_FTYPE_V4HI_INT },
+
/* SSE2 */
{ OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_shufpd, "__builtin_ia32_shufpd", IX86_BUILTIN_SHUFPD, UNKNOWN, (int) V2DF_FTYPE_V2DF_V2DF_INT },
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_movmskpd, "__builtin_ia32_movmskpd", IX86_BUILTIN_MOVMSKPD, UNKNOWN, (int) INT_FTYPE_V2DF },
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_pmovmskb, "__builtin_ia32_pmovmskb128", IX86_BUILTIN_PMOVMSKB128, UNKNOWN, (int) INT_FTYPE_V16QI },
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_sqrtv2df2, "__builtin_ia32_sqrtpd", IX86_BUILTIN_SQRTPD, UNKNOWN, (int) V2DF_FTYPE_V2DF },
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_cvtdq2pd, "__builtin_ia32_cvtdq2pd", IX86_BUILTIN_CVTDQ2PD, UNKNOWN, (int) V2DF_FTYPE_V4SI },
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_cvtdq2ps, "__builtin_ia32_cvtdq2ps", IX86_BUILTIN_CVTDQ2PS, UNKNOWN, (int) V4SF_FTYPE_V4SI },
+
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_cvtpd2dq, "__builtin_ia32_cvtpd2dq", IX86_BUILTIN_CVTPD2DQ, UNKNOWN, (int) V4SI_FTYPE_V2DF },
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_cvtpd2pi, "__builtin_ia32_cvtpd2pi", IX86_BUILTIN_CVTPD2PI, UNKNOWN, (int) V2SI_FTYPE_V2DF },
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_cvtpd2ps, "__builtin_ia32_cvtpd2ps", IX86_BUILTIN_CVTPD2PS, UNKNOWN, (int) V4SF_FTYPE_V2DF },
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_cvttpd2dq, "__builtin_ia32_cvttpd2dq", IX86_BUILTIN_CVTTPD2DQ, UNKNOWN, (int) V4SI_FTYPE_V2DF },
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_cvttpd2pi, "__builtin_ia32_cvttpd2pi", IX86_BUILTIN_CVTTPD2PI, UNKNOWN, (int) V2SI_FTYPE_V2DF },
+
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_cvtpi2pd, "__builtin_ia32_cvtpi2pd", IX86_BUILTIN_CVTPI2PD, UNKNOWN, (int) V2DF_FTYPE_V2SI },
+
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_cvtsd2si, "__builtin_ia32_cvtsd2si", IX86_BUILTIN_CVTSD2SI, UNKNOWN, (int) INT_FTYPE_V2DF },
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_cvttsd2si, "__builtin_ia32_cvttsd2si", IX86_BUILTIN_CVTTSD2SI, UNKNOWN, (int) INT_FTYPE_V2DF },
+ { OPTION_MASK_ISA_SSE2 | OPTION_MASK_ISA_64BIT, CODE_FOR_sse2_cvtsd2siq, "__builtin_ia32_cvtsd2si64", IX86_BUILTIN_CVTSD2SI64, UNKNOWN, (int) INT64_FTYPE_V2DF },
+ { OPTION_MASK_ISA_SSE2 | OPTION_MASK_ISA_64BIT, CODE_FOR_sse2_cvttsd2siq, "__builtin_ia32_cvttsd2si64", IX86_BUILTIN_CVTTSD2SI64, UNKNOWN, (int) INT64_FTYPE_V2DF },
+
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_cvtps2dq, "__builtin_ia32_cvtps2dq", IX86_BUILTIN_CVTPS2DQ, UNKNOWN, (int) V4SI_FTYPE_V4SF },
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_cvtps2pd, "__builtin_ia32_cvtps2pd", IX86_BUILTIN_CVTPS2PD, UNKNOWN, (int) V2DF_FTYPE_V4SF },
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_cvttps2dq, "__builtin_ia32_cvttps2dq", IX86_BUILTIN_CVTTPS2DQ, UNKNOWN, (int) V4SI_FTYPE_V4SF },
+
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_addv2df3, "__builtin_ia32_addpd", IX86_BUILTIN_ADDPD, UNKNOWN, (int) V2DF_FTYPE_V2DF_V2DF },
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_subv2df3, "__builtin_ia32_subpd", IX86_BUILTIN_SUBPD, UNKNOWN, (int) V2DF_FTYPE_V2DF_V2DF },
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_mulv2df3, "__builtin_ia32_mulpd", IX86_BUILTIN_MULPD, UNKNOWN, (int) V2DF_FTYPE_V2DF_V2DF },
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_divv2df3, "__builtin_ia32_divpd", IX86_BUILTIN_DIVPD, UNKNOWN, (int) V2DF_FTYPE_V2DF_V2DF },
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_vmaddv2df3, "__builtin_ia32_addsd", IX86_BUILTIN_ADDSD, UNKNOWN, (int) V2DF_FTYPE_V2DF_V2DF },
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_vmsubv2df3, "__builtin_ia32_subsd", IX86_BUILTIN_SUBSD, UNKNOWN, (int) V2DF_FTYPE_V2DF_V2DF },
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_vmmulv2df3, "__builtin_ia32_mulsd", IX86_BUILTIN_MULSD, UNKNOWN, (int) V2DF_FTYPE_V2DF_V2DF },
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_vmdivv2df3, "__builtin_ia32_divsd", IX86_BUILTIN_DIVSD, UNKNOWN, (int) V2DF_FTYPE_V2DF_V2DF },
+
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_maskcmpv2df3, "__builtin_ia32_cmpeqpd", IX86_BUILTIN_CMPEQPD, EQ, (int) V2DF_FTYPE_V2DF_V2DF },
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_maskcmpv2df3, "__builtin_ia32_cmpltpd", IX86_BUILTIN_CMPLTPD, LT, (int) V2DF_FTYPE_V2DF_V2DF },
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_maskcmpv2df3, "__builtin_ia32_cmplepd", IX86_BUILTIN_CMPLEPD, LE, (int) V2DF_FTYPE_V2DF_V2DF },
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_maskcmpv2df3, "__builtin_ia32_cmpgtpd", IX86_BUILTIN_CMPGTPD, LT, (int) V2DF_FTYPE_V2DF_V2DF_SWAP },
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_maskcmpv2df3, "__builtin_ia32_cmpgepd", IX86_BUILTIN_CMPGEPD, LE, (int) V2DF_FTYPE_V2DF_V2DF_SWAP},
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_maskcmpv2df3, "__builtin_ia32_cmpunordpd", IX86_BUILTIN_CMPUNORDPD, UNORDERED, (int) V2DF_FTYPE_V2DF_V2DF },
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_maskcmpv2df3, "__builtin_ia32_cmpneqpd", IX86_BUILTIN_CMPNEQPD, NE, (int) V2DF_FTYPE_V2DF_V2DF },
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_maskcmpv2df3, "__builtin_ia32_cmpnltpd", IX86_BUILTIN_CMPNLTPD, UNGE, (int) V2DF_FTYPE_V2DF_V2DF },
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_maskcmpv2df3, "__builtin_ia32_cmpnlepd", IX86_BUILTIN_CMPNLEPD, UNGT, (int) V2DF_FTYPE_V2DF_V2DF },
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_maskcmpv2df3, "__builtin_ia32_cmpngtpd", IX86_BUILTIN_CMPNGTPD, UNGE, (int) V2DF_FTYPE_V2DF_V2DF_SWAP },
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_maskcmpv2df3, "__builtin_ia32_cmpngepd", IX86_BUILTIN_CMPNGEPD, UNGT, (int) V2DF_FTYPE_V2DF_V2DF_SWAP },
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_maskcmpv2df3, "__builtin_ia32_cmpordpd", IX86_BUILTIN_CMPORDPD, ORDERED, (int) V2DF_FTYPE_V2DF_V2DF },
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_vmmaskcmpv2df3, "__builtin_ia32_cmpeqsd", IX86_BUILTIN_CMPEQSD, EQ, (int) V2DF_FTYPE_V2DF_V2DF },
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_vmmaskcmpv2df3, "__builtin_ia32_cmpltsd", IX86_BUILTIN_CMPLTSD, LT, (int) V2DF_FTYPE_V2DF_V2DF },
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_vmmaskcmpv2df3, "__builtin_ia32_cmplesd", IX86_BUILTIN_CMPLESD, LE, (int) V2DF_FTYPE_V2DF_V2DF },
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_vmmaskcmpv2df3, "__builtin_ia32_cmpunordsd", IX86_BUILTIN_CMPUNORDSD, UNORDERED, (int) V2DF_FTYPE_V2DF_V2DF },
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_vmmaskcmpv2df3, "__builtin_ia32_cmpneqsd", IX86_BUILTIN_CMPNEQSD, NE, (int) V2DF_FTYPE_V2DF_V2DF },
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_vmmaskcmpv2df3, "__builtin_ia32_cmpnltsd", IX86_BUILTIN_CMPNLTSD, UNGE, (int) V2DF_FTYPE_V2DF_V2DF },
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_vmmaskcmpv2df3, "__builtin_ia32_cmpnlesd", IX86_BUILTIN_CMPNLESD, UNGT, (int) V2DF_FTYPE_V2DF_V2DF },
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_vmmaskcmpv2df3, "__builtin_ia32_cmpordsd", IX86_BUILTIN_CMPORDSD, ORDERED, (int) V2DF_FTYPE_V2DF_V2DF },
+
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_sminv2df3, "__builtin_ia32_minpd", IX86_BUILTIN_MINPD, UNKNOWN, (int) V2DF_FTYPE_V2DF_V2DF },
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_smaxv2df3, "__builtin_ia32_maxpd", IX86_BUILTIN_MAXPD, UNKNOWN, (int) V2DF_FTYPE_V2DF_V2DF },
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_vmsminv2df3, "__builtin_ia32_minsd", IX86_BUILTIN_MINSD, UNKNOWN, (int) V2DF_FTYPE_V2DF_V2DF },
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_vmsmaxv2df3, "__builtin_ia32_maxsd", IX86_BUILTIN_MAXSD, UNKNOWN, (int) V2DF_FTYPE_V2DF_V2DF },
+
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_andv2df3, "__builtin_ia32_andpd", IX86_BUILTIN_ANDPD, UNKNOWN, (int) V2DF_FTYPE_V2DF_V2DF },
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_nandv2df3, "__builtin_ia32_andnpd", IX86_BUILTIN_ANDNPD, UNKNOWN, (int) V2DF_FTYPE_V2DF_V2DF },
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_iorv2df3, "__builtin_ia32_orpd", IX86_BUILTIN_ORPD, UNKNOWN, (int) V2DF_FTYPE_V2DF_V2DF },
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_xorv2df3, "__builtin_ia32_xorpd", IX86_BUILTIN_XORPD, UNKNOWN, (int) V2DF_FTYPE_V2DF_V2DF },
+
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_movsd, "__builtin_ia32_movsd", IX86_BUILTIN_MOVSD, UNKNOWN, (int) V2DF_FTYPE_V2DF_V2DF },
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_unpckhpd, "__builtin_ia32_unpckhpd", IX86_BUILTIN_UNPCKHPD, UNKNOWN, (int) V2DF_FTYPE_V2DF_V2DF },
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_unpcklpd, "__builtin_ia32_unpcklpd", IX86_BUILTIN_UNPCKLPD, UNKNOWN, (int) V2DF_FTYPE_V2DF_V2DF },
+
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_vec_pack_sfix_v2df, "__builtin_ia32_vec_pack_sfix", IX86_BUILTIN_VEC_PACK_SFIX, UNKNOWN, (int) V4SI_FTYPE_V2DF_V2DF },
+
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_addv16qi3, "__builtin_ia32_paddb128", IX86_BUILTIN_PADDB128, UNKNOWN, (int) V16QI_FTYPE_V16QI_V16QI },
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_addv8hi3, "__builtin_ia32_paddw128", IX86_BUILTIN_PADDW128, UNKNOWN, (int) V8HI_FTYPE_V8HI_V8HI },
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_addv4si3, "__builtin_ia32_paddd128", IX86_BUILTIN_PADDD128, UNKNOWN, (int) V4SI_FTYPE_V4SI_V4SI },
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_addv2di3, "__builtin_ia32_paddq128", IX86_BUILTIN_PADDQ128, UNKNOWN, (int) V2DI_FTYPE_V2DI_V2DI },
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_subv16qi3, "__builtin_ia32_psubb128", IX86_BUILTIN_PSUBB128, UNKNOWN, (int) V16QI_FTYPE_V16QI_V16QI },
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_subv8hi3, "__builtin_ia32_psubw128", IX86_BUILTIN_PSUBW128, UNKNOWN, (int) V8HI_FTYPE_V8HI_V8HI },
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_subv4si3, "__builtin_ia32_psubd128", IX86_BUILTIN_PSUBD128, UNKNOWN, (int) V4SI_FTYPE_V4SI_V4SI },
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_subv2di3, "__builtin_ia32_psubq128", IX86_BUILTIN_PSUBQ128, UNKNOWN, (int) V2DI_FTYPE_V2DI_V2DI },
+
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_ssaddv16qi3, "__builtin_ia32_paddsb128", IX86_BUILTIN_PADDSB128, UNKNOWN, (int) V16QI_FTYPE_V16QI_V16QI },
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_ssaddv8hi3, "__builtin_ia32_paddsw128", IX86_BUILTIN_PADDSW128, UNKNOWN, (int) V8HI_FTYPE_V8HI_V8HI },
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_sssubv16qi3, "__builtin_ia32_psubsb128", IX86_BUILTIN_PSUBSB128, UNKNOWN, (int) V16QI_FTYPE_V16QI_V16QI },
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_sssubv8hi3, "__builtin_ia32_psubsw128", IX86_BUILTIN_PSUBSW128, UNKNOWN, (int) V8HI_FTYPE_V8HI_V8HI },
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_usaddv16qi3, "__builtin_ia32_paddusb128", IX86_BUILTIN_PADDUSB128, UNKNOWN, (int) V16QI_FTYPE_V16QI_V16QI },
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_usaddv8hi3, "__builtin_ia32_paddusw128", IX86_BUILTIN_PADDUSW128, UNKNOWN, (int) V8HI_FTYPE_V8HI_V8HI },
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_ussubv16qi3, "__builtin_ia32_psubusb128", IX86_BUILTIN_PSUBUSB128, UNKNOWN, (int) V16QI_FTYPE_V16QI_V16QI },
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_ussubv8hi3, "__builtin_ia32_psubusw128", IX86_BUILTIN_PSUBUSW128, UNKNOWN, (int) V8HI_FTYPE_V8HI_V8HI },
+
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_mulv8hi3, "__builtin_ia32_pmullw128", IX86_BUILTIN_PMULLW128, UNKNOWN, (int) V8HI_FTYPE_V8HI_V8HI },
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_smulv8hi3_highpart, "__builtin_ia32_pmulhw128", IX86_BUILTIN_PMULHW128, UNKNOWN,(int) V8HI_FTYPE_V8HI_V8HI },
+
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_andv2di3, "__builtin_ia32_pand128", IX86_BUILTIN_PAND128, UNKNOWN, (int) V2DI_FTYPE_V2DI_V2DI },
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_nandv2di3, "__builtin_ia32_pandn128", IX86_BUILTIN_PANDN128, UNKNOWN, (int) V2DI_FTYPE_V2DI_V2DI },
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_iorv2di3, "__builtin_ia32_por128", IX86_BUILTIN_POR128, UNKNOWN, (int) V2DI_FTYPE_V2DI_V2DI },
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_xorv2di3, "__builtin_ia32_pxor128", IX86_BUILTIN_PXOR128, UNKNOWN, (int) V2DI_FTYPE_V2DI_V2DI },
+
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_uavgv16qi3, "__builtin_ia32_pavgb128", IX86_BUILTIN_PAVGB128, UNKNOWN, (int) V16QI_FTYPE_V16QI_V16QI },
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_uavgv8hi3, "__builtin_ia32_pavgw128", IX86_BUILTIN_PAVGW128, UNKNOWN, (int) V8HI_FTYPE_V8HI_V8HI },
+
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_eqv16qi3, "__builtin_ia32_pcmpeqb128", IX86_BUILTIN_PCMPEQB128, UNKNOWN, (int) V16QI_FTYPE_V16QI_V16QI },
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_eqv8hi3, "__builtin_ia32_pcmpeqw128", IX86_BUILTIN_PCMPEQW128, UNKNOWN, (int) V8HI_FTYPE_V8HI_V8HI },
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_eqv4si3, "__builtin_ia32_pcmpeqd128", IX86_BUILTIN_PCMPEQD128, UNKNOWN, (int) V4SI_FTYPE_V4SI_V4SI },
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_gtv16qi3, "__builtin_ia32_pcmpgtb128", IX86_BUILTIN_PCMPGTB128, UNKNOWN, (int) V16QI_FTYPE_V16QI_V16QI },
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_gtv8hi3, "__builtin_ia32_pcmpgtw128", IX86_BUILTIN_PCMPGTW128, UNKNOWN, (int) V8HI_FTYPE_V8HI_V8HI },
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_gtv4si3, "__builtin_ia32_pcmpgtd128", IX86_BUILTIN_PCMPGTD128, UNKNOWN, (int) V4SI_FTYPE_V4SI_V4SI },
+
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_umaxv16qi3, "__builtin_ia32_pmaxub128", IX86_BUILTIN_PMAXUB128, UNKNOWN, (int) V16QI_FTYPE_V16QI_V16QI },
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_smaxv8hi3, "__builtin_ia32_pmaxsw128", IX86_BUILTIN_PMAXSW128, UNKNOWN, (int) V8HI_FTYPE_V8HI_V8HI },
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_uminv16qi3, "__builtin_ia32_pminub128", IX86_BUILTIN_PMINUB128, UNKNOWN, (int) V16QI_FTYPE_V16QI_V16QI },
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_sminv8hi3, "__builtin_ia32_pminsw128", IX86_BUILTIN_PMINSW128, UNKNOWN, (int) V8HI_FTYPE_V8HI_V8HI },
+
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_punpckhbw, "__builtin_ia32_punpckhbw128", IX86_BUILTIN_PUNPCKHBW128, UNKNOWN, (int) V16QI_FTYPE_V16QI_V16QI },
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_punpckhwd, "__builtin_ia32_punpckhwd128", IX86_BUILTIN_PUNPCKHWD128, UNKNOWN, (int) V8HI_FTYPE_V8HI_V8HI },
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_punpckhdq, "__builtin_ia32_punpckhdq128", IX86_BUILTIN_PUNPCKHDQ128, UNKNOWN, (int) V4SI_FTYPE_V4SI_V4SI },
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_punpckhqdq, "__builtin_ia32_punpckhqdq128", IX86_BUILTIN_PUNPCKHQDQ128, UNKNOWN, (int) V2DI_FTYPE_V2DI_V2DI },
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_punpcklbw, "__builtin_ia32_punpcklbw128", IX86_BUILTIN_PUNPCKLBW128, UNKNOWN, (int) V16QI_FTYPE_V16QI_V16QI },
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_punpcklwd, "__builtin_ia32_punpcklwd128", IX86_BUILTIN_PUNPCKLWD128, UNKNOWN, (int) V8HI_FTYPE_V8HI_V8HI },
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_punpckldq, "__builtin_ia32_punpckldq128", IX86_BUILTIN_PUNPCKLDQ128, UNKNOWN, (int) V4SI_FTYPE_V4SI_V4SI },
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_punpcklqdq, "__builtin_ia32_punpcklqdq128", IX86_BUILTIN_PUNPCKLQDQ128, UNKNOWN, (int) V2DI_FTYPE_V2DI_V2DI },
+
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_packsswb, "__builtin_ia32_packsswb128", IX86_BUILTIN_PACKSSWB128, UNKNOWN, (int) V16QI_FTYPE_V8HI_V8HI },
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_packssdw, "__builtin_ia32_packssdw128", IX86_BUILTIN_PACKSSDW128, UNKNOWN, (int) V8HI_FTYPE_V4SI_V4SI },
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_packuswb, "__builtin_ia32_packuswb128", IX86_BUILTIN_PACKUSWB128, UNKNOWN, (int) V16QI_FTYPE_V8HI_V8HI },
+
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_umulv8hi3_highpart, "__builtin_ia32_pmulhuw128", IX86_BUILTIN_PMULHUW128, UNKNOWN, (int) V8HI_FTYPE_V8HI_V8HI },
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_psadbw, "__builtin_ia32_psadbw128", IX86_BUILTIN_PSADBW128, UNKNOWN, (int) V2DI_FTYPE_V16QI_V16QI },
+
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_umulv1siv1di3, "__builtin_ia32_pmuludq", IX86_BUILTIN_PMULUDQ, UNKNOWN, (int) V1DI_FTYPE_V2SI_V2SI },
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_umulv2siv2di3, "__builtin_ia32_pmuludq128", IX86_BUILTIN_PMULUDQ128, UNKNOWN, (int) V2DI_FTYPE_V4SI_V4SI },
+
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_pmaddwd, "__builtin_ia32_pmaddwd128", IX86_BUILTIN_PMADDWD128, UNKNOWN, (int) V4SI_FTYPE_V8HI_V8HI },
+
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_cvtsi2sd, "__builtin_ia32_cvtsi2sd", IX86_BUILTIN_CVTSI2SD, UNKNOWN, (int) V2DF_FTYPE_V2DF_SI },
+ { OPTION_MASK_ISA_SSE2 | OPTION_MASK_ISA_64BIT, CODE_FOR_sse2_cvtsi2sdq, "__builtin_ia32_cvtsi642sd", IX86_BUILTIN_CVTSI642SD, UNKNOWN, (int) V2DF_FTYPE_V2DF_DI },
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_cvtsd2ss, "__builtin_ia32_cvtsd2ss", IX86_BUILTIN_CVTSD2SS, UNKNOWN, (int) V4SF_FTYPE_V4SF_V2DF },
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_cvtss2sd, "__builtin_ia32_cvtss2sd", IX86_BUILTIN_CVTSS2SD, UNKNOWN, (int) V2DF_FTYPE_V2DF_V4SF },
+
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_ashlti3, "__builtin_ia32_pslldqi128", IX86_BUILTIN_PSLLDQI128, UNKNOWN, (int) V2DI2TI_FTYPE_V2DI_INT },
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_ashlv8hi3, "__builtin_ia32_psllwi128", IX86_BUILTIN_PSLLWI128, UNKNOWN, (int) V8HI_FTYPE_V8HI_SI_COUNT },
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_ashlv4si3, "__builtin_ia32_pslldi128", IX86_BUILTIN_PSLLDI128, UNKNOWN, (int) V4SI_FTYPE_V4SI_SI_COUNT },
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_ashlv2di3, "__builtin_ia32_psllqi128", IX86_BUILTIN_PSLLQI128, UNKNOWN, (int) V2DI_FTYPE_V2DI_SI_COUNT },
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_ashlv8hi3, "__builtin_ia32_psllw128", IX86_BUILTIN_PSLLW128, UNKNOWN, (int) V8HI_FTYPE_V8HI_V8HI_COUNT },
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_ashlv4si3, "__builtin_ia32_pslld128", IX86_BUILTIN_PSLLD128, UNKNOWN, (int) V4SI_FTYPE_V4SI_V4SI_COUNT },
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_ashlv2di3, "__builtin_ia32_psllq128", IX86_BUILTIN_PSLLQ128, UNKNOWN, (int) V2DI_FTYPE_V2DI_V2DI_COUNT },
+
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_lshrti3, "__builtin_ia32_psrldqi128", IX86_BUILTIN_PSRLDQI128, UNKNOWN, (int) V2DI2TI_FTYPE_V2DI_INT },
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_lshrv8hi3, "__builtin_ia32_psrlwi128", IX86_BUILTIN_PSRLWI128, UNKNOWN, (int) V8HI_FTYPE_V8HI_SI_COUNT },
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_lshrv4si3, "__builtin_ia32_psrldi128", IX86_BUILTIN_PSRLDI128, UNKNOWN, (int) V4SI_FTYPE_V4SI_SI_COUNT },
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_lshrv2di3, "__builtin_ia32_psrlqi128", IX86_BUILTIN_PSRLQI128, UNKNOWN, (int) V2DI_FTYPE_V2DI_SI_COUNT },
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_lshrv8hi3, "__builtin_ia32_psrlw128", IX86_BUILTIN_PSRLW128, UNKNOWN, (int) V8HI_FTYPE_V8HI_V8HI_COUNT },
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_lshrv4si3, "__builtin_ia32_psrld128", IX86_BUILTIN_PSRLD128, UNKNOWN, (int) V4SI_FTYPE_V4SI_V4SI_COUNT },
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_lshrv2di3, "__builtin_ia32_psrlq128", IX86_BUILTIN_PSRLQ128, UNKNOWN, (int) V2DI_FTYPE_V2DI_V2DI_COUNT },
+
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_ashrv8hi3, "__builtin_ia32_psrawi128", IX86_BUILTIN_PSRAWI128, UNKNOWN, (int) V8HI_FTYPE_V8HI_SI_COUNT },
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_ashrv4si3, "__builtin_ia32_psradi128", IX86_BUILTIN_PSRADI128, UNKNOWN, (int) V4SI_FTYPE_V4SI_SI_COUNT },
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_ashrv8hi3, "__builtin_ia32_psraw128", IX86_BUILTIN_PSRAW128, UNKNOWN, (int) V8HI_FTYPE_V8HI_V8HI_COUNT },
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_ashrv4si3, "__builtin_ia32_psrad128", IX86_BUILTIN_PSRAD128, UNKNOWN, (int) V4SI_FTYPE_V4SI_V4SI_COUNT },
+
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_pshufd, "__builtin_ia32_pshufd", IX86_BUILTIN_PSHUFD, UNKNOWN, (int) V4SI_FTYPE_V4SI_INT },
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_pshuflw, "__builtin_ia32_pshuflw", IX86_BUILTIN_PSHUFLW, UNKNOWN, (int) V8HI_FTYPE_V8HI_INT },
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_pshufhw, "__builtin_ia32_pshufhw", IX86_BUILTIN_PSHUFHW, UNKNOWN, (int) V8HI_FTYPE_V8HI_INT },
+
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_vmsqrtv2df2, "__builtin_ia32_sqrtsd", IX86_BUILTIN_SQRTSD, UNKNOWN, (int) V2DF_FTYPE_V2DF_VEC_MERGE },
+
+ /* SSE2 MMX */
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_mmx_addv1di3, "__builtin_ia32_paddq", IX86_BUILTIN_PADDQ, UNKNOWN, (int) V1DI_FTYPE_V1DI_V1DI },
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_mmx_subv1di3, "__builtin_ia32_psubq", IX86_BUILTIN_PSUBQ, UNKNOWN, (int) V1DI_FTYPE_V1DI_V1DI },
+
+ /* SSE3 */
+ { OPTION_MASK_ISA_SSE3, CODE_FOR_sse3_movshdup, "__builtin_ia32_movshdup", IX86_BUILTIN_MOVSHDUP, UNKNOWN, (int) V4SF_FTYPE_V4SF},
+ { OPTION_MASK_ISA_SSE3, CODE_FOR_sse3_movsldup, "__builtin_ia32_movsldup", IX86_BUILTIN_MOVSLDUP, UNKNOWN, (int) V4SF_FTYPE_V4SF },
+
+ { OPTION_MASK_ISA_SSE3, CODE_FOR_sse3_addsubv4sf3, "__builtin_ia32_addsubps", IX86_BUILTIN_ADDSUBPS, UNKNOWN, (int) V4SF_FTYPE_V4SF_V4SF },
+ { OPTION_MASK_ISA_SSE3, CODE_FOR_sse3_addsubv2df3, "__builtin_ia32_addsubpd", IX86_BUILTIN_ADDSUBPD, UNKNOWN, (int) V2DF_FTYPE_V2DF_V2DF },
+ { OPTION_MASK_ISA_SSE3, CODE_FOR_sse3_haddv4sf3, "__builtin_ia32_haddps", IX86_BUILTIN_HADDPS, UNKNOWN, (int) V4SF_FTYPE_V4SF_V4SF },
+ { OPTION_MASK_ISA_SSE3, CODE_FOR_sse3_haddv2df3, "__builtin_ia32_haddpd", IX86_BUILTIN_HADDPD, UNKNOWN, (int) V2DF_FTYPE_V2DF_V2DF },
+ { OPTION_MASK_ISA_SSE3, CODE_FOR_sse3_hsubv4sf3, "__builtin_ia32_hsubps", IX86_BUILTIN_HSUBPS, UNKNOWN, (int) V4SF_FTYPE_V4SF_V4SF },
+ { OPTION_MASK_ISA_SSE3, CODE_FOR_sse3_hsubv2df3, "__builtin_ia32_hsubpd", IX86_BUILTIN_HSUBPD, UNKNOWN, (int) V2DF_FTYPE_V2DF_V2DF },
+
+ /* SSSE3 */
+ { OPTION_MASK_ISA_SSSE3, CODE_FOR_absv16qi2, "__builtin_ia32_pabsb128", IX86_BUILTIN_PABSB128, UNKNOWN, (int) V16QI_FTYPE_V16QI },
+ { OPTION_MASK_ISA_SSSE3, CODE_FOR_absv8qi2, "__builtin_ia32_pabsb", IX86_BUILTIN_PABSB, UNKNOWN, (int) V8QI_FTYPE_V8QI },
+ { OPTION_MASK_ISA_SSSE3, CODE_FOR_absv8hi2, "__builtin_ia32_pabsw128", IX86_BUILTIN_PABSW128, UNKNOWN, (int) V8HI_FTYPE_V8HI },
+ { OPTION_MASK_ISA_SSSE3, CODE_FOR_absv4hi2, "__builtin_ia32_pabsw", IX86_BUILTIN_PABSW, UNKNOWN, (int) V4HI_FTYPE_V4HI },
+ { OPTION_MASK_ISA_SSSE3, CODE_FOR_absv4si2, "__builtin_ia32_pabsd128", IX86_BUILTIN_PABSD128, UNKNOWN, (int) V4SI_FTYPE_V4SI },
+ { OPTION_MASK_ISA_SSSE3, CODE_FOR_absv2si2, "__builtin_ia32_pabsd", IX86_BUILTIN_PABSD, UNKNOWN, (int) V2SI_FTYPE_V2SI },
+
+ { OPTION_MASK_ISA_SSSE3, CODE_FOR_ssse3_phaddwv8hi3, "__builtin_ia32_phaddw128", IX86_BUILTIN_PHADDW128, UNKNOWN, (int) V8HI_FTYPE_V8HI_V8HI },
+ { OPTION_MASK_ISA_SSSE3, CODE_FOR_ssse3_phaddwv4hi3, "__builtin_ia32_phaddw", IX86_BUILTIN_PHADDW, UNKNOWN, (int) V4HI_FTYPE_V4HI_V4HI },
+ { OPTION_MASK_ISA_SSSE3, CODE_FOR_ssse3_phadddv4si3, "__builtin_ia32_phaddd128", IX86_BUILTIN_PHADDD128, UNKNOWN, (int) V4SI_FTYPE_V4SI_V4SI },
+ { OPTION_MASK_ISA_SSSE3, CODE_FOR_ssse3_phadddv2si3, "__builtin_ia32_phaddd", IX86_BUILTIN_PHADDD, UNKNOWN, (int) V2SI_FTYPE_V2SI_V2SI },
+ { OPTION_MASK_ISA_SSSE3, CODE_FOR_ssse3_phaddswv8hi3, "__builtin_ia32_phaddsw128", IX86_BUILTIN_PHADDSW128, UNKNOWN, (int) V8HI_FTYPE_V8HI_V8HI },
+ { OPTION_MASK_ISA_SSSE3, CODE_FOR_ssse3_phaddswv4hi3, "__builtin_ia32_phaddsw", IX86_BUILTIN_PHADDSW, UNKNOWN, (int) V4HI_FTYPE_V4HI_V4HI },
+ { OPTION_MASK_ISA_SSSE3, CODE_FOR_ssse3_phsubwv8hi3, "__builtin_ia32_phsubw128", IX86_BUILTIN_PHSUBW128, UNKNOWN, (int) V8HI_FTYPE_V8HI_V8HI },
+ { OPTION_MASK_ISA_SSSE3, CODE_FOR_ssse3_phsubwv4hi3, "__builtin_ia32_phsubw", IX86_BUILTIN_PHSUBW, UNKNOWN, (int) V4HI_FTYPE_V4HI_V4HI },
+ { OPTION_MASK_ISA_SSSE3, CODE_FOR_ssse3_phsubdv4si3, "__builtin_ia32_phsubd128", IX86_BUILTIN_PHSUBD128, UNKNOWN, (int) V4SI_FTYPE_V4SI_V4SI },
+ { OPTION_MASK_ISA_SSSE3, CODE_FOR_ssse3_phsubdv2si3, "__builtin_ia32_phsubd", IX86_BUILTIN_PHSUBD, UNKNOWN, (int) V2SI_FTYPE_V2SI_V2SI },
+ { OPTION_MASK_ISA_SSSE3, CODE_FOR_ssse3_phsubswv8hi3, "__builtin_ia32_phsubsw128", IX86_BUILTIN_PHSUBSW128, UNKNOWN, (int) V8HI_FTYPE_V8HI_V8HI },
+ { OPTION_MASK_ISA_SSSE3, CODE_FOR_ssse3_phsubswv4hi3, "__builtin_ia32_phsubsw", IX86_BUILTIN_PHSUBSW, UNKNOWN, (int) V4HI_FTYPE_V4HI_V4HI },
+ { OPTION_MASK_ISA_SSSE3, CODE_FOR_ssse3_pmaddubsw128, "__builtin_ia32_pmaddubsw128", IX86_BUILTIN_PMADDUBSW128, UNKNOWN, (int) V8HI_FTYPE_V16QI_V16QI },
+ { OPTION_MASK_ISA_SSSE3, CODE_FOR_ssse3_pmaddubsw, "__builtin_ia32_pmaddubsw", IX86_BUILTIN_PMADDUBSW, UNKNOWN, (int) V4HI_FTYPE_V8QI_V8QI },
+ { OPTION_MASK_ISA_SSSE3, CODE_FOR_ssse3_pmulhrswv8hi3, "__builtin_ia32_pmulhrsw128", IX86_BUILTIN_PMULHRSW128, UNKNOWN, (int) V8HI_FTYPE_V8HI_V8HI },
+ { OPTION_MASK_ISA_SSSE3, CODE_FOR_ssse3_pmulhrswv4hi3, "__builtin_ia32_pmulhrsw", IX86_BUILTIN_PMULHRSW, UNKNOWN, (int) V4HI_FTYPE_V4HI_V4HI },
+ { OPTION_MASK_ISA_SSSE3, CODE_FOR_ssse3_pshufbv16qi3, "__builtin_ia32_pshufb128", IX86_BUILTIN_PSHUFB128, UNKNOWN, (int) V16QI_FTYPE_V16QI_V16QI },
+ { OPTION_MASK_ISA_SSSE3, CODE_FOR_ssse3_pshufbv8qi3, "__builtin_ia32_pshufb", IX86_BUILTIN_PSHUFB, UNKNOWN, (int) V8QI_FTYPE_V8QI_V8QI },
+ { OPTION_MASK_ISA_SSSE3, CODE_FOR_ssse3_psignv16qi3, "__builtin_ia32_psignb128", IX86_BUILTIN_PSIGNB128, UNKNOWN, (int) V16QI_FTYPE_V16QI_V16QI },
+ { OPTION_MASK_ISA_SSSE3, CODE_FOR_ssse3_psignv8qi3, "__builtin_ia32_psignb", IX86_BUILTIN_PSIGNB, UNKNOWN, (int) V8QI_FTYPE_V8QI_V8QI },
+ { OPTION_MASK_ISA_SSSE3, CODE_FOR_ssse3_psignv8hi3, "__builtin_ia32_psignw128", IX86_BUILTIN_PSIGNW128, UNKNOWN, (int) V8HI_FTYPE_V8HI_V8HI },
+ { OPTION_MASK_ISA_SSSE3, CODE_FOR_ssse3_psignv4hi3, "__builtin_ia32_psignw", IX86_BUILTIN_PSIGNW, UNKNOWN, (int) V4HI_FTYPE_V4HI_V4HI },
+ { OPTION_MASK_ISA_SSSE3, CODE_FOR_ssse3_psignv4si3, "__builtin_ia32_psignd128", IX86_BUILTIN_PSIGND128, UNKNOWN, (int) V4SI_FTYPE_V4SI_V4SI },
+ { OPTION_MASK_ISA_SSSE3, CODE_FOR_ssse3_psignv2si3, "__builtin_ia32_psignd", IX86_BUILTIN_PSIGND, UNKNOWN, (int) V2SI_FTYPE_V2SI_V2SI },
+
+ /* SSSE3. */
+ { OPTION_MASK_ISA_SSSE3, CODE_FOR_ssse3_palignrti, "__builtin_ia32_palignr128", IX86_BUILTIN_PALIGNR128, UNKNOWN, (int) V2DI2TI_FTYPE_V2DI_V2DI_INT },
+ { OPTION_MASK_ISA_SSSE3, CODE_FOR_ssse3_palignrdi, "__builtin_ia32_palignr", IX86_BUILTIN_PALIGNR, UNKNOWN, (int) V1DI2DI_FTYPE_V1DI_V1DI_INT },
+
/* SSE4.1 */
{ OPTION_MASK_ISA_SSE4_1, CODE_FOR_sse4_1_blendpd, "__builtin_ia32_blendpd", IX86_BUILTIN_BLENDPD, UNKNOWN, (int) V2DF_FTYPE_V2DF_V2DF_INT },
{ OPTION_MASK_ISA_SSE4_1, CODE_FOR_sse4_1_blendps, "__builtin_ia32_blendps", IX86_BUILTIN_BLENDPS, UNKNOWN, (int) V4SF_FTYPE_V4SF_V4SF_INT },
@@ -18023,379 +18585,67 @@ static const struct builtin_description bdesc_sse_args[] =
{ OPTION_MASK_ISA_SSE4_1, CODE_FOR_sse4_1_pblendvb, "__builtin_ia32_pblendvb128", IX86_BUILTIN_PBLENDVB128, UNKNOWN, (int) V16QI_FTYPE_V16QI_V16QI_V16QI },
{ OPTION_MASK_ISA_SSE4_1, CODE_FOR_sse4_1_pblendw, "__builtin_ia32_pblendw128", IX86_BUILTIN_PBLENDW128, UNKNOWN, (int) V8HI_FTYPE_V8HI_V8HI_INT },
+ { OPTION_MASK_ISA_SSE4_1, CODE_FOR_sse4_1_extendv8qiv8hi2, "__builtin_ia32_pmovsxbw128", IX86_BUILTIN_PMOVSXBW128, UNKNOWN, (int) V8HI_FTYPE_V16QI },
+ { OPTION_MASK_ISA_SSE4_1, CODE_FOR_sse4_1_extendv4qiv4si2, "__builtin_ia32_pmovsxbd128", IX86_BUILTIN_PMOVSXBD128, UNKNOWN, (int) V4SI_FTYPE_V16QI },
+ { OPTION_MASK_ISA_SSE4_1, CODE_FOR_sse4_1_extendv2qiv2di2, "__builtin_ia32_pmovsxbq128", IX86_BUILTIN_PMOVSXBQ128, UNKNOWN, (int) V2DI_FTYPE_V16QI },
+ { OPTION_MASK_ISA_SSE4_1, CODE_FOR_sse4_1_extendv4hiv4si2, "__builtin_ia32_pmovsxwd128", IX86_BUILTIN_PMOVSXWD128, UNKNOWN, (int) V4SI_FTYPE_V8HI },
+ { OPTION_MASK_ISA_SSE4_1, CODE_FOR_sse4_1_extendv2hiv2di2, "__builtin_ia32_pmovsxwq128", IX86_BUILTIN_PMOVSXWQ128, UNKNOWN, (int) V2DI_FTYPE_V8HI },
+ { OPTION_MASK_ISA_SSE4_1, CODE_FOR_sse4_1_extendv2siv2di2, "__builtin_ia32_pmovsxdq128", IX86_BUILTIN_PMOVSXDQ128, UNKNOWN, (int) V2DI_FTYPE_V4SI },
+ { OPTION_MASK_ISA_SSE4_1, CODE_FOR_sse4_1_zero_extendv8qiv8hi2, "__builtin_ia32_pmovzxbw128", IX86_BUILTIN_PMOVZXBW128, UNKNOWN, (int) V8HI_FTYPE_V16QI },
+ { OPTION_MASK_ISA_SSE4_1, CODE_FOR_sse4_1_zero_extendv4qiv4si2, "__builtin_ia32_pmovzxbd128", IX86_BUILTIN_PMOVZXBD128, UNKNOWN, (int) V4SI_FTYPE_V16QI },
+ { OPTION_MASK_ISA_SSE4_1, CODE_FOR_sse4_1_zero_extendv2qiv2di2, "__builtin_ia32_pmovzxbq128", IX86_BUILTIN_PMOVZXBQ128, UNKNOWN, (int) V2DI_FTYPE_V16QI },
+ { OPTION_MASK_ISA_SSE4_1, CODE_FOR_sse4_1_zero_extendv4hiv4si2, "__builtin_ia32_pmovzxwd128", IX86_BUILTIN_PMOVZXWD128, UNKNOWN, (int) V4SI_FTYPE_V8HI },
+ { OPTION_MASK_ISA_SSE4_1, CODE_FOR_sse4_1_zero_extendv2hiv2di2, "__builtin_ia32_pmovzxwq128", IX86_BUILTIN_PMOVZXWQ128, UNKNOWN, (int) V2DI_FTYPE_V8HI },
+ { OPTION_MASK_ISA_SSE4_1, CODE_FOR_sse4_1_zero_extendv2siv2di2, "__builtin_ia32_pmovzxdq128", IX86_BUILTIN_PMOVZXDQ128, UNKNOWN, (int) V2DI_FTYPE_V4SI },
+ { OPTION_MASK_ISA_SSE4_1, CODE_FOR_sse4_1_phminposuw, "__builtin_ia32_phminposuw128", IX86_BUILTIN_PHMINPOSUW128, UNKNOWN, (int) V8HI_FTYPE_V8HI },
+
+ { OPTION_MASK_ISA_SSE4_1, CODE_FOR_sse4_1_packusdw, "__builtin_ia32_packusdw128", IX86_BUILTIN_PACKUSDW128, UNKNOWN, (int) V8HI_FTYPE_V4SI_V4SI },
+ { OPTION_MASK_ISA_SSE4_1, CODE_FOR_sse4_1_eqv2di3, "__builtin_ia32_pcmpeqq", IX86_BUILTIN_PCMPEQQ, UNKNOWN, (int) V2DI_FTYPE_V2DI_V2DI },
+ { OPTION_MASK_ISA_SSE4_1, CODE_FOR_smaxv16qi3, "__builtin_ia32_pmaxsb128", IX86_BUILTIN_PMAXSB128, UNKNOWN, (int) V16QI_FTYPE_V16QI_V16QI },
+ { OPTION_MASK_ISA_SSE4_1, CODE_FOR_smaxv4si3, "__builtin_ia32_pmaxsd128", IX86_BUILTIN_PMAXSD128, UNKNOWN, (int) V4SI_FTYPE_V4SI_V4SI },
+ { OPTION_MASK_ISA_SSE4_1, CODE_FOR_umaxv4si3, "__builtin_ia32_pmaxud128", IX86_BUILTIN_PMAXUD128, UNKNOWN, (int) V4SI_FTYPE_V4SI_V4SI },
+ { OPTION_MASK_ISA_SSE4_1, CODE_FOR_umaxv8hi3, "__builtin_ia32_pmaxuw128", IX86_BUILTIN_PMAXUW128, UNKNOWN, (int) V8HI_FTYPE_V8HI_V8HI },
+ { OPTION_MASK_ISA_SSE4_1, CODE_FOR_sminv16qi3, "__builtin_ia32_pminsb128", IX86_BUILTIN_PMINSB128, UNKNOWN, (int) V16QI_FTYPE_V16QI_V16QI },
+ { OPTION_MASK_ISA_SSE4_1, CODE_FOR_sminv4si3, "__builtin_ia32_pminsd128", IX86_BUILTIN_PMINSD128, UNKNOWN, (int) V4SI_FTYPE_V4SI_V4SI },
+ { OPTION_MASK_ISA_SSE4_1, CODE_FOR_uminv4si3, "__builtin_ia32_pminud128", IX86_BUILTIN_PMINUD128, UNKNOWN, (int) V4SI_FTYPE_V4SI_V4SI },
+ { OPTION_MASK_ISA_SSE4_1, CODE_FOR_uminv8hi3, "__builtin_ia32_pminuw128", IX86_BUILTIN_PMINUW128, UNKNOWN, (int) V8HI_FTYPE_V8HI_V8HI },
+ { OPTION_MASK_ISA_SSE4_1, CODE_FOR_sse4_1_mulv2siv2di3, "__builtin_ia32_pmuldq128", IX86_BUILTIN_PMULDQ128, UNKNOWN, (int) V2DI_FTYPE_V4SI_V4SI },
+ { OPTION_MASK_ISA_SSE4_1, CODE_FOR_mulv4si3, "__builtin_ia32_pmulld128", IX86_BUILTIN_PMULLD128, UNKNOWN, (int) V4SI_FTYPE_V4SI_V4SI },
+
/* SSE4.1 and SSE5 */
{ OPTION_MASK_ISA_ROUND, CODE_FOR_sse4_1_roundpd, "__builtin_ia32_roundpd", IX86_BUILTIN_ROUNDPD, UNKNOWN, (int) V2DF_FTYPE_V2DF_INT },
{ OPTION_MASK_ISA_ROUND, CODE_FOR_sse4_1_roundps, "__builtin_ia32_roundps", IX86_BUILTIN_ROUNDPS, UNKNOWN, (int) V4SF_FTYPE_V4SF_INT },
{ OPTION_MASK_ISA_ROUND, CODE_FOR_sse4_1_roundsd, "__builtin_ia32_roundsd", IX86_BUILTIN_ROUNDSD, UNKNOWN, (int) V2DF_FTYPE_V2DF_V2DF_INT },
{ OPTION_MASK_ISA_ROUND, CODE_FOR_sse4_1_roundss, "__builtin_ia32_roundss", IX86_BUILTIN_ROUNDSS, UNKNOWN, (int) V4SF_FTYPE_V4SF_V4SF_INT },
- /* AES */
- { OPTION_MASK_ISA_SSE2, CODE_FOR_aeskeygenassist, 0, IX86_BUILTIN_AESKEYGENASSIST128, UNKNOWN, (int) V2DI_FTYPE_V2DI_INT },
-
- /* PCLMUL */
- { OPTION_MASK_ISA_SSE2, CODE_FOR_pclmulqdq, 0, IX86_BUILTIN_PCLMULQDQ128, UNKNOWN, (int) V2DI_FTYPE_V2DI_V2DI_INT },
-};
-
-static const struct builtin_description bdesc_2arg[] =
-{
- /* SSE */
- { OPTION_MASK_ISA_SSE, CODE_FOR_addv4sf3, "__builtin_ia32_addps", IX86_BUILTIN_ADDPS, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSE, CODE_FOR_subv4sf3, "__builtin_ia32_subps", IX86_BUILTIN_SUBPS, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSE, CODE_FOR_mulv4sf3, "__builtin_ia32_mulps", IX86_BUILTIN_MULPS, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSE, CODE_FOR_sse_divv4sf3, "__builtin_ia32_divps", IX86_BUILTIN_DIVPS, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSE, CODE_FOR_sse_vmaddv4sf3, "__builtin_ia32_addss", IX86_BUILTIN_ADDSS, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSE, CODE_FOR_sse_vmsubv4sf3, "__builtin_ia32_subss", IX86_BUILTIN_SUBSS, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSE, CODE_FOR_sse_vmmulv4sf3, "__builtin_ia32_mulss", IX86_BUILTIN_MULSS, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSE, CODE_FOR_sse_vmdivv4sf3, "__builtin_ia32_divss", IX86_BUILTIN_DIVSS, UNKNOWN, 0 },
-
- { OPTION_MASK_ISA_SSE, CODE_FOR_sse_maskcmpv4sf3, "__builtin_ia32_cmpeqps", IX86_BUILTIN_CMPEQPS, EQ, 0 },
- { OPTION_MASK_ISA_SSE, CODE_FOR_sse_maskcmpv4sf3, "__builtin_ia32_cmpltps", IX86_BUILTIN_CMPLTPS, LT, 0 },
- { OPTION_MASK_ISA_SSE, CODE_FOR_sse_maskcmpv4sf3, "__builtin_ia32_cmpleps", IX86_BUILTIN_CMPLEPS, LE, 0 },
- { OPTION_MASK_ISA_SSE, CODE_FOR_sse_maskcmpv4sf3, "__builtin_ia32_cmpgtps", IX86_BUILTIN_CMPGTPS, LT, BUILTIN_DESC_SWAP_OPERANDS },
- { OPTION_MASK_ISA_SSE, CODE_FOR_sse_maskcmpv4sf3, "__builtin_ia32_cmpgeps", IX86_BUILTIN_CMPGEPS, LE, BUILTIN_DESC_SWAP_OPERANDS },
- { OPTION_MASK_ISA_SSE, CODE_FOR_sse_maskcmpv4sf3, "__builtin_ia32_cmpunordps", IX86_BUILTIN_CMPUNORDPS, UNORDERED, 0 },
- { OPTION_MASK_ISA_SSE, CODE_FOR_sse_maskcmpv4sf3, "__builtin_ia32_cmpneqps", IX86_BUILTIN_CMPNEQPS, NE, 0 },
- { OPTION_MASK_ISA_SSE, CODE_FOR_sse_maskcmpv4sf3, "__builtin_ia32_cmpnltps", IX86_BUILTIN_CMPNLTPS, UNGE, 0 },
- { OPTION_MASK_ISA_SSE, CODE_FOR_sse_maskcmpv4sf3, "__builtin_ia32_cmpnleps", IX86_BUILTIN_CMPNLEPS, UNGT, 0 },
- { OPTION_MASK_ISA_SSE, CODE_FOR_sse_maskcmpv4sf3, "__builtin_ia32_cmpngtps", IX86_BUILTIN_CMPNGTPS, UNGE, BUILTIN_DESC_SWAP_OPERANDS },
- { OPTION_MASK_ISA_SSE, CODE_FOR_sse_maskcmpv4sf3, "__builtin_ia32_cmpngeps", IX86_BUILTIN_CMPNGEPS, UNGT, BUILTIN_DESC_SWAP_OPERANDS },
- { OPTION_MASK_ISA_SSE, CODE_FOR_sse_maskcmpv4sf3, "__builtin_ia32_cmpordps", IX86_BUILTIN_CMPORDPS, ORDERED, 0 },
- { OPTION_MASK_ISA_SSE, CODE_FOR_sse_vmmaskcmpv4sf3, "__builtin_ia32_cmpeqss", IX86_BUILTIN_CMPEQSS, EQ, 0 },
- { OPTION_MASK_ISA_SSE, CODE_FOR_sse_vmmaskcmpv4sf3, "__builtin_ia32_cmpltss", IX86_BUILTIN_CMPLTSS, LT, 0 },
- { OPTION_MASK_ISA_SSE, CODE_FOR_sse_vmmaskcmpv4sf3, "__builtin_ia32_cmpless", IX86_BUILTIN_CMPLESS, LE, 0 },
- { OPTION_MASK_ISA_SSE, CODE_FOR_sse_vmmaskcmpv4sf3, "__builtin_ia32_cmpunordss", IX86_BUILTIN_CMPUNORDSS, UNORDERED, 0 },
- { OPTION_MASK_ISA_SSE, CODE_FOR_sse_vmmaskcmpv4sf3, "__builtin_ia32_cmpneqss", IX86_BUILTIN_CMPNEQSS, NE, 0 },
- { OPTION_MASK_ISA_SSE, CODE_FOR_sse_vmmaskcmpv4sf3, "__builtin_ia32_cmpnltss", IX86_BUILTIN_CMPNLTSS, UNGE, 0 },
- { OPTION_MASK_ISA_SSE, CODE_FOR_sse_vmmaskcmpv4sf3, "__builtin_ia32_cmpnless", IX86_BUILTIN_CMPNLESS, UNGT, 0 },
- { OPTION_MASK_ISA_SSE, CODE_FOR_sse_vmmaskcmpv4sf3, "__builtin_ia32_cmpngtss", IX86_BUILTIN_CMPNGTSS, UNGE, BUILTIN_DESC_SWAP_OPERANDS },
- { OPTION_MASK_ISA_SSE, CODE_FOR_sse_vmmaskcmpv4sf3, "__builtin_ia32_cmpngess", IX86_BUILTIN_CMPNGESS, UNGT, BUILTIN_DESC_SWAP_OPERANDS },
- { OPTION_MASK_ISA_SSE, CODE_FOR_sse_vmmaskcmpv4sf3, "__builtin_ia32_cmpordss", IX86_BUILTIN_CMPORDSS, ORDERED, 0 },
-
- { OPTION_MASK_ISA_SSE, CODE_FOR_sminv4sf3, "__builtin_ia32_minps", IX86_BUILTIN_MINPS, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSE, CODE_FOR_smaxv4sf3, "__builtin_ia32_maxps", IX86_BUILTIN_MAXPS, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSE, CODE_FOR_sse_vmsminv4sf3, "__builtin_ia32_minss", IX86_BUILTIN_MINSS, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSE, CODE_FOR_sse_vmsmaxv4sf3, "__builtin_ia32_maxss", IX86_BUILTIN_MAXSS, UNKNOWN, 0 },
-
- { OPTION_MASK_ISA_SSE, CODE_FOR_andv4sf3, "__builtin_ia32_andps", IX86_BUILTIN_ANDPS, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSE, CODE_FOR_sse_nandv4sf3, "__builtin_ia32_andnps", IX86_BUILTIN_ANDNPS, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSE, CODE_FOR_iorv4sf3, "__builtin_ia32_orps", IX86_BUILTIN_ORPS, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSE, CODE_FOR_xorv4sf3, "__builtin_ia32_xorps", IX86_BUILTIN_XORPS, UNKNOWN, 0 },
-
- { OPTION_MASK_ISA_SSE, CODE_FOR_sse_movss, "__builtin_ia32_movss", IX86_BUILTIN_MOVSS, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSE, CODE_FOR_sse_movhlps, "__builtin_ia32_movhlps", IX86_BUILTIN_MOVHLPS, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSE, CODE_FOR_sse_movlhps, "__builtin_ia32_movlhps", IX86_BUILTIN_MOVLHPS, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSE, CODE_FOR_sse_unpckhps, "__builtin_ia32_unpckhps", IX86_BUILTIN_UNPCKHPS, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSE, CODE_FOR_sse_unpcklps, "__builtin_ia32_unpcklps", IX86_BUILTIN_UNPCKLPS, UNKNOWN, 0 },
-
- /* MMX */
- { OPTION_MASK_ISA_MMX, CODE_FOR_mmx_addv8qi3, "__builtin_ia32_paddb", IX86_BUILTIN_PADDB, UNKNOWN, 0 },
- { OPTION_MASK_ISA_MMX, CODE_FOR_mmx_addv4hi3, "__builtin_ia32_paddw", IX86_BUILTIN_PADDW, UNKNOWN, 0 },
- { OPTION_MASK_ISA_MMX, CODE_FOR_mmx_addv2si3, "__builtin_ia32_paddd", IX86_BUILTIN_PADDD, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSE2, CODE_FOR_mmx_addv1di3, "__builtin_ia32_paddq", IX86_BUILTIN_PADDQ, UNKNOWN, 0 },
- { OPTION_MASK_ISA_MMX, CODE_FOR_mmx_subv8qi3, "__builtin_ia32_psubb", IX86_BUILTIN_PSUBB, UNKNOWN, 0 },
- { OPTION_MASK_ISA_MMX, CODE_FOR_mmx_subv4hi3, "__builtin_ia32_psubw", IX86_BUILTIN_PSUBW, UNKNOWN, 0 },
- { OPTION_MASK_ISA_MMX, CODE_FOR_mmx_subv2si3, "__builtin_ia32_psubd", IX86_BUILTIN_PSUBD, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSE2, CODE_FOR_mmx_subv1di3, "__builtin_ia32_psubq", IX86_BUILTIN_PSUBQ, UNKNOWN, 0 },
-
- { OPTION_MASK_ISA_MMX, CODE_FOR_mmx_ssaddv8qi3, "__builtin_ia32_paddsb", IX86_BUILTIN_PADDSB, UNKNOWN, 0 },
- { OPTION_MASK_ISA_MMX, CODE_FOR_mmx_ssaddv4hi3, "__builtin_ia32_paddsw", IX86_BUILTIN_PADDSW, UNKNOWN, 0 },
- { OPTION_MASK_ISA_MMX, CODE_FOR_mmx_sssubv8qi3, "__builtin_ia32_psubsb", IX86_BUILTIN_PSUBSB, UNKNOWN, 0 },
- { OPTION_MASK_ISA_MMX, CODE_FOR_mmx_sssubv4hi3, "__builtin_ia32_psubsw", IX86_BUILTIN_PSUBSW, UNKNOWN, 0 },
- { OPTION_MASK_ISA_MMX, CODE_FOR_mmx_usaddv8qi3, "__builtin_ia32_paddusb", IX86_BUILTIN_PADDUSB, UNKNOWN, 0 },
- { OPTION_MASK_ISA_MMX, CODE_FOR_mmx_usaddv4hi3, "__builtin_ia32_paddusw", IX86_BUILTIN_PADDUSW, UNKNOWN, 0 },
- { OPTION_MASK_ISA_MMX, CODE_FOR_mmx_ussubv8qi3, "__builtin_ia32_psubusb", IX86_BUILTIN_PSUBUSB, UNKNOWN, 0 },
- { OPTION_MASK_ISA_MMX, CODE_FOR_mmx_ussubv4hi3, "__builtin_ia32_psubusw", IX86_BUILTIN_PSUBUSW, UNKNOWN, 0 },
-
- { OPTION_MASK_ISA_MMX, CODE_FOR_mmx_mulv4hi3, "__builtin_ia32_pmullw", IX86_BUILTIN_PMULLW, UNKNOWN, 0 },
- { OPTION_MASK_ISA_MMX, CODE_FOR_mmx_smulv4hi3_highpart, "__builtin_ia32_pmulhw", IX86_BUILTIN_PMULHW, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSE | OPTION_MASK_ISA_3DNOW_A, CODE_FOR_mmx_umulv4hi3_highpart, "__builtin_ia32_pmulhuw", IX86_BUILTIN_PMULHUW, UNKNOWN, 0 },
-
- { OPTION_MASK_ISA_MMX, CODE_FOR_mmx_andv2si3, "__builtin_ia32_pand", IX86_BUILTIN_PAND, UNKNOWN, 0 },
- { OPTION_MASK_ISA_MMX, CODE_FOR_mmx_nandv2si3, "__builtin_ia32_pandn", IX86_BUILTIN_PANDN, UNKNOWN, 0 },
- { OPTION_MASK_ISA_MMX, CODE_FOR_mmx_iorv2si3, "__builtin_ia32_por", IX86_BUILTIN_POR, UNKNOWN, 0 },
- { OPTION_MASK_ISA_MMX, CODE_FOR_mmx_xorv2si3, "__builtin_ia32_pxor", IX86_BUILTIN_PXOR, UNKNOWN, 0 },
-
- { OPTION_MASK_ISA_SSE | OPTION_MASK_ISA_3DNOW_A, CODE_FOR_mmx_uavgv8qi3, "__builtin_ia32_pavgb", IX86_BUILTIN_PAVGB, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSE | OPTION_MASK_ISA_3DNOW_A, CODE_FOR_mmx_uavgv4hi3, "__builtin_ia32_pavgw", IX86_BUILTIN_PAVGW, UNKNOWN, 0 },
-
- { OPTION_MASK_ISA_MMX, CODE_FOR_mmx_eqv8qi3, "__builtin_ia32_pcmpeqb", IX86_BUILTIN_PCMPEQB, UNKNOWN, 0 },
- { OPTION_MASK_ISA_MMX, CODE_FOR_mmx_eqv4hi3, "__builtin_ia32_pcmpeqw", IX86_BUILTIN_PCMPEQW, UNKNOWN, 0 },
- { OPTION_MASK_ISA_MMX, CODE_FOR_mmx_eqv2si3, "__builtin_ia32_pcmpeqd", IX86_BUILTIN_PCMPEQD, UNKNOWN, 0 },
- { OPTION_MASK_ISA_MMX, CODE_FOR_mmx_gtv8qi3, "__builtin_ia32_pcmpgtb", IX86_BUILTIN_PCMPGTB, UNKNOWN, 0 },
- { OPTION_MASK_ISA_MMX, CODE_FOR_mmx_gtv4hi3, "__builtin_ia32_pcmpgtw", IX86_BUILTIN_PCMPGTW, UNKNOWN, 0 },
- { OPTION_MASK_ISA_MMX, CODE_FOR_mmx_gtv2si3, "__builtin_ia32_pcmpgtd", IX86_BUILTIN_PCMPGTD, UNKNOWN, 0 },
-
- { OPTION_MASK_ISA_SSE | OPTION_MASK_ISA_3DNOW_A, CODE_FOR_mmx_umaxv8qi3, "__builtin_ia32_pmaxub", IX86_BUILTIN_PMAXUB, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSE | OPTION_MASK_ISA_3DNOW_A, CODE_FOR_mmx_smaxv4hi3, "__builtin_ia32_pmaxsw", IX86_BUILTIN_PMAXSW, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSE | OPTION_MASK_ISA_3DNOW_A, CODE_FOR_mmx_uminv8qi3, "__builtin_ia32_pminub", IX86_BUILTIN_PMINUB, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSE | OPTION_MASK_ISA_3DNOW_A, CODE_FOR_mmx_sminv4hi3, "__builtin_ia32_pminsw", IX86_BUILTIN_PMINSW, UNKNOWN, 0 },
-
- { OPTION_MASK_ISA_MMX, CODE_FOR_mmx_punpckhbw, "__builtin_ia32_punpckhbw", IX86_BUILTIN_PUNPCKHBW, UNKNOWN, 0 },
- { OPTION_MASK_ISA_MMX, CODE_FOR_mmx_punpckhwd, "__builtin_ia32_punpckhwd", IX86_BUILTIN_PUNPCKHWD, UNKNOWN, 0 },
- { OPTION_MASK_ISA_MMX, CODE_FOR_mmx_punpckhdq, "__builtin_ia32_punpckhdq", IX86_BUILTIN_PUNPCKHDQ, UNKNOWN, 0 },
- { OPTION_MASK_ISA_MMX, CODE_FOR_mmx_punpcklbw, "__builtin_ia32_punpcklbw", IX86_BUILTIN_PUNPCKLBW, UNKNOWN, 0 },
- { OPTION_MASK_ISA_MMX, CODE_FOR_mmx_punpcklwd, "__builtin_ia32_punpcklwd", IX86_BUILTIN_PUNPCKLWD, UNKNOWN, 0 },
- { OPTION_MASK_ISA_MMX, CODE_FOR_mmx_punpckldq, "__builtin_ia32_punpckldq", IX86_BUILTIN_PUNPCKLDQ, UNKNOWN, 0 },
-
- /* Special. */
- { OPTION_MASK_ISA_MMX, CODE_FOR_mmx_packsswb, 0, IX86_BUILTIN_PACKSSWB, UNKNOWN, 0 },
- { OPTION_MASK_ISA_MMX, CODE_FOR_mmx_packssdw, 0, IX86_BUILTIN_PACKSSDW, UNKNOWN, 0 },
- { OPTION_MASK_ISA_MMX, CODE_FOR_mmx_packuswb, 0, IX86_BUILTIN_PACKUSWB, UNKNOWN, 0 },
-
- { OPTION_MASK_ISA_SSE, CODE_FOR_sse_cvtpi2ps, 0, IX86_BUILTIN_CVTPI2PS, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSE, CODE_FOR_sse_cvtsi2ss, 0, IX86_BUILTIN_CVTSI2SS, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSE | OPTION_MASK_ISA_64BIT, CODE_FOR_sse_cvtsi2ssq, 0, IX86_BUILTIN_CVTSI642SS, UNKNOWN, 0 },
-
- { OPTION_MASK_ISA_SSE | OPTION_MASK_ISA_3DNOW_A, CODE_FOR_mmx_psadbw, 0, IX86_BUILTIN_PSADBW, UNKNOWN, 0 },
- { OPTION_MASK_ISA_MMX, CODE_FOR_mmx_pmaddwd, 0, IX86_BUILTIN_PMADDWD, UNKNOWN, 0 },
-
- /* SSE2 */
- { OPTION_MASK_ISA_SSE2, CODE_FOR_addv2df3, "__builtin_ia32_addpd", IX86_BUILTIN_ADDPD, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSE2, CODE_FOR_subv2df3, "__builtin_ia32_subpd", IX86_BUILTIN_SUBPD, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSE2, CODE_FOR_mulv2df3, "__builtin_ia32_mulpd", IX86_BUILTIN_MULPD, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSE2, CODE_FOR_divv2df3, "__builtin_ia32_divpd", IX86_BUILTIN_DIVPD, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_vmaddv2df3, "__builtin_ia32_addsd", IX86_BUILTIN_ADDSD, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_vmsubv2df3, "__builtin_ia32_subsd", IX86_BUILTIN_SUBSD, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_vmmulv2df3, "__builtin_ia32_mulsd", IX86_BUILTIN_MULSD, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_vmdivv2df3, "__builtin_ia32_divsd", IX86_BUILTIN_DIVSD, UNKNOWN, 0 },
-
- { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_maskcmpv2df3, "__builtin_ia32_cmpeqpd", IX86_BUILTIN_CMPEQPD, EQ, 0 },
- { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_maskcmpv2df3, "__builtin_ia32_cmpltpd", IX86_BUILTIN_CMPLTPD, LT, 0 },
- { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_maskcmpv2df3, "__builtin_ia32_cmplepd", IX86_BUILTIN_CMPLEPD, LE, 0 },
- { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_maskcmpv2df3, "__builtin_ia32_cmpgtpd", IX86_BUILTIN_CMPGTPD, LT, BUILTIN_DESC_SWAP_OPERANDS },
- { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_maskcmpv2df3, "__builtin_ia32_cmpgepd", IX86_BUILTIN_CMPGEPD, LE, BUILTIN_DESC_SWAP_OPERANDS },
- { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_maskcmpv2df3, "__builtin_ia32_cmpunordpd", IX86_BUILTIN_CMPUNORDPD, UNORDERED, 0 },
- { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_maskcmpv2df3, "__builtin_ia32_cmpneqpd", IX86_BUILTIN_CMPNEQPD, NE, 0 },
- { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_maskcmpv2df3, "__builtin_ia32_cmpnltpd", IX86_BUILTIN_CMPNLTPD, UNGE, 0 },
- { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_maskcmpv2df3, "__builtin_ia32_cmpnlepd", IX86_BUILTIN_CMPNLEPD, UNGT, 0 },
- { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_maskcmpv2df3, "__builtin_ia32_cmpngtpd", IX86_BUILTIN_CMPNGTPD, UNGE, BUILTIN_DESC_SWAP_OPERANDS },
- { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_maskcmpv2df3, "__builtin_ia32_cmpngepd", IX86_BUILTIN_CMPNGEPD, UNGT, BUILTIN_DESC_SWAP_OPERANDS },
- { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_maskcmpv2df3, "__builtin_ia32_cmpordpd", IX86_BUILTIN_CMPORDPD, ORDERED, 0 },
- { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_vmmaskcmpv2df3, "__builtin_ia32_cmpeqsd", IX86_BUILTIN_CMPEQSD, EQ, 0 },
- { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_vmmaskcmpv2df3, "__builtin_ia32_cmpltsd", IX86_BUILTIN_CMPLTSD, LT, 0 },
- { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_vmmaskcmpv2df3, "__builtin_ia32_cmplesd", IX86_BUILTIN_CMPLESD, LE, 0 },
- { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_vmmaskcmpv2df3, "__builtin_ia32_cmpunordsd", IX86_BUILTIN_CMPUNORDSD, UNORDERED, 0 },
- { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_vmmaskcmpv2df3, "__builtin_ia32_cmpneqsd", IX86_BUILTIN_CMPNEQSD, NE, 0 },
- { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_vmmaskcmpv2df3, "__builtin_ia32_cmpnltsd", IX86_BUILTIN_CMPNLTSD, UNGE, 0 },
- { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_vmmaskcmpv2df3, "__builtin_ia32_cmpnlesd", IX86_BUILTIN_CMPNLESD, UNGT, 0 },
- { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_vmmaskcmpv2df3, "__builtin_ia32_cmpordsd", IX86_BUILTIN_CMPORDSD, ORDERED, 0 },
-
- { OPTION_MASK_ISA_SSE2, CODE_FOR_sminv2df3, "__builtin_ia32_minpd", IX86_BUILTIN_MINPD, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSE2, CODE_FOR_smaxv2df3, "__builtin_ia32_maxpd", IX86_BUILTIN_MAXPD, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_vmsminv2df3, "__builtin_ia32_minsd", IX86_BUILTIN_MINSD, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_vmsmaxv2df3, "__builtin_ia32_maxsd", IX86_BUILTIN_MAXSD, UNKNOWN, 0 },
-
- { OPTION_MASK_ISA_SSE2, CODE_FOR_andv2df3, "__builtin_ia32_andpd", IX86_BUILTIN_ANDPD, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_nandv2df3, "__builtin_ia32_andnpd", IX86_BUILTIN_ANDNPD, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSE2, CODE_FOR_iorv2df3, "__builtin_ia32_orpd", IX86_BUILTIN_ORPD, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSE2, CODE_FOR_xorv2df3, "__builtin_ia32_xorpd", IX86_BUILTIN_XORPD, UNKNOWN, 0 },
-
- { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_movsd, "__builtin_ia32_movsd", IX86_BUILTIN_MOVSD, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_unpckhpd, "__builtin_ia32_unpckhpd", IX86_BUILTIN_UNPCKHPD, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_unpcklpd, "__builtin_ia32_unpcklpd", IX86_BUILTIN_UNPCKLPD, UNKNOWN, 0 },
-
- { OPTION_MASK_ISA_SSE2, CODE_FOR_vec_pack_sfix_v2df, "__builtin_ia32_vec_pack_sfix", IX86_BUILTIN_VEC_PACK_SFIX, UNKNOWN, 0 },
-
- /* SSE2 MMX */
- { OPTION_MASK_ISA_SSE2, CODE_FOR_addv16qi3, "__builtin_ia32_paddb128", IX86_BUILTIN_PADDB128, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSE2, CODE_FOR_addv8hi3, "__builtin_ia32_paddw128", IX86_BUILTIN_PADDW128, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSE2, CODE_FOR_addv4si3, "__builtin_ia32_paddd128", IX86_BUILTIN_PADDD128, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSE2, CODE_FOR_addv2di3, "__builtin_ia32_paddq128", IX86_BUILTIN_PADDQ128, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSE2, CODE_FOR_subv16qi3, "__builtin_ia32_psubb128", IX86_BUILTIN_PSUBB128, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSE2, CODE_FOR_subv8hi3, "__builtin_ia32_psubw128", IX86_BUILTIN_PSUBW128, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSE2, CODE_FOR_subv4si3, "__builtin_ia32_psubd128", IX86_BUILTIN_PSUBD128, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSE2, CODE_FOR_subv2di3, "__builtin_ia32_psubq128", IX86_BUILTIN_PSUBQ128, UNKNOWN, 0 },
-
- { OPTION_MASK_ISA_MMX, CODE_FOR_sse2_ssaddv16qi3, "__builtin_ia32_paddsb128", IX86_BUILTIN_PADDSB128, UNKNOWN, 0 },
- { OPTION_MASK_ISA_MMX, CODE_FOR_sse2_ssaddv8hi3, "__builtin_ia32_paddsw128", IX86_BUILTIN_PADDSW128, UNKNOWN, 0 },
- { OPTION_MASK_ISA_MMX, CODE_FOR_sse2_sssubv16qi3, "__builtin_ia32_psubsb128", IX86_BUILTIN_PSUBSB128, UNKNOWN, 0 },
- { OPTION_MASK_ISA_MMX, CODE_FOR_sse2_sssubv8hi3, "__builtin_ia32_psubsw128", IX86_BUILTIN_PSUBSW128, UNKNOWN, 0 },
- { OPTION_MASK_ISA_MMX, CODE_FOR_sse2_usaddv16qi3, "__builtin_ia32_paddusb128", IX86_BUILTIN_PADDUSB128, UNKNOWN, 0 },
- { OPTION_MASK_ISA_MMX, CODE_FOR_sse2_usaddv8hi3, "__builtin_ia32_paddusw128", IX86_BUILTIN_PADDUSW128, UNKNOWN, 0 },
- { OPTION_MASK_ISA_MMX, CODE_FOR_sse2_ussubv16qi3, "__builtin_ia32_psubusb128", IX86_BUILTIN_PSUBUSB128, UNKNOWN, 0 },
- { OPTION_MASK_ISA_MMX, CODE_FOR_sse2_ussubv8hi3, "__builtin_ia32_psubusw128", IX86_BUILTIN_PSUBUSW128, UNKNOWN, 0 },
-
- { OPTION_MASK_ISA_SSE2, CODE_FOR_mulv8hi3, "__builtin_ia32_pmullw128", IX86_BUILTIN_PMULLW128, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSE2, CODE_FOR_smulv8hi3_highpart, "__builtin_ia32_pmulhw128", IX86_BUILTIN_PMULHW128, UNKNOWN, 0 },
-
- { OPTION_MASK_ISA_SSE2, CODE_FOR_andv2di3, "__builtin_ia32_pand128", IX86_BUILTIN_PAND128, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_nandv2di3, "__builtin_ia32_pandn128", IX86_BUILTIN_PANDN128, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSE2, CODE_FOR_iorv2di3, "__builtin_ia32_por128", IX86_BUILTIN_POR128, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSE2, CODE_FOR_xorv2di3, "__builtin_ia32_pxor128", IX86_BUILTIN_PXOR128, UNKNOWN, 0 },
-
- { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_uavgv16qi3, "__builtin_ia32_pavgb128", IX86_BUILTIN_PAVGB128, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_uavgv8hi3, "__builtin_ia32_pavgw128", IX86_BUILTIN_PAVGW128, UNKNOWN, 0 },
-
- { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_eqv16qi3, "__builtin_ia32_pcmpeqb128", IX86_BUILTIN_PCMPEQB128, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_eqv8hi3, "__builtin_ia32_pcmpeqw128", IX86_BUILTIN_PCMPEQW128, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_eqv4si3, "__builtin_ia32_pcmpeqd128", IX86_BUILTIN_PCMPEQD128, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_gtv16qi3, "__builtin_ia32_pcmpgtb128", IX86_BUILTIN_PCMPGTB128, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_gtv8hi3, "__builtin_ia32_pcmpgtw128", IX86_BUILTIN_PCMPGTW128, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_gtv4si3, "__builtin_ia32_pcmpgtd128", IX86_BUILTIN_PCMPGTD128, UNKNOWN, 0 },
-
- { OPTION_MASK_ISA_SSE2, CODE_FOR_umaxv16qi3, "__builtin_ia32_pmaxub128", IX86_BUILTIN_PMAXUB128, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSE2, CODE_FOR_smaxv8hi3, "__builtin_ia32_pmaxsw128", IX86_BUILTIN_PMAXSW128, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSE2, CODE_FOR_uminv16qi3, "__builtin_ia32_pminub128", IX86_BUILTIN_PMINUB128, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSE2, CODE_FOR_sminv8hi3, "__builtin_ia32_pminsw128", IX86_BUILTIN_PMINSW128, UNKNOWN, 0 },
-
- { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_punpckhbw, "__builtin_ia32_punpckhbw128", IX86_BUILTIN_PUNPCKHBW128, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_punpckhwd, "__builtin_ia32_punpckhwd128", IX86_BUILTIN_PUNPCKHWD128, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_punpckhdq, "__builtin_ia32_punpckhdq128", IX86_BUILTIN_PUNPCKHDQ128, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_punpckhqdq, "__builtin_ia32_punpckhqdq128", IX86_BUILTIN_PUNPCKHQDQ128, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_punpcklbw, "__builtin_ia32_punpcklbw128", IX86_BUILTIN_PUNPCKLBW128, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_punpcklwd, "__builtin_ia32_punpcklwd128", IX86_BUILTIN_PUNPCKLWD128, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_punpckldq, "__builtin_ia32_punpckldq128", IX86_BUILTIN_PUNPCKLDQ128, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_punpcklqdq, "__builtin_ia32_punpcklqdq128", IX86_BUILTIN_PUNPCKLQDQ128, UNKNOWN, 0 },
-
- { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_packsswb, "__builtin_ia32_packsswb128", IX86_BUILTIN_PACKSSWB128, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_packssdw, "__builtin_ia32_packssdw128", IX86_BUILTIN_PACKSSDW128, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_packuswb, "__builtin_ia32_packuswb128", IX86_BUILTIN_PACKUSWB128, UNKNOWN, 0 },
-
- { OPTION_MASK_ISA_SSE2, CODE_FOR_umulv8hi3_highpart, "__builtin_ia32_pmulhuw128", IX86_BUILTIN_PMULHUW128, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_psadbw, 0, IX86_BUILTIN_PSADBW128, UNKNOWN, 0 },
-
- { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_umulv1siv1di3, 0, IX86_BUILTIN_PMULUDQ, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_umulv2siv2di3, 0, IX86_BUILTIN_PMULUDQ128, UNKNOWN, 0 },
-
- { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_pmaddwd, 0, IX86_BUILTIN_PMADDWD128, UNKNOWN, 0 },
-
- { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_cvtsi2sd, 0, IX86_BUILTIN_CVTSI2SD, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSE2 | OPTION_MASK_ISA_64BIT, CODE_FOR_sse2_cvtsi2sdq, 0, IX86_BUILTIN_CVTSI642SD, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_cvtsd2ss, 0, IX86_BUILTIN_CVTSD2SS, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_cvtss2sd, 0, IX86_BUILTIN_CVTSS2SD, UNKNOWN, 0 },
-
- /* SSE3 MMX */
- { OPTION_MASK_ISA_SSE3, CODE_FOR_sse3_addsubv4sf3, "__builtin_ia32_addsubps", IX86_BUILTIN_ADDSUBPS, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSE3, CODE_FOR_sse3_addsubv2df3, "__builtin_ia32_addsubpd", IX86_BUILTIN_ADDSUBPD, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSE3, CODE_FOR_sse3_haddv4sf3, "__builtin_ia32_haddps", IX86_BUILTIN_HADDPS, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSE3, CODE_FOR_sse3_haddv2df3, "__builtin_ia32_haddpd", IX86_BUILTIN_HADDPD, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSE3, CODE_FOR_sse3_hsubv4sf3, "__builtin_ia32_hsubps", IX86_BUILTIN_HSUBPS, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSE3, CODE_FOR_sse3_hsubv2df3, "__builtin_ia32_hsubpd", IX86_BUILTIN_HSUBPD, UNKNOWN, 0 },
-
- /* SSSE3 */
- { OPTION_MASK_ISA_SSSE3, CODE_FOR_ssse3_phaddwv8hi3, "__builtin_ia32_phaddw128", IX86_BUILTIN_PHADDW128, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSSE3, CODE_FOR_ssse3_phaddwv4hi3, "__builtin_ia32_phaddw", IX86_BUILTIN_PHADDW, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSSE3, CODE_FOR_ssse3_phadddv4si3, "__builtin_ia32_phaddd128", IX86_BUILTIN_PHADDD128, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSSE3, CODE_FOR_ssse3_phadddv2si3, "__builtin_ia32_phaddd", IX86_BUILTIN_PHADDD, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSSE3, CODE_FOR_ssse3_phaddswv8hi3, "__builtin_ia32_phaddsw128", IX86_BUILTIN_PHADDSW128, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSSE3, CODE_FOR_ssse3_phaddswv4hi3, "__builtin_ia32_phaddsw", IX86_BUILTIN_PHADDSW, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSSE3, CODE_FOR_ssse3_phsubwv8hi3, "__builtin_ia32_phsubw128", IX86_BUILTIN_PHSUBW128, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSSE3, CODE_FOR_ssse3_phsubwv4hi3, "__builtin_ia32_phsubw", IX86_BUILTIN_PHSUBW, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSSE3, CODE_FOR_ssse3_phsubdv4si3, "__builtin_ia32_phsubd128", IX86_BUILTIN_PHSUBD128, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSSE3, CODE_FOR_ssse3_phsubdv2si3, "__builtin_ia32_phsubd", IX86_BUILTIN_PHSUBD, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSSE3, CODE_FOR_ssse3_phsubswv8hi3, "__builtin_ia32_phsubsw128", IX86_BUILTIN_PHSUBSW128, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSSE3, CODE_FOR_ssse3_phsubswv4hi3, "__builtin_ia32_phsubsw", IX86_BUILTIN_PHSUBSW, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSSE3, CODE_FOR_ssse3_pmaddubswv8hi3, "__builtin_ia32_pmaddubsw128", IX86_BUILTIN_PMADDUBSW128, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSSE3, CODE_FOR_ssse3_pmaddubswv4hi3, "__builtin_ia32_pmaddubsw", IX86_BUILTIN_PMADDUBSW, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSSE3, CODE_FOR_ssse3_pmulhrswv8hi3, "__builtin_ia32_pmulhrsw128", IX86_BUILTIN_PMULHRSW128, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSSE3, CODE_FOR_ssse3_pmulhrswv4hi3, "__builtin_ia32_pmulhrsw", IX86_BUILTIN_PMULHRSW, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSSE3, CODE_FOR_ssse3_pshufbv16qi3, "__builtin_ia32_pshufb128", IX86_BUILTIN_PSHUFB128, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSSE3, CODE_FOR_ssse3_pshufbv8qi3, "__builtin_ia32_pshufb", IX86_BUILTIN_PSHUFB, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSSE3, CODE_FOR_ssse3_psignv16qi3, "__builtin_ia32_psignb128", IX86_BUILTIN_PSIGNB128, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSSE3, CODE_FOR_ssse3_psignv8qi3, "__builtin_ia32_psignb", IX86_BUILTIN_PSIGNB, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSSE3, CODE_FOR_ssse3_psignv8hi3, "__builtin_ia32_psignw128", IX86_BUILTIN_PSIGNW128, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSSE3, CODE_FOR_ssse3_psignv4hi3, "__builtin_ia32_psignw", IX86_BUILTIN_PSIGNW, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSSE3, CODE_FOR_ssse3_psignv4si3, "__builtin_ia32_psignd128", IX86_BUILTIN_PSIGND128, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSSE3, CODE_FOR_ssse3_psignv2si3, "__builtin_ia32_psignd", IX86_BUILTIN_PSIGND, UNKNOWN, 0 },
-
- /* SSE4.1 */
- { OPTION_MASK_ISA_SSE4_1, CODE_FOR_sse4_1_packusdw, "__builtin_ia32_packusdw128", IX86_BUILTIN_PACKUSDW128, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSE4_1, CODE_FOR_sse4_1_eqv2di3, "__builtin_ia32_pcmpeqq", IX86_BUILTIN_PCMPEQQ, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSE4_1, CODE_FOR_smaxv16qi3, "__builtin_ia32_pmaxsb128", IX86_BUILTIN_PMAXSB128, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSE4_1, CODE_FOR_smaxv4si3, "__builtin_ia32_pmaxsd128", IX86_BUILTIN_PMAXSD128, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSE4_1, CODE_FOR_umaxv4si3, "__builtin_ia32_pmaxud128", IX86_BUILTIN_PMAXUD128, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSE4_1, CODE_FOR_umaxv8hi3, "__builtin_ia32_pmaxuw128", IX86_BUILTIN_PMAXUW128, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSE4_1, CODE_FOR_sminv16qi3, "__builtin_ia32_pminsb128", IX86_BUILTIN_PMINSB128, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSE4_1, CODE_FOR_sminv4si3, "__builtin_ia32_pminsd128", IX86_BUILTIN_PMINSD128, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSE4_1, CODE_FOR_uminv4si3, "__builtin_ia32_pminud128", IX86_BUILTIN_PMINUD128, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSE4_1, CODE_FOR_uminv8hi3, "__builtin_ia32_pminuw128", IX86_BUILTIN_PMINUW128, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSE4_1, CODE_FOR_sse4_1_mulv2siv2di3, 0, IX86_BUILTIN_PMULDQ128, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSE4_1, CODE_FOR_mulv4si3, "__builtin_ia32_pmulld128", IX86_BUILTIN_PMULLD128, UNKNOWN, 0 },
-
/* SSE4.2 */
- { OPTION_MASK_ISA_SSE4_2, CODE_FOR_sse4_2_gtv2di3, "__builtin_ia32_pcmpgtq", IX86_BUILTIN_PCMPGTQ, UNKNOWN, 0 },
+ { OPTION_MASK_ISA_SSE4_2, CODE_FOR_sse4_2_gtv2di3, "__builtin_ia32_pcmpgtq", IX86_BUILTIN_PCMPGTQ, UNKNOWN, (int) V2DI_FTYPE_V2DI_V2DI },
+ { OPTION_MASK_ISA_SSE4_2, CODE_FOR_sse4_2_crc32qi, "__builtin_ia32_crc32qi", IX86_BUILTIN_CRC32QI, UNKNOWN, (int) UINT_FTYPE_UINT_UCHAR },
+ { OPTION_MASK_ISA_SSE4_2, CODE_FOR_sse4_2_crc32hi, "__builtin_ia32_crc32hi", IX86_BUILTIN_CRC32HI, UNKNOWN, (int) UINT_FTYPE_UINT_USHORT },
+ { OPTION_MASK_ISA_SSE4_2, CODE_FOR_sse4_2_crc32si, "__builtin_ia32_crc32si", IX86_BUILTIN_CRC32SI, UNKNOWN, (int) UINT_FTYPE_UINT_UINT },
+ { OPTION_MASK_ISA_SSE4_2 | OPTION_MASK_ISA_64BIT, CODE_FOR_sse4_2_crc32di, "__builtin_ia32_crc32di", IX86_BUILTIN_CRC32DI, UNKNOWN, (int) UINT64_FTYPE_UINT64_UINT64 },
+
+ /* SSE4A */
+ { OPTION_MASK_ISA_SSE4A, CODE_FOR_sse4a_extrqi, "__builtin_ia32_extrqi", IX86_BUILTIN_EXTRQI, UNKNOWN, (int) V2DI_FTYPE_V2DI_UINT_UINT },
+ { OPTION_MASK_ISA_SSE4A, CODE_FOR_sse4a_extrq, "__builtin_ia32_extrq", IX86_BUILTIN_EXTRQ, UNKNOWN, (int) V2DI_FTYPE_V2DI_V16QI },
+ { OPTION_MASK_ISA_SSE4A, CODE_FOR_sse4a_insertqi, "__builtin_ia32_insertqi", IX86_BUILTIN_INSERTQI, UNKNOWN, (int) V2DI_FTYPE_V2DI_V2DI_UINT_UINT },
+ { OPTION_MASK_ISA_SSE4A, CODE_FOR_sse4a_insertq, "__builtin_ia32_insertq", IX86_BUILTIN_INSERTQ, UNKNOWN, (int) V2DI_FTYPE_V2DI_V2DI },
/* AES */
- { OPTION_MASK_ISA_SSE2, CODE_FOR_aesenc, 0, IX86_BUILTIN_AESENC128, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSE2, CODE_FOR_aesenclast, 0, IX86_BUILTIN_AESENCLAST128, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSE2, CODE_FOR_aesdec, 0, IX86_BUILTIN_AESDEC128, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSE2, CODE_FOR_aesdeclast, 0, IX86_BUILTIN_AESDECLAST128, UNKNOWN, 0 },
-};
-
-static const struct builtin_description bdesc_1arg[] =
-{
- /* SSE */
- { OPTION_MASK_ISA_SSE | OPTION_MASK_ISA_3DNOW_A, CODE_FOR_mmx_pmovmskb, 0, IX86_BUILTIN_PMOVMSKB, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSE, CODE_FOR_sse_movmskps, 0, IX86_BUILTIN_MOVMSKPS, UNKNOWN, 0 },
-
- { OPTION_MASK_ISA_SSE, CODE_FOR_sse_sqrtv4sf2, 0, IX86_BUILTIN_SQRTPS, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSE, CODE_FOR_sqrtv4sf2, 0, IX86_BUILTIN_SQRTPS_NR, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSE, CODE_FOR_sse_rsqrtv4sf2, 0, IX86_BUILTIN_RSQRTPS, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSE, CODE_FOR_rsqrtv4sf2, 0, IX86_BUILTIN_RSQRTPS_NR, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSE, CODE_FOR_sse_rcpv4sf2, 0, IX86_BUILTIN_RCPPS, UNKNOWN, 0 },
-
- { OPTION_MASK_ISA_SSE, CODE_FOR_sse_cvtps2pi, 0, IX86_BUILTIN_CVTPS2PI, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSE, CODE_FOR_sse_cvtss2si, 0, IX86_BUILTIN_CVTSS2SI, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSE | OPTION_MASK_ISA_64BIT, CODE_FOR_sse_cvtss2siq, 0, IX86_BUILTIN_CVTSS2SI64, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSE, CODE_FOR_sse_cvttps2pi, 0, IX86_BUILTIN_CVTTPS2PI, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSE, CODE_FOR_sse_cvttss2si, 0, IX86_BUILTIN_CVTTSS2SI, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSE | OPTION_MASK_ISA_64BIT, CODE_FOR_sse_cvttss2siq, 0, IX86_BUILTIN_CVTTSS2SI64, UNKNOWN, 0 },
-
- /* SSE2 */
- { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_pmovmskb, 0, IX86_BUILTIN_PMOVMSKB128, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_movmskpd, 0, IX86_BUILTIN_MOVMSKPD, UNKNOWN, 0 },
-
- { OPTION_MASK_ISA_SSE2, CODE_FOR_sqrtv2df2, 0, IX86_BUILTIN_SQRTPD, UNKNOWN, 0 },
-
- { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_cvtdq2pd, 0, IX86_BUILTIN_CVTDQ2PD, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_cvtdq2ps, 0, IX86_BUILTIN_CVTDQ2PS, UNKNOWN, 0 },
-
- { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_cvtpd2dq, 0, IX86_BUILTIN_CVTPD2DQ, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_cvtpd2pi, 0, IX86_BUILTIN_CVTPD2PI, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_cvtpd2ps, 0, IX86_BUILTIN_CVTPD2PS, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_cvttpd2dq, 0, IX86_BUILTIN_CVTTPD2DQ, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_cvttpd2pi, 0, IX86_BUILTIN_CVTTPD2PI, UNKNOWN, 0 },
-
- { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_cvtpi2pd, 0, IX86_BUILTIN_CVTPI2PD, UNKNOWN, 0 },
-
- { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_cvtsd2si, 0, IX86_BUILTIN_CVTSD2SI, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_cvttsd2si, 0, IX86_BUILTIN_CVTTSD2SI, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSE2 | OPTION_MASK_ISA_64BIT, CODE_FOR_sse2_cvtsd2siq, 0, IX86_BUILTIN_CVTSD2SI64, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSE2 | OPTION_MASK_ISA_64BIT, CODE_FOR_sse2_cvttsd2siq, 0, IX86_BUILTIN_CVTTSD2SI64, UNKNOWN, 0 },
-
- { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_cvtps2dq, 0, IX86_BUILTIN_CVTPS2DQ, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_cvtps2pd, 0, IX86_BUILTIN_CVTPS2PD, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSE2, CODE_FOR_sse2_cvttps2dq, 0, IX86_BUILTIN_CVTTPS2DQ, UNKNOWN, 0 },
-
- /* SSE3 */
- { OPTION_MASK_ISA_SSE3, CODE_FOR_sse3_movshdup, "__builtin_ia32_movshdup", IX86_BUILTIN_MOVSHDUP, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSE3, CODE_FOR_sse3_movsldup, "__builtin_ia32_movsldup", IX86_BUILTIN_MOVSLDUP, UNKNOWN, 0 },
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_aeskeygenassist, 0, IX86_BUILTIN_AESKEYGENASSIST128, UNKNOWN, (int) V2DI_FTYPE_V2DI_INT },
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_aesimc, 0, IX86_BUILTIN_AESIMC128, UNKNOWN, (int) V2DI_FTYPE_V2DI },
- /* SSSE3 */
- { OPTION_MASK_ISA_SSSE3, CODE_FOR_absv16qi2, "__builtin_ia32_pabsb128", IX86_BUILTIN_PABSB128, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSSE3, CODE_FOR_absv8qi2, "__builtin_ia32_pabsb", IX86_BUILTIN_PABSB, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSSE3, CODE_FOR_absv8hi2, "__builtin_ia32_pabsw128", IX86_BUILTIN_PABSW128, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSSE3, CODE_FOR_absv4hi2, "__builtin_ia32_pabsw", IX86_BUILTIN_PABSW, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSSE3, CODE_FOR_absv4si2, "__builtin_ia32_pabsd128", IX86_BUILTIN_PABSD128, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSSE3, CODE_FOR_absv2si2, "__builtin_ia32_pabsd", IX86_BUILTIN_PABSD, UNKNOWN, 0 },
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_aesenc, 0, IX86_BUILTIN_AESENC128, UNKNOWN, (int) V2DI_FTYPE_V2DI_V2DI },
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_aesenclast, 0, IX86_BUILTIN_AESENCLAST128, UNKNOWN, (int) V2DI_FTYPE_V2DI_V2DI },
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_aesdec, 0, IX86_BUILTIN_AESDEC128, UNKNOWN, (int) V2DI_FTYPE_V2DI_V2DI },
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_aesdeclast, 0, IX86_BUILTIN_AESDECLAST128, UNKNOWN, (int) V2DI_FTYPE_V2DI_V2DI },
- /* SSE4.1 */
- { OPTION_MASK_ISA_SSE4_1, CODE_FOR_sse4_1_extendv8qiv8hi2, 0, IX86_BUILTIN_PMOVSXBW128, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSE4_1, CODE_FOR_sse4_1_extendv4qiv4si2, 0, IX86_BUILTIN_PMOVSXBD128, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSE4_1, CODE_FOR_sse4_1_extendv2qiv2di2, 0, IX86_BUILTIN_PMOVSXBQ128, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSE4_1, CODE_FOR_sse4_1_extendv4hiv4si2, 0, IX86_BUILTIN_PMOVSXWD128, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSE4_1, CODE_FOR_sse4_1_extendv2hiv2di2, 0, IX86_BUILTIN_PMOVSXWQ128, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSE4_1, CODE_FOR_sse4_1_extendv2siv2di2, 0, IX86_BUILTIN_PMOVSXDQ128, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSE4_1, CODE_FOR_sse4_1_zero_extendv8qiv8hi2, 0, IX86_BUILTIN_PMOVZXBW128, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSE4_1, CODE_FOR_sse4_1_zero_extendv4qiv4si2, 0, IX86_BUILTIN_PMOVZXBD128, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSE4_1, CODE_FOR_sse4_1_zero_extendv2qiv2di2, 0, IX86_BUILTIN_PMOVZXBQ128, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSE4_1, CODE_FOR_sse4_1_zero_extendv4hiv4si2, 0, IX86_BUILTIN_PMOVZXWD128, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSE4_1, CODE_FOR_sse4_1_zero_extendv2hiv2di2, 0, IX86_BUILTIN_PMOVZXWQ128, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSE4_1, CODE_FOR_sse4_1_zero_extendv2siv2di2, 0, IX86_BUILTIN_PMOVZXDQ128, UNKNOWN, 0 },
- { OPTION_MASK_ISA_SSE4_1, CODE_FOR_sse4_1_phminposuw, "__builtin_ia32_phminposuw128", IX86_BUILTIN_PHMINPOSUW128, UNKNOWN, 0 },
+ /* PCLMUL */
+ { OPTION_MASK_ISA_SSE2, CODE_FOR_pclmulqdq, 0, IX86_BUILTIN_PCLMULQDQ128, UNKNOWN, (int) V2DI_FTYPE_V2DI_V2DI_INT },
- /* AES */
- { OPTION_MASK_ISA_SSE2, CODE_FOR_aesimc, 0, IX86_BUILTIN_AESIMC128, UNKNOWN, 0 },
+ /* 64bit */
+ { OPTION_MASK_ISA_64BIT, CODE_FOR_abstf2, 0, IX86_BUILTIN_FABSQ, UNKNOWN, (int) FLOAT128_FTYPE_FLOAT128 },
+ { OPTION_MASK_ISA_64BIT, CODE_FOR_copysigntf3, 0, IX86_BUILTIN_COPYSIGNQ, UNKNOWN, (int) FLOAT128_FTYPE_FLOAT128_FLOAT128 },
};
/* SSE5 */
@@ -18711,12 +18961,14 @@ ix86_init_mmx_sse_builtins (void)
tree V8HI_type_node = build_vector_type_for_mode (intHI_type_node, V8HImode);
tree pchar_type_node = build_pointer_type (char_type_node);
- tree pcchar_type_node = build_pointer_type (
- build_type_variant (char_type_node, 1, 0));
+ tree pcchar_type_node
+ = build_pointer_type (build_type_variant (char_type_node, 1, 0));
tree pfloat_type_node = build_pointer_type (float_type_node);
- tree pcfloat_type_node = build_pointer_type (
- build_type_variant (float_type_node, 1, 0));
- tree pv2si_type_node = build_pointer_type (V2SI_type_node);
+ tree pcfloat_type_node
+ = build_pointer_type (build_type_variant (float_type_node, 1, 0));
+ tree pv2sf_type_node = build_pointer_type (V2SF_type_node);
+ tree pcv2sf_type_node
+ = build_pointer_type (build_type_variant (V2SF_type_node, 1, 0));
tree pv2di_type_node = build_pointer_type (V2DI_type_node);
tree pdi_type_node = build_pointer_type (long_long_unsigned_type_node);
@@ -18793,13 +19045,12 @@ ix86_init_mmx_sse_builtins (void)
pchar_type_node, NULL_TREE);
tree v4sf_ftype_pcfloat
= build_function_type_list (V4SF_type_node, pcfloat_type_node, NULL_TREE);
- /* @@@ the type is bogus */
- tree v4sf_ftype_v4sf_pv2si
+ tree v4sf_ftype_v4sf_pcv2sf
= build_function_type_list (V4SF_type_node,
- V4SF_type_node, pv2si_type_node, NULL_TREE);
- tree void_ftype_pv2si_v4sf
+ V4SF_type_node, pcv2sf_type_node, NULL_TREE);
+ tree void_ftype_pv2sf_v4sf
= build_function_type_list (void_type_node,
- pv2si_type_node, V4SF_type_node, NULL_TREE);
+ pv2sf_type_node, V4SF_type_node, NULL_TREE);
tree void_ftype_pfloat_v4sf
= build_function_type_list (void_type_node,
pfloat_type_node, V4SF_type_node, NULL_TREE);
@@ -18840,13 +19091,10 @@ ix86_init_mmx_sse_builtins (void)
tree v1di_ftype_v1di_v1di
= build_function_type_list (V1DI_type_node,
V1DI_type_node, V1DI_type_node, NULL_TREE);
-
- tree di_ftype_di_di_int
- = build_function_type_list (long_long_unsigned_type_node,
- long_long_unsigned_type_node,
- long_long_unsigned_type_node,
+ tree v1di_ftype_v1di_v1di_int
+ = build_function_type_list (V1DI_type_node,
+ V1DI_type_node, V1DI_type_node,
integer_type_node, NULL_TREE);
-
tree v2si_ftype_v2sf
= build_function_type_list (V2SI_type_node, V2SF_type_node, NULL_TREE);
tree v2sf_ftype_v2si
@@ -19152,6 +19400,47 @@ ix86_init_mmx_sse_builtins (void)
tree v2di_ftype_v2di
= build_function_type_list (V2DI_type_node, V2DI_type_node, NULL_TREE);
+ tree v16qi_ftype_v8hi_v8hi
+ = build_function_type_list (V16QI_type_node,
+ V8HI_type_node, V8HI_type_node,
+ NULL_TREE);
+ tree v8hi_ftype_v4si_v4si
+ = build_function_type_list (V8HI_type_node,
+ V4SI_type_node, V4SI_type_node,
+ NULL_TREE);
+ tree v8hi_ftype_v16qi_v16qi
+ = build_function_type_list (V8HI_type_node,
+ V16QI_type_node, V16QI_type_node,
+ NULL_TREE);
+ tree v4hi_ftype_v8qi_v8qi
+ = build_function_type_list (V4HI_type_node,
+ V8QI_type_node, V8QI_type_node,
+ NULL_TREE);
+ tree unsigned_ftype_unsigned_uchar
+ = build_function_type_list (unsigned_type_node,
+ unsigned_type_node,
+ unsigned_char_type_node,
+ NULL_TREE);
+ tree unsigned_ftype_unsigned_ushort
+ = build_function_type_list (unsigned_type_node,
+ unsigned_type_node,
+ short_unsigned_type_node,
+ NULL_TREE);
+ tree unsigned_ftype_unsigned_unsigned
+ = build_function_type_list (unsigned_type_node,
+ unsigned_type_node,
+ unsigned_type_node,
+ NULL_TREE);
+ tree uint64_ftype_uint64_uint64
+ = build_function_type_list (long_long_unsigned_type_node,
+ long_long_unsigned_type_node,
+ long_long_unsigned_type_node,
+ NULL_TREE);
+ tree float_ftype_float
+ = build_function_type_list (float_type_node,
+ float_type_node,
+ NULL_TREE);
+
tree ftype;
/* The __float80 type. */
@@ -19195,9 +19484,9 @@ ix86_init_mmx_sse_builtins (void)
def_builtin_const (OPTION_MASK_ISA_64BIT, "__builtin_copysignq", ftype, IX86_BUILTIN_COPYSIGNQ);
}
- /* Add all SSE builtins with variable number of operands. */
- for (i = 0, d = bdesc_sse_args;
- i < ARRAY_SIZE (bdesc_sse_args);
+ /* Add all special builtins with variable number of operands. */
+ for (i = 0, d = bdesc_special_args;
+ i < ARRAY_SIZE (bdesc_special_args);
i++, d++)
{
tree type;
@@ -19205,155 +19494,374 @@ ix86_init_mmx_sse_builtins (void)
if (d->name == 0)
continue;
- switch ((enum sse_builtin_type) d->flag)
+ switch ((enum ix86_special_builtin_type) d->flag)
{
- case V4SF_FTYPE_V4SF_INT:
- type = v4sf_ftype_v4sf_int;
+ case VOID_FTYPE_VOID:
+ type = void_ftype_void;
break;
- case V2DI_FTYPE_V2DI_INT:
- type = v2di_ftype_v2di_int;
+ case V16QI_FTYPE_PCCHAR:
+ type = v16qi_ftype_pcchar;
break;
- case V2DF_FTYPE_V2DF_INT:
- type = v2df_ftype_v2df_int;
+ case V4SF_FTYPE_PCFLOAT:
+ type = v4sf_ftype_pcfloat;
break;
- case V16QI_FTYPE_V16QI_V16QI_V16QI:
- type = v16qi_ftype_v16qi_v16qi_v16qi;
+ case V2DI_FTYPE_PV2DI:
+ type = v2di_ftype_pv2di;
break;
- case V4SF_FTYPE_V4SF_V4SF_V4SF:
- type = v4sf_ftype_v4sf_v4sf_v4sf;
+ case V2DF_FTYPE_PCDOUBLE:
+ type = v2df_ftype_pcdouble;
break;
- case V2DF_FTYPE_V2DF_V2DF_V2DF:
- type = v2df_ftype_v2df_v2df_v2df;
+ case V4SF_FTYPE_V4SF_PCV2SF:
+ type = v4sf_ftype_v4sf_pcv2sf;
break;
- case V16QI_FTYPE_V16QI_V16QI_INT:
- type = v16qi_ftype_v16qi_v16qi_int;
+ case V2DF_FTYPE_V2DF_PCDOUBLE:
+ type = v2df_ftype_v2df_pcdouble;
break;
- case V8HI_FTYPE_V8HI_V8HI_INT:
- type = v8hi_ftype_v8hi_v8hi_int;
+ case VOID_FTYPE_PV2SF_V4SF:
+ type = void_ftype_pv2sf_v4sf;
break;
- case V4SI_FTYPE_V4SI_V4SI_INT:
- type = v4si_ftype_v4si_v4si_int;
+ case VOID_FTYPE_PV2DI_V2DI:
+ type = void_ftype_pv2di_v2di;
break;
- case V4SF_FTYPE_V4SF_V4SF_INT:
- type = v4sf_ftype_v4sf_v4sf_int;
+ case VOID_FTYPE_PCHAR_V16QI:
+ type = void_ftype_pchar_v16qi;
break;
- case V2DI_FTYPE_V2DI_V2DI_INT:
- type = v2di_ftype_v2di_v2di_int;
+ case VOID_FTYPE_PFLOAT_V4SF:
+ type = void_ftype_pfloat_v4sf;
break;
- case V2DF_FTYPE_V2DF_V2DF_INT:
- type = v2df_ftype_v2df_v2df_int;
+ case VOID_FTYPE_PDOUBLE_V2DF:
+ type = void_ftype_pdouble_v2df;
+ break;
+ case VOID_FTYPE_PDI_DI:
+ type = void_ftype_pdi_di;
+ break;
+ case VOID_FTYPE_PINT_INT:
+ type = void_ftype_pint_int;
break;
default:
gcc_unreachable ();
}
- def_builtin_const (d->mask, d->name, type, d->code);
+ def_builtin (d->mask, d->name, type, d->code);
}
- /* Add all builtins that are more or less simple operations on two
- operands. */
- for (i = 0, d = bdesc_2arg; i < ARRAY_SIZE (bdesc_2arg); i++, d++)
+ /* Add all builtins with variable number of operands. */
+ for (i = 0, d = bdesc_args;
+ i < ARRAY_SIZE (bdesc_args);
+ i++, d++)
{
- /* Use one of the operands; the target can have a different mode for
- mask-generating compares. */
- enum machine_mode mode;
tree type;
if (d->name == 0)
continue;
- mode = insn_data[d->icode].operand[1].mode;
- switch (mode)
+ switch ((enum ix86_builtin_type) d->flag)
{
- case V16QImode:
+ case FLOAT_FTYPE_FLOAT:
+ type = float_ftype_float;
+ break;
+ case INT64_FTYPE_V4SF:
+ type = int64_ftype_v4sf;
+ break;
+ case INT64_FTYPE_V2DF:
+ type = int64_ftype_v2df;
+ break;
+ case INT_FTYPE_V16QI:
+ type = int_ftype_v16qi;
+ break;
+ case INT_FTYPE_V8QI:
+ type = int_ftype_v8qi;
+ break;
+ case INT_FTYPE_V4SF:
+ type = int_ftype_v4sf;
+ break;
+ case INT_FTYPE_V2DF:
+ type = int_ftype_v2df;
+ break;
+ case V16QI_FTYPE_V16QI:
+ type = v16qi_ftype_v16qi;
+ break;
+ case V8HI_FTYPE_V8HI:
+ type = v8hi_ftype_v8hi;
+ break;
+ case V8HI_FTYPE_V16QI:
+ type = v8hi_ftype_v16qi;
+ break;
+ case V8QI_FTYPE_V8QI:
+ type = v8qi_ftype_v8qi;
+ break;
+ case V4SI_FTYPE_V4SI:
+ type = v4si_ftype_v4si;
+ break;
+ case V4SI_FTYPE_V16QI:
+ type = v4si_ftype_v16qi;
+ break;
+ case V4SI_FTYPE_V8HI:
+ type = v4si_ftype_v8hi;
+ break;
+ case V4SI_FTYPE_V4SF:
+ type = v4si_ftype_v4sf;
+ break;
+ case V4SI_FTYPE_V2DF:
+ type = v4si_ftype_v2df;
+ break;
+ case V4HI_FTYPE_V4HI:
+ type = v4hi_ftype_v4hi;
+ break;
+ case V4SF_FTYPE_V4SF:
+ case V4SF_FTYPE_V4SF_VEC_MERGE:
+ type = v4sf_ftype_v4sf;
+ break;
+ case V4SF_FTYPE_V4SI:
+ type = v4sf_ftype_v4si;
+ break;
+ case V4SF_FTYPE_V2DF:
+ type = v4sf_ftype_v2df;
+ break;
+ case V2DI_FTYPE_V2DI:
+ type = v2di_ftype_v2di;
+ break;
+ case V2DI_FTYPE_V16QI:
+ type = v2di_ftype_v16qi;
+ break;
+ case V2DI_FTYPE_V8HI:
+ type = v2di_ftype_v8hi;
+ break;
+ case V2DI_FTYPE_V4SI:
+ type = v2di_ftype_v4si;
+ break;
+ case V2SI_FTYPE_V2SI:
+ type = v2si_ftype_v2si;
+ break;
+ case V2SI_FTYPE_V4SF:
+ type = v2si_ftype_v4sf;
+ break;
+ case V2SI_FTYPE_V2DF:
+ type = v2si_ftype_v2df;
+ break;
+ case V2SI_FTYPE_V2SF:
+ type = v2si_ftype_v2sf;
+ break;
+ case V2DF_FTYPE_V4SF:
+ type = v2df_ftype_v4sf;
+ break;
+ case V2DF_FTYPE_V2DF:
+ case V2DF_FTYPE_V2DF_VEC_MERGE:
+ type = v2df_ftype_v2df;
+ break;
+ case V2DF_FTYPE_V2SI:
+ type = v2df_ftype_v2si;
+ break;
+ case V2DF_FTYPE_V4SI:
+ type = v2df_ftype_v4si;
+ break;
+ case V2SF_FTYPE_V2SF:
+ type = v2sf_ftype_v2sf;
+ break;
+ case V2SF_FTYPE_V2SI:
+ type = v2sf_ftype_v2si;
+ break;
+ case V16QI_FTYPE_V16QI_V16QI:
type = v16qi_ftype_v16qi_v16qi;
break;
- case V8HImode:
+ case V16QI_FTYPE_V8HI_V8HI:
+ type = v16qi_ftype_v8hi_v8hi;
+ break;
+ case V8QI_FTYPE_V8QI_V8QI:
+ type = v8qi_ftype_v8qi_v8qi;
+ break;
+ case V8QI_FTYPE_V4HI_V4HI:
+ type = v8qi_ftype_v4hi_v4hi;
+ break;
+ case V8HI_FTYPE_V8HI_V8HI:
+ case V8HI_FTYPE_V8HI_V8HI_COUNT:
type = v8hi_ftype_v8hi_v8hi;
break;
- case V4SImode:
+ case V8HI_FTYPE_V16QI_V16QI:
+ type = v8hi_ftype_v16qi_v16qi;
+ break;
+ case V8HI_FTYPE_V4SI_V4SI:
+ type = v8hi_ftype_v4si_v4si;
+ break;
+ case V8HI_FTYPE_V8HI_SI_COUNT:
+ type = v8hi_ftype_v8hi_int;
+ break;
+ case V4SI_FTYPE_V4SI_V4SI:
+ case V4SI_FTYPE_V4SI_V4SI_COUNT:
type = v4si_ftype_v4si_v4si;
break;
- case V2DImode:
- type = v2di_ftype_v2di_v2di;
+ case V4SI_FTYPE_V8HI_V8HI:
+ type = v4si_ftype_v8hi_v8hi;
break;
- case V2DFmode:
- type = v2df_ftype_v2df_v2df;
+ case V4SI_FTYPE_V4SF_V4SF:
+ type = v4si_ftype_v4sf_v4sf;
break;
- case V4SFmode:
- type = v4sf_ftype_v4sf_v4sf;
+ case V4SI_FTYPE_V2DF_V2DF:
+ type = v4si_ftype_v2df_v2df;
break;
- case V8QImode:
- type = v8qi_ftype_v8qi_v8qi;
+ case V4SI_FTYPE_V4SI_SI_COUNT:
+ type = v4si_ftype_v4si_int;
break;
- case V4HImode:
+ case V4HI_FTYPE_V4HI_V4HI:
+ case V4HI_FTYPE_V4HI_V4HI_COUNT:
type = v4hi_ftype_v4hi_v4hi;
break;
- case V2SImode:
+ case V4HI_FTYPE_V8QI_V8QI:
+ type = v4hi_ftype_v8qi_v8qi;
+ break;
+ case V4HI_FTYPE_V2SI_V2SI:
+ type = v4hi_ftype_v2si_v2si;
+ break;
+ case V4HI_FTYPE_V4HI_SI_COUNT:
+ type = v4hi_ftype_v4hi_int;
+ break;
+ case V4SF_FTYPE_V4SF_V4SF:
+ case V4SF_FTYPE_V4SF_V4SF_SWAP:
+ type = v4sf_ftype_v4sf_v4sf;
+ break;
+ case V4SF_FTYPE_V4SF_V2SI:
+ type = v4sf_ftype_v4sf_v2si;
+ break;
+ case V4SF_FTYPE_V4SF_V2DF:
+ type = v4sf_ftype_v4sf_v2df;
+ break;
+ case V4SF_FTYPE_V4SF_DI:
+ type = v4sf_ftype_v4sf_int64;
+ break;
+ case V4SF_FTYPE_V4SF_SI:
+ type = v4sf_ftype_v4sf_int;
+ break;
+ case V2DI_FTYPE_V2DI_V2DI:
+ case V2DI_FTYPE_V2DI_V2DI_COUNT:
+ type = v2di_ftype_v2di_v2di;
+ break;
+ case V2DI_FTYPE_V16QI_V16QI:
+ type = v2di_ftype_v16qi_v16qi;
+ break;
+ case V2DI_FTYPE_V4SI_V4SI:
+ type = v2di_ftype_v4si_v4si;
+ break;
+ case V2DI_FTYPE_V2DI_V16QI:
+ type = v2di_ftype_v2di_v16qi;
+ break;
+ case V2DI_FTYPE_V2DF_V2DF:
+ type = v2di_ftype_v2df_v2df;
+ break;
+ case V2DI_FTYPE_V2DI_SI_COUNT:
+ type = v2di_ftype_v2di_int;
+ break;
+ case V2SI_FTYPE_V2SI_V2SI:
+ case V2SI_FTYPE_V2SI_V2SI_COUNT:
type = v2si_ftype_v2si_v2si;
break;
- case V1DImode:
+ case V2SI_FTYPE_V4HI_V4HI:
+ type = v2si_ftype_v4hi_v4hi;
+ break;
+ case V2SI_FTYPE_V2SF_V2SF:
+ type = v2si_ftype_v2sf_v2sf;
+ break;
+ case V2SI_FTYPE_V2SI_SI_COUNT:
+ type = v2si_ftype_v2si_int;
+ break;
+ case V2DF_FTYPE_V2DF_V2DF:
+ case V2DF_FTYPE_V2DF_V2DF_SWAP:
+ type = v2df_ftype_v2df_v2df;
+ break;
+ case V2DF_FTYPE_V2DF_V4SF:
+ type = v2df_ftype_v2df_v4sf;
+ break;
+ case V2DF_FTYPE_V2DF_DI:
+ type = v2df_ftype_v2df_int64;
+ break;
+ case V2DF_FTYPE_V2DF_SI:
+ type = v2df_ftype_v2df_int;
+ break;
+ case V2SF_FTYPE_V2SF_V2SF:
+ type = v2sf_ftype_v2sf_v2sf;
+ break;
+ case V1DI_FTYPE_V1DI_V1DI:
+ case V1DI_FTYPE_V1DI_V1DI_COUNT:
type = v1di_ftype_v1di_v1di;
break;
-
- default:
- gcc_unreachable ();
- }
-
- /* Override for comparisons. */
- if (d->icode == CODE_FOR_sse_maskcmpv4sf3
- || d->icode == CODE_FOR_sse_vmmaskcmpv4sf3)
- type = v4si_ftype_v4sf_v4sf;
-
- if (d->icode == CODE_FOR_sse2_maskcmpv2df3
- || d->icode == CODE_FOR_sse2_vmmaskcmpv2df3)
- type = v2di_ftype_v2df_v2df;
-
- if (d->icode == CODE_FOR_vec_pack_sfix_v2df)
- type = v4si_ftype_v2df_v2df;
-
- def_builtin_const (d->mask, d->name, type, d->code);
- }
-
- /* Add all builtins that are more or less simple operations on 1 operand. */
- for (i = 0, d = bdesc_1arg; i < ARRAY_SIZE (bdesc_1arg); i++, d++)
- {
- enum machine_mode mode;
- tree type;
-
- if (d->name == 0)
- continue;
- mode = insn_data[d->icode].operand[1].mode;
-
- switch (mode)
- {
- case V16QImode:
- type = v16qi_ftype_v16qi;
+ case V1DI_FTYPE_V8QI_V8QI:
+ type = v1di_ftype_v8qi_v8qi;
break;
- case V8HImode:
- type = v8hi_ftype_v8hi;
+ case V1DI_FTYPE_V2SI_V2SI:
+ type = v1di_ftype_v2si_v2si;
break;
- case V4SImode:
- type = v4si_ftype_v4si;
+ case V1DI_FTYPE_V1DI_SI_COUNT:
+ type = v1di_ftype_v1di_int;
break;
- case V2DFmode:
- type = v2df_ftype_v2df;
+ case UINT64_FTYPE_UINT64_UINT64:
+ type = uint64_ftype_uint64_uint64;
break;
- case V4SFmode:
- type = v4sf_ftype_v4sf;
+ case UINT_FTYPE_UINT_UINT:
+ type = unsigned_ftype_unsigned_unsigned;
break;
- case V8QImode:
- type = v8qi_ftype_v8qi;
+ case UINT_FTYPE_UINT_USHORT:
+ type = unsigned_ftype_unsigned_ushort;
break;
- case V4HImode:
- type = v4hi_ftype_v4hi;
+ case UINT_FTYPE_UINT_UCHAR:
+ type = unsigned_ftype_unsigned_uchar;
break;
- case V2SImode:
- type = v2si_ftype_v2si;
+ case V8HI_FTYPE_V8HI_INT:
+ type = v8hi_ftype_v8hi_int;
+ break;
+ case V4SI_FTYPE_V4SI_INT:
+ type = v4si_ftype_v4si_int;
+ break;
+ case V4HI_FTYPE_V4HI_INT:
+ type = v4hi_ftype_v4hi_int;
+ break;
+ case V4SF_FTYPE_V4SF_INT:
+ type = v4sf_ftype_v4sf_int;
+ break;
+ case V2DI_FTYPE_V2DI_INT:
+ case V2DI2TI_FTYPE_V2DI_INT:
+ type = v2di_ftype_v2di_int;
+ break;
+ case V2DF_FTYPE_V2DF_INT:
+ type = v2df_ftype_v2df_int;
+ break;
+ case V16QI_FTYPE_V16QI_V16QI_V16QI:
+ type = v16qi_ftype_v16qi_v16qi_v16qi;
+ break;
+ case V4SF_FTYPE_V4SF_V4SF_V4SF:
+ type = v4sf_ftype_v4sf_v4sf_v4sf;
+ break;
+ case V2DF_FTYPE_V2DF_V2DF_V2DF:
+ type = v2df_ftype_v2df_v2df_v2df;
+ break;
+ case V16QI_FTYPE_V16QI_V16QI_INT:
+ type = v16qi_ftype_v16qi_v16qi_int;
+ break;
+ case V8HI_FTYPE_V8HI_V8HI_INT:
+ type = v8hi_ftype_v8hi_v8hi_int;
+ break;
+ case V4SI_FTYPE_V4SI_V4SI_INT:
+ type = v4si_ftype_v4si_v4si_int;
+ break;
+ case V4SF_FTYPE_V4SF_V4SF_INT:
+ type = v4sf_ftype_v4sf_v4sf_int;
+ break;
+ case V2DI_FTYPE_V2DI_V2DI_INT:
+ case V2DI2TI_FTYPE_V2DI_V2DI_INT:
+ type = v2di_ftype_v2di_v2di_int;
+ break;
+ case V2DF_FTYPE_V2DF_V2DF_INT:
+ type = v2df_ftype_v2df_v2df_int;
+ break;
+ case V2DI_FTYPE_V2DI_UINT_UINT:
+ type = v2di_ftype_v2di_unsigned_unsigned;
+ break;
+ case V2DI_FTYPE_V2DI_V2DI_UINT_UINT:
+ type = v2di_ftype_v2di_v2di_unsigned_unsigned;
+ break;
+ case V1DI2DI_FTYPE_V1DI_V1DI_INT:
+ type = v1di_ftype_v1di_v1di_int;
break;
-
default:
- abort ();
+ gcc_unreachable ();
}
def_builtin_const (d->mask, d->name, type, d->code);
@@ -19383,31 +19891,6 @@ ix86_init_mmx_sse_builtins (void)
def_builtin_const (d->mask, d->name, ftype, d->code);
}
- /* Add the remaining MMX insns with somewhat more complicated types. */
- def_builtin (OPTION_MASK_ISA_MMX, "__builtin_ia32_emms", void_ftype_void, IX86_BUILTIN_EMMS);
-
- def_builtin_const (OPTION_MASK_ISA_MMX, "__builtin_ia32_psllwi", v4hi_ftype_v4hi_int, IX86_BUILTIN_PSLLWI);
- def_builtin_const (OPTION_MASK_ISA_MMX, "__builtin_ia32_pslldi", v2si_ftype_v2si_int, IX86_BUILTIN_PSLLDI);
- def_builtin_const (OPTION_MASK_ISA_MMX, "__builtin_ia32_psllqi", v1di_ftype_v1di_int, IX86_BUILTIN_PSLLQI);
- def_builtin_const (OPTION_MASK_ISA_MMX, "__builtin_ia32_psllw", v4hi_ftype_v4hi_v4hi, IX86_BUILTIN_PSLLW);
- def_builtin_const (OPTION_MASK_ISA_MMX, "__builtin_ia32_pslld", v2si_ftype_v2si_v2si, IX86_BUILTIN_PSLLD);
- def_builtin_const (OPTION_MASK_ISA_MMX, "__builtin_ia32_psllq", v1di_ftype_v1di_v1di, IX86_BUILTIN_PSLLQ);
-
- def_builtin_const (OPTION_MASK_ISA_MMX, "__builtin_ia32_psrlwi", v4hi_ftype_v4hi_int, IX86_BUILTIN_PSRLWI);
- def_builtin_const (OPTION_MASK_ISA_MMX, "__builtin_ia32_psrldi", v2si_ftype_v2si_int, IX86_BUILTIN_PSRLDI);
- def_builtin_const (OPTION_MASK_ISA_MMX, "__builtin_ia32_psrlqi", v1di_ftype_v1di_int, IX86_BUILTIN_PSRLQI);
- def_builtin_const (OPTION_MASK_ISA_MMX, "__builtin_ia32_psrlw", v4hi_ftype_v4hi_v4hi, IX86_BUILTIN_PSRLW);
- def_builtin_const (OPTION_MASK_ISA_MMX, "__builtin_ia32_psrld", v2si_ftype_v2si_v2si, IX86_BUILTIN_PSRLD);
- def_builtin_const (OPTION_MASK_ISA_MMX, "__builtin_ia32_psrlq", v1di_ftype_v1di_v1di, IX86_BUILTIN_PSRLQ);
-
- def_builtin_const (OPTION_MASK_ISA_MMX, "__builtin_ia32_psrawi", v4hi_ftype_v4hi_int, IX86_BUILTIN_PSRAWI);
- def_builtin_const (OPTION_MASK_ISA_MMX, "__builtin_ia32_psradi", v2si_ftype_v2si_int, IX86_BUILTIN_PSRADI);
- def_builtin_const (OPTION_MASK_ISA_MMX, "__builtin_ia32_psraw", v4hi_ftype_v4hi_v4hi, IX86_BUILTIN_PSRAW);
- def_builtin_const (OPTION_MASK_ISA_MMX, "__builtin_ia32_psrad", v2si_ftype_v2si_v2si, IX86_BUILTIN_PSRAD);
-
- def_builtin_const (OPTION_MASK_ISA_SSE | OPTION_MASK_ISA_3DNOW_A, "__builtin_ia32_pshufw", v4hi_ftype_v4hi_int, IX86_BUILTIN_PSHUFW);
- def_builtin_const (OPTION_MASK_ISA_MMX, "__builtin_ia32_pmaddwd", v2si_ftype_v4hi_v4hi, IX86_BUILTIN_PMADDWD);
-
/* comi/ucomi insns. */
for (i = 0, d = bdesc_comi; i < ARRAY_SIZE (bdesc_comi); i++, d++)
if (d->mask == OPTION_MASK_ISA_SSE2)
@@ -19419,211 +19902,22 @@ ix86_init_mmx_sse_builtins (void)
for (i = 0, d = bdesc_ptest; i < ARRAY_SIZE (bdesc_ptest); i++, d++)
def_builtin_const (d->mask, d->name, int_ftype_v2di_v2di, d->code);
- def_builtin_const (OPTION_MASK_ISA_MMX, "__builtin_ia32_packsswb", v8qi_ftype_v4hi_v4hi, IX86_BUILTIN_PACKSSWB);
- def_builtin_const (OPTION_MASK_ISA_MMX, "__builtin_ia32_packssdw", v4hi_ftype_v2si_v2si, IX86_BUILTIN_PACKSSDW);
- def_builtin_const (OPTION_MASK_ISA_MMX, "__builtin_ia32_packuswb", v8qi_ftype_v4hi_v4hi, IX86_BUILTIN_PACKUSWB);
-
+ /* SSE */
def_builtin (OPTION_MASK_ISA_SSE, "__builtin_ia32_ldmxcsr", void_ftype_unsigned, IX86_BUILTIN_LDMXCSR);
def_builtin (OPTION_MASK_ISA_SSE, "__builtin_ia32_stmxcsr", unsigned_ftype_void, IX86_BUILTIN_STMXCSR);
- def_builtin_const (OPTION_MASK_ISA_SSE, "__builtin_ia32_cvtpi2ps", v4sf_ftype_v4sf_v2si, IX86_BUILTIN_CVTPI2PS);
- def_builtin_const (OPTION_MASK_ISA_SSE, "__builtin_ia32_cvtps2pi", v2si_ftype_v4sf, IX86_BUILTIN_CVTPS2PI);
- def_builtin_const (OPTION_MASK_ISA_SSE, "__builtin_ia32_cvtsi2ss", v4sf_ftype_v4sf_int, IX86_BUILTIN_CVTSI2SS);
- def_builtin_const (OPTION_MASK_ISA_SSE | OPTION_MASK_ISA_64BIT, "__builtin_ia32_cvtsi642ss", v4sf_ftype_v4sf_int64, IX86_BUILTIN_CVTSI642SS);
- def_builtin_const (OPTION_MASK_ISA_SSE, "__builtin_ia32_cvtss2si", int_ftype_v4sf, IX86_BUILTIN_CVTSS2SI);
- def_builtin_const (OPTION_MASK_ISA_SSE | OPTION_MASK_ISA_64BIT, "__builtin_ia32_cvtss2si64", int64_ftype_v4sf, IX86_BUILTIN_CVTSS2SI64);
- def_builtin_const (OPTION_MASK_ISA_SSE, "__builtin_ia32_cvttps2pi", v2si_ftype_v4sf, IX86_BUILTIN_CVTTPS2PI);
- def_builtin_const (OPTION_MASK_ISA_SSE, "__builtin_ia32_cvttss2si", int_ftype_v4sf, IX86_BUILTIN_CVTTSS2SI);
- def_builtin_const (OPTION_MASK_ISA_SSE | OPTION_MASK_ISA_64BIT, "__builtin_ia32_cvttss2si64", int64_ftype_v4sf, IX86_BUILTIN_CVTTSS2SI64);
+ /* SSE or 3DNow!A */
def_builtin (OPTION_MASK_ISA_SSE | OPTION_MASK_ISA_3DNOW_A, "__builtin_ia32_maskmovq", void_ftype_v8qi_v8qi_pchar, IX86_BUILTIN_MASKMOVQ);
- def_builtin (OPTION_MASK_ISA_SSE, "__builtin_ia32_loadups", v4sf_ftype_pcfloat, IX86_BUILTIN_LOADUPS);
- def_builtin (OPTION_MASK_ISA_SSE, "__builtin_ia32_storeups", void_ftype_pfloat_v4sf, IX86_BUILTIN_STOREUPS);
-
- def_builtin (OPTION_MASK_ISA_SSE, "__builtin_ia32_loadhps", v4sf_ftype_v4sf_pv2si, IX86_BUILTIN_LOADHPS);
- def_builtin (OPTION_MASK_ISA_SSE, "__builtin_ia32_loadlps", v4sf_ftype_v4sf_pv2si, IX86_BUILTIN_LOADLPS);
- def_builtin (OPTION_MASK_ISA_SSE, "__builtin_ia32_storehps", void_ftype_pv2si_v4sf, IX86_BUILTIN_STOREHPS);
- def_builtin (OPTION_MASK_ISA_SSE, "__builtin_ia32_storelps", void_ftype_pv2si_v4sf, IX86_BUILTIN_STORELPS);
-
- def_builtin_const (OPTION_MASK_ISA_SSE, "__builtin_ia32_movmskps", int_ftype_v4sf, IX86_BUILTIN_MOVMSKPS);
- def_builtin_const (OPTION_MASK_ISA_SSE | OPTION_MASK_ISA_3DNOW_A, "__builtin_ia32_pmovmskb", int_ftype_v8qi, IX86_BUILTIN_PMOVMSKB);
- def_builtin (OPTION_MASK_ISA_SSE, "__builtin_ia32_movntps", void_ftype_pfloat_v4sf, IX86_BUILTIN_MOVNTPS);
- def_builtin (OPTION_MASK_ISA_SSE | OPTION_MASK_ISA_3DNOW_A, "__builtin_ia32_movntq", void_ftype_pdi_di, IX86_BUILTIN_MOVNTQ);
-
- def_builtin (OPTION_MASK_ISA_SSE | OPTION_MASK_ISA_3DNOW_A, "__builtin_ia32_sfence", void_ftype_void, IX86_BUILTIN_SFENCE);
-
- def_builtin_const (OPTION_MASK_ISA_SSE | OPTION_MASK_ISA_3DNOW_A, "__builtin_ia32_psadbw", v1di_ftype_v8qi_v8qi, IX86_BUILTIN_PSADBW);
-
- def_builtin_const (OPTION_MASK_ISA_SSE, "__builtin_ia32_rcpps", v4sf_ftype_v4sf, IX86_BUILTIN_RCPPS);
- def_builtin_const (OPTION_MASK_ISA_SSE, "__builtin_ia32_rcpss", v4sf_ftype_v4sf, IX86_BUILTIN_RCPSS);
- def_builtin_const (OPTION_MASK_ISA_SSE, "__builtin_ia32_rsqrtps", v4sf_ftype_v4sf, IX86_BUILTIN_RSQRTPS);
- def_builtin_const (OPTION_MASK_ISA_SSE, "__builtin_ia32_rsqrtps_nr", v4sf_ftype_v4sf, IX86_BUILTIN_RSQRTPS_NR);
- def_builtin_const (OPTION_MASK_ISA_SSE, "__builtin_ia32_rsqrtss", v4sf_ftype_v4sf, IX86_BUILTIN_RSQRTSS);
- ftype = build_function_type_list (float_type_node,
- float_type_node,
- NULL_TREE);
- def_builtin_const (OPTION_MASK_ISA_SSE, "__builtin_ia32_rsqrtf", ftype, IX86_BUILTIN_RSQRTF);
- def_builtin_const (OPTION_MASK_ISA_SSE, "__builtin_ia32_sqrtps", v4sf_ftype_v4sf, IX86_BUILTIN_SQRTPS);
- def_builtin_const (OPTION_MASK_ISA_SSE, "__builtin_ia32_sqrtps_nr", v4sf_ftype_v4sf, IX86_BUILTIN_SQRTPS_NR);
- def_builtin_const (OPTION_MASK_ISA_SSE, "__builtin_ia32_sqrtss", v4sf_ftype_v4sf, IX86_BUILTIN_SQRTSS);
-
- /* Original 3DNow! */
- def_builtin (OPTION_MASK_ISA_3DNOW, "__builtin_ia32_femms", void_ftype_void, IX86_BUILTIN_FEMMS);
- def_builtin_const (OPTION_MASK_ISA_3DNOW, "__builtin_ia32_pavgusb", v8qi_ftype_v8qi_v8qi, IX86_BUILTIN_PAVGUSB);
- def_builtin_const (OPTION_MASK_ISA_3DNOW, "__builtin_ia32_pf2id", v2si_ftype_v2sf, IX86_BUILTIN_PF2ID);
- def_builtin_const (OPTION_MASK_ISA_3DNOW, "__builtin_ia32_pfacc", v2sf_ftype_v2sf_v2sf, IX86_BUILTIN_PFACC);
- def_builtin_const (OPTION_MASK_ISA_3DNOW, "__builtin_ia32_pfadd", v2sf_ftype_v2sf_v2sf, IX86_BUILTIN_PFADD);
- def_builtin_const (OPTION_MASK_ISA_3DNOW, "__builtin_ia32_pfcmpeq", v2si_ftype_v2sf_v2sf, IX86_BUILTIN_PFCMPEQ);
- def_builtin_const (OPTION_MASK_ISA_3DNOW, "__builtin_ia32_pfcmpge", v2si_ftype_v2sf_v2sf, IX86_BUILTIN_PFCMPGE);
- def_builtin_const (OPTION_MASK_ISA_3DNOW, "__builtin_ia32_pfcmpgt", v2si_ftype_v2sf_v2sf, IX86_BUILTIN_PFCMPGT);
- def_builtin_const (OPTION_MASK_ISA_3DNOW, "__builtin_ia32_pfmax", v2sf_ftype_v2sf_v2sf, IX86_BUILTIN_PFMAX);
- def_builtin_const (OPTION_MASK_ISA_3DNOW, "__builtin_ia32_pfmin", v2sf_ftype_v2sf_v2sf, IX86_BUILTIN_PFMIN);
- def_builtin_const (OPTION_MASK_ISA_3DNOW, "__builtin_ia32_pfmul", v2sf_ftype_v2sf_v2sf, IX86_BUILTIN_PFMUL);
- def_builtin_const (OPTION_MASK_ISA_3DNOW, "__builtin_ia32_pfrcp", v2sf_ftype_v2sf, IX86_BUILTIN_PFRCP);
- def_builtin_const (OPTION_MASK_ISA_3DNOW, "__builtin_ia32_pfrcpit1", v2sf_ftype_v2sf_v2sf, IX86_BUILTIN_PFRCPIT1);
- def_builtin_const (OPTION_MASK_ISA_3DNOW, "__builtin_ia32_pfrcpit2", v2sf_ftype_v2sf_v2sf, IX86_BUILTIN_PFRCPIT2);
- def_builtin_const (OPTION_MASK_ISA_3DNOW, "__builtin_ia32_pfrsqrt", v2sf_ftype_v2sf, IX86_BUILTIN_PFRSQRT);
- def_builtin_const (OPTION_MASK_ISA_3DNOW, "__builtin_ia32_pfrsqit1", v2sf_ftype_v2sf_v2sf, IX86_BUILTIN_PFRSQIT1);
- def_builtin_const (OPTION_MASK_ISA_3DNOW, "__builtin_ia32_pfsub", v2sf_ftype_v2sf_v2sf, IX86_BUILTIN_PFSUB);
- def_builtin_const (OPTION_MASK_ISA_3DNOW, "__builtin_ia32_pfsubr", v2sf_ftype_v2sf_v2sf, IX86_BUILTIN_PFSUBR);
- def_builtin_const (OPTION_MASK_ISA_3DNOW, "__builtin_ia32_pi2fd", v2sf_ftype_v2si, IX86_BUILTIN_PI2FD);
- def_builtin_const (OPTION_MASK_ISA_3DNOW, "__builtin_ia32_pmulhrw", v4hi_ftype_v4hi_v4hi, IX86_BUILTIN_PMULHRW);
-
- /* 3DNow! extension as used in the Athlon CPU. */
- def_builtin_const (OPTION_MASK_ISA_3DNOW_A, "__builtin_ia32_pf2iw", v2si_ftype_v2sf, IX86_BUILTIN_PF2IW);
- def_builtin_const (OPTION_MASK_ISA_3DNOW_A, "__builtin_ia32_pfnacc", v2sf_ftype_v2sf_v2sf, IX86_BUILTIN_PFNACC);
- def_builtin_const (OPTION_MASK_ISA_3DNOW_A, "__builtin_ia32_pfpnacc", v2sf_ftype_v2sf_v2sf, IX86_BUILTIN_PFPNACC);
- def_builtin_const (OPTION_MASK_ISA_3DNOW_A, "__builtin_ia32_pi2fw", v2sf_ftype_v2si, IX86_BUILTIN_PI2FW);
- def_builtin_const (OPTION_MASK_ISA_3DNOW_A, "__builtin_ia32_pswapdsf", v2sf_ftype_v2sf, IX86_BUILTIN_PSWAPDSF);
- def_builtin_const (OPTION_MASK_ISA_3DNOW_A, "__builtin_ia32_pswapdsi", v2si_ftype_v2si, IX86_BUILTIN_PSWAPDSI);
-
/* SSE2 */
def_builtin (OPTION_MASK_ISA_SSE2, "__builtin_ia32_maskmovdqu", void_ftype_v16qi_v16qi_pchar, IX86_BUILTIN_MASKMOVDQU);
- def_builtin (OPTION_MASK_ISA_SSE2, "__builtin_ia32_loadupd", v2df_ftype_pcdouble, IX86_BUILTIN_LOADUPD);
- def_builtin (OPTION_MASK_ISA_SSE2, "__builtin_ia32_storeupd", void_ftype_pdouble_v2df, IX86_BUILTIN_STOREUPD);
-
- def_builtin (OPTION_MASK_ISA_SSE2, "__builtin_ia32_loadhpd", v2df_ftype_v2df_pcdouble, IX86_BUILTIN_LOADHPD);
- def_builtin (OPTION_MASK_ISA_SSE2, "__builtin_ia32_loadlpd", v2df_ftype_v2df_pcdouble, IX86_BUILTIN_LOADLPD);
-
- def_builtin_const (OPTION_MASK_ISA_SSE2, "__builtin_ia32_movmskpd", int_ftype_v2df, IX86_BUILTIN_MOVMSKPD);
- def_builtin_const (OPTION_MASK_ISA_SSE2, "__builtin_ia32_pmovmskb128", int_ftype_v16qi, IX86_BUILTIN_PMOVMSKB128);
- def_builtin (OPTION_MASK_ISA_SSE2, "__builtin_ia32_movnti", void_ftype_pint_int, IX86_BUILTIN_MOVNTI);
- def_builtin (OPTION_MASK_ISA_SSE2, "__builtin_ia32_movntpd", void_ftype_pdouble_v2df, IX86_BUILTIN_MOVNTPD);
- def_builtin (OPTION_MASK_ISA_SSE2, "__builtin_ia32_movntdq", void_ftype_pv2di_v2di, IX86_BUILTIN_MOVNTDQ);
-
- def_builtin_const (OPTION_MASK_ISA_SSE2, "__builtin_ia32_pshufd", v4si_ftype_v4si_int, IX86_BUILTIN_PSHUFD);
- def_builtin_const (OPTION_MASK_ISA_SSE2, "__builtin_ia32_pshuflw", v8hi_ftype_v8hi_int, IX86_BUILTIN_PSHUFLW);
- def_builtin_const (OPTION_MASK_ISA_SSE2, "__builtin_ia32_pshufhw", v8hi_ftype_v8hi_int, IX86_BUILTIN_PSHUFHW);
- def_builtin_const (OPTION_MASK_ISA_SSE2, "__builtin_ia32_psadbw128", v2di_ftype_v16qi_v16qi, IX86_BUILTIN_PSADBW128);
-
- def_builtin_const (OPTION_MASK_ISA_SSE2, "__builtin_ia32_sqrtpd", v2df_ftype_v2df, IX86_BUILTIN_SQRTPD);
- def_builtin_const (OPTION_MASK_ISA_SSE2, "__builtin_ia32_sqrtsd", v2df_ftype_v2df, IX86_BUILTIN_SQRTSD);
-
- def_builtin_const (OPTION_MASK_ISA_SSE2, "__builtin_ia32_cvtdq2pd", v2df_ftype_v4si, IX86_BUILTIN_CVTDQ2PD);
- def_builtin_const (OPTION_MASK_ISA_SSE2, "__builtin_ia32_cvtdq2ps", v4sf_ftype_v4si, IX86_BUILTIN_CVTDQ2PS);
-
- def_builtin_const (OPTION_MASK_ISA_SSE2, "__builtin_ia32_cvtpd2dq", v4si_ftype_v2df, IX86_BUILTIN_CVTPD2DQ);
- def_builtin_const (OPTION_MASK_ISA_SSE2, "__builtin_ia32_cvtpd2pi", v2si_ftype_v2df, IX86_BUILTIN_CVTPD2PI);
- def_builtin_const (OPTION_MASK_ISA_SSE2, "__builtin_ia32_cvtpd2ps", v4sf_ftype_v2df, IX86_BUILTIN_CVTPD2PS);
- def_builtin_const (OPTION_MASK_ISA_SSE2, "__builtin_ia32_cvttpd2dq", v4si_ftype_v2df, IX86_BUILTIN_CVTTPD2DQ);
- def_builtin_const (OPTION_MASK_ISA_SSE2, "__builtin_ia32_cvttpd2pi", v2si_ftype_v2df, IX86_BUILTIN_CVTTPD2PI);
-
- def_builtin_const (OPTION_MASK_ISA_SSE2, "__builtin_ia32_cvtpi2pd", v2df_ftype_v2si, IX86_BUILTIN_CVTPI2PD);
-
- def_builtin_const (OPTION_MASK_ISA_SSE2, "__builtin_ia32_cvtsd2si", int_ftype_v2df, IX86_BUILTIN_CVTSD2SI);
- def_builtin_const (OPTION_MASK_ISA_SSE2, "__builtin_ia32_cvttsd2si", int_ftype_v2df, IX86_BUILTIN_CVTTSD2SI);
- def_builtin_const (OPTION_MASK_ISA_SSE2 | OPTION_MASK_ISA_64BIT, "__builtin_ia32_cvtsd2si64", int64_ftype_v2df, IX86_BUILTIN_CVTSD2SI64);
- def_builtin_const (OPTION_MASK_ISA_SSE2 | OPTION_MASK_ISA_64BIT, "__builtin_ia32_cvttsd2si64", int64_ftype_v2df, IX86_BUILTIN_CVTTSD2SI64);
-
- def_builtin_const (OPTION_MASK_ISA_SSE2, "__builtin_ia32_cvtps2dq", v4si_ftype_v4sf, IX86_BUILTIN_CVTPS2DQ);
- def_builtin_const (OPTION_MASK_ISA_SSE2, "__builtin_ia32_cvtps2pd", v2df_ftype_v4sf, IX86_BUILTIN_CVTPS2PD);
- def_builtin_const (OPTION_MASK_ISA_SSE2, "__builtin_ia32_cvttps2dq", v4si_ftype_v4sf, IX86_BUILTIN_CVTTPS2DQ);
-
- def_builtin_const (OPTION_MASK_ISA_SSE2, "__builtin_ia32_cvtsi2sd", v2df_ftype_v2df_int, IX86_BUILTIN_CVTSI2SD);
- def_builtin_const (OPTION_MASK_ISA_SSE2 | OPTION_MASK_ISA_64BIT, "__builtin_ia32_cvtsi642sd", v2df_ftype_v2df_int64, IX86_BUILTIN_CVTSI642SD);
- def_builtin_const (OPTION_MASK_ISA_SSE2, "__builtin_ia32_cvtsd2ss", v4sf_ftype_v4sf_v2df, IX86_BUILTIN_CVTSD2SS);
- def_builtin_const (OPTION_MASK_ISA_SSE2, "__builtin_ia32_cvtss2sd", v2df_ftype_v2df_v4sf, IX86_BUILTIN_CVTSS2SD);
-
def_builtin (OPTION_MASK_ISA_SSE2, "__builtin_ia32_clflush", void_ftype_pcvoid, IX86_BUILTIN_CLFLUSH);
- def_builtin (OPTION_MASK_ISA_SSE2, "__builtin_ia32_lfence", void_ftype_void, IX86_BUILTIN_LFENCE);
x86_mfence = def_builtin (OPTION_MASK_ISA_SSE2, "__builtin_ia32_mfence", void_ftype_void, IX86_BUILTIN_MFENCE);
- def_builtin (OPTION_MASK_ISA_SSE2, "__builtin_ia32_loaddqu", v16qi_ftype_pcchar, IX86_BUILTIN_LOADDQU);
- def_builtin (OPTION_MASK_ISA_SSE2, "__builtin_ia32_storedqu", void_ftype_pchar_v16qi, IX86_BUILTIN_STOREDQU);
-
- def_builtin_const (OPTION_MASK_ISA_SSE2, "__builtin_ia32_pmuludq", v1di_ftype_v2si_v2si, IX86_BUILTIN_PMULUDQ);
- def_builtin_const (OPTION_MASK_ISA_SSE2, "__builtin_ia32_pmuludq128", v2di_ftype_v4si_v4si, IX86_BUILTIN_PMULUDQ128);
-
- def_builtin_const (OPTION_MASK_ISA_SSE2, "__builtin_ia32_pslldqi128", v2di_ftype_v2di_int, IX86_BUILTIN_PSLLDQI128);
- def_builtin_const (OPTION_MASK_ISA_SSE2, "__builtin_ia32_psllwi128", v8hi_ftype_v8hi_int, IX86_BUILTIN_PSLLWI128);
- def_builtin_const (OPTION_MASK_ISA_SSE2, "__builtin_ia32_pslldi128", v4si_ftype_v4si_int, IX86_BUILTIN_PSLLDI128);
- def_builtin_const (OPTION_MASK_ISA_SSE2, "__builtin_ia32_psllqi128", v2di_ftype_v2di_int, IX86_BUILTIN_PSLLQI128);
- def_builtin_const (OPTION_MASK_ISA_SSE2, "__builtin_ia32_psllw128", v8hi_ftype_v8hi_v8hi, IX86_BUILTIN_PSLLW128);
- def_builtin_const (OPTION_MASK_ISA_SSE2, "__builtin_ia32_pslld128", v4si_ftype_v4si_v4si, IX86_BUILTIN_PSLLD128);
- def_builtin_const (OPTION_MASK_ISA_SSE2, "__builtin_ia32_psllq128", v2di_ftype_v2di_v2di, IX86_BUILTIN_PSLLQ128);
-
- def_builtin_const (OPTION_MASK_ISA_SSE2, "__builtin_ia32_psrldqi128", v2di_ftype_v2di_int, IX86_BUILTIN_PSRLDQI128);
- def_builtin_const (OPTION_MASK_ISA_SSE2, "__builtin_ia32_psrlwi128", v8hi_ftype_v8hi_int, IX86_BUILTIN_PSRLWI128);
- def_builtin_const (OPTION_MASK_ISA_SSE2, "__builtin_ia32_psrldi128", v4si_ftype_v4si_int, IX86_BUILTIN_PSRLDI128);
- def_builtin_const (OPTION_MASK_ISA_SSE2, "__builtin_ia32_psrlqi128", v2di_ftype_v2di_int, IX86_BUILTIN_PSRLQI128);
- def_builtin_const (OPTION_MASK_ISA_SSE2, "__builtin_ia32_psrlw128", v8hi_ftype_v8hi_v8hi, IX86_BUILTIN_PSRLW128);
- def_builtin_const (OPTION_MASK_ISA_SSE2, "__builtin_ia32_psrld128", v4si_ftype_v4si_v4si, IX86_BUILTIN_PSRLD128);
- def_builtin_const (OPTION_MASK_ISA_SSE2, "__builtin_ia32_psrlq128", v2di_ftype_v2di_v2di, IX86_BUILTIN_PSRLQ128);
-
- def_builtin_const (OPTION_MASK_ISA_SSE2, "__builtin_ia32_psrawi128", v8hi_ftype_v8hi_int, IX86_BUILTIN_PSRAWI128);
- def_builtin_const (OPTION_MASK_ISA_SSE2, "__builtin_ia32_psradi128", v4si_ftype_v4si_int, IX86_BUILTIN_PSRADI128);
- def_builtin_const (OPTION_MASK_ISA_SSE2, "__builtin_ia32_psraw128", v8hi_ftype_v8hi_v8hi, IX86_BUILTIN_PSRAW128);
- def_builtin_const (OPTION_MASK_ISA_SSE2, "__builtin_ia32_psrad128", v4si_ftype_v4si_v4si, IX86_BUILTIN_PSRAD128);
-
- def_builtin_const (OPTION_MASK_ISA_SSE2, "__builtin_ia32_pmaddwd128", v4si_ftype_v8hi_v8hi, IX86_BUILTIN_PMADDWD128);
-
- /* Prescott New Instructions. */
+ /* SSE3. */
def_builtin (OPTION_MASK_ISA_SSE3, "__builtin_ia32_monitor", void_ftype_pcvoid_unsigned_unsigned, IX86_BUILTIN_MONITOR);
def_builtin (OPTION_MASK_ISA_SSE3, "__builtin_ia32_mwait", void_ftype_unsigned_unsigned, IX86_BUILTIN_MWAIT);
- def_builtin (OPTION_MASK_ISA_SSE3, "__builtin_ia32_lddqu", v16qi_ftype_pcchar, IX86_BUILTIN_LDDQU);
-
- /* SSSE3. */
- def_builtin_const (OPTION_MASK_ISA_SSSE3, "__builtin_ia32_palignr128", v2di_ftype_v2di_v2di_int, IX86_BUILTIN_PALIGNR128);
- def_builtin_const (OPTION_MASK_ISA_SSSE3, "__builtin_ia32_palignr", di_ftype_di_di_int, IX86_BUILTIN_PALIGNR);
-
- /* SSE4.1. */
- def_builtin (OPTION_MASK_ISA_SSE4_1, "__builtin_ia32_movntdqa", v2di_ftype_pv2di, IX86_BUILTIN_MOVNTDQA);
- def_builtin_const (OPTION_MASK_ISA_SSE4_1, "__builtin_ia32_pmovsxbw128", v8hi_ftype_v16qi, IX86_BUILTIN_PMOVSXBW128);
- def_builtin_const (OPTION_MASK_ISA_SSE4_1, "__builtin_ia32_pmovsxbd128", v4si_ftype_v16qi, IX86_BUILTIN_PMOVSXBD128);
- def_builtin_const (OPTION_MASK_ISA_SSE4_1, "__builtin_ia32_pmovsxbq128", v2di_ftype_v16qi, IX86_BUILTIN_PMOVSXBQ128);
- def_builtin_const (OPTION_MASK_ISA_SSE4_1, "__builtin_ia32_pmovsxwd128", v4si_ftype_v8hi, IX86_BUILTIN_PMOVSXWD128);
- def_builtin_const (OPTION_MASK_ISA_SSE4_1, "__builtin_ia32_pmovsxwq128", v2di_ftype_v8hi, IX86_BUILTIN_PMOVSXWQ128);
- def_builtin_const (OPTION_MASK_ISA_SSE4_1, "__builtin_ia32_pmovsxdq128", v2di_ftype_v4si, IX86_BUILTIN_PMOVSXDQ128);
- def_builtin_const (OPTION_MASK_ISA_SSE4_1, "__builtin_ia32_pmovzxbw128", v8hi_ftype_v16qi, IX86_BUILTIN_PMOVZXBW128);
- def_builtin_const (OPTION_MASK_ISA_SSE4_1, "__builtin_ia32_pmovzxbd128", v4si_ftype_v16qi, IX86_BUILTIN_PMOVZXBD128);
- def_builtin_const (OPTION_MASK_ISA_SSE4_1, "__builtin_ia32_pmovzxbq128", v2di_ftype_v16qi, IX86_BUILTIN_PMOVZXBQ128);
- def_builtin_const (OPTION_MASK_ISA_SSE4_1, "__builtin_ia32_pmovzxwd128", v4si_ftype_v8hi, IX86_BUILTIN_PMOVZXWD128);
- def_builtin_const (OPTION_MASK_ISA_SSE4_1, "__builtin_ia32_pmovzxwq128", v2di_ftype_v8hi, IX86_BUILTIN_PMOVZXWQ128);
- def_builtin_const (OPTION_MASK_ISA_SSE4_1, "__builtin_ia32_pmovzxdq128", v2di_ftype_v4si, IX86_BUILTIN_PMOVZXDQ128);
- def_builtin_const (OPTION_MASK_ISA_SSE4_1, "__builtin_ia32_pmuldq128", v2di_ftype_v4si_v4si, IX86_BUILTIN_PMULDQ128);
-
- /* SSE4.2. */
- ftype = build_function_type_list (unsigned_type_node,
- unsigned_type_node,
- unsigned_char_type_node,
- NULL_TREE);
- def_builtin_const (OPTION_MASK_ISA_SSE4_2, "__builtin_ia32_crc32qi", ftype, IX86_BUILTIN_CRC32QI);
- ftype = build_function_type_list (unsigned_type_node,
- unsigned_type_node,
- short_unsigned_type_node,
- NULL_TREE);
- def_builtin_const (OPTION_MASK_ISA_SSE4_2, "__builtin_ia32_crc32hi", ftype, IX86_BUILTIN_CRC32HI);
- ftype = build_function_type_list (unsigned_type_node,
- unsigned_type_node,
- unsigned_type_node,
- NULL_TREE);
- def_builtin_const (OPTION_MASK_ISA_SSE4_2, "__builtin_ia32_crc32si", ftype, IX86_BUILTIN_CRC32SI);
- ftype = build_function_type_list (long_long_unsigned_type_node,
- long_long_unsigned_type_node,
- long_long_unsigned_type_node,
- NULL_TREE);
- def_builtin_const (OPTION_MASK_ISA_SSE4_2, "__builtin_ia32_crc32di", ftype, IX86_BUILTIN_CRC32DI);
/* AES */
if (TARGET_AES)
@@ -19644,14 +19938,6 @@ ix86_init_mmx_sse_builtins (void)
def_builtin_const (OPTION_MASK_ISA_SSE2, "__builtin_ia32_pclmulqdq128", v2di_ftype_v2di_v2di_int, IX86_BUILTIN_PCLMULQDQ128);
}
- /* AMDFAM10 SSE4A New built-ins */
- def_builtin (OPTION_MASK_ISA_SSE4A, "__builtin_ia32_movntsd", void_ftype_pdouble_v2df, IX86_BUILTIN_MOVNTSD);
- def_builtin (OPTION_MASK_ISA_SSE4A, "__builtin_ia32_movntss", void_ftype_pfloat_v4sf, IX86_BUILTIN_MOVNTSS);
- def_builtin_const (OPTION_MASK_ISA_SSE4A, "__builtin_ia32_extrqi", v2di_ftype_v2di_unsigned_unsigned, IX86_BUILTIN_EXTRQI);
- def_builtin_const (OPTION_MASK_ISA_SSE4A, "__builtin_ia32_extrq", v2di_ftype_v2di_v16qi, IX86_BUILTIN_EXTRQ);
- def_builtin_const (OPTION_MASK_ISA_SSE4A, "__builtin_ia32_insertqi", v2di_ftype_v2di_v2di_unsigned_unsigned, IX86_BUILTIN_INSERTQI);
- def_builtin_const (OPTION_MASK_ISA_SSE4A, "__builtin_ia32_insertq", v2di_ftype_v2di_v2di, IX86_BUILTIN_INSERTQ);
-
/* Access to the vec_init patterns. */
ftype = build_function_type_list (V2SI_type_node, integer_type_node,
integer_type_node, NULL_TREE);
@@ -19819,206 +20105,6 @@ safe_vector_operand (rtx x, enum machine_mode mode)
return x;
}
-/* Subroutine of ix86_expand_builtin to take care of SSE insns with
- variable number of operands. */
-
-static rtx
-ix86_expand_sse_operands_builtin (enum insn_code icode, tree exp,
- enum sse_builtin_type type,
- rtx target)
-{
- rtx pat;
- unsigned int i, nargs;
- int num_memory = 0;
- struct
- {
- rtx op;
- enum machine_mode mode;
- } args[3];
- bool last_arg_constant = false;
- const struct insn_data *insn_p = &insn_data[icode];
- enum machine_mode tmode = insn_p->operand[0].mode;
-
- switch (type)
- {
- case V4SF_FTYPE_V4SF_INT:
- case V2DI_FTYPE_V2DI_INT:
- case V2DF_FTYPE_V2DF_INT:
- nargs = 2;
- last_arg_constant = true;
- break;
- case V16QI_FTYPE_V16QI_V16QI_V16QI:
- case V4SF_FTYPE_V4SF_V4SF_V4SF:
- case V2DF_FTYPE_V2DF_V2DF_V2DF:
- nargs = 3;
- break;
- case V16QI_FTYPE_V16QI_V16QI_INT:
- case V8HI_FTYPE_V8HI_V8HI_INT:
- case V4SI_FTYPE_V4SI_V4SI_INT:
- case V4SF_FTYPE_V4SF_V4SF_INT:
- case V2DI_FTYPE_V2DI_V2DI_INT:
- case V2DF_FTYPE_V2DF_V2DF_INT:
- nargs = 3;
- last_arg_constant = true;
- break;
- default:
- gcc_unreachable ();
- }
-
- gcc_assert (nargs <= ARRAY_SIZE (args));
-
- if (optimize
- || target == 0
- || GET_MODE (target) != tmode
- || ! (*insn_p->operand[0].predicate) (target, tmode))
- target = gen_reg_rtx (tmode);
-
- for (i = 0; i < nargs; i++)
- {
- tree arg = CALL_EXPR_ARG (exp, i);
- rtx op = expand_normal (arg);
- enum machine_mode mode = insn_p->operand[i + 1].mode;
- bool match = (*insn_p->operand[i + 1].predicate) (op, mode);
-
- if (last_arg_constant && (i + 1) == nargs)
- {
- if (!match)
- switch (icode)
- {
- case CODE_FOR_sse4_1_roundpd:
- case CODE_FOR_sse4_1_roundps:
- case CODE_FOR_sse4_1_roundsd:
- case CODE_FOR_sse4_1_roundss:
- case CODE_FOR_sse4_1_blendps:
- error ("the last argument must be a 4-bit immediate");
- return const0_rtx;
-
- case CODE_FOR_sse4_1_blendpd:
- error ("the last argument must be a 2-bit immediate");
- return const0_rtx;
-
- default:
- error ("the last argument must be an 8-bit immediate");
- return const0_rtx;
- }
- }
- else
- {
- if (VECTOR_MODE_P (mode))
- op = safe_vector_operand (op, mode);
-
- /* If we aren't optimizing, only allow one memory operand to
- be generated. */
- if (memory_operand (op, mode))
- num_memory++;
-
- gcc_assert (GET_MODE (op) == mode
- || GET_MODE (op) == VOIDmode);
-
- if (optimize || !match || num_memory > 1)
- op = copy_to_mode_reg (mode, op);
- }
-
- args[i].op = op;
- args[i].mode = mode;
- }
-
- switch (nargs)
- {
- case 1:
- pat = GEN_FCN (icode) (target, args[0].op);
- break;
- case 2:
- pat = GEN_FCN (icode) (target, args[0].op, args[1].op);
- break;
- case 3:
- pat = GEN_FCN (icode) (target, args[0].op, args[1].op,
- args[2].op);
- break;
- default:
- gcc_unreachable ();
- }
-
- if (! pat)
- return 0;
-
- emit_insn (pat);
- return target;
-}
-
-/* Subroutine of ix86_expand_builtin to take care of crc32 insns. */
-
-static rtx
-ix86_expand_crc32 (enum insn_code icode, tree exp, rtx target)
-{
- rtx pat;
- tree arg0 = CALL_EXPR_ARG (exp, 0);
- tree arg1 = CALL_EXPR_ARG (exp, 1);
- rtx op0 = expand_normal (arg0);
- rtx op1 = expand_normal (arg1);
- enum machine_mode tmode = insn_data[icode].operand[0].mode;
- enum machine_mode mode0 = insn_data[icode].operand[1].mode;
- enum machine_mode mode1 = insn_data[icode].operand[2].mode;
-
- if (optimize
- || !target
- || GET_MODE (target) != tmode
- || ! (*insn_data[icode].operand[0].predicate) (target, tmode))
- target = gen_reg_rtx (tmode);
-
- if (!(*insn_data[icode].operand[1].predicate) (op0, mode0))
- op0 = copy_to_mode_reg (mode0, op0);
- if (!(*insn_data[icode].operand[2].predicate) (op1, mode1))
- {
- op1 = copy_to_reg (op1);
- op1 = simplify_gen_subreg (mode1, op1, GET_MODE (op1), 0);
- }
-
- pat = GEN_FCN (icode) (target, op0, op1);
- if (! pat)
- return 0;
- emit_insn (pat);
- return target;
-}
-
-/* Subroutine of ix86_expand_builtin to take care of binop insns
- with an immediate. */
-
-static rtx
-ix86_expand_binop_imm_builtin (enum insn_code icode, tree exp,
- rtx target)
-{
- rtx pat;
- tree arg0 = CALL_EXPR_ARG (exp, 0);
- tree arg1 = CALL_EXPR_ARG (exp, 1);
- rtx op0 = expand_normal (arg0);
- rtx op1 = expand_normal (arg1);
- enum machine_mode tmode = insn_data[icode].operand[0].mode;
- enum machine_mode mode0 = insn_data[icode].operand[1].mode;
- enum machine_mode mode1 = insn_data[icode].operand[2].mode;
-
- if (! (*insn_data[icode].operand[1].predicate) (op0, mode1))
- {
- op0 = copy_to_reg (op0);
- op0 = simplify_gen_subreg (mode0, op0, GET_MODE (op0), 0);
- }
-
- if (! (*insn_data[icode].operand[2].predicate) (op1, mode1))
- {
- error ("the last operand must be an immediate");
- return const0_rtx;
- }
-
- target = gen_reg_rtx (V2DImode);
- pat = GEN_FCN (icode) (simplify_gen_subreg (tmode, target,
- V2DImode, 0),
- op0, op1);
- if (! pat)
- return 0;
- emit_insn (pat);
- return target;
-}
-
/* Subroutine of ix86_expand_builtin to take care of binop insns. */
static rtx
@@ -20258,71 +20344,12 @@ ix86_expand_multi_arg_builtin (enum insn_code icode, tree exp, rtx target,
return target;
}
-/* Subroutine of ix86_expand_builtin to take care of stores. */
-
-static rtx
-ix86_expand_store_builtin (enum insn_code icode, tree exp)
-{
- rtx pat;
- tree arg0 = CALL_EXPR_ARG (exp, 0);
- tree arg1 = CALL_EXPR_ARG (exp, 1);
- rtx op0 = expand_normal (arg0);
- rtx op1 = expand_normal (arg1);
- enum machine_mode mode0 = insn_data[icode].operand[0].mode;
- enum machine_mode mode1 = insn_data[icode].operand[1].mode;
-
- if (VECTOR_MODE_P (mode1))
- op1 = safe_vector_operand (op1, mode1);
-
- op0 = gen_rtx_MEM (mode0, copy_to_mode_reg (Pmode, op0));
- op1 = copy_to_mode_reg (mode1, op1);
-
- pat = GEN_FCN (icode) (op0, op1);
- if (pat)
- emit_insn (pat);
- return 0;
-}
-
-/* Subroutine of ix86_expand_builtin to take care of unop insns. */
+/* Subroutine of ix86_expand_args_builtin to take care of scalar unop
+ insns with vec_merge. */
static rtx
-ix86_expand_unop_builtin (enum insn_code icode, tree exp,
- rtx target, int do_load)
-{
- rtx pat;
- tree arg0 = CALL_EXPR_ARG (exp, 0);
- rtx op0 = expand_normal (arg0);
- enum machine_mode tmode = insn_data[icode].operand[0].mode;
- enum machine_mode mode0 = insn_data[icode].operand[1].mode;
-
- if (optimize || !target
- || GET_MODE (target) != tmode
- || ! (*insn_data[icode].operand[0].predicate) (target, tmode))
- target = gen_reg_rtx (tmode);
- if (do_load)
- op0 = gen_rtx_MEM (mode0, copy_to_mode_reg (Pmode, op0));
- else
- {
- if (VECTOR_MODE_P (mode0))
- op0 = safe_vector_operand (op0, mode0);
-
- if ((optimize && !register_operand (op0, mode0))
- || ! (*insn_data[icode].operand[1].predicate) (op0, mode0))
- op0 = copy_to_mode_reg (mode0, op0);
- }
-
- pat = GEN_FCN (icode) (target, op0);
- if (! pat)
- return 0;
- emit_insn (pat);
- return target;
-}
-
-/* Subroutine of ix86_expand_builtin to take care of three special unop insns:
- sqrtss, rsqrtss, rcpss. */
-
-static rtx
-ix86_expand_unop1_builtin (enum insn_code icode, tree exp, rtx target)
+ix86_expand_unop_vec_merge_builtin (enum insn_code icode, tree exp,
+ rtx target)
{
rtx pat;
tree arg0 = CALL_EXPR_ARG (exp, 0);
@@ -20356,8 +20383,8 @@ ix86_expand_unop1_builtin (enum insn_code icode, tree exp, rtx target)
/* Subroutine of ix86_expand_builtin to take care of comparison insns. */
static rtx
-ix86_expand_sse_compare (const struct builtin_description *d, tree exp,
- rtx target)
+ix86_expand_sse_compare (const struct builtin_description *d,
+ tree exp, rtx target, bool swap)
{
rtx pat;
tree arg0 = CALL_EXPR_ARG (exp, 0);
@@ -20377,7 +20404,7 @@ ix86_expand_sse_compare (const struct builtin_description *d, tree exp,
/* Swap operands if we have a comparison that isn't available in
hardware. */
- if (d->flag & BUILTIN_DESC_SWAP_OPERANDS)
+ if (swap)
{
rtx tmp = gen_reg_rtx (mode1);
emit_move_insn (tmp, op1);
@@ -20405,6 +20432,457 @@ ix86_expand_sse_compare (const struct builtin_description *d, tree exp,
return target;
}
+/* Subroutine of ix86_expand_builtin to take care of insns with
+ variable number of operands. */
+
+static rtx
+ix86_expand_args_builtin (const struct builtin_description *d,
+ tree exp, rtx target)
+{
+ rtx pat, real_target;
+ unsigned int i, nargs;
+ unsigned int nargs_constant = 0;
+ int num_memory = 0;
+ struct
+ {
+ rtx op;
+ enum machine_mode mode;
+ } args[4];
+ bool last_arg_count = false;
+ enum insn_code icode = d->icode;
+ const struct insn_data *insn_p = &insn_data[icode];
+ enum machine_mode tmode = insn_p->operand[0].mode;
+ enum machine_mode rmode = VOIDmode;
+ bool swap = false;
+ enum rtx_code comparison = d->comparison;
+
+ switch ((enum ix86_builtin_type) d->flag)
+ {
+ case FLOAT128_FTYPE_FLOAT128:
+ case FLOAT_FTYPE_FLOAT:
+ case INT64_FTYPE_V4SF:
+ case INT64_FTYPE_V2DF:
+ case INT_FTYPE_V16QI:
+ case INT_FTYPE_V8QI:
+ case INT_FTYPE_V4SF:
+ case INT_FTYPE_V2DF:
+ case V16QI_FTYPE_V16QI:
+ case V8HI_FTYPE_V8HI:
+ case V8HI_FTYPE_V16QI:
+ case V8QI_FTYPE_V8QI:
+ case V4SI_FTYPE_V4SI:
+ case V4SI_FTYPE_V16QI:
+ case V4SI_FTYPE_V4SF:
+ case V4SI_FTYPE_V8HI:
+ case V4SI_FTYPE_V2DF:
+ case V4HI_FTYPE_V4HI:
+ case V4SF_FTYPE_V4SF:
+ case V4SF_FTYPE_V4SI:
+ case V4SF_FTYPE_V2DF:
+ case V2DI_FTYPE_V2DI:
+ case V2DI_FTYPE_V16QI:
+ case V2DI_FTYPE_V8HI:
+ case V2DI_FTYPE_V4SI:
+ case V2DF_FTYPE_V2DF:
+ case V2DF_FTYPE_V4SI:
+ case V2DF_FTYPE_V4SF:
+ case V2DF_FTYPE_V2SI:
+ case V2SI_FTYPE_V2SI:
+ case V2SI_FTYPE_V4SF:
+ case V2SI_FTYPE_V2SF:
+ case V2SI_FTYPE_V2DF:
+ case V2SF_FTYPE_V2SF:
+ case V2SF_FTYPE_V2SI:
+ nargs = 1;
+ break;
+ case V4SF_FTYPE_V4SF_VEC_MERGE:
+ case V2DF_FTYPE_V2DF_VEC_MERGE:
+ return ix86_expand_unop_vec_merge_builtin (icode, exp, target);
+ case FLOAT128_FTYPE_FLOAT128_FLOAT128:
+ case V16QI_FTYPE_V16QI_V16QI:
+ case V16QI_FTYPE_V8HI_V8HI:
+ case V8QI_FTYPE_V8QI_V8QI:
+ case V8QI_FTYPE_V4HI_V4HI:
+ case V8HI_FTYPE_V8HI_V8HI:
+ case V8HI_FTYPE_V16QI_V16QI:
+ case V8HI_FTYPE_V4SI_V4SI:
+ case V4SI_FTYPE_V4SI_V4SI:
+ case V4SI_FTYPE_V8HI_V8HI:
+ case V4SI_FTYPE_V4SF_V4SF:
+ case V4SI_FTYPE_V2DF_V2DF:
+ case V4HI_FTYPE_V4HI_V4HI:
+ case V4HI_FTYPE_V8QI_V8QI:
+ case V4HI_FTYPE_V2SI_V2SI:
+ case V4SF_FTYPE_V4SF_V4SF:
+ case V4SF_FTYPE_V4SF_V2SI:
+ case V4SF_FTYPE_V4SF_V2DF:
+ case V4SF_FTYPE_V4SF_DI:
+ case V4SF_FTYPE_V4SF_SI:
+ case V2DI_FTYPE_V2DI_V2DI:
+ case V2DI_FTYPE_V16QI_V16QI:
+ case V2DI_FTYPE_V4SI_V4SI:
+ case V2DI_FTYPE_V2DI_V16QI:
+ case V2DI_FTYPE_V2DF_V2DF:
+ case V2SI_FTYPE_V2SI_V2SI:
+ case V2SI_FTYPE_V4HI_V4HI:
+ case V2SI_FTYPE_V2SF_V2SF:
+ case V2DF_FTYPE_V2DF_V2DF:
+ case V2DF_FTYPE_V2DF_V4SF:
+ case V2DF_FTYPE_V2DF_DI:
+ case V2DF_FTYPE_V2DF_SI:
+ case V2SF_FTYPE_V2SF_V2SF:
+ case V1DI_FTYPE_V1DI_V1DI:
+ case V1DI_FTYPE_V8QI_V8QI:
+ case V1DI_FTYPE_V2SI_V2SI:
+ if (comparison == UNKNOWN)
+ return ix86_expand_binop_builtin (icode, exp, target);
+ nargs = 2;
+ break;
+ case V4SF_FTYPE_V4SF_V4SF_SWAP:
+ case V2DF_FTYPE_V2DF_V2DF_SWAP:
+ gcc_assert (comparison != UNKNOWN);
+ nargs = 2;
+ swap = true;
+ break;
+ case V8HI_FTYPE_V8HI_V8HI_COUNT:
+ case V8HI_FTYPE_V8HI_SI_COUNT:
+ case V4SI_FTYPE_V4SI_V4SI_COUNT:
+ case V4SI_FTYPE_V4SI_SI_COUNT:
+ case V4HI_FTYPE_V4HI_V4HI_COUNT:
+ case V4HI_FTYPE_V4HI_SI_COUNT:
+ case V2DI_FTYPE_V2DI_V2DI_COUNT:
+ case V2DI_FTYPE_V2DI_SI_COUNT:
+ case V2SI_FTYPE_V2SI_V2SI_COUNT:
+ case V2SI_FTYPE_V2SI_SI_COUNT:
+ case V1DI_FTYPE_V1DI_V1DI_COUNT:
+ case V1DI_FTYPE_V1DI_SI_COUNT:
+ nargs = 2;
+ last_arg_count = true;
+ break;
+ case UINT64_FTYPE_UINT64_UINT64:
+ case UINT_FTYPE_UINT_UINT:
+ case UINT_FTYPE_UINT_USHORT:
+ case UINT_FTYPE_UINT_UCHAR:
+ nargs = 2;
+ break;
+ case V2DI2TI_FTYPE_V2DI_INT:
+ nargs = 2;
+ rmode = V2DImode;
+ nargs_constant = 1;
+ break;
+ case V8HI_FTYPE_V8HI_INT:
+ case V4SI_FTYPE_V4SI_INT:
+ case V4HI_FTYPE_V4HI_INT:
+ case V4SF_FTYPE_V4SF_INT:
+ case V2DI_FTYPE_V2DI_INT:
+ case V2DF_FTYPE_V2DF_INT:
+ nargs = 2;
+ nargs_constant = 1;
+ break;
+ case V16QI_FTYPE_V16QI_V16QI_V16QI:
+ case V4SF_FTYPE_V4SF_V4SF_V4SF:
+ case V2DF_FTYPE_V2DF_V2DF_V2DF:
+ nargs = 3;
+ break;
+ case V16QI_FTYPE_V16QI_V16QI_INT:
+ case V8HI_FTYPE_V8HI_V8HI_INT:
+ case V4SI_FTYPE_V4SI_V4SI_INT:
+ case V4SF_FTYPE_V4SF_V4SF_INT:
+ case V2DI_FTYPE_V2DI_V2DI_INT:
+ case V2DF_FTYPE_V2DF_V2DF_INT:
+ nargs = 3;
+ nargs_constant = 1;
+ break;
+ case V2DI2TI_FTYPE_V2DI_V2DI_INT:
+ nargs = 3;
+ rmode = V2DImode;
+ nargs_constant = 1;
+ break;
+ case V1DI2DI_FTYPE_V1DI_V1DI_INT:
+ nargs = 3;
+ rmode = DImode;
+ nargs_constant = 1;
+ break;
+ case V2DI_FTYPE_V2DI_UINT_UINT:
+ nargs = 3;
+ nargs_constant = 2;
+ break;
+ case V2DI_FTYPE_V2DI_V2DI_UINT_UINT:
+ nargs = 4;
+ nargs_constant = 2;
+ break;
+ default:
+ gcc_unreachable ();
+ }
+
+ gcc_assert (nargs <= ARRAY_SIZE (args));
+
+ if (comparison != UNKNOWN)
+ {
+ gcc_assert (nargs == 2);
+ return ix86_expand_sse_compare (d, exp, target, swap);
+ }
+
+ if (rmode == VOIDmode || rmode == tmode)
+ {
+ if (optimize
+ || target == 0
+ || GET_MODE (target) != tmode
+ || ! (*insn_p->operand[0].predicate) (target, tmode))
+ target = gen_reg_rtx (tmode);
+ real_target = target;
+ }
+ else
+ {
+ target = gen_reg_rtx (rmode);
+ real_target = simplify_gen_subreg (tmode, target, rmode, 0);
+ }
+
+ for (i = 0; i < nargs; i++)
+ {
+ tree arg = CALL_EXPR_ARG (exp, i);
+ rtx op = expand_normal (arg);
+ enum machine_mode mode = insn_p->operand[i + 1].mode;
+ bool match = (*insn_p->operand[i + 1].predicate) (op, mode);
+
+ if (last_arg_count && (i + 1) == nargs)
+ {
+ /* SIMD shift insns take either an 8-bit immediate or
+ register as count. But builtin functions take int as
+ count. If count doesn't match, we put it in register. */
+ if (!match)
+ {
+ op = simplify_gen_subreg (SImode, op, GET_MODE (op), 0);
+ if (!(*insn_p->operand[i + 1].predicate) (op, mode))
+ op = copy_to_reg (op);
+ }
+ }
+ else if ((nargs - i) <= nargs_constant)
+ {
+ if (!match)
+ switch (icode)
+ {
+ case CODE_FOR_sse4_1_roundpd:
+ case CODE_FOR_sse4_1_roundps:
+ case CODE_FOR_sse4_1_roundsd:
+ case CODE_FOR_sse4_1_roundss:
+ case CODE_FOR_sse4_1_blendps:
+ error ("the last argument must be a 4-bit immediate");
+ return const0_rtx;
+
+ case CODE_FOR_sse4_1_blendpd:
+ error ("the last argument must be a 2-bit immediate");
+ return const0_rtx;
+
+ default:
+ switch (nargs_constant)
+ {
+ case 2:
+ if ((nargs - i) == nargs_constant)
+ {
+ error ("the next to last argument must be an 8-bit immediate");
+ break;
+ }
+ case 1:
+ error ("the last argument must be an 8-bit immediate");
+ break;
+ default:
+ gcc_unreachable ();
+ }
+ return const0_rtx;
+ }
+ }
+ else
+ {
+ if (VECTOR_MODE_P (mode))
+ op = safe_vector_operand (op, mode);
+
+ /* If we aren't optimizing, only allow one memory operand to
+ be generated. */
+ if (memory_operand (op, mode))
+ num_memory++;
+
+ if (GET_MODE (op) == mode || GET_MODE (op) == VOIDmode)
+ {
+ if (optimize || !match || num_memory > 1)
+ op = copy_to_mode_reg (mode, op);
+ }
+ else
+ {
+ op = copy_to_reg (op);
+ op = simplify_gen_subreg (mode, op, GET_MODE (op), 0);
+ }
+ }
+
+ args[i].op = op;
+ args[i].mode = mode;
+ }
+
+ switch (nargs)
+ {
+ case 1:
+ pat = GEN_FCN (icode) (real_target, args[0].op);
+ break;
+ case 2:
+ pat = GEN_FCN (icode) (real_target, args[0].op, args[1].op);
+ break;
+ case 3:
+ pat = GEN_FCN (icode) (real_target, args[0].op, args[1].op,
+ args[2].op);
+ break;
+ case 4:
+ pat = GEN_FCN (icode) (real_target, args[0].op, args[1].op,
+ args[2].op, args[3].op);
+ break;
+ default:
+ gcc_unreachable ();
+ }
+
+ if (! pat)
+ return 0;
+
+ emit_insn (pat);
+ return target;
+}
+
+/* Subroutine of ix86_expand_builtin to take care of special insns
+ with variable number of operands. */
+
+static rtx
+ix86_expand_special_args_builtin (const struct builtin_description *d,
+ tree exp, rtx target)
+{
+ tree arg;
+ rtx pat, op;
+ unsigned int i, nargs, arg_adjust, memory;
+ struct
+ {
+ rtx op;
+ enum machine_mode mode;
+ } args[2];
+ enum insn_code icode = d->icode;
+ bool last_arg_constant = false;
+ const struct insn_data *insn_p = &insn_data[icode];
+ enum machine_mode tmode = insn_p->operand[0].mode;
+ enum { load, store } class;
+
+ switch ((enum ix86_special_builtin_type) d->flag)
+ {
+ case VOID_FTYPE_VOID:
+ emit_insn (GEN_FCN (icode) (target));
+ return 0;
+ case V2DI_FTYPE_PV2DI:
+ case V16QI_FTYPE_PCCHAR:
+ case V4SF_FTYPE_PCFLOAT:
+ case V2DF_FTYPE_PCDOUBLE:
+ nargs = 1;
+ class = load;
+ memory = 0;
+ break;
+ case VOID_FTYPE_PV2SF_V4SF:
+ case VOID_FTYPE_PV2DI_V2DI:
+ case VOID_FTYPE_PCHAR_V16QI:
+ case VOID_FTYPE_PFLOAT_V4SF:
+ case VOID_FTYPE_PDOUBLE_V2DF:
+ case VOID_FTYPE_PDI_DI:
+ case VOID_FTYPE_PINT_INT:
+ nargs = 1;
+ class = store;
+ /* Reserve memory operand for target. */
+ memory = ARRAY_SIZE (args);
+ break;
+ case V4SF_FTYPE_V4SF_PCV2SF:
+ case V2DF_FTYPE_V2DF_PCDOUBLE:
+ nargs = 2;
+ class = load;
+ memory = 1;
+ break;
+ default:
+ gcc_unreachable ();
+ }
+
+ gcc_assert (nargs <= ARRAY_SIZE (args));
+
+ if (class == store)
+ {
+ arg = CALL_EXPR_ARG (exp, 0);
+ op = expand_normal (arg);
+ gcc_assert (target == 0);
+ target = gen_rtx_MEM (tmode, copy_to_mode_reg (Pmode, op));
+ arg_adjust = 1;
+ }
+ else
+ {
+ arg_adjust = 0;
+ if (optimize
+ || target == 0
+ || GET_MODE (target) != tmode
+ || ! (*insn_p->operand[0].predicate) (target, tmode))
+ target = gen_reg_rtx (tmode);
+ }
+
+ for (i = 0; i < nargs; i++)
+ {
+ enum machine_mode mode = insn_p->operand[i + 1].mode;
+ bool match;
+
+ arg = CALL_EXPR_ARG (exp, i + arg_adjust);
+ op = expand_normal (arg);
+ match = (*insn_p->operand[i + 1].predicate) (op, mode);
+
+ if (last_arg_constant && (i + 1) == nargs)
+ {
+ if (!match)
+ switch (icode)
+ {
+ default:
+ error ("the last argument must be an 8-bit immediate");
+ return const0_rtx;
+ }
+ }
+ else
+ {
+ if (i == memory)
+ {
+ /* This must be the memory operand. */
+ op = gen_rtx_MEM (mode, copy_to_mode_reg (Pmode, op));
+ gcc_assert (GET_MODE (op) == mode
+ || GET_MODE (op) == VOIDmode);
+ }
+ else
+ {
+ /* This must be register. */
+ if (VECTOR_MODE_P (mode))
+ op = safe_vector_operand (op, mode);
+
+ gcc_assert (GET_MODE (op) == mode
+ || GET_MODE (op) == VOIDmode);
+ op = copy_to_mode_reg (mode, op);
+ }
+ }
+
+ args[i].op = op;
+ args[i].mode = mode;
+ }
+
+ switch (nargs)
+ {
+ case 1:
+ pat = GEN_FCN (icode) (target, args[0].op);
+ break;
+ case 2:
+ pat = GEN_FCN (icode) (target, args[0].op, args[1].op);
+ break;
+ default:
+ gcc_unreachable ();
+ }
+
+ if (! pat)
+ return 0;
+ emit_insn (pat);
+ return class == store ? 0 : target;
+}
+
/* Subroutine of ix86_expand_builtin to take care of comi insns. */
static rtx
@@ -20838,21 +21316,13 @@ ix86_expand_builtin (tree exp, rtx target, rtx subtarget ATTRIBUTE_UNUSED,
size_t i;
enum insn_code icode;
tree fndecl = TREE_OPERAND (CALL_EXPR_FN (exp), 0);
- tree arg0, arg1, arg2, arg3;
- rtx op0, op1, op2, op3, pat;
- enum machine_mode tmode, mode0, mode1, mode2, mode3, mode4;
+ tree arg0, arg1, arg2;
+ rtx op0, op1, op2, pat;
+ enum machine_mode mode0, mode1, mode2;
unsigned int fcode = DECL_FUNCTION_CODE (fndecl);
switch (fcode)
{
- case IX86_BUILTIN_EMMS:
- emit_insn (gen_mmx_emms ());
- return 0;
-
- case IX86_BUILTIN_SFENCE:
- emit_insn (gen_sse_sfence ());
- return 0;
-
case IX86_BUILTIN_MASKMOVQ:
case IX86_BUILTIN_MASKMOVDQU:
icode = (fcode == IX86_BUILTIN_MASKMOVQ
@@ -20884,75 +21354,6 @@ ix86_expand_builtin (tree exp, rtx target, rtx subtarget ATTRIBUTE_UNUSED,
emit_insn (pat);
return 0;
- case IX86_BUILTIN_RSQRTF:
- return ix86_expand_unop1_builtin (CODE_FOR_rsqrtsf2, exp, target);
-
- case IX86_BUILTIN_SQRTSS:
- return ix86_expand_unop1_builtin (CODE_FOR_sse_vmsqrtv4sf2, exp, target);
- case IX86_BUILTIN_RSQRTSS:
- return ix86_expand_unop1_builtin (CODE_FOR_sse_vmrsqrtv4sf2, exp, target);
- case IX86_BUILTIN_RCPSS:
- return ix86_expand_unop1_builtin (CODE_FOR_sse_vmrcpv4sf2, exp, target);
-
- case IX86_BUILTIN_LOADUPS:
- return ix86_expand_unop_builtin (CODE_FOR_sse_movups, exp, target, 1);
-
- case IX86_BUILTIN_STOREUPS:
- return ix86_expand_store_builtin (CODE_FOR_sse_movups, exp);
-
- case IX86_BUILTIN_LOADHPS:
- case IX86_BUILTIN_LOADLPS:
- case IX86_BUILTIN_LOADHPD:
- case IX86_BUILTIN_LOADLPD:
- icode = (fcode == IX86_BUILTIN_LOADHPS ? CODE_FOR_sse_loadhps
- : fcode == IX86_BUILTIN_LOADLPS ? CODE_FOR_sse_loadlps
- : fcode == IX86_BUILTIN_LOADHPD ? CODE_FOR_sse2_loadhpd
- : CODE_FOR_sse2_loadlpd);
- arg0 = CALL_EXPR_ARG (exp, 0);
- arg1 = CALL_EXPR_ARG (exp, 1);
- op0 = expand_normal (arg0);
- op1 = expand_normal (arg1);
- tmode = insn_data[icode].operand[0].mode;
- mode0 = insn_data[icode].operand[1].mode;
- mode1 = insn_data[icode].operand[2].mode;
-
- op0 = force_reg (mode0, op0);
- op1 = gen_rtx_MEM (mode1, copy_to_mode_reg (Pmode, op1));
- if (optimize || target == 0
- || GET_MODE (target) != tmode
- || !register_operand (target, tmode))
- target = gen_reg_rtx (tmode);
- pat = GEN_FCN (icode) (target, op0, op1);
- if (! pat)
- return 0;
- emit_insn (pat);
- return target;
-
- case IX86_BUILTIN_STOREHPS:
- case IX86_BUILTIN_STORELPS:
- icode = (fcode == IX86_BUILTIN_STOREHPS ? CODE_FOR_sse_storehps
- : CODE_FOR_sse_storelps);
- arg0 = CALL_EXPR_ARG (exp, 0);
- arg1 = CALL_EXPR_ARG (exp, 1);
- op0 = expand_normal (arg0);
- op1 = expand_normal (arg1);
- mode0 = insn_data[icode].operand[0].mode;
- mode1 = insn_data[icode].operand[1].mode;
-
- op0 = gen_rtx_MEM (mode0, copy_to_mode_reg (Pmode, op0));
- op1 = force_reg (mode1, op1);
-
- pat = GEN_FCN (icode) (op0, op1);
- if (! pat)
- return 0;
- emit_insn (pat);
- return const0_rtx;
-
- case IX86_BUILTIN_MOVNTPS:
- return ix86_expand_store_builtin (CODE_FOR_sse_movntv4sf, exp);
- case IX86_BUILTIN_MOVNTQ:
- return ix86_expand_store_builtin (CODE_FOR_sse_movntdi, exp);
-
case IX86_BUILTIN_LDMXCSR:
op0 = expand_normal (CALL_EXPR_ARG (exp, 0));
target = assign_386_stack_local (SImode, SLOT_VIRTUAL);
@@ -20965,233 +21366,6 @@ ix86_expand_builtin (tree exp, rtx target, rtx subtarget ATTRIBUTE_UNUSED,
emit_insn (gen_sse_stmxcsr (target));
return copy_to_mode_reg (SImode, target);
- case IX86_BUILTIN_PSHUFW:
- case IX86_BUILTIN_PSHUFD:
- case IX86_BUILTIN_PSHUFHW:
- case IX86_BUILTIN_PSHUFLW:
- icode = ( fcode == IX86_BUILTIN_PSHUFHW ? CODE_FOR_sse2_pshufhw
- : fcode == IX86_BUILTIN_PSHUFLW ? CODE_FOR_sse2_pshuflw
- : fcode == IX86_BUILTIN_PSHUFD ? CODE_FOR_sse2_pshufd
- : CODE_FOR_mmx_pshufw);
- arg0 = CALL_EXPR_ARG (exp, 0);
- arg1 = CALL_EXPR_ARG (exp, 1);
- op0 = expand_normal (arg0);
- op1 = expand_normal (arg1);
- tmode = insn_data[icode].operand[0].mode;
- mode1 = insn_data[icode].operand[1].mode;
- mode2 = insn_data[icode].operand[2].mode;
-
- if (! (*insn_data[icode].operand[1].predicate) (op0, mode1))
- op0 = copy_to_mode_reg (mode1, op0);
- if (! (*insn_data[icode].operand[2].predicate) (op1, mode2))
- {
- /* @@@ better error message */
- error ("mask must be an immediate");
- return const0_rtx;
- }
- if (target == 0
- || GET_MODE (target) != tmode
- || ! (*insn_data[icode].operand[0].predicate) (target, tmode))
- target = gen_reg_rtx (tmode);
- pat = GEN_FCN (icode) (target, op0, op1);
- if (! pat)
- return 0;
- emit_insn (pat);
- return target;
-
- case IX86_BUILTIN_PSLLW:
- case IX86_BUILTIN_PSLLWI:
- icode = CODE_FOR_mmx_ashlv4hi3;
- goto do_pshift;
- case IX86_BUILTIN_PSLLD:
- case IX86_BUILTIN_PSLLDI:
- icode = CODE_FOR_mmx_ashlv2si3;
- goto do_pshift;
- case IX86_BUILTIN_PSLLQ:
- case IX86_BUILTIN_PSLLQI:
- icode = CODE_FOR_mmx_ashlv1di3;
- goto do_pshift;
- case IX86_BUILTIN_PSRAW:
- case IX86_BUILTIN_PSRAWI:
- icode = CODE_FOR_mmx_ashrv4hi3;
- goto do_pshift;
- case IX86_BUILTIN_PSRAD:
- case IX86_BUILTIN_PSRADI:
- icode = CODE_FOR_mmx_ashrv2si3;
- goto do_pshift;
- case IX86_BUILTIN_PSRLW:
- case IX86_BUILTIN_PSRLWI:
- icode = CODE_FOR_mmx_lshrv4hi3;
- goto do_pshift;
- case IX86_BUILTIN_PSRLD:
- case IX86_BUILTIN_PSRLDI:
- icode = CODE_FOR_mmx_lshrv2si3;
- goto do_pshift;
- case IX86_BUILTIN_PSRLQ:
- case IX86_BUILTIN_PSRLQI:
- icode = CODE_FOR_mmx_lshrv1di3;
- goto do_pshift;
-
- case IX86_BUILTIN_PSLLW128:
- case IX86_BUILTIN_PSLLWI128:
- icode = CODE_FOR_ashlv8hi3;
- goto do_pshift;
- case IX86_BUILTIN_PSLLD128:
- case IX86_BUILTIN_PSLLDI128:
- icode = CODE_FOR_ashlv4si3;
- goto do_pshift;
- case IX86_BUILTIN_PSLLQ128:
- case IX86_BUILTIN_PSLLQI128:
- icode = CODE_FOR_ashlv2di3;
- goto do_pshift;
- case IX86_BUILTIN_PSRAW128:
- case IX86_BUILTIN_PSRAWI128:
- icode = CODE_FOR_ashrv8hi3;
- goto do_pshift;
- case IX86_BUILTIN_PSRAD128:
- case IX86_BUILTIN_PSRADI128:
- icode = CODE_FOR_ashrv4si3;
- goto do_pshift;
- case IX86_BUILTIN_PSRLW128:
- case IX86_BUILTIN_PSRLWI128:
- icode = CODE_FOR_lshrv8hi3;
- goto do_pshift;
- case IX86_BUILTIN_PSRLD128:
- case IX86_BUILTIN_PSRLDI128:
- icode = CODE_FOR_lshrv4si3;
- goto do_pshift;
- case IX86_BUILTIN_PSRLQ128:
- case IX86_BUILTIN_PSRLQI128:
- icode = CODE_FOR_lshrv2di3;
-
- do_pshift:
- arg0 = CALL_EXPR_ARG (exp, 0);
- arg1 = CALL_EXPR_ARG (exp, 1);
- op0 = expand_normal (arg0);
- op1 = expand_normal (arg1);
-
- tmode = insn_data[icode].operand[0].mode;
- mode1 = insn_data[icode].operand[1].mode;
-
- if (! (*insn_data[icode].operand[1].predicate) (op0, mode1))
- op0 = copy_to_reg (op0);
-
- if (!CONST_INT_P (op1))
- op1 = simplify_gen_subreg (SImode, op1, GET_MODE (op1), 0);
-
- if (! (*insn_data[icode].operand[2].predicate) (op1, SImode))
- op1 = copy_to_reg (op1);
-
- target = gen_reg_rtx (tmode);
- pat = GEN_FCN (icode) (target, op0, op1);
- if (!pat)
- return 0;
- emit_insn (pat);
- return target;
-
- case IX86_BUILTIN_PSLLDQI128:
- return ix86_expand_binop_imm_builtin (CODE_FOR_sse2_ashlti3,
- exp, target);
- break;
-
- case IX86_BUILTIN_PSRLDQI128:
- return ix86_expand_binop_imm_builtin (CODE_FOR_sse2_lshrti3,
- exp, target);
- break;
-
- case IX86_BUILTIN_FEMMS:
- emit_insn (gen_mmx_femms ());
- return NULL_RTX;
-
- case IX86_BUILTIN_PAVGUSB:
- return ix86_expand_binop_builtin (CODE_FOR_mmx_uavgv8qi3, exp, target);
-
- case IX86_BUILTIN_PF2ID:
- return ix86_expand_unop_builtin (CODE_FOR_mmx_pf2id, exp, target, 0);
-
- case IX86_BUILTIN_PFACC:
- return ix86_expand_binop_builtin (CODE_FOR_mmx_haddv2sf3, exp, target);
-
- case IX86_BUILTIN_PFADD:
- return ix86_expand_binop_builtin (CODE_FOR_mmx_addv2sf3, exp, target);
-
- case IX86_BUILTIN_PFCMPEQ:
- return ix86_expand_binop_builtin (CODE_FOR_mmx_eqv2sf3, exp, target);
-
- case IX86_BUILTIN_PFCMPGE:
- return ix86_expand_binop_builtin (CODE_FOR_mmx_gev2sf3, exp, target);
-
- case IX86_BUILTIN_PFCMPGT:
- return ix86_expand_binop_builtin (CODE_FOR_mmx_gtv2sf3, exp, target);
-
- case IX86_BUILTIN_PFMAX:
- return ix86_expand_binop_builtin (CODE_FOR_mmx_smaxv2sf3, exp, target);
-
- case IX86_BUILTIN_PFMIN:
- return ix86_expand_binop_builtin (CODE_FOR_mmx_sminv2sf3, exp, target);
-
- case IX86_BUILTIN_PFMUL:
- return ix86_expand_binop_builtin (CODE_FOR_mmx_mulv2sf3, exp, target);
-
- case IX86_BUILTIN_PFRCP:
- return ix86_expand_unop_builtin (CODE_FOR_mmx_rcpv2sf2, exp, target, 0);
-
- case IX86_BUILTIN_PFRCPIT1:
- return ix86_expand_binop_builtin (CODE_FOR_mmx_rcpit1v2sf3, exp, target);
-
- case IX86_BUILTIN_PFRCPIT2:
- return ix86_expand_binop_builtin (CODE_FOR_mmx_rcpit2v2sf3, exp, target);
-
- case IX86_BUILTIN_PFRSQIT1:
- return ix86_expand_binop_builtin (CODE_FOR_mmx_rsqit1v2sf3, exp, target);
-
- case IX86_BUILTIN_PFRSQRT:
- return ix86_expand_unop_builtin (CODE_FOR_mmx_rsqrtv2sf2, exp, target, 0);
-
- case IX86_BUILTIN_PFSUB:
- return ix86_expand_binop_builtin (CODE_FOR_mmx_subv2sf3, exp, target);
-
- case IX86_BUILTIN_PFSUBR:
- return ix86_expand_binop_builtin (CODE_FOR_mmx_subrv2sf3, exp, target);
-
- case IX86_BUILTIN_PI2FD:
- return ix86_expand_unop_builtin (CODE_FOR_mmx_floatv2si2, exp, target, 0);
-
- case IX86_BUILTIN_PMULHRW:
- return ix86_expand_binop_builtin (CODE_FOR_mmx_pmulhrwv4hi3, exp, target);
-
- case IX86_BUILTIN_PF2IW:
- return ix86_expand_unop_builtin (CODE_FOR_mmx_pf2iw, exp, target, 0);
-
- case IX86_BUILTIN_PFNACC:
- return ix86_expand_binop_builtin (CODE_FOR_mmx_hsubv2sf3, exp, target);
-
- case IX86_BUILTIN_PFPNACC:
- return ix86_expand_binop_builtin (CODE_FOR_mmx_addsubv2sf3, exp, target);
-
- case IX86_BUILTIN_PI2FW:
- return ix86_expand_unop_builtin (CODE_FOR_mmx_pi2fw, exp, target, 0);
-
- case IX86_BUILTIN_PSWAPDSI:
- return ix86_expand_unop_builtin (CODE_FOR_mmx_pswapdv2si2, exp, target, 0);
-
- case IX86_BUILTIN_PSWAPDSF:
- return ix86_expand_unop_builtin (CODE_FOR_mmx_pswapdv2sf2, exp, target, 0);
-
- case IX86_BUILTIN_SQRTSD:
- return ix86_expand_unop1_builtin (CODE_FOR_sse2_vmsqrtv2df2, exp, target);
- case IX86_BUILTIN_LOADUPD:
- return ix86_expand_unop_builtin (CODE_FOR_sse2_movupd, exp, target, 1);
- case IX86_BUILTIN_STOREUPD:
- return ix86_expand_store_builtin (CODE_FOR_sse2_movupd, exp);
-
- case IX86_BUILTIN_MFENCE:
- emit_insn (gen_sse2_mfence ());
- return 0;
- case IX86_BUILTIN_LFENCE:
- emit_insn (gen_sse2_lfence ());
- return 0;
-
case IX86_BUILTIN_CLFLUSH:
arg0 = CALL_EXPR_ARG (exp, 0);
op0 = expand_normal (arg0);
@@ -21202,18 +21376,6 @@ ix86_expand_builtin (tree exp, rtx target, rtx subtarget ATTRIBUTE_UNUSED,
emit_insn (gen_sse2_clflush (op0));
return 0;
- case IX86_BUILTIN_MOVNTPD:
- return ix86_expand_store_builtin (CODE_FOR_sse2_movntv2df, exp);
- case IX86_BUILTIN_MOVNTDQ:
- return ix86_expand_store_builtin (CODE_FOR_sse2_movntv2di, exp);
- case IX86_BUILTIN_MOVNTI:
- return ix86_expand_store_builtin (CODE_FOR_sse2_movntsi, exp);
-
- case IX86_BUILTIN_LOADDQU:
- return ix86_expand_unop_builtin (CODE_FOR_sse2_movdqu, exp, target, 1);
- case IX86_BUILTIN_STOREDQU:
- return ix86_expand_store_builtin (CODE_FOR_sse2_movdqu, exp);
-
case IX86_BUILTIN_MONITOR:
arg0 = CALL_EXPR_ARG (exp, 0);
arg1 = CALL_EXPR_ARG (exp, 1);
@@ -21245,168 +21407,6 @@ ix86_expand_builtin (tree exp, rtx target, rtx subtarget ATTRIBUTE_UNUSED,
emit_insn (gen_sse3_mwait (op0, op1));
return 0;
- case IX86_BUILTIN_LDDQU:
- return ix86_expand_unop_builtin (CODE_FOR_sse3_lddqu, exp,
- target, 1);
-
- case IX86_BUILTIN_PALIGNR:
- case IX86_BUILTIN_PALIGNR128:
- if (fcode == IX86_BUILTIN_PALIGNR)
- {
- icode = CODE_FOR_ssse3_palignrdi;
- mode = DImode;
- }
- else
- {
- icode = CODE_FOR_ssse3_palignrti;
- mode = V2DImode;
- }
- arg0 = CALL_EXPR_ARG (exp, 0);
- arg1 = CALL_EXPR_ARG (exp, 1);
- arg2 = CALL_EXPR_ARG (exp, 2);
- op0 = expand_expr (arg0, NULL_RTX, VOIDmode, EXPAND_NORMAL);
- op1 = expand_expr (arg1, NULL_RTX, VOIDmode, EXPAND_NORMAL);
- op2 = expand_expr (arg2, NULL_RTX, VOIDmode, EXPAND_NORMAL);
- tmode = insn_data[icode].operand[0].mode;
- mode1 = insn_data[icode].operand[1].mode;
- mode2 = insn_data[icode].operand[2].mode;
- mode3 = insn_data[icode].operand[3].mode;
-
- if (! (*insn_data[icode].operand[1].predicate) (op0, mode1))
- {
- op0 = copy_to_reg (op0);
- op0 = simplify_gen_subreg (mode1, op0, GET_MODE (op0), 0);
- }
- if (! (*insn_data[icode].operand[2].predicate) (op1, mode2))
- {
- op1 = copy_to_reg (op1);
- op1 = simplify_gen_subreg (mode2, op1, GET_MODE (op1), 0);
- }
- if (! (*insn_data[icode].operand[3].predicate) (op2, mode3))
- {
- error ("shift must be an immediate");
- return const0_rtx;
- }
- target = gen_reg_rtx (mode);
- pat = GEN_FCN (icode) (simplify_gen_subreg (tmode, target, mode, 0),
- op0, op1, op2);
- if (! pat)
- return 0;
- emit_insn (pat);
- return target;
-
- case IX86_BUILTIN_MOVNTDQA:
- return ix86_expand_unop_builtin (CODE_FOR_sse4_1_movntdqa, exp,
- target, 1);
-
- case IX86_BUILTIN_MOVNTSD:
- return ix86_expand_store_builtin (CODE_FOR_sse4a_vmmovntv2df, exp);
-
- case IX86_BUILTIN_MOVNTSS:
- return ix86_expand_store_builtin (CODE_FOR_sse4a_vmmovntv4sf, exp);
-
- case IX86_BUILTIN_INSERTQ:
- case IX86_BUILTIN_EXTRQ:
- icode = (fcode == IX86_BUILTIN_EXTRQ
- ? CODE_FOR_sse4a_extrq
- : CODE_FOR_sse4a_insertq);
- arg0 = CALL_EXPR_ARG (exp, 0);
- arg1 = CALL_EXPR_ARG (exp, 1);
- op0 = expand_normal (arg0);
- op1 = expand_normal (arg1);
- tmode = insn_data[icode].operand[0].mode;
- mode1 = insn_data[icode].operand[1].mode;
- mode2 = insn_data[icode].operand[2].mode;
- if (! (*insn_data[icode].operand[1].predicate) (op0, mode1))
- op0 = copy_to_mode_reg (mode1, op0);
- if (! (*insn_data[icode].operand[2].predicate) (op1, mode2))
- op1 = copy_to_mode_reg (mode2, op1);
- if (optimize || target == 0
- || GET_MODE (target) != tmode
- || ! (*insn_data[icode].operand[0].predicate) (target, tmode))
- target = gen_reg_rtx (tmode);
- pat = GEN_FCN (icode) (target, op0, op1);
- if (! pat)
- return NULL_RTX;
- emit_insn (pat);
- return target;
-
- case IX86_BUILTIN_EXTRQI:
- icode = CODE_FOR_sse4a_extrqi;
- arg0 = CALL_EXPR_ARG (exp, 0);
- arg1 = CALL_EXPR_ARG (exp, 1);
- arg2 = CALL_EXPR_ARG (exp, 2);
- op0 = expand_normal (arg0);
- op1 = expand_normal (arg1);
- op2 = expand_normal (arg2);
- tmode = insn_data[icode].operand[0].mode;
- mode1 = insn_data[icode].operand[1].mode;
- mode2 = insn_data[icode].operand[2].mode;
- mode3 = insn_data[icode].operand[3].mode;
- if (! (*insn_data[icode].operand[1].predicate) (op0, mode1))
- op0 = copy_to_mode_reg (mode1, op0);
- if (! (*insn_data[icode].operand[2].predicate) (op1, mode2))
- {
- error ("index mask must be an immediate");
- return gen_reg_rtx (tmode);
- }
- if (! (*insn_data[icode].operand[3].predicate) (op2, mode3))
- {
- error ("length mask must be an immediate");
- return gen_reg_rtx (tmode);
- }
- if (optimize || target == 0
- || GET_MODE (target) != tmode
- || ! (*insn_data[icode].operand[0].predicate) (target, tmode))
- target = gen_reg_rtx (tmode);
- pat = GEN_FCN (icode) (target, op0, op1, op2);
- if (! pat)
- return NULL_RTX;
- emit_insn (pat);
- return target;
-
- case IX86_BUILTIN_INSERTQI:
- icode = CODE_FOR_sse4a_insertqi;
- arg0 = CALL_EXPR_ARG (exp, 0);
- arg1 = CALL_EXPR_ARG (exp, 1);
- arg2 = CALL_EXPR_ARG (exp, 2);
- arg3 = CALL_EXPR_ARG (exp, 3);
- op0 = expand_normal (arg0);
- op1 = expand_normal (arg1);
- op2 = expand_normal (arg2);
- op3 = expand_normal (arg3);
- tmode = insn_data[icode].operand[0].mode;
- mode1 = insn_data[icode].operand[1].mode;
- mode2 = insn_data[icode].operand[2].mode;
- mode3 = insn_data[icode].operand[3].mode;
- mode4 = insn_data[icode].operand[4].mode;
-
- if (! (*insn_data[icode].operand[1].predicate) (op0, mode1))
- op0 = copy_to_mode_reg (mode1, op0);
-
- if (! (*insn_data[icode].operand[2].predicate) (op1, mode2))
- op1 = copy_to_mode_reg (mode2, op1);
-
- if (! (*insn_data[icode].operand[3].predicate) (op2, mode3))
- {
- error ("index mask must be an immediate");
- return gen_reg_rtx (tmode);
- }
- if (! (*insn_data[icode].operand[4].predicate) (op3, mode4))
- {
- error ("length mask must be an immediate");
- return gen_reg_rtx (tmode);
- }
- if (optimize || target == 0
- || GET_MODE (target) != tmode
- || ! (*insn_data[icode].operand[0].predicate) (target, tmode))
- target = gen_reg_rtx (tmode);
- pat = GEN_FCN (icode) (target, op0, op1, op2, op3);
- if (! pat)
- return NULL_RTX;
- emit_insn (pat);
- return target;
-
case IX86_BUILTIN_VEC_INIT_V2SI:
case IX86_BUILTIN_VEC_INIT_V4HI:
case IX86_BUILTIN_VEC_INIT_V8QI:
@@ -21447,42 +21447,21 @@ ix86_expand_builtin (tree exp, rtx target, rtx subtarget ATTRIBUTE_UNUSED,
return target;
}
- case IX86_BUILTIN_FABSQ:
- return ix86_expand_unop_builtin (CODE_FOR_abstf2, exp, target, 0);
-
- case IX86_BUILTIN_COPYSIGNQ:
- return ix86_expand_binop_builtin (CODE_FOR_copysigntf3, exp, target);
-
default:
break;
}
- for (i = 0, d = bdesc_sse_args;
- i < ARRAY_SIZE (bdesc_sse_args);
+ for (i = 0, d = bdesc_special_args;
+ i < ARRAY_SIZE (bdesc_special_args);
i++, d++)
if (d->code == fcode)
- {
- enum sse_builtin_type type = (enum sse_builtin_type) d->flag;
- return ix86_expand_sse_operands_builtin (d->icode, exp,
- type, target);
- }
-
- for (i = 0, d = bdesc_2arg; i < ARRAY_SIZE (bdesc_2arg); i++, d++)
- if (d->code == fcode)
- {
- /* Compares are treated specially. */
- if (d->icode == CODE_FOR_sse_maskcmpv4sf3
- || d->icode == CODE_FOR_sse_vmmaskcmpv4sf3
- || d->icode == CODE_FOR_sse2_maskcmpv2df3
- || d->icode == CODE_FOR_sse2_vmmaskcmpv2df3)
- return ix86_expand_sse_compare (d, exp, target);
-
- return ix86_expand_binop_builtin (d->icode, exp, target);
- }
+ return ix86_expand_special_args_builtin (d, exp, target);
- for (i = 0, d = bdesc_1arg; i < ARRAY_SIZE (bdesc_1arg); i++, d++)
+ for (i = 0, d = bdesc_args;
+ i < ARRAY_SIZE (bdesc_args);
+ i++, d++)
if (d->code == fcode)
- return ix86_expand_unop_builtin (d->icode, exp, target, 0);
+ return ix86_expand_args_builtin (d, exp, target);
for (i = 0, d = bdesc_comi; i < ARRAY_SIZE (bdesc_comi); i++, d++)
if (d->code == fcode)
@@ -21492,10 +21471,6 @@ ix86_expand_builtin (tree exp, rtx target, rtx subtarget ATTRIBUTE_UNUSED,
if (d->code == fcode)
return ix86_expand_sse_ptest (d, exp, target);
- for (i = 0, d = bdesc_crc32; i < ARRAY_SIZE (bdesc_crc32); i++, d++)
- if (d->code == fcode)
- return ix86_expand_crc32 (d->icode, exp, target);
-
for (i = 0, d = bdesc_pcmpestr;
i < ARRAY_SIZE (bdesc_pcmpestr);
i++, d++)
@@ -23067,7 +23042,10 @@ x86_output_mi_thunk (FILE *file ATTRIBUTE_UNUSED,
/* Put the this parameter into %eax. */
xops[0] = this_param;
xops[1] = this_reg = gen_rtx_REG (Pmode, AX_REG);
- output_asm_insn ("mov{l}\t{%0, %1|%1, %0}", xops);
+ if (TARGET_64BIT)
+ output_asm_insn ("mov{q}\t{%0, %1|%1, %0}", xops);
+ else
+ output_asm_insn ("mov{l}\t{%0, %1|%1, %0}", xops);
}
else
this_reg = NULL_RTX;
@@ -23136,7 +23114,10 @@ x86_output_mi_thunk (FILE *file ATTRIBUTE_UNUSED,
{
xops[0] = this_reg;
xops[1] = this_param;
- output_asm_insn ("mov{l}\t{%0, %1|%1, %0}", xops);
+ if (TARGET_64BIT)
+ output_asm_insn ("mov{q}\t{%0, %1|%1, %0}", xops);
+ else
+ output_asm_insn ("mov{l}\t{%0, %1|%1, %0}", xops);
}
xops[0] = XEXP (DECL_RTL (function), 0);
diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
index 102f7f7e96d..b5e9082ceec 100644
--- a/gcc/config/i386/i386.md
+++ b/gcc/config/i386/i386.md
@@ -535,11 +535,21 @@
(define_code_iterator plusminus [plus minus])
-;; Base name for define_insn and insn mnemonic.
-(define_code_attr addsub [(plus "add") (minus "sub")])
+(define_code_iterator sat_plusminus [ss_plus us_plus ss_minus us_minus])
+
+;; Base name for define_insn
+(define_code_attr plusminus_insn
+ [(plus "add") (ss_plus "ssadd") (us_plus "usadd")
+ (minus "sub") (ss_minus "sssub") (us_minus "ussub")])
+
+;; Base name for insn mnemonic.
+(define_code_attr plusminus_mnemonic
+ [(plus "add") (ss_plus "adds") (us_plus "addus")
+ (minus "sub") (ss_minus "subs") (us_minus "subus")])
;; Mark commutative operators as such in constraints.
-(define_code_attr comm [(plus "%") (minus "")])
+(define_code_attr comm [(plus "%") (ss_plus "%") (us_plus "%")
+ (minus "") (ss_minus "") (us_minus "")])
;; Mapping of signed max and min
(define_code_iterator smaxmin [smax smin])
@@ -4206,23 +4216,22 @@
"")
(define_insn "*truncdfsf_fast_mixed"
- [(set (match_operand:SF 0 "nonimmediate_operand" "=m,f,x")
+ [(set (match_operand:SF 0 "nonimmediate_operand" "=fm,x")
(float_truncate:SF
- (match_operand:DF 1 "nonimmediate_operand" "f ,f,xm")))]
+ (match_operand:DF 1 "nonimmediate_operand" "f ,xm")))]
"TARGET_SSE2 && TARGET_MIX_SSE_I387 && flag_unsafe_math_optimizations"
{
switch (which_alternative)
{
case 0:
- case 1:
return output_387_reg_move (insn, operands);
- case 2:
+ case 1:
return "cvtsd2ss\t{%1, %0|%0, %1}";
default:
gcc_unreachable ();
}
}
- [(set_attr "type" "fmov,fmov,ssecvt")
+ [(set_attr "type" "fmov,ssecvt")
(set_attr "mode" "SF")])
;; Yes, this one doesn't depend on flag_unsafe_math_optimizations,
@@ -4640,7 +4649,7 @@
(define_insn "fix_trunc<mode>_i387_fisttp_with_temp"
[(set (match_operand:X87MODEI 0 "nonimmediate_operand" "=m,?r")
(fix:X87MODEI (match_operand 1 "register_operand" "f,f")))
- (clobber (match_operand:X87MODEI 2 "memory_operand" "=m,m"))
+ (clobber (match_operand:X87MODEI 2 "memory_operand" "=X,m"))
(clobber (match_scratch:XF 3 "=&1f,&1f"))]
"X87_FLOAT_MODE_P (GET_MODE (operands[1]))
&& TARGET_FISTTP
@@ -4729,7 +4738,7 @@
(fix:DI (match_operand 1 "register_operand" "f,f")))
(use (match_operand:HI 2 "memory_operand" "m,m"))
(use (match_operand:HI 3 "memory_operand" "m,m"))
- (clobber (match_operand:DI 4 "memory_operand" "=m,m"))
+ (clobber (match_operand:DI 4 "memory_operand" "=X,m"))
(clobber (match_scratch:XF 5 "=&1f,&1f"))]
"X87_FLOAT_MODE_P (GET_MODE (operands[1]))
&& !TARGET_FISTTP
@@ -4786,7 +4795,7 @@
(fix:X87MODEI12 (match_operand 1 "register_operand" "f,f")))
(use (match_operand:HI 2 "memory_operand" "m,m"))
(use (match_operand:HI 3 "memory_operand" "m,m"))
- (clobber (match_operand:X87MODEI12 4 "memory_operand" "=m,m"))]
+ (clobber (match_operand:X87MODEI12 4 "memory_operand" "=X,m"))]
"X87_FLOAT_MODE_P (GET_MODE (operands[1]))
&& !TARGET_FISTTP
&& !SSE_FLOAT_MODE_P (GET_MODE (operands[1]))"
@@ -4963,7 +4972,7 @@
[(set (match_operand:MODEF 0 "register_operand" "=f,f,x,x,x")
(float:MODEF
(match_operand:SI 1 "nonimmediate_operand" "m,?r,r,m,!x")))
- (clobber (match_operand:SI 2 "memory_operand" "=m,m,m,m,m"))]
+ (clobber (match_operand:SI 2 "memory_operand" "=X,m,m,X,m"))]
"TARGET_SSE2 && TARGET_MIX_SSE_I387
&& TARGET_USE_VECTOR_CONVERTS && !optimize_size"
"#"
@@ -4993,7 +5002,7 @@
[(set (match_operand:MODEF 0 "register_operand" "=f,f,x,x")
(float:MODEF
(match_operand:SSEMODEI24 1 "nonimmediate_operand" "m,?r,r,m")))
- (clobber (match_operand:SSEMODEI24 2 "memory_operand" "=m,m,m,m"))]
+ (clobber (match_operand:SSEMODEI24 2 "memory_operand" "=X,m,m,X"))]
"(<SSEMODEI24:MODE>mode != DImode || TARGET_64BIT)
&& SSE_FLOAT_MODE_P (<MODEF:MODE>mode) && TARGET_MIX_SSE_I387"
"#"
@@ -5036,7 +5045,7 @@
(define_insn "*float<SSEMODEI24:mode><MODEF:mode>2_mixed_interunit"
[(set (match_operand:MODEF 0 "register_operand" "=f,x,x")
(float:MODEF
- (match_operand:SSEMODEI24 1 "register_operand" "m,r,m")))]
+ (match_operand:SSEMODEI24 1 "nonimmediate_operand" "m,r,m")))]
"(<SSEMODEI24:MODE>mode != DImode || TARGET_64BIT)
&& SSE_FLOAT_MODE_P (<MODEF:MODE>mode) && TARGET_MIX_SSE_I387
&& (TARGET_INTER_UNIT_CONVERSIONS || optimize_size)"
@@ -5071,7 +5080,7 @@
[(set (match_operand:MODEF 0 "register_operand" "=x,x,x")
(float:MODEF
(match_operand:SI 1 "nonimmediate_operand" "r,m,!x")))
- (clobber (match_operand:SI 2 "memory_operand" "=m,m,m"))]
+ (clobber (match_operand:SI 2 "memory_operand" "=m,X,m"))]
"TARGET_SSE2 && TARGET_SSE_MATH
&& TARGET_USE_VECTOR_CONVERTS && !optimize_size"
"#"
@@ -5215,7 +5224,7 @@
[(set (match_operand:MODEF 0 "register_operand" "=x,x")
(float:MODEF
(match_operand:SSEMODEI24 1 "nonimmediate_operand" "r,m")))
- (clobber (match_operand:SSEMODEI24 2 "memory_operand" "=m,m"))]
+ (clobber (match_operand:SSEMODEI24 2 "memory_operand" "=m,X"))]
"(<SSEMODEI24:MODE>mode != DImode || TARGET_64BIT)
&& SSE_FLOAT_MODE_P (<MODEF:MODE>mode) && TARGET_SSE_MATH"
"#"
@@ -5232,9 +5241,7 @@
"(<SSEMODEI24:MODE>mode != DImode || TARGET_64BIT)
&& SSE_FLOAT_MODE_P (<MODEF:MODE>mode) && TARGET_SSE_MATH
&& (TARGET_INTER_UNIT_CONVERSIONS || optimize_size)"
- "@
- cvtsi2s<MODEF:ssemodefsuffix><SSEMODEI24:rex64suffix>\t{%1, %0|%0, %1}
- cvtsi2s<MODEF:ssemodefsuffix><SSEMODEI24:rex64suffix>\t{%1, %0|%0, %1}"
+ "cvtsi2s<MODEF:ssemodefsuffix><SSEMODEI24:rex64suffix>\t{%1, %0|%0, %1}"
[(set_attr "type" "sseicvt")
(set_attr "mode" "<MODEF:MODE>")
(set_attr "athlon_decode" "double,direct")
@@ -5301,7 +5308,7 @@
[(set (match_operand:X87MODEF 0 "register_operand" "=f,f")
(float:X87MODEF
(match_operand:SSEMODEI24 1 "nonimmediate_operand" "m,?r")))
- (clobber (match_operand:SSEMODEI24 2 "memory_operand" "=m,m"))]
+ (clobber (match_operand:SSEMODEI24 2 "memory_operand" "=X,m"))]
"TARGET_80387"
"@
fild%z1\t%1
@@ -5349,9 +5356,9 @@
[(set (match_operand:X87MODEF 0 "register_operand" "=f,f")
(float:X87MODEF
(match_operand:DI 1 "nonimmediate_operand" "m,?r")))
- (clobber (match_scratch:V4SI 3 "=&x,x"))
- (clobber (match_scratch:V4SI 4 "=&x,x"))
- (clobber (match_operand:DI 2 "memory_operand" "=m,m"))]
+ (clobber (match_scratch:V4SI 3 "=X,x"))
+ (clobber (match_scratch:V4SI 4 "=X,x"))
+ (clobber (match_operand:DI 2 "memory_operand" "=X,m"))]
"TARGET_80387 && TARGET_SSE2 && TARGET_INTER_UNIT_MOVES
&& !TARGET_64BIT && !optimize_size"
"#"
@@ -5363,8 +5370,8 @@
(define_split
[(set (match_operand:X87MODEF 0 "register_operand" "")
(float:X87MODEF (match_operand:DI 1 "register_operand" "")))
- (clobber (match_operand:V4SI 3 "register_operand" ""))
- (clobber (match_operand:V4SI 4 "register_operand" ""))
+ (clobber (match_scratch:V4SI 3 ""))
+ (clobber (match_scratch:V4SI 4 ""))
(clobber (match_operand:DI 2 "memory_operand" ""))]
"TARGET_80387 && TARGET_SSE2 && TARGET_INTER_UNIT_MOVES
&& !TARGET_64BIT && !optimize_size
@@ -5387,9 +5394,9 @@
(define_split
[(set (match_operand:X87MODEF 0 "register_operand" "")
(float:X87MODEF (match_operand:DI 1 "memory_operand" "")))
- (clobber (match_operand:V4SI 2 "register_operand" ""))
- (clobber (match_operand:V4SI 3 "register_operand" ""))
- (clobber (match_operand:DI 4 "memory_operand" ""))]
+ (clobber (match_scratch:V4SI 3 ""))
+ (clobber (match_scratch:V4SI 4 ""))
+ (clobber (match_operand:DI 2 "memory_operand" ""))]
"TARGET_80387 && TARGET_SSE2 && TARGET_INTER_UNIT_MOVES
&& !TARGET_64BIT && !optimize_size
&& reload_completed
@@ -5585,7 +5592,7 @@
[(set_attr "type" "alu")
(set_attr "mode" "DI")])
-(define_insn "*<addsub><mode>3_cc_overflow"
+(define_insn "*<plusminus_insn><mode>3_cc_overflow"
[(set (reg:CCC FLAGS_REG)
(compare:CCC
(plusminus:SWI
@@ -5595,7 +5602,7 @@
(set (match_operand:SWI 0 "nonimmediate_operand" "=<r>m,<r>")
(plusminus:SWI (match_dup 1) (match_dup 2)))]
"ix86_binary_operator_ok (<CODE>, <MODE>mode, operands)"
- "<addsub>{<imodesuffix>}\t{%2, %0|%0, %2}"
+ "<plusminus_mnemonic>{<imodesuffix>}\t{%2, %0|%0, %2}"
[(set_attr "type" "alu")
(set_attr "mode" "<MODE>")])
@@ -5622,7 +5629,7 @@
[(set_attr "type" "icmp")
(set_attr "mode" "<MODE>")])
-(define_insn "*<addsub>si3_zext_cc_overflow"
+(define_insn "*<plusminus_insn>si3_zext_cc_overflow"
[(set (reg:CCC FLAGS_REG)
(compare:CCC
(plusminus:SI (match_operand:SI 1 "nonimmediate_operand" "<comm>0")
@@ -5631,7 +5638,7 @@
(set (match_operand:DI 0 "register_operand" "=r")
(zero_extend:DI (plusminus:SI (match_dup 1) (match_dup 2))))]
"TARGET_64BIT && ix86_binary_operator_ok (<CODE>, SImode, operands)"
- "<addsub>{l}\t{%2, %k0|%k0, %2}"
+ "<plusminus_mnemonic>{l}\t{%2, %k0|%k0, %2}"
[(set_attr "type" "alu")
(set_attr "mode" "SI")])
@@ -9740,11 +9747,9 @@
(clobber (reg:CC FLAGS_REG))]
"TARGET_64BIT
&& ix86_binary_operator_ok (XOR, DImode, operands)"
- "@
- xor{q}\t{%2, %0|%0, %2}
- xor{q}\t{%2, %0|%0, %2}"
+ "xor{q}\t{%2, %0|%0, %2}"
[(set_attr "type" "alu")
- (set_attr "mode" "DI,DI")])
+ (set_attr "mode" "DI")])
(define_insn "*xordi_2_rex64"
[(set (reg FLAGS_REG)
@@ -9756,11 +9761,9 @@
"TARGET_64BIT
&& ix86_match_ccmode (insn, CCNOmode)
&& ix86_binary_operator_ok (XOR, DImode, operands)"
- "@
- xor{q}\t{%2, %0|%0, %2}
- xor{q}\t{%2, %0|%0, %2}"
+ "xor{q}\t{%2, %0|%0, %2}"
[(set_attr "type" "alu")
- (set_attr "mode" "DI,DI")])
+ (set_attr "mode" "DI")])
(define_insn "*xordi_3_rex64"
[(set (reg FLAGS_REG)
@@ -17530,7 +17533,7 @@
[(set (match_operand:DI 0 "nonimmediate_operand" "=m,?r")
(unspec:DI [(match_operand:XF 1 "register_operand" "f,f")]
UNSPEC_FIST))
- (clobber (match_operand:DI 2 "memory_operand" "=m,m"))
+ (clobber (match_operand:DI 2 "memory_operand" "=X,m"))
(clobber (match_scratch:XF 3 "=&1f,&1f"))]
"TARGET_USE_FANCY_MATH_387"
"#"
@@ -17780,7 +17783,7 @@
UNSPEC_FIST_FLOOR))
(use (match_operand:HI 2 "memory_operand" "m,m"))
(use (match_operand:HI 3 "memory_operand" "m,m"))
- (clobber (match_operand:DI 4 "memory_operand" "=m,m"))
+ (clobber (match_operand:DI 4 "memory_operand" "=X,m"))
(clobber (match_scratch:XF 5 "=&1f,&1f"))]
"TARGET_USE_FANCY_MATH_387
&& flag_unsafe_math_optimizations"
@@ -17839,7 +17842,7 @@
UNSPEC_FIST_FLOOR))
(use (match_operand:HI 2 "memory_operand" "m,m"))
(use (match_operand:HI 3 "memory_operand" "m,m"))
- (clobber (match_operand:X87MODEI12 4 "memory_operand" "=m,m"))]
+ (clobber (match_operand:X87MODEI12 4 "memory_operand" "=X,m"))]
"TARGET_USE_FANCY_MATH_387
&& flag_unsafe_math_optimizations"
"#"
@@ -18045,7 +18048,7 @@
UNSPEC_FIST_CEIL))
(use (match_operand:HI 2 "memory_operand" "m,m"))
(use (match_operand:HI 3 "memory_operand" "m,m"))
- (clobber (match_operand:DI 4 "memory_operand" "=m,m"))
+ (clobber (match_operand:DI 4 "memory_operand" "=X,m"))
(clobber (match_scratch:XF 5 "=&1f,&1f"))]
"TARGET_USE_FANCY_MATH_387
&& flag_unsafe_math_optimizations"
@@ -18104,7 +18107,7 @@
UNSPEC_FIST_CEIL))
(use (match_operand:HI 2 "memory_operand" "m,m"))
(use (match_operand:HI 3 "memory_operand" "m,m"))
- (clobber (match_operand:X87MODEI12 4 "memory_operand" "=m,m"))]
+ (clobber (match_operand:X87MODEI12 4 "memory_operand" "=X,m"))]
"TARGET_USE_FANCY_MATH_387
&& flag_unsafe_math_optimizations"
"#"
@@ -18477,7 +18480,7 @@
(plus:SI (match_dup 3)
(const_int 4)))]
"!TARGET_64BIT && (TARGET_SINGLE_STRINGOP || optimize_size)"
- "{movsl|movsd}"
+ "movs{l|d}"
[(set_attr "type" "str")
(set_attr "mode" "SI")
(set_attr "memory" "both")])
@@ -18492,7 +18495,7 @@
(plus:DI (match_dup 3)
(const_int 4)))]
"TARGET_64BIT && (TARGET_SINGLE_STRINGOP || optimize_size)"
- "{movsl|movsd}"
+ "movs{l|d}"
[(set_attr "type" "str")
(set_attr "mode" "SI")
(set_attr "memory" "both")])
@@ -18748,7 +18751,7 @@
(plus:SI (match_dup 1)
(const_int 4)))]
"!TARGET_64BIT && (TARGET_SINGLE_STRINGOP || optimize_size)"
- "{stosl|stosd}"
+ "stos{l|d}"
[(set_attr "type" "str")
(set_attr "memory" "store")
(set_attr "mode" "SI")])
@@ -18760,7 +18763,7 @@
(plus:DI (match_dup 1)
(const_int 4)))]
"TARGET_64BIT && (TARGET_SINGLE_STRINGOP || optimize_size)"
- "{stosl|stosd}"
+ "stos{l|d}"
[(set_attr "type" "str")
(set_attr "memory" "store")
(set_attr "mode" "SI")])
@@ -19562,38 +19565,14 @@
operands[1], operands[0]);")
;; Conditional addition patterns
-(define_expand "addqicc"
- [(match_operand:QI 0 "register_operand" "")
- (match_operand 1 "comparison_operator" "")
- (match_operand:QI 2 "register_operand" "")
- (match_operand:QI 3 "const_int_operand" "")]
- ""
- "if (ix86_expand_int_addcc (operands)) DONE; else FAIL;")
-
-(define_expand "addhicc"
- [(match_operand:HI 0 "register_operand" "")
+(define_expand "add<mode>cc"
+ [(match_operand:SWI 0 "register_operand" "")
(match_operand 1 "comparison_operator" "")
- (match_operand:HI 2 "register_operand" "")
- (match_operand:HI 3 "const_int_operand" "")]
+ (match_operand:SWI 2 "register_operand" "")
+ (match_operand:SWI 3 "const_int_operand" "")]
""
"if (ix86_expand_int_addcc (operands)) DONE; else FAIL;")
-(define_expand "addsicc"
- [(match_operand:SI 0 "register_operand" "")
- (match_operand 1 "comparison_operator" "")
- (match_operand:SI 2 "register_operand" "")
- (match_operand:SI 3 "const_int_operand" "")]
- ""
- "if (ix86_expand_int_addcc (operands)) DONE; else FAIL;")
-
-(define_expand "adddicc"
- [(match_operand:DI 0 "register_operand" "")
- (match_operand 1 "comparison_operator" "")
- (match_operand:DI 2 "register_operand" "")
- (match_operand:DI 3 "const_int_operand" "")]
- "TARGET_64BIT"
- "if (ix86_expand_int_addcc (operands)) DONE; else FAIL;")
-
;; Misc patterns (?)
diff --git a/gcc/config/i386/linux.h b/gcc/config/i386/linux.h
index ac8149885fc..ec5dc4e2230 100644
--- a/gcc/config/i386/linux.h
+++ b/gcc/config/i386/linux.h
@@ -55,7 +55,7 @@ along with GCC; see the file COPYING3. If not see
frame, so we cannot allow profiling without a frame pointer. */
#undef SUBTARGET_FRAME_POINTER_REQUIRED
-#define SUBTARGET_FRAME_POINTER_REQUIRED current_function_profile
+#define SUBTARGET_FRAME_POINTER_REQUIRED crtl->profile
#undef SIZE_TYPE
#define SIZE_TYPE "unsigned int"
diff --git a/gcc/config/i386/mingw32.h b/gcc/config/i386/mingw32.h
index 200569ed090..3a3b74cf8be 100644
--- a/gcc/config/i386/mingw32.h
+++ b/gcc/config/i386/mingw32.h
@@ -180,7 +180,6 @@ __enable_execute_stack (void *addr) \
#undef ENABLE_EXECUTE_STACK
#define ENABLE_EXECUTE_STACK MINGW_ENABLE_EXECUTE_STACK
-
#ifdef IN_LIBGCC2
#include <windows.h>
#endif
diff --git a/gcc/config/i386/mm3dnow.h b/gcc/config/i386/mm3dnow.h
index dd1c871936e..96056e28e31 100644
--- a/gcc/config/i386/mm3dnow.h
+++ b/gcc/config/i386/mm3dnow.h
@@ -34,9 +34,6 @@
#include <mmintrin.h>
-/* Internal data types for implementing the intrinsics. */
-typedef float __v2sf __attribute__ ((__vector_size__ (8)));
-
extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
_m_femms (void)
{
diff --git a/gcc/config/i386/mmintrin.h b/gcc/config/i386/mmintrin.h
index 1c09be30e1a..3c135e61766 100644
--- a/gcc/config/i386/mmintrin.h
+++ b/gcc/config/i386/mmintrin.h
@@ -43,6 +43,7 @@ typedef int __v2si __attribute__ ((__vector_size__ (8)));
typedef short __v4hi __attribute__ ((__vector_size__ (8)));
typedef char __v8qi __attribute__ ((__vector_size__ (8)));
typedef long long __v1di __attribute__ ((__vector_size__ (8)));
+typedef float __v2sf __attribute__ ((__vector_size__ (8)));
/* Empty the multimedia state. */
extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
diff --git a/gcc/config/i386/msformat-c.c b/gcc/config/i386/msformat-c.c
index 821be470b8e..90365557a69 100644
--- a/gcc/config/i386/msformat-c.c
+++ b/gcc/config/i386/msformat-c.c
@@ -38,8 +38,8 @@ static const format_length_info ms_printf_length_specs[] =
{
{ "h", FMT_LEN_h, STD_C89, NULL, 0, 0 },
{ "l", FMT_LEN_l, STD_C89, NULL, 0, 0 },
- { "\0I32", FMT_LEN_l, STD_EXT, NULL, 0, 0 },
- { "\0I64", FMT_LEN_ll, STD_EXT, NULL, 0, 0 },
+ { "I32", FMT_LEN_l, STD_EXT, NULL, 0, 0 },
+ { "I64", FMT_LEN_ll, STD_EXT, NULL, 0, 0 },
{ "I", FMT_LEN_L, STD_EXT, NULL, 0, 0 },
{ NULL, 0, 0, NULL, 0, 0 }
};
diff --git a/gcc/config/i386/sse.md b/gcc/config/i386/sse.md
index 40ab29746ee..589da9b73b2 100644
--- a/gcc/config/i386/sse.md
+++ b/gcc/config/i386/sse.md
@@ -70,8 +70,8 @@
;; This is essential for maintaining stable calling conventions.
(define_expand "mov<mode>"
- [(set (match_operand:SSEMODEI 0 "nonimmediate_operand" "")
- (match_operand:SSEMODEI 1 "nonimmediate_operand" ""))]
+ [(set (match_operand:SSEMODE 0 "nonimmediate_operand" "")
+ (match_operand:SSEMODE 1 "nonimmediate_operand" ""))]
"TARGET_SSE"
{
ix86_expand_vector_move (<MODE>mode, operands);
@@ -79,8 +79,8 @@
})
(define_insn "*mov<mode>_internal"
- [(set (match_operand:SSEMODEI 0 "nonimmediate_operand" "=x,x ,m")
- (match_operand:SSEMODEI 1 "nonimmediate_or_sse_const_operand" "C ,xm,x"))]
+ [(set (match_operand:SSEMODE 0 "nonimmediate_operand" "=x,x ,m")
+ (match_operand:SSEMODE 1 "nonimmediate_or_sse_const_operand" "C ,xm,x"))]
"TARGET_SSE
&& (register_operand (operands[0], <MODE>mode)
|| register_operand (operands[1], <MODE>mode))"
@@ -91,23 +91,32 @@
return standard_sse_constant_opcode (insn, operands[1]);
case 1:
case 2:
- if (get_attr_mode (insn) == MODE_V4SF)
- return "movaps\t{%1, %0|%0, %1}";
- else
- return "movdqa\t{%1, %0|%0, %1}";
+ switch (get_attr_mode (insn))
+ {
+ case MODE_V4SF:
+ return "movaps\t{%1, %0|%0, %1}";
+ case MODE_V2DF:
+ return "movapd\t{%1, %0|%0, %1}";
+ default:
+ return "movdqa\t{%1, %0|%0, %1}";
+ }
default:
gcc_unreachable ();
}
}
[(set_attr "type" "sselog1,ssemov,ssemov")
(set (attr "mode")
- (if_then_else
- (ior (ior (ne (symbol_ref "optimize_size") (const_int 0))
- (eq (symbol_ref "TARGET_SSE2") (const_int 0)))
- (and (eq_attr "alternative" "2")
- (ne (symbol_ref "TARGET_SSE_TYPELESS_STORES")
- (const_int 0))))
- (const_string "V4SF")
+ (cond [(ior (ior (ne (symbol_ref "optimize_size") (const_int 0))
+ (eq (symbol_ref "TARGET_SSE2") (const_int 0)))
+ (and (eq_attr "alternative" "2")
+ (ne (symbol_ref "TARGET_SSE_TYPELESS_STORES")
+ (const_int 0))))
+ (const_string "V4SF")
+ (eq (const_string "<MODE>mode") (const_string "V4SFmode"))
+ (const_string "V4SF")
+ (eq (const_string "<MODE>mode") (const_string "V2DFmode"))
+ (const_string "V2DF")
+ ]
(const_string "TI")))])
;; Move a DI from a 32-bit register pair (e.g. %edx:%eax) to an xmm.
@@ -145,36 +154,6 @@
gcc_unreachable ();
})
-(define_expand "mov<mode>"
- [(set (match_operand:SSEMODEF2P 0 "nonimmediate_operand" "")
- (match_operand:SSEMODEF2P 1 "nonimmediate_operand" ""))]
- "TARGET_SSE"
-{
- ix86_expand_vector_move (<MODE>mode, operands);
- DONE;
-})
-
-(define_insn "*movv4sf_internal"
- [(set (match_operand:V4SF 0 "nonimmediate_operand" "=x,x,m")
- (match_operand:V4SF 1 "nonimmediate_or_sse_const_operand" "C,xm,x"))]
- "TARGET_SSE
- && (register_operand (operands[0], V4SFmode)
- || register_operand (operands[1], V4SFmode))"
-{
- switch (which_alternative)
- {
- case 0:
- return standard_sse_constant_opcode (insn, operands[1]);
- case 1:
- case 2:
- return "movaps\t{%1, %0|%0, %1}";
- default:
- gcc_unreachable ();
- }
-}
- [(set_attr "type" "sselog1,ssemov,ssemov")
- (set_attr "mode" "V4SF")])
-
(define_split
[(set (match_operand:V4SF 0 "register_operand" "")
(match_operand:V4SF 1 "zero_extended_scalar_load_operand" ""))]
@@ -189,38 +168,6 @@
operands[2] = CONST0_RTX (V4SFmode);
})
-(define_insn "*movv2df_internal"
- [(set (match_operand:V2DF 0 "nonimmediate_operand" "=x,x,m")
- (match_operand:V2DF 1 "nonimmediate_or_sse_const_operand" "C,xm,x"))]
- "TARGET_SSE
- && (register_operand (operands[0], V2DFmode)
- || register_operand (operands[1], V2DFmode))"
-{
- switch (which_alternative)
- {
- case 0:
- return standard_sse_constant_opcode (insn, operands[1]);
- case 1:
- case 2:
- if (get_attr_mode (insn) == MODE_V4SF)
- return "movaps\t{%1, %0|%0, %1}";
- else
- return "movapd\t{%1, %0|%0, %1}";
- default:
- gcc_unreachable ();
- }
-}
- [(set_attr "type" "sselog1,ssemov,ssemov")
- (set (attr "mode")
- (if_then_else
- (ior (ior (ne (symbol_ref "optimize_size") (const_int 0))
- (eq (symbol_ref "TARGET_SSE2") (const_int 0)))
- (and (eq_attr "alternative" "2")
- (ne (symbol_ref "TARGET_SSE_TYPELESS_STORES")
- (const_int 0))))
- (const_string "V4SF")
- (const_string "V2DF")))])
-
(define_split
[(set (match_operand:V2DF 0 "register_operand" "")
(match_operand:V2DF 1 "zero_extended_scalar_load_operand" ""))]
@@ -355,7 +302,7 @@
"SSE_VEC_FLOAT_MODE_P (<MODE>mode)"
"ix86_expand_fp_absneg_operator (<CODE>, <MODE>mode, operands); DONE;")
-(define_expand "<addsub><mode>3"
+(define_expand "<plusminus_insn><mode>3"
[(set (match_operand:SSEMODEF2P 0 "register_operand" "")
(plusminus:SSEMODEF2P
(match_operand:SSEMODEF2P 1 "nonimmediate_operand" "")
@@ -363,18 +310,18 @@
"SSE_VEC_FLOAT_MODE_P (<MODE>mode)"
"ix86_fixup_binary_operands_no_copy (<CODE>, <MODE>mode, operands);")
-(define_insn "*<addsub><mode>3"
+(define_insn "*<plusminus_insn><mode>3"
[(set (match_operand:SSEMODEF2P 0 "register_operand" "=x")
(plusminus:SSEMODEF2P
(match_operand:SSEMODEF2P 1 "nonimmediate_operand" "<comm>0")
(match_operand:SSEMODEF2P 2 "nonimmediate_operand" "xm")))]
"SSE_VEC_FLOAT_MODE_P (<MODE>mode)
&& ix86_binary_operator_ok (<CODE>, <MODE>mode, operands)"
- "<addsub>p<ssemodesuffixf2c>\t{%2, %0|%0, %2}"
+ "<plusminus_mnemonic>p<ssemodesuffixf2c>\t{%2, %0|%0, %2}"
[(set_attr "type" "sseadd")
(set_attr "mode" "<MODE>")])
-(define_insn "<sse>_vm<addsub><mode>3"
+(define_insn "<sse>_vm<plusminus_insn><mode>3"
[(set (match_operand:SSEMODEF2P 0 "register_operand" "=x")
(vec_merge:SSEMODEF2P
(plusminus:SSEMODEF2P
@@ -384,7 +331,7 @@
(const_int 1)))]
"SSE_VEC_FLOAT_MODE_P (<MODE>mode)
&& ix86_binary_operator_ok (<CODE>, V4SFmode, operands)"
- "<addsub>s<ssemodesuffixf2c>\t{%2, %0|%0, %2}"
+ "<plusminus_mnemonic>s<ssemodesuffixf2c>\t{%2, %0|%0, %2}"
[(set_attr "type" "sseadd")
(set_attr "mode" "<ssescalarmode>")])
@@ -668,7 +615,7 @@
[(set_attr "type" "sseadd")
(set_attr "mode" "V2DF")])
-(define_insn "sse3_h<addsub>v4sf3"
+(define_insn "sse3_h<plusminus_insn>v4sf3"
[(set (match_operand:V4SF 0 "register_operand" "=x")
(vec_concat:V4SF
(vec_concat:V2SF
@@ -690,12 +637,12 @@
(vec_select:SF (match_dup 2) (parallel [(const_int 2)]))
(vec_select:SF (match_dup 2) (parallel [(const_int 3)]))))))]
"TARGET_SSE3"
- "h<addsub>ps\t{%2, %0|%0, %2}"
+ "h<plusminus_mnemonic>ps\t{%2, %0|%0, %2}"
[(set_attr "type" "sseadd")
(set_attr "prefix_rep" "1")
(set_attr "mode" "V4SF")])
-(define_insn "sse3_h<addsub>v2df3"
+(define_insn "sse3_h<plusminus_insn>v2df3"
[(set (match_operand:V2DF 0 "register_operand" "=x")
(vec_concat:V2DF
(plusminus:DF
@@ -709,7 +656,7 @@
(parallel [(const_int 0)]))
(vec_select:DF (match_dup 2) (parallel [(const_int 1)])))))]
"TARGET_SSE3"
- "h<addsub>pd\t{%2, %0|%0, %2}"
+ "h<plusminus_mnemonic>pd\t{%2, %0|%0, %2}"
[(set_attr "type" "sseadd")
(set_attr "mode" "V2DF")])
@@ -2775,82 +2722,32 @@
"TARGET_SSE2"
"operands[2] = force_reg (<MODE>mode, CONST0_RTX (<MODE>mode));")
-(define_expand "add<mode>3"
- [(set (match_operand:SSEMODEI 0 "register_operand" "")
- (plus:SSEMODEI (match_operand:SSEMODEI 1 "nonimmediate_operand" "")
- (match_operand:SSEMODEI 2 "nonimmediate_operand" "")))]
- "TARGET_SSE2"
- "ix86_fixup_binary_operands_no_copy (PLUS, <MODE>mode, operands);")
-
-(define_insn "*add<mode>3"
- [(set (match_operand:SSEMODEI 0 "register_operand" "=x")
- (plus:SSEMODEI
- (match_operand:SSEMODEI 1 "nonimmediate_operand" "%0")
- (match_operand:SSEMODEI 2 "nonimmediate_operand" "xm")))]
- "TARGET_SSE2 && ix86_binary_operator_ok (PLUS, <MODE>mode, operands)"
- "padd<ssevecsize>\t{%2, %0|%0, %2}"
- [(set_attr "type" "sseiadd")
- (set_attr "prefix_data16" "1")
- (set_attr "mode" "TI")])
-
-(define_insn "sse2_ssadd<mode>3"
- [(set (match_operand:SSEMODE12 0 "register_operand" "=x")
- (ss_plus:SSEMODE12
- (match_operand:SSEMODE12 1 "nonimmediate_operand" "%0")
- (match_operand:SSEMODE12 2 "nonimmediate_operand" "xm")))]
- "TARGET_SSE2 && ix86_binary_operator_ok (SS_PLUS, <MODE>mode, operands)"
- "padds<ssevecsize>\t{%2, %0|%0, %2}"
- [(set_attr "type" "sseiadd")
- (set_attr "prefix_data16" "1")
- (set_attr "mode" "TI")])
-
-(define_insn "sse2_usadd<mode>3"
- [(set (match_operand:SSEMODE12 0 "register_operand" "=x")
- (us_plus:SSEMODE12
- (match_operand:SSEMODE12 1 "nonimmediate_operand" "%0")
- (match_operand:SSEMODE12 2 "nonimmediate_operand" "xm")))]
- "TARGET_SSE2 && ix86_binary_operator_ok (US_PLUS, <MODE>mode, operands)"
- "paddus<ssevecsize>\t{%2, %0|%0, %2}"
- [(set_attr "type" "sseiadd")
- (set_attr "prefix_data16" "1")
- (set_attr "mode" "TI")])
-
-(define_expand "sub<mode>3"
+(define_expand "<plusminus_insn><mode>3"
[(set (match_operand:SSEMODEI 0 "register_operand" "")
- (minus:SSEMODEI (match_operand:SSEMODEI 1 "register_operand" "")
- (match_operand:SSEMODEI 2 "nonimmediate_operand" "")))]
+ (plusminus:SSEMODEI
+ (match_operand:SSEMODEI 1 "nonimmediate_operand" "")
+ (match_operand:SSEMODEI 2 "nonimmediate_operand" "")))]
"TARGET_SSE2"
- "ix86_fixup_binary_operands_no_copy (MINUS, <MODE>mode, operands);")
+ "ix86_fixup_binary_operands_no_copy (<CODE>, <MODE>mode, operands);")
-(define_insn "*sub<mode>3"
+(define_insn "*<plusminus_insn><mode>3"
[(set (match_operand:SSEMODEI 0 "register_operand" "=x")
- (minus:SSEMODEI
- (match_operand:SSEMODEI 1 "register_operand" "0")
+ (plusminus:SSEMODEI
+ (match_operand:SSEMODEI 1 "nonimmediate_operand" "<comm>0")
(match_operand:SSEMODEI 2 "nonimmediate_operand" "xm")))]
- "TARGET_SSE2"
- "psub<ssevecsize>\t{%2, %0|%0, %2}"
- [(set_attr "type" "sseiadd")
- (set_attr "prefix_data16" "1")
- (set_attr "mode" "TI")])
-
-(define_insn "sse2_sssub<mode>3"
- [(set (match_operand:SSEMODE12 0 "register_operand" "=x")
- (ss_minus:SSEMODE12
- (match_operand:SSEMODE12 1 "register_operand" "0")
- (match_operand:SSEMODE12 2 "nonimmediate_operand" "xm")))]
- "TARGET_SSE2"
- "psubs<ssevecsize>\t{%2, %0|%0, %2}"
+ "TARGET_SSE2 && ix86_binary_operator_ok (<CODE>, <MODE>mode, operands)"
+ "p<plusminus_mnemonic><ssevecsize>\t{%2, %0|%0, %2}"
[(set_attr "type" "sseiadd")
(set_attr "prefix_data16" "1")
(set_attr "mode" "TI")])
-(define_insn "sse2_ussub<mode>3"
+(define_insn "sse2_<plusminus_insn><mode>3"
[(set (match_operand:SSEMODE12 0 "register_operand" "=x")
- (us_minus:SSEMODE12
- (match_operand:SSEMODE12 1 "register_operand" "0")
+ (sat_plusminus:SSEMODE12
+ (match_operand:SSEMODE12 1 "nonimmediate_operand" "<comm>0")
(match_operand:SSEMODE12 2 "nonimmediate_operand" "xm")))]
- "TARGET_SSE2"
- "psubus<ssevecsize>\t{%2, %0|%0, %2}"
+ "TARGET_SSE2 && ix86_binary_operator_ok (<CODE>, <MODE>mode, operands)"
+ "p<plusminus_mnemonic><ssevecsize>\t{%2, %0|%0, %2}"
[(set_attr "type" "sseiadd")
(set_attr "prefix_data16" "1")
(set_attr "mode" "TI")])
@@ -5639,7 +5536,7 @@
(set_attr "prefix_extra" "1")
(set_attr "mode" "DI")])
-(define_insn "ssse3_pmaddubswv8hi3"
+(define_insn "ssse3_pmaddubsw128"
[(set (match_operand:V8HI 0 "register_operand" "=x")
(ss_plus:V8HI
(mult:V8HI
@@ -5693,7 +5590,7 @@
(set_attr "prefix_extra" "1")
(set_attr "mode" "TI")])
-(define_insn "ssse3_pmaddubswv4hi3"
+(define_insn "ssse3_pmaddubsw"
[(set (match_operand:V4HI 0 "register_operand" "=y")
(ss_plus:V4HI
(mult:V4HI
diff --git a/gcc/config/i386/tmmintrin.h b/gcc/config/i386/tmmintrin.h
index 827d8b95b76..52d1e46424e 100644
--- a/gcc/config/i386/tmmintrin.h
+++ b/gcc/config/i386/tmmintrin.h
@@ -192,8 +192,8 @@ _mm_alignr_epi8(__m128i __X, __m128i __Y, const int __N)
extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
_mm_alignr_pi8(__m64 __X, __m64 __Y, const int __N)
{
- return (__m64) __builtin_ia32_palignr ((long long)__X,
- (long long)__Y, __N * 8);
+ return (__m64) __builtin_ia32_palignr ((__v1di)__X,
+ (__v1di)__Y, __N * 8);
}
#else
#define _mm_alignr_epi8(X, Y, N) \
@@ -201,8 +201,8 @@ _mm_alignr_pi8(__m64 __X, __m64 __Y, const int __N)
(__v2di)(__m128i)(Y), \
(int)(N) * 8))
#define _mm_alignr_pi8(X, Y, N) \
- ((__m64) __builtin_ia32_palignr ((long long)(__m64)(X), \
- (long long)(__m64)(Y), \
+ ((__m64) __builtin_ia32_palignr ((__v1di)(__m64)(X), \
+ (__v1di)(__m64)(Y), \
(int)(N) * 8))
#endif
diff --git a/gcc/config/i386/xmmintrin.h b/gcc/config/i386/xmmintrin.h
index f176d741f74..8d9b761bcaf 100644
--- a/gcc/config/i386/xmmintrin.h
+++ b/gcc/config/i386/xmmintrin.h
@@ -621,7 +621,7 @@ _mm_cvtpi16_ps (__m64 __A)
{
__v4hi __sign;
__v2si __hisi, __losi;
- __v4sf __r;
+ __v4sf __zero, __ra, __rb;
/* This comparison against zero gives us a mask that can be used to
fill in the missing sign bits in the unpack operations below, so
@@ -633,12 +633,11 @@ _mm_cvtpi16_ps (__m64 __A)
__losi = (__v2si) __builtin_ia32_punpcklwd ((__v4hi)__A, __sign);
/* Convert the doublewords to floating point two at a time. */
- __r = (__v4sf) _mm_setzero_ps ();
- __r = __builtin_ia32_cvtpi2ps (__r, __hisi);
- __r = __builtin_ia32_movlhps (__r, __r);
- __r = __builtin_ia32_cvtpi2ps (__r, __losi);
+ __zero = (__v4sf) _mm_setzero_ps ();
+ __ra = __builtin_ia32_cvtpi2ps (__zero, __hisi);
+ __rb = __builtin_ia32_cvtpi2ps (__ra, __losi);
- return (__m128) __r;
+ return (__m128) __builtin_ia32_movlhps (__ra, __rb);
}
/* Convert the four unsigned 16-bit values in A to SPFP form. */
@@ -646,19 +645,18 @@ extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artif
_mm_cvtpu16_ps (__m64 __A)
{
__v2si __hisi, __losi;
- __v4sf __r;
+ __v4sf __zero, __ra, __rb;
/* Convert the four words to doublewords. */
__hisi = (__v2si) __builtin_ia32_punpckhwd ((__v4hi)__A, (__v4hi)0LL);
__losi = (__v2si) __builtin_ia32_punpcklwd ((__v4hi)__A, (__v4hi)0LL);
/* Convert the doublewords to floating point two at a time. */
- __r = (__v4sf) _mm_setzero_ps ();
- __r = __builtin_ia32_cvtpi2ps (__r, __hisi);
- __r = __builtin_ia32_movlhps (__r, __r);
- __r = __builtin_ia32_cvtpi2ps (__r, __losi);
+ __zero = (__v4sf) _mm_setzero_ps ();
+ __ra = __builtin_ia32_cvtpi2ps (__zero, __hisi);
+ __rb = __builtin_ia32_cvtpi2ps (__ra, __losi);
- return (__m128) __r;
+ return (__m128) __builtin_ia32_movlhps (__ra, __rb);
}
/* Convert the low four signed 8-bit values in A to SPFP form. */
@@ -692,7 +690,7 @@ _mm_cvtpi32x2_ps(__m64 __A, __m64 __B)
{
__v4sf __zero = (__v4sf) _mm_setzero_ps ();
__v4sf __sfa = __builtin_ia32_cvtpi2ps (__zero, (__v2si)__A);
- __v4sf __sfb = __builtin_ia32_cvtpi2ps (__zero, (__v2si)__B);
+ __v4sf __sfb = __builtin_ia32_cvtpi2ps (__sfa, (__v2si)__B);
return (__m128) __builtin_ia32_movlhps (__sfa, __sfb);
}
@@ -747,14 +745,14 @@ _mm_unpacklo_ps (__m128 __A, __m128 __B)
extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
_mm_loadh_pi (__m128 __A, __m64 const *__P)
{
- return (__m128) __builtin_ia32_loadhps ((__v4sf)__A, (__v2si *)__P);
+ return (__m128) __builtin_ia32_loadhps ((__v4sf)__A, (const __v2sf *)__P);
}
/* Stores the upper two SPFP values of A into P. */
extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
_mm_storeh_pi (__m64 *__P, __m128 __A)
{
- __builtin_ia32_storehps ((__v2si *)__P, (__v4sf)__A);
+ __builtin_ia32_storehps ((__v2sf *)__P, (__v4sf)__A);
}
/* Moves the upper two values of B into the lower two values of A. */
@@ -776,14 +774,14 @@ _mm_movelh_ps (__m128 __A, __m128 __B)
extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
_mm_loadl_pi (__m128 __A, __m64 const *__P)
{
- return (__m128) __builtin_ia32_loadlps ((__v4sf)__A, (__v2si *)__P);
+ return (__m128) __builtin_ia32_loadlps ((__v4sf)__A, (const __v2sf *)__P);
}
/* Stores the lower two SPFP values of A into P. */
extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
_mm_storel_pi (__m64 *__P, __m128 __A)
{
- __builtin_ia32_storelps ((__v2si *)__P, (__v4sf)__A);
+ __builtin_ia32_storelps ((__v2sf *)__P, (__v4sf)__A);
}
/* Creates a 4-bit mask from the most significant bits of the SPFP values. */
diff --git a/gcc/config/ia64/ia64.c b/gcc/config/ia64/ia64.c
index 5b48eba14f5..22d0c0a3ce1 100644
--- a/gcc/config/ia64/ia64.c
+++ b/gcc/config/ia64/ia64.c
@@ -2379,7 +2379,7 @@ ia64_compute_frame_size (HOST_WIDE_INT size)
Likewise for -a profiling for the bb_init_func argument. For -ax
profiling, we need two output registers for the two bb_init_trace_func
arguments. */
- if (current_function_profile)
+ if (crtl->profile)
i = MAX (i, 1);
#endif
current_frame_info.n_output_regs = i;
@@ -2460,7 +2460,7 @@ ia64_compute_frame_size (HOST_WIDE_INT size)
/* Similarly for gp. Note that if we're calling setjmp, the stacked
registers are clobbered, so we fall back to the stack. */
current_frame_info.r[reg_save_gp]
- = (current_function_calls_setjmp ? 0 : find_gr_spill (reg_save_gp, 1));
+ = (cfun->calls_setjmp ? 0 : find_gr_spill (reg_save_gp, 1));
if (current_frame_info.r[reg_save_gp] == 0)
{
SET_HARD_REG_BIT (mask, GR_REG (1));
@@ -5058,7 +5058,7 @@ ia64_secondary_reload_class (enum reg_class class,
/* ??? This happens if we cse/gcse a BImode value across a call,
and the function has a nonlocal goto. This is because global
does not allocate call crossing pseudos to hard registers when
- current_function_has_nonlocal_goto is true. This is relatively
+ crtl->has_nonlocal_goto is true. This is relatively
common for C++ programs that use exceptions. To reproduce,
return NO_REGS and compile libstdc++. */
if (GET_CODE (x) == MEM)
diff --git a/gcc/config/iq2000/iq2000.c b/gcc/config/iq2000/iq2000.c
index 1baf6eb73bb..7ee5eda9407 100644
--- a/gcc/config/iq2000/iq2000.c
+++ b/gcc/config/iq2000/iq2000.c
@@ -1619,7 +1619,7 @@ compute_frame_size (HOST_WIDE_INT size)
/* If a function dynamically allocates the stack and
has 0 for STACK_DYNAMIC_OFFSET then allocate some stack space. */
- if (args_size == 0 && current_function_calls_alloca)
+ if (args_size == 0 && cfun->calls_alloca)
args_size = 4 * UNITS_PER_WORD;
total_size = var_size + args_size + extra_size;
@@ -1635,7 +1635,7 @@ compute_frame_size (HOST_WIDE_INT size)
}
/* We need to restore these for the handler. */
- if (current_function_calls_eh_return)
+ if (crtl->calls_eh_return)
{
unsigned int i;
@@ -1872,7 +1872,7 @@ iq2000_expand_prologue (void)
/* If struct value address is treated as the first argument. */
if (aggregate_value_p (DECL_RESULT (fndecl), fndecl)
- && ! current_function_returns_pcc_struct
+ && !cfun->returns_pcc_struct
&& targetm.calls.struct_value_rtx (TREE_TYPE (fndecl), 1) == 0)
{
tree type = build_pointer_type (fntype);
@@ -2064,7 +2064,7 @@ iq2000_expand_epilogue (void)
save_restore_insns (0);
- if (current_function_calls_eh_return)
+ if (crtl->calls_eh_return)
{
rtx eh_ofs = EH_RETURN_STACKADJ_RTX;
emit_insn (gen_addsi3 (eh_ofs, eh_ofs, tsize_rtx));
@@ -2073,14 +2073,14 @@ iq2000_expand_epilogue (void)
emit_insn (gen_blockage ());
- if (tsize != 0 || current_function_calls_eh_return)
+ if (tsize != 0 || crtl->calls_eh_return)
{
emit_insn (gen_addsi3 (stack_pointer_rtx, stack_pointer_rtx,
tsize_rtx));
}
}
- if (current_function_calls_eh_return)
+ if (crtl->calls_eh_return)
{
/* Perform the additional bump for __throw. */
emit_move_insn (gen_rtx_REG (Pmode, HARD_FRAME_POINTER_REGNUM),
diff --git a/gcc/config/m32c/m32c.c b/gcc/config/m32c/m32c.c
index c19fd4ed2cd..2e5558fd92d 100644
--- a/gcc/config/m32c/m32c.c
+++ b/gcc/config/m32c/m32c.c
@@ -1251,7 +1251,7 @@ need_to_save (int regno)
{
if (fixed_regs[regno])
return 0;
- if (cfun->calls_eh_return)
+ if (crtl->calls_eh_return)
return 1;
if (regno == FP_REGNO)
return 0;
@@ -1283,7 +1283,7 @@ m32c_pushm_popm (Push_Pop_Type ppt)
if (crtl->return_rtx
&& GET_CODE (crtl->return_rtx) == PARALLEL
- && !(cfun->calls_eh_return || cfun->machine->is_interrupt))
+ && !(crtl->calls_eh_return || cfun->machine->is_interrupt))
{
rtx exp = XVECEXP (crtl->return_rtx, 0, 0);
rtx rv = XEXP (exp, 0);
diff --git a/gcc/config/m32r/m32r.c b/gcc/config/m32r/m32r.c
index ea4e7f85c5c..64b7e5f63ab 100644
--- a/gcc/config/m32r/m32r.c
+++ b/gcc/config/m32r/m32r.c
@@ -1253,7 +1253,7 @@ static struct m32r_frame_info zero_frame_info;
&& (df_regs_ever_live_p (regno) && (!call_really_used_regs[regno] || interrupt_p)))
#define MUST_SAVE_FRAME_POINTER (df_regs_ever_live_p (FRAME_POINTER_REGNUM))
-#define MUST_SAVE_RETURN_ADDR (df_regs_ever_live_p (RETURN_ADDR_REGNUM) || current_function_profile)
+#define MUST_SAVE_RETURN_ADDR (df_regs_ever_live_p (RETURN_ADDR_REGNUM) || crtl->profile)
#define SHORT_INSN_SIZE 2 /* Size of small instructions. */
#define LONG_INSN_SIZE 4 /* Size of long instructions. */
@@ -1272,8 +1272,8 @@ m32r_compute_frame_size (int size) /* # of var. bytes allocated. */
unsigned int gmask;
enum m32r_function_type fn_type;
int interrupt_p;
- int pic_reg_used = flag_pic && (current_function_uses_pic_offset_table
- | current_function_profile);
+ int pic_reg_used = flag_pic && (crtl->uses_pic_offset_table
+ | crtl->profile);
var_size = M32R_STACK_ALIGN (size);
args_size = M32R_STACK_ALIGN (crtl->outgoing_args_size);
@@ -1372,8 +1372,8 @@ m32r_expand_prologue (void)
int regno;
int frame_size;
unsigned int gmask;
- int pic_reg_used = flag_pic && (current_function_uses_pic_offset_table
- | current_function_profile);
+ int pic_reg_used = flag_pic && (crtl->uses_pic_offset_table
+ | crtl->profile);
if (! current_frame_info.initialized)
m32r_compute_frame_size (get_frame_size ());
@@ -1434,7 +1434,7 @@ m32r_expand_prologue (void)
if (frame_pointer_needed)
emit_insn (gen_movsi (frame_pointer_rtx, stack_pointer_rtx));
- if (current_function_profile)
+ if (crtl->profile)
/* Push lr for mcount (form_pc, x). */
emit_insn (gen_movsi_push (stack_pointer_rtx,
gen_rtx_REG (Pmode, RETURN_ADDR_REGNUM)));
@@ -1443,10 +1443,10 @@ m32r_expand_prologue (void)
{
m32r_load_pic_register ();
m32r_reload_lr (stack_pointer_rtx,
- (current_function_profile ? 0 : frame_size));
+ (crtl->profile ? 0 : frame_size));
}
- if (current_function_profile && !pic_reg_used)
+ if (crtl->profile && !pic_reg_used)
emit_insn (gen_blockage ());
}
@@ -1519,7 +1519,7 @@ m32r_expand_epilogue (void)
unsigned int var_size = current_frame_info.var_size;
unsigned int args_size = current_frame_info.args_size;
unsigned int gmask = current_frame_info.gmask;
- int can_trust_sp_p = !current_function_calls_alloca;
+ int can_trust_sp_p = !cfun->calls_alloca;
if (flag_exceptions)
emit_insn (gen_blockage ());
@@ -1664,7 +1664,7 @@ m32r_legitimize_pic_address (rtx orig, rtx reg)
else
address = reg;
- current_function_uses_pic_offset_table = 1;
+ crtl->uses_pic_offset_table = 1;
if (GET_CODE (orig) == LABEL_REF
|| (GET_CODE (orig) == SYMBOL_REF && SYMBOL_REF_LOCAL_P (orig)))
diff --git a/gcc/config/m32r/m32r.h b/gcc/config/m32r/m32r.h
index d1ac1c81d21..0c9e31853ed 100644
--- a/gcc/config/m32r/m32r.h
+++ b/gcc/config/m32r/m32r.h
@@ -768,7 +768,7 @@ extern enum reg_class m32r_regno_reg_class[FIRST_PSEUDO_REGISTER];
/* A C expression which is nonzero if a function must have and use a
frame pointer. This expression is evaluated in the reload pass.
If its value is nonzero the function will have a frame pointer. */
-#define FRAME_POINTER_REQUIRED current_function_calls_alloca
+#define FRAME_POINTER_REQUIRED cfun->calls_alloca
#if 0
/* C statement to store the difference between the frame pointer
diff --git a/gcc/config/m32r/m32r.md b/gcc/config/m32r/m32r.md
index 84cf4f954e0..b33f624edde 100644
--- a/gcc/config/m32r/m32r.md
+++ b/gcc/config/m32r/m32r.md
@@ -2354,7 +2354,7 @@
"
{
if (flag_pic)
- current_function_uses_pic_offset_table = 1;
+ crtl->uses_pic_offset_table = 1;
}")
(define_insn "*call_via_reg"
@@ -2409,7 +2409,7 @@
"
{
if (flag_pic)
- current_function_uses_pic_offset_table = 1;
+ crtl->uses_pic_offset_table = 1;
}")
(define_insn "*call_value_via_reg"
@@ -2433,7 +2433,7 @@
int call26_p = call26_operand (operands[1], FUNCTION_MODE);
if (flag_pic)
- current_function_uses_pic_offset_table = 1;
+ crtl->uses_pic_offset_table = 1;
if (! call26_p)
{
diff --git a/gcc/config/m68k/cf.md b/gcc/config/m68k/cf.md
index b9c135c9901..546e99557db 100644
--- a/gcc/config/m68k/cf.md
+++ b/gcc/config/m68k/cf.md
@@ -1,4 +1,4 @@
-;; ColdFire V2 DFA description.
+;; ColdFire V1, V2 and V3 DFA description.
;; Copyright (C) 2007 Free Software Foundation, Inc.
;; Contributed by CodeSourcery Inc.
;;
@@ -19,171 +19,322 @@
;; the Free Software Foundation, 51 Franklin Street, Fifth Floor,
;; Boston, MA 02110-1301, USA.
+;; Intruction types recognized by DFA.
+;; This attribute correspond to type1 attribute with the exceptions below.
+;; omove - optimized move. All explicit loads on cfv1 and long explicit
+;; loads on cfv2 execute one cycle faster then they should.
+;; Supposedly, that is due to combined instruction decoding
+;; and address generation phases.
;; ??? To let genattrtab live, implement this attribute in C.
(define_attr "type2"
- "alu, alu_l, bcc, bra, call, jmp, lea, move, move_l, mul, pea, rts, unlk,
- unknown"
+ "alu, alu_reg, bcc, bra, call, jmp, lea, mul_l, mul_w, omove, pea,
+ rts, unlk, unknown"
(symbol_ref "m68k_sched_attr_type2 (insn)"))
;; Instruction Buffer
-(define_automaton "cf_v2_ib")
-
-;; If one of these cpu units is occupied, that means that corresponding
-;; word in the buffer is empty.
-(define_cpu_unit "cf_v2_ib_w0, cf_v2_ib_w1, cf_v2_ib_w2, cf_v2_ib_w3, cf_v2_ib_w4, cf_v2_ib_w5" "cf_v2_ib")
-
-(final_presence_set "cf_v2_ib_w1, cf_v2_ib_w2, cf_v2_ib_w3, cf_v2_ib_w4, cf_v2_ib_w5" "cf_v2_ib_w0")
-(final_presence_set "cf_v2_ib_w2, cf_v2_ib_w3, cf_v2_ib_w4, cf_v2_ib_w5" "cf_v2_ib_w1")
-(final_presence_set "cf_v2_ib_w3, cf_v2_ib_w4, cf_v2_ib_w5" "cf_v2_ib_w2")
-(final_presence_set "cf_v2_ib_w4, cf_v2_ib_w5" "cf_v2_ib_w3")
-(final_presence_set "cf_v2_ib_w5" "cf_v2_ib_w4")
-
-;; Occupy 1 word.
-(define_reservation "cf_v2_ib1" "cf_v2_ib_w0|cf_v2_ib_w1|cf_v2_ib_w2|cf_v2_ib_w3|cf_v2_ib_w4|cf_v2_ib_w5")
-
-;; Occupy 2 words.
-(define_reservation "cf_v2_ib2" "(cf_v2_ib_w0+cf_v2_ib_w1)|(cf_v2_ib_w1+cf_v2_ib_w2)|(cf_v2_ib_w2+cf_v2_ib_w3)|(cf_v2_ib_w3+cf_v2_ib_w4)|(cf_v2_ib_w4+cf_v2_ib_w5)")
-
-;; Occupy 3 words.
-(define_reservation "cf_v2_ib3" "(cf_v2_ib_w0+cf_v2_ib_w1+cf_v2_ib_w2)|(cf_v2_ib_w1+cf_v2_ib_w2+cf_v2_ib_w3)|(cf_v2_ib_w2+cf_v2_ib_w3+cf_v2_ib_w4)|(cf_v2_ib_w3+cf_v2_ib_w4+cf_v2_ib_w5)")
-
-;; Reservation to subscribe 1 word in the instruction buffer. If a given
-;; word in the instruction buffer is subscribed, that means it is empty.
-;; This reservation is used at the start of each cycle to setup the number
-;; of prefetched instruction words in the instruction buffer.
-;; At each cycle, given that memory bus is available (i.e. there is no
-;; pending memory operation), IFP prefetches two instruction words into IB.
-(define_insn_reservation "cf_v2_ib" 0
- (and (eq_attr "cpu" "cf_v2")
+(define_automaton "cf_ib")
+
+;; These pseudo units are used to model instruction buffer of ColdFire cores.
+;; Instruction of size N can be issued only when cf_ib_wN is available.
+(define_cpu_unit "cf_ib_w1, cf_ib_w2, cf_ib_w3" "cf_ib")
+
+;; Instruction occupies 1 word in the instruction buffer.
+(define_reservation "cf_ib1" "cf_ib_w1")
+;; Instruction occupies 2 words in the instruction buffer.
+(define_reservation "cf_ib2" "cf_ib_w1+cf_ib_w2")
+;; Instruction occupies 3 words in the instruction buffer.
+(define_reservation "cf_ib3" "cf_ib_w1+cf_ib_w2+cf_ib_w3")
+
+;; This reservation is used at the start of each cycle to setup the maximal
+;; length of instruction that can be issued on current cycle.
+;; E.g., when this reservation is applied for the first time, cf_ib_w3
+;; resource is marked busy, thus filtering out all 3-word insns.
+;;
+;; This reservation requires deterministic automaton.
+;;
+;; At each cycle, given that memory bus is available (i.e., there is no
+;; pending memory operation), instruction fetch pipeline (IFP) prefetches
+;; two instruction words into instruction buffer (IB).
+(define_insn_reservation "cf_ib1" 0
+ (and (eq_attr "cpu" "cfv1,cfv2,cfv3")
(eq_attr "type" "ib"))
- "cf_v2_ib1")
+ "cf_ib_w3|cf_ib_w2|cf_ib_w1")
;; Operand Execution Pipeline
-(define_automaton "cf_v2_oep")
+(define_automaton "cf_oep")
-(define_cpu_unit "cf_v2_dsoc, cf_v2_agex" "cf_v2_oep")
+(define_cpu_unit "cf_dsoc, cf_agex" "cf_oep")
;; A memory unit that is reffered to as 'certain hardware resources' in
;; ColdFire reference manuals. This unit remains occupied for two cycles
;; after last dsoc cycle of a store - hence there is a 2 cycle delay between
;; two consecutive stores.
-(define_automaton "cf_v2_chr")
+(define_automaton "cf_chr")
-(define_cpu_unit "cf_v2_chr" "cf_v2_chr")
+(define_cpu_unit "cf_chr" "cf_chr")
;; Memory bus
-(define_automaton "cf_v2_mem")
+(define_automaton "cf_mem")
;; When memory bus is subscribed, that implies that instruction buffer won't
-;; get its portion this cycle. To model that we query if cf_v2_mem unit is
+;; get its portion this cycle. To model that we query if cf_mem unit is
;; subscribed and adjust number of prefetched instruction words accordingly.
;;
-(define_query_cpu_unit "cf_v2_mem" "cf_v2_mem")
+(define_query_cpu_unit "cf_mem1, cf_mem2" "cf_mem")
+
+(define_reservation "cf_mem" "cf_mem1+cf_mem2")
;; Register to register move.
;; Takes 1 cycle.
-(define_reservation "cf_v2_move_00"
- "cf_v2_dsoc+cf_v2_agex")
+(define_reservation "cfv123_alu_00"
+ "cf_dsoc,cf_agex")
;; Load from a memory location.
;; Takes 3 cycles.
-(define_reservation "cf_v2_move_10"
- "cf_v2_dsoc,cf_v2_agex,cf_v2_dsoc+cf_v2_mem,cf_v2_agex")
-
-;; Long load from a memory location.
+(define_reservation "cfv12_alu_10"
+ "cf_dsoc,cf_agex,cf_dsoc+cf_mem,cf_agex")
;; Takes 2 cycles.
-(define_reservation "cf_v2_move_l_10"
- "cf_v2_dsoc+cf_v2_agex,cf_v2_dsoc+cf_v2_mem,cf_v2_agex")
+(define_reservation "cfv12_omove_10"
+ "cf_dsoc+cf_agex,cf_dsoc+cf_mem,cf_agex")
+;; Takes 4 cycles.
+(define_reservation "cfv3_alu_10"
+ "cf_dsoc,cf_agex,cf_dsoc+cf_mem1,cf_dsoc+cf_mem2,cf_agex")
+;; Takes 3 cycles.
+(define_reservation "cfv3_omove_10"
+ "cf_dsoc+cf_agex,cf_dsoc+cf_mem1,cf_dsoc+cf_mem2,cf_agex")
;; Load from an indexed location.
;; Takes 4 cycles.
-(define_reservation "cf_v2_move_i0"
- "cf_v2_dsoc,cf_v2_agex,cf_v2_agex,cf_v2_dsoc+cf_v2_mem,cf_v2_agex")
-
-;; Long load from an indexed location.
+(define_reservation "cfv12_alu_i0"
+ "cf_dsoc,cf_agex,cf_agex,cf_dsoc+cf_mem,cf_agex")
;; Takes 3 cycles.
-(define_reservation "cf_v2_move_l_i0"
- "cf_v2_dsoc+cf_v2_agex,cf_v2_agex,cf_v2_dsoc+cf_v2_mem,cf_v2_agex")
+(define_reservation "cfv12_omove_i0"
+ "cf_dsoc+cf_agex,cf_agex,cf_dsoc+cf_mem,cf_agex")
+;; Takes 5 cycles.
+(define_reservation "cfv3_alu_i0"
+ "cf_dsoc,cf_agex,cf_agex,cf_dsoc+cf_mem1,cf_dsoc+cf_mem2,cf_agex")
+;; Takes 4 cycles.
+(define_reservation "cfv3_omove_i0"
+ "cf_dsoc+cf_agex,cf_agex,cf_dsoc+cf_mem1,cf_dsoc+cf_mem2,cf_agex")
;; Store to a memory location.
;; Takes 1 cycle.
-(define_reservation "cf_v2_move_01"
- "cf_v2_dsoc+cf_v2_agex+cf_v2_chr,cf_v2_mem+cf_v2_chr,cf_v2_chr")
+(define_reservation "cfv12_alu_01"
+ "cf_dsoc+cf_agex+cf_chr,cf_mem+cf_chr,cf_chr")
+;; Takes 1 cycle.
+(define_reservation "cfv3_alu_01"
+ "cf_dsoc+cf_agex+cf_chr,cf_mem1+cf_chr,cf_mem2+cf_chr")
;; Store to an indexed location.
-;; Takes 2 cycle.
-(define_reservation "cf_v2_move_0i"
- "cf_v2_dsoc+cf_v2_agex,cf_v2_agex+cf_v2_chr,cf_v2_mem+cf_v2_chr,cf_v2_chr")
+;; Takes 2 cycles.
+(define_reservation "cfv12_alu_0i"
+ "cf_dsoc+cf_agex,cf_agex+cf_chr,cf_mem+cf_chr,cf_chr")
+;; Takes 2 cycles.
+(define_reservation "cfv3_alu_0i"
+ "cf_dsoc+cf_agex,cf_agex+cf_chr,cf_mem1+cf_chr,cf_mem2+cf_chr")
;; Load from a memory location and store to a memory location.
;; Takes 3 cycles
-(define_reservation "cf_v2_move_11"
- "cf_v2_dsoc,cf_v2_agex,cf_v2_dsoc+cf_v2_agex+cf_v2_mem+cf_v2_chr,cf_v2_mem+cf_v2_chr,cf_v2_chr")
-
-;; Long load from a memory location and store to a memory location.
+(define_reservation "cfv12_alu_11"
+ "cf_dsoc,cf_agex,cf_dsoc+cf_mem,cf_agex+cf_chr,cf_mem+cf_chr,cf_chr")
;; Takes 2 cycles.
-(define_reservation "cf_v2_move_l_11"
- "cf_v2_dsoc+cf_v2_agex,cf_v2_dsoc+cf_v2_agex+cf_v2_mem+cf_v2_chr,cf_v2_mem+cf_v2_chr,cf_v2_chr")
+(define_reservation "cfv12_omove_11"
+ "cf_dsoc+cf_agex,cf_dsoc+cf_mem,cf_agex+cf_chr,cf_mem+cf_chr,cf_chr")
+;; Takes 4 cycles
+(define_reservation "cfv3_alu_11"
+ "cf_dsoc,cf_agex,cf_dsoc+cf_mem1,cf_dsoc+cf_mem2,cf_agex+cf_chr,cf_mem1+cf_chr,cf_mem2+cf_chr")
+;; Takes 3 cycles.
+(define_reservation "cfv3_omove_11"
+ "cf_dsoc+cf_agex,cf_dsoc+cf_mem1,cf_dsoc+cf_mem2,cf_agex+cf_chr,cf_mem1+cf_chr,cf_mem2+cf_chr")
;; Load from an indexed location and store to a memory location.
;; Takes 4 cycles.
-(define_reservation "cf_v2_move_i1"
- "cf_v2_dsoc,cf_v2_agex,cf_v2_agex,cf_v2_dsoc+cf_v2_agex+cf_v2_mem+cf_v2_chr,cf_v2_mem+cf_v2_chr,cf_v2_chr")
-
-;; Long load from an indexed location and store to a memory location.
+(define_reservation "cfv12_alu_i1"
+ "cf_dsoc,cf_agex,cf_agex,cf_dsoc+cf_mem,cf_agex+cf_chr,cf_mem+cf_chr,cf_chr")
;; Takes 3 cycles.
-(define_reservation "cf_v2_move_l_i1"
- "cf_v2_dsoc+cf_v2_agex,cf_v2_agex,cf_v2_dsoc+cf_v2_agex+cf_v2_mem+cf_v2_chr,cf_v2_mem+cf_v2_chr,cf_v2_chr")
+(define_reservation "cfv12_omove_i1"
+ "cf_dsoc+cf_agex,cf_agex,cf_dsoc+cf_mem,cf_agex+cf_chr,cf_mem+cf_chr,cf_chr")
+;; Takes 5 cycles.
+(define_reservation "cfv3_alu_i1"
+ "cf_dsoc,cf_agex,cf_agex,cf_dsoc+cf_mem1,cf_dsoc+cf_mem2,cf_agex+cf_chr,cf_mem1+cf_chr,cf_mem2+cf_chr")
+;; Takes 4 cycles.
+(define_reservation "cfv3_omove_i1"
+ "cf_dsoc+cf_agex,cf_agex,cf_dsoc+cf_mem1,cf_dsoc+cf_mem2,cf_agex+cf_chr,cf_mem1+cf_chr,cf_mem2+cf_chr")
;; Load from a memory location and store to an indexed location.
;; Takes 4 cycles.
-(define_reservation "cf_v2_move_1i"
- "cf_v2_dsoc,cf_v2_agex,cf_v2_dsoc+cf_v2_agex+cf_v2_mem,cf_v2_agex,cf_v2_mem")
-
-;; Long load from a memory location and store to an indexed location.
+(define_reservation "cfv12_alu_1i"
+ "cf_dsoc,cf_agex,cf_dsoc+cf_mem,cf_agex,cf_agex+cf_chr,cf_mem+cf_chr,cf_chr")
;; Takes 3 cycles.
-(define_reservation "cf_v2_move_l_1i"
- "cf_v2_dsoc+cf_v2_agex,cf_v2_dsoc+cf_v2_agex+cf_v2_mem,cf_v2_agex,cf_v2_mem")
+(define_reservation "cfv12_omove_1i"
+ "cf_dsoc+cf_agex,cf_dsoc+cf_mem,cf_agex,cf_agex+cf_chr,cf_mem+cf_chr,cf_chr")
+;; Takes 5 cycles.
+(define_reservation "cfv3_alu_1i"
+ "cf_dsoc,cf_agex,cf_dsoc+cf_mem1,cf_dsoc+cf_mem2,cf_agex,cf_agex+cf_chr,cf_mem1+cf_chr,cf_mem2+cf_chr")
+;; Takes 4 cycles.
+(define_reservation "cfv3_omove_1i"
+ "cf_dsoc+cf_agex,cf_dsoc+cf_mem1,cf_dsoc+cf_mem2,cf_agex,cf_agex+cf_chr,cf_mem1+cf_chr,cf_mem2+cf_chr")
;; Lea operation for a memory location.
;; Takes 1 cycle.
-(define_reservation "cf_v2_lea_10"
- "cf_v2_dsoc+cf_v2_agex")
+(define_reservation "cfv123_lea_10"
+ "cf_dsoc,cf_agex")
;; Lea operation for an indexed location.
;; Takes 2 cycles.
-(define_reservation "cf_v2_lea_i0"
- "cf_v2_dsoc+cf_v2_agex,cf_v2_agex")
+(define_reservation "cfv123_lea_i0"
+ "cf_dsoc,cf_agex,cf_agex")
;; Pea operation for a memory location.
-;; Takes 2 cycle.
-(define_reservation "cf_v2_pea_11"
- "cf_v2_dsoc+cf_v2_agex,cf_v2_agex+cf_v2_chr,cf_v2_mem+cf_v2_chr,cf_v2_chr")
+;; Takes 2 cycles.
+(define_reservation "cfv12_pea_11"
+ "cf_dsoc,cf_agex,cf_agex+cf_chr,cf_mem+cf_chr,cf_chr")
+;; Takes 2 cycles.
+(define_reservation "cfv3_pea_11"
+ "cf_dsoc,cf_agex,cf_agex+cf_chr,cf_mem1+cf_chr,cf_mem2+cf_chr")
;; Pea operation for an indexed location.
;; Takes 3 cycles.
-(define_reservation "cf_v2_pea_i1"
- "cf_v2_dsoc+cf_v2_agex,cf_v2_agex,cf_v2_agex+cf_v2_chr,cf_v2_mem+cf_v2_chr,cf_v2_chr")
+(define_reservation "cfv12_pea_i1"
+ "cf_dsoc,cf_agex,cf_agex,cf_agex+cf_chr,cf_mem+cf_chr,cf_chr")
+;; Takes 3 cycles.
+(define_reservation "cfv3_pea_i1"
+ "cf_dsoc,cf_agex,cf_agex,cf_agex+cf_chr,cf_mem1+cf_chr,cf_mem2+cf_chr")
+
+;; Long multiplication with no mac.
+;; Takes 9-18 cycles.
+(define_reservation "cfv123_mul_l_00"
+ "cf_dsoc,(cf_agex+cf_dsoc)*17,cf_agex")
+
+;; Word multiplication with no mac.
+;; Takes 9 cycles.
+(define_reservation "cfv123_mul_w_00"
+ "cf_dsoc,(cf_agex+cf_dsoc)*8,cf_agex")
+
+;; Long multiplication with no mac.
+;; Takes 11-20 cycles.
+(define_reservation "cfv12_mul_l_10"
+ "cf_dsoc,cf_agex,cf_dsoc+cf_mem,(cf_agex+cf_dsoc)*17,cf_agex")
+;; Takes 12-21 cycles.
+(define_reservation "cfv3_mul_l_10"
+ "cf_dsoc,cf_agex,cf_dsoc+cf_mem1,cf_dsoc+cf_mem2,(cf_agex+cf_dsoc)*17,cf_agex")
+
+;; Word multiplication with no mac.
+;; Takes 11 cycles.
+(define_reservation "cfv12_mul_w_10"
+ "cf_dsoc,cf_agex,cf_dsoc+cf_mem,(cf_agex+cf_dsoc)*8,cf_agex")
+;; Takes 12 cycles.
+(define_reservation "cfv3_mul_w_10"
+ "cf_dsoc,cf_agex,cf_dsoc+cf_mem1,cf_dsoc+cf_mem2,(cf_agex+cf_dsoc)*8,cf_agex")
+
+;; Word multiplication with no mac.
+;; Takes 12 cycles.
+(define_reservation "cfv12_mul_w_i0"
+ "cf_dsoc,cf_agex,cf_agex,cf_dsoc+cf_mem,(cf_agex+cf_dsoc)*8,cf_agex")
+;; Takes 13 cycles.
+(define_reservation "cfv3_mul_w_i0"
+ "cf_dsoc,cf_agex,cf_agex,cf_dsoc+cf_mem1,cf_dsoc+cf_mem2,(cf_agex+cf_dsoc)*8,cf_agex")
+
+(define_automaton "cf_mac")
+
+(define_cpu_unit "cf_mac1,cf_mac2,cf_mac3,cf_mac4"
+ "cf_mac")
+
+;; Long multiplication with mac.
+;; Takes 5 cycles.
+(define_reservation "cfv123_mac_l_00"
+ "cf_dsoc,cf_agex,cf_mac1,cf_mac2,cf_mac3,cf_mac4")
+
+;; Word multiplication with mac.
+;; Takes 3 cycles.
+(define_reservation "cfv123_mac_w_00"
+ "cf_dsoc,cf_agex,cf_mac1,cf_mac2")
-(define_automaton "cf_v2_emac")
+;; Long multiplication with mac.
+;; Takes 7 cycles.
+(define_reservation "cfv12_mac_l_10"
+ "cf_dsoc,cf_agex,cf_dsoc+cf_mem,cf_agex,cf_mac1,cf_mac2,cf_mac3,cf_mac4")
+;; Takes 8 cycles.
+(define_reservation "cfv3_mac_l_10"
+ "cf_dsoc,cf_agex,cf_dsoc+cf_mem1,cf_dsoc+cf_mem2,cf_agex,cf_mac1,cf_mac2,cf_mac3,cf_mac4")
+
+;; Word multiplication with mac.
+;; Takes 5 cycles.
+(define_reservation "cfv12_mac_w_10"
+ "cf_dsoc,cf_agex,cf_dsoc+cf_mem,cf_agex,cf_mac1,cf_mac2")
+;; Takes 6 cycles.
+(define_reservation "cfv3_mac_w_10"
+ "cf_dsoc,cf_agex,cf_dsoc+cf_mem1,cf_dsoc+cf_mem2,cf_agex,cf_mac1,cf_mac2")
-(define_cpu_unit "cf_v2_emac1,cf_v2_emac2,cf_v2_emac3,cf_v2_emac4"
- "cf_v2_emac")
+;; Word multiplication with mac.
+;; Takes 6 cycles.
+(define_reservation "cfv12_mac_w_i0"
+ "cf_dsoc,cf_agex,cf_agex,cf_dsoc+cf_mem,cf_agex,cf_mac1,cf_mac2")
+;; Takes 7 cycles.
+(define_reservation "cfv3_mac_w_i0"
+ "cf_dsoc,cf_agex,cf_agex,cf_dsoc+cf_mem1,cf_dsoc+cf_mem2,cf_agex,cf_mac1,cf_mac2")
-;; Mul operation with register operands.
+;; Multiplication with emac.
;; Takes 4 cycles.
-(define_reservation "cf_v2_mul_00"
- "cf_v2_dsoc,cf_v2_agex+cf_v2_emac1,cf_v2_emac2,cf_v2_emac3,cf_v2_emac4")
+(define_reservation "cfv123_emac_00"
+ "cf_dsoc,cf_agex+cf_mac1,cf_mac2,cf_mac3,cf_mac4")
-;; Mul operation with implicit load from a memory location.
+;; Multiplication with emac.
;; Takes 6 cycles.
-(define_reservation "cf_v2_mul_10"
- "cf_v2_dsoc,cf_v2_agex,cf_v2_dsoc+cf_v2_mem,cf_v2_agex+cf_v2_emac1,cf_v2_emac2,cf_v2_emac3,cf_v2_emac4")
+(define_reservation "cfv12_emac_10"
+ "cf_dsoc,cf_agex,cf_dsoc+cf_mem,cf_agex+cf_mac1,cf_mac2,cf_mac3,cf_mac4")
+;; Takes 7 cycles.
+(define_reservation "cfv3_emac_10"
+ "cf_dsoc,cf_agex,cf_dsoc+cf_mem1,cf_dsoc+cf_mem2,cf_agex+cf_mac1,cf_mac2,cf_mac3,cf_mac4")
-;; Mul operation with implicit load from an indexed location.
+;; Word multiplication with emac.
;; Takes 7 cycles.
-(define_reservation "cf_v2_mul_i0"
- "cf_v2_dsoc,cf_v2_agex,cf_v2_agex,cf_v2_dsoc+cf_v2_mem,cf_v2_agex+cf_v2_emac1,cf_v2_emac2,cf_v2_emac3,cf_v2_emac4")
+(define_reservation "cfv12_emac_w_i0"
+ "cf_dsoc,cf_agex,cf_agex,cf_dsoc+cf_mem,cf_agex+cf_mac1,cf_mac2,cf_mac3,cf_mac4")
+;; Takes 8 cycles.
+(define_reservation "cfv3_emac_w_i0"
+ "cf_dsoc,cf_agex,cf_agex,cf_dsoc+cf_mem1,cf_dsoc+cf_mem2,cf_agex+cf_mac1,cf_mac2,cf_mac3,cf_mac4")
+
+;; Return instruction.
+;; ??? As return reads target address from stack, use a mem-read reservation
+;; ??? for it.
+;; ??? It's not clear what the core does during these 5 cycles.
+;; ??? Luckily, we don't care that much about an insn that won't be moved.
+;; Takes 5 cycles.
+(define_reservation "cfv12_rts" "cfv12_alu_10")
+;; Takes 8 cycles.
+(define_reservation "cfv3_rts" "cfv3_alu_10")
+
+;; Call instruction.
+;; ??? It's not clear what reservation is best to use for calls.
+;; ??? For now we use mem-write + return reservations to reflect the fact of
+;; ??? pushing and poping return address to and from the stack.
+;; Takes 3 cycles.
+(define_reservation "cfv12_call" "cfv12_alu_01,cfv12_rts")
+;; Takes 1/5 cycles.
+(define_reservation "cfv3_call" "cfv3_alu_01,cfv3_rts")
+
+;; Conditional branch instruction.
+;; ??? Branch reservations are unclear to me so far. Luckily, we don't care
+;; ??? that much about branches.
+;; Takes 2 cycles.
+(define_reservation "cfv12_bcc" "cfv123_alu_00")
+;; Takes 1 cycles.
+(define_reservation "cfv3_bcc" "cfv123_alu_00")
+
+;; Unconditional branch instruciton.
+;; Takes 2 cycles.
+(define_reservation "cfv12_bra" "cfv12_alu_01")
+;; Takes 1 cycles.
+(define_reservation "cfv3_bra" "cfv3_alu_01")
+
+;; Computed jump instruction.
+;; Takes 3 cycles.
+(define_reservation "cfv12_jmp"
+ "(cf_dsoc+cf_agex)*3")
+;; Takes 5 cycles.
+(define_reservation "cfv3_jmp"
+ "(cf_dsoc+cf_agex)*5")
;; Instruction reservations.
@@ -192,488 +343,1186 @@
;; for each instruction size.
;; A number in the end of reservation's name is the size of the instruction.
-(define_insn_reservation "cf_v2_move_00_1" 1
- (and (and (and (eq_attr "cpu" "cf_v2")
- (eq_attr "type2" "alu,alu_l,move,move_l"))
+(define_insn_reservation "cfv123_alu_00_1" 1
+ (and (and (and (eq_attr "cpu" "cfv1,cfv2,cfv3")
+ (eq_attr "type2" "alu,alu_reg,omove"))
(eq (symbol_ref "get_attr_size (insn)") (const_int 1)))
(eq_attr "op_mem" "00"))
- "cf_v2_ib1+cf_v2_move_00")
+ "cf_ib1+cfv123_alu_00")
-(define_insn_reservation "cf_v2_move_00_2" 1
- (and (and (and (eq_attr "cpu" "cf_v2")
- (eq_attr "type2" "alu,alu_l,move,move_l"))
+(define_insn_reservation "cfv123_alu_00_2" 1
+ (and (and (and (eq_attr "cpu" "cfv1,cfv2,cfv3")
+ (eq_attr "type2" "alu,alu_reg,omove"))
(eq (symbol_ref "get_attr_size (insn)") (const_int 2)))
(eq_attr "op_mem" "00"))
- "cf_v2_ib2+cf_v2_move_00")
+ "cf_ib2+cfv123_alu_00")
-(define_insn_reservation "cf_v2_move_00_3" 1
- (and (and (and (eq_attr "cpu" "cf_v2")
- (eq_attr "type2" "alu,alu_l,move,move_l"))
+(define_insn_reservation "cfv123_alu_00_3" 1
+ (and (and (and (eq_attr "cpu" "cfv1,cfv2,cfv3")
+ (eq_attr "type2" "alu,alu_reg,omove"))
(eq (symbol_ref "get_attr_size (insn)") (const_int 3)))
(eq_attr "op_mem" "00"))
- "cf_v2_ib3+cf_v2_move_00")
+ "cf_ib3+cfv123_alu_00")
+
+(define_insn_reservation "cfv12_alu_10_1" 3
+ (and (and (and (eq_attr "cpu" "cfv1,cfv2")
+ (eq_attr "type2" "alu"))
+ (eq (symbol_ref "get_attr_size (insn)") (const_int 1)))
+ (eq_attr "op_mem" "10"))
+ "cf_ib1+cfv12_alu_10")
+
+(define_insn_reservation "cfv12_alu_10_2" 3
+ (and (and (and (eq_attr "cpu" "cfv1,cfv2")
+ (eq_attr "type2" "alu"))
+ (eq (symbol_ref "get_attr_size (insn)") (const_int 2)))
+ (eq_attr "op_mem" "10"))
+ "cf_ib2+cfv12_alu_10")
-(define_insn_reservation "cf_v2_move_10_1" 4
- (and (and (and (eq_attr "cpu" "cf_v2")
- (eq_attr "type2" "alu_l,move"))
+(define_insn_reservation "cfv12_alu_10_3" 3
+ (and (and (and (eq_attr "cpu" "cfv1,cfv2")
+ (eq_attr "type2" "alu"))
+ (eq (symbol_ref "get_attr_size (insn)") (const_int 3)))
+ (eq_attr "op_mem" "10"))
+ "cf_ib3+cfv12_alu_10")
+
+(define_insn_reservation "cfv12_omove_10_1" 2
+ (and (and (and (eq_attr "cpu" "cfv1,cfv2")
+ (eq_attr "type2" "omove"))
(eq (symbol_ref "get_attr_size (insn)") (const_int 1)))
(eq_attr "op_mem" "10"))
- "cf_v2_ib1+cf_v2_move_10")
+ "cf_ib1+cfv12_omove_10")
-(define_insn_reservation "cf_v2_move_10_2" 4
- (and (and (and (eq_attr "cpu" "cf_v2")
- (eq_attr "type2" "alu_l,move"))
+(define_insn_reservation "cfv12_omove_10_2" 2
+ (and (and (and (eq_attr "cpu" "cfv1,cfv2")
+ (eq_attr "type2" "omove"))
(eq (symbol_ref "get_attr_size (insn)") (const_int 2)))
(eq_attr "op_mem" "10"))
- "cf_v2_ib2+cf_v2_move_10")
+ "cf_ib2+cfv12_omove_10")
-(define_insn_reservation "cf_v2_move_10_3" 4
- (and (and (and (eq_attr "cpu" "cf_v2")
- (eq_attr "type2" "alu_l,move"))
+(define_insn_reservation "cfv12_omove_10_3" 2
+ (and (and (and (eq_attr "cpu" "cfv1,cfv2")
+ (eq_attr "type2" "omove"))
(eq (symbol_ref "get_attr_size (insn)") (const_int 3)))
(eq_attr "op_mem" "10"))
- "cf_v2_ib3+cf_v2_move_10")
+ "cf_ib3+cfv12_omove_10")
-(define_insn_reservation "cf_v2_move_l_10_1" 3
- (and (and (and (eq_attr "cpu" "cf_v2")
- (eq_attr "type2" "move_l"))
+(define_insn_reservation "cfv3_alu_10_1" 4
+ (and (and (and (eq_attr "cpu" "cfv3")
+ (eq_attr "type2" "alu"))
(eq (symbol_ref "get_attr_size (insn)") (const_int 1)))
(eq_attr "op_mem" "10"))
- "cf_v2_ib1+cf_v2_move_l_10")
+ "cf_ib1+cfv3_alu_10")
-(define_insn_reservation "cf_v2_move_l_10_2" 3
- (and (and (and (eq_attr "cpu" "cf_v2")
- (eq_attr "type2" "move_l"))
+(define_insn_reservation "cfv3_alu_10_2" 4
+ (and (and (and (eq_attr "cpu" "cfv3")
+ (eq_attr "type2" "alu"))
(eq (symbol_ref "get_attr_size (insn)") (const_int 2)))
(eq_attr "op_mem" "10"))
- "cf_v2_ib2+cf_v2_move_l_10")
+ "cf_ib2+cfv3_alu_10")
-(define_insn_reservation "cf_v2_move_l_10_3" 3
- (and (and (and (eq_attr "cpu" "cf_v2")
- (eq_attr "type2" "move_l"))
+(define_insn_reservation "cfv3_alu_10_3" 4
+ (and (and (and (eq_attr "cpu" "cfv3")
+ (eq_attr "type2" "alu"))
(eq (symbol_ref "get_attr_size (insn)") (const_int 3)))
(eq_attr "op_mem" "10"))
- "cf_v2_ib3+cf_v2_move_l_10")
+ "cf_ib3+cfv3_alu_10")
+
+(define_insn_reservation "cfv3_omove_10_1" 3
+ (and (and (and (eq_attr "cpu" "cfv3")
+ (eq_attr "type2" "omove"))
+ (eq (symbol_ref "get_attr_size (insn)") (const_int 1)))
+ (eq_attr "op_mem" "10"))
+ "cf_ib1+cfv3_omove_10")
+
+(define_insn_reservation "cfv3_omove_10_2" 3
+ (and (and (and (eq_attr "cpu" "cfv3")
+ (eq_attr "type2" "omove"))
+ (eq (symbol_ref "get_attr_size (insn)") (const_int 2)))
+ (eq_attr "op_mem" "10"))
+ "cf_ib2+cfv3_omove_10")
+
+(define_insn_reservation "cfv3_omove_10_3" 3
+ (and (and (and (eq_attr "cpu" "cfv3")
+ (eq_attr "type2" "omove"))
+ (eq (symbol_ref "get_attr_size (insn)") (const_int 3)))
+ (eq_attr "op_mem" "10"))
+ "cf_ib3+cfv3_omove_10")
+
+(define_insn_reservation "cfv12_alu_i0_2" 4
+ (and (and (and (eq_attr "cpu" "cfv1,cfv2")
+ (eq_attr "type2" "alu"))
+ (eq (symbol_ref "get_attr_size (insn)") (const_int 2)))
+ (eq_attr "op_mem" "i0"))
+ "cf_ib2+cfv12_alu_i0")
+
+(define_insn_reservation "cfv12_alu_i0_3" 4
+ (and (and (and (eq_attr "cpu" "cfv1,cfv2")
+ (eq_attr "type2" "alu"))
+ (eq (symbol_ref "get_attr_size (insn)") (const_int 3)))
+ (eq_attr "op_mem" "i0"))
+ "cf_ib3+cfv12_alu_i0")
-(define_insn_reservation "cf_v2_move_i0_2" 5
- (and (and (and (eq_attr "cpu" "cf_v2")
- (eq_attr "type2" "alu_l,move"))
+(define_insn_reservation "cfv12_omove_i0_2" 3
+ (and (and (and (eq_attr "cpu" "cfv1,cfv2")
+ (eq_attr "type2" "omove"))
(eq (symbol_ref "get_attr_size (insn)") (const_int 2)))
(eq_attr "op_mem" "i0"))
- "cf_v2_ib2+cf_v2_move_i0")
+ "cf_ib2+cfv12_omove_i0")
-(define_insn_reservation "cf_v2_move_i0_3" 5
- (and (and (and (eq_attr "cpu" "cf_v2")
- (eq_attr "type2" "alu_l,move"))
+(define_insn_reservation "cfv12_omove_i0_3" 3
+ (and (and (and (eq_attr "cpu" "cfv1,cfv2")
+ (eq_attr "type2" "omove"))
(eq (symbol_ref "get_attr_size (insn)") (const_int 3)))
(eq_attr "op_mem" "i0"))
- "cf_v2_ib3+cf_v2_move_i0")
+ "cf_ib3+cfv12_omove_i0")
-(define_insn_reservation "cf_v2_move_l_i0_2" 4
- (and (and (and (eq_attr "cpu" "cf_v2")
- (eq_attr "type2" "move_l"))
+(define_insn_reservation "cfv3_alu_i0_2" 5
+ (and (and (and (eq_attr "cpu" "cfv3")
+ (eq_attr "type2" "alu"))
(eq (symbol_ref "get_attr_size (insn)") (const_int 2)))
(eq_attr "op_mem" "i0"))
- "cf_v2_ib2+cf_v2_move_l_i0")
+ "cf_ib2+cfv3_alu_i0")
-(define_insn_reservation "cf_v2_move_l_i0_3" 4
- (and (and (and (eq_attr "cpu" "cf_v2")
- (eq_attr "type2" "move_l"))
+(define_insn_reservation "cfv3_alu_i0_3" 5
+ (and (and (and (eq_attr "cpu" "cfv3")
+ (eq_attr "type2" "alu"))
(eq (symbol_ref "get_attr_size (insn)") (const_int 3)))
(eq_attr "op_mem" "i0"))
- "cf_v2_ib3+cf_v2_move_l_i0")
+ "cf_ib3+cfv3_alu_i0")
+
+(define_insn_reservation "cfv3_omove_i0_2" 4
+ (and (and (and (eq_attr "cpu" "cfv3")
+ (eq_attr "type2" "omove"))
+ (eq (symbol_ref "get_attr_size (insn)") (const_int 2)))
+ (eq_attr "op_mem" "i0"))
+ "cf_ib2+cfv3_omove_i0")
-(define_insn_reservation "cf_v2_move_01_1" 0
- (and (and (and (eq_attr "cpu" "cf_v2")
- (eq_attr "type2" "alu_l,move,move_l"))
+(define_insn_reservation "cfv3_omove_i0_3" 4
+ (and (and (and (eq_attr "cpu" "cfv3")
+ (eq_attr "type2" "omove"))
+ (eq (symbol_ref "get_attr_size (insn)") (const_int 3)))
+ (eq_attr "op_mem" "i0"))
+ "cf_ib3+cfv3_omove_i0")
+
+(define_insn_reservation "cfv12_alu_01_1" 0
+ (and (and (and (eq_attr "cpu" "cfv1,cfv2")
+ (eq_attr "type2" "alu,omove"))
(eq (symbol_ref "get_attr_size (insn)") (const_int 1)))
(eq_attr "op_mem" "01"))
- "cf_v2_ib1+cf_v2_move_01")
+ "cf_ib1+cfv12_alu_01")
-(define_insn_reservation "cf_v2_move_01_2" 0
- (and (and (and (eq_attr "cpu" "cf_v2")
- (eq_attr "type2" "alu_l,move,move_l"))
+(define_insn_reservation "cfv12_alu_01_2" 0
+ (and (and (and (eq_attr "cpu" "cfv1,cfv2")
+ (eq_attr "type2" "alu,omove"))
(eq (symbol_ref "get_attr_size (insn)") (const_int 2)))
(eq_attr "op_mem" "01"))
- "cf_v2_ib2+cf_v2_move_01")
+ "cf_ib2+cfv12_alu_01")
-(define_insn_reservation "cf_v2_move_01_3" 0
- (and (and (and (eq_attr "cpu" "cf_v2")
- (eq_attr "type2" "alu_l,move,move_l"))
+(define_insn_reservation "cfv12_alu_01_3" 0
+ (and (and (and (eq_attr "cpu" "cfv1,cfv2")
+ (eq_attr "type2" "alu,omove"))
(eq (symbol_ref "get_attr_size (insn)") (const_int 3)))
(eq_attr "op_mem" "01"))
- "cf_v2_ib3+cf_v2_move_01")
+ "cf_ib3+cfv12_alu_01")
+
+(define_insn_reservation "cfv3_alu_01_1" 0
+ (and (and (and (eq_attr "cpu" "cfv3")
+ (eq_attr "type2" "alu,omove"))
+ (eq (symbol_ref "get_attr_size (insn)") (const_int 1)))
+ (eq_attr "op_mem" "01"))
+ "cf_ib1+cfv3_alu_01")
+
+(define_insn_reservation "cfv3_alu_01_2" 0
+ (and (and (and (eq_attr "cpu" "cfv3")
+ (eq_attr "type2" "alu,omove"))
+ (eq (symbol_ref "get_attr_size (insn)") (const_int 2)))
+ (eq_attr "op_mem" "01"))
+ "cf_ib2+cfv3_alu_01")
+
+(define_insn_reservation "cfv3_alu_01_3" 0
+ (and (and (and (eq_attr "cpu" "cfv3")
+ (eq_attr "type2" "alu,omove"))
+ (eq (symbol_ref "get_attr_size (insn)") (const_int 3)))
+ (eq_attr "op_mem" "01"))
+ "cf_ib3+cfv3_alu_01")
+
+(define_insn_reservation "cfv12_alu_0i_2" 0
+ (and (and (and (eq_attr "cpu" "cfv1,cfv2")
+ (eq_attr "type2" "alu,omove"))
+ (eq (symbol_ref "get_attr_size (insn)") (const_int 2)))
+ (eq_attr "op_mem" "0i"))
+ "cf_ib2+cfv12_alu_0i")
+
+(define_insn_reservation "cfv12_alu_0i_3" 0
+ (and (and (and (eq_attr "cpu" "cfv1,cfv2")
+ (eq_attr "type2" "alu,omove"))
+ (eq (symbol_ref "get_attr_size (insn)") (const_int 3)))
+ (eq_attr "op_mem" "0i"))
+ "cf_ib3+cfv12_alu_0i")
-(define_insn_reservation "cf_v2_move_0i_2" 0
- (and (and (and (eq_attr "cpu" "cf_v2")
- (eq_attr "type2" "alu_l,move,move_l"))
+(define_insn_reservation "cfv3_alu_0i_2" 0
+ (and (and (and (eq_attr "cpu" "cfv3")
+ (eq_attr "type2" "alu,omove"))
(eq (symbol_ref "get_attr_size (insn)") (const_int 2)))
(eq_attr "op_mem" "0i"))
- "cf_v2_ib2+cf_v2_move_0i")
+ "cf_ib2+cfv3_alu_0i")
-(define_insn_reservation "cf_v2_move_0i_3" 0
- (and (and (and (eq_attr "cpu" "cf_v2")
- (eq_attr "type2" "alu_l,move,move_l"))
+(define_insn_reservation "cfv3_alu_0i_3" 0
+ (and (and (and (eq_attr "cpu" "cfv3")
+ (eq_attr "type2" "alu,omove"))
(eq (symbol_ref "get_attr_size (insn)") (const_int 3)))
(eq_attr "op_mem" "0i"))
- "cf_v2_ib3+cf_v2_move_0i")
+ "cf_ib3+cfv3_alu_0i")
-(define_insn_reservation "cf_v2_move_11_1" 0
- (and (and (and (eq_attr "cpu" "cf_v2")
- (eq_attr "type2" "alu_l,move"))
+(define_insn_reservation "cfv12_alu_11_1" 0
+ (and (and (and (eq_attr "cpu" "cfv1,cfv2")
+ (eq_attr "type2" "alu"))
(eq (symbol_ref "get_attr_size (insn)") (const_int 1)))
(eq_attr "op_mem" "11"))
- "cf_v2_ib1+cf_v2_move_11")
+ "cf_ib1+cfv12_alu_11")
-(define_insn_reservation "cf_v2_move_11_2" 0
- (and (and (and (eq_attr "cpu" "cf_v2")
- (eq_attr "type2" "alu_l,move"))
+(define_insn_reservation "cfv12_alu_11_2" 0
+ (and (and (and (eq_attr "cpu" "cfv1,cfv2")
+ (eq_attr "type2" "alu"))
(eq (symbol_ref "get_attr_size (insn)") (const_int 2)))
(eq_attr "op_mem" "11"))
- "cf_v2_ib2+cf_v2_move_11")
+ "cf_ib2+cfv12_alu_11")
-(define_insn_reservation "cf_v2_move_11_3" 0
- (and (and (and (eq_attr "cpu" "cf_v2")
- (eq_attr "type2" "alu_l,move"))
+(define_insn_reservation "cfv12_alu_11_3" 0
+ (and (and (and (eq_attr "cpu" "cfv1,cfv2")
+ (eq_attr "type2" "alu"))
(eq (symbol_ref "get_attr_size (insn)") (const_int 3)))
(eq_attr "op_mem" "11"))
- "cf_v2_ib3+cf_v2_move_11")
+ "cf_ib3+cfv12_alu_11")
-(define_insn_reservation "cf_v2_move_l_11_1" 0
- (and (and (and (eq_attr "cpu" "cf_v2")
- (eq_attr "type2" "move_l"))
+(define_insn_reservation "cfv12_omove_11_1" 0
+ (and (and (and (eq_attr "cpu" "cfv1,cfv2")
+ (eq_attr "type2" "omove"))
(eq (symbol_ref "get_attr_size (insn)") (const_int 1)))
(eq_attr "op_mem" "11"))
- "cf_v2_ib1+cf_v2_move_l_11")
+ "cf_ib1+cfv12_omove_11")
-(define_insn_reservation "cf_v2_move_l_11_2" 0
- (and (and (and (eq_attr "cpu" "cf_v2")
- (eq_attr "type2" "move_l"))
+(define_insn_reservation "cfv12_omove_11_2" 0
+ (and (and (and (eq_attr "cpu" "cfv1,cfv2")
+ (eq_attr "type2" "omove"))
(eq (symbol_ref "get_attr_size (insn)") (const_int 2)))
(eq_attr "op_mem" "11"))
- "cf_v2_ib2+cf_v2_move_l_11")
+ "cf_ib2+cfv12_omove_11")
-(define_insn_reservation "cf_v2_move_l_11_3" 0
- (and (and (and (eq_attr "cpu" "cf_v2")
- (eq_attr "type2" "move_l"))
+(define_insn_reservation "cfv12_omove_11_3" 0
+ (and (and (and (eq_attr "cpu" "cfv1,cfv2")
+ (eq_attr "type2" "omove"))
(eq (symbol_ref "get_attr_size (insn)") (const_int 3)))
(eq_attr "op_mem" "11"))
- "cf_v2_ib3+cf_v2_move_l_11")
+ "cf_ib3+cfv12_omove_11")
+
+(define_insn_reservation "cfv3_alu_11_1" 0
+ (and (and (and (eq_attr "cpu" "cfv3")
+ (eq_attr "type2" "alu"))
+ (eq (symbol_ref "get_attr_size (insn)") (const_int 1)))
+ (eq_attr "op_mem" "11"))
+ "cf_ib1+cfv3_alu_11")
+
+(define_insn_reservation "cfv3_alu_11_2" 0
+ (and (and (and (eq_attr "cpu" "cfv3")
+ (eq_attr "type2" "alu"))
+ (eq (symbol_ref "get_attr_size (insn)") (const_int 2)))
+ (eq_attr "op_mem" "11"))
+ "cf_ib2+cfv3_alu_11")
+
+(define_insn_reservation "cfv3_alu_11_3" 0
+ (and (and (and (eq_attr "cpu" "cfv3")
+ (eq_attr "type2" "alu"))
+ (eq (symbol_ref "get_attr_size (insn)") (const_int 3)))
+ (eq_attr "op_mem" "11"))
+ "cf_ib3+cfv3_alu_11")
+
+(define_insn_reservation "cfv3_omove_11_1" 0
+ (and (and (and (eq_attr "cpu" "cfv3")
+ (eq_attr "type2" "omove"))
+ (eq (symbol_ref "get_attr_size (insn)") (const_int 1)))
+ (eq_attr "op_mem" "11"))
+ "cf_ib1+cfv3_omove_11")
+
+(define_insn_reservation "cfv3_omove_11_2" 0
+ (and (and (and (eq_attr "cpu" "cfv3")
+ (eq_attr "type2" "omove"))
+ (eq (symbol_ref "get_attr_size (insn)") (const_int 2)))
+ (eq_attr "op_mem" "11"))
+ "cf_ib2+cfv3_omove_11")
+
+(define_insn_reservation "cfv3_omove_11_3" 0
+ (and (and (and (eq_attr "cpu" "cfv3")
+ (eq_attr "type2" "omove"))
+ (eq (symbol_ref "get_attr_size (insn)") (const_int 3)))
+ (eq_attr "op_mem" "11"))
+ "cf_ib3+cfv3_omove_11")
+
+(define_insn_reservation "cfv12_alu_i1_2" 0
+ (and (and (and (eq_attr "cpu" "cfv1,cfv2")
+ (eq_attr "type2" "alu"))
+ (eq (symbol_ref "get_attr_size (insn)") (const_int 2)))
+ (eq_attr "op_mem" "i1"))
+ "cf_ib2+cfv12_alu_i1")
+
+(define_insn_reservation "cfv12_alu_i1_3" 0
+ (and (and (and (eq_attr "cpu" "cfv1,cfv2")
+ (eq_attr "type2" "alu"))
+ (eq (symbol_ref "get_attr_size (insn)") (const_int 3)))
+ (eq_attr "op_mem" "i1"))
+ "cf_ib3+cfv12_alu_i1")
-(define_insn_reservation "cf_v2_move_i1_2" 0
- (and (and (and (eq_attr "cpu" "cf_v2")
- (eq_attr "type2" "alu_l,move"))
+(define_insn_reservation "cfv12_omove_i1_2" 0
+ (and (and (and (eq_attr "cpu" "cfv1,cfv2")
+ (eq_attr "type2" "omove"))
(eq (symbol_ref "get_attr_size (insn)") (const_int 2)))
(eq_attr "op_mem" "i1"))
- "cf_v2_ib2+cf_v2_move_i1")
+ "cf_ib2+cfv12_omove_i1")
-(define_insn_reservation "cf_v2_move_i1_3" 0
- (and (and (and (eq_attr "cpu" "cf_v2")
- (eq_attr "type2" "alu_l,move"))
+(define_insn_reservation "cfv12_omove_i1_3" 0
+ (and (and (and (eq_attr "cpu" "cfv1,cfv2")
+ (eq_attr "type2" "omove"))
(eq (symbol_ref "get_attr_size (insn)") (const_int 3)))
(eq_attr "op_mem" "i1"))
- "cf_v2_ib3+cf_v2_move_i1")
+ "cf_ib3+cfv12_omove_i1")
-(define_insn_reservation "cf_v2_move_l_i1_2" 0
- (and (and (and (eq_attr "cpu" "cf_v2")
- (eq_attr "type2" "move_l"))
+(define_insn_reservation "cfv3_alu_i1_2" 0
+ (and (and (and (eq_attr "cpu" "cfv3")
+ (eq_attr "type2" "alu"))
(eq (symbol_ref "get_attr_size (insn)") (const_int 2)))
(eq_attr "op_mem" "i1"))
- "cf_v2_ib2+cf_v2_move_l_i1")
+ "cf_ib2+cfv3_alu_i1")
-(define_insn_reservation "cf_v2_move_l_i1_3" 0
- (and (and (and (eq_attr "cpu" "cf_v2")
- (eq_attr "type2" "move_l"))
+(define_insn_reservation "cfv3_alu_i1_3" 0
+ (and (and (and (eq_attr "cpu" "cfv3")
+ (eq_attr "type2" "alu"))
(eq (symbol_ref "get_attr_size (insn)") (const_int 3)))
(eq_attr "op_mem" "i1"))
- "cf_v2_ib3+cf_v2_move_l_i1")
+ "cf_ib3+cfv3_alu_i1")
+
+(define_insn_reservation "cfv3_omove_i1_2" 0
+ (and (and (and (eq_attr "cpu" "cfv3")
+ (eq_attr "type2" "omove"))
+ (eq (symbol_ref "get_attr_size (insn)") (const_int 2)))
+ (eq_attr "op_mem" "i1"))
+ "cf_ib2+cfv3_omove_i1")
+
+(define_insn_reservation "cfv3_omove_i1_3" 0
+ (and (and (and (eq_attr "cpu" "cfv3")
+ (eq_attr "type2" "omove"))
+ (eq (symbol_ref "get_attr_size (insn)") (const_int 3)))
+ (eq_attr "op_mem" "i1"))
+ "cf_ib3+cfv3_omove_i1")
+
+(define_insn_reservation "cfv12_alu_1i_2" 0
+ (and (and (and (eq_attr "cpu" "cfv1,cfv2")
+ (eq_attr "type2" "alu"))
+ (eq (symbol_ref "get_attr_size (insn)") (const_int 2)))
+ (eq_attr "op_mem" "1i"))
+ "cf_ib2+cfv12_alu_1i")
+
+(define_insn_reservation "cfv12_alu_1i_3" 0
+ (and (and (and (eq_attr "cpu" "cfv1,cfv2")
+ (eq_attr "type2" "alu"))
+ (eq (symbol_ref "get_attr_size (insn)") (const_int 3)))
+ (eq_attr "op_mem" "1i"))
+ "cf_ib3+cfv12_alu_1i")
+
+(define_insn_reservation "cfv12_omove_1i_2" 0
+ (and (and (and (eq_attr "cpu" "cfv1,cfv2")
+ (eq_attr "type2" "omove"))
+ (eq (symbol_ref "get_attr_size (insn)") (const_int 2)))
+ (eq_attr "op_mem" "1i"))
+ "cf_ib2+cfv12_omove_1i")
+
+(define_insn_reservation "cfv12_omove_1i_3" 0
+ (and (and (and (eq_attr "cpu" "cfv1,cfv2")
+ (eq_attr "type2" "omove"))
+ (eq (symbol_ref "get_attr_size (insn)") (const_int 3)))
+ (eq_attr "op_mem" "1i"))
+ "cf_ib3+cfv12_omove_1i")
-(define_insn_reservation "cf_v2_move_1i_2" 0
- (and (and (and (eq_attr "cpu" "cf_v2")
- (eq_attr "type2" "alu_l,move"))
+(define_insn_reservation "cfv3_alu_1i_2" 0
+ (and (and (and (eq_attr "cpu" "cfv3")
+ (eq_attr "type2" "alu"))
(eq (symbol_ref "get_attr_size (insn)") (const_int 2)))
(eq_attr "op_mem" "1i"))
- "cf_v2_ib2+cf_v2_move_1i")
+ "cf_ib2+cfv3_alu_1i")
-(define_insn_reservation "cf_v2_move_1i_3" 0
- (and (and (and (eq_attr "cpu" "cf_v2")
- (eq_attr "type2" "alu_l,move"))
+(define_insn_reservation "cfv3_alu_1i_3" 0
+ (and (and (and (eq_attr "cpu" "cfv3")
+ (eq_attr "type2" "alu"))
(eq (symbol_ref "get_attr_size (insn)") (const_int 3)))
(eq_attr "op_mem" "1i"))
- "cf_v2_ib3+cf_v2_move_1i")
+ "cf_ib3+cfv3_alu_1i")
-(define_insn_reservation "cf_v2_move_l_1i_2" 0
- (and (and (and (eq_attr "cpu" "cf_v2")
- (eq_attr "type2" "move_l"))
+(define_insn_reservation "cfv3_omove_1i_2" 0
+ (and (and (and (eq_attr "cpu" "cfv3")
+ (eq_attr "type2" "omove"))
(eq (symbol_ref "get_attr_size (insn)") (const_int 2)))
(eq_attr "op_mem" "1i"))
- "cf_v2_ib2+cf_v2_move_l_1i")
+ "cf_ib2+cfv3_omove_1i")
-(define_insn_reservation "cf_v2_move_l_1i_3" 0
- (and (and (and (eq_attr "cpu" "cf_v2")
- (eq_attr "type2" "move_l"))
+(define_insn_reservation "cfv3_omove_1i_3" 0
+ (and (and (and (eq_attr "cpu" "cfv3")
+ (eq_attr "type2" "omove"))
(eq (symbol_ref "get_attr_size (insn)") (const_int 3)))
(eq_attr "op_mem" "1i"))
- "cf_v2_ib3+cf_v2_move_l_1i")
+ "cf_ib3+cfv3_omove_1i")
-(define_insn_reservation "cf_v2_lea_10_1" 1
- (and (and (and (eq_attr "cpu" "cf_v2")
+(define_insn_reservation "cfv123_lea_10_1" 1
+ (and (and (and (eq_attr "cpu" "cfv1,cfv2,cfv3")
(eq_attr "type2" "lea"))
(eq (symbol_ref "get_attr_size (insn)") (const_int 1)))
(eq_attr "op_mem" "10"))
- "cf_v2_ib1+cf_v2_lea_10")
+ "cf_ib1+cfv123_lea_10")
-(define_insn_reservation "cf_v2_lea_10_2" 1
- (and (and (and (eq_attr "cpu" "cf_v2")
+(define_insn_reservation "cfv123_lea_10_2" 1
+ (and (and (and (eq_attr "cpu" "cfv1,cfv2,cfv3")
(eq_attr "type2" "lea"))
(eq (symbol_ref "get_attr_size (insn)") (const_int 2)))
(eq_attr "op_mem" "10"))
- "cf_v2_ib2+cf_v2_lea_10")
+ "cf_ib2+cfv123_lea_10")
-(define_insn_reservation "cf_v2_lea_10_3" 1
- (and (and (and (eq_attr "cpu" "cf_v2")
+(define_insn_reservation "cfv123_lea_10_3" 1
+ (and (and (and (eq_attr "cpu" "cfv1,cfv2,cfv3")
(eq_attr "type2" "lea"))
(eq (symbol_ref "get_attr_size (insn)") (const_int 3)))
(eq_attr "op_mem" "10"))
- "cf_v2_ib3+cf_v2_lea_10")
+ "cf_ib3+cfv123_lea_10")
-(define_insn_reservation "cf_v2_lea_i0_2" 2
- (and (and (and (eq_attr "cpu" "cf_v2")
+(define_insn_reservation "cfv123_lea_i0_2" 2
+ (and (and (and (eq_attr "cpu" "cfv1,cfv2,cfv3")
(eq_attr "type2" "lea"))
(eq (symbol_ref "get_attr_size (insn)") (const_int 2)))
(eq_attr "op_mem" "i0"))
- "cf_v2_ib2+cf_v2_lea_i0")
+ "cf_ib2+cfv123_lea_i0")
-(define_insn_reservation "cf_v2_lea_i0_3" 2
- (and (and (and (eq_attr "cpu" "cf_v2")
+(define_insn_reservation "cfv123_lea_i0_3" 2
+ (and (and (and (eq_attr "cpu" "cfv1,cfv2,cfv3")
(eq_attr "type2" "lea"))
(eq (symbol_ref "get_attr_size (insn)") (const_int 3)))
(eq_attr "op_mem" "i0"))
- "cf_v2_ib3+cf_v2_lea_i0")
+ "cf_ib3+cfv123_lea_i0")
-(define_insn_reservation "cf_v2_pea_11_1" 0
- (and (and (and (eq_attr "cpu" "cf_v2")
+(define_insn_reservation "cfv12_pea_11_1" 0
+ (and (and (and (eq_attr "cpu" "cfv1,cfv2")
(eq_attr "type2" "pea"))
(eq (symbol_ref "get_attr_size (insn)") (const_int 1)))
(eq_attr "op_mem" "11"))
- "cf_v2_ib1+cf_v2_pea_11")
+ "cf_ib1+cfv12_pea_11")
-(define_insn_reservation "cf_v2_pea_11_2" 0
- (and (and (and (eq_attr "cpu" "cf_v2")
+(define_insn_reservation "cfv12_pea_11_2" 0
+ (and (and (and (eq_attr "cpu" "cfv1,cfv2")
(eq_attr "type2" "pea"))
(eq (symbol_ref "get_attr_size (insn)") (const_int 2)))
(eq_attr "op_mem" "11"))
- "cf_v2_ib2+cf_v2_pea_11")
+ "cf_ib2+cfv12_pea_11")
-(define_insn_reservation "cf_v2_pea_11_3" 0
- (and (and (and (eq_attr "cpu" "cf_v2")
+(define_insn_reservation "cfv12_pea_11_3" 0
+ (and (and (and (eq_attr "cpu" "cfv1,cfv2")
(eq_attr "type2" "pea"))
(eq (symbol_ref "get_attr_size (insn)") (const_int 3)))
(eq_attr "op_mem" "11"))
- "cf_v2_ib3+cf_v2_pea_11")
+ "cf_ib3+cfv12_pea_11")
+
+(define_insn_reservation "cfv3_pea_11_1" 0
+ (and (and (and (eq_attr "cpu" "cfv3")
+ (eq_attr "type2" "pea"))
+ (eq (symbol_ref "get_attr_size (insn)") (const_int 1)))
+ (eq_attr "op_mem" "11"))
+ "cf_ib1+cfv3_pea_11")
+
+(define_insn_reservation "cfv3_pea_11_2" 0
+ (and (and (and (eq_attr "cpu" "cfv3")
+ (eq_attr "type2" "pea"))
+ (eq (symbol_ref "get_attr_size (insn)") (const_int 2)))
+ (eq_attr "op_mem" "11"))
+ "cf_ib2+cfv3_pea_11")
+
+(define_insn_reservation "cfv3_pea_11_3" 0
+ (and (and (and (eq_attr "cpu" "cfv3")
+ (eq_attr "type2" "pea"))
+ (eq (symbol_ref "get_attr_size (insn)") (const_int 3)))
+ (eq_attr "op_mem" "11"))
+ "cf_ib3+cfv3_pea_11")
+
+(define_insn_reservation "cfv12_pea_i1_2" 0
+ (and (and (and (eq_attr "cpu" "cfv1,cfv2")
+ (eq_attr "type2" "pea"))
+ (eq (symbol_ref "get_attr_size (insn)") (const_int 2)))
+ (eq_attr "op_mem" "i1"))
+ "cf_ib2+cfv12_pea_i1")
+
+(define_insn_reservation "cfv12_pea_i1_3" 0
+ (and (and (and (eq_attr "cpu" "cfv1,cfv2")
+ (eq_attr "type2" "pea"))
+ (eq (symbol_ref "get_attr_size (insn)") (const_int 3)))
+ (eq_attr "op_mem" "i1"))
+ "cf_ib3+cfv12_pea_i1")
-(define_insn_reservation "cf_v2_pea_i1_2" 0
- (and (and (and (eq_attr "cpu" "cf_v2")
+(define_insn_reservation "cfv3_pea_i1_2" 0
+ (and (and (and (eq_attr "cpu" "cfv3")
(eq_attr "type2" "pea"))
(eq (symbol_ref "get_attr_size (insn)") (const_int 2)))
(eq_attr "op_mem" "i1"))
- "cf_v2_ib2+cf_v2_pea_i1")
+ "cf_ib2+cfv3_pea_i1")
-(define_insn_reservation "cf_v2_pea_i1_3" 0
- (and (and (and (eq_attr "cpu" "cf_v2")
+(define_insn_reservation "cfv3_pea_i1_3" 0
+ (and (and (and (eq_attr "cpu" "cfv3")
(eq_attr "type2" "pea"))
(eq (symbol_ref "get_attr_size (insn)") (const_int 3)))
(eq_attr "op_mem" "i1"))
- "cf_v2_ib3+cf_v2_pea_i1")
+ "cf_ib3+cfv3_pea_i1")
+
+(define_insn_reservation "cfv123_mul_l_00_1" 18
+ (and (and (and (and (eq_attr "cpu" "cfv1,cfv2,cfv3")
+ (eq_attr "mac" "no"))
+ (eq_attr "type2" "mul_l"))
+ (eq (symbol_ref "get_attr_size (insn)") (const_int 1)))
+ (eq_attr "op_mem" "00"))
+ "cf_ib1+cfv123_mul_l_00")
+
+(define_insn_reservation "cfv123_mul_l_00_2" 18
+ (and (and (and (and (eq_attr "cpu" "cfv1,cfv2,cfv3")
+ (eq_attr "mac" "no"))
+ (eq_attr "type2" "mul_l"))
+ (eq (symbol_ref "get_attr_size (insn)") (const_int 2)))
+ (eq_attr "op_mem" "00"))
+ "cf_ib2+cfv123_mul_l_00")
+
+(define_insn_reservation "cfv123_mul_l_00_3" 18
+ (and (and (and (and (eq_attr "cpu" "cfv1,cfv2,cfv3")
+ (eq_attr "mac" "no"))
+ (eq_attr "type2" "mul_l"))
+ (eq (symbol_ref "get_attr_size (insn)") (const_int 3)))
+ (eq_attr "op_mem" "00"))
+ "cf_ib3+cfv123_mul_l_00")
+
+(define_insn_reservation "cfv123_mul_w_00_1" 9
+ (and (and (and (and (eq_attr "cpu" "cfv1,cfv2,cfv3")
+ (eq_attr "mac" "no"))
+ (eq_attr "type2" "mul_w"))
+ (eq (symbol_ref "get_attr_size (insn)") (const_int 1)))
+ (eq_attr "op_mem" "00"))
+ "cf_ib1+cfv123_mul_w_00")
+
+(define_insn_reservation "cfv123_mul_w_00_2" 9
+ (and (and (and (and (eq_attr "cpu" "cfv1,cfv2,cfv3")
+ (eq_attr "mac" "no"))
+ (eq_attr "type2" "mul_w"))
+ (eq (symbol_ref "get_attr_size (insn)") (const_int 2)))
+ (eq_attr "op_mem" "00"))
+ "cf_ib2+cfv123_mul_w_00")
+
+(define_insn_reservation "cfv123_mul_w_00_3" 9
+ (and (and (and (and (eq_attr "cpu" "cfv1,cfv2,cfv3")
+ (eq_attr "mac" "no"))
+ (eq_attr "type2" "mul_w"))
+ (eq (symbol_ref "get_attr_size (insn)") (const_int 3)))
+ (eq_attr "op_mem" "00"))
+ "cf_ib3+cfv123_mul_w_00")
+
+(define_insn_reservation "cfv12_mul_l_10_1" 20
+ (and (and (and (and (eq_attr "cpu" "cfv1,cfv2")
+ (eq_attr "mac" "no"))
+ (eq_attr "type2" "mul_l"))
+ (eq (symbol_ref "get_attr_size (insn)") (const_int 1)))
+ (eq_attr "op_mem" "10"))
+ "cf_ib1+cfv12_mul_l_10")
-(define_insn_reservation "cf_v2_mul_00_1" 4
- (and (and (and (eq_attr "cpu" "cf_v2")
- (eq_attr "type2" "mul"))
+(define_insn_reservation "cfv12_mul_l_10_2" 20
+ (and (and (and (and (eq_attr "cpu" "cfv1,cfv2")
+ (eq_attr "mac" "no"))
+ (eq_attr "type2" "mul_l"))
+ (eq (symbol_ref "get_attr_size (insn)") (const_int 2)))
+ (eq_attr "op_mem" "10"))
+ "cf_ib2+cfv12_mul_l_10")
+
+(define_insn_reservation "cfv12_mul_l_10_3" 20
+ (and (and (and (and (eq_attr "cpu" "cfv1,cfv2")
+ (eq_attr "mac" "no"))
+ (eq_attr "type2" "mul_l"))
+ (eq (symbol_ref "get_attr_size (insn)") (const_int 3)))
+ (eq_attr "op_mem" "10"))
+ "cf_ib3+cfv12_mul_l_10")
+
+(define_insn_reservation "cfv3_mul_l_10_1" 21
+ (and (and (and (and (eq_attr "cpu" "cfv3")
+ (eq_attr "mac" "no"))
+ (eq_attr "type2" "mul_l"))
+ (eq (symbol_ref "get_attr_size (insn)") (const_int 1)))
+ (eq_attr "op_mem" "10"))
+ "cf_ib1+cfv3_mul_l_10")
+
+(define_insn_reservation "cfv3_mul_l_10_2" 21
+ (and (and (and (and (eq_attr "cpu" "cfv3")
+ (eq_attr "mac" "no"))
+ (eq_attr "type2" "mul_l"))
+ (eq (symbol_ref "get_attr_size (insn)") (const_int 2)))
+ (eq_attr "op_mem" "10"))
+ "cf_ib2+cfv3_mul_l_10")
+
+(define_insn_reservation "cfv3_mul_l_10_3" 21
+ (and (and (and (and (eq_attr "cpu" "cfv3")
+ (eq_attr "mac" "no"))
+ (eq_attr "type2" "mul_l"))
+ (eq (symbol_ref "get_attr_size (insn)") (const_int 3)))
+ (eq_attr "op_mem" "10"))
+ "cf_ib3+cfv3_mul_l_10")
+
+(define_insn_reservation "cfv12_mul_w_10_1" 11
+ (and (and (and (and (eq_attr "cpu" "cfv1,cfv2")
+ (eq_attr "mac" "no"))
+ (eq_attr "type2" "mul_w"))
+ (eq (symbol_ref "get_attr_size (insn)") (const_int 1)))
+ (eq_attr "op_mem" "10"))
+ "cf_ib1+cfv12_mul_w_10")
+
+(define_insn_reservation "cfv12_mul_w_10_2" 11
+ (and (and (and (and (eq_attr "cpu" "cfv1,cfv2")
+ (eq_attr "mac" "no"))
+ (eq_attr "type2" "mul_w"))
+ (eq (symbol_ref "get_attr_size (insn)") (const_int 2)))
+ (eq_attr "op_mem" "10"))
+ "cf_ib2+cfv12_mul_w_10")
+
+(define_insn_reservation "cfv12_mul_w_10_3" 11
+ (and (and (and (and (eq_attr "cpu" "cfv1,cfv2")
+ (eq_attr "mac" "no"))
+ (eq_attr "type2" "mul_w"))
+ (eq (symbol_ref "get_attr_size (insn)") (const_int 3)))
+ (eq_attr "op_mem" "10"))
+ "cf_ib3+cfv12_mul_w_10")
+
+(define_insn_reservation "cfv3_mul_w_10_1" 12
+ (and (and (and (and (eq_attr "cpu" "cfv3")
+ (eq_attr "mac" "no"))
+ (eq_attr "type2" "mul_w"))
+ (eq (symbol_ref "get_attr_size (insn)") (const_int 1)))
+ (eq_attr "op_mem" "10"))
+ "cf_ib1+cfv3_mul_w_10")
+
+(define_insn_reservation "cfv3_mul_w_10_2" 12
+ (and (and (and (and (eq_attr "cpu" "cfv3")
+ (eq_attr "mac" "no"))
+ (eq_attr "type2" "mul_w"))
+ (eq (symbol_ref "get_attr_size (insn)") (const_int 2)))
+ (eq_attr "op_mem" "10"))
+ "cf_ib2+cfv3_mul_w_10")
+
+(define_insn_reservation "cfv3_mul_w_10_3" 12
+ (and (and (and (and (eq_attr "cpu" "cfv3")
+ (eq_attr "mac" "no"))
+ (eq_attr "type2" "mul_w"))
+ (eq (symbol_ref "get_attr_size (insn)") (const_int 3)))
+ (eq_attr "op_mem" "10"))
+ "cf_ib3+cfv3_mul_w_10")
+
+(define_insn_reservation "cfv12_mul_w_i0_2" 12
+ (and (and (and (and (eq_attr "cpu" "cfv1,cfv2")
+ (eq_attr "mac" "no"))
+ (eq_attr "type2" "mul_w"))
+ (eq (symbol_ref "get_attr_size (insn)") (const_int 2)))
+ (eq_attr "op_mem" "i0"))
+ "cf_ib2+cfv12_mul_w_i0")
+
+(define_insn_reservation "cfv12_mul_w_i0_3" 12
+ (and (and (and (and (eq_attr "cpu" "cfv1,cfv2")
+ (eq_attr "mac" "no"))
+ (eq_attr "type2" "mul_w"))
+ (eq (symbol_ref "get_attr_size (insn)") (const_int 3)))
+ (eq_attr "op_mem" "i0"))
+ "cf_ib3+cfv12_mul_w_i0")
+
+
+(define_insn_reservation "cfv3_mul_w_i0_2" 13
+ (and (and (and (and (eq_attr "cpu" "cfv3")
+ (eq_attr "mac" "no"))
+ (eq_attr "type2" "mul_w"))
+ (eq (symbol_ref "get_attr_size (insn)") (const_int 2)))
+ (eq_attr "op_mem" "i0"))
+ "cf_ib2+cfv3_mul_w_i0")
+
+(define_insn_reservation "cfv3_mul_w_i0_3" 13
+ (and (and (and (and (eq_attr "cpu" "cfv3")
+ (eq_attr "mac" "no"))
+ (eq_attr "type2" "mul_w"))
+ (eq (symbol_ref "get_attr_size (insn)") (const_int 3)))
+ (eq_attr "op_mem" "i0"))
+ "cf_ib3+cfv3_mul_w_i0")
+
+(define_insn_reservation "cfv123_mac_l_00_1" 5
+ (and (and (and (and (eq_attr "cpu" "cfv1,cfv2,cfv3")
+ (eq_attr "mac" "cf_mac"))
+ (eq_attr "type2" "mul_l"))
(eq (symbol_ref "get_attr_size (insn)") (const_int 1)))
(eq_attr "op_mem" "00"))
- "cf_v2_ib1+cf_v2_mul_00")
+ "cf_ib1+cfv123_mac_l_00")
-(define_insn_reservation "cf_v2_mul_00_2" 4
- (and (and (and (eq_attr "cpu" "cf_v2")
- (eq_attr "type2" "mul"))
+(define_insn_reservation "cfv123_mac_l_00_2" 5
+ (and (and (and (and (eq_attr "cpu" "cfv1,cfv2,cfv3")
+ (eq_attr "mac" "cf_mac"))
+ (eq_attr "type2" "mul_l"))
(eq (symbol_ref "get_attr_size (insn)") (const_int 2)))
(eq_attr "op_mem" "00"))
- "cf_v2_ib2+cf_v2_mul_00")
+ "cf_ib2+cfv123_mac_l_00")
-(define_insn_reservation "cf_v2_mul_00_3" 4
- (and (and (and (eq_attr "cpu" "cf_v2")
- (eq_attr "type2" "mul"))
+(define_insn_reservation "cfv123_mac_l_00_3" 5
+ (and (and (and (and (eq_attr "cpu" "cfv1,cfv2,cfv3")
+ (eq_attr "mac" "cf_mac"))
+ (eq_attr "type2" "mul_l"))
(eq (symbol_ref "get_attr_size (insn)") (const_int 3)))
(eq_attr "op_mem" "00"))
- "cf_v2_ib3+cf_v2_mul_00")
+ "cf_ib3+cfv123_mac_l_00")
+
+(define_insn_reservation "cfv123_mac_w_00_1" 3
+ (and (and (and (and (eq_attr "cpu" "cfv1,cfv2,cfv3")
+ (eq_attr "mac" "cf_mac"))
+ (eq_attr "type2" "mul_w"))
+ (eq (symbol_ref "get_attr_size (insn)") (const_int 1)))
+ (eq_attr "op_mem" "00"))
+ "cf_ib1+cfv123_mac_w_00")
+
+(define_insn_reservation "cfv123_mac_w_00_2" 3
+ (and (and (and (and (eq_attr "cpu" "cfv1,cfv2,cfv3")
+ (eq_attr "mac" "cf_mac"))
+ (eq_attr "type2" "mul_w"))
+ (eq (symbol_ref "get_attr_size (insn)") (const_int 2)))
+ (eq_attr "op_mem" "00"))
+ "cf_ib2+cfv123_mac_w_00")
+
+(define_insn_reservation "cfv123_mac_w_00_3" 3
+ (and (and (and (and (eq_attr "cpu" "cfv1,cfv2,cfv3")
+ (eq_attr "mac" "cf_mac"))
+ (eq_attr "type2" "mul_w"))
+ (eq (symbol_ref "get_attr_size (insn)") (const_int 3)))
+ (eq_attr "op_mem" "00"))
+ "cf_ib3+cfv123_mac_w_00")
+
+(define_insn_reservation "cfv12_mac_l_10_1" 7
+ (and (and (and (and (eq_attr "cpu" "cfv1,cfv2")
+ (eq_attr "mac" "cf_mac"))
+ (eq_attr "type2" "mul_l"))
+ (eq (symbol_ref "get_attr_size (insn)") (const_int 1)))
+ (eq_attr "op_mem" "10"))
+ "cf_ib1+cfv12_mac_l_10")
+
+(define_insn_reservation "cfv12_mac_l_10_2" 7
+ (and (and (and (and (eq_attr "cpu" "cfv1,cfv2")
+ (eq_attr "mac" "cf_mac"))
+ (eq_attr "type2" "mul_l"))
+ (eq (symbol_ref "get_attr_size (insn)") (const_int 2)))
+ (eq_attr "op_mem" "10"))
+ "cf_ib2+cfv12_mac_l_10")
+
+(define_insn_reservation "cfv12_mac_l_10_3" 7
+ (and (and (and (and (eq_attr "cpu" "cfv1,cfv2")
+ (eq_attr "mac" "cf_mac"))
+ (eq_attr "type2" "mul_l"))
+ (eq (symbol_ref "get_attr_size (insn)") (const_int 3)))
+ (eq_attr "op_mem" "10"))
+ "cf_ib3+cfv12_mac_l_10")
-(define_insn_reservation "cf_v2_mul_10_1" 6
- (and (and (and (eq_attr "cpu" "cf_v2")
- (eq_attr "type2" "mul"))
+(define_insn_reservation "cfv3_mac_l_10_1" 8
+ (and (and (and (and (eq_attr "cpu" "cfv3")
+ (eq_attr "mac" "cf_mac"))
+ (eq_attr "type2" "mul_l"))
(eq (symbol_ref "get_attr_size (insn)") (const_int 1)))
(eq_attr "op_mem" "10"))
- "cf_v2_ib1+cf_v2_mul_10")
+ "cf_ib1+cfv3_mac_l_10")
-(define_insn_reservation "cf_v2_mul_10_2" 6
- (and (and (and (eq_attr "cpu" "cf_v2")
- (eq_attr "type2" "mul"))
+(define_insn_reservation "cfv3_mac_l_10_2" 8
+ (and (and (and (and (eq_attr "cpu" "cfv3")
+ (eq_attr "mac" "cf_mac"))
+ (eq_attr "type2" "mul_l"))
(eq (symbol_ref "get_attr_size (insn)") (const_int 2)))
(eq_attr "op_mem" "10"))
- "cf_v2_ib2+cf_v2_mul_10")
+ "cf_ib2+cfv3_mac_l_10")
-(define_insn_reservation "cf_v2_mul_10_3" 6
- (and (and (and (eq_attr "cpu" "cf_v2")
- (eq_attr "type2" "mul"))
+(define_insn_reservation "cfv3_mac_l_10_3" 8
+ (and (and (and (and (eq_attr "cpu" "cfv3")
+ (eq_attr "mac" "cf_mac"))
+ (eq_attr "type2" "mul_l"))
(eq (symbol_ref "get_attr_size (insn)") (const_int 3)))
(eq_attr "op_mem" "10"))
- "cf_v2_ib3+cf_v2_mul_10")
+ "cf_ib3+cfv3_mac_l_10")
+
+(define_insn_reservation "cfv12_mac_w_10_1" 5
+ (and (and (and (and (eq_attr "cpu" "cfv1,cfv2")
+ (eq_attr "mac" "cf_mac"))
+ (eq_attr "type2" "mul_w"))
+ (eq (symbol_ref "get_attr_size (insn)") (const_int 1)))
+ (eq_attr "op_mem" "10"))
+ "cf_ib1+cfv12_mac_w_10")
-(define_insn_reservation "cf_v2_mul_i0_2" 7
- (and (and (and (eq_attr "cpu" "cf_v2")
- (eq_attr "type2" "mul"))
+(define_insn_reservation "cfv12_mac_w_10_2" 5
+ (and (and (and (and (eq_attr "cpu" "cfv1,cfv2")
+ (eq_attr "mac" "cf_mac"))
+ (eq_attr "type2" "mul_w"))
+ (eq (symbol_ref "get_attr_size (insn)") (const_int 2)))
+ (eq_attr "op_mem" "10"))
+ "cf_ib2+cfv12_mac_w_10")
+
+(define_insn_reservation "cfv12_mac_w_10_3" 5
+ (and (and (and (and (eq_attr "cpu" "cfv1,cfv2")
+ (eq_attr "mac" "cf_mac"))
+ (eq_attr "type2" "mul_w"))
+ (eq (symbol_ref "get_attr_size (insn)") (const_int 3)))
+ (eq_attr "op_mem" "10"))
+ "cf_ib3+cfv12_mac_w_10")
+
+(define_insn_reservation "cfv3_mac_w_10_1" 6
+ (and (and (and (and (eq_attr "cpu" "cfv3")
+ (eq_attr "mac" "cf_mac"))
+ (eq_attr "type2" "mul_w"))
+ (eq (symbol_ref "get_attr_size (insn)") (const_int 1)))
+ (eq_attr "op_mem" "10"))
+ "cf_ib1+cfv3_mac_w_10")
+
+(define_insn_reservation "cfv3_mac_w_10_2" 6
+ (and (and (and (and (eq_attr "cpu" "cfv3")
+ (eq_attr "mac" "cf_mac"))
+ (eq_attr "type2" "mul_w"))
+ (eq (symbol_ref "get_attr_size (insn)") (const_int 2)))
+ (eq_attr "op_mem" "10"))
+ "cf_ib2+cfv3_mac_w_10")
+
+(define_insn_reservation "cfv3_mac_w_10_3" 6
+ (and (and (and (and (eq_attr "cpu" "cfv3")
+ (eq_attr "mac" "cf_mac"))
+ (eq_attr "type2" "mul_w"))
+ (eq (symbol_ref "get_attr_size (insn)") (const_int 3)))
+ (eq_attr "op_mem" "10"))
+ "cf_ib3+cfv3_mac_w_10")
+
+(define_insn_reservation "cfv12_mac_w_i0_2" 6
+ (and (and (and (and (eq_attr "cpu" "cfv1,cfv2")
+ (eq_attr "mac" "cf_mac"))
+ (eq_attr "type2" "mul_w"))
(eq (symbol_ref "get_attr_size (insn)") (const_int 2)))
(eq_attr "op_mem" "i0"))
- "cf_v2_ib2+cf_v2_mul_i0")
+ "cf_ib2+cfv12_mac_w_i0")
-(define_insn_reservation "cf_v2_mul_i0_3" 7
- (and (and (and (eq_attr "cpu" "cf_v2")
- (eq_attr "type2" "mul"))
+(define_insn_reservation "cfv12_mac_w_i0_3" 6
+ (and (and (and (and (eq_attr "cpu" "cfv1,cfv2")
+ (eq_attr "mac" "cf_mac"))
+ (eq_attr "type2" "mul_w"))
(eq (symbol_ref "get_attr_size (insn)") (const_int 3)))
(eq_attr "op_mem" "i0"))
- "cf_v2_ib3+cf_v2_mul_i0")
+ "cf_ib3+cfv12_mac_w_i0")
-;; ??? As return reads target address from stack, use a mem-read reservation
-;; for it.
-(define_reservation "cf_v2_rts" "cf_v2_move_10")
+(define_insn_reservation "cfv3_mac_w_i0_2" 7
+ (and (and (and (and (eq_attr "cpu" "cfv3")
+ (eq_attr "mac" "cf_mac"))
+ (eq_attr "type2" "mul_w"))
+ (eq (symbol_ref "get_attr_size (insn)") (const_int 2)))
+ (eq_attr "op_mem" "i0"))
+ "cf_ib2+cfv3_mac_w_i0")
-;; ??? It's not clear what the core does during these 5 cycles.
-;; Luckily, we don't care that much about an insn that won't be moved.
-(define_insn_reservation "cf_v2_rts_1" 5
- (and (and (eq_attr "cpu" "cf_v2")
+(define_insn_reservation "cfv3_mac_w_i0_3" 7
+ (and (and (and (and (eq_attr "cpu" "cfv3")
+ (eq_attr "mac" "cf_mac"))
+ (eq_attr "type2" "mul_w"))
+ (eq (symbol_ref "get_attr_size (insn)") (const_int 3)))
+ (eq_attr "op_mem" "i0"))
+ "cf_ib3+cfv3_mac_w_i0")
+
+(define_insn_reservation "cfv123_emac_00_1" 4
+ (and (and (and (and (eq_attr "cpu" "cfv1,cfv2,cfv3")
+ (eq_attr "mac" "cf_emac"))
+ (eq_attr "type2" "mul_l,mul_w"))
+ (eq (symbol_ref "get_attr_size (insn)") (const_int 1)))
+ (eq_attr "op_mem" "00"))
+ "cf_ib1+cfv123_emac_00")
+
+(define_insn_reservation "cfv123_emac_00_2" 4
+ (and (and (and (and (eq_attr "cpu" "cfv1,cfv2,cfv3")
+ (eq_attr "mac" "cf_emac"))
+ (eq_attr "type2" "mul_l,mul_w"))
+ (eq (symbol_ref "get_attr_size (insn)") (const_int 2)))
+ (eq_attr "op_mem" "00"))
+ "cf_ib2+cfv123_emac_00")
+
+(define_insn_reservation "cfv123_emac_00_3" 4
+ (and (and (and (and (eq_attr "cpu" "cfv1,cfv2,cfv3")
+ (eq_attr "mac" "cf_emac"))
+ (eq_attr "type2" "mul_l,mul_w"))
+ (eq (symbol_ref "get_attr_size (insn)") (const_int 3)))
+ (eq_attr "op_mem" "00"))
+ "cf_ib3+cfv123_emac_00")
+
+(define_insn_reservation "cfv12_emac_10_1" 6
+ (and (and (and (and (eq_attr "cpu" "cfv1,cfv2")
+ (eq_attr "mac" "cf_emac"))
+ (eq_attr "type2" "mul_l,mul_w"))
+ (eq (symbol_ref "get_attr_size (insn)") (const_int 1)))
+ (eq_attr "op_mem" "10"))
+ "cf_ib1+cfv12_emac_10")
+
+(define_insn_reservation "cfv12_emac_10_2" 6
+ (and (and (and (and (eq_attr "cpu" "cfv1,cfv2")
+ (eq_attr "mac" "cf_emac"))
+ (eq_attr "type2" "mul_l,mul_w"))
+ (eq (symbol_ref "get_attr_size (insn)") (const_int 2)))
+ (eq_attr "op_mem" "10"))
+ "cf_ib2+cfv12_emac_10")
+
+(define_insn_reservation "cfv12_emac_10_3" 6
+ (and (and (and (and (eq_attr "cpu" "cfv1,cfv2")
+ (eq_attr "mac" "cf_emac"))
+ (eq_attr "type2" "mul_l,mul_w"))
+ (eq (symbol_ref "get_attr_size (insn)") (const_int 3)))
+ (eq_attr "op_mem" "10"))
+ "cf_ib3+cfv12_emac_10")
+
+(define_insn_reservation "cfv3_emac_10_1" 7
+ (and (and (and (and (eq_attr "cpu" "cfv3")
+ (eq_attr "mac" "cf_emac"))
+ (eq_attr "type2" "mul_l,mul_w"))
+ (eq (symbol_ref "get_attr_size (insn)") (const_int 1)))
+ (eq_attr "op_mem" "10"))
+ "cf_ib1+cfv3_emac_10")
+
+(define_insn_reservation "cfv3_emac_10_2" 7
+ (and (and (and (and (eq_attr "cpu" "cfv3")
+ (eq_attr "mac" "cf_emac"))
+ (eq_attr "type2" "mul_l,mul_w"))
+ (eq (symbol_ref "get_attr_size (insn)") (const_int 2)))
+ (eq_attr "op_mem" "10"))
+ "cf_ib2+cfv3_emac_10")
+
+(define_insn_reservation "cfv3_emac_10_3" 7
+ (and (and (and (and (eq_attr "cpu" "cfv3")
+ (eq_attr "mac" "cf_emac"))
+ (eq_attr "type2" "mul_l,mul_w"))
+ (eq (symbol_ref "get_attr_size (insn)") (const_int 3)))
+ (eq_attr "op_mem" "10"))
+ "cf_ib3+cfv3_emac_10")
+
+(define_insn_reservation "cfv12_emac_w_i0_2" 7
+ (and (and (and (and (eq_attr "cpu" "cfv1,cfv2")
+ (eq_attr "mac" "cf_emac"))
+ (eq_attr "type2" "mul_w"))
+ (eq (symbol_ref "get_attr_size (insn)") (const_int 2)))
+ (eq_attr "op_mem" "i0"))
+ "cf_ib2+cfv12_emac_w_i0")
+
+(define_insn_reservation "cfv12_emac_w_i0_3" 7
+ (and (and (and (and (eq_attr "cpu" "cfv1,cfv2")
+ (eq_attr "mac" "cf_emac"))
+ (eq_attr "type2" "mul_w"))
+ (eq (symbol_ref "get_attr_size (insn)") (const_int 3)))
+ (eq_attr "op_mem" "i0"))
+ "cf_ib3+cfv12_emac_w_i0")
+
+(define_insn_reservation "cfv3_emac_w_i0_2" 8
+ (and (and (and (and (eq_attr "cpu" "cfv3")
+ (eq_attr "mac" "cf_emac"))
+ (eq_attr "type2" "mul_w"))
+ (eq (symbol_ref "get_attr_size (insn)") (const_int 2)))
+ (eq_attr "op_mem" "i0"))
+ "cf_ib2+cfv3_emac_w_i0")
+
+(define_insn_reservation "cfv3_emac_w_i0_3" 8
+ (and (and (and (and (eq_attr "cpu" "cfv3")
+ (eq_attr "mac" "cf_emac"))
+ (eq_attr "type2" "mul_w"))
+ (eq (symbol_ref "get_attr_size (insn)") (const_int 3)))
+ (eq_attr "op_mem" "i0"))
+ "cf_ib3+cfv3_emac_w_i0")
+
+(define_insn_reservation "cfv12_rts_1" 5
+ (and (and (eq_attr "cpu" "cfv1,cfv2")
(eq_attr "type2" "rts"))
(eq (symbol_ref "get_attr_size (insn)") (const_int 1)))
- "cf_v2_ib1+cf_v2_rts")
+ "cf_ib1+cfv12_rts")
-;; Call instructions reservations.
+(define_insn_reservation "cfv3_rts_1" 8
+ (and (and (eq_attr "cpu" "cfv3")
+ (eq_attr "type2" "rts"))
+ (eq (symbol_ref "get_attr_size (insn)") (const_int 1)))
+ "cf_ib1+cfv3_rts")
-;; ??? It's not clear what reservation is best to use for calls.
-;; For now we use mem-write + return reservations to reflect the fact of
-;; pushing and poping return address to and from the stack.
+(define_insn_reservation "cfv12_call_1" 3
+ (and (and (eq_attr "cpu" "cfv1,cfv2")
+ (eq_attr "type2" "call"))
+ (eq (symbol_ref "get_attr_size (insn)") (const_int 1)))
+ "cf_ib1+cfv12_call")
-(define_insn_reservation "cf_v2_call_1" 3
- (and (and (eq_attr "cpu" "cf_v2")
+(define_insn_reservation "cfv12_call_2" 3
+ (and (and (eq_attr "cpu" "cfv1,cfv2")
+ (eq_attr "type2" "call"))
+ (eq (symbol_ref "get_attr_size (insn)") (const_int 2)))
+ "cf_ib2+cfv12_call")
+
+(define_insn_reservation "cfv12_call_3" 3
+ (and (and (eq_attr "cpu" "cfv1,cfv2")
+ (eq_attr "type2" "call"))
+ (eq (symbol_ref "get_attr_size (insn)") (const_int 3)))
+ "cf_ib3+cfv12_call")
+
+(define_insn_reservation "cfv3_call_1" 1
+ (and (and (eq_attr "cpu" "cfv3")
(eq_attr "type2" "call"))
(eq (symbol_ref "get_attr_size (insn)") (const_int 1)))
- "cf_v2_ib1+cf_v2_move_10,cf_v2_rts")
+ "cf_ib1+cfv3_call")
-(define_insn_reservation "cf_v2_call_2" 3
- (and (and (eq_attr "cpu" "cf_v2")
+(define_insn_reservation "cfv3_call_2" 1
+ (and (and (eq_attr "cpu" "cfv3")
(eq_attr "type2" "call"))
(eq (symbol_ref "get_attr_size (insn)") (const_int 2)))
- "cf_v2_ib2+cf_v2_move_10,cf_v2_rts")
+ "cf_ib2+cfv3_call")
-(define_insn_reservation "cf_v2_call_3" 3
- (and (and (eq_attr "cpu" "cf_v2")
+(define_insn_reservation "cfv3_call_3" 1
+ (and (and (eq_attr "cpu" "cfv3")
(eq_attr "type2" "call"))
(eq (symbol_ref "get_attr_size (insn)") (const_int 3)))
- "cf_v2_ib3+cf_v2_move_10,cf_v2_rts")
+ "cf_ib3+cfv3_call")
-;; Branch reservations.
+(define_insn_reservation "cfv12_bcc_1" 2
+ (and (and (eq_attr "cpu" "cfv1,cfv2")
+ (eq_attr "type2" "bcc"))
+ (eq (symbol_ref "get_attr_size (insn)") (const_int 1)))
+ "cf_ib1+cfv12_bcc")
-;; ??? Branch reservations are unclear to me so far. Luckily, we don't care
-;; ??? that much about branches.
-(define_reservation "cf_v2_bcc" "cf_v2_move_00")
+(define_insn_reservation "cfv12_bcc_2" 2
+ (and (and (eq_attr "cpu" "cfv1,cfv2")
+ (eq_attr "type2" "bcc"))
+ (eq (symbol_ref "get_attr_size (insn)") (const_int 2)))
+ "cf_ib2+cfv12_bcc")
+
+(define_insn_reservation "cfv12_bcc_3" 2
+ (and (and (eq_attr "cpu" "cfv1,cfv2")
+ (eq_attr "type2" "bcc"))
+ (eq (symbol_ref "get_attr_size (insn)") (const_int 3)))
+ "cf_ib3+cfv12_bcc")
-(define_insn_reservation "cf_v2_bcc_1" 2
- (and (and (eq_attr "cpu" "cf_v2")
+(define_insn_reservation "cfv3_bcc_1" 1
+ (and (and (eq_attr "cpu" "cfv3")
(eq_attr "type2" "bcc"))
(eq (symbol_ref "get_attr_size (insn)") (const_int 1)))
- "cf_v2_ib1+cf_v2_bcc")
+ "cf_ib1+cfv3_bcc")
-(define_insn_reservation "cf_v2_bcc_2" 2
- (and (and (eq_attr "cpu" "cf_v2")
+(define_insn_reservation "cfv3_bcc_2" 1
+ (and (and (eq_attr "cpu" "cfv3")
(eq_attr "type2" "bcc"))
(eq (symbol_ref "get_attr_size (insn)") (const_int 2)))
- "cf_v2_ib2+cf_v2_bcc")
+ "cf_ib2+cfv3_bcc")
-(define_insn_reservation "cf_v2_bcc_3" 2
- (and (and (eq_attr "cpu" "cf_v2")
+(define_insn_reservation "cfv3_bcc_3" 1
+ (and (and (eq_attr "cpu" "cfv3")
(eq_attr "type2" "bcc"))
(eq (symbol_ref "get_attr_size (insn)") (const_int 3)))
- "cf_v2_ib3+cf_v2_bcc")
+ "cf_ib3+cfv3_bcc")
+
+(define_insn_reservation "cfv12_bra_1" 2
+ (and (and (eq_attr "cpu" "cfv1,cfv2")
+ (eq_attr "type2" "bra"))
+ (eq (symbol_ref "get_attr_size (insn)") (const_int 1)))
+ "cf_ib1+cfv12_bra")
-(define_reservation "cf_v2_bra" "cf_v2_move_01")
+(define_insn_reservation "cfv12_bra_2" 2
+ (and (and (eq_attr "cpu" "cfv1,cfv2")
+ (eq_attr "type2" "bra"))
+ (eq (symbol_ref "get_attr_size (insn)") (const_int 2)))
+ "cf_ib2+cfv12_bra")
-(define_insn_reservation "cf_v2_bra_1" 2
- (and (and (eq_attr "cpu" "cf_v2")
+(define_insn_reservation "cfv12_bra_3" 2
+ (and (and (eq_attr "cpu" "cfv1,cfv2")
+ (eq_attr "type2" "bra"))
+ (eq (symbol_ref "get_attr_size (insn)") (const_int 3)))
+ "cf_ib3+cfv12_bra")
+
+(define_insn_reservation "cfv3_bra_1" 1
+ (and (and (eq_attr "cpu" "cfv3")
(eq_attr "type2" "bra"))
(eq (symbol_ref "get_attr_size (insn)") (const_int 1)))
- "cf_v2_ib1+cf_v2_bra")
+ "cf_ib1+cfv3_bra")
-(define_insn_reservation "cf_v2_bra_2" 2
- (and (and (eq_attr "cpu" "cf_v2")
+(define_insn_reservation "cfv3_bra_2" 1
+ (and (and (eq_attr "cpu" "cfv3")
(eq_attr "type2" "bra"))
(eq (symbol_ref "get_attr_size (insn)") (const_int 2)))
- "cf_v2_ib2+cf_v2_bra")
+ "cf_ib2+cfv3_bra")
-(define_insn_reservation "cf_v2_bra_3" 2
- (and (and (eq_attr "cpu" "cf_v2")
+(define_insn_reservation "cfv3_bra_3" 1
+ (and (and (eq_attr "cpu" "cfv3")
(eq_attr "type2" "bra"))
(eq (symbol_ref "get_attr_size (insn)") (const_int 3)))
- "cf_v2_ib3+cf_v2_bra")
+ "cf_ib3+cfv3_bra")
-;; Computed jump.
-;; Takes 3 cycles.
-(define_reservation "cf_v2_jmp"
- "cf_v2_dsoc,cf_v2_agex,cf_v2_dsoc,cf_v2_agex")
+(define_insn_reservation "cfv12_jmp_1" 3
+ (and (and (eq_attr "cpu" "cfv1,cfv2")
+ (eq_attr "type2" "jmp"))
+ (eq (symbol_ref "get_attr_size (insn)") (const_int 1)))
+ "cf_ib1+cfv12_jmp")
+
+(define_insn_reservation "cfv12_jmp_2" 3
+ (and (and (eq_attr "cpu" "cfv1,cfv2")
+ (eq_attr "type2" "jmp"))
+ (eq (symbol_ref "get_attr_size (insn)") (const_int 2)))
+ "cf_ib2+cfv12_jmp")
+
+(define_insn_reservation "cfv12_jmp_3" 3
+ (and (and (eq_attr "cpu" "cfv1,cfv2")
+ (eq_attr "type2" "jmp"))
+ (eq (symbol_ref "get_attr_size (insn)") (const_int 3)))
+ "cf_ib3+cfv12_jmp")
-(define_insn_reservation "cf_v2_jmp_1" 3
- (and (and (eq_attr "cpu" "cf_v2")
+(define_insn_reservation "cfv3_jmp_1" 5
+ (and (and (eq_attr "cpu" "cfv3")
(eq_attr "type2" "jmp"))
(eq (symbol_ref "get_attr_size (insn)") (const_int 1)))
- "cf_v2_ib1+cf_v2_jmp")
+ "cf_ib1+cfv3_jmp")
-(define_insn_reservation "cf_v2_jmp_2" 3
- (and (and (eq_attr "cpu" "cf_v2")
+(define_insn_reservation "cfv3_jmp_2" 5
+ (and (and (eq_attr "cpu" "cfv3")
(eq_attr "type2" "jmp"))
(eq (symbol_ref "get_attr_size (insn)") (const_int 2)))
- "cf_v2_ib2+cf_v2_jmp")
+ "cf_ib2+cfv3_jmp")
-(define_insn_reservation "cf_v2_jmp_3" 3
- (and (and (eq_attr "cpu" "cf_v2")
+(define_insn_reservation "cfv3_jmp_3" 5
+ (and (and (eq_attr "cpu" "cfv3")
(eq_attr "type2" "jmp"))
(eq (symbol_ref "get_attr_size (insn)") (const_int 3)))
- "cf_v2_ib3+cf_v2_jmp")
+ "cf_ib3+cfv3_jmp")
;; Misc reservations.
-(define_insn_reservation "cf_v2_unlk_1" 2
- (and (and (eq_attr "cpu" "cf_v2")
+(define_insn_reservation "cfv12_unlk_1" 2
+ (and (and (eq_attr "cpu" "cfv1,cfv2")
+ (eq_attr "type2" "unlk"))
+ (eq (symbol_ref "get_attr_size (insn)") (const_int 1)))
+ "cf_ib1+cfv12_alu_10")
+
+(define_insn_reservation "cfv3_unlk_1" 3
+ (and (and (eq_attr "cpu" "cfv3")
(eq_attr "type2" "unlk"))
(eq (symbol_ref "get_attr_size (insn)") (const_int 1)))
- "cf_v2_ib1+cf_v2_move_l_10")
+ "cf_ib1+cfv3_alu_10")
;; This automaton is used to gather statistics on insns that need reservations.
-(define_automaton "cf_v2_guess")
+(define_automaton "cf_guess")
-(define_query_cpu_unit "cf_v2_guess" "cf_v2_guess")
+(define_query_cpu_unit "cf_guess" "cf_guess")
;; Dummy reservation for instructions that are not handled yet.
-(define_insn_reservation "cf_v2_guess_1" 1
- (and (and (eq_attr "cpu" "cf_v2")
+(define_insn_reservation "cf_guess_1" 1
+ (and (and (eq_attr "cpu" "cfv1,cfv2,cfv3")
(eq_attr "guess" "yes"))
(eq (symbol_ref "get_attr_size (insn)") (const_int 1)))
- "cf_v2_ib1+cf_v2_guess+cf_v2_dsoc+cf_v2_agex")
+ "cf_ib1+cf_guess+cf_dsoc+cf_agex")
-(define_insn_reservation "cf_v2_guess_2" 1
- (and (and (eq_attr "cpu" "cf_v2")
+(define_insn_reservation "cf_guess_2" 1
+ (and (and (eq_attr "cpu" "cfv1,cfv2,cfv3")
(eq_attr "guess" "yes"))
(eq (symbol_ref "get_attr_size (insn)") (const_int 2)))
- "cf_v2_ib2+cf_v2_guess+cf_v2_dsoc+cf_v2_agex")
+ "cf_ib2+cf_guess+cf_dsoc+cf_agex")
-(define_insn_reservation "cf_v2_guess_3" 1
- (and (and (eq_attr "cpu" "cf_v2")
+(define_insn_reservation "cf_guess_3" 1
+ (and (and (eq_attr "cpu" "cfv1,cfv2,cfv3")
(eq_attr "guess" "yes"))
(eq (symbol_ref "get_attr_size (insn)") (const_int 3)))
- "cf_v2_ib3+cf_v2_guess+cf_v2_dsoc+cf_v2_agex")
+ "cf_ib3+cf_guess+cf_dsoc+cf_agex")
diff --git a/gcc/config/m68k/m68k-protos.h b/gcc/config/m68k/m68k-protos.h
index bd039077b7d..8948065668a 100644
--- a/gcc/config/m68k/m68k-protos.h
+++ b/gcc/config/m68k/m68k-protos.h
@@ -67,6 +67,7 @@ extern const char *m68k_output_movem (rtx *, rtx, HOST_WIDE_INT, bool);
#ifdef HAVE_ATTR_cpu
extern enum attr_cpu m68k_sched_cpu;
+extern enum attr_mac m68k_sched_mac;
extern enum attr_opx_type m68k_sched_attr_opx_type (rtx, int);
extern enum attr_opy_type m68k_sched_attr_opy_type (rtx, int);
diff --git a/gcc/config/m68k/m68k.c b/gcc/config/m68k/m68k.c
index 6160237ede6..3fdd756ada9 100644
--- a/gcc/config/m68k/m68k.c
+++ b/gcc/config/m68k/m68k.c
@@ -666,8 +666,12 @@ override_options (void)
SUBTARGET_OVERRIDE_OPTIONS;
/* Setup scheduling options. */
- if (TUNE_CFV2)
- m68k_sched_cpu = CPU_CF_V2;
+ if (TUNE_CFV1)
+ m68k_sched_cpu = CPU_CFV1;
+ else if (TUNE_CFV2)
+ m68k_sched_cpu = CPU_CFV2;
+ else if (TUNE_CFV3)
+ m68k_sched_cpu = CPU_CFV3;
else
{
m68k_sched_cpu = CPU_UNKNOWN;
@@ -675,6 +679,16 @@ override_options (void)
flag_schedule_insns_after_reload = 0;
flag_modulo_sched = 0;
}
+
+ if (m68k_sched_cpu != CPU_UNKNOWN)
+ {
+ if ((m68k_cpu_flags & (FL_CF_EMAC | FL_CF_EMAC_B)) != 0)
+ m68k_sched_mac = MAC_CF_EMAC;
+ else if ((m68k_cpu_flags & FL_CF_MAC) != 0)
+ m68k_sched_mac = MAC_CF_MAC;
+ else
+ m68k_sched_mac = MAC_NO;
+ }
}
/* Generate a macro of the form __mPREFIX_cpu_NAME, where PREFIX is the
@@ -849,20 +863,20 @@ m68k_save_reg (unsigned int regno, bool interrupt_handler)
{
if (flag_pic && regno == PIC_REG)
{
- if (current_function_saves_all_registers)
+ if (crtl->saves_all_registers)
return true;
- if (current_function_uses_pic_offset_table)
+ if (crtl->uses_pic_offset_table)
return true;
/* Reload may introduce constant pool references into a function
that thitherto didn't need a PIC register. Note that the test
above will not catch that case because we will only set
- current_function_uses_pic_offset_table when emitting
+ crtl->uses_pic_offset_table when emitting
the address reloads. */
- if (current_function_uses_const_pool)
+ if (crtl->uses_const_pool)
return true;
}
- if (current_function_calls_eh_return)
+ if (crtl->calls_eh_return)
{
unsigned int i;
for (i = 0; ; i++)
@@ -972,7 +986,7 @@ m68k_expand_prologue (void)
/* If the stack limit is a symbol, we can check it here,
before actually allocating the space. */
- if (current_function_limit_stack
+ if (crtl->limit_stack
&& GET_CODE (stack_limit_rtx) == SYMBOL_REF)
{
limit = plus_constant (stack_limit_rtx, current_frame.size + 4);
@@ -1059,7 +1073,7 @@ m68k_expand_prologue (void)
/* If the stack limit is not a symbol, check it here.
This has the disadvantage that it may be too late... */
- if (current_function_limit_stack)
+ if (crtl->limit_stack)
{
if (REG_P (stack_limit_rtx))
{
@@ -1105,7 +1119,7 @@ m68k_expand_prologue (void)
if (flag_pic
&& !TARGET_SEP_DATA
- && current_function_uses_pic_offset_table)
+ && crtl->uses_pic_offset_table)
insn = emit_insn (gen_load_got (pic_offset_table_rtx));
}
@@ -1146,7 +1160,7 @@ m68k_expand_epilogue (bool sibcall_p)
What we really need to know there is if there could be pending
stack adjustment needed at that point. */
restore_from_sp = (!frame_pointer_needed
- || (!current_function_calls_alloca
+ || (!cfun->calls_alloca
&& current_function_is_leaf));
/* fsize_with_regs is the size we need to adjust the sp when
@@ -1284,7 +1298,7 @@ m68k_expand_epilogue (bool sibcall_p)
stack_pointer_rtx,
GEN_INT (fsize_with_regs)));
- if (current_function_calls_eh_return)
+ if (crtl->calls_eh_return)
emit_insn (gen_addsi3 (stack_pointer_rtx,
stack_pointer_rtx,
EH_RETURN_STACKADJ_RTX));
@@ -2032,7 +2046,7 @@ legitimize_pic_address (rtx orig, enum machine_mode mode ATTRIBUTE_UNUSED,
pic_ref = gen_rtx_MEM (Pmode,
gen_rtx_PLUS (Pmode,
pic_offset_table_rtx, orig));
- current_function_uses_pic_offset_table = 1;
+ crtl->uses_pic_offset_table = 1;
MEM_READONLY_P (pic_ref) = 1;
emit_move_insn (reg, pic_ref);
return reg;
@@ -4556,6 +4570,9 @@ m68k_return_in_memory (tree type, tree fntype ATTRIBUTE_UNUSED)
/* CPU to schedule the program for. */
enum attr_cpu m68k_sched_cpu;
+/* MAC to schedule the program for. */
+enum attr_mac m68k_sched_mac;
+
/* Operand type. */
enum attr_op_type
{
@@ -5011,14 +5028,14 @@ m68k_sched_attr_type2 (rtx insn)
{
switch (get_attr_type1 (insn))
{
- case TYPE1_ALU_REG1:
- case TYPE1_ALU_REGX:
- return TYPE2_ALU;
-
case TYPE1_ALU_L:
case TYPE1_ALUQ_L:
case TYPE1_CMP_L:
- return TYPE2_ALU_L;
+ return TYPE2_ALU;
+
+ case TYPE1_ALU_REG1:
+ case TYPE1_ALU_REGX:
+ return TYPE2_ALU_REG;
case TYPE1_BCC:
return TYPE2_BCC;
@@ -5041,15 +5058,29 @@ m68k_sched_attr_type2 (rtx insn)
case TYPE1_MOVE:
case TYPE1_MOVEQ_L:
case TYPE1_TST:
- return TYPE2_MOVE;
+ switch (m68k_sched_cpu)
+ {
+ case CPU_CFV1:
+ return TYPE2_OMOVE;
- case TYPE1_MOVE_L:
- case TYPE1_TST_L:
- return TYPE2_MOVE_L;
+ case CPU_CFV2:
+ case CPU_CFV3:
+ return TYPE2_ALU;
+
+ default:
+ gcc_assert (get_attr_guess (insn) == GUESS_YES);
+ return TYPE2_UNKNOWN;
+ }
- case TYPE1_MUL_W:
case TYPE1_MUL_L:
- return TYPE2_MUL;
+ return TYPE2_MUL_L;
+
+ case TYPE1_MUL_W:
+ return TYPE2_MUL_W;
+
+ case TYPE1_MOVE_L:
+ case TYPE1_TST_L:
+ return TYPE2_OMOVE;
case TYPE1_PEA:
return TYPE2_PEA;
@@ -5095,14 +5126,39 @@ m68k_sched_adjust_cost (rtx insn, rtx link ATTRIBUTE_UNUSED, rtx def_insn,
return cost;
}
-/* Size of the instruction buffer in words. */
-static int sched_ib_size;
+/* Maximal length of instruction for current CPU.
+ E.g. it is 3 for any ColdFire core. */
+static int max_insn_size;
+
+/* Data to model instruction buffer of CPU. */
+struct _sched_ib
+{
+ /* Size of the instruction buffer in words. */
+ int size;
+
+ /* Number of filled words in the instruction buffer. */
+ int filled;
+
+ /* Additional information about instruction buffer for CPUs that have
+ a buffer of instruction records, rather then a plain buffer
+ of instruction words. */
+ struct _sched_ib_records
+ {
+ /* Size of buffer in records. */
+ int n_insns;
-/* Number of filled words in the instruction buffer. */
-static int sched_ib_filled;
+ /* Array to hold data on adjustements made to the size of the buffer. */
+ int *adjust;
-/* An insn that reserves (marks empty) one word in the instruction buffer. */
-static rtx sched_ib_insn;
+ /* Index of the above array. */
+ int adjust_index;
+ } records;
+
+ /* An insn that reserves (marks empty) one word in the instruction buffer. */
+ rtx insn;
+};
+
+static struct _sched_ib sched_ib;
/* ID of memory unit. */
static int sched_mem_unit_code;
@@ -5121,19 +5177,58 @@ m68k_sched_variable_issue (FILE *sched_dump ATTRIBUTE_UNUSED,
if (recog_memoized (insn) >= 0)
{
- insn_size = get_attr_size (insn);
+ switch (m68k_sched_cpu)
+ {
+ case CPU_CFV1:
+ case CPU_CFV2:
+ insn_size = get_attr_size (insn);
+ break;
+
+ case CPU_CFV3:
+ insn_size = get_attr_size (insn);
+
+ /* ColdFire V3 and V4 cores have instruction buffers that can
+ accumulate up to 8 instructions regardless of instructions'
+ sizes. So we should take care not to "prefetch" 24 one-word
+ or 12 two-words instructions.
+ To model this behavior we temporarily decrease size of the
+ buffer by (max_insn_size - insn_size) for next 7 instructions. */
+ {
+ int adjust;
+
+ adjust = max_insn_size - insn_size;
+ sched_ib.size -= adjust;
+
+ if (sched_ib.filled > sched_ib.size)
+ sched_ib.filled = sched_ib.size;
+
+ sched_ib.records.adjust[sched_ib.records.adjust_index] = adjust;
+ }
+
+ ++sched_ib.records.adjust_index;
+ if (sched_ib.records.adjust_index == sched_ib.records.n_insns)
+ sched_ib.records.adjust_index = 0;
+
+ /* Undo adjustement we did 7 instructions ago. */
+ sched_ib.size
+ += sched_ib.records.adjust[sched_ib.records.adjust_index];
+
+ break;
- gcc_assert (insn_size <= sched_ib_filled);
+ default:
+ gcc_unreachable ();
+ }
+ gcc_assert (insn_size <= sched_ib.filled);
--can_issue_more;
}
else if (GET_CODE (PATTERN (insn)) == ASM_INPUT
|| asm_noperands (PATTERN (insn)) >= 0)
- insn_size = sched_ib_filled;
+ insn_size = sched_ib.filled;
else
insn_size = 0;
- sched_ib_filled -= insn_size;
+ sched_ib.filled -= insn_size;
return can_issue_more;
}
@@ -5357,7 +5452,7 @@ m68k_sched_md_init_global (FILE *sched_dump ATTRIBUTE_UNUSED,
m68k_sched_dump (sched_dump_split_class, "m68k_sched_split",
sched_dump);
- sched_dump_dfa_guess_unit_code = get_cpu_unit_code ("cf_v2_guess");
+ sched_dump_dfa_guess_unit_code = get_cpu_unit_code ("cf_guess");
sched_dump_dfa_state = alloca (state_size ());
m68k_sched_dump (sched_dump_dfa_class, "m68k_sched_dfa",
@@ -5370,21 +5465,32 @@ m68k_sched_md_init_global (FILE *sched_dump ATTRIBUTE_UNUSED,
/* Setup target cpu. */
switch (m68k_sched_cpu)
{
- case CPU_CF_V2:
- sched_ib_size = 6;
- sched_mem_unit_code = get_cpu_unit_code ("cf_v2_mem");
+ case CPU_CFV1:
+ case CPU_CFV2:
+ max_insn_size = 3;
+ sched_ib.records.n_insns = 0;
+ sched_ib.records.adjust = NULL;
+ break;
+
+ case CPU_CFV3:
+ max_insn_size = 3;
+ sched_ib.records.n_insns = 8;
+ sched_ib.records.adjust = xmalloc (sched_ib.records.n_insns
+ * sizeof (*sched_ib.records.adjust));
break;
default:
gcc_unreachable ();
}
+ sched_mem_unit_code = get_cpu_unit_code ("cf_mem1");
+
sched_adjust_cost_state = xmalloc (state_size ());
state_reset (sched_adjust_cost_state);
start_sequence ();
emit_insn (gen_ib ());
- sched_ib_insn = get_insns ();
+ sched_ib.insn = get_insns ();
end_sequence ();
}
@@ -5393,13 +5499,17 @@ static void
m68k_sched_md_finish_global (FILE *dump ATTRIBUTE_UNUSED,
int verbose ATTRIBUTE_UNUSED)
{
- sched_ib_insn = NULL;
+ sched_ib.insn = NULL;
free (sched_adjust_cost_state);
sched_adjust_cost_state = NULL;
sched_mem_unit_code = 0;
- sched_ib_size = 0;
+
+ free (sched_ib.records.adjust);
+ sched_ib.records.adjust = NULL;
+ sched_ib.records.n_insns = 0;
+ max_insn_size = 0;
free (sched_branch_type);
sched_branch_type = NULL;
@@ -5413,9 +5523,28 @@ m68k_sched_md_init (FILE *sched_dump ATTRIBUTE_UNUSED,
int sched_verbose ATTRIBUTE_UNUSED,
int n_insns ATTRIBUTE_UNUSED)
{
+ switch (m68k_sched_cpu)
+ {
+ case CPU_CFV1:
+ case CPU_CFV2:
+ sched_ib.size = 6;
+ break;
+
+ case CPU_CFV3:
+ sched_ib.size = sched_ib.records.n_insns * max_insn_size;
+
+ memset (sched_ib.records.adjust, 0,
+ sched_ib.records.n_insns * sizeof (*sched_ib.records.adjust));
+ sched_ib.records.adjust_index = 0;
+ break;
+
+ default:
+ gcc_unreachable ();
+ }
+
/* haifa-sched.c: schedule_block () calls advance_cycle () just before
the first cycle. Workaround that. */
- sched_ib_filled = -2;
+ sched_ib.filled = -2;
}
/* Implementation of targetm.sched.dfa_pre_advance_cycle () hook.
@@ -5426,10 +5555,10 @@ m68k_sched_dfa_pre_advance_cycle (void)
{
if (!cpu_unit_reservation_p (curr_state, sched_mem_unit_code))
{
- sched_ib_filled += 2;
+ sched_ib.filled += 2;
- if (sched_ib_filled > sched_ib_size)
- sched_ib_filled = sched_ib_size;
+ if (sched_ib.filled > sched_ib.size)
+ sched_ib.filled = sched_ib.size;
}
}
@@ -5442,13 +5571,14 @@ static void
m68k_sched_dfa_post_advance_cycle (void)
{
int i;
- int n;
/* Setup number of prefetched instruction words in the instruction
buffer. */
- for (i = sched_ib_filled, n = sched_ib_size; i < n; ++i)
+ i = max_insn_size - sched_ib.filled;
+
+ while (--i >= 0)
{
- if (state_transition (curr_state, sched_ib_insn) >= 0)
+ if (state_transition (curr_state, sched_ib.insn) >= 0)
gcc_unreachable ();
}
}
diff --git a/gcc/config/m68k/m68k.h b/gcc/config/m68k/m68k.h
index d5d89832643..32b5c243999 100644
--- a/gcc/config/m68k/m68k.h
+++ b/gcc/config/m68k/m68k.h
@@ -266,6 +266,7 @@ along with GCC; see the file COPYING3. If not see
#define TUNE_CPU32 (m68k_tune == ucpu32)
#define TUNE_CFV1 (m68k_tune == ucfv1)
#define TUNE_CFV2 (m68k_tune == ucfv2)
+#define TUNE_CFV3 (m68k_tune == ucfv3)
#define OVERRIDE_OPTIONS override_options()
diff --git a/gcc/config/m68k/m68k.md b/gcc/config/m68k/m68k.md
index 523b039acd0..abe363ee285 100644
--- a/gcc/config/m68k/m68k.md
+++ b/gcc/config/m68k/m68k.md
@@ -144,7 +144,12 @@
;; ::::::::::::::::::::
;; Processor type.
-(define_attr "cpu" "cf_v2, unknown" (const (symbol_ref "m68k_sched_cpu")))
+(define_attr "cpu" "cfv1, cfv2, cfv3, unknown"
+ (const (symbol_ref "m68k_sched_cpu")))
+
+;; MAC type.
+(define_attr "mac" "no, cf_mac, cf_emac"
+ (const (symbol_ref "m68k_sched_mac")))
;; Instruction type.
;; Basically, an asm pattern.
diff --git a/gcc/config/mcore/mcore.c b/gcc/config/mcore/mcore.c
index d9d3398b498..940c833dc3e 100644
--- a/gcc/config/mcore/mcore.c
+++ b/gcc/config/mcore/mcore.c
@@ -1938,7 +1938,7 @@ mcore_expand_prolog (void)
ASM_OUTPUT_CG_NODE (asm_out_file, mcore_current_function_name, space_allocated);
- if (current_function_calls_alloca)
+ if (cfun->calls_alloca)
ASM_OUTPUT_CG_EDGE (asm_out_file, mcore_current_function_name, "alloca", 1);
/* 970425: RBE:
diff --git a/gcc/config/mips/mips-protos.h b/gcc/config/mips/mips-protos.h
index deb99a08867..fbac8fcfd07 100644
--- a/gcc/config/mips/mips-protos.h
+++ b/gcc/config/mips/mips-protos.h
@@ -292,5 +292,6 @@ extern bool mips_use_ins_ext_p (rtx, HOST_WIDE_INT, HOST_WIDE_INT);
extern const char *mips16e_output_save_restore (rtx, HOST_WIDE_INT);
extern bool mips16e_save_restore_pattern_p (rtx, HOST_WIDE_INT,
struct mips16e_save_restore_info *);
+extern void mips_expand_compare_and_swap_12 (rtx, rtx, rtx, rtx);
#endif /* ! GCC_MIPS_PROTOS_H */
diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c
index d69169f13a7..86072acf4ab 100644
--- a/gcc/config/mips/mips.c
+++ b/gcc/config/mips/mips.c
@@ -1,6 +1,6 @@
/* Subroutines used for MIPS code generation.
Copyright (C) 1989, 1990, 1991, 1993, 1994, 1995, 1996, 1997, 1998,
- 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
+ 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
Free Software Foundation, Inc.
Contributed by A. Lichnewsky, lich@inria.inria.fr.
Changes by Michael Meissner, meissner@osf.org.
@@ -2121,6 +2121,19 @@ mips_emit_binary (enum rtx_code code, rtx target, rtx op0, rtx op1)
gen_rtx_fmt_ee (code, GET_MODE (target), op0, op1)));
}
+/* Compute (CODE OP0 OP1) and store the result in a new register
+ of mode MODE. Return that new register. */
+
+static rtx
+mips_force_binary (enum machine_mode mode, enum rtx_code code, rtx op0, rtx op1)
+{
+ rtx reg;
+
+ reg = gen_reg_rtx (mode);
+ mips_emit_binary (code, reg, op0, op1);
+ return reg;
+}
+
/* Copy VALUE to a register and return that register. If new pseudos
are allowed, copy it into a new register, otherwise use DEST. */
@@ -3741,8 +3754,10 @@ mips_emit_int_order_test (enum rtx_code code, bool *invert_ptr,
}
else if (invert_ptr == 0)
{
- rtx inv_target = gen_reg_rtx (GET_MODE (target));
- mips_emit_binary (inv_code, inv_target, cmp0, cmp1);
+ rtx inv_target;
+
+ inv_target = mips_force_binary (GET_MODE (target),
+ inv_code, cmp0, cmp1);
mips_emit_binary (XOR, target, inv_target, const1_rtx);
}
else
@@ -5850,8 +5865,7 @@ mips_expand_synci_loop (rtx begin, rtx end)
emit_insn (gen_synci (begin));
- cmp = gen_reg_rtx (Pmode);
- mips_emit_binary (GTU, cmp, begin, end);
+ cmp = mips_force_binary (Pmode, GTU, begin, end);
mips_emit_binary (PLUS, begin, begin, inc);
@@ -5859,6 +5873,68 @@ mips_expand_synci_loop (rtx begin, rtx end)
emit_jump_insn (gen_condjump (cmp_result, label));
}
+/* Expand a QI or HI mode compare_and_swap. The operands are the same
+ as for the generator function. */
+
+void
+mips_expand_compare_and_swap_12 (rtx result, rtx mem, rtx oldval, rtx newval)
+{
+ rtx orig_addr, memsi_addr, memsi, shift, shiftsi, unshifted_mask;
+ rtx mask, inverted_mask, oldvalsi, old_shifted, newvalsi, new_shifted, res;
+
+ /* Compute the address of the containing SImode value. */
+ orig_addr = force_reg (Pmode, XEXP (mem, 0));
+ memsi_addr = mips_force_binary (Pmode, AND, orig_addr,
+ force_reg (Pmode, GEN_INT (-4)));
+
+ /* Create a memory reference for it. */
+ memsi = gen_rtx_MEM (SImode, memsi_addr);
+ set_mem_alias_set (memsi, ALIAS_SET_MEMORY_BARRIER);
+ MEM_VOLATILE_P (memsi) = MEM_VOLATILE_P (mem);
+
+ /* Work out the byte offset of the QImode or HImode value,
+ counting from the least significant byte. */
+ shift = mips_force_binary (Pmode, AND, orig_addr, GEN_INT (3));
+ if (TARGET_BIG_ENDIAN)
+ mips_emit_binary (XOR, shift, shift,
+ GEN_INT (GET_MODE (mem) == QImode ? 3 : 2));
+
+ /* Multiply by eight to convert the shift value from bytes to bits. */
+ mips_emit_binary (ASHIFT, shift, shift, GEN_INT (3));
+
+ /* Make the final shift an SImode value, so that it can be used in
+ SImode operations. */
+ shiftsi = force_reg (SImode, gen_lowpart (SImode, shift));
+
+ /* Set MASK to an inclusive mask of the QImode or HImode value. */
+ unshifted_mask = GEN_INT (GET_MODE_MASK (GET_MODE (mem)));
+ unshifted_mask = force_reg (SImode, unshifted_mask);
+ mask = mips_force_binary (SImode, ASHIFT, unshifted_mask, shiftsi);
+
+ /* Compute the equivalent exclusive mask. */
+ inverted_mask = gen_reg_rtx (SImode);
+ emit_insn (gen_rtx_SET (VOIDmode, inverted_mask,
+ gen_rtx_NOT (SImode, mask)));
+
+ /* Shift the old value into place. */
+ oldvalsi = force_reg (SImode, gen_lowpart (SImode, oldval));
+ old_shifted = mips_force_binary (SImode, ASHIFT, oldvalsi, shiftsi);
+
+ /* Do the same for the new value. */
+ newvalsi = force_reg (SImode, gen_lowpart (SImode, newval));
+ new_shifted = mips_force_binary (SImode, ASHIFT, newvalsi, shiftsi);
+
+ /* Do the SImode atomic access. */
+ res = gen_reg_rtx (SImode);
+ emit_insn (gen_compare_and_swap_12 (res, memsi, mask, inverted_mask,
+ old_shifted, new_shifted));
+
+ /* Shift and convert the result. */
+ mips_emit_binary (AND, res, res, mask);
+ mips_emit_binary (LSHIFTRT, res, res, shiftsi);
+ mips_emit_move (result, gen_lowpart (GET_MODE (result), res));
+}
+
/* Return true if it is possible to use left/right accesses for a
bitfield of WIDTH bits starting BITPOS bits into *OP. When
returning true, update *OP, *LEFT and *RIGHT as follows:
@@ -7656,12 +7732,12 @@ mips_global_pointer (void)
/* FUNCTION_PROFILER includes a jal macro, so we need to give it
a valid gp. */
- if (current_function_profile)
+ if (crtl->profile)
return GLOBAL_POINTER_REGNUM;
/* If the function has a nonlocal goto, $gp must hold the correct
global pointer for the target function. */
- if (current_function_has_nonlocal_goto)
+ if (crtl->has_nonlocal_goto)
return GLOBAL_POINTER_REGNUM;
/* If the gp is never referenced, there's no need to initialize it.
@@ -7678,7 +7754,7 @@ mips_global_pointer (void)
In cases like these, reload will have added the constant to the pool
but no instruction will yet refer to it. */
if (!df_regs_ever_live_p (GLOBAL_POINTER_REGNUM)
- && !current_function_uses_const_pool
+ && !crtl->uses_const_pool
&& !mips_function_has_gp_insn ())
return 0;
@@ -7719,7 +7795,7 @@ mips_save_reg_p (unsigned int regno)
return TARGET_CALL_SAVED_GP && cfun->machine->global_pointer == regno;
/* Check call-saved registers. */
- if ((current_function_saves_all_registers || df_regs_ever_live_p (regno))
+ if ((crtl->saves_all_registers || df_regs_ever_live_p (regno))
&& !call_really_used_regs[regno])
return true;
@@ -7737,7 +7813,7 @@ mips_save_reg_p (unsigned int regno)
return true;
/* Check for registers that must be saved for FUNCTION_PROFILER. */
- if (current_function_profile && MIPS_SAVE_REG_FOR_PROFILING_P (regno))
+ if (crtl->profile && MIPS_SAVE_REG_FOR_PROFILING_P (regno))
return true;
/* We need to save the incoming return address if it is ever clobbered
@@ -7746,7 +7822,7 @@ mips_save_reg_p (unsigned int regno)
value in FPRs. */
if (regno == GP_REG_FIRST + 31
&& (df_regs_ever_live_p (regno)
- || current_function_calls_eh_return
+ || crtl->calls_eh_return
|| mips16_cfun_returns_in_fpr_p ()))
return true;
@@ -7837,7 +7913,7 @@ mips_compute_frame_info (void)
allocate the stack and have 0 for STACK_DYNAMIC_OFFSET, since it
looks like we are trying to create a second frame pointer to the
function, so allocate some stack space to make it happy. */
- if (current_function_calls_alloca)
+ if (cfun->calls_alloca)
frame->args_size = REG_PARM_STACK_SPACE (cfun->decl);
else
frame->args_size = 0;
@@ -7864,7 +7940,7 @@ mips_compute_frame_info (void)
/* If this function calls eh_return, we must also save and restore the
EH data registers. */
- if (current_function_calls_eh_return)
+ if (crtl->calls_eh_return)
for (i = 0; EH_RETURN_DATA_REGNO (i) != INVALID_REGNUM; i++)
{
frame->num_gp++;
@@ -7952,7 +8028,7 @@ mips_frame_pointer_required (void)
{
/* If the function contains dynamic stack allocations, we need to
use the frame pointer to access the static parts of the frame. */
- if (current_function_calls_alloca)
+ if (cfun->calls_alloca)
return true;
/* In MIPS16 mode, we need a frame pointer for a large frame; otherwise,
@@ -8489,7 +8565,7 @@ mips_expand_prologue (void)
/* If we are profiling, make sure no instructions are scheduled before
the call to mcount. */
- if (current_function_profile)
+ if (crtl->profile)
emit_insn (gen_blockage ());
}
@@ -8627,7 +8703,7 @@ mips_expand_epilogue (bool sibcall_p)
/* Add in the __builtin_eh_return stack adjustment. We need to
use a temporary in MIPS16 code. */
- if (current_function_calls_eh_return)
+ if (crtl->calls_eh_return)
{
if (TARGET_MIPS16)
{
@@ -8669,7 +8745,7 @@ mips_can_use_return_insn (void)
if (!reload_completed)
return false;
- if (current_function_profile)
+ if (crtl->profile)
return false;
/* In MIPS16 mode, a function that returns a floating-point value
@@ -11475,7 +11551,7 @@ mips_reorg_process_insns (void)
/* Profiled functions can't be all noreorder because the profiler
support uses assembler macros. */
- if (current_function_profile)
+ if (crtl->profile)
cfun->machine->all_noreorder_p = false;
/* Code compiled with -mfix-vr4120 can't be all noreorder because
diff --git a/gcc/config/mips/mips.h b/gcc/config/mips/mips.h
index 3a0e58c96e6..cda433aa4f0 100644
--- a/gcc/config/mips/mips.h
+++ b/gcc/config/mips/mips.h
@@ -2906,6 +2906,30 @@ while (0)
/* Return an asm string that atomically:
+ - Given that %2 contains a bit mask and %3 the inverted mask and
+ that %4 and %5 have already been ANDed with $2.
+
+ - Compares the bits in memory reference %1 selected by mask %2 to
+ register %4 and, if they are equal, changes the selected bits
+ in memory to %5.
+
+ - Sets register %0 to the old value of memory reference %1.
+ */
+#define MIPS_COMPARE_AND_SWAP_12 \
+ "%(%<%[%|sync\n" \
+ "1:\tll\t%0,%1\n" \
+ "\tand\t%@,%0,%2\n" \
+ "\tbne\t%@,%4,2f\n" \
+ "\tand\t%@,%0,%3\n" \
+ "\tor\t%@,%@,%5\n" \
+ "\tsc\t%@,%1\n" \
+ "\tbeq\t%@,%.,1b\n" \
+ "\tnop\n" \
+ "\tsync%-%]%>%)\n" \
+ "2:\n"
+
+/* Return an asm string that atomically:
+
- Sets memory reference %0 to %0 INSN %1.
SUFFIX is the suffix that should be added to "ll" and "sc"
diff --git a/gcc/config/mips/mips.md b/gcc/config/mips/mips.md
index cbdcdc6ed13..05adf2226d4 100644
--- a/gcc/config/mips/mips.md
+++ b/gcc/config/mips/mips.md
@@ -54,12 +54,13 @@
(UNSPEC_SYNCI 35)
(UNSPEC_SYNC 36)
(UNSPEC_COMPARE_AND_SWAP 37)
- (UNSPEC_SYNC_OLD_OP 38)
- (UNSPEC_SYNC_NEW_OP 39)
- (UNSPEC_SYNC_EXCHANGE 40)
- (UNSPEC_MEMORY_BARRIER 41)
- (UNSPEC_SET_GOT_VERSION 42)
- (UNSPEC_UPDATE_GOT_VERSION 43)
+ (UNSPEC_COMPARE_AND_SWAP_12 38)
+ (UNSPEC_SYNC_OLD_OP 39)
+ (UNSPEC_SYNC_NEW_OP 40)
+ (UNSPEC_SYNC_EXCHANGE 41)
+ (UNSPEC_MEMORY_BARRIER 42)
+ (UNSPEC_SET_GOT_VERSION 43)
+ (UNSPEC_UPDATE_GOT_VERSION 44)
(UNSPEC_ADDRESS_FIRST 100)
@@ -4447,6 +4448,34 @@
}
[(set_attr "length" "32")])
+(define_expand "sync_compare_and_swap<mode>"
+ [(match_operand:SHORT 0 "register_operand")
+ (match_operand:SHORT 1 "memory_operand")
+ (match_operand:SHORT 2 "general_operand")
+ (match_operand:SHORT 3 "general_operand")]
+ "GENERATE_LL_SC"
+{
+ mips_expand_compare_and_swap_12 (operands[0], operands[1],
+ operands[2], operands[3]);
+ DONE;
+})
+
+;; Helper insn for mips_expand_compare_and_swap_12.
+(define_insn "compare_and_swap_12"
+ [(set (match_operand:SI 0 "register_operand" "=&d")
+ (match_operand:SI 1 "memory_operand" "+R"))
+ (set (match_dup 1)
+ (unspec_volatile:SI [(match_operand:SI 2 "register_operand" "d")
+ (match_operand:SI 3 "register_operand" "d")
+ (match_operand:SI 4 "register_operand" "d")
+ (match_operand:SI 5 "register_operand" "d")]
+ UNSPEC_COMPARE_AND_SWAP_12))]
+ "GENERATE_LL_SC"
+{
+ return MIPS_COMPARE_AND_SWAP_12;
+}
+ [(set_attr "length" "40")])
+
(define_insn "sync_add<mode>"
[(set (match_operand:GPR 0 "memory_operand" "+R,R")
(unspec_volatile:GPR
diff --git a/gcc/config/mmix/mmix.c b/gcc/config/mmix/mmix.c
index 3a408438c62..2807d08d956 100644
--- a/gcc/config/mmix/mmix.c
+++ b/gcc/config/mmix/mmix.c
@@ -69,7 +69,7 @@ along with GCC; see the file COPYING3. If not see
|| !leaf_function_p ()))
#define IS_MMIX_EH_RETURN_DATA_REG(REGNO) \
- (current_function_calls_eh_return \
+ (crtl->calls_eh_return \
&& (EH_RETURN_DATA_REGNO (0) == REGNO \
|| EH_RETURN_DATA_REGNO (1) == REGNO \
|| EH_RETURN_DATA_REGNO (2) == REGNO \
@@ -96,7 +96,7 @@ along with GCC; see the file COPYING3. If not see
#define MMIX_POP_ARGUMENT() \
((! TARGET_ABI_GNU \
&& crtl->return_rtx != NULL \
- && ! current_function_returns_struct) \
+ && ! cfun->returns_struct) \
? (GET_CODE (crtl->return_rtx) == PARALLEL \
? GET_NUM_ELEM (XVEC (crtl->return_rtx, 0)) : 1) \
: 0)
@@ -2207,7 +2207,7 @@ mmix_expand_epilogue (void)
if (stack_space_to_deallocate != 0)
mmix_emit_sp_add (stack_space_to_deallocate);
- if (current_function_calls_eh_return)
+ if (crtl->calls_eh_return)
/* Adjust the (normal) stack-pointer to that of the receiver.
FIXME: It would be nice if we could also adjust the register stack
here, but we need to express it through DWARF 2 too. */
diff --git a/gcc/config/mmix/mmix.h b/gcc/config/mmix/mmix.h
index 19aab6f4b27..7e38eab1941 100644
--- a/gcc/config/mmix/mmix.h
+++ b/gcc/config/mmix/mmix.h
@@ -591,7 +591,7 @@ enum reg_class
/* Node: Elimination */
/* FIXME: Is this requirement built-in? Anyway, we should try to get rid
of it; we can deduce the value. */
-#define FRAME_POINTER_REQUIRED current_function_has_nonlocal_label
+#define FRAME_POINTER_REQUIRED cfun->has_nonlocal_label
/* The frame-pointer is stored in a location that either counts to the
offset of incoming parameters, or that counts to the offset of the
diff --git a/gcc/config/mn10300/mn10300.c b/gcc/config/mn10300/mn10300.c
index 1effca34473..ea7392bb0f9 100644
--- a/gcc/config/mn10300/mn10300.c
+++ b/gcc/config/mn10300/mn10300.c
@@ -1599,7 +1599,7 @@ mn10300_function_value (const_tree valtype, const_tree func, int outgoing)
if (! POINTER_TYPE_P (valtype))
return gen_rtx_REG (mode, FIRST_DATA_REGNUM);
else if (! TARGET_PTR_A0D0 || ! outgoing
- || current_function_returns_struct)
+ || cfun->returns_struct)
return gen_rtx_REG (mode, FIRST_ADDRESS_REGNUM);
rv = gen_rtx_PARALLEL (mode, rtvec_alloc (2));
diff --git a/gcc/config/mt/mt.h b/gcc/config/mt/mt.h
index 67a8185573d..de20d40eb5a 100644
--- a/gcc/config/mt/mt.h
+++ b/gcc/config/mt/mt.h
@@ -422,7 +422,7 @@ enum save_direction
handlers. */ \
|| (interrupt_handler && call_used_regs[regno] \
&& !current_function_is_leaf) \
- ||(current_function_calls_eh_return \
+ ||(crtl->calls_eh_return \
&& (regno == GPR_R7 || regno == GPR_R8)) \
) \
)
diff --git a/gcc/config/pa/pa.c b/gcc/config/pa/pa.c
index 3fff521df55..525572eb7c0 100644
--- a/gcc/config/pa/pa.c
+++ b/gcc/config/pa/pa.c
@@ -698,7 +698,7 @@ legitimize_pic_address (rtx orig, enum machine_mode mode, rtx reg)
REG_NOTES (insn));
LABEL_NUSES (orig)++;
}
- current_function_uses_pic_offset_table = 1;
+ crtl->uses_pic_offset_table = 1;
return reg;
}
if (GET_CODE (orig) == SYMBOL_REF)
@@ -745,7 +745,7 @@ legitimize_pic_address (rtx orig, enum machine_mode mode, rtx reg)
UNSPEC_DLTIND14R)));
}
- current_function_uses_pic_offset_table = 1;
+ crtl->uses_pic_offset_table = 1;
mark_reg_pointer (reg, BITS_PER_UNIT);
insn = emit_move_insn (reg, pic_ref);
@@ -3531,7 +3531,7 @@ compute_frame_size (HOST_WIDE_INT size, int *fregs_live)
/* If the current function calls __builtin_eh_return, then we need
to allocate stack space for registers that will hold data for
the exception handler. */
- if (DO_FRAME_NOTES && current_function_calls_eh_return)
+ if (DO_FRAME_NOTES && crtl->calls_eh_return)
{
unsigned int i;
@@ -3679,7 +3679,7 @@ hppa_expand_prologue (void)
/* Save RP first. The calling conventions manual states RP will
always be stored into the caller's frame at sp - 20 or sp - 16
depending on which ABI is in use. */
- if (df_regs_ever_live_p (2) || current_function_calls_eh_return)
+ if (df_regs_ever_live_p (2) || crtl->calls_eh_return)
{
store_reg (2, TARGET_64BIT ? -16 : -20, STACK_POINTER_REGNUM);
rp_saved = true;
@@ -3779,7 +3779,7 @@ hppa_expand_prologue (void)
/* Saving the EH return data registers in the frame is the simplest
way to get the frame unwind information emitted. We put them
just before the general registers. */
- if (DO_FRAME_NOTES && current_function_calls_eh_return)
+ if (DO_FRAME_NOTES && crtl->calls_eh_return)
{
unsigned int i, regno;
@@ -3811,7 +3811,7 @@ hppa_expand_prologue (void)
/* Saving the EH return data registers in the frame is the simplest
way to get the frame unwind information emitted. */
- if (DO_FRAME_NOTES && current_function_calls_eh_return)
+ if (DO_FRAME_NOTES && crtl->calls_eh_return)
{
unsigned int i, regno;
@@ -4113,7 +4113,7 @@ hppa_expand_epilogue (void)
/* If the current function calls __builtin_eh_return, then we need
to restore the saved EH data registers. */
- if (DO_FRAME_NOTES && current_function_calls_eh_return)
+ if (DO_FRAME_NOTES && crtl->calls_eh_return)
{
unsigned int i, regno;
@@ -4141,7 +4141,7 @@ hppa_expand_epilogue (void)
/* If the current function calls __builtin_eh_return, then we need
to restore the saved EH data registers. */
- if (DO_FRAME_NOTES && current_function_calls_eh_return)
+ if (DO_FRAME_NOTES && crtl->calls_eh_return)
{
unsigned int i, regno;
@@ -4238,7 +4238,7 @@ hppa_expand_epilogue (void)
if (ret_off != 0)
load_reg (2, ret_off, STACK_POINTER_REGNUM);
- if (DO_FRAME_NOTES && current_function_calls_eh_return)
+ if (DO_FRAME_NOTES && crtl->calls_eh_return)
{
rtx sa = EH_RETURN_STACKADJ_RTX;
@@ -8496,7 +8496,7 @@ borx_reg_operand (rtx op, enum machine_mode mode)
profitable to do so when the frame pointer is being eliminated. */
if (!reload_completed
&& flag_omit_frame_pointer
- && !current_function_calls_alloca
+ && !cfun->calls_alloca
&& op == frame_pointer_rtx)
return 0;
diff --git a/gcc/config/pa/pa.h b/gcc/config/pa/pa.h
index bcbacb4c69c..541f2e3069f 100644
--- a/gcc/config/pa/pa.h
+++ b/gcc/config/pa/pa.h
@@ -366,13 +366,13 @@ typedef struct machine_function GTY(())
/* Value should be nonzero if functions must have frame pointers. */
#define FRAME_POINTER_REQUIRED \
- (current_function_calls_alloca)
+ (cfun->calls_alloca)
/* Don't allow hard registers to be renamed into r2 unless r2
is already live or already being saved (due to eh). */
#define HARD_REGNO_RENAME_OK(OLD_REG, NEW_REG) \
- ((NEW_REG) != 2 || df_regs_ever_live_p (2) || current_function_calls_eh_return)
+ ((NEW_REG) != 2 || df_regs_ever_live_p (2) || crtl->calls_eh_return)
/* C statement to store the difference between the frame pointer
and the stack pointer values immediately after the function prologue.
@@ -791,7 +791,7 @@ extern int may_call_alloca;
#define EXIT_IGNORE_STACK \
(get_frame_size () != 0 \
- || current_function_calls_alloca || crtl->outgoing_args_size)
+ || cfun->calls_alloca || crtl->outgoing_args_size)
/* Output assembler code for a block containing the constant parts
of a trampoline, leaving space for the variable parts.\
diff --git a/gcc/config/pa/pa.md b/gcc/config/pa/pa.md
index ee6037a75b6..5f1d73893fd 100644
--- a/gcc/config/pa/pa.md
+++ b/gcc/config/pa/pa.md
@@ -7275,7 +7275,7 @@
(use (reg:SI 2))]
"!TARGET_NO_SPACE_REGS
&& !TARGET_PA_20
- && flag_pic && current_function_calls_eh_return"
+ && flag_pic && crtl->calls_eh_return"
"ldsid (%%sr0,%%r2),%%r1\;mtsp %%r1,%%sr0\;be%* 0(%%sr0,%%r2)"
[(set_attr "type" "branch")
(set_attr "length" "12")])
@@ -7317,7 +7317,7 @@
using space registers. */
if (!TARGET_NO_SPACE_REGS
&& !TARGET_PA_20
- && flag_pic && current_function_calls_eh_return)
+ && flag_pic && crtl->calls_eh_return)
x = gen_return_external_pic ();
else
x = gen_return_internal ();
diff --git a/gcc/config/rs6000/crtresfpr.asm b/gcc/config/rs6000/crtresfpr.asm
new file mode 100644
index 00000000000..aaa4b968049
--- /dev/null
+++ b/gcc/config/rs6000/crtresfpr.asm
@@ -0,0 +1,90 @@
+/*
+ * Special support for eabi and SVR4
+ *
+ * Copyright (C) 1995, 1996, 1998, 2000, 2001, 2008
+ * Free Software Foundation, Inc.
+ * Written By Michael Meissner
+ * 64-bit support written by David Edelsohn
+ *
+ * This file 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 2, or (at your option) any
+ * later version.
+ *
+ * In addition to the permissions in the GNU General Public License, the
+ * Free Software Foundation gives you unlimited permission to link the
+ * compiled version of this file with other programs, and to distribute
+ * those programs without any restriction coming from the use of this
+ * file. (The General Public License restrictions do apply in other
+ * respects; for example, they cover modification of the file, and
+ * distribution when not linked into another program.)
+ *
+ * This file 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 this program; see the file COPYING. If not, write to
+ * the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ * As a special exception, if you link this library with files
+ * compiled with GCC to produce an executable, this does not cause
+ * the resulting executable to be covered by the GNU General Public License.
+ * This exception does not however invalidate any other reasons why
+ * the executable file might be covered by the GNU General Public License.
+ */
+
+/* Do any initializations needed for the eabi environment */
+
+ .file "crtresfpr.asm"
+ .section ".text"
+ #include "ppc-asm.h"
+
+/* On PowerPC64 Linux, these functions are provided by the linker. */
+#ifndef __powerpc64__
+
+/* Routines for restoring floating point registers, called by the compiler. */
+/* Called with r11 pointing to the stack header word of the caller of the */
+/* function, just beyond the end of the floating point save area. */
+
+FUNC_START(_restfpr_14) lfd 14,-144(11) /* restore fp registers */
+FUNC_START(_restfpr_15) lfd 15,-136(11)
+FUNC_START(_restfpr_16) lfd 16,-128(11)
+FUNC_START(_restfpr_17) lfd 17,-120(11)
+FUNC_START(_restfpr_18) lfd 18,-112(11)
+FUNC_START(_restfpr_19) lfd 19,-104(11)
+FUNC_START(_restfpr_20) lfd 20,-96(11)
+FUNC_START(_restfpr_21) lfd 21,-88(11)
+FUNC_START(_restfpr_22) lfd 22,-80(11)
+FUNC_START(_restfpr_23) lfd 23,-72(11)
+FUNC_START(_restfpr_24) lfd 24,-64(11)
+FUNC_START(_restfpr_25) lfd 25,-56(11)
+FUNC_START(_restfpr_26) lfd 26,-48(11)
+FUNC_START(_restfpr_27) lfd 27,-40(11)
+FUNC_START(_restfpr_28) lfd 28,-32(11)
+FUNC_START(_restfpr_29) lfd 29,-24(11)
+FUNC_START(_restfpr_30) lfd 30,-16(11)
+FUNC_START(_restfpr_31) lfd 31,-8(11)
+ blr
+FUNC_END(_restfpr_31)
+FUNC_END(_restfpr_30)
+FUNC_END(_restfpr_29)
+FUNC_END(_restfpr_28)
+FUNC_END(_restfpr_27)
+FUNC_END(_restfpr_26)
+FUNC_END(_restfpr_25)
+FUNC_END(_restfpr_24)
+FUNC_END(_restfpr_23)
+FUNC_END(_restfpr_22)
+FUNC_END(_restfpr_21)
+FUNC_END(_restfpr_20)
+FUNC_END(_restfpr_19)
+FUNC_END(_restfpr_18)
+FUNC_END(_restfpr_17)
+FUNC_END(_restfpr_16)
+FUNC_END(_restfpr_15)
+FUNC_END(_restfpr_14)
+
+#endif
diff --git a/gcc/config/rs6000/crtresgpr.asm b/gcc/config/rs6000/crtresgpr.asm
new file mode 100644
index 00000000000..928341d7624
--- /dev/null
+++ b/gcc/config/rs6000/crtresgpr.asm
@@ -0,0 +1,90 @@
+/*
+ * Special support for eabi and SVR4
+ *
+ * Copyright (C) 1995, 1996, 1998, 2000, 2001, 2008
+ * Free Software Foundation, Inc.
+ * Written By Michael Meissner
+ * 64-bit support written by David Edelsohn
+ *
+ * This file 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 2, or (at your option) any
+ * later version.
+ *
+ * In addition to the permissions in the GNU General Public License, the
+ * Free Software Foundation gives you unlimited permission to link the
+ * compiled version of this file with other programs, and to distribute
+ * those programs without any restriction coming from the use of this
+ * file. (The General Public License restrictions do apply in other
+ * respects; for example, they cover modification of the file, and
+ * distribution when not linked into another program.)
+ *
+ * This file 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 this program; see the file COPYING. If not, write to
+ * the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ * As a special exception, if you link this library with files
+ * compiled with GCC to produce an executable, this does not cause
+ * the resulting executable to be covered by the GNU General Public License.
+ * This exception does not however invalidate any other reasons why
+ * the executable file might be covered by the GNU General Public License.
+ */
+
+/* Do any initializations needed for the eabi environment */
+
+ .file "crtresgpr.asm"
+ .section ".text"
+ #include "ppc-asm.h"
+
+/* On PowerPC64 Linux, these functions are provided by the linker. */
+#ifndef __powerpc64__
+
+/* Routines for restoring integer registers, called by the compiler. */
+/* Called with r11 pointing to the stack header word of the caller of the */
+/* function, just beyond the end of the integer restore area. */
+
+FUNC_START(_restgpr_14) lwz 14,-72(11) /* restore gp registers */
+FUNC_START(_restgpr_15) lwz 15,-68(11)
+FUNC_START(_restgpr_16) lwz 16,-64(11)
+FUNC_START(_restgpr_17) lwz 17,-60(11)
+FUNC_START(_restgpr_18) lwz 18,-56(11)
+FUNC_START(_restgpr_19) lwz 19,-52(11)
+FUNC_START(_restgpr_20) lwz 20,-48(11)
+FUNC_START(_restgpr_21) lwz 21,-44(11)
+FUNC_START(_restgpr_22) lwz 22,-40(11)
+FUNC_START(_restgpr_23) lwz 23,-36(11)
+FUNC_START(_restgpr_24) lwz 24,-32(11)
+FUNC_START(_restgpr_25) lwz 25,-28(11)
+FUNC_START(_restgpr_26) lwz 26,-24(11)
+FUNC_START(_restgpr_27) lwz 27,-20(11)
+FUNC_START(_restgpr_28) lwz 28,-16(11)
+FUNC_START(_restgpr_29) lwz 29,-12(11)
+FUNC_START(_restgpr_30) lwz 30,-8(11)
+FUNC_START(_restgpr_31) lwz 31,-4(11)
+ blr
+FUNC_END(_restgpr_31)
+FUNC_END(_restgpr_30)
+FUNC_END(_restgpr_29)
+FUNC_END(_restgpr_28)
+FUNC_END(_restgpr_27)
+FUNC_END(_restgpr_26)
+FUNC_END(_restgpr_25)
+FUNC_END(_restgpr_24)
+FUNC_END(_restgpr_23)
+FUNC_END(_restgpr_22)
+FUNC_END(_restgpr_21)
+FUNC_END(_restgpr_20)
+FUNC_END(_restgpr_19)
+FUNC_END(_restgpr_18)
+FUNC_END(_restgpr_17)
+FUNC_END(_restgpr_16)
+FUNC_END(_restgpr_15)
+FUNC_END(_restgpr_14)
+
+#endif
diff --git a/gcc/config/rs6000/crtresxfpr.asm b/gcc/config/rs6000/crtresxfpr.asm
new file mode 100644
index 00000000000..2a734866f07
--- /dev/null
+++ b/gcc/config/rs6000/crtresxfpr.asm
@@ -0,0 +1,95 @@
+/*
+ * Special support for eabi and SVR4
+ *
+ * Copyright (C) 1995, 1996, 1998, 2000, 2001, 2008
+ * Free Software Foundation, Inc.
+ * Written By Michael Meissner
+ * 64-bit support written by David Edelsohn
+ *
+ * This file 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 2, or (at your option) any
+ * later version.
+ *
+ * In addition to the permissions in the GNU General Public License, the
+ * Free Software Foundation gives you unlimited permission to link the
+ * compiled version of this file with other programs, and to distribute
+ * those programs without any restriction coming from the use of this
+ * file. (The General Public License restrictions do apply in other
+ * respects; for example, they cover modification of the file, and
+ * distribution when not linked into another program.)
+ *
+ * This file 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 this program; see the file COPYING. If not, write to
+ * the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ * As a special exception, if you link this library with files
+ * compiled with GCC to produce an executable, this does not cause
+ * the resulting executable to be covered by the GNU General Public License.
+ * This exception does not however invalidate any other reasons why
+ * the executable file might be covered by the GNU General Public License.
+ */
+
+/* Do any initializations needed for the eabi environment */
+
+ .file "crtresxfpr.asm"
+ .section ".text"
+ #include "ppc-asm.h"
+
+/* On PowerPC64 Linux, these functions are provided by the linker. */
+#ifndef __powerpc64__
+
+/* Routines for restoring floating point registers, called by the compiler. */
+/* Called with r11 pointing to the stack header word of the caller of the */
+/* function, just beyond the end of the floating point save area. */
+/* In addition to restoring the fp registers, it will return to the caller's */
+/* caller */
+
+FUNC_START(_restfpr_14_x) lfd 14,-144(11) /* restore fp registers */
+FUNC_START(_restfpr_15_x) lfd 15,-136(11)
+FUNC_START(_restfpr_16_x) lfd 16,-128(11)
+FUNC_START(_restfpr_17_x) lfd 17,-120(11)
+FUNC_START(_restfpr_18_x) lfd 18,-112(11)
+FUNC_START(_restfpr_19_x) lfd 19,-104(11)
+FUNC_START(_restfpr_20_x) lfd 20,-96(11)
+FUNC_START(_restfpr_21_x) lfd 21,-88(11)
+FUNC_START(_restfpr_22_x) lfd 22,-80(11)
+FUNC_START(_restfpr_23_x) lfd 23,-72(11)
+FUNC_START(_restfpr_24_x) lfd 24,-64(11)
+FUNC_START(_restfpr_25_x) lfd 25,-56(11)
+FUNC_START(_restfpr_26_x) lfd 26,-48(11)
+FUNC_START(_restfpr_27_x) lfd 27,-40(11)
+FUNC_START(_restfpr_28_x) lfd 28,-32(11)
+FUNC_START(_restfpr_29_x) lfd 29,-24(11)
+FUNC_START(_restfpr_30_x) lfd 30,-16(11)
+FUNC_START(_restfpr_31_x) lwz 0,4(11)
+ lfd 31,-8(11)
+ mtlr 0
+ mr 1,11
+ blr
+FUNC_END(_restfpr_31_x)
+FUNC_END(_restfpr_30_x)
+FUNC_END(_restfpr_29_x)
+FUNC_END(_restfpr_28_x)
+FUNC_END(_restfpr_27_x)
+FUNC_END(_restfpr_26_x)
+FUNC_END(_restfpr_25_x)
+FUNC_END(_restfpr_24_x)
+FUNC_END(_restfpr_23_x)
+FUNC_END(_restfpr_22_x)
+FUNC_END(_restfpr_21_x)
+FUNC_END(_restfpr_20_x)
+FUNC_END(_restfpr_19_x)
+FUNC_END(_restfpr_18_x)
+FUNC_END(_restfpr_17_x)
+FUNC_END(_restfpr_16_x)
+FUNC_END(_restfpr_15_x)
+FUNC_END(_restfpr_14_x)
+
+#endif
diff --git a/gcc/config/rs6000/crtresxgpr.asm b/gcc/config/rs6000/crtresxgpr.asm
new file mode 100644
index 00000000000..1bab865c452
--- /dev/null
+++ b/gcc/config/rs6000/crtresxgpr.asm
@@ -0,0 +1,93 @@
+/*
+ * Special support for eabi and SVR4
+ *
+ * Copyright (C) 1995, 1996, 1998, 2000, 2001, 2008
+ * Free Software Foundation, Inc.
+ * Written By Michael Meissner
+ * 64-bit support written by David Edelsohn
+ *
+ * This file 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 2, or (at your option) any
+ * later version.
+ *
+ * In addition to the permissions in the GNU General Public License, the
+ * Free Software Foundation gives you unlimited permission to link the
+ * compiled version of this file with other programs, and to distribute
+ * those programs without any restriction coming from the use of this
+ * file. (The General Public License restrictions do apply in other
+ * respects; for example, they cover modification of the file, and
+ * distribution when not linked into another program.)
+ *
+ * This file 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 this program; see the file COPYING. If not, write to
+ * the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ * As a special exception, if you link this library with files
+ * compiled with GCC to produce an executable, this does not cause
+ * the resulting executable to be covered by the GNU General Public License.
+ * This exception does not however invalidate any other reasons why
+ * the executable file might be covered by the GNU General Public License.
+ */
+
+/* Do any initializations needed for the eabi environment */
+
+ .file "crtresxgpr.asm"
+ .section ".text"
+ #include "ppc-asm.h"
+
+/* On PowerPC64 Linux, these functions are provided by the linker. */
+#ifndef __powerpc64__
+
+/* Routines for restoring integer registers, called by the compiler. */
+/* Called with r11 pointing to the stack header word of the caller of the */
+/* function, just beyond the end of the integer restore area. */
+
+FUNC_START(_restgpr_14_x) lwz 14,-72(11) /* restore gp registers */
+FUNC_START(_restgpr_15_x) lwz 15,-68(11)
+FUNC_START(_restgpr_16_x) lwz 16,-64(11)
+FUNC_START(_restgpr_17_x) lwz 17,-60(11)
+FUNC_START(_restgpr_18_x) lwz 18,-56(11)
+FUNC_START(_restgpr_19_x) lwz 19,-52(11)
+FUNC_START(_restgpr_20_x) lwz 20,-48(11)
+FUNC_START(_restgpr_21_x) lwz 21,-44(11)
+FUNC_START(_restgpr_22_x) lwz 22,-40(11)
+FUNC_START(_restgpr_23_x) lwz 23,-36(11)
+FUNC_START(_restgpr_24_x) lwz 24,-32(11)
+FUNC_START(_restgpr_25_x) lwz 25,-28(11)
+FUNC_START(_restgpr_26_x) lwz 26,-24(11)
+FUNC_START(_restgpr_27_x) lwz 27,-20(11)
+FUNC_START(_restgpr_28_x) lwz 28,-16(11)
+FUNC_START(_restgpr_29_x) lwz 29,-12(11)
+FUNC_START(_restgpr_30_x) lwz 30,-8(11)
+FUNC_START(_restgpr_31_x) lwz 0,4(11)
+ lwz 31,-4(11)
+ mtlr 0
+ mr 1,11
+ blr
+FUNC_END(_restgpr_31_x)
+FUNC_END(_restgpr_30_x)
+FUNC_END(_restgpr_29_x)
+FUNC_END(_restgpr_28_x)
+FUNC_END(_restgpr_27_x)
+FUNC_END(_restgpr_26_x)
+FUNC_END(_restgpr_25_x)
+FUNC_END(_restgpr_24_x)
+FUNC_END(_restgpr_23_x)
+FUNC_END(_restgpr_22_x)
+FUNC_END(_restgpr_21_x)
+FUNC_END(_restgpr_20_x)
+FUNC_END(_restgpr_19_x)
+FUNC_END(_restgpr_18_x)
+FUNC_END(_restgpr_17_x)
+FUNC_END(_restgpr_16_x)
+FUNC_END(_restgpr_15_x)
+FUNC_END(_restgpr_14_x)
+
+#endif
diff --git a/gcc/config/rs6000/crtsavfpr.asm b/gcc/config/rs6000/crtsavfpr.asm
new file mode 100644
index 00000000000..f3d708f6200
--- /dev/null
+++ b/gcc/config/rs6000/crtsavfpr.asm
@@ -0,0 +1,90 @@
+/*
+ * Special support for eabi and SVR4
+ *
+ * Copyright (C) 1995, 1996, 1998, 2000, 2001, 2008
+ * Free Software Foundation, Inc.
+ * Written By Michael Meissner
+ * 64-bit support written by David Edelsohn
+ *
+ * This file 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 2, or (at your option) any
+ * later version.
+ *
+ * In addition to the permissions in the GNU General Public License, the
+ * Free Software Foundation gives you unlimited permission to link the
+ * compiled version of this file with other programs, and to distribute
+ * those programs without any restriction coming from the use of this
+ * file. (The General Public License restrictions do apply in other
+ * respects; for example, they cover modification of the file, and
+ * distribution when not linked into another program.)
+ *
+ * This file 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 this program; see the file COPYING. If not, write to
+ * the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ * As a special exception, if you link this library with files
+ * compiled with GCC to produce an executable, this does not cause
+ * the resulting executable to be covered by the GNU General Public License.
+ * This exception does not however invalidate any other reasons why
+ * the executable file might be covered by the GNU General Public License.
+ */
+
+/* Do any initializations needed for the eabi environment */
+
+ .file "crtsavfpr.asm"
+ .section ".text"
+ #include "ppc-asm.h"
+
+/* On PowerPC64 Linux, these functions are provided by the linker. */
+#ifndef __powerpc64__
+
+/* Routines for saving floating point registers, called by the compiler. */
+/* Called with r11 pointing to the stack header word of the caller of the */
+/* function, just beyond the end of the floating point save area. */
+
+FUNC_START(_savefpr_14) stfd 14,-144(11) /* save fp registers */
+FUNC_START(_savefpr_15) stfd 15,-136(11)
+FUNC_START(_savefpr_16) stfd 16,-128(11)
+FUNC_START(_savefpr_17) stfd 17,-120(11)
+FUNC_START(_savefpr_18) stfd 18,-112(11)
+FUNC_START(_savefpr_19) stfd 19,-104(11)
+FUNC_START(_savefpr_20) stfd 20,-96(11)
+FUNC_START(_savefpr_21) stfd 21,-88(11)
+FUNC_START(_savefpr_22) stfd 22,-80(11)
+FUNC_START(_savefpr_23) stfd 23,-72(11)
+FUNC_START(_savefpr_24) stfd 24,-64(11)
+FUNC_START(_savefpr_25) stfd 25,-56(11)
+FUNC_START(_savefpr_26) stfd 26,-48(11)
+FUNC_START(_savefpr_27) stfd 27,-40(11)
+FUNC_START(_savefpr_28) stfd 28,-32(11)
+FUNC_START(_savefpr_29) stfd 29,-24(11)
+FUNC_START(_savefpr_30) stfd 30,-16(11)
+FUNC_START(_savefpr_31) stfd 31,-8(11)
+ blr
+FUNC_END(_savefpr_31)
+FUNC_END(_savefpr_30)
+FUNC_END(_savefpr_29)
+FUNC_END(_savefpr_28)
+FUNC_END(_savefpr_27)
+FUNC_END(_savefpr_26)
+FUNC_END(_savefpr_25)
+FUNC_END(_savefpr_24)
+FUNC_END(_savefpr_23)
+FUNC_END(_savefpr_22)
+FUNC_END(_savefpr_21)
+FUNC_END(_savefpr_20)
+FUNC_END(_savefpr_19)
+FUNC_END(_savefpr_18)
+FUNC_END(_savefpr_17)
+FUNC_END(_savefpr_16)
+FUNC_END(_savefpr_15)
+FUNC_END(_savefpr_14)
+
+#endif
diff --git a/gcc/config/rs6000/crtsavgpr.asm b/gcc/config/rs6000/crtsavgpr.asm
new file mode 100644
index 00000000000..0e244316fa6
--- /dev/null
+++ b/gcc/config/rs6000/crtsavgpr.asm
@@ -0,0 +1,90 @@
+/*
+ * Special support for eabi and SVR4
+ *
+ * Copyright (C) 1995, 1996, 1998, 2000, 2001, 2008
+ * Free Software Foundation, Inc.
+ * Written By Michael Meissner
+ * 64-bit support written by David Edelsohn
+ *
+ * This file 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 2, or (at your option) any
+ * later version.
+ *
+ * In addition to the permissions in the GNU General Public License, the
+ * Free Software Foundation gives you unlimited permission to link the
+ * compiled version of this file with other programs, and to distribute
+ * those programs without any restriction coming from the use of this
+ * file. (The General Public License restrictions do apply in other
+ * respects; for example, they cover modification of the file, and
+ * distribution when not linked into another program.)
+ *
+ * This file 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 this program; see the file COPYING. If not, write to
+ * the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ * As a special exception, if you link this library with files
+ * compiled with GCC to produce an executable, this does not cause
+ * the resulting executable to be covered by the GNU General Public License.
+ * This exception does not however invalidate any other reasons why
+ * the executable file might be covered by the GNU General Public License.
+ */
+
+/* Do any initializations needed for the eabi environment */
+
+ .file "crtsavgpr.asm"
+ .section ".text"
+ #include "ppc-asm.h"
+
+/* On PowerPC64 Linux, these functions are provided by the linker. */
+#ifndef __powerpc64__
+
+/* Routines for saving integer registers, called by the compiler. */
+/* Called with r11 pointing to the stack header word of the caller of the */
+/* function, just beyond the end of the integer save area. */
+
+FUNC_START(_savegpr_14) stw 14,-72(11) /* save gp registers */
+FUNC_START(_savegpr_15) stw 15,-68(11)
+FUNC_START(_savegpr_16) stw 16,-64(11)
+FUNC_START(_savegpr_17) stw 17,-60(11)
+FUNC_START(_savegpr_18) stw 18,-56(11)
+FUNC_START(_savegpr_19) stw 19,-52(11)
+FUNC_START(_savegpr_20) stw 20,-48(11)
+FUNC_START(_savegpr_21) stw 21,-44(11)
+FUNC_START(_savegpr_22) stw 22,-40(11)
+FUNC_START(_savegpr_23) stw 23,-36(11)
+FUNC_START(_savegpr_24) stw 24,-32(11)
+FUNC_START(_savegpr_25) stw 25,-28(11)
+FUNC_START(_savegpr_26) stw 26,-24(11)
+FUNC_START(_savegpr_27) stw 27,-20(11)
+FUNC_START(_savegpr_28) stw 28,-16(11)
+FUNC_START(_savegpr_29) stw 29,-12(11)
+FUNC_START(_savegpr_30) stw 30,-8(11)
+FUNC_START(_savegpr_31) stw 31,-4(11)
+ blr
+FUNC_END(_savegpr_31)
+FUNC_END(_savegpr_30)
+FUNC_END(_savegpr_29)
+FUNC_END(_savegpr_28)
+FUNC_END(_savegpr_27)
+FUNC_END(_savegpr_26)
+FUNC_END(_savegpr_25)
+FUNC_END(_savegpr_24)
+FUNC_END(_savegpr_23)
+FUNC_END(_savegpr_22)
+FUNC_END(_savegpr_21)
+FUNC_END(_savegpr_20)
+FUNC_END(_savegpr_19)
+FUNC_END(_savegpr_18)
+FUNC_END(_savegpr_17)
+FUNC_END(_savegpr_16)
+FUNC_END(_savegpr_15)
+FUNC_END(_savegpr_14)
+
+#endif
diff --git a/gcc/config/rs6000/e500crtres32gpr.asm b/gcc/config/rs6000/e500crtres32gpr.asm
new file mode 100644
index 00000000000..bd5f825447f
--- /dev/null
+++ b/gcc/config/rs6000/e500crtres32gpr.asm
@@ -0,0 +1,84 @@
+/*
+ * Special support for e500 eabi and SVR4
+ *
+ * Copyright (C) 2008 Free Software Foundation, Inc.
+ * Written by Nathan Froyd
+ *
+ * This file 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 2, or (at your option) any
+ * later version.
+ *
+ * In addition to the permissions in the GNU General Public License, the
+ * Free Software Foundation gives you unlimited permission to link the
+ * compiled version of this file with other programs, and to distribute
+ * those programs without any restriction coming from the use of this
+ * file. (The General Public License restrictions do apply in other
+ * respects; for example, they cover modification of the file, and
+ * distribution when not linked into another program.)
+ *
+ * This file 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 this program; see the file COPYING. If not, write to
+ * the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ * As a special exception, if you link this library with files
+ * compiled with GCC to produce an executable, this does not cause
+ * the resulting executable to be covered by the GNU General Public License.
+ * This exception does not however invalidate any other reasons why
+ * the executable file might be covered by the GNU General Public License.
+ */
+
+ .file "e500crtres32gpr.asm"
+ .section ".text"
+ #include "ppc-asm.h"
+
+#ifdef __SPE__
+
+/* Routines for restoring 32-bit integer registers, called by the compiler. */
+/* "Bare" versions that simply return to their caller. */
+
+FUNC_START(_rest32gpr_14) lwz 14,-72(11)
+FUNC_START(_rest32gpr_15) lwz 15,-68(11)
+FUNC_START(_rest32gpr_16) lwz 16,-64(11)
+FUNC_START(_rest32gpr_17) lwz 17,-60(11)
+FUNC_START(_rest32gpr_18) lwz 18,-56(11)
+FUNC_START(_rest32gpr_19) lwz 19,-52(11)
+FUNC_START(_rest32gpr_20) lwz 20,-48(11)
+FUNC_START(_rest32gpr_21) lwz 21,-44(11)
+FUNC_START(_rest32gpr_22) lwz 22,-40(11)
+FUNC_START(_rest32gpr_23) lwz 23,-36(11)
+FUNC_START(_rest32gpr_24) lwz 24,-32(11)
+FUNC_START(_rest32gpr_25) lwz 25,-28(11)
+FUNC_START(_rest32gpr_26) lwz 26,-24(11)
+FUNC_START(_rest32gpr_27) lwz 27,-20(11)
+FUNC_START(_rest32gpr_28) lwz 28,-16(11)
+FUNC_START(_rest32gpr_29) lwz 29,-12(11)
+FUNC_START(_rest32gpr_30) lwz 30,-8(11)
+FUNC_START(_rest32gpr_31) lwz 31,-4(11)
+ blr
+FUNC_END(_rest32gpr_31)
+FUNC_END(_rest32gpr_30)
+FUNC_END(_rest32gpr_29)
+FUNC_END(_rest32gpr_28)
+FUNC_END(_rest32gpr_27)
+FUNC_END(_rest32gpr_26)
+FUNC_END(_rest32gpr_25)
+FUNC_END(_rest32gpr_24)
+FUNC_END(_rest32gpr_23)
+FUNC_END(_rest32gpr_22)
+FUNC_END(_rest32gpr_21)
+FUNC_END(_rest32gpr_20)
+FUNC_END(_rest32gpr_19)
+FUNC_END(_rest32gpr_18)
+FUNC_END(_rest32gpr_17)
+FUNC_END(_rest32gpr_16)
+FUNC_END(_rest32gpr_15)
+FUNC_END(_rest32gpr_14)
+
+#endif
diff --git a/gcc/config/rs6000/e500crtres64gpr.asm b/gcc/config/rs6000/e500crtres64gpr.asm
new file mode 100644
index 00000000000..73ab506710c
--- /dev/null
+++ b/gcc/config/rs6000/e500crtres64gpr.asm
@@ -0,0 +1,84 @@
+/*
+ * Special support for e500 eabi and SVR4
+ *
+ * Copyright (C) 2008 Free Software Foundation, Inc.
+ * Written by Nathan Froyd
+ *
+ * This file 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 2, or (at your option) any
+ * later version.
+ *
+ * In addition to the permissions in the GNU General Public License, the
+ * Free Software Foundation gives you unlimited permission to link the
+ * compiled version of this file with other programs, and to distribute
+ * those programs without any restriction coming from the use of this
+ * file. (The General Public License restrictions do apply in other
+ * respects; for example, they cover modification of the file, and
+ * distribution when not linked into another program.)
+ *
+ * This file 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 this program; see the file COPYING. If not, write to
+ * the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ * As a special exception, if you link this library with files
+ * compiled with GCC to produce an executable, this does not cause
+ * the resulting executable to be covered by the GNU General Public License.
+ * This exception does not however invalidate any other reasons why
+ * the executable file might be covered by the GNU General Public License.
+ */
+
+ .file "e500crtres64gpr.asm"
+ .section ".text"
+ #include "ppc-asm.h"
+
+#ifdef __SPE__
+
+/* Routines for restoring 64-bit integer registers, called by the compiler. */
+/* "Bare" versions that return to their caller. */
+
+FUNC_START(_rest64gpr_14) evldd 14,0(11)
+FUNC_START(_rest64gpr_15) evldd 15,8(11)
+FUNC_START(_rest64gpr_16) evldd 16,16(11)
+FUNC_START(_rest64gpr_17) evldd 17,24(11)
+FUNC_START(_rest64gpr_18) evldd 18,32(11)
+FUNC_START(_rest64gpr_19) evldd 19,40(11)
+FUNC_START(_rest64gpr_20) evldd 20,48(11)
+FUNC_START(_rest64gpr_21) evldd 21,56(11)
+FUNC_START(_rest64gpr_22) evldd 22,64(11)
+FUNC_START(_rest64gpr_23) evldd 23,72(11)
+FUNC_START(_rest64gpr_24) evldd 24,80(11)
+FUNC_START(_rest64gpr_25) evldd 25,88(11)
+FUNC_START(_rest64gpr_26) evldd 26,96(11)
+FUNC_START(_rest64gpr_27) evldd 27,104(11)
+FUNC_START(_rest64gpr_28) evldd 28,112(11)
+FUNC_START(_rest64gpr_29) evldd 29,120(11)
+FUNC_START(_rest64gpr_30) evldd 30,128(11)
+FUNC_START(_rest64gpr_31) evldd 31,136(11)
+ blr
+FUNC_END(_rest64gpr_31)
+FUNC_END(_rest64gpr_30)
+FUNC_END(_rest64gpr_29)
+FUNC_END(_rest64gpr_28)
+FUNC_END(_rest64gpr_27)
+FUNC_END(_rest64gpr_26)
+FUNC_END(_rest64gpr_25)
+FUNC_END(_rest64gpr_24)
+FUNC_END(_rest64gpr_23)
+FUNC_END(_rest64gpr_22)
+FUNC_END(_rest64gpr_21)
+FUNC_END(_rest64gpr_20)
+FUNC_END(_rest64gpr_19)
+FUNC_END(_rest64gpr_18)
+FUNC_END(_rest64gpr_17)
+FUNC_END(_rest64gpr_16)
+FUNC_END(_rest64gpr_15)
+FUNC_END(_rest64gpr_14)
+
+#endif
diff --git a/gcc/config/rs6000/e500crtres64gprctr.asm b/gcc/config/rs6000/e500crtres64gprctr.asm
new file mode 100644
index 00000000000..93b5963321a
--- /dev/null
+++ b/gcc/config/rs6000/e500crtres64gprctr.asm
@@ -0,0 +1,83 @@
+/*
+ * Special support for e500 eabi and SVR4
+ *
+ * Copyright (C) 2008 Free Software Foundation, Inc.
+ * Written by Nathan Froyd
+ *
+ * This file 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 2, or (at your option) any
+ * later version.
+ *
+ * In addition to the permissions in the GNU General Public License, the
+ * Free Software Foundation gives you unlimited permission to link the
+ * compiled version of this file with other programs, and to distribute
+ * those programs without any restriction coming from the use of this
+ * file. (The General Public License restrictions do apply in other
+ * respects; for example, they cover modification of the file, and
+ * distribution when not linked into another program.)
+ *
+ * This file 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 this program; see the file COPYING. If not, write to
+ * the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ * As a special exception, if you link this library with files
+ * compiled with GCC to produce an executable, this does not cause
+ * the resulting executable to be covered by the GNU General Public License.
+ * This exception does not however invalidate any other reasons why
+ * the executable file might be covered by the GNU General Public License.
+ */
+
+ .file "e500crtres64gprctr.asm"
+ .section ".text"
+ #include "ppc-asm.h"
+
+#ifdef __SPE__
+
+/* Routines for restoring 64-bit integer registers where the number of
+ registers to be restored is passed in CTR, called by the compiler. */
+
+FUNC_START(_rest64gpr_ctr_14) evldd 14,0(11)
+ bdz _rest64_gpr_ctr_done
+FUNC_START(_rest64gpr_ctr_15) evldd 15,8(11)
+ bdz _rest64_gpr_ctr_done
+FUNC_START(_rest64gpr_ctr_16) evldd 16,16(11)
+ bdz _rest64_gpr_ctr_done
+FUNC_START(_rest64gpr_ctr_17) evldd 17,24(11)
+ bdz _rest64_gpr_ctr_done
+FUNC_START(_rest64gpr_ctr_18) evldd 18,32(11)
+ bdz _rest64_gpr_ctr_done
+FUNC_START(_rest64gpr_ctr_19) evldd 19,40(11)
+ bdz _rest64_gpr_ctr_done
+FUNC_START(_rest64gpr_ctr_20) evldd 20,48(11)
+ bdz _rest64_gpr_ctr_done
+FUNC_START(_rest64gpr_ctr_21) evldd 21,56(11)
+ bdz _rest64_gpr_ctr_done
+FUNC_START(_rest64gpr_ctr_22) evldd 22,64(11)
+ bdz _rest64_gpr_ctr_done
+FUNC_START(_rest64gpr_ctr_23) evldd 23,72(11)
+ bdz _rest64_gpr_ctr_done
+FUNC_START(_rest64gpr_ctr_24) evldd 24,80(11)
+ bdz _rest64_gpr_ctr_done
+FUNC_START(_rest64gpr_ctr_25) evldd 25,88(11)
+ bdz _rest64_gpr_ctr_done
+FUNC_START(_rest64gpr_ctr_26) evldd 26,96(11)
+ bdz _rest64_gpr_ctr_done
+FUNC_START(_rest64gpr_ctr_27) evldd 27,104(11)
+ bdz _rest64_gpr_ctr_done
+FUNC_START(_rest64gpr_ctr_28) evldd 28,112(11)
+ bdz _rest64_gpr_ctr_done
+FUNC_START(_rest64gpr_ctr_29) evldd 29,120(11)
+ bdz _rest64_gpr_ctr_done
+FUNC_START(_rest64gpr_ctr_30) evldd 30,128(11)
+ bdz _rest64_gpr_ctr_done
+FUNC_START(_rest64gpr_ctr_31) evldd 31,136(11)
+_rest64gpr_ctr_done: blr
+
+#endif
diff --git a/gcc/config/rs6000/e500crtrest32gpr.asm b/gcc/config/rs6000/e500crtrest32gpr.asm
new file mode 100644
index 00000000000..42f81d689f6
--- /dev/null
+++ b/gcc/config/rs6000/e500crtrest32gpr.asm
@@ -0,0 +1,86 @@
+/*
+ * Special support for e500 eabi and SVR4
+ *
+ * Copyright (C) 2008 Free Software Foundation, Inc.
+ * Written by Nathan Froyd
+ *
+ * This file 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 2, or (at your option) any
+ * later version.
+ *
+ * In addition to the permissions in the GNU General Public License, the
+ * Free Software Foundation gives you unlimited permission to link the
+ * compiled version of this file with other programs, and to distribute
+ * those programs without any restriction coming from the use of this
+ * file. (The General Public License restrictions do apply in other
+ * respects; for example, they cover modification of the file, and
+ * distribution when not linked into another program.)
+ *
+ * This file 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 this program; see the file COPYING. If not, write to
+ * the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ * As a special exception, if you link this library with files
+ * compiled with GCC to produce an executable, this does not cause
+ * the resulting executable to be covered by the GNU General Public License.
+ * This exception does not however invalidate any other reasons why
+ * the executable file might be covered by the GNU General Public License.
+ */
+
+ .file "e500crtrest32gpr.asm"
+ .section ".text"
+ #include "ppc-asm.h"
+
+#ifdef __SPE__
+
+/* Routines for restoring 32-bit integer registers, called by the compiler. */
+/* "Tail" versions that perform a tail call. */
+
+FUNC_START(_rest32gpr_14_t) lwz 14,-72(11)
+FUNC_START(_rest32gpr_15_t) lwz 15,-68(11)
+FUNC_START(_rest32gpr_16_t) lwz 16,-64(11)
+FUNC_START(_rest32gpr_17_t) lwz 17,-60(11)
+FUNC_START(_rest32gpr_18_t) lwz 18,-56(11)
+FUNC_START(_rest32gpr_19_t) lwz 19,-52(11)
+FUNC_START(_rest32gpr_20_t) lwz 20,-48(11)
+FUNC_START(_rest32gpr_21_t) lwz 21,-44(11)
+FUNC_START(_rest32gpr_22_t) lwz 22,-40(11)
+FUNC_START(_rest32gpr_23_t) lwz 23,-36(11)
+FUNC_START(_rest32gpr_24_t) lwz 24,-32(11)
+FUNC_START(_rest32gpr_25_t) lwz 25,-28(11)
+FUNC_START(_rest32gpr_26_t) lwz 26,-24(11)
+FUNC_START(_rest32gpr_27_t) lwz 27,-20(11)
+FUNC_START(_rest32gpr_28_t) lwz 28,-16(11)
+FUNC_START(_rest32gpr_29_t) lwz 29,-12(11)
+FUNC_START(_rest32gpr_30_t) lwz 30,-8(11)
+FUNC_START(_rest32gpr_31_t) lwz 31,-4(11)
+ lwz 0,4(11)
+ mr 1,11
+ blr
+FUNC_END(_rest32gpr_31_t)
+FUNC_END(_rest32gpr_30_t)
+FUNC_END(_rest32gpr_29_t)
+FUNC_END(_rest32gpr_28_t)
+FUNC_END(_rest32gpr_27_t)
+FUNC_END(_rest32gpr_26_t)
+FUNC_END(_rest32gpr_25_t)
+FUNC_END(_rest32gpr_24_t)
+FUNC_END(_rest32gpr_23_t)
+FUNC_END(_rest32gpr_22_t)
+FUNC_END(_rest32gpr_21_t)
+FUNC_END(_rest32gpr_20_t)
+FUNC_END(_rest32gpr_19_t)
+FUNC_END(_rest32gpr_18_t)
+FUNC_END(_rest32gpr_17_t)
+FUNC_END(_rest32gpr_16_t)
+FUNC_END(_rest32gpr_15_t)
+FUNC_END(_rest32gpr_14_t)
+
+#endif
diff --git a/gcc/config/rs6000/e500crtrest64gpr.asm b/gcc/config/rs6000/e500crtrest64gpr.asm
new file mode 100644
index 00000000000..cf7092c7a28
--- /dev/null
+++ b/gcc/config/rs6000/e500crtrest64gpr.asm
@@ -0,0 +1,85 @@
+/*
+ * Special support for e500 eabi and SVR4
+ *
+ * Copyright (C) 2008 Free Software Foundation, Inc.
+ * Written by Nathan Froyd
+ *
+ * This file 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 2, or (at your option) any
+ * later version.
+ *
+ * In addition to the permissions in the GNU General Public License, the
+ * Free Software Foundation gives you unlimited permission to link the
+ * compiled version of this file with other programs, and to distribute
+ * those programs without any restriction coming from the use of this
+ * file. (The General Public License restrictions do apply in other
+ * respects; for example, they cover modification of the file, and
+ * distribution when not linked into another program.)
+ *
+ * This file 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 this program; see the file COPYING. If not, write to
+ * the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ * As a special exception, if you link this library with files
+ * compiled with GCC to produce an executable, this does not cause
+ * the resulting executable to be covered by the GNU General Public License.
+ * This exception does not however invalidate any other reasons why
+ * the executable file might be covered by the GNU General Public License.
+ */
+
+ .file "e500crtrest64gpr.asm"
+ .section ".text"
+ #include "ppc-asm.h"
+
+#ifdef __SPE__
+
+/* "Tail" versions that perform a tail call. */
+
+FUNC_START(_rest64gpr_14_t) evldd 14,0(11)
+FUNC_START(_rest64gpr_15_t) evldd 15,8(11)
+FUNC_START(_rest64gpr_16_t) evldd 16,16(11)
+FUNC_START(_rest64gpr_17_t) evldd 17,24(11)
+FUNC_START(_rest64gpr_18_t) evldd 18,32(11)
+FUNC_START(_rest64gpr_19_t) evldd 19,40(11)
+FUNC_START(_rest64gpr_20_t) evldd 20,48(11)
+FUNC_START(_rest64gpr_21_t) evldd 21,56(11)
+FUNC_START(_rest64gpr_22_t) evldd 22,64(11)
+FUNC_START(_rest64gpr_23_t) evldd 23,72(11)
+FUNC_START(_rest64gpr_24_t) evldd 24,80(11)
+FUNC_START(_rest64gpr_25_t) evldd 25,88(11)
+FUNC_START(_rest64gpr_26_t) evldd 26,96(11)
+FUNC_START(_rest64gpr_27_t) evldd 27,104(11)
+FUNC_START(_rest64gpr_28_t) evldd 28,112(11)
+FUNC_START(_rest64gpr_29_t) evldd 29,120(11)
+FUNC_START(_rest64gpr_30_t) evldd 30,128(11)
+FUNC_START(_rest64gpr_31_t) lwz 0,148(11)
+ evldd 31,136(11)
+ addi 1,11,144
+ blr
+FUNC_END(_rest64gpr_31_t)
+FUNC_END(_rest64gpr_30_t)
+FUNC_END(_rest64gpr_29_t)
+FUNC_END(_rest64gpr_28_t)
+FUNC_END(_rest64gpr_27_t)
+FUNC_END(_rest64gpr_26_t)
+FUNC_END(_rest64gpr_25_t)
+FUNC_END(_rest64gpr_24_t)
+FUNC_END(_rest64gpr_23_t)
+FUNC_END(_rest64gpr_22_t)
+FUNC_END(_rest64gpr_21_t)
+FUNC_END(_rest64gpr_20_t)
+FUNC_END(_rest64gpr_19_t)
+FUNC_END(_rest64gpr_18_t)
+FUNC_END(_rest64gpr_17_t)
+FUNC_END(_rest64gpr_16_t)
+FUNC_END(_rest64gpr_15_t)
+FUNC_END(_rest64gpr_14_t)
+
+#endif
diff --git a/gcc/config/rs6000/e500crtresx32gpr.asm b/gcc/config/rs6000/e500crtresx32gpr.asm
new file mode 100644
index 00000000000..9fba08b5511
--- /dev/null
+++ b/gcc/config/rs6000/e500crtresx32gpr.asm
@@ -0,0 +1,87 @@
+/*
+ * Special support for e500 eabi and SVR4
+ *
+ * Copyright (C) 2008 Free Software Foundation, Inc.
+ * Written by Nathan Froyd
+ *
+ * This file 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 2, or (at your option) any
+ * later version.
+ *
+ * In addition to the permissions in the GNU General Public License, the
+ * Free Software Foundation gives you unlimited permission to link the
+ * compiled version of this file with other programs, and to distribute
+ * those programs without any restriction coming from the use of this
+ * file. (The General Public License restrictions do apply in other
+ * respects; for example, they cover modification of the file, and
+ * distribution when not linked into another program.)
+ *
+ * This file 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 this program; see the file COPYING. If not, write to
+ * the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ * As a special exception, if you link this library with files
+ * compiled with GCC to produce an executable, this does not cause
+ * the resulting executable to be covered by the GNU General Public License.
+ * This exception does not however invalidate any other reasons why
+ * the executable file might be covered by the GNU General Public License.
+ */
+
+ .file "e500crtresx32gpr.asm"
+ .section ".text"
+ #include "ppc-asm.h"
+
+#ifdef __SPE__
+
+/* Routines for restoring 32-bit integer registers, called by the compiler. */
+/* "Exit" versions that return to the caller's caller. */
+
+FUNC_START(_rest32gpr_14_x) lwz 14,-72(11)
+FUNC_START(_rest32gpr_15_x) lwz 15,-68(11)
+FUNC_START(_rest32gpr_16_x) lwz 16,-64(11)
+FUNC_START(_rest32gpr_17_x) lwz 17,-60(11)
+FUNC_START(_rest32gpr_18_x) lwz 18,-56(11)
+FUNC_START(_rest32gpr_19_x) lwz 19,-52(11)
+FUNC_START(_rest32gpr_20_x) lwz 20,-48(11)
+FUNC_START(_rest32gpr_21_x) lwz 21,-44(11)
+FUNC_START(_rest32gpr_22_x) lwz 22,-40(11)
+FUNC_START(_rest32gpr_23_x) lwz 23,-36(11)
+FUNC_START(_rest32gpr_24_x) lwz 24,-32(11)
+FUNC_START(_rest32gpr_25_x) lwz 25,-28(11)
+FUNC_START(_rest32gpr_26_x) lwz 26,-24(11)
+FUNC_START(_rest32gpr_27_x) lwz 27,-20(11)
+FUNC_START(_rest32gpr_28_x) lwz 28,-16(11)
+FUNC_START(_rest32gpr_29_x) lwz 29,-12(11)
+FUNC_START(_rest32gpr_30_x) lwz 30,-8(11)
+FUNC_START(_rest32gpr_31_x) lwz 0,4(11)
+ lwz 31,-4(11)
+ mr 1,11
+ mtlr 0
+ blr
+FUNC_END(_rest32gpr_31_x)
+FUNC_END(_rest32gpr_30_x)
+FUNC_END(_rest32gpr_29_x)
+FUNC_END(_rest32gpr_28_x)
+FUNC_END(_rest32gpr_27_x)
+FUNC_END(_rest32gpr_26_x)
+FUNC_END(_rest32gpr_25_x)
+FUNC_END(_rest32gpr_24_x)
+FUNC_END(_rest32gpr_23_x)
+FUNC_END(_rest32gpr_22_x)
+FUNC_END(_rest32gpr_21_x)
+FUNC_END(_rest32gpr_20_x)
+FUNC_END(_rest32gpr_19_x)
+FUNC_END(_rest32gpr_18_x)
+FUNC_END(_rest32gpr_17_x)
+FUNC_END(_rest32gpr_16_x)
+FUNC_END(_rest32gpr_15_x)
+FUNC_END(_rest32gpr_14_x)
+
+#endif
diff --git a/gcc/config/rs6000/e500crtresx64gpr.asm b/gcc/config/rs6000/e500crtresx64gpr.asm
new file mode 100644
index 00000000000..e6a24e94b35
--- /dev/null
+++ b/gcc/config/rs6000/e500crtresx64gpr.asm
@@ -0,0 +1,86 @@
+/*
+ * Special support for e500 eabi and SVR4
+ *
+ * Copyright (C) 2008 Free Software Foundation, Inc.
+ * Written by Nathan Froyd
+ *
+ * This file 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 2, or (at your option) any
+ * later version.
+ *
+ * In addition to the permissions in the GNU General Public License, the
+ * Free Software Foundation gives you unlimited permission to link the
+ * compiled version of this file with other programs, and to distribute
+ * those programs without any restriction coming from the use of this
+ * file. (The General Public License restrictions do apply in other
+ * respects; for example, they cover modification of the file, and
+ * distribution when not linked into another program.)
+ *
+ * This file 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 this program; see the file COPYING. If not, write to
+ * the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ * As a special exception, if you link this library with files
+ * compiled with GCC to produce an executable, this does not cause
+ * the resulting executable to be covered by the GNU General Public License.
+ * This exception does not however invalidate any other reasons why
+ * the executable file might be covered by the GNU General Public License.
+ */
+
+ .file "e500crtresx64gpr.asm"
+ .section ".text"
+ #include "ppc-asm.h"
+
+#ifdef __SPE__
+
+/* "Exit" versions that return to their caller's caller. */
+
+FUNC_START(_rest64gpr_14_x) evldd 14,0(11)
+FUNC_START(_rest64gpr_15_x) evldd 15,8(11)
+FUNC_START(_rest64gpr_16_x) evldd 16,16(11)
+FUNC_START(_rest64gpr_17_x) evldd 17,24(11)
+FUNC_START(_rest64gpr_18_x) evldd 18,32(11)
+FUNC_START(_rest64gpr_19_x) evldd 19,40(11)
+FUNC_START(_rest64gpr_20_x) evldd 20,48(11)
+FUNC_START(_rest64gpr_21_x) evldd 21,56(11)
+FUNC_START(_rest64gpr_22_x) evldd 22,64(11)
+FUNC_START(_rest64gpr_23_x) evldd 23,72(11)
+FUNC_START(_rest64gpr_24_x) evldd 24,80(11)
+FUNC_START(_rest64gpr_25_x) evldd 25,88(11)
+FUNC_START(_rest64gpr_26_x) evldd 26,96(11)
+FUNC_START(_rest64gpr_27_x) evldd 27,104(11)
+FUNC_START(_rest64gpr_28_x) evldd 28,112(11)
+FUNC_START(_rest64gpr_29_x) evldd 29,120(11)
+FUNC_START(_rest64gpr_30_x) evldd 30,128(11)
+FUNC_START(_rest64gpr_31_x) lwz 0,148(11)
+ evldd 31,136(11)
+ addi 1,11,144
+ mtlr 0
+ blr
+FUNC_END(_rest64gpr_31_x)
+FUNC_END(_rest64gpr_30_x)
+FUNC_END(_rest64gpr_29_x)
+FUNC_END(_rest64gpr_28_x)
+FUNC_END(_rest64gpr_27_x)
+FUNC_END(_rest64gpr_26_x)
+FUNC_END(_rest64gpr_25_x)
+FUNC_END(_rest64gpr_24_x)
+FUNC_END(_rest64gpr_23_x)
+FUNC_END(_rest64gpr_22_x)
+FUNC_END(_rest64gpr_21_x)
+FUNC_END(_rest64gpr_20_x)
+FUNC_END(_rest64gpr_19_x)
+FUNC_END(_rest64gpr_18_x)
+FUNC_END(_rest64gpr_17_x)
+FUNC_END(_rest64gpr_16_x)
+FUNC_END(_rest64gpr_15_x)
+FUNC_END(_rest64gpr_14_x)
+
+#endif
diff --git a/gcc/config/rs6000/e500crtsav32gpr.asm b/gcc/config/rs6000/e500crtsav32gpr.asm
new file mode 100644
index 00000000000..6cf97956ccc
--- /dev/null
+++ b/gcc/config/rs6000/e500crtsav32gpr.asm
@@ -0,0 +1,84 @@
+/*
+ * Special support for e500 eabi and SVR4
+ *
+ * Copyright (C) 2008 Free Software Foundation, Inc.
+ * Written by Nathan Froyd
+ *
+ * This file 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 2, or (at your option) any
+ * later version.
+ *
+ * In addition to the permissions in the GNU General Public License, the
+ * Free Software Foundation gives you unlimited permission to link the
+ * compiled version of this file with other programs, and to distribute
+ * those programs without any restriction coming from the use of this
+ * file. (The General Public License restrictions do apply in other
+ * respects; for example, they cover modification of the file, and
+ * distribution when not linked into another program.)
+ *
+ * This file 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 this program; see the file COPYING. If not, write to
+ * the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ * As a special exception, if you link this library with files
+ * compiled with GCC to produce an executable, this does not cause
+ * the resulting executable to be covered by the GNU General Public License.
+ * This exception does not however invalidate any other reasons why
+ * the executable file might be covered by the GNU General Public License.
+ */
+
+ .file "e500crtsav32gpr.asm"
+ .section ".text"
+ #include "ppc-asm.h"
+
+#ifdef __SPE__
+
+/* Routines for saving 32-bit integer registers, called by the compiler. */
+/* "Bare" versions that simply return to their caller. */
+
+FUNC_START(_save32gpr_14) stw 14,-72(11)
+FUNC_START(_save32gpr_15) stw 15,-68(11)
+FUNC_START(_save32gpr_16) stw 16,-64(11)
+FUNC_START(_save32gpr_17) stw 17,-60(11)
+FUNC_START(_save32gpr_18) stw 18,-56(11)
+FUNC_START(_save32gpr_19) stw 19,-52(11)
+FUNC_START(_save32gpr_20) stw 20,-48(11)
+FUNC_START(_save32gpr_21) stw 21,-44(11)
+FUNC_START(_save32gpr_22) stw 22,-40(11)
+FUNC_START(_save32gpr_23) stw 23,-36(11)
+FUNC_START(_save32gpr_24) stw 24,-32(11)
+FUNC_START(_save32gpr_25) stw 25,-28(11)
+FUNC_START(_save32gpr_26) stw 26,-24(11)
+FUNC_START(_save32gpr_27) stw 27,-20(11)
+FUNC_START(_save32gpr_28) stw 28,-16(11)
+FUNC_START(_save32gpr_29) stw 29,-12(11)
+FUNC_START(_save32gpr_30) stw 30,-8(11)
+FUNC_START(_save32gpr_31) stw 31,-4(11)
+ blr
+FUNC_END(_save32gpr_31)
+FUNC_END(_save32gpr_30)
+FUNC_END(_save32gpr_29)
+FUNC_END(_save32gpr_28)
+FUNC_END(_save32gpr_27)
+FUNC_END(_save32gpr_26)
+FUNC_END(_save32gpr_25)
+FUNC_END(_save32gpr_24)
+FUNC_END(_save32gpr_23)
+FUNC_END(_save32gpr_22)
+FUNC_END(_save32gpr_21)
+FUNC_END(_save32gpr_20)
+FUNC_END(_save32gpr_19)
+FUNC_END(_save32gpr_18)
+FUNC_END(_save32gpr_17)
+FUNC_END(_save32gpr_16)
+FUNC_END(_save32gpr_15)
+FUNC_END(_save32gpr_14)
+
+#endif
diff --git a/gcc/config/rs6000/e500crtsav64gpr.asm b/gcc/config/rs6000/e500crtsav64gpr.asm
new file mode 100644
index 00000000000..6a2b0fac82a
--- /dev/null
+++ b/gcc/config/rs6000/e500crtsav64gpr.asm
@@ -0,0 +1,83 @@
+/*
+ * Special support for e500 eabi and SVR4
+ *
+ * Copyright (C) 2008 Free Software Foundation, Inc.
+ * Written by Nathan Froyd
+ *
+ * This file 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 2, or (at your option) any
+ * later version.
+ *
+ * In addition to the permissions in the GNU General Public License, the
+ * Free Software Foundation gives you unlimited permission to link the
+ * compiled version of this file with other programs, and to distribute
+ * those programs without any restriction coming from the use of this
+ * file. (The General Public License restrictions do apply in other
+ * respects; for example, they cover modification of the file, and
+ * distribution when not linked into another program.)
+ *
+ * This file 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 this program; see the file COPYING. If not, write to
+ * the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ * As a special exception, if you link this library with files
+ * compiled with GCC to produce an executable, this does not cause
+ * the resulting executable to be covered by the GNU General Public License.
+ * This exception does not however invalidate any other reasons why
+ * the executable file might be covered by the GNU General Public License.
+ */
+
+ .file "e500crtsav64gpr.asm"
+ .section ".text"
+ #include "ppc-asm.h"
+
+#ifdef __SPE__
+
+/* Routines for saving 64-bit integer registers, called by the compiler. */
+
+FUNC_START(_save64gpr_14) evstdd 14,0(11)
+FUNC_START(_save64gpr_15) evstdd 15,8(11)
+FUNC_START(_save64gpr_16) evstdd 16,16(11)
+FUNC_START(_save64gpr_17) evstdd 17,24(11)
+FUNC_START(_save64gpr_18) evstdd 18,32(11)
+FUNC_START(_save64gpr_19) evstdd 19,40(11)
+FUNC_START(_save64gpr_20) evstdd 20,48(11)
+FUNC_START(_save64gpr_21) evstdd 21,56(11)
+FUNC_START(_save64gpr_22) evstdd 22,64(11)
+FUNC_START(_save64gpr_23) evstdd 23,72(11)
+FUNC_START(_save64gpr_24) evstdd 24,80(11)
+FUNC_START(_save64gpr_25) evstdd 25,88(11)
+FUNC_START(_save64gpr_26) evstdd 26,96(11)
+FUNC_START(_save64gpr_27) evstdd 27,104(11)
+FUNC_START(_save64gpr_28) evstdd 28,112(11)
+FUNC_START(_save64gpr_29) evstdd 29,120(11)
+FUNC_START(_save64gpr_30) evstdd 30,128(11)
+FUNC_START(_save64gpr_31) evstdd 31,136(11)
+ blr
+FUNC_END(_save64gpr_31)
+FUNC_END(_save64gpr_30)
+FUNC_END(_save64gpr_29)
+FUNC_END(_save64gpr_28)
+FUNC_END(_save64gpr_27)
+FUNC_END(_save64gpr_26)
+FUNC_END(_save64gpr_25)
+FUNC_END(_save64gpr_24)
+FUNC_END(_save64gpr_23)
+FUNC_END(_save64gpr_22)
+FUNC_END(_save64gpr_21)
+FUNC_END(_save64gpr_20)
+FUNC_END(_save64gpr_19)
+FUNC_END(_save64gpr_18)
+FUNC_END(_save64gpr_17)
+FUNC_END(_save64gpr_16)
+FUNC_END(_save64gpr_15)
+FUNC_END(_save64gpr_14)
+
+#endif
diff --git a/gcc/config/rs6000/e500crtsav64gprctr.asm b/gcc/config/rs6000/e500crtsav64gprctr.asm
new file mode 100644
index 00000000000..1261bb06ed8
--- /dev/null
+++ b/gcc/config/rs6000/e500crtsav64gprctr.asm
@@ -0,0 +1,102 @@
+/*
+ * Special support for e500 eabi and SVR4
+ *
+ * Copyright (C) 2008 Free Software Foundation, Inc.
+ * Written by Nathan Froyd
+ *
+ * This file 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 2, or (at your option) any
+ * later version.
+ *
+ * In addition to the permissions in the GNU General Public License, the
+ * Free Software Foundation gives you unlimited permission to link the
+ * compiled version of this file with other programs, and to distribute
+ * those programs without any restriction coming from the use of this
+ * file. (The General Public License restrictions do apply in other
+ * respects; for example, they cover modification of the file, and
+ * distribution when not linked into another program.)
+ *
+ * This file 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 this program; see the file COPYING. If not, write to
+ * the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ * As a special exception, if you link this library with files
+ * compiled with GCC to produce an executable, this does not cause
+ * the resulting executable to be covered by the GNU General Public License.
+ * This exception does not however invalidate any other reasons why
+ * the executable file might be covered by the GNU General Public License.
+ */
+
+ .file "e500crtsav64gprctr.asm"
+ .section ".text"
+ #include "ppc-asm.h"
+
+#ifdef __SPE__
+
+/* Routines for saving 64-bit integer registers where the number of
+ registers to be saved is passed in CTR, called by the compiler. */
+/* "Bare" versions that return to their caller. */
+
+FUNC_START(_save64gpr_ctr_14) evstdd 14,0(11)
+ bdz _save64_gpr_ctr_done
+FUNC_START(_save64gpr_ctr_15) evstdd 15,8(11)
+ bdz _save64_gpr_ctr_done
+FUNC_START(_save64gpr_ctr_16) evstdd 16,16(11)
+ bdz _save64_gpr_ctr_done
+FUNC_START(_save64gpr_ctr_17) evstdd 17,24(11)
+ bdz _save64_gpr_ctr_done
+FUNC_START(_save64gpr_ctr_18) evstdd 18,32(11)
+ bdz _save64_gpr_ctr_done
+FUNC_START(_save64gpr_ctr_19) evstdd 19,40(11)
+ bdz _save64_gpr_ctr_done
+FUNC_START(_save64gpr_ctr_20) evstdd 20,48(11)
+ bdz _save64_gpr_ctr_done
+FUNC_START(_save64gpr_ctr_21) evstdd 21,56(11)
+ bdz _save64_gpr_ctr_done
+FUNC_START(_save64gpr_ctr_22) evstdd 22,64(11)
+ bdz _save64_gpr_ctr_done
+FUNC_START(_save64gpr_ctr_23) evstdd 23,72(11)
+ bdz _save64_gpr_ctr_done
+FUNC_START(_save64gpr_ctr_24) evstdd 24,80(11)
+ bdz _save64_gpr_ctr_done
+FUNC_START(_save64gpr_ctr_25) evstdd 25,88(11)
+ bdz _save64_gpr_ctr_done
+FUNC_START(_save64gpr_ctr_26) evstdd 26,96(11)
+ bdz _save64_gpr_ctr_done
+FUNC_START(_save64gpr_ctr_27) evstdd 27,104(11)
+ bdz _save64_gpr_ctr_done
+FUNC_START(_save64gpr_ctr_28) evstdd 28,112(11)
+ bdz _save64_gpr_ctr_done
+FUNC_START(_save64gpr_ctr_29) evstdd 29,120(11)
+ bdz _save64_gpr_ctr_done
+FUNC_START(_save64gpr_ctr_30) evstdd 30,128(11)
+ bdz _save64_gpr_ctr_done
+FUNC_START(_save64gpr_ctr_31) evstdd 31,136(11)
+_save64gpr_ctr_done: blr
+FUNC_END(_save64gpr_ctr_31)
+FUNC_END(_save64gpr_ctr_30)
+FUNC_END(_save64gpr_ctr_29)
+FUNC_END(_save64gpr_ctr_28)
+FUNC_END(_save64gpr_ctr_27)
+FUNC_END(_save64gpr_ctr_26)
+FUNC_END(_save64gpr_ctr_25)
+FUNC_END(_save64gpr_ctr_24)
+FUNC_END(_save64gpr_ctr_23)
+FUNC_END(_save64gpr_ctr_22)
+FUNC_END(_save64gpr_ctr_21)
+FUNC_END(_save64gpr_ctr_20)
+FUNC_END(_save64gpr_ctr_19)
+FUNC_END(_save64gpr_ctr_18)
+FUNC_END(_save64gpr_ctr_17)
+FUNC_END(_save64gpr_ctr_16)
+FUNC_END(_save64gpr_ctr_15)
+FUNC_END(_save64gpr_ctr_14)
+
+#endif
diff --git a/gcc/config/rs6000/e500crtsavg32gpr.asm b/gcc/config/rs6000/e500crtsavg32gpr.asm
new file mode 100644
index 00000000000..d648817a763
--- /dev/null
+++ b/gcc/config/rs6000/e500crtsavg32gpr.asm
@@ -0,0 +1,84 @@
+/*
+ * Special support for e500 eabi and SVR4
+ *
+ * Copyright (C) 2008 Free Software Foundation, Inc.
+ * Written by Nathan Froyd
+ *
+ * This file 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 2, or (at your option) any
+ * later version.
+ *
+ * In addition to the permissions in the GNU General Public License, the
+ * Free Software Foundation gives you unlimited permission to link the
+ * compiled version of this file with other programs, and to distribute
+ * those programs without any restriction coming from the use of this
+ * file. (The General Public License restrictions do apply in other
+ * respects; for example, they cover modification of the file, and
+ * distribution when not linked into another program.)
+ *
+ * This file 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 this program; see the file COPYING. If not, write to
+ * the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ * As a special exception, if you link this library with files
+ * compiled with GCC to produce an executable, this does not cause
+ * the resulting executable to be covered by the GNU General Public License.
+ * This exception does not however invalidate any other reasons why
+ * the executable file might be covered by the GNU General Public License.
+ */
+
+ .file "e500crtsavg32gpr.asm"
+ .section ".text"
+ #include "ppc-asm.h"
+
+#ifdef __SPE__
+
+/* Routines for saving 32-bit integer registers, called by the compiler. */
+/* "GOT" versions that load the address of the GOT into lr before returning. */
+
+FUNC_START(_save32gpr_14_g) stw 14,-72(11)
+FUNC_START(_save32gpr_15_g) stw 15,-68(11)
+FUNC_START(_save32gpr_16_g) stw 16,-64(11)
+FUNC_START(_save32gpr_17_g) stw 17,-60(11)
+FUNC_START(_save32gpr_18_g) stw 18,-56(11)
+FUNC_START(_save32gpr_19_g) stw 19,-52(11)
+FUNC_START(_save32gpr_20_g) stw 20,-48(11)
+FUNC_START(_save32gpr_21_g) stw 21,-44(11)
+FUNC_START(_save32gpr_22_g) stw 22,-40(11)
+FUNC_START(_save32gpr_23_g) stw 23,-36(11)
+FUNC_START(_save32gpr_24_g) stw 24,-32(11)
+FUNC_START(_save32gpr_25_g) stw 25,-28(11)
+FUNC_START(_save32gpr_26_g) stw 26,-24(11)
+FUNC_START(_save32gpr_27_g) stw 27,-20(11)
+FUNC_START(_save32gpr_28_g) stw 28,-16(11)
+FUNC_START(_save32gpr_29_g) stw 29,-12(11)
+FUNC_START(_save32gpr_30_g) stw 30,-8(11)
+FUNC_START(_save32gpr_31_g) stw 31,-4(11)
+ b _GLOBAL_OFFSET_TABLE_-4
+FUNC_END(_save32gpr_31_g)
+FUNC_END(_save32gpr_30_g)
+FUNC_END(_save32gpr_29_g)
+FUNC_END(_save32gpr_28_g)
+FUNC_END(_save32gpr_27_g)
+FUNC_END(_save32gpr_26_g)
+FUNC_END(_save32gpr_25_g)
+FUNC_END(_save32gpr_24_g)
+FUNC_END(_save32gpr_23_g)
+FUNC_END(_save32gpr_22_g)
+FUNC_END(_save32gpr_21_g)
+FUNC_END(_save32gpr_20_g)
+FUNC_END(_save32gpr_19_g)
+FUNC_END(_save32gpr_18_g)
+FUNC_END(_save32gpr_17_g)
+FUNC_END(_save32gpr_16_g)
+FUNC_END(_save32gpr_15_g)
+FUNC_END(_save32gpr_14_g)
+
+#endif
diff --git a/gcc/config/rs6000/e500crtsavg64gpr.asm b/gcc/config/rs6000/e500crtsavg64gpr.asm
new file mode 100644
index 00000000000..7a60a84f2ec
--- /dev/null
+++ b/gcc/config/rs6000/e500crtsavg64gpr.asm
@@ -0,0 +1,84 @@
+/*
+ * Special support for e500 eabi and SVR4
+ *
+ * Copyright (C) 2008 Free Software Foundation, Inc.
+ * Written by Nathan Froyd
+ *
+ * This file 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 2, or (at your option) any
+ * later version.
+ *
+ * In addition to the permissions in the GNU General Public License, the
+ * Free Software Foundation gives you unlimited permission to link the
+ * compiled version of this file with other programs, and to distribute
+ * those programs without any restriction coming from the use of this
+ * file. (The General Public License restrictions do apply in other
+ * respects; for example, they cover modification of the file, and
+ * distribution when not linked into another program.)
+ *
+ * This file 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 this program; see the file COPYING. If not, write to
+ * the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ * As a special exception, if you link this library with files
+ * compiled with GCC to produce an executable, this does not cause
+ * the resulting executable to be covered by the GNU General Public License.
+ * This exception does not however invalidate any other reasons why
+ * the executable file might be covered by the GNU General Public License.
+ */
+
+ .file "e500crtsavg64gpr.asm"
+ .section ".text"
+ #include "ppc-asm.h"
+
+#ifdef __SPE__
+
+/* Routines for saving 64-bit integer registers, called by the compiler. */
+/* "GOT" versions that load the address of the GOT into lr before returning. */
+
+FUNC_START(_save64gpr_14_g) evstdd 14,0(11)
+FUNC_START(_save64gpr_15_g) evstdd 15,8(11)
+FUNC_START(_save64gpr_16_g) evstdd 16,16(11)
+FUNC_START(_save64gpr_17_g) evstdd 17,24(11)
+FUNC_START(_save64gpr_18_g) evstdd 18,32(11)
+FUNC_START(_save64gpr_19_g) evstdd 19,40(11)
+FUNC_START(_save64gpr_20_g) evstdd 20,48(11)
+FUNC_START(_save64gpr_21_g) evstdd 21,56(11)
+FUNC_START(_save64gpr_22_g) evstdd 22,64(11)
+FUNC_START(_save64gpr_23_g) evstdd 23,72(11)
+FUNC_START(_save64gpr_24_g) evstdd 24,80(11)
+FUNC_START(_save64gpr_25_g) evstdd 25,88(11)
+FUNC_START(_save64gpr_26_g) evstdd 26,96(11)
+FUNC_START(_save64gpr_27_g) evstdd 27,104(11)
+FUNC_START(_save64gpr_28_g) evstdd 28,112(11)
+FUNC_START(_save64gpr_29_g) evstdd 29,120(11)
+FUNC_START(_save64gpr_30_g) evstdd 30,128(11)
+FUNC_START(_save64gpr_31_g) evstdd 31,136(11)
+ b _GLOBAL_OFFSET_TABLE_-4
+FUNC_END(_save64gpr_31_g)
+FUNC_END(_save64gpr_30_g)
+FUNC_END(_save64gpr_29_g)
+FUNC_END(_save64gpr_28_g)
+FUNC_END(_save64gpr_27_g)
+FUNC_END(_save64gpr_26_g)
+FUNC_END(_save64gpr_25_g)
+FUNC_END(_save64gpr_24_g)
+FUNC_END(_save64gpr_23_g)
+FUNC_END(_save64gpr_22_g)
+FUNC_END(_save64gpr_21_g)
+FUNC_END(_save64gpr_20_g)
+FUNC_END(_save64gpr_19_g)
+FUNC_END(_save64gpr_18_g)
+FUNC_END(_save64gpr_17_g)
+FUNC_END(_save64gpr_16_g)
+FUNC_END(_save64gpr_15_g)
+FUNC_END(_save64gpr_14_g)
+
+#endif
diff --git a/gcc/config/rs6000/e500crtsavg64gprctr.asm b/gcc/config/rs6000/e500crtsavg64gprctr.asm
new file mode 100644
index 00000000000..1d978ec2793
--- /dev/null
+++ b/gcc/config/rs6000/e500crtsavg64gprctr.asm
@@ -0,0 +1,101 @@
+/*
+ * Special support for e500 eabi and SVR4
+ *
+ * Copyright (C) 2008 Free Software Foundation, Inc.
+ * Written by Nathan Froyd
+ *
+ * This file 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 2, or (at your option) any
+ * later version.
+ *
+ * In addition to the permissions in the GNU General Public License, the
+ * Free Software Foundation gives you unlimited permission to link the
+ * compiled version of this file with other programs, and to distribute
+ * those programs without any restriction coming from the use of this
+ * file. (The General Public License restrictions do apply in other
+ * respects; for example, they cover modification of the file, and
+ * distribution when not linked into another program.)
+ *
+ * This file 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 this program; see the file COPYING. If not, write to
+ * the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ * As a special exception, if you link this library with files
+ * compiled with GCC to produce an executable, this does not cause
+ * the resulting executable to be covered by the GNU General Public License.
+ * This exception does not however invalidate any other reasons why
+ * the executable file might be covered by the GNU General Public License.
+ */
+
+ .file "e500crtsavg64gprctr.asm"
+ .section ".text"
+ #include "ppc-asm.h"
+
+#ifdef __SPE__
+
+/* Routines for saving 64-bit integer registers, called by the compiler. */
+/* "GOT" versions that load the address of the GOT into lr before returning. */
+
+FUNC_START(_save64gpr_ctr_14_g) evstdd 14,0(11)
+ bdz _save64_gpr_ctr_g_done
+FUNC_START(_save64gpr_ctr_15_g) evstdd 15,8(11)
+ bdz _save64_gpr_ctr_g_done
+FUNC_START(_save64gpr_ctr_16_g) evstdd 16,16(11)
+ bdz _save64_gpr_ctr_g_done
+FUNC_START(_save64gpr_ctr_17_g) evstdd 17,24(11)
+ bdz _save64_gpr_ctr_g_done
+FUNC_START(_save64gpr_ctr_18_g) evstdd 18,32(11)
+ bdz _save64_gpr_ctr_g_done
+FUNC_START(_save64gpr_ctr_19_g) evstdd 19,40(11)
+ bdz _save64_gpr_ctr_g_done
+FUNC_START(_save64gpr_ctr_20_g) evstdd 20,48(11)
+ bdz _save64_gpr_ctr_g_done
+FUNC_START(_save64gpr_ctr_21_g) evstdd 21,56(11)
+ bdz _save64_gpr_ctr_g_done
+FUNC_START(_save64gpr_ctr_22_g) evstdd 22,64(11)
+ bdz _save64_gpr_ctr_g_done
+FUNC_START(_save64gpr_ctr_23_g) evstdd 23,72(11)
+ bdz _save64_gpr_ctr_g_done
+FUNC_START(_save64gpr_ctr_24_g) evstdd 24,80(11)
+ bdz _save64_gpr_ctr_g_done
+FUNC_START(_save64gpr_ctr_25_g) evstdd 25,88(11)
+ bdz _save64_gpr_ctr_g_done
+FUNC_START(_save64gpr_ctr_26_g) evstdd 26,96(11)
+ bdz _save64_gpr_ctr_g_done
+FUNC_START(_save64gpr_ctr_27_g) evstdd 27,104(11)
+ bdz _save64_gpr_ctr_g_done
+FUNC_START(_save64gpr_ctr_28_g) evstdd 28,112(11)
+ bdz _save64_gpr_ctr_g_done
+FUNC_START(_save64gpr_ctr_29_g) evstdd 29,120(11)
+ bdz _save64_gpr_ctr_g_done
+FUNC_START(_save64gpr_ctr_30_g) evstdd 30,128(11)
+ bdz _save64_gpr_ctr_g_done
+FUNC_START(_save64gpr_ctr_31_g) evstdd 31,136(11)
+_save64gpr_ctr_g_done: b _GLOBAL_OFFSET_TABLE_-4
+FUNC_END(_save64gpr_ctr_31_g)
+FUNC_END(_save64gpr_ctr_30_g)
+FUNC_END(_save64gpr_ctr_29_g)
+FUNC_END(_save64gpr_ctr_28_g)
+FUNC_END(_save64gpr_ctr_27_g)
+FUNC_END(_save64gpr_ctr_26_g)
+FUNC_END(_save64gpr_ctr_25_g)
+FUNC_END(_save64gpr_ctr_24_g)
+FUNC_END(_save64gpr_ctr_23_g)
+FUNC_END(_save64gpr_ctr_22_g)
+FUNC_END(_save64gpr_ctr_21_g)
+FUNC_END(_save64gpr_ctr_20_g)
+FUNC_END(_save64gpr_ctr_19_g)
+FUNC_END(_save64gpr_ctr_18_g)
+FUNC_END(_save64gpr_ctr_17_g)
+FUNC_END(_save64gpr_ctr_16_g)
+FUNC_END(_save64gpr_ctr_15_g)
+FUNC_END(_save64gpr_ctr_14_g)
+
+#endif
diff --git a/gcc/config/rs6000/netbsd.h b/gcc/config/rs6000/netbsd.h
index 088d09bad5c..0fdb4b5c376 100644
--- a/gcc/config/rs6000/netbsd.h
+++ b/gcc/config/rs6000/netbsd.h
@@ -75,8 +75,7 @@
#define STARTFILE_SPEC NETBSD_STARTFILE_SPEC
#undef ENDFILE_SPEC
-#define ENDFILE_SPEC \
- "crtsavres%O%s %(netbsd_endfile_spec)"
+#define ENDFILE_SPEC "%(netbsd_endfile_spec)"
#undef LIB_SPEC
#define LIB_SPEC NETBSD_LIB_SPEC
diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index 024c140b274..20cfe95b95d 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
+ 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
Free Software Foundation, Inc.
Contributed by Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
@@ -174,9 +174,15 @@ int rs6000_ieeequad;
/* Nonzero to use AltiVec ABI. */
int rs6000_altivec_abi;
+/* Nonzero if we want SPE SIMD instructions. */
+int rs6000_spe;
+
/* Nonzero if we want SPE ABI extensions. */
int rs6000_spe_abi;
+/* Nonzero to use isel instructions. */
+int rs6000_isel;
+
/* Nonzero if floating point operations are done in the GPRs. */
int rs6000_float_gprs = 0;
@@ -2177,11 +2183,21 @@ rs6000_handle_option (size_t code, const char *arg, int value)
rs6000_parse_yes_no_option ("vrsave", arg, &(TARGET_ALTIVEC_VRSAVE));
break;
+ case OPT_misel:
+ rs6000_explicit_options.isel = true;
+ rs6000_isel = value;
+ break;
+
case OPT_misel_:
rs6000_explicit_options.isel = true;
rs6000_parse_yes_no_option ("isel", arg, &(rs6000_isel));
break;
+ case OPT_mspe:
+ rs6000_explicit_options.spe = true;
+ rs6000_spe = value;
+ break;
+
case OPT_mspe_:
rs6000_explicit_options.spe = true;
rs6000_parse_yes_no_option ("spe", arg, &(rs6000_spe));
@@ -11449,7 +11465,7 @@ rs6000_got_register (rtx value ATTRIBUTE_UNUSED)
&& !df_regs_ever_live_p (RS6000_PIC_OFFSET_TABLE_REGNUM))
df_set_regs_ever_live (RS6000_PIC_OFFSET_TABLE_REGNUM, true);
- current_function_uses_pic_offset_table = 1;
+ crtl->uses_pic_offset_table = 1;
return pic_offset_table_rtx;
}
@@ -14128,7 +14144,7 @@ first_reg_to_save (void)
#if TARGET_MACHO
if (flag_pic
- && current_function_uses_pic_offset_table
+ && crtl->uses_pic_offset_table
&& first_reg > RS6000_PIC_OFFSET_TABLE_REGNUM)
return RS6000_PIC_OFFSET_TABLE_REGNUM;
#endif
@@ -14165,7 +14181,7 @@ first_altivec_reg_to_save (void)
/* On Darwin, the unwind routines are compiled without
TARGET_ALTIVEC, and use save_world to save/restore the
altivec registers when necessary. */
- if (DEFAULT_ABI == ABI_DARWIN && current_function_calls_eh_return
+ if (DEFAULT_ABI == ABI_DARWIN && crtl->calls_eh_return
&& ! TARGET_ALTIVEC)
return FIRST_ALTIVEC_REGNO + 20;
@@ -14189,7 +14205,7 @@ compute_vrsave_mask (void)
/* On Darwin, the unwind routines are compiled without
TARGET_ALTIVEC, and use save_world to save/restore the
call-saved altivec registers when necessary. */
- if (DEFAULT_ABI == ABI_DARWIN && current_function_calls_eh_return
+ if (DEFAULT_ABI == ABI_DARWIN && crtl->calls_eh_return
&& ! TARGET_ALTIVEC)
mask |= 0xFFF;
@@ -14231,7 +14247,7 @@ compute_save_world_info (rs6000_stack_t *info_ptr)
info_ptr->world_save_p
= (WORLD_SAVE_P (info_ptr)
&& DEFAULT_ABI == ABI_DARWIN
- && ! (current_function_calls_setjmp && flag_exceptions)
+ && ! (cfun->calls_setjmp && flag_exceptions)
&& info_ptr->first_fp_reg_save == FIRST_SAVED_FP_REGNO
&& info_ptr->first_gp_reg_save == FIRST_SAVED_GP_REGNO
&& info_ptr->first_altivec_reg_save == FIRST_SAVED_ALTIVEC_REGNO
@@ -14416,7 +14432,7 @@ rs6000_stack_info (void)
if (((TARGET_TOC && TARGET_MINIMAL_TOC)
|| (flag_pic == 1 && DEFAULT_ABI == ABI_V4)
|| (flag_pic && DEFAULT_ABI == ABI_DARWIN))
- && current_function_uses_const_pool
+ && crtl->uses_const_pool
&& info_ptr->first_gp_reg_save > RS6000_PIC_OFFSET_TABLE_REGNUM)
first_gp = RS6000_PIC_OFFSET_TABLE_REGNUM;
else
@@ -14452,14 +14468,14 @@ rs6000_stack_info (void)
/* Determine if we need to save the link register. */
if ((DEFAULT_ABI == ABI_AIX
- && current_function_profile
+ && crtl->profile
&& !TARGET_PROFILE_KERNEL)
#ifdef TARGET_RELOCATABLE
|| (TARGET_RELOCATABLE && (get_pool_size () != 0))
#endif
|| (info_ptr->first_fp_reg_save != 64
&& !FP_SAVE_INLINE (info_ptr->first_fp_reg_save))
- || (DEFAULT_ABI == ABI_V4 && current_function_calls_alloca)
+ || (DEFAULT_ABI == ABI_V4 && cfun->calls_alloca)
|| info_ptr->calls_p
|| rs6000_ra_ever_killed ())
{
@@ -14480,7 +14496,7 @@ rs6000_stack_info (void)
/* If the current function calls __builtin_eh_return, then we need
to allocate stack space for registers that will hold data for
the exception handler. */
- if (current_function_calls_eh_return)
+ if (crtl->calls_eh_return)
{
unsigned int i;
for (i = 0; EH_RETURN_DATA_REGNO (i) != INVALID_REGNUM; ++i)
@@ -14699,9 +14715,9 @@ spe_func_has_64bit_regs_p (void)
/* Functions that save and restore all the call-saved registers will
need to save/restore the registers in 64-bits. */
- if (current_function_calls_eh_return
- || current_function_calls_setjmp
- || current_function_has_nonlocal_goto)
+ if (crtl->calls_eh_return
+ || cfun->calls_setjmp
+ || crtl->has_nonlocal_goto)
return true;
insns = get_insns ();
@@ -14953,7 +14969,7 @@ rs6000_ra_ever_killed (void)
rtx reg;
rtx insn;
- if (current_function_is_thunk)
+ if (crtl->is_thunk)
return 0;
/* regs_ever_live has LR marked as used if any sibcalls are present,
@@ -15109,7 +15125,7 @@ rs6000_emit_eh_reg_restore (rtx source, rtx scratch)
rtx tmp;
if (frame_pointer_needed
- || current_function_calls_alloca
+ || cfun->calls_alloca
|| info->total_size > 32767)
{
tmp = gen_frame_mem (Pmode, frame_rtx);
@@ -15248,7 +15264,7 @@ rs6000_emit_allocate_stack (HOST_WIDE_INT size, int copy_r12)
return;
}
- if (current_function_limit_stack)
+ if (crtl->limit_stack)
{
if (REG_P (stack_limit_rtx)
&& REGNO (stack_limit_rtx) > 1
@@ -15604,14 +15620,14 @@ rs6000_emit_prologue (void)
&& no_global_regs_above (info->first_gp_reg_save));
saving_FPRs_inline = (info->first_fp_reg_save == 64
|| FP_SAVE_INLINE (info->first_fp_reg_save)
- || current_function_calls_eh_return
+ || crtl->calls_eh_return
|| cfun->machine->ra_need_lr);
/* For V.4, update stack before we do any saving and set back pointer. */
if (! WORLD_SAVE_P (info)
&& info->push_p
&& (DEFAULT_ABI == ABI_V4
- || current_function_calls_eh_return))
+ || crtl->calls_eh_return))
{
if (info->total_size < 32767)
sp_offset = info->total_size;
@@ -15654,7 +15670,7 @@ rs6000_emit_prologue (void)
&& info->cr_save_offset == 4
&& info->push_p
&& info->lr_save_p
- && (!current_function_calls_eh_return
+ && (!crtl->calls_eh_return
|| info->ehrd_offset == -432)
&& info->vrsave_save_offset == -224
&& info->altivec_save_offset == -416);
@@ -15951,7 +15967,7 @@ rs6000_emit_prologue (void)
/* ??? There's no need to emit actual instructions here, but it's the
easiest way to get the frame unwind information emitted. */
- if (current_function_calls_eh_return)
+ if (crtl->calls_eh_return)
{
unsigned int i, regno;
@@ -16017,7 +16033,7 @@ rs6000_emit_prologue (void)
/* Update stack and set back pointer unless this is V.4,
for which it was done previously. */
if (!WORLD_SAVE_P (info) && info->push_p
- && !(DEFAULT_ABI == ABI_V4 || current_function_calls_eh_return))
+ && !(DEFAULT_ABI == ABI_V4 || crtl->calls_eh_return))
{
if (info->total_size < 32767)
sp_offset = info->total_size;
@@ -16145,7 +16161,7 @@ rs6000_emit_prologue (void)
#if TARGET_MACHO
if (DEFAULT_ABI == ABI_DARWIN
- && flag_pic && current_function_uses_pic_offset_table)
+ && flag_pic && crtl->uses_pic_offset_table)
{
rtx lr = gen_rtx_REG (Pmode, LR_REGNO);
rtx src = machopic_function_base_sym ();
@@ -16228,6 +16244,10 @@ rs6000_output_function_prologue (FILE *file,
rs6000_pic_labelno++;
}
+/* Non-zero if vmx regs are restored before the frame pop, zero if
+ we restore after the pop when possible. */
+#define ALWAYS_RESTORE_ALTIVEC_BEFORE_POP 0
+
/* Emit function epilogue as insns.
At present, dwarf2out_frame_debug_expr doesn't understand
@@ -16264,16 +16284,21 @@ rs6000_emit_epilogue (int sibcall)
&& info->first_gp_reg_save < 31
&& no_global_regs_above (info->first_gp_reg_save));
restoring_FPRs_inline = (sibcall
- || current_function_calls_eh_return
+ || crtl->calls_eh_return
|| info->first_fp_reg_save == 64
|| FP_SAVE_INLINE (info->first_fp_reg_save));
- use_backchain_to_restore_sp = (frame_pointer_needed
- || current_function_calls_alloca
- || info->total_size > 32767);
using_mtcr_multiple = (rs6000_cpu == PROCESSOR_PPC601
|| rs6000_cpu == PROCESSOR_PPC603
|| rs6000_cpu == PROCESSOR_PPC750
|| optimize_size);
+ /* Restore via the backchain when we have a large frame, since this
+ is more efficient than an addis, addi pair. The second condition
+ here will not trigger at the moment; We don't actually need a
+ frame pointer for alloca, but the generic parts of the compiler
+ give us one anyway. */
+ use_backchain_to_restore_sp = (info->total_size > 32767
+ || (cfun->calls_alloca
+ && !frame_pointer_needed));
if (WORLD_SAVE_P (info))
{
@@ -16295,7 +16320,7 @@ rs6000_emit_epilogue (int sibcall)
+ LAST_ALTIVEC_REGNO + 1 - info->first_altivec_reg_save
+ 63 + 1 - info->first_fp_reg_save);
- strcpy (rname, ((current_function_calls_eh_return) ?
+ strcpy (rname, ((crtl->calls_eh_return) ?
"*eh_rest_world_r10" : "*rest_world"));
alloc_rname = ggc_strdup (rname);
@@ -16374,8 +16399,9 @@ rs6000_emit_epilogue (int sibcall)
stack. */
if (TARGET_ALTIVEC_ABI
&& info->altivec_size != 0
- && DEFAULT_ABI != ABI_V4
- && info->altivec_save_offset < (TARGET_32BIT ? -220 : -288))
+ && (ALWAYS_RESTORE_ALTIVEC_BEFORE_POP
+ || (DEFAULT_ABI != ABI_V4
+ && info->altivec_save_offset < (TARGET_32BIT ? -220 : -288))))
{
int i;
@@ -16386,6 +16412,8 @@ rs6000_emit_epilogue (int sibcall)
gen_rtx_MEM (Pmode, sp_reg_rtx));
sp_offset = 0;
}
+ else if (frame_pointer_needed)
+ frame_reg_rtx = hard_frame_pointer_rtx;
for (i = info->first_altivec_reg_save; i <= LAST_ALTIVEC_REGNO; ++i)
if (info->vrsave_mask & ALTIVEC_REG_BIT (i))
@@ -16410,18 +16438,23 @@ rs6000_emit_epilogue (int sibcall)
if (TARGET_ALTIVEC
&& TARGET_ALTIVEC_VRSAVE
&& info->vrsave_mask != 0
- && DEFAULT_ABI != ABI_V4
- && info->vrsave_save_offset < (TARGET_32BIT ? -220 : -288))
+ && (ALWAYS_RESTORE_ALTIVEC_BEFORE_POP
+ || (DEFAULT_ABI != ABI_V4
+ && info->vrsave_save_offset < (TARGET_32BIT ? -220 : -288))))
{
rtx addr, mem, reg;
- if (use_backchain_to_restore_sp
- && frame_reg_rtx == sp_reg_rtx)
+ if (frame_reg_rtx == sp_reg_rtx)
{
- frame_reg_rtx = gen_rtx_REG (Pmode, 11);
- emit_move_insn (frame_reg_rtx,
- gen_rtx_MEM (Pmode, sp_reg_rtx));
- sp_offset = 0;
+ if (use_backchain_to_restore_sp)
+ {
+ frame_reg_rtx = gen_rtx_REG (Pmode, 11);
+ emit_move_insn (frame_reg_rtx,
+ gen_rtx_MEM (Pmode, sp_reg_rtx));
+ sp_offset = 0;
+ }
+ else if (frame_pointer_needed)
+ frame_reg_rtx = hard_frame_pointer_rtx;
}
addr = gen_rtx_PLUS (Pmode, frame_reg_rtx,
@@ -16433,17 +16466,11 @@ rs6000_emit_epilogue (int sibcall)
emit_insn (generate_set_vrsave (reg, info, 1));
}
- /* If we have a frame pointer, a call to alloca, or a large stack
- frame, restore the old stack pointer using the backchain. Otherwise,
- we know what size to update it with. */
+ /* If we have a large stack frame, restore the old stack pointer
+ using the backchain. */
if (use_backchain_to_restore_sp)
{
- if (frame_reg_rtx != sp_reg_rtx)
- {
- emit_move_insn (sp_reg_rtx, frame_reg_rtx);
- frame_reg_rtx = sp_reg_rtx;
- }
- else
+ if (frame_reg_rtx == sp_reg_rtx)
{
/* Under V.4, don't reset the stack pointer until after we're done
loading the saved registers. */
@@ -16454,10 +16481,34 @@ rs6000_emit_epilogue (int sibcall)
gen_rtx_MEM (Pmode, sp_reg_rtx));
sp_offset = 0;
}
+ else if (ALWAYS_RESTORE_ALTIVEC_BEFORE_POP
+ && DEFAULT_ABI == ABI_V4)
+ /* frame_reg_rtx has been set up by the altivec restore. */
+ ;
+ else
+ {
+ emit_move_insn (sp_reg_rtx, frame_reg_rtx);
+ frame_reg_rtx = sp_reg_rtx;
+ }
+ }
+ /* If we have a frame pointer, we can restore the old stack pointer
+ from it. */
+ else if (frame_pointer_needed)
+ {
+ frame_reg_rtx = sp_reg_rtx;
+ if (DEFAULT_ABI == ABI_V4)
+ frame_reg_rtx = gen_rtx_REG (Pmode, 11);
+
+ emit_insn (TARGET_32BIT
+ ? gen_addsi3 (frame_reg_rtx, hard_frame_pointer_rtx,
+ GEN_INT (info->total_size))
+ : gen_adddi3 (frame_reg_rtx, hard_frame_pointer_rtx,
+ GEN_INT (info->total_size)));
+ sp_offset = 0;
}
else if (info->push_p
&& DEFAULT_ABI != ABI_V4
- && !current_function_calls_eh_return)
+ && !crtl->calls_eh_return)
{
emit_insn (TARGET_32BIT
? gen_addsi3 (sp_reg_rtx, sp_reg_rtx,
@@ -16468,7 +16519,8 @@ rs6000_emit_epilogue (int sibcall)
}
/* Restore AltiVec registers if we have not done so already. */
- if (TARGET_ALTIVEC_ABI
+ if (!ALWAYS_RESTORE_ALTIVEC_BEFORE_POP
+ && TARGET_ALTIVEC_ABI
&& info->altivec_size != 0
&& (DEFAULT_ABI == ABI_V4
|| info->altivec_save_offset >= (TARGET_32BIT ? -220 : -288)))
@@ -16495,7 +16547,8 @@ rs6000_emit_epilogue (int sibcall)
}
/* Restore VRSAVE if we have not done so already. */
- if (TARGET_ALTIVEC
+ if (!ALWAYS_RESTORE_ALTIVEC_BEFORE_POP
+ && TARGET_ALTIVEC
&& TARGET_ALTIVEC_VRSAVE
&& info->vrsave_mask != 0
&& (DEFAULT_ABI == ABI_V4
@@ -16537,7 +16590,7 @@ rs6000_emit_epilogue (int sibcall)
gen_rtx_REG (Pmode, 0));
/* Load exception handler data registers, if needed. */
- if (current_function_calls_eh_return)
+ if (crtl->calls_eh_return)
{
unsigned int i, regno;
@@ -16734,7 +16787,7 @@ rs6000_emit_epilogue (int sibcall)
: gen_adddi3 (sp_reg_rtx, sp_reg_rtx,
GEN_INT (sp_offset)));
- if (current_function_calls_eh_return)
+ if (crtl->calls_eh_return)
{
rtx sa = EH_RETURN_STACKADJ_RTX;
emit_insn (TARGET_32BIT
@@ -16864,7 +16917,7 @@ rs6000_output_function_epilogue (FILE *file,
System V.4 Powerpc's (and the embedded ABI derived from it) use a
different traceback table. */
if (DEFAULT_ABI == ABI_AIX && ! flag_inhibit_size_directive
- && rs6000_traceback != traceback_none && !current_function_is_thunk)
+ && rs6000_traceback != traceback_none && !crtl->is_thunk)
{
const char *fname = NULL;
const char *language_string = lang_hooks.name;
@@ -17848,13 +17901,13 @@ output_profile_hook (int labelno ATTRIBUTE_UNUSED)
int caller_addr_regno = LR_REGNO;
/* Be conservative and always set this, at least for now. */
- current_function_uses_pic_offset_table = 1;
+ crtl->uses_pic_offset_table = 1;
#if TARGET_MACHO
/* For PIC code, set up a stub and collect the caller's address
from r0, which is where the prologue puts it. */
if (MACHOPIC_INDIRECT
- && current_function_uses_pic_offset_table)
+ && crtl->uses_pic_offset_table)
caller_addr_regno = 0;
#endif
emit_library_call (gen_rtx_SYMBOL_REF (Pmode, mcount_name),
@@ -19822,7 +19875,7 @@ rs6000_handle_altivec_attribute (tree *node,
*no_add_attrs = true; /* No need to hang on to the attribute. */
if (result)
- *node = reconstruct_complex_type (*node, result);
+ *node = lang_hooks.types.reconstruct_complex_type (*node, result);
return NULL_TREE;
}
@@ -20630,7 +20683,7 @@ rs6000_elf_declare_function_name (FILE *file, const char *name, tree decl)
if (TARGET_RELOCATABLE
&& !TARGET_SECURE_PLT
- && (get_pool_size () != 0 || current_function_profile)
+ && (get_pool_size () != 0 || crtl->profile)
&& uses_TOC ())
{
char buf[256];
@@ -21331,6 +21384,12 @@ rs6000_register_move_cost (enum machine_mode mode,
else if (from == CR_REGS)
return 4;
+ /* Power6 has slower LR/CTR moves so make them more expensive than
+ memory in order to bias spills to memory .*/
+ else if (rs6000_cpu == PROCESSOR_POWER6
+ && reg_classes_intersect_p (from, LINK_OR_CTR_REGS))
+ return 6 * hard_regno_nregs[0][mode];
+
else
/* A move will cost one instruction per GPR moved. */
return 2 * hard_regno_nregs[0][mode];
diff --git a/gcc/config/rs6000/rs6000.h b/gcc/config/rs6000/rs6000.h
index 62f1d38f9a7..1bde282172b 100644
--- a/gcc/config/rs6000/rs6000.h
+++ b/gcc/config/rs6000/rs6000.h
@@ -367,6 +367,8 @@ extern int rs6000_long_double_type_size;
extern int rs6000_ieeequad;
extern int rs6000_altivec_abi;
extern int rs6000_spe_abi;
+extern int rs6000_spe;
+extern int rs6000_isel;
extern int rs6000_float_gprs;
extern int rs6000_alignment_flags;
extern const char *rs6000_sched_insert_nops_str;
@@ -1550,7 +1552,7 @@ typedef struct rs6000_args
#define EPILOGUE_USES(REGNO) \
((reload_completed && (REGNO) == LR_REGNO) \
|| (TARGET_ALTIVEC && (REGNO) == VRSAVE_REGNO) \
- || (current_function_calls_eh_return \
+ || (crtl->calls_eh_return \
&& TARGET_AIX \
&& (REGNO) == 2))
diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md
index cac5fd1f36b..8cd405e9275 100644
--- a/gcc/config/rs6000/rs6000.md
+++ b/gcc/config/rs6000/rs6000.md
@@ -10396,7 +10396,7 @@
emit_move_insn (chain, stack_bot);
/* Check stack bounds if necessary. */
- if (current_function_limit_stack)
+ if (crtl->limit_stack)
{
rtx available;
available = expand_binop (Pmode, sub_optab,
diff --git a/gcc/config/rs6000/rs6000.opt b/gcc/config/rs6000/rs6000.opt
index 18ee8286c2c..6ad682fad2b 100644
--- a/gcc/config/rs6000/rs6000.opt
+++ b/gcc/config/rs6000/rs6000.opt
@@ -190,7 +190,7 @@ Target RejectNegative Joined
-mvrsave=yes/no Deprecated option. Use -mvrsave/-mno-vrsave instead
misel
-Target Var(rs6000_isel)
+Target
Generate isel instructions
misel=
@@ -198,7 +198,7 @@ Target RejectNegative Joined
-misel=yes/no Deprecated option. Use -misel/-mno-isel instead
mspe
-Target Var(rs6000_spe)
+Target
Generate SPE SIMD instructions on E500
mpaired
diff --git a/gcc/config/rs6000/sysv4.h b/gcc/config/rs6000/sysv4.h
index 6e04beedac7..12abf4d6112 100644
--- a/gcc/config/rs6000/sysv4.h
+++ b/gcc/config/rs6000/sysv4.h
@@ -777,19 +777,19 @@ extern int fixuplabelno;
/* Override svr4.h definition. */
#undef ENDFILE_SPEC
#define ENDFILE_SPEC "\
-%{mads : crtsavres.o%s %(endfile_ads) ; \
- myellowknife : crtsavres.o%s %(endfile_yellowknife) ; \
- mmvme : crtsavres.o%s %(endfile_mvme) ; \
- msim : crtsavres.o%s %(endfile_sim) ; \
+%{mads : %(endfile_ads) ; \
+ myellowknife : %(endfile_yellowknife) ; \
+ mmvme : %(endfile_mvme) ; \
+ msim : %(endfile_sim) ; \
mwindiss : %(endfile_windiss) ; \
- mcall-freebsd: crtsavres.o%s %(endfile_freebsd) ; \
- mcall-linux : crtsavres.o%s %(endfile_linux) ; \
- mcall-gnu : crtsavres.o%s %(endfile_gnu) ; \
- mcall-netbsd : crtsavres.o%s %(endfile_netbsd) ; \
- mcall-openbsd: crtsavres.o%s %(endfile_openbsd) ; \
+ mcall-freebsd: %(endfile_freebsd) ; \
+ mcall-linux : %(endfile_linux) ; \
+ mcall-gnu : %(endfile_gnu) ; \
+ mcall-netbsd : %(endfile_netbsd) ; \
+ mcall-openbsd: %(endfile_openbsd) ; \
: %(crtsavres_default) %(endfile_default) }"
-#define CRTSAVRES_DEFAULT_SPEC "crtsavres.o%s"
+#define CRTSAVRES_DEFAULT_SPEC ""
#define ENDFILE_DEFAULT_SPEC "crtend.o%s ecrtn.o%s"
diff --git a/gcc/config/rs6000/t-netbsd b/gcc/config/rs6000/t-netbsd
index 0cb08e730c0..135748daecf 100644
--- a/gcc/config/rs6000/t-netbsd
+++ b/gcc/config/rs6000/t-netbsd
@@ -2,13 +2,30 @@
LIB2FUNCS_EXTRA = tramp.S
+LIB2FUNCS_STATIC_EXTRA = crtsavfpr.S crtresfpr.S \
+ crtsavgpr.S crtresgpr.S \
+ crtresxfpr.S crtresxgpr.S
+
tramp.S: $(srcdir)/config/rs6000/tramp.asm
cat $(srcdir)/config/rs6000/tramp.asm > tramp.S
-crtsavres.S: $(srcdir)/config/rs6000/crtsavres.asm
- cat $(srcdir)/config/rs6000/crtsavres.asm >crtsavres.S
+crtsavfpr.S: $(srcdir)/config/rs6000/crtsavfpr.asm
+ cat $(srcdir)/config/rs6000/crtsavfpr.asm >crtsavfpr.S
+
+crtresfpr.S: $(srcdir)/config/rs6000/crtresfpr.asm
+ cat $(srcdir)/config/rs6000/crtresfpr.asm >crtresfpr.S
+
+crtsavgpr.S: $(srcdir)/config/rs6000/crtsavgpr.asm
+ cat $(srcdir)/config/rs6000/crtsavgpr.asm >crtsavgpr.S
+
+crtresgpr.S: $(srcdir)/config/rs6000/crtresgpr.asm
+ cat $(srcdir)/config/rs6000/crtresgpr.asm >crtresgpr.S
+
+crtresxfpr.S: $(srcdir)/config/rs6000/crtresxfpr.asm
+ cat $(srcdir)/config/rs6000/crtresxfpr.asm >crtresxfpr.S
-EXTRA_PARTS += crtsavres$(objext)
+crtresxgpr.S: $(srcdir)/config/rs6000/crtresxgpr.asm
+ cat $(srcdir)/config/rs6000/crtresxgpr.asm >crtresxgpr.S
# It is important that crtbegin.o, etc., aren't surprised by stuff in .sdata.
CRTSTUFF_T_CFLAGS += -msdata=none
@@ -34,9 +51,22 @@ MULTILIB_MATCHES = ${MULTILIB_MATCHES_FLOAT}
LIBGCC = stmp-multilib
INSTALL_LIBGCC = install-multilib
EXTRA_MULTILIB_PARTS = crtbegin$(objext) crtend$(objext) \
- crtbeginS$(objext) crtendS$(objext) crtbeginT$(objext) \
- crtsavres$(objext)
+ crtbeginS$(objext) crtendS$(objext) crtbeginT$(objext)
+
+$(T)crtsavfpr$(objext): crtsavfpr.S
+ $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -c crtsavfpr.S -o $(T)crtsavfpr$(objext)
+
+$(T)crtresfpr$(objext): crtresfpr.S
+ $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -c crtresfpr.S -o $(T)crtresfpr$(objext)
+
+$(T)crtsavgpr$(objext): crtsavgpr.S
+ $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -c crtsavgpr.S -o $(T)crtsavgpr$(objext)
+
+$(T)crtresgpr$(objext): crtresgpr.S
+ $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -c crtresgpr.S -o $(T)crtresgpr$(objext)
+
+$(T)crtresxfpr$(objext): crtresxfpr.S
+ $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -c crtresxfpr.S -o $(T)crtresxfpr$(objext)
-$(T)crtsavres$(objext): crtsavres.S
- $(GCC_FOR_TARGET) $(CRTSTUFF_CFLAGS) $(CRTSTUFF_T_CFLAGS) \
- -c crtsavres.S -o $(T)crtsavres$(objext)
+$(T)crtresxgpr$(objext): crtresxgpr.S
+ $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -c crtresxgpr.S -o $(T)crtresxgpr$(objext)
diff --git a/gcc/config/rs6000/t-ppccomm b/gcc/config/rs6000/t-ppccomm
index c7529d77d01..8fc3e71b08e 100644
--- a/gcc/config/rs6000/t-ppccomm
+++ b/gcc/config/rs6000/t-ppccomm
@@ -2,8 +2,24 @@
LIB2FUNCS_EXTRA += tramp.S $(srcdir)/config/rs6000/darwin-ldouble.c
-# This one can't end up in shared libgcc
-LIB2FUNCS_STATIC_EXTRA = eabi.S
+# These can't end up in shared libgcc
+LIB2FUNCS_STATIC_EXTRA = eabi.S \
+ crtsavfpr.S crtresfpr.S \
+ crtsavgpr.S crtresgpr.S \
+ crtresxfpr.S crtresxgpr.S \
+ e500crtres32gpr.S \
+ e500crtres64gpr.S \
+ e500crtres64gprctr.S \
+ e500crtrest32gpr.S \
+ e500crtrest64gpr.S \
+ e500crtresx32gpr.S \
+ e500crtresx64gpr.S \
+ e500crtsav32gpr.S \
+ e500crtsav64gpr.S \
+ e500crtsav64gprctr.S \
+ e500crtsavg32gpr.S \
+ e500crtsavg64gpr.S \
+ e500crtsavg64gprctr.S
eabi.S: $(srcdir)/config/rs6000/eabi.asm
cat $(srcdir)/config/rs6000/eabi.asm > eabi.S
@@ -18,8 +34,7 @@ MULTILIB_MATCHES_SYSV = mcall-sysv=mcall-sysv-eabi mcall-sysv=mcall-sysv-noeabi
EXTRA_MULTILIB_PARTS = crtbegin$(objext) crtend$(objext) \
crtbeginS$(objext) crtendS$(objext) crtbeginT$(objext) \
ecrti$(objext) ecrtn$(objext) \
- ncrti$(objext) ncrtn$(objext) \
- crtsavres$(objext)
+ ncrti$(objext) ncrtn$(objext)
# We build {e,n}crti.o and {e,n}crtn.o, which serve to add begin and
# end labels to all of the special sections used when we link using gcc.
@@ -37,8 +52,62 @@ ncrti.S: $(srcdir)/config/rs6000/sol-ci.asm
ncrtn.S: $(srcdir)/config/rs6000/sol-cn.asm
cat $(srcdir)/config/rs6000/sol-cn.asm >ncrtn.S
-crtsavres.S: $(srcdir)/config/rs6000/crtsavres.asm
- cat $(srcdir)/config/rs6000/crtsavres.asm >crtsavres.S
+crtsavfpr.S: $(srcdir)/config/rs6000/crtsavfpr.asm
+ cat $(srcdir)/config/rs6000/crtsavfpr.asm >crtsavfpr.S
+
+crtresfpr.S: $(srcdir)/config/rs6000/crtresfpr.asm
+ cat $(srcdir)/config/rs6000/crtresfpr.asm >crtresfpr.S
+
+crtsavgpr.S: $(srcdir)/config/rs6000/crtsavgpr.asm
+ cat $(srcdir)/config/rs6000/crtsavgpr.asm >crtsavgpr.S
+
+crtresgpr.S: $(srcdir)/config/rs6000/crtresgpr.asm
+ cat $(srcdir)/config/rs6000/crtresgpr.asm >crtresgpr.S
+
+crtresxfpr.S: $(srcdir)/config/rs6000/crtresxfpr.asm
+ cat $(srcdir)/config/rs6000/crtresxfpr.asm >crtresxfpr.S
+
+crtresxgpr.S: $(srcdir)/config/rs6000/crtresxgpr.asm
+ cat $(srcdir)/config/rs6000/crtresxgpr.asm >crtresxgpr.S
+
+e500crtres32gpr.S: $(srcdir)/config/rs6000/e500crtres32gpr.asm
+ cat $(srcdir)/config/rs6000/e500crtres32gpr.asm >e500crtres32gpr.S
+
+e500crtres64gpr.S: $(srcdir)/config/rs6000/e500crtres64gpr.asm
+ cat $(srcdir)/config/rs6000/e500crtres64gpr.asm >e500crtres64gpr.S
+
+e500crtres64gprctr.S: $(srcdir)/config/rs6000/e500crtres64gprctr.asm
+ cat $(srcdir)/config/rs6000/e500crtres64gprctr.asm >e500crtres64gprctr.S
+
+e500crtrest32gpr.S: $(srcdir)/config/rs6000/e500crtrest32gpr.asm
+ cat $(srcdir)/config/rs6000/e500crtrest32gpr.asm >e500crtrest32gpr.S
+
+e500crtrest64gpr.S: $(srcdir)/config/rs6000/e500crtrest64gpr.asm
+ cat $(srcdir)/config/rs6000/e500crtrest64gpr.asm >e500crtrest64gpr.S
+
+e500crtresx32gpr.S: $(srcdir)/config/rs6000/e500crtresx32gpr.asm
+ cat $(srcdir)/config/rs6000/e500crtresx32gpr.asm >e500crtresx32gpr.S
+
+e500crtresx64gpr.S: $(srcdir)/config/rs6000/e500crtresx64gpr.asm
+ cat $(srcdir)/config/rs6000/e500crtresx64gpr.asm >e500crtresx64gpr.S
+
+e500crtsav32gpr.S: $(srcdir)/config/rs6000/e500crtsav32gpr.asm
+ cat $(srcdir)/config/rs6000/e500crtsav32gpr.asm >e500crtsav32gpr.S
+
+e500crtsav64gpr.S: $(srcdir)/config/rs6000/e500crtsav64gpr.asm
+ cat $(srcdir)/config/rs6000/e500crtsav64gpr.asm >e500crtsav64gpr.S
+
+e500crtsav64gprctr.S: $(srcdir)/config/rs6000/e500crtsav64gprctr.asm
+ cat $(srcdir)/config/rs6000/e500crtsav64gprctr.asm >e500crtsav64gprctr.S
+
+e500crtsavg32gpr.S: $(srcdir)/config/rs6000/e500crtsavg32gpr.asm
+ cat $(srcdir)/config/rs6000/e500crtsavg32gpr.asm >e500crtsavg32gpr.S
+
+e500crtsavg64gpr.S: $(srcdir)/config/rs6000/e500crtsavg64gpr.asm
+ cat $(srcdir)/config/rs6000/e500crtsavg64gpr.asm >e500crtsavg64gpr.S
+
+e500crtsavg64gprctr.S: $(srcdir)/config/rs6000/e500crtsavg64gprctr.asm
+ cat $(srcdir)/config/rs6000/e500crtsavg64gprctr.asm >e500crtsavg64gprctr.S
# Build multiple copies of ?crt{i,n}.o, one for each target switch.
$(T)ecrti$(objext): ecrti.S
@@ -53,8 +122,62 @@ $(T)ncrti$(objext): ncrti.S
$(T)ncrtn$(objext): ncrtn.S
$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -c ncrtn.S -o $(T)ncrtn$(objext)
-$(T)crtsavres$(objext): crtsavres.S
- $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -c crtsavres.S -o $(T)crtsavres$(objext)
+$(T)crtsavfpr$(objext): crtsavfpr.S
+ $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -c crtsavfpr.S -o $(T)crtsavfpr$(objext)
+
+$(T)crtresfpr$(objext): crtresfpr.S
+ $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -c crtresfpr.S -o $(T)crtresfpr$(objext)
+
+$(T)crtsavgpr$(objext): crtsavgpr.S
+ $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -c crtsavgpr.S -o $(T)crtsavgpr$(objext)
+
+$(T)crtresgpr$(objext): crtresgpr.S
+ $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -c crtresgpr.S -o $(T)crtresgpr$(objext)
+
+$(T)crtresxfpr$(objext): crtresxfpr.S
+ $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -c crtresxfpr.S -o $(T)crtresxfpr$(objext)
+
+$(T)crtresxgpr$(objext): crtresxgpr.S
+ $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -c crtresxgpr.S -o $(T)crtresxgpr$(objext)
+
+$(T)e500crtres32gpr$(objext): e500crtres32gpr.S
+ $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -c e500crtres32gpr.S -o $(T)e500crtres32gpr$(objext)
+
+$(T)e500crtres64gpr$(objext): e500crtres64gpr.S
+ $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -c e500crtres64gpr.S -o $(T)e500crtres64gpr$(objext)
+
+$(T)e500crtres64gprctr$(objext): e500crtres64gprctr.S
+ $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -c e500crtres64gprctr.S -o $(T)e500crtres64gprctr$(objext)
+
+$(T)e500crtrest32gpr$(objext): e500crtrest32gpr.S
+ $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -c e500crtrest32gpr.S -o $(T)e500crtrest32gpr$(objext)
+
+$(T)e500crtrest64gpr$(objext): e500crtrest64gpr.S
+ $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -c e500crtrest64gpr.S -o $(T)e500crtrest64gpr$(objext)
+
+$(T)e500crtresx32gpr$(objext): e500crtresx32gpr.S
+ $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -c e500crtresx32gpr.S -o $(T)e500crtresx32gpr$(objext)
+
+$(T)e500crtresx64gpr$(objext): e500crtresx64gpr.S
+ $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -c e500crtresx64gpr.S -o $(T)e500crtresx64gpr$(objext)
+
+$(T)e500crtsav32gpr$(objext): e500crtsav32gpr.S
+ $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -c e500crtsav32gpr.S -o $(T)e500crtsav32gpr$(objext)
+
+$(T)e500crtsav64gpr$(objext): e500crtsav64gpr.S
+ $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -c e500crtsav64gpr.S -o $(T)e500crtsav64gpr$(objext)
+
+$(T)e500crtsav64gprctr$(objext): e500crtsav64gprctr.S
+ $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -c e500crtsav64gprctr.S -o $(T)e500crtsav64gprctr$(objext)
+
+$(T)e500crtsavg32gpr$(objext): e500crtsavg32gpr.S
+ $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -c e500crtsavg32gpr.S -o $(T)e500crtsavg32gpr$(objext)
+
+$(T)e500crtsavg64gpr$(objext): e500crtsavg64gpr.S
+ $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -c e500crtsavg64gpr.S -o $(T)e500crtsavg64gpr$(objext)
+
+$(T)e500crtsavg64gprctr$(objext): e500crtsavg64gprctr.S
+ $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -c e500crtsavg64gprctr.S -o $(T)e500crtsavg64gprctr$(objext)
# It is important that crtbegin.o, etc., aren't surprised by stuff in .sdata.
CRTSTUFF_T_CFLAGS = -msdata=none
diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c
index f2a1947f5ae..6dab692c2a6 100644
--- a/gcc/config/s390/s390.c
+++ b/gcc/config/s390/s390.c
@@ -6438,9 +6438,9 @@ s390_regs_ever_clobbered (int *regs_ever_clobbered)
may use the eh registers, but the code which sets these registers is not
contained in that function. Hence s390_regs_ever_clobbered is not able to
deal with this automatically. */
- if (current_function_calls_eh_return || cfun->machine->has_landing_pad_p)
+ if (crtl->calls_eh_return || cfun->machine->has_landing_pad_p)
for (i = 0; EH_RETURN_DATA_REGNO (i) != INVALID_REGNUM ; i++)
- if (current_function_calls_eh_return
+ if (crtl->calls_eh_return
|| (cfun->machine->has_landing_pad_p
&& df_regs_ever_live_p (EH_RETURN_DATA_REGNO (i))))
regs_ever_clobbered[EH_RETURN_DATA_REGNO (i)] = 1;
@@ -6449,7 +6449,7 @@ s390_regs_ever_clobbered (int *regs_ever_clobbered)
This flag is also set for the unwinding code in libgcc.
See expand_builtin_unwind_init. For regs_ever_live this is done by
reload. */
- if (current_function_has_nonlocal_label)
+ if (cfun->has_nonlocal_label)
for (i = 0; i < 16; i++)
if (!call_really_used_regs[i])
regs_ever_clobbered[i] = 1;
@@ -6554,16 +6554,16 @@ s390_register_info (int clobbered_regs[])
|| TARGET_TPF_PROFILING
|| cfun->machine->split_branches_pending_p
|| cfun_frame_layout.save_return_addr_p
- || current_function_calls_eh_return
- || current_function_stdarg);
+ || crtl->calls_eh_return
+ || cfun->stdarg);
clobbered_regs[STACK_POINTER_REGNUM]
|= (!current_function_is_leaf
|| TARGET_TPF_PROFILING
|| cfun_save_high_fprs_p
|| get_frame_size () > 0
- || current_function_calls_alloca
- || current_function_stdarg);
+ || cfun->calls_alloca
+ || cfun->stdarg);
for (i = 6; i < 16; i++)
if (df_regs_ever_live_p (i) || clobbered_regs[i])
@@ -6616,7 +6616,7 @@ s390_register_info (int clobbered_regs[])
}
}
- if (current_function_stdarg)
+ if (cfun->stdarg)
{
/* Varargs functions need to save gprs 2 to 6. */
if (cfun->va_list_gpr_size
@@ -6738,8 +6738,8 @@ s390_frame_info (void)
&& !TARGET_TPF_PROFILING
&& cfun_frame_layout.frame_size == 0
&& !cfun_save_high_fprs_p
- && !current_function_calls_alloca
- && !current_function_stdarg)
+ && !cfun->calls_alloca
+ && !cfun->stdarg)
return;
if (!TARGET_PACKED_STACK)
@@ -6800,7 +6800,7 @@ s390_init_frame_layout (void)
/* Try to predict whether we'll need the base register. */
base_used = cfun->machine->split_branches_pending_p
- || current_function_uses_const_pool
+ || crtl->uses_const_pool
|| (!DISP_IN_RANGE (frame_size)
&& !CONST_OK_FOR_K (frame_size));
@@ -6961,8 +6961,8 @@ s390_can_eliminate (int from, int to)
/* Make sure we actually saved the return address. */
if (from == RETURN_ADDRESS_POINTER_REGNUM)
- if (!current_function_calls_eh_return
- && !current_function_stdarg
+ if (!crtl->calls_eh_return
+ && !cfun->stdarg
&& !cfun_frame_layout.save_return_addr_p)
return false;
@@ -7075,7 +7075,7 @@ save_gprs (rtx base, int offset, int first, int last)
gen_rtx_REG (Pmode, first),
GEN_INT (last - first + 1));
- if (first <= 6 && current_function_stdarg)
+ if (first <= 6 && cfun->stdarg)
for (i = 0; i < XVECLEN (PATTERN (insn), 0); i++)
{
rtx mem = XEXP (XVECEXP (PATTERN (insn), 0, i), 0);
diff --git a/gcc/config/score/score.h b/gcc/config/score/score.h
index ffb5af891ee..fe6e6f9b770 100644
--- a/gcc/config/score/score.h
+++ b/gcc/config/score/score.h
@@ -549,7 +549,7 @@ extern enum reg_class score_char_to_class[256];
Zero means the frame pointer need not be set up (and parms
may be accessed via the stack pointer) in functions that seem suitable.
This is computed in `reload', in reload1.c. */
-#define FRAME_POINTER_REQUIRED current_function_calls_alloca
+#define FRAME_POINTER_REQUIRED cfun->calls_alloca
#define ELIMINABLE_REGS \
{{ ARG_POINTER_REGNUM, STACK_POINTER_REGNUM}, \
diff --git a/gcc/config/score/score3.c b/gcc/config/score/score3.c
index 1399bee15cb..3114bcd1c55 100644
--- a/gcc/config/score/score3.c
+++ b/gcc/config/score/score3.c
@@ -189,7 +189,7 @@ score3_compute_frame_size (HOST_WIDE_INT size)
if (f->var_size == 0 && current_function_is_leaf)
f->args_size = f->cprestore_size = 0;
- if (f->args_size == 0 && current_function_calls_alloca)
+ if (f->args_size == 0 && cfun->calls_alloca)
f->args_size = UNITS_PER_WORD;
f->total_size = f->var_size + f->args_size + f->cprestore_size;
@@ -202,7 +202,7 @@ score3_compute_frame_size (HOST_WIDE_INT size)
}
}
- if (current_function_calls_eh_return)
+ if (crtl->calls_eh_return)
{
unsigned int i;
for (i = 0;; ++i)
@@ -1467,7 +1467,7 @@ rpush (int rd, int cnt)
rtx mem = gen_rtx_MEM (SImode, gen_rtx_PRE_DEC (SImode, stack_pointer_rtx));
rtx reg = gen_rtx_REG (SImode, rd);
- if (!current_function_calls_eh_return)
+ if (!crtl->calls_eh_return)
MEM_READONLY_P (mem) = 1;
if (cnt == 1)
@@ -1581,7 +1581,7 @@ rpop (int rd, int cnt)
rtx mem = gen_rtx_MEM (SImode, gen_rtx_POST_INC (SImode, stack_pointer_rtx));
rtx reg = gen_rtx_REG (SImode, rd);
- if (!current_function_calls_eh_return)
+ if (!crtl->calls_eh_return)
MEM_READONLY_P (mem) = 1;
if (cnt == 1)
@@ -1625,7 +1625,7 @@ score3_epilogue (int sibcall_p)
if (base != stack_pointer_rtx)
emit_move_insn (stack_pointer_rtx, base);
- if (current_function_calls_eh_return)
+ if (crtl->calls_eh_return)
emit_insn (gen_add3_insn (stack_pointer_rtx,
stack_pointer_rtx,
EH_RETURN_STACKADJ_RTX));
diff --git a/gcc/config/score/score7.c b/gcc/config/score/score7.c
index 2796e2e0d24..74031c2c6ae 100644
--- a/gcc/config/score/score7.c
+++ b/gcc/config/score/score7.c
@@ -188,7 +188,7 @@ score7_compute_frame_size (HOST_WIDE_INT size)
if (f->var_size == 0 && current_function_is_leaf)
f->args_size = f->cprestore_size = 0;
- if (f->args_size == 0 && current_function_calls_alloca)
+ if (f->args_size == 0 && cfun->calls_alloca)
f->args_size = UNITS_PER_WORD;
f->total_size = f->var_size + f->args_size + f->cprestore_size;
@@ -201,7 +201,7 @@ score7_compute_frame_size (HOST_WIDE_INT size)
}
}
- if (current_function_calls_eh_return)
+ if (crtl->calls_eh_return)
{
unsigned int i;
for (i = 0;; ++i)
@@ -1428,7 +1428,7 @@ score7_prologue (void)
rtx mem = gen_rtx_MEM (SImode,
gen_rtx_PRE_DEC (SImode, stack_pointer_rtx));
rtx reg = gen_rtx_REG (SImode, regno);
- if (!current_function_calls_eh_return)
+ if (!crtl->calls_eh_return)
MEM_READONLY_P (mem) = 1;
EMIT_PL (emit_insn (gen_pushsi_score7 (mem, reg)));
}
@@ -1508,7 +1508,7 @@ score7_epilogue (int sibcall_p)
if (base != stack_pointer_rtx)
emit_move_insn (stack_pointer_rtx, base);
- if (current_function_calls_eh_return)
+ if (crtl->calls_eh_return)
emit_insn (gen_add3_insn (stack_pointer_rtx,
stack_pointer_rtx,
EH_RETURN_STACKADJ_RTX));
@@ -1521,7 +1521,7 @@ score7_epilogue (int sibcall_p)
gen_rtx_POST_INC (SImode, stack_pointer_rtx));
rtx reg = gen_rtx_REG (SImode, regno);
- if (!current_function_calls_eh_return)
+ if (!crtl->calls_eh_return)
MEM_READONLY_P (mem) = 1;
emit_insn (gen_popsi_score7 (reg, mem));
diff --git a/gcc/config/sh/sh.c b/gcc/config/sh/sh.c
index 6b20ee3071d..cd1013dfdc6 100644
--- a/gcc/config/sh/sh.c
+++ b/gcc/config/sh/sh.c
@@ -5646,7 +5646,7 @@ output_stack_adjust (int size, rtx reg, int epilogue_p,
}
for (i = 0; i < nreg; i++)
CLEAR_HARD_REG_BIT (temps, FIRST_RET_REG + i);
- if (current_function_calls_eh_return)
+ if (crtl->calls_eh_return)
{
CLEAR_HARD_REG_BIT (temps, EH_RETURN_STACKADJ_REGNO);
for (i = 0; i <= 3; i++)
@@ -5980,7 +5980,7 @@ calc_live_regs (HARD_REG_SET *live_regs_mask)
if (TARGET_SHCOMPACT
&& ((crtl->args.info.call_cookie
& ~ CALL_COOKIE_RET_TRAMP (1))
- || current_function_saves_all_registers))
+ || crtl->saves_all_registers))
pr_live = 1;
has_call = TARGET_SHMEDIA ? ! leaf_function_p () : pr_live;
for (count = 0, reg = FIRST_PSEUDO_REGISTER; reg-- != 0; )
@@ -6010,7 +6010,7 @@ calc_live_regs (HARD_REG_SET *live_regs_mask)
|| (df_regs_ever_live_p (reg)
&& (!call_really_used_regs[reg]
|| (trapa_handler && reg == FPSCR_REG && TARGET_FPU_ANY)))
- || (current_function_calls_eh_return
+ || (crtl->calls_eh_return
&& (reg == EH_RETURN_DATA_REGNO (0)
|| reg == EH_RETURN_DATA_REGNO (1)
|| reg == EH_RETURN_DATA_REGNO (2)
@@ -6160,7 +6160,7 @@ sh5_schedule_saves (HARD_REG_SET *live_regs_mask, save_schedule *schedule,
&& ! FUNCTION_ARG_REGNO_P (i)
&& i != FIRST_RET_REG
&& ! (cfun->static_chain_decl != NULL && i == STATIC_CHAIN_REGNUM)
- && ! (current_function_calls_eh_return
+ && ! (crtl->calls_eh_return
&& (i == EH_RETURN_STACKADJ_REGNO
|| ((unsigned) i >= EH_RETURN_DATA_REGNO (0)
&& (unsigned) i <= EH_RETURN_DATA_REGNO (3)))))
@@ -6305,7 +6305,7 @@ sh_expand_prologue (void)
}
/* Emit the code for SETUP_VARARGS. */
- if (current_function_stdarg)
+ if (cfun->stdarg)
{
if (TARGET_VARARGS_PRETEND_ARGS (current_function_decl))
{
@@ -6850,7 +6850,7 @@ sh_expand_epilogue (bool sibcall_p)
+ crtl->args.info.stack_regs * 8,
stack_pointer_rtx, e, NULL);
- if (current_function_calls_eh_return)
+ if (crtl->calls_eh_return)
emit_insn (GEN_ADD3 (stack_pointer_rtx, stack_pointer_rtx,
EH_RETURN_STACKADJ_RTX));
@@ -7864,7 +7864,7 @@ sh_setup_incoming_varargs (CUMULATIVE_ARGS *ca,
int *pretend_arg_size,
int second_time ATTRIBUTE_UNUSED)
{
- gcc_assert (current_function_stdarg);
+ gcc_assert (cfun->stdarg);
if (TARGET_VARARGS_PRETEND_ARGS (current_function_decl))
{
int named_parm_regs, anon_parm_regs;
@@ -9216,7 +9216,7 @@ sh_allocate_initial_value (rtx hard_reg)
&& ! (TARGET_SHCOMPACT
&& ((crtl->args.info.call_cookie
& ~ CALL_COOKIE_RET_TRAMP (1))
- || current_function_saves_all_registers)))
+ || crtl->saves_all_registers)))
x = hard_reg;
else
x = gen_frame_mem (Pmode, return_address_pointer_rtx);
@@ -10612,7 +10612,7 @@ sh_get_pr_initial_val (void)
if (TARGET_SHCOMPACT
&& ((crtl->args.info.call_cookie
& ~ CALL_COOKIE_RET_TRAMP (1))
- || current_function_saves_all_registers))
+ || crtl->saves_all_registers))
return gen_frame_mem (SImode, return_address_pointer_rtx);
/* If we haven't finished rtl generation, there might be a nonlocal label
diff --git a/gcc/config/sh/sh.h b/gcc/config/sh/sh.h
index eb37106348f..67a6e3923fb 100644
--- a/gcc/config/sh/sh.h
+++ b/gcc/config/sh/sh.h
@@ -1359,7 +1359,7 @@ extern char sh_additional_register_names[ADDREGNAMES_SIZE] \
#define DEFAULT_PCC_STRUCT_RETURN 0
#define SHMEDIA_REGS_STACK_ADJUST() \
- (TARGET_SHCOMPACT && current_function_saves_all_registers \
+ (TARGET_SHCOMPACT && crtl->saves_all_registers \
? (8 * (/* r28-r35 */ 8 + /* r44-r59 */ 16 + /* tr5-tr7 */ 3) \
+ (TARGET_FPU_ANY ? 4 * (/* fr36 - fr63 */ 28) : 0)) \
: 0)
diff --git a/gcc/config/sh/sh.md b/gcc/config/sh/sh.md
index cfcf1b23d19..837fd2e0484 100644
--- a/gcc/config/sh/sh.md
+++ b/gcc/config/sh/sh.md
@@ -5067,7 +5067,7 @@ label:
[(set (match_dup 0) (match_dup 1))]
"
{
- if (TARGET_SHCOMPACT && current_function_saves_all_registers)
+ if (TARGET_SHCOMPACT && crtl->saves_all_registers)
operands[1] = gen_frame_mem (SImode, return_address_pointer_rtx);
}")
diff --git a/gcc/config/sparc/linux.h b/gcc/config/sparc/linux.h
index bd3b1f5ea7f..67b6412d2e9 100644
--- a/gcc/config/sparc/linux.h
+++ b/gcc/config/sparc/linux.h
@@ -22,39 +22,12 @@ along with GCC; see the file COPYING3. If not see
#define TARGET_OS_CPP_BUILTINS() \
do \
{ \
- builtin_define_std ("unix"); \
- builtin_define_std ("linux"); \
- builtin_define ("__gnu_linux__"); \
- builtin_assert ("system=linux"); \
- builtin_assert ("system=unix"); \
- builtin_assert ("system=posix"); \
+ LINUX_TARGET_OS_CPP_BUILTINS(); \
if (TARGET_LONG_DOUBLE_128) \
builtin_define ("__LONG_DOUBLE_128__"); \
} \
while (0)
-/* Don't assume anything about the header files. */
-#define NO_IMPLICIT_EXTERN_C
-
-#undef MD_EXEC_PREFIX
-#undef MD_STARTFILE_PREFIX
-
-/* Provide a STARTFILE_SPEC appropriate for GNU/Linux. Here we add
- the GNU/Linux magical crtbegin.o file (see crtstuff.c) which
- provides part of the support for getting C++ file-scope static
- object constructed before entering `main'. */
-
-#undef STARTFILE_SPEC
-#if defined HAVE_LD_PIE
-#define STARTFILE_SPEC \
- "%{!shared: %{pg|p:gcrt1.o%s;pie:Scrt1.o%s;:crt1.o%s}}\
- crti.o%s %{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s}"
-#else
-#define STARTFILE_SPEC \
- "%{!shared: %{pg|p:gcrt1.o%s;:crt1.o%s}}\
- crti.o%s %{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s}"
-#endif
-
/* Provide a ENDFILE_SPEC appropriate for GNU/Linux. Here we tack on
the GNU/Linux magical crtend.o file (see crtstuff.c) which
provides part of the support for getting C++ file-scope static
@@ -63,8 +36,8 @@ along with GCC; see the file COPYING3. If not see
#undef ENDFILE_SPEC
#define ENDFILE_SPEC \
- "%{ffast-math|funsafe-math-optimizations:crtfastmath.o%s} \
- %{shared|pie:crtendS.o%s;:crtend.o%s} crtn.o%s"
+ "%{shared|pie:crtendS.o%s;:crtend.o%s} crtn.o%s\
+ %{ffast-math|funsafe-math-optimizations:crtfastmath.o%s}"
/* This is for -profile to use -lc_p instead of -lc. */
#undef CC1_SPEC
@@ -75,10 +48,6 @@ along with GCC; see the file COPYING3. If not see
%{mv8:-mcpu=v8} %{msupersparc:-mcpu=supersparc} \
"
-/* The GNU C++ standard library requires that these macros be defined. */
-#undef CPLUSPLUS_CPP_SPEC
-#define CPLUSPLUS_CPP_SPEC "-D_GNU_SOURCE %(cpp)"
-
#undef TARGET_VERSION
#define TARGET_VERSION fprintf (stderr, " (sparc GNU/Linux with ELF)");
@@ -98,12 +67,6 @@ along with GCC; see the file COPYING3. If not see
#define CPP_SUBTARGET_SPEC \
"%{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT}"
-#undef LIB_SPEC
-#define LIB_SPEC \
- "%{pthread:-lpthread} \
- %{shared:-lc} \
- %{!shared:%{mieee-fp:-lieee} %{profile:-lc_p}%{!profile:-lc}}"
-
/* Provide a LINK_SPEC appropriate for GNU/Linux. Here we provide support
for the special GCC options -static and -shared, which allow us to
link things in one of these three modes by applying the appropriate
@@ -121,15 +84,6 @@ along with GCC; see the file COPYING3. If not see
/* If ELF is the default format, we should not use /lib/elf. */
#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
-#define UCLIBC_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
-#if UCLIBC_DEFAULT
-#define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:%{muclibc:%e-mglibc and -muclibc used together}" G ";:" U "}"
-#else
-#define CHOOSE_DYNAMIC_LINKER(G, U) "%{muclibc:%{mglibc:%e-mglibc and -muclibc used together}" U ";:" G "}"
-#endif
-#define LINUX_DYNAMIC_LINKER \
- CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER, UCLIBC_DYNAMIC_LINKER)
-
#undef LINK_SPEC
#define LINK_SPEC "-m elf32_sparc -Y P,/usr/lib %{shared:-shared} \
@@ -191,10 +145,6 @@ do { \
#undef DITF_CONVERSION_LIBFUNCS
#define DITF_CONVERSION_LIBFUNCS 1
-
-#if defined(HAVE_LD_EH_FRAME_HDR)
-#define LINK_EH_SPEC "%{!static:--eh-frame-hdr} "
-#endif
#ifdef HAVE_AS_TLS
#undef TARGET_SUN_TLS
@@ -203,31 +153,10 @@ do { \
#define TARGET_GNU_TLS 1
#endif
-/* Don't be different from other Linux platforms in this regard. */
-#define HANDLE_PRAGMA_PACK_PUSH_POP
-
/* We use GNU ld so undefine this so that attribute((init_priority)) works. */
#undef CTORS_SECTION_ASM_OP
#undef DTORS_SECTION_ASM_OP
-/* Determine whether the entire c99 runtime is present in the
- runtime library. */
-#define TARGET_C99_FUNCTIONS (OPTION_GLIBC)
-
-/* Whether we have sincos that follows the GNU extension. */
-#define TARGET_HAS_SINCOS (OPTION_GLIBC)
-
-#define TARGET_POSIX_IO
-
-#undef LINK_GCC_C_SEQUENCE_SPEC
-#define LINK_GCC_C_SEQUENCE_SPEC \
- "%{static:--start-group} %G %L %{static:--end-group}%{!static:%G}"
-
-/* Use --as-needed -lgcc_s for eh support. */
-#ifdef HAVE_LD_AS_NEEDED
-#define USE_LD_AS_NEEDED 1
-#endif
-
#define MD_UNWIND_SUPPORT "config/sparc/linux-unwind.h"
/* Linux currently uses RMO in uniprocessor mode, which is equivalent to
diff --git a/gcc/config/sparc/linux64.h b/gcc/config/sparc/linux64.h
index b205552874b..f8c87b95c86 100644
--- a/gcc/config/sparc/linux64.h
+++ b/gcc/config/sparc/linux64.h
@@ -19,27 +19,18 @@ 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_OS_CPP_BUILTINS() \
- do \
- { \
- builtin_define_std ("unix"); \
- builtin_define_std ("linux"); \
- builtin_define ("_LONGLONG"); \
- builtin_define ("__gnu_linux__"); \
- builtin_assert ("system=linux"); \
- builtin_assert ("system=unix"); \
- builtin_assert ("system=posix"); \
- if (TARGET_ARCH32 && TARGET_LONG_DOUBLE_128) \
- builtin_define ("__LONG_DOUBLE_128__"); \
- } \
+#define TARGET_OS_CPP_BUILTINS() \
+ do \
+ { \
+ LINUX_TARGET_OS_CPP_BUILTINS(); \
+ if (TARGET_ARCH64) \
+ builtin_define ("_LONGLONG"); \
+ if (TARGET_ARCH32 \
+ && TARGET_LONG_DOUBLE_128) \
+ builtin_define ("__LONG_DOUBLE_128__"); \
+ } \
while (0)
-/* Don't assume anything about the header files. */
-#define NO_IMPLICIT_EXTERN_C
-
-#undef MD_EXEC_PREFIX
-#undef MD_STARTFILE_PREFIX
-
#if TARGET_CPU_DEFAULT == TARGET_CPU_v9 \
|| TARGET_CPU_DEFAULT == TARGET_CPU_ultrasparc \
|| TARGET_CPU_DEFAULT == TARGET_CPU_ultrasparc3 \
@@ -54,25 +45,10 @@ along with GCC; see the file COPYING3. If not see
+ MASK_STACK_BIAS + MASK_APP_REGS + MASK_FPU + MASK_LONG_DOUBLE_128)
#endif
-#undef ASM_CPU_DEFAULT_SPEC
-#define ASM_CPU_DEFAULT_SPEC "-Av9a"
-
-/* Provide a STARTFILE_SPEC appropriate for GNU/Linux. Here we add
- the GNU/Linux magical crtbegin.o file (see crtstuff.c) which
- provides part of the support for getting C++ file-scope static
- object constructed before entering `main'. */
-
-#undef STARTFILE_SPEC
-
-#ifdef HAVE_LD_PIE
-#define STARTFILE_SPEC \
- "%{!shared:%{pg|p:gcrt1.o%s;pie:Scrt1.o%s;:crt1.o%s}}\
- crti.o%s %{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbeginS.o%s}"
-#else
-#define STARTFILE_SPEC \
- "%{!shared:%{pg|p:gcrt1.o%s;:crt1.o%s}}\
- crti.o%s %{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbeginS.o%s}"
-#endif
+/* This must be v9a not just v9 because by default we enable
+ -mvis. */
+#undef ASM_CPU64_DEFAULT_SPEC
+#define ASM_CPU64_DEFAULT_SPEC "-Av9a"
/* Provide a ENDFILE_SPEC appropriate for GNU/Linux. Here we tack on
the GNU/Linux magical crtend.o file (see crtstuff.c) which
@@ -80,16 +56,11 @@ along with GCC; see the file COPYING3. If not see
object constructed before entering `main', followed by a normal
GNU/Linux "finalizer" file, `crtn.o'. */
-#undef ENDFILE_SPEC
-
+#undef ENDFILE_SPEC
#define ENDFILE_SPEC \
"%{shared|pie:crtendS.o%s;:crtend.o%s} crtn.o%s\
%{ffast-math|funsafe-math-optimizations:crtfastmath.o%s}"
-/* The GNU C++ standard library requires that these macros be defined. */
-#undef CPLUSPLUS_CPP_SPEC
-#define CPLUSPLUS_CPP_SPEC "-D_GNU_SOURCE %(cpp)"
-
#undef TARGET_VERSION
#define TARGET_VERSION fprintf (stderr, " (sparc64 GNU/Linux with ELF)");
@@ -122,12 +93,6 @@ along with GCC; see the file COPYING3. If not see
%{pthread:-D_REENTRANT} \
"
-#undef LIB_SPEC
-#define LIB_SPEC \
- "%{pthread:-lpthread} \
- %{shared:-lc} \
- %{!shared: %{mieee-fp:-lieee} %{profile:-lc_p}%{!profile:-lc}}"
-
/* Provide a LINK_SPEC appropriate for GNU/Linux. Here we provide support
for the special GCC options -static and -shared, which allow us to
link things in one of these three modes by applying the appropriate
@@ -146,17 +111,6 @@ along with GCC; see the file COPYING3. If not see
#define GLIBC_DYNAMIC_LINKER32 "/lib/ld-linux.so.2"
#define GLIBC_DYNAMIC_LINKER64 "/lib64/ld-linux.so.2"
-#define UCLIBC_DYNAMIC_LINKER32 "/lib/ld-uClibc.so.0"
-#define UCLIBC_DYNAMIC_LINKER64 "/lib/ld64-uClibc.so.0"
-#if UCLIBC_DEFAULT
-#define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:%{muclibc:%e-mglibc and -muclibc used together}" G ";:" U "}"
-#else
-#define CHOOSE_DYNAMIC_LINKER(G, U) "%{muclibc:%{mglibc:%e-mglibc and -muclibc used together}" U ";:" G "}"
-#endif
-#define LINUX_DYNAMIC_LINKER32 \
- CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER32, UCLIBC_DYNAMIC_LINKER32)
-#define LINUX_DYNAMIC_LINKER64 \
- CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER64, UCLIBC_DYNAMIC_LINKER64)
#ifdef SPARC_BI_ARCH
@@ -203,7 +157,7 @@ along with GCC; see the file COPYING3. If not see
#undef CC1_SPEC
#if DEFAULT_ARCH32_P
-#define CC1_SPEC "\
+#define CC1_SPEC "%{profile:-p} \
%{sun4:} %{target:} \
%{mcypress:-mcpu=cypress} \
%{msparclite:-mcpu=sparclite} %{mf930:-mcpu=f930} %{mf934:-mcpu=f934} \
@@ -214,7 +168,7 @@ along with GCC; see the file COPYING3. If not see
%{!mno-vis:%{!mcpu=v9:-mvis}}} \
"
#else
-#define CC1_SPEC "\
+#define CC1_SPEC "%{profile:-p} \
%{sun4:} %{target:} \
%{mcypress:-mcpu=cypress} \
%{msparclite:-mcpu=sparclite} %{mf930:-mcpu=f930} %{mf934:-mcpu=f934} \
@@ -324,10 +278,6 @@ do { \
#undef DITF_CONVERSION_LIBFUNCS
#define DITF_CONVERSION_LIBFUNCS 1
-
-#if defined(HAVE_LD_EH_FRAME_HDR)
-#define LINK_EH_SPEC "%{!static:--eh-frame-hdr} "
-#endif
#ifdef HAVE_AS_TLS
#undef TARGET_SUN_TLS
@@ -336,31 +286,10 @@ do { \
#define TARGET_GNU_TLS 1
#endif
-/* Don't be different from other Linux platforms in this regard. */
-#define HANDLE_PRAGMA_PACK_PUSH_POP
-
/* We use GNU ld so undefine this so that attribute((init_priority)) works. */
#undef CTORS_SECTION_ASM_OP
#undef DTORS_SECTION_ASM_OP
-/* Determine whether the entire c99 runtime is present in the
- runtime library. */
-#define TARGET_C99_FUNCTIONS (OPTION_GLIBC)
-
-/* Whether we have sincos that follows the GNU extension. */
-#define TARGET_HAS_SINCOS (OPTION_GLIBC)
-
-#define TARGET_POSIX_IO
-
-#undef LINK_GCC_C_SEQUENCE_SPEC
-#define LINK_GCC_C_SEQUENCE_SPEC \
- "%{static:--start-group} %G %L %{static:--end-group}%{!static:%G}"
-
-/* Use --as-needed -lgcc_s for eh support. */
-#ifdef HAVE_LD_AS_NEEDED
-#define USE_LD_AS_NEEDED 1
-#endif
-
#define MD_UNWIND_SUPPORT "config/sparc/linux-unwind.h"
/* Linux currently uses RMO in uniprocessor mode, which is equivalent to
diff --git a/gcc/config/sparc/sparc.c b/gcc/config/sparc/sparc.c
index 962ed9fe3bc..2758e4d8485 100644
--- a/gcc/config/sparc/sparc.c
+++ b/gcc/config/sparc/sparc.c
@@ -2639,7 +2639,7 @@ eligible_for_return_delay (rtx trial)
/* If the function uses __builtin_eh_return, the eh_return machinery
occupies the delay slot. */
- if (current_function_calls_eh_return)
+ if (crtl->calls_eh_return)
return 0;
/* In the case of a true leaf function, anything can go into the slot. */
@@ -3084,7 +3084,7 @@ sparc_tls_got (void)
rtx temp;
if (flag_pic)
{
- current_function_uses_pic_offset_table = 1;
+ crtl->uses_pic_offset_table = 1;
return pic_offset_table_rtx;
}
@@ -3300,7 +3300,7 @@ legitimize_pic_address (rtx orig, enum machine_mode mode ATTRIBUTE_UNUSED,
pic_ref = gen_const_mem (Pmode,
gen_rtx_PLUS (Pmode,
pic_offset_table_rtx, address));
- current_function_uses_pic_offset_table = 1;
+ crtl->uses_pic_offset_table = 1;
insn = emit_move_insn (reg, pic_ref);
/* Put a REG_EQUAL note on this insn, so that it can be optimized
by loop. */
@@ -3342,7 +3342,7 @@ legitimize_pic_address (rtx orig, enum machine_mode mode ATTRIBUTE_UNUSED,
/* ??? Why do we do this? */
/* Now movsi_pic_label_ref uses it, but we ought to be checking that
the register is live instead, in case it is eliminated. */
- current_function_uses_pic_offset_table = 1;
+ crtl->uses_pic_offset_table = 1;
return orig;
}
@@ -3479,7 +3479,7 @@ sparc_emit_call_insn (rtx pat, rtx addr)
: !SYMBOL_REF_LOCAL_P (addr)))
{
use_reg (&CALL_INSN_FUNCTION_USAGE (insn), pic_offset_table_rtx);
- current_function_uses_pic_offset_table = 1;
+ crtl->uses_pic_offset_table = 1;
}
}
@@ -4099,7 +4099,7 @@ sparc_expand_prologue (void)
emit_save_or_restore_regs (SORR_SAVE);
/* Load the PIC register if needed. */
- if (flag_pic && current_function_uses_pic_offset_table)
+ if (flag_pic && crtl->uses_pic_offset_table)
load_pic_register (false);
}
@@ -4235,7 +4235,7 @@ output_return (rtx insn)
semantics of restore/return. We simply output the jump to the
return address and the insn in the delay slot (if any). */
- gcc_assert (! current_function_calls_eh_return);
+ gcc_assert (! crtl->calls_eh_return);
return "jmp\t%%o7+%)%#";
}
@@ -4246,7 +4246,7 @@ output_return (rtx insn)
combined with the 'restore' instruction or put in the delay slot of
the 'return' instruction. */
- if (current_function_calls_eh_return)
+ if (crtl->calls_eh_return)
{
/* If the function uses __builtin_eh_return, the eh_return
machinery occupies the delay slot. */
@@ -6780,7 +6780,7 @@ print_operand (FILE *file, rtx x, int code)
The call emitted is the same when sparc_std_struct_return is
present. */
if (! TARGET_ARCH64
- && current_function_returns_struct
+ && cfun->returns_struct
&& ! sparc_std_struct_return
&& (TREE_CODE (DECL_SIZE (DECL_RESULT (current_function_decl)))
== INTEGER_CST)
@@ -7863,7 +7863,7 @@ sparc_function_ok_for_sibcall (tree decl, tree exp ATTRIBUTE_UNUSED)
{
return (decl
&& flag_delayed_branch
- && (TARGET_ARCH64 || ! current_function_returns_struct)
+ && (TARGET_ARCH64 || ! cfun->returns_struct)
&& !(TARGET_VXWORKS_RTP
&& flag_pic
&& !targetm.binds_local_p (decl)));
diff --git a/gcc/config/sparc/sparc.h b/gcc/config/sparc/sparc.h
index eed016470b1..e9f0f2ab5c2 100644
--- a/gcc/config/sparc/sparc.h
+++ b/gcc/config/sparc/sparc.h
@@ -1678,11 +1678,11 @@ do { \
#define EXIT_IGNORE_STACK \
(get_frame_size () != 0 \
- || current_function_calls_alloca || crtl->outgoing_args_size)
+ || cfun->calls_alloca || crtl->outgoing_args_size)
/* Define registers used by the epilogue and return instruction. */
#define EPILOGUE_USES(REGNO) ((REGNO) == 31 \
- || (current_function_calls_eh_return && (REGNO) == 1))
+ || (crtl->calls_eh_return && (REGNO) == 1))
/* Length in units of the trampoline for entering a nested function. */
@@ -1724,7 +1724,7 @@ do { \
/* This is the offset of the return address to the true next instruction to be
executed for the current function. */
#define RETURN_ADDR_OFFSET \
- (8 + 4 * (! TARGET_ARCH64 && current_function_returns_struct))
+ (8 + 4 * (! TARGET_ARCH64 && cfun->returns_struct))
/* The current return address is in %i7. The return address of anything
farther back is in the register window save area at [%fp+60]. */
diff --git a/gcc/config/sparc/sparc.md b/gcc/config/sparc/sparc.md
index daf172ccbb1..c02c7094df2 100644
--- a/gcc/config/sparc/sparc.md
+++ b/gcc/config/sparc/sparc.md
@@ -137,10 +137,10 @@
(symbol_ref "flag_pic != 0"))
(define_attr "calls_alloca" "false,true"
- (symbol_ref "current_function_calls_alloca != 0"))
+ (symbol_ref "cfun->calls_alloca != 0"))
(define_attr "calls_eh_return" "false,true"
- (symbol_ref "current_function_calls_eh_return !=0 "))
+ (symbol_ref "crtl->calls_eh_return !=0 "))
(define_attr "leaf_function" "false,true"
(symbol_ref "current_function_uses_only_leaf_regs != 0"))
@@ -1844,7 +1844,7 @@
(minus:SI (match_dup 5) (match_dup 4)))]
"flag_pic"
{
- current_function_uses_pic_offset_table = 1;
+ crtl->uses_pic_offset_table = 1;
operands[2] = gen_rtx_SYMBOL_REF (Pmode, "_GLOBAL_OFFSET_TABLE_");
if (!can_create_pseudo_p ())
{
@@ -1993,7 +1993,7 @@
(minus:DI (match_dup 5) (match_dup 4)))]
"TARGET_ARCH64 && flag_pic"
{
- current_function_uses_pic_offset_table = 1;
+ crtl->uses_pic_offset_table = 1;
operands[2] = gen_rtx_SYMBOL_REF (Pmode, "_GLOBAL_OFFSET_TABLE_");
if (!can_create_pseudo_p ())
{
@@ -7237,7 +7237,7 @@
[(unspec_volatile [(const_int 0)] UNSPECV_SETJMP)]
""
{
- if (! current_function_calls_alloca)
+ if (! cfun->calls_alloca)
return "";
if (! TARGET_V9)
return "\tta\t3\n";
diff --git a/gcc/config/spu/spu.c b/gcc/config/spu/spu.c
index 55868ac2bb9..ad41994d5a5 100644
--- a/gcc/config/spu/spu.c
+++ b/gcc/config/spu/spu.c
@@ -1592,7 +1592,7 @@ spu_split_immediate (rtx * ops)
{
rtx pic_reg = get_pic_reg ();
emit_insn (gen_addsi3 (ops[0], ops[0], pic_reg));
- current_function_uses_pic_offset_table = 1;
+ crtl->uses_pic_offset_table = 1;
}
return flag_pic || c == IC_IL2s;
}
@@ -1618,7 +1618,7 @@ need_to_save_reg (int regno, int saving)
return 1;
if (flag_pic
&& regno == PIC_OFFSET_TABLE_REGNUM
- && (!saving || current_function_uses_pic_offset_table)
+ && (!saving || crtl->uses_pic_offset_table)
&& (!saving
|| !current_function_is_leaf || df_regs_ever_live_p (LAST_ARG_REGNUM)))
return 1;
@@ -1739,7 +1739,7 @@ spu_expand_prologue (void)
emit_note (NOTE_INSN_DELETED);
if (flag_pic && optimize == 0)
- current_function_uses_pic_offset_table = 1;
+ crtl->uses_pic_offset_table = 1;
if (spu_naked_function_p (current_function_decl))
return;
@@ -1753,7 +1753,7 @@ spu_expand_prologue (void)
+ crtl->args.pretend_args_size;
if (!current_function_is_leaf
- || current_function_calls_alloca || total_size > 0)
+ || cfun->calls_alloca || total_size > 0)
total_size += STACK_POINTER_OFFSET;
/* Save this first because code after this might use the link
@@ -1776,7 +1776,7 @@ spu_expand_prologue (void)
}
}
- if (flag_pic && current_function_uses_pic_offset_table)
+ if (flag_pic && crtl->uses_pic_offset_table)
{
rtx pic_reg = get_pic_reg ();
insn = emit_insn (gen_load_pic_offset (pic_reg, scratch_reg_0));
@@ -1878,12 +1878,12 @@ spu_expand_epilogue (bool sibcall_p)
+ crtl->args.pretend_args_size;
if (!current_function_is_leaf
- || current_function_calls_alloca || total_size > 0)
+ || cfun->calls_alloca || total_size > 0)
total_size += STACK_POINTER_OFFSET;
if (total_size > 0)
{
- if (current_function_calls_alloca)
+ if (cfun->calls_alloca)
frame_emit_load (STACK_POINTER_REGNUM, sp_reg, 0);
else
frame_emit_add_imm (sp_reg, sp_reg, total_size, scratch_reg_0);
@@ -3022,7 +3022,7 @@ spu_handle_vector_attribute (tree * node, tree name,
if (!result)
warning (0, "`%s' attribute ignored", IDENTIFIER_POINTER (name));
else
- *node = reconstruct_complex_type (*node, result);
+ *node = lang_hooks.types.reconstruct_complex_type (*node, result);
return NULL_TREE;
}
diff --git a/gcc/config/stormy16/stormy16.c b/gcc/config/stormy16/stormy16.c
index 99aea1ce660..6cbe52d5048 100644
--- a/gcc/config/stormy16/stormy16.c
+++ b/gcc/config/stormy16/stormy16.c
@@ -996,7 +996,7 @@ xstormy16_compute_stack_layout (void)
if (REG_NEEDS_SAVE (regno, ifun))
layout.register_save_size += UNITS_PER_WORD;
- if (current_function_stdarg)
+ if (cfun->stdarg)
layout.stdarg_save_size = NUM_ARGUMENT_REGISTERS * UNITS_PER_WORD;
else
layout.stdarg_save_size = 0;
diff --git a/gcc/config/v850/v850.c b/gcc/config/v850/v850.c
index c99841a31a4..2a0f3093641 100644
--- a/gcc/config/v850/v850.c
+++ b/gcc/config/v850/v850.c
@@ -1386,7 +1386,7 @@ compute_register_save_size (long * p_reg_saved)
long reg_saved = 0;
/* Count the return pointer if we need to save it. */
- if (current_function_profile && !call_p)
+ if (crtl->profile && !call_p)
{
df_set_regs_ever_live (LINK_POINTER_REGNUM, true);
call_p = 1;
diff --git a/gcc/config/vxworks.c b/gcc/config/vxworks.c
index 4fde6ad3c87..709791b02a3 100644
--- a/gcc/config/vxworks.c
+++ b/gcc/config/vxworks.c
@@ -26,6 +26,7 @@ along with GCC; see the file COPYING3. If not see
#include "toplev.h"
#include "output.h"
#include "tm.h"
+#include "tree.h"
/* Like default_named_section_asm_out_constructor, except that even
constructors with DEFAULT_INIT_PRIORITY must go in a numbered
@@ -56,11 +57,87 @@ vxworks_asm_out_destructor (rtx symbol, int priority)
assemble_addr_to_section (symbol, sec);
}
+/* Return the list of FIELD_DECLs that make up an emulated TLS
+ variable's control object. TYPE is the structure these are fields
+ of and *NAME will be filled in with the structure tag that should
+ be used. */
+
+static tree
+vxworks_emutls_var_fields (tree type, tree *name)
+{
+ tree field, next_field;
+
+ *name = get_identifier ("__tls_var");
+
+ field = build_decl (FIELD_DECL, get_identifier ("size"),
+ unsigned_type_node);
+ DECL_CONTEXT (field) = type;
+ next_field = field;
+
+ field = build_decl (FIELD_DECL, get_identifier ("module_id"),
+ unsigned_type_node);
+ DECL_CONTEXT (field) = type;
+ TREE_CHAIN (field) = next_field;
+ next_field = field;
+
+ field = build_decl (FIELD_DECL, get_identifier ("offset"),
+ unsigned_type_node);
+ DECL_CONTEXT (field) = type;
+ TREE_CHAIN (field) = next_field;
+
+ return field;
+}
+
+/* Return the CONSTRUCTOR to initialize an emulated TLS control
+ object. VAR is the control object. DECL is the TLS object itself
+ and TMPL_ADDR is the address (an ADDR_EXPR) of the initializer for
+ that object. */
+
+static tree
+vxworks_emutls_var_init (tree var, tree decl, tree tmpl_addr)
+{
+ VEC(constructor_elt,gc) *v = VEC_alloc (constructor_elt, gc, 3);
+ constructor_elt *elt;
+
+ tree type = TREE_TYPE (var);
+ tree field = TYPE_FIELDS (type);
+
+ elt = VEC_quick_push (constructor_elt, v, NULL);
+ elt->index = field;
+ elt->value = fold_convert (TREE_TYPE (field), tmpl_addr);
+
+ elt = VEC_quick_push (constructor_elt, v, NULL);
+ field = TREE_CHAIN (field);
+ elt->index = field;
+ elt->value = build_int_cst (TREE_TYPE (field), 0);
+
+ elt = VEC_quick_push (constructor_elt, v, NULL);
+ field = TREE_CHAIN (field);
+ elt->index = field;
+ elt->value = fold_convert (TREE_TYPE (field), DECL_SIZE_UNIT (decl));
+
+ return build_constructor (type, v);
+}
+
/* Do VxWorks-specific parts of OVERRIDE_OPTIONS. */
void
vxworks_override_options (void)
{
+ /* We don't support __thread via target hooks. */
+ targetm.have_tls = false;
+
+ targetm.emutls.get_address = "__builtin___tls_lookup";
+ targetm.emutls.register_common = NULL;
+ targetm.emutls.var_section = ".tls_vars";
+ targetm.emutls.tmpl_section = ".tls_data";
+ targetm.emutls.var_prefix = "__tls__";
+ targetm.emutls.tmpl_prefix = "";
+ targetm.emutls.var_fields = vxworks_emutls_var_fields;
+ targetm.emutls.var_init = vxworks_emutls_var_init;
+ targetm.emutls.var_align_fixed = true;
+ targetm.emutls.debug_form_tls_address = true;
+
/* We can use .ctors/.dtors sections only in RTP mode. */
targetm.have_ctors_dtors = TARGET_VXWORKS_RTP;
diff --git a/gcc/config/xtensa/xtensa.h b/gcc/config/xtensa/xtensa.h
index b78b25f5aa8..eaef97e2094 100644
--- a/gcc/config/xtensa/xtensa.h
+++ b/gcc/config/xtensa/xtensa.h
@@ -23,7 +23,6 @@ along with GCC; see the file COPYING3. If not see
#include "xtensa-config.h"
/* Standard GCC variables that we reference. */
-extern int current_function_calls_alloca;
extern int optimize;
/* External variables defined in xtensa.c. */
diff --git a/gcc/coretypes.h b/gcc/coretypes.h
index 03eb0decc4f..4fe480f781f 100644
--- a/gcc/coretypes.h
+++ b/gcc/coretypes.h
@@ -69,7 +69,9 @@ struct cpp_reader;
to it, so it's here. */
enum tls_model {
TLS_MODEL_NONE,
- TLS_MODEL_GLOBAL_DYNAMIC,
+ TLS_MODEL_EMULATED,
+ TLS_MODEL_REAL,
+ TLS_MODEL_GLOBAL_DYNAMIC = TLS_MODEL_REAL,
TLS_MODEL_LOCAL_DYNAMIC,
TLS_MODEL_INITIAL_EXEC,
TLS_MODEL_LOCAL_EXEC
diff --git a/gcc/coverage.c b/gcc/coverage.c
index cd1c13e2d57..ec8d589539f 100644
--- a/gcc/coverage.c
+++ b/gcc/coverage.c
@@ -43,6 +43,7 @@ along with GCC; see the file COPYING3. If not see
#include "hashtab.h"
#include "tree-iterator.h"
#include "cgraph.h"
+#include "tree-pass.h"
#include "gcov-io.c"
@@ -421,6 +422,9 @@ coverage_counter_alloc (unsigned counter, unsigned num)
ASM_GENERATE_INTERNAL_LABEL (buf, "LPBX", counter + 1);
DECL_NAME (tree_ctr_tables[counter]) = get_identifier (buf);
DECL_ALIGN (tree_ctr_tables[counter]) = TYPE_ALIGN (gcov_type_node);
+
+ if (dump_file)
+ fprintf (dump_file, "Using data file %s\n", da_file_name);
}
fn_b_ctrs[counter] = fn_n_ctrs[counter];
fn_n_ctrs[counter] += num;
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 1ea37333236..5bbeda665d9 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,88 @@
+2008-05-02 Simon Baldwin <simonb@google.com>
+
+ PR bootstrap/36108
+ * typeck.c (build_array_ref): Remove warn_array_subscript_range.
+
+2008-05-01 Simon Baldwin <simonb@google.com>
+
+ * typeck.c (build_array_ref): Call warn_array_subscript_range.
+
+2008-04-30 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/35986
+ * pt.c (more_specialized_fn): Stop the loop even if there are no
+ arguments before ellipsis.
+
+2008-04-29 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/35650
+ * parser.c (cp_parser_lookup_name): Look through single function
+ OVERLOAD.
+
+ PR c++/35987
+ * typeck.c (cp_build_modify_expr) <case PREINCREMENT_EXPR>: Don't build
+ COMPOUND_EXPR if the second argument would be error_mark_node.
+
+2008-04-28 Jason Merrill <jason@redhat.com>
+ Liu Guanwei <liu_gw@163.com>
+
+ PR c++/57
+ * parser.c (cp_parser_parameter_declaration): Handle < ambiguity
+ in default arguments.
+
+2008-04-25 Jan Hubicka <jh@suse.cz>
+
+ * typeck.c (check_return_expr): Update.
+ * decl.c (start_preparsed_function): Update.
+ * method.c (use_thunk): Update.
+
+2008-04-24 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/35758
+ * cp-tree.h (cp_reconstruct_complex_type): New prototype.
+ * cp-objcp-common.h (LANG_HOOKS_RECONSTRUCT_COMPLEX_TYPE): Define.
+ * decl2.c (is_late_template_attribute): Only make vector_size
+ late tmpl attribute if argument is type or value dependent.
+ (cp_reconstruct_complex_type): New function.
+
+2008-04-24 Richard Guenther <rguenther@suse.de>
+
+ * typeck.c (cp_build_function_call): Call
+ check_builtin_function_arguments.
+
+2008-04-23 Paolo Bonzini <bonzini@gnu.org>
+
+ * typeck.c (get_member_function_from_ptrfunc): Don't set TREE_INVARIANT.
+ (build_ptrmemfunc1): Don't set TREE_INVARIANT.
+ * init.c (build_zero_init): Don't set TREE_INVARIANT.
+ * class.c (build_base_path): Don't set TREE_INVARIANT.
+ (build_vtbl_ref_1): Don't set TREE_INVARIANT.
+ (build_vtbl_initializer): Don't set TREE_INVARIANT.
+ * decl.c (build_enumerator): Don't set TREE_INVARIANT.
+ * rtti.c (tinfo_base_init): Don't set TREE_INVARIANT.
+ (generic_initializer): Don't set TREE_INVARIANT.
+ (ptr_initializer): Don't set TREE_INVARIANT.
+ (ptm_initializer): Don't set TREE_INVARIANT.
+ (class_initializer): Don't set TREE_INVARIANT.
+ * typeck2.c (process_init_constructor): Don't set TREE_INVARIANT.
+ * pt.c (push_inline_template_parms_recursive): Don't set TREE_INVARIANT.
+ (build_template_parm_index): Don't set TREE_INVARIANT.
+ (reduce_template_parm_level): Don't set TREE_INVARIANT.
+ (process_template_parm): Don't set TREE_INVARIANT.
+
+2008-04-22 Jason Merrill <jason@redhat.com>
+
+ PR c++/35316
+ * semantics.c (finish_decltype_type): Check DECL_BIT_FIELD_TYPE
+ to see if DECL_BIT_FIELD_TYPE should be used, not some other flag.
+ * typeck.c (is_bitfield_expr_with_lowered_type): Likewise.
+
+2008-04-22 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/35747
+ * semantics.c (finish_stmt_expr): Call pop_stmt_list even if the stmt
+ expression is errorneous.
+
2008-04-21 Jason Merrill <jason@redhat.com>
PR c++/35325
diff --git a/gcc/cp/class.c b/gcc/cp/class.c
index a6dbc13a9b3..73f5dd5f717 100644
--- a/gcc/cp/class.c
+++ b/gcc/cp/class.c
@@ -385,7 +385,6 @@ build_base_path (enum tree_code code,
v_offset);
v_offset = cp_build_indirect_ref (v_offset, NULL, tf_warning_or_error);
TREE_CONSTANT (v_offset) = 1;
- TREE_INVARIANT (v_offset) = 1;
offset = convert_to_integer (ptrdiff_type_node,
size_diffop (offset,
@@ -630,7 +629,6 @@ build_vtbl_ref_1 (tree instance, tree idx)
aref = build_array_ref (vtbl, idx);
TREE_CONSTANT (aref) |= TREE_CONSTANT (vtbl) && TREE_CONSTANT (idx);
- TREE_INVARIANT (aref) = TREE_CONSTANT (aref);
return aref;
}
@@ -7450,7 +7448,6 @@ build_vtbl_initializer (tree binfo,
TREE_OPERAND (init, 0),
build_int_cst (NULL_TREE, i));
TREE_CONSTANT (fdesc) = 1;
- TREE_INVARIANT (fdesc) = 1;
vfun_inits = tree_cons (NULL_TREE, fdesc, vfun_inits);
}
diff --git a/gcc/cp/cp-objcp-common.h b/gcc/cp/cp-objcp-common.h
index a15b6b47a4f..b2b8405fccd 100644
--- a/gcc/cp/cp-objcp-common.h
+++ b/gcc/cp/cp-objcp-common.h
@@ -125,6 +125,8 @@ extern tree objcp_tsubst_copy_and_build (tree, tree, tsubst_flags_t,
#define LANG_HOOKS_TYPE_PROMOTES_TO cxx_type_promotes_to
#undef LANG_HOOKS_REGISTER_BUILTIN_TYPE
#define LANG_HOOKS_REGISTER_BUILTIN_TYPE c_register_builtin_type
+#undef LANG_HOOKS_RECONSTRUCT_COMPLEX_TYPE
+#define LANG_HOOKS_RECONSTRUCT_COMPLEX_TYPE cp_reconstruct_complex_type
#undef LANG_HOOKS_TO_TARGET_CHARSET
#define LANG_HOOKS_TO_TARGET_CHARSET c_common_to_target_charset
#undef LANG_HOOKS_GIMPLIFY_EXPR
diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h
index 27212c3c85c..8d223bc6f27 100644
--- a/gcc/cp/cp-tree.h
+++ b/gcc/cp/cp-tree.h
@@ -4282,6 +4282,7 @@ extern tree grokfield (const cp_declarator *, cp_decl_specifier_seq *,
tree, bool, tree, tree);
extern tree grokbitfield (const cp_declarator *, cp_decl_specifier_seq *,
tree);
+extern tree cp_reconstruct_complex_type (tree, tree);
extern void cplus_decl_attributes (tree *, tree, int);
extern void finish_anon_union (tree);
extern void cp_write_global_declarations (void);
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index d16cb78d06b..221b30040d7 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -10967,7 +10967,6 @@ build_enumerator (tree name, tree value, tree enumtype)
DECL_CONTEXT (decl) = FROB_CONTEXT (context);
TREE_CONSTANT (decl) = 1;
- TREE_INVARIANT (decl) = 1;
TREE_READONLY (decl) = 1;
DECL_INITIAL (decl) = value;
@@ -11279,7 +11278,7 @@ start_preparsed_function (tree decl1, tree attrs, int flags)
call expand_expr to calculate the size of a variable-sized array.
We haven't necessarily assigned RTL to all variables yet, so it's
not safe to try to expand expressions involving them. */
- cfun->x_dont_save_pending_sizes_p = 1;
+ cfun->dont_save_pending_sizes_p = 1;
/* Start the statement-tree, start the tree now. */
DECL_SAVED_TREE (decl1) = push_stmt_list ();
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c
index 078ca99e6f8..41af32faec4 100644
--- a/gcc/cp/decl2.c
+++ b/gcc/cp/decl2.c
@@ -991,11 +991,8 @@ is_late_template_attribute (tree attr, tree decl)
/* Unknown attribute. */
return false;
- /* Attribute vector_size handling wants to dive into the back end array
- building code, which breaks during template processing. */
- if (is_attribute_p ("vector_size", name)
- /* Attribute weak handling wants to write out assembly right away. */
- || is_attribute_p ("weak", name))
+ /* Attribute weak handling wants to write out assembly right away. */
+ if (is_attribute_p ("weak", name))
return true;
/* If any of the arguments are dependent expressions, we can't evaluate
@@ -1120,6 +1117,62 @@ save_template_attributes (tree *attr_p, tree *decl_p)
}
}
+/* Like reconstruct_complex_type, but handle also template trees. */
+
+tree
+cp_reconstruct_complex_type (tree type, tree bottom)
+{
+ tree inner, outer;
+
+ if (TREE_CODE (type) == POINTER_TYPE)
+ {
+ inner = cp_reconstruct_complex_type (TREE_TYPE (type), bottom);
+ outer = build_pointer_type_for_mode (inner, TYPE_MODE (type),
+ TYPE_REF_CAN_ALIAS_ALL (type));
+ }
+ else if (TREE_CODE (type) == REFERENCE_TYPE)
+ {
+ inner = cp_reconstruct_complex_type (TREE_TYPE (type), bottom);
+ outer = build_reference_type_for_mode (inner, TYPE_MODE (type),
+ TYPE_REF_CAN_ALIAS_ALL (type));
+ }
+ else if (TREE_CODE (type) == ARRAY_TYPE)
+ {
+ inner = cp_reconstruct_complex_type (TREE_TYPE (type), bottom);
+ outer = build_cplus_array_type (inner, TYPE_DOMAIN (type));
+ /* Don't call cp_build_qualified_type on ARRAY_TYPEs, the
+ element type qualification will be handled by the recursive
+ cp_reconstruct_complex_type call and cp_build_qualified_type
+ for ARRAY_TYPEs changes the element type. */
+ return outer;
+ }
+ else if (TREE_CODE (type) == FUNCTION_TYPE)
+ {
+ inner = cp_reconstruct_complex_type (TREE_TYPE (type), bottom);
+ outer = build_function_type (inner, TYPE_ARG_TYPES (type));
+ }
+ else if (TREE_CODE (type) == METHOD_TYPE)
+ {
+ inner = cp_reconstruct_complex_type (TREE_TYPE (type), bottom);
+ /* The build_method_type_directly() routine prepends 'this' to argument list,
+ so we must compensate by getting rid of it. */
+ outer
+ = build_method_type_directly
+ (TREE_TYPE (TREE_VALUE (TYPE_ARG_TYPES (type))),
+ inner,
+ TREE_CHAIN (TYPE_ARG_TYPES (type)));
+ }
+ else if (TREE_CODE (type) == OFFSET_TYPE)
+ {
+ inner = cp_reconstruct_complex_type (TREE_TYPE (type), bottom);
+ outer = build_offset_type (TYPE_OFFSET_BASETYPE (type), inner);
+ }
+ else
+ return bottom;
+
+ return cp_build_qualified_type (outer, TYPE_QUALS (type));
+}
+
/* Like decl_attributes, but handle C++ complexity. */
void
diff --git a/gcc/cp/init.c b/gcc/cp/init.c
index 6b2156d39cc..dab7dc8a68f 100644
--- a/gcc/cp/init.c
+++ b/gcc/cp/init.c
@@ -261,10 +261,7 @@ build_zero_init (tree type, tree nelts, bool static_storage_p)
/* In all cases, the initializer is a constant. */
if (init)
- {
- TREE_CONSTANT (init) = 1;
- TREE_INVARIANT (init) = 1;
- }
+ TREE_CONSTANT (init) = 1;
return init;
}
diff --git a/gcc/cp/method.c b/gcc/cp/method.c
index 03cd4439090..45358b2c5f4 100644
--- a/gcc/cp/method.c
+++ b/gcc/cp/method.c
@@ -437,7 +437,7 @@ use_thunk (tree thunk_fndecl, bool emit_p)
BLOCK_VARS (fn_block) = a;
DECL_INITIAL (thunk_fndecl) = fn_block;
init_function_start (thunk_fndecl);
- current_function_is_thunk = 1;
+ crtl->is_thunk = 1;
assemble_start_function (thunk_fndecl, fnname);
targetm.asm_out.output_mi_thunk (asm_out_file, thunk_fndecl,
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index f2acddbb255..a78e124a246 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -13723,6 +13723,7 @@ cp_parser_parameter_declaration (cp_parser *parser,
&& TYPE_BEING_DEFINED (current_class_type))
{
unsigned depth = 0;
+ int maybe_template_id = 0;
cp_token *first_token;
cp_token *token;
@@ -13741,6 +13742,33 @@ cp_parser_parameter_declaration (cp_parser *parser,
/* In valid code, a default argument must be
immediately followed by a `,' `)', or `...'. */
case CPP_COMMA:
+ if (depth == 0 && maybe_template_id)
+ {
+ /* If we've seen a '<', we might be in a
+ template-argument-list. Until Core issue 325 is
+ resolved, we don't know how this situation ought
+ to be handled, so try to DTRT. We check whether
+ what comes after the comma is a valid parameter
+ declaration list. If it is, then the comma ends
+ the default argument; otherwise the default
+ argument continues. */
+ bool error = false;
+
+ /* Set ITALP so cp_parser_parameter_declaration_list
+ doesn't decide to commit to this parse. */
+ bool saved_italp = parser->in_template_argument_list_p;
+ parser->in_template_argument_list_p = true;
+
+ cp_parser_parse_tentatively (parser);
+ cp_lexer_consume_token (parser->lexer);
+ cp_parser_parameter_declaration_list (parser, &error);
+ if (!cp_parser_error_occurred (parser) && !error)
+ done = true;
+ cp_parser_abort_tentative_parse (parser);
+
+ parser->in_template_argument_list_p = saved_italp;
+ break;
+ }
case CPP_CLOSE_PAREN:
case CPP_ELLIPSIS:
/* If we run into a non-nested `;', `}', or `]',
@@ -13764,6 +13792,13 @@ cp_parser_parameter_declaration (cp_parser *parser,
++depth;
break;
+ case CPP_LESS:
+ if (depth == 0)
+ /* This might be the comparison operator, or it might
+ start a template argument list. */
+ ++maybe_template_id;
+ break;
+
case CPP_RSHIFT:
if (cxx_dialect == cxx98)
break;
@@ -13772,11 +13807,16 @@ cp_parser_parameter_declaration (cp_parser *parser,
cases. */
case CPP_GREATER:
- /* If we see a non-nested `>', and `>' is not an
- operator, then it marks the end of the default
- argument. */
- if (!depth && !greater_than_is_operator_p)
- done = true;
+ if (depth == 0)
+ {
+ /* This might be an operator, or it might close a
+ template argument list. But if a previous '<'
+ started a template argument list, this will have
+ closed it, so we can't be in one anymore. */
+ maybe_template_id -= 1 + (token->type == CPP_RSHIFT);
+ if (maybe_template_id < 0)
+ maybe_template_id = 0;
+ }
break;
/* If we run out of tokens, issue an error message. */
@@ -16407,6 +16447,13 @@ cp_parser_lookup_name (cp_parser *parser, tree name,
decl = lookup_qualified_name (parser->scope, name,
tag_type != none_type,
/*complain=*/true);
+
+ /* If we have a single function from a using decl, pull it out. */
+ if (decl
+ && TREE_CODE (decl) == OVERLOAD
+ && !really_overloaded_fn (decl))
+ decl = OVL_FUNCTION (decl);
+
if (pushed_scope)
pop_scope (pushed_scope);
}
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index e55ce97b6a7..b13573ce43c 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -384,7 +384,6 @@ push_inline_template_parms_recursive (tree parmlist, int levels)
TREE_TYPE (parm));
DECL_ARTIFICIAL (decl) = 1;
TREE_CONSTANT (decl) = 1;
- TREE_INVARIANT (decl) = 1;
TREE_READONLY (decl) = 1;
DECL_INITIAL (decl) = DECL_INITIAL (parm);
SET_DECL_TEMPLATE_PARM_P (decl);
@@ -2870,7 +2869,6 @@ build_template_parm_index (int index,
TEMPLATE_PARM_DECL (t) = decl;
TREE_TYPE (t) = type;
TREE_CONSTANT (t) = TREE_CONSTANT (decl);
- TREE_INVARIANT (t) = TREE_INVARIANT (decl);
TREE_READONLY (t) = TREE_READONLY (decl);
return t;
@@ -2923,7 +2921,6 @@ reduce_template_parm_level (tree index, tree type, int levels, tree args,
decl = build_decl (TREE_CODE (orig_decl), DECL_NAME (orig_decl), type);
TREE_CONSTANT (decl) = TREE_CONSTANT (orig_decl);
- TREE_INVARIANT (decl) = TREE_INVARIANT (orig_decl);
TREE_READONLY (decl) = TREE_READONLY (orig_decl);
DECL_ARTIFICIAL (decl) = 1;
SET_DECL_TEMPLATE_PARM_P (decl);
@@ -3020,11 +3017,9 @@ process_template_parm (tree list, tree parm, bool is_non_type,
/* A template parameter is not modifiable. */
TREE_CONSTANT (parm) = 1;
- TREE_INVARIANT (parm) = 1;
TREE_READONLY (parm) = 1;
decl = build_decl (CONST_DECL, DECL_NAME (parm), TREE_TYPE (parm));
TREE_CONSTANT (decl) = 1;
- TREE_INVARIANT (decl) = 1;
TREE_READONLY (decl) = 1;
DECL_INITIAL (parm) = DECL_INITIAL (decl)
= build_template_parm_index (idx, processing_template_decl,
@@ -13657,7 +13652,9 @@ more_specialized_fn (tree pat1, tree pat2, int len)
processing_template_decl++;
- while (len--)
+ while (len--
+ /* Stop when an ellipsis is seen. */
+ && args1 != NULL_TREE && args2 != NULL_TREE)
{
tree arg1 = TREE_VALUE (args1);
tree arg2 = TREE_VALUE (args2);
@@ -13820,10 +13817,6 @@ more_specialized_fn (tree pat1, tree pat2, int len)
args1 = TREE_CHAIN (args1);
args2 = TREE_CHAIN (args2);
-
- /* Stop when an ellipsis is seen. */
- if (args1 == NULL_TREE || args2 == NULL_TREE)
- break;
}
processing_template_decl--;
diff --git a/gcc/cp/rtti.c b/gcc/cp/rtti.c
index d17ef6433e1..2d2ef5b84e1 100644
--- a/gcc/cp/rtti.c
+++ b/gcc/cp/rtti.c
@@ -902,7 +902,6 @@ tinfo_base_init (tinfo_s *ti, tree target)
init = build_constructor_from_list (NULL_TREE, nreverse (init));
TREE_CONSTANT (init) = 1;
- TREE_INVARIANT (init) = 1;
TREE_STATIC (init) = 1;
init = tree_cons (NULL_TREE, init, NULL_TREE);
@@ -920,7 +919,6 @@ generic_initializer (tinfo_s *ti, tree target)
init = build_constructor_from_list (NULL_TREE, init);
TREE_CONSTANT (init) = 1;
- TREE_INVARIANT (init) = 1;
TREE_STATIC (init) = 1;
return init;
}
@@ -946,7 +944,6 @@ ptr_initializer (tinfo_s *ti, tree target)
init = build_constructor_from_list (NULL_TREE, nreverse (init));
TREE_CONSTANT (init) = 1;
- TREE_INVARIANT (init) = 1;
TREE_STATIC (init) = 1;
return init;
}
@@ -979,7 +976,6 @@ ptm_initializer (tinfo_s *ti, tree target)
init = build_constructor_from_list (NULL_TREE, nreverse (init));
TREE_CONSTANT (init) = 1;
- TREE_INVARIANT (init) = 1;
TREE_STATIC (init) = 1;
return init;
}
@@ -996,7 +992,6 @@ class_initializer (tinfo_s *ti, tree target, tree trail)
TREE_CHAIN (init) = trail;
init = build_constructor_from_list (NULL_TREE, init);
TREE_CONSTANT (init) = 1;
- TREE_INVARIANT (init) = 1;
TREE_STATIC (init) = 1;
return init;
}
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c
index 12cf38750db..7881a9faf1b 100644
--- a/gcc/cp/semantics.c
+++ b/gcc/cp/semantics.c
@@ -1739,7 +1739,10 @@ finish_stmt_expr (tree stmt_expr, bool has_no_scope)
tree result;
if (error_operand_p (stmt_expr))
- return error_mark_node;
+ {
+ pop_stmt_list (stmt_expr);
+ return error_mark_node;
+ }
gcc_assert (TREE_CODE (stmt_expr) == STATEMENT_LIST);
@@ -4171,7 +4174,7 @@ finish_decltype_type (tree expr, bool id_expression_or_member_access_p)
switch (TREE_CODE (expr))
{
case FIELD_DECL:
- if (DECL_C_BIT_FIELD (expr))
+ if (DECL_BIT_FIELD_TYPE (expr))
{
type = DECL_BIT_FIELD_TYPE (expr);
break;
diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c
index 9e9d46151a9..bf264ad2cc7 100644
--- a/gcc/cp/typeck.c
+++ b/gcc/cp/typeck.c
@@ -1507,7 +1507,7 @@ is_bitfield_expr_with_lowered_type (const_tree exp)
tree field;
field = TREE_OPERAND (exp, 1);
- if (TREE_CODE (field) != FIELD_DECL || !DECL_C_BIT_FIELD (field))
+ if (TREE_CODE (field) != FIELD_DECL || !DECL_BIT_FIELD_TYPE (field))
return NULL_TREE;
if (same_type_ignoring_top_level_qualifiers_p
(TREE_TYPE (exp), DECL_BIT_FIELD_TYPE (field)))
@@ -2766,7 +2766,6 @@ get_member_function_from_ptrfunc (tree *instance_ptrptr, tree function)
fold_convert (sizetype, idx));
e2 = cp_build_indirect_ref (e2, NULL, tf_warning_or_error);
TREE_CONSTANT (e2) = 1;
- TREE_INVARIANT (e2) = 1;
/* When using function descriptors, the address of the
vtable entry is treated as a function pointer. */
@@ -2890,9 +2889,15 @@ cp_build_function_call (tree function, tree params, tsubst_flags_t complain)
if (nargs < 0)
return error_mark_node;
+ /* Check that arguments to builtin functions match the expectations. */
+ if (fndecl
+ && DECL_BUILT_IN (fndecl)
+ && DECL_BUILT_IN_CLASS (fndecl) == BUILT_IN_NORMAL
+ && !check_builtin_function_arguments (fndecl, nargs, argarray))
+ return error_mark_node;
+
/* Check for errors in format strings and inappropriately
null parameters. */
-
check_function_arguments (TYPE_ATTRIBUTES (fntype), nargs, argarray,
parm_types);
@@ -5940,10 +5945,11 @@ cp_build_modify_expr (tree lhs, enum tree_code modifycode, tree rhs,
lhs = build2 (TREE_CODE (lhs), TREE_TYPE (lhs),
stabilize_reference (TREE_OPERAND (lhs, 0)),
TREE_OPERAND (lhs, 1));
- return build2 (COMPOUND_EXPR, lhstype,
- lhs,
- cp_build_modify_expr (TREE_OPERAND (lhs, 0),
- modifycode, rhs, complain));
+ newrhs = cp_build_modify_expr (TREE_OPERAND (lhs, 0),
+ modifycode, rhs, complain);
+ if (newrhs == error_mark_node)
+ return error_mark_node;
+ return build2 (COMPOUND_EXPR, lhstype, lhs, newrhs);
/* Handle (a, b) used as an "lvalue". */
case COMPOUND_EXPR:
@@ -6396,7 +6402,6 @@ build_ptrmemfunc1 (tree type, tree delta, tree pfn)
CONSTRUCTOR_APPEND_ELT(v, delta_field, delta);
u = build_constructor (type, v);
TREE_CONSTANT (u) = TREE_CONSTANT (pfn) & TREE_CONSTANT (delta);
- TREE_INVARIANT (u) = TREE_INVARIANT (pfn) & TREE_INVARIANT (delta);
TREE_STATIC (u) = (TREE_CONSTANT (u)
&& (initializer_constant_valid_p (pfn, TREE_TYPE (pfn))
!= NULL_TREE)
@@ -7134,7 +7139,7 @@ check_return_expr (tree retval, bool *no_warning)
if (retval == error_mark_node)
return retval;
/* We can't initialize a register from a AGGR_INIT_EXPR. */
- else if (! current_function_returns_struct
+ else if (! cfun->returns_struct
&& TREE_CODE (retval) == TARGET_EXPR
&& TREE_CODE (TREE_OPERAND (retval, 1)) == AGGR_INIT_EXPR)
retval = build2 (COMPOUND_EXPR, TREE_TYPE (retval), retval,
diff --git a/gcc/cp/typeck2.c b/gcc/cp/typeck2.c
index 409c4922378..c7339f1832d 100644
--- a/gcc/cp/typeck2.c
+++ b/gcc/cp/typeck2.c
@@ -1081,7 +1081,6 @@ process_init_constructor (tree type, tree init)
if (!(flags & PICFLAG_NOT_ALL_CONSTANT))
{
TREE_CONSTANT (init) = 1;
- TREE_INVARIANT (init) = 1;
if (!(flags & PICFLAG_NOT_ALL_SIMPLE))
TREE_STATIC (init) = 1;
}
diff --git a/gcc/df-scan.c b/gcc/df-scan.c
index 4a733d6955c..79714e92a08 100644
--- a/gcc/df-scan.c
+++ b/gcc/df-scan.c
@@ -3871,7 +3871,7 @@ df_get_exit_block_use_set (bitmap exit_block_uses)
#ifdef EH_RETURN_DATA_REGNO
/* Mark the registers that will contain data for the handler. */
- if (reload_completed && current_function_calls_eh_return)
+ if (reload_completed && crtl->calls_eh_return)
for (i = 0; ; ++i)
{
unsigned regno = EH_RETURN_DATA_REGNO (i);
@@ -3883,7 +3883,7 @@ df_get_exit_block_use_set (bitmap exit_block_uses)
#ifdef EH_RETURN_STACKADJ_RTX
if ((!HAVE_epilogue || ! epilogue_completed)
- && current_function_calls_eh_return)
+ && crtl->calls_eh_return)
{
rtx tmp = EH_RETURN_STACKADJ_RTX;
if (tmp && REG_P (tmp))
@@ -3893,7 +3893,7 @@ df_get_exit_block_use_set (bitmap exit_block_uses)
#ifdef EH_RETURN_HANDLER_RTX
if ((!HAVE_epilogue || ! epilogue_completed)
- && current_function_calls_eh_return)
+ && crtl->calls_eh_return)
{
rtx tmp = EH_RETURN_HANDLER_RTX;
if (tmp && REG_P (tmp))
diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi
index 7cae1a4e070..f3c6c574a42 100644
--- a/gcc/doc/extend.texi
+++ b/gcc/doc/extend.texi
@@ -7647,13 +7647,13 @@ Generates the @code{movups} machine instruction as a store to memory.
Generates the @code{movss} machine instruction as a load from memory.
@item void __builtin_ia32_storess (float *, v4sf)
Generates the @code{movss} machine instruction as a store to memory.
-@item v4sf __builtin_ia32_loadhps (v4sf, v2si *)
+@item v4sf __builtin_ia32_loadhps (v4sf, const v2sf *)
Generates the @code{movhps} machine instruction as a load from memory.
-@item v4sf __builtin_ia32_loadlps (v4sf, v2si *)
+@item v4sf __builtin_ia32_loadlps (v4sf, const v2sf *)
Generates the @code{movlps} machine instruction as a load from memory
-@item void __builtin_ia32_storehps (v4sf, v2si *)
+@item void __builtin_ia32_storehps (v2sf *, v4sf)
Generates the @code{movhps} machine instruction as a store to memory.
-@item void __builtin_ia32_storelps (v4sf, v2si *)
+@item void __builtin_ia32_storelps (v2sf *, v4sf)
Generates the @code{movlps} machine instruction as a store to memory.
@end table
@@ -7748,15 +7748,15 @@ v16qi __builtin_ia32_punpcklbw128 (v16qi, v16qi)
v8hi __builtin_ia32_punpcklwd128 (v8hi, v8hi)
v4si __builtin_ia32_punpckldq128 (v4si, v4si)
v2di __builtin_ia32_punpcklqdq128 (v2di, v2di)
-v16qi __builtin_ia32_packsswb128 (v16qi, v16qi)
-v8hi __builtin_ia32_packssdw128 (v8hi, v8hi)
-v16qi __builtin_ia32_packuswb128 (v16qi, v16qi)
+v16qi __builtin_ia32_packsswb128 (v8hi, v8hi)
+v8hi __builtin_ia32_packssdw128 (v4si, v4si)
+v16qi __builtin_ia32_packuswb128 (v8hi, v8hi)
v8hi __builtin_ia32_pmulhuw128 (v8hi, v8hi)
void __builtin_ia32_maskmovdqu (v16qi, v16qi)
v2df __builtin_ia32_loadupd (double *)
void __builtin_ia32_storeupd (double *, v2df)
-v2df __builtin_ia32_loadhpd (v2df, double *)
-v2df __builtin_ia32_loadlpd (v2df, double *)
+v2df __builtin_ia32_loadhpd (v2df, double const *)
+v2df __builtin_ia32_loadlpd (v2df, double const *)
int __builtin_ia32_movmskpd (v2df)
int __builtin_ia32_pmovmskb128 (v16qi)
void __builtin_ia32_movnti (int *, int)
@@ -7852,13 +7852,13 @@ v4hi __builtin_ia32_phaddsw (v4hi, v4hi)
v2si __builtin_ia32_phsubd (v2si, v2si)
v4hi __builtin_ia32_phsubw (v4hi, v4hi)
v4hi __builtin_ia32_phsubsw (v4hi, v4hi)
-v8qi __builtin_ia32_pmaddubsw (v8qi, v8qi)
+v4hi __builtin_ia32_pmaddubsw (v8qi, v8qi)
v4hi __builtin_ia32_pmulhrsw (v4hi, v4hi)
v8qi __builtin_ia32_pshufb (v8qi, v8qi)
v8qi __builtin_ia32_psignb (v8qi, v8qi)
v2si __builtin_ia32_psignd (v2si, v2si)
v4hi __builtin_ia32_psignw (v4hi, v4hi)
-long long __builtin_ia32_palignr (long long, long long, int)
+v1di __builtin_ia32_palignr (v1di, v1di, int)
v8qi __builtin_ia32_pabsb (v8qi)
v2si __builtin_ia32_pabsd (v2si)
v4hi __builtin_ia32_pabsw (v4hi)
@@ -7875,13 +7875,13 @@ v8hi __builtin_ia32_phaddsw128 (v8hi, v8hi)
v4si __builtin_ia32_phsubd128 (v4si, v4si)
v8hi __builtin_ia32_phsubw128 (v8hi, v8hi)
v8hi __builtin_ia32_phsubsw128 (v8hi, v8hi)
-v16qi __builtin_ia32_pmaddubsw128 (v16qi, v16qi)
+v8hi __builtin_ia32_pmaddubsw128 (v16qi, v16qi)
v8hi __builtin_ia32_pmulhrsw128 (v8hi, v8hi)
v16qi __builtin_ia32_pshufb128 (v16qi, v16qi)
v16qi __builtin_ia32_psignb128 (v16qi, v16qi)
v4si __builtin_ia32_psignd128 (v4si, v4si)
v8hi __builtin_ia32_psignw128 (v8hi, v8hi)
-v2di __builtin_ia32_palignr (v2di, v2di, int)
+v2di __builtin_ia32_palignr128 (v2di, v2di, int)
v16qi __builtin_ia32_pabsb128 (v16qi)
v4si __builtin_ia32_pabsd128 (v4si)
v8hi __builtin_ia32_pabsw128 (v8hi)
@@ -7997,7 +7997,7 @@ Generates the @code{crc32b} machine instruction.
Generates the @code{crc32w} machine instruction.
@item unsigned int __builtin_ia32_crc32si (unsigned int, unsigned int)
Generates the @code{crc32l} machine instruction.
-@item unsigned long long __builtin_ia32_crc32di (unsigned int, unsigned long long)
+@item unsigned long long __builtin_ia32_crc32di (unsigned long long, unsigned long long)
@end table
The following built-in functions are changed to generate new SSE4.2
diff --git a/gcc/doc/gty.texi b/gcc/doc/gty.texi
index 2ffa1519429..c063d0184e3 100644
--- a/gcc/doc/gty.texi
+++ b/gcc/doc/gty.texi
@@ -316,8 +316,10 @@ escape.
@findex chain_next
@findex chain_prev
+@findex chain_circular
@item chain_next ("@var{expression}")
@itemx chain_prev ("@var{expression}")
+@itemx chain_circular ("@var{expression}")
It's helpful for the type machinery to know if objects are often
chained together in long lists; this lets it generate code that uses
@@ -326,7 +328,8 @@ it. @code{chain_next} is an expression for the next item in the list,
@code{chain_prev} is an expression for the previous item. For singly
linked lists, use only @code{chain_next}; for doubly linked lists, use
both. The machinery requires that taking the next item of the
-previous item gives the original item.
+previous item gives the original item. @code{chain_circular} is similar
+to @code{chain_next}, but can be used for circular single linked lists.
@findex reorder
@item reorder ("@var{function name}")
diff --git a/gcc/doc/install.texi b/gcc/doc/install.texi
index 027b1692bd9..0391ec86b7d 100644
--- a/gcc/doc/install.texi
+++ b/gcc/doc/install.texi
@@ -1201,7 +1201,8 @@ powerpc-linux for powerpc64-linux, only generates 32-bit code. This
option enables the 32-bit target to be a bi-arch compiler, which is
useful when you want a bi-arch compiler that defaults to 32-bit, and
you are building a bi-arch or multi-arch binutils in a combined tree.
-Currently, this option only affects powerpc-linux and x86-linux.
+Currently, this option only affects sparc-linux, powerpc-linux and
+x86-linux.
@item --enable-secureplt
This option enables @option{-msecure-plt} by default for powerpc-linux.
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index bb7be99e7d2..c1823997b2d 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -164,7 +164,7 @@ in the following sections.
@xref{Overall Options,,Options Controlling the Kind of Output}.
@gccoptlist{-c -S -E -o @var{file} -combine -pipe -pass-exit-codes @gol
-x @var{language} -v -### --help@r{[}=@var{class}@r{]} --target-help @gol
---version @@@var{file}}
+--version -wrapper@@@var{file}}
@item C Language Options
@xref{C Dialect Options,,Options Controlling C Dialect}.
@@ -1251,6 +1251,19 @@ diff /tmp/O2-opts /tmp/O3-opts | grep enabled
@opindex version
Display the version number and copyrights of the invoked GCC@.
+@item -wrapper
+@opindex wrapper
+Invoke all subcommands under a wrapper program. It takes a single
+comma separated list as an argument, which will be used to invoke
+the wrapper:
+
+@smallexample
+gcc -c t.c -wrapper gdb,--args
+@end smallexample
+
+This will invoke all subprograms of gcc under "gdb --args",
+thus cc1 invocation will be "gdb --args cc1 ...".
+
@include @value{srcdir}/../libiberty/at-file.texi
@end table
@@ -7206,10 +7219,6 @@ The maximum number of memory locations cselib should take into account.
Increasing values mean more aggressive optimization, making the compile time
increase with probably slightly better performance. The default value is 500.
-@item max-flow-memory-locations
-Similar as @option{max-cselib-memory-locations} but for dataflow liveness.
-The default value is 100.
-
@item reorder-blocks-duplicate
@itemx reorder-blocks-duplicate-feedback
diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi
index 869bb1b6a0a..3c015602298 100644
--- a/gcc/doc/tm.texi
+++ b/gcc/doc/tm.texi
@@ -50,6 +50,7 @@ through the macros defined in the @file{.h} file.
* Floating Point:: Handling floating point for cross-compilers.
* Mode Switching:: Insertion of mode-switching instructions.
* Target Attributes:: Defining target-specific uses of @code{__attribute__}.
+* Emulated TLS:: Emulated TLS support.
* MIPS Coprocessors:: MIPS coprocessor support and how to customize it.
* PCH Target:: Validity checking for precompiled headers.
* C++ ABI:: Controlling C++ ABI changes.
@@ -3170,7 +3171,7 @@ frame, or the frame pointer of the @var{count} @minus{} 1 frame if
@code{RETURN_ADDR_IN_PREVIOUS_FRAME} is defined.
The value of the expression must always be the correct address when
-@var{count} is zero, but may be @code{NULL_RTX} if there is not way to
+@var{count} is zero, but may be @code{NULL_RTX} if there is no way to
determine the return address of other frames.
@end defmac
@@ -9192,6 +9193,84 @@ attributes, @code{false} otherwise. By default, if a function has a
target specific attribute attached to it, it will not be inlined.
@end deftypefn
+@node Emulated TLS
+@section Emulating TLS
+@cindex Emulated TLS
+
+For targets whose psABI does not provide Thread Local Storage via
+specific relocations and instruction sequences, an emulation layer is
+used. A set of target hooks allows this emulation layer to be
+configured for the requirements of a particular target. For instance
+the psABI may infact specify TLS support in terms of an emulation
+layer.
+
+The emulation layer works by creating a control object for every TLS
+object. To access the TLS object, a lookup function is provided
+which, when given the address of the control object, will return the
+address of the current thread's instance of the TLS object.
+
+@deftypevr {Target Hook} {const char *} TARGET_EMUTLS_GET_ADDRESS
+Contains the name of the helper function that uses a TLS control
+object to locate a TLS instance. The default causes libgcc's
+emulated TLS helper function to be used.
+@end deftypevr
+
+@deftypevr {Target Hook} {const char *} TARGET_EMUTLS_REGISTER_COMMON
+Contains the name of the helper function that should be used at
+program startup to register TLS objects that are implicitly
+initialized to zero. If this is @code{NULL}, all TLS objects will
+have explicit initializers. The default causes libgcc's emulated TLS
+registration function to be used.
+@end deftypevr
+
+@deftypevr {Target Hook} {const char *} TARGET_EMUTLS_VAR_SECTION
+Contains the name of the section in which TLS control variables should
+be placed. The default of @code{NULL} allows these to be placed in
+any section.
+@end deftypevr
+
+@deftypevr {Target Hook} {const char *} TARGET_EMUTLS_TMPL_SECTION
+Contains the name of the section in which TLS initializers should be
+placed. The default of @code{NULL} allows these to be placed in any
+section.
+@end deftypevr
+
+@deftypevr {Target Hook} {const char *} TARGET_EMUTLS_VAR_PREFIX
+Contains the prefix to be prepended to TLS control variable names.
+The default of @code{NULL} uses a target-specific prefix.
+@end deftypevr
+
+@deftypevr {Target Hook} {const char *} TARGET_EMUTLS_TMPL_PREFIX
+Contains the prefix to be prepended to TLS initializer objects. The
+default of @code{NULL} uses a target-specific prefix.
+@end deftypevr
+
+@deftypefn {Target Hook} tree TARGET_EMUTLS_VAR_FIELDS (tree @var{type}, tree *@var{name})
+Specifies a function that generates the FIELD_DECLs for a TLS control
+object type. @var{type} is the RECORD_TYPE the fields are for and
+@var{name} should be filled with the structure tag, if the default of
+@code{__emutls_object} is unsuitable. The default creates a type suitable
+for libgcc's emulated TLS function.
+@end deftypefn
+
+@deftypefn {Target Hook} tree TARGET_EMUTLS_VAR_INIT (tree @var{var}, tree @var{decl}, tree @var{tmpl_addr})
+Specifies a function that generates the CONSTRUCTOR to initialize a
+TLS control object. @var{var} is the TLS control object, @var{decl}
+is the TLS object and @var{tmpl_addr} is the address of the
+initializer. The default initializes libgcc's emulated TLS control object.
+@end deftypefn
+
+@deftypevr {Target Hook} {bool} TARGET_EMUTLS_VAR_ALIGN_FIXED
+Specifies whether the alignment of TLS control variable objects is
+fixed and should not be increased as some backends may do to optimize
+single objects. The default is false.
+@end deftypevr
+
+@deftypevr {Target Hook} {bool} TARGET_EMUTLS_DEBUG_FORM_TLS_ADDRESS
+Specifies whether a DWARF @code{DW_OP_form_tls_address} location descriptor
+may be used to describe emulated TLS control objects.
+@end deftypevr
+
@node MIPS Coprocessors
@section Defining coprocessor specifics for MIPS targets.
@cindex MIPS coprocessor-definition macros
diff --git a/gcc/dojump.c b/gcc/dojump.c
index b619e0f49de..e1d2fb2c5c3 100644
--- a/gcc/dojump.c
+++ b/gcc/dojump.c
@@ -70,7 +70,7 @@ void
clear_pending_stack_adjust (void)
{
if (optimize > 0
- && (! flag_omit_frame_pointer || current_function_calls_alloca)
+ && (! flag_omit_frame_pointer || cfun->calls_alloca)
&& EXIT_IGNORE_STACK
&& ! (DECL_INLINE (current_function_decl) && ! flag_no_inline))
discard_pending_stack_adjust ();
@@ -219,8 +219,7 @@ do_jump (tree exp, rtx if_false_label, rtx if_true_label)
/* Strip narrowing integral type conversions. */
while ((TREE_CODE (exp0) == NOP_EXPR
- || TREE_CODE (exp0) == CONVERT_EXPR
- || TREE_CODE (exp0) == NON_LVALUE_EXPR)
+ || TREE_CODE (exp0) == CONVERT_EXPR)
&& TREE_OPERAND (exp0, 0) != error_mark_node
&& TYPE_PRECISION (TREE_TYPE (exp0))
<= TYPE_PRECISION (TREE_TYPE (TREE_OPERAND (exp0, 0))))
diff --git a/gcc/dse.c b/gcc/dse.c
index 9d19b7071ee..6984e19bd95 100644
--- a/gcc/dse.c
+++ b/gcc/dse.c
@@ -531,7 +531,7 @@ struct clear_alias_mode_holder
static alloc_pool clear_alias_mode_pool;
-/* This is true except if current_function_stdarg -- i.e. we cannot do
+/* This is true except if cfun->stdarg -- i.e. we cannot do
this for vararg functions because they play games with the frame. */
static bool stores_off_frame_dead_at_return;
@@ -718,7 +718,7 @@ dse_step0 (void)
bb_table = XCNEWVEC (bb_info_t, last_basic_block);
rtx_group_next_id = 0;
- stores_off_frame_dead_at_return = !current_function_stdarg;
+ stores_off_frame_dead_at_return = !cfun->stdarg;
init_alias_analysis ();
@@ -2163,7 +2163,7 @@ dse_step1 (void)
&& (EDGE_COUNT (bb->succs) == 0
|| (single_succ_p (bb)
&& single_succ (bb) == EXIT_BLOCK_PTR
- && ! current_function_calls_eh_return)))
+ && ! crtl->calls_eh_return)))
{
insn_info_t i_ptr = active_local_stores;
while (i_ptr)
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index 49c13d2afe4..cdf5250b49d 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -2657,8 +2657,8 @@ dwarf2out_begin_prologue (unsigned int line ATTRIBUTE_UNUSED,
fde->dw_fde_cfi = NULL;
fde->funcdef_number = current_function_funcdef_no;
fde->nothrow = TREE_NOTHROW (current_function_decl);
- fde->uses_eh_lsda = cfun->uses_eh_lsda;
- fde->all_throwers_are_sibcalls = cfun->all_throwers_are_sibcalls;
+ fde->uses_eh_lsda = crtl->uses_eh_lsda;
+ fde->all_throwers_are_sibcalls = crtl->all_throwers_are_sibcalls;
args_size = old_args_size = 0;
@@ -3837,7 +3837,7 @@ DEF_VEC_ALLOC_O(dw_attr_node,gc);
The children of each node form a circular list linked by
die_sib. die_child points to the node *before* the "first" child node. */
-typedef struct die_struct GTY(())
+typedef struct die_struct GTY((chain_circular ("%h.die_sib")))
{
enum dwarf_tag die_tag;
char *die_symbol;
@@ -9494,16 +9494,33 @@ loc_descriptor_from_tree_1 (tree loc, int want_address)
if (DECL_THREAD_LOCAL_P (loc))
{
rtx rtl;
+ unsigned first_op;
+ unsigned second_op;
- /* If this is not defined, we have no way to emit the data. */
- if (!targetm.have_tls || !targetm.asm_out.output_dwarf_dtprel)
- return 0;
-
- /* The way DW_OP_GNU_push_tls_address is specified, we can only
- look up addresses of objects in the current module. */
- if (DECL_EXTERNAL (loc))
- return 0;
-
+ if (targetm.have_tls)
+ {
+ /* If this is not defined, we have no way to emit the
+ data. */
+ if (!targetm.asm_out.output_dwarf_dtprel)
+ return 0;
+
+ /* The way DW_OP_GNU_push_tls_address is specified, we
+ can only look up addresses of objects in the current
+ module. */
+ if (DECL_EXTERNAL (loc))
+ return 0;
+ first_op = INTERNAL_DW_OP_tls_addr;
+ second_op = DW_OP_GNU_push_tls_address;
+ }
+ else
+ {
+ if (!targetm.emutls.debug_form_tls_address)
+ return 0;
+ loc = emutls_decl (loc);
+ first_op = DW_OP_addr;
+ second_op = DW_OP_form_tls_address;
+ }
+
rtl = rtl_for_decl_location (loc);
if (rtl == NULL_RTX)
return 0;
@@ -9514,11 +9531,11 @@ loc_descriptor_from_tree_1 (tree loc, int want_address)
if (! CONSTANT_P (rtl))
return 0;
- ret = new_loc_descr (INTERNAL_DW_OP_tls_addr, 0, 0);
+ ret = new_loc_descr (first_op, 0, 0);
ret->dw_loc_oprnd1.val_class = dw_val_class_addr;
ret->dw_loc_oprnd1.v.val_addr = rtl;
-
- ret1 = new_loc_descr (DW_OP_GNU_push_tls_address, 0, 0);
+
+ ret1 = new_loc_descr (second_op, 0, 0);
add_loc_descr (&ret, ret1);
have_address = 1;
@@ -9583,7 +9600,6 @@ loc_descriptor_from_tree_1 (tree loc, int want_address)
case NOP_EXPR:
case CONVERT_EXPR:
- case NON_LVALUE_EXPR:
case VIEW_CONVERT_EXPR:
case SAVE_EXPR:
case GIMPLE_MODIFY_STMT:
@@ -11212,7 +11228,6 @@ add_bound_info (dw_die_ref subrange_die, enum dwarf_attribute bound_attr, tree b
case CONVERT_EXPR:
case NOP_EXPR:
- case NON_LVALUE_EXPR:
case VIEW_CONVERT_EXPR:
add_bound_info (subrange_die, bound_attr, TREE_OPERAND (bound, 0));
break;
diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c
index aa9e96584a1..2fc2f92126a 100644
--- a/gcc/emit-rtl.c
+++ b/gcc/emit-rtl.c
@@ -678,7 +678,7 @@ gen_tmp_stack_mem (enum machine_mode mode, rtx addr)
{
rtx mem = gen_rtx_MEM (mode, addr);
MEM_NOTRAP_P (mem) = 1;
- if (!current_function_calls_alloca)
+ if (!cfun->calls_alloca)
set_mem_alias_set (mem, get_frame_alias_set ());
return mem;
}
@@ -1432,7 +1432,6 @@ component_ref_for_mem_expr (tree ref)
/* Now remove any conversions: they don't change what the underlying
object is. Likewise for SAVE_EXPR. */
while (TREE_CODE (inner) == NOP_EXPR || TREE_CODE (inner) == CONVERT_EXPR
- || TREE_CODE (inner) == NON_LVALUE_EXPR
|| TREE_CODE (inner) == VIEW_CONVERT_EXPR
|| TREE_CODE (inner) == SAVE_EXPR)
inner = TREE_OPERAND (inner, 0);
@@ -1563,7 +1562,6 @@ set_mem_attributes_minus_bitpos (rtx ref, tree t, int objectp,
/* Now remove any conversions: they don't change what the underlying
object is. Likewise for SAVE_EXPR. */
while (TREE_CODE (t) == NOP_EXPR || TREE_CODE (t) == CONVERT_EXPR
- || TREE_CODE (t) == NON_LVALUE_EXPR
|| TREE_CODE (t) == VIEW_CONVERT_EXPR
|| TREE_CODE (t) == SAVE_EXPR)
t = TREE_OPERAND (t, 0);
diff --git a/gcc/except.c b/gcc/except.c
index 9480658b506..f8bacd5902b 100644
--- a/gcc/except.c
+++ b/gcc/except.c
@@ -1691,7 +1691,7 @@ sjlj_assign_call_site_values (rtx dispatch_label, struct sjlj_lp_info *lp_info)
r->landing_pad = dispatch_label;
lp_info[i].action_index = collect_one_action_chain (ar_hash, r);
if (lp_info[i].action_index != -1)
- cfun->uses_eh_lsda = 1;
+ crtl->uses_eh_lsda = 1;
}
htab_delete (ar_hash);
@@ -1817,7 +1817,7 @@ sjlj_emit_function_enter (rtx dispatch_label)
emit_move_insn (mem, eh_personality_libfunc);
mem = adjust_address (fc, Pmode, sjlj_fc_lsda_ofs);
- if (cfun->uses_eh_lsda)
+ if (crtl->uses_eh_lsda)
{
char buf[20];
rtx sym;
@@ -2746,7 +2746,7 @@ can_throw_external (const_rtx insn)
return can_throw_external_1 (INTVAL (XEXP (note, 0)), false);
}
-/* Set TREE_NOTHROW and cfun->all_throwers_are_sibcalls. */
+/* Set TREE_NOTHROW and crtl->all_throwers_are_sibcalls. */
unsigned int
set_nothrow_function_flags (void)
@@ -2761,13 +2761,13 @@ set_nothrow_function_flags (void)
TREE_NOTHROW (current_function_decl) = 1;
- /* Assume cfun->all_throwers_are_sibcalls until we encounter
+ /* Assume crtl->all_throwers_are_sibcalls until we encounter
something that can throw an exception. We specifically exempt
CALL_INSNs that are SIBLING_CALL_P, as these are really jumps,
and can't throw. Most CALL_INSNs are not SIBLING_CALL_P, so this
is optimistic. */
- cfun->all_throwers_are_sibcalls = 1;
+ crtl->all_throwers_are_sibcalls = 1;
if (! flag_exceptions)
return 0;
@@ -2779,7 +2779,7 @@ set_nothrow_function_flags (void)
if (!CALL_P (insn) || !SIBLING_CALL_P (insn))
{
- cfun->all_throwers_are_sibcalls = 0;
+ crtl->all_throwers_are_sibcalls = 0;
return 0;
}
}
@@ -2792,7 +2792,7 @@ set_nothrow_function_flags (void)
if (!CALL_P (insn) || !SIBLING_CALL_P (insn))
{
- cfun->all_throwers_are_sibcalls = 0;
+ crtl->all_throwers_are_sibcalls = 0;
return 0;
}
}
@@ -2829,7 +2829,7 @@ expand_builtin_unwind_init (void)
{
/* Set this so all the registers get saved in our frame; we need to be
able to copy the saved values for any registers from frames we unwind. */
- current_function_saves_all_registers = 1;
+ crtl->saves_all_registers = 1;
#ifdef SETUP_FRAME_ADDRESSES
SETUP_FRAME_ADDRESSES ();
@@ -2952,7 +2952,7 @@ expand_eh_return (void)
if (! crtl->eh.ehr_label)
return;
- current_function_calls_eh_return = 1;
+ crtl->calls_eh_return = 1;
#ifdef EH_RETURN_STACKADJ_RTX
emit_move_insn (EH_RETURN_STACKADJ_RTX, const0_rtx);
@@ -3248,7 +3248,7 @@ convert_to_eh_region_ranges (void)
/* Existence of catch handlers, or must-not-throw regions
implies that an lsda is needed (even if empty). */
if (this_action != -1)
- cfun->uses_eh_lsda = 1;
+ crtl->uses_eh_lsda = 1;
/* Delay creation of region notes for no-action regions
until we're sure that an lsda will be required. */
@@ -3599,7 +3599,7 @@ output_function_exception_table (const char * ARG_UNUSED (fnname))
int tt_format_size = 0;
/* Not all functions need anything. */
- if (! cfun->uses_eh_lsda)
+ if (! crtl->uses_eh_lsda)
return;
if (eh_personality_libfunc)
diff --git a/gcc/explow.c b/gcc/explow.c
index 77d814789e4..d3cc01b9701 100644
--- a/gcc/explow.c
+++ b/gcc/explow.c
@@ -1081,7 +1081,7 @@ allocate_dynamic_stack_space (rtx size, rtx target, int known_align)
return virtual_stack_dynamic_rtx;
/* Otherwise, show we're calling alloca or equivalent. */
- current_function_calls_alloca = 1;
+ cfun->calls_alloca = 1;
/* Ensure the size is in the proper mode. */
if (GET_MODE (size) != VOIDmode && GET_MODE (size) != Pmode)
@@ -1129,7 +1129,7 @@ allocate_dynamic_stack_space (rtx size, rtx target, int known_align)
would use reg notes to store the "optimized" size and fix things
up later. These days we know this information before we ever
start building RTL so the reg notes are unnecessary. */
- if (!current_function_calls_setjmp)
+ if (!cfun->calls_setjmp)
{
int align = PREFERRED_STACK_BOUNDARY / BITS_PER_UNIT;
@@ -1236,7 +1236,7 @@ allocate_dynamic_stack_space (rtx size, rtx target, int known_align)
#endif
/* Check stack bounds if necessary. */
- if (current_function_limit_stack)
+ if (crtl->limit_stack)
{
rtx available;
rtx space_available = gen_label_rtx ();
diff --git a/gcc/expmed.c b/gcc/expmed.c
index d5d2d528ca0..5268b318f8d 100644
--- a/gcc/expmed.c
+++ b/gcc/expmed.c
@@ -976,7 +976,10 @@ store_fixed_bit_field (rtx op0, unsigned HOST_WIDE_INT offset,
}
if (op0 != temp)
- emit_move_insn (op0, temp);
+ {
+ op0 = copy_rtx (op0);
+ emit_move_insn (op0, temp);
+ }
}
/* Store a bit field that is split across multiple accessible memory objects.
diff --git a/gcc/expr.c b/gcc/expr.c
index 7f386439acc..141904f1231 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -4339,8 +4339,8 @@ expand_assignment (tree to, tree from, bool nontemporal)
the place the value is being stored, use a safe function when copying
a value through a pointer into a structure value return block. */
if (TREE_CODE (to) == RESULT_DECL && TREE_CODE (from) == INDIRECT_REF
- && current_function_returns_struct
- && !current_function_returns_pcc_struct)
+ && cfun->returns_struct
+ && !cfun->returns_pcc_struct)
{
rtx from_rtx, size;
@@ -6599,7 +6599,7 @@ highest_pow2_factor (const_tree exp)
}
break;
- case NON_LVALUE_EXPR: case NOP_EXPR: case CONVERT_EXPR:
+ case NOP_EXPR: case CONVERT_EXPR:
case SAVE_EXPR:
return highest_pow2_factor (TREE_OPERAND (exp, 0));
@@ -7121,9 +7121,8 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
}
ignore = (target == const0_rtx
- || ((code == NON_LVALUE_EXPR || code == NOP_EXPR
- || code == CONVERT_EXPR || code == COND_EXPR
- || code == VIEW_CONVERT_EXPR)
+ || ((code == NOP_EXPR || code == CONVERT_EXPR
+ || code == COND_EXPR || code == VIEW_CONVERT_EXPR)
&& TREE_CODE (type) == VOID_TYPE));
/* An operation in what may be a bit-field type needs the
@@ -8018,7 +8017,6 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
return expand_call (exp, target, ignore);
case PAREN_EXPR:
- case NON_LVALUE_EXPR:
case NOP_EXPR:
case CONVERT_EXPR:
if (TREE_OPERAND (exp, 0) == error_mark_node)
@@ -9411,8 +9409,7 @@ static int
is_aligning_offset (const_tree offset, const_tree exp)
{
/* Strip off any conversions. */
- while (TREE_CODE (offset) == NON_LVALUE_EXPR
- || TREE_CODE (offset) == NOP_EXPR
+ while (TREE_CODE (offset) == NOP_EXPR
|| TREE_CODE (offset) == CONVERT_EXPR)
offset = TREE_OPERAND (offset, 0);
@@ -9428,8 +9425,7 @@ is_aligning_offset (const_tree offset, const_tree exp)
/* Look at the first operand of BIT_AND_EXPR and strip any conversion.
It must be NEGATE_EXPR. Then strip any more conversions. */
offset = TREE_OPERAND (offset, 0);
- while (TREE_CODE (offset) == NON_LVALUE_EXPR
- || TREE_CODE (offset) == NOP_EXPR
+ while (TREE_CODE (offset) == NOP_EXPR
|| TREE_CODE (offset) == CONVERT_EXPR)
offset = TREE_OPERAND (offset, 0);
@@ -9437,8 +9433,7 @@ is_aligning_offset (const_tree offset, const_tree exp)
return 0;
offset = TREE_OPERAND (offset, 0);
- while (TREE_CODE (offset) == NON_LVALUE_EXPR
- || TREE_CODE (offset) == NOP_EXPR
+ while (TREE_CODE (offset) == NOP_EXPR
|| TREE_CODE (offset) == CONVERT_EXPR)
offset = TREE_OPERAND (offset, 0);
diff --git a/gcc/final.c b/gcc/final.c
index 177c17687d5..ccef70f00f1 100644
--- a/gcc/final.c
+++ b/gcc/final.c
@@ -1505,7 +1505,7 @@ final_start_function (rtx first ATTRIBUTE_UNUSED, FILE *file,
/* The Sun386i and perhaps other machines don't work right
if the profiling code comes after the prologue. */
#ifdef PROFILE_BEFORE_PROLOGUE
- if (current_function_profile)
+ if (crtl->profile)
profile_function (file);
#endif /* PROFILE_BEFORE_PROLOGUE */
@@ -1550,7 +1550,7 @@ static void
profile_after_prologue (FILE *file ATTRIBUTE_UNUSED)
{
#ifndef PROFILE_BEFORE_PROLOGUE
- if (current_function_profile)
+ if (crtl->profile)
profile_function (file);
#endif /* not PROFILE_BEFORE_PROLOGUE */
}
@@ -1562,7 +1562,7 @@ profile_function (FILE *file ATTRIBUTE_UNUSED)
# define NO_PROFILE_COUNTERS 0
#endif
#if defined(ASM_OUTPUT_REG_PUSH)
- int sval = current_function_returns_struct;
+ int sval = cfun->returns_struct;
rtx svrtx = targetm.calls.struct_value_rtx (TREE_TYPE (current_function_decl), 1);
#if defined(STATIC_CHAIN_INCOMING_REGNUM) || defined(STATIC_CHAIN_REGNUM)
int cxt = cfun->static_chain_decl != NULL;
@@ -3813,7 +3813,7 @@ leaf_function_p (void)
rtx insn;
rtx link;
- if (current_function_profile || profile_arc_flag)
+ if (crtl->profile || profile_arc_flag)
return 0;
for (insn = get_insns (); insn; insn = NEXT_INSN (insn))
@@ -3888,7 +3888,7 @@ only_leaf_regs_used (void)
&& ! permitted_reg_in_leaf_functions[i])
return 0;
- if (current_function_uses_pic_offset_table
+ if (crtl->uses_pic_offset_table
&& pic_offset_table_rtx != 0
&& REG_P (pic_offset_table_rtx)
&& ! permitted_reg_in_leaf_functions[REGNO (pic_offset_table_rtx)])
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index f5ec30c1706..b4645ca256e 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -5953,8 +5953,13 @@ extract_muldiv_1 (tree t, tree c, enum tree_code code, tree wide_type,
/* If these are the same operation types, we can associate them
assuming no overflow. */
if (tcode == code
- && 0 != (t1 = const_binop (MULT_EXPR, fold_convert (ctype, op1),
- fold_convert (ctype, c), 0))
+ && 0 != (t1 = int_const_binop (MULT_EXPR, fold_convert (ctype, op1),
+ fold_convert (ctype, c), 1))
+ && 0 != (t1 = force_fit_type_double (ctype, TREE_INT_CST_LOW (t1),
+ TREE_INT_CST_HIGH (t1),
+ (TYPE_UNSIGNED (ctype)
+ && tcode != MULT_EXPR) ? -1 : 1,
+ TREE_OVERFLOW (t1)))
&& !TREE_OVERFLOW (t1))
return fold_build2 (tcode, ctype, fold_convert (ctype, op0), t1);
@@ -6919,7 +6924,7 @@ try_move_mult_to_index (tree addr, tree op1)
else
{
/* Try if delta is a multiple of step. */
- tree tmp = div_if_zero_remainder (EXACT_DIV_EXPR, delta, step);
+ tree tmp = div_if_zero_remainder (EXACT_DIV_EXPR, op1, step);
if (! tmp)
continue;
delta = tmp;
@@ -8401,9 +8406,8 @@ maybe_canonicalize_comparison (enum tree_code code, tree type,
static bool
pointer_may_wrap_p (tree base, tree offset, HOST_WIDE_INT bitpos)
{
- tree size;
unsigned HOST_WIDE_INT offset_low, total_low;
- HOST_WIDE_INT offset_high, total_high;
+ HOST_WIDE_INT size, offset_high, total_high;
if (!POINTER_TYPE_P (TREE_TYPE (base)))
return true;
@@ -8411,21 +8415,6 @@ pointer_may_wrap_p (tree base, tree offset, HOST_WIDE_INT bitpos)
if (bitpos < 0)
return true;
- size = size_in_bytes (TREE_TYPE (TREE_TYPE (base)));
- if (size == NULL_TREE || TREE_CODE (size) != INTEGER_CST)
- return true;
-
- /* We can do slightly better for SIZE if we have an ADDR_EXPR of an
- array. */
- if (TREE_CODE (base) == ADDR_EXPR)
- {
- tree base_size = size_in_bytes (TREE_TYPE (TREE_OPERAND (base, 0)));
- if (base_size != NULL_TREE
- && TREE_CODE (base_size) == INTEGER_CST
- && INT_CST_LT_UNSIGNED (size, base_size))
- size = base_size;
- }
-
if (offset == NULL_TREE)
{
offset_low = 0;
@@ -8445,13 +8434,25 @@ pointer_may_wrap_p (tree base, tree offset, HOST_WIDE_INT bitpos)
true))
return true;
- if ((unsigned HOST_WIDE_INT) total_high
- < (unsigned HOST_WIDE_INT) TREE_INT_CST_HIGH (size))
- return false;
- if ((unsigned HOST_WIDE_INT) total_high
- > (unsigned HOST_WIDE_INT) TREE_INT_CST_HIGH (size))
+ if (total_high != 0)
return true;
- return total_low > TREE_INT_CST_LOW (size);
+
+ size = int_size_in_bytes (TREE_TYPE (TREE_TYPE (base)));
+ if (size <= 0)
+ return true;
+
+ /* We can do slightly better for SIZE if we have an ADDR_EXPR of an
+ array. */
+ if (TREE_CODE (base) == ADDR_EXPR)
+ {
+ HOST_WIDE_INT base_size;
+
+ base_size = int_size_in_bytes (TREE_TYPE (TREE_OPERAND (base, 0)));
+ if (base_size > 0 && size < base_size)
+ size = base_size;
+ }
+
+ return total_low > (unsigned HOST_WIDE_INT) size;
}
/* Subroutine of fold_binary. This routine performs all of the
@@ -10153,6 +10154,17 @@ fold_binary (enum tree_code code, tree type, tree op0, tree op1)
return fold_build2 (LSHIFT_EXPR, type, op1,
TREE_OPERAND (arg0, 1));
+ /* (A + A) * C -> A * 2 * C */
+ if (TREE_CODE (arg0) == PLUS_EXPR
+ && TREE_CODE (arg1) == INTEGER_CST
+ && operand_equal_p (TREE_OPERAND (arg0, 0),
+ TREE_OPERAND (arg0, 1), 0))
+ return fold_build2 (MULT_EXPR, type,
+ omit_one_operand (type, TREE_OPERAND (arg0, 0),
+ TREE_OPERAND (arg0, 1)),
+ fold_build2 (MULT_EXPR, type,
+ build_int_cst (type, 2) , arg1));
+
strict_overflow_p = false;
if (TREE_CODE (arg1) == INTEGER_CST
&& 0 != (tem = extract_muldiv (op0, arg1, code, NULL_TREE,
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index 3808eb56ff5..de9c781ad3c 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,102 @@
+2008-05-03 Janus Weil <jaydub66@gmail.com>
+
+ * misc.c (gfc_clear_ts): Set interface to NULL.
+
+2008-05-03 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
+ PR fortran/33268
+ * gfortran.h: Add extra_comma pointer to gfc_dt structure. Add iokind to
+ gfc_expr value union. Add io_kind enum to here from io.c.
+ * io.c (gfc_free_dt): Free extra_comma.
+ (gfc_resolve_dt): If an extra comma was encountered and io_unit is type
+ BT_CHARACTER, resolve to format_expr and set default unit. Error if
+ io_kind is M_WRITE. (match_io): Match the extra comma and set new
+ pointer, extra_comma.
+
+2008-05-01 Bud Davis <bdavis9659@sbcglobal.net>
+
+ PR35940/Fortran
+ * simplify.c (gfc_simplify_index): Check for direction argument
+ being a constant.
+
+2008-05-01 Janus Weil <jaydub66@gmail.com>
+
+ * gfortran.h (struct gfc_symbol): Moving "interface" member to
+ gfc_typespec (plus fixing a small docu error).
+ * interface.c (gfc_procedure_use): Ditto.
+ * decl.c (match_procedure_decl): Ditto.
+ * resolve.c (resolve_specific_f0,
+ resolve_specific_f0, resolve_symbol): Ditto.
+
+2008-04-30 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
+
+ * intrinsic.c (add_functions): Add SELECTED_CHAR_KIND intrinsic.
+ * intrinsic.h (gfc_check_selected_char_kind,
+ gfc_simplify_selected_char_kind): New prototypes.
+ * gfortran.h (gfc_isym_id): Add GFC_ISYM_SC_KIND.
+ * trans.h (gfor_fndecl_sc_kind): New function decl.
+ * trans-decl.c (gfor_fndecl_sc_kind): Build new decl.
+ * arith.c (gfc_compare_with_Cstring): New function.
+ * arith.h (gfc_compare_with_Cstring): New prototype.
+ * check.c (gfc_check_selected_char_kind): New function.
+ * primary.c (match_string_constant, match_kind_param): Mark
+ symbols used as literal constant kind param as referenced.
+ * trans-intrinsic.c (gfc_conv_intrinsic_sc_kind): New function.
+ (gfc_conv_intrinsic_function): Call gfc_conv_intrinsic_sc_kind.
+ * intrinsic.texi (SELECTED_CHAR_KIND): Document new intrinsic.
+ * simplify.c (gfc_simplify_selected_char_kind): New function.
+
+2008-04-28 Paul Thomas <pault@gcc.gnu.org>
+
+ PR fortran/35997
+ * module.c (find_symbol): Do not return a result for a symbol
+ that has been renamed in another module.
+
+2008-04-26 George Helffrich <george@gcc.gnu.org>
+
+ PR fortran/35892
+ PR fortran/35154
+ * trans-common.c (create_common): Add decl to function
+ chain (if inside one) to preserve identifier scope in debug output.
+
+2008-04-25 Jan Hubicka <jh@suse.cz>
+
+ * trans-decl.c (trans_function_start): Update.
+
+2008-04-25 Tobias Burnus <burnus@net-b.de>
+ Daniel Franke <franke.daniel@gmail.com>
+
+ PR fortran/35156
+ * gfortranspec.c (lang_specific_driver): Deprecate
+ -M option; fix ICE when "-M" is last argument and
+ make "-M<dir>" work.
+ * options.c (gfc_handle_module_path_options):
+ Use -J instead of -M in error messages.
+ * invoke.texi: Mark -M as depecated.
+
+2008-04-23 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+ Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
+
+ PR fortran/35994
+ * trans-instrinsic.c (gfc_conv_intrinsic_minmaxloc): Correctly adjust
+ loop counter offset.
+
+2008-04-23 Paolo Bonzini <bonzini@gnu.org>
+
+ * trans-expr.c (gfc_conv_structure): Don't set TREE_INVARIANT.
+ * trans-array.c (gfc_build_null_descriptor): Don't set TREE_INVARIANT.
+ (gfc_trans_array_constructor_value): Don't set TREE_INVARIANT.
+ (gfc_build_constant_array_constructor): Don't set TREE_INVARIANT.
+ (gfc_conv_array_initializer): Don't set TREE_INVARIANT.
+ * trans-common.c (get_init_field): Don't set TREE_INVARIANT.
+ (create_common): Don't set TREE_INVARIANT.
+ * trans-stmt.c (gfc_trans_character_select): Don't set TREE_INVARIANT.
+ * trans-decl.c (gfc_generate_function_code): Don't set TREE_INVARIANT.
+
+2008-04-21 Steve Ellcey <sje@cup.hp.com>
+
+ * f95-lang.c (gfc_init_decl_processing): use ptr_mode instead of Pmode.
+
2008-04-21 Daniel Franke <franke.daniel@gmail.com>
PR fortran/35019
@@ -182,6 +281,7 @@
2008-04-01 George Helffrich <george@gcc.gnu.org>
+ PR fortran/35154, fortran/23057
* trans-common.c (create_common): Add decl to function
chain to preserve identifier scope in debug output.
diff --git a/gcc/fortran/arith.c b/gcc/fortran/arith.c
index fdd6f6a7d77..4b8d45b189b 100644
--- a/gcc/fortran/arith.c
+++ b/gcc/fortran/arith.c
@@ -1208,7 +1208,7 @@ gfc_compare_string (gfc_expr *a, gfc_expr *b)
alen = a->value.character.length;
blen = b->value.character.length;
- len = (alen > blen) ? alen : blen;
+ len = MAX(alen, blen);
for (i = 0; i < len; i++)
{
@@ -1224,7 +1224,40 @@ gfc_compare_string (gfc_expr *a, gfc_expr *b)
}
/* Strings are equal */
+ return 0;
+}
+
+
+int
+gfc_compare_with_Cstring (gfc_expr *a, const char *b, bool case_sensitive)
+{
+ int len, alen, blen, i, ac, bc;
+
+ alen = a->value.character.length;
+ blen = strlen (b);
+
+ len = MAX(alen, blen);
+
+ for (i = 0; i < len; i++)
+ {
+ /* We cast to unsigned char because default char, if it is signed,
+ would lead to ac < 0 for string[i] > 127. */
+ ac = (unsigned char) ((i < alen) ? a->value.character.string[i] : ' ');
+ bc = (unsigned char) ((i < blen) ? b[i] : ' ');
+ if (!case_sensitive)
+ {
+ ac = TOLOWER (ac);
+ bc = TOLOWER (bc);
+ }
+
+ if (ac < bc)
+ return -1;
+ if (ac > bc)
+ return 1;
+ }
+
+ /* Strings are equal */
return 0;
}
diff --git a/gcc/fortran/arith.h b/gcc/fortran/arith.h
index f370c1cbce8..e27186ae92f 100644
--- a/gcc/fortran/arith.h
+++ b/gcc/fortran/arith.h
@@ -40,6 +40,8 @@ arith gfc_range_check (gfc_expr *);
int gfc_compare_expr (gfc_expr *, gfc_expr *, gfc_intrinsic_op);
int gfc_compare_string (gfc_expr *, gfc_expr *);
+int gfc_compare_with_Cstring (gfc_expr *, const char *, bool);
+
/* Constant folding for gfc_expr trees. */
gfc_expr *gfc_parentheses (gfc_expr * op);
diff --git a/gcc/fortran/check.c b/gcc/fortran/check.c
index c02656ce669..5f782400dd3 100644
--- a/gcc/fortran/check.c
+++ b/gcc/fortran/check.c
@@ -2350,6 +2350,22 @@ gfc_check_secnds (gfc_expr *r)
try
+gfc_check_selected_char_kind (gfc_expr *name)
+{
+ if (type_check (name, 0, BT_CHARACTER) == FAILURE)
+ return FAILURE;
+
+ if (kind_value_check (name, 0, gfc_default_character_kind) == FAILURE)
+ return FAILURE;
+
+ if (scalar_check (name, 0) == FAILURE)
+ return FAILURE;
+
+ return SUCCESS;
+}
+
+
+try
gfc_check_selected_int_kind (gfc_expr *r)
{
if (type_check (r, 0, BT_INTEGER) == FAILURE)
diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c
index d6a5633a2f6..f52c2f1ec8f 100644
--- a/gcc/fortran/decl.c
+++ b/gcc/fortran/decl.c
@@ -4060,8 +4060,8 @@ match_procedure_decl (void)
/* Resolve interface if possible. That way, attr.procedure is only set
if it is declared by a later procedure-declaration-stmt, which is
invalid per C1212. */
- while (proc_if->interface)
- proc_if = proc_if->interface;
+ while (proc_if->ts.interface)
+ proc_if = proc_if->ts.interface;
if (proc_if->generic)
{
@@ -4147,16 +4147,16 @@ got_ts:
/* Set interface. */
if (proc_if != NULL)
{
- sym->interface = proc_if;
+ sym->ts.interface = proc_if;
sym->attr.untyped = 1;
}
else if (current_ts.type != BT_UNKNOWN)
{
- sym->interface = gfc_new_symbol ("", gfc_current_ns);
- sym->interface->ts = current_ts;
- sym->interface->attr.function = 1;
- sym->ts = sym->interface->ts;
- sym->attr.function = sym->interface->attr.function;
+ sym->ts = current_ts;
+ sym->ts.interface = gfc_new_symbol ("", gfc_current_ns);
+ sym->ts.interface->ts = current_ts;
+ sym->ts.interface->attr.function = 1;
+ sym->attr.function = sym->ts.interface->attr.function;
}
if (gfc_match_eos () == MATCH_YES)
diff --git a/gcc/fortran/f95-lang.c b/gcc/fortran/f95-lang.c
index 4d2e9783af7..58e31279156 100644
--- a/gcc/fortran/f95-lang.c
+++ b/gcc/fortran/f95-lang.c
@@ -563,9 +563,9 @@ gfc_init_decl_processing (void)
/* x86_64 minw32 has a sizetype of "unsigned long long", most other hosts
have a sizetype of "unsigned long". Therefore choose the correct size
in mostly target independent way. */
- if (TYPE_MODE (long_unsigned_type_node) == Pmode)
+ if (TYPE_MODE (long_unsigned_type_node) == ptr_mode)
set_sizetype (long_unsigned_type_node);
- else if (TYPE_MODE (long_long_unsigned_type_node) == Pmode)
+ else if (TYPE_MODE (long_long_unsigned_type_node) == ptr_mode)
set_sizetype (long_long_unsigned_type_node);
else
set_sizetype (long_unsigned_type_node);
diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h
index 6035f629f56..f6a7c54123b 100644
--- a/gcc/fortran/gfortran.h
+++ b/gcc/fortran/gfortran.h
@@ -103,6 +103,12 @@ mstring;
/*************************** Enums *****************************/
+/* Used when matching and resolving data I/O transfer statements. */
+
+typedef enum
+{ M_READ, M_WRITE, M_PRINT, M_INQUIRE }
+io_kind;
+
/* The author remains confused to this day about the convention of
returning '0' for 'SUCCESS'... or was it the other way around? The
following enum makes things much more readable. We also start
@@ -465,6 +471,7 @@ enum gfc_isym_id
GFC_ISYM_RESHAPE,
GFC_ISYM_RRSPACING,
GFC_ISYM_RSHIFT,
+ GFC_ISYM_SC_KIND,
GFC_ISYM_SCALE,
GFC_ISYM_SCAN,
GFC_ISYM_SECNDS,
@@ -777,6 +784,7 @@ typedef struct
int kind;
struct gfc_symbol *derived;
gfc_charlen *cl; /* For character types only. */
+ struct gfc_symbol *interface; /* For PROCEDURE declarations. */
int is_c_interop;
int is_iso_c;
bt f90_type;
@@ -979,7 +987,7 @@ typedef struct gfc_symbol
gfc_typespec ts;
symbol_attribute attr;
- /* The interface member points to the formal argument list if the
+ /* The formal member points to the formal argument list if the
symbol is a function or subroutine name. If the symbol is a
generic name, the generic member points to the list of
interfaces. */
@@ -995,8 +1003,6 @@ typedef struct gfc_symbol
struct gfc_symbol *result; /* function result symbol */
gfc_component *components; /* Derived type components */
- struct gfc_symbol *interface; /* For PROCEDURE declarations. */
-
/* Defined only for Cray pointees; points to their pointer. */
struct gfc_symbol *cp_pointer;
@@ -1444,6 +1450,8 @@ typedef struct gfc_expr
{
int logical;
+ io_kind iokind;
+
mpz_t integer;
mpfr_t real;
@@ -1684,7 +1692,7 @@ typedef struct
{
gfc_expr *io_unit, *format_expr, *rec, *advance, *iostat, *size, *iomsg,
*id, *pos, *asynchronous, *blank, *decimal, *delim, *pad, *round,
- *sign;
+ *sign, *extra_comma;
gfc_symbol *namelist;
/* A format_label of `format_asterisk' indicates the "*" format */
diff --git a/gcc/fortran/gfortranspec.c b/gcc/fortran/gfortranspec.c
index 5f3a8d79354..4a7d02f11eb 100644
--- a/gcc/fortran/gfortranspec.c
+++ b/gcc/fortran/gfortranspec.c
@@ -429,18 +429,27 @@ For more information about these matters, see the file named COPYING\n\n"));
{
char *p;
+ fprintf (stderr, _("Warning: Using -M <directory> is deprecated, "
+ "use -J instead\n"));
if (argv[i][2] == '\0')
{
- p = XNEWVEC (char, strlen (argv[i + 1]) + 2);
- p[0] = '-';
- p[1] = 'J';
- strcpy (&p[2], argv[i + 1]);
- i++;
+ if (i+1 < argc)
+ {
+ p = XNEWVEC (char, strlen (argv[i + 1]) + 3);
+ p[0] = '-';
+ p[1] = 'J';
+ strcpy (&p[2], argv[i + 1]);
+ i++;
+ }
+ else
+ fatal ("argument to '%s' missing", argv[i]);
}
else
{
p = XNEWVEC (char, strlen (argv[i]) + 1);
- strcpy (p, argv[i]);
+ p[0] = '-';
+ p[1] = 'J';
+ strcpy (&p[2], argv[i] + 2);
}
append_arg (p);
continue;
diff --git a/gcc/fortran/interface.c b/gcc/fortran/interface.c
index 09f72383b0f..f5746bf0a53 100644
--- a/gcc/fortran/interface.c
+++ b/gcc/fortran/interface.c
@@ -2405,13 +2405,13 @@ gfc_procedure_use (gfc_symbol *sym, gfc_actual_arglist **ap, locus *where)
gfc_warning ("Procedure '%s' called with an implicit interface at %L",
sym->name, where);
- if (sym->interface && sym->interface->attr.intrinsic)
+ if (sym->ts.interface && sym->ts.interface->attr.intrinsic)
{
gfc_intrinsic_sym *isym;
- isym = gfc_find_function (sym->interface->name);
+ isym = gfc_find_function (sym->ts.interface->name);
if (isym != NULL)
{
- if (compare_actual_formal_intr (ap, sym->interface))
+ if (compare_actual_formal_intr (ap, sym->ts.interface))
return;
gfc_error ("Type/rank mismatch in argument '%s' at %L",
sym->name, where);
diff --git a/gcc/fortran/intrinsic.c b/gcc/fortran/intrinsic.c
index 258123b92b5..441fbecdc17 100644
--- a/gcc/fortran/intrinsic.c
+++ b/gcc/fortran/intrinsic.c
@@ -2141,6 +2141,13 @@ add_functions (void)
make_generic ("secnds", GFC_ISYM_SECNDS, GFC_STD_GNU);
+ add_sym_1 ("selected_char_kind", GFC_ISYM_SC_KIND, CLASS_TRANSFORMATIONAL,
+ ACTUAL_NO, BT_INTEGER, di, GFC_STD_F2003,
+ gfc_check_selected_char_kind, gfc_simplify_selected_char_kind,
+ NULL, nm, BT_CHARACTER, dc, REQUIRED);
+
+ make_generic ("selected_char_kind", GFC_ISYM_SC_KIND, GFC_STD_F2003);
+
add_sym_1 ("selected_int_kind", GFC_ISYM_SI_KIND, CLASS_TRANSFORMATIONAL, ACTUAL_NO, BT_INTEGER, di,
GFC_STD_F95, gfc_check_selected_int_kind,
gfc_simplify_selected_int_kind, NULL, r, BT_INTEGER, di, REQUIRED);
diff --git a/gcc/fortran/intrinsic.h b/gcc/fortran/intrinsic.h
index dc91e77caaf..91645fbb1e5 100644
--- a/gcc/fortran/intrinsic.h
+++ b/gcc/fortran/intrinsic.h
@@ -120,6 +120,7 @@ try gfc_check_scale (gfc_expr *, gfc_expr *);
try gfc_check_scan (gfc_expr *, gfc_expr *, gfc_expr *, gfc_expr *);
try gfc_check_second_sub (gfc_expr *);
try gfc_check_secnds (gfc_expr *);
+try gfc_check_selected_char_kind (gfc_expr *);
try gfc_check_selected_int_kind (gfc_expr *);
try gfc_check_selected_real_kind (gfc_expr *, gfc_expr *);
try gfc_check_set_exponent (gfc_expr *, gfc_expr *);
@@ -287,6 +288,7 @@ gfc_expr *gfc_simplify_reshape (gfc_expr *, gfc_expr *, gfc_expr *,
gfc_expr *gfc_simplify_rrspacing (gfc_expr *);
gfc_expr *gfc_simplify_scale (gfc_expr *, gfc_expr *);
gfc_expr *gfc_simplify_scan (gfc_expr *, gfc_expr *, gfc_expr *, gfc_expr *);
+gfc_expr *gfc_simplify_selected_char_kind (gfc_expr *);
gfc_expr *gfc_simplify_selected_int_kind (gfc_expr *);
gfc_expr *gfc_simplify_selected_real_kind (gfc_expr *, gfc_expr *);
gfc_expr *gfc_simplify_set_exponent (gfc_expr *, gfc_expr *);
diff --git a/gcc/fortran/intrinsic.texi b/gcc/fortran/intrinsic.texi
index c2630b249be..9d3553da111 100644
--- a/gcc/fortran/intrinsic.texi
+++ b/gcc/fortran/intrinsic.texi
@@ -225,6 +225,7 @@ Some basic guidelines for editing this document:
* @code{SCAN}: SCAN, Scan a string for the presence of a set of characters
* @code{SECNDS}: SECNDS, Time function
* @code{SECOND}: SECOND, CPU time function
+* @code{SELECTED_CHAR_KIND}: SELECTED_CHAR_KIND, Choose character kind
* @code{SELECTED_INT_KIND}: SELECTED_INT_KIND, Choose integer kind
* @code{SELECTED_REAL_KIND}: SELECTED_REAL_KIND, Choose real kind
* @code{SET_EXPONENT}: SET_EXPONENT, Set the exponent of the model
@@ -9256,6 +9257,48 @@ seconds.
+@node SELECTED_CHAR_KIND
+@section @code{SELECTED_CHAR_KIND} --- Choose character kind
+@fnindex SELECTED_CHAR_KIND
+@cindex character kind
+@cindex kind, character
+
+@table @asis
+@item @emph{Description}:
+
+@code{SELECTED_CHAR_KIND(NAME)} returns the kind value for the character
+set named @var{NAME}, if a character set with such a name is supported,
+or @math{-1} otherwise. Currently, supported character sets include
+``ASCII'' and ``DEFAULT'', which are equivalent.
+
+@item @emph{Standard}:
+Fortran 2003 and later
+
+@item @emph{Class}:
+Transformational function
+
+@item @emph{Syntax}:
+@code{RESULT = SELECTED_CHAR_KIND(NAME)}
+
+@item @emph{Arguments}:
+@multitable @columnfractions .15 .70
+@item @var{NAME} @tab Shall be a scalar and of the default character type.
+@end multitable
+
+@item @emph{Example}:
+@smallexample
+program ascii_kind
+ integer,parameter :: ascii = selected_char_kind("ascii")
+ character(kind=ascii, len=26) :: s
+
+ s = ascii_"abcdefghijklmnopqrstuvwxyz"
+ print *, s
+end program ascii_kind
+@end smallexample
+@end table
+
+
+
@node SELECTED_INT_KIND
@section @code{SELECTED_INT_KIND} --- Choose integer kind
@fnindex SELECTED_INT_KIND
diff --git a/gcc/fortran/invoke.texi b/gcc/fortran/invoke.texi
index 2bac12c7962..712aa2140c3 100644
--- a/gcc/fortran/invoke.texi
+++ b/gcc/fortran/invoke.texi
@@ -633,10 +633,10 @@ compiled modules are required by a @code{USE} statement.
gcc,Using the GNU Compiler Collection (GCC)}, for information on the
@option{-I} option.
-@item -M@var{dir}
@item -J@var{dir}
-@opindex @code{M}@var{dir}
+@item -M@var{dir}
@opindex @code{J}@var{dir}
+@opindex @code{M}@var{dir}
@cindex paths, search
@cindex module search path
This option specifies where to put @file{.mod} files for compiled modules.
@@ -645,8 +645,7 @@ statement.
The default is the current directory.
-@option{-J} is an alias for @option{-M} to avoid conflicts with existing
-GCC options.
+@option{-M} is deprecated to avoid conflicts with existing GCC options.
@item -fintrinsic-modules-path @var{dir}
@opindex @code{fintrinsic-modules-path} @var{dir}
diff --git a/gcc/fortran/io.c b/gcc/fortran/io.c
index 11907a72a89..4eb76309ede 100644
--- a/gcc/fortran/io.c
+++ b/gcc/fortran/io.c
@@ -2143,11 +2143,6 @@ gfc_match_flush (void)
/******************** Data Transfer Statements *********************/
-typedef enum
-{ M_READ, M_WRITE, M_PRINT, M_INQUIRE }
-io_kind;
-
-
/* Return a default unit number. */
static gfc_expr *
@@ -2421,6 +2416,7 @@ gfc_free_dt (gfc_dt *dt)
gfc_free_expr (dt->round);
gfc_free_expr (dt->blank);
gfc_free_expr (dt->decimal);
+ gfc_free_expr (dt->extra_comma);
gfc_free (dt);
}
@@ -2451,9 +2447,40 @@ gfc_resolve_dt (gfc_dt *dt)
&& (e->ts.type != BT_INTEGER
&& (e->ts.type != BT_CHARACTER || e->expr_type != EXPR_VARIABLE)))
{
- gfc_error ("UNIT specification at %L must be an INTEGER expression "
- "or a CHARACTER variable", &e->where);
- return FAILURE;
+ /* If there is no extra comma signifying the "format" form of the IO
+ statement, then this must be an error. */
+ if (!dt->extra_comma)
+ {
+ gfc_error ("UNIT specification at %L must be an INTEGER expression "
+ "or a CHARACTER variable", &e->where);
+ return FAILURE;
+ }
+ else
+ {
+ /* At this point, we have an extra comma. If io_unit has arrived as
+ type chracter, we assume its really the "format" form of the I/O
+ statement. We set the io_unit to the default unit and format to
+ the chracter expression. See F95 Standard section 9.4. */
+ io_kind k;
+ k = dt->extra_comma->value.iokind;
+ if (e->ts.type == BT_CHARACTER && (k == M_READ || k == M_PRINT))
+ {
+ dt->format_expr = dt->io_unit;
+ dt->io_unit = default_unit (k);
+
+ /* Free this pointer now so that a warning/error is not triggered
+ below for the "Extension". */
+ gfc_free_expr (dt->extra_comma);
+ dt->extra_comma = NULL;
+ }
+
+ if (k == M_WRITE)
+ {
+ gfc_error ("Invalid form of WRITE statement at %L, UNIT required",
+ &dt->extra_comma->where);
+ return FAILURE;
+ }
+ }
}
if (e->ts.type == BT_CHARACTER)
@@ -2471,6 +2498,11 @@ gfc_resolve_dt (gfc_dt *dt)
return FAILURE;
}
+ if (dt->extra_comma
+ && gfc_notify_std (GFC_STD_GNU, "Extension: Comma before i/o "
+ "item list at %L", &dt->extra_comma->where) == FAILURE)
+ return FAILURE;
+
if (dt->err)
{
if (gfc_reference_st_label (dt->err, ST_LABEL_TARGET) == FAILURE)
@@ -3306,12 +3338,23 @@ get_io_list:
/* Used in check_io_constraints, where no locus is available. */
spec_end = gfc_current_locus;
- /* Optional leading comma (non-standard). */
- if (!comma_flag
- && gfc_match_char (',') == MATCH_YES
- && gfc_notify_std (GFC_STD_GNU, "Extension: Comma before i/o "
- "item list at %C") == FAILURE)
- return MATCH_ERROR;
+ /* Optional leading comma (non-standard). We use a gfc_expr structure here
+ to save the locus. This is used later when resolving transfer statements
+ that might have a format expression without unit number. */
+ if (!comma_flag && gfc_match_char (',') == MATCH_YES)
+ {
+ dt->extra_comma = gfc_get_expr ();
+
+ /* Set the types to something compatible with iokind. This is needed to
+ get through gfc_free_expr later since iokind really has no Basic Type,
+ BT, of its own. */
+ dt->extra_comma->expr_type = EXPR_CONSTANT;
+ dt->extra_comma->ts.type = BT_LOGICAL;
+
+ /* Save the iokind and locus for later use in resolution. */
+ dt->extra_comma->value.iokind = k;
+ dt->extra_comma->where = gfc_current_locus;
+ }
io_code = NULL;
if (gfc_match_eos () != MATCH_YES)
diff --git a/gcc/fortran/misc.c b/gcc/fortran/misc.c
index 0d76926b267..136b751a196 100644
--- a/gcc/fortran/misc.c
+++ b/gcc/fortran/misc.c
@@ -77,6 +77,7 @@ gfc_clear_ts (gfc_typespec *ts)
ts->derived = NULL;
ts->kind = 0;
ts->cl = NULL;
+ ts->interface = NULL;
/* flag that says if the type is C interoperable */
ts->is_c_interop = 0;
/* says what f90 type the C kind interops with */
diff --git a/gcc/fortran/module.c b/gcc/fortran/module.c
index bc45e9eb9c1..832f68698b4 100644
--- a/gcc/fortran/module.c
+++ b/gcc/fortran/module.c
@@ -3146,13 +3146,14 @@ find_symtree_for_symbol (gfc_symtree *st, gfc_symbol *sym)
/* A recursive function to look for a speficic symbol by name and by
module. Whilst several symtrees might point to one symbol, its
is sufficient for the purposes here than one exist. Note that
- generic interfaces are distinguished. */
+ generic interfaces are distinguished as are symbols that have been
+ renamed in another module. */
static gfc_symtree *
find_symbol (gfc_symtree *st, const char *name,
const char *module, int generic)
{
int c;
- gfc_symtree *retval;
+ gfc_symtree *retval, *s;
if (st == NULL || st->n.sym == NULL)
return NULL;
@@ -3162,8 +3163,14 @@ find_symbol (gfc_symtree *st, const char *name,
&& strcmp (module, st->n.sym->module) == 0
&& !check_unique_name (st->name))
{
- if ((!generic && !st->n.sym->attr.generic)
- || (generic && st->n.sym->attr.generic))
+ s = gfc_find_symtree (gfc_current_ns->sym_root, name);
+
+ /* Detect symbols that are renamed by use association in another
+ module by the absence of a symtree and null attr.use_rename,
+ since the latter is not transmitted in the module file. */
+ if (((!generic && !st->n.sym->attr.generic)
+ || (generic && st->n.sym->attr.generic))
+ && !(s == NULL && !st->n.sym->attr.use_rename))
return st;
}
diff --git a/gcc/fortran/options.c b/gcc/fortran/options.c
index 06a462205b4..a1020bf35d4 100644
--- a/gcc/fortran/options.c
+++ b/gcc/fortran/options.c
@@ -391,10 +391,7 @@ gfc_handle_module_path_options (const char *arg)
{
if (gfc_option.module_dir != NULL)
- gfc_fatal_error ("gfortran: Only one -M option allowed");
-
- if (arg == NULL)
- gfc_fatal_error ("gfortran: Directory required after -M");
+ gfc_fatal_error ("gfortran: Only one -J option allowed");
gfc_option.module_dir = (char *) gfc_getmem (strlen (arg) + 2);
strcpy (gfc_option.module_dir, arg);
@@ -718,14 +715,13 @@ gfc_handle_option (size_t scode, const char *arg, int value)
break;
case OPT_J:
- case OPT_M:
gfc_handle_module_path_options (arg);
break;
-
+
case OPT_fsign_zero:
gfc_option.flag_sign_zero = value;
break;
-
+
case OPT_ffpe_trap_:
gfc_handle_fpe_trap_option (arg);
break;
diff --git a/gcc/fortran/primary.c b/gcc/fortran/primary.c
index 8f85873ce03..6b7fd519d6a 100644
--- a/gcc/fortran/primary.c
+++ b/gcc/fortran/primary.c
@@ -60,6 +60,8 @@ match_kind_param (int *kind)
if (p != NULL)
return MATCH_NO;
+ gfc_set_sym_referenced (sym);
+
if (*kind < 0)
return MATCH_NO;
@@ -907,6 +909,7 @@ match_string_constant (gfc_expr **result)
gfc_error (q);
return MATCH_ERROR;
}
+ gfc_set_sym_referenced (sym);
}
if (gfc_validate_kind (BT_CHARACTER, kind, true) < 0)
diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c
index 65d1a162cac..424420583ed 100644
--- a/gcc/fortran/resolve.c
+++ b/gcc/fortran/resolve.c
@@ -1563,10 +1563,10 @@ resolve_specific_f0 (gfc_symbol *sym, gfc_expr *expr)
/* See if we have an intrinsic interface. */
- if (sym->interface != NULL && sym->interface->attr.intrinsic)
+ if (sym->ts.interface != NULL && sym->ts.interface->attr.intrinsic)
{
gfc_intrinsic_sym *isym;
- isym = gfc_find_function (sym->interface->name);
+ isym = gfc_find_function (sym->ts.interface->name);
/* Existance of isym should be checked already. */
gcc_assert (isym);
@@ -2636,12 +2636,12 @@ resolve_specific_s0 (gfc_code *c, gfc_symbol *sym)
match m;
/* See if we have an intrinsic interface. */
- if (sym->interface != NULL && !sym->interface->attr.abstract
- && !sym->interface->attr.subroutine)
+ if (sym->ts.interface != NULL && !sym->ts.interface->attr.abstract
+ && !sym->ts.interface->attr.subroutine)
{
gfc_intrinsic_sym *isym;
- isym = gfc_find_function (sym->interface->name);
+ isym = gfc_find_function (sym->ts.interface->name);
/* Existance of isym should be checked already. */
gcc_assert (isym);
@@ -7735,26 +7735,27 @@ resolve_symbol (gfc_symbol *sym)
}
}
- if (sym->attr.procedure && sym->interface
+ if (sym->attr.procedure && sym->ts.interface
&& sym->attr.if_source != IFSRC_DECL)
{
- if (sym->interface->attr.procedure)
+ if (sym->ts.interface->attr.procedure)
gfc_error ("Interface '%s', used by procedure '%s' at %L, is declared "
- "in a later PROCEDURE statement", sym->interface->name,
+ "in a later PROCEDURE statement", sym->ts.interface->name,
sym->name,&sym->declared_at);
/* Get the attributes from the interface (now resolved). */
- if (sym->interface->attr.if_source || sym->interface->attr.intrinsic)
+ if (sym->ts.interface->attr.if_source || sym->ts.interface->attr.intrinsic)
{
- sym->ts = sym->interface->ts;
- sym->attr.function = sym->interface->attr.function;
- sym->attr.subroutine = sym->interface->attr.subroutine;
- copy_formal_args (sym, sym->interface);
+ sym->ts.type = sym->ts.interface->ts.type;
+ sym->ts.kind = sym->ts.interface->ts.kind;
+ sym->attr.function = sym->ts.interface->attr.function;
+ sym->attr.subroutine = sym->ts.interface->attr.subroutine;
+ copy_formal_args (sym, sym->ts.interface);
}
- else if (sym->interface->name[0] != '\0')
+ else if (sym->ts.interface->name[0] != '\0')
{
gfc_error ("Interface '%s' of procedure '%s' at %L must be explicit",
- sym->interface->name, sym->name, &sym->declared_at);
+ sym->ts.interface->name, sym->name, &sym->declared_at);
return;
}
}
diff --git a/gcc/fortran/simplify.c b/gcc/fortran/simplify.c
index 2272bb567b5..cde4770a1ec 100644
--- a/gcc/fortran/simplify.c
+++ b/gcc/fortran/simplify.c
@@ -1570,7 +1570,8 @@ gfc_simplify_index (gfc_expr *x, gfc_expr *y, gfc_expr *b, gfc_expr *kind)
int back, len, lensub;
int i, j, k, count, index = 0, start;
- if (x->expr_type != EXPR_CONSTANT || y->expr_type != EXPR_CONSTANT)
+ if (x->expr_type != EXPR_CONSTANT || y->expr_type != EXPR_CONSTANT
+ || ( b != NULL && b->expr_type != EXPR_CONSTANT))
return NULL;
if (b != NULL && b->value.logical != 0)
@@ -3629,6 +3630,28 @@ gfc_simplify_scan (gfc_expr *e, gfc_expr *c, gfc_expr *b, gfc_expr *kind)
gfc_expr *
+gfc_simplify_selected_char_kind (gfc_expr *e)
+{
+ int kind;
+ gfc_expr *result;
+
+ if (e->expr_type != EXPR_CONSTANT)
+ return NULL;
+
+ if (gfc_compare_with_Cstring (e, "ascii", false) == 0
+ || gfc_compare_with_Cstring (e, "default", false) == 0)
+ kind = 1;
+ else
+ kind = -1;
+
+ result = gfc_int_expr (kind);
+ result->where = e->where;
+
+ return result;
+}
+
+
+gfc_expr *
gfc_simplify_selected_int_kind (gfc_expr *e)
{
int i, kind, range;
diff --git a/gcc/fortran/trans-array.c b/gcc/fortran/trans-array.c
index 7bac68dd650..5fc56883bc9 100644
--- a/gcc/fortran/trans-array.c
+++ b/gcc/fortran/trans-array.c
@@ -316,7 +316,6 @@ gfc_build_null_descriptor (tree type)
/* Set a NULL data pointer. */
tmp = build_constructor_single (type, field, null_pointer_node);
TREE_CONSTANT (tmp) = 1;
- TREE_INVARIANT (tmp) = 1;
/* All other fields are ignored. */
return tmp;
@@ -1207,13 +1206,11 @@ gfc_trans_array_constructor_value (stmtblock_t * pblock, tree type,
init = build_constructor_from_list (tmptype, nreverse (list));
TREE_CONSTANT (init) = 1;
- TREE_INVARIANT (init) = 1;
TREE_STATIC (init) = 1;
/* Create a static variable to hold the data. */
tmp = gfc_create_var (tmptype, "data");
TREE_STATIC (tmp) = 1;
TREE_CONSTANT (tmp) = 1;
- TREE_INVARIANT (tmp) = 1;
TREE_READONLY (tmp) = 1;
DECL_INITIAL (tmp) = init;
init = tmp;
@@ -1582,13 +1579,11 @@ gfc_build_constant_array_constructor (gfc_expr * expr, tree type)
init = build_constructor_from_list (tmptype, nreverse (list));
TREE_CONSTANT (init) = 1;
- TREE_INVARIANT (init) = 1;
TREE_STATIC (init) = 1;
tmp = gfc_create_var (tmptype, "A");
TREE_STATIC (tmp) = 1;
TREE_CONSTANT (tmp) = 1;
- TREE_INVARIANT (tmp) = 1;
TREE_READONLY (tmp) = 1;
DECL_INITIAL (tmp) = init;
@@ -3911,7 +3906,6 @@ gfc_conv_array_initializer (tree type, gfc_expr * expr)
/* Create a constructor from the list of elements. */
tmp = build_constructor (type, v);
TREE_CONSTANT (tmp) = 1;
- TREE_INVARIANT (tmp) = 1;
return tmp;
}
diff --git a/gcc/fortran/trans-common.c b/gcc/fortran/trans-common.c
index d7e3e645965..5c91bf57946 100644
--- a/gcc/fortran/trans-common.c
+++ b/gcc/fortran/trans-common.c
@@ -547,7 +547,6 @@ get_init_field (segment_info *head, tree union_type, tree *field_init,
init = build_constructor (TREE_TYPE (field), v);
TREE_CONSTANT (init) = 1;
- TREE_INVARIANT (init) = 1;
*field_init = init;
@@ -657,7 +656,6 @@ create_common (gfc_common_head *com, segment_info *head, bool saw_equiv)
gcc_assert (!VEC_empty (constructor_elt, v));
ctor = build_constructor (union_type, v);
TREE_CONSTANT (ctor) = 1;
- TREE_INVARIANT (ctor) = 1;
TREE_STATIC (ctor) = 1;
DECL_INITIAL (decl) = ctor;
@@ -687,10 +685,14 @@ create_common (gfc_common_head *com, segment_info *head, bool saw_equiv)
/* This is a fake variable just for debugging purposes. */
TREE_ASM_WRITTEN (var_decl) = 1;
- if (com)
+ /* To preserve identifier names in COMMON, chain to procedure
+ scope unless at top level in a module definition. */
+ if (com
+ && s->sym->ns->proc_name
+ && s->sym->ns->proc_name->attr.flavor == FL_MODULE)
var_decl = pushdecl_top_level (var_decl);
else
- gfc_add_decl_to_function (var_decl);
+ gfc_add_decl_to_function (var_decl);
SET_DECL_VALUE_EXPR (var_decl,
fold_build3 (COMPONENT_REF, TREE_TYPE (s->field),
diff --git a/gcc/fortran/trans-decl.c b/gcc/fortran/trans-decl.c
index e693f729ba4..d204579c75f 100644
--- a/gcc/fortran/trans-decl.c
+++ b/gcc/fortran/trans-decl.c
@@ -124,7 +124,8 @@ tree gfor_fndecl_size0;
tree gfor_fndecl_size1;
tree gfor_fndecl_iargc;
-/* Intrinsic functions implemented in FORTRAN. */
+/* Intrinsic functions implemented in Fortran. */
+tree gfor_fndecl_sc_kind;
tree gfor_fndecl_si_kind;
tree gfor_fndecl_sr_kind;
@@ -1601,7 +1602,7 @@ trans_function_start (gfc_symbol * sym)
call expand_expr to calculate the size of a variable-sized array.
We haven't necessarily assigned RTL to all variables yet, so it's
not safe to try to expand expressions involving them. */
- cfun->x_dont_save_pending_sizes_p = 1;
+ cfun->dont_save_pending_sizes_p = 1;
/* function.c requires a push at the start of the function. */
pushlevel (0);
@@ -2099,19 +2100,22 @@ gfc_build_intrinsic_function_decls (void)
pchar_type_node,
gfc_charlen_type_node, pchar_type_node);
+ gfor_fndecl_sc_kind =
+ gfc_build_library_function_decl (get_identifier
+ (PREFIX("selected_char_kind")),
+ gfc_int4_type_node, 2,
+ gfc_charlen_type_node, pchar_type_node);
+
gfor_fndecl_si_kind =
gfc_build_library_function_decl (get_identifier
(PREFIX("selected_int_kind")),
- gfc_int4_type_node,
- 1,
- pvoid_type_node);
+ gfc_int4_type_node, 1, pvoid_type_node);
gfor_fndecl_sr_kind =
gfc_build_library_function_decl (get_identifier
(PREFIX("selected_real_kind")),
- gfc_int4_type_node,
- 2, pvoid_type_node,
- pvoid_type_node);
+ gfc_int4_type_node, 2,
+ pvoid_type_node, pvoid_type_node);
/* Power functions. */
{
@@ -3183,13 +3187,11 @@ gfc_generate_function_code (gfc_namespace * ns)
6)));
array = build_constructor_from_list (array_type, nreverse (array));
TREE_CONSTANT (array) = 1;
- TREE_INVARIANT (array) = 1;
TREE_STATIC (array) = 1;
/* Create a static variable to hold the jump table. */
var = gfc_create_var (array_type, "options");
TREE_CONSTANT (var) = 1;
- TREE_INVARIANT (var) = 1;
TREE_STATIC (var) = 1;
TREE_READONLY (var) = 1;
DECL_INITIAL (var) = array;
diff --git a/gcc/fortran/trans-expr.c b/gcc/fortran/trans-expr.c
index 01672470331..aae1d72fe1f 100644
--- a/gcc/fortran/trans-expr.c
+++ b/gcc/fortran/trans-expr.c
@@ -3478,10 +3478,7 @@ gfc_conv_structure (gfc_se * se, gfc_expr * expr, int init)
}
se->expr = build_constructor (type, v);
if (init)
- {
- TREE_CONSTANT(se->expr) = 1;
- TREE_INVARIANT(se->expr) = 1;
- }
+ TREE_CONSTANT (se->expr) = 1;
}
diff --git a/gcc/fortran/trans-intrinsic.c b/gcc/fortran/trans-intrinsic.c
index e832b8a30e9..9f022e7a09d 100644
--- a/gcc/fortran/trans-intrinsic.c
+++ b/gcc/fortran/trans-intrinsic.c
@@ -2171,11 +2171,12 @@ gfc_conv_intrinsic_minmaxloc (gfc_se * se, gfc_expr * expr, int op)
/* Remember where we are. An offset must be added to the loop
counter to obtain the required position. */
- if (loop.temp_dim)
- tmp = build_int_cst (gfc_array_index_type, 1);
+ if (loop.from[0])
+ tmp = fold_build2 (MINUS_EXPR, gfc_array_index_type,
+ gfc_index_one_node, loop.from[0]);
else
- tmp =fold_build2 (MINUS_EXPR, gfc_array_index_type,
- gfc_index_one_node, loop.from[0]);
+ tmp = build_int_cst (gfc_array_index_type, 1);
+
gfc_add_modify_expr (&block, offset, tmp);
tmp = fold_build2 (PLUS_EXPR, TREE_TYPE (pos),
@@ -3735,6 +3736,19 @@ gfc_conv_associated (gfc_se *se, gfc_expr *expr)
}
+/* Generate code for SELECTED_CHAR_KIND (NAME) intrinsic function. */
+
+static void
+gfc_conv_intrinsic_sc_kind (gfc_se *se, gfc_expr *expr)
+{
+ tree args[2];
+
+ gfc_conv_intrinsic_function_args (se, expr, args, 2);
+ se->expr = build_call_expr (gfor_fndecl_sc_kind, 2, args[0], args[1]);
+ se->expr = fold_convert (gfc_typenode_for_spec (&expr->ts), se->expr);
+}
+
+
/* Generate code for SELECTED_INT_KIND (R) intrinsic function. */
static void
@@ -4048,6 +4062,10 @@ gfc_conv_intrinsic_function (gfc_se * se, gfc_expr * expr)
gfc_conv_intrinsic_trim (se, expr);
break;
+ case GFC_ISYM_SC_KIND:
+ gfc_conv_intrinsic_sc_kind (se, expr);
+ break;
+
case GFC_ISYM_SI_KIND:
gfc_conv_intrinsic_si_kind (se, expr);
break;
diff --git a/gcc/fortran/trans-stmt.c b/gcc/fortran/trans-stmt.c
index e3f4cd456e8..5660ae61811 100644
--- a/gcc/fortran/trans-stmt.c
+++ b/gcc/fortran/trans-stmt.c
@@ -1435,12 +1435,10 @@ gfc_trans_character_select (gfc_code *code)
init = build_constructor_from_list (type, nreverse(init));
TREE_CONSTANT (init) = 1;
- TREE_INVARIANT (init) = 1;
TREE_STATIC (init) = 1;
/* Create a static variable to hold the jump table. */
tmp = gfc_create_var (type, "jumptable");
TREE_CONSTANT (tmp) = 1;
- TREE_INVARIANT (tmp) = 1;
TREE_STATIC (tmp) = 1;
TREE_READONLY (tmp) = 1;
DECL_INITIAL (tmp) = init;
diff --git a/gcc/fortran/trans.h b/gcc/fortran/trans.h
index 1dfb0a59dab..3e812a89028 100644
--- a/gcc/fortran/trans.h
+++ b/gcc/fortran/trans.h
@@ -556,7 +556,8 @@ extern GTY(()) tree gfor_fndecl_size0;
extern GTY(()) tree gfor_fndecl_size1;
extern GTY(()) tree gfor_fndecl_iargc;
-/* Implemented in FORTRAN. */
+/* Implemented in Fortran. */
+extern GTY(()) tree gfor_fndecl_sc_kind;
extern GTY(()) tree gfor_fndecl_si_kind;
extern GTY(()) tree gfor_fndecl_sr_kind;
diff --git a/gcc/function.c b/gcc/function.c
index c804c5e32f0..5d70ddd3f9f 100644
--- a/gcc/function.c
+++ b/gcc/function.c
@@ -1969,7 +1969,7 @@ assign_parms_augmented_arg_list (struct assign_parm_data_all *all)
/* If struct value address is treated as the first argument, make it so. */
if (aggregate_value_p (DECL_RESULT (fndecl), fndecl)
- && ! current_function_returns_pcc_struct
+ && ! cfun->returns_pcc_struct
&& targetm.calls.struct_value_rtx (TREE_TYPE (fndecl), 1) == 0)
{
tree type = build_pointer_type (TREE_TYPE (fntype));
@@ -2008,7 +2008,7 @@ assign_parm_find_data_types (struct assign_parm_data_all *all, tree parm,
memset (data, 0, sizeof (*data));
/* NAMED_ARG is a mis-nomer. We really mean 'non-varadic'. */
- if (!current_function_stdarg)
+ if (!cfun->stdarg)
data->named_arg = 1; /* No varadic parms. */
else if (TREE_CHAIN (parm))
data->named_arg = 1; /* Not the last non-varadic parm. */
@@ -2967,7 +2967,7 @@ assign_parms (tree fndecl)
continue;
}
- if (current_function_stdarg && !TREE_CHAIN (parm))
+ if (cfun->stdarg && !TREE_CHAIN (parm))
assign_parms_setup_varargs (&all, &data, false);
/* Find out where the parameter arrives in this function. */
@@ -3859,12 +3859,12 @@ allocate_struct_function (tree fndecl, bool abstract_p)
if (!abstract_p && aggregate_value_p (result, fndecl))
{
#ifdef PCC_STATIC_STRUCT_RETURN
- current_function_returns_pcc_struct = 1;
+ cfun->returns_pcc_struct = 1;
#endif
- current_function_returns_struct = 1;
+ cfun->returns_struct = 1;
}
- current_function_stdarg
+ cfun->stdarg
= (fntype
&& TYPE_ARG_TYPES (fntype) != 0
&& (TREE_VALUE (tree_last (TYPE_ARG_TYPES (fntype)))
@@ -4103,11 +4103,11 @@ expand_function_start (tree subr)
valid operands of arithmetic insns. */
init_recog_no_volatile ();
- current_function_profile
+ crtl->profile
= (profile_flag
&& ! DECL_NO_INSTRUMENT_FUNCTION_ENTRY_EXIT (subr));
- current_function_limit_stack
+ crtl->limit_stack
= (stack_limit_rtx != NULL_RTX && ! DECL_NO_LIMIT_STACK (subr));
/* Make the label for return statements to jump to. Do not special
@@ -4126,7 +4126,7 @@ expand_function_start (tree subr)
rtx value_address = 0;
#ifdef PCC_STATIC_STRUCT_RETURN
- if (current_function_returns_pcc_struct)
+ if (cfun->returns_pcc_struct)
{
int size = int_size_in_bytes (TREE_TYPE (DECL_RESULT (subr)));
value_address = assemble_static_space (size);
@@ -4244,7 +4244,7 @@ expand_function_start (tree subr)
parm_birth_insn = get_last_insn ();
- if (current_function_profile)
+ if (crtl->profile)
{
#ifdef PROFILE_HOOK
PROFILE_HOOK (current_function_funcdef_no);
@@ -4366,7 +4366,7 @@ expand_function_end (void)
/* If arg_pointer_save_area was referenced only from a nested
function, we will not have initialized it yet. Do that now. */
- if (arg_pointer_save_area && ! cfun->arg_pointer_save_area_init)
+ if (arg_pointer_save_area && ! crtl->arg_pointer_save_area_init)
get_arg_pointer_save_area ();
/* If we are doing stack checking and this function makes calls,
@@ -4523,9 +4523,9 @@ expand_function_end (void)
If returning a structure PCC style,
the caller also depends on this value.
- And current_function_returns_pcc_struct is not necessarily set. */
- if (current_function_returns_struct
- || current_function_returns_pcc_struct)
+ And cfun->returns_pcc_struct is not necessarily set. */
+ if (cfun->returns_struct
+ || cfun->returns_pcc_struct)
{
rtx value_address = DECL_RTL (DECL_RESULT (current_function_decl));
tree type = TREE_TYPE (DECL_RESULT (current_function_decl));
@@ -4584,7 +4584,7 @@ expand_function_end (void)
an accurate stack pointer to exit the function,
insert some code to save and restore the stack pointer. */
if (! EXIT_IGNORE_STACK
- && current_function_calls_alloca)
+ && cfun->calls_alloca)
{
rtx tem = 0;
@@ -4610,7 +4610,7 @@ get_arg_pointer_save_area (void)
arg_pointer_save_area = ret;
}
- if (! cfun->arg_pointer_save_area_init)
+ if (! crtl->arg_pointer_save_area_init)
{
rtx seq;
@@ -4737,7 +4737,7 @@ thread_prologue_and_epilogue_insns (void)
/* Insert an explicit USE for the frame pointer
if the profiling is on and the frame pointer is required. */
- if (current_function_profile && frame_pointer_needed)
+ if (crtl->profile && frame_pointer_needed)
emit_insn (gen_rtx_USE (VOIDmode, hard_frame_pointer_rtx));
/* Retain a map of the prologue insns. */
@@ -4748,7 +4748,7 @@ thread_prologue_and_epilogue_insns (void)
/* Ensure that instructions are not moved into the prologue when
profiling is on. The call to the profiling routine can be
emitted within the live range of a call-clobbered register. */
- if (current_function_profile)
+ if (crtl->profile)
emit_insn (gen_blockage ());
#endif
@@ -5343,7 +5343,7 @@ rest_of_match_asm_constraints (void)
rtx insn, pat, *p_sets;
int noutputs;
- if (!cfun->has_asm_statement)
+ if (!crtl->has_asm_statement)
return 0;
df_set_flags (DF_DEFER_INSN_RESCAN);
diff --git a/gcc/function.h b/gcc/function.h
index e98ffff88e7..fcfd3b65f43 100644
--- a/gcc/function.h
+++ b/gcc/function.h
@@ -179,6 +179,11 @@ struct call_site_record;
DEF_VEC_P(temp_slot_p);
DEF_VEC_ALLOC_P(temp_slot_p,gc);
+struct ipa_opt_pass;
+typedef struct ipa_opt_pass *ipa_opt_pass;
+
+DEF_VEC_P(ipa_opt_pass);
+DEF_VEC_ALLOC_P(ipa_opt_pass,heap);
enum function_frequency {
/* This function most likely won't be executed at all.
@@ -334,6 +339,59 @@ struct rtl_data GTY(())
/* If some insns can be deferred to the delay slots of the epilogue, the
delay list for them is recorded here. */
rtx epilogue_delay_list;
+
+ /* Nonzero if function being compiled called builtin_return_addr or
+ builtin_frame_address with nonzero count. */
+ bool accesses_prior_frames;
+
+ /* Nonzero if the function calls __builtin_eh_return. */
+ bool calls_eh_return;
+
+ /* Nonzero if function saves all registers, e.g. if it has a nonlocal
+ label that can reach the exit block via non-exceptional paths. */
+ bool saves_all_registers;
+
+ /* Nonzero if function being compiled has nonlocal gotos to parent
+ function. */
+ bool has_nonlocal_goto;
+
+ /* Nonzero if function being compiled has an asm statement. */
+ bool has_asm_statement;
+
+ /* Nonzero if the current function is a thunk, i.e., a lightweight
+ function implemented by the output_mi_thunk hook) that just
+ adjusts one of its arguments and forwards to another
+ function. */
+ bool is_thunk;
+
+ /* This bit is used by the exception handling logic. It is set if all
+ calls (if any) are sibling calls. Such functions do not have to
+ have EH tables generated, as they cannot throw. A call to such a
+ function, however, should be treated as throwing if any of its callees
+ can throw. */
+ bool all_throwers_are_sibcalls;
+
+ /* Nonzero if stack limit checking should be enabled in the current
+ function. */
+ bool limit_stack;
+
+ /* Nonzero if profiling code should be generated. */
+ bool profile;
+
+ /* Nonzero if the current function uses the constant pool. */
+ bool uses_const_pool;
+
+ /* Nonzero if the current function uses pic_offset_table_rtx. */
+ bool uses_pic_offset_table;
+
+ /* Nonzero if the current function needs an lsda for exception handling. */
+ bool uses_eh_lsda;
+
+ /* Set when the tail call has been produced. */
+ bool tail_call_emit;
+
+ /* Nonzero if code to initialize arg_pointer_save_area has been emitted. */
+ bool arg_pointer_save_area_init;
};
#define return_label (crtl->x_return_label)
@@ -413,6 +471,10 @@ struct function GTY(())
/* Properties used by the pass manager. */
unsigned int curr_properties;
unsigned int last_verified;
+ /* Interprocedural passes scheduled to have their transform functions
+ applied next time we execute local pass on them. We maintain it
+ per-function in order to allow IPA passes to introduce new functions. */
+ VEC(ipa_opt_pass,heap) * GTY((skip)) ipa_transforms_to_apply;
/* Collected bit flags. */
@@ -437,50 +499,10 @@ struct function GTY(())
either as a subroutine or builtin. */
unsigned int calls_alloca : 1;
- /* Nonzero if function being compiled called builtin_return_addr or
- builtin_frame_address with nonzero count. */
- unsigned int accesses_prior_frames : 1;
-
- /* Nonzero if the function calls __builtin_eh_return. */
- unsigned int calls_eh_return : 1;
-
-
/* Nonzero if function being compiled receives nonlocal gotos
from nested functions. */
unsigned int has_nonlocal_label : 1;
- /* Nonzero if function saves all registers, e.g. if it has a nonlocal
- label that can reach the exit block via non-exceptional paths. */
- unsigned int saves_all_registers : 1;
-
- /* Nonzero if function being compiled has nonlocal gotos to parent
- function. */
- unsigned int has_nonlocal_goto : 1;
-
- /* Nonzero if function being compiled has an asm statement. */
- unsigned int has_asm_statement : 1;
-
- /* Nonzero if the current function is a thunk, i.e., a lightweight
- function implemented by the output_mi_thunk hook) that just
- adjusts one of its arguments and forwards to another
- function. */
- unsigned int is_thunk : 1;
-
- /* This bit is used by the exception handling logic. It is set if all
- calls (if any) are sibling calls. Such functions do not have to
- have EH tables generated, as they cannot throw. A call to such a
- function, however, should be treated as throwing if any of its callees
- can throw. */
- unsigned int all_throwers_are_sibcalls : 1;
-
- /* Nonzero if profiling code should be generated. */
- unsigned int profile : 1;
-
- /* Nonzero if stack limit checking should be enabled in the current
- function. */
- unsigned int limit_stack : 1;
-
-
/* Nonzero if current function uses stdarg.h or equivalent. */
unsigned int stdarg : 1;
@@ -491,34 +513,10 @@ struct function GTY(())
variable-sized type, then the size of the parameter is computed
when the function body is entered. However, some front-ends do
not desire this behavior. */
- unsigned int x_dont_save_pending_sizes_p : 1;
-
- /* Nonzero if the current function uses the constant pool. */
- unsigned int uses_const_pool : 1;
-
- /* Nonzero if the current function uses pic_offset_table_rtx. */
- unsigned int uses_pic_offset_table : 1;
-
- /* Nonzero if the current function needs an lsda for exception handling. */
- unsigned int uses_eh_lsda : 1;
-
- /* Nonzero if code to initialize arg_pointer_save_area has been emitted. */
- unsigned int arg_pointer_save_area_init : 1;
+ unsigned int dont_save_pending_sizes_p : 1;
unsigned int after_inlining : 1;
- /* Set when the call to function itself has been emit. */
- unsigned int recursive_call_emit : 1;
-
-
- /* Set when the tail call has been produced. */
- unsigned int tail_call_emit : 1;
-
- /* FIXME tuples: This bit is temporarily here to mark when a
- function has been gimplified, so we can make sure we're not
- creating non GIMPLE tuples after gimplification. */
- unsigned int gimplified : 1;
-
/* Fields below this point are not set for abstract functions; see
allocate_struct_function. */
@@ -563,23 +561,7 @@ extern void pop_cfun (void);
extern void instantiate_decl_rtl (rtx x);
/* For backward compatibility... eventually these should all go away. */
-#define current_function_returns_struct (cfun->returns_struct)
-#define current_function_returns_pcc_struct (cfun->returns_pcc_struct)
-#define current_function_calls_setjmp (cfun->calls_setjmp)
-#define current_function_calls_alloca (cfun->calls_alloca)
-#define current_function_accesses_prior_frames (cfun->accesses_prior_frames)
-#define current_function_calls_eh_return (cfun->calls_eh_return)
-#define current_function_is_thunk (cfun->is_thunk)
-#define current_function_stdarg (cfun->stdarg)
-#define current_function_profile (cfun->profile)
#define current_function_funcdef_no (cfun->funcdef_no)
-#define current_function_limit_stack (cfun->limit_stack)
-#define current_function_uses_pic_offset_table (cfun->uses_pic_offset_table)
-#define current_function_uses_const_pool (cfun->uses_const_pool)
-#define current_function_has_nonlocal_label (cfun->has_nonlocal_label)
-#define current_function_saves_all_registers (cfun->saves_all_registers)
-#define current_function_has_nonlocal_goto (cfun->has_nonlocal_goto)
-#define current_function_has_asm_statement (cfun->has_asm_statement)
#define current_loops (cfun->x_current_loops)
#define dom_computed (cfun->cfg->x_dom_computed)
diff --git a/gcc/gcc.c b/gcc/gcc.c
index 0636579644f..b9ca2293149 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -285,12 +285,21 @@ static struct obstack obstack;
static struct obstack collect_obstack;
+/* This is a list of a wrapper program and its arguments.
+ e.g. wrapper_string of "strace,-c"
+ will cause all programs to run as
+ strace -c program arguments
+ instead of just
+ program arguments */
+static const char *wrapper_string;
+
/* Forward declaration for prototypes. */
struct path_prefix;
struct prefix_list;
static void init_spec (void);
static void store_arg (const char *, int, int);
+static void insert_wrapper (const char *);
static char *load_specs (const char *);
static void read_specs (const char *, int);
static void set_spec (const char *, const char *);
@@ -2845,6 +2854,13 @@ execute (void)
gcc_assert (!processing_spec_function);
+ if (wrapper_string)
+ {
+ string = find_a_file (&exec_prefixes, argbuf[0], X_OK, false);
+ argbuf[0] = (string) ? string : argbuf[0];
+ insert_wrapper (wrapper_string);
+ }
+
/* Count # of piped commands. */
for (n_commands = 1, i = 0; i < argbuf_index; i++)
if (strcmp (argbuf[i], "|") == 0)
@@ -2859,10 +2875,12 @@ execute (void)
commands[0].prog = argbuf[0]; /* first command. */
commands[0].argv = &argbuf[0];
- string = find_a_file (&exec_prefixes, commands[0].prog, X_OK, false);
-
- if (string)
- commands[0].argv[0] = string;
+
+ if (!wrapper_string)
+ {
+ string = find_a_file (&exec_prefixes, commands[0].prog, X_OK, false);
+ commands[0].argv[0] = (string) ? string : commands[0].argv[0];
+ }
for (n_commands = 1, i = 0; i < argbuf_index; i++)
if (strcmp (argbuf[i], "|") == 0)
@@ -3798,6 +3816,15 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\n"
use_pipes = 1;
n_switches++;
}
+ else if (strcmp (argv[i], "-wrapper") == 0)
+ {
+ if (++i >= argc)
+ fatal ("argument to '-wrapper' is missing");
+
+ wrapper_string = argv[i];
+ n_switches++;
+ n_switches++;
+ }
else if (strcmp (argv[i], "-###") == 0)
{
/* This is similar to -v except that there is no execution
@@ -4163,6 +4190,8 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\n"
infiles[n_infiles].language = "*";
infiles[n_infiles++].name = argv[i];
}
+ else if (strcmp (argv[i], "-wrapper") == 0)
+ i++;
else if (strcmp (argv[i], "-specs") == 0)
i++;
else if (strncmp (argv[i], "-specs=", 7) == 0)
@@ -4414,6 +4443,52 @@ end_going_arg (void)
}
}
+
+/* Parse the WRAPPER string which is a comma separated list of the command line
+ and insert them into the beginning of argbuf. */
+
+static void
+insert_wrapper (const char *wrapper)
+{
+ int n = 0;
+ int i;
+ char *buf = xstrdup (wrapper);
+ char *p = buf;
+
+ do
+ {
+ n++;
+ while (*p == ',')
+ p++;
+ }
+ while ((p = strchr (p, ',')) != NULL);
+
+ if (argbuf_index + n >= argbuf_length)
+ {
+ argbuf_length = argbuf_length * 2;
+ while (argbuf_length < argbuf_index + n)
+ argbuf_length *= 2;
+ argbuf = xrealloc (argbuf, argbuf_length * sizeof (const char *));
+ }
+ for (i = argbuf_index - 1; i >= 0; i--)
+ argbuf[i + n] = argbuf[i];
+
+ i = 0;
+ p = buf;
+ do
+ {
+ while (*p == ',')
+ {
+ *p = 0;
+ p++;
+ }
+ argbuf[i++] = p;
+ }
+ while ((p = strchr (p, ',')) != NULL);
+ gcc_assert (i == n);
+ argbuf_index += n;
+}
+
/* Process the spec SPEC and run the commands specified therein.
Returns 0 if the spec is successfully processed; -1 if failed. */
diff --git a/gcc/gcse.c b/gcc/gcse.c
index 20bb0804d2e..477d4d3ef07 100644
--- a/gcc/gcse.c
+++ b/gcc/gcse.c
@@ -658,7 +658,7 @@ gcse_main (rtx f ATTRIBUTE_UNUSED)
/* We do not construct an accurate cfg in functions which call
setjmp, so just punt to be safe. */
- if (current_function_calls_setjmp)
+ if (cfun->calls_setjmp)
return 0;
/* Assume that we do not need to run jump optimizations after gcse. */
@@ -6575,7 +6575,7 @@ bypass_jumps (void)
/* We do not construct an accurate cfg in functions which call
setjmp, so just punt to be safe. */
- if (current_function_calls_setjmp)
+ if (cfun->calls_setjmp)
return 0;
/* Identify the basic block information for this function, including
diff --git a/gcc/gengtype.c b/gcc/gengtype.c
index d2a1160f7af..586a3c34137 100644
--- a/gcc/gengtype.c
+++ b/gcc/gengtype.c
@@ -1941,6 +1941,8 @@ walk_type (type_p t, struct walk_type_data *d)
;
else if (strcmp (oo->name, "chain_prev") == 0)
;
+ else if (strcmp (oo->name, "chain_circular") == 0)
+ ;
else if (strcmp (oo->name, "reorder") == 0)
;
else
@@ -2418,6 +2420,7 @@ write_func_for_structure (type_p orig_s, type_p s, type_p *param,
int i;
const char *chain_next = NULL;
const char *chain_prev = NULL;
+ const char *chain_circular = NULL;
const char *mark_hook_name = NULL;
options_p opt;
struct walk_type_data d;
@@ -2436,11 +2439,17 @@ write_func_for_structure (type_p orig_s, type_p s, type_p *param,
chain_next = opt->info;
else if (strcmp (opt->name, "chain_prev") == 0)
chain_prev = opt->info;
+ else if (strcmp (opt->name, "chain_circular") == 0)
+ chain_circular = opt->info;
else if (strcmp (opt->name, "mark_hook") == 0)
mark_hook_name = opt->info;
if (chain_prev != NULL && chain_next == NULL)
error_at_line (&s->u.s.line, "chain_prev without chain_next");
+ if (chain_circular != NULL && chain_next != NULL)
+ error_at_line (&s->u.s.line, "chain_circular with chain_next");
+ if (chain_circular != NULL)
+ chain_next = chain_circular;
d.process_field = write_types_process_field;
d.cookie = wtd;
@@ -2485,7 +2494,10 @@ write_func_for_structure (type_p orig_s, type_p s, type_p *param,
}
else
{
- oprintf (d.of, " while (%s (xlimit", wtd->marker_routine);
+ if (chain_circular != NULL)
+ oprintf (d.of, " if (!%s (xlimit", wtd->marker_routine);
+ else
+ oprintf (d.of, " while (%s (xlimit", wtd->marker_routine);
if (wtd->param_prefix)
{
oprintf (d.of, ", xlimit, gt_%s_", wtd->param_prefix);
@@ -2493,6 +2505,8 @@ write_func_for_structure (type_p orig_s, type_p s, type_p *param,
output_type_enum (d.of, orig_s);
}
oprintf (d.of, "))\n");
+ if (chain_circular != NULL)
+ oprintf (d.of, " return;\n do\n");
if (mark_hook_name && !wtd->skip_hooks)
{
oprintf (d.of, " {\n");
@@ -2528,7 +2542,22 @@ write_func_for_structure (type_p orig_s, type_p s, type_p *param,
oprintf (d.of, ");\n");
oprintf (d.of, " }\n");
}
- oprintf (d.of, " while (x != xlimit)\n");
+ if (chain_circular != NULL)
+ {
+ oprintf (d.of, " while (%s (xlimit", wtd->marker_routine);
+ if (wtd->param_prefix)
+ {
+ oprintf (d.of, ", xlimit, gt_%s_", wtd->param_prefix);
+ output_mangled_typename (d.of, orig_s);
+ output_type_enum (d.of, orig_s);
+ }
+ oprintf (d.of, "));\n");
+ if (mark_hook_name && !wtd->skip_hooks)
+ oprintf (d.of, " %s (xlimit);\n", mark_hook_name);
+ oprintf (d.of, " do\n");
+ }
+ else
+ oprintf (d.of, " while (x != xlimit)\n");
}
oprintf (d.of, " {\n");
if (mark_hook_name && chain_next == NULL && !wtd->skip_hooks)
@@ -2547,6 +2576,8 @@ write_func_for_structure (type_p orig_s, type_p s, type_p *param,
}
oprintf (d.of, " }\n");
+ if (chain_circular != NULL)
+ oprintf (d.of, " while (x != xlimit);\n");
oprintf (d.of, "}\n");
}
diff --git a/gcc/gimple-low.c b/gcc/gimple-low.c
index 89de67a088c..fd1a19dfd32 100644
--- a/gcc/gimple-low.c
+++ b/gcc/gimple-low.c
@@ -122,7 +122,7 @@ lower_function_body (void)
disp_label = create_artificial_label ();
/* This mark will create forward edges from every call site. */
DECL_NONLOCAL (disp_label) = 1;
- current_function_has_nonlocal_label = 1;
+ cfun->has_nonlocal_label = 1;
x = build1 (LABEL_EXPR, void_type_node, disp_label);
tsi_link_after (&i, x, TSI_CONTINUE_LINKING);
diff --git a/gcc/gimplify.c b/gcc/gimplify.c
index 52f63c1fc0d..2e8ffef4430 100644
--- a/gcc/gimplify.c
+++ b/gcc/gimplify.c
@@ -2868,12 +2868,14 @@ gimplify_init_ctor_preeval (tree *expr_p, tree *pre_p, tree *post_p,
{
enum gimplify_status one;
- /* If the value is invariant, then there's nothing to pre-evaluate.
- But ensure it doesn't have any side-effects since a SAVE_EXPR is
- invariant but has side effects and might contain a reference to
- the object we're initializing. */
- if (TREE_INVARIANT (*expr_p) && !TREE_SIDE_EFFECTS (*expr_p))
- return;
+ /* If the value is constant, then there's nothing to pre-evaluate. */
+ if (TREE_CONSTANT (*expr_p))
+ {
+ /* Ensure it does not have side effects, it might contain a reference to
+ the object we're initializing. */
+ gcc_assert (!TREE_SIDE_EFFECTS (*expr_p));
+ return;
+ }
/* If the type has non-trivial constructors, we can't pre-evaluate. */
if (TREE_ADDRESSABLE (TREE_TYPE (*expr_p)))
@@ -3416,7 +3418,6 @@ gimplify_init_constructor (tree *expr_p, tree *pre_p,
break;
TREE_CONSTANT (ctor) = 0;
- TREE_INVARIANT (ctor) = 0;
}
/* Vector types use CONSTRUCTOR all the way through gimple
@@ -4254,8 +4255,7 @@ gimplify_addr_expr (tree *expr_p, tree *pre_p, tree *post_p)
if (TREE_CODE (op0) == INDIRECT_REF)
goto do_indirect_ref;
- /* Make sure TREE_INVARIANT, TREE_CONSTANT, and TREE_SIDE_EFFECTS
- is set properly. */
+ /* Make sure TREE_CONSTANT and TREE_SIDE_EFFECTS are set properly. */
recompute_tree_invariant_for_addr_expr (expr);
mark_addressable (TREE_OPERAND (expr, 0));
@@ -6603,7 +6603,6 @@ gimplify_function_tree (tree fndecl)
DECL_SAVED_TREE (fndecl) = bind;
}
- cfun->gimplified = true;
current_function_decl = oldfn;
pop_cfun ();
}
diff --git a/gcc/global.c b/gcc/global.c
index f88da110321..befdc9f367c 100644
--- a/gcc/global.c
+++ b/gcc/global.c
@@ -249,7 +249,7 @@ compute_regsets (HARD_REG_SET *elim_set,
#endif
int need_fp
= (! flag_omit_frame_pointer
- || (current_function_calls_alloca && EXIT_IGNORE_STACK)
+ || (cfun->calls_alloca && EXIT_IGNORE_STACK)
|| FRAME_POINTER_REQUIRED);
max_regno = max_reg_num ();
@@ -378,7 +378,7 @@ global_alloc (void)
if (REG_N_REFS (i) != 0 && REG_LIVE_LENGTH (i) != -1
/* Don't allocate pseudos that cross calls,
if this function receives a nonlocal goto. */
- && (! current_function_has_nonlocal_label
+ && (! cfun->has_nonlocal_label
|| REG_N_CALLS_CROSSED (i) == 0))
{
int blk = regno_basic_block (i);
diff --git a/gcc/gthr-single.h b/gcc/gthr-single.h
index 7dd1f5471cf..66a9dd86c90 100644
--- a/gcc/gthr-single.h
+++ b/gcc/gthr-single.h
@@ -1,6 +1,6 @@
/* Threads compatibility routines for libgcc2 and libobjc. */
/* Compile this one with gcc. */
-/* Copyright (C) 1997, 1999, 2000, 2004 Free Software Foundation, Inc.
+/* Copyright (C) 1997, 1999, 2000, 2004, 2008 Free Software Foundation, Inc.
This file is part of GCC.
@@ -31,16 +31,16 @@ Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
/* Just provide compatibility for mutex handling. */
+typedef int __gthread_key_t;
+typedef int __gthread_once_t;
typedef int __gthread_mutex_t;
typedef int __gthread_recursive_mutex_t;
+#define __GTHREAD_ONCE_INIT 0
#define __GTHREAD_MUTEX_INIT 0
+#define __GTHREAD_RECURSIVE_MUTEX_INIT 0
-#ifdef __cplusplus
-#define UNUSED(x)
-#else
-#define UNUSED(x) x __attribute__((unused))
-#endif
+#define UNUSED __attribute__((unused))
#ifdef _LIBOBJC
@@ -69,7 +69,7 @@ __gthread_objc_close_thread_system (void)
/* Create a new thread of execution. */
static inline objc_thread_t
-__gthread_objc_thread_detach (void (* func)(void *), void * UNUSED(arg))
+__gthread_objc_thread_detach (void (* func)(void *), void * arg UNUSED)
{
/* No thread support available */
return NULL;
@@ -77,7 +77,7 @@ __gthread_objc_thread_detach (void (* func)(void *), void * UNUSED(arg))
/* Set the current thread's priority. */
static inline int
-__gthread_objc_thread_set_priority (int UNUSED(priority))
+__gthread_objc_thread_set_priority (int priority UNUSED)
{
/* No thread support available */
return -1;
@@ -134,21 +134,21 @@ __gthread_objc_thread_get_data (void)
/* Allocate a mutex. */
static inline int
-__gthread_objc_mutex_allocate (objc_mutex_t UNUSED(mutex))
+__gthread_objc_mutex_allocate (objc_mutex_t mutex UNUSED)
{
return 0;
}
/* Deallocate a mutex. */
static inline int
-__gthread_objc_mutex_deallocate (objc_mutex_t UNUSED(mutex))
+__gthread_objc_mutex_deallocate (objc_mutex_t mutex UNUSED)
{
return 0;
}
/* Grab a lock on a mutex. */
static inline int
-__gthread_objc_mutex_lock (objc_mutex_t UNUSED(mutex))
+__gthread_objc_mutex_lock (objc_mutex_t mutex UNUSED)
{
/* There can only be one thread, so we always get the lock */
return 0;
@@ -156,7 +156,7 @@ __gthread_objc_mutex_lock (objc_mutex_t UNUSED(mutex))
/* Try to grab a lock on a mutex. */
static inline int
-__gthread_objc_mutex_trylock (objc_mutex_t UNUSED(mutex))
+__gthread_objc_mutex_trylock (objc_mutex_t mutex UNUSED)
{
/* There can only be one thread, so we always get the lock */
return 0;
@@ -164,7 +164,7 @@ __gthread_objc_mutex_trylock (objc_mutex_t UNUSED(mutex))
/* Unlock the mutex */
static inline int
-__gthread_objc_mutex_unlock (objc_mutex_t UNUSED(mutex))
+__gthread_objc_mutex_unlock (objc_mutex_t mutex UNUSED)
{
return 0;
}
@@ -173,36 +173,36 @@ __gthread_objc_mutex_unlock (objc_mutex_t UNUSED(mutex))
/* Allocate a condition. */
static inline int
-__gthread_objc_condition_allocate (objc_condition_t UNUSED(condition))
+__gthread_objc_condition_allocate (objc_condition_t condition UNUSED)
{
return 0;
}
/* Deallocate a condition. */
static inline int
-__gthread_objc_condition_deallocate (objc_condition_t UNUSED(condition))
+__gthread_objc_condition_deallocate (objc_condition_t condition UNUSED)
{
return 0;
}
/* Wait on the condition */
static inline int
-__gthread_objc_condition_wait (objc_condition_t UNUSED(condition),
- objc_mutex_t UNUSED(mutex))
+__gthread_objc_condition_wait (objc_condition_t condition UNUSED,
+ objc_mutex_t mutex UNUSED)
{
return 0;
}
/* Wake up all threads waiting on this condition. */
static inline int
-__gthread_objc_condition_broadcast (objc_condition_t UNUSED(condition))
+__gthread_objc_condition_broadcast (objc_condition_t condition UNUSED)
{
return 0;
}
/* Wake up one thread waiting on this condition. */
static inline int
-__gthread_objc_condition_signal (objc_condition_t UNUSED(condition))
+__gthread_objc_condition_signal (objc_condition_t condition UNUSED)
{
return 0;
}
@@ -215,26 +215,56 @@ __gthread_active_p (void)
return 0;
}
+static inline int
+__gthread_once (__gthread_once_t *once UNUSED, void (*func) () UNUSED)
+{
+ return 0;
+}
+
+static inline int UNUSED
+__gthread_key_create (__gthread_key_t *key UNUSED, void (*func) (void *) UNUSED)
+{
+ return 0;
+}
+
+static int UNUSED
+__gthread_key_delete (__gthread_key_t key UNUSED)
+{
+ return 0;
+}
+
+static inline void *
+__gthread_getspecific (__gthread_key_t key UNUSED)
+{
+ return 0;
+}
+
+static inline int
+__gthread_setspecific (__gthread_key_t key UNUSED, const void *v UNUSED)
+{
+ return 0;
+}
+
static inline int
-__gthread_mutex_destroy (__gthread_mutex_t * UNUSED(mutex))
+__gthread_mutex_destroy (__gthread_mutex_t *mutex UNUSED)
{
return 0;
}
static inline int
-__gthread_mutex_lock (__gthread_mutex_t * UNUSED(mutex))
+__gthread_mutex_lock (__gthread_mutex_t *mutex UNUSED)
{
return 0;
}
static inline int
-__gthread_mutex_trylock (__gthread_mutex_t * UNUSED(mutex))
+__gthread_mutex_trylock (__gthread_mutex_t *mutex UNUSED)
{
return 0;
}
static inline int
-__gthread_mutex_unlock (__gthread_mutex_t * UNUSED(mutex))
+__gthread_mutex_unlock (__gthread_mutex_t *mutex UNUSED)
{
return 0;
}
diff --git a/gcc/ipa-cp.c b/gcc/ipa-cp.c
index 4d9e0a4eb28..b8ae5ca91f8 100644
--- a/gcc/ipa-cp.c
+++ b/gcc/ipa-cp.c
@@ -72,7 +72,7 @@ along with GCC; see the file COPYING3. If not see
The jump function info, ipa_jump_func, is defined in ipa_edge
structure (defined in ipa_prop.h and pointed to by cgraph_node->aux)
- The modify info, ipa_modify, is defined in ipa_node structure
+ The modify info, modified_flags, is defined in ipa_node_params structure
(defined in ipa_prop.h and pointed to by cgraph_edge->aux).
-ipcp_init_stage() is the first stage driver.
@@ -89,7 +89,7 @@ along with GCC; see the file COPYING3. If not see
Cval of formal f will have a constant value if all callsites to this
function have the same constant value passed to f.
- The cval info, ipcp_formal, is defined in ipa_node structure
+ The cval info, ipcp_lattice, is defined in ipa_node_params structure
(defined in ipa_prop.h and pointed to by cgraph_edge->aux).
-ipcp_iterate_stage() is the second stage driver.
@@ -145,7 +145,7 @@ along with GCC; see the file COPYING3. If not see
#include "tree-dump.h"
#include "tree-inline.h"
-/* Get orig node field of ipa_node associated with method MT. */
+/* Get orig node field of ipa_node_params associated with method MT. */
static inline struct cgraph_node *
ipcp_method_orig_node (struct cgraph_node *mt)
{
@@ -173,17 +173,17 @@ static void
ipcp_cloned_create (struct cgraph_node *orig_node,
struct cgraph_node *new_node)
{
- ipa_node_create (new_node);
+ ipa_create_node_params (new_node);
ipcp_method_set_orig_node (new_node, orig_node);
- ipa_method_formal_compute_count (new_node);
- ipa_method_compute_tree_map (new_node);
+ ipa_count_formal_params (new_node);
+ ipa_create_param_decls_array (new_node);
}
/* Return cval_type field of CVAL. */
-static inline enum cvalue_type
-ipcp_cval_get_cvalue_type (struct ipcp_formal *cval)
+static inline enum ipa_lattice_type
+ipcp_cval_get_cvalue_type (struct ipcp_lattice *cval)
{
- return cval->cval_type;
+ return cval->type;
}
/* Return scale for MT. */
@@ -202,32 +202,32 @@ ipcp_method_set_scale (struct cgraph_node *node, gcov_type count)
/* Set TYPE as cval_type field of CVAL. */
static inline void
-ipcp_cval_set_cvalue_type (struct ipcp_formal *cval, enum cvalue_type type)
+ipcp_cval_set_cvalue_type (struct ipcp_lattice *cval, enum jump_func_type type)
{
- cval->cval_type = type;
+ cval->type = type;
}
/* Return cvalue field of CVAL. */
-static inline union parameter_info *
-ipcp_cval_get_cvalue (struct ipcp_formal *cval)
+static inline tree
+ipcp_cval_get_cvalue (struct ipcp_lattice *cval)
{
- return &(cval->cvalue);
+ return cval->constant;
}
/* Set VALUE as cvalue field CVAL. */
static inline void
-ipcp_cval_set_cvalue (struct ipcp_formal *cval, union parameter_info *value,
- enum cvalue_type type)
+ipcp_cval_set_cvalue (struct ipcp_lattice *cval, tree value,
+ enum ipa_lattice_type type)
{
- if (type == CONST_VALUE || type == CONST_VALUE_REF)
- cval->cvalue.value = value->value;
+ if (type == IPA_CONST_VALUE || type == IPA_CONST_VALUE_REF)
+ cval->constant = value;
}
/* Return whether TYPE is a constant type. */
static bool
-ipcp_type_is_const (enum cvalue_type type)
+ipcp_type_is_const (enum ipa_lattice_type type)
{
- if (type == CONST_VALUE || type == CONST_VALUE_REF)
+ if (type == IPA_CONST_VALUE || type == IPA_CONST_VALUE_REF)
return true;
else
return false;
@@ -235,43 +235,43 @@ ipcp_type_is_const (enum cvalue_type type)
/* Return true if CONST_VAL1 and CONST_VAL2 are equal. */
static inline bool
-ipcp_cval_equal_cvalues (union parameter_info *const_val1,
- union parameter_info *const_val2,
- enum cvalue_type type1, enum cvalue_type type2)
+ipcp_cval_equal_cvalues (tree const_val1, tree const_val2,
+ enum ipa_lattice_type type1,
+ enum ipa_lattice_type type2)
{
gcc_assert (ipcp_type_is_const (type1) && ipcp_type_is_const (type2));
if (type1 != type2)
return false;
- if (operand_equal_p (const_val1->value, const_val2->value, 0))
+ if (operand_equal_p (const_val1, const_val2, 0))
return true;
return false;
}
/* Compute Meet arithmetics:
- Meet (BOTTOM, x) = BOTTOM
- Meet (TOP,x) = x
- Meet (const_a,const_b) = BOTTOM, if const_a != const_b.
+ Meet (IPA_BOTTOM, x) = IPA_BOTTOM
+ Meet (IPA_TOP,x) = x
+ Meet (const_a,const_b) = IPA_BOTTOM, if const_a != const_b.
MEET (const_a,const_b) = const_a, if const_a == const_b.*/
static void
-ipcp_cval_meet (struct ipcp_formal *cval, struct ipcp_formal *cval1,
- struct ipcp_formal *cval2)
+ipcp_cval_meet (struct ipcp_lattice *cval, struct ipcp_lattice *cval1,
+ struct ipcp_lattice *cval2)
{
- if (ipcp_cval_get_cvalue_type (cval1) == BOTTOM
- || ipcp_cval_get_cvalue_type (cval2) == BOTTOM)
+ if (ipcp_cval_get_cvalue_type (cval1) == IPA_BOTTOM
+ || ipcp_cval_get_cvalue_type (cval2) == IPA_BOTTOM)
{
- ipcp_cval_set_cvalue_type (cval, BOTTOM);
+ ipcp_cval_set_cvalue_type (cval, IPA_BOTTOM);
return;
}
- if (ipcp_cval_get_cvalue_type (cval1) == TOP)
+ if (ipcp_cval_get_cvalue_type (cval1) == IPA_TOP)
{
ipcp_cval_set_cvalue_type (cval, ipcp_cval_get_cvalue_type (cval2));
ipcp_cval_set_cvalue (cval, ipcp_cval_get_cvalue (cval2),
ipcp_cval_get_cvalue_type (cval2));
return;
}
- if (ipcp_cval_get_cvalue_type (cval2) == TOP)
+ if (ipcp_cval_get_cvalue_type (cval2) == IPA_TOP)
{
ipcp_cval_set_cvalue_type (cval, ipcp_cval_get_cvalue_type (cval1));
ipcp_cval_set_cvalue (cval, ipcp_cval_get_cvalue (cval1),
@@ -283,7 +283,7 @@ ipcp_cval_meet (struct ipcp_formal *cval, struct ipcp_formal *cval1,
ipcp_cval_get_cvalue_type (cval1),
ipcp_cval_get_cvalue_type (cval2)))
{
- ipcp_cval_set_cvalue_type (cval, BOTTOM);
+ ipcp_cval_set_cvalue_type (cval, IPA_BOTTOM);
return;
}
ipcp_cval_set_cvalue_type (cval, ipcp_cval_get_cvalue_type (cval1));
@@ -292,34 +292,35 @@ ipcp_cval_meet (struct ipcp_formal *cval, struct ipcp_formal *cval1,
}
/* Return cval structure for the formal at index INFO_TYPE in MT. */
-static inline struct ipcp_formal *
+static inline struct ipcp_lattice *
ipcp_method_cval (struct cgraph_node *mt, int info_type)
{
- return &(IPA_NODE_REF (mt)->ipcp_cval[info_type]);
+ return &(IPA_NODE_REF (mt)->ipcp_lattices[info_type]);
}
/* Given the jump function (TYPE, INFO_TYPE), compute a new value of CVAL.
If TYPE is FORMAL_IPA_TYPE, the cval of the corresponding formal is
drawn from MT. */
static void
-ipcp_cval_compute (struct ipcp_formal *cval, struct cgraph_node *mt,
- enum jump_func_type type, union parameter_info *info_type)
+ipcp_cval_compute (struct ipcp_lattice *cval, struct cgraph_node *mt,
+ enum jump_func_type type,
+ union jump_func_value *info_type)
{
- if (type == UNKNOWN_IPATYPE)
- ipcp_cval_set_cvalue_type (cval, BOTTOM);
- else if (type == CONST_IPATYPE)
+ if (type == IPA_UNKNOWN)
+ ipcp_cval_set_cvalue_type (cval, IPA_BOTTOM);
+ else if (type == IPA_CONST)
{
- ipcp_cval_set_cvalue_type (cval, CONST_VALUE);
- ipcp_cval_set_cvalue (cval, info_type, CONST_VALUE);
+ ipcp_cval_set_cvalue_type (cval, IPA_CONST_VALUE);
+ ipcp_cval_set_cvalue (cval, info_type->constant, IPA_CONST_VALUE);
}
- else if (type == CONST_IPATYPE_REF)
+ else if (type == IPA_CONST_REF)
{
- ipcp_cval_set_cvalue_type (cval, CONST_VALUE_REF);
- ipcp_cval_set_cvalue (cval, info_type, CONST_VALUE_REF);
+ ipcp_cval_set_cvalue_type (cval, IPA_CONST_VALUE_REF);
+ ipcp_cval_set_cvalue (cval, info_type->constant, IPA_CONST_VALUE_REF);
}
- else if (type == FORMAL_IPATYPE)
+ else if (type == IPA_PASS_THROUGH)
{
- enum cvalue_type type =
+ enum ipa_lattice_type type =
ipcp_cval_get_cvalue_type (ipcp_method_cval
(mt, info_type->formal_id));
ipcp_cval_set_cvalue_type (cval, type);
@@ -332,12 +333,12 @@ ipcp_cval_compute (struct ipcp_formal *cval, struct cgraph_node *mt,
/* True when CVAL1 and CVAL2 values are not the same. */
static bool
-ipcp_cval_changed (struct ipcp_formal *cval1, struct ipcp_formal *cval2)
+ipcp_cval_changed (struct ipcp_lattice *cval1, struct ipcp_lattice *cval2)
{
if (ipcp_cval_get_cvalue_type (cval1) == ipcp_cval_get_cvalue_type (cval2))
{
- if (ipcp_cval_get_cvalue_type (cval1) != CONST_VALUE &&
- ipcp_cval_get_cvalue_type (cval1) != CONST_VALUE_REF)
+ if (ipcp_cval_get_cvalue_type (cval1) != IPA_CONST_VALUE
+ && ipcp_cval_get_cvalue_type (cval1) != IPA_CONST_VALUE_REF)
return false;
if (ipcp_cval_equal_cvalues (ipcp_cval_get_cvalue (cval1),
ipcp_cval_get_cvalue (cval2),
@@ -352,25 +353,33 @@ ipcp_cval_changed (struct ipcp_formal *cval1, struct ipcp_formal *cval2)
static inline void
ipcp_formal_create (struct cgraph_node *mt)
{
- IPA_NODE_REF (mt)->ipcp_cval =
- XCNEWVEC (struct ipcp_formal, ipa_method_formal_count (mt));
+ IPA_NODE_REF (mt)->ipcp_lattices =
+ XCNEWVEC (struct ipcp_lattice, ipa_get_param_count (IPA_NODE_REF (mt)));
}
/* Set cval structure of I-th formal of MT to CVAL. */
static inline void
-ipcp_method_cval_set (struct cgraph_node *mt, int i, struct ipcp_formal *cval)
+ipcp_method_cval_set (struct cgraph_node *mt, int i, struct ipcp_lattice *cval)
{
- IPA_NODE_REF (mt)->ipcp_cval[i].cval_type = cval->cval_type;
+ IPA_NODE_REF (mt)->ipcp_lattices[i].type = cval->type;
ipcp_cval_set_cvalue (ipcp_method_cval (mt, i),
- ipcp_cval_get_cvalue (cval), cval->cval_type);
+ ipcp_cval_get_cvalue (cval), cval->type);
}
/* Set type of cval structure of formal I of MT to CVAL_TYPE1. */
static inline void
ipcp_method_cval_set_cvalue_type (struct cgraph_node *mt, int i,
- enum cvalue_type cval_type1)
+ enum ipa_lattice_type type)
{
- IPA_NODE_REF (mt)->ipcp_cval[i].cval_type = cval_type1;
+ IPA_NODE_REF (mt)->ipcp_lattices[i].type = type;
+}
+
+/* Set type of cval structure of formal I of MT to CVAL_TYPE1. */
+static inline void
+ipcp_method_cval_set_lattice_type (struct cgraph_node *mt, int i,
+ enum ipa_lattice_type type)
+{
+ IPA_NODE_REF (mt)->ipcp_lattices[i].type = type;
}
/* Print ipcp_cval data structures to F. */
@@ -385,22 +394,22 @@ ipcp_method_cval_print (FILE * f)
for (node = cgraph_nodes; node; node = node->next)
{
fprintf (f, "Printing cvals %s:\n", cgraph_node_name (node));
- count = ipa_method_formal_count (node);
+ count = ipa_get_param_count (IPA_NODE_REF (node));
for (i = 0; i < count; i++)
{
if (ipcp_cval_get_cvalue_type (ipcp_method_cval (node, i))
- == CONST_VALUE
+ == IPA_CONST_VALUE
|| ipcp_cval_get_cvalue_type (ipcp_method_cval (node, i)) ==
- CONST_VALUE_REF)
+ IPA_CONST_VALUE_REF)
{
fprintf (f, " param [%d]: ", i);
fprintf (f, "type is CONST ");
cvalue =
- ipcp_cval_get_cvalue (ipcp_method_cval (node, i))->value;
+ ipcp_cval_get_cvalue (ipcp_method_cval (node, i));
print_generic_expr (f, cvalue, 0);
fprintf (f, "\n");
}
- else if (ipcp_method_cval (node, i)->cval_type == TOP)
+ else if (ipcp_method_cval (node, i)->type == IPA_TOP)
fprintf (f, "param [%d]: type is TOP \n", i);
else
fprintf (f, "param [%d]: type is BOTTOM \n", i);
@@ -408,12 +417,12 @@ ipcp_method_cval_print (FILE * f)
}
}
-/* Initialize ipcp_cval array of MT with TOP values.
- All cvals for a method's formal parameters are initialized to BOTTOM
+/* Initialize ipcp_cval array of MT with IPA_TOP values.
+ All cvals for a method's formal parameters are initialized to IPA_BOTTOM
The currently supported types are integer types, real types and
Fortran constants (i.e. references to constants defined as
const_decls). All other types are not analyzed and therefore are
- assigned with BOTTOM. */
+ assigned with IPA_BOTTOM. */
static void
ipcp_method_cval_init (struct cgraph_node *mt)
{
@@ -421,15 +430,15 @@ ipcp_method_cval_init (struct cgraph_node *mt)
tree parm_tree;
ipcp_formal_create (mt);
- for (i = 0; i < ipa_method_formal_count (mt); i++)
+ for (i = 0; i < ipa_get_param_count (IPA_NODE_REF (mt)) ; i++)
{
- parm_tree = ipa_method_get_tree (mt, i);
+ parm_tree = ipa_get_ith_param (IPA_NODE_REF (mt), i);
if (INTEGRAL_TYPE_P (TREE_TYPE (parm_tree))
|| SCALAR_FLOAT_TYPE_P (TREE_TYPE (parm_tree))
|| POINTER_TYPE_P (TREE_TYPE (parm_tree)))
- ipcp_method_cval_set_cvalue_type (mt, i, TOP);
+ ipcp_method_cval_set_cvalue_type (mt, i, IPA_TOP);
else
- ipcp_method_cval_set_cvalue_type (mt, i, BOTTOM);
+ ipcp_method_cval_set_cvalue_type (mt, i, IPA_BOTTOM);
}
}
@@ -456,13 +465,12 @@ constant_val_insert (tree parm1, tree val)
/* build INTEGER_CST tree with type TREE_TYPE and
value according to CVALUE. Return the tree. */
static tree
-build_const_val (union parameter_info *cvalue, enum cvalue_type type,
- tree tree_type)
+build_const_val (tree cvalue, enum ipa_lattice_type type, tree tree_type)
{
tree const_val = NULL;
gcc_assert (ipcp_type_is_const (type));
- const_val = fold_convert (tree_type, cvalue->value);
+ const_val = fold_convert (tree_type, cvalue);
return const_val;
}
@@ -470,14 +478,14 @@ build_const_val (union parameter_info *cvalue, enum cvalue_type type,
constant_val_insert(). */
static void
ipcp_propagate_const (struct cgraph_node *mt, int param,
- union parameter_info *cvalue, enum cvalue_type type)
+ tree cvalue, enum ipa_lattice_type type)
{
tree const_val;
tree parm_tree;
if (dump_file)
fprintf (dump_file, "propagating const to %s\n", cgraph_node_name (mt));
- parm_tree = ipa_method_get_tree (mt, param);
+ parm_tree = ipa_get_ith_param (IPA_NODE_REF (mt), param);
const_val = build_const_val (cvalue, type, TREE_TYPE (parm_tree));
constant_val_insert (parm_tree, const_val);
}
@@ -514,10 +522,10 @@ ipcp_init_stage (void)
for (node = cgraph_nodes; node; node = node->next)
{
- ipa_method_formal_compute_count (node);
- ipa_method_compute_tree_map (node);
+ ipa_count_formal_params (node);
+ ipa_create_param_decls_array (node);
ipcp_method_cval_init (node);
- ipa_method_compute_modify (node);
+ ipa_detect_param_modifications (node);
ipcp_method_compute_scale (node);
}
for (node = cgraph_nodes; node; node = node->next)
@@ -525,23 +533,22 @@ ipcp_init_stage (void)
/* building jump functions */
for (cs = node->callees; cs; cs = cs->next_callee)
{
- ipa_callsite_compute_count (cs);
- if (ipa_callsite_param_count (cs)
- != ipa_method_formal_count (cs->callee))
+ ipa_count_arguments (cs);
+ if (ipa_get_cs_argument_count (IPA_EDGE_REF (cs))
+ != ipa_get_param_count (IPA_NODE_REF (cs->callee)))
{
/* Handle cases of functions with
a variable number of parameters. */
- ipa_callsite_param_count_set (cs, 0);
- ipa_method_formal_count_set (cs->callee, 0);
+ ipa_set_called_with_variable_arg (IPA_NODE_REF (cs->callee));
}
else
- ipa_callsite_compute_param (cs);
+ ipa_compute_jump_functions (cs);
}
}
}
-/* Return true if there are some formal parameters whose value is TOP.
- Change their values to BOTTOM, since they weren't determined. */
+/* Return true if there are some formal parameters whose value is IPA_TOP.
+ Change their values to IPA_BOTTOM, since they weren't determined. */
static bool
ipcp_after_propagate (void)
{
@@ -552,12 +559,12 @@ ipcp_after_propagate (void)
prop_again = false;
for (node = cgraph_nodes; node; node = node->next)
{
- count = ipa_method_formal_count (node);
+ count = ipa_get_param_count (IPA_NODE_REF (node));
for (i = 0; i < count; i++)
- if (ipcp_cval_get_cvalue_type (ipcp_method_cval (node, i)) == TOP)
+ if (ipcp_cval_get_cvalue_type (ipcp_method_cval (node, i)) == IPA_TOP)
{
prop_again = true;
- ipcp_method_cval_set_cvalue_type (node, i, BOTTOM);
+ ipcp_method_cval_set_cvalue_type (node, i, IPA_BOTTOM);
}
}
return prop_again;
@@ -569,37 +576,39 @@ static void
ipcp_propagate_stage (void)
{
int i;
- struct ipcp_formal cval1 = { BOTTOM, {0} }, cval = { BOTTOM, {0} };
- struct ipcp_formal *cval2;
+ struct ipcp_lattice cval1 = { IPA_BOTTOM, NULL }, cval = { IPA_BOTTOM, NULL };
+ struct ipcp_lattice *cval2;
struct cgraph_node *mt, *callee;
struct cgraph_edge *cs;
struct ipa_jump_func *jump_func;
enum jump_func_type type;
- union parameter_info *info_type;
- ipa_methodlist_p wl;
+ union jump_func_value *jf_value;
+ struct ipa_func_list *wl;
int count;
- /* Initialize worklist to contain all methods. */
- wl = ipa_methodlist_init ();
- while (ipa_methodlist_not_empty (wl))
+ /* Initialize worklist to contain all functions. */
+ wl = ipa_init_func_list ();
+ while (wl)
{
- mt = ipa_remove_method (&wl);
+ mt = ipa_pop_func_from_list (&wl);
for (cs = mt->callees; cs; cs = cs->next_callee)
{
- callee = ipa_callsite_callee (cs);
- count = ipa_callsite_param_count (cs);
+ callee = cs->callee;
+ if (ipa_is_called_with_var_arguments (IPA_NODE_REF (callee)))
+ continue;
+ count = ipa_get_cs_argument_count (IPA_EDGE_REF (cs));
for (i = 0; i < count; i++)
{
- jump_func = ipa_callsite_param (cs, i);
- type = get_type (jump_func);
- info_type = ipa_jf_get_info_type (jump_func);
- ipcp_cval_compute (&cval1, mt, type, info_type);
+ jump_func = ipa_get_ith_jump_func (IPA_EDGE_REF (cs), i);
+ type = jump_func->type;
+ jf_value = &jump_func->value;
+ ipcp_cval_compute (&cval1, mt, type, jf_value);
cval2 = ipcp_method_cval (callee, i);
ipcp_cval_meet (&cval, &cval1, cval2);
if (ipcp_cval_changed (&cval, cval2))
{
ipcp_method_cval_set (callee, i, &cval);
- ipa_add_method (&wl, callee);
+ ipa_push_func_to_list (&wl, callee);
}
}
}
@@ -613,7 +622,7 @@ ipcp_iterate_stage (void)
{
ipcp_propagate_stage ();
if (ipcp_after_propagate ())
- /* Some cvals have changed from TOP to BOTTOM.
+ /* Some cvals have changed from IPA_TOP to IPA_BOTTOM.
This change should be propagated. */
ipcp_propagate_stage ();
}
@@ -646,27 +655,30 @@ ipcp_callsite_param_print (FILE * f)
{
fprintf (f, "callsite %s ", cgraph_node_name (node));
fprintf (f, "-> %s :: \n", cgraph_node_name (cs->callee));
- count = ipa_callsite_param_count (cs);
+
+ if (ipa_is_called_with_var_arguments (IPA_NODE_REF (cs->callee)))
+ continue;
+
+ count = ipa_get_cs_argument_count (IPA_EDGE_REF (cs));
for (i = 0; i < count; i++)
{
- jump_func = ipa_callsite_param (cs, i);
- type = get_type (jump_func);
+ jump_func = ipa_get_ith_jump_func (IPA_EDGE_REF (cs), i);
+ type = jump_func->type;
fprintf (f, " param %d: ", i);
- if (type == UNKNOWN_IPATYPE)
+ if (type == IPA_UNKNOWN)
fprintf (f, "UNKNOWN\n");
- else if (type == CONST_IPATYPE || type == CONST_IPATYPE_REF)
+ else if (type == IPA_CONST || type == IPA_CONST_REF)
{
- info_type = ipa_jf_get_info_type (jump_func)->value;
+ info_type = jump_func->value.constant;
fprintf (f, "CONST : ");
print_generic_expr (f, info_type, 0);
fprintf (f, "\n");
}
- else if (type == FORMAL_IPATYPE)
+ else if (type == IPA_PASS_THROUGH)
{
- fprintf (f, "FORMAL : ");
- fprintf (f, "%d\n",
- ipa_jf_get_info_type (jump_func)->formal_id);
+ fprintf (f, "PASS THROUGH : ");
+ fprintf (f, "%d\n", jump_func->value.formal_id);
}
}
}
@@ -818,8 +830,8 @@ ipcp_structures_print (FILE * f)
{
ipcp_method_cval_print (f);
ipcp_method_scale_print (f);
- ipa_method_tree_print (f);
- ipa_method_modify_print (f);
+ ipa_print_all_tree_maps (f);
+ ipa_print_all_params_modified (f);
ipcp_callsite_param_print (f);
}
@@ -842,15 +854,15 @@ ipcp_profile_print (FILE * f)
operates according to the flags sent. PARM_TREE is the
formal's tree found to be constant. CVALUE represents the constant. */
static struct ipa_replace_map *
-ipcp_replace_map_create (struct function *func, enum cvalue_type type,
- tree parm_tree, union parameter_info *cvalue)
+ipcp_replace_map_create (struct function *func, enum ipa_lattice_type type,
+ tree parm_tree, tree cvalue)
{
struct ipa_replace_map *replace_map;
tree const_val;
replace_map = XCNEW (struct ipa_replace_map);
gcc_assert (ipcp_type_is_const (type));
- if (type != CONST_VALUE_REF
+ if (type != IPA_CONST_VALUE_REF
&& is_gimple_reg (parm_tree) && gimple_default_def (func, parm_tree)
&& !SSA_NAME_OCCURS_IN_ABNORMAL_PHI (gimple_default_def (func, parm_tree)))
{
@@ -882,21 +894,21 @@ ipcp_redirect (struct cgraph_edge *cs)
int i, count;
struct ipa_jump_func *jump_func;
enum jump_func_type type;
- enum cvalue_type cval_type;
+ enum ipa_lattice_type lattice_type;
caller = cs->caller;
callee = cs->callee;
orig_callee = ipcp_method_orig_node (callee);
- count = ipa_method_formal_count (orig_callee);
+ count = ipa_get_param_count (IPA_NODE_REF (orig_callee));
for (i = 0; i < count; i++)
{
- cval_type =
+ lattice_type =
ipcp_cval_get_cvalue_type (ipcp_method_cval (orig_callee, i));
- if (ipcp_type_is_const (cval_type))
+ if (ipcp_type_is_const (lattice_type))
{
- jump_func = ipa_callsite_param (cs, i);
- type = get_type (jump_func);
- if (type != CONST_IPATYPE && type != CONST_IPATYPE_REF)
+ jump_func = ipa_get_ith_jump_func (IPA_EDGE_REF (cs), i);
+ type = jump_func->type;
+ if (type != IPA_CONST && type != IPA_CONST_REF)
return true;
}
}
@@ -993,23 +1005,24 @@ ipcp_insert_stage (void)
{
struct cgraph_node *node, *node1 = NULL;
int i, const_param;
- union parameter_info *cvalue;
+ tree cvalue;
VEC (cgraph_edge_p, heap) * redirect_callers;
varray_type replace_trees;
struct cgraph_edge *cs;
int node_callers, count;
tree parm_tree;
- enum cvalue_type type;
+ enum ipa_lattice_type type;
struct ipa_replace_map *replace_param;
for (node = cgraph_nodes; node; node = node->next)
{
/* Propagation of the constant is forbidden in
certain conditions. */
- if (!node->analyzed || ipcp_method_dont_insert_const (node))
+ if (!node->analyzed || ipcp_method_dont_insert_const (node)
+ || ipa_is_called_with_var_arguments (IPA_NODE_REF (node)))
continue;
const_param = 0;
- count = ipa_method_formal_count (node);
+ count = ipa_get_param_count (IPA_NODE_REF (node));
for (i = 0; i < count; i++)
{
type = ipcp_cval_get_cvalue_type (ipcp_method_cval (node, i));
@@ -1025,7 +1038,7 @@ ipcp_insert_stage (void)
if (ipcp_type_is_const (type))
{
cvalue = ipcp_cval_get_cvalue (ipcp_method_cval (node, i));
- parm_tree = ipa_method_get_tree (node, i);
+ parm_tree = ipa_get_ith_param (IPA_NODE_REF (node), i);
replace_param =
ipcp_replace_map_create (DECL_STRUCT_FUNCTION (node->decl),
type, parm_tree, cvalue);
@@ -1063,8 +1076,8 @@ ipcp_insert_stage (void)
if (ipcp_type_is_const (type))
{
cvalue = ipcp_cval_get_cvalue (ipcp_method_cval (node, i));
- parm_tree = ipa_method_get_tree (node, i);
- if (type != CONST_VALUE_REF && !is_gimple_reg (parm_tree))
+ parm_tree = ipa_get_ith_param (IPA_NODE_REF (node), i);
+ if (type != IPA_CONST_VALUE_REF && !is_gimple_reg (parm_tree))
ipcp_propagate_const (node1, i, cvalue, type);
}
}
@@ -1093,10 +1106,10 @@ ipcp_driver (void)
{
if (dump_file)
fprintf (dump_file, "\nIPA constant propagation start:\n");
- ipa_nodes_create ();
- ipa_edges_create ();
+ ipa_create_all_node_params ();
+ ipa_create_all_edge_args ();
/* 1. Call the init stage to initialize
- the ipa_node and ipa_edge structures. */
+ the ipa_node_params and ipa_edge_args structures. */
ipcp_init_stage ();
if (dump_file)
{
@@ -1120,9 +1133,8 @@ ipcp_driver (void)
ipcp_profile_print (dump_file);
}
/* Free all IPCP structures. */
- ipa_free ();
- ipa_nodes_free ();
- ipa_edges_free ();
+ ipa_free_all_node_params ();
+ ipa_free_all_edge_args ();
if (dump_file)
fprintf (dump_file, "\nIPA constant propagation end\n");
cgraph_remove_unreachable_nodes (true, NULL);
diff --git a/gcc/ipa-inline.c b/gcc/ipa-inline.c
index f251fbebe30..68a42013bfd 100644
--- a/gcc/ipa-inline.c
+++ b/gcc/ipa-inline.c
@@ -1426,26 +1426,6 @@ cgraph_gate_inlining (void)
return flag_inline_trees;
}
-struct simple_ipa_opt_pass pass_ipa_inline =
-{
- {
- SIMPLE_IPA_PASS,
- "inline", /* name */
- cgraph_gate_inlining, /* gate */
- cgraph_decide_inlining, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_INLINE_HEURISTICS, /* tv_id */
- 0, /* properties_required */
- PROP_cfg, /* properties_provided */
- 0, /* properties_destroyed */
- TODO_remove_functions, /* todo_flags_finish */
- TODO_dump_cgraph | TODO_dump_func
- | TODO_remove_functions /* todo_flags_finish */
- }
-};
-
/* Because inlining might remove no-longer reachable nodes, we need to
keep the array visible to garbage collector to avoid reading collected
out nodes. */
@@ -1579,18 +1559,20 @@ struct gimple_opt_pass pass_inline_parameters =
}
};
-/* Apply inline plan to the function. */
+/* Note function body size. */
+static void
+inline_generate_summary (struct cgraph_node *node ATTRIBUTE_UNUSED)
+{
+ compute_inline_parameters ();
+ return;
+}
+
+/* Apply inline plan to function. */
static unsigned int
-apply_inline (void)
+inline_transform (struct cgraph_node *node)
{
unsigned int todo = 0;
struct cgraph_edge *e;
- struct cgraph_node *node = cgraph_node (current_function_decl);
-
- /* Even when not optimizing, ensure that always_inline functions get inlined.
- */
- if (!optimize)
- cgraph_decide_inlining_incrementally (node, INLINE_SPEED, 0);
/* We might need the body of this function so that we can expand
it inline somewhere else. */
@@ -1606,6 +1588,66 @@ apply_inline (void)
todo = optimize_inline_calls (current_function_decl);
timevar_pop (TV_INTEGRATION);
}
+ return todo | execute_fixup_cfg ();
+}
+
+struct ipa_opt_pass pass_ipa_inline =
+{
+ {
+ IPA_PASS,
+ "inline", /* name */
+ cgraph_gate_inlining, /* gate */
+ cgraph_decide_inlining, /* execute */
+ NULL, /* sub */
+ NULL, /* next */
+ 0, /* static_pass_number */
+ TV_INLINE_HEURISTICS, /* tv_id */
+ 0, /* properties_required */
+ PROP_cfg, /* properties_provided */
+ 0, /* properties_destroyed */
+ TODO_remove_functions, /* todo_flags_finish */
+ TODO_dump_cgraph | TODO_dump_func
+ | TODO_remove_functions /* todo_flags_finish */
+ },
+ inline_generate_summary, /* function_generate_summary */
+ NULL, /* variable_generate_summary */
+ NULL, /* function_write_summary */
+ NULL, /* variable_write_summary */
+ NULL, /* function_read_summary */
+ NULL, /* variable_read_summary */
+ 0, /* TODOs */
+ inline_transform, /* function_transform */
+ NULL, /* variable_transform */
+};
+
+
+/* When inlining shall be performed. */
+static bool
+cgraph_gate_O0_always_inline (void)
+{
+ return !flag_unit_at_a_time || !flag_inline_trees;
+}
+
+static unsigned int
+cgraph_O0_always_inline (void)
+{
+ struct cgraph_node *node = cgraph_node (current_function_decl);
+ unsigned int todo = 0;
+ bool inlined;
+
+ if (sorrycount || errorcount)
+ return 0;
+ inlined = cgraph_decide_inlining_incrementally (node, INLINE_SPEED, 0);
+ /* We might need the body of this function so that we can expand
+ it inline somewhere else. */
+ if (cgraph_preserve_function_body_p (current_function_decl))
+ save_inline_function_body (node);
+ if (inlined || warn_inline)
+ {
+ timevar_push (TV_INTEGRATION);
+ todo = optimize_inline_calls (current_function_decl);
+ timevar_pop (TV_INTEGRATION);
+ }
/* In non-unit-at-a-time we must mark all referenced functions as needed. */
if (!flag_unit_at_a_time)
{
@@ -1617,13 +1659,13 @@ apply_inline (void)
return todo | execute_fixup_cfg ();
}
-struct gimple_opt_pass pass_apply_inline =
+struct gimple_opt_pass pass_O0_always_inline =
{
{
GIMPLE_PASS,
- "apply_inline", /* name */
- NULL, /* gate */
- apply_inline, /* execute */
+ "always_inline", /* name */
+ cgraph_gate_O0_always_inline, /* gate */
+ cgraph_O0_always_inline, /* execute */
NULL, /* sub */
NULL, /* next */
0, /* static_pass_number */
diff --git a/gcc/ipa-prop.c b/gcc/ipa-prop.c
index 76e2d3b7b50..f0403634c10 100644
--- a/gcc/ipa-prop.c
+++ b/gcc/ipa-prop.c
@@ -31,197 +31,88 @@ along with GCC; see the file COPYING3. If not see
#include "flags.h"
#include "timevar.h"
-/* This file contains interfaces that can be used for various IPA
- optimizations:
-
- - ipa_methodlist interface - It is used to create and handle a temporary
- worklist used in the propagation stage of IPCP. (can be used for more
- IPA optimizations).
-
- - ipa_callsite interface - for each callsite this interface creates and
- handles ipa_edge structure associated with it.
-
- - ipa_method interface - for each method this interface creates and
- handles ipa_node structure associated with it. */
-
-/* ipa_methodlist interface. */
-
-/* Create a new worklist node. */
-static inline ipa_methodlist_p
-ipa_create_methodlist_node (void)
-{
- return (ipa_methodlist_p) xcalloc (1, sizeof (struct ipa_methodlist));
-}
-
-/* Return true if worklist WL is empty. */
-bool
-ipa_methodlist_not_empty (ipa_methodlist_p wl)
-{
- return (wl != NULL);
-}
-
-/* Return the method in worklist element WL. */
-static inline struct cgraph_node *
-ipa_methodlist_method (ipa_methodlist_p wl)
-{
- return wl->method_p;
-}
-
-/* Make worklist element WL point to method MT in the callgraph. */
-static inline void
-ipa_methodlist_method_set (ipa_methodlist_p wl, struct cgraph_node *mt)
-{
- wl->method_p = mt;
-}
-
-/* Return the next element in the worklist following worklist
- element WL. */
-static inline ipa_methodlist_p
-ipa_methodlist_next_method (ipa_methodlist_p wl)
-{
- return wl->next_method;
-}
-
-/* Set worklist element WL1 to point to worklist element WL2. */
-static inline void
-ipa_methodlist_next_method_set (ipa_methodlist_p wl1, ipa_methodlist_p wl2)
-{
- wl1->next_method = wl2;
-}
-
-/* Initialize worklist to contain all methods. */
-ipa_methodlist_p
-ipa_methodlist_init (void)
+/* Initialize worklist to contain all functions. */
+struct ipa_func_list *
+ipa_init_func_list (void)
{
struct cgraph_node *node;
- ipa_methodlist_p wl;
+ struct ipa_func_list * wl;
wl = NULL;
for (node = cgraph_nodes; node; node = node->next)
- ipa_add_method (&wl, node);
+ ipa_push_func_to_list (&wl, node);
return wl;
}
-/* Add method MT to the worklist. Set worklist element WL
+/* Add cgraph node MT to the worklist. Set worklist element WL
to point to MT. */
void
-ipa_add_method (ipa_methodlist_p * wl, struct cgraph_node *mt)
+ipa_push_func_to_list (struct ipa_func_list **wl, struct cgraph_node *mt)
{
- ipa_methodlist_p temp;
+ struct ipa_func_list *temp;
- temp = ipa_create_methodlist_node ();
- ipa_methodlist_method_set (temp, mt);
- ipa_methodlist_next_method_set (temp, *wl);
+ temp = xcalloc (1, sizeof (struct ipa_func_list));
+ temp->node = mt;
+ temp->next = *wl;
*wl = temp;
}
-/* Remove a method from the worklist. WL points to the first
+/* Remove a function from the worklist. WL points to the first
element in the list, which is removed. */
struct cgraph_node *
-ipa_remove_method (ipa_methodlist_p * wl)
+ipa_pop_func_from_list (struct ipa_func_list ** wl)
{
- ipa_methodlist_p first;
- struct cgraph_node *return_method;
+ struct ipa_func_list *first;
+ struct cgraph_node *return_func;
first = *wl;
- *wl = ipa_methodlist_next_method (*wl);
- return_method = ipa_methodlist_method (first);
+ *wl = (*wl)->next;
+ return_func = first->node;
free (first);
- return return_method;
-}
-
-/* ipa_method interface. */
-
-/* Return number of formals of method MT. */
-int
-ipa_method_formal_count (struct cgraph_node *mt)
-{
- return IPA_NODE_REF (mt)->ipa_arg_num;
-}
-
-/* Set number of formals of method MT to I. */
-void
-ipa_method_formal_count_set (struct cgraph_node *mt, int i)
-{
- IPA_NODE_REF (mt)->ipa_arg_num = i;
-}
-
-/* Return whether I-th formal of MT is modified in MT. */
-static inline bool
-ipa_method_is_modified (struct cgraph_node *mt, int i)
-{
- return IPA_NODE_REF (mt)->ipa_mod[i];
-}
-
-/* Return the tree of I-th formal of MT. */
-tree
-ipa_method_get_tree (struct cgraph_node *mt, int i)
-{
- return IPA_NODE_REF (mt)->ipa_param_tree[i];
+ return return_func;
}
-/* Create tree map structure for MT. */
-static inline void
-ipa_method_tree_map_create (struct cgraph_node *mt)
-{
- IPA_NODE_REF (mt)->ipa_param_tree =
- XCNEWVEC (tree, ipa_method_formal_count (mt));
-}
-
-/* Create modify structure for MT. */
-static inline void
-ipa_method_modify_create (struct cgraph_node *mt)
-{
- ((struct ipa_node *) mt->aux)->ipa_mod =
- XCNEWVEC (bool, ipa_method_formal_count (mt));
-}
-
-/* Set modify of I-th formal of MT to VAL. */
-static inline void
-ipa_method_modify_set (struct cgraph_node *mt, int i, bool val)
-{
- IPA_NODE_REF (mt)->ipa_mod[i] = val;
-}
-
-/* Return index of the formal whose tree is PTREE in method MT. */
+/* Return index of the formal whose tree is ptree in function which corresponds
+ to info. */
static int
-ipa_method_tree_map (struct cgraph_node *mt, tree ptree)
+ipa_get_param_decl_index (struct ipa_node_params *info, tree ptree)
{
int i, count;
- count = ipa_method_formal_count (mt);
+ count = ipa_get_param_count (info);
for (i = 0; i < count; i++)
- if (IPA_NODE_REF (mt)->ipa_param_tree[i] == ptree)
+ if (ipa_get_ith_param(info, i) == ptree)
return i;
return -1;
}
-/* Insert the formal trees to the ipa_param_tree array in method MT. */
+/* Insert the formal trees to the param_decls array in function MT. */
void
-ipa_method_compute_tree_map (struct cgraph_node *mt)
+ipa_create_param_decls_array (struct cgraph_node *mt)
{
tree fndecl;
tree fnargs;
tree parm;
int param_num;
+ struct ipa_node_params *info = IPA_NODE_REF (mt);
- ipa_method_tree_map_create (mt);
+ info->param_decls = XCNEWVEC (tree, ipa_get_param_count (info));
fndecl = mt->decl;
fnargs = DECL_ARGUMENTS (fndecl);
param_num = 0;
for (parm = fnargs; parm; parm = TREE_CHAIN (parm))
{
- IPA_NODE_REF (mt)->ipa_param_tree[param_num] = parm;
+ info->param_decls[param_num] = parm;
param_num++;
}
}
/* Count number of formals in MT. Insert the result to the
- ipa_node. */
+ ipa_node_params. */
void
-ipa_method_formal_compute_count (struct cgraph_node *mt)
+ipa_count_formal_params (struct cgraph_node *mt)
{
tree fndecl;
tree fnargs;
@@ -233,57 +124,48 @@ ipa_method_formal_compute_count (struct cgraph_node *mt)
param_num = 0;
for (parm = fnargs; parm; parm = TREE_CHAIN (parm))
param_num++;
- ipa_method_formal_count_set (mt, param_num);
+ ipa_set_param_count (IPA_NODE_REF (mt), param_num);
}
-/* Check STMT to detect whether a formal is modified within MT,
- the appropriate entry is updated in the ipa_mod array of ipa_node
- (associated with MT). */
+/* Check STMT to detect whether a formal is modified within MT, the appropriate
+ entry is updated in the modified_flags array of ipa_node_params (associated
+ with MT). */
static void
-ipa_method_modify_stmt (struct cgraph_node *mt, tree stmt)
+ipa_check_stmt_modifications (struct cgraph_node *mt, tree stmt)
{
- int i, j;
+ int index, j;
tree parm_decl;
+ struct ipa_node_params *info;
switch (TREE_CODE (stmt))
{
case GIMPLE_MODIFY_STMT:
if (TREE_CODE (GIMPLE_STMT_OPERAND (stmt, 0)) == PARM_DECL)
{
+ info = IPA_NODE_REF (mt);
parm_decl = GIMPLE_STMT_OPERAND (stmt, 0);
- i = ipa_method_tree_map (mt, parm_decl);
- if (i >= 0)
- ipa_method_modify_set (mt, i, true);
+ index = ipa_get_param_decl_index (info, parm_decl);
+ if (index >= 0)
+ info->modified_flags[index] = true;
}
break;
case ASM_EXPR:
/* Asm code could modify any of the parameters. */
- for (j = 0; j < ipa_method_formal_count (mt); j++)
- ipa_method_modify_set (mt, j, true);
+ info = IPA_NODE_REF (mt);
+ for (j = 0; j < ipa_get_param_count (IPA_NODE_REF (mt)); j++)
+ info->modified_flags[j] = true;
break;
default:
break;
}
}
-/* Initialize ipa_mod array of MT. */
-static void
-ipa_method_modify_init (struct cgraph_node *mt)
-{
- int i, count;
-
- ipa_method_modify_create (mt);
- count = ipa_method_formal_count (mt);
- for (i = 0; i < count; i++)
- ipa_method_modify_set (mt, i, false);
-}
-
/* The modify computation driver for MT. Compute which formal arguments
- of method MT are locally modified. Formals may be modified in MT
+ of function MT are locally modified. Formals may be modified in MT
if their address is taken, or if
they appear on the left hand side of an assignment. */
void
-ipa_method_compute_modify (struct cgraph_node *mt)
+ipa_detect_param_modifications (struct cgraph_node *mt)
{
tree decl;
tree body;
@@ -292,29 +174,31 @@ ipa_method_compute_modify (struct cgraph_node *mt)
struct function *func;
block_stmt_iterator bsi;
tree stmt, parm_tree;
+ struct ipa_node_params *info = IPA_NODE_REF (mt);
- if (ipa_method_formal_count (mt) == 0)
+ if (ipa_get_param_count (info) == 0)
return;
- ipa_method_modify_init (mt);
+ count = ipa_get_param_count (info);
+ info->modified_flags = XCNEWVEC (bool, count);
decl = mt->decl;
- count = ipa_method_formal_count (mt);
/* ??? Handle pending sizes case. Set all parameters
- of the method to be modified. */
+ of the function to be modified. */
if (DECL_UNINLINABLE (decl))
{
for (j = 0; j < count; j++)
- ipa_method_modify_set (mt, j, true);
+ info->modified_flags[j] = true;
+
return;
}
/* Formals whose address is taken are considered modified. */
for (j = 0; j < count; j++)
{
- parm_tree = ipa_method_get_tree (mt, j);
+ parm_tree = ipa_get_ith_param (info, j);
if (!is_gimple_reg (parm_tree)
&& TREE_ADDRESSABLE (parm_tree))
- ipa_method_modify_set (mt, j, true);
+ info->modified_flags[j] = true;
}
body = DECL_SAVED_TREE (decl);
if (body != NULL)
@@ -325,171 +209,94 @@ ipa_method_compute_modify (struct cgraph_node *mt)
for (bsi = bsi_start (bb); !bsi_end_p (bsi); bsi_next (&bsi))
{
stmt = bsi_stmt (bsi);
- ipa_method_modify_stmt (mt, stmt);
+ ipa_check_stmt_modifications (mt, stmt);
}
}
}
}
-
-/* ipa_callsite interface. */
-
-/* Return number of arguments in callsite CS. */
-int
-ipa_callsite_param_count (struct cgraph_edge *cs)
-{
- return IPA_EDGE_REF (cs)->ipa_param_num;
-}
-
-/* Set number of arguments in callsite CS to I. */
-void
-ipa_callsite_param_count_set (struct cgraph_edge *cs, int i)
-{
- IPA_EDGE_REF (cs)->ipa_param_num = i;
-}
-
-/* Return the jump function (ipa_jump_func struct) for argument I of
- callsite CS. */
-struct ipa_jump_func *
-ipa_callsite_param (struct cgraph_edge *cs, int i)
-{
- return &(IPA_EDGE_REF (cs)->ipa_param_map[i]);
-}
-
-/* return the callee (cgraph_node) of callsite CS. */
-struct cgraph_node *
-ipa_callsite_callee (struct cgraph_edge *cs)
-{
- return cs->callee;
-}
-
-/* Set field 'type' of jump function (ipa_jump_func struct) of argument I
- in callsite CS. */
-static inline void
-ipa_callsite_param_set_type (struct cgraph_edge *cs, int i,
- enum jump_func_type type1)
-{
- IPA_EDGE_REF (cs)->ipa_param_map[i].type = type1;
-}
-
-/* Set FORMAL as 'info_type' field of jump function (ipa_jump_func struct)
- of argument I of callsite CS. */
-static inline void
-ipa_callsite_param_set_info_type_formal (struct cgraph_edge *cs, int i,
- unsigned int formal)
-{
- ipa_callsite_param (cs, i)->info_type.formal_id = formal;
-}
-
-/* Set int-valued INFO_TYPE1 as 'info_type' field of
- jump function (ipa_jump_func struct) of argument I of callsite CS. */
-static inline void
-ipa_callsite_param_set_info_type (struct cgraph_edge *cs, int i,
- tree info_type1)
-{
- ipa_callsite_param (cs, i)->info_type.value = info_type1;
-}
-
-/* Allocate space for callsite CS. */
-static inline void
-ipa_callsite_param_map_create (struct cgraph_edge *cs)
-{
- IPA_EDGE_REF (cs)->ipa_param_map =
- XCNEWVEC (struct ipa_jump_func, ipa_callsite_param_count (cs));
-}
-
-/* Return the call expr tree related to callsite CS. */
-static inline tree
-ipa_callsite_tree (struct cgraph_edge *cs)
-{
- return cs->call_stmt;
-}
-
-/* Return the caller (cgraph_node) of CS. */
-static inline struct cgraph_node *
-ipa_callsite_caller (struct cgraph_edge *cs)
-{
- return cs->caller;
-}
-
/* Count number of arguments callsite CS has and store it in
- ipa_edge structure corresponding to this callsite. */
+ ipa_edge_args structure corresponding to this callsite. */
void
-ipa_callsite_compute_count (struct cgraph_edge *cs)
+ipa_count_arguments (struct cgraph_edge *cs)
{
tree call_tree;
int arg_num;
- call_tree = get_call_expr_in (ipa_callsite_tree (cs));
+ call_tree = get_call_expr_in (cs->call_stmt);
gcc_assert (TREE_CODE (call_tree) == CALL_EXPR);
arg_num = call_expr_nargs (call_tree);
- ipa_callsite_param_count_set (cs, arg_num);
+ ipa_set_cs_argument_count (IPA_EDGE_REF (cs), arg_num);
}
/* Compute jump function for all arguments of callsite CS
- and insert the information in the ipa_param_map array
- in the ipa_edge corresponding to this callsite. (Explanation
- on jump functions is in ipa-prop.h). */
+ and insert the information in the jump_functions array
+ in the ipa_edge_args corresponding to this callsite. */
void
-ipa_callsite_compute_param (struct cgraph_edge *cs)
+ipa_compute_jump_functions (struct cgraph_edge *cs)
{
tree call_tree;
tree arg, cst_decl;
int arg_num;
- int i;
struct cgraph_node *mt;
tree parm_decl;
struct function *curr_cfun;
call_expr_arg_iterator iter;
+ struct ipa_edge_args *args = IPA_EDGE_REF (cs);
- if (ipa_callsite_param_count (cs) == 0)
+ if (ipa_get_cs_argument_count (args) == 0)
return;
- ipa_callsite_param_map_create (cs);
- call_tree = get_call_expr_in (ipa_callsite_tree (cs));
+ args->jump_functions = XCNEWVEC (struct ipa_jump_func,
+ ipa_get_cs_argument_count (args));
+ call_tree = get_call_expr_in (cs->call_stmt);
gcc_assert (TREE_CODE (call_tree) == CALL_EXPR);
arg_num = 0;
FOR_EACH_CALL_EXPR_ARG (arg, iter, call_tree)
{
/* If the formal parameter was passed as argument, we store
- FORMAL_IPATYPE and its index in the caller as the jump function
+ IPA_PASS_THROUGH and its index in the caller as the jump function
of this argument. */
if ((TREE_CODE (arg) == SSA_NAME
&& TREE_CODE (SSA_NAME_VAR (arg)) == PARM_DECL)
|| TREE_CODE (arg) == PARM_DECL)
{
- mt = ipa_callsite_caller (cs);
+ struct ipa_node_params *info;
+ int index;
+
+ mt = cs->caller;
+ info = IPA_NODE_REF (mt);
parm_decl = TREE_CODE (arg) == PARM_DECL ? arg : SSA_NAME_VAR (arg);
- i = ipa_method_tree_map (mt, parm_decl);
- if (TREE_CODE (arg) == SSA_NAME && IS_VALID_TREE_MAP_INDEX (i))
+ index = ipa_get_param_decl_index (info, parm_decl);
+ if (TREE_CODE (arg) == SSA_NAME && IS_VALID_JUMP_FUNC_INDEX (index))
{
curr_cfun = DECL_STRUCT_FUNCTION (mt->decl);
if (!gimple_default_def (curr_cfun, parm_decl)
|| gimple_default_def (curr_cfun, parm_decl) != arg)
- ipa_method_modify_set (mt, i, true);
+ info->modified_flags[index] = true;
}
- if (!IS_VALID_TREE_MAP_INDEX (i) || ipa_method_is_modified (mt, i))
- ipa_callsite_param_set_type (cs, arg_num, UNKNOWN_IPATYPE);
+ if (!IS_VALID_JUMP_FUNC_INDEX (index) || info->modified_flags[index])
+ args->jump_functions[arg_num].type = IPA_UNKNOWN;
else
{
- ipa_callsite_param_set_type (cs, arg_num, FORMAL_IPATYPE);
- ipa_callsite_param_set_info_type_formal (cs, arg_num, i);
+ args->jump_functions[arg_num].type = IPA_PASS_THROUGH;
+ args->jump_functions[arg_num].value.formal_id = index;
}
}
/* If a constant value was passed as argument,
- we store CONST_IPATYPE and its value as the jump function
+ we store IPA_CONST and its value as the jump function
of this argument. */
else if (TREE_CODE (arg) == INTEGER_CST
|| TREE_CODE (arg) == REAL_CST
|| TREE_CODE (arg) == FIXED_CST)
{
- ipa_callsite_param_set_type (cs, arg_num, CONST_IPATYPE);
- ipa_callsite_param_set_info_type (cs, arg_num, arg);
+ args->jump_functions[arg_num].type = IPA_CONST;
+ args->jump_functions[arg_num].value.constant = arg;
}
/* This is for the case of Fortran. If the address of a const_decl
- was passed as argument then we store
- CONST_IPATYPE_REF/CONST_IPATYPE_REF and the constant
+ was passed as argument then we store
+ IPA_CONST_REF/IPA_CONST_REF and the constant
value as the jump function corresponding to this argument. */
else if (TREE_CODE (arg) == ADDR_EXPR
&& TREE_CODE (TREE_OPERAND (arg, 0)) == CONST_DECL)
@@ -499,121 +306,90 @@ ipa_callsite_compute_param (struct cgraph_edge *cs)
|| TREE_CODE (DECL_INITIAL (cst_decl)) == REAL_CST
|| TREE_CODE (DECL_INITIAL (cst_decl)) == FIXED_CST)
{
- ipa_callsite_param_set_type (cs, arg_num,
- CONST_IPATYPE_REF);
- ipa_callsite_param_set_info_type (cs, arg_num,
- DECL_INITIAL (cst_decl));
+ args->jump_functions[arg_num].type = IPA_CONST_REF;
+ args->jump_functions[arg_num].value.constant = cst_decl;
}
}
else
- ipa_callsite_param_set_type (cs, arg_num, UNKNOWN_IPATYPE);
+ args->jump_functions[arg_num].type = IPA_UNKNOWN;
arg_num++;
}
}
-/* Return type of jump function JF. */
-enum jump_func_type
-get_type (struct ipa_jump_func *jf)
-{
- return jf->type;
-}
-
-/* Return info type of jump function JF. */
-union parameter_info *
-ipa_jf_get_info_type (struct ipa_jump_func *jf)
-{
- return &(jf->info_type);
-}
-
-/* Allocate and initialize ipa_node structure.
- cgraph_node NODE points to the new allocated ipa_node. */
+/* Allocate and initialize ipa_node_params structure for the given cgraph
+ node. */
void
-ipa_node_create (struct cgraph_node *node)
+ipa_create_node_params (struct cgraph_node *node)
{
- node->aux = xcalloc (1, sizeof (struct ipa_node));
+ node->aux = xcalloc (1, sizeof (struct ipa_node_params));
}
-/* Allocate and initialize ipa_node structure for all
+/* Allocate and initialize ipa_node_params structure for all
nodes in callgraph. */
void
-ipa_nodes_create (void)
+ipa_create_all_node_params (void)
{
struct cgraph_node *node;
for (node = cgraph_nodes; node; node = node->next)
- ipa_node_create (node);
+ ipa_create_node_params (node);
}
/* Allocate and initialize ipa_edge structure. */
void
-ipa_edges_create (void)
+ipa_create_all_edge_args (void)
{
struct cgraph_node *node;
struct cgraph_edge *cs;
for (node = cgraph_nodes; node; node = node->next)
for (cs = node->callees; cs; cs = cs->next_callee)
- cs->aux = xcalloc (1, sizeof (struct ipa_edge));
-}
-
-/* Free ipa_node structure. */
-void
-ipa_nodes_free (void)
-{
- struct cgraph_node *node;
-
- for (node = cgraph_nodes; node; node = node->next)
- {
- free (node->aux);
- node->aux = NULL;
- }
+ cs->aux = xcalloc (1, sizeof (struct ipa_edge_args));
}
/* Free ipa_edge structure. */
void
-ipa_edges_free (void)
+ipa_free_all_edge_args (void)
{
struct cgraph_node *node;
struct cgraph_edge *cs;
for (node = cgraph_nodes; node; node = node->next)
for (cs = node->callees; cs; cs = cs->next_callee)
- {
- free (cs->aux);
- cs->aux = NULL;
- }
+ if (cs->aux)
+ {
+ if (IPA_EDGE_REF (cs)->jump_functions)
+ free (IPA_EDGE_REF (cs)->jump_functions);
+ free (cs->aux);
+ cs->aux = NULL;
+ }
}
-/* Free ipa data structures of ipa_node and ipa_edge. */
+/* Free ipa data structures of ipa_node_params and ipa_edge_args. */
void
-ipa_free (void)
+ipa_free_all_node_params (void)
{
struct cgraph_node *node;
- struct cgraph_edge *cs;
for (node = cgraph_nodes; node; node = node->next)
{
if (node->aux == NULL)
continue;
- if (IPA_NODE_REF (node)->ipcp_cval)
- free (IPA_NODE_REF (node)->ipcp_cval);
- if (IPA_NODE_REF (node)->ipa_param_tree)
- free (IPA_NODE_REF (node)->ipa_param_tree);
- if (IPA_NODE_REF (node)->ipa_mod)
- free (IPA_NODE_REF (node)->ipa_mod);
- for (cs = node->callees; cs; cs = cs->next_callee)
- {
- if (cs->aux)
- if (IPA_EDGE_REF (cs)->ipa_param_map)
- free (IPA_EDGE_REF (cs)->ipa_param_map);
- }
+ if (IPA_NODE_REF (node)->ipcp_lattices)
+ free (IPA_NODE_REF (node)->ipcp_lattices);
+ if (IPA_NODE_REF (node)->param_decls)
+ free (IPA_NODE_REF (node)->param_decls);
+ if (IPA_NODE_REF (node)->modified_flags)
+ free (IPA_NODE_REF (node)->modified_flags);
+ free (node->aux);
+ node->aux = NULL;
}
}
-/* Print ipa_tree_map data structures of all methods in the
+/* Print ipa_tree_map data structures of all functions in the
callgraph to F. */
void
-ipa_method_tree_print (FILE * f)
+ipa_print_all_tree_maps (FILE * f)
{
int i, count;
tree temp;
@@ -622,11 +398,12 @@ ipa_method_tree_print (FILE * f)
fprintf (f, "\nPARAM TREE MAP PRINT\n");
for (node = cgraph_nodes; node; node = node->next)
{
- fprintf (f, "method %s Trees :: \n", cgraph_node_name (node));
- count = ipa_method_formal_count (node);
+ struct ipa_node_params *info = IPA_NODE_REF (node);
+ fprintf (f, "function %s Trees :: \n", cgraph_node_name (node));
+ count = ipa_get_param_count (info);
for (i = 0; i < count; i++)
{
- temp = ipa_method_get_tree (node, i);
+ temp = ipa_get_ith_param (info, i);
if (TREE_CODE (temp) == PARM_DECL)
fprintf (f, " param [%d] : %s\n", i,
(*lang_hooks.decl_printable_name) (temp, 2));
@@ -635,10 +412,10 @@ ipa_method_tree_print (FILE * f)
}
}
-/* Print ipa_modify data structures of all methods in the
+/* Print modified_flags data structures of all functions in the
callgraph to F. */
void
-ipa_method_modify_print (FILE * f)
+ipa_print_all_params_modified (FILE * f)
{
int i, count;
bool temp;
@@ -647,11 +424,12 @@ ipa_method_modify_print (FILE * f)
fprintf (f, "\nMODIFY PRINT\n");
for (node = cgraph_nodes; node; node = node->next)
{
- fprintf (f, "method %s :: \n", cgraph_node_name (node));
- count = ipa_method_formal_count (node);
+ struct ipa_node_params *info = IPA_NODE_REF (node);
+ fprintf (f, "function %s :: \n", cgraph_node_name (node));
+ count = ipa_get_param_count (info);
for (i = 0; i < count; i++)
{
- temp = ipa_method_is_modified (node, i);
+ temp = info->modified_flags[i];
if (temp)
fprintf (f, " param [%d] true \n", i);
else
@@ -659,3 +437,4 @@ ipa_method_modify_print (FILE * f)
}
}
}
+
diff --git a/gcc/ipa-prop.h b/gcc/ipa-prop.h
index 3731dc9d5ff..3be7502ae8c 100644
--- a/gcc/ipa-prop.h
+++ b/gcc/ipa-prop.h
@@ -30,43 +30,42 @@ along with GCC; see the file COPYING3. If not see
Formal - the caller's formal parameter is passed as an actual argument.
Constant - a constant is passed as an actual argument.
Unknown - neither of the above.
- Integer and real constants are represented as CONST_IPATYPE and Fortran
- constants are represented as CONST_IPATYPE_REF. */
+ Integer and real constants are represented as IPA_CONST and Fortran
+ constants are represented as IPA_CONST_REF. */
enum jump_func_type
{
- UNKNOWN_IPATYPE,
- CONST_IPATYPE,
- CONST_IPATYPE_REF,
- FORMAL_IPATYPE
+ IPA_UNKNOWN,
+ IPA_CONST,
+ IPA_CONST_REF,
+ IPA_PASS_THROUGH
};
-/* All formal parameters in the program have a cval computed by
- the interprocedural stage of IPCP.
- There are three main values of cval :
+/* All formal parameters in the program have a lattice associated with it
+ computed by the interprocedural stage of IPCP.
+ There are three main values of the lattice:
TOP - unknown.
BOTTOM - non constant.
CONSTANT_TYPE - constant value.
Cval of formal f will have a constant value if all callsites to this
function have the same constant value passed to f.
- Integer and real constants are represented as CONST_IPATYPE and Fortran
- constants are represented as CONST_IPATYPE_REF. */
-enum cvalue_type
-{
- BOTTOM,
- CONST_VALUE,
- CONST_VALUE_REF,
- TOP
+ Integer and real constants are represented as IPA_CONST and Fortran
+ constants are represented as IPA_CONST_REF. */
+enum ipa_lattice_type
+{
+ IPA_BOTTOM,
+ IPA_CONST_VALUE,
+ IPA_CONST_VALUE_REF,
+ IPA_TOP
};
-/* Represents the value of either jump function or cval.
+/* Represents a value of a jump function.
value represents a constant.
formal_id is used only in jump function context and represents
- pass-through parameter (the formal of caller is passed
- as argument). */
-union parameter_info
+ pass-through parameter (the formal of caller is passed as argument). */
+union jump_func_value
{
unsigned int formal_id;
- tree value;
+ tree constant;
};
/* A jump function for a callsite represents the values passed as actual
@@ -75,16 +74,16 @@ union parameter_info
struct ipa_jump_func
{
enum jump_func_type type;
- union parameter_info info_type;
+ union jump_func_value value;
};
/* All formal parameters in the program have a cval computed by
- the interprocedural stage of IPCP. See enum cvalue_type for
- the various types of cvals supported */
-struct ipcp_formal
+ the interprocedural stage of IPCP. See enum ipa_lattice_type for
+ the various types of lattices supported */
+struct ipcp_lattice
{
- enum cvalue_type cval_type;
- union parameter_info cvalue;
+ enum ipa_lattice_type type;
+ tree constant;
};
/* Represent which DECL tree (or reference to such tree)
@@ -102,103 +101,165 @@ struct ipa_replace_map
};
/* Return the field in cgraph_node/cgraph_edge struct that points
- to ipa_node/ipa_edge struct. */
-#define IPA_NODE_REF(MT) ((struct ipa_node *)(MT)->aux)
-#define IPA_EDGE_REF(EDGE) ((struct ipa_edge *)(EDGE)->aux)
+ to ipa_node_params/ipa_edge_args struct. */
+#define IPA_NODE_REF(MT) ((struct ipa_node_params *)(MT)->aux)
+#define IPA_EDGE_REF(EDGE) ((struct ipa_edge_args *)(EDGE)->aux)
/* This macro checks validity of index returned by
- ipa_method_tree_map function. */
-#define IS_VALID_TREE_MAP_INDEX(I) ((I) != -1)
+ ipa_get_param_decl_index function. */
+#define IS_VALID_JUMP_FUNC_INDEX(I) ((I) != -1)
-/* ipa_node stores information related to a method and
- its formal parameters. It is pointed to by a field in the
- method's corresponding cgraph_node.
+/* ipa_node_params stores information related to formal parameters of functions
+ and some other information for interprocedural passes that operate on
+ parameters (such as ipa-cp). */
- ipa_edge stores information related to a callsite and
- its arguments. It is pointed to by a field in the
- callsite's corresponding cgraph_edge. */
-struct ipa_node
+struct ipa_node_params
{
- /* Number of formal parameters of this method. When set to 0,
- this method's parameters would not be analyzed by the different
+ /* Number of formal parameters of this function. When set to 0,
+ this functions's parameters would not be analyzed by the different
stages of IPA CP. */
- int ipa_arg_num;
- /* Array of cvals. */
- struct ipcp_formal *ipcp_cval;
+ int param_count;
+ /* Array of lattices. */
+ struct ipcp_lattice *ipcp_lattices;
/* Mapping each parameter to its PARM_DECL tree. */
- tree *ipa_param_tree;
- /* Indicating which parameter is modified in its method. */
- bool *ipa_mod;
+ tree *param_decls;
+ /* Indicating which parameter is modified in its function. */
+ bool *modified_flags;
/* Only for versioned nodes this field would not be NULL,
it points to the node that IPA cp cloned from. */
struct cgraph_node *ipcp_orig_node;
- /* Meaningful only for original methods. Expresses the
+ /* Meaningful only for original functions. Expresses the
ratio between the direct calls and sum of all invocations of
this function (given by profiling info). It is used to calculate
the profiling information of the original function and the versioned
one. */
gcov_type count_scale;
+
+ /* Whether this fynction is called with variable number of actual
+ arguments. */
+ unsigned called_with_var_arguments : 1;
};
-struct ipa_edge
+/* ipa_node_params access functions. Please use these to access fields that
+ are or will be shared among various passes. */
+
+/* Set the number of formal parameters. */
+static inline void
+ipa_set_param_count (struct ipa_node_params *info, int count)
+{
+ info->param_count = count;
+}
+
+/* Return the number of formal parameters. */
+static inline int
+ipa_get_param_count (struct ipa_node_params *info)
+{
+ return info->param_count;
+}
+
+/* Returns the declaration of ith param of the corresponding node. Note there
+ is no setter function as this array is built just once using
+ ipa_create_param_decls_array. */
+static inline tree
+ipa_get_ith_param (struct ipa_node_params *info, int i)
+{
+ return info->param_decls[i];
+}
+
+/* Returns the modification flag corresponding o the ith paramterer. Note
+ there is no setter method as the goal is to set all flags when building the
+ array in ipa_detect_param_modifications. */
+static inline bool
+ipa_is_ith_param_modified (struct ipa_node_params *info, int i)
+{
+ return info->modified_flags[i];
+}
+
+/* Flag this node as having callers with variable number of arguments. */
+static inline void
+ipa_set_called_with_variable_arg (struct ipa_node_params *info)
+{
+ info->called_with_var_arguments = 1;
+}
+
+/* Have we detected this node was called with variable number of arguments? */
+static inline bool
+ipa_is_called_with_var_arguments (struct ipa_node_params *info)
+{
+ return info->called_with_var_arguments;
+}
+
+
+
+/* ipa_edge_args stores information related to a callsite and particularly
+ its arguments. It is pointed to by a field in the
+ callsite's corresponding cgraph_edge. */
+struct ipa_edge_args
{
/* Number of actual arguments in this callsite. When set to 0,
this callsite's parameters would not be analyzed by the different
stages of IPA CP. */
- int ipa_param_num;
+ int argument_count;
/* Array of the callsite's jump function of each parameter. */
- struct ipa_jump_func *ipa_param_map;
+ struct ipa_jump_func *jump_functions;
};
-/* A methodlist element (referred to also as methodlist node). It is used
- to create a temporary worklist used in
- the propagation stage of IPCP. (can be used for more IPA
- optimizations) */
-struct ipa_methodlist
+/* ipa_edge_args access functions. Please use these to access fields that
+ are or will be shared among various passes. */
+
+/* Set the number of actual arguments. */
+static inline void
+ipa_set_cs_argument_count (struct ipa_edge_args *args, int count)
{
- struct cgraph_node *method_p;
- struct ipa_methodlist *next_method;
+ args->argument_count = count;
+}
+
+/* Return the number of actual arguments. */
+static inline int
+ipa_get_cs_argument_count (struct ipa_edge_args *args)
+{
+ return args->argument_count;
+}
+
+/* Returns a pointer to the jump function for the ith argument. Please note
+ there is no setter function as jump functions are all set up in
+ ipa_compute_jump_functions. */
+static inline struct ipa_jump_func *
+ipa_get_ith_jump_func (struct ipa_edge_args *args, int i)
+{
+ return &args->jump_functions[i];
+}
+
+/* A function list element. It is used to create a temporary worklist used in
+ the propagation stage of IPCP. (can be used for more IPA optimizations) */
+struct ipa_func_list
+{
+ struct cgraph_node *node;
+ struct ipa_func_list *next;
};
-/* A pointer to a methodlist element. */
-typedef struct ipa_methodlist *ipa_methodlist_p;
-
-/* ipa_methodlist interface. */
-ipa_methodlist_p ipa_methodlist_init (void);
-bool ipa_methodlist_not_empty (ipa_methodlist_p);
-void ipa_add_method (ipa_methodlist_p *, struct cgraph_node *);
-struct cgraph_node *ipa_remove_method (ipa_methodlist_p *);
-
-/* ipa_callsite interface. */
-int ipa_callsite_param_count (struct cgraph_edge *);
-void ipa_callsite_param_count_set (struct cgraph_edge *, int);
-struct ipa_jump_func *ipa_callsite_param (struct cgraph_edge *, int);
-struct cgraph_node *ipa_callsite_callee (struct cgraph_edge *);
-void ipa_callsite_compute_param (struct cgraph_edge *);
-void ipa_callsite_compute_count (struct cgraph_edge *);
-
-/* ipa_method interface. */
-int ipa_method_formal_count (struct cgraph_node *);
-void ipa_method_formal_count_set (struct cgraph_node *, int);
-tree ipa_method_get_tree (struct cgraph_node *, int);
-void ipa_method_compute_tree_map (struct cgraph_node *);
-void ipa_method_formal_compute_count (struct cgraph_node *);
-void ipa_method_compute_modify (struct cgraph_node *);
-
-/* jump function interface. */
-enum jump_func_type get_type (struct ipa_jump_func *);
-union parameter_info *ipa_jf_get_info_type (struct ipa_jump_func *);
-
-/* ipa_node and ipa_edge interfaces. */
-void ipa_node_create (struct cgraph_node *);
-void ipa_free (void);
-void ipa_nodes_create (void);
-void ipa_edges_create (void);
-void ipa_edges_free (void);
-void ipa_nodes_free (void);
+/* ipa_func_list interface. */
+struct ipa_func_list *ipa_init_func_list (void);
+void ipa_push_func_to_list (struct ipa_func_list **, struct cgraph_node *);
+struct cgraph_node *ipa_pop_func_from_list (struct ipa_func_list **);
+
+/* Callsite related calculations. */
+void ipa_compute_jump_functions (struct cgraph_edge *);
+void ipa_count_arguments (struct cgraph_edge *);
+
+/* Function parameters related computations. */
+void ipa_count_formal_params (struct cgraph_node *);
+void ipa_create_param_decls_array (struct cgraph_node *);
+void ipa_detect_param_modifications (struct cgraph_node *);
+/* Creating and freeing ipa_node_params and ipa_edge_args. */
+void ipa_create_node_params (struct cgraph_node *);
+void ipa_free_all_node_params (void);
+void ipa_create_all_node_params (void);
+void ipa_create_all_edge_args (void);
+void ipa_free_all_edge_args (void);
/* Debugging interface. */
-void ipa_method_tree_print (FILE *);
-void ipa_method_modify_print (FILE *);
+void ipa_print_all_tree_maps (FILE *);
+void ipa_print_all_params_modified (FILE *);
#endif /* IPA_PROP_H */
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog
index b77812d291f..a9487a9be12 100644
--- a/gcc/java/ChangeLog
+++ b/gcc/java/ChangeLog
@@ -1,3 +1,16 @@
+2008-04-23 Paolo Bonzini <bonzini@gnu.org>
+
+ * class.c (build_utf8_ref): Don't set TREE_INVARIANT.
+ (build_classdollar_field): Don't set TREE_INVARIANT.
+ (get_dispatch_table): Don't set TREE_INVARIANT.
+ (make_class_data): Don't set TREE_INVARIANT.
+ (build_symbol_entry): Don't set TREE_INVARIANT.
+ (emit_symbol_table): Don't set TREE_INVARIANT.
+ * constants.c (build_constant_data_ref): Don't set TREE_INVARIANT.
+ (build_ref_from_constant_pool): Don't set TREE_INVARIANT.
+ * resource.c (compile_resource_data): Don't set TREE_INVARIANT.
+ * expr.c (cache_cpool_data_ref): Don't set TREE_INVARIANT.
+
2008-04-03 Tom Tromey <tromey@redhat.com>
* Make-lang.in (java_OBJS): New variable.
diff --git a/gcc/java/class.c b/gcc/java/class.c
index 4eb3360a539..85e37bc468b 100644
--- a/gcc/java/class.c
+++ b/gcc/java/class.c
@@ -955,7 +955,6 @@ build_utf8_ref (tree name)
PUSH_FIELD_VALUE (cinit, "data", string);
FINISH_RECORD_CONSTRUCTOR (cinit);
TREE_CONSTANT (cinit) = 1;
- TREE_INVARIANT (cinit) = 1;
/* Generate a unique-enough identifier. */
sprintf(buf, "_Utf%d", ++utf8_count);
@@ -1063,7 +1062,6 @@ build_classdollar_field (tree type)
/* const */ 1, 0)),
/* const */ 1, 0)));
TREE_STATIC (decl) = 1;
- TREE_INVARIANT (decl) = 1;
TREE_CONSTANT (decl) = 1;
TREE_READONLY (decl) = 1;
TREE_PUBLIC (decl) = 1;
@@ -1604,7 +1602,6 @@ get_dispatch_table (tree type, tree this_class_addr)
tree fdesc = build2 (FDESC_EXPR, nativecode_ptr_type_node,
method, build_int_cst (NULL_TREE, j));
TREE_CONSTANT (fdesc) = 1;
- TREE_INVARIANT (fdesc) = 1;
list = tree_cons (NULL_TREE, fdesc, list);
}
else
@@ -2076,7 +2073,6 @@ make_class_data (tree type)
build1 (ADDR_EXPR, symbols_array_ptr_type,
TYPE_OTABLE_SYMS_DECL (type)));
TREE_CONSTANT (TYPE_OTABLE_DECL (type)) = 1;
- TREE_INVARIANT (TYPE_OTABLE_DECL (type)) = 1;
}
if (TYPE_ATABLE_METHODS(type) == NULL_TREE)
{
@@ -2092,7 +2088,6 @@ make_class_data (tree type)
build1 (ADDR_EXPR, symbols_array_ptr_type,
TYPE_ATABLE_SYMS_DECL (type)));
TREE_CONSTANT (TYPE_ATABLE_DECL (type)) = 1;
- TREE_INVARIANT (TYPE_ATABLE_DECL (type)) = 1;
}
if (TYPE_ITABLE_METHODS(type) == NULL_TREE)
{
@@ -2108,7 +2103,6 @@ make_class_data (tree type)
build1 (ADDR_EXPR, symbols_array_ptr_type,
TYPE_ITABLE_SYMS_DECL (type)));
TREE_CONSTANT (TYPE_ITABLE_DECL (type)) = 1;
- TREE_INVARIANT (TYPE_ITABLE_DECL (type)) = 1;
}
PUSH_FIELD_VALUE (cons, "catch_classes",
@@ -2848,7 +2842,6 @@ build_symbol_entry (tree decl, tree special)
PUSH_FIELD_VALUE (sym, "signature", signature);
FINISH_RECORD_CONSTRUCTOR (sym);
TREE_CONSTANT (sym) = 1;
- TREE_INVARIANT (sym) = 1;
return sym;
}
@@ -2889,7 +2882,6 @@ emit_symbol_table (tree name, tree the_table, tree decl_list,
PUSH_FIELD_VALUE (null_symbol, "signature", null_pointer_node);
FINISH_RECORD_CONSTRUCTOR (null_symbol);
TREE_CONSTANT (null_symbol) = 1;
- TREE_INVARIANT (null_symbol) = 1;
list = tree_cons (NULL_TREE, null_symbol, list);
/* Put the list in the right order and make it a constructor. */
diff --git a/gcc/java/constants.c b/gcc/java/constants.c
index 8a3c532c870..5294285f65a 100644
--- a/gcc/java/constants.c
+++ b/gcc/java/constants.c
@@ -445,7 +445,6 @@ build_constant_data_ref (bool indirect)
TREE_THIS_NOTRAP (klass) = 1;
data = fold_convert (build_pointer_type (cpool_type), data);
d = build1 (INDIRECT_REF, cpool_type, data);
- TREE_INVARIANT (d) = 1;
return d;
}
@@ -485,7 +484,6 @@ build_ref_from_constant_pool (int index)
i = build_int_cst (NULL_TREE, index);
d = build4 (ARRAY_REF, TREE_TYPE (TREE_TYPE (d)), d, i,
NULL_TREE, NULL_TREE);
- TREE_INVARIANT (d) = 1;
return d;
}
diff --git a/gcc/java/expr.c b/gcc/java/expr.c
index b113df1de9e..75c18e51d17 100644
--- a/gcc/java/expr.c
+++ b/gcc/java/expr.c
@@ -3809,7 +3809,6 @@ cache_cpool_data_ref (void)
tree cpool_ptr = build_decl (VAR_DECL, NULL_TREE,
build_pointer_type (TREE_TYPE (d)));
java_add_local_var (cpool_ptr);
- TREE_INVARIANT (cpool_ptr) = 1;
TREE_CONSTANT (cpool_ptr) = 1;
java_add_stmt (build2 (MODIFY_EXPR, TREE_TYPE (cpool_ptr),
diff --git a/gcc/java/resource.c b/gcc/java/resource.c
index e0a403e7a0a..d01eb8e5a89 100644
--- a/gcc/java/resource.c
+++ b/gcc/java/resource.c
@@ -73,7 +73,6 @@ compile_resource_data (const char *name, const char *buffer, int length)
PUSH_FIELD_VALUE (rinit, "data", data);
FINISH_RECORD_CONSTRUCTOR (rinit);
TREE_CONSTANT (rinit) = 1;
- TREE_INVARIANT (rinit) = 1;
decl = build_decl (VAR_DECL, java_mangle_resource_name (name), rtype);
TREE_STATIC (decl) = 1;
diff --git a/gcc/langhooks-def.h b/gcc/langhooks-def.h
index a67ba81974b..aae46406515 100644
--- a/gcc/langhooks-def.h
+++ b/gcc/langhooks-def.h
@@ -64,7 +64,7 @@ extern const char *lhd_comdat_group (tree);
extern tree lhd_expr_size (const_tree);
extern size_t lhd_tree_size (enum tree_code);
extern HOST_WIDE_INT lhd_to_target_charset (HOST_WIDE_INT);
-extern tree lhd_expr_to_decl (tree, bool *, bool *, bool *);
+extern tree lhd_expr_to_decl (tree, bool *, bool *);
extern tree lhd_builtin_function (tree decl);
/* Declarations of default tree inlining hooks. */
@@ -167,6 +167,7 @@ extern tree lhd_make_node (enum tree_code);
lhd_omp_firstprivatize_type_sizes
#define LANG_HOOKS_TYPE_HASH_EQ NULL
#define LANG_HOOKS_GET_ARRAY_DESCR_INFO NULL
+#define LANG_HOOKS_RECONSTRUCT_COMPLEX_TYPE reconstruct_complex_type
#define LANG_HOOKS_HASH_TYPES true
#define LANG_HOOKS_FOR_TYPES_INITIALIZER { \
@@ -182,6 +183,7 @@ extern tree lhd_make_node (enum tree_code);
LANG_HOOKS_OMP_FIRSTPRIVATIZE_TYPE_SIZES, \
LANG_HOOKS_TYPE_HASH_EQ, \
LANG_HOOKS_GET_ARRAY_DESCR_INFO, \
+ LANG_HOOKS_RECONSTRUCT_COMPLEX_TYPE, \
LANG_HOOKS_HASH_TYPES \
}
diff --git a/gcc/langhooks.c b/gcc/langhooks.c
index 2df5c27915d..3943f02b794 100644
--- a/gcc/langhooks.c
+++ b/gcc/langhooks.c
@@ -502,8 +502,7 @@ lhd_to_target_charset (HOST_WIDE_INT c)
}
tree
-lhd_expr_to_decl (tree expr, bool *tc ATTRIBUTE_UNUSED,
- bool *ti ATTRIBUTE_UNUSED, bool *se ATTRIBUTE_UNUSED)
+lhd_expr_to_decl (tree expr, bool *tc ATTRIBUTE_UNUSED, bool *se ATTRIBUTE_UNUSED)
{
return expr;
}
diff --git a/gcc/langhooks.h b/gcc/langhooks.h
index 722c82cb623..6a54b01f060 100644
--- a/gcc/langhooks.h
+++ b/gcc/langhooks.h
@@ -130,6 +130,12 @@ struct lang_hooks_for_types
for the debugger about the array bounds, strides, etc. */
bool (*get_array_descr_info) (const_tree, struct array_descr_info *);
+ /* If we requested a pointer to a vector, build up the pointers that
+ we stripped off while looking for the inner type. Similarly for
+ return values from functions. The argument TYPE is the top of the
+ chain, and BOTTOM is the new type which we will point to. */
+ tree (*reconstruct_complex_type) (tree, tree);
+
/* Nonzero if types that are identical are to be hashed so that only
one copy is kept. If a language requires unique types for each
user-specified type, such as Ada, this should be set to TRUE. */
@@ -400,10 +406,9 @@ struct lang_hooks
void (*init_ts) (void);
/* Called by recompute_tree_invariant_for_addr_expr to go from EXPR
- to a contained expression or DECL, possibly updating *TC, *TI or
- *SE if in the process TREE_CONSTANT, TREE_INVARIANT or
- TREE_SIDE_EFFECTS need updating. */
- tree (*expr_to_decl) (tree expr, bool *tc, bool *ti, bool *se);
+ to a contained expression or DECL, possibly updating *TC or *SE
+ if in the process TREE_CONSTANT or TREE_SIDE_EFFECTS need updating. */
+ tree (*expr_to_decl) (tree expr, bool *tc, bool *se);
/* Whenever you add entries here, make sure you adjust langhooks-def.h
and langhooks.c accordingly. */
diff --git a/gcc/local-alloc.c b/gcc/local-alloc.c
index 33e5a297c1d..af97caf0173 100644
--- a/gcc/local-alloc.c
+++ b/gcc/local-alloc.c
@@ -2008,7 +2008,7 @@ combine_regs (rtx usedreg, rtx setreg, int may_save_copy, int insn_number,
if (reg_qty[sreg] >= -1
/* If we are not going to let any regs live across calls,
don't tie a call-crossing reg to a non-call-crossing reg. */
- || (current_function_has_nonlocal_label
+ || (cfun->has_nonlocal_label
&& ((REG_N_CALLS_CROSSED (ureg) > 0)
!= (REG_N_CALLS_CROSSED (sreg) > 0))))
return 0;
@@ -2229,7 +2229,7 @@ find_free_reg (enum reg_class class, enum machine_mode mode, int qtyno,
/* Don't let a pseudo live in a reg across a function call
if we might get a nonlocal goto. */
- if (current_function_has_nonlocal_label
+ if (cfun->has_nonlocal_label
&& qty[qtyno].n_calls_crossed > 0)
return -1;
diff --git a/gcc/objc/ChangeLog b/gcc/objc/ChangeLog
index 6c32bb2211c..02a1356b8cd 100644
--- a/gcc/objc/ChangeLog
+++ b/gcc/objc/ChangeLog
@@ -1,3 +1,7 @@
+2008-04-23 Paolo Bonzini <bonzini@gnu.org>
+
+ * objc-act.c (objc_build_string_object): Don't set TREE_INVARIANT.
+
2008-04-03 Tom Tromey <tromey@redhat.com>
* Make-lang.in (objc_OBJS): New variable.
diff --git a/gcc/objc/objc-act.c b/gcc/objc/objc-act.c
index 9baa4da793f..46565e94b4f 100644
--- a/gcc/objc/objc-act.c
+++ b/gcc/objc/objc-act.c
@@ -1953,7 +1953,6 @@ objc_build_string_object (tree string)
initlist);
constructor = objc_build_constructor (internal_const_str_type,
nreverse (initlist));
- TREE_INVARIANT (constructor) = true;
if (!flag_next_runtime)
constructor
diff --git a/gcc/optabs.c b/gcc/optabs.c
index 11df818fb89..8978a975a41 100644
--- a/gcc/optabs.c
+++ b/gcc/optabs.c
@@ -5270,7 +5270,8 @@ expand_float (rtx to, rtx from, int unsignedp)
end_sequence ();
emit_libcall_block (insns, target, value,
- gen_rtx_FLOAT (GET_MODE (to), from));
+ gen_rtx_fmt_e (unsignedp ? UNSIGNED_FLOAT : FLOAT,
+ GET_MODE (to), from));
}
done:
diff --git a/gcc/optc-gen.awk b/gcc/optc-gen.awk
index cd1024406da..f3b41a96778 100644
--- a/gcc/optc-gen.awk
+++ b/gcc/optc-gen.awk
@@ -189,8 +189,11 @@ for (i = 0; i < n_opts; i++) {
idx = -1;
}
}
- printf(" { %c-%s%c,\n %s,\n %s, %u, %d,\n",
- quote, opts[i], quote, hlp, back_chain[i], len, idx)
+ # Split the printf after %u to work around an ia64-hp-hpux11.23
+ # awk bug.
+ printf(" { %c-%s%c,\n %s,\n %s, %u,",
+ quote, opts[i], quote, hlp, back_chain[i], len)
+ printf(" %d,\n", idx)
condition = opt_args("Condition", flags[i])
cl_flags = switch_flags(flags[i])
if (condition != "")
diff --git a/gcc/opts.c b/gcc/opts.c
index b87bc562e5a..a5931f45a99 100644
--- a/gcc/opts.c
+++ b/gcc/opts.c
@@ -1982,6 +1982,8 @@ set_Wstrict_aliasing (int onoff)
gcc_assert (onoff == 0 || onoff == 1);
if (onoff != 0)
warn_strict_aliasing = 3;
+ else
+ warn_strict_aliasing = 0;
}
/* The following routines are useful in setting all the flags that
diff --git a/gcc/output.h b/gcc/output.h
index ae8404e7fe1..15daf5b8d0d 100644
--- a/gcc/output.h
+++ b/gcc/output.h
@@ -460,7 +460,10 @@ enum section_category
SECCAT_BSS,
SECCAT_SBSS,
- SECCAT_TBSS
+ SECCAT_TBSS,
+
+ SECCAT_EMUTLS_VAR,
+ SECCAT_EMUTLS_TMPL
};
/* Information that is provided by all instances of the section type. */
diff --git a/gcc/params.def b/gcc/params.def
index 566006d7485..69de32dce19 100644
--- a/gcc/params.def
+++ b/gcc/params.def
@@ -514,10 +514,6 @@ DEFPARAM(PARAM_MAX_CSELIB_MEMORY_LOCATIONS,
"max-cselib-memory-locations",
"The maximum memory locations recorded by cselib",
500, 0, 0)
-DEFPARAM(PARAM_MAX_FLOW_MEMORY_LOCATIONS,
- "max-flow-memory-locations",
- "The maximum memory locations recorded by flow",
- 100, 0, 0)
#ifdef ENABLE_GC_ALWAYS_COLLECT
# define GGC_MIN_EXPAND_DEFAULT 0
diff --git a/gcc/passes.c b/gcc/passes.c
index a34dd11a584..fc305ef6479 100644
--- a/gcc/passes.c
+++ b/gcc/passes.c
@@ -355,7 +355,7 @@ register_one_dump_file (struct opt_pass *pass)
? 1 : pass->static_pass_number));
dot_name = concat (".", pass->name, num, NULL);
- if (pass->type == SIMPLE_IPA_PASS)
+ if (pass->type == SIMPLE_IPA_PASS || pass->type == IPA_PASS)
prefix = "ipa-", flags = TDF_IPA;
else if (pass->type == GIMPLE_PASS)
prefix = "tree-", flags = TDF_TREE;
@@ -541,7 +541,6 @@ init_optimization_passes (void)
NEXT_PASS (pass_release_ssa_names);
}
NEXT_PASS (pass_rebuild_cgraph_edges);
- NEXT_PASS (pass_inline_parameters);
}
NEXT_PASS (pass_ipa_increase_alignment);
NEXT_PASS (pass_ipa_matrix_reorg);
@@ -560,7 +559,7 @@ init_optimization_passes (void)
/* These passes are run after IPA passes on every function that is being
output to the assembler file. */
p = &all_passes;
- NEXT_PASS (pass_apply_inline);
+ NEXT_PASS (pass_O0_always_inline);
NEXT_PASS (pass_all_optimizations);
{
struct opt_pass **p = &pass_all_optimizations.pass.sub;
@@ -573,6 +572,7 @@ init_optimization_passes (void)
NEXT_PASS (pass_rename_ssa_copies);
/* Initial scalar cleanups. */
+ NEXT_PASS (pass_complete_unrolli);
NEXT_PASS (pass_ccp);
NEXT_PASS (pass_phiprop);
NEXT_PASS (pass_fre);
@@ -742,7 +742,6 @@ init_optimization_passes (void)
NEXT_PASS (pass_partition_blocks);
NEXT_PASS (pass_regmove);
NEXT_PASS (pass_split_all_insns);
- NEXT_PASS (pass_fast_rtl_byte_dce);
NEXT_PASS (pass_lower_subreg2);
NEXT_PASS (pass_df_initialize_no_opt);
NEXT_PASS (pass_stack_ptr_mod);
@@ -1012,11 +1011,15 @@ execute_todo (unsigned int flags)
to analyze side effects. The full removal is done just at the end
of IPA pass queue. */
if (flags & TODO_remove_functions)
- cgraph_remove_unreachable_nodes (true, dump_file);
+ {
+ gcc_assert (!cfun);
+ cgraph_remove_unreachable_nodes (true, dump_file);
+ }
if ((flags & TODO_dump_cgraph)
&& dump_file && !current_function_decl)
{
+ gcc_assert (!cfun);
dump_cgraph (dump_file);
/* Flush the file. If verification fails, we won't be able to
close the file before aborting. */
@@ -1065,8 +1068,58 @@ verify_curr_properties (void *data)
}
#endif
+/* Initialize pass dump file. */
+
+static bool
+pass_init_dump_file (struct opt_pass *pass)
+{
+ /* If a dump file name is present, open it if enabled. */
+ if (pass->static_pass_number != -1)
+ {
+ bool initializing_dump = !dump_initialized_p (pass->static_pass_number);
+ dump_file_name = get_dump_file_name (pass->static_pass_number);
+ dump_file = dump_begin (pass->static_pass_number, &dump_flags);
+ if (dump_file && current_function_decl)
+ {
+ const char *dname, *aname;
+ dname = lang_hooks.decl_printable_name (current_function_decl, 2);
+ aname = (IDENTIFIER_POINTER
+ (DECL_ASSEMBLER_NAME (current_function_decl)));
+ fprintf (dump_file, "\n;; Apply transform to function %s (%s)%s\n\n", dname, aname,
+ cfun->function_frequency == FUNCTION_FREQUENCY_HOT
+ ? " (hot)"
+ : cfun->function_frequency == FUNCTION_FREQUENCY_UNLIKELY_EXECUTED
+ ? " (unlikely executed)"
+ : "");
+ }
+ return initializing_dump;
+ }
+ else
+ return false;
+}
+
+/* Flush PASS dump file. */
+
+static void
+pass_fini_dump_file (struct opt_pass *pass)
+{
+ /* Flush and close dump file. */
+ if (dump_file_name)
+ {
+ free (CONST_CAST (char *, dump_file_name));
+ dump_file_name = NULL;
+ }
+
+ if (dump_file)
+ {
+ dump_end (pass->static_pass_number, dump_file);
+ dump_file = NULL;
+ }
+}
+
/* After executing the pass, apply expected changes to the function
properties. */
+
static void
update_properties_after_pass (void *data)
{
@@ -1075,6 +1128,80 @@ update_properties_after_pass (void *data)
& ~pass->properties_destroyed;
}
+/* Schedule IPA transform pass DATA for CFUN. */
+
+static void
+add_ipa_transform_pass (void *data)
+{
+ struct ipa_opt_pass *ipa_pass = (struct ipa_opt_pass *) data;
+ VEC_safe_push (ipa_opt_pass, heap, cfun->ipa_transforms_to_apply, ipa_pass);
+}
+
+/* Execute IPA pass function summary generation. DATA is pointer to
+ pass list to execute. */
+
+static void
+execute_ipa_summary_passes (void *data)
+{
+ struct ipa_opt_pass *ipa_pass = (struct ipa_opt_pass *)data;
+ struct cgraph_node *node = cgraph_node (cfun->decl);
+ while (ipa_pass && ipa_pass->pass.type == IPA_PASS)
+ {
+ struct opt_pass *pass = &ipa_pass->pass;
+ if (!pass->gate || pass->gate ())
+ {
+ pass_init_dump_file (pass);
+ ipa_pass->function_generate_summary (node);
+ pass_fini_dump_file (pass);
+ }
+ ipa_pass = (struct ipa_opt_pass *)ipa_pass->pass.next;
+ }
+}
+
+/* Execute IPA_PASS function transform on NODE. */
+
+static void
+execute_one_ipa_transform_pass (struct cgraph_node *node,
+ struct ipa_opt_pass *ipa_pass)
+{
+ struct opt_pass *pass = &ipa_pass->pass;
+ unsigned int todo_after = 0;
+
+ current_pass = pass;
+ if (!ipa_pass->function_transform)
+ return;
+
+ /* Note that the folders should only create gimple expressions.
+ This is a hack until the new folder is ready. */
+ in_gimple_form = (cfun && (cfun->curr_properties & PROP_trees)) != 0;
+
+ pass_init_dump_file (pass);
+
+ /* Run pre-pass verification. */
+ execute_todo (ipa_pass->function_transform_todo_flags_start);
+
+ /* If a timevar is present, start it. */
+ if (pass->tv_id)
+ timevar_push (pass->tv_id);
+
+ /* Do it! */
+ todo_after = ipa_pass->function_transform (node);
+
+ /* Stop timevar. */
+ if (pass->tv_id)
+ timevar_pop (pass->tv_id);
+
+ /* Run post-pass cleanup and verification. */
+ execute_todo (todo_after);
+ verify_interpass_invariants ();
+
+ pass_fini_dump_file (pass);
+
+ current_pass = NULL;
+ /* Reset in_gimple_form to not break non-unit-at-a-time mode. */
+ in_gimple_form = false;
+}
+
static bool
execute_one_pass (struct opt_pass *pass)
{
@@ -1087,13 +1214,24 @@ execute_one_pass (struct opt_pass *pass)
/* IPA passes are executed on whole program, so cfun should be NULL.
Ohter passes needs function context set. */
- if (pass->type == SIMPLE_IPA_PASS)
+ if (pass->type == SIMPLE_IPA_PASS || pass->type == IPA_PASS)
gcc_assert (!cfun && !current_function_decl);
else
+ gcc_assert (cfun && current_function_decl);
+
+ if (cfun && cfun->ipa_transforms_to_apply)
{
- gcc_assert (cfun && current_function_decl);
- gcc_assert (!(cfun->curr_properties & PROP_trees)
- || pass->type != RTL_PASS);
+ unsigned int i;
+ struct cgraph_node *node = cgraph_node (current_function_decl);
+
+ for (i = 0; i < VEC_length (ipa_opt_pass, cfun->ipa_transforms_to_apply);
+ i++)
+ execute_one_ipa_transform_pass (node,
+ VEC_index (ipa_opt_pass,
+ cfun->ipa_transforms_to_apply,
+ i));
+ VEC_free (ipa_opt_pass, heap, cfun->ipa_transforms_to_apply);
+ cfun->ipa_transforms_to_apply = NULL;
}
current_pass = pass;
@@ -1119,6 +1257,7 @@ execute_one_pass (struct opt_pass *pass)
(void *)(size_t)pass->properties_required);
#endif
+
if (pass->name && comprobe_replf) {
static char buf[80];
memset(buf, 0, sizeof(buf));
@@ -1126,28 +1265,7 @@ execute_one_pass (struct opt_pass *pass)
comprobe_show_message(buf);
}
- /* If a dump file name is present, open it if enabled. */
- if (pass->static_pass_number != -1)
- {
- initializing_dump = !dump_initialized_p (pass->static_pass_number);
- dump_file_name = get_dump_file_name (pass->static_pass_number);
- dump_file = dump_begin (pass->static_pass_number, &dump_flags);
- if (dump_file && current_function_decl)
- {
- const char *dname, *aname;
- dname = lang_hooks.decl_printable_name (current_function_decl, 2);
- aname = (IDENTIFIER_POINTER
- (DECL_ASSEMBLER_NAME (current_function_decl)));
- fprintf (dump_file, "\n;; Function %s (%s)%s\n\n", dname, aname,
- cfun->function_frequency == FUNCTION_FREQUENCY_HOT
- ? " (hot)"
- : cfun->function_frequency == FUNCTION_FREQUENCY_UNLIKELY_EXECUTED
- ? " (unlikely executed)"
- : "");
- }
- }
- else
- initializing_dump = false;
+ initializing_dump = pass_init_dump_file (pass);
/* If a timevar is present, start it. */
if (pass->tv_id)
@@ -1188,22 +1306,17 @@ execute_one_pass (struct opt_pass *pass)
/* Run post-pass cleanup and verification. */
execute_todo (todo_after | pass->todo_flags_finish);
verify_interpass_invariants ();
+ if (pass->type == IPA_PASS)
+ do_per_function (add_ipa_transform_pass, pass);
if (!current_function_decl)
cgraph_process_new_functions ();
- /* Flush and close dump file. */
- if (dump_file_name)
- {
- free (CONST_CAST (char *, dump_file_name));
- dump_file_name = NULL;
- }
+ pass_fini_dump_file (pass);
- if (dump_file)
- {
- dump_end (pass->static_pass_number, dump_file);
- dump_file = NULL;
- }
+ if (pass->type != SIMPLE_IPA_PASS && pass->type != IPA_PASS)
+ gcc_assert (!(cfun->curr_properties & PROP_trees)
+ || pass->type != RTL_PASS);
current_pass = NULL;
/* Reset in_gimple_form to not break non-unit-at-a-time mode. */
@@ -1231,17 +1344,31 @@ execute_pass_list (struct opt_pass *pass)
void
execute_ipa_pass_list (struct opt_pass *pass)
{
+ bool summaries_generated = false;
do
{
gcc_assert (!current_function_decl);
gcc_assert (!cfun);
- gcc_assert (pass->type == SIMPLE_IPA_PASS);
+ gcc_assert (pass->type == SIMPLE_IPA_PASS || pass->type == IPA_PASS);
+ if (pass->type == IPA_PASS && (!pass->gate || pass->gate ()))
+ {
+ if (!summaries_generated)
+ {
+ if (!quiet_flag && !cfun)
+ fprintf (stderr, " <summary generate>");
+ do_per_function_toporder (execute_ipa_summary_passes, pass);
+ }
+ summaries_generated = true;
+ }
+ else
+ summaries_generated = false;
if (execute_one_pass (pass) && pass->sub)
{
if (pass->sub->type == GIMPLE_PASS)
do_per_function_toporder ((void (*)(void *))execute_pass_list,
pass->sub);
- else if (pass->sub->type == SIMPLE_IPA_PASS)
+ else if (pass->sub->type == SIMPLE_IPA_PASS
+ || pass->sub->type == IPA_PASS)
execute_ipa_pass_list (pass->sub);
else
gcc_unreachable ();
diff --git a/gcc/po/ChangeLog b/gcc/po/ChangeLog
index 6dcef740be7..db85c6d8046 100644
--- a/gcc/po/ChangeLog
+++ b/gcc/po/ChangeLog
@@ -1,3 +1,7 @@
+2008-05-03 Joseph S. Myers <joseph@codesourcery.com>
+
+ * zh_CN.po: Update.
+
2008-03-27 Joseph S. Myers <joseph@codesourcery.com>
* zh_CN.po: Update.
diff --git a/gcc/po/zh_CN.po b/gcc/po/zh_CN.po
index bad5b35e810..c1ea1150004 100644
--- a/gcc/po/zh_CN.po
+++ b/gcc/po/zh_CN.po
@@ -8,7 +8,7 @@ msgstr ""
"Project-Id-Version: gcc 4.3.0\n"
"Report-Msgid-Bugs-To: http://gcc.gnu.org/bugs.html\n"
"POT-Creation-Date: 2008-03-05 17:23+0100\n"
-"PO-Revision-Date: 2008-03-24 15:08+0800\n"
+"PO-Revision-Date: 2008-05-03 22:26+0800\n"
"Last-Translator: Meng Jie <zuxy.meng@gmail.com>\n"
"Language-Team: Chinese (simplified) <translation-team-zh-cn@lists.sourceforge.net>\n"
"MIME-Version: 1.0\n"
@@ -4112,7 +4112,7 @@ msgstr "‘shape’内建函数的‘source’实å‚在%L处ä¸èƒ½æ˜¯å‡å®šå¤§å°
#: fortran/check.c:2473
#, no-c-format
msgid "'%s' argument of '%s' intrinsic at %L must be less than rank %d"
-msgstr "%3$L处内建函数‘%2$s’的实å‚‘%1$s’秩必须å°äºŽ %d"
+msgstr "%3$L处内建函数‘%2$s’的实å‚‘%1$s’秩必须å°äºŽ %4$d"
#: fortran/check.c:2725
#, no-c-format
@@ -7052,7 +7052,7 @@ msgstr "扩展:%L处的 CONVERT 标记"
#: fortran/io.c:1367 fortran/io.c:1375
#, no-c-format
msgid "Fortran 2003: %s specifier in %s statement at %C has value '%s'"
-msgstr "Fortran 2003:%3$ 处 %2$ 语å¥ä¸­çš„ %1$s é™å®šç¬¦å€¼ä¸ºâ€˜%4$s’"
+msgstr "Fortran 2003:%3$C 处 %2$s 语å¥ä¸­çš„ %1$s é™å®šç¬¦å€¼ä¸ºâ€˜%4$s’"
#: fortran/io.c:1393 fortran/io.c:1401
#, no-c-format
@@ -8988,7 +8988,7 @@ msgstr ""
#: fortran/resolve.c:1640
#, no-c-format
msgid "Unable to resolve the specific function '%s' at %L"
-msgstr "ä¸èƒ½è§£æž %$2L处的函数‘%1$s’"
+msgstr "ä¸èƒ½è§£æž %2$L处的函数‘%1$s’"
#: fortran/resolve.c:1696 fortran/resolve.c:8931
#, no-c-format
@@ -9057,7 +9057,7 @@ msgstr "%3$L处‘%2$s’的形å‚‘%1$s’必须为 BIND(C)"
#: fortran/resolve.c:2170
#, no-c-format
msgid "'%s' at %L is not a function"
-msgstr "%2L处的‘%1$s’ä¸æ˜¯ä¸€ä¸ªå‡½æ•°"
+msgstr "%2$L处的‘%1$s’ä¸æ˜¯ä¸€ä¸ªå‡½æ•°"
#: fortran/resolve.c:2176
#, no-c-format
@@ -10622,7 +10622,7 @@ msgstr "%L处指定了é‡å¤çš„ VOLATILE 属性"
#: fortran/symbol.c:1296
#, no-c-format
msgid "%s attribute of '%s' conflicts with %s attribute at %L"
-msgstr "‘%2$s’的 %1$s 属性与%4$L处的 %2$s 属性冲çª"
+msgstr "‘%2$s’的 %1$s 属性与%4$L处的 %3$s 属性冲çª"
#: fortran/symbol.c:1330
#, no-c-format
@@ -15764,7 +15764,7 @@ msgstr "当下标类型为“charâ€æ—¶ç»™å‡ºè­¦å‘Š"
#: c.opt:156
msgid "Warn about variables that might be changed by \"longjmp\" or \"vfork\""
-msgstr "对能为%<longjmp%>或%<vfork%>所篡改的å˜é‡ç»™å‡ºè­¦å‘Š"
+msgstr "对能为\"longjmp\"或\"vfork\"所篡改的å˜é‡ç»™å‡ºè­¦å‘Š"
#: c.opt:160
msgid "Warn about possibly nested block comments, and C++ comments spanning more than one physical line"
@@ -18647,7 +18647,7 @@ msgstr "ISO C90 ä¸æ”¯æŒ%<long long%>"
#: c-decl.c:7230 c-decl.c:7259
#, gcc-internal-format
msgid "both %<long%> and %<short%> in declaration specifiers"
-msgstr "声明中åŒæ—¶ä½¿ç”¨äº† <long%>å’Œ%<short%>"
+msgstr "声明中åŒæ—¶ä½¿ç”¨äº† %<long%>å’Œ%<short%>"
#: c-decl.c:7233 c-decl.c:7436
#, gcc-internal-format
@@ -19963,7 +19963,7 @@ msgstr "%H%<num_threads%>值必须为正"
#: c-parser.c:7141
#, gcc-internal-format
msgid "expected %<+%>, %<*%>, %<-%>, %<&%>, %<^%>, %<|%>, %<&&%>, or %<||%>"
-msgstr "需è¦%<+%>ã€<*%>ã€%<-%>ã€%<&%>ã€%<^%>ã€%<|%>ã€%<&&%>或%<||%>"
+msgstr "需è¦%<+%>ã€%<*%>ã€%<-%>ã€%<&%>ã€%<^%>ã€%<|%>ã€%<&&%>或%<||%>"
#: c-parser.c:7224
#, gcc-internal-format
@@ -20532,7 +20532,7 @@ msgstr "å•ç›®å‡çš„æ“作数类型错误"
#: c-typeck.c:2952
#, gcc-internal-format
msgid "ISO C does not support %<~%> for complex conjugation"
-msgstr "ISO C ä¸æ”¯æŒç”¨ ~ 求共轭å¤æ•°"
+msgstr "ISO C ä¸æ”¯æŒç”¨ %<~%> 求共轭å¤æ•°"
#: c-typeck.c:2958
#, gcc-internal-format
@@ -27695,7 +27695,7 @@ msgstr "åªèƒ½ä¸ºå¯¹è±¡å’Œå‡½æ•°æŒ‡å®šç±»åž‹é™å®š"
#: cp/decl.c:3853
#, gcc-internal-format
msgid "%<typedef%> was ignored in this declaration"
-msgstr "此声明中的 typedef 被忽略"
+msgstr "此声明中的 %<typedef%> 被忽略"
#: cp/decl.c:3882
#, gcc-internal-format
@@ -27731,7 +27731,7 @@ msgstr "%q#D声明有%<extern%>并被åˆå§‹åŒ–"
#: cp/decl.c:4034
#, gcc-internal-format
msgid "definition of %q#D is marked %<dllimport%>"
-msgstr "%q#D的定义被标记为 dllimport"
+msgstr "%q#D的定义被标记为 %<dllimport%>"
#: cp/decl.c:4053
#, gcc-internal-format
@@ -31909,7 +31909,7 @@ msgstr "ISO C++ ä¸å…许在程åºé‡Œè°ƒç”¨%<::main%>"
#: cp/typeck.c:2764
#, gcc-internal-format
msgid "must use %<.*%> or %<->*%> to call pointer-to-member function in %<%E (...)%>"
-msgstr "必须用%<.*%>or%<->*%>调用 <%E (...)%>中的æˆå‘˜å‡½æ•°æŒ‡é’ˆ"
+msgstr "必须用%<.*%>or%<->*%>调用 %<%E (...)%>中的æˆå‘˜å‡½æ•°æŒ‡é’ˆ"
#: cp/typeck.c:2778
#, gcc-internal-format
diff --git a/gcc/print-tree.c b/gcc/print-tree.c
index 78fd72ec7c5..a6cb7b23760 100644
--- a/gcc/print-tree.c
+++ b/gcc/print-tree.c
@@ -293,8 +293,6 @@ print_node (FILE *file, const char *prefix, tree node, int indent)
else if (TYPE_P (node) && TYPE_SIZES_GIMPLIFIED (node))
fputs (" sizes-gimplified", file);
- if (TREE_INVARIANT (node))
- fputs (" invariant", file);
if (TREE_ADDRESSABLE (node))
fputs (" addressable", file);
if (TREE_THIS_VOLATILE (node))
diff --git a/gcc/ra-conflict.c b/gcc/ra-conflict.c
index a4f9e5f4ea1..f97d9a89ee2 100644
--- a/gcc/ra-conflict.c
+++ b/gcc/ra-conflict.c
@@ -1220,7 +1220,7 @@ global_conflicts (void)
/* No need to record conflicts for call clobbered regs if we have
nonlocal labels around, as we don't ever try to allocate such
regs in this case. */
- if (! current_function_has_nonlocal_label)
+ if (! cfun->has_nonlocal_label)
for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
if (call_used_regs [i])
record_one_conflict (allocnos_live, &hard_regs_live, i);
diff --git a/gcc/reload1.c b/gcc/reload1.c
index 7dc593f68ad..13b8e6f7ef0 100644
--- a/gcc/reload1.c
+++ b/gcc/reload1.c
@@ -742,11 +742,11 @@ reload (rtx first, int global)
/* A function that has a nonlocal label that can reach the exit
block via non-exceptional paths must save all call-saved
registers. */
- if (current_function_has_nonlocal_label
+ if (cfun->has_nonlocal_label
&& has_nonexceptional_receiver ())
- current_function_saves_all_registers = 1;
+ crtl->saves_all_registers = 1;
- if (current_function_saves_all_registers)
+ if (crtl->saves_all_registers)
for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
if (! call_used_regs[i] && ! fixed_regs[i] && ! LOCAL_REGNO (i))
df_set_regs_ever_live (i, true);
@@ -3721,9 +3721,9 @@ init_elim_table (void)
the frame pointer in that case. At some point,
we should improve this by emitting the
sp-adjusting insns for this case. */
- || (current_function_calls_alloca
+ || (cfun->calls_alloca
&& EXIT_IGNORE_STACK)
- || current_function_accesses_prior_frames
+ || crtl->accesses_prior_frames
|| FRAME_POINTER_REQUIRED);
num_eliminable = 0;
diff --git a/gcc/rtl-factoring.c b/gcc/rtl-factoring.c
index 77c2197b41d..8882f0f6e48 100644
--- a/gcc/rtl-factoring.c
+++ b/gcc/rtl-factoring.c
@@ -444,15 +444,17 @@ collect_pattern_seqs (void)
htab_iterator hti0, hti1, hti2;
p_hash_bucket hash_bucket;
p_hash_elem e0, e1;
-#ifdef STACK_REGS
+#if defined STACK_REGS || defined HAVE_CC0
basic_block bb;
- bitmap_head stack_reg_live;
+ bitmap_head dont_collect;
/* Extra initialization step to ensure that no stack registers (if present)
- are live across abnormal edges. Set a flag in STACK_REG_LIVE for an insn
- if a stack register is live after the insn. */
- bitmap_initialize (&stack_reg_live, NULL);
+ or cc0 code (if present) are live across abnormal edges.
+ Set a flag in DONT_COLLECT for an insn if a stack register is live
+ after the insn or the insn is cc0 setter or user. */
+ bitmap_initialize (&dont_collect, NULL);
+#ifdef STACK_REGS
FOR_EACH_BB (bb)
{
regset_head live;
@@ -476,7 +478,7 @@ collect_pattern_seqs (void)
{
if (REGNO_REG_SET_P (&live, reg))
{
- bitmap_set_bit (&stack_reg_live, INSN_UID (insn));
+ bitmap_set_bit (&dont_collect, INSN_UID (insn));
break;
}
}
@@ -493,6 +495,28 @@ collect_pattern_seqs (void)
}
#endif
+#ifdef HAVE_CC0
+ /* Mark CC0 setters and users as ineligible for collection into sequences.
+ This is an over-conservative fix, since it is OK to include
+ a cc0_setter, but only if we also include the corresponding cc0_user,
+ and vice versa. */
+ FOR_EACH_BB (bb)
+ {
+ rtx insn;
+ rtx next_tail;
+
+ next_tail = NEXT_INSN (BB_END (bb));
+
+ for (insn = BB_HEAD (bb); insn != next_tail; insn = NEXT_INSN (insn))
+ {
+ if (INSN_P (insn) && reg_mentioned_p (cc0_rtx, PATTERN (insn)))
+ bitmap_set_bit (&dont_collect, INSN_UID (insn));
+ }
+ }
+#endif
+
+#endif /* defined STACK_REGS || defined HAVE_CC0 */
+
/* Initialize PATTERN_SEQS to empty. */
pattern_seqs = 0;
@@ -505,15 +529,15 @@ collect_pattern_seqs (void)
FOR_EACH_HTAB_ELEMENT (hash_bucket->seq_candidates, e1, p_hash_elem,
hti2)
if (e0 != e1
-#ifdef STACK_REGS
- && !bitmap_bit_p (&stack_reg_live, INSN_UID (e0->insn))
- && !bitmap_bit_p (&stack_reg_live, INSN_UID (e1->insn))
+#if defined STACK_REGS || defined HAVE_CC0
+ && !bitmap_bit_p (&dont_collect, INSN_UID (e0->insn))
+ && !bitmap_bit_p (&dont_collect, INSN_UID (e1->insn))
#endif
)
match_seqs (e0, e1);
-#ifdef STACK_REGS
+#if defined STACK_REGS || defined HAVE_CC0
/* Free unused data. */
- bitmap_clear (&stack_reg_live);
+ bitmap_clear (&dont_collect);
#endif
}
diff --git a/gcc/stack-ptr-mod.c b/gcc/stack-ptr-mod.c
index e37fcc3e302..99e5f75178f 100644
--- a/gcc/stack-ptr-mod.c
+++ b/gcc/stack-ptr-mod.c
@@ -57,7 +57,7 @@ notice_stack_pointer_modification (void)
/* Assume that the stack pointer is unchanging if alloca hasn't
been used. */
- current_function_sp_is_unchanging = !current_function_calls_alloca;
+ current_function_sp_is_unchanging = !cfun->calls_alloca;
if (current_function_sp_is_unchanging)
FOR_EACH_BB (bb)
FOR_BB_INSNS (bb, insn)
diff --git a/gcc/stmt.c b/gcc/stmt.c
index aeea50970f6..ba4c49d4d87 100644
--- a/gcc/stmt.c
+++ b/gcc/stmt.c
@@ -1077,7 +1077,7 @@ expand_asm_operands (tree string, tree outputs, tree inputs,
if (real_output_rtx[i])
emit_move_insn (real_output_rtx[i], output_rtx[i]);
- cfun->has_asm_statement = 1;
+ crtl->has_asm_statement = 1;
free_temp_slots ();
}
diff --git a/gcc/stor-layout.c b/gcc/stor-layout.c
index 67e4c25fbdc..41c8fefc108 100644
--- a/gcc/stor-layout.c
+++ b/gcc/stor-layout.c
@@ -138,7 +138,7 @@ variable_size (tree size)
places. */
save = skip_simple_arithmetic (size);
- if (cfun && cfun->x_dont_save_pending_sizes_p)
+ if (cfun && cfun->dont_save_pending_sizes_p)
/* The front-end doesn't want us to keep a list of the expressions
that determine sizes for variable size objects. Trust it. */
return size;
diff --git a/gcc/target-def.h b/gcc/target-def.h
index 118e9791b19..85667861944 100644
--- a/gcc/target-def.h
+++ b/gcc/target-def.h
@@ -692,6 +692,61 @@
TARGET_CXX_ADJUST_CLASS_AT_DEFINITION \
}
+/* EMUTLS specific */
+#ifndef TARGET_EMUTLS_GET_ADDRESS
+#define TARGET_EMUTLS_GET_ADDRESS "__builtin___emutls_get_address"
+#endif
+
+#ifndef TARGET_EMUTLS_REGISTER_COMMON
+#define TARGET_EMUTLS_REGISTER_COMMON "__builtin___emutls_register_common"
+#endif
+
+#ifndef TARGET_EMUTLS_VAR_SECTION
+#define TARGET_EMUTLS_VAR_SECTION NULL
+#endif
+
+#ifndef TARGET_EMUTLS_TMPL_SECTION
+#define TARGET_EMUTLS_TMPL_SECTION NULL
+#endif
+
+#ifndef TARGET_EMUTLS_VAR_PREFIX
+#define TARGET_EMUTLS_VAR_PREFIX NULL
+#endif
+
+#ifndef TARGET_EMUTLS_TMPL_PREFIX
+#define TARGET_EMUTLS_TMPL_PREFIX NULL
+#endif
+
+#ifndef TARGET_EMUTLS_VAR_FIELDS
+#define TARGET_EMUTLS_VAR_FIELDS default_emutls_var_fields
+#endif
+
+#ifndef TARGET_EMUTLS_VAR_INIT
+#define TARGET_EMUTLS_VAR_INIT default_emutls_var_init
+#endif
+
+#ifndef TARGET_EMUTLS_VAR_ALIGN_FIXED
+#define TARGET_EMUTLS_VAR_ALIGN_FIXED false
+#endif
+
+#ifndef TARGET_EMUTLS_DEBUG_FORM_TLS_ADDRESS
+#define TARGET_EMUTLS_DEBUG_FORM_TLS_ADDRESS false
+#endif
+
+#define TARGET_EMUTLS \
+ { \
+ TARGET_EMUTLS_GET_ADDRESS, \
+ TARGET_EMUTLS_REGISTER_COMMON, \
+ TARGET_EMUTLS_VAR_SECTION, \
+ TARGET_EMUTLS_TMPL_SECTION, \
+ TARGET_EMUTLS_VAR_PREFIX, \
+ TARGET_EMUTLS_TMPL_PREFIX, \
+ TARGET_EMUTLS_VAR_FIELDS, \
+ TARGET_EMUTLS_VAR_INIT, \
+ TARGET_EMUTLS_VAR_ALIGN_FIXED, \
+ TARGET_EMUTLS_DEBUG_FORM_TLS_ADDRESS \
+ }
+
/* The whole shebang. */
#define TARGET_INITIALIZER \
{ \
@@ -783,6 +838,7 @@
TARGET_INSTANTIATE_DECLS, \
TARGET_C, \
TARGET_CXX, \
+ TARGET_EMUTLS, \
TARGET_EXTRA_LIVE_ON_ENTRY, \
TARGET_UNWIND_TABLES_DEFAULT, \
TARGET_HAVE_NAMED_SECTIONS, \
diff --git a/gcc/target.h b/gcc/target.h
index 128a0292a15..c331020b6ab 100644
--- a/gcc/target.h
+++ b/gcc/target.h
@@ -917,6 +917,34 @@ struct gcc_target
void (*adjust_class_at_definition) (tree type);
} cxx;
+ /* Functions and data for emulated TLS support. */
+ struct emutls {
+ /* Name of the address and common functions. */
+ const char *get_address;
+ const char *register_common;
+
+ /* Prefixes for proxy variable and template. */
+ const char *var_section;
+ const char *tmpl_section;
+
+ /* Prefixes for proxy variable and template. */
+ const char *var_prefix;
+ const char *tmpl_prefix;
+
+ /* Function to generate field definitions of the proxy variable. */
+ tree (*var_fields) (tree, tree *);
+
+ /* Function to initialize a proxy variable. */
+ tree (*var_init) (tree, tree, tree);
+
+ /* Whether we are allowed to alter the usual alignment of the
+ proxy variable. */
+ bool var_align_fixed;
+
+ /* Whether we can emit debug information for TLS vars. */
+ bool debug_form_tls_address;
+ } emutls;
+
/* For targets that need to mark extra registers as live on entry to
the function, they should define this target hook and set their
bits in the bitmap passed in. */
diff --git a/gcc/targhooks.h b/gcc/targhooks.h
index 5576f9804c3..c94dd069f5e 100644
--- a/gcc/targhooks.h
+++ b/gcc/targhooks.h
@@ -94,3 +94,5 @@ extern void hook_void_bitmap (bitmap);
extern bool default_handle_c_option (size_t, const char *, int);
extern int default_reloc_rw_mask (void);
extern tree default_mangle_decl_assembler_name (tree, tree);
+extern tree default_emutls_var_fields (tree, tree *);
+extern tree default_emutls_var_init (tree, tree, tree);
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 5cbca72b0f8..ecae39579e6 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,430 @@
+2008-05-05 Andrew Pinski <andrew_pinski@playstation.sony.com>
+
+ PR middle-end/36141
+ * gcc.c-torture/pr36141.c: New testcase.
+
+2008-05-06 Danny Smith <dannysmith@users.sourceforge.net>
+
+ * lib/target_supports.exp (check_effective_target_4byte_wchar_t):
+ New proc.
+ * gcc.dg/utf16-4.c: Use it.
+ * gcc.dg/utf32-4.c: Use it.
+ * g++.dg/ext/utf16-4.C: Use it.
+ * gcc.dg/ext/utf32-4.C: Use it.
+
+2008-05-05 Danny Smith <dannysmith@users.sourceforge.net>
+
+ * gfortran.dg/dev_null.f90. Remove and replace with...
+ * gfortran.dg/dev_null.F90: Use preprocessor define to
+ generalize the DEV_NULL name.
+
+2008-05-05 Andrew Pinski <andrew.pinski@playstation.sony.com>
+
+ * gcc.dg/tree-ssa/forwprop-5.c: New testcase.
+ * gcc.dg/tree-ssa/forwprop-6.c: New testcase.
+ * gcc.dg/tree-ssa/forwprop-7.c: New testcase.
+ * gcc.dg/tree-ssa/forwprop-8.c: New testcase.
+ * gcc.dg/tree-ssa/forwprop-9.c: New testcase.
+
+2008-05-05 Ira Rosen <irar@il.ibm.com>
+
+ PR tree-optimization/36119
+ * gfortran.dg/vect/pr36119.f: New test.
+
+2008-05-04 Thomas Koenig <tkoenig@gcc.gnu.org>
+
+ PR libfortran/35995
+ * gfortran.dg/intrinsic_ifunction_1.f90: New test case.
+
+2008-05-04 Andy Hutchinson <hutchinsonandy@aim.com>
+
+ * gcc.dg/nested-func-5.c: Skip for target without trampolines.
+ * gcc.dg/torture/nested-fn-1.c: Ditto.
+
+2008-05-04 Thomas Koenig <tkoenig@gcc.gnu.org>
+
+ PR libfortran/35990
+ * gfortran.dg/intrinsic_pack_4.f90: New test case.
+
+2008-05-03 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gnat.dg/discr6_pkg.ads: New helper.
+ * gnat.dg/discr6.adb: New test.
+
+2008-05-03 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gnat.dg/alignment4.adb: Adjust.
+ * gnat.dg/alignment5.adb: Likewise.
+ * gnat.dg/alignment6.adb: XFAIL.
+
+2008-05-03 Richard Guenther <rguenther@suse.de>
+
+ * gcc.dg/tree-ssa/loop-36.c: Cleanup the dump file.
+
+2008-05-03 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
+ PR fortran/33268
+ * gfortran.dg/io_constraints_4.f90: New test.
+
+2008-05-01 Simon Baldwin <simonb@google.com>
+
+ PR bootstrap/36108
+ * testsuite/gcc.dg/Warray-bounds.c: Removed frontend warnings update.
+ * testsuite/g++.dg/warn/Warray-bounds.c: Ditto.
+ * testsuite/gcc.dg/Warray-bounds-noopt.c: Removed testcase.
+ * testsuite/g++.dg/warn/Warray-bounds-noopt.c: Ditto.
+
+2008-05-01 Bud Davis <bdavis9659@sbcglobal.net>
+
+ PR fortran/PR35940
+ * gfortran.dg/index.f90: New test.
+
+2008-05-01 Simon Baldwin <simonb@google.com>
+
+ * testsuite/gcc.dg/Warray-bounds.c: Updated for frontend warnings,
+ additional tests for arrays of size 0 and size 1.
+ * testsuite/g++.dg/warn/Warray-bounds.c: Ditto.
+ * testsuite/gcc.dg/Warray-bounds-noopt.c: New testcase.
+ * testsuite/g++.dg/warn/Warray-bounds-noopt.c: Ditto.
+
+2008-05-01 Richard Guenther <rguenther@suse.de>
+
+ PR middle-end/36093
+ * gcc.c-torture/execute/pr36093.c: New testcase.
+
+2008-04-30 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
+
+ * gfortran.dg/selected_char_kind_1.f90: New test.
+ * gfortran.dg/selected_char_kind_2.f90: New test.
+ * gfortran.dg/selected_char_kind_3.f90: New test.
+
+2008-04-28 Paul Thomas <pault@gcc.gnu.org>
+
+ PR fortran/35997
+ * gfortran.dg/use_rename_3.f90
+
+2008-04-30 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/21636
+ * gcc.dg/tree-ssa/ssa-ccp-19.c: New testcase.
+
+2008-04-30 Thomas Koenig <tkoenig@gcc.gnu.org>
+
+ PR libfortran/35993
+ * gfortran.dg/intrinsic_product_1.f90: New test case.
+
+2008-04-30 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/14847
+ * gcc.dg/tree-ssa/ssa-ifcombine-6.c: New testcase.
+
+2008-04-30 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/35986
+ * g++.dg/overload/template4.C: New test.
+
+2008-04-30 Kai Tietz <kai.tietz@onevision.com>
+
+ * gfortran.dg/chmod_1.f90: Disable for *-*-mingw*.
+ * gfortran.dg/chmod_2.f90: Likewise.
+ * gfortran.dg/chmod_3.f90: Likewise.
+ * gfortran.dg/open_errors.f90: Likewise.
+
+2008-04-30 Nathan Sidwell <nathan@codesourcery.com>
+
+ * gcc.dg/tls/section-2.c: Restrict to vxworks.
+
+2008-04-29 Samuel Tardieu <sam@rfc1149.net>
+
+ PR ada/35792
+ * gnat.dg/specs/tag2.ads: New.
+
+2008-04-29 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/36078
+ * gfortran.fortran-torture/compile/pr36078.f90: New testcase.
+
+2008-04-29 Richard Guenther <rguenther@suse.de>
+
+ PR middle-end/15255
+ * gcc.dg/fold-plusmult.c: New testcase.
+
+2008-04-29 Richard Guenther <rguenther@suse.de>
+
+ PR middle-end/36077
+ * gcc.c-torture/execute/pr36077.c: New testcase.
+
+2008-04-29 Kai Tietz <kai.tietz@onevision.com>
+
+ * testsuite/gcc.dg/sync-2.c: Set dg-options "-ansi".
+
+2008-04-29 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/35650
+ * g++.dg/init/ref17.C: New test.
+
+ PR c++/35987
+ * g++.dg/other/error28.C: New test.
+
+2008-04-28 Uros Bizjak <ubizjak@gmail.com>
+
+ PR target/36073
+ * gcc.target/i386/pr36073.c: New test.
+
+2008-04-28 Richard Guenther <rguenther@suse.de>
+
+ PR testsuite/34223
+ * gcc.dg/vect/vect-118.c: Rename to ...
+ * gcc.dg/vect/O3-vect-pr34223.c: ... this.
+
+2008-04-28 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/36066
+ * gcc.dg/torture/pr36066.c: New testcase.
+
+2008-04-28 Uros Bizjak <ubizjak@gmail.com>
+
+ PR target/36064
+ * gcc.target/i386/pr36064.c: New test.
+
+2008-04-28 Uros Bizjak <ubizjak@gmail.com>
+
+ PR testsuite/36056
+ * g++.dg/ext/vector14.C: Add -msse for 32bit x86 targets.
+
+2008-04-27 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/18754
+ PR tree-optimization/34223
+ * gcc.dg/tree-ssa/loop-36.c: New testcase.
+ * gcc.dg/tree-ssa/loop-37.c: Likewise.
+ * gcc.dg/vect/vect-118.c: Likewise.
+ * gcc.dg/Wunreachable-8.c: XFAIL bogus warning.
+ * gcc.dg/vect/vect-66.c: Increase loop trip count.
+ * gcc.dg/vect/no-section-anchors-vect-66.c: Likewise.
+ * gcc.dg/vect/no-section-anchors-vect-69.c: Likewise.
+ * gcc.dg/vect/vect-76.c: Likewise.
+ * gcc.dg/vect/vect-outer-6.c: Likewise.
+ * gcc.dg/vect/vect-outer-1.c: Likewise.
+ * gcc.dg/vect/vect-outer-1a.c: Likewise.
+ * gcc.dg/vect/vect-11a.c: Likewise.
+ * gcc.dg/vect/vect-shift-1.c: Likewise.
+ * gcc.target/i386/vectorize1.c: Likewise.
+
+2008-04-27 Nathan Sidwell <nathan@codesourcery.com>
+
+ * gcc.dg/tls/section-2.c: New.
+ * gcc.dg/tls/emutls-1.c: New.
+ * lib/target-supports.exp (check_effective_target_tls_native):
+ Exclude vxworks.
+
+2008-04-26 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR testsuite/36053
+ * gcc.dg/large-size-array-2.c: Fix x86_64-*-mingw* check.
+ * gcc.dg/large-size-array-4.c: Likewise.
+
+2008-04-26 George Helffrich <george@gcc.gnu.org>
+
+ PRs fortran/PR35154, fortran/PR23057
+ * gfortran.dg/debug/pr35154-stabs.f: New test case for
+ .stabs functionality.
+ * gfortran.dg/debug/pr35154-dwarf2.f: New test case for
+ DWARF functionality.
+
+2008-04-26 Richard Sandiford <rsandifo@nildram.co.uk>
+
+ * gcc.target/mips/gcc-have-sync-compare-and-swap-1.c: Expect
+ __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 and
+ __GCC_HAVE_SYNC_COMPARE_AND_SWAP_2 to be defined.
+ * gcc.target/mips/gcc-have-sync-compare-and-swap-2.c: Likewise.
+
+2008-04-25 Tobias Burnus <burnus@net-b.de>
+
+ * gfortran/array_constructor_23.f: Change REAL(10) into kind > 8.
+ * gfortran/array_constructor_24.f: New; REAL(8) version of the test.
+
+2008-04-25 Kai Tietz <kai.tietz@onevision.com>
+
+ * gcc.dg/array-quals-1.c: Add xfail for x86_64-*-mingw*.
+ * gcc.dg/builtins-12.c: Add dg-options "-ansi".
+ * gcc.dg/builtins-13.c: Likewise.
+ * gcc.dg/pr25682.c: Likewise.
+ * gcc.dg/pr33694.c: Likewise.
+ * gcc.dg/c90-const-expr-2.c: Add check for _WIN64 define.
+ * gcc.dg/c99-const-expr-2.c: Likewise.
+ * gcc.dg/ia64-sync-1.c: Add typedef of size_t, for prototype.
+ * gcc.dg/ia64-sync-2.c: Likewise.
+ * gcc.dg/ia64-sync-3.c: Likewise
+ * gcc.dg/large-size-array.c: Add check for _WIN64 define.
+ * gcc.dg/large-size-array-3.c: Likewise.
+ * gcc.dg/large-size-array-2.c: Add x86_64-*-mingw* for ignore error
+ check.
+ * gcc.dg/large-size-array-4.c: Likewise.
+ * gcc.dg/max-1.c: Replace use of long by ssize_t.
+
+2008-04-24 Steve Ellcey <sje@cup.hp.com>
+
+ * gcc.dg/lower-subreg-1.c: Skip IA64 platform.
+
+2008-04-24 Steve Ellcey <sje@cup.hp.com>
+
+ * gcc.dg/vect/slp-15.c: Fix scan when vect_int_mult is false.
+
+2008-04-24 Steve Ellcey <sje@cup.hp.com>
+
+ PR testsuite/36035
+ * gcc.dg/vect/vect-vfa-slp.c: Remove bad check.
+
+2008-04-24 Jakub Jelinek <jakub@redhat.com>
+
+ * gcc.dg/pr36017.c: Run on all targets, remove -lm from dg-options.
+
+ PR c++/35758
+ * g++.dg/ext/vector14.C: New test.
+
+2008-04-24 Richard Guenther <rguenther@suse.de>
+
+ * gcc.dg/builtin-constant_p-1.c: New testcase.
+ * gcc.dg/builtin-errors.c: Adjust expected error.
+
+2008-04-24 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/36008
+ * gcc.c-torture/execute/20080424-1.c: New test.
+
+2008-04-24 Ira Rosen <irar@il.ibm.com>
+ Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/36034
+ * gcc.c-torture/execute/pr36034-1.c: New testcase.
+ * gcc.c-torture/execute/pr36034-2.c: Likewise.
+
+2008-04-24 Olivier Hainque <hainque@adacore.com>
+
+ * gnat.dg/concat_length.adb: New test.
+
+2008-04-24 Ira Rosen <irar@il.ibm.com>
+
+ PR tree-optimization/35982
+ * gcc.dg/vect/fast-math-pr35982.c: New.
+
+2008-04-24 Danny Smith <dannysmith@users.net>
+
+ * gcc.dg/format/ms-warnI64-1.c: New file.
+
+2008-04-24 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/36015
+ * gcc.dg/pr36015.c: New test.
+
+2008-04-24 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
+
+ PR rtl-optimization/36006
+ * gfortran.dg/pr36006-1.f90: New test.
+ * gfortran.dg/pr36006-2.f90: Ditto.
+
+2008-04-23 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
+ PR fortran/35994
+ * gfortran.dg/minmaxloc_5.f90: New test.
+ * gfortran.dg/minmaxloc_6.f90: New test.
+
+2008-04-23 Steve Ellcey <sje@cup.hp.com>
+
+ * gcc.dg/array-init-1.c: Add big-endian number to check.
+
+2008-04-23 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/27799
+ PR tree-optimization/32921
+ PR tree-optimization/32624
+ * gcc.dg/tree-ssa/pr27799.c: New testcase.
+ * gcc.dg/tree-ssa/20030807-7.c: Remove xfail, scan vrp dump.
+
+2008-04-23 Richard Guenther <rguenther@suse.de>
+
+ PR middle-end/36021
+ * gcc.dg/attr-alloc_size-2.c: New testcase.
+
+2008-04-23 Kai Tietz <kai.tietz@onevision.com>
+
+ * gcc.dg/20020919-1.c (loc_size_t): New type.
+ (_dl_stat): Use loc_size_t to cast pointers.
+ * gcc.c-torture/compile/20010327-1.c: Skip for x86_64-*-mingw*.
+
+2008-04-23 Thomas Koenig <tkoenig@gcc.gnu.org>
+
+ PR libfortran/35988
+ * gfortran.dg/matmul_7.f90: New test.
+
+2008-04-22 Steve Ellcey <sje@cup.hp.com>
+
+ * gcc.dg/struct/wo_prof_global_var.c: Initialize array.
+ * gcc.dg/struct/wo_prof_malloc_size_var.c: Ditto.
+ * gcc.dg/struct/w_prof_local_var.c: Ditto.
+ * gcc.dg/struct/w_prof_global_var.c: Ditto.
+ * gcc.dg/struct/wo_prof_local_var.c: Ditto.
+
+2008-04-22 Jason Merrill <jason@redhat.com>
+
+ PR c++/35316
+ * g++.dg/cpp0x/decltype11.C: New.
+
+2008-04-23 Jakub Jelinek <jakub@redhat.com>
+
+ PR rtl-optimization/36017
+ * gcc.dg/pr36017.c: New test.
+
+2008-04-22 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/35747
+ * g++.dg/ext/stmtexpr13.C: New test.
+
+2008-04-22 Ian Lance Taylor <iant@google.com>
+
+ * gcc.c-torture/compile/20080419-1.c: New test.
+
+2008-04-22 Kris Van Hees <kris.van.hees@oracle.com>
+
+ PR testsuite/35981
+ * g++.dg/ext/utf-cvt.C: Handle 64-bit platforms correctly.
+ Add tests for 'long long'.
+ * gcc.dg/utf-cvt.c: Handle 64-bit platforms correctly.
+ Add tests for 'long long'.
+
+2008-04-22 Nick Clifton <nickc@redhat.com>
+
+ * gcc.dg/Wconversion-real.c: Add missing end of comment marker.
+
+2008-04-21 Uros Bizjak <ubizjak@gmail.com>
+
+ PR target/31486
+ * gcc.target/i386/pr31486.c: New test.
+
+2008-04-21 Adam Nemet <anemet@caviumnetworks.com>
+
+ * gcc.dg/profile-dir-1.c, gcc.dg/profile-dir-2.c,
+ gcc.dg/profile-dir-3.c: Generate tree_profile dump. Check gcda
+ file name there instead of the assembly. Cleanup tree_profile
+ dump file.
+
+2008-04-21 Steve Ellcey <sje@cup.hp.com>
+
+ * gcc.dg/vect/vect-vfa-slp.c: XFAIL if vect_no_align.
+ * gcc.dg/vect/slp-25.c: Ditto.
+ * gcc.dg/vect/vect-outer-5.c: Ditto.
+ * gcc.dg/vect/pr33804.c: Ditto.
+ * gcc.dg/vect/vect-outer-4c.c: Ditto.
+ * gcc.dg/vect/no-vfa-vect-depend-1.c: Ditto.
+ * gcc.dg/vect/pr33953.c: Ditto.
+ * gcc.dg/vect/slp-3.c: Ditto.
+ * gcc.dg/vect/vect-iv-6.c: Ditto.
+
+2008-04-22 Jakub Jelinek <jakub@redhat.com>
+
+ * g++.dg/ext/fixed1.C: Add dg-options.
+
2008-04-21 Uros Bizjak <ubizjak@gmail.com>
PR target/26445
@@ -598,7 +1025,7 @@
2008-04-01 George Helffrich <george@gcc.gnu.org>
- PRs fortran/PR35154, fortran/PR23057
+ PRs fortran/35154, fortran/23057
* gcc.dg/debug/pr35154.c: New test to check that non-Fortran
use of common is unchanged.
@@ -2326,6 +2753,10 @@
PR objc++/34193
* obj-c++.dg/gnu-runtime-2.mm: Fix signature of function main().
+2008-02-08 Sa Liu <saliu@de.ibm.com>
+
+ * gcc.target/spu/intrinsics-3.c: New. Test error messages.
+
2008-02-06 Alexandre Oliva <aoliva@redhat.com>
PR c++/35056
diff --git a/gcc/testsuite/g++.dg/cpp0x/decltype11.C b/gcc/testsuite/g++.dg/cpp0x/decltype11.C
new file mode 100644
index 00000000000..ac32d349a6c
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/decltype11.C
@@ -0,0 +1,12 @@
+// PR c++/35316
+// { dg-options "-std=c++0x" }
+
+template<int> struct A
+{
+ int i : 2;
+
+ void foo()
+ {
+ decltype(i) j;
+ }
+};
diff --git a/gcc/testsuite/g++.dg/ext/fixed1.C b/gcc/testsuite/g++.dg/ext/fixed1.C
index db074a35b0c..9ee27808f46 100644
--- a/gcc/testsuite/g++.dg/ext/fixed1.C
+++ b/gcc/testsuite/g++.dg/ext/fixed1.C
@@ -1,4 +1,5 @@
// PR c++/35325
+// { dg-options "" }
template<int> struct A {};
diff --git a/gcc/testsuite/g++.dg/ext/stmtexpr13.C b/gcc/testsuite/g++.dg/ext/stmtexpr13.C
new file mode 100644
index 00000000000..978da1584e5
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ext/stmtexpr13.C
@@ -0,0 +1,9 @@
+// PR c++/35747
+// { dg-do compile }
+// { dg-options "" }
+
+void
+foo ()
+{
+ ({ i; ({ i; }); 0; }); // { dg-error "was not declared" }
+}
diff --git a/gcc/testsuite/g++.dg/ext/utf-cvt.C b/gcc/testsuite/g++.dg/ext/utf-cvt.C
index 0e6b17a5ad1..3ebc3a19af1 100644
--- a/gcc/testsuite/g++.dg/ext/utf-cvt.C
+++ b/gcc/testsuite/g++.dg/ext/utf-cvt.C
@@ -15,14 +15,17 @@ extern void fui (unsigned int);
extern void f_l (long);
extern void fsl (signed long);
extern void ful (unsigned long);
+extern void f_ll (long long);
+extern void fsll (signed long long);
+extern void full (unsigned long long);
void m(char16_t c0, char32_t c1)
{
- f_c (c0); /* { dg-warning "alter its value" } */
- fsc (c0); /* { dg-warning "alter its value" } */
- fuc (c0); /* { dg-warning "alter its value" } */
- f_s (c0); /* { dg-warning "change the sign" } */
- fss (c0); /* { dg-warning "change the sign" } */
+ f_c (c0); /* { dg-warning "alter its value" } */
+ fsc (c0); /* { dg-warning "alter its value" } */
+ fuc (c0); /* { dg-warning "alter its value" } */
+ f_s (c0); /* { dg-warning "change the sign" } */
+ fss (c0); /* { dg-warning "change the sign" } */
fus (c0);
f_i (c0);
fsi (c0);
@@ -30,17 +33,23 @@ void m(char16_t c0, char32_t c1)
f_l (c0);
fsl (c0);
ful (c0);
+ f_ll (c0);
+ fsll (c0);
+ full (c0);
- f_c (c1); /* { dg-warning "alter its value" } */
- fsc (c1); /* { dg-warning "alter its value" } */
- fuc (c1); /* { dg-warning "alter its value" } */
- f_s (c1); /* { dg-warning "alter its value" } */
- fss (c1); /* { dg-warning "alter its value" } */
- fus (c1); /* { dg-warning "alter its value" } */
- f_i (c1); /* { dg-warning "change the sign" } */
- fsi (c1); /* { dg-warning "change the sign" } */
+ f_c (c1); /* { dg-warning "alter its value" } */
+ fsc (c1); /* { dg-warning "alter its value" } */
+ fuc (c1); /* { dg-warning "alter its value" } */
+ f_s (c1); /* { dg-warning "alter its value" } */
+ fss (c1); /* { dg-warning "alter its value" } */
+ fus (c1); /* { dg-warning "alter its value" } */
+ f_i (c1); /* { dg-warning "change the sign" } */
+ fsi (c1); /* { dg-warning "change the sign" } */
fui (c1);
- f_l (c1); /* { dg-warning "change the sign" } */
- fsl (c1); /* { dg-warning "change the sign" } */
+ f_l (c1); /* { dg-warning "change the sign" "" { target { ilp32 } } } */
+ fsl (c1); /* { dg-warning "change the sign" "" { target { ilp32 } } } */
ful (c1);
+ f_ll (c1);
+ fsll (c1);
+ full (c1);
}
diff --git a/gcc/testsuite/g++.dg/ext/utf16-4.C b/gcc/testsuite/g++.dg/ext/utf16-4.C
index 0fb7459c21e..21cdb53bdeb 100644
--- a/gcc/testsuite/g++.dg/ext/utf16-4.C
+++ b/gcc/testsuite/g++.dg/ext/utf16-4.C
@@ -13,6 +13,6 @@ const static char16_t c5 = U'\u2029';
const static char16_t c6 = U'\U00064321'; /* { dg-warning "implicitly truncated" } */
const static char16_t c7 = L'a';
const static char16_t c8 = L'\u2029';
-const static char16_t c9 = L'\U00064321'; /* { dg-warning "implicitly truncated" } */
-
+const static char16_t c9 = L'\U00064321'; /* { dg-warning "implicitly truncated" "" { target { 4byte_wchar_t } } 16 } */
+ /* { dg-warning "constant too long" "" { target { ! 4byte_wchar_t } } 16 } */
int main () {}
diff --git a/gcc/testsuite/g++.dg/ext/utf32-4.C b/gcc/testsuite/g++.dg/ext/utf32-4.C
index af2fa8db1b1..5da2e822702 100644
--- a/gcc/testsuite/g++.dg/ext/utf32-4.C
+++ b/gcc/testsuite/g++.dg/ext/utf32-4.C
@@ -13,6 +13,6 @@ const static char32_t c5 = u'\u2029';
const static char32_t c6 = u'\U00064321'; /* { dg-warning "constant too long" } */
const static char32_t c7 = L'a';
const static char32_t c8 = L'\u2029';
-const static char32_t c9 = L'\U00064321';
+const static char32_t c9 = L'\U00064321'; /* { dg-warning "constant too long" { target { ! 4byte_wchar_t } } } */
int main () {}
diff --git a/gcc/testsuite/g++.dg/ext/vector14.C b/gcc/testsuite/g++.dg/ext/vector14.C
new file mode 100644
index 00000000000..1739014f6a4
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ext/vector14.C
@@ -0,0 +1,18 @@
+// PR c++/35758
+// { dg-do compile }
+// { dg-options "-msse" { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
+
+#define vector __attribute__((vector_size(16)))
+
+template<int N> vector signed int foo (vector float value) {}
+
+template<int> void foo (float) {}
+
+int
+main ()
+{
+ vector float v;
+ float f;
+ foo<1> (v);
+ foo<1> (f);
+}
diff --git a/gcc/testsuite/g++.dg/init/ref17.C b/gcc/testsuite/g++.dg/init/ref17.C
new file mode 100644
index 00000000000..2c8c22b8d88
--- /dev/null
+++ b/gcc/testsuite/g++.dg/init/ref17.C
@@ -0,0 +1,23 @@
+// PR c++/35650
+// { dg-do compile }
+
+void f1 ();
+
+namespace N
+{
+ using::f1;
+ void f2 ();
+ void f3 ();
+}
+
+using N::f3;
+
+void
+test ()
+{
+ void (&a) () = f1;
+ void (&b) () = N::f1;
+ void (&c) () = N::f2;
+ void (&d) () = f3;
+ void (&e) () = ::f3;
+}
diff --git a/gcc/testsuite/g++.dg/other/error28.C b/gcc/testsuite/g++.dg/other/error28.C
new file mode 100644
index 00000000000..5ac15b7de1e
--- /dev/null
+++ b/gcc/testsuite/g++.dg/other/error28.C
@@ -0,0 +1,8 @@
+// PR c++/35987
+// { dg-do compile }
+
+void
+foo (char *p)
+{
+ if (++p = true); // { dg-error "cannot convert" }
+}
diff --git a/gcc/testsuite/g++.dg/overload/template4.C b/gcc/testsuite/g++.dg/overload/template4.C
new file mode 100644
index 00000000000..4c3ca05e6c2
--- /dev/null
+++ b/gcc/testsuite/g++.dg/overload/template4.C
@@ -0,0 +1,21 @@
+// PR c++/35986
+// { dg-do compile }
+
+namespace
+{
+ template <int> void foo (...); // { dg-error "" "candidate" }
+ template <int> void bar (int, ...); // { dg-error "" "candidate" }
+ void baz (...); // { dg-error "" "candidate" }
+}
+
+template <int> void foo (...); // { dg-error "" "candidate" }
+template <int> void bar (int, ...); // { dg-error "" "candidate" }
+void baz (...); // { dg-error "" "candidate" }
+
+void
+test ()
+{
+ foo <0> (0); // { dg-error "is ambiguous" }
+ bar <1> (0, 1); // { dg-error "is ambiguous" }
+ baz (0); // { dg-error "is ambiguous" }
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/defarg8.C b/gcc/testsuite/g++.old-deja/g++.pt/defarg8.C
index 239672dec43..a72e85c4394 100644
--- a/gcc/testsuite/g++.old-deja/g++.pt/defarg8.C
+++ b/gcc/testsuite/g++.old-deja/g++.pt/defarg8.C
@@ -3,15 +3,15 @@
// Default arguments containing more than one non-nested explicit
// template argument leads to parse error
-// This might be ill formed. See DR 325 (which would like to make it
-// so)
+// This might be ill formed. See DR 325 (one proposed resolution is to make
+// it so)
template <class T> class foo1;
-template <class T, class U> class foo2; // { dg-error "" }
+template <class T, class U> class foo2;
struct bar {
template <class T, class U>
bar(int i = foo1<T>::baz, // { dg-bogus "" } -
int j = int(foo2<T, U>::baz), // ok
- int k = foo2<T, U>::baz) {} // { dg-error "" }
+ int k = foo2<T, U>::baz) {} // ok?
};
diff --git a/gcc/testsuite/gcc.c-torture/compile/20010327-1.c b/gcc/testsuite/gcc.c-torture/compile/20010327-1.c
index 59639e6ed96..f20e3a3e2dc 100644
--- a/gcc/testsuite/gcc.c-torture/compile/20010327-1.c
+++ b/gcc/testsuite/gcc.c-torture/compile/20010327-1.c
@@ -1,5 +1,6 @@
/* { dg-skip-if "non-SI pointers" { m32c-*-* } { "*" } { "" } } */
/* { dg-skip-if "HI mode pointer for avr" { "avr-*-*" } { "*" } { "" } } */
+/* { dg-skip-if "non-SI pointers for w64" { "x86_64-*-mingw*" } { "*" } { "" } } */
/* This testcase tests whether GCC can produce static initialized data
that references addresses of size 'unsigned long', even if that's not
diff --git a/gcc/testsuite/gcc.c-torture/compile/20080419-1.c b/gcc/testsuite/gcc.c-torture/compile/20080419-1.c
new file mode 100644
index 00000000000..b257fea747f
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/20080419-1.c
@@ -0,0 +1,6 @@
+extern void *f();
+void dmi_scan_machine(void) {
+ char *p = f(), *q;
+ for (q = p; q < p + 10; q++)
+ ;
+}
diff --git a/gcc/testsuite/gcc.c-torture/execute/20080424-1.c b/gcc/testsuite/gcc.c-torture/execute/20080424-1.c
new file mode 100644
index 00000000000..4916d907565
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/20080424-1.c
@@ -0,0 +1,31 @@
+/* PR tree-optimization/36008 */
+
+extern void abort (void);
+
+int g[48][3][3];
+
+void __attribute__ ((noinline))
+bar (int x[3][3], int y[3][3])
+{
+ static int i;
+ if (x != g[i + 8] || y != g[i++])
+ abort ();
+}
+
+static inline void __attribute__ ((always_inline))
+foo (int x[][3][3])
+{
+ int i;
+ for (i = 0; i < 8; i++)
+ {
+ int k = i + 8;
+ bar (x[k], x[k - 8]);
+ }
+}
+
+int
+main ()
+{
+ foo (g);
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr36034-1.c b/gcc/testsuite/gcc.c-torture/execute/pr36034-1.c
new file mode 100644
index 00000000000..eddec57cdb6
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/pr36034-1.c
@@ -0,0 +1,32 @@
+double x[5][10] = { { 10, 11, 12, 13, 14, 15, -1, -1, -1, -1 },
+ { 21, 22, 23, 24, 25, 26, -1, -1, -1, -1 },
+ { 32, 33, 34, 35, 36, 37, -1, -1, -1, -1 },
+ { 43, 44, 45, 46, 47, 48, -1, -1, -1, -1 },
+ { 54, 55, 56, 57, 58, 59, -1, -1, -1, -1 } };
+double tmp[5][6];
+
+void __attribute__((noinline))
+test (void)
+{
+ int i, j;
+ for (i = 0; i < 5; ++i)
+ {
+ tmp[i][0] = x[i][0];
+ tmp[i][1] = x[i][1];
+ tmp[i][2] = x[i][2];
+ tmp[i][3] = x[i][3];
+ tmp[i][4] = x[i][4];
+ tmp[i][5] = x[i][5];
+ }
+}
+extern void abort (void);
+int main()
+{
+ int i, j;
+ test();
+ for (i = 0; i < 5; ++i)
+ for (j = 0; j < 6; ++j)
+ if (tmp[i][j] == -1)
+ abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr36034-2.c b/gcc/testsuite/gcc.c-torture/execute/pr36034-2.c
new file mode 100644
index 00000000000..10abb791bbb
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/pr36034-2.c
@@ -0,0 +1,32 @@
+double x[50] = { 10, 11, 12, 13, 14, 15, -1, -1, -1, -1,
+ 21, 22, 23, 24, 25, 26, -1, -1, -1, -1,
+ 32, 33, 34, 35, 36, 37, -1, -1, -1, -1,
+ 43, 44, 45, 46, 47, 48, -1, -1, -1, -1,
+ 54, 55, 56, 57, 58, 59, -1, -1, -1, -1 };
+double tmp[30];
+
+void __attribute__((noinline))
+test (void)
+{
+ int i, j;
+ for (i = 0; i < 5; ++i)
+ {
+ tmp[i*6] = x[i*10];
+ tmp[i*6+1] = x[i*10+1];
+ tmp[i*6+2] = x[i*10+2];
+ tmp[i*6+3] = x[i*10+3];
+ tmp[i*6+4] = x[i*10+4];
+ tmp[i*6+5] = x[i*10+5];
+ }
+}
+extern void abort (void);
+int main()
+{
+ int i, j;
+ test();
+ for (i = 0; i < 5; ++i)
+ for (j = 0; j < 6; ++j)
+ if (tmp[i*6+j] == -1)
+ abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr36077.c b/gcc/testsuite/gcc.c-torture/execute/pr36077.c
new file mode 100644
index 00000000000..09636a10286
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/pr36077.c
@@ -0,0 +1,13 @@
+extern void abort (void);
+
+unsigned int test (unsigned int x)
+{
+ return x / 0x80000001U / 0x00000002U;
+}
+
+int main()
+{
+ if (test(2) != 0)
+ abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr36093.c b/gcc/testsuite/gcc.c-torture/execute/pr36093.c
new file mode 100644
index 00000000000..9549bc306b9
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/pr36093.c
@@ -0,0 +1,28 @@
+extern void abort (void);
+
+typedef struct Bar {
+ char c[129];
+} Bar __attribute__((__aligned__(128)));
+
+typedef struct Foo {
+ Bar bar[4];
+} Foo;
+
+Foo foo[4];
+
+int main()
+{
+ int i, j;
+ Foo *foop = &foo[0];
+
+ for (i=0; i < 4; i++) {
+ Bar *bar = &foop->bar[i];
+ for (j=0; j < 129; j++) {
+ bar->c[j] = 'a' + i;
+ }
+ }
+
+ if (foo[0].bar[3].c[128] != 'd')
+ abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.c-torture/pr36141.c b/gcc/testsuite/gcc.c-torture/pr36141.c
new file mode 100644
index 00000000000..82756199b77
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/pr36141.c
@@ -0,0 +1,17 @@
+extern void ffi_closure_unix (void);
+ffi_prep_closure_loc (void)
+{
+ struct ia64_fd
+ {
+ unsigned long long code_pointer;
+ unsigned long long gp;
+ };
+ struct ffi_ia64_trampoline_struct
+ {
+ unsigned long long code_pointer;
+ };
+ struct ffi_ia64_trampoline_struct *tramp;
+ struct ia64_fd *fd;
+ fd = (struct ia64_fd *)(void *)ffi_closure_unix;
+ tramp->code_pointer = fd->code_pointer;
+}
diff --git a/gcc/testsuite/gcc.dg/20020919-1.c b/gcc/testsuite/gcc.dg/20020919-1.c
index de58b0c91f5..15519bef7b4 100644
--- a/gcc/testsuite/gcc.dg/20020919-1.c
+++ b/gcc/testsuite/gcc.dg/20020919-1.c
@@ -237,12 +237,18 @@ bazllb (long long llp)
/* Real-world example of bug. */
+#ifdef _WIN64
+typedef unsigned int loc_size_t __attribute__ ((mode (DI)));
+#else
+typedef __SIZE_TYPE__ loc_size_t;
+#endif
+
struct stat;
int
_dl_stat (const char *file_name, struct stat *buf)
{
- register long a asm (REG1) = (long) file_name;
- register long b asm (REG2) = (long) buf;
+ register long a asm (REG1) = (long) (loc_size_t) file_name;
+ register long b asm (REG2) = (long) (loc_size_t) buf;
asm volatile ("movu.w %1,$r9\n\tbreak 13" : "=r" (a) : "g" (106), "0" (a), "r" (b) : REG1, REG5); /* { dg-error "conflict" } */
if (a >= 0)
diff --git a/gcc/testsuite/gcc.dg/Wconversion-real.c b/gcc/testsuite/gcc.dg/Wconversion-real.c
index 877fcea391f..4e79fd20e13 100644
--- a/gcc/testsuite/gcc.dg/Wconversion-real.c
+++ b/gcc/testsuite/gcc.dg/Wconversion-real.c
@@ -1,6 +1,6 @@
/* Test for diagnostics for Wconversion for floating-point. */
-/* { dg-do compile }
+/* { dg-do compile } */
/* { dg-options "-std=c99 -Wconversion" } */
float vfloat;
@@ -80,5 +80,3 @@ void h (void)
flongdouble (ld);
vlongdouble = ld;
}
-
-
diff --git a/gcc/testsuite/gcc.dg/Wunreachable-8.c b/gcc/testsuite/gcc.dg/Wunreachable-8.c
index 7fbb2e6ad60..81254ba3b2a 100644
--- a/gcc/testsuite/gcc.dg/Wunreachable-8.c
+++ b/gcc/testsuite/gcc.dg/Wunreachable-8.c
@@ -6,7 +6,7 @@ float Factorial(float X)
int k,j;
for (k=1; k < 5; k++)
{
- val += 1.0;
+ val += 1.0; /* { dg-bogus "will never be executed" "" { xfail *-*-* } } */
}
return (val); /* { dg-bogus "will never be executed" } */
}
diff --git a/gcc/testsuite/gcc.dg/array-init-1.c b/gcc/testsuite/gcc.dg/array-init-1.c
index 57669183dbb..0ab86346f7d 100644
--- a/gcc/testsuite/gcc.dg/array-init-1.c
+++ b/gcc/testsuite/gcc.dg/array-init-1.c
@@ -22,4 +22,4 @@ bar (void)
}
/* { dg-final { scan-assembler-not "abcdefghi" { target i?86-*-* x86_64-*-* ia64-*-* } } } */
-/* { dg-final { scan-assembler-times "7523094288207667809\|6867666564636261\|1684234849\|64636261" 2 { target i?86-*-* x86_64-*-* ia64-*-* } } } */
+/* { dg-final { scan-assembler-times "7017280452245743464\|7523094288207667809\|6867666564636261\|1684234849\|64636261" 2 { target i?86-*-* x86_64-*-* ia64-*-* } } } */
diff --git a/gcc/testsuite/gcc.dg/array-quals-1.c b/gcc/testsuite/gcc.dg/array-quals-1.c
index 24027bc8ce3..514daf8bc55 100644
--- a/gcc/testsuite/gcc.dg/array-quals-1.c
+++ b/gcc/testsuite/gcc.dg/array-quals-1.c
@@ -4,7 +4,7 @@
/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
/* { dg-do compile } */
/* The MMIX port always switches to the .data section at the end of a file. */
-/* { dg-final { scan-assembler-not "\\.data(?!\\.rel\\.ro)" { xfail powerpc*-*-aix* mmix-*-* } } } */
+/* { dg-final { scan-assembler-not "\\.data(?!\\.rel\\.ro)" { xfail powerpc*-*-aix* mmix-*-* x86_64-*-mingw* } } } */
static const int a[2] = { 1, 2 };
const int a1[2] = { 1, 2 };
typedef const int ci;
diff --git a/gcc/testsuite/gcc.dg/attr-alloc_size-2.c b/gcc/testsuite/gcc.dg/attr-alloc_size-2.c
new file mode 100644
index 00000000000..3cac807370f
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/attr-alloc_size-2.c
@@ -0,0 +1,4 @@
+/* { dg-do compile } */
+
+char *foo() __attribute__((alloc_size(1))); /* { dg-warning "outside range" } */
+
diff --git a/gcc/testsuite/gcc.dg/builtin-constant_p-1.c b/gcc/testsuite/gcc.dg/builtin-constant_p-1.c
new file mode 100644
index 00000000000..b0b34f4a1e1
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/builtin-constant_p-1.c
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+
+int main()
+{
+ if (__builtin_constant_p ()) /* { dg-error "not enough" } */
+ return 0;
+ if (__builtin_constant_p (5, 6)) /* { dg-error "too many" } */
+ return 1;
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/builtins-12.c b/gcc/testsuite/gcc.dg/builtins-12.c
index 22ba8ce3d31..61a80edf78f 100644
--- a/gcc/testsuite/gcc.dg/builtins-12.c
+++ b/gcc/testsuite/gcc.dg/builtins-12.c
@@ -6,6 +6,7 @@
Written by Roger Sayle, 12th April 2003. */
/* { dg-do compile } */
+/* { dg-options "-ansi" } */
/* { dg-final { scan-assembler-not "__builtin_" } } */
typedef __SIZE_TYPE__ size_t;
diff --git a/gcc/testsuite/gcc.dg/builtins-13.c b/gcc/testsuite/gcc.dg/builtins-13.c
index befcd3447ad..149407b5406 100644
--- a/gcc/testsuite/gcc.dg/builtins-13.c
+++ b/gcc/testsuite/gcc.dg/builtins-13.c
@@ -6,6 +6,7 @@
Written by Roger Sayle, 12th April 2003. */
/* { dg-do link } */
+/* { dg-options "-ansi" } */
typedef __SIZE_TYPE__ size_t;
diff --git a/gcc/testsuite/gcc.dg/builtins-error.c b/gcc/testsuite/gcc.dg/builtins-error.c
index 6acc215a97f..9f401bba1a0 100644
--- a/gcc/testsuite/gcc.dg/builtins-error.c
+++ b/gcc/testsuite/gcc.dg/builtins-error.c
@@ -9,7 +9,7 @@ int test1(struct X x)
int test2(double x)
{
- return __builtin_isgreater(x); /* { dg-error "too few arguments" } */
+ return __builtin_isgreater(x); /* { dg-error "not enough arguments" } */
}
int test3(double x)
diff --git a/gcc/testsuite/gcc.dg/c90-const-expr-2.c b/gcc/testsuite/gcc.dg/c90-const-expr-2.c
index 8c2c99f5cdb..cad5bc8673b 100644
--- a/gcc/testsuite/gcc.dg/c90-const-expr-2.c
+++ b/gcc/testsuite/gcc.dg/c90-const-expr-2.c
@@ -14,7 +14,7 @@ int *a;
int b;
long *c;
-#ifdef _LP64
+#if defined(_LP64) || defined(_WIN64)
#define ZERO 0L
#else
#define ZERO 0
diff --git a/gcc/testsuite/gcc.dg/c99-const-expr-2.c b/gcc/testsuite/gcc.dg/c99-const-expr-2.c
index 1a457e51a7d..555a58c0a63 100644
--- a/gcc/testsuite/gcc.dg/c99-const-expr-2.c
+++ b/gcc/testsuite/gcc.dg/c99-const-expr-2.c
@@ -14,7 +14,7 @@ int *a;
int b;
long *c;
-#ifdef _LP64
+#if defined(_LP64) || defined(_WIN64)
#define ZERO 0L
#else
#define ZERO 0
diff --git a/gcc/testsuite/gcc.dg/fold-plusmult.c b/gcc/testsuite/gcc.dg/fold-plusmult.c
new file mode 100644
index 00000000000..d584b958874
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/fold-plusmult.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-fdump-tree-original" } */
+
+int test1 (int a)
+{
+ return 2*a + 2*a;
+}
+
+int test2 (int a)
+{
+ return (a + a)*2;
+}
+
+/* { dg-final { scan-tree-dump-times "<a> \\\* 4" 2 "original" } } */
+/* { dg-final { cleanup-tree-dump "original" } } */
diff --git a/gcc/testsuite/gcc.dg/format/ms-warnI64-1.c b/gcc/testsuite/gcc.dg/format/ms-warnI64-1.c
new file mode 100644
index 00000000000..b5d31d2fe50
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/format/ms-warnI64-1.c
@@ -0,0 +1,28 @@
+/* Test for printf formats. Test for ISO C warnings with MS "I64"
+ extension.*/
+
+/* { dg-do compile { target { *-*-mingw* } } } */
+/* { dg-options "-std=iso9899:1990 -pedantic -Wformat -Wno-long-long" } */
+
+#define USE_SYSTEM_FORMATS
+#include "format.h"
+
+void
+foo (long long ll, unsigned long long ull, long long *lln,
+ long long *llp, unsigned long long *ullp)
+{
+ printf ("%I64d", ll); /* { dg-warning "'I64' ms_printf length modifier" "printf %I64d" } */
+ printf ("%I64i", ll); /* { dg-warning "'I64' ms_printf length modifier" "printf %I64i" } */
+ printf ("%I64o", ull); /* { dg-warning "'I64' ms_printf length modifier" "printf %I64o" } */
+ printf ("%I64u", ull); /* { dg-warning "'I64' ms_printf length modifier" "printf %I64u" } */
+ printf ("%I64x", ull); /* { dg-warning "'I64' ms_printf length modifier" "printf %I64x" } */
+ printf ("%I64X", ull); /* { dg-warning "'I64' ms_printf length modifier" "printf %I64X" } */
+ printf ("%I64n", lln); /* { dg-warning "'I64' ms_printf length modifier" "printf %I64n" } */
+ scanf ("%I64d", llp); /* { dg-warning "'I64' ms_scanf length modifier" "scanf %I64d" } */
+ scanf ("%I64i", llp); /* { dg-warning "'I64' ms_scanf length modifier" "scanf %I64i" } */
+ scanf ("%I64o", ullp); /* { dg-warning "'I64' ms_scanf length modifier" "scanf %I64o" } */
+ scanf ("%I64u", ullp); /* { dg-warning "'I64' ms_scanf length modifier" "scanf %I64u" } */
+ scanf ("%I64x", ullp); /* { dg-warning "'I64' ms_scanf length modifier" "scanf %I64x" } */
+ scanf ("%I64X", ullp); /* { dg-warning "'I64' ms_scanf length modifier" "scanf %I64X" } */
+ scanf ("%I64n", llp); /* { dg-warning "'I64' ms_scanf length modifier" "scanf %I64n" } */
+}
diff --git a/gcc/testsuite/gcc.dg/ia64-sync-1.c b/gcc/testsuite/gcc.dg/ia64-sync-1.c
index 8f4512e4fbf..efca5d7a049 100644
--- a/gcc/testsuite/gcc.dg/ia64-sync-1.c
+++ b/gcc/testsuite/gcc.dg/ia64-sync-1.c
@@ -7,8 +7,10 @@
/* Test basic functionality of the intrinsics. The operations should
not be optimized away if no one checks the return values. */
+__extension__ typedef __SIZE_TYPE__ size_t;
+
extern void abort (void);
-extern void *memcpy (void *, const void *, __SIZE_TYPE__);
+extern void *memcpy (void *, const void *, size_t);
static int AI[12];
static int init_noret_si[12] = { 0, 0, 0, 1, 0, 0, 0, 0, -1, 0, 0, 0 };
diff --git a/gcc/testsuite/gcc.dg/ia64-sync-2.c b/gcc/testsuite/gcc.dg/ia64-sync-2.c
index bb8c728bea3..b3ff127d9a3 100644
--- a/gcc/testsuite/gcc.dg/ia64-sync-2.c
+++ b/gcc/testsuite/gcc.dg/ia64-sync-2.c
@@ -6,8 +6,10 @@
/* Test basic functionality of the intrinsics. */
+__extension__ typedef __SIZE_TYPE__ size_t;
+
extern void abort (void);
-extern void *memcpy (void *, const void *, __SIZE_TYPE__);
+extern void *memcpy (void *, const void *, size_t);
static int AI[18];
static int init_si[18] = { 0,0,0,1,0,0,0,0,-1,0,0,0,0,0,-1,0,0,0 };
diff --git a/gcc/testsuite/gcc.dg/ia64-sync-3.c b/gcc/testsuite/gcc.dg/ia64-sync-3.c
index d093cdd4cb1..965d4359e86 100644
--- a/gcc/testsuite/gcc.dg/ia64-sync-3.c
+++ b/gcc/testsuite/gcc.dg/ia64-sync-3.c
@@ -6,8 +6,10 @@
/* Test basic functionality of the intrinsics. */
+__extension__ typedef __SIZE_TYPE__ size_t;
+
extern void abort (void);
-extern void *memcpy (void *, const void *, __SIZE_TYPE__);
+extern void *memcpy (void *, const void *, size_t);
static int AI[4];
static int init_si[4] = { -30,-30,-50,-50 };
diff --git a/gcc/testsuite/gcc.dg/large-size-array-2.c b/gcc/testsuite/gcc.dg/large-size-array-2.c
index 5411b838fac..a1da14b1f72 100644
--- a/gcc/testsuite/gcc.dg/large-size-array-2.c
+++ b/gcc/testsuite/gcc.dg/large-size-array-2.c
@@ -4,4 +4,4 @@
static char * name[] = {
[0x80000000] = "bar"
};
-/* { dg-error "too large" "" { target { ! lp64 } } 6 } */
+/* { dg-error "too large" "" { target { { ! lp64 } || x86_64-*-mingw* } } 6 } */
diff --git a/gcc/testsuite/gcc.dg/large-size-array-3.c b/gcc/testsuite/gcc.dg/large-size-array-3.c
index 0b6149ba5a5..ea13b933ae5 100644
--- a/gcc/testsuite/gcc.dg/large-size-array-3.c
+++ b/gcc/testsuite/gcc.dg/large-size-array-3.c
@@ -1,7 +1,7 @@
/* { dg-do compile } */
#include <limits.h>
-#ifdef __LP64__
+#if defined(__LP64__) || defined(_WIN64)
#define DIM (UINT_MAX>>1)+1
#else
#define DIM 65536
diff --git a/gcc/testsuite/gcc.dg/large-size-array-4.c b/gcc/testsuite/gcc.dg/large-size-array-4.c
index 020d57e2c64..4f88f2c93ed 100644
--- a/gcc/testsuite/gcc.dg/large-size-array-4.c
+++ b/gcc/testsuite/gcc.dg/large-size-array-4.c
@@ -4,4 +4,4 @@
static char * name[] = {
[0x80000000] = "bar"
};
-/* { dg-error "too large" "" { target { ! lp64 } } 6 } */
+/* { dg-error "too large" "" { target { { ! lp64 } || x86_64-*-mingw* } } 6 } */
diff --git a/gcc/testsuite/gcc.dg/large-size-array.c b/gcc/testsuite/gcc.dg/large-size-array.c
index 855d77e5e67..6ea76066934 100644
--- a/gcc/testsuite/gcc.dg/large-size-array.c
+++ b/gcc/testsuite/gcc.dg/large-size-array.c
@@ -1,7 +1,7 @@
/* { dg-do compile } */
#include <limits.h>
-#ifdef __LP64__
+#if defined(__LP64__) || defined(_WIN64)
#define DIM UINT_MAX>>1
#else
#define DIM USHRT_MAX>>1
diff --git a/gcc/testsuite/gcc.dg/lower-subreg-1.c b/gcc/testsuite/gcc.dg/lower-subreg-1.c
index 37c884a90c9..01851268c11 100644
--- a/gcc/testsuite/gcc.dg/lower-subreg-1.c
+++ b/gcc/testsuite/gcc.dg/lower-subreg-1.c
@@ -1,4 +1,4 @@
-/* { dg-do compile { target { ! mips64 } } } */
+/* { dg-do compile { target { { ! mips64 } && { ! ia64-*-* } } } } */
/* { dg-options "-O -fdump-rtl-subreg" } */
/* { dg-require-effective-target ilp32 } */
diff --git a/gcc/testsuite/gcc.dg/max-1.c b/gcc/testsuite/gcc.dg/max-1.c
index a5f16056c31..40f2145c038 100644
--- a/gcc/testsuite/gcc.dg/max-1.c
+++ b/gcc/testsuite/gcc.dg/max-1.c
@@ -7,14 +7,19 @@
/* m32c has varying sized pointers */
/* { dg-skip-if "" { "m32c-*-*" } { "*" } { "-mcpu=m32c" "-mcpu=m32cm" } } */
+/* Kludge to make it signed. */
+#define unsigned signed
+__extension__ typedef __SIZE_TYPE__ ssize_t;
+#undef unsigned
+
extern void abort (void);
-long fff[10];
+ssize_t fff[10];
-void f(long a, long b)
+void f(ssize_t a, ssize_t b)
{
- long crcc = b;
- long d = *((long*)(a+1));
+ ssize_t crcc = b;
+ ssize_t d = *((ssize_t*)(a+1));
int i;
a = d >= b? d:b;
@@ -27,11 +32,11 @@ void f(long a, long b)
/* The variable a cannot be a local variable as we get better aliasing
now and decide that the store to a is dead. The better aliasing comes
from better representation of pointer arithmetic. */
-long a = 10;
+ssize_t a = 10;
int main(void)
{
int i;
- f((long)(&a)-1,0);
+ f((ssize_t)(&a)-1,0);
for(i = 0;i<10;i++)
if (fff[i]!=10)
abort ();
diff --git a/gcc/testsuite/gcc.dg/nested-func-5.c b/gcc/testsuite/gcc.dg/nested-func-5.c
index 5076dbd5049..3545f37e5cc 100644
--- a/gcc/testsuite/gcc.dg/nested-func-5.c
+++ b/gcc/testsuite/gcc.dg/nested-func-5.c
@@ -1,6 +1,7 @@
/* { dg-do compile } */
/* { dg-options "-fexceptions" } */
/* PR28516: ICE generating ARM unwind directives for nested functions. */
+/* { dg-require-effective-target trampolines } */
void ex(int (*)(void));
void foo(int i)
diff --git a/gcc/testsuite/gcc.dg/pr25682.c b/gcc/testsuite/gcc.dg/pr25682.c
index 3a1d7c2ba59..4118862a1ff 100644
--- a/gcc/testsuite/gcc.dg/pr25682.c
+++ b/gcc/testsuite/gcc.dg/pr25682.c
@@ -1,5 +1,6 @@
/* PR c/25682 */
/* { dg-do compile } */
+/* { dg-options "-ansi" } */
/* Test whether we don't ICE on questionable constructs where offsetof
should have been used instead. */
diff --git a/gcc/testsuite/gcc.dg/pr33694.c b/gcc/testsuite/gcc.dg/pr33694.c
index eb7655e8585..fa62b9eaed2 100644
--- a/gcc/testsuite/gcc.dg/pr33694.c
+++ b/gcc/testsuite/gcc.dg/pr33694.c
@@ -1,4 +1,5 @@
/* { dg-do compile } */
+/* { dg-options "-ansi" } */
/* This used to ICE with type-checking enabled. */
diff --git a/gcc/testsuite/gcc.dg/pr36015.c b/gcc/testsuite/gcc.dg/pr36015.c
new file mode 100644
index 00000000000..456ec6ad954
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr36015.c
@@ -0,0 +1,22 @@
+/* PR target/36015 */
+/* { dg-do run } */
+/* { dg-options "-O0" } */
+/* { dg-options "-O0 -mregparm=3" { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
+
+static int test ();
+
+int
+main (void)
+{
+ test (0, 1, 2, 3, 4, 5, 6, 7);
+ return 0;
+}
+
+static int
+test (int a, int b, int c, int d, int e, int f, int g, int h)
+{
+ if (a != 0 || b != 1 || c != 2 || d != 3
+ || e != 4 || f != 5 || g != 6 || h != 7)
+ __builtin_abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/pr36017.c b/gcc/testsuite/gcc.dg/pr36017.c
new file mode 100644
index 00000000000..2af71e6006e
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr36017.c
@@ -0,0 +1,29 @@
+/* PR rtl-optimization/36017 */
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+
+extern double sqrt (double);
+extern void abort (void);
+
+__attribute__((noinline)) double
+foo (double a)
+{
+ double b, c, d = 0.7;
+ if (a <= d)
+ b = sqrt (d * a);
+ else
+ {
+ c = (1.0 - d) * (1.0 - a);
+ b = c > 0 ? 1.0 - sqrt (c) : 1.0;
+ }
+ return b;
+}
+
+int
+main (void)
+{
+ double c = foo (0.5);
+ if (c > 0.5917)
+ abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/profile-dir-1.c b/gcc/testsuite/gcc.dg/profile-dir-1.c
index 78fbcb20eb5..a0a22ffb0b0 100644
--- a/gcc/testsuite/gcc.dg/profile-dir-1.c
+++ b/gcc/testsuite/gcc.dg/profile-dir-1.c
@@ -1,6 +1,6 @@
/* { dg-do compile } */
-/* { dg-options "-O -fprofile-generate=." } */
-/* { dg-final { scan-assembler "\"./profile-dir-1.gcda\"" } } */
+/* { dg-options "-O -fprofile-generate=. -fdump-tree-tree_profile" } */
+/* { dg-final { scan-tree-dump " ./profile-dir-1.gcda" "tree_profile" } } */
int
main(void)
@@ -9,3 +9,4 @@ main(void)
}
/* { dg-final { cleanup-coverage-files } } */
+/* { dg-final { cleanup-tree-dump "tree_profile" } } */
diff --git a/gcc/testsuite/gcc.dg/profile-dir-2.c b/gcc/testsuite/gcc.dg/profile-dir-2.c
index af55b36a400..454f0641aa2 100644
--- a/gcc/testsuite/gcc.dg/profile-dir-2.c
+++ b/gcc/testsuite/gcc.dg/profile-dir-2.c
@@ -1,6 +1,6 @@
/* { dg-do compile } */
-/* { dg-options "-O -fprofile-generate" } */
-/* { dg-final { scan-assembler "/profile-dir-2.gcda" } } */
+/* { dg-options "-O -fprofile-generate -fdump-tree-tree_profile" } */
+/* { dg-final { scan-tree-dump "/profile-dir-2.gcda" "tree_profile" } } */
int
main(void)
@@ -9,3 +9,4 @@ main(void)
}
/* { dg-final { cleanup-coverage-files } } */
+/* { dg-final { cleanup-tree-dump "tree_profile" } } */
diff --git a/gcc/testsuite/gcc.dg/profile-dir-3.c b/gcc/testsuite/gcc.dg/profile-dir-3.c
index 0a924e97251..29b0a558712 100644
--- a/gcc/testsuite/gcc.dg/profile-dir-3.c
+++ b/gcc/testsuite/gcc.dg/profile-dir-3.c
@@ -1,6 +1,6 @@
/* { dg-do compile } */
-/* { dg-options "-O -fprofile-generate -fprofile-dir=." } */
-/* { dg-final { scan-assembler "\"./profile-dir-3.gcda\"" } } */
+/* { dg-options "-O -fprofile-generate -fprofile-dir=. -fdump-tree-tree_profile" } */
+/* { dg-final { scan-tree-dump " ./profile-dir-3.gcda" "tree_profile" } } */
int
main(void)
@@ -9,3 +9,4 @@ main(void)
}
/* { dg-final { cleanup-coverage-files } } */
+/* { dg-final { cleanup-tree-dump "tree_profile" } } */
diff --git a/gcc/testsuite/gcc.dg/struct/w_prof_global_var.c b/gcc/testsuite/gcc.dg/struct/w_prof_global_var.c
index 5fa1ca55da6..8f1ae752fd3 100644
--- a/gcc/testsuite/gcc.dg/struct/w_prof_global_var.c
+++ b/gcc/testsuite/gcc.dg/struct/w_prof_global_var.c
@@ -15,6 +15,10 @@ main ()
int i, sum;
p = malloc (N * sizeof (str_t));
+
+ for (i = 0; i < N; i++)
+ p[i].b = i;
+
for (i = 0; i < N; i++)
p[i].a = p[i].b + 1;
diff --git a/gcc/testsuite/gcc.dg/struct/w_prof_local_var.c b/gcc/testsuite/gcc.dg/struct/w_prof_local_var.c
index 91d580fda69..c84863c3790 100644
--- a/gcc/testsuite/gcc.dg/struct/w_prof_local_var.c
+++ b/gcc/testsuite/gcc.dg/struct/w_prof_local_var.c
@@ -13,6 +13,10 @@ main ()
int i, sum;
str_t * p = malloc (N * sizeof (str_t));
+
+ for (i = 0; i < N; i++)
+ p[i].b = i;
+
for (i = 0; i < N; i++)
p[i].a = p[i].b + 1;
diff --git a/gcc/testsuite/gcc.dg/struct/wo_prof_global_var.c b/gcc/testsuite/gcc.dg/struct/wo_prof_global_var.c
index 7e08e96f7b4..a38dd58b021 100644
--- a/gcc/testsuite/gcc.dg/struct/wo_prof_global_var.c
+++ b/gcc/testsuite/gcc.dg/struct/wo_prof_global_var.c
@@ -18,6 +18,10 @@ main ()
int i, sum;
p = malloc (N * sizeof (str_t));
+
+ for (i = 0; i < N; i++)
+ p[i].b = i;
+
for (i = 0; i < N; i++)
p[i].a = p[i].b + 1;
diff --git a/gcc/testsuite/gcc.dg/struct/wo_prof_local_var.c b/gcc/testsuite/gcc.dg/struct/wo_prof_local_var.c
index e931efa1272..65b31978312 100644
--- a/gcc/testsuite/gcc.dg/struct/wo_prof_local_var.c
+++ b/gcc/testsuite/gcc.dg/struct/wo_prof_local_var.c
@@ -16,6 +16,10 @@ main ()
int i, sum;
str_t * p = malloc (N * sizeof (str_t));
+
+ for (i = 0; i < N; i++)
+ p[i].b = i;
+
for (i = 0; i < N; i++)
p[i].a = p[i].b + 1;
diff --git a/gcc/testsuite/gcc.dg/struct/wo_prof_malloc_size_var.c b/gcc/testsuite/gcc.dg/struct/wo_prof_malloc_size_var.c
index 32842b0a7eb..7e80baba7d8 100644
--- a/gcc/testsuite/gcc.dg/struct/wo_prof_malloc_size_var.c
+++ b/gcc/testsuite/gcc.dg/struct/wo_prof_malloc_size_var.c
@@ -22,6 +22,9 @@ main ()
return 0;
for (i = 0; i < N; i++)
+ p[i].b = i;
+
+ for (i = 0; i < N; i++)
p[i].a = p[i].b + 1;
for (i = 0; i < N; i++)
diff --git a/gcc/testsuite/gcc.dg/sync-2.c b/gcc/testsuite/gcc.dg/sync-2.c
index 9849a705e27..d0e3f2cbe77 100644
--- a/gcc/testsuite/gcc.dg/sync-2.c
+++ b/gcc/testsuite/gcc.dg/sync-2.c
@@ -1,5 +1,6 @@
/* { dg-do run } */
/* { dg-require-effective-target sync_char_short } */
+/* { dg-options "-ansi" } */
/* { dg-options "-march=i486" { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
/* { dg-options "-mcpu=v9" { target sparc*-*-* } } */
diff --git a/gcc/testsuite/gcc.dg/tls/emutls-1.c b/gcc/testsuite/gcc.dg/tls/emutls-1.c
new file mode 100644
index 00000000000..a0dea509434
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tls/emutls-1.c
@@ -0,0 +1,21 @@
+/* { dg-do run { target *-wrs-vxworks } } */
+/* { dg-require-effective-target tls } */
+
+/* vxworks' TLS model requires no extra padding on the tls proxy
+ objects. */
+
+__thread int i;
+__thread int j;
+
+extern int __tls__i;
+extern int __tls__j;
+
+int main ()
+{
+ int delta = ((char *)&__tls__j - (char *)&__tls__i);
+
+ if (delta < 0)
+ delta = -delta;
+
+ return delta != 12;
+}
diff --git a/gcc/testsuite/gcc.dg/tls/section-2.c b/gcc/testsuite/gcc.dg/tls/section-2.c
new file mode 100644
index 00000000000..8f11def96f9
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tls/section-2.c
@@ -0,0 +1,8 @@
+/* Verify that we get errors for trying to put TLS data in
+ sections which can't work. */
+/* { dg-require-effective-target tls } */
+/* { dg-do compile { target *-*-vxworks } } */
+
+#define A(X) __attribute__((section(X)))
+
+__thread int i A("foo"); /* { dg-error "cannot be overridden" } */
diff --git a/gcc/testsuite/gcc.dg/torture/nested-fn-1.c b/gcc/testsuite/gcc.dg/torture/nested-fn-1.c
index a396def7eaa..99e852344a9 100644
--- a/gcc/testsuite/gcc.dg/torture/nested-fn-1.c
+++ b/gcc/testsuite/gcc.dg/torture/nested-fn-1.c
@@ -2,6 +2,7 @@
/* Test whether unused nested functions aren't emitted into the assembly. */
/* { dg-do compile } */
/* { dg-options "-g0" } */
+/* { dg-require-effective-target trampolines } */
int
fn1 (int x)
diff --git a/gcc/testsuite/gcc.dg/torture/pr36066.c b/gcc/testsuite/gcc.dg/torture/pr36066.c
new file mode 100644
index 00000000000..0e1d1ce3040
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr36066.c
@@ -0,0 +1,54 @@
+/* { dg-do compile } */
+/* { dg-options "-funsafe-loop-optimizations -ftree-vrp" } */
+
+typedef int FLAC__int32;
+typedef int FLAC__bool;
+typedef struct { } FLAC__Subframe;
+typedef enum { FLAC__CHANNEL_ASSIGNMENT_INDEPENDENT = 0, FLAC__CHANNEL_ASSIGNMENT_LEFT_SIDE = 1, FLAC__CHANNEL_ASSIGNMENT_RIGHT_SIDE = 2, FLAC__CHANNEL_ASSIGNMENT_MID_SIDE = 3 } FLAC__ChannelAssignment;
+typedef struct {
+ struct FLAC__StreamEncoderProtected *protected_;
+ struct FLAC__StreamEncoderPrivate *private_;
+} FLAC__StreamEncoder;
+typedef struct FLAC__StreamEncoderProtected {
+ FLAC__bool loose_mid_side_stereo;
+ unsigned channels;
+ unsigned blocksize;
+} FLAC__StreamEncoderProtected;
+typedef struct FLAC__StreamEncoderPrivate {
+ FLAC__int32 *integer_signal[(8u)];
+ FLAC__Subframe subframe_workspace_mid_side[2][2];
+ unsigned best_subframe_mid_side[2];
+ unsigned loose_mid_side_stereo_frame_count;
+} FLAC__StreamEncoderPrivate;
+static void get_wasted_bits_(FLAC__int32 signal[], unsigned samples)
+{
+ unsigned i;
+ FLAC__int32 x = 0;
+ for(i = 0; i < samples && !(x&1); i++)
+ x |= signal[i];
+}
+FLAC__Subframe * process_subframes_(FLAC__StreamEncoder *encoder, unsigned *bits)
+{
+ unsigned channel;
+ FLAC__Subframe *left_subframe = 0;
+ FLAC__ChannelAssignment channel_assignment;
+ for(channel = 0; channel < encoder->protected_->channels; channel++)
+ get_wasted_bits_(encoder->private_->integer_signal[channel], encoder->protected_->blocksize);
+ if(encoder->protected_->loose_mid_side_stereo && encoder->private_->loose_mid_side_stereo_frame_count > 0)
+ channel_assignment = FLAC__CHANNEL_ASSIGNMENT_MID_SIDE;
+ else {
+ FLAC__ChannelAssignment ca = (FLAC__ChannelAssignment)1;
+ unsigned min_bits = bits[0];
+ for(channel_assignment = (FLAC__ChannelAssignment)0; (int)ca <= 3; ca = (FLAC__ChannelAssignment)((int)ca + 1))
+ if(bits[ca] < min_bits)
+ channel_assignment = ca;
+ }
+ switch(channel_assignment) {
+ case FLAC__CHANNEL_ASSIGNMENT_INDEPENDENT:
+ case FLAC__CHANNEL_ASSIGNMENT_LEFT_SIDE:
+ case FLAC__CHANNEL_ASSIGNMENT_RIGHT_SIDE:
+ case FLAC__CHANNEL_ASSIGNMENT_MID_SIDE:
+ left_subframe = &encoder->private_->subframe_workspace_mid_side[0][encoder->private_->best_subframe_mid_side[0]];
+ }
+ return left_subframe;
+}
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030807-7.c b/gcc/testsuite/gcc.dg/tree-ssa/20030807-7.c
index 253c27ac4f7..f9f5fb798ef 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/20030807-7.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/20030807-7.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O2 -fdump-tree-dom3" } */
+/* { dg-options "-O2 -fdump-tree-vrp1" } */
extern void abort (void);
@@ -32,7 +32,6 @@ simplify_condition (cond_p)
c_simplify_stmt (&decl);
}
-/* There should be exactly one IF conditional. TBAA is not able to
- determine that 'decl' and 'cond' can't alias. */
-/* { dg-final { scan-tree-dump-times "if " 1 "dom3" { xfail *-*-* } } } */
-/* { dg-final { cleanup-tree-dump "dom3" } } */
+/* There should be exactly one IF conditional. */
+/* { dg-final { scan-tree-dump-times "if " 1 "vrp1" } } */
+/* { dg-final { cleanup-tree-dump "vrp1" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/forwprop-5.c b/gcc/testsuite/gcc.dg/tree-ssa/forwprop-5.c
new file mode 100644
index 00000000000..710bc5dd114
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/forwprop-5.c
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-forwprop1 -w" } */
+
+#define vector __attribute__((vector_size(16) ))
+struct VecClass
+{
+ vector float v;
+};
+
+vector float foo( vector float v )
+{
+ vector float x = v;
+ x = x + x;
+ struct VecClass y = *(struct VecClass*)&x;
+ return y.v;
+}
+
+/* We should be able to convert the cast to a VCE in forwprop1. */
+/* { dg-final { scan-tree-dump-times "VIEW_CONVERT_EXPR" 1 "forwprop1"} } */
+/* { dg-final { cleanup-tree-dump "forwprop1" } } */
+
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/forwprop-6.c b/gcc/testsuite/gcc.dg/tree-ssa/forwprop-6.c
new file mode 100644
index 00000000000..7df9f45ab17
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/forwprop-6.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-forwprop1 -W -Wall" } */
+
+
+int b;
+void f(void)
+{
+ float a;
+ a = 1;
+ b = *(int*)&a; /* { dg-warning "aliasing" } */
+}
+
+/* We should be able to convert the cast to a VCE in forwprop1,
+ even if there is an aliasing violation. */
+/* { dg-final { scan-tree-dump-times "VIEW_CONVERT_EXPR" 1 "forwprop1"} } */
+/* { dg-final { cleanup-tree-dump "forwprop1" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/forwprop-7.c b/gcc/testsuite/gcc.dg/tree-ssa/forwprop-7.c
new file mode 100644
index 00000000000..6b894b5b7c6
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/forwprop-7.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-forwprop1 -W -Wall" } */
+
+int i;
+int foo(void)
+{
+ volatile int *p = (volatile int *)&i;
+ return *p + *p;
+}
+
+/* We should not convert the cast to a VCE in forwprop1 as we have a volatile reference. */
+/* { dg-final { scan-tree-dump-times "VIEW_CONVERT_EXPR" 0 "forwprop1"} } */
+/* { dg-final { scan-tree-dump-times "volatile int" 2 "forwprop1"} } */
+/* { dg-final { cleanup-tree-dump "forwprop1" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/forwprop-8.c b/gcc/testsuite/gcc.dg/tree-ssa/forwprop-8.c
new file mode 100644
index 00000000000..4e0751f8119
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/forwprop-8.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-forwprop1 -W -Wall" } */
+
+
+struct X { int a[5]; };
+int foo(struct X *q)
+{
+ int (*pointer)[5] = &q->a;
+ return (*pointer)[0];
+}
+
+
+/* We should have propragated &q->a into (*pointer). */
+/* { dg-final { scan-tree-dump-times "pointer" 0 "forwprop1"} } */
+/* { dg-final { scan-tree-dump "->a\\\[0\\\]" "forwprop1" } } */
+/* { dg-final { cleanup-tree-dump "forwprop1" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/forwprop-9.c b/gcc/testsuite/gcc.dg/tree-ssa/forwprop-9.c
new file mode 100644
index 00000000000..70630d01a34
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/forwprop-9.c
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-final_cleanup -W -Wall -fno-early-inlining" } */
+
+
+int b;
+unsigned a;
+static inline int *g(void)
+{
+ a = 1;
+ return (int*)&a;
+}
+void f(void)
+{
+ b = *g();
+}
+/* We should have converted the assignments to two = 1. */
+/* { dg-final { scan-tree-dump-times " = 1" 2 "final_cleanup"} } */
+/* { dg-final { cleanup-tree-dump "final_cleanup" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/loop-36.c b/gcc/testsuite/gcc.dg/tree-ssa/loop-36.c
new file mode 100644
index 00000000000..0af4d534a7f
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/loop-36.c
@@ -0,0 +1,22 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-dce2" } */
+
+struct X { float array[4]; };
+
+struct X a,b;
+
+float foobar () {
+ float s = 0;
+ unsigned int d;
+ struct X c;
+ for (d=0; d<4; ++d)
+ c.array[d] = a.array[d] * b.array[d];
+ for (d=0; d<4; ++d)
+ s+=c.array[d];
+ return s;
+}
+
+/* The temporary structure should have been promoted to registers
+ by FRE after the loops have been unrolled by the early unrolling pass. */
+/* { dg-final { scan-tree-dump-not "c\.array" "dce2" } } */
+/* { dg-final { cleanup-tree-dump "dce2" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/loop-37.c b/gcc/testsuite/gcc.dg/tree-ssa/loop-37.c
new file mode 100644
index 00000000000..46b26bb873f
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/loop-37.c
@@ -0,0 +1,27 @@
+/* { dg-do link } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+extern void link_error (void);
+static const int my_array [3] = { 4, 5, 6 };
+
+void f0 (void)
+{
+ int j, sum = 0;
+ for (j = 0; j < 3; j ++)
+ sum += my_array [j];
+ if (15 != sum)
+ link_error ();
+}
+
+int f1 (int a [])
+{
+ int j, sum = 0;
+ for (j = 0; j < 3; j ++)
+ sum += a [j] + my_array [j];
+ return sum;
+}
+
+int main() { }
+
+/* { dg-final { scan-tree-dump-not "my_array" "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr27799.c b/gcc/testsuite/gcc.dg/tree-ssa/pr27799.c
new file mode 100644
index 00000000000..de09a40e08b
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr27799.c
@@ -0,0 +1,26 @@
+/* { dg-do link } */
+/* { dg-options "-O2" } */
+
+struct X { double m; int x; };
+struct Y { int y; short d; };
+struct YY { int y; short d; char c; };
+
+extern void link_error (void);
+
+int foo(struct X *x, struct Y *y)
+{
+ x->x = 0;
+ y->y = 1;
+ if (x->x != 0)
+ link_error ();
+}
+
+int foo_no(struct X *x, struct YY *y)
+{
+ x->x = 0;
+ y->y = 1;
+ if (x->x != 0)
+ link_error ();
+}
+
+int main() {}
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-19.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-19.c
new file mode 100644
index 00000000000..ab4182246a3
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-19.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-ccp1" } */
+
+struct f { int i; };
+int g()
+{
+ struct f a, *a1;
+ int *i;
+ a.i = 1;
+ a1 = &a;
+ i = &a1->i;
+ return *i; /* This should be turned into a.i */
+}
+
+/* { dg-final { scan-tree-dump "= a.i;" "ccp1" } } */
+/* { dg-final { cleanup-tree-dump "ccp1" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-ifcombine-6.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-ifcombine-6.c
new file mode 100644
index 00000000000..90abc8debc9
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-ifcombine-6.c
@@ -0,0 +1,37 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-ifcombine" } */
+
+void bar (void);
+
+void
+foo1 (unsigned int a)
+{
+ if (a & 1)
+ goto heaven;
+ if (a & 4)
+ goto heaven;
+ return;
+
+ heaven:
+ bar ();
+}
+
+void
+foo2 (unsigned int a)
+{
+ if (a & 1)
+ if (a & 4)
+ goto heaven;
+ return;
+
+ heaven:
+ bar ();
+}
+
+
+/* The special treatment of a & 1 != 0 in fold caused the pattern not
+ to be recognized due to extra conversions inserted. */
+
+/* { dg-final { scan-tree-dump "optimizing bits or bits test" "ifcombine" } } */
+/* { dg-final { scan-tree-dump "optimizing double bit test" "ifcombine" } } */
+/* { dg-final { cleanup-tree-dump "ifcombine" } } */
diff --git a/gcc/testsuite/gcc.dg/utf-cvt.c b/gcc/testsuite/gcc.dg/utf-cvt.c
index e4bc624ac35..109d231bff4 100644
--- a/gcc/testsuite/gcc.dg/utf-cvt.c
+++ b/gcc/testsuite/gcc.dg/utf-cvt.c
@@ -3,8 +3,8 @@
/* { dg-do compile } */
/* { dg-options "-std=gnu99 -Wall -Wconversion -Wsign-conversion" } */
-typedef unsigned short char16_t;
-typedef unsigned int char32_t;
+typedef short unsigned int char16_t;
+typedef unsigned int char32_t;
extern void f_c (char);
extern void fsc (signed char);
@@ -18,14 +18,17 @@ extern void fui (unsigned int);
extern void f_l (long);
extern void fsl (signed long);
extern void ful (unsigned long);
+extern void f_ll (long long);
+extern void fsll (signed long long);
+extern void full (unsigned long long);
void m (char16_t c0, char32_t c1)
{
- f_c (c0); /* { dg-warning "alter its value" } */
- fsc (c0); /* { dg-warning "alter its value" } */
- fuc (c0); /* { dg-warning "alter its value" } */
- f_s (c0); /* { dg-warning "change the sign" } */
- fss (c0); /* { dg-warning "change the sign" } */
+ f_c (c0); /* { dg-warning "alter its value" } */
+ fsc (c0); /* { dg-warning "alter its value" } */
+ fuc (c0); /* { dg-warning "alter its value" } */
+ f_s (c0); /* { dg-warning "change the sign" } */
+ fss (c0); /* { dg-warning "change the sign" } */
fus (c0);
f_i (c0);
fsi (c0);
@@ -33,17 +36,23 @@ void m (char16_t c0, char32_t c1)
f_l (c0);
fsl (c0);
ful (c0);
+ f_ll (c0);
+ fsll (c0);
+ full (c0);
- f_c (c1); /* { dg-warning "alter its value" } */
- fsc (c1); /* { dg-warning "alter its value" } */
- fuc (c1); /* { dg-warning "alter its value" } */
- f_s (c1); /* { dg-warning "alter its value" } */
- fss (c1); /* { dg-warning "alter its value" } */
- fus (c1); /* { dg-warning "alter its value" } */
- f_i (c1); /* { dg-warning "change the sign" } */
- fsi (c1); /* { dg-warning "change the sign" } */
+ f_c (c1); /* { dg-warning "alter its value" } */
+ fsc (c1); /* { dg-warning "alter its value" } */
+ fuc (c1); /* { dg-warning "alter its value" } */
+ f_s (c1); /* { dg-warning "alter its value" } */
+ fss (c1); /* { dg-warning "alter its value" } */
+ fus (c1); /* { dg-warning "alter its value" } */
+ f_i (c1); /* { dg-warning "change the sign" } */
+ fsi (c1); /* { dg-warning "change the sign" } */
fui (c1);
- f_l (c1); /* { dg-warning "change the sign" } */
- fsl (c1); /* { dg-warning "change the sign" } */
+ f_l (c1); /* { dg-warning "change the sign" "" { target { ilp32 } } } */
+ fsl (c1); /* { dg-warning "change the sign" "" { target { ilp32 } } } */
ful (c1);
+ f_ll (c1);
+ fsll (c1);
+ full (c1);
}
diff --git a/gcc/testsuite/gcc.dg/utf16-4.c b/gcc/testsuite/gcc.dg/utf16-4.c
index 812c8d2cd4a..86597b370e1 100644
--- a/gcc/testsuite/gcc.dg/utf16-4.c
+++ b/gcc/testsuite/gcc.dg/utf16-4.c
@@ -15,6 +15,7 @@ char16_t c5 = U'\u2029';
char16_t c6 = U'\U00064321'; /* { dg-warning "implicitly truncated" } */
char16_t c7 = L'a';
char16_t c8 = L'\u2029';
-char16_t c9 = L'\U00064321'; /* { dg-warning "implicitly truncated" } */
+char16_t c9 = L'\U00064321'; /* { dg-warning "implicitly truncated" "" { target { 4byte_wchar_t } } 18 } */
+ /* { dg-warning "constant too long" "" { target { ! 4byte_wchar_t } } 18 } */
int main () {}
diff --git a/gcc/testsuite/gcc.dg/utf32-4.c b/gcc/testsuite/gcc.dg/utf32-4.c
index dd05a9a6c39..48d84fd4219 100644
--- a/gcc/testsuite/gcc.dg/utf32-4.c
+++ b/gcc/testsuite/gcc.dg/utf32-4.c
@@ -15,6 +15,6 @@ char32_t c5 = u'\u2029';
char32_t c6 = u'\U00064321'; /* { dg-warning "constant too long" } */
char32_t c7 = L'a';
char32_t c8 = L'\u2029';
-char32_t c9 = L'\U00064321';
+char32_t c9 = L'\U00064321'; /* { dg-warning "constant too long" { target { ! 4byte_wchar_t } } } */
int main () {}
diff --git a/gcc/testsuite/gcc.dg/vect/O3-vect-pr34223.c b/gcc/testsuite/gcc.dg/vect/O3-vect-pr34223.c
new file mode 100644
index 00000000000..22ce72c75fe
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vect/O3-vect-pr34223.c
@@ -0,0 +1,33 @@
+/* { dg-require-effective-target vect_int } */
+
+#include "tree-vect.h"
+
+#define M 10
+#define N 3
+
+void __attribute__((noinline))
+foo (int n, int *ub, int *uc)
+{
+ int i, j, tmp1;
+
+ for (i = 0; i < n; i++)
+ {
+ tmp1 = 0;
+ for (j = 0; j < M; j++)
+ {
+ tmp1 += uc[i] * ((int)(j << N) / M);
+ }
+ ub[i] = tmp1;
+ }
+}
+
+int main()
+{
+ int uc[16], ub[16];
+ check_vect ();
+ foo (16, uc, ub);
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/fast-math-pr35982.c b/gcc/testsuite/gcc.dg/vect/fast-math-pr35982.c
new file mode 100644
index 00000000000..d21c61dd934
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vect/fast-math-pr35982.c
@@ -0,0 +1,25 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_float } */
+/* { dg-require-effective-target vect_int } */
+
+struct mem
+{
+ float avg;
+ int len;
+};
+
+float method2_int16 (struct mem *mem)
+{
+ int i;
+ float avg;
+
+ for (i = 0; i < 100; ++i)
+ avg += mem[i].avg * (float) mem[i].len;
+
+ return avg;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_extract_even_odd } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 0 loops" 1 "vect" { xfail vect_extract_even_odd } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+
diff --git a/gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-66.c b/gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-66.c
index 2be14ea33b6..d590975e57f 100644
--- a/gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-66.c
+++ b/gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-66.c
@@ -3,11 +3,10 @@
#include <stdarg.h>
#include "tree-vect.h"
-#define N 16
+#define N 8
-int ib[6] = {0,3,6,9,12,15};
-int ia[8][5][6];
-int ic[16][16][5][6];
+int ia[8][5][N+2];
+int ic[16][16][5][N+2];
__attribute__ ((noinline))
int main1 ()
@@ -17,7 +16,7 @@ int main1 ()
/* Multidimensional array. Aligned. */
for (i = 0; i < 16; i++)
{
- for (j = 0; j < 4; j++)
+ for (j = 0; j < N; j++)
{
ia[2][6][j] = 5;
}
@@ -26,7 +25,7 @@ int main1 ()
/* check results: */
for (i = 0; i < 16; i++)
{
- for (j = 0; j < 4; j++)
+ for (j = 0; j < N; j++)
{
if (ia[2][6][j] != 5)
abort();
@@ -35,14 +34,14 @@ int main1 ()
/* Multidimensional array. Aligned. */
for (i = 0; i < 16; i++)
{
- for (j = 0; j < 4; j++)
+ for (j = 0; j < N; j++)
ia[3][6][j+2] = 5;
}
/* check results: */
for (i = 0; i < 16; i++)
{
- for (j = 2; j < 6; j++)
+ for (j = 2; j < N+2; j++)
{
if (ia[3][6][j] != 5)
abort();
@@ -52,7 +51,7 @@ int main1 ()
/* Multidimensional array. Not aligned. */
for (i = 0; i < 16; i++)
{
- for (j = 0; j < 4; j++)
+ for (j = 0; j < N; j++)
{
ic[2][1][6][j+1] = 5;
}
@@ -61,7 +60,7 @@ int main1 ()
/* check results: */
for (i = 0; i < 16; i++)
{
- for (j = 0; j < 4; j++)
+ for (j = 0; j < N; j++)
{
if (ic[2][1][6][j+1] != 5)
abort();
diff --git a/gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-69.c b/gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-69.c
index 8317848db9b..c63ae2fd21b 100644
--- a/gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-69.c
+++ b/gcc/testsuite/gcc.dg/vect/no-section-anchors-vect-69.c
@@ -3,7 +3,7 @@
#include <stdarg.h>
#include "tree-vect.h"
-#define N 8
+#define N 12
struct s{
int m;
diff --git a/gcc/testsuite/gcc.dg/vect/no-vfa-vect-depend-1.c b/gcc/testsuite/gcc.dg/vect/no-vfa-vect-depend-1.c
index b8731a0475f..2c3ac296ff8 100644
--- a/gcc/testsuite/gcc.dg/vect/no-vfa-vect-depend-1.c
+++ b/gcc/testsuite/gcc.dg/vect/no-vfa-vect-depend-1.c
@@ -49,7 +49,7 @@ int main (void)
return main1 ();
}
-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" {xfail vect_no_align } } } */
/* { dg-final { scan-tree-dump-times "dependence distance >= VF or negative" 1 "vect" } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/pr33804.c b/gcc/testsuite/gcc.dg/vect/pr33804.c
index 959ac67e1d6..3ae7df0a2a4 100644
--- a/gcc/testsuite/gcc.dg/vect/pr33804.c
+++ b/gcc/testsuite/gcc.dg/vect/pr33804.c
@@ -11,7 +11,7 @@ void f(unsigned char *s, unsigned char *d, int n) {
}
}
-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
-/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" {xfail vect_no_align } } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" {xfail vect_no_align } } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/pr33953.c b/gcc/testsuite/gcc.dg/vect/pr33953.c
index ef1e248d711..f501a452e53 100644
--- a/gcc/testsuite/gcc.dg/vect/pr33953.c
+++ b/gcc/testsuite/gcc.dg/vect/pr33953.c
@@ -28,8 +28,8 @@ void blockmove_NtoN_blend_noremap32 (const UINT32 *srcdata, int srcwidth,
}
}
-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
-/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" {xfail vect_no_align } } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" {xfail vect_no_align } } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/slp-15.c b/gcc/testsuite/gcc.dg/vect/slp-15.c
index 6f04e6a3784..08b6f84b209 100644
--- a/gcc/testsuite/gcc.dg/vect/slp-15.c
+++ b/gcc/testsuite/gcc.dg/vect/slp-15.c
@@ -112,6 +112,6 @@ int main (void)
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" {target vect_int_mult } } } */
/* { dg-final { scan-tree-dump-times "vectorized 0 loops" 1 "vect" {target { ! { vect_int_mult } } } } } */
/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 2 "vect" {target vect_int_mult } } } */
-/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 2 "vect" {target { ! { vect_int_mult } } } } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 0 "vect" {target { ! { vect_int_mult } } } } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/slp-25.c b/gcc/testsuite/gcc.dg/vect/slp-25.c
index 0b62a29bf68..23022fd2b06 100644
--- a/gcc/testsuite/gcc.dg/vect/slp-25.c
+++ b/gcc/testsuite/gcc.dg/vect/slp-25.c
@@ -56,5 +56,5 @@ int main (void)
/* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" } } */
/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
-/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 2 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 2 "vect" { xfail vect_no_align } } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/slp-3.c b/gcc/testsuite/gcc.dg/vect/slp-3.c
index 474bfe8285f..cf39bf17a31 100644
--- a/gcc/testsuite/gcc.dg/vect/slp-3.c
+++ b/gcc/testsuite/gcc.dg/vect/slp-3.c
@@ -141,7 +141,7 @@ int main (void)
return 0;
}
-/* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" } } */
-/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 3 "vect" } } */
+/* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" { xfail vect_no_align } } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 3 "vect" { xfail vect_no_align } } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-11a.c b/gcc/testsuite/gcc.dg/vect/vect-11a.c
index 84e2a8b36cd..75b1035df4d 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-11a.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-11a.c
@@ -9,15 +9,18 @@ extern void abort (void);
__attribute__ ((noinline))
void u ()
{
- unsigned int A[4] = {0x08000000,0xffffffff,0xff0000ff,0xf0000001};
- unsigned int B[4] = {0x08000000,0x08000001,0xff0000ff,0xf0000001};
- unsigned int Answer[4] = {0,0xf7ffffff,0x0200fe01,0xe0000001};
- unsigned int C[4];
+ unsigned int A[8] = {0x08000000,0xffffffff,0xff0000ff,0xf0000001,
+ 0x08000000,0xffffffff,0xff0000ff,0xf0000001};
+ unsigned int B[8] = {0x08000000,0x08000001,0xff0000ff,0xf0000001,
+ 0x08000000,0x08000001,0xff0000ff,0xf0000001};
+ unsigned int Answer[8] = {0,0xf7ffffff,0x0200fe01,0xe0000001,
+ 0,0xf7ffffff,0x0200fe01,0xe0000001};
+ unsigned int C[8];
int i, j;
- for (i=0; i<4; i++)
+ for (i=0; i<8; i++)
C[i] = A[i] * B[i];
- for (i=0; i<4; i++)
+ for (i=0; i<8; i++)
if (C[i] != Answer[i])
abort ();
}
@@ -25,15 +28,18 @@ void u ()
__attribute__ ((noinline))
void s()
{
- signed int A[4] = {0x08000000,0xffffffff,0xff0000ff,0xf0000001};
- signed int B[4] = {0x08000000,0x08000001,0xff0000ff,0xf0000001};
- signed int Answer[4] = {0,0xf7ffffff,0x0200fe01, 0xe0000001};
- signed int C[4];
+ signed int A[8] = {0x08000000,0xffffffff,0xff0000ff,0xf0000001,
+ 0x08000000,0xffffffff,0xff0000ff,0xf0000001};
+ signed int B[8] = {0x08000000,0x08000001,0xff0000ff,0xf0000001,
+ 0x08000000,0x08000001,0xff0000ff,0xf0000001};
+ signed int Answer[8] = {0,0xf7ffffff,0x0200fe01, 0xe0000001,
+ 0,0xf7ffffff,0x0200fe01, 0xe0000001};
+ signed int C[8];
int i, j;
- for (i=0; i<4; i++)
+ for (i=0; i<8; i++)
C[i] = A[i] * B[i];
- for (i=0; i<4; i++)
+ for (i=0; i<8; i++)
if (C[i] != Answer[i])
abort ();
}
diff --git a/gcc/testsuite/gcc.dg/vect/vect-66.c b/gcc/testsuite/gcc.dg/vect/vect-66.c
index 4f93bc05d67..a332fa024b9 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-66.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-66.c
@@ -3,20 +3,18 @@
#include <stdarg.h>
#include "tree-vect.h"
-#define N 16
+#define N 8
__attribute__ ((noinline))
-int main1 ()
+void main1 ()
{
int i, j;
- int ib[6] = {0,3,6,9,12,15};
- int ia[8][5][6];
- int ic[16][16][5][6];
+ int ia[8][5][N+2];
/* Multidimensional array. Aligned. */
for (i = 0; i < 16; i++)
{
- for (j = 0; j < 4; j++)
+ for (j = 0; j < N; j++)
{
ia[2][6][j] = 5;
}
@@ -25,33 +23,48 @@ int main1 ()
/* check results: */
for (i = 0; i < 16; i++)
{
- for (j = 0; j < 4; j++)
+ for (j = 0; j < N; j++)
{
if (ia[2][6][j] != 5)
abort();
}
}
+}
+
+__attribute__ ((noinline))
+void main2 ()
+{
+ int i, j;
+ int ia[8][5][N+2];
+
/* Multidimensional array. Aligned. */
for (i = 0; i < 16; i++)
{
- for (j = 0; j < 4; j++)
+ for (j = 0; j < N; j++)
ia[3][6][j+2] = 5;
}
/* check results: */
for (i = 0; i < 16; i++)
{
- for (j = 2; j < 6; j++)
+ for (j = 2; j < N+2; j++)
{
if (ia[3][6][j] != 5)
abort();
}
}
+}
+
+__attribute__ ((noinline))
+void main3 ()
+{
+ int i, j;
+ int ic[16][16][5][N+2];
/* Multidimensional array. Not aligned. */
for (i = 0; i < 16; i++)
{
- for (j = 0; j < 4; j++)
+ for (j = 0; j < N; j++)
{
ic[2][1][6][j+1] = 5;
}
@@ -60,22 +73,24 @@ int main1 ()
/* check results: */
for (i = 0; i < 16; i++)
{
- for (j = 0; j < 4; j++)
+ for (j = 0; j < N; j++)
{
if (ic[2][1][6][j+1] != 5)
abort();
}
}
-
- return 0;
}
int main (void)
{
check_vect ();
- return main1 ();
+ main1 ();
+ main2 ();
+ main3 ();
+
+ return 0;
}
-/* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 3 "vect" } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-76.c b/gcc/testsuite/gcc.dg/vect/vect-76.c
index 908ccd249c3..8a2f7514e7e 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-76.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-76.c
@@ -3,7 +3,7 @@
#include <stdarg.h>
#include "tree-vect.h"
-#define N 8
+#define N 12
#define OFF 4
/* Check handling of accesses for which the "initial condition" -
diff --git a/gcc/testsuite/gcc.dg/vect/vect-iv-6.c b/gcc/testsuite/gcc.dg/vect/vect-iv-6.c
index a0863cfe064..b1a0d53e7e2 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-iv-6.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-iv-6.c
@@ -46,5 +46,5 @@ int main (void)
return main1 (3);
}
-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" {xfail vect_no_align } } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-outer-1.c b/gcc/testsuite/gcc.dg/vect/vect-outer-1.c
index 79a2ba41a36..f1892488603 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-outer-1.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-outer-1.c
@@ -1,6 +1,6 @@
/* { dg-do compile } */
-#define N 40
+#define N 64
signed short image[N][N] __attribute__ ((__aligned__(16)));
signed short block[N][N] __attribute__ ((__aligned__(16)));
signed short out[N] __attribute__ ((__aligned__(16)));
diff --git a/gcc/testsuite/gcc.dg/vect/vect-outer-1a.c b/gcc/testsuite/gcc.dg/vect/vect-outer-1a.c
index 2d6eb06d0c8..2d903937f91 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-outer-1a.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-outer-1a.c
@@ -1,6 +1,6 @@
/* { dg-do compile } */
-#define N 40
+#define N 64
signed short image[N][N] __attribute__ ((__aligned__(16)));
signed short block[N][N] __attribute__ ((__aligned__(16)));
diff --git a/gcc/testsuite/gcc.dg/vect/vect-outer-4c.c b/gcc/testsuite/gcc.dg/vect/vect-outer-4c.c
index eb6b30f41ed..3342b79b215 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-outer-4c.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-outer-4c.c
@@ -22,6 +22,6 @@ foo (){
}
}
-/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED" 1 "vect" { target vect_short_mult } } } */
+/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED" 1 "vect" { target { vect_short_mult && { ! vect_no_align } } } } } */
/* { dg-final { scan-tree-dump-times "zero step in outer loop." 1 "vect" } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-outer-5.c b/gcc/testsuite/gcc.dg/vect/vect-outer-5.c
index c9fc1e0f40b..2324a5a1f3b 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-outer-5.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-outer-5.c
@@ -79,5 +79,5 @@ int main ()
is known. */
/* { dg-final { scan-tree-dump-times "not vectorized: possible dependence between data-refs" 1 "vect" { xfail *-*-* } } } */
/* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED" 1 "vect" } } */
-/* { dg-final { scan-tree-dump-times "zero step in outer loop." 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "zero step in outer loop." 1 "vect" { xfail vect_no_align } } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-outer-6.c b/gcc/testsuite/gcc.dg/vect/vect-outer-6.c
index 56825449c12..6c4fa1ecb08 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-outer-6.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-outer-6.c
@@ -20,10 +20,10 @@ int main1 ()
int i, j;
- for (i = 0; i < 8; i++)
+ for (i = 0; i < N; i++)
{
s = 0;
- for (j=0; j<8; j+=4)
+ for (j = 0; j < N; j += 4)
s += C[j];
A[i] = s;
}
@@ -49,10 +49,10 @@ int main ()
main1();
/* check results: */
- for (i = 0; i < 8; i++)
+ for (i = 0; i < N; i++)
{
s = 0;
- for (j=0; j<8; j+=4)
+ for (j = 0; j < N; j += 4)
s += C[j];
if (A[i] != s)
abort ();
diff --git a/gcc/testsuite/gcc.dg/vect/vect-shift-1.c b/gcc/testsuite/gcc.dg/vect/vect-shift-1.c
index ca6e07dc703..346fffee102 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-shift-1.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-shift-1.c
@@ -4,12 +4,14 @@
#include <stdarg.h>
#include "tree-vect.h"
-#define N 4
+#define N 8
int main ()
{
- unsigned int A[N] = { 0x08000000, 0x08000001, 0x0ff0000ff, 0xf0000001 };
- unsigned int B[N] = { 0x01000000, 0x01000000, 0x01fe0001f, 0x1e000000 };
+ unsigned int A[N] = { 0x08000000, 0x08000001, 0x0ff0000ff, 0xf0000001,
+ 0x08000000, 0x08000001, 0x0ff0000ff, 0xf0000001 };
+ unsigned int B[N] = { 0x01000000, 0x01000000, 0x01fe0001f, 0x1e000000,
+ 0x01000000, 0x01000000, 0x01fe0001f, 0x1e000000 };
int i;
check_vect ();
diff --git a/gcc/testsuite/gcc.dg/vect/vect-vfa-slp.c b/gcc/testsuite/gcc.dg/vect/vect-vfa-slp.c
index 27560c72d9d..27f3ae7624a 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-vfa-slp.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-vfa-slp.c
@@ -52,5 +52,5 @@ main (void)
return 0;
}
-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail vect_no_align } } } */
/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.target/i386/pr31486.c b/gcc/testsuite/gcc.target/i386/pr31486.c
new file mode 100644
index 00000000000..7082d3de98b
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr31486.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-msse -mno-sse2" } */
+
+typedef double __v2df __attribute__ ((vector_size (16)));
+
+__v2df b = { 1.1, 1.2 };
+
+extern __v2df a2 (__v2df a, __v2df b);
+
+void test2 ()
+{
+ b = a2 (b, b);
+}
diff --git a/gcc/testsuite/gcc.target/i386/pr36064.c b/gcc/testsuite/gcc.target/i386/pr36064.c
new file mode 100644
index 00000000000..7964f280cff
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr36064.c
@@ -0,0 +1,55 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target ilp32 } */
+/* { dg-options "-O1 -march=core2" } */
+
+typedef long long ogg_int64_t;
+
+typedef struct vorbis_info
+{
+ long rate;
+} vorbis_info;
+
+typedef struct OggVorbis_File
+{
+ int seekable;
+ int links;
+ ogg_int64_t *pcmlengths;
+ vorbis_info *vi;
+ int ready_state;
+} OggVorbis_File;
+
+extern double ov_time_total (OggVorbis_File * vf, int i);
+extern int ov_pcm_seek_page (OggVorbis_File * vf, ogg_int64_t pos);
+
+int
+ov_time_seek_page (OggVorbis_File * vf, double seconds)
+{
+ int link = -1;
+ ogg_int64_t pcm_total = 0;
+ double time_total = 0.;
+
+ if (vf->ready_state < 2)
+ return (-131);
+ if (!vf->seekable)
+ return (-138);
+ if (seconds < 0)
+ return (-131);
+
+ for (link = 0; link < vf->links; link++)
+ {
+ double addsec = ov_time_total (vf, link);
+ if (seconds < time_total + addsec)
+ break;
+ time_total += addsec;
+ pcm_total += vf->pcmlengths[link * 2 + 1];
+ }
+
+ if (link == vf->links)
+ return (-131);
+
+ {
+ ogg_int64_t target =
+ pcm_total + (seconds - time_total) * vf->vi[link].rate;
+ return (ov_pcm_seek_page (vf, target));
+ }
+}
diff --git a/gcc/testsuite/gcc.target/i386/pr36073.c b/gcc/testsuite/gcc.target/i386/pr36073.c
new file mode 100644
index 00000000000..b1587579e32
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr36073.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-options "-O -march=core2 -mfpmath=sse,387 -ffast-math" } */
+
+extern double log (double x);
+extern int f (void);
+
+double cached_value;
+
+void g (void)
+{
+ cached_value = log (f ());
+}
diff --git a/gcc/testsuite/gcc.target/i386/vectorize1.c b/gcc/testsuite/gcc.target/i386/vectorize1.c
index bd5473fffca..7a5023aa905 100644
--- a/gcc/testsuite/gcc.target/i386/vectorize1.c
+++ b/gcc/testsuite/gcc.target/i386/vectorize1.c
@@ -4,14 +4,14 @@
extern char lanip[3][40];
typedef struct
{
- char *t[4];
+ char *t[8];
}tx_typ;
int set_names (void)
{
static tx_typ tt1;
int ln;
- for (ln = 0; ln < 4; ln++)
+ for (ln = 0; ln < 8; ln++)
tt1.t[ln] = lanip[1];
}
diff --git a/gcc/testsuite/gcc.target/mips/gcc-have-sync-compare-and-swap-1.c b/gcc/testsuite/gcc.target/mips/gcc-have-sync-compare-and-swap-1.c
index 72eff4da37c..4c642258f7b 100644
--- a/gcc/testsuite/gcc.target/mips/gcc-have-sync-compare-and-swap-1.c
+++ b/gcc/testsuite/gcc.target/mips/gcc-have-sync-compare-and-swap-1.c
@@ -1,11 +1,11 @@
/* { dg-do preprocess } */
/* { dg-mips-options "-mips2" } */
-#ifdef __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1
+#if defined (__GCC_HAVE_SYNC_COMPARE_AND_SWAP_1) == defined (__mips16)
#error nonono
#endif
-#ifdef __GCC_HAVE_SYNC_COMPARE_AND_SWAP_2
+#if defined (__GCC_HAVE_SYNC_COMPARE_AND_SWAP_2) == defined (__mips16)
#error nonono
#endif
diff --git a/gcc/testsuite/gcc.target/mips/gcc-have-sync-compare-and-swap-2.c b/gcc/testsuite/gcc.target/mips/gcc-have-sync-compare-and-swap-2.c
index fed2b38a57f..4265e4167ba 100644
--- a/gcc/testsuite/gcc.target/mips/gcc-have-sync-compare-and-swap-2.c
+++ b/gcc/testsuite/gcc.target/mips/gcc-have-sync-compare-and-swap-2.c
@@ -1,11 +1,11 @@
/* { dg-do preprocess } */
/* { dg-mips-options "-mgp64" } */
-#ifdef __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1
+#if defined (__GCC_HAVE_SYNC_COMPARE_AND_SWAP_1) == defined (__mips16)
#error nonono
#endif
-#ifdef __GCC_HAVE_SYNC_COMPARE_AND_SWAP_2
+#if defined (__GCC_HAVE_SYNC_COMPARE_AND_SWAP_2) == defined (__mips16)
#error nonono
#endif
diff --git a/gcc/testsuite/gfortran.dg/any_all_1.f90 b/gcc/testsuite/gfortran.dg/any_all_1.f90
index f1a14474034..f00c477b74a 100644
--- a/gcc/testsuite/gfortran.dg/any_all_1.f90
+++ b/gcc/testsuite/gfortran.dg/any_all_1.f90
@@ -4,7 +4,7 @@
program main
real, dimension(2,2) :: a
logical(kind=4), dimension(2) :: b
- integer, dimension(2) :: i
+ integer(kind=4), dimension(2) :: i
equivalence (b,i)
data a /1.0, 2.0, -0.1, -0.2 /
diff --git a/gcc/testsuite/gfortran.dg/array_constructor_23.f b/gcc/testsuite/gfortran.dg/array_constructor_23.f
index 3eeedbabd58..ac57efc2440 100644
--- a/gcc/testsuite/gfortran.dg/array_constructor_23.f
+++ b/gcc/testsuite/gfortran.dg/array_constructor_23.f
@@ -1,4 +1,5 @@
! { dg-do run }
+! { dg-require-effective-target fortran_large_real }
! Tests the fix for PR35944/6/7, in which the variable array constructors below
! were incorrectly translated and wrong code was produced.
!
@@ -34,7 +35,7 @@
subroutine fa2083
implicit none
integer j1,k
- parameter (k=10) !failed
+ parameter (k=selected_real_kind (precision (0.0_8) + 1)) ! failed
REAL(k) QDA1(10)
REAL(k) QDA(10), qval
qda = (/ 1,2,3,4,5,6,7,8,9,10 /)
diff --git a/gcc/testsuite/gfortran.dg/array_constructor_24.f b/gcc/testsuite/gfortran.dg/array_constructor_24.f
new file mode 100644
index 00000000000..dad613b136e
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/array_constructor_24.f
@@ -0,0 +1,47 @@
+! { dg-do run }
+! Tests the fix for PR35944/6/7, in which the variable array constructors below
+! were incorrectly translated and wrong code was produced.
+!
+! Contributed by Dick Hendrickson <dick.hendrickson@gmail.com>
+!
+ program try_fa6013
+ call fa6013 (10, 1, -1)
+ call fa6077 (10, 1, -1, (/1,2,3,4,5,6,7,8,9,10/))
+ call fa2083
+ end program
+
+ subroutine FA6013 (nf10, nf1, mf1)
+ integer, parameter :: kv = 4
+ REAL(KV) DDA1(10)
+ REAL(KV) DDA2(10)
+ REAL(KV) DDA(10), dval
+ dda = (/1,2,3,4,5,6,7,8,9,10/)
+ DDA1 = ATAN2 ((/(REAL(J1,KV),J1=1,10)/),
+ $ REAL((/(J1,J1=nf10,nf1,mf1)/), KV)) !fails
+ DDA2 = ATAN2 (DDA, DDA(10:1:-1))
+ if (any (DDA1 .ne. DDA2)) call abort ()
+ END
+
+ subroutine FA6077 (nf10,nf1,mf1, ida)
+ INTEGER IDA1(10)
+ INTEGER IDA2(10), ida(10)
+ IDA1 = IEOR((/1,2,3,4,5,6,7,8,9,10/),
+ $ (/(IDA(J1),J1=10,1,-1)/) )
+ IDA2 = IEOR ((/1,2,3,4,5,6,7,8,9,10/), (/10,9,8,7,6,5,4,3,2,1/) )
+ if (any (ida1 .ne. ida2)) call abort ()
+ END SUBROUTINE
+
+ subroutine fa2083
+ implicit none
+ integer j1,k
+ parameter (k=8) !failed for k=10
+ REAL(k) QDA1(10)
+ REAL(k) QDA(10), qval
+ qda = (/ 1,2,3,4,5,6,7,8,9,10 /)
+ QDA1 = MOD ( 1.1_k*( QDA(1) -5.0_k), P=( QDA -2.5_k))
+ DO J1 = 1,10
+ QVAL = MOD(1.1_k*(QDA(1)-5.0_k),P=(QDA(J1)-2.5_k))
+ if (qval .ne. qda1(j1)) call abort ()
+ ENDDO
+ END
+
diff --git a/gcc/testsuite/gfortran.dg/chmod_1.f90 b/gcc/testsuite/gfortran.dg/chmod_1.f90
index 2f0af8cc2db..e83beccf84b 100644
--- a/gcc/testsuite/gfortran.dg/chmod_1.f90
+++ b/gcc/testsuite/gfortran.dg/chmod_1.f90
@@ -1,4 +1,4 @@
-! { dg-do run }
+! { dg-do run { target { ! *-*-mingw* } } }
! { dg-options "-std=gnu" }
implicit none
character(len=*), parameter :: n = "foobar_file"
diff --git a/gcc/testsuite/gfortran.dg/chmod_2.f90 b/gcc/testsuite/gfortran.dg/chmod_2.f90
index 3dc445e1cb7..f319cd1868e 100644
--- a/gcc/testsuite/gfortran.dg/chmod_2.f90
+++ b/gcc/testsuite/gfortran.dg/chmod_2.f90
@@ -1,4 +1,4 @@
-! { dg-do run }
+! { dg-do run { target { ! *-*-mingw* } } }
! { dg-options "-std=gnu" }
implicit none
character(len=*), parameter :: n = "foobar_file"
diff --git a/gcc/testsuite/gfortran.dg/chmod_3.f90 b/gcc/testsuite/gfortran.dg/chmod_3.f90
index cfeba67dd42..63a4bbb564e 100644
--- a/gcc/testsuite/gfortran.dg/chmod_3.f90
+++ b/gcc/testsuite/gfortran.dg/chmod_3.f90
@@ -1,4 +1,4 @@
-! { dg-do run }
+! { dg-do run { target { ! *-*-mingw* } } }
! { dg-options "-std=gnu -fdefault-integer-8" }
implicit none
character(len=*), parameter :: n = "foobar_file"
diff --git a/gcc/testsuite/gfortran.dg/debug/pr35154-dwarf2.f b/gcc/testsuite/gfortran.dg/debug/pr35154-dwarf2.f
new file mode 100644
index 00000000000..0203d134a62
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/debug/pr35154-dwarf2.f
@@ -0,0 +1,37 @@
+C Test program for common block debugging. G. Helffrich 11 July 2004.
+C { dg-do compile }
+C { dg-skip-if "DWARF-2 only" { "*-*-*" } { "*" } { "-gdwarf-2" } }
+C { dg-options "-dA" }
+ common i,j
+ common /label/l,m
+ i = 1
+ j = 2
+ k = 3
+ l = 4
+ m = 5
+ call sub
+ end
+ subroutine sub
+ common /label/l,m
+ logical first
+ save n
+ data first /.true./
+ if (first) then
+ n = 0
+ first = .false.
+ endif
+ n = n + 1
+ l = l + 1
+ return
+ end
+
+C { dg-final { scan-assembler "(DIE.*DW_TAG_common_block)" } }
+C { dg-final { scan-assembler "DW_AT_name: \"__BLNK__\"" } }
+C { dg-final { scan-assembler "(DIE.*DW_TAG_member)" } }
+C { dg-final { scan-assembler "\"i.*\".*DW_AT_name" } }
+C { dg-final { scan-assembler "\"j.*\".*DW_AT_name" } }
+C { dg-final { scan-assembler "(DIE.*DW_TAG_common_block)" } }
+C { dg-final { scan-assembler "DW_AT_name: \"label\"" } }
+C { dg-final { scan-assembler "(DIE.*DW_TAG_member)" } }
+C { dg-final { scan-assembler "\"l.*\".*DW_AT_name" } }
+C { dg-final { scan-assembler "\"m.*\".*DW_AT_name" } }
diff --git a/gcc/testsuite/gfortran.dg/debug/pr35154-stabs.f b/gcc/testsuite/gfortran.dg/debug/pr35154-stabs.f
new file mode 100644
index 00000000000..7294771bd3e
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/debug/pr35154-stabs.f
@@ -0,0 +1,35 @@
+C Test program for common block debugging. G. Helffrich 11 July 2004.
+C { dg-do compile }
+C { dg-skip-if "No stabs" { mmix-*-* *-*-netware* alpha*-*-* hppa*64*-*-* ia64-*-* *-*-sysv5* *-*-vxworks* } { "*" } { "" } }
+C { dg-skip-if "No stabs" {*-*-* } { "*" } { "-gstabs" } }
+ common i,j
+ common /label/l,m
+ i = 1
+ j = 2
+ k = 3
+ l = 4
+ m = 5
+ call sub
+ end
+ subroutine sub
+ common /label/l,m
+ logical first
+ save n
+ data first /.true./
+ if (first) then
+ n = 0
+ first = .false.
+ endif
+ n = n + 1
+ l = l + 1
+ return
+ end
+
+C { dg-final { scan-assembler ".stabs.*\"__BLNK__\",226" } }
+C { dg-final { scan-assembler ".stabs.*\"i:V.*\",.*,0" } }
+C { dg-final { scan-assembler ".stabs.*\"j:V.*\",.*,4" } }
+C { dg-final { scan-assembler ".stabs.*\"__BLNK__\",228" } }
+C { dg-final { scan-assembler ".stabs.*\"label_\",226" } }
+C { dg-final { scan-assembler ".stabs.*\"l:V.*\",.*,0" } }
+C { dg-final { scan-assembler ".stabs.*\"m:V.*\",.*,4" } }
+C { dg-final { scan-assembler ".stabs.*\"label_\",228" } }
diff --git a/gcc/testsuite/gfortran.dg/dev_null.f90 b/gcc/testsuite/gfortran.dg/dev_null.F90
index edf93dbd1fc..2385e19ee6c 100644
--- a/gcc/testsuite/gfortran.dg/dev_null.f90
+++ b/gcc/testsuite/gfortran.dg/dev_null.F90
@@ -1,8 +1,13 @@
! { dg-do run }
! pr19478 read from /dev/null
! Thomas.Koenig@online.de
+#if defined _WIN32
+#define DEV_NULL "nul"
+#else
+#define DEV_NULL "/dev/null"
+#endif
character*20 foo
- open(10,file="/dev/null")
+ open(10,file=DEV_NULL)
write(10,'(A)') "Hello"
rewind(10)
read(10,'(A)',end=100) foo
diff --git a/gcc/testsuite/gfortran.dg/index.f90 b/gcc/testsuite/gfortran.dg/index.f90
new file mode 100644
index 00000000000..58cd25c701e
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/index.f90
@@ -0,0 +1,22 @@
+! { dg-do run }
+! pr35940
+ program FA1031
+ implicit none
+ integer I
+ INTEGER IDA1(10)
+ LOGICAL GDA1(10)
+ INTEGER RSLT(10)
+ DATA RSLT /4,1,4,1,4,1,4,1,4,1/
+ IDA1 = 0
+ gda1 = (/ (i/2*2 .ne. I, i=1,10) /)
+
+ IDA1 = INDEX ( 'DEFDEF' , 'DEF', GDA1 ) !fails
+ do I = 1, 10
+ if (IDA1(i).NE.RSLT(i)) call abort
+ end do
+ IDA1 = INDEX ( (/ ('DEFDEF',i=1,10) /) , 'DEF', GDA1 ) !works
+ do I = 1, 10
+ if (IDA1(i).NE.RSLT(i)) call abort
+ end do
+
+ END
diff --git a/gcc/testsuite/gfortran.dg/intrinsic_ifunction_1.f90 b/gcc/testsuite/gfortran.dg/intrinsic_ifunction_1.f90
new file mode 100644
index 00000000000..a27c220ee46
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/intrinsic_ifunction_1.f90
@@ -0,0 +1,43 @@
+! { dg-do run }
+! PR 35995 - ifunction.m4 and ifunction_logical.m4 had a bug
+! where zero-sized arguments were not handled correctly.
+! Test case provided by Dick Hendrickson, amended by
+! Thomas Koenig.
+
+ program try_gf0026_etc
+
+ call gf0026( 0, 1)
+ call foo ( 0, 1)
+
+ end program
+
+ SUBROUTINE GF0026(nf0,nf1)
+ LOGICAL LDA(9)
+ INTEGER IDA(NF0,9), iii(9)
+
+ lda = (/ (i/2*2 .eq. I, i=1,9) /)
+ LDA = ALL ( IDA .NE. -1000, 1)
+ if (.not. all(lda)) call abort
+ if (.not. all(ida .ne. -1000)) call abort
+
+ lda = (/ (i/2*2 .eq. I, i=1,9) /)
+ LDA = any ( IDA .NE. -1000, 1)
+ print *, lda !expect FALSE
+ if (any(lda)) call abort
+ print *, any(ida .ne. -1000) !expect FALSE
+ if (any(ida .ne. -1000)) call abort
+
+ iii = 137
+ iii = count ( IDA .NE. -1000, 1)
+ if (any(iii /= 0)) call abort
+ if (count(ida .ne. -1000) /= 0) call abort
+
+ END SUBROUTINE
+
+ subroutine foo (nf0, nf1)
+ integer, dimension(9):: res, iii
+ integer, dimension(nf0,9) :: ida
+ res = (/ (-i, i=1,9) /)
+ res = product (ida, 1)
+ if (any(res /= 1)) call abort
+ end subroutine foo
diff --git a/gcc/testsuite/gfortran.dg/intrinsic_pack_4.f90 b/gcc/testsuite/gfortran.dg/intrinsic_pack_4.f90
new file mode 100644
index 00000000000..691036817df
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/intrinsic_pack_4.f90
@@ -0,0 +1,72 @@
+! { dg-do run }
+! PR 35990 - some empty array sections caused pack to crash.
+! Test case contributed by Dick Hendrickson, adjusted and
+! extended by Thomas Koenig.
+ program try_gf1048
+
+ call gf1048a( 10, 8, 7, 1, 0, .true.)
+ call gf1048b( 10, 8, 7, 1, 0, .true.)
+ call gf1048c( 10, 8, 7, 1, 0, .true.)
+ call gf1048d( 10, 8, 7, 1, 0, .true.)
+ call P_inta ( 10, 8, 7, 1, 0, .true.)
+ call P_intb ( 10, 8, 7, 1, 0, .true.)
+ call P_intc ( 10, 8, 7, 1, 0, .true.)
+ call P_intd ( 10, 8, 7, 1, 0, .true.)
+ end program
+
+ SUBROUTINE GF1048a(nf10,nf8,nf7,nf1,nf0,nf_true)
+ logical nf_true
+ CHARACTER(9) BDA(10)
+ CHARACTER(9) BDA1(10)
+ BDA( 8:7) = PACK(BDA1( 10: 1), NF_TRUE)
+ END SUBROUTINE
+
+ SUBROUTINE GF1048b(nf10,nf8,nf7,nf1,nf0,nf_true)
+ logical nf_true
+ CHARACTER(9) BDA(10)
+ CHARACTER(9) BDA1(nf10)
+ BDA(NF8:NF7) = PACK(BDA1(NF8:NF7), NF_TRUE)
+ END SUBROUTINE
+
+ SUBROUTINE GF1048c(nf10,nf8,nf7,nf1,nf0,nf_true)
+ logical nf_true
+ CHARACTER(9) BDA(10)
+ CHARACTER(9) BDA1(10)
+ BDA(NF8:NF7) = PACK(BDA1(NF10:NF1), NF_TRUE)
+ END SUBROUTINE
+
+ SUBROUTINE GF1048d(nf10,nf8,nf7,nf1,nf0,nf_true)
+ logical nf_true
+ CHARACTER(9) BDA(10)
+ CHARACTER(9) BDA1(nf10)
+ BDA(NF8:NF7) = PACK(BDA1(NF10:NF1), NF_TRUE)
+ END SUBROUTINE
+
+ SUBROUTINE P_INTa(nf10,nf8,nf7,nf1,nf0,nf_true)
+ logical nf_true
+ INTEGER BDA(10)
+ INTEGER BDA1(10)
+ BDA( 8:7) = PACK(BDA1( 10: 1), NF_TRUE)
+ END SUBROUTINE
+
+ SUBROUTINE P_INTb(nf10,nf8,nf7,nf1,nf0,nf_true)
+ logical nf_true
+ INTEGER BDA(10)
+ INTEGER BDA1(nf10)
+ BDA(NF8:NF7) = PACK(BDA1(NF8:NF7), NF_TRUE)
+ END SUBROUTINE
+
+ SUBROUTINE P_INTc(nf10,nf8,nf7,nf1,nf0,nf_true)
+ logical nf_true
+ INTEGER BDA(10)
+ INTEGER BDA1(10)
+ BDA(NF8:NF7) = PACK(BDA1(NF10:NF1), NF_TRUE)
+ END SUBROUTINE
+
+ SUBROUTINE P_INTd(nf10,nf8,nf7,nf1,nf0,nf_true)
+ logical nf_true
+ INTEGER BDA(10)
+ INTEGER BDA1(nf10)
+ BDA(NF8:NF7) = PACK(BDA1(NF10:NF1), NF_TRUE)
+ END SUBROUTINE
+
diff --git a/gcc/testsuite/gfortran.dg/intrinsic_product_1.f90 b/gcc/testsuite/gfortran.dg/intrinsic_product_1.f90
new file mode 100644
index 00000000000..34d34fe8158
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/intrinsic_product_1.f90
@@ -0,0 +1,29 @@
+! { dg-do run }
+! PR 35993 - some intrinsics with mask = .false. didn't set
+! the whole return array for multi-dimensional arrays.
+! Test case adapted from Dick Hendrickson.
+
+ program try
+
+ call ga3019( 1, 2, 3, 4)
+ end program
+
+ SUBROUTINE GA3019(nf1,nf2,nf3,nf4)
+ INTEGER IDA(NF2,NF3)
+ INTEGER IDA1(NF2,NF4,NF3)
+
+ ida1 = 3
+
+ ida = -3
+ IDA(NF1:NF2,NF1:NF3) = PRODUCT(IDA1,NF2, NF1 .LT. 0) !fails
+ if (any(ida /= 1)) call abort
+
+ ida = -3
+ IDA(NF1:NF2,NF1:NF3) = PRODUCT(IDA1,NF2, .false. ) !fails
+ if (any(ida /= 1)) call abort
+
+ ida = -3
+ IDA(NF1:NF2,NF1:NF3) = PRODUCT(IDA1,NF2, ida1 .eq. 137 ) !works
+ if (any(ida /= 1)) call abort
+
+ END SUBROUTINE
diff --git a/gcc/testsuite/gfortran.dg/io_constraints_4.f90 b/gcc/testsuite/gfortran.dg/io_constraints_4.f90
new file mode 100644
index 00000000000..149d31b1631
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/io_constraints_4.f90
@@ -0,0 +1,10 @@
+! { dg-do compile }
+! PR33268 [patch,fortran] read ('(f3.3)'), a rejected due to the extra (...)
+
+write(*,('(a)')) 'Hello'
+write (*,'(f8.3)'), 3.14 ! { dg-warning "Comma before i/o item list" }
+print ('(a)'), "valid"
+read ('(f3.3)'), a
+read (*, '(f3.3)'), a ! { dg-warning "Comma before i/o item list" }
+write ('(a)'), "invalid" ! { dg-error "Invalid form of WRITE statement" }
+end
diff --git a/gcc/testsuite/gfortran.dg/matmul_7.f90 b/gcc/testsuite/gfortran.dg/matmul_7.f90
new file mode 100644
index 00000000000..b3f925a2145
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/matmul_7.f90
@@ -0,0 +1,40 @@
+! { dg-do run }
+! PR 35988 - failure on some zero-sized matmuls.
+! Test case contributed by Dick Hendrickson.
+
+ program try_gf1003
+
+ call gf1003a( 9, 8, 6)
+ call gf1003b( 9, 8, 6)
+ call gf1003c( 9, 8, 6) !fails
+ call gf1003d( 9, 8, 6) !fails
+ end program
+
+
+ SUBROUTINE GF1003a(nf9,nf8,nf6)
+ REAL RDA(3,2)
+ REAL RDA1(3,5)
+ REAL RDA2(5,2)
+ RDA = MATMUL(RDA1(:, 9:8),RDA2( 8:6,:))
+ END SUBROUTINE
+
+ SUBROUTINE GF1003b(nf9,nf8,nf6)
+ REAL RDA(3,2)
+ REAL RDA1(3,0)
+ REAL RDA2(0,2)
+ RDA = MATMUL(RDA1(:,NF9:NF8),RDA2(NF9:NF8,:))
+ END SUBROUTINE
+
+ SUBROUTINE GF1003c(nf9,nf8,nf6)
+ REAL RDA(3,2)
+ REAL RDA1(3,0)
+ REAL RDA2(0,2)
+ RDA = MATMUL(RDA1(:,NF9:NF8),RDA2(NF8:NF6,:))
+ END SUBROUTINE
+
+ SUBROUTINE GF1003d(nf9,nf8,nf6)
+ REAL RDA(3,2)
+ REAL RDA1(3,5)
+ REAL RDA2(5,2)
+ RDA = MATMUL(RDA1(:,NF9:NF8),RDA2(NF8:NF6,:))
+ END SUBROUTINE
diff --git a/gcc/testsuite/gfortran.dg/maxloc_bounds_4.f90 b/gcc/testsuite/gfortran.dg/maxloc_bounds_4.f90
index 22e5bf0af7a..5a38813a72e 100644
--- a/gcc/testsuite/gfortran.dg/maxloc_bounds_4.f90
+++ b/gcc/testsuite/gfortran.dg/maxloc_bounds_4.f90
@@ -15,7 +15,7 @@ end module tst
program main
use tst
implicit none
- integer(kind=4) :: res(3)
+ integer :: res(3)
call foo(res)
end program main
! { dg-output "Fortran runtime error: Incorrect extent in return value of MAXLOC intrnisic: is 3, should be 2" }
diff --git a/gcc/testsuite/gfortran.dg/maxloc_bounds_5.f90 b/gcc/testsuite/gfortran.dg/maxloc_bounds_5.f90
index cbc02921153..42e19e5a1e0 100644
--- a/gcc/testsuite/gfortran.dg/maxloc_bounds_5.f90
+++ b/gcc/testsuite/gfortran.dg/maxloc_bounds_5.f90
@@ -15,7 +15,7 @@ end module tst
program main
use tst
implicit none
- integer(kind=4) :: res(3)
+ integer :: res(3)
call foo(res)
end program main
! { dg-output "Fortran runtime error: Incorrect extent in return value of MAXLOC intrnisic: is 3, should be 2" }
diff --git a/gcc/testsuite/gfortran.dg/maxloc_bounds_7.f90 b/gcc/testsuite/gfortran.dg/maxloc_bounds_7.f90
index 491a044ea07..2194eee35a4 100644
--- a/gcc/testsuite/gfortran.dg/maxloc_bounds_7.f90
+++ b/gcc/testsuite/gfortran.dg/maxloc_bounds_7.f90
@@ -15,7 +15,7 @@ end module tst
program main
use tst
implicit none
- integer(kind=4) :: res(3)
+ integer :: res(3)
call foo(res)
end program main
! { dg-output "Fortran runtime error: Incorrect extent in return value of MAXLOC intrnisic: is 3, should be 2" }
diff --git a/gcc/testsuite/gfortran.dg/minmaxloc_5.f90 b/gcc/testsuite/gfortran.dg/minmaxloc_5.f90
new file mode 100644
index 00000000000..92e2103dedf
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/minmaxloc_5.f90
@@ -0,0 +1,18 @@
+! { dg-do run }
+! PR35994 [4.3/4.4 regression] MAXLOC and MINLOC off by one with mask
+program GA4076
+ REAL DDA(100)
+ dda = (/(J1,J1=1,100)/)
+ IDS = MAXLOC(DDA,1)
+ if (ids.ne.100) call abort !expect 100
+
+ IDS = MAXLOC(DDA,1, (/(J1,J1=1,100)/) > 50)
+ if (ids.ne.100) call abort !expect 100
+
+ IDS = minLOC(DDA,1)
+ if (ids.ne.1) call abort !expect 1
+
+ IDS = MinLOC(DDA,1, (/(J1,J1=1,100)/) > 50)
+ if (ids.ne.51) call abort !expect 51
+
+END
diff --git a/gcc/testsuite/gfortran.dg/minmaxloc_6.f90 b/gcc/testsuite/gfortran.dg/minmaxloc_6.f90
new file mode 100644
index 00000000000..c61fab47edf
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/minmaxloc_6.f90
@@ -0,0 +1,11 @@
+! { dg-do run }
+! PR35994 [4.3/4.4 regression] MAXLOC and MINLOC off by one with mask
+ REAL DDA(5:104)
+ dda = (/(J1,J1=1,100)/)
+
+ IDS = MAXLOC(DDA,1)
+ if (ids.ne.100) call abort !expect 100
+ IDS = MAXLOC(DDA,1, (/(J1,J1=1,100)/) > 50)
+ if (ids.ne.100) call abort !expect 100
+
+ END
diff --git a/gcc/testsuite/gfortran.dg/open_errors.f90 b/gcc/testsuite/gfortran.dg/open_errors.f90
index a8d5c2b10d7..0def37a6356 100644
--- a/gcc/testsuite/gfortran.dg/open_errors.f90
+++ b/gcc/testsuite/gfortran.dg/open_errors.f90
@@ -1,4 +1,4 @@
-! { dg-do run }
+! { dg-do run { target { ! *-*-mingw* } } }
! PR30005 Enhanced error messages for OPEN
! Submitted by Jerry DeLisle <jvdelisle@gcc.gnu.org>
character(60) :: msg
diff --git a/gcc/testsuite/gfortran.dg/pr36006-1.f90 b/gcc/testsuite/gfortran.dg/pr36006-1.f90
new file mode 100644
index 00000000000..ad33d947d14
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr36006-1.f90
@@ -0,0 +1,23 @@
+! { dg-do compile }
+!
+subroutine test4
+ integer, parameter :: wp = 4
+ complex(wp), parameter :: i = (0._wp, 1._wp)
+ complex(wp) :: c(12)
+ integer :: m, N
+
+ N = 12
+ c = (/(exp(i*m),m=1,N)/)
+ print *, c(1)
+end
+
+subroutine test8
+ integer, parameter :: wp = 8
+ complex(wp), parameter :: i = (0._wp, 1._wp)
+ complex(wp) :: c(12)
+ integer :: m, N
+
+ N = 12
+ c = (/(exp(i*m),m=1,N)/)
+ print *, c(1)
+end
diff --git a/gcc/testsuite/gfortran.dg/pr36006-2.f90 b/gcc/testsuite/gfortran.dg/pr36006-2.f90
new file mode 100644
index 00000000000..f422e09a860
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr36006-2.f90
@@ -0,0 +1,13 @@
+! { dg-do compile }
+! { dg-require-effective-target fortran_large_real }
+!
+subroutine test_large
+ integer, parameter :: wp = selected_real_kind (precision (0.0_8) + 1)
+ complex(wp), parameter :: i = (0._wp, 1._wp)
+ complex(wp) :: c(12)
+ integer :: m, N
+
+ N = 12
+ c = (/(exp(i*m),m=1,N)/)
+ print *, c(1)
+end
diff --git a/gcc/testsuite/gfortran.dg/selected_char_kind_1.f90 b/gcc/testsuite/gfortran.dg/selected_char_kind_1.f90
new file mode 100644
index 00000000000..f11fd0fb3f4
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/selected_char_kind_1.f90
@@ -0,0 +1,65 @@
+! { dg-do run }
+!
+! Checks for the SELECTED_CHAR_KIND intrinsic
+!
+ integer, parameter :: ascii = selected_char_kind ("ascii")
+ integer, parameter :: default = selected_char_kind ("default")
+
+ character(kind=ascii) :: s1
+ character(kind=default) :: s2
+ character(kind=selected_char_kind ("ascii")) :: s3
+ character(kind=selected_char_kind ("default")) :: s4
+
+ if (kind (s1) /= selected_char_kind ("ascii")) call abort
+ if (kind (s2) /= selected_char_kind ("default")) call abort
+ if (kind (s3) /= ascii) call abort
+ if (kind (s4) /= default) call abort
+
+ if (selected_char_kind("ascii") /= 1) call abort
+ if (selected_char_kind("default") /= 1) call abort
+ if (selected_char_kind("defauLt") /= 1) call abort
+ if (selected_char_kind("foo") /= -1) call abort
+ if (selected_char_kind("asciiiii") /= -1) call abort
+ if (selected_char_kind("default ") /= 1) call abort
+
+ call test("ascii", 1)
+ call test("default", 1)
+ call test("defauLt", 1)
+ call test("asciiiiii", -1)
+ call test("foo", -1)
+ call test("default ", 1)
+ call test("default x", -1)
+
+ call test(ascii_"ascii", 1)
+ call test(ascii_"default", 1)
+ call test(ascii_"defauLt", 1)
+ call test(ascii_"asciiiiii", -1)
+ call test(ascii_"foo", -1)
+ call test(ascii_"default ", 1)
+ call test(ascii_"default x", -1)
+
+ call test(default_"ascii", 1)
+ call test(default_"default", 1)
+ call test(default_"defauLt", 1)
+ call test(default_"asciiiiii", -1)
+ call test(default_"foo", -1)
+ call test(default_"default ", 1)
+ call test(default_"default x", -1)
+
+ if (kind (selected_char_kind ("")) /= kind(0)) call abort
+end
+
+subroutine test(s,i)
+ character(len=*,kind=selected_char_kind("ascii")) s
+ integer i
+
+ call test2(s,i)
+ if (selected_char_kind (s) /= i) call abort
+end subroutine test
+
+subroutine test2(s,i)
+ character(len=*,kind=selected_char_kind("default")) s
+ integer i
+
+ if (selected_char_kind (s) /= i) call abort
+end subroutine test2
diff --git a/gcc/testsuite/gfortran.dg/selected_char_kind_2.f90 b/gcc/testsuite/gfortran.dg/selected_char_kind_2.f90
new file mode 100644
index 00000000000..28ecd96ba3e
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/selected_char_kind_2.f90
@@ -0,0 +1,14 @@
+! { dg-do compile }
+!
+! Check that nonexisting character kinds are not rejected by the compiler
+!
+ character(kind=selected_char_kind("")) :: s1 ! { dg-error "is not supported for CHARACTER" }
+ character(kind=selected_char_kind(" ")) :: s2 ! { dg-error "is not supported for CHARACTER" }
+ character(kind=selected_char_kind("asciii")) :: s3 ! { dg-error "is not supported for CHARACTER" }
+ character(kind=selected_char_kind("I don't exist")) :: s4 ! { dg-error "is not supported for CHARACTER" }
+
+ print *, selected_char_kind() ! { dg-error "Missing actual argument" }
+ print *, selected_char_kind(12) ! { dg-error "must be CHARACTER" }
+ print *, selected_char_kind(["foo", "bar"]) ! { dg-error "must be a scalar" }
+
+end
diff --git a/gcc/testsuite/gfortran.dg/selected_char_kind_3.f90 b/gcc/testsuite/gfortran.dg/selected_char_kind_3.f90
new file mode 100644
index 00000000000..5cc7b112496
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/selected_char_kind_3.f90
@@ -0,0 +1,10 @@
+! { dg-do compile }
+! { dg-options "-std=f95 -pedantic -Wall" }
+!
+! Check that SELECTED_CHAR_KIND is rejected with -std=f95
+!
+ implicit none
+ character(kind=selected_char_kind("ascii")) :: s ! { dg-error "is not included in the selected standard" }
+ s = "" ! { dg-error "has no IMPLICIT type" }
+ print *, s
+end
diff --git a/gcc/testsuite/gfortran.dg/use_rename_3.f90 b/gcc/testsuite/gfortran.dg/use_rename_3.f90
new file mode 100644
index 00000000000..9f28e2ee70e
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/use_rename_3.f90
@@ -0,0 +1,35 @@
+! { dg-do compile }
+! Tests the fix for PR35997, in which the use association of renamed
+! valid2 and flag2 was treated as if the renaming were done on use
+! association in the main program. Thus, the following, direct use
+! association of valid and flag did not occur.
+!
+! Contributed by Drew McCormack <drewmccormack@mac.com>
+!
+module funcinterfacemod
+ interface
+ logical function valid ()
+ end function
+ end interface
+ logical :: flag = .true.
+end module
+
+module secondmod
+ use funcinterfacemod, valid2 => valid, flag2 => flag
+end module
+
+logical function valid ()
+ valid = .true.
+end function
+
+program main
+ use secondmod
+ use funcinterfacemod
+ if (valid ()) then
+ print *, 'Is Valid'
+ endif
+ if (flag) then
+ print *, 'Is flag'
+ endif
+end program
+! { dg-final { cleanup-modules "funcinterfacemod secondmod" } }
diff --git a/gcc/testsuite/gfortran.dg/vect/pr36119.f b/gcc/testsuite/gfortran.dg/vect/pr36119.f
new file mode 100644
index 00000000000..d4b11cb3679
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/vect/pr36119.f
@@ -0,0 +1,29 @@
+! { dg-do compile { target { i?86-*-* x86_64-*-* } } }
+! { dg-options "-O3 -mfpmath=sse -msse2 -ffree-form" }
+
+SUBROUTINE check_dnucint_ana (dcore)
+ IMPLICIT NONE
+ INTEGER, PARAMETER :: dp=8
+ REAL(dp), DIMENSION(10, 2), INTENT(IN),&
+ OPTIONAL :: dcore
+ INTEGER :: i, j
+ REAL(dp) :: delta, nssss, od, rn, ssssm, &
+ ssssp
+ REAL(dp), DIMENSION(10, 2) :: corem, corep, ncore
+ LOGICAL :: check_value
+
+ delta = 1.0E-8_dp
+ od = 0.5_dp/delta
+ ncore = od * (corep - corem)
+ nssss = od * (ssssp - ssssm)
+ IF (PRESENT(dcore)) THEN
+ DO i = 1, 2
+ DO j = 1, 10
+ IF (.NOT.check_value(ncore(j,i), dcore(j,i), delta, 0.1_dp)) THEN
+ END IF
+ END DO
+ END DO
+ END IF
+END SUBROUTINE check_dnucint_ana
+
+! { dg-final { cleanup-tree-dump "vect" } }
diff --git a/gcc/testsuite/gfortran.fortran-torture/compile/pr36078.f90 b/gcc/testsuite/gfortran.fortran-torture/compile/pr36078.f90
new file mode 100644
index 00000000000..b7f0aa3c3b0
--- /dev/null
+++ b/gcc/testsuite/gfortran.fortran-torture/compile/pr36078.f90
@@ -0,0 +1,22 @@
+ subroutine foo(func,p,eval)
+ real(kind=kind(1.0d0)), dimension(3,0:4,0:4,0:4) :: p
+ logical(kind=kind(.true.)), dimension(5,5,5) :: eval
+ interface
+ subroutine func(values,pt)
+ real(kind=kind(1.0d0)), dimension(:), intent(out) :: values
+ real(kind=kind(1.0d0)), dimension(:,:), intent(in) :: pt
+ end subroutine
+ end interface
+ real(kind=kind(1.0d0)), dimension(125,3) :: pt
+ integer(kind=kind(1)) :: n_pt
+
+ n_pt = 1
+ pt(1:n_pt,:) = &
+ reshape( &
+ pack( &
+ transpose(reshape(p,(/3,125/))), &
+ spread(reshape(eval,(/125/)),dim=2,ncopies=3)), &
+ (/n_pt,3/))
+
+ end subroutine
+ end
diff --git a/gcc/testsuite/gnat.dg/alignment4.adb b/gcc/testsuite/gnat.dg/alignment4.adb
index ebc105367cb..c23bcfe48da 100644
--- a/gcc/testsuite/gnat.dg/alignment4.adb
+++ b/gcc/testsuite/gnat.dg/alignment4.adb
@@ -11,5 +11,5 @@ begin
S1 := S2;
end;
--- { dg-final { scan-tree-dump-not "VIEW_CONVERT_EXPR" "gimple" } }
+-- { dg-final { scan-tree-dump-not ".\F" "gimple" } }
-- { dg-final { cleanup-tree-dump "gimple" } }
diff --git a/gcc/testsuite/gnat.dg/alignment5.adb b/gcc/testsuite/gnat.dg/alignment5.adb
index 4cc2d18db94..8a89f5ef895 100644
--- a/gcc/testsuite/gnat.dg/alignment5.adb
+++ b/gcc/testsuite/gnat.dg/alignment5.adb
@@ -27,5 +27,5 @@ begin
A_REC := B_REC;
end;
--- { dg-final { scan-tree-dump-not "VIEW_CONVERT_EXPR" "gimple" } }
+-- { dg-final { scan-tree-dump-not "\.F" "gimple" } }
-- { dg-final { cleanup-tree-dump "gimple" } }
diff --git a/gcc/testsuite/gnat.dg/alignment6.adb b/gcc/testsuite/gnat.dg/alignment6.adb
index f2889a50ecf..548574f5cc9 100644
--- a/gcc/testsuite/gnat.dg/alignment6.adb
+++ b/gcc/testsuite/gnat.dg/alignment6.adb
@@ -28,5 +28,5 @@ begin
B_REC := A_REC;
end;
--- { dg-final { scan-tree-dump-not "VIEW_CONVERT_EXPR" "gimple" } }
+-- { dg-final { scan-tree-dump-not "VIEW_CONVERT_EXPR" "gimple" { xfail *-*-* } } }
-- { dg-final { cleanup-tree-dump "gimple" } }
diff --git a/gcc/testsuite/gnat.dg/concat_length.adb b/gcc/testsuite/gnat.dg/concat_length.adb
new file mode 100644
index 00000000000..fe482d98d0a
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/concat_length.adb
@@ -0,0 +1,15 @@
+-- { dg-do run }
+
+procedure Concat_Length is
+ type Byte is mod 256;
+ for Byte'Size use 8;
+ type Block is array(Byte range <>) of Integer;
+
+ C0: Block(1..7) := (others => 0);
+ C1: Block(8..255) := (others => 0);
+ C2: Block := C0 & C1;
+begin
+ if C2'Length /= 255 then
+ raise Program_Error;
+ end if;
+end;
diff --git a/gcc/testsuite/gnat.dg/discr6.adb b/gcc/testsuite/gnat.dg/discr6.adb
new file mode 100644
index 00000000000..441b19bdf29
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/discr6.adb
@@ -0,0 +1,33 @@
+-- { dg-do compile }
+-- { dg-options "-gnatdm -gnatws" }
+
+with Discr6_Pkg;
+
+procedure Discr6 is
+
+ type T_Bit is range 0..1;
+ type T_Entier_16 is range -2**15 .. 2**15-1;
+
+ package My_Q is new Discr6_Pkg(T_Entier_16);
+
+ type T_Valeur is (BIT, Entier_16);
+
+ type R(D : T_Valeur) is record
+ case D is
+ when BIT => V_BIT : T_Bit;
+ when Entier_16 => V_E16 : T_Entier_16;
+ end case;
+ end record;
+ for R use record
+ V_BIT at 0 range 0..7;
+ V_E16 at 0 range 0..15;
+ D at 8 range 0..7;
+ end record;
+ for R'size use 128;
+
+ A : R(Entier_16);
+ I : Integer;
+
+begin
+ I := My_Q.X(A.V_E16);
+end;
diff --git a/gcc/testsuite/gnat.dg/discr6_pkg.ads b/gcc/testsuite/gnat.dg/discr6_pkg.ads
new file mode 100644
index 00000000000..11d713c244d
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/discr6_pkg.ads
@@ -0,0 +1,16 @@
+generic
+
+ type T(<>) is private;
+
+package Discr6_Pkg is
+
+ function X (A : T) return Integer;
+
+ pragma Interface(C, X);
+ pragma IMPORT_FUNCTION (
+ INTERNAL => X,
+ EXTERNAL => X,
+ PARAMETER_TYPES => (T),
+ MECHANISM => (Descriptor(S)));
+
+end Discr6_Pkg;
diff --git a/gcc/testsuite/gnat.dg/specs/tag2.ads b/gcc/testsuite/gnat.dg/specs/tag2.ads
new file mode 100644
index 00000000000..8e09f25a059
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/specs/tag2.ads
@@ -0,0 +1,17 @@
+-- { dg-do compile }
+
+package tag2 is
+ type I is synchronized interface;
+ type T1 is tagged;
+ type T2 is tagged;
+ type T3 is tagged;
+ type T4 is tagged;
+ type T5 is tagged;
+ type T6 is tagged;
+ protected type T1 is end T1; -- { dg-error "must be a tagged type" }
+ task type T2; -- { dg-error "must be a tagged type" }
+ type T3 is null record; -- { dg-error "must be tagged" }
+ task type T4 is new I with end;
+ protected type T5 is new I with end;
+ type T6 is tagged null record;
+end tag2;
diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
index 180ce86da2e..e071934a947 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -518,6 +518,13 @@ proc check_effective_target_tls {} {
# This won't change for different subtargets so cache the result.
proc check_effective_target_tls_native {} {
+ # VxWorks uses emulated TLS machinery, but with non-standard helper
+ # functions, so we fail to automatically detect it.
+ global target_triplet
+ if { [regexp ".*-.*-vxworks.*" $target_triplet] } {
+ return 0
+ }
+
return [check_no_messages_and_pattern tls_native "!emutls" assembly {
__thread int i;
int f (void) { return i; }
@@ -2345,3 +2352,11 @@ proc check_effective_target_c99_runtime { } {
$contents [add_options_for_c99_runtime ""]
}]
}
+
+# Return 1 if target wchar_t is at least 4 bytes.
+
+proc check_effective_target_4byte_wchar_t { } {
+ return [check_no_compiler_messages 4byte_wchar_t object {
+ int dummy[sizeof (wchar_t) >= 4 ? 1 : -1];
+ }]
+}
diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c
index f63f6eb989f..5dc9d045a90 100644
--- a/gcc/tree-cfg.c
+++ b/gcc/tree-cfg.c
@@ -1808,9 +1808,9 @@ notice_special_calls (tree t)
int flags = call_expr_flags (t);
if (flags & ECF_MAY_BE_ALLOCA)
- current_function_calls_alloca = true;
+ cfun->calls_alloca = true;
if (flags & ECF_RETURNS_TWICE)
- current_function_calls_setjmp = true;
+ cfun->calls_setjmp = true;
}
@@ -1820,8 +1820,8 @@ notice_special_calls (tree t)
void
clear_special_calls (void)
{
- current_function_calls_alloca = false;
- current_function_calls_setjmp = false;
+ cfun->calls_alloca = false;
+ cfun->calls_setjmp = false;
}
@@ -2495,7 +2495,7 @@ is_ctrl_altering_stmt (const_tree t)
{
/* A non-pure/const CALL_EXPR alters flow control if the current
function has nonlocal labels. */
- if (TREE_SIDE_EFFECTS (call) && current_function_has_nonlocal_label)
+ if (TREE_SIDE_EFFECTS (call) && cfun->has_nonlocal_label)
return true;
/* A CALL_EXPR also alters control flow if it does not return. */
@@ -2545,7 +2545,7 @@ tree_can_make_abnormal_goto (const_tree t)
if (TREE_CODE (t) == WITH_SIZE_EXPR)
t = TREE_OPERAND (t, 0);
if (TREE_CODE (t) == CALL_EXPR)
- return TREE_SIDE_EFFECTS (t) && current_function_has_nonlocal_label;
+ return TREE_SIDE_EFFECTS (t) && cfun->has_nonlocal_label;
return false;
}
@@ -3188,28 +3188,20 @@ verify_expr (tree *tp, int *walk_subtrees, void *data ATTRIBUTE_UNUSED)
case ADDR_EXPR:
{
- bool old_invariant;
bool old_constant;
bool old_side_effects;
- bool new_invariant;
bool new_constant;
bool new_side_effects;
- old_invariant = TREE_INVARIANT (t);
+ gcc_assert (is_gimple_address (t));
+
old_constant = TREE_CONSTANT (t);
old_side_effects = TREE_SIDE_EFFECTS (t);
recompute_tree_invariant_for_addr_expr (t);
- new_invariant = TREE_INVARIANT (t);
new_side_effects = TREE_SIDE_EFFECTS (t);
new_constant = TREE_CONSTANT (t);
- if (old_invariant != new_invariant)
- {
- error ("invariant not recomputed when ADDR_EXPR changed");
- return t;
- }
-
if (old_constant != new_constant)
{
error ("constant not recomputed when ADDR_EXPR changed");
@@ -3254,6 +3246,9 @@ verify_expr (tree *tp, int *walk_subtrees, void *data ATTRIBUTE_UNUSED)
}
break;
+ case NON_LVALUE_EXPR:
+ gcc_unreachable ();
+
case NOP_EXPR:
case CONVERT_EXPR:
case FIX_TRUNC_EXPR:
@@ -3261,7 +3256,6 @@ verify_expr (tree *tp, int *walk_subtrees, void *data ATTRIBUTE_UNUSED)
case NEGATE_EXPR:
case ABS_EXPR:
case BIT_NOT_EXPR:
- case NON_LVALUE_EXPR:
case TRUTH_NOT_EXPR:
CHECK_OP (0, "invalid operand to unary operator");
break;
@@ -5511,7 +5505,7 @@ DEF_VEC_ALLOC_P(basic_block,heap);
adding blocks when the dominator traversal reaches EXIT. This
function silently assumes that ENTRY strictly dominates EXIT. */
-static void
+void
gather_blocks_in_sese_region (basic_block entry, basic_block exit,
VEC(basic_block,heap) **bbs_p)
{
@@ -6586,7 +6580,7 @@ tree_purge_dead_abnormal_call_edges (basic_block bb)
{
bool changed = tree_purge_dead_eh_edges (bb);
- if (current_function_has_nonlocal_label)
+ if (cfun->has_nonlocal_label)
{
tree stmt = last_stmt (bb);
edge_iterator ei;
diff --git a/gcc/tree-flow.h b/gcc/tree-flow.h
index 03d1ba5ee5d..e36493dae42 100644
--- a/gcc/tree-flow.h
+++ b/gcc/tree-flow.h
@@ -771,6 +771,8 @@ extern bool tree_duplicate_sese_region (edge, edge, basic_block *, unsigned,
basic_block *);
extern bool tree_duplicate_sese_tail (edge, edge, basic_block *, unsigned,
basic_block *);
+extern void gather_blocks_in_sese_region (basic_block entry, basic_block exit,
+ VEC(basic_block,heap) **bbs_p);
extern void add_phi_args_after_copy_bb (basic_block);
extern void add_phi_args_after_copy (basic_block *, unsigned, edge);
extern bool tree_purge_dead_abnormal_call_edges (basic_block);
@@ -944,7 +946,7 @@ tree get_symbol_constant_value (tree);
tree fold_const_aggregate_ref (tree);
/* In tree-vrp.c */
-tree vrp_evaluate_conditional (tree, tree);
+tree vrp_evaluate_conditional (enum tree_code, tree, tree, tree);
void simplify_stmt_using_ranges (tree);
/* In tree-ssa-dom.c */
@@ -1016,7 +1018,7 @@ basic_block *blocks_in_phiopt_order (void);
void tree_ssa_lim (void);
unsigned int tree_ssa_unswitch_loops (void);
unsigned int canonicalize_induction_variables (void);
-unsigned int tree_unroll_loops_completely (bool);
+unsigned int tree_unroll_loops_completely (bool, bool);
unsigned int tree_ssa_prefetch_arrays (void);
unsigned int remove_empty_loops (void);
void tree_ssa_iv_optimize (void);
diff --git a/gcc/tree-gimple.c b/gcc/tree-gimple.c
index bc482983847..433c294039b 100644
--- a/gcc/tree-gimple.c
+++ b/gcc/tree-gimple.c
@@ -194,6 +194,45 @@ is_gimple_constant (const_tree t)
}
}
+/* Return true if T is a gimple address. */
+
+bool
+is_gimple_address (const_tree t)
+{
+ tree op;
+
+ if (TREE_CODE (t) != ADDR_EXPR)
+ return false;
+
+ op = TREE_OPERAND (t, 0);
+ while (handled_component_p (op))
+ {
+ if ((TREE_CODE (op) == ARRAY_REF
+ || TREE_CODE (op) == ARRAY_RANGE_REF)
+ && !is_gimple_val (TREE_OPERAND (op, 1)))
+ return false;
+
+ op = TREE_OPERAND (op, 0);
+ }
+
+ if (CONSTANT_CLASS_P (op) || INDIRECT_REF_P (op))
+ return true;
+
+ switch (TREE_CODE (op))
+ {
+ case PARM_DECL:
+ case RESULT_DECL:
+ case LABEL_DECL:
+ case FUNCTION_DECL:
+ case VAR_DECL:
+ case CONST_DECL:
+ return true;
+
+ default:
+ return false;
+ }
+}
+
/* Return true if T is a gimple invariant address. */
bool
@@ -227,40 +266,7 @@ is_gimple_invariant_address (const_tree t)
op = TREE_OPERAND (op, 0);
}
- if (CONSTANT_CLASS_P (op))
- return true;
-
- if (INDIRECT_REF_P (op))
- return false;
-
- switch (TREE_CODE (op))
- {
- case PARM_DECL:
- case RESULT_DECL:
- case LABEL_DECL:
- case FUNCTION_DECL:
- return true;
-
- case VAR_DECL:
- if (((TREE_STATIC (op) || DECL_EXTERNAL (op))
- && ! DECL_DLLIMPORT_P (op))
- || DECL_THREAD_LOCAL_P (op)
- || DECL_CONTEXT (op) == current_function_decl
- || decl_function_context (op) == current_function_decl)
- return true;
- break;
-
- case CONST_DECL:
- if ((TREE_STATIC (op) || DECL_EXTERNAL (op))
- || decl_function_context (op) == current_function_decl)
- return true;
- break;
-
- default:
- gcc_unreachable ();
- }
-
- return false;
+ return CONSTANT_CLASS_P (op) || decl_address_invariant_p (op);
}
/* Return true if T is a GIMPLE minimal invariant. It's a restricted
diff --git a/gcc/tree-gimple.h b/gcc/tree-gimple.h
index b45b44b2bde..2c4aa2d9379 100644
--- a/gcc/tree-gimple.h
+++ b/gcc/tree-gimple.h
@@ -62,6 +62,8 @@ extern bool is_gimple_addressable (tree);
/* Returns true iff T is any valid GIMPLE lvalue. */
extern bool is_gimple_lvalue (tree);
+/* Returns true iff T is a GIMPLE address. */
+bool is_gimple_address (const_tree);
/* Returns true iff T is a GIMPLE invariant address. */
bool is_gimple_invariant_address (const_tree);
/* Returns true iff T is a valid GIMPLE constant. */
diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c
index 665819961c6..687ed95c964 100644
--- a/gcc/tree-inline.c
+++ b/gcc/tree-inline.c
@@ -2233,7 +2233,6 @@ estimate_num_insns_1 (tree *tp, int *walk_subtrees, void *data)
case EH_FILTER_EXPR:
case STATEMENT_LIST:
case ERROR_MARK:
- case NON_LVALUE_EXPR:
case FDESC_EXPR:
case VA_ARG_EXPR:
case TRY_CATCH_EXPR:
diff --git a/gcc/tree-mudflap.c b/gcc/tree-mudflap.c
index 59f4beca2b0..b5e8984a4df 100644
--- a/gcc/tree-mudflap.c
+++ b/gcc/tree-mudflap.c
@@ -83,7 +83,6 @@ mf_build_string (const char *string)
TREE_TYPE (result) = build_array_type
(char_type_node, build_index_type (build_int_cst (NULL_TREE, len)));
TREE_CONSTANT (result) = 1;
- TREE_INVARIANT (result) = 1;
TREE_READONLY (result) = 1;
TREE_STATIC (result) = 1;
diff --git a/gcc/tree-nested.c b/gcc/tree-nested.c
index 2c1b9190d85..8588e303d28 100644
--- a/gcc/tree-nested.c
+++ b/gcc/tree-nested.c
@@ -1037,8 +1037,8 @@ convert_nonlocal_reference (tree *tp, int *walk_subtrees, void *data)
{
tree save_context;
- /* If we changed anything, then TREE_INVARIANT is be wrong,
- since we're no longer directly referencing a decl. */
+ /* If we changed anything, we might no longer be directly
+ referencing a decl. */
save_context = current_function_decl;
current_function_decl = info->context;
recompute_tree_invariant_for_addr_expr (t);
diff --git a/gcc/tree-optimize.c b/gcc/tree-optimize.c
index b6a9b93ef28..8c53e6f28b6 100644
--- a/gcc/tree-optimize.c
+++ b/gcc/tree-optimize.c
@@ -411,7 +411,7 @@ tree_rest_of_compilation (tree fndecl)
call expand_expr to calculate the size of a variable-sized array.
We haven't necessarily assigned RTL to all variables yet, so it's
not safe to try to expand expressions involving them. */
- cfun->x_dont_save_pending_sizes_p = 1;
+ cfun->dont_save_pending_sizes_p = 1;
tree_register_cfg_hooks ();
diff --git a/gcc/tree-parloops.c b/gcc/tree-parloops.c
index 4f3c13e2395..b377e846d0a 100644
--- a/gcc/tree-parloops.c
+++ b/gcc/tree-parloops.c
@@ -455,18 +455,17 @@ loop_has_blocks_with_irreducible_flag (struct loop *loop)
}
/* Assigns the address of OBJ in TYPE to an ssa name, and returns this name.
- The assignment statement is placed before LOOP. DECL_ADDRESS maps decls
+ The assignment statement is placed on edge ENTRY. DECL_ADDRESS maps decls
to their addresses that can be reused. The address of OBJ is known to
be invariant in the whole function. */
static tree
-take_address_of (tree obj, tree type, struct loop *loop, htab_t decl_address)
+take_address_of (tree obj, tree type, edge entry, htab_t decl_address)
{
int uid;
void **dslot;
struct int_tree_map ielt, *nielt;
tree *var_p, name, bvar, stmt, addr;
- edge entry = loop_preheader_edge (loop);
/* Since the address of OBJ is invariant, the trees may be shared.
Avoid rewriting unrelated parts of the code. */
@@ -570,15 +569,16 @@ initialize_reductions (void **slot, void *data)
struct elv_data
{
- struct loop *loop;
+ edge entry;
htab_t decl_address;
bool changed;
};
-/* Eliminates references to local variables in *TP out of LOOP. DECL_ADDRESS
- contains addresses of the references that had their address taken already.
- If the expression is changed, CHANGED is set to true. Callback for
- walk_tree. */
+/* Eliminates references to local variables in *TP out of the single
+ entry single exit region starting at DTA->ENTRY.
+ DECL_ADDRESS contains addresses of the references that had their
+ address taken already. If the expression is changed, CHANGED is
+ set to true. Callback for walk_tree. */
static tree
eliminate_local_variables_1 (tree *tp, int *walk_subtrees, void *data)
@@ -595,7 +595,7 @@ eliminate_local_variables_1 (tree *tp, int *walk_subtrees, void *data)
type = TREE_TYPE (t);
addr_type = build_pointer_type (type);
- addr = take_address_of (t, addr_type, dta->loop, dta->decl_address);
+ addr = take_address_of (t, addr_type, dta->entry, dta->decl_address);
*tp = build1 (INDIRECT_REF, TREE_TYPE (*tp), addr);
dta->changed = true;
@@ -625,7 +625,7 @@ eliminate_local_variables_1 (tree *tp, int *walk_subtrees, void *data)
return NULL_TREE;
addr_type = TREE_TYPE (t);
- addr = take_address_of (obj, addr_type, dta->loop, dta->decl_address);
+ addr = take_address_of (obj, addr_type, dta->entry, dta->decl_address);
*tp = addr;
dta->changed = true;
@@ -638,17 +638,18 @@ eliminate_local_variables_1 (tree *tp, int *walk_subtrees, void *data)
return NULL_TREE;
}
-/* Moves the references to local variables in STMT from LOOP. DECL_ADDRESS
- contains addresses for the references for that we have already taken
- them. */
+/* Moves the references to local variables in STMT out of the single
+ entry single exit region starting at ENTRY. DECL_ADDRESS contains
+ addresses of the references that had their address taken
+ already. */
static void
-eliminate_local_variables_stmt (struct loop *loop, tree stmt,
+eliminate_local_variables_stmt (edge entry, tree stmt,
htab_t decl_address)
{
struct elv_data dta;
- dta.loop = loop;
+ dta.entry = entry;
dta.decl_address = decl_address;
dta.changed = false;
@@ -658,33 +659,75 @@ eliminate_local_variables_stmt (struct loop *loop, tree stmt,
update_stmt (stmt);
}
-/* Eliminates the references to local variables from LOOP.
+/* Eliminates the references to local variables from the single entry
+ single exit region between the ENTRY and EXIT edges.
+
This includes:
1) Taking address of a local variable -- these are moved out of the
- loop (and temporary variable is created to hold the address if
+ region (and temporary variable is created to hold the address if
necessary).
+
2) Dereferencing a local variable -- these are replaced with indirect
references. */
static void
-eliminate_local_variables (struct loop *loop)
+eliminate_local_variables (edge entry, edge exit)
{
- basic_block bb, *body = get_loop_body (loop);
+ basic_block bb;
+ VEC (basic_block, heap) *body = VEC_alloc (basic_block, heap, 3);
unsigned i;
block_stmt_iterator bsi;
htab_t decl_address = htab_create (10, int_tree_map_hash, int_tree_map_eq,
free);
+ basic_block entry_bb = entry->src;
+ basic_block exit_bb = exit->dest;
- /* Find and rename the ssa names defined outside of loop. */
- for (i = 0; i < loop->num_nodes; i++)
- {
- bb = body[i];
+ gather_blocks_in_sese_region (entry_bb, exit_bb, &body);
+ for (i = 0; VEC_iterate (basic_block, body, i, bb); i++)
+ if (bb != entry_bb && bb != exit_bb)
for (bsi = bsi_start (bb); !bsi_end_p (bsi); bsi_next (&bsi))
- eliminate_local_variables_stmt (loop, bsi_stmt (bsi), decl_address);
- }
+ eliminate_local_variables_stmt (entry, bsi_stmt (bsi),
+ decl_address);
htab_delete (decl_address);
+ VEC_free (basic_block, heap, body);
+}
+
+/* Returns true if expression EXPR is not defined between ENTRY and
+ EXIT, i.e. if all its operands are defined outside of the region. */
+
+static bool
+expr_invariant_in_region_p (edge entry, edge exit, tree expr)
+{
+ basic_block entry_bb = entry->src;
+ basic_block exit_bb = exit->dest;
+ basic_block def_bb;
+ unsigned i, len;
+
+ if (is_gimple_min_invariant (expr))
+ return true;
+
+ if (TREE_CODE (expr) == SSA_NAME)
+ {
+ def_bb = bb_for_stmt (SSA_NAME_DEF_STMT (expr));
+ if (def_bb
+ && dominated_by_p (CDI_DOMINATORS, def_bb, entry_bb)
+ && !dominated_by_p (CDI_DOMINATORS, def_bb, exit_bb))
+ return false;
+
+ return true;
+ }
+
+ if (!EXPR_P (expr) && !GIMPLE_STMT_P (expr))
+ return false;
+
+ len = TREE_OPERAND_LENGTH (expr);
+ for (i = 0; i < len; i++)
+ if (!expr_invariant_in_region_p (entry, exit, TREE_OPERAND (expr, i)))
+ return false;
+
+ return true;
}
/* If COPY_NAME_P is true, creates and returns a duplicate of NAME.
@@ -695,9 +738,9 @@ eliminate_local_variables (struct loop *loop)
duplicated, storing the copies in DECL_COPIES. */
static tree
-separate_decls_in_loop_name (tree name,
- htab_t name_copies, htab_t decl_copies,
- bool copy_name_p)
+separate_decls_in_region_name (tree name,
+ htab_t name_copies, htab_t decl_copies,
+ bool copy_name_p)
{
tree copy, var, var_copy;
unsigned idx, uid, nuid;
@@ -762,15 +805,16 @@ separate_decls_in_loop_name (tree name,
return copy;
}
-/* Finds the ssa names used in STMT that are defined outside of LOOP and
- replaces such ssa names with their duplicates. The duplicates are stored to
- NAME_COPIES. Base decls of all ssa names used in STMT
- (including those defined in LOOP) are replaced with the new temporary
- variables; the replacement decls are stored in DECL_COPIES. */
+/* Finds the ssa names used in STMT that are defined outside the
+ region between ENTRY and EXIT and replaces such ssa names with
+ their duplicates. The duplicates are stored to NAME_COPIES. Base
+ decls of all ssa names used in STMT (including those defined in
+ LOOP) are replaced with the new temporary variables; the
+ replacement decls are stored in DECL_COPIES. */
static void
-separate_decls_in_loop_stmt (struct loop *loop, tree stmt,
- htab_t name_copies, htab_t decl_copies)
+separate_decls_in_region_stmt (edge entry, edge exit, tree stmt,
+ htab_t name_copies, htab_t decl_copies)
{
use_operand_p use;
def_operand_p def;
@@ -784,8 +828,8 @@ separate_decls_in_loop_stmt (struct loop *loop, tree stmt,
{
name = DEF_FROM_PTR (def);
gcc_assert (TREE_CODE (name) == SSA_NAME);
- copy = separate_decls_in_loop_name (name, name_copies, decl_copies,
- false);
+ copy = separate_decls_in_region_name (name, name_copies, decl_copies,
+ false);
gcc_assert (copy == name);
}
@@ -795,9 +839,9 @@ separate_decls_in_loop_stmt (struct loop *loop, tree stmt,
if (TREE_CODE (name) != SSA_NAME)
continue;
- copy_name_p = expr_invariant_in_loop_p (loop, name);
- copy = separate_decls_in_loop_name (name, name_copies, decl_copies,
- copy_name_p);
+ copy_name_p = expr_invariant_in_region_p (entry, exit, name);
+ copy = separate_decls_in_region_name (name, name_copies, decl_copies,
+ copy_name_p);
SET_USE (use, copy);
}
}
@@ -1118,36 +1162,44 @@ create_loads_and_stores_for_name (void **slot, void *data)
in LOOP. */
static void
-separate_decls_in_loop (struct loop *loop, htab_t reduction_list,
- tree * arg_struct, tree * new_arg_struct,
- struct clsn_data *ld_st_data)
+separate_decls_in_region (edge entry, edge exit, htab_t reduction_list,
+ tree *arg_struct, tree *new_arg_struct,
+ struct clsn_data *ld_st_data)
{
- basic_block bb1 = split_edge (loop_preheader_edge (loop));
+ basic_block bb1 = split_edge (entry);
basic_block bb0 = single_pred (bb1);
htab_t name_copies = htab_create (10, name_to_copy_elt_hash,
name_to_copy_elt_eq, free);
htab_t decl_copies = htab_create (10, int_tree_map_hash, int_tree_map_eq,
free);
- basic_block bb, *body = get_loop_body (loop);
unsigned i;
tree phi, type, type_name, nvar;
block_stmt_iterator bsi;
struct clsn_data clsn_data;
+ VEC (basic_block, heap) *body = VEC_alloc (basic_block, heap, 3);
+ basic_block bb;
+ basic_block entry_bb = bb1;
+ basic_block exit_bb = exit->dest;
- /* Find and rename the ssa names defined outside of loop. */
- for (i = 0; i < loop->num_nodes; i++)
- {
- bb = body[i];
-
- for (phi = phi_nodes (bb); phi; phi = PHI_CHAIN (phi))
- separate_decls_in_loop_stmt (loop, phi, name_copies, decl_copies);
+ entry = single_succ_edge(entry_bb);
+ gather_blocks_in_sese_region (entry_bb, exit_bb, &body);
- for (bsi = bsi_start (bb); !bsi_end_p (bsi); bsi_next (&bsi))
- separate_decls_in_loop_stmt (loop, bsi_stmt (bsi), name_copies,
- decl_copies);
+ for (i = 0; VEC_iterate (basic_block, body, i, bb); i++)
+ {
+ if (bb != entry_bb && bb != exit_bb)
+ {
+ for (phi = phi_nodes (bb); phi; phi = PHI_CHAIN (phi))
+ separate_decls_in_region_stmt (entry, exit, phi, name_copies,
+ decl_copies);
+
+ for (bsi = bsi_start (bb); !bsi_end_p (bsi); bsi_next (&bsi))
+ separate_decls_in_region_stmt (entry, exit, bsi_stmt (bsi),
+ name_copies, decl_copies);
+ }
}
- free (body);
+
+ VEC_free (basic_block, heap, body);
if (htab_elements (name_copies) == 0)
{
@@ -1165,7 +1217,7 @@ separate_decls_in_loop (struct loop *loop, htab_t reduction_list,
TYPE_NAME (type) = type_name;
htab_traverse (name_copies, add_field_for_name, type);
- if (htab_elements (reduction_list) > 0)
+ if (reduction_list && htab_elements (reduction_list) > 0)
{
/* Create the fields for reductions. */
htab_traverse (reduction_list, add_field_for_reduction,
@@ -1190,12 +1242,12 @@ separate_decls_in_loop (struct loop *loop, htab_t reduction_list,
/* Load the calculation from memory (after the join of the threads). */
- if (htab_elements (reduction_list) > 0)
+ if (reduction_list && htab_elements (reduction_list) > 0)
{
htab_traverse (reduction_list, create_stores_for_reduction,
ld_st_data);
clsn_data.load = make_ssa_name (nvar, NULL_TREE);
- clsn_data.load_bb = single_dom_exit (loop)->dest;
+ clsn_data.load_bb = exit->dest;
clsn_data.store = ld_st_data->store;
create_final_loads_for_reduction (reduction_list, &clsn_data);
}
@@ -1605,6 +1657,7 @@ gen_parallel_loop (struct loop *loop, htab_t reduction_list,
tree many_iterations_cond, type, nit;
tree stmts, arg_struct, new_arg_struct;
basic_block parallel_head;
+ edge entry, exit;
struct clsn_data clsn_data;
unsigned prob;
@@ -1702,18 +1755,20 @@ gen_parallel_loop (struct loop *loop, htab_t reduction_list,
/* Ensure that the exit condition is the first statement in the loop. */
transform_to_exit_first_loop (loop, reduction_list, nit);
-
/* Generate intializations for reductions. */
-
if (htab_elements (reduction_list) > 0)
htab_traverse (reduction_list, initialize_reductions, loop);
/* Eliminate the references to local variables from the loop. */
- eliminate_local_variables (loop);
+ gcc_assert (single_exit (loop));
+ entry = loop_preheader_edge (loop);
+ exit = single_dom_exit (loop);
+ eliminate_local_variables (entry, exit);
/* In the old loop, move all variables non-local to the loop to a structure
and back, and create separate decls for the variables used in loop. */
- separate_decls_in_loop (loop, reduction_list, &arg_struct, &new_arg_struct, &clsn_data);
+ separate_decls_in_region (entry, exit, reduction_list, &arg_struct,
+ &new_arg_struct, &clsn_data);
/* Create the parallel constructs. */
parallel_head = create_parallel_loop (loop, create_loop_fn (), arg_struct,
diff --git a/gcc/tree-pass.h b/gcc/tree-pass.h
index 4f5936283a3..fc130a8dd00 100644
--- a/gcc/tree-pass.h
+++ b/gcc/tree-pass.h
@@ -96,7 +96,8 @@ struct opt_pass
enum opt_pass_type {
GIMPLE_PASS,
RTL_PASS,
- SIMPLE_IPA_PASS
+ SIMPLE_IPA_PASS,
+ IPA_PASS
} type;
/* Terse name of the pass used as a fragment of the dump file name. */
const char *name;
@@ -133,7 +134,7 @@ struct opt_pass
unsigned int todo_flags_finish;
};
-/* Description or GIMPLE pass. */
+/* Description of GIMPLE pass. */
struct gimple_opt_pass
{
struct opt_pass pass;
@@ -145,7 +146,36 @@ struct rtl_opt_pass
struct opt_pass pass;
};
-/* Description if simple IPA pass. Simple IPA passes have just one execute
+struct varpool_node;
+struct cgraph_node;
+
+/* Description of IPA pass with generate summary, write, execute, read and
+ transform stages. */
+struct ipa_opt_pass
+{
+ struct opt_pass pass;
+
+ /* IPA passes can analyze function body and variable initializers using this
+ hook and produce summary. */
+ void (*function_generate_summary) (struct cgraph_node *);
+ void (*variable_generate_summary) (struct varpool_node *);
+
+ /* These hooks will be used to serialize IPA summaries on disk. For a moment
+ they are just placeholders. */
+ void (*function_write_summary) (struct cgraph_node *);
+ void (*variable_write_summary) (struct varpool_node *);
+ void (*function_read_summary) (struct cgraph_node *);
+ void (*variable_read_summary) (struct varpool_node *);
+
+ /* Results of interprocedural propagation of an IPA pass is applied to
+ function body via this hook. */
+ unsigned int function_transform_todo_flags_start;
+ unsigned int (*function_transform) (struct cgraph_node *);
+ void (*variable_transform) (struct varpool_node *);
+
+};
+
+/* Description of simple IPA pass. Simple IPA passes have just one execute
hook. */
struct simple_ipa_opt_pass
{
@@ -290,6 +320,7 @@ extern struct gimple_opt_pass pass_if_conversion;
extern struct gimple_opt_pass pass_loop_distribution;
extern struct gimple_opt_pass pass_vectorize;
extern struct gimple_opt_pass pass_complete_unroll;
+extern struct gimple_opt_pass pass_complete_unrolli;
extern struct gimple_opt_pass pass_parallelize_loops;
extern struct gimple_opt_pass pass_loop_prefetch;
extern struct gimple_opt_pass pass_iv_optimize;
@@ -335,7 +366,6 @@ extern struct gimple_opt_pass pass_simple_dse;
extern struct gimple_opt_pass pass_nrv;
extern struct gimple_opt_pass pass_mark_used_blocks;
extern struct gimple_opt_pass pass_rename_ssa_copies;
-extern struct gimple_opt_pass pass_expand;
extern struct gimple_opt_pass pass_rest_of_compilation;
extern struct gimple_opt_pass pass_sink_code;
extern struct gimple_opt_pass pass_fre;
@@ -353,9 +383,10 @@ extern struct gimple_opt_pass pass_build_cgraph_edges;
extern struct gimple_opt_pass pass_reset_cc_flags;
/* IPA Passes */
+extern struct ipa_opt_pass pass_ipa_inline;
+
extern struct simple_ipa_opt_pass pass_ipa_matrix_reorg;
extern struct simple_ipa_opt_pass pass_ipa_cp;
-extern struct simple_ipa_opt_pass pass_ipa_inline;
extern struct simple_ipa_opt_pass pass_ipa_early_inline;
extern struct simple_ipa_opt_pass pass_ipa_reference;
extern struct simple_ipa_opt_pass pass_ipa_pure_const;
@@ -382,6 +413,7 @@ extern struct gimple_opt_pass pass_fixup_cfg;
extern struct gimple_opt_pass pass_compiler_probe;
#endif
+extern struct rtl_opt_pass pass_expand;
extern struct rtl_opt_pass pass_init_function;
extern struct rtl_opt_pass pass_jump;
extern struct rtl_opt_pass pass_rtl_eh;
@@ -478,8 +510,8 @@ extern struct rtl_opt_pass pass_final;
extern struct rtl_opt_pass pass_rtl_seqabstr;
extern struct gimple_opt_pass pass_release_ssa_names;
extern struct gimple_opt_pass pass_early_inline;
+extern struct gimple_opt_pass pass_O0_always_inline;
extern struct gimple_opt_pass pass_inline_parameters;
-extern struct gimple_opt_pass pass_apply_inline;
extern struct gimple_opt_pass pass_all_early_optimizations;
extern struct gimple_opt_pass pass_update_address_taken;
diff --git a/gcc/tree-scalar-evolution.c b/gcc/tree-scalar-evolution.c
index 29f0dcf8f4c..31b77689b1a 100644
--- a/gcc/tree-scalar-evolution.c
+++ b/gcc/tree-scalar-evolution.c
@@ -2117,7 +2117,6 @@ instantiate_parameters_1 (struct loop *loop, tree chrec, int flags, htab_t cache
case NOP_EXPR:
case CONVERT_EXPR:
- case NON_LVALUE_EXPR:
op0 = instantiate_parameters_1 (loop, TREE_OPERAND (chrec, 0),
flags, cache, size_expr);
if (op0 == chrec_dont_know)
diff --git a/gcc/tree-ssa-alias.c b/gcc/tree-ssa-alias.c
index a9ae29fa876..c52d75e633b 100644
--- a/gcc/tree-ssa-alias.c
+++ b/gcc/tree-ssa-alias.c
@@ -196,7 +196,6 @@ static bitmap_obstack alias_bitmap_obstack;
/* Local functions. */
static void compute_flow_insensitive_aliasing (struct alias_info *);
-static void finalize_ref_all_pointers (struct alias_info *);
static void dump_alias_stats (FILE *);
static bool may_alias_p (tree, alias_set_type, tree, alias_set_type, bool);
static tree create_memory_tag (tree type, bool is_type_tag);
@@ -1800,12 +1799,6 @@ compute_may_aliases (void)
avoid invalid transformations on them. */
maybe_create_global_var ();
- /* If the program contains ref-all pointers, finalize may-alias information
- for them. This pass needs to be run after call-clobbering information
- has been computed. */
- if (ai->ref_all_symbol_mem_tag)
- finalize_ref_all_pointers (ai);
-
/* Compute memory partitions for every memory variable. */
compute_memory_partitions ();
@@ -2354,7 +2347,6 @@ compute_flow_sensitive_aliasing (struct alias_info *ai)
for (i = 0; VEC_iterate (tree, ai->processed_ptrs, i, ptr); i++)
{
struct ptr_info_def *pi = SSA_NAME_PTR_INFO (ptr);
- tree tag = symbol_mem_tag (SSA_NAME_VAR (ptr));
/* Set up aliasing information for PTR's name memory tag (if it has
one). Note that only pointers that have been dereferenced will
@@ -2362,18 +2354,7 @@ compute_flow_sensitive_aliasing (struct alias_info *ai)
if (pi->name_mem_tag && pi->pt_vars)
{
if (!bitmap_empty_p (pi->pt_vars))
- {
- union_alias_set_into (pi->name_mem_tag, pi->pt_vars);
- union_alias_set_into (tag, pi->pt_vars);
- bitmap_clear_bit (MTAG_ALIASES (tag), DECL_UID (tag));
-
- /* It may be the case that this the tag uid was the only
- bit we had set in the aliases list, and in this case,
- we don't want to keep an empty bitmap, as this
- asserts in tree-ssa-operands.c . */
- if (bitmap_empty_p (MTAG_ALIASES (tag)))
- BITMAP_FREE (MTAG_ALIASES (tag));
- }
+ union_alias_set_into (pi->name_mem_tag, pi->pt_vars);
}
}
timevar_pop (TV_FLOW_SENSITIVE);
@@ -2390,9 +2371,7 @@ have_common_aliases_p (bitmap tag1aliases, bitmap tag2aliases)
/* This is the old behavior of have_common_aliases_p, which is to
return false if both sets are empty, or one set is and the other
isn't. */
- if ((tag1aliases == NULL && tag2aliases != NULL)
- || (tag2aliases == NULL && tag1aliases != NULL)
- || (tag1aliases == NULL && tag2aliases == NULL))
+ if (tag1aliases == NULL || tag2aliases == NULL)
return false;
return bitmap_intersect_p (tag1aliases, tag2aliases);
@@ -2422,10 +2401,6 @@ compute_flow_insensitive_aliasing (struct alias_info *ai)
tree tag = symbol_mem_tag (p_map->var);
tree var;
- /* Call-clobbering information is not finalized yet at this point. */
- if (PTR_IS_REF_ALL (p_map->var))
- continue;
-
for (j = 0; j < ai->num_addressable_vars; j++)
{
struct alias_map_d *v_map;
@@ -2487,16 +2462,14 @@ compute_flow_insensitive_aliasing (struct alias_info *ai)
tree tag1 = symbol_mem_tag (p_map1->var);
bitmap may_aliases1 = MTAG_ALIASES (tag1);
- if (PTR_IS_REF_ALL (p_map1->var))
- continue;
-
- for (j = i + 1; j < ai->num_pointers; j++)
+ for (j = 0; j < ai->num_pointers; j++)
{
struct alias_map_d *p_map2 = ai->pointers[j];
tree tag2 = symbol_mem_tag (p_map2->var);
bitmap may_aliases2 = may_aliases (tag2);
- if (PTR_IS_REF_ALL (p_map2->var))
+ /* By convention tags don't alias themselves. */
+ if (tag1 == tag2)
continue;
/* If the pointers may not point to each other, do nothing. */
@@ -2508,66 +2481,13 @@ compute_flow_insensitive_aliasing (struct alias_info *ai)
if (have_common_aliases_p (may_aliases1, may_aliases2))
continue;
- if (may_aliases2 && !bitmap_empty_p (may_aliases2))
- {
- union_alias_set_into (tag1, may_aliases2);
- }
- else
- {
- /* Since TAG2 does not have any aliases of its own, add
- TAG2 itself to the alias set of TAG1. */
- add_may_alias (tag1, tag2);
- }
+ add_may_alias (tag1, tag2);
}
-
}
timevar_pop (TV_FLOW_INSENSITIVE);
}
-/* Finalize may-alias information for ref-all pointers. Traverse all
- the addressable variables found in setup_pointers_and_addressables.
-
- If flow-sensitive alias analysis has attached a name memory tag to
- a ref-all pointer, we will use it for the dereferences because that
- will have more precise aliasing information. But if there is no
- name tag, we will use a special symbol tag that aliases all the
- call-clobbered addressable variables. */
-
-static void
-finalize_ref_all_pointers (struct alias_info *ai)
-{
- size_t i;
-
- /* First add the real call-clobbered variables. */
- for (i = 0; i < ai->num_addressable_vars; i++)
- {
- tree var = ai->addressable_vars[i]->var;
- if (is_call_clobbered (var))
- add_may_alias (ai->ref_all_symbol_mem_tag, var);
- }
-
- /* Then add the call-clobbered pointer memory tags. See
- compute_flow_insensitive_aliasing for the rationale. */
- for (i = 0; i < ai->num_pointers; i++)
- {
- tree ptr = ai->pointers[i]->var, tag;
- /* Avoid adding to self and clean up. */
- if (PTR_IS_REF_ALL (ptr))
- {
- struct ptr_info_def *pi = get_ptr_info (ptr);
- if (pi->is_dereferenced)
- pi->pt_anything = 0;
- continue;
- }
- tag = symbol_mem_tag (ptr);
- if (is_call_clobbered (tag))
- add_may_alias (ai->ref_all_symbol_mem_tag, tag);
- }
-
-}
-
-
/* Create a new alias set entry for VAR in AI->ADDRESSABLE_VARS. */
static void
@@ -2862,74 +2782,85 @@ may_alias_p (tree ptr, alias_set_type mem_alias_set,
return false;
}
+ /* If the pointed to memory has alias set zero, or the pointer
+ is ref-all, or the pointer decl is marked that no TBAA is to
+ be applied, the MEM can alias VAR. */
+ if (mem_alias_set == 0
+ || DECL_POINTER_ALIAS_SET (ptr) == 0
+ || TYPE_REF_CAN_ALIAS_ALL (TREE_TYPE (ptr))
+ || DECL_NO_TBAA_P (ptr))
+ {
+ alias_stats.alias_mayalias++;
+ alias_stats.simple_resolved++;
+ return true;
+ }
+
gcc_assert (TREE_CODE (mem) == SYMBOL_MEMORY_TAG);
- if (!DECL_NO_TBAA_P (ptr))
- {
- alias_stats.tbaa_queries++;
+ alias_stats.tbaa_queries++;
- /* If the alias sets don't conflict then MEM cannot alias VAR. */
- if (!alias_sets_conflict_p (mem_alias_set, var_alias_set))
- {
- alias_stats.alias_noalias++;
- alias_stats.tbaa_resolved++;
- return false;
- }
+ /* If the alias sets don't conflict then MEM cannot alias VAR. */
+ if (mem_alias_set != var_alias_set
+ && !alias_set_subset_of (mem_alias_set, var_alias_set))
+ {
+ alias_stats.alias_noalias++;
+ alias_stats.tbaa_resolved++;
+ return false;
+ }
- /* If VAR is a record or union type, PTR cannot point into VAR
- unless there is some explicit address operation in the
- program that can reference a field of the type pointed-to by
- PTR. This also assumes that the types of both VAR and PTR
- are contained within the compilation unit, and that there is
- no fancy addressing arithmetic associated with any of the
- types involved. */
- if (mem_alias_set != 0 && var_alias_set != 0)
- {
- tree ptr_type = TREE_TYPE (ptr);
- tree var_type = TREE_TYPE (var);
+ /* If VAR is a record or union type, PTR cannot point into VAR
+ unless there is some explicit address operation in the
+ program that can reference a field of the type pointed-to by
+ PTR. This also assumes that the types of both VAR and PTR
+ are contained within the compilation unit, and that there is
+ no fancy addressing arithmetic associated with any of the
+ types involved. */
+ if (mem_alias_set != 0 && var_alias_set != 0)
+ {
+ tree ptr_type = TREE_TYPE (ptr);
+ tree var_type = TREE_TYPE (var);
- /* The star count is -1 if the type at the end of the
- pointer_to chain is not a record or union type. */
- if ((!alias_set_only) &&
- ipa_type_escape_star_count_of_interesting_type (var_type) >= 0)
- {
- int ptr_star_count = 0;
+ /* The star count is -1 if the type at the end of the
+ pointer_to chain is not a record or union type. */
+ if (!alias_set_only
+ && ipa_type_escape_star_count_of_interesting_type (var_type) >= 0)
+ {
+ int ptr_star_count = 0;
- /* ipa_type_escape_star_count_of_interesting_type is a
- little too restrictive for the pointer type, need to
- allow pointers to primitive types as long as those
- types cannot be pointers to everything. */
- while (POINTER_TYPE_P (ptr_type))
- {
- /* Strip the *s off. */
- ptr_type = TREE_TYPE (ptr_type);
- ptr_star_count++;
- }
+ /* ipa_type_escape_star_count_of_interesting_type is a
+ little too restrictive for the pointer type, need to
+ allow pointers to primitive types as long as those
+ types cannot be pointers to everything. */
+ while (POINTER_TYPE_P (ptr_type))
+ {
+ /* Strip the *s off. */
+ ptr_type = TREE_TYPE (ptr_type);
+ ptr_star_count++;
+ }
- /* There does not appear to be a better test to see if
- the pointer type was one of the pointer to everything
- types. */
- if (ptr_star_count > 0)
- {
- alias_stats.structnoaddress_queries++;
- if (ipa_type_escape_field_does_not_clobber_p (var_type,
- TREE_TYPE (ptr)))
- {
- alias_stats.structnoaddress_resolved++;
- alias_stats.alias_noalias++;
- return false;
- }
- }
- else if (ptr_star_count == 0)
+ /* There does not appear to be a better test to see if
+ the pointer type was one of the pointer to everything
+ types. */
+ if (ptr_star_count > 0)
+ {
+ alias_stats.structnoaddress_queries++;
+ if (ipa_type_escape_field_does_not_clobber_p (var_type,
+ TREE_TYPE (ptr)))
{
- /* If PTR_TYPE was not really a pointer to type, it cannot
- alias. */
- alias_stats.structnoaddress_queries++;
alias_stats.structnoaddress_resolved++;
alias_stats.alias_noalias++;
return false;
}
}
+ else if (ptr_star_count == 0)
+ {
+ /* If PTR_TYPE was not really a pointer to type, it cannot
+ alias. */
+ alias_stats.structnoaddress_queries++;
+ alias_stats.structnoaddress_resolved++;
+ alias_stats.alias_noalias++;
+ return false;
+ }
}
}
@@ -3035,12 +2966,6 @@ is_escape_site (tree stmt)
pointer escapes since we can't track the integer. */
if (POINTER_TYPE_P (from) && !POINTER_TYPE_P (to))
return ESCAPE_BAD_CAST;
-
- /* Same if the RHS is a conversion between a regular pointer and a
- ref-all pointer since we can't track the SMT of the former. */
- if (POINTER_TYPE_P (from) && !TYPE_REF_CAN_ALIAS_ALL (from)
- && POINTER_TYPE_P (to) && TYPE_REF_CAN_ALIAS_ALL (to))
- return ESCAPE_BAD_CAST;
}
/* If the LHS is an SSA name, it can't possibly represent a non-local
@@ -3146,14 +3071,6 @@ get_smt_for (tree ptr, struct alias_info *ai)
tree tag_type = TREE_TYPE (TREE_TYPE (ptr));
alias_set_type tag_set = get_alias_set (tag_type);
- /* We use a unique memory tag for all the ref-all pointers. */
- if (PTR_IS_REF_ALL (ptr))
- {
- if (!ai->ref_all_symbol_mem_tag)
- ai->ref_all_symbol_mem_tag = create_memory_tag (void_type_node, true);
- return ai->ref_all_symbol_mem_tag;
- }
-
/* To avoid creating unnecessary memory tags, only create one memory tag
per alias set class. Note that it may be tempting to group
memory tags based on conflicting alias sets instead of
diff --git a/gcc/tree-ssa-ccp.c b/gcc/tree-ssa-ccp.c
index 9bba5053e60..c6c7a8885f5 100644
--- a/gcc/tree-ssa-ccp.c
+++ b/gcc/tree-ssa-ccp.c
@@ -975,6 +975,38 @@ ccp_fold (tree stmt)
else if (kind == tcc_reference)
return fold_const_aggregate_ref (rhs);
+ /* Handle propagating invariant addresses into address operations.
+ The folding we do here matches that in tree-ssa-forwprop.c. */
+ else if (code == ADDR_EXPR)
+ {
+ tree *base;
+ base = &TREE_OPERAND (rhs, 0);
+ while (handled_component_p (*base))
+ base = &TREE_OPERAND (*base, 0);
+ if (TREE_CODE (*base) == INDIRECT_REF
+ && TREE_CODE (TREE_OPERAND (*base, 0)) == SSA_NAME)
+ {
+ prop_value_t *val = get_value (TREE_OPERAND (*base, 0));
+ if (val->lattice_val == CONSTANT
+ && TREE_CODE (val->value) == ADDR_EXPR
+ && useless_type_conversion_p (TREE_TYPE (TREE_OPERAND (*base, 0)),
+ TREE_TYPE (val->value))
+ && useless_type_conversion_p (TREE_TYPE (*base),
+ TREE_TYPE (TREE_OPERAND (val->value, 0))))
+ {
+ /* We need to return a new tree, not modify the IL or share
+ parts of it. So play some tricks to avoid manually
+ building it. */
+ tree ret, save = *base;
+ *base = TREE_OPERAND (val->value, 0);
+ ret = unshare_expr (rhs);
+ recompute_tree_invariant_for_addr_expr (ret);
+ *base = save;
+ return ret;
+ }
+ }
+ }
+
/* We may be able to fold away calls to builtin functions if their
arguments are constants. */
else if (code == CALL_EXPR
@@ -1210,6 +1242,25 @@ evaluate_stmt (tree stmt)
fold_undefer_overflow_warnings (is_constant, stmt, 0);
+ if (dump_file && (dump_flags & TDF_DETAILS))
+ {
+ fprintf (dump_file, "which is likely ");
+ switch (likelyvalue)
+ {
+ case CONSTANT:
+ fprintf (dump_file, "CONSTANT");
+ break;
+ case UNDEFINED:
+ fprintf (dump_file, "UNDEFINED");
+ break;
+ case VARYING:
+ fprintf (dump_file, "VARYING");
+ break;
+ default:;
+ }
+ fprintf (dump_file, "\n");
+ }
+
if (is_constant)
{
/* The statement produced a constant value. */
@@ -1378,7 +1429,6 @@ ccp_visit_stmt (tree stmt, edge *taken_edge_p, tree *output_p)
{
fprintf (dump_file, "\nVisiting statement:\n");
print_generic_stmt (dump_file, stmt, dump_flags);
- fprintf (dump_file, "\n");
}
if (TREE_CODE (stmt) == GIMPLE_MODIFY_STMT)
@@ -2097,8 +2147,8 @@ fold_stmt_r (tree *expr_p, int *walk_subtrees, void *data)
return t;
*walk_subtrees = 0;
- /* Set TREE_INVARIANT properly so that the value is properly
- considered constant, and so gets propagated as expected. */
+ /* Make sure the value is properly considered constant, and so gets
+ propagated as expected. */
if (*changed_p)
recompute_tree_invariant_for_addr_expr (expr);
return NULL_TREE;
diff --git a/gcc/tree-ssa-forwprop.c b/gcc/tree-ssa-forwprop.c
index e6402adce55..31322b65791 100644
--- a/gcc/tree-ssa-forwprop.c
+++ b/gcc/tree-ssa-forwprop.c
@@ -124,6 +124,14 @@ along with GCC; see the file COPYING3. If not see
res = x->y->z;
Or
+ ptr = (type1*)&type2var;
+ res = *ptr
+
+ Will get turned into (if type1 and type2 are the same size
+ and neither have volatile on them):
+ res = VIEW_CONVERT_EXPR<type1>(type2var)
+
+ Or
ptr = &x[0];
ptr2 = ptr + <constant>;
@@ -642,6 +650,40 @@ forward_propagate_addr_expr_1 (tree name, tree def_rhs, tree use_stmt,
return true;
}
+ /* Now see if the RHS node is an INDIRECT_REF using NAME. If so,
+ propagate the ADDR_EXPR into the use of NAME and try to
+ create a VCE and fold the result. */
+ if (TREE_CODE (rhs) == INDIRECT_REF
+ && TREE_OPERAND (rhs, 0) == name
+ && TYPE_SIZE (TREE_TYPE (rhs))
+ && TYPE_SIZE (TREE_TYPE (TREE_OPERAND (def_rhs, 0)))
+ /* Function decls should not be used for VCE either as it could be
+ a function descriptor that we want and not the actual function code. */
+ && TREE_CODE (TREE_OPERAND (def_rhs, 0)) != FUNCTION_DECL
+ /* We should not convert volatile loads to non volatile loads. */
+ && !TYPE_VOLATILE (TREE_TYPE (rhs))
+ && !TYPE_VOLATILE (TREE_TYPE (TREE_OPERAND (def_rhs, 0)))
+ && operand_equal_p (TYPE_SIZE (TREE_TYPE (rhs)),
+ TYPE_SIZE (TREE_TYPE (TREE_OPERAND (def_rhs, 0))), 0))
+ {
+ bool res = true;
+ tree new_rhs = unshare_expr (TREE_OPERAND (def_rhs, 0));
+ new_rhs = fold_build1 (VIEW_CONVERT_EXPR, TREE_TYPE (rhs), new_rhs);
+ /* If we have folded the VCE, then we have to create a new statement. */
+ if (TREE_CODE (new_rhs) != VIEW_CONVERT_EXPR)
+ {
+ block_stmt_iterator bsi = bsi_for_stmt (use_stmt);
+ new_rhs = force_gimple_operand_bsi (&bsi, new_rhs, true, NULL, true, BSI_SAME_STMT);
+ /* As we change the deference to a SSA_NAME, we need to return false to make sure that
+ the statement does not get removed. */
+ res = false;
+ }
+ *rhsp = new_rhs;
+ fold_stmt_inplace (use_stmt);
+ tidy_after_forward_propagate_addr (use_stmt);
+ return res;
+ }
+
/* If the use of the ADDR_EXPR is not a POINTER_PLUS_EXPR, there
is nothing to do. */
if (TREE_CODE (rhs) != POINTER_PLUS_EXPR
diff --git a/gcc/tree-ssa-ifcombine.c b/gcc/tree-ssa-ifcombine.c
index cec5868c636..3a28fadd792 100644
--- a/gcc/tree-ssa-ifcombine.c
+++ b/gcc/tree-ssa-ifcombine.c
@@ -135,6 +135,32 @@ same_phi_args_p (basic_block bb1, basic_block bb2, basic_block dest)
return true;
}
+/* Return the best representative SSA name for CANDIDATE which is used
+ in a bit test. */
+
+static tree
+get_name_for_bit_test (tree candidate)
+{
+ /* Skip single-use names in favor of using the name from a
+ non-widening conversion definition. */
+ if (TREE_CODE (candidate) == SSA_NAME
+ && has_single_use (candidate))
+ {
+ tree def_stmt = SSA_NAME_DEF_STMT (candidate);
+ if (TREE_CODE (def_stmt) == GIMPLE_MODIFY_STMT
+ && (TREE_CODE (GIMPLE_STMT_OPERAND (def_stmt, 1)) == NOP_EXPR
+ || TREE_CODE (GIMPLE_STMT_OPERAND (def_stmt, 1)) == CONVERT_EXPR))
+ {
+ tree rhs = GIMPLE_STMT_OPERAND (def_stmt, 1);
+ if (TYPE_PRECISION (TREE_TYPE (rhs))
+ <= TYPE_PRECISION (TREE_TYPE (TREE_OPERAND (rhs, 0))))
+ return TREE_OPERAND (rhs, 0);
+ }
+ }
+
+ return candidate;
+}
+
/* Recognize a single bit test pattern in COND_EXPR and its defining
statements. Store the name being tested in *NAME and the bit
in *BIT. The COND_EXPR computes *NAME & (1 << *BIT).
@@ -192,7 +218,7 @@ recognize_single_bit_test (tree cond_expr, tree *name, tree *bit)
{
/* t & 1 */
*bit = integer_zero_node;
- *name = orig_name;
+ *name = get_name_for_bit_test (orig_name);
}
return true;
@@ -272,7 +298,7 @@ recognize_bits_test (tree cond_expr, tree *name, tree *bits)
if (TREE_CODE (t) != BIT_AND_EXPR)
return false;
- *name = TREE_OPERAND (t, 0);
+ *name = get_name_for_bit_test (TREE_OPERAND (t, 0));
*bits = TREE_OPERAND (t, 1);
return true;
diff --git a/gcc/tree-ssa-loop-im.c b/gcc/tree-ssa-loop-im.c
index 6402a8e6244..c896abb8ba7 100644
--- a/gcc/tree-ssa-loop-im.c
+++ b/gcc/tree-ssa-loop-im.c
@@ -1640,6 +1640,8 @@ mem_refs_may_alias_p (tree mem1, tree mem2, struct pointer_map_t **ttae_cache)
&& SSA_VAR_P (mem1)
&& !AGGREGATE_TYPE_P (TREE_TYPE (mem1)))
return false;
+ if (!alias_sets_conflict_p (get_alias_set (mem1), get_alias_set (mem2)))
+ return false;
}
/* The expansion of addresses may be a bit expensive, thus we only do
diff --git a/gcc/tree-ssa-loop-ivcanon.c b/gcc/tree-ssa-loop-ivcanon.c
index 5e9e2482765..67af0b374d6 100644
--- a/gcc/tree-ssa-loop-ivcanon.c
+++ b/gcc/tree-ssa-loop-ivcanon.c
@@ -187,23 +187,20 @@ try_unroll_loop_completely (struct loop *loop,
> (unsigned) PARAM_VALUE (PARAM_MAX_COMPLETELY_PEELED_INSNS))
return false;
- if (ul == UL_NO_GROWTH)
+ unr_insns = estimated_unrolled_size (ninsns, n_unroll);
+ if (dump_file && (dump_flags & TDF_DETAILS))
+ {
+ fprintf (dump_file, " Loop size: %d\n", (int) ninsns);
+ fprintf (dump_file, " Estimated size after unrolling: %d\n",
+ (int) unr_insns);
+ }
+
+ if (ul == UL_NO_GROWTH
+ && unr_insns > ninsns)
{
- unr_insns = estimated_unrolled_size (ninsns, n_unroll);
-
if (dump_file && (dump_flags & TDF_DETAILS))
- {
- fprintf (dump_file, " Loop size: %d\n", (int) ninsns);
- fprintf (dump_file, " Estimated size after unrolling: %d\n",
- (int) unr_insns);
- }
-
- if (unr_insns > ninsns)
- {
- if (dump_file && (dump_flags & TDF_DETAILS))
- fprintf (dump_file, "Not unrolling loop %d:\n", loop->num);
- return false;
- }
+ fprintf (dump_file, "Not unrolling loop %d.\n", loop->num);
+ return false;
}
}
@@ -339,30 +336,46 @@ canonicalize_induction_variables (void)
size of the code does not increase. */
unsigned int
-tree_unroll_loops_completely (bool may_increase_size)
+tree_unroll_loops_completely (bool may_increase_size, bool unroll_outer)
{
loop_iterator li;
struct loop *loop;
- bool changed = false;
+ bool changed;
enum unroll_level ul;
- FOR_EACH_LOOP (li, loop, 0)
+ do
{
- if (may_increase_size && maybe_hot_bb_p (loop->header))
- ul = UL_ALL;
- else
- ul = UL_NO_GROWTH;
- changed |= canonicalize_loop_induction_variables (loop,
- false, ul,
- !flag_tree_loop_ivcanon);
- }
+ changed = false;
- /* Clean up the information about numbers of iterations, since complete
- unrolling might have invalidated it. */
- scev_reset ();
+ FOR_EACH_LOOP (li, loop, LI_ONLY_INNERMOST)
+ {
+ if (may_increase_size && maybe_hot_bb_p (loop->header)
+ /* Unroll outermost loops only if asked to do so or they do
+ not cause code growth. */
+ && (unroll_outer
+ || loop_outer (loop_outer (loop))))
+ ul = UL_ALL;
+ else
+ ul = UL_NO_GROWTH;
+ changed |= canonicalize_loop_induction_variables
+ (loop, false, ul, !flag_tree_loop_ivcanon);
+ }
+
+ if (changed)
+ {
+ /* This will take care of removing completely unrolled loops
+ from the loop structures so we can continue unrolling now
+ innermost loops. */
+ if (cleanup_tree_cfg ())
+ update_ssa (TODO_update_ssa_only_virtuals);
+
+ /* Clean up the information about numbers of iterations, since
+ complete unrolling might have invalidated it. */
+ scev_reset ();
+ }
+ }
+ while (changed);
- if (changed)
- return TODO_cleanup_cfg;
return 0;
}
diff --git a/gcc/tree-ssa-loop-ivopts.c b/gcc/tree-ssa-loop-ivopts.c
index 93f3be6b502..0687e891686 100644
--- a/gcc/tree-ssa-loop-ivopts.c
+++ b/gcc/tree-ssa-loop-ivopts.c
@@ -1541,7 +1541,6 @@ may_be_nonaddressable_p (tree expr)
return may_be_nonaddressable_p (TREE_OPERAND (expr, 0));
case CONVERT_EXPR:
- case NON_LVALUE_EXPR:
case NOP_EXPR:
return true;
diff --git a/gcc/tree-ssa-loop-manip.c b/gcc/tree-ssa-loop-manip.c
index 835b0062d8a..1ff6254c0b1 100644
--- a/gcc/tree-ssa-loop-manip.c
+++ b/gcc/tree-ssa-loop-manip.c
@@ -248,10 +248,15 @@ find_uses_to_rename_use (basic_block bb, tree use, bitmap *use_blocks,
return;
def_loop = def_bb->loop_father;
- /* If the definition is not inside loop, it is not interesting. */
+ /* If the definition is not inside a loop, it is not interesting. */
if (!loop_outer (def_loop))
return;
+ /* If the use is not outside of the loop it is defined in, it is not
+ interesting. */
+ if (flow_bb_inside_loop_p (def_loop, bb))
+ return;
+
if (!use_blocks[ver])
use_blocks[ver] = BITMAP_ALLOC (NULL);
bitmap_set_bit (use_blocks[ver], bb->index);
@@ -592,7 +597,8 @@ tree_duplicate_loop_to_header_edge (struct loop *loop, edge e,
return false;
#ifdef ENABLE_CHECKING
- verify_loop_closed_ssa ();
+ if (loops_state_satisfies_p (LOOP_CLOSED_SSA))
+ verify_loop_closed_ssa ();
#endif
first_new_block = last_basic_block;
diff --git a/gcc/tree-ssa-loop.c b/gcc/tree-ssa-loop.c
index 639fb10a393..52f5a7f58f8 100644
--- a/gcc/tree-ssa-loop.c
+++ b/gcc/tree-ssa-loop.c
@@ -223,13 +223,16 @@ struct gimple_opt_pass pass_predcom =
static unsigned int
tree_vectorize (void)
{
+ if (number_of_loops () <= 1)
+ return 0;
+
return vectorize_loops ();
}
static bool
gate_tree_vectorize (void)
{
- return flag_tree_vectorize && number_of_loops () > 1;
+ return flag_tree_vectorize;
}
struct gimple_opt_pass pass_vectorize =
@@ -466,7 +469,7 @@ tree_complete_unroll (void)
return tree_unroll_loops_completely (flag_unroll_loops
|| flag_peel_loops
- || optimize >= 3);
+ || optimize >= 3, true);
}
static bool
@@ -495,6 +498,53 @@ struct gimple_opt_pass pass_complete_unroll =
}
};
+/* Complete unrolling of inner loops. */
+
+static unsigned int
+tree_complete_unroll_inner (void)
+{
+ unsigned ret = 0;
+
+ loop_optimizer_init (LOOPS_NORMAL
+ | LOOPS_HAVE_RECORDED_EXITS);
+ if (number_of_loops () > 1)
+ {
+ scev_initialize ();
+ ret = tree_unroll_loops_completely (optimize >= 3, false);
+ free_numbers_of_iterations_estimates ();
+ scev_finalize ();
+ }
+ loop_optimizer_finalize ();
+
+ return ret;
+}
+
+static bool
+gate_tree_complete_unroll_inner (void)
+{
+ return optimize >= 2;
+}
+
+struct gimple_opt_pass pass_complete_unrolli =
+{
+ {
+ GIMPLE_PASS,
+ "cunrolli", /* name */
+ gate_tree_complete_unroll_inner, /* gate */
+ tree_complete_unroll_inner, /* execute */
+ NULL, /* sub */
+ NULL, /* next */
+ 0, /* static_pass_number */
+ TV_COMPLETE_UNROLL, /* tv_id */
+ PROP_cfg | PROP_ssa, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ TODO_dump_func | TODO_verify_loops
+ | TODO_ggc_collect /* todo_flags_finish */
+ }
+};
+
/* Parallelization. */
static bool
diff --git a/gcc/tree-ssa-propagate.c b/gcc/tree-ssa-propagate.c
index c37cfa53545..6423ec6ba52 100644
--- a/gcc/tree-ssa-propagate.c
+++ b/gcc/tree-ssa-propagate.c
@@ -1148,7 +1148,17 @@ fold_predicate_in (tree stmt)
else
return false;
- val = vrp_evaluate_conditional (*pred_p, stmt);
+ if (TREE_CODE (*pred_p) == SSA_NAME)
+ val = vrp_evaluate_conditional (EQ_EXPR,
+ *pred_p,
+ boolean_true_node,
+ stmt);
+ else
+ val = vrp_evaluate_conditional (TREE_CODE (*pred_p),
+ TREE_OPERAND (*pred_p, 0),
+ TREE_OPERAND (*pred_p, 1),
+ stmt);
+
if (val)
{
if (modify_stmt_p)
diff --git a/gcc/tree-ssa-structalias.c b/gcc/tree-ssa-structalias.c
index 6f6eff422da..ddcf4982690 100644
--- a/gcc/tree-ssa-structalias.c
+++ b/gcc/tree-ssa-structalias.c
@@ -2913,7 +2913,6 @@ get_constraint_for (tree t, VEC (ce_s, heap) **results)
{
case NOP_EXPR:
case CONVERT_EXPR:
- case NON_LVALUE_EXPR:
{
tree op = TREE_OPERAND (t, 0);
@@ -4862,8 +4861,6 @@ set_used_smts (void)
static void
merge_smts_into (tree p, bitmap solution)
{
- unsigned int i;
- bitmap_iterator bi;
tree smt;
bitmap aliases;
tree var = p;
@@ -4874,20 +4871,8 @@ merge_smts_into (tree p, bitmap solution)
smt = var_ann (var)->symbol_mem_tag;
if (smt)
{
- alias_set_type smtset = get_alias_set (TREE_TYPE (smt));
-
- /* Need to set the SMT subsets first before this
- will work properly. */
+ /* The smt itself isn't included in its aliases. */
bitmap_set_bit (solution, DECL_UID (smt));
- EXECUTE_IF_SET_IN_BITMAP (used_smts, 0, i, bi)
- {
- tree newsmt = referenced_var (i);
- tree newsmttype = TREE_TYPE (newsmt);
-
- if (alias_set_subset_of (get_alias_set (newsmttype),
- smtset))
- bitmap_set_bit (solution, i);
- }
aliases = MTAG_ALIASES (smt);
if (aliases)
@@ -4984,17 +4969,9 @@ find_what_p_points_to (tree p)
/* Instead of using pt_anything, we merge in the SMT aliases
for the underlying SMT. In addition, if they could have
- pointed to anything, they could point to global memory.
- But we cannot do that for ref-all pointers because these
- aliases have not been computed yet. */
+ pointed to anything, they could point to global memory. */
if (was_pt_anything)
{
- if (PTR_IS_REF_ALL (p))
- {
- pi->pt_anything = 1;
- return false;
- }
-
merge_smts_into (p, finished_solution);
pi->pt_global_mem = 1;
}
diff --git a/gcc/tree-ssa-structalias.h b/gcc/tree-ssa-structalias.h
index 8e4c57b28df..737135bdc87 100644
--- a/gcc/tree-ssa-structalias.h
+++ b/gcc/tree-ssa-structalias.h
@@ -21,9 +21,6 @@
#ifndef TREE_SSA_STRUCTALIAS_H
#define TREE_SSA_STRUCTALIAS_H
-/* True if the data pointed to by PTR can alias anything. */
-#define PTR_IS_REF_ALL(PTR) TYPE_REF_CAN_ALIAS_ALL (TREE_TYPE (PTR))
-
struct constraint;
typedef struct constraint *constraint_t;
@@ -57,9 +54,6 @@ struct alias_info
/* Pointers that have been used in an indirect load operation. */
struct pointer_set_t *dereferenced_ptrs_load;
-
- /* Memory tag for all the PTR_IS_REF_ALL pointers. */
- tree ref_all_symbol_mem_tag;
};
/* In tree-ssa-alias.c. */
diff --git a/gcc/tree-ssa-threadedge.c b/gcc/tree-ssa-threadedge.c
index 9e7dd6eed56..b15de2752eb 100644
--- a/gcc/tree-ssa-threadedge.c
+++ b/gcc/tree-ssa-threadedge.c
@@ -226,6 +226,7 @@ record_temporary_equivalences_from_stmts_at_dest (edge e,
for (bsi = bsi_start (e->dest); ! bsi_end_p (bsi); bsi_next (&bsi))
{
tree cached_lhs = NULL;
+ tree rhs;
stmt = bsi_stmt (bsi);
@@ -252,6 +253,32 @@ record_temporary_equivalences_from_stmts_at_dest (edge e,
|| TREE_CODE (GIMPLE_STMT_OPERAND (stmt, 0)) != SSA_NAME)
continue;
+ rhs = GIMPLE_STMT_OPERAND (stmt, 1);
+
+ /* The result of __builtin_object_size depends on all the arguments
+ of a phi node. Temporarily using only one edge produces invalid
+ results. For example
+
+ if (x < 6)
+ goto l;
+ else
+ goto l;
+
+ l:
+ r = PHI <&w[2].a[1](2), &a.a[6](3)>
+ __builtin_object_size (r, 0)
+
+ The result of __builtin_object_size is defined to be the maximum of
+ remaining bytes. If we use only one edge on the phi, the result will
+ change to be the remaining bytes for the corresponding phi argument. */
+
+ if (TREE_CODE (rhs) == CALL_EXPR)
+ {
+ tree fndecl = get_callee_fndecl (rhs);
+ if (fndecl && DECL_FUNCTION_CODE (fndecl) == BUILT_IN_OBJECT_SIZE)
+ continue;
+ }
+
/* At this point we have a statement which assigns an RHS to an
SSA_VAR on the LHS. We want to try and simplify this statement
to expose more context sensitive equivalences which in turn may
@@ -259,10 +286,10 @@ record_temporary_equivalences_from_stmts_at_dest (edge e,
Handle simple copy operations as well as implied copies from
ASSERT_EXPRs. */
- if (TREE_CODE (GIMPLE_STMT_OPERAND (stmt, 1)) == SSA_NAME)
- cached_lhs = GIMPLE_STMT_OPERAND (stmt, 1);
- else if (TREE_CODE (GIMPLE_STMT_OPERAND (stmt, 1)) == ASSERT_EXPR)
- cached_lhs = TREE_OPERAND (GIMPLE_STMT_OPERAND (stmt, 1), 0);
+ if (TREE_CODE (rhs) == SSA_NAME)
+ cached_lhs = rhs;
+ else if (TREE_CODE (rhs) == ASSERT_EXPR)
+ cached_lhs = TREE_OPERAND (rhs, 0);
else
{
/* A statement that is not a trivial copy or ASSERT_EXPR.
@@ -429,8 +456,7 @@ simplify_control_stmt_condition (edge e,
cached_lhs = fold (COND_EXPR_COND (dummy_cond));
while (TREE_CODE (cached_lhs) == NOP_EXPR
- || TREE_CODE (cached_lhs) == CONVERT_EXPR
- || TREE_CODE (cached_lhs) == NON_LVALUE_EXPR)
+ || TREE_CODE (cached_lhs) == CONVERT_EXPR)
cached_lhs = TREE_OPERAND (cached_lhs, 0);
fold_undefer_overflow_warnings (is_gimple_min_invariant (cached_lhs),
diff --git a/gcc/tree-stdarg.c b/gcc/tree-stdarg.c
index 54693d11bec..f1595fe99bc 100644
--- a/gcc/tree-stdarg.c
+++ b/gcc/tree-stdarg.c
@@ -595,7 +595,7 @@ static bool
gate_optimize_stdarg (void)
{
/* This optimization is only for stdarg functions. */
- return current_function_stdarg != 0;
+ return cfun->stdarg != 0;
}
diff --git a/gcc/tree-tailcall.c b/gcc/tree-tailcall.c
index a4430ec34e2..0458c8aec60 100644
--- a/gcc/tree-tailcall.c
+++ b/gcc/tree-tailcall.c
@@ -135,7 +135,7 @@ suitable_for_tail_opt_p (void)
referenced_var_iterator rvi;
tree var;
- if (current_function_stdarg)
+ if (cfun->stdarg)
return false;
/* No local variable nor structure field should be call-clobbered. We
@@ -164,7 +164,7 @@ suitable_for_tail_call_opt_p (void)
/* alloca (until we have stack slot life analysis) inhibits
sibling call optimizations, but not tail recursion. */
- if (current_function_calls_alloca)
+ if (cfun->calls_alloca)
return false;
/* If we are using sjlj exceptions, we may need to add a call to
@@ -176,7 +176,7 @@ suitable_for_tail_call_opt_p (void)
/* Any function that calls setjmp might have longjmp called from
any called function. ??? We really should represent this
properly in the CFG so that this needn't be special cased. */
- if (current_function_calls_setjmp)
+ if (cfun->calls_setjmp)
return false;
/* ??? It is OK if the argument of a function is taken in some cases,
diff --git a/gcc/tree-vect-analyze.c b/gcc/tree-vect-analyze.c
index 9f9ea823f20..729ad799822 100644
--- a/gcc/tree-vect-analyze.c
+++ b/gcc/tree-vect-analyze.c
@@ -1060,7 +1060,9 @@ vect_check_interleaving (struct data_reference *dra,
type_size_b = TREE_INT_CST_LOW (TYPE_SIZE_UNIT (TREE_TYPE (DR_REF (drb))));
if (type_size_a != type_size_b
- || tree_int_cst_compare (DR_STEP (dra), DR_STEP (drb)))
+ || tree_int_cst_compare (DR_STEP (dra), DR_STEP (drb))
+ || !types_compatible_p (TREE_TYPE (DR_REF (dra)),
+ TREE_TYPE (DR_REF (drb))))
return;
init_a = TREE_INT_CST_LOW (DR_INIT (dra));
@@ -2226,11 +2228,16 @@ vect_analyze_group_access (struct data_reference *dr)
/* Check that the size of the interleaving is equal to STEP for stores,
i.e., that there are no gaps. */
- if (!DR_IS_READ (dr) && dr_step != count_in_bytes)
+ if (dr_step != count_in_bytes)
{
- if (vect_print_dump_info (REPORT_DETAILS))
- fprintf (vect_dump, "interleaved store with gaps");
- return false;
+ if (DR_IS_READ (dr))
+ slp_impossible = true;
+ else
+ {
+ if (vect_print_dump_info (REPORT_DETAILS))
+ fprintf (vect_dump, "interleaved store with gaps");
+ return false;
+ }
}
/* Check that STEP is a multiple of type size. */
diff --git a/gcc/tree-vect-transform.c b/gcc/tree-vect-transform.c
index 6168fdab74d..7c5b68e0fdf 100644
--- a/gcc/tree-vect-transform.c
+++ b/gcc/tree-vect-transform.c
@@ -3668,6 +3668,11 @@ vectorizable_assignment (tree stmt, block_stmt_iterator *bsi, tree *vec_stmt,
VEC(tree,heap) *vec_oprnds = NULL;
tree vop;
+ /* FORNOW: SLP with multiple types is not supported. The SLP analysis
+ verifies this, so we can safely override NCOPIES with 1 here. */
+ if (slp_node)
+ ncopies = 1;
+
gcc_assert (ncopies >= 1);
if (ncopies > 1)
return false; /* FORNOW */
diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c
index e9106c47f19..4b409e46aaf 100644
--- a/gcc/tree-vrp.c
+++ b/gcc/tree-vrp.c
@@ -46,7 +46,6 @@ static sbitmap found_in_subgraph;
static int compare_values (tree val1, tree val2);
static int compare_values_warnv (tree val1, tree val2, bool *);
static void vrp_meet (value_range_t *, value_range_t *);
-static tree vrp_evaluate_conditional_warnv (tree, bool, bool *);
static tree vrp_evaluate_conditional_warnv_with_ops (enum tree_code,
tree, tree, bool, bool *);
@@ -2292,7 +2291,6 @@ extract_range_from_unary_expr (value_range_t *vr, enum tree_code code,
if (code == FIX_TRUNC_EXPR
|| code == FLOAT_EXPR
|| code == BIT_NOT_EXPR
- || code == NON_LVALUE_EXPR
|| code == CONJ_EXPR)
{
set_value_range_to_varying (vr);
@@ -3957,8 +3955,7 @@ register_edge_assert_for_1 (tree op, enum tree_code code,
retval |= register_edge_assert_for_1 (rhs, code, e, bsi);
}
else if (TREE_CODE (rhs) == NOP_EXPR
- || TREE_CODE (rhs) == CONVERT_EXPR
- || TREE_CODE (rhs) == NON_LVALUE_EXPR)
+ || TREE_CODE (rhs) == CONVERT_EXPR)
{
/* Recurse through the type conversion. */
retval |= register_edge_assert_for_1 (TREE_OPERAND (rhs, 0),
@@ -5274,64 +5271,7 @@ vrp_evaluate_conditional_warnv_with_ops (enum tree_code code, tree op0,
return NULL_TREE;
}
-/* Given a conditional predicate COND, try to determine if COND yields
- true or false based on the value ranges of its operands. Return
- BOOLEAN_TRUE_NODE if the conditional always evaluates to true,
- BOOLEAN_FALSE_NODE if the conditional always evaluates to false, and,
- NULL if the conditional cannot be evaluated at compile time.
-
- If USE_EQUIV_P is true, the ranges of all the names equivalent with
- the operands in COND are used when trying to compute its value.
- This is only used during final substitution. During propagation,
- we only check the range of each variable and not its equivalents.
-
- Set *STRICT_OVERFLOW_P to indicate whether we relied on an overflow
- infinity to produce the result. */
-
-static tree
-vrp_evaluate_conditional_warnv (tree cond, bool use_equiv_p,
- bool *strict_overflow_p)
-{
- gcc_assert (TREE_CODE (cond) == SSA_NAME
- || TREE_CODE_CLASS (TREE_CODE (cond)) == tcc_comparison);
-
- if (TREE_CODE (cond) == SSA_NAME)
- {
- value_range_t *vr;
- tree retval;
-
- if (use_equiv_p)
- retval = compare_name_with_value (NE_EXPR, cond, boolean_false_node,
- strict_overflow_p);
- else
- {
- value_range_t *vr = get_value_range (cond);
- retval = compare_range_with_value (NE_EXPR, vr, boolean_false_node,
- strict_overflow_p);
- }
-
- /* If COND has a known boolean range, return it. */
- if (retval)
- return retval;
-
- /* Otherwise, if COND has a symbolic range of exactly one value,
- return it. */
- vr = get_value_range (cond);
- if (vr->type == VR_RANGE && vr->min == vr->max)
- return vr->min;
- }
- else
- return vrp_evaluate_conditional_warnv_with_ops (TREE_CODE (cond),
- TREE_OPERAND (cond, 0),
- TREE_OPERAND (cond, 1),
- use_equiv_p,
- strict_overflow_p);
-
- /* Anything else cannot be computed statically. */
- return NULL_TREE;
-}
-
-/* Given COND within STMT, try to simplify it based on value range
+/* Given (CODE OP0 OP1) within STMT, try to simplify it based on value range
information. Return NULL if the conditional can not be evaluated.
The ranges of all the names equivalent with the operands in COND
will be used when trying to compute the value. If the result is
@@ -5339,13 +5279,17 @@ vrp_evaluate_conditional_warnv (tree cond, bool use_equiv_p,
appropriate. */
tree
-vrp_evaluate_conditional (tree cond, tree stmt)
+vrp_evaluate_conditional (enum tree_code code, tree op0, tree op1, tree stmt)
{
bool sop;
tree ret;
sop = false;
- ret = vrp_evaluate_conditional_warnv (cond, true, &sop);
+ ret = vrp_evaluate_conditional_warnv_with_ops (code,
+ op0,
+ op1,
+ true,
+ &sop);
if (ret && sop)
{
@@ -5379,8 +5323,8 @@ vrp_evaluate_conditional (tree cond, tree stmt)
if (warn_type_limits
&& ret
- && TREE_CODE_CLASS (TREE_CODE (cond)) == tcc_comparison
- && TREE_CODE (TREE_OPERAND (cond, 0)) == SSA_NAME)
+ && TREE_CODE_CLASS (code) == tcc_comparison
+ && TREE_CODE (op0) == SSA_NAME)
{
/* If the comparison is being folded and the operand on the LHS
is being compared against a constant value that is outside of
@@ -5388,8 +5332,6 @@ vrp_evaluate_conditional (tree cond, tree stmt)
always fold regardless of the value of OP0. If -Wtype-limits
was specified, emit a warning. */
const char *warnmsg = NULL;
- tree op0 = TREE_OPERAND (cond, 0);
- tree op1 = TREE_OPERAND (cond, 1);
tree type = TREE_TYPE (op0);
value_range_t *vr0 = get_value_range (op0);
@@ -5501,7 +5443,19 @@ vrp_visit_cond_stmt (tree stmt, edge *taken_edge_p)
MICO, TRAMP3D and SPEC2000) showed that doing this results in
4 more predicates folded in SPEC. */
sop = false;
- val = vrp_evaluate_conditional_warnv (cond, false, &sop);
+
+ if (TREE_CODE (cond) == SSA_NAME)
+ val = vrp_evaluate_conditional_warnv_with_ops (EQ_EXPR,
+ cond,
+ boolean_true_node,
+ false,
+ &sop);
+ else
+ val = vrp_evaluate_conditional_warnv_with_ops (TREE_CODE (cond),
+ TREE_OPERAND (cond, 0),
+ TREE_OPERAND (cond, 1),
+ false,
+ &sop);
if (val)
{
if (!sop)
@@ -6472,13 +6426,24 @@ static VEC(tree,heap) *stack;
static tree
simplify_stmt_for_jump_threading (tree stmt, tree within_stmt)
{
+ tree conditional;
/* We only use VRP information to simplify conditionals. This is
overly conservative, but it's unclear if doing more would be
worth the compile time cost. */
if (TREE_CODE (stmt) != COND_EXPR)
return NULL;
- return vrp_evaluate_conditional (COND_EXPR_COND (stmt), within_stmt);
+ conditional = COND_EXPR_COND (stmt);
+ if (TREE_CODE (conditional) == SSA_NAME)
+ return vrp_evaluate_conditional (EQ_EXPR,
+ conditional,
+ boolean_true_node,
+ within_stmt);
+ else
+ return vrp_evaluate_conditional (TREE_CODE (conditional),
+ TREE_OPERAND (conditional, 0),
+ TREE_OPERAND (conditional, 1),
+ within_stmt);
}
/* Blocks which have more than one predecessor and more than
@@ -6788,10 +6753,7 @@ execute_vrp (void)
SWITCH_LABELS (su->stmt) = su->vec;
if (VEC_length (edge, to_remove_edges) > 0)
- {
- free_dominance_info (CDI_DOMINATORS);
- cleanup_tree_cfg ();
- }
+ free_dominance_info (CDI_DOMINATORS);
VEC_free (edge, heap, to_remove_edges);
VEC_free (switch_update, heap, to_update_switch_stmts);
diff --git a/gcc/tree.c b/gcc/tree.c
index 2a6ebb0069b..73adaa10b03 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -621,7 +621,6 @@ make_node_stat (enum tree_code code MEM_STAT_DECL)
case tcc_constant:
TREE_CONSTANT (t) = 1;
- TREE_INVARIANT (t) = 1;
break;
case tcc_expression:
@@ -1192,7 +1191,6 @@ build_string (int len, const char *str)
memset (s, 0, sizeof (struct tree_common));
TREE_SET_CODE (s, STRING_CST);
TREE_CONSTANT (s) = 1;
- TREE_INVARIANT (s) = 1;
TREE_STRING_LENGTH (s) = len;
memcpy (s->string.str, str, len);
s->string.str[len] = '\0';
@@ -2056,7 +2054,111 @@ staticp (tree arg)
return NULL;
}
}
+
+
+
+/* Return whether OP is a DECL whose address is function-invariant. */
+
+bool
+decl_address_invariant_p (const_tree op)
+{
+ /* The conditions below are slightly less strict than the one in
+ staticp. */
+
+ switch (TREE_CODE (op))
+ {
+ case PARM_DECL:
+ case RESULT_DECL:
+ case LABEL_DECL:
+ case FUNCTION_DECL:
+ return true;
+
+ case VAR_DECL:
+ if (((TREE_STATIC (op) || DECL_EXTERNAL (op))
+ && !DECL_DLLIMPORT_P (op))
+ || DECL_THREAD_LOCAL_P (op)
+ || DECL_CONTEXT (op) == current_function_decl
+ || decl_function_context (op) == current_function_decl)
+ return true;
+ break;
+
+ case CONST_DECL:
+ if ((TREE_STATIC (op) || DECL_EXTERNAL (op))
+ || decl_function_context (op) == current_function_decl)
+ return true;
+ break;
+
+ default:
+ break;
+ }
+
+ return false;
+}
+
+
+/* Return true if T is function-invariant (internal function, does
+ not handle arithmetic; that's handled in skip_simple_arithmetic and
+ tree_invariant_p). */
+
+static bool tree_invariant_p (tree t);
+
+static bool
+tree_invariant_p_1 (tree t)
+{
+ tree op;
+
+ if (TREE_CONSTANT (t)
+ || (TREE_READONLY (t) && !TREE_SIDE_EFFECTS (t)))
+ return true;
+
+ switch (TREE_CODE (t))
+ {
+ case SAVE_EXPR:
+ return true;
+
+ case ADDR_EXPR:
+ op = TREE_OPERAND (t, 0);
+ while (handled_component_p (op))
+ {
+ switch (TREE_CODE (op))
+ {
+ case ARRAY_REF:
+ case ARRAY_RANGE_REF:
+ if (!tree_invariant_p (TREE_OPERAND (op, 1))
+ || TREE_OPERAND (op, 2) != NULL_TREE
+ || TREE_OPERAND (op, 3) != NULL_TREE)
+ return false;
+ break;
+
+ case COMPONENT_REF:
+ if (TREE_OPERAND (op, 2) != NULL_TREE)
+ return false;
+ break;
+
+ default:;
+ }
+ op = TREE_OPERAND (op, 0);
+ }
+
+ return CONSTANT_CLASS_P (op) || decl_address_invariant_p (op);
+
+ default:
+ break;
+ }
+
+ return false;
+}
+
+/* Return true if T is function-invariant. */
+
+static bool
+tree_invariant_p (tree t)
+{
+ tree inner = skip_simple_arithmetic (t);
+ return tree_invariant_p_1 (inner);
+}
+
/* Wrap a SAVE_EXPR around EXPR, if appropriate.
Do this to any expression which may be used in more than one place,
but must be evaluated only once.
@@ -2091,11 +2193,10 @@ save_expr (tree expr)
Since it is no problem to reevaluate literals, we just return the
literal node. */
inner = skip_simple_arithmetic (t);
+ if (TREE_CODE (inner) == ERROR_MARK)
+ return inner;
- if (TREE_INVARIANT (inner)
- || (TREE_READONLY (inner) && ! TREE_SIDE_EFFECTS (inner))
- || TREE_CODE (inner) == SAVE_EXPR
- || TREE_CODE (inner) == ERROR_MARK)
+ if (tree_invariant_p_1 (inner))
return t;
/* If INNER contains a PLACEHOLDER_EXPR, we must evaluate it each time, since
@@ -2116,7 +2217,6 @@ save_expr (tree expr)
value was computed on both sides of the jump. So make sure it isn't
eliminated as dead. */
TREE_SIDE_EFFECTS (t) = 1;
- TREE_INVARIANT (t) = 1;
return t;
}
@@ -2144,9 +2244,9 @@ skip_simple_arithmetic (tree expr)
inner = TREE_OPERAND (inner, 0);
else if (BINARY_CLASS_P (inner))
{
- if (TREE_INVARIANT (TREE_OPERAND (inner, 1)))
+ if (tree_invariant_p (TREE_OPERAND (inner, 1)))
inner = TREE_OPERAND (inner, 0);
- else if (TREE_INVARIANT (TREE_OPERAND (inner, 0)))
+ else if (tree_invariant_p (TREE_OPERAND (inner, 0)))
inner = TREE_OPERAND (inner, 1);
else
break;
@@ -2815,7 +2915,7 @@ stabilize_reference_1 (tree e)
ignore things that are actual constant or that already have been
handled by this function. */
- if (TREE_INVARIANT (e))
+ if (tree_invariant_p (e))
return e;
switch (TREE_CODE_CLASS (code))
@@ -2868,7 +2968,6 @@ stabilize_reference_1 (tree e)
TREE_READONLY (result) = TREE_READONLY (e);
TREE_SIDE_EFFECTS (result) = TREE_SIDE_EFFECTS (e);
TREE_THIS_VOLATILE (result) = TREE_THIS_VOLATILE (e);
- TREE_INVARIANT (result) = 1;
return result;
}
@@ -2876,13 +2975,13 @@ stabilize_reference_1 (tree e)
/* Low-level constructors for expressions. */
/* A helper function for build1 and constant folders. Set TREE_CONSTANT,
- TREE_INVARIANT, and TREE_SIDE_EFFECTS for an ADDR_EXPR. */
+ and TREE_SIDE_EFFECTS for an ADDR_EXPR. */
void
recompute_tree_invariant_for_addr_expr (tree t)
{
tree node;
- bool tc = true, ti = true, se = false;
+ bool tc = true, se = false;
/* We started out assuming this address is both invariant and constant, but
does not have side effects. Now go down any handled components and see if
@@ -2892,9 +2991,8 @@ recompute_tree_invariant_for_addr_expr (tree t)
??? Note that this code makes no attempt to deal with the case where
taking the address of something causes a copy due to misalignment. */
-#define UPDATE_TITCSE(NODE) \
+#define UPDATE_FLAGS(NODE) \
do { tree _node = (NODE); \
- if (_node && !TREE_INVARIANT (_node)) ti = false; \
if (_node && !TREE_CONSTANT (_node)) tc = false; \
if (_node && TREE_SIDE_EFFECTS (_node)) se = true; } while (0)
@@ -2908,11 +3006,11 @@ do { tree _node = (NODE); \
|| TREE_CODE (node) == ARRAY_RANGE_REF)
&& TREE_CODE (TREE_TYPE (TREE_OPERAND (node, 0))) == ARRAY_TYPE)
{
- UPDATE_TITCSE (TREE_OPERAND (node, 1));
+ UPDATE_FLAGS (TREE_OPERAND (node, 1));
if (TREE_OPERAND (node, 2))
- UPDATE_TITCSE (TREE_OPERAND (node, 2));
+ UPDATE_FLAGS (TREE_OPERAND (node, 2));
if (TREE_OPERAND (node, 3))
- UPDATE_TITCSE (TREE_OPERAND (node, 3));
+ UPDATE_FLAGS (TREE_OPERAND (node, 3));
}
/* Likewise, just because this is a COMPONENT_REF doesn't mean we have a
FIELD_DECL, apparently. The G++ front end can put something else
@@ -2921,46 +3019,35 @@ do { tree _node = (NODE); \
&& TREE_CODE (TREE_OPERAND (node, 1)) == FIELD_DECL)
{
if (TREE_OPERAND (node, 2))
- UPDATE_TITCSE (TREE_OPERAND (node, 2));
+ UPDATE_FLAGS (TREE_OPERAND (node, 2));
}
else if (TREE_CODE (node) == BIT_FIELD_REF)
- UPDATE_TITCSE (TREE_OPERAND (node, 2));
+ UPDATE_FLAGS (TREE_OPERAND (node, 2));
}
- node = lang_hooks.expr_to_decl (node, &tc, &ti, &se);
+ node = lang_hooks.expr_to_decl (node, &tc, &se);
/* Now see what's inside. If it's an INDIRECT_REF, copy our properties from
- the address, since &(*a)->b is a form of addition. If it's a decl, it's
- invariant and constant if the decl is static. It's also invariant if it's
- a decl in the current function. Taking the address of a volatile variable
- is not volatile. If it's a constant, the address is both invariant and
- constant. Otherwise it's neither. */
+ the address, since &(*a)->b is a form of addition. If it's a constant, the
+ address is constant too. If it's a decl, its address is constant if the
+ decl is static. Everything else is not constant and, furthermore,
+ taking the address of a volatile variable is not volatile. */
if (TREE_CODE (node) == INDIRECT_REF)
- UPDATE_TITCSE (TREE_OPERAND (node, 0));
- else if (DECL_P (node))
- {
- if (staticp (node))
- ;
- else if (decl_function_context (node) == current_function_decl
- /* Addresses of thread-local variables are invariant. */
- || (TREE_CODE (node) == VAR_DECL
- && DECL_THREAD_LOCAL_P (node)))
- tc = false;
- else
- ti = tc = false;
- }
+ UPDATE_FLAGS (TREE_OPERAND (node, 0));
else if (CONSTANT_CLASS_P (node))
;
+ else if (DECL_P (node))
+ tc &= (staticp (node) != NULL_TREE);
else
{
- ti = tc = false;
+ tc = false;
se |= TREE_SIDE_EFFECTS (node);
}
+
TREE_CONSTANT (t) = tc;
- TREE_INVARIANT (t) = ti;
TREE_SIDE_EFFECTS (t) = se;
-#undef UPDATE_TITCSE
+#undef UPDATE_FLAGS
}
/* Build an expression of code CODE, data type TYPE, and operands as
@@ -3057,9 +3144,6 @@ build1_stat (enum tree_code code, tree type, tree node MEM_STAT_DECL)
&& node && !TYPE_P (node)
&& TREE_CONSTANT (node))
TREE_CONSTANT (t) = 1;
- if ((TREE_CODE_CLASS (code) == tcc_unary || code == VIEW_CONVERT_EXPR)
- && node && TREE_INVARIANT (node))
- TREE_INVARIANT (t) = 1;
if (TREE_CODE_CLASS (code) == tcc_reference
&& node && TREE_THIS_VOLATILE (node))
TREE_THIS_VOLATILE (t) = 1;
@@ -3080,15 +3164,13 @@ build1_stat (enum tree_code code, tree type, tree node MEM_STAT_DECL)
read_only = 0; \
if (!TREE_CONSTANT (arg##N)) \
constant = 0; \
- if (!TREE_INVARIANT (arg##N)) \
- invariant = 0; \
} \
} while (0)
tree
build2_stat (enum tree_code code, tree tt, tree arg0, tree arg1 MEM_STAT_DECL)
{
- bool constant, read_only, side_effects, invariant;
+ bool constant, read_only, side_effects;
tree t;
gcc_assert (TREE_CODE_LENGTH (code) == 2);
@@ -3125,14 +3207,12 @@ build2_stat (enum tree_code code, tree tt, tree arg0, tree arg1 MEM_STAT_DECL)
|| TREE_CODE_CLASS (code) == tcc_binary);
read_only = 1;
side_effects = TREE_SIDE_EFFECTS (t);
- invariant = constant;
PROCESS_ARG(0);
PROCESS_ARG(1);
TREE_READONLY (t) = read_only;
TREE_CONSTANT (t) = constant;
- TREE_INVARIANT (t) = invariant;
TREE_SIDE_EFFECTS (t) = side_effects;
TREE_THIS_VOLATILE (t)
= (TREE_CODE_CLASS (code) == tcc_reference
@@ -3161,7 +3241,7 @@ tree
build3_stat (enum tree_code code, tree tt, tree arg0, tree arg1,
tree arg2 MEM_STAT_DECL)
{
- bool constant, read_only, side_effects, invariant;
+ bool constant, read_only, side_effects;
tree t;
gcc_assert (TREE_CODE_LENGTH (code) == 3);
@@ -3197,7 +3277,7 @@ tree
build4_stat (enum tree_code code, tree tt, tree arg0, tree arg1,
tree arg2, tree arg3 MEM_STAT_DECL)
{
- bool constant, read_only, side_effects, invariant;
+ bool constant, read_only, side_effects;
tree t;
gcc_assert (TREE_CODE_LENGTH (code) == 4);
@@ -3224,7 +3304,7 @@ tree
build5_stat (enum tree_code code, tree tt, tree arg0, tree arg1,
tree arg2, tree arg3, tree arg4 MEM_STAT_DECL)
{
- bool constant, read_only, side_effects, invariant;
+ bool constant, read_only, side_effects;
tree t;
gcc_assert (TREE_CODE_LENGTH (code) == 5);
@@ -3253,7 +3333,7 @@ build7_stat (enum tree_code code, tree tt, tree arg0, tree arg1,
tree arg2, tree arg3, tree arg4, tree arg5,
tree arg6 MEM_STAT_DECL)
{
- bool constant, read_only, side_effects, invariant;
+ bool constant, read_only, side_effects;
tree t;
gcc_assert (code == TARGET_MEM_REF);
@@ -3883,8 +3963,7 @@ merge_dllimport_decl_attributes (tree old, tree new)
"after being referenced with dll linkage", new);
/* If we have used a variable's address with dllimport linkage,
keep the old DECL_DLLIMPORT_P flag: the ADDR_EXPR using the
- decl may already have had TREE_INVARIANT and TREE_CONSTANT
- computed.
+ decl may already have had TREE_CONSTANT computed.
We still remove the attribute so that assembler code refers
to '&foo rather than '_imp__foo'. */
if (TREE_CODE (old) == VAR_DECL && TREE_ADDRESSABLE (old))
diff --git a/gcc/tree.h b/gcc/tree.h
index bdaf8d0f53d..d52c76095fb 100644
--- a/gcc/tree.h
+++ b/gcc/tree.h
@@ -387,7 +387,6 @@ struct tree_base GTY(())
unsigned private_flag : 1;
unsigned protected_flag : 1;
unsigned deprecated_flag : 1;
- unsigned invariant_flag : 1;
unsigned saturating_flag : 1;
unsigned default_def_flag : 1;
@@ -400,7 +399,7 @@ struct tree_base GTY(())
unsigned lang_flag_6 : 1;
unsigned visited : 1;
- unsigned spare : 22;
+ unsigned spare : 23;
/* FIXME tuples: Eventually, we need to move this somewhere external to
the trees. */
@@ -579,11 +578,6 @@ struct gimple_stmt GTY(())
Used in tree traversals to mark visited nodes.
- invariant_flag:
-
- TREE_INVARIANT in
- all expressions.
-
saturating_flag:
TYPE_SATURATING in
@@ -1372,12 +1366,6 @@ extern void omp_clause_range_check_failed (const_tree, const char *, int,
#define IDENTIFIER_TRANSPARENT_ALIAS(NODE) \
(IDENTIFIER_NODE_CHECK (NODE)->base.deprecated_flag)
-/* Value of expression is function invariant. A strict subset of
- TREE_CONSTANT, such an expression is constant over any one function
- invocation, though not across different invocations. May appear in
- any expression node. */
-#define TREE_INVARIANT(NODE) ((NODE)->base.invariant_flag)
-
/* In fixed-point types, means a saturating type. */
#define TYPE_SATURATING(NODE) ((NODE)->base.saturating_flag)
@@ -2276,8 +2264,9 @@ struct tree_block GTY(())
#define TYPE_TRANSPARENT_UNION(NODE) \
(UNION_TYPE_CHECK (NODE)->type.transparent_union_flag)
-/* For an ARRAY_TYPE, indicates that it is not permitted to
- take the address of a component of the type. */
+/* For an ARRAY_TYPE, indicates that it is not permitted to take the
+ address of a component of the type. This is the counterpart of
+ DECL_NONADDRESSABLE_P for arrays, see the definition of this flag. */
#define TYPE_NONALIASED_COMPONENT(NODE) \
(ARRAY_TYPE_CHECK (NODE)->type.transparent_union_flag)
@@ -2908,7 +2897,20 @@ struct tree_decl_with_rtl GTY(())
#define DECL_BIT_FIELD(NODE) (FIELD_DECL_CHECK (NODE)->decl_common.decl_flag_2)
/* Used in a FIELD_DECL to indicate that we cannot form the address of
- this component. */
+ this component. This makes it possible for Type-Based Alias Analysis
+ to disambiguate accesses to this field with indirect accesses using
+ the field's type:
+
+ struct S { int i; } s;
+ int *p;
+
+ If the flag is set on 'i', TBAA computes that s.i and *p never conflict.
+
+ From the implementation's viewpoint, the alias set of the type of the
+ field 'i' (int) will not be recorded as a subset of that of the type of
+ 's' (struct S) in record_component_aliases. The counterpart is that
+ accesses to s.i must not be given the alias set of the type of 'i'
+ (int) but instead directly that of the type of 's' (struct S). */
#define DECL_NONADDRESSABLE_P(NODE) \
(FIELD_DECL_CHECK (NODE)->decl_common.decl_flag_3)
@@ -3190,7 +3192,7 @@ extern void decl_fini_priority_insert (tree, priority_type);
/* In a VAR_DECL, nonzero if the data should be allocated from
thread-local storage. */
#define DECL_THREAD_LOCAL_P(NODE) \
- (VAR_DECL_CHECK (NODE)->decl_with_vis.tls_model != TLS_MODEL_NONE)
+ (VAR_DECL_CHECK (NODE)->decl_with_vis.tls_model >= TLS_MODEL_REAL)
struct tree_var_decl GTY(())
{
@@ -4886,6 +4888,7 @@ extern tree strip_float_extensions (tree);
/* In tree.c */
extern int really_constant_p (const_tree);
+extern bool decl_address_invariant_p (const_tree);
extern int int_fits_type_p (const_tree, const_tree);
#ifndef GENERATOR_FILE
extern void get_type_static_bounds (const_tree, mpz_t, mpz_t);
diff --git a/gcc/varasm.c b/gcc/varasm.c
index bfdf3679301..0d22fc33c0c 100644
--- a/gcc/varasm.c
+++ b/gcc/varasm.c
@@ -48,6 +48,7 @@ along with GCC; see the file COPYING3. If not see
#include "tm_p.h"
#include "debug.h"
#include "target.h"
+#include "targhooks.h"
#include "tree-mudflap.h"
#include "cgraph.h"
#include "cfglayout.h"
@@ -194,68 +195,95 @@ static GTY(()) struct rtx_constant_pool *shared_constant_pool;
static GTY ((if_marked ("tree_map_marked_p"), param_is (struct tree_map)))
htab_t emutls_htab;
static GTY (()) tree emutls_object_type;
-
-#ifndef NO_DOT_IN_LABEL
-# define EMUTLS_VAR_PREFIX "__emutls_v."
-# define EMUTLS_TMPL_PREFIX "__emutls_t."
-#elif !defined NO_DOLLAR_IN_LABEL
-# define EMUTLS_VAR_PREFIX "__emutls_v$"
-# define EMUTLS_TMPL_PREFIX "__emutls_t$"
+/* Emulated TLS objects have the TLS model TLS_MODEL_EMULATED. This
+ macro can be used on them to distinguish the control variable from
+ the initialization template. */
+#define DECL_EMUTLS_VAR_P(D) (TREE_TYPE (D) == emutls_object_type)
+
+#if !defined (NO_DOT_IN_LABEL)
+# define EMUTLS_SEPARATOR "."
+#elif !defined (NO_DOLLAR_IN_LABEL)
+# define EMUTLS_SEPARATOR "$"
#else
-# define EMUTLS_VAR_PREFIX "__emutls_v_"
-# define EMUTLS_TMPL_PREFIX "__emutls_t_"
+# define EMUTLS_SEPARATOR "_"
#endif
-/* Create an identifier for the struct __emutls_object, given an identifier
- of the DECL_ASSEMBLY_NAME of the original object. */
+/* Create an IDENTIFIER_NODE by prefixing PREFIX to the
+ IDENTIFIER_NODE NAME's name. */
static tree
-get_emutls_object_name (tree name)
+prefix_name (const char *prefix, tree name)
{
- char *toname = alloca (strlen (IDENTIFIER_POINTER (name))
- + sizeof (EMUTLS_VAR_PREFIX));
- strcpy (toname, EMUTLS_VAR_PREFIX);
- strcpy (toname + sizeof (EMUTLS_VAR_PREFIX) - 1, IDENTIFIER_POINTER (name));
+ unsigned plen = strlen (prefix);
+ unsigned nlen = strlen (IDENTIFIER_POINTER (name));
+ char *toname = alloca (plen + nlen + 1);
+
+ memcpy (toname, prefix, plen);
+ memcpy (toname + plen, IDENTIFIER_POINTER (name), nlen + 1);
return get_identifier (toname);
}
-/* Create the structure for struct __emutls_object. This should match the
- structure at the top of emutls.c, modulo the union there. */
+/* Create an identifier for the struct __emutls_object, given an identifier
+ of the DECL_ASSEMBLY_NAME of the original object. */
static tree
-get_emutls_object_type (void)
+get_emutls_object_name (tree name)
{
- tree type, type_name, field, next_field, word_type_node;
-
- type = emutls_object_type;
- if (type)
- return type;
-
- emutls_object_type = type = lang_hooks.types.make_type (RECORD_TYPE);
- type_name = get_identifier ("__emutls_object");
- type_name = build_decl (TYPE_DECL, type_name, type);
- TYPE_NAME (type) = type_name;
+ const char *prefix = (targetm.emutls.var_prefix
+ ? targetm.emutls.var_prefix
+ : "__emutls_v" EMUTLS_SEPARATOR);
+ return prefix_name (prefix, name);
+}
+tree
+default_emutls_var_fields (tree type, tree *name ATTRIBUTE_UNUSED)
+{
+ tree word_type_node, field, next_field;
+
field = build_decl (FIELD_DECL, get_identifier ("__templ"), ptr_type_node);
DECL_CONTEXT (field) = type;
next_field = field;
-
- field = build_decl (FIELD_DECL, get_identifier ("__offset"), ptr_type_node);
+
+ field = build_decl (FIELD_DECL, get_identifier ("__offset"),
+ ptr_type_node);
DECL_CONTEXT (field) = type;
TREE_CHAIN (field) = next_field;
next_field = field;
-
+
word_type_node = lang_hooks.types.type_for_mode (word_mode, 1);
- field = build_decl (FIELD_DECL, get_identifier ("__align"), word_type_node);
+ field = build_decl (FIELD_DECL, get_identifier ("__align"),
+ word_type_node);
DECL_CONTEXT (field) = type;
TREE_CHAIN (field) = next_field;
next_field = field;
-
+
field = build_decl (FIELD_DECL, get_identifier ("__size"), word_type_node);
DECL_CONTEXT (field) = type;
TREE_CHAIN (field) = next_field;
+ return field;
+}
+
+/* Create the structure for struct __emutls_object. This should match the
+ structure at the top of emutls.c, modulo the union there. */
+
+static tree
+get_emutls_object_type (void)
+{
+ tree type, type_name, field;
+
+ type = emutls_object_type;
+ if (type)
+ return type;
+
+ emutls_object_type = type = lang_hooks.types.make_type (RECORD_TYPE);
+ type_name = NULL;
+ field = targetm.emutls.var_fields (type, &type_name);
+ if (!type_name)
+ type_name = get_identifier ("__emutls_object");
+ type_name = build_decl (TYPE_DECL, type_name, type);
+ TYPE_NAME (type) = type_name;
TYPE_FIELDS (type) = field;
layout_type (type);
@@ -269,26 +297,30 @@ static tree
get_emutls_init_templ_addr (tree decl)
{
tree name, to;
- char *toname;
-
- if (!DECL_INITIAL (decl))
+
+ if (targetm.emutls.register_common && !DECL_INITIAL (decl)
+ && !DECL_SECTION_NAME (decl))
return null_pointer_node;
name = DECL_ASSEMBLER_NAME (decl);
- toname = alloca (strlen (IDENTIFIER_POINTER (name))
- + sizeof (EMUTLS_TMPL_PREFIX));
- strcpy (toname, EMUTLS_TMPL_PREFIX);
- strcpy (toname + sizeof (EMUTLS_TMPL_PREFIX) - 1, IDENTIFIER_POINTER (name));
- name = get_identifier (toname);
+ if (!targetm.emutls.tmpl_prefix || targetm.emutls.tmpl_prefix[0])
+ {
+ const char *prefix = (targetm.emutls.tmpl_prefix
+ ? targetm.emutls.tmpl_prefix
+ : "__emutls_t" EMUTLS_SEPARATOR);
+ name = prefix_name (prefix, name);
+ }
to = build_decl (VAR_DECL, name, TREE_TYPE (decl));
SET_DECL_ASSEMBLER_NAME (to, DECL_NAME (to));
-
+ DECL_TLS_MODEL (to) = TLS_MODEL_EMULATED;
DECL_ARTIFICIAL (to) = 1;
TREE_USED (to) = TREE_USED (decl);
TREE_READONLY (to) = 1;
DECL_IGNORED_P (to) = 1;
DECL_CONTEXT (to) = DECL_CONTEXT (decl);
+ DECL_SECTION_NAME (to) = DECL_SECTION_NAME (decl);
+
DECL_WEAK (to) = DECL_WEAK (decl);
if (DECL_ONE_ONLY (decl))
{
@@ -348,14 +380,18 @@ emutls_decl (tree decl)
h->to = to;
*(struct tree_map **) loc = h;
+ DECL_TLS_MODEL (to) = TLS_MODEL_EMULATED;
DECL_ARTIFICIAL (to) = 1;
DECL_IGNORED_P (to) = 1;
TREE_READONLY (to) = 0;
-
SET_DECL_ASSEMBLER_NAME (to, DECL_NAME (to));
if (DECL_ONE_ONLY (decl))
make_decl_one_only (to);
DECL_CONTEXT (to) = DECL_CONTEXT (decl);
+ if (targetm.emutls.var_align_fixed)
+ /* If we're not allowed to change the proxy object's
+ alignment, pretend it's been set by the user. */
+ DECL_USER_ALIGN (to) = 1;
}
/* Note that these fields may need to be updated from time to time from
@@ -413,16 +449,19 @@ emutls_common_1 (void **loc, void *xstmts)
void
emutls_finish (void)
{
- tree body = NULL_TREE;
-
- if (emutls_htab == NULL)
- return;
+ if (!targetm.emutls.register_common)
+ {
+ tree body = NULL_TREE;
- htab_traverse_noresize (emutls_htab, emutls_common_1, &body);
- if (body == NULL_TREE)
- return;
+ if (emutls_htab == NULL)
+ return;
- cgraph_build_static_cdtor ('I', body, DEFAULT_INIT_PRIORITY);
+ htab_traverse_noresize (emutls_htab, emutls_common_1, &body);
+ if (body == NULL_TREE)
+ return;
+
+ cgraph_build_static_cdtor ('I', body, DEFAULT_INIT_PRIORITY);
+ }
}
/* Helper routines for maintaining section_htab. */
@@ -1125,7 +1164,12 @@ get_variable_section (tree decl, bool prefer_noswitch_p)
{
if (DECL_THREAD_LOCAL_P (decl))
return tls_comm_section;
- if (TREE_PUBLIC (decl) && bss_initializer_p (decl))
+ /* This cannot be common bss for an emulated TLS object without
+ a register_common hook. */
+ else if (DECL_TLS_MODEL (decl) == TLS_MODEL_EMULATED
+ && !targetm.emutls.register_common)
+ ;
+ else if (TREE_PUBLIC (decl) && bss_initializer_p (decl))
return comm_section;
}
@@ -1633,7 +1677,7 @@ assemble_start_function (tree decl, const char *fnname)
/* When the function starts with a cold section, we need to explicitly
align the hot section and write out the hot section label.
But if the current function is a thunk, we do not have a CFG. */
- if (!current_function_is_thunk
+ if (!crtl->is_thunk
&& BB_PARTITION (ENTRY_BLOCK_PTR->next_bb) == BB_COLD_PARTITION)
{
switch_to_section (text_section);
@@ -1950,6 +1994,40 @@ assemble_variable_contents (tree decl, const char *name,
}
}
+/* Initialize emulated tls object TO, which refers to TLS variable
+ DECL and is initialized by PROXY. */
+
+tree
+default_emutls_var_init (tree to, tree decl, tree proxy)
+{
+ VEC(constructor_elt,gc) *v = VEC_alloc (constructor_elt, gc, 4);
+ constructor_elt *elt;
+ tree type = TREE_TYPE (to);
+ tree field = TYPE_FIELDS (type);
+
+ elt = VEC_quick_push (constructor_elt, v, NULL);
+ elt->index = field;
+ elt->value = fold_convert (TREE_TYPE (field), DECL_SIZE_UNIT (decl));
+
+ elt = VEC_quick_push (constructor_elt, v, NULL);
+ field = TREE_CHAIN (field);
+ elt->index = field;
+ elt->value = build_int_cst (TREE_TYPE (field),
+ DECL_ALIGN_UNIT (decl));
+
+ elt = VEC_quick_push (constructor_elt, v, NULL);
+ field = TREE_CHAIN (field);
+ elt->index = field;
+ elt->value = null_pointer_node;
+
+ elt = VEC_quick_push (constructor_elt, v, NULL);
+ field = TREE_CHAIN (field);
+ elt->index = field;
+ elt->value = proxy;
+
+ return build_constructor (type, v);
+}
+
/* Assemble everything that is needed for a variable or function declaration.
Not used for automatic variables, and not used for function definitions.
Should not be called for variables of incomplete structure type.
@@ -1984,32 +2062,8 @@ assemble_variable (tree decl, int top_level ATTRIBUTE_UNUSED,
|| (DECL_INITIAL (decl)
&& DECL_INITIAL (decl) != error_mark_node)))
{
- VEC(constructor_elt,gc) *v = VEC_alloc (constructor_elt, gc, 4);
- constructor_elt *elt;
- tree type = TREE_TYPE (to);
- tree field = TYPE_FIELDS (type);
-
- elt = VEC_quick_push (constructor_elt, v, NULL);
- elt->index = field;
- elt->value = fold_convert (TREE_TYPE (field), DECL_SIZE_UNIT (decl));
-
- elt = VEC_quick_push (constructor_elt, v, NULL);
- field = TREE_CHAIN (field);
- elt->index = field;
- elt->value = build_int_cst (TREE_TYPE (field),
- DECL_ALIGN_UNIT (decl));
-
- elt = VEC_quick_push (constructor_elt, v, NULL);
- field = TREE_CHAIN (field);
- elt->index = field;
- elt->value = null_pointer_node;
-
- elt = VEC_quick_push (constructor_elt, v, NULL);
- field = TREE_CHAIN (field);
- elt->index = field;
- elt->value = get_emutls_init_templ_addr (decl);
-
- DECL_INITIAL (to) = build_constructor (type, v);
+ DECL_INITIAL (to) = targetm.emutls.var_init
+ (to, decl, get_emutls_init_templ_addr (decl));
/* Make sure the template is marked as needed early enough.
Without this, if the variable is placed in a
@@ -2815,7 +2869,6 @@ const_hash_1 (const tree exp)
case NOP_EXPR:
case CONVERT_EXPR:
- case NON_LVALUE_EXPR:
return const_hash_1 (TREE_OPERAND (exp, 0)) * 7 + 2;
default:
@@ -2970,7 +3023,6 @@ compare_constant (const tree t1, const tree t2)
case NOP_EXPR:
case CONVERT_EXPR:
- case NON_LVALUE_EXPR:
case VIEW_CONVERT_EXPR:
return compare_constant (TREE_OPERAND (t1, 0), TREE_OPERAND (t2, 0));
@@ -3018,7 +3070,6 @@ copy_constant (tree exp)
case NOP_EXPR:
case CONVERT_EXPR:
- case NON_LVALUE_EXPR:
case VIEW_CONVERT_EXPR:
return build1 (TREE_CODE (exp), TREE_TYPE (exp),
copy_constant (TREE_OPERAND (exp, 0)));
@@ -3489,7 +3540,7 @@ force_const_mem (enum machine_mode mode, rtx x)
return NULL_RTX;
/* Record that this function has used a constant pool entry. */
- current_function_uses_const_pool = 1;
+ crtl->uses_const_pool = 1;
/* Decide which pool to use. */
pool = (targetm.use_blocks_for_constant_p (mode, x)
@@ -3803,7 +3854,7 @@ mark_constant_pool (void)
{
rtx insn, link;
- if (!current_function_uses_const_pool && n_deferred_constants == 0)
+ if (!crtl->uses_const_pool && n_deferred_constants == 0)
return;
for (insn = get_insns (); insn; insn = NEXT_INSN (insn))
@@ -3917,7 +3968,6 @@ compute_reloc_for_constant (tree exp)
case NOP_EXPR:
case CONVERT_EXPR:
- case NON_LVALUE_EXPR:
case VIEW_CONVERT_EXPR:
reloc = compute_reloc_for_constant (TREE_OPERAND (exp, 0));
break;
@@ -3973,7 +4023,6 @@ output_addressed_constants (tree exp)
case NOP_EXPR:
case CONVERT_EXPR:
- case NON_LVALUE_EXPR:
case VIEW_CONVERT_EXPR:
output_addressed_constants (TREE_OPERAND (exp, 0));
break;
@@ -5791,13 +5840,26 @@ categorize_decl_for_section (const_tree decl, int reloc)
ret = SECCAT_RODATA;
/* There are no read-only thread-local sections. */
- if (TREE_CODE (decl) == VAR_DECL && DECL_THREAD_LOCAL_P (decl))
+ if (TREE_CODE (decl) == VAR_DECL && DECL_TLS_MODEL (decl))
{
+ if (DECL_TLS_MODEL (decl) == TLS_MODEL_EMULATED)
+ {
+ if (DECL_EMUTLS_VAR_P (decl))
+ {
+ if (targetm.emutls.var_section)
+ ret = SECCAT_EMUTLS_VAR;
+ }
+ else
+ {
+ if (targetm.emutls.tmpl_prefix)
+ ret = SECCAT_EMUTLS_TMPL;
+ }
+ }
/* Note that this would be *just* SECCAT_BSS, except that there's
no concept of a read-only thread-local-data section. */
- if (ret == SECCAT_BSS
- || (flag_zero_initialized_in_bss
- && initializer_zerop (DECL_INITIAL (decl))))
+ else if (ret == SECCAT_BSS
+ || (flag_zero_initialized_in_bss
+ && initializer_zerop (DECL_INITIAL (decl))))
ret = SECCAT_TBSS;
else
ret = SECCAT_TDATA;
@@ -5889,6 +5951,12 @@ default_elf_select_section (tree decl, int reloc,
case SECCAT_TBSS:
sname = ".tbss";
break;
+ case SECCAT_EMUTLS_VAR:
+ sname = targetm.emutls.var_section;
+ break;
+ case SECCAT_EMUTLS_TMPL:
+ sname = targetm.emutls.tmpl_section;
+ break;
default:
gcc_unreachable ();
}
@@ -5906,69 +5974,73 @@ default_unique_section (tree decl, int reloc)
{
/* We only need to use .gnu.linkonce if we don't have COMDAT groups. */
bool one_only = DECL_ONE_ONLY (decl) && !HAVE_COMDAT_GROUP;
- const char *prefix, *name;
- size_t nlen, plen;
+ const char *prefix, *name, *linkonce;
char *string;
switch (categorize_decl_for_section (decl, reloc))
{
case SECCAT_TEXT:
- prefix = one_only ? ".gnu.linkonce.t." : ".text.";
+ prefix = one_only ? ".t" : ".text";
break;
case SECCAT_RODATA:
case SECCAT_RODATA_MERGE_STR:
case SECCAT_RODATA_MERGE_STR_INIT:
case SECCAT_RODATA_MERGE_CONST:
- prefix = one_only ? ".gnu.linkonce.r." : ".rodata.";
+ prefix = one_only ? ".r" : ".rodata";
break;
case SECCAT_SRODATA:
- prefix = one_only ? ".gnu.linkonce.s2." : ".sdata2.";
+ prefix = one_only ? ".s2" : ".sdata2";
break;
case SECCAT_DATA:
- prefix = one_only ? ".gnu.linkonce.d." : ".data.";
+ prefix = one_only ? ".d" : ".data";
break;
case SECCAT_DATA_REL:
- prefix = one_only ? ".gnu.linkonce.d.rel." : ".data.rel.";
+ prefix = one_only ? ".d.rel" : ".data.rel";
break;
case SECCAT_DATA_REL_LOCAL:
- prefix = one_only ? ".gnu.linkonce.d.rel.local." : ".data.rel.local.";
+ prefix = one_only ? ".d.rel.local" : ".data.rel.local";
break;
case SECCAT_DATA_REL_RO:
- prefix = one_only ? ".gnu.linkonce.d.rel.ro." : ".data.rel.ro.";
+ prefix = one_only ? ".d.rel.ro" : ".data.rel.ro";
break;
case SECCAT_DATA_REL_RO_LOCAL:
- prefix = one_only ? ".gnu.linkonce.d.rel.ro.local."
- : ".data.rel.ro.local.";
+ prefix = one_only ? ".d.rel.ro.local" : ".data.rel.ro.local";
break;
case SECCAT_SDATA:
- prefix = one_only ? ".gnu.linkonce.s." : ".sdata.";
+ prefix = one_only ? ".s" : ".sdata";
break;
case SECCAT_BSS:
- prefix = one_only ? ".gnu.linkonce.b." : ".bss.";
+ prefix = one_only ? ".b" : ".bss";
break;
case SECCAT_SBSS:
- prefix = one_only ? ".gnu.linkonce.sb." : ".sbss.";
+ prefix = one_only ? ".sb" : ".sbss";
break;
case SECCAT_TDATA:
- prefix = one_only ? ".gnu.linkonce.td." : ".tdata.";
+ prefix = one_only ? ".td" : ".tdata";
break;
case SECCAT_TBSS:
- prefix = one_only ? ".gnu.linkonce.tb." : ".tbss.";
+ prefix = one_only ? ".tb" : ".tbss";
+ break;
+ case SECCAT_EMUTLS_VAR:
+ prefix = targetm.emutls.var_section;
+ break;
+ case SECCAT_EMUTLS_TMPL:
+ prefix = targetm.emutls.tmpl_section;
break;
default:
gcc_unreachable ();
}
- plen = strlen (prefix);
name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl));
name = targetm.strip_name_encoding (name);
- nlen = strlen (name);
- string = alloca (nlen + plen + 1);
- memcpy (string, prefix, plen);
- memcpy (string + plen, name, nlen + 1);
+ /* If we're using one_only, then there needs to be a .gnu.linkonce
+ prefix to the section name. */
+ linkonce = one_only ? ".gnu.linkonce" : "";
+
+ string = ACONCAT ((linkonce, prefix, ".", name, NULL));
- DECL_SECTION_NAME (decl) = build_string (nlen + plen, string);
+ DECL_SECTION_NAME (decl) = build_string (strlen (string), string);
}
/* Like compute_reloc_for_constant, except for an RTX. The return value