aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYvan Roux <yvan.roux@linaro.org>2013-02-05 20:52:28 +0100
committerYvan Roux <yvan.roux@linaro.org>2013-02-05 20:52:28 +0100
commit66be58c6579ecaf79bee7485a34b4be4246781ba (patch)
tree4ad20a3a1d0c63d7ef5c92710fc452eb1b3fe2b5
parentcccb3dabc36e0c1a98ff7c673f413482eb26bea1 (diff)
Merge from FSF GCC 4.7.3 (svn branches/gcc-4_7-branch 195745).
-rw-r--r--ChangeLog.linaro6
-rw-r--r--gcc/ChangeLog465
-rw-r--r--gcc/DATESTAMP2
-rw-r--r--gcc/Makefile.in17
-rw-r--r--gcc/ada/ChangeLog12
-rw-r--r--gcc/ada/gcc-interface/decl.c9
-rw-r--r--gcc/ada/gnat_rm.texi24
-rw-r--r--gcc/builtins.c9
-rw-r--r--gcc/cfgcleanup.c26
-rw-r--r--gcc/cfgrtl.c34
-rw-r--r--gcc/cgraph.c1
-rw-r--r--gcc/cgraph.h1
-rw-r--r--gcc/config.gcc7
-rw-r--r--gcc/config/alpha/t-linux1
-rw-r--r--gcc/config/arm/arm.c71
-rw-r--r--gcc/config/arm/arm.md12
-rw-r--r--gcc/config/arm/t-linux-eabi7
-rw-r--r--gcc/config/avr/avr-c.c13
-rw-r--r--gcc/config/avr/avr-mcus.def49
-rw-r--r--gcc/config/avr/avr.c70
-rw-r--r--gcc/config/avr/avr.h9
-rw-r--r--gcc/config/avr/t-avr23
-rw-r--r--gcc/config/i386/constraints.md5
-rw-r--r--gcc/config/i386/cpuid.h39
-rw-r--r--gcc/config/i386/i386-c.c24
-rw-r--r--gcc/config/i386/i386.c7
-rw-r--r--gcc/config/i386/i386.md211
-rw-r--r--gcc/config/i386/sse.md6
-rw-r--r--gcc/config/i386/sync.md13
-rw-r--r--gcc/config/ia64/t-linux1
-rw-r--r--gcc/config/m68k/t-linux6
-rw-r--r--gcc/config/mips/t-linux647
-rw-r--r--gcc/config/pa/pa.c10
-rw-r--r--gcc/config/pa/pa.md6
-rw-r--r--gcc/config/pa/t-linux1
-rw-r--r--gcc/config/rs6000/t-fprules15
-rw-r--r--gcc/config/rs6000/t-linux9
-rw-r--r--gcc/config/rs6000/t-linux644
-rw-r--r--gcc/config/s390/t-linux643
-rw-r--r--gcc/config/sparc/t-linux1
-rw-r--r--gcc/config/sparc/t-linux645
-rwxr-xr-xgcc/configure36
-rw-r--r--gcc/configure.ac26
-rw-r--r--gcc/cp/ChangeLog102
-rw-r--r--gcc/cp/call.c26
-rw-r--r--gcc/cp/cp-objcp-common.c19
-rw-r--r--gcc/cp/cp-objcp-common.h2
-rw-r--r--gcc/cp/cp-tree.h2
-rw-r--r--gcc/cp/decl.c28
-rw-r--r--gcc/cp/except.c16
-rw-r--r--gcc/cp/init.c4
-rw-r--r--gcc/cp/name-lookup.c6
-rw-r--r--gcc/cp/parser.c3
-rw-r--r--gcc/cp/pt.c15
-rw-r--r--gcc/cp/semantics.c11
-rw-r--r--gcc/cp/tree.c42
-rw-r--r--gcc/cp/typeck.c3
-rw-r--r--gcc/cp/typeck2.c2
-rw-r--r--gcc/cppdefault.h2
-rw-r--r--gcc/doc/extend.texi8
-rw-r--r--gcc/doc/install.texi19
-rw-r--r--gcc/doc/invoke.texi3
-rw-r--r--gcc/emit-rtl.c7
-rw-r--r--gcc/expr.c48
-rw-r--r--gcc/fold-const.c27
-rw-r--r--gcc/fortran/ChangeLog81
-rw-r--r--gcc/fortran/class.c30
-rw-r--r--gcc/fortran/decl.c31
-rw-r--r--gcc/fortran/expr.c15
-rw-r--r--gcc/fortran/gfortran.h12
-rw-r--r--gcc/fortran/module.c13
-rw-r--r--gcc/fortran/parse.c7
-rw-r--r--gcc/fortran/resolve.c237
-rw-r--r--gcc/fortran/simplify.c4
-rw-r--r--gcc/fortran/trans-array.c10
-rw-r--r--gcc/fortran/trans-decl.c9
-rw-r--r--gcc/fortran/trans-expr.c136
-rw-r--r--gcc/function.c2
-rw-r--r--gcc/gimple-low.c9
-rw-r--r--gcc/gimple.c55
-rw-r--r--gcc/gimple.h1
-rw-r--r--gcc/graphite-dependences.c4
-rw-r--r--gcc/haifa-sched.c3
-rw-r--r--gcc/ipa-inline-transform.c4
-rw-r--r--gcc/ipa.c4
-rw-r--r--gcc/langhooks-def.h2
-rw-r--r--gcc/langhooks.h4
-rw-r--r--gcc/loop-iv.c4
-rw-r--r--gcc/testsuite/ChangeLog281
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/constexpr-ctor11.C16
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/constexpr-ctor12.C14
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/decltype48.C16
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/initlist-protected.C23
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/noexcept18.C11
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/noexcept19.C29
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/noexcept20.C22
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/vt-55542.C22
-rw-r--r--gcc/testsuite/g++.dg/ext/has_nothrow_constructor-2.C7
-rw-r--r--gcc/testsuite/g++.dg/ext/visibility/anon11.C13
-rw-r--r--gcc/testsuite/g++.dg/init/array33.C22
-rw-r--r--gcc/testsuite/g++.dg/init/array34.C15
-rw-r--r--gcc/testsuite/g++.dg/init/const9.C12
-rw-r--r--gcc/testsuite/g++.dg/ipa/pr55264.C17
-rw-r--r--gcc/testsuite/g++.dg/tree-ssa/pr53844.C78
-rw-r--r--gcc/testsuite/g++.dg/warn/Wreturn-type-8.C90
-rw-r--r--gcc/testsuite/g++.dg/warn/pmf2.C24
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/pr55921.c22
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/builtins/builtins.exp4
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/pr56051.c32
-rw-r--r--gcc/testsuite/gcc.dg/lto/pr55660_0.c11
-rw-r--r--gcc/testsuite/gcc.dg/lto/pr55660_1.c15
-rw-r--r--gcc/testsuite/gcc.dg/pr44061.c16
-rw-r--r--gcc/testsuite/gcc.dg/pr49069.c15
-rw-r--r--gcc/testsuite/gcc.dg/pr55094.c45
-rw-r--r--gcc/testsuite/gcc.dg/pr55236.c31
-rw-r--r--gcc/testsuite/gcc.dg/pr55838.c13
-rw-r--r--gcc/testsuite/gcc.dg/pr55940.c54
-rw-r--r--gcc/testsuite/gcc.dg/pr56023.c19
-rw-r--r--gcc/testsuite/gcc.dg/pr56098-1.c16
-rw-r--r--gcc/testsuite/gcc.dg/pr56125.c21
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr54127.c16
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr55755.c43
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr55882.c94
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr55890-1.c6
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr55890-2.c4
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr55890-3.c9
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/pr45144.c2
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/sra-13.c114
-rw-r--r--gcc/testsuite/gcc.target/arm/combine-movs.c3
-rw-r--r--gcc/testsuite/gcc.target/arm/neon-vset_lanes8.c7
-rw-r--r--gcc/testsuite/gcc.target/arm/pr42879.c3
-rw-r--r--gcc/testsuite/gcc.target/arm/pr51835.c9
-rw-r--r--gcc/testsuite/gcc.target/arm/pr51915.c2
-rw-r--r--gcc/testsuite/gcc.target/arm/pr52006.c2
-rw-r--r--gcc/testsuite/gcc.target/arm/pr53187.c2
-rw-r--r--gcc/testsuite/gcc.target/arm/thumb-find-work-register.c40
-rw-r--r--gcc/testsuite/gcc.target/arm/unsigned-extend-1.c2
-rw-r--r--gcc/testsuite/gcc.target/i386/movsd.c15
-rw-r--r--gcc/testsuite/gcc.target/i386/pr56028.c54
-rw-r--r--gcc/testsuite/gcc.target/pr55981.c54
-rw-r--r--gcc/testsuite/gfortran.dg/block_12.f906
-rw-r--r--gcc/testsuite/gfortran.dg/class_55.f9012
-rw-r--r--gcc/testsuite/gfortran.dg/elemental_scalar_args_2.f9036
-rw-r--r--gcc/testsuite/gfortran.dg/gomp/pr56052.f9016
-rw-r--r--gcc/testsuite/gfortran.dg/internal_pack_13.f9034
-rw-r--r--gcc/testsuite/gfortran.dg/internal_pack_14.f9034
-rw-r--r--gcc/testsuite/gfortran.dg/intrinsic_size_3.f9026
-rw-r--r--gcc/testsuite/gfortran.dg/module_error_1.f905
-rw-r--r--gcc/testsuite/gfortran.dg/pr56015.f9016
-rw-r--r--gcc/testsuite/gfortran.dg/select_8.f9012
-rw-r--r--gcc/testsuite/gfortran.dg/use_22.f9035
-rw-r--r--gcc/testsuite/gfortran.dg/use_23.f9042
-rw-r--r--gcc/testsuite/gfortran.dg/use_24.f9053
-rw-r--r--gcc/testsuite/gfortran.dg/use_25.f9039
-rw-r--r--gcc/testsuite/gfortran.dg/use_26.f9076
-rw-r--r--gcc/testsuite/gfortran.dg/use_27.f90103
-rw-r--r--gcc/testsuite/gnat.dg/alignment10.adb20
-rw-r--r--gcc/testsuite/gnat.dg/opt26.adb37
-rw-r--r--gcc/testsuite/lib/target-supports.exp3
-rw-r--r--gcc/tree-complex.c36
-rw-r--r--gcc/tree-sra.c6
-rw-r--r--gcc/tree-ssa-ccp.c8
-rw-r--r--gcc/tree-ssa-dse.c12
-rw-r--r--gcc/tree-ssa-math-opts.c14
-rw-r--r--gcc/tree-ssa-phiopt.c9
-rw-r--r--gcc/tree-ssa-strlen.c6
-rw-r--r--gcc/tree-ssa-structalias.c34
-rw-r--r--gcc/tree-streamer.c10
-rw-r--r--gcc/tree-vect-data-refs.c2
-rw-r--r--gcc/tree-vect-loop.c4
-rw-r--r--gcc/tree-vectorizer.h2
-rw-r--r--gcc/tree-vrp.c16
-rw-r--r--gcc/tree.c5
-rw-r--r--include/ChangeLog10
-rw-r--r--include/md5.h5
-rw-r--r--include/sha1.h5
-rw-r--r--libiberty/ChangeLog19
-rw-r--r--libiberty/md5.c15
-rw-r--r--libiberty/sha1.c3
-rw-r--r--libjava/classpath/ChangeLog5
-rw-r--r--libjava/classpath/lib/gnu/gcj/convert/Convert.classbin4799 -> 4799 bytes
-rw-r--r--libjava/classpath/lib/gnu/gcj/tools/gcj_dbtool/Main.classbin10918 -> 10918 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/locale/LocaleData.classbin7402 -> 7402 bytes
-rw-r--r--libjava/classpath/lib/gnu/java/rmi/registry/RegistryImpl.classbin4244 -> 4244 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$10.classbin1221 -> 1691 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$11.classbin1728 -> 1728 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$12.classbin1799 -> 1799 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$13.classbin1800 -> 1800 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$14.classbin1002 -> 1002 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$15.classbin924 -> 924 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$16.classbin1715 -> 1715 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$17.classbin828 -> 828 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$18.classbin809 -> 809 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$19.classbin809 -> 809 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$20.classbin1382 -> 1382 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$21.classbin1401 -> 1401 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$22.classbin809 -> 809 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$23.classbin809 -> 809 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$24.classbin809 -> 809 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$25.classbin809 -> 809 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main.classbin29338 -> 29338 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/orbd/Main$1.classbin1106 -> 1106 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/orbd/Main$2.classbin1052 -> 1052 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/orbd/Main$3.classbin1048 -> 1048 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/orbd/Main$4.classbin969 -> 969 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/orbd/Main$5.classbin721 -> 721 bytes
-rw-r--r--libjava/classpath/tools/classes/gnu/classpath/tools/orbd/Main.classbin5476 -> 5476 bytes
-rw-r--r--libjava/classpath/tools/gnu/classpath/tools/gjdoc/Main.java11
-rw-r--r--libquadmath/ChangeLog8
-rw-r--r--libquadmath/libquadmath.texi4
-rw-r--r--libstdc++-v3/ChangeLog19
-rw-r--r--libstdc++-v3/doc/xml/manual/abi.xml8
-rw-r--r--libstdc++-v3/doc/xml/manual/status_cxx2011.xml21
-rw-r--r--libstdc++-v3/include/std/complex6
-rw-r--r--libstdc++-v3/src/c++11/regex.cc9
215 files changed, 4236 insertions, 563 deletions
diff --git a/ChangeLog.linaro b/ChangeLog.linaro
index 6dabe6508ac..65d336902aa 100644
--- a/ChangeLog.linaro
+++ b/ChangeLog.linaro
@@ -1,4 +1,8 @@
-2012-02-05 Yvan Roux <yvan.roux@linaro.org>
+2013-02-05 Yvan Roux <yvan.roux@linaro.org>
+
+ Merge from FSF GCC 4.7.3 (svn branches/gcc-4_7-branch 195745).
+
+2013-02-05 Yvan Roux <yvan.roux@linaro.org>
Backport from mainline r193508
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index d36b2f80890..12850c1f57c 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,468 @@
+2013-02-04 Richard Biener <rguenther@suse.de>
+
+ Backport from mainline
+ 2012-01-11 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/44061
+ * tree-vrp.c (extract_range_basic): Compute zero as
+ value-range for __builtin_constant_p of function parameters.
+
+ 2013-01-08 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/55890
+ * tree-ssa-ccp.c (evaluate_stmt): Use gimple_call_builtin_class_p.
+
+2013-02-04 Richard Biener <rguenther@suse.de>
+
+ Backport from mainline
+ 2012-07-04 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/53844
+ * tree-ssa-dse.c (dse_possible_dead_store_p): Properly handle
+ the loop virtual PHI.
+
+ 2012-12-13 Richard Biener <rguenther@suse.de>
+
+ PR lto/55660
+ * tree-streamer.c (record_common_node): Check that we are not
+ recursively pre-loading nodes we want to skip. Handle
+ char_type_node appearing as part of va_list_type_node.
+
+2013-02-04 Richard Biener <rguenther@suse.de>
+
+ PR middle-end/55890
+ * gimple.h (gimple_call_builtin_class_p): New function.
+ * gimple.c (validate_call): New function.
+ (gimple_call_builtin_class_p): Likewise.
+ * tree-ssa-structalias.c (find_func_aliases_for_builtin_call):
+ Use gimple_call_builtin_class_p.
+ (find_func_clobbers): Likewise.
+ * tree-ssa-strlen.c (adjust_last_stmt): Likewise.
+ (strlen_optimize_stmt): Likewise.
+
+2013-02-01 Jakub Jelinek <jakub@redhat.com>
+
+ Backported from mainline
+ 2013-01-28 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/56125
+ * tree-ssa-math-opts.c (gimple_expand_builtin_pow): Don't optimize
+ pow(x,c) into sqrt(x) * powi(x, n/2) or
+ 1.0 / (sqrt(x) * powi(x, abs(n/2))) if c is an integer or when
+ optimizing for size.
+ Don't optimize pow(x,c) into powi(x, n/3) * powi(cbrt(x), n%3) or
+ 1.0 / (powi(x, abs(n)/3) * powi(cbrt(x), abs(n)%3)) if 2c is an
+ integer.
+
+ 2013-01-25 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/56098
+ * tree-ssa-phiopt.c (nt_init_block): Don't call add_or_mark_expr
+ for stmts with volatile ops.
+ (cond_store_replacement): Don't optimize if assign has volatile ops.
+ (cond_if_else_store_replacement_1): Don't optimize if either
+ then_assign or else_assign have volatile ops.
+
+ 2013-01-23 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/49069
+ * config/arm/arm.md (cbranchdi4, cstoredi4): Use s_register_operand
+ instead of cmpdi_operand for first comparison operand.
+ Don't assert that comparison operands aren't both constants.
+
+ 2013-01-21 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/56051
+ * fold-const.c (fold_binary_loc): Don't fold
+ X < (cast) (1 << Y) into (X >> Y) != 0 if cast is either
+ a narrowing conversion, or widening conversion from signed
+ to unsigned.
+
+ 2013-01-18 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/56015
+ * expr.c (expand_expr_real_2) <case COMPLEX_EXPR>: Handle
+ the case where writing real complex part of target modifies
+ op1.
+
+ 2013-01-15 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/55940
+ * function.c (thread_prologue_and_epilogue_insns): Always
+ add crtl->drap_reg to set_up_by_prologue.set, even if
+ stack_realign_drap is false.
+
+ 2013-01-10 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/55921
+ * tree-complex.c (expand_complex_asm): New function.
+ (expand_complex_operations_1): Call it for GIMPLE_ASM.
+
+ 2013-01-03 Jakub Jelinek <jakub@redhat.com>
+
+ PR rtl-optimization/55838
+ * loop-iv.c (iv_number_of_iterations): Call lowpart_subreg on
+ iv0.step, iv1.step and step.
+
+ 2012-11-23 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/54046
+ * Makefile.in (gimple-low.o): Depend on langhooks.h.
+ * gimple-low.c: Include langhooks.c.
+ (block_may_fallthru): Handle TARGET_EXPR and ERROR_MARK,
+ by default call lang_hooks.block_may_fallthru.
+ * langhooks.h (struct lang_hooks): Add block_may_fallthru
+ langhook.
+ * langhooks-def.h (LANG_HOOKS_BLOCK_MAY_FALLTHRU): Define.
+ (LANG_HOOKS_INITIALIZER): Use it.
+
+ 2012-11-20 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/55094
+ * builtins.c (expand_builtin_trap): Add REG_ARGS_SIZE note
+ on the trap insn for !ACCUMULATE_OUTGOING_ARGS.
+ * cfgcleanup.c (outgoing_edges_match): Don't look at debug insns
+ on the first old_insns_match_p call. For !ACCUMULATE_OUTGOING_ARGS
+ fail if the last real insn doesn't have REG_ARGS_SIZE note.
+
+ 2012-11-17 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/55236
+ * fold-const.c (make_range_step) <case NEGATE_EXPR>: For -fwrapv
+ and signed ARG0_TYPE, force low and high to be non-NULL.
+
+ 2012-11-13 Jakub Jelinek <jakub@redhat.com>
+
+ PR rtl-optimization/54127
+ * cfgrtl.c (force_nonfallthru_and_redirect): When redirecting
+ asm goto labels from BB_HEAD (e->dest) to target bb, decrement
+ LABEL_NUSES of BB_HEAD (e->dest) and increment LABEL_NUSES of
+ BB_HEAD (target) appropriately and adjust JUMP_LABEL and/or
+ REG_LABEL_TARGET and REG_LABEL_OPERAND.
+
+2013-02-01 Eric Botcazou <ebotcazou@adacore.com>
+
+ * fold-const.c (make_range_step) <TRUTH_NOT_EXPR>: Bail out if the
+ range isn't testing for zero.
+
+2013-01-29 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/56113
+ * tree-ssa-structalias.c (equiv_class_lookup): Also return
+ the bitmap leader.
+ (label_visit): Free duplicate bitmaps and record the leader instead.
+ (perform_var_substitution): Adjust.
+
+2013-01-28 Serowk <serowk@yandex.ru>
+
+ PR target/35294
+ * config/arm/arm.c (arm_expand_binop_builtin): Add new parameter.
+ Fix mode checks to allow for the passing of constants in the
+ second parameter.
+ (arm_expand_builtin): Adjust calls to arm_expand_binop_builtin.
+ Add entries in the switch statement for builtin iwmmxt vector
+ shift and rotate builtins.
+
+2013-01-27 Uros Bizjak <ubizjak@gmail.com>
+
+ Backport from mainline
+ 2013-01-27 Uros Bizjak <ubizjak@gmail.com>
+
+ PR target/56114
+ * config/i386/i386.md (*movabs<mode>_1): Add square brackets around
+ operand 0 in movabs insn template for -masm=intel asm alternative.
+ (*movabs<mode>_2): Ditto for operand 1.
+
+2013-01-27 Uros Bizjak <ubizjak@gmail.com>
+
+ Backport from mainline
+ 2013-01-22 Uros Bizjak <ubizjak@gmail.com>
+
+ PR target/56028
+ * config/i386/i386.md (*movti_internal_rex64): Change (o,riF)
+ alternative to (o,r).
+ (*movdi_internal_rex64): Remove (!o,n) alternative.
+ (DImode immediate->memory splitter): Remove.
+ (DImode immediate->memory peephole2): Remove.
+ (movtf): Enable for TARGET_64BIT || TARGET_SSE.
+ (*movtf_internal_rex64): Rename from *movtf_internal. Change (!o,F*r)
+ alternative to (!o,*r).
+ (*movtf_internal_sse): New pattern.
+ (*movxf_internal_rex64): New pattern.
+ (*movxf_internal): Disable for TARGET_64BIT.
+ (*movdf_internal_rex64): Remove (!o,F) alternative.
+
+ 2013-01-23 Uros Bizjak <ubizjak@gmail.com>
+
+ * config/i386/i386.md (*movdf_internal_rex64): Disparage alternatives
+ involving stack registers slightly.
+
+ 2013-01-24 Uros Bizjak <ubizjak@gmail.com>
+
+ * config/i386/constraints.md (Yf): New constraint.
+ * config/i386/i386.md (*movdf_internal_rex64): Use Yf*f instead
+ of f constraint to conditionaly disable x87 register preferences.
+ (*movdf_internal): Ditto.
+ (*movsf_internal): Ditto.
+
+ 2012-01-24 Uros Bizjak <ubizjak@gmail.com>
+
+ * config/i386/i386.md (*movti_internal_rex64): Add (o,e) alternative.
+ (*movtf_internal_rex64): Add (!o,C) alternative
+ (*movxf_internal_rex64): Ditto.
+ (*movdf_internal_rex64): Add (?r,C) and (?m,C) alternatives.
+
+2013-01-25 Georg-Johann Lay <avr@gjlay.de>
+
+ * doc/invoke.texi (AVR Built-in Macros): Document __XMEGA__.
+
+2013-01-24 Martin Jambor <mjambor@suse.cz>
+
+ Backport from mainline
+ 2013-01-04 Martin Jambor <mjambor@suse.cz>
+
+ PR tree-optimization/55755
+ * tree-sra.c (sra_modify_assign): Do not check that an access has no
+ children when trying to avoid producing a VIEW_CONVERT_EXPR.
+
+2013-01-21 Uros Bizjak <ubizjak@gmail.com>
+
+ Backport from mainline
+ 2013-01-21 Uros Bizjak <ubizjak@gmail.com>
+
+ * config/i386/i386.md (enabled): Do not disable fma4 for TARGET_FMA.
+
+2013-01-21 Uros Bizjak <ubizjak@gmail.com>
+
+ PR rtl-optimization/56023
+ * haifa-sched.c (fix_inter_tick): Do not update ticks of instructions,
+ dependent on debug instruction.
+
+2013-01-21 Martin Jambor <mjambor@suse.cz>
+
+ Backport from mainline
+ 2013-01-17 Martin Jambor <mjambor@suse.cz>
+
+ PR tree-optimizations/55264
+ * cgraph.c (cgraph_create_virtual_clone): Mark clones as non-virtual.
+ * cgraph.h (cgraph_only_called_directly_p_or_aliased_p): Return false
+ for virtual functions.
+ * ipa-inline-transform.c (can_remove_node_now_p_1): Never return true
+ for virtual methods.
+ * ipa.c (cgraph_remove_unreachable_nodes): Never return true for
+ virtual methods before inlining is over.
+
+2013-01-17 Uros Bizjak <ubizjak@gmail.com>
+
+ Backport from mainline
+ 2012-01-17 Uros Bizjak <ubizjak@gmail.com>
+
+ PR target/55981
+ * config/i386/sync.md (atomic_store<mode>): Generate SWImode
+ store through atomic_store<mode>_1.
+ (atomic_store<mode>_1): Macroize insn using SWI mode iterator.
+
+2013-01-16 Richard Biener <rguenther@suse.de>
+
+ PR middle-end/55882
+ * emit-rtl.c (set_mem_attributes_minus_bitpos): Correctly
+ account for bitpos when computing alignment.
+
+2013-01-14 Georg-Johann Lay <avr@gjlay.de>
+
+ Backport from 2013-01-14 trunk r195169.
+
+ PR target/55974
+ * config/avr/avr-c.c (avr_cpu_cpp_builtins): Define __FLASH
+ etc. to 1 and not to __flash.
+ Use LL suffix for __INT24_MAX__ with -mint8.
+ Use ULL suffix for __UINT24_MAX__ with -mint8.
+
+2013-01-14 Matthias Klose <doko@ubuntu.com>
+
+ * doc/invoke.texi: Document -print-multiarch.
+ * doc/install.texi: Document --enable-multiarch.
+ * doc/fragments.texi: Document MULTILIB_OSDIRNAMES, MULTIARCH_DIRNAME.
+ * configure.ac: Add --enable-multiarch option.
+ Substitute with_cpu, with_float.
+ * configure: Regenerate.
+ * Makefile.in (s-mlib): Pass MULTIARCH_DIRNAME to genmultilib.
+ enable_multiarch, with_cpu, with_float: New macros.
+ if_multiarch: New macro, define in terms of enable_multiarch.
+ * genmultilib: Add new argument for the multiarch name.
+ * gcc.c (multiarch_dir): Define.
+ (for_each_path): Search for multiarch suffixes.
+ (driver_handle_option): Handle multiarch option.
+ (do_spec_1): Pass -imultiarch if defined.
+ (main): Print multiarch.
+ (set_multilib_dir): Separate multilib and multiarch names
+ from multilib_select.
+ (print_multilib_info): Ignore multiarch names in multilib_select.
+ * incpath.c (add_standard_paths): Search the multiarch include dirs.
+ * cppdefault.h (default_include): Document multiarch in multilib
+ member.
+ * cppdefault.c: [LOCAL_INCLUDE_DIR, STANDARD_INCLUDE_DIR] Add an
+ include directory for multiarch directories.
+ * common.opt: New options --print-multiarch and -imultilib.
+
+ * config.gcc <i[34567]86-*-linux* | x86_64-*-linux*> (tmake_file):
+ Include i386/t-linux.
+ <i[34567]86-*-kfreebsd*-gnu | x86_64-*-kfreebsd*-gnu> (tmake_file):
+ Include i386/t-kfreebsd.
+ <i[34567]86-*-gnu*> (tmake_file): Include i386/t-gnu.
+ * config/i386/t-linux64: Add multiarch names in
+ MULTILIB_OSDIRNAMES, define MULTIARCH_DIRNAME.
+ * config/i386/t-gnu: New file.
+ * config/i386/t-kfreebsd: Likewise.
+ * config/i386/t-linux: Likewise.
+
+ * config/sparc/t-linux64: Add multiarch names in MULTILIB_OSDIRNAMES.
+ * config/sparc/t-linux: New file; define MULTIARCH_DIRNAME.
+ * config.gcc <sparc-*-linux*> (tmake_file): Include sparc/t-linux
+ for 32bit non-biarch configurations.
+
+ * config/pa/t-linux: New file; define MULTIARCH_DIRNAME.
+ * config.gcc <hppa*64*-*-linux*, hppa*-*-linux*> (tmake_file):
+ Include pa/t-linux.
+
+ * config/mips/t-linux64: Add multiarch names in MULTILIB_OSDIRNAMES.
+
+ * config/arm/t-linux-eabi: Define MULTIARCH_DIRNAME for linux target.
+
+ * config/rs6000/t-linux64: Add multiarch names in MULTILIB_OSDIRNAMES.
+ * config/rs6000/t-linux: New file; define MULTIARCH_DIRNAME.
+ * config/rs6000/t-fprules (SOFT_FLOAT_CPUS): New macro. Add e300c2
+ to the list.
+ (MULTILIB_MATCHES_FLOAT): Define in terms of SOFT_FLOAT_CPUS.
+ * config.gcc <powerpc-*-linux* | powerpc64-*-linux*> (tmake_file):
+ Include rs6000/t-linux for 32bit non-biarch configurations.
+
+ * config/s390/t-linux64: Add multiarch names in MULTILIB_OSDIRNAMES.
+
+ * config/m68k/t-linux: Define MULTIARCH_DIRNAME.
+
+ * config/ia64/t-linux: New file; define MULTIARCH_DIRNAME.
+ * config.gcc <ia64*-*-linux*> (tmake_file): Include ia64/t-linux.
+
+ * config/alpha/t-linux: New file; define MULTIARCH_DIRNAME.
+ * config.gcc <alpha*-*-linux*> (tmake_file): Include alpha/t-linux.
+
+2013-01-14 Eric Botcazou <ebotcazou@adacore.com>
+
+ * tree-vectorizer.h (vect_get_single_scalar_iteraion_cost): Fix typo.
+ * tree-vect-loop.c (vect_get_single_scalar_iteraion_cost): Likewise.
+ (vect_estimate_min_profitable_iter): Adjust to above fix.
+ * tree-vect-data-refs.c (vect_peeling_hash_get_lowest_cost): Likewise.
+
+2013-01-11 Michael Meissner <meissner@linux.vnet.ibm.com>
+
+ Backport from mainline
+ 2013-01-11 Michael Meissner <meissner@linux.vnet.ibm.com>
+
+ * doc/extend.texi (X86 Built-in Functions): Add whitespace in
+ __builtin_ia32_paddb256 and __builtin_ia32_pavgb256
+ documentation. Add missing '__' in front of
+ __builtin_ia32_packssdw256.
+
+2013-01-09 Uros Bizjak <ubizjak@gmail.com>
+
+ Backport from mainline
+ 2013-01-09 Uros Bizjak <ubizjak@gmail.com>
+
+ * config/i386/sse.md (*vec_interleave_highv2df): Change mode
+ attribute of movddup insn to DF.
+ (*vec_interleave_lowv2df): Ditto.
+ (vec_dupv2df): Ditto.
+
+2013-01-07 Georg-Johann Lay <avr@gjlay.de>
+
+ Backport from 2013-01-07 trunk r194991, r194992.
+
+ PR target/55897
+ * doc/extend.texi (AVR Named Address Spaces): __memx goes into
+ .progmemx.data now.
+
+ * config/avr/avr.h (ADDR_SPACE_COUNT): New enum.
+ (avr_addrspace_t): Add .section_name field.
+ * config/avr/avr.c (progmem_section): Use ADDR_SPACE_COUNT as
+ array size.
+ (avr_addrspace): Same. Initialize .section_name. Remove last
+ NULL entry. Put __memx into .progmemx.data.
+ (progmem_section_prefix): Remove.
+ (avr_asm_init_sections): No need to initialize progmem_section.
+ (avr_asm_named_section): Use avr_addrspace[].section_name to get
+ section name prefix.
+ (avr_asm_select_section): Ditto. And use get_unnamed_section to
+ retrieve the progmem section.
+ * avr-c.c (avr_cpu_cpp_builtins): Use ADDR_SPACE_COUNT as loop
+ boundary to run over avr_addrspace[].
+ (avr_register_target_pragmas): Ditto.
+
+2013-01-07 Georg-Johann Lay <avr@gjlay.de>
+
+ Backport from 2013-01-07 trunk r194978.
+
+ PR target/54461
+ * doc/install.texi (Cross-Compiler-Specific Options): Document
+ --with-avrlibc.
+
+2013-01-07 Georg-Johann Lay <avr@gjlay.de>
+
+ Backport from 2013-01-07 trunk r194968.
+
+ PR other/55243
+ * config/avr/t-avr: Don't automatically rebuild
+ $(srcdir)/config/avr/t-multilib
+ $(srcdir)/config/avr/avr-tables.opt
+ (avr-mcus): New phony target to build them on request.
+ (s-avr-mlib): Remove.
+ * avr/avr-mcus.def: Adjust comments.
+
+2013-01-07 Terry Guo <terry.guo@arm.com>
+
+ Backport from mainline
+ 2012-12-19 Terry Guo <terry.guo@arm.com>
+
+ * config/arm/arm.c (thumb_find_work_register): Check argument
+ register number based on current PCS.
+
+2013-01-06 Uros Bizjak <ubizjak@gmail.com>
+
+ Backport from mainline
+ 2013-01-03 Uros Bizjak <ubizjak@gmail.com>
+
+ PR target/55712
+ * config/i386/i386-c.c (ix86_target_macros_internal): Depending on
+ selected code model, define __code_mode_small__, __code_model_medium__,
+ __code_model_large__, __code_model_32__ or __code_model_kernel__.
+ * config/i386/cpuid.h (__cpuid, __cpuid_count) [__i386__]: Prefix
+ xchg temporary register with %k. Declare temporary register as
+ early clobbered.
+ [__x86_64__]: For medium and large code models, preserve %rbx register.
+
+2013-01-03 Richard Henderson <rth@redhat.com>
+
+ * config/i386/i386.c (ix86_expand_move): Always assign to op1
+ after eliminating TLS symbols.
+
+2013-01-03 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
+
+ PR target/53789
+ * config/pa/pa.md (movsi): Revert previous change.
+ * config/pa/pa.c (pa_legitimate_constant_p): Reject all TLS symbol
+ references.
+
+2013-01-02 Rainer Emrich <rainer@emrich-ebersheim.de>
+
+ PR bootstrap/55707
+ * graphite-dependences.c (hash_poly_ddr_p): Cast from pointer via
+ intptr_t.
+
+2013-01-02 Jason Merrill <jason@redhat.com>
+
+ PR c++/55804
+ * tree.c (build_array_type_1): Revert earlier change.
+
2012-12-25 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
PR target/53789
diff --git a/gcc/DATESTAMP b/gcc/DATESTAMP
index 7fc77670b46..e81bb7b2625 100644
--- a/gcc/DATESTAMP
+++ b/gcc/DATESTAMP
@@ -1 +1 @@
-20130102
+20130205
diff --git a/gcc/Makefile.in b/gcc/Makefile.in
index 766668c1255..11ce56451e4 100644
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -552,6 +552,21 @@ else
if_multiarch =
endif
+# Multiarch support
+enable_multiarch = @enable_multiarch@
+with_cpu = @with_cpu@
+with_float = @with_float@
+ifeq ($(enable_multiarch),yes)
+ if_multiarch = $(1)
+else
+ ifeq ($(enable_multiarch),auto)
+ # SYSTEM_HEADER_DIR is makefile syntax, cannot be evaluated in configure.ac
+ if_multiarch = $(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib/*/crti.o),$(1))
+ else
+ if_multiarch =
+ endif
+endif
+
# ------------------------
# Installation directories
# ------------------------
@@ -2594,7 +2609,7 @@ gimple-low.o : gimple-low.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) \
$(DIAGNOSTIC_H) $(GIMPLE_H) $(TREE_INLINE_H) langhooks.h \
$(LANGHOOKS_DEF_H) $(TREE_FLOW_H) $(TIMEVAR_H) $(TM_H) coretypes.h \
$(EXCEPT_H) $(FLAGS_H) $(RTL_H) $(FUNCTION_H) $(EXPR_H) $(TREE_PASS_H) \
- $(HASHTAB_H) $(DIAGNOSTIC_CORE_H) tree-iterator.h
+ $(HASHTAB_H) $(DIAGNOSTIC_CORE_H) tree-iterator.h langhooks.h
omp-low.o : omp-low.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
$(RTL_H) $(GIMPLE_H) $(TREE_INLINE_H) langhooks.h $(DIAGNOSTIC_CORE_H) \
$(TREE_FLOW_H) $(TIMEVAR_H) $(FLAGS_H) $(EXPR_H) $(DIAGNOSTIC_CORE_H) \
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 75c12234aa5..245a0d28623 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,15 @@
+2013-01-06 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gcc-interface/decl.c (gnat_to_gnu_entity) <discrete_type>: Do not
+ pack the field of the record type made for a misaligned type.
+
+2013-01-06 Eric Botcazou <ebotcazou@adacore.com>
+
+ Backport from mainline
+ 2013-01-04 Robert Dewar <dewar@adacore.com>
+
+ * gnat_rm.texi: Document alignment choice for subtypes.
+
2012-12-21 Ed Schonberg <schonberg@adacore.com>
PR ada/53737
diff --git a/gcc/ada/gcc-interface/decl.c b/gcc/ada/gcc-interface/decl.c
index 97f8d65d2f5..9ae5b4bf85f 100644
--- a/gcc/ada/gcc-interface/decl.c
+++ b/gcc/ada/gcc-interface/decl.c
@@ -1896,8 +1896,10 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
}
/* If the type we are dealing with has got a smaller alignment than the
- natural one, we need to wrap it up in a record type and under-align
- the latter. We reuse the padding machinery for this purpose. */
+ natural one, we need to wrap it up in a record type and misalign the
+ latter; we reuse the padding machinery for this purpose. Note that,
+ even if the record type is marked as packed because of misalignment,
+ we don't pack the field so as to give it the size of the type. */
else if (align > 0)
{
tree gnu_field_type, gnu_field;
@@ -1927,7 +1929,8 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
a bitfield. */
gnu_field
= create_field_decl (get_identifier ("F"), gnu_field_type,
- gnu_type, NULL_TREE, bitsize_zero_node, 1, 0);
+ gnu_type, TYPE_SIZE (gnu_field_type),
+ bitsize_zero_node, 0, 0);
finish_record_type (gnu_type, gnu_field, 2, debug_info_p);
compute_record_mode (gnu_type);
diff --git a/gcc/ada/gnat_rm.texi b/gcc/ada/gnat_rm.texi
index 9b10794e5c9..7aee128949f 100644
--- a/gcc/ada/gnat_rm.texi
+++ b/gcc/ada/gnat_rm.texi
@@ -11258,6 +11258,30 @@ The default alignment for the type @code{V} is 4, as a result of the
Integer field in the record, but it is permissible, as shown, to
override the default alignment of the record with a smaller value.
+@cindex Alignment, subtypes
+Note that according to the Ada standard, an alignment clause applies only
+to the first named subtype. If additional subtypes are declared, then the
+compiler is allowed to choose any alignment it likes, and there is no way
+to control this choice. Consider:
+
+@smallexample @c ada
+ type R is range 1 .. 10_000;
+ for R'Alignment use 1;
+ subtype RS is R range 1 .. 1000;
+@end smallexample
+
+@noindent
+The alignment clause specifies an alignment of 1 for the first named subtype
+@code{R} but this does not necessarily apply to @code{RS}. When writing
+portable Ada code, you should avoid writing code that explicitly or
+implicitly relies on the alignment of such subtypes.
+
+For the GNAT compiler, if an explicit alignment clause is given, this
+value is also used for any subsequent subtypes. So for GNAT, in the
+above example, you can count on the alignment of @code{RS} being 1. But this
+assumption is non-portable, and other compilers may choose different
+alignments for the subtype @code{RS}.
+
@node Size Clauses
@section Size Clauses
@cindex Size Clause
diff --git a/gcc/builtins.c b/gcc/builtins.c
index d952579676f..566220569c3 100644
--- a/gcc/builtins.c
+++ b/gcc/builtins.c
@@ -4727,7 +4727,14 @@ expand_builtin_trap (void)
{
#ifdef HAVE_trap
if (HAVE_trap)
- emit_insn (gen_trap ());
+ {
+ rtx insn = emit_insn (gen_trap ());
+ /* For trap insns when not accumulating outgoing args force
+ REG_ARGS_SIZE note to prevent crossjumping of calls with
+ different args sizes. */
+ if (!ACCUMULATE_OUTGOING_ARGS)
+ add_reg_note (insn, REG_ARGS_SIZE, GEN_INT (stack_pointer_delta));
+ }
else
#endif
emit_library_call (abort_libfunc, LCT_NORETURN, VOIDmode, 0);
diff --git a/gcc/cfgcleanup.c b/gcc/cfgcleanup.c
index b59cf7bc9f0..6ff161425fe 100644
--- a/gcc/cfgcleanup.c
+++ b/gcc/cfgcleanup.c
@@ -1487,6 +1487,8 @@ outgoing_edges_match (int mode, basic_block bb1, basic_block bb2)
edge fallthru1 = 0, fallthru2 = 0;
edge e1, e2;
edge_iterator ei;
+ rtx last1, last2;
+ bool nonfakeedges;
/* If we performed shrink-wrapping, edges to the EXIT_BLOCK_PTR can
only be distinguished for JUMP_INSNs. The two paths may differ in
@@ -1695,9 +1697,15 @@ outgoing_edges_match (int mode, basic_block bb1, basic_block bb2)
}
}
+ last1 = BB_END (bb1);
+ last2 = BB_END (bb2);
+ if (DEBUG_INSN_P (last1))
+ last1 = prev_nondebug_insn (last1);
+ if (DEBUG_INSN_P (last2))
+ last2 = prev_nondebug_insn (last2);
/* First ensure that the instructions match. There may be many outgoing
edges so this test is generally cheaper. */
- if (old_insns_match_p (mode, BB_END (bb1), BB_END (bb2)) != dir_both)
+ if (old_insns_match_p (mode, last1, last2) != dir_both)
return false;
/* Search the outgoing edges, ensure that the counts do match, find possible
@@ -1706,10 +1714,14 @@ outgoing_edges_match (int mode, basic_block bb1, basic_block bb2)
if (EDGE_COUNT (bb1->succs) != EDGE_COUNT (bb2->succs))
return false;
+ nonfakeedges = false;
FOR_EACH_EDGE (e1, ei, bb1->succs)
{
e2 = EDGE_SUCC (bb2, ei.index);
+ if ((e1->flags & EDGE_FAKE) == 0)
+ nonfakeedges = true;
+
if (e1->flags & EDGE_EH)
nehedges1++;
@@ -1727,6 +1739,18 @@ outgoing_edges_match (int mode, basic_block bb1, basic_block bb2)
|| (fallthru1 != 0) != (fallthru2 != 0))
return false;
+ /* If !ACCUMULATE_OUTGOING_ARGS, bb1 (and bb2) have no successors
+ and the last real insn doesn't have REG_ARGS_SIZE note, don't
+ attempt to optimize, as the two basic blocks might have different
+ REG_ARGS_SIZE depths. For noreturn calls and unconditional
+ traps there should be REG_ARG_SIZE notes, they could be missing
+ for __builtin_unreachable () uses though. */
+ if (!nonfakeedges
+ && !ACCUMULATE_OUTGOING_ARGS
+ && (!INSN_P (last1)
+ || !find_reg_note (last1, REG_ARGS_SIZE, NULL)))
+ return false;
+
/* fallthru edges must be forwarded to the same destination. */
if (fallthru1)
{
diff --git a/gcc/cfgrtl.c b/gcc/cfgrtl.c
index 65a4ffcb4bc..5af13dd4eff 100644
--- a/gcc/cfgrtl.c
+++ b/gcc/cfgrtl.c
@@ -1231,14 +1231,46 @@ force_nonfallthru_and_redirect (edge e, basic_block target, rtx jump_label)
&& (note = extract_asm_operands (PATTERN (BB_END (e->src)))))
{
int i, n = ASM_OPERANDS_LABEL_LENGTH (note);
+ bool adjust_jump_target = false;
for (i = 0; i < n; ++i)
{
if (XEXP (ASM_OPERANDS_LABEL (note, i), 0) == BB_HEAD (e->dest))
- XEXP (ASM_OPERANDS_LABEL (note, i), 0) = block_label (target);
+ {
+ LABEL_NUSES (XEXP (ASM_OPERANDS_LABEL (note, i), 0))--;
+ XEXP (ASM_OPERANDS_LABEL (note, i), 0) = block_label (target);
+ LABEL_NUSES (XEXP (ASM_OPERANDS_LABEL (note, i), 0))++;
+ adjust_jump_target = true;
+ }
if (XEXP (ASM_OPERANDS_LABEL (note, i), 0) == BB_HEAD (target))
asm_goto_edge = true;
}
+ if (adjust_jump_target)
+ {
+ rtx insn = BB_END (e->src), note;
+ rtx old_label = BB_HEAD (e->dest);
+ rtx new_label = BB_HEAD (target);
+
+ if (JUMP_LABEL (insn) == old_label)
+ {
+ JUMP_LABEL (insn) = new_label;
+ note = find_reg_note (insn, REG_LABEL_TARGET, new_label);
+ if (note)
+ remove_note (insn, note);
+ }
+ else
+ {
+ note = find_reg_note (insn, REG_LABEL_TARGET, old_label);
+ if (note)
+ remove_note (insn, note);
+ if (JUMP_LABEL (insn) != new_label
+ && !find_reg_note (insn, REG_LABEL_TARGET, new_label))
+ add_reg_note (insn, REG_LABEL_TARGET, new_label);
+ }
+ while ((note = find_reg_note (insn, REG_LABEL_OPERAND, old_label))
+ != NULL_RTX)
+ XEXP (note, 0) = new_label;
+ }
}
if (EDGE_COUNT (e->src->succs) >= 2 || abnormal_edge_flags || asm_goto_edge)
diff --git a/gcc/cgraph.c b/gcc/cgraph.c
index 9cc36903a8c..78e131b3921 100644
--- a/gcc/cgraph.c
+++ b/gcc/cgraph.c
@@ -2269,6 +2269,7 @@ cgraph_create_virtual_clone (struct cgraph_node *old_node,
TREE_PUBLIC (new_node->decl) = 0;
DECL_COMDAT (new_node->decl) = 0;
DECL_WEAK (new_node->decl) = 0;
+ DECL_VIRTUAL_P (new_node->decl) = 0;
DECL_STATIC_CONSTRUCTOR (new_node->decl) = 0;
DECL_STATIC_DESTRUCTOR (new_node->decl) = 0;
new_node->clone.tree_map = tree_map;
diff --git a/gcc/cgraph.h b/gcc/cgraph.h
index 122a44c3e69..7abfb8ae9f6 100644
--- a/gcc/cgraph.h
+++ b/gcc/cgraph.h
@@ -935,6 +935,7 @@ cgraph_only_called_directly_or_aliased_p (struct cgraph_node *node)
gcc_assert (!node->global.inlined_to);
return (!node->needed && !node->address_taken
&& !node->reachable_from_other_partition
+ && !DECL_VIRTUAL_P (node->decl)
&& !DECL_STATIC_CONSTRUCTOR (node->decl)
&& !DECL_STATIC_DESTRUCTOR (node->decl)
&& !node->local.externally_visible);
diff --git a/gcc/config.gcc b/gcc/config.gcc
index 658ac155f04..8ce8b051e57 100644
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -805,6 +805,7 @@ aarch64*-*-linux*)
;;
alpha*-*-linux*)
tm_file="${tm_file} alpha/elf.h alpha/linux.h alpha/linux-elf.h glibc-stdint.h"
+ tmake_file="${tmake_file} alpha/t-linux"
extra_options="${extra_options} alpha/elf.opt"
target_cpu_default="MASK_GAS"
;;
@@ -1091,6 +1092,7 @@ hppa*64*-*-linux*)
tm_file="pa/pa64-start.h ${tm_file} dbxelf.h elfos.h gnu-user.h linux.h \
glibc-stdint.h pa/pa-linux.h pa/pa64-regs.h pa/pa-64.h \
pa/pa64-linux.h"
+ tmake_file="${tmake_file} pa/t-linux"
gas=yes gnu_ld=yes
need_64bit_hwint=yes
;;
@@ -1098,6 +1100,7 @@ hppa*-*-linux*)
target_cpu_default="MASK_PA_11|MASK_NO_SPACE_REGS"
tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h pa/pa-linux.h \
pa/pa32-regs.h pa/pa32-linux.h"
+ tmake_file="${tmake_file} pa/t-linux"
;;
# port not yet contributed.
#hppa*-*-openbsd*)
@@ -1576,7 +1579,7 @@ ia64*-*-freebsd*)
;;
ia64*-*-linux*)
tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h ia64/sysv4.h ia64/linux.h"
- tmake_file="${tmake_file} ia64/t-ia64 t-libunwind"
+ tmake_file="${tmake_file} ia64/t-ia64 ia64/t-linux t-libunwind"
target_cpu_default="MASK_GNU_AS|MASK_GNU_LD"
;;
ia64*-*-hpux*)
@@ -2103,6 +2106,7 @@ powerpc-*-linux* | powerpc64-*-linux*)
;;
*)
tm_file="${tm_file} rs6000/linux.h glibc-stdint.h"
+ tmake_file="$tmake_file rs6000/t-linux"
;;
esac
case ${target} in
@@ -2466,6 +2470,7 @@ sparc-*-linux*)
tmake_file="${tmake_file} sparc/t-linux64"
else
tm_file="${tm_file} sparc/linux.h"
+ tmake_file="${tmake_file} sparc/t-linux"
fi
;;
sparc-*-netbsdelf*)
diff --git a/gcc/config/alpha/t-linux b/gcc/config/alpha/t-linux
new file mode 100644
index 00000000000..1b4a26f7455
--- /dev/null
+++ b/gcc/config/alpha/t-linux
@@ -0,0 +1 @@
+MULTIARCH_DIRNAME = $(call if_multiarch,alpha-linux-gnu)
diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
index 5987a6cea95..7bab8931964 100644
--- a/gcc/config/arm/arm.c
+++ b/gcc/config/arm/arm.c
@@ -172,7 +172,7 @@ static void cirrus_reorg (rtx);
static void arm_init_builtins (void);
static void arm_init_iwmmxt_builtins (void);
static rtx safe_vector_operand (rtx, enum machine_mode);
-static rtx arm_expand_binop_builtin (enum insn_code, tree, rtx);
+static rtx arm_expand_binop_builtin (enum insn_code, tree, rtx, bool);
static rtx arm_expand_unop_builtin (enum insn_code, tree, rtx, int);
static rtx arm_expand_builtin (tree, rtx, rtx, enum machine_mode, int);
static tree arm_builtin_decl (unsigned, bool);
@@ -5568,7 +5568,9 @@ thumb_find_work_register (unsigned long pushed_regs_mask)
if (! cfun->machine->uses_anonymous_args
&& crtl->args.size >= 0
&& crtl->args.size <= (LAST_ARG_REGNUM * UNITS_PER_WORD)
- && crtl->args.info.nregs < 4)
+ && (TARGET_AAPCS_BASED
+ ? crtl->args.info.aapcs_ncrn < 4
+ : crtl->args.info.nregs < 4))
return LAST_ARG_REGNUM;
/* Otherwise look for a call-saved register that is going to be pushed. */
@@ -20795,7 +20797,7 @@ safe_vector_operand (rtx x, enum machine_mode mode)
static rtx
arm_expand_binop_builtin (enum insn_code icode,
- tree exp, rtx target)
+ tree exp, rtx target, bool allow_void)
{
rtx pat;
tree arg0 = CALL_EXPR_ARG (exp, 0);
@@ -20816,7 +20818,32 @@ arm_expand_binop_builtin (enum insn_code icode,
|| ! (*insn_data[icode].operand[0].predicate) (target, tmode))
target = gen_reg_rtx (tmode);
- gcc_assert (GET_MODE (op0) == mode0 && GET_MODE (op1) == mode1);
+ if (GET_MODE (op0) != mode0)
+ {
+ error ("the first argument to the builtin has mode %s, expecting %s",
+ mode_name[GET_MODE (op0)], mode_name[mode0]);
+ /* Do not return a NULL_RTX - it causes an ICE in store_expr()
+ which does not expect builtin expansion to fail. */
+ return const0_rtx;
+ }
+
+ if (GET_MODE (op1) != mode1)
+ {
+ if (GET_MODE (op1) == VOIDmode)
+ {
+ /* We are being passed a constant as our second parameter.
+ If allow_void is true, assume that the pattern allows
+ immediates. Otherwise, copy the value into a register. */
+ if (! allow_void)
+ op1 = copy_to_mode_reg (mode1, op1);
+ }
+ else
+ {
+ error ("the second argument to the builtin has mode %s, expecting %s",
+ mode_name[GET_MODE (op1)], mode_name[mode1]);
+ return const0_rtx;
+ }
+ }
if (! (*insn_data[icode].operand[1].predicate) (op0, mode0))
op0 = copy_to_mode_reg (mode0, op0);
@@ -21449,13 +21476,13 @@ arm_expand_builtin (tree exp,
return target;
case ARM_BUILTIN_WSADB:
- return arm_expand_binop_builtin (CODE_FOR_iwmmxt_wsadb, exp, target);
+ return arm_expand_binop_builtin (CODE_FOR_iwmmxt_wsadb, exp, target, false);
case ARM_BUILTIN_WSADH:
- return arm_expand_binop_builtin (CODE_FOR_iwmmxt_wsadh, exp, target);
+ return arm_expand_binop_builtin (CODE_FOR_iwmmxt_wsadh, exp, target, false);
case ARM_BUILTIN_WSADBZ:
- return arm_expand_binop_builtin (CODE_FOR_iwmmxt_wsadbz, exp, target);
+ return arm_expand_binop_builtin (CODE_FOR_iwmmxt_wsadbz, exp, target, false);
case ARM_BUILTIN_WSADHZ:
- return arm_expand_binop_builtin (CODE_FOR_iwmmxt_wsadhz, exp, target);
+ return arm_expand_binop_builtin (CODE_FOR_iwmmxt_wsadhz, exp, target, false);
/* Several three-argument builtins. */
case ARM_BUILTIN_WMACS:
@@ -21503,6 +21530,32 @@ arm_expand_builtin (tree exp,
emit_insn (pat);
return target;
+ case ARM_BUILTIN_WSLLHI:
+ case ARM_BUILTIN_WSLLWI:
+ case ARM_BUILTIN_WSLLDI:
+ case ARM_BUILTIN_WSRAHI:
+ case ARM_BUILTIN_WSRAWI:
+ case ARM_BUILTIN_WSRADI:
+ case ARM_BUILTIN_WSRLHI:
+ case ARM_BUILTIN_WSRLWI:
+ case ARM_BUILTIN_WSRLDI:
+ case ARM_BUILTIN_WRORHI:
+ case ARM_BUILTIN_WRORWI:
+ case ARM_BUILTIN_WRORDI:
+ icode = ( fcode == ARM_BUILTIN_WSLLHI ? CODE_FOR_ashlv4hi3_iwmmxt
+ : fcode == ARM_BUILTIN_WSLLWI ? CODE_FOR_ashlv2si3_iwmmxt
+ : fcode == ARM_BUILTIN_WSLLDI ? CODE_FOR_ashldi3_iwmmxt
+ : fcode == ARM_BUILTIN_WSRAHI ? CODE_FOR_ashrv4hi3_iwmmxt
+ : fcode == ARM_BUILTIN_WSRAWI ? CODE_FOR_ashrv2si3_iwmmxt
+ : fcode == ARM_BUILTIN_WSRADI ? CODE_FOR_ashrdi3_iwmmxt
+ : fcode == ARM_BUILTIN_WSRLHI ? CODE_FOR_lshrv4hi3_iwmmxt
+ : fcode == ARM_BUILTIN_WSRLWI ? CODE_FOR_lshrv2si3_iwmmxt
+ : fcode == ARM_BUILTIN_WSRLDI ? CODE_FOR_lshrdi3_iwmmxt
+ : fcode == ARM_BUILTIN_WRORHI ? CODE_FOR_rorv4hi3
+ : fcode == ARM_BUILTIN_WRORWI ? CODE_FOR_rorv2si3
+ : /* ARM_BUILTIN_WRORDI */CODE_FOR_rordi3);
+ return arm_expand_binop_builtin (icode, exp, target, true);
+
case ARM_BUILTIN_WZERO:
target = gen_reg_rtx (DImode);
emit_insn (gen_iwmmxt_clrdi (target));
@@ -21517,7 +21570,7 @@ arm_expand_builtin (tree exp,
for (i = 0, d = bdesc_2arg; i < ARRAY_SIZE (bdesc_2arg); i++, d++)
if (d->code == (const enum arm_builtins) fcode)
- return arm_expand_binop_builtin (d->icode, exp, target);
+ return arm_expand_binop_builtin (d->icode, exp, target, false);
for (i = 0, d = bdesc_1arg; i < ARRAY_SIZE (bdesc_1arg); i++, d++)
if (d->code == (const enum arm_builtins) fcode)
diff --git a/gcc/config/arm/arm.md b/gcc/config/arm/arm.md
index 3c6d72a9185..9e2c34c12e3 100644
--- a/gcc/config/arm/arm.md
+++ b/gcc/config/arm/arm.md
@@ -7086,7 +7086,7 @@
(define_expand "cbranchdi4"
[(set (pc) (if_then_else
(match_operator 0 "expandable_comparison_operator"
- [(match_operand:DI 1 "cmpdi_operand" "")
+ [(match_operand:DI 1 "s_register_operand" "")
(match_operand:DI 2 "cmpdi_operand" "")])
(label_ref (match_operand 3 "" ""))
(pc)))]
@@ -7095,10 +7095,6 @@
rtx swap = NULL_RTX;
enum rtx_code code = GET_CODE (operands[0]);
- /* We should not have two constants. */
- gcc_assert (GET_MODE (operands[1]) == DImode
- || GET_MODE (operands[2]) == DImode);
-
/* Flip unimplemented DImode comparisons to a form that
arm_gen_compare_reg can handle. */
switch (code)
@@ -8099,17 +8095,13 @@
(define_expand "cstoredi4"
[(set (match_operand:SI 0 "s_register_operand" "")
(match_operator:SI 1 "expandable_comparison_operator"
- [(match_operand:DI 2 "cmpdi_operand" "")
+ [(match_operand:DI 2 "s_register_operand" "")
(match_operand:DI 3 "cmpdi_operand" "")]))]
"TARGET_32BIT"
"{
rtx swap = NULL_RTX;
enum rtx_code code = GET_CODE (operands[1]);
- /* We should not have two constants. */
- gcc_assert (GET_MODE (operands[2]) == DImode
- || GET_MODE (operands[3]) == DImode);
-
/* Flip unimplemented DImode comparisons to a form that
arm_gen_compare_reg can handle. */
switch (code)
diff --git a/gcc/config/arm/t-linux-eabi b/gcc/config/arm/t-linux-eabi
index 8004a7d0155..0a8be38552e 100644
--- a/gcc/config/arm/t-linux-eabi
+++ b/gcc/config/arm/t-linux-eabi
@@ -1,4 +1,4 @@
-# Copyright (C) 2005, 2009, 2010, 2011 Free Software Foundation, Inc.
+# Copyright (C) 2005-2012 Free Software Foundation, Inc.
#
# This file is part of GCC.
#
@@ -24,3 +24,8 @@ MULTILIB_DIRNAMES =
#MULTILIB_OPTIONS += mcpu=fa606te/mcpu=fa626te/mcpu=fmp626/mcpu=fa726te
#MULTILIB_DIRNAMES += fa606te fa626te fmp626 fa726te
#MULTILIB_EXCEPTIONS += *mthumb/*mcpu=fa606te *mthumb/*mcpu=fa626te *mthumb/*mcpu=fmp626 *mthumb/*mcpu=fa726te*
+
+ifneq (,$(findstring gnueabi,$(target)))
+ARM_EB = $(if $(findstring TARGET_BIG_ENDIAN_DEFAULT=1, $(tm_defines)),eb)
+MULTIARCH_DIRNAME = $(call if_multiarch,arm$(ARM_EB)-linux-gnueabi$(if $(filter hard,$(with_float)),hf))
+endif
diff --git a/gcc/config/avr/avr-c.c b/gcc/config/avr/avr-c.c
index 6eb0ebaed5a..f8626732703 100644
--- a/gcc/config/avr/avr-c.c
+++ b/gcc/config/avr/avr-c.c
@@ -43,7 +43,7 @@ avr_register_target_pragmas (void)
/* Register address spaces. The order must be the same as in the respective
enum from avr.h (or designated initialized must be used in avr.c). */
- for (i = 0; avr_addrspace[i].name; i++)
+ for (i = 0; i < ADDR_SPACE_COUNT; i++)
{
gcc_assert (i == avr_addrspace[i].id);
@@ -160,7 +160,7 @@ avr_cpu_cpp_builtins (struct cpp_reader *pfile)
if (!strcmp (lang_hooks.name, "GNU C"))
{
- for (i = 0; avr_addrspace[i].name; i++)
+ for (i = 0; i < ADDR_SPACE_COUNT; i++)
if (!ADDR_SPACE_GENERIC_P (i)
/* Only supply __FLASH<n> macro if the address space is reasonable
for this target. The address space qualifier itself is still
@@ -170,8 +170,7 @@ avr_cpu_cpp_builtins (struct cpp_reader *pfile)
const char *name = avr_addrspace[i].name;
char *Name = (char*) alloca (1 + strlen (name));
- cpp_define_formatted (pfile, "%s=%s",
- avr_toupper (Name, name), name);
+ cpp_define (pfile, avr_toupper (Name, name));
}
}
@@ -188,7 +187,9 @@ avr_cpu_cpp_builtins (struct cpp_reader *pfile)
/* Builtin macros for the __int24 and __uint24 type. */
- cpp_define (pfile, "__INT24_MAX__=8388607L");
+ cpp_define_formatted (pfile, "__INT24_MAX__=8388607%s",
+ INT_TYPE_SIZE == 8 ? "LL" : "L");
cpp_define (pfile, "__INT24_MIN__=(-__INT24_MAX__-1)");
- cpp_define (pfile, "__UINT24_MAX__=16777215UL");
+ cpp_define_formatted (pfile, "__UINT24_MAX__=16777215%s",
+ INT_TYPE_SIZE == 8 ? "ULL" : "UL");
}
diff --git a/gcc/config/avr/avr-mcus.def b/gcc/config/avr/avr-mcus.def
index 7d2882903f2..4e26cdd4ae9 100644
--- a/gcc/config/avr/avr-mcus.def
+++ b/gcc/config/avr/avr-mcus.def
@@ -1,5 +1,5 @@
/* AVR MCUs.
- Copyright (C) 2009, 2010, 2011
+ Copyright (C) 2009 -- 2013
Free Software Foundation, Inc.
This file is part of GCC.
@@ -18,19 +18,50 @@
along with GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */
-/* List of all known AVR MCU types - if updated, it has to be kept
- in sync in several places (FIXME: is there a better way?):
- - here;
- - gas/config/tc-avr.c;
- - avr-libc.
+/* List of all known AVR MCU types. If updated, cd to $(builddir)/gcc and run
+
+ $ make avr-mcus
+
+ This will regenerate / update the following source files:
+
+ - $(srcdir)/config/avr/t-multilib
+ - $(srcdir)/config/avr/avr-tables.opt
+
+ After that, rebuild everything and check-in the new sources to the repo.
+ The device list below has to be kept in sync with the following places:
+
+ - here
+ - gcc/doc/invoke.texi
+ - gas/config/tc-avr.c
+ - avr-libc
Before including this file, define a macro:
- AVR_MCU (NAME, ARCH, MACRO, SHORT_SP, ERRATA_SKIP, DATA_SEC, N_FLASH, LIBRARY_NAME)
+ AVR_MCU (NAME, ARCH, MACRO, SHORT_SP, ERRATA_SKIP, DATA_SEC, N_FLASH,
+ LIBRARY_NAME)
+
+ where the arguments are the fields of struct mcu_type_s:
+
+ NAME Accept -mmcu=<NAME>
+
+ ARCH Specifies the multilib variant together with SHORT_SP
+
+ MACRO If NULL, this is a core and not a device. If non-NULL,
+ supply respective built-in macro.
+
+ SHORT_SP The device / multilib has an 8-bit stack pointer (no SPH).
+
+ ERRATA_SKIP Apply work-around for the "skip 32-bit instruction"
+ silicon bug: Don't skip 32-bit instrctions.
+
+ DATA_SEC First address of SRAM, used in -Tdata= by the driver.
+
+ N_FLASH Number of 64 KiB flash segments, rounded up.
- where the arguments are the fields of struct mcu_type_s. */
+ LIBRARY_NAME Used by the driver to linke startup code from avr-libc
+ as of crt<LIBRARY_NAME>.o
-/* "avr2" must be first for the "0" default to work as intended. */
+ "avr2" must be first for the "0" default to work as intended. */
/* Classic, <= 8K. */
AVR_MCU ("avr2", ARCH_AVR2, NULL, 0, 1, 0x0060, 6, "s8515")
diff --git a/gcc/config/avr/avr.c b/gcc/config/avr/avr.c
index 02accf2009f..40a37b3e2fa 100644
--- a/gcc/config/avr/avr.c
+++ b/gcc/config/avr/avr.c
@@ -80,29 +80,18 @@
/* Known address spaces. The order must be the same as in the respective
enum from avr.h (or designated initialized must be used). */
-const avr_addrspace_t avr_addrspace[] =
-{
- { ADDR_SPACE_RAM, 0, 2, "" , 0 },
- { ADDR_SPACE_FLASH, 1, 2, "__flash", 0 },
- { ADDR_SPACE_FLASH1, 1, 2, "__flash1", 1 },
- { ADDR_SPACE_FLASH2, 1, 2, "__flash2", 2 },
- { ADDR_SPACE_FLASH3, 1, 2, "__flash3", 3 },
- { ADDR_SPACE_FLASH4, 1, 2, "__flash4", 4 },
- { ADDR_SPACE_FLASH5, 1, 2, "__flash5", 5 },
- { ADDR_SPACE_MEMX, 1, 3, "__memx", 0 },
- { 0 , 0, 0, NULL, 0 }
+const avr_addrspace_t avr_addrspace[ADDR_SPACE_COUNT] =
+{
+ { ADDR_SPACE_RAM, 0, 2, "", 0, NULL },
+ { ADDR_SPACE_FLASH, 1, 2, "__flash", 0, ".progmem.data" },
+ { ADDR_SPACE_FLASH1, 1, 2, "__flash1", 1, ".progmem1.data" },
+ { ADDR_SPACE_FLASH2, 1, 2, "__flash2", 2, ".progmem2.data" },
+ { ADDR_SPACE_FLASH3, 1, 2, "__flash3", 3, ".progmem3.data" },
+ { ADDR_SPACE_FLASH4, 1, 2, "__flash4", 4, ".progmem4.data" },
+ { ADDR_SPACE_FLASH5, 1, 2, "__flash5", 5, ".progmem5.data" },
+ { ADDR_SPACE_MEMX, 1, 3, "__memx", 0, ".progmemx.data" },
};
-/* Map 64-k Flash segment to section prefix. */
-static const char* const progmem_section_prefix[6] =
- {
- ".progmem.data",
- ".progmem1.data",
- ".progmem2.data",
- ".progmem3.data",
- ".progmem4.data",
- ".progmem5.data"
- };
/* Holding RAM addresses of some SFRs used by the compiler and that
are unique over all devices in an architecture like 'avr4'. */
@@ -208,8 +197,9 @@ const struct mcu_type_s *avr_current_device;
static GTY(()) section *progmem_swtable_section;
/* Unnamed sections associated to __attribute__((progmem)) aka. PROGMEM
- or to address space __flash*. */
-static GTY(()) section *progmem_section[6];
+ or to address space __flash* or __memx. Only used as singletons inside
+ avr_asm_select_section, but it must not be local there because of GTY. */
+static GTY(()) section *progmem_section[ADDR_SPACE_COUNT];
/* Condition for insns/expanders from avr-dimode.md. */
bool avr_have_dimode = true;
@@ -7120,8 +7110,6 @@ avr_output_progmem_section_asm_op (const void *data)
static void
avr_asm_init_sections (void)
{
- unsigned int n;
-
/* Set up a section for jump tables. Alignment is handled by
ASM_OUTPUT_BEFORE_CASE_LABEL. */
@@ -7140,13 +7128,6 @@ avr_asm_init_sections (void)
",\"ax\",@progbits");
}
- for (n = 0; n < sizeof (progmem_section) / sizeof (*progmem_section); n++)
- {
- progmem_section[n]
- = get_unnamed_section (0, avr_output_progmem_section_asm_op,
- progmem_section_prefix[n]);
- }
-
/* Override section callbacks to keep track of `avr_need_clear_bss_p'
resp. `avr_need_copy_data_p'. */
@@ -7224,10 +7205,9 @@ avr_asm_named_section (const char *name, unsigned int flags, tree decl)
if (flags & AVR_SECTION_PROGMEM)
{
addr_space_t as = (flags & AVR_SECTION_PROGMEM) / SECTION_MACH_DEP;
- int segment = avr_addrspace[as].segment;
const char *old_prefix = ".rodata";
- const char *new_prefix = progmem_section_prefix[segment];
-
+ const char *new_prefix = avr_addrspace[as].section_name;
+
if (STR_PREFIX_P (name, old_prefix))
{
const char *sname = ACONCAT ((new_prefix,
@@ -7339,13 +7319,18 @@ avr_asm_select_section (tree decl, int reloc, unsigned HOST_WIDE_INT align)
&& avr_progmem_p (decl, DECL_ATTRIBUTES (decl)))
{
addr_space_t as = TYPE_ADDR_SPACE (TREE_TYPE (decl));
- int segment = avr_addrspace[as].segment;
+
+ /* __progmem__ goes in generic space but shall be allocated to
+ .progmem.data */
+
+ if (ADDR_SPACE_GENERIC_P (as))
+ as = ADDR_SPACE_FLASH;
if (sect->common.flags & SECTION_NAMED)
{
const char * name = sect->named.name;
const char * old_prefix = ".rodata";
- const char * new_prefix = progmem_section_prefix[segment];
+ const char * new_prefix = avr_addrspace[as].section_name;
if (STR_PREFIX_P (name, old_prefix))
{
@@ -7354,8 +7339,15 @@ avr_asm_select_section (tree decl, int reloc, unsigned HOST_WIDE_INT align)
return get_section (sname, sect->common.flags, sect->named.decl);
}
}
-
- return progmem_section[segment];
+
+ if (!progmem_section[as])
+ {
+ progmem_section[as]
+ = get_unnamed_section (0, avr_output_progmem_section_asm_op,
+ avr_addrspace[as].section_name);
+ }
+
+ return progmem_section[as];
}
return sect;
diff --git a/gcc/config/avr/avr.h b/gcc/config/avr/avr.h
index d5537238217..79a669da409 100644
--- a/gcc/config/avr/avr.h
+++ b/gcc/config/avr/avr.h
@@ -156,6 +156,9 @@ typedef struct
/* Segment (i.e. 64k memory chunk) number. */
int segment;
+
+ /* Section prefix, e.g. ".progmem1.data" */
+ const char *section_name;
} avr_addrspace_t;
extern const avr_addrspace_t avr_addrspace[];
@@ -164,14 +167,16 @@ extern const avr_addrspace_t avr_addrspace[];
enum
{
- ADDR_SPACE_RAM,
+ ADDR_SPACE_RAM, /* ADDR_SPACE_GENERIC */
ADDR_SPACE_FLASH,
ADDR_SPACE_FLASH1,
ADDR_SPACE_FLASH2,
ADDR_SPACE_FLASH3,
ADDR_SPACE_FLASH4,
ADDR_SPACE_FLASH5,
- ADDR_SPACE_MEMX
+ ADDR_SPACE_MEMX,
+ /* Sentinel */
+ ADDR_SPACE_COUNT
};
#define TARGET_CPU_CPP_BUILTINS() avr_cpu_cpp_builtins (pfile)
diff --git a/gcc/config/avr/t-avr b/gcc/config/avr/t-avr
index 99638333204..6889b1ab7a6 100644
--- a/gcc/config/avr/t-avr
+++ b/gcc/config/avr/t-avr
@@ -1,5 +1,4 @@
-# Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
-# 2009, 2010, 2011 Free Software Foundation, Inc.
+# Copyright (C) 2000 -- 2013 Free Software Foundation, Inc.
#
# This file is part of GCC.
#
@@ -40,19 +39,27 @@ avr.o avr-c.o: $(srcdir)/config/avr/builtins.def
AVR_MCUS = $(srcdir)/config/avr/avr-mcus.def
+# Run `avr-mcus' after you changed or added devices in avr-mcus.def
+
+.PHONY: avr-mcus
+
+avr-mcus: $(srcdir)/config/avr/t-multilib \
+ $(srcdir)/config/avr/avr-tables.opt; @true
+
+# Make sure that -mmcu= is supported for devices from avr-mcus.def and
+# all -mmcu= values are displayed on the help screen
$(srcdir)/config/avr/avr-tables.opt: $(srcdir)/config/avr/genopt.sh $(AVR_MCUS)
$(SHELL) $< $(AVR_MCUS) > $@
+# Map -mmcu= to the right multilib variant
+
# MULTILIB_OPTIONS
# MULTILIB_DIRNAMES
# MULTILIB_EXCEPTIONS
# MULTILIB_MATCHES
-$(srcdir)/config/avr/t-multilib: s-avr-mlib; @true
s-mlib: $(srcdir)/config/avr/t-multilib
-s-avr-mlib: $(srcdir)/config/avr/genmultilib.awk $(AVR_MCUS)
- $(AWK) -f $< -v FORMAT=Makefile $< $(AVR_MCUS) > tmp-avr-mlib
- $(SHELL) $(srcdir)/../move-if-change \
- tmp-avr-mlib $(srcdir)/config/avr/t-multilib
- $(STAMP) $@
+$(srcdir)/config/avr/t-multilib: $(srcdir)/config/avr/genmultilib.awk \
+ $(AVR_MCUS)
+ $(AWK) -f $< -v FORMAT=Makefile $< $(AVR_MCUS) > $@
diff --git a/gcc/config/i386/constraints.md b/gcc/config/i386/constraints.md
index 5a19307a059..25327dd61b7 100644
--- a/gcc/config/i386/constraints.md
+++ b/gcc/config/i386/constraints.md
@@ -92,6 +92,7 @@
;; p Integer register when TARGET_PARTIAL_REG_STALL is disabled
;; d Integer register when integer DFmode moves are enabled
;; x Integer register when integer XFmode moves are enabled
+;; f x87 register when 80387 floating point arithmetic is enabled
(define_register_constraint "Yz" "TARGET_SSE ? SSE_FIRST_REG : NO_REGS"
"First SSE register (@code{%xmm0}).")
@@ -118,6 +119,10 @@
"optimize_function_for_speed_p (cfun) ? GENERAL_REGS : NO_REGS"
"@internal Any integer register when integer XFmode moves are enabled.")
+(define_register_constraint "Yf"
+ "(ix86_fpmath & FPMATH_387) ? FLOAT_REGS : NO_REGS"
+ "@internal Any x87 register when 80387 FP arithmetic is enabled.")
+
(define_constraint "z"
"@internal Constant call address operand."
(match_operand 0 "constant_call_address_operand"))
diff --git a/gcc/config/i386/cpuid.h b/gcc/config/i386/cpuid.h
index 5da8fd2e9f4..49de691b29d 100644
--- a/gcc/config/i386/cpuid.h
+++ b/gcc/config/i386/cpuid.h
@@ -73,35 +73,50 @@
/* %ebx may be the PIC register. */
#if __GNUC__ >= 3
#define __cpuid(level, a, b, c, d) \
- __asm__ ("xchg{l}\t{%%}ebx, %1\n\t" \
+ __asm__ ("xchg{l}\t{%%}ebx, %k1\n\t" \
"cpuid\n\t" \
- "xchg{l}\t{%%}ebx, %1\n\t" \
- : "=a" (a), "=r" (b), "=c" (c), "=d" (d) \
+ "xchg{l}\t{%%}ebx, %k1\n\t" \
+ : "=a" (a), "=&r" (b), "=c" (c), "=d" (d) \
: "0" (level))
#define __cpuid_count(level, count, a, b, c, d) \
- __asm__ ("xchg{l}\t{%%}ebx, %1\n\t" \
+ __asm__ ("xchg{l}\t{%%}ebx, %k1\n\t" \
"cpuid\n\t" \
- "xchg{l}\t{%%}ebx, %1\n\t" \
- : "=a" (a), "=r" (b), "=c" (c), "=d" (d) \
+ "xchg{l}\t{%%}ebx, %k1\n\t" \
+ : "=a" (a), "=&r" (b), "=c" (c), "=d" (d) \
: "0" (level), "2" (count))
#else
/* Host GCCs older than 3.0 weren't supporting Intel asm syntax
nor alternatives in i386 code. */
#define __cpuid(level, a, b, c, d) \
- __asm__ ("xchgl\t%%ebx, %1\n\t" \
+ __asm__ ("xchgl\t%%ebx, %k1\n\t" \
"cpuid\n\t" \
- "xchgl\t%%ebx, %1\n\t" \
- : "=a" (a), "=r" (b), "=c" (c), "=d" (d) \
+ "xchgl\t%%ebx, %k1\n\t" \
+ : "=a" (a), "=&r" (b), "=c" (c), "=d" (d) \
: "0" (level))
#define __cpuid_count(level, count, a, b, c, d) \
- __asm__ ("xchgl\t%%ebx, %1\n\t" \
+ __asm__ ("xchgl\t%%ebx, %k1\n\t" \
"cpuid\n\t" \
- "xchgl\t%%ebx, %1\n\t" \
- : "=a" (a), "=r" (b), "=c" (c), "=d" (d) \
+ "xchgl\t%%ebx, %k1\n\t" \
+ : "=a" (a), "=&r" (b), "=c" (c), "=d" (d) \
: "0" (level), "2" (count))
#endif
+#elif defined(__x86_64__) && (defined(__code_model_medium__) || defined(__code_model_large__)) && defined(__PIC__)
+/* %rbx may be the PIC register. */
+#define __cpuid(level, a, b, c, d) \
+ __asm__ ("xchg{q}\t{%%}rbx, %q1\n\t" \
+ "cpuid\n\t" \
+ "xchg{q}\t{%%}rbx, %q1\n\t" \
+ : "=a" (a), "=&r" (b), "=c" (c), "=d" (d) \
+ : "0" (level))
+
+#define __cpuid_count(level, count, a, b, c, d) \
+ __asm__ ("xchg{q}\t{%%}rbx, %q1\n\t" \
+ "cpuid\n\t" \
+ "xchg{q}\t{%%}rbx, %q1\n\t" \
+ : "=a" (a), "=&r" (b), "=c" (c), "=d" (d) \
+ : "0" (level), "2" (count))
#else
#define __cpuid(level, a, b, c, d) \
__asm__ ("cpuid\n\t" \
diff --git a/gcc/config/i386/i386-c.c b/gcc/config/i386/i386-c.c
index 62772b77833..86b76b646ff 100644
--- a/gcc/config/i386/i386-c.c
+++ b/gcc/config/i386/i386-c.c
@@ -233,6 +233,30 @@ ix86_target_macros_internal (HOST_WIDE_INT isa_flag,
break;
}
+ switch (ix86_cmodel)
+ {
+ case CM_SMALL:
+ case CM_SMALL_PIC:
+ def_or_undef (parse_in, "__code_model_small__");
+ break;
+ case CM_MEDIUM:
+ case CM_MEDIUM_PIC:
+ def_or_undef (parse_in, "__code_model_medium__");
+ break;
+ case CM_LARGE:
+ case CM_LARGE_PIC:
+ def_or_undef (parse_in, "__code_model_large__");
+ break;
+ case CM_32:
+ def_or_undef (parse_in, "__code_model_32__");
+ break;
+ case CM_KERNEL:
+ def_or_undef (parse_in, "__code_model_kernel__");
+ break;
+ default:
+ ;
+ }
+
if (isa_flag & OPTION_MASK_ISA_MMX)
def_or_undef (parse_in, "__MMX__");
if (isa_flag & OPTION_MASK_ISA_3DNOW)
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index eddbfb5b190..7921707faf0 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -1,6 +1,6 @@
/* Subroutines used for code generation on IA-32.
- Copyright (C) 1988, 1992, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
- 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
+ Copyright (C) 1988, 1992, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
+ 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013
Free Software Foundation, Inc.
This file is part of GCC.
@@ -15605,8 +15605,7 @@ ix86_expand_move (enum machine_mode mode, rtx operands[])
op0, 1, OPTAB_DIRECT);
if (tmp == op0)
return;
- if (GET_MODE (tmp) != mode)
- op1 = convert_to_mode (mode, tmp, 1);
+ op1 = convert_to_mode (mode, tmp, 1);
}
}
diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
index affc5dd199a..369bc9955c1 100644
--- a/gcc/config/i386/i386.md
+++ b/gcc/config/i386/i386.md
@@ -629,7 +629,7 @@
;; Used to control the "enabled" attribute on a per-instruction basis.
(define_attr "isa" "base,sse2,sse2_noavx,sse3,sse4,sse4_noavx,noavx,avx,
- bmi2,fma,fma4"
+ bmi2,fma4,fma"
(const_string "base"))
(define_attr "enabled" ""
@@ -643,14 +643,8 @@
(eq_attr "isa" "avx") (symbol_ref "TARGET_AVX")
(eq_attr "isa" "noavx") (symbol_ref "!TARGET_AVX")
(eq_attr "isa" "bmi2") (symbol_ref "TARGET_BMI2")
+ (eq_attr "isa" "fma4") (symbol_ref "TARGET_FMA4")
(eq_attr "isa" "fma") (symbol_ref "TARGET_FMA")
- ;; Fma instruction selection has to be done based on
- ;; register pressure. For generating fma4, a cost model
- ;; based on register pressure is required. Till then,
- ;; fma4 instruction is disabled for targets that implement
- ;; both fma and fma4 instruction sets.
- (eq_attr "isa" "fma4")
- (symbol_ref "TARGET_FMA4 && !TARGET_FMA")
]
(const_int 1)))
@@ -1824,8 +1818,8 @@
(set_attr "mode" "OI")])
(define_insn "*movti_internal_rex64"
- [(set (match_operand:TI 0 "nonimmediate_operand" "=!r,o,x,x,xm")
- (match_operand:TI 1 "general_operand" "riFo,riF,C,xm,x"))]
+ [(set (match_operand:TI 0 "nonimmediate_operand" "=!r,o,x,x,m")
+ (match_operand:TI 1 "general_operand" "riFo,re,C,xm,x"))]
"TARGET_64BIT && !(MEM_P (operands[0]) && MEM_P (operands[1]))"
{
switch (which_alternative)
@@ -1928,9 +1922,9 @@
(define_insn "*movdi_internal_rex64"
[(set (match_operand:DI 0 "nonimmediate_operand"
- "=r,r ,r,m ,!o,*y,m*y,?*y,?r ,?*Ym,*x,m ,*x,*x,?r ,?*Yi,?*x,?*Ym")
+ "=r,r ,r,m ,*y,m*y,?*y,?r ,?*Ym,*x,m ,*x,*x,?r ,?*Yi,?*x,?*Ym")
(match_operand:DI 1 "general_operand"
- "Z ,rem,i,re,n ,C ,*y ,m ,*Ym,r ,C ,*x,*x,m ,*Yi,r ,*Ym,*x"))]
+ "Z ,rem,i,re,C ,*y ,m ,*Ym,r ,C ,*x,*x,m ,*Yi,r ,*Ym,*x"))]
"TARGET_64BIT && !(MEM_P (operands[0]) && MEM_P (operands[1]))"
{
switch (get_attr_type (insn))
@@ -1963,9 +1957,6 @@
case TYPE_MMX:
return "pxor\t%0, %0";
- case TYPE_MULTI:
- return "#";
-
case TYPE_LEA:
return "lea{q}\t{%E1, %0|%0, %E1}";
@@ -1983,16 +1974,14 @@
}
[(set (attr "type")
(cond [(eq_attr "alternative" "4")
- (const_string "multi")
- (eq_attr "alternative" "5")
(const_string "mmx")
- (eq_attr "alternative" "6,7,8,9")
+ (eq_attr "alternative" "5,6,7,8")
(const_string "mmxmov")
- (eq_attr "alternative" "10")
+ (eq_attr "alternative" "9")
(const_string "sselog1")
- (eq_attr "alternative" "11,12,13,14,15")
+ (eq_attr "alternative" "10,11,12,13,14")
(const_string "ssemov")
- (eq_attr "alternative" "16,17")
+ (eq_attr "alternative" "15,16")
(const_string "ssecvt")
(match_operand 1 "pic_32bit_operand" "")
(const_string "lea")
@@ -2009,18 +1998,18 @@
(const_string "8")
(const_string "*")))
(set (attr "prefix_rex")
- (if_then_else (eq_attr "alternative" "8,9")
+ (if_then_else (eq_attr "alternative" "7,8")
(const_string "1")
(const_string "*")))
(set (attr "prefix_data16")
- (if_then_else (eq_attr "alternative" "11")
+ (if_then_else (eq_attr "alternative" "10")
(const_string "1")
(const_string "*")))
(set (attr "prefix")
- (if_then_else (eq_attr "alternative" "10,11,12,13,14,15")
+ (if_then_else (eq_attr "alternative" "11,12,13,14,15")
(const_string "maybe_vex")
(const_string "orig")))
- (set_attr "mode" "SI,DI,DI,DI,SI,DI,DI,DI,DI,DI,TI,DI,TI,DI,DI,DI,DI,DI")])
+ (set_attr "mode" "SI,DI,DI,DI,DI,DI,DI,DI,DI,TI,DI,TI,DI,DI,DI,DI,DI")])
;; Reload patterns to support multi-word load/store
;; with non-offsetable address.
@@ -2056,41 +2045,6 @@
DONE;
})
-;; Convert impossible stores of immediate to existing instructions.
-;; First try to get scratch register and go through it. In case this
-;; fails, move by 32bit parts.
-(define_peephole2
- [(match_scratch:DI 2 "r")
- (set (match_operand:DI 0 "memory_operand" "")
- (match_operand:DI 1 "immediate_operand" ""))]
- "TARGET_64BIT && !symbolic_operand (operands[1], DImode)
- && !x86_64_immediate_operand (operands[1], DImode)"
- [(set (match_dup 2) (match_dup 1))
- (set (match_dup 0) (match_dup 2))])
-
-;; We need to define this as both peepholer and splitter for case
-;; peephole2 pass is not run.
-;; "&& 1" is needed to keep it from matching the previous pattern.
-(define_peephole2
- [(set (match_operand:DI 0 "memory_operand" "")
- (match_operand:DI 1 "immediate_operand" ""))]
- "TARGET_64BIT && !symbolic_operand (operands[1], DImode)
- && !x86_64_immediate_operand (operands[1], DImode) && 1"
- [(set (match_dup 2) (match_dup 3))
- (set (match_dup 4) (match_dup 5))]
- "split_double_mode (DImode, &operands[0], 2, &operands[2], &operands[4]);")
-
-(define_split
- [(set (match_operand:DI 0 "memory_operand" "")
- (match_operand:DI 1 "immediate_operand" ""))]
- "TARGET_64BIT && ((optimize > 0 && flag_peephole2)
- ? epilogue_completed : reload_completed)
- && !symbolic_operand (operands[1], DImode)
- && !x86_64_immediate_operand (operands[1], DImode)"
- [(set (match_dup 2) (match_dup 3))
- (set (match_dup 4) (match_dup 5))]
- "split_double_mode (DImode, &operands[0], 2, &operands[2], &operands[4]);")
-
(define_insn "*movdi_internal"
[(set (match_operand:DI 0 "nonimmediate_operand"
"=r ,o ,*y,m*y,*y,*x,m ,*x,*x,*x,m ,*x,*x,?*x,?*Ym")
@@ -2373,7 +2327,7 @@
(match_operand:SWI1248x 1 "nonmemory_operand" "a,r<i>"))]
"TARGET_LP64 && ix86_check_movabs (insn, 0)"
"@
- movabs{<imodesuffix>}\t{%1, %P0|%P0, %1}
+ movabs{<imodesuffix>}\t{%1, %P0|[%P0], %1}
mov{<imodesuffix>}\t{%1, %a0|%a0, %1}"
[(set_attr "type" "imov")
(set_attr "modrm" "0,*")
@@ -2387,7 +2341,7 @@
(mem:SWI1248x (match_operand:DI 1 "x86_64_movabs_operand" "i,r")))]
"TARGET_LP64 && ix86_check_movabs (insn, 1)"
"@
- movabs{<imodesuffix>}\t{%P1, %0|%0, %P1}
+ movabs{<imodesuffix>}\t{%P1, %0|%0, [%P1]}
mov{<imodesuffix>}\t{%a1, %0|%0, %a1}"
[(set_attr "type" "imov")
(set_attr "modrm" "0,*")
@@ -2798,7 +2752,7 @@
(define_expand "movtf"
[(set (match_operand:TF 0 "nonimmediate_operand" "")
(match_operand:TF 1 "nonimmediate_operand" ""))]
- "TARGET_SSE2"
+ "TARGET_64BIT || TARGET_SSE2"
{
ix86_expand_move (TFmode, operands);
DONE;
@@ -2810,11 +2764,10 @@
""
"ix86_expand_move (<MODE>mode, operands); DONE;")
-(define_insn "*movtf_internal"
+(define_insn "*movtf_internal_rex64"
[(set (match_operand:TF 0 "nonimmediate_operand" "=x,m,x,?*r ,!o")
- (match_operand:TF 1 "general_operand" "xm,x,C,*roF,F*r"))]
- "TARGET_SSE2
- && !(MEM_P (operands[0]) && MEM_P (operands[1]))
+ (match_operand:TF 1 "general_operand" "xm,x,C,*roF,*r"))]
+ "TARGET_64BIT && !(MEM_P (operands[0]) && MEM_P (operands[1]))
&& (!can_create_pseudo_p ()
|| (ix86_cmodel == CM_MEDIUM || ix86_cmodel == CM_LARGE)
|| GET_CODE (operands[1]) != CONST_DOUBLE
@@ -2873,11 +2826,103 @@
(const_string "TI"))]
(const_string "DI")))])
+(define_insn "*movtf_internal_sse2"
+ [(set (match_operand:TF 0 "nonimmediate_operand" "=x,m,x")
+ (match_operand:TF 1 "general_operand" "xm,x,C"))]
+ "TARGET_SSE2 && !TARGET_64BIT
+ && !(MEM_P (operands[0]) && MEM_P (operands[1]))
+ && (!can_create_pseudo_p ()
+ || (ix86_cmodel == CM_MEDIUM || ix86_cmodel == CM_LARGE)
+ || GET_CODE (operands[1]) != CONST_DOUBLE
+ || (optimize_function_for_size_p (cfun)
+ && standard_sse_constant_p (operands[1])
+ && !memory_operand (operands[0], TFmode))
+ || (!TARGET_MEMORY_MISMATCH_STALL
+ && memory_operand (operands[0], TFmode)))"
+{
+ switch (which_alternative)
+ {
+ case 0:
+ case 1:
+ /* Handle misaligned load/store since we
+ don't have movmisaligntf pattern. */
+ if (misaligned_operand (operands[0], TFmode)
+ || misaligned_operand (operands[1], TFmode))
+ {
+ if (get_attr_mode (insn) == MODE_V4SF)
+ return "%vmovups\t{%1, %0|%0, %1}";
+ else
+ return "%vmovdqu\t{%1, %0|%0, %1}";
+ }
+ else
+ {
+ if (get_attr_mode (insn) == MODE_V4SF)
+ return "%vmovaps\t{%1, %0|%0, %1}";
+ else
+ return "%vmovdqa\t{%1, %0|%0, %1}";
+ }
+
+ case 2:
+ return standard_sse_constant_opcode (insn, operands[1]);
+
+ default:
+ gcc_unreachable ();
+ }
+}
+ [(set_attr "type" "ssemov,ssemov,sselog1")
+ (set_attr "prefix" "maybe_vex")
+ (set (attr "mode")
+ (cond [(eq_attr "alternative" "0,2")
+ (if_then_else
+ (match_test "optimize_function_for_size_p (cfun)")
+ (const_string "V4SF")
+ (const_string "TI"))
+ (eq_attr "alternative" "1")
+ (if_then_else
+ (ior (match_test "TARGET_SSE_TYPELESS_STORES")
+ (match_test "optimize_function_for_size_p (cfun)"))
+ (const_string "V4SF")
+ (const_string "TI"))]
+ (const_string "DI")))])
+
+(define_insn "*movxf_internal_rex64"
+ [(set (match_operand:XF 0 "nonimmediate_operand" "=f,m,f,?Yx*r ,!o")
+ (match_operand:XF 1 "general_operand" "fm,f,G,Yx*roF,Yx*rC"))]
+ "TARGET_64BIT && !(MEM_P (operands[0]) && MEM_P (operands[1]))
+ && (!can_create_pseudo_p ()
+ || (ix86_cmodel == CM_MEDIUM || ix86_cmodel == CM_LARGE)
+ || GET_CODE (operands[1]) != CONST_DOUBLE
+ || (optimize_function_for_size_p (cfun)
+ && standard_80387_constant_p (operands[1]) > 0
+ && !memory_operand (operands[0], XFmode))
+ || (!TARGET_MEMORY_MISMATCH_STALL
+ && memory_operand (operands[0], XFmode)))"
+{
+ switch (which_alternative)
+ {
+ case 0:
+ case 1:
+ return output_387_reg_move (insn, operands);
+
+ case 2:
+ return standard_80387_constant_opcode (operands[1]);
+
+ case 3:
+ case 4:
+ return "#";
+
+ default:
+ gcc_unreachable ();
+ }
+}
+ [(set_attr "type" "fmov,fmov,fmov,multi,multi")
+ (set_attr "mode" "XF,XF,XF,SI,SI")])
+
;; Possible store forwarding (partial memory) stall in alternative 4.
(define_insn "*movxf_internal"
[(set (match_operand:XF 0 "nonimmediate_operand" "=f,m,f,?Yx*r ,!o")
- (match_operand:XF 1 "general_operand" "fm,f,G,Yx*roF,FYx*r"))]
- "!(MEM_P (operands[0]) && MEM_P (operands[1]))
+ (match_operand:XF 1 "general_operand" "fm,f,G,Yx*roF,Yx*rF"))]
+ "!TARGET_64BIT && !(MEM_P (operands[0]) && MEM_P (operands[1]))
&& (!can_create_pseudo_p ()
|| (ix86_cmodel == CM_MEDIUM || ix86_cmodel == CM_LARGE)
|| GET_CODE (operands[1]) != CONST_DOUBLE
@@ -2909,9 +2954,9 @@
(define_insn "*movdf_internal_rex64"
[(set (match_operand:DF 0 "nonimmediate_operand"
- "=f,m,f,?r,?m,?r,!o,x,x,x,m,Yi,r ")
+ "=?Yf*f,?m ,?Yf*f,?r,?m,?r,?r,x,x,x,m,Yi,r ")
(match_operand:DF 1 "general_operand"
- "fm,f,G,rm,r ,F ,F ,C,x,m,x,r ,Yi"))]
+ "Yf*fm ,Yf*f ,G ,rm,rC,C ,F ,C,x,m,x,r ,Yi"))]
"TARGET_64BIT && !(MEM_P (operands[0]) && MEM_P (operands[1]))
&& (!can_create_pseudo_p ()
|| (ix86_cmodel == CM_MEDIUM || ix86_cmodel == CM_LARGE)
@@ -2937,10 +2982,10 @@
return "mov{q}\t{%1, %0|%0, %1}";
case 5:
- return "movabs{q}\t{%1, %0|%0, %1}";
+ return "mov{l}\t{%1, %k0|%k0, %1}";
case 6:
- return "#";
+ return "movabs{q}\t{%1, %0|%0, %1}";
case 7:
return standard_sse_constant_opcode (insn, operands[1]);
@@ -2982,22 +3027,20 @@
[(set (attr "type")
(cond [(eq_attr "alternative" "0,1,2")
(const_string "fmov")
- (eq_attr "alternative" "3,4,5")
+ (eq_attr "alternative" "3,4,5,6")
(const_string "imov")
- (eq_attr "alternative" "6")
- (const_string "multi")
(eq_attr "alternative" "7")
(const_string "sselog1")
]
(const_string "ssemov")))
(set (attr "modrm")
(if_then_else
- (and (eq_attr "alternative" "5") (eq_attr "type" "imov"))
+ (and (eq_attr "alternative" "6") (eq_attr "type" "imov"))
(const_string "0")
(const_string "*")))
(set (attr "length_immediate")
(if_then_else
- (and (eq_attr "alternative" "5") (eq_attr "type" "imov"))
+ (and (eq_attr "alternative" "6") (eq_attr "type" "imov"))
(const_string "8")
(const_string "*")))
(set (attr "prefix")
@@ -3011,8 +3054,10 @@
(set (attr "mode")
(cond [(eq_attr "alternative" "0,1,2")
(const_string "DF")
- (eq_attr "alternative" "3,4,5,6,11,12")
+ (eq_attr "alternative" "3,4,6,11,12")
(const_string "DI")
+ (eq_attr "alternative" "5")
+ (const_string "SI")
/* xorps is one byte shorter. */
(eq_attr "alternative" "7")
@@ -3050,9 +3095,9 @@
;; Possible store forwarding (partial memory) stall in alternative 4.
(define_insn "*movdf_internal"
[(set (match_operand:DF 0 "nonimmediate_operand"
- "=f,m,f,?Yd*r ,!o ,x,x,x,m,*x,*x,*x,m")
+ "=Yf*f,m ,Yf*f,?Yd*r ,!o ,x,x,x,m,*x,*x,*x,m")
(match_operand:DF 1 "general_operand"
- "fm,f,G,Yd*roF,FYd*r,C,x,m,x,C ,*x,m ,*x"))]
+ "Yf*fm,Yf*f,G ,Yd*roF,Yd*rF,C,x,m,x,C ,*x,m ,*x"))]
"!TARGET_64BIT && !(MEM_P (operands[0]) && MEM_P (operands[1]))
&& (!can_create_pseudo_p ()
|| (ix86_cmodel == CM_MEDIUM || ix86_cmodel == CM_LARGE)
@@ -3184,9 +3229,9 @@
(define_insn "*movsf_internal"
[(set (match_operand:SF 0 "nonimmediate_operand"
- "=f,m,f,?r ,?m,x,x,x,m,!*y,!m,!*y,?Yi,?r,!*Ym,!r")
+ "=Yf*f,m ,Yf*f,?r ,?m,x,x,x,m,!*y,!m,!*y,?Yi,?r,!*Ym,!r")
(match_operand:SF 1 "general_operand"
- "fm,f,G,rmF,Fr,C,x,m,x,m ,*y,*y ,r ,Yi,r ,*Ym"))]
+ "Yf*fm,Yf*f,G ,rmF,rF,C,x,m,x,m ,*y,*y ,r ,Yi,r ,*Ym"))]
"!(MEM_P (operands[0]) && MEM_P (operands[1]))
&& (!can_create_pseudo_p ()
|| (ix86_cmodel == CM_MEDIUM || ix86_cmodel == CM_LARGE)
diff --git a/gcc/config/i386/sse.md b/gcc/config/i386/sse.md
index e1600decc47..bf4b136b9c8 100644
--- a/gcc/config/i386/sse.md
+++ b/gcc/config/i386/sse.md
@@ -4302,7 +4302,7 @@
(set_attr "type" "sselog,sselog,sselog,ssemov,ssemov,ssemov")
(set_attr "prefix_data16" "*,*,*,1,*,1")
(set_attr "prefix" "orig,vex,maybe_vex,orig,vex,maybe_vex")
- (set_attr "mode" "V2DF,V2DF,V2DF,V1DF,V1DF,V1DF")])
+ (set_attr "mode" "V2DF,V2DF,DF,V1DF,V1DF,V1DF")])
;; Recall that the 256-bit unpck insns only shuffle within their lanes.
(define_expand "avx_movddup256"
@@ -4403,7 +4403,7 @@
(set_attr "type" "sselog,sselog,sselog,ssemov,ssemov,ssemov")
(set_attr "prefix_data16" "*,*,*,1,*,1")
(set_attr "prefix" "orig,vex,maybe_vex,orig,vex,maybe_vex")
- (set_attr "mode" "V2DF,V2DF,V2DF,V1DF,V1DF,V1DF")])
+ (set_attr "mode" "V2DF,V2DF,DF,V1DF,V1DF,V1DF")])
(define_split
[(set (match_operand:V2DF 0 "memory_operand" "")
@@ -4860,7 +4860,7 @@
[(set_attr "isa" "noavx,sse3")
(set_attr "type" "sselog1")
(set_attr "prefix" "orig,maybe_vex")
- (set_attr "mode" "V2DF")])
+ (set_attr "mode" "V2DF,DF")])
(define_insn "*vec_concatv2df"
[(set (match_operand:V2DF 0 "register_operand" "=x,x,x,x,x,x,x,x")
diff --git a/gcc/config/i386/sync.md b/gcc/config/i386/sync.md
index a58a1b94895..fa3281a78a2 100644
--- a/gcc/config/i386/sync.md
+++ b/gcc/config/i386/sync.md
@@ -223,8 +223,9 @@
DONE;
}
- /* Otherwise use a normal store. */
- emit_move_insn (operands[0], operands[1]);
+ /* Otherwise use a store. */
+ emit_insn (gen_atomic_store<mode>_1 (operands[0], operands[1],
+ operands[2]));
}
/* ... followed by an MFENCE, if required. */
if (model == MEMMODEL_SEQ_CST)
@@ -232,6 +233,14 @@
DONE;
})
+(define_insn "atomic_store<mode>_1"
+ [(set (match_operand:SWI 0 "memory_operand" "=m")
+ (unspec:SWI [(match_operand:SWI 1 "<nonmemory_operand>" "<r><i>")
+ (match_operand:SI 2 "const_int_operand")]
+ UNSPEC_MOVA))]
+ ""
+ "mov{<imodesuffix>}\t{%1, %0|%0, %1}")
+
(define_insn_and_split "atomic_storedi_fpu"
[(set (match_operand:DI 0 "memory_operand" "=m,m,m")
(unspec:DI [(match_operand:DI 1 "register_operand" "x,m,?r")]
diff --git a/gcc/config/ia64/t-linux b/gcc/config/ia64/t-linux
new file mode 100644
index 00000000000..ba9c60a383b
--- /dev/null
+++ b/gcc/config/ia64/t-linux
@@ -0,0 +1 @@
+MULTIARCH_DIRNAME = $(call if_multiarch,ia64-linux-gnu)
diff --git a/gcc/config/m68k/t-linux b/gcc/config/m68k/t-linux
index 3fa29474693..aa64dfc7c1d 100644
--- a/gcc/config/m68k/t-linux
+++ b/gcc/config/m68k/t-linux
@@ -1,4 +1,4 @@
-# Copyright (C) 2008, 2010, 2011 Free Software Foundation, Inc.
+# Copyright (C) 2008, 2010, 2011, 2012 Free Software Foundation, Inc.
#
# This file is part of GCC.
#
@@ -19,6 +19,10 @@
# Only include multilibs for 680x0 and ColdFire CPUs with an MMU.
M68K_MLIB_CPU += && ((CPU ~ "^m680") || (CPU ~ "^mcf")) && (FLAGS ~ "FL_MMU")
+ifeq ($(M68K_ARCH),m68k)
+MULTIARCH_DIRNAME = $(call if_multiarch,m68k-linux-gnu)
+endif
+
# This rule uses MULTILIB_MATCHES to generate a definition of
# SYSROOT_SUFFIX_SPEC.
sysroot-suffix.h: $(srcdir)/config/m68k/print-sysroot-suffix.sh
diff --git a/gcc/config/mips/t-linux64 b/gcc/config/mips/t-linux64
index 5197e5ee209..20136cdbe91 100644
--- a/gcc/config/mips/t-linux64
+++ b/gcc/config/mips/t-linux64
@@ -18,4 +18,9 @@
MULTILIB_OPTIONS = mabi=n32/mabi=32/mabi=64
MULTILIB_DIRNAMES = n32 32 64
-MULTILIB_OSDIRNAMES = ../lib32 ../lib ../lib64
+MIPS_EL = $(if $(filter %el, $(firstword $(subst -, ,$(target)))),el)
+MIPS_SOFT = $(if $(strip $(filter MASK_SOFT_FLOAT_ABI, $(target_cpu_default)) $(filter soft, $(with_float))),soft)
+MULTILIB_OSDIRNAMES = \
+ ../lib32$(call if_multiarch,:mips64$(MIPS_EL)-linux-gnuabin32$(MIPS_SOFT)) \
+ ../lib$(call if_multiarch,:mips$(MIPS_EL)-linux-gnu$(MIPS_SOFT)) \
+ ../lib64$(call if_multiarch,:mips64$(MIPS_EL)-linux-gnuabi64$(MIPS_SOFT))
diff --git a/gcc/config/pa/pa.c b/gcc/config/pa/pa.c
index 1a87adcd6ac..d286a98944b 100644
--- a/gcc/config/pa/pa.c
+++ b/gcc/config/pa/pa.c
@@ -10328,14 +10328,10 @@ pa_legitimate_constant_p (enum machine_mode mode, rtx x)
return false;
/* TLS_MODEL_GLOBAL_DYNAMIC and TLS_MODEL_LOCAL_DYNAMIC are not
- legitimate constants. */
+ legitimate constants. The other variants can't be handled by
+ the move patterns after reload starts. */
if (PA_SYMBOL_REF_TLS_P (x))
- {
- enum tls_model model = SYMBOL_REF_TLS_MODEL (x);
-
- if (model == TLS_MODEL_GLOBAL_DYNAMIC || model == TLS_MODEL_LOCAL_DYNAMIC)
- return false;
- }
+ return false;
if (TARGET_64BIT && GET_CODE (x) == CONST_DOUBLE)
return false;
diff --git a/gcc/config/pa/pa.md b/gcc/config/pa/pa.md
index 5ef7adb23b2..79a15d67c27 100644
--- a/gcc/config/pa/pa.md
+++ b/gcc/config/pa/pa.md
@@ -2051,12 +2051,6 @@
""
"
{
- /* A TLS symbol reference is not a valid move source operand.
- pa_emit_move_sequence can only handle them prior to reload.
- There is also no way to reload a TLS symbol reference, so
- we must reject them after reload starts. */
- if (PA_SYMBOL_REF_TLS_P (operands[1]) && !can_create_pseudo_p ())
- FAIL;
if (pa_emit_move_sequence (operands, SImode, 0))
DONE;
}")
diff --git a/gcc/config/pa/t-linux b/gcc/config/pa/t-linux
new file mode 100644
index 00000000000..f9f2b0a3cec
--- /dev/null
+++ b/gcc/config/pa/t-linux
@@ -0,0 +1 @@
+MULTIARCH_DIRNAME = $(call if_multiarch,hppa-linux-gnu)
diff --git a/gcc/config/rs6000/t-fprules b/gcc/config/rs6000/t-fprules
index 913bbbdae69..8e92d0b45a0 100644
--- a/gcc/config/rs6000/t-fprules
+++ b/gcc/config/rs6000/t-fprules
@@ -1,4 +1,4 @@
-# Copyright (C) 2002, 2005, 2006, 2008, 2011 Free Software Foundation, Inc.
+# Copyright (C) 2002, 2005, 2006, 2008, 2011, 2012 Free Software Foundation, Inc.
#
# This file is part of GCC.
#
@@ -16,17 +16,8 @@
# along with GCC; see the file COPYING3. If not see
# <http://www.gnu.org/licenses/>.
-MULTILIB_MATCHES_FLOAT = msoft-float=mcpu?401 \
- msoft-float=mcpu?403 \
- msoft-float=mcpu?405 \
- msoft-float=mcpu?440 \
- msoft-float=mcpu?464 \
- msoft-float=mcpu?476 \
- msoft-float=mcpu?ec603e \
- msoft-float=mcpu?801 \
- msoft-float=mcpu?821 \
- msoft-float=mcpu?823 \
- msoft-float=mcpu?860
+SOFT_FLOAT_CPUS = e300c2 401 403 405 440 464 476 ec603e 801 821 823 860
+MULTILIB_MATCHES_FLOAT = $(foreach cpu, $(SOFT_FLOAT_CPUS), msoft-float=mcpu?$(cpu))
# Build the libraries for both hard and soft floating point by default
diff --git a/gcc/config/rs6000/t-linux b/gcc/config/rs6000/t-linux
new file mode 100644
index 00000000000..017a293cde3
--- /dev/null
+++ b/gcc/config/rs6000/t-linux
@@ -0,0 +1,9 @@
+# do not define the multiarch name if configured for a soft-float cpu
+# or soft-float.
+ifeq (,$(filter $(with_cpu),$(SOFT_FLOAT_CPUS))$(findstring soft,$(with_float)))
+ifneq (,$(findstring spe,$(target)))
+MULTIARCH_DIRNAME = powerpc-linux-gnuspe$(if $(findstring rs6000/e500-double.h, $(tm_file_list)),,v1)
+else
+MULTIARCH_DIRNAME = powerpc-linux-gnu
+endif
+endif
diff --git a/gcc/config/rs6000/t-linux64 b/gcc/config/rs6000/t-linux64
index 6420431214d..f7eb91e2836 100644
--- a/gcc/config/rs6000/t-linux64
+++ b/gcc/config/rs6000/t-linux64
@@ -31,5 +31,7 @@ MULTILIB_DIRNAMES = 64 32 nof
MULTILIB_EXTRA_OPTS = fPIC mstrict-align
MULTILIB_EXCEPTIONS = m64/msoft-float
MULTILIB_EXCLUSIONS = m64/!m32/msoft-float
-MULTILIB_OSDIRNAMES = ../lib64 $(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib) nof
+MULTILIB_OSDIRNAMES = ../lib64$(call if_multiarch,:powerpc64-linux-gnu)
+MULTILIB_OSDIRNAMES += $(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib)$(call if_multiarch,:powerpc-linux-gnu)
+MULTILIB_OSDIRNAMES += nof
MULTILIB_MATCHES = $(MULTILIB_MATCHES_FLOAT)
diff --git a/gcc/config/s390/t-linux64 b/gcc/config/s390/t-linux64
index ede76a2cbf3..cc6ab367072 100644
--- a/gcc/config/s390/t-linux64
+++ b/gcc/config/s390/t-linux64
@@ -7,4 +7,5 @@
MULTILIB_OPTIONS = m64/m31
MULTILIB_DIRNAMES = 64 32
-MULTILIB_OSDIRNAMES = ../lib64 $(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib)
+MULTILIB_OSDIRNAMES = ../lib64$(call if_multiarch,:s390x-linux-gnu)
+MULTILIB_OSDIRNAMES += $(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib)$(call if_multiarch,:s390-linux-gnu)
diff --git a/gcc/config/sparc/t-linux b/gcc/config/sparc/t-linux
new file mode 100644
index 00000000000..bb8fc29e55b
--- /dev/null
+++ b/gcc/config/sparc/t-linux
@@ -0,0 +1 @@
+MULTIARCH_DIRNAME = $(call if_multiarch,sparc-linux-gnu)
diff --git a/gcc/config/sparc/t-linux64 b/gcc/config/sparc/t-linux64
index d9dfad66ce7..5c5569e36fa 100644
--- a/gcc/config/sparc/t-linux64
+++ b/gcc/config/sparc/t-linux64
@@ -1,5 +1,5 @@
# Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004,
-# 2006, 2010, 2011 Free Software Foundation, Inc.
+# 2006, 2010, 2011, 2012 Free Software Foundation, Inc.
#
# This file is part of GCC.
#
@@ -26,4 +26,5 @@
MULTILIB_OPTIONS = m64/m32
MULTILIB_DIRNAMES = 64 32
-MULTILIB_OSDIRNAMES = ../lib64 $(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib)
+MULTILIB_OSDIRNAMES = ../lib64$(call if_multiarch,:sparc64-linux-gnu)
+MULTILIB_OSDIRNAMES += $(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib)$(call if_multiarch,:sparc-linux-gnu)
diff --git a/gcc/configure b/gcc/configure
index 0ef1b44da3f..68b58d85dc6 100755
--- a/gcc/configure
+++ b/gcc/configure
@@ -765,6 +765,7 @@ enable_shared
enable_fixed_point
enable_decimal_float
with_float
+with_cpu
enable_multiarch
enable_multilib
ENABLE_BUILD_WITH_CXX
@@ -7065,6 +7066,37 @@ $as_echo "$enable_multiarch$ma_msg_suffix" >&6; }
# needed for setting the multiarch name for soft-float/hard-float ABIs
+# Determine whether or not multiarch is enabled.
+# Check whether --enable-multiarch was given.
+if test "${enable_multiarch+set}" = set; then :
+ enableval=$enable_multiarch; case "${enableval}" in
+yes|no|auto) enable_multiarch=$enableval;;
+*) as_fn_error "bad value ${enableval} given for --enable-multiarch option" "$LINENO" 5 ;;
+esac
+else
+ enable_multiarch=auto
+fi
+
+if test x${enable_multiarch} = xauto; then
+ if test x${with_native_system_header_dir} != x; then
+ ma_msg_suffix=", disabled auto check (configured with --native-system-header-dir)"
+ enable_multiarch=no
+ fi
+ if test x$host != x$target && test "x$with_sysroot" = x; then
+ ma_msg_suffix=", disabled auto check (cross build configured without --with-sysroot)"
+ enable_multiarch=no
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for multiarch configuration" >&5
+$as_echo_n "checking for multiarch configuration... " >&6; }
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_multiarch$ma_msg_suffix" >&5
+$as_echo "$enable_multiarch$ma_msg_suffix" >&6; }
+
+# needed for setting the multiarch name for soft-float/hard-float ABIs
+
+
+
# Enable __cxa_atexit for C++.
# Check whether --enable-__cxa_atexit was given.
if test "${enable___cxa_atexit+set}" = set; then :
@@ -18045,7 +18077,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 18048 "configure"
+#line 18080 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -18151,7 +18183,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 18154 "configure"
+#line 18186 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
diff --git a/gcc/configure.ac b/gcc/configure.ac
index 6eacf6ed7aa..4687c7af544 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -648,6 +648,32 @@ AC_MSG_RESULT($enable_multiarch$ma_msg_suffix)
# needed for setting the multiarch name for soft-float/hard-float ABIs
AC_SUBST(with_float)
+# Determine whether or not multiarch is enabled.
+AC_ARG_ENABLE(multiarch,
+[AS_HELP_STRING([--enable-multiarch],
+ [enable support for multiarch paths])],
+[case "${enableval}" in
+yes|no|auto) enable_multiarch=$enableval;;
+*) AC_MSG_ERROR(bad value ${enableval} given for --enable-multiarch option) ;;
+esac], [enable_multiarch=auto])
+if test x${enable_multiarch} = xauto; then
+ if test x${with_native_system_header_dir} != x; then
+ ma_msg_suffix=", disabled auto check (configured with --native-system-header-dir)"
+ enable_multiarch=no
+ fi
+ if test x$host != x$target && test "x$with_sysroot" = x; then
+ ma_msg_suffix=", disabled auto check (cross build configured without --with-sysroot)"
+ enable_multiarch=no
+ fi
+fi
+AC_MSG_CHECKING(for multiarch configuration)
+AC_SUBST(enable_multiarch)
+AC_MSG_RESULT($enable_multiarch$ma_msg_suffix)
+
+# needed for setting the multiarch name for soft-float/hard-float ABIs
+AC_SUBST(with_cpu)
+AC_SUBST(with_float)
+
# Enable __cxa_atexit for C++.
AC_ARG_ENABLE(__cxa_atexit,
[AS_HELP_STRING([--enable-__cxa_atexit], [enable __cxa_atexit for C++])],
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index c1a90010646..c3a28f59c53 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,105 @@
+2013-02-01 Jakub Jelinek <jakub@redhat.com>
+
+ Backported from mainline
+ 2012-12-13 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/55652
+ * typeck2.c (merge_exception_specifiers): Don't call operand_equal_p
+ if noex is NULL.
+
+ 2012-12-06 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/54207
+ * except.c (build_noexcept_spec): Avoid direct comparison
+ with boolean_true_node or boolean_false_node, instead use
+ operand_equal_p and/or INTEGER_CST check.
+ * pt.c (tsubst_exception_specification): Likewise.
+ * typeck2.c (merge_exception_specifiers): Likewise.
+
+ 2012-12-01 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/55542
+ * pt.c (make_ith_pack_parameter_name): Return NULL if
+ name is NULL.
+ (tsubst_decl): Call make_ith_pack_parameter_name even if
+ DECL_NAME is NULL.
+
+ 2012-11-23 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/54046
+ * cp-objcp-common.h (LANG_HOOKS_BLOCK_MAY_FALLTHRU): Redefine.
+ * cp-objcp-common.c (cxx_block_may_fallthru): New function.
+ * cp-tree.h (cxx_block_may_fallthru): New prototype.
+
+2013-01-25 Jason Merrill <jason@redhat.com>
+
+ PR c++/56104
+ * typeck.c (get_member_function_from_ptrfunc): Don't fold
+ POINTER_PLUS_EXPR.
+
+2013-01-22 Jason Merrill <jason@redhat.com>
+
+ * call.c (type_has_extended_temps): Fix C++ism.
+
+ PR c++/53650
+ * call.c (type_has_extended_temps): New.
+ * cp-tree.h: Declare it.
+ * decl.c (check_initializer): Use build_aggr_init for arrays
+ if it is false.
+ * init.c (build_vec_init): Avoid mixed signed/unsigned arithmetic.
+
+ PR c++/56071
+ * pt.c (maybe_instantiate_noexcept): Don't defer access checks.
+
+2013-01-21 Jason Merrill <jason@redhat.com>
+
+ PR c++/56059
+ * tree.c (strip_typedefs_expr) [TREE_VEC]: Preserve non-default
+ template args count.
+
+2013-01-09 Jason Merrill <jason@redhat.com>
+
+ PR c++/55893
+ * decl.c (cp_finish_decl): Clear TREE_READONLY if the variable
+ needs destruction.
+
+2013-01-08 Joel Brobecker <brobecker@adacore.com>
+
+ * parser.c (cp_parser_initializer_list): Move declaration
+ of variable non_const to start of lexical block.
+
+2013-01-04 Jason Merrill <jason@redhat.com>
+
+ PR c++/55877
+ * decl.c (reset_type_linkage, bt_reset_linkage): New.
+ (grokdeclarator): Use reset_type_linkage.
+ * name-lookup.c (binding_table_foreach): Handle null table.
+ * tree.c (decl_anon_ns_mem_p): Check TYPE_MAIN_DECL, not TYPE_NAME.
+
+2013-01-03 Jason Merrill <jason@redhat.com>
+
+ PR c++/55419
+ PR c++/55753
+ * pt.c (tsubst_copy_and_build) [TARGET_EXPR]: Don't touch
+ TREE_CONSTANT.
+
+ PR c++/55842
+ * semantics.c (trait_expr_value): Call maybe_instantiate_noexcept.
+
+ PR c++/55856
+ * semantics.c (build_data_member_initialization): Handle DECL_EXPR.
+
+2013-01-02 Jason Merrill <jason@redhat.com>
+
+ PR c++/54325
+ * call.c (build_new_method_call_1): Don't use build_value_init for
+ user-provided default constructors.
+
+ PR c++/55032
+ PR c++/55245
+ * tree.c (build_cplus_array_type): Copy layout information
+ to main variant if necessary.
+
2012-12-19 Jason Merrill <jason@redhat.com>
PR c++/55724
diff --git a/gcc/cp/call.c b/gcc/cp/call.c
index 648d0032acc..f49851df4ea 100644
--- a/gcc/cp/call.c
+++ b/gcc/cp/call.c
@@ -7218,6 +7218,9 @@ build_new_method_call_1 (tree instance, tree fns, VEC(tree,gc) **args,
build_special_member_call. */
if (CONSTRUCTOR_NELTS (init_list) == 0
&& TYPE_HAS_DEFAULT_CONSTRUCTOR (basetype)
+ /* For a user-provided default constructor, use the normal
+ mechanisms so that protected access works. */
+ && !type_has_user_provided_default_constructor (basetype)
&& !processing_template_decl)
init = build_value_init (basetype, complain);
@@ -8832,6 +8835,29 @@ extend_ref_init_temps (tree decl, tree init, VEC(tree,gc) **cleanups)
return init;
}
+/* Returns true iff an initializer for TYPE could contain temporaries that
+ need to be extended because they are bound to references or
+ std::initializer_list. */
+
+bool
+type_has_extended_temps (tree type)
+{
+ type = strip_array_types (type);
+ if (TREE_CODE (type) == REFERENCE_TYPE)
+ return true;
+ if (CLASS_TYPE_P (type))
+ {
+ tree f;
+ if (is_std_init_list (type))
+ return true;
+ for (f = next_initializable_field (TYPE_FIELDS (type));
+ f; f = next_initializable_field (DECL_CHAIN (f)))
+ if (type_has_extended_temps (TREE_TYPE (f)))
+ return true;
+ }
+ return false;
+}
+
/* Returns true iff TYPE is some variant of std::initializer_list. */
bool
diff --git a/gcc/cp/cp-objcp-common.c b/gcc/cp/cp-objcp-common.c
index a957a0303ac..3782333dab6 100644
--- a/gcc/cp/cp-objcp-common.c
+++ b/gcc/cp/cp-objcp-common.c
@@ -227,6 +227,25 @@ init_shadowed_var_for_decl (void)
tree_decl_map_eq, 0);
}
+/* Return true if stmt can fall thru. Used by block_may_fallthru
+ default case. */
+
+bool
+cxx_block_may_fallthru (const_tree stmt)
+{
+ switch (TREE_CODE (stmt))
+ {
+ case EXPR_STMT:
+ return block_may_fallthru (EXPR_STMT_EXPR (stmt));
+
+ case THROW_EXPR:
+ return false;
+
+ default:
+ return true;
+ }
+}
+
void
cp_common_init_ts (void)
{
diff --git a/gcc/cp/cp-objcp-common.h b/gcc/cp/cp-objcp-common.h
index c668ad8bcad..e2b56ecb932 100644
--- a/gcc/cp/cp-objcp-common.h
+++ b/gcc/cp/cp-objcp-common.h
@@ -94,6 +94,8 @@ extern void cp_common_init_ts (void);
#define LANG_HOOKS_TYPE_HASH_EQ cxx_type_hash_eq
#undef LANG_HOOKS_MISSING_NORETURN_OK_P
#define LANG_HOOKS_MISSING_NORETURN_OK_P cp_missing_noreturn_ok_p
+#undef LANG_HOOKS_BLOCK_MAY_FALLTHRU
+#define LANG_HOOKS_BLOCK_MAY_FALLTHRU cxx_block_may_fallthru
/* Attribute hooks. */
#undef LANG_HOOKS_COMMON_ATTRIBUTE_TABLE
diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h
index 0981cb88dff..bc9dfef2885 100644
--- a/gcc/cp/cp-tree.h
+++ b/gcc/cp/cp-tree.h
@@ -4889,6 +4889,7 @@ extern tree initialize_reference (tree, tree, int,
tsubst_flags_t);
extern tree extend_ref_init_temps (tree, tree, VEC(tree,gc)**);
extern tree make_temporary_var_for_ref_to_temp (tree, tree);
+extern bool type_has_extended_temps (tree);
extern tree strip_top_quals (tree);
extern bool reference_related_p (tree, tree);
extern tree perform_implicit_conversion (tree, tree, tsubst_flags_t);
@@ -5917,6 +5918,7 @@ extern bool cp_var_mod_type_p (tree, tree);
extern void cxx_initialize_diagnostics (diagnostic_context *);
extern int cxx_types_compatible_p (tree, tree);
extern void init_shadowed_var_for_decl (void);
+extern bool cxx_block_may_fallthru (const_tree);
/* in cp-gimplify.c */
extern int cp_gimplify_expr (tree *, gimple_seq *,
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 8bdd6be24f2..48143963e4d 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -5556,7 +5556,9 @@ check_initializer (tree decl, tree init, int flags, VEC(tree,gc) **cleanups)
if ((type_build_ctor_call (type) || CLASS_TYPE_P (type))
&& !(flags & LOOKUP_ALREADY_DIGESTED)
&& !(init && BRACE_ENCLOSED_INITIALIZER_P (init)
- && CP_AGGREGATE_TYPE_P (type)))
+ && CP_AGGREGATE_TYPE_P (type)
+ && (CLASS_TYPE_P (type)
+ || type_has_extended_temps (type))))
{
init_code = build_aggr_init_full_exprs (decl, init, flags);
@@ -6318,6 +6320,10 @@ cp_finish_decl (tree decl, tree init, bool init_const_expr_p,
}
else if (was_readonly)
TREE_READONLY (decl) = 1;
+
+ /* Likewise if it needs destruction. */
+ if (TYPE_HAS_NONTRIVIAL_DESTRUCTOR (type))
+ TREE_READONLY (decl) = 0;
}
make_rtl_for_nonlocal_decl (decl, init, asmspec);
@@ -8300,6 +8306,23 @@ check_var_type (tree identifier, tree type)
return type;
}
+/* Functions for adjusting the visibility of a tagged type and its nested
+ types when it gets a name for linkage purposes from a typedef. */
+
+static void bt_reset_linkage (binding_entry, void *);
+static void
+reset_type_linkage (tree type)
+{
+ set_linkage_according_to_type (type, TYPE_MAIN_DECL (type));
+ if (CLASS_TYPE_P (type))
+ binding_table_foreach (CLASSTYPE_NESTED_UTDS (type), bt_reset_linkage, NULL);
+}
+static void
+bt_reset_linkage (binding_entry b, void *data ATTRIBUTE_UNUSED)
+{
+ reset_type_linkage (b->type);
+}
+
/* Given declspecs and a declarator (abstract or otherwise), determine
the name and type of the object declared and construct a DECL node
for it.
@@ -9798,8 +9821,7 @@ grokdeclarator (const cp_declarator *declarator,
= TYPE_IDENTIFIER (type);
/* Adjust linkage now that we aren't anonymous anymore. */
- set_linkage_according_to_type (type, TYPE_MAIN_DECL (type));
- determine_visibility (TYPE_MAIN_DECL (type));
+ reset_type_linkage (type);
/* FIXME remangle member functions; member functions of a
type with external linkage have external linkage. */
diff --git a/gcc/cp/except.c b/gcc/cp/except.c
index c56dc2c734b..f7a1c7e511a 100644
--- a/gcc/cp/except.c
+++ b/gcc/cp/except.c
@@ -1302,15 +1302,21 @@ build_noexcept_spec (tree expr, int complain)
LOOKUP_NORMAL);
expr = cxx_constant_value (expr);
}
- if (expr == boolean_true_node)
- return noexcept_true_spec;
- else if (expr == boolean_false_node)
- return noexcept_false_spec;
+ if (TREE_CODE (expr) == INTEGER_CST)
+ {
+ if (operand_equal_p (expr, boolean_true_node, 0))
+ return noexcept_true_spec;
+ else
+ {
+ gcc_checking_assert (operand_equal_p (expr, boolean_false_node, 0));
+ return noexcept_false_spec;
+ }
+ }
else if (expr == error_mark_node)
return error_mark_node;
else
{
- gcc_assert (processing_template_decl || expr == error_mark_node
+ gcc_assert (processing_template_decl
|| TREE_CODE (expr) == DEFERRED_NOEXCEPT);
return build_tree_list (expr, NULL_TREE);
}
diff --git a/gcc/cp/init.c b/gcc/cp/init.c
index 483752abd09..39db56169c5 100644
--- a/gcc/cp/init.c
+++ b/gcc/cp/init.c
@@ -3501,7 +3501,9 @@ build_vec_init (tree base, tree maxindex, tree init,
if (TREE_CODE (type) == ARRAY_TYPE)
m = cp_build_binary_op (input_location,
MULT_EXPR, m,
- array_type_nelts_total (type),
+ /* Force signed arithmetic. */
+ convert (TREE_TYPE (m),
+ array_type_nelts_total (type)),
complain);
finish_cleanup_try_block (try_block);
diff --git a/gcc/cp/name-lookup.c b/gcc/cp/name-lookup.c
index 78589af78e2..565d3966ca5 100644
--- a/gcc/cp/name-lookup.c
+++ b/gcc/cp/name-lookup.c
@@ -251,9 +251,13 @@ binding_table_find (binding_table table, tree name)
void
binding_table_foreach (binding_table table, bt_foreach_proc proc, void *data)
{
- const size_t chain_count = table->chain_count;
+ size_t chain_count;
size_t i;
+ if (!table)
+ return;
+
+ chain_count = table->chain_count;
for (i = 0; i < chain_count; ++i)
{
binding_entry entry = table->chain[i];
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index 084269bc264..e701d209f01 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -17664,9 +17664,10 @@ cp_parser_initializer_list (cp_parser* parser, bool* non_constant_p)
&& cp_lexer_next_token_is (parser->lexer, CPP_OPEN_SQUARE))
{
/* In C++11, [ could start a lambda-introducer. */
+ bool non_const = false;
+
cp_parser_parse_tentatively (parser);
cp_lexer_consume_token (parser->lexer);
- bool non_const = false;
designator = cp_parser_constant_expression (parser, true, &non_const);
cp_parser_require (parser, CPP_CLOSE_SQUARE, RT_CLOSE_SQUARE);
cp_parser_require (parser, CPP_EQ, RT_EQ);
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index 8cf0545fd05..4cadda8911f 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -2861,6 +2861,8 @@ make_ith_pack_parameter_name (tree name, int i)
char* newname;
int newname_len;
+ if (name == NULL_TREE)
+ return name;
snprintf (numbuf, NUMBUF_LEN, "%i", i);
newname_len = IDENTIFIER_LENGTH (name)
+ strlen (numbuf) + 2;
@@ -10164,10 +10166,9 @@ tsubst_decl (tree t, tree args, tsubst_flags_t complain)
/* Get the Ith type. */
type = TREE_VEC_ELT (expanded_types, i);
- if (DECL_NAME (r))
- /* Rename the parameter to include the index. */
- DECL_NAME (r) =
- make_ith_pack_parameter_name (DECL_NAME (r), i);
+ /* Rename the parameter to include the index. */
+ DECL_NAME (r)
+ = make_ith_pack_parameter_name (DECL_NAME (r), i);
}
else if (!type)
/* We're dealing with a normal parameter. */
@@ -10736,7 +10737,7 @@ tsubst_exception_specification (tree fntype,
{
/* A noexcept-specifier. */
tree expr = TREE_PURPOSE (specs);
- if (expr == boolean_true_node || expr == boolean_false_node)
+ if (TREE_CODE (expr) == INTEGER_CST)
new_specs = expr;
else if (defer_ok)
{
@@ -14119,10 +14120,8 @@ tsubst_copy_and_build (tree t,
case TARGET_EXPR:
/* We can get here for a constant initializer of non-dependent type.
FIXME stop folding in cp_parser_initializer_clause. */
- gcc_assert (TREE_CONSTANT (t));
{
tree r = get_target_expr (RECUR (TARGET_EXPR_INITIAL (t)));
- TREE_CONSTANT (r) = true;
return r;
}
@@ -18088,12 +18087,14 @@ maybe_instantiate_noexcept (tree fn)
if (push_tinst_level (fn))
{
push_access_scope (fn);
+ push_deferring_access_checks (dk_no_deferred);
input_location = DECL_SOURCE_LOCATION (fn);
noex = tsubst_copy_and_build (DEFERRED_NOEXCEPT_PATTERN (noex),
DEFERRED_NOEXCEPT_ARGS (noex),
tf_warning_or_error, fn,
/*function_p=*/false,
/*integral_constant_expression_p=*/true);
+ pop_deferring_access_checks ();
pop_access_scope (fn);
pop_tinst_level ();
spec = build_noexcept_spec (noex, tf_warning_or_error);
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c
index c18bb841e00..d39d50a5f44 100644
--- a/gcc/cp/semantics.c
+++ b/gcc/cp/semantics.c
@@ -5392,7 +5392,8 @@ trait_expr_value (cp_trait_kind kind, tree type1, tree type2)
return (trait_expr_value (CPTK_HAS_TRIVIAL_CONSTRUCTOR, type1, type2)
|| (CLASS_TYPE_P (type1)
&& (t = locate_ctor (type1))
- && TYPE_NOTHROW_P (TREE_TYPE (t))));
+ && (maybe_instantiate_noexcept (t),
+ TYPE_NOTHROW_P (TREE_TYPE (t)))));
case CPTK_HAS_TRIVIAL_CONSTRUCTOR:
type1 = strip_array_types (type1);
@@ -5785,15 +5786,19 @@ build_data_member_initialization (tree t, VEC(constructor_elt,gc) **vec)
member = TREE_OPERAND (t, 0);
init = unshare_expr (TREE_OPERAND (t, 1));
}
- else
+ else if (TREE_CODE (t) == CALL_EXPR)
{
- gcc_assert (TREE_CODE (t) == CALL_EXPR);
member = CALL_EXPR_ARG (t, 0);
/* We don't use build_cplus_new here because it complains about
abstract bases. Leaving the call unwrapped means that it has the
wrong type, but cxx_eval_constant_expression doesn't care. */
init = unshare_expr (t);
}
+ else if (TREE_CODE (t) == DECL_EXPR)
+ /* Declaring a temporary, don't add it to the CONSTRUCTOR. */
+ return true;
+ else
+ gcc_unreachable ();
if (TREE_CODE (member) == INDIRECT_REF)
member = TREE_OPERAND (member, 0);
if (TREE_CODE (member) == NOP_EXPR)
diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c
index 46d6ed85259..793e7fad51c 100644
--- a/gcc/cp/tree.c
+++ b/gcc/cp/tree.c
@@ -734,6 +734,7 @@ tree
build_cplus_array_type (tree elt_type, tree index_type)
{
tree t;
+ bool needs_ctor, needs_dtor;
if (elt_type == error_mark_node || index_type == error_mark_node)
return error_mark_node;
@@ -799,6 +800,15 @@ build_cplus_array_type (tree elt_type, tree index_type)
t = build_array_type (elt_type, index_type);
}
+ /* Push these needs up so that initialization takes place
+ more easily. */
+ needs_ctor
+ = TYPE_NEEDS_CONSTRUCTING (TYPE_MAIN_VARIANT (elt_type));
+ TYPE_NEEDS_CONSTRUCTING (t) = needs_ctor;
+ needs_dtor
+ = TYPE_HAS_NONTRIVIAL_DESTRUCTOR (TYPE_MAIN_VARIANT (elt_type));
+ TYPE_HAS_NONTRIVIAL_DESTRUCTOR (t) = needs_dtor;
+
/* We want TYPE_MAIN_VARIANT of an array to strip cv-quals from the
element type as well, so fix it up if needed. */
if (elt_type != TYPE_MAIN_VARIANT (elt_type))
@@ -808,18 +818,34 @@ build_cplus_array_type (tree elt_type, tree index_type)
if (TYPE_MAIN_VARIANT (t) != m)
{
+ if (COMPLETE_TYPE_P (t) && !COMPLETE_TYPE_P (m))
+ {
+ /* m was built before the element type was complete, so we
+ also need to copy the layout info from t. */
+ tree size = TYPE_SIZE (t);
+ tree size_unit = TYPE_SIZE_UNIT (t);
+ unsigned int align = TYPE_ALIGN (t);
+ unsigned int user_align = TYPE_USER_ALIGN (t);
+ enum machine_mode mode = TYPE_MODE (t);
+ tree var;
+ for (var = m; var; var = TYPE_NEXT_VARIANT (var))
+ {
+ TYPE_SIZE (var) = size;
+ TYPE_SIZE_UNIT (var) = size_unit;
+ TYPE_ALIGN (var) = align;
+ TYPE_USER_ALIGN (var) = user_align;
+ SET_TYPE_MODE (var, mode);
+ TYPE_NEEDS_CONSTRUCTING (var) = needs_ctor;
+ TYPE_HAS_NONTRIVIAL_DESTRUCTOR (var) = needs_dtor;
+ }
+ }
+
TYPE_MAIN_VARIANT (t) = m;
TYPE_NEXT_VARIANT (t) = TYPE_NEXT_VARIANT (m);
TYPE_NEXT_VARIANT (m) = t;
}
}
- /* Push these needs up so that initialization takes place
- more easily. */
- TYPE_NEEDS_CONSTRUCTING (t)
- = TYPE_NEEDS_CONSTRUCTING (TYPE_MAIN_VARIANT (elt_type));
- TYPE_HAS_NONTRIVIAL_DESTRUCTOR (t)
- = TYPE_HAS_NONTRIVIAL_DESTRUCTOR (TYPE_MAIN_VARIANT (elt_type));
return t;
}
@@ -1312,6 +1338,8 @@ strip_typedefs_expr (tree t)
r = copy_node (t);
for (i = 0; i < n; ++i)
TREE_VEC_ELT (r, i) = VEC_index (tree, vec, i);
+ SET_NON_DEFAULT_TEMPLATE_ARGS_COUNT
+ (r, GET_NON_DEFAULT_TEMPLATE_ARGS_COUNT (t));
}
else
r = t;
@@ -2371,7 +2399,7 @@ decl_anon_ns_mem_p (const_tree decl)
/* Classes and namespaces inside anonymous namespaces have
TREE_PUBLIC == 0, so we can shortcut the search. */
else if (TYPE_P (decl))
- return (TREE_PUBLIC (TYPE_NAME (decl)) == 0);
+ return (TREE_PUBLIC (TYPE_MAIN_DECL (decl)) == 0);
else if (TREE_CODE (decl) == NAMESPACE_DECL)
return (TREE_PUBLIC (decl) == 0);
else
diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c
index 17b6e604dbf..c404c81c5e3 100644
--- a/gcc/cp/typeck.c
+++ b/gcc/cp/typeck.c
@@ -3119,7 +3119,8 @@ get_member_function_from_ptrfunc (tree *instance_ptrptr, tree function)
return error_mark_node;
}
/* ...and then the delta in the PMF. */
- instance_ptr = fold_build_pointer_plus (instance_ptr, delta);
+ instance_ptr = build2 (POINTER_PLUS_EXPR, TREE_TYPE (instance_ptr),
+ instance_ptr, fold_convert (sizetype, delta));
/* Hand back the adjusted 'this' argument to our caller. */
*instance_ptrptr = instance_ptr;
diff --git a/gcc/cp/typeck2.c b/gcc/cp/typeck2.c
index f9ac28b77d4..ce6de1678a0 100644
--- a/gcc/cp/typeck2.c
+++ b/gcc/cp/typeck2.c
@@ -1855,7 +1855,7 @@ merge_exception_specifiers (tree list, tree add, tree fn)
/* If ADD is a deferred noexcept, we must have been called from
process_subob_fn. For implicitly declared functions, we build up
a list of functions to consider at instantiation time. */
- if (noex == boolean_true_node)
+ if (noex && operand_equal_p (noex, boolean_true_node, 0))
noex = NULL_TREE;
gcc_assert (fn && (!noex || is_overloaded_fn (noex)));
noex = build_overload (fn, noex);
diff --git a/gcc/cppdefault.h b/gcc/cppdefault.h
index 7f58a1be310..93f7f88ac59 100644
--- a/gcc/cppdefault.h
+++ b/gcc/cppdefault.h
@@ -1,6 +1,6 @@
/* CPP Library.
Copyright (C) 1986, 1987, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
- 1999, 2000, 2003, 2004, 2006, 2007 Free Software Foundation, Inc.
+ 1999, 2000, 2003, 2004, 2006, 2007, 2012 Free Software Foundation, Inc.
Contributed by Per Bothner, 1994-95.
Based on CCCP program by Paul Rubin, June 1986
Adapted to ANSI C, Richard Stallman, Jan 1987
diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi
index b4d129356b7..393164f3526 100644
--- a/gcc/doc/extend.texi
+++ b/gcc/doc/extend.texi
@@ -1274,7 +1274,7 @@ RAM using the lower two bytes as RAM address.
If the high bit of the address is clear, data is read from flash
with @code{RAMPZ} set according to the high byte of the address.
-Objects in this address space will be located in @code{.progmem.data}.
+Objects in this address space will be located in @code{.progmemx.data}.
@end table
@b{Example}
@@ -10141,11 +10141,11 @@ v32qi __builtin_ia32_mpsadbw256 (v32qi,v32qi,v32qi,int)
v32qi __builtin_ia32_pabsb256 (v32qi)
v16hi __builtin_ia32_pabsw256 (v16hi)
v8si __builtin_ia32_pabsd256 (v8si)
-v16hi builtin_ia32_packssdw256 (v8si,v8si)
+v16hi __builtin_ia32_packssdw256 (v8si,v8si)
v32qi __builtin_ia32_packsswb256 (v16hi,v16hi)
v16hi __builtin_ia32_packusdw256 (v8si,v8si)
v32qi __builtin_ia32_packuswb256 (v16hi,v16hi)
-v32qi__builtin_ia32_paddb256 (v32qi,v32qi)
+v32qi __builtin_ia32_paddb256 (v32qi,v32qi)
v16hi __builtin_ia32_paddw256 (v16hi,v16hi)
v8si __builtin_ia32_paddd256 (v8si,v8si)
v4di __builtin_ia32_paddq256 (v4di,v4di)
@@ -10156,7 +10156,7 @@ v16hi __builtin_ia32_paddusw256 (v16hi,v16hi)
v4di __builtin_ia32_palignr256 (v4di,v4di,int)
v4di __builtin_ia32_andsi256 (v4di,v4di)
v4di __builtin_ia32_andnotsi256 (v4di,v4di)
-v32qi__builtin_ia32_pavgb256 (v32qi,v32qi)
+v32qi __builtin_ia32_pavgb256 (v32qi,v32qi)
v16hi __builtin_ia32_pavgw256 (v16hi,v16hi)
v32qi __builtin_ia32_pblendvb256 (v32qi,v32qi,v32qi)
v16hi __builtin_ia32_pblendw256 (v16hi,v16hi,int)
diff --git a/gcc/doc/install.texi b/gcc/doc/install.texi
index fcded05c043..a14c59f33b3 100644
--- a/gcc/doc/install.texi
+++ b/gcc/doc/install.texi
@@ -1032,6 +1032,15 @@ For ARM targets, possible values for @var{dialect} are @code{gnu} or
@code{gnu2}, which select between the original GNU dialect and the GNU TLS
descriptor-based dialect.
+@item --enable-multiarch
+Specify whether to enable or disable multiarch support. The default is
+to check for glibc start files in a multiarch location, and enable it
+if the files are found. The auto detection is enabled for native builds,
+and for cross builds configured with @option{--with-sysroot}, and without
+@option{--with-native-system-header-dir}.
+More documentation about multiarch can be found at
+@uref{http://wiki.debian.org/Multiarch}.
+
@item --disable-multilib
Specify that multiple target
libraries to support different target variants, calling
@@ -1813,6 +1822,16 @@ being used as the target C library. This causes @code{__eprintf} to be
omitted from @file{libgcc.a} on the assumption that it will be provided by
@samp{newlib}.
+@item --with-avrlibc
+Specifies that @samp{AVR-Libc} is
+being used as the target C library. This causes float support
+functions like @code{__addsf3} to be omitted from @file{libgcc.a} on
+the assumption that it will be provided by @file{libm.a}. For more
+technical details, cf. @uref{http://gcc.gnu.org/PR54461,,PR54461}.
+This option is only supported for the AVR target. It is not supported for
+RTEMS configurations, which currently use newlib. The option is
+supported since version 4.7.2 and is the default in 4.8.0 and newer.
+
@item --with-build-time-tools=@var{dir}
Specifies where to find the set of target tools (assembler, linker, etc.)
that will be used while building GCC itself. This option can be useful
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index a068d7ea2bc..5cb02ed7a3f 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -11564,6 +11564,9 @@ the device name as from the AVR user manual. The difference between
If @var{device} is not a device but only a core architecture like
@code{avr51}, this macro will not be defined.
+@item __AVR_XMEGA__
+The device/architecture belongs to the XMEGA family of devices.
+
@item __AVR_HAVE_ELPM__
The device has the the @code{ELPM} instruction.
diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c
index a95c14611c9..9d877a7b1bb 100644
--- a/gcc/emit-rtl.c
+++ b/gcc/emit-rtl.c
@@ -1839,7 +1839,12 @@ set_mem_attributes_minus_bitpos (rtx ref, tree t, int objectp,
if (!align_computed)
{
- unsigned int obj_align = get_object_alignment (t);
+ unsigned int obj_align;
+ unsigned HOST_WIDE_INT obj_bitpos;
+ obj_align = get_object_alignment_1 (t, &obj_bitpos);
+ obj_bitpos = (obj_bitpos - bitpos) & (obj_align - 1);
+ if (obj_bitpos != 0)
+ obj_align = (obj_bitpos & -obj_bitpos);
attrs.align = MAX (attrs.align, obj_align);
}
}
diff --git a/gcc/expr.c b/gcc/expr.c
index 1dcb9f59c25..4c248e06155 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -8696,6 +8696,54 @@ expand_expr_real_2 (sepops ops, rtx target, enum machine_mode tmode,
if (!target)
target = gen_reg_rtx (TYPE_MODE (type));
+ else
+ /* If target overlaps with op1, then either we need to force
+ op1 into a pseudo (if target also overlaps with op0),
+ or write the complex parts in reverse order. */
+ switch (GET_CODE (target))
+ {
+ case CONCAT:
+ if (reg_overlap_mentioned_p (XEXP (target, 0), op1))
+ {
+ if (reg_overlap_mentioned_p (XEXP (target, 1), op0))
+ {
+ complex_expr_force_op1:
+ temp = gen_reg_rtx (GET_MODE_INNER (GET_MODE (target)));
+ emit_move_insn (temp, op1);
+ op1 = temp;
+ break;
+ }
+ complex_expr_swap_order:
+ /* Move the imaginary (op1) and real (op0) parts to their
+ location. */
+ write_complex_part (target, op1, true);
+ write_complex_part (target, op0, false);
+
+ return target;
+ }
+ break;
+ case MEM:
+ temp = adjust_address_nv (target,
+ GET_MODE_INNER (GET_MODE (target)), 0);
+ if (reg_overlap_mentioned_p (temp, op1))
+ {
+ enum machine_mode imode = GET_MODE_INNER (GET_MODE (target));
+ temp = adjust_address_nv (target, imode,
+ GET_MODE_SIZE (imode));
+ if (reg_overlap_mentioned_p (temp, op0))
+ goto complex_expr_force_op1;
+ goto complex_expr_swap_order;
+ }
+ break;
+ default:
+ if (reg_overlap_mentioned_p (target, op1))
+ {
+ if (reg_overlap_mentioned_p (target, op0))
+ goto complex_expr_force_op1;
+ goto complex_expr_swap_order;
+ }
+ break;
+ }
/* Move the real (op0) and imaginary (op1) parts to their location. */
write_complex_part (target, op0, false);
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index d5fd2a42752..7f17b89b6d3 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -3832,6 +3832,10 @@ make_range_step (location_t loc, enum tree_code code, tree arg0, tree arg1,
switch (code)
{
case TRUTH_NOT_EXPR:
+ /* We can only do something if the range is testing for zero. */
+ if (low == NULL_TREE || high == NULL_TREE
+ || ! integer_zerop (low) || ! integer_zerop (high))
+ return NULL_TREE;
*p_in_p = ! in_p;
return arg0;
@@ -3904,6 +3908,17 @@ make_range_step (location_t loc, enum tree_code code, tree arg0, tree arg1,
return arg0;
case NEGATE_EXPR:
+ /* If flag_wrapv and ARG0_TYPE is signed, make sure
+ low and high are non-NULL, then normalize will DTRT. */
+ if (!TYPE_UNSIGNED (arg0_type)
+ && !TYPE_OVERFLOW_UNDEFINED (arg0_type))
+ {
+ if (low == NULL_TREE)
+ low = TYPE_MIN_VALUE (arg0_type);
+ if (high == NULL_TREE)
+ high = TYPE_MAX_VALUE (arg0_type);
+ }
+
/* (-x) IN [a,b] -> x in [-b, -a] */
n_low = range_binop (MINUS_EXPR, exp_type,
build_int_cst (exp_type, 0),
@@ -13438,10 +13453,22 @@ fold_binary_loc (location_t loc,
TREE_OPERAND (arg1, 1)),
build_int_cst (TREE_TYPE (arg0), 0));
+ /* Similarly for X < (cast) (1 << Y). But cast can't be narrowing,
+ otherwise Y might be >= # of bits in X's type and thus e.g.
+ (unsigned char) (1 << Y) for Y 15 might be 0.
+ If the cast is widening, then 1 << Y should have unsigned type,
+ otherwise if Y is number of bits in the signed shift type minus 1,
+ we can't optimize this. E.g. (unsigned long long) (1 << Y) for Y
+ 31 might be 0xffffffff80000000. */
if ((code == LT_EXPR || code == GE_EXPR)
&& TYPE_UNSIGNED (TREE_TYPE (arg0))
&& CONVERT_EXPR_P (arg1)
&& TREE_CODE (TREE_OPERAND (arg1, 0)) == LSHIFT_EXPR
+ && (TYPE_PRECISION (TREE_TYPE (arg1))
+ >= TYPE_PRECISION (TREE_TYPE (TREE_OPERAND (arg1, 0))))
+ && (TYPE_UNSIGNED (TREE_TYPE (TREE_OPERAND (arg1, 0)))
+ || (TYPE_PRECISION (TREE_TYPE (arg1))
+ == TYPE_PRECISION (TREE_TYPE (TREE_OPERAND (arg1, 0)))))
&& integer_onep (TREE_OPERAND (TREE_OPERAND (arg1, 0), 0)))
{
tem = build2 (RSHIFT_EXPR, TREE_TYPE (arg0), arg0,
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index 72a6659df10..91618a1a96f 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,80 @@
+2013-02-02 Thomas Koenig <tkoenig@gcc.gnu.org>
+
+ Backport from trunk
+ PR fortran/50627
+ PR fortran/56054
+ * decl.c (gfc_match_end): Remove half-ready namespace
+ from parent if the end of a block is missing.
+ * parse.c (parse_module): Do not put namespace into
+ gsymbol on error.
+
+2013-02-01 Jakub Jelinek <jakub@redhat.com>
+
+ Backported from mainline
+ 2013-01-23 Jakub Jelinek <jakub@redhat.com>
+
+ PR fortran/56052
+ * trans-decl.c (gfc_get_symbol_decl): Set DECL_ARTIFICIAL
+ and DECL_IGNORED_P on select_type_temporary and don't set
+ DECL_BY_REFERENCE.
+
+2013-01-24 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/56081
+ * resolve.c (resolve_select): Add argument 'select_type', reject
+ non-scalar expressions.
+ (resolve_select_type,resolve_code): Pass new argument to
+ 'resolve_select'.
+
+2013-01-17 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/55983
+ * class.c (find_typebound_proc_uop): Check for f2k_derived instead of
+ asserting it.
+
+2013-01-13 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/55072
+ * trans-array.c (gfc_conv_array_parameter): No packing was done for
+ full arrays of derived type.
+
+2013-01-13 Paul Thomas <pault@gcc.gnu.org>
+
+ PR fortran/55618
+ * trans-expr.c (gfc_conv_procedure_call): Dereference scalar
+ character function arguments to elemental procedures in
+ scalarization loops.
+
+2013-01-08 Mikael Morin <mikael@gcc.gnu.org>
+
+ PR fortran/42769
+ PR fortran/45836
+ PR fortran/45900
+ * module.c (read_module): Don't reuse local symtree if the associated
+ symbol isn't exactly the one wanted. Don't reuse local symtree if it is
+ ambiguous.
+ * resolve.c (resolve_call): Use symtree's name instead of symbol's to
+ lookup the symtree.
+
+2013-01-07 Tobias Burnus <burnus@net-b.de>
+ Thomas Koenig <tkoenig@gcc.gnu.org>
+ Jakub Jelinek <jakub@redhat.com>
+
+ PR fortran/55852
+ * expr.c (gfc_build_intrinsic_call): Avoid clashes
+ with user's procedures.
+ * gfortran.h (gfc_build_intrinsic_call): Update prototype.
+ (GFC_PREFIX): Define.
+ * simplify.c (gfc_simplify_size): Update call.
+
+2013-01-07 Steven G. Kargl <kargl@gcc.gnu.org>
+ Mikael Morin <mikael@gcc.gnu.org>
+
+ PR fortran/55827
+ * class.c (gfc_fix_class_refs): Adapt ts initialization for the case
+ e->symtree == NULL.
+ * trans-expr.c (gfc_conv_function_expr): Init sym earlier. Use it.
+
2012-12-20 Tobias Burnus <burnus@net-b.de>
PR fortran/54818
@@ -579,7 +656,7 @@
PR fortran/50981
* trans-array.c (gfc_walk_elemental_function_args): Fix
- passing of deallocated allocatables/pointers as absent argument.
+ passing of deallocated allocatables/pointers as absent argument.
2012-01-16 Tobias Burnus <burnus@net-b.de>
@@ -615,7 +692,7 @@
2012-01-16 Paul Thomas <pault@gcc.gnu.org>
* trans-array.c (gfc_trans_create_temp_array): In the case of a
- class array temporary, detect a null 'eltype' on entry and use
+ class array temporary, detect a null 'eltype' on entry and use
'initial' to provde the class reference and so, through the
vtable, the element size for the dynamic type.
* trans-stmt.c (gfc_conv_elemental_dependencies): For class
diff --git a/gcc/fortran/class.c b/gcc/fortran/class.c
index bfa8740288a..d4ed6b043ac 100644
--- a/gcc/fortran/class.c
+++ b/gcc/fortran/class.c
@@ -162,7 +162,23 @@ gfc_fix_class_refs (gfc_expr *e)
&& e->value.function.isym != NULL))
return;
- ts = &e->symtree->n.sym->ts;
+ if (e->expr_type == EXPR_VARIABLE)
+ ts = &e->symtree->n.sym->ts;
+ else
+ {
+ gfc_symbol *func;
+
+ gcc_assert (e->expr_type == EXPR_FUNCTION);
+ if (e->value.function.esym != NULL)
+ func = e->value.function.esym;
+ else
+ func = e->symtree->n.sym;
+
+ if (func->result != NULL)
+ ts = &func->result->ts;
+ else
+ ts = &func->ts;
+ }
for (ref = &e->ref; *ref != NULL; ref = &(*ref)->next)
{
@@ -924,15 +940,17 @@ find_typebound_proc_uop (gfc_symbol* derived, gfc_try* t,
gfc_symtree* res;
gfc_symtree* root;
- /* Set correct symbol-root. */
- gcc_assert (derived->f2k_derived);
- root = (uop ? derived->f2k_derived->tb_uop_root
- : derived->f2k_derived->tb_sym_root);
-
/* Set default to failure. */
if (t)
*t = FAILURE;
+ if (derived->f2k_derived)
+ /* Set correct symbol-root. */
+ root = (uop ? derived->f2k_derived->tb_uop_root
+ : derived->f2k_derived->tb_sym_root);
+ else
+ return NULL;
+
/* Try to find it in the current type's namespace. */
res = gfc_find_symtree (root, name);
if (res && res->n.tb && !res->n.tb->error)
diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c
index 8afccd5e31e..dbcd2a0a8d2 100644
--- a/gcc/fortran/decl.c
+++ b/gcc/fortran/decl.c
@@ -5896,6 +5896,8 @@ gfc_match_end (gfc_statement *st)
const char *target;
int eos_ok;
match m;
+ gfc_namespace *parent_ns, *ns, *prev_ns;
+ gfc_namespace **nsp;
old_loc = gfc_current_locus;
if (gfc_match ("end") != MATCH_YES)
@@ -6121,6 +6123,35 @@ syntax:
cleanup:
gfc_current_locus = old_loc;
+
+ /* If we are missing an END BLOCK, we created a half-ready namespace.
+ Remove it from the parent namespace's sibling list. */
+
+ if (state == COMP_BLOCK)
+ {
+ parent_ns = gfc_current_ns->parent;
+
+ nsp = &(gfc_state_stack->previous->tail->ext.block.ns);
+
+ prev_ns = NULL;
+ ns = *nsp;
+ while (ns)
+ {
+ if (ns == gfc_current_ns)
+ {
+ if (prev_ns == NULL)
+ *nsp = NULL;
+ else
+ prev_ns->sibling = ns->sibling;
+ }
+ prev_ns = ns;
+ ns = ns->sibling;
+ }
+
+ gfc_free_namespace (gfc_current_ns);
+ gfc_current_ns = parent_ns;
+ }
+
return MATCH_ERROR;
}
diff --git a/gcc/fortran/expr.c b/gcc/fortran/expr.c
index 18e26e34c3a..8e52c472bad 100644
--- a/gcc/fortran/expr.c
+++ b/gcc/fortran/expr.c
@@ -4511,29 +4511,36 @@ gfc_is_simply_contiguous (gfc_expr *expr, bool strict)
want to add arguments but with a NULL-expression. */
gfc_expr*
-gfc_build_intrinsic_call (const char* name, locus where, unsigned numarg, ...)
+gfc_build_intrinsic_call (gfc_namespace *ns, gfc_isym_id id, const char* name,
+ locus where, unsigned numarg, ...)
{
gfc_expr* result;
gfc_actual_arglist* atail;
gfc_intrinsic_sym* isym;
va_list ap;
unsigned i;
+ const char *mangled_name = gfc_get_string (GFC_PREFIX ("%s"), name);
- isym = gfc_find_function (name);
+ isym = gfc_intrinsic_function_by_id (id);
gcc_assert (isym);
result = gfc_get_expr ();
result->expr_type = EXPR_FUNCTION;
result->ts = isym->ts;
result->where = where;
- result->value.function.name = name;
+ result->value.function.name = mangled_name;
result->value.function.isym = isym;
- result->symtree = gfc_find_symtree (gfc_current_ns->sym_root, name);
+ gfc_get_sym_tree (mangled_name, ns, &result->symtree, false);
+ gfc_commit_symbol (result->symtree->n.sym);
gcc_assert (result->symtree
&& (result->symtree->n.sym->attr.flavor == FL_PROCEDURE
|| result->symtree->n.sym->attr.flavor == FL_UNKNOWN));
+ result->symtree->n.sym->intmod_sym_id = id;
+ result->symtree->n.sym->attr.flavor = FL_PROCEDURE;
+ result->symtree->n.sym->attr.intrinsic = 1;
+
va_start (ap, numarg);
atail = NULL;
for (i = 0; i < numarg; ++i)
diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h
index a5edd1306ad..6e1fc780d66 100644
--- a/gcc/fortran/gfortran.h
+++ b/gcc/fortran/gfortran.h
@@ -61,6 +61,15 @@ along with GCC; see the file COPYING3. If not see
#define PREFIX(x) "_gfortran_" x
#define PREFIX_LEN 10
+/* A prefix for internal variables, which are not user-visible. */
+#if !defined (NO_DOT_IN_LABEL)
+# define GFC_PREFIX(x) "_F." x
+#elif !defined (NO_DOLLAR_IN_LABEL)
+# define GFC_PREFIX(x) "_F$" x
+#else
+# define GFC_PREFIX(x) "_F_" x
+#endif
+
#define BLANK_COMMON_NAME "__BLNK__"
/* Macro to initialize an mstring structure. */
@@ -2764,7 +2773,8 @@ int gfc_get_corank (gfc_expr *);
bool gfc_has_ultimate_allocatable (gfc_expr *);
bool gfc_has_ultimate_pointer (gfc_expr *);
-gfc_expr* gfc_build_intrinsic_call (const char*, locus, unsigned, ...);
+gfc_expr* gfc_build_intrinsic_call (gfc_namespace *, gfc_isym_id, const char*,
+ locus, unsigned, ...);
gfc_try gfc_check_vardef_context (gfc_expr*, bool, bool, const char*);
diff --git a/gcc/fortran/module.c b/gcc/fortran/module.c
index e3631777fb4..f6662b47997 100644
--- a/gcc/fortran/module.c
+++ b/gcc/fortran/module.c
@@ -4641,8 +4641,14 @@ read_module (void)
if (p == NULL)
{
st = gfc_find_symtree (gfc_current_ns->sym_root, name);
- if (st != NULL)
- info->u.rsym.symtree = st;
+ if (st != NULL
+ && strcmp (st->n.sym->name, info->u.rsym.true_name) == 0
+ && st->n.sym->module != NULL
+ && strcmp (st->n.sym->module, info->u.rsym.module) == 0)
+ {
+ info->u.rsym.symtree = st;
+ info->u.rsym.sym = st->n.sym;
+ }
continue;
}
@@ -4663,7 +4669,8 @@ read_module (void)
/* Check for ambiguous symbols. */
if (check_for_ambiguous (st->n.sym, info))
st->ambiguous = 1;
- info->u.rsym.symtree = st;
+ else
+ info->u.rsym.symtree = st;
}
else
{
diff --git a/gcc/fortran/parse.c b/gcc/fortran/parse.c
index 317fb845479..5fbddd0e4b6 100644
--- a/gcc/fortran/parse.c
+++ b/gcc/fortran/parse.c
@@ -4283,6 +4283,7 @@ parse_module (void)
{
gfc_statement st;
gfc_gsymbol *s;
+ bool error;
s = gfc_get_gsymbol (gfc_new_block->name);
if (s->defined || (s->type != GSYM_UNKNOWN && s->type != GSYM_MODULE))
@@ -4296,6 +4297,7 @@ parse_module (void)
st = parse_spec (ST_NONE);
+ error = false;
loop:
switch (st)
{
@@ -4314,12 +4316,15 @@ loop:
gfc_error ("Unexpected %s statement in MODULE at %C",
gfc_ascii_statement (st));
+ error = true;
reject_statement ();
st = next_statement ();
goto loop;
}
- s->ns = gfc_current_ns;
+ /* Make sure not to free the namespace twice on error. */
+ if (!error)
+ s->ns = gfc_current_ns;
}
diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c
index bbc1c2208fb..17efdb5b373 100644
--- a/gcc/fortran/resolve.c
+++ b/gcc/fortran/resolve.c
@@ -94,7 +94,7 @@ static bool
is_sym_host_assoc (gfc_symbol *sym, gfc_namespace *ns)
{
for (ns = ns->parent; ns; ns = ns->parent)
- {
+ {
if (sym->ns == ns)
return true;
}
@@ -165,7 +165,7 @@ resolve_procedure_interface (gfc_symbol *sym)
sym->ts = ifc->result->ts;
sym->result = sym;
}
- else
+ else
sym->ts = ifc->ts;
sym->ts.interface = ifc;
sym->attr.function = ifc->attr.function;
@@ -513,7 +513,7 @@ resolve_contained_fntype (gfc_symbol *sym, gfc_namespace *ns)
}
}
- /* Fortran 95 Draft Standard, page 51, Section 5.1.1.5, on the Character
+ /* Fortran 95 Draft Standard, page 51, Section 5.1.1.5, on the Character
type, lists the only ways a character length value of * can be used:
dummy arguments of procedures, named constants, and function results
in external functions. Internal function results and results of module
@@ -1255,7 +1255,7 @@ generic_sym (gfc_symbol *sym)
return 0;
gfc_find_symbol (sym->name, sym->ns->parent, 1, &s);
-
+
if (s != NULL)
{
if (s == sym)
@@ -1376,7 +1376,7 @@ count_specific_procs (gfc_expr *e)
int n;
gfc_interface *p;
gfc_symbol *sym;
-
+
n = 0;
sym = e->symtree->n.sym;
@@ -1579,7 +1579,7 @@ resolve_procedure_expression (gfc_expr* expr)
gfc_warning ("Non-RECURSIVE procedure '%s' at %L is possibly calling"
" itself recursively. Declare it RECURSIVE or use"
" -frecursive", sym->name, &expr->where);
-
+
return SUCCESS;
}
@@ -1687,7 +1687,7 @@ resolve_actual_arglist (gfc_actual_arglist *arg, procedure_type ptype,
with the same name before emitting an error. */
if (sym->attr.generic && count_specific_procs (e) != 1)
return FAILURE;
-
+
/* Just in case a specific was found for the expression. */
sym = e->symtree->n.sym;
@@ -1876,7 +1876,7 @@ resolve_elemental_actual (gfc_expr *expr, gfc_code *c)
else if (c && c->ext.actual != NULL)
{
arg0 = c->ext.actual;
-
+
if (c->resolved_sym)
esym = c->resolved_sym;
else
@@ -2275,7 +2275,7 @@ resolve_global_procedure (gfc_symbol *sym, locus *where,
&& !(gfc_option.warn_std & GFC_STD_GNU)))
gfc_errors_to_warnings (1);
- if (sym->attr.if_source != IFSRC_IFBODY)
+ if (sym->attr.if_source != IFSRC_IFBODY)
gfc_procedure_use (def_sym, actual, where);
gfc_errors_to_warnings (0);
@@ -2679,7 +2679,7 @@ is_scalar_expr_ptr (gfc_expr *expr)
{
/* We have constant lower and upper bounds. If the
difference between is 1, it can be considered a
- scalar.
+ scalar.
FIXME: Use gfc_dep_compare_expr instead. */
start = (int) mpz_get_si
(ref->u.ar.as->lower[0]->value.integer);
@@ -2746,7 +2746,7 @@ gfc_iso_c_func_interface (gfc_symbol *sym, gfc_actual_arglist *args,
the actual expression could be a part-ref of the expr symbol. */
arg_ts = &(args->expr->ts);
arg_attr = gfc_expr_attr (args->expr);
-
+
if (sym->intmod_sym_id == ISOCBINDING_ASSOCIATED)
{
/* If the user gave two args then they are providing something for
@@ -2835,7 +2835,7 @@ gfc_iso_c_func_interface (gfc_symbol *sym, gfc_actual_arglist *args,
if (seen_section && retval == SUCCESS)
gfc_warning ("Array section in '%s' call at %L", name,
&(args->expr->where));
-
+
/* See if we have interoperable type and type param. */
if (gfc_verify_c_interop (arg_ts) == SUCCESS
|| gfc_check_any_c_kind (arg_ts) == SUCCESS)
@@ -2849,7 +2849,7 @@ gfc_iso_c_func_interface (gfc_symbol *sym, gfc_actual_arglist *args,
is not an array of zero size. */
if (args_sym->attr.allocatable == 1)
{
- if (args_sym->attr.dimension != 0
+ if (args_sym->attr.dimension != 0
&& (args_sym->as && args_sym->as->rank == 0))
{
gfc_error_now ("Allocatable variable '%s' used as a "
@@ -2888,7 +2888,7 @@ gfc_iso_c_func_interface (gfc_symbol *sym, gfc_actual_arglist *args,
retval = FAILURE;
}
}
-
+
/* Make sure it's not a character string. Arrays of
any type should be ok if the variable is of a C
interoperable type. */
@@ -2928,7 +2928,7 @@ gfc_iso_c_func_interface (gfc_symbol *sym, gfc_actual_arglist *args,
with no length type parameters. It still must have either
the pointer or target attribute, and it can be
allocatable (but must be allocated when c_loc is called). */
- if (args->expr->rank != 0
+ if (args->expr->rank != 0
&& is_scalar_expr_ptr (args->expr) != SUCCESS)
{
gfc_error_now ("Parameter '%s' to '%s' at %L must be a "
@@ -2936,7 +2936,7 @@ gfc_iso_c_func_interface (gfc_symbol *sym, gfc_actual_arglist *args,
&(args->expr->where));
retval = FAILURE;
}
- else if (arg_ts->type == BT_CHARACTER
+ else if (arg_ts->type == BT_CHARACTER
&& is_scalar_expr_ptr (args->expr) != SUCCESS)
{
gfc_error_now ("CHARACTER argument '%s' to '%s' at "
@@ -2975,7 +2975,7 @@ gfc_iso_c_func_interface (gfc_symbol *sym, gfc_actual_arglist *args,
retval = FAILURE;
}
}
-
+
/* for c_loc/c_funloc, the new symbol is the same as the old one */
*new_sym = sym;
}
@@ -3010,7 +3010,7 @@ resolve_function (gfc_expr *expr)
/* If this is a procedure pointer component, it has already been resolved. */
if (gfc_is_proc_ptr_comp (expr, NULL))
return SUCCESS;
-
+
if (sym && sym->attr.intrinsic
&& resolve_intrinsic (sym, &expr->where) == FAILURE)
return FAILURE;
@@ -3049,7 +3049,7 @@ resolve_function (gfc_expr *expr)
}
inquiry_argument = false;
-
+
/* Need to setup the call to the correct c_associated, depending on
the number of cptrs to user gives to compare. */
if (sym && sym->attr.is_iso_c == 1)
@@ -3057,12 +3057,12 @@ resolve_function (gfc_expr *expr)
if (gfc_iso_c_func_interface (sym, expr->value.function.actual, &sym)
== FAILURE)
return FAILURE;
-
+
/* Get the symtree for the new symbol (resolved func).
the old one will be freed later, when it's no longer used. */
gfc_find_sym_tree (sym->name, sym->ns, 1, &(expr->symtree));
}
-
+
/* Resume assumed_size checking. */
need_full_assumed_size--;
@@ -3391,7 +3391,7 @@ set_name_and_label (gfc_code *c, gfc_symbol *sym,
sprintf (name, "%s_%c%d", sym->name, type, kind);
/* Set up the binding label as the given symbol's label plus
the type and kind. */
- *binding_label = gfc_get_string ("%s_%c%d", sym->binding_label, type,
+ *binding_label = gfc_get_string ("%s_%c%d", sym->binding_label, type,
kind);
}
else
@@ -3402,7 +3402,7 @@ set_name_and_label (gfc_code *c, gfc_symbol *sym,
sprintf (name, "%s", sym->name);
*binding_label = sym->binding_label;
}
-
+
return;
}
@@ -3426,7 +3426,7 @@ gfc_iso_c_sub_interface (gfc_code *c, gfc_symbol *sym)
/* default to success; will override if find error */
match m = MATCH_YES;
- /* Make sure the actual arguments are in the necessary order (based on the
+ /* Make sure the actual arguments are in the necessary order (based on the
formal args) before resolving. */
gfc_procedure_use (sym, &c->ext.actual, &(c->loc));
@@ -3434,7 +3434,7 @@ gfc_iso_c_sub_interface (gfc_code *c, gfc_symbol *sym)
(sym->intmod_sym_id == ISOCBINDING_F_PROCPOINTER))
{
set_name_and_label (c, sym, name, &binding_label);
-
+
if (sym->intmod_sym_id == ISOCBINDING_F_POINTER)
{
if (c->ext.actual != NULL && c->ext.actual->next != NULL)
@@ -3445,7 +3445,7 @@ gfc_iso_c_sub_interface (gfc_code *c, gfc_symbol *sym)
gfc_procedure_use() (called above to sort actual args). */
if (c->ext.actual->next->expr->rank != 0)
{
- if(c->ext.actual->next->next == NULL
+ if(c->ext.actual->next->next == NULL
|| c->ext.actual->next->next->expr == NULL)
{
m = MATCH_ERROR;
@@ -3464,12 +3464,12 @@ gfc_iso_c_sub_interface (gfc_code *c, gfc_symbol *sym)
}
}
}
-
+
if (m != MATCH_ERROR)
{
/* the 1 means to add the optional arg to formal list */
new_sym = get_iso_c_sym (sym, name, binding_label, 1);
-
+
/* for error reporting, say it's declared where the original was */
new_sym->declared_at = sym->declared_at;
}
@@ -3485,7 +3485,7 @@ gfc_iso_c_sub_interface (gfc_code *c, gfc_symbol *sym)
c->resolved_sym = new_sym;
else
c->resolved_sym = sym;
-
+
return m;
}
@@ -3502,7 +3502,7 @@ resolve_specific_s0 (gfc_code *c, gfc_symbol *sym)
m = gfc_iso_c_sub_interface (c,sym);
return m;
}
-
+
if (sym->attr.external || sym->attr.if_source == IFSRC_IFBODY)
{
if (sym->attr.dummy)
@@ -3636,7 +3636,7 @@ resolve_call (gfc_code *c)
if (csym && gfc_current_ns->parent && csym->ns != gfc_current_ns)
{
gfc_symtree *st;
- gfc_find_sym_tree (csym->name, gfc_current_ns, 1, &st);
+ gfc_find_sym_tree (c->symtree->name, gfc_current_ns, 1, &st);
sym = st ? st->n.sym : NULL;
if (sym && csym != sym
&& sym->ns == gfc_current_ns
@@ -3921,7 +3921,7 @@ resolve_operator (gfc_expr *e)
if (op1->ts.type == BT_LOGICAL && op2->ts.type == BT_LOGICAL)
sprintf (msg,
_("Logicals at %%L must be compared with %s instead of %s"),
- (e->value.op.op == INTRINSIC_EQ
+ (e->value.op.op == INTRINSIC_EQ
|| e->value.op.op == INTRINSIC_EQ_OS)
? ".eqv." : ".neqv.", gfc_op2string (e->value.op.op));
else
@@ -4161,7 +4161,7 @@ compare_bound_mpz_t (gfc_expr *a, mpz_t b)
}
-/* Compute the last value of a sequence given by a triplet.
+/* Compute the last value of a sequence given by a triplet.
Return 0 if it wasn't able to compute the last value, or if the
sequence if empty, and 1 otherwise. */
@@ -6003,7 +6003,7 @@ resolve_typebound_function (gfc_expr* e)
e->value.function.esym = NULL;
e->symtree = st;
- if (new_ref)
+ if (new_ref)
e->ref = new_ref;
/* '_vptr' points to the vtab, which contains the procedure pointers. */
@@ -6321,7 +6321,7 @@ gfc_resolve_expr (gfc_expr *e)
if (t == SUCCESS && e->ts.type == BT_CHARACTER)
{
/* For efficiency, we call gfc_expand_constructor for BT_CHARACTER
- here rather then add a duplicate test for it above. */
+ here rather then add a duplicate test for it above. */
gfc_expand_constructor (e, false);
t = gfc_resolve_character_array_constructor (e);
}
@@ -6478,7 +6478,7 @@ forall_index (gfc_expr *expr, gfc_symbol *sym, int *f)
{
if (expr->expr_type != EXPR_VARIABLE)
return false;
-
+
/* A scalar assignment */
if (!expr->ref || *f == 1)
{
@@ -6761,7 +6761,7 @@ remove_last_array_ref (gfc_expr* e)
/* Used in resolve_allocate_expr to check that a allocation-object and
- a source-expr are conformable. This does not catch all possible
+ a source-expr are conformable. This does not catch all possible
cases; in particular a runtime checking is needed. */
static gfc_try
@@ -6769,7 +6769,7 @@ conformable_arrays (gfc_expr *e1, gfc_expr *e2)
{
gfc_ref *tail;
for (tail = e2->ref; tail && tail->next; tail = tail->next);
-
+
/* First compare rank. */
if (tail && e1->rank != tail->u.ar.as->rank)
{
@@ -7032,7 +7032,7 @@ resolve_allocate_expr (gfc_expr *e, gfc_code *code)
using _copy and trans_call. It is convenient to exploit that
when the allocated type is different from the declared type but
no SOURCE exists by setting expr3. */
- code->expr3 = gfc_default_initializer (&code->ext.alloc.ts);
+ code->expr3 = gfc_default_initializer (&code->ext.alloc.ts);
}
else if (!code->expr3)
{
@@ -7293,7 +7293,7 @@ resolve_allocate_deallocate (gfc_code *code, const char *fcn)
/* This is a potential collision. */
gfc_ref *pr = pe->ref;
gfc_ref *qr = qe->ref;
-
+
/* Follow the references until
a) They start to differ, in which case there is no error;
you can deallocate a%b and a%c in a single statement
@@ -7348,7 +7348,7 @@ resolve_allocate_deallocate (gfc_code *code, const char *fcn)
if (pr->u.c.component->name != qr->u.c.component->name)
break;
}
-
+
pr = pr->next;
qr = qr->next;
}
@@ -7375,7 +7375,7 @@ resolve_allocate_deallocate (gfc_code *code, const char *fcn)
/* Callback function for our mergesort variant. Determines interval
overlaps for CASEs. Return <0 if op1 < op2, 0 for overlap, >0 for
- op1 > op2. Assumes we're not dealing with the default case.
+ op1 > op2. Assumes we're not dealing with the default case.
We have op1 = (:L), (K:L) or (K:) and op2 = (:N), (M:N) or (M:).
There are nine situations to check. */
@@ -7624,7 +7624,7 @@ validate_case_label_expr (gfc_expr *e, gfc_expr *case_expr)
expression. */
static void
-resolve_select (gfc_code *code)
+resolve_select (gfc_code *code, bool select_type)
{
gfc_code *body;
gfc_expr *case_expr;
@@ -7654,8 +7654,9 @@ resolve_select (gfc_code *code)
}
case_expr = code->expr1;
-
type = case_expr->ts.type;
+
+ /* F08:C830. */
if (type != BT_LOGICAL && type != BT_INTEGER && type != BT_CHARACTER)
{
gfc_error ("Argument of SELECT statement at %L cannot be %s",
@@ -7665,6 +7666,16 @@ resolve_select (gfc_code *code)
return;
}
+ /* F08:R842. */
+ if (!select_type && case_expr->rank != 0)
+ {
+ gfc_error ("Argument of SELECT statement at %L must be a scalar "
+ "expression", &case_expr->where);
+
+ /* Punt. */
+ return;
+ }
+
/* Raise a warning if an INTEGER case value exceeds the range of
the case-expr. Later, all expressions will be promoted to the
largest kind of all case-labels. */
@@ -8066,7 +8077,7 @@ resolve_select_type (gfc_code *code, gfc_namespace *old_ns)
default_case = body;
}
}
-
+
if (error > 0)
return;
@@ -8085,7 +8096,7 @@ resolve_select_type (gfc_code *code, gfc_namespace *old_ns)
assoc->target = gfc_copy_expr (code->expr2);
assoc->target->where = code->expr2->where;
/* assoc->variable will be set by resolve_assoc_var. */
-
+
code->ext.block.assoc = assoc;
code->expr1->symtree->n.sym->assoc = assoc;
@@ -8156,7 +8167,7 @@ resolve_select_type (gfc_code *code, gfc_namespace *old_ns)
resolve_assoc_var (st->n.sym, false);
}
-
+
/* Take out CLASS IS cases for separate treatment. */
body = code;
while (body && body->block)
@@ -8165,7 +8176,7 @@ resolve_select_type (gfc_code *code, gfc_namespace *old_ns)
{
/* Add to class_is list. */
if (class_is == NULL)
- {
+ {
class_is = body->block;
tail = class_is;
}
@@ -8186,7 +8197,7 @@ resolve_select_type (gfc_code *code, gfc_namespace *old_ns)
if (class_is)
{
gfc_symbol *vtab;
-
+
if (!default_case)
{
/* Add a default case to hold the CLASS IS cases. */
@@ -8234,7 +8245,7 @@ resolve_select_type (gfc_code *code, gfc_namespace *old_ns)
}
while (swapped);
}
-
+
/* Generate IF chain. */
if_st = gfc_get_code ();
if_st->op = EXEC_IF;
@@ -8270,7 +8281,7 @@ resolve_select_type (gfc_code *code, gfc_namespace *old_ns)
new_st->op = EXEC_IF;
new_st->next = default_case->next;
}
-
+
/* Replace CLASS DEFAULT code by the IF chain. */
default_case->next = if_st;
}
@@ -8281,13 +8292,13 @@ resolve_select_type (gfc_code *code, gfc_namespace *old_ns)
gfc_resolve_blocks (code->block, gfc_current_ns);
gfc_current_ns = old_ns;
- resolve_select (code);
+ resolve_select (code, true);
}
/* Resolve a transfer statement. This is making sure that:
-- a derived type being transferred has only non-pointer components
- -- a derived type being transferred doesn't have private components, unless
+ -- a derived type being transferred doesn't have private components, unless
it's being transferred from the module where the type was defined
-- we're not trying to transfer a whole assumed size array. */
@@ -8391,7 +8402,7 @@ resolve_transfer (gfc_code *code)
/* Find the set of labels that are reachable from this block. We also
record the last statement in each block. */
-
+
static void
find_reachable_labels (gfc_code *block)
{
@@ -8697,7 +8708,7 @@ resolve_where (gfc_code *code, gfc_expr *mask)
"inconsistent shape", &cnext->expr1->where);
break;
-
+
case EXEC_ASSIGN_CALL:
resolve_call (cnext);
if (!cnext->resolved_sym->attr.elemental)
@@ -8783,7 +8794,7 @@ gfc_resolve_where_code_in_forall (gfc_code *code, int nvar,
case EXEC_ASSIGN:
gfc_resolve_assign_in_forall (cnext, nvar, var_expr);
break;
-
+
/* WHERE operator assignment statement */
case EXEC_ASSIGN_CALL:
resolve_call (cnext);
@@ -8851,10 +8862,10 @@ gfc_resolve_forall_body (gfc_code *code, int nvar, gfc_expr **var_expr)
/* Counts the number of iterators needed inside a forall construct, including
- nested forall constructs. This is used to allocate the needed memory
+ nested forall constructs. This is used to allocate the needed memory
in gfc_resolve_forall. */
-static int
+static int
gfc_count_forall_iterators (gfc_code *code)
{
int max_iters, sub_iters, current_iters;
@@ -8866,11 +8877,11 @@ gfc_count_forall_iterators (gfc_code *code)
for (fa = code->ext.forall_iterator; fa; fa = fa->next)
current_iters ++;
-
+
code = code->block->next;
while (code)
- {
+ {
if (code->op == EXEC_FORALL)
{
sub_iters = gfc_count_forall_iterators (code);
@@ -9491,7 +9502,7 @@ resolve_code (gfc_code *code, gfc_namespace *ns)
case EXEC_SELECT:
/* Select is complicated. Also, a SELECT construct could be
a transformed computed GOTO. */
- resolve_select (code);
+ resolve_select (code, false);
break;
case EXEC_SELECT_TYPE:
@@ -9653,7 +9664,7 @@ resolve_values (gfc_symbol *sym)
if (sym->value->expr_type == EXPR_STRUCTURE)
t= resolve_structure_cons (sym->value, 1);
- else
+ else
t = gfc_resolve_expr (sym->value);
if (t == FAILURE)
@@ -9675,7 +9686,7 @@ resolve_bind_c_comms (gfc_symtree *comm_block_tree)
{
gfc_gsymbol *binding_label_gsym;
gfc_gsymbol *comm_name_gsym;
- const char * bind_label = comm_block_tree->n.common->binding_label
+ const char * bind_label = comm_block_tree->n.common->binding_label
? comm_block_tree->n.common->binding_label : "";
/* See if a global symbol exists by the common block's name. It may
@@ -9718,7 +9729,7 @@ resolve_bind_c_comms (gfc_symtree *comm_block_tree)
check and nothing to add as a global symbol for the label. */
if (!comm_block_tree->n.common->binding_label)
return;
-
+
binding_label_gsym =
gfc_find_gsymbol (gfc_gsym_root,
comm_block_tree->n.common->binding_label);
@@ -9755,7 +9766,7 @@ resolve_bind_c_comms (gfc_symtree *comm_block_tree)
comm_name_gsym->name, &(comm_name_gsym->where));
}
}
-
+
return;
}
@@ -9769,34 +9780,34 @@ resolve_bind_c_derived_types (gfc_symbol *derived_sym)
if (derived_sym != NULL && derived_sym->attr.flavor == FL_DERIVED
&& derived_sym->attr.is_bind_c == 1)
verify_bind_c_derived_type (derived_sym);
-
+
return;
}
-/* Verify that any binding labels used in a given namespace do not collide
+/* Verify that any binding labels used in a given namespace do not collide
with the names or binding labels of any global symbols. */
static void
gfc_verify_binding_labels (gfc_symbol *sym)
{
int has_error = 0;
-
- if (sym != NULL && sym->attr.is_bind_c && sym->attr.is_iso_c == 0
+
+ if (sym != NULL && sym->attr.is_bind_c && sym->attr.is_iso_c == 0
&& sym->attr.flavor != FL_DERIVED && sym->binding_label)
{
gfc_gsymbol *bind_c_sym;
bind_c_sym = gfc_find_gsymbol (gfc_gsym_root, sym->binding_label);
- if (bind_c_sym != NULL
+ if (bind_c_sym != NULL
&& strcmp (bind_c_sym->name, sym->binding_label) == 0)
{
- if (sym->attr.if_source == IFSRC_DECL
- && (bind_c_sym->type != GSYM_SUBROUTINE
- && bind_c_sym->type != GSYM_FUNCTION)
- && ((sym->attr.contained == 1
- && strcmp (bind_c_sym->sym_name, sym->name) != 0)
- || (sym->attr.use_assoc == 1
+ if (sym->attr.if_source == IFSRC_DECL
+ && (bind_c_sym->type != GSYM_SUBROUTINE
+ && bind_c_sym->type != GSYM_FUNCTION)
+ && ((sym->attr.contained == 1
+ && strcmp (bind_c_sym->sym_name, sym->name) != 0)
+ || (sym->attr.use_assoc == 1
&& (strcmp (bind_c_sym->mod_name, sym->module) != 0))))
{
/* Make sure global procedures don't collide with anything. */
@@ -9806,10 +9817,10 @@ gfc_verify_binding_labels (gfc_symbol *sym)
&(bind_c_sym->where));
has_error = 1;
}
- else if (sym->attr.contained == 0
- && (sym->attr.if_source == IFSRC_IFBODY
- && sym->attr.flavor == FL_PROCEDURE)
- && (bind_c_sym->sym_name != NULL
+ else if (sym->attr.contained == 0
+ && (sym->attr.if_source == IFSRC_IFBODY
+ && sym->attr.flavor == FL_PROCEDURE)
+ && (bind_c_sym->sym_name != NULL
&& strcmp (bind_c_sym->sym_name, sym->name) != 0))
{
/* Make sure procedures in interface bodies don't collide. */
@@ -9820,10 +9831,10 @@ gfc_verify_binding_labels (gfc_symbol *sym)
&(bind_c_sym->where));
has_error = 1;
}
- else if (sym->attr.contained == 0
+ else if (sym->attr.contained == 0
&& sym->attr.if_source == IFSRC_UNKNOWN)
if ((sym->attr.use_assoc && bind_c_sym->mod_name
- && strcmp (bind_c_sym->mod_name, sym->module) != 0)
+ && strcmp (bind_c_sym->mod_name, sym->module) != 0)
|| sym->attr.use_assoc == 0)
{
gfc_error ("Binding label '%s' at %L collides with global "
@@ -10019,7 +10030,7 @@ apply_default_init (gfc_symbol *sym)
/* Build an initializer for a local integer, real, complex, logical, or
character variable, based on the command line flags finit-local-zero,
- finit-integer=, finit-real=, finit-logical=, and finit-runtime. Returns
+ finit-integer=, finit-real=, finit-logical=, and finit-runtime. Returns
null if the symbol should not have a default initialization. */
static gfc_expr *
build_default_init_expr (gfc_symbol *sym)
@@ -10050,10 +10061,10 @@ build_default_init_expr (gfc_symbol *sym)
characters, and only if the corresponding command-line flags
were set. Otherwise, we free init_expr and return null. */
switch (sym->ts.type)
- {
+ {
case BT_INTEGER:
if (gfc_option.flag_init_integer != GFC_INIT_INTEGER_OFF)
- mpz_set_si (init_expr->value.integer,
+ mpz_set_si (init_expr->value.integer,
gfc_option.flag_init_integer_value);
else
{
@@ -10090,7 +10101,7 @@ build_default_init_expr (gfc_symbol *sym)
break;
}
break;
-
+
case BT_COMPLEX:
switch (gfc_option.flag_init_real)
{
@@ -10122,7 +10133,7 @@ build_default_init_expr (gfc_symbol *sym)
break;
}
break;
-
+
case BT_LOGICAL:
if (gfc_option.flag_init_logical == GFC_INIT_LOGICAL_FALSE)
init_expr->value.logical = 0;
@@ -10134,9 +10145,9 @@ build_default_init_expr (gfc_symbol *sym)
init_expr = NULL;
}
break;
-
+
case BT_CHARACTER:
- /* For characters, the length must be constant in order to
+ /* For characters, the length must be constant in order to
create a default initializer. */
if (gfc_option.flag_init_character == GFC_INIT_CHARACTER_ON
&& sym->ts.u.cl->length
@@ -10175,7 +10186,7 @@ build_default_init_expr (gfc_symbol *sym)
init_expr->value.function.actual = arg;
}
break;
-
+
default:
gfc_free_expr (init_expr);
init_expr = NULL;
@@ -10203,7 +10214,7 @@ apply_default_init_local (gfc_symbol *sym)
/* For saved variables, we don't want to add an initializer at function
entry, so we just add a static initializer. Note that automatic variables
are stack allocated even with -fno-automatic. */
- if (sym->attr.save || sym->ns->save_all
+ if (sym->attr.save || sym->ns->save_all
|| (gfc_option.flag_max_stack_var_size == 0
&& (!sym->attr.dimension || !is_non_constant_shape_array (sym))))
{
@@ -10308,7 +10319,7 @@ resolve_fl_var_and_proc (gfc_symbol *sym, int mp_flag)
return FAILURE;
}
}
-
+
return SUCCESS;
}
@@ -10730,7 +10741,7 @@ resolve_fl_procedure (gfc_symbol *sym, int mp_flag)
sym->attr.is_c_interop = 1;
sym->ts.is_c_interop = 1;
}
-
+
curr_arg = sym->formal;
while (curr_arg != NULL)
{
@@ -10742,7 +10753,7 @@ resolve_fl_procedure (gfc_symbol *sym, int mp_flag)
BIND(C) to try and prevent multiple errors being
reported. */
has_non_interop_arg = 1;
-
+
curr_arg = curr_arg->next;
}
@@ -10755,7 +10766,7 @@ resolve_fl_procedure (gfc_symbol *sym, int mp_flag)
sym->attr.is_bind_c = 0;
}
}
-
+
if (!sym->attr.proc_pointer)
{
if (sym->attr.save == SAVE_EXPLICIT)
@@ -10906,7 +10917,7 @@ gfc_resolve_finalizers (gfc_symbol* derived)
{
gfc_error ("FINAL procedure '%s' declared at %L has the same"
" rank (%d) as '%s'",
- list->proc_sym->name, &list->where, my_rank,
+ list->proc_sym->name, &list->where, my_rank,
i->proc_sym->name);
goto error;
}
@@ -11156,7 +11167,7 @@ resolve_typebound_intrinsic_op (gfc_symbol* derived, gfc_intrinsic_op op,
{
gfc_symbol* super_type;
gfc_tbp_generic* target;
-
+
/* If there's already an error here, do nothing (but don't fail again). */
if (p->error)
return SUCCESS;
@@ -11381,7 +11392,7 @@ resolve_typebound_procedure (gfc_symtree* stree)
me_arg->name, &where, resolve_bindings_derived->name);
goto error;
}
-
+
gcc_assert (me_arg->ts.type == BT_CLASS);
if (CLASS_DATA (me_arg)->as && CLASS_DATA (me_arg)->as->rank > 0)
{
@@ -11458,7 +11469,7 @@ resolve_typebound_procedures (gfc_symbol* derived)
if (!derived->f2k_derived || !derived->f2k_derived->tb_sym_root)
return SUCCESS;
-
+
super_type = gfc_get_derived_super_type (derived);
if (super_type)
resolve_typebound_procedures (super_type);
@@ -11551,7 +11562,7 @@ ensure_not_abstract (gfc_symbol* sub, gfc_symbol* ancestor)
clearer than something sophisticated. */
gcc_assert (ancestor && !sub->attr.abstract);
-
+
if (!ancestor->attr.abstract)
return SUCCESS;
@@ -11685,7 +11696,7 @@ resolve_fl_derived0 (gfc_symbol *sym)
c->as = gfc_copy_array_spec (ifc->result->as);
}
else
- {
+ {
c->ts = ifc->ts;
c->attr.allocatable = ifc->attr.allocatable;
c->attr.pointer = ifc->attr.pointer;
@@ -11854,7 +11865,7 @@ resolve_fl_derived0 (gfc_symbol *sym)
|| (!sym->attr.is_class && c == sym->components))
&& strcmp (super_type->name, c->name) == 0)
c->attr.access = super_type->attr.access;
-
+
/* If this type is an extension, see if this component has the same name
as an inherited type-bound procedure. */
if (super_type && !sym->attr.is_class
@@ -12028,10 +12039,10 @@ resolve_fl_derived (gfc_symbol *sym)
vptr->ts.u.derived = vtab->ts.u.derived;
}
}
-
+
if (resolve_fl_derived0 (sym) == FAILURE)
return FAILURE;
-
+
/* Resolve the type-bound procedures. */
if (resolve_typebound_procedures (sym) == FAILURE)
return FAILURE;
@@ -12039,7 +12050,7 @@ resolve_fl_derived (gfc_symbol *sym)
/* Resolve the finalizer procedures. */
if (gfc_resolve_finalizers (sym) == FAILURE)
return FAILURE;
-
+
return SUCCESS;
}
@@ -12186,7 +12197,7 @@ static gfc_try
resolve_fl_parameter (gfc_symbol *sym)
{
/* A parameter array's shape needs to be constant. */
- if (sym->as != NULL
+ if (sym->as != NULL
&& (sym->as->type == AS_DEFERRED
|| is_non_constant_shape_array (sym)))
{
@@ -12301,8 +12312,8 @@ resolve_symbol (gfc_symbol *sym)
can. */
mp_flag = (sym->result != NULL && sym->result != sym);
- /* Make sure that the intrinsic is consistent with its internal
- representation. This needs to be done before assigning a default
+ /* Make sure that the intrinsic is consistent with its internal
+ representation. This needs to be done before assigning a default
type to avoid spurious warnings. */
if (sym->attr.flavor != FL_MODULE && sym->attr.intrinsic
&& resolve_intrinsic (sym, &sym->declared_at) == FAILURE)
@@ -12461,7 +12472,7 @@ resolve_symbol (gfc_symbol *sym)
sym->attr.flavor != FL_PROCEDURE && sym->attr.flavor != FL_DERIVED)
{
gfc_try t = SUCCESS;
-
+
/* First, make sure the variable is declared at the
module-level scope (J3/04-007, Section 15.3). */
if (sym->ns->proc_name->attr.flavor != FL_MODULE &&
@@ -12491,7 +12502,7 @@ resolve_symbol (gfc_symbol *sym)
verify_bind_c_derived_type (sym->ts.u.derived);
t = FAILURE;
}
-
+
/* Verify the variable itself as C interoperable if it
is BIND(C). It is not possible for this to succeed if
the verify_bind_c_derived_type failed, so don't have to handle
@@ -13263,12 +13274,12 @@ gfc_implicit_pure (gfc_symbol *sym)
sym = ns->proc_name;
if (sym == NULL)
return 0;
-
+
if (sym->attr.flavor == FL_PROCEDURE)
break;
}
}
-
+
return sym->attr.flavor == FL_PROCEDURE && sym->attr.implicit_pure
&& !sym->attr.pure;
}
@@ -13439,7 +13450,7 @@ resolve_equivalence_derived (gfc_symbol *derived, gfc_symbol *sym, gfc_expr *e)
}
-/* Resolve equivalence object.
+/* Resolve equivalence object.
An EQUIVALENCE object shall not be a dummy argument, a pointer, a target,
an allocatable array, an object of nonsequence derived type, an object of
sequence derived type containing a pointer at any level of component
diff --git a/gcc/fortran/simplify.c b/gcc/fortran/simplify.c
index 86de9cd6187..f1219d61c18 100644
--- a/gcc/fortran/simplify.c
+++ b/gcc/fortran/simplify.c
@@ -5573,7 +5573,9 @@ gfc_simplify_size (gfc_expr *array, gfc_expr *dim, gfc_expr *kind)
/* Otherwise, we build a new SIZE call. This is hopefully at least
simpler than the original one. */
if (!simplified)
- simplified = gfc_build_intrinsic_call ("size", array->where, 3,
+ simplified = gfc_build_intrinsic_call (gfc_current_ns,
+ GFC_ISYM_SIZE, "size",
+ array->where, 3,
gfc_copy_expr (replacement),
gfc_copy_expr (dim),
gfc_copy_expr (kind));
diff --git a/gcc/fortran/trans-array.c b/gcc/fortran/trans-array.c
index 807fb082546..d3114798c6d 100644
--- a/gcc/fortran/trans-array.c
+++ b/gcc/fortran/trans-array.c
@@ -6847,20 +6847,14 @@ gfc_conv_array_parameter (gfc_se * se, gfc_expr * expr, gfc_ss * ss, bool g77,
this_array_result = false;
/* Passing address of the array if it is not pointer or assumed-shape. */
- if (full_array_var && g77 && !this_array_result)
+ if (full_array_var && g77 && !this_array_result
+ && sym->ts.type != BT_DERIVED && sym->ts.type != BT_CLASS)
{
tmp = gfc_get_symbol_decl (sym);
if (sym->ts.type == BT_CHARACTER)
se->string_length = sym->ts.u.cl->backend_decl;
- if (sym->ts.type == BT_DERIVED || sym->ts.type == BT_CLASS)
- {
- gfc_conv_expr_descriptor (se, expr, ss);
- se->expr = gfc_conv_array_data (se->expr);
- return;
- }
-
if (!sym->attr.pointer
&& sym->as
&& sym->as->type != AS_ASSUMED_SHAPE
diff --git a/gcc/fortran/trans-decl.c b/gcc/fortran/trans-decl.c
index f225ab3b8c0..217eb4a08e6 100644
--- a/gcc/fortran/trans-decl.c
+++ b/gcc/fortran/trans-decl.c
@@ -1369,6 +1369,12 @@ gfc_get_symbol_decl (gfc_symbol * sym)
DECL_IGNORED_P (decl) = 1;
}
+ if (sym->attr.select_type_temporary)
+ {
+ DECL_ARTIFICIAL (decl) = 1;
+ DECL_IGNORED_P (decl) = 1;
+ }
+
if (sym->attr.dimension || sym->attr.codimension)
{
/* Create variables to hold the non-constant bits of array info. */
@@ -1479,7 +1485,8 @@ gfc_get_symbol_decl (gfc_symbol * sym)
&& POINTER_TYPE_P (TREE_TYPE (decl))
&& !sym->attr.pointer
&& !sym->attr.allocatable
- && !sym->attr.proc_pointer)
+ && !sym->attr.proc_pointer
+ && !sym->attr.select_type_temporary)
DECL_BY_REFERENCE (decl) = 1;
if (sym->attr.vtab
diff --git a/gcc/fortran/trans-expr.c b/gcc/fortran/trans-expr.c
index 3552da36be8..b54a28ed8fd 100644
--- a/gcc/fortran/trans-expr.c
+++ b/gcc/fortran/trans-expr.c
@@ -1,6 +1,6 @@
/* Expression translation
Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
- 2011, 2012
+ 2011, 2012, 2013
Free Software Foundation, Inc.
Contributed by Paul Brook <paul@nowt.org>
and Steven Bosscher <s.bosscher@student.tudelft.nl>
@@ -148,7 +148,7 @@ gfc_vtable_copy_get (tree decl)
/* Takes a derived type expression and returns the address of a temporary
- class object of the 'declared' type. */
+ class object of the 'declared' type. */
static void
gfc_conv_derived_to_class (gfc_se *parmse, gfc_expr *e,
gfc_typespec class_ts)
@@ -211,10 +211,10 @@ gfc_conv_derived_to_class (gfc_se *parmse, gfc_expr *e,
/* Takes a scalarized class array expression and returns the
address of a temporary scalar class object of the 'declared'
- type.
+ type.
OOP-TODO: This could be improved by adding code that branched on
the dynamic type being the same as the declared type. In this case
- the original class expression can be passed directly. */
+ the original class expression can be passed directly. */
void
gfc_conv_class_to_class (gfc_se *parmse, gfc_expr *e,
gfc_typespec class_ts, bool elemental)
@@ -267,7 +267,7 @@ gfc_conv_class_to_class (gfc_se *parmse, gfc_expr *e,
tmp = NULL_TREE;
if (class_ref == NULL
- && e->symtree && e->symtree->n.sym->ts.type == BT_CLASS)
+ && e->symtree && e->symtree->n.sym->ts.type == BT_CLASS)
tmp = e->symtree->n.sym->backend_decl;
else
{
@@ -481,7 +481,7 @@ gfc_trans_class_init_assign (gfc_code *code)
tmp = gfc_build_memcpy_call (dst.expr, src.expr, memsz.expr);
}
gfc_add_expr_to_block (&block, tmp);
-
+
return gfc_finish_block (&block);
}
@@ -727,7 +727,7 @@ gfc_conv_missing_dummy (gfc_se * se, gfc_expr * arg, gfc_typespec ts, int kind)
tmp = gfc_get_int_type (kind);
tmp = fold_convert (tmp, build_fold_indirect_ref_loc (input_location,
se->expr));
-
+
/* Test for a NULL value. */
tmp = build3_loc (input_location, COND_EXPR, TREE_TYPE (tmp), present,
tmp, fold_convert (TREE_TYPE (tmp), integer_one_node));
@@ -764,9 +764,9 @@ gfc_get_expr_charlen (gfc_expr *e)
gfc_ref *r;
tree length;
- gcc_assert (e->expr_type == EXPR_VARIABLE
+ gcc_assert (e->expr_type == EXPR_VARIABLE
&& e->ts.type == BT_CHARACTER);
-
+
length = NULL; /* To silence compiler warning. */
if (is_subref_array (e) && e->ts.u.cl->length)
@@ -855,8 +855,8 @@ flatten_array_ctors_without_strlen (gfc_expr* e)
{
case EXPR_OP:
- flatten_array_ctors_without_strlen (e->value.op.op1);
- flatten_array_ctors_without_strlen (e->value.op.op2);
+ flatten_array_ctors_without_strlen (e->value.op.op1);
+ flatten_array_ctors_without_strlen (e->value.op.op2);
break;
case EXPR_COMPCALL:
@@ -1221,7 +1221,7 @@ gfc_conv_variable (gfc_se * se, gfc_expr * expr)
se_expr = gfc_get_fake_result_decl (sym, parent_flag);
/* Similarly for alternate entry points. */
- else if (alternate_entry
+ else if (alternate_entry
&& (sym->ns->proc_name->backend_decl == current_function_decl
|| parent_flag))
{
@@ -1257,7 +1257,7 @@ gfc_conv_variable (gfc_se * se, gfc_expr * expr)
/* Dereference the expression, where needed. Since characters
- are entirely different from other types, they are treated
+ are entirely different from other types, they are treated
separately. */
if (sym->ts.type == BT_CHARACTER)
{
@@ -1287,7 +1287,7 @@ gfc_conv_variable (gfc_se * se, gfc_expr * expr)
se->expr = build_fold_indirect_ref_loc (input_location,
se->expr);
- /* Dereference non-character pointer variables.
+ /* Dereference non-character pointer variables.
These must be dummies, results, or scalars. */
if ((sym->attr.pointer || sym->attr.allocatable
|| gfc_is_associate_pointer (sym))
@@ -1359,7 +1359,7 @@ gfc_conv_variable (gfc_se * se, gfc_expr * expr)
{
if (expr->ts.type == BT_CHARACTER && !gfc_is_proc_ptr_comp (expr, NULL))
gfc_conv_string_parameter (se);
- else
+ else
se->expr = gfc_build_addr_expr (NULL_TREE, se->expr);
}
}
@@ -1441,11 +1441,11 @@ static const unsigned char powi_table[POWI_TABLE_SIZE] =
124, 166, 125, 214, 126, 138, 127, 153, /* 248 - 255 */
};
-/* If n is larger than lookup table's max index, we use the "window
+/* If n is larger than lookup table's max index, we use the "window
method". */
#define POWI_WINDOW_SIZE 3
-/* Recursive function to expand the power operator. The temporary
+/* Recursive function to expand the power operator. The temporary
values are put in tmpvar. The function returns tmpvar[1] ** n. */
static tree
gfc_conv_powi (gfc_se * se, unsigned HOST_WIDE_INT n, tree * tmpvar)
@@ -1508,7 +1508,7 @@ gfc_conv_cst_int_power (gfc_se * se, tree lhs, tree rhs)
/* There's no ABS for HOST_WIDE_INT, so here we go. It also takes care
of the asymmetric range of the integer type. */
n = (unsigned HOST_WIDE_INT) (m < 0 ? -m : m);
-
+
type = TREE_TYPE (lhs);
sgn = tree_int_cst_sgn (rhs);
@@ -1619,7 +1619,7 @@ gfc_conv_power_op (gfc_se * se, gfc_expr * expr)
case 4:
ikind = 0;
break;
-
+
case 8:
ikind = 1;
break;
@@ -1647,7 +1647,7 @@ gfc_conv_power_op (gfc_se * se, gfc_expr * expr)
case 4:
kind = 0;
break;
-
+
case 8:
kind = 1;
break;
@@ -1663,7 +1663,7 @@ gfc_conv_power_op (gfc_se * se, gfc_expr * expr)
default:
gcc_unreachable ();
}
-
+
switch (expr->value.op.op1->ts.type)
{
case BT_INTEGER:
@@ -1681,7 +1681,7 @@ gfc_conv_power_op (gfc_se * se, gfc_expr * expr)
case 0:
fndecl = builtin_decl_explicit (BUILT_IN_POWIF);
break;
-
+
case 1:
fndecl = builtin_decl_explicit (BUILT_IN_POWI);
break;
@@ -1691,7 +1691,7 @@ gfc_conv_power_op (gfc_se * se, gfc_expr * expr)
break;
case 3:
- /* Use the __builtin_powil() only if real(kind=16) is
+ /* Use the __builtin_powil() only if real(kind=16) is
actually the C long double type. */
if (!gfc_real16_is_float128)
fndecl = builtin_decl_explicit (BUILT_IN_POWIL);
@@ -1702,7 +1702,7 @@ gfc_conv_power_op (gfc_se * se, gfc_expr * expr)
}
}
- /* If we don't have a good builtin for this, go for the
+ /* If we don't have a good builtin for this, go for the
library function. */
if (!fndecl)
fndecl = gfor_fndecl_math_powi[kind][ikind].real;
@@ -2109,7 +2109,7 @@ gfc_conv_scalar_char_value (gfc_symbol *sym, gfc_se *se, gfc_expr **expr)
(int)(*expr)->value.character.string[0]);
if ((*expr)->ts.kind != gfc_c_int_kind)
{
- /* The expr needs to be compatible with a C int. If the
+ /* The expr needs to be compatible with a C int. If the
conversion fails, then the 2 causes an ICE. */
ts.type = BT_INTEGER;
ts.kind = gfc_c_int_kind;
@@ -2547,8 +2547,8 @@ gfc_add_interface_mapping (gfc_interface_mapping * mapping,
else if (!sym->attr.dimension || sym->attr.pointer || sym->attr.allocatable)
value = build_fold_indirect_ref_loc (input_location,
se->expr);
-
- /* For character(*), use the actual argument's descriptor. */
+
+ /* For character(*), use the actual argument's descriptor. */
else if (sym->ts.type == BT_CHARACTER && !new_sym->ts.u.cl->length)
value = build_fold_indirect_ref_loc (input_location,
se->expr);
@@ -2958,7 +2958,7 @@ gfc_conv_subref_array_arg (gfc_se * parmse, gfc_expr * expr, int g77,
rss = gfc_walk_expr (expr);
gcc_assert (rss != gfc_ss_terminator);
-
+
/* Initialize the scalarizer. */
gfc_init_loopinfo (&loop);
gfc_add_ss_to_loop (&loop, rss);
@@ -3118,7 +3118,7 @@ gfc_conv_subref_array_arg (gfc_se * parmse, gfc_expr * expr, int g77,
tmp = gfc_trans_scalar_assign (&lse, &rse, expr->ts, false, false, true);
gfc_add_expr_to_block (&body, tmp);
-
+
/* Generate the copying loops. */
gfc_trans_scalarizing_loops (&loop2, &body);
@@ -3145,7 +3145,7 @@ gfc_conv_subref_array_arg (gfc_se * parmse, gfc_expr * expr, int g77,
if (formal_ptr)
{
size = gfc_index_one_node;
- offset = gfc_index_zero_node;
+ offset = gfc_index_zero_node;
for (n = 0; n < dimen; n++)
{
tmp = gfc_conv_descriptor_ubound_get (parmse->expr,
@@ -3230,7 +3230,7 @@ conv_isocbinding_procedure (gfc_se * se, gfc_symbol * sym,
{
gfc_symbol *fsym;
gfc_ss *argss;
-
+
if (sym->intmod_sym_id == ISOCBINDING_LOC)
{
if (arg->expr->rank == 0)
@@ -3247,7 +3247,7 @@ conv_isocbinding_procedure (gfc_se * se, gfc_symbol * sym,
&& !(fsym->attr.pointer || fsym->attr.allocatable)
&& fsym->as->type != AS_ASSUMED_SHAPE;
f = f || !sym->attr.always_explicit;
-
+
argss = gfc_walk_expr (arg->expr);
gfc_conv_array_parameter (se, arg->expr, argss, f,
NULL, NULL, NULL);
@@ -3268,7 +3268,7 @@ conv_isocbinding_procedure (gfc_se * se, gfc_symbol * sym,
arg->expr->ts.f90_type = sym->ts.u.derived->ts.f90_type;
arg->expr->ts.kind = sym->ts.u.derived->ts.kind;
gfc_conv_expr_reference (se, arg->expr);
-
+
return 1;
}
else if ((sym->intmod_sym_id == ISOCBINDING_F_POINTER
@@ -3293,12 +3293,12 @@ conv_isocbinding_procedure (gfc_se * se, gfc_symbol * sym,
gfc_conv_expr (&fptrse, arg->next->expr);
gfc_add_block_to_block (&se->pre, &fptrse.pre);
gfc_add_block_to_block (&se->post, &fptrse.post);
-
+
if (arg->next->expr->symtree->n.sym->attr.proc_pointer
&& arg->next->expr->symtree->n.sym->attr.dummy)
fptrse.expr = build_fold_indirect_ref_loc (input_location,
fptrse.expr);
-
+
se->expr = fold_build2_loc (input_location, MODIFY_EXPR,
TREE_TYPE (fptrse.expr),
fptrse.expr,
@@ -3332,7 +3332,7 @@ conv_isocbinding_procedure (gfc_se * se, gfc_symbol * sym,
{
tree eq_expr;
tree not_null_expr;
-
+
/* Given two arguments so build the arg2se from second arg. */
gfc_init_se (&arg2se, NULL);
gfc_conv_expr (&arg2se, arg->next->expr);
@@ -3356,7 +3356,7 @@ conv_isocbinding_procedure (gfc_se * se, gfc_symbol * sym,
return 1;
}
-
+
/* Nothing was done. */
return 0;
}
@@ -3536,7 +3536,13 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym,
parmse.expr = gfc_build_addr_expr (NULL_TREE, parmse.expr);
}
else
- gfc_conv_expr_reference (&parmse, e);
+ {
+ gfc_conv_expr_reference (&parmse, e);
+ if (e->ts.type == BT_CHARACTER && !e->rank
+ && e->expr_type == EXPR_FUNCTION)
+ parmse.expr = build_fold_indirect_ref_loc (input_location,
+ parmse.expr);
+ }
/* The scalarizer does not repackage the reference to a class
array - instead it returns a pointer to the data element. */
@@ -3625,7 +3631,7 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym,
&& !CLASS_DATA (e)->attr.codimension)
parmse.expr = gfc_class_data_get (parmse.expr);
- /* If an ALLOCATABLE dummy argument has INTENT(OUT) and is
+ /* If an ALLOCATABLE dummy argument has INTENT(OUT) and is
allocated on entry, it must be deallocated. */
if (fsym && fsym->attr.allocatable
&& fsym->attr.intent == INTENT_OUT)
@@ -3709,7 +3715,7 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym,
/* If the argument is a function call that may not create
a temporary for the result, we have to check that we
- can do it, i.e. that there is no alias between this
+ can do it, i.e. that there is no alias between this
argument and another one. */
if (gfc_get_noncopying_intrinsic_argument (e) != NULL)
{
@@ -3770,7 +3776,7 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym,
gfc_conv_array_parameter (&parmse, e, argss, f, fsym,
sym->name, NULL);
- /* If an ALLOCATABLE dummy argument has INTENT(OUT) and is
+ /* If an ALLOCATABLE dummy argument has INTENT(OUT) and is
allocated on entry, it must be deallocated. */
if (fsym && fsym->attr.allocatable
&& fsym->attr.intent == INTENT_OUT)
@@ -3787,7 +3793,7 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym,
tmp, build_empty_stmt (input_location));
gfc_add_expr_to_block (&se->pre, tmp);
}
- }
+ }
}
/* The case with fsym->attr.optional is that of a user subroutine
@@ -3813,7 +3819,7 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym,
&& ((e->rank > 0 && sym->attr.elemental)
|| e->representation.length || e->ts.type == BT_CHARACTER
|| (e->rank > 0
- && (fsym == NULL
+ && (fsym == NULL
|| (fsym-> as
&& (fsym->as->type == AS_ASSUMED_SHAPE
|| fsym->as->type == AS_DEFERRED))))))
@@ -3982,7 +3988,7 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym,
fold_convert (TREE_TYPE (tmp),
null_pointer_node));
}
-
+
gfc_trans_runtime_check (true, false, cond, &se->pre, &e->where,
msg);
free (msg);
@@ -4039,7 +4045,7 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym,
&& GFC_TYPE_ARRAY_CAF_TOKEN (caf_type) != NULL_TREE);
tmp = GFC_TYPE_ARRAY_CAF_TOKEN (caf_type);
}
-
+
VEC_safe_push (tree, gc, stringargs, tmp);
if (GFC_DESCRIPTOR_TYPE_P (caf_type)
@@ -4132,7 +4138,7 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym,
gfc_conv_expr (&parmse, ts.u.cl->length);
gfc_add_block_to_block (&se->pre, &parmse.pre);
gfc_add_block_to_block (&se->post, &parmse.post);
-
+
tmp = fold_convert (gfc_charlen_type_node, parmse.expr);
tmp = fold_build2_loc (input_location, MAX_EXPR,
gfc_charlen_type_node, tmp,
@@ -4799,20 +4805,20 @@ gfc_conv_function_expr (gfc_se * se, gfc_expr * expr)
return;
}
+ /* expr.value.function.esym is the resolved (specific) function symbol for
+ most functions. However this isn't set for dummy procedures. */
+ sym = expr->value.function.esym;
+ if (!sym)
+ sym = expr->symtree->n.sym;
+
/* We distinguish statement functions from general functions to improve
runtime performance. */
- if (expr->symtree->n.sym->attr.proc == PROC_ST_FUNCTION)
+ if (sym->attr.proc == PROC_ST_FUNCTION)
{
gfc_conv_statement_function (se, expr);
return;
}
- /* expr.value.function.esym is the resolved (specific) function symbol for
- most functions. However this isn't set for dummy procedures. */
- sym = expr->value.function.esym;
- if (!sym)
- sym = expr->symtree->n.sym;
-
gfc_conv_procedure_call (se, sym, expr->value.function.actual, expr, NULL);
}
@@ -4868,7 +4874,7 @@ gfc_conv_array_constructor_expr (gfc_se * se, gfc_expr * expr)
/* Build a static initializer. EXPR is the expression for the initial value.
- The other parameters describe the variable of the component being
+ The other parameters describe the variable of the component being
initialized. EXPR may be null. */
tree
@@ -4899,7 +4905,7 @@ gfc_conv_initializer (gfc_expr * expr, gfc_typespec * ts, tree type,
gcc_assert (TREE_CODE (se.expr) != CONSTRUCTOR);
return se.expr;
}
-
+
if (array && !procptr)
{
tree ctor;
@@ -4957,7 +4963,7 @@ gfc_conv_initializer (gfc_expr * expr, gfc_typespec * ts, tree type,
}
}
}
-
+
static tree
gfc_trans_subarray_assign (tree dest, gfc_component * cm, gfc_expr * expr)
{
@@ -5004,7 +5010,7 @@ gfc_trans_subarray_assign (tree dest, gfc_component * cm, gfc_expr * expr)
cm->as->lower[n]->value.integer);
mpz_add_ui (lss_array->shape[n], lss_array->shape[n], 1);
}
-
+
/* Associate the SS with the loop. */
gfc_add_ss_to_loop (&loop, lss);
gfc_add_ss_to_loop (&loop, rss);
@@ -5070,7 +5076,7 @@ gfc_trans_alloc_subarray_assign (tree dest, gfc_component * cm,
gfc_start_block (&block);
gfc_init_se (&se, NULL);
- /* Get the descriptor for the expressions. */
+ /* Get the descriptor for the expressions. */
rss = gfc_walk_expr (expr);
se.want_pointer = 0;
gfc_conv_expr_descriptor (&se, expr, rss);
@@ -5325,7 +5331,7 @@ gfc_trans_structure_assign (tree dest, gfc_expr * expr)
fold_convert (TREE_TYPE (lse.expr), se.expr));
return gfc_finish_block (&block);
- }
+ }
for (c = gfc_constructor_first (expr->value.constructor);
c; c = gfc_constructor_next (c), cm = cm->next)
@@ -5407,7 +5413,7 @@ gfc_conv_structure (gfc_se * se, gfc_expr * expr, int init)
}
}
se->expr = build_constructor (type, v);
- if (init)
+ if (init)
TREE_CONSTANT (se->expr) = 1;
}
@@ -5752,7 +5758,7 @@ gfc_trans_pointer_assignment (gfc_expr * expr1, gfc_expr * expr2)
for (remap = expr1->ref; remap; remap = remap->next)
if (!remap->next && remap->type == REF_ARRAY
&& remap->u.ar.type == AR_SECTION)
- {
+ {
remap->u.ar.type = AR_FULL;
break;
}
@@ -6050,7 +6056,7 @@ gfc_trans_scalar_assign (gfc_se * lse, gfc_se * rse, gfc_typespec ts,
else if (ts.type == BT_DERIVED && ts.u.derived->attr.alloc_comp)
{
cond = NULL_TREE;
-
+
/* Are the rhs and the lhs the same? */
if (r_is_var)
{
@@ -6146,7 +6152,7 @@ arrayfunc_assign_needs_temporary (gfc_expr * expr1, gfc_expr * expr2)
/* Functions returning pointers or allocatables need temporaries. */
c = expr2->value.function.esym
- ? (expr2->value.function.esym->attr.pointer
+ ? (expr2->value.function.esym->attr.pointer
|| expr2->value.function.esym->attr.allocatable)
: (expr2->symtree->n.sym->attr.pointer
|| expr2->symtree->n.sym->attr.allocatable);
@@ -6439,7 +6445,7 @@ gfc_trans_arrayfunc_assign (gfc_expr * expr1, gfc_expr * expr2)
correctly take care of the reallocation internally. For intrinsic
calls, the array data is freed and the library takes care of allocation.
TODO: Add logic of trans-array.c: gfc_alloc_allocatable_for_assignment
- to the library. */
+ to the library. */
if (gfc_option.flag_realloc_lhs
&& gfc_is_reallocatable_lhs (expr1)
&& !gfc_expr_attr (expr1).codimension
@@ -6713,7 +6719,7 @@ alloc_scalar_allocatable_for_assignment (stmtblock_t *block,
gfc_init_se (&lse, NULL);
lse.want_pointer = 1;
gfc_conv_expr (&lse, expr1);
-
+
jump_label1 = gfc_build_label_decl (NULL_TREE);
jump_label2 = gfc_build_label_decl (NULL_TREE);
diff --git a/gcc/function.c b/gcc/function.c
index f16b5ef16b1..96879c8adcc 100644
--- a/gcc/function.c
+++ b/gcc/function.c
@@ -5961,7 +5961,7 @@ thread_prologue_and_epilogue_insns (void)
if (pic_offset_table_rtx)
add_to_hard_reg_set (&set_up_by_prologue.set, Pmode,
PIC_OFFSET_TABLE_REGNUM);
- if (stack_realign_drap && crtl->drap_reg)
+ if (crtl->drap_reg)
add_to_hard_reg_set (&set_up_by_prologue.set,
GET_MODE (crtl->drap_reg),
REGNO (crtl->drap_reg));
diff --git a/gcc/gimple-low.c b/gcc/gimple-low.c
index f6deba17938..c3d41282e80 100644
--- a/gcc/gimple-low.c
+++ b/gcc/gimple-low.c
@@ -32,6 +32,7 @@ along with GCC; see the file COPYING3. If not see
#include "function.h"
#include "diagnostic-core.h"
#include "tree-pass.h"
+#include "langhooks.h"
/* The differences between High GIMPLE and Low GIMPLE are the
following:
@@ -680,8 +681,14 @@ block_may_fallthru (const_tree block)
case CLEANUP_POINT_EXPR:
return block_may_fallthru (TREE_OPERAND (stmt, 0));
- default:
+ case TARGET_EXPR:
+ return block_may_fallthru (TREE_OPERAND (stmt, 1));
+
+ case ERROR_MARK:
return true;
+
+ default:
+ return lang_hooks.block_may_fallthru (stmt);
}
}
diff --git a/gcc/gimple.c b/gcc/gimple.c
index 79596a4ec9c..1be04aefa92 100644
--- a/gcc/gimple.c
+++ b/gcc/gimple.c
@@ -5464,16 +5464,61 @@ gimple_decl_printable_name (tree decl, int verbosity)
return IDENTIFIER_POINTER (DECL_NAME (decl));
}
-/* Return true when STMT is builtins call to CODE. */
+/* Return true when STMTs arguments match those of FNDECL. */
+
+static bool
+validate_call (gimple stmt, tree fndecl)
+{
+ tree arg, targs = TYPE_ARG_TYPES (TREE_TYPE (fndecl));
+ unsigned nargs = gimple_call_num_args (stmt);
+ unsigned i;
+ for (i = 0; i < nargs; ++i)
+ {
+ /* Variadic args follow. */
+ if (!targs)
+ return true;
+ arg = gimple_call_arg (stmt, i);
+ if (INTEGRAL_TYPE_P (TREE_TYPE (arg))
+ && INTEGRAL_TYPE_P (TREE_VALUE (targs)))
+ ;
+ else if (POINTER_TYPE_P (TREE_TYPE (arg))
+ && POINTER_TYPE_P (TREE_VALUE (targs)))
+ ;
+ else if (TREE_CODE (TREE_TYPE (arg))
+ != TREE_CODE (TREE_VALUE (targs)))
+ return false;
+ targs = TREE_CHAIN (targs);
+ }
+ if (targs && !VOID_TYPE_P (TREE_VALUE (targs)))
+ return false;
+ return true;
+}
+
+/* Return true when STMT is builtins call to CLASS. */
+
+bool
+gimple_call_builtin_class_p (gimple stmt, enum built_in_class klass)
+{
+ tree fndecl;
+ if (is_gimple_call (stmt)
+ && (fndecl = gimple_call_fndecl (stmt)) != NULL_TREE
+ && DECL_BUILT_IN_CLASS (fndecl) == klass)
+ return validate_call (stmt, fndecl);
+ return false;
+}
+
+/* Return true when STMT is builtins call to CODE of CLASS. */
bool
gimple_call_builtin_p (gimple stmt, enum built_in_function code)
{
tree fndecl;
- return (is_gimple_call (stmt)
- && (fndecl = gimple_call_fndecl (stmt)) != NULL
- && DECL_BUILT_IN_CLASS (fndecl) == BUILT_IN_NORMAL
- && DECL_FUNCTION_CODE (fndecl) == code);
+ if (is_gimple_call (stmt)
+ && (fndecl = gimple_call_fndecl (stmt)) != NULL_TREE
+ && DECL_BUILT_IN_CLASS (fndecl) == BUILT_IN_NORMAL
+ && DECL_FUNCTION_CODE (fndecl) == code)
+ return validate_call (stmt, fndecl);
+ return false;
}
/* Return true if STMT clobbers memory. STMT is required to be a
diff --git a/gcc/gimple.h b/gcc/gimple.h
index 47e46b784f5..97eec59fcb0 100644
--- a/gcc/gimple.h
+++ b/gcc/gimple.h
@@ -1023,6 +1023,7 @@ extern bool walk_stmt_load_store_ops (gimple, void *,
bool (*)(gimple, tree, void *),
bool (*)(gimple, tree, void *));
extern bool gimple_ior_addresses_taken (bitmap, gimple);
+extern bool gimple_call_builtin_class_p (gimple, enum built_in_class);
extern bool gimple_call_builtin_p (gimple, enum built_in_function);
extern bool gimple_asm_clobbers_memory_p (const_gimple);
diff --git a/gcc/graphite-dependences.c b/gcc/graphite-dependences.c
index fb49f161480..17b3ed273a4 100644
--- a/gcc/graphite-dependences.c
+++ b/gcc/graphite-dependences.c
@@ -1,5 +1,5 @@
/* Data dependence analysis for Graphite.
- Copyright (C) 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 2009, 2010, 2013 Free Software Foundation, Inc.
Contributed by Sebastian Pop <sebastian.pop@amd.com> and
Konrad Trifunovic <konrad.trifunovic@inria.fr>.
@@ -56,7 +56,7 @@ hash_poly_ddr_p (const void *pddr)
{
const struct poly_ddr *p = (const struct poly_ddr *) pddr;
- return (hashval_t) ((long) PDDR_SOURCE (p) + (long) PDDR_SINK (p));
+ return (hashval_t) ((intptr_t) PDDR_SOURCE (p) + (intptr_t) PDDR_SINK (p));
}
/* Returns true when PDDR has no dependence. */
diff --git a/gcc/haifa-sched.c b/gcc/haifa-sched.c
index 5888e4e8392..dff987abe24 100644
--- a/gcc/haifa-sched.c
+++ b/gcc/haifa-sched.c
@@ -6490,6 +6490,9 @@ fix_inter_tick (rtx head, rtx tail)
INSN_TICK (head) = tick;
}
+ if (DEBUG_INSN_P (head))
+ continue;
+
FOR_EACH_DEP (head, SD_LIST_RES_FORW, sd_it, dep)
{
rtx next;
diff --git a/gcc/ipa-inline-transform.c b/gcc/ipa-inline-transform.c
index 75b8e9daf11..ce1bc6e3ef8 100644
--- a/gcc/ipa-inline-transform.c
+++ b/gcc/ipa-inline-transform.c
@@ -95,9 +95,7 @@ can_remove_node_now_p_1 (struct cgraph_node *node)
those only after all devirtualizable virtual calls are processed.
Lacking may edges in callgraph we just preserve them post
inlining. */
- && (!DECL_VIRTUAL_P (node->decl)
- || (!DECL_COMDAT (node->decl)
- && !DECL_EXTERNAL (node->decl)))
+ && !DECL_VIRTUAL_P (node->decl)
/* During early inlining some unanalyzed cgraph nodes might be in the
callgraph and they might reffer the function in question. */
&& !cgraph_new_nodes);
diff --git a/gcc/ipa.c b/gcc/ipa.c
index 388291a3d92..8c2b3bda748 100644
--- a/gcc/ipa.c
+++ b/gcc/ipa.c
@@ -194,9 +194,7 @@ cgraph_remove_unreachable_nodes (bool before_inlining_p, FILE *file)
if (node->analyzed && !node->global.inlined_to
&& (!cgraph_can_remove_if_no_direct_calls_and_refs_p (node)
/* Keep around virtual functions for possible devirtualization. */
- || (before_inlining_p
- && DECL_VIRTUAL_P (node->decl)
- && (DECL_COMDAT (node->decl) || DECL_EXTERNAL (node->decl)))))
+ || (before_inlining_p && DECL_VIRTUAL_P (node->decl))))
{
gcc_assert (!node->global.inlined_to);
enqueue_cgraph_node (node, &first);
diff --git a/gcc/langhooks-def.h b/gcc/langhooks-def.h
index ed3230c6291..0b5b06ae5d3 100644
--- a/gcc/langhooks-def.h
+++ b/gcc/langhooks-def.h
@@ -116,6 +116,7 @@ extern void lhd_omp_firstprivatize_type_sizes (struct gimplify_omp_ctx *,
#define LANG_HOOKS_EH_PERSONALITY lhd_gcc_personality
#define LANG_HOOKS_EH_RUNTIME_TYPE lhd_pass_through_t
#define LANG_HOOKS_EH_PROTECT_CLEANUP_ACTIONS NULL
+#define LANG_HOOKS_BLOCK_MAY_FALLTHRU hook_bool_const_tree_true
#define LANG_HOOKS_EH_USE_CXA_END_CLEANUP false
#define LANG_HOOKS_DEEP_UNSHARING false
@@ -308,6 +309,7 @@ extern void lhd_end_section (void);
LANG_HOOKS_EH_PERSONALITY, \
LANG_HOOKS_EH_RUNTIME_TYPE, \
LANG_HOOKS_EH_PROTECT_CLEANUP_ACTIONS, \
+ LANG_HOOKS_BLOCK_MAY_FALLTHRU, \
LANG_HOOKS_EH_USE_CXA_END_CLEANUP, \
LANG_HOOKS_DEEP_UNSHARING \
}
diff --git a/gcc/langhooks.h b/gcc/langhooks.h
index 89e74f93681..623563e341a 100644
--- a/gcc/langhooks.h
+++ b/gcc/langhooks.h
@@ -465,6 +465,10 @@ struct lang_hooks
FUNCTION_DECL for `std::terminate'. */
tree (*eh_protect_cleanup_actions) (void);
+ /* Return true if a stmt can fallthru. Used by block_may_fallthru
+ to possibly handle language trees. */
+ bool (*block_may_fallthru) (const_tree);
+
/* True if this language uses __cxa_end_cleanup when the ARM EABI
is enabled. */
bool eh_use_cxa_end_cleanup;
diff --git a/gcc/loop-iv.c b/gcc/loop-iv.c
index 83d25015976..5264e329c27 100644
--- a/gcc/loop-iv.c
+++ b/gcc/loop-iv.c
@@ -2361,6 +2361,9 @@ iv_number_of_iterations (struct loop *loop, rtx insn, rtx condition,
iv1.step = const0_rtx;
}
+ iv0.step = lowpart_subreg (mode, iv0.step, comp_mode);
+ iv1.step = lowpart_subreg (mode, iv1.step, comp_mode);
+
/* This is either infinite loop or the one that ends immediately, depending
on initial values. Unswitching should remove this kind of conditions. */
if (iv0.step == const0_rtx && iv1.step == const0_rtx)
@@ -2471,6 +2474,7 @@ iv_number_of_iterations (struct loop *loop, rtx insn, rtx condition,
step = simplify_gen_unary (NEG, comp_mode, iv1.step, comp_mode);
else
step = iv0.step;
+ step = lowpart_subreg (mode, step, comp_mode);
delta = simplify_gen_binary (MINUS, comp_mode, iv1.base, iv0.base);
delta = lowpart_subreg (mode, delta, comp_mode);
delta = simplify_gen_binary (UMOD, mode, delta, step);
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 7f8d377a98d..678bd795014 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,282 @@
+2013-02-04 Janis Johnson <janisjo@codesourcery.com>
+
+ PR testsuite/56206
+ * lib/target-supports.exp (check_effective_target_arm_hard_vfp_ok):
+ Fix typo.
+
+2013-02-04 Richard Biener <rguenther@suse.de>
+
+ Backport from mainline
+ 2012-01-11 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/44061
+ * gcc.dg/pr44061.c: New testcase.
+
+ 2013-01-08 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/55890
+ * gcc.dg/torture/pr55890-3.c: New test.
+
+2013-02-04 Richard Biener <rguenther@suse.de>
+
+ Backport from mainline
+ 2012-07-04 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/53844
+ * g++.dg/tree-ssa/pr53844.C: New testcase.
+
+ 2012-12-13 Richard Biener <rguenther@suse.de>
+
+ PR lto/55660
+ * gcc.dg/lto/pr55660_0.c: New testcase.
+ * gcc.dg/lto/pr55660_1.c: Likewise.
+
+2013-02-04 Richard Biener <rguenther@suse.de>
+
+ PR middle-end/55890
+ * gcc.dg/torture/pr55890-1.c: New testcase.
+ * gcc.dg/torture/pr55890-2.c: Likewise.
+
+2013-02-02 Thomas Koenig <tkoenig@gcc.gnu.org>
+
+ Backport from trunk
+ PR fortran/50627
+ PR fortran/56054
+ * gfortran.dg/block_12.f90: New test.
+ * gfortran.dg/module_error_1.f90: New test.
+
+2013-02-01 Jakub Jelinek <jakub@redhat.com>
+
+ Backported from mainline
+ 2013-01-28 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/56125
+ * gcc.dg/pr56125.c: New test.
+
+ 2013-01-25 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/56098
+ * gcc.dg/pr56098-1.c: New test.
+
+ 2013-01-23 Jakub Jelinek <jakub@redhat.com>
+
+ PR fortran/56052
+ * gfortran.dg/gomp/pr56052.f90: New test.
+
+ 2013-01-23 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/49069
+ * gcc.dg/pr49069.c: New test.
+
+ 2013-01-21 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/56051
+ * gcc.c-torture/execute/pr56051.c: New test.
+
+ 2013-01-18 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/56015
+ * gfortran.dg/pr56015.f90: New test.
+
+ 2013-01-15 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/55940
+ * gcc.dg/pr55940.c: New test.
+
+ 2013-01-10 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/55921
+ * gcc.c-torture/compile/pr55921.c: New test.
+
+ 2013-01-03 Jakub Jelinek <jakub@redhat.com>
+
+ PR rtl-optimization/55838
+ * gcc.dg/pr55838.c: New test.
+
+ 2012-12-13 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/55652
+ * g++.dg/cpp0x/noexcept19.C: New test.
+
+ 2012-12-06 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/54207
+ * g++.dg/cpp0x/noexcept18.C: New test.
+
+ 2012-12-01 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/55542
+ * g++.dg/cpp0x/vt-55542.C: New test.
+
+ 2012-11-23 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/54046
+ * g++.dg/warn/Wreturn-type-8.C: New test.
+
+ 2012-11-20 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/55094
+ * gcc.dg/pr55094.c: New test.
+
+ 2012-11-17 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/55236
+ * gcc.dg/pr55236.c: New test.
+
+ 2012-11-13 Jakub Jelinek <jakub@redhat.com>
+
+ PR rtl-optimization/54127
+ * gcc.dg/torture/pr54127.c: New test.
+
+2013-02-01 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gnat.dg/opt26.adb: New test.
+
+2013-01-27 Uros Bizjak <ubizjak@gmail.com>
+
+ Backport from mainline
+ 2013-01-22 Uros Bizjak <ubizjak@gmail.com>
+
+ PR target/56028
+ * gcc.target/i386/pr56028.c: New test.
+
+ 2013-01-24 Uros Bizjak <ubizjak@gmail.com>
+
+ * gcc.target/i386/movsd.c: New test.
+
+2013-01-24 Janis Johnson <janisjo@codesourcery.com>
+
+ Backport from mainline
+ 2013-01-16 Janis Johnson <janisjo@codesourcery.com>
+
+ PR testsuite/55994
+ * gcc.c-torture/execute/builtins/builtins.exp: Add
+ -Wl,--allow-multiple-definition for eabi and elf targets.
+
+ Backport from mainline
+ 2013-01-17 Janis Johnson <janisjo@codesourcery.com>
+
+ * gcc.target/arm/pr51835.c: Avoid conflicts with multilib flags.
+ * gcc.target/arm/pr51915.c: Likewise.
+ * gcc.target/arm/pr52006.c: Likewise.
+ * gcc.target/arm/pr53187.c: Likewise.
+
+ Backport from mainline
+ 2012-10-12 Janis Johnson <janisjo@codesourcery.com>
+
+ * lib/target-supports.exp (check_effective_target_arm_hard_vfp_ok):
+ Return 0 if already specifying -mfloat-abi other than hard.
+
+ Backport from mainline
+ 2012-09-27 Janis Johnson <janisjo@codesourcery.com>
+
+ * gcc.target/arm/unsigned-extend-1.c: Omit -march option.
+
+ Backport from mainline
+ 2012-09-26 Janis Johnson <janisjo@codesourcery.com>
+
+ * gcc.target/arm/pr42879.c: Handle big-endian.
+
+ Backport from mainline
+ 2012-09-26 Janis Johnson <janisjo@codesourcery.com>
+
+ * gcc.target/arm/combine-movs.c
+
+ Backport from mainline
+ 2012-09-11 Christophe Lyon <christophe.lyon@linaro.org>
+
+ * gcc.target/arm/neon-vset_lanes8.c: Fix for big-endian support.
+
+2013-01-24 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/56081
+ * gfortran.dg/select_8.f90: New.
+
+2013-01-24 Martin Jambor <mjambor@suse.cz>
+
+ Backport from mainline
+ 2013-01-04 Martin Jambor <mjambor@suse.cz>
+
+ PR tree-optimization/55755
+ * gcc.dg/torture/pr55755.c: New test.
+ * gcc.dg/tree-ssa/sra-13.c: Likewise.
+ * gcc.dg/tree-ssa/pr45144.c: Update.
+
+2013-01-21 Uros Bizjak <ubizjak@gmail.com>
+
+ PR rtl-optimization/56023
+ * gcc.dg/pr56023.c: New test.
+
+2013-01-21 Martin Jambor <mjambor@suse.cz>
+
+ Backport from mainline
+ 2013-01-17 Martin Jambor <mjambor@suse.cz>
+
+ PR tree-optimizations/55264
+ * g++.dg/ipa/pr55264.C: New test.
+
+2013-01-17 Uros Bizjak <ubizjak@gmail.com>
+
+ Backport from mainline
+ 2013-01-17 Uros Bizjak <ubizjak@gmail.com>
+
+ PR target/55981
+ * gcc.target/pr55981.c: New test.
+
+2013-01-17 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/55983
+ * gfortran.dg/class_55.f90: New.
+
+2013-01-16 Richard Biener <rguenther@suse.de>
+
+ PR middle-end/55882
+ * gcc.dg/torture/pr55882.c: New testcase.
+
+2013-01-13 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/55072
+ * gfortran.dg/internal_pack_13.f90: New test.
+ * gfortran.dg/internal_pack_14.f90: New test.
+
+2013-01-13 Paul Thomas <pault@gcc.gnu.org>
+
+ PR fortran/55618
+ * gfortran.dg/elemental_scalar_args_2.f90: New test.
+
+2013-01-08 Mikael Morin <mikael@gcc.gnu.org>
+
+ PR fortran/42769
+ PR fortran/45836
+ PR fortran/45900
+ * gfortran.dg/use_23.f90: New test.
+ * gfortran.dg/use_24.f90: New test.
+ * gfortran.dg/use_25.f90: New test.
+ * gfortran.dg/use_26.f90: New test.
+ * gfortran.dg/use_27.f90: New test.
+
+2013-01-07 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/55852
+ * gfortran.dg/intrinsic_size_3.f90: New.
+
+2013-01-07 Steven G. Kargl <kargl@gcc.gnu.org>
+ Mikael Morin <mikael@gcc.gnu.org>
+
+ PR fortran/55827
+ * gfortran.dg/use_22.f90: New test.
+
+2013-01-07 Terry Guo <terry.guo@arm.com>
+
+ Backport from mainline
+ 2012-12-19 Terry Guo <terry.guo@arm.com>
+
+ * gcc.target/arm/thumb-find-work-register.c: New.
+
+2013-01-06 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gnat.dg/alignment10.adb: New test.
+
2012-12-22 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
Backport from mainline:
@@ -2566,7 +2845,7 @@
2012-02-06 Andrey Belevantsev <abel@ispras.ru>
- * gcc.dg/pr48374.c: Actually add the test I forgot
+ * gcc.dg/pr48374.c: Actually add the test I forgot
in the 2012-01-25 commit.
2012-02-05 Thomas König <tkoenig@gcc.gnu.org>
diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-ctor11.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-ctor11.C
new file mode 100644
index 00000000000..4b526eaa794
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-ctor11.C
@@ -0,0 +1,16 @@
+// PR c++/55856
+// { dg-options -std=c++11 }
+
+struct A
+{
+ A(const char *);
+};
+
+template <class T>
+struct B
+{
+ T t;
+ template <class U> constexpr B(U&& u): t(u) { };
+};
+
+B<A&&> b("");
diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-ctor12.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-ctor12.C
new file mode 100644
index 00000000000..a5a4b4d14a9
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-ctor12.C
@@ -0,0 +1,14 @@
+// PR c++/55753
+// { dg-options -std=c++11 }
+
+template <typename Tp>
+struct C {
+ constexpr C(const Tp& r) { }
+};
+
+template <typename Tp>
+struct B {
+ B() {
+ C<double> cpl = C<double>((true ? 1.0 : C<double>()));
+ }
+};
diff --git a/gcc/testsuite/g++.dg/cpp0x/decltype48.C b/gcc/testsuite/g++.dg/cpp0x/decltype48.C
new file mode 100644
index 00000000000..5aa0174a1e1
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/decltype48.C
@@ -0,0 +1,16 @@
+// PR c++/56059
+// { dg-options -std=c++11 }
+
+typedef int Int;
+template<typename T> struct baz { };
+template<typename T> T bar();
+
+template<typename T, typename ... U>
+baz<decltype(bar<Int>(bar<U>() ...))>
+foo(); // { dg-error "no match" }
+
+int main()
+{
+ foo<int, int>(); // { dg-error "no match" }
+ return 0;
+}
diff --git a/gcc/testsuite/g++.dg/cpp0x/initlist-protected.C b/gcc/testsuite/g++.dg/cpp0x/initlist-protected.C
new file mode 100644
index 00000000000..fb5cc6aa892
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/initlist-protected.C
@@ -0,0 +1,23 @@
+// PR c++/54325
+// { dg-options -std=c++11 }
+
+class base
+{
+ protected:
+ base()
+ {}
+};
+
+class derived : public base
+{
+ public:
+ derived()
+ : base{} // <-- Note the c++11 curly brace syntax
+ {}
+};
+
+int main()
+{
+ derived d1;
+ return 0;
+}
diff --git a/gcc/testsuite/g++.dg/cpp0x/noexcept18.C b/gcc/testsuite/g++.dg/cpp0x/noexcept18.C
new file mode 100644
index 00000000000..953fb0ec8b2
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/noexcept18.C
@@ -0,0 +1,11 @@
+// PR c++/54207
+// { dg-do compile }
+// { dg-options "-std=c++11" }
+
+typedef bool B;
+constexpr B foo () { return true; }
+
+void
+bar () noexcept (foo ())
+{
+}
diff --git a/gcc/testsuite/g++.dg/cpp0x/noexcept19.C b/gcc/testsuite/g++.dg/cpp0x/noexcept19.C
new file mode 100644
index 00000000000..12ff86e0d22
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/noexcept19.C
@@ -0,0 +1,29 @@
+// PR c++/55652
+// { dg-do compile }
+// { dg-options "-std=c++11" }
+
+template <typename T>
+struct A
+{
+ static const bool a = false;
+};
+
+template <typename X, typename Y = A <X>>
+struct B
+{
+ B () noexcept (A <Y>::a) {}
+};
+
+template <typename X, typename Y>
+struct C
+{
+ X x;
+ Y y;
+};
+
+struct D
+{
+ D () throw (int);
+};
+
+C <D, B <D>> c;
diff --git a/gcc/testsuite/g++.dg/cpp0x/noexcept20.C b/gcc/testsuite/g++.dg/cpp0x/noexcept20.C
new file mode 100644
index 00000000000..b86760292b3
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/noexcept20.C
@@ -0,0 +1,22 @@
+// PR c++/56071
+// { dg-options -std=c++11 }
+
+class B
+{
+ template <typename T> friend struct A;
+ B() {}
+};
+
+template <typename T>
+struct A
+{
+ A() noexcept(noexcept(B())) { }
+};
+
+struct C
+{
+ C()
+ {
+ static_assert( !noexcept(A<int>()), "" );
+ }
+};
diff --git a/gcc/testsuite/g++.dg/cpp0x/vt-55542.C b/gcc/testsuite/g++.dg/cpp0x/vt-55542.C
new file mode 100644
index 00000000000..3d5efee87d9
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/vt-55542.C
@@ -0,0 +1,22 @@
+// PR c++/55542
+// { dg-options "-std=c++11" }
+
+template <typename ... P>
+struct B
+{
+ template <typename O>
+ B (O *o, void (O::*f) (P ... p)) {}
+};
+class C
+{
+ void foo (void *, int);
+ template <typename ... A>
+ void bar (A ... a);
+ B <void *> c;
+ B <void *, int> d;
+ C (int) : c (this, &C::bar), d (this, &C::foo) {}
+};
+template <typename ... A>
+void C::bar (A ...)
+{
+}
diff --git a/gcc/testsuite/g++.dg/ext/has_nothrow_constructor-2.C b/gcc/testsuite/g++.dg/ext/has_nothrow_constructor-2.C
new file mode 100644
index 00000000000..9191c3e97f8
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ext/has_nothrow_constructor-2.C
@@ -0,0 +1,7 @@
+// PR c++/55842
+// { dg-options -std=c++11 }
+
+template <class=void> struct number {
+ number() noexcept(noexcept(0)) { }
+};
+const int z=__has_nothrow_constructor(number<>);
diff --git a/gcc/testsuite/g++.dg/ext/visibility/anon11.C b/gcc/testsuite/g++.dg/ext/visibility/anon11.C
new file mode 100644
index 00000000000..dfb4f12bbe8
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ext/visibility/anon11.C
@@ -0,0 +1,13 @@
+// PR c++/55877
+// { dg-final { scan-assembler-not "\\.local" } }
+
+typedef struct {
+ typedef enum { X, Y } A;
+ typedef struct { } B;
+ struct C { };
+} D;
+
+D d;
+D::A a;
+D::B b;
+D::C c;
diff --git a/gcc/testsuite/g++.dg/init/array33.C b/gcc/testsuite/g++.dg/init/array33.C
new file mode 100644
index 00000000000..4440d3d5432
--- /dev/null
+++ b/gcc/testsuite/g++.dg/init/array33.C
@@ -0,0 +1,22 @@
+// PR c++/55804
+// { dg-do run }
+
+int t = 0;
+template <typename> struct vector {
+ vector() { t++; }
+};
+
+typedef vector<int> Arrays[1];
+class C
+{
+ vector<int> v_;
+ void Foo(const Arrays &);
+};
+Arrays a;
+
+int main(void)
+{
+ if (t!=1)
+ __builtin_abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/g++.dg/init/array34.C b/gcc/testsuite/g++.dg/init/array34.C
new file mode 100644
index 00000000000..1c2e022e5eb
--- /dev/null
+++ b/gcc/testsuite/g++.dg/init/array34.C
@@ -0,0 +1,15 @@
+// PR c++/53650
+// We should loop over array inits if they don't involve temporaries
+// that need extending.
+// { dg-options "-fdump-tree-gimple" }
+// { dg-final { scan-tree-dump-times "Class::Class" 1 "gimple" } }
+// { dg-final { cleanup-tree-dump "gimple" } }
+
+struct Class {
+ Class();
+};
+
+int main() {
+ Class table [10] = {};
+ return 0;
+}
diff --git a/gcc/testsuite/g++.dg/init/const9.C b/gcc/testsuite/g++.dg/init/const9.C
new file mode 100644
index 00000000000..ba1dfd4bc46
--- /dev/null
+++ b/gcc/testsuite/g++.dg/init/const9.C
@@ -0,0 +1,12 @@
+// PR c++/55893
+// { dg-final { scan-assembler-not "rodata" } }
+
+struct foo
+{
+ virtual ~foo ();
+};
+
+int main ()
+{
+ static const foo tmp;
+}
diff --git a/gcc/testsuite/g++.dg/ipa/pr55264.C b/gcc/testsuite/g++.dg/ipa/pr55264.C
new file mode 100644
index 00000000000..cf54d6ae2a9
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ipa/pr55264.C
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fno-early-inlining -fno-weak" } */
+
+struct S
+{
+ S();
+ virtual inline void foo ()
+ {
+ foo();
+ }
+};
+
+void
+B ()
+{
+ S().foo ();
+}
diff --git a/gcc/testsuite/g++.dg/tree-ssa/pr53844.C b/gcc/testsuite/g++.dg/tree-ssa/pr53844.C
new file mode 100644
index 00000000000..0be29d86cbf
--- /dev/null
+++ b/gcc/testsuite/g++.dg/tree-ssa/pr53844.C
@@ -0,0 +1,78 @@
+// { dg-do compile }
+// { dg-options "-O2 -fdump-tree-optimized-vops" }
+
+struct VBase;
+
+//Very minimal numeric vector class where Base provides the policy
+template<typename Base=VBase>
+struct Vector : public Base{
+
+ inline Vector(const Base& b)
+ :Base(b)
+ {
+ }
+
+ //Assignment from any other sort of Vector
+ template<typename Base2>
+ void operator= (const Vector<Base2>& from)
+ {
+ for(int i=0; i<100; i++){
+ (*this)[i]=from[i];
+ }
+ }
+};
+
+
+//Base class to represent pointer as a Vector
+struct VBase{
+ double * const my_data;
+
+ double& operator[](int i) {
+ return my_data[i];
+ }
+
+ const double& operator[](int i) const {
+ return my_data[i];
+ }
+};
+
+//Base class providing very minimalistic expression template
+template<class B2> struct ScalarMulExpr
+{
+ const int& mul;
+ const Vector<B2>& vec;
+
+ int size() const
+ {
+ return vec.size();
+ }
+
+ double operator[](int i) const
+ {
+ return vec[i]*mul;
+ }
+
+ ScalarMulExpr(const Vector<B2>& vec_, const int& m)
+ :mul(m),vec(vec_)
+ {
+ }
+};
+
+//Allow vector to be multiplied by a scalar
+template<class B2>
+Vector<ScalarMulExpr<B2> > operator*(const Vector<B2>& lhs, const int& rhs)
+{
+ return ScalarMulExpr<B2>(lhs, rhs);
+}
+
+//Test function producing suboptimal asm code
+void test(const Vector<>& in, Vector<>& out, int i)
+{
+ out=in*1*1*1*1*1*1*1*1*1*1*1;
+}
+
+// There should be a single store remaining, inside the loops. All
+// dead stores to unused temporaries should have been removed.
+
+// { dg-final { scan-tree-dump-times "VDEF" 1 "optimized" } }
+// { dg-final { cleanup-tree-dump "optimized" } }
diff --git a/gcc/testsuite/g++.dg/warn/Wreturn-type-8.C b/gcc/testsuite/g++.dg/warn/Wreturn-type-8.C
new file mode 100644
index 00000000000..df87ba490da
--- /dev/null
+++ b/gcc/testsuite/g++.dg/warn/Wreturn-type-8.C
@@ -0,0 +1,90 @@
+// PR c++/54046
+// { dg-do compile }
+// { dg-options "-O0 -Wall -Wno-unused" }
+
+void foo (void) __attribute__((noreturn));
+
+struct A
+{
+ ~A () {}
+};
+
+bool
+check1 (int x)
+{
+ A z;
+ switch (x)
+ {
+ case 0:
+ return false;
+ default:
+ throw "X";
+ break;
+ }
+}
+
+bool
+check2 (int x)
+{
+ A z;
+ switch (x)
+ {
+ case 0:
+ return false;
+ default:
+ foo ();
+ break;
+ }
+}
+
+bool
+check3 (int x)
+{
+ switch (x)
+ {
+ case 0:
+ return false;
+ default:
+ throw "X";
+ break;
+ }
+}
+
+bool
+check4 (int x)
+{
+ switch (x)
+ {
+ case 0:
+ return false;
+ default:
+ foo ();
+ break;
+ }
+}
+
+bool
+check5 (int x)
+{
+ A z;
+ switch (x)
+ {
+ case 0:
+ return false;
+ default:
+ throw "X";
+ }
+}
+
+bool
+check6 (int x)
+{
+ A z;
+ switch (x)
+ {
+ case 0:
+ return false;
+ default:
+ foo ();
+ }
+}
diff --git a/gcc/testsuite/g++.dg/warn/pmf2.C b/gcc/testsuite/g++.dg/warn/pmf2.C
new file mode 100644
index 00000000000..be138190b09
--- /dev/null
+++ b/gcc/testsuite/g++.dg/warn/pmf2.C
@@ -0,0 +1,24 @@
+// PR c++/56104
+// { dg-options "-Wall -O2" }
+
+struct Foo
+{
+ Foo();
+ Foo(const Foo&);
+ void call()
+ {}
+};
+
+template<class MEMSIG, MEMSIG MEMFUNC>
+struct Wrap
+{
+ inline static void call( Foo cc )
+ {
+ (cc.*MEMFUNC)(); // <- warning here
+ }
+};
+
+void bar()
+{
+ Wrap<void (Foo::*)(), &Foo::call>::call( Foo() );
+}
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr55921.c b/gcc/testsuite/gcc.c-torture/compile/pr55921.c
new file mode 100644
index 00000000000..39af43cec0c
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/pr55921.c
@@ -0,0 +1,22 @@
+/* PR tree-optimization/55921 */
+/* { dg-do compile { target i?86-*-* x86_64-*-* } } */
+
+typedef union
+{
+ _Complex float cf;
+ long long ll;
+} ucf;
+
+void
+foo (ucf *in, ucf *out, _Complex float r)
+{
+ int i;
+ ucf ucf1;
+ _Complex float cf;
+
+ ucf1.ll = in[i].ll;
+ __asm ("" : "=r" (cf) : "0" (ucf1.ll));
+ cf *= r;
+ __asm ("" : "=r" (ucf1.ll) : "0" (cf));
+ out[i].ll = ucf1.ll;
+}
diff --git a/gcc/testsuite/gcc.c-torture/execute/builtins/builtins.exp b/gcc/testsuite/gcc.c-torture/execute/builtins/builtins.exp
index a54f3c1b53e..f86d535382e 100644
--- a/gcc/testsuite/gcc.c-torture/execute/builtins/builtins.exp
+++ b/gcc/testsuite/gcc.c-torture/execute/builtins/builtins.exp
@@ -41,6 +41,10 @@ set additional_flags ""
if [istarget "powerpc-*-darwin*"] {
lappend additional_flags "-Wl,-multiply_defined,suppress"
}
+if { [istarget *-*-eabi*]
+ || [istarget *-*-elf] } {
+ lappend additional_flags "-Wl,--allow-multiple-definition"
+}
foreach src [lsort [find $srcdir/$subdir *.c]] {
if {![string match *-lib.c $src] && [runtest_file_p $runtests $src]} {
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr56051.c b/gcc/testsuite/gcc.c-torture/execute/pr56051.c
new file mode 100644
index 00000000000..4ff6b9e267b
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/pr56051.c
@@ -0,0 +1,32 @@
+/* PR tree-optimization/56051 */
+
+extern void abort (void);
+
+int
+main ()
+{
+ unsigned char x1[1] = { 0 };
+ unsigned int s1 = __CHAR_BIT__;
+ int a1 = x1[0] < (unsigned char) (1 << s1);
+ unsigned char y1 = (unsigned char) (1 << s1);
+ int b1 = x1[0] < y1;
+ if (a1 != b1)
+ abort ();
+#if __SIZEOF_LONG_LONG__ > __SIZEOF_INT__
+ unsigned long long x2[1] = { 2ULL << (sizeof (int) * __CHAR_BIT__) };
+ unsigned int s2 = sizeof (int) * __CHAR_BIT__ - 1;
+ int a2 = x2[0] >= (unsigned long long) (1 << s2);
+ unsigned long long y2 = 1 << s2;
+ int b2 = x2[0] >= y2;
+ if (a2 != b2)
+ abort ();
+ unsigned long long x3[1] = { 2ULL << (sizeof (int) * __CHAR_BIT__) };
+ unsigned int s3 = sizeof (int) * __CHAR_BIT__ - 1;
+ int a3 = x3[0] >= (unsigned long long) (1U << s3);
+ unsigned long long y3 = 1U << s3;
+ int b3 = x3[0] >= y3;
+ if (a3 != b3)
+ abort ();
+#endif
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/lto/pr55660_0.c b/gcc/testsuite/gcc.dg/lto/pr55660_0.c
new file mode 100644
index 00000000000..7e7bb2ffff8
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/pr55660_0.c
@@ -0,0 +1,11 @@
+/* { dg-lto-do run } */
+/* { dg-extra-ld-options { -funsigned-char } } */
+
+char n[3] = {'a','b','c'};
+int foo(char *x)
+{
+ if (*x == 'b')
+ return (int)*x;
+ *x = 'y';
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/lto/pr55660_1.c b/gcc/testsuite/gcc.dg/lto/pr55660_1.c
new file mode 100644
index 00000000000..a8c368bb925
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lto/pr55660_1.c
@@ -0,0 +1,15 @@
+extern int foo (char*);
+extern void abort (void);
+
+extern char n[3];
+
+int main ()
+{
+ int i, m = 0;
+ for (i = 0; i < 3; i++)
+ m += foo(&n[i]);
+
+ if (m != 'b')
+ abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/pr44061.c b/gcc/testsuite/gcc.dg/pr44061.c
new file mode 100644
index 00000000000..60a4260ae94
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr44061.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -Wall" } */
+
+int a[2];
+int foo (int q)
+{
+ if (__builtin_constant_p (q))
+ {
+ if (q == 4)
+ return a[4]; /* { dg-bogus "array subscript is above array bounds" } */
+ else
+ return a[0];
+ }
+ else
+ return a[q];
+}
diff --git a/gcc/testsuite/gcc.dg/pr49069.c b/gcc/testsuite/gcc.dg/pr49069.c
new file mode 100644
index 00000000000..f0fe1f2f080
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr49069.c
@@ -0,0 +1,15 @@
+/* PR target/49069 */
+/* { dg-do compile } */
+/* { dg-options "-Os -fno-tree-forwprop -Wno-div-by-zero" } */
+
+int a;
+const unsigned long long b[1] = { 1ULL };
+extern void bar (int);
+
+void
+foo (void)
+{
+ for (a = 0; a == 1; a = 2)
+ ;
+ bar (b[0] == (a == 0 ? a : a / 0));
+}
diff --git a/gcc/testsuite/gcc.dg/pr55094.c b/gcc/testsuite/gcc.dg/pr55094.c
new file mode 100644
index 00000000000..c445b1a8649
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr55094.c
@@ -0,0 +1,45 @@
+/* PR middle-end/55094 */
+/* { dg-do compile } */
+/* { dg-options "-fcompare-debug -Os" } */
+/* { dg-additional-options "-fomit-frame-pointer -fno-asynchronous-unwind-tables -mpreferred-stack-boundary=2" { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
+
+extern int fn (long);
+int v;
+
+int
+foo (int x, long *y)
+{
+ if (x)
+ {
+ fn (y[0]);
+ __builtin_trap ();
+ }
+ __builtin_trap ();
+}
+
+int
+bar (int x, long *y)
+{
+ if (x)
+ {
+ fn (y[0]);
+ v = 1;
+ __builtin_unreachable ();
+ }
+ v = 1;
+ __builtin_unreachable ();
+}
+
+int
+baz (int x, long *y)
+{
+ if (x)
+ {
+ fn (y[0]);
+ v = 1;
+ __builtin_unreachable ();
+ }
+ v = 1;
+ int w = 1;
+ __builtin_unreachable ();
+}
diff --git a/gcc/testsuite/gcc.dg/pr55236.c b/gcc/testsuite/gcc.dg/pr55236.c
new file mode 100644
index 00000000000..dc66c04c327
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr55236.c
@@ -0,0 +1,31 @@
+/* PR tree-optimization/55236 */
+/* { dg-do run } */
+/* { dg-options "-O2 -fwrapv" } */
+
+extern void abort ();
+
+__attribute__((noinline, noclone)) void
+foo (int i)
+{
+ if (i > 0)
+ abort ();
+ i = -i;
+ if (i < 0)
+ return;
+ abort ();
+}
+
+__attribute__((noinline, noclone)) void
+bar (int i)
+{
+ if (i > 0 || (-i) >= 0)
+ abort ();
+}
+
+int
+main ()
+{
+ foo (-__INT_MAX__ - 1);
+ bar (-__INT_MAX__ - 1);
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/pr55838.c b/gcc/testsuite/gcc.dg/pr55838.c
new file mode 100644
index 00000000000..d2d6e142ba2
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr55838.c
@@ -0,0 +1,13 @@
+/* PR rtl-optimization/55838 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -funroll-loops" } */
+
+int a;
+unsigned char c;
+
+void
+f (void)
+{
+ while (c++ < 2)
+ c = a += 129;
+}
diff --git a/gcc/testsuite/gcc.dg/pr55940.c b/gcc/testsuite/gcc.dg/pr55940.c
new file mode 100644
index 00000000000..d046d0b6912
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr55940.c
@@ -0,0 +1,54 @@
+/* PR target/55940 */
+/* { dg-do run } */
+/* { dg-options "-Os" } */
+/* { dg-additional-options "-mpreferred-stack-boundary=2" { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
+
+struct S { int s; unsigned long t; };
+
+__attribute__ ((noinline, noclone)) unsigned long long
+bar (struct S *x, unsigned long y)
+{
+ asm volatile ("" : : "r" (x), "r" (y) : "memory");
+ return x->s + y;
+}
+
+__attribute__ ((noinline, noclone)) unsigned long long
+foo (struct S *x, unsigned long y)
+{
+ unsigned long a;
+ if (__builtin_expect (((__UINTPTR_TYPE__) (x) + 0x1000U < 0x2000U), 0))
+ return ~0ULL;
+ if (__builtin_expect (x->s <= 0 || x->s > 9, 0))
+ return ~0ULL;
+ a = x->t >> 12;
+ if (y == a)
+ return ~0ULL;
+ if (x->s == 3)
+ return x->t + y * 4096;
+ return bar (x, y);
+}
+
+int va, vb, vc, vd;
+
+int
+main ()
+{
+ struct S s;
+ asm volatile ("" : : : "memory");
+ int a = va, b = vb, c = vc, d = vd;
+ asm volatile ("" : : : "memory");
+ int i;
+ for (i = 0; i < 64; i++)
+ if (foo ((struct S *) 0, 0) != ~0ULL)
+ __builtin_abort ();
+ s.s = 3;
+ s.t = 2 << 12;
+ if (foo (&s, 2) != ~0ULL)
+ __builtin_abort ();
+ if (foo (&s, 3) != (2 << 12) + 3 * 4096)
+ __builtin_abort ();
+ asm volatile ("" : : : "memory");
+ va = a; vb = b; vc = c; vd = d;
+ asm volatile ("" : : : "memory");
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/pr56023.c b/gcc/testsuite/gcc.dg/pr56023.c
new file mode 100644
index 00000000000..f1942ac18c9
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr56023.c
@@ -0,0 +1,19 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fcompare-debug" } */
+
+void
+foo (char *c)
+{
+ unsigned int x = 0;
+ unsigned int i;
+
+ for (i = 0; c[i]; i++)
+ {
+ if (i >= 5 && x != 1)
+ break;
+ else if (c[i] == ' ')
+ x = i;
+ else if (c[i] == '/' && c[i + 1] != ' ' && i)
+ x = i + 1;
+ }
+}
diff --git a/gcc/testsuite/gcc.dg/pr56098-1.c b/gcc/testsuite/gcc.dg/pr56098-1.c
new file mode 100644
index 00000000000..c3b081a0899
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr56098-1.c
@@ -0,0 +1,16 @@
+/* PR tree-optimization/56098 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+volatile int *p;
+
+void
+foo (int x)
+{
+ *p = 1;
+ if (x)
+ *p = 2;
+}
+
+/* { dg-final { scan-tree-dump-not "=\[^\n\r]*\\*p" "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc/testsuite/gcc.dg/pr56125.c b/gcc/testsuite/gcc.dg/pr56125.c
new file mode 100644
index 00000000000..d1840a9a059
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr56125.c
@@ -0,0 +1,21 @@
+/* PR tree-optimization/56125 */
+/* { dg-do run } */
+/* { dg-options "-O2 -ffast-math" } */
+
+extern void abort (void);
+extern double fabs (double);
+
+__attribute__((cold)) double
+foo (double x, double n)
+{
+ double u = x / (n * n);
+ return u;
+}
+
+int
+main ()
+{
+ if (fabs (foo (29, 2) - 7.25) > 0.001)
+ abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/torture/pr54127.c b/gcc/testsuite/gcc.dg/torture/pr54127.c
new file mode 100644
index 00000000000..4f64998af0a
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr54127.c
@@ -0,0 +1,16 @@
+/* PR rtl-optimization/54127 */
+/* { dg-do compile } */
+
+extern void foo (void) __attribute__ ((__noreturn__));
+
+void
+bar (int x)
+{
+ if (x < 0)
+ foo ();
+ if (x == 0)
+ return;
+ __asm goto ("# %l[lab] %l[lab2]" : : : : lab, lab2);
+lab:;
+lab2:;
+}
diff --git a/gcc/testsuite/gcc.dg/torture/pr55755.c b/gcc/testsuite/gcc.dg/torture/pr55755.c
new file mode 100644
index 00000000000..3c8bb6ba41a
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr55755.c
@@ -0,0 +1,43 @@
+/* { dg-do run } */
+/* { dg-require-effective-target int32plus } */
+
+struct S4
+{
+ unsigned f0:24;
+} __attribute__((__packed__));
+
+struct S4 g_10 = {
+ 6210831
+};
+
+struct S5
+{
+ int i;
+ struct S4 l_8[2];
+} __attribute__((__packed__));
+
+int a, b;
+
+struct S4 func_2 (int x)
+{
+ struct S5 l = {
+ 0,
+ {{0}, {0}}
+ };
+ l.i = a;
+ g_10 = l.l_8[1];
+ for (; x<2; x++) {
+ struct S4 tmp = {
+ 11936567
+ };
+ l.l_8[x] = tmp;
+ }
+ b = l.i;
+ return g_10;
+}
+
+int main (void)
+{
+ func_2 (0);
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/torture/pr55882.c b/gcc/testsuite/gcc.dg/torture/pr55882.c
new file mode 100644
index 00000000000..fd2276e7f53
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr55882.c
@@ -0,0 +1,94 @@
+/* { dg-do run } */
+
+typedef enum
+{
+ PVT_A = 0,
+ PVT_B = 1,
+ PVT_CONFIG = 2,
+ PVT_RESERVED3 = 3,
+} T_CR_SELECT;
+
+typedef enum
+{
+ STD_ULOGIC_0 = 0,
+ STD_ULOGIC_1 = 1,
+} STD_ULOGIC;
+
+typedef struct
+{
+ unsigned char rtp : 3;
+ unsigned char rtn : 3;
+} C;
+
+typedef struct
+{
+ unsigned char nd;
+ unsigned char pd;
+ unsigned char rtn;
+ unsigned char rtp;
+} A;
+
+typedef struct
+{
+ unsigned short reserved : 14;
+ unsigned char Z_rx_enable : 2;
+ A pvt;
+} B;
+
+typedef struct
+{
+ B cr_dsclk_q3;
+ B cr_data_q3;
+ B cr_addr_q3;
+ B cr_cmd_q3;
+ B cr_pres_q3;
+ C cr_vref_q3[6];
+ unsigned char pres_disable;
+ unsigned char pres_drive_high;
+ unsigned char c_enab_120;
+ STD_ULOGIC clk_tximp;
+ STD_ULOGIC dqs_tximp;
+ STD_ULOGIC cmd_tximp;
+ STD_ULOGIC data_tximp;
+ STD_ULOGIC dqs_rxterm;
+ STD_ULOGIC data_rxterm;
+ T_CR_SELECT cr_clk_sel;
+ unsigned char cr_clk : 5;
+ T_CR_SELECT cr_dsclk_odd_sel;
+ unsigned char cr_dsclk_odd : 5;
+ T_CR_SELECT cr_dsclk_even_sel;
+ unsigned char cr_dsclk_even : 5;
+ T_CR_SELECT cr_data_sel;
+ unsigned char cr_data : 5;
+ T_CR_SELECT cr_vref_sel;
+ unsigned char cr_vref : 5;
+ T_CR_SELECT cr_others_sel;
+ unsigned char cr_others : 5;
+} CONFIG;
+
+typedef struct
+{
+ unsigned char enable_monitor;
+ unsigned short step_out_pointer : 12;
+ unsigned short hold_out_pointer : 12;
+ unsigned short enable_wr_dqs : 12;
+ unsigned short use_alt_rd_dqs : 12;
+ CONFIG io_buf;
+} mystruct;
+
+unsigned short __attribute__((noinline,noclone))
+testfunction(unsigned i)
+{
+ mystruct dmfe[8];
+ dmfe[0].use_alt_rd_dqs = 1;
+ dmfe[i].use_alt_rd_dqs = 0;
+ return dmfe[0].use_alt_rd_dqs;
+}
+
+extern void abort (void);
+int main ()
+{
+ if (testfunction(0) != 0)
+ abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/torture/pr55890-1.c b/gcc/testsuite/gcc.dg/torture/pr55890-1.c
new file mode 100644
index 00000000000..9fd558ea03f
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr55890-1.c
@@ -0,0 +1,6 @@
+/* { dg-do compile } */
+
+extern void *memmove(void *, void *, __SIZE_TYPE__);
+typedef int (*_TEST_fun_) ();
+static _TEST_fun_ i = (_TEST_fun_) memmove;
+main() { i(); }
diff --git a/gcc/testsuite/gcc.dg/torture/pr55890-2.c b/gcc/testsuite/gcc.dg/torture/pr55890-2.c
new file mode 100644
index 00000000000..a753e573dce
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr55890-2.c
@@ -0,0 +1,4 @@
+/* { dg-do compile } */
+
+extern void *memcpy();
+main() { memcpy(); }
diff --git a/gcc/testsuite/gcc.dg/torture/pr55890-3.c b/gcc/testsuite/gcc.dg/torture/pr55890-3.c
new file mode 100644
index 00000000000..c7f77be689d
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr55890-3.c
@@ -0,0 +1,9 @@
+/* { dg-do compile } */
+
+void *memmove ();
+
+void *
+bar ()
+{
+ return memmove ();
+}
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr45144.c b/gcc/testsuite/gcc.dg/tree-ssa/pr45144.c
index 85b2b159766..af23fb5970b 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/pr45144.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr45144.c
@@ -43,5 +43,5 @@ bar (unsigned orig, unsigned *new)
*new = foo (&a);
}
-/* { dg-final { scan-tree-dump " = VIEW_CONVERT_EXPR<unsigned int>\\(a\\);" "optimized"} } */
+/* { dg-final { scan-tree-dump-not "unnamed-unsigned:19" "optimized"} } */
/* { dg-final { cleanup-tree-dump "optimized" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/sra-13.c b/gcc/testsuite/gcc.dg/tree-ssa/sra-13.c
new file mode 100644
index 00000000000..12b77fe2f27
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/sra-13.c
@@ -0,0 +1,114 @@
+/* Test that SRA replacement can deal with assignments that have
+ sub-replacements on one side and a single scalar replacement on another. */
+/* { dg-do run } */
+/* { dg-options "-O1" } */
+
+struct A
+{
+ int i1, i2;
+};
+
+struct B
+{
+ long long int l;
+};
+
+union U
+{
+ struct A a;
+ struct B b;
+};
+
+int b, gi;
+long gl;
+union U gu1, gu2;
+
+int __attribute__ ((noinline, noclone))
+foo (void)
+{
+ union U x, y;
+ int r;
+
+ y = gu1;
+ if (b)
+ y.b.l = gl;
+
+ x = y;
+
+ if (!b)
+ r = x.a.i1;
+ else
+ r = 0;
+
+ gu2 = x;
+ return r;
+}
+
+long long int __attribute__ ((noinline, noclone))
+bar (void)
+{
+ union U x, y;
+ int r;
+
+ y = gu1;
+ if (b)
+ y.a.i1 = gi;
+
+ x = y;
+
+ if (!b)
+ r = x.b.l;
+ else
+ r = 0;
+
+ gu2 = x;
+ return r;
+}
+
+
+int
+main (void)
+{
+ int r;
+ long long int s;
+
+ b = 0;
+ gu1.a.i1 = 123;
+ gu1.a.i2 = 234;
+ r = foo ();
+ if (r != 123)
+ __builtin_abort ();
+ if (gu2.a.i1 != 123)
+ __builtin_abort ();
+ if (gu2.a.i2 != 234)
+ __builtin_abort ();
+
+ b = 1;
+ gl = 10000001;
+ gu1.b.l = 10000000;
+ r = foo ();
+ if (r != 0)
+ __builtin_abort ();
+ if (gu2.b.l != 10000001)
+ __builtin_abort ();
+
+ b = 0;
+ gu1.b.l = 20000000;
+ s = bar ();
+ if (s != 20000000)
+ __builtin_abort ();
+ if (gu2.b.l != 20000000)
+ __builtin_abort ();
+
+ b = 1;
+ gi = 456;
+ gu1.a.i1 = 123;
+ gu1.a.i2 = 234;
+ s = bar ();
+ if (s != 0)
+ __builtin_abort ();
+ if (gu2.a.i1 != 456)
+ __builtin_abort ();
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/arm/combine-movs.c b/gcc/testsuite/gcc.target/arm/combine-movs.c
index 4209a331427..e9fd6cb45d6 100644
--- a/gcc/testsuite/gcc.target/arm/combine-movs.c
+++ b/gcc/testsuite/gcc.target/arm/combine-movs.c
@@ -9,4 +9,5 @@ void foo (unsigned long r[], unsigned int d)
r[i] = 0;
}
-/* { dg-final { scan-assembler "movs\tr\[0-9\]" } } */
+/* { dg-final { scan-assembler "lsrs\tr\[0-9\]" { target arm_thumb2 } } } */
+/* { dg-final { scan-assembler "movs\tr\[0-9\]" { target { ! arm_thumb2 } } } } */
diff --git a/gcc/testsuite/gcc.target/arm/neon-vset_lanes8.c b/gcc/testsuite/gcc.target/arm/neon-vset_lanes8.c
index e87102edbe2..51d38fd1dfc 100644
--- a/gcc/testsuite/gcc.target/arm/neon-vset_lanes8.c
+++ b/gcc/testsuite/gcc.target/arm/neon-vset_lanes8.c
@@ -9,11 +9,14 @@
#include <stdlib.h>
#include <string.h>
-int8x8_t x = { 1, 2, 3, 4, 5, 6, 7, 8 };
-int8x8_t y = { 1, 2, 3, 16, 5, 6, 7, 8 };
+int8_t x_init[8] = { 1, 2, 3, 4, 5, 6, 7, 8 };
+int8_t y_init[8] = { 1, 2, 3, 16, 5, 6, 7, 8 };
int main (void)
{
+ int8x8_t x = vld1_s8 (x_init);
+ int8x8_t y = vld1_s8 (y_init);
+
x = vset_lane_s8 (16, x, 3);
if (memcmp (&x, &y, sizeof (x)) != 0)
abort();
diff --git a/gcc/testsuite/gcc.target/arm/pr42879.c b/gcc/testsuite/gcc.target/arm/pr42879.c
index 9961a839fb8..9fcdad694a3 100644
--- a/gcc/testsuite/gcc.target/arm/pr42879.c
+++ b/gcc/testsuite/gcc.target/arm/pr42879.c
@@ -4,6 +4,9 @@
struct A
{
+#ifdef __ARMEB__
+ int dummy:31;
+#endif
int v:1;
};
diff --git a/gcc/testsuite/gcc.target/arm/pr51835.c b/gcc/testsuite/gcc.target/arm/pr51835.c
index 858b72f8ad8..6d462d91596 100644
--- a/gcc/testsuite/gcc.target/arm/pr51835.c
+++ b/gcc/testsuite/gcc.target/arm/pr51835.c
@@ -1,6 +1,8 @@
/* { dg-do compile } */
-/* { dg-options "-O2 -mfloat-abi=hard -mfpu=fpv4-sp-d16" } */
-/* { dg-require-effective-target arm_thumb2_ok } */
+/* { dg-skip-if "no support for hard-float VFP ABI" { arm_thumb1 } { "-march=*" } { "" } } */
+/* { dg-skip-if "do not override -mfloat-abi" { *-*-* } { "-mfloat-abi=*" } { "-mfloat-abi=hard" } } */
+/* { dg-skip-if "avoid conflicting -mfpu" { *-*-* } { "-mfpu=*" } { "-mfpu=fpv4-sp-d16" "-mfpu=vfpv3xd" "-mfpu=vfpv3xd-fp16" } } */
+/* { dg-options "-O2 -march=armv7-a -mfloat-abi=hard -mfpu=fpv4-sp-d16" } */
int func1 (double d)
{
@@ -11,4 +13,5 @@ unsigned int func2 (double d)
return (unsigned int)d;
}
-/* { dg-final { scan-assembler-times "fmrrd\[\\t \]+r0,\[\\t \]*r1,\[\\t \]*d0" 2 } } */
+/* { dg-final { scan-assembler-times "fmrrd\[\\t \]+r0,\[\\t \]*r1,\[\\t \]*d0" 2 { target { arm_little_endian } } } } */
+/* { dg-final { scan-assembler-times "fmrrd\[\\t \]+r1,\[\\t \]*r0,\[\\t \]*d0" 2 { target { ! arm_little_endian } } } } */
diff --git a/gcc/testsuite/gcc.target/arm/pr51915.c b/gcc/testsuite/gcc.target/arm/pr51915.c
index 81bc4ebd15d..144d522f85b 100644
--- a/gcc/testsuite/gcc.target/arm/pr51915.c
+++ b/gcc/testsuite/gcc.target/arm/pr51915.c
@@ -1,5 +1,7 @@
/* PR target/51915 */
/* { dg-do compile } */
+/* { dg-skip-if "no support for hard-float VFP ABI" { arm_thumb1 } { "-march=*" } { "" } } */
+/* { dg-skip-if "do not override -mfloat-abi" { *-*-* } { "-mfloat-abi=*" } { "-mfloat-abi=hard" } } */
/* { dg-options "-march=armv7-a -mfloat-abi=hard -O2" } */
struct S { int s1; void *s2; };
diff --git a/gcc/testsuite/gcc.target/arm/pr52006.c b/gcc/testsuite/gcc.target/arm/pr52006.c
index 249470ad516..c274449ba01 100644
--- a/gcc/testsuite/gcc.target/arm/pr52006.c
+++ b/gcc/testsuite/gcc.target/arm/pr52006.c
@@ -1,5 +1,7 @@
/* PR target/52006 */
/* { dg-do compile } */
+/* { dg-skip-if "avoid conflicts with multilib flags" { *-*-* } { "-mfloat-abi=*" } { "-mfloat-abi=hard" } } */
+/* { dg-skip-if "no support for hard-float VFP ABI" { arm_thumb1 } { "-march=*" } { "" } } */
/* { dg-options "-march=armv7-a -mfloat-abi=hard -O2 -fPIC" } */
unsigned long a;
diff --git a/gcc/testsuite/gcc.target/arm/pr53187.c b/gcc/testsuite/gcc.target/arm/pr53187.c
index 648a06df5f6..b40dbbb310b 100644
--- a/gcc/testsuite/gcc.target/arm/pr53187.c
+++ b/gcc/testsuite/gcc.target/arm/pr53187.c
@@ -1,5 +1,7 @@
/* PR target/53187 */
/* { dg-do compile } */
+/* { dg-skip-if "no support for hard-float VFP ABI" { arm_thumb1 } { "-march=*" } { "" } } */
+/* { dg-skip-if "do not override -mfloat-abi" { *-*-* } { "-mfloat-abi=*" } { "-mfloat-abi=hard" } } */
/* { dg-options "-march=armv7-a -mfloat-abi=hard -O2" } */
void bar (int);
diff --git a/gcc/testsuite/gcc.target/arm/thumb-find-work-register.c b/gcc/testsuite/gcc.target/arm/thumb-find-work-register.c
new file mode 100644
index 00000000000..f2c0225a4d2
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/thumb-find-work-register.c
@@ -0,0 +1,40 @@
+/* Wrong method to get number of arg reg will cause argument corruption. */
+/* { dg-do run } */
+/* { dg-require-effective-target arm_eabi } */
+/* { dg-options "-mthumb -O1" } */
+
+extern void abort (void);
+
+int foo (int, int, int, int) __attribute__((noinline));
+
+int
+foo (int a, int b, int c, int d)
+{
+ register int m asm ("r8");
+
+ m = a;
+ m += b;
+ m += c;
+ m += d;
+
+ asm ("" : "=r" (m) : "0" (m));
+
+ return m;
+}
+
+int
+main ()
+{
+ volatile int a = 10;
+ volatile int b = 20;
+ volatile int c = 30;
+ volatile int d = 40;
+ volatile int sum = 0;
+
+ sum = foo (a, b, c, d);
+
+ if (sum != 100)
+ abort ();
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/arm/unsigned-extend-1.c b/gcc/testsuite/gcc.target/arm/unsigned-extend-1.c
index 6c55561df95..3b4ab048fb0 100644
--- a/gcc/testsuite/gcc.target/arm/unsigned-extend-1.c
+++ b/gcc/testsuite/gcc.target/arm/unsigned-extend-1.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O2 -march=armv6" } */
+/* { dg-options "-O2" } */
unsigned char foo (unsigned char c)
{
diff --git a/gcc/testsuite/gcc.target/i386/movsd.c b/gcc/testsuite/gcc.target/i386/movsd.c
new file mode 100644
index 00000000000..32a19e79a08
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/movsd.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -msse2 -mfpmath=sse" } */
+
+volatile double y;
+
+void
+test ()
+{
+ int z;
+
+ for (z = 0; z < 1000; z++)
+ y = 1.23;
+}
+
+/* { dg-final { scan-assembler-not "(fld|fst)" } } */
diff --git a/gcc/testsuite/gcc.target/i386/pr56028.c b/gcc/testsuite/gcc.target/i386/pr56028.c
new file mode 100644
index 00000000000..18ae25398b8
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr56028.c
@@ -0,0 +1,54 @@
+/* { dg-do compile { target { ! { ia32 } } } } */
+/* { dg-options "-O2" } */
+
+volatile int a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p;
+
+volatile long long y;
+
+void
+test ()
+{
+ int a_ = a;
+ int b_ = b;
+ int c_ = c;
+ int d_ = d;
+ int e_ = e;
+ int f_ = f;
+ int g_ = g;
+ int h_ = h;
+ int i_ = i;
+ int j_ = j;
+ int k_ = k;
+ int l_ = l;
+ int m_ = m;
+ int n_ = n;
+ int o_ = o;
+ int p_ = p;
+
+ int z;
+
+ for (z = 0; z < 1000; z++)
+ {
+ y = 0x100000002ll;
+ y = 0x300000004ll;
+ }
+
+ a = a_;
+ b = b_;
+ c = c_;
+ d = d_;
+ e = e_;
+ f = f_;
+ g = g_;
+ h = h_;
+ i = i_;
+ j = j_;
+ k = k_;
+ l = l_;
+ m = m_;
+ n = n_;
+ o = o_;
+ p = p_;
+}
+
+/* { dg-final { scan-assembler-times "movabs" 2 } } */
diff --git a/gcc/testsuite/gcc.target/pr55981.c b/gcc/testsuite/gcc.target/pr55981.c
new file mode 100644
index 00000000000..36498d63cfe
--- /dev/null
+++ b/gcc/testsuite/gcc.target/pr55981.c
@@ -0,0 +1,54 @@
+/* { dg-do compile { target { ! { ia32 } } } } */
+/* { dg-options "-O2" } */
+
+volatile int a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p;
+
+volatile long long y;
+
+void
+test ()
+{
+ int a_ = a;
+ int b_ = b;
+ int c_ = c;
+ int d_ = d;
+ int e_ = e;
+ int f_ = f;
+ int g_ = g;
+ int h_ = h;
+ int i_ = i;
+ int j_ = j;
+ int k_ = k;
+ int l_ = l;
+ int m_ = m;
+ int n_ = n;
+ int o_ = o;
+ int p_ = p;
+
+ int z;
+
+ for (z = 0; z < 1000; z++)
+ {
+ __atomic_store_n (&y, 0x100000002ll, __ATOMIC_SEQ_CST);
+ __atomic_store_n (&y, 0x300000004ll, __ATOMIC_SEQ_CST);
+ }
+
+ a = a_;
+ b = b_;
+ c = c_;
+ d = d_;
+ e = e_;
+ f = f_;
+ g = g_;
+ h = h_;
+ i = i_;
+ j = j_;
+ k = k_;
+ l = l_;
+ m = m_;
+ n = n_;
+ o = o_;
+ p = p_;
+}
+
+/* { dg-final { scan-assembler-times "movabs" 2 } } */
diff --git a/gcc/testsuite/gfortran.dg/block_12.f90 b/gcc/testsuite/gfortran.dg/block_12.f90
new file mode 100644
index 00000000000..a7e9c104390
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/block_12.f90
@@ -0,0 +1,6 @@
+! { dg-do compile }
+! PR 50627 - this used to free a namespace twice.
+program main
+ block
+end program main ! { dg-error "END BLOCK" }
+! { dg-prune-output "Unexpected end of file" }
diff --git a/gcc/testsuite/gfortran.dg/class_55.f90 b/gcc/testsuite/gfortran.dg/class_55.f90
new file mode 100644
index 00000000000..b47989f416c
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/class_55.f90
@@ -0,0 +1,12 @@
+! { dg-do compile }
+!
+! PR 55983: [4.7/4.8 Regression] ICE in find_typebound_proc_uop, at fortran/class.c:2711
+!
+! Contributed by Sylwester Arabas <slayoo@staszic.waw.pl>
+
+ type :: mpdata_t
+ class(bcd_t), pointer :: bcx, bcy ! { dg-error "is a type that has not been declared" }
+ end type
+ type(mpdata_t) :: this
+ call this%bcx%fill_halos() ! { dg-error "is being used before it is defined" }
+end
diff --git a/gcc/testsuite/gfortran.dg/elemental_scalar_args_2.f90 b/gcc/testsuite/gfortran.dg/elemental_scalar_args_2.f90
new file mode 100644
index 00000000000..c2b5df8d18b
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/elemental_scalar_args_2.f90
@@ -0,0 +1,36 @@
+! { dg-do run }
+! Test the fix for PR55618, in which character scalar function arguments to
+! elemental functions would gain an extra indirect reference thus causing
+! failures in Vst17.f95, Vst 30.f95 and Vst31.f95 in the iso_varying_string
+! testsuite, where elemental tests are done.
+!
+! Reported by Tobias Burnus <burnus@gcc.gnu.org>
+!
+ integer, dimension (2) :: i = [1,2]
+ integer :: j = 64
+ character (len = 2) :: chr1 = "lm"
+ character (len = 1), dimension (2) :: chr2 = ["r", "s"]
+ if (any (foo (i, bar()) .ne. ["a", "b"])) call abort ! This would fail
+ if (any (foo (i, "xy") .ne. ["x", "y"])) call abort ! OK - not a function
+ if (any (foo (i, chr1) .ne. ["l", "m"])) call abort ! ditto
+ if (any (foo (i, char (j)) .ne. ["A", "B"])) call abort ! This would fail
+ if (any (foo (i, chr2) .ne. ["s", "u"])) call abort ! OK - not a scalar
+ if (any (foo (i, bar2()) .ne. ["e", "g"])) call abort ! OK - not a scalar function
+contains
+ elemental character(len = 1) function foo (arg1, arg2)
+ integer, intent (in) :: arg1
+ character(len = *), intent (in) :: arg2
+ if (len (arg2) > 1) then
+ foo = arg2(arg1:arg1)
+ else
+ foo = char (ichar (arg2) + arg1)
+ end if
+ end function
+ character(len = 2) function bar ()
+ bar = "ab"
+ end function
+ function bar2 () result(res)
+ character (len = 1), dimension(2) :: res
+ res = ["d", "e"]
+ end function
+end
diff --git a/gcc/testsuite/gfortran.dg/gomp/pr56052.f90 b/gcc/testsuite/gfortran.dg/gomp/pr56052.f90
new file mode 100644
index 00000000000..dc3de715e8e
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/gomp/pr56052.f90
@@ -0,0 +1,16 @@
+! PR fortran/56052
+! { dg-do compile }
+! { dg-options "-fopenmp" }
+
+subroutine middle(args)
+ type args_t
+ end type
+ type, extends(args_t) :: scan_args_t
+ end type
+ class(args_t),intent(inout) :: args
+ !$omp single
+ select type (args)
+ type is (scan_args_t)
+ end select
+ !$omp end single
+end subroutine middle
diff --git a/gcc/testsuite/gfortran.dg/internal_pack_13.f90 b/gcc/testsuite/gfortran.dg/internal_pack_13.f90
new file mode 100644
index 00000000000..21fdc541878
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/internal_pack_13.f90
@@ -0,0 +1,34 @@
+! { dg-do run }
+!
+! PR 55072: [4.6/4.7/4.8 Regression] Missing internal_pack leads to wrong code with derived type
+!
+! Contributed by Tobias Burnus <burnus@gcc.gnu.org>
+
+implicit none
+type t
+integer :: i
+end type t
+type(t), target :: tgt(4,4)
+type(t), pointer :: p(:,:)
+integer :: i,j,k
+
+k = 1
+do i = 1, 4
+ do j = 1, 4
+ tgt(i,j)%i = k
+ k = k+1
+ end do
+end do
+
+p => tgt(::2,::2)
+print *,p%i
+call bar(p)
+
+contains
+
+ subroutine bar(x)
+ type(t) :: x(*)
+ print *,x(1:4)%i
+ if (any (x(1:4)%i /= [1, 9, 3, 11])) call abort()
+ end subroutine
+end
diff --git a/gcc/testsuite/gfortran.dg/internal_pack_14.f90 b/gcc/testsuite/gfortran.dg/internal_pack_14.f90
new file mode 100644
index 00000000000..1a4b3725fbb
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/internal_pack_14.f90
@@ -0,0 +1,34 @@
+! { dg-do run }
+!
+! PR 55072: [4.6/4.7/4.8 Regression] Missing internal_pack leads to wrong code with derived type
+!
+! Contributed by Janus Weil <janus@gcc.gnu.org>
+
+program GiBUU_neutrino_bug
+
+ Type particle
+ integer :: ID
+ End Type
+
+ type(particle), dimension(1:2,1:2) :: OutPart
+
+ OutPart(1,:)%ID = 1
+ OutPart(2,:)%ID = 2
+
+ call s1(OutPart(1,:))
+
+contains
+
+ subroutine s1(j)
+ type(particle) :: j(:)
+ print *,j(:)%ID
+ call s2(j)
+ end subroutine
+
+ subroutine s2(k)
+ type(particle) :: k(1:2)
+ print *,k(:)%ID
+ if (any (k(1:2)%ID /= [1, 1])) call abort()
+ end subroutine
+
+end
diff --git a/gcc/testsuite/gfortran.dg/intrinsic_size_3.f90 b/gcc/testsuite/gfortran.dg/intrinsic_size_3.f90
new file mode 100644
index 00000000000..d5f4bd23d55
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/intrinsic_size_3.f90
@@ -0,0 +1,26 @@
+! { dg-do compile }
+! { dg-options "-fdump-tree-original" }
+!
+! PR fortran/55852
+!
+! Contributed by A. Kasahara
+!
+program bug
+ implicit none
+
+ Real, allocatable:: a(:)
+ integer(2) :: iszs
+
+ allocate(a(1:3))
+
+ iszs = ubound((a), 1)! Was ICEing
+! print*, ubound((a), 1) ! Was ICEing
+! print*, ubound(a, 1) ! OK
+! print*, lbound((a), 1) ! OK
+! print*, lbound(a, 1) ! OK
+
+ stop
+end program bug
+
+! { dg-final { scan-tree-dump-times "iszs = \\(integer\\(kind=2\\)\\) MAX_EXPR <\\(D.....->dim.0..ubound - D.....->dim.0..lbound\\) \\+ 1, 0>;" 1 "original" } }
+! { dg-final { cleanup-tree-dump "original" } }
diff --git a/gcc/testsuite/gfortran.dg/module_error_1.f90 b/gcc/testsuite/gfortran.dg/module_error_1.f90
new file mode 100644
index 00000000000..84decc0a571
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/module_error_1.f90
@@ -0,0 +1,5 @@
+! { dg-do compile }
+! PR fortran/50627
+module kernels
+ select type (args) ! { dg-error "Unexpected SELECT TYPE" }
+end module kernels
diff --git a/gcc/testsuite/gfortran.dg/pr56015.f90 b/gcc/testsuite/gfortran.dg/pr56015.f90
new file mode 100644
index 00000000000..21d9d64280f
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr56015.f90
@@ -0,0 +1,16 @@
+! PR middle-end/56015
+! { dg-do run }
+! { dg-options "-Ofast -fno-inline" }
+
+program pr56015
+ implicit none
+ complex*16 p(10)
+ p(:) = (0.1d0, 0.2d0)
+ p(:) = (0.0d0, 1.0d0) * p(:)
+ call foo (p)
+contains
+ subroutine foo (p)
+ complex*16 p(10)
+ if (any (p .ne. (-0.2d0, 0.1d0))) call abort
+ end subroutine
+end program pr56015
diff --git a/gcc/testsuite/gfortran.dg/select_8.f90 b/gcc/testsuite/gfortran.dg/select_8.f90
new file mode 100644
index 00000000000..910d3939a4a
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/select_8.f90
@@ -0,0 +1,12 @@
+! { dg-do compile }
+!
+! PR 56081: [4.7/4.8 Regression] Segfault ICE on select with bad case
+!
+! Contributed by Richard L Lozes <richard@lozestech.com>
+
+ implicit none
+ integer :: a(4)
+ select case(a) ! { dg-error "must be a scalar expression" }
+ case (0)
+ end select
+end
diff --git a/gcc/testsuite/gfortran.dg/use_22.f90 b/gcc/testsuite/gfortran.dg/use_22.f90
new file mode 100644
index 00000000000..d61df671322
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/use_22.f90
@@ -0,0 +1,35 @@
+! { dg-do compile }
+!
+! PR fortran/55827
+! gfortran used to ICE with the call to `tostring' depending on how the
+! `tostring' symbol was USE-associated.
+!
+! Contributed by Lorenz Hüdepohl <bugs@stellardeath.org>
+
+module stringutils
+ interface
+ pure function strlen(handle) result(len)
+ integer, intent(in) :: handle
+ integer :: len
+ end function
+ end interface
+end module
+module intermediate ! does not die if this module is merged with stringutils
+ contains
+ function tostring(handle) result(string)
+ use stringutils
+ integer, intent(in) :: handle
+ character(len=strlen(handle)) :: string
+ end function
+end module
+module usage
+ contains
+ subroutine dies_here(handle)
+ use stringutils ! does not die if this unnecessary line is omitted or placed after "use intermediate"
+ use intermediate
+ integer :: handle
+ write(*,*) tostring(handle) ! ICE
+ end subroutine
+end module
+
+
diff --git a/gcc/testsuite/gfortran.dg/use_23.f90 b/gcc/testsuite/gfortran.dg/use_23.f90
new file mode 100644
index 00000000000..da05e1a8e20
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/use_23.f90
@@ -0,0 +1,42 @@
+! { dg-do compile }
+!
+! PR fortran/42769
+! This test used to ICE in resolve_typebound_procedure because T1's GET
+! procedure was wrongly associated to MOD2's MY_GET (instead of the original
+! MOD1's MY_GET) in MOD3's SUB.
+!
+! Original testcase by Salvator Filippone <sfilippone@uniroma2.it>
+! Reduced by Janus Weil <janus@gcc.gnu.org>
+
+module mod1
+ type :: t1
+ contains
+ procedure, nopass :: get => my_get
+ end type
+contains
+ logical function my_get()
+ end function
+end module
+
+module mod2
+contains
+ logical function my_get()
+ end function
+end module
+
+module mod3
+contains
+ subroutine sub(a)
+ use mod2, only: my_get
+ use mod1, only: t1
+ type(t1) :: a
+ end subroutine
+end module
+
+
+use mod2, only: my_get
+use mod3, only: sub
+end
+
+
+
diff --git a/gcc/testsuite/gfortran.dg/use_24.f90 b/gcc/testsuite/gfortran.dg/use_24.f90
new file mode 100644
index 00000000000..b709347b0fd
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/use_24.f90
@@ -0,0 +1,53 @@
+! { dg-do run }
+!
+! PR fortran/42769
+! The static resolution of A%GET used to be incorrectly simplified to MOD2's
+! MY_GET instead of the original MOD1's MY_GET, depending on the order in which
+! MOD1 and MOD2 were use-associated.
+!
+! Original testcase by Salvator Filippone <sfilippone@uniroma2.it>
+! Reduced by Janus Weil <janus@gcc.gnu.org>
+
+module mod1
+ type :: t1
+ contains
+ procedure, nopass :: get => my_get
+ end type
+contains
+ subroutine my_get(i)
+ i = 2
+ end subroutine
+end module
+
+module mod2
+contains
+ subroutine my_get(i) ! must have the same name as the function in mod1
+ i = 5
+ end subroutine
+end module
+
+
+ call test1()
+ call test2()
+
+contains
+
+ subroutine test1()
+ use mod2
+ use mod1
+ type(t1) :: a
+ call a%get(j)
+ if (j /= 2) call abort
+ end subroutine test1
+
+ subroutine test2()
+ use mod1
+ use mod2
+ type(t1) :: a
+ call a%get(j)
+ if (j /= 2) call abort
+ end subroutine test2
+end
+
+
+
diff --git a/gcc/testsuite/gfortran.dg/use_25.f90 b/gcc/testsuite/gfortran.dg/use_25.f90
new file mode 100644
index 00000000000..b79297f9fce
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/use_25.f90
@@ -0,0 +1,39 @@
+! { dg-do compile }
+!
+! PR fortran/42769
+! This test used to be rejected because the typebound call A%GET was
+! simplified to MY_GET which is an ambiguous name in the main program
+! namespace.
+!
+! Original testcase by Salvator Filippone <sfilippone@uniroma2.it>
+! Reduced by Janus Weil <janus@gcc.gnu.org>
+
+module mod1
+ type :: t1
+ contains
+ procedure, nopass :: get => my_get
+ end type
+contains
+ subroutine my_get()
+ print *,"my_get (mod1)"
+ end subroutine
+end module
+
+module mod2
+contains
+ subroutine my_get() ! must have the same name as the function in mod1
+ print *,"my_get (mod2)"
+ end subroutine
+end module
+
+ use mod2
+ use mod1
+ type(t1) :: a
+ call call_get
+ contains
+ subroutine call_get
+ call a%get()
+ end subroutine call_get
+end
+
+
diff --git a/gcc/testsuite/gfortran.dg/use_26.f90 b/gcc/testsuite/gfortran.dg/use_26.f90
new file mode 100644
index 00000000000..2e66401a14c
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/use_26.f90
@@ -0,0 +1,76 @@
+! { dg-do compile }
+!
+! PR fortran/45836
+! The B_TYPE_INSTANCE%SIZERETURN() typebound function used to be rejected on a
+! type mismatch because the function was resolved to A's SIZERETURN instead of
+! B's because of the ambiguity of the SIZERETURN name in the MAIN namespace.
+!
+! Original testcase by someone <ortp21@gmail.com>
+
+module A
+implicit none
+ type :: a_type
+ private
+ integer :: size = 1
+ contains
+ procedure :: sizeReturn
+ end type a_type
+ contains
+ function sizeReturn( a_type_ )
+ implicit none
+ integer :: sizeReturn
+ class(a_type) :: a_type_
+
+ sizeReturn = a_type_%size
+ end function sizeReturn
+end module A
+
+module B
+implicit none
+ type :: b_type
+ private
+ integer :: size = 2
+ contains
+ procedure :: sizeReturn
+ end type b_type
+ contains
+ function sizeReturn( b_type_ )
+ implicit none
+ integer :: sizeReturn
+ class(b_type) :: b_type_
+
+ sizeReturn = b_type_%size
+ end function sizeReturn
+end module B
+
+program main
+
+ call test1
+ call test2
+
+contains
+
+ subroutine test1
+ use A
+ use B
+ implicit none
+ type(a_type) :: a_type_instance
+ type(b_type) :: b_type_instance
+
+ print *, a_type_instance%sizeReturn()
+ print *, b_type_instance%sizeReturn()
+ end subroutine test1
+
+ subroutine test2
+ use B
+ use A
+ implicit none
+ type(a_type) :: a_type_instance
+ type(b_type) :: b_type_instance
+
+ print *, a_type_instance%sizeReturn()
+ print *, b_type_instance%sizeReturn()
+ end subroutine test2
+end program main
+
+
diff --git a/gcc/testsuite/gfortran.dg/use_27.f90 b/gcc/testsuite/gfortran.dg/use_27.f90
new file mode 100644
index 00000000000..71d77cc0180
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/use_27.f90
@@ -0,0 +1,103 @@
+! { dg-do run }
+!
+! PR fortran/45900
+! The BTYPEINSTANCE%CALLBACK() typebound call was resolved incorrectly to
+! A's CALLBACK procedure instead of B's because the CALLBACK name is ambiguous
+! in the MAIN namespace.
+!
+! Original testcase by someone <ortp21@gmail.com>
+
+module A
+implicit none
+ type :: aType
+ contains
+ procedure :: callback
+ end type aType
+ contains
+ subroutine callback( callback_, i )
+ implicit none
+ class(aType) :: callback_
+ integer :: i
+
+ i = 3
+ end subroutine callback
+
+ subroutine solver( callback_, i )
+ implicit none
+ class(aType) :: callback_
+ integer :: i
+
+ call callback_%callback(i)
+ end subroutine solver
+end module A
+
+module B
+use A, only: aType
+implicit none
+ type, extends(aType) :: bType
+ integer :: i
+ contains
+ procedure :: callback
+ end type bType
+ contains
+ subroutine callback( callback_, i )
+ implicit none
+ class(bType) :: callback_
+ integer :: i
+
+ i = 7
+ end subroutine callback
+end module B
+
+program main
+ call test1()
+ call test2()
+
+contains
+
+ subroutine test1
+ use A
+ use B
+ implicit none
+ type(aType) :: aTypeInstance
+ type(bType) :: bTypeInstance
+ integer :: iflag
+
+ bTypeInstance%i = 4
+
+ iflag = 0
+ call bTypeInstance%callback(iflag)
+ if (iflag /= 7) call abort
+ iflag = 1
+ call solver( bTypeInstance, iflag )
+ if (iflag /= 7) call abort
+
+ iflag = 2
+ call aTypeInstance%callback(iflag)
+ if (iflag /= 3) call abort
+ end subroutine test1
+
+ subroutine test2
+ use B
+ use A
+ implicit none
+ type(aType) :: aTypeInstance
+ type(bType) :: bTypeInstance
+ integer :: iflag
+
+ bTypeInstance%i = 4
+
+ iflag = 0
+ call bTypeInstance%callback(iflag)
+ if (iflag /= 7) call abort
+ iflag = 1
+ call solver( bTypeInstance, iflag )
+ if (iflag /= 7) call abort
+
+ iflag = 2
+ call aTypeInstance%callback(iflag)
+ if (iflag /= 3) call abort
+ end subroutine test2
+end program main
+
+
diff --git a/gcc/testsuite/gnat.dg/alignment10.adb b/gcc/testsuite/gnat.dg/alignment10.adb
new file mode 100644
index 00000000000..61779f1d7b4
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/alignment10.adb
@@ -0,0 +1,20 @@
+-- { dg-do run }
+
+procedure Alignment10 is
+
+ type Short_T is mod 2 ** 16;
+ for Short_T'Size use 16;
+ for Short_T'Alignment use 1;
+
+ subtype Short_Sub_T is Short_T range 1000 .. 1005;
+
+ A : aliased Short_T := 1000;
+ B : Short_Sub_T;
+ for B'Address use A'Address;
+ pragma Import (Ada, B);
+
+begin
+ if B /= 1000 then
+ raise Program_Error;
+ end if;
+end;
diff --git a/gcc/testsuite/gnat.dg/opt26.adb b/gcc/testsuite/gnat.dg/opt26.adb
new file mode 100644
index 00000000000..61f8b5b1eb9
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/opt26.adb
@@ -0,0 +1,37 @@
+-- { dg-do run }
+-- { dg-options "-gnato -O" }
+
+with Interfaces; use Interfaces;
+
+procedure Opt26 is
+
+ procedure Shift_Left_Bool
+ (Bool : in Boolean;
+ U8 : out Interfaces.Unsigned_8)
+ is
+ begin
+ U8 := Shift_Left (Boolean'Pos (Bool), 6);
+ end Shift_Left_Bool;
+
+ procedure Shift_Left_Not_Bool
+ (Bool : in Boolean;
+ U8 : out Interfaces.Unsigned_8)
+ is
+ begin
+ U8 := Shift_Left (Boolean'Pos (not Bool), 6);
+ end Shift_Left_Not_Bool;
+
+ Bool : constant Boolean := True;
+ Byte1, Byte2 : Interfaces.Unsigned_8;
+
+begin
+
+ Shift_Left_Bool (Bool, Byte1);
+
+ Shift_Left_Not_Bool (Bool, Byte2);
+
+ if Byte1 + Byte2 /= 64 then
+ raise Program_Error;
+ end if;
+
+end;
diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
index bf80350a110..2ad7be89b77 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -2079,7 +2079,8 @@ proc check_effective_target_arm_vfp_ok { } {
# options.
proc check_effective_target_arm_hard_vfp_ok { } {
- if { [check_effective_target_arm32] } {
+ if { [check_effective_target_arm32]
+ && ! [check-flags [list "" { *-*-* } { "-mfloat-abi=*" } { "-mfloat-abi=hard" }]] } {
return [check_no_compiler_messages arm_hard_vfp_ok executable {
int main() { return 0;}
} "-mfpu=vfp -mfloat-abi=hard"]
diff --git a/gcc/tree-complex.c b/gcc/tree-complex.c
index 0547fcf147f..c45ba190d1e 100644
--- a/gcc/tree-complex.c
+++ b/gcc/tree-complex.c
@@ -1400,6 +1400,36 @@ expand_complex_comparison (gimple_stmt_iterator *gsi, tree ar, tree ai,
update_stmt (stmt);
}
+/* Expand inline asm that sets some complex SSA_NAMEs. */
+
+static void
+expand_complex_asm (gimple_stmt_iterator *gsi)
+{
+ gimple stmt = gsi_stmt (*gsi);
+ unsigned int i;
+
+ for (i = 0; i < gimple_asm_noutputs (stmt); ++i)
+ {
+ tree link = gimple_asm_output_op (stmt, i);
+ tree op = TREE_VALUE (link);
+ if (TREE_CODE (op) == SSA_NAME
+ && TREE_CODE (TREE_TYPE (op)) == COMPLEX_TYPE)
+ {
+ tree type = TREE_TYPE (op);
+ tree inner_type = TREE_TYPE (type);
+ tree r = build1 (REALPART_EXPR, inner_type, op);
+ tree i = build1 (IMAGPART_EXPR, inner_type, op);
+ gimple_seq list = set_component_ssa_name (op, false, r);
+
+ if (list)
+ gsi_insert_seq_after (gsi, list, GSI_CONTINUE_LINKING);
+
+ list = set_component_ssa_name (op, true, i);
+ if (list)
+ gsi_insert_seq_after (gsi, list, GSI_CONTINUE_LINKING);
+ }
+ }
+}
/* Process one statement. If we identify a complex operation, expand it. */
@@ -1412,6 +1442,12 @@ expand_complex_operations_1 (gimple_stmt_iterator *gsi)
complex_lattice_t al, bl;
enum tree_code code;
+ if (gimple_code (stmt) == GIMPLE_ASM)
+ {
+ expand_complex_asm (gsi);
+ return;
+ }
+
lhs = gimple_get_lhs (stmt);
if (!lhs && gimple_code (stmt) != GIMPLE_COND)
return;
diff --git a/gcc/tree-sra.c b/gcc/tree-sra.c
index d546779bc67..681f3b7fb8f 100644
--- a/gcc/tree-sra.c
+++ b/gcc/tree-sra.c
@@ -3044,15 +3044,13 @@ sra_modify_assign (gimple *stmt, gimple_stmt_iterator *gsi)
??? This should move to fold_stmt which we simply should
call after building a VIEW_CONVERT_EXPR here. */
if (AGGREGATE_TYPE_P (TREE_TYPE (lhs))
- && !contains_bitfld_comp_ref_p (lhs)
- && !access_has_children_p (lacc))
+ && !contains_bitfld_comp_ref_p (lhs))
{
lhs = build_ref_for_model (loc, lhs, 0, racc, gsi, false);
gimple_assign_set_lhs (*stmt, lhs);
}
else if (AGGREGATE_TYPE_P (TREE_TYPE (rhs))
- && !contains_vce_or_bfcref_p (rhs)
- && !access_has_children_p (racc))
+ && !contains_vce_or_bfcref_p (rhs))
rhs = build_ref_for_model (loc, rhs, 0, lacc, gsi, false);
if (!useless_type_conversion_p (TREE_TYPE (lhs), TREE_TYPE (rhs)))
diff --git a/gcc/tree-ssa-ccp.c b/gcc/tree-ssa-ccp.c
index 5c2b7d9e65b..29baceb8079 100644
--- a/gcc/tree-ssa-ccp.c
+++ b/gcc/tree-ssa-ccp.c
@@ -1,6 +1,6 @@
/* Conditional constant propagation pass for the GNU compiler.
Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
- 2010, 2011, 2012 Free Software Foundation, Inc.
+ 2010, 2011, 2012, 2013 Free Software Foundation, Inc.
Adapted from original RTL SSA-CCP by Daniel Berlin <dberlin@dberlin.org>
Adapted to GIMPLE trees by Diego Novillo <dnovillo@redhat.com>
@@ -1588,7 +1588,6 @@ evaluate_stmt (gimple stmt)
&& !is_constant)
{
enum gimple_code code = gimple_code (stmt);
- tree fndecl;
val.lattice_val = VARYING;
val.value = NULL_TREE;
val.mask = double_int_minus_one;
@@ -1635,10 +1634,9 @@ evaluate_stmt (gimple stmt)
|| POINTER_TYPE_P (TREE_TYPE (rhs1)))
val = bit_value_binop (code, TREE_TYPE (rhs1), rhs1, rhs2);
}
- else if (code == GIMPLE_CALL
- && (fndecl = gimple_call_fndecl (stmt))
- && DECL_BUILT_IN_CLASS (fndecl) == BUILT_IN_NORMAL)
+ else if (gimple_call_builtin_class_p (stmt, BUILT_IN_NORMAL))
{
+ tree fndecl = gimple_call_fndecl (stmt);
switch (DECL_FUNCTION_CODE (fndecl))
{
case BUILT_IN_MALLOC:
diff --git a/gcc/tree-ssa-dse.c b/gcc/tree-ssa-dse.c
index 285d08c66c6..c80d9c9b74a 100644
--- a/gcc/tree-ssa-dse.c
+++ b/gcc/tree-ssa-dse.c
@@ -94,7 +94,7 @@ dse_possible_dead_store_p (gimple stmt, gimple *use_stmt)
temp = stmt;
do
{
- gimple use_stmt;
+ gimple use_stmt, defvar_def;
imm_use_iterator ui;
bool fail = false;
tree defvar;
@@ -108,6 +108,7 @@ dse_possible_dead_store_p (gimple stmt, gimple *use_stmt)
defvar = PHI_RESULT (temp);
else
defvar = gimple_vdef (temp);
+ defvar_def = temp;
temp = NULL;
FOR_EACH_IMM_USE_STMT (use_stmt, ui, defvar)
{
@@ -139,7 +140,14 @@ dse_possible_dead_store_p (gimple stmt, gimple *use_stmt)
fail = true;
BREAK_FROM_IMM_USE_STMT (ui);
}
- temp = use_stmt;
+ /* Do not consider the PHI as use if it dominates the
+ stmt defining the virtual operand we are processing,
+ we have processed it already in this case. */
+ if (gimple_bb (defvar_def) != gimple_bb (use_stmt)
+ && !dominated_by_p (CDI_DOMINATORS,
+ gimple_bb (defvar_def),
+ gimple_bb (use_stmt)))
+ temp = use_stmt;
}
/* If the statement is a use the store is not dead. */
else if (ref_maybe_used_by_stmt_p (use_stmt,
diff --git a/gcc/tree-ssa-math-opts.c b/gcc/tree-ssa-math-opts.c
index c04245223c3..24f2c24adc8 100644
--- a/gcc/tree-ssa-math-opts.c
+++ b/gcc/tree-ssa-math-opts.c
@@ -1116,7 +1116,7 @@ gimple_expand_builtin_pow (gimple_stmt_iterator *gsi, location_t loc,
tree type, sqrtfn, cbrtfn, sqrt_arg0, sqrt_sqrt, result, cbrt_x, powi_cbrt_x;
tree target = NULL_TREE;
enum machine_mode mode;
- bool hw_sqrt_exists;
+ bool hw_sqrt_exists, c_is_int, c2_is_int;
/* If the exponent isn't a constant, there's nothing of interest
to be done. */
@@ -1128,8 +1128,9 @@ gimple_expand_builtin_pow (gimple_stmt_iterator *gsi, location_t loc,
c = TREE_REAL_CST (arg1);
n = real_to_integer (&c);
real_from_integer (&cint, VOIDmode, n, n < 0 ? -1 : 0, 0);
+ c_is_int = real_identical (&c, &cint);
- if (real_identical (&c, &cint)
+ if (c_is_int
&& ((n >= -1 && n <= 2)
|| (flag_unsafe_math_optimizations
&& optimize_insn_for_speed_p ()
@@ -1227,7 +1228,8 @@ gimple_expand_builtin_pow (gimple_stmt_iterator *gsi, location_t loc,
return build_and_insert_call (gsi, loc, &target, cbrtfn, sqrt_arg0);
}
- /* Optimize pow(x,c), where n = 2c for some nonzero integer n, into
+ /* Optimize pow(x,c), where n = 2c for some nonzero integer n
+ and c not an integer, into
sqrt(x) * powi(x, n/2), n > 0;
1.0 / (sqrt(x) * powi(x, abs(n/2))), n < 0.
@@ -1236,10 +1238,13 @@ gimple_expand_builtin_pow (gimple_stmt_iterator *gsi, location_t loc,
real_arithmetic (&c2, MULT_EXPR, &c, &dconst2);
n = real_to_integer (&c2);
real_from_integer (&cint, VOIDmode, n, n < 0 ? -1 : 0, 0);
+ c2_is_int = real_identical (&c2, &cint);
if (flag_unsafe_math_optimizations
&& sqrtfn
- && real_identical (&c2, &cint))
+ && c2_is_int
+ && !c_is_int
+ && optimize_function_for_speed_p (cfun))
{
tree powi_x_ndiv2 = NULL_TREE;
@@ -1292,6 +1297,7 @@ gimple_expand_builtin_pow (gimple_stmt_iterator *gsi, location_t loc,
&& cbrtfn
&& (gimple_val_nonnegative_real_p (arg0) || !HONOR_NANS (mode))
&& real_identical (&c2, &c)
+ && !c2_is_int
&& optimize_function_for_speed_p (cfun)
&& powi_cost (n / 3) <= POWI_MAX_MULTS)
{
diff --git a/gcc/tree-ssa-phiopt.c b/gcc/tree-ssa-phiopt.c
index d4019c06431..8b904692818 100644
--- a/gcc/tree-ssa-phiopt.c
+++ b/gcc/tree-ssa-phiopt.c
@@ -1232,7 +1232,7 @@ nt_init_block (struct dom_walk_data *data ATTRIBUTE_UNUSED, basic_block bb)
{
gimple stmt = gsi_stmt (gsi);
- if (gimple_assign_single_p (stmt))
+ if (gimple_assign_single_p (stmt) && !gimple_has_volatile_ops (stmt))
{
add_or_mark_expr (bb, gimple_assign_lhs (stmt), nontrap_set, true);
add_or_mark_expr (bb, gimple_assign_rhs1 (stmt), nontrap_set, false);
@@ -1309,7 +1309,8 @@ cond_store_replacement (basic_block middle_bb, basic_block join_bb,
/* Check if middle_bb contains of only one store. */
if (!assign
- || !gimple_assign_single_p (assign))
+ || !gimple_assign_single_p (assign)
+ || gimple_has_volatile_ops (assign))
return false;
locus = gimple_location (assign);
@@ -1386,9 +1387,11 @@ cond_if_else_store_replacement_1 (basic_block then_bb, basic_block else_bb,
if (then_assign == NULL
|| !gimple_assign_single_p (then_assign)
|| gimple_clobber_p (then_assign)
+ || gimple_has_volatile_ops (then_assign)
|| else_assign == NULL
|| !gimple_assign_single_p (else_assign)
- || gimple_clobber_p (else_assign))
+ || gimple_clobber_p (else_assign)
+ || gimple_has_volatile_ops (else_assign))
return false;
lhs = gimple_assign_lhs (then_assign);
diff --git a/gcc/tree-ssa-strlen.c b/gcc/tree-ssa-strlen.c
index a37633a920f..304c2940576 100644
--- a/gcc/tree-ssa-strlen.c
+++ b/gcc/tree-ssa-strlen.c
@@ -812,10 +812,10 @@ adjust_last_stmt (strinfo si, gimple stmt, bool is_strcat)
if (!is_gimple_call (last.stmt))
return;
- callee = gimple_call_fndecl (last.stmt);
- if (callee == NULL_TREE || DECL_BUILT_IN_CLASS (callee) != BUILT_IN_NORMAL)
+ if (!gimple_call_builtin_class_p (last.stmt, BUILT_IN_NORMAL))
return;
+ callee = gimple_call_fndecl (last.stmt);
switch (DECL_FUNCTION_CODE (callee))
{
case BUILT_IN_MEMCPY:
@@ -1753,7 +1753,7 @@ strlen_optimize_stmt (gimple_stmt_iterator *gsi)
if (is_gimple_call (stmt))
{
tree callee = gimple_call_fndecl (stmt);
- if (callee && DECL_BUILT_IN_CLASS (callee) == BUILT_IN_NORMAL)
+ if (gimple_call_builtin_class_p (stmt, BUILT_IN_NORMAL))
switch (DECL_FUNCTION_CODE (callee))
{
case BUILT_IN_STRLEN:
diff --git a/gcc/tree-ssa-structalias.c b/gcc/tree-ssa-structalias.c
index f8532f59a45..0d4258db0f3 100644
--- a/gcc/tree-ssa-structalias.c
+++ b/gcc/tree-ssa-structalias.c
@@ -1916,10 +1916,10 @@ equiv_class_label_eq (const void *p1, const void *p2)
}
/* Lookup a equivalence class in TABLE by the bitmap of LABELS it
- contains. */
+ contains. Sets *REF_LABELS to the bitmap LABELS is equivalent to. */
static unsigned int
-equiv_class_lookup (htab_t table, bitmap labels)
+equiv_class_lookup (htab_t table, bitmap labels, bitmap *ref_labels)
{
void **slot;
struct equiv_class_label ecl;
@@ -1930,9 +1930,18 @@ equiv_class_lookup (htab_t table, bitmap labels)
slot = htab_find_slot_with_hash (table, &ecl,
ecl.hashcode, NO_INSERT);
if (!slot)
- return 0;
+ {
+ if (ref_labels)
+ *ref_labels = NULL;
+ return 0;
+ }
else
- return ((equiv_class_label_t) *slot)->equivalence_class;
+ {
+ equiv_class_label_t ec = (equiv_class_label_t) *slot;
+ if (ref_labels)
+ *ref_labels = ec->labels;
+ return ec->equivalence_class;
+ }
}
@@ -2132,14 +2141,21 @@ label_visit (constraint_graph_t graph, struct scc_info *si, unsigned int n)
if (!bitmap_empty_p (graph->points_to[n]))
{
+ bitmap ref_points_to;
unsigned int label = equiv_class_lookup (pointer_equiv_class_table,
- graph->points_to[n]);
+ graph->points_to[n],
+ &ref_points_to);
if (!label)
{
label = pointer_equiv_class++;
equiv_class_add (pointer_equiv_class_table,
label, graph->points_to[n]);
}
+ else
+ {
+ BITMAP_FREE (graph->points_to[n]);
+ graph->points_to[n] = ref_points_to;
+ }
graph->pointer_label[n] = label;
}
}
@@ -2199,7 +2215,7 @@ perform_var_substitution (constraint_graph_t graph)
/* Look up the location equivalence label if one exists, or make
one otherwise. */
label = equiv_class_lookup (location_equiv_class_table,
- pointed_by);
+ pointed_by, NULL);
if (label == 0)
{
label = location_equiv_class++;
@@ -4013,8 +4029,7 @@ find_func_aliases_for_builtin_call (gimple t)
VEC(ce_s, heap) *rhsc = NULL;
varinfo_t fi;
- if (fndecl != NULL_TREE
- && DECL_BUILT_IN_CLASS (fndecl) == BUILT_IN_NORMAL)
+ if (gimple_call_builtin_class_p (t, BUILT_IN_NORMAL))
/* ??? All builtins that are handled here need to be handled
in the alias-oracle query functions explicitly! */
switch (DECL_FUNCTION_CODE (fndecl))
@@ -4755,8 +4770,7 @@ find_func_clobbers (gimple origt)
/* For builtins we do not have separate function info. For those
we do not generate escapes for we have to generate clobbers/uses. */
- if (decl
- && DECL_BUILT_IN_CLASS (decl) == BUILT_IN_NORMAL)
+ if (gimple_call_builtin_class_p (t, BUILT_IN_NORMAL))
switch (DECL_FUNCTION_CODE (decl))
{
/* The following functions use and clobber memory pointed to
diff --git a/gcc/tree-streamer.c b/gcc/tree-streamer.c
index 94d540b5984..8e0a917f96a 100644
--- a/gcc/tree-streamer.c
+++ b/gcc/tree-streamer.c
@@ -251,6 +251,16 @@ streamer_tree_cache_get (struct streamer_tree_cache_d *cache, unsigned ix)
static void
record_common_node (struct streamer_tree_cache_d *cache, tree node)
{
+ /* If we recursively end up at nodes we do not want to preload simply don't.
+ ??? We'd want to verify that this doesn't happen, or alternatively
+ do not recurse at all. */
+ if (node == char_type_node)
+ return;
+
+ gcc_checking_assert (node != boolean_type_node
+ && node != boolean_true_node
+ && node != boolean_false_node);
+
/* We have to make sure to fill exactly the same number of
elements for all frontends. That can include NULL trees.
As our hash table can't deal with zero entries we'll simply stream
diff --git a/gcc/tree-vect-data-refs.c b/gcc/tree-vect-data-refs.c
index 6ef834cb788..152b858f754 100644
--- a/gcc/tree-vect-data-refs.c
+++ b/gcc/tree-vect-data-refs.c
@@ -1312,7 +1312,7 @@ vect_peeling_hash_get_lowest_cost (void **slot, void *data)
}
outside_cost += vect_get_known_peeling_cost (loop_vinfo, elem->npeel, &dummy,
- vect_get_single_scalar_iteraion_cost (loop_vinfo));
+ vect_get_single_scalar_iteration_cost (loop_vinfo));
if (inside_cost < min->inside_cost
|| (inside_cost == min->inside_cost && outside_cost < min->outside_cost))
diff --git a/gcc/tree-vect-loop.c b/gcc/tree-vect-loop.c
index 4e50fb854b2..352a01a71ac 100644
--- a/gcc/tree-vect-loop.c
+++ b/gcc/tree-vect-loop.c
@@ -2386,7 +2386,7 @@ vect_force_simple_reduction (loop_vec_info loop_info, gimple phi,
/* Calculate the cost of one scalar iteration of the loop. */
int
-vect_get_single_scalar_iteraion_cost (loop_vec_info loop_vinfo)
+vect_get_single_scalar_iteration_cost (loop_vec_info loop_vinfo)
{
struct loop *loop = LOOP_VINFO_LOOP (loop_vinfo);
basic_block *bbs = LOOP_VINFO_BBS (loop_vinfo);
@@ -2619,7 +2619,7 @@ vect_estimate_min_profitable_iters (loop_vec_info loop_vinfo)
}
}
- scalar_single_iter_cost = vect_get_single_scalar_iteraion_cost (loop_vinfo);
+ scalar_single_iter_cost = vect_get_single_scalar_iteration_cost (loop_vinfo);
/* Add additional cost for the peeled instructions in prologue and epilogue
loop.
diff --git a/gcc/tree-vectorizer.h b/gcc/tree-vectorizer.h
index 5f031b52f2e..bdef6a4dbdb 100644
--- a/gcc/tree-vectorizer.h
+++ b/gcc/tree-vectorizer.h
@@ -916,7 +916,7 @@ extern int vect_estimate_min_profitable_iters (loop_vec_info);
extern tree get_initial_def_for_reduction (gimple, tree, tree *);
extern int vect_min_worthwhile_factor (enum tree_code);
extern int vect_get_known_peeling_cost (loop_vec_info, int, int *, int);
-extern int vect_get_single_scalar_iteraion_cost (loop_vec_info);
+extern int vect_get_single_scalar_iteration_cost (loop_vec_info);
/* In tree-vect-slp.c. */
extern void vect_free_slp_instance (slp_instance);
diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c
index 43f661cffca..149626310d4 100644
--- a/gcc/tree-vrp.c
+++ b/gcc/tree-vrp.c
@@ -3268,8 +3268,20 @@ extract_range_basic (value_range_t *vr, gimple stmt)
bool sop = false;
tree type = gimple_expr_type (stmt);
- if (INTEGRAL_TYPE_P (type)
- && gimple_stmt_nonnegative_warnv_p (stmt, &sop))
+ /* If the call is __builtin_constant_p and the argument is a
+ function parameter resolve it to false. This avoids bogus
+ array bound warnings.
+ ??? We could do this as early as inlining is finished. */
+ if (gimple_call_builtin_p (stmt, BUILT_IN_CONSTANT_P))
+ {
+ tree arg = gimple_call_arg (stmt, 0);
+ if (TREE_CODE (arg) == SSA_NAME
+ && SSA_NAME_IS_DEFAULT_DEF (arg)
+ && TREE_CODE (SSA_NAME_VAR (arg)) == PARM_DECL)
+ set_value_range_to_null (vr, type);
+ }
+ else if (INTEGRAL_TYPE_P (type)
+ && gimple_stmt_nonnegative_warnv_p (stmt, &sop))
set_value_range_to_nonnegative (vr, type,
sop || stmt_overflow_infinity (stmt));
else if (vrp_stmt_computes_nonzero (stmt, &sop)
diff --git a/gcc/tree.c b/gcc/tree.c
index f0eabe5a99a..02cd9e8d226 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -7409,15 +7409,10 @@ build_array_type_1 (tree elt_type, tree index_type, bool shared)
if (shared)
{
- tree old_t = t;
hashval_t hashcode = iterative_hash_object (TYPE_HASH (elt_type), 0);
if (index_type)
hashcode = iterative_hash_object (TYPE_HASH (index_type), hashcode);
t = type_hash_canon (hashcode, t);
- if (t != old_t)
- /* Lay it out again in case the element type has been completed since
- the array was added to the hash table. */
- layout_type (t);
}
if (TYPE_CANONICAL (t) == t)
diff --git a/include/ChangeLog b/include/ChangeLog
index c04529bf0a4..bf7ea2aac95 100644
--- a/include/ChangeLog
+++ b/include/ChangeLog
@@ -1,3 +1,13 @@
+2013-01-30 Kai Tietz <ktietz@redhat.com>
+
+ Merged from trunk.
+
+ PR other/54620
+ PR target/39064
+ * md5.h (md5_uintptr, md5_uint32): Define as uintptr_t/uint32_t if
+ stdint.h and sys/types.h headers are present.
+ * sha1.h (sha1_uintptr, sha1_uint32): Likewise.
+
2012-09-20 Release Manager
* GCC 4.7.2 released.
diff --git a/include/md5.h b/include/md5.h
index b3ff4e14538..6da2fefe161 100644
--- a/include/md5.h
+++ b/include/md5.h
@@ -40,6 +40,11 @@
# include <sys/types.h>
typedef u_int32_t md5_uint32;
typedef uintptr_t md5_uintptr;
+#elif defined (HAVE_SYS_TYPES_H) && defined (HAVE_STDINT_H)
+#include <stdint.h>
+#include <sys/types.h>
+typedef uint32_t md5_uint32;
+typedef uintptr_t md5_uintptr;
#else
# define INT_MAX_32_BITS 2147483647
diff --git a/include/sha1.h b/include/sha1.h
index 5473f91f412..4da5c37f386 100644
--- a/include/sha1.h
+++ b/include/sha1.h
@@ -39,6 +39,11 @@
# include <sys/types.h>
typedef u_int32_t sha1_uint32;
typedef uintptr_t sha1_uintptr;
+#elif defined (HAVE_SYS_TYPES_H) && defined (HAVE_STDINT_H)
+#include <stdint.h>
+#include <sys/types.h>
+typedef uint32_t sha1_uint32;
+typedef uintptr_t sha1_uintptr;
#else
# define INT_MAX_32_BITS 2147483647
diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog
index 859760d5569..abeaf7be324 100644
--- a/libiberty/ChangeLog
+++ b/libiberty/ChangeLog
@@ -1,3 +1,22 @@
+2013-01-31 Kai Tietz <ktietz@redhat.com>
+
+ Merged from trunk
+ PR other/54620
+ * sha1.c (sha1_process_block): Handle case that size_t is
+ a wider-integer-scalar as a 32-bit unsigned integer.
+
+ Merged from trunk.
+ PR other/53413
+ * md5.c (md5_process_block): Handle case that size_t is
+ a wider-integer-scalar a 32-bit unsigned integer.
+
+ 2012-07-31 Mike Frysinger <vapier@gentoo.org>
+
+ Merged from trunk.
+ PR other/53285
+ * md5.c (md5_finish_ctx): Declare swap_bytes. Assign SWAP() output
+ to swap_bytes, and then call memcpy to move it to ctx->buffer.
+
2012-09-20 Release Manager
* GCC 4.7.2 released.
diff --git a/libiberty/md5.c b/libiberty/md5.c
index 0db8fc8936f..b30a6b7bfc5 100644
--- a/libiberty/md5.c
+++ b/libiberty/md5.c
@@ -103,6 +103,7 @@ md5_finish_ctx (struct md5_ctx *ctx, void *resbuf)
{
/* Take yet unprocessed bytes into account. */
md5_uint32 bytes = ctx->buflen;
+ md5_uint32 swap_bytes;
size_t pad;
/* Now count remaining bytes. */
@@ -113,10 +114,13 @@ md5_finish_ctx (struct md5_ctx *ctx, void *resbuf)
pad = bytes >= 56 ? 64 + 56 - bytes : 56 - bytes;
memcpy (&ctx->buffer[bytes], fillbuf, pad);
- /* Put the 64-bit file length in *bits* at the end of the buffer. */
- *(md5_uint32 *) &ctx->buffer[bytes + pad] = SWAP (ctx->total[0] << 3);
- *(md5_uint32 *) &ctx->buffer[bytes + pad + 4] = SWAP ((ctx->total[1] << 3) |
- (ctx->total[0] >> 29));
+ /* Put the 64-bit file length in *bits* at the end of the buffer.
+ Use memcpy to avoid aliasing problems. On most systems, this
+ will be optimized away to the same code. */
+ swap_bytes = SWAP (ctx->total[0] << 3);
+ memcpy (&ctx->buffer[bytes + pad], &swap_bytes, sizeof (swap_bytes));
+ swap_bytes = SWAP ((ctx->total[1] << 3) | (ctx->total[0] >> 29));
+ memcpy (&ctx->buffer[bytes + pad + 4], &swap_bytes, sizeof (swap_bytes));
/* Process last bytes. */
md5_process_block (ctx->buffer, bytes + pad + 8, ctx);
@@ -289,8 +293,7 @@ md5_process_block (const void *buffer, size_t len, struct md5_ctx *ctx)
length of the file up to 2^64 bits. Here we only compute the
number of bytes. Do a double word increment. */
ctx->total[0] += len;
- if (ctx->total[0] < len)
- ++ctx->total[1];
+ ctx->total[1] += ((len >> 31) >> 1) + (ctx->total[0] < len);
/* Process all bytes in the buffer with 64 bytes in each round of
the loop. */
diff --git a/libiberty/sha1.c b/libiberty/sha1.c
index 6a25ab23992..617e743a15e 100644
--- a/libiberty/sha1.c
+++ b/libiberty/sha1.c
@@ -300,8 +300,7 @@ sha1_process_block (const void *buffer, size_t len, struct sha1_ctx *ctx)
length of the file up to 2^64 bits. Here we only compute the
number of bytes. Do a double word increment. */
ctx->total[0] += len;
- if (ctx->total[0] < len)
- ++ctx->total[1];
+ ctx->total[1] += ((len >> 31) >> 1) + (ctx->total[0] < len);
#define rol(x, n) (((x) << (n)) | ((sha1_uint32) (x) >> (32 - (n))))
diff --git a/libjava/classpath/ChangeLog b/libjava/classpath/ChangeLog
index cc925176acd..93a7c02428f 100644
--- a/libjava/classpath/ChangeLog
+++ b/libjava/classpath/ChangeLog
@@ -1,3 +1,8 @@
+2013-01-10 Matthias Klose <doko@ubuntu.com>
+
+ * tools/gnu/classpath/tools/gjdoc/Main.java: Accept -source 1.5,
+ 1.6, 1.7.
+
2012-09-20 Release Manager
* GCC 4.7.2 released.
diff --git a/libjava/classpath/lib/gnu/gcj/convert/Convert.class b/libjava/classpath/lib/gnu/gcj/convert/Convert.class
index 2144fc8d847..7d7bd9c80f7 100644
--- a/libjava/classpath/lib/gnu/gcj/convert/Convert.class
+++ b/libjava/classpath/lib/gnu/gcj/convert/Convert.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/gcj/tools/gcj_dbtool/Main.class b/libjava/classpath/lib/gnu/gcj/tools/gcj_dbtool/Main.class
index 728256d0008..d3b6b2a046a 100644
--- a/libjava/classpath/lib/gnu/gcj/tools/gcj_dbtool/Main.class
+++ b/libjava/classpath/lib/gnu/gcj/tools/gcj_dbtool/Main.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/locale/LocaleData.class b/libjava/classpath/lib/gnu/java/locale/LocaleData.class
index ccee011a495..64d83fd1a9d 100644
--- a/libjava/classpath/lib/gnu/java/locale/LocaleData.class
+++ b/libjava/classpath/lib/gnu/java/locale/LocaleData.class
Binary files differ
diff --git a/libjava/classpath/lib/gnu/java/rmi/registry/RegistryImpl.class b/libjava/classpath/lib/gnu/java/rmi/registry/RegistryImpl.class
index 285ef414a2f..243f9ca2ac6 100644
--- a/libjava/classpath/lib/gnu/java/rmi/registry/RegistryImpl.class
+++ b/libjava/classpath/lib/gnu/java/rmi/registry/RegistryImpl.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$10.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$10.class
index 597a142cf50..90b91ae119c 100644
--- a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$10.class
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$10.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$11.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$11.class
index bf1c99a432e..23d85a77077 100644
--- a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$11.class
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$11.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$12.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$12.class
index 7bf3e4cb45f..dbdfaa2aefb 100644
--- a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$12.class
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$12.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$13.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$13.class
index 41645e8e9b4..c909614277b 100644
--- a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$13.class
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$13.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$14.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$14.class
index ed2e3427e9a..66aece4a282 100644
--- a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$14.class
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$14.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$15.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$15.class
index 68ec874477a..e28f48cb540 100644
--- a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$15.class
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$15.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$16.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$16.class
index 54fefac98b2..df9d6108652 100644
--- a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$16.class
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$16.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$17.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$17.class
index 81583d89783..ff343afd3c5 100644
--- a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$17.class
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$17.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$18.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$18.class
index a3952995909..37e1b3a68fd 100644
--- a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$18.class
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$18.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$19.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$19.class
index 61bf1f80899..ff2f0dcf3a1 100644
--- a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$19.class
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$19.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$20.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$20.class
index 5a9d8482806..1797ef1ad48 100644
--- a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$20.class
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$20.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$21.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$21.class
index 12a49837f2b..44c09cb459d 100644
--- a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$21.class
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$21.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$22.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$22.class
index 32e26ffa466..38f04fc0aae 100644
--- a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$22.class
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$22.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$23.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$23.class
index fd99e130d67..37388e45fb6 100644
--- a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$23.class
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$23.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$24.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$24.class
index 991629a166d..a577680d9ab 100644
--- a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$24.class
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$24.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$25.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$25.class
index 441b8dac273..41e4a2cf8fe 100644
--- a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$25.class
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$25.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main.class
index 2f46dd2828c..2e647b7c2b9 100644
--- a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main.class
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/orbd/Main$1.class b/libjava/classpath/tools/classes/gnu/classpath/tools/orbd/Main$1.class
index 81975151a3c..a93676b308f 100644
--- a/libjava/classpath/tools/classes/gnu/classpath/tools/orbd/Main$1.class
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/orbd/Main$1.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/orbd/Main$2.class b/libjava/classpath/tools/classes/gnu/classpath/tools/orbd/Main$2.class
index f87a12e80d1..2e73084c919 100644
--- a/libjava/classpath/tools/classes/gnu/classpath/tools/orbd/Main$2.class
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/orbd/Main$2.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/orbd/Main$3.class b/libjava/classpath/tools/classes/gnu/classpath/tools/orbd/Main$3.class
index f5a91597b31..c785c7a3e43 100644
--- a/libjava/classpath/tools/classes/gnu/classpath/tools/orbd/Main$3.class
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/orbd/Main$3.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/orbd/Main$4.class b/libjava/classpath/tools/classes/gnu/classpath/tools/orbd/Main$4.class
index df3cba93009..31d7a46c00b 100644
--- a/libjava/classpath/tools/classes/gnu/classpath/tools/orbd/Main$4.class
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/orbd/Main$4.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/orbd/Main$5.class b/libjava/classpath/tools/classes/gnu/classpath/tools/orbd/Main$5.class
index 0c082d0d0de..04b7561333f 100644
--- a/libjava/classpath/tools/classes/gnu/classpath/tools/orbd/Main$5.class
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/orbd/Main$5.class
Binary files differ
diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/orbd/Main.class b/libjava/classpath/tools/classes/gnu/classpath/tools/orbd/Main.class
index 53468e34872..ee1af075f39 100644
--- a/libjava/classpath/tools/classes/gnu/classpath/tools/orbd/Main.class
+++ b/libjava/classpath/tools/classes/gnu/classpath/tools/orbd/Main.class
Binary files differ
diff --git a/libjava/classpath/tools/gnu/classpath/tools/gjdoc/Main.java b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/Main.java
index ce9e96d820b..5a07df30fa4 100644
--- a/libjava/classpath/tools/gnu/classpath/tools/gjdoc/Main.java
+++ b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/Main.java
@@ -1337,12 +1337,17 @@ public final class Main
void process(String[] args)
{
option_source = args[0];
- if (!"1.2".equals(option_source)
+ if ("1.5".equals(option_source)
+ || "1.6".equals(option_source)
+ || "1.7".equals(option_source)) {
+ System.err.println("WARNING: support for option -source " + option_source + " is experimental");
+ }
+ else if (!"1.2".equals(option_source)
&& !"1.3".equals(option_source)
&& !"1.4".equals(option_source)) {
- throw new RuntimeException("Only he following values are currently"
- + " supported for option -source: 1.2, 1.3, 1.4.");
+ throw new RuntimeException("Only the following values are currently"
+ + " supported for option -source: 1.2, 1.3, 1.4; experimental: 1.5, 1.6, 1.7.");
}
}
});
diff --git a/libquadmath/ChangeLog b/libquadmath/ChangeLog
index f5cc38e55a2..ea2a0a7ace9 100644
--- a/libquadmath/ChangeLog
+++ b/libquadmath/ChangeLog
@@ -1,3 +1,11 @@
+2013-02-01 Jakub Jelinek <jakub@redhat.com>
+
+ Backported from mainline
+ 2013-01-22 Jakub Jelinek <jakub@redhat.com>
+
+ PR libquadmath/56072
+ * libquadmath.texi (M_PI_2q, M_PI_4q): Fix up description.
+
2012-09-20 Release Manager
* GCC 4.7.2 released.
diff --git a/libquadmath/libquadmath.texi b/libquadmath/libquadmath.texi
index 1ce245e8e69..c499d187483 100644
--- a/libquadmath/libquadmath.texi
+++ b/libquadmath/libquadmath.texi
@@ -123,8 +123,8 @@ The following mathematical constants of type @code{__float128} are defined.
@item @code{M_LN2q}: natural logarithm of 2
@item @code{M_LN10q}: natural logarithm of 10
@item @code{M_PIq}: pi
-@item @code{M_PI_2q}: two pi
-@item @code{M_PI_4q}: four pi
+@item @code{M_PI_2q}: pi divided by two
+@item @code{M_PI_4q}: pi divided by four
@item @code{M_1_PIq}: one over pi
@item @code{M_2_PIq}: one over two pi
@item @code{M_2_SQRTPIq}: two over square root of pi
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index 0a789d4ede5..cf83522da8b 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,3 +1,22 @@
+2013-01-24 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR libstdc++/56085
+ * include/std/complex (pow(const complex<>&, int)): Avoid __n
+ signed overflow.
+
+2013-01-17 Jonathan Wakely <jwakely.gcc@gmail.com>
+
+ PR libstdc++/52887
+ * src/c++11/regex.cc: Add instantiations for AIX.
+
+2013-01-08 Jonathan Wakely <jwakely.gcc@gmail.com>
+
+ * doc/xml/manual/status_cxx2011.xml: Document that N3189 is missing.
+
+2013-01-06 Jonathan Wakely <jwakely.gcc@gmail.com>
+
+ * doc/xml/manual/abi.xml: Update library and symbol versions.
+
2012-12-18 Matthew Gretton-Dann <matthew.gretton-dann@linaro.org>
Backport from mainline
diff --git a/libstdc++-v3/doc/xml/manual/abi.xml b/libstdc++-v3/doc/xml/manual/abi.xml
index cd058960eed..3fb5fa8de35 100644
--- a/libstdc++-v3/doc/xml/manual/abi.xml
+++ b/libstdc++-v3/doc/xml/manual/abi.xml
@@ -271,6 +271,7 @@ compatible.
<listitem><para>GCC 4.5.0: libstdc++.so.6.0.14</para></listitem>
<listitem><para>GCC 4.6.0: libstdc++.so.6.0.15</para></listitem>
<listitem><para>GCC 4.6.1: libstdc++.so.6.0.16</para></listitem>
+ <listitem><para>GCC 4.7.0: libstdc++.so.6.0.17</para></listitem>
</itemizedlist>
<para>
Note 1: Error should be libstdc++.so.3.0.3.
@@ -332,6 +333,7 @@ compatible.
<listitem><para>GCC 4.5.0: GLIBCXX_3.4.14, CXXABI_1.3.4</para></listitem>
<listitem><para>GCC 4.6.0: GLIBCXX_3.4.15, CXXABI_1.3.5</para></listitem>
<listitem><para>GCC 4.6.1: GLIBCXX_3.4.16, CXXABI_1.3.5</para></listitem>
+ <listitem><para>GCC 4.7.0: GLIBCXX_3.4.17, CXXABI_1.3.6</para></listitem>
</itemizedlist>
</listitem>
@@ -449,13 +451,19 @@ compatible.
<listitem><para>GCC 4.4.4: 20100429</para></listitem>
<listitem><para>GCC 4.4.5: 20101001</para></listitem>
<listitem><para>GCC 4.4.6: 20110416</para></listitem>
+ <listitem><para>GCC 4.4.7: 20120313</para></listitem>
<listitem><para>GCC 4.5.0: 20100414</para></listitem>
<listitem><para>GCC 4.5.1: 20100731</para></listitem>
<listitem><para>GCC 4.5.2: 20101216</para></listitem>
<listitem><para>GCC 4.5.3: 20110428</para></listitem>
+ <listitem><para>GCC 4.5.4: 20120702</para></listitem>
<listitem><para>GCC 4.6.0: 20110325</para></listitem>
<listitem><para>GCC 4.6.1: 20110627</para></listitem>
<listitem><para>GCC 4.6.2: 20111026</para></listitem>
+ <listitem><para>GCC 4.6.3: 20120301</para></listitem>
+ <listitem><para>GCC 4.7.0: 20120322</para></listitem>
+ <listitem><para>GCC 4.7.1: 20120614</para></listitem>
+ <listitem><para>GCC 4.7.2: 20120920</para></listitem>
</itemizedlist>
<para/>
</listitem>
diff --git a/libstdc++-v3/doc/xml/manual/status_cxx2011.xml b/libstdc++-v3/doc/xml/manual/status_cxx2011.xml
index 0ed63eab7be..e26db6ff910 100644
--- a/libstdc++-v3/doc/xml/manual/status_cxx2011.xml
+++ b/libstdc++-v3/doc/xml/manual/status_cxx2011.xml
@@ -158,10 +158,13 @@ particular release.
<entry>C library dependency for quick_exit, at_quick_exit</entry>
</row>
<row>
+ <?dbhtml bgcolor="#B0B0B0" ?>
<entry>18.6</entry>
<entry>Dynamic memory management</entry>
- <entry>Y</entry>
- <entry/>
+ <entry>Partial</entry>
+ <entry>Missing <code>get_new_handler</code>.
+ <code>set_new_handler</code> is not thread-safe.
+ </entry>
</row>
<row>
<entry>18.7</entry>
@@ -206,10 +209,13 @@ particular release.
<entry/>
</row>
<row>
+ <?dbhtml bgcolor="#B0B0B0" ?>
<entry>18.8.3</entry>
<entry>Abnormal termination</entry>
- <entry>Y</entry>
- <entry/>
+ <entry>Partial</entry>
+ <entry>Missing <code>get_terminate</code>.
+ <code>set_terminate</code> is not thread-safe.
+ </entry>
</row>
<row>
<entry>18.8.4</entry>
@@ -2606,10 +2612,13 @@ particular release.
<entry/>
</row>
<row>
+ <?dbhtml bgcolor="#B0B0B0" ?>
<entry>D.11</entry>
<entry>Violating exception-specifications</entry>
- <entry/>
- <entry/>
+ <entry>Partial</entry>
+ <entry>Missing <code>get_unexpected</code>.
+ <code>set_unexpected</code> is not thread-safe.
+ </entry>
</row>
</tbody>
diff --git a/libstdc++-v3/include/std/complex b/libstdc++-v3/include/std/complex
index c0e333117de..8ef7acb2436 100644
--- a/libstdc++-v3/include/std/complex
+++ b/libstdc++-v3/include/std/complex
@@ -1,8 +1,6 @@
// The template and inlines for the -*- C++ -*- complex number classes.
-// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
-// 2006, 2007, 2008, 2009, 2010, 2011
-// Free Software Foundation, Inc.
+// Copyright (C) 1997-2013 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
@@ -976,7 +974,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
pow(const complex<_Tp>& __z, int __n)
{
return __n < 0
- ? complex<_Tp>(1) / std::__complex_pow_unsigned(__z, -__n)
+ ? complex<_Tp>(1) / std::__complex_pow_unsigned(__z, -(unsigned)__n)
: std::__complex_pow_unsigned(__z, __n);
}
#endif
diff --git a/libstdc++-v3/src/c++11/regex.cc b/libstdc++-v3/src/c++11/regex.cc
index 8a47da341ae..d21f22176fb 100644
--- a/libstdc++-v3/src/c++11/regex.cc
+++ b/libstdc++-v3/src/c++11/regex.cc
@@ -1,6 +1,6 @@
// regex -*- C++ -*-
-// Copyright (C) 2011 Free Software Foundation, Inc.
+// Copyright (C) 2011-2013 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
@@ -34,5 +34,12 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
regex_error::~regex_error() throw() { }
+#ifdef _AIX
+ // PR libstdc++/52887
+ template class function<void (__regex::_PatternCursor const&,
+ __regex::_Results&)>;
+ template class function<bool (__regex::_PatternCursor const&)>;
+#endif
+
_GLIBCXX_END_NAMESPACE_VERSION
} // namespace std