aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYvan Roux <yvan.roux@linaro.org>2017-01-15 21:04:46 +0000
committerYvan Roux <yvan.roux@linaro.org>2017-01-15 21:04:46 +0000
commit12c4cf8e1f0cecabe380647621023dafc3479a2f (patch)
tree998a65bdbe6815214c71a19fe58b8c67698f792a
parentb1711f6d485de88bc985a5e23874f79ed0bd63f1 (diff)
parent9292dc98baf244da9c72b5c1c74ab87d961c381d (diff)
Merge branches/gcc-4_9-branch rev 239063
git-svn-id: https://gcc.gnu.org/svn/gcc/branches/linaro/gcc-4_9-branch@244479 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--ChangeLog19
-rw-r--r--Makefile.def1
-rw-r--r--Makefile.in1
-rw-r--r--boehm-gc/ChangeLog4
-rw-r--r--config/ChangeLog4
-rwxr-xr-xconfigure49
-rw-r--r--configure.ac3
-rw-r--r--contrib/ChangeLog4
-rw-r--r--contrib/reghunt/ChangeLog4
-rw-r--r--contrib/regression/ChangeLog4
-rw-r--r--fixincludes/ChangeLog11
-rw-r--r--fixincludes/fixincl.x57
-rw-r--r--fixincludes/inclhack.def14
-rw-r--r--fixincludes/tests/base/stdio.h5
-rw-r--r--gcc/ChangeLog1198
-rw-r--r--gcc/DATESTAMP2
-rw-r--r--gcc/DEV-PHASE1
-rw-r--r--gcc/ada/ChangeLog53
-rw-r--r--gcc/ada/a-textio.adb2
-rw-r--r--gcc/ada/gcc-interface/Makefile.in61
-rw-r--r--gcc/ada/s-oscons-tmplt.c7
-rw-r--r--gcc/ada/s-osinte-freebsd.ads9
-rw-r--r--gcc/ada/s-osinte-kfreebsd-gnu.ads119
-rw-r--r--gcc/ada/s-osinte-rtems.ads50
-rw-r--r--gcc/alias.c36
-rw-r--r--gcc/builtins.c116
-rw-r--r--gcc/c-family/ChangeLog35
-rw-r--r--gcc/c-family/c-common.c2
-rw-r--r--gcc/c-family/c-cppbuiltin.c1
-rw-r--r--gcc/c-family/c-ppoutput.c32
-rw-r--r--gcc/c/ChangeLog4
-rw-r--r--gcc/c/c-parser.c18
-rw-r--r--gcc/c/c-tree.h1
-rw-r--r--gcc/c/c-typeck.c55
-rw-r--r--gcc/calls.c44
-rw-r--r--gcc/cfgexpand.c29
-rw-r--r--gcc/cfgrtl.c16
-rw-r--r--gcc/cgraph.c5
-rw-r--r--gcc/cgraphclones.c1
-rw-r--r--gcc/combine.c19
-rw-r--r--gcc/config.gcc3
-rw-r--r--gcc/config.in12
-rw-r--r--gcc/config/aarch64/aarch64-simd.md10
-rw-r--r--gcc/config/aarch64/aarch64.c14
-rw-r--r--gcc/config/aarch64/aarch64.md8
-rw-r--r--gcc/config/alpha/alpha.md5
-rw-r--r--gcc/config/arm/arm-protos.h1
-rw-r--r--gcc/config/arm/arm.c44
-rw-r--r--gcc/config/arm/arm.h5
-rw-r--r--gcc/config/arm/arm.md25
-rw-r--r--gcc/config/arm/constraints.md5
-rw-r--r--gcc/config/arm/driver-arm.c11
-rw-r--r--gcc/config/arm/sync.md66
-rw-r--r--gcc/config/arm/thumb2.md30
-rw-r--r--gcc/config/arm/unspecs.md1
-rw-r--r--gcc/config/avr/avr.md16
-rw-r--r--gcc/config/avr/driver-avr.c2
-rw-r--r--gcc/config/darwin.h9
-rw-r--r--gcc/config/freebsd-spec.h7
-rw-r--r--gcc/config/i386/constraints.md10
-rw-r--r--gcc/config/i386/darwin.h6
-rw-r--r--gcc/config/i386/driver-i386.c73
-rw-r--r--gcc/config/i386/freebsd.h31
-rw-r--r--gcc/config/i386/i386.c99
-rw-r--r--gcc/config/i386/i386.md18
-rw-r--r--gcc/config/i386/sol2-9.h23
-rw-r--r--gcc/config/i386/sol2.h5
-rw-r--r--gcc/config/i386/sse.md23
-rw-r--r--gcc/config/ia64/ia64.c9
-rw-r--r--gcc/config/ia64/predicates.md26
-rw-r--r--gcc/config/microblaze/rtems.h7
-rw-r--r--gcc/config/pa/constraints.md4
-rw-r--r--gcc/config/pa/pa.c164
-rw-r--r--gcc/config/pa/pa.md130
-rw-r--r--gcc/config/pa/predicates.md6
-rw-r--r--gcc/config/rs6000/altivec.md2
-rw-r--r--gcc/config/rs6000/freebsd64.h40
-rw-r--r--gcc/config/rs6000/predicates.md13
-rw-r--r--gcc/config/rs6000/rs6000-builtin.def14
-rw-r--r--gcc/config/rs6000/rs6000.c9
-rw-r--r--gcc/config/rs6000/rs6000.h1
-rw-r--r--gcc/config/rs6000/rs6000.md102
-rw-r--r--gcc/config/rs6000/t-freebsd646
-rw-r--r--gcc/config/rs6000/vsx.md28
-rw-r--r--gcc/config/rtems.h2
-rw-r--r--gcc/config/s390/s390.c95
-rw-r--r--gcc/config/s390/s390.md10
-rw-r--r--gcc/config/sh/sh.md20
-rw-r--r--gcc/config/sparc/sp-elf.h4
-rw-r--r--gcc/config/sparc/sparc.c22
-rwxr-xr-xgcc/configure68
-rw-r--r--gcc/configure.ac21
-rw-r--r--gcc/cp/ChangeLog128
-rw-r--r--gcc/cp/Make-lang.in2
-rw-r--r--gcc/cp/call.c41
-rw-r--r--gcc/cp/cfns.gperf10
-rw-r--r--gcc/cp/cfns.h41
-rw-r--r--gcc/cp/cp-tree.h2
-rw-r--r--gcc/cp/cvt.c2
-rw-r--r--gcc/cp/decl.c5
-rw-r--r--gcc/cp/except.c3
-rw-r--r--gcc/cp/init.c2
-rw-r--r--gcc/cp/mangle.c2
-rw-r--r--gcc/cp/parser.c61
-rw-r--r--gcc/cp/pt.c22
-rw-r--r--gcc/cp/rtti.c4
-rw-r--r--gcc/cp/semantics.c6
-rw-r--r--gcc/cp/typeck.c5
-rw-r--r--gcc/doc/invoke.texi12
-rw-r--r--gcc/doc/md.texi2
-rw-r--r--gcc/doc/sourcebuild.texi3
-rw-r--r--gcc/dse.c23
-rw-r--r--gcc/dwarf2out.c2
-rw-r--r--gcc/fold-const.c40
-rw-r--r--gcc/fortran/ChangeLog89
-rw-r--r--gcc/fortran/check.c10
-rw-r--r--gcc/fortran/class.c4
-rw-r--r--gcc/fortran/parse.c69
-rw-r--r--gcc/fortran/scanner.c3
-rw-r--r--gcc/fortran/simplify.c6
-rw-r--r--gcc/fortran/trans-array.c5
-rw-r--r--gcc/fortran/trans-decl.c2
-rw-r--r--gcc/fortran/trans-expr.c14
-rw-r--r--gcc/fortran/trans-openmp.c5
-rw-r--r--gcc/fortran/trans-stmt.c11
-rw-r--r--gcc/fortran/trans-types.c14
-rw-r--r--gcc/fortran/trans.h4
-rw-r--r--gcc/gcse.c27
-rw-r--r--gcc/gimple-expr.c5
-rw-r--r--gcc/gimple-ssa-isolate-paths.c2
-rw-r--r--gcc/gimple-ssa-strength-reduction.c18
-rw-r--r--gcc/gimple.c5
-rw-r--r--gcc/gimplify.c32
-rw-r--r--gcc/go/ChangeLog4
-rw-r--r--gcc/go/gofrontend/expressions.cc10
-rw-r--r--gcc/graphite-blocking.c1
-rw-r--r--gcc/graphite-dependences.c15
-rw-r--r--gcc/graphite-interchange.c1
-rw-r--r--gcc/graphite-optimize-isl.c10
-rw-r--r--gcc/graphite-poly.c1
-rw-r--r--gcc/graphite-poly.h5
-rw-r--r--gcc/graphite-scop-detection.c1
-rw-r--r--gcc/graphite-sese-to-poly.c1
-rw-r--r--gcc/graphite.c1
-rw-r--r--gcc/haifa-sched.c10
-rw-r--r--gcc/hw-doloop.c4
-rw-r--r--gcc/ifcvt.c27
-rw-r--r--gcc/ipa-cp.c23
-rw-r--r--gcc/ipa-inline-analysis.c125
-rw-r--r--gcc/ipa-inline.h2
-rw-r--r--gcc/ipa-prop.c7
-rw-r--r--gcc/ipa-prop.h2
-rw-r--r--gcc/ira-build.c2
-rw-r--r--gcc/ira.c114
-rw-r--r--gcc/java/ChangeLog4
-rw-r--r--gcc/lra-constraints.c5
-rw-r--r--gcc/lto-streamer.h2
-rw-r--r--gcc/lto/ChangeLog4
-rw-r--r--gcc/objc/ChangeLog4
-rw-r--r--gcc/objcp/ChangeLog4
-rw-r--r--gcc/omp-low.c11
-rw-r--r--gcc/passes.c2
-rw-r--r--gcc/po/ChangeLog4
-rw-r--r--gcc/postreload.c18
-rw-r--r--gcc/ree.c6
-rw-r--r--gcc/rtl.h2
-rw-r--r--gcc/sched-deps.c7
-rw-r--r--gcc/testsuite/ChangeLog789
-rw-r--r--gcc/testsuite/c-c++-common/asan/pr64820.c31
-rw-r--r--gcc/testsuite/c-c++-common/cpp/pr57580.c9
-rw-r--r--gcc/testsuite/c-c++-common/gomp/pr57580.c36
-rw-r--r--gcc/testsuite/c-c++-common/gomp/pr71758.c10
-rw-r--r--gcc/testsuite/c-c++-common/pr67653.c8
-rw-r--r--gcc/testsuite/c-c++-common/pr69797.c8
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/alias-decl-45.C24
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/alias-decl-debug-0.C3
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/constexpr-array14.C9
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/constexpr-template10.C17
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/lambda/lambda-deduce3.C15
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/pr67767.C10
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/sfinae56.C26
-rw-r--r--gcc/testsuite/g++.dg/cpp1y/feat-cxx11.C8
-rw-r--r--gcc/testsuite/g++.dg/cpp1y/feat-cxx14.C8
-rw-r--r--gcc/testsuite/g++.dg/cpp1y/feat-cxx98-neg.C4
-rw-r--r--gcc/testsuite/g++.dg/ext/vector31.C29
-rw-r--r--gcc/testsuite/g++.dg/gomp/pr59627.C14
-rw-r--r--gcc/testsuite/g++.dg/inherit/using8.C15
-rw-r--r--gcc/testsuite/g++.dg/init/elide3.C50
-rw-r--r--gcc/testsuite/g++.dg/init/elide4.C13
-rw-r--r--gcc/testsuite/g++.dg/init/elide5.C27
-rw-r--r--gcc/testsuite/g++.dg/ipa/pr66616.C54
-rw-r--r--gcc/testsuite/g++.dg/ipa/pr68851.C29
-rw-r--r--gcc/testsuite/g++.dg/opt/pr69432.C62
-rw-r--r--gcc/testsuite/g++.dg/other/PR23205.C3
-rw-r--r--gcc/testsuite/g++.dg/other/pr23205-2.C3
-rw-r--r--gcc/testsuite/g++.dg/parse/pr71909.C22
-rw-r--r--gcc/testsuite/g++.dg/pr70098.C91
-rw-r--r--gcc/testsuite/g++.dg/pr71389.C23
-rw-r--r--gcc/testsuite/g++.dg/rtti/typeid11.C16
-rw-r--r--gcc/testsuite/g++.dg/template/pr67337.C25
-rw-r--r--gcc/testsuite/g++.dg/template/ptrmem30.C45
-rw-r--r--gcc/testsuite/g++.dg/tm/pr71909.C18
-rw-r--r--gcc/testsuite/g++.dg/torture/pr64280.C42
-rw-r--r--gcc/testsuite/g++.dg/torture/pr71452.C10
-rw-r--r--gcc/testsuite/g++.dg/torture/pr71874.C12
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/pr69214.c17
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/pr71693.c10
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/builtins/memops-asm.x10
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/builtins/strstr-asm.c1
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/builtins/strstr-asm.x10
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/pr67226.c42
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/pr67929_1.c15
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/pr68185.c29
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/pr68328.c44
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/pr68376-1.c24
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/pr68376-2.c73
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/pr69403.c20
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/pr70222-1.c30
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/pr70222-2.c20
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/pr70429.c17
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/pr70460.c29
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/pr70566.c47
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/pr71494.c22
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/pr71626-1.c19
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/pr71626-2.c4
-rw-r--r--gcc/testsuite/gcc.dg/20040813-1.c3
-rw-r--r--gcc/testsuite/gcc.dg/and-1.c4
-rw-r--r--gcc/testsuite/gcc.dg/autopar/pr69110.c17
-rw-r--r--gcc/testsuite/gcc.dg/darwin-20040809-2.c2
-rw-r--r--gcc/testsuite/gcc.dg/debug/pr66432.c19
-rw-r--r--gcc/testsuite/gcc.dg/ipa/ipa-sra-10.c34
-rw-r--r--gcc/testsuite/gcc.dg/ipa/pr70646.c40
-rw-r--r--gcc/testsuite/gcc.dg/lto/simd-function_0.c34
-rw-r--r--gcc/testsuite/gcc.dg/pr68670-1.c5
-rw-r--r--gcc/testsuite/gcc.dg/pr68670-2.c5
-rw-r--r--gcc/testsuite/gcc.dg/pr69015.c10
-rw-r--r--gcc/testsuite/gcc.dg/pr69195.c27
-rw-r--r--gcc/testsuite/gcc.dg/pr69238.c28
-rw-r--r--gcc/testsuite/gcc.dg/pr69522.c10
-rw-r--r--gcc/testsuite/gcc.dg/pr69644.c11
-rw-r--r--gcc/testsuite/gcc.dg/pr69802.c23
-rw-r--r--gcc/testsuite/gcc.dg/pr70022.c10
-rw-r--r--gcc/testsuite/gcc.dg/pr70152.c27
-rw-r--r--gcc/testsuite/gcc.dg/pr70161-2.c7
-rw-r--r--gcc/testsuite/gcc.dg/pr70161.c7
-rw-r--r--gcc/testsuite/gcc.dg/pr70169.c40
-rw-r--r--gcc/testsuite/gcc.dg/pr71558.c17
-rw-r--r--gcc/testsuite/gcc.dg/setjmp-6.c25
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr29119.c3
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr64091.c28
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr64882.c33
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr66375.c13
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr66413.c61
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr66794.c22
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr67609.c33
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr67794.c15
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr68648.c23
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr68955.c41
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr69574.c15
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr69715.c11
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr69941.c30
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr70457.c29
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr70484.c19
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr71452.c10
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr71606.c11
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/cunroll-11.c18
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/pr69355.c44
-rw-r--r--gcc/testsuite/gcc.target/aarch64/pr68363_1.c19
-rw-r--r--gcc/testsuite/gcc.target/aarch64/pr70809_1.c18
-rw-r--r--gcc/testsuite/gcc.target/arm/atomic_loaddi_1.c9
-rw-r--r--gcc/testsuite/gcc.target/arm/atomic_loaddi_2.c9
-rw-r--r--gcc/testsuite/gcc.target/arm/atomic_loaddi_3.c9
-rw-r--r--gcc/testsuite/gcc.target/arm/atomic_loaddi_4.c9
-rw-r--r--gcc/testsuite/gcc.target/arm/atomic_loaddi_5.c9
-rw-r--r--gcc/testsuite/gcc.target/arm/atomic_loaddi_6.c9
-rw-r--r--gcc/testsuite/gcc.target/arm/atomic_loaddi_7.c9
-rw-r--r--gcc/testsuite/gcc.target/arm/atomic_loaddi_8.c9
-rw-r--r--gcc/testsuite/gcc.target/arm/atomic_loaddi_9.c9
-rw-r--r--gcc/testsuite/gcc.target/arm/atomic_loaddi_acquire.x11
-rw-r--r--gcc/testsuite/gcc.target/arm/atomic_loaddi_relaxed.x11
-rw-r--r--gcc/testsuite/gcc.target/arm/atomic_loaddi_relaxed_cond.c20
-rw-r--r--gcc/testsuite/gcc.target/arm/atomic_loaddi_seq_cst.x11
-rw-r--r--gcc/testsuite/gcc.target/arm/pr67439_1.c11
-rw-r--r--gcc/testsuite/gcc.target/arm/pr67929_1.c21
-rw-r--r--gcc/testsuite/gcc.target/avr/pr71103.c16
-rw-r--r--gcc/testsuite/gcc.target/avr/torture/pr71103-2.c118
-rw-r--r--gcc/testsuite/gcc.target/i386/avx512f-pr70059.c33
-rw-r--r--gcc/testsuite/gcc.target/i386/pr67265-2.c9
-rw-r--r--gcc/testsuite/gcc.target/i386/pr67265.c12
-rw-r--r--gcc/testsuite/gcc.target/i386/pr67770.c40
-rw-r--r--gcc/testsuite/gcc.target/i386/pr68680.c15
-rw-r--r--gcc/testsuite/gcc.target/i386/pr68701-1.c13
-rw-r--r--gcc/testsuite/gcc.target/i386/pr68701-2.c11
-rw-r--r--gcc/testsuite/gcc.target/i386/pr69459.c42
-rw-r--r--gcc/testsuite/gcc.target/i386/pr69551.c23
-rw-r--r--gcc/testsuite/gcc.target/i386/pr69891.c30
-rw-r--r--gcc/testsuite/gcc.target/i386/pr70007.c30
-rw-r--r--gcc/testsuite/gcc.target/i386/pr70327.c12
-rw-r--r--gcc/testsuite/gcc.target/i386/pr70858.c45
-rw-r--r--gcc/testsuite/gcc.target/i386/sse4_1-round.h13
-rw-r--r--gcc/testsuite/gcc.target/i386/sse4_1-roundps-1.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/sse4_1-roundps-2.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/sse4_1-roundps-3.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/sse4_1-roundsd-1.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/sse4_1-roundsd-2.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/sse4_1-roundsd-3.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/sse4_1-roundsd-4.c13
-rw-r--r--gcc/testsuite/gcc.target/i386/sse4_1-roundss-1.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/sse4_1-roundss-2.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/sse4_1-roundss-3.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/sse4_1-roundss-4.c13
-rw-r--r--gcc/testsuite/gcc.target/ia64/pr60465-gprel64-c37.c10
-rw-r--r--gcc/testsuite/gcc.target/ia64/pr60465-gprel64.c27
-rw-r--r--gcc/testsuite/gcc.target/m68k/pr63347.c46
-rw-r--r--gcc/testsuite/gcc.target/powerpc/pr68872.c14
-rw-r--r--gcc/testsuite/gcc.target/powerpc/pr69548.c11
-rw-r--r--gcc/testsuite/gcc.target/powerpc/pr70117.c92
-rw-r--r--gcc/testsuite/gcc.target/powerpc/pr70963.c44
-rw-r--r--gcc/testsuite/gcc.target/powerpc/vec-cg.c22
-rw-r--r--gcc/testsuite/gcc.target/s390/gpr2fprsavecfi.c23
-rw-r--r--gcc/testsuite/gcc.target/s390/pr70674.c13
-rw-r--r--gcc/testsuite/gcc.target/sh/torture/pr67260.c12
-rw-r--r--gcc/testsuite/gcc.target/sparc/sparc-ret-1.c (renamed from gcc/testsuite/gcc.target/sparc/sparc-ret.c)0
-rw-r--r--gcc/testsuite/gcc.target/sparc/sparc-ret-2.c13
-rw-r--r--gcc/testsuite/gfortran.dg/allocate_with_arrayspec_1.f9029
-rw-r--r--gcc/testsuite/gfortran.dg/fmt_pf.f90226
-rw-r--r--gcc/testsuite/gfortran.dg/gomp/pr69128.f9023
-rw-r--r--gcc/testsuite/gfortran.dg/gomp/pr71704.f9058
-rw-r--r--gcc/testsuite/gfortran.dg/gomp/pr71705.f907
-rw-r--r--gcc/testsuite/gfortran.dg/gomp/pr71758.f9010
-rw-r--r--gcc/testsuite/gfortran.dg/include_6.f902
-rw-r--r--gcc/testsuite/gfortran.dg/list_read_14.f9025
-rw-r--r--gcc/testsuite/gfortran.dg/namelist_38.f9014
-rw-r--r--gcc/testsuite/gfortran.dg/namelist_84.f905
-rw-r--r--gcc/testsuite/gfortran.dg/pr60126.f9018
-rw-r--r--gcc/testsuite/gfortran.dg/pr66465.f9023
-rw-r--r--gcc/testsuite/gfortran.dg/pr70931.f9010
-rw-r--r--gcc/testsuite/gfortran.dg/pr71688.f9013
-rw-r--r--gcc/testsuite/gfortran.dg/pr71764.f9034
-rw-r--r--gcc/testsuite/gfortran.dg/proc_ptr_47.f9037
-rw-r--r--gcc/testsuite/gfortran.dg/prof/dynamic_dispatch_6.f0368
-rw-r--r--gcc/testsuite/gfortran.dg/prof/prof.exp56
-rw-r--r--gcc/testsuite/gfortran.dg/select_type_35.f0341
-rw-r--r--gcc/testsuite/gfortran.dg/unexpected_eof.f8
-rw-r--r--gcc/testsuite/lib/gcc-gdb-test.exp4
-rw-r--r--gcc/testsuite/lib/gcc-simulate-thread.exp4
-rw-r--r--gcc/testsuite/lib/target-supports.exp47
-rw-r--r--gcc/testsuite/objc.dg/stabs-1.m3
-rw-r--r--gcc/tree-cfg.c3
-rw-r--r--gcc/tree-chrec.c10
-rw-r--r--gcc/tree-data-ref.c21
-rw-r--r--gcc/tree-if-conv.c2
-rw-r--r--gcc/tree-inline.c11
-rw-r--r--gcc/tree-nested.c2
-rw-r--r--gcc/tree-scalar-evolution.c50
-rw-r--r--gcc/tree-sra.c84
-rw-r--r--gcc/tree-ssa-dom.c15
-rw-r--r--gcc/tree-ssa-loop-ivcanon.c4
-rw-r--r--gcc/tree-ssa-loop.c6
-rw-r--r--gcc/tree-ssa-math-opts.c6
-rw-r--r--gcc/tree-ssa-reassoc.c40
-rw-r--r--gcc/tree-ssa-strlen.c47
-rw-r--r--gcc/tree-ssa-tail-merge.c1
-rw-r--r--gcc/tree-ssa-threadedge.c33
-rw-r--r--gcc/tree-ssa.c11
-rw-r--r--gcc/tree-vect-data-refs.c2
-rw-r--r--gcc/tree-vect-loop.c2
-rw-r--r--gcc/tree-vrp.c7
-rw-r--r--gnattools/ChangeLog4
-rw-r--r--include/ChangeLog14
-rw-r--r--include/demangle.h4
-rw-r--r--intl/ChangeLog4
-rw-r--r--libada/ChangeLog4
-rw-r--r--libatomic/ChangeLog23
-rw-r--r--libatomic/Makefile.am7
-rw-r--r--libatomic/Makefile.in13
-rw-r--r--libatomic/config/rtems/host-config.h41
-rw-r--r--libatomic/config/rtems/lock.c37
-rw-r--r--libatomic/configure.tgt9
-rw-r--r--libbacktrace/ChangeLog10
-rw-r--r--libbacktrace/elf.c3
-rw-r--r--libcilkrts/ChangeLog4
-rw-r--r--libcpp/ChangeLog28
-rw-r--r--libcpp/errors.c16
-rw-r--r--libcpp/files.c16
-rw-r--r--libcpp/include/cpplib.h3
-rw-r--r--libcpp/line-map.c2
-rw-r--r--libcpp/po/ChangeLog4
-rw-r--r--libdecnumber/ChangeLog4
-rw-r--r--libffi/ChangeLog4
-rw-r--r--libgcc/ChangeLog35
-rw-r--r--libgcc/config.host9
-rw-r--r--libgcc/config/gmon-sol2.c36
-rw-r--r--libgcc/config/libbid/ChangeLog4
-rw-r--r--libgcc/config/pa/fptr.c66
-rw-r--r--libgfortran/ChangeLog24
-rw-r--r--libgfortran/io/list_read.c21
-rw-r--r--libgfortran/io/write_float.def26
-rw-r--r--libgomp/ChangeLog33
-rw-r--r--libgomp/testsuite/libgomp.c/pr68960.c25
-rw-r--r--libgomp/testsuite/libgomp.c/pr69110.c26
-rw-r--r--libgomp/testsuite/libgomp.fortran/associate3.f9020
-rw-r--r--libgomp/testsuite/libgomp.fortran/declare-simd-4.f907
-rw-r--r--libiberty/ChangeLog129
-rw-r--r--libiberty/cp-demangle.c175
-rw-r--r--libiberty/cp-demint.c1
-rw-r--r--libiberty/cplus-dem.c34
-rw-r--r--libiberty/testsuite/Makefile.in9
-rw-r--r--libiberty/testsuite/demangle-expected109
-rw-r--r--libiberty/testsuite/demangler-fuzzer.c108
-rw-r--r--libitm/ChangeLog4
-rw-r--r--libjava/ChangeLog12
-rw-r--r--libjava/classpath/ChangeLog4
-rw-r--r--libjava/libltdl/ChangeLog4
-rw-r--r--libjava/testsuite/lib/libjava.exp2
-rw-r--r--libobjc/ChangeLog4
-rw-r--r--libquadmath/ChangeLog4
-rw-r--r--libsanitizer/ChangeLog21
-rw-r--r--libsanitizer/asan/asan_mac.cc33
-rw-r--r--libsanitizer/asan/asan_mac.h4
-rw-r--r--libsanitizer/asan/asan_malloc_linux.cc43
-rw-r--r--libssp/ChangeLog4
-rw-r--r--libstdc++-v3/ChangeLog189
-rw-r--r--libstdc++-v3/acinclude.m446
-rw-r--r--libstdc++-v3/config.h.in5
-rwxr-xr-xlibstdc++-v3/configure62
-rw-r--r--libstdc++-v3/configure.ac1
-rw-r--r--libstdc++-v3/include/bits/alloc_traits.h126
-rw-r--r--libstdc++-v3/include/bits/basic_string.h1
-rw-r--r--libstdc++-v3/include/bits/regex_executor.tcc5
-rw-r--r--libstdc++-v3/include/bits/shared_ptr.h22
-rw-r--r--libstdc++-v3/include/bits/shared_ptr_base.h22
-rw-r--r--libstdc++-v3/include/bits/stl_algobase.h12
-rw-r--r--libstdc++-v3/include/bits/valarray_before.h14
-rw-r--r--libstdc++-v3/include/c_global/cmath99
-rw-r--r--libstdc++-v3/include/std/functional17
-rw-r--r--libstdc++-v3/include/tr1/cmath72
-rw-r--r--libstdc++-v3/src/c++11/thread.cc6
-rw-r--r--libstdc++-v3/testsuite/20_util/bind/68912.cc53
-rw-r--r--libstdc++-v3/testsuite/20_util/enable_shared_from_this/56383.cc56
-rw-r--r--libstdc++-v3/testsuite/20_util/function/68995.cc32
-rw-r--r--libstdc++-v3/testsuite/20_util/shared_ptr/cons/58659.cc8
-rw-r--r--libstdc++-v3/testsuite/21_strings/basic_string/cons/char/69092.cc58
-rw-r--r--libstdc++-v3/testsuite/25_algorithms/copy/move_iterators/69478.cc40
-rw-r--r--libstdc++-v3/testsuite/25_algorithms/copy_backward/move_iterators/69478.cc40
-rw-r--r--libstdc++-v3/testsuite/25_algorithms/move/69478.cc40
-rw-r--r--libstdc++-v3/testsuite/25_algorithms/move_backward/69478.cc40
-rw-r--r--libstdc++-v3/testsuite/26_numerics/headers/cmath/60637.cc35
-rw-r--r--libstdc++-v3/testsuite/26_numerics/headers/cmath/c99_classification_macros_c.cc2
-rw-r--r--libstdc++-v3/testsuite/26_numerics/valarray/69116.cc53
-rw-r--r--libstdc++-v3/testsuite/28_regex/algorithms/regex_match/ecma/char/68863.cc43
-rw-r--r--libstdc++-v3/testsuite/30_threads/thread/70503.cc38
-rw-r--r--libvtv/ChangeLog4
-rw-r--r--lto-plugin/ChangeLog4
-rw-r--r--maintainer-scripts/ChangeLog4
-rw-r--r--zlib/ChangeLog4
456 files changed, 10922 insertions, 1378 deletions
diff --git a/ChangeLog b/ChangeLog
index 17448318c94..ab4e8d04218 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,22 @@
+2016-08-03 Release Manager
+
+ * GCC 4.9.4 released.
+
+2015-12-04 Andreas Tobler <andreast@gcc.gnu.org>
+
+ Backport from mainline
+ 2015-12-01 Andreas Tobler <andreast@gcc.gnu.org>
+
+ PR libffi/65726
+ * Makefile.def (lang_env_dependencies): Make libffi depend
+ on cxx.
+ * Makefile.in: Regenerate.
+
+2015-11-18 Matthias Klose <doko@ubuntu.com>
+
+ * configure.ac: Permit also ISL 0.15 with CLooG.
+ * configure: Regenerate.
+
2015-06-26 Release Manager
* GCC 4.9.3 released.
diff --git a/Makefile.def b/Makefile.def
index cd99dd43af6..682922913b1 100644
--- a/Makefile.def
+++ b/Makefile.def
@@ -499,6 +499,7 @@ dependencies = { module=all-m4; on=all-build-texinfo; };
// on libgcc and newlib/libgloss.
lang_env_dependencies = { module=libjava; cxx=true; };
lang_env_dependencies = { module=libitm; cxx=true; };
+lang_env_dependencies = { module=libffi; cxx=true; };
lang_env_dependencies = { module=libcilkrts; cxx=true; };
lang_env_dependencies = { module=newlib; no_c=true; };
lang_env_dependencies = { module=libgloss; no_c=true; };
diff --git a/Makefile.in b/Makefile.in
index 6dd58025eb8..ebbc46f1b14 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -47879,6 +47879,7 @@ configure-target-winsup: maybe-all-target-newlib maybe-all-target-libgloss
configure-target-libffi: maybe-all-target-newlib maybe-all-target-libgloss
+configure-target-libffi: maybe-all-target-libstdc++-v3
configure-target-libjava: maybe-all-target-newlib maybe-all-target-libgloss
configure-target-libjava: maybe-all-target-libstdc++-v3
diff --git a/boehm-gc/ChangeLog b/boehm-gc/ChangeLog
index b94b1c20aa9..aeb669f8e24 100644
--- a/boehm-gc/ChangeLog
+++ b/boehm-gc/ChangeLog
@@ -1,3 +1,7 @@
+2016-08-03 Release Manager
+
+ * GCC 4.9.4 released.
+
2015-06-26 Release Manager
* GCC 4.9.3 released.
diff --git a/config/ChangeLog b/config/ChangeLog
index b479e849c54..0d09d1f6bc6 100644
--- a/config/ChangeLog
+++ b/config/ChangeLog
@@ -1,3 +1,7 @@
+2016-08-03 Release Manager
+
+ * GCC 4.9.4 released.
+
2015-06-26 Release Manager
* GCC 4.9.3 released.
diff --git a/configure b/configure
index 2849e37eef2..e75aa20278e 100755
--- a/configure
+++ b/configure
@@ -6073,6 +6073,55 @@ $as_echo "$gcc_cv_isl" >&6; }
fi
+ if test "${gcc_cv_isl}" = no ; then
+
+ if test "${ENABLE_ISL_CHECK}" = yes ; then
+ _isl_saved_CFLAGS=$CFLAGS
+ _isl_saved_LDFLAGS=$LDFLAGS
+ _isl_saved_LIBS=$LIBS
+
+ CFLAGS="${_isl_saved_CFLAGS} ${islinc} ${gmpinc}"
+ LDFLAGS="${_isl_saved_LDFLAGS} ${isllibs}"
+ LIBS="${_isl_saved_LIBS} -lisl"
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for version 0.15 of ISL" >&5
+$as_echo_n "checking for version 0.15 of ISL... " >&6; }
+ if test "$cross_compiling" = yes; then :
+ gcc_cv_isl=yes
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <isl/version.h>
+ #include <string.h>
+int
+main ()
+{
+if (strncmp (isl_version (), "isl-0.15", strlen ("isl-0.15")) != 0)
+ return 1;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ gcc_cv_isl=yes
+else
+ gcc_cv_isl=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_isl" >&5
+$as_echo "$gcc_cv_isl" >&6; }
+
+ CFLAGS=$_isl_saved_CFLAGS
+ LDFLAGS=$_isl_saved_LDFLAGS
+ LIBS=$_isl_saved_LIBS
+ fi
+
+
+ fi
fi
fi
fi
diff --git a/configure.ac b/configure.ac
index 96824c605c0..398ca0e61c5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1661,6 +1661,9 @@ if test "x$with_isl" != "xno" &&
ISL_CHECK_VERSION(0,12)
if test "${gcc_cv_isl}" = no ; then
ISL_CHECK_VERSION(0,14)
+ if test "${gcc_cv_isl}" = no ; then
+ ISL_CHECK_VERSION(0,15)
+ fi
fi
fi
fi
diff --git a/contrib/ChangeLog b/contrib/ChangeLog
index d220728e8ce..37003c7cbe3 100644
--- a/contrib/ChangeLog
+++ b/contrib/ChangeLog
@@ -1,3 +1,7 @@
+2016-08-03 Release Manager
+
+ * GCC 4.9.4 released.
+
2015-09-11 Markus Trippelsdorf <markus@trippelsdorf.de>
* download_prerequisites: Make sure that script is run from
diff --git a/contrib/reghunt/ChangeLog b/contrib/reghunt/ChangeLog
index 7d9ae3fc7b9..2138388d775 100644
--- a/contrib/reghunt/ChangeLog
+++ b/contrib/reghunt/ChangeLog
@@ -1,3 +1,7 @@
+2016-08-03 Release Manager
+
+ * GCC 4.9.4 released.
+
2015-06-26 Release Manager
* GCC 4.9.3 released.
diff --git a/contrib/regression/ChangeLog b/contrib/regression/ChangeLog
index 8a4ddbcc0da..7ce3a942a76 100644
--- a/contrib/regression/ChangeLog
+++ b/contrib/regression/ChangeLog
@@ -1,3 +1,7 @@
+2016-08-03 Release Manager
+
+ * GCC 4.9.4 released.
+
2015-06-26 Release Manager
* GCC 4.9.3 released.
diff --git a/fixincludes/ChangeLog b/fixincludes/ChangeLog
index f98e3694a98..1b9b59b700c 100644
--- a/fixincludes/ChangeLog
+++ b/fixincludes/ChangeLog
@@ -1,3 +1,14 @@
+2016-08-03 Release Manager
+
+ * GCC 4.9.4 released.
+
+2016-02-01 John David Anglin <danglin@gcc.gnu.org>
+
+ PR target/68741
+ * inclhack.def (hpux_vsscanf): New fix.
+ * fixincl.x: Regenerated.
+ * tests/base/stdio.h [HPUX_VSSCANF_CHECK]: New test.
+
2015-06-26 Release Manager
* GCC 4.9.3 released.
diff --git a/fixincludes/fixincl.x b/fixincludes/fixincl.x
index 10b4061f30a..88a0f3f125f 100644
--- a/fixincludes/fixincl.x
+++ b/fixincludes/fixincl.x
@@ -1,12 +1,12 @@
/* -*- buffer-read-only: t -*- vi: set ro:
- *
+ *
* DO NOT EDIT THIS FILE (fixincl.x)
- *
- * It has been AutoGen-ed December 8, 2013 at 12:24:14 PM by AutoGen 5.18.2
+ *
+ * It has been AutoGen-ed Monday February 1, 2016 at 03:26:15 PM EST
* From the definitions inclhack.def
* and the template file fixincl
*/
-/* DO NOT SVN-MERGE THIS FILE, EITHER Sun Dec 8 12:24:14 PST 2013
+/* DO NOT SVN-MERGE THIS FILE, EITHER Mon 1 Feb 2016 15:26:15 EST
*
* You must regenerate it. Use the ./genfixes script.
*
@@ -15,7 +15,7 @@
* certain ANSI-incompatible system header files which are fixed to work
* correctly with ANSI C and placed in a directory that GNU C will search.
*
- * This file contains 229 fixup descriptions.
+ * This file contains 230 fixup descriptions.
*
* See README for more information.
*
@@ -4119,6 +4119,43 @@ static const char* apzHpux11_VsnprintfPatch[] = {
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
+ * Description of Hpux_Vsscanf fix
+ */
+tSCC zHpux_VsscanfName[] =
+ "hpux_vsscanf";
+
+/*
+ * File name selection pattern
+ */
+tSCC zHpux_VsscanfList[] =
+ "stdio.h\0";
+/*
+ * Machine/OS name selection pattern
+ */
+tSCC* apzHpux_VsscanfMachs[] = {
+ "*-*-hpux*",
+ (const char*)NULL };
+
+/*
+ * content selection pattern - do fix if pattern found
+ */
+tSCC zHpux_VsscanfSelect0[] =
+ "(extern int vsscanf\\()char";
+
+#define HPUX_VSSCANF_TEST_CT 1
+static tTestDesc aHpux_VsscanfTests[] = {
+ { TT_EGREP, zHpux_VsscanfSelect0, (regex_t*)NULL }, };
+
+/*
+ * Fix Command Arguments for Hpux_Vsscanf
+ */
+static const char* apzHpux_VsscanfPatch[] = {
+ "format",
+ "%1const char",
+ (char*)NULL };
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * *
+ *
* Description of Hpux8_Bogus_Inlines fix
*/
tSCC zHpux8_Bogus_InlinesName[] =
@@ -9403,9 +9440,9 @@ static const char* apzX11_SprintfPatch[] = {
*
* List of all fixes
*/
-#define REGEX_COUNT 268
+#define REGEX_COUNT 269
#define MACH_LIST_SIZE_LIMIT 187
-#define FIX_COUNT 229
+#define FIX_COUNT 230
/*
* Enumerate the fixes
@@ -9506,6 +9543,7 @@ typedef enum {
HPUX11_SIZE_T_FIXIDX,
HPUX11_SNPRINTF_FIXIDX,
HPUX11_VSNPRINTF_FIXIDX,
+ HPUX_VSSCANF_FIXIDX,
HPUX8_BOGUS_INLINES_FIXIDX,
HPUX_C99_INTPTR_FIXIDX,
HPUX_C99_INTTYPES_FIXIDX,
@@ -10118,6 +10156,11 @@ tFixDesc fixDescList[ FIX_COUNT ] = {
HPUX11_VSNPRINTF_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
aHpux11_VsnprintfTests, apzHpux11_VsnprintfPatch, 0 },
+ { zHpux_VsscanfName, zHpux_VsscanfList,
+ apzHpux_VsscanfMachs,
+ HPUX_VSSCANF_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
+ aHpux_VsscanfTests, apzHpux_VsscanfPatch, 0 },
+
{ zHpux8_Bogus_InlinesName, zHpux8_Bogus_InlinesList,
apzHpux8_Bogus_InlinesMachs,
HPUX8_BOGUS_INLINES_TEST_CT, FD_MACH_ONLY,
diff --git a/fixincludes/inclhack.def b/fixincludes/inclhack.def
index 411300fb2e0..fc45a4c80a9 100644
--- a/fixincludes/inclhack.def
+++ b/fixincludes/inclhack.def
@@ -2186,6 +2186,20 @@ fix = {
};
/*
+ * Fix missing const in hpux vsscanf declaration
+ */
+fix = {
+ hackname = hpux_vsscanf;
+ mach = "*-*-hpux*";
+ files = stdio.h;
+ select = '(extern int vsscanf\()char';
+ c_fix = format;
+ c_fix_arg = "%1const char";
+
+ test_text = 'extern int vsscanf(char *, const char *, __va_list);';
+};
+
+/*
* get rid of bogus inline definitions in HP-UX 8.0
*/
fix = {
diff --git a/fixincludes/tests/base/stdio.h b/fixincludes/tests/base/stdio.h
index 975d0a52168..e2cbe5defe3 100644
--- a/fixincludes/tests/base/stdio.h
+++ b/fixincludes/tests/base/stdio.h
@@ -49,6 +49,11 @@ extern int vsnprintf(char *, _hpux_size_t, const char *, __gnuc_va_list);
#endif /* HPUX11_VSNPRINTF_CHECK */
+#if defined( HPUX_VSSCANF_CHECK )
+extern int vsscanf(const char *, const char *, __gnuc_va_list);
+#endif /* HPUX_VSSCANF_CHECK */
+
+
#if defined( IRIX_STDIO_DUMMY_VA_LIST_CHECK )
extern int printf( const char *, __gnuc_va_list );
#endif /* IRIX_STDIO_DUMMY_VA_LIST_CHECK */
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index c61d95fe0ff..a71eb925363 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,1193 @@
+2016-08-03 Release Manager
+
+ * GCC 4.9.4 released.
+
+2016-08-01 Marek Polacek <polacek@redhat.com>
+
+ Backport from mainline
+ 2016-07-29 Marek Polacek <polacek@redhat.com>
+
+ PR c/7652
+ * config/rs6000/rs6000.c (altivec_expand_ld_builtin): Add break.
+ (altivec_expand_st_builtin): Likewise.
+ * config/i386/i386.c (ix86_expand_args_builtin): Likewise.
+ (ix86_expand_round_builtin): Likewise.
+
+2016-07-19 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/71874
+ * builtins.c (fold_builtin_memory_op): Use
+ get_addr_base_and_unit_offset instead of get_ref_base_and_extent.
+
+2016-07-19 Martin Jambor <mjambor@suse.cz>
+
+ PR fortran/71688
+ * trans-decl.c (gfc_generate_function_code): Use cgraph_get_create_node
+ rather than cgraph_create_node to get a call graph node.
+
+2016-07-19 Martin Liska <mliska@suse.cz>
+
+ Backported from mainline
+ 2016-03-15 Richard Henderson <rth@redhat.com>
+
+ * line-map.c (new_linemap): Make alloc_size a size_t.
+
+2016-07-19 Jakub Jelinek <jakub@redhat.com>
+
+ Backported from mainline
+ 2016-07-11 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/71758
+ * omp-low.c (expand_omp_target): Gimplify device.
+
+2016-07-18 Martin Liska <mliska@suse.cz>
+
+ Backported from mainline
+ 2016-07-12 Martin Liska <mliska@suse.cz>
+
+ PR rtl-optimization/71634
+ * ira-build.c (mark_loops_for_removal): Properly iterate
+ loops.
+
+2016-07-08 Martin Liska <mliska@suse.cz>
+
+ Backported from mainline
+ 2016-07-08 Martin Liska <mliska@suse.cz>
+
+ PR middle-end/71606
+ * fold-const.c (fold_convertible_p): As COMPLEX_TYPE
+ folding produces SAVE_EXPRs, thus return false for the type.
+
+2016-07-07 Jakub Jelinek <jakub@redhat.com>
+
+ Backported from mainline
+ 2016-06-28 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/71626
+ * config/i386/i386.c (ix86_expand_vector_move): For SUBREG of
+ a constant, force its SUBREG_REG into memory or register instead
+ of whole op1.
+
+ 2016-06-21 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/71588
+ * tree-ssa-strlen.c (valid_builtin_call): New function.
+ (adjust_last_stmt, strlen_optimize_stmt): Use it.
+
+ 2016-06-10 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/71494
+ * tree-nested.c (convert_nonlocal_reference_stmt): For GIMPLE_GOTO
+ without LABEL_DECL, set *handled_ops_p to false instead of true.
+
+ 2016-03-29 Jakub Jelinek <jakub@redhat.com>
+
+ PR rtl-optimization/70429
+ * combine.c (simplify_shift_const_1): For ASHIFTRT don't optimize
+ (cst1 >> count) >> cst2 into (cst1 >> cst2) >> count if
+ mode != result_mode.
+
+ 2016-03-15 Jakub Jelinek <jakub@redhat.com>
+
+ PR rtl-optimization/70222
+ * combine.c (simplify_shift_const_1): For A >> B >> C LSHIFTRT
+ optimization if mode is different from result_mode, queue up masking
+ of the result in outer_op. Formatting fix.
+
+ 2016-03-11 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/70169
+ * tree-ssa-loop.c (gen_lsm_tmp_name): Handle FUNCTION_DECL and
+ LABEL_DECL like VAR_DECL. Emit nothing instead of gcc_unreachable
+ for unknown codes.
+
+ 2016-03-09 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/70152
+ * tree-sra.c (replace_removed_params_ssa_names): Copy over
+ SSA_NAME_OCCURS_IN_ABNORMAL_PHI from old_name to new_name.
+
+ 2016-02-26 Jakub Jelinek <jakub@redhat.com>
+ Eric Botcazou <ebotcazou@adacore.com>
+
+ PR rtl-optimization/69891
+ * dse.c (scan_insn): If we can't figure out memset arguments
+ or they are non-constant, call clear_rhs_from_active_local_stores.
+
+ 2016-02-16 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/69802
+ * tree-ssa-reassoc.c (update_range_test): If op is
+ SSA_NAME_IS_DEFAULT_DEF, give up unless tem is a positive
+ op == 1 test of precision 1 integral op, otherwise handle
+ that case as op itself. Fix up formatting.
+ (optimize_range_tests_to_bit_test, optimize_range_tests): Fix
+ up formatting.
+
+ 2014-12-12 Richard Biener <rguenther@suse.de>
+
+ PR middle-end/64280
+ * tree-cfg.c (replace_uses_by): Guard assert properly.
+
+2016-07-07 Richard Biener <rguenther@suse.de>
+
+ Backport from mainline
+ 2016-04-04 Richard Biener <rguenther@suse.de>
+
+ PR rtl-optimization/70484
+ * rtl.h (canon_output_dependence): Declare.
+ * alias.c (canon_output_dependence): New function.
+ * dse.c (record_store): Use canon_output_dependence rather
+ than canon_true_dependence.
+
+ 2016-06-08 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/71452
+ * tree-ssa.c (non_rewritable_lvalue_p): Make sure that the
+ type used for the SSA rewrite has enough precision to cover
+ the dynamic type of the location.
+
+ 2016-05-06 Richard Biener <rguenther@suse.de>
+
+ PR middle-end/70931
+ * dwarf2out.c (native_encode_initializer): Skip zero-sized fields.
+
+ 2016-03-01 Richard Biener <rguenther@suse.de>
+
+ PR middle-end/70022
+ * fold-const.c (fold_indirect_ref_1): Fix range checking for
+ vector BIT_FIELD_REF extract.
+
+2016-06-30 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/71693
+ * fold-const.c (fold_binary_loc) <case RROTATE_EXPR>: Cast
+ TREE_OPERAND (arg0, 0) and TREE_OPERAND (arg0, 1) to type
+ first when permuting bitwise operation with rotate. Cast
+ TREE_OPERAND (arg0, 0) to type when cancelling two rotations.
+
+2016-06-21 Georg-Johann Lay <avr@gjlay.de>
+
+ Backport from 2016-06-21 trunk r237639.
+
+ PR target/30417
+ * config/avr/driver-avr.c (avr_device_to_data_start):
+ Wrap -Tdata into %{!Tdata:...}.
+
+2016-06-21 Georg-Johann Lay <avr@gjlay.de>
+
+ PR target/71103
+ * config/avr/avr.md (movqi): Only handle loading subreg:qi of
+ constant addresses if can_create_pseudo_p.
+
+2016-06-20 Georg-Johann Lay <avr@gjlay.de>
+ Pitchumani Sivanupandi <pitchumani.s@atmel.com>
+
+ Backport from 2016-06-20 trunk r237589, r236558.
+
+ PR target/71103
+ * config/avr/avr.md (movqi): Handle loading subreg:qi (const,
+ symbol_ref,label_ref).
+
+2016-06-16 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/71554
+ * config/i386/i386.md (setcc + movzbl peephole2): Use reg_set_p.
+ (setcc + and peephole2): Likewise.
+
+ Backported from mainline
+ 2015-04-29 Uros Bizjak <ubizjak@gmail.com>
+
+ * config/i386/i386.md (setcc+movzbl peephole2): Check also clobbered
+ reg.
+ (setcc+andl peephole2): Ditto.
+
+2016-06-13 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/71505
+ * tree-vect-data-refs.c (vect_analyze_data_ref_accesses): Make
+ assert match comment.
+
+2016-06-07 Peter Bergner <bergner@vnet.ibm.com>
+
+ Backport from mainline
+ 2016-06-07 Peter Bergner <bergner@vnet.ibm.com>
+
+ * doc/invoke.texi (RS/6000 and PowerPC Options): Document -mhtm and
+ -mno-htm.
+
+2016-06-07 Uros Bizjak <ubizjak@gmail.com>
+
+ PR target/71389
+ * config/i386/i386.c (ix86_avx256_split_vector_move_misalign):
+ Copy op1 RTX to avoid invalid sharing.
+ (ix86_expand_vector_move_misalign): Ditto.
+
+2016-06-05 Uros Bizjak <ubizjak@gmail.com>
+
+ Backport from mainline
+ 2016-06-01 Uros Bizjak <ubizjak@gmail.com>
+ Jocelyn Mayer <l_indien@magic.fr>
+
+ PR target/67310
+ * config/i386/driver-i386.c (host_detect_local_cpu): Correctly
+ detect processor family for signature_CENTAUR_ebx.
+ <case PROCESSOR_I486>: Pass c3, winchip2 or winchip-c6 for
+ signature_CENTAUR_ebx.
+ <case PROCESSOR _PENTIUMPRO>: Pass c3-2 for signature_CENTAUR_ebx.
+ <default>: Pass x86-64 for has_longmode.
+
+2016-05-22 Iain Sandoe <iain@codesourcery.com>
+ Dominique d'Humieres <dominiq@lps.ens.fr>
+
+ Backport from mainline
+ 2015-12-17 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ PR target/67973
+ * configure.ac (gcc_cv_as_stabs_directive): New test.
+ * configure: Regenerate.
+ * config.in: Regenerate.
+ * config/darwin.h (DBX_DEBUGGING_INFO): Wrap in
+ HAVE_AS_STABS_DIRECTIVE.
+ (PREFERRED_DEBUGGING_TYPE): Likewise.
+ * config/i386/darwin.h (PREFERRED_DEBUGGING_TYPE): Only include
+ DBX_DEBUG if HAVE_AS_STABS_DIRECTIVE.
+
+ * doc/sourcebuild.texi (Effective-Target Keywords, Environment
+ attributes): Document stabs.
+
+2016-05-20 Eric Botcazou <ebotcazou@adacore.com>
+
+ * config/arm/arm.c (arm_expand_prologue): Set the stack usage to 0
+ for naked functions.
+ (thumb1_expand_prologue): Likewise.
+
+2016-05-20 Uros Bizjak <ubizjak@gmail.com>
+
+ * sched-deps.c (sched_analyze_2) <case TRAP_IF>: Also
+ force pending loads from memory.
+
+2016-05-20 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
+
+ Backport from mainline
+ 2016-05-17 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
+
+ PR target/70809
+ * config/aarch64/aarch64-simd.md (aarch64_vmls<mode>): Delete.
+
+2016-05-19 Martin Jambor <mjambor@suse.cz>
+
+ PR ipa/70646
+ * ipa-prop.c (determine_locally_known_aggregate_parts): Bail out early
+ if parameter PARAM_IPA_MAX_AGG_ITEMS is zero.
+
+2016-05-19 Martin Jambor <mjambor@suse.cz>
+
+ PR ipa/70646
+ * ipa-inline.h (condition): New field size.
+ * ipa-inline-analysis.c (add_condition): New parameter SIZE, use it
+ for comaprison and store it into the new condition.
+ (evaluate_conditions_for_known_args): Use condition size to check
+ access sizes for all but CHANGED conditions.
+ (unmodified_parm_1): New parameter size_p, store access size into it.
+ (unmodified_parm): Likewise.
+ (unmodified_parm_or_parm_agg_item): Likewise.
+ (eliminated_by_inlining_prob): Pass NULL to unmodified_parm as size_p.
+ (set_cond_stmt_execution_predicate): Extract access sizes and store
+ them to conditions.
+ (set_switch_stmt_execution_predicate): Likewise.
+ (will_be_nonconstant_expr_predicate): Likewise.
+ (will_be_nonconstant_predicate): Likewise.
+ (inline_read_section): Stream condition size.
+ (inline_write_summary): Likewise.
+ * lto-streamer.h (LTO_minor_version): Bump.
+ * ipa-prop.c (ipa_load_from_parm_agg): Added size_p parameter, pass it
+ to ipa_load_from_parm_agg_1.
+ * ipa-prop.h (ipa_load_from_parm_agg): Update declaration.
+
+2016-05-18 Uros Bizjak <ubizjak@gmail.com>
+
+ PR target/71145
+ * config/alpha/alpha.md (trap): Add (use (reg:DI 29)).
+ (*exception_receiver_1): Return "#" for TARGET_EXPLICIT_RELOCS.
+
+2016-05-10 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
+
+ Backport from mainline
+ 2016-03-23 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
+
+ PR driver/70132
+ * config/arm/driver-arm.c (host_detect_local_cpu): Reorder exit logic
+ to not call fclose twice on file.
+
+2016-05-10 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
+
+ Backport from mainline
+ 2016-05-10 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
+
+ PR target/70963
+ * config/rs6000/vsx.md (vsx_xvcvdpsxds_scale): Generate correct
+ code for a zero scale factor.
+ (vsx_xvcvdpuxds_scale): Likewise.
+
+2016-05-09 Sebastian Huber <sebastian.huber@embedded-brains.de>
+
+ Backport from mainline
+ 2016-04-27 Sebastian Huber <sebastian.huber@embedded-brains.de>
+
+ * config/rtems.h (LIB_SPEC): Add -latomic.
+
+2016-05-09 Sebastian Huber <sebastian.huber@embedded-brains.de>
+
+ Backport from mainline
+ 2016-04-27 Joel Sherrill <joel@rtems.org>
+
+ * config/microblaze/rtems.h: Redefine LINK_SPEC to avoid
+ xilink.ld and flags not relevant to RTEMS.
+
+2016-04-28 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/70858
+ * config/i386/i386.c (bdesc_special_args): Add | OPTION_MASK_ISA_64BIT
+ to __builtin_ia32_lwpval64 and __builtin_ia32_lwpins64.
+ (bdesc_args): Add | OPTION_MASK_ISA_64BIT to __builtin_ia32_bextr_u64,
+ __builtin_ia32_bextri_u64, __builtin_ia32_bzhi_di,
+ __builtin_ia32_pdep_di and __builtin_ia32_pext_di.
+
+2016-04-27 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
+
+ Backport from mainline
+ 2016-04-25 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
+
+ * config/rs6000/rs6000-builtin.def: Correct pasto error for
+ stxvd2x and stxvw4x built-in functions.
+
+2016-04-25 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
+
+ Backport from mainline
+ 2016-03-14 Segher Boessenkool <segher@kernel.crashing.org>
+
+ PR target/70098
+ * config/rs6000/rs6000.md (*ctr<mode>_internal1, *ctr<mode>_internal2,
+ *ctr<mode>_internal5, *ctr<mode>_internal6): Also allow "d" as output.
+ (define_split for the GPR case): Use int_reg_operand instead of
+ gpc_reg_operand for the output.
+
+2016-04-21 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
+
+ Backport from mainline
+ 2016-04-20 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
+
+ PR target/70674
+ * config/s390/s390.c (s390_restore_gprs_from_fprs): Pick the new
+ stack_restore_from_fpr pattern when restoring r15.
+ (s390_optimize_prologue): Strip away the memory barrier in the
+ parallel when trying to get rid of restore insns.
+ * config/s390/s390.md ("stack_restore_from_fpr"): New insn
+ definition for loading the stack pointer from an FPR. Compared to
+ the normal move insn this pattern includes a full memory barrier.
+
+2016-04-13 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
+
+ Backport from mainline
+ 2016-04-08 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
+
+ PR target/70566
+ * config/arm/thumb2.md (tst + branch-> lsls + branch
+ peephole below *orsi_not_shiftsi_si): Require that condition
+ register is dead after the peephole.
+ (second peephole after the above): Likewise.
+
+2016-04-12 Eric Botcazou <ebotcazou@adacore.com>
+
+ PR target/70630
+ * config/sparc/sparc.c (sparc_compute_frame_size): Add parentheses.
+
+2016-04-11 Alan Modra <amodra@gmail.com>
+
+ PR target/70117
+ * builtins.c (fold_builtin_classify): For IBM extended precision,
+ look at just the high-order double to test for NaN.
+ (fold_builtin_interclass_mathfn): Similarly for Inf. For isnormal
+ test just the high double for Inf but both doubles for subnormal
+ limit.
+
+2016-04-05 John David Anglin <danglin@gcc.gnu.org>
+
+ * config/pa/predicates.md (integer_store_memory_operand): Accept
+ REG+D operands with a large offset when reload_in_progress is true.
+ (floating_point_store_memory_operand): Likewise.
+
+2016-04-05 Uros Bizjak <ubizjak@gmail.com>
+
+ PR target/70510
+ * config/i386/sse.md (iptr): Add V16SI and V8DI modes.
+
+2016-04-04 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
+ Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/70457
+ * tree-inline.c (estimate_num_insn): Use gimple_call_builtin_p
+ to ensure a call statement is compatible with a built-in's
+ prototype.
+ * tree-ssa-math-opts.c (execute_cse_sincos_1): Likewise.
+ (execute_cse_sincos): Likewise.
+ (execute_optimize_widening_mul): Likewise.
+
+2016-03-31 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
+
+ * config/arm/sync.md (arm_atomic_loaddi2_ldrd): Fix output template
+ for non-unified syntax.
+
+2016-03-31 Jakub Jelinek <jakub@redhat.com>
+
+ PR rtl-optimization/70460
+ * ira.c (indirect_jump_optimize): Don't substitute LABEL_REF
+ with operand from REG_LABEL_OPERAND, instead substitute
+ SET_SRC or REG_EQUAL note content if it is a LABEL_REF.
+ Don't do anything for REG_NON_LOCAL_GOTO jumps.
+
+2016-03-31 Alan Modra <amodra@gmail.com>
+
+ Backport from mainline
+ 2016-02-16 Alan Modra <amodra@gmail.com>
+ PR target/68973
+ * config/rs6000/rs6000.md (reload_vsx_from_gprsf): Rewrite splitter.
+ (p8_mtvsrd_df, p8_mtvsrd_sf): New.
+ (p8_mtvsrd_1, p8_mtvsrd_2): Delete.
+ (p8_mtvsrwz): New.
+ (p8_mtvsrwz_1, p8_mtvsrwz_2): Delete.
+ (p8_xxpermdi_<mode>): Take two DF inputs rather than one TF.
+ (p8_fmrgow_<mode>): Likewise.
+ (reload_vsx_from_gpr<mode>): Adjust for above. Use "wa" for
+ clobber constraint.
+ (reload_fpr_from_gpr<mode>): Adjust for above. Use "d" for
+ op0 constraint.
+ (reload_vsx_from_gprsf): Use p8_mtvsrd_sf rather than attempting
+ to use movdi_internal64. Remove op0_di.
+ * config/rs6000/vsx.md (vsx_xscvspdpn_directmove): Make op1 SFmode.
+
+2016-03-29 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
+
+ PR target/69875
+ * config/arm/arm.h (TARGET_HAVE_LPAE): Define.
+ * config/arm/unspecs.md (VUNSPEC_LDRD_ATOMIC): New value.
+ * config/arm/sync.md (arm_atomic_loaddi2_ldrd): New pattern.
+ (atomic_loaddi_1): Delete.
+ (atomic_loaddi): Rewrite expander using the above changes.
+
+2016-03-21 Uros Bizjak <ubizjak@gmail.com>
+
+ PR target/70327
+ * config/i386/i386.md (movxi): Use ix86_expand_vector_move instead
+ of ix86_expand_move.
+ (movoi): Ditto.
+ (movti): Use general_operand for operand 1 predicate.
+
+2016-03-21 Tom de Vries <tom@codesourcery.com>
+
+ backport from trunk:
+ 2016-03-18 Tom de Vries <tom@codesourcery.com>
+
+ PR ipa/70161
+ * passes.c (execute_one_ipa_transform_pass): Add missing argument to
+ execute_function_dump.
+
+2016-03-17 John David Anglin <danglin@gcc.gnu.org>
+
+ PR target/70188
+ * config/pa/constraints.md: Revert 2015-02-13 change. Use
+ define_constraint for "Q" and "T" constraints.
+
+2016-03-16 Alan Modra <amodra@gmail.com>
+
+ PR rtl-optimization/69195
+ PR rtl-optimization/47992
+ * ira.c (indirect_jump_optimize): Ignore artificial defs.
+ Add comments.
+
+2016-03-15 Bernd Schmidt <bschmidt@redhat.com>
+
+ Backport from mainline
+ 2016-03-04 Bernd Schmidt <bschmidt@redhat.com>
+
+ PR rtl-optimization/69941
+ * postreload.c (reload_combine_recognize_pattern): Ensure all uses of
+ the reg share its mode.
+
+2016-03-14 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ Backport from mainline:
+ 2016-03-07 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ PR target/62281
+ * config/i386/sol2.h (STACK_REALIGN_DEFAULT): Define.
+
+ Revert:
+ 2014-02-11 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ PR libgomp/60107
+ * config/i386/sol2-9.h: New file.
+ * config.gcc (i[34567]86-*-solaris2* | x86_64-*-solaris2.1[0-9]*,
+ *-*-solaris2.9*): Use it.
+
+2016-03-10 Alan Modra <amodra@gmail.com>
+
+ PR rtl-optimization/69195
+ PR rtl-optimization/47992
+ * ira.c (recorded_label_ref): Delete.
+ (update_equiv_regs): Return void.
+ (indirect_jump_optimize): New function.
+ (ira): Call indirect_jump_optimize and delete_trivially_dead_insns
+ before regstat_compute_ri. Don't rebuild_jump_labels here.
+
+2016-03-04 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/70059
+ * config/i386/sse.md (vec_set_lo_<mode><mask_name>,
+ <extract_type_2>_vinsert<shuffletype><extract_suf_2>_mask): Formatting
+ fixes.
+ (vec_set_hi_<mode><mask_name>): Likewise. Swap VEC_CONCAT operands.
+
+2016-03-01 Eric Botcazou <ebotcazou@adacore.com>
+
+ PR rtl-optimization/70007
+ * gcse.c (compute_ld_motion_mems): Tidy up and also invalidate memory
+ references present in REG_EQUAL notes attached to non-SET patterns.
+
+2016-02-17 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
+
+ Backport from mainline
+ 2016-02-17 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
+
+ * config/rs6000/altivec.md (*altivec_lvxl_<mode>_internal): Output
+ correct instruction.
+
+2016-02-17 Bernd Schmidt <bschmidt@redhat.com>
+
+ Backport from mainline
+ 2016-02-12 Bernd Schmidt <bschmidt@redhat.com>
+
+ PR c/69522
+ * c-parser.c (c_parser_braced_init): New arg outer_obstack. All
+ callers changed. If nested_p is true, use it to call
+ finish_implicit_inits.
+ * c-tree.h (finish_implicit_inits): Declare.
+ * c-typeck.c (finish_implicit_inits): New function. Move code
+ from ...
+ (push_init_level): ... here.
+ (set_designator, process_init_element): Call finish_implicit_inits.
+
+2016-02-16 Bernd Schmidt <bschmidt@redhat.com>
+
+ Backport from mainline
+ 2016-02-15 Bernd Schmidt <bschmidt@redhat.com>
+
+ PR rtl-optimization/69752
+ * ira.c (update_equiv_regs): When looking for more than a single SET,
+ also take other side effects into account.
+
+2016-02-16 Tom de Vries <tom@codesourcery.com>
+
+ backport from trunk:
+ PR lto/67709
+ 2016-02-16 Tom de Vries <tom@codesourcery.com>
+
+ * omp-low.c (simd_clone_create): Remove call to
+ symtab->call_cgraph_insertion_hooks.
+
+2016-02-16 Tom de Vries <tom@codesourcery.com>
+
+ backport from trunk:
+ 2015-10-21 Ilya Enkovich <enkovich.gnu@gmail.com>
+
+ * omp-low.c (simd_clone_create): Set in_other_partition
+ for created clones.
+
+2016-02-13 Oleg Endo <olegendo@gcc.gnu.org>
+
+ Backport from mainline
+ 2016-02-13 Oleg Endo <olegendo@gcc.gnu.org>
+
+ PR target/67260
+ * config/sh/sh.md (sibcall_value_pcrel): Replace =&k scratch reg with
+ fixed R1_REG scratch reg.
+
+2016-02-12 Richard Biener <rguenther@suse.de>
+
+ Backport from mainline
+ 2016-02-09 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/69715
+ * tree-ssa.c (execute_update_addresses_taken): Mark non-decl
+ LHS on calls as non-rewritable.
+
+ 2016-02-01 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/69579
+ * tree-ssa-loop-ivcanon.c (propagate_constants_for_unrolling):
+ Do not propagate through abnormal PHI results.
+
+ 2016-02-01 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/69574
+ * tree-chrec.c (hide_evolution_in_other_loops_than_loop): Instead
+ of asserting return chrec_dont_know.
+
+2016-02-11 Richard Biener <rguenther@suse.de>
+
+ Backport from mainline
+ 2016-01-18 Richard Biener <rguenther@suse.de>
+
+ PR middle-end/69308
+ * gimple.c (gimple_could_trap_p_1): Handle GIMPLE_COND.
+
+ 2015-02-18 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/62217
+ * tree-ssa-dom.c (cprop_operand): Avoid propagating copies
+ into BIVs.
+
+ 2015-06-18 Richard Biener <rguenther@suse.de>
+
+ Backport from mainline
+ 2015-06-03 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/66375
+ * tree-scalar-evolution.c (follow_ssa_edge_binary): First
+ add to the evolution before following SSA edges.
+
+ 2015-06-23 Richard Biener <rguenther@suse.de>
+
+ Backport from mainline
+ 2015-06-09 Richard Biener <rguenther@suse.de>
+
+ PR middle-end/66413
+ * tree-inline.c (insert_init_debug_bind): Unshare value.
+
+ 2015-07-08 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/66794
+ * gimple-ssa-isolate-paths.c (gimple_ssa_isolate_erroneous_paths):
+ Free post-dominators.
+
+ 2015-07-10 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/66823
+ * tree-if-conv.c (memrefs_read_or_written_unconditionally): Fix
+ inverted predicate.
+
+2016-02-11 Jakub Jelinek <jakub@redhat.com>
+
+ Backported from mainline
+ 2016-01-22 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/69432
+ * config/i386/i386.c (expand_small_movmem_or_setmem,
+ expand_set_or_movmem_prologue_epilogue_by_misaligned_moves): Spelling
+ fixes.
+ (ix86_expand_set_or_movmem): Call do_pending_stack_adjust () early
+ if dynamic_check != -1.
+
+ 2016-01-21 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/67653
+ * gimplify.c (gimplify_asm_expr): Warn if it is too late to
+ attempt to mark memory input operand addressable and
+ call prepare_gimple_addressable in that case. Don't adjust
+ input_location for diagnostics, use error_at instead.
+
+ 2016-01-19 Jakub Jelinek <jakub@redhat.com>
+
+ PR rtl-optimization/68955
+ PR rtl-optimization/64557
+ * dse.c (record_store, check_mem_read_rtx): Don't call get_addr
+ here. Fix up formatting.
+ * alias.c (get_addr): Handle VALUE +/- CONST_SCALAR_INT_P.
+
+ 2016-01-11 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/69214
+ * tree-vrp.c (simplify_cond_using_ranges): Don't propagate
+ innerop into a comparison if SSA_NAME_OCCURS_IN_ABNORMAL_PHI.
+ Formatting fix.
+
+2016-02-11 Oleg Endo <olegendo@gcc.gnu.org>
+
+ Backport from mainline
+ 2016-02-11 Oleg Endo <olegendo@gcc.gnu.org>
+
+ PR target/69713
+ * config/sh/sh.md (casesi_worker_0): Add T_REG use.
+
+2016-02-11 Jakub Jelinek <jakub@redhat.com>
+
+ Backported from mainline
+ 2016-01-07 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/68960
+ * gimple-expr.c (copy_var_decl): If var has DECL_USER_ALIGN set, copy
+ it and DECL_ALIGN too.
+
+ 2016-01-01 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/69015
+ * ifcvt.c (find_cond_trap): Give up if returnjump_p (jump).
+
+ 2015-12-10 Jakub Jelinek <jakub@redhat.com>
+
+ PR rtl-optimization/68376
+ PR rtl-optimization/68670
+ * ifcvt.c (noce_try_abs): For one_cmpl allow < 0, >= 0
+ or > -1 conditions regardless of negate, and disallow
+ all other conditions.
+
+ 2015-11-19 Jakub Jelinek <jakub@redhat.com>
+
+ PR rtl-optimization/68376
+ * ifcvt.c (noce_try_abs): Disable one_cmpl optimization if
+ encountering x <= 0 ? ~x : x or x > 0 ? ~x : x.
+
+ 2015-12-04 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/68680
+ * calls.c (special_function_p): Return ECF_MAY_BE_ALLOCA for
+ BUILT_IN_ALLOCA{,_WITH_ALIGN}. Don't check for __builtin_alloca
+ by name.
+
+ 2015-11-21 Jakub Jelinek <jakub@redhat.com>
+
+ PR debug/66432
+ * tree-inline.c (copy_debug_stmt): If
+ gimple_debug_source_bind_get_value is DECL_ORIGIN of a PARM_DECL
+ in decl_debug_args, don't call remap_gimple_op_r on it.
+
+ 2015-11-19 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/67770
+ * config/i386/i386.md (simple_return): Disable if
+ ix86_static_chain_on_stack is true.
+
+2016-02-04 Jakub Jelinek <jakub@redhat.com>
+
+ Backported from mainline
+ 2016-02-03 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/69644
+ * config/rs6000/rs6000.c (rs6000_expand_atomic_compare_and_swap):
+ Force oldval into register if it does not satisfy reg_or_short_operand
+ predicate. Fix up formatting.
+
+2016-02-02 Uros Bizjak <ubizjak@gmail.com>
+
+ PR target/67032
+ * config/i386/i386.c (geode_cost): Increase cost of MMX and SSE moves.
+
+2016-02-02 Alan Modra <amodra@gmail.com>
+
+ PR target/69548
+ * config/rs6000/predicates.md (quad_int_reg_operand): Don't
+ allow subregs.
+
+2016-01-29 Martin Jambor <mjambor@suse.cz>
+
+ PR tree-optimization/69355
+ * tree-sra.c (analyze_access_subtree): Correct hole detection when
+ total_scalarization fails.
+
+2016-01-29 Uros Bizjak <ubizjak@gmail.com>
+
+ Backport from mainline
+ 2016-01-29 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/69551
+ * config/i386/i386.c (ix86_expand_vector_set) <case V4SImode>: For
+ SSE1, copy target into the temporary reg first before recursing
+ on it.
+
+2016-01-29 Uros Bizjak <ubizjak@gmail.com>
+
+ PR target/69459
+ * config/i386/constraints.md (C): Only accept constant zero operand.
+ (BC): New constraint.
+ * config/i386/sse.md (*mov<mode>_internal): Use BC constraint
+ instead of C constraint.
+ * doc/md.texi (Machine Constraints): Update description
+ of C constraint.
+
+2016-01-26 Tom de Vries <tom@codesourcery.com>
+
+ PR tree-optimization/69110
+ * tree-data-ref.c (initialize_data_dependence_relation): Handle
+ DR_NUM_DIMENSIONS == 0.
+
+2016-01-25 Tom de Vries <tom@codesourcery.com>
+
+ backport from trunk:
+ PR tree-optimization/PR64091
+ 2014-11-27 Richard Biener <rguenther@suse.de>
+
+ * tree-ssa-tail-merge.c (update_debug_stmt): After resetting
+ the stmt break from the loop over use operands.
+
+2016-01-22 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
+
+ Backport from mainline
+ 2016-01-22 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
+
+ PR target/69403
+ * config/arm/thumb2.md (*thumb2_ior_scc_strict_it): Convert to
+ define_insn_and_split. Ensure operands[1] and operands[0] do not
+ get assigned the same register.
+
+2016-01-22 Bernd Schmidt <bschmidt@redhat.com>
+
+ PR target/63681
+ * cfgrtl.c (cfg_layout_initialize): Weaken assert to only trigger if
+ flag_reorder_blocks_and_partition.
+ * hw-doloop.c (reorg_loops): Avoid reordering if that flag is set.
+
+2016-01-21 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
+
+ Backported from mainline
+ 2015-07-24 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
+
+ * config/s390/s390.c (s390_save_gprs_to_fprs): Add CFA_REGISTER
+ reg note to the GPR -> FPR save instructions.
+
+2016-01-20 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
+
+ Backport from mainline
+ 2015-09-10 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
+
+ PR target/67439
+ * config/arm/arm.md (*arm32_movhf): Remove !arm_restrict_it from
+ predicate. Set predicable_short_it attr to "no".
+
+2016-01-19 Sergei Trofimovich <siarheit@google.com>
+
+ Backport from mainline
+ PR other/60465
+ * config/ia64/ia64.c (ia64_expand_load_address): Use gprel64
+ for local symbolic operands.
+ * config/ia64/predicates.md (local_symbolic_operand64): New
+ predicate.
+
+2016-01-17 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
+
+ Backport from mainline:
+ 2016-01-17 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
+
+ PR tree-optimization/68799
+ * gimple-ssa-strength-reduction.c (create_phi_basis): Directly
+ look up phi candidates in the statement-candidate map.
+ (phi_add_costs): Likewise.
+ (record_phi_increments): Likewise.
+ (phi_incr_cost): Likewise.
+ (ncd_with_phi): Likewise.
+ (all_phi_incrs_profitable): Likewise.
+
+2016-01-14 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
+
+ PR target/68648
+ * config/arm/arm.md (*andsi_iorsi3_notsi): Try to simplify
+ the complement of operands[3] during splitting.
+
+2016-01-12 Jeff Law <law@redhat.com>
+
+ PR target/63347
+ * haifa-sched.c (prune_ready_list): If we have a SCHED_GROUP_P insn
+ that needs to be queued, just queue it for a single cycle.
+
+2016-01-12 Renlin Li <renlin.li@arm.com>
+
+ PR target/69082
+ Backport from mainline.
+ 2015-08-24 Renlin Li <renlin.li@arm.com>
+
+ * config/arm/arm-protos.h (arm_valid_symbolic_address_p): Declare.
+ * config/arm/arm.c (arm_valid_symbolic_address_p): Define.
+ * config/arm/arm.md (arm_movt): Use arm_valid_symbolic_address_p.
+ * config/arm/constraints.md ("j"): Add check for high code.
+
+2016-01-12 James Greenhalgh <james.greenhalgh@arm.com>
+
+ Backport from mainline.
+ 2015-12-09 James Greenhalgh <james.greenhalgh@arm.com>
+
+ PR rtl-optimization/67609
+ * config/aarch64/aarch64.c
+ (aarch64_cannot_change_mode_class): Don't permit word_mode
+ subregs of full vector modes.
+ * config/aarch64/aarch64.md (aarch64_movdi_<mode>low): Use
+ zero_extract rather than truncate.
+ (aarch64_movdi_<mode>high): Likewise.
+
+2016-01-11 John David Anglin <danglin@gcc.gnu.org>
+
+ * config/pa/pa.c (pa_emit_move_sequence): Handle floating point
+ reloads for other unsupported memory operands.
+
+2016-01-11 Martin Jambor <mjambor@suse.cz>
+
+ PR ipa/66616
+ * ipa-cp.c (propagate_constants_accross_call): Move thuk check...
+ (call_passes_through_thunk_p): ...here.
+ (find_more_scalar_values_for_callers_subset): Perform thunk checks
+ like propagate_constants_accross_call does.
+ * cgraphclones.c (duplicate_thunk_for_node): Copy can_change_signature
+ flag from the node to the new flag.
+
+2016-01-08 Martin Jambor <mjambor@suse.cz>
+
+ Backport from mainline
+ 2015-12-15 Martin Jambor <mjambor@suse.cz>
+
+ PR ipa/68851
+ * cgraph.c (collect_callers_of_node_1): Do not collect thunks.
+ (collect_callers): Change comment.
+
+2015-12-25 Andreas Tobler <andreast@gcc.gnu.org>
+
+ Backport from mainline
+ 2015-12-25 Andreas Tobler <andreast@gcc.gnu.org>
+
+ * config/rs6000/freebsd64.h: Delete FREEBSD_DYNAMIC_LINKER32/64
+ defines. Use FBSD_DYNAMIC_LINKER instead.
+ Rename and simplify LINK_OS_FREEBSD_SPEC_DEF32/64 to
+ LINK_OS_FREEBSD_SPEC_DEF.
+
+2015-12-22 Peter Bergner <bergner@vnet.ibm.com>
+
+ Backport from mainline
+ PR target/68872
+ * config/rs6000/rs6000.h (ASM_CPU_SPEC): For -mcpu=powerpc64le,
+ pass %(asm_cpu_power8).
+
+2015-12-18 John David Anglin <danglin@gcc.gnu.org>
+
+ PR target/68729
+ * config/pa/pa.c (pa_emit_move_sequence): Reorganize handling of
+ floating-point reloads. Only reload operands that are not valid
+ floating-point memory operands.
+
+2015-12-17 John David Anglin <danglin@gcc.gnu.org>
+
+ PR target/68779
+ * config/pa/pa.md (atomic_loaddi): Honor -mdisable-fpregs.
+ (atomic_loaddi_1): Likewise.
+ (atomic_storedi): Likewise.
+ (atomic_storedi_1): Likewise.
+ Move all atomic patterns to end of file.
+
+2015-12-09 Andreas Tobler <andreast@gcc.gnu.org>
+
+ Backport from mainline
+ 2015-12-09 Andreas Tobler <andreast@gcc.gnu.org>
+
+ * config/rs6000/freebsd64.h: Remove the redefinition of WCHAR_TYPE.
+
+2015-12-10 Jeff Law <law@redhat.com>
+
+ PR tree-optimization/61515
+ PR tree-optimization/46590
+ Backport from mainline.
+ * tree-ssa-threadedge.c (invalidate_equivalences): Walk the unwinding
+ stack rather than looking at every SSA_NAME's value.
+
+2015-12-10 Uros Bizjak <ubizjak@gmail.com>
+
+ Backport from mainline
+ 2015-12-08 Uros Bizjak <ubizjak@gmail.com>
+
+ PR target/68701
+ * config/i386/i386.c (ix86_option_override_internal): Enable
+ -maccumulate-outgoing-args when %ebp is fixed due to stack
+ realignment requirements.
+
+2015-12-09 John David Anglin <danglin@gcc.gnu.org>
+
+ PR target/68729
+ * config/pa/pa.c (pa_emit_move_sequence): Don't check that mode is
+ consistent with modes of the input and output operands when doing
+ reloads to and from floating point registers. Do reload for all
+ address forms.
+
+2015-12-08 Maxim Ostapenko <m.ostapenko@partner.samsung.com>
+
+ Backport from mainline.
+ 2015-03-16 Max Ostapenko <m.ostapenko@partner.samsung.com>
+
+ PR sanitizer/64820
+ * cfgexpand.c (align_base): New function.
+ (alloc_stack_frame_space): Call it.
+ (expand_stack_vars): Align prev_frame to be sure
+ data->asan_vec elements aligned properly.
+
+2015-12-04 Andreas Tobler <andreast@gcc.gnu.org>
+
+ Backport from mainline
+ 2015-12-01 Andreas Tobler <andreast@gcc.gnu.org>
+
+ * config/rs6000/freebsd64.h (ELFv2_ABI_CHECK): Add new macro.
+ (SUBSUBTARGET_OVERRIDE_OPTIONS): Use it to decide whether to set
+ rs6000_current_abi to ABI_AIX or ABI_ELFv2.
+
+2015-12-02 Renlin Li <renlin.li@arm.com>
+
+ Backport from mainline.
+ 2014-04-22 Ramana Radhakrishnan <ramana.radhakrishnan@arm.com>
+
+ * config/arm/arm.c (arm_hard_regno_mode_ok): Loosen
+ restrictions on core registers for DImode values in Thumb2.
+
+2015-11-25 Vladimir Makarov <vmakarov@redhat.com>
+
+ PR rtl-optimization/67954
+ * lra-constraints.c (curr_insn_transform): Add check on scratch
+ pseudo when change class to NO_REGS. Add an assert.
+
+2015-11-26 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
+
+ Backport from mainline
+ 2015-11-26 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
+ Bernd Schmidt <bschmidt@redhat.com>
+
+ PR rtl-optimization/67226
+ * calls.c (store_one_arg): Take into account
+ crtl->args.pretend_args_size when checking for overlap between
+ arg->value and argblock + arg->locate.offset during sibcall
+ optimization.
+
+2015-11-24 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
+
+ Backport from mainline
+ 2015-11-24 Bernd Schmidt <bschmidt@redhat.com>
+ Kyrylo Tkachov <kyrylo.tkachov@arm.com>
+
+ PR rtl-optimization/68194
+ PR rtl-optimization/68328
+ PR rtl-optimization/68185
+ * ree.c (combine_reaching_defs): Reject copy_needed case if
+ copies_list is not empty.
+
+2015-11-23 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
+
+ Backport from mainline
+ 2015-11-23 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
+
+ PR target/68363
+ * config/aarch64/aarch64.c (aarch64_madd_needs_nop): Reject arguments
+ that are not INSN_P.
+
+2015-11-19 Matthias Klose <doko@ubuntu.com>
+
+ Backport from the gcc-5-branch
+
+ 2015-07-21 Mike Frysinger <vapier@gentoo.org>
+ Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
+
+ * configure.ac: Add check for new options in isl-0.15.
+ * config.in, configure: Rebuilt.
+ * graphite-blocking.c: Include <isl/constraint.h>
+ * graphite-interchange.c, graphite-poly.c: Likewise.
+ * graphhite-scop-detection.c, graphite-sese-to-poly.c: Likewise.
+ * graphite.c, graphite-poly.c: Likewise.
+ * graphite-dependences.c: Include <isl/constraint.h>.
+ (max_number_of_out_dimensions): Returns isl_stat.
+ (extend_schedule_1): Likewise
+ (extend_schedule): Corresponding changes.
+ * graphite-optimize-isl.c: Include <isl/constraint.h> and
+ <isl/union_set.h>.
+ (getSingleMap): Change return type of isl_stat.
+ (optimize_isl): Conditionally use
+ isl_options_set_schedule_serialize_sccs.
+ * graphite-poly.h (isl_stat, isl_stat_ok): Define fallbacks
+ if not HAVE_ISL_OPTIONS_SET_SCHEDULE_SERIALIZE_SCCS.
+
+2015-11-19 Eric Botcazou <ebotcazou@adacore.com>
+
+ PR lto/61313
+ * configure.ac (PLUGIN_LD_SUFFIX): Do not touch the value specified
+ by the user.
+ * configure: Regenerate.
+
+2015-11-19 Eric Botcazou <ebotcazou@adacore.com>
+
+ PR target/68408
+ * config/sparc/sp-elf.h (CTORS_SECTION_ASM_OP): Undefine.
+ (DTORS_SECTION_ASM_OP): Likewise.
+
+2015-11-12 Eric Botcazou <ebotcazou@adacore.com>
+
+ PR target/67265
+ * config/i386/i386.c (ix86_adjust_stack_and_probe): Remove obsolete
+ assertion on the CFA register.
+
+2015-11-11 Andreas Tobler <andreast@gcc.gnu.org>
+
+ Backport from mainline
+ 2015-05-18 Andreas Tobler <andreast@gcc.gnu.org>
+
+ * config/freebsd-spec.h (FBSD_STARTFILE_SPEC): Add the bits to build
+ pie executables.
+ (FBSD_ENDFILE_SPEC): Likewise.
+ * config/i386/freebsd.h (STARTFILE_SPEC): Remove and use the one from
+ config/freebsd-spec.h.
+ (ENDFILE_SPEC): Likewise.
+
+ 2015-11-02 Andreas Tobler <andreast@gcc.gnu.org>
+
+ * config/rs6000/freebsd64.h (ASM_SPEC32): Adust spec to handle
+ PIE executables.
+
+ Backport from mainline
+ 2015-03-04 Andreas Tobler <andreast@gcc.gnu.org>
+
+ * config/rs6000/t-freebsd64: Remove 32-bit soft-float multilibs.
+
+2015-11-11 Eric Botcazou <ebotcazou@adacore.com>
+
+ PR target/67265
+ * ira.c (ira_setup_eliminable_regset): Do not necessarily create the
+ frame pointer for stack checking if non-call exceptions aren't used.
+ * config/i386/i386.c (ix86_finalize_stack_realign_flags): Likewise.
+
+2015-11-10 James Greenhalgh <james.greenhalgh@arm.com>
+
+ Partial backport from trunk r228751.
+ PR tree-optimization/68238
+ 2015-10-13 Richard Biener <rguenther@suse.de>
+
+ * tree-vect-loop.c (vect_estimate_min_profitable_iters): Use
+ LOOP_VINFO_COMP_ALIAS_DDRS to estimate alias versioning cost.
+
+2015-11-09 Eric Botcazou <ebotcazou@adacore.com>
+
+ PR target/57845
+ * config/sparc/sparc.c (sparc_function_value_1): In 32-bit mode, do
+ not promote the mode for aggregate types.
+
+2015-11-09 Renlin Li <renlin.li@arm.com>
+
+ Backport from mainline
+ 2014-09-12 Wilco Dijkstra <wilco.dijkstra@arm.com>
+
+ * ree.c (combine_reaching_defs): Ensure inserted copy don't change
+ the number of hard registers.
+
+2015-11-02 Martin Jambor <mjambor@suse.cz>
+
+ Backport from mainline
+ 2015-10-09 Martin Jambor <mjambor@suse.cz>
+
+ PR tree-optimization/67794
+ * tree-sra.c (replace_removed_params_ssa_names): Do not distinguish
+ between types of statements but accept original definitions as a
+ parameter.
+ (ipa_sra_modify_function_body): Use FOR_EACH_SSA_DEF_OPERAND to
+ iterate over definitions.
+
2015-10-27 Caroline Tice <cmtice@google.com>
(from Richard Biener)
@@ -382,7 +1572,7 @@
2015-07-01 Ramana Radhakrishnan <ramana.radhakrishnan@arm.com>
Backport from mainline
- 2015-06-24 Ramana Radhakrishnan <ramana.radhakrishnan@arm.com>
+ 2015-06-24 Ramana Radhakrishnan <ramana.radhakrishnan@arm.com>
PR target/63408
* config/arm/arm.c (vfp3_const_double_for_fract_bits): Disable
@@ -446,8 +1636,8 @@
Backport from mainline r212178.
2014-06-30 Joseph Myers <joseph@codesourcery.com>
- * var-tracking.c (add_stores): Return instead of asserting if old
- and new values for conditional store are the same.
+ * var-tracking.c (add_stores): Return instead of asserting if old
+ and new values for conditional store are the same.
2015-06-23 Ludovic Courtès <ludo@gnu.org>
@@ -1009,7 +2199,7 @@
Backport from mainline r222205
2015-04-17 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
- Jakub Jelinek <jakub@redhat.com>
+ Jakub Jelinek <jakub@redhat.com>
PR target/65787
* config/rs6000/rs6000.c (rtx_is_swappable_p): Ensure that a
diff --git a/gcc/DATESTAMP b/gcc/DATESTAMP
index 9303e045283..94783ba8168 100644
--- a/gcc/DATESTAMP
+++ b/gcc/DATESTAMP
@@ -1 +1 @@
-20151028
+20160726
diff --git a/gcc/DEV-PHASE b/gcc/DEV-PHASE
index 373fbc60bb9..e69de29bb2d 100644
--- a/gcc/DEV-PHASE
+++ b/gcc/DEV-PHASE
@@ -1 +0,0 @@
-prerelease
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 374a2a27146..745f6acb8d6 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,56 @@
+2016-08-03 Release Manager
+
+ * GCC 4.9.4 released.
+
+2016-04-28 Eric Botcazou <ebotcazou@adacore.com>
+
+ PR ada/70786
+ * a-textio.adb (Get_Immediate): Add missing 'not' in expression.
+
+2015-12-06 Eric Botcazou <ebotcazou@adacore.com>
+
+ PR ada/56274
+ * s-osinte-kfreebsd-gnu.ads (pthread_rwlock_t): New subtype.
+ (pthread_rwlockattr_t): Likewise.
+
+2015-12-06 Ludovic Brenta <ludovic@ludovic-brenta.org>
+
+ PR ada/49944
+ * s-osinte-freebsd.ads: Minor reformatting.
+ (Stack_Base_Available): Correct comments.
+ * s-osinte-kfreebsd-gnu.ads (Time_Slice_Supported, nanosleep,
+ clock_id_t, clock_gettime, Stack_Base_Available, Get_Page_Size,
+ mprotect, pthread_mutexattr_setprotocol,pthread_mutexattr_getprotocol
+ pthread_mutexattr_setprioceiling, pthread_mutexattr_getprioceiling,
+ pthread_attr_setscope, pthread_attr_getscope,
+ pthread_attr_setinheritsched, pthread_attr_getinheritsched,
+ Time_Slice_Supported): Copy from s-osinte-freebsd.ads.
+ * gcc-interface/Makefile.in (x86/kfreebsd): Use the POSIX version of
+ the System.Task_Primitives.Operations package.
+
+2015-12-06 Ludovic Brenta <ludovic@ludovic-brenta.org>
+
+ PR ada/49940
+ * s-osinte-kfreebsd-gnu.ads (lwp_self): New imported function.
+
+2015-12-01 Jan Sommer <soja-lists@aries.uberspace.de>
+
+ PR ada/68169
+ * s-oscons-tmplt.c: Generate pthread constants for RTEMS
+ * s-osinte-rtems.ads: Declare pthread structs as opaque types in Ada
+
+2015-11-29 Matthias Klose <doko@ubuntu.com>
+
+ PR ada/68564
+ * gcc-interface/Makefile.in: Fix powerpc/powerpc64* and
+ mipsel/mips64el bitness detection.
+ Merge the mipsel/mips64el definitions into one.
+
+2015-11-28 Matthias Klose <doko@ubuntu.com>
+
+ PR ada/68564
+ * gcc-interface/Makefile.in: Fix sparc/sparc64 bitness detection.
+
2015-10-09 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/Make-lang.in: Make sure that GNAT1_OBJS and not just
diff --git a/gcc/ada/a-textio.adb b/gcc/ada/a-textio.adb
index f28711e57f2..cd33cf9aa04 100644
--- a/gcc/ada/a-textio.adb
+++ b/gcc/ada/a-textio.adb
@@ -668,7 +668,7 @@ package body Ada.Text_IO is
Available := True;
Item :=
- (if Is_Start_Of_Encoding (Character'Val (ch), File.WC_Method)
+ (if not Is_Start_Of_Encoding (Character'Val (ch), File.WC_Method)
then Character'Val (ch)
else Get_Upper_Half_Char_Immed (Character'Val (ch), File));
end if;
diff --git a/gcc/ada/gcc-interface/Makefile.in b/gcc/ada/gcc-interface/Makefile.in
index e2cc4a9e0ec..0425423c84a 100644
--- a/gcc/ada/gcc-interface/Makefile.in
+++ b/gcc/ada/gcc-interface/Makefile.in
@@ -1275,9 +1275,7 @@ ifeq ($(strip $(filter-out %86 kfreebsd%,$(target_cpu) $(target_os))),)
s-osinte.adb<s-osinte-posix.adb \
s-osinte.ads<s-osinte-kfreebsd-gnu.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-taprop.adb<s-taprop-posix.adb \
s-taspri.ads<s-taspri-posix.ads \
s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
$(ATOMICS_TARGET_PAIRS) \
@@ -1308,9 +1306,7 @@ ifeq ($(strip $(filter-out x86_64 kfreebsd%,$(target_cpu) $(target_os))),)
s-osinte.adb<s-osinte-posix.adb \
s-osinte.ads<s-osinte-kfreebsd-gnu.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-taprop.adb<s-taprop-posix.adb \
s-taspri.ads<s-taspri-posix.ads \
s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
system.ads<system-freebsd-x86_64.ads
@@ -1797,51 +1793,8 @@ ifeq ($(strip $(filter-out mips linux%,$(target_cpu) $(target_os))),)
LIBRARY_VERSION := $(LIB_VERSION)
endif
-# Mips/el Linux
-ifeq ($(strip $(filter-out mipsel linux%,$(target_cpu) $(target_os))),)
- LIBGNAT_TARGET_PAIRS_COMMON = \
- 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-mipsel.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-noaltstack.ads \
- s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
- g-sercom.adb<g-sercom-linux.adb
-
- LIBGNAT_TARGET_PAIRS_32 = \
- system.ads<system-linux-mipsel.ads
-
- LIBGNAT_TARGET_PAIRS_64 = \
- system.ads<system-linux-mips64el.ads
-
- ifeq ($(strip $(shell $(GCC_FOR_TARGET) $(GNATLIBCFLAGS) -print-multi-os-directory)),../lib64)
- LIBGNAT_TARGET_PAIRS = \
- $(LIBGNAT_TARGET_PAIRS_COMMON) $(LIBGNAT_TARGET_PAIRS_64)
- else
- LIBGNAT_TARGET_PAIRS = \
- $(LIBGNAT_TARGET_PAIRS_COMMON) $(LIBGNAT_TARGET_PAIRS_32)
- endif
-
- TOOLS_TARGET_PAIRS = \
- mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb \
- indepsw.adb<indepsw-gnu.adb
-
- EXTRA_GNATRTL_TASKING_OBJS=s-linux.o
- EH_MECHANISM=-gcc
- THREADSLIB = -lpthread
- GNATLIB_SHARED = gnatlib-shared-dual
- GMEM_LIB = gmemlib
- LIBRARY_VERSION := $(LIB_VERSION)
-endif
-
-# Mips64/el Linux
-ifeq ($(strip $(filter-out mips64el linux%,$(target_cpu) $(target_os))),)
+# Mips/el and Mips64/el Linux
+ifeq ($(strip $(filter-out mipsel mips64el linux%,$(target_cpu) $(target_os))),)
LIBGNAT_TARGET_PAIRS_COMMON = \
a-intnam.ads<a-intnam-linux.ads \
s-inmaop.adb<s-inmaop-posix.adb \
@@ -1863,7 +1816,7 @@ ifeq ($(strip $(filter-out mips64el linux%,$(target_cpu) $(target_os))),)
LIBGNAT_TARGET_PAIRS_64 = \
system.ads<system-linux-mips64el.ads
- ifeq ($(strip $(shell $(GCC_FOR_TARGET) $(GNATLIBCFLAGS) -print-multi-os-directory)),../lib64)
+ ifneq (,$(or $(filter mips64el%, $(shell $(GCC_FOR_TARGET) $(GNATLIBCFLAGS) -print-multiarch)), $(filter ../lib64, $(shell $(GCC_FOR_TARGET) $(GNATLIBCFLAGS) -print-multi-os-directory))))
LIBGNAT_TARGET_PAIRS = \
$(LIBGNAT_TARGET_PAIRS_COMMON) $(LIBGNAT_TARGET_PAIRS_64)
else
@@ -1917,7 +1870,7 @@ ifeq ($(strip $(filter-out powerpc% linux%,$(target_cpu) $(target_os))),)
LIBGNAT_TARGET_PAIRS_64 = \
system.ads<system-linux-ppc64.ads
- ifeq ($(strip $(shell $(GCC_FOR_TARGET) $(GNATLIBCFLAGS) -print-multi-os-directory)),../lib64)
+ ifneq (,$(or $(filter powerpc64%, $(shell $(GCC_FOR_TARGET) $(GNATLIBCFLAGS) -print-multiarch)), $(filter ../lib64, $(shell $(GCC_FOR_TARGET) $(GNATLIBCFLAGS) -print-multi-os-directory))))
LIBGNAT_TARGET_PAIRS = \
$(LIBGNAT_TARGET_PAIRS_COMMON) $(LIBGNAT_TARGET_PAIRS_64)
else
@@ -2048,7 +2001,7 @@ ifeq ($(strip $(filter-out sparc% linux%,$(target_cpu) $(target_os))),)
LIBGNAT_TARGET_PAIRS_64 = \
system.ads<system-linux-sparcv9.ads
- ifeq ($(strip $(shell $(GCC_FOR_TARGET) $(GNATLIBCFLAGS) -print-multi-os-directory)),../lib64)
+ ifneq (,$(or $(filter sparc64-linux-gnu, $(shell $(GCC_FOR_TARGET) $(GNATLIBCFLAGS) -print-multiarch)), $(filter ../lib64, $(shell $(GCC_FOR_TARGET) $(GNATLIBCFLAGS) -print-multi-os-directory))))
LIBGNAT_TARGET_PAIRS = \
$(LIBGNAT_TARGET_PAIRS_COMMON) $(LIBGNAT_TARGET_PAIRS_64)
else
diff --git a/gcc/ada/s-oscons-tmplt.c b/gcc/ada/s-oscons-tmplt.c
index 5a034d58457..1fc357e497f 100644
--- a/gcc/ada/s-oscons-tmplt.c
+++ b/gcc/ada/s-oscons-tmplt.c
@@ -154,7 +154,7 @@ pragma Style_Checks ("M32766");
# include <_types.h>
#endif
-#ifdef __linux__
+#if defined (__linux__) || defined (__rtems__)
# include <pthread.h>
# include <signal.h>
#endif
@@ -1441,7 +1441,8 @@ CND(CLOCK_THREAD_CPUTIME_ID, "Thread CPU clock")
CNS(CLOCK_RT_Ada, "")
#endif
-#if defined (__APPLE__) || defined (__linux__) || defined (DUMMY)
+#if defined (__APPLE__) || defined (__linux__) || defined (__rtems__) || \
+ defined (DUMMY)
/*
-- Sizes of pthread data types
@@ -1484,7 +1485,7 @@ CND(PTHREAD_RWLOCKATTR_SIZE, "pthread_rwlockattr_t")
CND(PTHREAD_RWLOCK_SIZE, "pthread_rwlock_t")
CND(PTHREAD_ONCE_SIZE, "pthread_once_t")
-#endif /* __APPLE__ || __linux__ */
+#endif /* __APPLE__ || __linux__ || __rtems__*/
/*
diff --git a/gcc/ada/s-osinte-freebsd.ads b/gcc/ada/s-osinte-freebsd.ads
index b581dae2e20..2a7ee54176a 100644
--- a/gcc/ada/s-osinte-freebsd.ads
+++ b/gcc/ada/s-osinte-freebsd.ads
@@ -31,7 +31,7 @@
-- --
------------------------------------------------------------------------------
--- This is the FreeBSD PTHREADS version of this package
+-- This is the FreeBSD (POSIX Threads) version of this package
-- This package encapsulates all direct interfaces to OS services
-- that are needed by the tasking run-time (libgnarl).
@@ -197,7 +197,7 @@ package System.OS_Interface is
type timespec is private;
- function nanosleep (rqtp, rmtp : access timespec) return int;
+ function nanosleep (rqtp, rmtp : access timespec) return int;
pragma Import (C, nanosleep, "nanosleep");
type clockid_t is new int;
@@ -317,10 +317,7 @@ package System.OS_Interface is
-- 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 run time. Note that
- -- this value can only be true if pthread_t has a complete definition that
- -- corresponds exactly to the C header files.
+ -- Indicates whether the stack base is available on this target
function Get_Stack_Base (thread : pthread_t) return Address;
pragma Inline (Get_Stack_Base);
diff --git a/gcc/ada/s-osinte-kfreebsd-gnu.ads b/gcc/ada/s-osinte-kfreebsd-gnu.ads
index be46c2e531e..3f6ef9bb409 100644
--- a/gcc/ada/s-osinte-kfreebsd-gnu.ads
+++ b/gcc/ada/s-osinte-kfreebsd-gnu.ads
@@ -7,7 +7,7 @@
-- S p e c --
-- --
-- Copyright (C) 1991-1994, Florida State University --
--- Copyright (C) 1995-2014, Free Software Foundation, Inc. --
+-- Copyright (C) 1995-2015, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -30,7 +30,7 @@
-- --
------------------------------------------------------------------------------
--- This is the GNU/kFreeBSD (GNU/LinuxThreads) version of this package
+-- This is the GNU/kFreeBSD (POSIX Threads) version of this package
-- This package encapsulates all direct interfaces to OS services
-- that are needed by children of System.
@@ -198,8 +198,24 @@ package System.OS_Interface is
-- Time --
----------
+ Time_Slice_Supported : constant Boolean := True;
+ -- Indicates whether time slicing is supported (i.e SCHED_RR is supported)
+
type timespec is private;
+ function nanosleep (rqtp, rmtp : access timespec) return int;
+ pragma Import (C, nanosleep, "nanosleep");
+
+ type clockid_t is private;
+
+ CLOCK_REALTIME : constant clockid_t;
+
+ function clock_gettime
+ (clock_id : clockid_t;
+ tp : access timespec)
+ return int;
+ pragma Import (C, clock_gettime, "clock_gettime");
+
function To_Duration (TS : timespec) return Duration;
pragma Inline (To_Duration);
@@ -236,6 +252,16 @@ package System.OS_Interface is
function getpid return pid_t;
pragma Import (C, getpid, "getpid");
+ ---------
+ -- LWP --
+ ---------
+
+ function lwp_self return System.Address;
+ -- lwp_self does not exist on this thread library, revert to pthread_self
+ -- which is the closest approximation (with getpid). This function is
+ -- needed to share 7staprop.adb across POSIX-like targets.
+ pragma Import (C, lwp_self, "pthread_self");
+
-------------
-- Threads --
-------------
@@ -261,6 +287,18 @@ package System.OS_Interface is
type pthread_key_t is private;
PTHREAD_CREATE_DETACHED : constant := 1;
+ PTHREAD_CREATE_JOINABLE : constant := 0;
+
+ PTHREAD_SCOPE_PROCESS : constant := 0;
+ PTHREAD_SCOPE_SYSTEM : constant := 2;
+
+ -- Read/Write lock not supported on kfreebsd. To add support both types
+ -- pthread_rwlock_t and pthread_rwlockattr_t must properly be defined
+ -- with the associated routines pthread_rwlock_[init/destroy] and
+ -- pthread_rwlock_[rdlock/wrlock/unlock].
+
+ subtype pthread_rwlock_t is pthread_mutex_t;
+ subtype pthread_rwlockattr_t is pthread_mutexattr_t;
-----------
-- Stack --
@@ -284,9 +322,29 @@ package System.OS_Interface is
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
+
function Get_Stack_Base (thread : pthread_t) return Address;
pragma Inline (Get_Stack_Base);
- -- This is a dummy procedure to share some GNULLI files
+ -- returns the stack base of the specified thread. Only call this function
+ -- when Stack_Base_Available is True.
+
+ function Get_Page_Size return size_t;
+ function Get_Page_Size return Address;
+ pragma Import (C, Get_Page_Size, "getpagesize");
+ -- Returns the size of a page
+
+ PROT_NONE : constant := 0;
+ PROT_READ : constant := 1;
+ PROT_WRITE : constant := 2;
+ PROT_EXEC : constant := 4;
+ PROT_ALL : constant := PROT_READ + PROT_WRITE + PROT_EXEC;
+ PROT_ON : constant := PROT_NONE;
+ PROT_OFF : constant := PROT_ALL;
+
+ function mprotect (addr : Address; len : size_t; prot : int) return int;
+ pragma Import (C, mprotect);
---------------------------------------
-- Nonstandard Thread Initialization --
@@ -375,6 +433,36 @@ package System.OS_Interface is
-- POSIX.1c Section 13 --
--------------------------
+ PTHREAD_PRIO_NONE : constant := 0;
+ PTHREAD_PRIO_PROTECT : constant := 2;
+ PTHREAD_PRIO_INHERIT : constant := 1;
+
+ function pthread_mutexattr_setprotocol
+ (attr : access pthread_mutexattr_t;
+ protocol : int) return int;
+ pragma Import
+ (C, pthread_mutexattr_setprotocol, "pthread_mutexattr_setprotocol");
+
+ function pthread_mutexattr_getprotocol
+ (attr : access pthread_mutexattr_t;
+ protocol : access int) return int;
+ pragma Import
+ (C, pthread_mutexattr_getprotocol, "pthread_mutexattr_getprotocol");
+
+ function pthread_mutexattr_setprioceiling
+ (attr : access pthread_mutexattr_t;
+ prioceiling : int) return int;
+ pragma Import
+ (C, pthread_mutexattr_setprioceiling,
+ "pthread_mutexattr_setprioceiling");
+
+ function pthread_mutexattr_getprioceiling
+ (attr : access pthread_mutexattr_t;
+ prioceiling : access int) return int;
+ pragma Import
+ (C, pthread_mutexattr_getprioceiling,
+ "pthread_mutexattr_getprioceiling");
+
type struct_sched_param is record
sched_priority : int; -- scheduling priority
end record;
@@ -386,6 +474,28 @@ package System.OS_Interface is
param : access struct_sched_param) return int;
pragma Import (C, pthread_setschedparam, "pthread_setschedparam");
+ function pthread_attr_setscope
+ (attr : access pthread_attr_t;
+ contentionscope : int) return int;
+ pragma Import (C, pthread_attr_setscope, "pthread_attr_setscope");
+
+ function pthread_attr_getscope
+ (attr : access pthread_attr_t;
+ contentionscope : access int) return int;
+ pragma Import (C, pthread_attr_getscope, "pthread_attr_getscope");
+
+ function pthread_attr_setinheritsched
+ (attr : access pthread_attr_t;
+ inheritsched : int) return int;
+ pragma Import
+ (C, pthread_attr_setinheritsched, "pthread_attr_setinheritsched");
+
+ function pthread_attr_getinheritsched
+ (attr : access pthread_attr_t;
+ inheritsched : access int) return int;
+ pragma Import
+ (C, pthread_attr_getinheritsched, "pthread_attr_getinheritsched");
+
function pthread_attr_setschedpolicy
(attr : access pthread_attr_t;
policy : int) return int;
@@ -496,6 +606,9 @@ private
end record;
pragma Convention (C, timespec);
+ type clockid_t is new int;
+ CLOCK_REALTIME : constant clockid_t := 0;
+
type pthread_attr_t is record
detachstate : int;
schedpolicy : int;
diff --git a/gcc/ada/s-osinte-rtems.ads b/gcc/ada/s-osinte-rtems.ads
index 8b9ae1297cd..5a143cc666a 100644
--- a/gcc/ada/s-osinte-rtems.ads
+++ b/gcc/ada/s-osinte-rtems.ads
@@ -51,6 +51,8 @@
-- It is designed to be a bottom-level (leaf) package.
with Interfaces.C;
+with System.OS_Constants;
+
package System.OS_Interface is
pragma Preelaborate;
@@ -60,6 +62,7 @@ package System.OS_Interface is
subtype rtems_id is Interfaces.C.unsigned;
subtype int is Interfaces.C.int;
+ subtype char is Interfaces.C.char;
subtype short is Interfaces.C.short;
subtype long is Interfaces.C.long;
subtype unsigned is Interfaces.C.unsigned;
@@ -68,7 +71,6 @@ package System.OS_Interface is
subtype unsigned_char is Interfaces.C.unsigned_char;
subtype plain_char is Interfaces.C.plain_char;
subtype size_t is Interfaces.C.size_t;
-
-----------
-- Errno --
-----------
@@ -76,11 +78,11 @@ package System.OS_Interface is
function errno return int;
pragma Import (C, errno, "__get_errno");
- EAGAIN : constant := 11;
- EINTR : constant := 4;
- EINVAL : constant := 22;
- ENOMEM : constant := 12;
- ETIMEDOUT : constant := 116;
+ EAGAIN : constant := System.OS_Constants.EAGAIN;
+ EINTR : constant := System.OS_Constants.EINTR;
+ EINVAL : constant := System.OS_Constants.EINVAL;
+ ENOMEM : constant := System.OS_Constants.ENOMEM;
+ ETIMEDOUT : constant := System.OS_Constants.ETIMEDOUT;
-------------
-- Signals --
@@ -448,6 +450,7 @@ package System.OS_Interface is
ss_low_priority : int;
ss_replenish_period : timespec;
ss_initial_budget : timespec;
+ sched_ss_max_repl : int;
end record;
pragma Convention (C, struct_sched_param);
@@ -621,43 +624,34 @@ private
end record;
pragma Convention (C, timespec);
- CLOCK_REALTIME : constant clockid_t := 1;
- CLOCK_MONOTONIC : constant clockid_t := 4;
+ CLOCK_REALTIME : constant clockid_t := System.OS_Constants.CLOCK_REALTIME;
+ CLOCK_MONOTONIC : constant clockid_t := System.OS_Constants.CLOCK_MONOTONIC;
+
+ subtype char_array is Interfaces.C.char_array;
type pthread_attr_t is record
- is_initialized : int;
- stackaddr : System.Address;
- stacksize : int;
- contentionscope : int;
- inheritsched : int;
- schedpolicy : int;
- schedparam : struct_sched_param;
- cputime_clocked_allowed : int;
- detatchstate : int;
+ Data : char_array (1 .. OS_Constants.PTHREAD_ATTR_SIZE);
end record;
pragma Convention (C, pthread_attr_t);
+ for pthread_attr_t'Alignment use Interfaces.C.double'Alignment;
type pthread_condattr_t is record
- flags : int;
- process_shared : int;
+ Data : char_array (1 .. OS_Constants.PTHREAD_CONDATTR_SIZE);
end record;
pragma Convention (C, pthread_condattr_t);
+ for pthread_condattr_t'Alignment use Interfaces.C.double'Alignment;
type pthread_mutexattr_t is record
- is_initialized : int;
- process_shared : int;
- prio_ceiling : int;
- protocol : int;
- mutex_type : int;
- recursive : int;
- end record;
+ Data : char_array (1 .. OS_Constants.PTHREAD_MUTEXATTR_SIZE);
+ end record;
pragma Convention (C, pthread_mutexattr_t);
+ for pthread_mutexattr_t'Alignment use Interfaces.C.double'Alignment;
type pthread_rwlockattr_t is record
- is_initialized : int;
- process_shared : int;
+ Data : char_array (1 .. OS_Constants.PTHREAD_RWLOCKATTR_SIZE);
end record;
pragma Convention (C, pthread_rwlockattr_t);
+ for pthread_rwlockattr_t'Alignment use Interfaces.C.double'Alignment;
type pthread_t is new rtems_id;
diff --git a/gcc/alias.c b/gcc/alias.c
index 9956306ae29..2711b7df5b4 100644
--- a/gcc/alias.c
+++ b/gcc/alias.c
@@ -1882,8 +1882,8 @@ refs_newer_value_p (rtx expr, rtx v)
}
/* Convert the address X into something we can use. This is done by returning
- it unchanged unless it is a value; in the latter case we call cselib to get
- a more useful rtx. */
+ it unchanged unless it is a VALUE or VALUE +/- constant; for VALUE
+ we call cselib to get a more useful rtx. */
rtx
get_addr (rtx x)
@@ -1892,7 +1892,23 @@ get_addr (rtx x)
struct elt_loc_list *l;
if (GET_CODE (x) != VALUE)
- return x;
+ {
+ if ((GET_CODE (x) == PLUS || GET_CODE (x) == MINUS)
+ && GET_CODE (XEXP (x, 0)) == VALUE
+ && CONST_SCALAR_INT_P (XEXP (x, 1)))
+ {
+ rtx op0 = get_addr (XEXP (x, 0));
+ if (op0 != XEXP (x, 0))
+ {
+ if (GET_CODE (x) == PLUS
+ && GET_CODE (XEXP (x, 1)) == CONST_INT)
+ return plus_constant (GET_MODE (x), op0, INTVAL (XEXP (x, 1)));
+ return simplify_gen_binary (GET_CODE (x), GET_MODE (x),
+ op0, XEXP (x, 1));
+ }
+ }
+ return x;
+ }
v = CSELIB_VAL_PTR (x);
if (v)
{
@@ -2730,6 +2746,20 @@ output_dependence (const_rtx mem, const_rtx x)
/*mem_canonicalized=*/false,
/*x_canonicalized*/false, /*writep=*/true);
}
+
+/* Likewise, but we already have a canonicalized MEM, and X_ADDR for X.
+ Also, consider X in X_MODE (which might be from an enclosing
+ STRICT_LOW_PART / ZERO_EXTRACT).
+ If MEM_CANONICALIZED is true, MEM is canonicalized. */
+
+int
+canon_output_dependence (const_rtx mem, bool mem_canonicalized,
+ const_rtx x, machine_mode x_mode, rtx x_addr)
+{
+ return write_dependence_p (mem, x, x_mode, x_addr,
+ mem_canonicalized, /*x_canonicalized=*/true,
+ /*writep=*/true);
+}
diff --git a/gcc/builtins.c b/gcc/builtins.c
index 0825391a0d3..6c1d81794e7 100644
--- a/gcc/builtins.c
+++ b/gcc/builtins.c
@@ -8793,21 +8793,21 @@ fold_builtin_memory_op (location_t loc, tree dest, tree src,
{
tree src_base, dest_base, fn;
HOST_WIDE_INT src_offset = 0, dest_offset = 0;
- HOST_WIDE_INT size = -1;
- HOST_WIDE_INT maxsize = -1;
+ HOST_WIDE_INT maxsize;
srcvar = TREE_OPERAND (src, 0);
- src_base = get_ref_base_and_extent (srcvar, &src_offset,
- &size, &maxsize);
+ src_base = get_addr_base_and_unit_offset (srcvar, &src_offset);
+ if (src_base == NULL)
+ src_base = srcvar;
destvar = TREE_OPERAND (dest, 0);
- dest_base = get_ref_base_and_extent (destvar, &dest_offset,
- &size, &maxsize);
+ dest_base = get_addr_base_and_unit_offset (destvar,
+ &dest_offset);
+ if (dest_base == NULL)
+ dest_base = destvar;
if (tree_fits_uhwi_p (len))
maxsize = tree_to_uhwi (len);
else
maxsize = -1;
- src_offset /= BITS_PER_UNIT;
- dest_offset /= BITS_PER_UNIT;
if (SSA_VAR_P (src_base)
&& SSA_VAR_P (dest_base))
{
@@ -9997,6 +9997,8 @@ fold_builtin_interclass_mathfn (location_t loc, tree fndecl, tree arg)
mode = TYPE_MODE (TREE_TYPE (arg));
+ bool is_ibm_extended = MODE_COMPOSITE_P (mode);
+
/* If there is no optab, try generic code. */
switch (DECL_FUNCTION_CODE (fndecl))
{
@@ -10006,10 +10008,18 @@ fold_builtin_interclass_mathfn (location_t loc, tree fndecl, tree arg)
{
/* isinf(x) -> isgreater(fabs(x),DBL_MAX). */
tree const isgr_fn = builtin_decl_explicit (BUILT_IN_ISGREATER);
- tree const type = TREE_TYPE (arg);
+ tree type = TREE_TYPE (arg);
REAL_VALUE_TYPE r;
char buf[128];
+ if (is_ibm_extended)
+ {
+ /* NaN and Inf are encoded in the high-order double value
+ only. The low-order value is not significant. */
+ type = double_type_node;
+ mode = DFmode;
+ arg = fold_build1_loc (loc, NOP_EXPR, type, arg);
+ }
get_max_float (REAL_MODE_FORMAT (mode), buf, sizeof (buf));
real_from_string (&r, buf);
result = build_call_expr (isgr_fn, 2,
@@ -10022,10 +10032,18 @@ fold_builtin_interclass_mathfn (location_t loc, tree fndecl, tree arg)
{
/* isfinite(x) -> islessequal(fabs(x),DBL_MAX). */
tree const isle_fn = builtin_decl_explicit (BUILT_IN_ISLESSEQUAL);
- tree const type = TREE_TYPE (arg);
+ tree type = TREE_TYPE (arg);
REAL_VALUE_TYPE r;
char buf[128];
+ if (is_ibm_extended)
+ {
+ /* NaN and Inf are encoded in the high-order double value
+ only. The low-order value is not significant. */
+ type = double_type_node;
+ mode = DFmode;
+ arg = fold_build1_loc (loc, NOP_EXPR, type, arg);
+ }
get_max_float (REAL_MODE_FORMAT (mode), buf, sizeof (buf));
real_from_string (&r, buf);
result = build_call_expr (isle_fn, 2,
@@ -10045,21 +10063,72 @@ fold_builtin_interclass_mathfn (location_t loc, tree fndecl, tree arg)
/* isnormal(x) -> isgreaterequal(fabs(x),DBL_MIN) &
islessequal(fabs(x),DBL_MAX). */
tree const isle_fn = builtin_decl_explicit (BUILT_IN_ISLESSEQUAL);
- tree const isge_fn = builtin_decl_explicit (BUILT_IN_ISGREATEREQUAL);
- tree const type = TREE_TYPE (arg);
+ tree type = TREE_TYPE (arg);
+ tree orig_arg, max_exp, min_exp;
+ machine_mode orig_mode = mode;
REAL_VALUE_TYPE rmax, rmin;
char buf[128];
+ orig_arg = arg = builtin_save_expr (arg);
+ if (is_ibm_extended)
+ {
+ /* Use double to test the normal range of IBM extended
+ precision. Emin for IBM extended precision is
+ different to emin for IEEE double, being 53 higher
+ since the low double exponent is at least 53 lower
+ than the high double exponent. */
+ type = double_type_node;
+ mode = DFmode;
+ arg = fold_build1_loc (loc, NOP_EXPR, type, arg);
+ }
+ arg = fold_build1_loc (loc, ABS_EXPR, type, arg);
+
get_max_float (REAL_MODE_FORMAT (mode), buf, sizeof (buf));
real_from_string (&rmax, buf);
- sprintf (buf, "0x1p%d", REAL_MODE_FORMAT (mode)->emin - 1);
+ sprintf (buf, "0x1p%d", REAL_MODE_FORMAT (orig_mode)->emin - 1);
real_from_string (&rmin, buf);
- arg = builtin_save_expr (fold_build1_loc (loc, ABS_EXPR, type, arg));
- result = build_call_expr (isle_fn, 2, arg,
- build_real (type, rmax));
- result = fold_build2 (BIT_AND_EXPR, integer_type_node, result,
- build_call_expr (isge_fn, 2, arg,
- build_real (type, rmin)));
+ max_exp = build_real (type, rmax);
+ min_exp = build_real (type, rmin);
+
+ max_exp = build_call_expr (isle_fn, 2, arg, max_exp);
+ if (is_ibm_extended)
+ {
+ /* Testing the high end of the range is done just using
+ the high double, using the same test as isfinite().
+ For the subnormal end of the range we first test the
+ high double, then if its magnitude is equal to the
+ limit of 0x1p-969, we test whether the low double is
+ non-zero and opposite sign to the high double. */
+ tree const islt_fn = builtin_decl_explicit (BUILT_IN_ISLESS);
+ tree const isgt_fn = builtin_decl_explicit (BUILT_IN_ISGREATER);
+ tree gt_min = build_call_expr (isgt_fn, 2, arg, min_exp);
+ tree eq_min = fold_build2 (EQ_EXPR, integer_type_node,
+ arg, min_exp);
+ tree as_complex = build1 (VIEW_CONVERT_EXPR,
+ complex_double_type_node, orig_arg);
+ tree hi_dbl = build1 (REALPART_EXPR, type, as_complex);
+ tree lo_dbl = build1 (IMAGPART_EXPR, type, as_complex);
+ tree zero = build_real (type, dconst0);
+ tree hilt = build_call_expr (islt_fn, 2, hi_dbl, zero);
+ tree lolt = build_call_expr (islt_fn, 2, lo_dbl, zero);
+ tree logt = build_call_expr (isgt_fn, 2, lo_dbl, zero);
+ tree ok_lo = fold_build1 (TRUTH_NOT_EXPR, integer_type_node,
+ fold_build3 (COND_EXPR,
+ integer_type_node,
+ hilt, logt, lolt));
+ eq_min = fold_build2 (TRUTH_ANDIF_EXPR, integer_type_node,
+ eq_min, ok_lo);
+ min_exp = fold_build2 (TRUTH_ORIF_EXPR, integer_type_node,
+ gt_min, eq_min);
+ }
+ else
+ {
+ tree const isge_fn
+ = builtin_decl_explicit (BUILT_IN_ISGREATEREQUAL);
+ min_exp = build_call_expr (isge_fn, 2, arg, min_exp);
+ }
+ result = fold_build2 (BIT_AND_EXPR, integer_type_node,
+ max_exp, min_exp);
return result;
}
default:
@@ -10154,6 +10223,15 @@ fold_builtin_classify (location_t loc, tree fndecl, tree arg, int builtin_index)
return real_isnan (&r) ? integer_one_node : integer_zero_node;
}
+ {
+ bool is_ibm_extended = MODE_COMPOSITE_P (TYPE_MODE (TREE_TYPE (arg)));
+ if (is_ibm_extended)
+ {
+ /* NaN and Inf are encoded in the high-order double value
+ only. The low-order value is not significant. */
+ arg = fold_build1_loc (loc, NOP_EXPR, double_type_node, arg);
+ }
+ }
arg = builtin_save_expr (arg);
return fold_build2_loc (loc, UNORDERED_EXPR, type, arg, arg);
diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog
index 86ecae988f3..8e064465f99 100644
--- a/gcc/c-family/ChangeLog
+++ b/gcc/c-family/ChangeLog
@@ -1,3 +1,38 @@
+2016-08-03 Release Manager
+
+ * GCC 4.9.4 released.
+
+2016-07-07 Jakub Jelinek <jakub@redhat.com>
+
+ Backported from mainline
+ 2016-02-15 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/69797
+ * c-common.c (sync_resolve_size): Diagnose too few arguments
+ even when params is non-NULL empty vector.
+
+2016-07-05 Markus Trippelsdorf <markus@trippelsdorf.de>
+
+ PR c++/71214
+ * c-cppbuiltin.c (c_cpp_builtins): Define __cpp_rvalue_references.
+
+2016-02-11 Jakub Jelinek <jakub@redhat.com>
+
+ Backported from mainline
+ 2015-12-03 Jakub Jelinek <jakub@redhat.com>
+
+ PR preprocessor/57580
+ * c-ppoutput.c (print): Change printed field to bool.
+ (init_pp_output): Set print.printed to false instead of 0.
+ (scan_translation_unit): Fix up formatting. Set print.printed
+ to true after printing something other than newline.
+ (scan_translation_unit_trad): Set print.printed to true instead of 1.
+ (maybe_print_line_1): Set print.printed to false instead of 0.
+ (print_line_1): Likewise.
+ (do_line_change): Set print.printed to true instead of 1.
+ (cb_define, dump_queued_macros, cb_include, cb_def_pragma,
+ dump_macro): Set print.printed to false after printing newline.
+
2015-06-26 Release Manager
* GCC 4.9.3 released.
diff --git a/gcc/c-family/c-common.c b/gcc/c-family/c-common.c
index 88567018502..30dac625135 100644
--- a/gcc/c-family/c-common.c
+++ b/gcc/c-family/c-common.c
@@ -10203,7 +10203,7 @@ sync_resolve_size (tree function, vec<tree, va_gc> *params)
tree type;
int size;
- if (!params)
+ if (vec_safe_is_empty (params))
{
error ("too few arguments to function %qE", function);
return 0;
diff --git a/gcc/c-family/c-cppbuiltin.c b/gcc/c-family/c-cppbuiltin.c
index b65e08f3b99..1ba91b7aa7a 100644
--- a/gcc/c-family/c-cppbuiltin.c
+++ b/gcc/c-family/c-cppbuiltin.c
@@ -833,6 +833,7 @@ c_cpp_builtins (cpp_reader *pfile)
cpp_define (pfile, "__cpp_decltype=200707");
cpp_define (pfile, "__cpp_attributes=200809");
cpp_define (pfile, "__cpp_rvalue_reference=200610");
+ cpp_define (pfile, "__cpp_rvalue_references=200610");
cpp_define (pfile, "__cpp_variadic_templates=200704");
cpp_define (pfile, "__cpp_alias_templates=200704");
}
diff --git a/gcc/c-family/c-ppoutput.c b/gcc/c-family/c-ppoutput.c
index f3b5fa4487d..62598e98808 100644
--- a/gcc/c-family/c-ppoutput.c
+++ b/gcc/c-family/c-ppoutput.c
@@ -33,7 +33,7 @@ static struct
const cpp_token *prev; /* Previous token. */
const cpp_token *source; /* Source token for spacing. */
int src_line; /* Line number currently being written. */
- unsigned char printed; /* Nonzero if something output at line. */
+ bool printed; /* True if something output at line. */
bool first_time; /* pp_file_change hasn't been called yet. */
const char *src_file; /* Current source file. */
} print;
@@ -151,7 +151,7 @@ init_pp_output (FILE *out_stream)
/* Initialize the print structure. */
print.src_line = 1;
- print.printed = 0;
+ print.printed = false;
print.prev = 0;
print.outf = out_stream;
print.first_time = 1;
@@ -202,12 +202,16 @@ scan_translation_unit (cpp_reader *pfile)
{
do_line_change (pfile, token, loc, false);
putc (' ', print.outf);
+ print.printed = true;
}
else if (print.source->flags & PREV_WHITE
|| (print.prev
&& cpp_avoid_paste (pfile, print.prev, token))
|| (print.prev == NULL && token->type == CPP_HASH))
- putc (' ', print.outf);
+ {
+ putc (' ', print.outf);
+ print.printed = true;
+ }
}
else if (token->flags & PREV_WHITE)
{
@@ -218,6 +222,7 @@ scan_translation_unit (cpp_reader *pfile)
&& !in_pragma)
do_line_change (pfile, token, loc, false);
putc (' ', print.outf);
+ print.printed = true;
}
avoid_paste = false;
@@ -235,7 +240,7 @@ scan_translation_unit (cpp_reader *pfile)
fprintf (print.outf, "%s %s", space, name);
else
fprintf (print.outf, "%s", name);
- print.printed = 1;
+ print.printed = true;
in_pragma = true;
}
else if (token->type == CPP_PRAGMA_EOL)
@@ -246,9 +251,9 @@ scan_translation_unit (cpp_reader *pfile)
else
{
if (cpp_get_options (parse_in)->debug)
- linemap_dump_location (line_table, token->src_loc,
- print.outf);
+ linemap_dump_location (line_table, token->src_loc, print.outf);
cpp_output_token (token, print.outf);
+ print.printed = true;
}
/* CPP_COMMENT tokens and raw-string literal tokens can
@@ -298,7 +303,7 @@ scan_translation_unit_trad (cpp_reader *pfile)
size_t len = pfile->out.cur - pfile->out.base;
maybe_print_line (pfile->out.first_line);
fwrite (pfile->out.base, 1, len, print.outf);
- print.printed = 1;
+ print.printed = true;
if (!CPP_OPTION (pfile, discard_comments))
account_for_newlines (pfile->out.base, len);
}
@@ -319,7 +324,7 @@ maybe_print_line_1 (source_location src_loc, FILE *stream)
{
putc ('\n', stream);
print.src_line++;
- print.printed = 0;
+ print.printed = false;
}
if (!flag_no_line_commands
@@ -360,7 +365,7 @@ print_line_1 (source_location src_loc, const char *special_flags, FILE *stream)
/* End any previous line of text. */
if (print.printed)
putc ('\n', stream);
- print.printed = 0;
+ print.printed = false;
if (!flag_no_line_commands)
{
@@ -429,7 +434,7 @@ do_line_change (cpp_reader *pfile, const cpp_token *token,
if (!CPP_OPTION (pfile, traditional))
{
int spaces = LOCATION_COLUMN (src_loc) - 2;
- print.printed = 1;
+ print.printed = true;
while (-- spaces >= 0)
putc (' ', print.outf);
@@ -470,6 +475,7 @@ cb_define (cpp_reader *pfile, source_location line, cpp_hashnode *node)
fputs ((const char *) NODE_NAME (node), print.outf);
putc ('\n', print.outf);
+ print.printed = false;
linemap_resolve_location (line_table, line,
LRK_MACRO_DEFINITION_LOCATION,
&map);
@@ -521,7 +527,7 @@ dump_queued_macros (cpp_reader *pfile ATTRIBUTE_UNUSED)
{
putc ('\n', print.outf);
print.src_line++;
- print.printed = 0;
+ print.printed = false;
}
for (q = define_queue; q;)
@@ -530,6 +536,7 @@ dump_queued_macros (cpp_reader *pfile ATTRIBUTE_UNUSED)
fputs ("#define ", print.outf);
fputs (q->macro, print.outf);
putc ('\n', print.outf);
+ print.printed = false;
print.src_line++;
oq = q;
q = q->next;
@@ -573,6 +580,7 @@ cb_include (cpp_reader *pfile ATTRIBUTE_UNUSED, source_location line,
}
putc ('\n', print.outf);
+ print.printed = false;
print.src_line++;
}
@@ -638,6 +646,7 @@ cb_def_pragma (cpp_reader *pfile, source_location line)
maybe_print_line (line);
fputs ("#pragma ", print.outf);
cpp_output_line (pfile, print.outf);
+ print.printed = false;
print.src_line++;
}
@@ -651,6 +660,7 @@ dump_macro (cpp_reader *pfile, cpp_hashnode *node, void *v ATTRIBUTE_UNUSED)
fputs ((const char *) cpp_macro_definition (pfile, node),
print.outf);
putc ('\n', print.outf);
+ print.printed = false;
print.src_line++;
}
diff --git a/gcc/c/ChangeLog b/gcc/c/ChangeLog
index 85f1d2ec8b2..276582c71fc 100644
--- a/gcc/c/ChangeLog
+++ b/gcc/c/ChangeLog
@@ -1,3 +1,7 @@
+2016-08-03 Release Manager
+
+ * GCC 4.9.4 released.
+
2015-06-26 Release Manager
* GCC 4.9.3 released.
diff --git a/gcc/c/c-parser.c b/gcc/c/c-parser.c
index 4fbf4f2e157..d6d03c7304f 100644
--- a/gcc/c/c-parser.c
+++ b/gcc/c/c-parser.c
@@ -1161,7 +1161,8 @@ static tree c_parser_simple_asm_expr (c_parser *);
static tree c_parser_attributes (c_parser *);
static struct c_type_name *c_parser_type_name (c_parser *);
static struct c_expr c_parser_initializer (c_parser *);
-static struct c_expr c_parser_braced_init (c_parser *, tree, bool);
+static struct c_expr c_parser_braced_init (c_parser *, tree, bool,
+ struct obstack *);
static void c_parser_initelt (c_parser *, struct obstack *);
static void c_parser_initval (c_parser *, struct c_expr *,
struct obstack *);
@@ -4088,7 +4089,7 @@ static struct c_expr
c_parser_initializer (c_parser *parser)
{
if (c_parser_next_token_is (parser, CPP_OPEN_BRACE))
- return c_parser_braced_init (parser, NULL_TREE, false);
+ return c_parser_braced_init (parser, NULL_TREE, false, NULL);
else
{
struct c_expr ret;
@@ -4108,7 +4109,8 @@ c_parser_initializer (c_parser *parser)
top-level initializer in a declaration. */
static struct c_expr
-c_parser_braced_init (c_parser *parser, tree type, bool nested_p)
+c_parser_braced_init (c_parser *parser, tree type, bool nested_p,
+ struct obstack *outer_obstack)
{
struct c_expr ret;
struct obstack braced_init_obstack;
@@ -4117,7 +4119,10 @@ c_parser_braced_init (c_parser *parser, tree type, bool nested_p)
gcc_assert (c_parser_next_token_is (parser, CPP_OPEN_BRACE));
c_parser_consume_token (parser);
if (nested_p)
- push_init_level (0, &braced_init_obstack);
+ {
+ finish_implicit_inits (outer_obstack);
+ push_init_level (0, &braced_init_obstack);
+ }
else
really_start_incremental_init (type);
if (c_parser_next_token_is (parser, CPP_CLOSE_BRACE))
@@ -4368,7 +4373,8 @@ c_parser_initval (c_parser *parser, struct c_expr *after,
location_t loc = c_parser_peek_token (parser)->location;
if (c_parser_next_token_is (parser, CPP_OPEN_BRACE) && !after)
- init = c_parser_braced_init (parser, NULL_TREE, true);
+ init = c_parser_braced_init (parser, NULL_TREE, true,
+ braced_init_obstack);
else
{
init = c_parser_expr_no_commas (parser, after);
@@ -7567,7 +7573,7 @@ c_parser_postfix_expression_after_paren_type (c_parser *parser,
error_at (type_loc, "compound literal has variable size");
type = error_mark_node;
}
- init = c_parser_braced_init (parser, type, false);
+ init = c_parser_braced_init (parser, type, false, NULL);
finish_init ();
maybe_warn_string_init (type, init);
diff --git a/gcc/c/c-tree.h b/gcc/c/c-tree.h
index 53768d619b7..0da510e9b45 100644
--- a/gcc/c/c-tree.h
+++ b/gcc/c/c-tree.h
@@ -608,6 +608,7 @@ extern void maybe_warn_string_init (tree, struct c_expr);
extern void start_init (tree, tree, int);
extern void finish_init (void);
extern void really_start_incremental_init (tree);
+extern void finish_implicit_inits (struct obstack *);
extern void push_init_level (int, struct obstack *);
extern struct c_expr pop_init_level (int, struct obstack *);
extern void set_init_index (tree, tree, struct obstack *);
diff --git a/gcc/c/c-typeck.c b/gcc/c/c-typeck.c
index bc24a3b31e8..c20de0a4986 100644
--- a/gcc/c/c-typeck.c
+++ b/gcc/c/c-typeck.c
@@ -7164,6 +7164,31 @@ really_start_incremental_init (tree type)
}
}
+/* Called when we see an open brace for a nested initializer. Finish
+ off any pending levels with implicit braces. */
+void
+finish_implicit_inits (struct obstack *braced_init_obstack)
+{
+ while (constructor_stack->implicit)
+ {
+ if ((TREE_CODE (constructor_type) == RECORD_TYPE
+ || TREE_CODE (constructor_type) == UNION_TYPE)
+ && constructor_fields == 0)
+ process_init_element (input_location,
+ pop_init_level (1, braced_init_obstack),
+ true, braced_init_obstack);
+ else if (TREE_CODE (constructor_type) == ARRAY_TYPE
+ && constructor_max_index
+ && tree_int_cst_lt (constructor_max_index,
+ constructor_index))
+ process_init_element (input_location,
+ pop_init_level (1, braced_init_obstack),
+ true, braced_init_obstack);
+ else
+ break;
+ }
+}
+
/* Push down into a subobject, for initialization.
If this is for an explicit set of braces, IMPLICIT is 0.
If it is because the next element belongs at a lower level,
@@ -7175,34 +7200,6 @@ push_init_level (int implicit, struct obstack * braced_init_obstack)
struct constructor_stack *p;
tree value = NULL_TREE;
- /* If we've exhausted any levels that didn't have braces,
- pop them now. If implicit == 1, this will have been done in
- process_init_element; do not repeat it here because in the case
- of excess initializers for an empty aggregate this leads to an
- infinite cycle of popping a level and immediately recreating
- it. */
- if (implicit != 1)
- {
- while (constructor_stack->implicit)
- {
- if ((TREE_CODE (constructor_type) == RECORD_TYPE
- || TREE_CODE (constructor_type) == UNION_TYPE)
- && constructor_fields == 0)
- process_init_element (input_location,
- pop_init_level (1, braced_init_obstack),
- true, braced_init_obstack);
- else if (TREE_CODE (constructor_type) == ARRAY_TYPE
- && constructor_max_index
- && tree_int_cst_lt (constructor_max_index,
- constructor_index))
- process_init_element (input_location,
- pop_init_level (1, braced_init_obstack),
- true, braced_init_obstack);
- else
- break;
- }
- }
-
/* Unless this is an explicit brace, we need to preserve previous
content if any. */
if (implicit)
@@ -7611,6 +7608,7 @@ set_designator (int array, struct obstack * braced_init_obstack)
}
constructor_designated = 1;
+ finish_implicit_inits (braced_init_obstack);
push_init_level (2, braced_init_obstack);
return 0;
}
@@ -8942,6 +8940,7 @@ process_init_element (location_t loc, struct c_expr value, bool implicit,
p = p->next;
if (!p)
break;
+ finish_implicit_inits (braced_init_obstack);
push_init_level (2, braced_init_obstack);
p->stack = constructor_stack;
if (p->range_end && tree_int_cst_equal (p->index, p->range_end))
diff --git a/gcc/calls.c b/gcc/calls.c
index 50c0ef3ca9c..241561c9a78 100644
--- a/gcc/calls.c
+++ b/gcc/calls.c
@@ -521,12 +521,9 @@ special_function_p (const_tree fndecl, int flags)
/* We assume that alloca will always be called by name. It
makes no sense to pass it as a pointer-to-function to
anything that does not understand its behavior. */
- if (((IDENTIFIER_LENGTH (DECL_NAME (fndecl)) == 6
- && name[0] == 'a'
- && ! strcmp (name, "alloca"))
- || (IDENTIFIER_LENGTH (DECL_NAME (fndecl)) == 16
- && name[0] == '_'
- && ! strcmp (name, "__builtin_alloca"))))
+ if (IDENTIFIER_LENGTH (DECL_NAME (fndecl)) == 6
+ && name[0] == 'a'
+ && ! strcmp (name, "alloca"))
flags |= ECF_MAY_BE_ALLOCA;
/* Disregard prefix _, __, __x or __builtin_. */
@@ -572,6 +569,17 @@ special_function_p (const_tree fndecl, int flags)
flags |= ECF_NORETURN;
}
+ if (DECL_BUILT_IN_CLASS (fndecl) == BUILT_IN_NORMAL)
+ switch (DECL_FUNCTION_CODE (fndecl))
+ {
+ case BUILT_IN_ALLOCA:
+ case BUILT_IN_ALLOCA_WITH_ALIGN:
+ flags |= ECF_MAY_BE_ALLOCA;
+ break;
+ default:
+ break;
+ }
+
return flags;
}
@@ -2937,6 +2945,19 @@ expand_call (tree exp, rtx target, int ignore)
compute_argument_addresses (args, argblock, num_actuals);
+ /* Stack is properly aligned, pops can't safely be deferred during
+ the evaluation of the arguments. */
+ NO_DEFER_POP;
+
+ /* Precompute all register parameters. It isn't safe to compute
+ anything once we have started filling any specific hard regs.
+ TLS symbols sometimes need a call to resolve. Precompute
+ register parameters before any stack pointer manipulation
+ to avoid unaligned stack in the called function. */
+ precompute_register_parameters (num_actuals, args, &reg_parm_seen);
+
+ OK_DEFER_POP;
+
/* Perform stack alignment before the first push (the last arg). */
if (argblock == 0
&& adjusted_args_size.constant > reg_parm_stack_space
@@ -3003,10 +3024,6 @@ expand_call (tree exp, rtx target, int ignore)
}
}
- /* Precompute all register parameters. It isn't safe to compute anything
- once we have started filling any specific hard regs. */
- precompute_register_parameters (num_actuals, args, &reg_parm_seen);
-
if (CALL_EXPR_STATIC_CHAIN (exp))
static_chain_value = expand_normal (CALL_EXPR_STATIC_CHAIN (exp));
else
@@ -4620,6 +4637,13 @@ store_one_arg (struct arg_data *arg, rtx argblock, int flags,
if (XEXP (x, 0) != crtl->args.internal_arg_pointer)
i = INTVAL (XEXP (XEXP (x, 0), 1));
+ /* arg.locate doesn't contain the pretend_args_size offset,
+ it's part of argblock. Ensure we don't count it in I. */
+#ifdef STACK_GROWS_DOWNWARD
+ i -= crtl->args.pretend_args_size;
+#else
+ i += crtl->args.pretend_args_size;
+#endif
/* expand_call should ensure this. */
gcc_assert (!arg->locate.offset.var
&& arg->locate.size.var == 0
diff --git a/gcc/cfgexpand.c b/gcc/cfgexpand.c
index 010fd177f4a..b896e8ee1fb 100644
--- a/gcc/cfgexpand.c
+++ b/gcc/cfgexpand.c
@@ -248,6 +248,15 @@ align_local_variable (tree decl)
return align / BITS_PER_UNIT;
}
+/* Align given offset BASE with ALIGN. Truncate up if ALIGN_UP is true,
+ down otherwise. Return truncated BASE value. */
+
+static inline unsigned HOST_WIDE_INT
+align_base (HOST_WIDE_INT base, unsigned HOST_WIDE_INT align, bool align_up)
+{
+ return align_up ? (base + align - 1) & -align : base & -align;
+}
+
/* Allocate SIZE bytes at byte alignment ALIGN from the stack frame.
Return the frame offset. */
@@ -256,20 +265,17 @@ alloc_stack_frame_space (HOST_WIDE_INT size, unsigned HOST_WIDE_INT align)
{
HOST_WIDE_INT offset, new_frame_offset;
- new_frame_offset = frame_offset;
if (FRAME_GROWS_DOWNWARD)
{
- new_frame_offset -= size + frame_phase;
- new_frame_offset &= -align;
- new_frame_offset += frame_phase;
+ new_frame_offset
+ = align_base (frame_offset - frame_phase - size,
+ align, false) + frame_phase;
offset = new_frame_offset;
}
else
{
- new_frame_offset -= frame_phase;
- new_frame_offset += align - 1;
- new_frame_offset &= -align;
- new_frame_offset += frame_phase;
+ new_frame_offset
+ = align_base (frame_offset - frame_phase, align, true) + frame_phase;
offset = new_frame_offset;
new_frame_offset += size;
}
@@ -983,13 +989,16 @@ expand_stack_vars (bool (*pred) (size_t), struct stack_vars_data *data)
base = virtual_stack_vars_rtx;
if ((flag_sanitize & SANITIZE_ADDRESS) && ASAN_STACK && pred)
{
- HOST_WIDE_INT prev_offset = frame_offset;
+ HOST_WIDE_INT prev_offset
+ = align_base (frame_offset,
+ MAX (alignb, ASAN_RED_ZONE_SIZE),
+ FRAME_GROWS_DOWNWARD);
tree repr_decl = NULL_TREE;
-
offset
= alloc_stack_frame_space (stack_vars[i].size
+ ASAN_RED_ZONE_SIZE,
MAX (alignb, ASAN_RED_ZONE_SIZE));
+
data->asan_vec.safe_push (prev_offset);
data->asan_vec.safe_push (offset + stack_vars[i].size);
/* Find best representative of the partition.
diff --git a/gcc/cfgrtl.c b/gcc/cfgrtl.c
index f0e31671b8d..35e535711a3 100644
--- a/gcc/cfgrtl.c
+++ b/gcc/cfgrtl.c
@@ -4239,14 +4239,14 @@ cfg_layout_initialize (unsigned int flags)
rtx x;
basic_block bb;
- /* Once bb reordering is complete, cfg layout mode should not be re-entered.
- Entering cfg layout mode will perform optimizations on the cfg that
- could affect the bb layout negatively or even require fixups. An
- example of the latter is if edge forwarding performed when optimizing
- the cfg layout required moving a block from the hot to the cold section
- under -freorder-blocks-and-partition. This would create an illegal
- partitioning unless some manual fixup was performed. */
- gcc_assert (!crtl->bb_reorder_complete);
+ /* Once bb partitioning is complete, cfg layout mode should not be
+ re-entered. Entering cfg layout mode may require fixups. As an
+ example, if edge forwarding performed when optimizing the cfg
+ layout required moving a block from the hot to the cold
+ section. This would create an illegal partitioning unless some
+ manual fixup was performed. */
+ gcc_assert (!(crtl->bb_reorder_complete
+ && flag_reorder_blocks_and_partition));
initialize_original_copy_tables ();
diff --git a/gcc/cgraph.c b/gcc/cgraph.c
index ac9b460370b..a12b136a7fb 100644
--- a/gcc/cgraph.c
+++ b/gcc/cgraph.c
@@ -2527,13 +2527,14 @@ collect_callers_of_node_1 (struct cgraph_node *node, void *data)
if (avail > AVAIL_OVERWRITABLE)
for (cs = node->callers; cs != NULL; cs = cs->next_caller)
- if (!cs->indirect_inlining_edge)
+ if (!cs->indirect_inlining_edge
+ && !cs->caller->thunk.thunk_p)
redirect_callers->safe_push (cs);
return false;
}
/* Collect all callers of NODE and its aliases that are known to lead to NODE
- (i.e. are not overwritable). */
+ (i.e. are not overwritable) and that are not thunks. */
vec<cgraph_edge_p>
collect_callers_of_node (struct cgraph_node *node)
diff --git a/gcc/cgraphclones.c b/gcc/cgraphclones.c
index e310b1ce801..11bcc380501 100644
--- a/gcc/cgraphclones.c
+++ b/gcc/cgraphclones.c
@@ -367,6 +367,7 @@ duplicate_thunk_for_node (cgraph_node *thunk, cgraph_node *node)
new_thunk = cgraph_create_node (new_decl);
set_new_clone_decl_and_node_flags (new_thunk);
new_thunk->definition = true;
+ new_thunk->local.can_change_signature = node->local.can_change_signature;
new_thunk->thunk = thunk->thunk;
new_thunk->unique_name = in_lto_p;
new_thunk->former_clone_of = thunk->decl;
diff --git a/gcc/combine.c b/gcc/combine.c
index a22aba7d48e..d2f00d1b7e7 100644
--- a/gcc/combine.c
+++ b/gcc/combine.c
@@ -10173,9 +10173,24 @@ simplify_shift_const_1 (enum rtx_code code, enum machine_mode result_mode,
&& CONST_INT_P (XEXP (varop, 0))
&& !CONST_INT_P (XEXP (varop, 1)))
{
+ /* For ((unsigned) (cstULL >> count)) >> cst2 we have to make
+ sure the result will be masked. See PR70222. */
+ if (code == LSHIFTRT
+ && mode != result_mode
+ && !merge_outer_ops (&outer_op, &outer_const, AND,
+ GET_MODE_MASK (result_mode)
+ >> orig_count, result_mode,
+ &complement_p))
+ break;
+ /* For ((int) (cstLL >> count)) >> cst2 just give up. Queuing
+ up outer sign extension (often left and right shift) is
+ hardly more efficient than the original. See PR70429. */
+ if (code == ASHIFTRT && mode != result_mode)
+ break;
+
rtx new_rtx = simplify_const_binary_operation (code, mode,
- XEXP (varop, 0),
- GEN_INT (count));
+ XEXP (varop, 0),
+ GEN_INT (count));
varop = gen_rtx_fmt_ee (code, mode, new_rtx, XEXP (varop, 1));
count = 0;
continue;
diff --git a/gcc/config.gcc b/gcc/config.gcc
index a3bfee42249..7a9aafc70a3 100644
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -1543,9 +1543,6 @@ i[34567]86-*-solaris2* | x86_64-*-solaris2.1[0-9]*)
esac
with_tune_32=${with_tune_32:-generic}
case ${target} in
- *-*-solaris2.9*)
- tm_file="${tm_file} i386/sol2-9.h"
- ;;
*-*-solaris2.1[0-9]*)
tm_file="${tm_file} i386/x86-64.h i386/sol2-bi.h sol2-bi.h"
tm_defines="${tm_defines} TARGET_BI_ARCH=1"
diff --git a/gcc/config.in b/gcc/config.in
index ba3b7fc8bb5..f86133120bc 100644
--- a/gcc/config.in
+++ b/gcc/config.in
@@ -551,6 +551,12 @@
#endif
+/* Define if your assembler supports .stabs. */
+#ifndef USED_FOR_TARGET
+#undef HAVE_AS_STABS_DIRECTIVE
+#endif
+
+
/* Define if your assembler and linker support thread-local storage. */
#ifndef USED_FOR_TARGET
#undef HAVE_AS_TLS
@@ -1223,6 +1229,12 @@
#endif
+/* Define if isl_options_set_schedule_serialize_sccs exists. */
+#ifndef USED_FOR_TARGET
+#undef HAVE_ISL_OPTIONS_SET_SCHEDULE_SERIALIZE_SCCS
+#endif
+
+
/* Define if isl_schedule_constraints_compute_schedule exists. */
#ifndef USED_FOR_TARGET
#undef HAVE_ISL_SCHED_CONSTRAINTS_COMPUTE_SCHEDULE
diff --git a/gcc/config/aarch64/aarch64-simd.md b/gcc/config/aarch64/aarch64-simd.md
index ac4e4839828..f45411f4285 100644
--- a/gcc/config/aarch64/aarch64-simd.md
+++ b/gcc/config/aarch64/aarch64-simd.md
@@ -1744,16 +1744,6 @@
}
)
-(define_insn "aarch64_vmls<mode>"
- [(set (match_operand:VDQF 0 "register_operand" "=w")
- (minus:VDQF (match_operand:VDQF 1 "register_operand" "0")
- (mult:VDQF (match_operand:VDQF 2 "register_operand" "w")
- (match_operand:VDQF 3 "register_operand" "w"))))]
- "TARGET_SIMD"
- "fmls\\t%0.<Vtype>, %2.<Vtype>, %3.<Vtype>"
- [(set_attr "type" "neon_fp_mla_<Vetype>_scalar<q>")]
-)
-
;; FP Max/Min
;; Max/Min are introduced by idiom recognition by GCC's mid-end. An
;; expression like:
diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c
index 7b7953892e8..dc29cae5f57 100644
--- a/gcc/config/aarch64/aarch64.c
+++ b/gcc/config/aarch64/aarch64.c
@@ -7919,7 +7919,7 @@ aarch64_madd_needs_nop (rtx insn)
if (!aarch64_fix_a53_err835769)
return false;
- if (recog_memoized (insn) < 0)
+ if (!INSN_P (insn) || recog_memoized (insn) < 0)
return false;
attr_type = get_attr_type (insn);
@@ -9934,6 +9934,18 @@ aarch64_cannot_change_mode_class (enum machine_mode from,
enum machine_mode to,
enum reg_class rclass)
{
+ /* We cannot allow word_mode subregs of full vector modes.
+ Otherwise the middle-end will assume it's ok to store to
+ (subreg:DI (reg:TI 100) 0) in order to modify only the low 64 bits
+ of the 128-bit register. However, after reload the subreg will
+ be dropped leaving a plain DImode store. See PR67609 for a more
+ detailed dicussion. In some other cases we can be permissive and
+ return false. */
+ if (reg_classes_intersect_p (FP_REGS, rclass)
+ && GET_MODE_SIZE (to) == UNITS_PER_WORD
+ && GET_MODE_SIZE (from) > UNITS_PER_WORD)
+ return true;
+
/* Full-reg subregs are allowed on general regs or any class if they are
the same size. */
if (GET_MODE_SIZE (from) == GET_MODE_SIZE (to)
diff --git a/gcc/config/aarch64/aarch64.md b/gcc/config/aarch64/aarch64.md
index 76f8c61a91b..1d753ca7d9e 100644
--- a/gcc/config/aarch64/aarch64.md
+++ b/gcc/config/aarch64/aarch64.md
@@ -3773,7 +3773,8 @@
(define_insn "aarch64_movdi_<mode>low"
[(set (match_operand:DI 0 "register_operand" "=r")
- (truncate:DI (match_operand:TX 1 "register_operand" "w")))]
+ (zero_extract:DI (match_operand:TX 1 "register_operand" "w")
+ (const_int 64) (const_int 0)))]
"reload_completed || reload_in_progress"
"fmov\\t%x0, %d1"
[(set_attr "type" "f_mrc")
@@ -3782,9 +3783,8 @@
(define_insn "aarch64_movdi_<mode>high"
[(set (match_operand:DI 0 "register_operand" "=r")
- (truncate:DI
- (lshiftrt:TX (match_operand:TX 1 "register_operand" "w")
- (const_int 64))))]
+ (zero_extract:DI (match_operand:TX 1 "register_operand" "w")
+ (const_int 64) (const_int 64)))]
"reload_completed || reload_in_progress"
"fmov\\t%x0, %1.d[1]"
[(set_attr "type" "f_mrc")
diff --git a/gcc/config/alpha/alpha.md b/gcc/config/alpha/alpha.md
index 3eabba2e3fc..4fd69c5809b 100644
--- a/gcc/config/alpha/alpha.md
+++ b/gcc/config/alpha/alpha.md
@@ -3754,7 +3754,8 @@
;; BUGCHK is documented common to OSF/1 and VMS PALcode.
(define_insn "trap"
- [(trap_if (const_int 1) (const_int 0))]
+ [(trap_if (const_int 1) (const_int 0))
+ (use (reg:DI 29))]
""
"call_pal 0x81"
[(set_attr "type" "callpal")])
@@ -5174,7 +5175,7 @@
"TARGET_ABI_OSF"
{
if (TARGET_EXPLICIT_RELOCS)
- return "ldah $29,0($26)\t\t!gpdisp!%*\;lda $29,0($29)\t\t!gpdisp!%*";
+ return "#";
else
return "ldgp $29,0($26)";
}
diff --git a/gcc/config/arm/arm-protos.h b/gcc/config/arm/arm-protos.h
index 5488d838cb0..bd4a3d172f5 100644
--- a/gcc/config/arm/arm-protos.h
+++ b/gcc/config/arm/arm-protos.h
@@ -297,6 +297,7 @@ extern int vfp3_const_double_for_bits (rtx);
extern void arm_emit_coreregs_64bit_shift (enum rtx_code, rtx, rtx, rtx, rtx,
rtx);
+extern bool arm_valid_symbolic_address_p (rtx);
extern bool arm_validize_comparison (rtx *, rtx *, rtx *);
#endif /* RTX_CODE */
diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
index ee4dede6425..de0b66f08ca 100644
--- a/gcc/config/arm/arm.c
+++ b/gcc/config/arm/arm.c
@@ -21183,7 +21183,11 @@ arm_expand_prologue (void)
/* Naked functions don't have prologues. */
if (IS_NAKED (func_type))
- return;
+ {
+ if (flag_stack_usage_info)
+ current_function_static_stack_size = 0;
+ return;
+ }
/* Make a copy of c_f_p_a_s as we may need to modify it locally. */
args_to_push = crtl->args.pretend_args_size;
@@ -27235,7 +27239,11 @@ thumb1_expand_prologue (void)
/* Naked functions don't have prologues. */
if (IS_NAKED (func_type))
- return;
+ {
+ if (flag_stack_usage_info)
+ current_function_static_stack_size = 0;
+ return;
+ }
if (IS_INTERRUPT (func_type))
{
@@ -31724,6 +31732,38 @@ arm_emit_coreregs_64bit_shift (enum rtx_code code, rtx out, rtx in,
#undef BRANCH
}
+/* Returns true if the pattern is a valid symbolic address, which is either a
+ symbol_ref or (symbol_ref + addend).
+
+ According to the ARM ELF ABI, the initial addend of REL-type relocations
+ processing MOVW and MOVT instructions is formed by interpreting the 16-bit
+ literal field of the instruction as a 16-bit signed value in the range
+ -32768 <= A < 32768. */
+
+bool
+arm_valid_symbolic_address_p (rtx addr)
+{
+ rtx xop0, xop1 = NULL_RTX;
+ rtx tmp = addr;
+
+ if (GET_CODE (tmp) == SYMBOL_REF || GET_CODE (tmp) == LABEL_REF)
+ return true;
+
+ /* (const (plus: symbol_ref const_int)) */
+ if (GET_CODE (addr) == CONST)
+ tmp = XEXP (addr, 0);
+
+ if (GET_CODE (tmp) == PLUS)
+ {
+ xop0 = XEXP (tmp, 0);
+ xop1 = XEXP (tmp, 1);
+
+ if (GET_CODE (xop0) == SYMBOL_REF && CONST_INT_P (xop1))
+ return IN_RANGE (INTVAL (xop1), -0x8000, 0x7fff);
+ }
+
+ return false;
+}
/* Returns true if a valid comparison operation and makes
the operands in a form that is valid. */
diff --git a/gcc/config/arm/arm.h b/gcc/config/arm/arm.h
index 0f164c0cec4..6c1e01ee43f 100644
--- a/gcc/config/arm/arm.h
+++ b/gcc/config/arm/arm.h
@@ -369,6 +369,11 @@ extern void (*arm_lang_output_object_attributes_hook)(void);
/* Nonzero if this chip supports ldrex and strex */
#define TARGET_HAVE_LDREX ((arm_arch6 && TARGET_ARM) || arm_arch7)
+/* Nonzero if this chip supports LPAE. Such systems also support the
+ hardware divide instructions. */
+#define TARGET_HAVE_LPAE \
+ (arm_arch7 && arm_arch_arm_hwdiv && arm_arch_thumb_hwdiv)
+
/* Nonzero if this chip supports ldrex{bh} and strex{bh}. */
#define TARGET_HAVE_LDREXBH ((arm_arch6k && TARGET_ARM) || arm_arch7)
diff --git a/gcc/config/arm/arm.md b/gcc/config/arm/arm.md
index fd5024dc917..9b817a83720 100644
--- a/gcc/config/arm/arm.md
+++ b/gcc/config/arm/arm.md
@@ -3361,8 +3361,22 @@
"#" ; "orr%?\\t%0, %1, %2\;bic%?\\t%0, %0, %3"
"&& reload_completed"
[(set (match_dup 0) (ior:SI (match_dup 1) (match_dup 2)))
- (set (match_dup 0) (and:SI (not:SI (match_dup 3)) (match_dup 0)))]
- ""
+ (set (match_dup 0) (and:SI (match_dup 4) (match_dup 5)))]
+ {
+ /* If operands[3] is a constant make sure to fold the NOT into it
+ to avoid creating a NOT of a CONST_INT. */
+ rtx not_rtx = simplify_gen_unary (NOT, SImode, operands[3], SImode);
+ if (CONST_INT_P (not_rtx))
+ {
+ operands[4] = operands[0];
+ operands[5] = not_rtx;
+ }
+ else
+ {
+ operands[5] = operands[0];
+ operands[4] = not_rtx;
+ }
+ }
[(set_attr "length" "8")
(set_attr "ce_count" "2")
(set_attr "predicable" "yes")
@@ -6226,7 +6240,7 @@
[(set (match_operand:SI 0 "nonimmediate_operand" "=r")
(lo_sum:SI (match_operand:SI 1 "nonimmediate_operand" "0")
(match_operand:SI 2 "general_operand" "i")))]
- "arm_arch_thumb2"
+ "arm_arch_thumb2 && arm_valid_symbolic_address_p (operands[2])"
"movt%?\t%0, #:upper16:%c2"
[(set_attr "predicable" "yes")
(set_attr "predicable_short_it" "no")
@@ -7220,7 +7234,7 @@
(define_insn "*arm32_movhf"
[(set (match_operand:HF 0 "nonimmediate_operand" "=r,m,r,r")
(match_operand:HF 1 "general_operand" " m,r,r,F"))]
- "TARGET_32BIT && !(TARGET_HARD_FLOAT && TARGET_FP16) && !arm_restrict_it
+ "TARGET_32BIT && !(TARGET_HARD_FLOAT && TARGET_FP16)
&& ( s_register_operand (operands[0], HFmode)
|| s_register_operand (operands[1], HFmode))"
"*
@@ -7258,7 +7272,8 @@
[(set_attr "conds" "unconditional")
(set_attr "type" "load1,store1,mov_reg,multiple")
(set_attr "length" "4,4,4,8")
- (set_attr "predicable" "yes")]
+ (set_attr "predicable" "yes")
+ (set_attr "predicable_short_it" "no")]
)
(define_insn "*thumb1_movhf"
diff --git a/gcc/config/arm/constraints.md b/gcc/config/arm/constraints.md
index 62da4fd3987..aa3faaa970a 100644
--- a/gcc/config/arm/constraints.md
+++ b/gcc/config/arm/constraints.md
@@ -67,9 +67,10 @@
(define_constraint "j"
"A constant suitable for a MOVW instruction. (ARM/Thumb-2)"
(and (match_test "TARGET_32BIT && arm_arch_thumb2")
- (ior (match_code "high")
+ (ior (and (match_code "high")
+ (match_test "arm_valid_symbolic_address_p (XEXP (op, 0))"))
(and (match_code "const_int")
- (match_test "(ival & 0xffff0000) == 0")))))
+ (match_test "(ival & 0xffff0000) == 0")))))
(define_constraint "Pj"
"@internal A 12-bit constant suitable for an ADDW or SUBW instruction. (Thumb-2)"
diff --git a/gcc/config/arm/driver-arm.c b/gcc/config/arm/driver-arm.c
index bdaf48a9de4..dabacf0d223 100644
--- a/gcc/config/arm/driver-arm.c
+++ b/gcc/config/arm/driver-arm.c
@@ -125,12 +125,11 @@ host_detect_local_cpu (int argc, const char **argv)
}
}
- fclose (f);
-
- if (val == NULL)
- goto not_found;
-
- return concat ("-m", argv[0], "=", val, NULL);
+ if (val)
+ {
+ fclose (f);
+ return concat ("-m", argv[0], "=", val, NULL);
+ }
not_found:
{
diff --git a/gcc/config/arm/sync.md b/gcc/config/arm/sync.md
index 25ed926fc4e..773b4b45fa4 100644
--- a/gcc/config/arm/sync.md
+++ b/gcc/config/arm/sync.md
@@ -103,31 +103,61 @@
[(set_attr "predicable" "yes")
(set_attr "predicable_short_it" "no")])
-;; Note that ldrd and vldr are *not* guaranteed to be single-copy atomic,
-;; even for a 64-bit aligned address. Instead we use a ldrexd unparied
-;; with a store.
+;; An LDRD instruction usable by the atomic_loaddi expander on LPAE targets
+
+(define_insn "arm_atomic_loaddi2_ldrd"
+ [(set (match_operand:DI 0 "register_operand" "=r")
+ (unspec_volatile:DI
+ [(match_operand:DI 1 "arm_sync_memory_operand" "Q")]
+ VUNSPEC_LDRD_ATOMIC))]
+ "ARM_DOUBLEWORD_ALIGN && TARGET_HAVE_LPAE"
+ "ldr%(d%)\t%0, %H0, %C1"
+ [(set_attr "predicable" "yes")
+ (set_attr "predicable_short_it" "no")])
+
+;; There are three ways to expand this depending on the architecture
+;; features available. As for the barriers, a load needs a barrier
+;; after it on all non-relaxed memory models except when the load
+;; has acquire semantics (for ARMv8-A).
+
(define_expand "atomic_loaddi"
[(match_operand:DI 0 "s_register_operand") ;; val out
(match_operand:DI 1 "mem_noofs_operand") ;; memory
(match_operand:SI 2 "const_int_operand")] ;; model
- "TARGET_HAVE_LDREXD && ARM_DOUBLEWORD_ALIGN"
+ "(TARGET_HAVE_LDREXD || TARGET_HAVE_LPAE || TARGET_HAVE_LDACQ)
+ && ARM_DOUBLEWORD_ALIGN"
{
enum memmodel model = (enum memmodel) INTVAL (operands[2]);
- expand_mem_thread_fence (model);
- emit_insn (gen_atomic_loaddi_1 (operands[0], operands[1]));
- if (model == MEMMODEL_SEQ_CST)
- expand_mem_thread_fence (model);
- DONE;
-})
-(define_insn "atomic_loaddi_1"
- [(set (match_operand:DI 0 "s_register_operand" "=r")
- (unspec:DI [(match_operand:DI 1 "mem_noofs_operand" "Ua")]
- UNSPEC_LL))]
- "TARGET_HAVE_LDREXD && ARM_DOUBLEWORD_ALIGN"
- "ldrexd%?\t%0, %H0, %C1"
- [(set_attr "predicable" "yes")
- (set_attr "predicable_short_it" "no")])
+ /* For ARMv8-A we can use an LDAEXD to atomically load two 32-bit registers
+ when acquire or stronger semantics are needed. When the relaxed model is
+ used this can be relaxed to a normal LDRD. */
+ if (TARGET_HAVE_LDACQ)
+ {
+ if (model == MEMMODEL_RELAXED)
+ emit_insn (gen_arm_atomic_loaddi2_ldrd (operands[0], operands[1]));
+ else
+ emit_insn (gen_arm_load_acquire_exclusivedi (operands[0], operands[1]));
+
+ DONE;
+ }
+
+ /* On LPAE targets LDRD and STRD accesses to 64-bit aligned
+ locations are 64-bit single-copy atomic. We still need barriers in the
+ appropriate places to implement the ordering constraints. */
+ if (TARGET_HAVE_LPAE)
+ emit_insn (gen_arm_atomic_loaddi2_ldrd (operands[0], operands[1]));
+ else
+ emit_insn (gen_arm_load_exclusivedi (operands[0], operands[1]));
+
+
+ /* All non-relaxed models need a barrier after the load when load-acquire
+ instructions are not available. */
+ if (model != MEMMODEL_RELAXED)
+ expand_mem_thread_fence (model);
+
+ DONE;
+})
(define_expand "atomic_compare_and_swap<mode>"
[(match_operand:SI 0 "s_register_operand" "") ;; bool out
diff --git a/gcc/config/arm/thumb2.md b/gcc/config/arm/thumb2.md
index 2fb55486c75..7f3d3d4de21 100644
--- a/gcc/config/arm/thumb2.md
+++ b/gcc/config/arm/thumb2.md
@@ -653,15 +653,27 @@
(set_attr "type" "multiple")]
)
-(define_insn "*thumb2_ior_scc_strict_it"
- [(set (match_operand:SI 0 "s_register_operand" "=l,l")
+(define_insn_and_split "*thumb2_ior_scc_strict_it"
+ [(set (match_operand:SI 0 "s_register_operand" "=&r")
(ior:SI (match_operator:SI 2 "arm_comparison_operator"
[(match_operand 3 "cc_register" "") (const_int 0)])
- (match_operand:SI 1 "s_register_operand" "0,?l")))]
+ (match_operand:SI 1 "s_register_operand" "r")))]
"TARGET_THUMB2 && arm_restrict_it"
- "@
- it\\t%d2\;mov%d2\\t%0, #1\;it\\t%d2\;orr%d2\\t%0, %1
- mov\\t%0, #1\;orr\\t%0, %1\;it\\t%D2\;mov%D2\\t%0, %1"
+ "#" ; orr\\t%0, %1, #1\;it\\t%D2\;mov%D2\\t%0, %1
+ "&& reload_completed"
+ [(set (match_dup 0) (ior:SI (match_dup 1) (const_int 1)))
+ (cond_exec (match_dup 4)
+ (set (match_dup 0) (match_dup 1)))]
+ {
+ machine_mode mode = GET_MODE (operands[3]);
+ rtx_code rc = GET_CODE (operands[2]);
+
+ if (mode == CCFPmode || mode == CCFPEmode)
+ rc = reverse_condition_maybe_unordered (rc);
+ else
+ rc = reverse_condition (rc);
+ operands[4] = gen_rtx_fmt_ee (rc, VOIDmode, operands[3], const0_rtx);
+ }
[(set_attr "conds" "use")
(set_attr "length" "8")
(set_attr "type" "multiple")]
@@ -1517,7 +1529,8 @@
(match_operand 5 "" "")
(match_operand 6 "" "")))]
"TARGET_THUMB2
- && (INTVAL (operands[2]) >= 0 && INTVAL (operands[2]) < 32)"
+ && (INTVAL (operands[2]) >= 0 && INTVAL (operands[2]) < 32)
+ && peep2_reg_dead_p (2, operands[0])"
[(parallel [(set (match_dup 0)
(compare:CC_NOOV (ashift:SI (match_dup 1) (match_dup 2))
(const_int 0)))
@@ -1545,7 +1558,8 @@
(match_operand 5 "" "")
(match_operand 6 "" "")))]
"TARGET_THUMB2
- && (INTVAL (operands[2]) > 0 && INTVAL (operands[2]) < 32)"
+ && (INTVAL (operands[2]) > 0 && INTVAL (operands[2]) < 32)
+ && peep2_reg_dead_p (2, operands[0])"
[(parallel [(set (match_dup 0)
(compare:CC_NOOV (ashift:SI (match_dup 1) (match_dup 2))
(const_int 0)))
diff --git a/gcc/config/arm/unspecs.md b/gcc/config/arm/unspecs.md
index 147cb802d41..188f467f161 100644
--- a/gcc/config/arm/unspecs.md
+++ b/gcc/config/arm/unspecs.md
@@ -138,6 +138,7 @@
VUNSPEC_ATOMIC_XCHG ; Represent an atomic exchange.
VUNSPEC_ATOMIC_OP ; Represent an atomic operation.
VUNSPEC_LL ; Represent a load-register-exclusive.
+ VUNSPEC_LDRD_ATOMIC ; Represent an LDRD used as an atomic DImode load.
VUNSPEC_SC ; Represent a store-register-exclusive.
VUNSPEC_LAX ; Represent a load-register-acquire-exclusive.
VUNSPEC_SLX ; Represent a store-register-release-exclusive.
diff --git a/gcc/config/avr/avr.md b/gcc/config/avr/avr.md
index 07286206d0f..e385665847f 100644
--- a/gcc/config/avr/avr.md
+++ b/gcc/config/avr/avr.md
@@ -621,6 +621,22 @@
if (avr_mem_flash_p (dest))
DONE;
+ if (QImode == <MODE>mode
+ && SUBREG == GET_CODE (src)
+ && CONSTANT_ADDRESS_P (SUBREG_REG (src))
+ && can_create_pseudo_p())
+ {
+ // store_bitfield may want to store a SYMBOL_REF or CONST in a
+ // structure that's represented as PSImode. As the upper 16 bits
+ // of PSImode cannot be expressed as an HImode subreg, the rhs is
+ // decomposed into QImode (word_mode) subregs of SYMBOL_REF,
+ // CONST or LABEL_REF; cf. PR71103.
+
+ rtx const_addr = SUBREG_REG (src);
+ operands[1] = src = copy_rtx (src);
+ SUBREG_REG (src) = copy_to_mode_reg (GET_MODE (const_addr), const_addr);
+ }
+
/* One of the operands has to be in a register. */
if (!register_operand (dest, <MODE>mode)
&& !reg_or_0_operand (src, <MODE>mode))
diff --git a/gcc/config/avr/driver-avr.c b/gcc/config/avr/driver-avr.c
index 2d95f1b797c..4a879751535 100644
--- a/gcc/config/avr/driver-avr.c
+++ b/gcc/config/avr/driver-avr.c
@@ -101,7 +101,7 @@ avr_device_to_data_start (int argc, const char **argv)
snprintf (data_section_start_str, sizeof(data_section_start_str) - 1,
"0x%lX", data_section_start);
- return concat ("-Tdata ", data_section_start_str, NULL);
+ return concat ("%{!Tdata:-Tdata ", data_section_start_str, "}", NULL);
}
/* Returns command line parameters that describe the device startfile. */
diff --git a/gcc/config/darwin.h b/gcc/config/darwin.h
index 12636409979..f8fd2fef3b4 100644
--- a/gcc/config/darwin.h
+++ b/gcc/config/darwin.h
@@ -1,5 +1,5 @@
/* Target definitions for Darwin (Mac OS X) systems.
- Copyright (C) 1989-2014 Free Software Foundation, Inc.
+ Copyright (C) 1989-2016 Free Software Foundation, Inc.
Contributed by Apple Computer Inc.
This file is part of GCC.
@@ -392,12 +392,13 @@ extern GTY(()) int darwin_ms_struct;
#define ASM_DEBUG_SPEC "%{g*:%{!g0:%{!gdwarf*:--gstabs}}}"
-/* We still allow output of STABS. */
-
+/* We still allow output of STABS if the assembler supports it. */
+#ifdef HAVE_AS_STABS_DIRECTIVE
#define DBX_DEBUGGING_INFO 1
+#define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
+#endif
#define DWARF2_DEBUGGING_INFO 1
-#define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
#define DEBUG_FRAME_SECTION "__DWARF,__debug_frame,regular,debug"
#define DEBUG_INFO_SECTION "__DWARF,__debug_info,regular,debug"
diff --git a/gcc/config/freebsd-spec.h b/gcc/config/freebsd-spec.h
index 8e770066973..1e975575604 100644
--- a/gcc/config/freebsd-spec.h
+++ b/gcc/config/freebsd-spec.h
@@ -66,8 +66,9 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
"%{!shared: \
%{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} \
%{!p:%{profile:gcrt1.o%s} \
- %{!profile:crt1.o%s}}}} \
- crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
+ %{!profile: \
+ %{pie: Scrt1.o%s;:crt1.o%s}}}}} \
+ crti.o%s %{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s}"
/* Provide a ENDFILE_SPEC appropriate for FreeBSD. Here we tack on
the magical crtend.o file (see crtstuff.c) which provides part of
@@ -76,7 +77,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
`crtn.o'. */
#define FBSD_ENDFILE_SPEC \
- "%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s"
+ "%{shared|pie:crtendS.o%s;:crtend.o%s} crtn.o%s"
/* Provide a LIB_SPEC appropriate for FreeBSD as configured and as
required by the user-land thread model. Before __FreeBSD_version
diff --git a/gcc/config/i386/constraints.md b/gcc/config/i386/constraints.md
index 567e705646a..b662f8747d6 100644
--- a/gcc/config/i386/constraints.md
+++ b/gcc/config/i386/constraints.md
@@ -18,7 +18,7 @@
;; <http://www.gnu.org/licenses/>.
;;; Unused letters:
-;;; B H
+;;; H
;;; h j
;; Integer register constraints.
@@ -156,6 +156,10 @@
(and (not (match_test "TARGET_X32"))
(match_operand 0 "memory_operand")))
+(define_constraint "BC"
+ "@internal SSE constant operand."
+ (match_test "standard_sse_constant_p (op)"))
+
;; Integer constant constraints.
(define_constraint "I"
"Integer constant in the range 0 @dots{} 31, for 32-bit shifts."
@@ -206,8 +210,8 @@
;; This can theoretically be any mode's CONST0_RTX.
(define_constraint "C"
- "Standard SSE floating point constant."
- (match_test "standard_sse_constant_p (op)"))
+ "SSE constant zero operand."
+ (match_test "standard_sse_constant_p (op) == 1"))
;; Constant-or-symbol-reference constraints.
diff --git a/gcc/config/i386/darwin.h b/gcc/config/i386/darwin.h
index a85aa42d5fc..185bf31c2fe 100644
--- a/gcc/config/i386/darwin.h
+++ b/gcc/config/i386/darwin.h
@@ -1,5 +1,5 @@
/* Target definitions for x86 running Darwin.
- Copyright (C) 2001-2014 Free Software Foundation, Inc.
+ Copyright (C) 2001-2016 Free Software Foundation, Inc.
Contributed by Apple Computer Inc.
This file is part of GCC.
@@ -242,7 +242,11 @@ do { \
compiles default to stabs+. darwin9+ defaults to dwarf-2. */
#ifndef DARWIN_PREFER_DWARF
#undef PREFERRED_DEBUGGING_TYPE
+#ifdef HAVE_AS_STABS_DIRECTIVE
#define PREFERRED_DEBUGGING_TYPE (TARGET_64BIT ? DWARF2_DEBUG : DBX_DEBUG)
+#else
+#define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG
+#endif
#endif
/* Darwin uses the standard DWARF register numbers but the default
diff --git a/gcc/config/i386/driver-i386.c b/gcc/config/i386/driver-i386.c
index 992f91f8a57..20866db3546 100644
--- a/gcc/config/i386/driver-i386.c
+++ b/gcc/config/i386/driver-i386.c
@@ -596,33 +596,27 @@ const char *host_detect_local_cpu (int argc, const char **argv)
}
else if (vendor == signature_CENTAUR_ebx)
{
- if (arch)
+ processor = PROCESSOR_GENERIC;
+
+ switch (family)
{
- switch (family)
- {
- case 6:
- if (model > 9)
- /* Use the default detection procedure. */
- processor = PROCESSOR_GENERIC;
- else if (model == 9)
- cpu = "c3-2";
- else if (model >= 6)
- cpu = "c3";
- else
- processor = PROCESSOR_GENERIC;
- break;
- case 5:
- if (has_3dnow)
- cpu = "winchip2";
- else if (has_mmx)
- cpu = "winchip2-c6";
- else
- processor = PROCESSOR_GENERIC;
- break;
- default:
- /* We have no idea. */
- processor = PROCESSOR_GENERIC;
- }
+ default:
+ /* We have no idea. */
+ break;
+
+ case 5:
+ if (has_3dnow || has_mmx)
+ processor = PROCESSOR_I486;
+ break;
+
+ case 6:
+ if (model > 9 || has_longmode)
+ /* Use the default detection procedure. */
+ ;
+ else if (model == 9)
+ processor = PROCESSOR_PENTIUMPRO;
+ else if (model >= 6)
+ processor = PROCESSOR_I486;
}
}
else
@@ -653,7 +647,18 @@ const char *host_detect_local_cpu (int argc, const char **argv)
/* Default. */
break;
case PROCESSOR_I486:
- cpu = "i486";
+ if (arch && vendor == signature_CENTAUR_ebx)
+ {
+ if (model >= 6)
+ cpu = "c3";
+ else if (has_3dnow)
+ cpu = "winchip2";
+ else
+ /* Assume WinChip C6. */
+ cpu = "winchip-c6";
+ }
+ else
+ cpu = "i486";
break;
case PROCESSOR_PENTIUM:
if (arch && has_mmx)
@@ -766,8 +771,13 @@ const char *host_detect_local_cpu (int argc, const char **argv)
/* It is Pentium M. */
cpu = "pentium-m";
else if (has_sse)
- /* It is Pentium III. */
- cpu = "pentium3";
+ {
+ if (vendor == signature_CENTAUR_ebx)
+ cpu = "c3-2";
+ else
+ /* It is Pentium III. */
+ cpu = "pentium3";
+ }
else if (has_mmx)
/* It is Pentium II. */
cpu = "pentium2";
@@ -848,6 +858,11 @@ const char *host_detect_local_cpu (int argc, const char **argv)
else
cpu = "prescott";
}
+ else if (has_longmode)
+ /* Perhaps some emulator? Assume x86-64, otherwise gcc
+ -march=native would be unusable for 64-bit compilations,
+ as all the CPUs below are 32-bit only. */
+ cpu = "x86-64";
else if (has_sse2)
cpu = "pentium4";
else if (has_cmov)
diff --git a/gcc/config/i386/freebsd.h b/gcc/config/i386/freebsd.h
index bdca1b80b27..bb10ce5ba1c 100644
--- a/gcc/config/i386/freebsd.h
+++ b/gcc/config/i386/freebsd.h
@@ -59,28 +59,15 @@ along with GCC; see the file COPYING3. If not see
#define SUBTARGET_EXTRA_SPECS \
{ "fbsd_dynamic_linker", FBSD_DYNAMIC_LINKER }
-/* Provide a STARTFILE_SPEC appropriate for FreeBSD. Here we add
- the 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
-#define STARTFILE_SPEC \
- "%{!shared: \
- %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} \
- %{!p:%{profile:gcrt1.o%s} \
- %{!profile:crt1.o%s}}}} \
- crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
-
-/* Provide a ENDFILE_SPEC appropriate for FreeBSD. Here we tack on
- the magical crtend.o file (see crtstuff.c) which provides part of
- the support for getting C++ file-scope static object constructed
- before entering `main', followed by a normal "finalizer" file,
- `crtn.o'. */
-
-#undef ENDFILE_SPEC
-#define ENDFILE_SPEC \
- "%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s"
+/* Use the STARTFILE_SPEC from config/freebsd-spec.h. */
+
+#undef STARTFILE_SPEC
+#define STARTFILE_SPEC FBSD_STARTFILE_SPEC
+
+/* Use the ENDFILE_SPEC from config/freebsd-spec.h. */
+
+#undef ENDFILE_SPEC
+#define ENDFILE_SPEC FBSD_ENDFILE_SPEC
/* Provide a LINK_SPEC appropriate for FreeBSD. Here we provide support
for the special GCC options -static and -shared, which allow us to
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 663eb991cff..2b402854e84 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -528,17 +528,17 @@ struct processor_costs geode_cost = {
{4, 6, 6}, /* cost of storing fp registers
in SFmode, DFmode and XFmode */
- 1, /* cost of moving MMX register */
- {1, 1}, /* cost of loading MMX registers
+ 2, /* cost of moving MMX register */
+ {2, 2}, /* cost of loading MMX registers
in SImode and DImode */
- {1, 1}, /* cost of storing MMX registers
+ {2, 2}, /* cost of storing MMX registers
in SImode and DImode */
- 1, /* cost of moving SSE register */
- {1, 1, 1}, /* cost of loading SSE registers
+ 2, /* cost of moving SSE register */
+ {2, 2, 8}, /* cost of loading SSE registers
in SImode, DImode and TImode */
- {1, 1, 1}, /* cost of storing SSE registers
+ {2, 2, 8}, /* cost of storing SSE registers
in SImode, DImode and TImode */
- 1, /* MMX or SSE register to integer */
+ 3, /* MMX or SSE register to integer */
64, /* size of l1 cache. */
128, /* size of l2 cache. */
32, /* size of prefetch block */
@@ -4029,6 +4029,17 @@ ix86_option_override_internal (bool main_args_p,
opts->x_target_flags |= MASK_ACCUMULATE_OUTGOING_ARGS;
}
+ /* Stack realignment without -maccumulate-outgoing-args requires %ebp,
+ so enable -maccumulate-outgoing-args when %ebp is fixed. */
+ if (fixed_regs[BP_REG]
+ && !(opts->x_target_flags & MASK_ACCUMULATE_OUTGOING_ARGS))
+ {
+ if (opts_set->x_target_flags & MASK_ACCUMULATE_OUTGOING_ARGS)
+ warning (0, "fixed ebp register requires %saccumulate-outgoing-args%s",
+ prefix, suffix);
+ opts->x_target_flags |= MASK_ACCUMULATE_OUTGOING_ARGS;
+ }
+
/* Figure out what ASM_GENERATE_INTERNAL_LABEL builds as a prefix. */
{
char *p;
@@ -10441,8 +10452,6 @@ ix86_adjust_stack_and_probe (const HOST_WIDE_INT size)
release_scratch_register_on_entry (&sr);
}
- gcc_assert (cfun->machine->fs.cfa_reg != stack_pointer_rtx);
-
/* Even if the stack pointer isn't the CFA register, we need to correctly
describe the adjustments made to it, in particular differentiate the
frame-related ones from the frame-unrelated ones. */
@@ -10666,7 +10675,11 @@ ix86_finalize_stack_realign_flags (void)
&& !crtl->accesses_prior_frames
&& !cfun->calls_alloca
&& !crtl->calls_eh_return
- && !(flag_stack_check && STACK_CHECK_MOVING_SP)
+ /* See ira_setup_eliminable_regset for the rationale. */
+ && !(STACK_CHECK_MOVING_SP
+ && flag_stack_check
+ && flag_exceptions
+ && cfun->can_throw_non_call_exceptions)
&& !ix86_frame_pointer_required ()
&& get_frame_size () == 0
&& ix86_nsaved_sseregs () == 0
@@ -16905,12 +16918,29 @@ ix86_expand_vector_move (enum machine_mode mode, rtx operands[])
of the register, once we have that information we may be able
to handle some of them more efficiently. */
if (can_create_pseudo_p ()
- && register_operand (op0, mode)
&& (CONSTANT_P (op1)
|| (GET_CODE (op1) == SUBREG
&& CONSTANT_P (SUBREG_REG (op1))))
- && !standard_sse_constant_p (op1))
- op1 = validize_mem (force_const_mem (mode, op1));
+ && ((register_operand (op0, mode)
+ && !standard_sse_constant_p (op1))
+ /* ix86_expand_vector_move_misalign() does not like constants. */
+ || (SSE_REG_MODE_P (mode)
+ && MEM_P (op0)
+ && MEM_ALIGN (op0) < align)))
+ {
+ if (GET_CODE (op1) == SUBREG)
+ {
+ machine_mode imode = GET_MODE (SUBREG_REG (op1));
+ rtx r = force_const_mem (imode, SUBREG_REG (op1));
+ if (r)
+ r = validize_mem (r);
+ else
+ r = force_reg (imode, SUBREG_REG (op1));
+ op1 = simplify_gen_subreg (mode, r, imode, SUBREG_BYTE (op1));
+ }
+ else
+ op1 = validize_mem (force_const_mem (mode, op1));
+ }
/* We need to check memory alignment for SSE mode since attribute
can make operands unaligned. */
@@ -16921,13 +16951,8 @@ ix86_expand_vector_move (enum machine_mode mode, rtx operands[])
{
rtx tmp[2];
- /* ix86_expand_vector_move_misalign() does not like constants ... */
- if (CONSTANT_P (op1)
- || (GET_CODE (op1) == SUBREG
- && CONSTANT_P (SUBREG_REG (op1))))
- op1 = validize_mem (force_const_mem (mode, op1));
-
- /* ... nor both arguments in memory. */
+ /* ix86_expand_vector_move_misalign() does not like both
+ arguments in memory. */
if (!register_operand (op0, mode)
&& !register_operand (op1, mode))
op1 = force_reg (mode, op1);
@@ -17011,7 +17036,7 @@ ix86_avx256_split_vector_move_misalign (rtx op0, rtx op1)
m = adjust_address (op0, mode, 0);
emit_insn (extract (m, op1, const0_rtx));
m = adjust_address (op0, mode, 16);
- emit_insn (extract (m, op1, const1_rtx));
+ emit_insn (extract (m, copy_rtx (op1), const1_rtx));
}
else
emit_insn (store_unaligned (op0, op1));
@@ -17319,7 +17344,7 @@ ix86_expand_vector_move_misalign (enum machine_mode mode, rtx operands[])
m = adjust_address (op0, V2SFmode, 0);
emit_insn (gen_sse_storelps (m, op1));
m = adjust_address (op0, V2SFmode, 8);
- emit_insn (gen_sse_storehps (m, op1));
+ emit_insn (gen_sse_storehps (m, copy_rtx (op1)));
}
}
}
@@ -23592,7 +23617,7 @@ expand_small_movmem_or_setmem (rtx destmem, rtx srcmem,
if (DYNAMIC_CHECK)
Round COUNT down to multiple of SIZE
<< optional caller supplied zero size guard is here >>
- << optional caller suppplied dynamic check is here >>
+ << optional caller supplied dynamic check is here >>
<< caller supplied main copy loop is here >>
}
done_label:
@@ -23766,8 +23791,8 @@ expand_set_or_movmem_prologue_epilogue_by_misaligned_moves (rtx destmem, rtx src
else
*min_size = 0;
- /* Our loops always round down the bock size, but for dispatch to library
- we need precise value. */
+ /* Our loops always round down the block size, but for dispatch to
+ library we need precise value. */
if (dynamic_check)
*count = expand_simple_binop (GET_MODE (*count), AND, *count,
GEN_INT (-size), *count, 1, OPTAB_DIRECT);
@@ -24345,6 +24370,13 @@ ix86_expand_set_or_movmem (rtx dst, rtx src, rtx count_exp, rtx val_exp,
size_needed = GET_MODE_SIZE (move_mode) * unroll_factor;
epilogue_size_needed = size_needed;
+ /* If we are going to call any library calls conditionally, make sure any
+ pending stack adjustment happen before the first conditional branch,
+ otherwise they will be emitted before the library call only and won't
+ happen from the other branches. */
+ if (dynamic_check != -1)
+ do_pending_stack_adjust ();
+
desired_align = decide_alignment (align, alg, expected_size, move_mode);
if (!TARGET_ALIGN_STRINGOPS || noalign)
align = desired_align;
@@ -29201,9 +29233,9 @@ static const struct builtin_description bdesc_special_args[] =
{ OPTION_MASK_ISA_LWP, CODE_FOR_lwp_llwpcb, "__builtin_ia32_llwpcb", IX86_BUILTIN_LLWPCB, UNKNOWN, (int) VOID_FTYPE_PVOID },
{ OPTION_MASK_ISA_LWP, CODE_FOR_lwp_slwpcb, "__builtin_ia32_slwpcb", IX86_BUILTIN_SLWPCB, UNKNOWN, (int) PVOID_FTYPE_VOID },
{ OPTION_MASK_ISA_LWP, CODE_FOR_lwp_lwpvalsi3, "__builtin_ia32_lwpval32", IX86_BUILTIN_LWPVAL32, UNKNOWN, (int) VOID_FTYPE_UINT_UINT_UINT },
- { OPTION_MASK_ISA_LWP, CODE_FOR_lwp_lwpvaldi3, "__builtin_ia32_lwpval64", IX86_BUILTIN_LWPVAL64, UNKNOWN, (int) VOID_FTYPE_UINT64_UINT_UINT },
+ { OPTION_MASK_ISA_LWP | OPTION_MASK_ISA_64BIT, CODE_FOR_lwp_lwpvaldi3, "__builtin_ia32_lwpval64", IX86_BUILTIN_LWPVAL64, UNKNOWN, (int) VOID_FTYPE_UINT64_UINT_UINT },
{ OPTION_MASK_ISA_LWP, CODE_FOR_lwp_lwpinssi3, "__builtin_ia32_lwpins32", IX86_BUILTIN_LWPINS32, UNKNOWN, (int) UCHAR_FTYPE_UINT_UINT_UINT },
- { OPTION_MASK_ISA_LWP, CODE_FOR_lwp_lwpinsdi3, "__builtin_ia32_lwpins64", IX86_BUILTIN_LWPINS64, UNKNOWN, (int) UCHAR_FTYPE_UINT64_UINT_UINT },
+ { OPTION_MASK_ISA_LWP | OPTION_MASK_ISA_64BIT, CODE_FOR_lwp_lwpinsdi3, "__builtin_ia32_lwpins64", IX86_BUILTIN_LWPINS64, UNKNOWN, (int) UCHAR_FTYPE_UINT64_UINT_UINT },
/* FSGSBASE */
{ OPTION_MASK_ISA_FSGSBASE | OPTION_MASK_ISA_64BIT, CODE_FOR_rdfsbasesi, "__builtin_ia32_rdfsbase32", IX86_BUILTIN_RDFSBASE32, UNKNOWN, (int) UNSIGNED_FTYPE_VOID },
@@ -30029,12 +30061,12 @@ static const struct builtin_description bdesc_args[] =
/* BMI */
{ OPTION_MASK_ISA_BMI, CODE_FOR_bmi_bextr_si, "__builtin_ia32_bextr_u32", IX86_BUILTIN_BEXTR32, UNKNOWN, (int) UINT_FTYPE_UINT_UINT },
- { OPTION_MASK_ISA_BMI, CODE_FOR_bmi_bextr_di, "__builtin_ia32_bextr_u64", IX86_BUILTIN_BEXTR64, UNKNOWN, (int) UINT64_FTYPE_UINT64_UINT64 },
+ { OPTION_MASK_ISA_BMI | OPTION_MASK_ISA_64BIT, CODE_FOR_bmi_bextr_di, "__builtin_ia32_bextr_u64", IX86_BUILTIN_BEXTR64, UNKNOWN, (int) UINT64_FTYPE_UINT64_UINT64 },
{ OPTION_MASK_ISA_BMI, CODE_FOR_ctzhi2, "__builtin_ctzs", IX86_BUILTIN_CTZS, UNKNOWN, (int) UINT16_FTYPE_UINT16 },
/* TBM */
{ OPTION_MASK_ISA_TBM, CODE_FOR_tbm_bextri_si, "__builtin_ia32_bextri_u32", IX86_BUILTIN_BEXTRI32, UNKNOWN, (int) UINT_FTYPE_UINT_UINT },
- { OPTION_MASK_ISA_TBM, CODE_FOR_tbm_bextri_di, "__builtin_ia32_bextri_u64", IX86_BUILTIN_BEXTRI64, UNKNOWN, (int) UINT64_FTYPE_UINT64_UINT64 },
+ { OPTION_MASK_ISA_TBM | OPTION_MASK_ISA_64BIT, CODE_FOR_tbm_bextri_di, "__builtin_ia32_bextri_u64", IX86_BUILTIN_BEXTRI64, UNKNOWN, (int) UINT64_FTYPE_UINT64_UINT64 },
/* F16C */
{ OPTION_MASK_ISA_F16C, CODE_FOR_vcvtph2ps, "__builtin_ia32_vcvtph2ps", IX86_BUILTIN_CVTPH2PS, UNKNOWN, (int) V4SF_FTYPE_V8HI },
@@ -30044,11 +30076,11 @@ static const struct builtin_description bdesc_args[] =
/* BMI2 */
{ OPTION_MASK_ISA_BMI2, CODE_FOR_bmi2_bzhi_si3, "__builtin_ia32_bzhi_si", IX86_BUILTIN_BZHI32, UNKNOWN, (int) UINT_FTYPE_UINT_UINT },
- { OPTION_MASK_ISA_BMI2, CODE_FOR_bmi2_bzhi_di3, "__builtin_ia32_bzhi_di", IX86_BUILTIN_BZHI64, UNKNOWN, (int) UINT64_FTYPE_UINT64_UINT64 },
+ { OPTION_MASK_ISA_BMI2 | OPTION_MASK_ISA_64BIT, CODE_FOR_bmi2_bzhi_di3, "__builtin_ia32_bzhi_di", IX86_BUILTIN_BZHI64, UNKNOWN, (int) UINT64_FTYPE_UINT64_UINT64 },
{ OPTION_MASK_ISA_BMI2, CODE_FOR_bmi2_pdep_si3, "__builtin_ia32_pdep_si", IX86_BUILTIN_PDEP32, UNKNOWN, (int) UINT_FTYPE_UINT_UINT },
- { OPTION_MASK_ISA_BMI2, CODE_FOR_bmi2_pdep_di3, "__builtin_ia32_pdep_di", IX86_BUILTIN_PDEP64, UNKNOWN, (int) UINT64_FTYPE_UINT64_UINT64 },
+ { OPTION_MASK_ISA_BMI2 | OPTION_MASK_ISA_64BIT, CODE_FOR_bmi2_pdep_di3, "__builtin_ia32_pdep_di", IX86_BUILTIN_PDEP64, UNKNOWN, (int) UINT64_FTYPE_UINT64_UINT64 },
{ OPTION_MASK_ISA_BMI2, CODE_FOR_bmi2_pext_si3, "__builtin_ia32_pext_si", IX86_BUILTIN_PEXT32, UNKNOWN, (int) UINT_FTYPE_UINT_UINT },
- { OPTION_MASK_ISA_BMI2, CODE_FOR_bmi2_pext_di3, "__builtin_ia32_pext_di", IX86_BUILTIN_PEXT64, UNKNOWN, (int) UINT64_FTYPE_UINT64_UINT64 },
+ { OPTION_MASK_ISA_BMI2 | OPTION_MASK_ISA_64BIT, CODE_FOR_bmi2_pext_di3, "__builtin_ia32_pext_di", IX86_BUILTIN_PEXT64, UNKNOWN, (int) UINT64_FTYPE_UINT64_UINT64 },
/* AVX512F */
{ OPTION_MASK_ISA_AVX512F, CODE_FOR_avx512f_alignv16si_mask, "__builtin_ia32_alignd512_mask", IX86_BUILTIN_ALIGND512, UNKNOWN, (int) V16SI_FTYPE_V16SI_V16SI_INT_V16SI_HI },
@@ -34233,6 +34265,7 @@ ix86_expand_args_builtin (const struct builtin_description *d,
case 5:
pat = GEN_FCN (icode) (real_target, args[0].op, args[1].op,
args[2].op, args[3].op, args[4].op);
+ break;
case 6:
pat = GEN_FCN (icode) (real_target, args[0].op, args[1].op,
args[2].op, args[3].op, args[4].op,
@@ -34602,6 +34635,7 @@ ix86_expand_round_builtin (const struct builtin_description *d,
case 5:
pat = GEN_FCN (icode) (target, args[0].op, args[1].op,
args[2].op, args[3].op, args[4].op);
+ break;
case 6:
pat = GEN_FCN (icode) (target, args[0].op, args[1].op,
args[2].op, args[3].op, args[4].op,
@@ -40647,6 +40681,7 @@ ix86_expand_vector_set (bool mmx_ok, rtx target, rtx val, int elt)
{
/* For SSE1, we have to reuse the V4SF code. */
rtx t = gen_reg_rtx (V4SFmode);
+ emit_move_insn (t, gen_lowpart (V4SFmode, target));
ix86_expand_vector_set (false, t, gen_lowpart (SFmode, val), elt);
emit_move_insn (target, gen_lowpart (mode, t));
}
diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
index 2b19f6e307e..97a4f108712 100644
--- a/gcc/config/i386/i386.md
+++ b/gcc/config/i386/i386.md
@@ -1782,7 +1782,7 @@
[(set (match_operand:XI 0 "nonimmediate_operand")
(match_operand:XI 1 "general_operand"))]
"TARGET_AVX512F"
- "ix86_expand_move (XImode, operands); DONE;")
+ "ix86_expand_vector_move (XImode, operands); DONE;")
;; Reload patterns to support multi-word load/store
;; with non-offsetable address.
@@ -1822,11 +1822,11 @@
[(set (match_operand:OI 0 "nonimmediate_operand")
(match_operand:OI 1 "general_operand"))]
"TARGET_AVX"
- "ix86_expand_move (OImode, operands); DONE;")
+ "ix86_expand_vector_move (OImode, operands); DONE;")
(define_expand "movti"
[(set (match_operand:TI 0 "nonimmediate_operand")
- (match_operand:TI 1 "nonimmediate_operand"))]
+ (match_operand:TI 1 "general_operand"))]
"TARGET_64BIT || TARGET_SSE"
{
if (TARGET_64BIT)
@@ -11248,7 +11248,8 @@
(zero_extend (match_dup 1)))]
"(peep2_reg_dead_p (3, operands[1])
|| operands_match_p (operands[1], operands[3]))
- && ! reg_overlap_mentioned_p (operands[3], operands[0])"
+ && ! reg_overlap_mentioned_p (operands[3], operands[0])
+ && ! reg_set_p (operands[3], operands[4])"
[(parallel [(set (match_dup 5) (match_dup 0))
(match_dup 4)])
(set (strict_low_part (match_dup 6))
@@ -11291,7 +11292,8 @@
(clobber (reg:CC FLAGS_REG))])]
"(peep2_reg_dead_p (3, operands[1])
|| operands_match_p (operands[1], operands[3]))
- && ! reg_overlap_mentioned_p (operands[3], operands[0])"
+ && ! reg_overlap_mentioned_p (operands[3], operands[0])
+ && ! reg_set_p (operands[3], operands[4])"
[(parallel [(set (match_dup 5) (match_dup 0))
(match_dup 4)])
(set (strict_low_part (match_dup 6))
@@ -11584,10 +11586,14 @@
;; We need to disable this for TARGET_SEH, as otherwise
;; shrink-wrapped prologue gets enabled too. This might exceed
;; the maximum size of prologue in unwind information.
+;; Also disallow shrink-wrapping if using stack slot to pass the
+;; static chain pointer - the first instruction has to be pushl %esi
+;; and it can't be moved around, as we use alternate entry points
+;; in that case.
(define_expand "simple_return"
[(simple_return)]
- "!TARGET_SEH"
+ "!TARGET_SEH && !ix86_static_chain_on_stack"
{
if (crtl->args.pops_args)
{
diff --git a/gcc/config/i386/sol2-9.h b/gcc/config/i386/sol2-9.h
deleted file mode 100644
index 9ae88aae5dc..00000000000
--- a/gcc/config/i386/sol2-9.h
+++ /dev/null
@@ -1,23 +0,0 @@
-/* Target definitions for GCC for Intel 80386 running Solaris 9
- Copyright (C) 2014 Free Software Foundation, Inc.
-
-This file is part of GCC.
-
-GCC is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 3, or (at your option)
-any later version.
-
-GCC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GCC; see the file COPYING3. If not see
-<http://www.gnu.org/licenses/>. */
-
-/* Solaris 9 only guarantees 4-byte stack alignment as required by the i386
- psABI, so realign it as necessary for SSE instructions. */
-#undef STACK_REALIGN_DEFAULT
-#define STACK_REALIGN_DEFAULT 1
diff --git a/gcc/config/i386/sol2.h b/gcc/config/i386/sol2.h
index 8a21a59109d..2ce7a401848 100644
--- a/gcc/config/i386/sol2.h
+++ b/gcc/config/i386/sol2.h
@@ -25,6 +25,11 @@ along with GCC; see the file COPYING3. If not see
#define TARGET_SUBTARGET_DEFAULT \
(MASK_80387 | MASK_IEEE_FP | MASK_FLOAT_RETURNS | MASK_VECT8_RETURNS)
+/* 32-bit Solaris/x86 only guarantees 4-byte stack alignment as required by
+ the i386 psABI, so realign it as necessary for SSE instructions. */
+#undef STACK_REALIGN_DEFAULT
+#define STACK_REALIGN_DEFAULT (TARGET_64BIT ? 0 : 1)
+
/* Old versions of the Solaris assembler can not handle the difference of
labels in different sections, so force DW_EH_PE_datarel. */
#undef ASM_PREFERRED_EH_DATA_FORMAT
diff --git a/gcc/config/i386/sse.md b/gcc/config/i386/sse.md
index 3e35268fc9c..84b4782dd41 100644
--- a/gcc/config/i386/sse.md
+++ b/gcc/config/i386/sse.md
@@ -546,7 +546,8 @@
;; Pointer size override for scalar modes (Intel asm dialect)
(define_mode_attr iptr
- [(V32QI "b") (V16HI "w") (V8SI "k") (V4DI "q")
+ [(V16SI "k") (V8DI "q")
+ (V32QI "b") (V16HI "w") (V8SI "k") (V4DI "q")
(V16QI "b") (V8HI "w") (V4SI "k") (V2DI "q")
(V8SF "k") (V4DF "q")
(V4SF "k") (V2DF "q")
@@ -655,7 +656,7 @@
(define_insn "*mov<mode>_internal"
[(set (match_operand:VMOVE 0 "nonimmediate_operand" "=v,v ,m")
- (match_operand:VMOVE 1 "nonimmediate_or_sse_const_operand" "C ,vm,v"))]
+ (match_operand:VMOVE 1 "nonimmediate_or_sse_const_operand" "BC,vm,v"))]
"TARGET_SSE
&& (register_operand (operands[0], <MODE>mode)
|| register_operand (operands[1], <MODE>mode))"
@@ -9725,13 +9726,13 @@
{
int mask = INTVAL (operands[3]);
if (mask == 0)
- emit_insn (gen_vec_set_lo_<mode>_mask
- (operands[0], operands[1], operands[2],
- operands[4], operands[5]));
+ emit_insn (gen_vec_set_lo_<mode>_mask (operands[0], operands[1],
+ operands[2], operands[4],
+ operands[5]));
else
- emit_insn (gen_vec_set_hi_<mode>_mask
- (operands[0], operands[1], operands[2],
- operands[4], operands[5]));
+ emit_insn (gen_vec_set_hi_<mode>_mask (operands[0], operands[1],
+ operands[2], operands[4],
+ operands[5]));
DONE;
})
@@ -9742,7 +9743,7 @@
(vec_select:<ssehalfvecmode>
(match_operand:V8FI 1 "register_operand" "v")
(parallel [(const_int 4) (const_int 5)
- (const_int 6) (const_int 7)]))))]
+ (const_int 6) (const_int 7)]))))]
"TARGET_AVX512F"
"vinsert<shuffletype>64x4\t{$0x0, %2, %1, %0<mask_operand3>|%0<mask_operand3>, %1, %2, $0x0}"
[(set_attr "type" "sselog")
@@ -9753,11 +9754,11 @@
(define_insn "vec_set_hi_<mode><mask_name>"
[(set (match_operand:V8FI 0 "register_operand" "=v")
(vec_concat:V8FI
- (match_operand:<ssehalfvecmode> 2 "nonimmediate_operand" "vm")
(vec_select:<ssehalfvecmode>
(match_operand:V8FI 1 "register_operand" "v")
(parallel [(const_int 0) (const_int 1)
- (const_int 2) (const_int 3)]))))]
+ (const_int 2) (const_int 3)]))
+ (match_operand:<ssehalfvecmode> 2 "nonimmediate_operand" "vm")))]
"TARGET_AVX512F"
"vinsert<shuffletype>64x4\t{$0x1, %2, %1, %0<mask_operand3>|%0<mask_operand3>, %1, %2, $0x1}"
[(set_attr "type" "sselog")
diff --git a/gcc/config/ia64/ia64.c b/gcc/config/ia64/ia64.c
index 7e6ee17be6a..afa1de4883c 100644
--- a/gcc/config/ia64/ia64.c
+++ b/gcc/config/ia64/ia64.c
@@ -1095,6 +1095,15 @@ ia64_expand_load_address (rtx dest, rtx src)
emit_insn (gen_load_fptr (dest, src));
else if (sdata_symbolic_operand (src, VOIDmode))
emit_insn (gen_load_gprel (dest, src));
+ else if (local_symbolic_operand64 (src, VOIDmode))
+ {
+ /* We want to use @gprel rather than @ltoff relocations for local
+ symbols:
+ - @gprel does not require dynamic linker
+ - and does not use .sdata section
+ https://gcc.gnu.org/bugzilla/60465 */
+ emit_insn (gen_load_gprel64 (dest, src));
+ }
else
{
HOST_WIDE_INT addend = 0;
diff --git a/gcc/config/ia64/predicates.md b/gcc/config/ia64/predicates.md
index 989c550e7a7..6bd5d0cac98 100644
--- a/gcc/config/ia64/predicates.md
+++ b/gcc/config/ia64/predicates.md
@@ -92,6 +92,32 @@
}
})
+;; True if OP refers to a local symbol [+any offset].
+;; To be encoded as:
+;; movl % = @gprel(symbol+offset)
+;; add % = %, gp
+(define_predicate "local_symbolic_operand64"
+ (match_code "symbol_ref,const")
+{
+ switch (GET_CODE (op))
+ {
+ case CONST:
+ op = XEXP (op, 0);
+ if (GET_CODE (op) != PLUS
+ || GET_CODE (XEXP (op, 0)) != SYMBOL_REF
+ || GET_CODE (XEXP (op, 1)) != CONST_INT)
+ return false;
+ op = XEXP (op, 0);
+ /* FALLTHRU */
+
+ case SYMBOL_REF:
+ return SYMBOL_REF_LOCAL_P (op);
+
+ default:
+ gcc_unreachable ();
+ }
+})
+
;; True if OP refers to a symbol in the small address area.
(define_predicate "small_addr_symbolic_operand"
(match_code "symbol_ref,const")
diff --git a/gcc/config/microblaze/rtems.h b/gcc/config/microblaze/rtems.h
index 4d8a29eaf9b..60f28bdac44 100644
--- a/gcc/config/microblaze/rtems.h
+++ b/gcc/config/microblaze/rtems.h
@@ -23,3 +23,10 @@ along with GCC; see the file COPYING3. If not see
builtin_define( "__rtems__" ); \
builtin_assert( "system=rtems" ); \
} while (0)
+
+/* Redefine to include only items relevant for RTEMS */
+#undef LINK_SPEC
+#define LINK_SPEC "%{shared:-shared} -N -relax \
+ %{mbig-endian:-EB --oformat=elf32-microblaze} \
+ %{mlittle-endian:-EL --oformat=elf32-microblazeel} \
+ %{mxl-gp-opt:%{G*}} %{!mxl-gp-opt: -G 0}"
diff --git a/gcc/config/pa/constraints.md b/gcc/config/pa/constraints.md
index bfcba37346e..a9117b9889e 100644
--- a/gcc/config/pa/constraints.md
+++ b/gcc/config/pa/constraints.md
@@ -106,7 +106,7 @@
(and (match_code "mem")
(match_test "IS_LO_SUM_DLT_ADDR_P (XEXP (op, 0))")))
-(define_memory_constraint "Q"
+(define_constraint "Q"
"A memory operand that can be used as the destination operand of an
integer store, or the source operand of an integer load. That is
any memory operand that isn't a symbolic, indexed or lo_sum memory
@@ -122,7 +122,7 @@
(and (match_code "mem")
(match_test "IS_INDEX_ADDR_P (XEXP (op, 0))")))
-(define_memory_constraint "T"
+(define_constraint "T"
"A memory operand for floating-point loads and stores."
(match_test "floating_point_store_memory_operand (op, mode)"))
diff --git a/gcc/config/pa/pa.c b/gcc/config/pa/pa.c
index c2f03a178bc..aeafd44f6c8 100644
--- a/gcc/config/pa/pa.c
+++ b/gcc/config/pa/pa.c
@@ -1663,78 +1663,114 @@ pa_emit_move_sequence (rtx *operands, enum machine_mode mode, rtx scratch_reg)
/* Handle secondary reloads for loads/stores of FP registers from
REG+D addresses where D does not fit in 5 or 14 bits, including
- (subreg (mem (addr))) cases. */
+ (subreg (mem (addr))) cases, and reloads for other unsupported
+ memory operands. */
if (scratch_reg
- && fp_reg_operand (operand0, mode)
+ && FP_REG_P (operand0)
&& (MEM_P (operand1)
|| (GET_CODE (operand1) == SUBREG
- && MEM_P (XEXP (operand1, 0))))
- && !floating_point_store_memory_operand (operand1, mode))
+ && MEM_P (XEXP (operand1, 0)))))
{
- if (GET_CODE (operand1) == SUBREG)
- operand1 = XEXP (operand1, 0);
+ rtx op1 = operand1;
- /* SCRATCH_REG will hold an address and maybe the actual data. We want
- it in WORD_MODE regardless of what mode it was originally given
- to us. */
- scratch_reg = force_mode (word_mode, scratch_reg);
+ if (GET_CODE (op1) == SUBREG)
+ op1 = XEXP (op1, 0);
- /* D might not fit in 14 bits either; for such cases load D into
- scratch reg. */
- if (reg_plus_base_memory_operand (operand1, mode)
- && !(TARGET_PA_20
- && !TARGET_ELF32
- && INT_14_BITS (XEXP (XEXP (operand1, 0), 1))))
+ if (reg_plus_base_memory_operand (op1, GET_MODE (op1)))
{
- emit_move_insn (scratch_reg, XEXP (XEXP (operand1, 0), 1));
- emit_move_insn (scratch_reg,
- gen_rtx_fmt_ee (GET_CODE (XEXP (operand1, 0)),
- Pmode,
- XEXP (XEXP (operand1, 0), 0),
- scratch_reg));
+ if (!(TARGET_PA_20
+ && !TARGET_ELF32
+ && INT_14_BITS (XEXP (XEXP (op1, 0), 1)))
+ && !INT_5_BITS (XEXP (XEXP (op1, 0), 1)))
+ {
+ /* SCRATCH_REG will hold an address and maybe the actual data.
+ We want it in WORD_MODE regardless of what mode it was
+ originally given to us. */
+ scratch_reg = force_mode (word_mode, scratch_reg);
+
+ /* D might not fit in 14 bits either; for such cases load D
+ into scratch reg. */
+ if (!INT_14_BITS (XEXP (XEXP (op1, 0), 1)))
+ {
+ emit_move_insn (scratch_reg, XEXP (XEXP (op1, 0), 1));
+ emit_move_insn (scratch_reg,
+ gen_rtx_fmt_ee (GET_CODE (XEXP (op1, 0)),
+ Pmode,
+ XEXP (XEXP (op1, 0), 0),
+ scratch_reg));
+ }
+ else
+ emit_move_insn (scratch_reg, XEXP (op1, 0));
+ emit_insn (gen_rtx_SET (VOIDmode, operand0,
+ replace_equiv_address (op1, scratch_reg)));
+ return 1;
+ }
+ }
+ else if ((!INT14_OK_STRICT && symbolic_memory_operand (op1, VOIDmode))
+ || IS_LO_SUM_DLT_ADDR_P (XEXP (op1, 0))
+ || IS_INDEX_ADDR_P (XEXP (op1, 0)))
+ {
+ /* Load memory address into SCRATCH_REG. */
+ scratch_reg = force_mode (word_mode, scratch_reg);
+ emit_move_insn (scratch_reg, XEXP (op1, 0));
+ emit_insn (gen_rtx_SET (VOIDmode, operand0,
+ replace_equiv_address (op1, scratch_reg)));
+ return 1;
}
- else
- emit_move_insn (scratch_reg, XEXP (operand1, 0));
- emit_insn (gen_rtx_SET (VOIDmode, operand0,
- replace_equiv_address (operand1, scratch_reg)));
- return 1;
}
else if (scratch_reg
- && fp_reg_operand (operand1, mode)
+ && FP_REG_P (operand1)
&& (MEM_P (operand0)
|| (GET_CODE (operand0) == SUBREG
- && MEM_P (XEXP (operand0, 0))))
- && !floating_point_store_memory_operand (operand0, mode))
+ && MEM_P (XEXP (operand0, 0)))))
{
- if (GET_CODE (operand0) == SUBREG)
- operand0 = XEXP (operand0, 0);
+ rtx op0 = operand0;
- /* SCRATCH_REG will hold an address and maybe the actual data. We want
- it in WORD_MODE regardless of what mode it was originally given
- to us. */
- scratch_reg = force_mode (word_mode, scratch_reg);
+ if (GET_CODE (op0) == SUBREG)
+ op0 = XEXP (op0, 0);
- /* D might not fit in 14 bits either; for such cases load D into
- scratch reg. */
- if (reg_plus_base_memory_operand (operand0, mode)
- && !(TARGET_PA_20
- && !TARGET_ELF32
- && INT_14_BITS (XEXP (XEXP (operand0, 0), 1))))
- {
- emit_move_insn (scratch_reg, XEXP (XEXP (operand0, 0), 1));
- emit_move_insn (scratch_reg, gen_rtx_fmt_ee (GET_CODE (XEXP (operand0,
- 0)),
- Pmode,
- XEXP (XEXP (operand0, 0),
- 0),
- scratch_reg));
+ if (reg_plus_base_memory_operand (op0, GET_MODE (op0)))
+ {
+ if (!(TARGET_PA_20
+ && !TARGET_ELF32
+ && INT_14_BITS (XEXP (XEXP (op0, 0), 1)))
+ && !INT_5_BITS (XEXP (XEXP (op0, 0), 1)))
+ {
+ /* SCRATCH_REG will hold an address and maybe the actual data.
+ We want it in WORD_MODE regardless of what mode it was
+ originally given to us. */
+ scratch_reg = force_mode (word_mode, scratch_reg);
+
+ /* D might not fit in 14 bits either; for such cases load D
+ into scratch reg. */
+ if (!INT_14_BITS (XEXP (XEXP (op0, 0), 1)))
+ {
+ emit_move_insn (scratch_reg, XEXP (XEXP (op0, 0), 1));
+ emit_move_insn (scratch_reg,
+ gen_rtx_fmt_ee (GET_CODE (XEXP (op0, 0)),
+ Pmode,
+ XEXP (XEXP (op0, 0), 0),
+ scratch_reg));
+ }
+ else
+ emit_move_insn (scratch_reg, XEXP (op0, 0));
+ emit_insn (gen_rtx_SET (VOIDmode,
+ replace_equiv_address (op0, scratch_reg),
+ operand1));
+ return 1;
+ }
+ }
+ else if ((!INT14_OK_STRICT && symbolic_memory_operand (op0, VOIDmode))
+ || IS_LO_SUM_DLT_ADDR_P (XEXP (op0, 0))
+ || IS_INDEX_ADDR_P (XEXP (op0, 0)))
+ {
+ /* Load memory address into SCRATCH_REG. */
+ emit_move_insn (scratch_reg, XEXP (op0, 0));
+ emit_insn (gen_rtx_SET (VOIDmode,
+ replace_equiv_address (op0, scratch_reg),
+ operand1));
+ return 1;
}
- else
- emit_move_insn (scratch_reg, XEXP (operand0, 0));
- emit_insn (gen_rtx_SET (VOIDmode,
- replace_equiv_address (operand0, scratch_reg),
- operand1));
- return 1;
}
/* Handle secondary reloads for loads of FP registers from constant
expressions by forcing the constant into memory. For the most part,
@@ -1743,7 +1779,7 @@ pa_emit_move_sequence (rtx *operands, enum machine_mode mode, rtx scratch_reg)
Use scratch_reg to hold the address of the memory location. */
else if (scratch_reg
&& CONSTANT_P (operand1)
- && fp_reg_operand (operand0, mode))
+ && FP_REG_P (operand0))
{
rtx const_mem, xoperands[2];
@@ -1788,12 +1824,11 @@ pa_emit_move_sequence (rtx *operands, enum machine_mode mode, rtx scratch_reg)
scratch_reg = force_mode (word_mode, scratch_reg);
emit_move_insn (scratch_reg, XEXP (XEXP (operand1, 0), 1));
- emit_move_insn (scratch_reg, gen_rtx_fmt_ee (GET_CODE (XEXP (operand1,
- 0)),
- Pmode,
- XEXP (XEXP (operand1, 0),
- 0),
- scratch_reg));
+ emit_move_insn (scratch_reg,
+ gen_rtx_fmt_ee (GET_CODE (XEXP (operand1, 0)),
+ Pmode,
+ XEXP (XEXP (operand1, 0), 0),
+ scratch_reg));
/* Now we are going to load the scratch register from memory,
we want to load it in the same width as the original MEM,
@@ -1819,8 +1854,9 @@ pa_emit_move_sequence (rtx *operands, enum machine_mode mode, rtx scratch_reg)
emit_move_insn (operand0, scratch_reg);
return 1;
}
+
/* Handle the most common case: storing into a register. */
- else if (register_operand (operand0, mode))
+ if (register_operand (operand0, mode))
{
/* Legitimize TLS symbol references. This happens for references
that aren't a legitimate constant. */
diff --git a/gcc/config/pa/pa.md b/gcc/config/pa/pa.md
index 69bb8bcf860..321fa70de77 100644
--- a/gcc/config/pa/pa.md
+++ b/gcc/config/pa/pa.md
@@ -699,67 +699,6 @@
(include "predicates.md")
(include "constraints.md")
-;; Atomic instructions
-
-;; All memory loads and stores access storage atomically except
-;; for one exception. The STORE BYTES, STORE DOUBLE BYTES, and
-;; doubleword loads and stores are not guaranteed to be atomic
-;; when referencing the I/O address space.
-
-;; Implement atomic DImode load using 64-bit floating point load and copy.
-
-(define_expand "atomic_loaddi"
- [(match_operand:DI 0 "register_operand") ;; val out
- (match_operand:DI 1 "memory_operand") ;; memory
- (match_operand:SI 2 "const_int_operand")] ;; model
- "!TARGET_64BIT && !TARGET_SOFT_FLOAT"
-{
- enum memmodel model = (enum memmodel) INTVAL (operands[2]);
- operands[1] = force_reg (SImode, XEXP (operands[1], 0));
- operands[2] = gen_reg_rtx (DImode);
- expand_mem_thread_fence (model);
- emit_insn (gen_atomic_loaddi_1 (operands[0], operands[1], operands[2]));
- if ((model & MEMMODEL_MASK) == MEMMODEL_SEQ_CST)
- expand_mem_thread_fence (model);
- DONE;
-})
-
-(define_insn "atomic_loaddi_1"
- [(set (match_operand:DI 0 "register_operand" "=r")
- (mem:DI (match_operand:SI 1 "register_operand" "r")))
- (clobber (match_operand:DI 2 "register_operand" "=&f"))]
- "!TARGET_64BIT && !TARGET_SOFT_FLOAT"
- "{fldds|fldd} 0(%1),%2\;{fstds|fstd} %2,-16(%%sp)\;{ldws|ldw} -16(%%sp),%0\;{ldws|ldw} -12(%%sp),%R0"
- [(set_attr "type" "move")
- (set_attr "length" "16")])
-
-;; Implement atomic DImode store using copy and 64-bit floating point store.
-
-(define_expand "atomic_storedi"
- [(match_operand:DI 0 "memory_operand") ;; memory
- (match_operand:DI 1 "register_operand") ;; val out
- (match_operand:SI 2 "const_int_operand")] ;; model
- "!TARGET_64BIT && !TARGET_SOFT_FLOAT"
-{
- enum memmodel model = (enum memmodel) INTVAL (operands[2]);
- operands[0] = force_reg (SImode, XEXP (operands[0], 0));
- operands[2] = gen_reg_rtx (DImode);
- expand_mem_thread_fence (model);
- emit_insn (gen_atomic_storedi_1 (operands[0], operands[1], operands[2]));
- if ((model & MEMMODEL_MASK) == MEMMODEL_SEQ_CST)
- expand_mem_thread_fence (model);
- DONE;
-})
-
-(define_insn "atomic_storedi_1"
- [(set (mem:DI (match_operand:SI 0 "register_operand" "r"))
- (match_operand:DI 1 "register_operand" "r"))
- (clobber (match_operand:DI 2 "register_operand" "=&f"))]
- "!TARGET_64BIT && !TARGET_SOFT_FLOAT"
- "{stws|stw} %1,-16(%%sp)\;{stws|stw} %R1,-12(%%sp)\;{fldds|fldd} -16(%%sp),%2\;{fstds|fstd} %2,0(%0)"
- [(set_attr "type" "move")
- (set_attr "length" "16")])
-
;; Compare instructions.
;; This controls RTL generation and register allocation.
@@ -9849,3 +9788,72 @@ add,l %2,%3,%3\;bv,n %%r0(%3)"
"addil LR'%1-$tls_leoff$,%2\;ldo RR'%1-$tls_leoff$(%%r1),%0"
[(set_attr "type" "multi")
(set_attr "length" "8")])
+
+;; Atomic instructions
+
+;; All memory loads and stores access storage atomically except
+;; for one exception. The STORE BYTES, STORE DOUBLE BYTES, and
+;; doubleword loads and stores are not guaranteed to be atomic
+;; when referencing the I/O address space.
+
+;; Implement atomic DImode load using 64-bit floating point load and copy.
+
+(define_expand "atomic_loaddi"
+ [(match_operand:DI 0 "register_operand") ;; val out
+ (match_operand:DI 1 "memory_operand") ;; memory
+ (match_operand:SI 2 "const_int_operand")] ;; model
+ ""
+{
+ enum memmodel model = (enum memmodel) INTVAL (operands[2]);
+
+ if (TARGET_64BIT || TARGET_DISABLE_FPREGS || TARGET_SOFT_FLOAT)
+ FAIL;
+
+ operands[1] = force_reg (SImode, XEXP (operands[1], 0));
+ operands[2] = gen_reg_rtx (DImode);
+ expand_mem_thread_fence (model);
+ emit_insn (gen_atomic_loaddi_1 (operands[0], operands[1], operands[2]));
+ if ((model & MEMMODEL_MASK) == MEMMODEL_SEQ_CST)
+ expand_mem_thread_fence (model);
+ DONE;
+})
+
+(define_insn "atomic_loaddi_1"
+ [(set (match_operand:DI 0 "register_operand" "=r")
+ (mem:DI (match_operand:SI 1 "register_operand" "r")))
+ (clobber (match_operand:DI 2 "register_operand" "=&f"))]
+ "!TARGET_64BIT && !TARGET_DISABLE_FPREGS && !TARGET_SOFT_FLOAT"
+ "{fldds|fldd} 0(%1),%2\;{fstds|fstd} %2,-16(%%sp)\;{ldws|ldw} -16(%%sp),%0\;{ldws|ldw} -12(%%sp),%R0"
+ [(set_attr "type" "move")
+ (set_attr "length" "16")])
+
+;; Implement atomic DImode store using copy and 64-bit floating point store.
+
+(define_expand "atomic_storedi"
+ [(match_operand:DI 0 "memory_operand") ;; memory
+ (match_operand:DI 1 "register_operand") ;; val out
+ (match_operand:SI 2 "const_int_operand")] ;; model
+ ""
+{
+ enum memmodel model = (enum memmodel) INTVAL (operands[2]);
+
+ if (TARGET_64BIT || TARGET_DISABLE_FPREGS || TARGET_SOFT_FLOAT)
+ FAIL;
+
+ operands[0] = force_reg (SImode, XEXP (operands[0], 0));
+ operands[2] = gen_reg_rtx (DImode);
+ expand_mem_thread_fence (model);
+ emit_insn (gen_atomic_storedi_1 (operands[0], operands[1], operands[2]));
+ if ((model & MEMMODEL_MASK) == MEMMODEL_SEQ_CST)
+ expand_mem_thread_fence (model);
+ DONE;
+})
+
+(define_insn "atomic_storedi_1"
+ [(set (mem:DI (match_operand:SI 0 "register_operand" "r"))
+ (match_operand:DI 1 "register_operand" "r"))
+ (clobber (match_operand:DI 2 "register_operand" "=&f"))]
+ "!TARGET_64BIT && !TARGET_DISABLE_FPREGS && !TARGET_SOFT_FLOAT"
+ "{stws|stw} %1,-16(%%sp)\;{stws|stw} %R1,-12(%%sp)\;{fldds|fldd} -16(%%sp),%2\;{fstds|fstd} %2,0(%0)"
+ [(set_attr "type" "move")
+ (set_attr "length" "16")])
diff --git a/gcc/config/pa/predicates.md b/gcc/config/pa/predicates.md
index 405cf7f63c3..6968f50a01b 100644
--- a/gcc/config/pa/predicates.md
+++ b/gcc/config/pa/predicates.md
@@ -301,6 +301,9 @@
if (reg_plus_base_memory_operand (op, mode))
{
+ if (reload_in_progress)
+ return true;
+
/* Extract CONST_INT operand. */
if (GET_CODE (op) == SUBREG)
op = SUBREG_REG (op);
@@ -335,6 +338,9 @@
if (reg_plus_base_memory_operand (op, mode))
{
+ if (reload_in_progress)
+ return true;
+
/* Extract CONST_INT operand. */
if (GET_CODE (op) == SUBREG)
op = SUBREG_REG (op);
diff --git a/gcc/config/rs6000/altivec.md b/gcc/config/rs6000/altivec.md
index 63e72370e0f..22346e1c563 100644
--- a/gcc/config/rs6000/altivec.md
+++ b/gcc/config/rs6000/altivec.md
@@ -2436,7 +2436,7 @@
(match_operand:VM2 1 "memory_operand" "Z"))
(unspec [(const_int 0)] UNSPEC_SET_VSCR)])]
"TARGET_ALTIVEC"
- "lvx %0,%y1"
+ "lvxl %0,%y1"
[(set_attr "type" "vecload")])
(define_expand "altivec_lvx_<mode>"
diff --git a/gcc/config/rs6000/freebsd64.h b/gcc/config/rs6000/freebsd64.h
index 1f3ef199e86..e9cbd63017e 100644
--- a/gcc/config/rs6000/freebsd64.h
+++ b/gcc/config/rs6000/freebsd64.h
@@ -65,6 +65,13 @@ extern int dot_symbols;
#define INVALID_64BIT "-m%s not supported in this configuration"
#define INVALID_32BIT INVALID_64BIT
+/* Use LINUX64 instead of FREEBSD64 for compat with e.g. sysv4le.h */
+#ifdef LINUX64_DEFAULT_ABI_ELFv2
+#define ELFv2_ABI_CHECK (rs6000_elf_abi != 1)
+#else
+#define ELFv2_ABI_CHECK (rs6000_elf_abi == 2)
+#endif
+
#undef SUBSUBTARGET_OVERRIDE_OPTIONS
#define SUBSUBTARGET_OVERRIDE_OPTIONS \
do \
@@ -84,6 +91,12 @@ extern int dot_symbols;
rs6000_isa_flags &= ~OPTION_MASK_RELOCATABLE; \
error (INVALID_64BIT, "relocatable"); \
} \
+ if (ELFv2_ABI_CHECK) \
+ { \
+ rs6000_current_abi = ABI_ELFv2; \
+ if (dot_symbols) \
+ error ("-mcall-aixdesc incompatible with -mabi=elfv2"); \
+ } \
if (rs6000_isa_flags & OPTION_MASK_EABI) \
{ \
rs6000_isa_flags &= ~OPTION_MASK_EABI; \
@@ -130,7 +143,7 @@ extern int dot_symbols;
#define LINK_OS_FREEBSD_SPEC "%{m32:%(link_os_freebsd_spec32)}%{!m32:%(link_os_freebsd_spec64)}"
#define ASM_SPEC32 "-a32 \
-%{mrelocatable} %{mrelocatable-lib} %{fpic:-K PIC} %{fPIC:-K PIC} \
+%{mrelocatable} %{mrelocatable-lib} %{fpic|fpie|fPIC|fPIE:-K PIC} \
%{memb} %{!memb: %{msdata=eabi: -memb}} \
%{!mlittle: %{!mlittle-endian: %{!mbig: %{!mbig-endian: \
%{mcall-freebsd: -mbig} \
@@ -154,10 +167,7 @@ extern int dot_symbols;
{ "link_os_freebsd_spec32", LINK_OS_FREEBSD_SPEC32 }, \
{ "link_os_freebsd_spec64", LINK_OS_FREEBSD_SPEC64 },
-#define FREEBSD_DYNAMIC_LINKER32 "/libexec/ld-elf32.so.1"
-#define FREEBSD_DYNAMIC_LINKER64 "/libexec/ld-elf.so.1"
-
-#define LINK_OS_FREEBSD_SPEC_DEF32 "\
+#define LINK_OS_FREEBSD_SPEC_DEF "\
%{p:%nconsider using `-pg' instead of `-p' with gprof(1)} \
%{v:-V} \
%{assert*} %{R*} %{rpath*} %{defsym*} \
@@ -165,25 +175,13 @@ extern int dot_symbols;
%{!shared: \
%{!static: \
%{rdynamic: -export-dynamic} \
- %{!dynamic-linker:-dynamic-linker " FREEBSD_DYNAMIC_LINKER32 "}} \
+ %{!dynamic-linker:-dynamic-linker " FBSD_DYNAMIC_LINKER "}} \
%{static:-Bstatic}} \
%{symbolic:-Bsymbolic}"
-#define LINK_OS_FREEBSD_SPEC_DEF64 "\
- %{p:%nconsider using `-pg' instead of `-p' with gprof(1)} \
- %{v:-V} \
- %{assert*} %{R*} %{rpath*} %{defsym*} \
- %{shared:-Bshareable %{h*} %{soname*}} \
- %{!shared: \
- %{!static: \
- %{rdynamic: -export-dynamic} \
- %{!dynamic-linker:-dynamic-linker " FREEBSD_DYNAMIC_LINKER64 "}} \
- %{static:-Bstatic}} \
- %{symbolic:-Bsymbolic}"
-
-#define LINK_OS_FREEBSD_SPEC32 "-melf32ppc_fbsd " LINK_OS_FREEBSD_SPEC_DEF32
+#define LINK_OS_FREEBSD_SPEC32 "-melf32ppc_fbsd " LINK_OS_FREEBSD_SPEC_DEF
-#define LINK_OS_FREEBSD_SPEC64 "-melf64ppc_fbsd " LINK_OS_FREEBSD_SPEC_DEF64
+#define LINK_OS_FREEBSD_SPEC64 "-melf64ppc_fbsd " LINK_OS_FREEBSD_SPEC_DEF
#undef MULTILIB_DEFAULTS
#define MULTILIB_DEFAULTS { "m64" }
@@ -304,7 +302,7 @@ extern int dot_symbols;
/* rs6000.h gets this wrong for FreeBSD. We use the GCC defaults instead. */
#undef WCHAR_TYPE
-#define WCHAR_TYPE (TARGET_64BIT ? "int" : "long int")
+
#undef WCHAR_TYPE_SIZE
#define WCHAR_TYPE_SIZE 32
diff --git a/gcc/config/rs6000/predicates.md b/gcc/config/rs6000/predicates.md
index 8729d9b0ef1..808e5b8a2a4 100644
--- a/gcc/config/rs6000/predicates.md
+++ b/gcc/config/rs6000/predicates.md
@@ -270,20 +270,19 @@
;; Return 1 if op is a general purpose register that is an even register
;; which suitable for a load/store quad operation
+;; Subregs are not allowed here because when they are combine can
+;; create (subreg:PTI (reg:TI pseudo)) which will cause reload to
+;; think the innermost reg needs reloading, in TImode instead of
+;; PTImode. So reload will choose a reg in TImode which has no
+;; requirement that the reg be even.
(define_predicate "quad_int_reg_operand"
- (match_operand 0 "register_operand")
+ (match_code "reg")
{
HOST_WIDE_INT r;
if (!TARGET_QUAD_MEMORY && !TARGET_QUAD_MEMORY_ATOMIC)
return 0;
- if (GET_CODE (op) == SUBREG)
- op = SUBREG_REG (op);
-
- if (!REG_P (op))
- return 0;
-
r = REGNO (op);
if (r >= FIRST_PSEUDO_REGISTER)
return 1;
diff --git a/gcc/config/rs6000/rs6000-builtin.def b/gcc/config/rs6000/rs6000-builtin.def
index 031b964e701..14bee625bc9 100644
--- a/gcc/config/rs6000/rs6000-builtin.def
+++ b/gcc/config/rs6000/rs6000-builtin.def
@@ -1371,13 +1371,13 @@ BU_VSX_X (LXVW4X_V4SI, "lxvw4x_v4si", MEM)
BU_VSX_X (LXVW4X_V8HI, "lxvw4x_v8hi", MEM)
BU_VSX_X (LXVW4X_V16QI, "lxvw4x_v16qi", MEM)
BU_VSX_X (STXSDX, "stxsdx", MEM)
-BU_VSX_X (STXVD2X_V1TI, "stxsdx_v1ti", MEM)
-BU_VSX_X (STXVD2X_V2DF, "stxsdx_v2df", MEM)
-BU_VSX_X (STXVD2X_V2DI, "stxsdx_v2di", MEM)
-BU_VSX_X (STXVW4X_V4SF, "stxsdx_v4sf", MEM)
-BU_VSX_X (STXVW4X_V4SI, "stxsdx_v4si", MEM)
-BU_VSX_X (STXVW4X_V8HI, "stxsdx_v8hi", MEM)
-BU_VSX_X (STXVW4X_V16QI, "stxsdx_v16qi", MEM)
+BU_VSX_X (STXVD2X_V1TI, "stxvd2x_v1ti", MEM)
+BU_VSX_X (STXVD2X_V2DF, "stxvd2x_v2df", MEM)
+BU_VSX_X (STXVD2X_V2DI, "stxvd2x_v2di", MEM)
+BU_VSX_X (STXVW4X_V4SF, "stxvw4x_v4sf", MEM)
+BU_VSX_X (STXVW4X_V4SI, "stxvw4x_v4si", MEM)
+BU_VSX_X (STXVW4X_V8HI, "stxvw4x_v8hi", MEM)
+BU_VSX_X (STXVW4X_V16QI, "stxvw4x_v16qi", MEM)
BU_VSX_X (XSABSDP, "xsabsdp", CONST)
BU_VSX_X (XSADDDP, "xsadddp", FP)
BU_VSX_X (XSCMPODP, "xscmpodp", FP)
diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index 80564538c30..fc23b3314a5 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -20263,6 +20263,9 @@ rs6000_expand_atomic_compare_and_swap (rtx operands[])
else if (reg_overlap_mentioned_p (retval, oldval))
oldval = copy_to_reg (oldval);
+ if (mode != TImode && !reg_or_short_operand (oldval, mode))
+ oldval = copy_to_mode_reg (mode, oldval);
+
mem = rs6000_pre_atomic_barrier (mem, mod_s);
label1 = NULL_RTX;
@@ -20277,10 +20280,8 @@ rs6000_expand_atomic_compare_and_swap (rtx operands[])
x = retval;
if (mask)
- {
- x = expand_simple_binop (SImode, AND, retval, mask,
- NULL_RTX, 1, OPTAB_LIB_WIDEN);
- }
+ x = expand_simple_binop (SImode, AND, retval, mask,
+ NULL_RTX, 1, OPTAB_LIB_WIDEN);
cond = gen_reg_rtx (CCmode);
/* If we have TImode, synthesize a comparison. */
diff --git a/gcc/config/rs6000/rs6000.h b/gcc/config/rs6000/rs6000.h
index bd33ba8e773..36116b56f6c 100644
--- a/gcc/config/rs6000/rs6000.h
+++ b/gcc/config/rs6000/rs6000.h
@@ -121,6 +121,7 @@
%{mcpu=power8: %(asm_cpu_power8)} \
%{mcpu=a2: -ma2} \
%{mcpu=powerpc: -mppc} \
+%{mcpu=powerpc64le: %(asm_cpu_power8)} \
%{mcpu=rs64a: -mppc64} \
%{mcpu=401: -mppc} \
%{mcpu=403: -m403} \
diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md
index 94637f72187..a3efbbc0022 100644
--- a/gcc/config/rs6000/rs6000.md
+++ b/gcc/config/rs6000/rs6000.md
@@ -9976,38 +9976,28 @@
;; value, since it is allocated in reload and not all of the flow information
;; is setup for it. We have two patterns to do the two moves between gprs and
;; fprs. There isn't a dependancy between the two, but we could potentially
-;; schedule other instructions between the two instructions. TFmode is
-;; currently limited to traditional FPR registers. If/when this is changed, we
-;; will need to revist %L to make sure it works with VSX registers, or add an
-;; %x version of %L.
+;; schedule other instructions between the two instructions.
(define_insn "p8_fmrgow_<mode>"
[(set (match_operand:FMOVE64X 0 "register_operand" "=d")
- (unspec:FMOVE64X [(match_operand:TF 1 "register_operand" "d")]
+ (unspec:FMOVE64X [
+ (match_operand:DF 1 "register_operand" "d")
+ (match_operand:DF 2 "register_operand" "d")]
UNSPEC_P8V_FMRGOW))]
"!TARGET_POWERPC64 && TARGET_DIRECT_MOVE"
- "fmrgow %0,%1,%L1"
+ "fmrgow %0,%1,%2"
[(set_attr "type" "vecperm")])
-(define_insn "p8_mtvsrwz_1"
- [(set (match_operand:TF 0 "register_operand" "=d")
- (unspec:TF [(match_operand:SI 1 "register_operand" "r")]
+(define_insn "p8_mtvsrwz"
+ [(set (match_operand:DF 0 "register_operand" "=d")
+ (unspec:DF [(match_operand:SI 1 "register_operand" "r")]
UNSPEC_P8V_MTVSRWZ))]
"!TARGET_POWERPC64 && TARGET_DIRECT_MOVE"
"mtvsrwz %x0,%1"
[(set_attr "type" "mftgpr")])
-(define_insn "p8_mtvsrwz_2"
- [(set (match_operand:TF 0 "register_operand" "+d")
- (unspec:TF [(match_dup 0)
- (match_operand:SI 1 "register_operand" "r")]
- UNSPEC_P8V_MTVSRWZ))]
- "!TARGET_POWERPC64 && TARGET_DIRECT_MOVE"
- "mtvsrwz %L0,%1"
- [(set_attr "type" "mftgpr")])
-
(define_insn_and_split "reload_fpr_from_gpr<mode>"
- [(set (match_operand:FMOVE64X 0 "register_operand" "=ws")
+ [(set (match_operand:FMOVE64X 0 "register_operand" "=d")
(unspec:FMOVE64X [(match_operand:FMOVE64X 1 "register_operand" "r")]
UNSPEC_P8V_RELOAD_FROM_GPR))
(clobber (match_operand:TF 2 "register_operand" "=d"))]
@@ -10018,42 +10008,36 @@
{
rtx dest = operands[0];
rtx src = operands[1];
- rtx tmp = operands[2];
+ rtx tmp_hi = simplify_gen_subreg (DFmode, operands[2], TFmode, 0);
+ rtx tmp_lo = simplify_gen_subreg (DFmode, operands[2], TFmode, 8);
rtx gpr_hi_reg = gen_highpart (SImode, src);
rtx gpr_lo_reg = gen_lowpart (SImode, src);
- emit_insn (gen_p8_mtvsrwz_1 (tmp, gpr_hi_reg));
- emit_insn (gen_p8_mtvsrwz_2 (tmp, gpr_lo_reg));
- emit_insn (gen_p8_fmrgow_<mode> (dest, tmp));
+ emit_insn (gen_p8_mtvsrwz (tmp_hi, gpr_hi_reg));
+ emit_insn (gen_p8_mtvsrwz (tmp_lo, gpr_lo_reg));
+ emit_insn (gen_p8_fmrgow_<mode> (dest, tmp_hi, tmp_lo));
DONE;
}
[(set_attr "length" "12")
(set_attr "type" "three")])
;; Move 128 bit values from GPRs to VSX registers in 64-bit mode
-(define_insn "p8_mtvsrd_1"
- [(set (match_operand:TF 0 "register_operand" "=ws")
- (unspec:TF [(match_operand:DI 1 "register_operand" "r")]
- UNSPEC_P8V_MTVSRD))]
- "TARGET_POWERPC64 && TARGET_DIRECT_MOVE"
- "mtvsrd %0,%1"
- [(set_attr "type" "mftgpr")])
-
-(define_insn "p8_mtvsrd_2"
- [(set (match_operand:TF 0 "register_operand" "+ws")
- (unspec:TF [(match_dup 0)
- (match_operand:DI 1 "register_operand" "r")]
+(define_insn "p8_mtvsrd_df"
+ [(set (match_operand:DF 0 "register_operand" "=wa")
+ (unspec:DF [(match_operand:DI 1 "register_operand" "r")]
UNSPEC_P8V_MTVSRD))]
"TARGET_POWERPC64 && TARGET_DIRECT_MOVE"
- "mtvsrd %L0,%1"
+ "mtvsrd %x0,%1"
[(set_attr "type" "mftgpr")])
(define_insn "p8_xxpermdi_<mode>"
[(set (match_operand:FMOVE128_GPR 0 "register_operand" "=wa")
- (unspec:FMOVE128_GPR [(match_operand:TF 1 "register_operand" "ws")]
- UNSPEC_P8V_XXPERMDI))]
+ (unspec:FMOVE128_GPR [
+ (match_operand:DF 1 "register_operand" "wa")
+ (match_operand:DF 2 "register_operand" "wa")]
+ UNSPEC_P8V_XXPERMDI))]
"TARGET_POWERPC64 && TARGET_DIRECT_MOVE"
- "xxpermdi %x0,%1,%L1,0"
+ "xxpermdi %x0,%x1,%x2,0"
[(set_attr "type" "vecperm")])
(define_insn_and_split "reload_vsx_from_gpr<mode>"
@@ -10061,7 +10045,7 @@
(unspec:FMOVE128_GPR
[(match_operand:FMOVE128_GPR 1 "register_operand" "r")]
UNSPEC_P8V_RELOAD_FROM_GPR))
- (clobber (match_operand:TF 2 "register_operand" "=ws"))]
+ (clobber (match_operand:TF 2 "register_operand" "=wa"))]
"TARGET_POWERPC64 && TARGET_DIRECT_MOVE"
"#"
"&& reload_completed"
@@ -10069,13 +10053,18 @@
{
rtx dest = operands[0];
rtx src = operands[1];
- rtx tmp = operands[2];
+ /* You might think that we could use op0 as one temp and a DF clobber
+ as op2, but you'd be wrong. Secondary reload move patterns don't
+ check for overlap of the clobber and the destination. */
+ rtx tmp_hi = simplify_gen_subreg (DFmode, operands[2], TFmode, 0);
+ rtx tmp_lo = simplify_gen_subreg (DFmode, operands[2], TFmode, 8);
rtx gpr_hi_reg = gen_highpart (DImode, src);
rtx gpr_lo_reg = gen_lowpart (DImode, src);
- emit_insn (gen_p8_mtvsrd_1 (tmp, gpr_hi_reg));
- emit_insn (gen_p8_mtvsrd_2 (tmp, gpr_lo_reg));
- emit_insn (gen_p8_xxpermdi_<mode> (dest, tmp));
+ emit_insn (gen_p8_mtvsrd_df (tmp_hi, gpr_hi_reg));
+ emit_insn (gen_p8_mtvsrd_df (tmp_lo, gpr_lo_reg));
+ emit_insn (gen_p8_xxpermdi_<mode> (dest, tmp_hi, tmp_lo));
+ DONE;
}
[(set_attr "length" "12")
(set_attr "type" "three")])
@@ -10092,6 +10081,13 @@
;; Move SFmode to a VSX from a GPR register. Because scalar floating point
;; type is stored internally as double precision in the VSX registers, we have
;; to convert it from the vector format.
+(define_insn "p8_mtvsrd_sf"
+ [(set (match_operand:SF 0 "register_operand" "=wa")
+ (unspec:SF [(match_operand:DI 1 "register_operand" "r")]
+ UNSPEC_P8V_MTVSRD))]
+ "TARGET_POWERPC64 && TARGET_DIRECT_MOVE"
+ "mtvsrd %x0,%1"
+ [(set_attr "type" "mftgpr")])
(define_insn_and_split "reload_vsx_from_gprsf"
[(set (match_operand:SF 0 "register_operand" "=wa")
@@ -10106,16 +10102,12 @@
rtx op0 = operands[0];
rtx op1 = operands[1];
rtx op2 = operands[2];
- /* Also use the destination register to hold the unconverted DImode value.
- This is conceptually a separate value from OP0, so we use gen_rtx_REG
- rather than simplify_gen_subreg. */
- rtx op0_di = gen_rtx_REG (DImode, REGNO (op0));
rtx op1_di = simplify_gen_subreg (DImode, op1, SFmode, 0);
/* Move SF value to upper 32-bits for xscvspdpn. */
emit_insn (gen_ashldi3 (op2, op1_di, GEN_INT (32)));
- emit_move_insn (op0_di, op2);
- emit_insn (gen_vsx_xscvspdpn_directmove (op0, op0_di));
+ emit_insn (gen_p8_mtvsrd_sf (op0, op2));
+ emit_insn (gen_vsx_xscvspdpn_directmove (op0, op0));
DONE;
}
[(set_attr "length" "8")
@@ -14917,7 +14909,7 @@
(const_int 1))
(label_ref (match_operand 0 "" ""))
(pc)))
- (set (match_operand:P 2 "nonimmediate_operand" "=1,*r,m,*c*l")
+ (set (match_operand:P 2 "nonimmediate_operand" "=1,*r,m,*d*c*l")
(plus:P (match_dup 1)
(const_int -1)))
(clobber (match_scratch:CC 3 "=X,&x,&x,&x"))
@@ -14941,7 +14933,7 @@
(const_int 1))
(pc)
(label_ref (match_operand 0 "" ""))))
- (set (match_operand:P 2 "nonimmediate_operand" "=1,*r,m,*c*l")
+ (set (match_operand:P 2 "nonimmediate_operand" "=1,*r,m,*d*c*l")
(plus:P (match_dup 1)
(const_int -1)))
(clobber (match_scratch:CC 3 "=X,&x,&x,&x"))
@@ -14967,7 +14959,7 @@
(const_int 1))
(label_ref (match_operand 0 "" ""))
(pc)))
- (set (match_operand:P 2 "nonimmediate_operand" "=1,*r,m,*c*l")
+ (set (match_operand:P 2 "nonimmediate_operand" "=1,*r,m,*d*c*l")
(plus:P (match_dup 1)
(const_int -1)))
(clobber (match_scratch:CC 3 "=X,&x,&x,&x"))
@@ -14991,7 +14983,7 @@
(const_int 1))
(pc)
(label_ref (match_operand 0 "" ""))))
- (set (match_operand:P 2 "nonimmediate_operand" "=1,*r,m,*c*l")
+ (set (match_operand:P 2 "nonimmediate_operand" "=1,*r,m,*d*c*l")
(plus:P (match_dup 1)
(const_int -1)))
(clobber (match_scratch:CC 3 "=X,&x,&x,&x"))
@@ -15018,7 +15010,7 @@
(const_int 1)])
(match_operand 5 "" "")
(match_operand 6 "" "")))
- (set (match_operand:P 0 "gpc_reg_operand" "")
+ (set (match_operand:P 0 "int_reg_operand" "")
(plus:P (match_dup 1) (const_int -1)))
(clobber (match_scratch:CC 3 ""))
(clobber (match_scratch:P 4 ""))]
diff --git a/gcc/config/rs6000/t-freebsd64 b/gcc/config/rs6000/t-freebsd64
index e3ba65c947c..71d4f3f4524 100644
--- a/gcc/config/rs6000/t-freebsd64
+++ b/gcc/config/rs6000/t-freebsd64
@@ -21,11 +21,9 @@
# On FreeBSD the 32-bit libraries are found under /usr/lib32.
# Set MULTILIB_OSDIRNAMES according to this.
-MULTILIB_OPTIONS = m32 msoft-float
-MULTILIB_DIRNAMES = 32 nof
+MULTILIB_OPTIONS = m32
+MULTILIB_DIRNAMES = 32
MULTILIB_EXTRA_OPTS = fPIC mstrict-align
MULTILIB_EXCEPTIONS =
-MULTILIB_EXCLUSIONS = !m32/msoft-float
MULTILIB_OSDIRNAMES = ../lib32
-#MULTILIB_MATCHES = $(MULTILIB_MATCHES_FLOAT)
diff --git a/gcc/config/rs6000/vsx.md b/gcc/config/rs6000/vsx.md
index 9aaf0642804..4b1fa9f0387 100644
--- a/gcc/config/rs6000/vsx.md
+++ b/gcc/config/rs6000/vsx.md
@@ -1353,7 +1353,7 @@
;; Used by direct move to move a SFmode value from GPR to VSX register
(define_insn "vsx_xscvspdpn_directmove"
[(set (match_operand:SF 0 "vsx_register_operand" "=wa")
- (unspec:SF [(match_operand:DI 1 "vsx_register_operand" "wa")]
+ (unspec:SF [(match_operand:SF 1 "vsx_register_operand" "wa")]
UNSPEC_VSX_CVSPDPN))]
"TARGET_XSCVSPDPN"
"xscvspdpn %x0,%x1"
@@ -1415,10 +1415,15 @@
{
rtx op0 = operands[0];
rtx op1 = operands[1];
- rtx tmp = gen_reg_rtx (V2DFmode);
- int scale = INTVAL(operands[2]);
- if (scale != 0)
- rs6000_scale_v2df (tmp, op1, scale);
+ rtx tmp;
+ int scale = INTVAL (operands[2]);
+ if (scale == 0)
+ tmp = op1;
+ else
+ {
+ tmp = gen_reg_rtx (V2DFmode);
+ rs6000_scale_v2df (tmp, op1, scale);
+ }
emit_insn (gen_vsx_xvcvdpsxds (op0, tmp));
DONE;
})
@@ -1439,10 +1444,15 @@
{
rtx op0 = operands[0];
rtx op1 = operands[1];
- rtx tmp = gen_reg_rtx (V2DFmode);
- int scale = INTVAL(operands[2]);
- if (scale != 0)
- rs6000_scale_v2df (tmp, op1, scale);
+ rtx tmp;
+ int scale = INTVAL (operands[2]);
+ if (scale == 0)
+ tmp = op1;
+ else
+ {
+ tmp = gen_reg_rtx (V2DFmode);
+ rs6000_scale_v2df (tmp, op1, scale);
+ }
emit_insn (gen_vsx_xvcvdpuxds (op0, tmp));
DONE;
})
diff --git a/gcc/config/rtems.h b/gcc/config/rtems.h
index f14aed36aa6..ff1d1fb9e3c 100644
--- a/gcc/config/rtems.h
+++ b/gcc/config/rtems.h
@@ -45,6 +45,6 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#define LIB_SPEC "%{!qrtems: " STD_LIB_SPEC "} " \
"%{!nostdlib: %{qrtems: --start-group \
-lrtemsbsp -lrtemscpu \
- -lc -lgcc --end-group %{!qnolinkcmds: -T linkcmds%s}}}"
+ -latomic -lc -lgcc --end-group %{!qnolinkcmds: -T linkcmds%s}}}"
#define TARGET_POSIX_IO
diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c
index e507046aedd..0736a98d45b 100644
--- a/gcc/config/s390/s390.c
+++ b/gcc/config/s390/s390.c
@@ -8595,6 +8595,10 @@ s390_save_gprs_to_fprs (void)
emit_move_insn (gen_rtx_REG (DImode, cfun_gpr_save_slot (i)),
gen_rtx_REG (DImode, i));
RTX_FRAME_RELATED_P (insn) = 1;
+ /* This prevents dwarf2cfi from interpreting the set. Doing
+ so it might emit def_cfa_register infos setting an FPR as
+ new CFA. */
+ add_reg_note (insn, REG_CFA_REGISTER, PATTERN (insn));
}
}
}
@@ -8611,19 +8615,25 @@ s390_restore_gprs_from_fprs (void)
for (i = 6; i < 16; i++)
{
- if (FP_REGNO_P (cfun_gpr_save_slot (i)))
- {
- rtx insn =
- emit_move_insn (gen_rtx_REG (DImode, i),
- gen_rtx_REG (DImode, cfun_gpr_save_slot (i)));
- df_set_regs_ever_live (i, true);
- add_reg_note (insn, REG_CFA_RESTORE, gen_rtx_REG (DImode, i));
- if (i == STACK_POINTER_REGNUM)
- add_reg_note (insn, REG_CFA_DEF_CFA,
- plus_constant (Pmode, stack_pointer_rtx,
- STACK_POINTER_OFFSET));
- RTX_FRAME_RELATED_P (insn) = 1;
- }
+ rtx insn;
+
+ if (!FP_REGNO_P (cfun_gpr_save_slot (i)))
+ continue;
+
+ rtx fpr = gen_rtx_REG (DImode, cfun_gpr_save_slot (i));
+
+ if (i == STACK_POINTER_REGNUM)
+ insn = emit_insn (gen_stack_restore_from_fpr (fpr));
+ else
+ insn = emit_move_insn (gen_rtx_REG (DImode, i), fpr);
+
+ df_set_regs_ever_live (i, true);
+ add_reg_note (insn, REG_CFA_RESTORE, gen_rtx_REG (DImode, i));
+ if (i == STACK_POINTER_REGNUM)
+ add_reg_note (insn, REG_CFA_DEF_CFA,
+ plus_constant (Pmode, stack_pointer_rtx,
+ STACK_POINTER_OFFSET));
+ RTX_FRAME_RELATED_P (insn) = 1;
}
}
@@ -10908,37 +10918,46 @@ s390_optimize_prologue (void)
/* Remove ldgr/lgdr instructions used for saving and restore
GPRs if possible. */
- if (TARGET_Z10
- && GET_CODE (pat) == SET
- && GET_MODE (SET_SRC (pat)) == DImode
- && REG_P (SET_SRC (pat))
- && REG_P (SET_DEST (pat)))
+ if (TARGET_Z10)
{
- int src_regno = REGNO (SET_SRC (pat));
- int dest_regno = REGNO (SET_DEST (pat));
- int gpr_regno;
- int fpr_regno;
+ rtx tmp_pat = pat;
- if (!((GENERAL_REGNO_P (src_regno) && FP_REGNO_P (dest_regno))
- || (FP_REGNO_P (src_regno) && GENERAL_REGNO_P (dest_regno))))
- continue;
+ if (INSN_CODE (insn) == CODE_FOR_stack_restore_from_fpr)
+ tmp_pat = XVECEXP (pat, 0, 0);
- gpr_regno = GENERAL_REGNO_P (src_regno) ? src_regno : dest_regno;
- fpr_regno = FP_REGNO_P (src_regno) ? src_regno : dest_regno;
+ if (GET_CODE (tmp_pat) == SET
+ && GET_MODE (SET_SRC (tmp_pat)) == DImode
+ && REG_P (SET_SRC (tmp_pat))
+ && REG_P (SET_DEST (tmp_pat)))
+ {
+ int src_regno = REGNO (SET_SRC (tmp_pat));
+ int dest_regno = REGNO (SET_DEST (tmp_pat));
+ int gpr_regno;
+ int fpr_regno;
+
+ if (!((GENERAL_REGNO_P (src_regno)
+ && FP_REGNO_P (dest_regno))
+ || (FP_REGNO_P (src_regno)
+ && GENERAL_REGNO_P (dest_regno))))
+ continue;
- /* GPR must be call-saved, FPR must be call-clobbered. */
- if (!call_really_used_regs[fpr_regno]
- || call_really_used_regs[gpr_regno])
- continue;
+ gpr_regno = GENERAL_REGNO_P (src_regno) ? src_regno : dest_regno;
+ fpr_regno = FP_REGNO_P (src_regno) ? src_regno : dest_regno;
- /* It must not happen that what we once saved in an FPR now
- needs a stack slot. */
- gcc_assert (cfun_gpr_save_slot (gpr_regno) != -1);
+ /* GPR must be call-saved, FPR must be call-clobbered. */
+ if (!call_really_used_regs[fpr_regno]
+ || call_really_used_regs[gpr_regno])
+ continue;
- if (cfun_gpr_save_slot (gpr_regno) == 0)
- {
- remove_insn (insn);
- continue;
+ /* It must not happen that what we once saved in an FPR now
+ needs a stack slot. */
+ gcc_assert (cfun_gpr_save_slot (gpr_regno) != -1);
+
+ if (cfun_gpr_save_slot (gpr_regno) == 0)
+ {
+ remove_insn (insn);
+ continue;
+ }
}
}
diff --git a/gcc/config/s390/s390.md b/gcc/config/s390/s390.md
index 986b0c65b9a..cc9e39ef6c4 100644
--- a/gcc/config/s390/s390.md
+++ b/gcc/config/s390/s390.md
@@ -183,6 +183,8 @@
(BASE_REGNUM 13)
; Return address register.
(RETURN_REGNUM 14)
+ ; Stack pointer register.
+ (STACK_REGNUM 15)
; Condition code register.
(CC_REGNUM 33)
; Thread local storage pointer register.
@@ -9896,6 +9898,14 @@
[(set_attr "length" "0")])
+(define_insn "stack_restore_from_fpr"
+ [(set (reg:DI STACK_REGNUM)
+ (match_operand:DI 0 "register_operand" "f"))
+ (clobber (mem:BLK (scratch)))]
+ "TARGET_Z10"
+ "lgdr\t%%r15,%0"
+ [(set_attr "op_type" "RRE")])
+
;
; Data prefetch patterns
;
diff --git a/gcc/config/sh/sh.md b/gcc/config/sh/sh.md
index c1caabd3a10..bbbf54733ce 100644
--- a/gcc/config/sh/sh.md
+++ b/gcc/config/sh/sh.md
@@ -9605,12 +9605,16 @@ label:
(const_string "single") (const_string "double")))
(set_attr "type" "jump_ind")])
+;; sibcall_value_pcrel used to have a =&k clobber for the scratch register
+;; that it needs for the branch address. This causes troubles when there
+;; is a big overlap of argument and return value registers. Hence, use a
+;; fixed call clobbered register for the address. See also PR 67260.
(define_insn_and_split "sibcall_value_pcrel"
[(set (match_operand 0 "" "=rf")
(call (mem:SI (match_operand:SI 1 "symbol_ref_operand" ""))
(match_operand 2 "" "")))
(use (reg:PSI FPSCR_REG))
- (clobber (match_scratch:SI 3 "=k"))
+ (clobber (reg:SI R1_REG))
(return)]
"TARGET_SH2"
"#"
@@ -9620,6 +9624,8 @@ label:
rtx lab = PATTERN (gen_call_site ());
rtx call_insn;
+ operands[3] = gen_rtx_REG (SImode, R1_REG);
+
emit_insn (gen_sym_label2reg (operands[3], operands[1], lab));
call_insn = emit_call_insn (gen_sibcall_valuei_pcrel (operands[0],
operands[3],
@@ -10719,12 +10725,16 @@ label:
;; ??? reload might clobber r0 if we use it explicitly in the RTL before
;; reload; using a R0_REGS pseudo reg is likely to give poor code.
;; So we keep the use of r0 hidden in a R0_REGS clobber until after reload.
+;;
+;; The use on the T_REG in the casesi_worker* patterns links the bounds
+;; checking insns and the table memory access. See also PR 69713.
(define_insn "casesi_worker_0"
[(set (match_operand:SI 0 "register_operand" "=r,r")
(unspec:SI [(match_operand:SI 1 "register_operand" "0,r")
(label_ref (match_operand 2 "" ""))] UNSPEC_CASESI))
(clobber (match_scratch:SI 3 "=X,1"))
- (clobber (match_scratch:SI 4 "=&z,z"))]
+ (clobber (match_scratch:SI 4 "=&z,z"))
+ (use (reg:SI T_REG))]
"TARGET_SH1"
"#")
@@ -10733,7 +10743,8 @@ label:
(unspec:SI [(match_operand:SI 1 "register_operand" "")
(label_ref (match_operand 2 "" ""))] UNSPEC_CASESI))
(clobber (match_scratch:SI 3 ""))
- (clobber (match_scratch:SI 4 ""))]
+ (clobber (match_scratch:SI 4))
+ (use (reg:SI T_REG))]
"TARGET_SH1 && ! TARGET_SH2 && reload_completed"
[(set (reg:SI R0_REG) (unspec:SI [(label_ref (match_dup 2))] UNSPEC_MOVA))
(parallel [(set (match_dup 0)
@@ -10751,7 +10762,8 @@ label:
(unspec:SI [(match_operand:SI 1 "register_operand" "")
(label_ref (match_operand 2 "" ""))] UNSPEC_CASESI))
(clobber (match_scratch:SI 3 ""))
- (clobber (match_scratch:SI 4 ""))]
+ (clobber (match_scratch:SI 4))
+ (use (reg:SI T_REG))]
"TARGET_SH2 && reload_completed"
[(set (reg:SI R0_REG) (unspec:SI [(label_ref (match_dup 2))] UNSPEC_MOVA))
(parallel [(set (match_dup 0)
diff --git a/gcc/config/sparc/sp-elf.h b/gcc/config/sparc/sp-elf.h
index 28366e64f36..d9e3b77f3ec 100644
--- a/gcc/config/sparc/sp-elf.h
+++ b/gcc/config/sparc/sp-elf.h
@@ -53,6 +53,10 @@ along with GCC; see the file COPYING3. If not see
#undef ASM_GENERATE_INTERNAL_LABEL
#define ASM_GENERATE_INTERNAL_LABEL(LABEL,PREFIX,NUM) \
sprintf ((LABEL), "*.L%s%ld", (PREFIX), (long)(NUM))
+
+/* We use GNU ld so undefine this so that attribute((init_priority)) works. */
+#undef CTORS_SECTION_ASM_OP
+#undef DTORS_SECTION_ASM_OP
/* ??? Inherited from sol2.h. Probably wrong. */
#undef WCHAR_TYPE
diff --git a/gcc/config/sparc/sparc.c b/gcc/config/sparc/sparc.c
index d6449445caf..4d80c17829d 100644
--- a/gcc/config/sparc/sparc.c
+++ b/gcc/config/sparc/sparc.c
@@ -4980,13 +4980,18 @@ sparc_compute_frame_size (HOST_WIDE_INT size, int leaf_function)
/* Calculate space needed for global registers. */
if (TARGET_ARCH64)
- for (i = 0; i < 8; i++)
- if (save_global_or_fp_reg_p (i, 0))
- n_global_fp_regs += 2;
+ {
+ for (i = 0; i < 8; i++)
+ if (save_global_or_fp_reg_p (i, 0))
+ n_global_fp_regs += 2;
+ }
else
- for (i = 0; i < 8; i += 2)
- if (save_global_or_fp_reg_p (i, 0) || save_global_or_fp_reg_p (i + 1, 0))
- n_global_fp_regs += 2;
+ {
+ for (i = 0; i < 8; i += 2)
+ if (save_global_or_fp_reg_p (i, 0)
+ || save_global_or_fp_reg_p (i + 1, 0))
+ n_global_fp_regs += 2;
+ }
/* In the flat window model, find out which local and in registers need to
be saved. We don't reserve space in the current frame for them as they
@@ -7384,9 +7389,10 @@ sparc_function_value_1 (const_tree type, enum machine_mode mode,
mode = word_mode;
}
- /* We should only have pointer and integer types at this point. This must
- match sparc_promote_function_mode. */
+ /* We should only have pointer and integer types at this point, except with
+ -freg-struct-return. This must match sparc_promote_function_mode. */
else if (TARGET_ARCH32
+ && !(type && AGGREGATE_TYPE_P (type))
&& mclass == MODE_INT
&& GET_MODE_SIZE (mode) < UNITS_PER_WORD)
mode = word_mode;
diff --git a/gcc/configure b/gcc/configure
index 2a29445b7ac..cb847015834 100755
--- a/gcc/configure
+++ b/gcc/configure
@@ -15918,7 +15918,7 @@ _LT_EOF
if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
else
- export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+ export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
fi
aix_use_runtimelinking=no
@@ -20404,7 +20404,7 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie
if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
else
- export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+ export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
fi
;;
pw32*)
@@ -21553,7 +21553,7 @@ fi
if test "${with_plugin_ld+set}" = set; then :
withval=$with_plugin_ld; if test x"$withval" != x; then
ORIGINAL_PLUGIN_LD_FOR_TARGET="$withval"
- PLUGIN_LD_SUFFIX=`echo $withval | sed -e "s,$target_alias-,,"`
+ PLUGIN_LD_SUFFIX="$withval"
fi
fi
@@ -22988,6 +22988,37 @@ cat >>confdefs.h <<_ACEOF
_ACEOF
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for stabs directive" >&5
+$as_echo_n "checking assembler for stabs directive... " >&6; }
+if test "${gcc_cv_as_stabs_directive+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ gcc_cv_as_stabs_directive=no
+ if test x$gcc_cv_as != x; then
+ $as_echo '.stabs "gcc2_compiled.",60,0,0,0' > conftest.s
+ if { ac_try='$gcc_cv_as $gcc_cv_as_flags -o conftest.o conftest.s >&5'
+ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; }
+ then
+ gcc_cv_as_stabs_directive=yes
+ else
+ echo "configure: failed program was" >&5
+ cat conftest.s >&5
+ fi
+ rm -f conftest.o conftest.s
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_as_stabs_directive" >&5
+$as_echo "$gcc_cv_as_stabs_directive" >&6; }
+if test $gcc_cv_as_stabs_directive = yes; then
+
+$as_echo "#define HAVE_AS_STABS_DIRECTIVE 1" >>confdefs.h
+
+fi
+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for COMDAT group support (GNU as)" >&5
$as_echo_n "checking assembler for COMDAT group support (GNU as)... " >&6; }
if test "${gcc_cv_as_comdat_group+set}" = set; then :
@@ -27948,6 +27979,8 @@ $as_echo "#define HAVE_cloog 1" >>confdefs.h
# Check whether isl_schedule_constraints_compute_schedule is available;
# it's new in ISL-0.13.
+ # Check whether isl_options_set_schedule_serialize_sccs is available;
+ # it's new in ISL-0.15.
saved_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $ISLINC"
saved_LIBS="$LIBS"
@@ -27976,6 +28009,29 @@ rm -f core conftest.err conftest.$ac_objext \
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_has_isl_schedule_constraints_compute_schedule" >&5
$as_echo "$ac_has_isl_schedule_constraints_compute_schedule" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking Checking for isl_options_set_schedule_serialize_sccs" >&5
+$as_echo_n "checking Checking for isl_options_set_schedule_serialize_sccs... " >&6; }
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <isl/schedule.h>
+int
+main ()
+{
+isl_options_set_schedule_serialize_sccs (NULL, 0);
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_has_isl_options_set_schedule_serialize_sccs=yes
+else
+ ac_has_isl_options_set_schedule_serialize_sccs=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_has_isl_options_set_schedule_serialize_sccs" >&5
+$as_echo "$ac_has_isl_options_set_schedule_serialize_sccs" >&6; }
+
LIBS="$saved_LIBS"
CFLAGS="$saved_CFLAGS"
@@ -27984,6 +28040,12 @@ $as_echo "$ac_has_isl_schedule_constraints_compute_schedule" >&6; }
$as_echo "#define HAVE_ISL_SCHED_CONSTRAINTS_COMPUTE_SCHEDULE 1" >>confdefs.h
fi
+
+ if test x"$ac_has_isl_options_set_schedule_serialize_sccs" = x"yes"; then
+
+$as_echo "#define HAVE_ISL_OPTIONS_SET_SCHEDULE_SERIALIZE_SCCS 1" >>confdefs.h
+
+ fi
fi
diff --git a/gcc/configure.ac b/gcc/configure.ac
index 9fc97277760..94acd161d73 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -2098,7 +2098,7 @@ AC_ARG_WITH(plugin-ld,
[AS_HELP_STRING([[--with-plugin-ld=[ARG]]], [specify the plugin linker])],
[if test x"$withval" != x; then
ORIGINAL_PLUGIN_LD_FOR_TARGET="$withval"
- PLUGIN_LD_SUFFIX=`echo $withval | sed -e "s,$target_alias-,,"`
+ PLUGIN_LD_SUFFIX="$withval"
fi])
AC_SUBST(ORIGINAL_PLUGIN_LD_FOR_TARGET)
AC_DEFINE_UNQUOTED(PLUGIN_LD_SUFFIX, "$PLUGIN_LD_SUFFIX", [Specify plugin linker])
@@ -2746,6 +2746,11 @@ AC_DEFINE_UNQUOTED(HAVE_GAS_SHF_MERGE,
[`if test $gcc_cv_as_shf_merge = yes; then echo 1; else echo 0; fi`],
[Define 0/1 if your assembler supports marking sections with SHF_MERGE flag.])
+gcc_GAS_CHECK_FEATURE([stabs directive], gcc_cv_as_stabs_directive, ,,
+[.stabs "gcc2_compiled.",60,0,0,0],,
+[AC_DEFINE(HAVE_AS_STABS_DIRECTIVE, 1,
+ [Define if your assembler supports .stabs.])])
+
gcc_GAS_CHECK_FEATURE([COMDAT group support (GNU as)],
gcc_cv_as_comdat_group,
[elf,2,16,0], [--fatal-warnings],
@@ -5535,6 +5540,8 @@ if test "x${CLOOGLIBS}" != "x" ; then
# Check whether isl_schedule_constraints_compute_schedule is available;
# it's new in ISL-0.13.
+ # Check whether isl_options_set_schedule_serialize_sccs is available;
+ # it's new in ISL-0.15.
saved_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $ISLINC"
saved_LIBS="$LIBS"
@@ -5547,6 +5554,13 @@ if test "x${CLOOGLIBS}" != "x" ; then
[ac_has_isl_schedule_constraints_compute_schedule=no])
AC_MSG_RESULT($ac_has_isl_schedule_constraints_compute_schedule)
+ AC_MSG_CHECKING([Checking for isl_options_set_schedule_serialize_sccs])
+ AC_TRY_LINK([#include <isl/schedule.h>],
+ [isl_options_set_schedule_serialize_sccs (NULL, 0);],
+ [ac_has_isl_options_set_schedule_serialize_sccs=yes],
+ [ac_has_isl_options_set_schedule_serialize_sccs=no])
+ AC_MSG_RESULT($ac_has_isl_options_set_schedule_serialize_sccs)
+
LIBS="$saved_LIBS"
CFLAGS="$saved_CFLAGS"
@@ -5554,6 +5568,11 @@ if test "x${CLOOGLIBS}" != "x" ; then
AC_DEFINE(HAVE_ISL_SCHED_CONSTRAINTS_COMPUTE_SCHEDULE, 1,
[Define if isl_schedule_constraints_compute_schedule exists.])
fi
+
+ if test x"$ac_has_isl_options_set_schedule_serialize_sccs" = x"yes"; then
+ AC_DEFINE(HAVE_ISL_OPTIONS_SET_SCHEDULE_SERIALIZE_SCCS, 1,
+ [Define if isl_options_set_schedule_serialize_sccs exists.])
+ fi
fi
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 8fe4ac59b5f..b926ef17cb0 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,131 @@
+2016-08-03 Release Manager
+
+ * GCC 4.9.4 released.
+
+2016-07-21 Jason Merrill <jason@redhat.com>
+
+ PR c++/69223
+ * semantics.c (apply_deduced_return_type): Call
+ complete_type_or_else before building the new RESULT_DECL.
+
+ PR c++/71913
+ * call.c (unsafe_copy_elision_p): It's OK to elide when
+ initializing an unknown object.
+
+2016-07-20 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/71909
+ * parser.c (cp_parser_save_member_function_body): Consume
+ __transaction_relaxed or __transaction_atomic with optional
+ attribute. Only skip catch with block if try keyword is seen.
+
+2016-07-19 Jakub Jelinek <jakub@redhat.com>
+
+ Backported from mainline
+ 2016-07-18 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/71871
+ * typeck.c (build_x_conditional_expr): Revert the 2012-10-25 change.
+
+2016-07-07 Jakub Jelinek <jakub@redhat.com>
+
+ Backported from mainline
+ 2016-02-19 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/67767
+ * parser.c (cp_parser_std_attribute_spec_seq): Don't assume
+ attr_spec is always single element chain, chain all the attributes
+ properly together in the right order.
+
+2016-05-18 Jason Merrill <jason@redhat.com>
+
+ PR c++/70505
+ * pt.c (tsubst_baselink): Give the new TEMPLATE_ID_EXPR
+ unknown_type_node, too.
+
+2016-04-13 Alan Modra <amodra@gmail.com>
+
+ Backport from mainline
+ 2016-03-22 Patrick Palka <ppalka@gcc.gnu.org>
+ PR target/70107
+ PR c++/70096
+ * pt.c (tsubst_decl): Clear the DECL_MODE of the new decl.
+
+2016-03-18 Jonathan Wakely <jwakely@redhat.com>
+
+ Backported from mainline
+ 2014-12-19 Kai Tietz <ktietz@redhat.com>
+
+ PR c++/61198
+ * pt.c (most_general_template): Don't break for template-alias.
+
+2016-03-03 Jason Merrill <jason@redhat.com>
+
+ PR c++/65061
+ * parser.c (cp_parser_template_name): Call strip_using_decl.
+
+2016-02-25 Bernd Edlinger <bernd.edlinger@hotmail.de>
+
+ Backported from mainline
+ 2016-02-19 Jakub Jelinek <jakub@redhat.com>
+ Bernd Edlinger <bernd.edlinger@hotmail.de>
+
+ * Make-lang.in: Invoke gperf with -L C++.
+ * cfns.gperf: Remove prototypes for hash and libc_name_p
+ inlines.
+ * cfns.h: Regenerated.
+ * except.c (nothrow_libfn_p): Adjust.
+
+2016-02-11 Jakub Jelinek <jakub@redhat.com>
+
+ Backported from mainline
+ 2016-02-08 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/59627
+ * parser.c (cp_parser_omp_declare_reduction): Set assembler name
+ of the DECL_OMP_DECLARE_REDUCTION_P decls.
+
+2016-02-10 Jason Merrill <jason@redhat.com>
+
+ PR c++/68926
+ * pt.c (resolve_nondeduced_context): Add complain parm.
+ (do_auto_deduction): Pass it.
+ * cvt.c (convert_to_void): Likewise.
+ * decl.c (cp_finish_decl): Likewise.
+ * init.c (build_new): Likewise.
+ * rtti.c (get_tinfo_decl_dynamic): Likewise.
+ * semantics.c (finish_decltype_type): Likewise.
+ * typeck.c (decay_conversion): Likewise.
+ * cp-tree.h: Adjust declaration.
+
+2016-01-07 Jason Merrill <jason@redhat.com>
+
+ PR c++/68983
+ PR c++/67557
+ * call.c (unsafe_copy_elision_p): Look through COMPOUND_EXPR.
+
+2015-12-21 Jason Merrill <jason@redhat.com>
+
+ PR c++/66921
+ * decl.c (cp_complete_array_type): Allow an initializer that
+ already has array type.
+
+2015-12-17 Jason Merrill <jason@redhat.com>
+
+ PR c++/67576
+ PR c++/25466
+ * rtti.c (build_typeid): Use save_expr, not stabilize_reference.
+
+ PR c++/67557
+ * call.c (is_base_field_ref): New.
+ (unsafe_copy_elision_p): New.
+ (build_over_call): Use it.
+
+2015-12-04 Markus Trippelsdorf <markus@trippelsdorf.de>
+
+ PR c++/67337
+ * mangle.c (write_template_prefix): Guard against context==NULL.
+
2015-08-17 Jason Merrill <jason@redhat.com>
PR c++/66957
diff --git a/gcc/cp/Make-lang.in b/gcc/cp/Make-lang.in
index bd1c1d78f88..a0ea0d48359 100644
--- a/gcc/cp/Make-lang.in
+++ b/gcc/cp/Make-lang.in
@@ -111,7 +111,7 @@ else
# deleting the $(srcdir)/cp/cfns.h file.
$(srcdir)/cp/cfns.h:
endif
- gperf -o -C -E -k '1-6,$$' -j1 -D -N 'libc_name_p' -L ANSI-C \
+ gperf -o -C -E -k '1-6,$$' -j1 -D -N 'libc_name_p' -L C++ \
$(srcdir)/cp/cfns.gperf --output-file $(srcdir)/cp/cfns.h
#
diff --git a/gcc/cp/call.c b/gcc/cp/call.c
index 46bb880a878..59dc3633a74 100644
--- a/gcc/cp/call.c
+++ b/gcc/cp/call.c
@@ -6734,6 +6734,43 @@ mark_versions_used (tree fn)
}
}
+/* Return true iff T refers to a base field. */
+
+static bool
+is_base_field_ref (tree t)
+{
+ STRIP_NOPS (t);
+ if (TREE_CODE (t) == ADDR_EXPR)
+ t = TREE_OPERAND (t, 0);
+ if (TREE_CODE (t) == COMPONENT_REF)
+ t = TREE_OPERAND (t, 1);
+ if (TREE_CODE (t) == FIELD_DECL)
+ return DECL_FIELD_IS_BASE (t);
+ return false;
+}
+
+/* We can't elide a copy from a function returning by value to a base
+ subobject, as the callee might clobber tail padding. Return true iff this
+ could be that case. */
+
+static bool
+unsafe_copy_elision_p (tree target, tree exp)
+{
+ tree type = TYPE_MAIN_VARIANT (TREE_TYPE (exp));
+ /* It's safe to elide the copy for a class with no tail padding. */
+ if (tree_int_cst_equal (TYPE_SIZE (type), CLASSTYPE_SIZE (type)))
+ return false;
+ /* It's safe to elide the copy if we aren't initializing a base object. */
+ if (!is_base_field_ref (target))
+ return false;
+ tree init = TARGET_EXPR_INITIAL (exp);
+ /* build_compound_expr pushes COMPOUND_EXPR inside TARGET_EXPR. */
+ while (TREE_CODE (init) == COMPOUND_EXPR)
+ init = TREE_OPERAND (init, 1);
+ return (TREE_CODE (init) == AGGR_INIT_EXPR
+ && !AGGR_INIT_VIA_CTOR_P (init));
+}
+
/* Subroutine of the various build_*_call functions. Overload resolution
has chosen a winning candidate CAND; build up a CALL_EXPR accordingly.
ARGS is a TREE_LIST of the unconverted arguments to the call. FLAGS is a
@@ -7133,7 +7170,9 @@ build_over_call (struct z_candidate *cand, int flags, tsubst_flags_t complain)
else if (trivial)
return force_target_expr (DECL_CONTEXT (fn), arg, complain);
}
- else if (TREE_CODE (arg) == TARGET_EXPR || trivial)
+ else if (trivial
+ || (TREE_CODE (arg) == TARGET_EXPR
+ && !unsafe_copy_elision_p (fa, arg)))
{
tree to = stabilize_reference (cp_build_indirect_ref (fa, RO_NULL,
complain));
diff --git a/gcc/cp/cfns.gperf b/gcc/cp/cfns.gperf
index 05ca753927e..d9b16b800ef 100644
--- a/gcc/cp/cfns.gperf
+++ b/gcc/cp/cfns.gperf
@@ -1,3 +1,5 @@
+%language=C++
+%define class-name libc_name
%{
/* Copyright (C) 2000-2014 Free Software Foundation, Inc.
@@ -16,14 +18,6 @@ for more details.
You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */
-#ifdef __GNUC__
-__inline
-#endif
-static unsigned int hash (const char *, unsigned int);
-#ifdef __GNUC__
-__inline
-#endif
-const char * libc_name_p (const char *, unsigned int);
%}
%%
# The standard C library functions, for feeding to gperf; the result is used
diff --git a/gcc/cp/cfns.h b/gcc/cp/cfns.h
index c845ddf08ea..65801d1ae31 100644
--- a/gcc/cp/cfns.h
+++ b/gcc/cp/cfns.h
@@ -1,5 +1,5 @@
-/* ANSI-C code produced by gperf version 3.0.3 */
-/* Command-line: gperf -o -C -E -k '1-6,$' -j1 -D -N libc_name_p -L ANSI-C cfns.gperf */
+/* C++ code produced by gperf version 3.0.4 */
+/* Command-line: gperf -o -C -E -k '1-6,$' -j1 -D -N libc_name_p -L C++ --output-file cfns.h cfns.gperf */
#if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \
&& ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \
@@ -28,7 +28,7 @@
#error "gperf generated tables don't work with this execution character set. Please report a bug to <bug-gnu-gperf@gnu.org>."
#endif
-#line 1 "cfns.gperf"
+#line 3 "cfns.gperf"
/* Copyright (C) 2000-2014 Free Software Foundation, Inc.
@@ -47,25 +47,18 @@ for more details.
You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */
-#ifdef __GNUC__
-__inline
-#endif
-static unsigned int hash (const char *, unsigned int);
-#ifdef __GNUC__
-__inline
-#endif
-const char * libc_name_p (const char *, unsigned int);
/* maximum key range = 391, duplicates = 0 */
-#ifdef __GNUC__
-__inline
-#else
-#ifdef __cplusplus
-inline
-#endif
-#endif
-static unsigned int
-hash (register const char *str, register unsigned int len)
+class libc_name
+{
+private:
+ static inline unsigned int hash (const char *str, unsigned int len);
+public:
+ static const char *libc_name_p (const char *str, unsigned int len);
+};
+
+inline unsigned int
+libc_name::hash (register const char *str, register unsigned int len)
{
static const unsigned short asso_values[] =
{
@@ -122,14 +115,8 @@ hash (register const char *str, register unsigned int len)
return hval + asso_values[(unsigned char)str[len - 1]];
}
-#ifdef __GNUC__
-__inline
-#ifdef __GNUC_STDC_INLINE__
-__attribute__ ((__gnu_inline__))
-#endif
-#endif
const char *
-libc_name_p (register const char *str, register unsigned int len)
+libc_name::libc_name_p (register const char *str, register unsigned int len)
{
enum
{
diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h
index 163ee87a1ed..4478d476080 100644
--- a/gcc/cp/cp-tree.h
+++ b/gcc/cp/cp-tree.h
@@ -5632,7 +5632,7 @@ extern tree get_template_parms_at_level (tree, int);
extern tree get_template_innermost_arguments (const_tree);
extern tree get_template_argument_pack_elems (const_tree);
extern tree get_function_template_decl (const_tree);
-extern tree resolve_nondeduced_context (tree);
+extern tree resolve_nondeduced_context (tree, tsubst_flags_t);
extern hashval_t iterative_hash_template_arg (tree arg, hashval_t val);
/* in repo.c */
diff --git a/gcc/cp/cvt.c b/gcc/cp/cvt.c
index adfe7c6575f..4e6b3f73f43 100644
--- a/gcc/cp/cvt.c
+++ b/gcc/cp/cvt.c
@@ -1253,7 +1253,7 @@ convert_to_void (tree expr, impl_conv_void implicit, tsubst_flags_t complain)
default:;
}
- expr = resolve_nondeduced_context (expr);
+ expr = resolve_nondeduced_context (expr, complain);
{
tree probe = expr;
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 46cd58f95b9..74539efce05 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -6215,7 +6215,7 @@ cp_finish_decl (tree decl, tree init, bool init_const_expr_p,
if (TREE_CODE (d_init) == TREE_LIST)
d_init = build_x_compound_expr_from_list (d_init, ELK_INIT,
tf_warning_or_error);
- d_init = resolve_nondeduced_context (d_init);
+ d_init = resolve_nondeduced_context (d_init, tf_warning_or_error);
type = TREE_TYPE (decl) = do_auto_deduction (type, d_init,
auto_node);
if (type == error_mark_node)
@@ -7138,7 +7138,8 @@ cp_complete_array_type (tree *ptype, tree initial_value, bool do_default)
/* Don't get confused by a CONSTRUCTOR for some other type. */
if (initial_value && TREE_CODE (initial_value) == CONSTRUCTOR
- && !BRACE_ENCLOSED_INITIALIZER_P (initial_value))
+ && !BRACE_ENCLOSED_INITIALIZER_P (initial_value)
+ && TREE_CODE (TREE_TYPE (initial_value)) != ARRAY_TYPE)
return 1;
if (initial_value)
diff --git a/gcc/cp/except.c b/gcc/cp/except.c
index 221971ac956..32340f5ae83 100644
--- a/gcc/cp/except.c
+++ b/gcc/cp/except.c
@@ -1030,7 +1030,8 @@ nothrow_libfn_p (const_tree fn)
unless the system headers are playing rename tricks, and if
they are, we don't want to be confused by them. */
id = DECL_NAME (fn);
- return !!libc_name_p (IDENTIFIER_POINTER (id), IDENTIFIER_LENGTH (id));
+ return !!libc_name::libc_name_p (IDENTIFIER_POINTER (id),
+ IDENTIFIER_LENGTH (id));
}
/* Returns nonzero if an exception of type FROM will be caught by a
diff --git a/gcc/cp/init.c b/gcc/cp/init.c
index 09a897f0ef8..745b651f9bc 100644
--- a/gcc/cp/init.c
+++ b/gcc/cp/init.c
@@ -3027,7 +3027,7 @@ build_new (vec<tree, va_gc> **placement, tree type, tree nelts,
if (auto_node)
{
tree d_init = (**init)[0];
- d_init = resolve_nondeduced_context (d_init);
+ d_init = resolve_nondeduced_context (d_init, complain);
type = do_auto_deduction (type, d_init, auto_node);
}
}
diff --git a/gcc/cp/mangle.c b/gcc/cp/mangle.c
index c9b1c5f8eb0..3a22b0dc584 100644
--- a/gcc/cp/mangle.c
+++ b/gcc/cp/mangle.c
@@ -1118,7 +1118,7 @@ write_template_prefix (const tree node)
So, for the example above, `Outer<int>::Inner' is represented as a
substitution candidate by a TREE_LIST whose purpose is `Outer<int>'
and whose value is `Outer<T>::Inner<U>'. */
- if (TYPE_P (context))
+ if (context && TYPE_P (context))
substitution = build_tree_list (context, templ);
else
substitution = templ;
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index 18c706846ba..e06bb0a1b4b 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -13669,6 +13669,8 @@ cp_parser_template_name (cp_parser* parser,
/*ambiguous_decls=*/NULL,
token->location);
+ decl = strip_using_decl (decl);
+
/* If DECL is a template, then the name was a template-name. */
if (TREE_CODE (decl) == TEMPLATE_DECL)
;
@@ -22045,7 +22047,8 @@ cp_parser_std_attribute_spec (cp_parser *parser)
static tree
cp_parser_std_attribute_spec_seq (cp_parser *parser)
{
- tree attr_specs = NULL;
+ tree attr_specs = NULL_TREE;
+ tree attr_last = NULL_TREE;
while (true)
{
@@ -22055,11 +22058,13 @@ cp_parser_std_attribute_spec_seq (cp_parser *parser)
if (attr_spec == error_mark_node)
return error_mark_node;
- TREE_CHAIN (attr_spec) = attr_specs;
- attr_specs = attr_spec;
+ if (attr_last)
+ TREE_CHAIN (attr_last) = attr_spec;
+ else
+ attr_specs = attr_last = attr_spec;
+ attr_last = tree_last (attr_last);
}
- attr_specs = nreverse (attr_specs);
return attr_specs;
}
@@ -23361,6 +23366,7 @@ cp_parser_save_member_function_body (cp_parser* parser,
cp_token *first;
cp_token *last;
tree fn;
+ bool function_try_block = false;
/* Create the FUNCTION_DECL. */
fn = grokmethod (decl_specifiers, declarator, attributes);
@@ -23381,9 +23387,48 @@ cp_parser_save_member_function_body (cp_parser* parser,
/* Save away the tokens that make up the body of the
function. */
first = parser->lexer->next_token;
+
+ if (cp_lexer_next_token_is_keyword (parser->lexer, RID_TRANSACTION_RELAXED))
+ cp_lexer_consume_token (parser->lexer);
+ else if (cp_lexer_next_token_is_keyword (parser->lexer,
+ RID_TRANSACTION_ATOMIC))
+ {
+ cp_lexer_consume_token (parser->lexer);
+ /* Match cp_parser_txn_attribute_opt [[ identifier ]]. */
+ if (cp_lexer_next_token_is (parser->lexer, CPP_OPEN_SQUARE)
+ && (cp_lexer_peek_nth_token (parser->lexer, 2)->type
+ == CPP_OPEN_SQUARE)
+ && (cp_lexer_peek_nth_token (parser->lexer, 3)->type == CPP_NAME
+ || (cp_lexer_peek_nth_token (parser->lexer, 3)->type
+ == CPP_KEYWORD))
+ && (cp_lexer_peek_nth_token (parser->lexer, 4)->type
+ == CPP_CLOSE_SQUARE)
+ && (cp_lexer_peek_nth_token (parser->lexer, 5)->type
+ == CPP_CLOSE_SQUARE))
+ {
+ cp_lexer_consume_token (parser->lexer);
+ cp_lexer_consume_token (parser->lexer);
+ cp_lexer_consume_token (parser->lexer);
+ cp_lexer_consume_token (parser->lexer);
+ cp_lexer_consume_token (parser->lexer);
+ }
+ else
+ while (cp_next_tokens_can_be_gnu_attribute_p (parser)
+ && (cp_lexer_peek_nth_token (parser->lexer, 2)->type
+ == CPP_OPEN_PAREN))
+ {
+ cp_lexer_consume_token (parser->lexer);
+ if (cp_parser_cache_group (parser, CPP_CLOSE_PAREN, /*depth=*/0))
+ break;
+ }
+ }
+
/* Handle function try blocks. */
if (cp_lexer_next_token_is_keyword (parser->lexer, RID_TRY))
- cp_lexer_consume_token (parser->lexer);
+ {
+ cp_lexer_consume_token (parser->lexer);
+ function_try_block = true;
+ }
/* We can have braced-init-list mem-initializers before the fn body. */
if (cp_lexer_next_token_is (parser->lexer, CPP_COLON))
{
@@ -23401,8 +23446,9 @@ cp_parser_save_member_function_body (cp_parser* parser,
}
cp_parser_cache_group (parser, CPP_CLOSE_BRACE, /*depth=*/0);
/* Handle function try blocks. */
- while (cp_lexer_next_token_is_keyword (parser->lexer, RID_CATCH))
- cp_parser_cache_group (parser, CPP_CLOSE_BRACE, /*depth=*/0);
+ if (function_try_block)
+ while (cp_lexer_next_token_is_keyword (parser->lexer, RID_CATCH))
+ cp_parser_cache_group (parser, CPP_CLOSE_BRACE, /*depth=*/0);
last = parser->lexer->next_token;
/* Save away the inline definition; we will process it when the
@@ -30918,6 +30964,7 @@ cp_parser_omp_declare_reduction (cp_parser *parser, cp_token *pragma_tok,
DECL_DECLARED_INLINE_P (fndecl) = 1;
DECL_IGNORED_P (fndecl) = 1;
DECL_OMP_DECLARE_REDUCTION_P (fndecl) = 1;
+ SET_DECL_ASSEMBLER_NAME (fndecl, get_identifier ("<udr>"));
DECL_ATTRIBUTES (fndecl)
= tree_cons (get_identifier ("gnu_inline"), NULL_TREE,
DECL_ATTRIBUTES (fndecl));
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index 60e96710eb6..e08a27d437b 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -11164,6 +11164,8 @@ tsubst_decl (tree t, tree args, tsubst_flags_t complain)
/* The initializer must not be expanded until it is required;
see [temp.inst]. */
DECL_INITIAL (r) = NULL_TREE;
+ if (VAR_P (r))
+ DECL_MODE (r) = VOIDmode;
if (CODE_CONTAINS_STRUCT (TREE_CODE (t), TS_DECL_WRTL))
SET_DECL_RTL (r, NULL);
DECL_SIZE (r) = DECL_SIZE_UNIT (r) = 0;
@@ -12390,9 +12392,10 @@ tsubst_baselink (tree baselink, tree object_type,
/* Add back the template arguments, if present. */
if (BASELINK_P (baselink) && template_id_p)
BASELINK_FUNCTIONS (baselink)
- = build_nt (TEMPLATE_ID_EXPR,
- BASELINK_FUNCTIONS (baselink),
- template_args);
+ = build2 (TEMPLATE_ID_EXPR,
+ unknown_type_node,
+ BASELINK_FUNCTIONS (baselink),
+ template_args);
/* Update the conversion operator type. */
BASELINK_OPTYPE (baselink) = optype;
@@ -16773,7 +16776,7 @@ resolve_overloaded_unification (tree tparms,
lvalue for the function template specialization. */
tree
-resolve_nondeduced_context (tree orig_expr)
+resolve_nondeduced_context (tree orig_expr, tsubst_flags_t complain)
{
tree expr, offset, baselink;
bool addr;
@@ -16856,16 +16859,16 @@ resolve_nondeduced_context (tree orig_expr)
{
tree base
= TYPE_MAIN_VARIANT (TREE_TYPE (TREE_OPERAND (offset, 0)));
- expr = build_offset_ref (base, expr, addr, tf_warning_or_error);
+ expr = build_offset_ref (base, expr, addr, complain);
}
if (addr)
- expr = cp_build_addr_expr (expr, tf_warning_or_error);
+ expr = cp_build_addr_expr (expr, complain);
return expr;
}
- else if (good == 0 && badargs)
+ else if (good == 0 && badargs && (complain & tf_error))
/* There were no good options and at least one bad one, so let the
user know what the problem is. */
- instantiate_template (badfn, badargs, tf_warning_or_error);
+ instantiate_template (badfn, badargs, complain);
}
return orig_expr;
}
@@ -18873,6 +18876,7 @@ most_general_template (tree decl)
break;
if (CLASS_TYPE_P (TREE_TYPE (decl))
+ && !TYPE_DECL_ALIAS_P (TYPE_NAME (TREE_TYPE (decl)))
&& CLASSTYPE_TEMPLATE_SPECIALIZATION (TREE_TYPE (decl)))
break;
@@ -21738,7 +21742,7 @@ do_auto_deduction (tree type, tree init, tree auto_node)
if (BRACE_ENCLOSED_INITIALIZER_P (init))
type = listify_autos (type, auto_node);
- init = resolve_nondeduced_context (init);
+ init = resolve_nondeduced_context (init, tf_warning_or_error);
targs = make_tree_vec (1);
if (AUTO_IS_DECLTYPE (auto_node))
diff --git a/gcc/cp/rtti.c b/gcc/cp/rtti.c
index a8e6d25c844..051c4570ff6 100644
--- a/gcc/cp/rtti.c
+++ b/gcc/cp/rtti.c
@@ -245,7 +245,7 @@ get_tinfo_decl_dynamic (tree exp, tsubst_flags_t complain)
if (error_operand_p (exp))
return error_mark_node;
- exp = resolve_nondeduced_context (exp);
+ exp = resolve_nondeduced_context (exp, complain);
/* peel back references, so they match. */
type = non_reference (TREE_TYPE (exp));
@@ -335,7 +335,7 @@ build_typeid (tree exp, tsubst_flags_t complain)
/* So we need to look into the vtable of the type of exp.
Make sure it isn't a null lvalue. */
exp = cp_build_addr_expr (exp, complain);
- exp = stabilize_reference (exp);
+ exp = save_expr (exp);
cond = cp_convert (boolean_type_node, exp, complain);
exp = cp_build_indirect_ref (exp, RO_NULL, complain);
}
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c
index bbed56fb06e..7699765fe58 100644
--- a/gcc/cp/semantics.c
+++ b/gcc/cp/semantics.c
@@ -6936,7 +6936,7 @@ finish_decltype_type (tree expr, bool id_expression_or_member_access_p,
/* The type denoted by decltype(e) is defined as follows: */
- expr = resolve_nondeduced_context (expr);
+ expr = resolve_nondeduced_context (expr, complain);
if (invalid_nonstatic_memfn_p (expr, complain))
return error_mark_node;
@@ -10664,6 +10664,10 @@ apply_deduced_return_type (tree fco, tree return_type)
if (TREE_TYPE (result) == return_type)
return;
+ if (!processing_template_decl && !VOID_TYPE_P (return_type)
+ && !complete_type_or_else (return_type, NULL_TREE))
+ return;
+
/* We already have a DECL_RESULT from start_preparsed_function.
Now we need to redo the work it and allocate_struct_function
did to reflect the new type. */
diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c
index cd8318d92c6..6ed91251c96 100644
--- a/gcc/cp/typeck.c
+++ b/gcc/cp/typeck.c
@@ -1896,7 +1896,7 @@ decay_conversion (tree exp, tsubst_flags_t complain)
exp = mark_rvalue_use (exp);
- exp = resolve_nondeduced_context (exp);
+ exp = resolve_nondeduced_context (exp, complain);
if (type_unknown_p (exp))
{
if (complain & tf_error)
@@ -6055,8 +6055,7 @@ build_x_conditional_expr (location_t loc, tree ifexp, tree op1, tree op2,
}
expr = build_conditional_expr (loc, ifexp, op1, op2, complain);
- if (processing_template_decl && expr != error_mark_node
- && TREE_CODE (expr) != VEC_COND_EXPR)
+ if (processing_template_decl && expr != error_mark_node)
{
tree min = build_min_non_dep (COND_EXPR, expr,
orig_ifexp, orig_op1, orig_op2);
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index 9b4a1c2bfa8..0e8f707abed 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -921,7 +921,7 @@ See RS/6000 and PowerPC Options.
-mpointers-to-nested-functions -mno-pointers-to-nested-functions @gol
-msave-toc-indirect -mno-save-toc-indirect @gol
-mpower8-fusion -mno-mpower8-fusion -mpower8-vector -mno-power8-vector @gol
--mcrypto -mno-crypto -mdirect-move -mno-direct-move @gol
+-mcrypto -mno-crypto -mhtm -mno-htm -mdirect-move -mno-direct-move @gol
-mquad-memory -mno-quad-memory @gol
-mquad-memory-atomic -mno-quad-memory-atomic @gol
-mcompat-align-parm -mno-compat-align-parm}
@@ -19010,7 +19010,7 @@ following options:
-mpopcntb -mpopcntd -mpowerpc64 @gol
-mpowerpc-gpopt -mpowerpc-gfxopt -msingle-float -mdouble-float @gol
-msimple-fpu -mstring -mmulhw -mdlmzb -mmfpgpr -mvsx @gol
--mcrypto -mdirect-move -mpower8-fusion -mpower8-vector @gol
+-mcrypto -mdirect-move -mhtm -mpower8-fusion -mpower8-vector @gol
-mquad-memory -mquad-memory-atomic}
The particular options set for any particular CPU varies between
@@ -19177,6 +19177,14 @@ Generate code that uses (does not use) the instructions to move data
between the general purpose registers and the vector/scalar (VSX)
registers that were added in version 2.07 of the PowerPC ISA.
+@item -mhtm
+@itemx -mno-htm
+@opindex mhtm
+@opindex mno-htm
+Enable (disable) the use of the built-in functions that allow direct
+access to the Hardware Transactional Memory (HTM) instructions that
+were added in version 2.07 of the PowerPC ISA.
+
@item -mpower8-fusion
@itemx -mno-power8-fusion
@opindex mpower8-fusion
diff --git a/gcc/doc/md.texi b/gcc/doc/md.texi
index d43f1cbc7b9..19d55674ce3 100644
--- a/gcc/doc/md.texi
+++ b/gcc/doc/md.texi
@@ -2444,7 +2444,7 @@ Integer constant in the range 0 @dots{} 127, for 128-bit shifts.
Standard 80387 floating point constant.
@item C
-Standard SSE floating point constant.
+SSE constant zero operand.
@item e
32-bit signed integer constant, or a symbolic reference known
diff --git a/gcc/doc/sourcebuild.texi b/gcc/doc/sourcebuild.texi
index 39152df272a..371ddf663bb 100644
--- a/gcc/doc/sourcebuild.texi
+++ b/gcc/doc/sourcebuild.texi
@@ -1782,6 +1782,9 @@ time) should be run on this target. This can be enabled by setting the
Test system runs executables on a simulator (i.e. slowly) rather than
hardware (i.e. fast).
+@item stabs
+Target supports the stabs debugging format.
+
@item stdint_types
Target has the basic signed and unsigned C types in @code{stdint.h}.
This will be obsolete when GCC ensures a working @code{stdint.h} for
diff --git a/gcc/dse.c b/gcc/dse.c
index 878fedcec3b..2aa5af0d5ca 100644
--- a/gcc/dse.c
+++ b/gcc/dse.c
@@ -1545,14 +1545,9 @@ record_store (rtx body, bb_info_t bb_info)
mem_addr = base->val_rtx;
else
{
- group_info_t group
- = rtx_group_vec[group_id];
+ group_info_t group = rtx_group_vec[group_id];
mem_addr = group->canon_base_addr;
}
- /* get_addr can only handle VALUE but cannot handle expr like:
- VALUE + OFFSET, so call get_addr to get original addr for
- mem_addr before plus_constant. */
- mem_addr = get_addr (mem_addr);
if (offset)
mem_addr = plus_constant (get_address_mode (mem), mem_addr, offset);
}
@@ -1644,10 +1639,9 @@ record_store (rtx body, bb_info_t bb_info)
the value of store_info. If it is, set the rhs to NULL to
keep it from being used to remove a load. */
{
- if (canon_true_dependence (s_info->mem,
- GET_MODE (s_info->mem),
- s_info->mem_addr,
- mem, mem_addr))
+ if (canon_output_dependence (s_info->mem, true,
+ mem, GET_MODE (mem),
+ mem_addr))
{
s_info->rhs = NULL;
s_info->const_rhs = NULL;
@@ -2166,14 +2160,9 @@ check_mem_read_rtx (rtx *loc, void *data)
mem_addr = base->val_rtx;
else
{
- group_info_t group
- = rtx_group_vec[group_id];
+ group_info_t group = rtx_group_vec[group_id];
mem_addr = group->canon_base_addr;
}
- /* get_addr can only handle VALUE but cannot handle expr like:
- VALUE + OFFSET, so call get_addr to get original addr for
- mem_addr before plus_constant. */
- mem_addr = get_addr (mem_addr);
if (offset)
mem_addr = plus_constant (get_address_mode (mem), mem_addr, offset);
}
@@ -2593,6 +2582,8 @@ scan_insn (bb_info_t bb_info, rtx insn)
active_local_stores = insn_info;
}
}
+ else
+ clear_rhs_from_active_local_stores ();
}
}
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index 6b4e83ad566..f3226b62b46 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -15817,7 +15817,7 @@ native_encode_initializer (tree init, unsigned char *array, int size)
fieldsize = tree_to_shwi (DECL_SIZE_UNIT (field));
pos = int_byte_position (field);
gcc_assert (pos + fieldsize <= size);
- if (val
+ if (val && fieldsize != 0
&& !native_encode_initializer (val, array + pos, fieldsize))
return false;
}
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index 1021ab032bb..ffa3f78c0e8 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -1931,7 +1931,6 @@ fold_convertible_p (const_tree type, const_tree arg)
case REAL_TYPE:
case FIXED_POINT_TYPE:
- case COMPLEX_TYPE:
case VECTOR_TYPE:
case VOID_TYPE:
return TREE_CODE (type) == TREE_CODE (orig);
@@ -12744,11 +12743,15 @@ fold_binary_loc (location_t loc,
|| TREE_CODE (arg0) == BIT_IOR_EXPR
|| TREE_CODE (arg0) == BIT_XOR_EXPR)
&& TREE_CODE (TREE_OPERAND (arg0, 1)) == INTEGER_CST)
- return fold_build2_loc (loc, TREE_CODE (arg0), type,
- fold_build2_loc (loc, code, type,
- TREE_OPERAND (arg0, 0), arg1),
- fold_build2_loc (loc, code, type,
- TREE_OPERAND (arg0, 1), arg1));
+ {
+ tree arg00 = fold_convert_loc (loc, type, TREE_OPERAND (arg0, 0));
+ tree arg01 = fold_convert_loc (loc, type, TREE_OPERAND (arg0, 1));
+ return fold_build2_loc (loc, TREE_CODE (arg0), type,
+ fold_build2_loc (loc, code, type,
+ arg00, arg1),
+ fold_build2_loc (loc, code, type,
+ arg01, arg1));
+ }
/* Two consecutive rotates adding up to the precision of the
type can be ignored. */
@@ -12760,7 +12763,7 @@ fold_binary_loc (location_t loc,
&& ((TREE_INT_CST_LOW (arg1)
+ TREE_INT_CST_LOW (TREE_OPERAND (arg0, 1)))
== prec))
- return TREE_OPERAND (arg0, 0);
+ return fold_convert_loc (loc, type, TREE_OPERAND (arg0, 0));
/* Fold (X & C2) << C1 into (X << C1) & (C2 << C1)
(X & C2) >> C1 into (X >> C1) & (C2 >> C1)
@@ -16736,17 +16739,20 @@ fold_indirect_ref_1 (location_t loc, tree type, tree op0)
if (TREE_CODE (op00type) == VECTOR_TYPE
&& type == TREE_TYPE (op00type))
{
- HOST_WIDE_INT offset = tree_to_shwi (op01);
tree part_width = TYPE_SIZE (type);
- unsigned HOST_WIDE_INT part_widthi = tree_to_shwi (part_width)/BITS_PER_UNIT;
- unsigned HOST_WIDE_INT indexi = offset * BITS_PER_UNIT;
- tree index = bitsize_int (indexi);
-
- if (offset / part_widthi < TYPE_VECTOR_SUBPARTS (op00type))
- return fold_build3_loc (loc,
- BIT_FIELD_REF, type, op00,
- part_width, index);
-
+ unsigned HOST_WIDE_INT max_offset
+ = (tree_to_uhwi (part_width) / BITS_PER_UNIT
+ * TYPE_VECTOR_SUBPARTS (op00type));
+ if (tree_int_cst_sign_bit (op01) == 0
+ && compare_tree_int (op01, max_offset) == -1)
+ {
+ unsigned HOST_WIDE_INT offset = tree_to_uhwi (op01);
+ unsigned HOST_WIDE_INT indexi = offset * BITS_PER_UNIT;
+ tree index = bitsize_int (indexi);
+ return fold_build3_loc (loc,
+ BIT_FIELD_REF, type, op00,
+ part_width, index);
+ }
}
/* ((foo*)&complexfoo)[1] => __imag__ complexfoo */
else if (TREE_CODE (op00type) == COMPLEX_TYPE
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index 337bd32eaf8..ebed0e7d615 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,92 @@
+2016-08-03 Release Manager
+
+ * GCC 4.9.4 released.
+
+2016-07-15 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
+ Backport from trunk:
+ PR fortran/71764
+ * trans-expr.c (gfc_trans_structure_assign): Remove assert.
+
+2016-07-07 Jakub Jelinek <jakub@redhat.com>
+
+ Backported from mainline
+ 2016-07-01 Jakub Jelinek <jakub@redhat.com>
+
+ PR fortran/71717
+ * trans-openmp.c (gfc_omp_privatize_by_reference): Return false
+ for GFC_DECL_ASSOCIATE_VAR_P with POINTER_TYPE.
+
+ 2016-06-30 Jakub Jelinek <jakub@redhat.com>
+
+ PR fortran/71704
+ * parse.c (matchs, matcho): If spec_only, only gfc_match the keyword
+ and if successful, goto do_spec_only.
+ (matchds, matchdo): Define.
+ (decode_omp_directive): Add spec_only local var and set it.
+ Use matchds or matchdo macros instead of matchs or matcho
+ for declare target, declare simd, declare reduction and threadprivate
+ directives. Return ST_GET_FCN_CHARACTERISTICS if a non-declarative
+ directive could be matched.
+ (next_statement): For ST_GET_FCN_CHARACTERISTICS restore
+ gfc_current_locus from old_locus even if there is no label.
+
+ PR fortran/71705
+ * trans-openmp.c (gfc_trans_omp_clauses): Set TREE_ADDRESSABLE on
+ decls in to/from clauses.
+
+2016-05-26 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
+ Backport from trunk.
+ PR fortran/66461
+ * scanner.c (gfc_next_char_literal): Clear end_flag when adjusting
+ current locus back to old_locus.
+
+2016-02-28 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
+ Backported from mainline
+ PR fortran/61156
+ * scanner.c (add_path_to_list): If include path is not a directory,
+ issue a fatal error.
+
+2016-02-11 Jakub Jelinek <jakub@redhat.com>
+
+ Backported from mainline
+ 2016-01-08 Jakub Jelinek <jakub@redhat.com>
+
+ PR fortran/69128
+ * trans.h (OMPWS_SCALARIZER_BODY): Define.
+ (OMPWS_NOWAIT): Renumber.
+ * trans-stmt.c (gfc_trans_where_3): Only set OMPWS_SCALARIZER_WS
+ if OMPWS_SCALARIZER_BODY is not set already, and set also
+ OMPWS_SCALARIZER_BODY until the final loop creation.
+ * trans-expr.c (gfc_trans_assignment_1): Likewise.
+ * trans-openmp.c (gfc_trans_omp_workshare): Also clear
+ OMPWS_SCALARIZER_BODY.
+ * trans-array.c (gfc_trans_scalarized_loop_end): Don't create
+ OMP_FOR if OMPWS_SCALARIZER_BODY is set.
+
+2015-11-27 Andre Vehreschild <vehre@gcc.gnu.org>
+
+ PR fortran/68218
+ * trans-array.c (gfc_array_init_size): Add gfc_evaluate_now() when
+ array spec in allocate is a function call.
+
+2015-11-25 Paul Thomas <pault@gcc.gnu.org>
+
+ Backport from trunk.
+ PR fortran/68196
+ * class.c (has_finalizer_component): Prevent infinite recursion
+ through this function if the derived type and that of its
+ component are the same.
+ * trans-types.c (gfc_get_derived_type): Do the same for proc
+ pointers by ignoring the explicit interface for the component.
+
+ PR fortran/66465
+ * check.c (same_type_check): If either of the expressions is
+ BT_PROCEDURE, use the typespec from the symbol, rather than the
+ expression.
+
2013-10-19 Paul Thomas <pault@gcc.gnu.org>
Backport from trunk
diff --git a/gcc/fortran/check.c b/gcc/fortran/check.c
index b83d9da148d..07cacd048fc 100644
--- a/gcc/fortran/check.c
+++ b/gcc/fortran/check.c
@@ -399,7 +399,15 @@ less_than_bitsize2 (const char *arg1, gfc_expr *expr1, const char *arg2,
static bool
same_type_check (gfc_expr *e, int n, gfc_expr *f, int m)
{
- if (gfc_compare_types (&e->ts, &f->ts))
+ gfc_typespec *ets = &e->ts;
+ gfc_typespec *fts = &f->ts;
+
+ if (e->ts.type == BT_PROCEDURE && e->symtree->n.sym)
+ ets = &e->symtree->n.sym->ts;
+ if (f->ts.type == BT_PROCEDURE && f->symtree->n.sym)
+ fts = &f->symtree->n.sym->ts;
+
+ if (gfc_compare_types (ets, fts))
return true;
gfc_error ("'%s' argument of '%s' intrinsic at %L must be the same type "
diff --git a/gcc/fortran/class.c b/gcc/fortran/class.c
index f83a24bd1b0..32ddb6e34f7 100644
--- a/gcc/fortran/class.c
+++ b/gcc/fortran/class.c
@@ -840,7 +840,11 @@ has_finalizer_component (gfc_symbol *derived)
&& c->ts.u.derived->f2k_derived->finalizers)
return true;
+ /* Stop infinite recursion through this function by inhibiting
+ calls when the derived type and that of the component are
+ the same. */
if (c->ts.type == BT_DERIVED
+ && !gfc_compare_derived_types (derived, c->ts.u.derived)
&& !c->attr.pointer && !c->attr.allocatable
&& has_finalizer_component (c->ts.u.derived))
return true;
diff --git a/gcc/fortran/parse.c b/gcc/fortran/parse.c
index 3428b331e7c..e55477e07cc 100644
--- a/gcc/fortran/parse.c
+++ b/gcc/fortran/parse.c
@@ -559,9 +559,12 @@ decode_statement (void)
return ST_NONE;
}
-/* Like match, but set a flag simd_matched if keyword matched. */
+/* Like match, but set a flag simd_matched if keyword matched
+ and if spec_only, goto do_spec_only without actually matching. */
#define matchs(keyword, subr, st) \
do { \
+ if (spec_only && gfc_match (keyword) == MATCH_YES) \
+ goto do_spec_only; \
if (match_word_omp_simd (keyword, subr, &old_locus, \
&simd_matched) == MATCH_YES) \
return st; \
@@ -569,11 +572,36 @@ decode_statement (void)
undo_new_statement (); \
} while (0);
-/* Like match, but don't match anything if not -fopenmp. */
+/* Like match, but don't match anything if not -fopenmp
+ and if spec_only, goto do_spec_only without actually matching. */
#define matcho(keyword, subr, st) \
do { \
if (!gfc_option.gfc_flag_openmp) \
; \
+ else if (spec_only && gfc_match (keyword) == MATCH_YES) \
+ goto do_spec_only; \
+ else if (match_word (keyword, subr, &old_locus) \
+ == MATCH_YES) \
+ return st; \
+ else \
+ undo_new_statement (); \
+ } while (0);
+
+/* Like match, but set a flag simd_matched if keyword matched. */
+#define matchds(keyword, subr, st) \
+ do { \
+ if (match_word_omp_simd (keyword, subr, &old_locus, \
+ &simd_matched) == MATCH_YES) \
+ return st; \
+ else \
+ undo_new_statement (); \
+ } while (0);
+
+/* Like match, but don't match anything if not -fopenmp. */
+#define matchdo(keyword, subr, st) \
+ do { \
+ if (!gfc_option.gfc_flag_openmp) \
+ ; \
else if (match_word (keyword, subr, &old_locus) \
== MATCH_YES) \
return st; \
@@ -587,6 +615,7 @@ decode_omp_directive (void)
locus old_locus;
char c;
bool simd_matched = false;
+ bool spec_only = false;
gfc_enforce_clean_symbol_state ();
@@ -601,6 +630,10 @@ decode_omp_directive (void)
return ST_NONE;
}
+ if (gfc_current_state () == COMP_FUNCTION
+ && gfc_current_block ()->result->ts.kind == -1)
+ spec_only = true;
+
gfc_unset_implicit_pure (NULL);
old_locus = gfc_current_locus;
@@ -629,12 +662,12 @@ decode_omp_directive (void)
matcho ("critical", gfc_match_omp_critical, ST_OMP_CRITICAL);
break;
case 'd':
- matchs ("declare reduction", gfc_match_omp_declare_reduction,
- ST_OMP_DECLARE_REDUCTION);
- matchs ("declare simd", gfc_match_omp_declare_simd,
- ST_OMP_DECLARE_SIMD);
- matcho ("declare target", gfc_match_omp_declare_target,
- ST_OMP_DECLARE_TARGET);
+ matchds ("declare reduction", gfc_match_omp_declare_reduction,
+ ST_OMP_DECLARE_REDUCTION);
+ matchds ("declare simd", gfc_match_omp_declare_simd,
+ ST_OMP_DECLARE_SIMD);
+ matchdo ("declare target", gfc_match_omp_declare_target,
+ ST_OMP_DECLARE_TARGET);
matchs ("distribute parallel do simd",
gfc_match_omp_distribute_parallel_do_simd,
ST_OMP_DISTRIBUTE_PARALLEL_DO_SIMD);
@@ -754,8 +787,8 @@ decode_omp_directive (void)
matcho ("teams distribute", gfc_match_omp_teams_distribute,
ST_OMP_TEAMS_DISTRIBUTE);
matcho ("teams", gfc_match_omp_teams, ST_OMP_TEAMS);
- matcho ("threadprivate", gfc_match_omp_threadprivate,
- ST_OMP_THREADPRIVATE);
+ matchdo ("threadprivate", gfc_match_omp_threadprivate,
+ ST_OMP_THREADPRIVATE);
break;
case 'w':
matcho ("workshare", gfc_match_omp_workshare, ST_OMP_WORKSHARE);
@@ -778,6 +811,13 @@ decode_omp_directive (void)
gfc_error_recovery ();
return ST_NONE;
+
+ do_spec_only:
+ reject_statement ();
+ gfc_clear_error ();
+ gfc_buffer_error (false);
+ gfc_current_locus = old_locus;
+ return ST_GET_FCN_CHARACTERISTICS;
}
static gfc_statement
@@ -1126,10 +1166,13 @@ next_statement (void)
gfc_buffer_error (0);
- if (st == ST_GET_FCN_CHARACTERISTICS && gfc_statement_label != NULL)
+ if (st == ST_GET_FCN_CHARACTERISTICS)
{
- gfc_free_st_label (gfc_statement_label);
- gfc_statement_label = NULL;
+ if (gfc_statement_label != NULL)
+ {
+ gfc_free_st_label (gfc_statement_label);
+ gfc_statement_label = NULL;
+ }
gfc_current_locus = old_locus;
}
diff --git a/gcc/fortran/scanner.c b/gcc/fortran/scanner.c
index 8934924d876..1a6f4612b7c 100644
--- a/gcc/fortran/scanner.c
+++ b/gcc/fortran/scanner.c
@@ -336,7 +336,7 @@ add_path_to_list (gfc_directorylist **list, const char *path,
}
else if (!S_ISDIR (st.st_mode))
{
- gfc_warning_now ("\"%s\" is not a directory", path);
+ gfc_fatal_error ("\"%s\" is not a directory", path);
return;
}
@@ -1259,6 +1259,7 @@ restart:
not_continuation:
c = '\n';
gfc_current_locus = old_loc;
+ end_flag = 0;
done:
if (c == '\n')
diff --git a/gcc/fortran/simplify.c b/gcc/fortran/simplify.c
index 3106d798b01..07c22107a33 100644
--- a/gcc/fortran/simplify.c
+++ b/gcc/fortran/simplify.c
@@ -3692,8 +3692,12 @@ gfc_simplify_len (gfc_expr *e, gfc_expr *kind)
}
else if (e->expr_type == EXPR_VARIABLE && e->ts.type == BT_CHARACTER
&& e->symtree->n.sym
+ && e->symtree->n.sym->ts.type != BT_DERIVED
&& e->symtree->n.sym->assoc && e->symtree->n.sym->assoc->target
- && e->symtree->n.sym->assoc->target->ts.type == BT_DERIVED)
+ && e->symtree->n.sym->assoc->target->ts.type == BT_DERIVED
+ && e->symtree->n.sym->assoc->target->symtree->n.sym
+ && UNLIMITED_POLY (e->symtree->n.sym->assoc->target->symtree->n.sym))
+
/* The expression in assoc->target points to a ref to the _data component
of the unlimited polymorphic entity. To get the _len component the last
_data ref needs to be stripped and a ref to the _len component added. */
diff --git a/gcc/fortran/trans-array.c b/gcc/fortran/trans-array.c
index 877e37109a9..2d9fcee2888 100644
--- a/gcc/fortran/trans-array.c
+++ b/gcc/fortran/trans-array.c
@@ -3483,7 +3483,8 @@ gfc_trans_scalarized_loop_end (gfc_loopinfo * loop, int n,
tree init;
tree incr;
- if ((ompws_flags & (OMPWS_WORKSHARE_FLAG | OMPWS_SCALARIZER_WS))
+ if ((ompws_flags & (OMPWS_WORKSHARE_FLAG | OMPWS_SCALARIZER_WS
+ | OMPWS_SCALARIZER_BODY))
== (OMPWS_WORKSHARE_FLAG | OMPWS_SCALARIZER_WS)
&& n == loop->dimen - 1)
{
@@ -4976,6 +4977,8 @@ gfc_array_init_size (tree descriptor, int rank, int corank, tree * poffset,
gcc_assert (ubound);
gfc_conv_expr_type (&se, ubound, gfc_array_index_type);
gfc_add_block_to_block (pblock, &se.pre);
+ if (ubound->expr_type == EXPR_FUNCTION)
+ se.expr = gfc_evaluate_now (se.expr, pblock);
gfc_conv_descriptor_ubound_set (descriptor_block, descriptor,
gfc_rank_cst[n], se.expr);
diff --git a/gcc/fortran/trans-decl.c b/gcc/fortran/trans-decl.c
index 4b3e89b7910..331d4bc44a3 100644
--- a/gcc/fortran/trans-decl.c
+++ b/gcc/fortran/trans-decl.c
@@ -5778,7 +5778,7 @@ gfc_generate_function_code (gfc_namespace * ns)
function has already called cgraph_create_node, which also created
the cgraph node for this function. */
if (!has_coarray_vars || gfc_option.coarray != GFC_FCOARRAY_LIB)
- (void) cgraph_create_node (fndecl);
+ (void) cgraph_get_create_node (fndecl);
}
else
cgraph_finalize_function (fndecl, true);
diff --git a/gcc/fortran/trans-expr.c b/gcc/fortran/trans-expr.c
index b18ccd84644..a2857551c82 100644
--- a/gcc/fortran/trans-expr.c
+++ b/gcc/fortran/trans-expr.c
@@ -6184,7 +6184,6 @@ gfc_trans_structure_assign (tree dest, gfc_expr * expr)
{
gfc_se se, lse;
- gcc_assert (cm->backend_decl == NULL);
gfc_init_se (&se, NULL);
gfc_init_se (&lse, NULL);
gfc_conv_expr (&se, gfc_constructor_first (expr->value.constructor)->expr);
@@ -8024,6 +8023,7 @@ gfc_trans_assignment_1 (gfc_expr * expr1, gfc_expr * expr2, bool init_flag,
bool scalar_to_array;
tree string_length;
int n;
+ bool maybe_workshare = false;
/* Assignment of the form lhs = rhs. */
gfc_start_block (&block);
@@ -8092,8 +8092,13 @@ gfc_trans_assignment_1 (gfc_expr * expr1, gfc_expr * expr2, bool init_flag,
}
/* Allow the scalarizer to workshare array assignments. */
- if ((ompws_flags & OMPWS_WORKSHARE_FLAG) && loop.temp_ss == NULL)
- ompws_flags |= OMPWS_SCALARIZER_WS;
+ if ((ompws_flags & (OMPWS_WORKSHARE_FLAG | OMPWS_SCALARIZER_BODY))
+ == OMPWS_WORKSHARE_FLAG
+ && loop.temp_ss == NULL)
+ {
+ maybe_workshare = true;
+ ompws_flags |= OMPWS_SCALARIZER_WS | OMPWS_SCALARIZER_BODY;
+ }
/* Start the scalarized loop body. */
gfc_start_scalarized_body (&loop, &body);
@@ -8208,6 +8213,9 @@ gfc_trans_assignment_1 (gfc_expr * expr1, gfc_expr * expr2, bool init_flag,
gfc_add_expr_to_block (&loop.code[expr1->rank - 1], tmp);
}
+ if (maybe_workshare)
+ ompws_flags &= ~OMPWS_SCALARIZER_BODY;
+
/* Generate the copying loops. */
gfc_trans_scalarizing_loops (&loop, &body);
diff --git a/gcc/fortran/trans-openmp.c b/gcc/fortran/trans-openmp.c
index e9f4894e5ea..ab8641bafe3 100644
--- a/gcc/fortran/trans-openmp.c
+++ b/gcc/fortran/trans-openmp.c
@@ -59,6 +59,7 @@ gfc_omp_privatize_by_reference (const_tree decl)
if (GFC_DECL_GET_SCALAR_POINTER (decl)
|| GFC_DECL_GET_SCALAR_ALLOCATABLE (decl)
|| GFC_DECL_CRAY_POINTEE (decl)
+ || GFC_DECL_ASSOCIATE_VAR_P (decl)
|| VOID_TYPE_P (TREE_TYPE (TREE_TYPE (decl))))
return false;
@@ -2114,6 +2115,8 @@ gfc_trans_omp_clauses (stmtblock_t *block, gfc_omp_clauses *clauses,
tree decl = gfc_get_symbol_decl (n->sym);
if (gfc_omp_privatize_by_reference (decl))
decl = build_fold_indirect_ref (decl);
+ else if (DECL_P (decl))
+ TREE_ADDRESSABLE (decl) = 1;
if (GFC_DESCRIPTOR_TYPE_P (TREE_TYPE (decl)))
{
tree type = TREE_TYPE (decl);
@@ -3903,7 +3906,7 @@ gfc_trans_omp_workshare (gfc_code *code, gfc_omp_clauses *clauses)
/* By default, every gfc_code is a single unit of work. */
ompws_flags |= OMPWS_CURR_SINGLEUNIT;
- ompws_flags &= ~OMPWS_SCALARIZER_WS;
+ ompws_flags &= ~(OMPWS_SCALARIZER_WS | OMPWS_SCALARIZER_BODY);
switch (code->op)
{
diff --git a/gcc/fortran/trans-stmt.c b/gcc/fortran/trans-stmt.c
index 508346df6b7..d1a9adbd24e 100644
--- a/gcc/fortran/trans-stmt.c
+++ b/gcc/fortran/trans-stmt.c
@@ -4693,10 +4693,15 @@ gfc_trans_where_3 (gfc_code * cblock, gfc_code * eblock)
gfc_loopinfo loop;
gfc_ss *edss = 0;
gfc_ss *esss = 0;
+ bool maybe_workshare = false;
/* Allow the scalarizer to workshare simple where loops. */
- if (ompws_flags & OMPWS_WORKSHARE_FLAG)
- ompws_flags |= OMPWS_SCALARIZER_WS;
+ if ((ompws_flags & (OMPWS_WORKSHARE_FLAG | OMPWS_SCALARIZER_BODY))
+ == OMPWS_WORKSHARE_FLAG)
+ {
+ maybe_workshare = true;
+ ompws_flags |= OMPWS_SCALARIZER_WS | OMPWS_SCALARIZER_BODY;
+ }
cond = cblock->expr1;
tdst = cblock->next->expr1;
@@ -4796,6 +4801,8 @@ gfc_trans_where_3 (gfc_code * cblock, gfc_code * eblock)
gfc_add_expr_to_block (&body, tmp);
gfc_add_block_to_block (&body, &cse.post);
+ if (maybe_workshare)
+ ompws_flags &= ~OMPWS_SCALARIZER_BODY;
gfc_trans_scalarizing_loops (&loop, &body);
gfc_add_block_to_block (&block, &loop.pre);
gfc_add_block_to_block (&block, &loop.post);
diff --git a/gcc/fortran/trans-types.c b/gcc/fortran/trans-types.c
index 20069e239cc..26db35fb8f5 100644
--- a/gcc/fortran/trans-types.c
+++ b/gcc/fortran/trans-types.c
@@ -2342,6 +2342,7 @@ gfc_get_derived_type (gfc_symbol * derived)
gfc_component *c;
gfc_dt_list *dt;
gfc_namespace *ns;
+ tree tmp;
if (derived->attr.unlimited_polymorphic)
return ptr_type_node;
@@ -2490,8 +2491,19 @@ gfc_get_derived_type (gfc_symbol * derived)
node as DECL_CONTEXT of each FIELD_DECL. */
for (c = derived->components; c; c = c->next)
{
- if (c->attr.proc_pointer)
+ /* Prevent infinite recursion, when the procedure pointer type is
+ the same as derived, by forcing the procedure pointer component to
+ be built as if the explicit interface does not exist. */
+ if (c->attr.proc_pointer
+ && ((c->ts.type != BT_DERIVED && c->ts.type != BT_CLASS)
+ || (c->ts.u.derived
+ && !gfc_compare_derived_types (derived, c->ts.u.derived))))
field_type = gfc_get_ppc_type (c);
+ else if (c->attr.proc_pointer && derived->backend_decl)
+ {
+ tmp = build_function_type_list (derived->backend_decl, NULL_TREE);
+ field_type = build_pointer_type (tmp);
+ }
else if (c->ts.type == BT_DERIVED || c->ts.type == BT_CLASS)
field_type = c->ts.u.derived->backend_decl;
else
diff --git a/gcc/fortran/trans.h b/gcc/fortran/trans.h
index fe2779a204e..ddc56f083cc 100644
--- a/gcc/fortran/trans.h
+++ b/gcc/fortran/trans.h
@@ -982,7 +982,9 @@ extern const char gfc_msg_wrong_return[];
construct is not workshared. */
#define OMPWS_SCALARIZER_WS 4 /* Set if scalarizer should attempt
to create parallel loops. */
-#define OMPWS_NOWAIT 8 /* Use NOWAIT on OMP_FOR. */
+#define OMPWS_SCALARIZER_BODY 8 /* Set if handling body of potential
+ parallel loop. */
+#define OMPWS_NOWAIT 16 /* Use NOWAIT on OMP_FOR. */
extern int ompws_flags;
#endif /* GFC_TRANS_H */
diff --git a/gcc/gcse.c b/gcc/gcse.c
index b852aa1bf22..e59151621ae 100644
--- a/gcc/gcse.c
+++ b/gcc/gcse.c
@@ -3958,10 +3958,8 @@ compute_ld_motion_mems (void)
{
rtx src = SET_SRC (PATTERN (insn));
rtx dest = SET_DEST (PATTERN (insn));
- rtx note = find_reg_equal_equiv_note (insn);
- rtx src_eq;
- /* Check for a simple LOAD... */
+ /* Check for a simple load. */
if (MEM_P (src) && simple_mem (src))
{
ptr = ldst_entry (src);
@@ -3976,12 +3974,11 @@ compute_ld_motion_mems (void)
invalidate_any_buried_refs (src);
}
- if (note != 0 && REG_NOTE_KIND (note) == REG_EQUAL)
- src_eq = XEXP (note, 0);
- else
- src_eq = NULL_RTX;
-
- if (src_eq != NULL_RTX
+ /* Check for a simple load through a REG_EQUAL note. */
+ rtx note = find_reg_equal_equiv_note (insn), src_eq;
+ if (note
+ && REG_NOTE_KIND (note) == REG_EQUAL
+ && (src_eq = XEXP (note, 0))
&& !(MEM_P (src_eq) && simple_mem (src_eq)))
invalidate_any_buried_refs (src_eq);
@@ -4004,7 +4001,17 @@ compute_ld_motion_mems (void)
}
}
else
- invalidate_any_buried_refs (PATTERN (insn));
+ {
+ /* Invalidate all MEMs in the pattern and... */
+ invalidate_any_buried_refs (PATTERN (insn));
+
+ /* ...in REG_EQUAL notes for PARALLELs with single SET. */
+ rtx note = find_reg_equal_equiv_note (insn), src_eq;
+ if (note
+ && REG_NOTE_KIND (note) == REG_EQUAL
+ && (src_eq = XEXP (note, 0)))
+ invalidate_any_buried_refs (src_eq);
+ }
}
}
}
diff --git a/gcc/gimple-expr.c b/gcc/gimple-expr.c
index da663d6fb79..8ee5fa4530d 100644
--- a/gcc/gimple-expr.c
+++ b/gcc/gimple-expr.c
@@ -374,6 +374,11 @@ copy_var_decl (tree var, tree name, tree type)
TREE_USED (copy) = 1;
DECL_SEEN_IN_BIND_EXPR_P (copy) = 1;
DECL_ATTRIBUTES (copy) = DECL_ATTRIBUTES (var);
+ if (DECL_USER_ALIGN (var))
+ {
+ DECL_ALIGN (copy) = DECL_ALIGN (var);
+ DECL_USER_ALIGN (copy) = 1;
+ }
return copy;
}
diff --git a/gcc/gimple-ssa-isolate-paths.c b/gcc/gimple-ssa-isolate-paths.c
index 56fcfc84258..cd4d59f7716 100644
--- a/gcc/gimple-ssa-isolate-paths.c
+++ b/gcc/gimple-ssa-isolate-paths.c
@@ -404,10 +404,10 @@ gimple_ssa_isolate_erroneous_paths (void)
/* We scramble the CFG and loop structures a bit, clean up
appropriately. We really should incrementally update the
loop structures, in theory it shouldn't be that hard. */
+ free_dominance_info (CDI_POST_DOMINATORS);
if (cfg_altered)
{
free_dominance_info (CDI_DOMINATORS);
- free_dominance_info (CDI_POST_DOMINATORS);
loops_state_set (LOOPS_NEED_FIXUP);
return TODO_cleanup_cfg | TODO_update_ssa;
}
diff --git a/gcc/gimple-ssa-strength-reduction.c b/gcc/gimple-ssa-strength-reduction.c
index cb19399bd3f..fc48a1bc9cc 100644
--- a/gcc/gimple-ssa-strength-reduction.c
+++ b/gcc/gimple-ssa-strength-reduction.c
@@ -2251,7 +2251,8 @@ create_phi_basis (slsr_cand_t c, gimple from_phi, tree basis_name,
slsr_cand_t basis = lookup_cand (c->basis);
int nargs = gimple_phi_num_args (from_phi);
basic_block phi_bb = gimple_bb (from_phi);
- slsr_cand_t phi_cand = base_cand_from_table (gimple_phi_result (from_phi));
+ slsr_cand_t phi_cand = *((slsr_cand_t *)
+ pointer_map_contains (stmt_cand_map, from_phi));
phi_args.create (nargs);
/* Process each argument of the existing phi that represents
@@ -2362,7 +2363,8 @@ phi_add_costs (gimple phi, slsr_cand_t c, int one_add_cost)
{
unsigned i;
int cost = 0;
- slsr_cand_t phi_cand = base_cand_from_table (gimple_phi_result (phi));
+ slsr_cand_t phi_cand = *((slsr_cand_t *)
+ pointer_map_contains (stmt_cand_map, phi));
/* If we work our way back to a phi that isn't dominated by the hidden
basis, this isn't a candidate for replacement. Indicate this by
@@ -2573,7 +2575,8 @@ static void
record_phi_increments (slsr_cand_t basis, gimple phi)
{
unsigned i;
- slsr_cand_t phi_cand = base_cand_from_table (gimple_phi_result (phi));
+ slsr_cand_t phi_cand = *((slsr_cand_t *)
+ pointer_map_contains (stmt_cand_map, phi));
for (i = 0; i < gimple_phi_num_args (phi); i++)
{
@@ -2644,7 +2647,8 @@ phi_incr_cost (slsr_cand_t c, double_int incr, gimple phi, int *savings)
unsigned i;
int cost = 0;
slsr_cand_t basis = lookup_cand (c->basis);
- slsr_cand_t phi_cand = base_cand_from_table (gimple_phi_result (phi));
+ slsr_cand_t phi_cand = *((slsr_cand_t *)
+ pointer_map_contains (stmt_cand_map, phi));
for (i = 0; i < gimple_phi_num_args (phi); i++)
{
@@ -2988,7 +2992,8 @@ ncd_with_phi (slsr_cand_t c, double_int incr, gimple phi,
{
unsigned i;
slsr_cand_t basis = lookup_cand (c->basis);
- slsr_cand_t phi_cand = base_cand_from_table (gimple_phi_result (phi));
+ slsr_cand_t phi_cand = *((slsr_cand_t *)
+ pointer_map_contains (stmt_cand_map, phi));
for (i = 0; i < gimple_phi_num_args (phi); i++)
{
@@ -3196,7 +3201,8 @@ all_phi_incrs_profitable (slsr_cand_t c, gimple phi)
{
unsigned i;
slsr_cand_t basis = lookup_cand (c->basis);
- slsr_cand_t phi_cand = base_cand_from_table (gimple_phi_result (phi));
+ slsr_cand_t phi_cand = *((slsr_cand_t *)
+ pointer_map_contains (stmt_cand_map, phi));
for (i = 0; i < gimple_phi_num_args (phi); i++)
{
diff --git a/gcc/gimple.c b/gcc/gimple.c
index 30d16530e39..67792372244 100644
--- a/gcc/gimple.c
+++ b/gcc/gimple.c
@@ -1854,6 +1854,11 @@ gimple_could_trap_p_1 (gimple s, bool include_mem, bool include_stores)
&& TYPE_OVERFLOW_TRAPS (t)),
div));
+ case GIMPLE_COND:
+ t = TREE_TYPE (gimple_cond_lhs (s));
+ return operation_could_trap_p (gimple_cond_code (s),
+ FLOAT_TYPE_P (t), false, NULL_TREE);
+
default:
break;
}
diff --git a/gcc/gimplify.c b/gcc/gimplify.c
index 89e7334e8cd..84d318bf19a 100644
--- a/gcc/gimplify.c
+++ b/gcc/gimplify.c
@@ -5062,12 +5062,38 @@ gimplify_asm_expr (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p)
TREE_VALUE (link) = error_mark_node;
tret = gimplify_expr (&TREE_VALUE (link), pre_p, post_p,
is_gimple_lvalue, fb_lvalue | fb_mayfail);
+ if (tret != GS_ERROR)
+ {
+ /* Unlike output operands, memory inputs are not guaranteed
+ to be lvalues by the FE, and while the expressions are
+ marked addressable there, if it is e.g. a statement
+ expression, temporaries in it might not end up being
+ addressable. They might be already used in the IL and thus
+ it is too late to make them addressable now though. */
+ tree x = TREE_VALUE (link);
+ while (handled_component_p (x))
+ x = TREE_OPERAND (x, 0);
+ if (TREE_CODE (x) == MEM_REF
+ && TREE_CODE (TREE_OPERAND (x, 0)) == ADDR_EXPR)
+ x = TREE_OPERAND (TREE_OPERAND (x, 0), 0);
+ if ((TREE_CODE (x) == VAR_DECL
+ || TREE_CODE (x) == PARM_DECL
+ || TREE_CODE (x) == RESULT_DECL)
+ && !TREE_ADDRESSABLE (x)
+ && is_gimple_reg (x))
+ {
+ warning_at (EXPR_LOC_OR_LOC (TREE_VALUE (link),
+ input_location), 0,
+ "memory input %d is not directly addressable",
+ i);
+ prepare_gimple_addressable (&TREE_VALUE (link), pre_p);
+ }
+ }
mark_addressable (TREE_VALUE (link));
if (tret == GS_ERROR)
{
- if (EXPR_HAS_LOCATION (TREE_VALUE (link)))
- input_location = EXPR_LOCATION (TREE_VALUE (link));
- error ("memory input %d is not directly addressable", i);
+ error_at (EXPR_LOC_OR_LOC (TREE_VALUE (link), input_location),
+ "memory input %d is not directly addressable", i);
ret = tret;
}
}
diff --git a/gcc/go/ChangeLog b/gcc/go/ChangeLog
index ea93012d419..ea09a2b18e5 100644
--- a/gcc/go/ChangeLog
+++ b/gcc/go/ChangeLog
@@ -1,3 +1,7 @@
+2016-08-03 Release Manager
+
+ * GCC 4.9.4 released.
+
2015-06-26 Release Manager
* GCC 4.9.3 released.
diff --git a/gcc/go/gofrontend/expressions.cc b/gcc/go/gofrontend/expressions.cc
index b0b8e39e96e..011f441f245 100644
--- a/gcc/go/gofrontend/expressions.cc
+++ b/gcc/go/gofrontend/expressions.cc
@@ -9136,6 +9136,16 @@ Builtin_call_expression::do_export(Export* exp) const
int
Call_expression::do_traverse(Traverse* traverse)
{
+ // If we are calling a function in a different package that returns
+ // an unnamed type, this may be the only chance we get to traverse
+ // that type. We don't traverse this->type_ because it may be a
+ // Call_multiple_result_type that will just lead back here.
+ if (this->type_ != NULL && !this->type_->is_error_type())
+ {
+ Function_type *fntype = this->get_function_type();
+ if (fntype != NULL && Type::traverse(fntype, traverse) == TRAVERSE_EXIT)
+ return TRAVERSE_EXIT;
+ }
if (Expression::traverse(&this->fn_, traverse) == TRAVERSE_EXIT)
return TRAVERSE_EXIT;
if (this->args_ != NULL)
diff --git a/gcc/graphite-blocking.c b/gcc/graphite-blocking.c
index 20a24eb2cf3..27742ccdbe8 100644
--- a/gcc/graphite-blocking.c
+++ b/gcc/graphite-blocking.c
@@ -24,6 +24,7 @@ along with GCC; see the file COPYING3. If not see
#include "config.h"
#ifdef HAVE_cloog
+#include <isl/constraint.h>
#include <isl/set.h>
#include <isl/map.h>
#include <isl/union_map.h>
diff --git a/gcc/graphite-dependences.c b/gcc/graphite-dependences.c
index b0f868077ae..9308c279670 100644
--- a/gcc/graphite-dependences.c
+++ b/gcc/graphite-dependences.c
@@ -22,6 +22,7 @@ along with GCC; see the file COPYING3. If not see
#include "config.h"
#ifdef HAVE_cloog
+#include <isl/constraint.h>
#include <isl/set.h>
#include <isl/map.h>
#include <isl/union_map.h>
@@ -183,7 +184,7 @@ scop_get_transformed_schedule (scop_p scop, vec<poly_bb_p> pbbs)
/* Helper function used on each MAP of a isl_union_map. Computes the
maximal output dimension. */
-static int
+static isl_stat
max_number_of_out_dimensions (__isl_take isl_map *map, void *user)
{
int global_max = *((int *) user);
@@ -195,7 +196,7 @@ max_number_of_out_dimensions (__isl_take isl_map *map, void *user)
isl_map_free (map);
isl_space_free (space);
- return 0;
+ return isl_stat_ok;
}
/* Extends the output dimension of MAP to MAX dimensions. */
@@ -219,12 +220,12 @@ struct extend_schedule_str {
/* Helper function for extend_schedule. */
-static int
+static isl_stat
extend_schedule_1 (__isl_take isl_map *map, void *user)
{
struct extend_schedule_str *str = (struct extend_schedule_str *) user;
str->umap = isl_union_map_add_map (str->umap, extend_map (map, str->max));
- return 0;
+ return isl_stat_ok;
}
/* Return a relation that has uniform output dimensions. */
@@ -233,16 +234,16 @@ __isl_give isl_union_map *
extend_schedule (__isl_take isl_union_map *x)
{
int max = 0;
- int res;
+ isl_stat res;
struct extend_schedule_str str;
res = isl_union_map_foreach_map (x, max_number_of_out_dimensions, (void *) &max);
- gcc_assert (res == 0);
+ gcc_assert (res == isl_stat_ok);
str.max = max;
str.umap = isl_union_map_empty (isl_union_map_get_space (x));
res = isl_union_map_foreach_map (x, extend_schedule_1, (void *) &str);
- gcc_assert (res == 0);
+ gcc_assert (res == isl_stat_ok);
isl_union_map_free (x);
return str.umap;
diff --git a/gcc/graphite-interchange.c b/gcc/graphite-interchange.c
index 2e625c127ba..a4def578df2 100644
--- a/gcc/graphite-interchange.c
+++ b/gcc/graphite-interchange.c
@@ -24,6 +24,7 @@ along with GCC; see the file COPYING3. If not see
#include "config.h"
#ifdef HAVE_cloog
+#include <isl/constraint.h>
#include <isl/aff.h>
#include <isl/set.h>
#include <isl/map.h>
diff --git a/gcc/graphite-optimize-isl.c b/gcc/graphite-optimize-isl.c
index fc12eebbf10..82a65691d9e 100644
--- a/gcc/graphite-optimize-isl.c
+++ b/gcc/graphite-optimize-isl.c
@@ -21,7 +21,9 @@ along with GCC; see the file COPYING3. If not see
#include "config.h"
#ifdef HAVE_cloog
+#include <isl/constraint.h>
#include <isl/set.h>
+#include <isl/union_set.h>
#include <isl/map.h>
#include <isl/union_map.h>
#include <isl/schedule.h>
@@ -415,13 +417,13 @@ getScheduleMap (isl_schedule *Schedule)
return ScheduleMap;
}
-static int
+static isl_stat
getSingleMap (__isl_take isl_map *map, void *user)
{
isl_map **singleMap = (isl_map **) user;
*singleMap = map;
- return 0;
+ return isl_stat_ok;
}
static void
@@ -469,7 +471,11 @@ optimize_isl (scop_p scop)
isl_options_set_schedule_max_constant_term (scop->ctx, CONSTANT_BOUND);
isl_options_set_schedule_maximize_band_depth (scop->ctx, 1);
+#ifdef HAVE_ISL_OPTIONS_SET_SCHEDULE_SERIALIZE_SCCS
+ isl_options_set_schedule_serialize_sccs (scop->ctx, 1);
+#else
isl_options_set_schedule_fuse (scop->ctx, ISL_SCHEDULE_FUSE_MIN);
+#endif
isl_options_set_on_error (scop->ctx, ISL_ON_ERROR_CONTINUE);
schedule = isl_union_set_compute_schedule (domain, validity, proximity);
isl_options_set_on_error (scop->ctx, ISL_ON_ERROR_ABORT);
diff --git a/gcc/graphite-poly.c b/gcc/graphite-poly.c
index fccc2ec6de5..c7b6e22c315 100644
--- a/gcc/graphite-poly.c
+++ b/gcc/graphite-poly.c
@@ -22,6 +22,7 @@ along with GCC; see the file COPYING3. If not see
#include "config.h"
#ifdef HAVE_cloog
+#include <isl/constraint.h>
#include <isl/set.h>
#include <isl/map.h>
#include <isl/union_map.h>
diff --git a/gcc/graphite-poly.h b/gcc/graphite-poly.h
index 06d320eea49..c75200e1d58 100644
--- a/gcc/graphite-poly.h
+++ b/gcc/graphite-poly.h
@@ -22,6 +22,11 @@ along with GCC; see the file COPYING3. If not see
#ifndef GCC_GRAPHITE_POLY_H
#define GCC_GRAPHITE_POLY_H
+#ifndef HAVE_ISL_OPTIONS_SET_SCHEDULE_SERIALIZE_SCCS
+# define isl_stat int
+# define isl_stat_ok 0
+#endif
+
typedef struct poly_dr *poly_dr_p;
typedef struct poly_bb *poly_bb_p;
diff --git a/gcc/graphite-scop-detection.c b/gcc/graphite-scop-detection.c
index 635e21a8519..b68d15deaab 100644
--- a/gcc/graphite-scop-detection.c
+++ b/gcc/graphite-scop-detection.c
@@ -22,6 +22,7 @@ along with GCC; see the file COPYING3. If not see
#include "config.h"
#ifdef HAVE_cloog
+#include <isl/constraint.h>
#include <isl/set.h>
#include <isl/map.h>
#include <isl/union_map.h>
diff --git a/gcc/graphite-sese-to-poly.c b/gcc/graphite-sese-to-poly.c
index 7adf2a9d1b5..c3f75847204 100644
--- a/gcc/graphite-sese-to-poly.c
+++ b/gcc/graphite-sese-to-poly.c
@@ -21,6 +21,7 @@ along with GCC; see the file COPYING3. If not see
#include "config.h"
#ifdef HAVE_cloog
+#include <isl/constraint.h>
#include <isl/set.h>
#include <isl/map.h>
#include <isl/union_map.h>
diff --git a/gcc/graphite.c b/gcc/graphite.c
index 311b7e36152..52182a55a03 100644
--- a/gcc/graphite.c
+++ b/gcc/graphite.c
@@ -35,6 +35,7 @@ along with GCC; see the file COPYING3. If not see
#include "config.h"
#ifdef HAVE_cloog
+#include <isl/constraint.h>
#include <isl/set.h>
#include <isl/map.h>
#include <isl/options.h>
diff --git a/gcc/haifa-sched.c b/gcc/haifa-sched.c
index 73d915ff261..73c8c8ab23c 100644
--- a/gcc/haifa-sched.c
+++ b/gcc/haifa-sched.c
@@ -6220,7 +6220,15 @@ prune_ready_list (state_t temp_state, bool first_cycle_insn_p,
if (SCHED_GROUP_P (insn) && cost > min_cost_group)
min_cost_group = cost;
ready_remove (&ready, i);
- queue_insn (insn, cost, reason);
+ /* Normally we'd want to queue INSN for COST cycles. However,
+ if SCHED_GROUP_P is set, then we must ensure that nothing
+ else comes between INSN and its predecessor. If there is
+ some other insn ready to fire on the next cycle, then that
+ invariant would be broken.
+
+ So when SCHED_GROUP_P is set, just queue this insn for a
+ single cycle. */
+ queue_insn (insn, SCHED_GROUP_P (insn) ? 1 : cost, reason);
if (i + 1 < n)
break;
}
diff --git a/gcc/hw-doloop.c b/gcc/hw-doloop.c
index cc8f9b77505..d18276103b4 100644
--- a/gcc/hw-doloop.c
+++ b/gcc/hw-doloop.c
@@ -636,7 +636,9 @@ reorg_loops (bool do_reorder, struct hw_doloop_hooks *hooks)
loops = discover_loops (&loop_stack, hooks);
- if (do_reorder)
+ /* We can't enter cfglayout mode anymore if basic block partitioning
+ already happened. */
+ if (do_reorder && !flag_reorder_blocks_and_partition)
{
reorder_loops (loops);
free_loops (loops);
diff --git a/gcc/ifcvt.c b/gcc/ifcvt.c
index 4fd46d254d1..482ad8c46df 100644
--- a/gcc/ifcvt.c
+++ b/gcc/ifcvt.c
@@ -2096,12 +2096,26 @@ noce_try_abs (struct noce_if_info *if_info)
/* Work around funny ideas get_condition has wrt canonicalization.
Note that these rtx constants are known to be CONST_INT, and
- therefore imply integer comparisons. */
+ therefore imply integer comparisons.
+ The one_cmpl case is more complicated, as we want to handle
+ only x < 0 ? ~x : x or x >= 0 ? x : ~x to one_cmpl_abs (x)
+ and x < 0 ? x : ~x or x >= 0 ? ~x : x to ~one_cmpl_abs (x),
+ but not other cases (x > -1 is equivalent of x >= 0). */
if (c == constm1_rtx && GET_CODE (cond) == GT)
;
else if (c == const1_rtx && GET_CODE (cond) == LT)
- ;
- else if (c != CONST0_RTX (GET_MODE (b)))
+ {
+ if (one_cmpl)
+ return FALSE;
+ }
+ else if (c == CONST0_RTX (GET_MODE (b)))
+ {
+ if (one_cmpl
+ && GET_CODE (cond) != GE
+ && GET_CODE (cond) != LT)
+ return FALSE;
+ }
+ else
return FALSE;
/* Determine what sort of operation this is. */
@@ -3753,8 +3767,11 @@ find_cond_trap (basic_block test_bb, edge then_edge, edge else_edge)
return FALSE;
/* If the conditional jump is more than just a conditional jump, then
- we can not do if-conversion on this block. */
- if (! onlyjump_p (jump))
+ we can not do if-conversion on this block. Give up for returnjump_p,
+ changing a conditional return followed by unconditional trap for
+ conditional trap followed by unconditional return is likely not
+ beneficial and harder to handle. */
+ if (! onlyjump_p (jump) || returnjump_p (jump))
return FALSE;
/* We must be comparing objects whose modes imply the size. */
diff --git a/gcc/ipa-cp.c b/gcc/ipa-cp.c
index a6818ba8da1..5ea4f9b9b51 100644
--- a/gcc/ipa-cp.c
+++ b/gcc/ipa-cp.c
@@ -1411,6 +1411,18 @@ propagate_aggs_accross_jump_function (struct cgraph_edge *cs,
return ret;
}
+/* Return true if on the way cfrom CS->caller to the final (non-alias and
+ non-thunk) destination, the call passes through a thunk. */
+
+static bool
+call_passes_through_thunk_p (struct cgraph_edge *cs)
+{
+ struct cgraph_node *alias_or_thunk = cs->callee;
+ while (alias_or_thunk->alias)
+ alias_or_thunk = cgraph_alias_target (alias_or_thunk);
+ return alias_or_thunk->thunk.thunk_p;
+}
+
/* Propagate constants from the caller to the callee of CS. INFO describes the
caller. */
@@ -1419,7 +1431,7 @@ propagate_constants_accross_call (struct cgraph_edge *cs)
{
struct ipa_node_params *callee_info;
enum availability availability;
- struct cgraph_node *callee, *alias_or_thunk;
+ struct cgraph_node *callee;
struct ipa_edge_args *args;
bool ret = false;
int i, args_count, parms_count;
@@ -1439,10 +1451,7 @@ propagate_constants_accross_call (struct cgraph_edge *cs)
/* If this call goes through a thunk we must not propagate to the first (0th)
parameter. However, we might need to uncover a thunk from below a series
of aliases first. */
- alias_or_thunk = cs->callee;
- while (alias_or_thunk->alias)
- alias_or_thunk = cgraph_alias_target (alias_or_thunk);
- if (alias_or_thunk->thunk.thunk_p)
+ if (call_passes_through_thunk_p (cs))
{
ret |= set_all_contains_variable (ipa_get_parm_lattices (callee_info,
0));
@@ -2837,7 +2846,9 @@ find_more_scalar_values_for_callers_subset (struct cgraph_node *node,
struct ipa_jump_func *jump_func;
tree t;
- if (i >= ipa_get_cs_argument_count (IPA_EDGE_REF (cs)))
+ if (i >= ipa_get_cs_argument_count (IPA_EDGE_REF (cs))
+ || (i == 0
+ && call_passes_through_thunk_p (cs)))
{
newval = NULL_TREE;
break;
diff --git a/gcc/ipa-inline-analysis.c b/gcc/ipa-inline-analysis.c
index 9e71f43e28d..47a381074f0 100644
--- a/gcc/ipa-inline-analysis.c
+++ b/gcc/ipa-inline-analysis.c
@@ -233,13 +233,14 @@ struct agg_position_info
bool by_ref;
};
-/* Add condition to condition list CONDS. AGGPOS describes whether the used
- oprand is loaded from an aggregate and where in the aggregate it is. It can
- be NULL, which means this not a load from an aggregate. */
+/* Add condition to condition list SUMMARY. OPERAND_NUM, SIZE, CODE and VAL
+ correspond to fields of condition structure. AGGPOS describes whether the
+ used operand is loaded from an aggregate and where in the aggregate it is.
+ It can be NULL, which means this not a load from an aggregate. */
static struct predicate
add_condition (struct inline_summary *summary, int operand_num,
- struct agg_position_info *aggpos,
+ HOST_WIDE_INT size, struct agg_position_info *aggpos,
enum tree_code code, tree val)
{
int i;
@@ -265,6 +266,7 @@ add_condition (struct inline_summary *summary, int operand_num,
for (i = 0; vec_safe_iterate (summary->conds, i, &c); i++)
{
if (c->operand_num == operand_num
+ && c->size == size
&& c->code == code
&& c->val == val
&& c->agg_contents == agg_contents
@@ -281,6 +283,7 @@ add_condition (struct inline_summary *summary, int operand_num,
new_cond.agg_contents = agg_contents;
new_cond.by_ref = by_ref;
new_cond.offset = offset;
+ new_cond.size = size;
vec_safe_push (summary->conds, new_cond);
return single_cond_predicate (i + predicate_first_dynamic_condition);
}
@@ -859,21 +862,25 @@ evaluate_conditions_for_known_args (struct cgraph_node *node,
clause |= 1 << (i + predicate_first_dynamic_condition);
continue;
}
- if (c->code == IS_NOT_CONSTANT || c->code == CHANGED)
+ if (c->code == CHANGED)
continue;
- if (operand_equal_p (TYPE_SIZE (TREE_TYPE (c->val)),
- TYPE_SIZE (TREE_TYPE (val)), 0))
+ if (tree_to_shwi (TYPE_SIZE (TREE_TYPE (val))) != c->size)
{
- val = fold_unary (VIEW_CONVERT_EXPR, TREE_TYPE (c->val), val);
+ clause |= 1 << (i + predicate_first_dynamic_condition);
+ continue;
+ }
+ if (c->code == IS_NOT_CONSTANT)
+ continue;
- res = val
- ? fold_binary_to_constant (c->code, boolean_type_node, val, c->val)
- : NULL;
+ val = fold_unary (VIEW_CONVERT_EXPR, TREE_TYPE (c->val), val);
+ res = val
+ ? fold_binary_to_constant (c->code, boolean_type_node, val, c->val)
+ : NULL;
+
+ if (res && integer_zerop (res))
+ continue;
- if (res && integer_zerop (res))
- continue;
- }
clause |= 1 << (i + predicate_first_dynamic_condition);
}
return clause;
@@ -1495,16 +1502,21 @@ mark_modified (ao_ref *ao ATTRIBUTE_UNUSED, tree vdef ATTRIBUTE_UNUSED,
}
/* If OP refers to value of function parameter, return the corresponding
- parameter. */
+ parameter. If non-NULL, the size of the memory load (or the SSA_NAME of the
+ PARM_DECL) will be stored to *SIZE_P in that case too. */
static tree
-unmodified_parm_1 (gimple stmt, tree op)
+unmodified_parm_1 (gimple stmt, tree op, HOST_WIDE_INT *size_p)
{
/* SSA_NAME referring to parm default def? */
if (TREE_CODE (op) == SSA_NAME
&& SSA_NAME_IS_DEFAULT_DEF (op)
&& TREE_CODE (SSA_NAME_VAR (op)) == PARM_DECL)
- return SSA_NAME_VAR (op);
+ {
+ if (size_p)
+ *size_p = tree_to_shwi (TYPE_SIZE (TREE_TYPE (op)));
+ return SSA_NAME_VAR (op);
+ }
/* Non-SSA parm reference? */
if (TREE_CODE (op) == PARM_DECL)
{
@@ -1515,18 +1527,24 @@ unmodified_parm_1 (gimple stmt, tree op)
walk_aliased_vdefs (&refd, gimple_vuse (stmt), mark_modified, &modified,
NULL);
if (!modified)
- return op;
+ {
+ if (size_p)
+ *size_p = tree_to_shwi (TYPE_SIZE (TREE_TYPE (op)));
+ return op;
+ }
}
return NULL_TREE;
}
/* If OP refers to value of function parameter, return the corresponding
- parameter. Also traverse chains of SSA register assignments. */
+ parameter. Also traverse chains of SSA register assignments. If non-NULL,
+ the size of the memory load (or the SSA_NAME of the PARM_DECL) will be
+ stored to *SIZE_P in that case too. */
static tree
-unmodified_parm (gimple stmt, tree op)
+unmodified_parm (gimple stmt, tree op, HOST_WIDE_INT *size_p)
{
- tree res = unmodified_parm_1 (stmt, op);
+ tree res = unmodified_parm_1 (stmt, op, size_p);
if (res)
return res;
@@ -1534,23 +1552,25 @@ unmodified_parm (gimple stmt, tree op)
&& !SSA_NAME_IS_DEFAULT_DEF (op)
&& gimple_assign_single_p (SSA_NAME_DEF_STMT (op)))
return unmodified_parm (SSA_NAME_DEF_STMT (op),
- gimple_assign_rhs1 (SSA_NAME_DEF_STMT (op)));
+ gimple_assign_rhs1 (SSA_NAME_DEF_STMT (op)),
+ size_p);
return NULL_TREE;
}
/* If OP refers to a value of a function parameter or value loaded from an
aggregate passed to a parameter (either by value or reference), return TRUE
- and store the number of the parameter to *INDEX_P and information whether
- and how it has been loaded from an aggregate into *AGGPOS. INFO describes
- the function parameters, STMT is the statement in which OP is used or
- loaded. */
+ and store the number of the parameter to *INDEX_P, the access size into
+ *SIZE_P, and information whether and how it has been loaded from an
+ aggregate into *AGGPOS. INFO describes the function parameters, STMT is the
+ statement in which OP is used or loaded. */
static bool
unmodified_parm_or_parm_agg_item (struct ipa_node_params *info,
gimple stmt, tree op, int *index_p,
+ HOST_WIDE_INT *size_p,
struct agg_position_info *aggpos)
{
- tree res = unmodified_parm_1 (stmt, op);
+ tree res = unmodified_parm_1 (stmt, op, size_p);
gcc_checking_assert (aggpos);
if (res)
@@ -1572,12 +1592,12 @@ unmodified_parm_or_parm_agg_item (struct ipa_node_params *info,
op = gimple_assign_rhs1 (stmt);
if (!REFERENCE_CLASS_P (op))
return unmodified_parm_or_parm_agg_item (info, stmt, op, index_p,
- aggpos);
+ size_p, aggpos);
}
aggpos->agg_contents = true;
return ipa_load_from_parm_agg (info, stmt, op, index_p, &aggpos->offset,
- &aggpos->by_ref);
+ size_p, &aggpos->by_ref);
}
/* See if statement might disappear after inlining.
@@ -1629,7 +1649,7 @@ eliminated_by_inlining_prob (gimple stmt)
inner_lhs = lhs;
/* Reads of parameter are expected to be free. */
- if (unmodified_parm (stmt, inner_rhs))
+ if (unmodified_parm (stmt, inner_rhs, NULL))
rhs_free = true;
/* Match expressions of form &this->field. Those will most likely
combine with something upstream after inlining. */
@@ -1639,7 +1659,7 @@ eliminated_by_inlining_prob (gimple stmt)
if (TREE_CODE (op) == PARM_DECL)
rhs_free = true;
else if (TREE_CODE (op) == MEM_REF
- && unmodified_parm (stmt, TREE_OPERAND (op, 0)))
+ && unmodified_parm (stmt, TREE_OPERAND (op, 0), NULL))
rhs_free = true;
}
@@ -1652,7 +1672,7 @@ eliminated_by_inlining_prob (gimple stmt)
/* Reads of parameters passed by reference
expected to be free (i.e. optimized out after inlining). */
if (TREE_CODE (inner_rhs) == MEM_REF
- && unmodified_parm (stmt, TREE_OPERAND (inner_rhs, 0)))
+ && unmodified_parm (stmt, TREE_OPERAND (inner_rhs, 0), NULL))
rhs_free = true;
/* Copying parameter passed by reference into gimple register is
@@ -1693,7 +1713,7 @@ eliminated_by_inlining_prob (gimple stmt)
if (TREE_CODE (inner_lhs) == PARM_DECL
|| TREE_CODE (inner_lhs) == RESULT_DECL
|| (TREE_CODE (inner_lhs) == MEM_REF
- && (unmodified_parm (stmt, TREE_OPERAND (inner_lhs, 0))
+ && (unmodified_parm (stmt, TREE_OPERAND (inner_lhs, 0), NULL)
|| (TREE_CODE (TREE_OPERAND (inner_lhs, 0)) == SSA_NAME
&& SSA_NAME_VAR (TREE_OPERAND (inner_lhs, 0))
&& TREE_CODE (SSA_NAME_VAR (TREE_OPERAND
@@ -1723,6 +1743,7 @@ set_cond_stmt_execution_predicate (struct ipa_node_params *info,
{
gimple last;
tree op;
+ HOST_WIDE_INT size;
int index;
struct agg_position_info aggpos;
enum tree_code code, inverted_code;
@@ -1740,7 +1761,7 @@ set_cond_stmt_execution_predicate (struct ipa_node_params *info,
/* TODO: handle conditionals like
var = op0 < 4;
if (var != 0). */
- if (unmodified_parm_or_parm_agg_item (info, last, op, &index, &aggpos))
+ if (unmodified_parm_or_parm_agg_item (info, last, op, &index, &size, &aggpos))
{
code = gimple_cond_code (last);
inverted_code
@@ -1756,7 +1777,7 @@ set_cond_stmt_execution_predicate (struct ipa_node_params *info,
unordered one. Be sure it is not confused with NON_CONSTANT. */
if (this_code != ERROR_MARK)
{
- struct predicate p = add_condition (summary, index, &aggpos,
+ struct predicate p = add_condition (summary, index, size, &aggpos,
this_code,
gimple_cond_rhs (last));
e->aux = pool_alloc (edge_predicate_pool);
@@ -1786,11 +1807,11 @@ set_cond_stmt_execution_predicate (struct ipa_node_params *info,
return;
op2 = gimple_call_arg (set_stmt, 0);
if (!unmodified_parm_or_parm_agg_item
- (info, set_stmt, op2, &index, &aggpos))
+ (info, set_stmt, op2, &index, &size, &aggpos))
return;
FOR_EACH_EDGE (e, ei, bb->succs) if (e->flags & EDGE_FALSE_VALUE)
{
- struct predicate p = add_condition (summary, index, &aggpos,
+ struct predicate p = add_condition (summary, index, size, &aggpos,
IS_NOT_CONSTANT, NULL_TREE);
e->aux = pool_alloc (edge_predicate_pool);
*(struct predicate *) e->aux = p;
@@ -1809,6 +1830,7 @@ set_switch_stmt_execution_predicate (struct ipa_node_params *info,
gimple last;
tree op;
int index;
+ HOST_WIDE_INT size;
struct agg_position_info aggpos;
edge e;
edge_iterator ei;
@@ -1819,7 +1841,7 @@ set_switch_stmt_execution_predicate (struct ipa_node_params *info,
if (!last || gimple_code (last) != GIMPLE_SWITCH)
return;
op = gimple_switch_index (last);
- if (!unmodified_parm_or_parm_agg_item (info, last, op, &index, &aggpos))
+ if (!unmodified_parm_or_parm_agg_item (info, last, op, &index, &size, &aggpos))
return;
FOR_EACH_EDGE (e, ei, bb->succs)
@@ -1844,12 +1866,12 @@ set_switch_stmt_execution_predicate (struct ipa_node_params *info,
if (!min && !max)
p = true_predicate ();
else if (!max)
- p = add_condition (summary, index, &aggpos, EQ_EXPR, min);
+ p = add_condition (summary, index, size, &aggpos, EQ_EXPR, min);
else
{
struct predicate p1, p2;
- p1 = add_condition (summary, index, &aggpos, GE_EXPR, min);
- p2 = add_condition (summary, index, &aggpos, LE_EXPR, max);
+ p1 = add_condition (summary, index, size, &aggpos, GE_EXPR, min);
+ p2 = add_condition (summary, index, size, &aggpos, LE_EXPR, max);
p = and_predicates (summary->conds, &p1, &p2);
}
*(struct predicate *) e->aux
@@ -1949,13 +1971,14 @@ will_be_nonconstant_expr_predicate (struct ipa_node_params *info,
{
tree parm;
int index;
+ HOST_WIDE_INT size;
while (UNARY_CLASS_P (expr))
expr = TREE_OPERAND (expr, 0);
- parm = unmodified_parm (NULL, expr);
+ parm = unmodified_parm (NULL, expr, &size);
if (parm && (index = ipa_get_param_decl_index (info, parm)) >= 0)
- return add_condition (summary, index, NULL, CHANGED, NULL_TREE);
+ return add_condition (summary, index, size, NULL, CHANGED, NULL_TREE);
if (is_gimple_min_invariant (expr))
return false_predicate ();
if (TREE_CODE (expr) == SSA_NAME)
@@ -2016,6 +2039,7 @@ will_be_nonconstant_predicate (struct ipa_node_params *info,
struct predicate op_non_const;
bool is_load;
int base_index;
+ HOST_WIDE_INT size;
struct agg_position_info aggpos;
/* What statments might be optimized away
@@ -2039,7 +2063,7 @@ will_be_nonconstant_predicate (struct ipa_node_params *info,
tree op;
gcc_assert (gimple_assign_single_p (stmt));
op = gimple_assign_rhs1 (stmt);
- if (!unmodified_parm_or_parm_agg_item (info, stmt, op, &base_index,
+ if (!unmodified_parm_or_parm_agg_item (info, stmt, op, &base_index, &size,
&aggpos))
return p;
}
@@ -2050,7 +2074,7 @@ will_be_nonconstant_predicate (struct ipa_node_params *info,
adding conditionals. */
FOR_EACH_SSA_TREE_OPERAND (use, stmt, iter, SSA_OP_USE)
{
- tree parm = unmodified_parm (stmt, use);
+ tree parm = unmodified_parm (stmt, use, NULL);
/* For arguments we can build a condition. */
if (parm && ipa_get_param_decl_index (info, parm) >= 0)
continue;
@@ -2065,18 +2089,18 @@ will_be_nonconstant_predicate (struct ipa_node_params *info,
if (is_load)
op_non_const =
- add_condition (summary, base_index, &aggpos, CHANGED, NULL);
+ add_condition (summary, base_index, size, &aggpos, CHANGED, NULL);
else
op_non_const = false_predicate ();
FOR_EACH_SSA_TREE_OPERAND (use, stmt, iter, SSA_OP_USE)
{
- tree parm = unmodified_parm (stmt, use);
+ tree parm = unmodified_parm (stmt, use, &size);
int index;
if (parm && (index = ipa_get_param_decl_index (info, parm)) >= 0)
{
if (index != base_index)
- p = add_condition (summary, index, NULL, CHANGED, NULL_TREE);
+ p = add_condition (summary, index, size, NULL, CHANGED, NULL_TREE);
else
continue;
}
@@ -3300,7 +3324,8 @@ remap_predicate (struct inline_summary *info,
ap.by_ref = c->by_ref;
cond_predicate = add_condition (info,
operand_map[c->operand_num],
- &ap, c->code, c->val);
+ c->size, &ap, c->code,
+ c->val);
}
}
/* Fixed conditions remains same, construct single
@@ -4119,6 +4144,7 @@ inline_read_section (struct lto_file_decl_data *file_data, const char *data,
{
struct condition c;
c.operand_num = streamer_read_uhwi (&ib);
+ c.size = streamer_read_uhwi (&ib);
c.code = (enum tree_code) streamer_read_uhwi (&ib);
c.val = stream_read_tree (&ib, data_in);
bp = streamer_read_bitpack (&ib);
@@ -4280,6 +4306,7 @@ inline_write_summary (void)
for (i = 0; vec_safe_iterate (info->conds, i, &c); i++)
{
streamer_write_uhwi (ob, c->operand_num);
+ streamer_write_uhwi (ob, c->size);
streamer_write_uhwi (ob, c->code);
stream_write_tree (ob, c->val, true);
bp = bitpack_create (ob->main_stream);
diff --git a/gcc/ipa-inline.h b/gcc/ipa-inline.h
index 7860dec2fa4..110ed4f94d8 100644
--- a/gcc/ipa-inline.h
+++ b/gcc/ipa-inline.h
@@ -32,6 +32,8 @@ struct GTY(()) condition
/* If agg_contents is set, this is the offset from which the used data was
loaded. */
HOST_WIDE_INT offset;
+ /* Size of the access reading the data (or the PARM_DECL SSA_NAME). */
+ HOST_WIDE_INT size;
tree val;
int operand_num;
ENUM_BITFIELD(tree_code) code : 16;
diff --git a/gcc/ipa-prop.c b/gcc/ipa-prop.c
index c3890f74bfb..16afa2a610c 100644
--- a/gcc/ipa-prop.c
+++ b/gcc/ipa-prop.c
@@ -971,10 +971,10 @@ ipa_load_from_parm_agg_1 (vec<ipa_param_descriptor> descriptors,
bool
ipa_load_from_parm_agg (struct ipa_node_params *info, gimple stmt,
tree op, int *index_p, HOST_WIDE_INT *offset_p,
- bool *by_ref_p)
+ HOST_WIDE_INT *size_p, bool *by_ref_p)
{
return ipa_load_from_parm_agg_1 (info->descriptors, NULL, stmt, op, index_p,
- offset_p, NULL, by_ref_p);
+ offset_p, size_p, by_ref_p);
}
/* Given that an actual argument is an SSA_NAME (given in NAME) and is a result
@@ -1374,6 +1374,9 @@ determine_known_aggregate_parts (gimple call, tree arg, tree arg_type,
bool check_ref, by_ref;
ao_ref r;
+ if (PARAM_VALUE (PARAM_IPA_MAX_AGG_ITEMS) == 0)
+ return;
+
/* The function operates in three stages. First, we prepare check_ref, r,
arg_base and arg_offset based on what is actually passed as an actual
argument. */
diff --git a/gcc/ipa-prop.h b/gcc/ipa-prop.h
index 70185b2f4ac..5b3e8cd6e8f 100644
--- a/gcc/ipa-prop.h
+++ b/gcc/ipa-prop.h
@@ -594,7 +594,7 @@ void ipa_analyze_node (struct cgraph_node *);
tree ipa_find_agg_cst_for_param (struct ipa_agg_jump_function *, HOST_WIDE_INT,
bool);
bool ipa_load_from_parm_agg (struct ipa_node_params *, gimple, tree, int *,
- HOST_WIDE_INT *, bool *);
+ HOST_WIDE_INT *, HOST_WIDE_INT *, bool *);
/* Debugging interface. */
void ipa_print_node_params (FILE *, struct cgraph_node *node);
diff --git a/gcc/ira-build.c b/gcc/ira-build.c
index 643bbe9a08b..b13a87c5872 100644
--- a/gcc/ira-build.c
+++ b/gcc/ira-build.c
@@ -2277,7 +2277,7 @@ mark_loops_for_removal (void)
);
}
qsort (sorted_loops, n, sizeof (ira_loop_tree_node_t), loop_compare_func);
- for (i = 0; n - i + 1 > IRA_MAX_LOOPS_NUM; i++)
+ for (i = 0; i < n - IRA_MAX_LOOPS_NUM; i++)
{
sorted_loops[i]->to_remove_p = true;
if (internal_flag_ira_verbose > 1 && ira_dump_file != NULL)
diff --git a/gcc/ira.c b/gcc/ira.c
index fb0650e59ec..ca1bf38b9e6 100644
--- a/gcc/ira.c
+++ b/gcc/ira.c
@@ -2398,9 +2398,12 @@ ira_setup_eliminable_regset (void)
frame_pointer_needed
= (! flag_omit_frame_pointer
|| (cfun->calls_alloca && EXIT_IGNORE_STACK)
- /* We need the frame pointer to catch stack overflow exceptions
- if the stack pointer is moving. */
- || (flag_stack_check && STACK_CHECK_MOVING_SP)
+ /* We need the frame pointer to catch stack overflow exceptions if
+ the stack pointer is moving (as for the alloca case just above). */
+ || (STACK_CHECK_MOVING_SP
+ && flag_stack_check
+ && flag_exceptions
+ && cfun->can_throw_non_call_exceptions)
|| crtl->accesses_prior_frames
|| (SUPPORTS_STACK_ALIGNMENT && crtl->stack_realign_needed)
/* We need a frame pointer for all Cilk Plus functions that use
@@ -3434,9 +3437,6 @@ adjust_cleared_regs (rtx loc, const_rtx old_rtx ATTRIBUTE_UNUSED, void *data)
return NULL_RTX;
}
-/* Nonzero if we recorded an equivalence for a LABEL_REF. */
-static int recorded_label_ref;
-
/* Find registers that are equivalent to a single value throughout the
compilation (either because they can be referenced in memory or are
set once from a single constant). Lower their priority for a
@@ -3446,10 +3446,8 @@ static int recorded_label_ref;
value into the using insn. If it succeeds, we can eliminate the
register completely.
- Initialize init_insns in ira_reg_equiv array.
-
- Return non-zero if jump label rebuilding should be done. */
-static int
+ Initialize init_insns in ira_reg_equiv array. */
+static void
update_equiv_regs (void)
{
rtx insn;
@@ -3458,10 +3456,6 @@ update_equiv_regs (void)
bitmap cleared_regs;
bool *pdx_subregs;
- /* We need to keep track of whether or not we recorded a LABEL_REF so
- that we know if the jump optimizer needs to be rerun. */
- recorded_label_ref = 0;
-
/* Use pdx_subregs to show whether a reg is used in a paradoxical
subreg. */
pdx_subregs = XCNEWVEC (bool, max_regno);
@@ -3507,7 +3501,8 @@ update_equiv_regs (void)
/* If this insn contains more (or less) than a single SET,
only mark all destinations as having no known equivalence. */
- if (set == 0)
+ if (set == 0
+ || side_effects_p (SET_SRC (set)))
{
note_stores (PATTERN (insn), no_equiv, NULL);
continue;
@@ -3659,17 +3654,6 @@ update_equiv_regs (void)
= gen_rtx_INSN_LIST (VOIDmode, insn,
ira_reg_equiv[regno].init_insns);
- /* Record whether or not we created a REG_EQUIV note for a LABEL_REF.
- We might end up substituting the LABEL_REF for uses of the
- pseudo here or later. That kind of transformation may turn an
- indirect jump into a direct jump, in which case we must rerun the
- jump optimizer to ensure that the JUMP_LABEL fields are valid. */
- if (GET_CODE (x) == LABEL_REF
- || (GET_CODE (x) == CONST
- && GET_CODE (XEXP (x, 0)) == PLUS
- && (GET_CODE (XEXP (XEXP (x, 0), 0)) == LABEL_REF)))
- recorded_label_ref = 1;
-
reg_equiv[regno].replacement = x;
reg_equiv[regno].src_p = &SET_SRC (set);
reg_equiv[regno].loop_depth = loop_depth;
@@ -3786,9 +3770,9 @@ update_equiv_regs (void)
if (! INSN_P (insn))
continue;
- /* Don't substitute into a non-local goto, this confuses CFG. */
- if (JUMP_P (insn)
- && find_reg_note (insn, REG_NON_LOCAL_GOTO, NULL_RTX))
+ /* Don't substitute into jumps. indirect_jump_optimize does
+ this for anything we are prepared to handle. */
+ if (JUMP_P (insn))
continue;
for (link = REG_NOTES (insn); link; link = XEXP (link, 1))
@@ -3940,11 +3924,60 @@ update_equiv_regs (void)
end_alias_analysis ();
free (reg_equiv);
free (pdx_subregs);
- return recorded_label_ref;
}
-
+/* A pass over indirect jumps, converting simple cases to direct jumps.
+ Combine does this optimization too, but only within a basic block. */
+static void
+indirect_jump_optimize (void)
+{
+ basic_block bb;
+ bool rebuild_p = false;
+
+ FOR_EACH_BB_REVERSE_FN (bb, cfun)
+ {
+ rtx insn = BB_END (bb);
+ if (!JUMP_P (insn)
+ || find_reg_note (insn, REG_NON_LOCAL_GOTO, NULL_RTX))
+ continue;
+
+ rtx x = pc_set (insn);
+ if (!x || !REG_P (SET_SRC (x)))
+ continue;
+
+ int regno = REGNO (SET_SRC (x));
+ if (DF_REG_DEF_COUNT (regno) == 1)
+ {
+ df_ref def = DF_REG_DEF_CHAIN (regno);
+ if (!DF_REF_IS_ARTIFICIAL (def))
+ {
+ rtx def_insn = DF_REF_INSN (def);
+ rtx lab = NULL_RTX;
+ rtx set = single_set (def_insn);
+ if (set && GET_CODE (SET_SRC (set)) == LABEL_REF)
+ lab = SET_SRC (set);
+ else
+ {
+ rtx eqnote = find_reg_note (def_insn, REG_EQUAL, NULL_RTX);
+ if (eqnote && GET_CODE (XEXP (eqnote, 0)) == LABEL_REF)
+ lab = XEXP (eqnote, 0);
+ }
+ if (lab && validate_replace_rtx (SET_SRC (x), lab, insn))
+ rebuild_p = true;
+ }
+ }
+ }
+ if (rebuild_p)
+ {
+ timevar_push (TV_JUMP);
+ rebuild_jump_labels (get_insns ());
+ if (purge_all_dead_edges ())
+ delete_unreachable_blocks ();
+ timevar_pop (TV_JUMP);
+ }
+}
+
/* Set up fields memory, constant, and invariant from init_insns in
the structures of array ira_reg_equiv. */
static void
@@ -5187,7 +5220,6 @@ ira (FILE *f)
{
bool loops_p;
int ira_max_point_before_emit;
- int rebuild_p;
bool saved_flag_caller_saves = flag_caller_saves;
enum ira_region saved_flag_ira_region = flag_ira_region;
@@ -5260,6 +5292,10 @@ ira (FILE *f)
df_clear_flags (DF_NO_INSN_RESCAN);
+ indirect_jump_optimize ();
+ if (delete_trivially_dead_insns (get_insns (), max_reg_num ()))
+ df_analyze ();
+
regstat_init_n_sets_and_refs ();
regstat_compute_ri ();
@@ -5277,24 +5313,12 @@ ira (FILE *f)
if (resize_reg_info () && flag_ira_loop_pressure)
ira_set_pseudo_classes (true, ira_dump_file);
- rebuild_p = update_equiv_regs ();
+ update_equiv_regs ();
setup_reg_equiv ();
setup_reg_equiv_init ();
- if (optimize && rebuild_p)
- {
- timevar_push (TV_JUMP);
- rebuild_jump_labels (get_insns ());
- if (purge_all_dead_edges ())
- delete_unreachable_blocks ();
- timevar_pop (TV_JUMP);
- }
-
allocated_reg_info_size = max_reg_num ();
- if (delete_trivially_dead_insns (get_insns (), max_reg_num ()))
- df_analyze ();
-
/* It is not worth to do such improvement when we use a simple
allocation because of -O0 usage or because the function is too
big. */
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog
index d2677bed98d..9321534574d 100644
--- a/gcc/java/ChangeLog
+++ b/gcc/java/ChangeLog
@@ -1,3 +1,7 @@
+2016-08-03 Release Manager
+
+ * GCC 4.9.4 released.
+
2015-06-26 Release Manager
* GCC 4.9.3 released.
diff --git a/gcc/lra-constraints.c b/gcc/lra-constraints.c
index ae8f3cd949d..fc4bec879ef 100644
--- a/gcc/lra-constraints.c
+++ b/gcc/lra-constraints.c
@@ -3635,7 +3635,8 @@ curr_insn_transform (void)
assigment pass and the scratch pseudo will be
spilled. Spilled scratch pseudos are transformed
back to scratches at the LRA end. */
- && lra_former_scratch_operand_p (curr_insn, i))
+ && lra_former_scratch_operand_p (curr_insn, i)
+ && lra_former_scratch_p (REGNO (op)))
{
int regno = REGNO (op);
lra_change_class (regno, NO_REGS, " Change to", true);
@@ -3644,6 +3645,8 @@ curr_insn_transform (void)
spilled pseudo as there is only one such insn, the
current one. */
reg_renumber[regno] = -1;
+ lra_assert (bitmap_single_bit_set_p
+ (&lra_reg_info[REGNO (op)].insn_bitmap));
}
/* We can do an optional reload. If the pseudo got a hard
reg, we might improve the code through inheritance. If
diff --git a/gcc/lto-streamer.h b/gcc/lto-streamer.h
index 51b1903cc05..62a5fe0c698 100644
--- a/gcc/lto-streamer.h
+++ b/gcc/lto-streamer.h
@@ -141,7 +141,7 @@ along with GCC; see the file COPYING3. If not see
#define LTO_SECTION_NAME_PREFIX ".gnu.lto_"
#define LTO_major_version 3
-#define LTO_minor_version 0
+#define LTO_minor_version 1
typedef unsigned char lto_decl_flags_t;
diff --git a/gcc/lto/ChangeLog b/gcc/lto/ChangeLog
index bf67693d8fc..39945c966e2 100644
--- a/gcc/lto/ChangeLog
+++ b/gcc/lto/ChangeLog
@@ -1,3 +1,7 @@
+2016-08-03 Release Manager
+
+ * GCC 4.9.4 released.
+
2015-06-26 Release Manager
* GCC 4.9.3 released.
diff --git a/gcc/objc/ChangeLog b/gcc/objc/ChangeLog
index ee722a86573..befeed03e95 100644
--- a/gcc/objc/ChangeLog
+++ b/gcc/objc/ChangeLog
@@ -1,3 +1,7 @@
+2016-08-03 Release Manager
+
+ * GCC 4.9.4 released.
+
2015-06-26 Release Manager
* GCC 4.9.3 released.
diff --git a/gcc/objcp/ChangeLog b/gcc/objcp/ChangeLog
index 1f3f9065b68..1ba0cb619a0 100644
--- a/gcc/objcp/ChangeLog
+++ b/gcc/objcp/ChangeLog
@@ -1,3 +1,7 @@
+2016-08-03 Release Manager
+
+ * GCC 4.9.4 released.
+
2015-06-26 Release Manager
* GCC 4.9.3 released.
diff --git a/gcc/omp-low.c b/gcc/omp-low.c
index b5a86979d9e..ac2e222d3df 100644
--- a/gcc/omp-low.c
+++ b/gcc/omp-low.c
@@ -8234,9 +8234,15 @@ expand_omp_target (struct omp_region *region)
make_edge (else_bb, new_bb, EDGE_FALLTHRU);
device = tmp_var;
+ gsi = gsi_last_bb (new_bb);
+ }
+ else
+ {
+ gsi = gsi_last_bb (new_bb);
+ device = force_gimple_operand_gsi (&gsi, device, true, NULL_TREE,
+ true, GSI_SAME_STMT);
}
- gsi = gsi_last_bb (new_bb);
t = gimple_omp_target_data_arg (entry_stmt);
if (t == NULL)
{
@@ -11192,7 +11198,8 @@ simd_clone_create (struct cgraph_node *old_node)
DECL_STATIC_DESTRUCTOR (new_decl) = 0;
new_node
= cgraph_copy_node_for_versioning (old_node, new_decl, vNULL, NULL);
- cgraph_call_function_insertion_hooks (new_node);
+ if (old_node->in_other_partition)
+ new_node->in_other_partition = 1;
}
if (new_node == NULL)
return new_node;
diff --git a/gcc/passes.c b/gcc/passes.c
index 377b2471ab0..bee10f70e87 100644
--- a/gcc/passes.c
+++ b/gcc/passes.c
@@ -2079,7 +2079,7 @@ execute_one_ipa_transform_pass (struct cgraph_node *node,
check_profile_consistency (pass->static_pass_number, 1, true);
if (dump_file)
- do_per_function (execute_function_dump, NULL);
+ do_per_function (execute_function_dump, pass);
pass_fini_dump_file (pass);
current_pass = NULL;
diff --git a/gcc/po/ChangeLog b/gcc/po/ChangeLog
index 37387203bba..547ece9873a 100644
--- a/gcc/po/ChangeLog
+++ b/gcc/po/ChangeLog
@@ -1,3 +1,7 @@
+2016-08-03 Release Manager
+
+ * GCC 4.9.4 released.
+
2015-06-26 Release Manager
* GCC 4.9.3 released.
diff --git a/gcc/postreload.c b/gcc/postreload.c
index 9bfffe5f4df..1e852cdde04 100644
--- a/gcc/postreload.c
+++ b/gcc/postreload.c
@@ -1094,7 +1094,6 @@ static bool
reload_combine_recognize_pattern (rtx insn)
{
rtx set, reg, src;
- unsigned int regno;
set = single_set (insn);
if (set == NULL_RTX)
@@ -1106,7 +1105,20 @@ reload_combine_recognize_pattern (rtx insn)
|| hard_regno_nregs[REGNO (reg)][GET_MODE (reg)] != 1)
return false;
- regno = REGNO (reg);
+ unsigned int regno = REGNO (reg);
+ machine_mode mode = GET_MODE (reg);
+
+ if (reg_state[regno].use_index < 0
+ || reg_state[regno].use_index >= RELOAD_COMBINE_MAX_USES)
+ return false;
+
+ for (int i = reg_state[regno].use_index;
+ i < RELOAD_COMBINE_MAX_USES; i++)
+ {
+ struct reg_use *use = reg_state[regno].reg_use + i;
+ if (GET_MODE (*use->usep) != mode)
+ return false;
+ }
/* Look for (set (REGX) (CONST_INT))
(set (REGX) (PLUS (REGX) (REGY)))
@@ -1128,8 +1140,6 @@ reload_combine_recognize_pattern (rtx insn)
&& REG_P (XEXP (src, 1))
&& rtx_equal_p (XEXP (src, 0), reg)
&& !rtx_equal_p (XEXP (src, 1), reg)
- && reg_state[regno].use_index >= 0
- && reg_state[regno].use_index < RELOAD_COMBINE_MAX_USES
&& last_label_ruid < reg_state[regno].use_ruid)
{
rtx base = XEXP (src, 1);
diff --git a/gcc/ree.c b/gcc/ree.c
index 7d00d816d40..60af8eadeac 100644
--- a/gcc/ree.c
+++ b/gcc/ree.c
@@ -783,6 +783,12 @@ combine_reaching_defs (ext_cand *cand, const_rtx set_pat, ext_state *state)
if (state->defs_list.length () != 1)
return false;
+ /* We don't have the structure described above if there are
+ conditional moves in between the def and the candidate,
+ and we will not handle them correctly. See PR68194. */
+ if (state->copies_list.length () > 0)
+ return false;
+
/* We require the candidate not already be modified. It may,
for example have been changed from a (sign_extend (reg))
into (zero_extend (sign_extend (reg))).
diff --git a/gcc/rtl.h b/gcc/rtl.h
index 6d43b27feb1..62b4553e5be 100644
--- a/gcc/rtl.h
+++ b/gcc/rtl.h
@@ -2715,6 +2715,8 @@ extern int anti_dependence (const_rtx, const_rtx);
extern int canon_anti_dependence (const_rtx, bool,
const_rtx, enum machine_mode, rtx);
extern int output_dependence (const_rtx, const_rtx);
+extern int canon_output_dependence (const_rtx, bool,
+ const_rtx, machine_mode, rtx);
extern int may_alias_p (const_rtx, const_rtx);
extern void init_alias_target (void);
extern void init_alias_analysis (void);
diff --git a/gcc/sched-deps.c b/gcc/sched-deps.c
index 2c501cf6968..122748b29a4 100644
--- a/gcc/sched-deps.c
+++ b/gcc/sched-deps.c
@@ -2714,9 +2714,12 @@ sched_analyze_2 (struct deps_desc *deps, rtx x, rtx insn)
return;
}
- /* Force pending stores to memory in case a trap handler needs them. */
+ /* Force pending stores to memory in case a trap handler needs them.
+ Also force pending loads from memory; loads and stores can segfault
+ and the signal handler won't be triggered if the trap insn was moved
+ above load or store insn. */
case TRAP_IF:
- flush_pending_lists (deps, insn, true, false);
+ flush_pending_lists (deps, insn, true, true);
break;
case PREFETCH:
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 8e2f7312c79..19bcfd04416 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,8 +1,797 @@
+2016-08-03 Release Manager
+
+ * GCC 4.9.4 released.
+
+2016-07-22 Andre Vehreschild <vehre@gcc.gnu.org>
+
+ Backport from trunk:
+ PR fortran/70842
+ * gfortran.dg/select_type_35.f03: New test.
+
+2016-07-20 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/71909
+ * g++.dg/parse/pr71909.C: New test.
+ * g++.dg/tm/pr71909.C: New test.
+
+2016-07-19 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/71874
+ * g++.dg/torture/pr71874.C: New test.
+
+2016-07-19 Martin Jambor <mjambor@suse.cz>
+
+ PR fortran/71688
+ * gfortran.dg/pr71688.f90: New test.
+
+2016-07-19 Jakub Jelinek <jakub@redhat.com>
+
+ Backported from mainline
+ 2016-07-18 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/71871
+ * g++.dg/ext/vector31.C: New test.
+
+ 2016-07-11 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/71758
+ * c-c++-common/gomp/pr71758.c: New test.
+ * gfortran.dg/gomp/pr71758.f90: New test.
+
+2016-07-15 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
+ Backport from trunk:
+ PR fortran/71764
+ * gfortran.dg/pr71764.f90: New test.
+
+2016-07-08 Martin Liska <mliska@suse.cz>
+
+ Backported from mainline
+ 2016-07-08 Martin Liska <mliska@suse.cz>
+
+ * gcc.dg/torture/pr71606.c: New test.
+
+2016-07-07 Jakub Jelinek <jakub@redhat.com>
+
+ Backported from mainline
+ 2016-06-30 Jakub Jelinek <jakub@redhat.com>
+
+ PR fortran/71704
+ * gfortran.dg/gomp/pr71704.f90: New test.
+
+ PR fortran/71705
+ * gfortran.dg/gomp/pr71705.f90: New test.
+
+ 2016-06-28 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/71626
+ * gcc.c-torture/execute/pr71626-1.c: New test.
+ * gcc.c-torture/execute/pr71626-2.c: New test.
+
+ 2016-06-21 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/71588
+ * gcc.dg/pr71558.c: New test.
+
+ 2016-06-10 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/71494
+ * gcc.c-torture/execute/pr71494.c: New test.
+
+ 2016-03-29 Jakub Jelinek <jakub@redhat.com>
+
+ PR rtl-optimization/70429
+ * gcc.c-torture/execute/pr70429.c: New test.
+
+ 2016-03-15 Jakub Jelinek <jakub@redhat.com>
+
+ PR rtl-optimization/70222
+ * gcc.c-torture/execute/pr70222-1.c: New test.
+ * gcc.c-torture/execute/pr70222-2.c: New test.
+
+ 2016-03-11 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/70169
+ * gcc.dg/pr70169.c: New test.
+
+ 2016-03-09 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/70152
+ * gcc.dg/pr70152.c: New test.
+
+ 2016-02-26 Jakub Jelinek <jakub@redhat.com>
+ Eric Botcazou <ebotcazou@adacore.com>
+
+ PR rtl-optimization/69891
+ * gcc.target/i386/pr69891.c: New test.
+
+ 2016-02-19 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/67767
+ * g++.dg/cpp0x/pr67767.C: New test.
+
+ 2016-02-16 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/69802
+ * gcc.dg/pr69802.c: New test.
+
+ 2016-02-15 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/69797
+ * c-c++-common/pr69797.c: New test.
+
+ 2016-03-02 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/70022
+ * gcc.dg/pr70022.c: Add -w -Wno-psabi to dg-options.
+
+ 2014-12-12 Richard Biener <rguenther@suse.de>
+
+ PR middle-end/64280
+ * g++.dg/torture/pr64280.C: New testcase.
+
+2016-07-07 Richard Biener <rguenther@suse.de>
+
+ Backport from mainline
+ 2016-04-04 Richard Biener <rguenther@suse.de>
+
+ PR rtl-optimization/70484
+ * gcc.dg/torture/pr70484.c: New testcase.
+
+ 2016-06-08 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/71452
+ * gcc.dg/torture/pr71452.c: New testcase.
+
+ 2016-05-06 Richard Biener <rguenther@suse.de>
+
+ PR middle-end/70931
+ * gfortran.dg/pr70931.f90: New testcase.
+
+ 2016-03-01 Richard Biener <rguenther@suse.de>
+
+ PR middle-end/70022
+ * gcc.dg/pr70022.c: New testcase.
+
+2016-06-30 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/71693
+ * gcc.c-torture/compile/pr71693.c: New test.
+
+2016-06-20 Georg-Johann Lay <avr@gjlay.de>
+ Pitchumani Sivanupandi <pitchumani.s@atmel.com>
+
+ Backport from 2016-06-20 trunk r237589, r236558.
+
+ PR target/71103
+ * gcc.target/avr/pr71103.c: New test.
+ * gcc.target/avr/torture/pr71103-2.c: New test.
+
+2016-06-07 Uros Bizjak <ubizjak@gmail.com>
+
+ PR target/71389
+ * g++.dg/pr71389.C: New test.
+
+2016-05-26 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
+ Backport from trunk.
+ PR fortran/66461
+ * gfortran.dg/unexpected_eof.f: New test
+
+2016-05-22 Iain Sandoe <iain@codesourcery.com>
+ Dominique d'Humieres <dominiq@lps.ens.fr>
+
+ Backport from mainline
+ 2015-12-17 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ PR target/67973
+
+ * lib/target-supports.exp (check_effective_target_stabs): New proc.
+ * g++.dg/cpp0x/alias-decl-debug-0.C: Restrict to stabs targets.
+ * g++.dg/other/PR23205.C: Likewise.
+ * g++.dg/other/pr23205-2.C: Likewise.
+ * gcc.dg/20040813-1.c: Likewise.
+ * gcc.dg/darwin-20040809-2.c: Likewise.
+ * objc.dg/stabs-1.m: Likewise.
+
+2016-05-20 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
+
+ Backport from mainline
+ 2016-05-17 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
+
+ PR target/70809
+ * gcc.target/aarch64/pr70809_1.c: New test.
+
+2016-05-19 Martin Jambor <mjambor@suse.cz>
+
+ PR ipa/70646
+ * gcc.dg/ipa/pr70646.c: New test.
+
+2016-05-15 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
+
+ Backport from mainline
+ 2016-05-11 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
+
+ * gcc.target/powerpc/pr70963.c: Require at least power8 at both
+ compile and run time.
+
+2016-05-10 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
+
+ Backport from mainline
+ 2016-05-10 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
+
+ PR target/70963
+ * gcc.target/powerpc/pr70963.c: New.
+
+2016-05-05 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
+ Backport from trunk.
+ PR libgfortran/70684
+ * gfortran.dg/list_read_14.f90: New test.
+
+2016-04-28 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/70858
+ * gcc.target/i386/pr70858.c: New test.
+
+2016-04-25 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
+
+ Backport from mainline
+ 2016-03-14 Segher Boessenkool <segher@kernel.crashing.org>
+
+ PR target/70098
+ * lib/target-supports.exp (check_effective_target_powerpc64_no_dm):
+ New function.
+ * g++.dg/pr70098.C: New testcase.
+
+2016-04-21 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
+
+ Backport from mainline
+ 2016-04-20 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
+
+ PR target/70674
+ * gcc.target/s390/pr70674.c: New test.
+
+2016-04-13 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
+
+ Backport from mainline
+ 2016-04-08 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
+
+ PR target/70566
+ * gcc.c-torture/execute/pr70566.c: New test.
+
+2016-04-13 Alan Modra <amodra@gmail.com>
+
+ Backport from mainline
+ 2016-03-31 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+ * g++.dg/template/ptrmem30.C (read): Rename to data_read.
+ (Holder::foo): Reflect this.
+
+ 2016-03-22 Patrick Palka <ppalka@gcc.gnu.org>
+ PR c++/70096
+ * g++.dg/template/ptrmem30.C: New test.
+
+2016-04-11 Alan Modra <amodra@gmail.com>
+
+ * gcc.target/powerpc/pr70117.c: New.
+
+2016-04-05 Dominique d'Humieres <dominiq@lps.ens.fr>
+ Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
+ * gfortran.dg/fmt_pf.f90: New test.
+
+2016-04-04 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
+ Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/70457
+ * gcc.dg/torture/pr70457.c: New.
+
+2016-03-31 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
+
+ * gcc.target/arm/atomic_loaddi_relaxed_cond.c: New test.
+
+2016-03-31 Jakub Jelinek <jakub@redhat.com>
+
+ PR rtl-optimization/70460
+ * gcc.c-torture/execute/pr70460.c: New test.
+
+2016-02-29 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
+
+ PR target/69875
+ * gcc.target/arm/atomic_loaddi_acquire.x: New file.
+ * gcc.target/arm/atomic_loaddi_relaxed.x: Likewise.
+ * gcc.target/arm/atomic_loaddi_seq_cst.x: Likewise.
+ * gcc.target/arm/atomic_loaddi_1.c: New test.
+ * gcc.target/arm/atomic_loaddi_2.c: Likewise.
+ * gcc.target/arm/atomic_loaddi_3.c: Likewise.
+ * gcc.target/arm/atomic_loaddi_4.c: Likewise.
+ * gcc.target/arm/atomic_loaddi_5.c: Likewise.
+ * gcc.target/arm/atomic_loaddi_6.c: Likewise.
+ * gcc.target/arm/atomic_loaddi_7.c: Likewise.
+ * gcc.target/arm/atomic_loaddi_8.c: Likewise.
+ * gcc.target/arm/atomic_loaddi_9.c: Likewise.
+
+2016-03-29 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
+
+ Backport from mainline
+ 2016-03-23 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
+
+ * lib/target-supports.exp: Remove v7ve entry from loop
+ creating effective target checks.
+ (check_effective_target_arm_arch_v7ve_ok): New procedure.
+ (add_options_for_arm_arch_v7ve): Likewise.
+
+2016-03-21 Uros Bizjak <ubizjak@gmail.com>
+
+ PR target/70327
+ * gcc.target/i386/pr70327.c: New test.
+
+2016-03-21 Tom de Vries <tom@codesourcery.com>
+
+ backport from trunk:
+ 2016-03-18 Tom de Vries <tom@codesourcery.com>
+
+ * gcc.dg/pr70161-2.c: New test.
+ * gcc.dg/pr70161.c: New test.
+
+2016-03-18 Jonathan Wakely <jwakely@redhat.com>
+
+ Backported from mainline
+ 2014-12-19 Kai Tietz <ktietz@redhat.com>
+ Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/61198
+ * g++.dg/cpp0x/alias-decl-45.C: New file.
+
+2016-03-15 Bernd Schmidt <bschmidt@redhat.com>
+
+ Backport from mainline
+ 2016-03-04 Bernd Schmidt <bschmidt@redhat.com>
+
+ PR rtl-optimization/69941
+ * gcc.dg/torture/pr69941.c: New test.
+
+2016-03-14 Dominique d'Humieres <dominiq@lps.ens.fr>
+
+ PR fortran/45076
+ gfortran.dg/prof/prof.exp: New script.
+ gfortran.dg/prof/dynamic_dispatch_6.f03: New test.
+
+2016-03-10 Alan Modra <amodra@gmail.com>
+
+ * gcc.dg/pr69195.c: New.
+ * gcc.dg/pr69238.c: New.
+
+2016-03-04 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/70059
+ * gcc.target/i386/avx512f-pr70059.c: New test.
+
+2016-03-03 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * lib/gcc-gdb-test.exp (gdb-test): Make log message match command.
+ Invoke gdb with -batch.
+ * lib/gcc-simulate-thread.exp (simulate-thread): Likewise.
+
+2016-03-01 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gcc.target/i386/pr70007.c: New test.
+
+2016-02-29 Harald Anlauf <anlauf@gmx.de>
+
+ PR fortran/60126
+ * gfortran.dg/pr60126.f90: New test.
+
+2016-02-28 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
+ Backport from mainline
+ PR fortran/61156
+ * gfortran.dg/include_6.f90: Update test.
+
+2016-02-18 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
+ Backport from gcc-5-branch.
+ PR libgfortran/69668
+ * gfortran.dg/namelist_38.f90: Update test.
+ * gfortran.dg/namelist_84.f90: Update test.
+
+2016-02-18 Marek Polacek <polacek@redhat.com>
+
+ 2016-02-12 Marek Polacek <polacek@redhat.com>
+ Backport from mainline
+
+ * gcc.dg/pr69522.c: Add empty dg-options.
+
+2016-02-17 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
+
+ Backport from mainline
+ 2012-02-17 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
+
+ * gcc.target/powerpc/vec-cg.c: New test.
+
+2016-02-17 Bernd Schmidt <bschmidt@redhat.com>
+
+ Backport from mainline
+ 2016-02-12 Bernd Schmidt <bschmidt@redhat.com>
+
+ PR c/69522
+ * gcc.dg/pr69522.c: New test.
+
+2016-02-16 Tom de Vries <tom@codesourcery.com>
+
+ backport from trunk:
+ 2015-10-21 Ilya Enkovich <enkovich.gnu@gmail.com>
+
+ * gcc.dg/lto/simd-function_0.c: New test.
+
+2016-02-13 Oleg Endo <olegendo@gcc.gnu.org>
+
+ Backport from mainline
+ 2016-02-13 Oleg Endo <olegendo@gcc.gnu.org>
+
+ PR target/67260
+ * gcc.target/sh/torture/pr67260.c: New.
+
+2016-02-12 Richard Biener <rguenther@suse.de>
+
+ Backport from mainline
+ 2016-02-09 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/69715
+ * gcc.dg/torture/pr69715.c: New testcase.
+
+ 2016-02-01 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/69579
+ * gcc.dg/setjmp-6.c: New testcase.
+
+ 2016-02-01 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/69574
+ * gcc.dg/torture/pr69574.c: New testcase.
+
+2016-02-11 Richard Biener <rguenther@suse.de>
+
+ Backport from mainline
+ 2015-02-18 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/62217
+ * gcc.dg/tree-ssa/cunroll-11.c: New testcase.
+
+ 2015-06-18 Richard Biener <rguenther@suse.de>
+
+ Backport from mainline
+ 2015-06-03 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/66375
+ * gcc.dg/torture/pr66375.c: New testcase.
+
+ 2015-06-23 Richard Biener <rguenther@suse.de>
+
+ Backport from mainline
+ 2015-06-09 Richard Biener <rguenther@suse.de>
+
+ PR middle-end/66413
+ * gcc.dg/torture/pr66413.c: New testcase.
+
+ 2015-07-08 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/66794
+ * gcc.dg/torture/pr66794.c: New testcase.
+
+2016-02-11 Jakub Jelinek <jakub@redhat.com>
+
+ Backported from mainline
+ 2016-02-08 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/59627
+ * g++.dg/gomp/pr59627.C: New test.
+
+ 2016-01-22 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/69432
+ * g++.dg/opt/pr69432.C: New test.
+
+ 2016-01-21 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/67653
+ * c-c++-common/pr67653.c: New test.
+ * gcc.dg/torture/pr29119.c: Add dg-warning.
+
+ 2016-01-19 Jakub Jelinek <jakub@redhat.com>
+
+ PR rtl-optimization/68955
+ PR rtl-optimization/64557
+ * gcc.dg/torture/pr68955.c: New test.
+
+ 2016-01-11 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/69214
+ * gcc.c-torture/compile/pr69214.c: New test.
+
+ 2016-01-08 Jakub Jelinek <jakub@redhat.com>
+
+ PR fortran/69128
+ * gfortran.dg/gomp/pr69128.f90: New test.
+
+ 2016-01-01 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/69015
+ * gcc.dg/pr69015.c: New test.
+
+ 2015-12-10 Jakub Jelinek <jakub@redhat.com>
+
+ PR rtl-optimization/68376
+ PR rtl-optimization/68670
+ * gcc.c-torture/execute/pr68376-2.c (f5, f6, f7, f8): New
+ tests.
+ (main): Call them.
+ * gcc.dg/pr68670-1.c: New test.
+ * gcc.dg/pr68670-2.c: New test.
+
+ PR rtl-optimization/68376
+ * gcc.c-torture/execute/pr68376-1.c: New test.
+ * gcc.c-torture/execute/pr68376-2.c: New test.
+
+ 2015-12-04 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/68680
+ * gcc.target/i386/pr68680.c: New test.
+
+ 2015-12-03 Jakub Jelinek <jakub@redhat.com>
+
+ PR preprocessor/57580
+ * c-c++-common/cpp/pr57580.c: New test.
+ * c-c++-common/gomp/pr57580.c: New test.
+
+ 2015-11-21 Jakub Jelinek <jakub@redhat.com>
+
+ PR debug/66432
+ * gcc.dg/debug/pr66432.c: New test.
+
+ 2015-11-19 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/67770
+ * gcc.target/i386/pr67770.c: New test.
+
+2016-02-04 Jakub Jelinek <jakub@redhat.com>
+
+ Backported from mainline
+ 2016-02-03 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/69644
+ * gcc.dg/pr69644.c: New test.
+
+2016-02-02 Alan Modra <amodra@gmail.com>
+
+ PR target/69548
+ * gcc.target/powerpc/pr69548.c: New test.
+
+2016-01-29 Martin Jambor <mjambor@suse.cz>
+
+ PR tree-optimization/69355
+ * gcc.dg/tree-ssa/pr69355.c: New test.
+
+2016-01-29 Uros Bizjak <ubizjak@gmail.com>
+
+ Backport from mainline
+ 2016-01-29 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/69551
+ * gcc.target/i386/pr69551.c: New test.
+
+2016-01-29 Uros Bizjak <ubizjak@gmail.com>
+
+ PR target/69459
+ * gcc.target/i386/pr69459.c: New test.
+
+2016-01-27 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
+
+ * gcc.dg/and-1.c: Remove nand test for powerpc*-*-*.
+
+2016-01-27 Tom de Vries <tom@codesourcery.com>
+
+ * gcc.dg/autopar/pr69110.c: Fix pass number.
+
+2016-01-26 Tom de Vries <tom@codesourcery.com>
+
+ PR tree-optimization/69110
+ * gcc.dg/autopar/pr69110.c: New test.
+
+2016-01-25 Tom de Vries <tom@codesourcery.com>
+
+ backport from trunk:
+ PR tree-optimization/PR64091
+ 2014-11-27 Richard Biener <rguenther@suse.de>
+
+ * gcc.dg/torture/pr64091.c: New testcase.
+
+2016-01-22 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
+
+ Backport from mainline
+ 2016-01-22 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
+
+ PR target/69403
+ * gcc.c-torture/execute/pr69403.c: New test.
+
+2016-01-21 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
+
+ Backported from mainline
+ 2015-07-24 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
+
+ * gcc.target/s390/gpr2fprsavecfi.c: New test.
+
+2016-01-20 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
+
+ Backport from mainline
+ 2015-09-10 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
+
+ PR target/67439
+ * gcc.target/arm/pr67439_1.c: New test.
+
+2016-01-19 Sergei Trofimovich <siarheit@google.com>
+
+ Backport from mainline
+ PR other/60465
+ * gcc.target/ia64/pr60465-gprel64.c: New test.
+ * gcc.target/ia64/pr60465-gprel64-c37.c: New test.
+
+2016-01-19 Uros Bizjak <ubizjak@gmail.com>
+
+ PR testsuite/68820
+ * gcc.c-torture/execute/builtins/memops-asm.x: New file.
+ * gcc.c-torture/execute/builtins/strstr-asm.x: Ditto.
+ * gcc.c-torture/execute/builtins/strstr-asm.c: Remove dg-options.
+
+2016-01-14 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
+
+ PR target/68648
+ * gcc.dg/torture/pr68648.c: New test.
+
+2016-01-12 Jeff Law <law@redhat.com>
+
+ PR target/63347
+ * gcc.target/m68k/pr63347.c: New test.
+
+2016-01-12 James Greenhalgh <james.greenhalgh@arm.com>
+
+ Backport from mainline.
+ 2015-12-09 James Greenhalgh <james.greenhalgh@arm.com>
+
+ PR rtl-optimization/67609
+ * gcc.dg/torture/pr67609.c: New.
+
+2016-01-11 Martin Jambor <mjambor@suse.cz>
+
+ PR ipa/66616
+ * g++.dg/ipa/pr66616.C: New test.
+
+2016-01-08 Martin Jambor <mjambor@suse.cz>
+
+ Backport from mainline
+ 2015-12-15 Martin Jambor <mjambor@suse.cz>
+
+ PR ipa/68851
+ * g++.dg/ipa/pr68851.C: New test.
+
+2015-12-22 Peter Bergner <bergner@vnet.ibm.com>
+
+ Backport from mainline
+ PR target/68872
+ * gcc.target/powerpc/pr68872.c: New test.
+
+2015-12-10 Uros Bizjak <ubizjak@gmail.com>
+
+ Backport from mainline
+ 2015-12-08 Uros Bizjak <ubizjak@gmail.com>
+
+ PR target/68701
+ * gcc.target/i386/pr68701-1.c: New test.
+ * gcc.target/i386/pr68701-2.c: Ditto.
+
+2015-12-09 Uros Bizjak <ubizjak@gmail.com>
+
+ * gcc.target/i386/sse4_1-roundps-1.c: Remove ASM_SUFFIX define.
+ * gcc.target/i386/sse4_1-roundps-2.c: Ditto.
+ * gcc.target/i386/sse4_1-roundps-3.c: Ditto.
+ * gcc.target/i386/sse4_1-roundsd-1.c: Ditto.
+ * gcc.target/i386/sse4_1-roundsd-2.c: Ditto.
+ * gcc.target/i386/sse4_1-roundsd-3.c: Ditto.
+ * gcc.target/i386/sse4_1-roundss-1.c: Ditto.
+ * gcc.target/i386/sse4_1-roundss-2.c: Ditto.
+ * gcc.target/i386/sse4_1-roundss-3.c: Ditto.
+
+2015-12-09 Uros Bizjak <ubizjak@gmail.com>
+
+ * gcc.target/i386/sse4_1-round.h (do_round): Fix inline asm statements.
+ * gcc.target/i386/sse4_1-roundsd-4.c (do_round): Ditto.
+ * gcc.target/i386/sse4_1-roundss-4.c (do_round): Ditto.
+
+2015-12-08 Maxim Ostapenko <m.ostapenko@partner.samsung.com>
+
+ Backport from mainline.
+ 2015-03-16 Max Ostapenko <m.ostapenko@partner.samsung.com>
+
+ PR sanitizer/64820
+ * c-c++-common/asan/pr64820.c: New test.
+
+2015-11-27 Andre Vehreschild <vehre@gcc.gnu.org>
+
+ PR fortran/68218
+ * gfortran.dg/allocate_with_arrayspec_1.f90: New test.
+
+2015-11-26 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
+
+ Backport from mainline
+ 2015-11-26 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
+
+ PR rtl-optimization/67226
+ * gcc.c-torture/execute/pr67226.c: New test.
+
+2015-11-25 Paul Thomas <pault@gcc.gnu.org>
+
+ Backport from trunk.
+ PR fortran/68196
+ * gfortran.dg/proc_ptr_47.f90: New test.
+
+ Backport from trunk.
+ PR fortran/66465
+ * gfortran.dg/pr66465.f90: New test.
+
+2015-11-24 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
+
+ Backport from mainline
+ 2015-11-24 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
+
+ PR rtl-optimization/68194
+ PR rtl-optimization/68328
+ PR rtl-optimization/68185
+ * gcc.c-torture/execute/pr68185.c: New test.
+ * gcc.c-torture/execute/pr68328.c: Likewise.
+
+2015-11-23 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
+
+ Backport from mainline
+ 2015-11-23 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
+
+ PR target/68363
+ * gcc.target/aarch64/pr68363_1.c: New test.
+
+2015-11-12 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gcc.target/i386/pr67265-2.c: New test.
+
+2015-11-11 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gcc.target/i386/pr67265.c: New test.
+
+2015-11-09 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gcc.target/sparc/sparc-ret.c: Rename to...
+ * gcc.target/sparc/sparc-ret-1.c: ...this.
+ * gcc.target/sparc/sparc-ret-2.c: New test.
+
+2015-11-02 Martin Jambor <mjambor@suse.cz>
+
+ Backport from mainline
+ 2015-10-09 Martin Jambor <mjambor@suse.cz>
+
+ * gcc.dg/ipa/ipa-sra-10.c: New test.
+ * gcc.dg/torture/pr67794.c: Likewise.
+
2015-10-22 Paul Thomas <pault@gcc.gnu.org>
PR fortran/58754
* gfortran.dg/pr58754.f90: New test
+2015-11-01 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
+
+ PR target/67929
+ * gcc.target/arm/pr67929_1.c: Move to...
+ * gcc.c-torture/execute/pr67929_1.c: ... Here.
+ Remove arm-specific directives. Add noclone, noinline
+ attributes.
+
2015-10-27 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
Backport from mainline
diff --git a/gcc/testsuite/c-c++-common/asan/pr64820.c b/gcc/testsuite/c-c++-common/asan/pr64820.c
new file mode 100644
index 00000000000..885a6621491
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/asan/pr64820.c
@@ -0,0 +1,31 @@
+/* { dg-do run } */
+/* { dg-require-effective-target fstack_protector } */
+/* { dg-options "-fstack-protector-strong" } */
+/* { dg-set-target-env-var ASAN_OPTIONS "detect_stack_use_after_return=1" } */
+/* { dg-shouldfail "asan" } */
+
+__attribute__((noinline))
+char *Ident(char *x) {
+ return x;
+}
+
+__attribute__((noinline))
+char *Func1() {
+ char local[1 << 12];
+ return Ident(local);
+}
+
+__attribute__((noinline))
+void Func2(char *x) {
+ *x = 1;
+}
+int main(int argc, char **argv) {
+ Func2(Func1());
+ return 0;
+}
+
+/* { dg-output "AddressSanitizer: stack-use-after-return on address 0x\[0-9a-f\]+\[^\n\r]*(\n|\r\n|\r)" } */
+/* { dg-output "WRITE of size 1 at .* thread T0.*" } */
+/* { dg-output " #0.*(Func2)?.*pr64820.(c:21)?.*" } */
+/* { dg-output "is located in stack of thread T0 at offset.*" } */
+/* { dg-output "\'local\' <== Memory access at offset 32 is inside this variable" } */
diff --git a/gcc/testsuite/c-c++-common/cpp/pr57580.c b/gcc/testsuite/c-c++-common/cpp/pr57580.c
new file mode 100644
index 00000000000..1039e213e1c
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/cpp/pr57580.c
@@ -0,0 +1,9 @@
+/* PR preprocessor/57580 */
+/* { dg-do compile } */
+/* { dg-options "-save-temps" } */
+
+#define MSG \
+ _Pragma("message(\"message0\")") \
+ _Pragma("message(\"message1\")")
+MSG /* { dg-message "message0" } */
+/* { dg-message "message1" "" { target *-*-* } 8 } */
diff --git a/gcc/testsuite/c-c++-common/gomp/pr57580.c b/gcc/testsuite/c-c++-common/gomp/pr57580.c
new file mode 100644
index 00000000000..9bbe707ef37
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/gomp/pr57580.c
@@ -0,0 +1,36 @@
+/* PR preprocessor/57580 */
+/* { dg-do compile } */
+/* { dg-options "-fopenmp -save-temps -fdump-tree-gimple" } */
+
+#define PS \
+ _Pragma("omp parallel num_threads(2)") \
+ { \
+ _Pragma("omp single") \
+ { \
+ ret = 0; \
+ } \
+ }
+
+int
+main ()
+{
+ int ret;
+ _Pragma("omp parallel num_threads(3)")
+ {
+ _Pragma("omp single")
+ {
+ ret = 0;
+ }
+ }
+ _Pragma("omp parallel num_threads(4)") { _Pragma("omp single") { ret = 0; } }
+ { _Pragma("omp parallel num_threads(5)") { _Pragma("omp single") { ret = 0; } } }
+ PS
+ PS
+ return ret;
+}
+
+/* { dg-final { scan-tree-dump-times "#pragma omp parallel\[^\n\r]*num_threads\\(2\\)" 2 "gimple" } } */
+/* { dg-final { scan-tree-dump-times "#pragma omp parallel\[^\n\r]*num_threads\\(3\\)" 1 "gimple" } } */
+/* { dg-final { scan-tree-dump-times "#pragma omp parallel\[^\n\r]*num_threads\\(4\\)" 1 "gimple" } } */
+/* { dg-final { scan-tree-dump-times "#pragma omp parallel\[^\n\r]*num_threads\\(5\\)" 1 "gimple" } } */
+/* { dg-final { scan-tree-dump-times "#pragma omp single" 5 "gimple" } } */
diff --git a/gcc/testsuite/c-c++-common/gomp/pr71758.c b/gcc/testsuite/c-c++-common/gomp/pr71758.c
new file mode 100644
index 00000000000..d3c86972ef5
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/gomp/pr71758.c
@@ -0,0 +1,10 @@
+/* PR middle-end/71758 */
+
+void
+foo (int *p)
+{
+ long long i = 0;
+ #pragma omp target device (i)
+ ;
+ #pragma omp target update device (i) to (p[0])
+}
diff --git a/gcc/testsuite/c-c++-common/pr67653.c b/gcc/testsuite/c-c++-common/pr67653.c
new file mode 100644
index 00000000000..1b9f63ec626
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/pr67653.c
@@ -0,0 +1,8 @@
+/* PR middle-end/67653 */
+/* { dg-do compile } */
+
+void
+foo (void)
+{
+ __asm__ ("" : : "m" (({ static int a; a; }))); /* { dg-warning "memory input 0 is not directly addressable" } */
+}
diff --git a/gcc/testsuite/c-c++-common/pr69797.c b/gcc/testsuite/c-c++-common/pr69797.c
new file mode 100644
index 00000000000..fe2d4304c34
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/pr69797.c
@@ -0,0 +1,8 @@
+/* PR c++/69797 */
+/* { dg-do compile } */
+
+void
+foo ()
+{
+ __atomic_fetch_add (); /* { dg-error "too few arguments to function" } */
+}
diff --git a/gcc/testsuite/g++.dg/cpp0x/alias-decl-45.C b/gcc/testsuite/g++.dg/cpp0x/alias-decl-45.C
new file mode 100644
index 00000000000..e3434f51a39
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/alias-decl-45.C
@@ -0,0 +1,24 @@
+// PR c++/61198
+// { dg-do compile { target c++11 } }
+
+template<int herp, typename derp_t>
+struct broken
+{
+ template<typename target_t>
+ using rebind = broken<herp, target_t>;
+};
+
+template<typename derp_t>
+struct broken<2, derp_t>
+{
+ template<typename target_t>
+ using rebind = broken<2, target_t>;
+};
+
+int main(int argc, char **argv)
+{
+ broken<2, float>::rebind<double> u;
+
+ return 0;
+}
+
diff --git a/gcc/testsuite/g++.dg/cpp0x/alias-decl-debug-0.C b/gcc/testsuite/g++.dg/cpp0x/alias-decl-debug-0.C
index 524216ad5c0..8464aa35a1a 100644
--- a/gcc/testsuite/g++.dg/cpp0x/alias-decl-debug-0.C
+++ b/gcc/testsuite/g++.dg/cpp0x/alias-decl-debug-0.C
@@ -1,6 +1,5 @@
// Origin: PR c++/51032
-// { dg-do compile { target c++11 } }
-// { dg-skip-if "No stabs" { aarch64*-*-* mmix-*-* *-*-aix* alpha*-*-* hppa*64*-*-* ia64-*-* *-*-vxworks* nios2-*-* } { "*" } { "" } }
+// { dg-do compile { target { c++11 && stabs } } }
// { dg-options "-gstabs+" }
template <class C>
diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-array14.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-array14.C
new file mode 100644
index 00000000000..b8eb08411c1
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-array14.C
@@ -0,0 +1,9 @@
+// PR c++/66921
+// { dg-do compile { target c++11 } }
+
+template<typename T>
+struct Holder {
+ constexpr static const int array[] = { 1, 2, 3 };
+ enum {F = array[0]};
+};
+class HI: public Holder<int> {};
diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-template10.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-template10.C
new file mode 100644
index 00000000000..d63f1cc630f
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-template10.C
@@ -0,0 +1,17 @@
+// PR c++/70505
+// { dg-do compile { target c++11 } }
+
+template <class X>
+struct s
+{
+ template <class T>
+ static constexpr T f1(const T x) {return x;}
+ template <class T, T = f1<T>(sizeof(T))>
+ static constexpr T f2(const T x) {return x;}
+ static void f() {s<int>::f2(42);}
+};
+
+int main()
+{
+ s<int>::f();
+}
diff --git a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-deduce3.C b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-deduce3.C
new file mode 100644
index 00000000000..68ac29c9eac
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-deduce3.C
@@ -0,0 +1,15 @@
+// PR c++/69223
+// { dg-do compile { target c++11 } }
+
+template <class T> struct A
+{
+ T x[20];
+};
+
+int main()
+{
+ auto l = [](const A<int>& i){ return i; };
+ A<int> a;
+
+ l(a);
+}
diff --git a/gcc/testsuite/g++.dg/cpp0x/pr67767.C b/gcc/testsuite/g++.dg/cpp0x/pr67767.C
new file mode 100644
index 00000000000..fd4ae2d3f35
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/pr67767.C
@@ -0,0 +1,10 @@
+// PR c++/67767
+// { dg-do compile { target c++11 } }
+// { dg-options "-Wsuggest-attribute=noreturn" }
+
+void foo [[gnu::cold, gnu::noreturn]] ();
+
+void foo () // { dg-bogus "function might be candidate for attribute" }
+{
+ throw 1;
+}
diff --git a/gcc/testsuite/g++.dg/cpp0x/sfinae56.C b/gcc/testsuite/g++.dg/cpp0x/sfinae56.C
new file mode 100644
index 00000000000..0f954328eb4
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/sfinae56.C
@@ -0,0 +1,26 @@
+// PR c++/68926
+// { dg-do compile { target c++11 } }
+
+struct true_type { static constexpr bool value = true; };
+struct false_type { static constexpr bool value = false; };
+
+template<bool Cond> struct enable_if { using type = void; };
+template<> struct enable_if<false> { };
+
+template<typename T, typename U> struct is_same : false_type { };
+template<typename T> struct is_same<T, T> : true_type { };
+
+template<typename T>
+typename enable_if<is_same<int, T>::value>::type
+func();
+
+template<typename T, typename = decltype(func<T>)>
+true_type test(T);
+
+false_type test(...);
+
+int main()
+{
+ decltype(test(0))::value; // ok
+ decltype(test(0.f))::value; // error
+}
diff --git a/gcc/testsuite/g++.dg/cpp1y/feat-cxx11.C b/gcc/testsuite/g++.dg/cpp1y/feat-cxx11.C
index 606a5cec618..0d1c7f7d38d 100644
--- a/gcc/testsuite/g++.dg/cpp1y/feat-cxx11.C
+++ b/gcc/testsuite/g++.dg/cpp1y/feat-cxx11.C
@@ -55,10 +55,10 @@
# error "__cpp_attributes != 200809"
#endif
-#ifndef __cpp_rvalue_reference
-# error "__cpp_rvalue_reference"
-#elif __cpp_rvalue_reference != 200610
-# error "__cpp_rvalue_reference != 200610"
+#ifndef __cpp_rvalue_references
+# error "__cpp_rvalue_references"
+#elif __cpp_rvalue_references != 200610
+# error "__cpp_rvalue_references != 200610"
#endif
#ifndef __cpp_variadic_templates
diff --git a/gcc/testsuite/g++.dg/cpp1y/feat-cxx14.C b/gcc/testsuite/g++.dg/cpp1y/feat-cxx14.C
index 8a05f666064..d82c365fadd 100644
--- a/gcc/testsuite/g++.dg/cpp1y/feat-cxx14.C
+++ b/gcc/testsuite/g++.dg/cpp1y/feat-cxx14.C
@@ -57,10 +57,10 @@
# error "__cpp_attributes != 200809"
#endif
-#ifndef __cpp_rvalue_reference
-# error "__cpp_rvalue_reference"
-#elif __cpp_rvalue_reference != 200610
-# error "__cpp_rvalue_reference != 200610"
+#ifndef __cpp_rvalue_references
+# error "__cpp_rvalue_references"
+#elif __cpp_rvalue_references != 200610
+# error "__cpp_rvalue_references != 200610"
#endif
#ifndef __cpp_variadic_templates
diff --git a/gcc/testsuite/g++.dg/cpp1y/feat-cxx98-neg.C b/gcc/testsuite/g++.dg/cpp1y/feat-cxx98-neg.C
index b99b57efe0e..a2de19e1028 100644
--- a/gcc/testsuite/g++.dg/cpp1y/feat-cxx98-neg.C
+++ b/gcc/testsuite/g++.dg/cpp1y/feat-cxx98-neg.C
@@ -41,8 +41,8 @@
# error "__cpp_attributes" // { dg-error "error" }
#endif
-#ifndef __cpp_rvalue_reference
-# error "__cpp_rvalue_reference" // { dg-error "error" }
+#ifndef __cpp_rvalue_references
+# error "__cpp_rvalue_references" // { dg-error "error" }
#endif
#ifndef __cpp_variadic_templates
diff --git a/gcc/testsuite/g++.dg/ext/vector31.C b/gcc/testsuite/g++.dg/ext/vector31.C
new file mode 100644
index 00000000000..a0568394315
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ext/vector31.C
@@ -0,0 +1,29 @@
+// PR c++/71871
+// { dg-do compile }
+
+typedef unsigned int V __attribute__ ((__vector_size__ (32)));
+
+template <int N>
+void
+foo (V *x)
+{
+ V a = *x;
+ a = a ? a : -1;
+ *x = a;
+}
+
+template <typename T>
+void
+bar (T *x)
+{
+ T a = *x;
+ a = a ? a : -1;
+ *x = a;
+}
+
+void
+test (V *x, V *y)
+{
+ foo<0> (x);
+ bar<V> (y);
+}
diff --git a/gcc/testsuite/g++.dg/gomp/pr59627.C b/gcc/testsuite/g++.dg/gomp/pr59627.C
new file mode 100644
index 00000000000..ab6f44df116
--- /dev/null
+++ b/gcc/testsuite/g++.dg/gomp/pr59627.C
@@ -0,0 +1,14 @@
+// PR c++/59627
+// { dg-do compile { target lto } }
+// { dg-options "-fopenmp -flto" }
+
+struct A { A () : i (0) {} int i; };
+
+void
+foo ()
+{
+ A a;
+ #pragma omp declare reduction (+: A: omp_out.i += omp_in.i)
+ #pragma omp parallel reduction (+: a)
+ ;
+}
diff --git a/gcc/testsuite/g++.dg/inherit/using8.C b/gcc/testsuite/g++.dg/inherit/using8.C
new file mode 100644
index 00000000000..b7677c8f682
--- /dev/null
+++ b/gcc/testsuite/g++.dg/inherit/using8.C
@@ -0,0 +1,15 @@
+// PR c++/65061
+
+struct B
+{
+ template<typename T>
+ struct S {};
+};
+
+struct D : B
+{
+ using B::S;
+
+ template<typename T>
+ void doIt(/*struct*/ S<T>&);
+};
diff --git a/gcc/testsuite/g++.dg/init/elide3.C b/gcc/testsuite/g++.dg/init/elide3.C
new file mode 100644
index 00000000000..7eb0389a3f6
--- /dev/null
+++ b/gcc/testsuite/g++.dg/init/elide3.C
@@ -0,0 +1,50 @@
+// PR c++/67557
+// { dg-do run }
+
+namespace std
+{
+ struct string
+ {
+ typedef unsigned long size_type;
+ const char* _M_p;
+ char _M_local_buf[1];
+
+ string(const char* s) : _M_p(_M_local_buf)
+ {
+ __builtin_printf("%p constructed\n", this);
+ }
+
+ string(const string& s) : _M_p(_M_local_buf)
+ {
+ __builtin_printf("%p copied from %p\n", this, &s);
+ }
+
+ ~string()
+ {
+ __builtin_printf("%p destroyed\n", this);
+ if (_M_p != _M_local_buf)
+ __builtin_abort();
+ }
+ };
+}
+
+struct StartTag
+{
+ explicit StartTag(std::string const & tag) : tag_(tag), keepempty_(false) {}
+ std::string tag_;
+ bool keepempty_;
+};
+
+StartTag fontToStartTag() { return StartTag(""); }
+
+struct FontTag : public StartTag
+{
+ FontTag() : StartTag(fontToStartTag()) {}
+};
+
+int main()
+{
+ FontTag x;
+ __builtin_printf("%p x.tag_ in main()\n", &x.tag_);
+ return 0;
+}
diff --git a/gcc/testsuite/g++.dg/init/elide4.C b/gcc/testsuite/g++.dg/init/elide4.C
new file mode 100644
index 00000000000..f85d6eea40a
--- /dev/null
+++ b/gcc/testsuite/g++.dg/init/elide4.C
@@ -0,0 +1,13 @@
+// PR c++/67557
+
+class A {
+public:
+ A m_fn1();
+ A(A const &);
+ int *L;
+ int ref;
+};
+struct B : A {
+ B();
+};
+B::B() : A((0, m_fn1())) {}
diff --git a/gcc/testsuite/g++.dg/init/elide5.C b/gcc/testsuite/g++.dg/init/elide5.C
new file mode 100644
index 00000000000..0a9978ca661
--- /dev/null
+++ b/gcc/testsuite/g++.dg/init/elide5.C
@@ -0,0 +1,27 @@
+// PR c++/71913
+// { dg-do link { target c++11 } }
+
+void* operator new(unsigned long, void* p) { return p; }
+
+struct IndirectReturn {
+ IndirectReturn() {}
+ // Undefined so we get a link error if the indirect return value is copied
+ IndirectReturn(const IndirectReturn&);
+ IndirectReturn& operator=(const IndirectReturn&) = delete;
+ ~IndirectReturn() {}
+};
+
+IndirectReturn foo() { return IndirectReturn(); }
+
+void bar(void* ptr) {
+ new (ptr) IndirectReturn(foo());
+}
+
+alignas (alignof (IndirectReturn))
+unsigned char c[sizeof(IndirectReturn)];
+
+int main()
+{
+ bar(c);
+}
+
diff --git a/gcc/testsuite/g++.dg/ipa/pr66616.C b/gcc/testsuite/g++.dg/ipa/pr66616.C
new file mode 100644
index 00000000000..440ea6c6bfc
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ipa/pr66616.C
@@ -0,0 +1,54 @@
+// { dg-do run }
+// { dg-options "-O2 -fipa-cp-clone" }
+
+struct Distraction
+{
+ char fc[8];
+ virtual Distraction * return_self ()
+ { return this; }
+};
+
+static int go;
+
+struct A;
+
+struct A
+{
+ int fi;
+
+ A () : fi(0) {}
+ A (int pi) : fi (pi) {}
+ virtual void foo (int p) = 0;
+};
+
+struct B;
+
+struct B : public Distraction, A
+{
+ B () : Distraction(), A() { }
+ B (int pi) : Distraction (), A (pi) {}
+ virtual void foo (int p)
+ {
+ int o = fi;
+ for (int i = 0; i < p; i++)
+ o += i + i * i;
+ go = o;
+ }
+};
+
+struct B gb2 (2);
+
+extern "C" void abort (void);
+
+int
+main (void)
+{
+ for (int i = 0; i < 2; i++)
+ {
+ struct A *p = &gb2;
+ p->foo (0);
+ if (go != 2)
+ abort ();
+ }
+ return 0;
+}
diff --git a/gcc/testsuite/g++.dg/ipa/pr68851.C b/gcc/testsuite/g++.dg/ipa/pr68851.C
new file mode 100644
index 00000000000..659e4cdcc4a
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ipa/pr68851.C
@@ -0,0 +1,29 @@
+// { dg-do compile }
+// { dg-options "-O3" }
+
+class A;
+class B {
+public:
+ operator A *() const;
+};
+class A {
+public:
+ virtual bool isFormControlElement() const {}
+};
+class C {
+ struct D {
+ B element;
+ };
+ bool checkPseudoClass(const D &, int &) const;
+};
+class F {
+ virtual bool isFormControlElement() const;
+};
+class G : A, F {
+ bool isFormControlElement() const {}
+};
+bool C::checkPseudoClass(const D &p1, int &) const {
+ A &a = *p1.element;
+ a.isFormControlElement();
+ a.isFormControlElement() || a.isFormControlElement();
+}
diff --git a/gcc/testsuite/g++.dg/opt/pr69432.C b/gcc/testsuite/g++.dg/opt/pr69432.C
new file mode 100644
index 00000000000..1f23f2cedd6
--- /dev/null
+++ b/gcc/testsuite/g++.dg/opt/pr69432.C
@@ -0,0 +1,62 @@
+// PR target/69432
+// { dg-do compile }
+// { dg-options "-O3" }
+// { dg-additional-options "-minline-stringops-dynamically" { target i?86-*-* x86_64-*-* } }
+
+template <typename S, typename T, typename U>
+void
+f1 (S x, T y, U z)
+{
+ for (; y; --y, ++x)
+ *x = z;
+}
+
+template <typename S, typename T, typename U>
+void f2 (S x, T y, U z)
+{
+ f1 (x, y, z);
+}
+
+struct A {};
+struct B { static char f3 (A, unsigned); };
+
+template <typename S, typename U>
+void f4 (S, U);
+
+struct C
+{
+ template <typename S, typename T, typename U>
+ static S f5 (S x, T y, U z) { f2 (x, y, z); }
+};
+
+template <typename S, typename T, typename U>
+void f6 (S x, T y, U z) { C::f5 (x, y, z); }
+
+template <typename S, typename T, typename U, typename V>
+void f7 (S x, T y, U z, V) { f6 (x, y, z); }
+
+struct E
+{
+ struct D : A { char e; D (A); };
+ A f;
+ E (int x) : g(f) { f8 (x); }
+ ~E ();
+ D g;
+ void f9 (int x) { x ? B::f3 (g, x) : char (); }
+ void f8 (int x) { f9 (x); }
+};
+
+struct F : E
+{
+ F (int x) : E(x) { f10 (x); f4 (this, 0); }
+ char h;
+ void f10 (int x) { f7 (&g.e, x, h, 0); }
+};
+
+long a;
+
+void
+test ()
+{
+ F b(a);
+}
diff --git a/gcc/testsuite/g++.dg/other/PR23205.C b/gcc/testsuite/g++.dg/other/PR23205.C
index b05087b5420..65ba1f6f306 100644
--- a/gcc/testsuite/g++.dg/other/PR23205.C
+++ b/gcc/testsuite/g++.dg/other/PR23205.C
@@ -1,5 +1,4 @@
-/* { dg-do compile } */
-/* { dg-skip-if "No stabs" { aarch64*-*-* mmix-*-* *-*-aix* alpha*-*-* hppa*64*-*-* ia64-*-* nios2-*-* tile*-*-* *-*-vxworks } { "*" } { "" } } */
+/* { dg-do compile { target stabs } } */
/* { dg-options "-gstabs+ -fno-eliminate-unused-debug-types" } */
const int foobar = 4;
diff --git a/gcc/testsuite/g++.dg/other/pr23205-2.C b/gcc/testsuite/g++.dg/other/pr23205-2.C
index c7eefaa58c9..7b25c071a67 100644
--- a/gcc/testsuite/g++.dg/other/pr23205-2.C
+++ b/gcc/testsuite/g++.dg/other/pr23205-2.C
@@ -1,5 +1,4 @@
-/* { dg-do compile } */
-/* { dg-skip-if "No stabs" { aarch64*-*-* mmix-*-* *-*-aix* alpha*-*-* hppa*64*-*-* ia64-*-* tile*-*-* nios2-*-* } { "*" } { "" } } */
+/* { dg-do compile { target stabs } } */
/* { dg-options "-gstabs+ -fno-eliminate-unused-debug-types -ftoplevel-reorder" } */
const int foobar = 4;
diff --git a/gcc/testsuite/g++.dg/parse/pr71909.C b/gcc/testsuite/g++.dg/parse/pr71909.C
new file mode 100644
index 00000000000..ee592bf8e2b
--- /dev/null
+++ b/gcc/testsuite/g++.dg/parse/pr71909.C
@@ -0,0 +1,22 @@
+// PR c++/71909
+// { dg-do compile }
+
+struct S
+{
+ S () try : m (0) {}
+ catch (...) {}
+ void foo () try {}
+ catch (int) {}
+ catch (...) {}
+ int m;
+};
+
+struct T
+{
+ T () : m (0) {}
+ catch (...) {} // { dg-error "expected unqualified-id before" }
+ void foo () {}
+ catch (int) {} // { dg-error "expected unqualified-id before" }
+ catch (...) {} // { dg-error "expected unqualified-id before" }
+ int m;
+};
diff --git a/gcc/testsuite/g++.dg/pr70098.C b/gcc/testsuite/g++.dg/pr70098.C
new file mode 100644
index 00000000000..f5eb48f96e2
--- /dev/null
+++ b/gcc/testsuite/g++.dg/pr70098.C
@@ -0,0 +1,91 @@
+// PR target/70098
+// { dg-do compile }
+// { dg-options -O2 }
+// { dg-require-effective-target c++11 }
+// { dg-xfail-if "PR70098" { lp64 && powerpc64_no_dm } }
+// { dg-prune-output ".*internal compiler error.*" }
+
+template < typename > struct traits;
+template < typename, int _Rows, int _Cols, int = 0, int = _Rows,
+ int = _Cols > class Matrix;
+template < typename > class G;
+template < typename Derived > struct A {
+ typedef G < Derived > type;
+};
+
+template < typename Derived > class C {
+public:
+ enum { RowsAtCompileTime =
+ traits < Derived >::RowsAtCompileTime } static Zero;
+};
+
+template < typename Derived > class G:public C < Derived > {
+};
+
+template < int _Rows > class D {
+public:
+ long rows() {
+ return _Rows;
+ }
+};
+
+template < typename Derived > class PlainObjectBase:public A < Derived >::type {
+ typedef typename A < Derived >::type Base;
+ D < Base::RowsAtCompileTime > m_storage;
+
+public:
+ long rows() {
+ return m_storage.rows();
+ }
+};
+
+int fn1();
+
+struct B {
+ static long run(long x, long) {
+ int offset(fn1());
+ return x + offset;
+}};
+
+long fn2(int x)
+{
+ return B::run(x, 0);
+}
+
+template < typename _Scalar, int _Rows, int _Cols, int _Options, int _MaxRows,
+ int _MaxCols >
+ struct traits <Matrix < _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols >> {
+ enum { RowsAtCompileTime = _Rows };
+};
+
+template < typename, int, int, int, int _MaxRows, int _MaxCols >
+ class Matrix:public PlainObjectBase < Matrix < double, _MaxRows,
+ _MaxCols >> {
+public:
+ template < typename OtherDerived > Matrix(OtherDerived);
+};
+
+struct F {
+ static Matrix < double, 2, 2 > run(long size) {
+ Matrix < double, 2, 2 > diag = Matrix < double, 2, 2 >::Zero;
+ long i = 0;
+ while (i < size) {
+ long randomInt = fn2(-1);
+ if (randomInt == 0)
+ ++i;
+ else {
+ double alpha(randomInt);
+ diag = alpha;
+ i = 2;
+ }
+ }
+
+ return diag;
+ }
+};
+
+void fn3(Matrix < double, 2, 2 > m)
+{
+ long size = m.rows();
+ F::run(size);
+}
diff --git a/gcc/testsuite/g++.dg/pr71389.C b/gcc/testsuite/g++.dg/pr71389.C
new file mode 100644
index 00000000000..023abe1755c
--- /dev/null
+++ b/gcc/testsuite/g++.dg/pr71389.C
@@ -0,0 +1,23 @@
+// { dg-do compile { target i?86-*-* x86_64-*-* } }
+// { dg-options "-std=c++11 -O3 -march=ivybridge" }
+
+#include <functional>
+
+extern int le_s6, le_s9, le_s11;
+long foo_v14[16][16];
+
+void fn1() {
+ std::array<std::array<int, 16>, 16> v13;
+ for (; le_s6;)
+ for (int k1 = 2; k1 < 4; k1 = k1 + 1) {
+ for (int n1 = 0; n1 < le_s9; n1 = 8) {
+ *foo_v14[6] = 20923310;
+ for (int i2 = n1; i2 < n1 + 8; i2 = i2 + 1)
+ v13.at(5).at(i2 + 6 - n1) = 306146921;
+ }
+
+ for (int l2 = 0; l2 < le_s11; l2 = l2 + 1)
+ *(l2 + v13.at(5).begin()) = 306146921;
+ }
+ v13.at(le_s6 - 4);
+}
diff --git a/gcc/testsuite/g++.dg/rtti/typeid11.C b/gcc/testsuite/g++.dg/rtti/typeid11.C
new file mode 100644
index 00000000000..384b0f41705
--- /dev/null
+++ b/gcc/testsuite/g++.dg/rtti/typeid11.C
@@ -0,0 +1,16 @@
+// { dg-do run }
+
+#include <typeinfo>
+
+struct Base { virtual void foo() {} }; // polymorphic
+
+int main()
+{
+ Base b;
+ Base *ary[] = { &b, &b, &b};
+
+ int iter = 0;
+ typeid(*ary[iter++]);
+ if (iter != 1) // should be 1
+ __builtin_abort(); // but 2
+}
diff --git a/gcc/testsuite/g++.dg/template/pr67337.C b/gcc/testsuite/g++.dg/template/pr67337.C
new file mode 100644
index 00000000000..df2651bc9a5
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/pr67337.C
@@ -0,0 +1,25 @@
+template <class> class A
+{
+ void m_fn1 (int *, int);
+};
+
+template <class> class B
+{
+public:
+ typedef int Type;
+};
+
+template <class> class C
+{
+public:
+ C (int);
+ template <template <class> class T> void m_fn2 (typename T<void>::Type);
+};
+
+template <>
+void
+A<int>::m_fn1 (int *, int)
+{
+ C<int> a (0);
+ a.m_fn2<B> (0);
+}
diff --git a/gcc/testsuite/g++.dg/template/ptrmem30.C b/gcc/testsuite/g++.dg/template/ptrmem30.C
new file mode 100644
index 00000000000..31e9b5d17f6
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/ptrmem30.C
@@ -0,0 +1,45 @@
+// PR c++/70096
+// { dg-do run }
+
+int data_read;
+
+struct Holder
+{
+ void foo () { data_read = data; }
+ int data;
+};
+
+void
+poison_stack ()
+{
+ volatile char a[256];
+ __builtin_memset ((void *)a, 0xa, sizeof a);
+}
+
+template <typename F>
+void test1 ()
+{
+ Holder h;
+ h.data = 42;
+ F Holder::*fptr = &Holder::foo;
+ (h.*fptr)();
+}
+
+template <typename F>
+void test2 ()
+{
+ Holder h;
+ h.data = 42;
+ F Holder::*fptr1 = &Holder::foo;
+ F Holder::*fptr2 = fptr1;
+ (h.*fptr2)();
+}
+
+
+int main ()
+{
+ poison_stack ();
+ test1<void()>();
+ poison_stack ();
+ test2<void()>();
+}
diff --git a/gcc/testsuite/g++.dg/tm/pr71909.C b/gcc/testsuite/g++.dg/tm/pr71909.C
new file mode 100644
index 00000000000..941f2315170
--- /dev/null
+++ b/gcc/testsuite/g++.dg/tm/pr71909.C
@@ -0,0 +1,18 @@
+// PR c++/71909
+// { dg-do compile { target c++11 } }
+// { dg-options "-fgnu-tm" }
+
+struct S
+{
+ S () __transaction_atomic [[outer]] try : m {0} {} catch (int) {} catch (...) {}
+ int m;
+};
+
+struct T
+{
+ T () __transaction_atomic __attribute__((outer)) try : m {0} {} catch (int) {} catch (...) {}
+ int m;
+};
+
+void foo () __transaction_atomic [[outer]] try {} catch (int) {} catch (...) {}
+void bar () __transaction_atomic __attribute__((outer)) try {} catch (int) {} catch (...) {}
diff --git a/gcc/testsuite/g++.dg/torture/pr64280.C b/gcc/testsuite/g++.dg/torture/pr64280.C
new file mode 100644
index 00000000000..6ea31481bd5
--- /dev/null
+++ b/gcc/testsuite/g++.dg/torture/pr64280.C
@@ -0,0 +1,42 @@
+// { dg-do compile }
+
+class A
+{
+public:
+ A ();
+};
+class B
+{
+public:
+ B (int);
+ operator void *() { return m_fn1 () ? 0 : this; }
+ int m_fn1 ();
+};
+typedef int jmp_buf[];
+struct C
+{
+ jmp_buf cond_;
+};
+class F
+{
+ C what_;
+ bool m_fn2 ();
+};
+int _setjmp (int[]);
+void longjmp ();
+class D
+{
+public:
+ D () { longjmp (); }
+};
+bool
+F::m_fn2 ()
+{
+ B a (0);
+ if (a)
+ if (_setjmp (what_.cond_))
+ return 0;
+ else
+ D ();
+ A b;
+}
diff --git a/gcc/testsuite/g++.dg/torture/pr71452.C b/gcc/testsuite/g++.dg/torture/pr71452.C
new file mode 100644
index 00000000000..3ebe3a176f3
--- /dev/null
+++ b/gcc/testsuite/g++.dg/torture/pr71452.C
@@ -0,0 +1,10 @@
+// { dg-do run }
+
+int main()
+{
+ bool b;
+ *(char *)&b = 123;
+ if (*(char *)&b != 123)
+ __builtin_abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/g++.dg/torture/pr71874.C b/gcc/testsuite/g++.dg/torture/pr71874.C
new file mode 100644
index 00000000000..d9b4e2f8849
--- /dev/null
+++ b/gcc/testsuite/g++.dg/torture/pr71874.C
@@ -0,0 +1,12 @@
+// PR middle-end/71874
+// { dg-do run }
+
+int
+main ()
+{
+ char str[] = "abcdefghijklmnopqrstuvwxyzABCDEF";
+ __builtin_memmove (str + 20, str + 15, 11);
+ if (__builtin_strcmp (str, "abcdefghijklmnopqrstpqrstuvwxyzF") != 0)
+ __builtin_abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr69214.c b/gcc/testsuite/gcc.c-torture/compile/pr69214.c
new file mode 100644
index 00000000000..61728f51a48
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/pr69214.c
@@ -0,0 +1,17 @@
+/* PR tree-optimization/69214 */
+
+extern void bar (void);
+extern int __setjmp (char *);
+
+void
+foo (char *p)
+{
+ int d = 0;
+ bar ();
+ if (__setjmp (p))
+ return;
+ long a = d;
+ d = 8;
+ if (!a)
+ bar ();
+}
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr71693.c b/gcc/testsuite/gcc.c-torture/compile/pr71693.c
new file mode 100644
index 00000000000..fc9249c922c
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/pr71693.c
@@ -0,0 +1,10 @@
+/* PR middle-end/71693 */
+
+unsigned short v;
+
+void
+foo (int x)
+{
+ v = ((((unsigned short) (0x0001 | (x & 0x0070) | 0x0100) & 0x00ffU) << 8)
+ | (((unsigned short) (0x0001 | (x & 0x0070) | 0x0100) >> 8) & 0x00ffU));
+}
diff --git a/gcc/testsuite/gcc.c-torture/execute/builtins/memops-asm.x b/gcc/testsuite/gcc.c-torture/execute/builtins/memops-asm.x
new file mode 100644
index 00000000000..031049dc812
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/builtins/memops-asm.x
@@ -0,0 +1,10 @@
+# Different translation units may have different user name overrides
+# and we do not preserve enough context to known which one we want.
+
+set torture_eval_before_compile {
+ if {[string match {*-flto*} "$option"]} {
+ continue
+ }
+}
+
+return 0
diff --git a/gcc/testsuite/gcc.c-torture/execute/builtins/strstr-asm.c b/gcc/testsuite/gcc.c-torture/execute/builtins/strstr-asm.c
index 41678412b63..3c3e45dfa5d 100644
--- a/gcc/testsuite/gcc.c-torture/execute/builtins/strstr-asm.c
+++ b/gcc/testsuite/gcc.c-torture/execute/builtins/strstr-asm.c
@@ -2,7 +2,6 @@
Ensure all expected transformations of builtin strstr occur and
perform correctly in presence of redirect. */
-/* { dg-options "-ffat-lto-objects" } */
#define ASMNAME(cname) ASMNAME2 (__USER_LABEL_PREFIX__, cname)
#define ASMNAME2(prefix, cname) STRING (prefix) cname
diff --git a/gcc/testsuite/gcc.c-torture/execute/builtins/strstr-asm.x b/gcc/testsuite/gcc.c-torture/execute/builtins/strstr-asm.x
new file mode 100644
index 00000000000..031049dc812
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/builtins/strstr-asm.x
@@ -0,0 +1,10 @@
+# Different translation units may have different user name overrides
+# and we do not preserve enough context to known which one we want.
+
+set torture_eval_before_compile {
+ if {[string match {*-flto*} "$option"]} {
+ continue
+ }
+}
+
+return 0
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr67226.c b/gcc/testsuite/gcc.c-torture/execute/pr67226.c
new file mode 100644
index 00000000000..c533496cbc6
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/pr67226.c
@@ -0,0 +1,42 @@
+struct assembly_operand
+{
+ int type, value, symtype, symflags, marker;
+};
+
+struct assembly_operand to_input, from_input;
+
+void __attribute__ ((__noinline__, __noclone__))
+assemblez_1 (int internal_number, struct assembly_operand o1)
+{
+ if (o1.type != from_input.type)
+ __builtin_abort ();
+}
+
+void __attribute__ ((__noinline__, __noclone__))
+t0 (struct assembly_operand to, struct assembly_operand from)
+{
+ if (to.value == 0)
+ assemblez_1 (32, from);
+ else
+ __builtin_abort ();
+}
+
+int
+main (void)
+{
+ to_input.value = 0;
+ to_input.type = 1;
+ to_input.symtype = 2;
+ to_input.symflags = 3;
+ to_input.marker = 4;
+
+ from_input.value = 5;
+ from_input.type = 6;
+ from_input.symtype = 7;
+ from_input.symflags = 8;
+ from_input.marker = 9;
+
+ t0 (to_input, from_input);
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr67929_1.c b/gcc/testsuite/gcc.c-torture/execute/pr67929_1.c
new file mode 100644
index 00000000000..ae6cfbf3378
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/pr67929_1.c
@@ -0,0 +1,15 @@
+int __attribute__ ((noinline, noclone))
+foo (float a)
+{
+ return a * 4.9f;
+}
+
+
+int
+main (void)
+{
+ if (foo (10.0f) != 49)
+ __builtin_abort ();
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr68185.c b/gcc/testsuite/gcc.c-torture/execute/pr68185.c
new file mode 100644
index 00000000000..826531bf71b
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/pr68185.c
@@ -0,0 +1,29 @@
+int a, b, d = 1, e, f, o, u, w = 1, z;
+short c, q, t;
+
+int
+main ()
+{
+ char g;
+ for (; d; d--)
+ {
+ while (o)
+ for (; e;)
+ {
+ c = b;
+ int h = o = z;
+ for (; u;)
+ for (; a;)
+ ;
+ }
+ if (t < 1)
+ g = w;
+ f = g;
+ g && (q = 1);
+ }
+
+ if (q != 1)
+ __builtin_abort ();
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr68328.c b/gcc/testsuite/gcc.c-torture/execute/pr68328.c
new file mode 100644
index 00000000000..edf244bb356
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/pr68328.c
@@ -0,0 +1,44 @@
+int a, b, c = 1, d = 1, e;
+
+__attribute__ ((noinline, noclone))
+ int foo (void)
+{
+ asm volatile ("":::"memory");
+ return 4195552;
+}
+
+__attribute__ ((noinline, noclone))
+ void bar (int x, int y)
+{
+ asm volatile (""::"g" (x), "g" (y):"memory");
+ if (y == 0)
+ __builtin_abort ();
+}
+
+int
+baz (int x)
+{
+ char g, h;
+ int i, j;
+
+ foo ();
+ for (;;)
+ {
+ if (c)
+ h = d;
+ g = h < x ? h : 0;
+ i = (signed char) ((unsigned char) (g - 120) ^ 1);
+ j = i > 97;
+ if (a - j)
+ bar (0x123456, 0);
+ if (!b)
+ return e;
+ }
+}
+
+int
+main ()
+{
+ baz (2);
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr68376-1.c b/gcc/testsuite/gcc.c-torture/execute/pr68376-1.c
new file mode 100644
index 00000000000..cb52657646c
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/pr68376-1.c
@@ -0,0 +1,24 @@
+/* PR rtl-optimization/68376 */
+
+int a, b, c = 1;
+signed char d;
+
+int
+main ()
+{
+ for (; a < 1; a++)
+ for (; b < 1; b++)
+ {
+ signed char e = ~d;
+ if (d < 1)
+ e = d;
+ d = e;
+ if (!c)
+ __builtin_abort ();
+ }
+
+ if (d != 0)
+ __builtin_abort ();
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr68376-2.c b/gcc/testsuite/gcc.c-torture/execute/pr68376-2.c
new file mode 100644
index 00000000000..963d441b53f
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/pr68376-2.c
@@ -0,0 +1,73 @@
+/* PR rtl-optimization/68376 */
+
+extern void abort (void);
+
+__attribute__((noinline, noclone)) int
+f1 (int x)
+{
+ return x < 0 ? ~x : x;
+}
+
+__attribute__((noinline, noclone)) int
+f2 (int x)
+{
+ return x < 0 ? x : ~x;
+}
+
+__attribute__((noinline, noclone)) int
+f3 (int x)
+{
+ return x <= 0 ? ~x : x;
+}
+
+__attribute__((noinline, noclone)) int
+f4 (int x)
+{
+ return x <= 0 ? x : ~x;
+}
+
+__attribute__((noinline, noclone)) int
+f5 (int x)
+{
+ return x >= 0 ? ~x : x;
+}
+
+__attribute__((noinline, noclone)) int
+f6 (int x)
+{
+ return x >= 0 ? x : ~x;
+}
+
+__attribute__((noinline, noclone)) int
+f7 (int x)
+{
+ return x > 0 ? ~x : x;
+}
+
+__attribute__((noinline, noclone)) int
+f8 (int x)
+{
+ return x > 0 ? x : ~x;
+}
+
+int
+main ()
+{
+ if (f1 (5) != 5 || f1 (-5) != 4 || f1 (0) != 0)
+ abort ();
+ if (f2 (5) != -6 || f2 (-5) != -5 || f2 (0) != -1)
+ abort ();
+ if (f3 (5) != 5 || f3 (-5) != 4 || f3 (0) != -1)
+ abort ();
+ if (f4 (5) != -6 || f4 (-5) != -5 || f4 (0) != 0)
+ abort ();
+ if (f5 (5) != -6 || f5 (-5) != -5 || f5 (0) != -1)
+ abort ();
+ if (f6 (5) != 5 || f6 (-5) != 4 || f6 (0) != 0)
+ abort ();
+ if (f7 (5) != -6 || f7 (-5) != -5 || f7 (0) != 0)
+ abort ();
+ if (f8 (5) != 5 || f8 (-5) != 4 || f8 (0) != -1)
+ abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr69403.c b/gcc/testsuite/gcc.c-torture/execute/pr69403.c
new file mode 100644
index 00000000000..097d366079d
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/pr69403.c
@@ -0,0 +1,20 @@
+/* PR target/69403. */
+
+int a, b, c;
+
+__attribute__ ((__noinline__)) int
+fn1 ()
+{
+ if ((b | (a != (a & c))) == 1)
+ __builtin_abort ();
+ return 0;
+}
+
+int
+main (void)
+{
+ a = 5;
+ c = 1;
+ b = 6;
+ return fn1 ();
+}
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr70222-1.c b/gcc/testsuite/gcc.c-torture/execute/pr70222-1.c
new file mode 100644
index 00000000000..d79672e7fb4
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/pr70222-1.c
@@ -0,0 +1,30 @@
+/* PR rtl-optimization/70222 */
+
+int a = 1;
+unsigned int b = 2;
+int c = 0;
+int d = 0;
+
+void
+foo ()
+{
+ int e = ((-(c >= c)) < b) > ((int) (-1ULL >> ((a / a) * 15)));
+ d = -e;
+}
+
+__attribute__((noinline, noclone)) void
+bar (int x)
+{
+ if (x != -1)
+ __builtin_abort ();
+}
+
+int
+main ()
+{
+#if __CHAR_BIT__ == 8 && __SIZEOF_INT__ == 4 && __SIZEOF_LONG_LONG__ == 8
+ foo ();
+ bar (d);
+#endif
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr70222-2.c b/gcc/testsuite/gcc.c-torture/execute/pr70222-2.c
new file mode 100644
index 00000000000..7611c986a9b
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/pr70222-2.c
@@ -0,0 +1,20 @@
+/* PR rtl-optimization/70222 */
+
+#if __CHAR_BIT__ == 8 && __SIZEOF_INT__ == 4 && __SIZEOF_LONG_LONG__ == 8
+__attribute__((noinline, noclone)) unsigned int
+foo (int x)
+{
+ unsigned long long y = -1ULL >> x;
+ return (unsigned int) y >> 31;
+}
+#endif
+
+int
+main ()
+{
+#if __CHAR_BIT__ == 8 && __SIZEOF_INT__ == 4 && __SIZEOF_LONG_LONG__ == 8
+ if (foo (15) != 1 || foo (32) != 1 || foo (33) != 0)
+ __builtin_abort ();
+#endif
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr70429.c b/gcc/testsuite/gcc.c-torture/execute/pr70429.c
new file mode 100644
index 00000000000..6b08c8ead08
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/pr70429.c
@@ -0,0 +1,17 @@
+/* PR rtl-optimization/70429 */
+
+__attribute__((noinline, noclone)) int
+foo (int a)
+{
+ return (int) (0x14ff6e2207db5d1fLL >> a) >> 4;
+}
+
+int
+main ()
+{
+ if (sizeof (int) != 4 || sizeof (long long) != 8 || __CHAR_BIT__ != 8)
+ return 0;
+ if (foo (1) != 0x3edae8 || foo (2) != -132158092)
+ __builtin_abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr70460.c b/gcc/testsuite/gcc.c-torture/execute/pr70460.c
new file mode 100644
index 00000000000..bfecea0932e
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/pr70460.c
@@ -0,0 +1,29 @@
+/* PR rtl-optimization/70460 */
+
+int c;
+
+__attribute__((noinline, noclone)) void
+foo (int x)
+{
+ static int b[] = { &&lab1 - &&lab0, &&lab2 - &&lab0 };
+ void *a = &&lab0 + b[x];
+ goto *a;
+lab1:
+ c += 2;
+lab2:
+ c++;
+lab0:
+ ;
+}
+
+int
+main ()
+{
+ foo (0);
+ if (c != 3)
+ __builtin_abort ();
+ foo (1);
+ if (c != 4)
+ __builtin_abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr70566.c b/gcc/testsuite/gcc.c-torture/execute/pr70566.c
new file mode 100644
index 00000000000..f47106e70c7
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/pr70566.c
@@ -0,0 +1,47 @@
+/* PR target/70566. */
+
+#define NULL 0
+
+struct mystruct
+{
+ unsigned int f1 : 1;
+ unsigned int f2 : 1;
+ unsigned int f3 : 1;
+};
+
+__attribute__ ((noinline)) void
+myfunc (int a, void *b)
+{
+}
+__attribute__ ((noinline)) int
+myfunc2 (void *a)
+{
+ return 0;
+}
+
+static void
+set_f2 (struct mystruct *user, int f2)
+{
+ if (user->f2 != f2)
+ myfunc (myfunc2 (NULL), NULL);
+ else
+ __builtin_abort ();
+}
+
+__attribute__ ((noinline)) void
+foo (void *data)
+{
+ struct mystruct *user = data;
+ if (!user->f2)
+ set_f2 (user, 1);
+}
+
+int
+main (void)
+{
+ struct mystruct a;
+ a.f1 = 1;
+ a.f2 = 0;
+ foo (&a);
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr71494.c b/gcc/testsuite/gcc.c-torture/execute/pr71494.c
new file mode 100644
index 00000000000..f962f2c2e21
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/pr71494.c
@@ -0,0 +1,22 @@
+/* PR middle-end/71494 */
+
+int
+main ()
+{
+ void *label = &&out;
+ int i = 0;
+ void test (void)
+ {
+ label = &&out2;
+ goto *label;
+ out2:;
+ i++;
+ }
+ goto *label;
+ out:
+ i += 2;
+ test ();
+ if (i != 3)
+ __builtin_abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr71626-1.c b/gcc/testsuite/gcc.c-torture/execute/pr71626-1.c
new file mode 100644
index 00000000000..26cfa9650e0
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/pr71626-1.c
@@ -0,0 +1,19 @@
+/* PR middle-end/71626 */
+
+typedef __INTPTR_TYPE__ V __attribute__((__vector_size__(sizeof (__INTPTR_TYPE__))));
+
+__attribute__((noinline, noclone)) V
+foo ()
+{
+ V v = { (__INTPTR_TYPE__) foo };
+ return v;
+}
+
+int
+main ()
+{
+ V v = foo ();
+ if (v[0] != (__INTPTR_TYPE__) foo)
+ __builtin_abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr71626-2.c b/gcc/testsuite/gcc.c-torture/execute/pr71626-2.c
new file mode 100644
index 00000000000..4a27c54fbf3
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/pr71626-2.c
@@ -0,0 +1,4 @@
+/* PR middle-end/71626 */
+/* { dg-additional-options "-fpic" { target fpic } } */
+
+#include "pr71626-1.c"
diff --git a/gcc/testsuite/gcc.dg/20040813-1.c b/gcc/testsuite/gcc.dg/20040813-1.c
index 8be831d96b6..9cf664dd769 100644
--- a/gcc/testsuite/gcc.dg/20040813-1.c
+++ b/gcc/testsuite/gcc.dg/20040813-1.c
@@ -1,8 +1,7 @@
/* Test lang in N_SO stab. */
/* Contributed by Devang Patel <dpatel@apple.com> */
-/* { dg-do compile } */
-/* { dg-skip-if "No stabs" { aarch64*-*-* mmix-*-* *-*-aix* alpha*-*-* hppa*64*-*-* ia64-*-* tile*-*-* nios2-*-* *-*-vxworks* } { "*" } { "" } } */
+/* { dg-do compile { target stabs } } */
/* { dg-options "-gstabs" } */
int
diff --git a/gcc/testsuite/gcc.dg/and-1.c b/gcc/testsuite/gcc.dg/and-1.c
index c66e4e15fac..cf7974f7c16 100644
--- a/gcc/testsuite/gcc.dg/and-1.c
+++ b/gcc/testsuite/gcc.dg/and-1.c
@@ -1,8 +1,8 @@
/* { dg-do compile } */
/* { dg-options "-O2" } */
/* { dg-final { scan-assembler "and" { target powerpc*-*-* spu-*-* } } } */
-/* There should be no nand for this testcase (for either PPC or SPU). */
-/* { dg-final { scan-assembler-not "nand" { target powerpc*-*-* spu-*-* } } } */
+/* There should be no nand for this testcase for SPU. */
+/* { dg-final { scan-assembler-not "nand" { target spu-*-* } } } */
int f(int y)
{
diff --git a/gcc/testsuite/gcc.dg/autopar/pr69110.c b/gcc/testsuite/gcc.dg/autopar/pr69110.c
new file mode 100644
index 00000000000..438281dd990
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/autopar/pr69110.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -ftree-parallelize-loops=2 -fno-tree-loop-im -fdump-tree-parloops-details" } */
+
+#define N 1000
+
+unsigned int i = 0;
+
+void
+foo (void)
+{
+ unsigned int z;
+ for (z = 0; z < N; ++z)
+ ++i;
+}
+
+/* { dg-final { scan-tree-dump-times "SUCCESS: may be parallelized" 0 "parloops" } } */
+/* { dg-final { scan-tree-dump-times "FAILED: data dependencies exist across iterations" 1 "parloops" } } */
diff --git a/gcc/testsuite/gcc.dg/darwin-20040809-2.c b/gcc/testsuite/gcc.dg/darwin-20040809-2.c
index a38f75f26b7..98d571276d0 100644
--- a/gcc/testsuite/gcc.dg/darwin-20040809-2.c
+++ b/gcc/testsuite/gcc.dg/darwin-20040809-2.c
@@ -1,7 +1,7 @@
/* Test dead code strip support. */
/* Contributed by Devang Patel <dpatel@apple.com> */
-/* { dg-do compile { target *-*-darwin* } } */
+/* { dg-do compile { target { *-*-darwin* && stabs } } } */
/* { dg-options "-gstabs+ -fno-eliminate-unused-debug-symbols" } */
int
diff --git a/gcc/testsuite/gcc.dg/debug/pr66432.c b/gcc/testsuite/gcc.dg/debug/pr66432.c
new file mode 100644
index 00000000000..cf36799f3aa
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/debug/pr66432.c
@@ -0,0 +1,19 @@
+/* PR debug/66432 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -g" } */
+
+extern void baz (const char *, const char *) __attribute__ ((__noreturn__));
+
+void
+foo (int x, int y[x][x])
+{
+ if (x < 2)
+ baz ("", "");
+}
+
+void
+bar (void)
+{
+ int z[2][2] = { { 1, 2 }, { 3, 4 } };
+ foo (2, z);
+}
diff --git a/gcc/testsuite/gcc.dg/ipa/ipa-sra-10.c b/gcc/testsuite/gcc.dg/ipa/ipa-sra-10.c
new file mode 100644
index 00000000000..24b64d1234a
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/ipa/ipa-sra-10.c
@@ -0,0 +1,34 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fipa-sra -fdump-tree-eipa_sra-details" } */
+
+extern void consume (int);
+extern int glob, glob1, glob2;
+extern int get (void);
+
+
+static void __attribute__ ((noinline))
+foo (int a)
+{
+ a = glob;
+ consume (a);
+ a = get ();
+ consume (a);
+ __asm__ volatile("" : : ""(a));
+ consume (a);
+
+ if (glob1)
+ a = glob1;
+ else
+ a = glob2;
+ consume (a);
+}
+
+int
+bar (int a)
+{
+ foo (a);
+ glob = a;
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "replacing an SSA name of a removed param" 4 "eipa_sra" } } */
diff --git a/gcc/testsuite/gcc.dg/ipa/pr70646.c b/gcc/testsuite/gcc.dg/ipa/pr70646.c
new file mode 100644
index 00000000000..f85816e7303
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/ipa/pr70646.c
@@ -0,0 +1,40 @@
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+
+#pragma GCC optimize("no-unit-at-a-time")
+
+typedef unsigned char u8;
+typedef unsigned long long u64;
+
+static inline __attribute__((always_inline)) u64 __swab64p(const u64 *p)
+{
+ return (__builtin_constant_p((u64)(*p)) ? ((u64)( (((u64)(*p) & (u64)0x00000000000000ffULL) << 56) | (((u64)(*p) & (u64)0x000000000000ff00ULL) << 40) | (((u64)(*p) & (u64)0x0000000000ff0000ULL) << 24) | (((u64)(*p) & (u64)0x00000000ff000000ULL) << 8) | (((u64)(*p) & (u64)0x000000ff00000000ULL) >> 8) | (((u64)(*p) & (u64)0x0000ff0000000000ULL) >> 24) | (((u64)(*p) & (u64)0x00ff000000000000ULL) >> 40) | (((u64)(*p) & (u64)0xff00000000000000ULL) >> 56))) : __builtin_bswap64(*p));
+}
+
+static inline u64 wwn_to_u64(void *wwn)
+{
+ return __swab64p(wwn);
+}
+
+void __attribute__((noinline,noclone)) broken(u64* shost)
+{
+ u8 node_name[8] = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF};
+ *shost = wwn_to_u64(node_name);
+}
+
+void __attribute__((noinline,noclone)) dummy(void)
+{
+ __builtin_abort();
+}
+
+int main(int argc, char* argv[])
+{
+ u64 v;
+
+ broken(&v);
+
+ if(v != (u64)-1)
+ __builtin_abort();
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/lto/simd-function_0.c b/gcc/testsuite/gcc.dg/lto/simd-function_0.c
new file mode 100644
index 00000000000..cda31aafb2e
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/simd-function_0.c
@@ -0,0 +1,34 @@
+/* { dg-lto-do link } */
+/* { dg-require-effective-target avx2 } */
+/* { dg-lto-options { { -fopenmp-simd -O3 -ffast-math -mavx2 -flto -flto-partition=max } } } */
+
+#define SIZE 4096
+float x[SIZE];
+
+
+#pragma omp declare simd
+float
+__attribute__ ((noinline))
+my_mul (float x, float y) {
+ return x * y;
+}
+
+__attribute__ ((noinline))
+int foo ()
+{
+ int i = 0;
+#pragma omp simd safelen (16)
+ for (i = 0; i < SIZE; i++)
+ x[i] = my_mul ((float)i, 9932.3323);
+ return (int)x[0];
+}
+
+int main ()
+{
+ int i = 0;
+ for (i = 0; i < SIZE; i++)
+ x[i] = my_mul ((float) i, 9932.3323);
+ foo ();
+ return (int)x[0];
+}
+
diff --git a/gcc/testsuite/gcc.dg/pr68670-1.c b/gcc/testsuite/gcc.dg/pr68670-1.c
new file mode 100644
index 00000000000..92c28a0a4af
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr68670-1.c
@@ -0,0 +1,5 @@
+/* PR rtl-optimization/68670 */
+/* { dg-do run } */
+/* { dg-options "-O2 -ftracer" } */
+
+#include "../gcc.c-torture/execute/pr68376-1.c"
diff --git a/gcc/testsuite/gcc.dg/pr68670-2.c b/gcc/testsuite/gcc.dg/pr68670-2.c
new file mode 100644
index 00000000000..903e33e1f30
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr68670-2.c
@@ -0,0 +1,5 @@
+/* PR rtl-optimization/68670 */
+/* { dg-do run } */
+/* { dg-options "-O2 -ftracer" } */
+
+#include "../gcc.c-torture/execute/pr68376-2.c"
diff --git a/gcc/testsuite/gcc.dg/pr69015.c b/gcc/testsuite/gcc.dg/pr69015.c
new file mode 100644
index 00000000000..9e75db9d0e7
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr69015.c
@@ -0,0 +1,10 @@
+/* PR target/69015 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fno-if-conversion" } */
+
+void
+foo (int c)
+{
+ if (c)
+ __builtin_trap ();
+}
diff --git a/gcc/testsuite/gcc.dg/pr69195.c b/gcc/testsuite/gcc.dg/pr69195.c
new file mode 100644
index 00000000000..af373a1223e
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr69195.c
@@ -0,0 +1,27 @@
+/* { dg-do run } */
+/* { dg-options "-O3 -fno-dce -fno-forward-propagate" } */
+
+void __attribute__ ((noinline, noclone))
+foo (int *a, int n)
+{
+ int *lasta = a + n;
+ for (; a != lasta; a++)
+ {
+ *a *= 2;
+ a[1] = a[-1] + a[-2];
+ }
+}
+
+int
+main ()
+{
+ int a[16] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 };
+ int r[16] = { 1, 2, 6, 6, 16, 24, 44, 80,
+ 136, 248, 432, 768, 1360, 2400, 4256, 3760 };
+ unsigned i;
+ foo (&a[2], 13);
+ for (i = 0; i < 8; ++i)
+ if (a[i] != r[i])
+ __builtin_abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/pr69238.c b/gcc/testsuite/gcc.dg/pr69238.c
new file mode 100644
index 00000000000..3538e634429
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr69238.c
@@ -0,0 +1,28 @@
+/* { dg-do run } */
+/* { dg-options "-O2 -fno-dce -fno-forward-propagate -fno-rerun-cse-after-loop -funroll-loops" } */
+
+
+#define N 32
+
+short sa[N];
+short sb[N];
+int ia[N];
+int ib[N];
+
+int __attribute__ ((noinline, noclone))
+main1 (int n)
+{
+ int i;
+ for (i = 0; i < n; i++)
+ {
+ sa[i+7] = sb[i];
+ ia[i+3] = ib[i+1];
+ }
+ return 0;
+}
+
+int
+main (void)
+{
+ return main1 (N-7);
+}
diff --git a/gcc/testsuite/gcc.dg/pr69522.c b/gcc/testsuite/gcc.dg/pr69522.c
new file mode 100644
index 00000000000..820168d221d
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr69522.c
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+/* { dg-options "" } */
+struct str {};
+struct {
+ struct str b;
+ float c[1];
+ int d[1];
+ float e[2];
+ int f[1];
+} a = {{}, 0, {0.5}, 0, 0, {0}};
diff --git a/gcc/testsuite/gcc.dg/pr69644.c b/gcc/testsuite/gcc.dg/pr69644.c
new file mode 100644
index 00000000000..c60b1917029
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr69644.c
@@ -0,0 +1,11 @@
+/* PR target/69644 */
+/* { dg-do compile } */
+
+int
+main ()
+{
+ unsigned short x = 0x8000;
+ if (!__sync_bool_compare_and_swap (&x, 0x8000, 0) || x)
+ __builtin_abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/pr69802.c b/gcc/testsuite/gcc.dg/pr69802.c
new file mode 100644
index 00000000000..27ee02f36b5
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr69802.c
@@ -0,0 +1,23 @@
+/* PR tree-optimization/69802 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -Wall" } */
+
+struct S { unsigned f : 1; };
+int a, d;
+
+int
+foo (void)
+{
+ unsigned b = 0;
+ struct S c;
+ d = ((1 && b) < c.f) & c.f; /* { dg-warning "is used uninitialized" } */
+ return a;
+}
+
+int
+bar (_Bool c)
+{
+ unsigned b = 0;
+ d = ((1 && b) < c) & c;
+ return a;
+}
diff --git a/gcc/testsuite/gcc.dg/pr70022.c b/gcc/testsuite/gcc.dg/pr70022.c
new file mode 100644
index 00000000000..30eb7ece250
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr70022.c
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+/* { dg-options "-w -Wno-psabi" } */
+
+typedef int v4si __attribute__ ((vector_size (16)));
+
+int
+foo (v4si v)
+{
+ return v[~0UL];
+}
diff --git a/gcc/testsuite/gcc.dg/pr70152.c b/gcc/testsuite/gcc.dg/pr70152.c
new file mode 100644
index 00000000000..27a092d199a
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr70152.c
@@ -0,0 +1,27 @@
+/* PR tree-optimization/70152 */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+int a;
+int foo (void);
+int setjmp (char *);
+char buf[64];
+
+static int
+bar (int x)
+{
+ x = 0;
+ setjmp (buf);
+ for (;;)
+ {
+ switch (x)
+ case 5:
+ x = foo ();
+ }
+}
+
+void
+baz (void)
+{
+ bar (a);
+}
diff --git a/gcc/testsuite/gcc.dg/pr70161-2.c b/gcc/testsuite/gcc.dg/pr70161-2.c
new file mode 100644
index 00000000000..d2cb22140c3
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr70161-2.c
@@ -0,0 +1,7 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-ipa-all-graph -fipa-pta" } */
+
+void
+foo (void)
+{
+}
diff --git a/gcc/testsuite/gcc.dg/pr70161.c b/gcc/testsuite/gcc.dg/pr70161.c
new file mode 100644
index 00000000000..0b173c7ee9d
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr70161.c
@@ -0,0 +1,7 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-ipa-all-graph" } */
+
+void
+foo (void)
+{
+}
diff --git a/gcc/testsuite/gcc.dg/pr70169.c b/gcc/testsuite/gcc.dg/pr70169.c
new file mode 100644
index 00000000000..8d08f5c6472
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr70169.c
@@ -0,0 +1,40 @@
+/* PR tree-optimization/70169 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fno-strict-aliasing -fno-tree-dce" } */
+
+int printf (const char *, ...);
+
+void
+foo ()
+{
+ unsigned char *p = (unsigned char *) &printf;
+ for (;;)
+ (*p)++;
+}
+
+void
+bar (int x)
+{
+ unsigned char *p = (unsigned char *) &printf;
+ int i;
+ for (i = 0; i < x; i++)
+ (*p)++;
+}
+
+void
+baz (int x, int y)
+{
+ unsigned char *p = (unsigned char *) &&lab;
+ int i;
+ if (y)
+ {
+ for (i = 0; i < x; i++)
+ (*p)++;
+ }
+ else
+ {
+ lab:
+ asm volatile ("");
+ foo ();
+ }
+}
diff --git a/gcc/testsuite/gcc.dg/pr71558.c b/gcc/testsuite/gcc.dg/pr71558.c
new file mode 100644
index 00000000000..33a648e108c
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr71558.c
@@ -0,0 +1,17 @@
+/* PR tree-optimization/71588 */
+
+/* strcpy must not be pure, but make sure we don't ICE even when
+ it is declared incorrectly. */
+char *strcpy (char *, const char *) __attribute__ ((__pure__));
+__SIZE_TYPE__ strlen (const char *);
+void *malloc (__SIZE_TYPE__);
+
+char a[20];
+
+char *
+foo (void)
+{
+ __SIZE_TYPE__ b = strlen (a);
+ char *c = malloc (b);
+ return strcpy (c, a);
+}
diff --git a/gcc/testsuite/gcc.dg/setjmp-6.c b/gcc/testsuite/gcc.dg/setjmp-6.c
new file mode 100644
index 00000000000..0781f055952
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/setjmp-6.c
@@ -0,0 +1,25 @@
+/* PR69569 */
+/* { dg-do compile } */
+/* { dg-options "-O3" } */
+
+#include <setjmp.h>
+
+jmp_buf buf;
+
+struct str {
+ int Count;
+};
+int fun2(struct str *p1)
+{
+ int i = 1;
+ while (1) {
+ setjmp(buf);
+ break;
+ }
+ for (; i;) {
+ i = 0;
+ for (; i < (p1 ? p1->Count : 1); i++)
+ fun2(p1);
+ }
+ return 1;
+}
diff --git a/gcc/testsuite/gcc.dg/torture/pr29119.c b/gcc/testsuite/gcc.dg/torture/pr29119.c
index 63e5d8693a9..d4f02f12456 100644
--- a/gcc/testsuite/gcc.dg/torture/pr29119.c
+++ b/gcc/testsuite/gcc.dg/torture/pr29119.c
@@ -2,6 +2,5 @@
void ldt_add_entry(void)
{
- __asm__ ("" :: "m"(({unsigned __v; __v;})));
+ __asm__ ("" :: "m"(({unsigned __v; __v;}))); /* { dg-warning "memory input 0 is not directly addressable" } */
}
-
diff --git a/gcc/testsuite/gcc.dg/torture/pr64091.c b/gcc/testsuite/gcc.dg/torture/pr64091.c
new file mode 100644
index 00000000000..0cd994aede8
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr64091.c
@@ -0,0 +1,28 @@
+/* { dg-do compile } */
+/* { dg-additional-options "-g" } */
+
+extern int foo(void);
+
+int main(void)
+{
+ int i, a, b;
+
+ if (foo())
+ return 0;
+
+ for (i = 0, a = 0, b = 0; i < 3; i++, a++)
+ {
+ if (foo())
+ break;
+
+ if (b += a)
+ a = 0;
+ }
+
+ if (!a)
+ return 2;
+
+ b += a;
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/torture/pr64882.c b/gcc/testsuite/gcc.dg/torture/pr64882.c
new file mode 100644
index 00000000000..462edace1b9
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr64882.c
@@ -0,0 +1,33 @@
+/* PR target/64882 */
+/* { dg-do compile } */
+
+int a, d, e;
+long long b;
+static long long *c = &b;
+
+void
+fn1 (short p)
+{
+}
+
+long long
+fn2 (long long p1, long long p2)
+{
+ return (p1 && p1 > 26854775807LL - p2) || p1 < -p2 ? p1 : p1 + p2;
+}
+
+void
+fn3 ()
+{
+ long long f;
+ int g = 3;
+ int *h = &a;
+ for (e = 0; e < 2; e++)
+ {
+ int *i = &g;
+ if (!fn2 (*c, 7 < d % (*i)--))
+ f = fn2 ((*h <= 0) | b, 5278350700LL);
+ *h = f;
+ fn1 (*h);
+ }
+}
diff --git a/gcc/testsuite/gcc.dg/torture/pr66375.c b/gcc/testsuite/gcc.dg/torture/pr66375.c
new file mode 100644
index 00000000000..2447b43c17b
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr66375.c
@@ -0,0 +1,13 @@
+/* { dg-do run } */
+
+int a;
+extern void abort (void);
+int main ()
+{
+ int c = 0;
+ for (; a < 13; ++a)
+ c = (signed char)c - 11;
+ if (c != 113)
+ abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/torture/pr66413.c b/gcc/testsuite/gcc.dg/torture/pr66413.c
new file mode 100644
index 00000000000..0ca57d7202a
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr66413.c
@@ -0,0 +1,61 @@
+/* { dg-do compile } */
+/* { dg-additional-options "-g" } */
+
+int a, b, c, d, i, j, q, *e, *h, *k, *r, **p = &e;
+const int *f, **n = &f;
+static int g;
+
+void
+fn1 (int p1)
+{
+ c = p1;
+}
+
+static int *
+fn2 (int *p1, const int *p2)
+{
+ if (g)
+ n = &p2;
+ *n = p2;
+ int o[245];
+ fn1 (o != p2);
+ return p1;
+}
+
+static int *
+fn3 ()
+{
+ int s[54], *t = &s[0], u = 0, v = 1;
+ h = &v;
+ q = 1;
+ for (; q; q++)
+ {
+ int *w[] = { &u };
+ for (; v;)
+ return *p;
+ }
+ *r = *t + b >= 0;
+ return *p;
+}
+
+static int
+fn4 (int *p1)
+{
+ int *l[2], **m[7];
+ for (; i < 1; i++)
+ for (; j < 1; j++)
+ m[i * 70] = &l[0];
+ k = fn3 ();
+ fn2 (0, p1);
+ if ((m[0] == 0) & a)
+ for (;;)
+ ;
+ return 0;
+}
+
+int
+main ()
+{
+ fn4 (&d);
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/torture/pr66794.c b/gcc/testsuite/gcc.dg/torture/pr66794.c
new file mode 100644
index 00000000000..03eeec732bc
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr66794.c
@@ -0,0 +1,22 @@
+/* { dg-do compile } */
+/* { dg-additional-options "-w" } */
+
+int a, *b, e;
+static int **c = &b;
+
+struct
+{
+ int f0;
+} d;
+
+int *
+fn1 ()
+{
+ int f, **g = &b;
+ e = a;
+ for (; a;)
+ for (; d.f0; d.f0++)
+ ;
+ *g = &f;
+ return *c;
+}
diff --git a/gcc/testsuite/gcc.dg/torture/pr67609.c b/gcc/testsuite/gcc.dg/torture/pr67609.c
new file mode 100644
index 00000000000..817857dc52d
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr67609.c
@@ -0,0 +1,33 @@
+/* { dg-do run } */
+
+typedef union
+{
+ double v[2];
+ double s __attribute__ ((vector_size (16)));
+} data;
+
+data reg;
+
+void __attribute__ ((noinline))
+set_lower (double b)
+{
+ data stack_var;
+ double __attribute__ ((vector_size (16))) one = { 1.0, 1.0 };
+ stack_var.s = reg.s;
+ stack_var.s += one;
+ stack_var.v[0] += b;
+ reg.s = stack_var.s;
+}
+
+int
+main (int argc, char ** argv)
+{
+ reg.v[0] = 1.0;
+ reg.v[1] = 1.0;
+ /* reg should contain { 1.0, 1.0 }. */
+ set_lower (2.0);
+ /* reg should contain { 4.0, 2.0 }. */
+ if ((int) reg.v[0] != 4 || (int) reg.v[1] != 2)
+ __builtin_abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/torture/pr67794.c b/gcc/testsuite/gcc.dg/torture/pr67794.c
new file mode 100644
index 00000000000..5489e56fbc1
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr67794.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+
+int *b;
+static void fn1(int *best, int *dmin) {
+ int a[64];
+ dmin = a;
+ __asm__ volatile("" : "+&r"(dmin) : ""(best));
+}
+
+__attribute__((always_inline)) static inline void fn2(int *best) { fn1(best, b); }
+
+void fn3(void) {
+ int c[1];
+ fn2(c);
+}
diff --git a/gcc/testsuite/gcc.dg/torture/pr68648.c b/gcc/testsuite/gcc.dg/torture/pr68648.c
new file mode 100644
index 00000000000..762eb8243bd
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr68648.c
@@ -0,0 +1,23 @@
+/* { dg-do run } */
+/* { dg-options "-std=gnu99" } */
+
+int __attribute__ ((noinline))
+foo (void)
+{
+ return 123;
+}
+
+int __attribute__ ((noinline))
+bar (void)
+{
+ int c = 1;
+ c |= 4294967295 ^ (foo () | 4073709551608);
+ return c;
+}
+
+int
+main ()
+{
+ if (bar () != 0x83fd4005)
+ __builtin_abort ();
+}
diff --git a/gcc/testsuite/gcc.dg/torture/pr68955.c b/gcc/testsuite/gcc.dg/torture/pr68955.c
new file mode 100644
index 00000000000..e9da003f475
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr68955.c
@@ -0,0 +1,41 @@
+/* PR rtl-optimization/68955 */
+/* { dg-do run } */
+/* { dg-output "ONE1ONE" } */
+
+int a, b, c, d, g, m;
+int i[7][7][5] = { { { 5 } }, { { 5 } },
+ { { 5 }, { 5 }, { 5 }, { 5 }, { 5 }, { -1 } } };
+static int j = 11;
+short e, f, h, k, l;
+
+static void
+foo ()
+{
+ for (; e < 5; e++)
+ for (h = 3; h; h--)
+ {
+ for (g = 1; g < 6; g++)
+ {
+ m = c == 0 ? b : b / c;
+ i[e][1][e] = i[1][1][1] | (m & l) && f;
+ }
+ for (k = 0; k < 6; k++)
+ {
+ for (d = 0; d < 6; d++)
+ i[1][e][h] = i[h][k][e] >= l;
+ i[e + 2][h + 3][e] = 6 & l;
+ i[2][1][2] = a;
+ for (; j < 5;)
+ for (;;)
+ ;
+ }
+ }
+}
+
+int
+main ()
+{
+ foo ();
+ __builtin_printf ("ONE%dONE\n", i[1][0][2]);
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/torture/pr69574.c b/gcc/testsuite/gcc.dg/torture/pr69574.c
new file mode 100644
index 00000000000..feaac24043b
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr69574.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+
+typedef unsigned mytype;
+
+struct S {
+ mytype *pu;
+};
+
+mytype f(struct S *e)
+{
+ mytype x;
+ if(&x != e->pu)
+ __builtin_memcpy(&x, e->pu, sizeof(unsigned));
+ return x;
+}
diff --git a/gcc/testsuite/gcc.dg/torture/pr69715.c b/gcc/testsuite/gcc.dg/torture/pr69715.c
new file mode 100644
index 00000000000..cecc82cdf58
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr69715.c
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+
+struct __attribute__((may_alias)) S { long long low; int high; };
+struct S foo (void);
+long double
+bar (void)
+{
+ long double a;
+ *(struct S *)&a = foo ();
+ return a;
+}
diff --git a/gcc/testsuite/gcc.dg/torture/pr69941.c b/gcc/testsuite/gcc.dg/torture/pr69941.c
new file mode 100644
index 00000000000..f15d41a819f
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr69941.c
@@ -0,0 +1,30 @@
+/* { dg-do run } */
+
+int a = 0;
+int b = 0;
+int c = 0;
+int e = 0;
+int f = 0;
+int *g = &e;
+
+int fn1() { return b ? a : b; }
+
+int main() {
+ int h = fn1() <= 0x8000000000000000ULL; // h = 1;
+
+ int k = f; // k = 0;
+
+ long i = h ? k : k / h; // i = 0;
+
+ long l = (unsigned short)(i - 0x1800); // l = 0xe800
+
+ i = l ? l : c; // i = 0xe800;
+
+ *g = i; // *g = 0xe800; e = 0xe800;
+
+ unsigned char result = e >> 9; // result = 0x74;
+
+ if ((int)result != 0x74)
+ __builtin_abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/torture/pr70457.c b/gcc/testsuite/gcc.dg/torture/pr70457.c
new file mode 100644
index 00000000000..74daed4d36f
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr70457.c
@@ -0,0 +1,29 @@
+/* { dg-do compile } */
+
+/* This formerly ICEd when trying to expand pow as a built-in with
+ the wrong number of arguments. */
+
+extern double pow (double, double) __attribute__ ((__nothrow__ , __leaf__));
+
+typedef struct {
+ long long data;
+ int tag;
+} Object;
+
+extern Object Make_Flonum (double);
+extern Object P_Pow (Object, Object);
+
+Object General_Function (Object x, Object y, double (*fun)()) {
+ double d, ret;
+
+ d = 1.0;
+
+ if (y.tag >> 1)
+ ret = (*fun) (d);
+ else
+ ret = (*fun) (d, 0.0);
+
+ return Make_Flonum (ret);
+}
+
+Object P_Pow (Object x, Object y) { return General_Function (x, y, pow); }
diff --git a/gcc/testsuite/gcc.dg/torture/pr70484.c b/gcc/testsuite/gcc.dg/torture/pr70484.c
new file mode 100644
index 00000000000..7604c654fbe
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr70484.c
@@ -0,0 +1,19 @@
+/* { dg-do run } */
+
+extern void abort (void);
+
+int __attribute__((noinline,noclone))
+f(int *pi, long *pl)
+{
+ *pi = 1;
+ *pl = 0;
+ return *(char *)pi;
+}
+
+int main()
+{
+ union { long l; int i; } a;
+ if (f (&a.i, &a.l) != 0)
+ abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/torture/pr71452.c b/gcc/testsuite/gcc.dg/torture/pr71452.c
new file mode 100644
index 00000000000..8948d39fdaf
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr71452.c
@@ -0,0 +1,10 @@
+/* { dg-do run } */
+
+int main()
+{
+ _Bool b;
+ *(char *)&b = 123;
+ if (*(char *)&b != 123)
+ __builtin_abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/torture/pr71606.c b/gcc/testsuite/gcc.dg/torture/pr71606.c
new file mode 100644
index 00000000000..b0cc26ac771
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr71606.c
@@ -0,0 +1,11 @@
+_Complex a;
+void fn1 ();
+
+int main () {
+ fn1 (a);
+ return 0;
+}
+
+void fn1 (__complex__ long double p1) {
+ __imag__ p1 = 6.0L;
+}
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/cunroll-11.c b/gcc/testsuite/gcc.dg/tree-ssa/cunroll-11.c
new file mode 100644
index 00000000000..a26cb22d35d
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/cunroll-11.c
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -Warray-bounds -fdump-tree-cunroll-details" } */
+
+typedef struct { unsigned data; } s1;
+s1 g_x[4];
+
+extern void foo (s1 *x1, s1 *x2, int a, int b)
+{
+ int i;
+ for(i = 0; i < a; i++)
+ if(i == b)
+ g_x[i] = *x1;
+ else
+ g_x[i] = *x2;
+}
+
+/* { dg-final { scan-tree-dump "Loop 1 iterates at most 3 times" "cunroll" } } */
+/* { dg-final { cleanup-tree-dump "cunroll" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr69355.c b/gcc/testsuite/gcc.dg/tree-ssa/pr69355.c
new file mode 100644
index 00000000000..f515c211c99
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr69355.c
@@ -0,0 +1,44 @@
+/* { dg-do run } */
+/* { dg-options "-O -fno-strict-aliasing" } */
+
+struct S
+{
+ void *a;
+ long double b;
+};
+
+struct Z
+{
+ long long l;
+ short s;
+} __attribute__((packed));
+
+struct S __attribute__((noclone, noinline))
+foo (void *v, struct Z *z)
+{
+ struct S t;
+ t.a = v;
+ *(struct Z *) &t.b = *z;
+ return t;
+}
+
+struct Z gz;
+
+int
+main (int argc, char **argv)
+{
+ struct S s;
+
+ if (sizeof (long double) < sizeof (struct Z))
+ return 0;
+
+ gz.l = 0xbeef;
+ gz.s = 0xab;
+
+ s = foo ((void *) 0, &gz);
+
+ if ((((struct Z *) &s.b)->l != gz.l)
+ || (((struct Z *) &s.b)->s != gz.s))
+ __builtin_abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/aarch64/pr68363_1.c b/gcc/testsuite/gcc.target/aarch64/pr68363_1.c
new file mode 100644
index 00000000000..bb294b50dc0
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/pr68363_1.c
@@ -0,0 +1,19 @@
+/* { dg-do compile } */
+/* { dg-options "-mfix-cortex-a53-835769" } */
+
+int
+foo (int i)
+{
+ switch (i)
+ {
+ case 0:
+ case 2:
+ case 5:
+ return 0;
+ case 7:
+ case 11:
+ case 13:
+ return 1;
+ }
+ return -1;
+}
diff --git a/gcc/testsuite/gcc.target/aarch64/pr70809_1.c b/gcc/testsuite/gcc.target/aarch64/pr70809_1.c
new file mode 100644
index 00000000000..2e1bbf4b090
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/pr70809_1.c
@@ -0,0 +1,18 @@
+/* PR target/70809. */
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-vectorize -ffp-contract=off -mtune=generic" } */
+
+/* Check that vector FMLS is not generated when contraction is disabled. */
+
+void
+foo (float *__restrict__ __attribute__ ((aligned (16))) a,
+ float *__restrict__ __attribute__ ((aligned (16))) x,
+ float *__restrict__ __attribute__ ((aligned (16))) y,
+ float *__restrict__ __attribute__ ((aligned (16))) z)
+{
+ unsigned i = 0;
+ for (i = 0; i < 256; i++)
+ a[i] = x[i] - (y[i] * z[i]);
+}
+
+/* { dg-final { scan-assembler-not "fmls\tv.*" } } */
diff --git a/gcc/testsuite/gcc.target/arm/atomic_loaddi_1.c b/gcc/testsuite/gcc.target/arm/atomic_loaddi_1.c
new file mode 100644
index 00000000000..816d352bd6b
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/atomic_loaddi_1.c
@@ -0,0 +1,9 @@
+/* { dg-do compile } */
+/* { dg-options "-std=c11 -O" } */
+/* { dg-require-effective-target arm_arch_v7a_ok } */
+/* { dg-add-options arm_arch_v7a } */
+
+#include "atomic_loaddi_acquire.x"
+
+/* { dg-final { scan-assembler-times "ldrexd\tr\[0-9\]+, r\[0-9\]+, \\\[r\[0-9\]+\\\]" 1 } } */
+/* { dg-final { scan-assembler-times "dmb\tsy" 1 } } */
diff --git a/gcc/testsuite/gcc.target/arm/atomic_loaddi_2.c b/gcc/testsuite/gcc.target/arm/atomic_loaddi_2.c
new file mode 100644
index 00000000000..c54ac7743c9
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/atomic_loaddi_2.c
@@ -0,0 +1,9 @@
+/* { dg-do compile } */
+/* { dg-options "-std=c11 -O" } */
+/* { dg-require-effective-target arm_arch_v7ve_ok } */
+/* { dg-add-options arm_arch_v7ve } */
+
+#include "atomic_loaddi_acquire.x"
+
+/* { dg-final { scan-assembler-times "ldrd\tr\[0-9\]+, r\[0-9\]+, \\\[r\[0-9\]+\\\]" 1 } } */
+/* { dg-final { scan-assembler-times "dmb\tsy" 1 } } */
diff --git a/gcc/testsuite/gcc.target/arm/atomic_loaddi_3.c b/gcc/testsuite/gcc.target/arm/atomic_loaddi_3.c
new file mode 100644
index 00000000000..095c95889d4
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/atomic_loaddi_3.c
@@ -0,0 +1,9 @@
+/* { dg-do compile } */
+/* { dg-options "-std=c11 -O" } */
+/* { dg-require-effective-target arm_arch_v8a_ok } */
+/* { dg-add-options arm_arch_v8a } */
+
+#include "atomic_loaddi_acquire.x"
+
+/* { dg-final { scan-assembler-times "ldaexd\tr\[0-9\]+, r\[0-9\]+, \\\[r\[0-9\]+\\\]" 1 } } */
+/* { dg-final { scan-assembler-not "dmb\tsy" } } */
diff --git a/gcc/testsuite/gcc.target/arm/atomic_loaddi_4.c b/gcc/testsuite/gcc.target/arm/atomic_loaddi_4.c
new file mode 100644
index 00000000000..53667b4b665
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/atomic_loaddi_4.c
@@ -0,0 +1,9 @@
+/* { dg-do compile } */
+/* { dg-options "-std=c11 -O" } */
+/* { dg-require-effective-target arm_arch_v7a_ok } */
+/* { dg-add-options arm_arch_v7a } */
+
+#include "atomic_loaddi_relaxed.x"
+
+/* { dg-final { scan-assembler-times "ldrexd\tr\[0-9\]+, r\[0-9\]+, \\\[r\[0-9\]+\\\]" 1 } } */
+/* { dg-final { scan-assembler-not "dmb\tsy" } } */
diff --git a/gcc/testsuite/gcc.target/arm/atomic_loaddi_5.c b/gcc/testsuite/gcc.target/arm/atomic_loaddi_5.c
new file mode 100644
index 00000000000..2b9800bd281
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/atomic_loaddi_5.c
@@ -0,0 +1,9 @@
+/* { dg-do compile } */
+/* { dg-options "-std=c11 -O" } */
+/* { dg-require-effective-target arm_arch_v7ve_ok } */
+/* { dg-add-options arm_arch_v7ve } */
+
+#include "atomic_loaddi_relaxed.x"
+
+/* { dg-final { scan-assembler-times "ldrd\tr\[0-9\]+, r\[0-9\]+, \\\[r\[0-9\]+\\\]" 1 } } */
+/* { dg-final { scan-assembler-not "dmb\tsy" } } */ \ No newline at end of file
diff --git a/gcc/testsuite/gcc.target/arm/atomic_loaddi_6.c b/gcc/testsuite/gcc.target/arm/atomic_loaddi_6.c
new file mode 100644
index 00000000000..e37ca0b280c
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/atomic_loaddi_6.c
@@ -0,0 +1,9 @@
+/* { dg-do compile } */
+/* { dg-options "-std=c11 -O" } */
+/* { dg-require-effective-target arm_arch_v8a_ok } */
+/* { dg-add-options arm_arch_v8a } */
+
+#include "atomic_loaddi_relaxed.x"
+
+/* { dg-final { scan-assembler-times "ldrd\tr\[0-9\]+, r\[0-9\]+, \\\[r\[0-9\]+\\\]" 1 } } */
+/* { dg-final { scan-assembler-not "dmb\tsy" } } */ \ No newline at end of file
diff --git a/gcc/testsuite/gcc.target/arm/atomic_loaddi_7.c b/gcc/testsuite/gcc.target/arm/atomic_loaddi_7.c
new file mode 100644
index 00000000000..e6deb086d60
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/atomic_loaddi_7.c
@@ -0,0 +1,9 @@
+/* { dg-do compile } */
+/* { dg-options "-std=c11 -O" } */
+/* { dg-require-effective-target arm_arch_v7a_ok } */
+/* { dg-add-options arm_arch_v7a } */
+
+#include "atomic_loaddi_seq_cst.x"
+
+/* { dg-final { scan-assembler-times "ldrexd\tr\[0-9\]+, r\[0-9\]+, \\\[r\[0-9\]+\\\]" 1 } } */
+/* { dg-final { scan-assembler-times "dmb\tsy" 1 } } */
diff --git a/gcc/testsuite/gcc.target/arm/atomic_loaddi_8.c b/gcc/testsuite/gcc.target/arm/atomic_loaddi_8.c
new file mode 100644
index 00000000000..65530dd8b14
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/atomic_loaddi_8.c
@@ -0,0 +1,9 @@
+/* { dg-do compile } */
+/* { dg-options "-std=c11 -O" } */
+/* { dg-require-effective-target arm_arch_v7ve_ok } */
+/* { dg-add-options arm_arch_v7ve } */
+
+#include "atomic_loaddi_seq_cst.x"
+
+/* { dg-final { scan-assembler-times "ldrd\tr\[0-9\]+, r\[0-9\]+, \\\[r\[0-9\]+\\\]" 1 } } */
+/* { dg-final { scan-assembler-times "dmb\tsy" 1 } } */
diff --git a/gcc/testsuite/gcc.target/arm/atomic_loaddi_9.c b/gcc/testsuite/gcc.target/arm/atomic_loaddi_9.c
new file mode 100644
index 00000000000..3401a8eb686
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/atomic_loaddi_9.c
@@ -0,0 +1,9 @@
+/* { dg-do compile } */
+/* { dg-options "-std=c11 -O" } */
+/* { dg-require-effective-target arm_arch_v8a_ok } */
+/* { dg-add-options arm_arch_v8a } */
+
+#include "atomic_loaddi_seq_cst.x"
+
+/* { dg-final { scan-assembler-times "ldaexd\tr\[0-9\]+, r\[0-9\]+, \\\[r\[0-9\]+\\\]" 1 } } */
+/* { dg-final { scan-assembler-not "dmb\tsy" } } */
diff --git a/gcc/testsuite/gcc.target/arm/atomic_loaddi_acquire.x b/gcc/testsuite/gcc.target/arm/atomic_loaddi_acquire.x
new file mode 100644
index 00000000000..28997ef565b
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/atomic_loaddi_acquire.x
@@ -0,0 +1,11 @@
+#include <stdatomic.h>
+
+atomic_ullong foo;
+int glob;
+
+int
+main (void)
+{
+ atomic_load_explicit (&foo, memory_order_acquire);
+ return glob;
+}
diff --git a/gcc/testsuite/gcc.target/arm/atomic_loaddi_relaxed.x b/gcc/testsuite/gcc.target/arm/atomic_loaddi_relaxed.x
new file mode 100644
index 00000000000..701b3c42c09
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/atomic_loaddi_relaxed.x
@@ -0,0 +1,11 @@
+#include <stdatomic.h>
+
+atomic_ullong foo;
+int glob;
+
+int
+main (void)
+{
+ atomic_load_explicit (&foo, memory_order_relaxed);
+ return glob;
+}
diff --git a/gcc/testsuite/gcc.target/arm/atomic_loaddi_relaxed_cond.c b/gcc/testsuite/gcc.target/arm/atomic_loaddi_relaxed_cond.c
new file mode 100644
index 00000000000..d6977515081
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/atomic_loaddi_relaxed_cond.c
@@ -0,0 +1,20 @@
+/* { dg-do assemble } */
+/* { dg-options "-std=c11 -O" } */
+/* { dg-require-effective-target arm_arch_v8a_ok } */
+/* { dg-add-options arm_arch_v8a } */
+
+/* Check that if we conditionalise the atomic load we put the condition
+ code in the right place to create valid assembly. */
+
+#include <stdatomic.h>
+
+atomic_ullong foo;
+int glob;
+
+int
+main (int argc, char *argv[])
+{
+ if (argc > 2)
+ atomic_load_explicit (&foo, memory_order_relaxed);
+ return glob;
+}
diff --git a/gcc/testsuite/gcc.target/arm/atomic_loaddi_seq_cst.x b/gcc/testsuite/gcc.target/arm/atomic_loaddi_seq_cst.x
new file mode 100644
index 00000000000..32e78da67e8
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/atomic_loaddi_seq_cst.x
@@ -0,0 +1,11 @@
+#include <stdatomic.h>
+
+atomic_ullong foo;
+int glob;
+
+int
+main (void)
+{
+ atomic_load_explicit (&foo, memory_order_seq_cst);
+ return glob;
+}
diff --git a/gcc/testsuite/gcc.target/arm/pr67439_1.c b/gcc/testsuite/gcc.target/arm/pr67439_1.c
new file mode 100644
index 00000000000..f7a6128758a
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/pr67439_1.c
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target arm_thumb2_ok } */
+/* { dg-options "-O1 -mfp16-format=ieee -march=armv7-a -mfpu=neon -mthumb -mrestrict-it" } */
+
+__fp16 h0 = -1.0;
+
+void
+f (__fp16 *p)
+{
+ h0 = 1.0;
+}
diff --git a/gcc/testsuite/gcc.target/arm/pr67929_1.c b/gcc/testsuite/gcc.target/arm/pr67929_1.c
deleted file mode 100644
index 14943b6b598..00000000000
--- a/gcc/testsuite/gcc.target/arm/pr67929_1.c
+++ /dev/null
@@ -1,21 +0,0 @@
-/* { dg-do run } */
-/* { dg-require-effective-target arm_vfp3_ok } */
-/* { dg-options "-O2 -fno-inline" } */
-/* { dg-add-options arm_vfp3 } */
-/* { dg-skip-if "need fp instructions" { *-*-* } { "-mfloat-abi=soft" } { "" } } */
-
-int
-foo (float a)
-{
- return a * 4.9f;
-}
-
-
-int
-main (void)
-{
- if (foo (10.0f) != 49)
- __builtin_abort ();
-
- return 0;
-} \ No newline at end of file
diff --git a/gcc/testsuite/gcc.target/avr/pr71103.c b/gcc/testsuite/gcc.target/avr/pr71103.c
new file mode 100644
index 00000000000..43244d15e97
--- /dev/null
+++ b/gcc/testsuite/gcc.target/avr/pr71103.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-options "-O1" } */
+
+struct ResponseStruct{
+ unsigned char responseLength;
+ char *response;
+};
+
+static char response[5];
+struct ResponseStruct something(){
+ struct ResponseStruct returnValue;
+ returnValue.responseLength = 5;
+ returnValue.response = response;
+ return returnValue;
+}
+
diff --git a/gcc/testsuite/gcc.target/avr/torture/pr71103-2.c b/gcc/testsuite/gcc.target/avr/torture/pr71103-2.c
new file mode 100644
index 00000000000..480ad05acab
--- /dev/null
+++ b/gcc/testsuite/gcc.target/avr/torture/pr71103-2.c
@@ -0,0 +1,118 @@
+/* Use -g0 so that this test case doesn't just fail because
+ of PR52472. */
+
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99 -g0" } */
+
+struct S12
+{
+ char c;
+ const char *p;
+};
+
+struct S12f
+{
+ char c;
+ struct S12f (*f)(void);
+};
+
+struct S12labl
+{
+ char c;
+ void **labl;
+};
+
+struct S121
+{
+ char c;
+ const char *p;
+ char d;
+};
+
+const char str[5] = "abcd";
+
+struct S12 test_S12_0 (void)
+{
+ struct S12 s;
+ s.c = 'A';
+ s.p = str;
+ return s;
+}
+
+struct S12 test_S12_4 (void)
+{
+ struct S12 s;
+ s.c = 'A';
+ s.p = str + 4;
+ return s;
+}
+
+struct S12f test_S12f (void)
+{
+ struct S12f s;
+ s.c = 'A';
+ s.f = test_S12f;
+ return s;
+}
+
+struct S121 test_S121 (void)
+{
+ struct S121 s;
+ s.c = 'c';
+ s.p = str + 4;
+ s.d = 'd';
+ return s;
+}
+
+extern void use_S12lab (struct S12labl*);
+
+struct S12labl test_S12lab (void)
+{
+ struct S12labl s;
+labl:;
+ s.c = 'A';
+ s.labl = &&labl;
+ return s;
+}
+
+#ifdef __MEMX
+
+struct S13
+{
+ char c;
+ const __memx char *p;
+};
+
+const __memx char str_x[] = "abcd";
+
+struct S13 test_S13_0 (void)
+{
+ struct S13 s;
+ s.c = 'A';
+ s.p = str_x;
+ return s;
+}
+
+struct S13 test_S13_4a (void)
+{
+ struct S13 s;
+ s.c = 'A';
+ s.p = str_x + 4;
+ return s;
+}
+
+#ifdef __FLASH1
+
+const __flash1 char str_1[] = "abcd";
+
+struct S13 test_13_4b (void)
+{
+ struct S13 s;
+ s.c = 'A';
+ s.p = str_1 + 4;
+ return s;
+}
+
+#endif /* have __flash1 */
+#endif /* have __memx */
+
diff --git a/gcc/testsuite/gcc.target/i386/avx512f-pr70059.c b/gcc/testsuite/gcc.target/i386/avx512f-pr70059.c
new file mode 100644
index 00000000000..95c8915a93b
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/avx512f-pr70059.c
@@ -0,0 +1,33 @@
+/* PR target/70059 */
+/* { dg-do run } */
+/* { dg-require-effective-target avx512f } */
+/* { dg-options "-O2 -mavx512f" } */
+
+#include "avx512f-check.h"
+
+__attribute__((noinline, noclone)) __m512i
+foo (__m256i a, __m256i b)
+{
+ __m512i r = _mm512_undefined_si512 ();
+ r = _mm512_inserti64x4 (r, a, 0);
+ r = _mm512_inserti64x4 (r, b, 1);
+ return r;
+}
+
+static void
+avx512f_test (void)
+{
+ union256i_q a, b;
+ union512i_q r;
+ long long r_ref[8];
+ int i;
+ for (i = 0; i < 4; i++)
+ {
+ a.a[i] = 0x0101010101010101ULL * i;
+ b.a[i] = 0x1010101010101010ULL * i;
+ r_ref[i] = a.a[i];
+ r_ref[i + 4] = b.a[i];
+ }
+ r.x = foo (a.x, b.x);
+ check_union512i_q (r, r_ref);
+}
diff --git a/gcc/testsuite/gcc.target/i386/pr67265-2.c b/gcc/testsuite/gcc.target/i386/pr67265-2.c
new file mode 100644
index 00000000000..a9f2eb460ef
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr67265-2.c
@@ -0,0 +1,9 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fstack-check" } */
+
+void foo (int n)
+{
+ volatile char arr[64 * 1024];
+
+ arr[n] = 1;
+}
diff --git a/gcc/testsuite/gcc.target/i386/pr67265.c b/gcc/testsuite/gcc.target/i386/pr67265.c
new file mode 100644
index 00000000000..7827685fe5f
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr67265.c
@@ -0,0 +1,12 @@
+/* PR target/67265 */
+/* Reduced testcase by Johannes Dewender <gnu@JonnyJD.net> */
+
+/* { dg-do compile } */
+/* { dg-options "-O -fstack-check -fPIC" } */
+
+int a, b, c, d, e;
+
+void foo (void)
+{
+ __asm__("" : "+r"(c), "+r"(e), "+r"(d), "+r"(a) : ""(b), "mg"(foo), "mm"(c));
+}
diff --git a/gcc/testsuite/gcc.target/i386/pr67770.c b/gcc/testsuite/gcc.target/i386/pr67770.c
new file mode 100644
index 00000000000..3826aff45b7
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr67770.c
@@ -0,0 +1,40 @@
+/* PR target/67770 */
+/* { dg-do run { target ia32 } } */
+/* { dg-require-effective-target trampolines } */
+/* { dg-options "-O2" } */
+
+#ifndef NO_TRAMPOLINES
+__attribute__ ((noinline)) void
+foo (int i, void (* __attribute__ ((regparm (3))) bar) (int))
+{
+ bar (i);
+}
+#endif
+
+int
+main ()
+{
+#ifndef NO_TRAMPOLINES
+ int p = 0;
+
+ __attribute__ ((regparm (3), noinline)) void
+ bar (int i)
+ {
+ if (__builtin_expect (i, 0))
+ ++p;
+ }
+
+ foo (0, bar);
+ bar (0);
+
+ if (p != 0)
+ __builtin_abort ();
+
+ foo (1, bar);
+ bar (1);
+
+ if (p != 2)
+ __builtin_abort ();
+#endif
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/i386/pr68680.c b/gcc/testsuite/gcc.target/i386/pr68680.c
new file mode 100644
index 00000000000..5524e156362
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr68680.c
@@ -0,0 +1,15 @@
+/* PR tree-optimization/68680 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fstack-protector-strong" } */
+
+int foo (char *);
+
+int
+bar (unsigned long x)
+{
+ char a[x];
+ return foo (a);
+}
+
+/* Verify that this function is stack protected. */
+/* { dg-final { scan-assembler "stack_chk_fail" } } */
diff --git a/gcc/testsuite/gcc.target/i386/pr68701-1.c b/gcc/testsuite/gcc.target/i386/pr68701-1.c
new file mode 100644
index 00000000000..008eb6bddd2
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr68701-1.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-O -ffixed-ebp -mno-accumulate-outgoing-args" } */
+
+/* { dg-warning "fixed ebp register requires" "" { target *-*-* } 0 } */
+
+void foo (void);
+
+int
+main (int argc, char *argv[])
+{
+ foo ();
+ return argc - 1;
+}
diff --git a/gcc/testsuite/gcc.target/i386/pr68701-2.c b/gcc/testsuite/gcc.target/i386/pr68701-2.c
new file mode 100644
index 00000000000..bfe592ec8ec
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr68701-2.c
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+/* { dg-options "-O -ffixed-ebp -mno-accumulate-outgoing-args -mstackrealign -msse" } */
+
+/* { dg-warning "fixed ebp register requires" "" { target *-*-* } 0 } */
+
+typedef float V __attribute__((vector_size(16)));
+
+void bar (V a)
+{
+ volatile V b = a;
+}
diff --git a/gcc/testsuite/gcc.target/i386/pr69459.c b/gcc/testsuite/gcc.target/i386/pr69459.c
new file mode 100644
index 00000000000..2d0bbbcdbf1
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr69459.c
@@ -0,0 +1,42 @@
+/* PR target/69549 */
+/* { dg-do run { target sse2_runtime } } */
+/* { dg-options "-O2 -msse2" } */
+
+typedef unsigned char u8;
+typedef unsigned short u16;
+typedef unsigned int u32;
+typedef unsigned long long u64;
+typedef unsigned char v16u8 __attribute__ ((vector_size (16)));
+typedef unsigned short v16u16 __attribute__ ((vector_size (16)));
+typedef unsigned int v16u32 __attribute__ ((vector_size (16)));
+typedef unsigned long long v16u64 __attribute__ ((vector_size (16)));
+
+u64 __attribute__((noinline, noclone))
+foo (u8 u8_0, u16 u16_3, v16u8 v16u8_0, v16u16 v16u16_0, v16u32 v16u32_0, v16u64 v16u64_0, v16u8 v16u8_1, v16u16 v16u16_1, v16u32 v16u32_1, v16u64 v16u64_1, v16u8 v16u8_2, v16u16 v16u16_2, v16u32 v16u32_2, v16u64 v16u64_2, v16u8 v16u8_3, v16u16 v16u16_3, v16u32 v16u32_3, v16u64 v16u64_3)
+{
+ v16u64_0 /= (v16u64){u16_3, ((0))} | 1;
+ v16u64_1 += (v16u64)~v16u32_0;
+ v16u16_1 /= (v16u16){-v16u64_3[1]} | 1;
+ v16u64_3[1] -= 0x1fffffff;
+ v16u32_2 /= (v16u32)-v16u64_0 | 1;
+ v16u32_1 += ~v16u32_1;
+ v16u16_3 %= (v16u16){0xfff, v16u32_2[3], v16u8_0[14]} | 1;
+ v16u64_3 -= (v16u64)v16u32_2;
+ if (v16u64_1[1] >= 1) {
+ v16u64_0 %= (v16u64){v16u32_0[1]} | 1;
+ v16u32_1[1] %= 0x5fb856;
+ v16u64_1 |= -v16u64_0;
+ }
+ v16u8_0 *= (v16u8)v16u32_1;
+ return u8_0 + v16u8_0 [12] + v16u8_0 [13] + v16u8_0 [14] + v16u8_0 [15] + v16u16_0 [0] + v16u16_0 [1] + v16u32_0 [0] + v16u32_0 [1] + v16u32_0 [2] + v16u32_0 [3] + v16u64_0 [0] + v16u64_0 [1] + v16u8_1 [9] + v16u8_1 [10] + v16u8_1 [11] + v16u8_1 [15] + v16u16_1 [0] + v16u16_1 [1] + v16u16_1 [3] + v16u64_1 [0] + v16u64_1 [1] + v16u8_2 [3] + v16u8_2 [4] + v16u8_2 [5] + v16u8_2 [0] + v16u32_2 [1] + v16u32_2 [2] + v16u32_2 [3] + v16u64_2 [0] + v16u64_2 [1] + v16u8_3 [0] + v16u16_3 [6] + v16u16_3[7] + v16u32_3[1] + v16u32_3[2] + v16u64_3[0] + v16u64_3[1];
+}
+
+int
+main ()
+{
+ u64 x = foo(1, 1, (v16u8){1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, (v16u16){1, 1}, (v16u32){1}, (v16u64){1}, (v16u8){1}, (v16u16){1, 1}, (v16u32){1}, (v16u64){1}, (v16u8){1, 1, 1, 1, 1}, (v16u16){1}, (v16u32){1}, (v16u64){1}, (v16u8){1}, (v16u16){1}, (v16u32){1}, (v16u64){1});
+
+ if (x != 0xffffffffe0000209)
+ __builtin_abort();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/i386/pr69551.c b/gcc/testsuite/gcc.target/i386/pr69551.c
new file mode 100644
index 00000000000..1505fc21dbf
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr69551.c
@@ -0,0 +1,23 @@
+/* PR target/69551 */
+/* { dg-do run { target sse_runtime } } */
+/* { dg-options "-O2 -mno-sse2 -msse" } */
+
+typedef unsigned char v16qi __attribute__ ((vector_size (16)));
+typedef unsigned int v4si __attribute__ ((vector_size (16)));
+
+char __attribute__ ((noinline, noclone))
+test (v4si vec)
+{
+ vec[1] = 0x5fb856;
+ return ((v16qi) vec)[0];
+}
+
+int
+main ()
+{
+ char z = test ((v4si) { -1, -1, -1, -1 });
+
+ if (z != -1)
+ __builtin_abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/i386/pr69891.c b/gcc/testsuite/gcc.target/i386/pr69891.c
new file mode 100644
index 00000000000..2c5e86372e3
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr69891.c
@@ -0,0 +1,30 @@
+/* PR rtl-optimization/69891 */
+/* { dg-do run } */
+/* { dg-options "-O -fno-tree-fre -mstringop-strategy=libcall -Wno-psabi" } */
+/* { dg-additional-options "-mno-sse" { target ia32 } } */
+
+typedef unsigned short A;
+typedef unsigned short B __attribute__ ((vector_size (32)));
+typedef unsigned int C;
+typedef unsigned int D __attribute__ ((vector_size (32)));
+typedef unsigned long long E;
+typedef unsigned long long F __attribute__ ((vector_size (32)));
+
+__attribute__((noinline, noclone)) unsigned
+foo(D a, B b, D c, F d)
+{
+ b /= (B) {1, -c[0]} | 1;
+ c[0] |= 7;
+ a %= c | 1;
+ c ^= c;
+ return a[0] + b[15] + c[0] + d[3];
+}
+
+int
+main ()
+{
+ unsigned x = foo ((D) {}, (B) {}, (D) {}, (F) {});
+ if (x != 0)
+ __builtin_abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/i386/pr70007.c b/gcc/testsuite/gcc.target/i386/pr70007.c
new file mode 100644
index 00000000000..ff58d176683
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr70007.c
@@ -0,0 +1,30 @@
+/* PR rtl-optimization/70007 */
+/* { dg-do run { target bmi2 } } */
+/* { dg-options "-O -fgcse -mbmi2 -Wno-psabi" } */
+/* { dg-require-effective-target int128 } */
+
+#include "bmi2-check.h"
+
+typedef unsigned short v32u16 __attribute__ ((vector_size (32)));
+typedef unsigned long long v32u64 __attribute__ ((vector_size (32)));
+typedef unsigned __int128 u128;
+typedef unsigned __int128 v32u128 __attribute__ ((vector_size (32)));
+
+u128
+foo (v32u16 v32u16_0, v32u64 v32u64_0, v32u64 v32u64_1)
+{
+ do {
+ v32u16_0[13] |= v32u64_1[3] = (v32u64_1[3] >> 19) | (v32u64_1[3] << 45);
+ v32u64_1 %= ~v32u64_1;
+ v32u64_0 *= (v32u64) v32u16_0;
+ } while (v32u64_0[0]);
+ return v32u64_1[3];
+}
+
+static void
+bmi2_test ()
+{
+ u128 x = foo((v32u16){(unsigned short) ~0xba31, 0x47c6}, (v32u64){64}, (v32u64){0, 0x8b217e2514d23242, 0xac569b6dff9f82, 0x9d4cffe03c139c});
+ if (x != 0x3c74da5ca328d09)
+ __builtin_abort();
+}
diff --git a/gcc/testsuite/gcc.target/i386/pr70327.c b/gcc/testsuite/gcc.target/i386/pr70327.c
new file mode 100644
index 00000000000..035bb68d458
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr70327.c
@@ -0,0 +1,12 @@
+/* PR target/70327 */
+/* { dg-do compile } */
+/* { dg-require-effective-target int128 } */
+/* { dg-options "-mavx512f" } */
+
+typedef unsigned __int128 v4ti __attribute__ ((vector_size (64)));
+
+void
+foo (v4ti v)
+{
+ foo(v);
+}
diff --git a/gcc/testsuite/gcc.target/i386/pr70858.c b/gcc/testsuite/gcc.target/i386/pr70858.c
new file mode 100644
index 00000000000..99d7877346c
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr70858.c
@@ -0,0 +1,45 @@
+/* PR target/70858 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -mlwp -mbmi -mtbm -mbmi2 -std=gnu11" } */
+
+void
+f1 (unsigned long long x, unsigned int y)
+{
+ __builtin_ia32_lwpval64 (x, y, 1); /* { dg-warning "implicit declaration of function .__builtin_ia32_lwpval64." "" { target ia32 } } */
+}
+
+char
+f2 (unsigned long long x, unsigned int y)
+{
+ return __builtin_ia32_lwpins64 (x, y, 1); /* { dg-warning "implicit declaration of function .__builtin_ia32_lwpins64." "" { target ia32 } } */
+}
+
+unsigned long long
+f3 (unsigned long long x, unsigned long long y)
+{
+ return __builtin_ia32_bextr_u64 (x, y); /* { dg-warning "implicit declaration of function .__builtin_ia32_bextr_u64." "" { target ia32 } } */
+}
+
+unsigned long long
+f4 (unsigned long long x)
+{
+ return __builtin_ia32_bextri_u64 (x, 1); /* { dg-warning "implicit declaration of function .__builtin_ia32_bextri_u64." "" { target ia32 } } */
+}
+
+unsigned long long
+f5 (unsigned long long x, unsigned long long y)
+{
+ return __builtin_ia32_bzhi_di (x, y); /* { dg-warning "implicit declaration of function .__builtin_ia32_bzhi_di." "" { target ia32 } } */
+}
+
+unsigned long long
+f6 (unsigned long long x, unsigned long long y)
+{
+ return __builtin_ia32_pdep_di (x, y); /* { dg-warning "implicit declaration of function .__builtin_ia32_pdep_di." "" { target ia32 } } */
+}
+
+unsigned long long
+f7 (unsigned long long x, unsigned long long y)
+{
+ return __builtin_ia32_pext_di (x, y); /* { dg-warning "implicit declaration of function .__builtin_ia32_pext_di." "" { target ia32 } } */
+}
diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-round.h b/gcc/testsuite/gcc.target/i386/sse4_1-round.h
index 0210ac130b6..dfb0b778cdc 100644
--- a/gcc/testsuite/gcc.target/i386/sse4_1-round.h
+++ b/gcc/testsuite/gcc.target/i386/sse4_1-round.h
@@ -28,7 +28,7 @@ init_round (FP_T *src)
static FP_T
do_round (FP_T f, int type)
{
- short saved_cw, new_cw, clr_mask;
+ unsigned short saved_cw, new_cw, clr_mask;
FP_T ret;
if ((type & 4))
@@ -42,16 +42,15 @@ do_round (FP_T f, int type)
clr_mask = ~0x0C3F;
}
- __asm__ ("fld" ASM_SUFFIX " %0" : : "m" (*&f));
+ __asm__ ("fnstcw %0" : "=m" (saved_cw));
- __asm__ ("fstcw %0" : "=m" (*&saved_cw));
new_cw = saved_cw & clr_mask;
new_cw |= type;
- __asm__ ("fldcw %0" : : "m" (*&new_cw));
- __asm__ ("frndint\n"
- "fstp" ASM_SUFFIX " %0\n" : "=m" (*&ret));
- __asm__ ("fldcw %0" : : "m" (*&saved_cw));
+ __asm__ ("fldcw %2\n\t"
+ "frndint\n\t"
+ "fldcw %3" : "=t" (ret)
+ : "0" (f), "m" (new_cw), "m" (saved_cw));
return ret;
}
diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-roundps-1.c b/gcc/testsuite/gcc.target/i386/sse4_1-roundps-1.c
index 71bc51be232..fab227869fc 100644
--- a/gcc/testsuite/gcc.target/i386/sse4_1-roundps-1.c
+++ b/gcc/testsuite/gcc.target/i386/sse4_1-roundps-1.c
@@ -7,7 +7,6 @@
#define VEC_T __m128
#define FP_T float
-#define ASM_SUFFIX "s"
#define ROUND_INTRIN(x, mode) _mm_ceil_ps(x)
#define ROUND_MODE _MM_FROUND_CEIL
diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-roundps-2.c b/gcc/testsuite/gcc.target/i386/sse4_1-roundps-2.c
index 672e92067c8..405c55d45a4 100644
--- a/gcc/testsuite/gcc.target/i386/sse4_1-roundps-2.c
+++ b/gcc/testsuite/gcc.target/i386/sse4_1-roundps-2.c
@@ -7,7 +7,6 @@
#define VEC_T __m128
#define FP_T float
-#define ASM_SUFFIX "s"
#define ROUND_INTRIN _mm_round_ps
#define ROUND_MODE _MM_FROUND_NINT
diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-roundps-3.c b/gcc/testsuite/gcc.target/i386/sse4_1-roundps-3.c
index 4bfc1cacc91..97485b95867 100644
--- a/gcc/testsuite/gcc.target/i386/sse4_1-roundps-3.c
+++ b/gcc/testsuite/gcc.target/i386/sse4_1-roundps-3.c
@@ -7,7 +7,6 @@
#define VEC_T __m128
#define FP_T float
-#define ASM_SUFFIX "s"
#define ROUND_INTRIN(x, mode) _mm_floor_ps(x)
#define ROUND_MODE _MM_FROUND_FLOOR
diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-roundsd-1.c b/gcc/testsuite/gcc.target/i386/sse4_1-roundsd-1.c
index ae8881cf0f8..e6cec0b9478 100644
--- a/gcc/testsuite/gcc.target/i386/sse4_1-roundsd-1.c
+++ b/gcc/testsuite/gcc.target/i386/sse4_1-roundsd-1.c
@@ -7,7 +7,6 @@
#define VEC_T __m128d
#define FP_T double
-#define ASM_SUFFIX "l"
#define ROUND_INTRIN(x, mode) _mm_ceil_sd(x, x)
#define ROUND_MODE _MM_FROUND_CEIL
diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-roundsd-2.c b/gcc/testsuite/gcc.target/i386/sse4_1-roundsd-2.c
index 70679bb07a0..54ca21f8f2c 100644
--- a/gcc/testsuite/gcc.target/i386/sse4_1-roundsd-2.c
+++ b/gcc/testsuite/gcc.target/i386/sse4_1-roundsd-2.c
@@ -7,7 +7,6 @@
#define VEC_T __m128d
#define FP_T double
-#define ASM_SUFFIX "l"
#define ROUND_INTRIN(x, mode) _mm_round_sd(x, x, mode)
#define ROUND_MODE _MM_FROUND_NINT
diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-roundsd-3.c b/gcc/testsuite/gcc.target/i386/sse4_1-roundsd-3.c
index 81a3f760638..a59d6f86e5f 100644
--- a/gcc/testsuite/gcc.target/i386/sse4_1-roundsd-3.c
+++ b/gcc/testsuite/gcc.target/i386/sse4_1-roundsd-3.c
@@ -7,7 +7,6 @@
#define VEC_T __m128d
#define FP_T double
-#define ASM_SUFFIX "l"
#define ROUND_INTRIN(x, mode) _mm_floor_sd(x, x)
#define ROUND_MODE _MM_FROUND_FLOOR
diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-roundsd-4.c b/gcc/testsuite/gcc.target/i386/sse4_1-roundsd-4.c
index 124f825021d..ff8b09eeba6 100644
--- a/gcc/testsuite/gcc.target/i386/sse4_1-roundsd-4.c
+++ b/gcc/testsuite/gcc.target/i386/sse4_1-roundsd-4.c
@@ -36,7 +36,7 @@ init_round (double *src)
static double
do_round (double f, int type)
{
- short saved_cw, new_cw, clr_mask;
+ unsigned short saved_cw, new_cw, clr_mask;
double ret;
if ((type & 4))
@@ -50,16 +50,15 @@ do_round (double f, int type)
clr_mask = ~0x0C3F;
}
- __asm__ ("fldl %0" : : "m" (*&f));
+ __asm__ ("fnstcw %0" : "=m" (saved_cw));
- __asm__ ("fstcw %0" : "=m" (*&saved_cw));
new_cw = saved_cw & clr_mask;
new_cw |= type;
- __asm__ ("fldcw %0" : : "m" (*&new_cw));
- __asm__ ("frndint\n"
- "fstpl %0\n" : "=m" (*&ret));
- __asm__ ("fldcw %0" : : "m" (*&saved_cw));
+ __asm__ ("fldcw %2\n\t"
+ "frndint\n\t"
+ "fldcw %3" : "=t" (ret)
+ : "0" (f), "m" (new_cw), "m" (saved_cw));
return ret;
}
diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-roundss-1.c b/gcc/testsuite/gcc.target/i386/sse4_1-roundss-1.c
index 96dd8a6a76f..9c20b90ad05 100644
--- a/gcc/testsuite/gcc.target/i386/sse4_1-roundss-1.c
+++ b/gcc/testsuite/gcc.target/i386/sse4_1-roundss-1.c
@@ -7,7 +7,6 @@
#define VEC_T __m128
#define FP_T float
-#define ASM_SUFFIX "s"
#define ROUND_INTRIN(x, mode) _mm_ceil_ss(x, x)
#define ROUND_MODE _MM_FROUND_CEIL
diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-roundss-2.c b/gcc/testsuite/gcc.target/i386/sse4_1-roundss-2.c
index f052c029f7a..072664e1573 100644
--- a/gcc/testsuite/gcc.target/i386/sse4_1-roundss-2.c
+++ b/gcc/testsuite/gcc.target/i386/sse4_1-roundss-2.c
@@ -7,7 +7,6 @@
#define VEC_T __m128
#define FP_T float
-#define ASM_SUFFIX "s"
#define ROUND_INTRIN(x, mode) _mm_round_ss(x, x, mode)
#define ROUND_MODE _MM_FROUND_NINT
diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-roundss-3.c b/gcc/testsuite/gcc.target/i386/sse4_1-roundss-3.c
index 0a696b1cfb7..97c69fdbcb2 100644
--- a/gcc/testsuite/gcc.target/i386/sse4_1-roundss-3.c
+++ b/gcc/testsuite/gcc.target/i386/sse4_1-roundss-3.c
@@ -7,7 +7,6 @@
#define VEC_T __m128
#define FP_T float
-#define ASM_SUFFIX "s"
#define ROUND_INTRIN(x, mode) _mm_floor_ss(x, x)
#define ROUND_MODE _MM_FROUND_FLOOR
diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-roundss-4.c b/gcc/testsuite/gcc.target/i386/sse4_1-roundss-4.c
index 71042d1b777..95488908630 100644
--- a/gcc/testsuite/gcc.target/i386/sse4_1-roundss-4.c
+++ b/gcc/testsuite/gcc.target/i386/sse4_1-roundss-4.c
@@ -36,7 +36,7 @@ init_round (float *src)
static float
do_round (float f, int type)
{
- short saved_cw, new_cw, clr_mask;
+ unsigned short saved_cw, new_cw, clr_mask;
float ret;
if ((type & 4))
@@ -50,16 +50,15 @@ do_round (float f, int type)
clr_mask = ~0x0C3F;
}
- __asm__ ("flds %0" : : "m" (*&f));
+ __asm__ ("fnstcw %0" : "=m" (saved_cw));
- __asm__ ("fstcw %0" : "=m" (*&saved_cw));
new_cw = saved_cw & clr_mask;
new_cw |= type;
- __asm__ ("fldcw %0" : : "m" (*&new_cw));
- __asm__ ("frndint\n"
- "fstps %0\n" : "=m" (*&ret));
- __asm__ ("fldcw %0" : : "m" (*&saved_cw));
+ __asm__ ("fldcw %2\n\t"
+ "frndint\n\t"
+ "fldcw %3" : "=t" (ret)
+ : "0" (f), "m" (new_cw), "m" (saved_cw));
return ret;
}
diff --git a/gcc/testsuite/gcc.target/ia64/pr60465-gprel64-c37.c b/gcc/testsuite/gcc.target/ia64/pr60465-gprel64-c37.c
new file mode 100644
index 00000000000..a7e6809eb6d
--- /dev/null
+++ b/gcc/testsuite/gcc.target/ia64/pr60465-gprel64-c37.c
@@ -0,0 +1,10 @@
+/* { dg-do compile { target ia64-*-* } } */
+/* { dg-options "-O2 -fpic" } */
+/* { dg-final { scan-assembler-not "@ltoffx" } } */
+
+/* A bit of https://bugzilla.redhat.com/show_bug.cgi?id=33354
+ where many stores to static variables overflow .sdata */
+
+static const char *s90;
+void f() { s90 = "string 90"; }
+const char * g() { return s90; }
diff --git a/gcc/testsuite/gcc.target/ia64/pr60465-gprel64.c b/gcc/testsuite/gcc.target/ia64/pr60465-gprel64.c
new file mode 100644
index 00000000000..c00ecc947d9
--- /dev/null
+++ b/gcc/testsuite/gcc.target/ia64/pr60465-gprel64.c
@@ -0,0 +1,27 @@
+/* { dg-do compile { target ia64-*-* } } */
+/* { dg-options "-O2 -fpic" } */
+/* { dg-final { scan-assembler-not "@ltoffx" } } */
+
+/* Test imitates early ld.so setup in glibc
+ where no dynamic relocations must be present. */
+
+struct rtld_global
+{
+ long *p[77];
+};
+
+struct rtld_global _rtld_local __attribute__ ((visibility ("hidden"), section (".sdata")));
+
+static void __attribute__ ((unused, noinline))
+elf_get_dynamic_info (struct rtld_global * g, long * dyn)
+{
+ long **info = g->p;
+
+ info[(0x6ffffeff - *dyn) + 66] = dyn;
+}
+
+void __attribute__ ((unused, noinline))
+_dl_start (long * dyn)
+{
+ elf_get_dynamic_info(&_rtld_local, dyn);
+}
diff --git a/gcc/testsuite/gcc.target/m68k/pr63347.c b/gcc/testsuite/gcc.target/m68k/pr63347.c
new file mode 100644
index 00000000000..1d23e9a827a
--- /dev/null
+++ b/gcc/testsuite/gcc.target/m68k/pr63347.c
@@ -0,0 +1,46 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -mcpu=5208" } */
+
+#include <stdlib.h>
+
+void __attribute__ ((noinline))
+oof()
+{
+ asm volatile ("" ::: "memory");
+}
+int print_info(unsigned int *ip_addr)
+{
+ int invalid = 0;
+
+ if (ip_addr) {
+ unsigned int haddr = *ip_addr;
+ oof("stuff");
+ if (0x0 == haddr) {
+ invalid = 1;
+ }
+ oof("stuff2");
+ } else {
+ invalid = 1;
+ }
+
+ return invalid;
+}
+
+int main(int argc, char *argv[])
+{
+ unsigned int myaddr;
+ int ret;
+
+ myaddr = 0x0;
+ ret = print_info(&myaddr);
+ if (!ret)
+ abort ();
+
+ myaddr = 0x01020304;
+ ret = print_info(&myaddr);
+ if (ret)
+ abort ();
+ exit (0);
+}
+
+
diff --git a/gcc/testsuite/gcc.target/powerpc/pr68872.c b/gcc/testsuite/gcc.target/powerpc/pr68872.c
new file mode 100644
index 00000000000..68f388efaa2
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/pr68872.c
@@ -0,0 +1,14 @@
+/* PR target/68872 */
+/* { dg-do assemble { target { powerpc64le-*-* } } } */
+/* { dg-options "-mcpu=powerpc64le" } */
+
+/* Verify that -mcpu=powerpc64le passes -mpower8/-mpwr8 to the assembler. */
+
+long
+bar (unsigned char *ptr, unsigned char val)
+{
+ long ret;
+ asm volatile ("stbcx. %0,0,%1" :: "r" (val), "r" (ptr));
+ asm volatile ("mfcr %0,8" : "=r" (ret) ::);
+ return ret;
+}
diff --git a/gcc/testsuite/gcc.target/powerpc/pr69548.c b/gcc/testsuite/gcc.target/powerpc/pr69548.c
new file mode 100644
index 00000000000..439f588b874
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/pr69548.c
@@ -0,0 +1,11 @@
+/* { dg-do assemble { target { powerpc*-*-* && lp64 } } } */
+/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */
+/* { dg-require-effective-target powerpc_p8vector_ok } */
+/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power8" } } */
+/* { dg-options "-mcpu=power8 -Os -mbig" } */
+
+__int128
+quad_exchange (__int128 *ptr, __int128 newval)
+{
+ return __atomic_exchange_n (ptr, newval, __ATOMIC_RELAXED);
+}
diff --git a/gcc/testsuite/gcc.target/powerpc/pr70117.c b/gcc/testsuite/gcc.target/powerpc/pr70117.c
new file mode 100644
index 00000000000..f1fdedb6c59
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/pr70117.c
@@ -0,0 +1,92 @@
+/* { dg-do run { target { powerpc*-*-linux* powerpc*-*-darwin* powerpc*-*-aix* rs6000-*-* } } } */
+/* { dg-options "-std=c99 -mlong-double-128 -O2" } */
+
+#include <float.h>
+
+union gl_long_double_union
+{
+ struct { double hi; double lo; } dd;
+ long double ld;
+};
+
+/* This is gnulib's LDBL_MAX which, being 107 bits in precision, is
+ slightly larger than gcc's 106 bit precision LDBL_MAX. */
+volatile union gl_long_double_union gl_LDBL_MAX =
+ { { DBL_MAX, DBL_MAX / (double)134217728UL / (double)134217728UL } };
+
+volatile double min_denorm = 0x1p-1074;
+volatile double ld_low = 0x1p-969;
+volatile double dinf = 1.0/0.0;
+volatile double dnan = 0.0/0.0;
+
+int
+main (void)
+{
+ long double ld;
+
+ ld = gl_LDBL_MAX.ld;
+ if (__builtin_isinfl (ld))
+ __builtin_abort ();
+ ld = -gl_LDBL_MAX.ld;
+ if (__builtin_isinfl (ld))
+ __builtin_abort ();
+
+ ld = gl_LDBL_MAX.ld;
+ if (!__builtin_isfinite (ld))
+ __builtin_abort ();
+ ld = -gl_LDBL_MAX.ld;
+ if (!__builtin_isfinite (ld))
+ __builtin_abort ();
+
+ ld = ld_low;
+ if (!__builtin_isnormal (ld))
+ __builtin_abort ();
+ ld = -ld_low;
+ if (!__builtin_isnormal (ld))
+ __builtin_abort ();
+
+ ld = -min_denorm;
+ ld += ld_low;
+ if (__builtin_isnormal (ld))
+ __builtin_abort ();
+ ld = min_denorm;
+ ld -= ld_low;
+ if (__builtin_isnormal (ld))
+ __builtin_abort ();
+
+ ld = 0.0;
+ if (__builtin_isnormal (ld))
+ __builtin_abort ();
+ ld = -0.0;
+ if (__builtin_isnormal (ld))
+ __builtin_abort ();
+
+ ld = LDBL_MAX;
+ if (!__builtin_isnormal (ld))
+ __builtin_abort ();
+ ld = -LDBL_MAX;
+ if (!__builtin_isnormal (ld))
+ __builtin_abort ();
+
+ ld = gl_LDBL_MAX.ld;
+ if (!__builtin_isnormal (ld))
+ __builtin_abort ();
+ ld = -gl_LDBL_MAX.ld;
+ if (!__builtin_isnormal (ld))
+ __builtin_abort ();
+
+ ld = dinf;
+ if (__builtin_isnormal (ld))
+ __builtin_abort ();
+ ld = -dinf;
+ if (__builtin_isnormal (ld))
+ __builtin_abort ();
+
+ ld = dnan;
+ if (__builtin_isnormal (ld))
+ __builtin_abort ();
+ ld = -dnan;
+ if (__builtin_isnormal (ld))
+ __builtin_abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/powerpc/pr70963.c b/gcc/testsuite/gcc.target/powerpc/pr70963.c
new file mode 100644
index 00000000000..128ebd9f09f
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/pr70963.c
@@ -0,0 +1,44 @@
+/* { dg-do run { target powerpc64*-*-* } } */
+/* { dg-require-effective-target p8vector_hw } */
+/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */
+/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power8" } } */
+/* { dg-options "-mcpu=power8" } */
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <altivec.h>
+
+static int failed;
+static void test (void);
+
+static void check (int result, const char *name)
+{
+ if (!result)
+ {
+ failed++;
+ printf ("fail %s\n", name);
+ }
+}
+
+int main (void)
+{
+ test ();
+ if (failed)
+ abort ();
+ return 0;
+}
+
+vector double x = { 81.0, 76.0 };
+vector long long y = { 81, 76 };
+
+static void test()
+{
+ vector long long a = vec_cts (x, 0);
+ vector double b = vec_ctf (a, 0);
+ vector long long c = __builtin_vsx_xvcvdpuxds_scale (x, 0);
+ vector double d = vec_ctf (c, 0);
+ check (vec_all_eq (a, y), "vec_cts");
+ check (vec_all_eq (b, x), "vec_ctf");
+ check (vec_all_eq (c, y), "xvcvdpuxds");
+ check (vec_all_eq (d, x), "vec_ctf unsigned");
+}
diff --git a/gcc/testsuite/gcc.target/powerpc/vec-cg.c b/gcc/testsuite/gcc.target/powerpc/vec-cg.c
new file mode 100644
index 00000000000..c31d217d880
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/vec-cg.c
@@ -0,0 +1,22 @@
+/* Test code generation of vector built-ins. We don't have this for
+ most of ours today. As new built-ins are added, please add to this
+ test case. Update as necessary to add VSX, P8-vector, P9-vector,
+ etc. */
+
+/* { dg-do compile { target powerpc*-*-* } } */
+/* { dg-require-effective-target powerpc_altivec_ok } */
+/* { dg-options "-maltivec -O0" } */
+
+#include <altivec.h>
+
+static vector signed int i, *pi;
+static int int1;
+
+void
+b()
+{
+ i = __builtin_altivec_lvxl (int1, pi);
+ i = vec_lvxl (int1, pi);
+}
+
+/* { dg-final { scan-assembler-times "lvxl" 2 } } */
diff --git a/gcc/testsuite/gcc.target/s390/gpr2fprsavecfi.c b/gcc/testsuite/gcc.target/s390/gpr2fprsavecfi.c
new file mode 100644
index 00000000000..92a0d3ae29a
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/gpr2fprsavecfi.c
@@ -0,0 +1,23 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -march=z10 -mzarch -fdwarf2-cfi-asm" } */
+
+char *gl[100];
+
+long
+foo ()
+{
+ long r = 0;
+ char bla[100];
+ int i;
+
+ __builtin_memcpy (bla, gl, 100);
+
+ for (i = 0; i < 100; i++)
+ r += bla[i];
+
+ return r;
+}
+
+/* { dg-final { scan-assembler-not "cfi_def_cfa_register" } } */
+/* { dg-final { scan-assembler "cfi_register" } } */
+/* { dg-final { scan-assembler "cfi_def_cfa_offset" } } */
diff --git a/gcc/testsuite/gcc.target/s390/pr70674.c b/gcc/testsuite/gcc.target/s390/pr70674.c
new file mode 100644
index 00000000000..13bf271d95f
--- /dev/null
+++ b/gcc/testsuite/gcc.target/s390/pr70674.c
@@ -0,0 +1,13 @@
+/* Test case for PR/70674. */
+
+/* { dg-do compile { target s390x-*-* } } */
+/* { dg-options "-march=z10 -mtune=z196 -O2 -fno-omit-frame-pointer -fno-asynchronous-unwind-tables" } */
+
+void
+foo (void)
+{
+ volatile int a = 5;
+ (void) a;
+}
+
+/* { dg-final { scan-assembler-not "^.*lgdr.*\n.*\\(%r11\\)" } } */
diff --git a/gcc/testsuite/gcc.target/sh/torture/pr67260.c b/gcc/testsuite/gcc.target/sh/torture/pr67260.c
new file mode 100644
index 00000000000..a7b70f0c99d
--- /dev/null
+++ b/gcc/testsuite/gcc.target/sh/torture/pr67260.c
@@ -0,0 +1,12 @@
+/* { dg-additional-options "-std=gnu99 -fPIC" } */
+/* { dg-do compile } */
+
+#pragma GCC visibility push(hidden)
+
+double _Complex foo (double _Complex arg);
+
+double _Complex
+bar (double _Complex arg)
+{
+ return foo (arg);
+}
diff --git a/gcc/testsuite/gcc.target/sparc/sparc-ret.c b/gcc/testsuite/gcc.target/sparc/sparc-ret-1.c
index f58b059e5aa..f58b059e5aa 100644
--- a/gcc/testsuite/gcc.target/sparc/sparc-ret.c
+++ b/gcc/testsuite/gcc.target/sparc/sparc-ret-1.c
diff --git a/gcc/testsuite/gcc.target/sparc/sparc-ret-2.c b/gcc/testsuite/gcc.target/sparc/sparc-ret-2.c
new file mode 100644
index 00000000000..536b9b75a4c
--- /dev/null
+++ b/gcc/testsuite/gcc.target/sparc/sparc-ret-2.c
@@ -0,0 +1,13 @@
+/* PR target/57845 */
+
+/* { dg-do compile } */
+/* { dg-options "-freg-struct-return" } */
+
+struct S { short int i; };
+
+struct S foo (short int i)
+{
+ struct S s;
+ s.i = i;
+ return s;
+}
diff --git a/gcc/testsuite/gfortran.dg/allocate_with_arrayspec_1.f90 b/gcc/testsuite/gfortran.dg/allocate_with_arrayspec_1.f90
new file mode 100644
index 00000000000..686b612408a
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/allocate_with_arrayspec_1.f90
@@ -0,0 +1,29 @@
+! { dg-do run }
+! { dg-options "-fdump-tree-original" }
+
+MODULE mo_test
+
+ integer :: n = 0
+CONTAINS
+
+ FUNCTION nquery()
+ INTEGER :: nquery
+ WRITE (0,*) "hello!"
+ n = n + 1
+ nquery = n
+ END FUNCTION nquery
+
+END MODULE mo_test
+
+
+! ----------------------------------------------------------------------
+! MAIN PROGRAM
+! ----------------------------------------------------------------------
+PROGRAM example
+ USE mo_test
+ INTEGER, ALLOCATABLE :: query_buf(:)
+ ALLOCATE(query_buf(nquery()))
+ if (n /= 1 .or. size(query_buf) /= n) call abort()
+END PROGRAM example
+
+! { dg-final { scan-tree-dump-times "nquery" 5 "original" } }
diff --git a/gcc/testsuite/gfortran.dg/fmt_pf.f90 b/gcc/testsuite/gfortran.dg/fmt_pf.f90
new file mode 100644
index 00000000000..6cefa86e4a8
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/fmt_pf.f90
@@ -0,0 +1,226 @@
+! { dg-do run }
+! PR70235 Incorrect output with PF format.
+! Test case provided by Antoine Gardeux.
+program pr70235
+use ISO_FORTRAN_ENV
+ implicit none
+ integer, parameter :: j(size(real_kinds)+4)=[REAL_KINDS, [4, 4, 4, 4]]
+ logical :: l_skip(4) = .false.
+ integer :: i
+ integer :: n_tst = 0, n_cnt = 0, n_skip = 0
+ character(len=20) :: s, s1
+
+! Check that the default rounding mode is to nearest and to even on tie.
+ do i=1,size(real_kinds)
+ if (i == 1) then
+ write(s, '(2F4.1,2F4.0)') real(-9.49999905,kind=j(1)), &
+ real(9.49999905,kind=j(1)), &
+ real(9.5,kind=j(1)), real(8.5,kind=j(1))
+ write(s1, '(3PE10.3,2PE10.3)') real(987350.,kind=j(1)), &
+ real(98765.0,kind=j(1))
+ else if (i == 2) then
+ write(s, '(2F4.1,2F4.0)') real(-9.49999905,kind=j(2)), &
+ real(9.49999905,kind=j(2)), &
+ real(9.5,kind=j(2)), real(8.5,kind=j(2))
+ write(s1, '(3PE10.3,2PE10.3)') real(987350.,kind=j(2)), &
+ real(98765.0,kind=j(2))
+ else if (i == 3) then
+ write(s, '(2F4.1,2F4.0)') real(-9.49999905,kind=j(3)), &
+ real(9.49999905,kind=j(3)), &
+ real(9.5,kind=j(3)), real(8.5,kind=j(3))
+ write(s1, '(3PE10.3,2PE10.3)') real(987350.,kind=j(3)), &
+ real(98765.0,kind=j(3))
+ else if (i == 4) then
+ write(s, '(2F4.1,2F4.0)') real(-9.49999905,kind=j(4)), &
+ real(9.49999905,kind=j(4)), &
+ real(9.5,kind=j(4)), real(8.5,kind=j(4))
+ write(s1, '(3PE10.3,2PE10.3)') real(987350.,kind=j(4)), &
+ real(98765.0,kind=j(4))
+ end if
+ if (s /= '-9.5 9.5 10. 8.' .or. s1 /= ' 987.4E+03 98.76E+03') then
+ l_skip(i) = .true.
+! print "('Unsupported rounding for real(',i0,')')", j(i)
+ end if
+ end do
+
+
+! Original test.
+ call checkfmt("(-6PF8.3)", 1.0e4, " 0.010")
+ call checkfmt("(-6PF8.3)", 0.0, " 0.000")
+
+! Test for the bug in comment 6.
+ call checkfmt("(-8pf18.3)", 643.125, " 0.000")
+ call checkfmt("(-7pf18.3)", 643.125, " 0.000")
+ call checkfmt("(-6pf18.3)", 643.125, " 0.001")
+ call checkfmt("(-5pf18.3)", 643.125, " 0.006")
+ call checkfmt("(-4pf18.3)", 643.125, " 0.064")
+ call checkfmt("(-3pf18.3)", 643.125, " 0.643")
+ call checkfmt("(-2pf18.3)", 643.125, " 6.431")
+ call checkfmt("(-1pf18.3)", 643.125, " 64.312")
+ call checkfmt("( 0pf18.3)", 643.125, " 643.125")
+
+ call checkfmt("(ru,-8pf18.3)", 643.125, " 0.001")
+ call checkfmt("(ru,-7pf18.3)", 643.125, " 0.001")
+ call checkfmt("(ru,-6pf18.3)", 643.125, " 0.001")
+ call checkfmt("(ru,-5pf18.3)", 643.125, " 0.007")
+ call checkfmt("(ru,-4pf18.3)", 643.125, " 0.065")
+ call checkfmt("(ru,-3pf18.3)", 643.125, " 0.644")
+ call checkfmt("(ru,-2pf18.3)", 643.125, " 6.432")
+ call checkfmt("(ru,-1pf18.3)", 643.125, " 64.313")
+ call checkfmt("(ru, 0pf18.3)", 643.125, " 643.125")
+
+ call checkfmt("(rd,-8pf18.3)", 643.125, " 0.000")
+ call checkfmt("(rd,-7pf18.3)", 643.125, " 0.000")
+ call checkfmt("(rd,-6pf18.3)", 643.125, " 0.000")
+ call checkfmt("(rd,-5pf18.3)", 643.125, " 0.006")
+ call checkfmt("(rd,-4pf18.3)", 643.125, " 0.064")
+ call checkfmt("(rd,-3pf18.3)", 643.125, " 0.643")
+ call checkfmt("(rd,-2pf18.3)", 643.125, " 6.431")
+ call checkfmt("(rd,-1pf18.3)", 643.125, " 64.312")
+ call checkfmt("(rd, 0pf18.3)", 643.125, " 643.125")
+
+ call checkfmt("(rz,-8pf18.3)", 643.125, " 0.000")
+ call checkfmt("(rz,-7pf18.3)", 643.125, " 0.000")
+ call checkfmt("(rz,-6pf18.3)", 643.125, " 0.000")
+ call checkfmt("(rz,-5pf18.3)", 643.125, " 0.006")
+ call checkfmt("(rz,-4pf18.3)", 643.125, " 0.064")
+ call checkfmt("(rz,-3pf18.3)", 643.125, " 0.643")
+ call checkfmt("(rz,-2pf18.3)", 643.125, " 6.431")
+ call checkfmt("(rz,-1pf18.3)", 643.125, " 64.312")
+ call checkfmt("(rz, 0pf18.3)", 643.125, " 643.125")
+
+ call checkfmt("(rc,-8pf18.3)", 643.125, " 0.000")
+ call checkfmt("(rc,-7pf18.3)", 643.125, " 0.000")
+ call checkfmt("(rc,-6pf18.3)", 643.125, " 0.001")
+ call checkfmt("(rc,-5pf18.3)", 643.125, " 0.006")
+ call checkfmt("(rc,-4pf18.3)", 643.125, " 0.064")
+ call checkfmt("(rc,-3pf18.3)", 643.125, " 0.643")
+ call checkfmt("(rc,-2pf18.3)", 643.125, " 6.431")
+ call checkfmt("(rc,-1pf18.3)", 643.125, " 64.313")
+ call checkfmt("(rc, 0pf18.3)", 643.125, " 643.125")
+
+ call checkfmt("(rn,-8pf18.3)", 643.125, " 0.000")
+ call checkfmt("(rn,-7pf18.3)", 643.125, " 0.000")
+ call checkfmt("(rn,-6pf18.3)", 643.125, " 0.001")
+ call checkfmt("(rn,-5pf18.3)", 643.125, " 0.006")
+ call checkfmt("(rn,-4pf18.3)", 643.125, " 0.064")
+ call checkfmt("(rn,-3pf18.3)", 643.125, " 0.643")
+ call checkfmt("(rn,-2pf18.3)", 643.125, " 6.431")
+ call checkfmt("(rn,-1pf18.3)", 643.125, " 64.312")
+ call checkfmt("(rn, 0pf18.3)", 643.125, " 643.125")
+
+ call checkfmt("(rp,-8pf18.3)", 643.125, " 0.000")
+ call checkfmt("(rp,-7pf18.3)", 643.125, " 0.000")
+ call checkfmt("(rp,-6pf18.3)", 643.125, " 0.001")
+ call checkfmt("(rp,-5pf18.3)", 643.125, " 0.006")
+ call checkfmt("(rp,-4pf18.3)", 643.125, " 0.064")
+ call checkfmt("(rp,-3pf18.3)", 643.125, " 0.643")
+ call checkfmt("(rp,-2pf18.3)", 643.125, " 6.431")
+ call checkfmt("(rp,-1pf18.3)", 643.125, " 64.312")
+ call checkfmt("(rp, 0pf18.3)", 643.125, " 643.125")
+
+ call checkfmt("(-8pf18.3)", -643.125, " -0.000")
+ call checkfmt("(-7pf18.3)", -643.125, " -0.000")
+ call checkfmt("(-6pf18.3)", -643.125, " -0.001")
+ call checkfmt("(-5pf18.3)", -643.125, " -0.006")
+ call checkfmt("(-4pf18.3)", -643.125, " -0.064")
+ call checkfmt("(-3pf18.3)", -643.125, " -0.643")
+ call checkfmt("(-2pf18.3)", -643.125, " -6.431")
+ call checkfmt("(-1pf18.3)", -643.125, " -64.312")
+ call checkfmt("( 0pf18.3)", -643.125, " -643.125")
+
+ call checkfmt("(ru,-8pf18.3)", -643.125, " -0.000")
+ call checkfmt("(ru,-7pf18.3)", -643.125, " -0.000")
+ call checkfmt("(ru,-6pf18.3)", -643.125, " -0.000")
+ call checkfmt("(ru,-5pf18.3)", -643.125, " -0.006")
+ call checkfmt("(ru,-4pf18.3)", -643.125, " -0.064")
+ call checkfmt("(ru,-3pf18.3)", -643.125, " -0.643")
+ call checkfmt("(ru,-2pf18.3)", -643.125, " -6.431")
+ call checkfmt("(ru,-1pf18.3)", -643.125, " -64.312")
+ call checkfmt("(ru, 0pf18.3)", -643.125, " -643.125")
+
+ call checkfmt("(rd,-8pf18.3)", -643.125, " -0.001")
+ call checkfmt("(rd,-7pf18.3)", -643.125, " -0.001")
+ call checkfmt("(rd,-6pf18.3)", -643.125, " -0.001")
+ call checkfmt("(rd,-5pf18.3)", -643.125, " -0.007")
+ call checkfmt("(rd,-4pf18.3)", -643.125, " -0.065")
+ call checkfmt("(rd,-3pf18.3)", -643.125, " -0.644")
+ call checkfmt("(rd,-2pf18.3)", -643.125, " -6.432")
+ call checkfmt("(rd,-1pf18.3)", -643.125, " -64.313")
+ call checkfmt("(rd, 0pf18.3)", -643.125, " -643.125")
+
+ call checkfmt("(rz,-8pf18.3)", -643.125, " -0.000")
+ call checkfmt("(rz,-7pf18.3)", -643.125, " -0.000")
+ call checkfmt("(rz,-6pf18.3)", -643.125, " -0.000")
+ call checkfmt("(rz,-5pf18.3)", -643.125, " -0.006")
+ call checkfmt("(rz,-4pf18.3)", -643.125, " -0.064")
+ call checkfmt("(rz,-3pf18.3)", -643.125, " -0.643")
+ call checkfmt("(rz,-2pf18.3)", -643.125, " -6.431")
+ call checkfmt("(rz,-1pf18.3)", -643.125, " -64.312")
+ call checkfmt("(rz, 0pf18.3)", -643.125, " -643.125")
+
+ call checkfmt("(rc,-8pf18.3)", -643.125, " -0.000")
+ call checkfmt("(rc,-7pf18.3)", -643.125, " -0.000")
+ call checkfmt("(rc,-6pf18.3)", -643.125, " -0.001")
+ call checkfmt("(rc,-5pf18.3)", -643.125, " -0.006")
+ call checkfmt("(rc,-4pf18.3)", -643.125, " -0.064")
+ call checkfmt("(rc,-3pf18.3)", -643.125, " -0.643")
+ call checkfmt("(rc,-2pf18.3)", -643.125, " -6.431")
+ call checkfmt("(rc,-1pf18.3)", -643.125, " -64.313")
+ call checkfmt("(rc, 0pf18.3)", -643.125, " -643.125")
+
+ call checkfmt("(rn,-8pf18.3)", -643.125, " -0.000")
+ call checkfmt("(rn,-7pf18.3)", -643.125, " -0.000")
+ call checkfmt("(rn,-6pf18.3)", -643.125, " -0.001")
+ call checkfmt("(rn,-5pf18.3)", -643.125, " -0.006")
+ call checkfmt("(rn,-4pf18.3)", -643.125, " -0.064")
+ call checkfmt("(rn,-3pf18.3)", -643.125, " -0.643")
+ call checkfmt("(rn,-2pf18.3)", -643.125, " -6.431")
+ call checkfmt("(rn,-1pf18.3)", -643.125, " -64.312")
+ call checkfmt("(rn, 0pf18.3)", -643.125, " -643.125")
+
+ call checkfmt("(rp,-8pf18.3)", -643.125, " -0.000")
+ call checkfmt("(rp,-7pf18.3)", -643.125, " -0.000")
+ call checkfmt("(rp,-6pf18.3)", -643.125, " -0.001")
+ call checkfmt("(rp,-5pf18.3)", -643.125, " -0.006")
+ call checkfmt("(rp,-4pf18.3)", -643.125, " -0.064")
+ call checkfmt("(rp,-3pf18.3)", -643.125, " -0.643")
+ call checkfmt("(rp,-2pf18.3)", -643.125, " -6.431")
+ call checkfmt("(rp,-1pf18.3)", -643.125, " -64.312")
+ call checkfmt("(rp, 0pf18.3)", -643.125, " -643.125")
+
+ ! print *, n_tst, n_cnt, n_skip
+ if (n_cnt /= 0) call abort
+ if (all(.not. l_skip)) print *, "All kinds rounded to nearest"
+
+contains
+ subroutine checkfmt(fmt, x, cmp)
+ implicit none
+ integer :: i
+ character(len=*), intent(in) :: fmt
+ real, intent(in) :: x
+ character(len=*), intent(in) :: cmp
+ do i=1,size(real_kinds)
+ if (i == 1) then
+ write(s, fmt) real(x,kind=j(1))
+ else if (i == 2) then
+ write(s, fmt) real(x,kind=j(2))
+ else if (i == 3) then
+ write(s, fmt) real(x,kind=j(3))
+ else if (i == 4) then
+ write(s, fmt) real(x,kind=j(4))
+ end if
+ n_tst = n_tst + 1
+ if (s /= cmp) then
+ if (l_skip(i)) then
+ n_skip = n_skip + 1
+ else
+ print "(a,1x,a,' expected: ',1x,a)", fmt, s, cmp
+ n_cnt = n_cnt + 1
+ end if
+ end if
+ end do
+
+ end subroutine
+end program
+! { dg-output "All kinds rounded to nearest" { xfail { i?86-*-solaris2.9* hppa*-*-hpux* } } }
diff --git a/gcc/testsuite/gfortran.dg/gomp/pr69128.f90 b/gcc/testsuite/gfortran.dg/gomp/pr69128.f90
new file mode 100644
index 00000000000..248c404ad41
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/gomp/pr69128.f90
@@ -0,0 +1,23 @@
+! PR fortran/69128
+! { dg-do compile }
+
+program test
+ implicit none
+ interface
+ subroutine use(b, c)
+ real, allocatable :: b(:), c(:)
+ end subroutine
+ end interface
+ real, allocatable :: a(:,:), b(:), c(:)
+ integer :: dim1, dim2, i,j
+ dim1=10000
+ dim2=500
+ allocate(a(dim1,dim2),b(dim1),c(dim1))
+ call random_number(a)
+
+!$omp parallel workshare
+ b(:) = maxval(a(:,:), dim=2)
+ c(:) = sum(a(:,:), dim=2)
+!$omp end parallel workshare
+ call use(b, c)
+end program
diff --git a/gcc/testsuite/gfortran.dg/gomp/pr71704.f90 b/gcc/testsuite/gfortran.dg/gomp/pr71704.f90
new file mode 100644
index 00000000000..5c1c003ca57
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/gomp/pr71704.f90
@@ -0,0 +1,58 @@
+! PR fortran/71704
+! { dg-do compile }
+
+real function f0 ()
+!$omp declare simd (f0)
+ f0 = 1
+end
+
+real function f1 ()
+!$omp declare target (f1)
+ f1 = 1
+end
+
+real function f2 ()
+!$omp declare reduction (foo : integer : omp_out = omp_out + omp_in) &
+!$omp & initializer (omp_priv = 0)
+ f2 = 1
+end
+
+real function f3 ()
+ real, save :: t
+!$omp threadprivate (t)
+ f3 = 1
+end
+
+real function f4 ()
+!$omp taskwait
+ f4 = 1
+end
+
+real function f5 ()
+!$omp barrier
+ f5 = 1
+end
+
+real function f6 ()
+!$omp parallel
+!$omp end parallel
+ f6 = 1
+end
+
+real function f7 ()
+!$omp single
+!$omp end single
+ f7 = 1
+end
+
+real function f8 ()
+!$omp critical
+!$omp end critical
+ f8 = 1
+end
+
+real function f9 ()
+!$omp critical
+!$omp end critical
+ f9 = 1
+end
diff --git a/gcc/testsuite/gfortran.dg/gomp/pr71705.f90 b/gcc/testsuite/gfortran.dg/gomp/pr71705.f90
new file mode 100644
index 00000000000..4813aacfdc3
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/gomp/pr71705.f90
@@ -0,0 +1,7 @@
+! PR fortran/71705
+! { dg-do compile }
+
+ real :: x
+ x = 0.0
+ !$omp target update to(x)
+end
diff --git a/gcc/testsuite/gfortran.dg/gomp/pr71758.f90 b/gcc/testsuite/gfortran.dg/gomp/pr71758.f90
new file mode 100644
index 00000000000..47215ba5cd9
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/gomp/pr71758.f90
@@ -0,0 +1,10 @@
+! PR middle-end/71758
+
+subroutine pr71758 (p)
+ integer(8) :: i
+ integer :: p(20)
+ i = 0
+ !$omp target device(i)
+ !$omp end target
+ !$omp target update to(p(1:1)) device(i)
+end subroutine
diff --git a/gcc/testsuite/gfortran.dg/include_6.f90 b/gcc/testsuite/gfortran.dg/include_6.f90
index 0bac3909b8a..d2b48eb595b 100644
--- a/gcc/testsuite/gfortran.dg/include_6.f90
+++ b/gcc/testsuite/gfortran.dg/include_6.f90
@@ -1,5 +1,5 @@
! { dg-do compile }
! { dg-options "-I gfortran.log" }
-! { dg-warning "is not a directory" "" { target *-*-* } 0 }
+! { dg-error "is not a directory" "" { target *-*-* } 0 }
end
diff --git a/gcc/testsuite/gfortran.dg/list_read_14.f90 b/gcc/testsuite/gfortran.dg/list_read_14.f90
new file mode 100644
index 00000000000..15bcfad500d
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/list_read_14.f90
@@ -0,0 +1,25 @@
+! { dg-do run }
+! PR70684 incorrect reading of values from file on Windows
+program test
+implicit none
+integer,parameter :: isize=12
+integer,parameter :: funit=12
+integer :: i
+character(1), parameter :: cr=char(13)
+double precision, dimension(isize) :: a, res
+res= (/ 1.0000000000000000, 2.0000000000000000, 3.0000000000000000, &
+ 4.0000000000000000, 5.0000000000000000, 6.0000000000000000, &
+ 7.0000000000000000, 8.0000000000000000, 9.0000000000000000, &
+ 10.000000000000000, 11.000000000000000, 12.000000000000000 /)
+do i=1,isize
+ a(i)=dble(i)
+enddo
+open(funit,status="scratch")
+write(funit,'(1x,6(f25.20,'',''),a)') (a(i),i=1,6), cr
+write(funit,'(1x,6(f25.20,'',''),a)') (a(i),i=7,12), cr
+rewind(funit)
+a=0d0
+read(funit,*) (a(i),i=1,isize)
+close(funit)
+if (any(a /= res)) call abort
+end
diff --git a/gcc/testsuite/gfortran.dg/namelist_38.f90 b/gcc/testsuite/gfortran.dg/namelist_38.f90
index 5578654eea4..b51463cfa8a 100644
--- a/gcc/testsuite/gfortran.dg/namelist_38.f90
+++ b/gcc/testsuite/gfortran.dg/namelist_38.f90
@@ -5,6 +5,7 @@
program main
implicit none
character(len=3) :: a
+ character(25) :: b
namelist /foo/ a
open(10, status="scratch", delim="quote")
@@ -28,9 +29,12 @@ program main
open(10, status="scratch", delim="none")
a = "a'a"
write(10,foo)
- rewind 10
- a = ""
- read (10,foo)
- if (a.ne."a'a") call abort
- close (10)
+ rewind (10)
+ read(10,"(a)") b
+ if (b .ne. "&FOO") call abort
+ read(10,"(a)") b
+ if (b .ne. " A=a'a") call abort
+ read(10,"(a)") b
+ if (b .ne. " /") call abort
+ close(10)
end program main
diff --git a/gcc/testsuite/gfortran.dg/namelist_84.f90 b/gcc/testsuite/gfortran.dg/namelist_84.f90
index af139d91edc..14b68a44e8a 100644
--- a/gcc/testsuite/gfortran.dg/namelist_84.f90
+++ b/gcc/testsuite/gfortran.dg/namelist_84.f90
@@ -17,12 +17,11 @@ program namelist_delim_none
write(10, mylist)
rewind(10)
mystring = "xxxxx"
- read(10,mylist)
- if (any(mystring /= (/ 'mon', 'tue', 'wed', 'thu', 'fri' /))) call abort
rewind(10)
do i=1,5
read(10,'(a)') internal_unit
- if (scan(internal_unit,"""'").ne.0) call abort
+ if (i.eq.2 .and. internal_unit .ne. " MYSTRING=mon tue wed thu fri ,") call abort
+ if (scan(internal_unit,"""'").ne.0) print *, internal_unit
end do
close(10)
end program
diff --git a/gcc/testsuite/gfortran.dg/pr60126.f90 b/gcc/testsuite/gfortran.dg/pr60126.f90
new file mode 100644
index 00000000000..038f54456f4
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr60126.f90
@@ -0,0 +1,18 @@
+! { dg-do compile }
+! PR fortran/60126 - ICE on pointer rank remapping
+! Based on testcase by Michel Valin <mfvalin at gmail dot com>
+
+subroutine simple_bug_demo
+ implicit none
+ interface
+ function offset_ptr_R4(nelements) result (dest)
+ implicit none
+ real, pointer, dimension(:) :: dest
+ integer, intent(IN) :: nelements
+ end function offset_ptr_R4
+ end interface
+
+ real, dimension(:,:), pointer :: R2D
+
+ R2D(-2:2,-3:3) => offset_ptr_R4(100)
+end
diff --git a/gcc/testsuite/gfortran.dg/pr66465.f90 b/gcc/testsuite/gfortran.dg/pr66465.f90
new file mode 100644
index 00000000000..ab868305051
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr66465.f90
@@ -0,0 +1,23 @@
+! { dg-do compile }
+!
+! Tests the fix for PR66465, in which the arguments of the call to
+! ASSOCIATED were falsly detected to have different type/kind.
+!
+! Contributed by Damian Rouson <damian@sourceryinstitute.org>
+!
+ interface
+ real function HandlerInterface (arg)
+ real :: arg
+ end
+ end interface
+
+ type TextHandlerTestCase
+ procedure (HandlerInterface), nopass, pointer :: handlerOut=>null()
+ end type
+
+ type(TextHandlerTestCase) this
+
+ procedure (HandlerInterface), pointer :: procPtr=>null()
+
+ print*, associated(procPtr, this%handlerOut)
+end
diff --git a/gcc/testsuite/gfortran.dg/pr70931.f90 b/gcc/testsuite/gfortran.dg/pr70931.f90
new file mode 100644
index 00000000000..08ecd687752
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr70931.f90
@@ -0,0 +1,10 @@
+! { dg-do compile }
+! { dg-options "-g" }
+program p
+ type t
+ integer :: a
+ integer :: b(0)
+ end type
+ type(t), parameter :: z = t(1, [2])
+ print *, z
+end
diff --git a/gcc/testsuite/gfortran.dg/pr71688.f90 b/gcc/testsuite/gfortran.dg/pr71688.f90
new file mode 100644
index 00000000000..dbb6d185cf4
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr71688.f90
@@ -0,0 +1,13 @@
+! { dg-do compile }
+! { dg-options "-fcoarray=lib" }
+
+program p
+ call s
+contains
+ subroutine s
+ real :: x[*] = 1
+ block
+ end block
+ x = 2
+ end
+end
diff --git a/gcc/testsuite/gfortran.dg/pr71764.f90 b/gcc/testsuite/gfortran.dg/pr71764.f90
new file mode 100644
index 00000000000..48176f8297e
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr71764.f90
@@ -0,0 +1,34 @@
+! { dg-do run }
+! PR71764
+program p
+ use iso_c_binding, only: c_ptr, c_null_ptr, c_ptr, c_associated, c_loc
+ logical, target :: rls
+ real, target :: t = 3.14
+ type(c_ptr) :: nullptr,c
+ real, pointer :: k
+ nullptr = c_null_ptr
+ c = nullptr
+ rls = c_associated(c)
+ if (rls) call abort
+ if (c_associated(c)) call abort
+ c = c_loc(rls)
+ if (.not. c_associated(c)) call abort
+ c = nullptr
+ if (c_associated(c)) call abort
+ c = c_loc(t)
+ k => t
+ call association_test(k, c)
+contains
+ subroutine association_test(a,b)
+ use iso_c_binding, only: c_associated, c_loc, c_ptr
+ implicit none
+ real, pointer :: a
+ type(c_ptr) :: b
+ if(c_associated(b, c_loc(a))) then
+ return
+ else
+ call abort
+ end if
+ end subroutine association_test
+end
+
diff --git a/gcc/testsuite/gfortran.dg/proc_ptr_47.f90 b/gcc/testsuite/gfortran.dg/proc_ptr_47.f90
new file mode 100644
index 00000000000..43084f67e40
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/proc_ptr_47.f90
@@ -0,0 +1,37 @@
+! { dg-do run }
+! Tests the fix for PR68196
+!
+! Contributed by Damian Rouson <damian@sourceryinstitute.org>
+!
+ type AA
+ integer :: i
+ procedure(foo), pointer :: funct
+ end type
+ class(AA), allocatable :: my_AA
+ type(AA) :: res
+
+ allocate (my_AA, source = AA (1, foo))
+
+ res = my_AA%funct ()
+
+ if (res%i .ne. 3) call abort
+ if (.not.associated (res%funct)) call abort
+ if (my_AA%i .ne. 4) call abort
+ if (associated (my_AA%funct)) call abort
+
+contains
+ function foo(A)
+ class(AA), allocatable :: A
+ type(AA) foo
+
+ if (.not.allocated (A)) then
+ allocate (A, source = AA (2, foo))
+ endif
+
+ select type (A)
+ type is (AA)
+ foo = AA (3, foo)
+ A = AA (4, NULL ())
+ end select
+ end function
+end
diff --git a/gcc/testsuite/gfortran.dg/prof/dynamic_dispatch_6.f03 b/gcc/testsuite/gfortran.dg/prof/dynamic_dispatch_6.f03
new file mode 100644
index 00000000000..82e4e6f9b8e
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/prof/dynamic_dispatch_6.f03
@@ -0,0 +1,68 @@
+! { dg-require-profiling "-fprofile-generate" }
+! { dg-options "-Ofast" }
+!
+! PR 45076: [OOP] gfortran.dg/dynamic_dispatch_6.f03 ICEs with -fprofile-use
+!
+! Contributed by Damian Rouson <damian@rouson.net>
+
+module field_module
+ implicit none
+ private
+ public :: field
+ type ,abstract :: field
+ end type
+end module
+
+module periodic_5th_order_module
+ use field_module ,only : field
+ implicit none
+ type ,extends(field) :: periodic_5th_order
+ end type
+end module
+
+module field_factory_module
+ implicit none
+ private
+ public :: field_factory
+ type, abstract :: field_factory
+ contains
+ procedure(create_interface), deferred :: create
+ end type
+ abstract interface
+ function create_interface(this)
+ use field_module ,only : field
+ import :: field_factory
+ class(field_factory), intent(in) :: this
+ class(field) ,pointer :: create_interface
+ end function
+ end interface
+end module
+
+module periodic_5th_factory_module
+ use field_factory_module , only : field_factory
+ implicit none
+ private
+ public :: periodic_5th_factory
+ type, extends(field_factory) :: periodic_5th_factory
+ contains
+ procedure :: create=>new_periodic_5th_order
+ end type
+contains
+ function new_periodic_5th_order(this)
+ use field_module ,only : field
+ use periodic_5th_order_module ,only : periodic_5th_order
+ class(periodic_5th_factory), intent(in) :: this
+ class(field) ,pointer :: new_periodic_5th_order
+ end function
+end module
+
+program main
+ use field_module ,only : field
+ use field_factory_module ,only : field_factory
+ use periodic_5th_factory_module ,only : periodic_5th_factory
+ implicit none
+ class(field) ,pointer :: u
+ class(field_factory), allocatable :: field_creator
+ allocate (periodic_5th_factory :: field_creator)
+ u => field_creator%create()
+end program
diff --git a/gcc/testsuite/gfortran.dg/prof/prof.exp b/gcc/testsuite/gfortran.dg/prof/prof.exp
new file mode 100644
index 00000000000..0bad01d2dbb
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/prof/prof.exp
@@ -0,0 +1,56 @@
+# Copyright (C) 2001-2016 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GCC; see the file COPYING3. If not see
+# <http://www.gnu.org/licenses/>.
+
+# Test the functionality of programs compiled with profile-directed block
+# ordering using -fprofile-generate followed by -fprofile-use.
+
+load_lib target-supports.exp
+
+# Some targets don't support tree profiling.
+if { ![check_profiling_available "-fprofile-generate"] } {
+ return
+}
+
+# The procedures in profopt.exp need these parameters.
+set tool gfortran
+set prof_ext "gcda"
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+# Load support procs.
+load_lib profopt.exp
+
+# Save and override the default list defined in profopt.exp.
+set treeprof_save_profopt_options $PROFOPT_OPTIONS
+set PROFOPT_OPTIONS [list {}]
+
+# These are globals used by profopt-execute. The first is options
+# needed to generate profile data, the second is options to use the
+# profile data.
+set profile_option "-fprofile-generate -D_PROFILE_GENERATE"
+set feedback_option "-fprofile-use -D_PROFILE_USE"
+
+foreach src [lsort [glob -nocomplain $srcdir/$subdir/*.f*]] {
+ # If we're only testing specific files and this isn't one of them, skip it.
+ if ![runtest_file_p $runtests $src] then {
+ continue
+ }
+ profopt-execute $src
+}
+
+set PROFOPT_OPTIONS $treeprof_save_profopt_options
diff --git a/gcc/testsuite/gfortran.dg/select_type_35.f03 b/gcc/testsuite/gfortran.dg/select_type_35.f03
new file mode 100644
index 00000000000..92d2f275313
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/select_type_35.f03
@@ -0,0 +1,41 @@
+! { dg-do run }
+!
+! Contributed by Nathanael Huebbe
+! Check fix for PR/70842
+
+program foo
+
+ TYPE, ABSTRACT :: t_Intermediate
+ END TYPE t_Intermediate
+
+ type, extends(t_Intermediate) :: t_Foo
+ character(:), allocatable :: string
+ end type t_Foo
+
+ class(t_Foo), allocatable :: obj
+
+ allocate(obj)
+ obj%string = "blabarfoo"
+
+ call bar(obj)
+
+ deallocate(obj)
+contains
+ subroutine bar(me)
+ class(t_Intermediate), target :: me
+
+ class(*), pointer :: alias
+
+ select type(me)
+ type is(t_Foo)
+ if (len(me%string) /= 9) call abort()
+ end select
+
+ alias => me
+ select type(alias)
+ type is(t_Foo)
+ if (len(alias%string) /= 9) call abort()
+ end select
+ end subroutine bar
+end program foo
+
diff --git a/gcc/testsuite/gfortran.dg/unexpected_eof.f b/gcc/testsuite/gfortran.dg/unexpected_eof.f
new file mode 100644
index 00000000000..d3cdb99596a
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/unexpected_eof.f
@@ -0,0 +1,8 @@
+! { dg-do compile }
+! PR66461 ICE on missing end program in fixed source
+ program p
+ integer x(2)
+ x = -1
+ if ( x(1) < 0 .or.
+ & x(2) < 0 ) print *, x
+! { dg-error "Unexpected end of file" "" { target *-*-* } 0 }
diff --git a/gcc/testsuite/lib/gcc-gdb-test.exp b/gcc/testsuite/lib/gcc-gdb-test.exp
index d182d88fa56..15e84290edc 100644
--- a/gcc/testsuite/lib/gcc-gdb-test.exp
+++ b/gcc/testsuite/lib/gcc-gdb-test.exp
@@ -52,8 +52,8 @@ proc gdb-test { args } {
puts $fd "quit"
close $fd
- send_log "Spawning: $gdb_name -nx -nw -quiet -x $cmd_file ./$output_file\n"
- set res [remote_spawn target "$gdb_name -nx -nw -quiet -x $cmd_file ./$output_file"]
+ send_log "Spawning: $gdb_name -nx -nw -quiet -batch -x $cmd_file ./$output_file\n"
+ set res [remote_spawn target "$gdb_name -nx -nw -quiet -batch -x $cmd_file ./$output_file"]
if { $res < 0 || $res == "" } {
unsupported "$testname"
file delete $cmd_file
diff --git a/gcc/testsuite/lib/gcc-simulate-thread.exp b/gcc/testsuite/lib/gcc-simulate-thread.exp
index 100462458e5..db09b78ad6f 100644
--- a/gcc/testsuite/lib/gcc-simulate-thread.exp
+++ b/gcc/testsuite/lib/gcc-simulate-thread.exp
@@ -49,8 +49,8 @@ proc simulate-thread { args } {
set message "thread simulation test"
- send_log "Spawning: $gdb_name -nx -nw -quiet -x $cmd_file ./$exec_file\n"
- set res [remote_spawn target "$gdb_name -nx -nw -x $cmd_file ./$exec_file"]
+ send_log "Spawning: $gdb_name -nx -nw -batch -x $cmd_file ./$exec_file\n"
+ set res [remote_spawn target "$gdb_name -nx -nw -batch -x $cmd_file ./$exec_file"]
if { $res < 0 || $res == "" } {
unsupported "$testcase $message"
return
diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
index e021d551ccc..bbf3e267ada 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -804,6 +804,15 @@ proc check_effective_target_pthread {} {
} "-pthread"]
}
+# Return 1 if compilation with -gstabs is error-free for trivial
+# code, 0 otherwise.
+
+proc check_effective_target_stabs {} {
+ return [check_no_compiler_messages stabs object {
+ void foo (void) { }
+ } "-gstabs"]
+}
+
# Return 1 if compilation with -mpe-aligned-commons is error-free
# for trivial code, 0 otherwise.
@@ -1393,6 +1402,19 @@ proc check_effective_target_avx_runtime { } {
return 0
}
+# Return 1 if we are compiling for 64-bit PowerPC but we do not use direct
+# move instructions for moves from GPR to FPR.
+
+proc check_effective_target_powerpc64_no_dm { } {
+ # The "mulld" checks if we are generating PowerPC64 code. The "lfd"
+ # checks if we do not use direct moves, but use the old-fashioned
+ # slower move-via-the-stack.
+ return [check_no_messages_and_pattern powerpc64_no_dm \
+ {\mmulld\M.*\mlfd} assembly {
+ double f(long long x) { return x*x; }
+ } {-O2}]
+}
+
# Return 1 if the target supports executing power8 vector instructions, 0
# otherwise. Cache the result.
@@ -2707,7 +2729,9 @@ proc check_effective_target_arm_fp16_ok { } {
# Creates a series of routines that return 1 if the given architecture
# can be selected and a routine to give the flags to select that architecture
# Note: Extra flags may be added to disable options from newer compilers
-# (Thumb in particular - but others may be added in the future)
+# (Thumb in particular - but others may be added in the future).
+# -march=armv7ve is special and is handled explicitly after this loop because
+# it needs more than one predefine check to identify.
# Usage: /* { dg-require-effective-target arm_arch_v5_ok } */
# /* { dg-add-options arm_arch_v5 } */
# /* { dg-require-effective-target arm_arch_v5_multilib } */
@@ -2722,7 +2746,6 @@ foreach { armfunc armflag armdef } { v4 "-march=armv4 -marm" __ARM_ARCH_4__
v6z "-march=armv6z" __ARM_ARCH_6Z__
v6m "-march=armv6-m -mthumb" __ARM_ARCH_6M__
v7a "-march=armv7-a" __ARM_ARCH_7A__
- v7ve "-march=armv7ve" __ARM_ARCH_7A__
v7r "-march=armv7-r" __ARM_ARCH_7R__
v7m "-march=armv7-m -mthumb" __ARM_ARCH_7M__
v7em "-march=armv7e-m -mthumb" __ARM_ARCH_7EM__
@@ -2756,6 +2779,26 @@ foreach { armfunc armflag armdef } { v4 "-march=armv4 -marm" __ARM_ARCH_4__
}]
}
+# Same functions as above but for -march=armv7ve. To uniquely identify
+# -march=armv7ve we need to check for __ARM_ARCH_7A__ as well as
+# __ARM_FEATURE_IDIV otherwise it aliases with armv7-a.
+
+proc check_effective_target_arm_arch_v7ve_ok { } {
+ if { [ string match "*-marm*" "-march=armv7ve" ] &&
+ ![check_effective_target_arm_arm_ok] } {
+ return 0
+ }
+ return [check_no_compiler_messages arm_arch_v7ve_ok assembly {
+ #if !defined (__ARM_ARCH_7A__) || !defined (__ARM_FEATURE_IDIV)
+ #error !armv7ve
+ #endif
+ } "-march=armv7ve" ]
+}
+
+proc add_options_for_arm_arch_v7ve { flags } {
+ return "$flags -march=armv7ve"
+}
+
# Return 1 if this is an ARM target where -marm causes ARM to be
# used (not Thumb)
diff --git a/gcc/testsuite/objc.dg/stabs-1.m b/gcc/testsuite/objc.dg/stabs-1.m
index e43f7d84aa4..452993ed916 100644
--- a/gcc/testsuite/objc.dg/stabs-1.m
+++ b/gcc/testsuite/objc.dg/stabs-1.m
@@ -1,8 +1,7 @@
/* Check if the final SO STABS record goes into the .text section. */
/* Contributed by Ziemowit Laski <zlaski@apple.com> */
-/* { dg-do compile } */
-/* { dg-skip-if "No stabs" { mmix-*-* *-*-aix* alpha*-*-* hppa*64*-*-* ia64-*-* } { "*" } { "" } } */
+/* { dg-do compile { target stabs } } */
/* { dg-options "-gstabs" } */
@interface MyClass
diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c
index f684a102ab2..46a8381d952 100644
--- a/gcc/tree-cfg.c
+++ b/gcc/tree-cfg.c
@@ -1719,7 +1719,8 @@ replace_uses_by (tree name, tree val)
if (gimple_code (stmt) == GIMPLE_PHI)
{
e = gimple_phi_arg_edge (stmt, PHI_ARG_INDEX_FROM_USE (use));
- if (e->flags & EDGE_ABNORMAL)
+ if (e->flags & EDGE_ABNORMAL
+ && !SSA_NAME_OCCURS_IN_ABNORMAL_PHI (val))
{
/* This can only occur for virtual operands, since
for the real ones SSA_NAME_OCCURS_IN_ABNORMAL_PHI (name))
diff --git a/gcc/tree-chrec.c b/gcc/tree-chrec.c
index b9350f015e2..c6c5015d7b9 100644
--- a/gcc/tree-chrec.c
+++ b/gcc/tree-chrec.c
@@ -730,12 +730,12 @@ hide_evolution_in_other_loops_than_loop (tree chrec,
/* There is no evolution in this loop. */
return initial_condition (chrec);
+ else if (flow_loop_nested_p (loop, chloop))
+ return hide_evolution_in_other_loops_than_loop (CHREC_LEFT (chrec),
+ loop_num);
+
else
- {
- gcc_assert (flow_loop_nested_p (loop, chloop));
- return hide_evolution_in_other_loops_than_loop (CHREC_LEFT (chrec),
- loop_num);
- }
+ return chrec_dont_know;
default:
return chrec;
diff --git a/gcc/tree-data-ref.c b/gcc/tree-data-ref.c
index 7def7f0cb3b..4a517d75dd9 100644
--- a/gcc/tree-data-ref.c
+++ b/gcc/tree-data-ref.c
@@ -1495,13 +1495,14 @@ initialize_data_dependence_relation (struct data_reference *a,
/* The case where the references are exactly the same. */
if (operand_equal_p (DR_REF (a), DR_REF (b), 0))
{
- if (loop_nest.exists ()
- && !object_address_invariant_in_loop_p (loop_nest[0],
- DR_BASE_OBJECT (a)))
- {
- DDR_ARE_DEPENDENT (res) = chrec_dont_know;
- return res;
- }
+ if ((loop_nest.exists ()
+ && !object_address_invariant_in_loop_p (loop_nest[0],
+ DR_BASE_OBJECT (a)))
+ || DR_NUM_DIMENSIONS (a) == 0)
+ {
+ DDR_ARE_DEPENDENT (res) = chrec_dont_know;
+ return res;
+ }
DDR_AFFINE_P (res) = true;
DDR_ARE_DEPENDENT (res) = NULL_TREE;
DDR_SUBSCRIPTS (res).create (DR_NUM_DIMENSIONS (a));
@@ -1533,9 +1534,9 @@ initialize_data_dependence_relation (struct data_reference *a,
/* If the base of the object is not invariant in the loop nest, we cannot
analyze it. TODO -- in fact, it would suffice to record that there may
be arbitrary dependences in the loops where the base object varies. */
- if (loop_nest.exists ()
- && !object_address_invariant_in_loop_p (loop_nest[0],
- DR_BASE_OBJECT (a)))
+ if ((loop_nest.exists ()
+ && !object_address_invariant_in_loop_p (loop_nest[0], DR_BASE_OBJECT (a)))
+ || DR_NUM_DIMENSIONS (a) == 0)
{
DDR_ARE_DEPENDENT (res) = chrec_dont_know;
return res;
diff --git a/gcc/tree-if-conv.c b/gcc/tree-if-conv.c
index 0dc340f15aa..88d2a517cc3 100644
--- a/gcc/tree-if-conv.c
+++ b/gcc/tree-if-conv.c
@@ -593,7 +593,7 @@ memrefs_read_or_written_unconditionally (gimple stmt,
|| TREE_CODE (ref_base_b) == REALPART_EXPR)
ref_base_b = TREE_OPERAND (ref_base_b, 0);
- if (!operand_equal_p (ref_base_a, ref_base_b, 0))
+ if (operand_equal_p (ref_base_a, ref_base_b, 0))
{
tree cb = bb_predicate (gimple_bb (DR_STMT (b)));
diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c
index 288645b5904..94f025fb2a6 100644
--- a/gcc/tree-inline.c
+++ b/gcc/tree-inline.c
@@ -2652,8 +2652,6 @@ copy_debug_stmt (gimple stmt, copy_body_data *id)
else if (gimple_debug_source_bind_p (stmt))
{
gimple_debug_source_bind_set_var (stmt, t);
- walk_tree (gimple_debug_source_bind_get_value_ptr (stmt),
- remap_gimple_op_r, &wi, NULL);
/* When inlining and source bind refers to one of the optimized
away parameters, change the source bind into normal debug bind
referring to the corresponding DEBUG_EXPR_DECL that should have
@@ -2677,7 +2675,10 @@ copy_debug_stmt (gimple stmt, copy_body_data *id)
break;
}
}
- }
+ }
+ if (gimple_debug_source_bind_p (stmt))
+ walk_tree (gimple_debug_source_bind_get_value_ptr (stmt),
+ remap_gimple_op_r, &wi, NULL);
}
processing_debug_stmt = 0;
@@ -2785,7 +2786,7 @@ insert_init_debug_bind (copy_body_data *id,
base_stmt = gsi_stmt (gsi);
}
- note = gimple_build_debug_bind (tracked_var, value, base_stmt);
+ note = gimple_build_debug_bind (tracked_var, unshare_expr (value), base_stmt);
if (bb)
{
@@ -3845,7 +3846,7 @@ estimate_num_insns (gimple stmt, eni_weights *weights)
return 0;
else if (is_inexpensive_builtin (decl))
return weights->target_builtin_call_cost;
- else if (DECL_BUILT_IN_CLASS (decl) == BUILT_IN_NORMAL)
+ else if (gimple_call_builtin_p (stmt, BUILT_IN_NORMAL))
{
/* We canonicalize x * x to pow (x, 2.0) with -ffast-math, so
specialize the cheap expansion we do here.
diff --git a/gcc/tree-nested.c b/gcc/tree-nested.c
index 28753c16c89..5efbbc52695 100644
--- a/gcc/tree-nested.c
+++ b/gcc/tree-nested.c
@@ -1313,7 +1313,7 @@ convert_nonlocal_reference_stmt (gimple_stmt_iterator *gsi, bool *handled_ops_p,
{
wi->val_only = true;
wi->is_lhs = false;
- *handled_ops_p = true;
+ *handled_ops_p = false;
return NULL_TREE;
}
break;
diff --git a/gcc/tree-scalar-evolution.c b/gcc/tree-scalar-evolution.c
index f1ddc24b1a2..66b063f9293 100644
--- a/gcc/tree-scalar-evolution.c
+++ b/gcc/tree-scalar-evolution.c
@@ -935,27 +935,25 @@ follow_ssa_edge_binary (struct loop *loop, gimple at_stmt,
limit++;
evol = *evolution_of_loop;
- res = follow_ssa_edge
- (loop, SSA_NAME_DEF_STMT (rhs0), halting_phi, &evol, limit);
-
- if (res == t_true)
- *evolution_of_loop = add_to_evolution
+ evol = add_to_evolution
(loop->num,
chrec_convert (type, evol, at_stmt),
code, rhs1, at_stmt);
-
+ res = follow_ssa_edge
+ (loop, SSA_NAME_DEF_STMT (rhs0), halting_phi, &evol, limit);
+ if (res == t_true)
+ *evolution_of_loop = evol;
else if (res == t_false)
{
+ *evolution_of_loop = add_to_evolution
+ (loop->num,
+ chrec_convert (type, *evolution_of_loop, at_stmt),
+ code, rhs0, at_stmt);
res = follow_ssa_edge
(loop, SSA_NAME_DEF_STMT (rhs1), halting_phi,
evolution_of_loop, limit);
-
if (res == t_true)
- *evolution_of_loop = add_to_evolution
- (loop->num,
- chrec_convert (type, *evolution_of_loop, at_stmt),
- code, rhs0, at_stmt);
-
+ ;
else if (res == t_dont_know)
*evolution_of_loop = chrec_dont_know;
}
@@ -968,15 +966,15 @@ follow_ssa_edge_binary (struct loop *loop, gimple at_stmt,
{
/* Match an assignment under the form:
"a = b + ...". */
+ *evolution_of_loop = add_to_evolution
+ (loop->num, chrec_convert (type, *evolution_of_loop,
+ at_stmt),
+ code, rhs1, at_stmt);
res = follow_ssa_edge
(loop, SSA_NAME_DEF_STMT (rhs0), halting_phi,
evolution_of_loop, limit);
if (res == t_true)
- *evolution_of_loop = add_to_evolution
- (loop->num, chrec_convert (type, *evolution_of_loop,
- at_stmt),
- code, rhs1, at_stmt);
-
+ ;
else if (res == t_dont_know)
*evolution_of_loop = chrec_dont_know;
}
@@ -986,15 +984,15 @@ follow_ssa_edge_binary (struct loop *loop, gimple at_stmt,
{
/* Match an assignment under the form:
"a = ... + c". */
+ *evolution_of_loop = add_to_evolution
+ (loop->num, chrec_convert (type, *evolution_of_loop,
+ at_stmt),
+ code, rhs0, at_stmt);
res = follow_ssa_edge
(loop, SSA_NAME_DEF_STMT (rhs1), halting_phi,
evolution_of_loop, limit);
if (res == t_true)
- *evolution_of_loop = add_to_evolution
- (loop->num, chrec_convert (type, *evolution_of_loop,
- at_stmt),
- code, rhs0, at_stmt);
-
+ ;
else if (res == t_dont_know)
*evolution_of_loop = chrec_dont_know;
}
@@ -1019,13 +1017,13 @@ follow_ssa_edge_binary (struct loop *loop, gimple at_stmt,
if (TREE_CODE (rhs1) == SSA_NAME)
limit++;
+ *evolution_of_loop = add_to_evolution
+ (loop->num, chrec_convert (type, *evolution_of_loop, at_stmt),
+ MINUS_EXPR, rhs1, at_stmt);
res = follow_ssa_edge (loop, SSA_NAME_DEF_STMT (rhs0), halting_phi,
evolution_of_loop, limit);
if (res == t_true)
- *evolution_of_loop = add_to_evolution
- (loop->num, chrec_convert (type, *evolution_of_loop, at_stmt),
- MINUS_EXPR, rhs1, at_stmt);
-
+ ;
else if (res == t_dont_know)
*evolution_of_loop = chrec_dont_know;
}
diff --git a/gcc/tree-sra.c b/gcc/tree-sra.c
index 13f6c4a8e63..3659ff38a0e 100644
--- a/gcc/tree-sra.c
+++ b/gcc/tree-sra.c
@@ -2295,7 +2295,7 @@ analyze_access_subtree (struct access *root, struct access *parent,
if (covered_to < limit)
hole = true;
- if (scalar)
+ if (scalar || !allow_replacements)
root->grp_total_scalarization = 0;
}
@@ -4464,61 +4464,47 @@ get_adjustment_for_base (ipa_parm_adjustment_vec adjustments, tree base)
return NULL;
}
-/* If the statement STMT defines an SSA_NAME of a parameter which is to be
- removed because its value is not used, replace the SSA_NAME with a one
- relating to a created VAR_DECL together all of its uses and return true.
- ADJUSTMENTS is a pointer to an adjustments vector. */
+/* If OLD_NAME, which is being defined by statement STMT, is an SSA_NAME of a
+ parameter which is to be removed because its value is not used, create a new
+ SSA_NAME relating to a replacement VAR_DECL, replace all uses of the
+ original with it and return it. If there is no need to re-map, return NULL.
+ ADJUSTMENTS is a pointer to a vector of IPA-SRA adjustments. */
-static bool
-replace_removed_params_ssa_names (gimple stmt,
+static tree
+replace_removed_params_ssa_names (tree old_name, gimple stmt,
ipa_parm_adjustment_vec adjustments)
{
struct ipa_parm_adjustment *adj;
- tree lhs, decl, repl, name;
-
- if (gimple_code (stmt) == GIMPLE_PHI)
- lhs = gimple_phi_result (stmt);
- else if (is_gimple_assign (stmt))
- lhs = gimple_assign_lhs (stmt);
- else if (is_gimple_call (stmt))
- lhs = gimple_call_lhs (stmt);
- else
- gcc_unreachable ();
+ tree decl, repl, new_name;
- if (TREE_CODE (lhs) != SSA_NAME)
- return false;
+ if (TREE_CODE (old_name) != SSA_NAME)
+ return NULL;
- decl = SSA_NAME_VAR (lhs);
+ decl = SSA_NAME_VAR (old_name);
if (decl == NULL_TREE
|| TREE_CODE (decl) != PARM_DECL)
- return false;
+ return NULL;
adj = get_adjustment_for_base (adjustments, decl);
if (!adj)
- return false;
+ return NULL;
repl = get_replaced_param_substitute (adj);
- name = make_ssa_name (repl, stmt);
+ new_name = make_ssa_name (repl, stmt);
+ SSA_NAME_OCCURS_IN_ABNORMAL_PHI (new_name)
+ = SSA_NAME_OCCURS_IN_ABNORMAL_PHI (old_name);
if (dump_file)
{
fprintf (dump_file, "replacing an SSA name of a removed param ");
- print_generic_expr (dump_file, lhs, 0);
+ print_generic_expr (dump_file, old_name, 0);
fprintf (dump_file, " with ");
- print_generic_expr (dump_file, name, 0);
+ print_generic_expr (dump_file, new_name, 0);
fprintf (dump_file, "\n");
}
- if (is_gimple_assign (stmt))
- gimple_assign_set_lhs (stmt, name);
- else if (is_gimple_call (stmt))
- gimple_call_set_lhs (stmt, name);
- else
- gimple_phi_set_result (stmt, name);
-
- replace_uses_by (lhs, name);
- release_ssa_name (lhs);
- return true;
+ replace_uses_by (old_name, new_name);
+ return new_name;
}
/* If the statement pointed to by STMT_PTR contains any expressions that need
@@ -4599,7 +4585,16 @@ ipa_sra_modify_function_body (ipa_parm_adjustment_vec adjustments)
gimple_stmt_iterator gsi;
for (gsi = gsi_start_phis (bb); !gsi_end_p (gsi); gsi_next (&gsi))
- replace_removed_params_ssa_names (gsi_stmt (gsi), adjustments);
+ {
+ gimple phi = gsi_stmt (gsi);
+ tree new_lhs, old_lhs = gimple_phi_result (phi);
+ new_lhs = replace_removed_params_ssa_names (old_lhs, phi, adjustments);
+ if (new_lhs)
+ {
+ gimple_phi_set_result (phi, new_lhs);
+ release_ssa_name (old_lhs);
+ }
+ }
gsi = gsi_start_bb (bb);
while (!gsi_end_p (gsi))
@@ -4619,7 +4614,6 @@ ipa_sra_modify_function_body (ipa_parm_adjustment_vec adjustments)
case GIMPLE_ASSIGN:
modified |= sra_ipa_modify_assign (&stmt, &gsi, adjustments);
- modified |= replace_removed_params_ssa_names (stmt, adjustments);
break;
case GIMPLE_CALL:
@@ -4634,8 +4628,6 @@ ipa_sra_modify_function_body (ipa_parm_adjustment_vec adjustments)
{
t = gimple_call_lhs_ptr (stmt);
modified |= ipa_modify_expr (t, false, adjustments);
- modified |= replace_removed_params_ssa_names (stmt,
- adjustments);
}
break;
@@ -4656,6 +4648,20 @@ ipa_sra_modify_function_body (ipa_parm_adjustment_vec adjustments)
break;
}
+ def_operand_p defp;
+ ssa_op_iter iter;
+ FOR_EACH_SSA_DEF_OPERAND (defp, stmt, iter, SSA_OP_DEF)
+ {
+ tree old_def = DEF_FROM_PTR (defp);
+ if (tree new_def = replace_removed_params_ssa_names (old_def, stmt,
+ adjustments))
+ {
+ SET_DEF (defp, new_def);
+ release_ssa_name (old_def);
+ modified = true;
+ }
+ }
+
if (modified)
{
update_stmt (stmt);
diff --git a/gcc/tree-ssa-dom.c b/gcc/tree-ssa-dom.c
index 8ef0920cc77..1497e005bb5 100644
--- a/gcc/tree-ssa-dom.c
+++ b/gcc/tree-ssa-dom.c
@@ -2261,11 +2261,16 @@ cprop_operand (gimple stmt, use_operand_p op_p)
if (loop_depth_of_name (val) > loop_depth_of_name (op))
return;
- /* Do not propagate copies into simple IV increment statements.
- See PR23821 for how this can disturb IV analysis. */
- if (TREE_CODE (val) != INTEGER_CST
- && simple_iv_increment_p (stmt))
- return;
+ /* Do not propagate copies into BIVs.
+ See PR23821 and PR62217 for how this can disturb IV and
+ number of iteration analysis. */
+ if (TREE_CODE (val) != INTEGER_CST)
+ {
+ gimple def = SSA_NAME_DEF_STMT (op);
+ if (gimple_code (def) == GIMPLE_PHI
+ && gimple_bb (def)->loop_father->header == gimple_bb (def))
+ return;
+ }
/* Dump details. */
if (dump_file && (dump_flags & TDF_DETAILS))
diff --git a/gcc/tree-ssa-loop-ivcanon.c b/gcc/tree-ssa-loop-ivcanon.c
index b475b067bb5..00f26b8dd91 100644
--- a/gcc/tree-ssa-loop-ivcanon.c
+++ b/gcc/tree-ssa-loop-ivcanon.c
@@ -1072,7 +1072,9 @@ propagate_constants_for_unrolling (basic_block bb)
tree result = gimple_phi_result (phi);
tree arg = gimple_phi_arg_def (phi, 0);
- if (gimple_phi_num_args (phi) == 1 && TREE_CODE (arg) == INTEGER_CST)
+ if (! SSA_NAME_OCCURS_IN_ABNORMAL_PHI (result)
+ && gimple_phi_num_args (phi) == 1
+ && TREE_CODE (arg) == INTEGER_CST)
{
propagate_into_all_uses (result, arg);
gsi_remove (&gsi, true);
diff --git a/gcc/tree-ssa-loop.c b/gcc/tree-ssa-loop.c
index e71519acf7b..aabca0f67e3 100644
--- a/gcc/tree-ssa-loop.c
+++ b/gcc/tree-ssa-loop.c
@@ -621,6 +621,8 @@ gen_lsm_tmp_name (tree ref)
case SSA_NAME:
case VAR_DECL:
case PARM_DECL:
+ case FUNCTION_DECL:
+ case LABEL_DECL:
name = get_name (ref);
if (!name)
name = "D";
@@ -636,11 +638,9 @@ gen_lsm_tmp_name (tree ref)
break;
case INTEGER_CST:
+ default:
/* Nothing. */
break;
-
- default:
- gcc_unreachable ();
}
}
diff --git a/gcc/tree-ssa-math-opts.c b/gcc/tree-ssa-math-opts.c
index 0e8d54d34fe..0c40ade04c6 100644
--- a/gcc/tree-ssa-math-opts.c
+++ b/gcc/tree-ssa-math-opts.c
@@ -746,7 +746,7 @@ execute_cse_sincos_1 (tree name)
if (gimple_code (use_stmt) != GIMPLE_CALL
|| !gimple_call_lhs (use_stmt)
|| !(fndecl = gimple_call_fndecl (use_stmt))
- || DECL_BUILT_IN_CLASS (fndecl) != BUILT_IN_NORMAL)
+ || !gimple_call_builtin_p (use_stmt, BUILT_IN_NORMAL))
continue;
switch (DECL_FUNCTION_CODE (fndecl))
@@ -1437,7 +1437,7 @@ execute_cse_sincos (void)
if (is_gimple_call (stmt)
&& gimple_call_lhs (stmt)
&& (fndecl = gimple_call_fndecl (stmt))
- && DECL_BUILT_IN_CLASS (fndecl) == BUILT_IN_NORMAL)
+ && gimple_call_builtin_p (stmt, BUILT_IN_NORMAL))
{
tree arg, arg0, arg1, result;
HOST_WIDE_INT n;
@@ -2860,7 +2860,7 @@ execute_optimize_widening_mul (void)
{
tree fndecl = gimple_call_fndecl (stmt);
if (fndecl
- && DECL_BUILT_IN_CLASS (fndecl) == BUILT_IN_NORMAL)
+ && gimple_call_builtin_p (stmt, BUILT_IN_NORMAL))
{
switch (DECL_FUNCTION_CODE (fndecl))
{
diff --git a/gcc/tree-ssa-reassoc.c b/gcc/tree-ssa-reassoc.c
index 60b4dae38a7..6bd52cca3d5 100644
--- a/gcc/tree-ssa-reassoc.c
+++ b/gcc/tree-ssa-reassoc.c
@@ -2091,10 +2091,33 @@ update_range_test (struct range_entry *range, struct range_entry *otherrange,
tree tem = build_range_check (loc, optype, exp, in_p, low, high);
enum warn_strict_overflow_code wc = WARN_STRICT_OVERFLOW_COMPARISON;
gimple_stmt_iterator gsi;
+ unsigned int uid;
if (tem == NULL_TREE)
return false;
+ /* If op is default def SSA_NAME, there is no place to insert the
+ new comparison. Give up, unless we can use OP itself as the
+ range test. */
+ if (op && SSA_NAME_IS_DEFAULT_DEF (op))
+ {
+ if (op == range->exp
+ && ((TYPE_PRECISION (optype) == 1 && TYPE_UNSIGNED (optype))
+ || TREE_CODE (optype) == BOOLEAN_TYPE)
+ && (op == tem
+ || (TREE_CODE (tem) == EQ_EXPR
+ && TREE_OPERAND (tem, 0) == op
+ && integer_onep (TREE_OPERAND (tem, 1))))
+ && opcode != BIT_IOR_EXPR
+ && (opcode != ERROR_MARK || oe->rank != BIT_IOR_EXPR))
+ {
+ stmt = NULL;
+ tem = op;
+ }
+ else
+ return false;
+ }
+
if (strict_overflow_p && issue_strict_overflow_warning (wc))
warning_at (loc, OPT_Wstrict_overflow,
"assuming signed overflow does not occur "
@@ -2128,11 +2151,22 @@ update_range_test (struct range_entry *range, struct range_entry *otherrange,
tem = invert_truthvalue_loc (loc, tem);
tem = fold_convert_loc (loc, optype, tem);
- gsi = gsi_for_stmt (stmt);
+ if (stmt)
+ {
+ gsi = gsi_for_stmt (stmt);
+ uid = gimple_uid (stmt);
+ }
+ else
+ {
+ gsi = gsi_none ();
+ uid = 0;
+ }
+ if (stmt == NULL)
+ gcc_checking_assert (tem == op);
/* In rare cases range->exp can be equal to lhs of stmt.
In that case we have to insert after the stmt rather then before
it. */
- if (op == range->exp)
+ else if (op == range->exp)
tem = force_gimple_operand_gsi (&gsi, tem, true, NULL_TREE, false,
GSI_CONTINUE_LINKING);
else
@@ -2145,7 +2179,7 @@ update_range_test (struct range_entry *range, struct range_entry *otherrange,
if (gimple_uid (gsi_stmt (gsi)))
break;
else
- gimple_set_uid (gsi_stmt (gsi), gimple_uid (stmt));
+ gimple_set_uid (gsi_stmt (gsi), uid);
oe->op = tem;
range->exp = exp;
diff --git a/gcc/tree-ssa-strlen.c b/gcc/tree-ssa-strlen.c
index 8d99a31d5df..bd6cbe82e82 100644
--- a/gcc/tree-ssa-strlen.c
+++ b/gcc/tree-ssa-strlen.c
@@ -768,6 +768,49 @@ find_equal_ptrs (tree ptr, int idx)
}
}
+/* Return true if STMT is a call to a builtin function with the right
+ arguments and attributes that should be considered for optimization
+ by this pass. */
+
+static bool
+valid_builtin_call (gimple stmt)
+{
+ if (!gimple_call_builtin_p (stmt, BUILT_IN_NORMAL))
+ return false;
+
+ tree callee = gimple_call_fndecl (stmt);
+ switch (DECL_FUNCTION_CODE (callee))
+ {
+ case BUILT_IN_STRCHR:
+ case BUILT_IN_STRLEN:
+ /* The above functions should be pure. Punt if they aren't. */
+ if (gimple_vdef (stmt) || gimple_vuse (stmt) == NULL_TREE)
+ return false;
+ break;
+
+ case BUILT_IN_MEMCPY:
+ case BUILT_IN_MEMCPY_CHK:
+ case BUILT_IN_MEMPCPY:
+ case BUILT_IN_MEMPCPY_CHK:
+ case BUILT_IN_STPCPY:
+ case BUILT_IN_STPCPY_CHK:
+ case BUILT_IN_STRCAT:
+ case BUILT_IN_STRCAT_CHK:
+ case BUILT_IN_STRCPY:
+ case BUILT_IN_STRCPY_CHK:
+ /* The above functions should be neither const nor pure. Punt if they
+ aren't. */
+ if (gimple_vdef (stmt) == NULL_TREE || gimple_vuse (stmt) == NULL_TREE)
+ return false;
+ break;
+
+ default:
+ break;
+ }
+
+ return true;
+}
+
/* If the last .MEM setter statement before STMT is
memcpy (x, y, strlen (y) + 1), the only .MEM use of it is STMT
and STMT is known to overwrite x[strlen (x)], adjust the last memcpy to
@@ -842,7 +885,7 @@ adjust_last_stmt (strinfo si, gimple stmt, bool is_strcat)
return;
}
- if (!gimple_call_builtin_p (last.stmt, BUILT_IN_NORMAL))
+ if (!valid_builtin_call (last.stmt))
return;
callee = gimple_call_fndecl (last.stmt);
@@ -1827,7 +1870,7 @@ strlen_optimize_stmt (gimple_stmt_iterator *gsi)
if (is_gimple_call (stmt))
{
tree callee = gimple_call_fndecl (stmt);
- if (gimple_call_builtin_p (stmt, BUILT_IN_NORMAL))
+ if (valid_builtin_call (stmt))
switch (DECL_FUNCTION_CODE (callee))
{
case BUILT_IN_STRLEN:
diff --git a/gcc/tree-ssa-tail-merge.c b/gcc/tree-ssa-tail-merge.c
index b5165d549fe..7bcac2f0614 100644
--- a/gcc/tree-ssa-tail-merge.c
+++ b/gcc/tree-ssa-tail-merge.c
@@ -1618,6 +1618,7 @@ update_debug_stmt (gimple stmt)
gimple_debug_bind_reset_value (stmt);
update_stmt (stmt);
+ break;
}
}
diff --git a/gcc/tree-ssa-threadedge.c b/gcc/tree-ssa-threadedge.c
index 604123e10d3..dd962a744ea 100644
--- a/gcc/tree-ssa-threadedge.c
+++ b/gcc/tree-ssa-threadedge.c
@@ -283,15 +283,40 @@ fold_assignment_stmt (gimple stmt)
}
/* A new value has been assigned to LHS. If necessary, invalidate any
- equivalences that are no longer valid. */
+ equivalences that are no longer valid. This includes invaliding
+ LHS and any objects that are currently equivalent to LHS.
+
+ Finding the objects that are currently marked as equivalent to LHS
+ is a bit tricky. We could walk the ssa names and see if any have
+ SSA_NAME_VALUE that is the same as LHS. That's expensive.
+
+ However, it's far more efficient to look at the unwinding stack as
+ that will have all context sensitive equivalences which are the only
+ ones that we really have to worry about here. */
static void
invalidate_equivalences (tree lhs, vec<tree> *stack)
{
- for (unsigned int i = 1; i < num_ssa_names; i++)
- if (ssa_name (i) && SSA_NAME_VALUE (ssa_name (i)) == lhs)
- record_temporary_equivalence (ssa_name (i), NULL_TREE, stack);
+ /* The stack is an unwinding stack. If the current element is NULL
+ then it's a "stop unwinding" marker. Else the current marker is
+ the SSA_NAME with an equivalence and the prior entry in the stack
+ is what the current element is equivalent to. */
+ for (int i = stack->length() - 1; i >= 0; i--)
+ {
+ /* Ignore the stop unwinding markers. */
+ if ((*stack)[i] == NULL)
+ continue;
+
+ /* We want to check the current value of stack[i] to see if
+ it matches LHS. If so, then invalidate. */
+ if (SSA_NAME_VALUE ((*stack)[i]) == lhs)
+ record_temporary_equivalence ((*stack)[i], NULL_TREE, stack);
+
+ /* Remember, we're dealing with two elements in this case. */
+ i--;
+ }
+ /* And invalidate any known value for LHS itself. */
if (SSA_NAME_VALUE (lhs))
record_temporary_equivalence (lhs, NULL_TREE, stack);
}
diff --git a/gcc/tree-ssa.c b/gcc/tree-ssa.c
index 20f061ffaf0..3d3ffaa8982 100644
--- a/gcc/tree-ssa.c
+++ b/gcc/tree-ssa.c
@@ -1380,6 +1380,14 @@ non_rewritable_lvalue_p (tree lhs)
tree decl = TREE_OPERAND (TREE_OPERAND (lhs, 0), 0);
if (DECL_P (decl)
&& DECL_SIZE (decl) == TYPE_SIZE (TREE_TYPE (lhs))
+ /* If the dynamic type of the decl has larger precision than
+ the decl itself we can't use the decls type for SSA rewriting. */
+ && ((! INTEGRAL_TYPE_P (TREE_TYPE (decl))
+ || compare_tree_int (DECL_SIZE (decl),
+ TYPE_PRECISION (TREE_TYPE (decl))) == 0)
+ || (INTEGRAL_TYPE_P (TREE_TYPE (lhs))
+ && (TYPE_PRECISION (TREE_TYPE (decl))
+ >= TYPE_PRECISION (TREE_TYPE (lhs)))))
&& (TREE_THIS_VOLATILE (decl) == TREE_THIS_VOLATILE (lhs)))
return false;
}
@@ -1474,7 +1482,8 @@ execute_update_addresses_taken (void)
tree lhs = gimple_get_lhs (stmt);
if (lhs
&& TREE_CODE (lhs) != SSA_NAME
- && non_rewritable_lvalue_p (lhs))
+ && ((code == GIMPLE_CALL && ! DECL_P (lhs))
+ || non_rewritable_lvalue_p (lhs)))
{
decl = get_base_address (lhs);
if (DECL_P (decl))
diff --git a/gcc/tree-vect-data-refs.c b/gcc/tree-vect-data-refs.c
index 7e801838522..a298020c2fd 100644
--- a/gcc/tree-vect-data-refs.c
+++ b/gcc/tree-vect-data-refs.c
@@ -2563,7 +2563,7 @@ vect_analyze_data_ref_accesses (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo)
/* Sorting has ensured that DR_INIT (dra) <= DR_INIT (drb). */
HOST_WIDE_INT init_a = TREE_INT_CST_LOW (DR_INIT (dra));
HOST_WIDE_INT init_b = TREE_INT_CST_LOW (DR_INIT (drb));
- gcc_assert (init_a < init_b);
+ gcc_assert (init_a <= init_b);
/* If init_b == init_a + the size of the type * k, we have an
interleaving, and DRA is accessed before DRB. */
diff --git a/gcc/tree-vect-loop.c b/gcc/tree-vect-loop.c
index 8f7b9be0882..59946d2a010 100644
--- a/gcc/tree-vect-loop.c
+++ b/gcc/tree-vect-loop.c
@@ -2792,7 +2792,7 @@ vect_estimate_min_profitable_iters (loop_vec_info loop_vinfo,
if (LOOP_REQUIRES_VERSIONING_FOR_ALIAS (loop_vinfo))
{
/* FIXME: Make cost depend on complexity of individual check. */
- unsigned len = LOOP_VINFO_MAY_ALIAS_DDRS (loop_vinfo).length ();
+ unsigned len = LOOP_VINFO_COMP_ALIAS_DDRS (loop_vinfo).length ();
(void) add_stmt_cost (target_cost_data, len, vector_stmt, NULL, 0,
vect_prologue);
dump_printf (MSG_NOTE,
diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c
index fb3e05d85c2..5f3a6f8dbc3 100644
--- a/gcc/tree-vrp.c
+++ b/gcc/tree-vrp.c
@@ -9021,7 +9021,8 @@ simplify_cond_using_ranges (gimple stmt)
innerop = gimple_assign_rhs1 (def_stmt);
if (TREE_CODE (innerop) == SSA_NAME
- && !POINTER_TYPE_P (TREE_TYPE (innerop)))
+ && !POINTER_TYPE_P (TREE_TYPE (innerop))
+ && !SSA_NAME_OCCURS_IN_ABNORMAL_PHI (innerop))
{
value_range_t *vr = get_value_range (innerop);
@@ -9051,8 +9052,8 @@ simplify_cond_using_ranges (gimple stmt)
else
location = gimple_location (stmt);
warning_at (location, OPT_Wstrict_overflow,
- "assuming signed overflow does not occur when "
- "simplifying conditional");
+ "assuming signed overflow does not occur when "
+ "simplifying conditional");
}
tree newconst = fold_convert (TREE_TYPE (innerop), op1);
diff --git a/gnattools/ChangeLog b/gnattools/ChangeLog
index 7d214030324..dd73453b103 100644
--- a/gnattools/ChangeLog
+++ b/gnattools/ChangeLog
@@ -1,3 +1,7 @@
+2016-08-03 Release Manager
+
+ * GCC 4.9.4 released.
+
2015-06-26 Release Manager
* GCC 4.9.3 released.
diff --git a/include/ChangeLog b/include/ChangeLog
index 59839bd5747..8941985f339 100644
--- a/include/ChangeLog
+++ b/include/ChangeLog
@@ -1,3 +1,17 @@
+2016-08-03 Release Manager
+
+ * GCC 4.9.4 released.
+
+2016-05-19 Jakub Jelinek <jakub@redhat.com>
+
+ Backported from mainline
+ 2015-11-27 Pedro Alves <palves@redhat.com>
+
+ PR other/61321
+ PR other/61233
+ * demangle.h (enum demangle_component_type)
+ <DEMANGLE_COMPONENT_CONVERSION>: New value.
+
2015-06-26 Release Manager
* GCC 4.9.3 released.
diff --git a/include/demangle.h b/include/demangle.h
index bbad71bd8c7..7dc26489d6f 100644
--- a/include/demangle.h
+++ b/include/demangle.h
@@ -373,6 +373,10 @@ enum demangle_component_type
/* A typecast, represented as a unary operator. The one subtree is
the type to which the argument should be cast. */
DEMANGLE_COMPONENT_CAST,
+ /* A conversion operator, represented as a unary operator. The one
+ subtree is the type to which the argument should be converted
+ to. */
+ DEMANGLE_COMPONENT_CONVERSION,
/* A nullary expression. The left subtree is the operator. */
DEMANGLE_COMPONENT_NULLARY,
/* A unary expression. The left subtree is the operator, and the
diff --git a/intl/ChangeLog b/intl/ChangeLog
index eb4589fb025..e790f668c12 100644
--- a/intl/ChangeLog
+++ b/intl/ChangeLog
@@ -1,3 +1,7 @@
+2016-08-03 Release Manager
+
+ * GCC 4.9.4 released.
+
2015-06-26 Release Manager
* GCC 4.9.3 released.
diff --git a/libada/ChangeLog b/libada/ChangeLog
index 3f0f98f145d..e1c994db9d8 100644
--- a/libada/ChangeLog
+++ b/libada/ChangeLog
@@ -1,3 +1,7 @@
+2016-08-03 Release Manager
+
+ * GCC 4.9.4 released.
+
2015-06-26 Release Manager
* GCC 4.9.3 released.
diff --git a/libatomic/ChangeLog b/libatomic/ChangeLog
index 1deda88729f..fab6ad6a3b2 100644
--- a/libatomic/ChangeLog
+++ b/libatomic/ChangeLog
@@ -1,3 +1,26 @@
+2016-08-03 Release Manager
+
+ * GCC 4.9.4 released.
+
+2016-05-09 Sebastian Huber <sebastian.huber@embedded-brains.de>
+
+ Backport from mainline:
+ 2016-04-27 Sebastian Huber <sebastian.huber@embedded-brains.de>
+
+ * configure.tgt (configure_tgt_pre_target_cpu_XCFLAGS): New variable.
+ (*-*-rtems*): New supported target.
+ * config/rtems/host-config.h: New file.
+ * config/rtems/lock.c: Likewise.
+
+2016-01-06 Szabolcs Nagy <szabolcs.nagy@arm.com>
+
+ Backport from mainline:
+ 2016-01-06 Szabolcs Nagy <szabolcs.nagy@arm.com>
+
+ PR other/67627
+ * Makefile.am (all-multi): Add dependency.
+ * Makefile.in: Regenerate.
+
2015-06-26 Release Manager
* GCC 4.9.3 released.
diff --git a/libatomic/Makefile.am b/libatomic/Makefile.am
index 47f25df0d22..fde12a5766e 100644
--- a/libatomic/Makefile.am
+++ b/libatomic/Makefile.am
@@ -139,3 +139,10 @@ endif
libatomic_convenience_la_SOURCES = $(libatomic_la_SOURCES)
libatomic_convenience_la_LIBADD = $(libatomic_la_LIBADD)
+
+# Override the automake generated all-multi rule to guarantee that all-multi
+# is not run in parallel with the %_.lo rules which generate $(DEPDIR)/*.Ppo
+# makefile fragments to avoid broken *.Ppo getting included into the Makefile
+# when it is reloaded during the build of all-multi.
+all-multi: $(libatomic_la_LIBADD)
+ $(MULTIDO) $(AM_MAKEFLAGS) DO=all multi-do # $(MAKE)
diff --git a/libatomic/Makefile.in b/libatomic/Makefile.in
index 22c384b4322..42fd2c7fda5 100644
--- a/libatomic/Makefile.in
+++ b/libatomic/Makefile.in
@@ -465,12 +465,6 @@ clean-libtool:
distclean-libtool:
-rm -f libtool config.lt
-
-# GNU Make needs to see an explicit $(MAKE) variable in the command it
-# runs to enable its job server during parallel builds. Hence the
-# comments below.
-all-multi:
- $(MULTIDO) $(AM_MAKEFLAGS) DO=all multi-do # $(MAKE)
install-multi:
$(MULTIDO) $(AM_MAKEFLAGS) DO=install multi-do # $(MAKE)
@@ -764,6 +758,13 @@ vpath % $(strip $(search_path))
%_.lo: Makefile
$(LTCOMPILE) $(M_DEPS) $(M_SIZE) $(M_IFUNC) -c -o $@ $(M_SRC)
+# Override the automake generated all-multi rule to guarantee that all-multi
+# is not run in parallel with the %_.lo rules which generate $(DEPDIR)/*.Ppo
+# makefile fragments to avoid broken *.Ppo getting included into the Makefile
+# when it is reloaded during the build of all-multi.
+all-multi: $(libatomic_la_LIBADD)
+ $(MULTIDO) $(AM_MAKEFLAGS) DO=all multi-do # $(MAKE)
+
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
diff --git a/libatomic/config/rtems/host-config.h b/libatomic/config/rtems/host-config.h
new file mode 100644
index 00000000000..d11e9efb01f
--- /dev/null
+++ b/libatomic/config/rtems/host-config.h
@@ -0,0 +1,41 @@
+/* Copyright (C) 2016 Free Software Foundation, Inc.
+ Contributed by Sebastian Huber <sebastian.huber@embedded-brains.de>.
+
+ This file is part of the GNU Atomic Library (libatomic).
+
+ Libatomic is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ Libatomic is distributed in the hope that it will be useful, but WITHOUT ANY
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ more details.
+
+ Under Section 7 of GPL version 3, you are granted additional
+ permissions described in the GCC Runtime Library Exception, version
+ 3.1, as published by the Free Software Foundation.
+
+ You should have received a copy of the GNU General Public License and
+ a copy of the GCC Runtime Library Exception along with this program;
+ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+ <http://www.gnu.org/licenses/>. */
+
+/* Included after all more target-specific host-config.h. */
+
+#include <machine/_libatomic.h>
+
+static inline UWORD
+protect_start (void *ptr)
+{
+ return _Libatomic_Protect_start (ptr);
+}
+
+static inline void
+protect_end (void *ptr, UWORD isr_level)
+{
+ _Libatomic_Protect_end (ptr, isr_level);
+}
+
+#include_next <host-config.h>
diff --git a/libatomic/config/rtems/lock.c b/libatomic/config/rtems/lock.c
new file mode 100644
index 00000000000..f999f9b6837
--- /dev/null
+++ b/libatomic/config/rtems/lock.c
@@ -0,0 +1,37 @@
+/* Copyright (C) 2016 Free Software Foundation, Inc.
+ Contributed by Sebastian Huber <sebastian.huber@embedded-brains.de>.
+
+ This file is part of the GNU Atomic Library (libatomic).
+
+ Libatomic is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ Libatomic is distributed in the hope that it will be useful, but WITHOUT ANY
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ more details.
+
+ Under Section 7 of GPL version 3, you are granted additional
+ permissions described in the GCC Runtime Library Exception, version
+ 3.1, as published by the Free Software Foundation.
+
+ You should have received a copy of the GNU General Public License and
+ a copy of the GCC Runtime Library Exception along with this program;
+ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include "libatomic_i.h"
+
+void
+libat_lock_n (void *ptr, size_t n)
+{
+ _Libatomic_Lock_n (ptr, n);
+}
+
+void
+libat_unlock_n (void *ptr, size_t n)
+{
+ _Libatomic_Unlock_n (ptr, n);
+}
diff --git a/libatomic/configure.tgt b/libatomic/configure.tgt
index a3757efbbe2..403906dd786 100644
--- a/libatomic/configure.tgt
+++ b/libatomic/configure.tgt
@@ -26,6 +26,10 @@
# Map the target cpu to an ARCH sub-directory. At the same time,
# work out any special compilation flags as necessary.
+# Give operating systems the opportunity to discard XCFLAGS modifications based
+# on ${target_cpu}. For example to allow proper use of multilibs.
+configure_tgt_pre_target_cpu_XCFLAGS="${XCFLAGS}"
+
case "${target_cpu}" in
alpha*) ARCH=alpha ;;
rs6000 | powerpc*) ARCH=powerpc ;;
@@ -108,6 +112,11 @@ case "${target}" in
config_path="${config_path} posix"
;;
+ *-*-rtems*)
+ XCFLAGS="${configure_tgt_pre_target_cpu_XCFLAGS}"
+ config_path="rtems"
+ ;;
+
*-*-elf*)
# ??? No target OS. We could be targeting bare-metal kernel-mode,
# or user-mode for some custom OS. If the target supports TAS,
diff --git a/libbacktrace/ChangeLog b/libbacktrace/ChangeLog
index 0a0fa7abbfd..7b376bef10f 100644
--- a/libbacktrace/ChangeLog
+++ b/libbacktrace/ChangeLog
@@ -1,3 +1,13 @@
+2016-08-03 Release Manager
+
+ * GCC 4.9.4 released.
+
+2016-05-18 Uros Bizjak <ubizjak@gmail.com>
+
+ PR target/71161
+ * elf.c (phdr_callback) [__i386__]: Add
+ __attribute__((__force_align_arg_pointer__)).
+
2015-06-26 Release Manager
* GCC 4.9.3 released.
diff --git a/libbacktrace/elf.c b/libbacktrace/elf.c
index e63aaf5dbdf..4c4e7cd0bb4 100644
--- a/libbacktrace/elf.c
+++ b/libbacktrace/elf.c
@@ -867,6 +867,9 @@ struct phdr_data
libraries. */
static int
+#ifdef __i386__
+__attribute__ ((__force_align_arg_pointer__))
+#endif
phdr_callback (struct dl_phdr_info *info, size_t size ATTRIBUTE_UNUSED,
void *pdata)
{
diff --git a/libcilkrts/ChangeLog b/libcilkrts/ChangeLog
index 96a4999ec11..d84d7a98dd1 100644
--- a/libcilkrts/ChangeLog
+++ b/libcilkrts/ChangeLog
@@ -1,3 +1,7 @@
+2016-08-03 Release Manager
+
+ * GCC 4.9.4 released.
+
2015-06-26 Release Manager
* GCC 4.9.3 released.
diff --git a/libcpp/ChangeLog b/libcpp/ChangeLog
index 2cb99a0067e..34d5ee8e713 100644
--- a/libcpp/ChangeLog
+++ b/libcpp/ChangeLog
@@ -1,3 +1,31 @@
+2016-08-03 Release Manager
+
+ * GCC 4.9.4 released.
+
+2016-02-11 Jakub Jelinek <jakub@redhat.com>
+
+ Backported from mainline
+ 2016-01-28 Jakub Jelinek <jakub@redhat.com>
+
+ PR pch/68176
+ * files.c (_cpp_find_file): Set file->implicit_preinclude even if
+ included from file->implicit_preinclude header.
+
+2016-02-11 Jakub Jelinek <jakub@redhat.com>
+
+ Backported from mainline
+ 2015-11-19 Jakub Jelinek <jakub@redhat.com>
+
+ PR preprocessor/60736
+ * include/cpplib.h (cpp_errno_filename): New prototype.
+ * errors.c (cpp_errno): Don't handle msgid "" specially, use
+ _(msgid) instead of msgid as argument to cpp_error.
+ (cpp_errno_filename): New function.
+ * files.c (read_file_guts): Use cpp_errno_filename instead of
+ cpp_errno.
+ (open_file_failed): Likewise. Use file->name if file->path is NULL
+ in diagnostics.
+
2015-06-26 Release Manager
* GCC 4.9.3 released.
diff --git a/libcpp/errors.c b/libcpp/errors.c
index d1ca7a12ff4..3e7aeae3817 100644
--- a/libcpp/errors.c
+++ b/libcpp/errors.c
@@ -230,8 +230,18 @@ cpp_warning_with_line_syshdr (cpp_reader *pfile, int reason,
bool
cpp_errno (cpp_reader *pfile, int level, const char *msgid)
{
- if (msgid[0] == '\0')
- msgid = _("stdout");
+ return cpp_error (pfile, level, "%s: %s", _(msgid), xstrerror (errno));
+}
+
+/* Print a warning or error, depending on the value of LEVEL. Include
+ information from errno. Unlike cpp_errno, the argument is a filename
+ that is not localized, but "" is replaced with localized "stdout". */
+
+bool
+cpp_errno_filename (cpp_reader *pfile, int level, const char *filename)
+{
+ if (filename[0] == '\0')
+ filename = _("stdout");
- return cpp_error (pfile, level, "%s: %s", msgid, xstrerror (errno));
+ return cpp_error (pfile, level, "%s: %s", filename, xstrerror (errno));
}
diff --git a/libcpp/files.c b/libcpp/files.c
index f9834951c2f..2d87b7902b9 100644
--- a/libcpp/files.c
+++ b/libcpp/files.c
@@ -516,7 +516,10 @@ _cpp_find_file (cpp_reader *pfile, const char *fname, cpp_dir *start_dir,
return entry->u.file;
file = make_cpp_file (pfile, start_dir, fname);
- file->implicit_preinclude = implicit_preinclude;
+ file->implicit_preinclude
+ = (implicit_preinclude
+ || (pfile->buffer
+ && pfile->buffer->file->implicit_preinclude));
/* Try each path in the include chain. */
for (; !fake ;)
@@ -709,7 +712,7 @@ read_file_guts (cpp_reader *pfile, _cpp_file *file)
if (count < 0)
{
- cpp_errno (pfile, CPP_DL_ERROR, file->path);
+ cpp_errno_filename (pfile, CPP_DL_ERROR, file->path);
free (buf);
return false;
}
@@ -1035,7 +1038,8 @@ open_file_failed (cpp_reader *pfile, _cpp_file *file, int angle_brackets)
/* If the preprocessor output (other than dependency information) is
being used, we must also flag an error. */
if (CPP_OPTION (pfile, deps.need_preprocessor_output))
- cpp_errno (pfile, CPP_DL_FATAL, file->path);
+ cpp_errno_filename (pfile, CPP_DL_FATAL,
+ file->path ? file->path : file->name);
}
else
{
@@ -1049,9 +1053,11 @@ open_file_failed (cpp_reader *pfile, _cpp_file *file, int angle_brackets)
if (CPP_OPTION (pfile, deps.style) == DEPS_NONE
|| print_dep
|| CPP_OPTION (pfile, deps.need_preprocessor_output))
- cpp_errno (pfile, CPP_DL_FATAL, file->path);
+ cpp_errno_filename (pfile, CPP_DL_FATAL,
+ file->path ? file->path : file->name);
else
- cpp_errno (pfile, CPP_DL_WARNING, file->path);
+ cpp_errno_filename (pfile, CPP_DL_WARNING,
+ file->path ? file->path : file->name);
}
}
diff --git a/libcpp/include/cpplib.h b/libcpp/include/cpplib.h
index a9db7abbd26..89333febe4f 100644
--- a/libcpp/include/cpplib.h
+++ b/libcpp/include/cpplib.h
@@ -949,6 +949,9 @@ extern bool cpp_warning_syshdr (cpp_reader *, int, const char *msgid, ...)
/* Output a diagnostic with "MSGID: " preceding the
error string of errno. No location is printed. */
extern bool cpp_errno (cpp_reader *, int, const char *msgid);
+/* Similarly, but with "FILENAME: " instead of "MSGID: ", where
+ the filename is not localized. */
+extern bool cpp_errno_filename (cpp_reader *, int, const char *filename);
/* Same as cpp_error, except additionally specifies a position as a
(translation unit) physical line and physical column. If the line is
diff --git a/libcpp/line-map.c b/libcpp/line-map.c
index 78c43933d83..873f80327a0 100644
--- a/libcpp/line-map.c
+++ b/libcpp/line-map.c
@@ -216,7 +216,7 @@ new_linemap (struct line_maps *set,
if (LINEMAPS_USED (set, macro_map_p) == LINEMAPS_ALLOCATED (set, macro_map_p))
{
/* We ran out of allocated line maps. Let's allocate more. */
- unsigned alloc_size;
+ size_t alloc_size;
/* Cast away extern "C" from the type of xrealloc. */
line_map_realloc reallocator = (set->reallocator
diff --git a/libcpp/po/ChangeLog b/libcpp/po/ChangeLog
index 20982da4c16..b82292109de 100644
--- a/libcpp/po/ChangeLog
+++ b/libcpp/po/ChangeLog
@@ -1,3 +1,7 @@
+2016-08-03 Release Manager
+
+ * GCC 4.9.4 released.
+
2015-06-26 Release Manager
* GCC 4.9.3 released.
diff --git a/libdecnumber/ChangeLog b/libdecnumber/ChangeLog
index b1088a146f8..ea1d086e621 100644
--- a/libdecnumber/ChangeLog
+++ b/libdecnumber/ChangeLog
@@ -1,3 +1,7 @@
+2016-08-03 Release Manager
+
+ * GCC 4.9.4 released.
+
2015-06-26 Release Manager
* GCC 4.9.3 released.
diff --git a/libffi/ChangeLog b/libffi/ChangeLog
index 9652c6eb8d1..1c403048e9e 100644
--- a/libffi/ChangeLog
+++ b/libffi/ChangeLog
@@ -1,3 +1,7 @@
+2016-08-03 Release Manager
+
+ * GCC 4.9.4 released.
+
2015-06-26 Release Manager
* GCC 4.9.3 released.
diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog
index 7fab2d947d3..edbf3e60d98 100644
--- a/libgcc/ChangeLog
+++ b/libgcc/ChangeLog
@@ -1,3 +1,38 @@
+2016-08-03 Release Manager
+
+ * GCC 4.9.4 released.
+
+2016-05-17 Sebastian Huber <sebastian.huber@embedded-brains.de>
+
+ Backport from mainline
+ 2016-05-10 Joel Sherrill <joel@rtems.org>
+
+ PR libgcc/70720
+ * config.host (moxie-*-rtems*): Merge this stanza with other moxie
+ targets so the same extra_parts are built. Also have tmake_file add
+ on to its value rather than override.
+
+2016-03-21 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ Backport from mainline
+ 2016-03-16 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ PR target/38239
+ * config/gmon-sol2.c [__i386__] (_mcount): Save and restore
+ call-clobbered registers.
+ (internal_mcount): Remove __i386__ handling.
+
+2015-12-09 John David Anglin <danglin@gcc.gnu.org>
+
+ * config/pa/fptr.c (__canonicalize_funcptr_for_compare): Remove code
+ to initialize call to __dl_fixup once.
+
+2015-12-01 John David Anglin <danglin@gcc.gnu.org>
+
+ * config/pa/fptr.c (__canonicalize_funcptr_for_compare): Initialize
+ fixup values if saved GOT address doesn't match runtime address.
+ (fixup_branch_offset): Reorder list.
+
2015-10-19 Venkataramanan Kumar <Venkataramanan.kumar@amd.com>
Backport from mainline
diff --git a/libgcc/config.host b/libgcc/config.host
index ac0effbedc1..e0261d70d45 100644
--- a/libgcc/config.host
+++ b/libgcc/config.host
@@ -869,14 +869,9 @@ mmix-knuth-mmixware)
mn10300-*-*)
tmake_file=t-fdpbit
;;
-moxie-*-elf | moxie-*-uclinux*)
- tmake_file="moxie/t-moxie t-softfp-sfdf t-softfp-excl t-softfp"
- extra_parts="$extra_parts crti.o crtn.o"
- ;;
-moxie-*-rtems*)
+moxie-*-elf | moxie-*-uclinux* | moxie-*-rtems*)
tmake_file="$tmake_file moxie/t-moxie t-softfp-sfdf t-softfp-excl t-softfp"
- # Don't use default.
- extra_parts=
+ extra_parts="$extra_parts crti.o crtn.o"
;;
msp430*-*-elf)
tmake_file="$tm_file t-crtstuff t-fdpbit msp430/t-msp430"
diff --git a/libgcc/config/gmon-sol2.c b/libgcc/config/gmon-sol2.c
index 7d6149665d0..810012609e1 100644
--- a/libgcc/config/gmon-sol2.c
+++ b/libgcc/config/gmon-sol2.c
@@ -43,11 +43,7 @@
extern void monstartup (char *, char *);
extern void _mcleanup (void);
-#ifdef __i386__
-static void internal_mcount (void) __attribute__ ((used));
-#else
static void internal_mcount (char *, unsigned short *) __attribute__ ((used));
-#endif
static void moncontrol (int);
struct phdr {
@@ -222,8 +218,19 @@ _mcleanup (void)
/* Solaris 2 libraries use _mcount. */
#if defined __i386__
asm(".globl _mcount\n"
+ " .type _mcount, @function\n"
"_mcount:\n"
- " jmp internal_mcount\n");
+ /* Save and restore the call-clobbered registers. */
+ " pushl %eax\n"
+ " pushl %ecx\n"
+ " pushl %edx\n"
+ " movl 12(%esp), %edx\n"
+ " movl 4(%ebp), %eax\n"
+ " call internal_mcount\n"
+ " popl %edx\n"
+ " popl %ecx\n"
+ " popl %eax\n"
+ " ret\n");
#elif defined __x86_64__
/* See GLIBC for additional information about this technique. */
asm(".globl _mcount\n"
@@ -298,32 +305,13 @@ asm(".global _mcount\n"
#endif
static void
-#ifdef __i386__
-internal_mcount (void)
-#else
internal_mcount (char *selfpc, unsigned short *frompcindex)
-#endif
{
struct tostruct *top;
struct tostruct *prevtop;
long toindex;
static char already_setup;
-#ifdef __i386__
- char *selfpc;
- unsigned short *frompcindex;
-
- /* Find the return address for mcount and the return address for mcount's
- caller. */
-
- /* selfpc = pc pushed by mcount call.
- This identifies the function that was just entered. */
- selfpc = (void *) __builtin_return_address (0);
- /* frompcindex = pc in preceding frame.
- This identifies the caller of the function just entered. */
- frompcindex = (void *) __builtin_return_address (1);
-#endif
-
if(!already_setup) {
extern char etext[];
diff --git a/libgcc/config/libbid/ChangeLog b/libgcc/config/libbid/ChangeLog
index b445b46e2e3..01f9844400e 100644
--- a/libgcc/config/libbid/ChangeLog
+++ b/libgcc/config/libbid/ChangeLog
@@ -1,3 +1,7 @@
+2016-08-03 Release Manager
+
+ * GCC 4.9.4 released.
+
2015-06-26 Release Manager
* GCC 4.9.3 released.
diff --git a/libgcc/config/pa/fptr.c b/libgcc/config/pa/fptr.c
index 347f636dd25..8720ae9fed9 100644
--- a/libgcc/config/pa/fptr.c
+++ b/libgcc/config/pa/fptr.c
@@ -40,7 +40,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
the template should it be necessary to change the current branch
position. */
#define NOFFSETS 2
-static int fixup_branch_offset[NOFFSETS] = { 32, -4 };
+static int fixup_branch_offset[NOFFSETS] = { -4, 32 };
#define GET_FIELD(X, FROM, TO) \
((X) >> (31 - (TO)) & ((1 << ((TO) - (FROM) + 1)) - 1))
@@ -64,9 +64,10 @@ unsigned int __canonicalize_funcptr_for_compare (fptr_t)
unsigned int
__canonicalize_funcptr_for_compare (fptr_t fptr)
{
- static unsigned int fixup_plabel[2];
- static fixup_t fixup;
- unsigned int *plabel, *got;
+ static unsigned int fixup_plabel[2] __attribute__((used));
+ fixup_t fixup;
+ unsigned int *got, *iptr, *plabel;
+ int i;
/* -1 and page 0 are special. -1 is used in crtend to mark the end of
a list of function pointers. Also return immediately if the plabel
@@ -87,42 +88,33 @@ __canonicalize_funcptr_for_compare (fptr_t fptr)
if (got != &_GLOBAL_OFFSET_TABLE_)
return plabel[0];
- /* Initialize our plabel for calling fixup if we haven't done so already.
- This code needs to be thread safe but we don't have to be too careful
- as the result is invariant. */
- if (!fixup)
+ /* Find the first "bl" branch in the offset search list. This is a
+ call to _dl_fixup or a magic branch to fixup at the beginning of the
+ trampoline template. The fixup function does the actual runtime
+ resolution of function descriptors. We only look for "bl" branches
+ with a 17-bit pc-relative displacement. */
+ for (i = 0; i < NOFFSETS; i++)
{
- int i;
- unsigned int *iptr;
-
- /* Find the first "bl" branch in the offset search list. This is a
- call to fixup or a magic branch to fixup at the beginning of the
- trampoline template. The fixup function does the actual runtime
- resolution of function descriptors. We only look for "bl" branches
- with a 17-bit pc-relative displacement. */
- for (i = 0; i < NOFFSETS; i++)
- {
- iptr = (unsigned int *) (got[-2] + fixup_branch_offset[i]);
- if ((*iptr & 0xfc00e000) == 0xe8000000)
- break;
- }
-
- /* This should not happen... */
- if (i == NOFFSETS)
- return ~0;
-
- /* Extract the 17-bit displacement from the instruction. */
- iptr += SIGN_EXTEND (GET_FIELD (*iptr, 19, 28) |
- GET_FIELD (*iptr, 29, 29) << 10 |
- GET_FIELD (*iptr, 11, 15) << 11 |
- GET_FIELD (*iptr, 31, 31) << 16, 17);
-
- /* Build a plabel for an indirect call to fixup. */
- fixup_plabel[0] = (unsigned int) iptr + 8; /* address of fixup */
- fixup_plabel[1] = got[-1]; /* ltp for fixup */
- fixup = (fixup_t) ((int) fixup_plabel | 3);
+ iptr = (unsigned int *) (got[-2] + fixup_branch_offset[i]);
+ if ((*iptr & 0xfc00e000) == 0xe8000000)
+ break;
}
+ /* This should not happen... */
+ if (i == NOFFSETS)
+ return ~0;
+
+ /* Extract the 17-bit displacement from the instruction. */
+ iptr += SIGN_EXTEND (GET_FIELD (*iptr, 19, 28) |
+ GET_FIELD (*iptr, 29, 29) << 10 |
+ GET_FIELD (*iptr, 11, 15) << 11 |
+ GET_FIELD (*iptr, 31, 31) << 16, 17);
+
+ /* Build a plabel for an indirect call to _dl_fixup. */
+ fixup_plabel[0] = (unsigned int) iptr + 8; /* address of fixup */
+ fixup_plabel[1] = got[-1]; /* ltp for fixup */
+ fixup = (fixup_t) ((int) fixup_plabel | 3);
+
/* Call fixup to resolve the function address. got[1] contains the
link_map pointer and plabel[1] the relocation offset. */
fixup ((struct link_map *) got[1], plabel[1]);
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog
index 5cdd8192e15..c1aa49af741 100644
--- a/libgfortran/ChangeLog
+++ b/libgfortran/ChangeLog
@@ -1,3 +1,27 @@
+2016-08-03 Release Manager
+
+ * GCC 4.9.4 released.
+
+2016-05-05 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
+ Backport from trunk.
+ PR libgfortran/70684
+ * io/list_read (next_char): Add '\r' to check for end of line.
+ factor. (two places)
+
+2016-04-05 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+ Dominique d'Humieres <dominiq@lps.ens.fr>
+
+ PR libgfortran/70235
+ * io/write_float.def: Fix PF format for negative values of the scale
+ factor.
+
+2016-02-18 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
+ Backport from gcc-5-branch.
+ PR libgfortran/69668
+ * io/list_read.c (read_character): Remove code related to DELIM_NONE.
+
2015-08-28 James Greenhalgh <james.greenhalgh@arm.com>
Backport from gcc-5-branch.
diff --git a/libgfortran/io/list_read.c b/libgfortran/io/list_read.c
index b95721069cc..9e6dd315371 100644
--- a/libgfortran/io/list_read.c
+++ b/libgfortran/io/list_read.c
@@ -141,7 +141,8 @@ next_char (st_parameter_dt *dtp)
dtp->u.p.at_eol = 0;
c = dtp->u.p.last_char;
dtp->u.p.last_char = EOF - 1;
- goto done;
+ dtp->u.p.at_eol = (c == '\n' || c == '\r' || c == EOF);
+ return c;
}
/* Read from line_buffer if enabled. */
@@ -155,7 +156,8 @@ next_char (st_parameter_dt *dtp)
{
dtp->u.p.line_buffer[dtp->u.p.line_buffer_pos] = '\0';
dtp->u.p.line_buffer_pos++;
- goto done;
+ dtp->u.p.at_eol = (c == '\n' || c == '\r' || c == EOF);
+ return c;
}
dtp->u.p.line_buffer_pos = 0;
@@ -1006,21 +1008,6 @@ read_character (st_parameter_dt *dtp, int length __attribute__ ((unused)))
default:
if (dtp->u.p.namelist_mode)
{
- if (dtp->u.p.current_unit->delim_status == DELIM_NONE)
- {
- /* No delimiters so finish reading the string now. */
- int i;
- push_char (dtp, c);
- for (i = dtp->u.p.ionml->string_length; i > 1; i--)
- {
- if ((c = next_char (dtp)) == EOF)
- goto done_eof;
- push_char (dtp, c);
- }
- dtp->u.p.saved_type = BT_CHARACTER;
- free_line (dtp);
- return;
- }
unget_char (dtp, c);
return;
}
diff --git a/libgfortran/io/write_float.def b/libgfortran/io/write_float.def
index 99f6ff8e83f..05b5c721de0 100644
--- a/libgfortran/io/write_float.def
+++ b/libgfortran/io/write_float.def
@@ -184,9 +184,6 @@ output_float (st_parameter_dt *dtp, const fnode *f, char *buffer, size_t size,
memmove (digits + nbefore, digits + nbefore + 1, p);
digits[nbefore + p] = '.';
nbefore += p;
- nafter = d - p;
- if (nafter < 0)
- nafter = 0;
nafter = d;
nzero = 0;
}
@@ -204,12 +201,27 @@ output_float (st_parameter_dt *dtp, const fnode *f, char *buffer, size_t size,
{
nzero = -(nbefore + p);
memmove (digits + 1, digits, nbefore);
- digits++;
- nafter = d + nbefore;
+ nafter = d - nzero;
+ if (nafter == 0 && d > 0)
+ {
+ /* This is needed to get the correct rounding. */
+ memmove (digits + 1, digits, ndigits - 1);
+ digits[1] = '0';
+ nafter = 1;
+ nzero = d - 1;
+ }
+ else if (nafter < 0)
+ {
+ /* Reset digits to 0 in order to get correct rounding
+ towards infinity. */
+ for (i = 0; i < ndigits; i++)
+ digits[i] = '0';
+ digits[ndigits - 1] = '1';
+ nafter = d;
+ nzero = 0;
+ }
nbefore = 0;
}
- if (nzero > d)
- nzero = d;
}
}
else
diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog
index 924feddfec0..33b1a3f9564 100644
--- a/libgomp/ChangeLog
+++ b/libgomp/ChangeLog
@@ -1,3 +1,36 @@
+2016-08-03 Release Manager
+
+ * GCC 4.9.4 released.
+
+2016-07-07 Jakub Jelinek <jakub@redhat.com>
+
+ Backported from mainline
+ 2016-07-01 Jakub Jelinek <jakub@redhat.com>
+
+ PR fortran/71717
+ * testsuite/libgomp.fortran/associate3.f90: New test.
+
+2016-02-16 Tom de Vries <tom@codesourcery.com>
+
+ backport from trunk:
+ PR lto/67709
+ 2016-02-16 Tom de Vries <tom@codesourcery.com>
+
+ * testsuite/libgomp.fortran/declare-simd-4.f90: New test.
+
+2016-02-11 Jakub Jelinek <jakub@redhat.com>
+
+ Backported from mainline
+ 2016-01-07 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/68960
+ * testsuite/libgomp.c/pr68960.c: New test.
+
+2016-01-26 Tom de Vries <tom@codesourcery.com>
+
+ PR tree-optimization/69110
+ * testsuite/libgomp.c/pr69110.c: New test.
+
2015-06-26 Release Manager
* GCC 4.9.3 released.
diff --git a/libgomp/testsuite/libgomp.c/pr68960.c b/libgomp/testsuite/libgomp.c/pr68960.c
new file mode 100644
index 00000000000..2accc6af4a8
--- /dev/null
+++ b/libgomp/testsuite/libgomp.c/pr68960.c
@@ -0,0 +1,25 @@
+/* PR middle-end/68960 */
+/* { dg-do run } */
+
+int
+main ()
+{
+ int temp[257] __attribute__ ((aligned (256))) = { 0 };
+ #pragma omp parallel private (temp) num_threads (2)
+ {
+ int *p = &temp[0];
+ asm volatile ("" : "+g" (p));
+ if (((__UINTPTR_TYPE__) p) & 255)
+ __builtin_abort ();
+ }
+ #pragma omp parallel num_threads (2)
+ #pragma omp single
+ #pragma omp task firstprivate (temp)
+ {
+ int *p = &temp[0];
+ asm volatile ("" : "+g" (p));
+ if (((__UINTPTR_TYPE__) p) & 255)
+ __builtin_abort ();
+ }
+ return 0;
+}
diff --git a/libgomp/testsuite/libgomp.c/pr69110.c b/libgomp/testsuite/libgomp.c/pr69110.c
new file mode 100644
index 00000000000..0d9e5ca5c3c
--- /dev/null
+++ b/libgomp/testsuite/libgomp.c/pr69110.c
@@ -0,0 +1,26 @@
+/* { dg-do run } */
+/* { dg-options "-ftree-parallelize-loops=2 -O1 -fno-tree-loop-im" } */
+
+#define N 1000
+
+unsigned int i = 0;
+
+static void __attribute__((noinline, noclone))
+foo (void)
+{
+ unsigned int z;
+ for (z = 0; z < N; ++z)
+ ++i;
+}
+
+extern void abort (void);
+
+int
+main (void)
+{
+ foo ();
+ if (i != N)
+ abort ();
+
+ return 0;
+}
diff --git a/libgomp/testsuite/libgomp.fortran/associate3.f90 b/libgomp/testsuite/libgomp.fortran/associate3.f90
new file mode 100644
index 00000000000..ec3d8dc33b9
--- /dev/null
+++ b/libgomp/testsuite/libgomp.fortran/associate3.f90
@@ -0,0 +1,20 @@
+! PR fortran/71717
+! { dg-do run }
+
+ type t
+ real, allocatable :: f(:)
+ end type
+ type (t) :: v
+ integer :: i, j
+ allocate (v%f(4))
+ v%f = 19.
+ i = 5
+ associate (u => v, k => i)
+ !$omp parallel do
+ do j = 1, 4
+ u%f(j) = 21.
+ if (j.eq.1) k = 7
+ end do
+ end associate
+ if (any (v%f(:).ne.21.) .or. i.ne.7) call abort
+end
diff --git a/libgomp/testsuite/libgomp.fortran/declare-simd-4.f90 b/libgomp/testsuite/libgomp.fortran/declare-simd-4.f90
new file mode 100644
index 00000000000..bfdf9cf11b4
--- /dev/null
+++ b/libgomp/testsuite/libgomp.fortran/declare-simd-4.f90
@@ -0,0 +1,7 @@
+! { dg-do run { target { vect_simd_clones && lto } } }
+! { dg-options "-fno-inline -flto -fno-use-linker-plugin" }
+! { dg-additional-sources declare-simd-3.f90 }
+! { dg-additional-options "-msse2" { target sse2_runtime } }
+! { dg-additional-options "-mavx" { target avx_runtime } }
+
+include 'declare-simd-2.f90'
diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog
index df722b33a1a..8c62484a9a2 100644
--- a/libiberty/ChangeLog
+++ b/libiberty/ChangeLog
@@ -1,3 +1,132 @@
+2016-08-03 Release Manager
+
+ * GCC 4.9.4 released.
+
+2016-05-19 Jakub Jelinek <jakub@redhat.com>
+
+ Backported from mainline
+ 2016-05-19 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/70498
+ * cp-demangle.c (d_expression_1): Formatting fix.
+
+ 2016-05-02 Marcel Böhme <boehme.marcel@gmail.com>
+
+ PR c++/70498
+ * cp-demangle.c: Parse numbers as integer instead of long to avoid
+ overflow after sanity checks. Include <limits.h> if available.
+ (INT_MAX): Define if necessary.
+ (d_make_template_param): Takes integer argument instead of long.
+ (d_make_function_param): Likewise.
+ (d_append_num): Likewise.
+ (d_identifier): Likewise.
+ (d_number): Parse as and return integer.
+ (d_compact_number): Handle overflow.
+ (d_source_name): Change variable type to integer for parsed number.
+ (d_java_resource): Likewise.
+ (d_special_name): Likewise.
+ (d_discriminator): Likewise.
+ (d_unnamed_type): Likewise.
+ * testsuite/demangle-expected: Add regression test cases.
+
+ 2016-04-08 Marcel Böhme <boehme.marcel@gmail.com>
+
+ PR c++/69687
+ * cplus-dem.c: Include <limits.h> if available.
+ (INT_MAX): Define if necessary.
+ (remember_type, remember_Ktype, register_Btype, string_need):
+ Abort if we detect cases where we the size of the allocation would
+ overflow.
+
+ PR c++/70492
+ * cplus-dem.c (gnu_special): Handle case where consume_count returns
+ -1.
+
+ 2016-03-31 Mikhail Maltsev <maltsevm@gmail.com>
+ Marcel Bohme <boehme.marcel@gmail.com>
+
+ PR c++/67394
+ PR c++/70481
+ * cplus-dem.c (squangle_mop_up): Zero bsize/ksize after freeing
+ btypevec/ktypevec.
+ * testsuite/demangle-expected: Add coverage tests.
+
+ 2015-11-27 Pedro Alves <palves@redhat.com>
+
+ PR other/61321
+ PR other/61233
+ * cp-demangle.c (d_demangle_callback, d_make_comp): Handle
+ DEMANGLE_COMPONENT_CONVERSION.
+ (is_ctor_dtor_or_conversion): Handle DEMANGLE_COMPONENT_CONVERSION
+ instead of DEMANGLE_COMPONENT_CAST.
+ (d_operator_name): Return a DEMANGLE_COMPONENT_CONVERSION
+ component if handling a conversion.
+ (d_count_templates_scopes, d_print_comp_inner): Handle
+ DEMANGLE_COMPONENT_CONVERSION.
+ (d_print_comp_inner): Handle DEMANGLE_COMPONENT_CONVERSION instead
+ of DEMANGLE_COMPONENT_CAST.
+ (d_print_cast): Rename as ...
+ (d_print_conversion): ... this. Adjust comments.
+ (d_print_cast): Rewrite - simply print the left subcomponent.
+ * cp-demint.c (cplus_demangle_fill_component): Handle
+ DEMANGLE_COMPONENT_CONVERSION.
+
+ * testsuite/demangle-expected: Add tests.
+
+ 2015-07-13 Mikhail Maltsev <maltsevm@gmail.com>
+
+ * cp-demangle.c (d_dump): Fix syntax error.
+ (d_identifier): Adjust type of len to match d_source_name.
+ (d_expression_1): Fix out-of-bounds access. Check code variable for
+ NULL before dereferencing it.
+ (d_find_pack): Do not recurse for FIXED_TYPE, DEFAULT_ARG and NUMBER.
+ (d_print_comp_inner): Add NULL pointer check.
+ * testsuite/demangle-expected: Add new testcases.
+
+ 2014-08-29 Andrew Burgess <aburgess@broadcom.com>
+
+ * cp-demangle.c (d_dump): Only access field from s_fixed part of
+ the union for DEMANGLE_COMPONENT_FIXED_TYPE.
+ (d_count_templates_scopes): Likewise.
+
+ 2014-08-13 Gary Benson <gbenson@redhat.com>
+
+ * testsuite/demangler-fuzzer.c: New file.
+ * testsuite/Makefile.in (fuzz-demangler): New rule.
+ (demangler-fuzzer): Likewise.
+ (mostlyclean): Clean up demangler fuzzer.
+
+ 2014-06-11 Andrew Burgess <aburgess@broadcom.com>
+
+ * cplus-dem.c (do_type): Call string_delete even if the call to
+ demangle_template fails.
+
+ 2014-05-28 Pedro Alves <palves@redhat.com>
+
+ * cp-demangle.c (d_dump): Handle DEMANGLE_COMPONENT_FUNCTION_PARAM
+ and DEMANGLE_COMPONENT_NUMBER.
+
+ 2014-05-22 Thomas Schwinge <thomas@codesourcery.com>
+
+ * testsuite/demangle-expected: Fix last commit.
+
+ 2014-05-14 Andrew Burgess <aburgess@broadcom.com>
+
+ * cplus-dmem.c (internal_cplus_demangle): Free any resources
+ allocated by possible previous call to gnu_special.
+ (squangle_mop_up): Reset pointers to NULL after calling free.
+ * testsuite/demangle-expected: New test case.
+
+ 2014-05-08 Gary Benson <gbenson@redhat.com>
+
+ * cp-demangle.c (struct d_component_stack): New structure.
+ (struct d_print_info): New field component_stack.
+ (d_print_init): Initialize the above.
+ (d_print_comp_inner): Renamed from d_print_comp.
+ Do not restore template stack if it would cause a loop.
+ (d_print_comp): New function.
+ * testsuite/demangle-expected: New test cases.
+
2015-06-26 Release Manager
* GCC 4.9.3 released.
diff --git a/libiberty/cp-demangle.c b/libiberty/cp-demangle.c
index 3d5d33ef591..3e3dd98bbe0 100644
--- a/libiberty/cp-demangle.c
+++ b/libiberty/cp-demangle.c
@@ -124,6 +124,13 @@ extern char *alloca ();
# endif /* alloca */
#endif /* HAVE_ALLOCA_H */
+#ifdef HAVE_LIMITS_H
+#include <limits.h>
+#endif
+#ifndef INT_MAX
+# define INT_MAX (int)(((unsigned int) ~0) >> 1) /* 0x7FFFFFFF */
+#endif
+
#include "ansidecl.h"
#include "libiberty.h"
#include "demangle.h"
@@ -275,6 +282,16 @@ struct d_growable_string
int allocation_failure;
};
+/* Stack of components, innermost first, used to avoid loops. */
+
+struct d_component_stack
+{
+ /* This component. */
+ const struct demangle_component *dc;
+ /* This component's parent. */
+ const struct d_component_stack *parent;
+};
+
/* A demangle component and some scope captured when it was first
traversed. */
@@ -327,6 +344,8 @@ struct d_print_info
int pack_index;
/* Number of d_print_flush calls so far. */
unsigned long int flush_count;
+ /* Stack of components, innermost first, used to avoid loops. */
+ const struct d_component_stack *component_stack;
/* Array of saved scopes for evaluating substitutions. */
struct d_saved_scope *saved_scopes;
/* Index of the next unused saved scope in the above array. */
@@ -382,7 +401,7 @@ d_make_dtor (struct d_info *, enum gnu_v3_dtor_kinds,
struct demangle_component *);
static struct demangle_component *
-d_make_template_param (struct d_info *, long);
+d_make_template_param (struct d_info *, int);
static struct demangle_component *
d_make_sub (struct d_info *, const char *, int);
@@ -405,7 +424,7 @@ static struct demangle_component *d_unqualified_name (struct d_info *);
static struct demangle_component *d_source_name (struct d_info *);
-static long d_number (struct d_info *);
+static int d_number (struct d_info *);
static struct demangle_component *d_identifier (struct d_info *, int);
@@ -526,8 +545,10 @@ d_print_array_type (struct d_print_info *, int,
static void
d_print_expr_op (struct d_print_info *, int, const struct demangle_component *);
-static void
-d_print_cast (struct d_print_info *, int, const struct demangle_component *);
+static void d_print_cast (struct d_print_info *, int,
+ const struct demangle_component *);
+static void d_print_conversion (struct d_print_info *, int,
+ const struct demangle_component *);
static int d_demangle_callback (const char *, int,
demangle_callbackref, void *);
@@ -563,6 +584,9 @@ d_dump (struct demangle_component *dc, int indent)
case DEMANGLE_COMPONENT_TEMPLATE_PARAM:
printf ("template parameter %ld\n", dc->u.s_number.number);
return;
+ case DEMANGLE_COMPONENT_FUNCTION_PARAM:
+ printf ("function parameter %ld\n", dc->u.s_number.number);
+ return;
case DEMANGLE_COMPONENT_CTOR:
printf ("constructor %d\n", (int) dc->u.s_ctor.kind);
d_dump (dc->u.s_ctor.name, indent + 2);
@@ -698,7 +722,9 @@ d_dump (struct demangle_component *dc, int indent)
printf ("pointer to member type\n");
break;
case DEMANGLE_COMPONENT_FIXED_TYPE:
- printf ("fixed-point type\n");
+ printf ("fixed-point type, accum? %d, sat? %d\n",
+ dc->u.s_fixed.accum, dc->u.s_fixed.sat);
+ d_dump (dc->u.s_fixed.length, indent + 2);
break;
case DEMANGLE_COMPONENT_ARGLIST:
printf ("argument list\n");
@@ -712,6 +738,9 @@ d_dump (struct demangle_component *dc, int indent)
case DEMANGLE_COMPONENT_CAST:
printf ("cast\n");
break;
+ case DEMANGLE_COMPONENT_CONVERSION:
+ printf ("conversion operator\n");
+ break;
case DEMANGLE_COMPONENT_NULLARY:
printf ("nullary operator\n");
break;
@@ -748,6 +777,9 @@ d_dump (struct demangle_component *dc, int indent)
case DEMANGLE_COMPONENT_CHARACTER:
printf ("character '%c'\n", dc->u.s_character.character);
return;
+ case DEMANGLE_COMPONENT_NUMBER:
+ printf ("number %ld\n", dc->u.s_number.number);
+ return;
case DEMANGLE_COMPONENT_DECLTYPE:
printf ("decltype\n");
break;
@@ -918,6 +950,7 @@ d_make_comp (struct d_info *di, enum demangle_component_type type,
case DEMANGLE_COMPONENT_IMAGINARY:
case DEMANGLE_COMPONENT_VENDOR_TYPE:
case DEMANGLE_COMPONENT_CAST:
+ case DEMANGLE_COMPONENT_CONVERSION:
case DEMANGLE_COMPONENT_JAVA_RESOURCE:
case DEMANGLE_COMPONENT_DECLTYPE:
case DEMANGLE_COMPONENT_PACK_EXPANSION:
@@ -1085,7 +1118,7 @@ d_make_dtor (struct d_info *di, enum gnu_v3_dtor_kinds kind,
/* Add a new template parameter. */
static struct demangle_component *
-d_make_template_param (struct d_info *di, long i)
+d_make_template_param (struct d_info *di, int i)
{
struct demangle_component *p;
@@ -1101,7 +1134,7 @@ d_make_template_param (struct d_info *di, long i)
/* Add a new function parameter. */
static struct demangle_component *
-d_make_function_param (struct d_info *di, long i)
+d_make_function_param (struct d_info *di, int i)
{
struct demangle_component *p;
@@ -1209,7 +1242,7 @@ is_ctor_dtor_or_conversion (struct demangle_component *dc)
return is_ctor_dtor_or_conversion (d_right (dc));
case DEMANGLE_COMPONENT_CTOR:
case DEMANGLE_COMPONENT_DTOR:
- case DEMANGLE_COMPONENT_CAST:
+ case DEMANGLE_COMPONENT_CONVERSION:
return 1;
}
}
@@ -1575,7 +1608,7 @@ d_unqualified_name (struct d_info *di)
static struct demangle_component *
d_source_name (struct d_info *di)
{
- long len;
+ int len;
struct demangle_component *ret;
len = d_number (di);
@@ -1588,12 +1621,12 @@ d_source_name (struct d_info *di)
/* number ::= [n] <(non-negative decimal integer)> */
-static long
+static int
d_number (struct d_info *di)
{
int negative;
char peek;
- long ret;
+ int ret;
negative = 0;
peek = d_peek_char (di);
@@ -1765,11 +1798,16 @@ d_operator_name (struct d_info *di)
{
struct demangle_component *type;
int was_conversion = di->is_conversion;
+ struct demangle_component *res;
di->is_conversion = ! di->is_expression;
type = cplus_demangle_type (di);
+ if (di->is_conversion)
+ res = d_make_comp (di, DEMANGLE_COMPONENT_CONVERSION, type, NULL);
+ else
+ res = d_make_comp (di, DEMANGLE_COMPONENT_CAST, type, NULL);
di->is_conversion = was_conversion;
- return d_make_comp (di, DEMANGLE_COMPONENT_CAST, type, NULL);
+ return res;
}
else
{
@@ -1820,7 +1858,7 @@ d_java_resource (struct d_info *di)
{
struct demangle_component *p = NULL;
struct demangle_component *next = NULL;
- long len, i;
+ int len, i;
char c;
const char *str;
@@ -1962,7 +2000,7 @@ d_special_name (struct d_info *di)
case 'C':
{
struct demangle_component *derived_type;
- long offset;
+ int offset;
struct demangle_component *base_type;
derived_type = cplus_demangle_type (di);
@@ -2885,10 +2923,10 @@ d_pointer_to_member_type (struct d_info *di)
/* <non-negative number> _ */
-static long
+static int
d_compact_number (struct d_info *di)
{
- long num;
+ int num;
if (d_peek_char (di) == '_')
num = 0;
else if (d_peek_char (di) == 'n')
@@ -2896,7 +2934,7 @@ d_compact_number (struct d_info *di)
else
num = d_number (di) + 1;
- if (! d_check_char (di, '_'))
+ if (num < 0 || ! d_check_char (di, '_'))
return -1;
return num;
}
@@ -2908,7 +2946,7 @@ d_compact_number (struct d_info *di)
static struct demangle_component *
d_template_param (struct d_info *di)
{
- long param;
+ int param;
if (! d_check_char (di, 'T'))
return NULL;
@@ -3110,9 +3148,10 @@ d_expression_1 (struct d_info *di)
}
else
{
- index = d_compact_number (di) + 1;
- if (index == 0)
+ index = d_compact_number (di);
+ if (index == INT_MAX || index == -1)
return NULL;
+ index++;
}
return d_make_function_param (di, index);
}
@@ -3143,6 +3182,8 @@ d_expression_1 (struct d_info *di)
struct demangle_component *type = NULL;
if (peek == 't')
type = cplus_demangle_type (di);
+ if (!d_peek_next_char (di))
+ return NULL;
d_advance (di, 2);
return d_make_comp (di, DEMANGLE_COMPONENT_INITIALIZER_LIST,
type, d_exprlist (di, 'E'));
@@ -3217,6 +3258,8 @@ d_expression_1 (struct d_info *di)
struct demangle_component *left;
struct demangle_component *right;
+ if (code == NULL)
+ return NULL;
if (op_is_new_cast (op))
left = cplus_demangle_type (di);
else
@@ -3244,7 +3287,9 @@ d_expression_1 (struct d_info *di)
struct demangle_component *second;
struct demangle_component *third;
- if (!strcmp (code, "qu"))
+ if (code == NULL)
+ return NULL;
+ else if (!strcmp (code, "qu"))
{
/* ?: expression. */
first = d_expression_1 (di);
@@ -3435,7 +3480,7 @@ d_local_name (struct d_info *di)
static int
d_discriminator (struct d_info *di)
{
- long discrim;
+ int discrim;
if (d_peek_char (di) != '_')
return 1;
@@ -3491,7 +3536,7 @@ static struct demangle_component *
d_unnamed_type (struct d_info *di)
{
struct demangle_component *ret;
- long num;
+ int num;
if (! d_check_char (di, 'U'))
return NULL;
@@ -3857,12 +3902,12 @@ d_count_templates_scopes (int *num_templates, int *num_scopes,
case DEMANGLE_COMPONENT_FUNCTION_TYPE:
case DEMANGLE_COMPONENT_ARRAY_TYPE:
case DEMANGLE_COMPONENT_PTRMEM_TYPE:
- case DEMANGLE_COMPONENT_FIXED_TYPE:
case DEMANGLE_COMPONENT_VECTOR_TYPE:
case DEMANGLE_COMPONENT_ARGLIST:
case DEMANGLE_COMPONENT_TEMPLATE_ARGLIST:
case DEMANGLE_COMPONENT_INITIALIZER_LIST:
case DEMANGLE_COMPONENT_CAST:
+ case DEMANGLE_COMPONENT_CONVERSION:
case DEMANGLE_COMPONENT_NULLARY:
case DEMANGLE_COMPONENT_UNARY:
case DEMANGLE_COMPONENT_BINARY:
@@ -3902,6 +3947,11 @@ d_count_templates_scopes (int *num_templates, int *num_scopes,
dc->u.s_extended_operator.name);
break;
+ case DEMANGLE_COMPONENT_FIXED_TYPE:
+ d_count_templates_scopes (num_templates, num_scopes,
+ dc->u.s_fixed.length);
+ break;
+
case DEMANGLE_COMPONENT_GLOBAL_CONSTRUCTORS:
case DEMANGLE_COMPONENT_GLOBAL_DESTRUCTORS:
d_count_templates_scopes (num_templates, num_scopes,
@@ -3934,6 +3984,8 @@ d_print_init (struct d_print_info *dpi, demangle_callbackref callback,
dpi->demangle_failure = 0;
+ dpi->component_stack = NULL;
+
dpi->saved_scopes = NULL;
dpi->next_saved_scope = 0;
dpi->num_saved_scopes = 0;
@@ -4002,10 +4054,10 @@ d_append_string (struct d_print_info *dpi, const char *s)
}
static inline void
-d_append_num (struct d_print_info *dpi, long l)
+d_append_num (struct d_print_info *dpi, int l)
{
char buf[25];
- sprintf (buf,"%ld", l);
+ sprintf (buf,"%d", l);
d_append_string (dpi, buf);
}
@@ -4158,6 +4210,9 @@ d_find_pack (struct d_print_info *dpi,
case DEMANGLE_COMPONENT_CHARACTER:
case DEMANGLE_COMPONENT_FUNCTION_PARAM:
case DEMANGLE_COMPONENT_UNNAMED_TYPE:
+ case DEMANGLE_COMPONENT_FIXED_TYPE:
+ case DEMANGLE_COMPONENT_DEFAULT_ARG:
+ case DEMANGLE_COMPONENT_NUMBER:
return NULL;
case DEMANGLE_COMPONENT_EXTENDED_OPERATOR:
@@ -4269,8 +4324,8 @@ d_get_saved_scope (struct d_print_info *dpi,
/* Subroutine to handle components. */
static void
-d_print_comp (struct d_print_info *dpi, int options,
- const struct demangle_component *dc)
+d_print_comp_inner (struct d_print_info *dpi, int options,
+ const struct demangle_component *dc)
{
/* Magic variable to let reference smashing skip over the next modifier
without needing to modify *dc. */
@@ -4393,6 +4448,11 @@ d_print_comp (struct d_print_info *dpi, int options,
local_name = d_right (typed_name);
if (local_name->type == DEMANGLE_COMPONENT_DEFAULT_ARG)
local_name = local_name->u.s_unary_num.sub;
+ if (local_name == NULL)
+ {
+ d_print_error (dpi);
+ return;
+ }
while (local_name->type == DEMANGLE_COMPONENT_RESTRICT_THIS
|| local_name->type == DEMANGLE_COMPONENT_VOLATILE_THIS
|| local_name->type == DEMANGLE_COMPONENT_CONST_THIS
@@ -4673,11 +4733,30 @@ d_print_comp (struct d_print_info *dpi, int options,
}
else
{
+ const struct d_component_stack *dcse;
+ int found_self_or_parent = 0;
+
/* This traversal is reentering SUB as a substition.
- Restore the original templates temporarily. */
- saved_templates = dpi->templates;
- dpi->templates = scope->templates;
- need_template_restore = 1;
+ If we are not beneath SUB or DC in the tree then we
+ need to restore SUB's template stack temporarily. */
+ for (dcse = dpi->component_stack; dcse != NULL;
+ dcse = dcse->parent)
+ {
+ if (dcse->dc == sub
+ || (dcse->dc == dc
+ && dcse != dpi->component_stack))
+ {
+ found_self_or_parent = 1;
+ break;
+ }
+ }
+
+ if (!found_self_or_parent)
+ {
+ saved_templates = dpi->templates;
+ dpi->templates = scope->templates;
+ need_template_restore = 1;
+ }
}
a = d_lookup_template_argument (dpi, sub);
@@ -4962,9 +5041,9 @@ d_print_comp (struct d_print_info *dpi, int options,
d_print_comp (dpi, options, dc->u.s_extended_operator.name);
return;
- case DEMANGLE_COMPONENT_CAST:
+ case DEMANGLE_COMPONENT_CONVERSION:
d_append_string (dpi, "operator ");
- d_print_cast (dpi, options, dc);
+ d_print_conversion (dpi, options, dc);
return;
case DEMANGLE_COMPONENT_NULLARY:
@@ -5316,6 +5395,21 @@ d_print_comp (struct d_print_info *dpi, int options,
}
}
+static void
+d_print_comp (struct d_print_info *dpi, int options,
+ const struct demangle_component *dc)
+{
+ struct d_component_stack self;
+
+ self.dc = dc;
+ self.parent = dpi->component_stack;
+ dpi->component_stack = &self;
+
+ d_print_comp_inner (dpi, options, dc);
+
+ dpi->component_stack = self.parent;
+}
+
/* Print a Java dentifier. For Java we try to handle encoded extended
Unicode characters. The C++ ABI doesn't mention Unicode encoding,
so we don't it for C++. Characters are encoded as
@@ -5682,11 +5776,20 @@ d_print_expr_op (struct d_print_info *dpi, int options,
static void
d_print_cast (struct d_print_info *dpi, int options,
- const struct demangle_component *dc)
+ const struct demangle_component *dc)
+{
+ d_print_comp (dpi, options, d_left (dc));
+}
+
+/* Print a conversion operator. */
+
+static void
+d_print_conversion (struct d_print_info *dpi, int options,
+ const struct demangle_component *dc)
{
struct d_print_template dpt;
- /* For a cast operator, we need the template parameters from
+ /* For a conversion operator, we need the template parameters from
the enclosing template in scope for processing the type. */
if (dpi->current_template != NULL)
{
diff --git a/libiberty/cp-demint.c b/libiberty/cp-demint.c
index 1d1a77af748..efcc5b7f5c0 100644
--- a/libiberty/cp-demint.c
+++ b/libiberty/cp-demint.c
@@ -110,6 +110,7 @@ cplus_demangle_fill_component (struct demangle_component *p,
case DEMANGLE_COMPONENT_IMAGINARY:
case DEMANGLE_COMPONENT_VENDOR_TYPE:
case DEMANGLE_COMPONENT_CAST:
+ case DEMANGLE_COMPONENT_CONVERSION:
if (right != NULL)
return 0;
break;
diff --git a/libiberty/cplus-dem.c b/libiberty/cplus-dem.c
index e94848767e7..aace73302cb 100644
--- a/libiberty/cplus-dem.c
+++ b/libiberty/cplus-dem.c
@@ -56,6 +56,13 @@ void * malloc ();
void * realloc ();
#endif
+#ifdef HAVE_LIMITS_H
+#include <limits.h>
+#endif
+#ifndef INT_MAX
+# define INT_MAX (int)(((unsigned int) ~0) >> 1) /* 0x7FFFFFFF */
+#endif
+
#include <demangle.h>
#undef CURRENT_DEMANGLING_STYLE
#define CURRENT_DEMANGLING_STYLE work->options
@@ -1175,6 +1182,11 @@ internal_cplus_demangle (struct work_stuff *work, const char *mangled)
if ((AUTO_DEMANGLING || GNU_DEMANGLING))
{
success = gnu_special (work, &mangled, &decl);
+ if (!success)
+ {
+ delete_work_stuff (work);
+ string_delete (&decl);
+ }
}
if (!success)
{
@@ -1218,10 +1230,14 @@ squangle_mop_up (struct work_stuff *work)
if (work -> btypevec != NULL)
{
free ((char *) work -> btypevec);
+ work->btypevec = NULL;
+ work->bsize = 0;
}
if (work -> ktypevec != NULL)
{
free ((char *) work -> ktypevec);
+ work->ktypevec = NULL;
+ work->ksize = 0;
}
}
@@ -2979,6 +2995,11 @@ gnu_special (struct work_stuff *work, const char **mangled, string *declp)
success = 1;
break;
}
+ else if (n == -1)
+ {
+ success = 0;
+ break;
+ }
}
else
{
@@ -3656,7 +3677,10 @@ do_type (struct work_stuff *work, const char **mangled, string *result)
string_delete (&temp);
}
else
- break;
+ {
+ string_delete (&temp);
+ break;
+ }
}
else if (**mangled == 'Q')
{
@@ -4231,6 +4255,8 @@ remember_type (struct work_stuff *work, const char *start, int len)
}
else
{
+ if (work -> typevec_size > INT_MAX / 2)
+ xmalloc_failed (INT_MAX);
work -> typevec_size *= 2;
work -> typevec
= XRESIZEVEC (char *, work->typevec, work->typevec_size);
@@ -4258,6 +4284,8 @@ remember_Ktype (struct work_stuff *work, const char *start, int len)
}
else
{
+ if (work -> ksize > INT_MAX / 2)
+ xmalloc_failed (INT_MAX);
work -> ksize *= 2;
work -> ktypevec
= XRESIZEVEC (char *, work->ktypevec, work->ksize);
@@ -4287,6 +4315,8 @@ register_Btype (struct work_stuff *work)
}
else
{
+ if (work -> bsize > INT_MAX / 2)
+ xmalloc_failed (INT_MAX);
work -> bsize *= 2;
work -> btypevec
= XRESIZEVEC (char *, work->btypevec, work->bsize);
@@ -4741,6 +4771,8 @@ string_need (string *s, int n)
else if (s->e - s->p < n)
{
tem = s->p - s->b;
+ if (n > INT_MAX / 2 - tem)
+ xmalloc_failed (INT_MAX);
n += tem;
n *= 2;
s->b = XRESIZEVEC (char, s->b, n);
diff --git a/libiberty/testsuite/Makefile.in b/libiberty/testsuite/Makefile.in
index 69ac1f5105e..d23c09c8b2d 100644
--- a/libiberty/testsuite/Makefile.in
+++ b/libiberty/testsuite/Makefile.in
@@ -59,6 +59,10 @@ check-pexecute: test-pexecute
check-expandargv: test-expandargv
./test-expandargv
+# Run the demangler fuzzer
+fuzz-demangler: demangler-fuzzer
+ ./demangler-fuzzer
+
TEST_COMPILE = $(CC) @DEFS@ $(LIBCFLAGS) -I.. -I$(INCDIR) $(HDEFINES)
test-demangle: $(srcdir)/test-demangle.c ../libiberty.a
$(TEST_COMPILE) -o test-demangle \
@@ -72,6 +76,10 @@ test-expandargv: $(srcdir)/test-expandargv.c ../libiberty.a
$(TEST_COMPILE) -DHAVE_CONFIG_H -I.. -o test-expandargv \
$(srcdir)/test-expandargv.c ../libiberty.a
+demangler-fuzzer: $(srcdir)/demangler-fuzzer.c ../libiberty.a
+ $(TEST_COMPILE) -o demangler-fuzzer \
+ $(srcdir)/demangler-fuzzer.c ../libiberty.a
+
# Standard (either GNU or Cygnus) rules we don't use.
html install-html info install-info clean-info dvi pdf install-pdf \
install etags tags installcheck:
@@ -81,6 +89,7 @@ mostlyclean:
rm -f test-demangle
rm -f test-pexecute
rm -f test-expandargv
+ rm -f demangler-fuzzer
rm -f core
clean: mostlyclean
distclean: clean
diff --git a/libiberty/testsuite/demangle-expected b/libiberty/testsuite/demangle-expected
index 3ff08e6e5f2..706c0cd760b 100644
--- a/libiberty/testsuite/demangle-expected
+++ b/libiberty/testsuite/demangle-expected
@@ -4091,6 +4091,36 @@ void g<1>(A<1>&, B<static_cast<bool>(1)>&)
_ZNKSt7complexIiE4realB5cxx11Ev
std::complex<int>::real[abi:cxx11]() const
#
+# Some more crashes revealed by fuzz-testing:
+# Check for NULL pointer when demangling trinary operators
+--format=gnu-v3
+_Z1fAv32_f
+_Z1fAv32_f
+# Do not overflow when decoding identifier length
+--format=gnu-v3
+_Z11111111111
+_Z11111111111
+# Check out-of-bounds access when decoding braced initializer list
+--format=gnu-v3
+_ZDTtl
+_ZDTtl
+# Check for NULL pointer when demangling DEMANGLE_COMPONENT_LOCAL_NAME
+--format=gnu-v3
+_ZZN1fEEd_lEv
+_ZZN1fEEd_lEv
+# Handle DEMANGLE_COMPONENT_FIXED_TYPE in d_find_pack
+--format=gnu-v3
+_Z1fDpDFT_
+_Z1fDpDFT_
+# Likewise, DEMANGLE_COMPONENT_DEFAULT_ARG
+--format=gnu-v3
+_Z1fIDpZ1fEd_E
+_Z1fIDpZ1fEd_E
+# Likewise, DEMANGLE_COMPONENT_NUMBER
+--format=gnu-v3
+_Z1fDpDv1_c
+f((char __vector(1))...)
+#
# Ada (GNAT) tests.
#
# Simple test.
@@ -4294,6 +4324,7 @@ void n<void (A::*)() const &>(void (A::*)() const &)
--format=gnu-v3
_ZL1fIiEvv
void f<int>()
+# https://sourceware.org/bugzilla/show_bug.cgi?id=14963#c3
--format=gnu-v3
_ZSt7forwardIRN1x14refobjiteratorINS0_3refINS0_4mime30multipart_section_processorObjIZ15get_body_parserIZZN14mime_processor21make_section_iteratorERKNS2_INS3_10sectionObjENS0_10ptrrefBaseEEEbENKUlvE_clEvEUlSB_bE_ZZNS6_21make_section_iteratorESB_bENKSC_clEvEUlSB_E0_ENS1_INS2_INS0_20outputrefiteratorObjIiEES8_EEEERKSsSB_OT_OT0_EUlmE_NS3_32make_multipart_default_discarderISP_EEEES8_EEEEEOT_RNSt16remove_referenceISW_E4typeE
x::refobjiterator<x::ref<x::mime::multipart_section_processorObj<x::refobjiterator<x::ref<x::outputrefiteratorObj<int>, x::ptrrefBase> > get_body_parser<mime_processor::make_section_iterator(x::ref<x::mime::sectionObj, x::ptrrefBase> const&, bool)::{lambda()#1}::operator()() const::{lambda(x::ref<x::mime::sectionObj, x::ptrrefBase> const&, bool)#1}, mime_processor::make_section_iterator(x::ref<x::mime::sectionObj, x::ptrrefBase> const&, bool)::{lambda()#1}::operator()() const::{lambda(x::ref<x::mime::sectionObj, x::ptrrefBase> const&)#2}>(std::string const&, x::ref<x::mime::sectionObj, x::ptrrefBase> const&, mime_processor::make_section_iterator(x::ref<x::mime::sectionObj, x::ptrrefBase> const&, bool)::{lambda()#1}::operator()() const::{lambda(x::ref<x::mime::sectionObj, x::ptrrefBase> const&, bool)#1}&&, mime_processor::make_section_iterator(x::ref<x::mime::sectionObj, x::ptrrefBase> const&, bool)::{lambda()#1}::operator()() const::{lambda(x::ref<x::mime::sectionObj, x::ptrrefBase> const&)#2}&&)::{lambda(unsigned long)#1}, x::mime::make_multipart_default_discarder<mime_processor::make_section_iterator(x::ref<x::mime::sectionObj, x::ptrrefBase> const&, bool)::{lambda()#1}::operator()() const::{lambda(x::ref<x::mime::sectionObj, x::ptrrefBase> const&, bool)#1}&&> >, x::ptrrefBase> >& std::forward<x::refobjiterator<x::ref<x::mime::multipart_section_processorObj<x::refobjiterator<x::ref<x::outputrefiteratorObj<int>, x::ptrrefBase> > get_body_parser<mime_processor::make_section_iterator(x::ref<x::mime::sectionObj, x::ptrrefBase> const&, bool)::{lambda()#1}::operator()() const::{lambda(x::ref<x::mime::sectionObj, x::ptrrefBase> const&, bool)#1}, mime_processor::make_section_iterator(x::ref<x::mime::sectionObj, x::ptrrefBase> const&, bool)::{lambda()#1}::operator()() const::{lambda(x::ref<x::mime::sectionObj, x::ptrrefBase> const&)#2}>(std::string const&, x::ref<x::mime::sectionObj, x::ptrrefBase> const&, mime_processor::make_section_iterator(x::ref<x::mime::sectionObj, x::ptrrefBase> const&, bool)::{lambda()#1}::operator()() const::{lambda(x::ref<x::mime::sectionObj, x::ptrrefBase> const&, bool)#1}&&, mime_processor::make_section_iterator(x::ref<x::mime::sectionObj, x::ptrrefBase> const&, bool)::{lambda()#1}::operator()() const::{lambda(x::ref<x::mime::sectionObj, x::ptrrefBase> const&)#2}&&)::{lambda(unsigned long)#1}, x::mime::make_multipart_default_discarder<mime_processor::make_section_iterator(x::ref<x::mime::sectionObj, x::ptrrefBase> const&, bool)::{lambda()#1}::operator()() const::{lambda(x::ref<x::mime::sectionObj, x::ptrrefBase> const&, bool)#1}&&> >, x::ptrrefBase> >&>(std::remove_reference<x::mime::multipart_section_processorObj<x::refobjiterator<x::ref<x::outputrefiteratorObj<int>, x::ptrrefBase> > get_body_parser<mime_processor::make_section_iterator(x::ref<x::mime::sectionObj, x::ptrrefBase> const&, bool)::{lambda()#1}::operator()() const::{lambda(x::ref<x::mime::sectionObj, x::ptrrefBase> const&, bool)#1}, mime_processor::make_section_iterator(x::ref<x::mime::sectionObj, x::ptrrefBase> const&, bool)::{lambda()#1}::operator()() const::{lambda(x::ref<x::mime::sectionObj, x::ptrrefBase> const&)#2}>(std::string const&, x::ref<x::mime::sectionObj, x::ptrrefBase> const&, mime_processor::make_section_iterator(x::ref<x::mime::sectionObj, x::ptrrefBase> const&, bool)::{lambda()#1}::operator()() const::{lambda(x::ref<x::mime::sectionObj, x::ptrrefBase> const&, bool)#1}&&, mime_processor::make_section_iterator(x::ref<x::mime::sectionObj, x::ptrrefBase> const&, bool)::{lambda()#1}::operator()() const::{lambda(x::ref<x::mime::sectionObj, x::ptrrefBase> const&)#2}&&)::{lambda(unsigned long)#1}, x::mime::make_multipart_default_discarder<mime_processor::make_section_iterator(x::ref<x::mime::sectionObj, x::ptrrefBase> const&, bool)::{lambda()#1}::operator()() const::{lambda(x::ref<x::mime::sectionObj, x::ptrrefBase> const&, bool)#1}&&> > >::type&)
@@ -4317,3 +4348,81 @@ A::operator C*<C>
_ZN1AcvT_IiEI1CEEv
A::operator C<int><C>()
A::operator C<int><C>
+# https://sourceware.org/bugzilla/show_bug.cgi?id=14963#c16
+--format=gnu-v3
+_ZN3mdr16in_cached_threadIRZNK4cudr6GPUSet17parallel_for_eachIZN5tns3d20shape_representation7compute7GPUImpl7executeERKNS_1AINS_7ptr_refIKjEELl3ELl3ENS_8c_strideILl1ELl0EEEEERKNS8_INS9_IjEELl4ELl1ESD_EEEUliRKNS1_7ContextERNS7_5StateEE_JSt6vectorISO_SaISO_EEEEEvOT_DpRT0_EUlSP_E_JSt17reference_wrapperISO_EEEENS_12ScopedFutureIDTclfp_spcl7forwardISW_Efp0_EEEEESV_DpOSW_
+mdr::ScopedFuture<decltype ({parm#1}(((forward<void cudr::GPUSet::parallel_for_each<tns3d::shape_representation::compute::GPUImpl::execute(mdr::A<mdr::ptr_ref<unsigned int const>, 3l, 3l, mdr::c_stride<1l, 0l> > const&, mdr::A<mdr::ptr_ref<unsigned int>, 4l, 1l, mdr::c_stride<1l, 0l> > const&)::{lambda(int, cudr::Context const&, tns3d::shape_representation::compute::GPUImpl::State&)#1}, std::vector<tns3d::shape_representation::compute::GPUImpl::State, std::allocator<tns3d::shape_representation::compute::GPUImpl::State> > >(tns3d::shape_representation::compute::GPUImpl::execute(mdr::A<mdr::ptr_ref<unsigned int const>, 3l, 3l, mdr::c_stride<1l, 0l> > const&, mdr::A<mdr::ptr_ref<unsigned int>, 4l, 1l, mdr::c_stride<1l, 0l> > const&)::{lambda(int, cudr::Context const&, tns3d::shape_representation::compute::GPUImpl::State&)#1}&&, std::vector<tns3d::shape_representation::compute::GPUImpl::State, std::allocator<tns3d::shape_representation::compute::GPUImpl::State> >&) const::{lambda(tns3d::shape_representation::compute::GPUImpl::State&)#1}&>)({parm#2}))...))> mdr::in_cached_thread<void cudr::GPUSet::parallel_for_each<tns3d::shape_representation::compute::GPUImpl::execute(mdr::A<mdr::ptr_ref<unsigned int const>, 3l, 3l, mdr::c_stride<1l, 0l> > const&, mdr::A<mdr::ptr_ref<unsigned int>, 4l, 1l, mdr::c_stride<1l, 0l> > const&)::{lambda(int, cudr::Context const&, tns3d::shape_representation::compute::GPUImpl::State&)#1}, std::vector<tns3d::shape_representation::compute::GPUImpl::State, std::allocator<tns3d::shape_representation::compute::GPUImpl::State> > >(void cudr::GPUSet::parallel_for_each<tns3d::shape_representation::compute::GPUImpl::execute(mdr::A<mdr::ptr_ref<unsigned int const>, 3l, 3l, mdr::c_stride<1l, 0l> > const&, mdr::A<mdr::ptr_ref<unsigned int>, 4l, 1l, mdr::c_stride<1l, 0l> > const&)::{lambda(int, cudr::Context const&, tns3d::shape_representation::compute::GPUImpl::State&)#1}, std::vector<tns3d::shape_representation::compute::GPUImpl::State, std::allocator<tns3d::shape_representation::compute::GPUImpl::State> > >(tns3d::shape_representation::compute::GPUImpl::execute(mdr::A<mdr::ptr_ref<unsigned int const>, 3l, 3l, mdr::c_stride<1l, 0l> > const&, mdr::A<mdr::ptr_ref<unsigned int>, 4l, 1l, mdr::c_stride<1l, 0l> > const&)::{lambda(int, cudr::Context const&, tns3d::shape_representation::compute::GPUImpl::State&)#1}&&, std::vector<tns3d::shape_representation::compute::GPUImpl::State, std::allocator<tns3d::shape_representation::compute::GPUImpl::State> >&) const::{lambda(tns3d::shape_representation::compute::GPUImpl::State&)#1}&, std::vector<tns3d::shape_representation::compute::GPUImpl::State, std::allocator<tns3d::shape_representation::compute::GPUImpl::State> >&) const::{lambda(tns3d::shape_representation::compute::GPUImpl::State&)#1}&, std::reference_wrapper<tns3d::shape_representation::compute::GPUImpl::State> >(void cudr::GPUSet::parallel_for_each<tns3d::shape_representation::compute::GPUImpl::execute(mdr::A<mdr::ptr_ref<unsigned int const>, 3l, 3l, mdr::c_stride<1l, 0l> > const&, mdr::A<mdr::ptr_ref<unsigned int>, 4l, 1l, mdr::c_stride<1l, 0l> > const&)::{lambda(int, cudr::Context const&, tns3d::shape_representation::compute::GPUImpl::State&)#1}, std::vector<tns3d::shape_representation::compute::GPUImpl::State, std::allocator<tns3d::shape_representation::compute::GPUImpl::State> > >(tns3d::shape_representation::compute::GPUImpl::execute(mdr::A<mdr::ptr_ref<unsigned int const>, 3l, 3l, mdr::c_stride<1l, 0l> > const&, mdr::A<mdr::ptr_ref<unsigned int>, 4l, 1l, mdr::c_stride<1l, 0l> > const&)::{lambda(int, cudr::Context const&, tns3d::shape_representation::compute::GPUImpl::State&)#1}&&, std::vector<tns3d::shape_representation::compute::GPUImpl::State, std::allocator<tns3d::shape_representation::compute::GPUImpl::State> >&) const::{lambda(tns3d::shape_representation::compute::GPUImpl::State&)#1}&, (void cudr::GPUSet::parallel_for_each<tns3d::shape_representation::compute::GPUImpl::execute(mdr::A<mdr::ptr_ref<unsigned int const>, 3l, 3l, mdr::c_stride<1l, 0l> > const&, mdr::A<mdr::ptr_ref<unsigned int>, 4l, 1l, mdr::c_stride<1l, 0l> > const&)::{lambda(int, cudr::Context const&, tns3d::shape_representation::compute::GPUImpl::State&)#1}, std::vector<tns3d::shape_representation::compute::GPUImpl::State, std::allocator<tns3d::shape_representation::compute::GPUImpl::State> > >(tns3d::shape_representation::compute::GPUImpl::execute(mdr::A<mdr::ptr_ref<unsigned int const>, 3l, 3l, mdr::c_stride<1l, 0l> > const&, mdr::A<mdr::ptr_ref<unsigned int>, 4l, 1l, mdr::c_stride<1l, 0l> > const&)::{lambda(int, cudr::Context const&, tns3d::shape_representation::compute::GPUImpl::State&)#1}&&, std::vector<tns3d::shape_representation::compute::GPUImpl::State, std::allocator<tns3d::shape_representation::compute::GPUImpl::State> >&) const::{lambda(tns3d::shape_representation::compute::GPUImpl::State&)#1}&&&)...)
+# https://sourceware.org/bugzilla/show_bug.cgi?id=14963#c18
+--format=gnu-v3
+_ZNSt9_Any_data9_M_accessIPZN13ThreadManager10futureTaskISt5_BindIFSt7_Mem_fnIM6RunnerFvvEEPS5_EEEEvOT_EUlvE_EERSC_v
+void ThreadManager::futureTask<std::_Bind<std::_Mem_fn<void (Runner::*)()> (Runner*)> >(std::_Bind<std::_Mem_fn<void (Runner::*)()> (Runner*)>&&)::{lambda()#1}*& std::_Any_data::_M_access<void ThreadManager::futureTask<std::_Bind<std::_Mem_fn<void (Runner::*)()> (Runner*)> >(void ThreadManager::futureTask<std::_Bind<std::_Mem_fn<void (Runner::*)()> (Runner*)> >(std::_Bind<std::_Mem_fn<void (Runner::*)()> (Runner*)>&&)::{lambda()#1}*&&)::{lambda()#1}*>()
+# https://sourceware.org/bugzilla/show_bug.cgi?id=14963#c24
+# aka https://sourceware.org/bugzilla/show_bug.cgi?id=16593
+--format=gnu-v3
+_ZNSt9_Any_data9_M_accessIPZN3sel8Selector6SetObjI3FooJPKcMS4_FviEEEEvRT_DpT0_EUlvE_EESA_v
+void sel::Selector::SetObj<Foo, char const*, void (Foo::*)(int)>(Foo&, char const*, void (Foo::*)(int))::{lambda()#1}*& std::_Any_data::_M_access<void sel::Selector::SetObj<Foo, char const*, void (Foo::*)(int)>(void sel::Selector::SetObj<Foo, char const*, void (Foo::*)(int)>(Foo&, char const*, void (Foo::*)(int))::{lambda()#1}*&, char const*, void (Foo::*)(int))::{lambda()#1}*>()
+# https://sourceware.org/bugzilla/show_bug.cgi?id=16752#c1
+--format=gnu-v3
+_ZNSt9_Any_data9_M_accessIPZN13ThreadManager7newTaskIRSt5_BindIFSt7_Mem_fnIM5DiaryFivEEPS5_EEIEEESt6futureINSt9result_ofIFT_DpT0_EE4typeEEOSF_DpOSG_EUlvE_EERSF_v
+std::future<std::result_of<std::_Bind<std::_Mem_fn<int (Diary::*)()> (Diary*)>& ()>::type> ThreadManager::newTask<std::_Bind<std::_Mem_fn<int (Diary::*)()> (Diary*)>&>(std::_Bind<std::_Mem_fn<int (Diary::*)()> (Diary*)>&)::{lambda()#1}*& std::_Any_data::_M_access<std::future<std::result_of<std::_Bind<std::_Mem_fn<int (Diary::*)()> (Diary*)>& ()>::type> ThreadManager::newTask<std::_Bind<std::_Mem_fn<int (Diary::*)()> (Diary*)>&>(std::future<std::result_of<std::_Bind<std::_Mem_fn<int (Diary::*)()> (Diary*)>& ()>::type> ThreadManager::newTask<std::_Bind<std::_Mem_fn<int (Diary::*)()> (Diary*)>&>(std::_Bind<std::_Mem_fn<int (Diary::*)()> (Diary*)>&)::{lambda()#1}*&&)::{lambda()#1}*>()
+# https://sourceware.org/bugzilla/show_bug.cgi?id=16752#c6
+--format=gnu-v3
+_ZNSt9_Any_data9_M_accessIPZN6cereal18polymorphic_detail15getInputBindingINS1_16JSONInputArchiveEEENS1_6detail15InputBindingMapIT_E11SerializersERS7_jEUlPvRSt10unique_ptrIvNS5_12EmptyDeleterIvEEEE0_EESA_v
+cereal::detail::InputBindingMap<cereal::JSONInputArchive>::Serializers cereal::polymorphic_detail::getInputBinding<cereal::JSONInputArchive>(cereal::JSONInputArchive&, unsigned int)::{lambda(void*, std::unique_ptr<void, cereal::detail::EmptyDeleter<void> >&)#2}*& std::_Any_data::_M_access<cereal::detail::InputBindingMap<cereal::JSONInputArchive>::Serializers cereal::polymorphic_detail::getInputBinding<cereal::JSONInputArchive>(cereal::detail::InputBindingMap<cereal::JSONInputArchive>::Serializers cereal::polymorphic_detail::getInputBinding<cereal::JSONInputArchive>(cereal::JSONInputArchive&, unsigned int)::{lambda(void*, std::unique_ptr<void, cereal::detail::EmptyDeleter<void> >&)#2}*&, unsigned int)::{lambda(void*, std::unique_ptr<void, cereal::detail::EmptyDeleter<void> >&)#2}*>()
+# https://sourceware.org/bugzilla/show_bug.cgi?id=16845#c2
+--format=gnu-v3
+_ZNSt9_Any_data9_M_accessIPZ4postISt8functionIFvvEEEvOT_EUlvE_EERS5_v
+void post<std::function<void ()> >(std::function<void ()>&&)::{lambda()#1}*& std::_Any_data::_M_access<void post<std::function<void ()> >(void post<std::function<void ()> >(std::function<void ()>&&)::{lambda()#1}*&&)::{lambda()#1}*>()
+#
+--format=auto --no-params
+_Z3xxxDFyuVb
+xxx(unsigned long long _Fract, bool volatile)
+xxx
+# https://sourceware.org/bugzilla/show_bug.cgi?id=16817
+--format=auto --no-params
+_QueueNotification_QueueController__$4PPPPPPPM_A_INotice___Z
+_QueueNotification_QueueController__$4PPPPPPPM_A_INotice___Z
+_QueueNotification_QueueController__$4PPPPPPPM_A_INotice___Z
+#
+# These two are from gcc PR61321, and gcc PR61233 / gdb PR16957
+#
+--format=gnu-v3
+_Z13function_tempIiEv1AIXszcvT_Li999EEE
+void function_temp<int>(A<sizeof ((int)(999))>)
+#
+--format=gnu-v3
+_Z7ZipWithI7QStringS0_5QListZN4oral6detail16AdaptCreateTableI7AccountEES0_RKNS3_16CachedFieldsDataEEUlRKS0_SA_E_ET1_IDTclfp1_cvT__EcvT0__EEEERKT1_ISC_ERKT1_ISD_ET2_
+QList<decltype ({parm#3}((QString)(), (QString)()))> ZipWith<QString, QString, QList, QString oral::detail::AdaptCreateTable<Account>(oral::detail::CachedFieldsData const&)::{lambda(QString const&, QString const&)#1}>(QList<QString oral::detail::AdaptCreateTable<Account>(oral::detail::CachedFieldsData const&)::{lambda(QString const&, QString const&)#1}> const&, QList<QList> const&, QString oral::detail::AdaptCreateTable<Account>(oral::detail::CachedFieldsData const&)::{lambda(QString const&, QString const&)#1})
+#
+# These three are symbols generated by g++'s testsuite, which triggered the same bug as above.
+--format=gnu-v3
+_Z14int_if_addableI1YERiP1AIXszpldecvPT_Li0EdecvS4_Li0EEE
+int& int_if_addable<Y>(A<sizeof ((*((Y*)(0)))+(*((Y*)(0))))>*)
+#
+--format=gnu-v3
+_Z3bazIiEvP1AIXszcl3foocvT__ELCf00000000_00000000EEEE
+void baz<int>(A<sizeof (foo((int)(), (floatcomplex )00000000_00000000))>*)
+#
+--format=gnu-v3
+_Z3fooI1FEN1XIXszdtcl1PclcvT__EEE5arrayEE4TypeEv
+X<sizeof ((P(((F)())())).array)>::Type foo<F>()
+#
+# Tests a use-after-free problem PR70481
+
+_Q.__0
+::Q.(void)
+#
+# Tests a use-after-free problem PR70481
+
+_Q10-__9cafebabe.
+cafebabe.::-(void)
+#
+# Tests integer overflow problem PR70492
+
+__vt_90000000000cafebabe
+__vt_90000000000cafebabe
+#
+# Tests write access violation PR70498
+
+_Z80800000000000000000000
+_Z80800000000000000000000
diff --git a/libiberty/testsuite/demangler-fuzzer.c b/libiberty/testsuite/demangler-fuzzer.c
new file mode 100644
index 00000000000..aff70247301
--- /dev/null
+++ b/libiberty/testsuite/demangler-fuzzer.c
@@ -0,0 +1,108 @@
+/* Demangler fuzzer.
+
+ Copyright (C) 2014 Free Software Foundation, Inc.
+
+ This file is part of GNU libiberty.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <time.h>
+#include "demangle.h"
+
+#define MAXLEN 253
+#define ALPMIN 33
+#define ALPMAX 127
+
+static char *program_name;
+
+#define DEFAULT_MAXCOUNT 7500000
+
+static void
+print_usage (FILE *fp, int exit_value)
+{
+ fprintf (fp, "Usage: %s [OPTION]...\n", program_name);
+ fprintf (fp, "Options:\n");
+ fprintf (fp, " -h Display this message.\n");
+ fprintf (fp, " -s SEED Select the random seed to be used.\n");
+ fprintf (fp, " The default is to base one on the");
+ fprintf (fp, " current time.\n");
+ fprintf (fp, " -m MAXCOUNT Exit after MAXCOUNT symbols.\n");
+ fprintf (fp, " The default is %d.", DEFAULT_MAXCOUNT);
+ fprintf (fp, " Set to `-1' for no limit.\n");
+
+ exit (exit_value);
+}
+
+int
+main (int argc, char *argv[])
+{
+ char symbol[2 + MAXLEN + 1] = "_Z";
+ int seed = -1, seed_set = 0;
+ int count = 0, maxcount = DEFAULT_MAXCOUNT;
+ int optchr;
+
+ program_name = argv[0];
+
+ do
+ {
+ optchr = getopt (argc, argv, "hs:m:t:");
+ switch (optchr)
+ {
+ case '?': /* Unrecognized option. */
+ print_usage (stderr, 1);
+ break;
+
+ case 'h':
+ print_usage (stdout, 0);
+ break;
+
+ case 's':
+ seed = atoi (optarg);
+ seed_set = 1;
+ break;
+
+ case 'm':
+ maxcount = atoi (optarg);
+ break;
+ }
+ }
+ while (optchr != -1);
+
+ if (!seed_set)
+ seed = time (NULL);
+ srand (seed);
+ printf ("%s: seed = %d\n", program_name, seed);
+
+ while (maxcount < 0 || count < maxcount)
+ {
+ char *buffer = symbol + 2;
+ int length, i;
+
+ length = rand () % MAXLEN;
+ for (i = 0; i < length; i++)
+ *buffer++ = (rand () % (ALPMAX - ALPMIN)) + ALPMIN;
+
+ *buffer++ = '\0';
+
+ cplus_demangle (symbol, DMGL_AUTO | DMGL_ANSI | DMGL_PARAMS);
+
+ count++;
+ }
+
+ printf ("%s: successfully demangled %d symbols\n", program_name, count);
+ exit (0);
+}
diff --git a/libitm/ChangeLog b/libitm/ChangeLog
index 8e15808f6d5..459f4d29631 100644
--- a/libitm/ChangeLog
+++ b/libitm/ChangeLog
@@ -1,3 +1,7 @@
+2016-08-03 Release Manager
+
+ * GCC 4.9.4 released.
+
2015-07-03 Carlos Sánchez de La Lama <csanchezdll@gmail.com>
PR target/52482
diff --git a/libjava/ChangeLog b/libjava/ChangeLog
index d384accdb89..ed8a4048cd0 100644
--- a/libjava/ChangeLog
+++ b/libjava/ChangeLog
@@ -1,3 +1,15 @@
+2016-08-03 Release Manager
+
+ * GCC 4.9.4 released.
+
+2016-04-23 Dominique d'Humieres <dominiq@lps.ens.fr>
+
+ backport from trunk:
+ 2016-04-20 Ben Elliston <bje@gnu.org>
+
+ * testsuite/lib/libjava.exp (libjava_arguments): Use 'file
+ normalize' rather than the defunct DejaGnu 'absolute' proc.
+
2015-06-26 Release Manager
* GCC 4.9.3 released.
diff --git a/libjava/classpath/ChangeLog b/libjava/classpath/ChangeLog
index 13c31aa6003..ecf0df58995 100644
--- a/libjava/classpath/ChangeLog
+++ b/libjava/classpath/ChangeLog
@@ -1,3 +1,7 @@
+2016-08-03 Release Manager
+
+ * GCC 4.9.4 released.
+
2015-06-26 Release Manager
* GCC 4.9.3 released.
diff --git a/libjava/libltdl/ChangeLog b/libjava/libltdl/ChangeLog
index 79a238d891d..9c0a7827e77 100644
--- a/libjava/libltdl/ChangeLog
+++ b/libjava/libltdl/ChangeLog
@@ -1,3 +1,7 @@
+2016-08-03 Release Manager
+
+ * GCC 4.9.4 released.
+
2015-06-26 Release Manager
* GCC 4.9.3 released.
diff --git a/libjava/testsuite/lib/libjava.exp b/libjava/testsuite/lib/libjava.exp
index 0de823b737c..932765b6022 100644
--- a/libjava/testsuite/lib/libjava.exp
+++ b/libjava/testsuite/lib/libjava.exp
@@ -414,7 +414,7 @@ proc libjava_arguments {{mode compile}} {
# Search for libtool. We need it to link.
set found_compiler 0
- set d [absolute $objdir]
+ set d [file normalize $objdir]
foreach x {. .. ../.. ../../..} {
if {[file exists $d/$x/libtool]} then {
# We have to run silently to avoid DejaGNU lossage.
diff --git a/libobjc/ChangeLog b/libobjc/ChangeLog
index caa71601c21..bb7e1e16a38 100644
--- a/libobjc/ChangeLog
+++ b/libobjc/ChangeLog
@@ -1,3 +1,7 @@
+2016-08-03 Release Manager
+
+ * GCC 4.9.4 released.
+
2015-06-26 Release Manager
* GCC 4.9.3 released.
diff --git a/libquadmath/ChangeLog b/libquadmath/ChangeLog
index 01000d6442d..90c5da74011 100644
--- a/libquadmath/ChangeLog
+++ b/libquadmath/ChangeLog
@@ -1,3 +1,7 @@
+2016-08-03 Release Manager
+
+ * GCC 4.9.4 released.
+
2015-06-26 Release Manager
* GCC 4.9.3 released.
diff --git a/libsanitizer/ChangeLog b/libsanitizer/ChangeLog
index 2352e94211c..a9c18205d7d 100644
--- a/libsanitizer/ChangeLog
+++ b/libsanitizer/ChangeLog
@@ -1,3 +1,24 @@
+2016-08-03 Release Manager
+
+ * GCC 4.9.4 released.
+
+2016-07-07 Jakub Jelinek <jakub@redhat.com>
+
+ Backported from mainline
+ 2016-05-17 Jakub Jelinek <jakub@redhat.com>
+
+ PR sanitizer/71160
+ * asan/asan_malloc_linux.cc: Cherry pick upstream r254395
+ and r269633.
+
+2016-04-05 Maxim Ostapenko <m.ostapenko@samsung.com>
+
+ PR sanitizer/70474
+ * asan/asan_mac.cc (GetMacosVersionInternal): Cherry pick
+ upstream r241487, 221379 and r224315.
+ (void MaybeReexec): Cherry pick upstream r241487.
+ * asan/asan_mac.h (enum MacosVersion): Cherry pick upstream r224315.
+
2015-06-26 Release Manager
* GCC 4.9.3 released.
diff --git a/libsanitizer/asan/asan_mac.cc b/libsanitizer/asan/asan_mac.cc
index 8d01843afaf..36e287cdcaa 100644
--- a/libsanitizer/asan/asan_mac.cc
+++ b/libsanitizer/asan/asan_mac.cc
@@ -70,7 +70,12 @@ MacosVersion GetMacosVersionInternal() {
case '1': return MACOS_VERSION_LION;
case '2': return MACOS_VERSION_MOUNTAIN_LION;
case '3': return MACOS_VERSION_MAVERICKS;
- default: return MACOS_VERSION_UNKNOWN;
+ case '4': return MACOS_VERSION_YOSEMITE;
+ default:
+ if (IsDigit(version[1]))
+ return MACOS_VERSION_UNKNOWN_NEWER;
+ else
+ return MACOS_VERSION_UNKNOWN;
}
}
default: return MACOS_VERSION_UNKNOWN;
@@ -136,6 +141,23 @@ void LeakyResetEnv(const char *name, const char *name_value) {
}
}
+bool DyldNeedsEnvVariable() {
+// If running on OS X 10.11+ or iOS 9.0+, dyld will interpose even if
+// DYLD_INSERT_LIBRARIES is not set.
+
+#if SANITIZER_IOSSIM
+ // GetMacosVersion will not work for the simulator, whose kernel version
+ // is tied to the host. Use a weak linking hack for the simulator.
+ // This API was introduced in the same version of the OS as the dyld
+ // optimization.
+
+ // Check for presence of a symbol that is available on OS X 10.11+, iOS 9.0+.
+ return (dlsym(RTLD_NEXT, "mach_memory_info") == nullptr);
+#else
+ return (GetMacosVersion() <= MACOS_VERSION_YOSEMITE);
+#endif
+}
+
void MaybeReexec() {
if (!flags()->allow_reexec) return;
// Make sure the dynamic ASan runtime library is preloaded so that the
@@ -148,8 +170,9 @@ void MaybeReexec() {
uptr old_env_len = dyld_insert_libraries ?
internal_strlen(dyld_insert_libraries) : 0;
uptr fname_len = internal_strlen(info.dli_fname);
- if (!dyld_insert_libraries ||
- !REAL(strstr)(dyld_insert_libraries, info.dli_fname)) {
+ bool lib_is_in_env =
+ dyld_insert_libraries && REAL(strstr)(dyld_insert_libraries, info.dli_fname);
+ if (DyldNeedsEnvVariable() && !lib_is_in_env) {
// DYLD_INSERT_LIBRARIES is not set or does not contain the runtime
// library.
char program_name[1024];
@@ -180,6 +203,10 @@ void MaybeReexec() {
}
execv(program_name, *_NSGetArgv());
} else {
+
+ if (!lib_is_in_env)
+ return;
+
// DYLD_INSERT_LIBRARIES is set and contains the runtime library.
if (old_env_len == fname_len) {
// It's just the runtime library name - fine to unset the variable.
diff --git a/libsanitizer/asan/asan_mac.h b/libsanitizer/asan/asan_mac.h
index 2d1d4b0bfb3..efa6eb51fe5 100644
--- a/libsanitizer/asan/asan_mac.h
+++ b/libsanitizer/asan/asan_mac.h
@@ -41,7 +41,9 @@ enum MacosVersion {
MACOS_VERSION_SNOW_LEOPARD,
MACOS_VERSION_LION,
MACOS_VERSION_MOUNTAIN_LION,
- MACOS_VERSION_MAVERICKS
+ MACOS_VERSION_MAVERICKS,
+ MACOS_VERSION_YOSEMITE,
+ MACOS_VERSION_UNKNOWN_NEWER
};
// Used by asan_malloc_mac.cc and asan_mac.cc
diff --git a/libsanitizer/asan/asan_malloc_linux.cc b/libsanitizer/asan/asan_malloc_linux.cc
index e3495cb0900..d74789b1510 100644
--- a/libsanitizer/asan/asan_malloc_linux.cc
+++ b/libsanitizer/asan/asan_malloc_linux.cc
@@ -58,39 +58,62 @@ void ReplaceSystemMalloc() {
// ---------------------- Replacement functions ---------------- {{{1
using namespace __asan; // NOLINT
+static uptr allocated_for_dlsym;
+static const uptr kDlsymAllocPoolSize = 1024;
+static uptr alloc_memory_for_dlsym[kDlsymAllocPoolSize];
+
+static bool IsInDlsymAllocPool(const void *ptr) {
+ uptr off = (uptr)ptr - (uptr)alloc_memory_for_dlsym;
+ return off < sizeof(alloc_memory_for_dlsym);
+}
+
+static void *AllocateFromLocalPool(uptr size_in_bytes) {
+ uptr size_in_words = RoundUpTo(size_in_bytes, kWordSize) / kWordSize;
+ void *mem = (void*)&alloc_memory_for_dlsym[allocated_for_dlsym];
+ allocated_for_dlsym += size_in_words;
+ CHECK_LT(allocated_for_dlsym, kDlsymAllocPoolSize);
+ return mem;
+}
+
INTERCEPTOR(void, free, void *ptr) {
GET_STACK_TRACE_FREE;
+ if (UNLIKELY(IsInDlsymAllocPool(ptr)))
+ return;
asan_free(ptr, &stack, FROM_MALLOC);
}
INTERCEPTOR(void, cfree, void *ptr) {
GET_STACK_TRACE_FREE;
+ if (UNLIKELY(IsInDlsymAllocPool(ptr)))
+ return;
asan_free(ptr, &stack, FROM_MALLOC);
}
INTERCEPTOR(void*, malloc, uptr size) {
+ if (UNLIKELY(!asan_inited))
+ // Hack: dlsym calls malloc before REAL(malloc) is retrieved from dlsym.
+ return AllocateFromLocalPool(size);
GET_STACK_TRACE_MALLOC;
return asan_malloc(size, &stack);
}
INTERCEPTOR(void*, calloc, uptr nmemb, uptr size) {
- if (!asan_inited) {
+ if (UNLIKELY(!asan_inited))
// Hack: dlsym calls calloc before REAL(calloc) is retrieved from dlsym.
- const uptr kCallocPoolSize = 1024;
- static uptr calloc_memory_for_dlsym[kCallocPoolSize];
- static uptr allocated;
- uptr size_in_words = ((nmemb * size) + kWordSize - 1) / kWordSize;
- void *mem = (void*)&calloc_memory_for_dlsym[allocated];
- allocated += size_in_words;
- CHECK(allocated < kCallocPoolSize);
- return mem;
- }
+ return AllocateFromLocalPool(nmemb * size);
GET_STACK_TRACE_MALLOC;
return asan_calloc(nmemb, size, &stack);
}
INTERCEPTOR(void*, realloc, void *ptr, uptr size) {
GET_STACK_TRACE_MALLOC;
+ if (UNLIKELY(IsInDlsymAllocPool(ptr))) {
+ uptr offset = (uptr)ptr - (uptr)alloc_memory_for_dlsym;
+ uptr copy_size = Min(size, kDlsymAllocPoolSize - offset);
+ void *new_ptr = asan_malloc(size, &stack);
+ internal_memcpy(new_ptr, ptr, copy_size);
+ return new_ptr;
+ }
return asan_realloc(ptr, size, &stack);
}
diff --git a/libssp/ChangeLog b/libssp/ChangeLog
index 290978cf67d..5c08811607b 100644
--- a/libssp/ChangeLog
+++ b/libssp/ChangeLog
@@ -1,3 +1,7 @@
+2016-08-03 Release Manager
+
+ * GCC 4.9.4 released.
+
2015-06-26 Release Manager
* GCC 4.9.3 released.
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index 70774cce9ab..ba361b1a5a7 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,3 +1,192 @@
+2016-08-03 Release Manager
+
+ * GCC 4.9.4 released.
+
+2016-04-20 Jonathan Wakely <jwakely@redhat.com>
+
+ Backport from mainline
+ 2016-01-26 Jonathan Wakely <jwakely@redhat.com>
+
+ PR libstdc++/69478
+ * include/bits/stl_algobase.h (__copy_move<_IsMove, true,
+ random_access_iterator_tag>): Check is_move_assignable when moving.
+ (__copy_move_backwards<_IsMove, true, random_access_iterator_tag>):
+ Likewise.
+ * testsuite/25_algorithms/copy/move_iterators/69478.cc: New.
+ * testsuite/25_algorithms/copy_backward/move_iterators/69478.cc: New.
+ * testsuite/25_algorithms/move/69478.cc: New.
+ * testsuite/25_algorithms/move_backward/69478.cc: New.
+
+ Backport from mainline
+ 2016-04-05 Jonathan Wakely <jwakely@redhat.com>
+
+ PR libstdc++/70503
+ * src/c++11/thread.cc (execute_native_thread_routine,
+ execute_native_thread_routine_compat): Give internal linkage.
+ * testsuite/30_threads/thread/70503.cc: New test.
+
+2016-03-18 Jonathan Wakely <jwakely@redhat.com>
+
+ Backport from mainline
+ 2016-01-11 Jonathan Wakely <jwakely@redhat.com>
+
+ PR libstdc++/60976
+ * include/bits/alloc_traits.h (allocator_traits<allocator<_Tp>>):
+ Define partial specialization.
+ * testsuite/20_util/shared_ptr/cons/58659.cc: Add construct and
+ destroy members to std::allocator explicit specialization.
+
+2016-02-23 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ Backport from mainline
+ 2015-11-24 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+ * acinclude.m4 (GLIBCXX_CHECK_MATH11_PROTO): New test.
+ * configure.ac: Use it.
+ * configure: Regenerate.
+ * config.h.in: Regenerate.
+
+ * include/c_global/cmath [__cplusplus >= 201103L]
+ (std::fpclassify): Wrap in !__CORRECT_ISO_CPP11_MATH_H_PROTO.
+ (std::isfinite): Likewise.
+ (std::isinf): Likewise.
+ (std::isnan): Likewise.
+ (std::isnormal): Likewise.
+ (std::signbit): Likewise.
+ (std::isgreater): Likewise.
+ (std::isgreaterequal): Likewise.
+ (std::isless): Likewise.
+ (std::islessequal): Likewise.
+ (std::islessgreater): Likewise.
+ (std::isunordered): Likewise.
+ (std::acosh): Likewise.
+ (std::asinh): Likewise.
+ (std::atanh): Likewise.
+ (std::cbrt): Likewise.
+ (std::copysign): Likewise.
+ (std::erf): Likewise.
+ (std::erfc): Likewise.
+ (std::exp2): Likewise.
+ (std::expm1): Likewise.
+ (std::fdim): Likewise.
+ (std::fma): Likewise.
+ (std::fmax): Likewise.
+ (std::fmin): Likewise.
+ (std::hypot): Likewise.
+ (std::ilogb): Likewise.
+ (std::lgamma): Likewise.
+ (std::llrint): Likewise.
+ (std::llround): Likewise.
+ (std::log1p): Likewise.
+ (std::log2): Likewise.
+ (std::logb): Likewise.
+ (std::lrint): Likewise.
+ (std::lround): Likewise.
+ (std::nearbyint): Likewise.
+ (std::nextafter): Likewise.
+ (std::nexttoward): Likewise.
+ (std::remainder): Likewise.
+ (std::remquo): Likewise.
+ (std::rint): Likewise.
+ (std::round): Likewise.
+ (std::scalbln): Likewise.
+ (std::scalbn): Likewise.
+ (std::tgamma): Likewise.
+ (std::trunc): Likewise.
+ * include/tr1/cmath [_GLIBCXX_USE_C99_MATH_TR1] (std::tr1::acosh):
+ Wrap in !__CORRECT_ISO_CPP11_MATH_H_PROTO.
+ (std::tr1::asinh): Likewise.
+ (std::tr1::atanh): Likewise.
+ (std::tr1::cbrt): Likewise.
+ (std::tr1::copysign): Likewise.
+ (std::tr1::erf): Likewise.
+ (std::tr1::erfc): Likewise.
+ (std::tr1::exp2): Likewise.
+ (std::tr1::expm1): Likewise.
+ (std::tr1::fabs): Likewise.
+ (std::tr1::fdim): Likewise.
+ (std::tr1::fma): Likewise.
+ (std::tr1::fmax): Likewise.
+ (std::tr1::fmin): Likewise.
+ (std::tr1::hypot): Likewise.
+ (std::tr1::ilogb): Likewise.
+ (std::tr1::lgamma): Likewise.
+ (std::tr1::llrint): Likewise.
+ (std::tr1::llround): Likewise.
+ (std::tr1::log1p): Likewise.
+ (std::tr1::log2): Likewise.
+ (std::tr1::logb): Likewise.
+ (std::tr1::lrint): Likewise.
+ (std::tr1::lround): Likewise.
+ (std::tr1::nearbyint): Likewise.
+ (std::tr1::nextafter): Likewise.
+ (std::tr1::nexttoward): Likewise.
+ (std::tr1::remainder): Likewise.
+ (std::tr1::remquo): Likewise.
+ (std::tr1::rint): Likewise.
+ (std::tr1::scalbln): Likewise.
+ (std::tr1::scalbn): Likewise.
+ (std::tr1::tgamma): Likewise.
+ (std::tr1::trunc): Likewise.
+ (std::tr1::pow): Likewise.
+
+ * testsuite/26_numerics/headers/cmath/c99_classification_macros_c.cc:
+ Restrict dg-xfail-if, dg-excess-errors to *-*-solaris2.10*.
+
+2016-02-10 Jonathan Wakely <jwakely@redhat.com>
+
+ PR libstdc++/69116
+ * include/bits/valarray_before.h (__fun, __fun_with_valarray): Only
+ define result_type for types which can be safely used with valarrays.
+ * testsuite/26_numerics/valarray/69116.cc: New.
+
+2016-01-18 Jonathan Wakely <jwakely@redhat.com>
+
+ PR libstdc++/60637
+ * include/c_global/cmath (signbit) [__cplusplus < 201103L]: Use
+ __builtin_signbitf or __builtin_signbitl as appropriate.
+ * testsuite/26_numerics/headers/cmath/60637.cc: New.
+
+2016-01-12 Jonathan Wakely <jwakely@redhat.com>
+
+ PR libstdc++/69092
+ * include/bits/basic_string.h (basic_string::_S_copy_chars<_Iterator>):
+ Remove _GLIBCXX_NOEXCEPT.
+ testsuite/21_strings/basic_string/cons/char/69092.cc: New.
+
+ PR libstdc++/68995
+ * include/std/functional (_Function_handler::_M_invoke): Qualify
+ __callable_functor.
+ * testsuite/20_util/function/68995.cc: New.
+
+2015-12-16 Jonathan Wakely <jwakely@redhat.com>
+
+ PR libstdc++/68912
+ * include/std/functional (_Bind::operator()): Use lvalue functor to
+ deduce return type.
+ * testsuite/20_util/bind/68912.cc: New.
+
+ Backport from mainline
+ 2015-12-02 Jonathan Wakely <jwakely@redhat.com>
+
+ PR libstdc++/56383
+ * testsuite/20_util/enable_shared_from_this/56383.cc: New.
+ * include/bits/shared_ptr_base.h (__enable_shared_from_this): Make
+ friend declaration match previous declaration of
+ __enable_shared_from_this_helper.
+ * include/bits/shared_ptr.h (enable_shared_from_this): Likewise.
+
+2015-12-15 Tim Shen <timshen@google.com>
+
+ Backport from mainline
+ 2015-12-15 Tim Shen <timshen@google.com>
+
+ PR libstdc++/68863
+ * include/bits/regex_executor.tcc (_Executor::_M_lookahead):
+ Copy the captured content for lookahead, so that the backreferences
+ inside can refer to them.
+ * testsuite/28_regex/algorithms/regex_match/ecma/char/68863.cc:
+ New testcase.
+
2015-10-02 Jonathan Wakely <jwakely@redhat.com>
PR libstdc++/65142
diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4
index b3ce3dbe3d9..f680d925562 100644
--- a/libstdc++-v3/acinclude.m4
+++ b/libstdc++-v3/acinclude.m4
@@ -1897,6 +1897,52 @@ AC_DEFUN([GLIBCXX_CHECK_STDIO_PROTO], [
])
dnl
+dnl Check whether required C++11 overloads are present in <math.h>.
+dnl
+AC_DEFUN([GLIBCXX_CHECK_MATH11_PROTO], [
+
+ AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ ac_save_CXXFLAGS="$CXXFLAGS"
+ CXXFLAGS="$CXXFLAGS -std=c++11"
+
+ case "$host" in
+ *-*-solaris2.*)
+ # Solaris 12 introduced the C++11 <math.h> overloads. A backport to
+ # a Solaris 11.3 SRU is likely, maybe even a Solaris 10 patch.
+ AC_MSG_CHECKING([for C++11 <math.h> overloads])
+ AC_CACHE_VAL(glibcxx_cv_math11_overload, [
+ AC_COMPILE_IFELSE([AC_LANG_SOURCE(
+ [#include <math.h>
+ #undef isfinite
+ namespace std {
+ inline bool isfinite(float __x)
+ { return __builtin_isfinite(__x); }
+ }
+ ])],
+ [glibcxx_cv_math11_overload=no],
+ [glibcxx_cv_math11_overload=yes]
+ )])
+
+ # autoheader cannot handle indented templates.
+ AH_VERBATIM([__CORRECT_ISO_CPP11_MATH_H_PROTO],
+ [/* Define if all C++11 overloads are available in <math.h>. */
+#if __cplusplus >= 201103L
+#undef __CORRECT_ISO_CPP11_MATH_H_PROTO
+#endif])
+
+ if test $glibcxx_cv_math11_overload = yes; then
+ AC_DEFINE(__CORRECT_ISO_CPP11_MATH_H_PROTO)
+ fi
+ AC_MSG_RESULT([$glibcxx_cv_math11_overload])
+ ;;
+ esac
+
+ CXXFLAGS="$ac_save_CXXFLAGS"
+ AC_LANG_RESTORE
+])
+
+dnl
dnl Check whether macros, etc are present for <system_error>
dnl
AC_DEFUN([GLIBCXX_CHECK_SYSTEM_ERROR], [
diff --git a/libstdc++-v3/config.h.in b/libstdc++-v3/config.h.in
index adc7d44ee48..774a8809418 100644
--- a/libstdc++-v3/config.h.in
+++ b/libstdc++-v3/config.h.in
@@ -882,6 +882,11 @@
/* Define to 1 if mutex_timedlock is available. */
#undef _GTHREAD_USE_MUTEX_TIMEDLOCK
+/* Define if all C++11 overloads are available in <math.h>. */
+#if __cplusplus >= 201103L
+#undef __CORRECT_ISO_CPP11_MATH_H_PROTO
+#endif
+
#if defined (HAVE__ACOSF) && ! defined (HAVE_ACOSF)
# define HAVE_ACOSF 1
# define acosf _acosf
diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure
index 16e09f097ac..bcd2c8cdbc1 100755
--- a/libstdc++-v3/configure
+++ b/libstdc++-v3/configure
@@ -17489,6 +17489,68 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+ ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+ ac_save_CXXFLAGS="$CXXFLAGS"
+ CXXFLAGS="$CXXFLAGS -std=c++11"
+
+ case "$host" in
+ *-*-solaris2.*)
+ # Solaris 12 introduced the C++11 <math.h> overloads. A backport to
+ # a Solaris 11.3 SRU is likely, maybe even a Solaris 10 patch.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C++11 <math.h> overloads" >&5
+$as_echo_n "checking for C++11 <math.h> overloads... " >&6; }
+ if test "${glibcxx_cv_math11_overload+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <math.h>
+ #undef isfinite
+ namespace std {
+ inline bool isfinite(float __x)
+ { return __builtin_isfinite(__x); }
+ }
+
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+ glibcxx_cv_math11_overload=no
+else
+ glibcxx_cv_math11_overload=yes
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+
+ # autoheader cannot handle indented templates.
+
+
+ if test $glibcxx_cv_math11_overload = yes; then
+ $as_echo "#define __CORRECT_ISO_CPP11_MATH_H_PROTO 1" >>confdefs.h
+
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_math11_overload" >&5
+$as_echo "$glibcxx_cv_math11_overload" >&6; }
+ ;;
+ esac
+
+ CXXFLAGS="$ac_save_CXXFLAGS"
+ ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for EOWNERDEAD" >&5
$as_echo_n "checking for EOWNERDEAD... " >&6; }
if test "${glibcxx_cv_system_error1+set}" = set; then :
diff --git a/libstdc++-v3/configure.ac b/libstdc++-v3/configure.ac
index 1de0f6c1cbf..590562f4fa6 100644
--- a/libstdc++-v3/configure.ac
+++ b/libstdc++-v3/configure.ac
@@ -178,6 +178,7 @@ GLIBCXX_ENABLE_VTABLE_VERIFY([no])
# Checks for operating systems support that doesn't require linking.
GLIBCXX_CHECK_STDIO_PROTO
+GLIBCXX_CHECK_MATH11_PROTO
GLIBCXX_CHECK_SYSTEM_ERROR
# For the streamoff typedef.
diff --git a/libstdc++-v3/include/bits/alloc_traits.h b/libstdc++-v3/include/bits/alloc_traits.h
index 23fe8de0947..a1d2154207d 100644
--- a/libstdc++-v3/include/bits/alloc_traits.h
+++ b/libstdc++-v3/include/bits/alloc_traits.h
@@ -406,7 +406,7 @@ _GLIBCXX_ALLOC_TR_NESTED_TYPE(propagate_on_container_swap,
* Calls @c __a.destroy(__p) if that expression is well-formed,
* otherwise calls @c __p->~_Tp()
*/
- template <class _Tp>
+ template<typename _Tp>
static void destroy(_Alloc& __a, _Tp* __p)
{ _S_destroy(__a, __p); }
@@ -434,6 +434,130 @@ _GLIBCXX_ALLOC_TR_NESTED_TYPE(propagate_on_container_swap,
{ return _S_select(__rhs, 0); }
};
+ /// Partial specialization for std::allocator.
+ template<typename _Tp>
+ struct allocator_traits<allocator<_Tp>>
+ {
+ /// The allocator type
+ using allocator_type = allocator<_Tp>;
+ /// The allocated type
+ using value_type = _Tp;
+
+ /// The allocator's pointer type.
+ using pointer = _Tp*;
+
+ /// The allocator's const pointer type.
+ using const_pointer = const _Tp*;
+
+ /// The allocator's void pointer type.
+ using void_pointer = void*;
+
+ /// The allocator's const void pointer type.
+ using const_void_pointer = const void*;
+
+ /// The allocator's difference type
+ using difference_type = std::ptrdiff_t;
+
+ /// The allocator's size type
+ using size_type = std::size_t;
+
+ /// How the allocator is propagated on copy assignment
+ using propagate_on_container_copy_assignment = false_type;
+
+ /// How the allocator is propagated on move assignment
+ using propagate_on_container_move_assignment = true_type;
+
+ /// How the allocator is propagated on swap
+ using propagate_on_container_swap = false_type;
+
+ template<typename _Up>
+ using rebind_alloc = allocator<_Up>;
+
+ template<typename _Up>
+ using rebind_traits = allocator_traits<allocator<_Up>>;
+
+ /**
+ * @brief Allocate memory.
+ * @param __a An allocator.
+ * @param __n The number of objects to allocate space for.
+ *
+ * Calls @c a.allocate(n)
+ */
+ static pointer
+ allocate(allocator_type& __a, size_type __n)
+ { return __a.allocate(__n); }
+
+ /**
+ * @brief Allocate memory.
+ * @param __a An allocator.
+ * @param __n The number of objects to allocate space for.
+ * @param __hint Aid to locality.
+ * @return Memory of suitable size and alignment for @a n objects
+ * of type @c value_type
+ *
+ * Returns <tt> a.allocate(n, hint) </tt>
+ */
+ static pointer
+ allocate(allocator_type& __a, size_type __n, const_void_pointer __hint)
+ { return __a.allocate(__n, __hint); }
+
+ /**
+ * @brief Deallocate memory.
+ * @param __a An allocator.
+ * @param __p Pointer to the memory to deallocate.
+ * @param __n The number of objects space was allocated for.
+ *
+ * Calls <tt> a.deallocate(p, n) </tt>
+ */
+ static void
+ deallocate(allocator_type& __a, pointer __p, size_type __n)
+ { __a.deallocate(__p, __n); }
+
+ /**
+ * @brief Construct an object of type @a _Up
+ * @param __a An allocator.
+ * @param __p Pointer to memory of suitable size and alignment for Tp
+ * @param __args Constructor arguments.
+ *
+ * Calls <tt> __a.construct(__p, std::forward<Args>(__args)...) </tt>
+ */
+ template<typename _Up, typename... _Args>
+ static void
+ construct(allocator_type& __a, _Up* __p, _Args&&... __args)
+ { __a.construct(__p, std::forward<_Args>(__args)...); }
+
+ /**
+ * @brief Destroy an object of type @a _Up
+ * @param __a An allocator.
+ * @param __p Pointer to the object to destroy
+ *
+ * Calls @c __a.destroy(__p).
+ */
+ template<typename _Up>
+ static void
+ destroy(allocator_type& __a, _Up* __p)
+ { __a.destroy(__p); }
+
+ /**
+ * @brief The maximum supported allocation size
+ * @param __a An allocator.
+ * @return @c __a.max_size()
+ */
+ static size_type
+ max_size(const allocator_type& __a) noexcept
+ { return __a.max_size(); }
+
+ /**
+ * @brief Obtain an allocator to use when copying a container.
+ * @param __rhs An allocator.
+ * @return @c __rhs
+ */
+ static allocator_type
+ select_on_container_copy_construction(const allocator_type& __rhs)
+ { return __rhs; }
+ };
+
+
template<typename _Alloc>
inline void
__do_alloc_on_copy(_Alloc& __one, const _Alloc& __two, true_type)
diff --git a/libstdc++-v3/include/bits/basic_string.h b/libstdc++-v3/include/bits/basic_string.h
index a629390c789..48613f6df52 100644
--- a/libstdc++-v3/include/bits/basic_string.h
+++ b/libstdc++-v3/include/bits/basic_string.h
@@ -384,7 +384,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
template<class _Iterator>
static void
_S_copy_chars(_CharT* __p, _Iterator __k1, _Iterator __k2)
- _GLIBCXX_NOEXCEPT
{
for (; __k1 != __k2; ++__k1, ++__p)
traits_type::assign(*__p, *__k1); // These types are off.
diff --git a/libstdc++-v3/include/bits/regex_executor.tcc b/libstdc++-v3/include/bits/regex_executor.tcc
index 1dc65435f11..3ef1789febf 100644
--- a/libstdc++-v3/include/bits/regex_executor.tcc
+++ b/libstdc++-v3/include/bits/regex_executor.tcc
@@ -144,7 +144,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
bool _Executor<_BiIter, _Alloc, _TraitsT, __dfs_mode>::
_M_lookahead(_State<_TraitsT> __state)
{
- _ResultsVec __what(_M_cur_results.size());
+ // Backreferences may refer to captured content.
+ // We may want to make this faster by not copying,
+ // but let's not be clever prematurely.
+ _ResultsVec __what(_M_cur_results);
auto __sub = std::unique_ptr<_Executor>(new _Executor(_M_current,
_M_end,
__what,
diff --git a/libstdc++-v3/include/bits/shared_ptr.h b/libstdc++-v3/include/bits/shared_ptr.h
index 081d3bd3748..7ee224aae2e 100644
--- a/libstdc++-v3/include/bits/shared_ptr.h
+++ b/libstdc++-v3/include/bits/shared_ptr.h
@@ -556,19 +556,25 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
_M_weak_assign(_Tp1* __p, const __shared_count<>& __n) const noexcept
{ _M_weak_this._M_assign(__p, __n); }
- template<typename _Tp1>
+ template<typename _Tp1, typename _Tp2>
friend void
- __enable_shared_from_this_helper(const __shared_count<>& __pn,
- const enable_shared_from_this* __pe,
- const _Tp1* __px) noexcept
- {
- if (__pe != 0)
- __pe->_M_weak_assign(const_cast<_Tp1*>(__px), __pn);
- }
+ __enable_shared_from_this_helper(const __shared_count<>&,
+ const enable_shared_from_this<_Tp1>*,
+ const _Tp2*) noexcept;
mutable weak_ptr<_Tp> _M_weak_this;
};
+ template<typename _Tp1, typename _Tp2>
+ inline void
+ __enable_shared_from_this_helper(const __shared_count<>& __pn,
+ const enable_shared_from_this<_Tp1>*
+ __pe, const _Tp2* __px) noexcept
+ {
+ if (__pe != nullptr)
+ __pe->_M_weak_assign(const_cast<_Tp2*>(__px), __pn);
+ }
+
/**
* @brief Create an object that is owned by a shared_ptr.
* @param __a An allocator.
diff --git a/libstdc++-v3/include/bits/shared_ptr_base.h b/libstdc++-v3/include/bits/shared_ptr_base.h
index 026c5979fae..64394f283ba 100644
--- a/libstdc++-v3/include/bits/shared_ptr_base.h
+++ b/libstdc++-v3/include/bits/shared_ptr_base.h
@@ -1506,19 +1506,25 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
_M_weak_assign(_Tp1* __p, const __shared_count<_Lp>& __n) const noexcept
{ _M_weak_this._M_assign(__p, __n); }
- template<typename _Tp1>
+ template<_Lock_policy _Lp1, typename _Tp1, typename _Tp2>
friend void
- __enable_shared_from_this_helper(const __shared_count<_Lp>& __pn,
- const __enable_shared_from_this* __pe,
- const _Tp1* __px) noexcept
- {
- if (__pe != 0)
- __pe->_M_weak_assign(const_cast<_Tp1*>(__px), __pn);
- }
+ __enable_shared_from_this_helper(const __shared_count<_Lp1>&,
+ const __enable_shared_from_this<_Tp1,
+ _Lp1>*, const _Tp2*) noexcept;
mutable __weak_ptr<_Tp, _Lp> _M_weak_this;
};
+ template<_Lock_policy _Lp1, typename _Tp1, typename _Tp2>
+ inline void
+ __enable_shared_from_this_helper(const __shared_count<_Lp1>& __pn,
+ const __enable_shared_from_this<_Tp1,
+ _Lp1>* __pe,
+ const _Tp2* __px) noexcept
+ {
+ if (__pe != nullptr)
+ __pe->_M_weak_assign(const_cast<_Tp2*>(__px), __pn);
+ }
template<typename _Tp, _Lock_policy _Lp, typename _Alloc, typename... _Args>
inline __shared_ptr<_Tp, _Lp>
diff --git a/libstdc++-v3/include/bits/stl_algobase.h b/libstdc++-v3/include/bits/stl_algobase.h
index a8d3cc89ee3..ef01ebad8c7 100644
--- a/libstdc++-v3/include/bits/stl_algobase.h
+++ b/libstdc++-v3/include/bits/stl_algobase.h
@@ -369,9 +369,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
__copy_m(const _Tp* __first, const _Tp* __last, _Tp* __result)
{
#if __cplusplus >= 201103L
+ using __assignable = conditional<_IsMove,
+ is_move_assignable<_Tp>,
+ is_copy_assignable<_Tp>>;
// trivial types can have deleted assignment
- static_assert( is_copy_assignable<_Tp>::value,
- "type is not assignable" );
+ static_assert( __assignable::type::value, "type is not assignable" );
#endif
const ptrdiff_t _Num = __last - __first;
if (_Num)
@@ -569,9 +571,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
__copy_move_b(const _Tp* __first, const _Tp* __last, _Tp* __result)
{
#if __cplusplus >= 201103L
+ using __assignable = conditional<_IsMove,
+ is_move_assignable<_Tp>,
+ is_copy_assignable<_Tp>>;
// trivial types can have deleted assignment
- static_assert( is_copy_assignable<_Tp>::value,
- "type is not assignable" );
+ static_assert( __assignable::type::value, "type is not assignable" );
#endif
const ptrdiff_t _Num = __last - __first;
if (_Num)
diff --git a/libstdc++-v3/include/bits/valarray_before.h b/libstdc++-v3/include/bits/valarray_before.h
index fb5ec74ee53..971ed82cb4c 100644
--- a/libstdc++-v3/include/bits/valarray_before.h
+++ b/libstdc++-v3/include/bits/valarray_before.h
@@ -331,14 +331,24 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return pow(__x, __y); }
};
+ template<typename _Tp, bool _IsValidValarrayValue = !__is_abstract(_Tp)>
+ struct __fun_with_valarray
+ {
+ typedef _Tp result_type;
+ };
+
+ template<typename _Tp>
+ struct __fun_with_valarray<_Tp, false>
+ {
+ // No result type defined for invalid value types.
+ };
// We need these bits in order to recover the return type of
// some functions/operators now that we're no longer using
// function templates.
template<typename, typename _Tp>
- struct __fun
+ struct __fun : __fun_with_valarray<_Tp>
{
- typedef _Tp result_type;
};
// several specializations for relational operators.
diff --git a/libstdc++-v3/include/c_global/cmath b/libstdc++-v3/include/c_global/cmath
index c53491244b7..ba6815aad11 100644
--- a/libstdc++-v3/include/c_global/cmath
+++ b/libstdc++-v3/include/c_global/cmath
@@ -557,6 +557,8 @@ namespace std _GLIBCXX_VISIBILITY(default)
_GLIBCXX_BEGIN_NAMESPACE_VERSION
#if __cplusplus >= 201103L
+
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
constexpr int
fpclassify(float __x)
{ return __builtin_fpclassify(FP_NAN, FP_INFINITE, FP_NORMAL,
@@ -571,6 +573,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
fpclassify(long double __x)
{ return __builtin_fpclassify(FP_NAN, FP_INFINITE, FP_NORMAL,
FP_SUBNORMAL, FP_ZERO, __x); }
+#endif
template<typename _Tp>
constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
@@ -578,6 +581,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
fpclassify(_Tp __x)
{ return __x != 0 ? FP_NORMAL : FP_ZERO; }
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
constexpr bool
isfinite(float __x)
{ return __builtin_isfinite(__x); }
@@ -589,6 +593,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
constexpr bool
isfinite(long double __x)
{ return __builtin_isfinite(__x); }
+#endif
template<typename _Tp>
constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
@@ -596,6 +601,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
isfinite(_Tp __x)
{ return true; }
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
constexpr bool
isinf(float __x)
{ return __builtin_isinf(__x); }
@@ -607,6 +613,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
constexpr bool
isinf(long double __x)
{ return __builtin_isinf(__x); }
+#endif
template<typename _Tp>
constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
@@ -614,6 +621,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
isinf(_Tp __x)
{ return false; }
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
constexpr bool
isnan(float __x)
{ return __builtin_isnan(__x); }
@@ -625,6 +633,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
constexpr bool
isnan(long double __x)
{ return __builtin_isnan(__x); }
+#endif
template<typename _Tp>
constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
@@ -632,6 +641,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
isnan(_Tp __x)
{ return false; }
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
constexpr bool
isnormal(float __x)
{ return __builtin_isnormal(__x); }
@@ -643,6 +653,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
constexpr bool
isnormal(long double __x)
{ return __builtin_isnormal(__x); }
+#endif
template<typename _Tp>
constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
@@ -650,6 +661,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
isnormal(_Tp __x)
{ return __x != 0 ? true : false; }
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
// The front-end doesn't provide a type generic builtin (libstdc++/58625).
constexpr bool
signbit(float __x)
@@ -662,6 +674,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
constexpr bool
signbit(long double __x)
{ return __builtin_signbitl(__x); }
+#endif
template<typename _Tp>
constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
@@ -669,6 +682,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
signbit(_Tp __x)
{ return __x < 0 ? true : false; }
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
constexpr bool
isgreater(float __x, float __y)
{ return __builtin_isgreater(__x, __y); }
@@ -680,6 +694,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
constexpr bool
isgreater(long double __x, long double __y)
{ return __builtin_isgreater(__x, __y); }
+#endif
template<typename _Tp, typename _Up>
constexpr typename
@@ -691,6 +706,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
return __builtin_isgreater(__type(__x), __type(__y));
}
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
constexpr bool
isgreaterequal(float __x, float __y)
{ return __builtin_isgreaterequal(__x, __y); }
@@ -702,6 +718,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
constexpr bool
isgreaterequal(long double __x, long double __y)
{ return __builtin_isgreaterequal(__x, __y); }
+#endif
template<typename _Tp, typename _Up>
constexpr typename
@@ -713,6 +730,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
return __builtin_isgreaterequal(__type(__x), __type(__y));
}
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
constexpr bool
isless(float __x, float __y)
{ return __builtin_isless(__x, __y); }
@@ -724,6 +742,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
constexpr bool
isless(long double __x, long double __y)
{ return __builtin_isless(__x, __y); }
+#endif
template<typename _Tp, typename _Up>
constexpr typename
@@ -735,6 +754,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
return __builtin_isless(__type(__x), __type(__y));
}
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
constexpr bool
islessequal(float __x, float __y)
{ return __builtin_islessequal(__x, __y); }
@@ -746,6 +766,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
constexpr bool
islessequal(long double __x, long double __y)
{ return __builtin_islessequal(__x, __y); }
+#endif
template<typename _Tp, typename _Up>
constexpr typename
@@ -757,6 +778,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
return __builtin_islessequal(__type(__x), __type(__y));
}
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
constexpr bool
islessgreater(float __x, float __y)
{ return __builtin_islessgreater(__x, __y); }
@@ -768,6 +790,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
constexpr bool
islessgreater(long double __x, long double __y)
{ return __builtin_islessgreater(__x, __y); }
+#endif
template<typename _Tp, typename _Up>
constexpr typename
@@ -779,6 +802,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
return __builtin_islessgreater(__type(__x), __type(__y));
}
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
constexpr bool
isunordered(float __x, float __y)
{ return __builtin_isunordered(__x, __y); }
@@ -790,6 +814,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
constexpr bool
isunordered(long double __x, long double __y)
{ return __builtin_isunordered(__x, __y); }
+#endif
template<typename _Tp, typename _Up>
constexpr typename
@@ -855,7 +880,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
signbit(_Tp __f)
{
typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
- return __builtin_signbit(__type(__f));
+ return sizeof(__type) == sizeof(float)
+ ? __builtin_signbitf(__type(__f))
+ : sizeof(__type) == sizeof(double)
+ ? __builtin_signbit(__type(__f))
+ : __builtin_signbitl(__type(__f));
}
template<typename _Tp>
@@ -1180,6 +1209,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
using ::truncl;
/// Additional overloads.
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
constexpr float
acosh(float __x)
{ return __builtin_acoshf(__x); }
@@ -1187,6 +1217,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
constexpr long double
acosh(long double __x)
{ return __builtin_acoshl(__x); }
+#endif
template<typename _Tp>
constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
@@ -1194,6 +1225,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
acosh(_Tp __x)
{ return __builtin_acosh(__x); }
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
constexpr float
asinh(float __x)
{ return __builtin_asinhf(__x); }
@@ -1201,6 +1233,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
constexpr long double
asinh(long double __x)
{ return __builtin_asinhl(__x); }
+#endif
template<typename _Tp>
constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
@@ -1208,6 +1241,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
asinh(_Tp __x)
{ return __builtin_asinh(__x); }
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
constexpr float
atanh(float __x)
{ return __builtin_atanhf(__x); }
@@ -1215,6 +1249,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
constexpr long double
atanh(long double __x)
{ return __builtin_atanhl(__x); }
+#endif
template<typename _Tp>
constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
@@ -1222,6 +1257,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
atanh(_Tp __x)
{ return __builtin_atanh(__x); }
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
constexpr float
cbrt(float __x)
{ return __builtin_cbrtf(__x); }
@@ -1229,6 +1265,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
constexpr long double
cbrt(long double __x)
{ return __builtin_cbrtl(__x); }
+#endif
template<typename _Tp>
constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
@@ -1236,6 +1273,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
cbrt(_Tp __x)
{ return __builtin_cbrt(__x); }
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
constexpr float
copysign(float __x, float __y)
{ return __builtin_copysignf(__x, __y); }
@@ -1243,6 +1281,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
constexpr long double
copysign(long double __x, long double __y)
{ return __builtin_copysignl(__x, __y); }
+#endif
template<typename _Tp, typename _Up>
constexpr typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
@@ -1252,6 +1291,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
return copysign(__type(__x), __type(__y));
}
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
constexpr float
erf(float __x)
{ return __builtin_erff(__x); }
@@ -1259,6 +1299,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
constexpr long double
erf(long double __x)
{ return __builtin_erfl(__x); }
+#endif
template<typename _Tp>
constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
@@ -1266,6 +1307,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
erf(_Tp __x)
{ return __builtin_erf(__x); }
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
constexpr float
erfc(float __x)
{ return __builtin_erfcf(__x); }
@@ -1273,6 +1315,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
constexpr long double
erfc(long double __x)
{ return __builtin_erfcl(__x); }
+#endif
template<typename _Tp>
constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
@@ -1280,6 +1323,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
erfc(_Tp __x)
{ return __builtin_erfc(__x); }
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
constexpr float
exp2(float __x)
{ return __builtin_exp2f(__x); }
@@ -1287,6 +1331,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
constexpr long double
exp2(long double __x)
{ return __builtin_exp2l(__x); }
+#endif
template<typename _Tp>
constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
@@ -1294,6 +1339,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
exp2(_Tp __x)
{ return __builtin_exp2(__x); }
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
constexpr float
expm1(float __x)
{ return __builtin_expm1f(__x); }
@@ -1301,6 +1347,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
constexpr long double
expm1(long double __x)
{ return __builtin_expm1l(__x); }
+#endif
template<typename _Tp>
constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
@@ -1308,6 +1355,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
expm1(_Tp __x)
{ return __builtin_expm1(__x); }
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
constexpr float
fdim(float __x, float __y)
{ return __builtin_fdimf(__x, __y); }
@@ -1315,6 +1363,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
constexpr long double
fdim(long double __x, long double __y)
{ return __builtin_fdiml(__x, __y); }
+#endif
template<typename _Tp, typename _Up>
constexpr typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
@@ -1324,6 +1373,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
return fdim(__type(__x), __type(__y));
}
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
constexpr float
fma(float __x, float __y, float __z)
{ return __builtin_fmaf(__x, __y, __z); }
@@ -1331,6 +1381,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
constexpr long double
fma(long double __x, long double __y, long double __z)
{ return __builtin_fmal(__x, __y, __z); }
+#endif
template<typename _Tp, typename _Up, typename _Vp>
constexpr typename __gnu_cxx::__promote_3<_Tp, _Up, _Vp>::__type
@@ -1340,6 +1391,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
return fma(__type(__x), __type(__y), __type(__z));
}
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
constexpr float
fmax(float __x, float __y)
{ return __builtin_fmaxf(__x, __y); }
@@ -1347,6 +1399,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
constexpr long double
fmax(long double __x, long double __y)
{ return __builtin_fmaxl(__x, __y); }
+#endif
template<typename _Tp, typename _Up>
constexpr typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
@@ -1356,6 +1409,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
return fmax(__type(__x), __type(__y));
}
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
constexpr float
fmin(float __x, float __y)
{ return __builtin_fminf(__x, __y); }
@@ -1363,6 +1417,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
constexpr long double
fmin(long double __x, long double __y)
{ return __builtin_fminl(__x, __y); }
+#endif
template<typename _Tp, typename _Up>
constexpr typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
@@ -1372,6 +1427,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
return fmin(__type(__x), __type(__y));
}
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
constexpr float
hypot(float __x, float __y)
{ return __builtin_hypotf(__x, __y); }
@@ -1379,6 +1435,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
constexpr long double
hypot(long double __x, long double __y)
{ return __builtin_hypotl(__x, __y); }
+#endif
template<typename _Tp, typename _Up>
constexpr typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
@@ -1388,6 +1445,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
return hypot(__type(__x), __type(__y));
}
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
constexpr int
ilogb(float __x)
{ return __builtin_ilogbf(__x); }
@@ -1395,6 +1453,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
constexpr int
ilogb(long double __x)
{ return __builtin_ilogbl(__x); }
+#endif
template<typename _Tp>
constexpr
@@ -1403,6 +1462,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
ilogb(_Tp __x)
{ return __builtin_ilogb(__x); }
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
constexpr float
lgamma(float __x)
{ return __builtin_lgammaf(__x); }
@@ -1410,6 +1470,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
constexpr long double
lgamma(long double __x)
{ return __builtin_lgammal(__x); }
+#endif
template<typename _Tp>
constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
@@ -1417,6 +1478,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
lgamma(_Tp __x)
{ return __builtin_lgamma(__x); }
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
constexpr long long
llrint(float __x)
{ return __builtin_llrintf(__x); }
@@ -1424,6 +1486,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
constexpr long long
llrint(long double __x)
{ return __builtin_llrintl(__x); }
+#endif
template<typename _Tp>
constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
@@ -1431,6 +1494,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
llrint(_Tp __x)
{ return __builtin_llrint(__x); }
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
constexpr long long
llround(float __x)
{ return __builtin_llroundf(__x); }
@@ -1438,6 +1502,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
constexpr long long
llround(long double __x)
{ return __builtin_llroundl(__x); }
+#endif
template<typename _Tp>
constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
@@ -1445,6 +1510,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
llround(_Tp __x)
{ return __builtin_llround(__x); }
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
constexpr float
log1p(float __x)
{ return __builtin_log1pf(__x); }
@@ -1452,6 +1518,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
constexpr long double
log1p(long double __x)
{ return __builtin_log1pl(__x); }
+#endif
template<typename _Tp>
constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
@@ -1459,6 +1526,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
log1p(_Tp __x)
{ return __builtin_log1p(__x); }
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
// DR 568.
constexpr float
log2(float __x)
@@ -1467,6 +1535,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
constexpr long double
log2(long double __x)
{ return __builtin_log2l(__x); }
+#endif
template<typename _Tp>
constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
@@ -1474,6 +1543,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
log2(_Tp __x)
{ return __builtin_log2(__x); }
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
constexpr float
logb(float __x)
{ return __builtin_logbf(__x); }
@@ -1481,6 +1551,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
constexpr long double
logb(long double __x)
{ return __builtin_logbl(__x); }
+#endif
template<typename _Tp>
constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
@@ -1488,6 +1559,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
logb(_Tp __x)
{ return __builtin_logb(__x); }
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
constexpr long
lrint(float __x)
{ return __builtin_lrintf(__x); }
@@ -1495,6 +1567,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
constexpr long
lrint(long double __x)
{ return __builtin_lrintl(__x); }
+#endif
template<typename _Tp>
constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
@@ -1502,6 +1575,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
lrint(_Tp __x)
{ return __builtin_lrint(__x); }
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
constexpr long
lround(float __x)
{ return __builtin_lroundf(__x); }
@@ -1509,6 +1583,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
constexpr long
lround(long double __x)
{ return __builtin_lroundl(__x); }
+#endif
template<typename _Tp>
constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
@@ -1516,6 +1591,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
lround(_Tp __x)
{ return __builtin_lround(__x); }
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
constexpr float
nearbyint(float __x)
{ return __builtin_nearbyintf(__x); }
@@ -1523,6 +1599,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
constexpr long double
nearbyint(long double __x)
{ return __builtin_nearbyintl(__x); }
+#endif
template<typename _Tp>
constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
@@ -1530,6 +1607,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
nearbyint(_Tp __x)
{ return __builtin_nearbyint(__x); }
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
constexpr float
nextafter(float __x, float __y)
{ return __builtin_nextafterf(__x, __y); }
@@ -1537,6 +1615,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
constexpr long double
nextafter(long double __x, long double __y)
{ return __builtin_nextafterl(__x, __y); }
+#endif
template<typename _Tp, typename _Up>
constexpr typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
@@ -1546,6 +1625,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
return nextafter(__type(__x), __type(__y));
}
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
constexpr float
nexttoward(float __x, long double __y)
{ return __builtin_nexttowardf(__x, __y); }
@@ -1553,6 +1633,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
constexpr long double
nexttoward(long double __x, long double __y)
{ return __builtin_nexttowardl(__x, __y); }
+#endif
template<typename _Tp>
constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
@@ -1560,6 +1641,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
nexttoward(_Tp __x, long double __y)
{ return __builtin_nexttoward(__x, __y); }
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
constexpr float
remainder(float __x, float __y)
{ return __builtin_remainderf(__x, __y); }
@@ -1567,6 +1649,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
constexpr long double
remainder(long double __x, long double __y)
{ return __builtin_remainderl(__x, __y); }
+#endif
template<typename _Tp, typename _Up>
constexpr typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
@@ -1576,6 +1659,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
return remainder(__type(__x), __type(__y));
}
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
inline float
remquo(float __x, float __y, int* __pquo)
{ return __builtin_remquof(__x, __y, __pquo); }
@@ -1583,6 +1667,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
inline long double
remquo(long double __x, long double __y, int* __pquo)
{ return __builtin_remquol(__x, __y, __pquo); }
+#endif
template<typename _Tp, typename _Up>
inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
@@ -1592,6 +1677,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
return remquo(__type(__x), __type(__y), __pquo);
}
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
constexpr float
rint(float __x)
{ return __builtin_rintf(__x); }
@@ -1599,6 +1685,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
constexpr long double
rint(long double __x)
{ return __builtin_rintl(__x); }
+#endif
template<typename _Tp>
constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
@@ -1606,6 +1693,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
rint(_Tp __x)
{ return __builtin_rint(__x); }
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
constexpr float
round(float __x)
{ return __builtin_roundf(__x); }
@@ -1613,6 +1701,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
constexpr long double
round(long double __x)
{ return __builtin_roundl(__x); }
+#endif
template<typename _Tp>
constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
@@ -1620,6 +1709,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
round(_Tp __x)
{ return __builtin_round(__x); }
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
constexpr float
scalbln(float __x, long __ex)
{ return __builtin_scalblnf(__x, __ex); }
@@ -1627,6 +1717,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
constexpr long double
scalbln(long double __x, long __ex)
{ return __builtin_scalblnl(__x, __ex); }
+#endif
template<typename _Tp>
constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
@@ -1634,6 +1725,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
scalbln(_Tp __x, long __ex)
{ return __builtin_scalbln(__x, __ex); }
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
constexpr float
scalbn(float __x, int __ex)
{ return __builtin_scalbnf(__x, __ex); }
@@ -1641,6 +1733,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
constexpr long double
scalbn(long double __x, int __ex)
{ return __builtin_scalbnl(__x, __ex); }
+#endif
template<typename _Tp>
constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
@@ -1648,6 +1741,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
scalbn(_Tp __x, int __ex)
{ return __builtin_scalbn(__x, __ex); }
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
constexpr float
tgamma(float __x)
{ return __builtin_tgammaf(__x); }
@@ -1655,6 +1749,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
constexpr long double
tgamma(long double __x)
{ return __builtin_tgammal(__x); }
+#endif
template<typename _Tp>
constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
@@ -1662,6 +1757,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
tgamma(_Tp __x)
{ return __builtin_tgamma(__x); }
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
constexpr float
trunc(float __x)
{ return __builtin_truncf(__x); }
@@ -1669,6 +1765,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
constexpr long double
trunc(long double __x)
{ return __builtin_truncl(__x); }
+#endif
template<typename _Tp>
constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
diff --git a/libstdc++-v3/include/std/functional b/libstdc++-v3/include/std/functional
index fac1c6708f1..654ecc0e1b1 100644
--- a/libstdc++-v3/include/std/functional
+++ b/libstdc++-v3/include/std/functional
@@ -1312,7 +1312,7 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type)
// Call unqualified
template<typename... _Args, typename _Result
- = decltype( std::declval<_Functor>()(
+ = decltype( std::declval<_Functor&>()(
_Mu<_Bound_args>()( std::declval<_Bound_args&>(),
std::declval<tuple<_Args...>&>() )... ) )>
_Result
@@ -1326,7 +1326,7 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type)
// Call as const
template<typename... _Args, typename _Result
= decltype( std::declval<typename enable_if<(sizeof...(_Args) >= 0),
- typename add_const<_Functor>::type>::type>()(
+ typename add_const<_Functor>::type&>::type>()(
_Mu<_Bound_args>()( std::declval<const _Bound_args&>(),
std::declval<tuple<_Args...>&>() )... ) )>
_Result
@@ -1340,7 +1340,7 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type)
// Call as volatile
template<typename... _Args, typename _Result
= decltype( std::declval<typename enable_if<(sizeof...(_Args) >= 0),
- typename add_volatile<_Functor>::type>::type>()(
+ typename add_volatile<_Functor>::type&>::type>()(
_Mu<_Bound_args>()( std::declval<volatile _Bound_args&>(),
std::declval<tuple<_Args...>&>() )... ) )>
_Result
@@ -1354,7 +1354,7 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type)
// Call as const volatile
template<typename... _Args, typename _Result
= decltype( std::declval<typename enable_if<(sizeof...(_Args) >= 0),
- typename add_cv<_Functor>::type>::type>()(
+ typename add_cv<_Functor>::type&>::type>()(
_Mu<_Bound_args>()( std::declval<const volatile _Bound_args&>(),
std::declval<tuple<_Args...>&>() )... ) )>
_Result
@@ -2051,7 +2051,7 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type)
static _Res
_M_invoke(const _Any_data& __functor, _ArgTypes... __args)
{
- return __callable_functor(**_Base::_M_get_pointer(__functor))(
+ return std::__callable_functor(**_Base::_M_get_pointer(__functor))(
std::forward<_ArgTypes>(__args)...);
}
};
@@ -2066,7 +2066,7 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type)
static void
_M_invoke(const _Any_data& __functor, _ArgTypes... __args)
{
- __callable_functor(**_Base::_M_get_pointer(__functor))(
+ std::__callable_functor(**_Base::_M_get_pointer(__functor))(
std::forward<_ArgTypes>(__args)...);
}
};
@@ -2146,8 +2146,9 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type)
typedef _Res _Signature_type(_ArgTypes...);
template<typename _Functor>
- using _Invoke = decltype(__callable_functor(std::declval<_Functor&>())
- (std::declval<_ArgTypes>()...) );
+ using _Invoke
+ = decltype(std::__callable_functor(std::declval<_Functor&>())
+ (std::declval<_ArgTypes>()...) );
// Used so the return type convertibility checks aren't done when
// performing overload resolution for copy construction/assignment.
diff --git a/libstdc++-v3/include/tr1/cmath b/libstdc++-v3/include/tr1/cmath
index ea40656be0b..92689a07ecc 100644
--- a/libstdc++-v3/include/tr1/cmath
+++ b/libstdc++-v3/include/tr1/cmath
@@ -419,6 +419,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
/// Additional overloads [8.16.4].
using std::acos;
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
inline float
acosh(float __x)
{ return __builtin_acoshf(__x); }
@@ -426,6 +427,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
inline long double
acosh(long double __x)
{ return __builtin_acoshl(__x); }
+#endif
template<typename _Tp>
inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
@@ -435,6 +437,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
using std::asin;
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
inline float
asinh(float __x)
{ return __builtin_asinhf(__x); }
@@ -442,6 +445,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
inline long double
asinh(long double __x)
{ return __builtin_asinhl(__x); }
+#endif
template<typename _Tp>
inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
@@ -452,6 +456,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
using std::atan;
using std::atan2;
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
inline float
atanh(float __x)
{ return __builtin_atanhf(__x); }
@@ -459,6 +464,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
inline long double
atanh(long double __x)
{ return __builtin_atanhl(__x); }
+#endif
template<typename _Tp>
inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
@@ -466,6 +472,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
atanh(_Tp __x)
{ return __builtin_atanh(__x); }
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
inline float
cbrt(float __x)
{ return __builtin_cbrtf(__x); }
@@ -473,6 +480,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
inline long double
cbrt(long double __x)
{ return __builtin_cbrtl(__x); }
+#endif
template<typename _Tp>
inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
@@ -482,6 +490,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
using std::ceil;
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
inline float
copysign(float __x, float __y)
{ return __builtin_copysignf(__x, __y); }
@@ -489,6 +498,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
inline long double
copysign(long double __x, long double __y)
{ return __builtin_copysignl(__x, __y); }
+#endif
template<typename _Tp, typename _Up>
inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
@@ -501,6 +511,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
using std::cos;
using std::cosh;
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
inline float
erf(float __x)
{ return __builtin_erff(__x); }
@@ -508,6 +519,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
inline long double
erf(long double __x)
{ return __builtin_erfl(__x); }
+#endif
template<typename _Tp>
inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
@@ -515,6 +527,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
erf(_Tp __x)
{ return __builtin_erf(__x); }
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
inline float
erfc(float __x)
{ return __builtin_erfcf(__x); }
@@ -522,6 +535,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
inline long double
erfc(long double __x)
{ return __builtin_erfcl(__x); }
+#endif
template<typename _Tp>
inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
@@ -531,6 +545,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
using std::exp;
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
inline float
exp2(float __x)
{ return __builtin_exp2f(__x); }
@@ -538,6 +553,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
inline long double
exp2(long double __x)
{ return __builtin_exp2l(__x); }
+#endif
template<typename _Tp>
inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
@@ -545,6 +561,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
exp2(_Tp __x)
{ return __builtin_exp2(__x); }
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
inline float
expm1(float __x)
{ return __builtin_expm1f(__x); }
@@ -552,6 +569,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
inline long double
expm1(long double __x)
{ return __builtin_expm1l(__x); }
+#endif
template<typename _Tp>
inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
@@ -568,6 +586,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
using ::fabs;
#ifndef __CORRECT_ISO_CPP_MATH_H_PROTO
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
inline float
fabs(float __x)
{ return __builtin_fabsf(__x); }
@@ -575,6 +594,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
inline long double
fabs(long double __x)
{ return __builtin_fabsl(__x); }
+#endif
template<typename _Tp>
inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
@@ -583,6 +603,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return __builtin_fabs(__x); }
#endif
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
inline float
fdim(float __x, float __y)
{ return __builtin_fdimf(__x, __y); }
@@ -590,6 +611,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
inline long double
fdim(long double __x, long double __y)
{ return __builtin_fdiml(__x, __y); }
+#endif
template<typename _Tp, typename _Up>
inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
@@ -601,6 +623,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
using std::floor;
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
inline float
fma(float __x, float __y, float __z)
{ return __builtin_fmaf(__x, __y, __z); }
@@ -608,6 +631,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
inline long double
fma(long double __x, long double __y, long double __z)
{ return __builtin_fmal(__x, __y, __z); }
+#endif
template<typename _Tp, typename _Up, typename _Vp>
inline typename __gnu_cxx::__promote_3<_Tp, _Up, _Vp>::__type
@@ -617,6 +641,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
return fma(__type(__x), __type(__y), __type(__z));
}
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
inline float
fmax(float __x, float __y)
{ return __builtin_fmaxf(__x, __y); }
@@ -624,6 +649,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
inline long double
fmax(long double __x, long double __y)
{ return __builtin_fmaxl(__x, __y); }
+#endif
template<typename _Tp, typename _Up>
inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
@@ -633,6 +659,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
return fmax(__type(__x), __type(__y));
}
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
inline float
fmin(float __x, float __y)
{ return __builtin_fminf(__x, __y); }
@@ -640,6 +667,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
inline long double
fmin(long double __x, long double __y)
{ return __builtin_fminl(__x, __y); }
+#endif
template<typename _Tp, typename _Up>
inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
@@ -652,6 +680,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
using std::fmod;
using std::frexp;
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
inline float
hypot(float __x, float __y)
{ return __builtin_hypotf(__x, __y); }
@@ -659,6 +688,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
inline long double
hypot(long double __x, long double __y)
{ return __builtin_hypotl(__x, __y); }
+#endif
template<typename _Tp, typename _Up>
inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
@@ -668,6 +698,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
return hypot(__type(__y), __type(__x));
}
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
inline int
ilogb(float __x)
{ return __builtin_ilogbf(__x); }
@@ -675,6 +706,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
inline int
ilogb(long double __x)
{ return __builtin_ilogbl(__x); }
+#endif
template<typename _Tp>
inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
@@ -684,6 +716,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
using std::ldexp;
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
inline float
lgamma(float __x)
{ return __builtin_lgammaf(__x); }
@@ -691,6 +724,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
inline long double
lgamma(long double __x)
{ return __builtin_lgammal(__x); }
+#endif
template<typename _Tp>
inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
@@ -698,6 +732,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
lgamma(_Tp __x)
{ return __builtin_lgamma(__x); }
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
inline long long
llrint(float __x)
{ return __builtin_llrintf(__x); }
@@ -705,6 +740,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
inline long long
llrint(long double __x)
{ return __builtin_llrintl(__x); }
+#endif
template<typename _Tp>
inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
@@ -712,6 +748,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
llrint(_Tp __x)
{ return __builtin_llrint(__x); }
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
inline long long
llround(float __x)
{ return __builtin_llroundf(__x); }
@@ -719,6 +756,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
inline long long
llround(long double __x)
{ return __builtin_llroundl(__x); }
+#endif
template<typename _Tp>
inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
@@ -729,6 +767,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
using std::log;
using std::log10;
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
inline float
log1p(float __x)
{ return __builtin_log1pf(__x); }
@@ -736,6 +775,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
inline long double
log1p(long double __x)
{ return __builtin_log1pl(__x); }
+#endif
template<typename _Tp>
inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
@@ -744,6 +784,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return __builtin_log1p(__x); }
// DR 568.
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
inline float
log2(float __x)
{ return __builtin_log2f(__x); }
@@ -751,6 +792,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
inline long double
log2(long double __x)
{ return __builtin_log2l(__x); }
+#endif
template<typename _Tp>
inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
@@ -758,6 +800,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
log2(_Tp __x)
{ return __builtin_log2(__x); }
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
inline float
logb(float __x)
{ return __builtin_logbf(__x); }
@@ -765,6 +808,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
inline long double
logb(long double __x)
{ return __builtin_logbl(__x); }
+#endif
template<typename _Tp>
inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
@@ -774,6 +818,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
return __builtin_logb(__x);
}
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
inline long
lrint(float __x)
{ return __builtin_lrintf(__x); }
@@ -781,6 +826,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
inline long
lrint(long double __x)
{ return __builtin_lrintl(__x); }
+#endif
template<typename _Tp>
inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
@@ -788,6 +834,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
lrint(_Tp __x)
{ return __builtin_lrint(__x); }
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
inline long
lround(float __x)
{ return __builtin_lroundf(__x); }
@@ -795,6 +842,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
inline long
lround(long double __x)
{ return __builtin_lroundl(__x); }
+#endif
template<typename _Tp>
inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
@@ -802,6 +850,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
lround(_Tp __x)
{ return __builtin_lround(__x); }
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
inline float
nearbyint(float __x)
{ return __builtin_nearbyintf(__x); }
@@ -809,6 +858,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
inline long double
nearbyint(long double __x)
{ return __builtin_nearbyintl(__x); }
+#endif
template<typename _Tp>
inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
@@ -816,6 +866,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
nearbyint(_Tp __x)
{ return __builtin_nearbyint(__x); }
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
inline float
nextafter(float __x, float __y)
{ return __builtin_nextafterf(__x, __y); }
@@ -823,6 +874,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
inline long double
nextafter(long double __x, long double __y)
{ return __builtin_nextafterl(__x, __y); }
+#endif
template<typename _Tp, typename _Up>
inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
@@ -832,6 +884,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
return nextafter(__type(__x), __type(__y));
}
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
inline float
nexttoward(float __x, long double __y)
{ return __builtin_nexttowardf(__x, __y); }
@@ -839,6 +892,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
inline long double
nexttoward(long double __x, long double __y)
{ return __builtin_nexttowardl(__x, __y); }
+#endif
template<typename _Tp>
inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
@@ -846,6 +900,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
nexttoward(_Tp __x, long double __y)
{ return __builtin_nexttoward(__x, __y); }
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
inline float
remainder(float __x, float __y)
{ return __builtin_remainderf(__x, __y); }
@@ -853,6 +908,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
inline long double
remainder(long double __x, long double __y)
{ return __builtin_remainderl(__x, __y); }
+#endif
template<typename _Tp, typename _Up>
inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
@@ -862,6 +918,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
return remainder(__type(__x), __type(__y));
}
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
inline float
remquo(float __x, float __y, int* __pquo)
{ return __builtin_remquof(__x, __y, __pquo); }
@@ -869,6 +926,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
inline long double
remquo(long double __x, long double __y, int* __pquo)
{ return __builtin_remquol(__x, __y, __pquo); }
+#endif
template<typename _Tp, typename _Up>
inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
@@ -878,6 +936,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
return remquo(__type(__x), __type(__y), __pquo);
}
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
inline float
rint(float __x)
{ return __builtin_rintf(__x); }
@@ -885,6 +944,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
inline long double
rint(long double __x)
{ return __builtin_rintl(__x); }
+#endif
template<typename _Tp>
inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
@@ -892,6 +952,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
rint(_Tp __x)
{ return __builtin_rint(__x); }
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
inline float
round(float __x)
{ return __builtin_roundf(__x); }
@@ -899,6 +960,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
inline long double
round(long double __x)
{ return __builtin_roundl(__x); }
+#endif
template<typename _Tp>
inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
@@ -906,6 +968,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
round(_Tp __x)
{ return __builtin_round(__x); }
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
inline float
scalbln(float __x, long __ex)
{ return __builtin_scalblnf(__x, __ex); }
@@ -913,6 +976,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
inline long double
scalbln(long double __x, long __ex)
{ return __builtin_scalblnl(__x, __ex); }
+#endif
template<typename _Tp>
inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
@@ -920,6 +984,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
scalbln(_Tp __x, long __ex)
{ return __builtin_scalbln(__x, __ex); }
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
inline float
scalbn(float __x, int __ex)
{ return __builtin_scalbnf(__x, __ex); }
@@ -927,6 +992,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
inline long double
scalbn(long double __x, int __ex)
{ return __builtin_scalbnl(__x, __ex); }
+#endif
template<typename _Tp>
inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
@@ -940,6 +1006,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
using std::tan;
using std::tanh;
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
inline float
tgamma(float __x)
{ return __builtin_tgammaf(__x); }
@@ -947,6 +1014,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
inline long double
tgamma(long double __x)
{ return __builtin_tgammal(__x); }
+#endif
template<typename _Tp>
inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
@@ -954,6 +1022,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
tgamma(_Tp __x)
{ return __builtin_tgamma(__x); }
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
inline float
trunc(float __x)
{ return __builtin_truncf(__x); }
@@ -961,6 +1030,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
inline long double
trunc(long double __x)
{ return __builtin_truncl(__x); }
+#endif
template<typename _Tp>
inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
@@ -994,6 +1064,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
// the discussion about this issue here:
// http://gcc.gnu.org/ml/gcc-patches/2012-09/msg01278.html
+#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
inline float
pow(float __x, float __y)
{ return std::pow(__x, __y); }
@@ -1001,6 +1072,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
inline long double
pow(long double __x, long double __y)
{ return std::pow(__x, __y); }
+#endif
template<typename _Tp, typename _Up>
inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
diff --git a/libstdc++-v3/src/c++11/thread.cc b/libstdc++-v3/src/c++11/thread.cc
index 49aacb5a96d..d6574489376 100644
--- a/libstdc++-v3/src/c++11/thread.cc
+++ b/libstdc++-v3/src/c++11/thread.cc
@@ -70,9 +70,9 @@ static inline int get_nprocs()
namespace std _GLIBCXX_VISIBILITY(default)
{
- namespace
+ extern "C"
{
- extern "C" void*
+ static void*
execute_native_thread_routine(void* __p)
{
thread::_Impl_base* __t = static_cast<thread::_Impl_base*>(__p);
@@ -94,7 +94,7 @@ namespace std _GLIBCXX_VISIBILITY(default)
return 0;
}
- }
+ } // extern "C"
_GLIBCXX_BEGIN_NAMESPACE_VERSION
diff --git a/libstdc++-v3/testsuite/20_util/bind/68912.cc b/libstdc++-v3/testsuite/20_util/bind/68912.cc
new file mode 100644
index 00000000000..7a00b75124a
--- /dev/null
+++ b/libstdc++-v3/testsuite/20_util/bind/68912.cc
@@ -0,0 +1,53 @@
+// Copyright (C) 2015 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library 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 library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// { dg-options "-std=gnu++11" }
+// { dg-do compile }
+
+#include<functional>
+
+struct Wrong {};
+struct A {};
+struct B {};
+struct C{};
+struct D{};
+
+struct X {
+ A operator()(int, double) & { return {}; }
+ Wrong operator()(int, double) && {return {}; }
+
+ B operator()(int, double) const & { return {}; }
+ Wrong operator()(int, double) const && {return {}; }
+
+ C operator()(int, double) volatile & { return {}; }
+ Wrong operator()(int, double) volatile && {return {}; }
+
+ D operator()(int, double) const volatile & { return {}; }
+ Wrong operator()(int, double) const volatile && {return {}; }
+};
+
+void test01()
+{
+ auto bound = std::bind(X{}, 5, std::placeholders::_1);
+ A res = bound(1.0);
+ const auto bound_c = bound;
+ B res_c = bound_c(1.0);
+ volatile auto bound_v = bound;
+ C res_v = bound_v(1.0);
+ volatile const auto bound_cv = bound;
+ D res_cv = bound_cv(1.0);
+}
diff --git a/libstdc++-v3/testsuite/20_util/enable_shared_from_this/56383.cc b/libstdc++-v3/testsuite/20_util/enable_shared_from_this/56383.cc
new file mode 100644
index 00000000000..ea0f28da8f5
--- /dev/null
+++ b/libstdc++-v3/testsuite/20_util/enable_shared_from_this/56383.cc
@@ -0,0 +1,56 @@
+// Copyright (C) 2015 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library 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 library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// { dg-options "-std=gnu++11" }
+
+#include <memory>
+#include <testsuite_hooks.h>
+
+struct A : std::enable_shared_from_this<A>
+{
+ void* a() { return shared_from_this().get(); }
+};
+
+struct B : std::enable_shared_from_this<B>
+{
+};
+
+struct D : A, B
+{
+};
+
+void test01()
+{
+ bool test = false;
+
+ auto d = std::make_shared<D>();
+ try
+ {
+ d->a();
+ }
+ catch (const std::bad_weak_ptr&)
+ {
+ test = true;
+ }
+ VERIFY(test);
+}
+
+int
+main()
+{
+ test01();
+}
diff --git a/libstdc++-v3/testsuite/20_util/function/68995.cc b/libstdc++-v3/testsuite/20_util/function/68995.cc
new file mode 100644
index 00000000000..75dafb4776b
--- /dev/null
+++ b/libstdc++-v3/testsuite/20_util/function/68995.cc
@@ -0,0 +1,32 @@
+// Copyright (C) 2015 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library 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 library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// { dg-options "-std=gnu++11" }
+// { dg-do compile }
+
+#include <tr1/memory>
+#include <functional>
+#include <tr1/functional>
+
+std::tr1::shared_ptr<int> test() { return {}; }
+
+std::function<std::tr1::shared_ptr<int>()> func = test;
+std::function<std::tr1::shared_ptr<int>()> funcr = std::ref(test);
+
+void test2(std::tr1::shared_ptr<int>) { }
+
+std::function<void(std::tr1::shared_ptr<int>)> func2 = std::ref(test2);
diff --git a/libstdc++-v3/testsuite/20_util/shared_ptr/cons/58659.cc b/libstdc++-v3/testsuite/20_util/shared_ptr/cons/58659.cc
index 6df3289fbb1..c68c7bfcd62 100644
--- a/libstdc++-v3/testsuite/20_util/shared_ptr/cons/58659.cc
+++ b/libstdc++-v3/testsuite/20_util/shared_ptr/cons/58659.cc
@@ -51,6 +51,14 @@ namespace std
allocated = false;
}
+ template<typename _Up, typename... _Args>
+ void construct(_Up* __p, _Args&&... __args)
+ { ::new(__p) _Up(std::forward<_Args>(__args)...); }
+
+ template<typename _Up>
+ void destroy(_Up* __p)
+ { __p->~_Up(); }
+
static char storage[sizeof(spcd)];
static bool allocated;
};
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/cons/char/69092.cc b/libstdc++-v3/testsuite/21_strings/basic_string/cons/char/69092.cc
new file mode 100644
index 00000000000..483708b948a
--- /dev/null
+++ b/libstdc++-v3/testsuite/21_strings/basic_string/cons/char/69092.cc
@@ -0,0 +1,58 @@
+// Copyright (C) 2016 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library 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 library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// { dg-options "-std=gnu++11" }
+
+// PR libstdc++/69092
+
+#include <string>
+#include <iterator>
+
+struct hate_T_iterator : std::iterator<std::forward_iterator_tag, char> {
+ explicit hate_T_iterator(char* p) : p(p) {}
+ char* p;
+
+ hate_T_iterator& operator++() { ++p; return *this; }
+
+ hate_T_iterator operator++(int)
+ {
+ hate_T_iterator r = *this;
+ ++*this; return r;
+ }
+
+ char& operator*() const
+ {
+ if (*p == 'T')
+ throw 1;
+ return *p;
+ }
+
+ char* operator->() const { return p; }
+
+ bool operator== (hate_T_iterator other) const { return p == other.p;}
+ bool operator!= (hate_T_iterator other) const { return p != other.p;}
+};
+
+int main()
+{
+ char test_str[4] = "ATA";
+ try {
+ std::string s(hate_T_iterator(test_str), hate_T_iterator(test_str+3));
+ }
+ catch(int) {
+ }
+}
diff --git a/libstdc++-v3/testsuite/25_algorithms/copy/move_iterators/69478.cc b/libstdc++-v3/testsuite/25_algorithms/copy/move_iterators/69478.cc
new file mode 100644
index 00000000000..707b273c83e
--- /dev/null
+++ b/libstdc++-v3/testsuite/25_algorithms/copy/move_iterators/69478.cc
@@ -0,0 +1,40 @@
+// { dg-options "-std=gnu++11" }
+// { dg-do compile }
+
+// Copyright (C) 2016 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library 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 library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// PR libstdc++/69478
+
+#include <algorithm>
+#include <iterator>
+
+void
+test01()
+{
+ // A move-only type that is also a trivial class.
+ struct trivial_rvalstruct
+ {
+ trivial_rvalstruct() = default;
+ trivial_rvalstruct(trivial_rvalstruct&&) = default;
+ trivial_rvalstruct& operator=(trivial_rvalstruct&&) = default;
+ };
+ static_assert(std::is_trivial<trivial_rvalstruct>::value, "");
+
+ trivial_rvalstruct a[1], b[1];
+ copy(std::make_move_iterator(a), std::make_move_iterator(a + 1), b);
+}
diff --git a/libstdc++-v3/testsuite/25_algorithms/copy_backward/move_iterators/69478.cc b/libstdc++-v3/testsuite/25_algorithms/copy_backward/move_iterators/69478.cc
new file mode 100644
index 00000000000..e00d146996f
--- /dev/null
+++ b/libstdc++-v3/testsuite/25_algorithms/copy_backward/move_iterators/69478.cc
@@ -0,0 +1,40 @@
+// { dg-options "-std=gnu++11" }
+// { dg-do compile }
+
+// Copyright (C) 2016 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library 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 library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// PR libstdc++/69478
+
+#include <algorithm>
+#include <iterator>
+
+void
+test01()
+{
+ // A move-only type that is also a trivial class.
+ struct trivial_rvalstruct
+ {
+ trivial_rvalstruct() = default;
+ trivial_rvalstruct(trivial_rvalstruct&&) = default;
+ trivial_rvalstruct& operator=(trivial_rvalstruct&&) = default;
+ };
+ static_assert(std::is_trivial<trivial_rvalstruct>::value, "");
+
+ trivial_rvalstruct a[1], b[1];
+ copy_backward(std::make_move_iterator(a), std::make_move_iterator(a+1), b);
+}
diff --git a/libstdc++-v3/testsuite/25_algorithms/move/69478.cc b/libstdc++-v3/testsuite/25_algorithms/move/69478.cc
new file mode 100644
index 00000000000..791e0bfcff6
--- /dev/null
+++ b/libstdc++-v3/testsuite/25_algorithms/move/69478.cc
@@ -0,0 +1,40 @@
+// { dg-options "-std=gnu++11" }
+// { dg-do compile }
+
+// Copyright (C) 2016 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library 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 library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// PR libstdc++/69478
+
+#include <algorithm>
+#include <iterator>
+
+void
+test01()
+{
+ // A move-only type that is also a trivial class.
+ struct trivial_rvalstruct
+ {
+ trivial_rvalstruct() = default;
+ trivial_rvalstruct(trivial_rvalstruct&&) = default;
+ trivial_rvalstruct& operator=(trivial_rvalstruct&&) = default;
+ };
+ static_assert(std::is_trivial<trivial_rvalstruct>::value, "");
+
+ trivial_rvalstruct a[1], b[1];
+ std::move(a, a + 1, b);
+}
diff --git a/libstdc++-v3/testsuite/25_algorithms/move_backward/69478.cc b/libstdc++-v3/testsuite/25_algorithms/move_backward/69478.cc
new file mode 100644
index 00000000000..8ca198fc2c1
--- /dev/null
+++ b/libstdc++-v3/testsuite/25_algorithms/move_backward/69478.cc
@@ -0,0 +1,40 @@
+// { dg-options "-std=gnu++11" }
+// { dg-do compile }
+
+// Copyright (C) 2016 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library 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 library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// PR libstdc++/69478
+
+#include <algorithm>
+#include <iterator>
+
+void
+test01()
+{
+ // A move-only type that is also a trivial class.
+ struct trivial_rvalstruct
+ {
+ trivial_rvalstruct() = default;
+ trivial_rvalstruct(trivial_rvalstruct&&) = default;
+ trivial_rvalstruct& operator=(trivial_rvalstruct&&) = default;
+ };
+ static_assert(std::is_trivial<trivial_rvalstruct>::value, "");
+
+ trivial_rvalstruct a[1], b[1];
+ std::move_backward(a, a + 1, b);
+}
diff --git a/libstdc++-v3/testsuite/26_numerics/headers/cmath/60637.cc b/libstdc++-v3/testsuite/26_numerics/headers/cmath/60637.cc
new file mode 100644
index 00000000000..16a78963e6c
--- /dev/null
+++ b/libstdc++-v3/testsuite/26_numerics/headers/cmath/60637.cc
@@ -0,0 +1,35 @@
+// Copyright (C) 2016 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library 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 library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// { dg-options "-std=gnu++98 -ffast-math" }
+// { dg-do run { target i?86-*-* x86_64-*-* } }
+
+#include <cmath>
+#include <testsuite_hooks.h>
+
+void
+test01()
+{
+ long double ld = -5.3165867831218916301793863361917824e-2467L;
+ VERIFY( std::signbit(ld) == 1 );
+}
+
+int
+main()
+{
+ test01();
+}
diff --git a/libstdc++-v3/testsuite/26_numerics/headers/cmath/c99_classification_macros_c.cc b/libstdc++-v3/testsuite/26_numerics/headers/cmath/c99_classification_macros_c.cc
index 5799344738c..06dd132babe 100644
--- a/libstdc++-v3/testsuite/26_numerics/headers/cmath/c99_classification_macros_c.cc
+++ b/libstdc++-v3/testsuite/26_numerics/headers/cmath/c99_classification_macros_c.cc
@@ -20,7 +20,7 @@
// { dg-do compile }
// { dg-add-options no_pch }
-// { dg-xfail-if "" { { *-*-linux* *-*-gnu* *-*-darwin* *-*-solaris2.1[0-9]* hppa*-*-hpux* *-*-mingw* } || { uclibc || newlib } } { "*" } { "" } }
+// { dg-xfail-if "" { { *-*-linux* *-*-gnu* *-*-darwin* *-*-solaris2.10* hppa*-*-hpux* *-*-mingw* } || { uclibc || newlib } } { "*" } { "" } }
// { dg-excess-errors "" { target { { *-*-linux* *-*-gnu* *-*-darwin* *-*-solaris2.1[0-9]* hppa*-*-hpux* *-*-mingw* } || { uclibc || newlib } } } }
#include <math.h>
diff --git a/libstdc++-v3/testsuite/26_numerics/valarray/69116.cc b/libstdc++-v3/testsuite/26_numerics/valarray/69116.cc
new file mode 100644
index 00000000000..ef9826778cf
--- /dev/null
+++ b/libstdc++-v3/testsuite/26_numerics/valarray/69116.cc
@@ -0,0 +1,53 @@
+// Copyright (C) 2016 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library 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 library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// { dg-do compile }
+// { dg-options "-std=gnu++98" }
+
+// libstdc++/69116
+
+#include <exception>
+#include <valarray>
+
+template<typename T>
+ void foo(const T&) { }
+
+struct X : std::exception // makes namespace std an associated namespace
+{
+ virtual void pure() = 0;
+
+ typedef void(*func_type)(const X&);
+
+ void operator+(func_type) const;
+ void operator-(func_type) const;
+ void operator*(func_type) const;
+ void operator/(func_type) const;
+ void operator%(func_type) const;
+ void operator<<(func_type) const;
+ void operator>>(func_type) const;
+};
+
+void foo(X& x)
+{
+ x + foo;
+ x - foo;
+ x * foo;
+ x / foo;
+ x % foo;
+ x << foo;
+ x >> foo;
+}
diff --git a/libstdc++-v3/testsuite/28_regex/algorithms/regex_match/ecma/char/68863.cc b/libstdc++-v3/testsuite/28_regex/algorithms/regex_match/ecma/char/68863.cc
new file mode 100644
index 00000000000..9e7a9a73614
--- /dev/null
+++ b/libstdc++-v3/testsuite/28_regex/algorithms/regex_match/ecma/char/68863.cc
@@ -0,0 +1,43 @@
+// { dg-options "-std=gnu++11" }
+
+// Copyright (C) 2015 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+//
+// This library 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 library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// 28.11.2 regex_match
+
+#include <regex>
+#include <testsuite_hooks.h>
+#include <testsuite_regex.h>
+
+using namespace __gnu_test;
+using namespace std;
+
+// libstdc++/68863
+void
+test01()
+{
+ bool test __attribute__((unused)) = true;
+
+ VERIFY(!std::regex_match("aa", std::regex("(.)(?!\\1).")));
+}
+
+int
+main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/30_threads/thread/70503.cc b/libstdc++-v3/testsuite/30_threads/thread/70503.cc
new file mode 100644
index 00000000000..3b64ef8d2de
--- /dev/null
+++ b/libstdc++-v3/testsuite/30_threads/thread/70503.cc
@@ -0,0 +1,38 @@
+// Copyright (C) 2016 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library 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 library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// { dg-do link }
+// { dg-options "-std=gnu++11 -static" { target *-*-*gnu* } }
+// { dg-require-cstdint "" }
+// { dg-require-gthreads "" }
+// { dg-require-effective-target static }
+
+#include <thread>
+
+extern "C" {
+ // Should not get multiple definition errors from libstdc++.a(thread.o)
+ void execute_native_thread_routine(void) { }
+ void execute_native_thread_routine_compat(void) { }
+}
+
+int main()
+{
+ execute_native_thread_routine();
+ execute_native_thread_routine_compat();
+
+ std::thread{}.detach(); // ensure libstdc++.a(thread.o) is linked in
+}
diff --git a/libvtv/ChangeLog b/libvtv/ChangeLog
index 76198a8925b..77a973af32b 100644
--- a/libvtv/ChangeLog
+++ b/libvtv/ChangeLog
@@ -1,3 +1,7 @@
+2016-08-03 Release Manager
+
+ * GCC 4.9.4 released.
+
2015-06-26 Release Manager
* GCC 4.9.3 released.
diff --git a/lto-plugin/ChangeLog b/lto-plugin/ChangeLog
index 3558b371134..fbb0f3da585 100644
--- a/lto-plugin/ChangeLog
+++ b/lto-plugin/ChangeLog
@@ -1,3 +1,7 @@
+2016-08-03 Release Manager
+
+ * GCC 4.9.4 released.
+
2015-06-26 Release Manager
* GCC 4.9.3 released.
diff --git a/maintainer-scripts/ChangeLog b/maintainer-scripts/ChangeLog
index c209b5c796a..23ce6e36971 100644
--- a/maintainer-scripts/ChangeLog
+++ b/maintainer-scripts/ChangeLog
@@ -1,3 +1,7 @@
+2016-08-03 Release Manager
+
+ * GCC 4.9.4 released.
+
2015-06-26 Release Manager
* GCC 4.9.3 released.
diff --git a/zlib/ChangeLog b/zlib/ChangeLog
index b1c429b87f9..5e32a38f48f 100644
--- a/zlib/ChangeLog
+++ b/zlib/ChangeLog
@@ -1,3 +1,7 @@
+2016-08-03 Release Manager
+
+ * GCC 4.9.4 released.
+
2015-06-26 Release Manager
* GCC 4.9.3 released.